From owner-svn-src-head@FreeBSD.ORG Sun Mar 15 01:38:37 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7455A106566C; Sun, 15 Mar 2009 01:38:37 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6340D8FC12; Sun, 15 Mar 2009 01:38:37 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2F1cbTe013508; Sun, 15 Mar 2009 01:38:37 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2F1cbHF013507; Sun, 15 Mar 2009 01:38:37 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200903150138.n2F1cbHF013507@svn.freebsd.org> From: Sam Leffler Date: Sun, 15 Mar 2009 01:38:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r189841 - head/contrib/wpa/hostapd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 15 Mar 2009 01:38:37 -0000 Author: sam Date: Sun Mar 15 01:38:37 2009 New Revision: 189841 URL: http://svn.freebsd.org/changeset/base/189841 Log: remove gcc-ism; tsinfo isn't used anyway Modified: head/contrib/wpa/hostapd/wme.h Modified: head/contrib/wpa/hostapd/wme.h ============================================================================== --- head/contrib/wpa/hostapd/wme.h Sat Mar 14 23:59:53 2009 (r189840) +++ head/contrib/wpa/hostapd/wme.h Sun Mar 15 01:38:37 2009 (r189841) @@ -27,7 +27,7 @@ * defined(__DragonFly__) */ -extern inline u16 tsinfo(int tag1d, int contention_based, int direction) +static inline u16 tsinfo(int tag1d, int contention_based, int direction) { return (tag1d << 11) | (contention_based << 7) | (direction << 5) | (tag1d << 1); From owner-svn-src-head@FreeBSD.ORG Sun Mar 15 01:39:16 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DE5BA106566C; Sun, 15 Mar 2009 01:39:16 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B36C98FC16; Sun, 15 Mar 2009 01:39:16 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2F1dGcm013557; Sun, 15 Mar 2009 01:39:16 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2F1dGdw013556; Sun, 15 Mar 2009 01:39:16 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200903150139.n2F1dGdw013556@svn.freebsd.org> From: Sam Leffler Date: Sun, 15 Mar 2009 01:39:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r189842 - head/usr.sbin/wpa X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 15 Mar 2009 01:39:17 -0000 Author: sam Date: Sun Mar 15 01:39:16 2009 New Revision: 189842 URL: http://svn.freebsd.org/changeset/base/189842 Log: no need to for gnu89 any more Modified: head/usr.sbin/wpa/Makefile.inc Modified: head/usr.sbin/wpa/Makefile.inc ============================================================================== --- head/usr.sbin/wpa/Makefile.inc Sun Mar 15 01:38:37 2009 (r189841) +++ head/usr.sbin/wpa/Makefile.inc Sun Mar 15 01:39:16 2009 (r189842) @@ -24,6 +24,4 @@ CFLAGS+=-I${WPA_DISTDIR}/src/utils CFLAGS+= -DCONFIG_CTRL_IFACE CFLAGS+= -DCONFIG_CTRL_IFACE_UNIX -CSTD= gnu89 # XXX - .include From owner-svn-src-head@FreeBSD.ORG Sun Mar 15 02:31:35 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 11DD4106564A; Sun, 15 Mar 2009 02:31:35 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D9EF08FC12; Sun, 15 Mar 2009 02:31:34 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2F2VY98014528; Sun, 15 Mar 2009 02:31:34 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2F2VYTg014527; Sun, 15 Mar 2009 02:31:34 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200903150231.n2F2VYTg014527@svn.freebsd.org> From: Warner Losh Date: Sun, 15 Mar 2009 02:31: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: r189843 - head/sys/dev/fe X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 15 Mar 2009 02:31:35 -0000 Author: imp Date: Sun Mar 15 02:31:34 2009 New Revision: 189843 URL: http://svn.freebsd.org/changeset/base/189843 Log: Generalize the workaround for the Hitachi HT-4840-11. The Contec C-NET(PC) has a cfe at location 1 that has both an odd irq mask (it matches pc98 machines, so maybe it was a flag for pc98 operation) as well as a memory map. Since this driver doesn't know how to cope, we start with cfe2, which is purely an I/O space mapped and that seems to make it work. I say 'seems' here, because the card I have doesn't seem to have the right dongle for full testing... Modified: head/sys/dev/fe/if_fe_pccard.c Modified: head/sys/dev/fe/if_fe_pccard.c ============================================================================== --- head/sys/dev/fe/if_fe_pccard.c Sun Mar 15 01:39:16 2009 (r189842) +++ head/sys/dev/fe/if_fe_pccard.c Sun Mar 15 02:31:34 2009 (r189843) @@ -62,9 +62,10 @@ static int fe_pccard_detach(device_t); static const struct fe_pccard_product { struct pccard_product mpp_product; int mpp_flags; + int mpp_cfe; #define MPP_MBH10302 1 #define MPP_ANYFUNC 2 -#define MPP_SKIP_TO_CFE_10 4 +#define MPP_SKIP_TO_CFE 4 } fe_pccard_products[] = { /* These need to be first */ { PCMCIA_CARD(FUJITSU2, FMV_J181), MPP_MBH10302 }, @@ -77,11 +78,11 @@ static const struct fe_pccard_product { #if 0 /* XXX 86960-based? */ { PCMCIA_CARD(TDK, LAK_DFL9610), 0 }, #endif - { PCMCIA_CARD(CONTEC, CNETPC), 0 }, + { PCMCIA_CARD(CONTEC, CNETPC), MPP_SKIP_TO_CFE, 2 }, { PCMCIA_CARD(FUJITSU, LA501), 0 }, { PCMCIA_CARD(FUJITSU, LA10S), 0 }, { PCMCIA_CARD(FUJITSU, NE200T), MPP_MBH10302 },/* Sold by Eagle */ - { PCMCIA_CARD(HITACHI, HT_4840), MPP_MBH10302 | MPP_SKIP_TO_CFE_10}, + { PCMCIA_CARD(HITACHI, HT_4840), MPP_MBH10302 | MPP_SKIP_TO_CFE, 10 }, { PCMCIA_CARD(RATOC, REX_R280), 0 }, { PCMCIA_CARD(XIRCOM, CE), MPP_ANYFUNC }, { { NULL } } @@ -108,13 +109,13 @@ fe_pccard_probe(device_t dev) return (error); if (fcn != PCCARD_FUNCTION_NETWORK) return (ENXIO); - if (pp->mpp_flags & MPP_SKIP_TO_CFE_10) { - for (i = 10; i < 27; i++) { + if (pp->mpp_flags & MPP_SKIP_TO_CFE) { + for (i = pp->mpp_cfe; i < 32; i++) { if (pccard_select_cfe(dev, i) == 0) goto good; } device_printf(dev, - "Hitachi HT-4840-11 workaround failed\n"); + "Failed to map CFE %d or higher\n", pp->mpp_cfe); return ENXIO; } good:; From owner-svn-src-head@FreeBSD.ORG Sun Mar 15 06:40:58 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 47F67106566C; Sun, 15 Mar 2009 06:40:58 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 36C2C8FC1D; Sun, 15 Mar 2009 06:40:58 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2F6ew3q019350; Sun, 15 Mar 2009 06:40:58 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2F6ewKh019349; Sun, 15 Mar 2009 06:40:58 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200903150640.n2F6ewKh019349@svn.freebsd.org> From: Warner Losh Date: Sun, 15 Mar 2009 06:40: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: r189844 - head/sys/dev/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: Sun, 15 Mar 2009 06:40:58 -0000 Author: imp Date: Sun Mar 15 06:40:57 2009 New Revision: 189844 URL: http://svn.freebsd.org/changeset/base/189844 Log: Don't adjust ranges at all for subtractive bridges. The simple-minded stuff we're doing is too simple-minded, so back it out for now. Modified: head/sys/dev/pci/pci_pci.c Modified: head/sys/dev/pci/pci_pci.c ============================================================================== --- head/sys/dev/pci/pci_pci.c Sun Mar 15 02:31:34 2009 (r189843) +++ head/sys/dev/pci/pci_pci.c Sun Mar 15 06:40:57 2009 (r189844) @@ -413,12 +413,14 @@ pcib_alloc_resource(device_t dev, device } } else { ok = 1; +#if 0 /* * If we overlap with the subtractive range, then * pick the upper range to use. */ if (start < sc->iolimit && end > sc->iobase) start = sc->iolimit + 1; +#endif } if (end < start) { device_printf(dev, "ioport: end (%lx) < start (%lx)\n", @@ -478,6 +480,7 @@ pcib_alloc_resource(device_t dev, device } } else if (!ok) { ok = 1; /* subtractive bridge: always ok */ +#if 0 if (pcib_is_nonprefetch_open(sc)) { if (start < sc->memlimit && end > sc->membase) start = sc->memlimit + 1; @@ -486,6 +489,7 @@ pcib_alloc_resource(device_t dev, device if (start < sc->pmemlimit && end > sc->pmembase) start = sc->pmemlimit + 1; } +#endif } if (end < start) { device_printf(dev, "memory: end (%lx) < start (%lx)\n", From owner-svn-src-head@FreeBSD.ORG Sun Mar 15 06:41:47 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E5E621065673; Sun, 15 Mar 2009 06:41:47 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D37188FC17; Sun, 15 Mar 2009 06:41:47 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2F6fl6m019402; Sun, 15 Mar 2009 06:41:47 GMT (envelope-from jeff@svn.freebsd.org) Received: (from jeff@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2F6fluw019399; Sun, 15 Mar 2009 06:41:47 GMT (envelope-from jeff@svn.freebsd.org) Message-Id: <200903150641.n2F6fluw019399@svn.freebsd.org> From: Jeff Roberson Date: Sun, 15 Mar 2009 06:41: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: r189845 - 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: Sun, 15 Mar 2009 06:41:48 -0000 Author: jeff Date: Sun Mar 15 06:41:47 2009 New Revision: 189845 URL: http://svn.freebsd.org/changeset/base/189845 Log: - Implement a new mechanism for resetting lock profiling. We now guarantee that all cpus have acknowledged the cleared enable int by scheduling the resetting thread on each cpu in succession. Since all lock profiling happens within a critical section this guarantees that all cpus have left lock profiling before we clear the datastructures. - Assert that the per-thread queue of locks lock profiling is aware of is clear on thread exit. There were several cases where this was not true that slows lock profiling and leaks information. - Remove all objects from all lists before clearing any per-cpu information in reset. Lock profiling objects can migrate between per-cpu caches and previously these migrated objects could be zero'd before they'd been removed Discussed with: attilio Sponsored by: Nokia Modified: head/sys/kern/kern_thread.c head/sys/kern/subr_lock.c head/sys/sys/lock_profile.h Modified: head/sys/kern/kern_thread.c ============================================================================== --- head/sys/kern/kern_thread.c Sun Mar 15 06:40:57 2009 (r189844) +++ head/sys/kern/kern_thread.c Sun Mar 15 06:41:47 2009 (r189845) @@ -306,6 +306,8 @@ thread_alloc(void) void thread_free(struct thread *td) { + + lock_profile_thread_exit(td); if (td->td_cpuset) cpuset_rel(td->td_cpuset); td->td_cpuset = NULL; @@ -439,6 +441,7 @@ thread_wait(struct proc *p) /* Wait for any remaining threads to exit cpu_throw(). */ while (p->p_exitthreads) sched_relinquish(curthread); + lock_profile_thread_exit(td); cpuset_rel(td->td_cpuset); td->td_cpuset = NULL; cpu_thread_clean(td); Modified: head/sys/kern/subr_lock.c ============================================================================== --- head/sys/kern/subr_lock.c Sun Mar 15 06:40:57 2009 (r189844) +++ head/sys/kern/subr_lock.c Sun Mar 15 06:41:47 2009 (r189845) @@ -46,9 +46,11 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include +#include #include #include @@ -186,7 +188,8 @@ struct lock_prof_cpu { struct lock_prof_cpu *lp_cpu[MAXCPU]; -int lock_prof_enable = 0; +volatile int lock_prof_enable = 0; +static volatile int lock_prof_resetting; /* SWAG: sbuf size = avg stat. line size * number of locks */ #define LPROF_SBUF_SIZE 256 * 400 @@ -239,25 +242,77 @@ lock_prof_init(void *arg) } SYSINIT(lockprof, SI_SUB_SMP, SI_ORDER_ANY, lock_prof_init, NULL); +/* + * To be certain that lock profiling has idled on all cpus before we + * reset, we schedule the resetting thread on all active cpus. Since + * all operations happen within critical sections we can be sure that + * it is safe to zero the profiling structures. + */ +static void +lock_prof_idle(void) +{ + struct thread *td; + int cpu; + + td = curthread; + thread_lock(td); + for (cpu = 0; cpu <= mp_maxid; cpu++) { + if (CPU_ABSENT(cpu)) + continue; + sched_bind(td, cpu); + } + sched_unbind(td); + thread_unlock(td); +} + +static void +lock_prof_reset_wait(void) +{ + + /* + * Spin relinquishing our cpu so that lock_prof_idle may + * run on it. + */ + while (lock_prof_resetting) + sched_relinquish(curthread); +} + static void lock_prof_reset(void) { struct lock_prof_cpu *lpc; int enabled, i, cpu; + /* + * We not only race with acquiring and releasing locks but also + * thread exit. To be certain that threads exit without valid head + * pointers they must see resetting set before enabled is cleared. + * Otherwise a lock may not be removed from a per-thread list due + * to disabled being set but not wait for reset() to remove it below. + */ + atomic_store_rel_int(&lock_prof_resetting, 1); enabled = lock_prof_enable; lock_prof_enable = 0; - pause("lpreset", hz / 10); + lock_prof_idle(); + /* + * Some objects may have migrated between CPUs. Clear all links + * before we zero the structures. Some items may still be linked + * into per-thread lists as well. + */ for (cpu = 0; cpu <= mp_maxid; cpu++) { lpc = lp_cpu[cpu]; for (i = 0; i < LPROF_CACHE_SIZE; i++) { LIST_REMOVE(&lpc->lpc_types[0].lpt_objs[i], lpo_link); LIST_REMOVE(&lpc->lpc_types[1].lpt_objs[i], lpo_link); } + } + for (cpu = 0; cpu <= mp_maxid; cpu++) { + lpc = lp_cpu[cpu]; bzero(lpc, sizeof(*lpc)); lock_prof_init_type(&lpc->lpc_types[0]); lock_prof_init_type(&lpc->lpc_types[1]); } + atomic_store_rel_int(&lock_prof_resetting, 0); lock_prof_enable = enabled; } @@ -351,7 +406,7 @@ retry_sbufops: "max", "wait_max", "total", "wait_total", "count", "avg", "wait_avg", "cnt_hold", "cnt_lock", "name"); enabled = lock_prof_enable; lock_prof_enable = 0; - pause("lpreset", hz / 10); + lock_prof_idle(); t = ticks; for (cpu = 0; cpu <= mp_maxid; cpu++) { if (lp_cpu[cpu] == NULL) @@ -461,16 +516,13 @@ lock_profile_object_lookup(struct lock_o if (l->lpo_obj == lo && l->lpo_file == file && l->lpo_line == line) return (l); - critical_enter(); type = &lp_cpu[PCPU_GET(cpuid)]->lpc_types[spin]; l = LIST_FIRST(&type->lpt_lpoalloc); if (l == NULL) { lock_prof_rejected++; - critical_exit(); return (NULL); } LIST_REMOVE(l, lpo_link); - critical_exit(); l->lpo_obj = lo; l->lpo_file = file; l->lpo_line = line; @@ -497,18 +549,49 @@ lock_profile_obtain_lock_success(struct spin = (LOCK_CLASS(lo)->lc_flags & LC_SPINLOCK) ? 1 : 0; if (spin && lock_prof_skipspin == 1) return; + critical_enter(); + /* Recheck enabled now that we're in a critical section. */ + if (lock_prof_enable == 0) + goto out; l = lock_profile_object_lookup(lo, spin, file, line); if (l == NULL) - return; + goto out; l->lpo_cnt++; if (++l->lpo_ref > 1) - return; + goto out; l->lpo_contest_locking = contested; l->lpo_acqtime = nanoseconds(); if (waittime && (l->lpo_acqtime > waittime)) l->lpo_waittime = l->lpo_acqtime - waittime; else l->lpo_waittime = 0; +out: + critical_exit(); +} + +void +lock_profile_thread_exit(struct thread *td) +{ +#ifdef INVARIANTS + struct lock_profile_object *l; + + MPASS(curthread->td_critnest == 0); +#endif + /* + * If lock profiling was disabled we have to wait for reset to + * clear our pointers before we can exit safely. + */ + lock_prof_reset_wait(); +#ifdef INVARIANTS + LIST_FOREACH(l, &td->td_lprof[0], lpo_link) + printf("thread still holds lock acquired at %s:%d\n", + l->lpo_file, l->lpo_line); + LIST_FOREACH(l, &td->td_lprof[1], lpo_link) + printf("thread still holds lock acquired at %s:%d\n", + l->lpo_file, l->lpo_line); +#endif + MPASS(LIST_FIRST(&td->td_lprof[0]) == NULL); + MPASS(LIST_FIRST(&td->td_lprof[1]) == NULL); } void @@ -521,11 +604,20 @@ lock_profile_release_lock(struct lock_ob struct lpohead *head; int spin; - if (!lock_prof_enable || (lo->lo_flags & LO_NOPROFILE)) + if (lo->lo_flags & LO_NOPROFILE) return; spin = (LOCK_CLASS(lo)->lc_flags & LC_SPINLOCK) ? 1 : 0; head = &curthread->td_lprof[spin]; + if (LIST_FIRST(head) == NULL) + return; critical_enter(); + /* Recheck enabled now that we're in a critical section. */ + if (lock_prof_enable == 0 && lock_prof_resetting == 1) + goto out; + /* + * If lock profiling is not enabled we still want to remove the + * lpo from our queue. + */ LIST_FOREACH(l, head, lpo_link) if (l->lpo_obj == lo) break; Modified: head/sys/sys/lock_profile.h ============================================================================== --- head/sys/sys/lock_profile.h Sun Mar 15 06:40:57 2009 (r189844) +++ head/sys/sys/lock_profile.h Sun Mar 15 06:41:47 2009 (r189845) @@ -43,11 +43,13 @@ LIST_HEAD(lpohead, lock_profile_object); u_int64_t nanoseconds(void); #endif -extern int lock_prof_enable; +extern volatile int lock_prof_enable; void lock_profile_obtain_lock_success(struct lock_object *lo, int contested, uint64_t waittime, const char *file, int line); void lock_profile_release_lock(struct lock_object *lo); +void lock_profile_thread_exit(struct thread *td); + static inline void lock_profile_obtain_lock_failed(struct lock_object *lo, int *contested, @@ -61,21 +63,10 @@ lock_profile_obtain_lock_failed(struct l #else /* !LOCK_PROFILING */ -static inline void -lock_profile_release_lock(struct lock_object *lo) -{ -} - -static inline void -lock_profile_obtain_lock_failed(struct lock_object *lo, int *contested, uint64_t *waittime) -{ -} - -static inline void -lock_profile_obtain_lock_success(struct lock_object *lo, int contested, uint64_t waittime, - const char *file, int line) -{ -} +#define lock_profile_release_lock(lo) +#define lock_profile_obtain_lock_failed(lo, contested, waittime) +#define lock_profile_obtain_lock_success(lo, contested, waittime, file, line) +#define lock_profile_thread_exit(td) #endif /* !LOCK_PROFILING */ From owner-svn-src-head@FreeBSD.ORG Sun Mar 15 08:03:55 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 68DB6106564A; Sun, 15 Mar 2009 08:03:55 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 573938FC1C; Sun, 15 Mar 2009 08:03:55 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2F83tlv020937; Sun, 15 Mar 2009 08:03:55 GMT (envelope-from jeff@svn.freebsd.org) Received: (from jeff@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2F83tVk020933; Sun, 15 Mar 2009 08:03:55 GMT (envelope-from jeff@svn.freebsd.org) Message-Id: <200903150803.n2F83tVk020933@svn.freebsd.org> From: Jeff Roberson Date: Sun, 15 Mar 2009 08:03:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r189846 - 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: Sun, 15 Mar 2009 08:03:56 -0000 Author: jeff Date: Sun Mar 15 08:03:54 2009 New Revision: 189846 URL: http://svn.freebsd.org/changeset/base/189846 Log: - Wrap lock profiling state variables in #ifdef LOCK_PROFILING blocks. Modified: head/sys/kern/kern_lock.c head/sys/kern/kern_mutex.c head/sys/kern/kern_rwlock.c head/sys/kern/kern_sx.c Modified: head/sys/kern/kern_lock.c ============================================================================== --- head/sys/kern/kern_lock.c Sun Mar 15 06:41:47 2009 (r189845) +++ head/sys/kern/kern_lock.c Sun Mar 15 08:03:54 2009 (r189846) @@ -333,16 +333,17 @@ __lockmgr_args(struct lock *lk, u_int fl const char *wmesg, int pri, int timo, const char *file, int line) { GIANT_DECLARE; - uint64_t waittime; struct lock_class *class; const char *iwmesg; uintptr_t tid, v, x; u_int op; - int contested, error, ipri, itimo, queue, wakeup_swapper; + int error, ipri, itimo, queue, wakeup_swapper; +#ifdef LOCK_PROFILING + uint64_t waittime = 0; + int contested = 0; +#endif - contested = 0; error = 0; - waittime = 0; tid = (uintptr_t)curthread; op = (flags & LK_TYPE_MASK); iwmesg = (wmesg == LK_WMESG_DEFAULT) ? lk->lock_object.lo_name : wmesg; Modified: head/sys/kern/kern_mutex.c ============================================================================== --- head/sys/kern/kern_mutex.c Sun Mar 15 06:41:47 2009 (r189845) +++ head/sys/kern/kern_mutex.c Sun Mar 15 08:03:54 2009 (r189846) @@ -254,8 +254,11 @@ _mtx_unlock_spin_flags(struct mtx *m, in int _mtx_trylock(struct mtx *m, int opts, const char *file, int line) { - int rval, contested = 0; +#ifdef LOCK_PROFILING uint64_t waittime = 0; + int contested = 0; +#endif + int rval; MPASS(curthread != NULL); KASSERT(m->mtx_lock != MTX_DESTROYED, @@ -296,15 +299,17 @@ _mtx_lock_sleep(struct mtx *m, uintptr_t int line) { struct turnstile *ts; + uintptr_t v; #ifdef ADAPTIVE_MUTEXES volatile struct thread *owner; #endif #ifdef KTR int cont_logged = 0; #endif +#ifdef LOCK_PROFILING int contested = 0; uint64_t waittime = 0; - uintptr_t v; +#endif if (mtx_owned(m)) { KASSERT((m->lock_object.lo_flags & LO_RECURSABLE) != 0, @@ -448,8 +453,11 @@ void _mtx_lock_spin(struct mtx *m, uintptr_t tid, int opts, const char *file, int line) { - int i = 0, contested = 0; + int i = 0; +#ifdef LOCK_PROFILING + int contested = 0; uint64_t waittime = 0; +#endif if (LOCK_LOG_TEST(&m->lock_object, opts)) CTR1(KTR_LOCK, "_mtx_lock_spin: %p spinning", m); @@ -486,11 +494,13 @@ _thread_lock_flags(struct thread *td, in { struct mtx *m; uintptr_t tid; - int i, contested; - uint64_t waittime; + int i; +#ifdef LOCK_PROFILING + int contested = 0; + uint64_t waittime = 0; +#endif - contested = i = 0; - waittime = 0; + i = 0; tid = (uintptr_t)curthread; for (;;) { retry: Modified: head/sys/kern/kern_rwlock.c ============================================================================== --- head/sys/kern/kern_rwlock.c Sun Mar 15 06:41:47 2009 (r189845) +++ head/sys/kern/kern_rwlock.c Sun Mar 15 08:03:54 2009 (r189846) @@ -282,8 +282,10 @@ _rw_rlock(struct rwlock *rw, const char int spintries = 0; int i; #endif +#ifdef LOCK_PROFILING uint64_t waittime = 0; int contested = 0; +#endif uintptr_t v; KASSERT(rw->rw_lock != RW_DESTROYED, @@ -584,9 +586,11 @@ _rw_wlock_hard(struct rwlock *rw, uintpt int spintries = 0; int i; #endif - uint64_t waittime = 0; uintptr_t v, x; +#ifdef LOCK_PROFILING + uint64_t waittime = 0; int contested = 0; +#endif if (rw_wlocked(rw)) { KASSERT(rw->lock_object.lo_flags & RW_RECURSE, Modified: head/sys/kern/kern_sx.c ============================================================================== --- head/sys/kern/kern_sx.c Sun Mar 15 06:41:47 2009 (r189845) +++ head/sys/kern/kern_sx.c Sun Mar 15 08:03:54 2009 (r189846) @@ -431,9 +431,12 @@ _sx_xlock_hard(struct sx *sx, uintptr_t #ifdef ADAPTIVE_SX volatile struct thread *owner; #endif - uint64_t waittime = 0; uintptr_t x; - int contested = 0, error = 0; +#ifdef LOCK_PROFILING + uint64_t waittime = 0; + int contested = 0; +#endif + int error = 0; /* If we already hold an exclusive lock, then recurse. */ if (sx_xlocked(sx)) { @@ -652,8 +655,10 @@ _sx_slock_hard(struct sx *sx, int opts, #ifdef ADAPTIVE_SX volatile struct thread *owner; #endif +#ifdef LOCK_PROFILING uint64_t waittime = 0; int contested = 0; +#endif uintptr_t x; int error = 0; From owner-svn-src-head@FreeBSD.ORG Sun Mar 15 08:08:56 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4397D1065673; Sun, 15 Mar 2009 08:08:56 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (77-93-215-190.static.masterinter.net [77.93.215.190]) by mx1.freebsd.org (Postfix) with ESMTP id E95338FC1C; Sun, 15 Mar 2009 08:08:55 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from localhost (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 0ABE59CB07F; Sun, 15 Mar 2009 09:08:38 +0100 (CET) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by localhost (lev.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id PTAwZ3Ag+vCX; Sun, 15 Mar 2009 09:08:35 +0100 (CET) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id A7AC59CB124; Sun, 15 Mar 2009 09:08:35 +0100 (CET) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.14.3/8.14.3/Submit) id n2F88ZHK039816; Sun, 15 Mar 2009 09:08:35 +0100 (CET) (envelope-from rdivacky) Date: Sun, 15 Mar 2009 09:08:35 +0100 From: Roman Divacky To: Martin Voros Message-ID: <20090315080835.GA39715@freebsd.org> References: <200903141755.n2EHtGj1003232@svn.freebsd.org> <942531.27013.qm@web55506.mail.re4.yahoo.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="OgqxwSJOaUobr8KG" Content-Disposition: inline In-Reply-To: <942531.27013.qm@web55506.mail.re4.yahoo.com> 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: r189801 - in head: cddl cddl/lib/libzpool cddl/usr.bin/ztest cddl/usr.sbin/zdb share/mk tools/regression/include/tgmath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 15 Mar 2009 08:08:56 -0000 --OgqxwSJOaUobr8KG Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Mar 14, 2009 at 02:34:31PM -0700, Martin Voros wrote: >=20 > ----- Original Message ---- >=20 > > From: Roman Divacky > > To: src-committers@freebsd.org; svn-src-all@freebsd.org; svn-src-head@f= reebsd.org > > Sent: Sunday, March 15, 2009 4:55:16 AM > > Subject: svn commit: r189801 - in head: cddl cddl/lib/libzpool cddl/usr= .bin/ztest cddl/usr.sbin/zdb share/mk tools/regression/include/tgmath > >=20 > > Author: rdivacky > > Date: Sat Mar 14 17:55:16 2009 > > New Revision: 189801 > > URL: http://svn.freebsd.org/changeset/base/189801 > >=20 > > Log: > > Switch over to gnu99 compilation on default for userland. > > =20 > > Tested by: make universe > > Tested by: ports exp build (done by pav) > > Reviewed by: ru > > Reviewed by: silence on arch > > Approved by: ed (mentor) > >=20 > > Modified: > > head/cddl/Makefile.inc > > head/cddl/lib/libzpool/Makefile > > head/cddl/usr.bin/ztest/Makefile > > head/cddl/usr.sbin/zdb/Makefile > > head/share/mk/bsd.sys.mk > > head/tools/regression/include/tgmath/Makefile > >=20 > > Modified: head/cddl/Makefile.inc > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=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/cddl/Makefile.inc Sat Mar 14 17:54:58 2009 (r189800) > > +++ head/cddl/Makefile.inc Sat Mar 14 17:55:16 2009 (r189801) > > @@ -6,3 +6,5 @@ OPENSOLARIS_SYS_DISTDIR=3D ${.CURDIR}/../. > > IGNORE_PRAGMA=3D YES > >=20 > > CFLAGS+=3D -DNEED_SOLARIS_BOOLEAN > > + > > +CSTD?=3D gnu89 >=20 > Hi, >=20 > I assume that you should have gnu99 here. no... cddl/* stuff does not build with gnu99 so I use there gnu89 (it's contributed source with -Werror turned on so I wanted to play safe). the subsequent CSTD=3Dc99 are there because some parts needs c99 compilatio= n. --OgqxwSJOaUobr8KG Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.11 (FreeBSD) iEYEARECAAYFAkm8t4IACgkQLVEj6D3CBEwdfQCfQMsozbvnhtrKMWY4/9O+KvHi 6/EAn0UfWilB5eGc1HxfWLTKUq+0p1rp =X1mI -----END PGP SIGNATURE----- --OgqxwSJOaUobr8KG-- From owner-svn-src-head@FreeBSD.ORG Sun Mar 15 08:13:09 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0838E106564A; Sun, 15 Mar 2009 08:13:09 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (77-93-215-190.static.masterinter.net [77.93.215.190]) by mx1.freebsd.org (Postfix) with ESMTP id B2F1D8FC0C; Sun, 15 Mar 2009 08:13:08 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from localhost (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 91E2A9CB115; Sun, 15 Mar 2009 09:12:52 +0100 (CET) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by localhost (lev.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id B9uZej33Dfi6; Sun, 15 Mar 2009 09:12:40 +0100 (CET) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id C9AA29CB125; Sun, 15 Mar 2009 09:12:40 +0100 (CET) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.14.3/8.14.3/Submit) id n2F8Ce1b040216; Sun, 15 Mar 2009 09:12:40 +0100 (CET) (envelope-from rdivacky) Date: Sun, 15 Mar 2009 09:12:40 +0100 From: Roman Divacky To: David Schultz Message-ID: <20090315081240.GB39715@freebsd.org> References: <200903141936.n2EJaDM5006130@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200903141936.n2EJaDM5006130@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: r189824 - in head/contrib/gcc: . doc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 15 Mar 2009 08:13:09 -0000 On Sat, Mar 14, 2009 at 07:36:13PM +0000, David Schultz wrote: > Author: das > Date: Sat Mar 14 19:36:13 2009 > New Revision: 189824 > URL: http://svn.freebsd.org/changeset/base/189824 > > Log: > Make gcc use C99 inline semantics in c99 and gnu99 mode. This was the > original intent, but the functionality wasn't implemented until after > gcc 4.2 was released. However, if you compiled a program that would > behave differently before and after this change, gcc 4.2 would have > warned you; hence, everything currently in the base system is > unaffected by this change. This patch also adds additional warnings > about certain inline function-related bogosity, e.g., using a > static non-const local variable in an inline function. > > These changes were merged from a snapshot of gcc mainline from March > 2007, prior to the GPLv3 switch. I then ran the regression test suite > from a more recent gcc snapshot and fixed the important bugs it found. > I also squelched the following warning unless -pedantic is specified: > > foo is static but used in inline function bar which is not static > > This is consistent with LLVM's behavior, but not consistent with gcc 4.3. thnx a lot for doing this! just a quick question - what is the fallback strategy for ports that will die on this? roman From owner-svn-src-head@FreeBSD.ORG Sun Mar 15 08:31:11 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA77E106564A for ; Sun, 15 Mar 2009 08:31:11 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outD.internet-mail-service.net (outd.internet-mail-service.net [216.240.47.227]) by mx1.freebsd.org (Postfix) with ESMTP id CF5398FC0C for ; Sun, 15 Mar 2009 08:31:11 +0000 (UTC) (envelope-from julian@elischer.org) Received: from idiom.com (mx0.idiom.com [216.240.32.160]) by out.internet-mail-service.net (Postfix) with ESMTP id 91321C9DD; Sun, 15 Mar 2009 01:31:11 -0700 (PDT) X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e Received: from julian-mac.elischer.org (home.elischer.org [216.240.48.38]) by idiom.com (Postfix) with ESMTP id 019D02D600E; Sun, 15 Mar 2009 01:31:10 -0700 (PDT) Message-ID: <49BCBCD3.1080102@elischer.org> Date: Sun, 15 Mar 2009 01:31:15 -0700 From: Julian Elischer User-Agent: Thunderbird 2.0.0.19 (Macintosh/20081209) MIME-Version: 1.0 To: Jeff Roberson References: <200903150803.n2F83tVk020933@svn.freebsd.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, Jeff Roberson , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r189846 - 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: Sun, 15 Mar 2009 08:31:12 -0000 Jeff Roberson wrote: > Sorry for the temporary build breakage; I meant to commit these two > patches together. > > Jeff > > On Sun, 15 Mar 2009, Jeff Roberson wrote: > yeah had me going there for a while until I resynced from -current again. From owner-svn-src-head@FreeBSD.ORG Sun Mar 15 08:32:56 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E1B0B1065670 for ; Sun, 15 Mar 2009 08:32:56 +0000 (UTC) (envelope-from jroberson@jroberson.net) Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.239]) by mx1.freebsd.org (Postfix) with ESMTP id BDF058FC0C for ; Sun, 15 Mar 2009 08:32:56 +0000 (UTC) (envelope-from jroberson@jroberson.net) Received: by rv-out-0506.google.com with SMTP id f6so2547020rvb.43 for ; Sun, 15 Mar 2009 01:32:56 -0700 (PDT) Received: by 10.141.87.13 with SMTP id p13mr1589575rvl.166.1237104312561; Sun, 15 Mar 2009 01:05:12 -0700 (PDT) Received: from ?10.0.1.198? (udp016664uds.hawaiiantel.net [72.235.41.117]) by mx.google.com with ESMTPS id k2sm12390362rvb.4.2009.03.15.01.05.09 (version=SSLv3 cipher=RC4-MD5); Sun, 15 Mar 2009 01:05:11 -0700 (PDT) Date: Sat, 14 Mar 2009 22:01:06 -1000 (HST) From: Jeff Roberson X-X-Sender: jroberson@desktop To: Jeff Roberson In-Reply-To: <200903150803.n2F83tVk020933@svn.freebsd.org> Message-ID: References: <200903150803.n2F83tVk020933@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r189846 - 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: Sun, 15 Mar 2009 08:32:57 -0000 Sorry for the temporary build breakage; I meant to commit these two patches together. Jeff On Sun, 15 Mar 2009, Jeff Roberson wrote: > Author: jeff > Date: Sun Mar 15 08:03:54 2009 > New Revision: 189846 > URL: http://svn.freebsd.org/changeset/base/189846 > > Log: > - Wrap lock profiling state variables in #ifdef LOCK_PROFILING blocks. > > Modified: > head/sys/kern/kern_lock.c > head/sys/kern/kern_mutex.c > head/sys/kern/kern_rwlock.c > head/sys/kern/kern_sx.c > > Modified: head/sys/kern/kern_lock.c > ============================================================================== > --- head/sys/kern/kern_lock.c Sun Mar 15 06:41:47 2009 (r189845) > +++ head/sys/kern/kern_lock.c Sun Mar 15 08:03:54 2009 (r189846) > @@ -333,16 +333,17 @@ __lockmgr_args(struct lock *lk, u_int fl > const char *wmesg, int pri, int timo, const char *file, int line) > { > GIANT_DECLARE; > - uint64_t waittime; > struct lock_class *class; > const char *iwmesg; > uintptr_t tid, v, x; > u_int op; > - int contested, error, ipri, itimo, queue, wakeup_swapper; > + int error, ipri, itimo, queue, wakeup_swapper; > +#ifdef LOCK_PROFILING > + uint64_t waittime = 0; > + int contested = 0; > +#endif > > - contested = 0; > error = 0; > - waittime = 0; > tid = (uintptr_t)curthread; > op = (flags & LK_TYPE_MASK); > iwmesg = (wmesg == LK_WMESG_DEFAULT) ? lk->lock_object.lo_name : wmesg; > > Modified: head/sys/kern/kern_mutex.c > ============================================================================== > --- head/sys/kern/kern_mutex.c Sun Mar 15 06:41:47 2009 (r189845) > +++ head/sys/kern/kern_mutex.c Sun Mar 15 08:03:54 2009 (r189846) > @@ -254,8 +254,11 @@ _mtx_unlock_spin_flags(struct mtx *m, in > int > _mtx_trylock(struct mtx *m, int opts, const char *file, int line) > { > - int rval, contested = 0; > +#ifdef LOCK_PROFILING > uint64_t waittime = 0; > + int contested = 0; > +#endif > + int rval; > > MPASS(curthread != NULL); > KASSERT(m->mtx_lock != MTX_DESTROYED, > @@ -296,15 +299,17 @@ _mtx_lock_sleep(struct mtx *m, uintptr_t > int line) > { > struct turnstile *ts; > + uintptr_t v; > #ifdef ADAPTIVE_MUTEXES > volatile struct thread *owner; > #endif > #ifdef KTR > int cont_logged = 0; > #endif > +#ifdef LOCK_PROFILING > int contested = 0; > uint64_t waittime = 0; > - uintptr_t v; > +#endif > > if (mtx_owned(m)) { > KASSERT((m->lock_object.lo_flags & LO_RECURSABLE) != 0, > @@ -448,8 +453,11 @@ void > _mtx_lock_spin(struct mtx *m, uintptr_t tid, int opts, const char *file, > int line) > { > - int i = 0, contested = 0; > + int i = 0; > +#ifdef LOCK_PROFILING > + int contested = 0; > uint64_t waittime = 0; > +#endif > > if (LOCK_LOG_TEST(&m->lock_object, opts)) > CTR1(KTR_LOCK, "_mtx_lock_spin: %p spinning", m); > @@ -486,11 +494,13 @@ _thread_lock_flags(struct thread *td, in > { > struct mtx *m; > uintptr_t tid; > - int i, contested; > - uint64_t waittime; > + int i; > +#ifdef LOCK_PROFILING > + int contested = 0; > + uint64_t waittime = 0; > +#endif > > - contested = i = 0; > - waittime = 0; > + i = 0; > tid = (uintptr_t)curthread; > for (;;) { > retry: > > Modified: head/sys/kern/kern_rwlock.c > ============================================================================== > --- head/sys/kern/kern_rwlock.c Sun Mar 15 06:41:47 2009 (r189845) > +++ head/sys/kern/kern_rwlock.c Sun Mar 15 08:03:54 2009 (r189846) > @@ -282,8 +282,10 @@ _rw_rlock(struct rwlock *rw, const char > int spintries = 0; > int i; > #endif > +#ifdef LOCK_PROFILING > uint64_t waittime = 0; > int contested = 0; > +#endif > uintptr_t v; > > KASSERT(rw->rw_lock != RW_DESTROYED, > @@ -584,9 +586,11 @@ _rw_wlock_hard(struct rwlock *rw, uintpt > int spintries = 0; > int i; > #endif > - uint64_t waittime = 0; > uintptr_t v, x; > +#ifdef LOCK_PROFILING > + uint64_t waittime = 0; > int contested = 0; > +#endif > > if (rw_wlocked(rw)) { > KASSERT(rw->lock_object.lo_flags & RW_RECURSE, > > Modified: head/sys/kern/kern_sx.c > ============================================================================== > --- head/sys/kern/kern_sx.c Sun Mar 15 06:41:47 2009 (r189845) > +++ head/sys/kern/kern_sx.c Sun Mar 15 08:03:54 2009 (r189846) > @@ -431,9 +431,12 @@ _sx_xlock_hard(struct sx *sx, uintptr_t > #ifdef ADAPTIVE_SX > volatile struct thread *owner; > #endif > - uint64_t waittime = 0; > uintptr_t x; > - int contested = 0, error = 0; > +#ifdef LOCK_PROFILING > + uint64_t waittime = 0; > + int contested = 0; > +#endif > + int error = 0; > > /* If we already hold an exclusive lock, then recurse. */ > if (sx_xlocked(sx)) { > @@ -652,8 +655,10 @@ _sx_slock_hard(struct sx *sx, int opts, > #ifdef ADAPTIVE_SX > volatile struct thread *owner; > #endif > +#ifdef LOCK_PROFILING > uint64_t waittime = 0; > int contested = 0; > +#endif > uintptr_t x; > int error = 0; > > From owner-svn-src-head@FreeBSD.ORG Sun Mar 15 09:12:45 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D89C106567D for ; Sun, 15 Mar 2009 09:12:45 +0000 (UTC) (envelope-from christoph.mallon@gmx.de) Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by mx1.freebsd.org (Postfix) with SMTP id A07618FC0C for ; Sun, 15 Mar 2009 09:12:43 +0000 (UTC) (envelope-from christoph.mallon@gmx.de) Received: (qmail invoked by alias); 15 Mar 2009 09:12:40 -0000 Received: from p54A3CD43.dip.t-dialin.net (EHLO tron.homeunix.org) [84.163.205.67] by mail.gmx.net (mp045) with SMTP; 15 Mar 2009 10:12:40 +0100 X-Authenticated: #1673122 X-Provags-ID: V01U2FsdGVkX1+wH+9wB2awW7oXJW5BbZ0O6u4Q4d31pKWkaRz+Eq t0B3MFZ+8VDctD Message-ID: <49BCC67D.70104@gmx.de> Date: Sun, 15 Mar 2009 10:12:29 +0100 From: Christoph Mallon User-Agent: Thunderbird 2.0.0.19 (X11/20090103) MIME-Version: 1.0 To: David Schultz References: <200903141855.n2EItpnp004551@svn.freebsd.org> In-Reply-To: <200903141855.n2EItpnp004551@svn.freebsd.org> Content-Type: multipart/mixed; boundary="------------000004040405050702070407" X-Y-GMX-Trusted: 0 X-FuHaFi: 0.5,0.52 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r189804 - head/usr.bin/ncal X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 15 Mar 2009 09:12:45 -0000 This is a multi-part message in MIME format. --------------000004040405050702070407 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hi David! David Schultz schrieb: > Author: das > Date: Sat Mar 14 18:55:51 2009 > New Revision: 189804 > URL: http://svn.freebsd.org/changeset/base/189804 > > Log: > Multibyte character support for cal(1). > > PR: 131578 > > Modified: > head/usr.bin/ncal/ncal.1 > head/usr.bin/ncal/ncal.c > [...] > Modified: head/usr.bin/ncal/ncal.c > ============================================================================== > --- head/usr.bin/ncal/ncal.c Sat Mar 14 18:24:15 2009 (r189803) > +++ head/usr.bin/ncal/ncal.c Sat Mar 14 18:55:51 2009 (r189804) [...] > @@ -532,17 +537,17 @@ printyearb(int y, int jd_flag) > printf("%s\n\n", center(t, s, mw * mpl + mpl)); > > for (j = 0; j != 12; j += mpl) { > - printf("%-*s ", mw, center(s, year[j].name, mw)); > + printf("%-*ls ", mw, wcenter(ws, year[j].name, mw)); > if (mpl == 2) > - printf("%s\n", center(s, year[j + 1].name, mw)); > + printf("%ls\n", wcenter(ws, year[j + 1].name, mw)); > else > - printf("%-*s %s\n", mw, > - center(s, year[j + 1].name, mw), > - center(t, year[j + 2].name, mw)); > + printf("%-*ls %ls\n", mw, > + wcenter(ws, year[j + 1].name, mw), > + wcenter(wt, year[j + 2].name, mw)); > > if (mpl == 2) > - printf(" %s %s %s %s %s %s %s " > - " %s %s %s %s %s %s %.2s\n", > + wprintf(L" %ls %ls %ls %ls %ls %ls %ls " > + " %ls %ls %ls %ls %ls %ls %.2ls\n", > wds.names[6], wds.names[0], wds.names[1], > wds.names[2], wds.names[3], wds.names[4], > wds.names[5], [...] Your changes to ncal are invalid. You are mixing byte and wide output functions, which access the same stream (here printf() and wprintf()). This is not allowed according to C99 §17.9.2:5: "Byte input/output functions shall not be applied to a wide-oriented stream and wide character input/output functions shall not be applied to a byte-oriented stream. [...]" (The first access of a stream with a byte/wide oriented function makes it byte/wide oriented) With FreeBSD's current implementation of output functions this accidently works, but you should not rely on this. For example with glibc's implementation it fails. Attached is a patch, which changes all wprintf()s back to printf(). Christoph --------------000004040405050702070407 Content-Type: text/plain; name="ncal.diff" Content-Transfer-Encoding: base64 Content-Disposition: inline; filename="ncal.diff" SW5kZXg6IG5jYWwuYwo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBuY2FsLmMJKFJldmlzaW9uIDE4OTg0 NSkKKysrIG5jYWwuYwkoQXJiZWl0c2tvcGllKQpAQCAtNDQzLDE1ICs0NDMsMTUgQEAKIAlt dyA9IGpkX2ZsYWcgPyBNT05USF9XSURUSF9CX0ogOiBNT05USF9XSURUSF9COwogCiAJc3dw cmludGYocywgTUFYX1dJRFRILCBMIiVscyAlZCIsIG1vbnRoLm5hbWUsIHkpOwotCXdwcmlu dGYoTCIlbHNcbiIsIHdjZW50ZXIodCwgcywgbXcpKTsKKwlwcmludGYoIiVsc1xuIiwgd2Nl bnRlcih0LCBzLCBtdykpOwogCiAJaWYgKGpkX2ZsYWcpCi0JCXdwcmludGYoTCIgJWxzICVs cyAlbHMgJWxzICVscyAlbHMgJS4ybHNcbiIsCisJCXByaW50ZigiICVscyAlbHMgJWxzICVs cyAlbHMgJWxzICUuMmxzXG4iLAogCQkJd2RzLm5hbWVzWzZdLCB3ZHMubmFtZXNbMF0sCiAJ CQl3ZHMubmFtZXNbMV0sIHdkcy5uYW1lc1syXSwgd2RzLm5hbWVzWzNdLAogCQkJd2RzLm5h bWVzWzRdLCB3ZHMubmFtZXNbNV0pOwogCWVsc2UKLQkJd3ByaW50ZihMIiVscyVscyVscyVs cyVscyVscyUuMmxzXG4iLCB3ZHMubmFtZXNbNl0sCisJCXByaW50ZigiJWxzJWxzJWxzJWxz JWxzJWxzJS4ybHNcbiIsIHdkcy5uYW1lc1s2XSwKIAkJCXdkcy5uYW1lc1swXSwgd2RzLm5h bWVzWzFdLCB3ZHMubmFtZXNbMl0sIHdkcy5uYW1lc1szXSwKIAkJCXdkcy5uYW1lc1s0XSwg d2RzLm5hbWVzWzVdKTsKIApAQCAtNTQ2LDcgKzU0Niw3IEBACiAJCQkgICAgd2NlbnRlcih3 dCwgeWVhcltqICsgMl0ubmFtZSwgbXcpKTsKIAogCQlpZiAobXBsID09IDIpCi0JCQl3cHJp bnRmKEwiICVscyAlbHMgJWxzICVscyAlbHMgJWxzICVscyAiCisJCQlwcmludGYoIiAlbHMg JWxzICVscyAlbHMgJWxzICVscyAlbHMgIgogCQkJCSIgJWxzICVscyAlbHMgJWxzICVscyAl bHMgJS4ybHNcbiIsCiAJCQkJd2RzLm5hbWVzWzZdLCB3ZHMubmFtZXNbMF0sIHdkcy5uYW1l c1sxXSwKIAkJCQl3ZHMubmFtZXNbMl0sIHdkcy5uYW1lc1szXSwgd2RzLm5hbWVzWzRdLApA QCAtNTU1LDcgKzU1NSw3IEBACiAJCQkJd2RzLm5hbWVzWzJdLCB3ZHMubmFtZXNbM10sIHdk cy5uYW1lc1s0XSwKIAkJCQl3ZHMubmFtZXNbNV0pOwogCQllbHNlCi0JCQl3cHJpbnRmKEwi JWxzJWxzJWxzJWxzJWxzJWxzJWxzICIKKwkJCXByaW50ZigiJWxzJWxzJWxzJWxzJWxzJWxz JWxzICIKIAkJCQkiJWxzJWxzJWxzJWxzJWxzJWxzJWxzICIKIAkJCQkiJWxzJWxzJWxzJWxz JWxzJWxzJS4ybHNcbiIsCiAJCQkJd2RzLm5hbWVzWzZdLCB3ZHMubmFtZXNbMF0sIHdkcy5u YW1lc1sxXSwK --------------000004040405050702070407-- From owner-svn-src-head@FreeBSD.ORG Sun Mar 15 09:58:32 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9B7C41065670; Sun, 15 Mar 2009 09:58:32 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 883888FC16; Sun, 15 Mar 2009 09:58:32 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2F9wWqY023116; Sun, 15 Mar 2009 09:58:32 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2F9wVDt023106; Sun, 15 Mar 2009 09:58:31 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200903150958.n2F9wVDt023106@svn.freebsd.org> From: Robert Watson Date: Sun, 15 Mar 2009 09:58: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: r189848 - in head: sys/netinet sys/netinet6 usr.bin/netstat usr.bin/systat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 15 Mar 2009 09:58:33 -0000 Author: rwatson Date: Sun Mar 15 09:58:31 2009 New Revision: 189848 URL: http://svn.freebsd.org/changeset/base/189848 Log: Correct a number of evolved problems with inp_vflag and inp_flags: certain flags that should have been in inp_flags ended up in inp_vflag, meaning that they were inconsistently locked, and in one case, interpreted. Move the following flags from inp_vflag to gaps in the inp_flags space (and clean up the inp_flags constants to make gaps more obvious to future takers): INP_TIMEWAIT INP_SOCKREF INP_ONESBCAST INP_DROPPED Some aspects of this change have no effect on kernel ABI at all, as these are UDP/TCP/IP-internal uses; however, netstat and sockstat detect INP_TIMEWAIT when listing TCP sockets, so any MFC will need to take this into account. MFC after: 1 week (or after dependencies are MFC'd) Reviewed by: bz Modified: head/sys/netinet/in_pcb.c head/sys/netinet/in_pcb.h head/sys/netinet/tcp_input.c head/sys/netinet/tcp_subr.c head/sys/netinet/tcp_timer.c head/sys/netinet/tcp_timewait.c head/sys/netinet/tcp_usrreq.c head/sys/netinet6/in6_pcb.c head/usr.bin/netstat/inet.c head/usr.bin/systat/netstat.c Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Sun Mar 15 09:26:56 2009 (r189847) +++ head/sys/netinet/in_pcb.c Sun Mar 15 09:58:31 2009 (r189848) @@ -384,7 +384,7 @@ in_pcbbind_setup(struct inpcb *inp, stru * This entire block sorely needs a rewrite. */ if (t && - ((t->inp_vflag & INP_TIMEWAIT) == 0) && + ((t->inp_flags & INP_TIMEWAIT) == 0) && (so->so_type != SOCK_STREAM || ntohl(t->inp_faddr.s_addr) == INADDR_ANY) && (ntohl(sin->sin_addr.s_addr) != INADDR_ANY || @@ -397,7 +397,7 @@ in_pcbbind_setup(struct inpcb *inp, stru } t = in_pcblookup_local(pcbinfo, sin->sin_addr, lport, wild, cred); - if (t && (t->inp_vflag & INP_TIMEWAIT)) { + if (t && (t->inp_flags & INP_TIMEWAIT)) { /* * XXXRW: If an incpb has had its timewait * state recycled, we treat the address as @@ -1031,7 +1031,7 @@ in_pcbdrop(struct inpcb *inp) INP_INFO_WLOCK_ASSERT(inp->inp_pcbinfo); INP_WLOCK_ASSERT(inp); - inp->inp_vflag |= INP_DROPPED; + inp->inp_flags |= INP_DROPPED; if (inp->inp_flags & INP_INHASHLIST) { struct inpcbport *phd = inp->inp_phd; @@ -1818,6 +1818,22 @@ db_print_inpflags(int inp_flags) db_printf("%sIN6P_AUTOFLOWLABEL", comma ? ", " : ""); comma = 1; } + if (inp_flags & INP_TIMEWAIT) { + db_printf("%sINP_TIMEWAIT", comma ? ", " : ""); + comma = 1; + } + if (inp_flags & INP_ONESBCAST) { + db_printf("%sINP_ONESBCAST", comma ? ", " : ""); + comma = 1; + } + if (inp_flags & INP_DROPPED) { + db_printf("%sINP_DROPPED", comma ? ", " : ""); + comma = 1; + } + if (inp_flags & INP_SOCKREF) { + db_printf("%sINP_SOCKREF", comma ? ", " : ""); + comma = 1; + } if (inp_flags & IN6P_RFC2292) { db_printf("%sIN6P_RFC2292", comma ? ", " : ""); comma = 1; @@ -1846,22 +1862,6 @@ db_print_inpvflag(u_char inp_vflag) db_printf("%sINP_IPV6PROTO", comma ? ", " : ""); comma = 1; } - if (inp_vflag & INP_TIMEWAIT) { - db_printf("%sINP_TIMEWAIT", comma ? ", " : ""); - comma = 1; - } - if (inp_vflag & INP_ONESBCAST) { - db_printf("%sINP_ONESBCAST", comma ? ", " : ""); - comma = 1; - } - if (inp_vflag & INP_DROPPED) { - db_printf("%sINP_DROPPED", comma ? ", " : ""); - comma = 1; - } - if (inp_vflag & INP_SOCKREF) { - db_printf("%sINP_SOCKREF", comma ? ", " : ""); - comma = 1; - } } void Modified: head/sys/netinet/in_pcb.h ============================================================================== --- head/sys/netinet/in_pcb.h Sun Mar 15 09:26:56 2009 (r189847) +++ head/sys/netinet/in_pcb.h Sun Mar 15 09:58:31 2009 (r189848) @@ -384,40 +384,38 @@ void inp_4tuple_get(struct inpcb *inp, #define INP_IPV4 0x1 #define INP_IPV6 0x2 #define INP_IPV6PROTO 0x4 /* opened under IPv6 protocol */ -#define INP_TIMEWAIT 0x8 /* inpcb in TIMEWAIT, ppcb is tcptw */ -#define INP_ONESBCAST 0x10 /* send all-ones broadcast */ -#define INP_DROPPED 0x20 /* protocol drop flag */ -#define INP_SOCKREF 0x40 /* strong socket reference */ /* * Flags for inp_flag. */ -#define INP_RECVOPTS 0x01 /* receive incoming IP options */ -#define INP_RECVRETOPTS 0x02 /* receive IP options for reply */ -#define INP_RECVDSTADDR 0x04 /* receive IP dst address */ -#define INP_HDRINCL 0x08 /* user supplies entire IP header */ -#define INP_HIGHPORT 0x10 /* user wants "high" port binding */ -#define INP_LOWPORT 0x20 /* user wants "low" port binding */ -#define INP_ANONPORT 0x40 /* port chosen for user */ -#define INP_RECVIF 0x80 /* receive incoming interface */ -#define INP_MTUDISC 0x100 /* user can do MTU discovery */ -#define INP_FAITH 0x200 /* accept FAITH'ed connections */ -#define INP_RECVTTL 0x400 /* receive incoming IP TTL */ -#define INP_DONTFRAG 0x800 /* don't fragment packet */ -#define INP_NONLOCALOK 0x1000 /* Allow bind to spoof any address */ +#define INP_RECVOPTS 0x00000001 /* receive incoming IP options */ +#define INP_RECVRETOPTS 0x00000002 /* receive IP options for reply */ +#define INP_RECVDSTADDR 0x00000004 /* receive IP dst address */ +#define INP_HDRINCL 0x00000008 /* user supplies entire IP header */ +#define INP_HIGHPORT 0x00000010 /* user wants "high" port binding */ +#define INP_LOWPORT 0x00000020 /* user wants "low" port binding */ +#define INP_ANONPORT 0x00000040 /* port chosen for user */ +#define INP_RECVIF 0x00000080 /* receive incoming interface */ +#define INP_MTUDISC 0x00000100 /* user can do MTU discovery */ +#define INP_FAITH 0x00000200 /* accept FAITH'ed connections */ +#define INP_RECVTTL 0x00000400 /* receive incoming IP TTL */ +#define INP_DONTFRAG 0x00000800 /* don't fragment packet */ +#define INP_NONLOCALOK 0x00001000 /* Allow bind to spoof any address */ /* - requires options IP_NONLOCALBIND */ -#define INP_INHASHLIST 0x2000 /* in_pcbinshash() has been called */ - -#define IN6P_IPV6_V6ONLY 0x008000 /* restrict AF_INET6 socket for v6 */ - -#define IN6P_PKTINFO 0x010000 /* receive IP6 dst and I/F */ -#define IN6P_HOPLIMIT 0x020000 /* receive hoplimit */ -#define IN6P_HOPOPTS 0x040000 /* receive hop-by-hop options */ -#define IN6P_DSTOPTS 0x080000 /* receive dst options after rthdr */ -#define IN6P_RTHDR 0x100000 /* receive routing header */ -#define IN6P_RTHDRDSTOPTS 0x200000 /* receive dstoptions before rthdr */ -#define IN6P_TCLASS 0x400000 /* receive traffic class value */ -#define IN6P_AUTOFLOWLABEL 0x800000 /* attach flowlabel automatically */ +#define INP_INHASHLIST 0x00002000 /* in_pcbinshash() has been called */ +#define IN6P_IPV6_V6ONLY 0x00008000 /* restrict AF_INET6 socket for v6 */ +#define IN6P_PKTINFO 0x00010000 /* receive IP6 dst and I/F */ +#define IN6P_HOPLIMIT 0x00020000 /* receive hoplimit */ +#define IN6P_HOPOPTS 0x00040000 /* receive hop-by-hop options */ +#define IN6P_DSTOPTS 0x00080000 /* receive dst options after rthdr */ +#define IN6P_RTHDR 0x00100000 /* receive routing header */ +#define IN6P_RTHDRDSTOPTS 0x00200000 /* receive dstoptions before rthdr */ +#define IN6P_TCLASS 0x00400000 /* receive traffic class value */ +#define IN6P_AUTOFLOWLABEL 0x00800000 /* attach flowlabel automatically */ +#define INP_TIMEWAIT 0x01000000 /* in TIMEWAIT, ppcb is tcptw */ +#define INP_ONESBCAST 0x02000000 /* send all-ones broadcast */ +#define INP_DROPPED 0x04000000 /* protocol drop flag */ +#define INP_SOCKREF 0x08000000 /* strong socket reference */ #define IN6P_RFC2292 0x40000000 /* used RFC2292 API on the socket */ #define IN6P_MTU 0x80000000 /* receive path MTU */ Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Sun Mar 15 09:26:56 2009 (r189847) +++ head/sys/netinet/tcp_input.c Sun Mar 15 09:58:31 2009 (r189848) @@ -635,7 +635,7 @@ findpcb: * tried to free the inpcb, in which case we need to loop back and * try to find a new inpcb to deliver to. */ - if (inp->inp_vflag & INP_TIMEWAIT) { + if (inp->inp_flags & INP_TIMEWAIT) { KASSERT(ti_locked == TI_RLOCKED || ti_locked == TI_WLOCKED, ("%s: INP_TIMEWAIT ti_locked %d", __func__, ti_locked)); Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Sun Mar 15 09:26:56 2009 (r189847) +++ head/sys/netinet/tcp_subr.c Sun Mar 15 09:58:31 2009 (r189848) @@ -881,10 +881,10 @@ tcp_close(struct tcpcb *tp) KASSERT(inp->inp_socket != NULL, ("tcp_close: inp_socket NULL")); so = inp->inp_socket; soisdisconnected(so); - if (inp->inp_vflag & INP_SOCKREF) { + if (inp->inp_flags & INP_SOCKREF) { KASSERT(so->so_state & SS_PROTOREF, ("tcp_close: !SS_PROTOREF")); - inp->inp_vflag &= ~INP_SOCKREF; + inp->inp_flags &= ~INP_SOCKREF; INP_WUNLOCK(inp); ACCEPT_LOCK(); SOCK_LOCK(so); @@ -921,7 +921,7 @@ tcp_drain(void) */ INP_INFO_RLOCK(&V_tcbinfo); LIST_FOREACH(inpb, V_tcbinfo.ipi_listhead, inp_list) { - if (inpb->inp_vflag & INP_TIMEWAIT) + if (inpb->inp_flags & INP_TIMEWAIT) continue; INP_WLOCK(inpb); if ((tcpb = intotcpcb(inpb)) != NULL) { @@ -962,8 +962,8 @@ tcp_notify(struct inpcb *inp, int error) INP_INFO_WLOCK_ASSERT(&V_tcbinfo); INP_WLOCK_ASSERT(inp); - if ((inp->inp_vflag & INP_TIMEWAIT) || - (inp->inp_vflag & INP_DROPPED)) + if ((inp->inp_flags & INP_TIMEWAIT) || + (inp->inp_flags & INP_DROPPED)) return (inp); tp = intotcpcb(inp); @@ -1063,7 +1063,7 @@ tcp_pcblist(SYSCTL_HANDLER_ARGS) * TCP state changes, is not quite right, but for * now, better than nothing. */ - if (inp->inp_vflag & INP_TIMEWAIT) { + if (inp->inp_flags & INP_TIMEWAIT) { if (intotw(inp) != NULL) error = cr_cansee(req->td->td_ucred, intotw(inp)->tw_cred); @@ -1094,7 +1094,7 @@ tcp_pcblist(SYSCTL_HANDLER_ARGS) inp_ppcb = inp->inp_ppcb; if (inp_ppcb == NULL) bzero((char *) &xt.xt_tp, sizeof xt.xt_tp); - else if (inp->inp_vflag & INP_TIMEWAIT) { + else if (inp->inp_flags & INP_TIMEWAIT) { bzero((char *) &xt.xt_tp, sizeof xt.xt_tp); xt.xt_tp.t_state = TCPS_TIME_WAIT; } else @@ -1293,8 +1293,8 @@ tcp_ctlinput(int cmd, struct sockaddr *s ip->ip_src, th->th_sport, 0, NULL); if (inp != NULL) { INP_WLOCK(inp); - if (!(inp->inp_vflag & INP_TIMEWAIT) && - !(inp->inp_vflag & INP_DROPPED) && + if (!(inp->inp_flags & INP_TIMEWAIT) && + !(inp->inp_flags & INP_DROPPED) && !(inp->inp_socket == NULL)) { icmp_tcp_seq = htonl(th->th_seq); tp = intotcpcb(inp); @@ -1581,8 +1581,8 @@ tcp_drop_syn_sent(struct inpcb *inp, int INP_INFO_WLOCK_ASSERT(&V_tcbinfo); INP_WLOCK_ASSERT(inp); - if ((inp->inp_vflag & INP_TIMEWAIT) || - (inp->inp_vflag & INP_DROPPED)) + if ((inp->inp_flags & INP_TIMEWAIT) || + (inp->inp_flags & INP_DROPPED)) return (inp); tp = intotcpcb(inp); @@ -1610,8 +1610,8 @@ tcp_mtudisc(struct inpcb *inp, int errno struct socket *so; INP_WLOCK_ASSERT(inp); - if ((inp->inp_vflag & INP_TIMEWAIT) || - (inp->inp_vflag & INP_DROPPED)) + if ((inp->inp_flags & INP_TIMEWAIT) || + (inp->inp_flags & INP_DROPPED)) return (inp); tp = intotcpcb(inp); @@ -2185,7 +2185,7 @@ sysctl_drop(SYSCTL_HANDLER_ARGS) } if (inp != NULL) { INP_WLOCK(inp); - if (inp->inp_vflag & INP_TIMEWAIT) { + if (inp->inp_flags & INP_TIMEWAIT) { /* * XXXRW: There currently exists a state where an * inpcb is present, but its timewait state has been @@ -2197,7 +2197,7 @@ sysctl_drop(SYSCTL_HANDLER_ARGS) tcp_twclose(tw, 0); else INP_WUNLOCK(inp); - } else if (!(inp->inp_vflag & INP_DROPPED) && + } else if (!(inp->inp_flags & INP_DROPPED) && !(inp->inp_socket->so_options & SO_ACCEPTCONN)) { tp = intotcpcb(inp); tp = tcp_drop(tp, ECONNABORTED); Modified: head/sys/netinet/tcp_timer.c ============================================================================== --- head/sys/netinet/tcp_timer.c Sun Mar 15 09:26:56 2009 (r189847) +++ head/sys/netinet/tcp_timer.c Sun Mar 15 09:58:31 2009 (r189848) @@ -182,7 +182,7 @@ tcp_timer_delack(void *xtp) } INP_WLOCK(inp); INP_INFO_RUNLOCK(&V_tcbinfo); - if ((inp->inp_vflag & INP_DROPPED) || callout_pending(&tp->t_timers->tt_delack) + if ((inp->inp_flags & INP_DROPPED) || callout_pending(&tp->t_timers->tt_delack) || !callout_active(&tp->t_timers->tt_delack)) { INP_WUNLOCK(inp); CURVNET_RESTORE(); @@ -229,7 +229,7 @@ tcp_timer_2msl(void *xtp) } INP_WLOCK(inp); tcp_free_sackholes(tp); - if ((inp->inp_vflag & INP_DROPPED) || callout_pending(&tp->t_timers->tt_2msl) || + if ((inp->inp_flags & INP_DROPPED) || callout_pending(&tp->t_timers->tt_2msl) || !callout_active(&tp->t_timers->tt_2msl)) { INP_WUNLOCK(tp->t_inpcb); INP_INFO_WUNLOCK(&V_tcbinfo); @@ -301,7 +301,7 @@ tcp_timer_keep(void *xtp) return; } INP_WLOCK(inp); - if ((inp->inp_vflag & INP_DROPPED) || callout_pending(&tp->t_timers->tt_keep) + if ((inp->inp_flags & INP_DROPPED) || callout_pending(&tp->t_timers->tt_keep) || !callout_active(&tp->t_timers->tt_keep)) { INP_WUNLOCK(inp); INP_INFO_WUNLOCK(&V_tcbinfo); @@ -397,7 +397,7 @@ tcp_timer_persist(void *xtp) return; } INP_WLOCK(inp); - if ((inp->inp_vflag & INP_DROPPED) || callout_pending(&tp->t_timers->tt_persist) + if ((inp->inp_flags & INP_DROPPED) || callout_pending(&tp->t_timers->tt_persist) || !callout_active(&tp->t_timers->tt_persist)) { INP_WUNLOCK(inp); INP_INFO_WUNLOCK(&V_tcbinfo); @@ -471,7 +471,7 @@ tcp_timer_rexmt(void * xtp) return; } INP_WLOCK(inp); - if ((inp->inp_vflag & INP_DROPPED) || callout_pending(&tp->t_timers->tt_rexmt) + if ((inp->inp_flags & INP_DROPPED) || callout_pending(&tp->t_timers->tt_rexmt) || !callout_active(&tp->t_timers->tt_rexmt)) { INP_WUNLOCK(inp); INP_INFO_WUNLOCK(&V_tcbinfo); Modified: head/sys/netinet/tcp_timewait.c ============================================================================== --- head/sys/netinet/tcp_timewait.c Sun Mar 15 09:26:56 2009 (r189847) +++ head/sys/netinet/tcp_timewait.c Sun Mar 15 09:58:31 2009 (r189848) @@ -265,17 +265,17 @@ tcp_twstart(struct tcpcb *tp) if (acknow) tcp_twrespond(tw, TH_ACK); inp->inp_ppcb = tw; - inp->inp_vflag |= INP_TIMEWAIT; + inp->inp_flags |= INP_TIMEWAIT; tcp_tw_2msl_reset(tw, 0); /* * If the inpcb owns the sole reference to the socket, then we can * detach and free the socket as it is not needed in time wait. */ - if (inp->inp_vflag & INP_SOCKREF) { + if (inp->inp_flags & INP_SOCKREF) { KASSERT(so->so_state & SS_PROTOREF, ("tcp_twstart: !SS_PROTOREF")); - inp->inp_vflag &= ~INP_SOCKREF; + inp->inp_flags &= ~INP_SOCKREF; INP_WUNLOCK(inp); ACCEPT_LOCK(); SOCK_LOCK(so); @@ -435,7 +435,7 @@ tcp_twclose(struct tcptw *tw, int reuse) * notify the socket layer. */ inp = tw->tw_inpcb; - KASSERT((inp->inp_vflag & INP_TIMEWAIT), ("tcp_twclose: !timewait")); + KASSERT((inp->inp_flags & INP_TIMEWAIT), ("tcp_twclose: !timewait")); KASSERT(intotw(inp) == tw, ("tcp_twclose: inp_ppcb != tw")); INP_INFO_WLOCK_ASSERT(&V_tcbinfo); /* tcp_tw_2msl_stop(). */ INP_WLOCK_ASSERT(inp); @@ -453,8 +453,8 @@ tcp_twclose(struct tcptw *tw, int reuse) * in which case another reference exists (XXXRW: think * about this more), and we don't need to take action. */ - if (inp->inp_vflag & INP_SOCKREF) { - inp->inp_vflag &= ~INP_SOCKREF; + if (inp->inp_flags & INP_SOCKREF) { + inp->inp_flags &= ~INP_SOCKREF; INP_WUNLOCK(inp); ACCEPT_LOCK(); SOCK_LOCK(so); Modified: head/sys/netinet/tcp_usrreq.c ============================================================================== --- head/sys/netinet/tcp_usrreq.c Sun Mar 15 09:26:56 2009 (r189847) +++ head/sys/netinet/tcp_usrreq.c Sun Mar 15 09:58:31 2009 (r189848) @@ -169,7 +169,7 @@ tcp_detach(struct socket *so, struct inp tp = intotcpcb(inp); - if (inp->inp_vflag & INP_TIMEWAIT) { + if (inp->inp_flags & INP_TIMEWAIT) { /* * There are two cases to handle: one in which the time wait * state is being discarded (INP_DROPPED), and one in which @@ -182,7 +182,7 @@ tcp_detach(struct socket *so, struct inp * * XXXRW: Would it be cleaner to free the tcptw here? */ - if (inp->inp_vflag & INP_DROPPED) { + if (inp->inp_flags & INP_DROPPED) { KASSERT(tp == NULL, ("tcp_detach: INP_TIMEWAIT && " "INP_DROPPED && tp != NULL")); in_pcbdetach(inp); @@ -201,7 +201,7 @@ tcp_detach(struct socket *so, struct inp * * XXXRW: Does the second case still occur? */ - if (inp->inp_vflag & INP_DROPPED || + if (inp->inp_flags & INP_DROPPED || tp->t_state < TCPS_SYN_SENT) { tcp_discardcb(tp); in_pcbdetach(inp); @@ -262,7 +262,7 @@ tcp_usr_bind(struct socket *so, struct s inp = sotoinpcb(so); KASSERT(inp != NULL, ("tcp_usr_bind: inp == NULL")); INP_WLOCK(inp); - if (inp->inp_vflag & (INP_TIMEWAIT | INP_DROPPED)) { + if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) { error = EINVAL; goto out; } @@ -303,7 +303,7 @@ tcp6_usr_bind(struct socket *so, struct inp = sotoinpcb(so); KASSERT(inp != NULL, ("tcp6_usr_bind: inp == NULL")); INP_WLOCK(inp); - if (inp->inp_vflag & (INP_TIMEWAIT | INP_DROPPED)) { + if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) { error = EINVAL; goto out; } @@ -350,7 +350,7 @@ tcp_usr_listen(struct socket *so, int ba inp = sotoinpcb(so); KASSERT(inp != NULL, ("tcp_usr_listen: inp == NULL")); INP_WLOCK(inp); - if (inp->inp_vflag & (INP_TIMEWAIT | INP_DROPPED)) { + if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) { error = EINVAL; goto out; } @@ -388,7 +388,7 @@ tcp6_usr_listen(struct socket *so, int b inp = sotoinpcb(so); KASSERT(inp != NULL, ("tcp6_usr_listen: inp == NULL")); INP_WLOCK(inp); - if (inp->inp_vflag & (INP_TIMEWAIT | INP_DROPPED)) { + if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) { error = EINVAL; goto out; } @@ -449,7 +449,7 @@ tcp_usr_connect(struct socket *so, struc inp = sotoinpcb(so); KASSERT(inp != NULL, ("tcp_usr_connect: inp == NULL")); INP_WLOCK(inp); - if (inp->inp_vflag & (INP_TIMEWAIT | INP_DROPPED)) { + if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) { error = EINVAL; goto out; } @@ -491,7 +491,7 @@ tcp6_usr_connect(struct socket *so, stru inp = sotoinpcb(so); KASSERT(inp != NULL, ("tcp6_usr_connect: inp == NULL")); INP_WLOCK(inp); - if (inp->inp_vflag & (INP_TIMEWAIT | INP_DROPPED)) { + if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) { error = EINVAL; goto out; } @@ -557,7 +557,7 @@ tcp_usr_disconnect(struct socket *so) inp = sotoinpcb(so); KASSERT(inp != NULL, ("tcp_usr_disconnect: inp == NULL")); INP_WLOCK(inp); - if (inp->inp_vflag & (INP_TIMEWAIT | INP_DROPPED)) { + if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) { error = ECONNRESET; goto out; } @@ -594,7 +594,7 @@ tcp_usr_accept(struct socket *so, struct KASSERT(inp != NULL, ("tcp_usr_accept: inp == NULL")); INP_INFO_RLOCK(&V_tcbinfo); INP_WLOCK(inp); - if (inp->inp_vflag & (INP_TIMEWAIT | INP_DROPPED)) { + if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) { error = ECONNABORTED; goto out; } @@ -637,7 +637,7 @@ tcp6_usr_accept(struct socket *so, struc inp = sotoinpcb(so); KASSERT(inp != NULL, ("tcp6_usr_accept: inp == NULL")); INP_WLOCK(inp); - if (inp->inp_vflag & (INP_TIMEWAIT | INP_DROPPED)) { + if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) { error = ECONNABORTED; goto out; } @@ -687,7 +687,7 @@ tcp_usr_shutdown(struct socket *so) inp = sotoinpcb(so); KASSERT(inp != NULL, ("inp == NULL")); INP_WLOCK(inp); - if (inp->inp_vflag & (INP_TIMEWAIT | INP_DROPPED)) { + if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) { error = ECONNRESET; goto out; } @@ -695,7 +695,7 @@ tcp_usr_shutdown(struct socket *so) TCPDEBUG1(); socantsendmore(so); tcp_usrclosed(tp); - if (!(inp->inp_vflag & INP_DROPPED)) + if (!(inp->inp_flags & INP_DROPPED)) error = tcp_output_disconnect(tp); out: @@ -720,7 +720,7 @@ tcp_usr_rcvd(struct socket *so, int flag inp = sotoinpcb(so); KASSERT(inp != NULL, ("tcp_usr_rcvd: inp == NULL")); INP_WLOCK(inp); - if (inp->inp_vflag & (INP_TIMEWAIT | INP_DROPPED)) { + if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) { error = ECONNRESET; goto out; } @@ -771,7 +771,7 @@ tcp_usr_send(struct socket *so, int flag inp = sotoinpcb(so); KASSERT(inp != NULL, ("tcp_usr_send: inp == NULL")); INP_WLOCK(inp); - if (inp->inp_vflag & (INP_TIMEWAIT | INP_DROPPED)) { + if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) { if (control) m_freem(control); if (m) @@ -829,7 +829,7 @@ tcp_usr_send(struct socket *so, int flag INP_INFO_WUNLOCK(&V_tcbinfo); headlocked = 0; } - if (!(inp->inp_vflag & INP_DROPPED)) { + if (!(inp->inp_flags & INP_DROPPED)) { if (flags & PRUS_MORETOCOME) tp->t_flags |= TF_MORETOCOME; error = tcp_output_send(tp); @@ -917,18 +917,18 @@ tcp_usr_abort(struct socket *so) /* * If we still have full TCP state, and we're not dropped, drop. */ - if (!(inp->inp_vflag & INP_TIMEWAIT) && - !(inp->inp_vflag & INP_DROPPED)) { + if (!(inp->inp_flags & INP_TIMEWAIT) && + !(inp->inp_flags & INP_DROPPED)) { tp = intotcpcb(inp); TCPDEBUG1(); tcp_drop(tp, ECONNABORTED); TCPDEBUG2(PRU_ABORT); } - if (!(inp->inp_vflag & INP_DROPPED)) { + if (!(inp->inp_flags & INP_DROPPED)) { SOCK_LOCK(so); so->so_state |= SS_PROTOREF; SOCK_UNLOCK(so); - inp->inp_vflag |= INP_SOCKREF; + inp->inp_flags |= INP_SOCKREF; } INP_WUNLOCK(inp); INP_INFO_WUNLOCK(&V_tcbinfo); @@ -957,18 +957,18 @@ tcp_usr_close(struct socket *so) * If we still have full TCP state, and we're not dropped, initiate * a disconnect. */ - if (!(inp->inp_vflag & INP_TIMEWAIT) && - !(inp->inp_vflag & INP_DROPPED)) { + if (!(inp->inp_flags & INP_TIMEWAIT) && + !(inp->inp_flags & INP_DROPPED)) { tp = intotcpcb(inp); TCPDEBUG1(); tcp_disconnect(tp); TCPDEBUG2(PRU_CLOSE); } - if (!(inp->inp_vflag & INP_DROPPED)) { + if (!(inp->inp_flags & INP_DROPPED)) { SOCK_LOCK(so); so->so_state |= SS_PROTOREF; SOCK_UNLOCK(so); - inp->inp_vflag |= INP_SOCKREF; + inp->inp_flags |= INP_SOCKREF; } INP_WUNLOCK(inp); INP_INFO_WUNLOCK(&V_tcbinfo); @@ -988,7 +988,7 @@ tcp_usr_rcvoob(struct socket *so, struct inp = sotoinpcb(so); KASSERT(inp != NULL, ("tcp_usr_rcvoob: inp == NULL")); INP_WLOCK(inp); - if (inp->inp_vflag & (INP_TIMEWAIT | INP_DROPPED)) { + if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) { error = ECONNRESET; goto out; } @@ -1241,7 +1241,7 @@ tcp_fill_info(struct tcpcb *tp, struct t */ #define INP_WLOCK_RECHECK(inp) do { \ INP_WLOCK(inp); \ - if (inp->inp_vflag & (INP_TIMEWAIT | INP_DROPPED)) { \ + if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) { \ INP_WUNLOCK(inp); \ return (ECONNRESET); \ } \ @@ -1275,7 +1275,7 @@ tcp_ctloutput(struct socket *so, struct #endif return (error); } - if (inp->inp_vflag & (INP_TIMEWAIT | INP_DROPPED)) { + if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) { INP_WUNLOCK(inp); return (ECONNRESET); } @@ -1515,7 +1515,7 @@ tcp_disconnect(struct tcpcb *tp) soisdisconnecting(so); sbflush(&so->so_rcv); tcp_usrclosed(tp); - if (!(inp->inp_vflag & INP_DROPPED)) + if (!(inp->inp_flags & INP_DROPPED)) tcp_output_disconnect(tp); } } Modified: head/sys/netinet6/in6_pcb.c ============================================================================== --- head/sys/netinet6/in6_pcb.c Sun Mar 15 09:26:56 2009 (r189847) +++ head/sys/netinet6/in6_pcb.c Sun Mar 15 09:58:31 2009 (r189848) @@ -197,7 +197,7 @@ in6_pcbbind(register struct inpcb *inp, &sin6->sin6_addr, lport, INPLOOKUP_WILDCARD, cred); if (t && - ((t->inp_vflag & INP_TIMEWAIT) == 0) && + ((t->inp_flags & INP_TIMEWAIT) == 0) && (so->so_type != SOCK_STREAM || IN6_IS_ADDR_UNSPECIFIED(&t->in6p_faddr)) && (!IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr) || @@ -215,7 +215,7 @@ in6_pcbbind(register struct inpcb *inp, sin.sin_addr, lport, INPLOOKUP_WILDCARD, cred); if (t && - ((t->inp_vflag & + ((t->inp_flags & INP_TIMEWAIT) == 0) && (so->so_type != SOCK_STREAM || ntohl(t->inp_faddr.s_addr) == @@ -227,7 +227,7 @@ in6_pcbbind(register struct inpcb *inp, } t = in6_pcblookup_local(pcbinfo, &sin6->sin6_addr, lport, wild, cred); - if (t && (reuseport & ((t->inp_vflag & INP_TIMEWAIT) ? + if (t && (reuseport & ((t->inp_flags & INP_TIMEWAIT) ? intotw(t)->tw_so_options : t->inp_socket->so_options)) == 0) return (EADDRINUSE); @@ -238,7 +238,7 @@ in6_pcbbind(register struct inpcb *inp, in6_sin6_2_sin(&sin, sin6); t = in_pcblookup_local(pcbinfo, sin.sin_addr, lport, wild, cred); - if (t && t->inp_vflag & INP_TIMEWAIT) { + if (t && t->inp_flags & INP_TIMEWAIT) { if ((reuseport & intotw(t)->tw_so_options) == 0 && (ntohl(t->inp_laddr.s_addr) != Modified: head/usr.bin/netstat/inet.c ============================================================================== --- head/usr.bin/netstat/inet.c Sun Mar 15 09:26:56 2009 (r189847) +++ head/usr.bin/netstat/inet.c Sun Mar 15 09:58:31 2009 (r189848) @@ -257,7 +257,7 @@ pcblist_kvm(u_long off, char **bufp, int if (istcp) { if (inp->inp_ppcb == NULL) bzero(&xt.xt_tp, sizeof xt.xt_tp); - else if (inp->inp_vflag & INP_TIMEWAIT) { + else if (inp->inp_flags & INP_TIMEWAIT) { bzero(&xt.xt_tp, sizeof xt.xt_tp); xt.xt_tp.t_state = TCPS_TIME_WAIT; } else Modified: head/usr.bin/systat/netstat.c ============================================================================== --- head/usr.bin/systat/netstat.c Sun Mar 15 09:26:56 2009 (r189847) +++ head/usr.bin/systat/netstat.c Sun Mar 15 09:58:31 2009 (r189848) @@ -222,7 +222,7 @@ again: if (nports && !checkport(&inpcb)) continue; if (istcp) { - if (inpcb.inp_vflag & INP_TIMEWAIT) { + if (inpcb.inp_flags & INP_TIMEWAIT) { bzero(&sockb, sizeof(sockb)); enter_kvm(&inpcb, &sockb, TCPS_TIME_WAIT, "tcp"); From owner-svn-src-head@FreeBSD.ORG Sun Mar 15 13:14:06 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AFF5E106564A; Sun, 15 Mar 2009 13:14:06 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9340D8FC1D; Sun, 15 Mar 2009 13:14:06 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2FDE6Zj029990; Sun, 15 Mar 2009 13:14:06 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2FDE6Zx029988; Sun, 15 Mar 2009 13:14:06 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <200903151314.n2FDE6Zx029988@svn.freebsd.org> From: Gabor Kovesdan Date: Sun, 15 Mar 2009 13:14: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: r189850 - in head: . lib/libc/nls X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 15 Mar 2009 13:14:07 -0000 Author: gabor (doc,ports committer) Date: Sun Mar 15 13:14:06 2009 New Revision: 189850 URL: http://svn.freebsd.org/changeset/base/189850 Log: - Create the buildworld object directories with mtree instead of various mkdir calls - Remove the ugly workaroung from libc NLS, which was to create some of these directories Modified: head/Makefile.inc1 head/lib/libc/nls/Makefile.inc Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sun Mar 15 10:43:48 2009 (r189849) +++ head/Makefile.inc1 Sun Mar 15 13:14:06 2009 (r189850) @@ -344,30 +344,13 @@ _worldtmp: rm -f ${OBJTREE}${.CURDIR}/usr.bin/truss/ioctl.c .endif .for _dir in \ - usr/bin usr/games usr/include/sys usr/lib \ - usr/libexec usr/sbin usr/share/dict \ - usr/share/groff_font/devX100 \ - usr/share/groff_font/devX100-12 \ - usr/share/groff_font/devX75 \ - usr/share/groff_font/devX75-12 \ - usr/share/groff_font/devascii \ - usr/share/groff_font/devcp1047 \ - usr/share/groff_font/devdvi \ - usr/share/groff_font/devhtml \ - usr/share/groff_font/devkoi8-r \ - usr/share/groff_font/devlatin1 \ - usr/share/groff_font/devlbp \ - usr/share/groff_font/devlj4 \ - usr/share/groff_font/devps \ - usr/share/groff_font/devutf8 \ - usr/share/tmac/mdoc usr/share/tmac/mm - mkdir -p ${WORLDTMP}/legacy/${_dir} -.endfor -.for _dir in \ - lib usr/bin usr/include usr/lib/compat/aout usr/libdata/ldscripts \ - usr/libexec usr/sbin usr/share/misc + lib usr legacy/usr mkdir -p ${WORLDTMP}/${_dir} .endfor + mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \ + -p ${WORLDTMP}/legacy/usr >/dev/null + mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \ + -p ${WORLDTMP}/usr >/dev/null mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \ -p ${WORLDTMP}/usr/include >/dev/null ln -sf ${.CURDIR}/sys ${WORLDTMP} @@ -448,10 +431,9 @@ build32: @echo "--------------------------------------------------------------" @echo ">>> stage 5.1: building 32 bit shim libraries" @echo "--------------------------------------------------------------" -.for _dir in \ - usr/include usr/lib32 usr/share/misc - mkdir -p ${LIB32TMP}/${_dir} -.endfor + mkdir -p ${LIB32TMP}/usr/lib32 + mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \ + -p ${LIB32TMP}/usr >/dev/null mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \ -p ${LIB32TMP}/usr/include >/dev/null mkdir -p ${WORLDTMP} Modified: head/lib/libc/nls/Makefile.inc ============================================================================== --- head/lib/libc/nls/Makefile.inc Sun Mar 15 10:43:48 2009 (r189849) +++ head/lib/libc/nls/Makefile.inc Sun Mar 15 13:14:06 2009 (r189850) @@ -30,9 +30,3 @@ NLS+= pl_PL.ISO8859-2 NLS+= ru_RU.KOI8-R NLS+= sk_SK.ISO8859-2 NLS+= sv_SE.ISO8859-1 - -.BEGIN: -.for c in ${NLS} - mkdir -p ${CANONICALOBJDIR}/../../lib32/usr/share/nls/${c} - mkdir -p ${CANONICALOBJDIR}/../../tmp/usr/share/nls/${c} -.endfor From owner-svn-src-head@FreeBSD.ORG Sun Mar 15 14:21:06 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 62809106566C; Sun, 15 Mar 2009 14:21:06 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4DD388FC18; Sun, 15 Mar 2009 14:21:06 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2FEL61B031308; Sun, 15 Mar 2009 14:21:06 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2FEL5Ra031289; Sun, 15 Mar 2009 14:21:05 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200903151421.n2FEL5Ra031289@svn.freebsd.org> From: Robert Watson Date: Sun, 15 Mar 2009 14:21: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: r189851 - in head/sys: conf i386/conf kern modules modules/netgraph net netinet netinet6 netnatm pc98/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: Sun, 15 Mar 2009 14:21:06 -0000 Author: rwatson Date: Sun Mar 15 14:21:05 2009 New Revision: 189851 URL: http://svn.freebsd.org/changeset/base/189851 Log: Remove IFF_NEEDSGIANT, a compatibility infrastructure introduced in FreeBSD 5.x to allow network device drivers to run with Giant despite the network stack being Giant-free. This significantly simplifies calls into ioctl() on network interfaces, especially in the multicast code, as well as eliminates deferred invocation of interface if_start routines. Disable the build on device drivers still depending on IFF_NEEDSGIANT as they no longer compile. They will be removed in a few weeks if they haven't been made MPSAFE in that time. Disabled drivers: if_ar if_axe if_aue if_cdce if_cue if_kue if_ray if_rue if_rum if_sr if_udav if_ural if_zyd Drivers that were already disabled because of tty changes: if_ppp if_sl Discussed on: arch@ Modified: head/sys/conf/NOTES head/sys/conf/files head/sys/conf/files.i386 head/sys/conf/files.pc98 head/sys/conf/options head/sys/i386/conf/NOTES head/sys/kern/kern_poll.c head/sys/modules/Makefile head/sys/modules/netgraph/Makefile head/sys/net/if.c head/sys/net/if_bridge.c head/sys/net/if_var.h head/sys/netinet/in.c head/sys/netinet/in_mcast.c head/sys/netinet6/in6.c head/sys/netinet6/in6_ifattach.c head/sys/netinet6/mld6.c head/sys/netnatm/natm.c head/sys/pc98/conf/NOTES Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Sun Mar 15 13:14:06 2009 (r189850) +++ head/sys/conf/NOTES Sun Mar 15 14:21:05 2009 (r189851) @@ -765,10 +765,6 @@ device arcnet # of synchronous PPP links (like `cx', `ar'). device sppp -# The `sl' device implements the Serial Line IP (SLIP) service. -# The `ppp' device implements the Point-to-Point Protocol. - - # The `bpf' device enables the Berkeley Packet Filter. Be # aware of the legal and administrative consequences of enabling this # option. The number of devices determines the maximum number of @@ -837,15 +833,6 @@ device enc device lagg # -# The PPP_BSDCOMP option enables support for compress(1) style entire -# packet compression, the PPP_DEFLATE is for zlib/gzip style compression. -# PPP_FILTER enables code for filtering the ppp data stream and selecting -# events for resetting the demand dial activity timer - requires bpf. -# See pppd(8) for more details. -# - - -# # Internet family options: # # MROUTING enables the kernel multicast packet forwarder, which works @@ -2678,7 +2665,6 @@ options SC_DEBUG_LEVEL=5 # Syscons debu options SC_RENDER_DEBUG # syscons rendering debugging options SHOW_BUSYBUFS # List buffers that prevent root unmount -options SLIP_IFF_OPTS options VFS_BIO_DEBUG # VFS buffer I/O debugging options KSTACK_MAX_PAGES=32 # Maximum pages to give the kernel stack Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun Mar 15 13:14:06 2009 (r189850) +++ head/sys/conf/files Sun Mar 15 14:21:05 2009 (r189851) @@ -1306,7 +1306,6 @@ dev/random/probe.c optional random dev/random/randomdev.c optional random dev/random/randomdev_soft.c optional random dev/random/yarrow.c optional random -dev/ray/if_ray.c optional ray pccard dev/rc/rc.c optional rc dev/re/if_re.c optional re dev/rndtest/rndtest.c optional rndtest @@ -1424,8 +1423,6 @@ dev/sound/midi/synth_if.m optional sound dev/spibus/spibus.c optional spibus \ dependency "spibus_if.h" dev/spibus/spibus_if.m optional spibus -dev/sr/if_sr.c optional sr -dev/sr/if_sr_pci.c optional sr pci dev/ste/if_ste.c optional ste pci dev/stg/tmc18c30.c optional stg dev/stg/tmc18c30_isa.c optional stg isa @@ -1502,15 +1499,6 @@ legacy/dev/usb/ehci_ddb.c optional oehci legacy/dev/usb/ehci_pci.c optional oehci pci legacy/dev/usb/hid.c optional ousb legacy/dev/usb/if_aue.c optional oaue -legacy/dev/usb/if_axe.c optional oaxe -legacy/dev/usb/if_cdce.c optional ocdce -legacy/dev/usb/if_cue.c optional ocue -legacy/dev/usb/if_kue.c optional okue -legacy/dev/usb/if_ural.c optional oural -legacy/dev/usb/if_rue.c optional orue -legacy/dev/usb/if_rum.c optional orum -legacy/dev/usb/if_udav.c optional oudav -legacy/dev/usb/if_zyd.c optional ozyd legacy/dev/usb/ohci.c optional oohci legacy/dev/usb/ohci_pci.c optional oohci pci legacy/dev/usb/sl811hs.c optional oslhci @@ -2160,7 +2148,6 @@ net/bpf_jitter.c optional bpf_jitter net/bpf_filter.c optional bpf | netgraph_bpf net/bpf_zerocopy.c optional bpf net/bridgestp.c optional bridge | if_bridge -net/bsd_comp.c optional ppp_bsdcomp net/ieee8023ad_lacp.c optional lagg net/if.c standard net/if_arcsubr.c optional arcnet @@ -2184,8 +2171,6 @@ net/if_loop.c optional loop net/if_llatbl.c standard net/if_media.c standard net/if_mib.c standard -net/if_ppp.c optional ppp -net/if_sl.c optional sl net/if_spppfr.c optional sppp | netgraph_sppp net/if_spppsubr.c optional sppp | netgraph_sppp net/if_stf.c optional stf @@ -2195,8 +2180,6 @@ net/if_vlan.c optional vlan net/mppcc.c optional netgraph_mppc_compression net/mppcd.c optional netgraph_mppc_compression net/netisr.c standard -net/ppp_deflate.c optional ppp_deflate -net/ppp_tty.c optional ppp net/pfil.c optional ether | inet net/radix.c standard net/radix_mpath.c standard @@ -2204,10 +2187,10 @@ net/raw_cb.c standard net/raw_usrreq.c standard net/route.c standard net/rtsock.c standard -net/slcompress.c optional netgraph_vjc | ppp | sl | sppp | \ +net/slcompress.c optional netgraph_vjc | sppp | \ netgraph_sppp net/zlib.c optional crypto | geom_uzip | ipsec | \ - mxge | ppp_deflate | netgraph_deflate | \ + mxge | netgraph_deflate | \ ddb_ctf net80211/ieee80211.c optional wlan net80211/ieee80211_acl.c optional wlan_acl Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Sun Mar 15 13:14:06 2009 (r189850) +++ head/sys/conf/files.i386 Sun Mar 15 14:21:05 2009 (r189851) @@ -130,9 +130,6 @@ dev/agp/agp_via.c optional agp dev/aic/aic_isa.c optional aic isa dev/amdtemp/amdtemp.c optional amdtemp dev/arcmsr/arcmsr.c optional arcmsr pci -dev/ar/if_ar.c optional ar -dev/ar/if_ar_isa.c optional ar isa -dev/ar/if_ar_pci.c optional ar pci dev/asmc/asmc.c optional asmc isa dev/atkbdc/atkbd.c optional atkbd atkbdc dev/atkbdc/atkbd_atkbdc.c optional atkbd atkbdc @@ -218,7 +215,6 @@ dev/sio/sio_pccard.c optional sio pccar dev/sio/sio_pci.c optional sio pci dev/sio/sio_puc.c optional sio puc dev/speaker/spkr.c optional speaker -dev/sr/if_sr_isa.c optional sr isa dev/syscons/apm/apm_saver.c optional apm_saver apm dev/syscons/scterm-teken.c optional sc dev/syscons/scvesactl.c optional sc vga vesa Modified: head/sys/conf/files.pc98 ============================================================================== --- head/sys/conf/files.pc98 Sun Mar 15 13:14:06 2009 (r189850) +++ head/sys/conf/files.pc98 Sun Mar 15 14:21:05 2009 (r189851) @@ -85,8 +85,6 @@ dev/agp/agp_nvidia.c optional agp dev/agp/agp_sis.c optional agp dev/agp/agp_via.c optional agp dev/aic/aic_cbus.c optional aic isa -dev/ar/if_ar.c optional ar -dev/ar/if_ar_pci.c optional ar pci dev/ce/ceddk.c optional ce dev/ce/if_ce.c optional ce dev/ce/tau32-ddk.c optional ce Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Sun Mar 15 13:14:06 2009 (r189850) +++ head/sys/conf/options Sun Mar 15 14:21:05 2009 (r189851) @@ -407,9 +407,6 @@ MROUTING opt_mrouting.h NCP NETATALK opt_atalk.h NFSLOCKD -PPP_BSDCOMP opt_ppp.h -PPP_DEFLATE opt_ppp.h -PPP_FILTER opt_ppp.h RADIX_MPATH opt_mpath.h ROUTETABLES opt_route.h COMPAT_ROUTE_FLAGS opt_route.h Modified: head/sys/i386/conf/NOTES ============================================================================== --- head/sys/i386/conf/NOTES Sun Mar 15 13:14:06 2009 (r189850) +++ head/sys/i386/conf/NOTES Sun Mar 15 14:21:05 2009 (r189851) @@ -528,8 +528,6 @@ hint.mse.0.irq="5" # Network interfaces: # -# ar: Arnet SYNC/570i hdlc sync 2/4 port V.35/X.21 serial driver -# (requires sppp) # ath: Atheros a/b/g WiFi adapters (requires ath_hal and wlan) # ce: Cronyx Tau-PCI/32 sync single/dual port G.703/E1 serial adaptor # with 32 HDLC subchannels (requires sppp (default), or NETGRAPH if @@ -554,17 +552,11 @@ hint.mse.0.irq="5" # nve: nVidia nForce MCP on-board Ethernet Networking # ral: Ralink Technology IEEE 802.11 wireless adapter # sbni: Granch SBNI12-xx ISA and PCI adapters -# sr: RISCom/N2 hdlc sync 1/2 port V.35/X.21 serial driver (requires sppp) # wl: Lucent Wavelan (ISA card only). # wpi: Intel 3945ABG Wireless LAN controller # Order for ISA/EISA devices is important here -device ar -hint.ar.0.at="isa" -hint.ar.0.port="0x300" -hint.ar.0.irq="10" -hint.ar.0.maddr="0xd0000" device ath # Atheros pci/cardbus NIC's device ath_hal # pci/cardbus chip support #device ath_ar5210 # AR5210 chips @@ -619,11 +611,6 @@ hint.sbni.0.at="isa" hint.sbni.0.port="0x210" hint.sbni.0.irq="0xefdead" hint.sbni.0.flags="0" -device sr -hint.sr.0.at="isa" -hint.sr.0.port="0x300" -hint.sr.0.irq="5" -hint.sr.0.maddr="0xd0000" device wl hint.wl.0.at="isa" hint.wl.0.port="0x300" Modified: head/sys/kern/kern_poll.c ============================================================================== --- head/sys/kern/kern_poll.c Sun Mar 15 13:14:06 2009 (r189850) +++ head/sys/kern/kern_poll.c Sun Mar 15 14:21:05 2009 (r189851) @@ -551,9 +551,7 @@ poll_switch(SYSCTL_HANDLER_ARGS) else ifr.ifr_reqcap = ifp->if_capenable & ~IFCAP_POLLING; - IFF_LOCKGIANT(ifp); /* LOR here */ (void) (*ifp->if_ioctl)(ifp, SIOCSIFCAP, (caddr_t)&ifr); - IFF_UNLOCKGIANT(ifp); } } IFNET_RUNLOCK(); Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Sun Mar 15 13:14:06 2009 (r189850) +++ head/sys/modules/Makefile Sun Mar 15 14:21:05 2009 (r189851) @@ -24,7 +24,6 @@ SUBDIR= ${_3dfx} \ ${_an} \ ${_aout} \ ${_apm} \ - ${_ar} \ ${_arcmsr} \ ${_arcnet} \ ${_asmc} \ @@ -219,7 +218,6 @@ SUBDIR= ${_3dfx} \ puc \ ral \ ${_random} \ - ${_ray} \ rc4 \ ${_rdma} \ re \ @@ -244,7 +242,6 @@ SUBDIR= ${_3dfx} \ ${_speaker} \ ${_splash} \ ${_sppp} \ - ${_sr} \ ste \ ${_stg} \ stge \ @@ -332,7 +329,6 @@ _amd= amd _an= an _aout= aout _apm= apm -_ar= ar _arcnet= arcnet _bktr= bktr _cardbus= cardbus @@ -385,7 +381,6 @@ _opensolaris= opensolaris _pccard= pccard _pcfclock= pcfclock _pst= pst -_ray= ray _rdma= rdma _safe= safe _sbni= sbni @@ -395,7 +390,6 @@ _sound= sound _speaker= speaker _splash= splash _sppp= sppp -_sr= sr _stg= stg _streams= streams _svr4= svr4 Modified: head/sys/modules/netgraph/Makefile ============================================================================== --- head/sys/modules/netgraph/Makefile Sun Mar 15 13:14:06 2009 (r189850) +++ head/sys/modules/netgraph/Makefile Sun Mar 15 14:21:05 2009 (r189851) @@ -44,8 +44,6 @@ SUBDIR= async \ source \ split \ sppp \ - ${_sync_ar} \ - ${_sync_sr} \ tag \ tcpmss \ tee \ @@ -54,11 +52,6 @@ SUBDIR= async \ vjc \ vlan -.if ${MACHINE_ARCH} == "i386" -_sync_ar= sync_ar -_sync_sr= sync_sr -.endif - .if ${MK_BLUETOOTH} != "no" || defined(ALL_MODULES) _bluetooth= bluetooth .endif Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Sun Mar 15 13:14:06 2009 (r189850) +++ head/sys/net/if.c Sun Mar 15 14:21:05 2009 (r189851) @@ -138,7 +138,6 @@ static void link_rtrequest(int, struct r static int if_rtdel(struct radix_node *, void *); static int ifhwioctl(u_long, struct ifnet *, caddr_t, struct thread *); static int if_delmulti_locked(struct ifnet *, struct ifmultiaddr *, int); -static void if_start_deferred(void *context, int pending); static void do_link_state_change(void *, int); static int if_getgroup(struct ifgroupreq *, struct ifnet *); static int if_getgroupmembers(struct ifgroupreq *); @@ -582,7 +581,6 @@ if_attach(struct ifnet *ifp) panic ("%s: BUG: if_attach called without if_alloc'd input()\n", ifp->if_xname); - TASK_INIT(&ifp->if_starttask, 0, if_start_deferred, ifp); TASK_INIT(&ifp->if_linktask, 0, do_link_state_change, ifp); IF_AFDATA_LOCK_INIT(ifp); ifp->if_afdata_initialized = 0; @@ -674,9 +672,6 @@ if_attach(struct ifnet *ifp) if (atomic_cmpset_int(&slowtimo_started, 0, 1) && !cold) if_slowtimo(0); } - if (ifp->if_flags & IFF_NEEDSGIANT) - if_printf(ifp, - "WARNING: using obsoleted IFF_NEEDSGIANT flag\n"); } static void @@ -1607,8 +1602,7 @@ if_qflush(struct ifnet *ifp) * call the appropriate interface routine on expiration. * * XXXRW: Note that because timeouts run with Giant, if_watchdog() is called - * holding Giant. If we switch to an MPSAFE callout, we likely need to grab - * Giant before entering if_watchdog() on an IFF_NEEDSGIANT interface. + * holding Giant. */ static void if_slowtimo(void *arg) @@ -1741,9 +1735,7 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, ifp->if_flags = (ifp->if_flags & IFF_CANTCHANGE) | (new_flags &~ IFF_CANTCHANGE); if (ifp->if_ioctl) { - IFF_LOCKGIANT(ifp); (void) (*ifp->if_ioctl)(ifp, cmd, data); - IFF_UNLOCKGIANT(ifp); } getmicrotime(&ifp->if_lastchange); break; @@ -1756,9 +1748,7 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, return (EOPNOTSUPP); if (ifr->ifr_reqcap & ~ifp->if_capabilities) return (EINVAL); - IFF_LOCKGIANT(ifp); error = (*ifp->if_ioctl)(ifp, cmd, data); - IFF_UNLOCKGIANT(ifp); if (error == 0) getmicrotime(&ifp->if_lastchange); break; @@ -1830,9 +1820,7 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, return (error); if (ifp->if_ioctl == NULL) return (EOPNOTSUPP); - IFF_LOCKGIANT(ifp); error = (*ifp->if_ioctl)(ifp, cmd, data); - IFF_UNLOCKGIANT(ifp); if (error == 0) getmicrotime(&ifp->if_lastchange); break; @@ -1848,9 +1836,7 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, return (EINVAL); if (ifp->if_ioctl == NULL) return (EOPNOTSUPP); - IFF_LOCKGIANT(ifp); error = (*ifp->if_ioctl)(ifp, cmd, data); - IFF_UNLOCKGIANT(ifp); if (error == 0) { getmicrotime(&ifp->if_lastchange); rt_ifmsg(ifp); @@ -1920,9 +1906,7 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, return (error); if (ifp->if_ioctl == NULL) return (EOPNOTSUPP); - IFF_LOCKGIANT(ifp); error = (*ifp->if_ioctl)(ifp, cmd, data); - IFF_UNLOCKGIANT(ifp); if (error == 0) getmicrotime(&ifp->if_lastchange); break; @@ -1938,9 +1922,7 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, case SIOCGIFGENERIC: if (ifp->if_ioctl == NULL) return (EOPNOTSUPP); - IFF_LOCKGIANT(ifp); error = (*ifp->if_ioctl)(ifp, cmd, data); - IFF_UNLOCKGIANT(ifp); break; case SIOCSIFLLADDR: @@ -2168,9 +2150,7 @@ if_setflag(struct ifnet *ifp, int flag, } ifr.ifr_flags = ifp->if_flags & 0xffff; ifr.ifr_flagshigh = ifp->if_flags >> 16; - IFF_LOCKGIANT(ifp); error = (*ifp->if_ioctl)(ifp, SIOCSIFFLAGS, (caddr_t)&ifr); - IFF_UNLOCKGIANT(ifp); if (error) goto recover; /* Notify userland that interface flags have changed */ @@ -2540,9 +2520,7 @@ if_addmulti(struct ifnet *ifp, struct so * interface to let them know about it. */ if (ifp->if_ioctl != NULL) { - IFF_LOCKGIANT(ifp); (void) (*ifp->if_ioctl)(ifp, SIOCADDMULTI, 0); - IFF_UNLOCKGIANT(ifp); } if (llsa != NULL) @@ -2601,9 +2579,7 @@ if_delmulti(struct ifnet *ifp, struct so return (ENOENT); if (lastref && ifp->if_ioctl != NULL) { - IFF_LOCKGIANT(ifp); (void)(*ifp->if_ioctl)(ifp, SIOCDELMULTI, 0); - IFF_UNLOCKGIANT(ifp); } return (0); @@ -2613,9 +2589,7 @@ if_delmulti(struct ifnet *ifp, struct so * Delete a multicast group membership by group membership pointer. * Network-layer protocol domains must use this routine. * - * It is safe to call this routine if the ifp disappeared. Callers should - * hold IFF_LOCKGIANT() to avoid a LOR in case the hardware needs to be - * reconfigured. + * It is safe to call this routine if the ifp disappeared. */ void if_delmulti_ifma(struct ifmultiaddr *ifma) @@ -2660,9 +2634,7 @@ if_delmulti_ifma(struct ifmultiaddr *ifm */ IF_ADDR_UNLOCK(ifp); if (lastref && ifp->if_ioctl != NULL) { - IFF_LOCKGIANT(ifp); (void)(*ifp->if_ioctl)(ifp, SIOCDELMULTI, 0); - IFF_UNLOCKGIANT(ifp); } } } @@ -2784,7 +2756,6 @@ if_setlladdr(struct ifnet *ifp, const u_ */ if ((ifp->if_flags & IFF_UP) != 0) { if (ifp->if_ioctl) { - IFF_LOCKGIANT(ifp); ifp->if_flags &= ~IFF_UP; ifr.ifr_flags = ifp->if_flags & 0xffff; ifr.ifr_flagshigh = ifp->if_flags >> 16; @@ -2793,7 +2764,6 @@ if_setlladdr(struct ifnet *ifp, const u_ ifr.ifr_flags = ifp->if_flags & 0xffff; ifr.ifr_flagshigh = ifp->if_flags >> 16; (*ifp->if_ioctl)(ifp, SIOCSIFFLAGS, (caddr_t)&ifr); - IFF_UNLOCKGIANT(ifp); } #ifdef INET /* @@ -2839,39 +2809,11 @@ if_printf(struct ifnet *ifp, const char return (retval); } -/* - * When an interface is marked IFF_NEEDSGIANT, its if_start() routine cannot - * be called without Giant. However, we often can't acquire the Giant lock - * at those points; instead, we run it via a task queue that holds Giant via - * if_start_deferred. - * - * XXXRW: We need to make sure that the ifnet isn't fully detached until any - * outstanding if_start_deferred() tasks that will run after the free. This - * probably means waiting in if_detach(). - */ void if_start(struct ifnet *ifp) { - if (ifp->if_flags & IFF_NEEDSGIANT) { - if (mtx_owned(&Giant)) - (*(ifp)->if_start)(ifp); - else - taskqueue_enqueue(taskqueue_swi_giant, - &ifp->if_starttask); - } else - (*(ifp)->if_start)(ifp); -} - -static void -if_start_deferred(void *context, int pending) -{ - struct ifnet *ifp; - - GIANT_REQUIRED; - - ifp = context; - (ifp->if_start)(ifp); + (*(ifp)->if_start)(ifp); } /* @@ -2908,7 +2850,7 @@ if_handoff(struct ifqueue *ifq, struct m _IF_ENQUEUE(ifq, m); IF_UNLOCK(ifq); if (ifp != NULL && !active) - if_start(ifp); + (*(ifp)->if_start)(ifp); return (1); } Modified: head/sys/net/if_bridge.c ============================================================================== --- head/sys/net/if_bridge.c Sun Mar 15 13:14:06 2009 (r189850) +++ head/sys/net/if_bridge.c Sun Mar 15 14:21:05 2009 (r189851) @@ -829,9 +829,7 @@ bridge_set_ifcap(struct bridge_softc *sc ifr.ifr_reqcap = set; if (ifp->if_capenable != set) { - IFF_LOCKGIANT(ifp); error = (*ifp->if_ioctl)(ifp, SIOCSIFCAP, (caddr_t)&ifr); - IFF_UNLOCKGIANT(ifp); if (error) if_printf(sc->sc_ifp, "error setting interface capabilities on %s\n", Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Sun Mar 15 13:14:06 2009 (r189850) +++ head/sys/net/if_var.h Sun Mar 15 14:21:05 2009 (r189851) @@ -181,7 +181,6 @@ struct ifnet { void *if_afdata[AF_MAX]; int if_afdata_initialized; struct rwlock if_afdata_lock; - struct task if_starttask; /* task for IFF_NEEDSGIANT */ struct task if_linktask; /* task for link change events */ struct mtx if_addr_mtx; /* mutex to protect address lists */ @@ -379,16 +378,6 @@ EVENTHANDLER_DECLARE(group_change_event, #define IF_AFDATA_LOCK_ASSERT(ifp) rw_assert(&(ifp)->if_afdata_lock, RA_LOCKED) #define IF_AFDATA_UNLOCK_ASSERT(ifp) rw_assert(&(ifp)->if_afdata_lock, RA_UNLOCKED) -#define IFF_LOCKGIANT(ifp) do { \ - if ((ifp)->if_flags & IFF_NEEDSGIANT) \ - mtx_lock(&Giant); \ -} while (0) - -#define IFF_UNLOCKGIANT(ifp) do { \ - if ((ifp)->if_flags & IFF_NEEDSGIANT) \ - mtx_unlock(&Giant); \ -} while (0) - int if_handoff(struct ifqueue *ifq, struct mbuf *m, struct ifnet *ifp, int adjust); #define IF_HANDOFF(ifq, m, ifp) \ Modified: head/sys/netinet/in.c ============================================================================== --- head/sys/netinet/in.c Sun Mar 15 13:14:06 2009 (r189850) +++ head/sys/netinet/in.c Sun Mar 15 14:21:05 2009 (r189851) @@ -397,10 +397,8 @@ in_control(struct socket *so, u_long cmd oldaddr = ia->ia_dstaddr; ia->ia_dstaddr = *(struct sockaddr_in *)&ifr->ifr_dstaddr; if (ifp->if_ioctl != NULL) { - IFF_LOCKGIANT(ifp); error = (*ifp->if_ioctl)(ifp, SIOCSIFDSTADDR, (caddr_t)ia); - IFF_UNLOCKGIANT(ifp); if (error) { ia->ia_dstaddr = oldaddr; return (error); @@ -507,10 +505,7 @@ in_control(struct socket *so, u_long cmd default: if (ifp == NULL || ifp->if_ioctl == NULL) return (EOPNOTSUPP); - IFF_LOCKGIANT(ifp); - error = (*ifp->if_ioctl)(ifp, cmd, data); - IFF_UNLOCKGIANT(ifp); - return (error); + return ((*ifp->if_ioctl)(ifp, cmd, data)); } /* @@ -531,7 +526,6 @@ in_control(struct socket *so, u_long cmd IFP_TO_IA(ifp, oia); if (oia == NULL) { ii = ((struct in_ifinfo *)ifp->if_afdata[AF_INET]); - IFF_LOCKGIANT(ifp); IN_MULTI_LOCK(); if (ii->ii_allhosts) { (void)in_leavegroup_locked(ii->ii_allhosts, @@ -539,7 +533,6 @@ in_control(struct socket *so, u_long cmd ii->ii_allhosts = NULL; } IN_MULTI_UNLOCK(); - IFF_UNLOCKGIANT(ifp); } } IFAFREE(&ia->ia_ifa); @@ -753,9 +746,7 @@ in_ifinit(struct ifnet *ifp, struct in_i * and to validate the address if necessary. */ if (ifp->if_ioctl != NULL) { - IFF_LOCKGIANT(ifp); error = (*ifp->if_ioctl)(ifp, SIOCSIFADDR, (caddr_t)ia); - IFF_UNLOCKGIANT(ifp); if (error) { splx(s); /* LIST_REMOVE(ia, ia_hash) is done in in_control */ Modified: head/sys/netinet/in_mcast.c ============================================================================== --- head/sys/netinet/in_mcast.c Sun Mar 15 13:14:06 2009 (r189850) +++ head/sys/netinet/in_mcast.c Sun Mar 15 14:21:05 2009 (r189851) @@ -1100,11 +1100,9 @@ in_joingroup(struct ifnet *ifp, const st { int error; - IFF_LOCKGIANT(ifp); IN_MULTI_LOCK(); error = in_joingroup_locked(ifp, gina, imf, pinm); IN_MULTI_UNLOCK(); - IFF_UNLOCKGIANT(ifp); return (error); } @@ -1181,20 +1179,14 @@ int in_leavegroup(struct in_multi *inm, /*const*/ struct in_mfilter *imf) { struct ifnet *ifp; - int detached, error; + int error; - detached = inm_is_ifp_detached(inm); ifp = inm->inm_ifp; - if (!detached) - IFF_LOCKGIANT(ifp); IN_MULTI_LOCK(); error = in_leavegroup_locked(inm, imf); IN_MULTI_UNLOCK(); - if (!detached) - IFF_UNLOCKGIANT(ifp); - return (error); } @@ -1396,8 +1388,6 @@ inp_block_unblock_source(struct inpcb *i if (!IN_MULTICAST(ntohl(gsa->sin.sin_addr.s_addr))) return (EINVAL); - IFF_LOCKGIANT(ifp); - /* * Check if we are actually a member of this group. */ @@ -1486,7 +1476,6 @@ out_imf_rollback: out_inp_locked: INP_WUNLOCK(inp); - IFF_UNLOCKGIANT(ifp); return (error); } @@ -1978,8 +1967,6 @@ inp_join_group(struct inpcb *inp, struct if (ifp == NULL || (ifp->if_flags & IFF_MULTICAST) == 0) return (EADDRNOTAVAIL); - IFF_LOCKGIANT(ifp); - /* * MCAST_JOIN_SOURCE on an exclusive membership is an error. * On an existing inclusive membership, it just adds the @@ -2102,7 +2089,6 @@ out_imo_free: out_inp_locked: INP_WUNLOCK(inp); - IFF_UNLOCKGIANT(ifp); return (error); } @@ -2215,9 +2201,6 @@ inp_leave_group(struct inpcb *inp, struc if (!IN_MULTICAST(ntohl(gsa->sin.sin_addr.s_addr))) return (EINVAL); - if (ifp) - IFF_LOCKGIANT(ifp); - /* * Find the membership in the membership array. */ @@ -2312,8 +2295,6 @@ out_imf_rollback: out_inp_locked: INP_WUNLOCK(inp); - if (ifp) - IFF_UNLOCKGIANT(ifp); return (error); } @@ -2432,8 +2413,6 @@ inp_set_source_filters(struct inpcb *inp if (ifp == NULL) return (EADDRNOTAVAIL); - IFF_LOCKGIANT(ifp); - /* * Take the INP write lock. * Check if this socket is a member of this group. @@ -2551,7 +2530,6 @@ out_imf_rollback: out_inp_locked: INP_WUNLOCK(inp); - IFF_UNLOCKGIANT(ifp); return (error); } Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Sun Mar 15 13:14:06 2009 (r189850) +++ head/sys/netinet6/in6.c Sun Mar 15 14:21:05 2009 (r189851) @@ -1516,9 +1516,7 @@ in6_ifinit(struct ifnet *ifp, struct in6 ia->ia_addr = *sin6; if (ifacount <= 1 && ifp->if_ioctl) { - IFF_LOCKGIANT(ifp); error = (*ifp->if_ioctl)(ifp, SIOCSIFADDR, (caddr_t)ia); - IFF_UNLOCKGIANT(ifp); if (error) { splx(s); return (error); Modified: head/sys/netinet6/in6_ifattach.c ============================================================================== --- head/sys/netinet6/in6_ifattach.c Sun Mar 15 13:14:06 2009 (r189850) +++ head/sys/netinet6/in6_ifattach.c Sun Mar 15 14:21:05 2009 (r189851) @@ -906,10 +906,8 @@ in6_purgemaddrs(struct ifnet *ifp) struct in6_multi *in6m; struct in6_multi *oin6m; - IFF_LOCKGIANT(ifp); LIST_FOREACH_SAFE(in6m, &in6_multihead, in6m_entry, oin6m) { if (in6m->in6m_ifp == ifp) in6_delmulti(in6m); } - IFF_UNLOCKGIANT(ifp); } Modified: head/sys/netinet6/mld6.c ============================================================================== --- head/sys/netinet6/mld6.c Sun Mar 15 13:14:06 2009 (r189850) +++ head/sys/netinet6/mld6.c Sun Mar 15 14:21:05 2009 (r189851) @@ -550,7 +550,6 @@ in6_addmulti(struct in6_addr *maddr6, st *errorp = 0; in6m = NULL; - IFF_LOCKGIANT(ifp); /*IN6_MULTI_LOCK();*/ IN6_LOOKUP_MULTI(*maddr6, ifp, in6m); @@ -622,7 +621,6 @@ in6_addmulti(struct in6_addr *maddr6, st } while (0); /*IN6_MULTI_UNLOCK();*/ - IFF_UNLOCKGIANT(ifp); return (in6m); } Modified: head/sys/netnatm/natm.c ============================================================================== --- head/sys/netnatm/natm.c Sun Mar 15 13:14:06 2009 (r189850) +++ head/sys/netnatm/natm.c Sun Mar 15 14:21:05 2009 (r189851) @@ -221,13 +221,9 @@ natm_usr_connect(struct socket *so, stru op.param.traffic = ATMIO_TRAFFIC_UBR; NATM_UNLOCK(); - IFF_LOCKGIANT(ifp); if (ifp->if_ioctl == NULL || - ifp->if_ioctl(ifp, SIOCATMOPENVCC, (caddr_t)&op) != 0) { - IFF_UNLOCKGIANT(ifp); + ifp->if_ioctl(ifp, SIOCATMOPENVCC, (caddr_t)&op) != 0) return (EIO); - } - IFF_UNLOCKGIANT(ifp); soisconnected(so); return (error); } @@ -259,11 +255,8 @@ natm_usr_disconnect(struct socket *so) cl.vpi = npcb->npcb_vpi; cl.vci = npcb->npcb_vci; NATM_UNLOCK(); - if (ifp->if_ioctl != NULL) { - IFF_LOCKGIANT(ifp); + if (ifp->if_ioctl != NULL) ifp->if_ioctl(ifp, SIOCATMCLOSEVCC, (caddr_t)&cl); - IFF_UNLOCKGIANT(ifp); - } soisdisconnected(so); return (error); } @@ -342,17 +335,13 @@ natm_usr_control(struct socket *so, u_lo struct ifnet *ifp, d_thread_t *p) { struct natmpcb *npcb; - int error; npcb = (struct natmpcb *)so->so_pcb; KASSERT(npcb != NULL, ("natm_usr_control: npcb == NULL")); if (ifp == NULL || ifp->if_ioctl == NULL) return (EOPNOTSUPP); - IFF_LOCKGIANT(ifp); - error = ((*ifp->if_ioctl)(ifp, cmd, arg)); - IFF_UNLOCKGIANT(ifp); - return (error); + return ((*ifp->if_ioctl)(ifp, cmd, arg)); } static void Modified: head/sys/pc98/conf/NOTES ============================================================================== --- head/sys/pc98/conf/NOTES Sun Mar 15 13:14:06 2009 (r189850) +++ head/sys/pc98/conf/NOTES Sun Mar 15 14:21:05 2009 (r189851) @@ -372,8 +372,6 @@ hint.mse.0.irq="13" # Network interfaces: # -# ar: Arnet SYNC/570i hdlc sync 2/4 port V.35/X.21 serial driver -# (requires sppp) # ce: Cronyx Tau-PCI/32 sync single/dual port G.703/E1 serial adaptor # with 32 HDLC subchannels (requires sppp (default), or NETGRAPH if # NETGRAPH_CRONYX is configured) @@ -391,13 +389,11 @@ hint.mse.0.irq="13" # ral: Ralink Technology IEEE 802.11 wireless adapter # sbni: Granch SBNI12-xx ISA and PCI adapters # snc: National Semiconductor DP8393X SONIC Ethernet adapter driver -# sr: RISCom/N2 hdlc sync 1/2 port V.35/X.21 serial driver (requires sppp) # ural: Ralink Technology RT2500USB IEEE 802.11 wireless adapter # ath: Atheros a/b/g WiFi adapters (requires ath_hal and wlan) # Order for ISA/EISA devices is important here -device ar device ce device cp device cs @@ -427,7 +423,6 @@ hint.snc.0.at="isa" hint.snc.0.port="0x888" hint.snc.0.irq="6" hint.snc.0.maddr="0xc0000" -device sr device ural device ath # Atheros pci/cardbus NIC's From owner-svn-src-head@FreeBSD.ORG Sun Mar 15 15:03:22 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C141B106564A; Sun, 15 Mar 2009 15:03:22 +0000 (UTC) (envelope-from dchagin@dchagin.static.corbina.ru) Received: from contrabass.post.ru (contrabass.post.ru [85.21.78.5]) by mx1.freebsd.org (Postfix) with ESMTP id 6DF168FC16; Sun, 15 Mar 2009 15:03:22 +0000 (UTC) (envelope-from dchagin@dchagin.static.corbina.ru) Received: from corbina.ru (mail.post.ru [195.14.50.16]) by contrabass.post.ru (Postfix) with ESMTP id 5BF546E52E; Sun, 15 Mar 2009 18:03:20 +0300 (MSK) X-Virus-Scanned: by cgpav Uf39PSi9pFi9oFi9 Received: from [10.208.17.3] (HELO dchagin.static.corbina.ru) by corbina.ru (CommuniGate Pro SMTP 5.1.14) with ESMTPS id 1680073419; Sun, 15 Mar 2009 18:03:20 +0300 Received: from dchagin.static.corbina.ru (localhost.chd.net [127.0.0.1]) by dchagin.static.corbina.ru (8.14.3/8.14.3) with ESMTP id n2FF3JBs044084; Sun, 15 Mar 2009 18:03:19 +0300 (MSK) (envelope-from dchagin@dchagin.static.corbina.ru) Received: (from dchagin@localhost) by dchagin.static.corbina.ru (8.14.3/8.14.3/Submit) id n2FF3ENT044083; Sun, 15 Mar 2009 18:03:14 +0300 (MSK) (envelope-from dchagin) Date: Sun, 15 Mar 2009 18:03:14 +0300 From: Chagin Dmitry To: Rui Paulo Message-ID: <20090315150314.GA44065@dchagin.static.corbina.ru> References: <200903131630.n2DGUXGx067777@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="x+6KMIRAuhnl3hBn" Content-Disposition: inline In-Reply-To: <200903131630.n2DGUXGx067777@svn.freebsd.org> User-Agent: Mutt/1.5.19 (2009-01-05) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r189770 - 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, 15 Mar 2009 15:03:23 -0000 --x+6KMIRAuhnl3hBn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Mar 13, 2009 at 04:30:33PM +0000, Rui Paulo wrote: > Author: rpaulo > Date: Fri Mar 13 16:30:33 2009 > New Revision: 189770 > URL: http://svn.freebsd.org/changeset/base/189770 >=20 > Log: > Mention k8temp -> amdtemp rename. > =20 > MFC after: 2 weeks >=20 > Modified: > head/UPDATING >=20 hi Rui, please, unbreak LINT also :) patch bellow: Index: sys/boot/forth/loader.conf =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/boot/forth/loader.conf (revision 189852) +++ sys/boot/forth/loader.conf (working copy) @@ -402,7 +402,7 @@ accf_http_load=3D"NO" # Wait for full HTTP request random_load=3D"NO" # Random device speaker_load=3D"NO" # AT speaker module coretemp_load=3D"NO" # Intel Core CPU temperature monitor -k8temp_load=3D"NO" # AMD K8 temperature monitor +amdtemp_load=3D"NO" # AMD K8 temperature monitor =20 ############################################################## ### ACPI settings ########################################## Index: sys/amd64/conf/NOTES =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/amd64/conf/NOTES (revision 189852) +++ sys/amd64/conf/NOTES (working copy) @@ -400,10 +400,10 @@ device ichwd # Temperature sensors: # # coretemp: on-die sensor on Intel Core and newer CPUs -# k8temp: on-die sensor on AMD K8 CPUs +# amdtemp: on-die sensor on AMD K8 CPUs # device coretemp -device k8temp +device amdtemp =20 # # CPU control pseudo-device. Provides access to MSRs, CPUID info and --=20 Have fun! chd --x+6KMIRAuhnl3hBn Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.10 (FreeBSD) iEYEARECAAYFAkm9GLEACgkQ0t2Tb3OO/O3WygCfRRx+ceFKmGhYCygyHAIoQUpb 5RwAnjD/UjkTLQGXd4UzrAHvRO/nnGEb =yXe6 -----END PGP SIGNATURE----- --x+6KMIRAuhnl3hBn-- From owner-svn-src-head@FreeBSD.ORG Sun Mar 15 15:07:42 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B23F106564A; Sun, 15 Mar 2009 15:07:42 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:7b8:613:100::211]) by mx1.freebsd.org (Postfix) with ESMTP id 061DF8FC15; Sun, 15 Mar 2009 15:07:41 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: by palm.hoeg.nl (Postfix, from userid 1000) id C3ABD1CE0B; Sun, 15 Mar 2009 16:07:40 +0100 (CET) Date: Sun, 15 Mar 2009 16:07:40 +0100 From: Ed Schouten To: Gabor Kovesdan Message-ID: <20090315150740.GZ31961@hoeg.nl> References: <200903151314.n2FDE6Zx029988@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="TcuvTDpCAASXpu1W" Content-Disposition: inline In-Reply-To: <200903151314.n2FDE6Zx029988@svn.freebsd.org> User-Agent: Mutt/1.5.19 (2009-01-05) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r189850 - in head: . lib/libc/nls X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 15 Mar 2009 15:07:42 -0000 --TcuvTDpCAASXpu1W Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Gabor Kovesdan wrote: > - Create the buildworld object directories with mtree instead of various > mkdir calls > - Remove the ugly workaroung from libc NLS, which was to create some of > these directories Thank you! I actually needed something similar for my FreeBSD+Clang patchset. ;-) --=20 Ed Schouten WWW: http://80386.nl/ --TcuvTDpCAASXpu1W Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkm9GbwACgkQ52SDGA2eCwWb+wCdHTElEdq0MupdAXpaIkgpGfSS LZgAn1J4RFGxGTU/1+v3S2JUyrqDGqBZ =yMtk -----END PGP SIGNATURE----- --TcuvTDpCAASXpu1W-- From owner-svn-src-head@FreeBSD.ORG Sun Mar 15 15:18:11 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 695D1106566C; Sun, 15 Mar 2009 15:18:11 +0000 (UTC) (envelope-from alexander@leidinger.net) Received: from redbull.bpaserver.net (redbullneu.bpaserver.net [213.198.78.217]) by mx1.freebsd.org (Postfix) with ESMTP id 1EB2F8FC0A; Sun, 15 Mar 2009 15:18:10 +0000 (UTC) (envelope-from alexander@leidinger.net) Received: from outgoing.leidinger.net (pD9E2C9D9.dip.t-dialin.net [217.226.201.217]) by redbull.bpaserver.net (Postfix) with ESMTP id 01BD62E0AA; Sun, 15 Mar 2009 16:18:06 +0100 (CET) Received: from unknown (IO.Leidinger.net [192.168.2.103]) by outgoing.leidinger.net (Postfix) with ESMTP id AA823C29AC; Sun, 15 Mar 2009 16:18:02 +0100 (CET) Date: Sun, 15 Mar 2009 16:18:02 +0100 From: Alexander Leidinger To: Dmitry Chagin Message-ID: <20090315161802.000034d2@unknown> In-Reply-To: <200903131640.n2DGep8f068001@svn.freebsd.org> References: <200903131640.n2DGep8f068001@svn.freebsd.org> X-Mailer: Claws Mail 3.7.1 (GTK+ 2.10.13; i586-pc-mingw32msvc) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BPAnet-MailScanner-Information: Please contact the ISP for more information X-MailScanner-ID: 01BD62E0AA.069E4 X-BPAnet-MailScanner: Found to be clean X-BPAnet-MailScanner-SpamCheck: not spam, ORDB-RBL, SpamAssassin (not cached, score=-14.823, required 6, BAYES_00 -15.00, RDNS_DYNAMIC 0.10, TW_SV 0.08) X-BPAnet-MailScanner-From: alexander@leidinger.net X-Spam-Status: No Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r189771 - in head/sys: amd64/amd64 amd64/linux32 arm/arm compat/ia32 compat/svr4 i386/i386 i386/linux ia64/ia64 kern mips/mips powerpc/powerpc sparc64/sparc64 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: Sun, 15 Mar 2009 15:18:11 -0000 On Fri, 13 Mar 2009 16:40:51 +0000 (UTC) Dmitry Chagin wrote: > New Revision: 189771 > Log: > Implement new way of branding ELF binaries by looking to a > ".note.ABI-tag" section. Does this mean we do not need brandelf for the linuxulator anymore (do static linux programs contain this field with a correct value)? If yes: - Please document it least in the doc repository in "en_US.ISO8859-1/books/porters-handbook/book.sgml" (version 800071 should be close enough, so just adding a little note there is enough). This way we can take this into account for the linux stuff in the ports collection. - I don't know if this should be mentioned in the brandelf man-page too in this case. At least the evaluation order should be mentioned there, I think. Bye, Alexander. From owner-svn-src-head@FreeBSD.ORG Sun Mar 15 15:47:10 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7003B106564A for ; Sun, 15 Mar 2009 15:47:10 +0000 (UTC) (envelope-from r.c.ladan@gmail.com) Received: from mail-ew0-f166.google.com (mail-ew0-f166.google.com [209.85.219.166]) by mx1.freebsd.org (Postfix) with ESMTP id E06458FC0C for ; Sun, 15 Mar 2009 15:47:09 +0000 (UTC) (envelope-from r.c.ladan@gmail.com) Received: by mail-ew0-f166.google.com with SMTP id 10so3343504ewy.43 for ; Sun, 15 Mar 2009 08:47:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :organization:user-agent:mime-version:to:cc:subject:references :in-reply-to:x-enigmail-version:content-type; bh=g+cJYwhacELgDyPpGSGXSoHhrygMKGhmQvwOK3vEuLM=; b=hHTSCA1QXM1JWZ0a3oR/px2SALJpLICTp/gLIgn7/KwstN8oKnObzaaCZd8kFcG4Ym 01uuL13fIT9Y8+bPR2xZ4VJ/xo9nM+pSRg4ezP1XN012DYbHu2q3cyaYP+huxjzJ9tJk pBPl8dyyFsek+4VpamuwtlCbtoWv4JEWbG6wQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:organization:user-agent:mime-version:to :cc:subject:references:in-reply-to:x-enigmail-version:content-type; b=cUvRiylPzrQQkpne/5PdYBnIF2pwl/ZmBDj1ksikjypJwSqYQcj5LcuON1zjCdkAnF nWC7JAEwtxKa27+wNCQoEgnJVgVO6ScqVAJPHyo9YLdBmEgRWLPJj9jplYnOsqVdtp0I WmkhnuaXmZEnXfjbxlVhnJhDeCqaje4uemEHA= Received: by 10.216.51.82 with SMTP id a60mr1468481wec.108.1237130122354; Sun, 15 Mar 2009 08:15:22 -0700 (PDT) Received: from self.rene-ladan.nl ([77.163.174.49]) by mx.google.com with ESMTPS id 1sm7693723nfv.30.2009.03.15.08.15.21 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 15 Mar 2009 08:15:21 -0700 (PDT) Sender: Rene Ladan Message-ID: <49BD1B5C.4010105@freebsd.org> Date: Sun, 15 Mar 2009 16:14:36 +0100 From: Rene Ladan Organization: The FreeBSD Project User-Agent: Thunderbird 2.0.0.19 (X11/20090111) MIME-Version: 1.0 To: =?ISO-8859-1?Q?G=E1bor_K=F6vesd=E1n?= References: <200903131040.n2DAecSO061131@svn.freebsd.org> <49BB0DF0.3020907@FreeBSD.org> In-Reply-To: <49BB0DF0.3020907@FreeBSD.org> X-Enigmail-Version: 0.95.6 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigD8121F0FA5AFE945036ED738" Cc: Gabor Pali , doc@FreeBSD.org, Tom Rhodes , Robert Watson , Giorgos Keramidas , svn-src-head@freebsd.org, "Sean C. Farley" Subject: Re: NLS additions to I18N chapter of developers-handbook [Was: Re: svn commit: r189765 - in head: . lib/libc lib/libc/nls] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 15 Mar 2009 15:47:10 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigD8121F0FA5AFE945036ED738 Content-Type: multipart/mixed; boundary="------------080101080707070509060703" This is a multi-part message in MIME format. --------------080101080707070509060703 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable G=E1bor K=F6vesd=E1n schreef: > Robert Watson escribi=F3: >> >> On Fri, 13 Mar 2009, Gabor Kovesdan wrote: >> >>> - Reenable Native Language Support in libc. This feature was=20 >>> disabled due >>> to possible breakages in the catalog handling code. Since then, t= hat >>> code has been replaced by the secure code from NetBSD but NLS in l= ibc >>> remained turned off. Tests have shown that the feature is stable = and >>> working so we can now turn it on again. >> >> Do we have a nice tutorialish document somewhere on what people=20 >> writing new command line tools or libraries should do in order to=20 >> address localization requirements, or at least, make it easier for=20 >> other people to do so? I'm afraid I, at least, live in a world=20 >> without catalogues, but a quick and practical guide to what The Right = >> Thing Is for FreeBSD would make it much easier for me to do something = >> a bit more mature. >> > I've spent some time on writing a short section on this trying to do=20 > this from a practical viewpoint. Please take a look ant tell me what do= =20 > you think: > http://kovesdan.org/files/developers-handbook/posix-nls.html >=20 > A patch can be found here: > http://kovesdan.org/patches/nls-doc.diff >=20 > (doc@ and some probable reviewers added to CC) >=20 I've reviewed the patch, a diff to it is attached. Rene --=20 http://www.rene-ladan.nl/ GPG fingerprint =3D ADBC ECCD EB5F A6B4 549F 600D 8C9E 647A E564 2BFC (s= ubkeys.pgp.net) --------------080101080707070509060703 Content-Type: text/plain; name="rene-nls-doc.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline; filename="rene-nls-doc.diff" --- nls-doc.diff.orig 2009-03-15 12:53:06.000000000 +0100 +++ nls-doc.diff 2009-03-15 16:06:38.000000000 +0100 @@ -22,17 +22,17 @@ + + + -+ Localized messages with POSIX.1 Native Language Support (N= LS) ++ Localized Messages with POSIX.1 Native Language Support (N= LS) + + Beyond the basic I18N functions, like supporting various in= put + encodings or supporting national conventions, such as the different -+ decimal separators, at a higher level of I18N, we can localize the -+ messages written to the output by our program. A common way of doing -+ this is using the POSIX.1 NLS functions, which are provided as a part ++ decimal separators, at a higher level of I18N, it is possible to local= ize the ++ messages written to the output by the various programs. A common way = of doing ++ this is using the POSIX.1 NLS functions which are provided as a part + of the &os; base system. + + -+ Organizing localized messages into catalog files ++ Organizing Localized Messages into Catalog Files + + POSIX.1 NLS is based on catalog files, which contain the + localized messages in the desired encoding. The messages are @@ -43,38 +43,38 @@ + Hungarian messages for ISO8859-2 encoding should be stored in a file= + called hu_HU.ISO8859-2. + -+ These catalog files are usual text files that contain the -+ numbered mesages. It is possible to write comments by starting -+ the line with a $ sign. Set boundaries are also separated by ++ These catalog files are common text files that contain the ++ numbered messages. It is possible to write comments by starting ++ the line with a $ sign. Set boundaries are also = separated by + special comments, where the keyword set must -+ directly follow the $ sign. The set keyword ++ directly follow the $ sign. The set keyword + is then followed by the set number. For example: + + $set 1 + + The actual message entries start with the message number and -+ are then followed by the localized message. The well-known -+ &man.printf.3; modifiers are accepted: ++ followed by the localized message. The well-known ++ modifiers from &man.printf.3; are accepted: + + 15 "File not found: %s\n" + + The language catalog files have to be compiled into a binary + form before they can be opened from the program. This conversion + is done with the &man.gencat.1; utility. Its first argument is the -+ filename of the compiled catalog and the further arguments are the -+ input catalogs. You can also organize the localized messages into -+ more catalog files and then process all of them with ++ filename of the compiled catalog and its further arguments are the ++ input catalogs. The localized messages can also be organized into ++ more catalog files and then all of them can be processed with + &man.gencat.1;. + + + -+ Using the catalog files from the source code ++ Using the Catalog Files from the Source Code + -+ The usage of the catalog files is very simple. To use ++ Using the catalog files is simple. To use + the related functions, nl_types.h must be included. Befo= re -+ using a catalog, you have to open it with &man.catopen.3;. -+ It has two arguments, the first one is the name of the ++ using a catalog, it has to be opened with &man.catopen.3;. ++ The function takes two arguments. The first parameter is the name o= f the + installed and compiled catalog. Usually, the name of the + program is used, such as grep. + This name will be used when looking for the compiled @@ -91,7 +91,7 @@ + + + NL_CAT_LOCALE, which means that -+ the used catalog file will be based on the ++ the used catalog file will be based on + LC_MESSAGES. + + @@ -100,29 +100,29 @@ + the proper catalog. + + -+ The &man.catopen.3; call return with a catalog identifier of -+ type nl_catd. For possible returned error -+ codes, please refer to the manual page. ++ The &man.catopen.3; call returns a catalog identifier of ++ type nl_catd. Please refer to the manual page fo= r a list of possible returned error ++ codes. + + After opening a catalog &man.catgets.3; can be used to retrieve + a message. The first parameter is the catalog identifier returned + by &man.catopen.3;, the second one is the number of the set, the -+ third one is the number of the message and the fourth one is a -+ fallback message, which will be returned if the requested message ++ third one is the number of the messages, and the fourth one is a ++ fallback message which will be returned if the requested message + cannot be retrieved from the catalog file. + + After using the catalog file, it must be closed by calling -+ &man.catclose.3;, which has one argument, the catalog id. ++ &man.catclose.3; which has one argument, the catalog id. + + + -+ A practical example ++ A Practical Example + -+ The following example will demonstrate an easy solution to ++ The following example will demonstrate an easy solution on how t= o + use NLS catalogs in a flexible way. + -+ We need to put these lines to a common header file of -+ the program, which is included into all source files, where ++ The below lines need to be put into a common header file of ++ the program which is included into all source files where + localized messages are necessary: + + @@ -137,7 +137,7 @@ + +extern char *nlsstr[]; + -+ Then put these lines to the global declaration part of the ++ Next, put these lines into the global declaration part of the + main source file: + + @@ -147,16 +147,16 @@ +#endif + +/* -+ * Default messags to use when NLS is disabled or no catalogue ++ * Default messages to use when NLS is disabled or no catalog + * is found. + */ +char *nlsstr[] =3D { + "", +/* 1*/ "some random message", -+/* 2*/ "some another message" ++/* 2*/ "some other message" +}; + -+ And here comes the real code snippets, which open, read and ++ Next come the real code snippets, which open, read, and + close the catalog: + + @@ -176,25 +176,25 @@ + + + -+ Making use of bsd.nls.mk ++ Making use of <filename>bsd.nls.mk</filename> + -+ Using the catalog files requires few repeatable steps, ++ Using the catalog files requires a few repeatable steps, + such as compiling the catalogs and installing them to the + proper location. In order to simplify this process even + more, bsd.nls.mk introduces some macros. -+ It is not needed to include bsd.nls.mk ++ It is not necessary to include bsd.nls.mk + explicitly, it is pulled in from the common Makefiles, + such as bsd.prog.mk or + bsd.lib.mk. + + Usually it is enough to define NLSNAME, -+ which should be the catalog name mentioned as the first ++ which should have the catalog name mentioned as the first + argument of &man.catopen.3; and list the catalog files in + NLS without their .msg + extension. + + For further information about bsd.nls.mk, -+ please refer to this file itself, it is short and easy to ++ please refer to the file itself, it is short and easy to + understand. + + --------------080101080707070509060703-- --------------enigD8121F0FA5AFE945036ED738 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.11 (FreeBSD) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkm9G4gACgkQjJ5keuVkK/xy0wCgi6hdTbX/vAQjbIBYHGVBDsIY 5acAn1gZjZkzZmvUVffX8AqyT/9jPbYG =HgU1 -----END PGP SIGNATURE----- --------------enigD8121F0FA5AFE945036ED738-- From owner-svn-src-head@FreeBSD.ORG Sun Mar 15 15:51:11 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EB4A1106566C; Sun, 15 Mar 2009 15:51:11 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id C5DD18FC0A; Sun, 15 Mar 2009 15:51:11 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id 6E52146B0D; Sun, 15 Mar 2009 11:51:11 -0400 (EDT) Date: Sun, 15 Mar 2009 15:51:11 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org In-Reply-To: <200903151421.n2FEL5Ra031289@svn.freebsd.org> Message-ID: References: <200903151421.n2FEL5Ra031289@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Subject: Re: svn commit: r189851 - in head/sys: conf i386/conf kern modules modules/netgraph net netinet netinet6 netnatm pc98/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: Sun, 15 Mar 2009 15:51:12 -0000 On Sun, 15 Mar 2009, Robert Watson wrote: > Remove IFF_NEEDSGIANT, a compatibility infrastructure introduced > in FreeBSD 5.x to allow network device drivers to run with Giant > despite the network stack being Giant-free. This significantly > simplifies calls into ioctl() on network interfaces, especially > in the multicast code, as well as eliminates deferred invocation > of interface if_start routines. > > Disable the build on device drivers still depending on > IFF_NEEDSGIANT as they no longer compile. They will be removed > in a few weeks if they haven't been made MPSAFE in that time. > Disabled drivers: > > if_ar > if_axe > if_aue > if_cdce > if_cue > if_kue > if_ray > if_rue > if_rum > if_sr > if_udav > if_ural > if_zyd > > Drivers that were already disabled because of tty changes: > > if_ppp > if_sl On or around 1 April, I will remove these drivers from the repository if they haven't been updated. Most of the above drivers have already been replaced by the usb2 drivers of similar names. The only real exceptions are if_ar and if_sr, which currently don't have MPSAFE variants but were still being compiled. Robert N M Watson Computer Laboratory University of Cambridge From owner-svn-src-head@FreeBSD.ORG Sun Mar 15 15:57:42 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4A88106571D; Sun, 15 Mar 2009 15:57:42 +0000 (UTC) (envelope-from das@FreeBSD.ORG) Received: from zim.MIT.EDU (ZIM.MIT.EDU [18.95.3.101]) by mx1.freebsd.org (Postfix) with ESMTP id 8FB978FC15; Sun, 15 Mar 2009 15:57:42 +0000 (UTC) (envelope-from das@FreeBSD.ORG) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.3/8.14.2) with ESMTP id n2FFwFfZ056834; Sun, 15 Mar 2009 11:58:15 -0400 (EDT) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by zim.MIT.EDU (8.14.3/8.14.2/Submit) id n2FFwF7B056833; Sun, 15 Mar 2009 11:58:15 -0400 (EDT) (envelope-from das@FreeBSD.ORG) Date: Sun, 15 Mar 2009 11:58:14 -0400 From: David Schultz To: Roman Divacky Message-ID: <20090315155814.GA56735@zim.MIT.EDU> Mail-Followup-To: Roman Divacky , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG References: <200903141936.n2EJaDM5006130@svn.freebsd.org> <20090315081240.GB39715@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090315081240.GB39715@freebsd.org> Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG Subject: Re: svn commit: r189824 - in head/contrib/gcc: . doc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 15 Mar 2009 15:57:43 -0000 On Sun, Mar 15, 2009, Roman Divacky wrote: > On Sat, Mar 14, 2009 at 07:36:13PM +0000, David Schultz wrote: > > Author: das > > Date: Sat Mar 14 19:36:13 2009 > > New Revision: 189824 > > URL: http://svn.freebsd.org/changeset/base/189824 > > > > Log: > > Make gcc use C99 inline semantics in c99 and gnu99 mode. This was the > > original intent, but the functionality wasn't implemented until after > > gcc 4.2 was released. However, if you compiled a program that would > > behave differently before and after this change, gcc 4.2 would have > > warned you; hence, everything currently in the base system is > > unaffected by this change. This patch also adds additional warnings > > about certain inline function-related bogosity, e.g., using a > > static non-const local variable in an inline function. > > > > These changes were merged from a snapshot of gcc mainline from March > > 2007, prior to the GPLv3 switch. I then ran the regression test suite > > from a more recent gcc snapshot and fixed the important bugs it found. > > I also squelched the following warning unless -pedantic is specified: > > > > foo is static but used in inline function bar which is not static > > > > This is consistent with LLVM's behavior, but not consistent with gcc 4.3. > > thnx a lot for doing this! just a quick question - what is the fallback > strategy for ports that will die on this? It depends, but the compiler option -fgnu89-inline (supported in gcc 4.2+) should do the trick. From owner-svn-src-head@FreeBSD.ORG Sun Mar 15 16:10:25 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CD32D1065670; Sun, 15 Mar 2009 16:10:25 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BB6728FC0A; Sun, 15 Mar 2009 16:10:25 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2FGAP9Z033489; Sun, 15 Mar 2009 16:10:25 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2FGAPvL033488; Sun, 15 Mar 2009 16:10:25 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200903151610.n2FGAPvL033488@svn.freebsd.org> From: Robert Watson Date: Sun, 15 Mar 2009 16:10: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: r189853 - 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: Sun, 15 Mar 2009 16:10:26 -0000 Author: rwatson Date: Sun Mar 15 16:10:25 2009 New Revision: 189853 URL: http://svn.freebsd.org/changeset/base/189853 Log: Bump __FreeBSD_version for the removal of IFF_NEEDSGIANT; network device drivers that require Giant to be held over calls to the ifnet interface are no longer supported in the FreeBSD 8.x kernel. Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Sun Mar 15 14:25:03 2009 (r189852) +++ head/sys/sys/param.h Sun Mar 15 16:10:25 2009 (r189853) @@ -57,7 +57,7 @@ * is created, otherwise 1. */ #undef __FreeBSD_version -#define __FreeBSD_version 800071 /* Master, propagated to newvers */ +#define __FreeBSD_version 800072 /* Master, propagated to newvers */ #ifndef LOCORE #include From owner-svn-src-head@FreeBSD.ORG Sun Mar 15 16:12:50 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5DBAB106566B; Sun, 15 Mar 2009 16:12:50 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4C4798FC0A; Sun, 15 Mar 2009 16:12:50 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2FGCo0D033579; Sun, 15 Mar 2009 16:12:50 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2FGConX033578; Sun, 15 Mar 2009 16:12:50 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200903151612.n2FGConX033578@svn.freebsd.org> From: Robert Watson Date: Sun, 15 Mar 2009 16:12: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: r189854 - 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, 15 Mar 2009 16:12:50 -0000 Author: rwatson Date: Sun Mar 15 16:12:50 2009 New Revision: 189854 URL: http://svn.freebsd.org/changeset/base/189854 Log: Mention specifically in UPDATING that non-MPSAFE device drivers are no longer supported. Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Sun Mar 15 16:10:25 2009 (r189853) +++ head/UPDATING Sun Mar 15 16:12:50 2009 (r189854) @@ -22,6 +22,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. to maximize performance. (To disable malloc debugging, run ln -s aj /etc/malloc.conf.) +20090315: + Support for the IFF_NEEDSGIANT network interface flag has been + removed, which means that non-MPSAFE network device drivers are no + longer supported. In particular, if_ar, if_sr, and network device + drivers from the old (legacy) USB stack can no longer be built or + used. + 20090313: POSIX.1 Native Language Support (NLS) has been enabled in libc and a bunch of new language catalog files have also been added. From owner-svn-src-head@FreeBSD.ORG Sun Mar 15 17:02:51 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C57CB106564A; Sun, 15 Mar 2009 17:02:51 +0000 (UTC) (envelope-from dchagin@dchagin.static.corbina.ru) Received: from contrabass.post.ru (contrabass.post.ru [85.21.78.5]) by mx1.freebsd.org (Postfix) with ESMTP id 6FA2C8FC08; Sun, 15 Mar 2009 17:02:51 +0000 (UTC) (envelope-from dchagin@dchagin.static.corbina.ru) Received: from corbina.ru (mail.post.ru [195.14.50.16]) by contrabass.post.ru (Postfix) with ESMTP id 609F26ED7F; Sun, 15 Mar 2009 20:02:44 +0300 (MSK) X-Virus-Scanned: by cgpav Uf39PSi9pFi9oFi9 Received: from [10.208.17.3] (HELO dchagin.static.corbina.ru) by corbina.ru (CommuniGate Pro SMTP 5.1.14) with ESMTPS id 1680208058; Sun, 15 Mar 2009 20:02:44 +0300 Received: from dchagin.static.corbina.ru (localhost.chd.net [127.0.0.1]) by dchagin.static.corbina.ru (8.14.3/8.14.3) with ESMTP id n2FH2h4c002861; Sun, 15 Mar 2009 20:02:43 +0300 (MSK) (envelope-from dchagin@dchagin.static.corbina.ru) Received: (from dchagin@localhost) by dchagin.static.corbina.ru (8.14.3/8.14.3/Submit) id n2FH2ccV002860; Sun, 15 Mar 2009 20:02:38 +0300 (MSK) (envelope-from dchagin) Date: Sun, 15 Mar 2009 20:02:38 +0300 From: Chagin Dmitry To: Alexander Leidinger Message-ID: <20090315170238.GA2593@dchagin.static.corbina.ru> References: <200903131640.n2DGep8f068001@svn.freebsd.org> <20090315161802.000034d2@unknown> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="gBBFr7Ir9EOA20Yy" Content-Disposition: inline In-Reply-To: <20090315161802.000034d2@unknown> User-Agent: Mutt/1.5.19 (2009-01-05) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r189771 - in head/sys: amd64/amd64 amd64/linux32 arm/arm compat/ia32 compat/svr4 i386/i386 i386/linux ia64/ia64 kern mips/mips powerpc/powerpc sparc64/sparc64 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: Sun, 15 Mar 2009 17:02:52 -0000 --gBBFr7Ir9EOA20Yy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Mar 15, 2009 at 04:18:02PM +0100, Alexander Leidinger wrote: > On Fri, 13 Mar 2009 16:40:51 +0000 (UTC) Dmitry Chagin > wrote: >=20 > > New Revision: 189771 >=20 > > Log: > > Implement new way of branding ELF binaries by looking to a > > ".note.ABI-tag" section. >=20 > Does this mean we do not need brandelf for the linuxulator anymore > (do static linux programs contain this field with a correct value)? If > yes: > - Please document it least in the doc repository in > "en_US.ISO8859-1/books/porters-handbook/book.sgml" (version 800071 > should be close enough, so just adding a little note there is enough). > This way we can take this into account for the linux stuff in the ports > collection. > - I don't know if this should be mentioned in the brandelf man-page too > in this case. At least the evaluation order should be mentioned there, > I think. >=20 hi, dchagin# file /compat/linux/sbin/ldconfig /compat/linux/sbin/ldconfig: ELF 32-bit LSB executable, Intel 80386, version 1 (GNU/Linux), statically linked, for GNU/Linux 2.6.9, stripped dchagin# brandelf -f 0 /compat/linux/sbin/ldconfig dchagin# /compat/linux/sbin/ldconfig -V ldconfig (GNU libc) 2.7 Copyright (C) 2007 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Written by Andreas Jaeger. dchagin# readelf -h /compat/linux/sbin/ldconfig | grep ABI OS/ABI: UNIX - System V ABI Version: 0 dchagin# so it works for statically linked binaries also. Unfortunately, I not the best person for a documentation writing... Therefore I will make it a bit later :) --=20 Have fun! chd --gBBFr7Ir9EOA20Yy Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.10 (FreeBSD) iEYEARECAAYFAkm9NKgACgkQ0t2Tb3OO/O3DfQCbBsP7li6SvK2lYyv82j2aj4ix MCMAoI+4cexrvNZDtiUf/6+tvNLdgX8x =YDqN -----END PGP SIGNATURE----- --gBBFr7Ir9EOA20Yy-- From owner-svn-src-head@FreeBSD.ORG Sun Mar 15 17:31:53 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AC78A1065688; Sun, 15 Mar 2009 17:31:53 +0000 (UTC) (envelope-from dchagin@dchagin.static.corbina.ru) Received: from contrabass.post.ru (contrabass.post.ru [85.21.78.5]) by mx1.freebsd.org (Postfix) with ESMTP id 583CE8FC14; Sun, 15 Mar 2009 17:31:53 +0000 (UTC) (envelope-from dchagin@dchagin.static.corbina.ru) Received: from corbina.ru (mail.post.ru [195.14.50.16]) by contrabass.post.ru (Postfix) with ESMTP id 928DF6DA8A; Sun, 15 Mar 2009 20:31:52 +0300 (MSK) X-Virus-Scanned: by cgpav Uf39PSi9pFi9oFi9 Received: from [10.208.17.3] (HELO dchagin.static.corbina.ru) by corbina.ru (CommuniGate Pro SMTP 5.1.14) with ESMTPS id 1680243484; Sun, 15 Mar 2009 20:31:52 +0300 Received: from dchagin.static.corbina.ru (localhost.chd.net [127.0.0.1]) by dchagin.static.corbina.ru (8.14.3/8.14.3) with ESMTP id n2FHVpFY003309; Sun, 15 Mar 2009 20:31:52 +0300 (MSK) (envelope-from dchagin@dchagin.static.corbina.ru) Received: (from dchagin@localhost) by dchagin.static.corbina.ru (8.14.3/8.14.3/Submit) id n2FHVk2x003308; Sun, 15 Mar 2009 20:31:46 +0300 (MSK) (envelope-from dchagin) Date: Sun, 15 Mar 2009 20:31:46 +0300 From: Chagin Dmitry To: "David E. O'Brien" Message-ID: <20090315173146.GA3192@dchagin.static.corbina.ru> References: <200901312046.n0VKk1LV033660@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="WIyZ46R2i8wDzkSu" Content-Disposition: inline In-Reply-To: <200901312046.n0VKk1LV033660@svn.freebsd.org> User-Agent: Mutt/1.5.19 (2009-01-05) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r187964 - head/sys/amd64/linux32 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 15 Mar 2009 17:31:54 -0000 --WIyZ46R2i8wDzkSu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Jan 31, 2009 at 08:46:01PM +0000, David E. O'Brien wrote: > Author: obrien > Date: Sat Jan 31 20:46:01 2009 > New Revision: 187964 > URL: http://svn.freebsd.org/changeset/base/187964 >=20 > Log: > Fix the inconsistent tabbing. > =20 > Noticed by: bde >=20 > Modified: > head/sys/amd64/linux32/linux32_sysvec.c >=20 [skip] hi David, please, merge it. --=20 Have fun! chd --WIyZ46R2i8wDzkSu Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.10 (FreeBSD) iEYEARECAAYFAkm9O4EACgkQ0t2Tb3OO/O1N6gCfeT1zvM0ySwamhCBrAfLoRzUp BSEAn02mPc4RA//U7+h88zYT0KlAzKpJ =PPov -----END PGP SIGNATURE----- --WIyZ46R2i8wDzkSu-- From owner-svn-src-head@FreeBSD.ORG Sun Mar 15 17:38:44 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DED361065672; Sun, 15 Mar 2009 17:38:44 +0000 (UTC) (envelope-from dchagin@dchagin.static.corbina.ru) Received: from contrabass.post.ru (contrabass.post.ru [85.21.78.5]) by mx1.freebsd.org (Postfix) with ESMTP id 8B54A8FC14; Sun, 15 Mar 2009 17:38:44 +0000 (UTC) (envelope-from dchagin@dchagin.static.corbina.ru) Received: from corbina.ru (mail.post.ru [195.14.50.16]) by contrabass.post.ru (Postfix) with ESMTP id C772D6F294; Sun, 15 Mar 2009 20:38:43 +0300 (MSK) X-Virus-Scanned: by cgpav Uf39PSi9pFi9oFi9 Received: from [10.208.17.3] (HELO dchagin.static.corbina.ru) by corbina.ru (CommuniGate Pro SMTP 5.1.14) with ESMTPS id 1680250176; Sun, 15 Mar 2009 20:38:43 +0300 Received: from dchagin.static.corbina.ru (localhost.chd.net [127.0.0.1]) by dchagin.static.corbina.ru (8.14.3/8.14.3) with ESMTP id n2FHchnf003456; Sun, 15 Mar 2009 20:38:43 +0300 (MSK) (envelope-from dchagin@dchagin.static.corbina.ru) Received: (from dchagin@localhost) by dchagin.static.corbina.ru (8.14.3/8.14.3/Submit) id n2FHcgHO003455; Sun, 15 Mar 2009 20:38:42 +0300 (MSK) (envelope-from dchagin) Date: Sun, 15 Mar 2009 20:38:42 +0300 From: Chagin Dmitry To: Warner Losh Message-ID: <20090315173842.GA3422@dchagin.static.corbina.ru> References: <200812170611.mBH6Bhep059636@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="8t9RHnE3ZwKMSgU+" Content-Disposition: inline In-Reply-To: <200812170611.mBH6Bhep059636@svn.freebsd.org> User-Agent: Mutt/1.5.19 (2009-01-05) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r186211 - in head/sys: amd64/linux32 i386/linux X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 15 Mar 2009 17:38:45 -0000 --8t9RHnE3ZwKMSgU+ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Dec 17, 2008 at 06:11:43AM +0000, Warner Losh wrote: > Author: imp > Date: Wed Dec 17 06:11:42 2008 > New Revision: 186211 > URL: http://svn.freebsd.org/changeset/base/186211 >=20 > Log: > Remove obsolete AT_DEBUG stuff. It never should have been committed > in the first place, let alone migrated to linux emulation. > =20 > Reviewed by: peter, rdivacky >=20 > Modified: > head/sys/amd64/linux32/linux32_sysvec.c > head/sys/i386/linux/linux_sysvec.c >=20 hi Warner, please, merge it. --=20 Have fun! chd --8t9RHnE3ZwKMSgU+ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.10 (FreeBSD) iEYEARECAAYFAkm9PSIACgkQ0t2Tb3OO/O3S2wCghGp6DHJ5B08MCBKxYyQ/ldY7 Vg4AoMOGDFUFav+TgRld/8FGeyh/OYjJ =tplq -----END PGP SIGNATURE----- --8t9RHnE3ZwKMSgU+-- From owner-svn-src-head@FreeBSD.ORG Sun Mar 15 19:16:13 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2569C1065672; Sun, 15 Mar 2009 19:16:13 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 13DF18FC1D; Sun, 15 Mar 2009 19:16:13 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2FJGCW3037369; Sun, 15 Mar 2009 19:16:12 GMT (envelope-from dchagin@svn.freebsd.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2FJGCAW037367; Sun, 15 Mar 2009 19:16:12 GMT (envelope-from dchagin@svn.freebsd.org) Message-Id: <200903151916.n2FJGCAW037367@svn.freebsd.org> From: Dmitry Chagin Date: Sun, 15 Mar 2009 19: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: r189861 - head/sys/compat/linux X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 15 Mar 2009 19:16:13 -0000 Author: dchagin Date: Sun Mar 15 19:16:12 2009 New Revision: 189861 URL: http://svn.freebsd.org/changeset/base/189861 Log: Include linux_futex.h before linux_emul.h Approved by: kib (mentor) MFC after: 6 days Modified: head/sys/compat/linux/linux_emul.h head/sys/compat/linux/linux_futex.c Modified: head/sys/compat/linux/linux_emul.h ============================================================================== --- head/sys/compat/linux/linux_emul.h Sun Mar 15 17:27:06 2009 (r189860) +++ head/sys/compat/linux/linux_emul.h Sun Mar 15 19:16:12 2009 (r189861) @@ -31,8 +31,6 @@ #ifndef _LINUX_EMUL_H_ #define _LINUX_EMUL_H_ -#include - struct linux_emuldata_shared { int refs; pid_t group_pid; Modified: head/sys/compat/linux/linux_futex.c ============================================================================== --- head/sys/compat/linux/linux_futex.c Sun Mar 15 17:27:06 2009 (r189860) +++ head/sys/compat/linux/linux_futex.c Sun Mar 15 19:16:12 2009 (r189861) @@ -60,8 +60,8 @@ __KERNEL_RCSID(1, "$NetBSD: linux_futex. #include #include #endif -#include #include +#include struct futex; From owner-svn-src-head@FreeBSD.ORG Sun Mar 15 19:38:34 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 693361065675; Sun, 15 Mar 2009 19:38:34 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 577098FC1A; Sun, 15 Mar 2009 19:38:34 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2FJcY2I037831; Sun, 15 Mar 2009 19:38:34 GMT (envelope-from dchagin@svn.freebsd.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2FJcYAV037828; Sun, 15 Mar 2009 19:38:34 GMT (envelope-from dchagin@svn.freebsd.org) Message-Id: <200903151938.n2FJcYAV037828@svn.freebsd.org> From: Dmitry Chagin Date: Sun, 15 Mar 2009 19:38: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: r189862 - head/sys/compat/linux X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 15 Mar 2009 19:38:35 -0000 Author: dchagin Date: Sun Mar 15 19:38:34 2009 New Revision: 189862 URL: http://svn.freebsd.org/changeset/base/189862 Log: Ignore FUTEX_FD op, as it is done by linux. Approved by: kib (mentor) MFC after: 2 weeks Modified: head/sys/compat/linux/linux_futex.c head/sys/compat/linux/linux_futex.h Modified: head/sys/compat/linux/linux_futex.c ============================================================================== --- head/sys/compat/linux/linux_futex.c Sun Mar 15 19:16:12 2009 (r189861) +++ head/sys/compat/linux/linux_futex.c Sun Mar 15 19:38:34 2009 (r189862) @@ -276,13 +276,6 @@ linux_sys_futex(struct thread *td, struc FUTEX_SYSTEM_UNLOCK; break; - case LINUX_FUTEX_FD: -#ifdef DEBUG - printf("linux_sys_futex: unimplemented op %d\n", - args->op); -#endif - return (ENOSYS); - case LINUX_FUTEX_WAKE_OP: FUTEX_SYSTEM_LOCK; #ifdef DEBUG Modified: head/sys/compat/linux/linux_futex.h ============================================================================== --- head/sys/compat/linux/linux_futex.h Sun Mar 15 19:16:12 2009 (r189861) +++ head/sys/compat/linux/linux_futex.h Sun Mar 15 19:38:34 2009 (r189862) @@ -38,7 +38,7 @@ #define LINUX_FUTEX_WAIT 0 #define LINUX_FUTEX_WAKE 1 -#define LINUX_FUTEX_FD 2 +#define LINUX_FUTEX_FD 2 /* unused */ #define LINUX_FUTEX_REQUEUE 3 #define LINUX_FUTEX_CMP_REQUEUE 4 #define LINUX_FUTEX_WAKE_OP 5 From owner-svn-src-head@FreeBSD.ORG Sun Mar 15 19:40:24 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C964910656EF; Sun, 15 Mar 2009 19:40:24 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from ebb.errno.com (ebb.errno.com [69.12.149.25]) by mx1.freebsd.org (Postfix) with ESMTP id 1B0308FC21; Sun, 15 Mar 2009 19:40:23 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from trouble.errno.com (trouble.errno.com [10.0.0.248]) (authenticated bits=0) by ebb.errno.com (8.13.6/8.12.6) with ESMTP id n2FJeNUY066200 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 15 Mar 2009 12:40:23 -0700 (PDT) (envelope-from sam@freebsd.org) Message-ID: <49BD59A7.8020902@freebsd.org> Date: Sun, 15 Mar 2009 12:40:23 -0700 From: Sam Leffler Organization: FreeBSD Project User-Agent: Thunderbird 2.0.0.18 (X11/20081209) MIME-Version: 1.0 To: Dmitry Chagin References: <200903151916.n2FJGCAW037367@svn.freebsd.org> In-Reply-To: <200903151916.n2FJGCAW037367@svn.freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-DCC-Misty-Metrics: ebb.errno.com; whitelist Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r189861 - head/sys/compat/linux X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 15 Mar 2009 19:40:38 -0000 Dmitry Chagin wrote: > Author: dchagin > Date: Sun Mar 15 19:16:12 2009 > New Revision: 189861 > URL: http://svn.freebsd.org/changeset/base/189861 > > Log: > Include linux_futex.h before linux_emul.h > > Please explain the "why" in your commit msg; the "what" is usually clear... Sam From owner-svn-src-head@FreeBSD.ORG Sun Mar 15 20:17:45 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 06B561065673; Sun, 15 Mar 2009 20:17:45 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E86928FC13; Sun, 15 Mar 2009 20:17:44 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2FKHiQ1038589; Sun, 15 Mar 2009 20:17:44 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2FKHijd038587; Sun, 15 Mar 2009 20:17:44 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200903152017.n2FKHijd038587@svn.freebsd.org> From: Robert Watson Date: Sun, 15 Mar 2009 20:17: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: r189863 - in head: share/man/man4 sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 15 Mar 2009 20:17:45 -0000 Author: rwatson Date: Sun Mar 15 20:17:44 2009 New Revision: 189863 URL: http://svn.freebsd.org/changeset/base/189863 Log: Teach the loopback interface about checksum generation and validation avoidance: - Enable setting the RXCSUM and TXCSUM flags for loopback interfaces; set both by default. - When RXCSUM is set, flag packets sent over the loopback interface as having checked and valid IP, UDP, TCP checksums so that higher protocol layers won't check them. - Always clear CSUM_{IP,UDP_TCP} checksum required flags on transmit, as they will have gotten there as a result of TXCSUM being set. This is done only for packets explicitly sent over the loopback, not simulated loopback via if_simloop() due to !SIMPLEX interfaces, etc. Note that enabling TXCSUM but not RXCSUM will lead to unhappiness, as checksums won't be generated but will be validated. Kris reports that this leads to significant performance improvements in loopback benchmarking with TCP and UDP for throughput: RXCSUM RXCSUM+TXCSUM TCP 15% 37% UDP 10% 74% Update man page. Reviewed by: sam Tested by: kris MFC after: 1 week Modified: head/share/man/man4/lo.4 head/sys/net/if_loop.c Modified: head/share/man/man4/lo.4 ============================================================================== --- head/share/man/man4/lo.4 Sun Mar 15 19:38:34 2009 (r189862) +++ head/share/man/man4/lo.4 Sun Mar 15 20:17:44 2009 (r189863) @@ -1,5 +1,7 @@ .\" Copyright (c) 1983, 1991, 1993 -.\" The Regents of the University of California. All rights reserved. +.\" The Regents of the University of California. +.\" Copyright (c) 2009 Robert N. M. Watson +.\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -9,10 +11,6 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. .\" 4. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. @@ -32,7 +30,7 @@ .\" @(#)lo.4 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd June 5, 1993 +.Dd March 15, 2009 .Dt LO 4 .Os .Sh NAME @@ -58,6 +56,20 @@ The loopback should .Em never be configured first unless no hardware interfaces exist. +.Pp +If the transmit checksum offload capability flag is enabled on a loopback +interface, checksums will not be generated by IP, UDP, or TCP for packets +sent on the interface. +.Pp +If the receive checksum offload capability flag is enabled on a loopback +interface, checksums will not be validated by IP, UDP, or TCP for packets +received on the interface. +.Pp +By default, both receive and transmit checksum flags will be enabled, in +order to avoid the overhead of checksumming for local communication where +data corruption is unlikely. +If transmit checksum generation is disabled, then validation should also be +disabled in order to avoid packets being dropped due to invalid checksums. .Sh DIAGNOSTICS .Bl -diag .It lo%d: can't handle af%d. @@ -74,8 +86,5 @@ The .Nm device appeared in .Bx 4.2 . -.Sh BUGS -Previous versions of the system enabled the loopback interface -automatically, using a nonstandard Internet address (127.1). -Use of that address is now discouraged; a reserved host address -for the local network should be used instead. +The current checksum generation and validation avoidance policy appeared in +.Fx 8.0 . Modified: head/sys/net/if_loop.c ============================================================================== --- head/sys/net/if_loop.c Sun Mar 15 19:38:34 2009 (r189862) +++ head/sys/net/if_loop.c Sun Mar 15 20:17:44 2009 (r189863) @@ -138,6 +138,8 @@ lo_clone_create(struct if_clone *ifc, in ifp->if_ioctl = loioctl; ifp->if_output = looutput; ifp->if_snd.ifq_maxlen = ifqmaxlen; + ifp->if_hwassist = ifp->if_capabilities = ifp->if_capenable = + IFCAP_HWCSUM; if_attach(ifp); bpfattach(ifp, DLT_NULL, sizeof(u_int32_t)); if (V_loif == NULL) @@ -212,6 +214,13 @@ looutput(struct ifnet *ifp, struct mbuf #if 1 /* XXX */ switch (dst->sa_family) { case AF_INET: + if (ifp->if_capenable & IFCAP_RXCSUM) { + m->m_pkthdr.csum_data = 0xffff; + m->m_pkthdr.csum_flags = CSUM_DATA_VALID | + CSUM_PSEUDO_HDR | CSUM_IP_CHECKED | + CSUM_IP_VALID | CSUM_SCTP_VALID; + } + m->m_pkthdr.csum_flags &= ~(CSUM_IP | CSUM_TCP | CSUM_UDP); case AF_INET6: case AF_IPX: case AF_APPLETALK: @@ -348,7 +357,7 @@ loioctl(struct ifnet *ifp, u_long cmd, c { struct ifaddr *ifa; struct ifreq *ifr = (struct ifreq *)data; - int error = 0; + int error = 0, mask; switch (cmd) { case SIOCSIFADDR: @@ -391,6 +400,18 @@ loioctl(struct ifnet *ifp, u_long cmd, c case SIOCSIFFLAGS: break; + case SIOCSIFCAP: + mask = ifp->if_capenable ^ ifr->ifr_reqcap; + if ((mask & IFCAP_RXCSUM) != 0) + ifp->if_capenable ^= IFCAP_RXCSUM; + if ((mask & IFCAP_TXCSUM) != 0) + ifp->if_capenable ^= IFCAP_TXCSUM; + if (ifp->if_capenable & IFCAP_TXCSUM) + ifp->if_hwassist = CSUM_IP | CSUM_TCP | CSUM_UDP; + else + ifp->if_hwassist = 0; + break; + default: error = EINVAL; } From owner-svn-src-head@FreeBSD.ORG Sun Mar 15 20:23:08 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A00DA106564A; Sun, 15 Mar 2009 20:23:08 +0000 (UTC) (envelope-from kris@FreeBSD.org) Received: from kennaway-macbookpro.config (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id A4BA38FC0A; Sun, 15 Mar 2009 20:23:07 +0000 (UTC) (envelope-from kris@FreeBSD.org) Message-ID: <49BD63AB.6090702@FreeBSD.org> Date: Sun, 15 Mar 2009 20:23:07 +0000 From: Kris Kennaway User-Agent: Thunderbird 2.0.0.19 (Macintosh/20081209) MIME-Version: 1.0 To: Robert Watson References: <200903152017.n2FKHijd038587@svn.freebsd.org> In-Reply-To: <200903152017.n2FKHijd038587@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r189863 - in head: share/man/man4 sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 15 Mar 2009 20:23:09 -0000 Robert Watson wrote: > Author: rwatson > Date: Sun Mar 15 20:17:44 2009 > New Revision: 189863 > URL: http://svn.freebsd.org/changeset/base/189863 > > Log: > Teach the loopback interface about checksum generation and validation > avoidance: > > - Enable setting the RXCSUM and TXCSUM flags for loopback interfaces; > set both by default. > - When RXCSUM is set, flag packets sent over the loopback interface as > having checked and valid IP, UDP, TCP checksums so that higher > protocol layers won't check them. > - Always clear CSUM_{IP,UDP_TCP} checksum required flags on transmit, > as they will have gotten there as a result of TXCSUM being set. > > This is done only for packets explicitly sent over the loopback, not > simulated loopback via if_simloop() due to !SIMPLEX interfaces, etc. > > Note that enabling TXCSUM but not RXCSUM will lead to unhappiness, as > checksums won't be generated but will be validated. > > Kris reports that this leads to significant performance improvements > in loopback benchmarking with TCP and UDP for throughput: > > RXCSUM RXCSUM+TXCSUM > TCP 15% 37% > UDP 10% 74% More like 24% instead of 74% actually, the sender and receiver had become unbalanced in that test. Kris From owner-svn-src-head@FreeBSD.ORG Sun Mar 15 20:54:00 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 21B561065674; Sun, 15 Mar 2009 20:54:00 +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 F05538FC1F; Sun, 15 Mar 2009 20:53:59 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id 7F8FC46B55; Sun, 15 Mar 2009 16:53:59 -0400 (EDT) Date: Sun, 15 Mar 2009 20:53:59 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Kris Kennaway In-Reply-To: <49BD63AB.6090702@FreeBSD.org> Message-ID: References: <200903152017.n2FKHijd038587@svn.freebsd.org> <49BD63AB.6090702@FreeBSD.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r189863 - in head: share/man/man4 sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 15 Mar 2009 20:54:01 -0000 On Sun, 15 Mar 2009, Kris Kennaway wrote: >> Kris reports that this leads to significant performance improvements >> in loopback benchmarking with TCP and UDP for throughput: >> RXCSUM RXCSUM+TXCSUM >> TCP 15% 37% >> UDP 10% 74% > > More like 24% instead of 74% actually, the sender and receiver had become > unbalanced in that test. That makes more sense -- I was surprised to see such a large win on UDP. Thanks for the update. Robert N M Watson Computer Laboratory University of Cambridge From owner-svn-src-head@FreeBSD.ORG Sun Mar 15 22:33:19 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3832E106566C; Sun, 15 Mar 2009 22:33:19 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 268D08FC23; Sun, 15 Mar 2009 22:33:19 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2FMXJG4041383; Sun, 15 Mar 2009 22:33:19 GMT (envelope-from jamie@svn.freebsd.org) Received: (from jamie@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2FMXI2v041380; Sun, 15 Mar 2009 22:33:18 GMT (envelope-from jamie@svn.freebsd.org) Message-Id: <200903152233.n2FMXI2v041380@svn.freebsd.org> From: Jamie Gritton Date: Sun, 15 Mar 2009 22:33: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: r189864 - 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: Sun, 15 Mar 2009 22:33:19 -0000 Author: jamie Date: Sun Mar 15 22:33:18 2009 New Revision: 189864 URL: http://svn.freebsd.org/changeset/base/189864 Log: Default to AF_LOCAL instead of AF_INET sockets for non-family-specific operations. This allows the query operations to work in non-IPv4 jails, and will be necessary in a future of possible non-INET networking. Approved by: bz (mentor) Modified: head/sbin/ifconfig/ifclone.c head/sbin/ifconfig/ifconfig.c head/sbin/ifconfig/ifgroup.c Modified: head/sbin/ifconfig/ifclone.c ============================================================================== --- head/sbin/ifconfig/ifclone.c Sun Mar 15 20:17:44 2009 (r189863) +++ head/sbin/ifconfig/ifclone.c Sun Mar 15 22:33:18 2009 (r189864) @@ -54,9 +54,9 @@ list_cloners(void) int idx; int s; - s = socket(AF_INET, SOCK_DGRAM, 0); + s = socket(AF_LOCAL, SOCK_DGRAM, 0); if (s == -1) - err(1, "socket(AF_INET,SOCK_DGRAM)"); + err(1, "socket(AF_LOCAL,SOCK_DGRAM)"); memset(&ifcr, 0, sizeof(ifcr)); Modified: head/sbin/ifconfig/ifconfig.c ============================================================================== --- head/sbin/ifconfig/ifconfig.c Sun Mar 15 20:17:44 2009 (r189863) +++ head/sbin/ifconfig/ifconfig.c Sun Mar 15 22:33:18 2009 (r189864) @@ -441,22 +441,23 @@ static const struct cmd setifdstaddr_cmd DEF_CMD("ifdstaddr", 0, setifdstaddr); static int -ifconfig(int argc, char *const *argv, int iscreate, const struct afswtch *afp) +ifconfig(int argc, char *const *argv, int iscreate, const struct afswtch *uafp) { - const struct afswtch *nafp; + const struct afswtch *afp, *nafp; const struct cmd *p; struct callback *cb; int s; strncpy(ifr.ifr_name, name, sizeof ifr.ifr_name); + afp = uafp != NULL ? uafp : af_getbyname("inet"); top: - if (afp == NULL) - afp = af_getbyname("inet"); ifr.ifr_addr.sa_family = afp->af_af == AF_LINK || afp->af_af == AF_UNSPEC ? - AF_INET : afp->af_af; + AF_LOCAL : afp->af_af; - if ((s = socket(ifr.ifr_addr.sa_family, SOCK_DGRAM, 0)) < 0) + if ((s = socket(ifr.ifr_addr.sa_family, SOCK_DGRAM, 0)) < 0 && + (uafp != NULL || errno != EPROTONOSUPPORT || + (s = socket(AF_LOCAL, SOCK_DGRAM, 0)) < 0)) err(1, "socket(family %u,SOCK_DGRAM", ifr.ifr_addr.sa_family); while (argc > 0) { @@ -803,11 +804,12 @@ status(const struct afswtch *afp, const if (afp == NULL) { allfamilies = 1; - afp = af_getbyname("inet"); - } else + ifr.ifr_addr.sa_family = AF_LOCAL; + } else { allfamilies = 0; - - ifr.ifr_addr.sa_family = afp->af_af == AF_LINK ? AF_INET : afp->af_af; + ifr.ifr_addr.sa_family = + afp->af_af == AF_LINK ? AF_LOCAL : afp->af_af; + } strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); s = socket(ifr.ifr_addr.sa_family, SOCK_DGRAM, 0); Modified: head/sbin/ifconfig/ifgroup.c ============================================================================== --- head/sbin/ifconfig/ifgroup.c Sun Mar 15 20:17:44 2009 (r189863) +++ head/sbin/ifconfig/ifgroup.c Sun Mar 15 22:33:18 2009 (r189864) @@ -131,9 +131,9 @@ printgroup(const char *groupname) int len, cnt = 0; int s; - s = socket(AF_INET, SOCK_DGRAM, 0); + s = socket(AF_LOCAL, SOCK_DGRAM, 0); if (s == -1) - err(1, "socket(AF_INET,SOCK_DGRAM)"); + err(1, "socket(AF_LOCAL,SOCK_DGRAM)"); bzero(&ifgr, sizeof(ifgr)); strlcpy(ifgr.ifgr_name, groupname, sizeof(ifgr.ifgr_name)); if (ioctl(s, SIOCGIFGMEMB, (caddr_t)&ifgr) == -1) { From owner-svn-src-head@FreeBSD.ORG Sun Mar 15 23:52:13 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A69A106567D; Sun, 15 Mar 2009 23:52:13 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 79B3B8FC37; Sun, 15 Mar 2009 23:52:13 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2FNqDno043020; Sun, 15 Mar 2009 23:52:13 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2FNqDHk043019; Sun, 15 Mar 2009 23:52:13 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200903152352.n2FNqDHk043019@svn.freebsd.org> From: Warner Losh Date: Sun, 15 Mar 2009 23:52:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r189865 - 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, 15 Mar 2009 23:52:14 -0000 Author: imp Date: Sun Mar 15 23:52:13 2009 New Revision: 189865 URL: http://svn.freebsd.org/changeset/base/189865 Log: Restore missing OSREL definition that accidetnally dropped from an earlier version of this patch. Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sun Mar 15 22:33:18 2009 (r189864) +++ head/Makefile.inc1 Sun Mar 15 23:52:13 2009 (r189865) @@ -1338,6 +1338,9 @@ CDTMP= ${MAKEOBJDIRPREFIX}/${XDEV}/${.CU CDMAKE=${CDENV} ${MAKE} ${NOFUN} CD2MAKE=${CD2ENV} PATH=${CDTMP}/usr/bin:${XDTP}/usr/bin:${PATH} ${MAKE} ${NOFUN} XDDESTDIR=${DESTDIR}${XDTP} +.if !defined(OSREL) +OSREL!= uname -r | sed -e 's/[-(].*//' +.endif .ORDER: xdev-build xdev-install xdev: xdev-build xdev-install From owner-svn-src-head@FreeBSD.ORG Mon Mar 16 03:11:03 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 03548106566B; Mon, 16 Mar 2009 03:11:03 +0000 (UTC) (envelope-from scf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B13808FC0A; Mon, 16 Mar 2009 03:11:02 +0000 (UTC) (envelope-from scf@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2G3B2g9047003; Mon, 16 Mar 2009 03:11:02 GMT (envelope-from scf@svn.freebsd.org) Received: (from scf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2G3B2wn047002; Mon, 16 Mar 2009 03:11:02 GMT (envelope-from scf@svn.freebsd.org) Message-Id: <200903160311.n2G3B2wn047002@svn.freebsd.org> From: Sean Farley Date: Mon, 16 Mar 2009 03:11: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: r189866 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Mar 2009 03:11:03 -0000 Author: scf Date: Mon Mar 16 03:11:02 2009 New Revision: 189866 URL: http://svn.freebsd.org/changeset/base/189866 Log: Add the SIOCSIFMTU ioctl handling directly to tap(4) permitting it to have its MTU set higher than 1500 (ETHERMTU). Its new limit is now 65535 as enforced by ifhwioctl() in if.c This allows a tap(4) device to be added to a bridge, which requires all interface members to have the same MTU, with an interface configured for jumbo frames. QEMU may now connect to a network via tap(4) without requiring the real interface to have its MTU set to 1500 or lower. Reviewed by: rpaulo, bms MFC after: 1 week Modified: head/sys/net/if_tap.c Modified: head/sys/net/if_tap.c ============================================================================== --- head/sys/net/if_tap.c Sun Mar 15 23:52:13 2009 (r189865) +++ head/sys/net/if_tap.c Mon Mar 16 03:11:02 2009 (r189866) @@ -600,6 +600,7 @@ static int tapifioctl(struct ifnet *ifp, u_long cmd, caddr_t data) { struct tap_softc *tp = ifp->if_softc; + struct ifreq *ifr = (struct ifreq *)data; struct ifstat *ifs = NULL; int s, dummy; @@ -609,6 +610,12 @@ tapifioctl(struct ifnet *ifp, u_long cmd case SIOCDELMULTI: break; + case SIOCSIFMTU: + s = splimp(); + ifp->if_mtu = ifr->ifr_mtu; + splx(s); + break; + case SIOCGIFSTATUS: s = splimp(); ifs = (struct ifstat *)data; From owner-svn-src-head@FreeBSD.ORG Mon Mar 16 05:39:37 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DC1B2106570C; Mon, 16 Mar 2009 05:39:37 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C9F448FC2B; Mon, 16 Mar 2009 05:39:37 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2G5dbLv049688; Mon, 16 Mar 2009 05:39:37 GMT (envelope-from dchagin@svn.freebsd.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2G5dbiS049687; Mon, 16 Mar 2009 05:39:37 GMT (envelope-from dchagin@svn.freebsd.org) Message-Id: <200903160539.n2G5dbiS049687@svn.freebsd.org> From: Dmitry Chagin Date: Mon, 16 Mar 2009 05:39:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r189867 - head/sys/compat/linux X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Mar 2009 05:39:38 -0000 Author: dchagin Date: Mon Mar 16 05:39:37 2009 New Revision: 189867 URL: http://svn.freebsd.org/changeset/base/189867 Log: Sort include files in the alphabetical order. Approved by: kib (mentor) MFC after: 2 weeks Modified: head/sys/compat/linux/linux_futex.c Modified: head/sys/compat/linux/linux_futex.c ============================================================================== --- head/sys/compat/linux/linux_futex.c Mon Mar 16 03:11:02 2009 (r189866) +++ head/sys/compat/linux/linux_futex.c Mon Mar 16 05:39:37 2009 (r189867) @@ -40,18 +40,17 @@ __KERNEL_RCSID(1, "$NetBSD: linux_futex. #include "opt_compat.h" #include -#include -#include #include -#include -#include #include +#include #include +#include #include #include +#include +#include #include #include -#include #ifdef COMPAT_LINUX32 #include From owner-svn-src-head@FreeBSD.ORG Mon Mar 16 08:15:35 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F2D91065686; Mon, 16 Mar 2009 08:15:35 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5DDA48FC1E; Mon, 16 Mar 2009 08:15:35 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2G8FZwm052542; Mon, 16 Mar 2009 08:15:35 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2G8FZ9v052541; Mon, 16 Mar 2009 08:15:35 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200903160815.n2G8FZ9v052541@svn.freebsd.org> From: Robert Noland Date: Mon, 16 Mar 2009 08: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: r189868 - head/sys/dev/drm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Mar 2009 08:15:36 -0000 Author: rnoland Date: Mon Mar 16 08:15:35 2009 New Revision: 189868 URL: http://svn.freebsd.org/changeset/base/189868 Log: Fix R600 writeback across suspend/resume. This is likely a NOOP for us, since I haven't ported the suspend/resume code yet. MFC after: 3 days Modified: head/sys/dev/drm/r600_cp.c Modified: head/sys/dev/drm/r600_cp.c ============================================================================== --- head/sys/dev/drm/r600_cp.c Mon Mar 16 05:39:37 2009 (r189867) +++ head/sys/dev/drm/r600_cp.c Mon Mar 16 08:15:35 2009 (r189868) @@ -1740,9 +1740,6 @@ static void r600_cp_init_ring_buffer(str RADEON_WRITE(R600_CP_DEBUG, (1 << 27) | (1 << 28)); - /* Start with assuming that writeback doesn't work */ - dev_priv->writeback_works = 0; - /* Initialize the scratch register pointer. This will cause * the scratch register values to be written out to memory * whenever they are updated. From owner-svn-src-head@FreeBSD.ORG Mon Mar 16 08:19:12 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 27EEF106566C; Mon, 16 Mar 2009 08:19:12 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F045D8FC12; Mon, 16 Mar 2009 08:19:11 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2G8JBpI052633; Mon, 16 Mar 2009 08:19:11 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2G8JBqR052630; Mon, 16 Mar 2009 08:19:11 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200903160819.n2G8JBqR052630@svn.freebsd.org> From: Robert Noland Date: Mon, 16 Mar 2009 08:19:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r189869 - head/sys/dev/drm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Mar 2009 08:19:12 -0000 Author: rnoland Date: Mon Mar 16 08:19:11 2009 New Revision: 189869 URL: http://svn.freebsd.org/changeset/base/189869 Log: Get rid of any remaining PZERO flags in mtx_sleep() Also, clean up some ifdef mess while I'm here. MFC after: 3 days Modified: head/sys/dev/drm/drm_drv.c head/sys/dev/drm/drm_lock.c head/sys/dev/drm/radeon_cp.c Modified: head/sys/dev/drm/drm_drv.c ============================================================================== --- head/sys/dev/drm/drm_drv.c Mon Mar 16 08:15:35 2009 (r189868) +++ head/sys/dev/drm/drm_drv.c Mon Mar 16 08:19:11 2009 (r189869) @@ -666,7 +666,7 @@ void drm_close(void *data) } /* Contention */ retcode = mtx_sleep((void *)&dev->lock.lock_queue, - &dev->dev_lock, PZERO | PCATCH, "drmlk2", 0); + &dev->dev_lock, PCATCH, "drmlk2", 0); if (retcode) break; } Modified: head/sys/dev/drm/drm_lock.c ============================================================================== --- head/sys/dev/drm/drm_lock.c Mon Mar 16 08:15:35 2009 (r189868) +++ head/sys/dev/drm/drm_lock.c Mon Mar 16 08:19:11 2009 (r189869) @@ -82,7 +82,7 @@ int drm_lock(struct drm_device *dev, voi /* Contention */ ret = mtx_sleep((void *)&dev->lock.lock_queue, &dev->dev_lock, - PZERO | PCATCH, "drmlk2", 0); + PCATCH, "drmlk2", 0); if (ret != 0) break; } Modified: head/sys/dev/drm/radeon_cp.c ============================================================================== --- head/sys/dev/drm/radeon_cp.c Mon Mar 16 08:15:35 2009 (r189868) +++ head/sys/dev/drm/radeon_cp.c Mon Mar 16 08:19:11 2009 (r189869) @@ -1708,26 +1708,14 @@ void radeon_do_release(struct drm_device if ((dev_priv->flags & RADEON_FAMILY_MASK) >= CHIP_R600) { while ((ret = r600_do_cp_idle(dev_priv)) != 0) { DRM_DEBUG("radeon_do_cp_idle %d\n", ret); -#ifdef __linux__ - schedule(); -#elsif defined(__FreeBSD__) mtx_sleep(&ret, &dev->dev_lock, 0, "rdnrel", 1); -#else - tsleep(&ret, PZERO, "rdnrel", 1); -#endif } } else { while ((ret = radeon_do_cp_idle(dev_priv)) != 0) { DRM_DEBUG("radeon_do_cp_idle %d\n", ret); -#ifdef __linux__ - schedule(); -#elsif defined(__FreeBSD__) mtx_sleep(&ret, &dev->dev_lock, 0, "rdnrel", 1); -#else - tsleep(&ret, PZERO, "rdnrel", 1); -#endif } } if ((dev_priv->flags & RADEON_FAMILY_MASK) >= CHIP_R600) { From owner-svn-src-head@FreeBSD.ORG Mon Mar 16 08:21:52 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 48725106564A; Mon, 16 Mar 2009 08:21:52 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3728A8FC14; Mon, 16 Mar 2009 08:21:52 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2G8Lq89052720; Mon, 16 Mar 2009 08:21:52 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2G8Lq7m052719; Mon, 16 Mar 2009 08:21:52 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200903160821.n2G8Lq7m052719@svn.freebsd.org> From: Robert Noland Date: Mon, 16 Mar 2009 08:21:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r189870 - head/sys/dev/atkbdc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Mar 2009 08:21:52 -0000 Author: rnoland Date: Mon Mar 16 08:21:51 2009 New Revision: 189870 URL: http://svn.freebsd.org/changeset/base/189870 Log: Teach psm about O_ASYNC This makes Xorg happy if you aren't using moused. MFC after: 3 days Modified: head/sys/dev/atkbdc/psm.c Modified: head/sys/dev/atkbdc/psm.c ============================================================================== --- head/sys/dev/atkbdc/psm.c Mon Mar 16 08:19:11 2009 (r189869) +++ head/sys/dev/atkbdc/psm.c Mon Mar 16 08:21:51 2009 (r189870) @@ -70,7 +70,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include +#include #include #include #include @@ -299,6 +302,7 @@ struct psm_softc { /* Driver status inf struct cdev *bdev; int lasterr; int cmdcount; + struct sigio *async; /* Processes waiting for SIGIO */ }; static devclass_t psm_devclass; #define PSM_SOFTC(unit) \ @@ -1490,6 +1494,7 @@ psmopen(struct cdev *dev, int flag, int sc->mode.level = sc->dflt_mode.level; sc->mode.protocol = sc->dflt_mode.protocol; sc->watchdog = FALSE; + sc->async = NULL; /* flush the event queue */ sc->queue.count = 0; @@ -1629,6 +1634,12 @@ psmclose(struct cdev *dev, int flag, int /* remove anything left in the output buffer */ empty_aux_buffer(sc->kbdc, 10); + /* clean up and sigio requests */ + if (sc->async != NULL) { + funsetown(&sc->async); + sc->async = NULL; + } + /* close is almost always successful */ sc->state &= ~PSM_OPEN; kbdc_lock(sc->kbdc, FALSE); @@ -2190,6 +2201,15 @@ psmioctl(struct cdev *dev, u_long cmd, c break; #endif /* MOUSE_GETHWID */ + case FIONBIO: + case FIOASYNC: + break; + case FIOSETOWN: + error = fsetown(*(int *)addr, &sc->async); + break; + case FIOGETOWN: + *(int *) addr = fgetown(&sc->async); + break; default: return (ENOTTY); } @@ -3454,6 +3474,9 @@ next: wakeup(sc); } selwakeuppri(&sc->rsel, PZERO); + if (sc->async != NULL) { + pgsigio(&sc->async, SIGIO, 0); + } sc->state &= ~PSM_SOFTARMED; splx(s); } From owner-svn-src-head@FreeBSD.ORG Mon Mar 16 08:40:06 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 346B6106566C; Mon, 16 Mar 2009 08:40:06 +0000 (UTC) (envelope-from alexander@leidinger.net) Received: from redbull.bpaserver.net (redbullneu.bpaserver.net [213.198.78.217]) by mx1.freebsd.org (Postfix) with ESMTP id D16258FC13; Mon, 16 Mar 2009 08:40:05 +0000 (UTC) (envelope-from alexander@leidinger.net) Received: from outgoing.leidinger.net (pD9E2EC7B.dip.t-dialin.net [217.226.236.123]) by redbull.bpaserver.net (Postfix) with ESMTP id 8D1FB2E1E0; Mon, 16 Mar 2009 09:39:57 +0100 (CET) Received: from webmail.leidinger.net (webmail.leidinger.net [192.168.1.102]) by outgoing.leidinger.net (Postfix) with ESMTP id F375EC3EC9; Mon, 16 Mar 2009 09:39:53 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=Leidinger.net; s=outgoing-alex; t=1237192794; bh=IGsz3O1eZdATtzJM3eD8NRcu01q4nu+Td nt90mkmQhw=; h=Message-ID:Date:From:To:Cc:Subject:References: In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=3mTV/s2a9d5JoRBr+75MtQE9+ZiooDueui1AyEA2uoxQvmeZq9yRobWc2M2oZ07vF UqXxON4eFwSiI0sNGS9RJjkD6D0t2Bv4fBqWV7gKp3vlFZafPx94KgvTUy+00bwZPKk vxl+mbk374+g7A7UjD0G5+oQwMG9TAdlFSH7u53+k1PUCbd7lGOZPKGbVtMOi3yOjJI 8u8rG6c0ldNB8Zgghzj5mFjGsdA0OrN3TxoaVHgIUJf3upT4+nAHvJwAcFASKWIhfV6 e5Sx1dADTMEiX1b9UmR+WdTrJ+YMjiOPkZzkNcExDOv4Hs0h92lcma0Gyoo4JPaIVkl JBjTeFpQw== Received: (from www@localhost) by webmail.leidinger.net (8.14.3/8.13.8/Submit) id n2G8dr0w098616; Mon, 16 Mar 2009 09:39:53 +0100 (CET) (envelope-from Alexander@Leidinger.net) Received: from pslux.cec.eu.int (pslux.cec.eu.int [158.169.9.14]) by webmail.leidinger.net (Horde Framework) with HTTP; Mon, 16 Mar 2009 09:39:53 +0100 Message-ID: <20090316093953.15672m44k7hxieuc@webmail.leidinger.net> X-Priority: 3 (Normal) Date: Mon, 16 Mar 2009 09:39:53 +0100 From: Alexander Leidinger To: Dmitry Chagin References: <200903151938.n2FJcYAV037828@svn.freebsd.org> In-Reply-To: <200903151938.n2FJcYAV037828@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: 7bit User-Agent: Internet Messaging Program (IMP) H3 (4.3) / FreeBSD-8.0 X-BPAnet-MailScanner-Information: Please contact the ISP for more information X-MailScanner-ID: 8D1FB2E1E0.6F4FC X-BPAnet-MailScanner: Found to be clean X-BPAnet-MailScanner-SpamCheck: not spam, ORDB-RBL, SpamAssassin (not cached, score=-14.823, required 6, BAYES_00 -15.00, DKIM_SIGNED 0.00, DKIM_VERIFIED -0.00, RDNS_DYNAMIC 0.10, TW_SV 0.08) X-BPAnet-MailScanner-From: alexander@leidinger.net X-Spam-Status: No Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r189862 - head/sys/compat/linux X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Mar 2009 08:40:06 -0000 Quoting Dmitry Chagin (from Sun, 15 Mar 2009 19:38:34 +0000 (UTC)): > Author: dchagin > Date: Sun Mar 15 19:38:34 2009 > New Revision: 189862 > URL: http://svn.freebsd.org/changeset/base/189862 > > Log: > Ignore FUTEX_FD op, as it is done by linux. It would be good if there would be a comment for this case, telling that this is done by Linux too, else someone may think it's a missing feature in FreeBSD. Bye, Alexander. -- Philosophy will clip an angel's wings. -- John Keats http://www.Leidinger.net Alexander @ Leidinger.net: PGP ID = B0063FE7 http://www.FreeBSD.org netchild @ FreeBSD.org : PGP ID = 72077137 From owner-svn-src-head@FreeBSD.ORG Mon Mar 16 09:00:30 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E12D1065672; Mon, 16 Mar 2009 09:00:30 +0000 (UTC) (envelope-from dchagin@dchagin.static.corbina.ru) Received: from contrabass.post.ru (contrabass.post.ru [85.21.78.5]) by mx1.freebsd.org (Postfix) with ESMTP id 0AFE18FC1E; Mon, 16 Mar 2009 09:00:29 +0000 (UTC) (envelope-from dchagin@dchagin.static.corbina.ru) Received: from corbina.ru (mail.post.ru [195.14.50.16]) by contrabass.post.ru (Postfix) with ESMTP id 24C6D7033C; Mon, 16 Mar 2009 12:00:29 +0300 (MSK) X-Virus-Scanned: by cgpav Uf39PSi9pFi9oFi9 Received: from [10.208.17.3] (HELO dchagin.static.corbina.ru) by corbina.ru (CommuniGate Pro SMTP 5.1.14) with ESMTPS id 1681510985; Mon, 16 Mar 2009 12:00:29 +0300 Received: from dchagin.static.corbina.ru (localhost.chd.net [127.0.0.1]) by dchagin.static.corbina.ru (8.14.3/8.14.3) with ESMTP id n2G90SWS085328; Mon, 16 Mar 2009 12:00:28 +0300 (MSK) (envelope-from dchagin@dchagin.static.corbina.ru) Received: (from dchagin@localhost) by dchagin.static.corbina.ru (8.14.3/8.14.3/Submit) id n2G90NYR085327; Mon, 16 Mar 2009 12:00:23 +0300 (MSK) (envelope-from dchagin) Date: Mon, 16 Mar 2009 12:00:23 +0300 From: Chagin Dmitry To: Alexander Leidinger Message-ID: <20090316090023.GA85280@dchagin.static.corbina.ru> References: <200903151938.n2FJcYAV037828@svn.freebsd.org> <20090316093953.15672m44k7hxieuc@webmail.leidinger.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Q68bSM7Ycu6FN28Q" Content-Disposition: inline In-Reply-To: <20090316093953.15672m44k7hxieuc@webmail.leidinger.net> User-Agent: Mutt/1.5.19 (2009-01-05) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r189862 - head/sys/compat/linux X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Mar 2009 09:00:30 -0000 --Q68bSM7Ycu6FN28Q Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Mar 16, 2009 at 09:39:53AM +0100, Alexander Leidinger wrote: > Quoting Dmitry Chagin (from Sun, 15 Mar 2009 =20 > 19:38:34 +0000 (UTC)): >=20 > > Author: dchagin > > Date: Sun Mar 15 19:38:34 2009 > > New Revision: 189862 > > URL: http://svn.freebsd.org/changeset/base/189862 > > > > Log: > > Ignore FUTEX_FD op, as it is done by linux. >=20 > It would be good if there would be a comment for this case, telling =20 > that this is done by Linux too, else someone may think it's a missing =20 > feature in FreeBSD. >=20 ok, thnx. bellow a commit msg about it. commit 82af7aca56c67061420d618cc5a30f0fd4106b80 Author: Eric Sesterhenn Date: Fri Jan 25 10:40:46 2008 +0100 Removal of FUTEX_FD =20 Since FUTEX_FD was scheduled for removal in June 2007 lets remove it. =20 Google Code search found no users for it and NGPT was abandoned in 2003 according to IBM. futex.h is left untouched to make sure the id does not get reassigned. Since queue_me() has no users left it is commented out to avoid a warning, i didnt remove it completely since it is part of the internal api (matching unqueue_me()) =20 --=20 Have fun! chd --Q68bSM7Ycu6FN28Q Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.10 (FreeBSD) iEYEARECAAYFAkm+FSYACgkQ0t2Tb3OO/O1aTACfbmnnrnvmKhog5Fe5gbA2iaRr lrgAnRYLJt7nrBz2A/GfhBZmC34Z5GuH =FZTx -----END PGP SIGNATURE----- --Q68bSM7Ycu6FN28Q-- From owner-svn-src-head@FreeBSD.ORG Mon Mar 16 09:22:36 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3241E1065672; Mon, 16 Mar 2009 09:22:35 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2120A8FC0A; Mon, 16 Mar 2009 09:22:35 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2G9MZMq053943; Mon, 16 Mar 2009 09:22:35 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2G9MZim053942; Mon, 16 Mar 2009 09:22:35 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200903160922.n2G9MZim053942@svn.freebsd.org> From: Robert Watson Date: Mon, 16 Mar 2009 09:22: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: r189871 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Mar 2009 09:22:37 -0000 Author: rwatson Date: Mon Mar 16 09:22:34 2009 New Revision: 189871 URL: http://svn.freebsd.org/changeset/base/189871 Log: if_hwassist should be initialized with CSUM, rather than IFCAP, flags. Submitted by: yongari MFC after: 1 week Modified: head/sys/net/if_loop.c Modified: head/sys/net/if_loop.c ============================================================================== --- head/sys/net/if_loop.c Mon Mar 16 08:21:51 2009 (r189870) +++ head/sys/net/if_loop.c Mon Mar 16 09:22:34 2009 (r189871) @@ -138,8 +138,8 @@ lo_clone_create(struct if_clone *ifc, in ifp->if_ioctl = loioctl; ifp->if_output = looutput; ifp->if_snd.ifq_maxlen = ifqmaxlen; - ifp->if_hwassist = ifp->if_capabilities = ifp->if_capenable = - IFCAP_HWCSUM; + ifp->if_capabilities = ifp->if_capenable = IFCAP_HWCSUM; + ifp->if_hwassist = CSUM_IP | CSUM_TCP | CSUM_UDP; if_attach(ifp); bpfattach(ifp, DLT_NULL, sizeof(u_int32_t)); if (V_loif == NULL) From owner-svn-src-head@FreeBSD.ORG Mon Mar 16 10:36:24 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6C1E71065673; Mon, 16 Mar 2009 10:36:24 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5ADB88FC08; Mon, 16 Mar 2009 10:36:24 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2GAaO0n058122; Mon, 16 Mar 2009 10:36:24 GMT (envelope-from dchagin@svn.freebsd.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2GAaOj7058120; Mon, 16 Mar 2009 10:36:24 GMT (envelope-from dchagin@svn.freebsd.org) Message-Id: <200903161036.n2GAaOj7058120@svn.freebsd.org> From: Dmitry Chagin Date: Mon, 16 Mar 2009 10:36: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: r189872 - in head/sys: amd64/conf boot/forth X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Mar 2009 10:36:24 -0000 Author: dchagin Date: Mon Mar 16 10:36:24 2009 New Revision: 189872 URL: http://svn.freebsd.org/changeset/base/189872 Log: Chase the k8temp->amdtemp rename in NOTES and loader.conf. Approved by: kib (mentor) Modified: head/sys/amd64/conf/NOTES head/sys/boot/forth/loader.conf Modified: head/sys/amd64/conf/NOTES ============================================================================== --- head/sys/amd64/conf/NOTES Mon Mar 16 09:22:34 2009 (r189871) +++ head/sys/amd64/conf/NOTES Mon Mar 16 10:36:24 2009 (r189872) @@ -400,10 +400,10 @@ device ichwd # Temperature sensors: # # coretemp: on-die sensor on Intel Core and newer CPUs -# k8temp: on-die sensor on AMD K8 CPUs +# amdtemp: on-die sensor on AMD K8/K10/K11 CPUs # device coretemp -device k8temp +device amdtemp # # CPU control pseudo-device. Provides access to MSRs, CPUID info and Modified: head/sys/boot/forth/loader.conf ============================================================================== --- head/sys/boot/forth/loader.conf Mon Mar 16 09:22:34 2009 (r189871) +++ head/sys/boot/forth/loader.conf Mon Mar 16 10:36:24 2009 (r189872) @@ -402,7 +402,7 @@ accf_http_load="NO" # Wait for full HTT random_load="NO" # Random device speaker_load="NO" # AT speaker module coretemp_load="NO" # Intel Core CPU temperature monitor -k8temp_load="NO" # AMD K8 temperature monitor +amdtemp_load="NO" # AMD K8/K10/K11 temperature monitor ############################################################## ### ACPI settings ########################################## From owner-svn-src-head@FreeBSD.ORG Mon Mar 16 10:56:51 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D46F1065678; Mon, 16 Mar 2009 10:56:51 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 01D3A8FC2D; Mon, 16 Mar 2009 10:56:51 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2GAuoAn058533; Mon, 16 Mar 2009 10:56:50 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2GAuoQM058532; Mon, 16 Mar 2009 10:56:50 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200903161056.n2GAuoQM058532@svn.freebsd.org> From: Robert Watson Date: Mon, 16 Mar 2009 10:56: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: r189873 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Mar 2009 10:56:51 -0000 Author: rwatson Date: Mon Mar 16 10:56:50 2009 New Revision: 189873 URL: http://svn.freebsd.org/changeset/base/189873 Log: Define and use two macros for loopback checksum offload: LO_CSUM_FEATURES - a bitmask of supported transmit offload features, which will be stored in if_hwassist if IFCAP_TXCSUM is enabled, and be cleared from mbuf packet header csum flags on transmit. (1) LO_CSUM_SET - a bitmask of supported receive offload features, which will be set on the mbuf packet header csum flags on transmit if IFCAP_RXCSUM is enabled. While here, fix SCTP offload for loopback: offer generation on the transmit side, don't just skip validation on the receive side. Obtained from: DragonflyBSD (1) MFC after: 1 week Modified: head/sys/net/if_loop.c Modified: head/sys/net/if_loop.c ============================================================================== --- head/sys/net/if_loop.c Mon Mar 16 10:36:24 2009 (r189872) +++ head/sys/net/if_loop.c Mon Mar 16 10:56:50 2009 (r189873) @@ -94,6 +94,11 @@ #define LOMTU 16384 #endif +#define LO_CSUM_FEATURES (CSUM_IP | CSUM_TCP | CSUM_UDP | CSUM_SCTP) +#define LO_CSUM_SET (CSUM_DATA_VALID | CSUM_PSEUDO_HDR | \ + CSUM_IP_CHECKED | CSUM_IP_VALID | \ + CSUM_SCTP_VALID) + int loioctl(struct ifnet *, u_long, caddr_t); static void lortrequest(int, struct rtentry *, struct rt_addrinfo *); int looutput(struct ifnet *ifp, struct mbuf *m, @@ -139,7 +144,7 @@ lo_clone_create(struct if_clone *ifc, in ifp->if_output = looutput; ifp->if_snd.ifq_maxlen = ifqmaxlen; ifp->if_capabilities = ifp->if_capenable = IFCAP_HWCSUM; - ifp->if_hwassist = CSUM_IP | CSUM_TCP | CSUM_UDP; + ifp->if_hwassist = LO_CSUM_FEATURES; if_attach(ifp); bpfattach(ifp, DLT_NULL, sizeof(u_int32_t)); if (V_loif == NULL) @@ -216,11 +221,9 @@ looutput(struct ifnet *ifp, struct mbuf case AF_INET: if (ifp->if_capenable & IFCAP_RXCSUM) { m->m_pkthdr.csum_data = 0xffff; - m->m_pkthdr.csum_flags = CSUM_DATA_VALID | - CSUM_PSEUDO_HDR | CSUM_IP_CHECKED | - CSUM_IP_VALID | CSUM_SCTP_VALID; + m->m_pkthdr.csum_flags = LO_CSUM_SET; } - m->m_pkthdr.csum_flags &= ~(CSUM_IP | CSUM_TCP | CSUM_UDP); + m->m_pkthdr.csum_flags &= ~LO_CSUM_FEATURES; case AF_INET6: case AF_IPX: case AF_APPLETALK: @@ -407,7 +410,7 @@ loioctl(struct ifnet *ifp, u_long cmd, c if ((mask & IFCAP_TXCSUM) != 0) ifp->if_capenable ^= IFCAP_TXCSUM; if (ifp->if_capenable & IFCAP_TXCSUM) - ifp->if_hwassist = CSUM_IP | CSUM_TCP | CSUM_UDP; + ifp->if_hwassist = LO_CSUM_FEATURES; else ifp->if_hwassist = 0; break; From owner-svn-src-head@FreeBSD.ORG Mon Mar 16 11:19:26 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 670FD10657E9; Mon, 16 Mar 2009 11:19:26 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 101858FC4E; Mon, 16 Mar 2009 11:19:08 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2GBJ71h058967; Mon, 16 Mar 2009 11:19:07 GMT (envelope-from weongyo@svn.freebsd.org) Received: (from weongyo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2GBJ77p058966; Mon, 16 Mar 2009 11:19:07 GMT (envelope-from weongyo@svn.freebsd.org) Message-Id: <200903161119.n2GBJ77p058966@svn.freebsd.org> From: Weongyo Jeong Date: Mon, 16 Mar 2009 11: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: r189874 - head/sys/compat/ndis X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Mar 2009 11:19:59 -0000 Author: weongyo Date: Mon Mar 16 11:19:07 2009 New Revision: 189874 URL: http://svn.freebsd.org/changeset/base/189874 Log: use usb2_desc_foreach() to iterate the USB config descriptor instread of accessing structures directly to check some invalid descriptors. Pointed by: hps Modified: head/sys/compat/ndis/subr_usbd.c Modified: head/sys/compat/ndis/subr_usbd.c ============================================================================== --- head/sys/compat/ndis/subr_usbd.c Mon Mar 16 10:56:50 2009 (r189873) +++ head/sys/compat/ndis/subr_usbd.c Mon Mar 16 11:19:07 2009 (r189874) @@ -63,6 +63,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -1206,12 +1207,11 @@ USBD_ParseConfigurationDescriptorEx(conf int32_t intfsubclass; int32_t intfproto; { - char *pos; + struct usb2_descriptor *next = NULL; usb_interface_descriptor_t *desc; - for (pos = start; pos < ((char *)conf + UGETW(conf->wTotalLength)); - pos += desc->bLength) { - desc = (usb_interface_descriptor_t *)pos; + while ((next = usb2_desc_foreach(conf, next)) != NULL) { + desc = (usb_interface_descriptor_t *)next; if (desc->bDescriptorType != UDESC_INTERFACE) continue; if (!(intfnum == -1 || desc->bInterfaceNumber == intfnum)) From owner-svn-src-head@FreeBSD.ORG Mon Mar 16 12:16:17 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9299910656DA; Mon, 16 Mar 2009 12:16:17 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 65FE68FC08; Mon, 16 Mar 2009 12:16:17 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2GCGHrN060315; Mon, 16 Mar 2009 12:16:17 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2GCGHjI060314; Mon, 16 Mar 2009 12:16:17 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200903161216.n2GCGHjI060314@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Mon, 16 Mar 2009 12:16: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: r189875 - head/bin/cat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Mar 2009 12:16:19 -0000 Author: des Date: Mon Mar 16 12:16:17 2009 New Revision: 189875 URL: http://svn.freebsd.org/changeset/base/189875 Log: cat(1) compiles fine at WARNS level 6. Modified: head/bin/cat/Makefile Modified: head/bin/cat/Makefile ============================================================================== --- head/bin/cat/Makefile Mon Mar 16 11:19:07 2009 (r189874) +++ head/bin/cat/Makefile Mon Mar 16 12:16:17 2009 (r189875) @@ -2,5 +2,6 @@ # $FreeBSD$ PROG= cat +WARNS?= 6 .include From owner-svn-src-head@FreeBSD.ORG Mon Mar 16 12:42:23 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7136B106566B; Mon, 16 Mar 2009 12:42:23 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5F8568FC13; Mon, 16 Mar 2009 12:42:23 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2GCgNMf060831; Mon, 16 Mar 2009 12:42:23 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2GCgNMG060830; Mon, 16 Mar 2009 12:42:23 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200903161242.n2GCgNMG060830@svn.freebsd.org> From: Alexander Motin Date: Mon, 16 Mar 2009 12:42: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: r189876 - head/sys/dev/sound/pci/hda X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Mar 2009 12:42:24 -0000 Author: mav Date: Mon Mar 16 12:42:23 2009 New Revision: 189876 URL: http://svn.freebsd.org/changeset/base/189876 Log: Fix spelling in message. Modified: head/sys/dev/sound/pci/hda/hdac.c Modified: head/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.c Mon Mar 16 12:16:17 2009 (r189875) +++ head/sys/dev/sound/pci/hda/hdac.c Mon Mar 16 12:42:23 2009 (r189876) @@ -7923,9 +7923,9 @@ hdac_pcm_attach(device_t dev) device_printf(dev, "+--------------------------------------+\n"); hdac_dump_pcmchannels(pdevinfo); device_printf(dev, "\n"); - device_printf(dev, "+--------------------------------+\n"); - device_printf(dev, "| DUMPING Playback/Record Pathes |\n"); - device_printf(dev, "+--------------------------------+\n"); + device_printf(dev, "+-------------------------------+\n"); + device_printf(dev, "| DUMPING Playback/Record Paths |\n"); + device_printf(dev, "+-------------------------------+\n"); hdac_dump_dac(pdevinfo); hdac_dump_adc(pdevinfo); hdac_dump_mix(pdevinfo); From owner-svn-src-head@FreeBSD.ORG Mon Mar 16 15:09:48 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9CB7E106568A; Mon, 16 Mar 2009 15:09:48 +0000 (UTC) (envelope-from vanhu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 897208FC18; Mon, 16 Mar 2009 15:09:48 +0000 (UTC) (envelope-from vanhu@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2GF9lxd063774; Mon, 16 Mar 2009 15:09:47 GMT (envelope-from vanhu@svn.freebsd.org) Received: (from vanhu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2GF9lT6063773; Mon, 16 Mar 2009 15:09:47 GMT (envelope-from vanhu@svn.freebsd.org) Message-Id: <200903161509.n2GF9lT6063773@svn.freebsd.org> From: VANHULLEBUS Yvan Date: Mon, 16 Mar 2009 15:09: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: r189877 - head/contrib/libpcap X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Mar 2009 15:09:50 -0000 Author: vanhu Date: Mon Mar 16 15:09:47 2009 New Revision: 189877 URL: http://svn.freebsd.org/changeset/base/189877 Log: Added DLT_ENC to map list, so it is now possible to save dumps on enc0 Reviewed by: gnn(mentor) Obtained from: NETASQ MFC after: 1 week Modified: head/contrib/libpcap/savefile.c Modified: head/contrib/libpcap/savefile.c ============================================================================== --- head/contrib/libpcap/savefile.c Mon Mar 16 12:42:23 2009 (r189876) +++ head/contrib/libpcap/savefile.c Mon Mar 16 15:09:47 2009 (r189877) @@ -811,6 +811,9 @@ static struct linktype_map { /* IPMB */ { DLT_IPMB, LINKTYPE_IPMB }, + /* enc0 device */ + { DLT_ENC, LINKTYPE_ENC }, + { -1, -1 } }; From owner-svn-src-head@FreeBSD.ORG Mon Mar 16 15:39:47 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5DF561065678; Mon, 16 Mar 2009 15:39: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 40EDB8FC14; Mon, 16 Mar 2009 15:39:47 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2GFdlF0064400; Mon, 16 Mar 2009 15:39:47 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2GFdliL064395; Mon, 16 Mar 2009 15:39:47 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200903161539.n2GFdliL064395@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 16 Mar 2009 15:39: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: r189878 - in head/sys: gnu/fs/xfs/FreeBSD kern sys ufs/ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Mar 2009 15:39:48 -0000 Author: kib Date: Mon Mar 16 15:39:46 2009 New Revision: 189878 URL: http://svn.freebsd.org/changeset/base/189878 Log: Fix two issues with bufdaemon, often causing the processes to hang in the "nbufkv" sleep. First, ffs background cg group block write requests a new buffer for the shadow copy. When ffs_bufwrite() is called from the bufdaemon due to buffers shortage, requesting the buffer deadlock bufdaemon. Introduce a new flag for getnewbuf(), GB_NOWAIT_BD, to request getblk to not block while allocating the buffer, and return failure instead. Add a flag argument to the geteblk to allow to pass the flags to getblk(). Do not repeat the getnewbuf() call from geteblk if buffer allocation failed and either GB_NOWAIT_BD is specified, or geteblk() is called from bufdaemon (or its helper, see below). In ffs_bufwrite(), fall back to synchronous cg block write if shadow block allocation failed. Since r107847, buffer write assumes that vnode owning the buffer is locked. The second problem is that buffer cache may accumulate many buffers belonging to limited number of vnodes. With such workload, quite often threads that own the mentioned vnodes locks are trying to read another block from the vnodes, and, due to buffer cache exhaustion, are asking bufdaemon for help. Bufdaemon is unable to make any substantial progress because the vnodes are locked. Allow the threads owning vnode locks to help the bufdaemon by doing the flush pass over the buffer cache before getnewbuf() is going to uninterruptible sleep. Move the flushing code from buf_daemon() to new helper function buf_do_flush(), that is called from getnewbuf(). The number of buffers flushed by single call to buf_do_flush() from getnewbuf() is limited by new sysctl vfs.flushbufqtarget. Prevent recursive calls to buf_do_flush() by marking the bufdaemon and threads that temporarily help bufdaemon by TDP_BUFNEED flag. In collaboration with: pho Reviewed by: tegge (previous version) Tested by: glebius, yandex ... MFC after: 3 weeks Modified: head/sys/gnu/fs/xfs/FreeBSD/xfs_buf.c head/sys/kern/vfs_bio.c head/sys/sys/buf.h head/sys/sys/proc.h head/sys/ufs/ffs/ffs_vfsops.c Modified: head/sys/gnu/fs/xfs/FreeBSD/xfs_buf.c ============================================================================== --- head/sys/gnu/fs/xfs/FreeBSD/xfs_buf.c Mon Mar 16 15:09:47 2009 (r189877) +++ head/sys/gnu/fs/xfs/FreeBSD/xfs_buf.c Mon Mar 16 15:39:46 2009 (r189878) @@ -81,7 +81,7 @@ xfs_buf_get_empty(size_t size, xfs_buft { struct buf *bp; - bp = geteblk(0); + bp = geteblk(0, 0); if (bp != NULL) { bp->b_bufsize = size; bp->b_bcount = size; @@ -100,7 +100,7 @@ xfs_buf_get_noaddr(size_t len, xfs_bufta if (len >= MAXPHYS) return (NULL); - bp = geteblk(len); + bp = geteblk(len, 0); if (bp != NULL) { BUF_ASSERT_HELD(bp); Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Mon Mar 16 15:09:47 2009 (r189877) +++ head/sys/kern/vfs_bio.c Mon Mar 16 15:39:46 2009 (r189878) @@ -106,7 +106,8 @@ static void vfs_setdirty_locked_object(s static void vfs_vmio_release(struct buf *bp); static int vfs_bio_clcheck(struct vnode *vp, int size, daddr_t lblkno, daddr_t blkno); -static int flushbufqueues(int, int); +static int buf_do_flush(struct vnode *vp); +static int flushbufqueues(struct vnode *, int, int); static void buf_daemon(void); static void bremfreel(struct buf *bp); #if defined(COMPAT_FREEBSD4) || defined(COMPAT_FREEBSD5) || \ @@ -198,6 +199,9 @@ SYSCTL_INT(_vfs, OID_AUTO, getnewbufcall static int getnewbufrestarts; SYSCTL_INT(_vfs, OID_AUTO, getnewbufrestarts, CTLFLAG_RW, &getnewbufrestarts, 0, "Number of times getnewbuf has had to restart a buffer aquisition"); +static int flushbufqtarget = 100; +SYSCTL_INT(_vfs, OID_AUTO, flushbufqtarget, CTLFLAG_RW, &flushbufqtarget, 0, + "Amount of work to do in flushbufqueues when helping bufdaemon"); /* * Wakeup point for bufdaemon, as well as indicator of whether it is already @@ -258,6 +262,7 @@ static struct mtx nblock; #define QUEUE_DIRTY_GIANT 3 /* B_DELWRI buffers that need giant */ #define QUEUE_EMPTYKVA 4 /* empty buffer headers w/KVA assignment */ #define QUEUE_EMPTY 5 /* empty buffer headers */ +#define QUEUE_SENTINEL 1024 /* not an queue index, but mark for sentinel */ /* Queues for free buffers with various properties */ static TAILQ_HEAD(bqueues, buf) bufqueues[BUFFER_QUEUES] = { { 0 } }; @@ -1710,21 +1715,23 @@ vfs_bio_awrite(struct buf *bp) */ static struct buf * -getnewbuf(int slpflag, int slptimeo, int size, int maxsize) +getnewbuf(struct vnode *vp, int slpflag, int slptimeo, int size, int maxsize, + int gbflags) { + struct thread *td; struct buf *bp; struct buf *nbp; int defrag = 0; int nqindex; static int flushingbufs; + td = curthread; /* * We can't afford to block since we might be holding a vnode lock, * which may prevent system daemons from running. We deal with * low-memory situations by proactively returning memory and running * async I/O rather then sync I/O. */ - atomic_add_int(&getnewbufcalls, 1); atomic_subtract_int(&getnewbufrestarts, 1); restart: @@ -1956,8 +1963,9 @@ restart: */ if (bp == NULL) { - int flags; + int flags, norunbuf; char *waitmsg; + int fl; if (defrag) { flags = VFS_BIO_NEED_BUFSPACE; @@ -1975,9 +1983,35 @@ restart: mtx_unlock(&bqlock); bd_speedup(); /* heeeelp */ + if (gbflags & GB_NOWAIT_BD) + return (NULL); mtx_lock(&nblock); while (needsbuffer & flags) { + if (vp != NULL && (td->td_pflags & TDP_BUFNEED) == 0) { + mtx_unlock(&nblock); + /* + * getblk() is called with a vnode + * locked, and some majority of the + * dirty buffers may as well belong to + * the vnode. Flushing the buffers + * there would make a progress that + * cannot be achieved by the + * buf_daemon, that cannot lock the + * vnode. + */ + norunbuf = ~(TDP_BUFNEED | TDP_NORUNNINGBUF) | + (td->td_pflags & TDP_NORUNNINGBUF); + /* play bufdaemon */ + td->td_pflags |= TDP_BUFNEED | TDP_NORUNNINGBUF; + fl = buf_do_flush(vp); + td->td_pflags &= norunbuf; + mtx_lock(&nblock); + if (fl != 0) + continue; + if ((needsbuffer & flags) == 0) + break; + } if (msleep(&needsbuffer, &nblock, (PRIBIO + 4) | slpflag, waitmsg, slptimeo)) { mtx_unlock(&nblock); @@ -2046,6 +2080,35 @@ static struct kproc_desc buf_kp = { }; SYSINIT(bufdaemon, SI_SUB_KTHREAD_BUF, SI_ORDER_FIRST, kproc_start, &buf_kp); +static int +buf_do_flush(struct vnode *vp) +{ + int flushed; + + flushed = flushbufqueues(vp, QUEUE_DIRTY, 0); + /* The list empty check here is slightly racy */ + if (!TAILQ_EMPTY(&bufqueues[QUEUE_DIRTY_GIANT])) { + mtx_lock(&Giant); + flushed += flushbufqueues(vp, QUEUE_DIRTY_GIANT, 0); + mtx_unlock(&Giant); + } + if (flushed == 0) { + /* + * Could not find any buffers without rollback + * dependencies, so just write the first one + * in the hopes of eventually making progress. + */ + flushbufqueues(vp, QUEUE_DIRTY, 1); + if (!TAILQ_EMPTY( + &bufqueues[QUEUE_DIRTY_GIANT])) { + mtx_lock(&Giant); + flushbufqueues(vp, QUEUE_DIRTY_GIANT, 1); + mtx_unlock(&Giant); + } + } + return (flushed); +} + static void buf_daemon() { @@ -2059,7 +2122,7 @@ buf_daemon() /* * This process is allowed to take the buffer cache to the limit */ - curthread->td_pflags |= TDP_NORUNNINGBUF; + curthread->td_pflags |= TDP_NORUNNINGBUF | TDP_BUFNEED; mtx_lock(&bdlock); for (;;) { bd_request = 0; @@ -2074,30 +2137,8 @@ buf_daemon() * normally would so they can run in parallel with our drain. */ while (numdirtybuffers > lodirtybuffers) { - int flushed; - - flushed = flushbufqueues(QUEUE_DIRTY, 0); - /* The list empty check here is slightly racy */ - if (!TAILQ_EMPTY(&bufqueues[QUEUE_DIRTY_GIANT])) { - mtx_lock(&Giant); - flushed += flushbufqueues(QUEUE_DIRTY_GIANT, 0); - mtx_unlock(&Giant); - } - if (flushed == 0) { - /* - * Could not find any buffers without rollback - * dependencies, so just write the first one - * in the hopes of eventually making progress. - */ - flushbufqueues(QUEUE_DIRTY, 1); - if (!TAILQ_EMPTY( - &bufqueues[QUEUE_DIRTY_GIANT])) { - mtx_lock(&Giant); - flushbufqueues(QUEUE_DIRTY_GIANT, 1); - mtx_unlock(&Giant); - } + if (buf_do_flush(NULL) == 0) break; - } uio_yield(); } @@ -2143,7 +2184,7 @@ SYSCTL_INT(_vfs, OID_AUTO, flushwithdeps 0, "Number of buffers flushed with dependecies that require rollbacks"); static int -flushbufqueues(int queue, int flushdeps) +flushbufqueues(struct vnode *lvp, int queue, int flushdeps) { struct buf sentinel; struct vnode *vp; @@ -2153,20 +2194,37 @@ flushbufqueues(int queue, int flushdeps) int flushed; int target; - target = numdirtybuffers - lodirtybuffers; - if (flushdeps && target > 2) - target /= 2; + if (lvp == NULL) { + target = numdirtybuffers - lodirtybuffers; + if (flushdeps && target > 2) + target /= 2; + } else + target = flushbufqtarget; flushed = 0; bp = NULL; + sentinel.b_qindex = QUEUE_SENTINEL; mtx_lock(&bqlock); - TAILQ_INSERT_TAIL(&bufqueues[queue], &sentinel, b_freelist); + TAILQ_INSERT_HEAD(&bufqueues[queue], &sentinel, b_freelist); while (flushed != target) { - bp = TAILQ_FIRST(&bufqueues[queue]); - if (bp == &sentinel) + bp = TAILQ_NEXT(&sentinel, b_freelist); + if (bp != NULL) { + TAILQ_REMOVE(&bufqueues[queue], &sentinel, b_freelist); + TAILQ_INSERT_AFTER(&bufqueues[queue], bp, &sentinel, + b_freelist); + } else break; - TAILQ_REMOVE(&bufqueues[queue], bp, b_freelist); - TAILQ_INSERT_TAIL(&bufqueues[queue], bp, b_freelist); - + /* + * Skip sentinels inserted by other invocations of the + * flushbufqueues(), taking care to not reorder them. + */ + if (bp->b_qindex == QUEUE_SENTINEL) + continue; + /* + * Only flush the buffers that belong to the + * vnode locked by the curthread. + */ + if (lvp != NULL && bp->b_vp != lvp) + continue; if (BUF_LOCK(bp, LK_EXCLUSIVE | LK_NOWAIT, NULL) != 0) continue; if (bp->b_pin_count > 0) { @@ -2214,16 +2272,27 @@ flushbufqueues(int queue, int flushdeps) BUF_UNLOCK(bp); continue; } - if (vn_lock(vp, LK_EXCLUSIVE | LK_NOWAIT) == 0) { + if (vn_lock(vp, LK_EXCLUSIVE | LK_NOWAIT | LK_CANRECURSE) == 0) { mtx_unlock(&bqlock); CTR3(KTR_BUF, "flushbufqueue(%p) vp %p flags %X", bp, bp->b_vp, bp->b_flags); - vfs_bio_awrite(bp); + if (curproc == bufdaemonproc) + vfs_bio_awrite(bp); + else { + bremfree(bp); + bwrite(bp); + } vn_finished_write(mp); VOP_UNLOCK(vp, 0); flushwithdeps += hasdeps; flushed++; - waitrunningbufspace(); + + /* + * Sleeping on runningbufspace while holding + * vnode lock leads to deadlock. + */ + if (curproc == bufdaemonproc) + waitrunningbufspace(); numdirtywakeup((lodirtybuffers + hidirtybuffers) / 2); mtx_lock(&bqlock); continue; @@ -2605,7 +2674,7 @@ loop: maxsize = vmio ? size + (offset & PAGE_MASK) : size; maxsize = imax(maxsize, bsize); - bp = getnewbuf(slpflag, slptimeo, size, maxsize); + bp = getnewbuf(vp, slpflag, slptimeo, size, maxsize, flags); if (bp == NULL) { if (slpflag || slptimeo) return NULL; @@ -2680,14 +2749,17 @@ loop: * set to B_INVAL. */ struct buf * -geteblk(int size) +geteblk(int size, int flags) { struct buf *bp; int maxsize; maxsize = (size + BKVAMASK) & ~BKVAMASK; - while ((bp = getnewbuf(0, 0, size, maxsize)) == 0) - continue; + while ((bp = getnewbuf(NULL, 0, 0, size, maxsize, flags)) == NULL) { + if ((flags & GB_NOWAIT_BD) && + (curthread->td_pflags & TDP_BUFNEED) != 0) + return (NULL); + } allocbuf(bp, size); bp->b_flags |= B_INVAL; /* b_dep cleared by getnewbuf() */ BUF_ASSERT_HELD(bp); Modified: head/sys/sys/buf.h ============================================================================== --- head/sys/sys/buf.h Mon Mar 16 15:09:47 2009 (r189877) +++ head/sys/sys/buf.h Mon Mar 16 15:39:46 2009 (r189878) @@ -443,6 +443,7 @@ buf_countdeps(struct buf *bp, int i) */ #define GB_LOCK_NOWAIT 0x0001 /* Fail if we block on a buf lock. */ #define GB_NOCREAT 0x0002 /* Don't create a buf if not found. */ +#define GB_NOWAIT_BD 0x0004 /* Do not wait for bufdaemon */ #ifdef _KERNEL extern int nbuf; /* The number of buffer headers */ @@ -487,7 +488,7 @@ struct buf * getpbuf(int *); struct buf *incore(struct bufobj *, daddr_t); struct buf *gbincore(struct bufobj *, daddr_t); struct buf *getblk(struct vnode *, daddr_t, int, int, int, int); -struct buf *geteblk(int); +struct buf *geteblk(int, int); int bufwait(struct buf *); int bufwrite(struct buf *); void bufdone(struct buf *); Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Mon Mar 16 15:09:47 2009 (r189877) +++ head/sys/sys/proc.h Mon Mar 16 15:39:46 2009 (r189878) @@ -345,7 +345,7 @@ do { \ #define TDP_OLDMASK 0x00000001 /* Need to restore mask after suspend. */ #define TDP_INKTR 0x00000002 /* Thread is currently in KTR code. */ #define TDP_INKTRACE 0x00000004 /* Thread is currently in KTRACE code. */ -#define TDP_UNUSED8 0x00000008 /* available */ +#define TDP_BUFNEED 0x00000008 /* Do not recurse into the buf flush */ #define TDP_COWINPROGRESS 0x00000010 /* Snapshot copy-on-write in progress. */ #define TDP_ALTSTACK 0x00000020 /* Have alternate signal stack. */ #define TDP_DEADLKTREAT 0x00000040 /* Lock aquisition - deadlock treatment. */ Modified: head/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vfsops.c Mon Mar 16 15:09:47 2009 (r189877) +++ head/sys/ufs/ffs/ffs_vfsops.c Mon Mar 16 15:39:46 2009 (r189878) @@ -1845,7 +1845,9 @@ ffs_bufwrite(struct buf *bp) ("bufwrite: needs chained iodone (%p)", bp->b_iodone)); /* get a new block */ - newbp = geteblk(bp->b_bufsize); + newbp = geteblk(bp->b_bufsize, GB_NOWAIT_BD); + if (newbp == NULL) + goto normal_write; /* * set it to be identical to the old block. We have to @@ -1885,6 +1887,7 @@ ffs_bufwrite(struct buf *bp) } /* Let the normal bufwrite do the rest for us */ +normal_write: return (bufwrite(bp)); } From owner-svn-src-head@FreeBSD.ORG Mon Mar 16 15:50:30 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 570CE10656FD; Mon, 16 Mar 2009 15:50:30 +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 44DDA8FC0A; Mon, 16 Mar 2009 15:50:30 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2GFoU9i064651; Mon, 16 Mar 2009 15:50:30 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2GFoUZI064650; Mon, 16 Mar 2009 15:50:30 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200903161550.n2GFoUZI064650@svn.freebsd.org> From: Alexander Motin Date: Mon, 16 Mar 2009 15:50: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: r189879 - head/sys/dev/sound/pci/hda X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Mar 2009 15:50:31 -0000 Author: mav Date: Mon Mar 16 15:50:29 2009 New Revision: 189879 URL: http://svn.freebsd.org/changeset/base/189879 Log: Remove CD input hack for ALC268 based Acer systems. Latest systems does not implement CD input in hardware, while unconditional showing it confuse users. Also it was made in the way that sometimes improper with present driver. Add patch for ALC268 based Acer TM5320 to make headphones jack sensing work. Default configuration defines two separate playback associations, which current driver unable to trace properly due to order they are defined and limited codec uniformity. Submitted by: G. Mirov Modified: head/sys/dev/sound/pci/hda/hdac.c Modified: head/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.c Mon Mar 16 15:39:46 2009 (r189878) +++ head/sys/dev/sound/pci/hda/hdac.c Mon Mar 16 15:50:29 2009 (r189879) @@ -83,7 +83,7 @@ #include "mixer_if.h" -#define HDA_DRV_TEST_REV "20090226_0129" +#define HDA_DRV_TEST_REV "20090316_0130" SND_DECLARE_FILE("$FreeBSD$"); @@ -247,6 +247,7 @@ SND_DECLARE_FILE("$FreeBSD$"); #define ACER_A4715_SUBVENDOR HDA_MODEL_CONSTRUCT(ACER, 0x0133) #define ACER_3681WXM_SUBVENDOR HDA_MODEL_CONSTRUCT(ACER, 0x0110) #define ACER_T6292_SUBVENDOR HDA_MODEL_CONSTRUCT(ACER, 0x011b) +#define ACER_T5320_SUBVENDOR HDA_MODEL_CONSTRUCT(ACER, 0x011f) #define ACER_ALL_SUBVENDOR HDA_MODEL_CONSTRUCT(ACER, 0xffff) /* Asus */ @@ -2452,13 +2453,14 @@ hdac_widget_pin_getconfig(struct hdac_wi patch = "seq=15 device=Headphones"; break; } - } else if (id == HDA_CODEC_ALC268 && - HDA_DEV_MATCH(ACER_ALL_SUBVENDOR, sc->pci_subvendor)) { + } else if (id == HDA_CODEC_ALC268) { + if (sc->pci_subvendor == ACER_T5320_SUBVENDOR) { switch (nid) { - case 28: - patch = "device=CD conn=fixed"; + case 20: /* Headphones Jack */ + patch = "as=1 seq=15"; break; } + } } if (patch != NULL) From owner-svn-src-head@FreeBSD.ORG Mon Mar 16 15:54:22 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 34F1F1065673; Mon, 16 Mar 2009 15:54:22 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 234908FC23; Mon, 16 Mar 2009 15:54:22 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2GFsM6e064762; Mon, 16 Mar 2009 15:54:22 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2GFsMm6064761; Mon, 16 Mar 2009 15:54:22 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200903161554.n2GFsMm6064761@svn.freebsd.org> From: Sam Leffler Date: Mon, 16 Mar 2009 15:54: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: r189880 - head/share/man/man8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Mar 2009 15:54:22 -0000 Author: sam Date: Mon Mar 16 15:54:21 2009 New Revision: 189880 URL: http://svn.freebsd.org/changeset/base/189880 Log: (finally) document -n Modified: head/share/man/man8/nanobsd.8 Modified: head/share/man/man8/nanobsd.8 ============================================================================== --- head/share/man/man8/nanobsd.8 Mon Mar 16 15:50:29 2009 (r189879) +++ head/share/man/man8/nanobsd.8 Mon Mar 16 15:54:21 2009 (r189880) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 28, 2006 +.Dd March 16, 2009 .Dt NANOBSD 8 .Os .Sh NAME @@ -33,7 +33,7 @@ applications .Sh SYNOPSIS .Nm -.Op Fl bhkw +.Op Fl bhknw .Op Fl c Ar config-file .Sh DESCRIPTION The @@ -59,6 +59,12 @@ Display usage information. Skip the .Cm buildkernel stage of the build. +.It Fl n +Do not cleanup before each build stage. +This suppresses the normal cleanup work done before the +.Cm buildworld +stage and adds -DNO_CLEAN to the make command line +used for each build stage (world and kernel). .It Fl w Skip the .Cm buildworld From owner-svn-src-head@FreeBSD.ORG Mon Mar 16 16:15:14 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C31921065697; Mon, 16 Mar 2009 16:15:14 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 96FBF8FC15; Mon, 16 Mar 2009 16:15:14 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2GGFEtn065282; Mon, 16 Mar 2009 16:15:14 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2GGFERX065281; Mon, 16 Mar 2009 16:15:14 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200903161615.n2GGFERX065281@svn.freebsd.org> From: Andriy Gapon Date: Mon, 16 Mar 2009 16:15:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r189882 - head/sys/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: Mon, 16 Mar 2009 16:15:16 -0000 Author: avg Date: Mon Mar 16 16:15:14 2009 New Revision: 189882 URL: http://svn.freebsd.org/changeset/base/189882 Log: intpm: minor enhancements 1. fix nointr check in intsmb_start, matters only if ENABLE_ALART is defined (by default, it is not); 2. drop unnecessary inspection/reporting of power-management io registers base address; 3. in verbose mode report errors from SMBus host controller and their mapping to smbus(4) errors; Approved by: jhb (mentor) Modified: head/sys/pci/intpm.c Modified: head/sys/pci/intpm.c ============================================================================== --- head/sys/pci/intpm.c Mon Mar 16 16:14:26 2009 (r189881) +++ head/sys/pci/intpm.c Mon Mar 16 16:15:14 2009 (r189882) @@ -167,10 +167,6 @@ intsmb_attach(device_t dev) goto fail; } - value = pci_read_config(dev, PCI_BASE_ADDR_PM, 4); - device_printf(dev, "PM %s %x\n", (value & 1) ? "I/O mapped" : "Memory", - value & 0xfffe); - sc->isbusy = 0; sc->smbus = device_add_child(dev, "smbus", -1); if (sc->smbus == NULL) { @@ -365,13 +361,13 @@ intsmb_start(struct intsmb_softc *sc, un tmp |= PIIX4_SMBHSTCNT_START; /* While not in autoconfiguration enable interrupts. */ - if (!cold || !nointr) + if (!cold && !nointr) tmp |= PIIX4_SMBHSTCNT_INTREN; bus_write_1(sc->io_res, PIIX4_SMBHSTCNT, tmp); } static int -intsmb_error(int status) +intsmb_error(device_t dev, int status) { int error = 0; @@ -381,6 +377,10 @@ intsmb_error(int status) error |= SMB_ECOLLI; if (status & PIIX4_SMBHSTSTAT_FAIL) error |= SMB_ENOACK; + + if (error != 0 && bootverbose) + device_printf(dev, "error = %d, status = %#x\n", error, status); + return (error); } @@ -410,7 +410,7 @@ intsmb_stop_poll(struct intsmb_softc *sc status = bus_read_1(sc->io_res, PIIX4_SMBHSTSTS); if (!(status & PIIX4_SMBHSTSTAT_BUSY)) { sc->isbusy = 0; - error = intsmb_error(status); + error = intsmb_error(sc->dev, status); if (error == 0 && !(status & PIIX4_SMBHSTSTAT_INTR)) device_printf(sc->dev, "unknown cause why?\n"); return (error); @@ -442,7 +442,7 @@ intsmb_stop(struct intsmb_softc *sc) if (error == 0) { status = bus_read_1(sc->io_res, PIIX4_SMBHSTSTS); if (!(status & PIIX4_SMBHSTSTAT_BUSY)) { - error = intsmb_error(status); + error = intsmb_error(sc->dev, status); if (error == 0 && !(status & PIIX4_SMBHSTSTAT_INTR)) device_printf(sc->dev, "unknown cause why?\n"); #ifdef ENABLE_ALART From owner-svn-src-head@FreeBSD.ORG Mon Mar 16 16:33:09 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D96010656E3; Mon, 16 Mar 2009 16:33:09 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3AEB88FC12; Mon, 16 Mar 2009 16:33:09 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2GGX9h9065828; Mon, 16 Mar 2009 16:33:09 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2GGX966065825; Mon, 16 Mar 2009 16:33:09 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <200903161633.n2GGX966065825@svn.freebsd.org> From: Gabor Kovesdan Date: Mon, 16 Mar 2009 16:33: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: r189883 - head/lib/libc/nls X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Mar 2009 16:33:10 -0000 Author: gabor (doc,ports committer) Date: Mon Mar 16 16:33:08 2009 New Revision: 189883 URL: http://svn.freebsd.org/changeset/base/189883 Log: - Add Brazilian Portuguese catalog [1] - Fixes for German catalog [2] PR: kern/132694 [1], conf/80504 [2] Submitted by: Murilo Opsfelder [1], brueffer [2] Added: head/lib/libc/nls/pt_BR.ISO8859-1.msg (contents, props changed) Modified: head/lib/libc/nls/Makefile.inc head/lib/libc/nls/de_DE.ISO8859-1.msg Modified: head/lib/libc/nls/Makefile.inc ============================================================================== --- head/lib/libc/nls/Makefile.inc Mon Mar 16 16:15:14 2009 (r189882) +++ head/lib/libc/nls/Makefile.inc Mon Mar 16 16:33:08 2009 (r189883) @@ -27,6 +27,7 @@ NLS+= mn_MN.UTF-8 NLS+= nl_NL.ISO8859-1 NLS+= no_NO.ISO8859-1 NLS+= pl_PL.ISO8859-2 +NLS+= pt_BR.ISO8859-1 NLS+= ru_RU.KOI8-R NLS+= sk_SK.ISO8859-2 NLS+= sv_SE.ISO8859-1 Modified: head/lib/libc/nls/de_DE.ISO8859-1.msg ============================================================================== --- head/lib/libc/nls/de_DE.ISO8859-1.msg Mon Mar 16 16:15:14 2009 (r189882) +++ head/lib/libc/nls/de_DE.ISO8859-1.msg Mon Mar 16 16:33:08 2009 (r189883) @@ -24,13 +24,13 @@ $ ENOEXEC $ EBADF 9 Ungültiger Dateideskriptor $ ECHILD -10 Kein Kindprozess +10 Keine Kindprozesse $ EDEADLK 11 Ein Deadlock wurde vermieden $ ENOMEM 12 Kann nicht genug Speicher belegen $ EACCES -13 Zugriff verboten +13 Zugriff verweigert $ EFAULT 14 Ungültige Adresse $ ENOTBLK @@ -50,13 +50,13 @@ $ EISDIR $ EINVAL 22 Ungültiges Argument $ ENFILE -23 Zu viele offene Dateien im gesamten System +23 Zu viele offene Dateien im System $ EMFILE 24 Zu viele offene Dateien $ ENOTTY -25 Ungültiger Ioctl für dieses Gerät +25 Ungültiger IOCTL für dieses Gerät $ ETXTBSY -26 Ausführbare Datei wird benutzt +26 Text-Datei ist belegt $ EFBIG 27 Datei zu groß $ ENOSPC @@ -70,13 +70,13 @@ $ EMLINK $ EPIPE 32 Unterbrochene Pipe $ EDOM -33 Numerisches Argument ausserhalb des Wertebereichs +33 Numerisches Argument außerhalb des Wertebereichs $ ERANGE -34 Ergebnis zu groß oder zu klein +34 Ergebnis zu groß $ EAGAIN, EWOULDBLOCK 35 Ressource vorübergehend nicht verfügbar $ EINPROGRESS -36 Operation wird jetzt fortgesetzt +36 Operation wird jetzt ausgeführt $ EALREADY 37 Operation wird bereits ausgeführt $ ENOTSOCK @@ -98,7 +98,7 @@ $ EOPNOTSUPP $ EPFNOSUPPORT 46 Protokollfamilie nicht unterstützt $ EAFNOSUPPORT -47 Addressart wird von der Protokollfamilie nicht unterstützt +47 Adressfamilie wird von der Protokollfamilie nicht unterstützt $ EADDRINUSE 48 Adresse wird bereits benutzt $ EADDRNOTAVAIL @@ -142,7 +142,7 @@ $ EPROCLIM $ EUSERS 68 Zu viele Benutzer $ EDQUOT -69 Plattenplatzlimit erschöpft +69 Platzlimit überschritten $ ESTALE 70 Verwaister NFS-Dateideskriptor $ EREMOTE @@ -150,7 +150,7 @@ $ EREMOTE $ EBADRPC 72 RPC-Struktur ist ungültig $ ERPCMISMATCH -73 RPC-Version stimmt nicht +73 RPC-Version ist falsch $ EPROGUNAVAIL 74 RPC-Programm nicht verfügbar $ EPROGMISMATCH @@ -164,7 +164,7 @@ $ ENOSYS $ EFTYPE 79 Ungültiger Dateityp oder Dateiformat $ EAUTH -80 Authentikationsfehler +80 Authentifikationsfehler $ ENEEDAUTH 81 Authentikator benötigt $ EIDRM @@ -173,30 +173,14 @@ $ ENOMSG 83 Keine Nachricht vom gewünschten Typ $ EOVERFLOW 84 Wert zu groß, um in Datentyp zu speichern -$ EILSEQ -85 Illegale Byte-Sequenz -$ ENOTSUP -86 Operation nicht unterstützt $ ECANCELED -87 Operation abgebrochen -$ EBADMSG -88 Ungültige Nachricht -$ ENODATA -89 Keine Nachricht verfügbar -$ ENOSR -90 Keine STREAM-Ressourcen verfügbar -$ ENOSTR -91 Kein STREAM -$ ETIME -92 Zeitüberschreitung bei STREAM Ioctl +85 Operation abgebrochen +$ EILSEQ +86 Ungültige Byte-Sequenz $ ENOATTR -93 Attribut nicht gefunden -$ EMULTIHOP -94 Multihopversuch -$ ENOLINK -95 Verbindung wurde getrennt -$ EPROTO -96 Protokollfehler +87 Attribut nicht gefunden +$ EDOOFUS +88 Programmierfehler $ $ strsignal() support catalog $ @@ -224,7 +208,7 @@ $ SIGBUS $ SIGSEGV 11 Illegaler Speicherzugriff $ SIGSYS -12 Ungültiger Systemaufruf +12 Ungültiger Speicherzugriff $ SIGPIPE 13 Unterbrochene Pipe $ SIGALRM @@ -246,22 +230,20 @@ $ SIGTTIN $ SIGTTOU 22 Gestoppt (Ausgabe) $ SIGIO -23 Ein/Ausgabe ist möglich +23 Ein/Ausgabe möglich $ SIGXCPU -24 CPU-Zeitlimit erschöpft +24 CPU-Zeitlimit überschritten $ SIGXFSZ -25 Dateigröße hat das Limit erreicht +25 Dateigrößenlimit überschritten $ SIGVTALRM 26 Virtueller Wecker abgelaufen $ SIGPROF 27 Profil-Wecker abgelaufen $ SIGWINCH -28 Fenstergröße hat sich geändert +28 Fenstergröße hat sich verändert $ SIGINFO 29 Informationsanforderung $ SIGUSR1 30 Benutzerdefiniertes Signal 1 $ SIGUSR2 31 Benutzerdefiniertes Signal 2 -$ SIGPWR -32 Statusänderung der Energieversorgung Added: head/lib/libc/nls/pt_BR.ISO8859-1.msg ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/nls/pt_BR.ISO8859-1.msg Mon Mar 16 16:33:08 2009 (r189883) @@ -0,0 +1,249 @@ +$ $FreeBSD$ +$ +$ Message catalog for pt_BR.ISO8859-1 locale +$ +$ strerror() support catalog +$ +$set 1 +$ EPERM +1 Operação não permitida +$ ENOENT +2 Nenhum arquivo ou diretório encontrado +$ ESRCH +3 Nenhum processo encontrado +$ EINTR +4 Chamada de sistema interrompida +$ EIO +5 Erro de entrada/saída +$ ENXIO +6 Dispositivo não configurado +$ E2BIG +7 Lista de argumentos muito grande +$ ENOEXEC +8 Erro no formato de execução +$ EBADF +9 Erro no descritor de arquivo +$ ECHILD +10 Nenhum processo filho +$ EDEADLK +11 Bloqueio de recurso evitado +$ ENOMEM +12 Impossível alocar memória +$ EACCES +13 Permissão negada +$ EFAULT +14 Endereço errado +$ ENOTBLK +15 Dispositivo de bloco requerido +$ EBUSY +16 Dispositivo ocupado +$ EEXIST +17 Arquivo existe +$ EXDEV +18 Ligação entre dispositivos +$ ENODEV +19 Operação não suportada pelo dispositivo +$ ENOTDIR +20 Não é um diretório +$ EISDIR +21 É um diretório +$ EINVAL +22 Argumento inválido +$ ENFILE +23 Muitos arquivos abertos no sistema +$ EMFILE +24 Muitos arquivos abertos no sistema +$ ENOTTY +25 ioctl inapropriado para o dispositivo +$ ETXTBSY +26 Arquivo texto sendo utilizado +$ EFBIG +27 Arquivo muito grande +$ ENOSPC +28 Sem espaço no dispositivo +$ ESPIPE +29 seek ilegal +$ EROFS +30 Sistema de arquivos apenas para leitura +$ EMLINK +31 Muitos links +$ EPIPE +32 pipe quebrado +$ EDOM +33 Arqumento numérico fora do domínio +$ ERANGE +34 Resultado muito grande +$ EAGAIN, EWOULDBLOCK +35 Recurso temporariamente indisponível +$ EINPROGRESS +36 Operação em progresso agora +$ EALREADY +37 Operação em progresso pronta +$ ENOTSOCK +38 Operação de socket em um não-socket +$ EDESTADDRREQ +39 Endereço de destino requerido +$ EMSGSIZE +40 Mensagem muito grande +$ EPROTOTYPE +41 Tipo de protocolo errado para socket +$ ENOPROTOOPT +42 Protocolo não disponível +$ EPROTONOSUPPORT +43 Protocolo não suportado +$ ESOCKTNOSUPPORT +44 Tipo de socket não suportado +$ EOPNOTSUPP +45 Operação não permitida +$ EPFNOSUPPORT +46 Família de protocolo não suportada +$ EAFNOSUPPORT +47 Família de endereços não suportada pela família de protocolos +$ EADDRINUSE +48 Endereço já está em uso +$ EADDRNOTAVAIL +49 Impossível obter endereço solicitado +$ ENETDOWN +50 Rede está parada +$ ENETUNREACH +51 Rede está inalcançável +$ ENETRESET +52 Conexão de rede perdida durante reset +$ ECONNABORTED +53 Conexão abortada por software +$ ECONNRESET +54 Conexão reiniciada pelo outro ponto +$ ENOBUFS +55 Sem espaço de buffer disponível +$ EISCONN +56 Socket já está conectado +$ ENOTCONN +57 Socket não está conectado +$ ESHUTDOWN +58 Impossível enviar depois que o socket foi finalizado +$ ETOOMANYREFS +59 Muitas referências: impossível ligar +$ ETIMEDOUT +60 Tempo de operação expirou +$ ECONNREFUSED +61 Conexão recusada +$ ELOOP +62 Muitos níveis de links simbólicos +$ ENAMETOOLONG +63 Nome de arquivo muito grande +$ EHOSTDOWN +64 Host está desligado +$ EHOSTUNREACH +65 Sem rota para o host +$ ENOTEMPTY +66 Diretório não está vazio +$ EPROCLIM +67 Muitos processos +$ EUSERS +68 Muitos usuários +$ EDQUOT +69 Quota de disco excedida +$ ESTALE +70 Manipulador de arquivo NFS velho +$ EREMOTE +71 Muitos níveis no caminho remoto +$ EBADRPC +72 Estrutura RPC incorreta +$ ERPCMISMATCH +73 Versão RPC incorreta +$ EPROGUNAVAIL +74 Programa RPC indisponível +$ EPROGMISMATCH +75 Versão do programa incorreta +$ EPROCUNAVAIL +76 Procedimento incorreto para o programa +$ ENOLCK +77 Nenhum lock disponível +$ ENOSYS +78 Função não implementada +$ EFTYPE +79 Tipo de arquivo ou formato inapropriados +$ EAUTH +80 Erro de autenticação +$ ENEEDAUTH +81 Necessidade de autenticador +$ EIDRM +82 Identificador removido +$ ENOMSG +83 Nenhuma mensagem do tipo desejado +$ EOVERFLOW +84 Valor muito grande para ser armazenado neste tipo de dado +$ ECANCELED +85 Operação cancelada +$ EILSEQ +86 Sequência de bytes ilegal +$ ENOATTR +87 Atributo não encontrado +$ EDOOFUS +88 Erro de programação +$ +$ strsignal() support catalog +$ +$set 2 +$ SIGHUP +1 Fim da linha (Hangup) +$ SIGINT +2 Interrupção +$ SIGQUIT +3 Saída +$ SIGILL +4 Instrução ilegal +$ SIGTRAP +5 Trap de Trace/BPT +$ SIGABRT +6 Abortar trap +$ SIGEMT +7 EMT trap +$ SIGFPE +8 Exceção de ponto flutuante +$ SIGKILL +9 Morreu +$ SIGBUS +10 Erro de barramento +$ SIGSEGV +11 Falha de segmentação +$ SIGSYS +12 Chamada de sistema incorreta +$ SIGPIPE +13 Pipe incorreto +$ SIGALRM +14 Alarme do relógio +$ SIGTERM +15 Terminado +$ SIGURG +16 Condição urgente de E/S +$ SIGSTOP +17 Suspendido (sinal) +$ SIGTSTP +18 Suspendido +$ SIGCONT +19 Continuado +$ SIGCHLD +20 Filho saiu +$ SIGTTIN +21 Parado (entrada de tty) +$ SIGTTOU +22 Parado (saída de tty) +$ SIGIO +23 E/S possível +$ SIGXCPU +24 Limite de tempo de CPU excedido +$ SIGXFSZ +25 Tamanho de arquivo excedido +$ SIGVTALRM +26 Temporizador virtual expirou +$ SIGPROF +27 Temporizador de profiling expirou +$ SIGWINCH +28 Mudança no tamanho de janela +$ SIGINFO +29 Requisição de informação +$ SIGUSR1 +30 Sinal 1 definido pelo usuário +$ SIGUSR2 +31 Sinal 2 definido pelo usuário From owner-svn-src-head@FreeBSD.ORG Mon Mar 16 16:40:09 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 164BE106566C; Mon, 16 Mar 2009 16:40:09 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.cksoft.de (mail.cksoft.de [195.88.108.3]) by mx1.freebsd.org (Postfix) with ESMTP id BF9B98FC13; Mon, 16 Mar 2009 16:40:08 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id 4108041C6BB; Mon, 16 Mar 2009 17:40:07 +0100 (CET) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([195.88.108.3]) by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id GaIk2d-l9kIm; Mon, 16 Mar 2009 17:40:05 +0100 (CET) Received: by mail.cksoft.de (Postfix, from userid 66) id D3A6441C6A1; Mon, 16 Mar 2009 17:40:05 +0100 (CET) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id 15E644448E6; Mon, 16 Mar 2009 16:38:56 +0000 (UTC) Date: Mon, 16 Mar 2009 16:38:56 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: VANHULLEBUS Yvan In-Reply-To: <200903161509.n2GF9lT6063773@svn.freebsd.org> Message-ID: <20090316163648.Q96785@maildrop.int.zabbadoz.net> References: <200903161509.n2GF9lT6063773@svn.freebsd.org> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, "George V. Neville-Neil" , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r189877 - head/contrib/libpcap X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Mar 2009 16:40:09 -0000 On Mon, 16 Mar 2009, VANHULLEBUS Yvan wrote: > Author: vanhu > Date: Mon Mar 16 15:09:47 2009 > New Revision: 189877 > URL: http://svn.freebsd.org/changeset/base/189877 > > Log: > Added DLT_ENC to map list, so it is now possible > to save dumps on enc0 > > Reviewed by: gnn(mentor) > Obtained from: NETASQ > MFC after: 1 week If you haven't you should also submit this upstream as OpenBSD can make use of that as well. (www.tcpdump.org) All entries (that aren't overlong) are tab separated in in the linktype_map map[]. It would be nice, to keep the style of the vendor. > Modified: > head/contrib/libpcap/savefile.c > > Modified: head/contrib/libpcap/savefile.c > ============================================================================== > --- head/contrib/libpcap/savefile.c Mon Mar 16 12:42:23 2009 (r189876) > +++ head/contrib/libpcap/savefile.c Mon Mar 16 15:09:47 2009 (r189877) > @@ -811,6 +811,9 @@ static struct linktype_map { > /* IPMB */ > { DLT_IPMB, LINKTYPE_IPMB }, > > + /* enc0 device */ > + { DLT_ENC, LINKTYPE_ENC }, > + > { -1, -1 } > }; > > -- Bjoern A. Zeeb The greatest risk is not taking one. From owner-svn-src-head@FreeBSD.ORG Mon Mar 16 19:09:59 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 865C9106564A; Mon, 16 Mar 2009 19:09:59 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 740628FC1B; Mon, 16 Mar 2009 19:09:59 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2GJ9xXh070024; Mon, 16 Mar 2009 19:09:59 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2GJ9x1I070023; Mon, 16 Mar 2009 19:09:59 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200903161909.n2GJ9x1I070023@svn.freebsd.org> From: Robert Noland Date: Mon, 16 Mar 2009 19:09: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: r189899 - head/sys/dev/drm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Mar 2009 19:10:00 -0000 Author: rnoland Date: Mon Mar 16 19:09:59 2009 New Revision: 189899 URL: http://svn.freebsd.org/changeset/base/189899 Log: Use the right MSI_REARM for RS600. MFC after: 3 days Modified: head/sys/dev/drm/radeon_irq.c Modified: head/sys/dev/drm/radeon_irq.c ============================================================================== --- head/sys/dev/drm/radeon_irq.c Mon Mar 16 18:15:52 2009 (r189898) +++ head/sys/dev/drm/radeon_irq.c Mon Mar 16 19:09:59 2009 (r189899) @@ -229,6 +229,7 @@ irqreturn_t radeon_driver_irq_handler(DR RADEON_WRITE(RADEON_AIC_CNTL, tmp | RS400_MSI_REARM); break; + case CHIP_RS600: case CHIP_RS690: case CHIP_RS740: tmp = RADEON_READ(RADEON_BUS_CNTL) & From owner-svn-src-head@FreeBSD.ORG Mon Mar 16 19:31:09 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2DAD6106566C; Mon, 16 Mar 2009 19:31:09 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 01B558FC0A; Mon, 16 Mar 2009 19:31:09 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2GJV8Pr070481; Mon, 16 Mar 2009 19:31:08 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2GJV8EF070480; Mon, 16 Mar 2009 19:31:08 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <200903161931.n2GJV8EF070480@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Mon, 16 Mar 2009 19:31:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r189900 - head/sys/geom/eli X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Mar 2009 19:31:09 -0000 Author: pjd Date: Mon Mar 16 19:31:08 2009 New Revision: 189900 URL: http://svn.freebsd.org/changeset/base/189900 Log: Detach GELI providers on shutdown/reboot, which will allow providers underneath to close properly. Reported, reviewed and tested by: guido MFC after: 1 week Modified: head/sys/geom/eli/g_eli.c Modified: head/sys/geom/eli/g_eli.c ============================================================================== --- head/sys/geom/eli/g_eli.c Mon Mar 16 19:09:59 2009 (r189899) +++ head/sys/geom/eli/g_eli.c Mon Mar 16 19:31:08 2009 (r189900) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -81,8 +82,12 @@ TUNABLE_INT("kern.geom.eli.batch", &g_el SYSCTL_UINT(_kern_geom_eli, OID_AUTO, batch, CTLFLAG_RW, &g_eli_batch, 0, "Use crypto operations batching"); +static eventhandler_tag g_eli_pre_sync = NULL; + static int g_eli_destroy_geom(struct gctl_req *req, struct g_class *mp, struct g_geom *gp); +static void g_eli_init(struct g_class *mp); +static void g_eli_fini(struct g_class *mp); static g_taste_t g_eli_taste; static g_dumpconf_t g_eli_dumpconf; @@ -92,7 +97,9 @@ struct g_class g_eli_class = { .version = G_VERSION, .ctlreq = g_eli_config, .taste = g_eli_taste, - .destroy_geom = g_eli_destroy_geom + .destroy_geom = g_eli_destroy_geom, + .init = g_eli_init, + .fini = g_eli_fini }; @@ -1075,5 +1082,52 @@ g_eli_dumpconf(struct sbuf *sb, const ch g_eli_algo2str(sc->sc_ealgo)); } +static void +g_eli_shutdown_pre_sync(void *arg, int howto) +{ + struct g_class *mp; + struct g_geom *gp, *gp2; + struct g_provider *pp; + struct g_eli_softc *sc; + int error; + + mp = arg; + DROP_GIANT(); + g_topology_lock(); + LIST_FOREACH_SAFE(gp, &mp->geom, geom, gp2) { + sc = gp->softc; + if (sc == NULL) + continue; + pp = LIST_FIRST(&gp->provider); + KASSERT(pp != NULL, ("No provider? gp=%p (%s)", gp, gp->name)); + if (pp->acr + pp->acw + pp->ace == 0) + error = g_eli_destroy(sc, 1); + else { + sc->sc_flags |= G_ELI_FLAG_RW_DETACH; + gp->access = g_eli_access; + } + } + g_topology_unlock(); + PICKUP_GIANT(); +} + +static void +g_eli_init(struct g_class *mp) +{ + + g_eli_pre_sync = EVENTHANDLER_REGISTER(shutdown_pre_sync, + g_eli_shutdown_pre_sync, mp, SHUTDOWN_PRI_FIRST); + if (g_eli_pre_sync == NULL) + G_ELI_DEBUG(0, "Warning! Cannot register shutdown event."); +} + +static void +g_eli_fini(struct g_class *mp) +{ + + if (g_eli_pre_sync != NULL) + EVENTHANDLER_DEREGISTER(shutdown_pre_sync, g_eli_pre_sync); +} + DECLARE_GEOM_CLASS(g_eli_class, g_eli); MODULE_DEPEND(g_eli, crypto, 1, 1, 1); From owner-svn-src-head@FreeBSD.ORG Mon Mar 16 20:14:39 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 544F01065760; Mon, 16 Mar 2009 20:14:39 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id ED79A8FC13; Mon, 16 Mar 2009 20:14:38 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id n2GKAUai042257; Mon, 16 Mar 2009 14:10:31 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Tue, 17 Mar 2009 05:10:58 +0900 (JST) Message-Id: <20090317.051058.-2068218148.imp@bsdimp.com> To: ed@80386.nl From: "M. Warner Losh" In-Reply-To: <20090315150740.GZ31961@hoeg.nl> References: <200903151314.n2FDE6Zx029988@svn.freebsd.org> <20090315150740.GZ31961@hoeg.nl> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, gabor@freebsd.org Subject: Re: svn commit: r189850 - in head: . lib/libc/nls X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Mar 2009 20:14:40 -0000 In message: <20090315150740.GZ31961@hoeg.nl> Ed Schouten writes: : * Gabor Kovesdan wrote: : > - Create the buildworld object directories with mtree instead of various : > mkdir calls : > - Remove the ugly workaroung from libc NLS, which was to create some of : > these directories : : Thank you! I actually needed something similar for my FreeBSD+Clang : patchset. ;-) Thanks Gabor for following through with this! Warner From owner-svn-src-head@FreeBSD.ORG Mon Mar 16 23:56:29 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 357F21065673; Mon, 16 Mar 2009 23:56:29 +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 22FE28FC14; Mon, 16 Mar 2009 23:56:29 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2GNuT0b075558; Mon, 16 Mar 2009 23:56:29 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2GNuT7K075557; Mon, 16 Mar 2009 23:56:29 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200903162356.n2GNuT7K075557@svn.freebsd.org> From: Doug Barton Date: Mon, 16 Mar 2009 23:56: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: r189902 - head/contrib/wpa/wpa_supplicant X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Mar 2009 23:56:29 -0000 Author: dougb Date: Mon Mar 16 23:56:28 2009 New Revision: 189902 URL: http://svn.freebsd.org/changeset/base/189902 Log: Add some notes and clarify a few sections: 1. Add a note to double-check the man page 2. Remove windows-specific items in the ctrl_interface section 3. Add a note that ap_scan must be set to 1 for use with wlan 4. Clarify the wording for scan_ssid related to APs that hide ssid 5. Clarify the wording for the priority option Modified: head/contrib/wpa/wpa_supplicant/wpa_supplicant.conf Modified: head/contrib/wpa/wpa_supplicant/wpa_supplicant.conf ============================================================================== --- head/contrib/wpa/wpa_supplicant/wpa_supplicant.conf Mon Mar 16 23:08:38 2009 (r189901) +++ head/contrib/wpa/wpa_supplicant/wpa_supplicant.conf Mon Mar 16 23:56:28 2009 (r189902) @@ -1,5 +1,7 @@ ##### Example wpa_supplicant configuration file ############################### # +# ***** Please check wpa_supplicant.conf(5) for details on these options ***** +# # This file describes configuration file format and lists all available option. # Please also take a look at simpler configuration examples in 'examples' # subdirectory. @@ -59,19 +61,6 @@ # DIR=/var/run/wpa_supplicant GROUP=0 # (group can be either group name or gid) # -# For UDP connections (default on Windows): The value will be ignored. This -# variable is just used to select that the control interface is to be created. -# The value can be set to, e.g., udp (ctrl_interface=udp) -# -# For Windows Named Pipe: This value can be used to set the security descriptor -# for controlling access to the control interface. Security descriptor can be -# set using Security Descriptor String Format (see http://msdn.microsoft.com/ -# library/default.asp?url=/library/en-us/secauthz/security/ -# security_descriptor_string_format.asp). The descriptor string needs to be -# prefixed with SDDL=. For example, ctrl_interface=SDDL=D: would set an empty -# DACL (which will reject all connections). See README-Windows.txt for more -# information about SDDL string format. -# ctrl_interface=/var/run/wpa_supplicant # IEEE 802.1X/EAPOL version @@ -102,6 +91,8 @@ eapol_version=1 # the driver reports successful association; each network block should have # explicit security policy (i.e., only one option in the lists) for # key_mgmt, pairwise, group, proto variables +# +# For use in FreeBSD with the wlan module ap_scan must be set to 1. ap_scan=1 # EAP fast re-authentication @@ -221,7 +212,7 @@ fast_reauth=1 # scan_ssid: # 0 = do not scan this SSID with specific Probe Request frames (default) # 1 = scan with SSID-specific Probe Request frames (this can be used to -# find APs that do not accept broadcast SSID or use multiple SSIDs; +# find APs that hide (do not broadcast) SSID or use multiple SSIDs; # this will add latency to scanning, so enable this only when needed) # # bssid: BSSID (optional); if set, this network block is used only when @@ -237,7 +228,7 @@ fast_reauth=1 # policy, signal strength, etc. # Please note that AP scanning with scan_ssid=1 and ap_scan=2 mode are not # using this priority to select the order for scanning. Instead, they try the -# networks in the order that used in the configuration file. +# networks in the order that they are listed in the configuration file. # # mode: IEEE 802.11 operation mode # 0 = infrastructure (Managed) mode, i.e., associate with an AP (default) From owner-svn-src-head@FreeBSD.ORG Tue Mar 17 00:48:12 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA900106566C; Tue, 17 Mar 2009 00:48:12 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A511C8FC0C; Tue, 17 Mar 2009 00:48:12 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2H0mCQg076597; Tue, 17 Mar 2009 00:48:12 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2H0mCw4076588; Tue, 17 Mar 2009 00:48:12 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200903170048.n2H0mCw4076588@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 17 Mar 2009 00:48: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: r189903 - in head/sys: amd64/acpica amd64/amd64 amd64/include conf dev/acpica i386/i386 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: Tue, 17 Mar 2009 00:48:13 -0000 Author: jkim Date: Tue Mar 17 00:48:11 2009 New Revision: 189903 URL: http://svn.freebsd.org/changeset/base/189903 Log: Initial suspend/resume support for amd64. This code is heavily inspired by Takanori Watanabe's experimental SMP patch for i386 and large portion was shamelessly cut and pasted from Peter Wemm's AP boot code. Added: head/sys/amd64/acpica/Makefile (contents, props changed) head/sys/amd64/acpica/acpi_switch.S (contents, props changed) head/sys/amd64/acpica/acpi_wakecode.S (contents, props changed) head/sys/amd64/acpica/genwakecode.sh (contents, props changed) head/sys/amd64/acpica/genwakedata.sh (contents, props changed) Modified: head/sys/amd64/acpica/acpi_machdep.c head/sys/amd64/acpica/acpi_wakeup.c head/sys/amd64/amd64/amd64_mem.c head/sys/amd64/amd64/apic_vector.S head/sys/amd64/amd64/cpu_switch.S head/sys/amd64/amd64/db_trace.c head/sys/amd64/amd64/genassym.c head/sys/amd64/amd64/mp_machdep.c head/sys/amd64/include/apicvar.h head/sys/amd64/include/pcb.h head/sys/amd64/include/smp.h head/sys/conf/files.amd64 head/sys/dev/acpica/acpi.c head/sys/dev/acpica/acpi_ec.c head/sys/i386/i386/i686_mem.c head/sys/i386/i386/k6_mem.c head/sys/kern/subr_smp.c head/sys/sys/memrange.h head/sys/sys/smp.h Added: head/sys/amd64/acpica/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/amd64/acpica/Makefile Tue Mar 17 00:48:11 2009 (r189903) @@ -0,0 +1,33 @@ +# $FreeBSD$ + +# Correct path for kernel builds +# Don't rely on the kernel's .depend file +.ifdef MAKESRCPATH +.PATH: ${MAKESRCPATH} +DEPENDFILE= +.else +MAKESRCPATH= ${.CURDIR} +CLEANFILES= acpi_wakecode.h acpi_wakedata.h acpi_wakecode.bin acpi_wakecode.o +.endif +.if ${CC} == "icc" +CFLAGS+= -restrict +NOSTDINC= -X +.else +NOSTDINC= -nostdinc +.endif +CFLAGS+= ${NOSTDINC} -include opt_global.h -I. -I${MAKESRCPATH}/../.. + +all: acpi_wakecode.h acpi_wakedata.h + +acpi_wakecode.o: acpi_wakecode.S assym.s + +acpi_wakecode.bin: acpi_wakecode.o + objcopy -S -O binary acpi_wakecode.o acpi_wakecode.bin + +acpi_wakecode.h: acpi_wakecode.bin + sh ${MAKESRCPATH}/genwakecode.sh > acpi_wakecode.h + +acpi_wakedata.h: acpi_wakecode.bin + sh ${MAKESRCPATH}/genwakedata.sh > acpi_wakedata.h + +.include Modified: head/sys/amd64/acpica/acpi_machdep.c ============================================================================== --- head/sys/amd64/acpica/acpi_machdep.c Mon Mar 16 23:56:28 2009 (r189902) +++ head/sys/amd64/acpica/acpi_machdep.c Tue Mar 17 00:48:11 2009 (r189903) @@ -31,25 +31,50 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include +SYSCTL_DECL(_debug_acpi); + +uint32_t acpi_resume_beep; +TUNABLE_INT("debug.acpi.resume_beep", &acpi_resume_beep); +SYSCTL_UINT(_debug_acpi, OID_AUTO, resume_beep, CTLFLAG_RW, &acpi_resume_beep, + 0, "Beep the PC speaker when resuming"); +uint32_t acpi_reset_video; +TUNABLE_INT("hw.acpi.reset_video", &acpi_reset_video); + static int intr_model = ACPI_INTR_PIC; +static struct apm_clone_data acpi_clone; int acpi_machdep_init(device_t dev) { - struct acpi_softc *sc; + struct acpi_softc *sc; sc = devclass_get_softc(devclass_find("acpi"), 0); + + /* Create a fake clone for /dev/acpi. */ + STAILQ_INIT(&sc->apm_cdevs); + acpi_clone.cdev = sc->acpi_dev_t; + acpi_clone.acpi_sc = sc; + ACPI_LOCK(acpi); + STAILQ_INSERT_TAIL(&sc->apm_cdevs, &acpi_clone, entries); + ACPI_UNLOCK(acpi); + sc->acpi_clone = &acpi_clone; acpi_install_wakeup_handler(sc); if (intr_model != ACPI_INTR_PIC) acpi_SetIntrModel(intr_model); + SYSCTL_ADD_UINT(&sc->acpi_sysctl_ctx, + SYSCTL_CHILDREN(sc->acpi_sysctl_tree), OID_AUTO, + "reset_video", CTLFLAG_RW, &acpi_reset_video, 0, + "Call the VESA reset BIOS vector on the resume path"); + return (0); } Added: head/sys/amd64/acpica/acpi_switch.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/amd64/acpica/acpi_switch.S Tue Mar 17 00:48:11 2009 (r189903) @@ -0,0 +1,177 @@ +/*- + * Copyright (c) 2001 Takanori Watanabe + * Copyright (c) 2001 Mitsuru IWASAKI + * Copyright (c) 2008-2009 Jung-uk Kim + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include + +#include "acpi_wakedata.h" +#include "assym.s" + +#define WAKEUP_DECL(member) \ + .set WAKEUP_ ## member, wakeup_ ## member - wakeup_ctx + + WAKEUP_DECL(xpcb) + WAKEUP_DECL(gdt) + WAKEUP_DECL(efer) + WAKEUP_DECL(pat) + WAKEUP_DECL(star) + WAKEUP_DECL(lstar) + WAKEUP_DECL(cstar) + WAKEUP_DECL(sfmask) + WAKEUP_DECL(cpu) + +#define WAKEUP_CTX(member) WAKEUP_ ## member (%rdi) +#define WAKEUP_PCB(member) PCB_ ## member(%r11) +#define WAKEUP_XPCB(member) XPCB_ ## member(%r11) + +ENTRY(acpi_restorecpu) + /* Switch to KPML4phys. */ + movq %rsi, %rax + movq %rax, %cr3 + + /* Restore GDT. */ + lgdt WAKEUP_CTX(gdt) + jmp 1f +1: + + /* Fetch PCB. */ + movq WAKEUP_CTX(xpcb), %r11 + + /* Restore segment registers. */ + mov WAKEUP_PCB(DS), %ds + mov WAKEUP_PCB(ES), %es + mov WAKEUP_XPCB(SS), %ss + mov WAKEUP_PCB(FS), %fs + mov WAKEUP_PCB(GS), %gs + + movl $MSR_FSBASE, %ecx + movl WAKEUP_PCB(FSBASE), %eax + movl 4 + WAKEUP_PCB(FSBASE), %edx + wrmsr + movl $MSR_GSBASE, %ecx + movl WAKEUP_PCB(GSBASE), %eax + movl 4 + WAKEUP_PCB(GSBASE), %edx + wrmsr + movl $MSR_KGSBASE, %ecx + movl WAKEUP_XPCB(KGSBASE), %eax + movl 4 + WAKEUP_XPCB(KGSBASE), %edx + wrmsr + + /* Restore EFER. */ + movl $MSR_EFER, %ecx + movl WAKEUP_CTX(efer), %eax + wrmsr + + /* Restore PAT. */ + movl $MSR_PAT, %ecx + movl WAKEUP_CTX(pat), %eax + movl 4 + WAKEUP_CTX(pat), %edx + wrmsr + + /* Restore fast syscall stuff. */ + movl $MSR_STAR, %ecx + movl WAKEUP_CTX(star), %eax + movl 4 + WAKEUP_CTX(star), %edx + wrmsr + movl $MSR_LSTAR, %ecx + movl WAKEUP_CTX(lstar), %eax + movl 4 + WAKEUP_CTX(lstar), %edx + wrmsr + movl $MSR_CSTAR, %ecx + movl WAKEUP_CTX(cstar), %eax + movl 4 + WAKEUP_CTX(cstar), %edx + wrmsr + movl $MSR_SF_MASK, %ecx + movl WAKEUP_CTX(sfmask), %eax + wrmsr + + /* Restore CR0, CR2 and CR4. */ + movq WAKEUP_XPCB(CR0), %rax + movq %rax, %cr0 + movq WAKEUP_XPCB(CR2), %rax + movq %rax, %cr2 + movq WAKEUP_XPCB(CR4), %rax + movq %rax, %cr4 + + /* Restore descriptor tables. */ + lidt WAKEUP_XPCB(IDT) + lldt WAKEUP_XPCB(LDT) + movw WAKEUP_XPCB(TR), %ax + ltr %ax + + /* Restore other callee saved registers. */ + movq WAKEUP_PCB(R15), %r15 + movq WAKEUP_PCB(R14), %r14 + movq WAKEUP_PCB(R13), %r13 + movq WAKEUP_PCB(R12), %r12 + movq WAKEUP_PCB(RBP), %rbp + movq WAKEUP_PCB(RSP), %rsp + movq WAKEUP_PCB(RBX), %rbx + + /* Restore debug registers. */ + movq WAKEUP_PCB(DR0), %rax + movq %rax, %dr0 + movq WAKEUP_PCB(DR1), %rax + movq %rax, %dr1 + movq WAKEUP_PCB(DR2), %rax + movq %rax, %dr2 + movq WAKEUP_PCB(DR3), %rax + movq %rax, %dr3 + movq WAKEUP_PCB(DR6), %rax + movq %rax, %dr6 + movq WAKEUP_PCB(DR7), %rax + movq %rax, %dr7 + + /* Restore return address. */ + movq WAKEUP_PCB(RIP), %rax + movq %rax, (%rsp) + + /* Indicate the CPU is resumed. */ + xorl %eax, %eax + movl %eax, WAKEUP_CTX(cpu) + + ret +END(acpi_restorecpu) + +ENTRY(acpi_savecpu) + /* Fetch XPCB and save CPU context. */ + movq %rdi, %r10 + call savectx2 + movq %r10, %r11 + + /* Patch caller's return address and stack pointer. */ + movq (%rsp), %rax + movq %rax, WAKEUP_PCB(RIP) + movq %rsp, %rax + movq %rax, WAKEUP_PCB(RSP) + + movl $1, %eax + ret +END(acpi_savecpu) Added: head/sys/amd64/acpica/acpi_wakecode.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/amd64/acpica/acpi_wakecode.S Tue Mar 17 00:48:11 2009 (r189903) @@ -0,0 +1,278 @@ +/*- + * Copyright (c) 2001 Takanori Watanabe + * Copyright (c) 2001 Mitsuru IWASAKI + * Copyright (c) 2003 Peter Wemm + * Copyright (c) 2008 Jung-uk Kim + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#define LOCORE + +#include +#include + +#include "assym.s" + +/* + * Resume entry point for real mode. + * + * If XFirmwareWakingVector is zero and FirmwareWakingVector is non-zero + * in FACS, the BIOS enters here in real mode after POST with CS set to + * (FirmwareWakingVector >> 4) and IP set to (FirmwareWakingVector & 0xf). + * Depending on the previous sleep state, we may need to initialize more + * of the system (i.e., S3 suspend-to-RAM vs. S4 suspend-to-disk). + * + * Note: If XFirmwareWakingVector is non-zero, it should disable address + * translation/paging and interrupts, load all segment registers with + * a flat 4 GB address space, and set EFLAGS.IF to zero. Currently + * this mode is not supported by this code. + */ + + .data /* So we can modify it */ + + ALIGN_TEXT +wakeup_start: + .code16 + /* + * Set up segment registers for real mode, a small stack for + * any calls we make, and clear any flags. + */ + cli /* make sure no interrupts */ + cld + mov %cs, %ax /* copy %cs to %ds. Remember these */ + mov %ax, %ds /* are offsets rather than selectors */ + mov %ax, %ss + movw $PAGE_SIZE - 8, %sp + pushw $0 + popfw + + /* To debug resume hangs, beep the speaker if the user requested. */ + cmpw $0, resume_beep - wakeup_start + je 1f + movb $0xc0, %al + outb %al, $0x42 + movb $0x04, %al + outb %al, $0x42 + inb $0x61, %al + orb $0x3, %al + outb %al, $0x61 + movw $0, resume_beep - wakeup_start +1: + + /* Re-initialize video BIOS if the reset_video tunable is set. */ + cmpw $0, reset_video - wakeup_start + je 1f + lcall $0xc000, $3 + movw $0, reset_video - wakeup_start + + /* + * Set up segment registers for real mode again in case the + * previous BIOS call clobbers them. + */ + mov %cs, %ax + mov %ax, %ds + mov %ax, %ss +1: + + /* + * Find relocation base and patch the gdt descript and ljmp targets + */ + xorl %ebx, %ebx + mov %cs, %bx + sall $4, %ebx /* %ebx is now our relocation base */ + + /* + * Load the descriptor table pointer. We'll need it when running + * in 16-bit protected mode. + */ + lgdtl bootgdtdesc - wakeup_start + + /* Enable protected mode */ + movl $CR0_PE, %eax + mov %eax, %cr0 + + /* + * Now execute a far jump to turn on protected mode. This + * causes the segment registers to turn into selectors and causes + * %cs to be loaded from the gdt. + * + * The following instruction is: + * ljmpl $bootcode32 - bootgdt, $wakeup_32 - wakeup_start + * but gas cannot assemble that. And besides, we patch the targets + * in early startup and its a little clearer what we are patching. + */ +wakeup_sw32: + .byte 0x66 /* size override to 32 bits */ + .byte 0xea /* opcode for far jump */ + .long wakeup_32 - wakeup_start /* offset in segment */ + .word bootcode32 - bootgdt /* index in gdt for 32 bit code */ + + /* + * At this point, we are running in 32 bit legacy protected mode. + */ + .code32 +wakeup_32: + + mov $bootdata32 - bootgdt, %eax + mov %ax, %ds + + /* Turn on the PAE and PSE bits for when paging is enabled */ + mov %cr4, %eax + orl $(CR4_PAE | CR4_PSE), %eax + mov %eax, %cr4 + + /* + * Enable EFER.LME so that we get long mode when all the prereqs are + * in place. In this case, it turns on when CR0_PG is finally enabled. + * Pick up a few other EFER bits that we'll use need we're here. + */ + movl $MSR_EFER, %ecx + rdmsr + orl $EFER_LME | EFER_SCE, %eax + wrmsr + + /* + * Point to the embedded page tables for startup. Note that this + * only gets accessed after we're actually in 64 bit mode, however + * we can only set the bottom 32 bits of %cr3 in this state. This + * means we are required to use a temporary page table that is below + * the 4GB limit. %ebx is still our relocation base. We could just + * subtract 3 * PAGE_SIZE, but that would be too easy. + */ + leal wakeup_pagetables - wakeup_start(%ebx), %eax + movl (%eax), %eax + mov %eax, %cr3 + + /* + * Finally, switch to long bit mode by enabling paging. We have + * to be very careful here because all the segmentation disappears + * out from underneath us. The spec says we can depend on the + * subsequent pipelined branch to execute, but *only if* everthing + * is still identity mapped. If any mappings change, the pipeline + * will flush. + */ + mov %cr0, %eax + orl $CR0_PG, %eax + mov %eax, %cr0 + + /* + * At this point paging is enabled, and we are in "compatability" mode. + * We do another far jump to reload %cs with the 64 bit selector. + * %cr3 points to a 4-level page table page. + * We cannot yet jump all the way to the kernel because we can only + * specify a 32 bit linear address. So, yet another trampoline. + * + * The following instruction is: + * ljmp $bootcode64 - bootgdt, $wakeup_64 - wakeup_start + * but gas cannot assemble that. And besides, we patch the targets + * in early startup and its a little clearer what we are patching. + */ +wakeup_sw64: + .byte 0xea /* opcode for far jump */ + .long wakeup_64 - wakeup_start /* offset in segment */ + .word bootcode64 - bootgdt /* index in gdt for 64 bit code */ + + /* + * Yeehar! We're running in 64-bit mode! We can mostly ignore our + * segment registers, and get on with it. + * Note that we are running at the correct virtual address, but with + * a 1:1 1GB mirrored mapping over entire address space. We had better + * switch to a real %cr3 promptly so that we can get to the direct map + * space. Remember that jmp is relative and that we've been relocated, + * so use an indirect jump. + */ + .code64 +wakeup_64: + mov $bootdata64 - bootgdt, %eax + mov %ax, %ds + + /* Restore arguments and return. */ + movq wakeup_ctx - wakeup_start(%rbx), %rdi + movq wakeup_kpml4 - wakeup_start(%rbx), %rsi + movq wakeup_retaddr - wakeup_start(%rbx), %rax + jmp *%rax + + ALIGN_DATA +bootgdt: + .long 0x00000000 + .long 0x00000000 + +bootcode64: + .long 0x0000ffff + .long 0x00af9b00 + +bootdata64: + .long 0x0000ffff + .long 0x00af9300 + +bootcode32: + .long 0x0000ffff + .long 0x00cf9b00 + +bootdata32: + .long 0x0000ffff + .long 0x00cf9300 +bootgdtend: + +wakeup_pagetables: + .long 0 + +bootgdtdesc: + .word bootgdtend - bootgdt /* Length */ + .long bootgdt - wakeup_start /* Offset plus %ds << 4 */ + + ALIGN_DATA +resume_beep: + .long 0 +reset_video: + .long 0 +wakeup_retaddr: + .quad 0 +wakeup_kpml4: + .quad 0 + +wakeup_ctx: + .quad 0 +wakeup_xpcb: + .quad 0 +wakeup_gdt: + .word 0 + .quad 0 +wakeup_efer: + .quad 0 +wakeup_pat: + .quad 0 +wakeup_star: + .quad 0 +wakeup_lstar: + .quad 0 +wakeup_cstar: + .quad 0 +wakeup_sfmask: + .quad 0 +wakeup_cpu: + .long 0 +dummy: Modified: head/sys/amd64/acpica/acpi_wakeup.c ============================================================================== --- head/sys/amd64/acpica/acpi_wakeup.c Mon Mar 16 23:56:28 2009 (r189902) +++ head/sys/amd64/acpica/acpi_wakeup.c Tue Mar 17 00:48:11 2009 (r189903) @@ -1,6 +1,8 @@ /*- * Copyright (c) 2001 Takanori Watanabe * Copyright (c) 2001 Mitsuru IWASAKI + * Copyright (c) 2003 Peter Wemm + * Copyright (c) 2008-2009 Jung-uk Kim * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -29,18 +31,411 @@ __FBSDID("$FreeBSD$"); #include +#include #include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include + +#ifdef SMP +#include +#include +#endif #include #include +#include "acpi_wakecode.h" +#include "acpi_wakedata.h" + +/* Make sure the code is less than a page and leave room for the stack. */ +CTASSERT(sizeof(wakecode) < PAGE_SIZE - 1024); + +#ifndef _SYS_CDEFS_H_ +#error this file needs sys/cdefs.h as a prerequisite +#endif + +extern uint32_t acpi_resume_beep; +extern uint32_t acpi_reset_video; + +#ifdef SMP +extern struct xpcb *stopxpcbs; +#else +static struct xpcb *stopxpcbs; +#endif + +int acpi_restorecpu(struct xpcb *, vm_offset_t); +int acpi_savecpu(struct xpcb *); + +static void acpi_reset_tss(int cpu); +static void acpi_alloc_wakeup_handler(void); +static void acpi_stop_beep(void *); + +#ifdef SMP +static int acpi_wakeup_ap(struct acpi_softc *, int); +static void acpi_wakeup_cpus(struct acpi_softc *, cpumask_t); +#endif + +#define WAKECODE_VADDR(sc) ((sc)->acpi_wakeaddr + (3 * PAGE_SIZE)) +#define WAKECODE_PADDR(sc) ((sc)->acpi_wakephys + (3 * PAGE_SIZE)) +#define WAKECODE_FIXUP(offset, type, val) do { \ + type *addr; \ + addr = (type *)(WAKECODE_VADDR(sc) + offset); \ + *addr = val; \ +} while (0) + +/* Turn off bits 1&2 of the PIT, stopping the beep. */ +static void +acpi_stop_beep(void *arg) +{ + outb(0x61, inb(0x61) & ~0x3); +} + +#ifdef SMP +static int +acpi_wakeup_ap(struct acpi_softc *sc, int cpu) +{ + int vector = (WAKECODE_PADDR(sc) >> 12) & 0xff; + int apic_id = cpu_apic_ids[cpu]; + int ms; + + WAKECODE_FIXUP(wakeup_xpcb, struct xpcb *, &stopxpcbs[cpu]); + WAKECODE_FIXUP(wakeup_gdt, uint16_t, stopxpcbs[cpu].xpcb_gdt.rd_limit); + WAKECODE_FIXUP(wakeup_gdt + 2, uint64_t, + stopxpcbs[cpu].xpcb_gdt.rd_base); + WAKECODE_FIXUP(wakeup_cpu, int, cpu); + + acpi_reset_tss(cpu); + + /* do an INIT IPI: assert RESET */ + lapic_ipi_raw(APIC_DEST_DESTFLD | APIC_TRIGMOD_EDGE | + APIC_LEVEL_ASSERT | APIC_DESTMODE_PHY | APIC_DELMODE_INIT, apic_id); + + /* wait for pending status end */ + lapic_ipi_wait(-1); + + /* do an INIT IPI: deassert RESET */ + lapic_ipi_raw(APIC_DEST_ALLESELF | APIC_TRIGMOD_LEVEL | + APIC_LEVEL_DEASSERT | APIC_DESTMODE_PHY | APIC_DELMODE_INIT, 0); + + /* wait for pending status end */ + DELAY(10000); /* wait ~10mS */ + lapic_ipi_wait(-1); + + /* + * next we do a STARTUP IPI: the previous INIT IPI might still be + * latched, (P5 bug) this 1st STARTUP would then terminate + * immediately, and the previously started INIT IPI would continue. OR + * the previous INIT IPI has already run. and this STARTUP IPI will + * run. OR the previous INIT IPI was ignored. and this STARTUP IPI + * will run. + */ + + /* do a STARTUP IPI */ + lapic_ipi_raw(APIC_DEST_DESTFLD | APIC_TRIGMOD_EDGE | + APIC_LEVEL_DEASSERT | APIC_DESTMODE_PHY | APIC_DELMODE_STARTUP | + vector, apic_id); + lapic_ipi_wait(-1); + DELAY(200); /* wait ~200uS */ + + /* + * finally we do a 2nd STARTUP IPI: this 2nd STARTUP IPI should run IF + * the previous STARTUP IPI was cancelled by a latched INIT IPI. OR + * this STARTUP IPI will be ignored, as only ONE STARTUP IPI is + * recognized after hardware RESET or INIT IPI. + */ + + lapic_ipi_raw(APIC_DEST_DESTFLD | APIC_TRIGMOD_EDGE | + APIC_LEVEL_DEASSERT | APIC_DESTMODE_PHY | APIC_DELMODE_STARTUP | + vector, apic_id); + lapic_ipi_wait(-1); + DELAY(200); /* wait ~200uS */ + + /* Wait up to 5 seconds for it to start. */ + for (ms = 0; ms < 5000; ms++) { + if (*(int *)(WAKECODE_VADDR(sc) + wakeup_cpu) == 0) + return (1); /* return SUCCESS */ + DELAY(1000); + } + return (0); /* return FAILURE */ +} + +#define WARMBOOT_TARGET 0 +#define WARMBOOT_OFF (KERNBASE + 0x0467) +#define WARMBOOT_SEG (KERNBASE + 0x0469) + +#define CMOS_REG (0x70) +#define CMOS_DATA (0x71) +#define BIOS_RESET (0x0f) +#define BIOS_WARM (0x0a) + +static void +acpi_wakeup_cpus(struct acpi_softc *sc, cpumask_t wakeup_cpus) +{ + uint32_t mpbioswarmvec; + cpumask_t map; + int cpu; + u_char mpbiosreason; + + /* save the current value of the warm-start vector */ + mpbioswarmvec = *((uint32_t *)WARMBOOT_OFF); + outb(CMOS_REG, BIOS_RESET); + mpbiosreason = inb(CMOS_DATA); + + /* setup a vector to our boot code */ + *((volatile u_short *)WARMBOOT_OFF) = WARMBOOT_TARGET; + *((volatile u_short *)WARMBOOT_SEG) = WAKECODE_PADDR(sc) >> 4; + outb(CMOS_REG, BIOS_RESET); + outb(CMOS_DATA, BIOS_WARM); /* 'warm-start' */ + + /* Wake up each AP. */ + for (cpu = 1; cpu < mp_ncpus; cpu++) { + map = 1ul << cpu; + if ((wakeup_cpus & map) != map) + continue; + if (acpi_wakeup_ap(sc, cpu) == 0) { + /* restore the warmstart vector */ + *(uint32_t *)WARMBOOT_OFF = mpbioswarmvec; + panic("acpi_wakeup: failed to resume AP #%d (PHY #%d)", + cpu, cpu_apic_ids[cpu]); + } + } + + /* restore the warmstart vector */ + *(uint32_t *)WARMBOOT_OFF = mpbioswarmvec; + + outb(CMOS_REG, BIOS_RESET); + outb(CMOS_DATA, mpbiosreason); +} +#endif + +static void +acpi_reset_tss(int cpu) +{ + uint32_t *tss; + + /* + * We have to clear "task busy" bit in TSS to restore + * task register later. Otherwise, ltr causes GPF. + */ + tss = (uint32_t *)&gdt[NGDT * cpu + GPROC0_SEL] + 1; + *tss &= ~((SDT_SYSBSY ^ SDT_SYSTSS) << 8); +} + int acpi_sleep_machdep(struct acpi_softc *sc, int state) { - return (0); + struct savefpu *stopfpu; +#ifdef SMP + cpumask_t wakeup_cpus; +#endif + register_t cr3, rf; + ACPI_STATUS status; + int ret; + + ret = -1; + + if (sc->acpi_wakeaddr == 0ul) + return (ret); + +#ifdef SMP + wakeup_cpus = PCPU_GET(other_cpus); +#endif + + AcpiSetFirmwareWakingVector(WAKECODE_PADDR(sc)); + + rf = intr_disable(); + intr_suspend(); + + /* + * Temporarily switch to the kernel pmap because it provides + * an identity mapping (setup at boot) for the low physical + * memory region containing the wakeup code. + */ + cr3 = rcr3(); + load_cr3(KPML4phys); + + stopfpu = &stopxpcbs[0].xpcb_pcb.pcb_save; + if (acpi_savecpu(&stopxpcbs[0])) { + fpugetregs(curthread, stopfpu); + +#ifdef SMP + if (wakeup_cpus != 0 && suspend_cpus(wakeup_cpus) == 0) { + device_printf(sc->acpi_dev, + "Failed to suspend APs: CPU mask = 0x%jx\n", + (uintmax_t)(wakeup_cpus & ~stopped_cpus)); + goto out; + } +#endif + + WAKECODE_FIXUP(resume_beep, uint32_t, acpi_resume_beep); + WAKECODE_FIXUP(reset_video, uint32_t, acpi_reset_video); + + WAKECODE_FIXUP(wakeup_xpcb, struct xpcb *, &stopxpcbs[0]); + WAKECODE_FIXUP(wakeup_gdt, uint16_t, + stopxpcbs[0].xpcb_gdt.rd_limit); + WAKECODE_FIXUP(wakeup_gdt + 2, uint64_t, + stopxpcbs[0].xpcb_gdt.rd_base); + WAKECODE_FIXUP(wakeup_cpu, int, 0); + + acpi_reset_tss(0); + + /* Call ACPICA to enter the desired sleep state */ + if (state == ACPI_STATE_S4 && sc->acpi_s4bios) + status = AcpiEnterSleepStateS4bios(); + else + status = AcpiEnterSleepState(state); + + if (status != AE_OK) { + device_printf(sc->acpi_dev, + "AcpiEnterSleepState failed - %s\n", + AcpiFormatException(status)); + goto out; + } + + for (;;) + ia32_pause(); + } else { + fpusetregs(curthread, stopfpu); + + WAKECODE_FIXUP(resume_beep, uint32_t, 0); + WAKECODE_FIXUP(reset_video, uint32_t, 0); +#ifdef SMP + if (wakeup_cpus != 0) + acpi_wakeup_cpus(sc, wakeup_cpus); +#endif + ret = 0; + } + +out: +#ifdef SMP + if (wakeup_cpus != 0) + restart_cpus(wakeup_cpus); +#endif + + load_cr3(cr3); + intr_resume(); + intr_restore(rf); + + AcpiSetFirmwareWakingVector(0); + + if (ret == 0 && mem_range_softc.mr_op != NULL && + mem_range_softc.mr_op->reinit != NULL) + mem_range_softc.mr_op->reinit(&mem_range_softc); + + /* If we beeped, turn it off after a delay. */ + if (acpi_resume_beep) + timeout(acpi_stop_beep, NULL, 3 * hz); + + return (ret); +} + +static vm_offset_t acpi_wakeaddr; + +static void +acpi_alloc_wakeup_handler(void) +{ + void *wakeaddr; + + if (!cold) + return; + + /* + * Specify the region for our wakeup code. We want it in the low 1 MB + * region, excluding video memory and above (0xa0000). We ask for + * it to be page-aligned, just to be safe. + */ + wakeaddr = contigmalloc(4 * PAGE_SIZE, M_DEVBUF, M_NOWAIT, 0, 0x9ffff, + PAGE_SIZE, 0ul); + if (wakeaddr == NULL) { + printf("%s: can't alloc wake memory\n", __func__); + return; + } + stopxpcbs = malloc(mp_ncpus * sizeof(*stopxpcbs), M_DEVBUF, M_NOWAIT); + if (stopxpcbs == NULL) { + contigfree(wakeaddr, 4 * PAGE_SIZE, M_DEVBUF); + printf("%s: can't alloc CPU state memory\n", __func__); + return; + } + acpi_wakeaddr = (vm_offset_t)wakeaddr; } +SYSINIT(acpiwakeup, SI_SUB_KMEM, SI_ORDER_ANY, acpi_alloc_wakeup_handler, 0); + void acpi_install_wakeup_handler(struct acpi_softc *sc) { + uint64_t *pt4, *pt3, *pt2; + int i; + + if (acpi_wakeaddr == 0ul) + return; + + sc->acpi_wakeaddr = acpi_wakeaddr; + sc->acpi_wakephys = vtophys(acpi_wakeaddr); + + bcopy(wakecode, (void *)WAKECODE_VADDR(sc), sizeof(wakecode)); + + /* Patch GDT base address, ljmp targets and page table base address. */ + WAKECODE_FIXUP((bootgdtdesc + 2), uint32_t, + WAKECODE_PADDR(sc) + bootgdt); + WAKECODE_FIXUP((wakeup_sw32 + 2), uint32_t, + WAKECODE_PADDR(sc) + wakeup_32); + WAKECODE_FIXUP((wakeup_sw64 + 1), uint32_t, + WAKECODE_PADDR(sc) + wakeup_64); + WAKECODE_FIXUP(wakeup_pagetables, uint32_t, sc->acpi_wakephys); + + /* Save pointers to some global data. */ + WAKECODE_FIXUP(wakeup_retaddr, void *, acpi_restorecpu); + WAKECODE_FIXUP(wakeup_kpml4, uint64_t, KPML4phys); + WAKECODE_FIXUP(wakeup_ctx, vm_offset_t, + WAKECODE_VADDR(sc) + wakeup_ctx); + WAKECODE_FIXUP(wakeup_efer, uint64_t, rdmsr(MSR_EFER)); + WAKECODE_FIXUP(wakeup_pat, uint64_t, rdmsr(MSR_PAT)); + WAKECODE_FIXUP(wakeup_star, uint64_t, rdmsr(MSR_STAR)); + WAKECODE_FIXUP(wakeup_lstar, uint64_t, rdmsr(MSR_LSTAR)); + WAKECODE_FIXUP(wakeup_cstar, uint64_t, rdmsr(MSR_CSTAR)); + WAKECODE_FIXUP(wakeup_sfmask, uint64_t, rdmsr(MSR_SF_MASK)); + + /* Build temporary page tables below realmode code. */ + pt4 = (uint64_t *)acpi_wakeaddr; + pt3 = pt4 + (PAGE_SIZE) / sizeof(uint64_t); + pt2 = pt3 + (PAGE_SIZE) / sizeof(uint64_t); + + /* Create the initial 1GB replicated page tables */ + for (i = 0; i < 512; i++) { + /* + * Each slot of the level 4 pages points + * to the same level 3 page + */ + pt4[i] = (uint64_t)(sc->acpi_wakephys + PAGE_SIZE); + pt4[i] |= PG_V | PG_RW | PG_U; + + /* + * Each slot of the level 3 pages points + * to the same level 2 page + */ + pt3[i] = (uint64_t)(sc->acpi_wakephys + (2 * PAGE_SIZE)); + pt3[i] |= PG_V | PG_RW | PG_U; + + /* The level 2 page slots are mapped with 2MB pages for 1GB. */ + pt2[i] = i * (2 * 1024 * 1024); + pt2[i] |= PG_V | PG_RW | PG_PS | PG_U; + } + + if (bootverbose) + device_printf(sc->acpi_dev, "wakeup code va %p pa %p\n", + (void *)sc->acpi_wakeaddr, (void *)sc->acpi_wakephys); } Added: head/sys/amd64/acpica/genwakecode.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/amd64/acpica/genwakecode.sh Tue Mar 17 00:48:11 2009 (r189903) @@ -0,0 +1,6 @@ +#!/bin/sh +# $FreeBSD$ +# +file2c 'static char wakecode[] = {' '};' Delivered-To: svn-src-head@FreeBSD.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 81780106564A; Tue, 17 Mar 2009 01:03:59 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: src-committers@FreeBSD.org Date: Mon, 16 Mar 2009 21:03:46 -0400 User-Agent: KMail/1.6.2 References: <200903170048.n2H0mCw4076588@svn.freebsd.org> In-Reply-To: <200903170048.n2H0mCw4076588@svn.freebsd.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200903162103.52835.jkim@FreeBSD.org> Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org Subject: Re: svn commit: r189903 - in head/sys: amd64/acpica amd64/amd64 amd64/include conf dev/acpica i386/i386 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: Tue, 17 Mar 2009 01:04:00 -0000 On Monday 16 March 2009 08:48 pm, Jung-uk Kim wrote: > Author: jkim > Date: Tue Mar 17 00:48:11 2009 > New Revision: 189903 > URL: http://svn.freebsd.org/changeset/base/189903 > > Log: > Initial suspend/resume support for amd64. > > This code is heavily inspired by Takanori Watanabe's experimental > SMP patch for i386 and large portion was shamelessly cut and pasted > from Peter Wemm's AP boot code. Older revision was: Reviewed by: jhb, mav Tested by: mav Jung-uk Kim From owner-svn-src-head@FreeBSD.ORG Tue Mar 17 01:38:51 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 80610106566C; Tue, 17 Mar 2009 01:38:51 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6DD058FC19; Tue, 17 Mar 2009 01:38:51 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2H1cpj0077510; Tue, 17 Mar 2009 01:38:51 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2H1cp0r077509; Tue, 17 Mar 2009 01:38:51 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200903170138.n2H1cp0r077509@svn.freebsd.org> From: Andrew Thompson Date: Tue, 17 Mar 2009 01:38: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: r189904 - 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: Tue, 17 Mar 2009 01:38:52 -0000 Author: thompsa Date: Tue Mar 17 01:38:51 2009 New Revision: 189904 URL: http://svn.freebsd.org/changeset/base/189904 Log: Add Supertop IDE adapter and Quickcam entries. Modified: head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Tue Mar 17 00:48:11 2009 (r189903) +++ head/sys/dev/usb/usbdevs Tue Mar 17 01:38:51 2009 (r189904) @@ -593,6 +593,7 @@ vendor SILICOM 0x1485 Silicom vendor RALINK 0x148f Ralink Technology vendor IMAGINATION 0x149a Imagination Technologies vendor CONCEPTRONIC2 0x14b2 Conceptronic +vendor SUPERTOP 0x14cd Super Top vendor PLANEX3 0x14ea Planex Communications vendor SILICONPORTALS 0x1527 Silicon Portals vendor UBIQUAM 0x1529 UBIQUAM Co., Ltd. @@ -1632,6 +1633,7 @@ product LOGITECH QUICKCAMWEB 0x0801 Quic product LOGITECH QUICKCAMPRO 0x0810 QuickCam Pro product LOGITECH QUICKCAMEXP 0x0840 QuickCam Express product LOGITECH QUICKCAM 0x0850 QuickCam +product LOGITECH QUICKCAMPRO3 0x0990 QuickCam Pro 9000 product LOGITECH N43 0xc000 N43 product LOGITECH N48 0xc001 N48 mouse product LOGITECH MBA47 0xc002 M-BA47 mouse @@ -2312,6 +2314,9 @@ product SUN KEYBOARD 0x0005 Type 6 USB /* XXX The above is a North American PC style keyboard possibly */ product SUN MOUSE 0x0100 Type 6 USB mouse +/* Super Top products */ +product SUPERTOP IDE 0x6600 USB-IDE + /* Supra products */ product DIAMOND2 SUPRAEXPRESS56K 0x07da Supra Express 56K modem product DIAMOND2 SUPRA2890 0x0b4a SupraMax 2890 56K Modem From owner-svn-src-head@FreeBSD.ORG Tue Mar 17 01:42:49 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 404F1106566B; Tue, 17 Mar 2009 01:42:47 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2E3898FC08; Tue, 17 Mar 2009 01:42:47 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2H1gl2K077614; Tue, 17 Mar 2009 01:42:47 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2H1glBO077613; Tue, 17 Mar 2009 01:42:47 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200903170142.n2H1glBO077613@svn.freebsd.org> From: Andrew Thompson Date: Tue, 17 Mar 2009 01:42: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: r189905 - 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: Tue, 17 Mar 2009 01:42:49 -0000 Author: thompsa Date: Tue Mar 17 01:42:46 2009 New Revision: 189905 URL: http://svn.freebsd.org/changeset/base/189905 Log: MFp4 //depot/projects/usb 159238,159275 Add umass quirks. Submitted by: Michael Gmelin Modified: head/sys/dev/usb/storage/umass.c Modified: head/sys/dev/usb/storage/umass.c ============================================================================== --- head/sys/dev/usb/storage/umass.c Tue Mar 17 01:38:51 2009 (r189904) +++ head/sys/dev/usb/storage/umass.c Tue Mar 17 01:42:46 2009 (r189905) @@ -609,7 +609,7 @@ static const struct umass_devdescr umass }, {USB_VENDOR_MYSON, USB_PRODUCT_MYSON_HEDEN, RID_WILDCARD, UMASS_PROTO_SCSI | UMASS_PROTO_BBB, - NO_INQUIRY | IGNORE_RESIDUE + NO_INQUIRY | IGNORE_RESIDUE | NO_SYNCHRONIZE_CACHE }, {USB_VENDOR_MYSON, USB_PRODUCT_MYSON_STARREADER, RID_WILDCARD, UMASS_PROTO_SCSI | UMASS_PROTO_BBB, @@ -847,6 +847,10 @@ static const struct umass_devdescr umass UMASS_PROTO_SCSI | UMASS_PROTO_BBB, NO_QUIRKS }, + {USB_VENDOR_SUPERTOP, USB_PRODUCT_SUPERTOP_IDE, RID_WILDCARD, + UMASS_PROTO_SCSI | UMASS_PROTO_BBB, + IGNORE_RESIDUE | NO_SYNCHRONIZE_CACHE + }, {USB_VENDOR_TAUGA, USB_PRODUCT_TAUGA_CAMERAMATE, RID_WILDCARD, UMASS_PROTO_SCSI, NO_QUIRKS @@ -2022,7 +2026,7 @@ umass_t_bbb_status_callback(struct usb2_ residue = UGETDW(sc->csw.dCSWDataResidue); - if (!residue) { + if ((!residue) || (sc->sc_quirks & IGNORE_RESIDUE)) { residue = (sc->sc_transfer.data_len - sc->sc_transfer.actlen); } From owner-svn-src-head@FreeBSD.ORG Tue Mar 17 01:46:40 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DDA2A1065670; Tue, 17 Mar 2009 01:46:40 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CAD2C8FC21; Tue, 17 Mar 2009 01:46:40 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2H1ke5v077739; Tue, 17 Mar 2009 01:46:40 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2H1ketd077734; Tue, 17 Mar 2009 01:46:40 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200903170146.n2H1ketd077734@svn.freebsd.org> From: Andrew Thompson Date: Tue, 17 Mar 2009 01:46: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: r189906 - in head/sys/dev/usb: . image 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: Tue, 17 Mar 2009 01:46:41 -0000 Author: thompsa Date: Tue Mar 17 01:46:40 2009 New Revision: 189906 URL: http://svn.freebsd.org/changeset/base/189906 Log: MFp4 //depot/projects/usb 159225,159241,159292 Fix regression issue in the USB file system interface. - Use cdev_privdata pointer as indicator of correct file handle. - Remove redundant FIFO opened flags. Don't send ZLP at close for ulpt and uscanner devices as this causes some models to stop working. This reverts back to the USB1 behaviour. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/image/uscanner.c head/sys/dev/usb/serial/ulpt.c head/sys/dev/usb/usb_dev.c head/sys/dev/usb/usb_dev.h head/sys/dev/usb/usb_device.h Modified: head/sys/dev/usb/image/uscanner.c ============================================================================== --- head/sys/dev/usb/image/uscanner.c Tue Mar 17 01:42:46 2009 (r189905) +++ head/sys/dev/usb/image/uscanner.c Tue Mar 17 01:46:40 2009 (r189906) @@ -149,7 +149,7 @@ static const struct usb2_config uscanner .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, .mh.bufsize = USCANNER_BSIZE, - .mh.flags = {.pipe_bof = 1,.force_short_xfer = 1,.proxy_buffer = 1,.force_short_xfer = 1,}, + .mh.flags = {.pipe_bof = 1,.proxy_buffer = 1,}, .mh.callback = &uscanner_write_callback, }, Modified: head/sys/dev/usb/serial/ulpt.c ============================================================================== --- head/sys/dev/usb/serial/ulpt.c Tue Mar 17 01:42:46 2009 (r189905) +++ head/sys/dev/usb/serial/ulpt.c Tue Mar 17 01:46:40 2009 (r189906) @@ -200,7 +200,8 @@ ulpt_write_callback(struct usb2_xfer *xf DPRINTF("no FIFO\n"); return; } - DPRINTF("state=0x%x\n", USB_GET_STATE(xfer)); + DPRINTF("state=0x%x actlen=%u\n", + USB_GET_STATE(xfer), xfer->actlen); switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: @@ -208,7 +209,6 @@ ulpt_write_callback(struct usb2_xfer *xf tr_setup: if (usb2_fifo_get_data(f, xfer->frbuffers, 0, xfer->max_data_length, &actlen, 0)) { - xfer->frlengths[0] = actlen; usb2_start_hardware(xfer); } @@ -339,7 +339,7 @@ static const struct usb2_config ulpt_con .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, .mh.bufsize = ULPT_BSIZE, - .mh.flags = {.pipe_bof = 1,.force_short_xfer = 1,.proxy_buffer = 1}, + .mh.flags = {.pipe_bof = 1,.proxy_buffer = 1}, .mh.callback = &ulpt_write_callback, }, Modified: head/sys/dev/usb/usb_dev.c ============================================================================== --- head/sys/dev/usb/usb_dev.c Tue Mar 17 01:42:46 2009 (r189905) +++ head/sys/dev/usb/usb_dev.c Tue Mar 17 01:46:40 2009 (r189906) @@ -72,7 +72,8 @@ SYSCTL_INT(_hw_usb2_dev, OID_AUTO, debug /* prototypes */ -static int usb2_fifo_open(struct usb2_fifo *, int); +static int usb2_fifo_open(struct usb2_cdev_privdata *, + struct usb2_fifo *, int); static void usb2_fifo_close(struct usb2_fifo *, int); static void usb2_dev_init(void *); static void usb2_dev_init_post(void *); @@ -160,7 +161,6 @@ usb2_ref_device(struct usb2_cdev_privdat { struct usb2_fifo **ppf; struct usb2_fifo *f; - int dev_ep_index; DPRINTFN(2, "usb2_ref_device, cpd=%p need uref=%d\n", cpd, need_uref); @@ -180,7 +180,6 @@ usb2_ref_device(struct usb2_cdev_privdat goto error; } /* check if we are doing an open */ - dev_ep_index = cpd->ep_addr; if (cpd->fflags == 0) { /* set defaults */ cpd->txfifo = NULL; @@ -200,15 +199,12 @@ usb2_ref_device(struct usb2_cdev_privdat cpd->is_write = 1; /* ref */ if (f == NULL || f->refcount == USB_FIFO_REF_MAX) goto error; + if (f->curr_cpd != cpd) + goto error; /* check if USB-FS is active */ if (f->fs_ep_max != 0) { cpd->is_usbfs = 1; } - /* - * Get real endpoint index associated with - * this FIFO: - */ - dev_ep_index = f->dev_ep_index; } else { cpd->txfifo = NULL; cpd->is_write = 0; /* no ref */ @@ -222,15 +218,12 @@ usb2_ref_device(struct usb2_cdev_privdat cpd->is_read = 1; /* ref */ if (f == NULL || f->refcount == USB_FIFO_REF_MAX) goto error; + if (f->curr_cpd != cpd) + goto error; /* check if USB-FS is active */ if (f->fs_ep_max != 0) { cpd->is_usbfs = 1; } - /* - * Get real endpoint index associated with - * this FIFO: - */ - dev_ep_index = f->dev_ep_index; } else { cpd->rxfifo = NULL; cpd->is_read = 0; /* no ref */ @@ -434,7 +427,7 @@ usb2_fifo_create(struct usb2_cdev_privda /* wrong endpoint index */ continue; } - if (f->opened) { + if (f->curr_cpd != NULL) { /* FIFO is opened */ is_busy = 1; continue; @@ -451,7 +444,7 @@ usb2_fifo_create(struct usb2_cdev_privda /* wrong endpoint index */ continue; } - if (f->opened) { + if (f->curr_cpd != NULL) { /* FIFO is opened */ is_busy = 1; continue; @@ -466,10 +459,20 @@ usb2_fifo_create(struct usb2_cdev_privda if (no_null == 0) { if (ep >= (USB_EP_MAX / 2)) { /* we don't create any endpoints in this range */ - DPRINTFN(5, "dev_ep_index out of range\n"); + DPRINTFN(5, "ep out of range\n"); return (is_busy ? EBUSY : EINVAL); } } + + if ((ep != 0) && is_busy) { + /* + * Only the default control endpoint is allowed to be + * opened multiple times! + */ + DPRINTFN(5, "busy\n"); + return (EBUSY); + } + /* Check TX FIFO */ if (is_tx && (udev->fifo[n + USB_FIFO_TX] == NULL)) { @@ -639,7 +642,8 @@ usb2_dev_get_pipe(struct usb2_device *ud * Else: Failure *------------------------------------------------------------------------*/ static int -usb2_fifo_open(struct usb2_fifo *f, int fflags) +usb2_fifo_open(struct usb2_cdev_privdata *cpd, + struct usb2_fifo *f, int fflags) { int err; @@ -660,11 +664,14 @@ usb2_fifo_open(struct usb2_fifo *f, int /* check if we are already opened */ /* we don't need any locks when checking this variable */ - if (f->opened) { + if (f->curr_cpd != NULL) { err = EBUSY; goto done; } + /* reset short flag before open */ + f->flag_short = 0; + /* call open method */ err = (f->methods->f_open) (f, fflags); if (err) { @@ -690,9 +697,9 @@ usb2_fifo_open(struct usb2_fifo *f, int /* reset ASYNC proc flag */ f->async_p = NULL; - /* flag the fifo as opened to prevent others */ mtx_lock(&usb2_ref_lock); - f->opened = 1; + /* flag the fifo as opened to prevent others */ + f->curr_cpd = cpd; mtx_unlock(&usb2_ref_lock); /* reset queue */ @@ -733,14 +740,14 @@ usb2_fifo_close(struct usb2_fifo *f, int int err; /* check if we are not opened */ - if (!f->opened) { + if (f->curr_cpd == NULL) { /* nothing to do - already closed */ return; } mtx_lock(f->priv_mtx); - /* clear current file flag */ - f->opened = 0; + /* clear current cdev private data pointer */ + f->curr_cpd = NULL; /* check if we are selected */ if (f->flag_isselect) { @@ -834,21 +841,6 @@ usb2_open(struct cdev *dev, int fflags, } cpd->fflags = fflags; /* access mode for open lifetime */ - /* Check if the endpoint is already open, we always allow EP0 */ - if (ep > 0) { - if ((fflags & FREAD && cpd->udev->ep_rd_opened & (1 << ep)) || - (fflags & FWRITE && cpd->udev->ep_wr_opened & (1 << ep))) { - DPRINTFN(2, "endpoint already open\n"); - usb2_unref_device(cpd); - free(cpd, M_USBDEV); - return (EBUSY); - } - if (fflags & FREAD) - cpd->udev->ep_rd_opened |= (1 << ep); - if (fflags & FWRITE) - cpd->udev->ep_wr_opened |= (1 << ep); - } - /* create FIFOs, if any */ err = usb2_fifo_create(cpd); /* check for error */ @@ -859,7 +851,7 @@ usb2_open(struct cdev *dev, int fflags, return (err); } if (fflags & FREAD) { - err = usb2_fifo_open(cpd->rxfifo, fflags); + err = usb2_fifo_open(cpd, cpd->rxfifo, fflags); if (err) { DPRINTFN(2, "read open failed\n"); usb2_unref_device(cpd); @@ -868,7 +860,7 @@ usb2_open(struct cdev *dev, int fflags, } } if (fflags & FWRITE) { - err = usb2_fifo_open(cpd->txfifo, fflags); + err = usb2_fifo_open(cpd, cpd->txfifo, fflags); if (err) { DPRINTFN(2, "write open failed\n"); if (fflags & FREAD) { @@ -892,27 +884,20 @@ static void usb2_close(void *arg) { struct usb2_cdev_privdata *cpd = arg; - struct usb2_device *udev; int err; - DPRINTFN(2, "usb2_close, cpd=%p\n", cpd); + DPRINTFN(2, "cpd=%p\n", cpd); err = usb2_ref_device(cpd, 1); if (err) { free(cpd, M_USBDEV); return; } - - udev = cpd->udev; if (cpd->fflags & FREAD) { usb2_fifo_close(cpd->rxfifo, cpd->fflags); - /* clear read bitmask */ - udev->ep_rd_opened &= ~(1 << cpd->ep_addr); } if (cpd->fflags & FWRITE) { usb2_fifo_close(cpd->txfifo, cpd->fflags); - /* clear write bitmask */ - udev->ep_wr_opened &= ~(1 << cpd->ep_addr); } usb2_unref_device(cpd); @@ -1621,7 +1606,6 @@ usb2_fifo_attach(struct usb2_device *ude /* initialise FIFO structures */ f_tx->fifo_index = n + USB_FIFO_TX; - f_tx->dev_ep_index = (n / 2) + (USB_EP_MAX / 2); f_tx->priv_mtx = priv_mtx; f_tx->priv_sc0 = priv_sc; f_tx->methods = pm; @@ -1629,7 +1613,6 @@ usb2_fifo_attach(struct usb2_device *ude f_tx->udev = udev; f_rx->fifo_index = n + USB_FIFO_RX; - f_rx->dev_ep_index = (n / 2) + (USB_EP_MAX / 2); f_rx->priv_mtx = priv_mtx; f_rx->priv_sc0 = priv_sc; f_rx->methods = pm; @@ -1684,12 +1667,13 @@ usb2_fifo_attach(struct usb2_device *ude pd->bus_index = device_get_unit(udev->bus->bdev); pd->dev_index = udev->device_index; pd->ep_addr = -1; /* not an endpoint */ - pd->fifo_index = f_tx->fifo_index; + pd->fifo_index = f_tx->fifo_index & f_rx->fifo_index; pd->mode = FREAD|FWRITE; /* Now, create the device itself */ f_sc->dev = make_dev(&usb2_devsw, 0, uid, gid, mode, devname); + /* XXX setting si_drv1 and creating the device is not atomic! */ f_sc->dev->si_drv1 = pd; } @@ -1762,7 +1746,9 @@ usb2_fifo_detach(struct usb2_fifo_sc *f_ f_sc->fp[USB_FIFO_RX] = NULL; if (f_sc->dev != NULL) { - destroy_dev_sched_cb(f_sc->dev, usb2_fifo_cleanup, f_sc->dev->si_drv1); + destroy_dev_sched_cb(f_sc->dev, + usb2_fifo_cleanup, f_sc->dev->si_drv1); + f_sc->dev = NULL; } DPRINTFN(2, "detached %p\n", f_sc); @@ -1949,6 +1935,13 @@ usb2_fifo_get_data(struct usb2_fifo *f, break; } if (f->flag_flushing) { + /* check if we should send a short packet */ + if (f->flag_short != 0) { + f->flag_short = 0; + tr_data = 1; + break; + } + /* flushing complete */ f->flag_flushing = 0; usb2_fifo_wakeup(f); } @@ -2007,6 +2000,13 @@ usb2_fifo_get_data_linear(struct usb2_fi break; } if (f->flag_flushing) { + /* check if we should send a short packet */ + if (f->flag_short != 0) { + f->flag_short = 0; + tr_data = 1; + break; + } + /* flushing complete */ f->flag_flushing = 0; usb2_fifo_wakeup(f); } @@ -2186,3 +2186,13 @@ usb2_read_symlink(uint8_t *user_ptr, uin sx_unlock(&usb2_sym_lock); return (error); } + +void +usb2_fifo_set_close_zlp(struct usb2_fifo *f, uint8_t onoff) +{ + if (f == NULL) + return; + + /* send a Zero Length Packet, ZLP, before close */ + f->flag_short = onoff; +} Modified: head/sys/dev/usb/usb_dev.h ============================================================================== --- head/sys/dev/usb/usb_dev.h Tue Mar 17 01:42:46 2009 (r189905) +++ head/sys/dev/usb/usb_dev.h Tue Mar 17 01:46:40 2009 (r189906) @@ -93,12 +93,12 @@ struct usb2_cdev_privdata { int bus_index; /* bus index */ int dev_index; /* device index */ int ep_addr; /* endpoint address */ + int fflags; uint8_t fifo_index; /* FIFO index */ uint8_t is_read; /* location has read access */ uint8_t is_write; /* location has write access */ uint8_t is_uref; /* USB refcount decr. needed */ uint8_t is_usbfs; /* USB-FS is active */ - int fflags; }; struct usb2_fs_privdata { @@ -130,7 +130,8 @@ struct usb2_fifo { struct usb2_xfer *xfer[2]; struct usb2_xfer **fs_xfer; struct mtx *priv_mtx; /* client data */ - int opened; /* set if FIFO is opened by a FILE */ + /* set if FIFO is opened by a FILE: */ + struct usb2_cdev_privdata *curr_cpd; void *priv_sc0; /* client data */ void *priv_sc1; /* client data */ void *queue_data; @@ -194,5 +195,6 @@ struct usb2_symlink *usb2_alloc_symlink( void usb2_free_symlink(struct usb2_symlink *ps); int usb2_read_symlink(uint8_t *user_ptr, uint32_t startentry, uint32_t user_len); +void usb2_fifo_set_close_zlp(struct usb2_fifo *, uint8_t); #endif /* _USB2_DEV_H_ */ Modified: head/sys/dev/usb/usb_device.h ============================================================================== --- head/sys/dev/usb/usb_device.h Tue Mar 17 01:42:46 2009 (r189905) +++ head/sys/dev/usb/usb_device.h Tue Mar 17 01:46:40 2009 (r189906) @@ -127,8 +127,6 @@ struct usb2_device { uint32_t plugtime; /* copy of "ticks" */ - uint16_t ep_rd_opened; /* bitmask of endpoints opened */ - uint16_t ep_wr_opened; /* from the device nodes. */ uint16_t refcount; #define USB_DEV_REF_MAX 0xffff From owner-svn-src-head@FreeBSD.ORG Tue Mar 17 02:32:37 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7CFA5106564A; Tue, 17 Mar 2009 02:32:37 +0000 (UTC) (envelope-from scf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6C02E8FC12; Tue, 17 Mar 2009 02:32:37 +0000 (UTC) (envelope-from scf@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2H2Wb7f078614; Tue, 17 Mar 2009 02:32:37 GMT (envelope-from scf@svn.freebsd.org) Received: (from scf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2H2Wboh078613; Tue, 17 Mar 2009 02:32:37 GMT (envelope-from scf@svn.freebsd.org) Message-Id: <200903170232.n2H2Wboh078613@svn.freebsd.org> From: Sean Farley Date: Tue, 17 Mar 2009 02:32:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r189907 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 17 Mar 2009 02:32:37 -0000 Author: scf Date: Tue Mar 17 02:32:36 2009 New Revision: 189907 URL: http://svn.freebsd.org/changeset/base/189907 Log: Remove the splimp()/splx() calls around the setting of the MTU. They are no-op's that I inadvertently added. Even if locking is needed in general for the ioctl's, setting a single long will not need it due to the operation being atomic. Reported by: rwatson Modified: head/sys/net/if_tap.c Modified: head/sys/net/if_tap.c ============================================================================== --- head/sys/net/if_tap.c Tue Mar 17 01:46:40 2009 (r189906) +++ head/sys/net/if_tap.c Tue Mar 17 02:32:36 2009 (r189907) @@ -611,9 +611,7 @@ tapifioctl(struct ifnet *ifp, u_long cmd break; case SIOCSIFMTU: - s = splimp(); ifp->if_mtu = ifr->ifr_mtu; - splx(s); break; case SIOCGIFSTATUS: From owner-svn-src-head@FreeBSD.ORG Tue Mar 17 03:32:13 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 25F37106566B; Tue, 17 Mar 2009 03:32:13 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 14BDB8FC08; Tue, 17 Mar 2009 03:32:13 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2H3WC3H080025; Tue, 17 Mar 2009 03:32:12 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2H3WCVq080024; Tue, 17 Mar 2009 03:32:12 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200903170332.n2H3WCVq080024@svn.freebsd.org> From: Robert Noland Date: Tue, 17 Mar 2009 03:32:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r189908 - head/sys/dev/drm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 17 Mar 2009 03:32:13 -0000 Author: rnoland Date: Tue Mar 17 03:32:12 2009 New Revision: 189908 URL: http://svn.freebsd.org/changeset/base/189908 Log: Use flsl() here rather than ffsl() I discovered that we were computing page_order differently than linux. MFC after: 3 days Modified: head/sys/dev/drm/drm_bufs.c Modified: head/sys/dev/drm/drm_bufs.c ============================================================================== --- head/sys/dev/drm/drm_bufs.c Tue Mar 17 02:32:36 2009 (r189907) +++ head/sys/dev/drm/drm_bufs.c Tue Mar 17 03:32:12 2009 (r189908) @@ -1106,7 +1106,7 @@ int drm_order(unsigned long size) if (size == 0) return 0; - order = ffsl(size) - 1; + order = flsl(size) - 1; if (size & ~(1ul << order)) ++order; From owner-svn-src-head@FreeBSD.ORG Tue Mar 17 03:36:24 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8AA9A106566C; Tue, 17 Mar 2009 03:36:24 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7916F8FC12; Tue, 17 Mar 2009 03:36:24 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2H3aOsV080143; Tue, 17 Mar 2009 03:36:24 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2H3aOpL080142; Tue, 17 Mar 2009 03:36:24 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200903170336.n2H3aOpL080142@svn.freebsd.org> From: Robert Noland Date: Tue, 17 Mar 2009 03:36: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: r189909 - head/sys/dev/drm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 17 Mar 2009 03:36:25 -0000 Author: rnoland Date: Tue Mar 17 03:36:24 2009 New Revision: 189909 URL: http://svn.freebsd.org/changeset/base/189909 Log: Change the logic around to match ati_pcigart. MFC after: 3 days Modified: head/sys/dev/drm/r600_cp.c Modified: head/sys/dev/drm/r600_cp.c ============================================================================== --- head/sys/dev/drm/r600_cp.c Tue Mar 17 03:32:12 2009 (r189908) +++ head/sys/dev/drm/r600_cp.c Tue Mar 17 03:36:24 2009 (r189909) @@ -174,7 +174,6 @@ int r600_page_table_init(struct drm_devi if (entry->busaddr[i] == 0) { DRM_ERROR("unable to map PCIGART pages!\n"); r600_page_table_cleanup(dev, gart_info); - ret = -EINVAL; goto done; } #endif @@ -193,6 +192,7 @@ int r600_page_table_init(struct drm_devi entry_addr += ATI_PCIGART_PAGE_SIZE; } } + ret = 1; #ifdef __linux__ done: #endif @@ -2100,7 +2100,7 @@ int r600_do_init_cp(struct drm_device *d dev_priv->gart_info.addr, dev_priv->pcigart_offset); - if (r600_page_table_init(dev)) { + if (!r600_page_table_init(dev)) { DRM_ERROR("Failed to init GART table\n"); r600_do_cleanup_cp(dev); return -EINVAL; From owner-svn-src-head@FreeBSD.ORG Tue Mar 17 03:39:10 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18C31106564A; Tue, 17 Mar 2009 03:39:10 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 071C48FC19; Tue, 17 Mar 2009 03:39:10 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2H3d9VQ080221; Tue, 17 Mar 2009 03:39:09 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2H3d9Km080220; Tue, 17 Mar 2009 03:39:09 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200903170339.n2H3d9Km080220@svn.freebsd.org> From: Robert Noland Date: Tue, 17 Mar 2009 03:39: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: r189910 - head/sys/dev/drm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 17 Mar 2009 03:39:10 -0000 Author: rnoland Date: Tue Mar 17 03:39:09 2009 New Revision: 189910 URL: http://svn.freebsd.org/changeset/base/189910 Log: Cast register maps and offsets to vm_offset_t MFC after: 3 days Modified: head/sys/dev/drm/drmP.h Modified: head/sys/dev/drm/drmP.h ============================================================================== --- head/sys/dev/drm/drmP.h Tue Mar 17 03:36:24 2009 (r189909) +++ head/sys/dev/drm/drmP.h Tue Mar 17 03:39:09 2009 (r189910) @@ -240,17 +240,23 @@ typedef u_int8_t u8; #endif #define DRM_READ8(map, offset) \ - *(volatile u_int8_t *) (((unsigned long)(map)->handle) + (offset)) + *(volatile u_int8_t *)(((vm_offset_t)(map)->handle) + \ + (vm_offset_t)(offset)) #define DRM_READ16(map, offset) \ - *(volatile u_int16_t *) (((unsigned long)(map)->handle) + (offset)) + *(volatile u_int16_t *)(((vm_offset_t)(map)->handle) + \ + (vm_offset_t)(offset)) #define DRM_READ32(map, offset) \ - *(volatile u_int32_t *)(((unsigned long)(map)->handle) + (offset)) + *(volatile u_int32_t *)(((vm_offset_t)(map)->handle) + \ + (vm_offset_t)(offset)) #define DRM_WRITE8(map, offset, val) \ - *(volatile u_int8_t *) (((unsigned long)(map)->handle) + (offset)) = val + *(volatile u_int8_t *)(((vm_offset_t)(map)->handle) + \ + (vm_offset_t)(offset)) = val #define DRM_WRITE16(map, offset, val) \ - *(volatile u_int16_t *) (((unsigned long)(map)->handle) + (offset)) = val + *(volatile u_int16_t *)(((vm_offset_t)(map)->handle) + \ + (vm_offset_t)(offset)) = val #define DRM_WRITE32(map, offset, val) \ - *(volatile u_int32_t *)(((unsigned long)(map)->handle) + (offset)) = val + *(volatile u_int32_t *)(((vm_offset_t)(map)->handle) + \ + (vm_offset_t)(offset)) = val #define DRM_VERIFYAREA_READ( uaddr, size ) \ (!useracc(__DECONST(caddr_t, uaddr), size, VM_PROT_READ)) From owner-svn-src-head@FreeBSD.ORG Tue Mar 17 03:44:37 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C0F3106566B; Tue, 17 Mar 2009 03:44:37 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 061828FC15; Tue, 17 Mar 2009 03:44:37 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2H3iax6080368; Tue, 17 Mar 2009 03:44:36 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2H3iaLo080367; Tue, 17 Mar 2009 03:44:36 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200903170344.n2H3iaLo080367@svn.freebsd.org> From: Robert Noland Date: Tue, 17 Mar 2009 03:44: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: r189911 - head/sys/dev/drm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 17 Mar 2009 03:44:37 -0000 Author: rnoland Date: Tue Mar 17 03:44:36 2009 New Revision: 189911 URL: http://svn.freebsd.org/changeset/base/189911 Log: We can have more than 3 pci resources MFC after: 3 days Modified: head/sys/dev/drm/drmP.h Modified: head/sys/dev/drm/drmP.h ============================================================================== --- head/sys/dev/drm/drmP.h Tue Mar 17 03:39:09 2009 (r189910) +++ head/sys/dev/drm/drmP.h Tue Mar 17 03:44:36 2009 (r189911) @@ -613,7 +613,7 @@ struct drm_driver_info { }; /* Length for the array of resource pointers for drm_get_resource_*. */ -#define DRM_MAX_PCI_RESOURCE 3 +#define DRM_MAX_PCI_RESOURCE 6 /** * DRM device functions structure From owner-svn-src-head@FreeBSD.ORG Tue Mar 17 03:46:37 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 62AD01065676; Tue, 17 Mar 2009 03:46:37 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4FC4A8FC14; Tue, 17 Mar 2009 03:46:37 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2H3kbbf080446; Tue, 17 Mar 2009 03:46:37 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2H3kbm0080445; Tue, 17 Mar 2009 03:46:37 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200903170346.n2H3kbm0080445@svn.freebsd.org> From: Robert Noland Date: Tue, 17 Mar 2009 03:46:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r189912 - head/sys/dev/drm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 17 Mar 2009 03:46:39 -0000 Author: rnoland Date: Tue Mar 17 03:46:37 2009 New Revision: 189912 URL: http://svn.freebsd.org/changeset/base/189912 Log: Minor code cleanup MFC after: 3 days Modified: head/sys/dev/drm/drm_bufs.c Modified: head/sys/dev/drm/drm_bufs.c ============================================================================== --- head/sys/dev/drm/drm_bufs.c Tue Mar 17 03:44:36 2009 (r189911) +++ head/sys/dev/drm/drm_bufs.c Tue Mar 17 03:46:37 2009 (r189912) @@ -216,7 +216,7 @@ int drm_addmap(struct drm_device * dev, DRM_LOCK(); return EINVAL; } - map->offset = map->offset + dev->sg->handle; + map->offset += dev->sg->handle; break; case _DRM_CONSISTENT: /* Unfortunately, we don't get any alignment specification from From owner-svn-src-head@FreeBSD.ORG Tue Mar 17 03:49:24 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CFB64106566C; Tue, 17 Mar 2009 03:49:24 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BE53A8FC16; Tue, 17 Mar 2009 03:49:24 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2H3nO2v080525; Tue, 17 Mar 2009 03:49:24 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2H3nOY1080524; Tue, 17 Mar 2009 03:49:24 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200903170349.n2H3nOY1080524@svn.freebsd.org> From: Robert Noland Date: Tue, 17 Mar 2009 03: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: r189913 - head/sys/dev/drm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 17 Mar 2009 03:49:25 -0000 Author: rnoland Date: Tue Mar 17 03:49:24 2009 New Revision: 189913 URL: http://svn.freebsd.org/changeset/base/189913 Log: Add list_for_each_prev to our linux compatibility. We need this for nouveau MFC after: 3 days Modified: head/sys/dev/drm/drm_linux_list.h Modified: head/sys/dev/drm/drm_linux_list.h ============================================================================== --- head/sys/dev/drm/drm_linux_list.h Tue Mar 17 03:46:37 2009 (r189912) +++ head/sys/dev/drm/drm_linux_list.h Tue Mar 17 03:49:24 2009 (r189913) @@ -67,6 +67,10 @@ list_del(struct list_head *entry) { #define list_for_each(entry, head) \ for (entry = (head)->next; entry != head; entry = (entry)->next) +#define list_for_each_prev(entry, head) \ + for (entry = (head)->prev; entry != (head); \ + entry = entry->prev) + #define list_for_each_safe(entry, temp, head) \ for (entry = (head)->next, temp = (entry)->next; \ entry != head; \ From owner-svn-src-head@FreeBSD.ORG Tue Mar 17 03:50:36 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 35685106564A; Tue, 17 Mar 2009 03:50:36 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2459D8FC1A; Tue, 17 Mar 2009 03:50:36 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2H3oah3080591; Tue, 17 Mar 2009 03:50:36 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2H3oah2080590; Tue, 17 Mar 2009 03:50:36 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200903170350.n2H3oah2080590@svn.freebsd.org> From: Robert Noland Date: Tue, 17 Mar 2009 03: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: r189914 - head/sys/dev/drm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 17 Mar 2009 03:50:36 -0000 Author: rnoland Date: Tue Mar 17 03:50:35 2009 New Revision: 189914 URL: http://svn.freebsd.org/changeset/base/189914 Log: Improve the debugging output of drm_mmap MFC after: 3 days Modified: head/sys/dev/drm/drm_vm.c Modified: head/sys/dev/drm/drm_vm.c ============================================================================== --- head/sys/dev/drm/drm_vm.c Tue Mar 17 03:49:24 2009 (r189913) +++ head/sys/dev/drm/drm_vm.c Tue Mar 17 03:50:35 2009 (r189914) @@ -86,8 +86,13 @@ int drm_mmap(struct cdev *kdev, vm_offse } if (map == NULL) { + DRM_DEBUG("Can't find map, requested offset = %016lx\n", + offset); + TAILQ_FOREACH(map, &dev->maplist, link) { + DRM_DEBUG("map offset = %016lx, handle = %016lx\n", + map->offset, (unsigned long)map->handle); + } DRM_UNLOCK(); - DRM_DEBUG("can't find map\n"); return -1; } if (((map->flags&_DRM_RESTRICTED) && !DRM_SUSER(DRM_CURPROC))) { From owner-svn-src-head@FreeBSD.ORG Tue Mar 17 03:53:45 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4F00C106566B; Tue, 17 Mar 2009 03:53:45 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3DB4E8FC08; Tue, 17 Mar 2009 03:53:45 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2H3riuC080677; Tue, 17 Mar 2009 03:53:44 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2H3ri51080676; Tue, 17 Mar 2009 03:53:44 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200903170353.n2H3ri51080676@svn.freebsd.org> From: Robert Noland Date: Tue, 17 Mar 2009 03:53: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: r189915 - head/sys/dev/drm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 17 Mar 2009 03:53:45 -0000 Author: rnoland Date: Tue Mar 17 03:53:44 2009 New Revision: 189915 URL: http://svn.freebsd.org/changeset/base/189915 Log: Add support for matching solely on vendor id. We will use this method with nouveau MFC after: 3 days Modified: head/sys/dev/drm/drm_drv.c Modified: head/sys/dev/drm/drm_drv.c ============================================================================== --- head/sys/dev/drm/drm_drv.c Tue Mar 17 03:50:35 2009 (r189914) +++ head/sys/dev/drm/drm_drv.c Tue Mar 17 03:53:44 2009 (r189915) @@ -182,7 +182,10 @@ int drm_probe(device_t kdev, drm_pci_id_ id_entry = drm_find_description(vendor, device, idlist); if (id_entry != NULL) { - device_set_desc(kdev, id_entry->name); + if (!device_get_desc(kdev)) { + DRM_DEBUG("desc : %s\n", device_get_desc(kdev)); + device_set_desc(kdev, id_entry->name); + } return 0; } @@ -290,7 +293,8 @@ drm_pci_id_list_t *drm_find_description( for (i = 0; idlist[i].vendor != 0; i++) { if ((idlist[i].vendor == vendor) && - (idlist[i].device == device)) { + ((idlist[i].device == device) || + (idlist[i].device == 0))) { return &idlist[i]; } } From owner-svn-src-head@FreeBSD.ORG Tue Mar 17 05:10:12 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E6EF3106566B; Tue, 17 Mar 2009 05:10:12 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CA3FF8FC13; Tue, 17 Mar 2009 05:10:12 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2H5ACdK082224; Tue, 17 Mar 2009 05:10:12 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2H5AC1k082223; Tue, 17 Mar 2009 05:10:12 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200903170510.n2H5AC1k082223@svn.freebsd.org> From: Robert Noland Date: Tue, 17 Mar 2009 05:10:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r189916 - head/sys/dev/drm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 17 Mar 2009 05:10:13 -0000 Author: rnoland Date: Tue Mar 17 05:10:12 2009 New Revision: 189916 URL: http://svn.freebsd.org/changeset/base/189916 Log: Cast to (unsigned long) to make printf happy on i386 MFC after: 3 days Modified: head/sys/dev/drm/drm_vm.c Modified: head/sys/dev/drm/drm_vm.c ============================================================================== --- head/sys/dev/drm/drm_vm.c Tue Mar 17 03:53:44 2009 (r189915) +++ head/sys/dev/drm/drm_vm.c Tue Mar 17 05:10:12 2009 (r189916) @@ -87,10 +87,11 @@ int drm_mmap(struct cdev *kdev, vm_offse if (map == NULL) { DRM_DEBUG("Can't find map, requested offset = %016lx\n", - offset); + (unsigned long)offset); TAILQ_FOREACH(map, &dev->maplist, link) { DRM_DEBUG("map offset = %016lx, handle = %016lx\n", - map->offset, (unsigned long)map->handle); + (unsigned long)map->offset, + (unsigned long)map->handle); } DRM_UNLOCK(); return -1; From owner-svn-src-head@FreeBSD.ORG Tue Mar 17 05:57:44 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 208EE106564A; Tue, 17 Mar 2009 05:57:44 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0F3608FC18; Tue, 17 Mar 2009 05:57:44 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2H5vhYe084295; Tue, 17 Mar 2009 05:57:43 GMT (envelope-from weongyo@svn.freebsd.org) Received: (from weongyo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2H5vhQf084294; Tue, 17 Mar 2009 05:57:43 GMT (envelope-from weongyo@svn.freebsd.org) Message-Id: <200903170557.n2H5vhQf084294@svn.freebsd.org> From: Weongyo Jeong Date: Tue, 17 Mar 2009 05:57: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: r189917 - head/sys/compat/ndis X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 17 Mar 2009 05:57:44 -0000 Author: weongyo Date: Tue Mar 17 05:57:43 2009 New Revision: 189917 URL: http://svn.freebsd.org/changeset/base/189917 Log: grab NDIS USB lock instead of HAL preemption. This change should be happened in the previous. Modified: head/sys/compat/ndis/subr_usbd.c Modified: head/sys/compat/ndis/subr_usbd.c ============================================================================== --- head/sys/compat/ndis/subr_usbd.c Tue Mar 17 05:10:12 2009 (r189916) +++ head/sys/compat/ndis/subr_usbd.c Tue Mar 17 05:57:43 2009 (r189917) @@ -707,8 +707,9 @@ usbd_irpcancel(dobj, ip) device_object *dobj; irp *ip; { + device_t dev = IRP_NDIS_DEV(ip); + struct ndis_softc *sc = device_get_softc(dev); struct ndisusb_ep *ne = IRP_NDISUSB_EP(ip); - uint8_t irql; if (ne == NULL) { ip->irp_cancel = TRUE; @@ -720,10 +721,10 @@ usbd_irpcancel(dobj, ip) * Make sure that the current USB transfer proxy is * cancelled and then restarted. */ - KeRaiseIrql(DISPATCH_LEVEL, &irql); + NDISUSB_LOCK(sc); usb2_transfer_stop(ne->ne_xfer[0]); usb2_transfer_start(ne->ne_xfer[0]); - KeLowerIrql(irql); + NDISUSB_UNLOCK(sc); ip->irp_cancel = TRUE; IoReleaseCancelSpinLock(ip->irp_cancelirql); From owner-svn-src-head@FreeBSD.ORG Tue Mar 17 09:50:40 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9E9CA1065675; Tue, 17 Mar 2009 09:50:40 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8D5D38FC21; Tue, 17 Mar 2009 09:50:40 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2H9oe3r088798; Tue, 17 Mar 2009 09:50:40 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2H9oeda088797; Tue, 17 Mar 2009 09:50:40 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200903170950.n2H9oeda088797@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 17 Mar 2009 09:50: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: r189919 - 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, 17 Mar 2009 09:50:41 -0000 Author: kib Date: Tue Mar 17 09:50:40 2009 New Revision: 189919 URL: http://svn.freebsd.org/changeset/base/189919 Log: Use the properly sized types for ELF object header and program headers. This fixes osrel fetching from the FreeBSD branding note for the 64bit platforms. Reported by: swell.k gmail com Reviewed by: dchagin Tested by: dchagin, swell.k gmail com Modified: head/sys/kern/imgact_elf.c Modified: head/sys/kern/imgact_elf.c ============================================================================== --- head/sys/kern/imgact_elf.c Tue Mar 17 06:54:41 2009 (r189918) +++ head/sys/kern/imgact_elf.c Tue Mar 17 09:50:40 2009 (r189919) @@ -1330,14 +1330,14 @@ __elfN(check_note)(struct image_params * int32_t *osrel) { const Elf_Note *note, *note_end; - const Elf32_Phdr *phdr, *pnote; - const Elf32_Ehdr *hdr; + const Elf_Phdr *phdr, *pnote; + const Elf_Ehdr *hdr; const char *note_name; int i; pnote = NULL; - hdr = (const Elf32_Ehdr *)imgp->image_header; - phdr = (const Elf32_Phdr *)(imgp->image_header + hdr->e_phoff); + hdr = (const Elf_Ehdr *)imgp->image_header; + phdr = (const Elf_Phdr *)(imgp->image_header + hdr->e_phoff); for (i = 0; i < hdr->e_phnum; i++) { if (phdr[i].p_type == PT_NOTE) { From owner-svn-src-head@FreeBSD.ORG Tue Mar 17 10:51:32 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6BECA1065819; Tue, 17 Mar 2009 10:51:32 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3F17A8FC16; Tue, 17 Mar 2009 10:51:32 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2HApWmK092938; Tue, 17 Mar 2009 10:51:32 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2HApWMr092937; Tue, 17 Mar 2009 10:51:32 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <200903171051.n2HApWMr092937@svn.freebsd.org> From: Edwin Groothuis Date: Tue, 17 Mar 2009 10:51: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: r189923 - head/share/zoneinfo X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 17 Mar 2009 10:51:33 -0000 Author: edwin Date: Tue Mar 17 10:51:31 2009 New Revision: 189923 URL: http://svn.freebsd.org/changeset/base/189923 Log: MFV of tzdata2009c - Cuba has DST again. MFC after: 1 week Modified: head/share/zoneinfo/ (props changed) head/share/zoneinfo/northamerica Modified: head/share/zoneinfo/northamerica ============================================================================== --- head/share/zoneinfo/northamerica Tue Mar 17 10:48:13 2009 (r189922) +++ head/share/zoneinfo/northamerica Tue Mar 17 10:51:31 2009 (r189923) @@ -1,4 +1,4 @@ -# @(#)northamerica 8.26 +# @(#)northamerica 8.27 #
 
 # also includes Central America and the Caribbean
@@ -2258,6 +2258,25 @@ Zone America/Costa_Rica	-5:36:20 -	LMT	1
 # From Arthur David Olson (2008-03-12):
 # Assume Sun>=15 (third Sunday) going forward.
 
+# From Alexander Krivenyshev (2009-03-04)
+# According to the Radio Reloj - Cuba will start Daylight Saving Time on
+# midnight between Saturday, March 07, 2009 and Sunday, March 08, 2009-
+# not on midnight March 14 / March 15 as previously thought.
+#
+# 
+# http://www.worldtimezone.com/dst_news/dst_news_cuba05.html
+# (in Spanish)
+# 
+
+# From Arthur David Olson (2009-03-09)
+# I listened over the Internet to
+# 
+# http://media.enet.cu/readioreloj
+# 
+# this morning; when it was 10:05 a. m. here in Bethesda, Maryland the
+# the time was announced as "diez cinco"--the same time as here, indicating
+# that has indeed switched to DST. Assume second Sunday from 2009 forward.
+
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Cuba	1928	only	-	Jun	10	0:00	1:00	D
 Rule	Cuba	1928	only	-	Oct	10	0:00	0	S
@@ -2290,7 +2309,8 @@ Rule	Cuba	1998	2003	-	Oct	lastSun	0:00s	
 Rule	Cuba	2000	2004	-	Apr	Sun>=1	0:00s	1:00	D
 Rule	Cuba	2006	max	-	Oct	lastSun	0:00s	0	S
 Rule	Cuba	2007	only	-	Mar	Sun>=8	0:00s	1:00	D
-Rule	Cuba	2008	max	-	Mar	Sun>=15	0:00s	1:00	D
+Rule	Cuba	2008	only	-	Mar	Sun>=15	0:00s	1:00	D
+Rule	Cuba	2009	max	-	Mar	Sun>=8	0:00s	1:00	D
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	America/Havana	-5:29:28 -	LMT	1890

From owner-svn-src-head@FreeBSD.ORG  Tue Mar 17 12:47:40 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B1081106564A;
	Tue, 17 Mar 2009 12:47:40 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 9F63B8FC19;
	Tue, 17 Mar 2009 12:47:40 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2HCle5n095182;
	Tue, 17 Mar 2009 12:47:40 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2HCle8o095181;
	Tue, 17 Mar 2009 12:47:40 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <200903171247.n2HCle8o095181@svn.freebsd.org>
From: Konstantin Belousov 
Date: Tue, 17 Mar 2009 12:47: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: r189925 - 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, 17 Mar 2009 12:47:41 -0000

Author: kib
Date: Tue Mar 17 12:47:40 2009
New Revision: 189925
URL: http://svn.freebsd.org/changeset/base/189925

Log:
  Add some definitions for the DT_FLAGS_1 tag flags.
  
  Reviewed by:	     kan

Modified:
  head/sys/sys/elf_common.h

Modified: head/sys/sys/elf_common.h
==============================================================================
--- head/sys/sys/elf_common.h	Tue Mar 17 11:28:56 2009	(r189924)
+++ head/sys/sys/elf_common.h	Tue Mar 17 12:47:40 2009	(r189925)
@@ -466,6 +466,11 @@ typedef struct {
 				   executable contains code using a static
 				   thread-local storage scheme. */
 
+/* Values for DT_FLAGS_1 */
+#define	DF_1_BIND_NOW	0x00000001	/* Same as DF_BIND_NOW */
+#define	DF_1_GLOBAL	0x00000002	/* Set the RTLD_GLOBAL for object */
+#define	DF_1_ORIGIN	0x00000080	/* Process $ORIGIN */
+
 /* Values for n_type.  Used in core files. */
 #define	NT_PRSTATUS	1	/* Process status. */
 #define	NT_FPREGSET	2	/* Floating point registers. */

From owner-svn-src-head@FreeBSD.ORG  Tue Mar 17 12:50:17 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 18D70106568A;
	Tue, 17 Mar 2009 12:50:17 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 03DA08FC1E;
	Tue, 17 Mar 2009 12:50:17 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2HCoGxc095288;
	Tue, 17 Mar 2009 12:50:16 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2HCoG0i095280;
	Tue, 17 Mar 2009 12:50:16 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <200903171250.n2HCoG0i095280@svn.freebsd.org>
From: Konstantin Belousov 
Date: Tue, 17 Mar 2009 12:50: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: r189926 - in head/sys: amd64/include arm/include
	i386/include ia64/include mips/include powerpc/include
	sparc64/include sun4v/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: Tue, 17 Mar 2009 12:50:18 -0000

Author: kib
Date: Tue Mar 17 12:50:16 2009
New Revision: 189926
URL: http://svn.freebsd.org/changeset/base/189926

Log:
  Add AT_EXECPATH ELF auxinfo entry type. The value's a_ptr is a pointer
  to the full path of the image that is being executed.
  Increase AT_COUNT.
  
  Remove no longer true comment about types used in Linux ELF binaries,
  listed types contain FreeBSD-specific entries.
  
  Reviewed by:	kan

Modified:
  head/sys/amd64/include/elf.h
  head/sys/arm/include/elf.h
  head/sys/i386/include/elf.h
  head/sys/ia64/include/elf.h
  head/sys/mips/include/elf.h
  head/sys/powerpc/include/elf.h
  head/sys/sparc64/include/elf.h
  head/sys/sun4v/include/elf.h

Modified: head/sys/amd64/include/elf.h
==============================================================================
--- head/sys/amd64/include/elf.h	Tue Mar 17 12:47:40 2009	(r189925)
+++ head/sys/amd64/include/elf.h	Tue Mar 17 12:50:16 2009	(r189926)
@@ -81,16 +81,14 @@ __ElfType(Auxinfo);
 #define	AT_BASE		7	/* Interpreter's base address. */
 #define	AT_FLAGS	8	/* Flags (unused for i386). */
 #define	AT_ENTRY	9	/* Where interpreter should transfer control. */
-/*
- * The following non-standard values are used in Linux ELF binaries.
- */
 #define	AT_NOTELF	10	/* Program is not ELF ?? */
 #define	AT_UID		11	/* Real uid. */
 #define	AT_EUID		12	/* Effective uid. */
 #define	AT_GID		13	/* Real gid. */
 #define	AT_EGID		14	/* Effective gid. */
+#define	AT_EXECPATH	15	/* Path to the executable. */
 
-#define	AT_COUNT	15	/* Count of defined aux entry types. */
+#define	AT_COUNT	16	/* Count of defined aux entry types. */
 
 /*
  * Relocation types.

Modified: head/sys/arm/include/elf.h
==============================================================================
--- head/sys/arm/include/elf.h	Tue Mar 17 12:47:40 2009	(r189925)
+++ head/sys/arm/include/elf.h	Tue Mar 17 12:50:16 2009	(r189926)
@@ -75,8 +75,9 @@ __ElfType(Auxinfo);
 #define AT_EUID         12      /* Effective uid. */
 #define AT_GID          13      /* Real gid. */
 #define AT_EGID         14      /* Effective gid. */
+#define	AT_EXECPATH	15	/* Path to the executable. */
 
-#define AT_COUNT        15      /* Count of defined aux entry types. */
+#define AT_COUNT        16      /* Count of defined aux entry types. */
 
 #define	R_ARM_COUNT		33	/* Count of defined relocation types. */
 

Modified: head/sys/i386/include/elf.h
==============================================================================
--- head/sys/i386/include/elf.h	Tue Mar 17 12:47:40 2009	(r189925)
+++ head/sys/i386/include/elf.h	Tue Mar 17 12:50:16 2009	(r189926)
@@ -84,16 +84,14 @@ __ElfType(Auxinfo);
 #define	AT_BASE		7	/* Interpreter's base address. */
 #define	AT_FLAGS	8	/* Flags (unused for i386). */
 #define	AT_ENTRY	9	/* Where interpreter should transfer control. */
-/*
- * The following non-standard values are used in Linux ELF binaries.
- */
 #define	AT_NOTELF	10	/* Program is not ELF ?? */
 #define	AT_UID		11	/* Real uid. */
 #define	AT_EUID		12	/* Effective uid. */
 #define	AT_GID		13	/* Real gid. */
 #define	AT_EGID		14	/* Effective gid. */
+#define	AT_EXECPATH	15	/* Path to the executable. */
 
-#define	AT_COUNT	15	/* Count of defined aux entry types. */
+#define	AT_COUNT	16	/* Count of defined aux entry types. */
 
 /*
  * Relocation types.

Modified: head/sys/ia64/include/elf.h
==============================================================================
--- head/sys/ia64/include/elf.h	Tue Mar 17 12:47:40 2009	(r189925)
+++ head/sys/ia64/include/elf.h	Tue Mar 17 12:50:16 2009	(r189926)
@@ -82,16 +82,14 @@ __ElfType(Auxinfo);
 #define	AT_BASE		7	/* Interpreter's base address. */
 #define	AT_FLAGS	8	/* Flags (unused for i386). */
 #define	AT_ENTRY	9	/* Where interpreter should transfer control. */
-/*
- * The following non-standard values are used in Linux ELF binaries.
- */
 #define	AT_NOTELF	10	/* Program is not ELF ?? */
 #define	AT_UID		11	/* Real uid. */
 #define	AT_EUID		12	/* Effective uid. */
 #define	AT_GID		13	/* Real gid. */
 #define	AT_EGID		14	/* Effective gid. */
+#define	AT_EXECPATH	15	/* Path to the executable. */
 
-#define	AT_COUNT	15	/* Count of defined aux entry types. */
+#define	AT_COUNT	16	/* Count of defined aux entry types. */
 
 /*
  * Values for e_flags.

Modified: head/sys/mips/include/elf.h
==============================================================================
--- head/sys/mips/include/elf.h	Tue Mar 17 12:47:40 2009	(r189925)
+++ head/sys/mips/include/elf.h	Tue Mar 17 12:50:16 2009	(r189926)
@@ -241,15 +241,13 @@ __ElfType(Auxinfo);
 #define	AT_BASE		7	/* Interpreter's base address. */
 #define	AT_FLAGS	8	/* Flags (unused for i386). */
 #define	AT_ENTRY	9	/* Where interpreter should transfer control. */
-/*
- * The following non-standard values are used in Linux ELF binaries.
- */
 #define	AT_NOTELF	10	/* Program is not ELF ?? */
 #define	AT_UID		11	/* Real uid. */
 #define	AT_EUID		12	/* Effective uid. */
 #define	AT_GID		13	/* Real gid. */
 #define	AT_EGID		14	/* Effective gid. */
+#define	AT_EXECPATH	15	/* Path to the executable. */
 
-#define	AT_COUNT	15	/* Count of defined aux entry types. */
+#define	AT_COUNT	16	/* Count of defined aux entry types. */
 
 #endif /* !_MACHINE_ELF_H_ */

Modified: head/sys/powerpc/include/elf.h
==============================================================================
--- head/sys/powerpc/include/elf.h	Tue Mar 17 12:47:40 2009	(r189925)
+++ head/sys/powerpc/include/elf.h	Tue Mar 17 12:50:16 2009	(r189926)
@@ -77,8 +77,9 @@ __ElfType(Auxinfo);
 #define	AT_DCACHEBSIZE	10	/* Data cache block size for the processor. */
 #define	AT_ICACHEBSIZE	11	/* Instruction cache block size for the uP. */
 #define	AT_UCACHEBSIZE	12	/* Cache block size, or `0' if cache not unified. */
+#define	AT_EXECPATH	13	/* Path to the executable. */
 
-#define	AT_COUNT	13	/* Count of defined aux entry types. */
+#define	AT_COUNT	14	/* Count of defined aux entry types. */
 
 /*
  * Relocation types.

Modified: head/sys/sparc64/include/elf.h
==============================================================================
--- head/sys/sparc64/include/elf.h	Tue Mar 17 12:47:40 2009	(r189925)
+++ head/sys/sparc64/include/elf.h	Tue Mar 17 12:50:16 2009	(r189926)
@@ -78,16 +78,14 @@ __ElfType(Auxinfo);
 #define	AT_BASE		7	/* Interpreter's base address. */
 #define	AT_FLAGS	8	/* Flags (unused). */
 #define	AT_ENTRY	9	/* Where interpreter should transfer control. */
-/*
- * The following non-standard values are used in Linux ELF binaries.
- */
 #define	AT_NOTELF	10	/* Program is not ELF ?? */
 #define	AT_UID		11	/* Real uid. */
 #define	AT_EUID		12	/* Effective uid. */
 #define	AT_GID		13	/* Real gid. */
 #define	AT_EGID		14	/* Effective gid. */
+#define	AT_EXECPATH	15	/* Path to the executable. */
 
-#define	AT_COUNT	15	/* Count of defined aux entry types. */
+#define	AT_COUNT	16	/* Count of defined aux entry types. */
 
 /* Define "machine" characteristics */
 #if __ELF_WORD_SIZE == 32

Modified: head/sys/sun4v/include/elf.h
==============================================================================
--- head/sys/sun4v/include/elf.h	Tue Mar 17 12:47:40 2009	(r189925)
+++ head/sys/sun4v/include/elf.h	Tue Mar 17 12:50:16 2009	(r189926)
@@ -78,16 +78,14 @@ __ElfType(Auxinfo);
 #define	AT_BASE		7	/* Interpreter's base address. */
 #define	AT_FLAGS	8	/* Flags (unused). */
 #define	AT_ENTRY	9	/* Where interpreter should transfer control. */
-/*
- * The following non-standard values are used in Linux ELF binaries.
- */
 #define	AT_NOTELF	10	/* Program is not ELF ?? */
 #define	AT_UID		11	/* Real uid. */
 #define	AT_EUID		12	/* Effective uid. */
 #define	AT_GID		13	/* Real gid. */
 #define	AT_EGID		14	/* Effective gid. */
+#define	AT_EXECPATH	15	/* Path to the executable. */
 
-#define	AT_COUNT	15	/* Count of defined aux entry types. */
+#define	AT_COUNT	16	/* Count of defined aux entry types. */
 
 /* Define "machine" characteristics */
 #if __ELF_WORD_SIZE == 32

From owner-svn-src-head@FreeBSD.ORG  Tue Mar 17 12:53:29 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4AF07106564A;
	Tue, 17 Mar 2009 12:53:29 +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 37E8A8FC23;
	Tue, 17 Mar 2009 12:53:29 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2HCrTKH095391;
	Tue, 17 Mar 2009 12:53:29 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2HCrSsR095387;
	Tue, 17 Mar 2009 12:53:28 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <200903171253.n2HCrSsR095387@svn.freebsd.org>
From: Konstantin Belousov 
Date: Tue, 17 Mar 2009 12:53: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: r189927 - in head/sys: compat/ia32 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: Tue, 17 Mar 2009 12:53:30 -0000

Author: kib
Date: Tue Mar 17 12:53:28 2009
New Revision: 189927
URL: http://svn.freebsd.org/changeset/base/189927

Log:
  Supply AT_EXECPATH auxinfo entry to the interpreter, both for native and
  compat32 binaries.
  
  Tested by:	pho
  Reviewed by:	kan

Modified:
  head/sys/compat/ia32/ia32_sysvec.c
  head/sys/kern/imgact_elf.c
  head/sys/kern/kern_exec.c
  head/sys/sys/imgact.h

Modified: head/sys/compat/ia32/ia32_sysvec.c
==============================================================================
--- head/sys/compat/ia32/ia32_sysvec.c	Tue Mar 17 12:50:16 2009	(r189926)
+++ head/sys/compat/ia32/ia32_sysvec.c	Tue Mar 17 12:53:28 2009	(r189927)
@@ -189,15 +189,21 @@ ia32_copyout_strings(struct image_params
 	char *stringp, *destp;
 	u_int32_t *stack_base;
 	struct freebsd32_ps_strings *arginfo;
+	size_t execpath_len;
 	int szsigcode;
 
 	/*
 	 * Calculate string base and vector table pointers.
 	 * Also deal with signal trampoline code for this exec type.
 	 */
+	if (imgp->execpath != NULL && imgp->auxargs != NULL)
+		execpath_len = strlen(imgp->execpath) + 1;
+	else
+		execpath_len = 0;
 	arginfo = (struct freebsd32_ps_strings *)FREEBSD32_PS_STRINGS;
 	szsigcode = *(imgp->proc->p_sysent->sv_szsigcode);
 	destp =	(caddr_t)arginfo - szsigcode - SPARE_USRSPACE -
+		roundup(execpath_len, sizeof(char *)) -
 		roundup((ARG_MAX - imgp->args->stringspace), sizeof(char *));
 
 	/*
@@ -208,6 +214,15 @@ ia32_copyout_strings(struct image_params
 			((caddr_t)arginfo - szsigcode), szsigcode);
 
 	/*
+	 * Copy the image path for the rtld.
+	 */
+	if (execpath_len != 0) {
+		imgp->execpathp = (uintptr_t)arginfo - szsigcode - execpath_len;
+		copyout(imgp->execpath, (void *)imgp->execpathp,
+		    execpath_len);
+	}
+
+	/*
 	 * If we have a valid auxargs ptr, prepare some room
 	 * on the stack.
 	 */
@@ -223,9 +238,9 @@ ia32_copyout_strings(struct image_params
 		 * the arg and env vector sets,and imgp->auxarg_size is room
 		 * for argument of Runtime loader.
 		 */
-		vectp = (u_int32_t *) (destp - (imgp->args->argc + imgp->args->envc + 2 +
-				       imgp->auxarg_size) * sizeof(u_int32_t));
-
+		vectp = (u_int32_t *) (destp - (imgp->args->argc +
+		    imgp->args->envc + 2 + imgp->auxarg_size + execpath_len) *
+		    sizeof(u_int32_t));
 	} else
 		/*
 		 * The '+ 2' is for the null pointers at the end of each of

Modified: head/sys/kern/imgact_elf.c
==============================================================================
--- head/sys/kern/imgact_elf.c	Tue Mar 17 12:50:16 2009	(r189926)
+++ head/sys/kern/imgact_elf.c	Tue Mar 17 12:53:28 2009	(r189927)
@@ -885,6 +885,8 @@ __elfN(freebsd_fixup)(register_t **stack
 	AUXARGS_ENTRY(pos, AT_FLAGS, args->flags);
 	AUXARGS_ENTRY(pos, AT_ENTRY, args->entry);
 	AUXARGS_ENTRY(pos, AT_BASE, args->base);
+	if (imgp->execpathp != 0)
+		AUXARGS_ENTRY(pos, AT_EXECPATH, imgp->execpathp);
 	AUXARGS_ENTRY(pos, AT_NULL, 0);
 
 	free(imgp->auxargs, M_TEMP);

Modified: head/sys/kern/kern_exec.c
==============================================================================
--- head/sys/kern/kern_exec.c	Tue Mar 17 12:50:16 2009	(r189926)
+++ head/sys/kern/kern_exec.c	Tue Mar 17 12:53:28 2009	(r189927)
@@ -379,6 +379,8 @@ do_execve(td, args, mac_p)
 	imgp->ps_strings = 0;
 	imgp->auxarg_size = 0;
 	imgp->args = args;
+	imgp->execpath = imgp->freepath = NULL;
+	imgp->execpathp = 0;
 
 #ifdef MAC
 	error = mac_execve_enter(imgp, mac_p);
@@ -519,6 +521,15 @@ interpret:
 	 * of the sv_copyout_strings/sv_fixup operations require the vnode.
 	 */
 	VOP_UNLOCK(imgp->vp, 0);
+
+	/*
+	 * Do the best to calculate the full path to the image file.
+	 */
+	if (imgp->auxargs != NULL &&
+	    ((args->fname != NULL && args->fname[0] == '/') ||
+	     vn_fullpath(td, imgp->vp, &imgp->execpath, &imgp->freepath) != 0))
+		imgp->execpath = args->fname;
+
 	/*
 	 * Copy out strings (args and env) and initialize stack base
 	 */
@@ -859,6 +870,8 @@ exec_fail_dealloc:
 	if (imgp->object != NULL)
 		vm_object_deallocate(imgp->object);
 
+	free(imgp->freepath, M_TEMP);
+
 	if (error == 0) {
 		/*
 		 * Stop the process here if its stop event mask has
@@ -1164,18 +1177,24 @@ exec_copyout_strings(imgp)
 	register_t *stack_base;
 	struct ps_strings *arginfo;
 	struct proc *p;
+	size_t execpath_len;
 	int szsigcode;
 
 	/*
 	 * Calculate string base and vector table pointers.
 	 * Also deal with signal trampoline code for this exec type.
 	 */
+	if (imgp->execpath != NULL && imgp->auxargs != NULL)
+		execpath_len = strlen(imgp->execpath) + 1;
+	else
+		execpath_len = 0;
 	p = imgp->proc;
 	szsigcode = 0;
 	arginfo = (struct ps_strings *)p->p_sysent->sv_psstrings;
 	if (p->p_sysent->sv_szsigcode != NULL)
 		szsigcode = *(p->p_sysent->sv_szsigcode);
 	destp =	(caddr_t)arginfo - szsigcode - SPARE_USRSPACE -
+	    roundup(execpath_len, sizeof(char *)) -
 	    roundup((ARG_MAX - imgp->args->stringspace), sizeof(char *));
 
 	/*
@@ -1186,6 +1205,15 @@ exec_copyout_strings(imgp)
 		    szsigcode), szsigcode);
 
 	/*
+	 * Copy the image path for the rtld.
+	 */
+	if (execpath_len != 0) {
+		imgp->execpathp = (uintptr_t)arginfo - szsigcode - execpath_len;
+		copyout(imgp->execpath, (void *)imgp->execpathp,
+		    execpath_len);
+	}
+
+	/*
 	 * If we have a valid auxargs ptr, prepare some room
 	 * on the stack.
 	 */
@@ -1202,9 +1230,8 @@ exec_copyout_strings(imgp)
 		 * for argument of Runtime loader.
 		 */
 		vectp = (char **)(destp - (imgp->args->argc +
-		    imgp->args->envc + 2 + imgp->auxarg_size) *
+		    imgp->args->envc + 2 + imgp->auxarg_size + execpath_len) *
 		    sizeof(char *));
-
 	} else {
 		/*
 		 * The '+ 2' is for the null pointers at the end of each of

Modified: head/sys/sys/imgact.h
==============================================================================
--- head/sys/sys/imgact.h	Tue Mar 17 12:50:16 2009	(r189926)
+++ head/sys/sys/imgact.h	Tue Mar 17 12:53:28 2009	(r189927)
@@ -66,6 +66,9 @@ struct image_params {
 	size_t auxarg_size;
 	struct image_args *args;	/* system call arguments */
 	struct sysentvec *sysent;	/* system entry vector */
+	char *execpath;
+	unsigned long execpathp;
+	char *freepath;
 };
 
 #ifdef _KERNEL

From owner-svn-src-head@FreeBSD.ORG  Tue Mar 17 13:07:12 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1C20D1065741;
	Tue, 17 Mar 2009 13:07:12 +0000 (UTC)
	(envelope-from sbruno@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 09E028FC0C;
	Tue, 17 Mar 2009 13:07:12 +0000 (UTC)
	(envelope-from sbruno@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2HD7BVh095717;
	Tue, 17 Mar 2009 13:07:11 GMT (envelope-from sbruno@svn.freebsd.org)
Received: (from sbruno@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2HD7BKS095716;
	Tue, 17 Mar 2009 13:07:11 GMT (envelope-from sbruno@svn.freebsd.org)
Message-Id: <200903171307.n2HD7BKS095716@svn.freebsd.org>
From: Sean Bruno 
Date: Tue, 17 Mar 2009 13:07: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: r189928 - head/sys/dev/firewire
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 17 Mar 2009 13:07:12 -0000

Author: sbruno
Date: Tue Mar 17 13:07:11 2009
New Revision: 189928
URL: http://svn.freebsd.org/changeset/base/189928

Log:
  Reviewed by:	scott (scottl@freebsd.org)
  Obtained from:	Hideotshi Shimokawa
  
  This update is based on comments from Hidetoshi.
  
  Changeset 183550 removed the call to crom_load() in fw_busreset().  Restore
  that call such that the Configuration ROM is valid.
  
  Stash and update fwdev settings in fw_explore_node() so that negotiation
  works again.

Modified:
  head/sys/dev/firewire/firewire.c

Modified: head/sys/dev/firewire/firewire.c
==============================================================================
--- head/sys/dev/firewire/firewire.c	Tue Mar 17 12:53:28 2009	(r189927)
+++ head/sys/dev/firewire/firewire.c	Tue Mar 17 13:07:11 2009	(r189928)
@@ -685,7 +685,8 @@ fw_init_crom(struct firewire_comm *fc)
 	src->businfo.cyc_clk_acc = 100;
 	src->businfo.max_rec = fc->maxrec;
 	src->businfo.max_rom = MAXROM_4;
-	src->businfo.generation = 0;
+#define FW_GENERATION_CHANGEABLE 2
+	src->businfo.generation = FW_GENERATION_CHANGEABLE;
 	src->businfo.link_spd = fc->speed;
 
 	src->businfo.eui64.hi = fc->eui.hi;
@@ -734,6 +735,7 @@ fw_busreset(struct firewire_comm *fc, ui
 	struct firewire_dev_comm *fdc;
 	struct crom_src *src;
 	device_t *devlistp;
+	uint32_t *newrom;
 	int i, devcnt;
 
 	FW_GLOCK_ASSERT(fc);
@@ -759,18 +761,31 @@ fw_busreset(struct firewire_comm *fc, ui
 	}
 
 	src = &fc->crom_src_buf->src;
-	/*
-	 * If the old config rom needs to be overwritten,
-	 * bump the businfo.generation indicator to 
-	 * indicate that we need to be reprobed
-	 */
-	if (bcmp(src, fc->config_rom, CROMSIZE) != 0) {
-		/* generation is a 2 bit field */
-		/* valid values are only from 0 - 3 */
-		src->businfo.generation = 1;
-		bcopy(src, (void *)fc->config_rom, CROMSIZE);
-	} else
-		src->businfo.generation = 0;
+        /*
+         * If the old config rom needs to be overwritten,
+         * bump the businfo.generation indicator to 
+         * indicate that we need to be reprobed
+         * See 1394a-2000 8.3.2.5.4 for more details.
+         * generation starts at 2 and rolls over at 0xF
+         * back to 2.
+         * 
+         * A generation of 0 indicates a device
+         * that is not 1394a-2000 compliant.
+         * A generation of 1 indicates a device that
+         * does not change it's Bus Info Block or 
+         * Configuration ROM.
+         */
+#define FW_MAX_GENERATION 0xF
+	newrom = malloc(CROMSIZE, M_FW, M_NOWAIT | M_ZERO);
+	src = &fc->crom_src_buf->src;
+	crom_load(src, newrom, CROMSIZE);
+	if (bcmp(newrom, fc->config_rom, CROMSIZE) != 0) {
+		if ( src->businfo.generation++ > FW_MAX_GENERATION )
+			src->businfo.generation = FW_GENERATION_CHANGEABLE;
+		bcopy(newrom, (void *)fc->config_rom, CROMSIZE);
+	}
+	free(newrom, M_FW);
+
 }
 
 /* Call once after reboot */
@@ -1590,6 +1605,10 @@ fw_explore_node(struct fw_device *dfwdev
 		}
 		fwdev->fc = fc;
 		fwdev->eui = binfo->eui64;
+		fwdev->dst = dfwdev->dst;
+		fwdev->maxrec = dfwdev->maxrec;
+		fwdev->status = dfwdev->status;
+
 		/*
 		 * Pre-1394a-2000 didn't have link_spd in
 		 * the Bus Info block, so try and use the 
@@ -1599,7 +1618,7 @@ fw_explore_node(struct fw_device *dfwdev
 		 * ignore the speed map alltogether. SWB
 		 */
 		if ( binfo->link_spd == FWSPD_S100 /* 0 */) {
-			device_printf(fc->bdev, "%s"
+			device_printf(fc->bdev, "%s: "
 				"Pre 1394a-2000 detected\n",
 				__func__);
 			fwdev->speed = fc->speed_map->speed[fc->nodeid][node];
@@ -1609,21 +1628,19 @@ fw_explore_node(struct fw_device *dfwdev
 		 * Test this speed with a read to the CSRROM.
 		 * If it fails, slow down the speed and retry.
 		 */
-		while (fwdev->speed > 0) {
+		while (fwdev->speed > FWSPD_S100 /* 0 */) {
 			err = fw_explore_read_quads(fwdev, CSRROMOFF,
             				&speed_test, 1);
-			if (err)
+			if (err) {
+				device_printf(fc->bdev, "%s: fwdev->speed(%s)"
+						" decremented due to negotiation\n",
+						__func__,
+						linkspeed[fwdev->speed]);
 				fwdev->speed--;
-			else
+			} else
 				break;
 				
 		}
-		if (fwdev->speed != binfo->link_spd)
-			device_printf(fc->bdev, "%s: fwdev->speed(%s)"
-						" set lower than binfo->link_spd(%s)\n",
-						__func__,
-						linkspeed[fwdev->speed],
-						linkspeed[binfo->link_spd]);
 		/* inesrt into sorted fwdev list */
 		pfwdev = NULL;
 		STAILQ_FOREACH(tfwdev, &fc->devices, link) {
@@ -1641,15 +1658,15 @@ fw_explore_node(struct fw_device *dfwdev
 		device_printf(fc->bdev, "New %s device ID:%08x%08x\n",
 		    linkspeed[fwdev->speed],
 		    fwdev->eui.hi, fwdev->eui.lo);
-	}
-	fwdev->dst = node;
-	fwdev->status = FWDEVINIT;
-
-	/* unchanged ? */
-	if (bcmp(&csr[0], &fwdev->csrrom[0], sizeof(uint32_t) * 5) == 0) {
-		if (firewire_debug)
-			device_printf(fc->dev, "node%d: crom unchanged\n", node);
-		return (0);
+	} else {
+		fwdev->dst = node;
+		fwdev->status = FWDEVINIT;
+		/* unchanged ? */
+		if (bcmp(&csr[0], &fwdev->csrrom[0], sizeof(uint32_t) * 5) == 0) {
+			if (firewire_debug)
+				device_printf(fc->dev, "node%d: crom unchanged\n", node);
+			return (0);
+		}
 	}
 
 	bzero(&fwdev->csrrom[0], CROMSIZE);
@@ -1661,6 +1678,9 @@ fw_explore_node(struct fw_device *dfwdev
 	err = fw_explore_csrblock(fwdev, 0x14, 1); /* root directory */
 
 	if (err) {
+		if (firewire_debug)
+			device_printf(fc->dev, "%s: explore csrblock failed err(%d)\n",
+					__func__, err);
 		fwdev->status = FWDEVINVAL;
 		fwdev->csrrom[0] = 0;
 	}

From owner-svn-src-head@FreeBSD.ORG  Tue Mar 17 14:41:54 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 81EEF10656D9;
	Tue, 17 Mar 2009 14:41:54 +0000 (UTC) (envelope-from bms@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 627878FC0C;
	Tue, 17 Mar 2009 14:41:54 +0000 (UTC) (envelope-from bms@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2HEfswP097765;
	Tue, 17 Mar 2009 14:41:54 GMT (envelope-from bms@svn.freebsd.org)
Received: (from bms@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2HEfsam097762;
	Tue, 17 Mar 2009 14:41:54 GMT (envelope-from bms@svn.freebsd.org)
Message-Id: <200903171441.n2HEfsam097762@svn.freebsd.org>
From: Bruce M Simpson 
Date: Tue, 17 Mar 2009 14:41: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: r189931 - 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: Tue, 17 Mar 2009 14:41:56 -0000

Author: bms
Date: Tue Mar 17 14:41:54 2009
New Revision: 189931
URL: http://svn.freebsd.org/changeset/base/189931

Log:
  Deal with the case where ifma_protospec may be NULL, during
  any IPv4 multicast operations which reference it.
  
  There is a potential race because ifma_protospec is set to NULL
  when we discover the underlying ifnet has gone away. This write
  is not covered by the IF_ADDR_LOCK, and it's difficult to widen
  its scope without making it a recursive lock. It isn't clear why
  this manifests more quickly with 802.11 interfaces, but does not
  seem to manifest at all with wired interfaces.
  
  With this change, the 802.11 related panics reported by sam@
  and cokane@ should go away. It is not the right fix, that requires
  more thought before 8.0.
  
  Idea from:	sam
  Tested by:	cokane

Modified:
  head/sys/netinet/igmp.c
  head/sys/netinet/in.c
  head/sys/netinet/in_mcast.c

Modified: head/sys/netinet/igmp.c
==============================================================================
--- head/sys/netinet/igmp.c	Tue Mar 17 14:29:25 2009	(r189930)
+++ head/sys/netinet/igmp.c	Tue Mar 17 14:41:54 2009	(r189931)
@@ -183,6 +183,11 @@ static int	vnet_igmp_idetach(const void 
  * VIMAGE: Each in_multi corresponds to an ifp, and each ifp corresponds
  * to a vnet in ifp->if_vnet.
  *
+ * SMPng: XXX We may potentially race operations on ifma_protospec.
+ * The problem is that we currently lack a clean way of taking the
+ * IF_ADDR_LOCK() between the ifnet and in layers w/o recursing,
+ * as anything which modifies ifma needs to be covered by that lock.
+ * So check for ifma_protospec being NULL before proceeding.
  */
 struct mtx		 igmp_mtx;
 int			 mpsafe_igmp = 0;
@@ -601,6 +606,7 @@ out:
  * is detached, but also before the link layer does its cleanup.
  *
  * SMPNG: igmp_ifdetach() needs to take IF_ADDR_LOCK().
+ * XXX This is also bitten by unlocked ifma_protospec access.
  *
  * VIMAGE: curvnet should have been set by caller, but let's not assume
  * that for now.
@@ -623,8 +629,13 @@ igmp_ifdetach(struct ifnet *ifp)
 	if (igi->igi_version == IGMP_VERSION_3) {
 		IF_ADDR_LOCK(ifp);
 		TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
-			if (ifma->ifma_addr->sa_family != AF_INET)
+			if (ifma->ifma_addr->sa_family != AF_INET ||
+			    ifma->ifma_protospec == NULL)
 				continue;
+#if 0
+			KASSERT(ifma->ifma_protospec != NULL,
+			    ("%s: ifma_protospec is NULL", __func__));
+#endif
 			inm = (struct in_multi *)ifma->ifma_protospec;
 			if (inm->inm_state == IGMP_LEAVING_MEMBER) {
 				SLIST_INSERT_HEAD(&igi->igi_relinmhead,
@@ -783,7 +794,8 @@ igmp_input_v1_query(struct ifnet *ifp, c
 	 */
 	IF_ADDR_LOCK(ifp);
 	TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
-		if (ifma->ifma_addr->sa_family != AF_INET)
+		if (ifma->ifma_addr->sa_family != AF_INET ||
+		    ifma->ifma_protospec == NULL)
 			continue;
 		inm = (struct in_multi *)ifma->ifma_protospec;
 		if (inm->inm_timer != 0)
@@ -880,7 +892,8 @@ igmp_input_v2_query(struct ifnet *ifp, c
 
 			IF_ADDR_LOCK(ifp);
 			TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
-				if (ifma->ifma_addr->sa_family != AF_INET)
+				if (ifma->ifma_addr->sa_family != AF_INET ||
+				    ifma->ifma_protospec == NULL)
 					continue;
 				inm = (struct in_multi *)ifma->ifma_protospec;
 				igmp_v2_update_group(inm, timer);
@@ -1701,7 +1714,8 @@ igmp_fasttimo_vnet(void)
 		IF_ADDR_LOCK(ifp);
 		TAILQ_FOREACH_SAFE(ifma, &ifp->if_multiaddrs, ifma_link,
 		    tifma) {
-			if (ifma->ifma_addr->sa_family != AF_INET)
+			if (ifma->ifma_addr->sa_family != AF_INET ||
+			    ifma->ifma_protospec == NULL)
 				continue;
 			inm = (struct in_multi *)ifma->ifma_protospec;
 			switch (igi->igi_version) {
@@ -3311,7 +3325,8 @@ igmp_v3_dispatch_general_query(struct ig
 
 	IF_ADDR_LOCK(ifp);
 	TAILQ_FOREACH_SAFE(ifma, &ifp->if_multiaddrs, ifma_link, tifma) {
-		if (ifma->ifma_addr->sa_family != AF_INET)
+		if (ifma->ifma_addr->sa_family != AF_INET ||
+		    ifma->ifma_protospec == NULL)
 			continue;
 
 		inm = (struct in_multi *)ifma->ifma_protospec;

Modified: head/sys/netinet/in.c
==============================================================================
--- head/sys/netinet/in.c	Tue Mar 17 14:29:25 2009	(r189930)
+++ head/sys/netinet/in.c	Tue Mar 17 14:41:54 2009	(r189931)
@@ -1011,6 +1011,8 @@ in_ifdetach(struct ifnet *ifp)
  * Delete all IPv4 multicast address records, and associated link-layer
  * multicast address records, associated with ifp.
  * XXX It looks like domifdetach runs AFTER the link layer cleanup.
+ * XXX This should not race with ifma_protospec being set during
+ * a new allocation, if it does, we have bigger problems.
  */
 static void
 in_purgemaddrs(struct ifnet *ifp)
@@ -1031,8 +1033,13 @@ in_purgemaddrs(struct ifnet *ifp)
 	 */
 	IF_ADDR_LOCK(ifp);
 	TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
-		if (ifma->ifma_addr->sa_family != AF_INET)
+		if (ifma->ifma_addr->sa_family != AF_INET ||
+		    ifma->ifma_protospec == NULL)
 			continue;
+#if 0
+		KASSERT(ifma->ifma_protospec != NULL,
+		    ("%s: ifma_protospec is NULL", __func__));
+#endif
 		inm = (struct in_multi *)ifma->ifma_protospec;
 		LIST_INSERT_HEAD(&purgeinms, inm, inm_link);
 	}

Modified: head/sys/netinet/in_mcast.c
==============================================================================
--- head/sys/netinet/in_mcast.c	Tue Mar 17 14:29:25 2009	(r189930)
+++ head/sys/netinet/in_mcast.c	Tue Mar 17 14:41:54 2009	(r189931)
@@ -432,6 +432,9 @@ in_getmulti(struct ifnet *ifp, const str
 	if (error != 0)
 		return (error);
 
+	/* XXX ifma_protospec must be covered by IF_ADDR_LOCK */
+	IF_ADDR_LOCK(ifp);
+
 	/*
 	 * If something other than netinet is occupying the link-layer
 	 * group, print a meaningful error message and back out of
@@ -454,9 +457,12 @@ in_getmulti(struct ifnet *ifp, const str
 #endif
 		++inm->inm_refcount;
 		*pinm = inm;
+		IF_ADDR_UNLOCK(ifp);
 		return (0);
 	}
 
+	IF_ADDR_LOCK_ASSERT(ifp);
+
 	/*
 	 * A new in_multi record is needed; allocate and initialize it.
 	 * We DO NOT perform an IGMP join as the in_ layer may need to
@@ -467,6 +473,7 @@ in_getmulti(struct ifnet *ifp, const str
 	inm = malloc(sizeof(*inm), M_IPMADDR, M_NOWAIT | M_ZERO);
 	if (inm == NULL) {
 		if_delmulti_ifma(ifma);
+		IF_ADDR_UNLOCK(ifp);
 		return (ENOMEM);
 	}
 	inm->inm_addr = *group;
@@ -489,6 +496,7 @@ in_getmulti(struct ifnet *ifp, const str
 
 	*pinm = inm;
 
+	IF_ADDR_UNLOCK(ifp);
 	return (0);
 }
 
@@ -522,6 +530,7 @@ inm_release_locked(struct in_multi *inm)
 
 	ifma = inm->inm_ifma;
 
+	/* XXX this access is not covered by IF_ADDR_LOCK */
 	CTR2(KTR_IGMPV3, "%s: purging ifma %p", __func__, ifma);
 	KASSERT(ifma->ifma_protospec == inm,
 	    ("%s: ifma_protospec != inm", __func__));

From owner-svn-src-head@FreeBSD.ORG  Tue Mar 17 14:53:43 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4D1031065784;
	Tue, 17 Mar 2009 14:53:43 +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 1E5038FC20;
	Tue, 17 Mar 2009 14:53:43 +0000 (UTC)
	(envelope-from fabient@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2HErhIn098028;
	Tue, 17 Mar 2009 14:53:43 GMT (envelope-from fabient@svn.freebsd.org)
Received: (from fabient@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2HErgLO098026;
	Tue, 17 Mar 2009 14:53:42 GMT (envelope-from fabient@svn.freebsd.org)
Message-Id: <200903171453.n2HErgLO098026@svn.freebsd.org>
From: Fabien Thomas 
Date: Tue, 17 Mar 2009 14:53: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: r189932 - in head: share/misc usr.bin/calendar/calendars
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 17 Mar 2009 14:53:47 -0000

Author: fabient
Date: Tue Mar 17 14:53:42 2009
New Revision: 189932
URL: http://svn.freebsd.org/changeset/base/189932

Log:
  Add information about me as a new committer to the src tree
  
  Approved by:	jkoshy (mentor)

Modified:
  head/share/misc/committers-src.dot
  head/usr.bin/calendar/calendars/calendar.freebsd

Modified: head/share/misc/committers-src.dot
==============================================================================
--- head/share/misc/committers-src.dot	Tue Mar 17 14:41:54 2009	(r189931)
+++ head/share/misc/committers-src.dot	Tue Mar 17 14:53:42 2009	(r189932)
@@ -88,6 +88,7 @@ eik [label="Oliver Eikemeier\neik@FreeBS
 emaste [label="Ed Maste\nemaste@FreeBSD.org\n2005/10/04"]
 emax [label="Maksim Yevmenkin\nemax@FreeBSD.org\n2003/10/12"]
 eri [label="Ermal Luci\neri@FreeBSD.org\n2008/06/11"]
+fabient [label="Fabien Thomas\nfabient@FreeBSD.org\n2009/03/16"]
 fanf [label="Tony Finch\nfanf@FreeBSD.org\n2002/05/05"]
 fjoe [label="Max Khon\nfjoe@FreeBSD.org\n2001/08/06"]
 flz [label="Florent Thoumie\nflz@FreeBSD.org\n2006/03/30"]
@@ -314,6 +315,7 @@ jkh -> wes
 jkh -> yar
 
 jkoshy -> kaiw
+jkoshy -> fabient
 
 jlemon -> bmilekic
 jlemon -> brooks

Modified: head/usr.bin/calendar/calendars/calendar.freebsd
==============================================================================
--- head/usr.bin/calendar/calendars/calendar.freebsd	Tue Mar 17 14:41:54 2009	(r189931)
+++ head/usr.bin/calendar/calendars/calendar.freebsd	Tue Mar 17 14:53:42 2009	(r189932)
@@ -28,6 +28,7 @@
 01/22	Johann Visagie  born in Cape Town, South Africa, 1970
 01/23	Hideyuki KURASHINA  born in Niigata, Japan, 1982
 01/24	Matteo Riondato  born in Padova, Italy, 1986
+01/24	Fabien Thomas  born in Avignon, France, 1971
 01/25	Bernd Walter  born in Moers, Nordrhein-Westfalen, Germany, 1974
 01/26	Andrew Gallatin  born in Buffalo, New York, United States, 1970
 01/27	Nick Sayer  born in San Diego, California, United States, 1968

From owner-svn-src-head@FreeBSD.ORG  Tue Mar 17 16:30:49 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E60951065676;
	Tue, 17 Mar 2009 16:30:49 +0000 (UTC)
	(envelope-from attilio@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D344F8FC12;
	Tue, 17 Mar 2009 16:30:49 +0000 (UTC)
	(envelope-from attilio@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2HGUnsw099800;
	Tue, 17 Mar 2009 16:30:49 GMT (envelope-from attilio@svn.freebsd.org)
Received: (from attilio@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2HGUnPP099799;
	Tue, 17 Mar 2009 16:30:49 GMT (envelope-from attilio@svn.freebsd.org)
Message-Id: <200903171630.n2HGUnPP099799@svn.freebsd.org>
From: Attilio Rao 
Date: Tue, 17 Mar 2009 16:30: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: r189933 - 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, 17 Mar 2009 16:30:50 -0000

Author: attilio
Date: Tue Mar 17 16:30:49 2009
New Revision: 189933
URL: http://svn.freebsd.org/changeset/base/189933

Log:
  Fix an old-standing bug that crept in along the several revisions:
  B_DELWRI cleanup and vnode disassociation should happen just before to
  assign the buffer to a queue.
  
  Reported by:	miwi, Volker ,
  		Ben Kaduk ,
  		Christopher Mallon 
  Tested by:	lulf, miwi

Modified:
  head/sys/kern/vfs_bio.c

Modified: head/sys/kern/vfs_bio.c
==============================================================================
--- head/sys/kern/vfs_bio.c	Tue Mar 17 14:53:42 2009	(r189932)
+++ head/sys/kern/vfs_bio.c	Tue Mar 17 16:30:49 2009	(r189933)
@@ -1369,9 +1369,23 @@ brelse(struct buf *bp)
 	if (bp->b_qindex != QUEUE_NONE)
 		panic("brelse: free buffer onto another queue???");
 
+	/*
+	 * If the buffer has junk contents signal it and eventually
+	 * clean up B_DELWRI and diassociate the vnode so that gbincore()
+	 * doesn't find it.
+	 */
+	if (bp->b_bufsize == 0 || (bp->b_ioflags & BIO_ERROR) != 0 ||
+	    (bp->b_flags & (B_INVAL | B_NOCACHE | B_RELBUF)) != 0)
+		bp->b_flags |= B_INVAL;
+	if (bp->b_flags & B_INVAL) {
+		if (bp->b_flags & B_DELWRI)
+			bundirty(bp);
+		if (bp->b_vp)
+			brelvp(bp);
+	}
+
 	/* buffers with no memory */
 	if (bp->b_bufsize == 0) {
-		bp->b_flags |= B_INVAL;
 		bp->b_xflags &= ~(BX_BKGRDWRITE | BX_ALTDATA);
 		if (bp->b_vflags & BV_BKGRDINPROG)
 			panic("losing buffer 1");
@@ -1384,7 +1398,6 @@ brelse(struct buf *bp)
 	/* buffers with junk contents */
 	} else if (bp->b_flags & (B_INVAL | B_NOCACHE | B_RELBUF) ||
 	    (bp->b_ioflags & BIO_ERROR)) {
-		bp->b_flags |= B_INVAL;
 		bp->b_xflags &= ~(BX_BKGRDWRITE | BX_ALTDATA);
 		if (bp->b_vflags & BV_BKGRDINPROG)
 			panic("losing buffer 2");
@@ -1407,19 +1420,6 @@ brelse(struct buf *bp)
 	mtx_unlock(&bqlock);
 
 	/*
-	 * If B_INVAL and B_DELWRI is set, clear B_DELWRI.  We have already
-	 * placed the buffer on the correct queue.  We must also disassociate
-	 * the device and vnode for a B_INVAL buffer so gbincore() doesn't
-	 * find it.
-	 */
-	if (bp->b_flags & B_INVAL) {
-		if (bp->b_flags & B_DELWRI)
-			bundirty(bp);
-		if (bp->b_vp)
-			brelvp(bp);
-	}
-
-	/*
 	 * Fixup numfreebuffers count.  The bp is on an appropriate queue
 	 * unless locked.  We then bump numfreebuffers if it is not B_DELWRI.
 	 * We've already handled the B_INVAL case ( B_DELWRI will be clear

From owner-svn-src-head@FreeBSD.ORG  Tue Mar 17 19:37:48 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 06DCD1065705;
	Tue, 17 Mar 2009 19:37:48 +0000 (UTC)
	(envelope-from dwmalone@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E7D348FC12;
	Tue, 17 Mar 2009 19:37:47 +0000 (UTC)
	(envelope-from dwmalone@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2HJbl4N004445;
	Tue, 17 Mar 2009 19:37:47 GMT
	(envelope-from dwmalone@svn.freebsd.org)
Received: (from dwmalone@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2HJblWL004444;
	Tue, 17 Mar 2009 19:37:47 GMT
	(envelope-from dwmalone@svn.freebsd.org)
Message-Id: <200903171937.n2HJblWL004444@svn.freebsd.org>
From: David Malone 
Date: Tue, 17 Mar 2009 19: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: r189934 - 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: Tue, 17 Mar 2009 19:37:50 -0000

Author: dwmalone
Date: Tue Mar 17 19:37:47 2009
New Revision: 189934
URL: http://svn.freebsd.org/changeset/base/189934

Log:
  Fix some warns - mainly signedness and unused variables.

Modified:
  head/usr.bin/ministat/ministat.c

Modified: head/usr.bin/ministat/ministat.c
==============================================================================
--- head/usr.bin/ministat/ministat.c	Tue Mar 17 16:30:49 2009	(r189933)
+++ head/usr.bin/ministat/ministat.c	Tue Mar 17 19:37:47 2009	(r189934)
@@ -136,7 +136,7 @@ struct dataset {
 	double	*points;
 	unsigned lpoints;
 	double sy, syy;
-	int n;
+	unsigned n;
 };
 
 static struct dataset *
@@ -191,8 +191,6 @@ Avg(struct dataset *ds)
 static double
 Median(struct dataset *ds)
 {
-	int even, i;
-	struct point *p1, *p2;
 
 	return (ds->points[ds->n / 2]);
 }
@@ -317,8 +315,8 @@ static void
 PlotSet(struct dataset *ds, int val)
 {
 	struct plot *pl;
-	struct point *pp;
-	int i, j, m, x, n;
+	int i, j, m, x;
+	unsigned n;
 	int bar;
 
 	pl = &plot;

From owner-svn-src-head@FreeBSD.ORG  Tue Mar 17 19:51:04 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9BE941065670;
	Tue, 17 Mar 2009 19:51:04 +0000 (UTC)
	(envelope-from dwmalone@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 6F51C8FC15;
	Tue, 17 Mar 2009 19:51:04 +0000 (UTC)
	(envelope-from dwmalone@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2HJp4gn004810;
	Tue, 17 Mar 2009 19:51:04 GMT
	(envelope-from dwmalone@svn.freebsd.org)
Received: (from dwmalone@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2HJp4ER004808;
	Tue, 17 Mar 2009 19:51:04 GMT
	(envelope-from dwmalone@svn.freebsd.org)
Message-Id: <200903171951.n2HJp4ER004808@svn.freebsd.org>
From: David Malone 
Date: Tue, 17 Mar 2009 19:51: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: r189936 - head/release/picobsd/tinyware/simple_httpd
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 17 Mar 2009 19:51:05 -0000

Author: dwmalone
Date: Tue Mar 17 19:51:04 2009
New Revision: 189936
URL: http://svn.freebsd.org/changeset/base/189936

Log:
  Warns fixes: use putenv rather than setenv to avoid constness problems,
  when we want to print an off_t cast to intmax_t and use %jd.
  
  Up WARNS to 6.

Modified:
  head/release/picobsd/tinyware/simple_httpd/Makefile
  head/release/picobsd/tinyware/simple_httpd/simple_httpd.c

Modified: head/release/picobsd/tinyware/simple_httpd/Makefile
==============================================================================
--- head/release/picobsd/tinyware/simple_httpd/Makefile	Tue Mar 17 19:38:40 2009	(r189935)
+++ head/release/picobsd/tinyware/simple_httpd/Makefile	Tue Mar 17 19:51:04 2009	(r189936)
@@ -3,5 +3,6 @@
 PROG=simple_httpd
 SRCS= 	simple_httpd.c
 NO_MAN=
+WARNS?=6
 
 .include 

Modified: head/release/picobsd/tinyware/simple_httpd/simple_httpd.c
==============================================================================
--- head/release/picobsd/tinyware/simple_httpd/simple_httpd.c	Tue Mar 17 19:38:40 2009	(r189935)
+++ head/release/picobsd/tinyware/simple_httpd/simple_httpd.c	Tue Mar 17 19:51:04 2009	(r189936)
@@ -42,6 +42,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -278,7 +279,7 @@ http_request(void)
                /*printf("HTTP/1.0 200 OK\nContent-type: text/html\n\n\n");*/
 	       printf("HTTP/1.0 200 OK\r\n");
                /* Plug in environment variable, others in log_line */
-	       putenv("SERVER_SOFTWARE=FreeBSD/PicoBSD");
+	       setenv("SERVER_SOFTWARE", "FreeBSD/PicoBSD", 1);
 
 	       execlp (filename,filename,par,(char *)0);
               } 
@@ -331,7 +332,7 @@ http_request(void)
 	http_output(httpd_server_ident);
 	http_date();
 
-	sprintf(buff, "Content-length: %lld\r\n", file_status.st_size);
+	sprintf(buff, "Content-length: %jd\r\n", (intmax_t)file_status.st_size);
 	write(con_sock, buff, strlen(buff));
 
 	strcpy(buff, "Content-type: ");

From owner-svn-src-head@FreeBSD.ORG  Tue Mar 17 21:20:40 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3022A10656C4;
	Tue, 17 Mar 2009 21:20:40 +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 1765A8FC18;
	Tue, 17 Mar 2009 21:20:40 +0000 (UTC)
	(envelope-from delphij@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2HLKdND006652;
	Tue, 17 Mar 2009 21:20:39 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2HLKdo7006651;
	Tue, 17 Mar 2009 21:20:39 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <200903172120.n2HLKdo7006651@svn.freebsd.org>
From: Xin LI 
Date: Tue, 17 Mar 2009 21:20: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: r189939 - 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: Tue, 17 Mar 2009 21:20:40 -0000

Author: delphij
Date: Tue Mar 17 21:20:39 2009
New Revision: 189939
URL: http://svn.freebsd.org/changeset/base/189939

Log:
  Add prototypes for libusb20_be_[gs]et_template.

Modified:
  head/lib/libusb/libusb20.h

Modified: head/lib/libusb/libusb20.h
==============================================================================
--- head/lib/libusb/libusb20.h	Tue Mar 17 20:59:45 2009	(r189938)
+++ head/lib/libusb/libusb20.h	Tue Mar 17 21:20:39 2009	(r189939)
@@ -274,6 +274,8 @@ int	libusb20_be_get_dev_quirk(struct lib
 int	libusb20_be_get_quirk_name(struct libusb20_backend *pbe, uint16_t index, struct libusb20_quirk *pq);
 int	libusb20_be_add_dev_quirk(struct libusb20_backend *pbe, struct libusb20_quirk *pq);
 int	libusb20_be_remove_dev_quirk(struct libusb20_backend *pbe, struct libusb20_quirk *pq);
+int	libusb20_be_get_template(struct libusb20_backend *pbe, int *ptemp);
+int	libusb20_be_set_template(struct libusb20_backend *pbe, int temp);
 
 /* USB backend operations */
 

From owner-svn-src-head@FreeBSD.ORG  Tue Mar 17 21:21:34 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 55C5710656D5;
	Tue, 17 Mar 2009 21:21:34 +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 447408FC22;
	Tue, 17 Mar 2009 21:21:34 +0000 (UTC)
	(envelope-from delphij@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2HLLYSV006707;
	Tue, 17 Mar 2009 21:21:34 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2HLLYKu006706;
	Tue, 17 Mar 2009 21:21:34 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <200903172121.n2HLLYKu006706@svn.freebsd.org>
From: Xin LI 
Date: Tue, 17 Mar 2009 21:21:34 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r189940 - head/usr.sbin/usbconfig
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 17 Mar 2009 21:21:35 -0000

Author: delphij
Date: Tue Mar 17 21:21:33 2009
New Revision: 189940
URL: http://svn.freebsd.org/changeset/base/189940

Log:
  Remove unused local.  usbconfig(8) can now compile under
  WARNS=6.

Modified:
  head/usr.sbin/usbconfig/usbconfig.c

Modified: head/usr.sbin/usbconfig/usbconfig.c
==============================================================================
--- head/usr.sbin/usbconfig/usbconfig.c	Tue Mar 17 21:20:39 2009	(r189939)
+++ head/usr.sbin/usbconfig/usbconfig.c	Tue Mar 17 21:21:33 2009	(r189940)
@@ -501,7 +501,6 @@ main(int argc, char **argv)
 {
 	struct libusb20_backend *pbe;
 	struct options *opt = &options;
-	char *cp;
 	int n;
 	int t;
 

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 18 01:57:54 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 717FB106579A;
	Wed, 18 Mar 2009 01:57:54 +0000 (UTC)
	(envelope-from weongyo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 5E8838FC22;
	Wed, 18 Mar 2009 01:57:54 +0000 (UTC)
	(envelope-from weongyo@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2I1vskk011771;
	Wed, 18 Mar 2009 01:57:54 GMT (envelope-from weongyo@svn.freebsd.org)
Received: (from weongyo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2I1vs7v011770;
	Wed, 18 Mar 2009 01:57:54 GMT (envelope-from weongyo@svn.freebsd.org)
Message-Id: <200903180157.n2I1vs7v011770@svn.freebsd.org>
From: Weongyo Jeong 
Date: Wed, 18 Mar 2009 01:57: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: r189942 - head/sys/compat/ndis
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 18 Mar 2009 01:57:55 -0000

Author: weongyo
Date: Wed Mar 18 01:57:54 2009
New Revision: 189942
URL: http://svn.freebsd.org/changeset/base/189942

Log:
  If the caller sets irp_usriostat or irp_usrevent it try to process it
  whatever the IRP flag is because some drivers (eg. RTL8187L NDIS driver)
  call IoCompleteRequest() without setting flags.  It will prevent waiting
  a event forever at attach.

Modified:
  head/sys/compat/ndis/subr_ntoskrnl.c

Modified: head/sys/compat/ndis/subr_ntoskrnl.c
==============================================================================
--- head/sys/compat/ndis/subr_ntoskrnl.c	Wed Mar 18 01:57:26 2009	(r189941)
+++ head/sys/compat/ndis/subr_ntoskrnl.c	Wed Mar 18 01:57:54 2009	(r189942)
@@ -1197,6 +1197,11 @@ IofCompleteRequest(irp *ip, uint8_t prio
 		sl++;
 	} while (ip->irp_currentstackloc <= (ip->irp_stackcnt + 1));
 
+	if (ip->irp_usriostat != NULL)
+		*ip->irp_usriostat = ip->irp_iostat;
+	if (ip->irp_usrevent != NULL)
+		KeSetEvent(ip->irp_usrevent, prioboost, FALSE);
+
 	/* Handle any associated IRPs. */
 
 	if (ip->irp_flags & IRP_ASSOCIATED_IRP) {
@@ -1220,16 +1225,10 @@ IofCompleteRequest(irp *ip, uint8_t prio
 
 	/* With any luck, these conditions will never arise. */
 
-	if (ip->irp_flags & (IRP_PAGING_IO|IRP_CLOSE_OPERATION)) {
-		if (ip->irp_usriostat != NULL)
-			*ip->irp_usriostat = ip->irp_iostat;
-		if (ip->irp_usrevent != NULL)
-			KeSetEvent(ip->irp_usrevent, prioboost, FALSE);
-		if (ip->irp_flags & IRP_PAGING_IO) {
-			if (ip->irp_mdl != NULL)
-				IoFreeMdl(ip->irp_mdl);
-			IoFreeIrp(ip);
-		}
+	if (ip->irp_flags & IRP_PAGING_IO) {
+		if (ip->irp_mdl != NULL)
+			IoFreeMdl(ip->irp_mdl);
+		IoFreeIrp(ip);
 	}
 
 	return;

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 18 02:38:36 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 380951065675;
	Wed, 18 Mar 2009 02:38:36 +0000 (UTC)
	(envelope-from weongyo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 244AF8FC14;
	Wed, 18 Mar 2009 02:38:36 +0000 (UTC)
	(envelope-from weongyo@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2I2cauU012990;
	Wed, 18 Mar 2009 02:38:36 GMT (envelope-from weongyo@svn.freebsd.org)
Received: (from weongyo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2I2ca0a012987;
	Wed, 18 Mar 2009 02:38:36 GMT (envelope-from weongyo@svn.freebsd.org)
Message-Id: <200903180238.n2I2ca0a012987@svn.freebsd.org>
From: Weongyo Jeong 
Date: Wed, 18 Mar 2009 02:38: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: r189950 - in head/sys: compat/ndis dev/if_ndis
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 18 Mar 2009 02:38:36 -0000

Author: weongyo
Date: Wed Mar 18 02:38:35 2009
New Revision: 189950
URL: http://svn.freebsd.org/changeset/base/189950

Log:
  Some NDIS USB drivers try to call URB funcs like URB_FUNCTION_VENDOR_xxx
  or URB_FUNCTION_CLASS_xxx with HAL preemption lock that means it's
  non-sleepable during USB requests though usb2_do_request() requires a
  sleep so it needs to send queries to the default pipe without those
  interfaces to avoid sleep.

Modified:
  head/sys/compat/ndis/subr_usbd.c
  head/sys/dev/if_ndis/if_ndis_usb.c
  head/sys/dev/if_ndis/if_ndisvar.h

Modified: head/sys/compat/ndis/subr_usbd.c
==============================================================================
--- head/sys/compat/ndis/subr_usbd.c	Wed Mar 18 02:26:46 2009	(r189949)
+++ head/sys/compat/ndis/subr_usbd.c	Wed Mar 18 02:38:35 2009	(r189950)
@@ -77,6 +77,38 @@ __FBSDID("$FreeBSD$");
 
 static driver_object usbd_driver;
 static usb2_callback_t usbd_non_isoc_callback;
+static usb2_callback_t usbd_ctrl_callback;
+
+#define	USBD_CTRL_READ_PIPE		0
+#define	USBD_CTRL_WRITE_PIPE		1
+#define	USBD_CTRL_MAX_PIPE		2
+#define	USBD_CTRL_READ_BUFFER_SP	256
+#define	USBD_CTRL_READ_BUFFER_SIZE	\
+	(sizeof(struct usb2_device_request) + USBD_CTRL_READ_BUFFER_SP)
+#define	USBD_CTRL_WRITE_BUFFER_SIZE	\
+	(sizeof(struct usb2_device_request))
+static struct usb2_config usbd_default_epconfig[USBD_CTRL_MAX_PIPE] = {
+	[USBD_CTRL_READ_PIPE] = {
+		.type =		UE_CONTROL,
+		.endpoint =	0x00,	/* control pipe */
+		.direction =	UE_DIR_ANY,
+		.if_index =	0,
+		.mh.bufsize =	USBD_CTRL_READ_BUFFER_SIZE,
+		.mh.flags =	{ .short_xfer_ok = 1, },
+		.mh.callback =	&usbd_ctrl_callback,
+		.mh.timeout =	5000,	/* 5 seconds */
+	},
+	[USBD_CTRL_WRITE_PIPE] = {
+		.type =		UE_CONTROL,
+		.endpoint =	0x00,	/* control pipe */
+		.direction =	UE_DIR_ANY,
+		.if_index =	0,
+		.mh.bufsize =	USBD_CTRL_WRITE_BUFFER_SIZE,
+		.mh.flags =	{ .proxy_buffer = 1, },
+		.mh.callback =	&usbd_ctrl_callback,
+		.mh.timeout =	5000,	/* 5 seconds */
+	}
+};
 
 static int32_t		 usbd_func_bulkintr(irp *);
 static int32_t		 usbd_func_vendorclass(irp *);
@@ -84,6 +116,9 @@ static int32_t		 usbd_func_selconf(irp *
 static int32_t		 usbd_func_abort_pipe(irp *);
 static usb2_error_t	 usbd_setup_endpoint(irp *, uint8_t,
 			    struct usb2_endpoint_descriptor	*);
+static usb2_error_t	 usbd_setup_endpoint_default(irp *, uint8_t);
+static usb2_error_t	 usbd_setup_endpoint_one(irp *, uint8_t,
+			    struct ndisusb_ep *, struct usb2_config *);
 static int32_t		 usbd_func_getdesc(irp *);
 static union usbd_urb	*usbd_geturb(irp *);
 static struct ndisusb_ep*usbd_get_ndisep(irp *, usb_endpoint_descriptor_t *);
@@ -558,6 +593,57 @@ usbd_func_selconf(ip)
 }
 
 static usb2_error_t
+usbd_setup_endpoint_one(ip, ifidx, ne, epconf)
+	irp				*ip;
+	uint8_t				ifidx;
+	struct ndisusb_ep		*ne;
+	struct usb2_config		*epconf;
+{
+	device_t dev = IRP_NDIS_DEV(ip);
+	struct ndis_softc *sc = device_get_softc(dev);
+	struct usb2_xfer *xfer;
+	usb2_error_t status;
+
+	InitializeListHead(&ne->ne_active);
+	InitializeListHead(&ne->ne_pending);
+	KeInitializeSpinLock(&ne->ne_lock);
+
+	status = usb2_transfer_setup(sc->ndisusb_dev, &ifidx, ne->ne_xfer,
+	    epconf, 1, sc, &sc->ndisusb_mtx);
+	if (status != USB_ERR_NORMAL_COMPLETION) {
+		device_printf(dev, "couldn't setup xfer: %s\n",
+		    usb2_errstr(status));
+		return (status);
+	}
+	xfer = ne->ne_xfer[0];
+	xfer->priv_fifo = ne;
+
+	return (status);
+}
+
+static usb2_error_t
+usbd_setup_endpoint_default(ip, ifidx)
+	irp				*ip;
+	uint8_t				ifidx;
+{
+	device_t dev = IRP_NDIS_DEV(ip);
+	struct ndis_softc *sc = device_get_softc(dev);
+	usb2_error_t status;
+
+	if (ifidx > 0)
+		device_printf(dev, "warning: ifidx > 0 isn't supported.\n");
+
+	status = usbd_setup_endpoint_one(ip, ifidx, &sc->ndisusb_dread_ep,
+	    &usbd_default_epconfig[USBD_CTRL_READ_PIPE]);
+	if (status != USB_ERR_NORMAL_COMPLETION)
+		return (status);
+
+	status = usbd_setup_endpoint_one(ip, ifidx, &sc->ndisusb_dwrite_ep,
+	    &usbd_default_epconfig[USBD_CTRL_WRITE_PIPE]);
+	return (status);
+}
+
+static usb2_error_t
 usbd_setup_endpoint(ip, ifidx, ep)
 	irp				*ip;
 	uint8_t				ifidx;
@@ -644,62 +730,54 @@ usbd_func_vendorclass(ip)
 	irp			*ip;
 {
 	device_t dev = IRP_NDIS_DEV(ip);
+	int32_t error;
 	struct ndis_softc *sc = device_get_softc(dev);
+	struct ndisusb_ep *ne;
+	struct ndisusb_xfer *nx;
 	struct usbd_urb_vendor_or_class_request *vcreq;
-	uint8_t type = 0;
 	union usbd_urb *urb;
-	struct usb2_device_request req;
-	usb2_error_t status;
+
+	if (!(sc->ndisusb_status & NDISUSB_STATUS_SETUP_EP)) {
+		/*
+		 * XXX In some cases the interface number isn't 0.  However
+		 * some driver (eg. RTL8187L NDIS driver) calls this function
+		 * before calling URB_FUNCTION_SELECT_CONFIGURATION.
+		 */
+		error = usbd_setup_endpoint_default(ip, 0);
+		if (error != USB_ERR_NORMAL_COMPLETION)
+			return usbd_usb2urb(error);
+		sc->ndisusb_status |= NDISUSB_STATUS_SETUP_EP;
+	}
 
 	urb = usbd_geturb(ip);
 	vcreq = &urb->uu_vcreq;
+	ne = (vcreq->uvc_trans_flags & USBD_TRANSFER_DIRECTION_IN) ?
+	    &sc->ndisusb_dread_ep : &sc->ndisusb_dwrite_ep;
+	IRP_NDISUSB_EP(ip) = ne;
+	ip->irp_cancelfunc = (cancel_func)usbd_irpcancel_wrap;
 
-	switch (urb->uu_hdr.uuh_func) {
-	case URB_FUNCTION_CLASS_DEVICE:
-		type = UT_CLASS | UT_DEVICE;
-		break;
-	case URB_FUNCTION_CLASS_INTERFACE:
-		type = UT_CLASS | UT_INTERFACE;
-		break;
-	case URB_FUNCTION_CLASS_OTHER:
-		type = UT_CLASS | UT_OTHER;
-		break;
-	case URB_FUNCTION_CLASS_ENDPOINT:
-		type = UT_CLASS | UT_ENDPOINT;
-		break;
-	case URB_FUNCTION_VENDOR_DEVICE:
-		type = UT_VENDOR | UT_DEVICE;
-		break;
-	case URB_FUNCTION_VENDOR_INTERFACE:
-		type = UT_VENDOR | UT_INTERFACE;
-		break;
-	case URB_FUNCTION_VENDOR_OTHER:
-		type = UT_VENDOR | UT_OTHER;
-		break;
-	case URB_FUNCTION_VENDOR_ENDPOINT:
-		type = UT_VENDOR | UT_ENDPOINT;
-		break;
-	default:
-		/* never reached.  */
-		break;
+	nx = malloc(sizeof(struct ndisusb_xfer), M_USBDEV, M_NOWAIT | M_ZERO);
+	if (nx == NULL) {
+		device_printf(IRP_NDIS_DEV(ip), "out of memory\n");
+		return (USBD_STATUS_NO_MEMORY);
 	}
+	nx->nx_ep = ne;
+	nx->nx_priv = ip;
+	KeAcquireSpinLockAtDpcLevel(&ne->ne_lock);
+	InsertTailList((&ne->ne_pending), (&nx->nx_next));
+	KeReleaseSpinLockFromDpcLevel(&ne->ne_lock);
 
-	type |= (vcreq->uvc_trans_flags & USBD_TRANSFER_DIRECTION_IN) ?
-	    UT_READ : UT_WRITE;
-	type |= vcreq->uvc_reserved1;
-
-	req.bmRequestType = type;
-	req.bRequest = vcreq->uvc_req;
-	USETW(req.wIndex, vcreq->uvc_idx);
-	USETW(req.wValue, vcreq->uvc_value);
-	USETW(req.wLength, vcreq->uvc_trans_buflen);
+	/* we've done to setup xfer.  Let's transfer it.  */
+	ip->irp_iostat.isb_status = STATUS_PENDING;
+	ip->irp_iostat.isb_info = 0;
+	USBD_URB_STATUS(urb) = USBD_STATUS_PENDING;
+	IoMarkIrpPending(ip);
 
-	NDISUSB_LOCK(sc);
-	status = usb2_do_request(sc->ndisusb_dev, &sc->ndisusb_mtx, &req,
-	    vcreq->uvc_trans_buf);
-	NDISUSB_UNLOCK(sc);
+	error = usbd_taskadd(ip, NDISUSB_TASK_VENDOR);
+	if (error != USBD_STATUS_SUCCESS)
+		return (error);
 
-	return usbd_usb2urb(status);
+	return (USBD_STATUS_PENDING);
 }
 
 static void
@@ -872,6 +950,146 @@ extra:
 	}
 }
 
+static void
+usbd_ctrl_callback(struct usb2_xfer *xfer)
+{
+	irp *ip;
+	struct ndis_softc *sc = xfer->priv_sc;
+	struct ndisusb_ep *ne = xfer->priv_fifo;
+	struct ndisusb_xfer *nx;
+	uint8_t irql;
+	union usbd_urb *urb;
+	struct usbd_urb_vendor_or_class_request *vcreq;
+	uint8_t type = 0;
+	struct usb2_device_request req;
+
+	switch (USB_GET_STATE(xfer)) {
+	case USB_ST_TRANSFERRED:
+		nx = usbd_aq_getfirst(sc, ne);
+		if (nx == NULL)
+			return;
+
+		ip = nx->nx_priv;
+		urb = usbd_geturb(ip);
+		vcreq = &urb->uu_vcreq;
+
+		if (vcreq->uvc_trans_flags & USBD_TRANSFER_DIRECTION_IN) {
+			usb2_copy_out(xfer->frbuffers + 1, 0,
+			    vcreq->uvc_trans_buf, xfer->frlengths[1]);
+			nx->nx_urbactlen += xfer->frlengths[1];
+		}
+
+		usbd_xfer_complete(sc, ne, nx, USB_ERR_NORMAL_COMPLETION);
+		/* fall through */
+	case USB_ST_SETUP:
+next:
+		/* get next transfer */
+		KeAcquireSpinLock(&ne->ne_lock, &irql);
+		if (IsListEmpty(&ne->ne_pending)) {
+			KeReleaseSpinLock(&ne->ne_lock, irql);
+			return;
+		}
+		nx = CONTAINING_RECORD(ne->ne_pending.nle_flink,
+		    struct ndisusb_xfer, nx_next);
+		RemoveEntryList(&nx->nx_next);
+		/* add a entry to the active queue's tail.  */
+		InsertTailList((&ne->ne_active), (&nx->nx_next));
+		KeReleaseSpinLock(&ne->ne_lock, irql);
+
+		ip = nx->nx_priv;
+		urb = usbd_geturb(ip);
+		vcreq = &urb->uu_vcreq;
+
+		switch (urb->uu_hdr.uuh_func) {
+		case URB_FUNCTION_CLASS_DEVICE:
+			type = UT_CLASS | UT_DEVICE;
+			break;
+		case URB_FUNCTION_CLASS_INTERFACE:
+			type = UT_CLASS | UT_INTERFACE;
+			break;
+		case URB_FUNCTION_CLASS_OTHER:
+			type = UT_CLASS | UT_OTHER;
+			break;
+		case URB_FUNCTION_CLASS_ENDPOINT:
+			type = UT_CLASS | UT_ENDPOINT;
+			break;
+		case URB_FUNCTION_VENDOR_DEVICE:
+			type = UT_VENDOR | UT_DEVICE;
+			break;
+		case URB_FUNCTION_VENDOR_INTERFACE:
+			type = UT_VENDOR | UT_INTERFACE;
+			break;
+		case URB_FUNCTION_VENDOR_OTHER:
+			type = UT_VENDOR | UT_OTHER;
+			break;
+		case URB_FUNCTION_VENDOR_ENDPOINT:
+			type = UT_VENDOR | UT_ENDPOINT;
+			break;
+		default:
+			/* never reached.  */
+			break;
+		}
+
+		type |= (vcreq->uvc_trans_flags & USBD_TRANSFER_DIRECTION_IN) ?
+		    UT_READ : UT_WRITE;
+		type |= vcreq->uvc_reserved1;
+
+		req.bmRequestType = type;
+		req.bRequest = vcreq->uvc_req;
+		USETW(req.wIndex, vcreq->uvc_idx);
+		USETW(req.wValue, vcreq->uvc_value);
+		USETW(req.wLength, vcreq->uvc_trans_buflen);
+
+		nx->nx_urbbuf		= vcreq->uvc_trans_buf;
+		nx->nx_urblen		= vcreq->uvc_trans_buflen;
+		nx->nx_urbactlen	= 0;
+
+		usb2_copy_in(xfer->frbuffers, 0, &req, sizeof(req));
+		xfer->frlengths[0] = sizeof(req);
+		xfer->nframes = 1;
+		if (vcreq->uvc_trans_flags & USBD_TRANSFER_DIRECTION_IN) {
+			if (vcreq->uvc_trans_buflen >= USBD_CTRL_READ_BUFFER_SP)
+				device_printf(sc->ndis_dev,
+				    "warning: not enough buffer space (%d).\n",
+				    vcreq->uvc_trans_buflen);
+			xfer->frlengths[1] = MIN(xfer->max_data_length,
+			    vcreq->uvc_trans_buflen);
+			xfer->nframes = 2;
+		} else {
+			if (nx->nx_urblen > 0)
+				device_printf(sc->ndis_dev,
+				    "warning: not enough write buffer space"
+				    " (%d).\n", nx->nx_urblen);
+			/*
+			 * XXX with my local tests there was no cases to require
+			 * a extra buffer until now but it'd need to update in
+			 * the future if it needs to be.
+			 */
+			if (nx->nx_urblen > 0) {
+				usb2_copy_in(xfer->frbuffers + 1 , 0,
+				    nx->nx_urbbuf, nx->nx_urblen);
+				xfer->frlengths[1] = nx->nx_urblen;
+				xfer->nframes = 2;
+			}
+		}
+		usb2_start_hardware(xfer);
+		break;
+	default:
+		nx = usbd_aq_getfirst(sc, ne);
+		if (nx == NULL)
+			return;
+		if (xfer->error != USB_ERR_CANCELLED) {
+			xfer->flags.stall_pipe = 1;
+			device_printf(sc->ndis_dev, "usb xfer warning (%s)\n",
+			    usb2_errstr(xfer->error));
+		}
+		usbd_xfer_complete(sc, ne, nx, xfer->error);
+		if (xfer->error != USB_ERR_CANCELLED)
+			goto next;
+		break;
+	}
+}
+
 static struct ndisusb_ep *
 usbd_get_ndisep(ip, ep)
 	irp			*ip;
@@ -902,6 +1120,7 @@ usbd_xfertask(dobj, arg)
 	struct ndisusb_xferdone *nd;
 	struct ndisusb_xfer *nq;
 	struct usbd_urb_bulk_or_intr_transfer *ubi;
+	struct usbd_urb_vendor_or_class_request *vcreq;
 	union usbd_urb *urb;
 	usb2_error_t status;
 	void *priv;
@@ -922,18 +1141,19 @@ usbd_xfertask(dobj, arg)
 		ip = priv;
 		urb = usbd_geturb(ip);
 
-		KASSERT(urb->uu_hdr.uuh_func ==
-		    URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER,
-		    ("function(%d) isn't for bulk or interrupt",
-			urb->uu_hdr.uuh_func));
-
 		ip->irp_cancelfunc = NULL;
 		IRP_NDISUSB_EP(ip) = NULL;
 
 		switch (status) {
 		case USB_ERR_NORMAL_COMPLETION:
-			ubi = &urb->uu_bulkintr;
-			ubi->ubi_trans_buflen = nq->nx_urbactlen;
+			if (urb->uu_hdr.uuh_func ==
+			    URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER) {
+				ubi = &urb->uu_bulkintr;
+				ubi->ubi_trans_buflen = nq->nx_urbactlen;
+			} else {
+				vcreq = &urb->uu_vcreq;
+				vcreq->uvc_trans_buflen = nq->nx_urbactlen;
+			}
 			ip->irp_iostat.isb_info = nq->nx_urbactlen;
 			ip->irp_iostat.isb_status = STATUS_SUCCESS;
 			USBD_URB_STATUS(urb) = USBD_STATUS_SUCCESS;
@@ -1037,6 +1257,12 @@ usbd_task(dobj, arg)
 			usb2_transfer_stop(ne->ne_xfer[0]);
 			usb2_transfer_start(ne->ne_xfer[0]);
 			break;
+		case NDISUSB_TASK_VENDOR:
+			ne = (urb->uu_vcreq.uvc_trans_flags &
+			    USBD_TRANSFER_DIRECTION_IN) ?
+			    &sc->ndisusb_dread_ep : &sc->ndisusb_dwrite_ep;
+			usb2_transfer_start(ne->ne_xfer[0]);
+			break;
 		default:
 			break;
 		}

Modified: head/sys/dev/if_ndis/if_ndis_usb.c
==============================================================================
--- head/sys/dev/if_ndis/if_ndis_usb.c	Wed Mar 18 02:26:46 2009	(r189949)
+++ head/sys/dev/if_ndis/if_ndis_usb.c	Wed Mar 18 02:38:35 2009	(r189950)
@@ -210,6 +210,10 @@ ndisusb_detach(device_t self)
 
 	ndis_pnpevent_nic(self, NDIS_PNP_EVENT_SURPRISE_REMOVED);
 
+	if (sc->ndisusb_status & NDISUSB_STATUS_SETUP_EP) {
+		usb2_transfer_unsetup(sc->ndisusb_dread_ep.ne_xfer, 1);
+		usb2_transfer_unsetup(sc->ndisusb_dwrite_ep.ne_xfer, 1);
+	}
 	for (i = 0; i < NDISUSB_ENDPT_MAX; i++) {
 		ne = &sc->ndisusb_ep[i];
 		usb2_transfer_unsetup(ne->ne_xfer, 1);

Modified: head/sys/dev/if_ndis/if_ndisvar.h
==============================================================================
--- head/sys/dev/if_ndis/if_ndisvar.h	Wed Mar 18 02:26:46 2009	(r189949)
+++ head/sys/dev/if_ndis/if_ndisvar.h	Wed Mar 18 02:38:35 2009	(r189950)
@@ -146,6 +146,7 @@ struct ndisusb_task {
 	unsigned		nt_type;
 #define	NDISUSB_TASK_TSTART	0
 #define	NDISUSB_TASK_IRPCANCEL	1
+#define	NDISUSB_TASK_VENDOR	2
 	void			*nt_ctx;
 	list_entry		nt_tasklist;
 };
@@ -229,6 +230,8 @@ struct ndis_softc {
 
 	struct usb2_device	*ndisusb_dev;
 	struct mtx		ndisusb_mtx;
+	struct ndisusb_ep	ndisusb_dread_ep;
+	struct ndisusb_ep	ndisusb_dwrite_ep;
 #define	NDISUSB_GET_ENDPT(addr) \
 	((UE_GET_DIR(addr) >> 7) | (UE_GET_ADDR(addr) << 1))
 #define	NDISUSB_ENDPT_MAX	((UE_ADDR + 1) * 2)
@@ -241,6 +244,7 @@ struct ndis_softc {
 	kspin_lock		ndisusb_tasklock;
 	int			ndisusb_status;
 #define NDISUSB_STATUS_DETACH	0x1
+#define	NDISUSB_STATUS_SETUP_EP	0x2
 };
 
 #define	NDIS_LOCK(_sc)		mtx_lock(&(_sc)->ndis_mtx)

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 18 03:56:27 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1B932106566C;
	Wed, 18 Mar 2009 03:56:27 +0000 (UTC)
	(envelope-from ganbold@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 094978FC08;
	Wed, 18 Mar 2009 03:56:27 +0000 (UTC)
	(envelope-from ganbold@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2I3uQPH014943;
	Wed, 18 Mar 2009 03:56:26 GMT (envelope-from ganbold@svn.freebsd.org)
Received: (from ganbold@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2I3uQRi014942;
	Wed, 18 Mar 2009 03:56:26 GMT (envelope-from ganbold@svn.freebsd.org)
Message-Id: <200903180356.n2I3uQRi014942@svn.freebsd.org>
From: Ganbold Tsagaankhuu 
Date: Wed, 18 Mar 2009 03:56: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: r189955 - head/usr.sbin/sysinstall
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 18 Mar 2009 03:56:27 -0000

Author: ganbold (doc committer)
Date: Wed Mar 18 03:56:26 2009
New Revision: 189955
URL: http://svn.freebsd.org/changeset/base/189955

Log:
  Clear confirm password field first when adding new user.
  
  PR: i386/132580
  Reported by: 	ilgiz 
  Approved by:    kensmith

Modified:
  head/usr.sbin/sysinstall/user.c

Modified: head/usr.sbin/sysinstall/user.c
==============================================================================
--- head/usr.sbin/sysinstall/user.c	Wed Mar 18 03:36:08 2009	(r189954)
+++ head/usr.sbin/sysinstall/user.c	Wed Mar 18 03:56:26 2009	(r189955)
@@ -698,6 +698,7 @@ userAddUser(dialogMenuItem *self)
     CLEAR(ugroup);
     CLEAR(gecos);
     CLEAR(passwd);
+    CLEAR(confpasswd);
     CLEAR(umemb);
     CLEAR(homedir);
     CLEAR(shell);

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 18 12:00:42 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4AEB91065691;
	Wed, 18 Mar 2009 12:00:42 +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 08CDF8FC19;
	Wed, 18 Mar 2009 12:00:42 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from fledge.watson.org (fledge.watson.org [65.122.17.41])
	by cyrus.watson.org (Postfix) with ESMTPS id B6A3B46B39;
	Wed, 18 Mar 2009 08:00:41 -0400 (EDT)
Date: Wed, 18 Mar 2009 12:00:41 +0000 (GMT)
From: Robert Watson 
X-X-Sender: robert@fledge.watson.org
To: =?ISO-8859-15?Q?G=E1bor_K=F6vesd=E1n?= 
In-Reply-To: <49BB0DF0.3020907@FreeBSD.org>
Message-ID: 
References: <200903131040.n2DAecSO061131@svn.freebsd.org>
	
	<49BB0DF0.3020907@FreeBSD.org>
User-Agent: Alpine 2.00 (BSF 1167 2008-08-23)
MIME-Version: 1.0
Content-Type: MULTIPART/MIXED; BOUNDARY="621616949-857572288-1237377641=:99720"
Cc: Gabor Pali , doc@FreeBSD.org,
	Tom Rhodes , Giorgos Keramidas ,
	Manolis Kiagias ,
	svn-src-head@freebsd.org, "Sean C. Farley" 
Subject: Re: NLS additions to I18N chapter of developers-handbook [Was: Re:
 svn commit: r189765 - in head: . lib/libc lib/libc/nls]
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 18 Mar 2009 12:00:43 -0000

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--621616949-857572288-1237377641=:99720
Content-Type: TEXT/PLAIN; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8BIT


On Sat, 14 Mar 2009, Gábor Kövesdán wrote:

> Robert Watson escribió:
>> 
>> On Fri, 13 Mar 2009, Gabor Kovesdan wrote:
>>
>>>  - Reenable Native Language Support in libc.  This feature was disabled 
>>> due
>>>    to possible breakages in the catalog handling code.  Since then, that
>>>    code has been replaced by the secure code from NetBSD but NLS in libc
>>>    remained turned off.  Tests have shown that the feature is stable and
>>>    working so we can now turn it on again.
>> 
>> Do we have a nice tutorialish document somewhere on what people writing new 
>> command line tools or libraries should do in order to address localization 
>> requirements, or at least, make it easier for other people to do so?  I'm 
>> afraid I, at least, live in a world without catalogues, but a quick and 
>> practical guide to what The Right Thing Is for FreeBSD would make it much 
>> easier for me to do something a bit more mature.
>> 
> I've spent some time on writing a short section on this trying to do this 
> from a practical viewpoint. Please take a look ant tell me what do you 
> think: http://kovesdan.org/files/developers-handbook/posix-nls.html

s/are usual text files/are normal text files/?

I'm a bit surprised there isn't an include file that magically does this for 
you?

   extern nl_catd           catalog;

   extern char             *nlsstr[];

Is it expected that this same programming approach will work for applications 
to be compiled on other platforms, such as Mac OS X, Solaris, and Linux?  (I 
see the word POSIX, but that has various meanings :-).  In particular, suppose 
I want to update OpenBSM to use catalogs -- it contains both libraries and 
binaries -- will I need to do anything special?

Do you have any advice on what to do for libraries that provide error strings 
in their own error spaces?  Is it intended that the library's init and destroy 
functions will open and close catalogues?  Will this work if the application 
the library is used by doesn't know about catalogues?  Etc...

In the bsd.nls.mk section, there's no worked example, which I think would be 
helpful.

You begin by saying "Beyond the basic I18N functions" -- is there an 
introduction section that talks about those functions as well?

Is there a comprehensive project to identify opportunities for using 
catalogues through the system that need owners?  This sounds like it might be 
a useful GSoC project if someone can impose some structure on it?

Thanks for working on this,

Robert N M Watson
Computer Laboratory
University of Cambridge
--621616949-857572288-1237377641=:99720--

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 18 12:59:45 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7AC1910656BF;
	Wed, 18 Mar 2009 12:59:45 +0000 (UTC)
	(envelope-from gabor@FreeBSD.org)
Received: from server.mypc.hu (server.mypc.hu [87.229.73.95])
	by mx1.freebsd.org (Postfix) with ESMTP id 05DBF8FC0A;
	Wed, 18 Mar 2009 12:59:43 +0000 (UTC)
	(envelope-from gabor@FreeBSD.org)
Received: from localhost (localhost [127.0.0.1])
	by server.mypc.hu (Postfix) with ESMTP id BC88F14D7905;
	Wed, 18 Mar 2009 13:59:41 +0100 (CET)
X-Virus-Scanned: amavisd-new at t-hosting.hu
Received: from server.mypc.hu ([127.0.0.1])
	by localhost (server.mypc.hu [127.0.0.1]) (amavisd-new, port 10024)
	with LMTP id dm9ioL0NiP8D; Wed, 18 Mar 2009 13:59:40 +0100 (CET)
Received: from [192.168.1.105] (catv-80-98-231-64.catv.broadband.hu
	[80.98.231.64])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by server.mypc.hu (Postfix) with ESMTPSA id 98F4814D279A;
	Wed, 18 Mar 2009 13:59:40 +0100 (CET)
Message-ID: <49C0F039.30700@FreeBSD.org>
Date: Wed, 18 Mar 2009 13:59:37 +0100
From: =?ISO-8859-1?Q?G=E1bor_K=F6vesd=E1n?= 
User-Agent: Thunderbird 2.0.0.19 (Windows/20081209)
MIME-Version: 1.0
To: Robert Watson 
References: <200903131040.n2DAecSO061131@svn.freebsd.org>
	
	<49BB0DF0.3020907@FreeBSD.org>
	
In-Reply-To: 
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Cc: Gabor Pali , doc@FreeBSD.org,
	Tom Rhodes , Giorgos Keramidas ,
	Manolis Kiagias ,
	svn-src-head@freebsd.org, "Sean C. Farley" 
Subject: Re: NLS additions to I18N chapter of developers-handbook [Was: Re:
 svn commit: r189765 - in head: . lib/libc lib/libc/nls]
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 18 Mar 2009 12:59:52 -0000


>> I've spent some time on writing a short section on this trying to do 
>> this from a practical viewpoint. Please take a look ant tell me what 
>> do you think: 
>> http://kovesdan.org/files/developers-handbook/posix-nls.html
>
> s/are usual text files/are normal text files/?
ATM, we have "common text files". Rene sent some corrections, but I 
haven't yet updated the patch.
>
> I'm a bit surprised there isn't an include file that magically does 
> this for you?
>
>   extern nl_catd           catalog;
>
>   extern char             *nlsstr[];
No, I'm afraid there isn't. Think of using multiple catalogs from one 
application. You need to refer to them with an identifier when you call 
catgets(). The example I included in the documentation is a simplified 
one, it uses one catalog with one set. It satisfied usual needs, though. 
I don't think one would use more catalogs from an application very 
often, but the opportunity is given. I can't think of a really good 
example, but for example, let's suppose we have a localized gzip, which 
handles NLS and we are working on bzip2. There might be messages in 
gzip's catalog file, which we would reuse, e.g. "error in archive file" 
or such general ones. It would reduce duplicated messages but would make 
bzip2's localization partly depend on gzip. Or maybe we could collect 
the common messages to a single catalog file and besides, create gzip's 
and bzip2's own catalog with further messages. Well, it was just a silly 
example, but things like this is possible with NLS.
>
> Is it expected that this same programming approach will work for 
> applications to be compiled on other platforms, such as Mac OS X, 
> Solaris, and Linux?  (I see the word POSIX, but that has various 
> meanings :-).  In particular, suppose I want to update OpenBSM to use 
> catalogs -- it contains both libraries and binaries -- will I need to 
> do anything special?
Sincerely speaking, I haven't tried it. I can make a test app, which 
prints out a single message depending on LC_MESSAGES and I can test it 
on Linux, but unfortunately I don't have Mac OS X, nor Solaris access.
>
> Do you have any advice on what to do for libraries that provide error 
> strings in their own error spaces?  Is it intended that the library's 
> init and destroy functions will open and close catalogues?  Will this 
> work if the application the library is used by doesn't know about 
> catalogues?  Etc...
It will work. Actually, this is the case of libc. For example, ls(1) 
doesn't have to know about catalog, but this just works out of the box:

 > env LC_MESSAGES=es_ES.ISO8859-1 ls nonexistingdirectory
ls: nonexistingdirectory: Fichero o directorio inexistente

I haven't looked at ls's code but obviously it calls err(1, NULL), which 
checks errno and prints this related error message, which is defined in 
libc's catalog file. The catalog must be initialized before using it but 
as for the closing I think you can just omit it without any real harm, 
because the file will be released when the app terminates. Calling 
catclose is more important if you explicitly want to release the 
resource, because you know you won't need it any more or if you want to 
reuse the variable to open another catalog.
>
> In the bsd.nls.mk section, there's no worked example, which I think 
> would be helpful.
Good point, I'll add an example there, as well.
>
> You begin by saying "Beyond the basic I18N functions" -- is there an 
> introduction section that talks about those functions as well?
No, unfortunately. I meant there wchar-cleannes, respecting LC_TIME and 
such cases... E.g. sort has a -M option which tells sort to sort by 
month abbreviations. A localized sort should take those from LC_TIME 
instead of just using wired-in "JAN", "FEB", ... strings. I think it 
would be a long-term goal to extend developers-handbook. As for I18N, 
I'll try to add more content on a step-by-step basis.
>
> Is there a comprehensive project to identify opportunities for using 
> catalogues through the system that need owners?  This sounds like it 
> might be a useful GSoC project if someone can impose some structure on 
> it?
No, there's no organized project. I got interested in I18N a long ago, 
translating docs to Hungarian and then I realized there are nifty 
opportunities to extend language support beyond translated docs. Now it 
seems I'll apply to SoC with a project that delivers a BSDL libiconv, 
which is also very demanded. I'm doing preliminary research and 
discussing the details with my potential mentor. As for NLS as a SoC 
project, I'm not sure if it's enough for that. We have a good 
infrastructure for NLS (POSIX.1-compliant libraries and bsd.nls.mk) and 
adding catalog support to individual utilities might be too 
"mechanical". I mean, you just need to insert my code snippet and 
collect the strings into a template that translators can use and it just 
works. As you wrote, libraries might be more complex, but I don't know 
about any crucial difference that applies to libraries.
Thanks for your interest in this effort,

-- 
Gabor Kovesdan
FreeBSD Volunteer

EMAIL: gabor@FreeBSD.org .:|:. gabor@kovesdan.org
WEB:   http://people.FreeBSD.org/~gabor .:|:. http://kovesdan.org


From owner-svn-src-head@FreeBSD.ORG  Wed Mar 18 13:40:37 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B6BAD1065689;
	Wed, 18 Mar 2009 13:40:37 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A3A068FC20;
	Wed, 18 Mar 2009 13:40:37 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2IDeb6P027621;
	Wed, 18 Mar 2009 13:40:37 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2IDebUF027618;
	Wed, 18 Mar 2009 13:40:37 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <200903181340.n2IDebUF027618@svn.freebsd.org>
From: Konstantin Belousov 
Date: Wed, 18 Mar 2009 13:40:37 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r189959 - head/libexec/rtld-elf
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 18 Mar 2009 13:40:38 -0000

Author: kib
Date: Wed Mar 18 13:40:37 2009
New Revision: 189959
URL: http://svn.freebsd.org/changeset/base/189959

Log:
  Implement the dynamic string token substitution in the rpath and
  soneeded pathes. The $ORIGIN, $OSNAME, $OSREL and $PLATFORM tokens
  are supported. Enabling the substitution requires DF_ORIGIN flag in
  DT_FLAGS or DF_1_ORIGIN if DF_FLAGS_1, that may be set with -z origin
  gnu ld flag. Translation is unconditionally disabled for setuid/setgid
  processes.
  
  The $ORIGIN translation relies on the AT_EXECPATH auxinfo supplied
  by kernel.
  
  Requested by:	maho
  Tested by:	maho, pho
  Reviewed by:	kan

Modified:
  head/libexec/rtld-elf/map_object.c
  head/libexec/rtld-elf/rtld.c
  head/libexec/rtld-elf/rtld.h

Modified: head/libexec/rtld-elf/map_object.c
==============================================================================
--- head/libexec/rtld-elf/map_object.c	Wed Mar 18 13:19:46 2009	(r189958)
+++ head/libexec/rtld-elf/map_object.c	Wed Mar 18 13:40:37 2009	(r189959)
@@ -348,6 +348,8 @@ obj_free(Obj_Entry *obj)
 	free(obj->vertab);
     if (obj->origin_path)
 	free(obj->origin_path);
+    if (obj->z_origin)
+	free(obj->rpath);
     if (obj->priv)
 	free(obj->priv);
     if (obj->path)

Modified: head/libexec/rtld-elf/rtld.c
==============================================================================
--- head/libexec/rtld-elf/rtld.c	Wed Mar 18 13:19:46 2009	(r189958)
+++ head/libexec/rtld-elf/rtld.c	Wed Mar 18 13:40:37 2009	(r189959)
@@ -41,6 +41,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -118,6 +119,7 @@ static void objlist_remove_unref(Objlist
 static void *path_enumerate(const char *, path_enum_proc, void *);
 static int relocate_objects(Obj_Entry *, bool, Obj_Entry *);
 static int rtld_dirname(const char *, char *);
+static int rtld_dirname_abs(const char *, char *);
 static void rtld_exit(void);
 static char *search_library_path(const char *, const char *);
 static const void **get_program_var_addr(const char *);
@@ -134,6 +136,9 @@ static void unlink_object(Obj_Entry *);
 static void unload_object(Obj_Entry *);
 static void unref_dag(Obj_Entry *);
 static void ref_dag(Obj_Entry *);
+static int origin_subst_one(char **res, const char *real, const char *kw,
+  const char *subst, char *may_free);
+static char *origin_subst(const char *real, const char *origin_path);
 static int  rtld_verify_versions(const Objlist *);
 static int  rtld_verify_object_versions(Obj_Entry *);
 static void object_add_name(Obj_Entry *, const char *);
@@ -412,7 +417,25 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_
 	    die();
     }
 
-    obj_main->path = xstrdup(argv0);
+    if (aux_info[AT_EXECPATH] != 0) {
+	    char *kexecpath;
+	    char buf[MAXPATHLEN];
+
+	    kexecpath = aux_info[AT_EXECPATH]->a_un.a_ptr;
+	    dbg("AT_EXECPATH %p %s", kexecpath, kexecpath);
+	    if (kexecpath[0] == '/')
+		    obj_main->path = kexecpath;
+	    else if (getcwd(buf, sizeof(buf)) == NULL ||
+		     strlcat(buf, "/", sizeof(buf)) >= sizeof(buf) ||
+		     strlcat(buf, kexecpath, sizeof(buf)) >= sizeof(buf))
+		    obj_main->path = xstrdup(argv0);
+	    else
+		    obj_main->path = xstrdup(buf);
+    } else {
+	    dbg("No AT_EXECPATH");
+	    obj_main->path = xstrdup(argv0);
+    }
+    dbg("obj_main path %s", obj_main->path);
     obj_main->mainprog = true;
 
     /*
@@ -614,6 +637,83 @@ basename(const char *name)
     return p != NULL ? p + 1 : name;
 }
 
+static struct utsname uts;
+
+static int
+origin_subst_one(char **res, const char *real, const char *kw, const char *subst,
+    char *may_free)
+{
+    const char *p, *p1;
+    char *res1;
+    int subst_len;
+    int kw_len;
+
+    res1 = *res = NULL;
+    p = real;
+    subst_len = kw_len = 0;
+    for (;;) {
+	 p1 = strstr(p, kw);
+	 if (p1 != NULL) {
+	     if (subst_len == 0) {
+		 subst_len = strlen(subst);
+		 kw_len = strlen(kw);
+	     }
+	     if (*res == NULL) {
+		 *res = xmalloc(PATH_MAX);
+		 res1 = *res;
+	     }
+	     if ((res1 - *res) + subst_len + (p1 - p) >= PATH_MAX) {
+		 _rtld_error("Substitution of %s in %s cannot be performed",
+		     kw, real);
+		 if (may_free != NULL)
+		     free(may_free);
+		 free(res);
+		 return (false);
+	     }
+	     memcpy(res1, p, p1 - p);
+	     res1 += p1 - p;
+	     memcpy(res1, subst, subst_len);
+	     res1 += subst_len;
+	     p = p1 + kw_len;
+	 } else {
+	    if (*res == NULL) {
+		if (may_free != NULL)
+		    *res = may_free;
+		else
+		    *res = xstrdup(real);
+		return (true);
+	    }
+	    *res1 = '\0';
+	    if (may_free != NULL)
+		free(may_free);
+	    if (strlcat(res1, p, PATH_MAX - (res1 - *res)) >= PATH_MAX) {
+		free(res);
+		return (false);
+	    }
+	    return (true);
+	 }
+    }
+}
+
+static char *
+origin_subst(const char *real, const char *origin_path)
+{
+    char *res1, *res2, *res3, *res4;
+
+    if (uts.sysname[0] == '\0') {
+	if (uname(&uts) != 0) {
+	    _rtld_error("utsname failed: %d", errno);
+	    return (NULL);
+	}
+    }
+    if (!origin_subst_one(&res1, real, "$ORIGIN", origin_path, NULL) ||
+	!origin_subst_one(&res2, res1, "$OSNAME", uts.sysname, res1) ||
+	!origin_subst_one(&res3, res2, "$OSREL", uts.release, res2) ||
+	!origin_subst_one(&res4, res3, "$PLATFORM", uts.machine, res3))
+	    return (NULL);
+    return (res4);
+}
+
 static void
 die(void)
 {
@@ -790,11 +890,8 @@ digest_dynamic(Obj_Entry *obj, int early
 #endif
 
 	case DT_FLAGS:
-		if (dynp->d_un.d_val & DF_ORIGIN) {
-		    obj->origin_path = xmalloc(PATH_MAX);
-		    if (rtld_dirname(obj->path, obj->origin_path) == -1)
-			die();
-		}
+		if ((dynp->d_un.d_val & DF_1_ORIGIN) && trust)
+		    obj->z_origin = true;
 		if (dynp->d_un.d_val & DF_SYMBOLIC)
 		    obj->symbolic = true;
 		if (dynp->d_un.d_val & DF_TEXTREL)
@@ -826,6 +923,15 @@ digest_dynamic(Obj_Entry *obj, int early
 		break;
 #endif
 
+	case DT_FLAGS_1:
+		if ((dynp->d_un.d_val & DF_1_ORIGIN) && trust)
+		    obj->z_origin = true;
+		if (dynp->d_un.d_val & DF_1_GLOBAL)
+			/* XXX */;
+		if (dynp->d_un.d_val & DF_1_BIND_NOW)
+		    obj->bind_now = true;
+	    break;
+
 	default:
 	    if (!early) {
 		dbg("Ignoring d_tag %ld = %#lx", (long)dynp->d_tag,
@@ -844,8 +950,17 @@ digest_dynamic(Obj_Entry *obj, int early
 	obj->pltrelsize = 0;
     }
 
-    if (dyn_rpath != NULL)
-	obj->rpath = obj->strtab + dyn_rpath->d_un.d_val;
+    if (obj->z_origin && obj->origin_path == NULL) {
+	obj->origin_path = xmalloc(PATH_MAX);
+	if (rtld_dirname_abs(obj->path, obj->origin_path) == -1)
+	    die();
+    }
+
+    if (dyn_rpath != NULL) {
+	obj->rpath = (char *)obj->strtab + dyn_rpath->d_un.d_val;
+	if (obj->z_origin)
+	    obj->rpath = origin_subst(obj->rpath, obj->origin_path);
+    }
 
     if (dyn_soname != NULL)
 	object_add_name(obj, obj->strtab + dyn_soname->d_un.d_val);
@@ -1003,7 +1118,10 @@ find_library(const char *xname, const Ob
 	      xname);
 	    return NULL;
 	}
-	return xstrdup(xname);
+	if (refobj->z_origin)
+	    return origin_subst(xname, refobj->origin_path);
+	else
+	    return xstrdup(xname);
     }
 
     if (libmap_disable || (refobj == NULL) ||
@@ -2309,6 +2427,23 @@ rtld_dirname(const char *path, char *bna
     return (0);
 }
 
+static int
+rtld_dirname_abs(const char *path, char *base)
+{
+	char base_rel[PATH_MAX];
+
+	if (rtld_dirname(path, base) == -1)
+		return (-1);
+	if (base[0] == '/')
+		return (0);
+	if (getcwd(base_rel, sizeof(base_rel)) == NULL ||
+	    strlcat(base_rel, "/", sizeof(base_rel)) >= sizeof(base_rel) ||
+	    strlcat(base_rel, base, sizeof(base_rel)) >= sizeof(base_rel))
+		return (-1);
+	strcpy(base, base_rel);
+	return (0);
+}
+
 static void
 linkmap_add(Obj_Entry *obj)
 {

Modified: head/libexec/rtld-elf/rtld.h
==============================================================================
--- head/libexec/rtld-elf/rtld.h	Wed Mar 18 13:19:46 2009	(r189958)
+++ head/libexec/rtld-elf/rtld.h	Wed Mar 18 13:40:37 2009	(r189959)
@@ -195,7 +195,7 @@ typedef struct Struct_Obj_Entry {
     const Elf_Hashelt *chains;	/* Hash table chain array */
     unsigned long nchains;	/* Number of chains */
 
-    const char *rpath;		/* Search path specified in object */
+    char *rpath;		/* Search path specified in object */
     Needed_Entry *needed;	/* Shared objects needed by this one (%) */
 
     STAILQ_HEAD(, Struct_Name_Entry) names; /* List of names for this object we
@@ -216,6 +216,7 @@ typedef struct Struct_Obj_Entry {
     bool init_done : 1;		/* Already have added object to init list */
     bool tls_done : 1;		/* Already allocated offset for static TLS */
     bool phdr_alloc : 1;	/* Phdr is allocated and needs to be freed. */
+    bool z_origin : 1;		/* Process rpath and soname tokens */
 
     struct link_map linkmap;	/* for GDB and dlinfo() */
     Objlist dldags;		/* Object belongs to these dlopened DAGs (%) */

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 18 13:54:36 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3D99F1065674;
	Wed, 18 Mar 2009 13:54:36 +0000 (UTC) (envelope-from pho@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 2C2AC8FC0C;
	Wed, 18 Mar 2009 13:54:36 +0000 (UTC) (envelope-from pho@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2IDsaDH027974;
	Wed, 18 Mar 2009 13:54:36 GMT (envelope-from pho@svn.freebsd.org)
Received: (from pho@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2IDsakd027973;
	Wed, 18 Mar 2009 13:54:36 GMT (envelope-from pho@svn.freebsd.org)
Message-Id: <200903181354.n2IDsakd027973@svn.freebsd.org>
From: Peter Holm 
Date: Wed, 18 Mar 2009 13:54: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: r189961 - head/sys/fs/nullfs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 18 Mar 2009 13:54:37 -0000

Author: pho
Date: Wed Mar 18 13:54:35 2009
New Revision: 189961
URL: http://svn.freebsd.org/changeset/base/189961

Log:
  Do not use null_bypass for VOP_ISLOCKED, directly call default
  implementation. null_bypass cannot work for the !nullfs-vnodes, in
  particular, for VBAD vnodes.
  
  In collaboration with:	kib

Modified:
  head/sys/fs/nullfs/null_vnops.c

Modified: head/sys/fs/nullfs/null_vnops.c
==============================================================================
--- head/sys/fs/nullfs/null_vnops.c	Wed Mar 18 13:47:44 2009	(r189960)
+++ head/sys/fs/nullfs/null_vnops.c	Wed Mar 18 13:54:35 2009	(r189961)
@@ -724,6 +724,7 @@ struct vop_vector null_vnodeops = {
 	.vop_getattr =		null_getattr,
 	.vop_getwritemount =	null_getwritemount,
 	.vop_inactive =		null_inactive,
+	.vop_islocked =		vop_stdislocked,
 	.vop_lock1 =		null_lock,
 	.vop_lookup =		null_lookup,
 	.vop_open =		null_open,

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 18 13:57:31 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AF19E1065672;
	Wed, 18 Mar 2009 13:57:31 +0000 (UTC)
	(envelope-from asmrookie@gmail.com)
Received: from mail-bw0-f164.google.com (mail-bw0-f164.google.com
	[209.85.218.164])
	by mx1.freebsd.org (Postfix) with ESMTP id A0C0E8FC19;
	Wed, 18 Mar 2009 13:57:30 +0000 (UTC)
	(envelope-from asmrookie@gmail.com)
Received: by bwz8 with SMTP id 8so59080bwz.43
	for ; Wed, 18 Mar 2009 06:57:29 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:sender:received:in-reply-to
	:references:date:x-google-sender-auth:message-id:subject:from:to:cc
	:content-type:content-transfer-encoding;
	bh=lrrn9u/b4UHn9+Nq/M9lPIAB5n/70eMMlaBbsyZTCSo=;
	b=YVf/5w2bf2xJ1uBDBIKVSJl3wVFOnywUrJCzquQlBZV3Q+2LHZA3Vfc0Ro3hS6QkqC
	+xJOmIN1PdiWc2ijIOLLtaXDz2tAOsX1w6BW4TPu3in+ovaqya+2bk+iMdahvj0gGZx8
	A0ci9vXf/pWLlzrV6bUSclRyDAhUwMMpCSlbY=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type
	:content-transfer-encoding;
	b=Gm10hU25ys2DmI1WGUh8kVEwsAMpyoRonv2A+ot0nxj50CZ6R/YiAPYg4857sZsPSt
	TD1TvpX2Mb5BmA1qwPBs2uxHLvBHQLmBpiXibDNhDwj/3pVXkpIl52zrEVk8vdQXqpBZ
	nVpuUH6hwc3eBC9MCCrt0Swx1wRDieGr8b3fA=
MIME-Version: 1.0
Sender: asmrookie@gmail.com
Received: by 10.223.104.140 with SMTP id p12mr1071479fao.7.1237384649498; Wed, 
	18 Mar 2009 06:57:29 -0700 (PDT)
In-Reply-To: <200903181354.n2IDsakd027973@svn.freebsd.org>
References: <200903181354.n2IDsakd027973@svn.freebsd.org>
Date: Wed, 18 Mar 2009 14:57:29 +0100
X-Google-Sender-Auth: 9c98d6f9cda0567d
Message-ID: <3bbf2fe10903180657i61454fb1m43dfcd75ad648a09@mail.gmail.com>
From: Attilio Rao 
To: Peter Holm 
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r189961 - head/sys/fs/nullfs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 18 Mar 2009 13:57:32 -0000

2009/3/18, Peter Holm :
> Author: pho
>  Date: Wed Mar 18 13:54:35 2009
>  New Revision: 189961
>  URL: http://svn.freebsd.org/changeset/base/189961
>
>  Log:
>   Do not use null_bypass for VOP_ISLOCKED, directly call default
>   implementation. null_bypass cannot work for the !nullfs-vnodes, in
>   particular, for VBAD vnodes.
>
>   In collaboration with:        kib

Pointy hat to: attilio

Attilio


-- 
Peace can only be achieved by understanding - A. Einstein

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 18 14:01:42 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1F8761065672;
	Wed, 18 Mar 2009 14:01:42 +0000 (UTC)
	(envelope-from vanhu@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 07E808FC08;
	Wed, 18 Mar 2009 14:01:42 +0000 (UTC)
	(envelope-from vanhu@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2IE1fue028186;
	Wed, 18 Mar 2009 14:01:41 GMT (envelope-from vanhu@svn.freebsd.org)
Received: (from vanhu@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2IE1fU9028185;
	Wed, 18 Mar 2009 14:01:41 GMT (envelope-from vanhu@svn.freebsd.org)
Message-Id: <200903181401.n2IE1fU9028185@svn.freebsd.org>
From: VANHULLEBUS Yvan 
Date: Wed, 18 Mar 2009 14:01: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: r189962 - head/sys/netipsec
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 18 Mar 2009 14:01:44 -0000

Author: vanhu
Date: Wed Mar 18 14:01:41 2009
New Revision: 189962
URL: http://svn.freebsd.org/changeset/base/189962

Log:
  Fixed deletion of sav entries in key_delsah()
  
  Approved by:	gnn(mentor)
  Obtained from:	NETASQ
  MFC after:	1 month

Modified:
  head/sys/netipsec/key.c

Modified: head/sys/netipsec/key.c
==============================================================================
--- head/sys/netipsec/key.c	Wed Mar 18 13:54:35 2009	(r189961)
+++ head/sys/netipsec/key.c	Wed Mar 18 14:01:41 2009	(r189962)
@@ -2687,7 +2687,10 @@ key_delsah(sah)
 			if (sav->refcnt == 0) {
 				/* sanity check */
 				KEY_CHKSASTATE(state, sav->state, __func__);
-				KEY_FREESAV(&sav);
+				/* do NOT call KEY_FREESAV here: it will only delete the sav if refcnt == 1,
+				 * where we already know that refcnt == 0
+				 */
+				key_delsav(sav);
 			} else {
 				/* give up to delete this sa */
 				zombie++;
@@ -4131,6 +4134,8 @@ key_flush_sad(time_t now)
 
 		/* if LARVAL entry doesn't become MATURE, delete it. */
 		LIST_FOREACH_SAFE(sav, &sah->savtree[SADB_SASTATE_LARVAL], chain, nextsav) {
+			/* Need to also check refcnt for a larval SA ???
+			 */
 			if (now - sav->created > V_key_larval_lifetime)
 				KEY_FREESAV(&sav);
 		}

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 18 14:33:11 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1DF7C106566C;
	Wed, 18 Mar 2009 14:33:11 +0000 (UTC)
	(envelope-from gabor@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 0C8A68FC0A;
	Wed, 18 Mar 2009 14:33:11 +0000 (UTC)
	(envelope-from gabor@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2IEXAUH028816;
	Wed, 18 Mar 2009 14:33:10 GMT (envelope-from gabor@svn.freebsd.org)
Received: (from gabor@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2IEXAib028815;
	Wed, 18 Mar 2009 14:33:10 GMT (envelope-from gabor@svn.freebsd.org)
Message-Id: <200903181433.n2IEXAib028815@svn.freebsd.org>
From: Gabor Kovesdan 
Date: Wed, 18 Mar 2009 14:33:10 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r189963 - head/lib/libc/nls
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 18 Mar 2009 14:33:11 -0000

Author: gabor (doc,ports committer)
Date: Wed Mar 18 14:33:10 2009
New Revision: 189963
URL: http://svn.freebsd.org/changeset/base/189963

Log:
  - Fix typo
  
  PR:		kern/132773
  Reported by:	Alan R. S. Bueno 
  Submitted by:	Murilo Opsfelder 

Modified:
  head/lib/libc/nls/pt_BR.ISO8859-1.msg

Modified: head/lib/libc/nls/pt_BR.ISO8859-1.msg
==============================================================================
--- head/lib/libc/nls/pt_BR.ISO8859-1.msg	Wed Mar 18 14:01:41 2009	(r189962)
+++ head/lib/libc/nls/pt_BR.ISO8859-1.msg	Wed Mar 18 14:33:10 2009	(r189963)
@@ -70,7 +70,7 @@ $ EMLINK
 $ EPIPE
 32 pipe quebrado
 $ EDOM
-33 Arqumento numérico fora do domínio
+33 Argumento numérico fora do domínio
 $ ERANGE
 34 Resultado muito grande
 $ EAGAIN, EWOULDBLOCK

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 18 16:19:44 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C64EC106566B;
	Wed, 18 Mar 2009 16:19:44 +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 B41668FC12;
	Wed, 18 Mar 2009 16:19:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2IGJi5C031032;
	Wed, 18 Mar 2009 16:19:44 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2IGJifl031031;
	Wed, 18 Mar 2009 16:19:44 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <200903181619.n2IGJifl031031@svn.freebsd.org>
From: John Baldwin 
Date: Wed, 18 Mar 2009 16:19: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: r189967 -
	head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 18 Mar 2009 16:19:45 -0000

Author: jhb
Date: Wed Mar 18 16:19:44 2009
New Revision: 189967
URL: http://svn.freebsd.org/changeset/base/189967

Log:
  The zfs_get_xattrdir() function is used to find the extended attribute
  directory for a znode.  When the directory already exists, it returns a
  referenced but unlocked vnode.  When a directory does not yet exist, it
  calls zfs_make_xattrdir() to create a new one.  zfs_make_xattrdir() returns
  the vnode both referenced and and locked and zfs_get_xattrdir() was leaking
  this vnode lock to its callers.  Fix this by dropping the vnode lock if
  zfs_make_xattrdir() successfully creates a new extended attribute
  directory.
  
  Reviewed by:	pjd

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

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c	Wed Mar 18 16:09:05 2009	(r189966)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c	Wed Mar 18 16:19:44 2009	(r189967)
@@ -940,6 +940,8 @@ top:
 		/* NB: we already did dmu_tx_wait() if necessary */
 		goto top;
 	}
+	if (error == 0)
+		VOP_UNLOCK(*xvpp, 0);
 
 	return (error);
 }

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 18 18:08:17 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8BAAB1065829;
	Wed, 18 Mar 2009 18:08:17 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42])
	by mx1.freebsd.org (Postfix) with ESMTP id 4B8A58FC18;
	Wed, 18 Mar 2009 18:08:17 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from server.baldwin.cx (pool-98-109-39-197.nwrknj.fios.verizon.net
	[98.109.39.197])
	by cyrus.watson.org (Postfix) with ESMTPSA id D23D946B88;
	Wed, 18 Mar 2009 14:08:16 -0400 (EDT)
Received: from localhost (john@localhost [127.0.0.1]) (authenticated bits=0)
	by server.baldwin.cx (8.14.3/8.14.3) with ESMTP id n2II7TK0007423;
	Wed, 18 Mar 2009 14:08:10 -0400 (EDT) (envelope-from jhb@freebsd.org)
From: John Baldwin 
To: Kostik Belousov 
Date: Wed, 18 Mar 2009 12:15:22 -0400
User-Agent: KMail/1.9.7
References: <200812181158.mBIBwC50039690@svn.freebsd.org>
	<49BAA2C6.2000807@FreeBSD.org>
	<20090313212229.GW41617@deviant.kiev.zoral.com.ua>
In-Reply-To: <20090313212229.GW41617@deviant.kiev.zoral.com.ua>
MIME-Version: 1.0
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200903181215.23213.jhb@freebsd.org>
X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by
	milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]);
	Wed, 18 Mar 2009 14:08:11 -0400 (EDT)
X-Virus-Scanned: ClamAV 0.94.2/9130/Wed Mar 18 09:51:53 2009 on
	server.baldwin.cx
X-Virus-Status: Clean
X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 
	autolearn=ham version=3.1.3
X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r186276 - 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: Wed, 18 Mar 2009 18:08:18 -0000

On Friday 13 March 2009 5:22:29 pm Kostik Belousov wrote:
> On Fri, Mar 13, 2009 at 02:15:34PM -0400, John Baldwin wrote:
> > Konstantin Belousov wrote:
> > >Author: kib
> > >Date: Thu Dec 18 11:58:12 2008
> > >New Revision: 186276
> > >URL: http://svn.freebsd.org/changeset/base/186276
> > >
> > >Log:
> > >  Do not return success and doomed vnode from lookup. LK_UPGRADE allows
> > >  the vnode to be reclaimed.
> > >  
> > >  Tested by:	pho
> > >  MFC after:	1 month
> > 
> > Would EBADF be more appropriate?  That is what other places that check 
> > VI_DOOMED return for this type of check (e.g. in cache_lookup()).
> 
> I do not think so. When we do namei lookup, there is actually no
> file descriptor to be invalid. The fact the we lost the race with
> forced unmount actually means that there is no more node with
> supplied name.

Hmm, I think a few places need to be fixed to ENOENT instead of EBADF then:

--- //depot/user/jhb/lock/kern/vfs_cache.c
+++ /home/jhb/work/p4/lock/kern/vfs_cache.c
@@ -315,7 +315,7 @@
  * (negative cacheing), a status of ENOENT is returned. If the lookup
  * fails, a status of zero is returned.  If the directory vnode is
  * recycled out from under us due to a forced unmount, a status of
- * EBADF is returned.
+ * ENOENT is returned.
  *
  * vpp is locked and ref'd on return.  If we're looking up DOTDOT, dvp is
  * unlocked.  If we're looking up . an extra ref is taken, but the lock is
@@ -467,7 +467,7 @@
 					/* forced unmount */
 					vrele(*vpp);
 					*vpp = NULL;
-					return (EBADF);
+					return (ENOENT);
 				}
 			} else
 				vn_lock(*vpp, LK_DOWNGRADE | LK_RETRY);
@@ -974,7 +974,7 @@
 		if (vp->v_vflag & VV_ROOT) {
 			if (vp->v_iflag & VI_DOOMED) {	/* forced unmount */
 				CACHE_RUNLOCK();
-				error = EBADF;
+				error = ENOENT;
 				break;
 			}
 			vp = vp->v_mount->mnt_vnodecovered;
--- //depot/user/jhb/lock/kern/vfs_lookup.c
+++ /home/jhb/work/p4/lock/kern/vfs_lookup.c
@@ -602,7 +602,7 @@
 			if ((dp->v_vflag & VV_ROOT) == 0)
 				break;
 			if (dp->v_iflag & VI_DOOMED) {	/* forced unmount */
-				error = EBADF;
+				error = ENOENT;
 				goto bad;
 			}
 			tdp = dp;
@@ -764,9 +764,11 @@
 	     *ndp->ni_next == '/')) {
 		cnp->cn_flags |= ISSYMLINK;
 		if (dp->v_iflag & VI_DOOMED) {
-			/* We can't know whether the directory was mounted with
-			 * NOSYMFOLLOW, so we can't follow safely. */
-			error = EBADF;
+			/*
+			 * We can't know whether the directory was mounted with
+			 * NOSYMFOLLOW, so we can't follow safely.
+			 */
+			error = ENOENT;
 			goto bad2;
 		}
 		if (dp->v_mount->mnt_flag & MNT_NOSYMFOLLOW) {


-- 
John Baldwin

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 18 18:08:59 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 09A9D106591C;
	Wed, 18 Mar 2009 18:08:59 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42])
	by mx1.freebsd.org (Postfix) with ESMTP id CC9FA8FC1A;
	Wed, 18 Mar 2009 18:08:58 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from server.baldwin.cx (pool-98-109-39-197.nwrknj.fios.verizon.net
	[98.109.39.197])
	by cyrus.watson.org (Postfix) with ESMTPSA id 792ED46B66;
	Wed, 18 Mar 2009 14:08:58 -0400 (EDT)
Received: from localhost (john@localhost [127.0.0.1]) (authenticated bits=0)
	by server.baldwin.cx (8.14.3/8.14.3) with ESMTP id n2II7TK7007423;
	Wed, 18 Mar 2009 14:08:52 -0400 (EDT) (envelope-from jhb@freebsd.org)
From: John Baldwin 
To: src-committers@freebsd.org
Date: Wed, 18 Mar 2009 14:06:32 -0400
User-Agent: KMail/1.9.7
References: <200903181619.n2IGJifl031031@svn.freebsd.org>
In-Reply-To: <200903181619.n2IGJifl031031@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200903181406.32619.jhb@freebsd.org>
X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by
	milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]);
	Wed, 18 Mar 2009 14:08:52 -0400 (EDT)
X-Virus-Scanned: ClamAV 0.94.2/9130/Wed Mar 18 09:51:53 2009 on
	server.baldwin.cx
X-Virus-Status: Clean
X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 
	autolearn=ham version=3.1.3
X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org
Subject: Re: svn commit: r189967 -
	head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 18 Mar 2009 18:09:00 -0000

On Wednesday 18 March 2009 12:19:44 pm John Baldwin wrote:
> Author: jhb
> Date: Wed Mar 18 16:19:44 2009
> New Revision: 189967
> URL: http://svn.freebsd.org/changeset/base/189967
> 
> Log:
>   The zfs_get_xattrdir() function is used to find the extended attribute
>   directory for a znode.  When the directory already exists, it returns a
>   referenced but unlocked vnode.  When a directory does not yet exist, it
>   calls zfs_make_xattrdir() to create a new one.  zfs_make_xattrdir() returns
>   the vnode both referenced and and locked and zfs_get_xattrdir() was leaking
>   this vnode lock to its callers.  Fix this by dropping the vnode lock if
>   zfs_make_xattrdir() successfully creates a new extended attribute
>   directory.

This should fix the panics with ZFS and tar + EA.

-- 
John Baldwin

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 18 18:42:58 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C99A110656E0;
	Wed, 18 Mar 2009 18:42:58 +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 B80148FC1D;
	Wed, 18 Mar 2009 18:42:58 +0000 (UTC)
	(envelope-from brueffer@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2IIgw55034352;
	Wed, 18 Mar 2009 18:42:58 GMT
	(envelope-from brueffer@svn.freebsd.org)
Received: (from brueffer@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2IIgw6f034350;
	Wed, 18 Mar 2009 18:42:58 GMT
	(envelope-from brueffer@svn.freebsd.org)
Message-Id: <200903181842.n2IIgw6f034350@svn.freebsd.org>
From: Christian Brueffer 
Date: Wed, 18 Mar 2009 18:42: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: r189977 - 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, 18 Mar 2009 18:42:59 -0000

Author: brueffer
Date: Wed Mar 18 18:42:58 2009
New Revision: 189977
URL: http://svn.freebsd.org/changeset/base/189977

Log:
  k8temp(4) has been renamed to amdtemp(4).

Modified:
  head/ObsoleteFiles.inc

Modified: head/ObsoleteFiles.inc
==============================================================================
--- head/ObsoleteFiles.inc	Wed Mar 18 18:42:48 2009	(r189976)
+++ head/ObsoleteFiles.inc	Wed Mar 18 18:42:58 2009	(r189977)
@@ -14,6 +14,8 @@
 # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last.
 #
 
+# 20090313: k8temp(4) renamed to amdtemp(4)
+OLD_FILES+=usr/share/man/man4/k8temp.4.gz
 # 20090308: libusb.so.1 renamed
 OLD_LIBS+=usr/lib/libusb20.so.1
 OLD_FILES+=usr/lib/libusb20.a

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 18 18:43:31 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9B6F91065670;
	Wed, 18 Mar 2009 18:43:31 +0000 (UTC)
	(envelope-from luigi@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 7B55A8FC0A;
	Wed, 18 Mar 2009 18:43:31 +0000 (UTC)
	(envelope-from luigi@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2IIhVmV034405;
	Wed, 18 Mar 2009 18:43:31 GMT (envelope-from luigi@svn.freebsd.org)
Received: (from luigi@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2IIhVmp034404;
	Wed, 18 Mar 2009 18:43:31 GMT (envelope-from luigi@svn.freebsd.org)
Message-Id: <200903181843.n2IIhVmp034404@svn.freebsd.org>
From: Luigi Rizzo 
Date: Wed, 18 Mar 2009 18:43: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: r189978 - head/release/picobsd/build
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 18 Mar 2009 18:43:32 -0000

Author: luigi
Date: Wed Mar 18 18:43:31 2009
New Revision: 189978
URL: http://svn.freebsd.org/changeset/base/189978

Log:
  add the option to picobsd to copy files from the host filesystem
  without root privs. This is done, among other things, replacing
  the absolute paths in the symlinks with relative paths, so we
  do not need to do a chroot to follow them.
  
  Still need to update the manpage.
  
  MFC after:	3 days

Modified:
  head/release/picobsd/build/picobsd

Modified: head/release/picobsd/build/picobsd
==============================================================================
--- head/release/picobsd/build/picobsd	Wed Mar 18 18:42:58 2009	(r189977)
+++ head/release/picobsd/build/picobsd	Wed Mar 18 18:43:31 2009	(r189978)
@@ -284,6 +284,9 @@ build_image() {
     if [ -f ${MY_TREE}/config ] ; then
 	. ${MY_TREE}/config
     fi
+    if [ -f ${o_additional_config} ] ; then
+	. ${o_additional_config}
+    fi
 
     # location of the object directory
     PICO_OBJ=${l_objtree}/picobsd/${THETYPE}
@@ -529,6 +532,32 @@ populate_floppy_fs() {		# OK
     ) || true
 }
 
+# Copy the specified files to the destination filesystem.
+# Each file is specified as a pair "src dst", dst is assumed to be
+# a directory (and created with mkdir -p) if it has a trailing /
+# Be careful to escape metacharacters.
+# You can use ${CROSS} to point to the root of the cross build
+# (remember that it might be incomplete)
+
+do_copyfiles() {	# rootdir varname
+	log Copy files to $1
+	local root=$1
+	local srcs dst
+	local CROSS=${_SHLIBDIRPREFIX}
+	eval set "\${${2}}"
+        srcs=""
+	for dst in $* ; do
+		[ x"$srcs" = x ] && srcs=$dst && continue
+		eval srcs="$srcs"	# expand wildcard and vars
+		case x"$dst" in
+		*/ )	mkdir -p ${root}/${dst} ;;
+		# * )	mkdir -p `dirname ${root}/${dst}` ;;
+		esac
+		cp -p ${srcs} ${root}/${dst} || true
+		srcs=""
+        done
+}
+
 # Populate the memory filesystem with binaries and non-variable
 # configuration files.
 # First do an mtree pass, then create directory links and device entries,
@@ -537,7 +566,7 @@ populate_floppy_fs() {		# OK
 # Finally, if required, make a copy of the floppy.tree onto /fd
 
 populate_mfs_tree() {
-    local a dst MFS_TREE
+    local i j a dst MFS_TREE
 
     log "populate_mfs_tree()"
     dst=${BUILDDIR}/mfs.tree
@@ -552,12 +581,15 @@ populate_mfs_tree() {
     log "Running mtree using $a..."
     mtree -deU -f $a -p ${dst} > /dev/null || fail $? mtree
 
-    # XXX create links
+    # Create symlinks using relative pathnames, so it is possible
+    # to follow them also when building the image.
+    # Note that names in STAND_LINKS should not have a leading /
     for i in ${STAND_LINKS}; do
-	ln -s /stand ${dst}/$i
+	j=`echo $i | sed -E 's:^[^/]+::;s:/[^/]+:../:g'`
+	ln -s ${j}stand ${dst}/$i
     done
-    ln -s /dev/null ${dst}/var/run/log
-    ln -s /etc/termcap ${dst}/usr/share/misc/termcap
+    ln -s ../../dev/null ${dst}/var/run/log
+    ln -s ../../../etc/termcap ${dst}/usr/share/misc/termcap
 
     ### now build the crunched binaries ###
     (
@@ -629,6 +661,13 @@ populate_mfs_tree() {
 	(cd ${dst}; chown -R root . )
     fi
 
+    if [ -n "${copy_files}" ] ; then
+	do_copyfiles ${dst} copy_files
+    fi
+
+    # The 'import_files' mechanism is deprecated, as it requires
+    # root permissions to follow the symlinks, and also does
+    # not let you rename the entries.
     if [ -n "${import_files}" ] ; then
 	log "importing ${import_files} into mfs"
 	# We do it in a chroot environment on the target so
@@ -641,6 +680,7 @@ populate_mfs_tree() {
 	rm -rf ${dst}/rescue
     fi
 
+    # final step -- build the mfs image
     (cd ${BUILDDIR}
 	# override the owner
 	echo "/set uid=0 gid=0" > mtree.out
@@ -916,6 +956,11 @@ while [ true ]; do
 	generate_iso="YES"
 	;;
 
+    --cfg) # read additional config from this file
+	o_additional_config=`realpath $2`
+	shift
+	;;
+
     *)
 	break
 	;;

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 18 19:28:17 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C0046106564A;
	Wed, 18 Mar 2009 19:28:17 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id AD4468FC22;
	Wed, 18 Mar 2009 19:28:17 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2IJSH9m035501;
	Wed, 18 Mar 2009 19:28:17 GMT (envelope-from sam@svn.freebsd.org)
Received: (from sam@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2IJSHHm035494;
	Wed, 18 Mar 2009 19:28:17 GMT (envelope-from sam@svn.freebsd.org)
Message-Id: <200903181928.n2IJSHHm035494@svn.freebsd.org>
From: Sam Leffler 
Date: Wed, 18 Mar 2009 19:28: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: r189980 - in head/sys: dev/ath 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: Wed, 18 Mar 2009 19:28:18 -0000

Author: sam
Date: Wed Mar 18 19:28:17 2009
New Revision: 189980
URL: http://svn.freebsd.org/changeset/base/189980

Log:
  Minor cleanups of tdma protocol handling:
  o break out version-related code to simplify rev'ing the protocol
  o add parameter validation macros so checks that appear multiple places
    are consistent (and easy to change)
  o add protocol version check when looking for a scan candidate
  o improve scan debug output format
  o rewrite beacon update handling to calculate a bitmask of changed values
    and pass that down through the driver callback so drivers can optimize work
  o do slot bounds check before use when parsing received beacons

Modified:
  head/sys/dev/ath/if_ath.c
  head/sys/net80211/ieee80211.h
  head/sys/net80211/ieee80211_scan_sta.c
  head/sys/net80211/ieee80211_tdma.c
  head/sys/net80211/ieee80211_tdma.h
  head/sys/net80211/ieee80211_var.h

Modified: head/sys/dev/ath/if_ath.c
==============================================================================
--- head/sys/dev/ath/if_ath.c	Wed Mar 18 18:46:50 2009	(r189979)
+++ head/sys/dev/ath/if_ath.c	Wed Mar 18 19:28:17 2009	(r189980)
@@ -225,7 +225,7 @@ static void	ath_tdma_bintvalsetup(struct
 		    const struct ieee80211_tdma_state *tdma);
 static void	ath_tdma_config(struct ath_softc *sc, struct ieee80211vap *vap);
 static void	ath_tdma_update(struct ieee80211_node *ni,
-		    const struct ieee80211_tdma_param *tdma);
+		    const struct ieee80211_tdma_param *tdma, int);
 static void	ath_tdma_beacon_send(struct ath_softc *sc,
 		    struct ieee80211vap *vap);
 
@@ -7477,7 +7477,7 @@ ath_tdma_config(struct ath_softc *sc, st
  */
 static void
 ath_tdma_update(struct ieee80211_node *ni,
-	const struct ieee80211_tdma_param *tdma)
+	const struct ieee80211_tdma_param *tdma, int changed)
 {
 #define	TSF_TO_TU(_h,_l) \
 	((((u_int32_t)(_h)) << 22) | (((u_int32_t)(_l)) >> 10))
@@ -7498,7 +7498,7 @@ ath_tdma_update(struct ieee80211_node *n
 	/*
 	 * Check for and adopt configuration changes.
 	 */
-	if (isset(ATH_VAP(vap)->av_boff.bo_flags, IEEE80211_BEACON_TDMA)) {
+	if (changed != 0) {
 		const struct ieee80211_tdma_state *ts = vap->iv_tdma;
 
 		ath_tdma_bintvalsetup(sc, ts);

Modified: head/sys/net80211/ieee80211.h
==============================================================================
--- head/sys/net80211/ieee80211.h	Wed Mar 18 18:46:50 2009	(r189979)
+++ head/sys/net80211/ieee80211.h	Wed Mar 18 19:28:17 2009	(r189980)
@@ -1077,15 +1077,27 @@ struct ieee80211_duration {
 #define	ATH_FF_SNAP_ORGCODE_1	0x03
 #define	ATH_FF_SNAP_ORGCODE_2	0x7f
 
+/* NB: Atheros allocated the OUI for this purpose ~2005 but beware ... */
+#define	TDMA_OUI		ATH_OUI
+#define	TDMA_OUI_TYPE		0x02
+#define	TDMA_VERSION_V2		2
+#define	TDMA_VERSION		TDMA_VERSION_V2
+
+/* NB: we only support 2 right now but protocol handles up to 8 */
+#define	TDMA_MAXSLOTS		2	/* max slots/sta's */
+
+#define	TDMA_PARAM_LEN_V2	sizeof(struct ieee80211_tdma_param)
+
 struct ieee80211_tdma_param {
 	u_int8_t	tdma_id;	/* IEEE80211_ELEMID_VENDOR */
 	u_int8_t	tdma_len;
 	u_int8_t	tdma_oui[3];	/* 0x00, 0x03, 0x7f */
 	u_int8_t	tdma_type;	/* OUI type */
 	u_int8_t	tdma_subtype;	/* OUI subtype */
+#define	TDMA_SUBTYPE_PARAM	0x01
 	u_int8_t	tdma_version;	/* spec revision */
-	u_int8_t	tdma_slot;	/* station slot # */
-	u_int8_t	tdma_slotcnt;	/* bss slot count */
+	u_int8_t	tdma_slot;	/* station slot # [0..7] */
+	u_int8_t	tdma_slotcnt;	/* bss slot count [1..8] */
 	u_int16_t	tdma_slotlen;	/* bss slot len (100us) */
 	u_int8_t	tdma_bintval;	/* beacon interval (superframes) */
 	u_int8_t	tdma_inuse[1];	/* slot occupancy map */
@@ -1093,10 +1105,14 @@ struct ieee80211_tdma_param {
 	u_int8_t	tdma_tstamp[8];	/* timestamp from last beacon */
 } __packed;
 
-/* NB: Atheros allocated the OUI for this purpose ~3 years ago but beware ... */
-#define	TDMA_OUI		ATH_OUI
-#define	TDMA_OUI_TYPE		0x02
-#define	TDMA_SUBTYPE_PARAM	0x01
-#define	TDMA_VERSION		2
+#define	TDMA_VERSION_VALID(_version) \
+	(TDMA_VERSION_V2 <= (_version) && (_version) <= TDMA_VERSION)
+#define	TDMA_SLOTCNT_VALID(_slotcnt) \
+	(2 <= (_slotcnt) && (_slotcnt) <= TDMA_MAXSLOTS)
+/* XXX magic constants */
+#define	TDMA_SLOTLEN_VALID(_slotlen) \
+	(2*100 <= (_slotlen) && (unsigned)(_slotlen) <= 0xfffff)
+/* XXX probably should set a max */
+#define	TDMA_BINTVAL_VALID(_bintval)	(1 <= (_bintval))
 
 #endif /* _NET80211_IEEE80211_H_ */

Modified: head/sys/net80211/ieee80211_scan_sta.c
==============================================================================
--- head/sys/net80211/ieee80211_scan_sta.c	Wed Mar 18 18:46:50 2009	(r189979)
+++ head/sys/net80211/ieee80211_scan_sta.c	Wed Mar 18 19:28:17 2009	(r189980)
@@ -126,6 +126,7 @@ static void sta_flush_table(struct sta_t
 #define	MATCH_TDMA_NOTMASTER	0x0800	/* not TDMA master */
 #define	MATCH_TDMA_NOSLOT	0x1000	/* all TDMA slots occupied */
 #define	MATCH_TDMA_LOCAL	0x2000	/* local address */
+#define	MATCH_TDMA_VERSION	0x4000	/* protocol version mismatch */
 static int match_bss(struct ieee80211vap *,
 	const struct ieee80211_scan_state *, struct sta_entry *, int);
 static void adhoc_age(struct ieee80211_scan_state *);
@@ -970,9 +971,12 @@ match_bss(struct ieee80211vap *vap,
 		if (vap->iv_caps & IEEE80211_C_TDMA) {
 			const struct ieee80211_tdma_param *tdma =
 			    (const struct ieee80211_tdma_param *)se->se_ies.tdma_ie;
+			const struct ieee80211_tdma_state *ts = vap->iv_tdma;
 
 			if (tdma == NULL)
 				fail |= MATCH_TDMA_NOIE;
+			else if (tdma->tdma_version != ts->tdma_version)
+				fail |= MATCH_TDMA_VERSION;
 			else if (tdma->tdma_slot != 0)
 				fail |= MATCH_TDMA_NOTMASTER;
 			else if (tdma_isfull(tdma))
@@ -1062,9 +1066,10 @@ match_bss(struct ieee80211vap *vap,
 		    fail & MATCH_CC ? '$' :
 #ifdef IEEE80211_SUPPORT_TDMA
 		    fail & MATCH_TDMA_NOIE ? '&' :
-		    fail & MATCH_TDMA_NOTMASTER ? ':' :
-		    fail & MATCH_TDMA_NOSLOT ? '@' :
-		    fail & MATCH_TDMA_LOCAL ? '#' :
+		    fail & MATCH_TDMA_VERSION ? 'v' :
+		    fail & MATCH_TDMA_NOTMASTER ? 's' :
+		    fail & MATCH_TDMA_NOSLOT ? 'f' :
+		    fail & MATCH_TDMA_LOCAL ? 'l' :
 #endif
 		    fail ? '-' : '+', ether_sprintf(se->se_macaddr));
 		printf(" %s%c", ether_sprintf(se->se_bssid),
@@ -1076,8 +1081,7 @@ match_bss(struct ieee80211vap *vap,
 		    fail & MATCH_RATE ? '!' : ' ');
 		printf(" %4s%c",
 		    (se->se_capinfo & IEEE80211_CAPINFO_ESS) ? "ess" :
-		    (se->se_capinfo & IEEE80211_CAPINFO_IBSS) ? "ibss" :
-		    "????",
+		    (se->se_capinfo & IEEE80211_CAPINFO_IBSS) ? "ibss" : "",
 		    fail & MATCH_CAPINFO ? '!' : ' ');
 		printf(" %3s%c ",
 		    (se->se_capinfo & IEEE80211_CAPINFO_PRIVACY) ?

Modified: head/sys/net80211/ieee80211_tdma.c
==============================================================================
--- head/sys/net80211/ieee80211_tdma.c	Wed Mar 18 18:46:50 2009	(r189979)
+++ head/sys/net80211/ieee80211_tdma.c	Wed Mar 18 19:28:17 2009	(r189980)
@@ -142,6 +142,7 @@ ieee80211_tdma_vattach(struct ieee80211v
 		return;
 	}
 	/* NB: default configuration is passive so no beacons */
+	ts->tdma_version = TDMA_VERSION;
 	ts->tdma_slotlen = TDMA_SLOTLEN_DEFAULT;
 	ts->tdma_slotcnt = TDMA_SLOTCNT_DEFAULT;
 	ts->tdma_bintval = TDMA_BINTVAL_DEFAULT;
@@ -371,71 +372,90 @@ tdma_recv_mgmt(struct ieee80211_node *ni
  * a TDMA information element.  The sender's identity
  * is provided so we can track who our peer is.  If pickslot
  * is non-zero we scan the slot allocation state in the ie
- * locate a free slot for our use.
+ * to locate a free slot for our use.
  */
 static int
 tdma_update(struct ieee80211vap *vap, const struct ieee80211_tdma_param *tdma,
 	struct ieee80211_node *ni, int pickslot)
 {
 	struct ieee80211_tdma_state *ts = vap->iv_tdma;
-	int slotlen, slotcnt, slot, bintval;
+	int slot, slotlen, update;
 
 	KASSERT(vap->iv_caps & IEEE80211_C_TDMA,
 	     ("not a tdma vap, caps 0x%x", vap->iv_caps));
 
-	slotlen = le16toh(tdma->tdma_slotlen);
-	slotcnt = tdma->tdma_slotcnt;
-	bintval = tdma->tdma_bintval;
-
-	/* XXX rate-limit printf's */
-	if (!(2 <= slotcnt && slotcnt <= IEEE80211_TDMA_MAXSLOTS)) {
-		printf("%s: bogus slot cnt %u\n", __func__, slotcnt);
-		return 0;
-	}
-	/* XXX magic constants */
-	if (slotlen < 2 || slotlen > (0xfffff/100)) {
-		printf("%s: bogus slot len %u\n", __func__, slotlen);
-		return 0;
-	}
-	if (bintval < 1) {
-		printf("%s: bogus beacon interval %u\n", __func__, bintval);
-		return 0;
-	}
+	update = 0;
+	if (tdma->tdma_slotcnt != ts->tdma_slotcnt) {
+		if (!TDMA_SLOTCNT_VALID(tdma->tdma_slotcnt)) {
+			printf("%s: bad slot cnt %u\n",
+			    __func__, tdma->tdma_slotcnt);
+			return 0;
+		}
+		update |= TDMA_UPDATE_SLOTCNT;
+ 	}
+	slotlen = le16toh(tdma->tdma_slotlen) * 100;
+	if (slotlen != ts->tdma_slotlen) {
+		if (!TDMA_SLOTLEN_VALID(slotlen)) {
+			printf("%s: bad slot len %u\n",
+			    __func__, slotlen);
+			return 0;
+		}
+		update |= TDMA_UPDATE_SLOTLEN;
+ 	}
+	if (tdma->tdma_bintval != ts->tdma_bintval) {
+		if (!TDMA_BINTVAL_VALID(tdma->tdma_bintval)) {
+			printf("%s: bad beacon interval %u\n",
+			    __func__, tdma->tdma_bintval);
+			return 0;
+		}
+		update |= TDMA_UPDATE_BINTVAL;
+ 	}
+	slot = ts->tdma_slot;
 	if (pickslot) {
 		/*
 		 * Pick unoccupied slot.  Note we never choose slot 0.
 		 */
-		for (slot = slotcnt-1; slot > 0; slot--)
+		for (slot = tdma->tdma_slotcnt-1; slot > 0; slot--)
 			if (isclr(tdma->tdma_inuse, slot))
 				break;
 		if (slot <= 0) {
 			printf("%s: no free slot, slotcnt %u inuse: 0x%x\n",
-				__func__, slotcnt, tdma->tdma_inuse[0]);
+				__func__, tdma->tdma_slotcnt,
+				tdma->tdma_inuse[0]);
 			/* XXX need to do something better */
 			return 0;
 		}
-	} else
-		slot = ts->tdma_slot;
+		if (slot != ts->tdma_slot)
+			update |= TDMA_UPDATE_SLOT;
+	}
+	if (ni != ts->tdma_peer) {
+		/* update everything */
+		update = TDMA_UPDATE_SLOT
+		       | TDMA_UPDATE_SLOTCNT
+		       | TDMA_UPDATE_SLOTLEN
+		       | TDMA_UPDATE_BINTVAL;
+	}
 
-	if (slotcnt != ts->tdma_slotcnt ||
-	    100*slotlen != ts->tdma_slotlen ||
-	    bintval != ts->tdma_bintval ||
-	    slot != ts->tdma_slot ||
-	    ts->tdma_peer != ni) {
+	if (update) {
 		/*
 		 * New/changed parameters; update runtime state.
 		 */
 		/* XXX overwrites user parameters */
-		ts->tdma_slotcnt = slotcnt;
-		ts->tdma_slotlen = 100*slotlen;
-		ts->tdma_slot = slot;
-		ts->tdma_bintval = bintval;
+		if (update & TDMA_UPDATE_SLOTCNT)
+			ts->tdma_slotcnt = tdma->tdma_slotcnt;
+		if (update & TDMA_UPDATE_SLOTLEN)
+			ts->tdma_slotlen = slotlen;
+		if (update & TDMA_UPDATE_SLOT)
+			ts->tdma_slot = slot;
+		if (update & TDMA_UPDATE_BINTVAL)
+			ts->tdma_bintval = tdma->tdma_bintval;
 		/* mark beacon to be updated before next xmit */
 		ieee80211_beacon_notify(vap, IEEE80211_BEACON_TDMA);
 
 		IEEE80211_DPRINTF(vap, IEEE80211_MSG_TDMA,
 		    "%s: slot %u slotcnt %u slotlen %u us bintval %u\n",
-		    __func__, slot, slotcnt, 100*slotlen, tdma->tdma_bintval);
+		    __func__, ts->tdma_slot, ts->tdma_slotcnt,
+		    100*ts->tdma_slotlen, ts->tdma_bintval);
 	}
 	/*
 	 * Notify driver.  Note we can be called before
@@ -445,7 +465,7 @@ tdma_update(struct ieee80211vap *vap, co
 	 * has been setup.  The next beacon will dtrt.
 	 */
 	if (vap->iv_state == IEEE80211_S_RUN)
-		vap->iv_ic->ic_tdma_update(ni, tdma);
+		vap->iv_ic->ic_tdma_update(ni, tdma, update);
 	/*
 	 * Dispatch join event on first beacon from new master.
 	 */
@@ -481,10 +501,23 @@ tdma_process_params(struct ieee80211_nod
 		    wh, "tdma", "too short, len %u", len);
 		return IEEE80211_REASON_IE_INVALID;
 	}
-	if (tdma->tdma_version != TDMA_VERSION) {
+	if (tdma->tdma_version != ts->tdma_version) {
+		IEEE80211_DISCARD_IE(vap,
+		    IEEE80211_MSG_ELEMID | IEEE80211_MSG_TDMA,
+		    wh, "tdma", "bad version %u (ours %u)",
+		    tdma->tdma_version, ts->tdma_version);
+		return IEEE80211_REASON_IE_INVALID;
+	}
+ 	/*
+	 * NB: ideally we'd check against tdma_slotcnt, but that
+	 * would require extra effort so do this easy check that
+	 * covers the work below; more stringent checks are done
+	 * before we make more extensive use of the ie contents.
+	 */
+	if (tdma->tdma_slot >= TDMA_MAXSLOTS) {
 		IEEE80211_DISCARD_IE(vap,
 		    IEEE80211_MSG_ELEMID | IEEE80211_MSG_TDMA,
-		    wh, "tdma", "bad version %u", tdma->tdma_version);
+		    wh, "tdma", "invalid slot %u", tdma->tdma_slot);
 		return IEEE80211_REASON_IE_INVALID;
 	}
 	/*
@@ -612,7 +645,7 @@ ieee80211_add_tdma(uint8_t *frm, struct 
 		.tdma_subtype	= TDMA_SUBTYPE_PARAM,
 		.tdma_version	= TDMA_VERSION,
 	};
-	const struct ieee80211_tdma_state *tdma = vap->iv_tdma;
+	const struct ieee80211_tdma_state *ts = vap->iv_tdma;
 	uint16_t slotlen;
 
 	KASSERT(vap->iv_caps & IEEE80211_C_TDMA,
@@ -620,13 +653,13 @@ ieee80211_add_tdma(uint8_t *frm, struct 
 
 	memcpy(frm, ¶m, sizeof(param));
 	frm += __offsetof(struct ieee80211_tdma_param, tdma_slot);
-	*frm++ = tdma->tdma_slot;
-	*frm++ = tdma->tdma_slotcnt;
+	*frm++ = ts->tdma_slot;
+	*frm++ = ts->tdma_slotcnt;
 	/* NB: convert units to fit in 16-bits */
-	slotlen = tdma->tdma_slotlen / 100;	/* 100us units */
+	slotlen = ts->tdma_slotlen / 100;	/* 100us units */
 	ADDSHORT(frm, slotlen);
-	*frm++ = tdma->tdma_bintval;
-	*frm++ = tdma->tdma_inuse[0];
+	*frm++ = ts->tdma_bintval;
+	*frm++ = ts->tdma_inuse[0];
 	frm += 10;				/* pad+timestamp */
 	return frm; 
 #undef ADDSHORT
@@ -717,8 +750,7 @@ ieee80211_tdma_ioctl_set80211(struct iee
 		}
 		break;
 	case IEEE80211_IOC_TDMA_SLOTCNT:
-		if (!(2 <= ireq->i_val &&
-		      ireq->i_val <= IEEE80211_TDMA_MAXSLOTS))
+		if (!TDMA_SLOTCNT_VALID(ireq->i_val))
 			return EINVAL;
 		if (ireq->i_val != ts->tdma_slotcnt) {
 			ts->tdma_slotcnt = ireq->i_val;
@@ -732,7 +764,7 @@ ieee80211_tdma_ioctl_set80211(struct iee
 		 * 0xfffff is the max duration for bursting
 		 * (implict by way of 16-bit data type for i_val)
 		 */
-		if (ireq->i_val < 150)
+		if (!TDMA_SLOTLEN_VALID(ireq->i_val))
 			return EINVAL;
 		if (ireq->i_val != ts->tdma_slotlen) {
 			ts->tdma_slotlen = ireq->i_val;
@@ -740,7 +772,7 @@ ieee80211_tdma_ioctl_set80211(struct iee
 		}
 		break;
 	case IEEE80211_IOC_TDMA_BINTERVAL:
-		if (ireq->i_val < 1)
+		if (!TDMA_BINTVAL_VALID(ireq->i_val))
 			return EINVAL;
 		if (ireq->i_val != ts->tdma_bintval) {
 			ts->tdma_bintval = ireq->i_val;

Modified: head/sys/net80211/ieee80211_tdma.h
==============================================================================
--- head/sys/net80211/ieee80211_tdma.h	Wed Mar 18 18:46:50 2009	(r189979)
+++ head/sys/net80211/ieee80211_tdma.h	Wed Mar 18 19:28:17 2009	(r189980)
@@ -33,11 +33,11 @@
  */
 struct ieee80211_tdma_state {
 	u_int	tdma_slotlen;		/* bss slot length (us) */
+	uint8_t	tdma_version;		/* protocol version to use */
 	uint8_t	tdma_slotcnt;		/* bss slot count */
 	uint8_t	tdma_bintval;		/* beacon interval (slots) */
 	uint8_t	tdma_slot;		/* station slot # */
 	uint8_t	tdma_inuse[1];		/* mask of slots in use */
-#define	IEEE80211_TDMA_MAXSLOTS	8
 	void	*tdma_peer;		/* peer station cookie */
 	uint8_t	tdma_active[1];		/* mask of active slots */
 	int	tdma_count;		/* active/inuse countdown */
@@ -49,6 +49,11 @@ struct ieee80211_tdma_state {
 		    struct mbuf *, int, int, int, uint32_t);
 	void	(*tdma_opdetach)(struct ieee80211vap *);
 };
+ 
+#define	TDMA_UPDATE_SLOT	0x0001	/* tdma_slot changed */
+#define	TDMA_UPDATE_SLOTCNT	0x0002	/* tdma_slotcnt changed */
+#define	TDMA_UPDATE_SLOTLEN	0x0004	/* tdma_slotlen changed */
+#define	TDMA_UPDATE_BINTVAL	0x0008	/* tdma_bintval changed */
 
 void	ieee80211_tdma_vattach(struct ieee80211vap *);
 

Modified: head/sys/net80211/ieee80211_var.h
==============================================================================
--- head/sys/net80211/ieee80211_var.h	Wed Mar 18 18:46:50 2009	(r189979)
+++ head/sys/net80211/ieee80211_var.h	Wed Mar 18 19:28:17 2009	(r189980)
@@ -229,7 +229,7 @@ struct ieee80211com {
 	void			(*ic_newassoc)(struct ieee80211_node *, int);
 	/* TDMA update notification */
 	void			(*ic_tdma_update)(struct ieee80211_node *,
-				    const struct ieee80211_tdma_param *);
+				    const struct ieee80211_tdma_param *, int);
 	/* node state management */
 	struct ieee80211_node*	(*ic_node_alloc)(struct ieee80211vap *,
 				    const uint8_t [IEEE80211_ADDR_LEN]);

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 18 19:38:39 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D5DCD1065673;
	Wed, 18 Mar 2009 19:38:39 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A9E2A8FC19;
	Wed, 18 Mar 2009 19:38:39 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2IJcdX6035738;
	Wed, 18 Mar 2009 19:38:39 GMT (envelope-from sam@svn.freebsd.org)
Received: (from sam@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2IJcdnk035736;
	Wed, 18 Mar 2009 19:38:39 GMT (envelope-from sam@svn.freebsd.org)
Message-Id: <200903181938.n2IJcdnk035736@svn.freebsd.org>
From: Sam Leffler 
Date: Wed, 18 Mar 2009 19:38: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: r189981 - 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: Wed, 18 Mar 2009 19:38:40 -0000

Author: sam
Date: Wed Mar 18 19:38:39 2009
New Revision: 189981
URL: http://svn.freebsd.org/changeset/base/189981

Log:
  rate limit printfs for invalid tdma ie contents; probably want this to
  be less than 1/sec

Modified:
  head/sys/net80211/ieee80211_tdma.c
  head/sys/net80211/ieee80211_tdma.h

Modified: head/sys/net80211/ieee80211_tdma.c
==============================================================================
--- head/sys/net80211/ieee80211_tdma.c	Wed Mar 18 19:28:17 2009	(r189980)
+++ head/sys/net80211/ieee80211_tdma.c	Wed Mar 18 19:38:39 2009	(r189981)
@@ -387,8 +387,9 @@ tdma_update(struct ieee80211vap *vap, co
 	update = 0;
 	if (tdma->tdma_slotcnt != ts->tdma_slotcnt) {
 		if (!TDMA_SLOTCNT_VALID(tdma->tdma_slotcnt)) {
-			printf("%s: bad slot cnt %u\n",
-			    __func__, tdma->tdma_slotcnt);
+			if (ppsratecheck(&ts->tdma_lastprint, &ts->tdma_fails, 1))
+				printf("%s: bad slot cnt %u\n",
+				    __func__, tdma->tdma_slotcnt);
 			return 0;
 		}
 		update |= TDMA_UPDATE_SLOTCNT;
@@ -396,16 +397,18 @@ tdma_update(struct ieee80211vap *vap, co
 	slotlen = le16toh(tdma->tdma_slotlen) * 100;
 	if (slotlen != ts->tdma_slotlen) {
 		if (!TDMA_SLOTLEN_VALID(slotlen)) {
-			printf("%s: bad slot len %u\n",
-			    __func__, slotlen);
+			if (ppsratecheck(&ts->tdma_lastprint, &ts->tdma_fails, 1))
+				printf("%s: bad slot len %u\n",
+				    __func__, slotlen);
 			return 0;
 		}
 		update |= TDMA_UPDATE_SLOTLEN;
  	}
 	if (tdma->tdma_bintval != ts->tdma_bintval) {
 		if (!TDMA_BINTVAL_VALID(tdma->tdma_bintval)) {
-			printf("%s: bad beacon interval %u\n",
-			    __func__, tdma->tdma_bintval);
+			if (ppsratecheck(&ts->tdma_lastprint, &ts->tdma_fails, 1))
+				printf("%s: bad beacon interval %u\n",
+				    __func__, tdma->tdma_bintval);
 			return 0;
 		}
 		update |= TDMA_UPDATE_BINTVAL;

Modified: head/sys/net80211/ieee80211_tdma.h
==============================================================================
--- head/sys/net80211/ieee80211_tdma.h	Wed Mar 18 19:28:17 2009	(r189980)
+++ head/sys/net80211/ieee80211_tdma.h	Wed Mar 18 19:38:39 2009	(r189981)
@@ -38,9 +38,11 @@ struct ieee80211_tdma_state {
 	uint8_t	tdma_bintval;		/* beacon interval (slots) */
 	uint8_t	tdma_slot;		/* station slot # */
 	uint8_t	tdma_inuse[1];		/* mask of slots in use */
-	void	*tdma_peer;		/* peer station cookie */
 	uint8_t	tdma_active[1];		/* mask of active slots */
 	int	tdma_count;		/* active/inuse countdown */
+	void	*tdma_peer;		/* peer station cookie */
+	struct timeval tdma_lastprint;	/* time of last rate-limited printf */
+	int	tdma_fails;		/* fail count for rate-limiting */
 
 	/* parent method pointers */
 	int	(*tdma_newstate)(struct ieee80211vap *, enum ieee80211_state,

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 18 20:03:33 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BA39C1065702;
	Wed, 18 Mar 2009 20:03:33 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A87428FC18;
	Wed, 18 Mar 2009 20:03:33 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2IK3X14036278;
	Wed, 18 Mar 2009 20:03:33 GMT (envelope-from imp@svn.freebsd.org)
Received: (from imp@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2IK3Xhb036277;
	Wed, 18 Mar 2009 20:03:33 GMT (envelope-from imp@svn.freebsd.org)
Message-Id: <200903182003.n2IK3Xhb036277@svn.freebsd.org>
From: Warner Losh 
Date: Wed, 18 Mar 2009 20:03: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: r189983 - 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: Wed, 18 Mar 2009 20:03:35 -0000

Author: imp
Date: Wed Mar 18 20:03:33 2009
New Revision: 189983
URL: http://svn.freebsd.org/changeset/base/189983

Log:
  Reference exca.

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

Modified: head/share/man/man4/pccbb.4
==============================================================================
--- head/share/man/man4/pccbb.4	Wed Mar 18 19:51:40 2009	(r189982)
+++ head/share/man/man4/pccbb.4	Wed Mar 18 20:03:33 2009	(r189983)
@@ -34,6 +34,7 @@
 .Cd device cbb
 .Cd device pccard
 .Cd device cardbus
+.Cd device exca
 .Sh DESCRIPTION
 The
 .Nm
@@ -178,4 +179,5 @@ debugging problems with the bridge chips
 .El
 .Sh SEE ALSO
 .Xr cardbus 4 ,
-.Xr pccard 4
+.Xr pccard 4 ,
+.Xr exca 4

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 18 21:02:00 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BBDE6106566C;
	Wed, 18 Mar 2009 21:02:00 +0000 (UTC)
	(envelope-from kostikbel@gmail.com)
Received: from mail.terabit.net.ua (mail.terabit.net.ua [195.137.202.147])
	by mx1.freebsd.org (Postfix) with ESMTP id 5565D8FC12;
	Wed, 18 Mar 2009 21:02:00 +0000 (UTC)
	(envelope-from kostikbel@gmail.com)
Received: from skuns.zoral.com.ua ([91.193.166.194] helo=mail.zoral.com.ua)
	by mail.terabit.net.ua with esmtps (TLSv1:AES256-SHA:256)
	(Exim 4.63 (FreeBSD)) (envelope-from )
	id 1Lk2ti-0007jP-UU; Wed, 18 Mar 2009 23:01:59 +0200
Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua
	[10.1.1.148])
	by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id n2IL1kFN035777
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 18 Mar 2009 23:01:46 +0200 (EET)
	(envelope-from kostikbel@gmail.com)
Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1])
	by deviant.kiev.zoral.com.ua (8.14.3/8.14.3) with ESMTP id
	n2IL1kY9011334; Wed, 18 Mar 2009 23:01:46 +0200 (EET)
	(envelope-from kostikbel@gmail.com)
Received: (from kostik@localhost)
	by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id n2IL1kNR011333; 
	Wed, 18 Mar 2009 23:01:46 +0200 (EET)
	(envelope-from kostikbel@gmail.com)
X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to
	kostikbel@gmail.com using -f
Date: Wed, 18 Mar 2009 23:01:46 +0200
From: Kostik Belousov 
To: John Baldwin 
Message-ID: <20090318210146.GG7716@deviant.kiev.zoral.com.ua>
References: <200812181158.mBIBwC50039690@svn.freebsd.org>
	<49BAA2C6.2000807@FreeBSD.org>
	<20090313212229.GW41617@deviant.kiev.zoral.com.ua>
	<200903181215.23213.jhb@freebsd.org>
Mime-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="QWpDgw58+k1mSFBj"
Content-Disposition: inline
In-Reply-To: <200903181215.23213.jhb@freebsd.org>
User-Agent: Mutt/1.4.2.3i
X-Virus-Scanned: ClamAV version 0.94.2,
	clamav-milter version 0.94.2 on skuns.kiev.zoral.com.ua
X-Virus-Status: Clean
X-Spam-Status: No, score=-4.4 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
X-Virus-Scanned: mail.terabit.net.ua 1Lk2ti-0007jP-UU
	ff02edea1678b6c9413a12e355346f4e
X-Terabit: YES
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r186276 - 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: Wed, 18 Mar 2009 21:02:01 -0000


--QWpDgw58+k1mSFBj
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, Mar 18, 2009 at 12:15:22PM -0400, John Baldwin wrote:
> On Friday 13 March 2009 5:22:29 pm Kostik Belousov wrote:
> > On Fri, Mar 13, 2009 at 02:15:34PM -0400, John Baldwin wrote:
> > > Konstantin Belousov wrote:
> > > >Author: kib
> > > >Date: Thu Dec 18 11:58:12 2008
> > > >New Revision: 186276
> > > >URL: http://svn.freebsd.org/changeset/base/186276
> > > >
> > > >Log:
> > > >  Do not return success and doomed vnode from lookup. LK_UPGRADE all=
ows
> > > >  the vnode to be reclaimed.
> > > > =20
> > > >  Tested by:	pho
> > > >  MFC after:	1 month
> > >=20
> > > Would EBADF be more appropriate?  That is what other places that chec=
k=20
> > > VI_DOOMED return for this type of check (e.g. in cache_lookup()).
> >=20
> > I do not think so. When we do namei lookup, there is actually no
> > file descriptor to be invalid. The fact the we lost the race with
> > forced unmount actually means that there is no more node with
> > supplied name.
>=20
> Hmm, I think a few places need to be fixed to ENOENT instead of EBADF the=
n:
>=20
> --- //depot/user/jhb/lock/kern/vfs_cache.c
> +++ /home/jhb/work/p4/lock/kern/vfs_cache.c
> @@ -315,7 +315,7 @@
>   * (negative cacheing), a status of ENOENT is returned. If the lookup
>   * fails, a status of zero is returned.  If the directory vnode is
>   * recycled out from under us due to a forced unmount, a status of
> - * EBADF is returned.
> + * ENOENT is returned.
>   *
>   * vpp is locked and ref'd on return.  If we're looking up DOTDOT, dvp is
>   * unlocked.  If we're looking up . an extra ref is taken, but the lock =
is
> @@ -467,7 +467,7 @@
>  					/* forced unmount */
>  					vrele(*vpp);
>  					*vpp =3D NULL;
> -					return (EBADF);
> +					return (ENOENT);
>  				}
>  			} else
>  				vn_lock(*vpp, LK_DOWNGRADE | LK_RETRY);
> @@ -974,7 +974,7 @@
>  		if (vp->v_vflag & VV_ROOT) {
>  			if (vp->v_iflag & VI_DOOMED) {	/* forced unmount */
>  				CACHE_RUNLOCK();
> -				error =3D EBADF;
> +				error =3D ENOENT;
>  				break;
>  			}
>  			vp =3D vp->v_mount->mnt_vnodecovered;
> --- //depot/user/jhb/lock/kern/vfs_lookup.c
> +++ /home/jhb/work/p4/lock/kern/vfs_lookup.c
> @@ -602,7 +602,7 @@
>  			if ((dp->v_vflag & VV_ROOT) =3D=3D 0)
>  				break;
>  			if (dp->v_iflag & VI_DOOMED) {	/* forced unmount */
> -				error =3D EBADF;
> +				error =3D ENOENT;
>  				goto bad;
>  			}
>  			tdp =3D dp;
> @@ -764,9 +764,11 @@
>  	     *ndp->ni_next =3D=3D '/')) {
>  		cnp->cn_flags |=3D ISSYMLINK;
>  		if (dp->v_iflag & VI_DOOMED) {
> -			/* We can't know whether the directory was mounted with
> -			 * NOSYMFOLLOW, so we can't follow safely. */
> -			error =3D EBADF;
> +			/*
> +			 * We can't know whether the directory was mounted with
> +			 * NOSYMFOLLOW, so we can't follow safely.
> +			 */
> +			error =3D ENOENT;
>  			goto bad2;
>  		}
>  		if (dp->v_mount->mnt_flag & MNT_NOSYMFOLLOW) {
>=20

There is one place in lookup() that does MNT_UNION handling, it switches
to the covered directory when VOP_LOOKUP returns ENOENT. In current code,
EBADF from VOP_LOOKUP would cause namei to return, but with the change,
it will continue. I doubt that this can cause a problem.

Overall, it looks good to me.

--QWpDgw58+k1mSFBj
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (FreeBSD)

iEYEARECAAYFAknBYTkACgkQC3+MBN1Mb4hHpwCfetOfFkK8nJPRtZnYc1rYsWTZ
TRMAni18qQGC4JYrrn35L/5mjERHFbma
=Dm5Q
-----END PGP SIGNATURE-----

--QWpDgw58+k1mSFBj--

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 18 21:33:28 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 74E041065678;
	Wed, 18 Mar 2009 21:33:28 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 539F68FC1F;
	Wed, 18 Mar 2009 21:33:28 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2ILXSHM038160;
	Wed, 18 Mar 2009 21:33:28 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2ILXSYW038159;
	Wed, 18 Mar 2009 21:33:28 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <200903182133.n2ILXSYW038159@svn.freebsd.org>
From: Rui Paulo 
Date: Wed, 18 Mar 2009 21:33: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: r189987 - 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: Wed, 18 Mar 2009 21:33:32 -0000

Author: rpaulo
Date: Wed Mar 18 21:33:28 2009
New Revision: 189987
URL: http://svn.freebsd.org/changeset/base/189987

Log:
  Use plural in a comment. No functional change.

Modified:
  head/sys/net80211/ieee80211_input.c

Modified: head/sys/net80211/ieee80211_input.c
==============================================================================
--- head/sys/net80211/ieee80211_input.c	Wed Mar 18 20:42:00 2009	(r189986)
+++ head/sys/net80211/ieee80211_input.c	Wed Mar 18 21:33:28 2009	(r189987)
@@ -98,7 +98,7 @@ ieee80211_input_all(struct ieee80211com 
 }
 
 /*
- * This function reassemble fragments.
+ * This function reassembles fragments.
  *
  * XXX should handle 3 concurrent reassemblies per-spec.
  */

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 18 21:51:12 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 77B79106579B;
	Wed, 18 Mar 2009 21:51:12 +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 45CBE8FC15;
	Wed, 18 Mar 2009 21:51:12 +0000 (UTC)
	(envelope-from dougb@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2ILpCU7038757;
	Wed, 18 Mar 2009 21:51:12 GMT (envelope-from dougb@svn.freebsd.org)
Received: (from dougb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2ILpCrM038756;
	Wed, 18 Mar 2009 21:51:12 GMT (envelope-from dougb@svn.freebsd.org)
Message-Id: <200903182151.n2ILpCrM038756@svn.freebsd.org>
From: Doug Barton 
Date: Wed, 18 Mar 2009 21:51: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: r189992 - head/usr.sbin/mergemaster
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 18 Mar 2009 21:51:15 -0000

Author: dougb
Date: Wed Mar 18 21:51:11 2009
New Revision: 189992
URL: http://svn.freebsd.org/changeset/base/189992

Log:
  Add a new -F option to automatically install files that differ
  only by version control Id strings

Modified:
  head/usr.sbin/mergemaster/mergemaster.sh

Modified: head/usr.sbin/mergemaster/mergemaster.sh
==============================================================================
--- head/usr.sbin/mergemaster/mergemaster.sh	Wed Mar 18 21:51:02 2009	(r189991)
+++ head/usr.sbin/mergemaster/mergemaster.sh	Wed Mar 18 21:51:11 2009	(r189992)
@@ -15,7 +15,7 @@ PATH=/bin:/usr/bin:/usr/sbin
 display_usage () {
   VERSION_NUMBER=`grep "[$]FreeBSD:" $0 | cut -d ' ' -f 4`
   echo "mergemaster version ${VERSION_NUMBER}"
-  echo 'Usage: mergemaster [-scrvahipCPU]'
+  echo 'Usage: mergemaster [-scrvahipFCPU]'
   echo '    [-m /path] [-t /path] [-d] [-u N] [-w N] [-A arch] [-D /path]'
   echo "Options:"
   echo "  -s  Strict comparison (diff every pair of files)"
@@ -26,6 +26,7 @@ display_usage () {
   echo "  -h  Display more complete help"
   echo '  -i  Automatically install files that do not exist in destination directory'
   echo '  -p  Pre-buildworld mode, only compares crucial files'
+  echo '  -F  Install files that differ only by revision control Id ($FreeBSD$)'
   echo '  -C  Compare local rc.conf variables to the defaults'
   echo '  -P  Preserve files that are overwritten'
   echo "  -U  Attempt to auto upgrade files that have not been user modified"
@@ -264,11 +265,14 @@ MTREEFILE="${MTREEDB}/mergemaster.mtree"
 
 # Check the command line options
 #
-while getopts ":ascrvhipCPm:t:du:w:D:A:U" COMMAND_LINE_ARGUMENT ; do
+while getopts ":ascrvhipCPm:t:du:w:D:A:FU" COMMAND_LINE_ARGUMENT ; do
   case "${COMMAND_LINE_ARGUMENT}" in
   A)
     ARCHSTRING='TARGET_ARCH='${OPTARG}
     ;;
+  F)
+    FREEBSD_ID=yes
+    ;;
   U)
     AUTO_UPGRADE=yes
     ;;
@@ -1021,6 +1025,19 @@ for COMPFILE in `find . -type f -size +0
       # Use more if not.
       # Use unified diffs by default.  Context diffs give me a headache. :)
       #
+      # If the user chose the -F option, test for that before proceeding
+      #
+      if [ -n "$FREEBSD_ID" ]; then
+        if diff -q -I'[$]FreeBSD:.*$' "${DESTDIR}${COMPFILE#.}" "${COMPFILE}" > \
+            /dev/null 2>&1; then
+          if mm_install "${COMPFILE}"; then
+            echo "*** Updated revision control Id for ${DESTDIR}${COMPFILE#.}"
+          else
+            echo "*** Problem installing ${COMPFILE}, it will remain to merge by hand later"
+          fi
+          continue
+        fi
+      fi
       case "${AUTO_RUN}" in
       '')
         # prompt user to install/delete/merge changes

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 18 21:55:09 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id F3E4D1065675;
	Wed, 18 Mar 2009 21:55:08 +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 E192D8FC28;
	Wed, 18 Mar 2009 21:55:08 +0000 (UTC)
	(envelope-from dougb@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2ILt8KH038929;
	Wed, 18 Mar 2009 21:55:08 GMT (envelope-from dougb@svn.freebsd.org)
Received: (from dougb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2ILt8Ti038928;
	Wed, 18 Mar 2009 21:55:08 GMT (envelope-from dougb@svn.freebsd.org)
Message-Id: <200903182155.n2ILt8Ti038928@svn.freebsd.org>
From: Doug Barton 
Date: Wed, 18 Mar 2009 21:55:08 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r189994 - head/usr.sbin/mergemaster
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 18 Mar 2009 21:55:10 -0000

Author: dougb
Date: Wed Mar 18 21:55:08 2009
New Revision: 189994
URL: http://svn.freebsd.org/changeset/base/189994

Log:
  1. Update for new -F option from r189992.
  2. Sort the command line options to match how they are displayed
  in usage()
  3. Change references to cvs to the more generic "version control system"
  and remove the .Xr for cvs
  4. Consistently use ".Op Fl" to refer to command line options in the text.
  5. Only use the apostrophe to indicate possession.
  6. Add FREEBSD_ID (-F) to the list of variables in the example rc,
  and change the DIFF_OPTIONS example to -Bb since -F now covers it.

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

Modified: head/usr.sbin/mergemaster/mergemaster.8
==============================================================================
--- head/usr.sbin/mergemaster/mergemaster.8	Wed Mar 18 21:54:28 2009	(r189993)
+++ head/usr.sbin/mergemaster/mergemaster.8	Wed Mar 18 21:55:08 2009	(r189994)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd January 2, 2009
+.Dd March 18, 2009
 .Dt MERGEMASTER 8
 .Os
 .Sh NAME
@@ -32,14 +32,14 @@
 .Nd merge configuration files, et al during an upgrade
 .Sh SYNOPSIS
 .Nm
-.Op Fl achiprsvCPU
-.Op Fl A Ar Target architecture
-.Op Fl D Ar /destdir/path
+.Op Fl scrvahipFCPU
 .Op Fl m Ar /path/to/sources
 .Op Fl t Ar /path/to/temp/root
 .Op Fl d
 .Op Fl u Ar N
 .Op Fl w Ar N
+.Op Fl A Ar Target architecture
+.Op Fl D Ar /destdir/path
 .Sh DESCRIPTION
 The
 .Nm
@@ -82,15 +82,23 @@ merge by hand later.
 By default it creates the temporary root in
 .Pa /var/tmp/temproot
 and compares the
-.Xr cvs 1
-version $Id/$FreeBSD strings for files that have them, deleting
+Version Control System (VCS) Id strings ($FreeBSD$)
+for files that have them, deleting
 the temporary file if the strings match.
 If there is
-no $Id string, or if the strings are different it
+no Id string, or if the strings are different it
 compares the files themselves.
 You can
-also specify that the script ignore the $Id strings and
-compare every file.
+also specify that the script ignore the Id strings and
+compare every file with the
+.Op Fl s
+option.
+Using the
+.Op Fl F
+option
+.Nm
+will install the new file for you if they differ only by
+VCS strings.
 .Pp
 The merge menu option is designed to let you easily combine your
 customizations from the old version of a file into the new one.
@@ -117,11 +125,13 @@ After
 installing an updated version of this file you should
 probably run
 .Xr pwd_mkdb 8
-with the -p option to rebuild your password databases
+with the
+.Op Fl p
+option to rebuild your password databases
 and recreate
 .Pa /etc/passwd .
 .Pp
-The script uses the owner and group id's
+The script uses the owner and group ids
 that the files are created with by
 .Pa /usr/src/etc/Makefile ,
 and file permissions as specified by the umask.
@@ -158,9 +168,9 @@ and therefore can override both files.
 The options are as follows:
 .Bl -tag -width Fl
 .It Fl s
-Perform a strict comparison, diff'ing every pair of files.
+Perform a strict comparison, diffing every pair of files.
 This comparison is performed line by line,
-without regard to CVS $Id's.
+without regard to VCS Ids.
 .It Fl c
 Use context diffs instead of unified diffs.
 .It Fl r
@@ -189,8 +199,11 @@ directory exists, it creates a new one i
 non-existent directory.
 This option unsets the verbose flag,
 but is compatible with all other options.
-Setting -a makes
--w superfluous.
+Setting
+.Op Fl a
+makes
+.Op Fl w
+superfluous.
 .It Fl h
 Display usage and help information.
 .It Fl i
@@ -202,6 +215,9 @@ Compares only files known to be essentia
 {build|install}world,
 including
 .Pa /etc/make.conf .
+.It Fl F
+If the files differ only by VCS Id ($FreeBSD$)
+install the new file.
 .It Fl C
 After a standard
 .Nm
@@ -213,6 +229,8 @@ Preserve files that you replace in
 or another directory you specify in your
 .Nm
 rc file.
+.It Fl U
+Attempt to auto upgrade files that have not been user modified.
 .It Fl m Ar /path/to/sources
 Specify the path to the directory where you want to do the
 .Xr make 1 .
@@ -234,7 +252,9 @@ instead of the default
 .It Fl d
 Add the date and time to the name of the temporary
 root directory.
-If -t is specified, this option must
+If
+.Op Fl t
+is specified, this option must
 follow it if you want the date added too.
 .It Fl u Ar N
 Specify a numeric umask.
@@ -250,8 +270,6 @@ Specify an alternative
 architecture name.
 .It Fl D Ar /path
 Specify the destination directory for the installed files.
-.It Fl U
-Attempt to auto upgrade files that have not been user modified.
 .El
 .Sh ENVIRONMENT
 The
@@ -314,12 +332,15 @@ with all values commented out:
 # Specify the destination directory for the installed files
 #DESTDIR=
 #
-# Strict comparison bypasses the CVS $Id tests and compares every file
+# Strict comparison skips the VCS Id test and compares every file
 #STRICT=no
 #
 # Type of diff, such as unified, context, etc.
 #DIFF_FLAG='-u'
 #
+# Install the new file if it differs only by VCS Id ($FreeBSD$)
+#FREEBSD_ID=
+#
 # Verbose mode includes more details and additional checks
 #VERBOSE=
 #
@@ -345,7 +366,7 @@ with all values commented out:
 #IGNORE_FILES='/etc/motd /etc/printcap foo bar'
 #
 # Additional options for diff.  This will get unset when using -s.
-#DIFF_OPTIONS='-I$\&FreeBSD:.*[$]'	# Ignores CVS Id tags
+#DIFF_OPTIONS='-Bb'	# Ignore changes in whitespace
 #
 # Location to store the list of mtree values for AUTO_UPGRADE purposes
 #MTREEDB='/var/db'
@@ -382,7 +403,7 @@ Typically all you will need to do is typ
 .Nm
 at the prompt and the script will do all the work for you.
 .Pp
-To use context diff's and have
+To use context diffs and have
 .Nm
 explain more things as it goes along, use:
 .Pp
@@ -401,7 +422,6 @@ comparison, use:
 .Pp
 .Dl # mergemaster -sw 110
 .Sh SEE ALSO
-.Xr cvs 1 ,
 .Xr diff 1 ,
 .Xr make 1 ,
 .Xr more 1 ,

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 18 23:52:20 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id EFF89106564A;
	Wed, 18 Mar 2009 23:52:20 +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 DE26C8FC13;
	Wed, 18 Mar 2009 23:52:20 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2INqKQS041761;
	Wed, 18 Mar 2009 23:52:20 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2INqKsE041760;
	Wed, 18 Mar 2009 23:52:20 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <200903182352.n2INqKsE041760@svn.freebsd.org>
From: Marius Strobl 
Date: Wed, 18 Mar 2009 23:52: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: r190003 - head/sys/sparc64/sparc64
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 18 Mar 2009 23:52:21 -0000

Author: marius
Date: Wed Mar 18 23:52:20 2009
New Revision: 190003
URL: http://svn.freebsd.org/changeset/base/190003

Log:
  Add missing const.

Modified:
  head/sys/sparc64/sparc64/db_disasm.c

Modified: head/sys/sparc64/sparc64/db_disasm.c
==============================================================================
--- head/sys/sparc64/sparc64/db_disasm.c	Wed Mar 18 23:50:25 2009	(r190002)
+++ head/sys/sparc64/sparc64/db_disasm.c	Wed Mar 18 23:52:20 2009	(r190003)
@@ -82,14 +82,14 @@ struct sparc_insn {
 	  const char* format;
 };
 
-static const char* regs[] = {
+static const char *const regs[] = {
 	"g0", "g1", "g2", "g3", "g4", "g5", "g6", "g7",
 	"o0", "o1", "o2", "o3", "o4", "o5", "sp", "o7",
 	"l0", "l1", "l2", "l3", "l4", "l5", "l6", "l7",
 	"i0", "i1", "i2", "i3", "i4", "i5", "fp", "i7"
 };
 
-static const char* priv_regs[] = {
+static const char *const priv_regs[] = {
 	"tpc", "tnpc", "tstate", "tt", "tick", "tba", "pstate", "tl",
 	"pil", "cwp", "cansave", "canrestore", "cleanwin", "otherwin",
 	"wstate", "fq",
@@ -97,18 +97,18 @@ static const char* priv_regs[] = {
 	"", "", "", "", "", "", "", "ver"
 };
 
-static const char* state_regs[] = {
+static const char *const state_regs[] = {
 	"y", "", "ccr", "asi", "tick", "pc", "fprs", "asr",
 	"", "", "", "", "", "", "", "",
 	"pcr", "pic", "dcr", "gsr", "set_softint", "clr_softint", "softint",
 	"tick_cmpr", "sys_tick", "sys_tick_cmpr", "", "", "", "", "", "", ""
 };
 
-static const char* ccodes[] = {
+static const char *const ccodes[] = {
 	"fcc0", "fcc1", "fcc2", "fcc3", "icc", "", "xcc", ""
 };
 
-static const char* prefetch[] = {
+static const char *const prefetch[] = {
 	"n_reads", "one_read", "n_writes", "one_write", "page"
 };
 

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 19 00:44:22 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id F13B91065672;
	Thu, 19 Mar 2009 00:44:22 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id DFD3F8FC17;
	Thu, 19 Mar 2009 00:44:22 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2J0iMYk043004;
	Thu, 19 Mar 2009 00:44:22 GMT (envelope-from imp@svn.freebsd.org)
Received: (from imp@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2J0iMlD043003;
	Thu, 19 Mar 2009 00:44:22 GMT (envelope-from imp@svn.freebsd.org)
Message-Id: <200903190044.n2J0iMlD043003@svn.freebsd.org>
From: Warner Losh 
Date: Thu, 19 Mar 2009 00:44: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: r190007 - 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, 19 Mar 2009 00:44:23 -0000

Author: imp
Date: Thu Mar 19 00:44:22 2009
New Revision: 190007
URL: http://svn.freebsd.org/changeset/base/190007

Log:
  Add usr.bin/ar to the list of cross tools.  Before, when we had gnu
  ar, it was built in the gnu/usr.bin/binutils tree.  Now it isn't.
  
  Submitted by:	John Hein

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==============================================================================
--- head/Makefile.inc1	Thu Mar 19 00:28:54 2009	(r190006)
+++ head/Makefile.inc1	Thu Mar 19 00:44:22 2009	(r190007)
@@ -1017,6 +1017,7 @@ cross-tools:
 .for _tool in \
     gnu/usr.bin/binutils \
     gnu/usr.bin/cc \
+    usr.bin/ar \
     usr.bin/sed \
     usr.bin/xlint/lint1 usr.bin/xlint/lint2 usr.bin/xlint/xlint \
     ${_btxld} \

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 19 01:15:27 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4A75A106566B;
	Thu, 19 Mar 2009 01:15:27 +0000 (UTC) (envelope-from bms@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 385D18FC16;
	Thu, 19 Mar 2009 01:15:27 +0000 (UTC) (envelope-from bms@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2J1FROo043803;
	Thu, 19 Mar 2009 01:15:27 GMT (envelope-from bms@svn.freebsd.org)
Received: (from bms@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2J1FRwg043802;
	Thu, 19 Mar 2009 01:15:27 GMT (envelope-from bms@svn.freebsd.org)
Message-Id: <200903190115.n2J1FRwg043802@svn.freebsd.org>
From: Bruce M Simpson 
Date: Thu, 19 Mar 2009 01:15:27 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190011 - 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: Thu, 19 Mar 2009 01:15:27 -0000

Author: bms
Date: Thu Mar 19 01:15:26 2009
New Revision: 190011
URL: http://svn.freebsd.org/changeset/base/190011

Log:
  Comment IGMP_PIM as being very historic, as in, don't use.

Modified:
  head/sys/netinet/igmp.h

Modified: head/sys/netinet/igmp.h
==============================================================================
--- head/sys/netinet/igmp.h	Thu Mar 19 01:07:21 2009	(r190010)
+++ head/sys/netinet/igmp.h	Thu Mar 19 01:15:26 2009	(r190011)
@@ -108,7 +108,7 @@ struct igmp_report {
 #define IGMP_HOST_MEMBERSHIP_QUERY	0x11	/* membership query         */
 #define IGMP_v1_HOST_MEMBERSHIP_REPORT	0x12	/* Ver. 1 membership report */
 #define IGMP_DVMRP			0x13	/* DVMRP routing message    */
-#define IGMP_PIM			0x14	/* PIM routing message     */
+#define IGMP_PIM			0x14	/* PIMv1 message (historic) */
 #define IGMP_v2_HOST_MEMBERSHIP_REPORT	0x16	/* Ver. 2 membership report */
 #define IGMP_HOST_LEAVE_MESSAGE		0x17	/* Leave-group message     */
 #define IGMP_MTRACE_REPLY		0x1e	/* mtrace(8) reply */

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 19 01:43:04 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D1FF21065674;
	Thu, 19 Mar 2009 01:43:03 +0000 (UTC) (envelope-from bms@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id BD0478FC18;
	Thu, 19 Mar 2009 01:43:03 +0000 (UTC) (envelope-from bms@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2J1h3e8044354;
	Thu, 19 Mar 2009 01:43:03 GMT (envelope-from bms@svn.freebsd.org)
Received: (from bms@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2J1h38h044349;
	Thu, 19 Mar 2009 01:43:03 GMT (envelope-from bms@svn.freebsd.org)
Message-Id: <200903190143.n2J1h38h044349@svn.freebsd.org>
From: Bruce M Simpson 
Date: Thu, 19 Mar 2009 01:43: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: r190012 - in head: . sys/modules/ip6_mroute_mod
	sys/modules/ip_mroute_mod sys/netinet sys/netinet6 usr.bin/netstat
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 19 Mar 2009 01:43:05 -0000

Author: bms
Date: Thu Mar 19 01:43:03 2009
New Revision: 190012
URL: http://svn.freebsd.org/changeset/base/190012

Log:
  Introduce a number of changes to the MROUTING code.
  This is purely a forwarding plane cleanup; no control plane
  code is involved.
  
  Summary:
   * Split IPv4 and IPv6 MROUTING support. The static compile-time
     kernel option remains the same, however, the modules may now
     be built for IPv4 and IPv6 separately as ip_mroute_mod and
     ip6_mroute_mod.
   * Clean up the IPv4 multicast forwarding code to use BSD queue
     and hash table constructs. Don't build our own timer abstractions
     when ratecheck() and timevalclear() etc will do.
   * Expose the multicast forwarding cache (MFC) and virtual interface
     table (VIF) as sysctls, to reduce netstat's dependence on libkvm
     for this information for running kernels.
     * bandwidth meters however still require libkvm.
   * Make the MFC hash table size a boot/load-time tunable ULONG,
     net.inet.ip.mfchashsize (defaults to 256).
   * Remove unused members from struct vif and struct mfc.
   * Kill RSVP support, as no current RSVP implementation uses it.
     These stubs could be moved to raw_ip.c.
   * Don't share locks or initialization between IPv4 and IPv6.
   * Don't use a static struct route_in6 in ip6_mroute.c.
     The v6 code is still using a cached struct route_in6, this is
     moved to mif6 for the time being.
   * More cleanup remains to be merged from ip_mroute.c to ip6_mroute.c.
  
  v4 path tested using ports/net/mcast-tools.
  v6 changes are mostly mechanical locking and *have not* been tested.
  As these changes partially break some kernel ABIs, they will not
  be MFCed. There is a lot more work to be done here.
  
  Reviewed by:	Pavlin Radoslavov

Added:
  head/sys/modules/ip6_mroute_mod/
  head/sys/modules/ip6_mroute_mod/Makefile   (contents, props changed)
Modified:
  head/UPDATING
  head/sys/modules/ip_mroute_mod/Makefile
  head/sys/netinet/ip_mroute.c
  head/sys/netinet/ip_mroute.h
  head/sys/netinet6/ip6_mroute.c
  head/sys/netinet6/ip6_mroute.h
  head/usr.bin/netstat/main.c
  head/usr.bin/netstat/mroute.c
  head/usr.bin/netstat/netstat.h

Modified: head/UPDATING
==============================================================================
--- head/UPDATING	Thu Mar 19 01:15:26 2009	(r190011)
+++ head/UPDATING	Thu Mar 19 01:43:03 2009	(r190012)
@@ -22,6 +22,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8.
 	to maximize performance.  (To disable malloc debugging, run
 	ln -s aj /etc/malloc.conf.)
 
+20090319:
+	The multicast forwarding code has been cleaned up. netstat(1)
+	only relies on KVM now for printing bandwidth upcall meters.
+	The IPv4 and IPv6 modules are split into ip_mroute_mod and
+	ip6_mroute_mod respectively. The config(5) options for statically
+	compiling this code remain the same, i.e. 'options MROUTING'.
+
 20090315:
 	Support for the IFF_NEEDSGIANT network interface flag has been
 	removed, which means that non-MPSAFE network device drivers are no

Added: head/sys/modules/ip6_mroute_mod/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/modules/ip6_mroute_mod/Makefile	Thu Mar 19 01:43:03 2009	(r190012)
@@ -0,0 +1,19 @@
+# $FreeBSD$
+
+.include 
+
+.PATH: ${.CURDIR}/../../netinet6
+
+KMOD=	ip6_mroute
+
+SRCS=	ip6_mroute.c
+SRCS+=	opt_inet6.h opt_mac.h opt_mrouting.h
+
+.if !defined(KERNBUILDDIR)
+opt_inet6.h:
+	echo "#define INET6 1" > ${.TARGET}
+opt_mrouting.h:
+	echo "#define MROUTING 1" > ${.TARGET}
+.endif
+
+.include 

Modified: head/sys/modules/ip_mroute_mod/Makefile
==============================================================================
--- head/sys/modules/ip_mroute_mod/Makefile	Thu Mar 19 01:15:26 2009	(r190011)
+++ head/sys/modules/ip_mroute_mod/Makefile	Thu Mar 19 01:43:03 2009	(r190012)
@@ -8,21 +8,12 @@ KMOD=	ip_mroute
 
 SRCS=	ip_mroute.c
 SRCS+=	opt_inet.h opt_mac.h opt_mrouting.h opt_route.h
-SRCS+=	opt_inet6.h
-
-.if ${MK_INET6_SUPPORT} != "no"
-SRCS+=	ip6_mroute.c
-.endif
 
 .if !defined(KERNBUILDDIR)
 opt_inet.h:
 	echo "#define INET 1" > ${.TARGET}
 opt_mrouting.h:
 	echo "#define MROUTING 1" > ${.TARGET}
-.if ${MK_INET6_SUPPORT} != "no"
-opt_inet6.h:
-	echo "#define INET6 1" > ${.TARGET}
-.endif
 .endif
 
 .include 

Modified: head/sys/netinet/ip_mroute.c
==============================================================================
--- head/sys/netinet/ip_mroute.c	Thu Mar 19 01:15:26 2009	(r190011)
+++ head/sys/netinet/ip_mroute.c	Thu Mar 19 01:43:03 2009	(r190012)
@@ -53,11 +53,24 @@
  * bandwidth metering and signaling
  */
 
+/*
+ * TODO: Prefix functions with ipmf_.
+ * TODO: Maintain a refcount on if_allmulti() in ifnet or in the protocol
+ * domain attachment (if_afdata) so we can track consumers of that service.
+ * TODO: Deprecate routing socket path for SIOCGETSGCNT and SIOCGETVIFCNT,
+ * move it to socket options.
+ * TODO: Rototile log_debug to use KTR.
+ * TODO: Cleanup LSRR removal further.
+ * TODO: Push RSVP stubs into raw_ip.c.
+ * TODO: Use bitstring.h for vif set.
+ * TODO: Fix mrt6_ioctl dangling ref when dynamically loaded.
+ * TODO: Sync ip6_mroute.c with this file.
+ */
+
 #include 
 __FBSDID("$FreeBSD$");
 
 #include "opt_inet.h"
-#include "opt_inet6.h"
 #include "opt_mac.h"
 #include "opt_mrouting.h"
 
@@ -81,9 +94,11 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+
 #include 
 #include 
 #include 
+
 #include 
 #include 
 #include 
@@ -98,96 +113,84 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#ifdef INET6
-#include 
-#include 
-#include 
-#include 
-#endif
 #include 
 
 #include 
 
-/*
- * Control debugging code for rsvp and multicast routing code.
- * Can only set them with the debugger.
- */
-static u_int    rsvpdebug;		/* non-zero enables debugging	*/
-
-static u_int	mrtdebug;		/* any set of the flags below	*/
 #define		DEBUG_MFC	0x02
 #define		DEBUG_FORWARD	0x04
 #define		DEBUG_EXPIRE	0x08
 #define		DEBUG_XMIT	0x10
 #define		DEBUG_PIM	0x20
+static u_int	mrtdebug;
+SYSCTL_INT(_debug, OID_AUTO, mrtdebug, CTLFLAG_RW, &mrtdebug, 0,
+    "Enable/disable IPv4 multicast forwarding debugging flags");
 
 #define		VIFI_INVALID	((vifi_t) -1)
+#define		M_HASCL(m)	((m)->m_flags & M_EXT)
 
-#define M_HASCL(m)	((m)->m_flags & M_EXT)
-
-static MALLOC_DEFINE(M_MRTABLE, "mroutetbl", "multicast routing tables");
+static MALLOC_DEFINE(M_MRTABLE, "mroutetbl", "multicast forwarding cache");
 
 /*
  * Locking.  We use two locks: one for the virtual interface table and
  * one for the forwarding table.  These locks may be nested in which case
  * the VIF lock must always be taken first.  Note that each lock is used
  * to cover not only the specific data structure but also related data
- * structures.  It may be better to add more fine-grained locking later;
- * it's not clear how performance-critical this code is.
- *
- * XXX: This module could particularly benefit from being cleaned
- *      up to use the  macros.
- *
+ * structures.
  */
 
-static struct mrtstat	mrtstat;
-SYSCTL_STRUCT(_net_inet_ip, OID_AUTO, mrtstat, CTLFLAG_RW,
-    &mrtstat, mrtstat,
-    "Multicast Routing Statistics (struct mrtstat, netinet/ip_mroute.h)");
-
-static struct mfc	*mfctable[MFCTBLSIZ];
-SYSCTL_OPAQUE(_net_inet_ip, OID_AUTO, mfctable, CTLFLAG_RD,
-    &mfctable, sizeof(mfctable), "S,*mfc[MFCTBLSIZ]",
-    "Multicast Forwarding Table (struct *mfc[MFCTBLSIZ], netinet/ip_mroute.h)");
-
 static struct mtx mrouter_mtx;
 #define	MROUTER_LOCK()		mtx_lock(&mrouter_mtx)
 #define	MROUTER_UNLOCK()	mtx_unlock(&mrouter_mtx)
 #define	MROUTER_LOCK_ASSERT()	mtx_assert(&mrouter_mtx, MA_OWNED)
-#define	MROUTER_LOCK_INIT()	\
+#define	MROUTER_LOCK_INIT()						\
 	mtx_init(&mrouter_mtx, "IPv4 multicast forwarding", NULL, MTX_DEF)
 #define	MROUTER_LOCK_DESTROY()	mtx_destroy(&mrouter_mtx)
 
+static struct mrtstat	mrtstat;
+SYSCTL_STRUCT(_net_inet_ip, OID_AUTO, mrtstat, CTLFLAG_RW,
+    &mrtstat, mrtstat,
+    "IPv4 Multicast Forwarding Statistics (struct mrtstat, "
+    "netinet/ip_mroute.h)");
+
+static u_long			 mfchash;
+#define MFCHASH(a, g)							\
+	((((a).s_addr >> 20) ^ ((a).s_addr >> 10) ^ (a).s_addr ^ \
+	  ((g).s_addr >> 20) ^ ((g).s_addr >> 10) ^ (g).s_addr) & mfchash)
+#define MFCHASHSIZE	256
+
+static u_char			*nexpire;	/* 0..mfchashsize-1 */
+static u_long			 mfchashsize;	/* Hash size */
+LIST_HEAD(mfchashhdr, mfc)	*mfchashtbl;
+
 static struct mtx mfc_mtx;
-#define	MFC_LOCK()	mtx_lock(&mfc_mtx)
-#define	MFC_UNLOCK()	mtx_unlock(&mfc_mtx)
+#define	MFC_LOCK()		mtx_lock(&mfc_mtx)
+#define	MFC_UNLOCK()		mtx_unlock(&mfc_mtx)
 #define	MFC_LOCK_ASSERT()	mtx_assert(&mfc_mtx, MA_OWNED)
-#define	MFC_LOCK_INIT()	mtx_init(&mfc_mtx, "mroute mfc table", NULL, MTX_DEF)
+#define	MFC_LOCK_INIT()							\
+	mtx_init(&mfc_mtx, "IPv4 multicast forwarding cache", NULL, MTX_DEF)
 #define	MFC_LOCK_DESTROY()	mtx_destroy(&mfc_mtx)
 
+static vifi_t		numvifs;
 static struct vif	viftable[MAXVIFS];
 SYSCTL_OPAQUE(_net_inet_ip, OID_AUTO, viftable, CTLFLAG_RD,
     &viftable, sizeof(viftable), "S,vif[MAXVIFS]",
-    "Multicast Virtual Interfaces (struct vif[MAXVIFS], netinet/ip_mroute.h)");
+    "IPv4 Multicast Interfaces (struct vif[MAXVIFS], netinet/ip_mroute.h)");
 
 static struct mtx vif_mtx;
-#define	VIF_LOCK()	mtx_lock(&vif_mtx)
-#define	VIF_UNLOCK()	mtx_unlock(&vif_mtx)
+#define	VIF_LOCK()		mtx_lock(&vif_mtx)
+#define	VIF_UNLOCK()		mtx_unlock(&vif_mtx)
 #define	VIF_LOCK_ASSERT()	mtx_assert(&vif_mtx, MA_OWNED)
-#define	VIF_LOCK_INIT()	mtx_init(&vif_mtx, "mroute vif table", NULL, MTX_DEF)
+#define	VIF_LOCK_INIT()							\
+	mtx_init(&vif_mtx, "IPv4 multicast interfaces", NULL, MTX_DEF)
 #define	VIF_LOCK_DESTROY()	mtx_destroy(&vif_mtx)
 
-static u_char		nexpire[MFCTBLSIZ];
-
 static eventhandler_tag if_detach_event_tag = NULL;
 
 static struct callout expire_upcalls_ch;
-
 #define		EXPIRE_TIMEOUT	(hz / 4)	/* 4x / second		*/
 #define		UPCALL_EXPIRE	6		/* number of timeouts	*/
 
-#define ENCAP_TTL 64
-
 /*
  * Bandwidth meter variables and constants
  */
@@ -223,7 +226,7 @@ SYSCTL_ULONG(_net_inet_pim, OID_AUTO, sq
     "Disable IGMP_WHOLEPKT notifications if rendezvous point is unspecified");
 
 extern  struct domain inetdomain;
-struct protosw in_pim_protosw = {
+static const struct protosw in_pim_protosw = {
 	.pr_type =		SOCK_RAW,
 	.pr_domain =		&inetdomain,
 	.pr_protocol =		IPPROTO_PIM,
@@ -235,18 +238,6 @@ struct protosw in_pim_protosw = {
 };
 static const struct encaptab *pim_encap_cookie;
 
-#ifdef INET6
-/* ip6_mroute.c glue */
-extern struct in6_protosw in6_pim_protosw;
-static const struct encaptab *pim6_encap_cookie;
-
-extern int X_ip6_mrouter_set(struct socket *, struct sockopt *);
-extern int X_ip6_mrouter_get(struct socket *, struct sockopt *);
-extern int X_ip6_mrouter_done(void);
-extern int X_ip6_mforward(struct ip6_hdr *, struct ifnet *, struct mbuf *);
-extern int X_mrt6_ioctl(int, caddr_t);
-#endif
-
 static int pim_encapcheck(const struct mbuf *, int, int, void *);
 
 /*
@@ -264,6 +255,7 @@ struct pim_encap_pimhdr {
 	struct pim pim;
 	uint32_t   flags;
 };
+#define		PIM_ENCAP_TTL	64
 
 static struct ip pim_encap_iphdr = {
 #if BYTE_ORDER == LITTLE_ENDIAN
@@ -277,7 +269,7 @@ static struct ip pim_encap_iphdr = {
 	sizeof(struct ip),	/* total length */
 	0,			/* id */
 	0,			/* frag offset */
-	ENCAP_TTL,
+	PIM_ENCAP_TTL,
 	IPPROTO_PIM,
 	0,			/* checksum */
 };
@@ -297,129 +289,97 @@ static vifi_t reg_vif_num = VIFI_INVALID
 /*
  * Private variables.
  */
-static vifi_t	   numvifs;
 
-static u_long	X_ip_mcast_src(int vifi);
-static int	X_ip_mforward(struct ip *ip, struct ifnet *ifp,
-			struct mbuf *m, struct ip_moptions *imo);
+static u_long	X_ip_mcast_src(int);
+static int	X_ip_mforward(struct ip *, struct ifnet *, struct mbuf *,
+		    struct ip_moptions *);
 static int	X_ip_mrouter_done(void);
-static int	X_ip_mrouter_get(struct socket *so, struct sockopt *m);
-static int	X_ip_mrouter_set(struct socket *so, struct sockopt *m);
-static int	X_legal_vif_num(int vif);
-static int	X_mrt_ioctl(int cmd, caddr_t data, int fibnum);
-
-static int get_sg_cnt(struct sioc_sg_req *);
-static int get_vif_cnt(struct sioc_vif_req *);
-static void if_detached_event(void *arg __unused, struct ifnet *);
-static int ip_mrouter_init(struct socket *, int);
-static int add_vif(struct vifctl *);
-static int del_vif_locked(vifi_t);
-static int del_vif(vifi_t);
-static int add_mfc(struct mfcctl2 *);
-static int del_mfc(struct mfcctl2 *);
-static int set_api_config(uint32_t *); /* chose API capabilities */
-static int socket_send(struct socket *, struct mbuf *, struct sockaddr_in *);
-static int set_assert(int);
-static void expire_upcalls(void *);
-static int ip_mdq(struct mbuf *, struct ifnet *, struct mfc *, vifi_t);
-static void phyint_send(struct ip *, struct vif *, struct mbuf *);
-static void send_packet(struct vif *, struct mbuf *);
-
-/*
- * Bandwidth monitoring
- */
-static void free_bw_list(struct bw_meter *list);
-static int add_bw_upcall(struct bw_upcall *);
-static int del_bw_upcall(struct bw_upcall *);
-static void bw_meter_receive_packet(struct bw_meter *x, int plen,
-		struct timeval *nowp);
-static void bw_meter_prepare_upcall(struct bw_meter *x, struct timeval *nowp);
-static void bw_upcalls_send(void);
-static void schedule_bw_meter(struct bw_meter *x, struct timeval *nowp);
-static void unschedule_bw_meter(struct bw_meter *x);
-static void bw_meter_process(void);
-static void expire_bw_upcalls_send(void *);
-static void expire_bw_meter_process(void *);
-
-static int pim_register_send(struct ip *, struct vif *,
-		struct mbuf *, struct mfc *);
-static int pim_register_send_rp(struct ip *, struct vif *,
-		struct mbuf *, struct mfc *);
-static int pim_register_send_upcall(struct ip *, struct vif *,
-		struct mbuf *, struct mfc *);
-static struct mbuf *pim_register_prepare(struct ip *, struct mbuf *);
-
-/*
- * whether or not special PIM assert processing is enabled.
- */
-static int pim_assert;
-/*
- * Rate limit for assert notification messages, in usec
- */
-#define ASSERT_MSG_TIME		3000000
+static int	X_ip_mrouter_get(struct socket *, struct sockopt *);
+static int	X_ip_mrouter_set(struct socket *, struct sockopt *);
+static int	X_legal_vif_num(int);
+static int	X_mrt_ioctl(int, caddr_t, int);
+
+static int	add_bw_upcall(struct bw_upcall *);
+static int	add_mfc(struct mfcctl2 *);
+static int	add_vif(struct vifctl *);
+static void	bw_meter_prepare_upcall(struct bw_meter *, struct timeval *);
+static void	bw_meter_process(void);
+static void	bw_meter_receive_packet(struct bw_meter *, int,
+		    struct timeval *);
+static void	bw_upcalls_send(void);
+static int	del_bw_upcall(struct bw_upcall *);
+static int	del_mfc(struct mfcctl2 *);
+static int	del_vif(vifi_t);
+static int	del_vif_locked(vifi_t);
+static void	expire_bw_meter_process(void *);
+static void	expire_bw_upcalls_send(void *);
+static void	expire_mfc(struct mfc *);
+static void	expire_upcalls(void *);
+static void	free_bw_list(struct bw_meter *);
+static int	get_sg_cnt(struct sioc_sg_req *);
+static int	get_vif_cnt(struct sioc_vif_req *);
+static void	if_detached_event(void *, struct ifnet *);
+static int	ip_mdq(struct mbuf *, struct ifnet *, struct mfc *, vifi_t);
+static int	ip_mrouter_init(struct socket *, int);
+static __inline struct mfc *
+		mfc_find(struct in_addr *, struct in_addr *);
+static void	phyint_send(struct ip *, struct vif *, struct mbuf *);
+static struct mbuf *
+		pim_register_prepare(struct ip *, struct mbuf *);
+static int	pim_register_send(struct ip *, struct vif *,
+		    struct mbuf *, struct mfc *);
+static int	pim_register_send_rp(struct ip *, struct vif *,
+		    struct mbuf *, struct mfc *);
+static int	pim_register_send_upcall(struct ip *, struct vif *,
+		    struct mbuf *, struct mfc *);
+static void	schedule_bw_meter(struct bw_meter *, struct timeval *);
+static void	send_packet(struct vif *, struct mbuf *);
+static int	set_api_config(uint32_t *);
+static int	set_assert(int);
+static int	socket_send(struct socket *, struct mbuf *,
+		    struct sockaddr_in *);
+static void	unschedule_bw_meter(struct bw_meter *);
 
 /*
- * Kernel multicast routing API capabilities and setup.
+ * Kernel multicast forwarding API capabilities and setup.
  * If more API capabilities are added to the kernel, they should be
  * recorded in `mrt_api_support'.
  */
+#define MRT_API_VERSION		0x0305
+
+static const int mrt_api_version = MRT_API_VERSION;
 static const uint32_t mrt_api_support = (MRT_MFC_FLAGS_DISABLE_WRONGVIF |
 					 MRT_MFC_FLAGS_BORDER_VIF |
 					 MRT_MFC_RP |
 					 MRT_MFC_BW_UPCALL);
 static uint32_t mrt_api_config = 0;
 
-/*
- * Hash function for a source, group entry
- */
-#define MFCHASH(a, g) MFCHASHMOD(((a) >> 20) ^ ((a) >> 10) ^ (a) ^ \
-			((g) >> 20) ^ ((g) >> 10) ^ (g))
+static int pim_assert_enabled;
+static struct timeval pim_assert_interval = { 3, 0 };	/* Rate limit */
 
 /*
- * Find a route for a given origin IP address and Multicast group address
- * Statistics are updated by the caller if needed
- * (mrtstat.mrts_mfc_lookups and mrtstat.mrts_mfc_misses)
+ * Find a route for a given origin IP address and multicast group address.
+ * Statistics must be updated by the caller.
  */
-static struct mfc *
-mfc_find(in_addr_t o, in_addr_t g)
+static __inline struct mfc *
+mfc_find(struct in_addr *o, struct in_addr *g)
 {
-    struct mfc *rt;
+	struct mfc *rt;
 
-    MFC_LOCK_ASSERT();
+	MFC_LOCK_ASSERT();
 
-    for (rt = mfctable[MFCHASH(o,g)]; rt; rt = rt->mfc_next)
-	if ((rt->mfc_origin.s_addr == o) &&
-		(rt->mfc_mcastgrp.s_addr == g) && (rt->mfc_stall == NULL))
-	    break;
-    return rt;
-}
+	LIST_FOREACH(rt, &mfchashtbl[MFCHASH(*o, *g)], mfc_hash) {
+		if (in_hosteq(rt->mfc_origin, *o) &&
+		    in_hosteq(rt->mfc_mcastgrp, *g) &&
+		    TAILQ_EMPTY(&rt->mfc_stall))
+			break;
+	}
 
-/*
- * Macros to compute elapsed time efficiently
- * Borrowed from Van Jacobson's scheduling code
- */
-#define TV_DELTA(a, b, delta) {					\
-	int xxs;						\
-	delta = (a).tv_usec - (b).tv_usec;			\
-	if ((xxs = (a).tv_sec - (b).tv_sec)) {			\
-		switch (xxs) {					\
-		case 2:						\
-		      delta += 1000000;				\
-		      /* FALLTHROUGH */				\
-		case 1:						\
-		      delta += 1000000;				\
-		      break;					\
-		default:					\
-		      delta += (1000000 * xxs);			\
-		}						\
-	}							\
+	return (rt);
 }
 
-#define TV_LT(a, b) (((a).tv_usec < (b).tv_usec && \
-	      (a).tv_sec <= (b).tv_sec) || (a).tv_sec < (b).tv_sec)
-
 /*
- * Handle MRT setsockopt commands to modify the multicast routing tables.
+ * Handle MRT setsockopt commands to modify the multicast forwarding tables.
  */
 static int
 X_ip_mrouter_set(struct socket *so, struct sockopt *sopt)
@@ -526,15 +486,15 @@ static int
 X_ip_mrouter_get(struct socket *so, struct sockopt *sopt)
 {
     int error;
-    static int version = 0x0305; /* !!! why is this here? XXX */
 
     switch (sopt->sopt_name) {
     case MRT_VERSION:
-	error = sooptcopyout(sopt, &version, sizeof version);
+	error = sooptcopyout(sopt, &mrt_api_version, sizeof mrt_api_version);
 	break;
 
     case MRT_ASSERT:
-	error = sooptcopyout(sopt, &pim_assert, sizeof pim_assert);
+	error = sooptcopyout(sopt, &pim_assert_enabled,
+	    sizeof pim_assert_enabled);
 	break;
 
     case MRT_API_SUPPORT:
@@ -556,7 +516,7 @@ X_ip_mrouter_get(struct socket *so, stru
  * Handle ioctl commands to obtain information from the cache
  */
 static int
-X_mrt_ioctl(int cmd, caddr_t data, int fibnum)
+X_mrt_ioctl(int cmd, caddr_t data, int fibnum __unused)
 {
     int error = 0;
 
@@ -593,7 +553,7 @@ get_sg_cnt(struct sioc_sg_req *req)
     struct mfc *rt;
 
     MFC_LOCK();
-    rt = mfc_find(req->src.s_addr, req->grp.s_addr);
+    rt = mfc_find(&req->src, &req->grp);
     if (rt == NULL) {
 	MFC_UNLOCK();
 	req->pktcnt = req->bytecnt = req->wrong_if = 0xffffffff;
@@ -632,10 +592,8 @@ get_vif_cnt(struct sioc_vif_req *req)
 static void
 ip_mrouter_reset(void)
 {
-    bzero((caddr_t)mfctable, sizeof(mfctable));
-    bzero((caddr_t)nexpire, sizeof(nexpire));
 
-    pim_assert = 0;
+    pim_assert_enabled = 0;
     mrt_api_config = 0;
 
     callout_init(&expire_upcalls_ch, CALLOUT_MPSAFE);
@@ -652,55 +610,40 @@ if_detached_event(void *arg __unused, st
     INIT_VNET_INET(curvnet);
     vifi_t vifi;
     int i;
-    struct mfc *mfc;
-    struct mfc *nmfc;
-    struct mfc **ppmfc;	/* Pointer to previous node's next-pointer */
-    struct rtdetq *pq;
-    struct rtdetq *npq;
 
     MROUTER_LOCK();
+
     if (V_ip_mrouter == NULL) {
 	MROUTER_UNLOCK();
+	return;
     }
 
+    VIF_LOCK();
+    MFC_LOCK();
+
     /*
      * Tear down multicast forwarder state associated with this ifnet.
      * 1. Walk the vif list, matching vifs against this ifnet.
      * 2. Walk the multicast forwarding cache (mfc) looking for
      *    inner matches with this vif's index.
-     * 3. Free any pending mbufs for this mfc.
-     * 4. Free the associated mfc entry and state associated with this vif.
-     *    Be very careful about unlinking from a singly-linked list whose
-     *    "head node" is a pointer in a simple array.
-     * 5. Free vif state. This should disable ALLMULTI on the interface.
+     * 3. Expire any matching multicast forwarding cache entries.
+     * 4. Free vif state. This should disable ALLMULTI on the interface.
      */
-    VIF_LOCK();
-    MFC_LOCK();
     for (vifi = 0; vifi < numvifs; vifi++) {
 	if (viftable[vifi].v_ifp != ifp)
 		continue;
-	for (i = 0; i < MFCTBLSIZ; i++) {
-	    ppmfc = &mfctable[i];
-	    for (mfc = mfctable[i]; mfc != NULL; ) {
-		nmfc = mfc->mfc_next;
-		if (mfc->mfc_parent == vifi) {
-		    for (pq = mfc->mfc_stall; pq != NULL; ) {
-			npq = pq->next;
-			m_freem(pq->m);
-			free(pq, M_MRTABLE);
-			pq = npq;
-		    }
-		    free_bw_list(mfc->mfc_bw_meter);
-		    free(mfc, M_MRTABLE);
-		    *ppmfc = nmfc;
-		} else {
-		    ppmfc = &mfc->mfc_next;
+	for (i = 0; i < mfchashsize; i++) {
+		struct mfc *rt, *nrt;
+		for (rt = LIST_FIRST(&mfchashtbl[i]); rt; rt = nrt) {
+			nrt = LIST_NEXT(rt, mfc_hash);
+			if (rt->mfc_parent == vifi) {
+				expire_mfc(rt);
+			}
 		}
-		mfc = nmfc;
-	    }
 	}
 	del_vif_locked(vifi);
     }
+
     MFC_UNLOCK();
     VIF_UNLOCK();
 
@@ -708,7 +651,7 @@ if_detached_event(void *arg __unused, st
 }
                         
 /*
- * Enable multicast routing
+ * Enable multicast forwarding.
  */
 static int
 ip_mrouter_init(struct socket *so, int version)
@@ -739,6 +682,8 @@ ip_mrouter_init(struct socket *so, int v
 	return (ENOMEM);
     }
 
+    mfchashtbl = hashinit_flags(mfchashsize, M_MRTABLE, &mfchash, HASH_NOWAIT);
+
     callout_reset(&expire_upcalls_ch, EXPIRE_TIMEOUT, expire_upcalls, NULL);
 
     callout_reset(&bw_upcalls_ch, BW_UPCALLS_PERIOD,
@@ -756,7 +701,7 @@ ip_mrouter_init(struct socket *so, int v
 }
 
 /*
- * Disable multicast routing
+ * Disable multicast forwarding.
  */
 static int
 X_ip_mrouter_done(void)
@@ -766,8 +711,6 @@ X_ip_mrouter_done(void)
     int i;
     struct ifnet *ifp;
     struct ifreq ifr;
-    struct mfc *rt;
-    struct rtdetq *rte;
 
     MROUTER_LOCK();
 
@@ -783,12 +726,13 @@ X_ip_mrouter_done(void)
     mrt_api_config = 0;
 
     VIF_LOCK();
+
     /*
      * For each phyint in use, disable promiscuous reception of all IP
      * multicasts.
      */
     for (vifi = 0; vifi < numvifs; vifi++) {
-	if (viftable[vifi].v_lcl_addr.s_addr != 0 &&
+	if (!in_nullhost(viftable[vifi].v_lcl_addr) &&
 		!(viftable[vifi].v_flags & (VIFF_TUNNEL | VIFF_REGISTER))) {
 	    struct sockaddr_in *so = (struct sockaddr_in *)&(ifr.ifr_addr);
 
@@ -801,38 +745,37 @@ X_ip_mrouter_done(void)
     }
     bzero((caddr_t)viftable, sizeof(viftable));
     numvifs = 0;
-    pim_assert = 0;
+    pim_assert_enabled = 0;
+
     VIF_UNLOCK();
+
     EVENTHANDLER_DEREGISTER(ifnet_departure_event, if_detach_event_tag);
 
-    /*
-     * Free all multicast forwarding cache entries.
-     */
     callout_stop(&expire_upcalls_ch);
     callout_stop(&bw_upcalls_ch);
     callout_stop(&bw_meter_ch);
 
     MFC_LOCK();
-    for (i = 0; i < MFCTBLSIZ; i++) {
-	for (rt = mfctable[i]; rt != NULL; ) {
-	    struct mfc *nr = rt->mfc_next;
-
-	    for (rte = rt->mfc_stall; rte != NULL; ) {
-		struct rtdetq *n = rte->next;
 
-		m_freem(rte->m);
-		free(rte, M_MRTABLE);
-		rte = n;
-	    }
-	    free_bw_list(rt->mfc_bw_meter);
-	    free(rt, M_MRTABLE);
-	    rt = nr;
+    /*
+     * Free all multicast forwarding cache entries.
+     * Do not use hashdestroy(), as we must perform other cleanup.
+     */
+    for (i = 0; i < mfchashsize; i++) {
+	struct mfc *rt, *nrt;
+	for (rt = LIST_FIRST(&mfchashtbl[i]); rt; rt = nrt) {
+		nrt = LIST_NEXT(rt, mfc_hash);
+		expire_mfc(rt);
 	}
     }
-    bzero((caddr_t)mfctable, sizeof(mfctable));
-    bzero((caddr_t)nexpire, sizeof(nexpire));
+    free(mfchashtbl, M_MRTABLE);
+    mfchashtbl = NULL;
+
+    bzero(nexpire, sizeof(nexpire[0]) * mfchashsize);
+
     bw_upcalls_n = 0;
     bzero(bw_meter_timers, sizeof(bw_meter_timers));
+
     MFC_UNLOCK();
 
     reg_vif_num = VIFI_INVALID;
@@ -854,7 +797,7 @@ set_assert(int i)
     if ((i != 1) && (i != 0))
 	return EINVAL;
 
-    pim_assert = i;
+    pim_assert_enabled = i;
 
     return 0;
 }
@@ -878,17 +821,22 @@ set_api_config(uint32_t *apival)
 	*apival = 0;
 	return EPERM;
     }
-    if (pim_assert) {
+    if (pim_assert_enabled) {
 	*apival = 0;
 	return EPERM;
     }
-    for (i = 0; i < MFCTBLSIZ; i++) {
-	if (mfctable[i] != NULL) {
+
+    MFC_LOCK();
+
+    for (i = 0; i < mfchashsize; i++) {
+	if (LIST_FIRST(&mfchashtbl[i]) != NULL) {
 	    *apival = 0;
 	    return EPERM;
 	}
     }
 
+    MFC_UNLOCK();
+
     mrt_api_config = *apival & mrt_api_support;
     *apival = mrt_api_config;
 
@@ -918,11 +866,11 @@ add_vif(struct vifctl *vifcp)
 	VIF_UNLOCK();
 	return EINVAL;
     }
-    if (vifp->v_lcl_addr.s_addr != INADDR_ANY) {
+    if (!in_nullhost(vifp->v_lcl_addr)) {
 	VIF_UNLOCK();
 	return EADDRINUSE;
     }
-    if (vifcp->vifc_lcl_addr.s_addr == INADDR_ANY) {
+    if (in_nullhost(vifcp->vifc_lcl_addr)) {
 	VIF_UNLOCK();
 	return EADDRNOTAVAIL;
     }
@@ -978,8 +926,6 @@ add_vif(struct vifctl *vifcp)
     vifp->v_lcl_addr  = vifcp->vifc_lcl_addr;
     vifp->v_rmt_addr  = vifcp->vifc_rmt_addr;
     vifp->v_ifp       = ifp;
-    vifp->v_rsvp_on   = 0;
-    vifp->v_rsvpd     = NULL;
     /* initialize per vif pkt counters */
     vifp->v_pkt_in    = 0;
     vifp->v_pkt_out   = 0;
@@ -988,7 +934,8 @@ add_vif(struct vifctl *vifcp)
     bzero(&vifp->v_route, sizeof(vifp->v_route));
 
     /* Adjust numvifs up if the vifi is higher than numvifs */
-    if (numvifs <= vifcp->vifc_vifi) numvifs = vifcp->vifc_vifi + 1;
+    if (numvifs <= vifcp->vifc_vifi)
+	numvifs = vifcp->vifc_vifi + 1;
 
     VIF_UNLOCK();
 
@@ -1017,7 +964,7 @@ del_vif_locked(vifi_t vifi)
 	return EINVAL;
     }
     vifp = &viftable[vifi];
-    if (vifp->v_lcl_addr.s_addr == INADDR_ANY) {
+    if (in_nullhost(vifp->v_lcl_addr)) {
 	return EADDRNOTAVAIL;
     }
 
@@ -1034,7 +981,7 @@ del_vif_locked(vifi_t vifi)
 
     /* Adjust numvifs down */
     for (vifi = numvifs; vifi > 0; vifi--)
-	if (viftable[vifi-1].v_lcl_addr.s_addr != INADDR_ANY)
+	if (!in_nullhost(viftable[vifi-1].v_lcl_addr))
 	    break;
     numvifs = vifi;
 
@@ -1089,9 +1036,25 @@ init_mfc_params(struct mfc *rt, struct m
     rt->mfc_pkt_cnt    = 0;
     rt->mfc_byte_cnt   = 0;
     rt->mfc_wrong_if   = 0;
-    rt->mfc_last_assert.tv_sec = rt->mfc_last_assert.tv_usec = 0;
+    timevalclear(&rt->mfc_last_assert);
 }
 
+static void
+expire_mfc(struct mfc *rt)
+{
+	struct rtdetq *rte, *nrte;
+
+	free_bw_list(rt->mfc_bw_meter);
+
+	TAILQ_FOREACH_SAFE(rte, &rt->mfc_stall, rte_link, nrte) {
+		m_freem(rte->m);
+		TAILQ_REMOVE(&rt->mfc_stall, rte, rte_link);
+		free(rte, M_MRTABLE);
+	}
+
+	LIST_REMOVE(rt, mfc_hash);
+	free(rt, M_MRTABLE);
+}
 
 /*
  * Add an mfc entry
@@ -1100,14 +1063,14 @@ static int
 add_mfc(struct mfcctl2 *mfccp)
 {
     struct mfc *rt;
-    u_long hash;
-    struct rtdetq *rte;
+    struct rtdetq *rte, *nrte;
+    u_long hash = 0;
     u_short nstl;
 
     VIF_LOCK();
     MFC_LOCK();
 
-    rt = mfc_find(mfccp->mfcc_origin.s_addr, mfccp->mfcc_mcastgrp.s_addr);
+    rt = mfc_find(&mfccp->mfcc_origin, &mfccp->mfcc_mcastgrp);
 
     /* If an entry already exists, just update the fields */
     if (rt) {
@@ -1120,47 +1083,48 @@ add_mfc(struct mfcctl2 *mfccp)
 	update_mfc_params(rt, mfccp);
 	MFC_UNLOCK();
 	VIF_UNLOCK();
-	return 0;
+	return (0);
     }
 
     /*
      * Find the entry for which the upcall was made and update
      */
-    hash = MFCHASH(mfccp->mfcc_origin.s_addr, mfccp->mfcc_mcastgrp.s_addr);
-    for (rt = mfctable[hash], nstl = 0; rt; rt = rt->mfc_next) {
-
-	if ((rt->mfc_origin.s_addr == mfccp->mfcc_origin.s_addr) &&
-		(rt->mfc_mcastgrp.s_addr == mfccp->mfcc_mcastgrp.s_addr) &&
-		(rt->mfc_stall != NULL)) {
-
-	    if (nstl++)
-		log(LOG_ERR, "add_mfc %s o %lx g %lx p %x dbx %p\n",
-		    "multiple kernel entries",
-		    (u_long)ntohl(mfccp->mfcc_origin.s_addr),
-		    (u_long)ntohl(mfccp->mfcc_mcastgrp.s_addr),
-		    mfccp->mfcc_parent, (void *)rt->mfc_stall);
-
-	    if (mrtdebug & DEBUG_MFC)
-		log(LOG_DEBUG,"add_mfc o %lx g %lx p %x dbg %p\n",
-		    (u_long)ntohl(mfccp->mfcc_origin.s_addr),
-		    (u_long)ntohl(mfccp->mfcc_mcastgrp.s_addr),
-		    mfccp->mfcc_parent, (void *)rt->mfc_stall);
-
-	    init_mfc_params(rt, mfccp);
+    nstl = 0;
+    hash = MFCHASH(mfccp->mfcc_origin, mfccp->mfcc_mcastgrp);
+    LIST_FOREACH(rt, &mfchashtbl[hash], mfc_hash) {
+	if (in_hosteq(rt->mfc_origin, mfccp->mfcc_origin) &&
+	    in_hosteq(rt->mfc_mcastgrp, mfccp->mfcc_mcastgrp) &&
+	    !TAILQ_EMPTY(&rt->mfc_stall)) {
+		if (nstl++) {
+			log(LOG_ERR, "add_mfc %s o %lx g %lx p %x dbx %p\n",
+			    "multiple kernel entries",
+			    (u_long)ntohl(mfccp->mfcc_origin.s_addr),
+			    (u_long)ntohl(mfccp->mfcc_mcastgrp.s_addr),
+			    mfccp->mfcc_parent,
+			    (void *)TAILQ_FIRST(&rt->mfc_stall));
+		}
 
-	    rt->mfc_expire = 0;	/* Don't clean this guy up */
-	    nexpire[hash]--;
+		if (mrtdebug & DEBUG_MFC) {
+			log(LOG_DEBUG,"add_mfc o %lx g %lx p %x dbg %p\n",
+			    (u_long)ntohl(mfccp->mfcc_origin.s_addr),
+			    (u_long)ntohl(mfccp->mfcc_mcastgrp.s_addr),
+			    mfccp->mfcc_parent,
+			    (void *)TAILQ_FIRST(&rt->mfc_stall));
+		}
 
-	    /* free packets Qed at the end of this entry */
-	    for (rte = rt->mfc_stall; rte != NULL; ) {
-		struct rtdetq *n = rte->next;
+		init_mfc_params(rt, mfccp);
+		rt->mfc_expire = 0;	/* Don't clean this guy up */
+		nexpire[hash]--;
 
-		ip_mdq(rte->m, rte->ifp, rt, -1);
-		m_freem(rte->m);
-		free(rte, M_MRTABLE);
-		rte = n;
-	    }
-	    rt->mfc_stall = NULL;
+		/* Free queued packets, but attempt to forward them first. */
+		TAILQ_FOREACH_SAFE(rte, &rt->mfc_stall, rte_link, nrte) {
+			if (rte->ifp != NULL)
+				ip_mdq(rte->m, rte->ifp, rt, -1);
+			m_freem(rte->m);
+			TAILQ_REMOVE(&rt->mfc_stall, rte, rte_link);
+			rt->mfc_nstall--;
+			free(rte, M_MRTABLE);
+		}
 	}
     }
 
@@ -1168,43 +1132,50 @@ add_mfc(struct mfcctl2 *mfccp)
      * It is possible that an entry is being inserted without an upcall
      */
     if (nstl == 0) {
+	/*
+	 * No mfc; make a new one
+	 */
 	if (mrtdebug & DEBUG_MFC)
 	    log(LOG_DEBUG,"add_mfc no upcall h %lu o %lx g %lx p %x\n",
 		hash, (u_long)ntohl(mfccp->mfcc_origin.s_addr),
 		(u_long)ntohl(mfccp->mfcc_mcastgrp.s_addr),
 		mfccp->mfcc_parent);
 
-	for (rt = mfctable[hash]; rt != NULL; rt = rt->mfc_next) {
-	    if ((rt->mfc_origin.s_addr == mfccp->mfcc_origin.s_addr) &&
-		    (rt->mfc_mcastgrp.s_addr == mfccp->mfcc_mcastgrp.s_addr)) {
-		init_mfc_params(rt, mfccp);
-		if (rt->mfc_expire)
-		    nexpire[hash]--;
-		rt->mfc_expire = 0;
-		break; /* XXX */
-	    }
+	LIST_FOREACH(rt, &mfchashtbl[hash], mfc_hash) {
+		if (in_hosteq(rt->mfc_origin, mfccp->mfcc_origin) &&
+		    in_hosteq(rt->mfc_mcastgrp, mfccp->mfcc_mcastgrp)) {
+			init_mfc_params(rt, mfccp);
+			if (rt->mfc_expire)
+			    nexpire[hash]--;
+			rt->mfc_expire = 0;
+			break; /* XXX */
+		}
 	}
+
 	if (rt == NULL) {		/* no upcall, so make a new entry */
 	    rt = (struct mfc *)malloc(sizeof(*rt), M_MRTABLE, M_NOWAIT);
 	    if (rt == NULL) {
 		MFC_UNLOCK();
 		VIF_UNLOCK();
-		return ENOBUFS;
+		return (ENOBUFS);
 	    }
 
 	    init_mfc_params(rt, mfccp);
-	    rt->mfc_expire     = 0;
-	    rt->mfc_stall      = NULL;
+	    TAILQ_INIT(&rt->mfc_stall);
+	    rt->mfc_nstall = 0;
 
+	    rt->mfc_expire     = 0;
 	    rt->mfc_bw_meter = NULL;
+
 	    /* insert new entry at head of hash chain */
-	    rt->mfc_next = mfctable[hash];
-	    mfctable[hash] = rt;
+	    LIST_INSERT_HEAD(&mfchashtbl[hash], rt, mfc_hash);
 	}
     }
+
     MFC_UNLOCK();
     VIF_UNLOCK();
-    return 0;
+
+    return (0);
 }
 
 /*
@@ -1216,49 +1187,40 @@ del_mfc(struct mfcctl2 *mfccp)
     struct in_addr	origin;
     struct in_addr	mcastgrp;
     struct mfc		*rt;
-    struct mfc		**nptr;
-    u_long		hash;
-    struct bw_meter	*list;
 
     origin = mfccp->mfcc_origin;
     mcastgrp = mfccp->mfcc_mcastgrp;
 
-    if (mrtdebug & DEBUG_MFC)
+    if (mrtdebug & DEBUG_MFC) {
 	log(LOG_DEBUG,"del_mfc orig %lx mcastgrp %lx\n",
-	    (u_long)ntohl(origin.s_addr), (u_long)ntohl(mcastgrp.s_addr));
+	    (u_long)ntohl(origin.s_addr),
+	    (u_long)ntohl(mcastgrp.s_addr));
+    }

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

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 19 08:22:57 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 025DA106564A;
	Thu, 19 Mar 2009 08:22:57 +0000 (UTC)
	(envelope-from rnoland@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E4ACD8FC12;
	Thu, 19 Mar 2009 08:22:56 +0000 (UTC)
	(envelope-from rnoland@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2J8MuXa053262;
	Thu, 19 Mar 2009 08:22:56 GMT (envelope-from rnoland@svn.freebsd.org)
Received: (from rnoland@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2J8MuBl053258;
	Thu, 19 Mar 2009 08:22:56 GMT (envelope-from rnoland@svn.freebsd.org)
Message-Id: <200903190822.n2J8MuBl053258@svn.freebsd.org>
From: Robert Noland 
Date: Thu, 19 Mar 2009 08:22: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: r190020 - head/sys/dev/drm
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 19 Mar 2009 08:22:57 -0000

Author: rnoland
Date: Thu Mar 19 08:22:56 2009
New Revision: 190020
URL: http://svn.freebsd.org/changeset/base/190020

Log:
  Pull in some suspend / resume changes from Intel's code
  
  Tested by:	mav@
  MFC after:	3 days

Modified:
  head/sys/dev/drm/i915_drv.h
  head/sys/dev/drm/i915_reg.h
  head/sys/dev/drm/i915_suspend.c

Modified: head/sys/dev/drm/i915_drv.h
==============================================================================
--- head/sys/dev/drm/i915_drv.h	Thu Mar 19 08:18:13 2009	(r190019)
+++ head/sys/dev/drm/i915_drv.h	Thu Mar 19 08:22:56 2009	(r190020)
@@ -151,6 +151,8 @@ typedef struct drm_i915_private {
 	u32 saveDSPACNTR;
 	u32 saveDSPBCNTR;
 	u32 saveDSPARB;
+	u32 saveRENDERSTANDBY;
+	u32 saveHWS;
 	u32 savePIPEACONF;
 	u32 savePIPEBCONF;
 	u32 savePIPEASRC;
@@ -232,8 +234,8 @@ typedef struct drm_i915_private {
 	u8 saveAR_INDEX;
 	u8 saveAR[21];
 	u8 saveDACMASK;
-	u8 saveDACDATA[256*3]; /* 256 3-byte colors */
 	u8 saveCR[37];
+
 	struct {
 #ifdef __linux__
 		struct drm_mm gtt_space;
@@ -651,7 +653,8 @@ extern int i915_wait_ring(struct drm_dev
 
 #define IS_G4X(dev) ((dev)->pci_device == 0x2E02 || \
 		     (dev)->pci_device == 0x2E12 || \
-		     (dev)->pci_device == 0x2E22)
+		     (dev)->pci_device == 0x2E22 || \
+		     IS_GM45(dev))
 
 #define IS_G33(dev)    ((dev)->pci_device == 0x29C2 ||	\
 			(dev)->pci_device == 0x29B2 ||	\

Modified: head/sys/dev/drm/i915_reg.h
==============================================================================
--- head/sys/dev/drm/i915_reg.h	Thu Mar 19 08:18:13 2009	(r190019)
+++ head/sys/dev/drm/i915_reg.h	Thu Mar 19 08:22:56 2009	(r190020)
@@ -38,7 +38,7 @@ __FBSDID("$FreeBSD$");
 #define INTEL_GMCH_MEM_64M	0x1
 #define INTEL_GMCH_MEM_128M	0
 
-#define INTEL_855_GMCH_GMS_MASK		(0x7 << 4)
+#define INTEL_GMCH_GMS_MASK		(0xf << 4)
 #define INTEL_855_GMCH_GMS_DISABLED	(0x0 << 4)
 #define INTEL_855_GMCH_GMS_STOLEN_1M	(0x1 << 4)
 #define INTEL_855_GMCH_GMS_STOLEN_4M	(0x2 << 4)
@@ -48,6 +48,12 @@ __FBSDID("$FreeBSD$");
 
 #define INTEL_915G_GMCH_GMS_STOLEN_48M	(0x6 << 4)
 #define INTEL_915G_GMCH_GMS_STOLEN_64M	(0x7 << 4)
+#define INTEL_GMCH_GMS_STOLEN_128M	(0x8 << 4)
+#define INTEL_GMCH_GMS_STOLEN_256M	(0x9 << 4)
+#define INTEL_GMCH_GMS_STOLEN_96M	(0xa << 4)
+#define INTEL_GMCH_GMS_STOLEN_160M	(0xb << 4)
+#define INTEL_GMCH_GMS_STOLEN_224M	(0xc << 4)
+#define INTEL_GMCH_GMS_STOLEN_352M	(0xd << 4)
 
 /* PCI config space */
 
@@ -178,9 +184,27 @@ __FBSDID("$FreeBSD$");
 #define   DISPLAY_PLANE_B           (1<<20)
 
 /*
- * Instruction and interrupt control regs
+ * Fence registers
  */
+#define FENCE_REG_830_0			0x2000
+#define FENCE_REG_945_8			0x3000
+#define   I830_FENCE_START_MASK		0x07f80000
+#define   I830_FENCE_TILING_Y_SHIFT	12
+#define   I830_FENCE_SIZE_BITS(size)	((ffs((size) >> 19) - 1) << 8)
+#define   I830_FENCE_PITCH_SHIFT	4
+#define   I830_FENCE_REG_VALID		(1<<0)
+
+#define   I915_FENCE_START_MASK		0x0ff00000
+#define   I915_FENCE_SIZE_BITS(size)	((ffs((size) >> 20) - 1) << 8)
+
+#define FENCE_REG_965_0			0x03000
+#define   I965_FENCE_PITCH_SHIFT	2
+#define   I965_FENCE_TILING_Y_SHIFT	1
+#define   I965_FENCE_REG_VALID		(1<<0)
 
+/*
+ * Instruction and interrupt control regs
+ */
 #define PRB0_TAIL	0x02030
 #define PRB0_HEAD	0x02034
 #define PRB0_START	0x02038
@@ -248,6 +272,7 @@ __FBSDID("$FreeBSD$");
 #define   CM0_RC_OP_FLUSH_DISABLE (1<<0)
 #define GFX_FLSH_CNTL	0x02170 /* 915+ only */
 
+
 /*
  * Framebuffer compression (915+ only)
  */
@@ -525,11 +550,17 @@ __FBSDID("$FreeBSD$");
 #define DCC_ADDRESSING_MODE_DUAL_CHANNEL_INTERLEAVED	(2 << 0)
 #define DCC_ADDRESSING_MODE_MASK			(3 << 0)
 #define DCC_CHANNEL_XOR_DISABLE				(1 << 10)
+#define DCC_CHANNEL_XOR_BIT_17				(1 << 9)
 
 /** 965 MCH register controlling DRAM channel configuration */
 #define C0DRB3			0x10206
 #define C1DRB3			0x10606
 
+/** GM965 GM45 render standby register */
+#define MCHBAR_RENDER_STANDBY	0x111B8
+
+#define PEG_BAND_GAP_DATA	0x14d68
+
 /*
  * Overlay regs
  */
@@ -593,6 +624,9 @@ __FBSDID("$FreeBSD$");
 
 /* Hotplug control (945+ only) */
 #define PORT_HOTPLUG_EN		0x61110
+#define   HDMIB_HOTPLUG_INT_EN			(1 << 29)
+#define   HDMIC_HOTPLUG_INT_EN			(1 << 28)
+#define   HDMID_HOTPLUG_INT_EN			(1 << 27)
 #define   SDVOB_HOTPLUG_INT_EN			(1 << 26)
 #define   SDVOC_HOTPLUG_INT_EN			(1 << 25)
 #define   TV_HOTPLUG_INT_EN			(1 << 18)
@@ -600,6 +634,9 @@ __FBSDID("$FreeBSD$");
 #define   CRT_HOTPLUG_FORCE_DETECT		(1 << 3)
 
 #define PORT_HOTPLUG_STAT	0x61114
+#define   HDMIB_HOTPLUG_INT_STATUS		(1 << 29)
+#define   HDMIC_HOTPLUG_INT_STATUS		(1 << 28)
+#define   HDMID_HOTPLUG_INT_STATUS		(1 << 27)
 #define   CRT_HOTPLUG_INT_STATUS		(1 << 11)
 #define   TV_HOTPLUG_INT_STATUS			(1 << 10)
 #define   CRT_HOTPLUG_MONITOR_MASK		(3 << 8)
@@ -629,7 +666,16 @@ __FBSDID("$FreeBSD$");
 #define   SDVO_PHASE_SELECT_DEFAULT	(6 << 19)
 #define   SDVO_CLOCK_OUTPUT_INVERT	(1 << 18)
 #define   SDVOC_GANG_MODE		(1 << 16)
+#define   SDVO_ENCODING_SDVO		(0x0 << 10)
+#define   SDVO_ENCODING_HDMI		(0x2 << 10)
+/** Requird for HDMI operation */
+#define   SDVO_NULL_PACKETS_DURING_VSYNC (1 << 9)
 #define   SDVO_BORDER_ENABLE		(1 << 7)
+#define   SDVO_AUDIO_ENABLE		(1 << 6)
+/** New with 965, default is to be set */
+#define   SDVO_VSYNC_ACTIVE_HIGH	(1 << 4)
+/** New with 965, default is to be set */
+#define   SDVO_HSYNC_ACTIVE_HIGH	(1 << 3)
 #define   SDVOB_PCIE_CONCURRENCY	(1 << 3)
 #define   SDVO_DETECTED			(1 << 2)
 /* Bits to be preserved when writing */
@@ -1403,6 +1449,7 @@ __FBSDID("$FreeBSD$");
 #define PIPEB_FRMCOUNT_GM45	0x71040
 #define PIPEB_FLIPCOUNT_GM45	0x71044
 
+
 /* Display B control */
 #define DSPBCNTR		0x71180
 #define   DISPPLANE_ALPHA_TRANS_ENABLE		(1<<15)

Modified: head/sys/dev/drm/i915_suspend.c
==============================================================================
--- head/sys/dev/drm/i915_suspend.c	Thu Mar 19 08:18:13 2009	(r190019)
+++ head/sys/dev/drm/i915_suspend.c	Thu Mar 19 08:22:56 2009	(r190020)
@@ -125,11 +125,6 @@ static void i915_save_vga(struct drm_dev
 
 	/* VGA color palette registers */
 	dev_priv->saveDACMASK = I915_READ8(VGA_DACMASK);
-	/* DACCRX automatically increments during read */
-	I915_WRITE8(VGA_DACRX, 0);
-	/* Read 3 bytes of color data from each index */
-	for (i = 0; i < 256 * 3; i++)
-		dev_priv->saveDACDATA[i] = I915_READ8(VGA_DACDATA);
 
 	/* MSR bits */
 	dev_priv->saveMSR = I915_READ8(VGA_MSR_READ);
@@ -231,12 +226,6 @@ static void i915_restore_vga(struct drm_
 
 	/* VGA color palette registers */
 	I915_WRITE8(VGA_DACMASK, dev_priv->saveDACMASK);
-	/* DACCRX automatically increments during read */
-	I915_WRITE8(VGA_DACWX, 0);
-	/* Read 3 bytes of color data from each index */
-	for (i = 0; i < 256 * 3; i++)
-		I915_WRITE8(VGA_DACDATA, dev_priv->saveDACDATA[i]);
-
 }
 
 int i915_save_state(struct drm_device *dev)
@@ -250,6 +239,13 @@ int i915_save_state(struct drm_device *d
 	pci_read_config_byte(dev->pdev, LBB, &dev_priv->saveLBB);
 #endif
 
+	/* Render Standby */
+	if (IS_I965G(dev) && IS_MOBILE(dev))
+		dev_priv->saveRENDERSTANDBY = I915_READ(MCHBAR_RENDER_STANDBY);
+
+	/* Hardware status page */
+	dev_priv->saveHWS = I915_READ(HWS_PGA);
+
 	/* Display arbitration control */
 	dev_priv->saveDSPARB = I915_READ(DSPARB);
 
@@ -379,6 +375,14 @@ int i915_restore_state(struct drm_device
 	pci_write_config_byte(dev->pdev, LBB, dev_priv->saveLBB);
 #endif
 
+	/* Render Standby */
+	if (IS_I965G(dev) && IS_MOBILE(dev))
+		I915_WRITE(MCHBAR_RENDER_STANDBY, dev_priv->saveRENDERSTANDBY);
+
+	/* Hardware status page */
+	I915_WRITE(HWS_PGA, dev_priv->saveHWS);
+
+	/* Display arbitration */
 	I915_WRITE(DSPARB, dev_priv->saveDSPARB);
 
 	/* Pipe & plane A info */

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 19 08:28:36 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B1A901065670;
	Thu, 19 Mar 2009 08:28:36 +0000 (UTC)
	(envelope-from rnoland@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 9F3D98FC0C;
	Thu, 19 Mar 2009 08:28:36 +0000 (UTC)
	(envelope-from rnoland@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2J8SaBL053404;
	Thu, 19 Mar 2009 08:28:36 GMT (envelope-from rnoland@svn.freebsd.org)
Received: (from rnoland@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2J8Sanh053402;
	Thu, 19 Mar 2009 08:28:36 GMT (envelope-from rnoland@svn.freebsd.org)
Message-Id: <200903190828.n2J8Sanh053402@svn.freebsd.org>
From: Robert Noland 
Date: Thu, 19 Mar 2009 08:28: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: r190021 - head/sys/dev/drm
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 19 Mar 2009 08:28:37 -0000

Author: rnoland
Date: Thu Mar 19 08:28:36 2009
New Revision: 190021
URL: http://svn.freebsd.org/changeset/base/190021

Log:
  Sync up the rest of the code that we use with what Intel is shipping
  
  	-Some irq/vblank related changes that hopefully will help.
  	-A little more cleanup while I'm here.
  
  MFC after:	3 days

Modified:
  head/sys/dev/drm/i915_dma.c
  head/sys/dev/drm/i915_irq.c

Modified: head/sys/dev/drm/i915_dma.c
==============================================================================
--- head/sys/dev/drm/i915_dma.c	Thu Mar 19 08:22:56 2009	(r190020)
+++ head/sys/dev/drm/i915_dma.c	Thu Mar 19 08:28:36 2009	(r190021)
@@ -193,7 +193,7 @@ static int i915_initialize(struct drm_de
 		dev_priv->ring.map.flags = 0;
 		dev_priv->ring.map.mtrr = 0;
 
-		drm_core_ioremap(&dev_priv->ring.map, dev);
+		drm_core_ioremap_wc(&dev_priv->ring.map, dev);
 
 		if (dev_priv->ring.map.handle == NULL) {
 			i915_dma_cleanup(dev);
@@ -209,7 +209,7 @@ static int i915_initialize(struct drm_de
 	dev_priv->back_offset = init->back_offset;
 	dev_priv->front_offset = init->front_offset;
 	dev_priv->current_page = 0;
-	dev_priv->sarea_priv->pf_current_page = dev_priv->current_page;
+	dev_priv->sarea_priv->pf_current_page = 0;
 
 	/* Allow hardware batchbuffers unless told otherwise.
 	 */
@@ -721,7 +721,7 @@ static int i915_flip_bufs(struct drm_dev
 
 	DRM_DEBUG("%s\n", __func__);
 
-	LOCK_TEST_WITH_RETURN(dev, file_priv);
+	RING_LOCK_TEST_WITH_RETURN(dev, file_priv);
 
 	ret = i915_dispatch_flip(dev);
 
@@ -758,7 +758,7 @@ static int i915_getparam(struct drm_devi
 		value = 0;
 		break;
 	default:
-		DRM_ERROR("Unknown parameter %d\n", param->param);
+		DRM_DEBUG("Unknown parameter %d\n", param->param);
 		return -EINVAL;
 	}
 
@@ -791,7 +791,7 @@ static int i915_setparam(struct drm_devi
 		dev_priv->allow_batchbuffer = param->value;
 		break;
 	default:
-		DRM_ERROR("unknown parameter %d\n", param->param);
+		DRM_DEBUG("unknown parameter %d\n", param->param);
 		return -EINVAL;
 	}
 
@@ -822,7 +822,7 @@ static int i915_set_status_page(struct d
 	dev_priv->hws_map.flags = 0;
 	dev_priv->hws_map.mtrr = 0;
 
-	drm_core_ioremap(&dev_priv->hws_map, dev);
+	drm_core_ioremap_wc(&dev_priv->hws_map, dev);
 	if (dev_priv->hws_map.handle == NULL) {
 		i915_dma_cleanup(dev);
 		dev_priv->status_gfx_addr = 0;
@@ -880,8 +880,12 @@ int i915_driver_load(struct drm_device *
 	/* Init HWS */
 	if (!I915_NEED_GFX_HWS(dev)) {
 		ret = i915_init_phys_hws(dev);
-		if (ret != 0)
+		if (ret != 0) {
+			drm_rmmap(dev, dev_priv->mmio_map);
+			drm_free(dev_priv, sizeof(struct drm_i915_private),
+			    DRM_MEM_DRIVER);
 			return ret;
+		}
 	}
 #ifdef __linux__
 	/* On the 945G/GM, the chipset reports the MSI capability on the
@@ -901,6 +905,7 @@ int i915_driver_load(struct drm_device *
 	intel_opregion_init(dev);
 #endif
 	DRM_SPININIT(&dev_priv->user_irq_lock, "userirq");
+	dev_priv->user_irq_refcount = 0;
 
 	ret = drm_vblank_init(dev, I915_NUM_PIPE);
 

Modified: head/sys/dev/drm/i915_irq.c
==============================================================================
--- head/sys/dev/drm/i915_irq.c	Thu Mar 19 08:22:56 2009	(r190020)
+++ head/sys/dev/drm/i915_irq.c	Thu Mar 19 08:28:36 2009	(r190021)
@@ -43,21 +43,28 @@ __FBSDID("$FreeBSD$");
  * we leave them always unmasked in IMR and then control enabling them through
  * PIPESTAT alone.
  */
-#define I915_INTERRUPT_ENABLE_FIX (I915_DISPLAY_PIPE_A_EVENT_INTERRUPT | \
-				   I915_DISPLAY_PIPE_B_EVENT_INTERRUPT)
+#define I915_INTERRUPT_ENABLE_FIX	(I915_DISPLAY_PIPE_A_EVENT_INTERRUPT | \
+				   	 I915_DISPLAY_PIPE_B_EVENT_INTERRUPT)
 
 /** Interrupts that we mask and unmask at runtime. */
-#define I915_INTERRUPT_ENABLE_VAR (I915_USER_INTERRUPT)
+#define I915_INTERRUPT_ENABLE_VAR	(I915_USER_INTERRUPT)
 
 /** These are all of the interrupts used by the driver */
-#define I915_INTERRUPT_ENABLE_MASK (I915_INTERRUPT_ENABLE_FIX | \
-				    I915_INTERRUPT_ENABLE_VAR)
+#define I915_INTERRUPT_ENABLE_MASK	(I915_INTERRUPT_ENABLE_FIX | \
+				    	 I915_INTERRUPT_ENABLE_VAR)
+
+#define I915_PIPE_VBLANK_STATUS		(PIPE_START_VBLANK_INTERRUPT_STATUS |\
+					 PIPE_VBLANK_INTERRUPT_STATUS)
+ 
+#define I915_PIPE_VBLANK_ENABLE		(PIPE_START_VBLANK_INTERRUPT_ENABLE |\
+					 PIPE_VBLANK_INTERRUPT_ENABLE)
+  
+#define DRM_I915_VBLANK_PIPE_ALL	(DRM_I915_VBLANK_PIPE_A | \
+					 DRM_I915_VBLANK_PIPE_B)
 
 static inline void
 i915_enable_irq(drm_i915_private_t *dev_priv, u32 mask)
 {
-	DRM_DEBUG("irq_enable_reg = 0x%08x, mask = 0x%08x\n",
-	    dev_priv->irq_mask_reg, mask);
 	mask &= I915_INTERRUPT_ENABLE_VAR;
 	if ((dev_priv->irq_mask_reg & mask) != 0) {
 		dev_priv->irq_mask_reg &= ~mask;
@@ -189,59 +196,84 @@ irqreturn_t i915_driver_irq_handler(DRM_
 	drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
 	u32 iir, new_iir;
 	u32 pipea_stats, pipeb_stats;
+	u32 vblank_status;
+	u32 vblank_enable;
+	int irq_received;
 
 	atomic_inc(&dev_priv->irq_received);
 
-	for (iir = I915_READ(IIR) ; iir != 0 ; iir = new_iir) {
+	iir = I915_READ(IIR);
 
-		pipea_stats = pipeb_stats = 0;
+	if (IS_I965G(dev)) {
+		vblank_status = I915_START_VBLANK_INTERRUPT_STATUS;
+		vblank_enable = PIPE_START_VBLANK_INTERRUPT_ENABLE;
+	} else {
+		vblank_status = I915_VBLANK_INTERRUPT_STATUS;
+		vblank_enable = I915_VBLANK_INTERRUPT_ENABLE;
+	}
+
+	for (;;) {
+		irq_received = iir != 0;
+
+		/* Can't rely on pipestat interrupt bit in iir as it might
+		 * have been cleared after the pipestat interrupt was received.
+		 * It doesn't set the bit in iir again, but it still produces
+		 * interrupts (for non-MSI).
+		 */
+		DRM_SPINLOCK(&dev_priv->user_irq_lock);
+		pipea_stats = I915_READ(PIPEASTAT);
+		pipeb_stats = I915_READ(PIPEBSTAT);
 
 		/*
 		 * Clear the PIPE(A|B)STAT regs before the IIR
 		 */
-		if (iir & I915_DISPLAY_PIPE_A_EVENT_INTERRUPT) {
-			DRM_SPINLOCK(&dev_priv->user_irq_lock);
-			pipea_stats = I915_READ(PIPEASTAT);
+		if (pipea_stats & 0x8000ffff) {
 			I915_WRITE(PIPEASTAT, pipea_stats);
-			DRM_SPINUNLOCK(&dev_priv->user_irq_lock);
+			irq_received = 1;
 		}
 
-		if (iir & I915_DISPLAY_PIPE_B_EVENT_INTERRUPT) {
-			DRM_SPINLOCK(&dev_priv->user_irq_lock);
-			pipeb_stats = I915_READ(PIPEBSTAT);
+		if (pipeb_stats & 0x8000ffff) {
 			I915_WRITE(PIPEBSTAT, pipeb_stats);
-			DRM_SPINUNLOCK(&dev_priv->user_irq_lock);
+			irq_received = 1;
 		}
+		DRM_SPINUNLOCK(&dev_priv->user_irq_lock);
 
-		I915_WRITE(IIR, iir);
-		new_iir = I915_READ(IIR);
+		if (!irq_received)
+			break;
 
-		DRM_DEBUG("iir = 0x%08x, pipestats a = 0x%08x, b = 0x%08x\n",
-		    iir, pipea_stats, pipeb_stats);
+		I915_WRITE(IIR, iir);
+		new_iir = I915_READ(IIR); /* Flush posted writes */
 
 		if (dev_priv->sarea_priv)
 			dev_priv->sarea_priv->last_dispatch =
 			    READ_BREADCRUMB(dev_priv);
 
 		if (iir & I915_USER_INTERRUPT) {
-#ifdef I915_HAVE_GEM
-			dev_priv->mm.irq_gem_seqno = i915_get_gem_seqno(dev);
-#endif
 			DRM_WAKEUP(&dev_priv->irq_queue);
 		}
 
-		if (pipea_stats & (PIPE_START_VBLANK_INTERRUPT_STATUS |
-		    PIPE_VBLANK_INTERRUPT_STATUS))
+		if (pipea_stats & vblank_status)
 			drm_handle_vblank(dev, 0);
 
-		if (pipeb_stats & (PIPE_START_VBLANK_INTERRUPT_STATUS |
-		    PIPE_VBLANK_INTERRUPT_STATUS))
+		if (pipeb_stats & vblank_status)
 			drm_handle_vblank(dev, 1);
-#ifdef __linux__
-		if ((pipeb_stats & I915_LEGACY_BLC_EVENT_STATUS) ||
-		    (iir & I915_ASLE_INTERRUPT))
-			opregion_asle_intr(dev);
-#endif
+
+		/* With MSI, interrupts are only generated when iir
+		 * transitions from zero to nonzero.  If another bit got
+		 * set while we were handling the existing iir bits, then
+		 * we would never get another interrupt.
+		 *
+		 * This is fine on non-MSI as well, as if we hit this path
+		 * we avoid exiting the interrupt handler only to generate
+		 * another one.
+		 *
+		 * Note that for MSI this could cause a stray interrupt report
+		 * if an interrupt landed in the time between writing IIR and
+		 * the posting read.  This should be rare enough to never
+		 * trigger the 99% of 100,000 interrupts test for disabling
+		 * stray interrupts.
+		 */
+		iir = new_iir;
 	}
 }
 
@@ -273,27 +305,25 @@ static int i915_emit_irq(struct drm_devi
 void i915_user_irq_get(struct drm_device *dev)
 {
 	drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
-	unsigned long irqflags;
 
 	DRM_DEBUG("\n");
-	DRM_SPINLOCK_IRQSAVE(&dev_priv->user_irq_lock, irqflags);
+	DRM_SPINLOCK(&dev_priv->user_irq_lock);
 	if (dev->irq_enabled && (++dev_priv->user_irq_refcount == 1))
 		i915_enable_irq(dev_priv, I915_USER_INTERRUPT);
-	DRM_SPINUNLOCK_IRQRESTORE(&dev_priv->user_irq_lock, irqflags);
+	DRM_SPINUNLOCK(&dev_priv->user_irq_lock);
 }
 
 void i915_user_irq_put(struct drm_device *dev)
 {
 	drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
-	unsigned long irqflags;
 
-	DRM_SPINLOCK_IRQSAVE(&dev_priv->user_irq_lock, irqflags);
-#ifdef __linux__
-	BUG_ON(dev->irq_enabled && dev_priv->user_irq_refcount <= 0);
-#endif
-	if (dev->irq_enabled && (--dev_priv->user_irq_refcount == 0))
-		i915_disable_irq(dev_priv, I915_USER_INTERRUPT);
-	DRM_SPINUNLOCK_IRQRESTORE(&dev_priv->user_irq_lock, irqflags);
+	DRM_SPINLOCK(&dev_priv->user_irq_lock);
+	if (dev->irq_enabled) {
+		KASSERT(dev_priv->user_irq_refcount > 0, ("invalid refcount"));
+		if (--dev_priv->user_irq_refcount == 0)
+			i915_disable_irq(dev_priv, I915_USER_INTERRUPT);
+	}
+	DRM_SPINUNLOCK(&dev_priv->user_irq_lock);
 }
 
 static int i915_wait_irq(struct drm_device * dev, int irq_nr)
@@ -320,15 +350,14 @@ static int i915_wait_irq(struct drm_devi
 		    READ_BREADCRUMB(dev_priv) >= irq_nr);
 	i915_user_irq_put(dev);
 
+	if (ret == -ERESTART)
+		DRM_DEBUG("restarting syscall\n");
+
 	if (ret == -EBUSY) {
 		DRM_ERROR("EBUSY -- rec: %d emitted: %d\n",
 			  READ_BREADCRUMB(dev_priv), (int)dev_priv->counter);
 	}
 
-	if (dev_priv->sarea_priv)
-		dev_priv->sarea_priv->last_dispatch =
-			READ_BREADCRUMB(dev_priv);
-
 	return ret;
 }
 
@@ -341,13 +370,13 @@ int i915_irq_emit(struct drm_device *dev
 	drm_i915_irq_emit_t *emit = data;
 	int result;
 
-	RING_LOCK_TEST_WITH_RETURN(dev, file_priv);
-
 	if (!dev_priv) {
 		DRM_ERROR("called with no initialization\n");
 		return -EINVAL;
 	}
 
+	RING_LOCK_TEST_WITH_RETURN(dev, file_priv);
+
 	result = i915_emit_irq(dev);
 
 	if (DRM_COPY_TO_USER(emit->irq_seq, &result, sizeof(int))) {
@@ -380,21 +409,21 @@ int i915_irq_wait(struct drm_device *dev
 int i915_enable_vblank(struct drm_device *dev, int pipe)
 {
 	drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
-	unsigned long irqflags;
-	u32 pipestat;
+	int pipeconf_reg = (pipe == 0) ? PIPEACONF : PIPEBCONF;
+	u32 pipeconf;
 
-	/*
-	 * Older chips didn't have the start vblank interrupt,
-	 * but
-	 */
-	if (IS_I965G (dev))
-		pipestat = PIPE_START_VBLANK_INTERRUPT_ENABLE;
-	else
-		pipestat = PIPE_VBLANK_INTERRUPT_ENABLE;
+	pipeconf = I915_READ(pipeconf_reg);
+	if (!(pipeconf & PIPEACONF_ENABLE))
+		return -EINVAL;
 
-	DRM_SPINLOCK_IRQSAVE(&dev_priv->user_irq_lock, irqflags);
-	i915_enable_pipestat(dev_priv, pipe, pipestat);
-	DRM_SPINUNLOCK_IRQRESTORE(&dev_priv->user_irq_lock, irqflags);
+	DRM_SPINLOCK(&dev_priv->user_irq_lock);
+	if (IS_I965G(dev))
+		i915_enable_pipestat(dev_priv, pipe,
+				     PIPE_START_VBLANK_INTERRUPT_ENABLE);
+	else
+		i915_enable_pipestat(dev_priv, pipe,
+				     PIPE_VBLANK_INTERRUPT_ENABLE);
+	DRM_SPINUNLOCK(&dev_priv->user_irq_lock);
 	return 0;
 }
 
@@ -404,12 +433,12 @@ int i915_enable_vblank(struct drm_device
 void i915_disable_vblank(struct drm_device *dev, int pipe)
 {
 	drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
-	unsigned long irqflags;
 
-	DRM_SPINLOCK_IRQSAVE(&dev_priv->user_irq_lock, irqflags);
+	DRM_SPINLOCK(&dev_priv->user_irq_lock);
 	i915_disable_pipestat(dev_priv, pipe,
-	    PIPE_START_VBLANK_INTERRUPT_ENABLE | PIPE_VBLANK_INTERRUPT_ENABLE);
-	DRM_SPINUNLOCK_IRQRESTORE(&dev_priv->user_irq_lock, irqflags);
+			      PIPE_VBLANK_INTERRUPT_ENABLE |
+			      PIPE_START_VBLANK_INTERRUPT_ENABLE);
+	DRM_SPINUNLOCK(&dev_priv->user_irq_lock);
 }
 
 /* Set the vblank monitor pipe
@@ -463,7 +492,6 @@ int i915_vblank_swap(struct drm_device *
 	 * Context switching to userland and back is plenty fast enough for
 	 * meeting the requirements of vblank swapping.
 	 */
-
 	return -EINVAL;
 }
 
@@ -473,6 +501,8 @@ void i915_driver_irq_preinstall(struct d
 {
 	drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
 
+	atomic_set_int(&dev_priv->irq_received, 0);
+
 	I915_WRITE(HWSTAM, 0xeffe);
 	I915_WRITE(PIPEASTAT, 0);
 	I915_WRITE(PIPEBSTAT, 0);
@@ -505,13 +535,6 @@ int i915_driver_irq_postinstall(struct d
 	I915_WRITE(IER, I915_INTERRUPT_ENABLE_MASK);
 	I915_WRITE(IMR, dev_priv->irq_mask_reg);
 	(void) I915_READ(IER);
-#ifdef __linux__
-	opregion_enable_asle(dev);
-#endif
-	DRM_INIT_WAITQUEUE(&dev_priv->irq_queue);
-
-	i915_enable_vblank(dev, 0);
-	i915_enable_vblank(dev, 1);
 
 	return 0;
 }

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 19 08:34:04 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6DEEC106564A;
	Thu, 19 Mar 2009 08:34:04 +0000 (UTC)
	(envelope-from rnoland@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 5C1138FC12;
	Thu, 19 Mar 2009 08:34:04 +0000 (UTC)
	(envelope-from rnoland@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2J8Y4QK053565;
	Thu, 19 Mar 2009 08:34:04 GMT (envelope-from rnoland@svn.freebsd.org)
Received: (from rnoland@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2J8Y4lV053564;
	Thu, 19 Mar 2009 08:34:04 GMT (envelope-from rnoland@svn.freebsd.org)
Message-Id: <200903190834.n2J8Y4lV053564@svn.freebsd.org>
From: Robert Noland 
Date: Thu, 19 Mar 2009 08:34: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: r190022 - head/sys/dev/drm
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 19 Mar 2009 08:34:05 -0000

Author: rnoland
Date: Thu Mar 19 08:34:04 2009
New Revision: 190022
URL: http://svn.freebsd.org/changeset/base/190022

Log:
  Rework vblank handling to try to resolve some reports of "slow" windows
  after vt switch or suspend.  I can't really test this on Intel right now
  but I think I've heard reports of it on radeon as well.  I can't break
  it on the radeon here.
  
  MFC after:	3 days

Modified:
  head/sys/dev/drm/drm_irq.c

Modified: head/sys/dev/drm/drm_irq.c
==============================================================================
--- head/sys/dev/drm/drm_irq.c	Thu Mar 19 08:28:36 2009	(r190021)
+++ head/sys/dev/drm/drm_irq.c	Thu Mar 19 08:34:04 2009	(r190022)
@@ -98,15 +98,13 @@ static void vblank_disable_fn(void *arg)
 
 void drm_vblank_cleanup(struct drm_device *dev)
 {
-	unsigned long irqflags;
-
 	/* Bail if the driver didn't call drm_vblank_init() */
 	if (dev->num_crtcs == 0)
 		return;
 
-	DRM_SPINLOCK_IRQSAVE(&dev->vbl_lock, irqflags);
+	DRM_SPINLOCK(&dev->vbl_lock);
 	callout_stop(&dev->vblank_disable_timer);
-	DRM_SPINUNLOCK_IRQRESTORE(&dev->vbl_lock, irqflags);
+	DRM_SPINUNLOCK(&dev->vbl_lock);
 
 	callout_drain(&dev->vblank_disable_timer);
 
@@ -200,11 +198,25 @@ err:
 
 int drm_irq_uninstall(struct drm_device *dev)
 {
+	int crtc;
+
 	if (!dev->irq_enabled)
 		return EINVAL;
 
 	dev->irq_enabled = 0;
 
+	/*
+	* Wake up any waiters so they don't hang.
+	*/
+	DRM_SPINLOCK(&dev->vbl_lock);
+	for (crtc = 0; crtc < dev->num_crtcs; crtc++) {
+		DRM_WAKEUP(&dev->vblank[crtc].queue);
+		dev->vblank[crtc].enabled = 0;
+		dev->vblank[crtc].last =
+		    dev->driver->get_vblank_counter(dev, crtc);
+	}
+	DRM_SPINUNLOCK(&dev->vbl_lock);
+
 	DRM_DEBUG("irq=%d\n", dev->irq);
 
 	dev->driver->irq_uninstall(dev);
@@ -277,16 +289,15 @@ static void drm_update_vblank_count(stru
 
 int drm_vblank_get(struct drm_device *dev, int crtc)
 {
-	unsigned long irqflags;
 	int ret = 0;
 
-	DRM_SPINLOCK_IRQSAVE(&dev->vbl_lock, irqflags);
+	DRM_SPINLOCK(&dev->vbl_lock);
 	/* Going from 0->1 means we have to enable interrupts again */
 	atomic_add_acq_int(&dev->vblank[crtc].refcount, 1);
-	DRM_DEBUG("vblank refcount = %d\n", dev->vblank[crtc].refcount);
 	if (dev->vblank[crtc].refcount == 1 &&
 	    !dev->vblank[crtc].enabled) {
 		ret = dev->driver->enable_vblank(dev, crtc);
+		DRM_DEBUG("enabling vblank on crtc %d, ret: %d\n", crtc, ret);
 		if (ret)
 			atomic_dec(&dev->vblank[crtc].refcount);
 		else {
@@ -294,30 +305,28 @@ int drm_vblank_get(struct drm_device *de
 			drm_update_vblank_count(dev, crtc);
 		}
 	}
-	DRM_SPINUNLOCK_IRQRESTORE(&dev->vbl_lock, irqflags);
+	DRM_SPINUNLOCK(&dev->vbl_lock);
 
 	return ret;
 }
 
 void drm_vblank_put(struct drm_device *dev, int crtc)
 {
-	unsigned long irqflags;
+	KASSERT(atomic_read(&dev->vblank[crtc].refcount) > 0,
+	    ("invalid refcount"));
 
-	DRM_SPINLOCK_IRQSAVE(&dev->vbl_lock, irqflags);
 	/* Last user schedules interrupt disable */
 	atomic_subtract_acq_int(&dev->vblank[crtc].refcount, 1);
-	DRM_DEBUG("vblank refcount = %d\n", dev->vblank[crtc].refcount);
+
 	if (dev->vblank[crtc].refcount == 0)
 	    callout_reset(&dev->vblank_disable_timer, 5 * DRM_HZ,
 		(timeout_t *)vblank_disable_fn, (void *)dev);
-	DRM_SPINUNLOCK_IRQRESTORE(&dev->vbl_lock, irqflags);
 }
 
 int drm_modeset_ctl(struct drm_device *dev, void *data,
 		    struct drm_file *file_priv)
 {
 	struct drm_modeset_ctl *modeset = data;
-	unsigned long irqflags;
 	int crtc, ret = 0;
 
 	DRM_DEBUG("num_crtcs=%d\n", dev->num_crtcs);
@@ -343,18 +352,22 @@ int drm_modeset_ctl(struct drm_device *d
 	case _DRM_PRE_MODESET:
 		DRM_DEBUG("pre-modeset\n");
 		if (!dev->vblank[crtc].inmodeset) {
-			dev->vblank[crtc].inmodeset = 1;
-			drm_vblank_get(dev, crtc);
+			dev->vblank[crtc].inmodeset = 0x1;
+			if (drm_vblank_get(dev, crtc) == 0)
+				dev->vblank[crtc].inmodeset |= 0x2;
 		}
 		break;
 	case _DRM_POST_MODESET:
 		DRM_DEBUG("post-modeset\n");
 		if (dev->vblank[crtc].inmodeset) {
-			DRM_SPINLOCK_IRQSAVE(&dev->vbl_lock, irqflags);
+			DRM_SPINLOCK(&dev->vbl_lock);
 			dev->vblank_disable_allowed = 1;
+			DRM_SPINUNLOCK(&dev->vbl_lock);
+
+			if (dev->vblank[crtc].inmodeset & 0x2)
+				drm_vblank_put(dev, crtc);
+
 			dev->vblank[crtc].inmodeset = 0;
-			DRM_SPINUNLOCK_IRQRESTORE(&dev->vbl_lock, irqflags);
-			drm_vblank_put(dev, crtc);
 		}
 		break;
 	default:
@@ -445,7 +458,11 @@ int drm_wait_vblank(struct drm_device *d
 			mtx_unlock(&dev->irq_lock);
 		}
 
-		DRM_DEBUG("return = %d\n", ret);
+		if (ret == ERESTART) {
+			DRM_DEBUG("restarting syscall\n");
+			return ret;
+		}
+
 		if (ret != EINTR) {
 			struct timeval now;
 

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 19 08:36:09 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 11B02106566B;
	Thu, 19 Mar 2009 08:36:09 +0000 (UTC)
	(envelope-from rnoland@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id DA1858FC1B;
	Thu, 19 Mar 2009 08:36:08 +0000 (UTC)
	(envelope-from rnoland@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2J8a8rr053645;
	Thu, 19 Mar 2009 08:36:08 GMT (envelope-from rnoland@svn.freebsd.org)
Received: (from rnoland@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2J8a8Kk053642;
	Thu, 19 Mar 2009 08:36:08 GMT (envelope-from rnoland@svn.freebsd.org)
Message-Id: <200903190836.n2J8a8Kk053642@svn.freebsd.org>
From: Robert Noland 
Date: Thu, 19 Mar 2009 08:36:08 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190023 - head/sys/dev/drm
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 19 Mar 2009 08:36:09 -0000

Author: rnoland
Date: Thu Mar 19 08:36:08 2009
New Revision: 190023
URL: http://svn.freebsd.org/changeset/base/190023

Log:
  Add some debugging so I can see when syscalls are being restarted
  consistantly.  After a lengthy irc discussion it seems like we
  shouldn't need to worry about them, but it's nice to know about.
  
  MFC after:	3 days

Modified:
  head/sys/dev/drm/drm_lock.c
  head/sys/dev/drm/mga_irq.c
  head/sys/dev/drm/radeon_irq.c

Modified: head/sys/dev/drm/drm_lock.c
==============================================================================
--- head/sys/dev/drm/drm_lock.c	Thu Mar 19 08:34:04 2009	(r190022)
+++ head/sys/dev/drm/drm_lock.c	Thu Mar 19 08:36:08 2009	(r190023)
@@ -87,7 +87,12 @@ int drm_lock(struct drm_device *dev, voi
 			break;
 	}
 	DRM_UNLOCK();
-	DRM_DEBUG("%d %s\n", lock->context, ret ? "interrupted" : "has lock");
+
+	if (ret == ERESTART)
+		DRM_DEBUG("restarting syscall\n");
+	else
+		DRM_DEBUG("%d %s\n", lock->context,
+		    ret ? "interrupted" : "has lock");
 
 	if (ret != 0)
 		return ret;

Modified: head/sys/dev/drm/mga_irq.c
==============================================================================
--- head/sys/dev/drm/mga_irq.c	Thu Mar 19 08:34:04 2009	(r190022)
+++ head/sys/dev/drm/mga_irq.c	Thu Mar 19 08:36:08 2009	(r190023)
@@ -139,6 +139,9 @@ int mga_driver_fence_wait(struct drm_dev
 		    (((cur_fence = atomic_read(&dev_priv->last_fence_retired))
 		      - *sequence) <= (1 << 23)));
 
+	if (ret == -ERESTART)
+		DRM_DEBUG("restarting syscall\n");
+
 	*sequence = cur_fence;
 
 	return ret;

Modified: head/sys/dev/drm/radeon_irq.c
==============================================================================
--- head/sys/dev/drm/radeon_irq.c	Thu Mar 19 08:34:04 2009	(r190022)
+++ head/sys/dev/drm/radeon_irq.c	Thu Mar 19 08:36:08 2009	(r190023)
@@ -282,6 +282,9 @@ static int radeon_wait_irq(struct drm_de
 	DRM_WAIT_ON(ret, dev_priv->swi_queue, 3 * DRM_HZ,
 		    RADEON_READ(RADEON_LAST_SWI_REG) >= swi_nr);
 
+	if (ret == -ERESTART)
+		DRM_DEBUG("restarting syscall");
+
 	return ret;
 }
 

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 19 10:23:26 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BBE87106564A;
	Thu, 19 Mar 2009 10:23:26 +0000 (UTC) (envelope-from bms@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id AAC718FC13;
	Thu, 19 Mar 2009 10:23:26 +0000 (UTC) (envelope-from bms@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2JANQ9J055901;
	Thu, 19 Mar 2009 10:23:26 GMT (envelope-from bms@svn.freebsd.org)
Received: (from bms@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JANQse055900;
	Thu, 19 Mar 2009 10:23:26 GMT (envelope-from bms@svn.freebsd.org)
Message-Id: <200903191023.n2JANQse055900@svn.freebsd.org>
From: Bruce M Simpson 
Date: Thu, 19 Mar 2009 10:23: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: r190024 - head/usr.bin/netstat
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 19 Mar 2009 10:23:27 -0000

Author: bms
Date: Thu Mar 19 10:23:26 2009
New Revision: 190024
URL: http://svn.freebsd.org/changeset/base/190024

Log:
  Fix size_t merge-o.

Modified:
  head/usr.bin/netstat/mroute.c

Modified: head/usr.bin/netstat/mroute.c
==============================================================================
--- head/usr.bin/netstat/mroute.c	Thu Mar 19 08:36:08 2009	(r190023)
+++ head/usr.bin/netstat/mroute.c	Thu Mar 19 10:23:26 2009	(r190024)
@@ -293,7 +293,7 @@ mroutepr(u_long pmfchashtbl, u_long pmfc
 			len -= sizeof(*m);
 		}
 		if (len != 0)
-			warnx("print_mfc: %d trailing bytes", len);
+			warnx("print_mfc: %lu trailing bytes", (u_long)len);
 
 		free(mfctable);
 	} else {

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 19 10:32:25 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C3A781065670;
	Thu, 19 Mar 2009 10:32:25 +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 B21A78FC13;
	Thu, 19 Mar 2009 10:32:25 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2JAWPjx058338;
	Thu, 19 Mar 2009 10:32:25 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JAWP1d058337;
	Thu, 19 Mar 2009 10:32:25 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <200903191032.n2JAWP1d058337@svn.freebsd.org>
From: Konstantin Belousov 
Date: Thu, 19 Mar 2009 10:32: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: r190025 - head/lib/libthr/thread
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 19 Mar 2009 10:32:26 -0000

Author: kib
Date: Thu Mar 19 10:32:25 2009
New Revision: 190025
URL: http://svn.freebsd.org/changeset/base/190025

Log:
  Forcibly unlock the malloc() locks in the child process after fork(),
  by temporary pretending that the process is still multithreaded.
  Current malloc lock primitives do nothing for singlethreaded process.
  
  Reviewed by:	davidxu, deischen

Modified:
  head/lib/libthr/thread/thr_fork.c

Modified: head/lib/libthr/thread/thr_fork.c
==============================================================================
--- head/lib/libthr/thread/thr_fork.c	Thu Mar 19 10:23:26 2009	(r190024)
+++ head/lib/libthr/thread/thr_fork.c	Thu Mar 19 10:32:25 2009	(r190025)
@@ -173,8 +173,11 @@ _fork(void)
 		/* Ready to continue, unblock signals. */ 
 		_thr_signal_unblock(curthread);
 
-		if (unlock_malloc)
+		if (unlock_malloc) {
+			__isthreaded = 1;
 			_malloc_postfork();
+			__isthreaded = 0;
+		}
 
 		/* Run down atfork child handlers. */
 		TAILQ_FOREACH(af, &_thr_atfork_list, qe) {

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 19 10:42:07 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 976E0106566C;
	Thu, 19 Mar 2009 10:42:07 +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 845288FC16;
	Thu, 19 Mar 2009 10:42:07 +0000 (UTC)
	(envelope-from brueffer@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2JAg7wL058576;
	Thu, 19 Mar 2009 10:42:07 GMT
	(envelope-from brueffer@svn.freebsd.org)
Received: (from brueffer@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JAg7iT058575;
	Thu, 19 Mar 2009 10:42:07 GMT
	(envelope-from brueffer@svn.freebsd.org)
Message-Id: <200903191042.n2JAg7iT058575@svn.freebsd.org>
From: Christian Brueffer 
Date: Thu, 19 Mar 2009 10:42: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: r190026 - 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, 19 Mar 2009 10:42:08 -0000

Author: brueffer
Date: Thu Mar 19 10:42:07 2009
New Revision: 190026
URL: http://svn.freebsd.org/changeset/base/190026

Log:
  Mdoc style, spelling, grammar and wording fixes. This manpage needs more work.

Modified:
  head/sbin/ipfw/ipfw.8

Modified: head/sbin/ipfw/ipfw.8
==============================================================================
--- head/sbin/ipfw/ipfw.8	Thu Mar 19 10:32:25 2009	(r190025)
+++ head/sbin/ipfw/ipfw.8	Thu Mar 19 10:42:07 2009	(r190026)
@@ -1,7 +1,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd September 27, 2008
+.Dd February 7, 2009
 .Dt IPFW 8
 .Os
 .Sh NAME
@@ -606,10 +606,10 @@ To delete previously applied tag, use th
 keyword.
 .Pp
 Note: since tags are kept with the packet everywhere in kernelspace,
-they can be set and unset anywhere in kernel network subsystem
-(using
+they can be set and unset anywhere in the kernel network subsystem
+(using the
 .Xr mbuf_tags 9
-facility), not only by means of
+facility), not only by means of the
 .Xr ipfw 4
 .Cm tag
 and
@@ -862,8 +862,8 @@ actions.
 .It Cm setfib Ar fibnum
 The packet is tagged so as to use the FIB (routing table)
 .Ar fibnum
-in any subsequent forwarding decisions. Initially this is
-limited to the values  0 through 15. See 
+in any subsequent forwarding decisions.
+Initially this is limited to the values 0 through 15, see
 .Xr setfib 8 .
 Processing continues at the next rule.
 .El
@@ -1166,7 +1166,7 @@ Destination options
 .Pq Cm dstopt ,
 IPSec authentication headers
 .Pq Cm ah ,
-and IPSec encapsulated security payload headers
+and IPsec encapsulated security payload headers
 .Pq Cm esp .
 .It Cm fib Ar fibnum
 Matches a packet that has been tagged to use
@@ -1835,13 +1835,12 @@ A pipe emulates a link with given bandwi
 queue size and packet loss rate.
 Packets are queued in front of the pipe as they come out from the classifier,
 and then transferred to the pipe according to the pipe's parameters.
-.Pp
 .It Em queue
 A queue
 is an abstraction used to implement the WF2Q+
 (Worst-case Fair Weighted Fair Queueing) policy, which is
 an efficient variant of the WFQ policy.
-.br
+.Pp
 The queue associates a
 .Em weight
 and a reference pipe to each flow, and then all backlogged (i.e.,
@@ -1850,8 +1849,8 @@ bandwidth proportionally to their weight
 Note that weights are not priorities; a flow with a lower weight
 is still guaranteed to get its fraction of the bandwidth even if a
 flow with a higher weight is permanently backlogged.
-.Pp
 .El
+.Pp
 In practice,
 .Em pipes
 can be used to set hard limits to the bandwidth that a flow can use, whereas
@@ -2101,7 +2100,7 @@ If you are logged in over a network, loa
 version of
 .Nm
 is probably not as straightforward as you would think.
-I recommend the following command line:
+The following command line is recommended:
 .Bd -literal -offset indent
 kldload ipfw && \e
 ipfw add 32000 allow ip from any to any
@@ -2141,14 +2140,13 @@ The nat configuration command is the fol
 .Ek
 .Ed
 .Pp
-.
 The following parameters can be configured:
 .Bl -tag -width indent
 .It Cm ip Ar ip_address
 Define an ip address to use for aliasing.
 .It Cm if Ar nic
-Use ip addres of NIC for aliasing, dynamically changing
-it if NIC's ip address change.
+Use ip address of NIC for aliasing, dynamically changing
+it if NIC's ip address changes.
 .It Cm log
 Enable logging on this nat instance.
 .It Cm deny_in
@@ -2171,27 +2169,26 @@ To let the packet continue after being (
 .Va net.inet.ip.fw.one_pass 
 to 0.
 For more information about aliasing modes, refer to
-.Xr libalias 3
-.
+.Xr libalias 3 .
 See Section
 .Sx EXAMPLES
 for some examples about nat usage.
 .Sh REDIRECT AND LSNAT SUPPORT IN IPFW
 Redirect and LSNAT support follow closely the syntax used in
-.Xr natd 8
-. 
+.Xr natd 8 . 
 See Section
 .Sx EXAMPLES
 for some examples on how to do redirect and lsnat.
 .Sh SCTP NAT SUPPORT
-Sctp nat can be configured in a simillar manner to TCP through the
-ipfw command line tool
-.Xr ipfw 8
-, the main difference is that 
+SCTP nat can be configured in a similar manner to TCP through the
+.Nm
+command line tool.
+The main difference is that 
 .Nm sctp nat 
-does not do port
-translation. Since the local and global side ports will be the same,
-there is no need to specify both. Ports are redirected as follows:
+does not do port translation.
+Since the local and global side ports will be the same,
+there is no need to specify both.
+Ports are redirected as follows:
 .Bd -ragged -offset indent
 .Bk -words
 .Cm nat 
@@ -2203,15 +2200,16 @@ there is no need to specify both. Ports 
 .Ek
 .Ed
 .Pp
-.
 Most
-.B sctp nat
+.Nm sctp nat
 configuration can be done in real-time through the
-.B sysctl(8)
-interface. All may be changed dynamically, though the hash_table size will only
-change for new 
-.Nm nat 
-instances. See 
+.Xr sysctl 8
+interface.
+All may be changed dynamically, though the hash_table size will only
+change for new
+.Nm nat
+instances.
+See
 .Sx SYSCTL VARIABLES 
 for more info.
 .Sh SYSCTL VARIABLES
@@ -2238,22 +2236,23 @@ ports and vtags match but global address
 will accept and process all OOTB global AddIP messages.
 .El
 .Pp
-Option 1 should never be selected as this forms a security risk. An attacker can
+Option 1 should never be selected as this forms a security risk.
+An attacker can
 establish multiple fake associations by sending AddIP messages.
 .It Va net.inet.ip.alias.sctp.chunk_proc_limit: No 5
 Defines the maximum number of chunks in an SCTP packet that will be parsed for a
-packet that matches an existing association. This value is enforced to be greater or equal
-than 
+packet that matches an existing association.
+This value is enforced to be greater or equal than 
 .Cm net.inet.ip.alias.sctp.initialising_chunk_proc_limit . 
 A high value is
 a DoS risk yet setting too low a value may result in important control chunks in
 the packet not being located and parsed.
 .It Va net.inet.ip.alias.sctp.error_on_ootb: No 1
-Defines when the 
+Defines when the
 .Nm nat 
-responds to any Out-of-the-Blue (OOTB) packets with ErrorM
-packets. An OOTB packet is a packet that arrives with no existing association
-registered in the 
+responds to any Out-of-the-Blue (OOTB) packets with ErrorM packets.
+An OOTB packet is a packet that arrives with no existing association
+registered in the
 .Nm nat 
 and is not an INIT or ASCONF-AddIP packet:
 .Bl -tag -width indent
@@ -2263,8 +2262,8 @@ ErrorM is never sent in response to OOTB
 ErrorM is only sent to OOTB packets received on the local side.
 .It Cm 2
 ErrorM is sent to the local side and on the global side ONLY if there is a
-partial match (ports and vtags match but the source global IP does not). This
-value is only useful if the 
+partial match (ports and vtags match but the source global IP does not).
+This value is only useful if the 
 .Nm nat 
 is tracking global IP addresses.
 .It Cm 3
@@ -2273,20 +2272,21 @@ ErrorM is sent in response to all OOTB p
 .El
 .Pp
 At the moment the default is 0, since the ErrorM packet is not yet
-supported by most SCTP stacks. When it is supported, and if not tracking
+supported by most SCTP stacks.
+When it is supported, and if not tracking
 global addresses, we recommend setting this value to 1 to allow
 multi-homed local hosts to function with the 
 .Nm nat .
 To track global addresses, we recommend setting this value to 2 to
 allow global hosts to be informed when they need to (re)send an
-ASCONF-AddIP. Value 3 should never be chosen (except for debugging) as
-the
+ASCONF-AddIP.
+Value 3 should never be chosen (except for debugging) as the
 .Nm nat 
 will respond to all OOTB global packets (a DoS risk).
 .It Va net.inet.ip.alias.sctp.hashtable_size: No 2003
 Size of hash tables used for 
 .Nm nat 
-lookups (100 < prime_number > 1000001)
+lookups (100 < prime_number > 1000001).
 This value sets the 
 .Nm hash table 
 size for any future created 
@@ -2294,26 +2294,33 @@ size for any future created 
 instance and therefore must be set prior to creating a 
 .Nm nat 
 instance.
-The table sizes my be changed to suit specific needs. If there will be few
-concurrent associations, and memory is scarce, you may make these smaller.  If
-there will be many thousands (or millions) of concurrent associations, you
-should make these larger. A prime number is best for the table size. The sysctl
+The table sizes may be changed to suit specific needs.
+If there will be few
+concurrent associations, and memory is scarce, you may make these smaller.
+If there will be many thousands (or millions) of concurrent associations, you
+should make these larger.
+A prime number is best for the table size.
+The sysctl
 update function will adjust your input value to the next highest prime number.
 .It Va net.inet.ip.alias.sctp.holddown_time:  No 0
 Hold association in table for this many seconds after receiving a
-SHUTDOWN-COMPLETE.  This allows endpoints to correct shutdown gracefully if a
+SHUTDOWN-COMPLETE.
+This allows endpoints to correct shutdown gracefully if a
 shutdown_complete is lost and retransmissions are required.
 .It Va net.inet.ip.alias.sctp.init_timer: No 15
 Timeout value while waiting for (INIT-ACK|AddIP-ACK).
 This value cannot be 0.
 .It Va net.inet.ip.alias.sctp.initialising_chunk_proc_limit: No 2
 Defines the maximum number of chunks in an SCTP packet that will be parsed when
-no existing association exists that matches that packet. Ideally this packet
-will only be an INIT or ASCONF-AddIP packet. A higher value may become a DoS
+no existing association exists that matches that packet.
+Ideally this packet
+will only be an INIT or ASCONF-AddIP packet.
+A higher value may become a DoS
 risk as malformed packets can consume processing resources.
 .It Va net.inet.ip.alias.sctp.param_proc_limit: No 25
 Defines the maximum number of parameters within a chunk that will be parsed in a
-packet. As for other similar sysctl variables, larger values pose a DoS risk.
+packet.
+As for other similar sysctl variables, larger values pose a DoS risk.
 .It Va net.inet.ip.alias.sctp.log_level: No 0 
 Level of detail in the system log messages (0 \- minimal, 1 \- event,
 2 \- info, 3 \- detail, 4 \- debug, 5 \- max debug). May be a good
@@ -2335,7 +2342,7 @@ association is limited to this value
 .El
 .Pp
 This variable is fully dynamic, the new value will be adopted for all newly
-arriving associations, existing association are treated as they were previously.
+arriving associations, existing associations are treated as they were previously.
 Global tracking will decrease the number of collisions within the 
 .Nm nat 
 at a cost
@@ -2552,10 +2559,10 @@ by adding the following to the top of a 
 This rule drops all incoming packets that appear to be coming from another
 directly connected system but on the wrong interface.
 For example, a packet with a source address of
-.Li 192.168.0.0/24
-, configured on
-.Li fxp0
-, but coming in on
+.Li 192.168.0.0/24 ,
+configured on
+.Li fxp0 ,
+but coming in on
 .Li fxp1
 would be dropped.
 .Ss DYNAMIC RULES
@@ -2875,14 +2882,13 @@ Work on
 .Nm dummynet
 traffic shaper supported by Akamba Corp.
 .Pp
-Sctp
+SCTP
 .Nm nat
 support has been developed by
 .An The Centre for Advanced Internet Architectures (CAIA) Aq http://www.caia.swin.edu.au .
 The primary developers and maintainers are David Hayes and Jason But.
 For further information visit:
 .Aq http://www.caia.swin.edu.au/urp/SONATA
-.
 .Sh BUGS
 The syntax has grown over the years and sometimes it might be confusing.
 Unfortunately, backward compatibility prevents cleaning up mistakes
@@ -2933,8 +2939,8 @@ or quoted appropriately.
 .Pp
 Due to the architecture of 
 .Xr libalias 3 , 
-ipfw nat is not compatible with the tcp segmentation offloading
-(TSO). Thus, to reliably nat your network traffic, please disable TSO
+ipfw nat is not compatible with the TCP segmentation offloading (TSO).
+Thus, to reliably nat your network traffic, please disable TSO
 on your NICs using
 .Xr ifconfig 8 .
 .Pp

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 19 12:31:59 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D8654106566B;
	Thu, 19 Mar 2009 12:31:59 +0000 (UTC)
	(envelope-from nyan@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C6F2E8FC17;
	Thu, 19 Mar 2009 12:31:59 +0000 (UTC)
	(envelope-from nyan@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2JCVxqD060797;
	Thu, 19 Mar 2009 12:31:59 GMT (envelope-from nyan@svn.freebsd.org)
Received: (from nyan@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JCVxsN060796;
	Thu, 19 Mar 2009 12:31:59 GMT (envelope-from nyan@svn.freebsd.org)
Message-Id: <200903191231.n2JCVxsN060796@svn.freebsd.org>
From: Takahashi Yoshihiro 
Date: Thu, 19 Mar 2009 12:31: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: r190027 - 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: Thu, 19 Mar 2009 12:32:00 -0000

Author: nyan
Date: Thu Mar 19 12:31:59 2009
New Revision: 190027
URL: http://svn.freebsd.org/changeset/base/190027

Log:
  Use the common PC98_SID_ACTIVE define instead of a local define.

Modified:
  head/sbin/fdisk_pc98/fdisk.c

Modified: head/sbin/fdisk_pc98/fdisk.c
==============================================================================
--- head/sbin/fdisk_pc98/fdisk.c	Thu Mar 19 10:42:07 2009	(r190026)
+++ head/sbin/fdisk_pc98/fdisk.c	Thu Mar 19 12:31:59 2009	(r190027)
@@ -84,8 +84,6 @@ struct mboot {
 static struct mboot mboot;
 static int fd;
 
-#define ACTIVE 0x80
-
 static uint dos_cyls;
 static uint dos_heads;
 static uint dos_sectors;
@@ -520,7 +518,7 @@ change_active(int which)
 
 	active = -1;
 	for (i = 0; i < NDOSPART; i++) {
-		if ((partp[i].dp_sid & ACTIVE) == 0)
+		if ((partp[i].dp_sid & PC98_SID_ACTIVE) == 0)
 			continue;
 		printf("Partition %d is marked active\n", i + 1);
 		if (active == -1)
@@ -545,7 +543,7 @@ setactive:
 		active = new;
 	} while (!ok("Are you happy with this choice"));
 	if (active > 0 && active <= 8)
-		partp[active-1].dp_sid |= ACTIVE;
+		partp[active-1].dp_sid |= PC98_SID_ACTIVE;
 }
 
 static void

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 19 12:33:37 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id ED2921065687;
	Thu, 19 Mar 2009 12:33:37 +0000 (UTC)
	(envelope-from nyan@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id DB4038FC14;
	Thu, 19 Mar 2009 12:33:37 +0000 (UTC)
	(envelope-from nyan@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2JCXbrT060934;
	Thu, 19 Mar 2009 12:33:37 GMT (envelope-from nyan@svn.freebsd.org)
Received: (from nyan@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JCXbJg060933;
	Thu, 19 Mar 2009 12:33:37 GMT (envelope-from nyan@svn.freebsd.org)
Message-Id: <200903191233.n2JCXbJg060933@svn.freebsd.org>
From: Takahashi Yoshihiro 
Date: Thu, 19 Mar 2009 12:33:37 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190029 - head/sys/boot/pc98/libpc98
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 19 Mar 2009 12:33:38 -0000

Author: nyan
Date: Thu Mar 19 12:33:37 2009
New Revision: 190029
URL: http://svn.freebsd.org/changeset/base/190029

Log:
  Use the common PC98_MID_* defines instead of a magic number.

Modified:
  head/sys/boot/pc98/libpc98/biosdisk.c

Modified: head/sys/boot/pc98/libpc98/biosdisk.c
==============================================================================
--- head/sys/boot/pc98/libpc98/biosdisk.c	Thu Mar 19 12:32:13 2009	(r190028)
+++ head/sys/boot/pc98/libpc98/biosdisk.c	Thu Mar 19 12:33:37 2009	(r190029)
@@ -625,9 +625,9 @@ bd_bestslice(struct open_disk *od)
 
 	dp = &od->od_slicetab[0];
 	for (i = 0; i < od->od_nslices; i++, dp++) {
-		switch(dp->dp_mid & 0x7f) {
-		case DOSMID_386BSD & 0x7f:		/* FreeBSD */
-			if ((dp->dp_mid & 0x80) &&
+		switch(dp->dp_mid & PC98_MID_MASK) {
+		case PC98_MID_386BSD:		/* FreeBSD */
+			if ((dp->dp_mid & PC98_MID_BOOTABLE) &&
 			    (preflevel > PREF_FBSD_ACT)) {
 				pref = i;
 				preflevel = PREF_FBSD_ACT;
@@ -643,7 +643,7 @@ bd_bestslice(struct open_disk *od)
 		case 0x22:
 		case 0x23:
 		case 0x63:
-			if ((dp->dp_mid & 0x80) &&
+			if ((dp->dp_mid & PC98_MID_BOOTABLE) &&
 			    (preflevel > PREF_DOS_ACT)) {
 				pref = i;
 				preflevel = PREF_DOS_ACT;

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 19 12:39:13 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9FE5B1065687;
	Thu, 19 Mar 2009 12:39:13 +0000 (UTC) (envelope-from des@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 8B9AB8FC28;
	Thu, 19 Mar 2009 12:39:13 +0000 (UTC) (envelope-from des@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2JCdDe2061098;
	Thu, 19 Mar 2009 12:39:13 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JCdD2K061097;
	Thu, 19 Mar 2009 12:39:13 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <200903191239.n2JCdD2K061097@svn.freebsd.org>
From: Dag-Erling Smorgrav 
Date: Thu, 19 Mar 2009 12:39: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: r190030 - head/sys/dev/ichwd
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 19 Mar 2009 12:39:14 -0000

Author: des
Date: Thu Mar 19 12:39:13 2009
New Revision: 190030
URL: http://svn.freebsd.org/changeset/base/190030

Log:
  Rename two functions to make their purpose clearer.  Add tons of comments.
  Generated code is identical after stripping .comment section.
  
  Suggested by:	Andriy Gapon 
  MFC after:	2 weeks

Modified:
  head/sys/dev/ichwd/ichwd.c

Modified: head/sys/dev/ichwd/ichwd.c
==============================================================================
--- head/sys/dev/ichwd/ichwd.c	Thu Mar 19 12:33:37 2009	(r190029)
+++ head/sys/dev/ichwd/ichwd.c	Thu Mar 19 12:39:13 2009	(r190030)
@@ -141,26 +141,55 @@ static devclass_t ichwd_devclass;
 			device_printf(dev, __VA_ARGS__);\
 	} while (0)
 
+/*
+ * Disable the watchdog timeout SMI handler.
+ *
+ * Apparently, some BIOSes install handlers that reset or disable the
+ * watchdog timer instead of resetting the system, so we disable the SMI
+ * (by clearing the SMI_TCO_EN bit of the SMI_EN register) to prevent this
+ * from happening.
+ */
 static __inline void
-ichwd_intr_enable(struct ichwd_softc *sc)
+ichwd_smi_disable(struct ichwd_softc *sc)
 {
 	ichwd_write_smi_4(sc, SMI_EN, ichwd_read_smi_4(sc, SMI_EN) & ~SMI_TCO_EN);
 }
 
+/*
+ * Enable the watchdog timeout SMI handler.  See above for details.
+ */
 static __inline void
-ichwd_intr_disable(struct ichwd_softc *sc)
+ichwd_smi_enable(struct ichwd_softc *sc)
 {
 	ichwd_write_smi_4(sc, SMI_EN, ichwd_read_smi_4(sc, SMI_EN) | SMI_TCO_EN);
 }
 
+/*
+ * Reset the watchdog status bits.
+ */
 static __inline void
 ichwd_sts_reset(struct ichwd_softc *sc)
 {
+	/*
+	 * The watchdog status bits are set to 1 by the hardware to
+	 * indicate various conditions.  They can be cleared by software
+	 * by writing a 1, not a 0.
+	 */
 	ichwd_write_tco_2(sc, TCO1_STS, TCO_TIMEOUT);
+	/*
+	 * XXX The datasheet says that TCO_SECOND_TO_STS must be cleared
+	 * before TCO_BOOT_STS, not the other way around.
+	 */
 	ichwd_write_tco_2(sc, TCO2_STS, TCO_BOOT_STS);
 	ichwd_write_tco_2(sc, TCO2_STS, TCO_SECOND_TO_STS);
 }
 
+/*
+ * Enable the watchdog timer by clearing the TCO_TMR_HALT bit in the
+ * TCO1_CNT register.  This is complicated by the need to preserve bit 9
+ * of that same register, and the requirement that all other bits must be
+ * written back as zero.
+ */
 static __inline void
 ichwd_tmr_enable(struct ichwd_softc *sc)
 {
@@ -172,6 +201,9 @@ ichwd_tmr_enable(struct ichwd_softc *sc)
 	ichwd_verbose_printf(sc->device, "timer enabled\n");
 }
 
+/*
+ * Disable the watchdog timer.  See above for details.
+ */
 static __inline void
 ichwd_tmr_disable(struct ichwd_softc *sc)
 {
@@ -183,6 +215,11 @@ ichwd_tmr_disable(struct ichwd_softc *sc
 	ichwd_verbose_printf(sc->device, "timer disabled\n");
 }
 
+/*
+ * Reload the watchdog timer: writing anything to any of the lower five
+ * bits of the TCO_RLD register reloads the timer from the last value
+ * written to TCO_TMR.
+ */
 static __inline void
 ichwd_tmr_reload(struct ichwd_softc *sc)
 {
@@ -194,6 +231,10 @@ ichwd_tmr_reload(struct ichwd_softc *sc)
 	ichwd_verbose_printf(sc->device, "timer reloaded\n");
 }
 
+/*
+ * Set the initial timeout value.  Note that this must always be followed
+ * by a reload.
+ */
 static __inline void
 ichwd_tmr_set(struct ichwd_softc *sc, unsigned int timeout)
 {
@@ -262,7 +303,8 @@ ichwd_clear_noreboot(struct ichwd_softc 
 }
 
 /*
- * Watchdog event handler.
+ * Watchdog event handler - called by the framework to enable or disable
+ * the watchdog or change the initial timeout value.
  */
 static void
 ichwd_event(void *arg, unsigned int cmd, int *error)
@@ -426,6 +468,13 @@ ichwd_attach(device_t dev)
 	device_printf(dev, "%s (ICH%d or equivalent)\n",
 	    device_get_desc(dev), sc->ich_version);
 
+	/*
+	 * XXX we should check the status registers (specifically, the
+	 * TCO_SECOND_TO_STS bit in the TCO2_STS register) to see if we
+	 * just came back from a watchdog-induced reset, and let the user
+	 * know.
+	 */
+
 	/* reset the watchdog status registers */
 	ichwd_sts_reset(sc);
 
@@ -435,8 +484,8 @@ ichwd_attach(device_t dev)
 	/* register the watchdog event handler */
 	sc->ev_tag = EVENTHANDLER_REGISTER(watchdog_list, ichwd_event, sc, 0);
 
-	/* enable watchdog timeout interrupts */
-	ichwd_intr_enable(sc);
+	/* disable the SMI handler */
+	ichwd_smi_disable(sc);
 
 	return (0);
  fail:
@@ -466,8 +515,8 @@ ichwd_detach(device_t dev)
 	if (sc->active)
 		ichwd_tmr_disable(sc);
 
-	/* disable watchdog timeout interrupts */
-	ichwd_intr_disable(sc);
+	/* enable the SMI handler */
+	ichwd_smi_enable(sc);
 
 	/* deregister event handler */
 	if (sc->ev_tag != NULL)

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 19 12:48:00 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B73DD106566B;
	Thu, 19 Mar 2009 12:48:00 +0000 (UTC) (envelope-from des@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A5B6D8FC0A;
	Thu, 19 Mar 2009 12:48:00 +0000 (UTC) (envelope-from des@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2JCm0Mo061332;
	Thu, 19 Mar 2009 12:48:00 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JCm0Rd061331;
	Thu, 19 Mar 2009 12:48:00 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <200903191248.n2JCm0Rd061331@svn.freebsd.org>
From: Dag-Erling Smorgrav 
Date: Thu, 19 Mar 2009 12:48:00 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190031 - head/etc/defaults
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 19 Mar 2009 12:48:01 -0000

Author: des
Date: Thu Mar 19 12:48:00 2009
New Revision: 190031
URL: http://svn.freebsd.org/changeset/base/190031

Log:
  Revert r188010.  When dhclient is backgrounded, services such as ntpdate,
  sendmail / postfix etc. may fail to start because DNS is unavailable and /
  or the server is unreachable.  In the worst case, the machine may become
  unusable.
  
  Debugging this issue was far more difficult than it should have been, due
  to earlier changes to the rc framework to hide almost all useful information
  about the boot process.
  
  Approved by:	silence

Modified:
  head/etc/defaults/rc.conf

Modified: head/etc/defaults/rc.conf
==============================================================================
--- head/etc/defaults/rc.conf	Thu Mar 19 12:39:13 2009	(r190030)
+++ head/etc/defaults/rc.conf	Thu Mar 19 12:48:00 2009	(r190031)
@@ -101,7 +101,7 @@ nisdomainname="NO"		# Set to NIS domain 
 dhclient_program="/sbin/dhclient"	# Path to dhcp client program.
 dhclient_flags=""		# Extra flags to pass to dhcp client.
 #dhclient_flags_fxp0=""		# Extra dhclient flags for fxp0 only
-background_dhclient="YES"	# Start dhcp client in the background.
+background_dhclient="NO"	# Start dhcp client in the background.
 #background_dhclient_fxp0="YES"	# Start dhcp client on fxp0 in the background.
 synchronous_dhclient="NO"	# Start dhclient directly on configured
 				# interfaces during startup.

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 19 12:52:20 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 91F6E106564A;
	Thu, 19 Mar 2009 12:52:20 +0000 (UTC) (envelope-from des@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 667188FC1D;
	Thu, 19 Mar 2009 12:52:20 +0000 (UTC) (envelope-from des@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2JCqK9P061463;
	Thu, 19 Mar 2009 12:52:20 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JCqKre061462;
	Thu, 19 Mar 2009 12:52:20 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <200903191252.n2JCqKre061462@svn.freebsd.org>
From: Dag-Erling Smorgrav 
Date: Thu, 19 Mar 2009 12:52: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: r190032 - head/etc
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 19 Mar 2009 12:52:21 -0000

Author: des
Date: Thu Mar 19 12:52:19 2009
New Revision: 190032
URL: http://svn.freebsd.org/changeset/base/190032

Log:
  Add hostid to the ranks.
  
  MFC after:	2 weeks

Modified:
  head/etc/netstart

Modified: head/etc/netstart
==============================================================================
--- head/etc/netstart	Thu Mar 19 12:48:00 2009	(r190031)
+++ head/etc/netstart	Thu Mar 19 12:52:19 2009	(r190032)
@@ -40,6 +40,7 @@ load_rc_config 'XXX'
 _start=quietstart
 
 /etc/rc.d/devd ${_start}
+/etc/rc.d/hostid ${_start}
 /etc/rc.d/hostname ${_start}
 /etc/rc.d/ipmon ${_start}
 /etc/rc.d/ipfilter ${_start}

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 19 13:53:42 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CDC6D1065691;
	Thu, 19 Mar 2009 13:53:42 +0000 (UTC)
	(envelope-from nyan@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A102F8FC0C;
	Thu, 19 Mar 2009 13:53:42 +0000 (UTC)
	(envelope-from nyan@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2JDrgSM063514;
	Thu, 19 Mar 2009 13:53:42 GMT (envelope-from nyan@svn.freebsd.org)
Received: (from nyan@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JDrggG063511;
	Thu, 19 Mar 2009 13:53:42 GMT (envelope-from nyan@svn.freebsd.org)
Message-Id: <200903191353.n2JDrggG063511@svn.freebsd.org>
From: Takahashi Yoshihiro 
Date: Thu, 19 Mar 2009 13:53: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: r190046 - in head/sys/boot/pc98: libpc98 loader
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 19 Mar 2009 13:53:43 -0000

Author: nyan
Date: Thu Mar 19 13:53:42 2009
New Revision: 190046
URL: http://svn.freebsd.org/changeset/base/190046

Log:
  Reduce diffs against i386.

Modified:
  head/sys/boot/pc98/libpc98/Makefile
  head/sys/boot/pc98/loader/Makefile
  head/sys/boot/pc98/loader/main.c

Modified: head/sys/boot/pc98/libpc98/Makefile
==============================================================================
--- head/sys/boot/pc98/libpc98/Makefile	Thu Mar 19 13:48:43 2009	(r190045)
+++ head/sys/boot/pc98/libpc98/Makefile	Thu Mar 19 13:53:42 2009	(r190046)
@@ -5,8 +5,9 @@ INTERNALLIB=
 
 .PATH:	${.CURDIR}/../../i386/libi386
 
-SRCS=	bioscd.c biosdisk.c biosmem.c biospnp.c biospci.c biossmap.c \
-	bootinfo.c bootinfo32.c comconsole.c devicename.c elf32_freebsd.c \
+SRCS=	bioscd.c biosdisk.c biosmem.c biospnp.c \
+	biospci.c biossmap.c bootinfo.c bootinfo32.c \
+	comconsole.c devicename.c elf32_freebsd.c \
 	i386_copy.c i386_module.c nullconsole.c pxe.c pxetramp.s \
 	time.c vidconsole.c
 

Modified: head/sys/boot/pc98/loader/Makefile
==============================================================================
--- head/sys/boot/pc98/loader/Makefile	Thu Mar 19 13:48:43 2009	(r190045)
+++ head/sys/boot/pc98/loader/Makefile	Thu Mar 19 13:53:42 2009	(r190046)
@@ -18,6 +18,7 @@ CFLAGS+=	-DLOADER_TFTP_SUPPORT
 CFLAGS+=	-DLOADER_NFS_SUPPORT
 .endif
 
+# Include bcache code.
 HAVE_BCACHE=	yes
 
 # Enable PnP and ISA-PnP code.

Modified: head/sys/boot/pc98/loader/main.c
==============================================================================
--- head/sys/boot/pc98/loader/main.c	Thu Mar 19 13:48:43 2009	(r190045)
+++ head/sys/boot/pc98/loader/main.c	Thu Mar 19 13:53:42 2009	(r190046)
@@ -145,6 +145,14 @@ main(void)
 	    bc_add(initial_bootdev);
     }
 
+    archsw.arch_autoload = i386_autoload;
+    archsw.arch_getdev = i386_getdev;
+    archsw.arch_copyin = i386_copyin;
+    archsw.arch_copyout = i386_copyout;
+    archsw.arch_readin = i386_readin;
+    archsw.arch_isainb = isa_inb;
+    archsw.arch_isaoutb = isa_outb;
+
     /*
      * March through the device switch probing for things.
      */
@@ -163,14 +171,6 @@ main(void)
 
     extract_currdev();				/* set $currdev and $loaddev */
     setenv("LINES", "24", 1);			/* optional */
-    
-    archsw.arch_autoload = i386_autoload;
-    archsw.arch_getdev = i386_getdev;
-    archsw.arch_copyin = i386_copyin;
-    archsw.arch_copyout = i386_copyout;
-    archsw.arch_readin = i386_readin;
-    archsw.arch_isainb = isa_inb;
-    archsw.arch_isaoutb = isa_outb;
 
     interact();			/* doesn't return */
 
@@ -188,7 +188,8 @@ static void
 extract_currdev(void)
 {
     struct i386_devdesc	new_currdev;
-    int			major, biosdev = -1;
+    int			major;
+    int			biosdev = -1;
 
     /* Assume we are booting from a BIOS disk by default */
     new_currdev.d_dev = &biosdisk;

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 19 14:13:19 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1F61110656C8;
	Thu, 19 Mar 2009 14:13:19 +0000 (UTC) (envelope-from dfr@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 0D43C8FC2C;
	Thu, 19 Mar 2009 14:13:19 +0000 (UTC) (envelope-from dfr@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2JEDIbR064389;
	Thu, 19 Mar 2009 14:13:18 GMT (envelope-from dfr@svn.freebsd.org)
Received: (from dfr@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JEDIFS064388;
	Thu, 19 Mar 2009 14:13:18 GMT (envelope-from dfr@svn.freebsd.org)
Message-Id: <200903191413.n2JEDIFS064388@svn.freebsd.org>
From: Doug Rabson 
Date: Thu, 19 Mar 2009 14:13: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: r190053 - head/sys/nfsserver
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 19 Mar 2009 14:13:20 -0000

Author: dfr
Date: Thu Mar 19 14:13:18 2009
New Revision: 190053
URL: http://svn.freebsd.org/changeset/base/190053

Log:
  Fix an mbuf leak in the error path.
  
  Submitted by:	Rick Macklem 

Modified:
  head/sys/nfsserver/nfs_srvkrpc.c

Modified: head/sys/nfsserver/nfs_srvkrpc.c
==============================================================================
--- head/sys/nfsserver/nfs_srvkrpc.c	Thu Mar 19 14:12:07 2009	(r190052)
+++ head/sys/nfsserver/nfs_srvkrpc.c	Thu Mar 19 14:13:18 2009	(r190053)
@@ -397,6 +397,7 @@ nfssvc_program(struct svc_req *rqst, SVC
 #endif
 #endif
 			    inet_ntoa(sin->sin_addr), port);
+			m_freem(mreq);
 			svcerr_weakauth(rqst);
 			svc_freereq(rqst);
 			return;
@@ -405,6 +406,7 @@ nfssvc_program(struct svc_req *rqst, SVC
 
 	if (proc != nfsrv_null) {
 		if (!svc_getcred(rqst, &nd.nd_cr, &nd.nd_credflavor)) {
+			m_freem(mreq);
 			svcerr_weakauth(rqst);
 			svc_freereq(rqst);
 			return;

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 19 14:14:21 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5E987106568A;
	Thu, 19 Mar 2009 14:14:21 +0000 (UTC) (envelope-from bms@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 4B8C88FC14;
	Thu, 19 Mar 2009 14:14:21 +0000 (UTC) (envelope-from bms@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2JEELM3064454;
	Thu, 19 Mar 2009 14:14:21 GMT (envelope-from bms@svn.freebsd.org)
Received: (from bms@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JEEL09064453;
	Thu, 19 Mar 2009 14:14:21 GMT (envelope-from bms@svn.freebsd.org)
Message-Id: <200903191414.n2JEEL09064453@svn.freebsd.org>
From: Bruce M Simpson 
Date: Thu, 19 Mar 2009 14:14: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: r190054 - 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: Thu, 19 Mar 2009 14:14:22 -0000

Author: bms
Date: Thu Mar 19 14:14:21 2009
New Revision: 190054
URL: http://svn.freebsd.org/changeset/base/190054

Log:
  Cleanup: Nuke debug.mrtdebug, and replace it with KTR.

Modified:
  head/sys/netinet/ip_mroute.c

Modified: head/sys/netinet/ip_mroute.c
==============================================================================
--- head/sys/netinet/ip_mroute.c	Thu Mar 19 14:13:18 2009	(r190053)
+++ head/sys/netinet/ip_mroute.c	Thu Mar 19 14:14:21 2009	(r190054)
@@ -59,7 +59,6 @@
  * domain attachment (if_afdata) so we can track consumers of that service.
  * TODO: Deprecate routing socket path for SIOCGETSGCNT and SIOCGETVIFCNT,
  * move it to socket options.
- * TODO: Rototile log_debug to use KTR.
  * TODO: Cleanup LSRR removal further.
  * TODO: Push RSVP stubs into raw_ip.c.
  * TODO: Use bitstring.h for vif set.
@@ -79,6 +78,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -117,14 +117,9 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
-#define		DEBUG_MFC	0x02
-#define		DEBUG_FORWARD	0x04
-#define		DEBUG_EXPIRE	0x08
-#define		DEBUG_XMIT	0x10
-#define		DEBUG_PIM	0x20
-static u_int	mrtdebug;
-SYSCTL_INT(_debug, OID_AUTO, mrtdebug, CTLFLAG_RW, &mrtdebug, 0,
-    "Enable/disable IPv4 multicast forwarding debugging flags");
+#ifndef KTR_IPMF
+#define KTR_IPMF KTR_SUBSYS
+#endif
 
 #define		VIFI_INVALID	((vifi_t) -1)
 #define		M_HASCL(m)	((m)->m_flags & M_EXT)
@@ -658,9 +653,8 @@ ip_mrouter_init(struct socket *so, int v
 {
     INIT_VNET_INET(curvnet);
 
-    if (mrtdebug)
-	log(LOG_DEBUG, "ip_mrouter_init: so_type = %d, pr_protocol = %d\n",
-	    so->so_type, so->so_proto->pr_protocol);
+    CTR3(KTR_IPMF, "%s: so_type %d, pr_protocol %d", __func__,
+        so->so_type, so->so_proto->pr_protocol);
 
     if (so->so_type != SOCK_RAW || so->so_proto->pr_protocol != IPPROTO_IGMP)
 	return EOPNOTSUPP;
@@ -694,8 +688,7 @@ ip_mrouter_init(struct socket *so, int v
 
     MROUTER_UNLOCK();
 
-    if (mrtdebug)
-	log(LOG_DEBUG, "ip_mrouter_init\n");
+    CTR1(KTR_IPMF, "%s: done", __func__);
 
     return 0;
 }
@@ -782,8 +775,7 @@ X_ip_mrouter_done(void)
 
     MROUTER_UNLOCK();
 
-    if (mrtdebug)
-	log(LOG_DEBUG, "ip_mrouter_done\n");
+    CTR1(KTR_IPMF, "%s: done", __func__);
 
     return 0;
 }
@@ -894,14 +886,12 @@ add_vif(struct vifctl *vifcp)
     }
 
     if ((vifcp->vifc_flags & VIFF_TUNNEL) != 0) {
-	log(LOG_ERR, "tunnels are no longer supported\n");
+	CTR1(KTR_IPMF, "%s: tunnels are no longer supported", __func__);
 	VIF_UNLOCK();
 	return EOPNOTSUPP;
     } else if (vifcp->vifc_flags & VIFF_REGISTER) {
 	ifp = &multicast_register_if;
-	if (mrtdebug)
-	    log(LOG_DEBUG, "Adding a register vif, ifp: %p\n",
-		    (void *)&multicast_register_if);
+	CTR2(KTR_IPMF, "%s: add register vif for ifp %p", __func__, ifp);
 	if (reg_vif_num == VIFI_INVALID) {
 	    if_initname(&multicast_register_if, "register_vif", 0);
 	    multicast_register_if.if_flags = IFF_LOOPBACK;
@@ -939,13 +929,9 @@ add_vif(struct vifctl *vifcp)
 
     VIF_UNLOCK();
 
-    if (mrtdebug)
-	log(LOG_DEBUG, "add_vif #%d, lcladdr %lx, %s %lx, thresh %x\n",
-	    vifcp->vifc_vifi,
-	    (u_long)ntohl(vifcp->vifc_lcl_addr.s_addr),
-	    (vifcp->vifc_flags & VIFF_TUNNEL) ? "rmtaddr" : "mask",
-	    (u_long)ntohl(vifcp->vifc_rmt_addr.s_addr),
-	    vifcp->vifc_threshold);
+    CTR4(KTR_IPMF, "%s: add vif %d laddr %s thresh %x", __func__,
+	(int)vifcp->vifc_vifi, inet_ntoa(&vifcp->vifc_lcl_addr),
+	(int)vifcp->vifc_threshold);
 
     return 0;
 }
@@ -976,8 +962,7 @@ del_vif_locked(vifi_t vifi)
 
     bzero((caddr_t)vifp, sizeof (*vifp));
 
-    if (mrtdebug)
-	log(LOG_DEBUG, "del_vif %d, numvifs %d\n", vifi, numvifs);
+    CTR2(KTR_IPMF, "%s: delete vif %d", __func__, (int)vifi);
 
     /* Adjust numvifs down */
     for (vifi = numvifs; vifi > 0; vifi--)
@@ -1074,12 +1059,10 @@ add_mfc(struct mfcctl2 *mfccp)
 
     /* If an entry already exists, just update the fields */
     if (rt) {
-	if (mrtdebug & DEBUG_MFC)
-	    log(LOG_DEBUG,"add_mfc update o %lx g %lx p %x\n",
-		(u_long)ntohl(mfccp->mfcc_origin.s_addr),
-		(u_long)ntohl(mfccp->mfcc_mcastgrp.s_addr),
-		mfccp->mfcc_parent);
-
+	CTR4(KTR_IPMF, "%s: update mfc orig %s group %lx parent %x",
+	    __func__, inet_ntoa(&mfccp->mfcc_origin),
+	    (u_long)ntohl(mfccp->mfcc_mcastgrp.s_addr),
+	    mfccp->mfcc_parent);
 	update_mfc_params(rt, mfccp);
 	MFC_UNLOCK();
 	VIF_UNLOCK();
@@ -1095,22 +1078,14 @@ add_mfc(struct mfcctl2 *mfccp)
 	if (in_hosteq(rt->mfc_origin, mfccp->mfcc_origin) &&
 	    in_hosteq(rt->mfc_mcastgrp, mfccp->mfcc_mcastgrp) &&
 	    !TAILQ_EMPTY(&rt->mfc_stall)) {
-		if (nstl++) {
-			log(LOG_ERR, "add_mfc %s o %lx g %lx p %x dbx %p\n",
-			    "multiple kernel entries",
-			    (u_long)ntohl(mfccp->mfcc_origin.s_addr),
-			    (u_long)ntohl(mfccp->mfcc_mcastgrp.s_addr),
-			    mfccp->mfcc_parent,
-			    (void *)TAILQ_FIRST(&rt->mfc_stall));
-		}
-
-		if (mrtdebug & DEBUG_MFC) {
-			log(LOG_DEBUG,"add_mfc o %lx g %lx p %x dbg %p\n",
-			    (u_long)ntohl(mfccp->mfcc_origin.s_addr),
-			    (u_long)ntohl(mfccp->mfcc_mcastgrp.s_addr),
-			    mfccp->mfcc_parent,
-			    (void *)TAILQ_FIRST(&rt->mfc_stall));
-		}
+		CTR5(KTR_IPMF,
+		    "%s: add mfc orig %s group %lx parent %x qh %p",
+		    __func__, inet_ntoa(&mfccp->mfcc_origin),
+		    (u_long)ntohl(mfccp->mfcc_mcastgrp.s_addr),
+		    mfccp->mfcc_parent,
+		    TAILQ_FIRST(&rt->mfc_stall));
+		if (nstl++)
+			CTR1(KTR_IPMF, "%s: multiple matches", __func__);
 
 		init_mfc_params(rt, mfccp);
 		rt->mfc_expire = 0;	/* Don't clean this guy up */
@@ -1132,15 +1107,7 @@ add_mfc(struct mfcctl2 *mfccp)
      * It is possible that an entry is being inserted without an upcall
      */
     if (nstl == 0) {
-	/*
-	 * No mfc; make a new one
-	 */
-	if (mrtdebug & DEBUG_MFC)
-	    log(LOG_DEBUG,"add_mfc no upcall h %lu o %lx g %lx p %x\n",
-		hash, (u_long)ntohl(mfccp->mfcc_origin.s_addr),
-		(u_long)ntohl(mfccp->mfcc_mcastgrp.s_addr),
-		mfccp->mfcc_parent);
-
+	CTR1(KTR_IPMF, "%s: adding mfc w/o upcall", __func__);
 	LIST_FOREACH(rt, &mfchashtbl[hash], mfc_hash) {
 		if (in_hosteq(rt->mfc_origin, mfccp->mfcc_origin) &&
 		    in_hosteq(rt->mfc_mcastgrp, mfccp->mfcc_mcastgrp)) {
@@ -1191,11 +1158,8 @@ del_mfc(struct mfcctl2 *mfccp)
     origin = mfccp->mfcc_origin;
     mcastgrp = mfccp->mfcc_mcastgrp;
 
-    if (mrtdebug & DEBUG_MFC) {
-	log(LOG_DEBUG,"del_mfc orig %lx mcastgrp %lx\n",
-	    (u_long)ntohl(origin.s_addr),
-	    (u_long)ntohl(mcastgrp.s_addr));
-    }
+    CTR3(KTR_IPMF, "%s: delete mfc orig %s group %lx", __func__,
+	inet_ntoa(origin), (u_long)ntohl(mcastgrp.s_addr));
 
     MFC_LOCK();
 
@@ -1260,10 +1224,8 @@ X_ip_mforward(struct ip *ip, struct ifne
     int error;
     vifi_t vifi;
 
-    if (mrtdebug & DEBUG_FORWARD)
-	log(LOG_DEBUG, "ip_mforward: src %lx, dst %lx, ifp %p\n",
-	    (u_long)ntohl(ip->ip_src.s_addr), (u_long)ntohl(ip->ip_dst.s_addr),
-	    (void *)ifp);
+    CTR3(KTR_IPMF, "ip_mforward: delete mfc orig %s group %lx ifp %p",
+	inet_ntoa(ip->ip_src), (u_long)ntohl(mcastgrp.s_addr), ifp);
 
     if (ip->ip_hl < (sizeof(struct ip) + TUNNEL_LEN) >> 2 ||
 		((u_char *)(ip + 1))[1] != IPOPT_LSRR ) {
@@ -1276,14 +1238,7 @@ X_ip_mforward(struct ip *ip, struct ifne
 	 * Packet arrived through a source-route tunnel.
 	 * Source-route tunnels are no longer supported.
 	 */
-	static int last_log;
-	if (last_log != time_uptime) {
-	    last_log = time_uptime;
-	    log(LOG_ERR,
-		"ip_mforward: received source-routed packet from %lx\n",
-		(u_long)ntohl(ip->ip_src.s_addr));
-	}
-	return 1;
+	return (1);
     }
 
     VIF_LOCK();
@@ -1333,10 +1288,8 @@ X_ip_mforward(struct ip *ip, struct ifne
 	++mrtstat.mrts_mfc_misses;
 
 	mrtstat.mrts_no_route++;
-	if (mrtdebug & (DEBUG_FORWARD | DEBUG_MFC))
-	    log(LOG_DEBUG, "ip_mforward: no rte s %lx g %lx\n",
-		(u_long)ntohl(ip->ip_src.s_addr),
-		(u_long)ntohl(ip->ip_dst.s_addr));
+	CTR2(KTR_IPMF, "ip_mforward: no mfc for (%s,%lx)",
+	    inet_ntoa(ip->ip_src), (u_long)ntohl(ip->ip_dst.s_addr));
 
 	/*
 	 * Allocate mbufs early so that we don't do extra work if we are
@@ -1390,6 +1343,7 @@ X_ip_mforward(struct ip *ip, struct ifne
 	    rt = (struct mfc *)malloc(sizeof(*rt), M_MRTABLE, M_NOWAIT);
 	    if (rt == NULL)
 		goto fail;
+
 	    /* Make a copy of the header to send to the user level process */
 	    mm = m_copy(mb0, 0, hlen);
 	    if (mm == NULL)
@@ -1409,7 +1363,7 @@ X_ip_mforward(struct ip *ip, struct ifne
 
 	    k_igmpsrc.sin_addr = ip->ip_src;
 	    if (socket_send(V_ip_mrouter, mm, &k_igmpsrc) < 0) {
-		log(LOG_WARNING, "ip_mforward: ip_mrouter socket queue full\n");
+		CTR0(KTR_IPMF, "ip_mforward: socket queue full");
 		++mrtstat.mrts_upq_sockfull;
 fail1:
 		free(rt, M_MRTABLE);
@@ -1502,11 +1456,9 @@ expire_upcalls(void *unused)
 		}
 
 		++mrtstat.mrts_cache_cleanups;
-		if (mrtdebug & DEBUG_EXPIRE) {
-		    log(LOG_DEBUG, "expire_upcalls: expiring (%lx %lx)\n",
-			(u_long)ntohl(rt->mfc_origin.s_addr),
-			(u_long)ntohl(rt->mfc_mcastgrp.s_addr));
-		}
+		CTR3(KTR_IPMF, "%s: expire (%lx, %lx)", __func__,
+		    (u_long)ntohl(rt->mfc_origin.s_addr),
+		    (u_long)ntohl(rt->mfc_mcastgrp.s_addr));
 
 		expire_mfc(rt);
 	    }
@@ -1548,10 +1500,8 @@ ip_mdq(struct mbuf *m, struct ifnet *ifp
      */
     vifi = rt->mfc_parent;
     if ((vifi >= numvifs) || (viftable[vifi].v_ifp != ifp)) {
-	/* came in the wrong interface */
-	if (mrtdebug & DEBUG_FORWARD)
-	    log(LOG_DEBUG, "wrong if: ifp %p vifi %d vififp %p\n",
-		(void *)ifp, vifi, (void *)viftable[vifi].v_ifp);
+	CTR4(KTR_IPMF, "%s: rx on wrong ifp %p (vifi %d, v_ifp %p)",
+	    __func__, ifp, (int)vifi, viftable[vifi].v_ifp);
 	++mrtstat.mrts_wrong_if;
 	++rt->mfc_wrong_if;
 	/*
@@ -1596,8 +1546,7 @@ ip_mdq(struct mbuf *m, struct ifnet *ifp
 
 		k_igmpsrc.sin_addr = im->im_src;
 		if (socket_send(V_ip_mrouter, mm, &k_igmpsrc) < 0) {
-		    log(LOG_WARNING,
-			"ip_mforward: ip_mrouter socket queue full\n");
+		    CTR1(KTR_IPMF, "%s: socket queue full", __func__);
 		    ++mrtstat.mrts_upq_sockfull;
 		    return ENOBUFS;
 		}
@@ -1736,10 +1685,8 @@ send_packet(struct vif *vifp, struct mbu
 	 * the loopback interface, thus preventing looping.
 	 */
 	error = ip_output(m, NULL, &vifp->v_route, IP_FORWARDING, &imo, NULL);
-	if (mrtdebug & DEBUG_XMIT) {
-	    log(LOG_DEBUG, "phyint_send on vif %td err %d\n",
-		vifp - viftable, error);
-	}
+	CTR3(KTR_IPMF, "%s: vif %td err %d", __func__,
+	    (ptrdiff_t)(vifp - viftable), error);
 }
 
 /*
@@ -2362,9 +2309,6 @@ pim_register_send(struct ip *ip, struct 
 {
     struct mbuf *mb_copy, *mm;
 
-    if (mrtdebug & DEBUG_PIM)
-	log(LOG_DEBUG, "pim_register_send: ");
-
     /*
      * Do not send IGMP_WHOLEPKT notifications to userland, if the
      * rendezvous point was unspecified, and we were told not to.
@@ -2490,9 +2434,7 @@ pim_register_send_upcall(struct ip *ip, 
     mrtstat.mrts_upcalls++;
 
     if (socket_send(V_ip_mrouter, mb_first, &k_igmpsrc) < 0) {
-	if (mrtdebug & DEBUG_PIM)
-	    log(LOG_WARNING,
-		"mcast: pim_register_send_upcall: ip_mrouter socket queue full");
+	CTR1(KTR_IPMF, "%s: socket queue full", __func__);
 	++mrtstat.mrts_upq_sockfull;
 	return ENOBUFS;
     }
@@ -2620,8 +2562,8 @@ pim_input(struct mbuf *m, int off)
      */
     if (datalen < PIM_MINLEN) {
 	pimstat.pims_rcv_tooshort++;
-	log(LOG_ERR, "pim_input: packet size too small %d from %lx\n",
-	    datalen, (u_long)ip->ip_src.s_addr);
+	CTR3(KTR_IPMF, "%s: short packet (%d) from %s",
+	    __func__, datalen, inet_ntoa(&ip->ip_src));
 	m_freem(m);
 	return;
     }
@@ -2641,9 +2583,10 @@ pim_input(struct mbuf *m, int off)
      */
     if ((m->m_flags & M_EXT || m->m_len < minlen) &&
 	(m = m_pullup(m, minlen)) == 0) {
-	log(LOG_ERR, "pim_input: m_pullup failure\n");
+	CTR1(KTR_IPMF, "%s: m_pullup() failed", __func__);
 	return;
     }
+
     /* m_pullup() may have given us a new mbuf so reset ip. */
     ip = mtod(m, struct ip *);
     ip_tos = ip->ip_tos;
@@ -2664,8 +2607,7 @@ pim_input(struct mbuf *m, int off)
 	/* do nothing, checksum okay */
     } else if (in_cksum(m, datalen)) {
 	pimstat.pims_rcv_badsum++;
-	if (mrtdebug & DEBUG_PIM)
-	    log(LOG_DEBUG, "pim_input: invalid checksum");
+	CTR1(KTR_IPMF, "%s: invalid checksum", __func__);
 	m_freem(m);
 	return;
     }
@@ -2673,8 +2615,8 @@ pim_input(struct mbuf *m, int off)
     /* PIM version check */
     if (PIM_VT_V(pim->pim_vt) < PIM_VERSION) {
 	pimstat.pims_rcv_badversion++;
-	log(LOG_ERR, "pim_input: incorrect version %d, expecting %d\n",
-	    PIM_VT_V(pim->pim_vt), PIM_VERSION);
+	CTR3(KTR_IPMF, "%s: bad version %d expect %d", __func__,
+	    (int)PIM_VT_V(pim->pim_vt), PIM_VERSION);
 	m_freem(m);
 	return;
     }
@@ -2698,9 +2640,8 @@ pim_input(struct mbuf *m, int off)
 	VIF_LOCK();
 	if ((reg_vif_num >= numvifs) || (reg_vif_num == VIFI_INVALID)) {
 	    VIF_UNLOCK();
-	    if (mrtdebug & DEBUG_PIM)
-		log(LOG_DEBUG,
-		    "pim_input: register vif not set: %d\n", reg_vif_num);
+	    CTR2(KTR_IPMF, "%s: register vif not set: %d", __func__,
+		(int)reg_vif_num);
 	    m_freem(m);
 	    return;
 	}
@@ -2714,9 +2655,7 @@ pim_input(struct mbuf *m, int off)
 	if (datalen < PIM_REG_MINLEN) {
 	    pimstat.pims_rcv_tooshort++;
 	    pimstat.pims_rcv_badregisters++;
-	    log(LOG_ERR,
-		"pim_input: register packet size too small %d from %lx\n",
-		datalen, (u_long)ip->ip_src.s_addr);
+	    CTR1(KTR_IPMF, "%s: register packet size too small", __func__);
 	    m_freem(m);
 	    return;
 	}
@@ -2724,21 +2663,13 @@ pim_input(struct mbuf *m, int off)
 	reghdr = (u_int32_t *)(pim + 1);
 	encap_ip = (struct ip *)(reghdr + 1);
 
-	if (mrtdebug & DEBUG_PIM) {
-	    log(LOG_DEBUG,
-		"pim_input[register], encap_ip: %lx -> %lx, encap_ip len %d\n",
-		(u_long)ntohl(encap_ip->ip_src.s_addr),
-		(u_long)ntohl(encap_ip->ip_dst.s_addr),
-		ntohs(encap_ip->ip_len));
-	}
+	CTR3(KTR_IPMF, "%s: register: encap ip src %s len %d",
+	    __func__, inet_ntoa(encap_ip->ip_src), ntohs(encap_ip->ip_len));
 
 	/* verify the version number of the inner packet */
 	if (encap_ip->ip_v != IPVERSION) {
 	    pimstat.pims_rcv_badregisters++;
-	    if (mrtdebug & DEBUG_PIM) {
-		log(LOG_DEBUG, "pim_input: invalid IP version (%d) "
-		    "of the inner packet\n", encap_ip->ip_v);
-	    }
+	    CTR1(KTR_IPMF, "%s: bad encap ip version", __func__);
 	    m_freem(m);
 	    return;
 	}
@@ -2746,11 +2677,8 @@ pim_input(struct mbuf *m, int off)
 	/* verify the inner packet is destined to a mcast group */
 	if (!IN_MULTICAST(ntohl(encap_ip->ip_dst.s_addr))) {
 	    pimstat.pims_rcv_badregisters++;
-	    if (mrtdebug & DEBUG_PIM)
-		log(LOG_DEBUG,
-		    "pim_input: inner packet of register is not "
-		    "multicast %lx\n",
-		    (u_long)ntohl(encap_ip->ip_dst.s_addr));
+	    CTR2(KTR_IPMF, "%s: bad encap ip dest %s", __func__,
+		inet_ntoa(encap_ip->ip_dst));
 	    m_freem(m);
 	    return;
 	}
@@ -2789,8 +2717,7 @@ pim_input(struct mbuf *m, int off)
 	 */
 	mcp = m_copy(m, 0, iphlen + PIM_REG_MINLEN);
 	if (mcp == NULL) {
-	    log(LOG_ERR,
-		"pim_input: pim register: could not copy register head\n");
+	    CTR1(KTR_IPMF, "%s: m_copy() failed", __func__);
 	    m_freem(m);
 	    return;
 	}
@@ -2805,14 +2732,13 @@ pim_input(struct mbuf *m, int off)
 	 */
 	m_adj(m, iphlen + PIM_MINLEN);
 
-	if (mrtdebug & DEBUG_PIM) {
-	    log(LOG_DEBUG,
-		"pim_input: forwarding decapsulated register: "
-		"src %lx, dst %lx, vif %d\n",
-		(u_long)ntohl(encap_ip->ip_src.s_addr),
-		(u_long)ntohl(encap_ip->ip_dst.s_addr),
-		reg_vif_num);
-	}
+	CTR4(KTR_IPMF,
+	    "%s: forward decap'd REGISTER: src %lx dst %lx vif %d",
+	    __func__,
+	    (u_long)ntohl(encap_ip->ip_src.s_addr),
+	    (u_long)ntohl(encap_ip->ip_dst.s_addr),
+	    (int)reg_vif_num);
+
 	/* NB: vifp was collected above; can it change on us? */
 	if_simloop(vifp, m, dst.sin_family, 0);
 

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 19 14:23:18 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1F9971065670;
	Thu, 19 Mar 2009 14:23:18 +0000 (UTC)
	(envelope-from ivoras@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E793E8FC1E;
	Thu, 19 Mar 2009 14:23:17 +0000 (UTC)
	(envelope-from ivoras@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2JENH56064871;
	Thu, 19 Mar 2009 14:23:17 GMT (envelope-from ivoras@svn.freebsd.org)
Received: (from ivoras@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JENHUl064869;
	Thu, 19 Mar 2009 14:23:17 GMT (envelope-from ivoras@svn.freebsd.org)
Message-Id: <200903191423.n2JENHUl064869@svn.freebsd.org>
From: Ivan Voras 
Date: Thu, 19 Mar 2009 14:23: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: r190058 - head/sys/geom/part
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 19 Mar 2009 14:23:18 -0000

Author: ivoras
Date: Thu Mar 19 14:23:17 2009
New Revision: 190058
URL: http://svn.freebsd.org/changeset/base/190058

Log:
  Make GEOM provider names starting with "/dev/" acceptable as well as their
  "raw" names. While there, change the formatting of extended MSDOS partitions
  so that the dot (".") is not used to separate two numbers (which kind of
  looks like the whole is a decimal number). Use "+" instead, which also
  hints that the second part of the name is the offset from the start of
  the partition in the first part of the name. Also change the offset from
  decimal to hexadecimal notation, simply for aesthetic reasons and future
  compatibility.
  
  GEOM_PART is the default in 8-CURRENT but not yet in 7-STABLE so this
  changeset can be MFC-ed without causing major problems from the second
  part.
  
  Reviewed by:	marcel
  Approved by:	gnn (mentor)
  MFC after:	2 weeks

Modified:
  head/sys/geom/part/g_part.c
  head/sys/geom/part/g_part_ebr.c

Modified: head/sys/geom/part/g_part.c
==============================================================================
--- head/sys/geom/part/g_part.c	Thu Mar 19 14:20:00 2009	(r190057)
+++ head/sys/geom/part/g_part.c	Thu Mar 19 14:23:17 2009	(r190058)
@@ -49,6 +49,10 @@ __FBSDID("$FreeBSD$");
 
 #include "g_part_if.h"
 
+#ifndef _PATH_DEV
+#define _PATH_DEV "/dev/"
+#endif
+
 static kobj_method_t g_part_null_methods[] = {
 	{ 0, 0 }
 };
@@ -273,12 +277,17 @@ g_part_new_provider(struct g_geom *gp, s
 }
 
 static int
-g_part_parm_geom(const char *p, struct g_geom **v)
+g_part_parm_geom(const char *rawname, struct g_geom **v)
 {
 	struct g_geom *gp;
+	const char *pname;
 
+	if (strncmp(rawname, _PATH_DEV, strlen(_PATH_DEV)) == 0)
+		pname = rawname + strlen(_PATH_DEV);
+	else
+		pname = rawname;
 	LIST_FOREACH(gp, &g_part_class.geom, geom) {
-		if (!strcmp(p, gp->name))
+		if (!strcmp(pname, gp->name))
 			break;
 	}
 	if (gp == NULL)
@@ -288,11 +297,14 @@ g_part_parm_geom(const char *p, struct g
 }
 
 static int
-g_part_parm_provider(const char *p, struct g_provider **v)
+g_part_parm_provider(const char *pname, struct g_provider **v)
 {
 	struct g_provider *pp;
 
-	pp = g_provider_by_name(p);
+	if (strncmp(pname, _PATH_DEV, strlen(_PATH_DEV)) == 0)
+		pp = g_provider_by_name(pname + strlen(_PATH_DEV));
+	else
+		pp = g_provider_by_name(pname);
 	if (pp == NULL)
 		return (EINVAL);
 	*v = pp;

Modified: head/sys/geom/part/g_part_ebr.c
==============================================================================
--- head/sys/geom/part/g_part_ebr.c	Thu Mar 19 14:20:00 2009	(r190057)
+++ head/sys/geom/part/g_part_ebr.c	Thu Mar 19 14:23:17 2009	(r190058)
@@ -343,7 +343,7 @@ g_part_ebr_name(struct g_part_table *tab
     char *buf, size_t bufsz)
 {
 
-	snprintf(buf, bufsz, ".%08u", entry->gpe_index);
+	snprintf(buf, bufsz, "+%08x", entry->gpe_index);
 	return (buf);
 }
 

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 19 14:26:00 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A3F8A106564A;
	Thu, 19 Mar 2009 14:26:00 +0000 (UTC)
	(envelope-from ivoras@gmail.com)
Received: from mail-bw0-f164.google.com (mail-bw0-f164.google.com
	[209.85.218.164])
	by mx1.freebsd.org (Postfix) with ESMTP id BEC028FC13;
	Thu, 19 Mar 2009 14:25:59 +0000 (UTC)
	(envelope-from ivoras@gmail.com)
Received: by bwz8 with SMTP id 8so489917bwz.43
	for ; Thu, 19 Mar 2009 07:25:58 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:sender:received:in-reply-to
	:references:date:x-google-sender-auth:message-id:subject:from:to
	:content-type:content-transfer-encoding;
	bh=tO/E5gFxdmpPUcqw6g2kQ1yOUXGRBv2aznhFXBXyAq0=;
	b=ZyEB5++LLUFccPoWVT+hoaJHS9CggLj3a9rIzAhgwmROA57j/2HQun6t8TVHzNijFJ
	GZlRtJYuZ/tqnBv0IOSQT8RH+Kb2M+/7LX6EHOwKbolxnM94mskhssW0DJ2w99TnyCRs
	IGWfWITY06t2JYVNX4fM5GFFsnA/Emu4Jt+0o=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:content-type
	:content-transfer-encoding;
	b=FIfBIRH2fUlEe9Wr9ad4BOsyYpXmbOoEBhFEQy5fdCX5MS1ZLmR4ptdPogPALIhc/l
	QAi4OyQkmSVL7h35K0bgzNLLdCAuvvG+/wla45wMxR5fUIFb9KSkd1S83cUiO0lC/mFR
	IRgvjhF+pGRwaZlI/zjWt08EiI/vBN95rbeXs=
MIME-Version: 1.0
Sender: ivoras@gmail.com
Received: by 10.204.76.13 with SMTP id a13mr852221bkk.105.1237472758710; Thu, 
	19 Mar 2009 07:25:58 -0700 (PDT)
In-Reply-To: <200903191423.n2JENHUl064869@svn.freebsd.org>
References: <200903191423.n2JENHUl064869@svn.freebsd.org>
Date: Thu, 19 Mar 2009 15:25:58 +0100
X-Google-Sender-Auth: 5c71427f97e62c40
Message-ID: <9bbcef730903190725y716a1fd9w434dff8d9948d761@mail.gmail.com>
From: Ivan Voras 
To: src-committers@freebsd.org, svn-src-all@freebsd.org, 
	svn-src-head@freebsd.org
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Cc: 
Subject: Re: svn commit: r190058 - head/sys/geom/part
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 19 Mar 2009 14:26:01 -0000

>
> +#ifndef _PATH_DEV
> +#define _PATH_DEV "/dev/"
> +#endif
> +

This is also about the second time I've needed _PATH_DEV for similar
purposes in the kernel, but paths.h is not in include/sys. Is there a
recommendation for this situation?

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 19 15:44:13 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 86409106571C;
	Thu, 19 Mar 2009 15:44:13 +0000 (UTC)
	(envelope-from vanhu@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 72BE38FC0C;
	Thu, 19 Mar 2009 15:44:13 +0000 (UTC)
	(envelope-from vanhu@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2JFiDCZ067297;
	Thu, 19 Mar 2009 15:44:13 GMT (envelope-from vanhu@svn.freebsd.org)
Received: (from vanhu@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JFiD63067296;
	Thu, 19 Mar 2009 15:44:13 GMT (envelope-from vanhu@svn.freebsd.org)
Message-Id: <200903191544.n2JFiD63067296@svn.freebsd.org>
From: VANHULLEBUS Yvan 
Date: Thu, 19 Mar 2009 15:44: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: r190071 - head/sys/netipsec
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 19 Mar 2009 15:44:15 -0000

Author: vanhu
Date: Thu Mar 19 15:44:13 2009
New Revision: 190071
URL: http://svn.freebsd.org/changeset/base/190071

Log:
  Fixed style for some comments
  
  Approved by:	gnn(mentor)

Modified:
  head/sys/netipsec/key.c

Modified: head/sys/netipsec/key.c
==============================================================================
--- head/sys/netipsec/key.c	Thu Mar 19 15:40:44 2009	(r190070)
+++ head/sys/netipsec/key.c	Thu Mar 19 15:44:13 2009	(r190071)
@@ -2687,7 +2687,9 @@ key_delsah(sah)
 			if (sav->refcnt == 0) {
 				/* sanity check */
 				KEY_CHKSASTATE(state, sav->state, __func__);
-				/* do NOT call KEY_FREESAV here: it will only delete the sav if refcnt == 1,
+				/* 
+				 * do NOT call KEY_FREESAV here:
+				 * it will only delete the sav if refcnt == 1,
 				 * where we already know that refcnt == 0
 				 */
 				key_delsav(sav);
@@ -4134,8 +4136,7 @@ key_flush_sad(time_t now)
 
 		/* if LARVAL entry doesn't become MATURE, delete it. */
 		LIST_FOREACH_SAFE(sav, &sah->savtree[SADB_SASTATE_LARVAL], chain, nextsav) {
-			/* Need to also check refcnt for a larval SA ???
-			 */
+			/* Need to also check refcnt for a larval SA ??? */
 			if (now - sav->created > V_key_larval_lifetime)
 				KEY_FREESAV(&sav);
 		}

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 19 15:50:46 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1037D1065676;
	Thu, 19 Mar 2009 15:50:46 +0000 (UTC)
	(envelope-from vanhu@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id F2ED88FC0A;
	Thu, 19 Mar 2009 15:50:45 +0000 (UTC)
	(envelope-from vanhu@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2JFojZT067665;
	Thu, 19 Mar 2009 15:50:45 GMT (envelope-from vanhu@svn.freebsd.org)
Received: (from vanhu@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JFojsB067664;
	Thu, 19 Mar 2009 15:50:45 GMT (envelope-from vanhu@svn.freebsd.org)
Message-Id: <200903191550.n2JFojsB067664@svn.freebsd.org>
From: VANHULLEBUS Yvan 
Date: Thu, 19 Mar 2009 15:50: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: r190075 - head/sys/netipsec
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 19 Mar 2009 15:50:46 -0000

Author: vanhu
Date: Thu Mar 19 15:50:45 2009
New Revision: 190075
URL: http://svn.freebsd.org/changeset/base/190075

Log:
  Fixed style for some comments
  
  Approved by:	gnn(mentor)

Modified:
  head/sys/netipsec/key.c

Modified: head/sys/netipsec/key.c
==============================================================================
--- head/sys/netipsec/key.c	Thu Mar 19 15:49:30 2009	(r190074)
+++ head/sys/netipsec/key.c	Thu Mar 19 15:50:45 2009	(r190075)
@@ -4161,7 +4161,8 @@ key_flush_sad(time_t now)
 			if (sav->lft_s->addtime != 0 &&
 			    now - sav->created > sav->lft_s->addtime) {
 				key_sa_chgstate(sav, SADB_SASTATE_DYING);
-				/* Actually, only send expire message if SA has been used, as it
+				/* 
+				 * Actually, only send expire message if SA has been used, as it
 				 * was done before, but should we always send such message, and let IKE
 				 * daemon decide if it should be renegociated or not ?
 				 * XXX expire message will actually NOT be sent if SA is only used

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 19 17:16:34 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4CC6A106566B;
	Thu, 19 Mar 2009 17:16:34 +0000 (UTC)
	(envelope-from garga@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 3B9668FC19;
	Thu, 19 Mar 2009 17:16:34 +0000 (UTC)
	(envelope-from garga@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2JHGXtH070393;
	Thu, 19 Mar 2009 17:16:33 GMT (envelope-from garga@svn.freebsd.org)
Received: (from garga@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JHGXoY070392;
	Thu, 19 Mar 2009 17:16:33 GMT (envelope-from garga@svn.freebsd.org)
Message-Id: <200903191716.n2JHGXoY070392@svn.freebsd.org>
From: Renato Botelho 
Date: Thu, 19 Mar 2009 17:16: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: r190089 - 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: Thu, 19 Mar 2009 17:16:34 -0000

Author: garga (ports committer)
Date: Thu Mar 19 17:16:33 2009
New Revision: 190089
URL: http://svn.freebsd.org/changeset/base/190089

Log:
  - Add Sun Type 7 keyboard
  - Rename Type 6 entry (following NetBSD)
  - Add Sun Type 7 Keyboard USB Hub
  
  PR:		usb/132811
  Reviewed by:	thompsa
  Approved by:	thompsa

Modified:
  head/sys/dev/usb/usbdevs

Modified: head/sys/dev/usb/usbdevs
==============================================================================
--- head/sys/dev/usb/usbdevs	Thu Mar 19 17:14:00 2009	(r190088)
+++ head/sys/dev/usb/usbdevs	Thu Mar 19 17:16:33 2009	(r190089)
@@ -2310,9 +2310,11 @@ product SUNTAC AS64LX		0x000b	SUNTAC U-C
 product SUNTAC AS144L4		0x0011	SUNTAC U-Cable type A4
 
 /* Sun Microsystems products */
-product SUN KEYBOARD		0x0005	Type 6 USB keyboard
+product SUN KEYBOARD_TYPE_6	0x0005	Type 6 USB keyboard
+product SUN KEYBOARD_TYPE_7	0x00a2	Type 7 USB keyboard
 /* XXX The above is a North American PC style keyboard possibly */
 product SUN MOUSE		0x0100	Type 6 USB mouse
+product SUN KBD_HUB		0x100e	Kbd Hub
 
 /* Super Top products */
 product	SUPERTOP IDE		0x6600	USB-IDE

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 19 18:34:58 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DFBDA106566C;
	Thu, 19 Mar 2009 18:34:58 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id CD9788FC17;
	Thu, 19 Mar 2009 18:34:58 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2JIYw43072120;
	Thu, 19 Mar 2009 18:34:58 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JIYw7M072119;
	Thu, 19 Mar 2009 18:34:58 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <200903191834.n2JIYw7M072119@svn.freebsd.org>
From: Rui Paulo 
Date: Thu, 19 Mar 2009 18:34: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: r190093 - 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: Thu, 19 Mar 2009 18:34:59 -0000

Author: rpaulo
Date: Thu Mar 19 18:34:58 2009
New Revision: 190093
URL: http://svn.freebsd.org/changeset/base/190093

Log:
  Fix typo in comment.

Modified:
  head/sys/net80211/ieee80211_node.h

Modified: head/sys/net80211/ieee80211_node.h
==============================================================================
--- head/sys/net80211/ieee80211_node.h	Thu Mar 19 18:04:37 2009	(r190092)
+++ head/sys/net80211/ieee80211_node.h	Thu Mar 19 18:34:58 2009	(r190093)
@@ -69,7 +69,7 @@ struct ieee80211vap;
 /*
  * Information element ``blob''.  We use this structure
  * to capture management frame payloads that need to be
- * retained.  Information elemnts within the payload that
+ * retained.  Information elements within the payload that
  * we need to consult have references recorded.
  */
 struct ieee80211_ies {

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 19 18:45:38 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1A403106566B;
	Thu, 19 Mar 2009 18:45:38 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 084898FC19;
	Thu, 19 Mar 2009 18:45:38 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2JIjbjX072364;
	Thu, 19 Mar 2009 18:45:37 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JIjbDl072363;
	Thu, 19 Mar 2009 18:45:37 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <200903191845.n2JIjbDl072363@svn.freebsd.org>
From: Rui Paulo 
Date: Thu, 19 Mar 2009 18:45:37 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190094 - 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: Thu, 19 Mar 2009 18:45:38 -0000

Author: rpaulo
Date: Thu Mar 19 18:45:37 2009
New Revision: 190094
URL: http://svn.freebsd.org/changeset/base/190094

Log:
  Remove leftover comment because we now use a flag to check for associd.
  
  Discussed with:	sam

Modified:
  head/sys/net80211/ieee80211_output.c

Modified: head/sys/net80211/ieee80211_output.c
==============================================================================
--- head/sys/net80211/ieee80211_output.c	Thu Mar 19 18:34:58 2009	(r190093)
+++ head/sys/net80211/ieee80211_output.c	Thu Mar 19 18:45:37 2009	(r190094)
@@ -205,7 +205,6 @@ ieee80211_start(struct ifnet *ifp)
 			m_freem(m);
 			continue;
 		}
-		/* XXX AUTH'd */
 		if (ni->ni_associd == 0 &&
 		    (ni->ni_flags & IEEE80211_NODE_ASSOCID)) {
 			IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_OUTPUT,

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 19 19:29:11 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9E13A1065673;
	Thu, 19 Mar 2009 19:29:11 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 8A6918FC12;
	Thu, 19 Mar 2009 19:29:11 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2JJTBxk073351;
	Thu, 19 Mar 2009 19:29:11 GMT (envelope-from sam@svn.freebsd.org)
Received: (from sam@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JJTAJp073345;
	Thu, 19 Mar 2009 19:29:10 GMT (envelope-from sam@svn.freebsd.org)
Message-Id: <200903191929.n2JJTAJp073345@svn.freebsd.org>
From: Sam Leffler 
Date: Thu, 19 Mar 2009 19: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: r190096 - in head/sys/dev/ath: . ath_hal ath_hal/ar5210
	ath_hal/ar5211 ath_hal/ar5212
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 19 Mar 2009 19:29:12 -0000

Author: sam
Date: Thu Mar 19 19:29:10 2009
New Revision: 190096
URL: http://svn.freebsd.org/changeset/base/190096

Log:
  purge hal abi support; now that the hal is merged w/ the driver
  we cannot be out of sync
  
  MFC after:	1 week

Modified:
  head/sys/dev/ath/ath_hal/ah.h
  head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c
  head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c
  head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c
  head/sys/dev/ath/if_ath.c
  head/sys/dev/ath/if_athvar.h

Modified: head/sys/dev/ath/ath_hal/ah.h
==============================================================================
--- head/sys/dev/ath/ath_hal/ah.h	Thu Mar 19 19:22:11 2009	(r190095)
+++ head/sys/dev/ath/ath_hal/ah.h	Thu Mar 19 19:29:10 2009	(r190096)
@@ -598,8 +598,6 @@ struct ieee80211_channel;
  */
 struct ath_hal {
 	uint32_t	ah_magic;	/* consistency check magic number */
-	uint32_t	ah_abi;		/* HAL ABI version */
-#define	HAL_ABI_VERSION	0x08112800	/* YYMMDDnn */
 	uint16_t	ah_devid;	/* PCI device ID */
 	uint16_t	ah_subvendorid;	/* PCI subvendor ID */
 	HAL_SOFTC	ah_sc;		/* back pointer to driver/os state */

Modified: head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c	Thu Mar 19 19:22:11 2009	(r190095)
+++ head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c	Thu Mar 19 19:29:10 2009	(r190096)
@@ -38,7 +38,6 @@ static void ar5210DisablePCIE(struct ath
 
 static const struct ath_hal_private ar5210hal = {{
 	.ah_magic			= AR5210_MAGIC,
-	.ah_abi				= HAL_ABI_VERSION,
 
 	.ah_getRateTable		= ar5210GetRateTable,
 	.ah_detach			= ar5210Detach,

Modified: head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c	Thu Mar 19 19:22:11 2009	(r190095)
+++ head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c	Thu Mar 19 19:29:10 2009	(r190096)
@@ -38,7 +38,6 @@ static void ar5211DisablePCIE(struct ath
 
 static const struct ath_hal_private ar5211hal = {{
 	.ah_magic			= AR5211_MAGIC,
-	.ah_abi				= HAL_ABI_VERSION,
 
 	.ah_getRateTable		= ar5211GetRateTable,
 	.ah_detach			= ar5211Detach,

Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c	Thu Mar 19 19:22:11 2009	(r190095)
+++ head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c	Thu Mar 19 19:29:10 2009	(r190096)
@@ -34,7 +34,6 @@ static void ar5212DisablePCIE(struct ath
 
 static const struct ath_hal_private ar5212hal = {{
 	.ah_magic			= AR5212_MAGIC,
-	.ah_abi				= HAL_ABI_VERSION,
 
 	.ah_getRateTable		= ar5212GetRateTable,
 	.ah_detach			= ar5212Detach,

Modified: head/sys/dev/ath/if_ath.c
==============================================================================
--- head/sys/dev/ath/if_ath.c	Thu Mar 19 19:22:11 2009	(r190095)
+++ head/sys/dev/ath/if_ath.c	Thu Mar 19 19:29:10 2009	(r190096)
@@ -89,11 +89,6 @@ __FBSDID("$FreeBSD$");
 #endif
 
 /*
- * We require a HAL w/ the changes for split tx/rx MIC.
- */
-CTASSERT(HAL_ABI_VERSION > 0x06052200);
-
-/*
  * ATH_BCBUF determines the number of vap's that can transmit
  * beacons and also (currently) the number of vap's that can
  * have unique mac addresses/bssid.  When staggering beacons
@@ -380,13 +375,6 @@ ath_attach(u_int16_t devid, struct ath_s
 		error = ENXIO;
 		goto bad;
 	}
-	if (ah->ah_abi != HAL_ABI_VERSION) {
-		if_printf(ifp, "HAL ABI mismatch detected "
-			"(HAL:0x%x != driver:0x%x)\n",
-			ah->ah_abi, HAL_ABI_VERSION);
-		error = ENXIO;
-		goto bad;
-	}
 	sc->sc_ah = ah;
 	sc->sc_invalid = 0;	/* ready to go, enable interrupt handling */
 #ifdef	ATH_DEBUG
@@ -2689,17 +2677,8 @@ ath_calcrxfilter(struct ath_softc *sc)
 	u_int32_t rfilt;
 
 	rfilt = HAL_RX_FILTER_UCAST | HAL_RX_FILTER_BCAST | HAL_RX_FILTER_MCAST;
-#if HAL_ABI_VERSION < 0x08011600
-	rfilt |= (ath_hal_getrxfilter(sc->sc_ah) &
-		(HAL_RX_FILTER_PHYRADAR | HAL_RX_FILTER_PHYERR));
-#elif HAL_ABI_VERSION < 0x08060100
-	if (ic->ic_opmode == IEEE80211_M_STA &&
-	    !sc->sc_needmib && !sc->sc_scanning)
-		rfilt |= HAL_RX_FILTER_PHYERR;
-#else
 	if (!sc->sc_needmib && !sc->sc_scanning)
 		rfilt |= HAL_RX_FILTER_PHYERR;
-#endif
 	if (ic->ic_opmode != IEEE80211_M_STA)
 		rfilt |= HAL_RX_FILTER_PROBEREQ;
 	if (ic->ic_opmode == IEEE80211_M_MONITOR || (ifp->if_flags & IFF_PROMISC))
@@ -6273,10 +6252,6 @@ ath_rate_setup(struct ath_softc *sc, u_i
 		break;
 	case IEEE80211_MODE_TURBO_A:
 		rt = ath_hal_getratetable(ah, HAL_MODE_108A);
-#if HAL_ABI_VERSION < 0x07013100
-		if (rt == NULL)		/* XXX bandaid for old hal's */
-			rt = ath_hal_getratetable(ah, HAL_MODE_TURBO);
-#endif
 		break;
 	case IEEE80211_MODE_TURBO_G:
 		rt = ath_hal_getratetable(ah, HAL_MODE_108G);

Modified: head/sys/dev/ath/if_athvar.h
==============================================================================
--- head/sys/dev/ath/if_athvar.h	Thu Mar 19 19:22:11 2009	(r190095)
+++ head/sys/dev/ath/if_athvar.h	Thu Mar 19 19:29:10 2009	(r190096)
@@ -462,16 +462,10 @@ void	ath_intr(void *);
 	((*(_ah)->ah_setChannel)((_ah), (_chan)))
 #define	ath_hal_calibrate(_ah, _chan, _iqcal) \
 	((*(_ah)->ah_perCalibration)((_ah), (_chan), (_iqcal)))
-#if HAL_ABI_VERSION >= 0x08111000
 #define	ath_hal_calibrateN(_ah, _chan, _lcal, _isdone) \
 	((*(_ah)->ah_perCalibrationN)((_ah), (_chan), 0x1, (_lcal), (_isdone)))
 #define	ath_hal_calreset(_ah, _chan) \
 	((*(_ah)->ah_resetCalValid)((_ah), (_chan)))
-#else
-#define	ath_hal_calibrateN(_ah, _chan, _lcal, _isdone) \
-	ath_hal_calibrate(_ah, _chan, _isdone)
-#define	ath_hal_calreset(_ah, _chan)	(0)
-#endif
 #define	ath_hal_setledstate(_ah, _state) \
 	((*(_ah)->ah_setLedState)((_ah), (_state)))
 #define	ath_hal_beaconinit(_ah, _nextb, _bperiod) \
@@ -545,19 +539,8 @@ void	ath_intr(void *);
 	(ath_hal_getcapability(_ah, HAL_CAP_CIPHER, _cipher, NULL) == HAL_OK)
 #define	ath_hal_getregdomain(_ah, _prd) \
 	(ath_hal_getcapability(_ah, HAL_CAP_REG_DMN, 0, (_prd)) == HAL_OK)
-#if HAL_ABI_VERSION < 0x08090100
-/* XXX wrong for anything but amd64 and i386 */
-#if defined(__LP64__)
-#define	ath_hal_setregdomain(_ah, _rd) \
-	(*(uint16_t *)(((uint8_t *)&(_ah)[1]) + 176) = (_rd))
-#else
-#define	ath_hal_setregdomain(_ah, _rd) \
-	(*(uint16_t *)(((uint8_t *)&(_ah)[1]) + 128) = (_rd))
-#endif
-#else
 #define	ath_hal_setregdomain(_ah, _rd) \
 	ath_hal_setcapability(_ah, HAL_CAP_REG_DMN, 0, _rd, NULL)
-#endif
 #define	ath_hal_getcountrycode(_ah, _pcc) \
 	(*(_pcc) = (_ah)->ah_countryCode)
 #define	ath_hal_gettkipmic(_ah) \
@@ -656,31 +639,6 @@ void	ath_intr(void *);
 	ath_hal_setcapability(_ah, HAL_CAP_INTMIT, 1, _v, NULL)
 #define	ath_hal_getchannoise(_ah, _c) \
 	((*(_ah)->ah_getChanNoise)((_ah), (_c)))
-#if HAL_ABI_VERSION < 0x05122200
-#define	HAL_TXQ_TXOKINT_ENABLE	TXQ_FLAG_TXOKINT_ENABLE
-#define	HAL_TXQ_TXERRINT_ENABLE	TXQ_FLAG_TXERRINT_ENABLE
-#define	HAL_TXQ_TXDESCINT_ENABLE TXQ_FLAG_TXDESCINT_ENABLE
-#define	HAL_TXQ_TXEOLINT_ENABLE	TXQ_FLAG_TXEOLINT_ENABLE
-#define	HAL_TXQ_TXURNINT_ENABLE	TXQ_FLAG_TXURNINT_ENABLE
-#endif
-#if HAL_ABI_VERSION < 0x06102501
-#define	ath_hal_ispublicsafetysku(ah) \
-	(((ah)->ah_regdomain == 0 && (ah)->ah_countryCode == 842) || \
-	 (ah)->ah_regdomain == 0x12)
-#endif
-#if HAL_ABI_VERSION < 0x06122400
-/* XXX yech, can't get to regdomain so just hack a compat shim */
-#define	ath_hal_isgsmsku(ah) \
-	((ah)->ah_countryCode == 843)
-#endif
-#if HAL_ABI_VERSION < 0x07050400
-/* compat shims so code compilers--it won't work though */
-#define	CHANNEL_HT20		0x10000
-#define	CHANNEL_HT40PLUS 	0x20000
-#define	CHANNEL_HT40MINUS 	0x40000
-#define	HAL_MODE_11NG_HT20	0x008000
-#define HAL_MODE_11NA_HT20  	0x010000
-#endif
 
 #define	ath_hal_setuprxdesc(_ah, _ds, _size, _intreq) \
 	((*(_ah)->ah_setupRxDesc)((_ah), (_ds), (_size), (_intreq)))

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 19 20:24:31 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5981E1065670;
	Thu, 19 Mar 2009 20:24:31 +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 45E318FC19;
	Thu, 19 Mar 2009 20:24:31 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2JKOVuW074484;
	Thu, 19 Mar 2009 20:24:31 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JKOVNd074483;
	Thu, 19 Mar 2009 20:24:31 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <200903192024.n2JKOVNd074483@svn.freebsd.org>
From: Marius Strobl 
Date: Thu, 19 Mar 2009 20:24: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: r190097 - head/usr.sbin/eeprom
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 19 Mar 2009 20:24:32 -0000

Author: marius
Date: Thu Mar 19 20:24:30 2009
New Revision: 190097
URL: http://svn.freebsd.org/changeset/base/190097

Log:
  - Sprinkle const.
  - Remove incorrect __unused.

Modified:
  head/usr.sbin/eeprom/ofw_options.c

Modified: head/usr.sbin/eeprom/ofw_options.c
==============================================================================
--- head/usr.sbin/eeprom/ofw_options.c	Thu Mar 19 19:29:10 2009	(r190096)
+++ head/usr.sbin/eeprom/ofw_options.c	Thu Mar 19 20:24:30 2009	(r190097)
@@ -52,18 +52,18 @@ __FBSDID("$FreeBSD$");
 
 struct ofwo_extabent {
 	const char	*ex_prop;
-	int		(*ex_handler)(struct ofwo_extabent *, int, const void *,
-			    int, const char *);
+	int		(*ex_handler)(const struct ofwo_extabent *, int,
+			    const void *, int, const char *);
 };
 
-static int	ofwo_oemlogo(struct ofwo_extabent *, int, const void *, int,
-		    const char *);
-static int	ofwo_secmode(struct ofwo_extabent *, int, const void *, int,
-		    const char *);
-static int	ofwo_secpwd(struct ofwo_extabent *, int, const void *, int,
-		    const char *);
+static int	ofwo_oemlogo(const struct ofwo_extabent *, int, const void *,
+		    int, const char *);
+static int	ofwo_secmode(const struct ofwo_extabent *, int, const void *,
+		    int, const char *);
+static int	ofwo_secpwd(const struct ofwo_extabent *, int, const void *,
+		    int, const char *);
 
-static struct ofwo_extabent ofwo_extab[] = {
+static const struct ofwo_extabent const ofwo_extab[] = {
 	{ "oem-logo",			ofwo_oemlogo },
 	{ "security-mode",		ofwo_secmode },
 	{ "security-password",		ofwo_secpwd },
@@ -81,8 +81,8 @@ ofwo_printprop(const char *prop, const c
 }
 
 static int
-ofwo_oemlogo(struct ofwo_extabent *exent, int fd, const void *buf, int buflen,
-    const char *val)
+ofwo_oemlogo(const struct ofwo_extabent *exent, int fd, const void *buf,
+    int buflen, const char *val)
 {
 	int lfd;
 	char logo[OFWO_LOGO + 1];
@@ -117,8 +117,8 @@ ofwo_oemlogo(struct ofwo_extabent *exent
 }
 
 static int
-ofwo_secmode(struct ofwo_extabent *exent, int fd, const void *buf, int buflen,
-    const char *val)
+ofwo_secmode(const struct ofwo_extabent *exent, int fd, const void *buf,
+    int buflen, const char *val)
 {
 	int res;
 
@@ -145,8 +145,8 @@ ofwo_secmode(struct ofwo_extabent *exent
 }
 
 static int
-ofwo_secpwd(struct ofwo_extabent *exent, int fd __unused,
-    const void *buf __unused, __unused int buflen, const char *val)
+ofwo_secpwd(const struct ofwo_extabent *exent, int fd, const void *buf,
+    int buflen, const char *val)
 {
 	void *pbuf;
 	int len, pblen, rv;
@@ -246,14 +246,14 @@ ofwo_dump(void)
 	int fd, len, nlen, pblen;
 	phandle_t optnode;
 	char prop[OFWO_MAXPROP + 1];
-	struct ofwo_extabent *ex;
+	const struct ofwo_extabent *ex;
 
 	pblen = 0;
 	pbuf = NULL;
 	fd = ofw_open(O_RDONLY);
 	optnode = ofw_optnode(fd);
 	for (nlen = ofw_firstprop(fd, optnode, prop, sizeof(prop)); nlen != 0;
-	     nlen = ofw_nextprop(fd, optnode, prop, prop, sizeof(prop))) {
+	    nlen = ofw_nextprop(fd, optnode, prop, prop, sizeof(prop))) {
 		len = ofw_getprop_alloc(fd, optnode, prop, &pbuf, &pblen, 1);
 		if (len < 0)
 			continue;
@@ -277,7 +277,7 @@ ofwo_action(const char *prop, const char
 {
 	void *pbuf;
 	int fd, len, pblen, rv;
-	struct ofwo_extabent *ex;
+	const struct ofwo_extabent *ex;
 
 	pblen = 0;
 	rv = EX_OK;
@@ -300,7 +300,7 @@ ofwo_action(const char *prop, const char
 		rv = (*ex->ex_handler)(ex, fd, pbuf, len, val);
 	else if (val)
 		rv = ofwo_setstr(fd, pbuf, len, prop, val);
-	else 
+	else
 		ofwo_printprop(prop, (char *)pbuf, len);
 out:
 	if (pbuf != NULL)

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 19 20:29:23 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8E025106566B;
	Thu, 19 Mar 2009 20:29:23 +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 79F188FC25;
	Thu, 19 Mar 2009 20:29:23 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2JKTNRO074601;
	Thu, 19 Mar 2009 20:29:23 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JKTN54074599;
	Thu, 19 Mar 2009 20:29:23 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <200903192029.n2JKTN54074599@svn.freebsd.org>
From: Marius Strobl 
Date: Thu, 19 Mar 2009 20:29: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: r190098 - in head/sys/sparc64: fhc sparc64
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 19 Mar 2009 20:29:24 -0000

Author: marius
Date: Thu Mar 19 20:29:23 2009
New Revision: 190098
URL: http://svn.freebsd.org/changeset/base/190098

Log:
  - Failing to register as interrupt controller during attach shouldn't
    be fatal so just inform about this instead of panicing.
  - Sort device methods.
  - Take advantage of KOBJMETHOD_END.
  - Remove some redundant variables.

Modified:
  head/sys/sparc64/fhc/fhc.c
  head/sys/sparc64/sparc64/upa.c

Modified: head/sys/sparc64/fhc/fhc.c
==============================================================================
--- head/sys/sparc64/fhc/fhc.c	Thu Mar 19 20:24:30 2009	(r190097)
+++ head/sys/sparc64/fhc/fhc.c	Thu Mar 19 20:29:23 2009	(r190098)
@@ -90,14 +90,14 @@ static device_method_t fhc_methods[] = {
 	/* Bus interface */
 	DEVMETHOD(bus_print_child,	fhc_print_child),
 	DEVMETHOD(bus_probe_nomatch,	fhc_probe_nomatch),
-	DEVMETHOD(bus_setup_intr,	fhc_setup_intr),
-	DEVMETHOD(bus_teardown_intr,	bus_generic_teardown_intr),
 	DEVMETHOD(bus_alloc_resource,	fhc_alloc_resource),
-	DEVMETHOD(bus_release_resource,	bus_generic_rl_release_resource),
 	DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
 	DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
-	DEVMETHOD(bus_get_resource_list, fhc_get_resource_list),
+	DEVMETHOD(bus_release_resource,	bus_generic_rl_release_resource),
+	DEVMETHOD(bus_setup_intr,	fhc_setup_intr),
+	DEVMETHOD(bus_teardown_intr,	bus_generic_teardown_intr),
 	DEVMETHOD(bus_get_resource,	bus_generic_rl_get_resource),
+	DEVMETHOD(bus_get_resource_list, fhc_get_resource_list),
 
 	/* ofw_bus interface */
 	DEVMETHOD(ofw_bus_get_devinfo,	fhc_get_devinfo),
@@ -107,7 +107,7 @@ static device_method_t fhc_methods[] = {
 	DEVMETHOD(ofw_bus_get_node,	ofw_bus_gen_get_node),
 	DEVMETHOD(ofw_bus_get_type,	ofw_bus_gen_get_type),
 
-	{ NULL, NULL }
+	KOBJMETHOD_END
 };
 
 static driver_t fhc_driver = {
@@ -165,9 +165,7 @@ fhc_attach(device_t dev)
 	int central;
 	int error;
 	int i;
-	int nintr;
-	int nreg;
-	int rid;
+	int j;
 
 	sc = device_get_softc(dev);
 	node = ofw_bus_get_node(dev);
@@ -177,9 +175,9 @@ fhc_attach(device_t dev)
 		central = 1;
 
 	for (i = 0; i < FHC_NREG; i++) {
-		rid = i;
+		j = i;
 		sc->sc_memres[i] = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
-		    &rid, RF_ACTIVE);
+		    &j, RF_ACTIVE);
 		if (sc->sc_memres[i] == NULL) {
 			device_printf(dev, "cannot allocate resource %d\n", i);
 			error = ENXIO;
@@ -239,7 +237,8 @@ fhc_attach(device_t dev)
 		/*
 		 * Hunt through all the interrupt mapping regs and register
 		 * our interrupt controller for the corresponding interrupt
-		 * vectors.
+		 * vectors.  We do this early in order to be able to catch
+		 * stray interrupts.
 		 */
 		for (i = FHC_FANFAIL; i <= FHC_TOD; i++) {
 			fica = malloc(sizeof(*fica), M_DEVBUF, M_NOWAIT);
@@ -259,11 +258,13 @@ fhc_attach(device_t dev)
 			 * the IGN and the IGN is constant for all devices
 			 * on that FireHose controller.
 			 */
-			if (intr_controller_register(INTMAP_VEC(sc->sc_ign,
+			j = intr_controller_register(INTMAP_VEC(sc->sc_ign,
 			    INTINO(bus_read_4(fica->fica_memres, FHC_IMAP))),
-			    &fhc_ic, fica) != 0)
-				panic("%s: could not register interrupt "
-				    "controller for map %d", __func__, i);
+			    &fhc_ic, fica);
+			if (j != 0)
+				device_printf(dev, "could not register "
+				    "interrupt controller for map %d (%d)\n",
+				    i, j);
 		}
 	} else {
 		snprintf(ledname, sizeof(ledname), "board%d", board);
@@ -276,9 +277,9 @@ fhc_attach(device_t dev)
 			free(fdi, M_DEVBUF);
 			continue;
 		}
-		nreg = OF_getprop_alloc(child, "reg", sizeof(*reg),
+		i = OF_getprop_alloc(child, "reg", sizeof(*reg),
 		    (void **)®);
-		if (nreg == -1) {
+		if (i == -1) {
 			device_printf(dev, "<%s>: incomplete\n",
 			    fdi->fdi_obdinfo.obd_name);
 			ofw_bus_gen_destroy_devinfo(&fdi->fdi_obdinfo);
@@ -286,19 +287,19 @@ fhc_attach(device_t dev)
 			continue;
 		}
 		resource_list_init(&fdi->fdi_rl);
-		for (i = 0; i < nreg; i++)
-			resource_list_add(&fdi->fdi_rl, SYS_RES_MEMORY, i,
-			    reg[i].sbr_offset, reg[i].sbr_offset +
-			    reg[i].sbr_size, reg[i].sbr_size);
+		for (j = 0; j < i; j++)
+			resource_list_add(&fdi->fdi_rl, SYS_RES_MEMORY, j,
+			    reg[j].sbr_offset, reg[j].sbr_offset +
+			    reg[j].sbr_size, reg[j].sbr_size);
 		free(reg, M_OFWPROP);
 		if (central == 1) {
-			nintr = OF_getprop_alloc(child, "interrupts",
+			i = OF_getprop_alloc(child, "interrupts",
 			    sizeof(*intr), (void **)&intr);
-			if (nintr != -1) {
-				for (i = 0; i < nintr; i++) {
-					iv = INTMAP_VEC(sc->sc_ign, intr[i]);
+			if (i != -1) {
+				for (j = 0; j < i; j++) {
+					iv = INTMAP_VEC(sc->sc_ign, intr[j]);
 					resource_list_add(&fdi->fdi_rl,
-					    SYS_RES_IRQ, i, iv, iv, 1);
+					    SYS_RES_IRQ, j, iv, iv, 1);
 				}
 				free(intr, M_OFWPROP);
 			}

Modified: head/sys/sparc64/sparc64/upa.c
==============================================================================
--- head/sys/sparc64/sparc64/upa.c	Thu Mar 19 20:24:30 2009	(r190097)
+++ head/sys/sparc64/sparc64/upa.c	Thu Mar 19 20:29:23 2009	(r190098)
@@ -144,7 +144,7 @@ static device_method_t upa_methods[] = {
 	DEVMETHOD(ofw_bus_get_node,	ofw_bus_gen_get_node),
 	DEVMETHOD(ofw_bus_get_type,	ofw_bus_gen_get_type),
 
-	{ NULL, NULL }
+	KOBJMETHOD_END
 };
 
 static devclass_t upa_devclass;
@@ -241,7 +241,7 @@ upa_attach(device_t dev)
 				    "pci108e,8001") == 0 &&
 				    ((bus_get_resource_start(children[j],
 				    SYS_RES_MEMORY, 0) >> 20) & 1) == 1) {
-				    	schizo = children[j];
+					schizo = children[j];
 					break;
 				}
 			}
@@ -287,9 +287,10 @@ upa_attach(device_t dev)
 		goto fail;
 	}
 
- 	/*
+	/*
 	 * Hunt through all the interrupt mapping regs and register our
 	 * interrupt controller for the corresponding interrupt vectors.
+	 * We do this early in order to be able to catch stray interrupts.
 	 */
 	for (i = UPA_INO_BASE; i <= UPA_INO_MAX; i++) {
 		imr = 0;
@@ -312,10 +313,11 @@ upa_attach(device_t dev)
 		device_printf(dev, "intr map (INO %d) IMR%d: %#lx\n",
 		    i, imr, (u_long)UPA_READ(sc, imr, 0x0));
 #endif
-		if (intr_controller_register(INTMAP_VEC(sc->sc_ign, i),
-		    &upa_ic, uica) != 0)
-			panic("%s: could not register interrupt controller "
-			    "for INO %d", __func__, i);
+		j = intr_controller_register(INTMAP_VEC(sc->sc_ign, i),
+		    &upa_ic, uica);
+		if (j != 0)
+			device_printf(dev, "could not register interrupt "
+			    "controller for INO %d (%d)\n", i, j);
 	}
 
 	/* Make sure the power level is appropriate for normal operation. */
@@ -345,13 +347,13 @@ upa_attach(device_t dev)
 			device_printf(dev,
 			    "could not determine upa-portid of child 0x%lx\n",
 			    (unsigned long)child);
-		    	continue;
+			continue;
 		}
 		if (portid > 1) {
 			device_printf(dev,
 			    "upa-portid %d of child 0x%lx invalid\n", portid,
 			    (unsigned long)child);
-		    	continue;
+			continue;
 		}
 		if ((udi = upa_setup_dinfo(dev, sc, child, portid)) == NULL)
 			continue;
@@ -493,12 +495,12 @@ upa_setup_intr(device_t dev, device_t ch
 	/*
 	 * Make sure the vector is fully specified and we registered
 	 * our interrupt controller for it.
- 	 */
+	 */
 	vec = rman_get_start(ires);
 	if (INTIGN(vec) != sc->sc_ign || intr_vectors[vec].iv_ic != &upa_ic) {
 		device_printf(dev, "invalid interrupt vector 0x%lx\n", vec);
- 		return (EINVAL);
- 	}
+		return (EINVAL);
+	}
 	return (bus_generic_setup_intr(dev, child, ires, flags, filt, func,
 	    arg, cookiep));
 }

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 19 20:31:55 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C491F1065673;
	Thu, 19 Mar 2009 20:31:55 +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 AEE6D8FC16;
	Thu, 19 Mar 2009 20:31:55 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2JKVthp074703;
	Thu, 19 Mar 2009 20:31:55 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JKVttd074697;
	Thu, 19 Mar 2009 20:31:55 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <200903192031.n2JKVttd074697@svn.freebsd.org>
From: Marius Strobl 
Date: Thu, 19 Mar 2009 20:31: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: r190099 - in head/sys/sparc64: central ebus pci sbus
	sparc64
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 19 Mar 2009 20:31:57 -0000

Author: marius
Date: Thu Mar 19 20:31:55 2009
New Revision: 190099
URL: http://svn.freebsd.org/changeset/base/190099

Log:
  - Sort device methods.
  - Take advantage of KOBJMETHOD_END.

Modified:
  head/sys/sparc64/central/central.c
  head/sys/sparc64/ebus/ebus.c
  head/sys/sparc64/pci/apb.c
  head/sys/sparc64/pci/ofw_pcib.c
  head/sys/sparc64/sbus/dma_sbus.c
  head/sys/sparc64/sparc64/nexus.c

Modified: head/sys/sparc64/central/central.c
==============================================================================
--- head/sys/sparc64/central/central.c	Thu Mar 19 20:29:23 2009	(r190098)
+++ head/sys/sparc64/central/central.c	Thu Mar 19 20:31:55 2009	(r190099)
@@ -76,14 +76,14 @@ static device_method_t central_methods[]
 	/* Bus interface */
 	DEVMETHOD(bus_print_child,	central_print_child),
 	DEVMETHOD(bus_probe_nomatch,	central_probe_nomatch),
-	DEVMETHOD(bus_setup_intr,	bus_generic_setup_intr),
-	DEVMETHOD(bus_teardown_intr,	bus_generic_teardown_intr),
 	DEVMETHOD(bus_alloc_resource,	central_alloc_resource),
-	DEVMETHOD(bus_release_resource,	bus_generic_rl_release_resource),
 	DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
 	DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
-	DEVMETHOD(bus_get_resource_list, central_get_resource_list),
+	DEVMETHOD(bus_release_resource,	bus_generic_rl_release_resource),
+	DEVMETHOD(bus_setup_intr,	bus_generic_setup_intr),
+	DEVMETHOD(bus_teardown_intr,	bus_generic_teardown_intr),
 	DEVMETHOD(bus_get_resource,	bus_generic_rl_get_resource),
+	DEVMETHOD(bus_get_resource_list, central_get_resource_list),
 
 	/* ofw_bus interface */
 	DEVMETHOD(ofw_bus_get_devinfo,	central_get_devinfo),
@@ -93,7 +93,7 @@ static device_method_t central_methods[]
 	DEVMETHOD(ofw_bus_get_node,	ofw_bus_gen_get_node),
 	DEVMETHOD(ofw_bus_get_type,	ofw_bus_gen_get_type),
 
-	{ NULL, NULL }
+	KOBJMETHOD_END
 };
 
 static driver_t central_driver = {

Modified: head/sys/sparc64/ebus/ebus.c
==============================================================================
--- head/sys/sparc64/ebus/ebus.c	Thu Mar 19 20:29:23 2009	(r190098)
+++ head/sys/sparc64/ebus/ebus.c	Thu Mar 19 20:31:55 2009	(r190099)
@@ -109,14 +109,14 @@ static device_method_t ebus_methods[] = 
 	/* Bus interface */
 	DEVMETHOD(bus_print_child,	ebus_print_child),
 	DEVMETHOD(bus_probe_nomatch,	ebus_probe_nomatch),
-	DEVMETHOD(bus_setup_intr,	bus_generic_setup_intr),
-	DEVMETHOD(bus_teardown_intr,	bus_generic_teardown_intr),
 	DEVMETHOD(bus_alloc_resource,	ebus_alloc_resource),
-	DEVMETHOD(bus_get_resource_list, ebus_get_resource_list),
 	DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
 	DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
 	DEVMETHOD(bus_release_resource,	ebus_release_resource),
+	DEVMETHOD(bus_setup_intr,	bus_generic_setup_intr),
+	DEVMETHOD(bus_teardown_intr,	bus_generic_teardown_intr),
 	DEVMETHOD(bus_get_resource,	bus_generic_rl_get_resource),
+	DEVMETHOD(bus_get_resource_list, ebus_get_resource_list),
 	DEVMETHOD(bus_child_pnpinfo_str, ofw_bus_gen_child_pnpinfo_str),
 
 	/* ofw_bus interface */
@@ -127,7 +127,7 @@ static device_method_t ebus_methods[] = 
 	DEVMETHOD(ofw_bus_get_node,	ofw_bus_gen_get_node),
 	DEVMETHOD(ofw_bus_get_type,	ofw_bus_gen_get_type),
 
-	{ 0, 0 }
+	KOBJMETHOD_END
 };
 
 static driver_t ebus_driver = {

Modified: head/sys/sparc64/pci/apb.c
==============================================================================
--- head/sys/sparc64/pci/apb.c	Thu Mar 19 20:29:23 2009	(r190098)
+++ head/sys/sparc64/pci/apb.c	Thu Mar 19 20:31:55 2009	(r190099)
@@ -90,9 +90,9 @@ static device_method_t apb_methods[] = {
 	DEVMETHOD(bus_read_ivar,	pcib_read_ivar),
 	DEVMETHOD(bus_write_ivar,	pcib_write_ivar),
 	DEVMETHOD(bus_alloc_resource,	apb_alloc_resource),
-	DEVMETHOD(bus_release_resource,	bus_generic_release_resource),
 	DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
 	DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
+	DEVMETHOD(bus_release_resource,	bus_generic_release_resource),
 	DEVMETHOD(bus_setup_intr,	bus_generic_setup_intr),
 	DEVMETHOD(bus_teardown_intr,	bus_generic_teardown_intr),
 
@@ -105,7 +105,7 @@ static device_method_t apb_methods[] = {
 	/* ofw_bus interface */
 	DEVMETHOD(ofw_bus_get_node,	ofw_pcib_gen_get_node),
 
-	{ 0, 0 }
+	KOBJMETHOD_END
 };
 
 static devclass_t pcib_devclass;

Modified: head/sys/sparc64/pci/ofw_pcib.c
==============================================================================
--- head/sys/sparc64/pci/ofw_pcib.c	Thu Mar 19 20:29:23 2009	(r190098)
+++ head/sys/sparc64/pci/ofw_pcib.c	Thu Mar 19 20:31:55 2009	(r190099)
@@ -71,9 +71,9 @@ static device_method_t ofw_pcib_methods[
 	DEVMETHOD(bus_read_ivar,	pcib_read_ivar),
 	DEVMETHOD(bus_write_ivar,	pcib_write_ivar),
 	DEVMETHOD(bus_alloc_resource,	pcib_alloc_resource),
-	DEVMETHOD(bus_release_resource,	bus_generic_release_resource),
 	DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
 	DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
+	DEVMETHOD(bus_release_resource,	bus_generic_release_resource),
 	DEVMETHOD(bus_setup_intr,	bus_generic_setup_intr),
 	DEVMETHOD(bus_teardown_intr,	bus_generic_teardown_intr),
 
@@ -86,7 +86,7 @@ static device_method_t ofw_pcib_methods[
 	/* ofw_bus interface */
 	DEVMETHOD(ofw_bus_get_node,	ofw_pcib_gen_get_node),
 
-	{ 0, 0 }
+	KOBJMETHOD_END
 };
 
 static devclass_t pcib_devclass;

Modified: head/sys/sparc64/sbus/dma_sbus.c
==============================================================================
--- head/sys/sparc64/sbus/dma_sbus.c	Thu Mar 19 20:29:23 2009	(r190098)
+++ head/sys/sparc64/sbus/dma_sbus.c	Thu Mar 19 20:31:55 2009	(r190099)
@@ -122,14 +122,14 @@ static device_method_t dma_methods[] = {
 	/* Bus interface */
 	DEVMETHOD(bus_print_child,	dma_print_child),
 	DEVMETHOD(bus_probe_nomatch,	dma_probe_nomatch),
-	DEVMETHOD(bus_setup_intr,	bus_generic_setup_intr),
-	DEVMETHOD(bus_teardown_intr,	bus_generic_teardown_intr),
 	DEVMETHOD(bus_alloc_resource,	bus_generic_rl_alloc_resource),
-	DEVMETHOD(bus_release_resource, bus_generic_rl_release_resource),
 	DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
 	DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
-	DEVMETHOD(bus_get_resource_list, dma_get_resource_list),
+	DEVMETHOD(bus_release_resource, bus_generic_rl_release_resource),
+	DEVMETHOD(bus_setup_intr,	bus_generic_setup_intr),
+	DEVMETHOD(bus_teardown_intr,	bus_generic_teardown_intr),
 	DEVMETHOD(bus_get_resource,	bus_generic_rl_get_resource),
+	DEVMETHOD(bus_get_resource_list, dma_get_resource_list),
 
 	/* ofw_bus interface */
 	DEVMETHOD(ofw_bus_get_devinfo,	dma_get_devinfo),
@@ -139,7 +139,7 @@ static device_method_t dma_methods[] = {
 	DEVMETHOD(ofw_bus_get_node,	ofw_bus_gen_get_node),
 	DEVMETHOD(ofw_bus_get_type,	ofw_bus_gen_get_type),
 
-	{ 0, 0 }
+	KOBJMETHOD_END
 };
 
 static driver_t dma_driver = {

Modified: head/sys/sparc64/sparc64/nexus.c
==============================================================================
--- head/sys/sparc64/sparc64/nexus.c	Thu Mar 19 20:29:23 2009	(r190098)
+++ head/sys/sparc64/sparc64/nexus.c	Thu Mar 19 20:31:55 2009	(r190099)
@@ -122,12 +122,12 @@ static device_method_t nexus_methods[] =
 	DEVMETHOD(bus_release_resource,	nexus_release_resource),
 	DEVMETHOD(bus_setup_intr,	nexus_setup_intr),
 	DEVMETHOD(bus_teardown_intr,	nexus_teardown_intr),
-#ifdef SMP
-	DEVMETHOD(bus_bind_intr,	nexus_bind_intr),
-#endif
 	DEVMETHOD(bus_set_resource,	bus_generic_rl_set_resource),
 	DEVMETHOD(bus_get_resource,	bus_generic_rl_get_resource),
 	DEVMETHOD(bus_get_resource_list, nexus_get_resource_list),
+#ifdef SMP
+	DEVMETHOD(bus_bind_intr,	nexus_bind_intr),
+#endif
 	DEVMETHOD(bus_get_dma_tag,	nexus_get_dma_tag),
 
 	/* ofw_bus interface */
@@ -138,7 +138,7 @@ static device_method_t nexus_methods[] =
 	DEVMETHOD(ofw_bus_get_node,	ofw_bus_gen_get_node),
 	DEVMETHOD(ofw_bus_get_type,	ofw_bus_gen_get_type),
 
-	{ 0, 0 }
+	KOBJMETHOD_END
 };
 
 static devclass_t nexus_devclass;

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 19 20:33:27 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4999D106566B;
	Thu, 19 Mar 2009 20:33:27 +0000 (UTC)
	(envelope-from thompsa@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 341258FC0A;
	Thu, 19 Mar 2009 20:33:27 +0000 (UTC)
	(envelope-from thompsa@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2JKXRQ6074823;
	Thu, 19 Mar 2009 20:33:27 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JKXQeF074801;
	Thu, 19 Mar 2009 20:33:26 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <200903192033.n2JKXQeF074801@svn.freebsd.org>
From: Andrew Thompson 
Date: Thu, 19 Mar 2009 20:33: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: r190100 - in head: . share/man/man4 share/man/man5
	sys/amd64/conf sys/arm/conf sys/boot/forth sys/conf
	sys/dev/usb/image sys/i386/conf sys/modules/usb
	sys/modules/usb/uscanner sys/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: Thu, 19 Mar 2009 20:33:27 -0000

Author: thompsa
Date: Thu Mar 19 20:33:26 2009
New Revision: 190100
URL: http://svn.freebsd.org/changeset/base/190100

Log:
  Remove the uscanner(4) driver, this follows the removal of the kernel scanner
  driver in Linux 2.6. uscanner was just a simple wrapper around a fifo and
  contained no logic, the default interface is now libusb (supported by sane).
  
  Reviewed by:	HPS

Deleted:
  head/share/man/man4/uscanner.4
  head/sys/dev/usb/image/uscanner.c
  head/sys/modules/usb/uscanner/Makefile
Modified:
  head/ObsoleteFiles.inc
  head/UPDATING
  head/share/man/man4/Makefile
  head/share/man/man4/usb.4
  head/share/man/man5/devfs.rules.5
  head/sys/amd64/conf/GENERIC
  head/sys/arm/conf/HL200
  head/sys/arm/conf/KB920X
  head/sys/boot/forth/loader.conf
  head/sys/conf/NOTES
  head/sys/conf/files
  head/sys/i386/conf/GENERIC
  head/sys/i386/conf/XBOX
  head/sys/modules/usb/Makefile
  head/sys/pc98/conf/GENERIC
  head/sys/powerpc/conf/GENERIC
  head/sys/sparc64/conf/GENERIC
  head/sys/sun4v/conf/GENERIC
  head/tools/tools/nanobsd/rescue/AMD64
  head/tools/tools/nanobsd/rescue/I386

Modified: head/ObsoleteFiles.inc
==============================================================================
--- head/ObsoleteFiles.inc	Thu Mar 19 20:31:55 2009	(r190099)
+++ head/ObsoleteFiles.inc	Thu Mar 19 20:33:26 2009	(r190100)
@@ -14,6 +14,8 @@
 # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last.
 #
 
+# 20090319: uscanner(4) has been removed
+OLD_FILES+=usr/share/man/man4/uscanner.4.gz
 # 20090313: k8temp(4) renamed to amdtemp(4)
 OLD_FILES+=usr/share/man/man4/k8temp.4.gz
 # 20090308: libusb.so.1 renamed

Modified: head/UPDATING
==============================================================================
--- head/UPDATING	Thu Mar 19 20:31:55 2009	(r190099)
+++ head/UPDATING	Thu Mar 19 20:33:26 2009	(r190100)
@@ -23,6 +23,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8.
 	ln -s aj /etc/malloc.conf.)
 
 20090319:
+	The uscanner(4) driver has been removed from the kernel. This follows
+	Linux removing theirs in 2.6 and making libusb the default interface
+	(supported by sane).
+
+20090319:
 	The multicast forwarding code has been cleaned up. netstat(1)
 	only relies on KVM now for printing bandwidth upcall meters.
 	The IPv4 and IPv6 modules are split into ip_mroute_mod and

Modified: head/share/man/man4/Makefile
==============================================================================
--- head/share/man/man4/Makefile	Thu Mar 19 20:31:55 2009	(r190099)
+++ head/share/man/man4/Makefile	Thu Mar 19 20:33:26 2009	(r190100)
@@ -421,7 +421,6 @@ MAN=	aac.4 \
 	urio.4 \
 	${_urtw.4} \
 	usb.4 \
-	uscanner.4 \
 	uslcom.4 \
 	utopia.4 \
 	uvisor.4 \

Modified: head/share/man/man4/usb.4
==============================================================================
--- head/share/man/man4/usb.4	Thu Mar 19 20:31:55 2009	(r190099)
+++ head/share/man/man4/usb.4	Thu Mar 19 20:33:26 2009	(r190100)
@@ -422,7 +422,6 @@ specifications can be found at:
 .Xr ums 4 ,
 .Xr uplcom 4 ,
 .Xr urio 4 ,
-.Xr uscanner 4 ,
 .Xr uvscom 4 ,
 .Xr usbdevs 8
 .Sh HISTORY

Modified: head/share/man/man5/devfs.rules.5
==============================================================================
--- head/share/man/man5/devfs.rules.5	Thu Mar 19 20:31:55 2009	(r190099)
+++ head/share/man/man5/devfs.rules.5	Thu Mar 19 20:33:26 2009	(r190100)
@@ -101,12 +101,12 @@ The first line declares and starts a new
 and the number 10.
 .Pp
 To make all the
-.Xr uscanner 4
+.Xr ulpt 4
 devices accessible to their owner and the
 .Dq Li usb
 group, a similar rule may be used:
 .Pp
-.Dl "add path 'uscanner*' mode 0660 group usb"
+.Dl "add path 'ulpt*' mode 0660 group usb"
 .Sh SEE ALSO
 .Xr glob 3 ,
 .Xr devfs 5 ,

Modified: head/sys/amd64/conf/GENERIC
==============================================================================
--- head/sys/amd64/conf/GENERIC	Thu Mar 19 20:31:55 2009	(r190099)
+++ head/sys/amd64/conf/GENERIC	Thu Mar 19 20:33:26 2009	(r190100)
@@ -295,7 +295,6 @@ device		ums		# Mouse
 device		ural		# Ralink Technology RT2500USB wireless NICs
 device		rum		# Ralink Technology RT2501USB wireless NICs
 device		urio		# Diamond Rio 500 MP3 player
-device		uscanner	# Scanners
 # USB Serial devices
 device		uark		# Technologies ARK3116 based serial adapters
 device		ubsa		# Belkin F5U103 and compatible serial adapters

Modified: head/sys/arm/conf/HL200
==============================================================================
--- head/sys/arm/conf/HL200	Thu Mar 19 20:31:55 2009	(r190099)
+++ head/sys/arm/conf/HL200	Thu Mar 19 20:33:26 2009	(r190100)
@@ -103,7 +103,6 @@ device          umass           # Disks/
 device          ural            # Ralink Technology RT2500USB wireless NICs
 device          rum             # Ralink Technology RT2501USB wireless NICs
 device          urio            # Diamond Rio 500 MP3 player
-device          uscanner        # Scanners
 # USB Ethernet, requires miibus
 device		miibus
 device          aue             # ADMtek USB Ethernet

Modified: head/sys/arm/conf/KB920X
==============================================================================
--- head/sys/arm/conf/KB920X	Thu Mar 19 20:31:55 2009	(r190099)
+++ head/sys/arm/conf/KB920X	Thu Mar 19 20:33:26 2009	(r190100)
@@ -104,7 +104,6 @@ device          umass           # Disks/
 device          ural            # Ralink Technology RT2500USB wireless NICs
 device          rum             # Ralink Technology RT2501USB wireless NICs
 device          urio            # Diamond Rio 500 MP3 player
-device          uscanner        # Scanners
 # USB Ethernet, requires miibus
 device		miibus
 device          aue             # ADMtek USB Ethernet

Modified: head/sys/boot/forth/loader.conf
==============================================================================
--- head/sys/boot/forth/loader.conf	Thu Mar 19 20:31:55 2009	(r190099)
+++ head/sys/boot/forth/loader.conf	Thu Mar 19 20:33:26 2009	(r190100)
@@ -379,7 +379,6 @@ ulpt_load="NO"			# Printer
 ums_load="NO"			# Mouse
 umass_load="NO"			# Mass Storage Devices
 umodem_load="NO"		# Modems
-uscanner_load="NO"		# Scanners
 if_aue_load="NO"		# ADMtek USB ethernet
 if_axe_load="NO"		# ASIX Electronics AX88172 USB ethernet
 if_cue_load="NO"		# CATC USB ethernet

Modified: head/sys/conf/NOTES
==============================================================================
--- head/sys/conf/NOTES	Thu Mar 19 20:31:55 2009	(r190099)
+++ head/sys/conf/NOTES	Thu Mar 19 20:33:26 2009	(r190100)
@@ -2413,8 +2413,6 @@ device		umodem
 device		ums
 # Diamond Rio 500 MP3 player
 device		urio
-# USB scanners
-device		uscanner
 #
 # USB serial support
 device		ucom

Modified: head/sys/conf/files
==============================================================================
--- head/sys/conf/files	Thu Mar 19 20:31:55 2009	(r190099)
+++ head/sys/conf/files	Thu Mar 19 20:33:26 2009	(r190100)
@@ -1656,10 +1656,6 @@ dev/usb/template/usb_template_cdce.c	opt
 dev/usb/template/usb_template_msc.c	optional usb_template
 dev/usb/template/usb_template_mtp.c	optional usb_template
 #
-# USB image drivers
-#
-dev/usb/image/uscanner.c	optional uscanner
-#
 # USB END
 #
 dev/utopia/idtphy.c		optional utopia

Modified: head/sys/i386/conf/GENERIC
==============================================================================
--- head/sys/i386/conf/GENERIC	Thu Mar 19 20:31:55 2009	(r190099)
+++ head/sys/i386/conf/GENERIC	Thu Mar 19 20:33:26 2009	(r190100)
@@ -309,7 +309,6 @@ device		ural		# Ralink Technology RT2500
 device		rum		# Ralink Technology RT2501USB wireless NICs
 device		zyd		# ZyDAS zb1211/zb1211b wireless NICs
 device		urio		# Diamond Rio 500 MP3 player
-device		uscanner	# Scanners
 # USB Serial devices
 device		u3g		# USB-based 3G modems (Option, Huawei, Sierra)
 device		uark		# Technologies ARK3116 based serial adapters

Modified: head/sys/i386/conf/XBOX
==============================================================================
--- head/sys/i386/conf/XBOX	Thu Mar 19 20:31:55 2009	(r190099)
+++ head/sys/i386/conf/XBOX	Thu Mar 19 20:33:26 2009	(r190100)
@@ -91,7 +91,6 @@ device		ulpt		# Printer
 device		umass		# Disks/Mass storage - Requires scbus and da
 device		ums		# Mouse
 device		urio		# Diamond Rio 500 MP3 player
-device		uscanner	# Scanners
 
 device		miibus
 device		aue		# ADMtek USB Ethernet

Modified: head/sys/modules/usb/Makefile
==============================================================================
--- head/sys/modules/usb/Makefile	Thu Mar 19 20:31:55 2009	(r190099)
+++ head/sys/modules/usb/Makefile	Thu Mar 19 20:33:26 2009	(r190100)
@@ -29,7 +29,7 @@ SUBDIR = usb
 #SUBDIR += ubt bluetooth_ng ubtfw
 SUBDIR += ehci musb ohci uhci uss820dci ${_at91dci} ${_atmegadci}
 SUBDIR += rum ural zyd
-SUBDIR += uhid ukbd ums udbp ufm uscanner
+SUBDIR += uhid ukbd ums udbp ufm
 SUBDIR += ucom u3g uark ubsa ubser uchcom ucycom ufoma uftdi ugensa uipaq ulpt \
 	  umct umodem umoscom uplcom uslcom uvisor uvscom
 SUBDIR += uether aue axe cdce cue kue rue udav

Modified: head/sys/pc98/conf/GENERIC
==============================================================================
--- head/sys/pc98/conf/GENERIC	Thu Mar 19 20:31:55 2009	(r190099)
+++ head/sys/pc98/conf/GENERIC	Thu Mar 19 20:33:26 2009	(r190100)
@@ -265,7 +265,6 @@ device		bpf		# Berkeley packet filter
 #device		rum		# Ralink Technology RT2501USB wireless NICs
 #device		zyd		# ZyDAS zb1211/zb1211b wireless NICs
 #device		urio		# Diamond Rio 500 MP3 player
-#device		uscanner	# Scanners
 # USB Serial devices
 #device		uark		# Technologies ARK3116 based serial adapters
 #device		ubsa		# Belkin F5U103 and compatible serial adapters

Modified: head/sys/powerpc/conf/GENERIC
==============================================================================
--- head/sys/powerpc/conf/GENERIC	Thu Mar 19 20:31:55 2009	(r190099)
+++ head/sys/powerpc/conf/GENERIC	Thu Mar 19 20:33:26 2009	(r190100)
@@ -140,7 +140,6 @@ device		ulpt		# Printer
 device		umass		# Disks/Mass storage - Requires scbus and da0
 device		ums		# Mouse
 device		urio		# Diamond Rio 500 MP3 player
-device		uscanner	# Scanners
 # USB Ethernet
 device		aue		# ADMtek USB Ethernet
 device		axe		# ASIX Electronics USB Ethernet

Modified: head/sys/sparc64/conf/GENERIC
==============================================================================
--- head/sys/sparc64/conf/GENERIC	Thu Mar 19 20:31:55 2009	(r190099)
+++ head/sys/sparc64/conf/GENERIC	Thu Mar 19 20:33:26 2009	(r190100)
@@ -230,7 +230,6 @@ device		ukbd		# Keyboard
 #device		umass		# Disks/Mass storage - Requires scbus and da
 device		ums		# Mouse
 #device		urio		# Diamond Rio 500 MP3 player
-#device		uscanner	# Scanners
 # USB Ethernet, requires mii
 #device		aue		# ADMtek USB Ethernet
 #device		axe		# ASIX Electronics USB Ethernet

Modified: head/sys/sun4v/conf/GENERIC
==============================================================================
--- head/sys/sun4v/conf/GENERIC	Thu Mar 19 20:31:55 2009	(r190099)
+++ head/sys/sun4v/conf/GENERIC	Thu Mar 19 20:33:26 2009	(r190100)
@@ -191,7 +191,6 @@ device		ulpt		# Printer
 #device		umass		# Disks/Mass storage - Requires scbus and da
 device		ums		# Mouse
 #device		urio		# Diamond Rio 500 MP3 player
-#device		uscanner	# Scanners
 # USB Ethernet, requires mii
 #device		aue		# ADMtek USB Ethernet
 #device		axe		# ASIX Electronics USB Ethernet

Modified: head/tools/tools/nanobsd/rescue/AMD64
==============================================================================
--- head/tools/tools/nanobsd/rescue/AMD64	Thu Mar 19 20:31:55 2009	(r190099)
+++ head/tools/tools/nanobsd/rescue/AMD64	Thu Mar 19 20:33:26 2009	(r190100)
@@ -296,7 +296,6 @@ device		ums		# Mouse
 device		ural		# Ralink Technology RT2500USB wireless NICs
 device		rum		# Ralink Technology RT2501USB wireless NICs
 device		urio		# Diamond Rio 500 MP3 player
-device		uscanner	# Scanners
 # USB Serial devices
 device		ucom		# Generic com ttys
 device		uark		# Technologies ARK3116 based serial adapters

Modified: head/tools/tools/nanobsd/rescue/I386
==============================================================================
--- head/tools/tools/nanobsd/rescue/I386	Thu Mar 19 20:31:55 2009	(r190099)
+++ head/tools/tools/nanobsd/rescue/I386	Thu Mar 19 20:33:26 2009	(r190100)
@@ -310,7 +310,6 @@ device		ural		# Ralink Technology RT2500
 device		rum		# Ralink Technology RT2501USB wireless NICs
 device		zyd		# ZyDAS zb1211/zb1211b wireless NICs
 device		urio		# Diamond Rio 500 MP3 player
-device		uscanner	# Scanners
 # USB Serial devices
 device		ucom		# Generic com ttys
 device		u3g		# USB-based 3G modems (Option, Huawei, Sierra)

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 19 20:36:46 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 988B41065674;
	Thu, 19 Mar 2009 20:36:46 +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 6A42E8FC0A;
	Thu, 19 Mar 2009 20:36:46 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2JKak5c074935;
	Thu, 19 Mar 2009 20:36:46 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JKaku6074931;
	Thu, 19 Mar 2009 20:36:46 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <200903192036.n2JKaku6074931@svn.freebsd.org>
From: Marius Strobl 
Date: Thu, 19 Mar 2009 20:36:46 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190101 - in head/sys/sparc64: pci sparc64
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 19 Mar 2009 20:36:49 -0000

Author: marius
Date: Thu Mar 19 20:36:46 2009
New Revision: 190101
URL: http://svn.freebsd.org/changeset/base/190101

Log:
  Take advantage of KOBJMETHOD_END.

Modified:
  head/sys/sparc64/pci/ofw_pcibus.c
  head/sys/sparc64/sparc64/eeprom.c
  head/sys/sparc64/sparc64/rtc.c
  head/sys/sparc64/sparc64/sc_machdep.c

Modified: head/sys/sparc64/pci/ofw_pcibus.c
==============================================================================
--- head/sys/sparc64/pci/ofw_pcibus.c	Thu Mar 19 20:33:26 2009	(r190100)
+++ head/sys/sparc64/pci/ofw_pcibus.c	Thu Mar 19 20:36:46 2009	(r190101)
@@ -90,7 +90,7 @@ static device_method_t ofw_pcibus_method
 	DEVMETHOD(ofw_bus_get_node,	ofw_bus_gen_get_node),
 	DEVMETHOD(ofw_bus_get_type,	ofw_bus_gen_get_type),
 
-	{ 0, 0 }
+	KOBJMETHOD_END
 };
 
 struct ofw_pcibus_devinfo {

Modified: head/sys/sparc64/sparc64/eeprom.c
==============================================================================
--- head/sys/sparc64/sparc64/eeprom.c	Thu Mar 19 20:33:26 2009	(r190100)
+++ head/sys/sparc64/sparc64/eeprom.c	Thu Mar 19 20:36:46 2009	(r190101)
@@ -91,7 +91,7 @@ static device_method_t eeprom_methods[] 
 	DEVMETHOD(clock_gettime,	mk48txx_gettime),
 	DEVMETHOD(clock_settime,	mk48txx_settime),
 
-	{ 0, 0 }
+	KOBJMETHOD_END
 };
 
 static driver_t eeprom_driver = {

Modified: head/sys/sparc64/sparc64/rtc.c
==============================================================================
--- head/sys/sparc64/sparc64/rtc.c	Thu Mar 19 20:33:26 2009	(r190100)
+++ head/sys/sparc64/sparc64/rtc.c	Thu Mar 19 20:36:46 2009	(r190101)
@@ -89,7 +89,7 @@ static device_method_t rtc_ebus_methods[
 	DEVMETHOD(clock_gettime,	mc146818_gettime),
 	DEVMETHOD(clock_settime,	mc146818_settime),
 
-	{ 0, 0 }
+	KOBJMETHOD_END
 };
 
 static driver_t rtc_ebus_driver = {

Modified: head/sys/sparc64/sparc64/sc_machdep.c
==============================================================================
--- head/sys/sparc64/sparc64/sc_machdep.c	Thu Mar 19 20:33:26 2009	(r190100)
+++ head/sys/sparc64/sparc64/sc_machdep.c	Thu Mar 19 20:36:46 2009	(r190101)
@@ -57,7 +57,7 @@ static device_method_t sc_methods[] = {
 	DEVMETHOD(device_probe,		sc_probe),
 	DEVMETHOD(device_attach,	sc_attach),
 
-	{ 0, 0 }
+	KOBJMETHOD_END
 };
 
 static driver_t sc_driver = {

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 19 20:38:02 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 61C32106571B;
	Thu, 19 Mar 2009 20:38:02 +0000 (UTC)
	(envelope-from thompsa@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1C8A78FC1A;
	Thu, 19 Mar 2009 20:38:02 +0000 (UTC)
	(envelope-from thompsa@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2JKc2uQ074999;
	Thu, 19 Mar 2009 20:38:02 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JKc1Mc074998;
	Thu, 19 Mar 2009 20:38:02 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <200903192038.n2JKc1Mc074998@svn.freebsd.org>
From: Andrew Thompson 
Date: Thu, 19 Mar 2009 20:38: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: r190102 - in head/sys: dev/usb/image
	modules/usb/uscanner
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 19 Mar 2009 20:38:17 -0000

Author: thompsa
Date: Thu Mar 19 20:38:01 2009
New Revision: 190102
URL: http://svn.freebsd.org/changeset/base/190102

Log:
  Remove empty dirs.

Deleted:
  head/sys/dev/usb/image/
  head/sys/modules/usb/uscanner/

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 19 20:38:45 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 78A55106574B;
	Thu, 19 Mar 2009 20:38:45 +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 65BAB8FC16;
	Thu, 19 Mar 2009 20:38:45 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2JKcj70075049;
	Thu, 19 Mar 2009 20:38:45 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JKcjkT075047;
	Thu, 19 Mar 2009 20:38:45 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <200903192038.n2JKcjkT075047@svn.freebsd.org>
From: Marius Strobl 
Date: Thu, 19 Mar 2009 20:38: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: r190103 - head/sys/sparc64/sparc64
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 19 Mar 2009 20:38:46 -0000

Author: marius
Date: Thu Mar 19 20:38:45 2009
New Revision: 190103
URL: http://svn.freebsd.org/changeset/base/190103

Log:
  Take advantage of KOBJMETHOD_END.

Modified:
  head/sys/sparc64/sparc64/jbusppm.c
  head/sys/sparc64/sparc64/schppm.c

Modified: head/sys/sparc64/sparc64/jbusppm.c
==============================================================================
--- head/sys/sparc64/sparc64/jbusppm.c	Thu Mar 19 20:38:01 2009	(r190102)
+++ head/sys/sparc64/sparc64/jbusppm.c	Thu Mar 19 20:38:45 2009	(r190103)
@@ -78,7 +78,7 @@ static device_method_t jbusppm_methods[]
 	DEVMETHOD(device_probe,		jbusppm_probe),
 	DEVMETHOD(device_attach,	jbusppm_attach),
 
-	{ NULL, NULL }
+	KOBJMETHOD_END
 };
 
 static devclass_t jbusppm_devclass;

Modified: head/sys/sparc64/sparc64/schppm.c
==============================================================================
--- head/sys/sparc64/sparc64/schppm.c	Thu Mar 19 20:38:01 2009	(r190102)
+++ head/sys/sparc64/sparc64/schppm.c	Thu Mar 19 20:38:45 2009	(r190103)
@@ -73,7 +73,7 @@ static device_method_t schppm_methods[] 
 	DEVMETHOD(device_probe,		schppm_probe),
 	DEVMETHOD(device_attach,	schppm_attach),
 
-	{ NULL, NULL }
+	KOBJMETHOD_END
 };
 
 static devclass_t schppm_devclass;

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 19 20:40:50 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 346801065688;
	Thu, 19 Mar 2009 20:40:50 +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 225838FC20;
	Thu, 19 Mar 2009 20:40:50 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2JKeoUU075201;
	Thu, 19 Mar 2009 20:40:50 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JKeoYY075200;
	Thu, 19 Mar 2009 20:40:50 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <200903192040.n2JKeoYY075200@svn.freebsd.org>
From: Marius Strobl 
Date: Thu, 19 Mar 2009 20:40: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: r190105 - head/sys/sparc64/sparc64
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 19 Mar 2009 20:40:50 -0000

Author: marius
Date: Thu Mar 19 20:40:49 2009
New Revision: 190105
URL: http://svn.freebsd.org/changeset/base/190105

Log:
  There's no need to wrap kdb_enter() in #ifdef KDB as it's always available.

Modified:
  head/sys/sparc64/sparc64/machdep.c

Modified: head/sys/sparc64/sparc64/machdep.c
==============================================================================
--- head/sys/sparc64/sparc64/machdep.c	Thu Mar 19 20:40:11 2009	(r190104)
+++ head/sys/sparc64/sparc64/machdep.c	Thu Mar 19 20:40:49 2009	(r190105)
@@ -496,10 +496,8 @@ sparc64_init(caddr_t mdp, u_long o1, u_l
 
 	kdb_init();
 
-#ifdef KDB
 	if (boothowto & RB_KDB)
 		kdb_enter(KDB_WHY_BOOTFLAGS, "Boot flags requested debugger");
-#endif
 }
 
 void

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 19 20:43:01 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 82D1F1065692;
	Thu, 19 Mar 2009 20:43:01 +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 7086A8FC26;
	Thu, 19 Mar 2009 20:43:01 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2JKh1SL075273;
	Thu, 19 Mar 2009 20:43:01 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JKh1R1075272;
	Thu, 19 Mar 2009 20:43:01 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <200903192043.n2JKh1R1075272@svn.freebsd.org>
From: Marius Strobl 
Date: Thu, 19 Mar 2009 20:43: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: r190106 - head/sys/sparc64/sparc64
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 19 Mar 2009 20:43:02 -0000

Author: marius
Date: Thu Mar 19 20:43:01 2009
New Revision: 190106
URL: http://svn.freebsd.org/changeset/base/190106

Log:
  - Remove the delay in cpu_mp_shutdown() which is no longer necessary since
    we have stopped using SUNW,stop-self with r186395.
  - There's no need to wrap kdb_active in #ifdef KDB as it's always available.

Modified:
  head/sys/sparc64/sparc64/mp_machdep.c

Modified: head/sys/sparc64/sparc64/mp_machdep.c
==============================================================================
--- head/sys/sparc64/sparc64/mp_machdep.c	Thu Mar 19 20:40:49 2009	(r190105)
+++ head/sys/sparc64/sparc64/mp_machdep.c	Thu Mar 19 20:43:01 2009	(r190106)
@@ -413,8 +413,6 @@ cpu_mp_shutdown(void)
 			break;
 		}
 	}
-	/* XXX: delay a bit to allow the CPUs to actually enter the PROM. */
-	DELAY(100000);
 	critical_exit();
 }
 
@@ -505,11 +503,7 @@ spitfire_ipi_send(u_int mid, u_long d0, 
 		 */
 		DELAY(2);
 	}
-	if (
-#ifdef KDB
-	    kdb_active ||
-#endif
-	    panicstr != NULL)
+	if (kdb_active != 0 || panicstr != NULL)
 		printf("%s: couldn't send IPI to module 0x%u\n",
 		    __func__, mid);
 	else
@@ -581,11 +575,7 @@ cheetah_ipi_selected(u_int cpus, u_long 
 		 */
 		DELAY(2 * mp_ncpus);
 	}
-	if (
-#ifdef KDB
-	    kdb_active ||
-#endif
-	    panicstr != NULL)
+	if (kdb_active != 0 || panicstr != NULL)
 		printf("%s: couldn't send IPI (cpus=0x%u ids=0x%lu)\n",
 		    __func__, cpus, ids);
 	else

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 19 20:46:51 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E0E461065670;
	Thu, 19 Mar 2009 20:46: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 CD8B68FC13;
	Thu, 19 Mar 2009 20:46:51 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2JKkp22075396;
	Thu, 19 Mar 2009 20:46:51 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JKkpsZ075392;
	Thu, 19 Mar 2009 20:46:51 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <200903192046.n2JKkpsZ075392@svn.freebsd.org>
From: Marius Strobl 
Date: Thu, 19 Mar 2009 20:46: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: r190107 - in head/sys: sparc64/include sparc64/sparc64
	sun4v/include sun4v/sun4v
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 19 Mar 2009 20:46:53 -0000

Author: marius
Date: Thu Mar 19 20:46:51 2009
New Revision: 190107
URL: http://svn.freebsd.org/changeset/base/190107

Log:
  - There's no need to wrap kdb_active and kdb_trap() in #ifdef KDB as
    they're always available.
  - Remove unused variable. [1]
  - Add a missing const.
  - Sort includes.
  
  Submitted by:	Christoph Mallon [1]

Modified:
  head/sys/sparc64/include/trap.h
  head/sys/sparc64/sparc64/trap.c
  head/sys/sun4v/include/trap.h
  head/sys/sun4v/sun4v/trap.c

Modified: head/sys/sparc64/include/trap.h
==============================================================================
--- head/sys/sparc64/include/trap.h	Thu Mar 19 20:43:01 2009	(r190106)
+++ head/sys/sparc64/include/trap.h	Thu Mar 19 20:46:51 2009	(r190107)
@@ -91,7 +91,7 @@
 
 #ifndef LOCORE
 void sun4u_set_traptable(void *tba_addr);
-extern const char *trap_msg[];
+extern const char *const trap_msg[];
 #endif
 
 #endif

Modified: head/sys/sparc64/sparc64/trap.c
==============================================================================
--- head/sys/sparc64/sparc64/trap.c	Thu Mar 19 20:43:01 2009	(r190106)
+++ head/sys/sparc64/sparc64/trap.c	Thu Mar 19 20:46:51 2009	(r190107)
@@ -71,7 +71,6 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
-#include 
 
 #include 
 #include 
@@ -84,7 +83,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -114,7 +113,7 @@ extern char fas_nofault_end[];
 
 extern char *syscallnames[];
 
-const char *trap_msg[] = {
+const char *const trap_msg[] = {
 	"reserved",
 	"instruction access exception",
 	"instruction access error",
@@ -329,15 +328,12 @@ trap(struct trapframe *tf)
 		KASSERT((tf->tf_type & T_KERNEL) != 0,
 		    ("trap: kernel trap isn't"));
 
-#ifdef KDB
 		if (kdb_active) {
 			kdb_reenter();
 			return;
 		}
-#endif
 
 		switch (tf->tf_type & ~T_KERNEL) {
-#ifdef KDB
 		case T_BREAKPOINT:
 		case T_KSTACK_FAULT:
 			error = (kdb_trap(tf->tf_type, 0, tf) == 0);
@@ -349,7 +345,6 @@ trap(struct trapframe *tf)
 			error = db_watch_trap(tf);
 			break;
 #endif
-#endif
 		case T_DATA_MISS:
 		case T_DATA_PROTECTION:
 		case T_INSTRUCTION_MISS:
@@ -409,7 +404,6 @@ static int
 trap_pfault(struct thread *td, struct trapframe *tf)
 {
 	struct vmspace *vm;
-	struct pcb *pcb;
 	struct proc *p;
 	vm_offset_t va;
 	vm_prot_t prot;
@@ -429,7 +423,6 @@ trap_pfault(struct thread *td, struct tr
 
 	rv = KERN_SUCCESS;
 	ctx = TLB_TAR_CTX(tf->tf_tar);
-	pcb = td->td_pcb;
 	type = tf->tf_type & ~T_KERNEL;
 	va = TLB_TAR_VA(tf->tf_tar);
 
@@ -559,11 +552,6 @@ syscall(struct trapframe *tf)
 
 	PCPU_INC(cnt.v_syscall);
 
-	narg = 0;
-	error = 0;
-	reg = 0;
-	regcnt = REG_MAXARGS;
-
 	td->td_pticks = 0;
 	td->td_frame = tf;
 	if (td->td_ucred != p->p_ucred)
@@ -577,6 +565,8 @@ syscall(struct trapframe *tf)
 	tpc = tf->tf_tpc;
 	TF_DONE(tf);
 
+	reg = 0;
+	regcnt = REG_MAXARGS;
 	if (p->p_sysent->sv_prepsyscall) {
 		/*
 		 * The prep code is MP aware.

Modified: head/sys/sun4v/include/trap.h
==============================================================================
--- head/sys/sun4v/include/trap.h	Thu Mar 19 20:43:01 2009	(r190106)
+++ head/sys/sun4v/include/trap.h	Thu Mar 19 20:46:51 2009	(r190107)
@@ -144,7 +144,7 @@
 
 
 #ifndef LOCORE
-extern const char *trap_msg[];
+extern const char *const trap_msg[];
 extern void set_mmfsa_traptable(void *, uint64_t);
 extern void trap_init(void);
 #endif

Modified: head/sys/sun4v/sun4v/trap.c
==============================================================================
--- head/sys/sun4v/sun4v/trap.c	Thu Mar 19 20:43:01 2009	(r190106)
+++ head/sys/sun4v/sun4v/trap.c	Thu Mar 19 20:46:51 2009	(r190107)
@@ -81,7 +81,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -119,7 +118,7 @@ extern char fas_nofault_end[];
 
 extern char *syscallnames[];
 
-const char *trap_msg[] = {
+const char *const trap_msg[] = {
 	"reserved",
 	"instruction access exception",
 	"instruction access error",
@@ -390,21 +389,17 @@ trap(struct trapframe *tf, int64_t type,
 		    ("trap: kernel trap isn't - trap: %ld:%s: 0x%lx at 0x%lx on cpu=%d\n", 
 		     trapno, trap_msg[trapno], data, tf->tf_tpc, curcpu));
 
-#ifdef KDB
 		if (kdb_active) {
 			kdb_reenter();
 			return;
 		}
-#endif
 
 		switch (trapno) {
-#ifdef KDB
 		case T_BREAKPOINT:
 		case T_KSTACK_FAULT:
 			error = (kdb_trap(trapno, 0, tf) == 0);
 			TF_DONE(tf);
 			break;
-#endif
 		case T_DATA_MISS:
 		case T_DATA_PROTECTION:
 		case T_INSTRUCTION_MISS:
@@ -460,7 +455,6 @@ static int
 trap_pfault(struct thread *td, struct trapframe *tf, int64_t type, uint64_t data)
 {
 	struct vmspace *vm;
-	struct pcb *pcb;
 	struct proc *p;
 	vm_offset_t va;
 	vm_prot_t prot;
@@ -475,7 +469,6 @@ trap_pfault(struct thread *td, struct tr
 
 	rv = KERN_SUCCESS;
 	ctx = TLB_TAR_CTX(data);
-	pcb = td->td_pcb;
 	type = type & ~T_KERNEL;
 	va = TLB_TAR_VA(data);
 
@@ -603,11 +596,6 @@ syscall(struct trapframe *tf)
 
 	PCPU_INC(cnt.v_syscall);
 
-	narg = 0;
-	error = 0;
-	reg = 0;
-	regcnt = REG_MAXARGS;
-
 	td->td_pticks = 0;
 	td->td_frame = tf;
 	if (td->td_ucred != p->p_ucred)
@@ -621,6 +609,8 @@ syscall(struct trapframe *tf)
 	tpc = tf->tf_tpc;
 	TF_DONE(tf);
 
+	reg = 0;
+	regcnt = REG_MAXARGS;
 	if (p->p_sysent->sv_prepsyscall) {
 		/*
 		 * The prep code is MP aware.

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 19 20:48:48 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0FF94106564A;
	Thu, 19 Mar 2009 20:48:48 +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 D71BD8FC1A;
	Thu, 19 Mar 2009 20:48:47 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2JKmlWv075483;
	Thu, 19 Mar 2009 20:48:47 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JKmlg9075482;
	Thu, 19 Mar 2009 20:48:47 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <200903192048.n2JKmlg9075482@svn.freebsd.org>
From: Marius Strobl 
Date: Thu, 19 Mar 2009 20:48: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: r190108 - head/sys/sparc64/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: Thu, 19 Mar 2009 20:48:49 -0000

Author: marius
Date: Thu Mar 19 20:48:47 2009
New Revision: 190108
URL: http://svn.freebsd.org/changeset/base/190108

Log:
  - Take advantage of KOBJMETHOD_END.
  - Hook up the streaming buffer (not used by iommu(4) by default, yet)
    if available and usable. [1]
  - Move the message regarding belated registration as interrupt control
    under bootverbose as this isn't something the user should worry about.
  
  Tested by:	Michael Moll [1]

Modified:
  head/sys/sparc64/pci/schizo.c

Modified: head/sys/sparc64/pci/schizo.c
==============================================================================
--- head/sys/sparc64/pci/schizo.c	Thu Mar 19 20:46:51 2009	(r190107)
+++ head/sys/sparc64/pci/schizo.c	Thu Mar 19 20:48:47 2009	(r190108)
@@ -148,7 +148,7 @@ static device_method_t schizo_methods[] 
 	/* ofw_bus interface */
 	DEVMETHOD(ofw_bus_get_node,	schizo_get_node),
 
-	{ 0, 0 }
+	KOBJMETHOD_END
 };
 
 static devclass_t schizo_devclass;
@@ -449,14 +449,17 @@ schizo_attach(device_t dev)
 		tc_init(tc);
 	}
 
-	/* Set up the IOMMU.  Both Schizo and Tomatillo have one per PBM. */
+	/*
+	 * Set up the IOMMU.  Schizo, Tomatillo and XMITS all have
+	 * one per PBM.  Schizo and XMITS additionally have a streaming
+	 * buffer, in Schizo version < 5 (i.e. revision < 2.3) it's
+	 * affected by several errata and basically unusable though.
+	 */
 	sc->sc_is.is_pmaxaddr = IOMMU_MAXADDR(STX_IOMMU_BITS);
-	sc->sc_is.is_sb[0] = 0;
-	sc->sc_is.is_sb[1] = 0;
-#ifdef notyet
-	if (OF_getproplen(node, "no-streaming-cache") < 0)
+	sc->sc_is.is_sb[0] = sc->sc_is.is_sb[1] = 0;
+	if (OF_getproplen(node, "no-streaming-cache") < 0 &&
+	    !(sc->sc_mode == SCHIZO_MODE_SCZ && sc->sc_ver < 5))
 		sc->sc_is.is_sb[0] = STX_PCI_STRBUF;
-#endif
 
 #define	TSBCASE(x)							\
 	case (IOTSB_BASESZ << (x)) << (IO_PAGE_SHIFT - IOTTE_SHIFT):	\
@@ -1154,8 +1157,9 @@ schizo_setup_intr(device_t dev, device_t
 			    "controller for vector 0x%lx (%d)\n", vec, error);
 			return (error);
 		}
-		device_printf(dev, "belatedly registered as interrupt "
-		    "controller for vector 0x%lx\n", vec);
+		if (bootverbose)
+			device_printf(dev, "belatedly registered as "
+			    "interrupt controller for vector 0x%lx\n", vec);
 	} else {
 		device_printf(dev,
 		    "invalid interrupt controller for vector 0x%lx\n", vec);

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 19 20:52:46 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D76381065672;
	Thu, 19 Mar 2009 20:52:46 +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 C33118FC0C;
	Thu, 19 Mar 2009 20:52:46 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2JKqkRu075598;
	Thu, 19 Mar 2009 20:52:46 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JKqkaY075596;
	Thu, 19 Mar 2009 20:52:46 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <200903192052.n2JKqkaY075596@svn.freebsd.org>
From: Marius Strobl 
Date: Thu, 19 Mar 2009 20:52:46 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190109 - head/sys/sparc64/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: Thu, 19 Mar 2009 20:52:48 -0000

Author: marius
Date: Thu Mar 19 20:52:46 2009
New Revision: 190109
URL: http://svn.freebsd.org/changeset/base/190109

Log:
  - Ensure we find no unexpected partner.
  - Failing to register as interrupt controller during attach shouldn't
    be fatal so just inform about this instead of panicing.
  - Disable rerun of the streaming cache as workaround for a silicon bug
    of certain Psycho versions.
  - Remove the comment regarding lack of newbus'ified bus_dma(9) as being
    able to associate a DMA tag with a device would allow to implement
    CDMA flushing/syncing in bus_dmamap_sync(9) but that would totally
    kill performance. Given that for devices not behind a PCI-PCI bridge
    the host-to-PCI bridges also only do CDMA flushing/syncing based on
    interrupts there's no additional disadvantage for polling(4) callbacks
    in the case schizo(4) has to do the CDMA flushing/syncing but rather a
    general problem.
  - Don't panic if the power failure, power management or over-temperature
    interrupts doesn't exist as these aren't mandatory and not available
    with all controllers (not even Psychos). [1]
  - Take advantage of KOBJMETHOD_END.
  - Remove some redundant variables.
  - Add missing const.
  
  PR:	131371 [1]

Modified:
  head/sys/sparc64/pci/psycho.c
  head/sys/sparc64/pci/psychovar.h

Modified: head/sys/sparc64/pci/psycho.c
==============================================================================
--- head/sys/sparc64/pci/psycho.c	Thu Mar 19 20:48:47 2009	(r190108)
+++ head/sys/sparc64/pci/psycho.c	Thu Mar 19 20:52:46 2009	(r190109)
@@ -83,7 +83,7 @@ static void psycho_set_intr(struct psych
     driver_filter_t, driver_intr_t);
 static int psycho_find_intrmap(struct psycho_softc *, u_int, bus_addr_t *,
     bus_addr_t *, u_long *);
-static driver_filter_t psycho_dmasync;
+static driver_filter_t psycho_dma_sync_stub;
 static void psycho_intr_enable(void *);
 static void psycho_intr_disable(void *);
 static void psycho_intr_assign(void *);
@@ -150,7 +150,7 @@ static device_method_t psycho_methods[] 
 	/* ofw_bus interface */
 	DEVMETHOD(ofw_bus_get_node,	psycho_get_node),
 
-	{ 0, 0 }
+	KOBJMETHOD_END
 };
 
 static devclass_t psycho_devclass;
@@ -175,7 +175,7 @@ struct psycho_icarg {
 	bus_addr_t		pica_clr;
 };
 
-struct psycho_dmasync {
+struct psycho_dma_sync {
 	struct psycho_softc	*pds_sc;
 	driver_filter_t		*pds_handler;	/* handler to call */
 	void			*pds_arg;	/* argument for the handler */
@@ -232,14 +232,14 @@ struct psycho_desc {
 	const char	*pd_name;
 };
 
-static const struct psycho_desc psycho_compats[] = {
+static const struct psycho_desc const psycho_compats[] = {
 	{ "pci108e,8000", PSYCHO_MODE_PSYCHO,	"Psycho compatible" },
 	{ "pci108e,a000", PSYCHO_MODE_SABRE,	"Sabre compatible" },
 	{ "pci108e,a001", PSYCHO_MODE_SABRE,	"Hummingbird compatible" },
 	{ NULL,		  0,			NULL }
 };
 
-static const struct psycho_desc psycho_models[] = {
+static const struct psycho_desc const psycho_models[] = {
 	{ "SUNW,psycho",  PSYCHO_MODE_PSYCHO,	"Psycho" },
 	{ "SUNW,sabre",   PSYCHO_MODE_SABRE,	"Sabre" },
 	{ NULL,		  0,			NULL }
@@ -296,8 +296,8 @@ psycho_attach(device_t dev)
 	phandle_t child, node;
 	uint32_t dvmabase, prop, prop_array[2];
 	int32_t rev;
-	u_int ver;
-	int i, n, nrange, rid;
+	u_int rerun, ver;
+	int i, n;
 
 	node = ofw_bus_get_node(dev);
 	sc = device_get_softc(dev);
@@ -315,7 +315,7 @@ psycho_attach(device_t dev)
 	 * (2) the shared Psycho configuration registers
 	 */
 	if (sc->sc_mode == PSYCHO_MODE_PSYCHO) {
-		rid = 2;
+		i = 2;
 		sc->sc_pcictl =
 		    bus_get_resource_start(dev, SYS_RES_MEMORY, 0) -
 		    bus_get_resource_start(dev, SYS_RES_MEMORY, 2);
@@ -332,18 +332,18 @@ psycho_attach(device_t dev)
 			/* NOTREACHED */
 		}
 	} else {
-		rid = 0;
+		i = 0;
 		sc->sc_pcictl = PSR_PCICTL0;
 		sc->sc_half = 0;
 	}
-	sc->sc_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid,
+	sc->sc_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &i,
 	    (sc->sc_mode == PSYCHO_MODE_PSYCHO ? RF_SHAREABLE : 0) |
 	    RF_ACTIVE);
 	if (sc->sc_mem_res == NULL)
 		panic("%s: could not allocate registers", __func__);
 
 	/*
-	 * Match other Psycho's that are already configured against
+	 * Match other Psychos that are already configured against
 	 * the base physical address.  This will be the same for a
 	 * pair of devices that share register space.
 	 */
@@ -363,6 +363,8 @@ psycho_attach(device_t dev)
 			panic("%s: could not malloc mutex", __func__);
 		mtx_init(sc->sc_mtx, "pcib_mtx", NULL, MTX_SPIN);
 	} else {
+		if (sc->sc_mode != PSYCHO_MODE_PSYCHO)
+			panic("%s: no partner expected", __func__);
 		if (mtx_initialized(osc->sc_mtx) == 0)
 			panic("%s: mutex not initialized", __func__);
 		sc->sc_mtx = osc->sc_mtx;
@@ -408,16 +410,17 @@ psycho_attach(device_t dev)
 	case 0:
 		dr |= DIAG_RTRY_DIS;
 		dr &= ~DIAG_DWSYNC_DIS;
-		/* XXX need to also disable rerun of the streaming buffers. */
+		rerun = 0;
 		break;
 	case 1:
 		csr &= ~PCICTL_ARB_PARK;
 		dr |= DIAG_RTRY_DIS | DIAG_DWSYNC_DIS;
-		/* XXX need to also disable rerun of the streaming buffers. */
+		rerun = 0;
 		break;
 	default:
 		dr |= DIAG_DWSYNC_DIS;
 		dr &= ~DIAG_RTRY_DIS;
+		rerun = 1;
 		break;
 	}
 
@@ -460,13 +463,12 @@ psycho_attach(device_t dev)
 	    rman_manage_region(&sc->sc_pci_mem_rman, 0, PSYCHO_MEM_SIZE) != 0)
 		panic("%s: failed to set up memory rman", __func__);
 
-	nrange = OF_getprop_alloc(node, "ranges", sizeof(*range),
-	    (void **)&range);
+	n = OF_getprop_alloc(node, "ranges", sizeof(*range), (void **)&range);
 	/*
 	 * Make sure that the expected ranges are present.  The
 	 * OFW_PCI_CS_MEM64 one is not currently used though.
 	 */
-	if (nrange != PSYCHO_NRANGE)
+	if (n != PSYCHO_NRANGE)
 		panic("%s: unsupported number of ranges", __func__);
 	/*
 	 * Find the addresses of the various bus spaces.
@@ -493,7 +495,8 @@ psycho_attach(device_t dev)
 		/*
 		 * Hunt through all the interrupt mapping regs and register
 		 * our interrupt controller for the corresponding interrupt
-		 * vectors.
+		 * vectors.  We do this early in order to be able to catch
+		 * stray interrupts.
 		 */
 		for (n = 0; n <= PSYCHO_MAX_INO; n++) {
 			if (psycho_find_intrmap(sc, n, &intrmap, &intrclr,
@@ -523,22 +526,23 @@ psycho_attach(device_t dev)
 			    INTMAP_ENABLE(INTMAP_VEC(sc->sc_ign, n),
 			    PCPU_GET(mid)));
 #endif
-			if (intr_controller_register(INTMAP_VEC(sc->sc_ign, n),
-			    &psycho_ic, pica) != 0)
-				panic("%s: could not register interrupt "
-				    "controller for INO %d", __func__, n);
+			i = intr_controller_register(INTMAP_VEC(sc->sc_ign, n),
+			    &psycho_ic, pica);
+			if (i != 0)
+				device_printf(dev, "could not register "
+				    "interrupt controller for INO %d (%d)\n",
+				    n, i);
 		}
 
-		if (sc->sc_mode == PSYCHO_MODE_PSYCHO) {
-			/* Initialize the counter-timer. */
+		if (sc->sc_mode == PSYCHO_MODE_PSYCHO)
 			sparc64_counter_init(device_get_nameunit(dev),
 			    rman_get_bustag(sc->sc_mem_res),
 			    rman_get_bushandle(sc->sc_mem_res), PSR_TC0);
-		}
 
 		/*
 		 * Set up IOMMU and PCI configuration if we're the first
-		 * of a pair of Psycho's to arrive here.
+		 * of a pair of Psychos to arrive here or a Hummingbird
+		 * or Sabre.
 		 *
 		 * We should calculate a TSB size based on amount of RAM
 		 * and number of bus controllers and number and type of
@@ -556,10 +560,10 @@ psycho_attach(device_t dev)
 		else
 			sc->sc_is->is_pmaxaddr =
 			    IOMMU_MAXADDR(PSYCHO_IOMMU_BITS);
-		sc->sc_is->is_sb[0] = 0;
-		sc->sc_is->is_sb[1] = 0;
+		sc->sc_is->is_sb[0] = sc->sc_is->is_sb[1] = 0;
 		if (OF_getproplen(node, "no-streaming-cache") < 0)
 			sc->sc_is->is_sb[0] = sc->sc_pcictl + PCR_STRBUF;
+		sc->sc_is->is_flags |= (rerun != 1) ? IOMMU_RERUN_DISABLE : 0;
 		psycho_iommu_init(sc, 3, dvmabase);
 	} else {
 		/* Just copy IOMMU state, config tag and address. */
@@ -694,12 +698,20 @@ psycho_set_intr(struct psycho_softc *sc,
 	rid = index;
 	sc->sc_irq_res[index] = bus_alloc_resource_any(sc->sc_dev, SYS_RES_IRQ,
 	    &rid, RF_ACTIVE);
+	if (sc->sc_irq_res[index] == NULL && intrmap >= PSR_POWER_INT_MAP) {
+		/*
+		 * These interrupts aren't mandatory and not available
+		 * with all controllers (not even Psychos).
+		 */
+		return;
+	}
 	if (sc->sc_irq_res[index] == NULL ||
 	    INTIGN(vec = rman_get_start(sc->sc_irq_res[index])) != sc->sc_ign ||
 	    INTVEC(PSYCHO_READ8(sc, intrmap)) != vec ||
 	    intr_vectors[vec].iv_ic != &psycho_ic ||
-	    bus_setup_intr(sc->sc_dev, sc->sc_irq_res[index], INTR_TYPE_MISC,
-	    filt, intr, sc, &sc->sc_ihand[index]) != 0)
+	    bus_setup_intr(sc->sc_dev, sc->sc_irq_res[index],
+	    INTR_TYPE_MISC | INTR_FAST, filt, intr, sc,
+	    &sc->sc_ihand[index]) != 0)
 		panic("%s: failed to set up interrupt %d", __func__, index);
 }
 
@@ -1065,9 +1077,9 @@ psycho_read_ivar(device_t dev, device_t 
 }
 
 static int
-psycho_dmasync(void *arg)
+psycho_dma_sync_stub(void *arg)
 {
-	struct psycho_dmasync *pds = arg;
+	struct psycho_dma_sync *pds = arg;
 
 	(void)PCIB_READ_CONFIG(pds->pds_ppb, pds->pds_bus, pds->pds_slot,
 	    pds->pds_func, PCIR_VENDOR, 2);
@@ -1125,7 +1137,7 @@ psycho_setup_intr(device_t dev, device_t
 	devclass_t pci_devclass;
 	device_t cdev, pdev, pcidev;
 	struct psycho_softc *sc;
-	struct psycho_dmasync *pds;
+	struct psycho_dma_sync *pds;
 	u_long vec;
 	int error;
 
@@ -1142,17 +1154,12 @@ psycho_setup_intr(device_t dev, device_t
 	}
 
 	/*
-	 * The Sabre-APB-combination has a bug where it does not drain
-	 * DMA write data for devices behind additional PCI-PCI bridges
-	 * underneath the APB PCI-PCI bridge.  The workaround is to do
-	 * a read on the farest PCI-PCI bridge followed by a read of the
-	 * PCI DMA write sync register of the Sabre.
-	 * XXX installing the wrapper for an affected device and the
-	 * actual workaround in psycho_dmasync() should be moved to
-	 * psycho(4)-specific bus_dma_tag_create() and bus_dmamap_sync()
-	 * methods, respectively, once DMA tag creation is newbus'ified,
-	 * so the workaround isn't only applied for interrupt handlers
-	 * but also for polling(4) callbacks.
+	 * The Sabre-APB-combination does not automatically flush DMA
+	 * write data for devices behind additional PCI-PCI bridges
+	 * underneath the APB PCI-PCI bridge.  The procedure for a
+	 * manual flush is to do a PIO read on the far side of the
+	 * farthest PCI-PCI bridge followed by a read of the PCI DMA
+	 * write sync register of the Sabre.
 	 */
 	if (sc->sc_mode == PSYCHO_MODE_SABRE) {
 		pds = malloc(sizeof(*pds), M_DEVBUF, M_NOWAIT | M_ZERO);
@@ -1191,20 +1198,20 @@ psycho_setup_intr(device_t dev, device_t
 			pds->pds_func = pci_get_function(pcidev);
 			if (bootverbose)
 				device_printf(dev, "installed DMA sync "
-				    "workaround for device %d.%d on bus %d\n",
+				    "wrapper for device %d.%d on bus %d\n",
 				    pds->pds_slot, pds->pds_func,
 				    pds->pds_bus);
 			if (intr == NULL) {
 				pds->pds_handler = filt;
 				error = bus_generic_setup_intr(dev, child,
-				    ires, flags, psycho_dmasync, intr, pds,
-				    cookiep);
+				    ires, flags, psycho_dma_sync_stub, intr,
+				    pds, cookiep);
 			} else {
 				pds->pds_handler = (driver_filter_t *)intr;
 				error = bus_generic_setup_intr(dev, child,
 				    ires, flags, filt,
-				    (driver_intr_t *)psycho_dmasync, pds,
-				    cookiep);
+				    (driver_intr_t *)psycho_dma_sync_stub,
+				    pds, cookiep);
 			}
 		} else
 			error = bus_generic_setup_intr(dev, child, ires,
@@ -1226,7 +1233,7 @@ psycho_teardown_intr(device_t dev, devic
     void *cookie)
 {
 	struct psycho_softc *sc;
-	struct psycho_dmasync *pds;
+	struct psycho_dma_sync *pds;
 	int error;
 
 	sc = device_get_softc(dev);
@@ -1314,8 +1321,8 @@ psycho_activate_resource(device_t bus, d
 		    type, rid, r));
 	if (type == SYS_RES_MEMORY) {
 		/*
-		 * Need to memory-map the device space, as some drivers depend
-		 * on the virtual address being set and useable.
+		 * Need to memory-map the device space, as some drivers
+		 * depend on the virtual address being set and usable.
 		 */
 		error = sparc64_bus_mem_map(rman_get_bustag(r),
 		    rman_get_bushandle(r), rman_get_size(r), 0, 0, &p);

Modified: head/sys/sparc64/pci/psychovar.h
==============================================================================
--- head/sys/sparc64/pci/psychovar.h	Thu Mar 19 20:48:47 2009	(r190108)
+++ head/sys/sparc64/pci/psychovar.h	Thu Mar 19 20:52:46 2009	(r190109)
@@ -49,8 +49,8 @@ struct psycho_softc {
 
 	phandle_t			sc_node;	/* Firmware node */
 	u_int				sc_mode;
-#define	PSYCHO_MODE_SABRE	1
-#define	PSYCHO_MODE_PSYCHO	2
+#define	PSYCHO_MODE_SABRE		0
+#define	PSYCHO_MODE_PSYCHO		1
 
 	/* Bus A or B of a psycho pair? */
 	u_int				sc_half;

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 19 20:54:15 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DAA9910656BE;
	Thu, 19 Mar 2009 20:54:15 +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 C74718FC12;
	Thu, 19 Mar 2009 20:54:15 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2JKsFdw075663;
	Thu, 19 Mar 2009 20:54:15 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JKsFPn075662;
	Thu, 19 Mar 2009 20:54:15 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <200903192054.n2JKsFPn075662@svn.freebsd.org>
From: Marius Strobl 
Date: Thu, 19 Mar 2009 20:54: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: r190110 - head/sys/sparc64/isa
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 19 Mar 2009 20:54:17 -0000

Author: marius
Date: Thu Mar 19 20:54:15 2009
New Revision: 190110
URL: http://svn.freebsd.org/changeset/base/190110

Log:
  Sort include.

Modified:
  head/sys/sparc64/isa/ofw_isa.c

Modified: head/sys/sparc64/isa/ofw_isa.c
==============================================================================
--- head/sys/sparc64/isa/ofw_isa.c	Thu Mar 19 20:52:46 2009	(r190109)
+++ head/sys/sparc64/isa/ofw_isa.c	Thu Mar 19 20:54:15 2009	(r190110)
@@ -40,8 +40,8 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#include 
 #include 
+#include 
 
 #include 
 #include 

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 19 20:58:00 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 00C1B1065672;
	Thu, 19 Mar 2009 20:58:00 +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 E262F8FC20;
	Thu, 19 Mar 2009 20:57:59 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2JKvxNl075779;
	Thu, 19 Mar 2009 20:57:59 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JKvxKP075778;
	Thu, 19 Mar 2009 20:57:59 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <200903192057.n2JKvxKP075778@svn.freebsd.org>
From: Marius Strobl 
Date: Thu, 19 Mar 2009 20:57: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: r190111 - head/sys/sparc64/isa
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 19 Mar 2009 20:58:00 -0000

Author: marius
Date: Thu Mar 19 20:57:59 2009
New Revision: 190111
URL: http://svn.freebsd.org/changeset/base/190111

Log:
  Add device found in B100.

Modified:
  head/sys/sparc64/isa/isa.c

Modified: head/sys/sparc64/isa/isa.c
==============================================================================
--- head/sys/sparc64/isa/isa.c	Thu Mar 19 20:54:15 2009	(r190110)
+++ head/sys/sparc64/isa/isa.c	Thu Mar 19 20:57:59 2009	(r190111)
@@ -118,7 +118,7 @@ isa_init(device_t dev)
 static const struct {
 	const char	*name;
 	uint32_t	id;
-} ofw_isa_pnp_map[] = {
+} const ofw_isa_pnp_map[] = {
 	{ "SUNW,lomh",	0x0000ae4e }, /* SUN0000 */
 	{ "dma",	0x0002d041 }, /* PNP0200 */
 	{ "floppy",	0x0007d041 }, /* PNP0700 */
@@ -130,6 +130,7 @@ static const struct {
 	{ "rmc-comm",	0x0300ae4e }, /* SUN0003 */
 	{ "kb_ps2",	0x0303d041 }, /* PNP0303 */
 	{ "kdmouse",	0x030fd041 }, /* PNP0F03 */
+	{ "bscbus",	0x0400ae4e }, /* SUN0004 */
 	{ "power",	0x0c0cd041 }, /* PNP0C0C */
 	{ NULL,		0x0 }
 };

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 19 21:02:37 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 58A56106566C;
	Thu, 19 Mar 2009 21:02:37 +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 457E68FC08;
	Thu, 19 Mar 2009 21:02:37 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2JL2bPC075920;
	Thu, 19 Mar 2009 21:02:37 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JL2bdg075918;
	Thu, 19 Mar 2009 21:02:37 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <200903192102.n2JL2bdg075918@svn.freebsd.org>
From: Marius Strobl 
Date: Thu, 19 Mar 2009 21:02:37 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190112 - head/sys/sparc64/sbus
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 19 Mar 2009 21:02:38 -0000

Author: marius
Date: Thu Mar 19 21:02:36 2009
New Revision: 190112
URL: http://svn.freebsd.org/changeset/base/190112

Log:
  - As suggested by OpenSolaris use up-burst-sizes for determining the
    supported burst sizes.
  - Add support for 64-bit burst sizes (required for SBus GEM).
  - Failing to register as interrupt controller during attach shouldn't
    be fatal so just inform about this instead of panicing.
  - Take advantage of KOBJMETHOD_END.
  - Remove some redundant variables.
  - Add missing const.

Modified:
  head/sys/sparc64/sbus/sbus.c
  head/sys/sparc64/sbus/sbusvar.h

Modified: head/sys/sparc64/sbus/sbus.c
==============================================================================
--- head/sys/sparc64/sbus/sbus.c	Thu Mar 19 20:57:59 2009	(r190111)
+++ head/sys/sparc64/sbus/sbus.c	Thu Mar 19 21:02:36 2009	(r190112)
@@ -190,7 +190,7 @@ static bus_deactivate_resource_t sbus_de
 static bus_get_dma_tag_t sbus_get_dma_tag;
 static ofw_bus_get_devinfo_t sbus_get_devinfo;
 
-static int sbus_inlist(const char *, const char **);
+static int sbus_inlist(const char *, const char *const *);
 static struct sbus_devinfo * sbus_setup_dinfo(device_t, struct sbus_softc *,
     phandle_t);
 static void sbus_destroy_dinfo(struct sbus_devinfo *);
@@ -217,16 +217,15 @@ static device_method_t sbus_methods[] = 
 	DEVMETHOD(bus_print_child,	sbus_print_child),
 	DEVMETHOD(bus_probe_nomatch,	sbus_probe_nomatch),
 	DEVMETHOD(bus_read_ivar,	sbus_read_ivar),
-	DEVMETHOD(bus_setup_intr, 	sbus_setup_intr),
-	DEVMETHOD(bus_teardown_intr,	bus_generic_teardown_intr),
 	DEVMETHOD(bus_alloc_resource,	sbus_alloc_resource),
 	DEVMETHOD(bus_activate_resource,	sbus_activate_resource),
 	DEVMETHOD(bus_deactivate_resource,	sbus_deactivate_resource),
 	DEVMETHOD(bus_release_resource,	sbus_release_resource),
-	DEVMETHOD(bus_get_resource_list, sbus_get_resource_list),
+	DEVMETHOD(bus_setup_intr, 	sbus_setup_intr),
+	DEVMETHOD(bus_teardown_intr,	bus_generic_teardown_intr),
 	DEVMETHOD(bus_get_resource,	bus_generic_rl_get_resource),
+	DEVMETHOD(bus_get_resource_list, sbus_get_resource_list),
 	DEVMETHOD(bus_get_dma_tag,	sbus_get_dma_tag),
-	DEVMETHOD(bus_child_pnpinfo_str, ofw_bus_gen_child_pnpinfo_str),
 
 	/* ofw_bus interface */
 	DEVMETHOD(ofw_bus_get_devinfo,	sbus_get_devinfo),
@@ -236,7 +235,7 @@ static device_method_t sbus_methods[] = 
 	DEVMETHOD(ofw_bus_get_node,	ofw_bus_gen_get_node),
 	DEVMETHOD(ofw_bus_get_type,	ofw_bus_gen_get_type),
 
-	{ 0, 0 }
+	KOBJMETHOD_END
 };
 
 static driver_t sbus_driver = {
@@ -266,14 +265,14 @@ struct sbus_icarg {
 	bus_addr_t		sica_clr;
 };
 
-static const char *sbus_order_first[] = {
+static const char *const sbus_order_first[] = {
 	"auxio",
 	"dma",
 	NULL
 };
 
 static int
-sbus_inlist(const char *name, const char **list)
+sbus_inlist(const char *name, const char *const *list)
 {
 	int i;
 
@@ -313,32 +312,33 @@ sbus_attach(device_t dev)
 	bus_size_t size;
 	u_long vec;
 	phandle_t child, node;
-	int clock, i, intr, rid;
+	uint32_t prop;
+	int i, j;
 
 	sc = device_get_softc(dev);
 	sc->sc_dev = dev;
 	node = ofw_bus_get_node(dev);
 
-	rid = 0;
-	sc->sc_sysio_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid,
+	i = 0;
+	sc->sc_sysio_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &i,
 	    RF_ACTIVE);
 	if (sc->sc_sysio_res == NULL)
 		panic("%s: cannot allocate device memory", __func__);
 
-	if (OF_getprop(node, "interrupts", &intr, sizeof(intr)) == -1)
+	if (OF_getprop(node, "interrupts", &prop, sizeof(prop)) == -1)
 		panic("%s: cannot get IGN", __func__);
-	sc->sc_ign = INTIGN(intr);
+	sc->sc_ign = INTIGN(prop);
 	sc->sc_cbustag = sbus_alloc_bustag(sc);
 
 	/*
 	 * Record clock frequency for synchronous SCSI.
 	 * IS THIS THE CORRECT DEFAULT??
 	 */
-	if (OF_getprop(node, "clock-frequency", &clock, sizeof(clock)) == -1)
-		clock = 25000000;
-	sc->sc_clockfreq = clock;
-	clock /= 1000;
-	device_printf(dev, "clock %d.%03d MHz\n", clock / 1000, clock % 1000);
+	if (OF_getprop(node, "clock-frequency", &prop, sizeof(prop)) == -1)
+		prop = 25000000;
+	sc->sc_clockfreq = prop;
+	prop /= 1000;
+	device_printf(dev, "clock %d.%03d MHz\n", prop / 1000, prop % 1000);
 
 	/*
 	 * Collect address translations from the OBP.
@@ -362,9 +362,9 @@ sbus_attach(device_t dev)
 		sc->sc_rd[i].rd_slot = range[i].cspace;
 		sc->sc_rd[i].rd_coffset = range[i].coffset;
 		sc->sc_rd[i].rd_cend = sc->sc_rd[i].rd_coffset + size;
-		rid = resource_list_add_next(rl, SYS_RES_MEMORY, phys,
+		j = resource_list_add_next(rl, SYS_RES_MEMORY, phys,
 		    phys + size - 1, size);
-		if ((res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid,
+		if ((res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &j,
 		    RF_ACTIVE)) == NULL)
 			panic("%s: cannot allocate decoded range", __func__);
 		sc->sc_rd[i].rd_bushandle = rman_get_bushandle(res);
@@ -381,11 +381,12 @@ sbus_attach(device_t dev)
 
 	/*
 	 * Get the SBus burst transfer size if burst transfers are supported.
-	 * XXX: is the default correct?
 	 */
-	if (OF_getprop(node, "burst-sizes", &sc->sc_burst,
+	if (OF_getprop(node, "up-burst-sizes", &sc->sc_burst,
 	    sizeof(sc->sc_burst)) == -1 || sc->sc_burst == 0)
-		sc->sc_burst = SBUS_BURST_DEF;
+		sc->sc_burst =
+		    (SBUS_BURST64_DEF << SBUS_BURST64_SHIFT) | SBUS_BURST_DEF;
+
 
 	/* initalise the IOMMU */
 
@@ -421,6 +422,7 @@ sbus_attach(device_t dev)
  	/*
 	 * Hunt through all the interrupt mapping regs and register our
 	 * interrupt controller for the corresponding interrupt vectors.
+	 * We do this early in order to be able to catch stray interrupts.
 	 */
 	for (i = 0; i <= SBUS_MAX_INO; i++) {
 		if (sbus_find_intrmap(sc, i, &intrmap, &intrclr) == 0)
@@ -439,31 +441,32 @@ sbus_attach(device_t dev)
 		    (u_long)intrmap, (u_long)SYSIO_READ8(sc, intrmap),
 		    (u_long)intrclr);
 #endif
-		if (intr_controller_register(INTMAP_VEC(sc->sc_ign, i),
-		    &sbus_ic, sica) != 0)
-			panic("%s: could not register interrupt controller "
-			    "for INO %d", __func__, i);
+		j = intr_controller_register(INTMAP_VEC(sc->sc_ign, i),
+		    &sbus_ic, sica);
+		if (j != 0)
+			device_printf(dev, "could not register interrupt "
+			    "controller for INO %d (%d)\n", i, j);
 	}
 
 	/* Enable the over-temperature and power-fail interrupts. */
-	rid = 4;
-	sc->sc_ot_ires = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid,
+	i = 4;
+	sc->sc_ot_ires = bus_alloc_resource_any(dev, SYS_RES_IRQ, &i,
 	    RF_ACTIVE);
 	if (sc->sc_ot_ires == NULL ||
 	    INTIGN(vec = rman_get_start(sc->sc_ot_ires)) != sc->sc_ign ||
 	    INTVEC(SYSIO_READ8(sc, SBR_THERM_INT_MAP)) != vec ||
 	    intr_vectors[vec].iv_ic != &sbus_ic ||
-	    bus_setup_intr(dev, sc->sc_ot_ires, INTR_TYPE_MISC,
+	    bus_setup_intr(dev, sc->sc_ot_ires, INTR_TYPE_MISC | INTR_FAST,
 	    NULL, sbus_overtemp, sc, &sc->sc_ot_ihand) != 0)
 		panic("%s: failed to set up temperature interrupt", __func__);
-	rid = 3;
-	sc->sc_pf_ires = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid,
+	i = 3;
+	sc->sc_pf_ires = bus_alloc_resource_any(dev, SYS_RES_IRQ, &i,
 	    RF_ACTIVE);
 	if (sc->sc_pf_ires == NULL ||
 	    INTIGN(vec = rman_get_start(sc->sc_pf_ires)) != sc->sc_ign ||
 	    INTVEC(SYSIO_READ8(sc, SBR_POWER_INT_MAP)) != vec ||
 	    intr_vectors[vec].iv_ic != &sbus_ic ||
-	    bus_setup_intr(dev, sc->sc_pf_ires, INTR_TYPE_MISC,
+	    bus_setup_intr(dev, sc->sc_pf_ires, INTR_TYPE_MISC | INTR_FAST,
 	    NULL, sbus_pwrfail, sc, &sc->sc_pf_ihand) != 0)
 		panic("%s: failed to set up power fail interrupt", __func__);
 
@@ -849,8 +852,8 @@ sbus_activate_resource(device_t bus, dev
 	}
 	if (type == SYS_RES_MEMORY) {
 		/*
-		 * Need to memory-map the device space, as some drivers depend
-		 * on the virtual address being set and useable.
+		 * Need to memory-map the device space, as some drivers
+		 * depend on the virtual address being set and usable.
 		 */
 		error = sparc64_bus_mem_map(rman_get_bustag(r),
 		    rman_get_bushandle(r), rman_get_size(r), 0, 0, &p);

Modified: head/sys/sparc64/sbus/sbusvar.h
==============================================================================
--- head/sys/sparc64/sbus/sbusvar.h	Thu Mar 19 20:57:59 2009	(r190111)
+++ head/sys/sparc64/sbus/sbusvar.h	Thu Mar 19 21:02:36 2009	(r190112)
@@ -77,7 +77,7 @@
  */
 
 #ifndef _SPARC64_SBUS_SBUSVAR_H_
-#define _SPARC64_SBUS_SBUSVAR_H_
+#define	_SPARC64_SBUS_SBUSVAR_H_
 
 /*
  * Macros for probe order
@@ -88,18 +88,24 @@
 /*
  * PROM-reported DMA burst sizes for the SBus
  */
-#define SBUS_BURST_1	0x1
-#define SBUS_BURST_2	0x2
-#define SBUS_BURST_4	0x4
-#define SBUS_BURST_8	0x8
-#define SBUS_BURST_16	0x10
-#define SBUS_BURST_32	0x20
-#define SBUS_BURST_64	0x40
+#define	SBUS_BURST_1		(1 << 0)
+#define	SBUS_BURST_2		(1 << 1)
+#define	SBUS_BURST_4		(1 << 2)
+#define	SBUS_BURST_8		(1 << 3)
+#define	SBUS_BURST_16		(1 << 4)
+#define	SBUS_BURST_32		(1 << 5)
+#define	SBUS_BURST_64		(1 << 6)
+#define	SBUS_BURST_MASK		((1 << SBUS_BURST_SIZE) - 1)
+#define	SBUS_BURST_SIZE		16
+#define	SBUS_BURST64_MASK	(SBUS_BURST_MASK << SBUS_BURST64_SHIFT)
+#define	SBUS_BURST64_SHIFT	16
 
 /* Used if no burst sizes are specified for the bus. */
 #define	SBUS_BURST_DEF \
 	(SBUS_BURST_1 | SBUS_BURST_2 | SBUS_BURST_4 | SBUS_BURST_8 | 	\
-	SBUS_BURST_16)
+	SBUS_BURST_16 | SBUS_BURST_32 | SBUS_BURST_64)
+#define	SBUS_BURST64_DEF \
+	(SBUS_BURST_8 | SBUS_BURST_16 | SBUS_BURST_32 | SBUS_BURST_64)
 
 enum sbus_device_ivars {
 	SBUS_IVAR_BURSTSZ,
@@ -111,7 +117,7 @@ enum sbus_device_ivars {
 /*
  * Simplified accessors for sbus devices
  */
-#define SBUS_ACCESSOR(var, ivar, type) \
+#define	SBUS_ACCESSOR(var, ivar, type) \
 	__BUS_ACCESSOR(sbus, var, SBUS, ivar, type)
 
 SBUS_ACCESSOR(burstsz,		BURSTSZ,	int)

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 19 21:12:44 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7799E106566C;
	Thu, 19 Mar 2009 21:12:44 +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 6526A8FC17;
	Thu, 19 Mar 2009 21:12:44 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2JLCiGU076249;
	Thu, 19 Mar 2009 21:12:44 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JLCiGs076248;
	Thu, 19 Mar 2009 21:12:44 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <200903192112.n2JLCiGs076248@svn.freebsd.org>
From: Marius Strobl 
Date: Thu, 19 Mar 2009 21:12: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: r190113 - head/sys/sparc64/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: Thu, 19 Mar 2009 21:12:45 -0000

Author: marius
Date: Thu Mar 19 21:12:44 2009
New Revision: 190113
URL: http://svn.freebsd.org/changeset/base/190113

Log:
  Bring the implementation of the pnpinfo string function more in
  line with the rest of this file.

Modified:
  head/sys/sparc64/pci/ofw_pcibus.c

Modified: head/sys/sparc64/pci/ofw_pcibus.c
==============================================================================
--- head/sys/sparc64/pci/ofw_pcibus.c	Thu Mar 19 21:02:36 2009	(r190112)
+++ head/sys/sparc64/pci/ofw_pcibus.c	Thu Mar 19 21:12:44 2009	(r190113)
@@ -68,8 +68,7 @@ static device_probe_t ofw_pcibus_probe;
 static device_attach_t ofw_pcibus_attach;
 static pci_assign_interrupt_t ofw_pcibus_assign_interrupt;
 static ofw_bus_get_devinfo_t ofw_pcibus_get_devinfo;
-static int ofw_pcibus_child_pnpinfo_str_method(device_t cbdev, device_t child, 
-    char *buf, size_t buflen);
+static bus_child_pnpinfo_str_t ofw_pcibus_pnpinfo_str;
 
 static device_method_t ofw_pcibus_methods[] = {
 	/* Device interface */
@@ -77,7 +76,7 @@ static device_method_t ofw_pcibus_method
 	DEVMETHOD(device_attach,	ofw_pcibus_attach),
 
 	/* Bus interface */
-	DEVMETHOD(bus_child_pnpinfo_str, ofw_pcibus_child_pnpinfo_str_method),
+	DEVMETHOD(bus_child_pnpinfo_str, ofw_pcibus_pnpinfo_str),
 
 	/* PCI interface */
 	DEVMETHOD(pci_assign_interrupt, ofw_pcibus_assign_interrupt),
@@ -306,16 +305,15 @@ ofw_pcibus_get_devinfo(device_t bus, dev
 }
 
 static int
-ofw_pcibus_child_pnpinfo_str_method(device_t cbdev, device_t child, char *buf,
+ofw_pcibus_pnpinfo_str(device_t dev, device_t child, char *buf,
     size_t buflen)
 {
-	pci_child_pnpinfo_str_method(cbdev, child, buf, buflen);
 
+	pci_child_pnpinfo_str_method(dev, child, buf, buflen);
 	if (ofw_bus_get_node(child) != -1)  {
-		strlcat(buf, " ", buflen); /* Separate info */
-		ofw_bus_gen_child_pnpinfo_str(cbdev, child, buf, buflen);
+		strlcat(buf, " ", buflen); /* Separate info. */
+		ofw_bus_gen_child_pnpinfo_str(dev, child, buf, buflen);
 	}
 
 	return (0);
 }
-

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 19 21:14:45 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9B3C01065686;
	Thu, 19 Mar 2009 21:14:45 +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 884E88FC08;
	Thu, 19 Mar 2009 21:14:45 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2JLEjFD076327;
	Thu, 19 Mar 2009 21:14:45 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JLEjE1076322;
	Thu, 19 Mar 2009 21:14:45 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <200903192114.n2JLEjE1076322@svn.freebsd.org>
From: Marius Strobl 
Date: Thu, 19 Mar 2009 21: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: r190114 - in head/sys/sparc64: central fhc sbus sparc64
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 19 Mar 2009 21:14:46 -0000

Author: marius
Date: Thu Mar 19 21:14:45 2009
New Revision: 190114
URL: http://svn.freebsd.org/changeset/base/190114

Log:
  Hook up the generic OFW pnpinfo string method.

Modified:
  head/sys/sparc64/central/central.c
  head/sys/sparc64/fhc/fhc.c
  head/sys/sparc64/sbus/dma_sbus.c
  head/sys/sparc64/sbus/sbus.c
  head/sys/sparc64/sparc64/upa.c

Modified: head/sys/sparc64/central/central.c
==============================================================================
--- head/sys/sparc64/central/central.c	Thu Mar 19 21:12:44 2009	(r190113)
+++ head/sys/sparc64/central/central.c	Thu Mar 19 21:14:45 2009	(r190114)
@@ -84,6 +84,7 @@ static device_method_t central_methods[]
 	DEVMETHOD(bus_teardown_intr,	bus_generic_teardown_intr),
 	DEVMETHOD(bus_get_resource,	bus_generic_rl_get_resource),
 	DEVMETHOD(bus_get_resource_list, central_get_resource_list),
+	DEVMETHOD(bus_child_pnpinfo_str, ofw_bus_gen_child_pnpinfo_str),
 
 	/* ofw_bus interface */
 	DEVMETHOD(ofw_bus_get_devinfo,	central_get_devinfo),

Modified: head/sys/sparc64/fhc/fhc.c
==============================================================================
--- head/sys/sparc64/fhc/fhc.c	Thu Mar 19 21:12:44 2009	(r190113)
+++ head/sys/sparc64/fhc/fhc.c	Thu Mar 19 21:14:45 2009	(r190114)
@@ -98,6 +98,7 @@ static device_method_t fhc_methods[] = {
 	DEVMETHOD(bus_teardown_intr,	bus_generic_teardown_intr),
 	DEVMETHOD(bus_get_resource,	bus_generic_rl_get_resource),
 	DEVMETHOD(bus_get_resource_list, fhc_get_resource_list),
+	DEVMETHOD(bus_child_pnpinfo_str, ofw_bus_gen_child_pnpinfo_str),
 
 	/* ofw_bus interface */
 	DEVMETHOD(ofw_bus_get_devinfo,	fhc_get_devinfo),

Modified: head/sys/sparc64/sbus/dma_sbus.c
==============================================================================
--- head/sys/sparc64/sbus/dma_sbus.c	Thu Mar 19 21:12:44 2009	(r190113)
+++ head/sys/sparc64/sbus/dma_sbus.c	Thu Mar 19 21:14:45 2009	(r190114)
@@ -130,6 +130,7 @@ static device_method_t dma_methods[] = {
 	DEVMETHOD(bus_teardown_intr,	bus_generic_teardown_intr),
 	DEVMETHOD(bus_get_resource,	bus_generic_rl_get_resource),
 	DEVMETHOD(bus_get_resource_list, dma_get_resource_list),
+	DEVMETHOD(bus_child_pnpinfo_str, ofw_bus_gen_child_pnpinfo_str),
 
 	/* ofw_bus interface */
 	DEVMETHOD(ofw_bus_get_devinfo,	dma_get_devinfo),

Modified: head/sys/sparc64/sbus/sbus.c
==============================================================================
--- head/sys/sparc64/sbus/sbus.c	Thu Mar 19 21:12:44 2009	(r190113)
+++ head/sys/sparc64/sbus/sbus.c	Thu Mar 19 21:14:45 2009	(r190114)
@@ -225,6 +225,7 @@ static device_method_t sbus_methods[] = 
 	DEVMETHOD(bus_teardown_intr,	bus_generic_teardown_intr),
 	DEVMETHOD(bus_get_resource,	bus_generic_rl_get_resource),
 	DEVMETHOD(bus_get_resource_list, sbus_get_resource_list),
+	DEVMETHOD(bus_child_pnpinfo_str, ofw_bus_gen_child_pnpinfo_str),
 	DEVMETHOD(bus_get_dma_tag,	sbus_get_dma_tag),
 
 	/* ofw_bus interface */

Modified: head/sys/sparc64/sparc64/upa.c
==============================================================================
--- head/sys/sparc64/sparc64/upa.c	Thu Mar 19 21:12:44 2009	(r190113)
+++ head/sys/sparc64/sparc64/upa.c	Thu Mar 19 21:14:45 2009	(r190114)
@@ -135,6 +135,7 @@ static device_method_t upa_methods[] = {
 	DEVMETHOD(bus_teardown_intr,	bus_generic_teardown_intr),
 	DEVMETHOD(bus_get_resource,	bus_generic_rl_get_resource),
 	DEVMETHOD(bus_get_resource_list, upa_get_resource_list),
+	DEVMETHOD(bus_child_pnpinfo_str, ofw_bus_gen_child_pnpinfo_str),
 
 	/* ofw_bus interface */
 	DEVMETHOD(ofw_bus_get_devinfo,	upa_get_devinfo),

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 19 22:34:56 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 57B53106566B;
	Thu, 19 Mar 2009 22:34:56 +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 45E818FC13;
	Thu, 19 Mar 2009 22:34:56 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2JMYu5O078586;
	Thu, 19 Mar 2009 22:34:56 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JMYu2g078584;
	Thu, 19 Mar 2009 22:34:56 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <200903192234.n2JMYu2g078584@svn.freebsd.org>
From: Marius Strobl 
Date: Thu, 19 Mar 2009 22:34: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: r190117 - head/sys/dev/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: Thu, 19 Mar 2009 22:34:56 -0000

Author: marius
Date: Thu Mar 19 22:34:55 2009
New Revision: 190117
URL: http://svn.freebsd.org/changeset/base/190117

Log:
  - Set MIIF_NOLOOP and don't add IFM_LOOP as loopback apparently isn't
    supported with these pseudo-PHYs. The MIIF_NOLOOP flag currently triggers
    nothing but hopefully will be respected by mii_phy_setmedia() later on.
  - Don't add IFM_NONE as isolation isn't supported by these pseudo-PHYs.
  - Use mii_phy_add_media() instead of mii_add_media() so the latter can
    be eventually retired.

Modified:
  head/sys/dev/dc/dcphy.c
  head/sys/dev/dc/pnphy.c

Modified: head/sys/dev/dc/dcphy.c
==============================================================================
--- head/sys/dev/dc/dcphy.c	Thu Mar 19 22:01:19 2009	(r190116)
+++ head/sys/dev/dc/dcphy.c	Thu Mar 19 22:34:55 2009	(r190117)
@@ -154,13 +154,12 @@ dcphy_attach(device_t dev)
 	sc->mii_service = dcphy_service;
 	sc->mii_pdata = mii;
 
-	sc->mii_flags |= MIIF_NOISOLATE;
-	mii->mii_instance++;
-
-#define	ADD(m, c)	ifmedia_add(&mii->mii_media, (m), (c), NULL)
+	/*
+	 * Apparently, we can neither isolate nor do loopback.
+	 */
+	sc->mii_flags |= MIIF_NOISOLATE | MIIF_NOLOOP;
 
-	ADD(IFM_MAKEWORD(IFM_ETHER, IFM_NONE, 0, sc->mii_inst),
-	    BMCR_ISO);
+	mii->mii_instance++;
 
 	/*dcphy_reset(sc);*/
 	dc_sc = mii->mii_ifp->if_softc;
@@ -186,9 +185,8 @@ dcphy_attach(device_t dev)
 
 	sc->mii_capabilities &= ma->mii_capmask;
 	device_printf(dev, " ");
-	mii_add_media(sc);
+	mii_phy_add_media(sc);
 	printf("\n");
-#undef ADD
 
 	MIIBUS_MEDIAINIT(sc->mii_dev);
 	return (0);

Modified: head/sys/dev/dc/pnphy.c
==============================================================================
--- head/sys/dev/dc/pnphy.c	Thu Mar 19 22:01:19 2009	(r190116)
+++ head/sys/dev/dc/pnphy.c	Thu Mar 19 22:34:55 2009	(r190117)
@@ -137,24 +137,19 @@ pnphy_attach(device_t dev)
 	sc->mii_service = pnphy_service;
 	sc->mii_pdata = mii;
 
-	sc->mii_flags |= MIIF_NOISOLATE;
-	mii->mii_instance++;
+	/*
+	 * Apparently, we can neither isolate nor do loopback.
+	 */
+	sc->mii_flags |= MIIF_NOISOLATE | MIIF_NOLOOP;
 
-#define	ADD(m, c)	ifmedia_add(&mii->mii_media, (m), (c), NULL)
+	mii->mii_instance++;
 
 	sc->mii_capabilities =
 	    BMSR_100TXFDX | BMSR_100TXHDX | BMSR_10TFDX | BMSR_10THDX;
 	sc->mii_capabilities &= ma->mii_capmask;
 	device_printf(dev, " ");
-	mii_add_media(sc);
+	mii_phy_add_media(sc);
 	printf("\n");
-	ADD(IFM_MAKEWORD(IFM_ETHER, IFM_NONE, 0, sc->mii_inst),
-	    BMCR_ISO);
-
-	ADD(IFM_MAKEWORD(IFM_ETHER, IFM_100_TX, IFM_LOOP, sc->mii_inst),
-	    BMCR_LOOP|BMCR_S100);
-
-#undef ADD
 
 	MIIBUS_MEDIAINIT(sc->mii_dev);
 	return (0);

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 20 00:06:53 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D90271065675;
	Fri, 20 Mar 2009 00:06:53 +0000 (UTC) (envelope-from xcllnt@mac.com)
Received: from asmtpout021.mac.com (asmtpout021.mac.com [17.148.16.96])
	by mx1.freebsd.org (Postfix) with ESMTP id C2D6A8FC14;
	Fri, 20 Mar 2009 00:06:53 +0000 (UTC) (envelope-from xcllnt@mac.com)
MIME-version: 1.0
Content-transfer-encoding: 7BIT
Content-type: text/plain; charset=US-ASCII; format=flowed; delsp=yes
Received: from andyhong-t61.jnpr.net (natint3.juniper.net [66.129.224.36])
	by asmtp021.mac.com
	(Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008;
	32bit)) with ESMTPSA id <0KGS004MD2ZGB560@asmtp021.mac.com>; Thu,
	19 Mar 2009 17:06:53 -0700 (PDT)
Message-id: <31910B64-3437-4C1D-8234-FC6A1C3D4F8B@mac.com>
From: Marcel Moolenaar 
To: Marius Strobl 
In-reply-to: <200903192040.n2JKeoYY075200@svn.freebsd.org>
Date: Thu, 19 Mar 2009 17:06:52 -0700
References: <200903192040.n2JKeoYY075200@svn.freebsd.org>
X-Mailer: Apple Mail (2.930.3)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r190105 - head/sys/sparc64/sparc64
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 20 Mar 2009 00:06:54 -0000


On Mar 19, 2009, at 1:40 PM, Marius Strobl wrote:

> Author: marius
> Date: Thu Mar 19 20:40:49 2009
> New Revision: 190105
> URL: http://svn.freebsd.org/changeset/base/190105
>
> Log:
>  There's no need to wrap kdb_enter() in #ifdef KDB as it's always  
> available.

That's not quite how it works.

option KDB is used to build the kernel with debugging features
that could impact performance, security and/or functionality.
In this case it's not so much a matter of whether kdb_enter()
is defined or not, but rather whether the kernel should respect
-d.

-- 
Marcel Moolenaar
xcllnt@mac.com




From owner-svn-src-head@FreeBSD.ORG  Fri Mar 20 04:48:28 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 44E571065690;
	Fri, 20 Mar 2009 04:48:28 +0000 (UTC)
	(envelope-from rnoland@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 32A8A8FC0C;
	Fri, 20 Mar 2009 04:48:28 +0000 (UTC)
	(envelope-from rnoland@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2K4mSfs086166;
	Fri, 20 Mar 2009 04:48:28 GMT (envelope-from rnoland@svn.freebsd.org)
Received: (from rnoland@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2K4mSYO086165;
	Fri, 20 Mar 2009 04:48:28 GMT (envelope-from rnoland@svn.freebsd.org)
Message-Id: <200903200448.n2K4mSYO086165@svn.freebsd.org>
From: Robert Noland 
Date: Fri, 20 Mar 2009 04:48:28 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190123 - head/sys/dev/drm
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 20 Mar 2009 04:48:29 -0000

Author: rnoland
Date: Fri Mar 20 04:48:27 2009
New Revision: 190123
URL: http://svn.freebsd.org/changeset/base/190123

Log:
  Adjust the flags to bus_dmamem around here too.
  
  MFC after:	3 days

Modified:
  head/sys/dev/drm/ati_pcigart.c

Modified: head/sys/dev/drm/ati_pcigart.c
==============================================================================
--- head/sys/dev/drm/ati_pcigart.c	Fri Mar 20 03:10:12 2009	(r190122)
+++ head/sys/dev/drm/ati_pcigart.c	Fri Mar 20 04:48:27 2009	(r190123)
@@ -75,18 +75,15 @@ drm_ati_alloc_pcigart_table(struct drm_d
 	    NULL, NULL, /* filtfunc, filtfuncargs */
 	    gart_info->table_size, 1, /* maxsize, nsegs */
 	    gart_info->table_size, /* maxsegsize */
-	    BUS_DMA_ALLOCNOW, NULL, NULL, /* flags, lockfunc, lockfuncargs */
+	    0, NULL, NULL, /* flags, lockfunc, lockfuncargs */
 	    &dmah->tag);
 	if (ret != 0) {
 		free(dmah, DRM_MEM_DMA);
 		return ENOMEM;
 	}
 
-	flags = BUS_DMA_NOWAIT | BUS_DMA_ZERO;
-	if (gart_info->gart_reg_if == DRM_ATI_GART_IGP)
-	    flags |= BUS_DMA_NOCACHE;
-	
-	ret = bus_dmamem_alloc(dmah->tag, &dmah->vaddr, flags, &dmah->map);
+	ret = bus_dmamem_alloc(dmah->tag, &dmah->vaddr,
+	    BUS_DMA_WAITOK | BUS_DMA_ZERO, &dmah->map);
 	if (ret != 0) {
 		bus_dma_tag_destroy(dmah->tag);
 		free(dmah, DRM_MEM_DMA);
@@ -94,8 +91,12 @@ drm_ati_alloc_pcigart_table(struct drm_d
 	}
 	DRM_LOCK();
 
+	flags = BUS_DMA_NOWAIT;
+	if (gart_info->gart_reg_if == DRM_ATI_GART_IGP)
+	    flags |= BUS_DMA_NOCACHE;
+	
 	ret = bus_dmamap_load(dmah->tag, dmah->map, dmah->vaddr,
-	    gart_info->table_size, drm_ati_alloc_pcigart_table_cb, dmah, 0);
+	    gart_info->table_size, drm_ati_alloc_pcigart_table_cb, dmah, flags);
 	if (ret != 0) {
 		bus_dmamem_free(dmah->tag, dmah->vaddr, dmah->map);
 		bus_dma_tag_destroy(dmah->tag);

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 20 04:49:49 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 50D561065670;
	Fri, 20 Mar 2009 04:49:49 +0000 (UTC)
	(envelope-from rnoland@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 3F13F8FC0A;
	Fri, 20 Mar 2009 04:49:49 +0000 (UTC)
	(envelope-from rnoland@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2K4nn08086229;
	Fri, 20 Mar 2009 04:49:49 GMT (envelope-from rnoland@svn.freebsd.org)
Received: (from rnoland@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2K4nnOt086228;
	Fri, 20 Mar 2009 04:49:49 GMT (envelope-from rnoland@svn.freebsd.org)
Message-Id: <200903200449.n2K4nnOt086228@svn.freebsd.org>
From: Robert Noland 
Date: Fri, 20 Mar 2009 04:49: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: r190124 - head/sys/dev/drm
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 20 Mar 2009 04:49:49 -0000

Author: rnoland
Date: Fri Mar 20 04:49:48 2009
New Revision: 190124
URL: http://svn.freebsd.org/changeset/base/190124

Log:
  Add a couple of radeon pci ids.
  
  MFC after:	3 days

Modified:
  head/sys/dev/drm/drm_pciids.h

Modified: head/sys/dev/drm/drm_pciids.h
==============================================================================
--- head/sys/dev/drm/drm_pciids.h	Fri Mar 20 04:48:27 2009	(r190123)
+++ head/sys/dev/drm/drm_pciids.h	Fri Mar 20 04:49:48 2009	(r190124)
@@ -320,6 +320,8 @@
 	{0x1002, 0x9612, CHIP_RS780|RADEON_NEW_MEMMAP|RADEON_IS_IGP, "ATI Radeon HD 3200 Graphics"}, \
 	{0x1002, 0x9613, CHIP_RS780|RADEON_NEW_MEMMAP|RADEON_IS_IGP, "ATI Radeon 3100 Graphics"}, \
 	{0x1002, 0x9614, CHIP_RS780|RADEON_NEW_MEMMAP|RADEON_IS_IGP, "ATI Radeon 3300 Graphics"}, \
+	{0x1002, 0x9615, CHIP_RS780|RADEON_NEW_MEMMAP|RADEON_IS_IGP, "ATI Radeon 3200 Graphics"}, \
+	{0x1002, 0x9616, CHIP_RS780|RADEON_NEW_MEMMAP|RADEON_IS_IGP, "ATI Radeon 3000 Graphics"}, \
 	{0x1002, 0x9440, CHIP_RV770|RADEON_NEW_MEMMAP, "ATI Radeon 4800 Series"}, \
 	{0x1002, 0x9441, CHIP_RV770|RADEON_NEW_MEMMAP, "ATI Radeon 4870 X2"}, \
 	{0x1002, 0x9442, CHIP_RV770|RADEON_NEW_MEMMAP, "ATI Radeon 4800 Series"}, \

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 20 04:53:12 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id F0678106564A;
	Fri, 20 Mar 2009 04:53:12 +0000 (UTC)
	(envelope-from rnoland@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id DECE98FC18;
	Fri, 20 Mar 2009 04:53:12 +0000 (UTC)
	(envelope-from rnoland@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2K4rCQl086319;
	Fri, 20 Mar 2009 04:53:12 GMT (envelope-from rnoland@svn.freebsd.org)
Received: (from rnoland@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2K4rCdY086318;
	Fri, 20 Mar 2009 04:53:12 GMT (envelope-from rnoland@svn.freebsd.org)
Message-Id: <200903200453.n2K4rCdY086318@svn.freebsd.org>
From: Robert Noland 
Date: Fri, 20 Mar 2009 04:53: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: r190125 - head/sys/dev/drm
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 20 Mar 2009 04:53:13 -0000

Author: rnoland
Date: Fri Mar 20 04:53:12 2009
New Revision: 190125
URL: http://svn.freebsd.org/changeset/base/190125

Log:
  Only issue the wakeup and store the counter if vblank is enabled on
  the pipe.
  
  MFC after:	3 days

Modified:
  head/sys/dev/drm/drm_irq.c

Modified: head/sys/dev/drm/drm_irq.c
==============================================================================
--- head/sys/dev/drm/drm_irq.c	Fri Mar 20 04:49:48 2009	(r190124)
+++ head/sys/dev/drm/drm_irq.c	Fri Mar 20 04:53:12 2009	(r190125)
@@ -210,10 +210,12 @@ int drm_irq_uninstall(struct drm_device 
 	*/
 	DRM_SPINLOCK(&dev->vbl_lock);
 	for (crtc = 0; crtc < dev->num_crtcs; crtc++) {
-		DRM_WAKEUP(&dev->vblank[crtc].queue);
-		dev->vblank[crtc].enabled = 0;
-		dev->vblank[crtc].last =
-		    dev->driver->get_vblank_counter(dev, crtc);
+		if (dev->vblank[crtc].enabled) {
+			DRM_WAKEUP(&dev->vblank[crtc].queue);
+			dev->vblank[crtc].enabled = 0;
+			dev->vblank[crtc].last =
+		    	    dev->driver->get_vblank_counter(dev, crtc);
+		}
 	}
 	DRM_SPINUNLOCK(&dev->vbl_lock);
 

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 20 05:21:29 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id F0168106564A;
	Fri, 20 Mar 2009 05:21:29 +0000 (UTC)
	(envelope-from nyan@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id DE0558FC15;
	Fri, 20 Mar 2009 05:21:29 +0000 (UTC)
	(envelope-from nyan@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2K5LTOI086921;
	Fri, 20 Mar 2009 05:21:29 GMT (envelope-from nyan@svn.freebsd.org)
Received: (from nyan@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2K5LTlB086920;
	Fri, 20 Mar 2009 05:21:29 GMT (envelope-from nyan@svn.freebsd.org)
Message-Id: <200903200521.n2K5LTlB086920@svn.freebsd.org>
From: Takahashi Yoshihiro 
Date: Fri, 20 Mar 2009 05:21: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: r190126 - head/sys/boot/pc98/libpc98
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 20 Mar 2009 05:21:30 -0000

Author: nyan
Date: Fri Mar 20 05:21:29 2009
New Revision: 190126
URL: http://svn.freebsd.org/changeset/base/190126

Log:
  MFi386: the part of r179825 to reduce diffs against i386.

Modified:
  head/sys/boot/pc98/libpc98/time.c

Modified: head/sys/boot/pc98/libpc98/time.c
==============================================================================
--- head/sys/boot/pc98/libpc98/time.c	Fri Mar 20 04:53:12 2009	(r190125)
+++ head/sys/boot/pc98/libpc98/time.c	Fri Mar 20 05:21:29 2009	(r190126)
@@ -33,23 +33,21 @@ __FBSDID("$FreeBSD$");
 #include "bootstrap.h"
 #include "libi386.h"
 
+static int	bios_seconds(void);
+
 /*
- * Return the time in seconds since the beginning of the day.
- *
- * If we pass midnight, don't wrap back to 0.
+ * Return the BIOS time-of-day value.
  *
  * XXX uses undocumented BCD support from libstand.
  */
-
-time_t
-time(time_t *t)
+static int
+bios_seconds(void)
 {
-    static time_t	lasttime, now;
     int			hr, minute, sec;
     unsigned char	bios_time[6];
-
+    
     v86.ctl = 0;
-    v86.addr = 0x1c;            /* int 0x1c, function 0 */
+    v86.addr = 0x1c;		/* int 0x1c, function 0 */
     v86.eax = 0x0000;
     v86.es  = VTOPSEG(bios_time);
     v86.ebx = VTOPOFF(bios_time);
@@ -59,7 +57,20 @@ time(time_t *t)
     minute = bcd2bin(bios_time[4]);
     sec = bcd2bin(bios_time[5]);
     
-    now = hr * 3600 + minute * 60 + sec;
+    return (hr * 3600 + minute * 60 + sec);
+}
+
+/*
+ * Return the time in seconds since the beginning of the day.
+ */
+time_t
+time(time_t *t)
+{
+    static time_t lasttime;
+    time_t now;
+
+    now = bios_seconds();
+
     if (now < lasttime)
 	now += 24 * 3600;
     lasttime = now;

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 20 05:33:59 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 381B3106564A;
	Fri, 20 Mar 2009 05:33:59 +0000 (UTC)
	(envelope-from nyan@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 2632C8FC19;
	Fri, 20 Mar 2009 05:33:59 +0000 (UTC)
	(envelope-from nyan@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2K5XwRX087220;
	Fri, 20 Mar 2009 05:33:58 GMT (envelope-from nyan@svn.freebsd.org)
Received: (from nyan@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2K5Xwch087219;
	Fri, 20 Mar 2009 05:33:58 GMT (envelope-from nyan@svn.freebsd.org)
Message-Id: <200903200533.n2K5Xwch087219@svn.freebsd.org>
From: Takahashi Yoshihiro 
Date: Fri, 20 Mar 2009 05:33: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: r190127 - head/sys/boot/pc98/libpc98
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 20 Mar 2009 05:33:59 -0000

Author: nyan
Date: Fri Mar 20 05:33:58 2009
New Revision: 190127
URL: http://svn.freebsd.org/changeset/base/190127

Log:
  Merge the missing changes from i386.
  Teach the loader about the FAT partitions.

Modified:
  head/sys/boot/pc98/libpc98/biosdisk.c

Modified: head/sys/boot/pc98/libpc98/biosdisk.c
==============================================================================
--- head/sys/boot/pc98/libpc98/biosdisk.c	Fri Mar 20 05:21:29 2009	(r190126)
+++ head/sys/boot/pc98/libpc98/biosdisk.c	Fri Mar 20 05:33:58 2009	(r190127)
@@ -269,17 +269,8 @@ bd_print(int verbose)
 
 		/* Check for a "dedicated" disk */
 		for (j = 0; j < od->od_nslices; j++) {
-		    switch(dptr[j].dp_mid) {
-		    case DOSMID_386BSD:
-		        sprintf(line, "      disk%ds%d", i, j + 1);
-			bd_printbsdslice(od,
-			    dptr[j].dp_scyl * od->od_hds * od->od_sec +
-			    dptr[j].dp_shd * od->od_sec + dptr[j].dp_ssect,
-			    line, verbose);
-			break;
-		    default:
-			break;
-		    }
+		    sprintf(line, "      disk%ds%d", i, j + 1);
+		    bd_printslice(od, &dptr[j], line, verbose);
 		}
 	    }
 	    bd_closedisk(od);
@@ -311,6 +302,52 @@ display_size(uint64_t size)
 }
 
 /*
+ * Print information about slices on a disk.  For the size calculations we
+ * assume a 512 byte sector.
+ */
+static void
+bd_printslice(struct open_disk *od, struct pc98_partition *dp, char *prefix,
+	int verbose)
+{
+	int cylsecs, start, size;
+	char stats[80];
+	char line[80];
+
+	cylsecs = od->od_hds * od->od_sec;
+	start = dp->dp_scyl * cylsecs + dp->dp_shd * od->od_sec + dp->dp_ssect;
+	size = (dp->dp_ecyl - dp->dp_scyl + 1) * cylsecs;
+
+	if (verbose)
+		sprintf(stats, " %s (%d - %d)", display_size(size),
+		    start, start + size);
+	else
+		stats[0] = '\0';
+
+	switch(dp->dp_mid & PC98_MID_MASK) {
+	case PC98_MID_386BSD:
+		bd_printbsdslice(od, start, prefix, verbose);
+		return;
+	case 0x00:				/* unused partition */
+		return;
+	case 0x01:
+		sprintf(line, "%s: FAT-12%s\n", prefix, stats);
+		break;
+	case 0x11:
+	case 0x20:
+	case 0x21:
+	case 0x22:
+	case 0x23:
+	case 0x24:
+		sprintf(line, "%s: FAT-16%s\n", prefix, stats);
+		break;
+	default:
+		sprintf(line, "%s: Unknown fs: 0x%x %s\n", prefix, dp->dp_mid,
+		    stats);
+	}
+	pager_output(line);
+}
+
+/*
  * Print out each valid partition in the disklabel of a FreeBSD slice.
  * For size calculations, we assume a 512 byte sector size.
  */
@@ -349,7 +386,7 @@ bd_printbsdslice(struct open_disk *od, d
 
 	    /* Only print out statistics in verbose mode */
 	    if (verbose)
-		sprintf(line, "  %s%c: %s %s (%d - %d)\n", prefix, 'a' + i,
+	        sprintf(line, "  %s%c: %s %s (%d - %d)\n", prefix, 'a' + i,
 		    (lp->d_partitions[i].p_fstype == FS_SWAP) ? "swap " : 
 		    (lp->d_partitions[i].p_fstype == FS_VINUM) ? "vinum" :
 		    "FFS  ",

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 20 09:12:01 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CEE55106566C;
	Fri, 20 Mar 2009 09:12:01 +0000 (UTC)
	(envelope-from vanhu@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id BDB008FC12;
	Fri, 20 Mar 2009 09:12:01 +0000 (UTC)
	(envelope-from vanhu@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2K9C1PQ091836;
	Fri, 20 Mar 2009 09:12:01 GMT (envelope-from vanhu@svn.freebsd.org)
Received: (from vanhu@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2K9C1g3091835;
	Fri, 20 Mar 2009 09:12:01 GMT (envelope-from vanhu@svn.freebsd.org)
Message-Id: <200903200912.n2K9C1g3091835@svn.freebsd.org>
From: VANHULLEBUS Yvan 
Date: Fri, 20 Mar 2009 09:12: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: r190138 - head/sys/netipsec
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 20 Mar 2009 09:12:02 -0000

Author: vanhu
Date: Fri Mar 20 09:12:01 2009
New Revision: 190138
URL: http://svn.freebsd.org/changeset/base/190138

Log:
  Spelling fix in a comment
  
  Approved by:	gnn(mentor)

Modified:
  head/sys/netipsec/key.c

Modified: head/sys/netipsec/key.c
==============================================================================
--- head/sys/netipsec/key.c	Fri Mar 20 09:02:40 2009	(r190137)
+++ head/sys/netipsec/key.c	Fri Mar 20 09:12:01 2009	(r190138)
@@ -4164,7 +4164,7 @@ key_flush_sad(time_t now)
 				/* 
 				 * Actually, only send expire message if SA has been used, as it
 				 * was done before, but should we always send such message, and let IKE
-				 * daemon decide if it should be renegociated or not ?
+				 * daemon decide if it should be renegotiated or not ?
 				 * XXX expire message will actually NOT be sent if SA is only used
 				 * after soft lifetime has been reached, see below (DYING state)
 				 */

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 20 09:25:22 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 736F91065676;
	Fri, 20 Mar 2009 09:25:22 +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 565808FC1D;
	Fri, 20 Mar 2009 09:25:22 +0000 (UTC)
	(envelope-from brueffer@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2K9PMCP092206;
	Fri, 20 Mar 2009 09:25:22 GMT
	(envelope-from brueffer@svn.freebsd.org)
Received: (from brueffer@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2K9PMMN092201;
	Fri, 20 Mar 2009 09:25:22 GMT
	(envelope-from brueffer@svn.freebsd.org)
Message-Id: <200903200925.n2K9PMMN092201@svn.freebsd.org>
From: Christian Brueffer 
Date: Fri, 20 Mar 2009 09:25: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: r190139 - in head/release/doc: en_US.ISO8859-1/hardware
	ja_JP.eucJP/hardware/common ru_RU.KOI8-R/hardware/common
	share/misc zh_CN.GB2312/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: Fri, 20 Mar 2009 09:25:23 -0000

Author: brueffer
Date: Fri Mar 20 09:25:21 2009
New Revision: 190139
URL: http://svn.freebsd.org/changeset/base/190139

Log:
  uscanner(4) has been removed, delete it from the hardware notes to
  fix the build.

Modified:
  head/release/doc/en_US.ISO8859-1/hardware/article.sgml
  head/release/doc/ja_JP.eucJP/hardware/common/dev.sgml
  head/release/doc/ru_RU.KOI8-R/hardware/common/dev.sgml
  head/release/doc/share/misc/dev.archlist.txt
  head/release/doc/zh_CN.GB2312/hardware/article.sgml

Modified: head/release/doc/en_US.ISO8859-1/hardware/article.sgml
==============================================================================
--- head/release/doc/en_US.ISO8859-1/hardware/article.sgml	Fri Mar 20 09:12:01 2009	(r190138)
+++ head/release/doc/en_US.ISO8859-1/hardware/article.sgml	Fri Mar 20 09:25:21 2009	(r190139)
@@ -1468,8 +1468,6 @@
 
       &hwlist.umct;
 
-      &hwlist.uscanner;
-
       &hwlist.umass;
 
       [&arch.amd64;, &arch.i386;, &arch.pc98;] Audio Devices

Modified: head/release/doc/ja_JP.eucJP/hardware/common/dev.sgml
==============================================================================
--- head/release/doc/ja_JP.eucJP/hardware/common/dev.sgml	Fri Mar 20 09:12:01 2009	(r190138)
+++ head/release/doc/ja_JP.eucJP/hardware/common/dev.sgml	Fri Mar 20 09:25:21 2009	(r190139)
@@ -802,8 +802,6 @@
 
     &hwlist.umct;
 
-    &hwlist.uscanner;
-
     &hwlist.umass;
 
     ¥ª¡¼¥Ç¥£¥ª¥Ç¥Ð¥¤¥¹ (&man.uaudio.4; ¥É¥é¥¤¥Ð)

Modified: head/release/doc/ru_RU.KOI8-R/hardware/common/dev.sgml
==============================================================================
--- head/release/doc/ru_RU.KOI8-R/hardware/common/dev.sgml	Fri Mar 20 09:12:01 2009	(r190138)
+++ head/release/doc/ru_RU.KOI8-R/hardware/common/dev.sgml	Fri Mar 20 09:25:21 2009	(r190139)
@@ -816,8 +816,6 @@
 
     &hwlist.umct;
 
-    &hwlist.uscanner;
-
     &hwlist.umass;
 
     áÕÄÉÏ ÕÓÔÒÏÊÓÔ×Á (ÄÒÁÊ×ÅÒ &man.uaudio.4;)

Modified: head/release/doc/share/misc/dev.archlist.txt
==============================================================================
--- head/release/doc/share/misc/dev.archlist.txt	Fri Mar 20 09:12:01 2009	(r190138)
+++ head/release/doc/share/misc/dev.archlist.txt	Fri Mar 20 09:25:21 2009	(r190139)
@@ -162,7 +162,6 @@ umodem	i386,pc98,amd64
 uplcom	i386,pc98,amd64
 ural	i386,amd64
 urio	i386,pc98,amd64,powerpc
-uscanner	i386,pc98,amd64,powerpc
 uvisor	i386,pc98,amd64
 uvscom	i386,pc98,amd64
 vge	i386,pc98,amd64

Modified: head/release/doc/zh_CN.GB2312/hardware/article.sgml
==============================================================================
--- head/release/doc/zh_CN.GB2312/hardware/article.sgml	Fri Mar 20 09:12:01 2009	(r190138)
+++ head/release/doc/zh_CN.GB2312/hardware/article.sgml	Fri Mar 20 09:25:21 2009	(r190139)
@@ -1210,8 +1210,6 @@
 
     &hwlist.umct;
 
-    &hwlist.uscanner;
-
     &hwlist.umass;
 
     [&arch.amd64;, &arch.i386;, &arch.pc98;] ÉùÒôÉ豸 (&man.uaudio.4; Çý¶¯³ÌÐò)

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 20 10:04:00 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C3E20106564A;
	Fri, 20 Mar 2009 10:04:00 +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 B24368FC0A;
	Fri, 20 Mar 2009 10:04:00 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2KA40pt093038;
	Fri, 20 Mar 2009 10:04:00 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2KA40Do093037;
	Fri, 20 Mar 2009 10:04:00 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <200903201004.n2KA40Do093037@svn.freebsd.org>
From: Konstantin Belousov 
Date: Fri, 20 Mar 2009 10:04: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: r190140 - 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, 20 Mar 2009 10:04:01 -0000

Author: kib
Date: Fri Mar 20 10:04:00 2009
New Revision: 190140
URL: http://svn.freebsd.org/changeset/base/190140

Log:
  Remove unneeded braces to reduce used vertical screen space.

Modified:
  head/sys/kern/vfs_cache.c

Modified: head/sys/kern/vfs_cache.c
==============================================================================
--- head/sys/kern/vfs_cache.c	Fri Mar 20 09:25:21 2009	(r190139)
+++ head/sys/kern/vfs_cache.c	Fri Mar 20 10:04:00 2009	(r190140)
@@ -957,9 +957,8 @@ vn_fullpath1(struct thread *td, struct v
 			vp = ncp->nc_dvp;
 		} else {
 			error = vn_vptocnp(&vp, &bp, buf, &buflen);
-			if (error) {
+			if (error)
 				return (error);
-			}
 		}
 		*--bp = '/';
 		buflen--;
@@ -1022,9 +1021,8 @@ vn_fullpath1(struct thread *td, struct v
 			numfullpathfail4++;
 			CACHE_RUNLOCK();
 			return (ENOMEM);
-		} else {
+		} else
 			*--bp = '/';
-		}
 	}
 	numfullpathfound++;
 	CACHE_RUNLOCK();

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 20 10:47:17 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id F2CE5106564A;
	Fri, 20 Mar 2009 10:47:16 +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 E0DEB8FC0A;
	Fri, 20 Mar 2009 10:47:16 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2KAlGSt099826;
	Fri, 20 Mar 2009 10:47:16 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2KAlGej099825;
	Fri, 20 Mar 2009 10:47:16 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <200903201047.n2KAlGej099825@svn.freebsd.org>
From: Konstantin Belousov 
Date: Fri, 20 Mar 2009 10:47:16 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190141 - 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, 20 Mar 2009 10:47:17 -0000

Author: kib
Date: Fri Mar 20 10:47:16 2009
New Revision: 190141
URL: http://svn.freebsd.org/changeset/base/190141

Log:
  When ktracing namei operations, log a result of the __getcwd().
  
  MFC after:	1 week

Modified:
  head/sys/kern/vfs_cache.c

Modified: head/sys/kern/vfs_cache.c
==============================================================================
--- head/sys/kern/vfs_cache.c	Fri Mar 20 10:04:00 2009	(r190140)
+++ head/sys/kern/vfs_cache.c	Fri Mar 20 10:47:16 2009	(r190141)
@@ -35,6 +35,8 @@
 #include 
 __FBSDID("$FreeBSD$");
 
+#include "opt_ktrace.h"
+
 #include 
 #include 
 #include 
@@ -50,6 +52,9 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#ifdef KTRACE
+#include 
+#endif
 
 #include 
 
@@ -807,6 +812,10 @@ kern___getcwd(struct thread *td, u_char 
 			bcopy(bp, buf, strlen(bp) + 1);
 		else
 			error = copyout(bp, buf, strlen(bp) + 1);
+#ifdef KTRACE
+	if (KTRPOINT(curthread, KTR_NAMEI))
+		ktrnamei(bp);
+#endif
 	}
 	free(tmpbuf, M_TEMP);
 	return (error);

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 20 10:59:07 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3F6E51065673;
	Fri, 20 Mar 2009 10:59:07 +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 2D85B8FC0C;
	Fri, 20 Mar 2009 10:59:07 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2KAx678000184;
	Fri, 20 Mar 2009 10:59:06 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2KAx61l000183;
	Fri, 20 Mar 2009 10:59:06 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <200903201059.n2KAx61l000183@svn.freebsd.org>
From: Konstantin Belousov 
Date: Fri, 20 Mar 2009 10:59: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: r190142 - 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, 20 Mar 2009 10:59:08 -0000

Author: kib
Date: Fri Mar 20 10:59:06 2009
New Revision: 190142
URL: http://svn.freebsd.org/changeset/base/190142

Log:
  The nc_nlen member of the struct namecache contains the length of the cached
  name, not the length + 1.
  
  PR:	132620, 132542
  Reported by:	bf2006a yahoo com
  Tested by:	bf2006a, pho
  Reviewed by:	marcus

Modified:
  head/sys/kern/vfs_cache.c

Modified: head/sys/kern/vfs_cache.c
==============================================================================
--- head/sys/kern/vfs_cache.c	Fri Mar 20 10:47:16 2009	(r190141)
+++ head/sys/kern/vfs_cache.c	Fri Mar 20 10:59:06 2009	(r190142)
@@ -997,7 +997,7 @@ vn_fullpath1(struct thread *td, struct v
 		ncp = TAILQ_FIRST(&vp->v_cache_dst);
 		if (ncp != NULL) {
 			MPASS(vp->v_dd == NULL || ncp->nc_dvp == vp->v_dd);
-			buflen -= ncp->nc_nlen - 1;
+			buflen -= ncp->nc_nlen;
 			for (i = ncp->nc_nlen - 1; i >= 0 && bp != buf; i--)
 				*--bp = ncp->nc_name[i];
 			if (bp == buf) {

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 20 11:00:39 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9EE0B106566C;
	Fri, 20 Mar 2009 11:00:39 +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 8D1ED8FC13;
	Fri, 20 Mar 2009 11:00:39 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2KB0dMH000272;
	Fri, 20 Mar 2009 11:00:39 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2KB0dwg000271;
	Fri, 20 Mar 2009 11:00:39 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <200903201100.n2KB0dwg000271@svn.freebsd.org>
From: Konstantin Belousov 
Date: Fri, 20 Mar 2009 11:00: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: r190143 - 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, 20 Mar 2009 11:00:40 -0000

Author: kib
Date: Fri Mar 20 11:00:39 2009
New Revision: 190143
URL: http://svn.freebsd.org/changeset/base/190143

Log:
  Do not forget to adjust buflen for the first resolution of the path
  from namecache.
  While there, compare pointers for equiality.
  
  Reviewed by:	marcus
  Tested by:	pho

Modified:
  head/sys/kern/vfs_cache.c

Modified: head/sys/kern/vfs_cache.c
==============================================================================
--- head/sys/kern/vfs_cache.c	Fri Mar 20 10:59:06 2009	(r190142)
+++ head/sys/kern/vfs_cache.c	Fri Mar 20 11:00:39 2009	(r190143)
@@ -956,7 +956,8 @@ vn_fullpath1(struct thread *td, struct v
 	if (vp->v_type != VDIR) {
 		ncp = TAILQ_FIRST(&vp->v_cache_dst);
 		if (ncp != NULL) {
-			for (i = ncp->nc_nlen - 1; i >= 0 && bp > buf; i--)
+			buflen -= ncp->nc_nlen;
+			for (i = ncp->nc_nlen - 1; i >= 0 && bp != buf; i--)
 				*--bp = ncp->nc_name[i];
 			if (bp == buf) {
 				numfullpathfail4++;

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 20 11:03:55 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D19D1106566B;
	Fri, 20 Mar 2009 11:03:55 +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 C02198FC1C;
	Fri, 20 Mar 2009 11:03:55 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2KB3ti2000362;
	Fri, 20 Mar 2009 11:03:55 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2KB3t8B000361;
	Fri, 20 Mar 2009 11:03:55 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <200903201103.n2KB3t8B000361@svn.freebsd.org>
From: Konstantin Belousov 
Date: Fri, 20 Mar 2009 11:03:55 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190144 - 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, 20 Mar 2009 11:03:56 -0000

Author: kib
Date: Fri Mar 20 11:03:55 2009
New Revision: 190144
URL: http://svn.freebsd.org/changeset/base/190144

Log:
  Remove unneeded braces to reduce used vertical screen space.
  The location was missed in r190140.

Modified:
  head/sys/kern/vfs_cache.c

Modified: head/sys/kern/vfs_cache.c
==============================================================================
--- head/sys/kern/vfs_cache.c	Fri Mar 20 11:00:39 2009	(r190143)
+++ head/sys/kern/vfs_cache.c	Fri Mar 20 11:03:55 2009	(r190144)
@@ -1010,9 +1010,8 @@ vn_fullpath1(struct thread *td, struct v
 			vp = ncp->nc_dvp;
 		} else {
 			error = vn_vptocnp(&vp, &bp, buf, &buflen);
-			if (error) {
+			if (error)
 				break;
-			}
 		}
 		*--bp = '/';
 		buflen--;

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 20 11:08:57 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CC650106566B;
	Fri, 20 Mar 2009 11:08:57 +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 BA6428FC08;
	Fri, 20 Mar 2009 11:08:57 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2KB8vwO000503;
	Fri, 20 Mar 2009 11:08:57 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2KB8vHN000502;
	Fri, 20 Mar 2009 11:08:57 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <200903201108.n2KB8vHN000502@svn.freebsd.org>
From: Konstantin Belousov 
Date: Fri, 20 Mar 2009 11:08: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: r190145 - 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, 20 Mar 2009 11:08:58 -0000

Author: kib
Date: Fri Mar 20 11:08:57 2009
New Revision: 190145
URL: http://svn.freebsd.org/changeset/base/190145

Log:
  Do not underflow the buffer and then report the problem. Check for the
  condition before the buffer write.
  Also, since buflen is unsigned, previous check was ignored.
  
  Reviewed by:	marcus
  Tested by:	pho

Modified:
  head/sys/kern/vfs_cache.c

Modified: head/sys/kern/vfs_cache.c
==============================================================================
--- head/sys/kern/vfs_cache.c	Fri Mar 20 11:03:55 2009	(r190144)
+++ head/sys/kern/vfs_cache.c	Fri Mar 20 11:08:57 2009	(r190145)
@@ -970,13 +970,13 @@ vn_fullpath1(struct thread *td, struct v
 			if (error)
 				return (error);
 		}
-		*--bp = '/';
-		buflen--;
-		if (buflen < 0) {
+		if (buflen <= 0) {
 			numfullpathfail4++;
 			CACHE_RUNLOCK();
 			return (ENOMEM);
 		}
+		*--bp = '/';
+		buflen--;
 		slash_prefixed = 1;
 	}
 	while (vp != rdir && vp != rootvnode) {
@@ -1013,14 +1013,14 @@ vn_fullpath1(struct thread *td, struct v
 			if (error)
 				break;
 		}
-		*--bp = '/';
-		buflen--;
-		if (buflen < 0) {
+		if (buflen <= 0) {
 			numfullpathfail4++;
 			CACHE_RUNLOCK();
 			error = ENOMEM;
 			break;
 		}
+		*--bp = '/';
+		buflen--;
 		slash_prefixed = 1;
 	}
 	if (error)

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 20 12:26:43 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5199D1065674;
	Fri, 20 Mar 2009 12:26:43 +0000 (UTC)
	(envelope-from nyan@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 3E4398FC1B;
	Fri, 20 Mar 2009 12:26:43 +0000 (UTC)
	(envelope-from nyan@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2KCQgNn002040;
	Fri, 20 Mar 2009 12:26:42 GMT (envelope-from nyan@svn.freebsd.org)
Received: (from nyan@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2KCQgBb002039;
	Fri, 20 Mar 2009 12:26:42 GMT (envelope-from nyan@svn.freebsd.org)
Message-Id: <200903201226.n2KCQgBb002039@svn.freebsd.org>
From: Takahashi Yoshihiro 
Date: Fri, 20 Mar 2009 12:26: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: r190146 - head/sys/boot/pc98/libpc98
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 20 Mar 2009 12:26:44 -0000

Author: nyan
Date: Fri Mar 20 12:26:42 2009
New Revision: 190146
URL: http://svn.freebsd.org/changeset/base/190146

Log:
  MFi386: r189749
  
    Teach the BIOS CD driver to use bounce buffers when the destination
    address is > 1 MB.

Modified:
  head/sys/boot/pc98/libpc98/bioscd.c

Modified: head/sys/boot/pc98/libpc98/bioscd.c
==============================================================================
--- head/sys/boot/pc98/libpc98/bioscd.c	Fri Mar 20 11:08:57 2009	(r190145)
+++ head/sys/boot/pc98/libpc98/bioscd.c	Fri Mar 20 12:26:42 2009	(r190146)
@@ -170,9 +170,9 @@ bc_add(int biosdev)
 static void
 bc_print(int verbose)
 {
-	int i;
 	char line[80];
-    
+	int i;
+
 	for (i = 0; i < nbcinfo; i++) {
 		sprintf(line, "    cd%d: Device 0x%x\n", i,
 		    bcinfo[i].bc_sp.sp_devicespec);
@@ -232,7 +232,7 @@ bc_strategy(void *devdata, int rw, daddr
 	if (dblk % (BIOSCD_SECSIZE / DEV_BSIZE) != 0)
 		return (EINVAL);
 	dblk /= (BIOSCD_SECSIZE / DEV_BSIZE);
-	DEBUG("read %d from %d to %p", blks, dblk, buf);
+	DEBUG("read %d from %lld to %p", blks, dblk, buf);
 
 	if (rsize)
 		*rsize = 0;
@@ -241,9 +241,9 @@ bc_strategy(void *devdata, int rw, daddr
 		return (EIO);
 	}
 #ifdef BD_SUPPORT_FRAGS
-	DEBUG("bc_strategy: frag read %d from %d+%d to %p", 
+	DEBUG("frag read %d from %lld+%d to %p", 
 	    fragsize, dblk, blks, buf + (blks * BIOSCD_SECSIZE));
-	if (fragsize && bc_read(unit, dblk + blks, 1, fragsize)) {
+	if (fragsize && bc_read(unit, dblk + blks, 1, fragbuf)) {
 		DEBUG("frag read error");
 		return(EIO);
 	}
@@ -254,11 +254,14 @@ bc_strategy(void *devdata, int rw, daddr
 	return (0);
 }
 
+/* Max number of sectors to bounce-buffer at a time. */
+#define	CD_BOUNCEBUF	8
+
 static int
 bc_read(int unit, daddr_t dblk, int blks, caddr_t dest)
 {
-	u_int result, retry;
-	static unsigned short packet[8];
+	u_int maxfer, resid, result, retry, x;
+	caddr_t bbuf, p, xp;
 	int biosdev;
 #ifdef DISK_DEBUG
 	int error;
@@ -272,40 +275,73 @@ bc_read(int unit, daddr_t dblk, int blks
 	if (blks == 0)
 		return (0);
 
+	/* Decide whether we have to bounce */
+	if (VTOP(dest) >> 20 != 0) {
+		/* 
+		 * The destination buffer is above first 1MB of
+		 * physical memory so we have to arrange a suitable
+		 * bounce buffer.
+		 */
+		x = min(CD_BOUNCEBUF, (unsigned)blks);
+		bbuf = alloca(x * BIOSCD_SECSIZE);
+		maxfer = x;
+	} else {
+		bbuf = NULL;
+		maxfer = 0;
+	}
+	
 	biosdev = bc_unit2bios(unit);
-	/*
-	 * Loop retrying the operation a couple of times.  The BIOS
-	 * may also retry.
-	 */
-	for (retry = 0; retry < 3; retry++) {
-		/* If retrying, reset the drive */
-		if (retry > 0) {
+	resid = blks;
+	p = dest;
+
+	while (resid > 0) {
+		if (bbuf)
+			xp = bbuf;
+		else
+			xp = p;
+		x = resid;
+		if (maxfer > 0)
+			x = min(x, maxfer);
+
+		/*
+		 * Loop retrying the operation a couple of times.  The BIOS
+		 * may also retry.
+		 */
+		for (retry = 0; retry < 3; retry++) {
+			/* If retrying, reset the drive */
+			if (retry > 0) {
+				v86.ctl = V86_FLAGS;
+				v86.addr = 0x1b;
+				v86.eax = 0x0300 | biosdev;
+				v86int();
+			}
+
 			v86.ctl = V86_FLAGS;
 			v86.addr = 0x1b;
-			v86.eax = 0x0300 | biosdev;
+			v86.eax = 0x0600 | (biosdev & 0x7f);
+			v86.ebx = blks * BIOSCD_SECSIZE;
+			v86.ecx = dblk & 0xffff;
+			v86.edx = (dblk >> 16) & 0xffff;
+			v86.ebp = VTOPOFF(dest);
+			v86.es = VTOPSEG(dest);
 			v86int();
+			result = (v86.efl & PSL_C);
+			if (result == 0)
+				break;
 		}
-
-		v86.ctl = V86_FLAGS;
-		v86.addr = 0x1b;
-		v86.eax = 0x0600 | (biosdev & 0x7f);
-		v86.ebx = blks * BIOSCD_SECSIZE;
-		v86.ecx = dblk & 0xffff;
-		v86.edx = (dblk >> 16) & 0xffff;
-		v86.ebp = VTOPOFF(dest);
-		v86.es = VTOPSEG(dest);
-		v86int();
-		result = (v86.efl & PSL_C);
-		if (result == 0)
-			break;
-	}
 	
 #ifdef DISK_DEBUG
-	error = (v86.eax >> 8) & 0xff;
+		error = (v86.eax >> 8) & 0xff;
 #endif
-	DEBUG("%d sectors from %ld to %p (0x%x) %s", blks, dblk, dest,
-	    VTOP(dest), result ? "failed" : "ok");
-	DEBUG("unit %d  status 0x%x",  unit, error);
+		DEBUG("%d sectors from %lld to %p (0x%x) %s", x, dblk, p,
+		    VTOP(p), result ? "failed" : "ok");
+		DEBUG("unit %d  status 0x%x", unit, error);
+		if (bbuf != NULL)
+			bcopy(bbuf, p, x * BIOSCD_SECSIZE);
+		p += (x * BIOSCD_SECSIZE);
+		dblk += x;
+		resid -= x;
+	}
 	
 /*	hexdump(dest, (blks * BIOSCD_SECSIZE)); */
 	return(0);

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 20 13:03:33 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id EB005106564A;
	Fri, 20 Mar 2009 13:03:33 +0000 (UTC)
	(envelope-from nyan@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D87DC8FC12;
	Fri, 20 Mar 2009 13:03:33 +0000 (UTC)
	(envelope-from nyan@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2KD3Xnr002780;
	Fri, 20 Mar 2009 13:03:33 GMT (envelope-from nyan@svn.freebsd.org)
Received: (from nyan@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2KD3X9b002779;
	Fri, 20 Mar 2009 13:03:33 GMT (envelope-from nyan@svn.freebsd.org)
Message-Id: <200903201303.n2KD3X9b002779@svn.freebsd.org>
From: Takahashi Yoshihiro 
Date: Fri, 20 Mar 2009 13:03: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: r190147 - head/sys/boot/pc98/libpc98
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 20 Mar 2009 13:03:34 -0000

Author: nyan
Date: Fri Mar 20 13:03:33 2009
New Revision: 190147
URL: http://svn.freebsd.org/changeset/base/190147

Log:
  Oops, fix the previous change.

Modified:
  head/sys/boot/pc98/libpc98/bioscd.c

Modified: head/sys/boot/pc98/libpc98/bioscd.c
==============================================================================
--- head/sys/boot/pc98/libpc98/bioscd.c	Fri Mar 20 12:26:42 2009	(r190146)
+++ head/sys/boot/pc98/libpc98/bioscd.c	Fri Mar 20 13:03:33 2009	(r190147)
@@ -319,11 +319,11 @@ bc_read(int unit, daddr_t dblk, int blks
 			v86.ctl = V86_FLAGS;
 			v86.addr = 0x1b;
 			v86.eax = 0x0600 | (biosdev & 0x7f);
-			v86.ebx = blks * BIOSCD_SECSIZE;
+			v86.ebx = x * BIOSCD_SECSIZE;
 			v86.ecx = dblk & 0xffff;
 			v86.edx = (dblk >> 16) & 0xffff;
-			v86.ebp = VTOPOFF(dest);
-			v86.es = VTOPSEG(dest);
+			v86.ebp = VTOPOFF(xp);
+			v86.es = VTOPSEG(xp);
 			v86int();
 			result = (v86.efl & PSL_C);
 			if (result == 0)

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 20 13:13:53 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 00D9D106564A;
	Fri, 20 Mar 2009 13:13:53 +0000 (UTC) (envelope-from bms@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 7977B8FC14;
	Fri, 20 Mar 2009 13:13:51 +0000 (UTC) (envelope-from bms@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2KDDpx6003014;
	Fri, 20 Mar 2009 13:13:51 GMT (envelope-from bms@svn.freebsd.org)
Received: (from bms@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2KDDp0n003013;
	Fri, 20 Mar 2009 13:13:51 GMT (envelope-from bms@svn.freebsd.org)
Message-Id: <200903201313.n2KDDp0n003013@svn.freebsd.org>
From: Bruce M Simpson 
Date: Fri, 20 Mar 2009 13: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: r190148 - 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: Fri, 20 Mar 2009 13:13:53 -0000

Author: bms
Date: Fri Mar 20 13:13:50 2009
New Revision: 190148
URL: http://svn.freebsd.org/changeset/base/190148

Log:
  Fix brainos introduced during mechanical KTR change.
  
  Pointy hat to:	bms

Modified:
  head/sys/netinet/ip_mroute.c

Modified: head/sys/netinet/ip_mroute.c
==============================================================================
--- head/sys/netinet/ip_mroute.c	Fri Mar 20 13:03:33 2009	(r190147)
+++ head/sys/netinet/ip_mroute.c	Fri Mar 20 13:13:50 2009	(r190148)
@@ -77,6 +77,7 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -930,7 +931,7 @@ add_vif(struct vifctl *vifcp)
     VIF_UNLOCK();
 
     CTR4(KTR_IPMF, "%s: add vif %d laddr %s thresh %x", __func__,
-	(int)vifcp->vifc_vifi, inet_ntoa(&vifcp->vifc_lcl_addr),
+	(int)vifcp->vifc_vifi, inet_ntoa(vifcp->vifc_lcl_addr),
 	(int)vifcp->vifc_threshold);
 
     return 0;
@@ -1060,7 +1061,7 @@ add_mfc(struct mfcctl2 *mfccp)
     /* If an entry already exists, just update the fields */
     if (rt) {
 	CTR4(KTR_IPMF, "%s: update mfc orig %s group %lx parent %x",
-	    __func__, inet_ntoa(&mfccp->mfcc_origin),
+	    __func__, inet_ntoa(mfccp->mfcc_origin),
 	    (u_long)ntohl(mfccp->mfcc_mcastgrp.s_addr),
 	    mfccp->mfcc_parent);
 	update_mfc_params(rt, mfccp);
@@ -1080,7 +1081,7 @@ add_mfc(struct mfcctl2 *mfccp)
 	    !TAILQ_EMPTY(&rt->mfc_stall)) {
 		CTR5(KTR_IPMF,
 		    "%s: add mfc orig %s group %lx parent %x qh %p",
-		    __func__, inet_ntoa(&mfccp->mfcc_origin),
+		    __func__, inet_ntoa(mfccp->mfcc_origin),
 		    (u_long)ntohl(mfccp->mfcc_mcastgrp.s_addr),
 		    mfccp->mfcc_parent,
 		    TAILQ_FIRST(&rt->mfc_stall));
@@ -1225,7 +1226,7 @@ X_ip_mforward(struct ip *ip, struct ifne
     vifi_t vifi;
 
     CTR3(KTR_IPMF, "ip_mforward: delete mfc orig %s group %lx ifp %p",
-	inet_ntoa(ip->ip_src), (u_long)ntohl(mcastgrp.s_addr), ifp);
+	inet_ntoa(ip->ip_src), (u_long)ntohl(ip->ip_dst.s_addr), ifp);
 
     if (ip->ip_hl < (sizeof(struct ip) + TUNNEL_LEN) >> 2 ||
 		((u_char *)(ip + 1))[1] != IPOPT_LSRR ) {
@@ -2563,7 +2564,7 @@ pim_input(struct mbuf *m, int off)
     if (datalen < PIM_MINLEN) {
 	pimstat.pims_rcv_tooshort++;
 	CTR3(KTR_IPMF, "%s: short packet (%d) from %s",
-	    __func__, datalen, inet_ntoa(&ip->ip_src));
+	    __func__, datalen, inet_ntoa(ip->ip_src));
 	m_freem(m);
 	return;
     }

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 20 13:41:23 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 73BA11065675;
	Fri, 20 Mar 2009 13:41:23 +0000 (UTC)
	(envelope-from jamie@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 60DA18FC3C;
	Fri, 20 Mar 2009 13:41:23 +0000 (UTC)
	(envelope-from jamie@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2KDfNBv003700;
	Fri, 20 Mar 2009 13:41:23 GMT (envelope-from jamie@svn.freebsd.org)
Received: (from jamie@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2KDfN1U003699;
	Fri, 20 Mar 2009 13:41:23 GMT (envelope-from jamie@svn.freebsd.org)
Message-Id: <200903201341.n2KDfN1U003699@svn.freebsd.org>
From: Jamie Gritton 
Date: Fri, 20 Mar 2009 13:41: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: r190151 - head/sys/net
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 20 Mar 2009 13:41:24 -0000

Author: jamie
Date: Fri Mar 20 13:41:23 2009
New Revision: 190151
URL: http://svn.freebsd.org/changeset/base/190151

Log:
  Call the interface's if_ioctl from ifioctl(), if the protocol didn't
  handle the ioctl.  There are other paths that already call it, but this
  allows for a non-interface socket (like AF_LOCAL which ifconfig now
  uses) to use a broader class of interface ioctls.
  
  Approved by:	bz (mentor), rwatson

Modified:
  head/sys/net/if.c

Modified: head/sys/net/if.c
==============================================================================
--- head/sys/net/if.c	Fri Mar 20 13:27:51 2009	(r190150)
+++ head/sys/net/if.c	Fri Mar 20 13:41:23 2009	(r190151)
@@ -2025,6 +2025,8 @@ ifioctl(struct socket *so, u_long cmd, c
 	error = ((*so->so_proto->pr_usrreqs->pru_control)(so, cmd,
 								 data,
 								 ifp, td));
+	if (error == EOPNOTSUPP && ifp != NULL && ifp->if_ioctl != NULL)
+		error = (*ifp->if_ioctl)(ifp, cmd, data);
 #else
 	{
 		int ocmd = cmd;
@@ -2066,6 +2068,9 @@ ifioctl(struct socket *so, u_long cmd, c
 								   cmd,
 								   data,
 								   ifp, td));
+		if (error == EOPNOTSUPP && ifp != NULL &&
+		    ifp->if_ioctl != NULL)
+			error = (*ifp->if_ioctl)(ifp, cmd, data);
 		switch (ocmd) {
 
 		case OSIOCGIFADDR:

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 20 14:00:15 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: by hub.freebsd.org (Postfix, from userid 1086)
	id C1F37106566B; Fri, 20 Mar 2009 14:00:15 +0000 (UTC)
Date: Fri, 20 Mar 2009 14:00:15 +0000
From: Vasil Dimov 
To: David Schultz 
Message-ID: <20090320140015.GA17645@hub.freebsd.org>
References: <200903142010.n2EKAESF006945@svn.freebsd.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <200903142010.n2EKAESF006945@svn.freebsd.org>
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r189828 - in head: include sys/sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
Reply-To: vd@FreeBSD.org
List-Id: 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, 20 Mar 2009 14:00:16 -0000

On Sat, Mar 14, 2009 at 08:10:14PM +0000, David Schultz wrote:
> Author: das
> Date: Sat Mar 14 20:10:14 2009
> New Revision: 189828
> URL: http://svn.freebsd.org/changeset/base/189828
> 
> Log:
>   Fix the visibility of several prototypes. Also move pthread_kill() and
>   pthread_sigmask() to signal.h. In principle, this shouldn't break anything,
[...]

But it did break, see http://www.freebsd.org/cgi/query-pr.cgi?pr=132828

I think one's namespace shouldn't be polluted with the prototype of
pthread_kill() if he has not included pthread.h.

-- 
Vasil Dimov
gro.DSBeerF@dv

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 20 14:00:18 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8C3301065674;
	Fri, 20 Mar 2009 14:00:18 +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 1C6BE8FC08;
	Fri, 20 Mar 2009 14:00:17 +0000 (UTC)
	(envelope-from marius@alchemy.franken.de)
Received: from alchemy.franken.de (localhost [127.0.0.1])
	by alchemy.franken.de (8.14.3/8.14.3/ALCHEMY.FRANKEN.DE) with ESMTP id
	n2KDam33037451; Fri, 20 Mar 2009 14:37:10 +0100 (CET)
	(envelope-from marius@alchemy.franken.de)
Received: (from marius@localhost)
	by alchemy.franken.de (8.14.3/8.14.3/Submit) id n2KDamnU037450;
	Fri, 20 Mar 2009 14:36:48 +0100 (CET) (envelope-from marius)
Date: Fri, 20 Mar 2009 14:36:48 +0100
From: Marius Strobl 
To: Marcel Moolenaar 
Message-ID: <20090320133648.GE59320@alchemy.franken.de>
References: <200903192040.n2JKeoYY075200@svn.freebsd.org>
	<31910B64-3437-4C1D-8234-FC6A1C3D4F8B@mac.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <31910B64-3437-4C1D-8234-FC6A1C3D4F8B@mac.com>
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: r190105 - head/sys/sparc64/sparc64
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 20 Mar 2009 14:00:19 -0000

On Thu, Mar 19, 2009 at 05:06:52PM -0700, Marcel Moolenaar wrote:
> 
> On Mar 19, 2009, at 1:40 PM, Marius Strobl wrote:
> 
> >Author: marius
> >Date: Thu Mar 19 20:40:49 2009
> >New Revision: 190105
> >URL: http://svn.freebsd.org/changeset/base/190105
> >
> >Log:
> > There's no need to wrap kdb_enter() in #ifdef KDB as it's always  
> >available.
> 
> That's not quite how it works.
> 
> option KDB is used to build the kernel with debugging features
> that could impact performance, security and/or functionality.
> In this case it's not so much a matter of whether kdb_enter()
> is defined or not, but rather whether the kernel should respect
> -d.
> 

That's generally true but the places where I removed
#ifdef KDB don't have an impact on security, performance
doesn't matter and -d still does nothing if there's no
debugger available (which in turn would require options
KDB, at least according to documentation). I'm not sure
what your're actually trying to say; following your
logic strictly would mean that subr_kdb.c shouldn't be
standard but only compiled in when options KDB is
present.

Marius


From owner-svn-src-head@FreeBSD.ORG  Fri Mar 20 14:01:42 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 87BC71065688;
	Fri, 20 Mar 2009 14:01:42 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 5BA928FC13;
	Fri, 20 Mar 2009 14:01:42 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2KE1g8n004377;
	Fri, 20 Mar 2009 14:01:42 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2KE1gO1004376;
	Fri, 20 Mar 2009 14:01:42 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <200903201401.n2KE1gO1004376@svn.freebsd.org>
From: Rui Paulo 
Date: Fri, 20 Mar 2009 14: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: r190155 - head/contrib/libpcap
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 20 Mar 2009 14:01:43 -0000

Author: rpaulo
Date: Fri Mar 20 14:01:42 2009
New Revision: 190155
URL: http://svn.freebsd.org/changeset/base/190155

Log:
  Bootstrap mergeinfo.

Modified:
  head/contrib/libpcap/   (props changed)

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 20 14:02:53 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A4EE7106568C;
	Fri, 20 Mar 2009 14:02:53 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 786C88FC1A;
	Fri, 20 Mar 2009 14:02:53 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2KE2rcI004463;
	Fri, 20 Mar 2009 14:02:53 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2KE2rXu004462;
	Fri, 20 Mar 2009 14:02:53 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <200903201402.n2KE2rXu004462@svn.freebsd.org>
From: Rui Paulo 
Date: Fri, 20 Mar 2009 14:02: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: r190156 - head/contrib/tcpdump
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 20 Mar 2009 14:02:54 -0000

Author: rpaulo
Date: Fri Mar 20 14:02:53 2009
New Revision: 190156
URL: http://svn.freebsd.org/changeset/base/190156

Log:
  Bootstrap mergeinfo.

Modified:
  head/contrib/tcpdump/   (props changed)

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 20 14:31:09 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 620821065693;
	Fri, 20 Mar 2009 14:31:09 +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 4F53A8FC18;
	Fri, 20 Mar 2009 14:31:09 +0000 (UTC) (envelope-from ed@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2KEV9PV005047;
	Fri, 20 Mar 2009 14:31:09 GMT (envelope-from ed@svn.freebsd.org)
Received: (from ed@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2KEV9kQ005045;
	Fri, 20 Mar 2009 14:31:09 GMT (envelope-from ed@svn.freebsd.org)
Message-Id: <200903201431.n2KEV9kQ005045@svn.freebsd.org>
From: Ed Schouten 
Date: Fri, 20 Mar 2009 14:31: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: r190157 - head/sys/dev/syscons/teken
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 20 Mar 2009 14:31:10 -0000

Author: ed
Date: Fri Mar 20 14:31:08 2009
New Revision: 190157
URL: http://svn.freebsd.org/changeset/base/190157

Log:
  Just use default behaviour on tabstops when using too many columns.
  
  It seems I didn't fix this issue before committing teken to the tree. My
  initial idea was to somehow add an error mechanism to instruct the video
  driver author to increase T_NUMCOL when using very big terminals. It
  turns out we have platforms where we have gigantic consoles on systems
  like the Apple PowerMac G5, which means we crash there right now.
  
  Just ignore tabstops placed beyond column 160. Just force tabs to be
  placed on each 8 columns.
  
  Reported by:	nwhitehorn

Modified:
  head/sys/dev/syscons/teken/teken.c
  head/sys/dev/syscons/teken/teken_subr.h

Modified: head/sys/dev/syscons/teken/teken.c
==============================================================================
--- head/sys/dev/syscons/teken/teken.c	Fri Mar 20 14:02:53 2009	(r190156)
+++ head/sys/dev/syscons/teken/teken.c	Fri Mar 20 14:31:08 2009	(r190157)
@@ -361,8 +361,6 @@ void
 teken_set_winsize(teken_t *t, const teken_pos_t *p)
 {
 
-	teken_assert(p->tp_col <= T_NUMCOL);
-
 	t->t_winsize = *p;
 	/* XXX: bounds checking with cursor/etc! */
 	t->t_scrollreg.ts_begin = 0;

Modified: head/sys/dev/syscons/teken/teken_subr.h
==============================================================================
--- head/sys/dev/syscons/teken/teken_subr.h	Fri Mar 20 14:02:53 2009	(r190156)
+++ head/sys/dev/syscons/teken/teken_subr.h	Fri Mar 20 14:31:08 2009	(r190157)
@@ -37,7 +37,8 @@ teken_tab_isset(teken_t *t, unsigned int
 {
 	unsigned int b, o;
 
-	teken_assert(col <= T_NUMCOL);
+	if (col >= T_NUMCOL)
+		return ((col & 0x7) == 0);
 
 	b = col / (sizeof(unsigned int) * 8);
 	o = col % (sizeof(unsigned int) * 8);
@@ -50,7 +51,8 @@ teken_tab_clear(teken_t *t, unsigned int
 {
 	unsigned int b, o;
 
-	teken_assert(col <= T_NUMCOL);
+	if (col >= T_NUMCOL)
+		return;
 
 	b = col / (sizeof(unsigned int) * 8);
 	o = col % (sizeof(unsigned int) * 8);
@@ -63,7 +65,8 @@ teken_tab_set(teken_t *t, unsigned int c
 {
 	unsigned int b, o;
 
-	teken_assert(col <= T_NUMCOL);
+	if (col >= T_NUMCOL)
+		return;
 
 	b = col / (sizeof(unsigned int) * 8);
 	o = col % (sizeof(unsigned int) * 8);

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 20 14:32:51 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8701F106568B;
	Fri, 20 Mar 2009 14:32: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 74FB48FC12;
	Fri, 20 Mar 2009 14:32:51 +0000 (UTC) (envelope-from ed@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2KEWpJS005171;
	Fri, 20 Mar 2009 14:32:51 GMT (envelope-from ed@svn.freebsd.org)
Received: (from ed@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2KEWpno005170;
	Fri, 20 Mar 2009 14:32:51 GMT (envelope-from ed@svn.freebsd.org)
Message-Id: <200903201432.n2KEWpno005170@svn.freebsd.org>
From: Ed Schouten 
Date: Fri, 20 Mar 2009 14:32: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: r190158 - head/sys/dev/syscons/teken
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 20 Mar 2009 14:32:52 -0000

Author: ed
Date: Fri Mar 20 14:32:51 2009
New Revision: 190158
URL: http://svn.freebsd.org/changeset/base/190158

Log:
  Small cleanup to previous commit.
  
  Just use % 8, instead of & 0x7. This makes it easier to understand.

Modified:
  head/sys/dev/syscons/teken/teken_subr.h

Modified: head/sys/dev/syscons/teken/teken_subr.h
==============================================================================
--- head/sys/dev/syscons/teken/teken_subr.h	Fri Mar 20 14:31:08 2009	(r190157)
+++ head/sys/dev/syscons/teken/teken_subr.h	Fri Mar 20 14:32:51 2009	(r190158)
@@ -38,7 +38,7 @@ teken_tab_isset(teken_t *t, unsigned int
 	unsigned int b, o;
 
 	if (col >= T_NUMCOL)
-		return ((col & 0x7) == 0);
+		return ((col % 8) == 0);
 
 	b = col / (sizeof(unsigned int) * 8);
 	o = col % (sizeof(unsigned int) * 8);

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 20 15:31:42 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4914E10656BD;
	Fri, 20 Mar 2009 15:31:42 +0000 (UTC) (envelope-from xcllnt@mac.com)
Received: from asmtpout014.mac.com (asmtpout014.mac.com [17.148.16.89])
	by mx1.freebsd.org (Postfix) with ESMTP id 1C68A8FC15;
	Fri, 20 Mar 2009 15:31:42 +0000 (UTC) (envelope-from xcllnt@mac.com)
MIME-version: 1.0
Content-transfer-encoding: 7BIT
Content-type: text/plain; charset=US-ASCII; format=flowed
Received: from [192.168.4.253] (mail.xcllnt.net [75.101.29.67])
	by asmtp014.mac.com
	(Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008;
	32bit)) with ESMTPSA id <0KGT001IU9SRLM60@asmtp014.mac.com>; Fri,
	20 Mar 2009 08:31:41 -0700 (PDT)
Message-id: 
From: Marcel Moolenaar 
To: Marius Strobl 
In-reply-to: <20090320133648.GE59320@alchemy.franken.de>
Date: Fri, 20 Mar 2009 08:31:39 -0700
References: <200903192040.n2JKeoYY075200@svn.freebsd.org>
	<31910B64-3437-4C1D-8234-FC6A1C3D4F8B@mac.com>
	<20090320133648.GE59320@alchemy.franken.de>
X-Mailer: Apple Mail (2.930.3)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r190105 - head/sys/sparc64/sparc64
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 20 Mar 2009 15:31:43 -0000


On Mar 20, 2009, at 6:36 AM, Marius Strobl wrote:

>>> Log:
>>> There's no need to wrap kdb_enter() in #ifdef KDB as it's always
>>> available.
>>
>> That's not quite how it works.
>>
>> option KDB is used to build the kernel with debugging features
>> that could impact performance, security and/or functionality.
>> In this case it's not so much a matter of whether kdb_enter()
>> is defined or not, but rather whether the kernel should respect
>> -d.
>>
>
> That's generally true but the places where I removed
> #ifdef KDB don't have an impact on security, performance
> doesn't matter and -d still does nothing if there's no
> debugger available (which in turn would require options
> KDB, at least according to documentation). I'm not sure
> what your're actually trying to say; following your
> logic strictly would mean that subr_kdb.c shouldn't be
> standard but only compiled in when options KDB is
> present.

The functions in subr_kdb.c have been made standard (i.e
non-optional) so that they can actually be used safely
from modules without having to worry about whether the
kernel has some option enabled. So, option KDB doesn't
control their visibility.

A debugger is present when either DDB or GDB is defined.
So, option KDB doesn't control that either.

Option KDB doesn't do much. For the most part it guards
code that results in entry into the debugger. For serial
consoles it changes the behaviour of the driver when a
serial break is detected. It also enabled the checking
for the alternate break sequence. Both you may not want
to do in production.

Granted there's no granularity. You want different
options for different cases so that you can enable or
disable code independently. That we never could do
before KDB, and we never did afterwards...

-- 
Marcel Moolenaar
xcllnt@mac.com




From owner-svn-src-head@FreeBSD.ORG  Fri Mar 20 15:32:34 2009
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.ORG
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 41B02106566B;
	Fri, 20 Mar 2009 15:32:34 +0000 (UTC) (envelope-from das@FreeBSD.ORG)
Received: from zim.MIT.EDU (ZIM.MIT.EDU [18.95.3.101])
	by mx1.freebsd.org (Postfix) with ESMTP id F29248FC1D;
	Fri, 20 Mar 2009 15:32:33 +0000 (UTC) (envelope-from das@FreeBSD.ORG)
Received: from zim.MIT.EDU (localhost [127.0.0.1])
	by zim.MIT.EDU (8.14.3/8.14.2) with ESMTP id n2KFY5Pv062737;
	Fri, 20 Mar 2009 11:34:05 -0400 (EDT) (envelope-from das@FreeBSD.ORG)
Received: (from das@localhost)
	by zim.MIT.EDU (8.14.3/8.14.2/Submit) id n2KFY5Eh062736;
	Fri, 20 Mar 2009 11:34:05 -0400 (EDT) (envelope-from das@FreeBSD.ORG)
Date: Fri, 20 Mar 2009 11:34:05 -0400
From: David Schultz 
To: Vasil Dimov 
Message-ID: <20090320153405.GA62675@zim.MIT.EDU>
Mail-Followup-To: Vasil Dimov , src-committers@FreeBSD.ORG,
	svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG
References: <200903142010.n2EKAESF006945@svn.freebsd.org>
	<20090320140015.GA17645@hub.freebsd.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20090320140015.GA17645@hub.freebsd.org>
Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG,
	src-committers@FreeBSD.ORG
Subject: Re: svn commit: r189828 - in head: include 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: Fri, 20 Mar 2009 15:32:34 -0000

On Fri, Mar 20, 2009, Vasil Dimov wrote:
> On Sat, Mar 14, 2009 at 08:10:14PM +0000, David Schultz wrote:
> > Author: das
> > Date: Sat Mar 14 20:10:14 2009
> > New Revision: 189828
> > URL: http://svn.freebsd.org/changeset/base/189828
> > 
> > Log:
> >   Fix the visibility of several prototypes. Also move pthread_kill() and
> >   pthread_sigmask() to signal.h. In principle, this shouldn't break anything,
> [...]
> 
> But it did break, see http://www.freebsd.org/cgi/query-pr.cgi?pr=132828
> 
> I think one's namespace shouldn't be polluted with the prototype of
> pthread_kill() if he has not included pthread.h.

The pthreads API has always defined pthread_kill() to be in
signal.h, not pthread.h. This is what is done in glibc and
elsewhere.

GNU Pth has some bogus and extremely unportable hacks to ``trick''
system headers into not declaring symbols:

  /*
   * Prevent system includes from implicitly including
   * possibly existing vendor Pthread headers
   */
  #define PTHREAD
  #define PTHREAD_H
  #define _PTHREAD_T
  #define _PTHREAD_H
  #define _PTHREAD_H_
  #define PTHREAD_INCLUDED
  #define _PTHREAD_INCLUDED
  #define SYS_PTHREAD_H
  #define _SYS_PTHREAD_H
  #define _SYS_PTHREAD_H_
  #define SYS_PTHREAD_INCLUDED
  #define _SYS_PTHREAD_INCLUDED
  #define BITS_PTHREADTYPES_H
  #define _BITS_PTHREADTYPES_H
  #define _BITS_PTHREADTYPES_H_
  #define _BITS_SIGTHREAD_H

The one that works for glibc is _BITS_SIGTHREAD_H. I'd rather not
be complicit in these shenanigans, but if we can't easily fix the
problem in Pth, I suppose we can teach signal.h about one of these
bogus macros. What do you think?

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 20 15:57:10 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 15718106564A;
	Fri, 20 Mar 2009 15:57:10 +0000 (UTC) (envelope-from sam@freebsd.org)
Received: from ebb.errno.com (ebb.errno.com [69.12.149.25])
	by mx1.freebsd.org (Postfix) with ESMTP id BC08E8FC0A;
	Fri, 20 Mar 2009 15:57:09 +0000 (UTC) (envelope-from sam@freebsd.org)
Received: from trouble.errno.com (trouble.errno.com [10.0.0.248])
	(authenticated bits=0)
	by ebb.errno.com (8.13.6/8.12.6) with ESMTP id n2KFv8eP005017
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 20 Mar 2009 08:57:09 -0700 (PDT) (envelope-from sam@freebsd.org)
Message-ID: <49C3BCD4.4030605@freebsd.org>
Date: Fri, 20 Mar 2009 08:57:08 -0700
From: Sam Leffler 
Organization: FreeBSD Project
User-Agent: Thunderbird 2.0.0.18 (X11/20081209)
MIME-Version: 1.0
To: Vasil Dimov , src-committers@freebsd.org,
	svn-src-all@freebsd.org, svn-src-head@freebsd.org
References: <200903142010.n2EKAESF006945@svn.freebsd.org>
	<20090320140015.GA17645@hub.freebsd.org>
	<20090320153405.GA62675@zim.MIT.EDU>
In-Reply-To: <20090320153405.GA62675@zim.MIT.EDU>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-DCC--Metrics: ebb.errno.com; whitelist
Cc: 
Subject: Re: svn commit: r189828 - in head: include 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: Fri, 20 Mar 2009 15:57:10 -0000

David Schultz wrote:
> On Fri, Mar 20, 2009, Vasil Dimov wrote:
>   
>> On Sat, Mar 14, 2009 at 08:10:14PM +0000, David Schultz wrote:
>>     
>>> Author: das
>>> Date: Sat Mar 14 20:10:14 2009
>>> New Revision: 189828
>>> URL: http://svn.freebsd.org/changeset/base/189828
>>>
>>> Log:
>>>   Fix the visibility of several prototypes. Also move pthread_kill() and
>>>   pthread_sigmask() to signal.h. In principle, this shouldn't break anything,
>>>       
>> [...]
>>
>> But it did break, see http://www.freebsd.org/cgi/query-pr.cgi?pr=132828
>>
>> I think one's namespace shouldn't be polluted with the prototype of
>> pthread_kill() if he has not included pthread.h.
>>     
>
> The pthreads API has always defined pthread_kill() to be in
> signal.h, not pthread.h. This is what is done in glibc and
> elsewhere.
>
> GNU Pth has some bogus and extremely unportable hacks to ``trick''
> system headers into not declaring symbols:
>
>   /*
>    * Prevent system includes from implicitly including
>    * possibly existing vendor Pthread headers
>    */
>   #define PTHREAD
>   #define PTHREAD_H
>   #define _PTHREAD_T
>   #define _PTHREAD_H
>   #define _PTHREAD_H_
>   #define PTHREAD_INCLUDED
>   #define _PTHREAD_INCLUDED
>   #define SYS_PTHREAD_H
>   #define _SYS_PTHREAD_H
>   #define _SYS_PTHREAD_H_
>   #define SYS_PTHREAD_INCLUDED
>   #define _SYS_PTHREAD_INCLUDED
>   #define BITS_PTHREADTYPES_H
>   #define _BITS_PTHREADTYPES_H
>   #define _BITS_PTHREADTYPES_H_
>   #define _BITS_SIGTHREAD_H
>
> The one that works for glibc is _BITS_SIGTHREAD_H. I'd rather not
> be complicit in these shenanigans, but if we can't easily fix the
> problem in Pth, I suppose we can teach signal.h about one of these
> bogus macros. What do you think?
>
>   

Dumb question, why do we need devel/pth?  Isn't the native pthread 
support sufficient?

    Sam


From owner-svn-src-head@FreeBSD.ORG  Fri Mar 20 16:34:23 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id EE30B106564A;
	Fri, 20 Mar 2009 16:34:23 +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 632408FC17;
	Fri, 20 Mar 2009 16:34:22 +0000 (UTC)
	(envelope-from marius@alchemy.franken.de)
Received: from alchemy.franken.de (localhost [127.0.0.1])
	by alchemy.franken.de (8.14.3/8.14.3/ALCHEMY.FRANKEN.DE) with ESMTP id
	n2KGXx5b038854; Fri, 20 Mar 2009 17:34:22 +0100 (CET)
	(envelope-from marius@alchemy.franken.de)
Received: (from marius@localhost)
	by alchemy.franken.de (8.14.3/8.14.3/Submit) id n2KGXxCU038853;
	Fri, 20 Mar 2009 17:33:59 +0100 (CET) (envelope-from marius)
Date: Fri, 20 Mar 2009 17:33:59 +0100
From: Marius Strobl 
To: Marcel Moolenaar 
Message-ID: <20090320163359.GH59320@alchemy.franken.de>
References: <200903192040.n2JKeoYY075200@svn.freebsd.org>
	<31910B64-3437-4C1D-8234-FC6A1C3D4F8B@mac.com>
	<20090320133648.GE59320@alchemy.franken.de>
	
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: 
User-Agent: Mutt/1.4.2.3i
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r190105 - head/sys/sparc64/sparc64
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 20 Mar 2009 16:34:24 -0000

On Fri, Mar 20, 2009 at 08:31:39AM -0700, Marcel Moolenaar wrote:
> 
> On Mar 20, 2009, at 6:36 AM, Marius Strobl wrote:
> 
> >>>Log:
> >>>There's no need to wrap kdb_enter() in #ifdef KDB as it's always
> >>>available.
> >>
> >>That's not quite how it works.
> >>
> >>option KDB is used to build the kernel with debugging features
> >>that could impact performance, security and/or functionality.
> >>In this case it's not so much a matter of whether kdb_enter()
> >>is defined or not, but rather whether the kernel should respect
> >>-d.
> >>
> >
> >That's generally true but the places where I removed
> >#ifdef KDB don't have an impact on security, performance
> >doesn't matter and -d still does nothing if there's no
> >debugger available (which in turn would require options
> >KDB, at least according to documentation). I'm not sure
> >what your're actually trying to say; following your
> >logic strictly would mean that subr_kdb.c shouldn't be
> >standard but only compiled in when options KDB is
> >present.
> 
> The functions in subr_kdb.c have been made standard (i.e
> non-optional) so that they can actually be used safely
> from modules without having to worry about whether the
> kernel has some option enabled. So, option KDB doesn't
> control their visibility.
> 
> A debugger is present when either DDB or GDB is defined.
> So, option KDB doesn't control that either.
> 
> Option KDB doesn't do much. For the most part it guards
> code that results in entry into the debugger.

Okay, I now see why you objected to r190105. My point
is that in this case the code in question doesn't
need such protection (just as a module not using KDB
wouldn't have) as there's no relevant impact on
functionality, performance or security here but
especially in r190106 removing it improves readability.
It's not my intention to unconditionally remove every
#ifdef KDB around references of parts of subr_kdb.c
as the commit messages might imply.

> For serial
> consoles it changes the behaviour of the driver when a
> serial break is detected. It also enabled the checking
> for the alternate break sequence. Both you may not want
> to do in production.
> 
> Granted there's no granularity. You want different
> options for different cases so that you can enable or
> disable code independently. That we never could do
> before KDB, and we never did afterwards...
> 

Marius


From owner-svn-src-head@FreeBSD.ORG  Fri Mar 20 16:44:10 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8D26F106566B;
	Fri, 20 Mar 2009 16:44:10 +0000 (UTC) (envelope-from xcllnt@mac.com)
Received: from asmtpout020.mac.com (asmtpout020.mac.com [17.148.16.95])
	by mx1.freebsd.org (Postfix) with ESMTP id 7309F8FC1F;
	Fri, 20 Mar 2009 16:44:10 +0000 (UTC) (envelope-from xcllnt@mac.com)
MIME-version: 1.0
Content-transfer-encoding: 7BIT
Content-type: text/plain; charset=US-ASCII; format=flowed
Received: from macbook-pro.jnpr.net ([66.129.224.36])
	by asmtp020.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01
	(built Dec
	16 2008; 32bit)) with ESMTPSA id <0KGT00CW6D55Q620@asmtp020.mac.com>;
	Fri, 20 Mar 2009 09:43:54 -0700 (PDT)
Message-id: <458289DF-A730-453D-81D3-DAB8631A9F34@mac.com>
From: Marcel Moolenaar 
To: Marius Strobl 
In-reply-to: <20090320163359.GH59320@alchemy.franken.de>
Date: Fri, 20 Mar 2009 09:42:32 -0700
References: <200903192040.n2JKeoYY075200@svn.freebsd.org>
	<31910B64-3437-4C1D-8234-FC6A1C3D4F8B@mac.com>
	<20090320133648.GE59320@alchemy.franken.de>
	
	<20090320163359.GH59320@alchemy.franken.de>
X-Mailer: Apple Mail (2.930.3)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r190105 - head/sys/sparc64/sparc64
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 20 Mar 2009 16:44:11 -0000


On Mar 20, 2009, at 9:33 AM, Marius Strobl wrote:
>>
>>>>> Log:
>>>>> There's no need to wrap kdb_enter() in #ifdef KDB as it's always
>>>>> available.
>>>>
>>>> That's not quite how it works.
>>>>
>>>> option KDB is used to build the kernel with debugging features
>>>> that could impact performance, security and/or functionality.
>>>> In this case it's not so much a matter of whether kdb_enter()
>>>> is defined or not, but rather whether the kernel should respect
>>>> -d.
>>>>
>>>
>>> That's generally true but the places where I removed
>>> #ifdef KDB don't have an impact on security, performance
>>> doesn't matter and -d still does nothing if there's no
>>> debugger available (which in turn would require options
>>> KDB, at least according to documentation). I'm not sure
>>> what your're actually trying to say; following your
>>> logic strictly would mean that subr_kdb.c shouldn't be
>>> standard but only compiled in when options KDB is
>>> present.
>>
>> The functions in subr_kdb.c have been made standard (i.e
>> non-optional) so that they can actually be used safely
>> from modules without having to worry about whether the
>> kernel has some option enabled. So, option KDB doesn't
>> control their visibility.
>>
>> A debugger is present when either DDB or GDB is defined.
>> So, option KDB doesn't control that either.
>>
>> Option KDB doesn't do much. For the most part it guards
>> code that results in entry into the debugger.
>
> Okay, I now see why you objected to r190105.

It wasn't an objection, just a remark.

> My point
> is that in this case the code in question doesn't
> need such protection (just as a module not using KDB
> wouldn't have) as there's no relevant impact on
> functionality, performance or security here but
> especially in r190106 removing it improves readability.

My only real objection is that this creates an inconsistency
between platforms. By removing option KDB the kernel will
not respect -d (or boot_kdb=1) on any platform but sparc64.
There's a user-visible impact. I would prefer that we keep
all platforms the same so that documentation can apply
uniformly and isn't only applicable to i386.

I'm perfectly happy if uniformity is achieved by removing
the ifdef from all platforms :-)

Anyway: it's not a big deal in any case.

-- 
Marcel Moolenaar
xcllnt@mac.com




From owner-svn-src-head@FreeBSD.ORG  Fri Mar 20 16:46:30 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 51F711065675
	for ; Fri, 20 Mar 2009 16:46:30 +0000 (UTC)
	(envelope-from cokane@FreeBSD.org)
Received: from mail-out1.fuse.net (mail-out1.fuse.net [216.68.8.175])
	by mx1.freebsd.org (Postfix) with ESMTP id 09AA98FC20
	for ; Fri, 20 Mar 2009 16:46:29 +0000 (UTC)
	(envelope-from cokane@FreeBSD.org)
X-CNFS-Analysis: v=1.0 c=1 a=r_5zXaxxhK4A:10 a=SrmVwFdnOH0A:10
	a=6I5d2MoRAAAA:8 a=Ri7sf02kGt6SfL-SZ7UA:9
	a=1Aa3Knt5xIpGRYcjXf4A:7 a=A46Q0mC7abSQWLvxMOGj6a4sW5wA:4
	a=LY0hPdMaydYA:10 a=eMCuiTGOnfXaIzemHMoA:9
	a=ngkNk-BprOOiKny09MR3rpHCBagA:4 a=rPt6xJ-oxjAA:10
X-CM-Score: 0
X-Scanned-by: Cloudmark Authority Engine
Authentication-Results: gwout1 smtp.mail=cokane@FreeBSD.org; spf=softfail
Received-SPF: softfail (gwout1: transitional domain FreeBSD.org does not
	designate 74.215.227.9 as permitted sender)
Received: from [74.215.227.9] ([74.215.227.9:50565] helo=discordia)
	by gwout1 (envelope-from )
	(ecelerity 2.2.2.37 r(28805/28810M)) with ESMTP
	id EF/56-27669-468C3C94; Fri, 20 Mar 2009 12:46:28 -0400
Received: by discordia (Postfix, from userid 103)
	id 92E9B35A7F1; Fri, 20 Mar 2009 12:46:28 -0400 (EDT)
X-Spam-Checker-Version: SpamAssassin 3.1.8-gr1 (2007-02-13) on discordia
X-Spam-Level: 
X-Spam-Status: No, score=-4.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00
	autolearn=ham version=3.1.8-gr1
Received: from [172.31.1.6] (unknown [172.31.1.6])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by discordia (Postfix) with ESMTP id BC8B635A7F1;
	Fri, 20 Mar 2009 12:46:21 -0400 (EDT)
From: Coleman Kane 
To: Sam Leffler 
In-Reply-To: <49C3BCD4.4030605@freebsd.org>
References: <200903142010.n2EKAESF006945@svn.freebsd.org>
	<20090320140015.GA17645@hub.freebsd.org>
	<20090320153405.GA62675@zim.MIT.EDU>  <49C3BCD4.4030605@freebsd.org>
Content-Type: multipart/signed; micalg="pgp-sha1";
	protocol="application/pgp-signature";
	boundary="=-4QP3RwbfanYU+n1xELYe"
Organization: FreeBSD Project
Date: Fri, 20 Mar 2009 12:44:55 -0400
Message-Id: <1237567495.1993.2.camel@localhost>
Mime-Version: 1.0
X-Mailer: Evolution 2.24.5 FreeBSD GNOME Team Port 
Cc: svn-src-head@freebsd.org, Vasil Dimov ,
	svn-src-all@freebsd.org, src-committers@freebsd.org
Subject: Re: svn commit: r189828 - in head: include 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: Fri, 20 Mar 2009 16:46:30 -0000


--=-4QP3RwbfanYU+n1xELYe
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

On Fri, 2009-03-20 at 08:57 -0700, Sam Leffler wrote:
> David Schultz wrote:
> > On Fri, Mar 20, 2009, Vasil Dimov wrote:
> >  =20
> >> On Sat, Mar 14, 2009 at 08:10:14PM +0000, David Schultz wrote:
> >>    =20
> >>> Author: das
> >>> Date: Sat Mar 14 20:10:14 2009
> >>> New Revision: 189828
> >>> URL: http://svn.freebsd.org/changeset/base/189828
> >>>
> >>> Log:
> >>>   Fix the visibility of several prototypes. Also move pthread_kill() =
and
> >>>   pthread_sigmask() to signal.h. In principle, this shouldn't break a=
nything,
> >>>      =20
> >> [...]
> >>
> >> But it did break, see http://www.freebsd.org/cgi/query-pr.cgi?pr=3D132=
828
> >>
> >> I think one's namespace shouldn't be polluted with the prototype of
> >> pthread_kill() if he has not included pthread.h.
> >>    =20
> >
> > The pthreads API has always defined pthread_kill() to be in
> > signal.h, not pthread.h. This is what is done in glibc and
> > elsewhere.
> >
> > GNU Pth has some bogus and extremely unportable hacks to ``trick''
> > system headers into not declaring symbols:
> >
> >   /*
> >    * Prevent system includes from implicitly including
> >    * possibly existing vendor Pthread headers
> >    */
> >   #define PTHREAD
> >   #define PTHREAD_H
> >   #define _PTHREAD_T
> >   #define _PTHREAD_H
> >   #define _PTHREAD_H_
> >   #define PTHREAD_INCLUDED
> >   #define _PTHREAD_INCLUDED
> >   #define SYS_PTHREAD_H
> >   #define _SYS_PTHREAD_H
> >   #define _SYS_PTHREAD_H_
> >   #define SYS_PTHREAD_INCLUDED
> >   #define _SYS_PTHREAD_INCLUDED
> >   #define BITS_PTHREADTYPES_H
> >   #define _BITS_PTHREADTYPES_H
> >   #define _BITS_PTHREADTYPES_H_
> >   #define _BITS_SIGTHREAD_H
> >
> > The one that works for glibc is _BITS_SIGTHREAD_H. I'd rather not
> > be complicit in these shenanigans, but if we can't easily fix the
> > problem in Pth, I suppose we can teach signal.h about one of these
> > bogus macros. What do you think?
> >
> >  =20
>=20
> Dumb question, why do we need devel/pth?  Isn't the native pthread=20
> support sufficient?
>=20
>     Sam
>=20

For whatever reason, both security/libassuan and security/gnupg want
pth.

I was able to solve the problem by removing the "#include "
from the offending file (there is only one) in devel/pth. After that, it
built fine and I am using it now.

Maybe devel/pth doesn't even really need to #include 
anymore....

--=20
Coleman Kane

--=-4QP3RwbfanYU+n1xELYe
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (FreeBSD)

iEUEABECAAYFAknDyAQACgkQcMSxQcXat5ccNACeL/94Y6zONAIsJRNXElrpIxoJ
anAAlAwhLpVGqDi8DtDNn/EITDVS+cU=
=WTVu
-----END PGP SIGNATURE-----

--=-4QP3RwbfanYU+n1xELYe--


From owner-svn-src-head@FreeBSD.ORG  Fri Mar 20 17:10:50 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8C790106568D;
	Fri, 20 Mar 2009 17:10:50 +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 7A1038FC15;
	Fri, 20 Mar 2009 17:10:50 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2KHAowH008394;
	Fri, 20 Mar 2009 17:10:50 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2KHAoRx008393;
	Fri, 20 Mar 2009 17:10:50 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <200903201710.n2KHAoRx008393@svn.freebsd.org>
From: Marius Strobl 
Date: Fri, 20 Mar 2009 17:10: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: r190161 - head/sys/sparc64/sparc64
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 20 Mar 2009 17:10:51 -0000

Author: marius
Date: Fri Mar 20 17:10:50 2009
New Revision: 190161
URL: http://svn.freebsd.org/changeset/base/190161

Log:
  Revert r190105 so that removing options KDB but DDB or GDB being
  available will cause the kernel to not respect -d and boot_kdb=1
  for consistency with the other platforms as pointed out by marcel@.

Modified:
  head/sys/sparc64/sparc64/machdep.c

Modified: head/sys/sparc64/sparc64/machdep.c
==============================================================================
--- head/sys/sparc64/sparc64/machdep.c	Fri Mar 20 16:02:37 2009	(r190160)
+++ head/sys/sparc64/sparc64/machdep.c	Fri Mar 20 17:10:50 2009	(r190161)
@@ -496,8 +496,10 @@ sparc64_init(caddr_t mdp, u_long o1, u_l
 
 	kdb_init();
 
+#ifdef KDB
 	if (boothowto & RB_KDB)
 		kdb_enter(KDB_WHY_BOOTFLAGS, "Boot flags requested debugger");
+#endif
 }
 
 void

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 20 17:11:45 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C20BA10656CE;
	Fri, 20 Mar 2009 17:11:45 +0000 (UTC)
	(envelope-from kientzle@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id AA4108FC19;
	Fri, 20 Mar 2009 17:11:45 +0000 (UTC)
	(envelope-from kientzle@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2KHBjhh008453;
	Fri, 20 Mar 2009 17:11:45 GMT
	(envelope-from kientzle@svn.freebsd.org)
Received: (from kientzle@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2KHBjh4008452;
	Fri, 20 Mar 2009 17:11:45 GMT
	(envelope-from kientzle@svn.freebsd.org)
Message-Id: <200903201711.n2KHBjh4008452@svn.freebsd.org>
From: Tim Kientzle 
Date: Fri, 20 Mar 2009 17:11: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: r190162 - head/usr.bin/ar
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 20 Mar 2009 17:11:47 -0000

Author: kientzle
Date: Fri Mar 20 17:11:45 2009
New Revision: 190162
URL: http://svn.freebsd.org/changeset/base/190162

Log:
  Act like ranlib if our name ends in ranlib.  In particular,
  this works with some recent cross-building changes by Warner
  that install ranlib as, e.g., "arm-freebsd7.1-ranlib".
  
  Submitted by:	John Hein

Modified:
  head/usr.bin/ar/ar.c

Modified: head/usr.bin/ar/ar.c
==============================================================================
--- head/usr.bin/ar/ar.c	Fri Mar 20 17:10:50 2009	(r190161)
+++ head/usr.bin/ar/ar.c	Fri Mar 20 17:11:45 2009	(r190162)
@@ -108,8 +108,11 @@ main(int argc, char **argv)
 	if ((bsdar->progname = getprogname()) == NULL)
 		bsdar->progname = "ar";
 
-	if (strcmp(bsdar->progname, "ranlib") == 0 ||
-	    strcmp(bsdar->progname, "bsdranlib") == 0) {
+	/* Act like ranlib if our name ends in "ranlib"; this
+	 * accomodates arm-freebsd7.1-ranlib, bsdranlib, etc. */
+	len = strlen(bsdar->progname);
+	if (len >= strlen("ranlib") &&
+	    strcmp(bsdar->progname + len - strlen("ranlib"), "ranlib") == 0) {
 		while ((opt = getopt_long(argc, argv, "tV", longopts,
 		    NULL)) != -1) {
 			switch(opt) {

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 20 17:40:41 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 662991065686;
	Fri, 20 Mar 2009 17:40:41 +0000 (UTC) (envelope-from sam@freebsd.org)
Received: from ebb.errno.com (ebb.errno.com [69.12.149.25])
	by mx1.freebsd.org (Postfix) with ESMTP id 21E318FC0C;
	Fri, 20 Mar 2009 17:40:41 +0000 (UTC) (envelope-from sam@freebsd.org)
Received: from trouble.errno.com (trouble.errno.com [10.0.0.248])
	(authenticated bits=0)
	by ebb.errno.com (8.13.6/8.12.6) with ESMTP id n2KHeeSa005666
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 20 Mar 2009 10:40:40 -0700 (PDT) (envelope-from sam@freebsd.org)
Message-ID: <49C3D518.6070105@freebsd.org>
Date: Fri, 20 Mar 2009 10:40:40 -0700
From: Sam Leffler 
Organization: FreeBSD Project
User-Agent: Thunderbird 2.0.0.18 (X11/20081209)
MIME-Version: 1.0
To: Coleman Kane 
References: <200903142010.n2EKAESF006945@svn.freebsd.org>	
	<20090320140015.GA17645@hub.freebsd.org>	
	<20090320153405.GA62675@zim.MIT.EDU> <49C3BCD4.4030605@freebsd.org>
	<1237567495.1993.2.camel@localhost>
In-Reply-To: <1237567495.1993.2.camel@localhost>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-DCC--Metrics: ebb.errno.com; whitelist
Cc: svn-src-head@freebsd.org, Vasil Dimov ,
	svn-src-all@freebsd.org, src-committers@freebsd.org
Subject: Re: svn commit: r189828 - in head: include 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: Fri, 20 Mar 2009 17:40:42 -0000

Coleman Kane wrote:
> On Fri, 2009-03-20 at 08:57 -0700, Sam Leffler wrote:
>   
>> David Schultz wrote:
>>     
>>> On Fri, Mar 20, 2009, Vasil Dimov wrote:
>>>   
>>>       
>>>> On Sat, Mar 14, 2009 at 08:10:14PM +0000, David Schultz wrote:
>>>>     
>>>>         
>>>>> Author: das
>>>>> Date: Sat Mar 14 20:10:14 2009
>>>>> New Revision: 189828
>>>>> URL: http://svn.freebsd.org/changeset/base/189828
>>>>>
>>>>> Log:
>>>>>   Fix the visibility of several prototypes. Also move pthread_kill() and
>>>>>   pthread_sigmask() to signal.h. In principle, this shouldn't break anything,
>>>>>       
>>>>>           
>>>> [...]
>>>>
>>>> But it did break, see http://www.freebsd.org/cgi/query-pr.cgi?pr=132828
>>>>
>>>> I think one's namespace shouldn't be polluted with the prototype of
>>>> pthread_kill() if he has not included pthread.h.
>>>>     
>>>>         
>>> The pthreads API has always defined pthread_kill() to be in
>>> signal.h, not pthread.h. This is what is done in glibc and
>>> elsewhere.
>>>
>>> GNU Pth has some bogus and extremely unportable hacks to ``trick''
>>> system headers into not declaring symbols:
>>>
>>>   /*
>>>    * Prevent system includes from implicitly including
>>>    * possibly existing vendor Pthread headers
>>>    */
>>>   #define PTHREAD
>>>   #define PTHREAD_H
>>>   #define _PTHREAD_T
>>>   #define _PTHREAD_H
>>>   #define _PTHREAD_H_
>>>   #define PTHREAD_INCLUDED
>>>   #define _PTHREAD_INCLUDED
>>>   #define SYS_PTHREAD_H
>>>   #define _SYS_PTHREAD_H
>>>   #define _SYS_PTHREAD_H_
>>>   #define SYS_PTHREAD_INCLUDED
>>>   #define _SYS_PTHREAD_INCLUDED
>>>   #define BITS_PTHREADTYPES_H
>>>   #define _BITS_PTHREADTYPES_H
>>>   #define _BITS_PTHREADTYPES_H_
>>>   #define _BITS_SIGTHREAD_H
>>>
>>> The one that works for glibc is _BITS_SIGTHREAD_H. I'd rather not
>>> be complicit in these shenanigans, but if we can't easily fix the
>>> problem in Pth, I suppose we can teach signal.h about one of these
>>> bogus macros. What do you think?
>>>
>>>   
>>>       
>> Dumb question, why do we need devel/pth?  Isn't the native pthread 
>> support sufficient?
>>
>>     Sam
>>
>>     
>
> For whatever reason, both security/libassuan and security/gnupg want
> pth.
>
> I was able to solve the problem by removing the "#include "
> from the offending file (there is only one) in devel/pth. After that, it
> built fine and I am using it now.
>
> Maybe devel/pth doesn't even really need to #include 
> anymore....
>   

Well a recent foray into dealing with this ports breakage made me 
question why we drag in various packages.  devel/pth is one example; I 
see many others scroll by that appear to duplicate functionality in the 
base system.  At the end of the day it's clearly an issue of maintenance 
overhead--we'd have to mod apps to do things like remove use of 
gnu-long-opts in to switch away from things like gtar and the savings is 
unclear.  But I can ask...

    Sam


From owner-svn-src-head@FreeBSD.ORG  Fri Mar 20 17:48:36 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D88BE106564A;
	Fri, 20 Mar 2009 17:48:36 +0000 (UTC)
	(envelope-from rnoland@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C68348FC16;
	Fri, 20 Mar 2009 17:48:36 +0000 (UTC)
	(envelope-from rnoland@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2KHmaT7009133;
	Fri, 20 Mar 2009 17:48:36 GMT (envelope-from rnoland@svn.freebsd.org)
Received: (from rnoland@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2KHmaos009132;
	Fri, 20 Mar 2009 17:48:36 GMT (envelope-from rnoland@svn.freebsd.org)
Message-Id: <200903201748.n2KHmaos009132@svn.freebsd.org>
From: Robert Noland 
Date: Fri, 20 Mar 2009 17: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: r190163 - head/sys/dev/drm
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 20 Mar 2009 17:48:37 -0000

Author: rnoland
Date: Fri Mar 20 17:48:36 2009
New Revision: 190163
URL: http://svn.freebsd.org/changeset/base/190163

Log:
  Don't deref dev->dev_private before checking that it exists.
  
  Found with:	Coverity Prevent(tm)
  CID:		2940
  
  MFC after:	3 days

Modified:
  head/sys/dev/drm/i915_drv.c

Modified: head/sys/dev/drm/i915_drv.c
==============================================================================
--- head/sys/dev/drm/i915_drv.c	Fri Mar 20 17:11:45 2009	(r190162)
+++ head/sys/dev/drm/i915_drv.c	Fri Mar 20 17:48:36 2009	(r190163)
@@ -46,9 +46,8 @@ static drm_pci_id_list_t i915_pciidlist[
 static int i915_suspend(device_t kdev)
 {
 	struct drm_device *dev = device_get_softc(kdev);
-	struct drm_i915_private *dev_priv = dev->dev_private;
 
-	if (!dev || !dev_priv) {
+	if (!dev || !dev->dev_private) {
 		DRM_ERROR("dev: 0x%lx, dev_priv: 0x%lx\n",
 			(unsigned long) dev, (unsigned long) dev_priv);
 		DRM_ERROR("DRM not initialized, aborting suspend.\n");

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 20 17:51:26 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DC5F810656C0;
	Fri, 20 Mar 2009 17:51:26 +0000 (UTC)
	(envelope-from rnoland@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id CA3138FC26;
	Fri, 20 Mar 2009 17:51:26 +0000 (UTC)
	(envelope-from rnoland@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2KHpQLi009222;
	Fri, 20 Mar 2009 17:51:26 GMT (envelope-from rnoland@svn.freebsd.org)
Received: (from rnoland@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2KHpQAi009221;
	Fri, 20 Mar 2009 17:51:26 GMT (envelope-from rnoland@svn.freebsd.org)
Message-Id: <200903201751.n2KHpQAi009221@svn.freebsd.org>
From: Robert Noland 
Date: Fri, 20 Mar 2009 17:51: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: r190164 - head/sys/dev/drm
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 20 Mar 2009 17:51:27 -0000

Author: rnoland
Date: Fri Mar 20 17:51:26 2009
New Revision: 190164
URL: http://svn.freebsd.org/changeset/base/190164

Log:
  Fix what appears to be a typo, and restore the registers correctly.
  
  Found with:	Coverity Prevent(tm)
  CID: 		2454

Modified:
  head/sys/dev/drm/i915_suspend.c

Modified: head/sys/dev/drm/i915_suspend.c
==============================================================================
--- head/sys/dev/drm/i915_suspend.c	Fri Mar 20 17:48:36 2009	(r190163)
+++ head/sys/dev/drm/i915_suspend.c	Fri Mar 20 17:51:26 2009	(r190164)
@@ -515,7 +515,7 @@ int i915_restore_state(struct drm_device
 
 	for (i = 0; i < 16; i++) {
 		I915_WRITE(SWF00 + (i << 2), dev_priv->saveSWF0[i]);
-		I915_WRITE(SWF10 + (i << 2), dev_priv->saveSWF1[i+7]);
+		I915_WRITE(SWF10 + (i << 2), dev_priv->saveSWF1[i]);
 	}
 	for (i = 0; i < 3; i++)
 		I915_WRITE(SWF30 + (i << 2), dev_priv->saveSWF2[i]);

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 20 18:01:32 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B4B941065673;
	Fri, 20 Mar 2009 18:01:32 +0000 (UTC)
	(envelope-from rnoland@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A2BA18FC0C;
	Fri, 20 Mar 2009 18:01:32 +0000 (UTC)
	(envelope-from rnoland@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2KI1WFg009538;
	Fri, 20 Mar 2009 18:01:32 GMT (envelope-from rnoland@svn.freebsd.org)
Received: (from rnoland@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2KI1Wer009537;
	Fri, 20 Mar 2009 18:01:32 GMT (envelope-from rnoland@svn.freebsd.org)
Message-Id: <200903201801.n2KI1Wer009537@svn.freebsd.org>
From: Robert Noland 
Date: Fri, 20 Mar 2009 18:01: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: r190166 - head/sys/dev/drm
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 20 Mar 2009 18:01:33 -0000

Author: rnoland
Date: Fri Mar 20 18:01:32 2009
New Revision: 190166
URL: http://svn.freebsd.org/changeset/base/190166

Log:
  Remove the DRM_ERROR to fix build.  It didn't make any sense anyway.
  
  MFC after:	3 days

Modified:
  head/sys/dev/drm/i915_drv.c

Modified: head/sys/dev/drm/i915_drv.c
==============================================================================
--- head/sys/dev/drm/i915_drv.c	Fri Mar 20 18:00:19 2009	(r190165)
+++ head/sys/dev/drm/i915_drv.c	Fri Mar 20 18:01:32 2009	(r190166)
@@ -48,8 +48,6 @@ static int i915_suspend(device_t kdev)
 	struct drm_device *dev = device_get_softc(kdev);
 
 	if (!dev || !dev->dev_private) {
-		DRM_ERROR("dev: 0x%lx, dev_priv: 0x%lx\n",
-			(unsigned long) dev, (unsigned long) dev_priv);
 		DRM_ERROR("DRM not initialized, aborting suspend.\n");
 		return -ENODEV;
 	}

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 20 18:10:45 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DD7811065675;
	Fri, 20 Mar 2009 18:10:45 +0000 (UTC)
	(envelope-from bruce@cran.org.uk)
Received: from muon.cran.org.uk (brucec-1-pt.tunnel.tserv4.nyc4.ipv6.he.net
	[IPv6:2001:470:1f06:c09::2])
	by mx1.freebsd.org (Postfix) with ESMTP id 941358FC1D;
	Fri, 20 Mar 2009 18:10:45 +0000 (UTC)
	(envelope-from bruce@cran.org.uk)
Received: from muon.cran.org.uk (localhost [127.0.0.1])
	by muon.cran.org.uk (Postfix) with ESMTP id D08861902C;
	Fri, 20 Mar 2009 18:10:43 +0000 (GMT)
X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on muon
X-Spam-Level: 
X-Spam-Status: No, score=-2.5 required=8.0 tests=AWL,BAYES_00,NO_RELAYS
	autolearn=ham version=3.2.5
Received: from gluon (unknown [IPv6:2a01:348:10f:0:240:f4ff:fe57:9871])
	(using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))
	(No client certificate requested)
	by muon.cran.org.uk (Postfix) with ESMTPSA;
	Fri, 20 Mar 2009 18:10:43 +0000 (GMT)
Date: Fri, 20 Mar 2009 18:10:36 +0000
From: Bruce Cran 
To: Sam Leffler 
Message-ID: <20090320181036.3589c284@gluon>
In-Reply-To: <49C3D518.6070105@freebsd.org>
References: <200903142010.n2EKAESF006945@svn.freebsd.org>
	<20090320140015.GA17645@hub.freebsd.org>
	<20090320153405.GA62675@zim.MIT.EDU> <49C3BCD4.4030605@freebsd.org>
	<1237567495.1993.2.camel@localhost> <49C3D518.6070105@freebsd.org>
X-Mailer: Claws Mail 3.6.1 (GTK+ 2.15.5; i486-pc-linux-gnu)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@freebsd.org, Vasil Dimov ,
	svn-src-all@freebsd.org, src-committers@freebsd.org,
	Coleman Kane 
Subject: Re: svn commit: r189828 - in head: include 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: Fri, 20 Mar 2009 18:10:47 -0000

On Fri, 20 Mar 2009 10:40:40 -0700
Sam Leffler  wrote:

> Coleman Kane wrote:
> > On Fri, 2009-03-20 at 08:57 -0700, Sam Leffler wrote:
    
> >> Dumb question, why do we need devel/pth?  Isn't the native pthread 
> >> support sufficient?
> >>
> >>     Sam
> >>
> >>     
> >
> > For whatever reason, both security/libassuan and security/gnupg want
> > pth.
> >
> > I was able to solve the problem by removing the "#include
> > " from the offending file (there is only one) in
> > devel/pth. After that, it built fine and I am using it now.
> >
> > Maybe devel/pth doesn't even really need to #include 
> > anymore....
> >   
> 
> Well a recent foray into dealing with this ports breakage made me 
> question why we drag in various packages.  devel/pth is one example;
> I see many others scroll by that appear to duplicate functionality in
> the base system.  At the end of the day it's clearly an issue of
> maintenance overhead--we'd have to mod apps to do things like remove
> use of gnu-long-opts in to switch away from things like gtar and the
> savings is unclear.  But I can ask...

The only explanation I've found as to why gnupg requires pth and
doesn't just use the OS's
own pthreads implementation
is at http://markmail.org/message/3euqd4xfg6e5ehc7 

-- 
Bruce Cran

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 20 18:21:08 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0A00F106567A
	for ; Fri, 20 Mar 2009 18:21:08 +0000 (UTC)
	(envelope-from cokane@FreeBSD.org)
Received: from mail-out1.fuse.net (mail-out1.fuse.net [216.68.8.175])
	by mx1.freebsd.org (Postfix) with ESMTP id B3BBB8FC15
	for ; Fri, 20 Mar 2009 18:21:07 +0000 (UTC)
	(envelope-from cokane@FreeBSD.org)
X-CNFS-Analysis: v=1.0 c=1 a=r_5zXaxxhK4A:10 a=SrmVwFdnOH0A:10
	a=6I5d2MoRAAAA:8 a=mDV3o1hIAAAA:8 a=tVtli89e7P5fUUDGNEkA:9
	a=sHmOR11LvyQCMGWePOYA:7 a=gOTDsefWpYLdnwcWseGZ4D1YLwEA:4
	a=LY0hPdMaydYA:10 a=3our312xe5wwGToX:21 a=5q22virFVcgRI0ER:21
	a=2l8Pv3DlLmjInSRyVz8A:9 a=6hzxJyPt57ZiYCNgerb-OijkPcsA:4
	a=rPt6xJ-oxjAA:10
X-CM-Score: 0
X-Scanned-by: Cloudmark Authority Engine
Authentication-Results: gwout1 smtp.mail=cokane@FreeBSD.org; spf=softfail
Received-SPF: softfail (gwout1: transitional domain FreeBSD.org does not
	designate 74.215.227.9 as permitted sender)
Received: from [74.215.227.9] ([74.215.227.9:50399] helo=discordia)
	by gwout1 (envelope-from )
	(ecelerity 2.2.2.37 r(28805/28810M)) with ESMTP
	id DA/39-27669-29ED3C94; Fri, 20 Mar 2009 14:21:06 -0400
Received: by discordia (Postfix, from userid 103)
	id 75CB135A7F2; Fri, 20 Mar 2009 14:21:06 -0400 (EDT)
X-Spam-Checker-Version: SpamAssassin 3.1.8-gr1 (2007-02-13) on discordia
X-Spam-Level: 
X-Spam-Status: No, score=-3.5 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,
	URIBL_SBL autolearn=ham version=3.1.8-gr1
Received: from [172.31.1.6] (unknown [172.31.1.6])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by discordia (Postfix) with ESMTP id 7C27F35A7F1;
	Fri, 20 Mar 2009 14:20:58 -0400 (EDT)
From: Coleman Kane 
To: Sam Leffler 
In-Reply-To: <49C3D518.6070105@freebsd.org>
References: <200903142010.n2EKAESF006945@svn.freebsd.org>
	<20090320140015.GA17645@hub.freebsd.org>
	<20090320153405.GA62675@zim.MIT.EDU>  <49C3BCD4.4030605@freebsd.org>
	<1237567495.1993.2.camel@localhost>  <49C3D518.6070105@freebsd.org>
Content-Type: multipart/signed; micalg="pgp-sha1";
	protocol="application/pgp-signature";
	boundary="=-pMvLpvf7zNpuZdBfNYIa"
Organization: FreeBSD Project
Date: Fri, 20 Mar 2009 14:19:35 -0400
Message-Id: <1237573175.1993.19.camel@localhost>
Mime-Version: 1.0
X-Mailer: Evolution 2.24.5 FreeBSD GNOME Team Port 
Cc: svn-src-head@freebsd.org, Vasil Dimov ,
	svn-src-all@freebsd.org, src-committers@freebsd.org
Subject: Re: svn commit: r189828 - in head: include 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: Fri, 20 Mar 2009 18:21:08 -0000


--=-pMvLpvf7zNpuZdBfNYIa
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

On Fri, 2009-03-20 at 10:40 -0700, Sam Leffler wrote:
> Coleman Kane wrote:
> > On Fri, 2009-03-20 at 08:57 -0700, Sam Leffler wrote:
> >  =20
> >> David Schultz wrote:
> >>    =20
> >>> On Fri, Mar 20, 2009, Vasil Dimov wrote:
> >>>  =20
> >>>      =20
> >>>> On Sat, Mar 14, 2009 at 08:10:14PM +0000, David Schultz wrote:
> >>>>    =20
> >>>>        =20
> >>>>> Author: das
> >>>>> Date: Sat Mar 14 20:10:14 2009
> >>>>> New Revision: 189828
> >>>>> URL: http://svn.freebsd.org/changeset/base/189828
> >>>>>
> >>>>> Log:
> >>>>>   Fix the visibility of several prototypes. Also move pthread_kill(=
) and
> >>>>>   pthread_sigmask() to signal.h. In principle, this shouldn't break=
 anything,
> >>>>>      =20
> >>>>>          =20
> >>>> [...]
> >>>>
> >>>> But it did break, see http://www.freebsd.org/cgi/query-pr.cgi?pr=3D1=
32828
> >>>>
> >>>> I think one's namespace shouldn't be polluted with the prototype of
> >>>> pthread_kill() if he has not included pthread.h.
> >>>>    =20
> >>>>        =20
> >>> The pthreads API has always defined pthread_kill() to be in
> >>> signal.h, not pthread.h. This is what is done in glibc and
> >>> elsewhere.
> >>>
> >>> GNU Pth has some bogus and extremely unportable hacks to ``trick''
> >>> system headers into not declaring symbols:
> >>>
> >>>   /*
> >>>    * Prevent system includes from implicitly including
> >>>    * possibly existing vendor Pthread headers
> >>>    */
> >>>   #define PTHREAD
> >>>   #define PTHREAD_H
> >>>   #define _PTHREAD_T
> >>>   #define _PTHREAD_H
> >>>   #define _PTHREAD_H_
> >>>   #define PTHREAD_INCLUDED
> >>>   #define _PTHREAD_INCLUDED
> >>>   #define SYS_PTHREAD_H
> >>>   #define _SYS_PTHREAD_H
> >>>   #define _SYS_PTHREAD_H_
> >>>   #define SYS_PTHREAD_INCLUDED
> >>>   #define _SYS_PTHREAD_INCLUDED
> >>>   #define BITS_PTHREADTYPES_H
> >>>   #define _BITS_PTHREADTYPES_H
> >>>   #define _BITS_PTHREADTYPES_H_
> >>>   #define _BITS_SIGTHREAD_H
> >>>
> >>> The one that works for glibc is _BITS_SIGTHREAD_H. I'd rather not
> >>> be complicit in these shenanigans, but if we can't easily fix the
> >>> problem in Pth, I suppose we can teach signal.h about one of these
> >>> bogus macros. What do you think?
> >>>
> >>>  =20
> >>>      =20
> >> Dumb question, why do we need devel/pth?  Isn't the native pthread=20
> >> support sufficient?
> >>
> >>     Sam
> >>
> >>    =20
> >
> > For whatever reason, both security/libassuan and security/gnupg want
> > pth.
> >
> > I was able to solve the problem by removing the "#include "
> > from the offending file (there is only one) in devel/pth. After that, i=
t
> > built fine and I am using it now.
> >
> > Maybe devel/pth doesn't even really need to #include 
> > anymore....
> >  =20
>=20
> Well a recent foray into dealing with this ports breakage made me=20
> question why we drag in various packages.  devel/pth is one example; I=20
> see many others scroll by that appear to duplicate functionality in the=20
> base system.  At the end of the day it's clearly an issue of maintenance=20
> overhead--we'd have to mod apps to do things like remove use of=20
> gnu-long-opts in to switch away from things like gtar and the savings is=20
> unclear.  But I can ask...
>=20
>     Sam
>=20

I've found that many of the GNU apps are notorious for this. I really
can't say that I know why libassuan or gnupg explicitly require GNU pth,
rather than first attempting to use POSIX pthread API. Their configure
scripts both want to search for and run pth-config, and fail to enable
some sort of threaded features if it doesn't exist. I already tried
removing pth stuff from both port Makefiles to see what would happen. I
didn't spend much time on it after I figured out that devel/pth would
just work if I removed the signal.h include.

I am guessing that some non-standard extensions which GNU pth provides
are not provided by the normal POSIX spec.

In fact, libassuan just goes ahead and uses a bunch of pth_* overrides
for dealing with them in a thread-safe manner (waitpid, read, write,
select, usleep).

According to GnuPG (security/gnupg in the configure.ac file):
*** To support concurrent access to the gpg-agent and the SCdaemon
*** we need the support of the GNU Portable Threads Library.
*** Download it from ftp://ftp.gnu.org/gnu/pth/
*** On a Debian GNU/Linux system you might want to try
***   apt-get install libpth-dev

--=20
Coleman Kane

--=-pMvLpvf7zNpuZdBfNYIa
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (FreeBSD)

iEUEABECAAYFAknD3jcACgkQcMSxQcXat5e7/gCcDlgCxULcbgTEj2q89CbRChlu
WiwAmJteH+rbT4/avhddMACqM4YFlcI=
=6CFn
-----END PGP SIGNATURE-----

--=-pMvLpvf7zNpuZdBfNYIa--


From owner-svn-src-head@FreeBSD.ORG  Fri Mar 20 18:29:53 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1ADB61065673;
	Fri, 20 Mar 2009 18:29:53 +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 092418FC08;
	Fri, 20 Mar 2009 18:29:53 +0000 (UTC)
	(envelope-from delphij@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2KITq6d010209;
	Fri, 20 Mar 2009 18:29:52 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2KITqBk010208;
	Fri, 20 Mar 2009 18:29:52 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <200903201829.n2KITqBk010208@svn.freebsd.org>
From: Xin LI 
Date: Fri, 20 Mar 2009 18: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: r190168 - head/usr.bin/kdump
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 20 Mar 2009 18:29:53 -0000

Author: delphij
Date: Fri Mar 20 18:29:52 2009
New Revision: 190168
URL: http://svn.freebsd.org/changeset/base/190168

Log:
  Add two missing include files and prototype for sockfamilyname()
  which is generated by mksubr.

Modified:
  head/usr.bin/kdump/kdump.c

Modified: head/usr.bin/kdump/kdump.c
==============================================================================
--- head/usr.bin/kdump/kdump.c	Fri Mar 20 18:04:20 2009	(r190167)
+++ head/usr.bin/kdump/kdump.c	Fri Mar 20 18:29:52 2009	(r190168)
@@ -67,7 +67,9 @@ extern int errno;
 #ifdef NETATALK
 #include 
 #endif
+#include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -98,6 +100,7 @@ void ktrsockaddr(struct sockaddr *);
 void ktrstat(struct stat *);
 void ktrstruct(char *, size_t);
 void usage(void);
+void sockfamilyname(int);
 const char *ioctlname(u_long);
 
 int timestamp, decimal, fancy = 1, suppressdata, tail, threads, maxdata,

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 20 18:30:21 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 01B3F1065744;
	Fri, 20 Mar 2009 18:30:21 +0000 (UTC)
	(envelope-from rnoland@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E353F8FC22;
	Fri, 20 Mar 2009 18:30:20 +0000 (UTC)
	(envelope-from rnoland@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2KIUKS7010269;
	Fri, 20 Mar 2009 18:30:20 GMT (envelope-from rnoland@svn.freebsd.org)
Received: (from rnoland@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2KIUKtr010264;
	Fri, 20 Mar 2009 18:30:20 GMT (envelope-from rnoland@svn.freebsd.org)
Message-Id: <200903201830.n2KIUKtr010264@svn.freebsd.org>
From: Robert Noland 
Date: Fri, 20 Mar 2009 18:30:20 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190169 - head/sys/dev/agp
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 20 Mar 2009 18:30:21 -0000

Author: rnoland
Date: Fri Mar 20 18:30:20 2009
New Revision: 190169
URL: http://svn.freebsd.org/changeset/base/190169

Log:
  vm_offset_t is unsigned and therefore can not be negative.
  Avoid unnessecary compares.
  
  Found with:	Coverity Prevent(tm)
  CID:		2362,4215,4214,4209,4208,2363,4211,4210,4213,4212
  
  MFC after:	3 days

Modified:
  head/sys/dev/agp/agp.c
  head/sys/dev/agp/agp_amd64.c
  head/sys/dev/agp/agp_i810.c
  head/sys/dev/agp/agp_intel.c
  head/sys/dev/agp/agp_via.c

Modified: head/sys/dev/agp/agp.c
==============================================================================
--- head/sys/dev/agp/agp.c	Fri Mar 20 18:29:52 2009	(r190168)
+++ head/sys/dev/agp/agp.c	Fri Mar 20 18:30:20 2009	(r190169)
@@ -532,7 +532,7 @@ agp_generic_bind_memory(device_t dev, st
 	int error;
 
 	/* Do some sanity checks first. */
-	if (offset < 0 || (offset & (AGP_PAGE_SIZE - 1)) != 0 ||
+	if ((offset & (AGP_PAGE_SIZE - 1)) != 0 ||
 	    offset + mem->am_size > AGP_GET_APERTURE(dev)) {
 		device_printf(dev, "binding memory at bad offset %#x\n",
 		    (int)offset);

Modified: head/sys/dev/agp/agp_amd64.c
==============================================================================
--- head/sys/dev/agp/agp_amd64.c	Fri Mar 20 18:29:52 2009	(r190168)
+++ head/sys/dev/agp/agp_amd64.c	Fri Mar 20 18:30:20 2009	(r190169)
@@ -337,7 +337,7 @@ agp_amd64_bind_page(device_t dev, vm_off
 {
 	struct agp_amd64_softc *sc = device_get_softc(dev);
 
-	if (offset < 0 || offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT))
+	if (offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT))
 		return (EINVAL);
 
 	sc->gatt->ag_virtual[offset >> AGP_PAGE_SHIFT] =
@@ -351,7 +351,7 @@ agp_amd64_unbind_page(device_t dev, vm_o
 {
 	struct agp_amd64_softc *sc = device_get_softc(dev);
 
-	if (offset < 0 || offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT))
+	if (offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT))
 		return (EINVAL);
 
 	sc->gatt->ag_virtual[offset >> AGP_PAGE_SHIFT] = 0;

Modified: head/sys/dev/agp/agp_i810.c
==============================================================================
--- head/sys/dev/agp/agp_i810.c	Fri Mar 20 18:29:52 2009	(r190168)
+++ head/sys/dev/agp/agp_i810.c	Fri Mar 20 18:30:20 2009	(r190169)
@@ -840,7 +840,7 @@ agp_i810_bind_page(device_t dev, vm_offs
 {
 	struct agp_i810_softc *sc = device_get_softc(dev);
 
-	if (offset < 0 || offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT)) {
+	if (offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT)) {
 		device_printf(dev, "failed: offset is 0x%08jx, shift is %d, entries is %d\n", (intmax_t)offset, AGP_PAGE_SHIFT, sc->gatt->ag_entries);
 		return EINVAL;
 	}
@@ -862,7 +862,7 @@ agp_i810_unbind_page(device_t dev, vm_of
 {
 	struct agp_i810_softc *sc = device_get_softc(dev);
 
-	if (offset < 0 || offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT))
+	if (offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT))
 		return EINVAL;
 
 	if ( sc->chiptype != CHIP_I810 ) {
@@ -1016,7 +1016,7 @@ agp_i810_bind_memory(device_t dev, struc
 	vm_offset_t i;
 
 	/* Do some sanity checks first. */
-	if (offset < 0 || (offset & (AGP_PAGE_SIZE - 1)) != 0 ||
+	if ((offset & (AGP_PAGE_SIZE - 1)) != 0 ||
 	    offset + mem->am_size > AGP_GET_APERTURE(dev)) {
 		device_printf(dev, "binding memory at bad offset %#x\n",
 		    (int)offset);

Modified: head/sys/dev/agp/agp_intel.c
==============================================================================
--- head/sys/dev/agp/agp_intel.c	Fri Mar 20 18:29:52 2009	(r190168)
+++ head/sys/dev/agp/agp_intel.c	Fri Mar 20 18:30:20 2009	(r190169)
@@ -371,7 +371,7 @@ agp_intel_bind_page(device_t dev, vm_off
 
 	sc = device_get_softc(dev);
 
-	if (offset < 0 || offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT))
+	if (offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT))
 		return (EINVAL);
 
 	sc->gatt->ag_virtual[offset >> AGP_PAGE_SHIFT] = physical | 0x17;
@@ -385,7 +385,7 @@ agp_intel_unbind_page(device_t dev, vm_o
 
 	sc = device_get_softc(dev);
 
-	if (offset < 0 || offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT))
+	if (offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT))
 		return (EINVAL);
 
 	sc->gatt->ag_virtual[offset >> AGP_PAGE_SHIFT] = 0;

Modified: head/sys/dev/agp/agp_via.c
==============================================================================
--- head/sys/dev/agp/agp_via.c	Fri Mar 20 18:29:52 2009	(r190168)
+++ head/sys/dev/agp/agp_via.c	Fri Mar 20 18:30:20 2009	(r190169)
@@ -362,7 +362,7 @@ agp_via_bind_page(device_t dev, vm_offse
 {
 	struct agp_via_softc *sc = device_get_softc(dev);
 
-	if (offset < 0 || offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT))
+	if (offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT))
 		return EINVAL;
 
 	sc->gatt->ag_virtual[offset >> AGP_PAGE_SHIFT] = physical;
@@ -374,7 +374,7 @@ agp_via_unbind_page(device_t dev, vm_off
 {
 	struct agp_via_softc *sc = device_get_softc(dev);
 
-	if (offset < 0 || offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT))
+	if (offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT))
 		return EINVAL;
 
 	sc->gatt->ag_virtual[offset >> AGP_PAGE_SHIFT] = 0;

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 20 18:35:16 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 83D1410656C3;
	Fri, 20 Mar 2009 18:35:16 +0000 (UTC)
	(envelope-from rnoland@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 7152D8FC1C;
	Fri, 20 Mar 2009 18:35:16 +0000 (UTC)
	(envelope-from rnoland@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2KIZGfm010429;
	Fri, 20 Mar 2009 18:35:16 GMT (envelope-from rnoland@svn.freebsd.org)
Received: (from rnoland@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2KIZGxf010428;
	Fri, 20 Mar 2009 18:35:16 GMT (envelope-from rnoland@svn.freebsd.org)
Message-Id: <200903201835.n2KIZGxf010428@svn.freebsd.org>
From: Robert Noland 
Date: Fri, 20 Mar 2009 18:35: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: r190170 - head/sys/dev/drm
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 20 Mar 2009 18:35:17 -0000

Author: rnoland
Date: Fri Mar 20 18:35:16 2009
New Revision: 190170
URL: http://svn.freebsd.org/changeset/base/190170

Log:
  vm_offset_t is unsigned, so compare of >= 0 is not needed.
  
  Found with:	Coverity Prevent(tm)
  CID:		2259
  
  MFC after:	3 days

Modified:
  head/sys/dev/drm/drm_vm.c

Modified: head/sys/dev/drm/drm_vm.c
==============================================================================
--- head/sys/dev/drm/drm_vm.c	Fri Mar 20 18:30:20 2009	(r190169)
+++ head/sys/dev/drm/drm_vm.c	Fri Mar 20 18:35:16 2009	(r190170)
@@ -54,7 +54,7 @@ int drm_mmap(struct cdev *kdev, vm_offse
 	if (file_priv && !file_priv->authenticated)
 		return EACCES;
 
-	if (dev->dma && offset >= 0 && offset < ptoa(dev->dma->page_count)) {
+	if (dev->dma && offset < ptoa(dev->dma->page_count)) {
 		drm_device_dma_t *dma = dev->dma;
 
 		DRM_SPINLOCK(&dev->dma_lock);

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 20 18:51:14 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3A7021065675;
	Fri, 20 Mar 2009 18:51:14 +0000 (UTC)
	(envelope-from rnoland@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 28EDF8FC14;
	Fri, 20 Mar 2009 18:51:14 +0000 (UTC)
	(envelope-from rnoland@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2KIpEh9010752;
	Fri, 20 Mar 2009 18:51:14 GMT (envelope-from rnoland@svn.freebsd.org)
Received: (from rnoland@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2KIpEbN010751;
	Fri, 20 Mar 2009 18:51:14 GMT (envelope-from rnoland@svn.freebsd.org)
Message-Id: <200903201851.n2KIpEbN010751@svn.freebsd.org>
From: Robert Noland 
Date: Fri, 20 Mar 2009 18:51: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: r190171 - 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: Fri, 20 Mar 2009 18:51:14 -0000

Author: rnoland
Date: Fri Mar 20 18:51:13 2009
New Revision: 190171
URL: http://svn.freebsd.org/changeset/base/190171

Log:
  Replace anholt with myself as drm maintainer.
  
  Noticed by:	miwi
  
  MFC after:	3 days

Modified:
  head/MAINTAINERS

Modified: head/MAINTAINERS
==============================================================================
--- head/MAINTAINERS	Fri Mar 20 18:35:16 2009	(r190170)
+++ head/MAINTAINERS	Fri Mar 20 18:51:13 2009	(r190171)
@@ -76,7 +76,7 @@ groff		ru	Recommends pre-commit review.
 share/mk	ru	This is a vital component of the build system, so I
 			offer a pre-commit review for anything non-trivial.
 ipfw		ipfw	Pre-commit review preferred. send to ipfw@freebsd.org
-drm		anholt	Just keep me informed of changes, try not to break it.
+drm		rnoland	Just keep me informed of changes, try not to break it.
 libufs		jmallett	Willing to handle problems, help with work.
 fdc(4)		joerg	Just keep me informed of changes, try not to break it.
 sppp(4)		joerg	Just keep me informed of changes, try not to break it.

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 20 18:56:28 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8B49A10656D0;
	Fri, 20 Mar 2009 18:56:28 +0000 (UTC)
	(envelope-from thompsa@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 77B218FC14;
	Fri, 20 Mar 2009 18:56:28 +0000 (UTC)
	(envelope-from thompsa@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2KIuSgt010896;
	Fri, 20 Mar 2009 18:56:28 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2KIuSl3010888;
	Fri, 20 Mar 2009 18:56:28 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <200903201856.n2KIuSl3010888@svn.freebsd.org>
From: Andrew Thompson 
Date: Fri, 20 Mar 2009 18:56: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: r190172 - in head/sys/dev/usb: input serial 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: Fri, 20 Mar 2009 18:56:29 -0000

Author: thompsa
Date: Fri Mar 20 18:56:27 2009
New Revision: 190172
URL: http://svn.freebsd.org/changeset/base/190172

Log:
  MFp4 //depot/projects/usb @159375,159376,159377
  
  Further remove dependancy towards Giant.
  
  Submitted by:	Hans Petter Selasky

Modified:
  head/sys/dev/usb/input/uhid.c
  head/sys/dev/usb/input/ums.c
  head/sys/dev/usb/serial/ubser.c
  head/sys/dev/usb/serial/ucycom.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

Modified: head/sys/dev/usb/input/uhid.c
==============================================================================
--- head/sys/dev/usb/input/uhid.c	Fri Mar 20 18:51:13 2009	(r190171)
+++ head/sys/dev/usb/input/uhid.c	Fri Mar 20 18:56:27 2009	(r190172)
@@ -668,8 +668,8 @@ uhid_attach(device_t dev)
 			 * feature report ID 2 before it'll start
 			 * returning digitizer data.
 			 */
-			error = usb2_req_set_report
-			    (uaa->device, &Giant, reportbuf, sizeof(reportbuf),
+			error = usb2_req_set_report(uaa->device, NULL,
+			    reportbuf, sizeof(reportbuf),
 			    uaa->info.bIfaceIndex, UHID_FEATURE_REPORT, 2);
 
 			if (error) {
@@ -691,16 +691,16 @@ uhid_attach(device_t dev)
 	}
 	if (sc->sc_repdesc_ptr == NULL) {
 
-		error = usb2_req_get_hid_desc
-		    (uaa->device, &Giant, &sc->sc_repdesc_ptr,
-		    &sc->sc_repdesc_size, M_USBDEV, uaa->info.bIfaceIndex);
+		error = usb2_req_get_hid_desc(uaa->device, NULL,
+		    &sc->sc_repdesc_ptr, &sc->sc_repdesc_size,
+		    M_USBDEV, uaa->info.bIfaceIndex);
 
 		if (error) {
 			device_printf(dev, "no report descriptor\n");
 			goto detach;
 		}
 	}
-	error = usb2_req_set_idle(uaa->device, &Giant,
+	error = usb2_req_set_idle(uaa->device, NULL,
 	    uaa->info.bIfaceIndex, 0, 0);
 
 	if (error) {

Modified: head/sys/dev/usb/input/ums.c
==============================================================================
--- head/sys/dev/usb/input/ums.c	Fri Mar 20 18:51:13 2009	(r190171)
+++ head/sys/dev/usb/input/ums.c	Fri Mar 20 18:56:27 2009	(r190172)
@@ -338,7 +338,7 @@ ums_probe(device_t dev)
 	    (id->bInterfaceClass != UICLASS_HID))
 		return (ENXIO);
 
-	error = usb2_req_get_hid_desc(uaa->device, &Giant,
+	error = usb2_req_get_hid_desc(uaa->device, NULL,
 	    &d_ptr, &d_len, M_TEMP, uaa->info.bIfaceIndex);
 
 	if (error)
@@ -395,8 +395,7 @@ ums_attach(device_t dev)
 		DPRINTF("error=%s\n", usb2_errstr(err));
 		goto detach;
 	}
-	err = usb2_req_get_hid_desc
-	    (uaa->device, &Giant, &d_ptr,
+	err = usb2_req_get_hid_desc(uaa->device, NULL, &d_ptr,
 	    &d_len, M_TEMP, uaa->info.bIfaceIndex);
 
 	if (err) {

Modified: head/sys/dev/usb/serial/ubser.c
==============================================================================
--- head/sys/dev/usb/serial/ubser.c	Fri Mar 20 18:51:13 2009	(r190171)
+++ head/sys/dev/usb/serial/ubser.c	Fri Mar 20 18:56:27 2009	(r190172)
@@ -244,8 +244,8 @@ ubser_attach(device_t dev)
 	req.wIndex[0] = sc->sc_iface_no;
 	req.wIndex[1] = 0;
 	USETW(req.wLength, 1);
-	error = usb2_do_request_flags
-	    (uaa->device, &Giant, &req, &sc->sc_numser,
+	error = usb2_do_request_flags(uaa->device, NULL,
+	    &req, &sc->sc_numser,
 	    0, NULL, USB_DEFAULT_TIMEOUT);
 
 	if (error || (sc->sc_numser == 0)) {

Modified: head/sys/dev/usb/serial/ucycom.c
==============================================================================
--- head/sys/dev/usb/serial/ucycom.c	Fri Mar 20 18:51:13 2009	(r190171)
+++ head/sys/dev/usb/serial/ucycom.c	Fri Mar 20 18:56:27 2009	(r190172)
@@ -222,8 +222,7 @@ ucycom_attach(device_t dev)
 
 	/* get report descriptor */
 
-	error = usb2_req_get_hid_desc
-	    (uaa->device, &Giant,
+	error = usb2_req_get_hid_desc(uaa->device, NULL,
 	    &urd_ptr, &urd_len, M_USBDEV,
 	    UCYCOM_IFACE_INDEX);
 

Modified: head/sys/dev/usb/serial/umodem.c
==============================================================================
--- head/sys/dev/usb/serial/umodem.c	Fri Mar 20 18:51:13 2009	(r190171)
+++ head/sys/dev/usb/serial/umodem.c	Fri Mar 20 18:56:27 2009	(r190172)
@@ -769,7 +769,7 @@ umodem_set_comm_feature(struct usb2_devi
 	USETW(req.wLength, UCDC_ABSTRACT_STATE_LENGTH);
 	USETW(ast.wState, state);
 
-	return (usb2_do_request(udev, &Giant, &req, &ast));
+	return (usb2_do_request(udev, NULL, &req, &ast));
 }
 
 static int

Modified: head/sys/dev/usb/serial/uplcom.c
==============================================================================
--- head/sys/dev/usb/serial/uplcom.c	Fri Mar 20 18:51:13 2009	(r190171)
+++ head/sys/dev/usb/serial/uplcom.c	Fri Mar 20 18:56:27 2009	(r190172)
@@ -441,7 +441,7 @@ uplcom_reset(struct uplcom_softc *sc, st
 	req.wIndex[1] = 0;
 	USETW(req.wLength, 0);
 
-	return (usb2_do_request(udev, &Giant, &req, NULL));
+	return (usb2_do_request(udev, NULL, &req, NULL));
 }
 
 struct pl2303x_init {
@@ -485,7 +485,7 @@ uplcom_pl2303x_init(struct usb2_device *
 		USETW(req.wIndex, pl2303x[i].index);
 		USETW(req.wLength, pl2303x[i].length);
 
-		err = usb2_do_request(udev, &Giant, &req, buf);
+		err = usb2_do_request(udev, NULL, &req, buf);
 		if (err) {
 			DPRINTF("error=%s\n", usb2_errstr(err));
 			return (EIO);

Modified: head/sys/dev/usb/serial/uvisor.c
==============================================================================
--- head/sys/dev/usb/serial/uvisor.c	Fri Mar 20 18:51:13 2009	(r190171)
+++ head/sys/dev/usb/serial/uvisor.c	Fri Mar 20 18:56:27 2009	(r190172)
@@ -373,8 +373,8 @@ uvisor_init(struct uvisor_softc *sc, str
 		USETW(req.wValue, 0);
 		USETW(req.wIndex, 0);
 		USETW(req.wLength, UVISOR_CONNECTION_INFO_SIZE);
-		err = usb2_do_request_flags
-		    (udev, &Giant, &req, &coninfo, USB_SHORT_XFER_OK,
+		err = usb2_do_request_flags(udev, NULL,
+		    &req, &coninfo, USB_SHORT_XFER_OK,
 		    &actlen, USB_DEFAULT_TIMEOUT);
 
 		if (err) {
@@ -427,7 +427,7 @@ uvisor_init(struct uvisor_softc *sc, str
 		USETW(req.wLength, UVISOR_GET_PALM_INFORMATION_LEN);
 
 		err = usb2_do_request_flags
-		    (udev, &Giant, &req, &pconinfo, USB_SHORT_XFER_OK,
+		    (udev, NULL, &req, &pconinfo, USB_SHORT_XFER_OK,
 		    &actlen, USB_DEFAULT_TIMEOUT);
 
 		if (err) {
@@ -468,7 +468,7 @@ uvisor_init(struct uvisor_softc *sc, str
 		USETW(req.wIndex, 0);
 		USETW(req.wLength, 1);
 
-		err = usb2_do_request(udev, &Giant, &req, buffer);
+		err = usb2_do_request(udev, NULL, &req, buffer);
 		if (err) {
 			goto done;
 		}
@@ -479,7 +479,7 @@ uvisor_init(struct uvisor_softc *sc, str
 		USETW(req.wValue, 0);
 		USETW(req.wIndex, 0);
 		USETW(req.wLength, 1);
-		err = usb2_do_request(udev, &Giant, &req, buffer);
+		err = usb2_do_request(udev, NULL, &req, buffer);
 		if (err) {
 			goto done;
 		}
@@ -490,7 +490,7 @@ uvisor_init(struct uvisor_softc *sc, str
 	USETW(req.wValue, 0);
 	USETW(req.wIndex, 5);
 	USETW(req.wLength, sizeof(wAvail));
-	err = usb2_do_request(udev, &Giant, &req, &wAvail);
+	err = usb2_do_request(udev, NULL, &req, &wAvail);
 	if (err) {
 		goto done;
 	}

Modified: head/sys/dev/usb/storage/umass.c
==============================================================================
--- head/sys/dev/usb/storage/umass.c	Fri Mar 20 18:51:13 2009	(r190171)
+++ head/sys/dev/usb/storage/umass.c	Fri Mar 20 18:56:27 2009	(r190172)
@@ -1583,7 +1583,7 @@ umass_attach(device_t dev)
 	 * some devices need a delay after that the configuration value is
 	 * set to function properly:
 	 */
-	usb2_pause_mtx(&Giant, hz);
+	usb2_pause_mtx(NULL, hz);
 
 	/* register the SIM */
 	err = umass_cam_attach_sim(sc);
@@ -1642,7 +1642,7 @@ umass_init_shuttle(struct umass_softc *s
 	req.wIndex[0] = sc->sc_iface_no;
 	req.wIndex[1] = 0;
 	USETW(req.wLength, sizeof(status));
-	err = usb2_do_request(sc->sc_udev, &Giant, &req, &status);
+	err = usb2_do_request(sc->sc_udev, NULL, &req, &status);
 
 	DPRINTF(sc, UDMASS_GEN, "Shuttle init returned 0x%02x%02x\n",
 	    status[0], status[1]);
@@ -2161,7 +2161,7 @@ umass_bbb_get_max_lun(struct umass_softc
 	req.wIndex[1] = 0;
 	USETW(req.wLength, 1);
 
-	err = usb2_do_request(sc->sc_udev, &Giant, &req, &buf);
+	err = usb2_do_request(sc->sc_udev, NULL, &req, &buf);
 	if (err) {
 		buf = 0;
 

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 20 18:59:53 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A8FD8106566B;
	Fri, 20 Mar 2009 18:59:53 +0000 (UTC)
	(envelope-from thompsa@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 95C7D8FC12;
	Fri, 20 Mar 2009 18:59:53 +0000 (UTC)
	(envelope-from thompsa@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2KIxrmv010990;
	Fri, 20 Mar 2009 18:59:53 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2KIxrK1010988;
	Fri, 20 Mar 2009 18:59:53 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <200903201859.n2KIxrK1010988@svn.freebsd.org>
From: Andrew Thompson 
Date: Fri, 20 Mar 2009 18:59: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: r190173 - in 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: Fri, 20 Mar 2009 18:59:54 -0000

Author: thompsa
Date: Fri Mar 20 18:59:53 2009
New Revision: 190173
URL: http://svn.freebsd.org/changeset/base/190173

Log:
  MFp4 //depot/projects/usb @159379,159380
  
  Fixes for 8-bit and 16-bit compilation.
  
  Submitted by:	Hans Petter Selasky

Modified:
  head/sys/dev/usb/storage/ustorage_fs.c
  head/sys/dev/usb/usb_endian.h

Modified: head/sys/dev/usb/storage/ustorage_fs.c
==============================================================================
--- head/sys/dev/usb/storage/ustorage_fs.c	Fri Mar 20 18:56:27 2009	(r190172)
+++ head/sys/dev/usb/storage/ustorage_fs.c	Fri Mar 20 18:59:53 2009	(r190173)
@@ -60,10 +60,27 @@ SYSCTL_INT(_hw_usb2_ustorage_fs, OID_AUT
 
 /* Define some limits */
 
-#define	USTORAGE_FS_BULK_SIZE (1 << 17)
+#define	USTORAGE_FS_BULK_SIZE (1UL << 17)
 #define	USTORAGE_FS_MAX_LUN 8
-#define	USTORAGE_FS_RELEASE 0x0101
-#define	USTORAGE_FS_RAM_SECT (1 << 13)
+
+/*
+ * The SCSI ID string must be exactly 28 characters long
+ * exluding the terminating zero.
+ */
+#ifndef USTORAGE_FS_ID_STRING
+#define	USTORAGE_FS_ID_STRING \
+	"FreeBSD " /* 8 */ \
+	"File-Stor Gadget" /* 16 */ \
+	"0101" /* 4 */
+#endif
+
+/*
+ * The following macro defines the number of
+ * sectors to be allocated for the RAM disk:
+ */
+#ifndef USTORAGE_FS_RAM_SECT
+#define	USTORAGE_FS_RAM_SECT (1UL << 13)
+#endif
 
 static uint8_t *ustorage_fs_ramdisk;
 
@@ -955,8 +972,6 @@ static uint8_t
 ustorage_fs_inquiry(struct ustorage_fs_softc *sc)
 {
 	uint8_t *buf = sc->sc_transfer.data_ptr;
-	static const char vendor_id[] = "FreeBSD ";
-	static const char product_id[] = "File-Stor Gadget";
 
 	struct ustorage_fs_lun *currlun = sc->sc_transfer.currlun;
 
@@ -978,12 +993,9 @@ ustorage_fs_inquiry(struct ustorage_fs_s
 	buf[4] = 31;
 	/* Additional length */
 	/* No special options */
-	/*
-	 * NOTE: We are writing an extra zero here, that is not
-	 * transferred to the peer:
-	 */
-	snprintf(buf + 8, 28 + 1, "%-8s%-16s%04x", vendor_id, product_id,
-	    USTORAGE_FS_RELEASE);
+	/* Copy in ID string */
+	memcpy(buf + 8, USTORAGE_FS_ID_STRING, 28);
+
 	return (ustorage_fs_min_len(sc, 36, 0 - 1));
 }
 
@@ -1332,7 +1344,7 @@ ustorage_fs_read(struct ustorage_fs_soft
 	 * too big
 	 */
 	if (sc->sc_transfer.cmd_data[0] == SC_READ_6) {
-		lba = (sc->sc_transfer.cmd_data[1] << 16) |
+		lba = (((uint32_t)sc->sc_transfer.cmd_data[1]) << 16) |
 		    get_be16(&sc->sc_transfer.cmd_data[2]);
 	} else {
 		lba = get_be32(&sc->sc_transfer.cmd_data[2]);
@@ -1391,7 +1403,7 @@ ustorage_fs_write(struct ustorage_fs_sof
 	 * too big.
 	 */
 	if (sc->sc_transfer.cmd_data[0] == SC_WRITE_6)
-		lba = (sc->sc_transfer.cmd_data[1] << 16) |
+		lba = (((uint32_t)sc->sc_transfer.cmd_data[1]) << 16) |
 		    get_be16(&sc->sc_transfer.cmd_data[2]);
 	else {
 		lba = get_be32(&sc->sc_transfer.cmd_data[2]);
@@ -1539,7 +1551,7 @@ ustorage_fs_check_cmd(struct ustorage_fs
 	 * non-zero.
 	 */
 	for (i = 0; i != min_cmd_size; i++) {
-		if (sc->sc_transfer.cmd_data[i] && !(mask & (1 << i))) {
+		if (sc->sc_transfer.cmd_data[i] && !(mask & (1UL << i))) {
 			if (currlun) {
 				currlun->sense_data = SS_INVALID_FIELD_IN_CDB;
 			}
@@ -1570,6 +1582,7 @@ ustorage_fs_do_cmd(struct ustorage_fs_so
 {
 	uint8_t error = 1;
 	uint8_t i;
+	uint32_t temp;
 
 	/* set default data transfer pointer */
 	sc->sc_transfer.data_ptr = sc->sc_qdata;
@@ -1585,7 +1598,7 @@ ustorage_fs_do_cmd(struct ustorage_fs_so
 			break;
 		}
 		error = ustorage_fs_check_cmd(sc, 6,
-		    (1 << 4) | 1, 0);
+		    (1UL << 4) | 1, 0);
 		if (error) {
 			break;
 		}
@@ -1600,7 +1613,7 @@ ustorage_fs_do_cmd(struct ustorage_fs_so
 			break;
 		}
 		error = ustorage_fs_check_cmd(sc, 6,
-		    (1 << 1) | (1 << 4) | 1, 0);
+		    (1UL << 1) | (1UL << 4) | 1, 0);
 		if (error) {
 			break;
 		}
@@ -1616,7 +1629,7 @@ ustorage_fs_do_cmd(struct ustorage_fs_so
 			break;
 		}
 		error = ustorage_fs_check_cmd(sc, 10,
-		    (1 << 1) | (3 << 7) | 1, 0);
+		    (1UL << 1) | (3UL << 7) | 1, 0);
 		if (error) {
 			break;
 		}
@@ -1631,7 +1644,7 @@ ustorage_fs_do_cmd(struct ustorage_fs_so
 			break;
 		}
 		error = ustorage_fs_check_cmd(sc, 6,
-		    (1 << 1) | (1 << 2) | (1 << 4) | 1, 0);
+		    (1UL << 1) | (1UL << 2) | (1UL << 4) | 1, 0);
 		if (error) {
 			break;
 		}
@@ -1647,7 +1660,7 @@ ustorage_fs_do_cmd(struct ustorage_fs_so
 			break;
 		}
 		error = ustorage_fs_check_cmd(sc, 10,
-		    (1 << 1) | (1 << 2) | (3 << 7) | 1, 0);
+		    (1UL << 1) | (1UL << 2) | (3UL << 7) | 1, 0);
 		if (error) {
 			break;
 		}
@@ -1661,7 +1674,7 @@ ustorage_fs_do_cmd(struct ustorage_fs_so
 			break;
 		}
 		error = ustorage_fs_check_cmd(sc, 6,
-		    (1 << 4) | 1, 0);
+		    (1UL << 4) | 1, 0);
 		if (error) {
 			break;
 		}
@@ -1672,13 +1685,13 @@ ustorage_fs_do_cmd(struct ustorage_fs_so
 	case SC_READ_6:
 		i = sc->sc_transfer.cmd_data[4];
 		sc->sc_transfer.cmd_dir = DIR_WRITE;
-		error = ustorage_fs_min_len(sc,
-		    ((i == 0) ? 256 : i) << 9, 0 - (1 << 9));
+		temp = ((i == 0) ? 256UL : i);
+		error = ustorage_fs_min_len(sc, temp << 9, 0 - (1UL << 9));
 		if (error) {
 			break;
 		}
 		error = ustorage_fs_check_cmd(sc, 6,
-		    (7 << 1) | (1 << 4) | 1, 1);
+		    (7UL << 1) | (1UL << 4) | 1, 1);
 		if (error) {
 			break;
 		}
@@ -1688,13 +1701,13 @@ ustorage_fs_do_cmd(struct ustorage_fs_so
 
 	case SC_READ_10:
 		sc->sc_transfer.cmd_dir = DIR_WRITE;
-		error = ustorage_fs_min_len(sc,
-		    get_be16(&sc->sc_transfer.cmd_data[7]) << 9, 0 - (1 << 9));
+		temp = get_be16(&sc->sc_transfer.cmd_data[7]);
+		error = ustorage_fs_min_len(sc, temp << 9, 0 - (1UL << 9));
 		if (error) {
 			break;
 		}
 		error = ustorage_fs_check_cmd(sc, 10,
-		    (1 << 1) | (0xf << 2) | (3 << 7) | 1, 1);
+		    (1UL << 1) | (0xfUL << 2) | (3UL << 7) | 1, 1);
 		if (error) {
 			break;
 		}
@@ -1704,13 +1717,19 @@ ustorage_fs_do_cmd(struct ustorage_fs_so
 
 	case SC_READ_12:
 		sc->sc_transfer.cmd_dir = DIR_WRITE;
-		error = ustorage_fs_min_len(sc,
-		    get_be32(&sc->sc_transfer.cmd_data[6]) << 9, 0 - (1 << 9));
+		temp = get_be32(&sc->sc_transfer.cmd_data[6]);
+		if (temp >= (1UL << (32 - 9))) {
+			/* numerical overflow */
+			sc->sc_csw.bCSWStatus = CSWSTATUS_FAILED;
+			error = 1;
+			break;
+		}
+		error = ustorage_fs_min_len(sc, temp << 9, 0 - (1UL << 9));
 		if (error) {
 			break;
 		}
 		error = ustorage_fs_check_cmd(sc, 12,
-		    (1 << 1) | (0xf << 2) | (0xf << 6) | 1, 1);
+		    (1UL << 1) | (0xfUL << 2) | (0xfUL << 6) | 1, 1);
 		if (error) {
 			break;
 		}
@@ -1721,7 +1740,7 @@ ustorage_fs_do_cmd(struct ustorage_fs_so
 	case SC_READ_CAPACITY:
 		sc->sc_transfer.cmd_dir = DIR_WRITE;
 		error = ustorage_fs_check_cmd(sc, 10,
-		    (0xf << 2) | (1 << 8) | 1, 1);
+		    (0xfUL << 2) | (1UL << 8) | 1, 1);
 		if (error) {
 			break;
 		}
@@ -1737,7 +1756,7 @@ ustorage_fs_do_cmd(struct ustorage_fs_so
 			break;
 		}
 		error = ustorage_fs_check_cmd(sc, 10,
-		    (3 << 7) | 1, 1);
+		    (3UL << 7) | 1, 1);
 		if (error) {
 			break;
 		}
@@ -1752,7 +1771,7 @@ ustorage_fs_do_cmd(struct ustorage_fs_so
 			break;
 		}
 		error = ustorage_fs_check_cmd(sc, 6,
-		    (1 << 4) | 1, 0);
+		    (1UL << 4) | 1, 0);
 		if (error) {
 			break;
 		}
@@ -1766,7 +1785,7 @@ ustorage_fs_do_cmd(struct ustorage_fs_so
 			break;
 		}
 		error = ustorage_fs_check_cmd(sc, 6,
-		    (1 << 1) | (1 << 4) | 1, 0);
+		    (1UL << 1) | (1UL << 4) | 1, 0);
 		if (error) {
 			break;
 		}
@@ -1780,7 +1799,7 @@ ustorage_fs_do_cmd(struct ustorage_fs_so
 			break;
 		}
 		error = ustorage_fs_check_cmd(sc, 10,
-		    (0xf << 2) | (3 << 7) | 1, 1);
+		    (0xfUL << 2) | (3UL << 7) | 1, 1);
 		if (error) {
 			break;
 		}
@@ -1807,7 +1826,7 @@ ustorage_fs_do_cmd(struct ustorage_fs_so
 			break;
 		}
 		error = ustorage_fs_check_cmd(sc, 10,
-		    (1 << 1) | (0xf << 2) | (3 << 7) | 1, 1);
+		    (1UL << 1) | (0xfUL << 2) | (3UL << 7) | 1, 1);
 		if (error) {
 			break;
 		}
@@ -1818,13 +1837,13 @@ ustorage_fs_do_cmd(struct ustorage_fs_so
 	case SC_WRITE_6:
 		i = sc->sc_transfer.cmd_data[4];
 		sc->sc_transfer.cmd_dir = DIR_READ;
-		error = ustorage_fs_min_len(sc,
-		    ((i == 0) ? 256 : i) << 9, 0 - (1 << 9));
+		temp = ((i == 0) ? 256UL : i);
+		error = ustorage_fs_min_len(sc, temp << 9, 0 - (1UL << 9));
 		if (error) {
 			break;
 		}
 		error = ustorage_fs_check_cmd(sc, 6,
-		    (7 << 1) | (1 << 4) | 1, 1);
+		    (7UL << 1) | (1UL << 4) | 1, 1);
 		if (error) {
 			break;
 		}
@@ -1834,13 +1853,13 @@ ustorage_fs_do_cmd(struct ustorage_fs_so
 
 	case SC_WRITE_10:
 		sc->sc_transfer.cmd_dir = DIR_READ;
-		error = ustorage_fs_min_len(sc,
-		    get_be16(&sc->sc_transfer.cmd_data[7]) << 9, 0 - (1 << 9));
+		temp = get_be16(&sc->sc_transfer.cmd_data[7]);
+		error = ustorage_fs_min_len(sc, temp << 9, 0 - (1UL << 9));
 		if (error) {
 			break;
 		}
 		error = ustorage_fs_check_cmd(sc, 10,
-		    (1 << 1) | (0xf << 2) | (3 << 7) | 1, 1);
+		    (1UL << 1) | (0xfUL << 2) | (3UL << 7) | 1, 1);
 		if (error) {
 			break;
 		}
@@ -1850,13 +1869,19 @@ ustorage_fs_do_cmd(struct ustorage_fs_so
 
 	case SC_WRITE_12:
 		sc->sc_transfer.cmd_dir = DIR_READ;
-		error = ustorage_fs_min_len(sc,
-		    get_be32(&sc->sc_transfer.cmd_data[6]) << 9, 0 - (1 << 9));
+		temp = get_be32(&sc->sc_transfer.cmd_data[6]);
+		if (temp >= (1UL << (32 - 9))) {
+			/* numerical overflow */
+			sc->sc_csw.bCSWStatus = CSWSTATUS_FAILED;
+			error = 1;
+			break;
+		}
+		error = ustorage_fs_min_len(sc, temp << 9, 0 - (1UL << 9));
 		if (error) {
 			break;
 		}
 		error = ustorage_fs_check_cmd(sc, 12,
-		    (1 << 1) | (0xf << 2) | (0xf << 6) | 1, 1);
+		    (1UL << 1) | (0xfUL << 2) | (0xfUL << 6) | 1, 1);
 		if (error) {
 			break;
 		}

Modified: head/sys/dev/usb/usb_endian.h
==============================================================================
--- head/sys/dev/usb/usb_endian.h	Fri Mar 20 18:56:27 2009	(r190172)
+++ head/sys/dev/usb/usb_endian.h	Fri Mar 20 18:59:53 2009	(r190173)
@@ -48,19 +48,19 @@ typedef uint8_t uQWord[8];
 
 #define	UGETW(w)			\
   ((w)[0] |				\
-  ((w)[1] << 8))
+  (((uint16_t)((w)[1])) << 8))
 
 #define	UGETDW(w)			\
   ((w)[0] |				\
-  ((w)[1] << 8) |			\
-  ((w)[2] << 16) |			\
-  ((w)[3] << 24))
+  (((uint16_t)((w)[1])) << 8) |		\
+  (((uint32_t)((w)[2])) << 16) |	\
+  (((uint32_t)((w)[3])) << 24))
 
 #define	UGETQW(w)			\
   ((w)[0] |				\
-  ((w)[1] << 8) |			\
-  ((w)[2] << 16) |			\
-  ((w)[3] << 24) |			\
+  (((uint16_t)((w)[1])) << 8) |		\
+  (((uint32_t)((w)[2])) << 16) |	\
+  (((uint32_t)((w)[3])) << 24) |	\
   (((uint64_t)((w)[4])) << 32) |	\
   (((uint64_t)((w)[5])) << 40) |	\
   (((uint64_t)((w)[6])) << 48) |	\

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 20 19:04:33 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9B2851065672;
	Fri, 20 Mar 2009 19:04:33 +0000 (UTC)
	(envelope-from thompsa@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 872738FC14;
	Fri, 20 Mar 2009 19:04:33 +0000 (UTC)
	(envelope-from thompsa@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2KJ4XpI011168;
	Fri, 20 Mar 2009 19:04:33 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2KJ4Vpj011122;
	Fri, 20 Mar 2009 19:04:31 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <200903201904.n2KJ4Vpj011122@svn.freebsd.org>
From: Andrew Thompson 
Date: Fri, 20 Mar 2009 19:04:31 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190174 - in head/sys/dev/usb: . controller net serial
	storage template
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 20 Mar 2009 19:04:34 -0000

Author: thompsa
Date: Fri Mar 20 19:04:31 2009
New Revision: 190174
URL: http://svn.freebsd.org/changeset/base/190174

Log:
  MFp4 //depot/projects/usb @159430
  
  - Move tunable defines into usb_core.h and dependancy towards usb_defs.h
  - Leave hardcoded defines in "usb_defs.h".
  - Allow overriding all tunable defines.
  - Add more customisable typedefs.
  - Correct maximum device number.
  
  Submitted by:	Hans Petter Selasky

Modified:
  head/sys/dev/usb/controller/at91dci.c
  head/sys/dev/usb/controller/at91dci_atmelarm.c
  head/sys/dev/usb/controller/atmegadci.c
  head/sys/dev/usb/controller/atmegadci_atmelarm.c
  head/sys/dev/usb/controller/ehci.c
  head/sys/dev/usb/controller/ehci.h
  head/sys/dev/usb/controller/ehci_ixp4xx.c
  head/sys/dev/usb/controller/ehci_mbus.c
  head/sys/dev/usb/controller/ehci_pci.c
  head/sys/dev/usb/controller/musb_otg.c
  head/sys/dev/usb/controller/musb_otg_atmelarm.c
  head/sys/dev/usb/controller/ohci.c
  head/sys/dev/usb/controller/ohci.h
  head/sys/dev/usb/controller/ohci_atmelarm.c
  head/sys/dev/usb/controller/ohci_pci.c
  head/sys/dev/usb/controller/uhci.c
  head/sys/dev/usb/controller/uhci.h
  head/sys/dev/usb/controller/uhci_pci.c
  head/sys/dev/usb/controller/usb_controller.c
  head/sys/dev/usb/controller/uss820dci.c
  head/sys/dev/usb/controller/uss820dci_atmelarm.c
  head/sys/dev/usb/net/if_cdce.c
  head/sys/dev/usb/serial/u3g.c
  head/sys/dev/usb/serial/ubser.c
  head/sys/dev/usb/serial/ugensa.c
  head/sys/dev/usb/serial/umct.c
  head/sys/dev/usb/serial/umodem.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_core.h
  head/sys/dev/usb/usb_debug.c
  head/sys/dev/usb/usb_defs.h
  head/sys/dev/usb/usb_dev.c
  head/sys/dev/usb/usb_device.c
  head/sys/dev/usb/usb_dynamic.c
  head/sys/dev/usb/usb_generic.c
  head/sys/dev/usb/usb_handle_request.c
  head/sys/dev/usb/usb_hid.c
  head/sys/dev/usb/usb_hub.c
  head/sys/dev/usb/usb_msctest.c
  head/sys/dev/usb/usb_request.c
  head/sys/dev/usb/usb_sw_transfer.c
  head/sys/dev/usb/usb_transfer.c
  head/sys/dev/usb/usb_util.c

Modified: head/sys/dev/usb/controller/at91dci.c
==============================================================================
--- head/sys/dev/usb/controller/at91dci.c	Fri Mar 20 18:59:53 2009	(r190173)
+++ head/sys/dev/usb/controller/at91dci.c	Fri Mar 20 19:04:31 2009	(r190174)
@@ -47,7 +47,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 
 #define	USB_DEBUG_VAR at91dcidebug
 

Modified: head/sys/dev/usb/controller/at91dci_atmelarm.c
==============================================================================
--- head/sys/dev/usb/controller/at91dci_atmelarm.c	Fri Mar 20 18:59:53 2009	(r190173)
+++ head/sys/dev/usb/controller/at91dci_atmelarm.c	Fri Mar 20 19:04:31 2009	(r190174)
@@ -28,7 +28,6 @@ __FBSDID("$FreeBSD$");
 
 
 #include 
-#include 
 #include 
 
 #include 

Modified: head/sys/dev/usb/controller/atmegadci.c
==============================================================================
--- head/sys/dev/usb/controller/atmegadci.c	Fri Mar 20 18:59:53 2009	(r190173)
+++ head/sys/dev/usb/controller/atmegadci.c	Fri Mar 20 19:04:31 2009	(r190174)
@@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 
 #define	USB_DEBUG_VAR atmegadci_debug
 

Modified: head/sys/dev/usb/controller/atmegadci_atmelarm.c
==============================================================================
--- head/sys/dev/usb/controller/atmegadci_atmelarm.c	Fri Mar 20 18:59:53 2009	(r190173)
+++ head/sys/dev/usb/controller/atmegadci_atmelarm.c	Fri Mar 20 19:04:31 2009	(r190174)
@@ -26,7 +26,6 @@ __FBSDID("$FreeBSD$");
  * SUCH DAMAGE.
  */
 
-#include 
 #include 
 
 #include 

Modified: head/sys/dev/usb/controller/ehci.c
==============================================================================
--- head/sys/dev/usb/controller/ehci.c	Fri Mar 20 18:59:53 2009	(r190173)
+++ head/sys/dev/usb/controller/ehci.c	Fri Mar 20 19:04:31 2009	(r190174)
@@ -49,7 +49,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 
 #define	USB_DEBUG_VAR ehcidebug
 
@@ -3168,7 +3167,7 @@ ehci_root_ctrl_done(struct usb2_xfer *xf
 		USETW(sc->sc_hub_desc.stat.wStatus, 0);
 		break;
 	case C(UR_SET_ADDRESS, UT_WRITE_DEVICE):
-		if (value >= USB_MAX_DEVICES) {
+		if (value >= EHCI_MAX_DEVICES) {
 			std->err = USB_ERR_IOERROR;
 			goto done;
 		}

Modified: head/sys/dev/usb/controller/ehci.h
==============================================================================
--- head/sys/dev/usb/controller/ehci.h	Fri Mar 20 18:59:53 2009	(r190173)
+++ head/sys/dev/usb/controller/ehci.h	Fri Mar 20 19:04:31 2009	(r190174)
@@ -38,7 +38,7 @@
 #ifndef _EHCI_H_
 #define	_EHCI_H_
 
-#define	EHCI_MAX_DEVICES USB_MAX_DEVICES
+#define	EHCI_MAX_DEVICES MIN(USB_MAX_DEVICES, 128)
 
 /* PCI config registers */
 #define	PCI_CBMEM		0x10	/* configuration base MEM */

Modified: head/sys/dev/usb/controller/ehci_ixp4xx.c
==============================================================================
--- head/sys/dev/usb/controller/ehci_ixp4xx.c	Fri Mar 20 18:59:53 2009	(r190173)
+++ head/sys/dev/usb/controller/ehci_ixp4xx.c	Fri Mar 20 19:04:31 2009	(r190174)
@@ -32,7 +32,6 @@ __FBSDID("$FreeBSD$");
 #include "opt_bus.h"
 
 #include 
-#include 
 #include 
 
 #include 

Modified: head/sys/dev/usb/controller/ehci_mbus.c
==============================================================================
--- head/sys/dev/usb/controller/ehci_mbus.c	Fri Mar 20 18:59:53 2009	(r190173)
+++ head/sys/dev/usb/controller/ehci_mbus.c	Fri Mar 20 19:04:31 2009	(r190174)
@@ -39,7 +39,6 @@ __FBSDID("$FreeBSD$");
 #include "opt_bus.h"
 
 #include 
-#include 
 #include 
 
 #include 

Modified: head/sys/dev/usb/controller/ehci_pci.c
==============================================================================
--- head/sys/dev/usb/controller/ehci_pci.c	Fri Mar 20 18:59:53 2009	(r190173)
+++ head/sys/dev/usb/controller/ehci_pci.c	Fri Mar 20 19:04:31 2009	(r190174)
@@ -53,7 +53,6 @@ __FBSDID("$FreeBSD$");
  */
 
 #include 
-#include 
 #include 
 
 #include 

Modified: head/sys/dev/usb/controller/musb_otg.c
==============================================================================
--- head/sys/dev/usb/controller/musb_otg.c	Fri Mar 20 18:59:53 2009	(r190173)
+++ head/sys/dev/usb/controller/musb_otg.c	Fri Mar 20 19:04:31 2009	(r190174)
@@ -39,7 +39,6 @@
 #include 
 #include 
 #include 
-#include 
 
 #define	USB_DEBUG_VAR musbotgdebug
 

Modified: head/sys/dev/usb/controller/musb_otg_atmelarm.c
==============================================================================
--- head/sys/dev/usb/controller/musb_otg_atmelarm.c	Fri Mar 20 18:59:53 2009	(r190173)
+++ head/sys/dev/usb/controller/musb_otg_atmelarm.c	Fri Mar 20 19:04:31 2009	(r190174)
@@ -25,7 +25,6 @@
  */
 
 #include 
-#include 
 #include 
 
 #include 

Modified: head/sys/dev/usb/controller/ohci.c
==============================================================================
--- head/sys/dev/usb/controller/ohci.c	Fri Mar 20 18:59:53 2009	(r190173)
+++ head/sys/dev/usb/controller/ohci.c	Fri Mar 20 19:04:31 2009	(r190174)
@@ -38,7 +38,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 
 #define	USB_DEBUG_VAR ohcidebug
 
@@ -2256,7 +2255,7 @@ ohci_root_ctrl_done(struct usb2_xfer *xf
 		USETW(sc->sc_hub_desc.stat.wStatus, 0);
 		break;
 	case C(UR_SET_ADDRESS, UT_WRITE_DEVICE):
-		if (value >= USB_MAX_DEVICES) {
+		if (value >= OHCI_MAX_DEVICES) {
 			std->err = USB_ERR_IOERROR;
 			goto done;
 		}

Modified: head/sys/dev/usb/controller/ohci.h
==============================================================================
--- head/sys/dev/usb/controller/ohci.h	Fri Mar 20 18:59:53 2009	(r190173)
+++ head/sys/dev/usb/controller/ohci.h	Fri Mar 20 19:04:31 2009	(r190174)
@@ -39,7 +39,7 @@
 #ifndef _OHCI_H_
 #define	_OHCI_H_
 
-#define	OHCI_MAX_DEVICES USB_MAX_DEVICES
+#define	OHCI_MAX_DEVICES MIN(USB_MAX_DEVICES, 128)
 
 /* PCI config registers */
 #define	PCI_CBMEM		0x10	/* configuration base memory */

Modified: head/sys/dev/usb/controller/ohci_atmelarm.c
==============================================================================
--- head/sys/dev/usb/controller/ohci_atmelarm.c	Fri Mar 20 18:59:53 2009	(r190173)
+++ head/sys/dev/usb/controller/ohci_atmelarm.c	Fri Mar 20 19:04:31 2009	(r190174)
@@ -26,7 +26,6 @@
 __FBSDID("$FreeBSD$");
 
 #include 
-#include 
 #include 
 
 #include 

Modified: head/sys/dev/usb/controller/ohci_pci.c
==============================================================================
--- head/sys/dev/usb/controller/ohci_pci.c	Fri Mar 20 18:59:53 2009	(r190173)
+++ head/sys/dev/usb/controller/ohci_pci.c	Fri Mar 20 19:04:31 2009	(r190174)
@@ -52,7 +52,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 
 #include 
 #include 

Modified: head/sys/dev/usb/controller/uhci.c
==============================================================================
--- head/sys/dev/usb/controller/uhci.c	Fri Mar 20 18:59:53 2009	(r190173)
+++ head/sys/dev/usb/controller/uhci.c	Fri Mar 20 19:04:31 2009	(r190174)
@@ -41,7 +41,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 
 #define	USB_DEBUG_VAR uhcidebug
 
@@ -2626,7 +2625,7 @@ uhci_root_ctrl_done(struct usb2_xfer *xf
 		USETW(sc->sc_hub_desc.stat.wStatus, 0);
 		break;
 	case C(UR_SET_ADDRESS, UT_WRITE_DEVICE):
-		if (value >= USB_MAX_DEVICES) {
+		if (value >= UHCI_MAX_DEVICES) {
 			std->err = USB_ERR_IOERROR;
 			goto done;
 		}

Modified: head/sys/dev/usb/controller/uhci.h
==============================================================================
--- head/sys/dev/usb/controller/uhci.h	Fri Mar 20 18:59:53 2009	(r190173)
+++ head/sys/dev/usb/controller/uhci.h	Fri Mar 20 19:04:31 2009	(r190174)
@@ -39,7 +39,7 @@
 #ifndef _UHCI_H_
 #define	_UHCI_H_
 
-#define	UHCI_MAX_DEVICES USB_MAX_DEVICES
+#define	UHCI_MAX_DEVICES MIN(USB_MAX_DEVICES, 128)
 
 /* PCI config registers */
 #define	PCI_USBREV		0x60	/* USB protocol revision */

Modified: head/sys/dev/usb/controller/uhci_pci.c
==============================================================================
--- head/sys/dev/usb/controller/uhci_pci.c	Fri Mar 20 18:59:53 2009	(r190173)
+++ head/sys/dev/usb/controller/uhci_pci.c	Fri Mar 20 19:04:31 2009	(r190174)
@@ -49,7 +49,6 @@ __FBSDID("$FreeBSD$");
  */
 
 #include 
-#include 
 #include 
 
 #include 

Modified: head/sys/dev/usb/controller/usb_controller.c
==============================================================================
--- head/sys/dev/usb/controller/usb_controller.c	Fri Mar 20 18:59:53 2009	(r190173)
+++ head/sys/dev/usb/controller/usb_controller.c	Fri Mar 20 19:04:31 2009	(r190174)
@@ -25,7 +25,6 @@
  */
 
 #include 
-#include 
 #include 
 #include 
 

Modified: head/sys/dev/usb/controller/uss820dci.c
==============================================================================
--- head/sys/dev/usb/controller/uss820dci.c	Fri Mar 20 18:59:53 2009	(r190173)
+++ head/sys/dev/usb/controller/uss820dci.c	Fri Mar 20 19:04:31 2009	(r190174)
@@ -36,7 +36,6 @@
 #include 
 #include 
 #include 
-#include 
 
 #define	USB_DEBUG_VAR uss820dcidebug
 

Modified: head/sys/dev/usb/controller/uss820dci_atmelarm.c
==============================================================================
--- head/sys/dev/usb/controller/uss820dci_atmelarm.c	Fri Mar 20 18:59:53 2009	(r190173)
+++ head/sys/dev/usb/controller/uss820dci_atmelarm.c	Fri Mar 20 19:04:31 2009	(r190174)
@@ -28,7 +28,6 @@ __FBSDID("$FreeBSD$");
  */
 
 #include 
-#include 
 #include 
 
 #include 

Modified: head/sys/dev/usb/net/if_cdce.c
==============================================================================
--- head/sys/dev/usb/net/if_cdce.c	Fri Mar 20 18:59:53 2009	(r190173)
+++ head/sys/dev/usb/net/if_cdce.c	Fri Mar 20 19:04:31 2009	(r190174)
@@ -48,7 +48,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 
 #define	USB_DEBUG_VAR cdce_debug
 

Modified: head/sys/dev/usb/serial/u3g.c
==============================================================================
--- head/sys/dev/usb/serial/u3g.c	Fri Mar 20 18:59:53 2009	(r190173)
+++ head/sys/dev/usb/serial/u3g.c	Fri Mar 20 19:04:31 2009	(r190174)
@@ -34,7 +34,6 @@
 #include 
 #include 
 #include 
-#include 
 
 #define	USB_DEBUG_VAR u3g_debug
 

Modified: head/sys/dev/usb/serial/ubser.c
==============================================================================
--- head/sys/dev/usb/serial/ubser.c	Fri Mar 20 18:59:53 2009	(r190173)
+++ head/sys/dev/usb/serial/ubser.c	Fri Mar 20 19:04:31 2009	(r190174)
@@ -80,7 +80,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 
 #define	USB_DEBUG_VAR ubser_debug
 

Modified: head/sys/dev/usb/serial/ugensa.c
==============================================================================
--- head/sys/dev/usb/serial/ugensa.c	Fri Mar 20 18:59:53 2009	(r190173)
+++ head/sys/dev/usb/serial/ugensa.c	Fri Mar 20 19:04:31 2009	(r190174)
@@ -47,7 +47,6 @@
 #include 
 #include 
 #include 
-#include 
 
 #define	USB_DEBUG_VAR usb2_debug
 

Modified: head/sys/dev/usb/serial/umct.c
==============================================================================
--- head/sys/dev/usb/serial/umct.c	Fri Mar 20 18:59:53 2009	(r190173)
+++ head/sys/dev/usb/serial/umct.c	Fri Mar 20 19:04:31 2009	(r190174)
@@ -49,7 +49,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 
 #define	USB_DEBUG_VAR usb2_debug
 

Modified: head/sys/dev/usb/serial/umodem.c
==============================================================================
--- head/sys/dev/usb/serial/umodem.c	Fri Mar 20 18:59:53 2009	(r190173)
+++ head/sys/dev/usb/serial/umodem.c	Fri Mar 20 19:04:31 2009	(r190174)
@@ -86,7 +86,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 
 #define	USB_DEBUG_VAR umodem_debug
 

Modified: head/sys/dev/usb/storage/ustorage_fs.c
==============================================================================
--- head/sys/dev/usb/storage/ustorage_fs.c	Fri Mar 20 18:59:53 2009	(r190173)
+++ head/sys/dev/usb/storage/ustorage_fs.c	Fri Mar 20 19:04:31 2009	(r190174)
@@ -39,7 +39,6 @@
 #include 
 #include 
 #include 
-#include 
 
 #define	USB_DEBUG_VAR ustorage_fs_debug
 

Modified: head/sys/dev/usb/template/usb_template.c
==============================================================================
--- head/sys/dev/usb/template/usb_template.c	Fri Mar 20 18:59:53 2009	(r190173)
+++ head/sys/dev/usb/template/usb_template.c	Fri Mar 20 19:04:31 2009	(r190174)
@@ -32,7 +32,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 
 #define	USB_DEBUG_VAR usb2_debug

Modified: head/sys/dev/usb/usb_busdma.c
==============================================================================
--- head/sys/dev/usb/usb_busdma.c	Fri Mar 20 18:59:53 2009	(r190173)
+++ head/sys/dev/usb/usb_busdma.c	Fri Mar 20 19:04:31 2009	(r190174)
@@ -27,7 +27,6 @@
 #include 
 #include 
 #include 
-#include 
 
 #define	USB_DEBUG_VAR usb2_debug
 

Modified: head/sys/dev/usb/usb_compat_linux.c
==============================================================================
--- head/sys/dev/usb/usb_compat_linux.c	Fri Mar 20 18:59:53 2009	(r190173)
+++ head/sys/dev/usb/usb_compat_linux.c	Fri Mar 20 19:04:31 2009	(r190174)
@@ -25,7 +25,6 @@
  * SUCH DAMAGE.
  */
 
-#include 
 #include 
 #include 
 #include 

Modified: head/sys/dev/usb/usb_core.h
==============================================================================
--- head/sys/dev/usb/usb_core.h	Fri Mar 20 18:59:53 2009	(r190173)
+++ head/sys/dev/usb/usb_core.h	Fri Mar 20 19:04:31 2009	(r190174)
@@ -157,10 +157,40 @@ struct usb2_xfer_root;
 
 /* typedefs */
 
-typedef uint8_t usb2_error_t;
-
 typedef void (usb2_callback_t)(struct usb2_xfer *);
 
+#ifndef USB_HAVE_USB_ERROR_T
+typedef uint8_t usb2_error_t;		/* see "USB_ERR_XXX" */
+#endif
+
+#ifndef USB_HAVE_TIMEOUT_T
+typedef uint32_t usb2_timeout_t;	/* milliseconds */
+#endif
+
+#ifndef USB_HAVE_LENGTH_T
+typedef uint32_t usb2_length_t;		/* bytes */
+#endif
+
+#ifndef USB_HAVE_FRAMES_T
+typedef uint32_t usb2_frames_t;		/* units */
+#endif
+
+#ifndef USB_HAVE_INTERVAL_T
+typedef uint32_t usb2_interval_t;	/* milliseconds */
+#endif
+
+#ifndef USB_HAVE_SIZE_T
+typedef uint32_t usb2_size_t;		/* bytes */
+#endif
+
+#ifndef USB_HAVE_REFS_T
+typedef uint32_t usb2_refs_t;		/* units */
+#endif
+
+#ifndef USB_HAVE_TICKS_T
+typedef uint32_t usb2_ticks_t;		/* system defined */
+#endif
+
 /* structures */
 
 /*

Modified: head/sys/dev/usb/usb_debug.c
==============================================================================
--- head/sys/dev/usb/usb_debug.c	Fri Mar 20 18:59:53 2009	(r190173)
+++ head/sys/dev/usb/usb_debug.c	Fri Mar 20 19:04:31 2009	(r190174)
@@ -25,7 +25,6 @@
  */
 
 #include 
-#include 
 
 #include 
 #include 

Modified: head/sys/dev/usb/usb_defs.h
==============================================================================
--- head/sys/dev/usb/usb_defs.h	Fri Mar 20 18:59:53 2009	(r190173)
+++ head/sys/dev/usb/usb_defs.h	Fri Mar 20 19:04:31 2009	(r190174)
@@ -27,22 +27,16 @@
 #ifndef _USB2_DEFS_H_
 #define	_USB2_DEFS_H_
 
-/* Definition of some USB constants */
+/* Definition of some hardcoded USB constants. */
+
+#define	USB_MAX_IPACKET		8	/* initial USB packet size */
 
-#define	USB_BUS_MAX 256			/* units */
-#define	USB_DEV_MAX 128			/* units */
-#define	USB_IFACE_MAX 32		/* units */
 #define	USB_EP_MAX (2*16)		/* hardcoded */
-#define	USB_FIFO_MAX (4 * USB_EP_MAX)
 
 #define	USB_ROOT_HUB_ADDR 1		/* index */
 
 #define	USB_MIN_DEVICES 2		/* unused + root HUB */
 
-#define	USB_MAX_DEVICES USB_DEV_MAX	/* including virtual root HUB and
-					 * address zero */
-#define	USB_MAX_ENDPOINTS USB_EP_MAX	/* 2 directions on 16 endpoints */
-
 #define	USB_UNCONFIG_INDEX 0xFF		/* internal use only */
 #define	USB_IFACE_INDEX_ANY 0xFF	/* internal use only */
 
@@ -57,20 +51,10 @@
 #define	USB_FS_BYTES_PER_HS_UFRAME 188	/* bytes */
 #define	USB_HS_MICRO_FRAMES_MAX 8	/* units */
 
+#define	USB_ISOC_TIME_MAX 128		/* ms */
+
 /* sanity checks */
 
-#if (USB_FIFO_MAX < USB_EP_MAX)
-#error "There cannot be less FIFOs than USB endpoints."
-#endif
-#if (USB_FIFO_MAX & 1)
-#error "Number of FIFOs must be odd."
-#endif
-#if (USB_EP_MAX < (2*16))
-#error "Number of hardware USB endpoints cannot be less than 32."
-#endif
-#if (USB_MAX_DEVICES < USB_MIN_DEVICES)
-#error "Minimum number of devices is greater than maximum number of devices."
-#endif
 #if (USB_ROOT_HUB_ADDR >= USB_MIN_DEVICES)
 #error "The root hub address must be less than USB_MIN_DEVICES."
 #endif

Modified: head/sys/dev/usb/usb_dev.c
==============================================================================
--- head/sys/dev/usb/usb_dev.c	Fri Mar 20 18:59:53 2009	(r190173)
+++ head/sys/dev/usb/usb_dev.c	Fri Mar 20 19:04:31 2009	(r190174)
@@ -29,7 +29,6 @@
 
 #include 
 #include 
-#include 
 #include 
 #include 
 

Modified: head/sys/dev/usb/usb_device.c
==============================================================================
--- head/sys/dev/usb/usb_device.c	Fri Mar 20 18:59:53 2009	(r190173)
+++ head/sys/dev/usb/usb_device.c	Fri Mar 20 19:04:31 2009	(r190174)
@@ -24,7 +24,6 @@
  * SUCH DAMAGE.
  */
 
-#include 
 #include 
 #include 
 #include 

Modified: head/sys/dev/usb/usb_dynamic.c
==============================================================================
--- head/sys/dev/usb/usb_dynamic.c	Fri Mar 20 18:59:53 2009	(r190173)
+++ head/sys/dev/usb/usb_dynamic.c	Fri Mar 20 19:04:31 2009	(r190174)
@@ -24,7 +24,6 @@
  * SUCH DAMAGE.
  */
 
-#include 
 #include 
 #include 
 #include 

Modified: head/sys/dev/usb/usb_generic.c
==============================================================================
--- head/sys/dev/usb/usb_generic.c	Fri Mar 20 18:59:53 2009	(r190173)
+++ head/sys/dev/usb/usb_generic.c	Fri Mar 20 19:04:31 2009	(r190174)
@@ -24,7 +24,6 @@
  * SUCH DAMAGE.
  */
 
-#include 
 #include 
 #include 
 #include 

Modified: head/sys/dev/usb/usb_handle_request.c
==============================================================================
--- head/sys/dev/usb/usb_handle_request.c	Fri Mar 20 18:59:53 2009	(r190173)
+++ head/sys/dev/usb/usb_handle_request.c	Fri Mar 20 19:04:31 2009	(r190174)
@@ -24,7 +24,6 @@
  * SUCH DAMAGE.
  */
 
-#include 
 #include 
 #include 
 #include 

Modified: head/sys/dev/usb/usb_hid.c
==============================================================================
--- head/sys/dev/usb/usb_hid.c	Fri Mar 20 18:59:53 2009	(r190173)
+++ head/sys/dev/usb/usb_hid.c	Fri Mar 20 19:04:31 2009	(r190174)
@@ -43,7 +43,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
 
 #define	USB_DEBUG_VAR usb2_debug

Modified: head/sys/dev/usb/usb_hub.c
==============================================================================
--- head/sys/dev/usb/usb_hub.c	Fri Mar 20 18:59:53 2009	(r190173)
+++ head/sys/dev/usb/usb_hub.c	Fri Mar 20 19:04:31 2009	(r190174)
@@ -30,7 +30,6 @@
  * USB spec: http://www.usb.org/developers/docs/usbspec.zip
  */
 
-#include 
 #include 
 #include 
 #include 

Modified: head/sys/dev/usb/usb_msctest.c
==============================================================================
--- head/sys/dev/usb/usb_msctest.c	Fri Mar 20 18:59:53 2009	(r190173)
+++ head/sys/dev/usb/usb_msctest.c	Fri Mar 20 19:04:31 2009	(r190174)
@@ -32,7 +32,6 @@
  * mass storage quirks for not supported SCSI commands!
  */
 
-#include 
 #include 
 #include 
 #include 

Modified: head/sys/dev/usb/usb_request.c
==============================================================================
--- head/sys/dev/usb/usb_request.c	Fri Mar 20 18:59:53 2009	(r190173)
+++ head/sys/dev/usb/usb_request.c	Fri Mar 20 19:04:31 2009	(r190174)
@@ -26,7 +26,6 @@
  * SUCH DAMAGE.
  */
 
-#include 
 #include 
 #include 
 #include 

Modified: head/sys/dev/usb/usb_sw_transfer.c
==============================================================================
--- head/sys/dev/usb/usb_sw_transfer.c	Fri Mar 20 18:59:53 2009	(r190173)
+++ head/sys/dev/usb/usb_sw_transfer.c	Fri Mar 20 19:04:31 2009	(r190174)
@@ -27,7 +27,6 @@
 #include 
 #include 
 #include 
-#include 
 
 #define	USB_DEBUG_VAR usb2_debug
 

Modified: head/sys/dev/usb/usb_transfer.c
==============================================================================
--- head/sys/dev/usb/usb_transfer.c	Fri Mar 20 18:59:53 2009	(r190173)
+++ head/sys/dev/usb/usb_transfer.c	Fri Mar 20 19:04:31 2009	(r190174)
@@ -27,7 +27,6 @@
 #include 
 #include 
 #include 
-#include 
 
 #define	USB_DEBUG_VAR usb2_debug
 

Modified: head/sys/dev/usb/usb_util.c
==============================================================================
--- head/sys/dev/usb/usb_util.c	Fri Mar 20 18:59:53 2009	(r190173)
+++ head/sys/dev/usb/usb_util.c	Fri Mar 20 19:04:31 2009	(r190174)
@@ -24,7 +24,6 @@
  * SUCH DAMAGE.
  */
 
-#include 
 #include 
 #include 
 #include 

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 20 21:12:39 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 45226106566C;
	Fri, 20 Mar 2009 21:12:39 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 31F1C8FC1E;
	Fri, 20 Mar 2009 21:12:39 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2KLCdlL013625;
	Fri, 20 Mar 2009 21:12:39 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2KLCcMo013621;
	Fri, 20 Mar 2009 21:12:38 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <200903202112.n2KLCcMo013621@svn.freebsd.org>
From: John Baldwin 
Date: Fri, 20 Mar 2009 21:12:38 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190176 - in head/sys: nfs4client nfsclient
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 20 Mar 2009 21:12:40 -0000

Author: jhb
Date: Fri Mar 20 21:12:38 2009
New Revision: 190176
URL: http://svn.freebsd.org/changeset/base/190176

Log:
  Expand the per-node access cache to cache permissions for multiple users.
  The number of entries in the cache defaults to 8 but is easily changed in
  nfsclient/nfs.h.  When the cache is filled, the oldest cache entry is
  evicted when space is needed.
  
  I mirrored the changes to the NFSv[23] client in the NFSv4 client to fix
  compile breakage.  However, the NFSv4 client doesn't actually use the
  access cache currently.
  
  Submitted by:	rmacklem

Modified:
  head/sys/nfs4client/nfs4_vnops.c
  head/sys/nfsclient/nfs.h
  head/sys/nfsclient/nfs_vnops.c
  head/sys/nfsclient/nfsnode.h

Modified: head/sys/nfs4client/nfs4_vnops.c
==============================================================================
--- head/sys/nfs4client/nfs4_vnops.c	Fri Mar 20 20:55:57 2009	(r190175)
+++ head/sys/nfs4client/nfs4_vnops.c	Fri Mar 20 21:12:38 2009	(r190176)
@@ -241,11 +241,11 @@ SYSCTL_INT(_vfs_nfs4, OID_AUTO, access_c
 			 | NFSV3ACCESS_DELETE | NFSV3ACCESS_LOOKUP)
 static int
 nfs4_v3_access_otw(struct vnode *vp, int wmode, struct thread *td,
-    struct ucred *cred)
+    struct ucred *cred, uint32_t *retmode)
 {
 	const int v3 = 1;
 	u_int32_t *tl;
-	int error = 0, attrflag;
+	int error = 0, attrflag, i, lrupos;
 
 	return (0);
 
@@ -264,11 +264,26 @@ nfs4_v3_access_otw(struct vnode *vp, int
 	nfsm_request(vp, NFSPROC_ACCESS, td, cred);
 	nfsm_postop_attr(vp, attrflag);
 	if (!error) {
+		lrupos = 0;
 		tl = nfsm_dissect(u_int32_t *, NFSX_UNSIGNED);
 		rmode = fxdr_unsigned(u_int32_t, *tl);
-		np->n_mode = rmode;
-		np->n_modeuid = cred->cr_uid;
-		np->n_modestamp = time_second;
+		for (i = 0; i < NFS_ACCESSCACHESIZE; i++) {
+			if (np->n_accesscache[i].uid == cred->cr_uid) {
+				np->n_accesscache[i].mode = rmode;
+				np->n_accesscache[i].stamp = time_second;
+				break;
+			}
+			if (i > 0 && np->n_accesscache[i].stamp <
+			    np->n_accesscache[lrupos].stamp)
+				lrupos = i;
+		}
+		if (i == NFS_ACCESSCACHESIZE) {
+			np->n_accesscache[lrupos].uid = cred->cr_uid;
+			np->n_accesscache[lrupos].mode = rmode;
+			np->n_accesscache[lrupos].stamp = time_second;
+		}
+		if (retmode != NULL)
+			*retmode = rmode;
 	}
 	m_freem(mrep);
 nfsmout:
@@ -285,8 +300,8 @@ static int
 nfs4_access(struct vop_access_args *ap)
 {
 	struct vnode *vp = ap->a_vp;
-	int error = 0;
-	u_int32_t mode, wmode;
+	int error = 0, i, gotahit;
+	u_int32_t mode, rmode, wmode;
 	int v3 = NFS_ISV3(vp);	/* v3 \in v4 */
 	struct nfsnode *np = VTONFS(vp);
 	caddr_t bpos, dpos;
@@ -350,19 +365,27 @@ nfs4_access(struct vop_access_args *ap)
 		 * Does our cached result allow us to give a definite yes to
 		 * this request?
 		 */
-		if (time_second < np->n_modestamp + nfs4_access_cache_timeout &&
-		    ap->a_cred->cr_uid == np->n_modeuid &&
-		    (np->n_mode & mode) == mode) {
-			nfsstats.accesscache_hits++;
-		} else {
+		gotahit = 0;
+		for (i = 0; i < NFS_ACCESSCACHESIZE; i++) {
+			if (ap->a_cred->cr_uid == np->n_accesscache[i].uid) {
+				if (time_second < (np->n_accesscache[i].stamp +
+				    nfs4_access_cache_timeout) &&
+				    (np->n_accesscache[i].mode & mode) == mode) {
+					nfsstats.accesscache_hits++;
+					gotahit = 1;
+				}
+				break;
+			}
+		}
+		if (gotahit == 0) {
 			/*
 			 * Either a no, or a don't know.  Go to the wire.
 			 */
 			nfsstats.accesscache_misses++;
 		        error = nfs4_v3_access_otw(vp, wmode, ap->a_td,
-			    ap->a_cred);
+			    ap->a_cred, &rmode);
 			if (error == 0) {
-				if ((np->n_mode & mode) != mode)
+				if ((rmode & mode) != mode)
 					error = EACCES;
 			}
 		}

Modified: head/sys/nfsclient/nfs.h
==============================================================================
--- head/sys/nfsclient/nfs.h	Fri Mar 20 20:55:57 2009	(r190175)
+++ head/sys/nfsclient/nfs.h	Fri Mar 20 21:12:38 2009	(r190176)
@@ -68,6 +68,9 @@
 #ifndef NFS_MAXDIRATTRTIMO
 #define	NFS_MAXDIRATTRTIMO 60
 #endif
+#ifndef	NFS_ACCESSCACHESIZE
+#define	NFS_ACCESSCACHESIZE 8		/* Per-node access cache entries */
+#endif
 #define	NFS_WSIZE	8192		/* Def. write data size <= 8192 */
 #define	NFS_RSIZE	8192		/* Def. read data size <= 8192 */
 #define NFS_READDIRSIZE	8192		/* Def. readdir size */

Modified: head/sys/nfsclient/nfs_vnops.c
==============================================================================
--- head/sys/nfsclient/nfs_vnops.c	Fri Mar 20 20:55:57 2009	(r190175)
+++ head/sys/nfsclient/nfs_vnops.c	Fri Mar 20 21:12:38 2009	(r190176)
@@ -270,11 +270,11 @@ SYSCTL_INT(_vfs_nfs, OID_AUTO, access_ca
 
 static int
 nfs3_access_otw(struct vnode *vp, int wmode, struct thread *td,
-    struct ucred *cred)
+    struct ucred *cred, uint32_t *retmode)
 {
 	const int v3 = 1;
 	u_int32_t *tl;
-	int error = 0, attrflag;
+	int error = 0, attrflag, i, lrupos;
 
 	struct mbuf *mreq, *mrep, *md, *mb;
 	caddr_t bpos, dpos;
@@ -291,13 +291,28 @@ nfs3_access_otw(struct vnode *vp, int wm
 	nfsm_request(vp, NFSPROC_ACCESS, td, cred);
 	nfsm_postop_attr(vp, attrflag);
 	if (!error) {
+		lrupos = 0;
 		tl = nfsm_dissect(u_int32_t *, NFSX_UNSIGNED);
 		rmode = fxdr_unsigned(u_int32_t, *tl);
 		mtx_lock(&np->n_mtx);
-		np->n_mode = rmode;
-		np->n_modeuid = cred->cr_uid;
-		np->n_modestamp = time_second;
+		for (i = 0; i < NFS_ACCESSCACHESIZE; i++) {
+			if (np->n_accesscache[i].uid == cred->cr_uid) {
+				np->n_accesscache[i].mode = rmode;
+				np->n_accesscache[i].stamp = time_second;
+				break;
+			}
+			if (i > 0 && np->n_accesscache[i].stamp <
+			    np->n_accesscache[lrupos].stamp)
+				lrupos = i;
+		}
+		if (i == NFS_ACCESSCACHESIZE) {
+			np->n_accesscache[lrupos].uid = cred->cr_uid;
+			np->n_accesscache[lrupos].mode = rmode;
+			np->n_accesscache[lrupos].stamp = time_second;
+		}
 		mtx_unlock(&np->n_mtx);
+		if (retmode != NULL)
+			*retmode = rmode;
 	}
 	m_freem(mrep);
 nfsmout:
@@ -314,8 +329,8 @@ static int
 nfs_access(struct vop_access_args *ap)
 {
 	struct vnode *vp = ap->a_vp;
-	int error = 0;
-	u_int32_t mode, wmode;
+	int error = 0, i, gotahit;
+	u_int32_t mode, rmode, wmode;
 	int v3 = NFS_ISV3(vp);
 	struct nfsnode *np = VTONFS(vp);
 
@@ -372,26 +387,32 @@ nfs_access(struct vop_access_args *ap)
 		 * Does our cached result allow us to give a definite yes to
 		 * this request?
 		 */
+		gotahit = 0;
 		mtx_lock(&np->n_mtx);
-		if ((time_second < (np->n_modestamp + nfsaccess_cache_timeout)) &&
-		    (ap->a_cred->cr_uid == np->n_modeuid) &&
-		    ((np->n_mode & mode) == mode)) {
-			nfsstats.accesscache_hits++;
-		} else {
+		for (i = 0; i < NFS_ACCESSCACHESIZE; i++) {
+			if (ap->a_cred->cr_uid == np->n_accesscache[i].uid) {
+				if (time_second < (np->n_accesscache[i].stamp +
+				    nfsaccess_cache_timeout) &&
+				    (np->n_accesscache[i].mode & mode) == mode) {
+					nfsstats.accesscache_hits++;
+					gotahit = 1;
+				}
+				break;
+			}
+		}
+		mtx_unlock(&np->n_mtx);
+		if (gotahit == 0) {
 			/*
 			 * Either a no, or a don't know.  Go to the wire.
 			 */
 			nfsstats.accesscache_misses++;
-			mtx_unlock(&np->n_mtx);
-		        error = nfs3_access_otw(vp, wmode, ap->a_td,ap->a_cred);
-			mtx_lock(&np->n_mtx);
+		        error = nfs3_access_otw(vp, wmode, ap->a_td, ap->a_cred,
+			    &rmode);
 			if (!error) {
-				if ((np->n_mode & mode) != mode) {
+				if ((rmode & mode) != mode)
 					error = EACCES;
-				}
 			}
 		}
-		mtx_unlock(&np->n_mtx);
 		return (error);
 	} else {
 		if ((error = nfsspec_access(ap)) != 0) {
@@ -651,7 +672,7 @@ nfs_getattr(struct vop_getattr_args *ap)
 		goto nfsmout;
 	if (v3 && nfs_prime_access_cache && nfsaccess_cache_timeout > 0) {
 		nfsstats.accesscache_misses++;
-		nfs3_access_otw(vp, NFSV3ACCESS_ALL, td, ap->a_cred);
+		nfs3_access_otw(vp, NFSV3ACCESS_ALL, td, ap->a_cred, NULL);
 		if (nfs_getattrcache(vp, &vattr) == 0)
 			goto nfsmout;
 	}
@@ -810,7 +831,7 @@ nfs_setattrrpc(struct vnode *vp, struct 
 	struct nfsnode *np = VTONFS(vp);
 	caddr_t bpos, dpos;
 	u_int32_t *tl;
-	int error = 0, wccflag = NFSV3_WCCRATTR;
+	int error = 0, i, wccflag = NFSV3_WCCRATTR;
 	struct mbuf *mreq, *mrep, *md, *mb;
 	int v3 = NFS_ISV3(vp);
 
@@ -843,7 +864,10 @@ nfs_setattrrpc(struct vnode *vp, struct 
 	}
 	nfsm_request(vp, NFSPROC_SETATTR, curthread, cred);
 	if (v3) {
-		np->n_modestamp = 0;
+		mtx_lock(&np->n_mtx);
+		for (i = 0; i < NFS_ACCESSCACHESIZE; i++)
+			np->n_accesscache[i].stamp = 0;
+		mtx_unlock(&np->n_mtx);
 		nfsm_wcc_data(vp, wccflag);
 	} else
 		nfsm_loadattr(vp, NULL);

Modified: head/sys/nfsclient/nfsnode.h
==============================================================================
--- head/sys/nfsclient/nfsnode.h	Fri Mar 20 20:55:57 2009	(r190175)
+++ head/sys/nfsclient/nfsnode.h	Fri Mar 20 21:12:38 2009	(r190176)
@@ -84,6 +84,12 @@ struct nfs_attrcache_timestamp {
 	unsigned long	nfs_ac_ts_syscalls;	
 };
 
+struct nfs_accesscache {
+	u_int32_t		mode;		/* ACCESS mode cache */
+	uid_t			uid;		/* credentials having mode */
+	time_t			stamp;		/* mode cache timestamp */
+};
+	
 /*
  * The nfsnode is the nfs equivalent to ufs's inode. Any similarity
  * is purely coincidental.
@@ -104,9 +110,7 @@ struct nfsnode {
 	u_quad_t		n_lrev;		/* Modify rev for lease */
 	struct vattr		n_vattr;	/* Vnode attribute cache */
 	time_t			n_attrstamp;	/* Attr. cache timestamp */
-	u_int32_t		n_mode;		/* ACCESS mode cache */
-	uid_t			n_modeuid;	/* credentials having mode */
-	time_t			n_modestamp;	/* mode cache timestamp */
+	struct nfs_accesscache	n_accesscache[NFS_ACCESSCACHESIZE];
 	struct timespec		n_mtime;	/* Prev modify time. */
 	time_t			n_ctime;	/* Prev create time. */
 	time_t			n_dmtime;	/* Prev dir modify time. */

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 20 21:48:12 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 340C31065677;
	Fri, 20 Mar 2009 21:48:12 +0000 (UTC)
	(envelope-from thompsa@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 2005A8FC22;
	Fri, 20 Mar 2009 21:48:12 +0000 (UTC)
	(envelope-from thompsa@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2KLmBG1014548;
	Fri, 20 Mar 2009 21:48:11 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2KLmBD1014532;
	Fri, 20 Mar 2009 21:48:11 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <200903202148.n2KLmBD1014532@svn.freebsd.org>
From: Andrew Thompson 
Date: Fri, 20 Mar 2009 21:48: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: r190180 - 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: Fri, 20 Mar 2009 21:48:13 -0000

Author: thompsa
Date: Fri Mar 20 21:48:11 2009
New Revision: 190180
URL: http://svn.freebsd.org/changeset/base/190180

Log:
  MFp4 //depot/projects/usb@159392
  
  Add ifdefs for making parts of usb conditional.
  
  Submitted by:	Hans Petter Selasky

Modified:
  head/sys/dev/usb/controller/at91dci.c
  head/sys/dev/usb/controller/atmegadci.c
  head/sys/dev/usb/controller/musb_otg.c
  head/sys/dev/usb/controller/usb_controller.c
  head/sys/dev/usb/controller/uss820dci.c
  head/sys/dev/usb/usb_busdma.c
  head/sys/dev/usb/usb_busdma.h
  head/sys/dev/usb/usb_core.h
  head/sys/dev/usb/usb_debug.h
  head/sys/dev/usb/usb_device.c
  head/sys/dev/usb/usb_device.h
  head/sys/dev/usb/usb_request.c
  head/sys/dev/usb/usb_transfer.c
  head/sys/dev/usb/usb_transfer.h
  head/sys/dev/usb/usb_util.c
  head/sys/dev/usb/usb_util.h

Modified: head/sys/dev/usb/controller/at91dci.c
==============================================================================
--- head/sys/dev/usb/controller/at91dci.c	Fri Mar 20 21:47:26 2009	(r190179)
+++ head/sys/dev/usb/controller/at91dci.c	Fri Mar 20 21:48:11 2009	(r190180)
@@ -69,7 +69,7 @@ __FBSDID("$FreeBSD$");
    USB_P2U(&(((struct at91dci_softc *)0)->sc_bus))))
 
 #define	AT9100_DCI_PC2SC(pc) \
-   AT9100_DCI_BUS2SC((pc)->tag_parent->info->bus)
+   AT9100_DCI_BUS2SC(USB_DMATAG_TO_XROOT((pc)->tag_parent)->bus)
 
 #if USB_DEBUG
 static int at91dcidebug = 0;

Modified: head/sys/dev/usb/controller/atmegadci.c
==============================================================================
--- head/sys/dev/usb/controller/atmegadci.c	Fri Mar 20 21:47:26 2009	(r190179)
+++ head/sys/dev/usb/controller/atmegadci.c	Fri Mar 20 21:48:11 2009	(r190180)
@@ -62,7 +62,7 @@ __FBSDID("$FreeBSD$");
    USB_P2U(&(((struct atmegadci_softc *)0)->sc_bus))))
 
 #define	ATMEGA_PC2SC(pc) \
-   ATMEGA_BUS2SC((pc)->tag_parent->info->bus)
+   ATMEGA_BUS2SC(USB_DMATAG_TO_XROOT((pc)->tag_parent)->bus)
 
 #if USB_DEBUG
 static int atmegadci_debug = 0;

Modified: head/sys/dev/usb/controller/musb_otg.c
==============================================================================
--- head/sys/dev/usb/controller/musb_otg.c	Fri Mar 20 21:47:26 2009	(r190179)
+++ head/sys/dev/usb/controller/musb_otg.c	Fri Mar 20 21:48:11 2009	(r190180)
@@ -63,7 +63,7 @@
    USB_P2U(&(((struct musbotg_softc *)0)->sc_bus))))
 
 #define	MUSBOTG_PC2SC(pc) \
-   MUSBOTG_BUS2SC((pc)->tag_parent->info->bus)
+   MUSBOTG_BUS2SC(USB_DMATAG_TO_XROOT((pc)->tag_parent)->bus)
 
 #if USB_DEBUG
 static int musbotgdebug = 0;

Modified: head/sys/dev/usb/controller/usb_controller.c
==============================================================================
--- head/sys/dev/usb/controller/usb_controller.c	Fri Mar 20 21:47:26 2009	(r190179)
+++ head/sys/dev/usb/controller/usb_controller.c	Fri Mar 20 21:48:11 2009	(r190180)
@@ -49,15 +49,6 @@ static device_detach_t usb2_detach;
 
 static void	usb2_attach_sub(device_t, struct usb2_bus *);
 static void	usb2_post_init(void *);
-static void	usb2_bus_mem_flush_all_cb(struct usb2_bus *,
-		    struct usb2_page_cache *, struct usb2_page *, uint32_t,
-		    uint32_t);
-static void	usb2_bus_mem_alloc_all_cb(struct usb2_bus *,
-		    struct usb2_page_cache *, struct usb2_page *, uint32_t,
-		    uint32_t);
-static void	usb2_bus_mem_free_all_cb(struct usb2_bus *,
-		    struct usb2_page_cache *, struct usb2_page *, uint32_t,
-		    uint32_t);
 static void	usb2_bus_roothub(struct usb2_proc_msg *pm);
 
 /* static variables */
@@ -487,16 +478,19 @@ SYSUNINIT(usb2_bus_unload, SI_SUB_KLD, S
 /*------------------------------------------------------------------------*
  *	usb2_bus_mem_flush_all_cb
  *------------------------------------------------------------------------*/
+#if USB_HAVE_BUSDMA
 static void
 usb2_bus_mem_flush_all_cb(struct usb2_bus *bus, struct usb2_page_cache *pc,
     struct usb2_page *pg, uint32_t size, uint32_t align)
 {
 	usb2_pc_cpu_flush(pc);
 }
+#endif
 
 /*------------------------------------------------------------------------*
  *	usb2_bus_mem_flush_all - factored out code
  *------------------------------------------------------------------------*/
+#if USB_HAVE_BUSDMA
 void
 usb2_bus_mem_flush_all(struct usb2_bus *bus, usb2_bus_mem_cb_t *cb)
 {
@@ -504,10 +498,12 @@ usb2_bus_mem_flush_all(struct usb2_bus *
 		cb(bus, &usb2_bus_mem_flush_all_cb);
 	}
 }
+#endif
 
 /*------------------------------------------------------------------------*
  *	usb2_bus_mem_alloc_all_cb
  *------------------------------------------------------------------------*/
+#if USB_HAVE_BUSDMA
 static void
 usb2_bus_mem_alloc_all_cb(struct usb2_bus *bus, struct usb2_page_cache *pc,
     struct usb2_page *pg, uint32_t size, uint32_t align)
@@ -519,6 +515,7 @@ usb2_bus_mem_alloc_all_cb(struct usb2_bu
 		bus->alloc_failed = 1;
 	}
 }
+#endif
 
 /*------------------------------------------------------------------------*
  *	usb2_bus_mem_alloc_all - factored out code
@@ -541,9 +538,10 @@ usb2_bus_mem_alloc_all(struct usb2_bus *
 
 	TAILQ_INIT(&bus->intr_q.head);
 
+#if USB_HAVE_BUSDMA
 	usb2_dma_tag_setup(bus->dma_parent_tag, bus->dma_tags,
-	    dmat, &bus->bus_mtx, NULL, NULL, 32, USB_BUS_DMA_TAG_MAX);
-
+	    dmat, &bus->bus_mtx, NULL, 32, USB_BUS_DMA_TAG_MAX);
+#endif
 	if ((bus->devices_max > USB_MAX_DEVICES) ||
 	    (bus->devices_max < USB_MIN_DEVICES) ||
 	    (bus->devices == NULL)) {
@@ -551,9 +549,11 @@ usb2_bus_mem_alloc_all(struct usb2_bus *
 		    "initialised properly!\n");
 		bus->alloc_failed = 1;		/* failure */
 	}
+#if USB_HAVE_BUSDMA
 	if (cb) {
 		cb(bus, &usb2_bus_mem_alloc_all_cb);
 	}
+#endif
 	if (bus->alloc_failed) {
 		usb2_bus_mem_free_all(bus, cb);
 	}
@@ -563,12 +563,14 @@ usb2_bus_mem_alloc_all(struct usb2_bus *
 /*------------------------------------------------------------------------*
  *	usb2_bus_mem_free_all_cb
  *------------------------------------------------------------------------*/
+#if USB_HAVE_BUSDMA
 static void
 usb2_bus_mem_free_all_cb(struct usb2_bus *bus, struct usb2_page_cache *pc,
     struct usb2_page *pg, uint32_t size, uint32_t align)
 {
 	usb2_pc_free_mem(pc);
 }
+#endif
 
 /*------------------------------------------------------------------------*
  *	usb2_bus_mem_free_all - factored out code
@@ -576,10 +578,12 @@ usb2_bus_mem_free_all_cb(struct usb2_bus
 void
 usb2_bus_mem_free_all(struct usb2_bus *bus, usb2_bus_mem_cb_t *cb)
 {
+#if USB_HAVE_BUSDMA
 	if (cb) {
 		cb(bus, &usb2_bus_mem_free_all_cb);
 	}
 	usb2_dma_tag_unsetup(bus->dma_parent_tag);
+#endif
 
 	mtx_destroy(&bus->bus_mtx);
 }

Modified: head/sys/dev/usb/controller/uss820dci.c
==============================================================================
--- head/sys/dev/usb/controller/uss820dci.c	Fri Mar 20 21:47:26 2009	(r190179)
+++ head/sys/dev/usb/controller/uss820dci.c	Fri Mar 20 21:48:11 2009	(r190180)
@@ -58,7 +58,7 @@
    USB_P2U(&(((struct uss820dci_softc *)0)->sc_bus))))
 
 #define	USS820_DCI_PC2SC(pc) \
-   USS820_DCI_BUS2SC((pc)->tag_parent->info->bus)
+   USS820_DCI_BUS2SC(USB_DMATAG_TO_XROOT((pc)->tag_parent)->bus)
 
 #if USB_DEBUG
 static int uss820dcidebug = 0;

Modified: head/sys/dev/usb/usb_busdma.c
==============================================================================
--- head/sys/dev/usb/usb_busdma.c	Fri Mar 20 21:47:26 2009	(r190179)
+++ head/sys/dev/usb/usb_busdma.c	Fri Mar 20 21:48:11 2009	(r190180)
@@ -41,20 +41,20 @@
 #include 
 #include 
 
+#if USB_HAVE_BUSDMA
 static void	usb2_dma_tag_create(struct usb2_dma_tag *, uint32_t, uint32_t);
 static void	usb2_dma_tag_destroy(struct usb2_dma_tag *);
+#endif
 
-#ifdef __FreeBSD__
+#if USB_HAVE_BUSDMA && defined(__FreeBSD__)
 static void	usb2_dma_lock_cb(void *, bus_dma_lock_op_t);
-static int32_t	usb2_m_copy_in_cb(void *, void *, uint32_t);
 static void	usb2_pc_alloc_mem_cb(void *, bus_dma_segment_t *, int, int);
 static void	usb2_pc_load_mem_cb(void *, bus_dma_segment_t *, int, int);
 static void	usb2_pc_common_mem_cb(void *, bus_dma_segment_t *, int, int,
 		    uint8_t);
 #endif
 
-#ifdef __NetBSD__
-static int32_t	usb2_m_copy_in_cb(void *, caddr_t, uint32_t);
+#if USB_HAVE_BUSDMA && defined(__NetBSD__)
 static void	usb2_pc_common_mem_cb(struct usb2_page_cache *,
 		    bus_dma_segment_t *, int, int, uint8_t);
 #endif
@@ -71,6 +71,7 @@ usb2_get_page(struct usb2_page_cache *pc
 {
 	struct usb2_page *page;
 
+#if USB_HAVE_BUSDMA
 	if (pc->page_start) {
 
 		/* Case 1 - something has been loaded into DMA */
@@ -105,14 +106,16 @@ usb2_get_page(struct usb2_page_cache *pc
 
 			res->buffer = USB_ADD_BYTES(page->buffer, offset);
 		}
-	} else {
-
-		/* Case 2 - Plain PIO */
-
-		res->buffer = USB_ADD_BYTES(pc->buffer, offset);
-		res->length = 0 - 1;
-		res->physaddr = 0;
+		return;
 	}
+#endif
+	/* Case 2 - Plain PIO */
+
+	res->buffer = USB_ADD_BYTES(pc->buffer, offset);
+	res->length = 0 - 1;
+#if USB_HAVE_BUSDMA
+	res->physaddr = 0;
+#endif
 }
 
 /*------------------------------------------------------------------------*
@@ -146,6 +149,7 @@ usb2_copy_in(struct usb2_page_cache *cac
  *    0: Success
  * Else: Failure
  *------------------------------------------------------------------------*/
+#if USB_HAVE_USER_IO
 int
 usb2_copy_in_user(struct usb2_page_cache *cache, uint32_t offset,
     const void *ptr, uint32_t len)
@@ -170,10 +174,12 @@ usb2_copy_in_user(struct usb2_page_cache
 	}
 	return (0);			/* success */
 }
+#endif
 
 /*------------------------------------------------------------------------*
  *  usb2_m_copy_in - copy a mbuf chain directly into DMA-able memory
  *------------------------------------------------------------------------*/
+#if USB_HAVE_MBUF
 struct usb2_m_copy_in_arg {
 	struct usb2_page_cache *cache;
 	uint32_t dst_offset;
@@ -202,10 +208,12 @@ usb2_m_copy_in(struct usb2_page_cache *c
 
 	error = m_apply(m, src_offset, src_len, &usb2_m_copy_in_cb, &arg);
 }
+#endif
 
 /*------------------------------------------------------------------------*
  *  usb2_uiomove - factored out code
  *------------------------------------------------------------------------*/
+#if USB_HAVE_USER_IO
 int
 usb2_uiomove(struct usb2_page_cache *pc, struct uio *uio,
     uint32_t pc_offset, uint32_t len)
@@ -234,6 +242,7 @@ usb2_uiomove(struct usb2_page_cache *pc,
 	}
 	return (error);
 }
+#endif
 
 /*------------------------------------------------------------------------*
  *  usb2_copy_out - copy directly from DMA-able memory
@@ -266,6 +275,7 @@ usb2_copy_out(struct usb2_page_cache *ca
  *    0: Success
  * Else: Failure
  *------------------------------------------------------------------------*/
+#if USB_HAVE_USER_IO
 int
 usb2_copy_out_user(struct usb2_page_cache *cache, uint32_t offset,
     void *ptr, uint32_t len)
@@ -290,6 +300,7 @@ usb2_copy_out_user(struct usb2_page_cach
 	}
 	return (0);			/* success */
 }
+#endif
 
 /*------------------------------------------------------------------------*
  *  usb2_bzero - zero DMA-able memory
@@ -313,8 +324,7 @@ usb2_bzero(struct usb2_page_cache *cache
 	}
 }
 
-
-#ifdef __FreeBSD__
+#if USB_HAVE_BUSDMA && defined(__FreeBSD__)
 
 /*------------------------------------------------------------------------*
  *	usb2_dma_lock_cb - dummy callback
@@ -691,7 +701,7 @@ usb2_pc_dmamap_create(struct usb2_page_c
 	struct usb2_dma_tag *utag;
 
 	/* get info */
-	info = pc->tag_parent->info;
+	info = USB_DMATAG_TO_XROOT(pc->tag_parent);
 
 	/* sanity check */
 	if (info == NULL) {
@@ -731,7 +741,7 @@ usb2_pc_dmamap_destroy(struct usb2_page_
 
 #endif
 
-#ifdef __NetBSD__
+#if USB_HAVE_BUSDMA && defined(__NetBSD__)
 
 /*------------------------------------------------------------------------*
  *	usb2_dma_tag_create - allocate a DMA tag
@@ -1062,7 +1072,7 @@ usb2_pc_dmamap_create(struct usb2_page_c
 	struct usb2_dma_tag *utag;
 
 	/* get info */
-	info = pc->tag_parent->info;
+	info = USB_DMATAG_TO_XROOT(pc->tag_parent);
 
 	/* sanity check */
 	if (info == NULL) {
@@ -1106,6 +1116,8 @@ usb2_pc_dmamap_destroy(struct usb2_page_
 
 #endif
 
+#if USB_HAVE_BUSDMA
+
 /*------------------------------------------------------------------------*
  *	usb2_dma_tag_find - factored out code
  *------------------------------------------------------------------------*/
@@ -1148,8 +1160,7 @@ void
 usb2_dma_tag_setup(struct usb2_dma_parent_tag *udpt,
     struct usb2_dma_tag *udt, bus_dma_tag_t dmat,
     struct mtx *mtx, usb2_dma_callback_t *func,
-    struct usb2_xfer_root *info, uint8_t ndmabits,
-    uint8_t nudt)
+    uint8_t ndmabits, uint8_t nudt)
 {
 	bzero(udpt, sizeof(*udpt));
 
@@ -1167,7 +1178,6 @@ usb2_dma_tag_setup(struct usb2_dma_paren
 
 	/* store some information */
 	udpt->mtx = mtx;
-	udpt->info = info;
 	udpt->func = func;
 	udpt->tag = dmat;
 	udpt->utag_first = udt;
@@ -1349,7 +1359,7 @@ usb2_bdma_done_event(struct usb2_dma_par
 {
 	struct usb2_xfer_root *info;
 
-	info = udpt->info;
+	info = USB_DMATAG_TO_XROOT(udpt);
 
 	mtx_assert(info->xfer_mtx, MA_OWNED);
 
@@ -1423,3 +1433,5 @@ usb2_bdma_post_sync(struct usb2_xfer *xf
 		pc++;
 	}
 }
+
+#endif

Modified: head/sys/dev/usb/usb_busdma.h
==============================================================================
--- head/sys/dev/usb/usb_busdma.h	Fri Mar 20 21:47:26 2009	(r190179)
+++ head/sys/dev/usb/usb_busdma.h	Fri Mar 20 21:48:11 2009	(r190180)
@@ -60,8 +60,10 @@ typedef void (usb2_dma_callback_t)(struc
  * address of a memory page having size USB_PAGE_SIZE.
  */
 struct usb2_page {
+#if USB_HAVE_BUSDMA
 	bus_size_t physaddr;
 	void   *buffer;			/* non Kernel Virtual Address */
+#endif
 };
 
 /*
@@ -71,7 +73,9 @@ struct usb2_page {
  */
 struct usb2_page_search {
 	void   *buffer;
+#if USB_HAVE_BUSDMA
 	bus_size_t physaddr;
+#endif
 	uint32_t length;
 };
 
@@ -81,62 +85,67 @@ struct usb2_page_search {
  */
 struct usb2_page_cache {
 
-#ifdef __FreeBSD__
+#if USB_HAVE_BUSDMA && defined(__FreeBSD__)
 	bus_dma_tag_t tag;
 	bus_dmamap_t map;
 #endif
-#ifdef __NetBSD__
+#if USB_HAVE_BUSDMA && defined(__NetBSD__)
 	bus_dma_tag_t tag;
 	bus_dmamap_t map;
 	bus_dma_segment_t *p_seg;
 #endif
+#if USB_HAVE_BUSDMA
 	struct usb2_page *page_start;
+#endif
 	struct usb2_dma_parent_tag *tag_parent;	/* always set */
 	void   *buffer;			/* virtual buffer pointer */
-#ifdef __NetBSD__
+#if USB_HAVE_BUSDMA && defined(_NetBSD__)
 	int	n_seg;
 #endif
+#if USB_HAVE_BUSDMA
 	uint32_t page_offset_buf;
 	uint32_t page_offset_end;
 	uint8_t	isread:1;		/* set if we are currently reading
 					 * from the memory. Else write. */
 	uint8_t	ismultiseg:1;		/* set if we can have multiple
 					 * segments */
+#endif
 };
 
 /*
  * The following structure describes the parent USB DMA tag.
  */
 struct usb2_dma_parent_tag {
-#ifdef __FreeBSD__
+#if USB_HAVE_BUSDMA && defined(__FreeBSD__)
 	struct cv cv[1];		/* internal condition variable */
 #endif
-
+#if USB_HAVE_BUSDMA
 	bus_dma_tag_t tag;		/* always set */
 
 	struct mtx *mtx;		/* private mutex, always set */
-	struct usb2_xfer_root *info;	/* used by the callback function */
 	usb2_dma_callback_t *func;	/* load complete callback function */
 	struct usb2_dma_tag *utag_first;/* pointer to first USB DMA tag */
-
 	uint8_t	dma_error;		/* set if DMA load operation failed */
 	uint8_t	dma_bits;		/* number of DMA address lines */
 	uint8_t	utag_max;		/* number of USB DMA tags */
+#endif
 };
 
 /*
  * The following structure describes an USB DMA tag.
  */
 struct usb2_dma_tag {
-#ifdef __NetBSD__
+#if USB_HAVE_BUSDMA && defined(__NetBSD__)
 	bus_dma_segment_t *p_seg;
 #endif
+#if USB_HAVE_BUSDMA
 	struct usb2_dma_parent_tag *tag_parent;
 	bus_dma_tag_t tag;
 
 	uint32_t align;
 	uint32_t size;
-#ifdef __NetBSD__
+#endif
+#if USB_HAVE_BUSDMA && defined(__NetBSD__)
 	uint32_t n_seg;
 #endif
 };
@@ -168,8 +177,7 @@ int	usb2_copy_out_user(struct usb2_page_
 	    void *ptr, uint32_t len);
 void	usb2_dma_tag_setup(struct usb2_dma_parent_tag *udpt,
 	    struct usb2_dma_tag *udt, bus_dma_tag_t dmat, struct mtx *mtx,
-	    usb2_dma_callback_t *func, struct usb2_xfer_root *info,
-	    uint8_t ndmabits, uint8_t nudt);
+	    usb2_dma_callback_t *func, uint8_t ndmabits, uint8_t nudt);
 void	usb2_dma_tag_unsetup(struct usb2_dma_parent_tag *udpt);
 void	usb2_get_page(struct usb2_page_cache *pc, uint32_t offset,
 	    struct usb2_page_search *res);

Modified: head/sys/dev/usb/usb_core.h
==============================================================================
--- head/sys/dev/usb/usb_core.h	Fri Mar 20 21:47:26 2009	(r190179)
+++ head/sys/dev/usb/usb_core.h	Fri Mar 20 21:48:11 2009	(r190180)
@@ -32,16 +32,84 @@
 #ifndef _USB2_CORE_H_
 #define	_USB2_CORE_H_
 
+/* Allow defines in "opt_usb.h" to override configuration */
+
+#include "opt_usb.h"
+#include "opt_bus.h"
+
 /* Default USB configuration */
 
-#ifndef USB_USE_CONDVAR
-#define	USB_USE_CONDVAR 0
+/*
+ * The following macro defines if the code shall use cv_xxx() instead
+ * of msleep() and wakeup().
+ */
+#ifndef USB_HAVE_CONDVAR
+#define	USB_HAVE_CONDVAR 0
 #endif
 
+/*
+ * The following macro defines if the code shall support
+ * /dev/usb/x.y.z.
+ */
 #ifndef USB_HAVE_UGEN
 #define	USB_HAVE_UGEN 1
 #endif
 
+/*
+ * The following macro defines if the code shall support any forms of
+ * ASCII strings.
+ */
+#ifndef USB_HAVE_STRINGS
+#define	USB_HAVE_STRINGS 1
+#endif
+
+/*
+ * The following macro defines if the code shall support BUS-DMA.
+ */
+#ifndef USB_HAVE_BUSDMA
+#define	USB_HAVE_BUSDMA 1
+#endif
+
+/*
+ * The following macro defines if the code shall support the Linux
+ * compatibility layer.
+ */
+#ifndef USB_HAVE_COMPAT_LINUX
+#define	USB_HAVE_COMPAT_LINUX 1
+#endif
+
+/*
+ * The following macro defines if the code shall support
+ * userland data transfer via copyin() and copyout()
+ */
+#ifndef USB_HAVE_USER_IO
+#define	USB_HAVE_USER_IO 1
+#endif
+
+/*
+ * The following macro defines if the code shall support copy in via
+ * bsd-mbufs to USB.
+ */
+#ifndef USB_HAVE_MBUF
+#define	USB_HAVE_MBUF 1
+#endif
+
+/*
+ * The following macro defines if the code shall compile a table
+ * describing USB vendor and product IDs.
+ */
+#ifndef USB_VERBOSE
+#define	USB_VERBOSE 1
+#endif
+
+/*
+ * The following macro defines if USB debugging support shall be
+ * compiled for the USB core and all drivers.
+ */
+#ifndef USB_DEBUG
+#define	USB_DEBUG 1
+#endif
+
 #ifndef USB_TD_GET_PROC
 #define	USB_TD_GET_PROC(td) (td)->td_proc
 #endif
@@ -76,8 +144,6 @@
 #include 
 
 #include "usb_if.h"
-#include "opt_usb.h"
-#include "opt_bus.h"
 
 #define	USB_STACK_VERSION 2000		/* 2.0 */
 
@@ -95,10 +161,6 @@
 
 #define	USB_MAX_IPACKET		8	/* maximum size of the initial USB
 					 * data packet */
-#ifndef USB_VERBOSE
-#define	USB_VERBOSE 1
-#endif
-
 #define	USB_HUB_MAX_DEPTH 5
 
 /* USB transfer states */
@@ -256,12 +318,14 @@ struct usb2_xfer_flags_int {
 
 	uint8_t	short_frames_ok:1;	/* filtered version */
 	uint8_t	short_xfer_ok:1;	/* filtered version */
+#if USB_HAVE_BUSDMA
 	uint8_t	bdma_enable:1;		/* filtered version (only set if
 					 * hardware supports DMA) */
 	uint8_t	bdma_no_post_sync:1;	/* set if the USB callback wrapper
 					 * should not do the BUS-DMA post sync
 					 * operation */
 	uint8_t	bdma_setup:1;		/* set if BUS-DMA has been setup */
+#endif
 	uint8_t	isochronous_xfr:1;	/* set if isochronous transfer */
 	uint8_t	usb2_mode:1;		/* shadow copy of "udev->usb2_mode" */
 	uint8_t	curr_dma_set:1;		/* used by USB HC/DC driver */

Modified: head/sys/dev/usb/usb_debug.h
==============================================================================
--- head/sys/dev/usb/usb_debug.h	Fri Mar 20 21:47:26 2009	(r190179)
+++ head/sys/dev/usb/usb_debug.h	Fri Mar 20 21:48:11 2009	(r190180)
@@ -35,11 +35,6 @@ SYSCTL_DECL(_hw_usb2);
 /* Declare global USB debug variable. */
 extern int usb2_debug;
 
-/* Force debugging until further */
-#ifndef USB_DEBUG
-#define	USB_DEBUG 1
-#endif
-
 /* Check if USB debugging is enabled. */
 #ifdef USB_DEBUG_VAR
 #if (USB_DEBUG != 0)

Modified: head/sys/dev/usb/usb_device.c
==============================================================================
--- head/sys/dev/usb/usb_device.c	Fri Mar 20 21:47:26 2009	(r190179)
+++ head/sys/dev/usb/usb_device.c	Fri Mar 20 21:48:11 2009	(r190180)
@@ -44,9 +44,11 @@
 #include 
 #include 
 #include 
-#include 
 #include 
+#if USB_HAVE_UGEN
+#include 
 #include 
+#endif
 
 #include 
 
@@ -68,7 +70,9 @@ static void	usb2_init_attach_arg(struct 
 static void	usb2_suspend_resume_sub(struct usb2_device *, device_t,
 		    uint8_t);
 static void	usb2_clear_stall_proc(struct usb2_proc_msg *_pm);
+#if USB_HAVE_STRINGS
 static void	usb2_check_strings(struct usb2_device *);
+#endif
 static usb2_error_t usb2_fill_iface_data(struct usb2_device *, uint8_t,
 		    uint8_t);
 static void	usb2_notify_addq(const char *type, struct usb2_device *);
@@ -482,11 +486,13 @@ usb2_free_iface_data(struct usb2_device 
 
 	/* mtx_assert() */
 
+#if USB_HAVE_COMPAT_LINUX
 	/* free Linux compat device, if any */
 	if (udev->linux_dev) {
 		usb_linux_free_device(udev->linux_dev);
 		udev->linux_dev = NULL;
 	}
+#endif
 	/* free all pipes, if any */
 	usb2_free_pipe_data(udev, 0, 0);
 
@@ -1584,6 +1590,7 @@ usb2_alloc_device(device_t parent_dev, s
 	/* assume 100mA bus powered for now. Changed when configured. */
 	udev->power = USB_MIN_POWER;
 
+#if USB_HAVE_STRINGS
 	/* get serial number string */
 	err = usb2_req_get_string_any
 	    (udev, NULL, (char *)scratch_ptr,
@@ -1607,6 +1614,7 @@ usb2_alloc_device(device_t parent_dev, s
 
 	/* finish up all the strings */
 	usb2_check_strings(udev);
+#endif
 
 	if (udev->flags.usb2_mode == USB_MODE_HOST) {
 		uint8_t config_index;
@@ -2032,6 +2040,7 @@ usb2_devinfo(struct usb2_device *udev, c
 	}
 }
 
+#if USB_HAVE_STRINGS
 #if USB_VERBOSE
 /*
  * Descriptions of of known vendors and devices ("products").
@@ -2128,6 +2137,7 @@ usb2_check_strings(struct usb2_device *u
 		    sizeof(udev->product), "product 0x%04x", product_id);
 	}
 }
+#endif
 
 /*
  * Returns:

Modified: head/sys/dev/usb/usb_device.h
==============================================================================
--- head/sys/dev/usb/usb_device.h	Fri Mar 20 21:47:26 2009	(r190179)
+++ head/sys/dev/usb/usb_device.h	Fri Mar 20 21:48:11 2009	(r190180)
@@ -28,6 +28,7 @@
 #define	_USB2_DEVICE_H_
 
 struct usb2_symlink;
+struct usb_device;		/* linux compat */
 
 #define	USB_DEFAULT_XFER_MAX 2
 
@@ -114,7 +115,9 @@ struct usb2_device {
 	struct usb2_device *parent_hub;
 	struct usb2_config_descriptor *cdesc;	/* full config descr */
 	struct usb2_hub *hub;		/* only if this is a hub */
+#if USB_HAVE_COMPAT_LINUX
 	struct usb_device *linux_dev;
+#endif
 	struct usb2_xfer *default_xfer[USB_DEFAULT_XFER_MAX];
 	struct usb2_temp_data *usb2_template_ptr;
 	struct usb2_pipe *pipe_curr;	/* current clear stall pipe */

Modified: head/sys/dev/usb/usb_request.c
==============================================================================
--- head/sys/dev/usb/usb_request.c	Fri Mar 20 21:47:26 2009	(r190179)
+++ head/sys/dev/usb/usb_request.c	Fri Mar 20 21:48:11 2009	(r190180)
@@ -264,6 +264,10 @@ usb2_do_request_flags(struct usb2_device
 	if (actlen) {
 		*actlen = 0;
 	}
+#if (USB_HAVE_USER_IO == 0)
+	if (flags & USB_USER_DATA_PTR)
+		return (USB_ERR_INVAL);
+#endif
 	if (udev->flags.usb2_mode == USB_MODE_DEVICE) {
 		DPRINTF("USB device mode\n");
 		(usb2_temp_get_desc_p) (udev, req, &desc, &temp);
@@ -277,13 +281,14 @@ usb2_do_request_flags(struct usb2_device
 			*actlen = length;
 		}
 		if (length > 0) {
+#if USB_HAVE_USER_IO
 			if (flags & USB_USER_DATA_PTR) {
 				if (copyout(desc, data, length)) {
 					return (USB_ERR_INVAL);
 				}
-			} else {
+			} else
+#endif
 				bcopy(desc, data, length);
-			}
 		}
 		return (0);		/* success */
 	}
@@ -339,6 +344,7 @@ usb2_do_request_flags(struct usb2_device
 
 		if (temp > 0) {
 			if (!(req->bmRequestType & UT_READ)) {
+#if USB_HAVE_USER_IO
 				if (flags & USB_USER_DATA_PTR) {
 					USB_XFER_UNLOCK(xfer);
 					err = usb2_copy_in_user(xfer->frbuffers + 1,
@@ -348,9 +354,10 @@ usb2_do_request_flags(struct usb2_device
 						err = USB_ERR_INVAL;
 						break;
 					}
-				} else {
-					usb2_copy_in(xfer->frbuffers + 1, 0, data, temp);
-				}
+				} else
+#endif
+					usb2_copy_in(xfer->frbuffers + 1,
+					    0, data, temp);
 			}
 			xfer->nframes = 2;
 		} else {
@@ -408,6 +415,7 @@ usb2_do_request_flags(struct usb2_device
 		}
 		if (temp > 0) {
 			if (req->bmRequestType & UT_READ) {
+#if USB_HAVE_USER_IO
 				if (flags & USB_USER_DATA_PTR) {
 					USB_XFER_UNLOCK(xfer);
 					err = usb2_copy_out_user(xfer->frbuffers + 1,
@@ -417,10 +425,10 @@ usb2_do_request_flags(struct usb2_device
 						err = USB_ERR_INVAL;
 						break;
 					}
-				} else {
+				} else
+#endif
 					usb2_copy_out(xfer->frbuffers + 1,
 					    0, data, temp);
-				}
 			}
 		}
 		/*

Modified: head/sys/dev/usb/usb_transfer.c
==============================================================================
--- head/sys/dev/usb/usb_transfer.c	Fri Mar 20 21:47:26 2009	(r190179)
+++ head/sys/dev/usb/usb_transfer.c	Fri Mar 20 21:48:11 2009	(r190180)
@@ -191,6 +191,7 @@ usb2_get_dma_delay(struct usb2_bus *bus)
  *    0: Success
  * Else: Failure
  *------------------------------------------------------------------------*/
+#if USB_HAVE_BUSDMA
 uint8_t
 usb2_transfer_setup_sub_malloc(struct usb2_setup_params *parm,
     struct usb2_page_cache **ppc, uint32_t size, uint32_t align,
@@ -301,6 +302,7 @@ usb2_transfer_setup_sub_malloc(struct us
 	parm->dma_page_ptr = pg;
 	return (0);
 }
+#endif
 
 /*------------------------------------------------------------------------*
  *	usb2_transfer_setup_sub - transfer setup subroutine
@@ -643,6 +645,7 @@ usb2_transfer_setup_sub(struct usb2_setu
 	if (parm->bufsize_max < parm->bufsize) {
 		parm->bufsize_max = parm->bufsize;
 	}
+#if USB_HAVE_BUSDMA
 	if (xfer->flags_int.bdma_enable) {
 		/*
 		 * Setup "dma_page_ptr".
@@ -670,6 +673,7 @@ usb2_transfer_setup_sub(struct usb2_setu
 		parm->dma_page_ptr += (2 * n_frbuffers);
 		parm->dma_page_ptr += (parm->bufsize / USB_PAGE_SIZE);
 	}
+#endif
 	if (zmps) {
 		/* correct maximum data length */
 		xfer->max_data_length = 0;
@@ -694,7 +698,7 @@ usb2_transfer_setup_sub(struct usb2_setu
 		for (x = 0; x != n_frbuffers; x++) {
 			xfer->frbuffers[x].tag_parent =
 			    &xfer->xroot->dma_parent_tag;
-
+#if USB_HAVE_BUSDMA
 			if (xfer->flags_int.bdma_enable &&
 			    (parm->bufsize_max > 0)) {
 
@@ -705,6 +709,7 @@ usb2_transfer_setup_sub(struct usb2_setu
 					goto done;
 				}
 			}
+#endif
 		}
 	}
 done:
@@ -815,28 +820,31 @@ usb2_transfer_setup(struct usb2_device *
 			info->memory_base = buf;
 			info->memory_size = parm.size[0];
 
+#if USB_HAVE_BUSDMA
 			info->dma_page_cache_start = USB_ADD_BYTES(buf, parm.size[4]);
 			info->dma_page_cache_end = USB_ADD_BYTES(buf, parm.size[5]);
+#endif
 			info->xfer_page_cache_start = USB_ADD_BYTES(buf, parm.size[5]);
 			info->xfer_page_cache_end = USB_ADD_BYTES(buf, parm.size[2]);
 
 			usb2_cv_init(&info->cv_drain, "WDRAIN");
 
 			info->xfer_mtx = xfer_mtx;
-
+#if USB_HAVE_BUSDMA
 			usb2_dma_tag_setup(&info->dma_parent_tag,
 			    parm.dma_tag_p, udev->bus->dma_parent_tag[0].tag,
-			    xfer_mtx, &usb2_bdma_done_event, info, 32, parm.dma_tag_max);
+			    xfer_mtx, &usb2_bdma_done_event, 32, parm.dma_tag_max);
+#endif
 
 			info->bus = udev->bus;
 			info->udev = udev;
 
 			TAILQ_INIT(&info->done_q.head);
 			info->done_q.command = &usb2_callback_wrapper;
-
+#if USB_HAVE_BUSDMA
 			TAILQ_INIT(&info->dma_q.head);
 			info->dma_q.command = &usb2_bdma_work_loop;
-
+#endif
 			info->done_m[0].hdr.pm_callback = &usb2_callback_proc;
 			info->done_m[0].xroot = info;
 			info->done_m[1].hdr.pm_callback = &usb2_callback_proc;
@@ -1084,6 +1092,7 @@ usb2_transfer_unsetup_sub(struct usb2_xf
 
 	USB_BUS_UNLOCK(info->bus);
 
+#if USB_HAVE_BUSDMA
 	/* free DMA'able memory, if any */
 	pc = info->dma_page_cache_start;
 	while (pc != info->dma_page_cache_end) {
@@ -1100,6 +1109,7 @@ usb2_transfer_unsetup_sub(struct usb2_xf
 
 	/* free all DMA tags */
 	usb2_dma_tag_unsetup(&info->dma_parent_tag);
+#endif
 
 	usb2_cv_destroy(&info->cv_drain);
 
@@ -1161,9 +1171,10 @@ usb2_transfer_unsetup(struct usb2_xfer *
 
 		usb2_transfer_drain(xfer);
 
+#if USB_HAVE_BUSDMA
 		if (xfer->flags_int.bdma_enable)
 			needs_delay = 1;
-
+#endif
 		/*
 		 * NOTE: default pipe does not have an
 		 * interface, even if pipe->iface_index == 0
@@ -1412,9 +1423,10 @@ usb2_start_hardware(struct usb2_xfer *xf
 	/* clear "did_close" flag */
 	xfer->flags_int.did_close = 0;
 
+#if USB_HAVE_BUSDMA
 	/* clear "bdma_setup" flag */
 	xfer->flags_int.bdma_setup = 0;
-
+#endif
 	/* by default we cannot cancel any USB transfer immediately */
 	xfer->flags_int.can_cancel_immed = 0;
 
@@ -1507,11 +1519,13 @@ usb2_start_hardware(struct usb2_xfer *xf
 	 * Check if BUS-DMA support is enabled and try to load virtual
 	 * buffers into DMA, if any:
 	 */
+#if USB_HAVE_BUSDMA
 	if (xfer->flags_int.bdma_enable) {
 		/* insert the USB transfer last in the BUS-DMA queue */
 		usb2_command_wrapper(&xfer->xroot->dma_q, xfer);
 		return;
 	}
+#endif
 	/*
 	 * Enter the USB transfer into the Host Controller or
 	 * Device Controller schedule:
@@ -1923,12 +1937,13 @@ usb2_callback_wrapper(struct usb2_xfer_q
 		} else {
 			/* set transferred state */
 			xfer->usb2_state = USB_ST_TRANSFERRED;
-
+#if USB_HAVE_BUSDMA
 			/* sync DMA memory, if any */
 			if (xfer->flags_int.bdma_enable &&
 			    (!xfer->flags_int.bdma_no_post_sync)) {
 				usb2_bdma_post_sync(xfer);
 			}
+#endif
 		}
 	}
 
@@ -2042,8 +2057,6 @@ usb2_transfer_enqueue(struct usb2_xfer_q
 void
 usb2_transfer_done(struct usb2_xfer *xfer, usb2_error_t error)
 {
-	struct usb2_xfer_queue *pq;
-
 	USB_BUS_LOCK_ASSERT(xfer->xroot->bus, MA_OWNED);
 
 	DPRINTF("err=%s\n", usb2_errstr(error));
@@ -2070,7 +2083,10 @@ usb2_transfer_done(struct usb2_xfer *xfe
 	 */
 	usb2_transfer_dequeue(xfer);
 
+#if USB_HAVE_BUSDMA
 	if (mtx_owned(xfer->xroot->xfer_mtx)) {
+		struct usb2_xfer_queue *pq;
+
 		/*
 		 * If the private USB lock is not locked, then we assume
 		 * that the BUS-DMA load stage has been passed:
@@ -2082,6 +2098,7 @@ usb2_transfer_done(struct usb2_xfer *xfe
 			usb2_command_wrapper(pq, NULL);
 		}
 	}
+#endif
 	/* keep some statistics */
 	if (xfer->error) {
 		xfer->xroot->bus->stats_err.uds_requests

Modified: head/sys/dev/usb/usb_transfer.h
==============================================================================
--- head/sys/dev/usb/usb_transfer.h	Fri Mar 20 21:47:26 2009	(r190179)
+++ head/sys/dev/usb/usb_transfer.h	Fri Mar 20 21:48:11 2009	(r190180)
@@ -36,23 +36,33 @@ struct usb2_done_msg {
 	struct usb2_xfer_root *xroot;
 };
 
+#define	USB_DMATAG_TO_XROOT(dpt)				\
+  ((struct usb2_xfer_root *)(					\
+   ((uint8_t *)(dpt)) -						\
+   ((uint8_t *)&((struct usb2_xfer_root *)0)->dma_parent_tag) +	\
+   ((uint8_t *)0)))
+
 /*
  * The following structure is used to keep information about memory
  * that should be automatically freed at the moment all USB transfers
  * have been freed.
  */
 struct usb2_xfer_root {
+	struct usb2_dma_parent_tag dma_parent_tag;
+#if USB_HAVE_BUSDMA
 	struct usb2_xfer_queue dma_q;
+#endif
 	struct usb2_xfer_queue done_q;
 	struct usb2_done_msg done_m[2];
 	struct cv cv_drain;
-	struct usb2_dma_parent_tag dma_parent_tag;
 
 	struct usb2_process *done_p;	/* pointer to callback process */
 	void   *memory_base;
 	struct mtx *xfer_mtx;	/* cannot be changed during operation */
+#if USB_HAVE_BUSDMA
 	struct usb2_page_cache *dma_page_cache_start;
 	struct usb2_page_cache *dma_page_cache_end;
+#endif
 	struct usb2_page_cache *xfer_page_cache_start;
 	struct usb2_page_cache *xfer_page_cache_end;
 	struct usb2_bus *bus;		/* pointer to USB bus (cached) */

Modified: head/sys/dev/usb/usb_util.c
==============================================================================
--- head/sys/dev/usb/usb_util.c	Fri Mar 20 21:47:26 2009	(r190179)
+++ head/sys/dev/usb/usb_util.c	Fri Mar 20 21:48:11 2009	(r190180)
@@ -39,7 +39,7 @@
 #include 
 
 /* function prototypes */
-#if (USB_USE_CONDVAR == 0)
+#if (USB_HAVE_CONDVAR == 0)
 static int usb2_msleep(void *chan, struct mtx *mtx, int priority, const char *wmesg, int timo);
 
 #endif
@@ -47,6 +47,7 @@ static int usb2_msleep(void *chan, struc
 /*------------------------------------------------------------------------*
  * device_delete_all_children - delete all children of a device
  *------------------------------------------------------------------------*/

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

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 20 21:50:55 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8B758106566B;
	Fri, 20 Mar 2009 21:50:55 +0000 (UTC)
	(envelope-from thompsa@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 786188FC23;
	Fri, 20 Mar 2009 21:50:55 +0000 (UTC)
	(envelope-from thompsa@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2KLotYm014657;
	Fri, 20 Mar 2009 21:50:55 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2KLosLI014640;
	Fri, 20 Mar 2009 21:50:54 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <200903202150.n2KLosLI014640@svn.freebsd.org>
From: Andrew Thompson 
Date: Fri, 20 Mar 2009 21:50: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: r190181 - in head/sys/dev/usb: . controller 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: Fri, 20 Mar 2009 21:50:56 -0000

Author: thompsa
Date: Fri Mar 20 21:50:54 2009
New Revision: 190181
URL: http://svn.freebsd.org/changeset/base/190181

Log:
  MFp4 //depot/projects/usb @159431,159437,159438
  
  - start using the new USB typedefs in the USB core
  - Remove usage of USB_ADD_BYTES()
  
  Submitted by:	Hans Petter Selasky

Modified:
  head/sys/dev/usb/controller/at91dci.c
  head/sys/dev/usb/controller/atmegadci.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/controller/uss820dci.c
  head/sys/dev/usb/storage/ustorage_fs.c
  head/sys/dev/usb/usb_bus.h
  head/sys/dev/usb/usb_busdma.c
  head/sys/dev/usb/usb_busdma.h
  head/sys/dev/usb/usb_compat_linux.c
  head/sys/dev/usb/usb_compat_linux.h
  head/sys/dev/usb/usb_controller.h
  head/sys/dev/usb/usb_core.h
  head/sys/dev/usb/usb_dev.c
  head/sys/dev/usb/usb_dev.h
  head/sys/dev/usb/usb_device.c
  head/sys/dev/usb/usb_device.h
  head/sys/dev/usb/usb_generic.c
  head/sys/dev/usb/usb_hid.c
  head/sys/dev/usb/usb_hid.h
  head/sys/dev/usb/usb_hub.c
  head/sys/dev/usb/usb_hub.h
  head/sys/dev/usb/usb_lookup.c
  head/sys/dev/usb/usb_lookup.h
  head/sys/dev/usb/usb_mbuf.c
  head/sys/dev/usb/usb_mbuf.h
  head/sys/dev/usb/usb_msctest.c
  head/sys/dev/usb/usb_process.c
  head/sys/dev/usb/usb_process.h
  head/sys/dev/usb/usb_request.c
  head/sys/dev/usb/usb_request.h
  head/sys/dev/usb/usb_sw_transfer.c
  head/sys/dev/usb/usb_transfer.c
  head/sys/dev/usb/usb_transfer.h

Modified: head/sys/dev/usb/controller/at91dci.c
==============================================================================
--- head/sys/dev/usb/controller/at91dci.c	Fri Mar 20 21:48:11 2009	(r190180)
+++ head/sys/dev/usb/controller/at91dci.c	Fri Mar 20 21:50:54 2009	(r190181)
@@ -66,7 +66,7 @@ __FBSDID("$FreeBSD$");
 
 #define	AT9100_DCI_BUS2SC(bus) \
    ((struct at91dci_softc *)(((uint8_t *)(bus)) - \
-   USB_P2U(&(((struct at91dci_softc *)0)->sc_bus))))
+    ((uint8_t *)&(((struct at91dci_softc *)0)->sc_bus))))
 
 #define	AT9100_DCI_PC2SC(pc) \
    AT9100_DCI_BUS2SC(USB_DMATAG_TO_XROOT((pc)->tag_parent)->bus)

Modified: head/sys/dev/usb/controller/atmegadci.c
==============================================================================
--- head/sys/dev/usb/controller/atmegadci.c	Fri Mar 20 21:48:11 2009	(r190180)
+++ head/sys/dev/usb/controller/atmegadci.c	Fri Mar 20 21:50:54 2009	(r190181)
@@ -59,7 +59,7 @@ __FBSDID("$FreeBSD$");
 
 #define	ATMEGA_BUS2SC(bus) \
    ((struct atmegadci_softc *)(((uint8_t *)(bus)) - \
-   USB_P2U(&(((struct atmegadci_softc *)0)->sc_bus))))
+    ((uint8_t *)&(((struct atmegadci_softc *)0)->sc_bus))))
 
 #define	ATMEGA_PC2SC(pc) \
    ATMEGA_BUS2SC(USB_DMATAG_TO_XROOT((pc)->tag_parent)->bus)

Modified: head/sys/dev/usb/controller/ehci.c
==============================================================================
--- head/sys/dev/usb/controller/ehci.c	Fri Mar 20 21:48:11 2009	(r190180)
+++ head/sys/dev/usb/controller/ehci.c	Fri Mar 20 21:50:54 2009	(r190181)
@@ -66,8 +66,9 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#define	EHCI_BUS2SC(bus) ((ehci_softc_t *)(((uint8_t *)(bus)) - \
-   USB_P2U(&(((ehci_softc_t *)0)->sc_bus))))
+#define	EHCI_BUS2SC(bus) \
+   ((ehci_softc_t *)(((uint8_t *)(bus)) - \
+    ((uint8_t *)&(((ehci_softc_t *)0)->sc_bus))))
 
 #if USB_DEBUG
 static int ehcidebug = 0;
@@ -1729,7 +1730,7 @@ ehci_setup_standard_chain(struct usb2_xf
 	    xfer->address, UE_GET_ADDR(xfer->endpoint),
 	    xfer->sumlen, usb2_get_speed(xfer->xroot->udev));
 
-	temp.average = xfer->max_usb2_frame_size;
+	temp.average = xfer->max_hc_frame_size;
 	temp.max_frame_size = xfer->max_frame_size;
 	temp.sc = EHCI_BUS2SC(xfer->xroot->bus);
 
@@ -3563,7 +3564,7 @@ ehci_xfer_setup(struct usb2_setup_params
 
 		nqh = 1;
 		nqtd = ((2 * xfer->nframes) + 1	/* STATUS */
-		    + (xfer->max_data_length / xfer->max_usb2_frame_size));
+		    + (xfer->max_data_length / xfer->max_hc_frame_size));
 
 	} else if (parm->methods == &ehci_device_bulk_methods) {
 
@@ -3576,7 +3577,7 @@ ehci_xfer_setup(struct usb2_setup_params
 
 		nqh = 1;
 		nqtd = ((2 * xfer->nframes)
-		    + (xfer->max_data_length / xfer->max_usb2_frame_size));
+		    + (xfer->max_data_length / xfer->max_hc_frame_size));
 
 	} else if (parm->methods == &ehci_device_intr_methods) {
 
@@ -3598,7 +3599,7 @@ ehci_xfer_setup(struct usb2_setup_params
 
 		nqh = 1;
 		nqtd = ((2 * xfer->nframes)
-		    + (xfer->max_data_length / xfer->max_usb2_frame_size));
+		    + (xfer->max_data_length / xfer->max_hc_frame_size));
 
 	} else if (parm->methods == &ehci_device_isoc_fs_methods) {
 

Modified: head/sys/dev/usb/controller/ohci.c
==============================================================================
--- head/sys/dev/usb/controller/ohci.c	Fri Mar 20 21:48:11 2009	(r190180)
+++ head/sys/dev/usb/controller/ohci.c	Fri Mar 20 21:50:54 2009	(r190181)
@@ -55,8 +55,9 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#define	OHCI_BUS2SC(bus) ((ohci_softc_t *)(((uint8_t *)(bus)) - \
-   USB_P2U(&(((ohci_softc_t *)0)->sc_bus))))
+#define	OHCI_BUS2SC(bus) \
+   ((ohci_softc_t *)(((uint8_t *)(bus)) - \
+    ((uint8_t *)&(((ohci_softc_t *)0)->sc_bus))))
 
 #if USB_DEBUG
 static int ohcidebug = 0;
@@ -1410,7 +1411,7 @@ ohci_setup_standard_chain(struct usb2_xf
 	    xfer->address, UE_GET_ADDR(xfer->endpoint),
 	    xfer->sumlen, usb2_get_speed(xfer->xroot->udev));
 
-	temp.average = xfer->max_usb2_frame_size;
+	temp.average = xfer->max_hc_frame_size;
 	temp.max_frame_size = xfer->max_frame_size;
 
 	/* toggle the DMA set we are using */
@@ -2528,7 +2529,7 @@ ohci_xfer_setup(struct usb2_setup_params
 
 		nitd = 0;
 		ntd = ((2 * xfer->nframes) + 1	/* STATUS */
-		    + (xfer->max_data_length / xfer->max_usb2_frame_size));
+		    + (xfer->max_data_length / xfer->max_hc_frame_size));
 		nqh = 1;
 
 	} else if (parm->methods == &ohci_device_bulk_methods) {
@@ -2538,7 +2539,7 @@ ohci_xfer_setup(struct usb2_setup_params
 
 		nitd = 0;
 		ntd = ((2 * xfer->nframes)
-		    + (xfer->max_data_length / xfer->max_usb2_frame_size));
+		    + (xfer->max_data_length / xfer->max_hc_frame_size));
 		nqh = 1;
 
 	} else if (parm->methods == &ohci_device_intr_methods) {
@@ -2548,7 +2549,7 @@ ohci_xfer_setup(struct usb2_setup_params
 
 		nitd = 0;
 		ntd = ((2 * xfer->nframes)
-		    + (xfer->max_data_length / xfer->max_usb2_frame_size));
+		    + (xfer->max_data_length / xfer->max_hc_frame_size));
 		nqh = 1;
 
 	} else if (parm->methods == &ohci_device_isoc_methods) {

Modified: head/sys/dev/usb/controller/uhci.c
==============================================================================
--- head/sys/dev/usb/controller/uhci.c	Fri Mar 20 21:48:11 2009	(r190180)
+++ head/sys/dev/usb/controller/uhci.c	Fri Mar 20 21:50:54 2009	(r190181)
@@ -59,8 +59,9 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #define	alt_next next
-#define	UHCI_BUS2SC(bus) ((uhci_softc_t *)(((uint8_t *)(bus)) - \
-   USB_P2U(&(((uhci_softc_t *)0)->sc_bus))))
+#define	UHCI_BUS2SC(bus) \
+   ((uhci_softc_t *)(((uint8_t *)(bus)) - \
+    ((uint8_t *)&(((uhci_softc_t *)0)->sc_bus))))
 
 #if USB_DEBUG
 static int uhcidebug = 0;

Modified: head/sys/dev/usb/controller/uss820dci.c
==============================================================================
--- head/sys/dev/usb/controller/uss820dci.c	Fri Mar 20 21:48:11 2009	(r190180)
+++ head/sys/dev/usb/controller/uss820dci.c	Fri Mar 20 21:50:54 2009	(r190181)
@@ -55,7 +55,7 @@
 
 #define	USS820_DCI_BUS2SC(bus) \
    ((struct uss820dci_softc *)(((uint8_t *)(bus)) - \
-   USB_P2U(&(((struct uss820dci_softc *)0)->sc_bus))))
+    ((uint8_t *)&(((struct uss820dci_softc *)0)->sc_bus))))
 
 #define	USS820_DCI_PC2SC(pc) \
    USS820_DCI_BUS2SC(USB_DMATAG_TO_XROOT((pc)->tag_parent)->bus)

Modified: head/sys/dev/usb/storage/ustorage_fs.c
==============================================================================
--- head/sys/dev/usb/storage/ustorage_fs.c	Fri Mar 20 21:48:11 2009	(r190180)
+++ head/sys/dev/usb/storage/ustorage_fs.c	Fri Mar 20 21:50:54 2009	(r190181)
@@ -59,8 +59,11 @@ SYSCTL_INT(_hw_usb2_ustorage_fs, OID_AUT
 
 /* Define some limits */
 
-#define	USTORAGE_FS_BULK_SIZE (1UL << 17)
-#define	USTORAGE_FS_MAX_LUN 8
+#ifndef USTORAGE_FS_BULK_SIZE 
+#define	USTORAGE_FS_BULK_SIZE (1UL << 17)	/* bytes */
+#endif
+
+#define	USTORAGE_FS_MAX_LUN 8	/* units */
 
 /*
  * The SCSI ID string must be exactly 28 characters long
@@ -136,7 +139,7 @@ typedef struct {
 
 struct ustorage_fs_lun {
 
-	void   *memory_image;
+	uint8_t	*memory_image;
 
 	uint32_t num_sectors;
 	uint32_t sense_data;
@@ -1370,8 +1373,7 @@ ustorage_fs_read(struct ustorage_fs_soft
 	file_offset = lba;
 	file_offset <<= 9;
 
-	sc->sc_transfer.data_ptr =
-	    USB_ADD_BYTES(currlun->memory_image, (uint32_t)file_offset);
+	sc->sc_transfer.data_ptr = currlun->memory_image + file_offset;
 
 	return (0);
 }
@@ -1435,8 +1437,7 @@ ustorage_fs_write(struct ustorage_fs_sof
 	file_offset = lba;
 	file_offset <<= 9;
 
-	sc->sc_transfer.data_ptr =
-	    USB_ADD_BYTES(currlun->memory_image, (uint32_t)file_offset);
+	sc->sc_transfer.data_ptr = currlun->memory_image + file_offset;
 
 	return (0);
 }

Modified: head/sys/dev/usb/usb_bus.h
==============================================================================
--- head/sys/dev/usb/usb_bus.h	Fri Mar 20 21:48:11 2009	(r190180)
+++ head/sys/dev/usb/usb_bus.h	Fri Mar 20 21:50:54 2009	(r190181)
@@ -81,9 +81,9 @@ struct usb2_bus {
 	struct usb2_bus_methods *methods;	/* filled by HC driver */
 	struct usb2_device **devices;
 
-	uint32_t hw_power_state;	/* see USB_HW_POWER_XXX */
-	uint32_t uframe_usage[USB_HS_MICRO_FRAMES_MAX];
-	uint32_t transfer_count[4];
+	usb2_power_mask_t hw_power_state;	/* see USB_HW_POWER_XXX */
+	usb2_size_t uframe_usage[USB_HS_MICRO_FRAMES_MAX];
+
 	uint16_t isoc_time_last;	/* in milliseconds */
 
 	uint8_t	alloc_failed;		/* Set if memory allocation failed. */

Modified: head/sys/dev/usb/usb_busdma.c
==============================================================================
--- head/sys/dev/usb/usb_busdma.c	Fri Mar 20 21:48:11 2009	(r190180)
+++ head/sys/dev/usb/usb_busdma.c	Fri Mar 20 21:50:54 2009	(r190181)
@@ -42,7 +42,7 @@
 #include 
 
 #if USB_HAVE_BUSDMA
-static void	usb2_dma_tag_create(struct usb2_dma_tag *, uint32_t, uint32_t);
+static void	usb2_dma_tag_create(struct usb2_dma_tag *, usb2_size_t, usb2_size_t);
 static void	usb2_dma_tag_destroy(struct usb2_dma_tag *);
 #endif
 
@@ -66,7 +66,7 @@ static void	usb2_pc_common_mem_cb(struct
  * been properly initialized !
  *------------------------------------------------------------------------*/
 void
-usb2_get_page(struct usb2_page_cache *pc, uint32_t offset,
+usb2_get_page(struct usb2_page_cache *pc, usb2_frlength_t offset,
     struct usb2_page_search *res)
 {
 	struct usb2_page *page;
@@ -122,8 +122,8 @@ usb2_get_page(struct usb2_page_cache *pc
  *  usb2_copy_in - copy directly to DMA-able memory
  *------------------------------------------------------------------------*/
 void
-usb2_copy_in(struct usb2_page_cache *cache, uint32_t offset,
-    const void *ptr, uint32_t len)
+usb2_copy_in(struct usb2_page_cache *cache, usb2_frlength_t offset,
+    const void *ptr, usb2_frlength_t len)
 {
 	struct usb2_page_search buf_res;
 
@@ -151,8 +151,8 @@ usb2_copy_in(struct usb2_page_cache *cac
  *------------------------------------------------------------------------*/
 #if USB_HAVE_USER_IO
 int
-usb2_copy_in_user(struct usb2_page_cache *cache, uint32_t offset,
-    const void *ptr, uint32_t len)
+usb2_copy_in_user(struct usb2_page_cache *cache, usb2_frlength_t offset,
+    const void *ptr, usb2_frlength_t len)
 {
 	struct usb2_page_search buf_res;
 	int error;
@@ -182,10 +182,10 @@ usb2_copy_in_user(struct usb2_page_cache
 #if USB_HAVE_MBUF
 struct usb2_m_copy_in_arg {
 	struct usb2_page_cache *cache;
-	uint32_t dst_offset;
+	usb2_frlength_t dst_offset;
 };
 
-static int32_t
+static int
 #ifdef __FreeBSD__
 usb2_m_copy_in_cb(void *arg, void *src, uint32_t count)
 #else
@@ -200,11 +200,11 @@ usb2_m_copy_in_cb(void *arg, caddr_t src
 }
 
 void
-usb2_m_copy_in(struct usb2_page_cache *cache, uint32_t dst_offset,
-    struct mbuf *m, uint32_t src_offset, uint32_t src_len)
+usb2_m_copy_in(struct usb2_page_cache *cache, usb2_frlength_t dst_offset,
+    struct mbuf *m, usb2_size_t src_offset, usb2_frlength_t src_len)
 {
 	struct usb2_m_copy_in_arg arg = {cache, dst_offset};
-	register int error;
+	int error;
 
 	error = m_apply(m, src_offset, src_len, &usb2_m_copy_in_cb, &arg);
 }
@@ -216,7 +216,7 @@ usb2_m_copy_in(struct usb2_page_cache *c
 #if USB_HAVE_USER_IO
 int
 usb2_uiomove(struct usb2_page_cache *pc, struct uio *uio,
-    uint32_t pc_offset, uint32_t len)
+    usb2_frlength_t pc_offset, usb2_frlength_t len)
 {
 	struct usb2_page_search res;
 	int error = 0;
@@ -248,8 +248,8 @@ usb2_uiomove(struct usb2_page_cache *pc,
  *  usb2_copy_out - copy directly from DMA-able memory
  *------------------------------------------------------------------------*/
 void
-usb2_copy_out(struct usb2_page_cache *cache, uint32_t offset,
-    void *ptr, uint32_t len)
+usb2_copy_out(struct usb2_page_cache *cache, usb2_frlength_t offset,
+    void *ptr, usb2_frlength_t len)
 {
 	struct usb2_page_search res;
 
@@ -277,8 +277,8 @@ usb2_copy_out(struct usb2_page_cache *ca
  *------------------------------------------------------------------------*/
 #if USB_HAVE_USER_IO
 int
-usb2_copy_out_user(struct usb2_page_cache *cache, uint32_t offset,
-    void *ptr, uint32_t len)
+usb2_copy_out_user(struct usb2_page_cache *cache, usb2_frlength_t offset,
+    void *ptr, usb2_frlength_t len)
 {
 	struct usb2_page_search res;
 	int error;
@@ -306,7 +306,8 @@ usb2_copy_out_user(struct usb2_page_cach
  *  usb2_bzero - zero DMA-able memory
  *------------------------------------------------------------------------*/
 void
-usb2_bzero(struct usb2_page_cache *cache, uint32_t offset, uint32_t len)
+usb2_bzero(struct usb2_page_cache *cache, usb2_frlength_t offset,
+    usb2_frlength_t len)
 {
 	struct usb2_page_search res;
 
@@ -343,7 +344,7 @@ usb2_dma_lock_cb(void *arg, bus_dma_lock
  *------------------------------------------------------------------------*/
 static void
 usb2_dma_tag_create(struct usb2_dma_tag *udt,
-    uint32_t size, uint32_t align)
+    usb2_size_t size, usb2_size_t align)
 {
 	bus_dma_tag_t tag;
 
@@ -408,7 +409,7 @@ usb2_pc_common_mem_cb(void *arg, bus_dma
 	struct usb2_dma_parent_tag *uptag;
 	struct usb2_page_cache *pc;
 	struct usb2_page *pg;
-	uint32_t rem;
+	usb2_size_t rem;
 	uint8_t owned;
 
 	pc = arg;
@@ -471,7 +472,7 @@ done:
  *------------------------------------------------------------------------*/
 uint8_t
 usb2_pc_alloc_mem(struct usb2_page_cache *pc, struct usb2_page *pg,
-    uint32_t size, uint32_t align)
+    usb2_size_t size, usb2_size_t align)
 {
 	struct usb2_dma_parent_tag *uptag;
 	struct usb2_dma_tag *utag;
@@ -594,7 +595,7 @@ usb2_pc_free_mem(struct usb2_page_cache 
  * Else: Error
  *------------------------------------------------------------------------*/
 uint8_t
-usb2_pc_load_mem(struct usb2_page_cache *pc, uint32_t size, uint8_t sync)
+usb2_pc_load_mem(struct usb2_page_cache *pc, usb2_size_t size, uint8_t sync)
 {
 	/* setup page cache */
 	pc->page_offset_buf = 0;
@@ -695,7 +696,7 @@ usb2_pc_cpu_flush(struct usb2_page_cache
  * Else: Failure
  *------------------------------------------------------------------------*/
 uint8_t
-usb2_pc_dmamap_create(struct usb2_page_cache *pc, uint32_t size)
+usb2_pc_dmamap_create(struct usb2_page_cache *pc, usb2_size_t size)
 {
 	struct usb2_xfer_root *info;
 	struct usb2_dma_tag *utag;
@@ -751,9 +752,9 @@ usb2_pc_dmamap_destroy(struct usb2_page_
  *------------------------------------------------------------------------*/
 static void
 usb2_dma_tag_create(struct usb2_dma_tag *udt,
-    uint32_t size, uint32_t align)
+    usb2_size_t size, usb2_size_t align)
 {
-	uint32_t nseg;
+	usb2_size_t nseg;
 
 	if (align == 1) {
 		nseg = (2 + (size / USB_PAGE_SIZE));
@@ -789,7 +790,7 @@ usb2_pc_common_mem_cb(struct usb2_page_c
 {
 	struct usb2_dma_parent_tag *uptag;
 	struct usb2_page *pg;
-	uint32_t rem;
+	usb2_size_t rem;
 	uint8_t ext_seg;		/* extend last segment */
 
 	uptag = pc->tag_parent;
@@ -855,7 +856,7 @@ done:
  *------------------------------------------------------------------------*/
 uint8_t
 usb2_pc_alloc_mem(struct usb2_page_cache *pc, struct usb2_page *pg,
-    uint32_t size, uint32_t align)
+    usb2_size_t size, usb2_size_t align)
 {
 	struct usb2_dma_parent_tag *uptag;
 	struct usb2_dma_tag *utag;
@@ -978,7 +979,7 @@ usb2_pc_free_mem(struct usb2_page_cache 
  * Else: Error
  *------------------------------------------------------------------------*/
 uint8_t
-usb2_pc_load_mem(struct usb2_page_cache *pc, uint32_t size, uint8_t sync)
+usb2_pc_load_mem(struct usb2_page_cache *pc, usb2_size_t size, uint8_t sync)
 {
 	int error;
 
@@ -1028,7 +1029,7 @@ usb2_pc_load_mem(struct usb2_page_cache 
 void
 usb2_pc_cpu_invalidate(struct usb2_page_cache *pc)
 {
-	uint32_t len;
+	usb2_size_t len;
 
 	len = pc->page_offset_end - pc->page_offset_buf;
 
@@ -1046,7 +1047,7 @@ usb2_pc_cpu_invalidate(struct usb2_page_
 void
 usb2_pc_cpu_flush(struct usb2_page_cache *pc)
 {
-	uint32_t len;
+	usb2_size_t len;
 
 	len = pc->page_offset_end - pc->page_offset_buf;
 
@@ -1066,7 +1067,7 @@ usb2_pc_cpu_flush(struct usb2_page_cache
  * Else: Failure
  *------------------------------------------------------------------------*/
 uint8_t
-usb2_pc_dmamap_create(struct usb2_page_cache *pc, uint32_t size)
+usb2_pc_dmamap_create(struct usb2_page_cache *pc, usb2_size_t size)
 {
 	struct usb2_xfer_root *info;
 	struct usb2_dma_tag *utag;
@@ -1123,7 +1124,7 @@ usb2_pc_dmamap_destroy(struct usb2_page_
  *------------------------------------------------------------------------*/
 struct usb2_dma_tag *
 usb2_dma_tag_find(struct usb2_dma_parent_tag *udpt,
-    uint32_t size, uint32_t align)
+    usb2_size_t size, usb2_size_t align)
 {
 	struct usb2_dma_tag *udt;
 	uint8_t nudt;
@@ -1232,7 +1233,7 @@ usb2_bdma_work_loop(struct usb2_xfer_que
 {
 	struct usb2_xfer_root *info;
 	struct usb2_xfer *xfer;
-	uint32_t nframes;
+	usb2_frcount_t nframes;
 
 	xfer = pq->curr;
 	info = xfer->xroot;
@@ -1248,7 +1249,7 @@ usb2_bdma_work_loop(struct usb2_xfer_que
 	}
 	if (!xfer->flags_int.bdma_setup) {
 		struct usb2_page *pg;
-		uint32_t frlength_0;
+		usb2_frlength_t frlength_0;
 		uint8_t isread;
 
 		xfer->flags_int.bdma_setup = 1;
@@ -1381,7 +1382,7 @@ void
 usb2_bdma_pre_sync(struct usb2_xfer *xfer)
 {
 	struct usb2_page_cache *pc;
-	uint32_t nframes;
+	usb2_frcount_t nframes;
 
 	if (xfer->flags_int.isochronous_xfr) {
 		/* only one frame buffer */
@@ -1414,7 +1415,7 @@ void
 usb2_bdma_post_sync(struct usb2_xfer *xfer)
 {
 	struct usb2_page_cache *pc;
-	uint32_t nframes;
+	usb2_frcount_t nframes;
 
 	if (xfer->flags_int.isochronous_xfr) {
 		/* only one frame buffer */

Modified: head/sys/dev/usb/usb_busdma.h
==============================================================================
--- head/sys/dev/usb/usb_busdma.h	Fri Mar 20 21:48:11 2009	(r190180)
+++ head/sys/dev/usb/usb_busdma.h	Fri Mar 20 21:50:54 2009	(r190181)
@@ -76,7 +76,7 @@ struct usb2_page_search {
 #if USB_HAVE_BUSDMA
 	bus_size_t physaddr;
 #endif
-	uint32_t length;
+	usb2_size_t length;
 };
 
 /*
@@ -103,8 +103,8 @@ struct usb2_page_cache {
 	int	n_seg;
 #endif
 #if USB_HAVE_BUSDMA
-	uint32_t page_offset_buf;
-	uint32_t page_offset_end;
+	usb2_size_t page_offset_buf;
+	usb2_size_t page_offset_end;
 	uint8_t	isread:1;		/* set if we are currently reading
 					 * from the memory. Else write. */
 	uint8_t	ismultiseg:1;		/* set if we can have multiple
@@ -142,47 +142,47 @@ struct usb2_dma_tag {
 	struct usb2_dma_parent_tag *tag_parent;
 	bus_dma_tag_t tag;
 
-	uint32_t align;
-	uint32_t size;
+	usb2_size_t align;
+	usb2_size_t size;
 #endif
 #if USB_HAVE_BUSDMA && defined(__NetBSD__)
-	uint32_t n_seg;
+	usb2_size_t n_seg;
 #endif
 };
 
 /* function prototypes */
 
 int	usb2_uiomove(struct usb2_page_cache *pc, struct uio *uio,
-	    uint32_t pc_offset, uint32_t len);
+	    usb2_frlength_t pc_offset, usb2_frlength_t len);
 struct usb2_dma_tag *usb2_dma_tag_find(struct usb2_dma_parent_tag *udpt,
-	    uint32_t size, uint32_t align);
+	    usb2_size_t size, usb2_size_t align);
 uint8_t	usb2_pc_alloc_mem(struct usb2_page_cache *pc, struct usb2_page *pg,
-	    uint32_t size, uint32_t align);
-uint8_t	usb2_pc_dmamap_create(struct usb2_page_cache *pc, uint32_t size);
-uint8_t	usb2_pc_load_mem(struct usb2_page_cache *pc, uint32_t size,
+	    usb2_size_t size, usb2_size_t align);
+uint8_t	usb2_pc_dmamap_create(struct usb2_page_cache *pc, usb2_size_t size);
+uint8_t	usb2_pc_load_mem(struct usb2_page_cache *pc, usb2_size_t size,
 	    uint8_t sync);
 void	usb2_bdma_done_event(struct usb2_dma_parent_tag *udpt);
 void	usb2_bdma_post_sync(struct usb2_xfer *xfer);
 void	usb2_bdma_pre_sync(struct usb2_xfer *xfer);
 void	usb2_bdma_work_loop(struct usb2_xfer_queue *pq);
-void	usb2_bzero(struct usb2_page_cache *cache, uint32_t offset,
-	    uint32_t len);
-void	usb2_copy_in(struct usb2_page_cache *cache, uint32_t offset,
-	    const void *ptr, uint32_t len);
-int	usb2_copy_in_user(struct usb2_page_cache *cache, uint32_t offset,
-	    const void *ptr, uint32_t len);
-void	usb2_copy_out(struct usb2_page_cache *cache, uint32_t offset,
-	    void *ptr, uint32_t len);
-int	usb2_copy_out_user(struct usb2_page_cache *cache, uint32_t offset,
-	    void *ptr, uint32_t len);
+void	usb2_bzero(struct usb2_page_cache *cache, usb2_frlength_t offset,
+	    usb2_frlength_t len);
+void	usb2_copy_in(struct usb2_page_cache *cache, usb2_frlength_t offset,
+	    const void *ptr, usb2_frlength_t len);
+int	usb2_copy_in_user(struct usb2_page_cache *cache, usb2_frlength_t offset,
+	    const void *ptr, usb2_frlength_t len);
+void	usb2_copy_out(struct usb2_page_cache *cache, usb2_frlength_t offset,
+	    void *ptr, usb2_frlength_t len);
+int	usb2_copy_out_user(struct usb2_page_cache *cache, usb2_frlength_t offset,
+	    void *ptr, usb2_frlength_t len);
 void	usb2_dma_tag_setup(struct usb2_dma_parent_tag *udpt,
 	    struct usb2_dma_tag *udt, bus_dma_tag_t dmat, struct mtx *mtx,
 	    usb2_dma_callback_t *func, uint8_t ndmabits, uint8_t nudt);
 void	usb2_dma_tag_unsetup(struct usb2_dma_parent_tag *udpt);
-void	usb2_get_page(struct usb2_page_cache *pc, uint32_t offset,
+void	usb2_get_page(struct usb2_page_cache *pc, usb2_frlength_t offset,
 	    struct usb2_page_search *res);
-void	usb2_m_copy_in(struct usb2_page_cache *cache, uint32_t dst_offset,
-	    struct mbuf *m, uint32_t src_offset, uint32_t src_len);
+void	usb2_m_copy_in(struct usb2_page_cache *cache, usb2_frlength_t dst_offset,
+	    struct mbuf *m, usb2_size_t src_offset, usb2_frlength_t src_len);
 void	usb2_pc_cpu_flush(struct usb2_page_cache *pc);
 void	usb2_pc_cpu_invalidate(struct usb2_page_cache *pc);
 void	usb2_pc_dmamap_destroy(struct usb2_page_cache *pc);

Modified: head/sys/dev/usb/usb_compat_linux.c
==============================================================================
--- head/sys/dev/usb/usb_compat_linux.c	Fri Mar 20 21:48:11 2009	(r190180)
+++ head/sys/dev/usb/usb_compat_linux.c	Fri Mar 20 21:50:54 2009	(r190181)
@@ -67,7 +67,7 @@ static usb2_callback_t usb_linux_non_iso
 static usb_complete_t usb_linux_wait_complete;
 
 static uint16_t	usb_max_isoc_frames(struct usb_device *);
-static int	usb_start_wait_urb(struct urb *, uint32_t, uint16_t *);
+static int	usb_start_wait_urb(struct urb *, usb2_timeout_t, uint16_t *);
 static const struct usb_device_id *usb_linux_lookup_id(
 		    const struct usb_device_id *, struct usb2_attach_arg *);
 static struct	usb_driver *usb_linux_get_usb_driver(struct usb_linux_softc *);
@@ -564,7 +564,7 @@ usb_clear_halt(struct usb_device *dev, s
  * Linux USB transfers.
  *------------------------------------------------------------------------*/
 static int
-usb_start_wait_urb(struct urb *urb, uint32_t timeout, uint16_t *p_actlen)
+usb_start_wait_urb(struct urb *urb, usb2_timeout_t timeout, uint16_t *p_actlen)
 {
 	int err;
 
@@ -620,7 +620,7 @@ int
 usb_control_msg(struct usb_device *dev, struct usb_host_endpoint *uhe,
     uint8_t request, uint8_t requesttype,
     uint16_t value, uint16_t index, void *data,
-    uint16_t size, uint32_t timeout)
+    uint16_t size, usb2_timeout_t timeout)
 {
 	struct usb2_device_request req;
 	struct urb *urb;
@@ -741,7 +741,7 @@ usb_set_interface(struct usb_device *dev
  *------------------------------------------------------------------------*/
 int
 usb_setup_endpoint(struct usb_device *dev,
-    struct usb_host_endpoint *uhe, uint32_t bufsize)
+    struct usb_host_endpoint *uhe, usb2_size_t bufsize)
 {
 	struct usb2_config cfg[2];
 	uint8_t type = uhe->desc.bmAttributes & UE_XFERTYPE;
@@ -836,7 +836,7 @@ usb_linux_create_usb_device(struct usb2_
 	struct usb_interface *p_ui = NULL;
 	struct usb_host_interface *p_uhi = NULL;
 	struct usb_host_endpoint *p_uhe = NULL;
-	uint32_t size;
+	usb2_size_t size;
 	uint16_t niface_total;
 	uint16_t nedesc;
 	uint16_t iface_no_curr;
@@ -971,7 +971,7 @@ struct urb *
 usb_alloc_urb(uint16_t iso_packets, uint16_t mem_flags)
 {
 	struct urb *urb;
-	uint32_t size;
+	usb2_size_t size;
 
 	if (iso_packets == 0xFFFF) {
 		/*
@@ -1102,7 +1102,7 @@ usb_ifnum_to_if(struct usb_device *dev, 
  *	usb_buffer_alloc
  *------------------------------------------------------------------------*/
 void   *
-usb_buffer_alloc(struct usb_device *dev, uint32_t size, uint16_t mem_flags, uint8_t *dma_addr)
+usb_buffer_alloc(struct usb_device *dev, usb2_size_t size, uint16_t mem_flags, uint8_t *dma_addr)
 {
 	return (malloc(size, M_USBDEV, M_WAITOK | M_ZERO));
 }
@@ -1193,7 +1193,7 @@ usb_linux_free_device(struct usb_device 
  *	usb_buffer_free
  *------------------------------------------------------------------------*/
 void
-usb_buffer_free(struct usb_device *dev, uint32_t size,
+usb_buffer_free(struct usb_device *dev, usb2_size_t size,
     void *addr, uint8_t dma_addr)
 {
 	free(addr, M_USBDEV);
@@ -1326,9 +1326,9 @@ usb_linux_complete(struct usb2_xfer *xfe
 static void
 usb_linux_isoc_callback(struct usb2_xfer *xfer)
 {
-	uint32_t max_frame = xfer->max_frame_size;
-	uint32_t offset;
-	uint16_t x;
+	usb2_frlength_t max_frame = xfer->max_frame_size;
+	usb2_frlength_t offset;
+	usb2_frcount_t x;
 	struct urb *urb = xfer->priv_fifo;
 	struct usb_host_endpoint *uhe = xfer->priv_sc;
 	struct usb_iso_packet_descriptor *uipd;
@@ -1500,7 +1500,7 @@ usb_linux_non_isoc_callback(struct usb2_
 	struct urb *urb = xfer->priv_fifo;
 	struct usb_host_endpoint *uhe = xfer->priv_sc;
 	uint8_t *ptr;
-	uint32_t max_bulk = xfer->max_data_length;
+	usb2_frlength_t max_bulk = xfer->max_data_length;
 	uint8_t data_frame = xfer->flags_int.control_xfr ? 1 : 0;
 
 	DPRINTF("\n");

Modified: head/sys/dev/usb/usb_compat_linux.h
==============================================================================
--- head/sys/dev/usb/usb_compat_linux.h	Fri Mar 20 21:48:11 2009	(r190180)
+++ head/sys/dev/usb/usb_compat_linux.h	Fri Mar 20 21:50:54 2009	(r190181)
@@ -321,7 +321,7 @@ struct usb_host_endpoint {
 
 	uint8_t *extra;			/* Extra descriptors */
 
-	uint32_t fbsd_buf_size;
+	usb2_frlength_t fbsd_buf_size;
 
 	uint16_t extralen;
 
@@ -406,10 +406,10 @@ struct urb {
 	void   *context;		/* (in) context for completion */
 	usb_complete_t *complete;	/* (in) completion routine */
 
-	uint32_t transfer_buffer_length;/* (in) data buffer length */
-	uint32_t actual_length;		/* (return) actual transfer length */
-	uint32_t bsd_length_rem;
-	uint32_t timeout;		/* FreeBSD specific */
+	usb2_size_t transfer_buffer_length;/* (in) data buffer length */
+	usb2_size_t bsd_length_rem;
+	usb2_size_t actual_length;	/* (return) actual transfer length */
+	usb2_timeout_t timeout;		/* FreeBSD specific */
 
 	uint16_t transfer_flags;	/* (in) */
 #define	URB_SHORT_NOT_OK	0x0001	/* report short transfers like errors */
@@ -420,8 +420,8 @@ struct urb {
 #define	URB_WAIT_WAKEUP		0x0010	/* custom flags */
 #define	URB_IS_SLEEPING		0x0020	/* custom flags */
 
-	uint16_t start_frame;		/* (modify) start frame (ISO) */
-	uint16_t number_of_packets;	/* (in) number of ISO packets */
+	usb2_frcount_t start_frame;	/* (modify) start frame (ISO) */
+	usb2_frcount_t number_of_packets;	/* (in) number of ISO packets */
 	uint16_t interval;		/* (modify) transfer interval
 					 * (INT/ISO) */
 	uint16_t error_count;		/* (return) number of ISO errors */
@@ -441,11 +441,11 @@ int	usb_unlink_urb(struct urb *urb);
 int	usb_clear_halt(struct usb_device *dev, struct usb_host_endpoint *uhe);
 int	usb_control_msg(struct usb_device *dev, struct usb_host_endpoint *pipe,
 	    uint8_t request, uint8_t requesttype, uint16_t value,
-	    uint16_t index, void *data, uint16_t size, uint32_t timeout);
+	    uint16_t index, void *data, uint16_t size, usb2_timeout_t timeout);
 int	usb_set_interface(struct usb_device *dev, uint8_t ifnum,
 	    uint8_t alternate);
 int	usb_setup_endpoint(struct usb_device *dev,
-	    struct usb_host_endpoint *uhe, uint32_t bufsize);
+	    struct usb_host_endpoint *uhe, usb2_frlength_t bufsize);
 
 struct usb_host_endpoint *usb_find_host_endpoint(struct usb_device *dev,
 	    uint8_t type, uint8_t ep);
@@ -454,11 +454,11 @@ struct usb_host_interface *usb_altnum_to
 	    const struct usb_interface *intf, uint8_t alt_index);
 struct usb_interface *usb_ifnum_to_if(struct usb_device *dev, uint8_t iface_no);
 
-void   *usb_buffer_alloc(struct usb_device *dev, uint32_t size,
+void   *usb_buffer_alloc(struct usb_device *dev, usb2_size_t size,
 	    uint16_t mem_flags, uint8_t *dma_addr);
 void   *usb_get_intfdata(struct usb_interface *intf);
 
-void	usb_buffer_free(struct usb_device *dev, uint32_t size, void *addr, uint8_t dma_addr);
+void	usb_buffer_free(struct usb_device *dev, usb2_size_t size, void *addr, uint8_t dma_addr);
 void	usb_free_urb(struct urb *urb);
 void	usb_init_urb(struct urb *urb);
 void	usb_kill_urb(struct urb *urb);

Modified: head/sys/dev/usb/usb_controller.h
==============================================================================
--- head/sys/dev/usb/usb_controller.h	Fri Mar 20 21:48:11 2009	(r190180)
+++ head/sys/dev/usb/usb_controller.h	Fri Mar 20 21:50:54 2009	(r190181)
@@ -45,7 +45,7 @@ struct usb2_endpoint_descriptor;
 
 /* typedefs */
 
-typedef void (usb2_bus_mem_sub_cb_t)(struct usb2_bus *bus, struct usb2_page_cache *pc, struct usb2_page *pg, uint32_t size, uint32_t align);
+typedef void (usb2_bus_mem_sub_cb_t)(struct usb2_bus *bus, struct usb2_page_cache *pc, struct usb2_page *pg, usb2_size_t size, usb2_size_t align);
 typedef void (usb2_bus_mem_cb_t)(struct usb2_bus *bus, usb2_bus_mem_sub_cb_t *scb);
 
 /*
@@ -175,7 +175,7 @@ struct usb2_hw_ep_scratch {
  */
 struct usb2_temp_setup {
 	void   *buf;
-	uint32_t size;
+	usb2_size_t size;
 	uint8_t	usb2_speed;
 	uint8_t	self_powered;
 	uint8_t	bNumEndpoints;

Modified: head/sys/dev/usb/usb_core.h
==============================================================================
--- head/sys/dev/usb/usb_core.h	Fri Mar 20 21:48:11 2009	(r190180)
+++ head/sys/dev/usb/usb_core.h	Fri Mar 20 21:50:54 2009	(r190181)
@@ -163,6 +163,10 @@
 					 * data packet */
 #define	USB_HUB_MAX_DEPTH 5
 
+#ifndef USB_EP0_BUFSIZE
+#define	USB_EP0_BUFSIZE		1024	/* bytes */
+#endif
+
 /* USB transfer states */
 
 #define	USB_ST_SETUP       0
@@ -229,30 +233,26 @@ typedef uint8_t usb2_error_t;		/* see "U
 typedef uint32_t usb2_timeout_t;	/* milliseconds */
 #endif
 
-#ifndef USB_HAVE_LENGTH_T
-typedef uint32_t usb2_length_t;		/* bytes */
-#endif
-
-#ifndef USB_HAVE_FRAMES_T
-typedef uint32_t usb2_frames_t;		/* units */
+#ifndef USB_HAVE_FRLENGTH_T
+typedef uint32_t usb2_frlength_t;	/* bytes */
 #endif
 
-#ifndef USB_HAVE_INTERVAL_T
-typedef uint32_t usb2_interval_t;	/* milliseconds */
+#ifndef USB_HAVE_FRCOUNT_T
+typedef uint32_t usb2_frcount_t;	/* units */
 #endif
 
 #ifndef USB_HAVE_SIZE_T
 typedef uint32_t usb2_size_t;		/* bytes */
 #endif
 
-#ifndef USB_HAVE_REFS_T
-typedef uint32_t usb2_refs_t;		/* units */
-#endif
-
 #ifndef USB_HAVE_TICKS_T
 typedef uint32_t usb2_ticks_t;		/* system defined */
 #endif
 
+#ifndef USB_HAVE_POWER_MASK_T
+typedef uint32_t usb2_power_mask_t;	/* see "USB_HW_POWER_XXX" */
+#endif
+
 /* structures */
 
 /*
@@ -339,11 +339,11 @@ struct usb2_xfer_flags_int {
  */
 struct usb2_config_sub {
 	usb2_callback_t *callback;	/* USB transfer callback */
-	uint32_t bufsize;		/* total pipe buffer size in bytes */
-	uint32_t frames;		/* maximum number of USB frames */
-	uint16_t interval;		/* interval in milliseconds */
+	usb2_frlength_t bufsize;	/* total pipe buffer size in bytes */
+	usb2_frcount_t frames;		/* maximum number of USB frames */
+	usb2_timeout_t interval;	/* interval in milliseconds */
 #define	USB_DEFAULT_INTERVAL	0
-	uint16_t timeout;		/* transfer timeout in milliseconds */
+	usb2_timeout_t timeout;		/* transfer timeout in milliseconds */
 	struct usb2_xfer_flags flags;	/* transfer flags */
 };
 
@@ -382,29 +382,29 @@ struct usb2_xfer {
 	void   *priv_sc;		/* device driver data pointer 1 */
 	void   *priv_fifo;		/* device driver data pointer 2 */
 	void   *local_buffer;
-	uint32_t *frlengths;
+	usb2_frlength_t *frlengths;
 	struct usb2_page_cache *frbuffers;
 	usb2_callback_t *callback;
 
-	uint32_t max_usb2_frame_size;
-	uint32_t max_data_length;
-	uint32_t sumlen;		/* sum of all lengths in bytes */
-	uint32_t actlen;		/* actual length in bytes */
-	uint32_t timeout;		/* milliseconds */
+	usb2_frlength_t max_hc_frame_size;
+	usb2_frlength_t max_data_length;
+	usb2_frlength_t sumlen;		/* sum of all lengths in bytes */
+	usb2_frlength_t actlen;		/* actual length in bytes */
+	usb2_timeout_t timeout;		/* milliseconds */
 #define	USB_NO_TIMEOUT 0
 #define	USB_DEFAULT_TIMEOUT 5000	/* 5000 ms = 5 seconds */
 
-	uint32_t max_frame_count;	/* initial value of "nframes" after
+	usb2_frcount_t max_frame_count;	/* initial value of "nframes" after
 					 * setup */
-	uint32_t nframes;		/* number of USB frames to transfer */
-	uint32_t aframes;		/* actual number of USB frames
+	usb2_frcount_t nframes;		/* number of USB frames to transfer */
+	usb2_frcount_t aframes;		/* actual number of USB frames
 					 * transferred */
 
 	uint16_t max_packet_size;
 	uint16_t max_frame_size;
 	uint16_t qh_pos;
 	uint16_t isoc_time_complete;	/* in ms */
-	uint16_t interval;		/* milliseconds */
+	usb2_timeout_t interval;	/* milliseconds */
 
 	uint8_t	address;		/* physical USB address */
 	uint8_t	endpoint;		/* physical USB endpoint */
@@ -489,9 +489,9 @@ usb2_error_t usb2_transfer_setup(struct 
 	    const struct usb2_config *setup_start, uint16_t n_setup,
 	    void *priv_sc, struct mtx *priv_mtx);
 void	usb2_set_frame_data(struct usb2_xfer *xfer, void *ptr,
-	    uint32_t frindex);
-void	usb2_set_frame_offset(struct usb2_xfer *xfer, uint32_t offset,
-	    uint32_t frindex);
+	    usb2_frcount_t frindex);
+void	usb2_set_frame_offset(struct usb2_xfer *xfer, usb2_frlength_t offset,
+	    usb2_frcount_t frindex);
 void	usb2_start_hardware(struct usb2_xfer *xfer);
 void	usb2_transfer_clear_stall(struct usb2_xfer *xfer);
 void	usb2_transfer_drain(struct usb2_xfer *xfer);

Modified: head/sys/dev/usb/usb_dev.c
==============================================================================
--- head/sys/dev/usb/usb_dev.c	Fri Mar 20 21:48:11 2009	(r190180)
+++ head/sys/dev/usb/usb_dev.c	Fri Mar 20 21:50:54 2009	(r190181)
@@ -1688,7 +1688,7 @@ usb2_fifo_attach(struct usb2_device *ude
  * Else failure
  *------------------------------------------------------------------------*/
 int
-usb2_fifo_alloc_buffer(struct usb2_fifo *f, uint32_t bufsize,
+usb2_fifo_alloc_buffer(struct usb2_fifo *f, usb2_size_t bufsize,
     uint16_t nbuf)
 {
 	usb2_fifo_free_buffer(f);
@@ -1753,11 +1753,11 @@ usb2_fifo_detach(struct usb2_fifo_sc *f_
 	DPRINTFN(2, "detached %p\n", f_sc);
 }
 
-uint32_t
+usb2_size_t
 usb2_fifo_put_bytes_max(struct usb2_fifo *f)
 {
 	struct usb2_mbuf *m;
-	uint32_t len;
+	usb2_size_t len;
 
 	USB_IF_POLL(&f->free_q, m);
 
@@ -1778,10 +1778,10 @@ usb2_fifo_put_bytes_max(struct usb2_fifo
  *------------------------------------------------------------------------*/
 void
 usb2_fifo_put_data(struct usb2_fifo *f, struct usb2_page_cache *pc,
-    uint32_t offset, uint32_t len, uint8_t what)
+    usb2_frlength_t offset, usb2_frlength_t len, uint8_t what)
 {
 	struct usb2_mbuf *m;
-	uint32_t io_len;
+	usb2_frlength_t io_len;
 
 	while (len || (what == 1)) {
 
@@ -1816,10 +1816,10 @@ usb2_fifo_put_data(struct usb2_fifo *f, 
 
 void
 usb2_fifo_put_data_linear(struct usb2_fifo *f, void *ptr,
-    uint32_t len, uint8_t what)
+    usb2_size_t len, uint8_t what)
 {
 	struct usb2_mbuf *m;
-	uint32_t io_len;
+	usb2_size_t io_len;
 
 	while (len || (what == 1)) {
 
@@ -1853,7 +1853,7 @@ usb2_fifo_put_data_linear(struct usb2_fi
 }
 
 uint8_t
-usb2_fifo_put_data_buffer(struct usb2_fifo *f, void *ptr, uint32_t len)
+usb2_fifo_put_data_buffer(struct usb2_fifo *f, void *ptr, usb2_size_t len)
 {
 	struct usb2_mbuf *m;
 
@@ -1889,11 +1889,11 @@ usb2_fifo_put_data_error(struct usb2_fif
  *------------------------------------------------------------------------*/
 uint8_t
 usb2_fifo_get_data(struct usb2_fifo *f, struct usb2_page_cache *pc,
-    uint32_t offset, uint32_t len, uint32_t *actlen,
+    usb2_frlength_t offset, usb2_frlength_t len, usb2_frlength_t *actlen,
     uint8_t what)
 {
 	struct usb2_mbuf *m;
-	uint32_t io_len;
+	usb2_frlength_t io_len;
 	uint8_t tr_data = 0;
 
 	actlen[0] = 0;
@@ -1955,10 +1955,10 @@ usb2_fifo_get_data(struct usb2_fifo *f, 
 
 uint8_t
 usb2_fifo_get_data_linear(struct usb2_fifo *f, void *ptr,
-    uint32_t len, uint32_t *actlen, uint8_t what)
+    usb2_size_t len, usb2_size_t *actlen, uint8_t what)
 {
 	struct usb2_mbuf *m;
-	uint32_t io_len;
+	usb2_size_t io_len;
 	uint8_t tr_data = 0;
 
 	actlen[0] = 0;
@@ -2019,7 +2019,7 @@ usb2_fifo_get_data_linear(struct usb2_fi
 }
 
 uint8_t
-usb2_fifo_get_data_buffer(struct usb2_fifo *f, void **pptr, uint32_t *plen)
+usb2_fifo_get_data_buffer(struct usb2_fifo *f, void **pptr, usb2_size_t *plen)
 {
 	struct usb2_mbuf *m;
 

Modified: head/sys/dev/usb/usb_dev.h
==============================================================================
--- head/sys/dev/usb/usb_dev.h	Fri Mar 20 21:48:11 2009	(r190180)
+++ head/sys/dev/usb/usb_dev.h	Fri Mar 20 21:50:54 2009	(r190181)
@@ -135,9 +135,9 @@ struct usb2_fifo {
 	void   *priv_sc0;		/* client data */
 	void   *priv_sc1;		/* client data */
 	void   *queue_data;
-	uint32_t timeout;		/* timeout in milliseconds */
-	uint32_t bufsize;		/* BULK and INTERRUPT buffer size */
-	uint16_t nframes;		/* for isochronous mode */
+	usb2_timeout_t timeout;		/* timeout in milliseconds */
+	usb2_frlength_t bufsize;		/* BULK and INTERRUPT buffer size */
+	usb2_frcount_t nframes;		/* for isochronous mode */
 	uint16_t dev_ep_index;		/* our device endpoint index */
 	uint8_t	flag_sleeping;		/* set if FIFO is sleeping */
 	uint8_t	flag_iscomplete;	/* set if a USB transfer is complete */
@@ -175,17 +175,18 @@ int	usb2_fifo_attach(struct usb2_device 
 void	usb2_fifo_detach(struct usb2_fifo_sc *f_sc);
 uint32_t usb2_fifo_put_bytes_max(struct usb2_fifo *fifo);
 void	usb2_fifo_put_data(struct usb2_fifo *fifo, struct usb2_page_cache *pc,
-	    uint32_t offset, uint32_t len, uint8_t what);
+	    usb2_frlength_t offset, usb2_frlength_t len, uint8_t what);
 void	usb2_fifo_put_data_linear(struct usb2_fifo *fifo, void *ptr,
-	    uint32_t len, uint8_t what);
-uint8_t	usb2_fifo_put_data_buffer(struct usb2_fifo *f, void *ptr, uint32_t len);
+	    usb2_size_t len, uint8_t what);
+uint8_t	usb2_fifo_put_data_buffer(struct usb2_fifo *f, void *ptr, usb2_size_t len);
 void	usb2_fifo_put_data_error(struct usb2_fifo *fifo);
 uint8_t	usb2_fifo_get_data(struct usb2_fifo *fifo, struct usb2_page_cache *pc,
-	    uint32_t offset, uint32_t len, uint32_t *actlen, uint8_t what);
+	    usb2_frlength_t offset, usb2_frlength_t len, usb2_frlength_t *actlen,
+	    uint8_t what);
 uint8_t	usb2_fifo_get_data_linear(struct usb2_fifo *fifo, void *ptr,
-	    uint32_t len, uint32_t *actlen, uint8_t what);
+	    usb2_size_t len, usb2_size_t *actlen, uint8_t what);
 uint8_t	usb2_fifo_get_data_buffer(struct usb2_fifo *f, void **pptr,
-	    uint32_t *plen);
+	    usb2_size_t *plen);

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

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 20 21:51:28 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 26A38106567D;
	Fri, 20 Mar 2009 21:51:28 +0000 (UTC)
	(envelope-from ivoras@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1593F8FC1E;
	Fri, 20 Mar 2009 21:51:28 +0000 (UTC)
	(envelope-from ivoras@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2KLpRiH014703;
	Fri, 20 Mar 2009 21:51:27 GMT (envelope-from ivoras@svn.freebsd.org)
Received: (from ivoras@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2KLpRMB014702;
	Fri, 20 Mar 2009 21:51:27 GMT (envelope-from ivoras@svn.freebsd.org)
Message-Id: <200903202151.n2KLpRMB014702@svn.freebsd.org>
From: Ivan Voras 
Date: Fri, 20 Mar 2009 21:51: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: r190182 - 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: Fri, 20 Mar 2009 21:51:28 -0000

Author: ivoras
Date: Fri Mar 20 21:51:27 2009
New Revision: 190182
URL: http://svn.freebsd.org/changeset/base/190182

Log:
  Note that GEOM_PART is on by default in 8-CURRENT and how it's different
  from older slices.
  
  OKed by:	marcel
  Approved by:	gnn (mentor)

Modified:
  head/UPDATING

Modified: head/UPDATING
==============================================================================
--- head/UPDATING	Fri Mar 20 21:50:54 2009	(r190181)
+++ head/UPDATING	Fri Mar 20 21:51:27 2009	(r190182)
@@ -22,6 +22,15 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8.
 	to maximize performance.  (To disable malloc debugging, run
 	ln -s aj /etc/malloc.conf.)
 
+20090320:
+	GEOM_PART has become the default partition slicer for storage devices,
+	replacing GEOM_MBR, GEOM_BSD, GEOM_PC98 and GEOM_GPT slicers. It
+	introduces some changes: the devices created from MSDOS extended
+	partition entries (EBR) can be named differently than with GEOM_MBR
+	and are now symlinks to	devices with offset-based names, and kernel
+	dumps are now not allowed to be written to devices whose partition
+	types indicate they are meant to be used for file systems.
+
 20090319:
 	The uscanner(4) driver has been removed from the kernel. This follows
 	Linux removing theirs in 2.6 and making libusb the default interface

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 20 21:57:55 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 50CCD106566B;
	Fri, 20 Mar 2009 21:57:55 +0000 (UTC)
	(envelope-from thompsa@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 3DA258FC0C;
	Fri, 20 Mar 2009 21:57:55 +0000 (UTC)
	(envelope-from thompsa@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2KLvtht014897;
	Fri, 20 Mar 2009 21:57:55 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2KLvsdj014880;
	Fri, 20 Mar 2009 21:57:54 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <200903202157.n2KLvsdj014880@svn.freebsd.org>
From: Andrew Thompson 
Date: Fri, 20 Mar 2009 21:57: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: r190183 - 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: Fri, 20 Mar 2009 21:57:55 -0000

Author: thompsa
Date: Fri Mar 20 21:57:54 2009
New Revision: 190183
URL: http://svn.freebsd.org/changeset/base/190183

Log:
  MFp4 //depot/projects/usb @159479,159502,159516,159522,159529
  
  Workaround for buggy USB hardware not handling new SETUP packet before STATUS
  stage is complete, this allows xfers to endpoint0 to return a short frame.
  
  Submitted by:	Hans Petter Selasky
  Reported by:	me

Modified:
  head/sys/dev/usb/controller/at91dci.c
  head/sys/dev/usb/controller/at91dci_atmelarm.c
  head/sys/dev/usb/controller/atmegadci.c
  head/sys/dev/usb/controller/atmegadci_atmelarm.c
  head/sys/dev/usb/controller/ehci.c
  head/sys/dev/usb/controller/ehci_ixp4xx.c
  head/sys/dev/usb/controller/ehci_mbus.c
  head/sys/dev/usb/controller/ehci_pci.c
  head/sys/dev/usb/controller/musb_otg.c
  head/sys/dev/usb/controller/musb_otg_atmelarm.c
  head/sys/dev/usb/controller/ohci.c
  head/sys/dev/usb/controller/ohci_atmelarm.c
  head/sys/dev/usb/controller/ohci_pci.c
  head/sys/dev/usb/controller/uhci.c
  head/sys/dev/usb/controller/uhci_pci.c
  head/sys/dev/usb/controller/uss820dci.c
  head/sys/dev/usb/controller/uss820dci_atmelarm.c

Modified: head/sys/dev/usb/controller/at91dci.c
==============================================================================
--- head/sys/dev/usb/controller/at91dci.c	Fri Mar 20 21:51:27 2009	(r190182)
+++ head/sys/dev/usb/controller/at91dci.c	Fri Mar 20 21:57:54 2009	(r190183)
@@ -887,8 +887,8 @@ at91dci_setup_standard_chain(struct usb2
 
 	temp.td = NULL;
 	temp.td_next = xfer->td_start[0];
-	temp.setup_alt_next = xfer->flags_int.short_frames_ok;
 	temp.offset = 0;
+	temp.setup_alt_next = xfer->flags_int.short_frames_ok;
 
 	sc = AT9100_DCI_BUS2SC(xfer->xroot->bus);
 	ep_no = (xfer->endpoint & UE_ADDR);
@@ -902,6 +902,12 @@ at91dci_setup_standard_chain(struct usb2
 			temp.len = xfer->frlengths[0];
 			temp.pc = xfer->frbuffers + 0;
 			temp.short_pkt = temp.len ? 1 : 0;
+			/* check for last frame */
+			if (xfer->nframes == 1) {
+				/* no STATUS stage yet, SETUP is last */
+				if (xfer->flags_int.control_act)
+					temp.setup_alt_next = 0;
+			}
 
 			at91dci_setup_standard_chain_sub(&temp);
 		}
@@ -933,7 +939,13 @@ at91dci_setup_standard_chain(struct usb2
 		x++;
 
 		if (x == xfer->nframes) {
-			temp.setup_alt_next = 0;
+			if (xfer->flags_int.control_xfr) {
+				if (xfer->flags_int.control_act) {
+					temp.setup_alt_next = 0;
+				}
+			} else {
+				temp.setup_alt_next = 0;
+			}
 		}
 		if (temp.len == 0) {
 
@@ -958,47 +970,46 @@ at91dci_setup_standard_chain(struct usb2
 		}
 	}
 
-	/* always setup a valid "pc" pointer for status and sync */
-	temp.pc = xfer->frbuffers + 0;
-
-	/* check if we need to sync */
-	if (need_sync && xfer->flags_int.control_xfr) {
-
-		/* we need a SYNC point after TX */
-		temp.func = &at91dci_data_tx_sync;
-		temp.len = 0;
-		temp.short_pkt = 0;
-
-		at91dci_setup_standard_chain_sub(&temp);
-	}
-	/* check if we should append a status stage */
-	if (xfer->flags_int.control_xfr &&
-	    !xfer->flags_int.control_act) {
+	/* check for control transfer */
+	if (xfer->flags_int.control_xfr) {
 
-		/*
-		 * Send a DATA1 message and invert the current
-		 * endpoint direction.
-		 */
-		if (xfer->endpoint & UE_DIR_IN) {
-			temp.func = &at91dci_data_rx;
-			need_sync = 0;
-		} else {
-			temp.func = &at91dci_data_tx;
-			need_sync = 1;
-		}
+		/* always setup a valid "pc" pointer for status and sync */
+		temp.pc = xfer->frbuffers + 0;
 		temp.len = 0;
 		temp.short_pkt = 0;
+		temp.setup_alt_next = 0;
 
-		at91dci_setup_standard_chain_sub(&temp);
+		/* check if we need to sync */
 		if (need_sync) {
 			/* we need a SYNC point after TX */
 			temp.func = &at91dci_data_tx_sync;
-			temp.len = 0;
-			temp.short_pkt = 0;
+			at91dci_setup_standard_chain_sub(&temp);
+		}
+
+		/* check if we should append a status stage */
+		if (!xfer->flags_int.control_act) {
+
+			/*
+			 * Send a DATA1 message and invert the current
+			 * endpoint direction.
+			 */
+			if (xfer->endpoint & UE_DIR_IN) {
+				temp.func = &at91dci_data_rx;
+				need_sync = 0;
+			} else {
+				temp.func = &at91dci_data_tx;
+				need_sync = 1;
+			}
 
 			at91dci_setup_standard_chain_sub(&temp);
+			if (need_sync) {
+				/* we need a SYNC point after TX */
+				temp.func = &at91dci_data_tx_sync;
+				at91dci_setup_standard_chain_sub(&temp);
+			}
 		}
 	}
+
 	/* must have at least one frame! */
 	td = temp.td;
 	xfer->td_transfer_last = td;

Modified: head/sys/dev/usb/controller/at91dci_atmelarm.c
==============================================================================
--- head/sys/dev/usb/controller/at91dci_atmelarm.c	Fri Mar 20 21:51:27 2009	(r190182)
+++ head/sys/dev/usb/controller/at91dci_atmelarm.c	Fri Mar 20 21:57:54 2009	(r190183)
@@ -204,10 +204,10 @@ at91_udp_attach(device_t dev)
 
 #if (__FreeBSD_version >= 700031)
 	err = bus_setup_intr(dev, sc->sc_dci.sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE,
-	    NULL, (void *)at91dci_interrupt, sc, &sc->sc_dci.sc_intr_hdl);
+	    NULL, (driver_intr_t *)at91dci_interrupt, sc, &sc->sc_dci.sc_intr_hdl);
 #else
 	err = bus_setup_intr(dev, sc->sc_dci.sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE,
-	    (void *)at91dci_interrupt, sc, &sc->sc_dci.sc_intr_hdl);
+	    (driver_intr_t *)at91dci_interrupt, sc, &sc->sc_dci.sc_intr_hdl);
 #endif
 	if (err) {
 		sc->sc_dci.sc_intr_hdl = NULL;
@@ -215,10 +215,10 @@ at91_udp_attach(device_t dev)
 	}
 #if (__FreeBSD_version >= 700031)
 	err = bus_setup_intr(dev, sc->sc_vbus_irq_res, INTR_TYPE_BIO | INTR_MPSAFE,
-	    NULL, (void *)at91_vbus_poll, sc, &sc->sc_vbus_intr_hdl);
+	    NULL, (driver_intr_t *)at91_vbus_poll, sc, &sc->sc_vbus_intr_hdl);
 #else
 	err = bus_setup_intr(dev, sc->sc_vbus_irq_res, INTR_TYPE_BIO | INTR_MPSAFE,
-	    (void *)at91_vbus_poll, sc, &sc->sc_vbus_intr_hdl);
+	    (driver_intr_t *)at91_vbus_poll, sc, &sc->sc_vbus_intr_hdl);
 #endif
 	if (err) {
 		sc->sc_vbus_intr_hdl = NULL;

Modified: head/sys/dev/usb/controller/atmegadci.c
==============================================================================
--- head/sys/dev/usb/controller/atmegadci.c	Fri Mar 20 21:51:27 2009	(r190182)
+++ head/sys/dev/usb/controller/atmegadci.c	Fri Mar 20 21:57:54 2009	(r190183)
@@ -791,8 +791,8 @@ atmegadci_setup_standard_chain(struct us
 
 	temp.td = NULL;
 	temp.td_next = xfer->td_start[0];
-	temp.setup_alt_next = xfer->flags_int.short_frames_ok;
 	temp.offset = 0;
+	temp.setup_alt_next = xfer->flags_int.short_frames_ok;
 
 	sc = ATMEGA_BUS2SC(xfer->xroot->bus);
 	ep_no = (xfer->endpoint & UE_ADDR);
@@ -806,6 +806,12 @@ atmegadci_setup_standard_chain(struct us
 			temp.len = xfer->frlengths[0];
 			temp.pc = xfer->frbuffers + 0;
 			temp.short_pkt = temp.len ? 1 : 0;
+			/* check for last frame */
+			if (xfer->nframes == 1) {
+				/* no STATUS stage yet, SETUP is last */
+				if (xfer->flags_int.control_act)
+					temp.setup_alt_next = 0;
+			}
 
 			atmegadci_setup_standard_chain_sub(&temp);
 		}
@@ -837,7 +843,13 @@ atmegadci_setup_standard_chain(struct us
 		x++;
 
 		if (x == xfer->nframes) {
-			temp.setup_alt_next = 0;
+			if (xfer->flags_int.control_xfr) {
+				if (xfer->flags_int.control_act) {
+					temp.setup_alt_next = 0;
+				}
+			} else {
+				temp.setup_alt_next = 0;
+			}
 		}
 		if (temp.len == 0) {
 
@@ -862,45 +874,42 @@ atmegadci_setup_standard_chain(struct us
 		}
 	}
 
-	/* always setup a valid "pc" pointer for status and sync */
-	temp.pc = xfer->frbuffers + 0;
-
-	/* check if we need to sync */
-	if (need_sync && xfer->flags_int.control_xfr) {
+	if (xfer->flags_int.control_xfr) {
 
-		/* we need a SYNC point after TX */
-		temp.func = &atmegadci_data_tx_sync;
+		/* always setup a valid "pc" pointer for status and sync */
+		temp.pc = xfer->frbuffers + 0;
 		temp.len = 0;
 		temp.short_pkt = 0;
+		temp.setup_alt_next = 0;
 
-		atmegadci_setup_standard_chain_sub(&temp);
-	}
-	/* check if we should append a status stage */
-	if (xfer->flags_int.control_xfr &&
-	    !xfer->flags_int.control_act) {
-
-		/*
-		 * Send a DATA1 message and invert the current
-		 * endpoint direction.
-		 */
-		if (xfer->endpoint & UE_DIR_IN) {
-			temp.func = &atmegadci_data_rx;
-			need_sync = 0;
-		} else {
-			temp.func = &atmegadci_data_tx;
-			need_sync = 1;
-		}
-		temp.len = 0;
-		temp.short_pkt = 0;
-
-		atmegadci_setup_standard_chain_sub(&temp);
+		/* check if we need to sync */
 		if (need_sync) {
 			/* we need a SYNC point after TX */
 			temp.func = &atmegadci_data_tx_sync;
-			temp.len = 0;
-			temp.short_pkt = 0;
+			atmegadci_setup_standard_chain_sub(&temp);
+		}
+
+		/* check if we should append a status stage */
+		if (!xfer->flags_int.control_act) {
+
+			/*
+			 * Send a DATA1 message and invert the current
+			 * endpoint direction.
+			 */
+			if (xfer->endpoint & UE_DIR_IN) {
+				temp.func = &atmegadci_data_rx;
+				need_sync = 0;
+			} else {
+				temp.func = &atmegadci_data_tx;
+				need_sync = 1;
+			}
 
 			atmegadci_setup_standard_chain_sub(&temp);
+			if (need_sync) {
+				/* we need a SYNC point after TX */
+				temp.func = &atmegadci_data_tx_sync;
+				atmegadci_setup_standard_chain_sub(&temp);
+			}
 		}
 	}
 	/* must have at least one frame! */

Modified: head/sys/dev/usb/controller/atmegadci_atmelarm.c
==============================================================================
--- head/sys/dev/usb/controller/atmegadci_atmelarm.c	Fri Mar 20 21:51:27 2009	(r190182)
+++ head/sys/dev/usb/controller/atmegadci_atmelarm.c	Fri Mar 20 21:57:54 2009	(r190183)
@@ -113,7 +113,7 @@ atmegadci_attach(device_t dev)
 	device_set_ivars(sc->sc_otg.sc_bus.bdev, &sc->sc_otg.sc_bus);
 
 	err = bus_setup_intr(dev, sc->sc_otg.sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE,
-	    NULL, (void *)atmegadci_interrupt, sc, &sc->sc_otg.sc_intr_hdl);
+	    NULL, (driver_intr_t *)atmegadci_interrupt, sc, &sc->sc_otg.sc_intr_hdl);
 	if (err) {
 		sc->sc_otg.sc_intr_hdl = NULL;
 		goto error;

Modified: head/sys/dev/usb/controller/ehci.c
==============================================================================
--- head/sys/dev/usb/controller/ehci.c	Fri Mar 20 21:51:27 2009	(r190182)
+++ head/sys/dev/usb/controller/ehci.c	Fri Mar 20 21:57:54 2009	(r190183)
@@ -117,7 +117,7 @@ struct ehci_std_temp {
 	uint8_t	shortpkt;
 	uint8_t	auto_data_toggle;
 	uint8_t	setup_alt_next;
-	uint8_t	short_frames_ok;
+	uint8_t	last_frame;
 };
 
 void
@@ -1546,10 +1546,12 @@ ehci_setup_standard_chain_sub(struct ehc
 	uint32_t buf_offset;
 	uint32_t average;
 	uint32_t len_old;
+	uint32_t terminate;
 	uint8_t shortpkt_old;
 	uint8_t precompute;
 
-	qtd_altnext = htohc32(temp->sc, EHCI_LINK_TERMINATE);
+	terminate = htohc32(temp->sc, EHCI_LINK_TERMINATE);
+	qtd_altnext = terminate;
 	td_alt_next = NULL;
 	buf_offset = 0;
 	shortpkt_old = temp->shortpkt;
@@ -1696,14 +1698,17 @@ restart:
 		precompute = 0;
 
 		/* setup alt next pointer, if any */
-		if (temp->short_frames_ok) {
-			if (temp->setup_alt_next) {
-				td_alt_next = td_next;
-				qtd_altnext = td_next->qtd_self;
-			}
+		if (temp->last_frame) {
+			td_alt_next = NULL;
+			qtd_altnext = terminate;
 		} else {
 			/* we use this field internally */
 			td_alt_next = td_next;
+			if (temp->setup_alt_next) {
+				qtd_altnext = td_next->qtd_self;
+			} else {
+				qtd_altnext = terminate;
+			}
 		}
 
 		/* restore */
@@ -1746,8 +1751,8 @@ ehci_setup_standard_chain(struct usb2_xf
 	temp.td = NULL;
 	temp.td_next = td;
 	temp.qtd_status = 0;
+	temp.last_frame = 0;
 	temp.setup_alt_next = xfer->flags_int.short_frames_ok;
-	temp.short_frames_ok = xfer->flags_int.short_frames_ok;
 
 	if (xfer->flags_int.control_xfr) {
 		if (xfer->pipe->toggle_next) {
@@ -1780,7 +1785,14 @@ ehci_setup_standard_chain(struct usb2_xf
 			temp.len = xfer->frlengths[0];
 			temp.pc = xfer->frbuffers + 0;
 			temp.shortpkt = temp.len ? 1 : 0;
-
+			/* check for last frame */
+			if (xfer->nframes == 1) {
+				/* no STATUS stage yet, SETUP is last */
+				if (xfer->flags_int.control_act) {
+					temp.last_frame = 1;
+					temp.setup_alt_next = 0;
+				}
+			}
 			ehci_setup_standard_chain_sub(&temp);
 		}
 		x = 1;
@@ -1798,7 +1810,16 @@ ehci_setup_standard_chain(struct usb2_xf
 		x++;
 
 		if (x == xfer->nframes) {
-			temp.setup_alt_next = 0;
+			if (xfer->flags_int.control_xfr) {
+				/* no STATUS stage yet, DATA is last */
+				if (xfer->flags_int.control_act) {
+					temp.last_frame = 1;
+					temp.setup_alt_next = 0;
+				}
+			} else {
+				temp.last_frame = 1;
+				temp.setup_alt_next = 0;
+			}
 		}
 		/* keep previous data toggle and error count */
 
@@ -1855,6 +1876,8 @@ ehci_setup_standard_chain(struct usb2_xf
 		temp.len = 0;
 		temp.pc = NULL;
 		temp.shortpkt = 0;
+		temp.last_frame = 1;
+		temp.setup_alt_next = 0;
 
 		ehci_setup_standard_chain_sub(&temp);
 	}

Modified: head/sys/dev/usb/controller/ehci_ixp4xx.c
==============================================================================
--- head/sys/dev/usb/controller/ehci_ixp4xx.c	Fri Mar 20 21:51:27 2009	(r190182)
+++ head/sys/dev/usb/controller/ehci_ixp4xx.c	Fri Mar 20 21:57:54 2009	(r190183)
@@ -189,7 +189,7 @@ ehci_ixp_attach(device_t self)
 
 
 	err = bus_setup_intr(self, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE,
-	    NULL, (void *)(void *)ehci_interrupt, sc, &sc->sc_intr_hdl);
+	    NULL, (driver_intr_t *)ehci_interrupt, sc, &sc->sc_intr_hdl);
 	if (err) {
 		device_printf(self, "Could not setup irq, %d\n", err);
 		sc->sc_intr_hdl = NULL;

Modified: head/sys/dev/usb/controller/ehci_mbus.c
==============================================================================
--- head/sys/dev/usb/controller/ehci_mbus.c	Fri Mar 20 21:51:27 2009	(r190182)
+++ head/sys/dev/usb/controller/ehci_mbus.c	Fri Mar 20 21:57:54 2009	(r190183)
@@ -210,7 +210,7 @@ ehci_mbus_attach(device_t self)
 	    MV_USB_DEVICE_UNDERFLOW);
 
 	err = bus_setup_intr(self, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE,
-	    NULL, (void *)(void *)ehci_interrupt, sc, &sc->sc_intr_hdl);
+	    NULL, (driver_intr_t *)ehci_interrupt, sc, &sc->sc_intr_hdl);
 	if (err) {
 		device_printf(self, "Could not setup irq, %d\n", err);
 		sc->sc_intr_hdl = NULL;

Modified: head/sys/dev/usb/controller/ehci_pci.c
==============================================================================
--- head/sys/dev/usb/controller/ehci_pci.c	Fri Mar 20 21:51:27 2009	(r190182)
+++ head/sys/dev/usb/controller/ehci_pci.c	Fri Mar 20 21:57:54 2009	(r190183)
@@ -338,10 +338,10 @@ ehci_pci_attach(device_t self)
 
 #if (__FreeBSD_version >= 700031)
 	err = bus_setup_intr(self, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE,
-	    NULL, (void *)(void *)ehci_interrupt, sc, &sc->sc_intr_hdl);
+	    NULL, (driver_intr_t *)ehci_interrupt, sc, &sc->sc_intr_hdl);
 #else
 	err = bus_setup_intr(self, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE,
-	    (void *)(void *)ehci_interrupt, sc, &sc->sc_intr_hdl);
+	    (driver_intr_t *)ehci_interrupt, sc, &sc->sc_intr_hdl);
 #endif
 	if (err) {
 		device_printf(self, "Could not setup irq, %d\n", err);

Modified: head/sys/dev/usb/controller/musb_otg.c
==============================================================================
--- head/sys/dev/usb/controller/musb_otg.c	Fri Mar 20 21:51:27 2009	(r190182)
+++ head/sys/dev/usb/controller/musb_otg.c	Fri Mar 20 21:57:54 2009	(r190183)
@@ -1132,8 +1132,8 @@ musbotg_setup_standard_chain(struct usb2
 
 	temp.td = NULL;
 	temp.td_next = xfer->td_start[0];
-	temp.setup_alt_next = xfer->flags_int.short_frames_ok;
 	temp.offset = 0;
+	temp.setup_alt_next = xfer->flags_int.short_frames_ok;
 
 	sc = MUSBOTG_BUS2SC(xfer->xroot->bus);
 	ep_no = (xfer->endpoint & UE_ADDR);
@@ -1180,7 +1180,13 @@ musbotg_setup_standard_chain(struct usb2
 		x++;
 
 		if (x == xfer->nframes) {
-			temp.setup_alt_next = 0;
+			if (xfer->flags_int.control_xfr) {
+				if (xfer->flags_int.control_act) {
+					temp.setup_alt_next = 0;
+				}
+			} else {
+				temp.setup_alt_next = 0;
+			}
 		}
 		if (temp.len == 0) {
 
@@ -1205,23 +1211,24 @@ musbotg_setup_standard_chain(struct usb2
 		}
 	}
 
-	/* always setup a valid "pc" pointer for status and sync */
-	temp.pc = xfer->frbuffers + 0;
-
-	/* check if we should append a status stage */
-
-	if (xfer->flags_int.control_xfr &&
-	    !xfer->flags_int.control_act) {
+	/* check for control transfer */
+	if (xfer->flags_int.control_xfr) {
 
-		/*
-		 * Send a DATA1 message and invert the current
-		 * endpoint direction.
-		 */
-		temp.func = &musbotg_setup_status;
+		/* always setup a valid "pc" pointer for status and sync */
+		temp.pc = xfer->frbuffers + 0;
 		temp.len = 0;
 		temp.short_pkt = 0;
+		temp.setup_alt_next = 0;
 
-		musbotg_setup_standard_chain_sub(&temp);
+		/* check if we should append a status stage */
+		if (!xfer->flags_int.control_act) {
+			/*
+			 * Send a DATA1 message and invert the current
+			 * endpoint direction.
+			 */
+			temp.func = &musbotg_setup_status;
+			musbotg_setup_standard_chain_sub(&temp);
+		}
 	}
 	/* must have at least one frame! */
 	td = temp.td;

Modified: head/sys/dev/usb/controller/musb_otg_atmelarm.c
==============================================================================
--- head/sys/dev/usb/controller/musb_otg_atmelarm.c	Fri Mar 20 21:51:27 2009	(r190182)
+++ head/sys/dev/usb/controller/musb_otg_atmelarm.c	Fri Mar 20 21:57:54 2009	(r190183)
@@ -130,10 +130,10 @@ musbotg_attach(device_t dev)
 
 #if (__FreeBSD_version >= 700031)
 	err = bus_setup_intr(dev, sc->sc_otg.sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE,
-	    NULL, (void *)musbotg_interrupt, sc, &sc->sc_otg.sc_intr_hdl);
+	    NULL, (driver_intr_t *)musbotg_interrupt, sc, &sc->sc_otg.sc_intr_hdl);
 #else
 	err = bus_setup_intr(dev, sc->sc_otg.sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE,
-	    (void *)musbotg_interrupt, sc, &sc->sc_otg.sc_intr_hdl);
+	    (driver_intr_t *)musbotg_interrupt, sc, &sc->sc_otg.sc_intr_hdl);
 #endif
 	if (err) {
 		sc->sc_otg.sc_intr_hdl = NULL;

Modified: head/sys/dev/usb/controller/ohci.c
==============================================================================
--- head/sys/dev/usb/controller/ohci.c	Fri Mar 20 21:51:27 2009	(r190182)
+++ head/sys/dev/usb/controller/ohci.c	Fri Mar 20 21:57:54 2009	(r190183)
@@ -115,7 +115,7 @@ struct ohci_std_temp {
 	uint16_t max_frame_size;
 	uint8_t	shortpkt;
 	uint8_t	setup_alt_next;
-	uint8_t	short_frames_ok;
+	uint8_t last_frame;
 };
 
 static struct ohci_hcca *
@@ -1020,6 +1020,23 @@ ohci_check_transfer_sub(struct usb2_xfer
 		usb2_pc_cpu_flush(ed->page_cache);
 
 		DPRINTFN(13, "xfer=%p following alt next\n", xfer);
+
+		/*
+		 * Make sure that the OHCI re-scans the schedule by
+		 * writing the BLF and CLF bits:
+		 */
+
+		if (xfer->xroot->udev->pwr_save.suspended) {
+			/* nothing to do */
+		} else if (xfer->pipe->methods == &ohci_device_bulk_methods) {
+			ohci_softc_t *sc = OHCI_BUS2SC(xfer->xroot->bus);
+
+			OWRITE4(sc, OHCI_COMMAND_STATUS, OHCI_BLF);
+		} else if (xfer->pipe->methods == &ohci_device_ctrl_methods) {
+			ohci_softc_t *sc = OHCI_BUS2SC(xfer->xroot->bus);
+
+			OWRITE4(sc, OHCI_COMMAND_STATUS, OHCI_CLF);
+		}
 	}
 }
 
@@ -1034,7 +1051,6 @@ static uint8_t
 ohci_check_transfer(struct usb2_xfer *xfer)
 {
 	ohci_ed_t *ed;
-	uint32_t ed_flags;
 	uint32_t ed_headp;
 	uint32_t ed_tailp;
 
@@ -1043,12 +1059,10 @@ ohci_check_transfer(struct usb2_xfer *xf
 	ed = xfer->qh_start[xfer->flags_int.curr_dma_set];
 
 	usb2_pc_cpu_invalidate(ed->page_cache);
-	ed_flags = le32toh(ed->ed_flags);
 	ed_headp = le32toh(ed->ed_headp);
 	ed_tailp = le32toh(ed->ed_tailp);
 
-	if ((ed_flags & OHCI_ED_SKIP) ||
-	    (ed_headp & OHCI_HALTED) ||
+	if ((ed_headp & OHCI_HALTED) ||
 	    (((ed_headp ^ ed_tailp) & (~0xF)) == 0)) {
 		if (xfer->pipe->methods == &ohci_device_isoc_methods) {
 			/* isochronous transfer */
@@ -1379,10 +1393,9 @@ restart:
 		precompute = 0;
 
 		/* setup alt next pointer, if any */
-		if (temp->short_frames_ok) {
-			if (temp->setup_alt_next) {
-				td_alt_next = td_next;
-			}
+		if (temp->last_frame) {
+			/* no alternate next */
+			td_alt_next = NULL;
 		} else {
 			/* we use this field internally */
 			td_alt_next = td_next;
@@ -1425,8 +1438,8 @@ ohci_setup_standard_chain(struct usb2_xf
 
 	temp.td = NULL;
 	temp.td_next = td;
+	temp.last_frame = 0;
 	temp.setup_alt_next = xfer->flags_int.short_frames_ok;
-	temp.short_frames_ok = xfer->flags_int.short_frames_ok;
 
 	methods = xfer->pipe->methods;
 
@@ -1441,7 +1454,14 @@ ohci_setup_standard_chain(struct usb2_xf
 			temp.len = xfer->frlengths[0];
 			temp.pc = xfer->frbuffers + 0;
 			temp.shortpkt = temp.len ? 1 : 0;
-
+			/* check for last frame */
+			if (xfer->nframes == 1) {
+				/* no STATUS stage yet, SETUP is last */
+				if (xfer->flags_int.control_act) {
+					temp.last_frame = 1;
+					temp.setup_alt_next = 0;
+				}
+			}
 			ohci_setup_standard_chain_sub(&temp);
 
 			/*
@@ -1482,7 +1502,16 @@ ohci_setup_standard_chain(struct usb2_xf
 		x++;
 
 		if (x == xfer->nframes) {
-			temp.setup_alt_next = 0;
+			if (xfer->flags_int.control_xfr) {
+				/* no STATUS stage yet, DATA is last */
+				if (xfer->flags_int.control_act) {
+					temp.last_frame = 1;
+					temp.setup_alt_next = 0;
+				}
+			} else {
+				temp.last_frame = 1;
+				temp.setup_alt_next = 0;
+			}
 		}
 		if (temp.len == 0) {
 
@@ -1523,11 +1552,14 @@ ohci_setup_standard_chain(struct usb2_xf
 		temp.len = 0;
 		temp.pc = NULL;
 		temp.shortpkt = 0;
+		temp.last_frame = 1;
+		temp.setup_alt_next = 0;
 
 		ohci_setup_standard_chain_sub(&temp);
 	}
 	td = temp.td;
 
+	/* Ensure that last TD is terminating: */
 	td->td_next = htole32(OHCI_TD_NEXT_END);
 	td->td_flags &= ~htole32(OHCI_TD_INTR_MASK);
 	td->td_flags |= htole32(OHCI_TD_SET_DI(1));

Modified: head/sys/dev/usb/controller/ohci_atmelarm.c
==============================================================================
--- head/sys/dev/usb/controller/ohci_atmelarm.c	Fri Mar 20 21:51:27 2009	(r190182)
+++ head/sys/dev/usb/controller/ohci_atmelarm.c	Fri Mar 20 21:57:54 2009	(r190183)
@@ -111,10 +111,10 @@ ohci_atmelarm_attach(device_t dev)
 
 #if (__FreeBSD_version >= 700031)
 	err = bus_setup_intr(dev, sc->sc_ohci.sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE,
-	    NULL, (void *)ohci_interrupt, sc, &sc->sc_ohci.sc_intr_hdl);
+	    NULL, (driver_intr_t *)ohci_interrupt, sc, &sc->sc_ohci.sc_intr_hdl);
 #else
 	err = bus_setup_intr(dev, sc->sc_ohci.sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE,
-	    (void *)ohci_interrupt, sc, &sc->sc_ohci.sc_intr_hdl);
+	    (driver_intr_t *)ohci_interrupt, sc, &sc->sc_ohci.sc_intr_hdl);
 #endif
 	if (err) {
 		sc->sc_ohci.sc_intr_hdl = NULL;

Modified: head/sys/dev/usb/controller/ohci_pci.c
==============================================================================
--- head/sys/dev/usb/controller/ohci_pci.c	Fri Mar 20 21:51:27 2009	(r190182)
+++ head/sys/dev/usb/controller/ohci_pci.c	Fri Mar 20 21:57:54 2009	(r190183)
@@ -289,10 +289,10 @@ ohci_pci_attach(device_t self)
 
 #if (__FreeBSD_version >= 700031)
 	err = bus_setup_intr(self, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE,
-	    NULL, (void *)(void *)ohci_interrupt, sc, &sc->sc_intr_hdl);
+	    NULL, (driver_intr_t *)ohci_interrupt, sc, &sc->sc_intr_hdl);
 #else
 	err = bus_setup_intr(self, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE,
-	    (void *)(void *)ohci_interrupt, sc, &sc->sc_intr_hdl);
+	    (driver_intr_t *)ohci_interrupt, sc, &sc->sc_intr_hdl);
 #endif
 	if (err) {
 		device_printf(self, "Could not setup irq, %d\n", err);

Modified: head/sys/dev/usb/controller/uhci.c
==============================================================================
--- head/sys/dev/usb/controller/uhci.c	Fri Mar 20 21:51:27 2009	(r190182)
+++ head/sys/dev/usb/controller/uhci.c	Fri Mar 20 21:57:54 2009	(r190183)
@@ -124,7 +124,7 @@ struct uhci_std_temp {
 	uint16_t max_frame_size;
 	uint8_t	shortpkt;
 	uint8_t	setup_alt_next;
-	uint8_t	short_frames_ok;
+	uint8_t	last_frame;
 };
 
 extern struct usb2_bus_methods uhci_bus_methods;
@@ -1253,30 +1253,33 @@ uhci_check_transfer_sub(struct usb2_xfer
 	td_self = td->td_self;
 	td_alt_next = td->alt_next;
 
-	if ((td->td_token ^ td_token) & htole32(UHCI_TD_SET_DT(1))) {
+	if (xfer->flags_int.control_xfr)
+		goto skip;	/* don't touch the DT value! */
 
-		/*
-	         * The data toggle is wrong and
-	         * we need to switch it !
-	         */
+	if (!((td->td_token ^ td_token) & htole32(UHCI_TD_SET_DT(1))))
+		goto skip;	/* data toggle has correct value */
 
-		while (1) {
+	/*
+	 * The data toggle is wrong and we need to toggle it !
+	 */
+	while (1) {
 
-			td->td_token ^= htole32(UHCI_TD_SET_DT(1));
-			usb2_pc_cpu_flush(td->page_cache);
+		td->td_token ^= htole32(UHCI_TD_SET_DT(1));
+		usb2_pc_cpu_flush(td->page_cache);
 
-			if (td == xfer->td_transfer_last) {
-				/* last transfer */
-				break;
-			}
-			td = td->obj_next;
+		if (td == xfer->td_transfer_last) {
+			/* last transfer */
+			break;
+		}
+		td = td->obj_next;
 
-			if (td->alt_next != td_alt_next) {
-				/* next frame */
-				break;
-			}
+		if (td->alt_next != td_alt_next) {
+			/* next frame */
+			break;
 		}
 	}
+skip:
+
 	/* update the QH */
 	qh->qh_e_next = td_self;
 	usb2_pc_cpu_flush(qh->page_cache);
@@ -1631,10 +1634,8 @@ restart:
 		precompute = 0;
 
 		/* setup alt next pointer, if any */
-		if (temp->short_frames_ok) {
-			if (temp->setup_alt_next) {
-				td_alt_next = td_next;
-			}
+		if (temp->last_frame) {
+			td_alt_next = NULL;
 		} else {
 			/* we use this field internally */
 			td_alt_next = td_next;
@@ -1673,8 +1674,8 @@ uhci_setup_standard_chain(struct usb2_xf
 
 	temp.td = NULL;
 	temp.td_next = td;
+	temp.last_frame = 0;
 	temp.setup_alt_next = xfer->flags_int.short_frames_ok;
-	temp.short_frames_ok = xfer->flags_int.short_frames_ok;
 
 	uhci_mem_layout_init(&temp.ml, xfer);
 
@@ -1707,7 +1708,14 @@ uhci_setup_standard_chain(struct usb2_xf
 			temp.len = xfer->frlengths[0];
 			temp.ml.buf_pc = xfer->frbuffers + 0;
 			temp.shortpkt = temp.len ? 1 : 0;
-
+			/* check for last frame */
+			if (xfer->nframes == 1) {
+				/* no STATUS stage yet, SETUP is last */
+				if (xfer->flags_int.control_act) {
+					temp.last_frame = 1;
+					temp.setup_alt_next = 0;
+				}
+			}
 			uhci_setup_standard_chain_sub(&temp);
 		}
 		x = 1;
@@ -1725,7 +1733,16 @@ uhci_setup_standard_chain(struct usb2_xf
 		x++;
 
 		if (x == xfer->nframes) {
-			temp.setup_alt_next = 0;
+			if (xfer->flags_int.control_xfr) {
+				/* no STATUS stage yet, DATA is last */
+				if (xfer->flags_int.control_act) {
+					temp.last_frame = 1;
+					temp.setup_alt_next = 0;
+				}
+			} else {
+				temp.last_frame = 1;
+				temp.setup_alt_next = 0;
+			}
 		}
 		/*
 		 * Keep previous data toggle,
@@ -1780,11 +1797,14 @@ uhci_setup_standard_chain(struct usb2_xf
 		temp.len = 0;
 		temp.ml.buf_pc = NULL;
 		temp.shortpkt = 0;
+		temp.last_frame = 1;
+		temp.setup_alt_next = 0;
 
 		uhci_setup_standard_chain_sub(&temp);
 	}
 	td = temp.td;
 
+	/* Ensure that last TD is terminating: */
 	td->td_next = htole32(UHCI_PTR_T);
 
 	/* set interrupt bit */

Modified: head/sys/dev/usb/controller/uhci_pci.c
==============================================================================
--- head/sys/dev/usb/controller/uhci_pci.c	Fri Mar 20 21:51:27 2009	(r190182)
+++ head/sys/dev/usb/controller/uhci_pci.c	Fri Mar 20 21:57:54 2009	(r190183)
@@ -323,10 +323,10 @@ uhci_pci_attach(device_t self)
 
 #if (__FreeBSD_version >= 700031)
 	err = bus_setup_intr(self, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE,
-	    NULL, (void *)(void *)uhci_interrupt, sc, &sc->sc_intr_hdl);
+	    NULL, (driver_intr_t *)uhci_interrupt, sc, &sc->sc_intr_hdl);
 #else
 	err = bus_setup_intr(self, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE,
-	    (void *)(void *)uhci_interrupt, sc, &sc->sc_intr_hdl);
+	    (driver_intr_t *)uhci_interrupt, sc, &sc->sc_intr_hdl);
 #endif
 
 	if (err) {

Modified: head/sys/dev/usb/controller/uss820dci.c
==============================================================================
--- head/sys/dev/usb/controller/uss820dci.c	Fri Mar 20 21:51:27 2009	(r190182)
+++ head/sys/dev/usb/controller/uss820dci.c	Fri Mar 20 21:57:54 2009	(r190183)
@@ -836,8 +836,8 @@ uss820dci_setup_standard_chain(struct us
 
 	temp.td = NULL;
 	temp.td_next = xfer->td_start[0];
-	temp.setup_alt_next = xfer->flags_int.short_frames_ok;
 	temp.offset = 0;
+	temp.setup_alt_next = xfer->flags_int.short_frames_ok;
 
 	sc = USS820_DCI_BUS2SC(xfer->xroot->bus);
 	ep_no = (xfer->endpoint & UE_ADDR);
@@ -851,6 +851,12 @@ uss820dci_setup_standard_chain(struct us
 			temp.len = xfer->frlengths[0];
 			temp.pc = xfer->frbuffers + 0;
 			temp.short_pkt = temp.len ? 1 : 0;
+			/* check for last frame */
+			if (xfer->nframes == 1) {
+				/* no STATUS stage yet, SETUP is last */
+				if (xfer->flags_int.control_act)
+					temp.setup_alt_next = 0;
+			}
 
 			uss820dci_setup_standard_chain_sub(&temp);
 		}
@@ -878,7 +884,13 @@ uss820dci_setup_standard_chain(struct us
 		x++;
 
 		if (x == xfer->nframes) {
-			temp.setup_alt_next = 0;
+			if (xfer->flags_int.control_xfr) {
+				if (xfer->flags_int.control_act) {
+					temp.setup_alt_next = 0;
+				}
+			} else {
+				temp.setup_alt_next = 0;
+			}
 		}
 		if (temp.len == 0) {
 
@@ -903,37 +915,39 @@ uss820dci_setup_standard_chain(struct us
 		}
 	}
 
-	/* always setup a valid "pc" pointer for status and sync */
-	temp.pc = xfer->frbuffers + 0;
-
-	/* check if we should append a status stage */
-
-	if (xfer->flags_int.control_xfr &&
-	    !xfer->flags_int.control_act) {
+	/* check for control transfer */
+	if (xfer->flags_int.control_xfr) {
 		uint8_t need_sync;
 
-		/*
-		 * Send a DATA1 message and invert the current
-		 * endpoint direction.
-		 */
-		if (xfer->endpoint & UE_DIR_IN) {
-			temp.func = &uss820dci_data_rx;
-			need_sync = 0;
-		} else {
-			temp.func = &uss820dci_data_tx;
-			need_sync = 1;
-		}
+		/* always setup a valid "pc" pointer for status and sync */
+		temp.pc = xfer->frbuffers + 0;
 		temp.len = 0;
 		temp.short_pkt = 0;
+		temp.setup_alt_next = 0;
 
-		uss820dci_setup_standard_chain_sub(&temp);
-		if (need_sync) {
-			/* we need a SYNC point after TX */
-			temp.func = &uss820dci_data_tx_sync;
+		/* check if we should append a status stage */
+		if (!xfer->flags_int.control_act) {
+
+			/*
+			 * Send a DATA1 message and invert the current
+			 * endpoint direction.
+			 */
+			if (xfer->endpoint & UE_DIR_IN) {
+				temp.func = &uss820dci_data_rx;
+				need_sync = 0;
+			} else {
+				temp.func = &uss820dci_data_tx;
+				need_sync = 1;
+			}
 			temp.len = 0;
 			temp.short_pkt = 0;
 
 			uss820dci_setup_standard_chain_sub(&temp);
+			if (need_sync) {
+				/* we need a SYNC point after TX */
+				temp.func = &uss820dci_data_tx_sync;
+				uss820dci_setup_standard_chain_sub(&temp);
+			}
 		}
 	}
 	/* must have at least one frame! */

Modified: head/sys/dev/usb/controller/uss820dci_atmelarm.c
==============================================================================
--- head/sys/dev/usb/controller/uss820dci_atmelarm.c	Fri Mar 20 21:51:27 2009	(r190182)
+++ head/sys/dev/usb/controller/uss820dci_atmelarm.c	Fri Mar 20 21:57:54 2009	(r190183)
@@ -170,10 +170,10 @@ uss820_atmelarm_attach(device_t dev)
 
 #if (__FreeBSD_version >= 700031)
 	err = bus_setup_intr(dev, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE,
-	    NULL, (void *)uss820dci_interrupt, sc, &sc->sc_intr_hdl);
+	    NULL, (driver_intr_t *)uss820dci_interrupt, sc, &sc->sc_intr_hdl);
 #else
 	err = bus_setup_intr(dev, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE,
-	    (void *)uss820dci_interrupt, sc, &sc->sc_intr_hdl);
+	    (driver_intr_t *)uss820dci_interrupt, sc, &sc->sc_intr_hdl);
 #endif
 	if (err) {
 		sc->sc_intr_hdl = NULL;

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 20 22:01:45 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5EAD1106564A;
	Fri, 20 Mar 2009 22:01:45 +0000 (UTC)
	(envelope-from thompsa@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 4CBEB8FC16;
	Fri, 20 Mar 2009 22:01:45 +0000 (UTC)
	(envelope-from thompsa@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2KM1jYe015027;
	Fri, 20 Mar 2009 22:01:45 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2KM1jPY015026;
	Fri, 20 Mar 2009 22:01:45 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <200903202201.n2KM1jPY015026@svn.freebsd.org>
From: Andrew Thompson 
Date: Fri, 20 Mar 2009 22:01: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: r190184 - 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: Fri, 20 Mar 2009 22:01:46 -0000

Author: thompsa
Date: Fri Mar 20 22:01:45 2009
New Revision: 190184
URL: http://svn.freebsd.org/changeset/base/190184

Log:
  MFp4 //depot/projects/usb @159479,159502,159516,159522,159529
  
  Workaround for buggy USB hardware not handling new SETUP packet before STATUS
  stage is complete, this allows xfers to endpoint0 to return a short frame.
  
  Submitted by: Hans Petter Selasky
  Reported by:  me

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

Modified: head/sys/dev/usb/usb_transfer.c
==============================================================================
--- head/sys/dev/usb/usb_transfer.c	Fri Mar 20 21:57:54 2009	(r190183)
+++ head/sys/dev/usb/usb_transfer.c	Fri Mar 20 22:01:45 2009	(r190184)
@@ -113,7 +113,6 @@ static const struct usb2_config usb2_con
 		.endpoint = 0x00,	/* Control pipe */
 		.direction = UE_DIR_ANY,
 		.mh.bufsize = sizeof(struct usb2_device_request),
-		.mh.flags = {},
 		.mh.callback = &usb2_do_clear_stall_callback,
 		.mh.timeout = 1000,	/* 1 second */
 		.mh.interval = 50,	/* 50ms */
@@ -1251,6 +1250,20 @@ usb2_start_hardware_sub(struct usb2_xfer
 		/* no longer active */
 		xfer->flags_int.control_act = 0;
 	}
+
+	/* Check for invalid number of frames */
+	if (xfer->nframes > 2) {
+		/*
+		 * If you need to split a control transfer, you
+		 * have to do one part at a time. Only with
+		 * non-control transfers you can do multiple
+		 * parts a time.
+		 */
+		DPRINTFN(0, "Too many frames: %u\n",
+		    (unsigned int)xfer->nframes);
+		goto error;
+	}
+
 	/*
          * Check if there is a control
          * transfer in progress:
@@ -1495,23 +1508,28 @@ usb2_start_hardware(struct usb2_xfer *xf
 	 */
 	if (USB_GET_DATA_ISREAD(xfer)) {
 
-		if (xfer->flags_int.control_xfr) {
-
-			/*
-			 * Control transfers do not support reception
-			 * of multiple short USB frames !
-			 */
+		if (xfer->flags.short_frames_ok) {
+			xfer->flags_int.short_xfer_ok = 1;
+			xfer->flags_int.short_frames_ok = 1;
+		} else if (xfer->flags.short_xfer_ok) {
+			xfer->flags_int.short_xfer_ok = 1;
 
-			if (xfer->flags.short_xfer_ok) {
-				xfer->flags_int.short_xfer_ok = 1;
-			}
-		} else {
-
-			if (xfer->flags.short_frames_ok) {
-				xfer->flags_int.short_xfer_ok = 1;
+			/* check for control transfer */
+			if (xfer->flags_int.control_xfr) {
+				/*
+				 * 1) Control transfers do not support
+				 * reception of multiple short USB
+				 * frames in host mode and device side
+				 * mode, with exception of:
+				 *
+				 * 2) Due to sometimes buggy device
+				 * side firmware we need to do a
+				 * STATUS stage in case of short
+				 * control transfers in USB host mode.
+				 * The STATUS stage then becomes the
+				 * "alt_next" to the DATA stage.
+				 */
 				xfer->flags_int.short_frames_ok = 1;
-			} else if (xfer->flags.short_xfer_ok) {
-				xfer->flags_int.short_xfer_ok = 1;
 			}
 		}
 	}
@@ -2652,7 +2670,6 @@ usb2_clear_data_toggle(struct usb2_devic
  *	.interval = 50, //50 milliseconds
  *	.bufsize = sizeof(struct usb2_device_request),
  *	.mh.timeout = 1000, //1.000 seconds
- *	.mh.flags = { },
  *	.mh.callback = &my_clear_stall_callback, // **
  * };
  *

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 20 22:04:34 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D6EA31065676;
	Fri, 20 Mar 2009 22:04:34 +0000 (UTC)
	(envelope-from thompsa@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 6325D8FC17;
	Fri, 20 Mar 2009 22:04:33 +0000 (UTC)
	(envelope-from thompsa@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2KM4XgF015173;
	Fri, 20 Mar 2009 22:04:33 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2KM4Xj7015172;
	Fri, 20 Mar 2009 22:04:33 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <200903202204.n2KM4Xj7015172@svn.freebsd.org>
From: Andrew Thompson 
Date: Fri, 20 Mar 2009 22:04: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: r190185 - 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: Fri, 20 Mar 2009 22:04:35 -0000

Author: thompsa
Date: Fri Mar 20 22:04:33 2009
New Revision: 190185
URL: http://svn.freebsd.org/changeset/base/190185

Log:
  MFp4 //depot/projects/usb
  
  Sync usb_core.h after header changes.
  
  Submitted by:	Hans Petter Selasky

Modified:
  head/sys/dev/usb/usb_core.h

Modified: head/sys/dev/usb/usb_core.h
==============================================================================
--- head/sys/dev/usb/usb_core.h	Fri Mar 20 22:01:45 2009	(r190184)
+++ head/sys/dev/usb/usb_core.h	Fri Mar 20 22:04:33 2009	(r190185)
@@ -32,6 +32,8 @@
 #ifndef _USB2_CORE_H_
 #define	_USB2_CORE_H_
 
+#define	USB_STACK_VERSION 2000		/* 2.0 */
+
 /* Allow defines in "opt_usb.h" to override configuration */
 
 #include "opt_usb.h"
@@ -140,28 +142,53 @@
 #include 
 #include 
 
-#include 
+#include 
 #include 
 
 #include "usb_if.h"
 
-#define	USB_STACK_VERSION 2000		/* 2.0 */
-
+#ifndef USB_HOST_ALIGN
 #define	USB_HOST_ALIGN    8		/* bytes, must be power of two */
+#endif
 
-#define	USB_ISOC_TIME_MAX 128		/* ms */
+#ifndef USB_FS_ISOC_UFRAME_MAX
 #define	USB_FS_ISOC_UFRAME_MAX 4	/* exclusive unit */
+#endif
 
 #if (USB_FS_ISOC_UFRAME_MAX > 6)
 #error "USB_FS_ISOC_UFRAME_MAX cannot be set higher than 6"
 #endif
 
+#ifndef USB_BUS_MAX
+#define	USB_BUS_MAX 256			/* units */
+#endif
+
+#ifndef USB_MAX_DEVICES
+#define	USB_MAX_DEVICES 128		/* units */
+#endif
+
+#if (USB_MAX_DEVICES < USB_MIN_DEVICES)
+#error "Minimum number of devices is greater than maximum number of devices."
+#endif
+
+#ifndef USB_IFACE_MAX
+#define	USB_IFACE_MAX 32		/* units */
+#endif
+
+#ifndef USB_FIFO_MAX
+#define	USB_FIFO_MAX 128		/* units */
+#endif
+
+#if (USB_FIFO_MAX & 1)
+#error "Number of FIFOs must be odd."
+#endif
+
 #define	USB_MAX_FS_ISOC_FRAMES_PER_XFER (120)	/* units */
 #define	USB_MAX_HS_ISOC_FRAMES_PER_XFER (8*120)	/* units */
 
-#define	USB_MAX_IPACKET		8	/* maximum size of the initial USB
-					 * data packet */
-#define	USB_HUB_MAX_DEPTH 5
+#ifndef USB_HUB_MAX_DEPTH
+#define	USB_HUB_MAX_DEPTH	5
+#endif
 
 #ifndef USB_EP0_BUFSIZE
 #define	USB_EP0_BUFSIZE		1024	/* bytes */

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 20 22:10:37 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6FEEF1065673;
	Fri, 20 Mar 2009 22:10:37 +0000 (UTC)
	(envelope-from thompsa@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 5C9218FC17;
	Fri, 20 Mar 2009 22:10:37 +0000 (UTC)
	(envelope-from thompsa@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2KMAbqj015325;
	Fri, 20 Mar 2009 22:10:37 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2KMAaRN015318;
	Fri, 20 Mar 2009 22:10:36 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <200903202210.n2KMAaRN015318@svn.freebsd.org>
From: Andrew Thompson 
Date: Fri, 20 Mar 2009 22: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: r190186 - in head/sys/dev/usb: . misc serial 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: Fri, 20 Mar 2009 22:10:38 -0000

Author: thompsa
Date: Fri Mar 20 22:10:36 2009
New Revision: 190186
URL: http://svn.freebsd.org/changeset/base/190186

Log:
  MFp4 //depot/projects/usb@159517
  
  Fix warnings with the IAR compiler.
  
  Submitted by:	Hans Petter Selasky

Modified:
  head/sys/dev/usb/misc/udbp.c
  head/sys/dev/usb/serial/ucycom.c
  head/sys/dev/usb/serial/ufoma.c
  head/sys/dev/usb/storage/umass.c
  head/sys/dev/usb/storage/urio.c
  head/sys/dev/usb/usb_handle_request.c
  head/sys/dev/usb/usb_msctest.c

Modified: head/sys/dev/usb/misc/udbp.c
==============================================================================
--- head/sys/dev/usb/misc/udbp.c	Fri Mar 20 22:04:33 2009	(r190185)
+++ head/sys/dev/usb/misc/udbp.c	Fri Mar 20 22:10:36 2009	(r190186)
@@ -212,7 +212,6 @@ static const struct usb2_config udbp_con
 		.endpoint = 0x00,	/* Control pipe */
 		.direction = UE_DIR_ANY,
 		.mh.bufsize = sizeof(struct usb2_device_request),
-		.mh.flags = {},
 		.mh.callback = &udbp_bulk_write_clear_stall_callback,
 		.mh.timeout = 1000,	/* 1 second */
 		.mh.interval = 50,	/* 50ms */
@@ -223,7 +222,6 @@ static const struct usb2_config udbp_con
 		.endpoint = 0x00,	/* Control pipe */
 		.direction = UE_DIR_ANY,
 		.mh.bufsize = sizeof(struct usb2_device_request),
-		.mh.flags = {},
 		.mh.callback = &udbp_bulk_read_clear_stall_callback,
 		.mh.timeout = 1000,	/* 1 second */
 		.mh.interval = 50,	/* 50ms */

Modified: head/sys/dev/usb/serial/ucycom.c
==============================================================================
--- head/sys/dev/usb/serial/ucycom.c	Fri Mar 20 22:04:33 2009	(r190185)
+++ head/sys/dev/usb/serial/ucycom.c	Fri Mar 20 22:10:36 2009	(r190186)
@@ -121,7 +121,6 @@ static const struct usb2_config ucycom_c
 		.endpoint = 0x00,	/* Control pipe */
 		.direction = UE_DIR_ANY,
 		.mh.bufsize = (sizeof(struct usb2_device_request) + UCYCOM_MAX_IOLEN),
-		.mh.flags = {},
 		.mh.callback = &ucycom_ctrl_write_callback,
 		.mh.timeout = 1000,	/* 1 second */
 	},

Modified: head/sys/dev/usb/serial/ufoma.c
==============================================================================
--- head/sys/dev/usb/serial/ufoma.c	Fri Mar 20 22:04:33 2009	(r190185)
+++ head/sys/dev/usb/serial/ufoma.c	Fri Mar 20 22:10:36 2009	(r190186)
@@ -252,7 +252,6 @@ static const struct usb2_config
 		.endpoint = 0x00,	/* Control pipe */
 		.direction = UE_DIR_ANY,
 		.mh.bufsize = (sizeof(struct usb2_device_request) + 1),
-		.mh.flags = {},
 		.mh.callback = &ufoma_ctrl_write_callback,
 		.mh.timeout = 1000,	/* 1 second */
 	},

Modified: head/sys/dev/usb/storage/umass.c
==============================================================================
--- head/sys/dev/usb/storage/umass.c	Fri Mar 20 22:04:33 2009	(r190185)
+++ head/sys/dev/usb/storage/umass.c	Fri Mar 20 22:10:36 2009	(r190186)
@@ -1063,7 +1063,6 @@ struct usb2_config umass_bbb_config[UMAS
 		.endpoint = 0x00,	/* Control pipe */
 		.direction = UE_DIR_ANY,
 		.mh.bufsize = sizeof(struct usb2_device_request),
-		.mh.flags = {},
 		.mh.callback = &umass_t_bbb_reset1_callback,
 		.mh.timeout = 5000,	/* 5 seconds */
 		.mh.interval = 500,	/* 500 milliseconds */
@@ -1074,7 +1073,6 @@ struct usb2_config umass_bbb_config[UMAS
 		.endpoint = 0x00,	/* Control pipe */
 		.direction = UE_DIR_ANY,
 		.mh.bufsize = sizeof(struct usb2_device_request),
-		.mh.flags = {},
 		.mh.callback = &umass_t_bbb_reset2_callback,
 		.mh.timeout = 5000,	/* 5 seconds */
 		.mh.interval = 50,	/* 50 milliseconds */
@@ -1085,7 +1083,6 @@ struct usb2_config umass_bbb_config[UMAS
 		.endpoint = 0x00,	/* Control pipe */
 		.direction = UE_DIR_ANY,
 		.mh.bufsize = sizeof(struct usb2_device_request),
-		.mh.flags = {},
 		.mh.callback = &umass_t_bbb_reset3_callback,
 		.mh.timeout = 5000,	/* 5 seconds */
 		.mh.interval = 50,	/* 50 milliseconds */
@@ -1096,7 +1093,6 @@ struct usb2_config umass_bbb_config[UMAS
 		.endpoint = UE_ADDR_ANY,
 		.direction = UE_DIR_OUT,
 		.mh.bufsize = sizeof(umass_bbb_cbw_t),
-		.mh.flags = {},
 		.mh.callback = &umass_t_bbb_command_callback,
 		.mh.timeout = 5000,	/* 5 seconds */
 	},
@@ -1116,7 +1112,6 @@ struct usb2_config umass_bbb_config[UMAS
 		.endpoint = 0x00,	/* Control pipe */
 		.direction = UE_DIR_ANY,
 		.mh.bufsize = sizeof(struct usb2_device_request),
-		.mh.flags = {},
 		.mh.callback = &umass_t_bbb_data_rd_cs_callback,
 		.mh.timeout = 5000,	/* 5 seconds */
 	},
@@ -1136,7 +1131,6 @@ struct usb2_config umass_bbb_config[UMAS
 		.endpoint = 0x00,	/* Control pipe */
 		.direction = UE_DIR_ANY,
 		.mh.bufsize = sizeof(struct usb2_device_request),
-		.mh.flags = {},
 		.mh.callback = &umass_t_bbb_data_wr_cs_callback,
 		.mh.timeout = 5000,	/* 5 seconds */
 	},
@@ -1160,7 +1154,6 @@ struct usb2_config umass_cbi_config[UMAS
 		.direction = UE_DIR_ANY,
 		.mh.bufsize = (sizeof(struct usb2_device_request) +
 		    UMASS_CBI_DIAGNOSTIC_CMDLEN),
-		.mh.flags = {},
 		.mh.callback = &umass_t_cbi_reset1_callback,
 		.mh.timeout = 5000,	/* 5 seconds */
 		.mh.interval = 500,	/* 500 milliseconds */
@@ -1171,7 +1164,6 @@ struct usb2_config umass_cbi_config[UMAS
 		.endpoint = 0x00,	/* Control pipe */
 		.direction = UE_DIR_ANY,
 		.mh.bufsize = sizeof(struct usb2_device_request),
-		.mh.flags = {},
 		.mh.callback = &umass_t_cbi_reset2_callback,
 		.mh.timeout = 5000,	/* 5 seconds */
 		.mh.interval = 50,	/* 50 milliseconds */
@@ -1182,7 +1174,6 @@ struct usb2_config umass_cbi_config[UMAS
 		.endpoint = 0x00,	/* Control pipe */
 		.direction = UE_DIR_ANY,
 		.mh.bufsize = sizeof(struct usb2_device_request),
-		.mh.flags = {},
 		.mh.callback = &umass_t_cbi_reset3_callback,
 		.mh.timeout = 5000,	/* 5 seconds */
 		.mh.interval = 50,	/* 50 milliseconds */
@@ -1194,7 +1185,6 @@ struct usb2_config umass_cbi_config[UMAS
 		.direction = UE_DIR_ANY,
 		.mh.bufsize = (sizeof(struct usb2_device_request) +
 		    UMASS_MAX_CMDLEN),
-		.mh.flags = {},
 		.mh.callback = &umass_t_cbi_command_callback,
 		.mh.timeout = 5000,	/* 5 seconds */
 	},
@@ -1214,7 +1204,6 @@ struct usb2_config umass_cbi_config[UMAS
 		.endpoint = 0x00,	/* Control pipe */
 		.direction = UE_DIR_ANY,
 		.mh.bufsize = sizeof(struct usb2_device_request),
-		.mh.flags = {},
 		.mh.callback = &umass_t_cbi_data_rd_cs_callback,
 		.mh.timeout = 5000,	/* 5 seconds */
 	},
@@ -1234,7 +1223,6 @@ struct usb2_config umass_cbi_config[UMAS
 		.endpoint = 0x00,	/* Control pipe */
 		.direction = UE_DIR_ANY,
 		.mh.bufsize = sizeof(struct usb2_device_request),
-		.mh.flags = {},
 		.mh.callback = &umass_t_cbi_data_wr_cs_callback,
 		.mh.timeout = 5000,	/* 5 seconds */
 	},
@@ -1254,7 +1242,6 @@ struct usb2_config umass_cbi_config[UMAS
 		.endpoint = 0x00,	/* Control pipe */
 		.direction = UE_DIR_ANY,
 		.mh.bufsize = sizeof(struct usb2_device_request),
-		.mh.flags = {},
 		.mh.callback = &umass_t_cbi_reset4_callback,
 		.mh.timeout = 5000,	/* ms */
 	},

Modified: head/sys/dev/usb/storage/urio.c
==============================================================================
--- head/sys/dev/usb/storage/urio.c	Fri Mar 20 22:04:33 2009	(r190185)
+++ head/sys/dev/usb/storage/urio.c	Fri Mar 20 22:10:36 2009	(r190186)
@@ -149,7 +149,6 @@ static const struct usb2_config urio_con
 		.endpoint = 0x00,	/* Control pipe */
 		.direction = UE_DIR_ANY,
 		.mh.bufsize = sizeof(struct usb2_device_request),
-		.mh.flags = {},
 		.mh.callback = &urio_write_clear_stall_callback,
 		.mh.timeout = 1000,	/* 1 second */
 		.mh.interval = 50,	/* 50ms */
@@ -160,7 +159,6 @@ static const struct usb2_config urio_con
 		.endpoint = 0x00,	/* Control pipe */
 		.direction = UE_DIR_ANY,
 		.mh.bufsize = sizeof(struct usb2_device_request),
-		.mh.flags = {},
 		.mh.callback = &urio_read_clear_stall_callback,
 		.mh.timeout = 1000,	/* 1 second */
 		.mh.interval = 50,	/* 50ms */

Modified: head/sys/dev/usb/usb_handle_request.c
==============================================================================
--- head/sys/dev/usb/usb_handle_request.c	Fri Mar 20 22:04:33 2009	(r190185)
+++ head/sys/dev/usb/usb_handle_request.c	Fri Mar 20 22:10:36 2009	(r190186)
@@ -211,7 +211,7 @@ tr_repeat:
 	    (iface->subdev != NULL) &&
 	    device_is_attached(iface->subdev)) {
 #if 0
-		DEVMETHOD(usb2_handle_request, NULL);	/* dummy */
+		DEVMETHOD(usb_handle_request, NULL);	/* dummy */
 #endif
 		error = USB_HANDLE_REQUEST(iface->subdev,
 		    &req, ppdata, plen,

Modified: head/sys/dev/usb/usb_msctest.c
==============================================================================
--- head/sys/dev/usb/usb_msctest.c	Fri Mar 20 22:04:33 2009	(r190185)
+++ head/sys/dev/usb/usb_msctest.c	Fri Mar 20 22:10:36 2009	(r190186)
@@ -138,7 +138,6 @@ static const struct usb2_config bbb_conf
 		.endpoint = UE_ADDR_ANY,
 		.direction = UE_DIR_OUT,
 		.mh.bufsize = sizeof(struct bbb_cbw),
-		.mh.flags = {},
 		.mh.callback = &bbb_command_callback,
 		.mh.timeout = 4 * USB_MS_HZ,	/* 4 seconds */
 	},
@@ -158,7 +157,6 @@ static const struct usb2_config bbb_conf
 		.endpoint = 0x00,	/* Control pipe */
 		.direction = UE_DIR_ANY,
 		.mh.bufsize = sizeof(struct usb2_device_request),
-		.mh.flags = {},
 		.mh.callback = &bbb_data_rd_cs_callback,
 		.mh.timeout = 1 * USB_MS_HZ,	/* 1 second  */
 	},
@@ -178,7 +176,6 @@ static const struct usb2_config bbb_conf
 		.endpoint = 0x00,	/* Control pipe */
 		.direction = UE_DIR_ANY,
 		.mh.bufsize = sizeof(struct usb2_device_request),
-		.mh.flags = {},
 		.mh.callback = &bbb_data_wr_cs_callback,
 		.mh.timeout = 1 * USB_MS_HZ,	/* 1 second  */
 	},

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 20 22:12:16 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 42B991065672;
	Fri, 20 Mar 2009 22:12:16 +0000 (UTC)
	(envelope-from thompsa@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 0ECDE8FC15;
	Fri, 20 Mar 2009 22:12:16 +0000 (UTC)
	(envelope-from thompsa@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2KMCFwo015403;
	Fri, 20 Mar 2009 22:12:15 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2KMCFnF015401;
	Fri, 20 Mar 2009 22:12:15 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <200903202212.n2KMCFnF015401@svn.freebsd.org>
From: Andrew Thompson 
Date: Fri, 20 Mar 2009 22:12:15 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190187 - 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: Fri, 20 Mar 2009 22:12:16 -0000

Author: thompsa
Date: Fri Mar 20 22:12:15 2009
New Revision: 190187
URL: http://svn.freebsd.org/changeset/base/190187

Log:
  MFp4 //depot/projects/usb@159446
  
  Remove unused and depreciated function: usb2_get_devid().
  
  Submitted by:	Hans Petter Selasky

Modified:
  head/sys/dev/usb/usb_util.c
  head/sys/dev/usb/usb_util.h

Modified: head/sys/dev/usb/usb_util.c
==============================================================================
--- head/sys/dev/usb/usb_util.c	Fri Mar 20 22:10:36 2009	(r190186)
+++ head/sys/dev/usb/usb_util.c	Fri Mar 20 22:12:15 2009	(r190187)
@@ -203,20 +203,6 @@ usb2_trim_spaces(char *p)
 #endif
 
 /*------------------------------------------------------------------------*
- *	usb2_get_devid
- *
- * This function returns the USB Vendor and Product ID like a 32-bit
- * unsigned integer.
- *------------------------------------------------------------------------*/
-uint32_t
-usb2_get_devid(device_t dev)
-{
-	struct usb2_attach_arg *uaa = device_get_ivars(dev);
-
-	return ((uaa->info.idVendor << 16) | (uaa->info.idProduct));
-}
-
-/*------------------------------------------------------------------------*
  *	usb2_make_str_desc - convert an ASCII string into a UNICODE string
  *------------------------------------------------------------------------*/
 uint8_t

Modified: head/sys/dev/usb/usb_util.h
==============================================================================
--- head/sys/dev/usb/usb_util.h	Fri Mar 20 22:10:36 2009	(r190186)
+++ head/sys/dev/usb/usb_util.h	Fri Mar 20 22:12:15 2009	(r190187)
@@ -28,7 +28,6 @@
 #define	_USB2_UTIL_H_
 
 int	device_delete_all_children(device_t dev);
-uint32_t usb2_get_devid(device_t dev);
 uint8_t	usb2_make_str_desc(void *ptr, uint16_t max_len, const char *s);
 void	device_set_usb2_desc(device_t dev);
 void	usb2_pause_mtx(struct mtx *mtx, int _ticks);

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 20 22:13:49 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A46F51065670;
	Fri, 20 Mar 2009 22:13:49 +0000 (UTC)
	(envelope-from kientzle@freebsd.org)
Received: from kientzle.com (kientzle.com [66.166.149.50])
	by mx1.freebsd.org (Postfix) with ESMTP id 718858FC19;
	Fri, 20 Mar 2009 22:13:49 +0000 (UTC)
	(envelope-from kientzle@freebsd.org)
Received: (from root@localhost)
	by kientzle.com (8.14.3/8.14.3) id n2KLsajY056783;
	Fri, 20 Mar 2009 14:54:36 -0700 (PDT)
	(envelope-from kientzle@freebsd.org)
Received: from [10.123.2.23] (fw2.kientzle.com [10.123.1.2])
	by kientzle.com with SMTP id drctr7783j34pu4tybv5qqydc6;
	Fri, 20 Mar 2009 14:54:36 -0700 (PDT)
	(envelope-from kientzle@freebsd.org)
Message-ID: <49C4109C.1020804@freebsd.org>
Date: Fri, 20 Mar 2009 14:54:36 -0700
From: Tim Kientzle 
User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.12) Gecko/20060422
X-Accept-Language: en-us, en
MIME-Version: 1.0
To: Sam Leffler 
References: <200903142010.n2EKAESF006945@svn.freebsd.org>	
	<20090320140015.GA17645@hub.freebsd.org>	
	<20090320153405.GA62675@zim.MIT.EDU> <49C3BCD4.4030605@freebsd.org>
	<1237567495.1993.2.camel@localhost> <49C3D518.6070105@freebsd.org>
In-Reply-To: <49C3D518.6070105@freebsd.org>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@freebsd.org, Vasil Dimov ,
	svn-src-all@freebsd.org, src-committers@freebsd.org,
	Coleman Kane 
Subject: Re: svn commit: r189828 - in head: include 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: Fri, 20 Mar 2009 22:13:50 -0000

> ... we'd have to mod apps to do things like remove use of 
> gnu-long-opts in to switch away from things like gtar and the savings is 
> unclear.  But I can ask...

FYI:  bsdtar already supports the most popular GNU tar
long options.  There should be extremely few ports
that actually require GNU tar.

Tim

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 20 22:15:22 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id EBAB3106564A;
	Fri, 20 Mar 2009 22:15:22 +0000 (UTC)
	(envelope-from thompsa@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id DAA838FC1F;
	Fri, 20 Mar 2009 22:15:22 +0000 (UTC)
	(envelope-from thompsa@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2KMFMrc015524;
	Fri, 20 Mar 2009 22:15:22 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2KMFMLj015523;
	Fri, 20 Mar 2009 22:15:22 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <200903202215.n2KMFMLj015523@svn.freebsd.org>
From: Andrew Thompson 
Date: Fri, 20 Mar 2009 22:15: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: r190188 - 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: Fri, 20 Mar 2009 22:15:23 -0000

Author: thompsa
Date: Fri Mar 20 22:15:22 2009
New Revision: 190188
URL: http://svn.freebsd.org/changeset/base/190188

Log:
  MFp4 //depot/projects/usb @159423, 159497
  
  - Return a Zero Length packet on read errors.
  - Allow for smaller buffer size.
  
  Submitted by:	Hans Petter Selasky

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

Modified: head/sys/dev/usb/usb_generic.c
==============================================================================
--- head/sys/dev/usb/usb_generic.c	Fri Mar 20 22:12:15 2009	(r190187)
+++ head/sys/dev/usb/usb_generic.c	Fri Mar 20 22:15:22 2009	(r190188)
@@ -416,6 +416,8 @@ ugen_default_read_callback(struct usb2_x
 
 	default:			/* Error */
 		if (xfer->error != USB_ERR_CANCELLED) {
+			/* send a zero length packet to userland */
+			usb2_fifo_put_data(f, xfer->frbuffers, 0, 0, 1);
 			f->flag_stall = 1;
 			f->fifo_zlp = 0;
 			usb2_transfer_start(f->xfer[1]);
@@ -1616,8 +1618,8 @@ ugen_set_buffer_size(struct usb2_fifo *f
 {
 	usb2_frlength_t t;
 
-	if (*(int *)addr < 1024)
-		t = 1024;
+	if (*(int *)addr < 0)
+		t = 0;		/* use "wMaxPacketSize" */
 	else if (*(int *)addr < (256 * 1024))
 		t = *(int *)addr;
 	else

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 20 22:17:03 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4B7EC1065672;
	Fri, 20 Mar 2009 22:17:03 +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 229F08FC0A;
	Fri, 20 Mar 2009 22:17:03 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from fledge.watson.org (fledge.watson.org [65.122.17.41])
	by cyrus.watson.org (Postfix) with ESMTPS id D092646B2A;
	Fri, 20 Mar 2009 18:17:02 -0400 (EDT)
Date: Fri, 20 Mar 2009 22:17:02 +0000 (GMT)
From: Robert Watson 
X-X-Sender: robert@fledge.watson.org
To: Coleman Kane 
In-Reply-To: <1237573175.1993.19.camel@localhost>
Message-ID: 
References: <200903142010.n2EKAESF006945@svn.freebsd.org>
	<20090320140015.GA17645@hub.freebsd.org>
	<20090320153405.GA62675@zim.MIT.EDU> <49C3BCD4.4030605@freebsd.org>
	<1237567495.1993.2.camel@localhost> <49C3D518.6070105@freebsd.org>
	<1237573175.1993.19.camel@localhost>
User-Agent: Alpine 2.00 (BSF 1167 2008-08-23)
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII
Cc: svn-src-head@freebsd.org, Vasil Dimov ,
	svn-src-all@freebsd.org, Sam Leffler ,
	src-committers@freebsd.org
Subject: Re: svn commit: r189828 - in head: include 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: Fri, 20 Mar 2009 22:17:03 -0000

On Fri, 20 Mar 2009, Coleman Kane wrote:

> I've found that many of the GNU apps are notorious for this. I really can't 
> say that I know why libassuan or gnupg explicitly require GNU pth, rather 
> than first attempting to use POSIX pthread API. Their configure scripts both 
> want to search for and run pth-config, and fail to enable some sort of 
> threaded features if it doesn't exist. I already tried removing pth stuff 
> from both port Makefiles to see what would happen. I didn't spend much time 
> on it after I figured out that devel/pth would just work if I removed the 
> signal.h include.
>
> I am guessing that some non-standard extensions which GNU pth provides are 
> not provided by the normal POSIX spec.
>
> In fact, libassuan just goes ahead and uses a bunch of pth_* overrides for 
> dealing with them in a thread-safe manner (waitpid, read, write, select, 
> usleep).

Historically, pthreads implementations were highly variable in quality, 
completeness, etc.  It wouldn't surprise me if the persistence of applications 
linking against pth isn't, in part, a response to that (now-historic) 
situation.

Robert N M Watson
Computer Laboratory
University of Cambridge

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 20 22:17:27 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9A4181065675;
	Fri, 20 Mar 2009 22:17:27 +0000 (UTC)
	(envelope-from thompsa@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 887EC8FC0C;
	Fri, 20 Mar 2009 22:17:27 +0000 (UTC)
	(envelope-from thompsa@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2KMHRw5015603;
	Fri, 20 Mar 2009 22:17:27 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2KMHR0N015602;
	Fri, 20 Mar 2009 22:17:27 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <200903202217.n2KMHR0N015602@svn.freebsd.org>
From: Andrew Thompson 
Date: Fri, 20 Mar 2009 22:17:27 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190189 - 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: Fri, 20 Mar 2009 22:17:28 -0000

Author: thompsa
Date: Fri Mar 20 22:17:27 2009
New Revision: 190189
URL: http://svn.freebsd.org/changeset/base/190189

Log:
  Add umass quirk.
  
  PR:			usb/132799
  Reported by:		Yoshihiro Ota
  Submitted by:		Hans Petter Selasky

Modified:
  head/sys/dev/usb/storage/umass.c

Modified: head/sys/dev/usb/storage/umass.c
==============================================================================
--- head/sys/dev/usb/storage/umass.c	Fri Mar 20 22:15:22 2009	(r190188)
+++ head/sys/dev/usb/storage/umass.c	Fri Mar 20 22:17:27 2009	(r190189)
@@ -458,6 +458,7 @@ static const struct umass_devdescr umass
 	{USB_VENDOR_GENESYS, USB_PRODUCT_GENESYS_GL641USB2IDE, RID_WILDCARD,
 		UMASS_PROTO_SCSI | UMASS_PROTO_BBB,
 		FORCE_SHORT_INQUIRY | NO_START_STOP | IGNORE_RESIDUE
+		    | NO_SYNCHRONIZE_CACHE
 	},
 	{USB_VENDOR_GENESYS, USB_PRODUCT_GENESYS_GL641USB2IDE_2, RID_WILDCARD,
 		UMASS_PROTO_ATAPI | UMASS_PROTO_BBB,

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 20 22:32:06 2009
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.ORG
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AE3111065672;
	Fri, 20 Mar 2009 22:32:06 +0000 (UTC)
	(envelope-from reg@openpave.org)
Received: from mx3.ucdavis.edu (mx3.ucdavis.edu [128.120.32.33])
	by mx1.freebsd.org (Postfix) with ESMTP id 8F2B68FC1B;
	Fri, 20 Mar 2009 22:32:06 +0000 (UTC)
	(envelope-from reg@openpave.org)
Received: from flint.openpave.org ([169.237.230.40])
	by mx3.ucdavis.edu (8.13.7/8.13.1/it-defang-5.4.0) with ESMTP id
	n2KMCCJP001456
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 20 Mar 2009 15:12:12 -0700 (PDT)
Received: from sandy.local (flint.local [192.168.1.5])
	by flint.openpave.org (8.14.3/8.14.3) with ESMTP id n2KMCBkk005342;
	Fri, 20 Mar 2009 22:12:12 GMT (envelope-from reg@sandy.local)
Received: (from reg@localhost)
	by sandy.local (8.14.3/8.14.3/Submit) id n2KMCBJf005341;
	Fri, 20 Mar 2009 14:12:11 -0800 (PST) (envelope-from reg)
Date: Fri, 20 Mar 2009 14:12:11 -0800
From: Jeremy Lea 
To: Ivan Voras 
Message-ID: <20090320221211.GA5205@flint.openpave.org>
References: <200903202151.n2KLpRMB014702@svn.freebsd.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <200903202151.n2KLpRMB014702@svn.freebsd.org>
User-Agent: Mutt/1.4.2.3i
X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on av1
X-Virus-Status: Clean
X-Scanned-By: MIMEDefang 2.57 on 128.120.32.33
Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG,
	src-committers@FreeBSD.ORG
Subject: Re: svn commit: r190182 - 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: Fri, 20 Mar 2009 22:32:07 -0000

Hi,

On Fri, Mar 20, 2009 at 09:51:27PM +0000, Ivan Voras wrote:
> +20090320:
> +	GEOM_PART has become the default partition slicer for storage devices,
> +	replacing GEOM_MBR, GEOM_BSD, GEOM_PC98 and GEOM_GPT slicers. It
> +	introduces some changes: the devices created from MSDOS extended
> +	partition entries (EBR) can be named differently than with GEOM_MBR
> +	and are now symlinks to	devices with offset-based names, and kernel
> +	dumps are now not allowed to be written to devices whose partition
> +	types indicate they are meant to be used for file systems.
> +

This should probably also note the issue with stale disklabels from old
DD mode disks, which causes the machine to be unbootable.  It should
also mention the "geometry does not match label (255h,63s != 16h,63s)"
message (which appears to be harmless), and it should also probably
mention that the c partition now covers the entire disk, not just the
"DOS partition"...  And it should be noted that these changes took place
in Decemeber, so that people have a better chance of knowing if they are
going to be bitten.

Regards,
  -Jeremy

-- 
FreeBSD - Because the best things in life are free...
                                           http://www.freebsd.org/

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 20 22:54:29 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C208F106566C;
	Fri, 20 Mar 2009 22:54:29 +0000 (UTC)
	(envelope-from ivoras@gmail.com)
Received: from mail-bw0-f164.google.com (mail-bw0-f164.google.com
	[209.85.218.164])
	by mx1.freebsd.org (Postfix) with ESMTP id A07E18FC1E;
	Fri, 20 Mar 2009 22:54:28 +0000 (UTC)
	(envelope-from ivoras@gmail.com)
Received: by bwz8 with SMTP id 8so1011018bwz.43
	for ; Fri, 20 Mar 2009 15:54:27 -0700 (PDT)
MIME-Version: 1.0
In-Reply-To: <20090320221211.GA5205@flint.openpave.org>
References: <200903202151.n2KLpRMB014702@svn.freebsd.org>
	<20090320221211.GA5205@flint.openpave.org>
Date: Fri, 20 Mar 2009 23:54:12 +0100
Received: by 10.204.117.65 with SMTP id p1mr1416367bkq.91.1237589667537; Fri, 
	20 Mar 2009 15:54:27 -0700 (PDT)
Message-ID: <9bbcef730903201554x773f46bdy890c8ab48760dce2@mail.gmail.com>
From: Ivan Voras 
To: Jeremy Lea 
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, Marcel Moolenaar 
Subject: Re: svn commit: r190182 - 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: Fri, 20 Mar 2009 22:54:30 -0000

2009/3/20 Jeremy Lea :
> Hi,
>
> On Fri, Mar 20, 2009 at 09:51:27PM +0000, Ivan Voras wrote:
>> +20090320:
>> + =C2=A0 =C2=A0 GEOM_PART has become the default partition slicer for st=
orage devices,
>> + =C2=A0 =C2=A0 replacing GEOM_MBR, GEOM_BSD, GEOM_PC98 and GEOM_GPT sli=
cers. It
>> + =C2=A0 =C2=A0 introduces some changes: the devices created from MSDOS =
extended
>> + =C2=A0 =C2=A0 partition entries (EBR) can be named differently than wi=
th GEOM_MBR
>> + =C2=A0 =C2=A0 and are now symlinks to devices with offset-based names,=
 and kernel
>> + =C2=A0 =C2=A0 dumps are now not allowed to be written to devices whose=
 partition
>> + =C2=A0 =C2=A0 types indicate they are meant to be used for file system=
s.
>> +
>
> This should probably also note the issue with stale disklabels from old
> DD mode disks, which causes the machine to be unbootable. =C2=A0It should
> also mention the "geometry does not match label (255h,63s !=3D 16h,63s)"
> message (which appears to be harmless), and it should also probably
> mention that the c partition now covers the entire disk, not just the
> "DOS partition"... =C2=A0And it should be noted that these changes took p=
lace
> in Decemeber, so that people have a better chance of knowing if they are
> going to be bitten.

Ok. Should I re-sort the note into December (probably not since it
mentions development from a large period) or just mention it in text?

@Marcel: is the warning important (I didn't encounter it yet; I guess
it probably a quirk of UFS?) and is the "c" change intended? (isn't it
time to abandon the special case of "c"?)

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 20 23:04:03 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 356B41065687;
	Fri, 20 Mar 2009 23:04:03 +0000 (UTC) (envelope-from xcllnt@mac.com)
Received: from asmtpout020.mac.com (asmtpout020.mac.com [17.148.16.95])
	by mx1.freebsd.org (Postfix) with ESMTP id 191CC8FC20;
	Fri, 20 Mar 2009 23:04:02 +0000 (UTC) (envelope-from xcllnt@mac.com)
MIME-version: 1.0
Content-transfer-encoding: 7BIT
Content-type: text/plain; charset=US-ASCII; format=flowed; delsp=yes
Received: from tkarwa-t43.jnpr.net ([66.129.224.36])
	by asmtp020.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01
	(built Dec
	16 2008; 32bit)) with ESMTPSA id <0KGT001CBUQQ7B40@asmtp020.mac.com>;
	Fri, 20 Mar 2009 16:04:02 -0700 (PDT)
Message-id: <8C44C8B6-FBBD-48CC-BAE0-5EA2EAC84609@mac.com>
From: Marcel Moolenaar 
To: Ivan Voras 
In-reply-to: <9bbcef730903201554x773f46bdy890c8ab48760dce2@mail.gmail.com>
Date: Fri, 20 Mar 2009 16:02:40 -0700
References: <200903202151.n2KLpRMB014702@svn.freebsd.org>
	<20090320221211.GA5205@flint.openpave.org>
	<9bbcef730903201554x773f46bdy890c8ab48760dce2@mail.gmail.com>
X-Mailer: Apple Mail (2.930.3)
Cc: Jeremy Lea , svn-src-head@freebsd.org,
	svn-src-all@freebsd.org, src-committers@freebsd.org,
	Marcel Moolenaar 
Subject: Re: svn commit: r190182 - 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: Fri, 20 Mar 2009 23:04:04 -0000


On Mar 20, 2009, at 3:54 PM, Ivan Voras wrote:

> 2009/3/20 Jeremy Lea :
>> Hi,
>>
>> On Fri, Mar 20, 2009 at 09:51:27PM +0000, Ivan Voras wrote:
>>> +20090320:
>>> +     GEOM_PART has become the default partition slicer for  
>>> storage devices,
>>> +     replacing GEOM_MBR, GEOM_BSD, GEOM_PC98 and GEOM_GPT  
>>> slicers. It
>>> +     introduces some changes: the devices created from MSDOS  
>>> extended
>>> +     partition entries (EBR) can be named differently than with  
>>> GEOM_MBR
>>> +     and are now symlinks to devices with offset-based names, and  
>>> kernel
>>> +     dumps are now not allowed to be written to devices whose  
>>> partition
>>> +     types indicate they are meant to be used for file systems.
>>> +
>>
>> This should probably also note the issue with stale disklabels from  
>> old
>> DD mode disks, which causes the machine to be unbootable.  It should
>> also mention the "geometry does not match label (255h,63s != 16h, 
>> 63s)"
>> message (which appears to be harmless), and it should also probably
>> mention that the c partition now covers the entire disk, not just the
>> "DOS partition"...  And it should be noted that these changes took  
>> place
>> in Decemeber, so that people have a better chance of knowing if  
>> they are
>> going to be bitten.
>
> Ok. Should I re-sort the note into December (probably not since it
> mentions development from a large period) or just mention it in text?

I would mention it in text.

> @Marcel: is the warning important (I didn't encounter it yet; I guess
> it probably a quirk of UFS?)

The warning could be important. It also makes us aware that
there's a discrepancy, which indicates that we have bugs.

> and is the "c" change intended?

The only change is that the 'c' partition cannot be used directly
anymore. If you want the whole disk, you use the provider. The
meaning of 'c' didn't change.

> (isn't it
> time to abandon the special case of "c"?)

I chose to hide 'c' rather than give it a new meaning. The
reason being that disklabel/bsdlabel still assumes the old
meaning. By hiding the 'c' partition we avoid that people
abuse the 'c' partition. There's no need to abuse 'c'
anymore because the partition table can hold 20 partitions
instead of 8.

-- 
Marcel Moolenaar
xcllnt@mac.com




From owner-svn-src-head@FreeBSD.ORG  Fri Mar 20 23:12:15 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 53F06106566C;
	Fri, 20 Mar 2009 23:12:15 +0000 (UTC)
	(envelope-from thompsa@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 4170D8FC15;
	Fri, 20 Mar 2009 23:12:15 +0000 (UTC)
	(envelope-from thompsa@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2KNCEO4016731;
	Fri, 20 Mar 2009 23:12:14 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2KNCEue016723;
	Fri, 20 Mar 2009 23:12:14 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <200903202312.n2KNCEue016723@svn.freebsd.org>
From: Andrew Thompson 
Date: Fri, 20 Mar 2009 23:12: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: r190191 - 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: Fri, 20 Mar 2009 23:12:16 -0000

Author: thompsa
Date: Fri Mar 20 23:12:14 2009
New Revision: 190191
URL: http://svn.freebsd.org/changeset/base/190191

Log:
  Fix compile with USB_HAVE_BUSDMA/USB_HAVE_UGEN/USB_HAVE_STRINGS.
  
  Submitted by:	Hans Petter Selasky

Modified:
  head/sys/dev/usb/usb_bus.h
  head/sys/dev/usb/usb_busdma.h
  head/sys/dev/usb/usb_dev.c
  head/sys/dev/usb/usb_device.c
  head/sys/dev/usb/usb_device.h
  head/sys/dev/usb/usb_generic.c
  head/sys/dev/usb/usb_hub.c
  head/sys/dev/usb/usb_util.c

Modified: head/sys/dev/usb/usb_bus.h
==============================================================================
--- head/sys/dev/usb/usb_bus.h	Fri Mar 20 23:06:16 2009	(r190190)
+++ head/sys/dev/usb/usb_bus.h	Fri Mar 20 23:12:14 2009	(r190191)
@@ -75,9 +75,10 @@ struct usb2_bus {
 	device_t parent;
 	device_t bdev;			/* filled by HC driver */
 
+#if USB_HAVE_BUSDMA
 	struct usb2_dma_parent_tag dma_parent_tag[1];
 	struct usb2_dma_tag dma_tags[USB_BUS_DMA_TAG_MAX];
-
+#endif
 	struct usb2_bus_methods *methods;	/* filled by HC driver */
 	struct usb2_device **devices;
 

Modified: head/sys/dev/usb/usb_busdma.h
==============================================================================
--- head/sys/dev/usb/usb_busdma.h	Fri Mar 20 23:06:16 2009	(r190190)
+++ head/sys/dev/usb/usb_busdma.h	Fri Mar 20 23:12:14 2009	(r190191)
@@ -48,6 +48,7 @@
 
 struct usb2_xfer_root;
 struct usb2_dma_parent_tag;
+struct usb2_dma_tag;
 
 /*
  * The following typedef defines the USB DMA load done callback.
@@ -115,11 +116,11 @@ struct usb2_page_cache {
 /*
  * The following structure describes the parent USB DMA tag.
  */
+#if USB_HAVE_BUSDMA
 struct usb2_dma_parent_tag {
-#if USB_HAVE_BUSDMA && defined(__FreeBSD__)
+#if defined(__FreeBSD__)
 	struct cv cv[1];		/* internal condition variable */
 #endif
-#if USB_HAVE_BUSDMA
 	bus_dma_tag_t tag;		/* always set */
 
 	struct mtx *mtx;		/* private mutex, always set */
@@ -128,27 +129,31 @@ struct usb2_dma_parent_tag {
 	uint8_t	dma_error;		/* set if DMA load operation failed */
 	uint8_t	dma_bits;		/* number of DMA address lines */
 	uint8_t	utag_max;		/* number of USB DMA tags */
-#endif
 };
+#else
+struct usb2_dma_parent_tag {};		/* empty struct */
+#endif
 
 /*
  * The following structure describes an USB DMA tag.
  */
+#if USB_HAVE_BUSDMA
 struct usb2_dma_tag {
-#if USB_HAVE_BUSDMA && defined(__NetBSD__)
+#if defined(__NetBSD__)
 	bus_dma_segment_t *p_seg;
 #endif
-#if USB_HAVE_BUSDMA
 	struct usb2_dma_parent_tag *tag_parent;
 	bus_dma_tag_t tag;
 
 	usb2_size_t align;
 	usb2_size_t size;
-#endif
-#if USB_HAVE_BUSDMA && defined(__NetBSD__)
+#if defined(__NetBSD__)
 	usb2_size_t n_seg;
 #endif
 };
+#else
+struct usb2_dma_tag {};			/* empty struct */
+#endif
 
 /* function prototypes */
 

Modified: head/sys/dev/usb/usb_dev.c
==============================================================================
--- head/sys/dev/usb/usb_dev.c	Fri Mar 20 23:06:16 2009	(r190190)
+++ head/sys/dev/usb/usb_dev.c	Fri Mar 20 23:12:14 2009	(r190191)
@@ -54,6 +54,8 @@
 
 #include 
 
+#if USB_HAVE_UGEN
+
 #if USB_DEBUG
 static int usb2_fifo_debug = 0;
 
@@ -2195,3 +2197,4 @@ usb2_fifo_set_close_zlp(struct usb2_fifo
 	/* send a Zero Length Packet, ZLP, before close */
 	f->flag_short = onoff;
 }
+#endif	/* USB_HAVE_UGEN */

Modified: head/sys/dev/usb/usb_device.c
==============================================================================
--- head/sys/dev/usb/usb_device.c	Fri Mar 20 23:06:16 2009	(r190190)
+++ head/sys/dev/usb/usb_device.c	Fri Mar 20 23:12:14 2009	(r190191)
@@ -75,9 +75,8 @@ static void	usb2_check_strings(struct us
 #endif
 static usb2_error_t usb2_fill_iface_data(struct usb2_device *, uint8_t,
 		    uint8_t);
-static void	usb2_notify_addq(const char *type, struct usb2_device *);
-
 #if USB_HAVE_UGEN
+static void	usb2_notify_addq(const char *type, struct usb2_device *);
 static void	usb2_fifo_free_wrap(struct usb2_device *, uint8_t, uint8_t);
 static struct cdev *usb2_make_dev(struct usb2_device *, int, int);
 static void	usb2_cdev_create(struct usb2_device *);
@@ -738,7 +737,6 @@ usb2_set_alt_interface_index(struct usb2
 	 */
 	usb2_fifo_free_wrap(udev, iface_index, 0);
 #endif
-
 	err = usb2_fill_iface_data(udev, iface_index, alt_index);
 	if (err) {
 		goto done;
@@ -1378,8 +1376,6 @@ usb2_alloc_device(device_t parent_dev, s
 	usb2_cv_init(udev->default_cv, "WCTRL");
 	usb2_cv_init(udev->default_cv + 1, "UGONE");
 
-	LIST_INIT(&udev->pd_list);
-
 	/* initialise our mutex */
 	mtx_init(udev->default_mtx, "USB device mutex", NULL, MTX_DEF);
 
@@ -1449,18 +1445,19 @@ usb2_alloc_device(device_t parent_dev, s
 	/* set device index */
 	udev->device_index = device_index;
 
+#if USB_HAVE_UGEN
 	/* Create ugen name */
 	snprintf(udev->ugen_name, sizeof(udev->ugen_name),
 	    USB_GENERIC_NAME "%u.%u", device_get_unit(bus->bdev),
 	    device_index);
-#if USB_HAVE_UGEN
+	LIST_INIT(&udev->pd_list);
+
 	/* Create the control endpoint device */
 	udev->default_dev = usb2_make_dev(udev, 0, FREAD|FWRITE);
 
 	/* Create a link from /dev/ugenX.X to the default endpoint */
 	make_dev_alias(udev->default_dev, udev->ugen_name);
 #endif
-
 	if (udev->flags.usb2_mode == USB_MODE_HOST) {
 
 		err = usb2_req_set_address(udev, NULL, device_index);
@@ -1713,14 +1710,17 @@ repeat_set_config:
 	usb2_bus_port_set_device(bus, parent_hub ?
 	    parent_hub->hub->ports + port_index : NULL, udev, device_index);
 
-	/* Link and announce the ugen device name */
 #if USB_HAVE_UGEN
+	/* Symlink the ugen device name */
 	udev->ugen_symlink = usb2_alloc_symlink(udev->ugen_name);
-#endif
+
+	/* Announce device */
+#if USB_HAVE_STRINGS
 	printf("%s: <%s> at %s\n", udev->ugen_name, udev->manufacturer,
 	    device_get_nameunit(udev->bus->bdev));
-
+#endif
 	usb2_notify_addq("+", udev);
+#endif
 done:
 	if (err) {
 		/* free device  */
@@ -1824,7 +1824,6 @@ usb2_cdev_free(struct usb2_device *udev)
 
 	while ((pd = LIST_FIRST(&udev->pd_list)) != NULL) {
 		KASSERT(pd->cdev->si_drv1 == pd, ("privdata corrupt"));
-		KASSERT(pd->ep_addr > 0, ("freeing EP0"));
 
 		destroy_dev_sched_cb(pd->cdev, usb2_cdev_cleanup, pd);
 		pd->cdev = NULL;
@@ -1851,18 +1850,20 @@ usb2_free_device(struct usb2_device *ude
 
 	DPRINTFN(4, "udev=%p port=%d\n", udev, udev->port_no);
 
+#if USB_HAVE_UGEN
 	usb2_notify_addq("-", udev);
 
+#if USB_HAVE_STRINGS
 	printf("%s: <%s> at %s (disconnected)\n", udev->ugen_name,
 	    udev->manufacturer, device_get_nameunit(bus->bdev));
+#endif
 
 	/* Destroy UGEN symlink, if any */
 	if (udev->ugen_symlink) {
-#if USB_HAVE_UGEN
 		usb2_free_symlink(udev->ugen_symlink);
-#endif
 		udev->ugen_symlink = NULL;
 	}
+#endif
 	/*
 	 * Unregister our device first which will prevent any further
 	 * references:
@@ -1873,7 +1874,6 @@ usb2_free_device(struct usb2_device *ude
 
 #if USB_HAVE_UGEN
 	/* wait for all pending references to go away: */
-
 	mtx_lock(&usb2_ref_lock);
 	udev->refcount--;
 	while (udev->refcount != 0) {
@@ -1923,7 +1923,9 @@ usb2_free_device(struct usb2_device *ude
 	usb2_cv_destroy(udev->default_cv + 1);
 
 	mtx_destroy(udev->default_mtx);
+#if USB_HAVE_UGEN
 	KASSERT(LIST_FIRST(&udev->pd_list) == NULL, ("leaked cdev entries"));
+#endif
 
 	/* free device */
 	free(udev, M_USB);
@@ -2026,14 +2028,24 @@ usb2_devinfo(struct usb2_device *udev, c
 
 	if (udd->bDeviceClass != 0xFF) {
 		snprintf(dst_ptr, dst_len, "%s %s, class %d/%d, rev %x.%02x/"
-		    "%x.%02x, addr %d", udev->manufacturer, udev->product,
+		    "%x.%02x, addr %d",
+#if USB_HAVE_STRINGS
+		    udev->manufacturer, udev->product,
+#else
+		    "-", "-",
+#endif
 		    udd->bDeviceClass, udd->bDeviceSubClass,
 		    (bcdUSB >> 8), bcdUSB & 0xFF,
 		    (bcdDevice >> 8), bcdDevice & 0xFF,
 		    udev->address);
 	} else {
 		snprintf(dst_ptr, dst_len, "%s %s, rev %x.%02x/"
-		    "%x.%02x, addr %d", udev->manufacturer, udev->product,
+		    "%x.%02x, addr %d",
+#if USB_HAVE_STRINGS
+		    udev->manufacturer, udev->product,
+#else
+		    "-", "-",
+#endif
 		    (bcdUSB >> 8), bcdUSB & 0xFF,
 		    (bcdDevice >> 8), bcdDevice & 0xFF,
 		    udev->address);
@@ -2230,6 +2242,7 @@ usb2_get_device_index(struct usb2_device
 	return (udev->device_index);
 }
 
+#if USB_HAVE_UGEN
 /*------------------------------------------------------------------------*
  *	usb2_notify_addq
  *
@@ -2271,35 +2284,19 @@ usb2_notify_addq(const char *type, struc
 		    UGETW(udev->ddesc.idProduct),
 		    udev->ddesc.bDeviceClass,
 		    udev->ddesc.bDeviceSubClass,
+#if USB_HAVE_STRINGS
 		    udev->serial,
+#else
+		    "",
+#endif
 		    udev->port_no,
-		    udev->parent_hub->ugen_name);
-	} else {
-		snprintf(data, 1024,
-		    "%s"
-		    "%s "
-		    "vendor=0x%04x "
-		    "product=0x%04x "
-		    "devclass=0x%02x "
-		    "devsubclass=0x%02x "
-		    "sernum=\"%s\" "
-		    "at port=%u "
-		    "on "
-		    "%s\n",
-		    type,
-		    udev->ugen_name,
-		    UGETW(udev->ddesc.idVendor),
-		    UGETW(udev->ddesc.idProduct),
-		    udev->ddesc.bDeviceClass,
-		    udev->ddesc.bDeviceSubClass,
-		    udev->serial,
-		    udev->port_no,
-		    device_get_nameunit(device_get_parent(udev->bus->bdev)));
+		    udev->parent_hub != NULL ?
+		        udev->parent_hub->ugen_name :
+		        device_get_nameunit(device_get_parent(udev->bus->bdev)));
 	}
 	devctl_queue_data(data);
 }
 
-#if USB_HAVE_UGEN
 /*------------------------------------------------------------------------*
  *	usb2_fifo_free_wrap
  *

Modified: head/sys/dev/usb/usb_device.h
==============================================================================
--- head/sys/dev/usb/usb_device.h	Fri Mar 20 23:06:16 2009	(r190190)
+++ head/sys/dev/usb/usb_device.h	Fri Mar 20 23:12:14 2009	(r190191)
@@ -27,7 +27,7 @@
 #ifndef _USB2_DEVICE_H_
 #define	_USB2_DEVICE_H_
 
-struct usb2_symlink;
+struct usb2_symlink;		/* UGEN */
 struct usb_device;		/* linux compat */
 
 #define	USB_DEFAULT_XFER_MAX 2
@@ -121,13 +121,12 @@ struct usb2_device {
 	struct usb2_xfer *default_xfer[USB_DEFAULT_XFER_MAX];
 	struct usb2_temp_data *usb2_template_ptr;
 	struct usb2_pipe *pipe_curr;	/* current clear stall pipe */
+#if USB_HAVE_UGEN
 	struct usb2_fifo *fifo[USB_FIFO_MAX];
-
-	char ugen_name[20];			/* name of ugenX.X device */
 	struct usb2_symlink *ugen_symlink;	/* our generic symlink */
-
 	LIST_HEAD(,usb2_fs_privdata) pd_list;
-
+	char	ugen_name[20];		/* name of ugenX.X device */
+#endif
 	usb2_ticks_t plugtime;		/* copy of "ticks" */
 
 	uint16_t refcount;
@@ -156,9 +155,11 @@ struct usb2_device {
 	struct usb2_endpoint_descriptor default_ep_desc;	/* for pipe 0 */
 	struct usb2_device_descriptor ddesc;	/* device descriptor */
 
+#if USB_HAVE_STRINGS
 	char	serial[64];		/* serial number */
 	char	manufacturer[64];	/* manufacturer string */
 	char	product[64];		/* product string */
+#endif
 };
 
 /* globals */

Modified: head/sys/dev/usb/usb_generic.c
==============================================================================
--- head/sys/dev/usb/usb_generic.c	Fri Mar 20 23:06:16 2009	(r190190)
+++ head/sys/dev/usb/usb_generic.c	Fri Mar 20 23:12:14 2009	(r190191)
@@ -47,6 +47,8 @@
 #include 
 #include 
 
+#if USB_HAVE_UGEN
+
 /* defines */
 
 #define	UGEN_BULK_FS_BUFFER_SIZE	(64*32)	/* bytes */
@@ -799,12 +801,14 @@ usb2_gen_fill_deviceinfo(struct usb2_fif
 	di->udi_bus = device_get_unit(udev->bus->bdev);
 	di->udi_addr = udev->address;
 	di->udi_index = udev->device_index;
+#if USB_HAVE_STRINGS
 	strlcpy(di->udi_serial, udev->serial,
 	    sizeof(di->udi_serial));
 	strlcpy(di->udi_vendor, udev->manufacturer,
 	    sizeof(di->udi_vendor));
 	strlcpy(di->udi_product, udev->product,
 	    sizeof(di->udi_product));
+#endif
 	usb2_printBCD(di->udi_release, sizeof(di->udi_release),
 	    UGETW(udev->ddesc.bcdDevice));
 	di->udi_vendorNo = UGETW(udev->ddesc.idVendor);
@@ -2183,3 +2187,4 @@ ugen_default_fs_callback(struct usb2_xfe
 		break;
 	}
 }
+#endif	/* USB_HAVE_UGEN */

Modified: head/sys/dev/usb/usb_hub.c
==============================================================================
--- head/sys/dev/usb/usb_hub.c	Fri Mar 20 23:06:16 2009	(r190190)
+++ head/sys/dev/usb/usb_hub.c	Fri Mar 20 23:12:14 2009	(r190191)
@@ -978,7 +978,11 @@ uhub_child_pnpinfo_string(device_t paren
 		    UGETW(res.udev->ddesc.idProduct),
 		    res.udev->ddesc.bDeviceClass,
 		    res.udev->ddesc.bDeviceSubClass,
+#if USB_HAVE_STRINGS
 		    res.udev->serial,
+#else
+		    "",
+#endif
 		    iface->idesc->bInterfaceClass,
 		    iface->idesc->bInterfaceSubClass);
 	} else {

Modified: head/sys/dev/usb/usb_util.c
==============================================================================
--- head/sys/dev/usb/usb_util.c	Fri Mar 20 23:06:16 2009	(r190190)
+++ head/sys/dev/usb/usb_util.c	Fri Mar 20 23:12:14 2009	(r190191)
@@ -167,7 +167,6 @@ usb2_pause_mtx(struct mtx *mtx, int _tic
  * pointed to by "p" having a maximum length of "p_len" bytes
  * including the terminating zero.
  *------------------------------------------------------------------------*/
-#if USB_HAVE_STRINGS
 void
 usb2_printBCD(char *p, uint16_t p_len, uint16_t bcd)
 {
@@ -175,7 +174,6 @@ usb2_printBCD(char *p, uint16_t p_len, u
 		/* ignore any errors */
 	}
 }
-#endif
 
 /*------------------------------------------------------------------------*
  *	usb2_trim_spaces

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 20 23:13:32 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AB657106566C;
	Fri, 20 Mar 2009 23:13:32 +0000 (UTC)
	(envelope-from ivoras@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 9A4CF8FC08;
	Fri, 20 Mar 2009 23:13:32 +0000 (UTC)
	(envelope-from ivoras@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2KNDWgE016796;
	Fri, 20 Mar 2009 23:13:32 GMT (envelope-from ivoras@svn.freebsd.org)
Received: (from ivoras@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2KNDWs2016795;
	Fri, 20 Mar 2009 23:13:32 GMT (envelope-from ivoras@svn.freebsd.org)
Message-Id: <200903202313.n2KNDWs2016795@svn.freebsd.org>
From: Ivan Voras 
Date: Fri, 20 Mar 2009 23:13: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: r190192 - 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: Fri, 20 Mar 2009 23:13:33 -0000

Author: ivoras
Date: Fri Mar 20 23:13:32 2009
New Revision: 190192
URL: http://svn.freebsd.org/changeset/base/190192

Log:
  Separate the GEOM_PART entry into paragraphs with differences from old
  slicers. Add more notes.
  
  Reviewed by:	marcel (implicit)
  Approved by:	gnn (mentor) (implicit)

Modified:
  head/UPDATING

Modified: head/UPDATING
==============================================================================
--- head/UPDATING	Fri Mar 20 23:12:14 2009	(r190191)
+++ head/UPDATING	Fri Mar 20 23:13:32 2009	(r190192)
@@ -25,11 +25,23 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8.
 20090320:
 	GEOM_PART has become the default partition slicer for storage devices,
 	replacing GEOM_MBR, GEOM_BSD, GEOM_PC98 and GEOM_GPT slicers. It
-	introduces some changes: the devices created from MSDOS extended
-	partition entries (EBR) can be named differently than with GEOM_MBR
-	and are now symlinks to	devices with offset-based names, and kernel
-	dumps are now not allowed to be written to devices whose partition
-	types indicate they are meant to be used for file systems.
+	introduces some changes:
+	
+	MSDOS/EBR: the devices created from MSDOS extended partition entries
+	(EBR) can be named differently than with GEOM_MBR and are now symlinks
+	to devices with offset-based names. fstabs may need to be modified.
+
+	BSD: the "geometry does not match label" warning is harmless in most
+	cases but it points to problems in file system misalignment with
+	disk geometry. The "c" partition is now implicit, covers the whole
+	top-level drive and cannot be (mis)used by users.
+	
+	General: Kernel dumps are now not allowed to be written to devices
+	whose partition types indicate they are meant to be used for file
+	systems (or, in case of MSDOS partitions, as something else than
+	the "386BSD" type).
+
+	Most of these changes date approximately from 200812.
 
 20090319:
 	The uscanner(4) driver has been removed from the kernel. This follows

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 20 23:55:01 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9DB3B1065670;
	Fri, 20 Mar 2009 23:55:01 +0000 (UTC)
	(envelope-from gabor@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 8B3848FC14;
	Fri, 20 Mar 2009 23:55:01 +0000 (UTC)
	(envelope-from gabor@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2KNt1gx017623;
	Fri, 20 Mar 2009 23:55:01 GMT (envelope-from gabor@svn.freebsd.org)
Received: (from gabor@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2KNt1VS017622;
	Fri, 20 Mar 2009 23:55:01 GMT (envelope-from gabor@svn.freebsd.org)
Message-Id: <200903202355.n2KNt1VS017622@svn.freebsd.org>
From: Gabor Kovesdan 
Date: Fri, 20 Mar 2009 23:55: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: r190193 - head/lib/libc/nls
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 20 Mar 2009 23:55:02 -0000

Author: gabor (doc,ports committer)
Date: Fri Mar 20 23:55:01 2009
New Revision: 190193
URL: http://svn.freebsd.org/changeset/base/190193

Log:
  - Add Ukranian catalog
  
  Submitted by:	Alex Kozlov  (via private mail)

Added:
  head/lib/libc/nls/uk_UA.UTF-8.msg   (contents, props changed)
Modified:
  head/lib/libc/nls/Makefile.inc

Modified: head/lib/libc/nls/Makefile.inc
==============================================================================
--- head/lib/libc/nls/Makefile.inc	Fri Mar 20 23:13:32 2009	(r190192)
+++ head/lib/libc/nls/Makefile.inc	Fri Mar 20 23:55:01 2009	(r190193)
@@ -31,3 +31,4 @@ NLS+=	pt_BR.ISO8859-1
 NLS+=	ru_RU.KOI8-R
 NLS+=	sk_SK.ISO8859-2
 NLS+=	sv_SE.ISO8859-1
+NLS+=	uk_UA.UTF-8

Added: head/lib/libc/nls/uk_UA.UTF-8.msg
==============================================================================
Binary file. No diff available.

From owner-svn-src-head@FreeBSD.ORG  Sat Mar 21 00:23:07 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 75F55106564A;
	Sat, 21 Mar 2009 00:23:07 +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 5ACC98FC15;
	Sat, 21 Mar 2009 00:23:07 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2L0N7d4018243;
	Sat, 21 Mar 2009 00:23:07 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2L0N7GR018241;
	Sat, 21 Mar 2009 00:23:07 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <200903210023.n2L0N7GR018241@svn.freebsd.org>
From: Marius Strobl 
Date: Sat, 21 Mar 2009 00:23: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: r190194 - head/sys/dev/bge
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 21 Mar 2009 00:23:07 -0000

Author: marius
Date: Sat Mar 21 00:23:07 2009
New Revision: 190194
URL: http://svn.freebsd.org/changeset/base/190194

Log:
  - In bge_ifmedia_upd_locked() take advantrage of LIST_FOREACH().
  - If boot verbose, print asicrev, chiprev and bus type on attach.
  - For PCI Express devices:
    1) Adjust max read request size to 4Kbytes
    2) Turn on FIFO_LONG_BURST in RDMA during bge_blockinit()
    Though 1) does not seem to have much to do with the poor TX performance
    observed on PCI Express bge(4), 2) does fix the problem. [1]
  - Nuke the RX CPU self-diag, which prevents working cards from working
    (Linux tg3 does not have this diag neither does OpenBSD's bge(4)).
    The increasing of the firmware handshaking timeout to 20000 retries
    done as part of the original commit isn't merged as way already have a
    way higher BGE_TIMEOUT of 100000.
  
  PR:		119361 [1]
  Obtained from:	tg3 via DragonflyBSD [1], DragonflyBSD

Modified:
  head/sys/dev/bge/if_bge.c
  head/sys/dev/bge/if_bgereg.h

Modified: head/sys/dev/bge/if_bge.c
==============================================================================
--- head/sys/dev/bge/if_bge.c	Fri Mar 20 23:55:01 2009	(r190193)
+++ head/sys/dev/bge/if_bge.c	Sat Mar 21 00:23:07 2009	(r190194)
@@ -384,6 +384,7 @@ static uint32_t bge_readreg_ind(struct b
 #endif
 static void bge_writemem_direct(struct bge_softc *, int, int);
 static void bge_writereg_ind(struct bge_softc *, int, int);
+static void bge_set_max_readrq(struct bge_softc *, int);
 
 static int bge_miibus_readreg(device_t, int, int);
 static int bge_miibus_writereg(device_t, int, int, int);
@@ -523,6 +524,34 @@ bge_writemem_ind(struct bge_softc *sc, i
 	pci_write_config(dev, BGE_PCI_MEMWIN_BASEADDR, 0, 4);
 }
 
+/*
+ * PCI Express only
+ */
+static void
+bge_set_max_readrq(struct bge_softc *sc, int expr_ptr)
+{
+	device_t dev;
+	uint16_t val;
+
+	KASSERT((sc->bge_flags & BGE_FLAG_PCIE) && expr_ptr != 0,
+	    ("%s: not applicable", __func__));
+
+	dev = sc->bge_dev;
+
+	val = pci_read_config(dev, expr_ptr + BGE_PCIE_DEVCTL, 2);
+	if ((val & BGE_PCIE_DEVCTL_MAX_READRQ_MASK) !=
+	    BGE_PCIE_DEVCTL_MAX_READRQ_4096) {
+		if (bootverbose)
+			device_printf(dev, "adjust device control 0x%04x ",
+			    val);
+		val &= ~BGE_PCIE_DEVCTL_MAX_READRQ_MASK;
+		val |= BGE_PCIE_DEVCTL_MAX_READRQ_4096;
+		pci_write_config(dev, expr_ptr + BGE_PCIE_DEVCTL, val, 2);
+		if (bootverbose)
+			printf("-> 0x%04x\n", val);
+	}
+}
+
 #ifdef notdef
 static uint32_t
 bge_readreg_ind(struct bge_softc *sc, int off)
@@ -1278,18 +1307,6 @@ bge_chipinit(struct bge_softc *sc)
 	/* Set endianness before we access any non-PCI registers. */
 	pci_write_config(sc->bge_dev, BGE_PCI_MISC_CTL, BGE_INIT, 4);
 
-	/*
-	 * Check the 'ROM failed' bit on the RX CPU to see if
-	 * self-tests passed. Skip this check when there's no
-	 * chip containing the Ethernet address fitted, since
-	 * in that case it will always fail.
-	 */
-	if ((sc->bge_flags & BGE_FLAG_EADDR) &&
-	    CSR_READ_4(sc, BGE_RXCPU_MODE) & BGE_RXCPUMODE_ROMFAIL) {
-		device_printf(sc->bge_dev, "RX CPU self-diagnostics failed!\n");
-		return (ENODEV);
-	}
-
 	/* Clear the MAC control register */
 	CSR_WRITE_4(sc, BGE_MAC_MODE, 0);
 
@@ -1742,14 +1759,18 @@ bge_blockinit(struct bge_softc *sc)
 	/* Enable host coalescing bug fix. */
 	if (sc->bge_asicrev == BGE_ASICREV_BCM5755 ||
 	    sc->bge_asicrev == BGE_ASICREV_BCM5787)
-			val |= 1 << 29;
+		val |= 1 << 29;
 
 	/* Turn on write DMA state machine */
 	CSR_WRITE_4(sc, BGE_WDMA_MODE, val);
+	DELAY(40);
 
 	/* Turn on read DMA state machine */
-	CSR_WRITE_4(sc, BGE_RDMA_MODE,
-	    BGE_RDMAMODE_ENABLE | BGE_RDMAMODE_ALL_ATTNS);
+	val = BGE_RDMAMODE_ENABLE | BGE_RDMAMODE_ALL_ATTNS;
+	if (sc->bge_flags & BGE_FLAG_PCIE)
+		val |= BGE_RDMAMODE_FIFO_LONG_BURST;
+	CSR_WRITE_4(sc, BGE_RDMA_MODE, val);
+	DELAY(40);
 
 	/* Turn on RX data completion state machine */
 	CSR_WRITE_4(sc, BGE_RDC_MODE, BGE_RDCMODE_ENABLE);
@@ -2387,7 +2408,7 @@ bge_attach(device_t dev)
 		goto fail;
 	}
 
-	/* Save ASIC rev. */
+	/* Save various chip information. */
 	sc->bge_chipid =
 	    pci_read_config(dev, BGE_PCI_MISC_CTL, 4) &
 	    BGE_PCIMISCCTL_ASICREV;
@@ -2470,14 +2491,17 @@ bge_attach(device_t dev)
 		 * Found a PCI Express capabilities register, this
 		 * must be a PCI Express device.
 		 */
-		if (reg != 0)
+		if (reg != 0) {
 			sc->bge_flags |= BGE_FLAG_PCIE;
 #else
 	if (BGE_IS_5705_PLUS(sc)) {
 		reg = pci_read_config(dev, BGE_PCIE_CAPID_REG, 4);
-		if ((reg & 0xFF) == BGE_PCIE_CAPID)
+		if ((reg & 0xFF) == BGE_PCIE_CAPID) {
 			sc->bge_flags |= BGE_FLAG_PCIE;
+			reg = BGE_PCIE_CAPID;
 #endif
+			bge_set_max_readrq(sc, reg);
+		}
 	} else {
 		/*
 		 * Check if the device is in PCI-X Mode.
@@ -2522,6 +2546,13 @@ bge_attach(device_t dev)
 		goto fail;
 	}
 
+	if (bootverbose)
+		device_printf(dev,
+		    "CHIP ID 0x%08x; ASIC REV 0x%02x; CHIP REV 0x%02x; %s\n",
+		    sc->bge_chipid, sc->bge_asicrev, sc->bge_chiprev,
+		    (sc->bge_flags & BGE_FLAG_PCIX) ? "PCI-X" :
+		    ((sc->bge_flags & BGE_FLAG_PCIE) ? "PCI-E" : "PCI"));
+
 	BGE_LOCK_INIT(sc, device_get_nameunit(dev));
 
 	/* Try to reset the chip. */
@@ -3882,6 +3913,7 @@ bge_ifmedia_upd_locked(struct ifnet *ifp
 {
 	struct bge_softc *sc = ifp->if_softc;
 	struct mii_data *mii;
+	struct mii_softc *miisc;
 	struct ifmedia *ifm;
 
 	BGE_LOCK_ASSERT(sc);
@@ -3932,12 +3964,9 @@ bge_ifmedia_upd_locked(struct ifnet *ifp
 
 	sc->bge_link_evt++;
 	mii = device_get_softc(sc->bge_miibus);
-	if (mii->mii_instance) {
-		struct mii_softc *miisc;
-		for (miisc = LIST_FIRST(&mii->mii_phys); miisc != NULL;
-		    miisc = LIST_NEXT(miisc, mii_list))
+	if (mii->mii_instance)
+		LIST_FOREACH(miisc, &mii->mii_phys, mii_list)
 			mii_phy_reset(miisc);
-	}
 	mii_mediachg(mii);
 
 	/*

Modified: head/sys/dev/bge/if_bgereg.h
==============================================================================
--- head/sys/dev/bge/if_bgereg.h	Fri Mar 20 23:55:01 2009	(r190193)
+++ head/sys/dev/bge/if_bgereg.h	Sat Mar 21 00:23:07 2009	(r190194)
@@ -176,6 +176,22 @@
 #define	BGE_PCI_MSI_ADDR_LO		0x60
 #define	BGE_PCI_MSI_DATA		0x64
 
+/*
+ * PCI Express definitions
+ * According to
+ * PCI Express base specification, REV. 1.0a
+ */
+
+/* PCI Express device control, 16bits */
+#define	BGE_PCIE_DEVCTL			0x08
+#define	BGE_PCIE_DEVCTL_MAX_READRQ_MASK	0x7000
+#define	BGE_PCIE_DEVCTL_MAX_READRQ_128	0x0000
+#define	BGE_PCIE_DEVCTL_MAX_READRQ_256	0x1000
+#define	BGE_PCIE_DEVCTL_MAX_READRQ_512	0x2000
+#define	BGE_PCIE_DEVCTL_MAX_READRQ_1024	0x3000
+#define	BGE_PCIE_DEVCTL_MAX_READRQ_2048	0x4000
+#define	BGE_PCIE_DEVCTL_MAX_READRQ_4096	0x5000
+
 /* PCI MSI. ??? */
 #define	BGE_PCIE_CAPID_REG		0xD0
 #define	BGE_PCIE_CAPID			0x10
@@ -1359,6 +1375,8 @@
 #define	BGE_RDMAMODE_PCI_FIFOOREAD_ATTN	0x00000100
 #define	BGE_RDMAMODE_LOCWRITE_TOOBIG	0x00000200
 #define	BGE_RDMAMODE_ALL_ATTNS		0x000003FC
+#define	BGE_RDMAMODE_FIFO_SIZE_128	0x00020000
+#define	BGE_RDMAMODE_FIFO_LONG_BURST	0x00030000
 
 /* Read DMA status register */
 #define	BGE_RDMASTAT_PCI_TGT_ABRT_ATTN	0x00000004

From owner-svn-src-head@FreeBSD.ORG  Sat Mar 21 03:59:44 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D34EF1065694;
	Sat, 21 Mar 2009 03:59:44 +0000 (UTC)
	(envelope-from nwhitehorn@freebsd.org)
Received: from agogare.doit.wisc.edu (agogare.doit.wisc.edu [144.92.197.211])
	by mx1.freebsd.org (Postfix) with ESMTP id A47A08FC20;
	Sat, 21 Mar 2009 03:59:44 +0000 (UTC)
	(envelope-from nwhitehorn@freebsd.org)
MIME-version: 1.0
Content-transfer-encoding: 7BIT
Content-type: text/plain; charset=UTF-8; format=flowed
Received: from avs-daemon.smtpauth2.wiscmail.wisc.edu by
	smtpauth2.wiscmail.wisc.edu
	(Sun Java(tm) System Messaging Server 6.3-7.04 (built Sep 26 2008;
	32bit)) id <0KGU005008FKK300@smtpauth2.wiscmail.wisc.edu>; Fri,
	20 Mar 2009 22:59:44 -0500 (CDT)
Received: from comporellon.tachypleus.net ([76.201.152.222])
	by smtpauth2.wiscmail.wisc.edu
	(Sun Java(tm) System Messaging Server 6.3-7.04 (built Sep 26 2008;
	32bit))
	with ESMTPSA id <0KGU001NK8FIZZ10@smtpauth2.wiscmail.wisc.edu>; Fri,
	20 Mar 2009 22:59:43 -0500 (CDT)
Date: Fri, 20 Mar 2009 22:59:42 -0500
From: Nathan Whitehorn 
In-reply-to: <200903201431.n2KEV9kQ005045@svn.freebsd.org>
To: Ed Schouten 
Message-id: <49C4662E.50808@freebsd.org>
X-Spam-Report: AuthenticatedSender=yes, SenderIP=76.201.152.222
X-Spam-PmxInfo: Server=avs-14, Version=5.5.1.360522,
	Antispam-Engine: 2.6.1.350677, Antispam-Data: 2009.3.21.34916,
	SenderIP=76.201.152.222
References: <200903201431.n2KEV9kQ005045@svn.freebsd.org>
User-Agent: Thunderbird 2.0.0.21 (X11/20090320)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r190157 - head/sys/dev/syscons/teken
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 21 Mar 2009 03:59:46 -0000

Ed Schouten wrote:
> Author: ed
> Date: Fri Mar 20 14:31:08 2009
> New Revision: 190157
> URL: http://svn.freebsd.org/changeset/base/190157
>
> Log:
>   Just use default behaviour on tabstops when using too many columns.
>   
>   It seems I didn't fix this issue before committing teken to the tree. My
>   initial idea was to somehow add an error mechanism to instruct the video
>   driver author to increase T_NUMCOL when using very big terminals. It
>   turns out we have platforms where we have gigantic consoles on systems
>   like the Apple PowerMac G5, which means we crash there right now.
>   
>   Just ignore tabstops placed beyond column 160. Just force tabs to be
>   placed on each 8 columns.
>   
Thanks for this! My console works much better now.
-Nathan

From owner-svn-src-head@FreeBSD.ORG  Sat Mar 21 05:34:31 2009
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id EA076106564A;
	Sat, 21 Mar 2009 05:34:31 +0000 (UTC) (envelope-from imp@bsdimp.com)
Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85])
	by mx1.freebsd.org (Postfix) with ESMTP id 8A6778FC08;
	Sat, 21 Mar 2009 05:34:31 +0000 (UTC) (envelope-from imp@bsdimp.com)
Received: from localhost (localhost [127.0.0.1])
	by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id n2L5Xj0L010709;
	Fri, 20 Mar 2009 23:33:45 -0600 (MDT) (envelope-from imp@bsdimp.com)
Date: Fri, 20 Mar 2009 23:34:18 -0600 (MDT)
Message-Id: <20090320.233418.1605903587.imp@bsdimp.com>
To: ivoras@FreeBSD.org
From: "M. Warner Losh" 
In-Reply-To: <9bbcef730903201554x773f46bdy890c8ab48760dce2@mail.gmail.com>
References: <200903202151.n2KLpRMB014702@svn.freebsd.org>
	<20090320221211.GA5205@flint.openpave.org>
	<9bbcef730903201554x773f46bdy890c8ab48760dce2@mail.gmail.com>
X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
Cc: reg@FreeBSD.org, svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org, marcel@FreeBSD.org
Subject: Re: svn commit: r190182 - 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: Sat, 21 Mar 2009 05:34:32 -0000

In message: <9bbcef730903201554x773f46bdy890c8ab48760dce2@mail.gmail.co=
m>
            Ivan Voras  writes:
: 2009/3/20 Jeremy Lea :
: > Hi,
: >
: > On Fri, Mar 20, 2009 at 09:51:27PM +0000, Ivan Voras wrote:
: >> +20090320:
: >> + =A0 =A0 GEOM_PART has become the default partition slicer for st=
orage devices,
: >> + =A0 =A0 replacing GEOM_MBR, GEOM_BSD, GEOM_PC98 and GEOM_GPT sli=
cers. It
: >> + =A0 =A0 introduces some changes: the devices created from MSDOS =
extended
: >> + =A0 =A0 partition entries (EBR) can be named differently than wi=
th GEOM_MBR
: >> + =A0 =A0 and are now symlinks to devices with offset-based names,=
 and kernel
: >> + =A0 =A0 dumps are now not allowed to be written to devices whose=
 partition
: >> + =A0 =A0 types indicate they are meant to be used for file system=
s.
: >> +
: >
: > This should probably also note the issue with stale disklabels from=
 old
: > DD mode disks, which causes the machine to be unbootable. =A0It sho=
uld
: > also mention the "geometry does not match label (255h,63s !=3D 16h,=
63s)"
: > message (which appears to be harmless), and it should also probably=

: > mention that the c partition now covers the entire disk, not just t=
he
: > "DOS partition"... =A0And it should be noted that these changes too=
k place
: > in Decemeber, so that people have a better chance of knowing if the=
y are
: > going to be bitten.
: =

: Ok. Should I re-sort the note into December (probably not since it
: mentions development from a large period) or just mention it in text?=

: =

: @Marcel: is the warning important (I didn't encounter it yet; I guess=

: it probably a quirk of UFS?) and is the "c" change intended? (isn't i=
t
: time to abandon the special case of "c"?)

Historically, UPDATING has done the 'revisionist history' thing where
if we discover a commit on May 5th caused the problem, we use May 5th
as the date, even though the issue was discovered/documented July
31st.

Warner

From owner-svn-src-head@FreeBSD.ORG  Sat Mar 21 05:37:56 2009
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CA822106566C;
	Sat, 21 Mar 2009 05:37:56 +0000 (UTC) (envelope-from imp@bsdimp.com)
Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85])
	by mx1.freebsd.org (Postfix) with ESMTP id 6FA1B8FC13;
	Sat, 21 Mar 2009 05:37:56 +0000 (UTC) (envelope-from imp@bsdimp.com)
Received: from localhost (localhost [127.0.0.1])
	by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id n2L5ZibG010733;
	Fri, 20 Mar 2009 23:35:44 -0600 (MDT) (envelope-from imp@bsdimp.com)
Date: Fri, 20 Mar 2009 23:36:17 -0600 (MDT)
Message-Id: <20090320.233617.1784646020.imp@bsdimp.com>
To: xcllnt@mac.com
From: "M. Warner Losh" 
In-Reply-To: <8C44C8B6-FBBD-48CC-BAE0-5EA2EAC84609@mac.com>
References: <20090320221211.GA5205@flint.openpave.org>
	<9bbcef730903201554x773f46bdy890c8ab48760dce2@mail.gmail.com>
	<8C44C8B6-FBBD-48CC-BAE0-5EA2EAC84609@mac.com>
X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Cc: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org,
	svn-src-head@FreeBSD.org, marcel@FreeBSD.org, ivoras@FreeBSD.org,
	reg@FreeBSD.org
Subject: Re: svn commit: r190182 - 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: Sat, 21 Mar 2009 05:37:57 -0000

In message: <8C44C8B6-FBBD-48CC-BAE0-5EA2EAC84609@mac.com>
            Marcel Moolenaar  writes:
: The warning could be important. It also makes us aware that
: there's a discrepancy, which indicates that we have bugs.

We MAY have bugs.  The geometry of the disk label not matching the
geometry reported by the device often isn't a bug at all...

Warner

From owner-svn-src-head@FreeBSD.ORG  Sat Mar 21 05:44:22 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AAA3810657CD;
	Sat, 21 Mar 2009 05:44:22 +0000 (UTC)
	(envelope-from thompsa@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 974AE8FC25;
	Sat, 21 Mar 2009 05:44:22 +0000 (UTC)
	(envelope-from thompsa@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2L5iMrp024301;
	Sat, 21 Mar 2009 05:44:22 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2L5iMf8024299;
	Sat, 21 Mar 2009 05:44:22 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <200903210544.n2L5iMf8024299@svn.freebsd.org>
From: Andrew Thompson 
Date: Sat, 21 Mar 2009 05:44: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: r190195 - in 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, 21 Mar 2009 05:44:23 -0000

Author: thompsa
Date: Sat Mar 21 05:44:22 2009
New Revision: 190195
URL: http://svn.freebsd.org/changeset/base/190195

Log:
  Revert r190173 as it breaks 64bit arches.

Modified:
  head/sys/dev/usb/storage/ustorage_fs.c
  head/sys/dev/usb/usb_endian.h

Modified: head/sys/dev/usb/storage/ustorage_fs.c
==============================================================================
--- head/sys/dev/usb/storage/ustorage_fs.c	Sat Mar 21 00:23:07 2009	(r190194)
+++ head/sys/dev/usb/storage/ustorage_fs.c	Sat Mar 21 05:44:22 2009	(r190195)
@@ -60,10 +60,12 @@ SYSCTL_INT(_hw_usb2_ustorage_fs, OID_AUT
 /* Define some limits */
 
 #ifndef USTORAGE_FS_BULK_SIZE 
-#define	USTORAGE_FS_BULK_SIZE (1UL << 17)	/* bytes */
+#define	USTORAGE_FS_BULK_SIZE (1 << 17)	/* bytes */
 #endif
 
 #define	USTORAGE_FS_MAX_LUN 8	/* units */
+#define	USTORAGE_FS_RELEASE 0x0101
+#define	USTORAGE_FS_RAM_SECT (1 << 13)
 
 /*
  * The SCSI ID string must be exactly 28 characters long
@@ -974,6 +976,8 @@ static uint8_t
 ustorage_fs_inquiry(struct ustorage_fs_softc *sc)
 {
 	uint8_t *buf = sc->sc_transfer.data_ptr;
+	static const char vendor_id[] = "FreeBSD ";
+	static const char product_id[] = "File-Stor Gadget";
 
 	struct ustorage_fs_lun *currlun = sc->sc_transfer.currlun;
 
@@ -995,9 +999,12 @@ ustorage_fs_inquiry(struct ustorage_fs_s
 	buf[4] = 31;
 	/* Additional length */
 	/* No special options */
-	/* Copy in ID string */
-	memcpy(buf + 8, USTORAGE_FS_ID_STRING, 28);
-
+	/*
+	 * NOTE: We are writing an extra zero here, that is not
+	 * transferred to the peer:
+	 */
+	snprintf(buf + 8, 28 + 1, "%-8s%-16s%04x", vendor_id, product_id,
+	    USTORAGE_FS_RELEASE);
 	return (ustorage_fs_min_len(sc, 36, 0 - 1));
 }
 
@@ -1346,7 +1353,7 @@ ustorage_fs_read(struct ustorage_fs_soft
 	 * too big
 	 */
 	if (sc->sc_transfer.cmd_data[0] == SC_READ_6) {
-		lba = (((uint32_t)sc->sc_transfer.cmd_data[1]) << 16) |
+		lba = (sc->sc_transfer.cmd_data[1] << 16) |
 		    get_be16(&sc->sc_transfer.cmd_data[2]);
 	} else {
 		lba = get_be32(&sc->sc_transfer.cmd_data[2]);
@@ -1404,7 +1411,7 @@ ustorage_fs_write(struct ustorage_fs_sof
 	 * too big.
 	 */
 	if (sc->sc_transfer.cmd_data[0] == SC_WRITE_6)
-		lba = (((uint32_t)sc->sc_transfer.cmd_data[1]) << 16) |
+		lba = (sc->sc_transfer.cmd_data[1] << 16) |
 		    get_be16(&sc->sc_transfer.cmd_data[2]);
 	else {
 		lba = get_be32(&sc->sc_transfer.cmd_data[2]);
@@ -1551,7 +1558,7 @@ ustorage_fs_check_cmd(struct ustorage_fs
 	 * non-zero.
 	 */
 	for (i = 0; i != min_cmd_size; i++) {
-		if (sc->sc_transfer.cmd_data[i] && !(mask & (1UL << i))) {
+		if (sc->sc_transfer.cmd_data[i] && !(mask & (1 << i))) {
 			if (currlun) {
 				currlun->sense_data = SS_INVALID_FIELD_IN_CDB;
 			}
@@ -1582,7 +1589,6 @@ ustorage_fs_do_cmd(struct ustorage_fs_so
 {
 	uint8_t error = 1;
 	uint8_t i;
-	uint32_t temp;
 
 	/* set default data transfer pointer */
 	sc->sc_transfer.data_ptr = sc->sc_qdata;
@@ -1598,7 +1604,7 @@ ustorage_fs_do_cmd(struct ustorage_fs_so
 			break;
 		}
 		error = ustorage_fs_check_cmd(sc, 6,
-		    (1UL << 4) | 1, 0);
+		    (1 << 4) | 1, 0);
 		if (error) {
 			break;
 		}
@@ -1613,7 +1619,7 @@ ustorage_fs_do_cmd(struct ustorage_fs_so
 			break;
 		}
 		error = ustorage_fs_check_cmd(sc, 6,
-		    (1UL << 1) | (1UL << 4) | 1, 0);
+		    (1 << 1) | (1 << 4) | 1, 0);
 		if (error) {
 			break;
 		}
@@ -1629,7 +1635,7 @@ ustorage_fs_do_cmd(struct ustorage_fs_so
 			break;
 		}
 		error = ustorage_fs_check_cmd(sc, 10,
-		    (1UL << 1) | (3UL << 7) | 1, 0);
+		    (1 << 1) | (3 << 7) | 1, 0);
 		if (error) {
 			break;
 		}
@@ -1644,7 +1650,7 @@ ustorage_fs_do_cmd(struct ustorage_fs_so
 			break;
 		}
 		error = ustorage_fs_check_cmd(sc, 6,
-		    (1UL << 1) | (1UL << 2) | (1UL << 4) | 1, 0);
+		    (1 << 1) | (1 << 2) | (1 << 4) | 1, 0);
 		if (error) {
 			break;
 		}
@@ -1660,7 +1666,7 @@ ustorage_fs_do_cmd(struct ustorage_fs_so
 			break;
 		}
 		error = ustorage_fs_check_cmd(sc, 10,
-		    (1UL << 1) | (1UL << 2) | (3UL << 7) | 1, 0);
+		    (1 << 1) | (1 << 2) | (3 << 7) | 1, 0);
 		if (error) {
 			break;
 		}
@@ -1674,7 +1680,7 @@ ustorage_fs_do_cmd(struct ustorage_fs_so
 			break;
 		}
 		error = ustorage_fs_check_cmd(sc, 6,
-		    (1UL << 4) | 1, 0);
+		    (1 << 4) | 1, 0);
 		if (error) {
 			break;
 		}
@@ -1685,13 +1691,13 @@ ustorage_fs_do_cmd(struct ustorage_fs_so
 	case SC_READ_6:
 		i = sc->sc_transfer.cmd_data[4];
 		sc->sc_transfer.cmd_dir = DIR_WRITE;
-		temp = ((i == 0) ? 256UL : i);
-		error = ustorage_fs_min_len(sc, temp << 9, 0 - (1UL << 9));
+		error = ustorage_fs_min_len(sc,
+		    ((i == 0) ? 256 : i) << 9, 0 - (1 << 9));
 		if (error) {
 			break;
 		}
 		error = ustorage_fs_check_cmd(sc, 6,
-		    (7UL << 1) | (1UL << 4) | 1, 1);
+		    (7 << 1) | (1 << 4) | 1, 1);
 		if (error) {
 			break;
 		}
@@ -1701,13 +1707,13 @@ ustorage_fs_do_cmd(struct ustorage_fs_so
 
 	case SC_READ_10:
 		sc->sc_transfer.cmd_dir = DIR_WRITE;
-		temp = get_be16(&sc->sc_transfer.cmd_data[7]);
-		error = ustorage_fs_min_len(sc, temp << 9, 0 - (1UL << 9));
+		error = ustorage_fs_min_len(sc,
+		    get_be16(&sc->sc_transfer.cmd_data[7]) << 9, 0 - (1 << 9));
 		if (error) {
 			break;
 		}
 		error = ustorage_fs_check_cmd(sc, 10,
-		    (1UL << 1) | (0xfUL << 2) | (3UL << 7) | 1, 1);
+		    (1 << 1) | (0xf << 2) | (3 << 7) | 1, 1);
 		if (error) {
 			break;
 		}
@@ -1717,19 +1723,13 @@ ustorage_fs_do_cmd(struct ustorage_fs_so
 
 	case SC_READ_12:
 		sc->sc_transfer.cmd_dir = DIR_WRITE;
-		temp = get_be32(&sc->sc_transfer.cmd_data[6]);
-		if (temp >= (1UL << (32 - 9))) {
-			/* numerical overflow */
-			sc->sc_csw.bCSWStatus = CSWSTATUS_FAILED;
-			error = 1;
-			break;
-		}
-		error = ustorage_fs_min_len(sc, temp << 9, 0 - (1UL << 9));
+		error = ustorage_fs_min_len(sc,
+		    get_be32(&sc->sc_transfer.cmd_data[6]) << 9, 0 - (1 << 9));
 		if (error) {
 			break;
 		}
 		error = ustorage_fs_check_cmd(sc, 12,
-		    (1UL << 1) | (0xfUL << 2) | (0xfUL << 6) | 1, 1);
+		    (1 << 1) | (0xf << 2) | (0xf << 6) | 1, 1);
 		if (error) {
 			break;
 		}
@@ -1740,7 +1740,7 @@ ustorage_fs_do_cmd(struct ustorage_fs_so
 	case SC_READ_CAPACITY:
 		sc->sc_transfer.cmd_dir = DIR_WRITE;
 		error = ustorage_fs_check_cmd(sc, 10,
-		    (0xfUL << 2) | (1UL << 8) | 1, 1);
+		    (0xf << 2) | (1 << 8) | 1, 1);
 		if (error) {
 			break;
 		}
@@ -1756,7 +1756,7 @@ ustorage_fs_do_cmd(struct ustorage_fs_so
 			break;
 		}
 		error = ustorage_fs_check_cmd(sc, 10,
-		    (3UL << 7) | 1, 1);
+		    (3 << 7) | 1, 1);
 		if (error) {
 			break;
 		}
@@ -1771,7 +1771,7 @@ ustorage_fs_do_cmd(struct ustorage_fs_so
 			break;
 		}
 		error = ustorage_fs_check_cmd(sc, 6,
-		    (1UL << 4) | 1, 0);
+		    (1 << 4) | 1, 0);
 		if (error) {
 			break;
 		}
@@ -1785,7 +1785,7 @@ ustorage_fs_do_cmd(struct ustorage_fs_so
 			break;
 		}
 		error = ustorage_fs_check_cmd(sc, 6,
-		    (1UL << 1) | (1UL << 4) | 1, 0);
+		    (1 << 1) | (1 << 4) | 1, 0);
 		if (error) {
 			break;
 		}
@@ -1799,7 +1799,7 @@ ustorage_fs_do_cmd(struct ustorage_fs_so
 			break;
 		}
 		error = ustorage_fs_check_cmd(sc, 10,
-		    (0xfUL << 2) | (3UL << 7) | 1, 1);
+		    (0xf << 2) | (3 << 7) | 1, 1);
 		if (error) {
 			break;
 		}
@@ -1826,7 +1826,7 @@ ustorage_fs_do_cmd(struct ustorage_fs_so
 			break;
 		}
 		error = ustorage_fs_check_cmd(sc, 10,
-		    (1UL << 1) | (0xfUL << 2) | (3UL << 7) | 1, 1);
+		    (1 << 1) | (0xf << 2) | (3 << 7) | 1, 1);
 		if (error) {
 			break;
 		}
@@ -1837,13 +1837,13 @@ ustorage_fs_do_cmd(struct ustorage_fs_so
 	case SC_WRITE_6:
 		i = sc->sc_transfer.cmd_data[4];
 		sc->sc_transfer.cmd_dir = DIR_READ;
-		temp = ((i == 0) ? 256UL : i);
-		error = ustorage_fs_min_len(sc, temp << 9, 0 - (1UL << 9));
+		error = ustorage_fs_min_len(sc,
+		    ((i == 0) ? 256 : i) << 9, 0 - (1 << 9));
 		if (error) {
 			break;
 		}
 		error = ustorage_fs_check_cmd(sc, 6,
-		    (7UL << 1) | (1UL << 4) | 1, 1);
+		    (7 << 1) | (1 << 4) | 1, 1);
 		if (error) {
 			break;
 		}
@@ -1853,13 +1853,13 @@ ustorage_fs_do_cmd(struct ustorage_fs_so
 
 	case SC_WRITE_10:
 		sc->sc_transfer.cmd_dir = DIR_READ;
-		temp = get_be16(&sc->sc_transfer.cmd_data[7]);
-		error = ustorage_fs_min_len(sc, temp << 9, 0 - (1UL << 9));
+		error = ustorage_fs_min_len(sc,
+		    get_be16(&sc->sc_transfer.cmd_data[7]) << 9, 0 - (1 << 9));
 		if (error) {
 			break;
 		}
 		error = ustorage_fs_check_cmd(sc, 10,
-		    (1UL << 1) | (0xfUL << 2) | (3UL << 7) | 1, 1);
+		    (1 << 1) | (0xf << 2) | (3 << 7) | 1, 1);
 		if (error) {
 			break;
 		}
@@ -1869,19 +1869,13 @@ ustorage_fs_do_cmd(struct ustorage_fs_so
 
 	case SC_WRITE_12:
 		sc->sc_transfer.cmd_dir = DIR_READ;
-		temp = get_be32(&sc->sc_transfer.cmd_data[6]);
-		if (temp >= (1UL << (32 - 9))) {
-			/* numerical overflow */
-			sc->sc_csw.bCSWStatus = CSWSTATUS_FAILED;
-			error = 1;
-			break;
-		}
-		error = ustorage_fs_min_len(sc, temp << 9, 0 - (1UL << 9));
+		error = ustorage_fs_min_len(sc,
+		    get_be32(&sc->sc_transfer.cmd_data[6]) << 9, 0 - (1 << 9));
 		if (error) {
 			break;
 		}
 		error = ustorage_fs_check_cmd(sc, 12,
-		    (1UL << 1) | (0xfUL << 2) | (0xfUL << 6) | 1, 1);
+		    (1 << 1) | (0xf << 2) | (0xf << 6) | 1, 1);
 		if (error) {
 			break;
 		}

Modified: head/sys/dev/usb/usb_endian.h
==============================================================================
--- head/sys/dev/usb/usb_endian.h	Sat Mar 21 00:23:07 2009	(r190194)
+++ head/sys/dev/usb/usb_endian.h	Sat Mar 21 05:44:22 2009	(r190195)
@@ -48,19 +48,19 @@ typedef uint8_t uQWord[8];
 
 #define	UGETW(w)			\
   ((w)[0] |				\
-  (((uint16_t)((w)[1])) << 8))
+  ((w)[1] << 8))
 
 #define	UGETDW(w)			\
   ((w)[0] |				\
-  (((uint16_t)((w)[1])) << 8) |		\
-  (((uint32_t)((w)[2])) << 16) |	\
-  (((uint32_t)((w)[3])) << 24))
+  ((w)[1] << 8) |			\
+  ((w)[2] << 16) |			\
+  ((w)[3] << 24))
 
 #define	UGETQW(w)			\
   ((w)[0] |				\
-  (((uint16_t)((w)[1])) << 8) |		\
-  (((uint32_t)((w)[2])) << 16) |	\
-  (((uint32_t)((w)[3])) << 24) |	\
+  ((w)[1] << 8) |			\
+  ((w)[2] << 16) |			\
+  ((w)[3] << 24) |			\
   (((uint64_t)((w)[4])) << 32) |	\
   (((uint64_t)((w)[5])) << 40) |	\
   (((uint64_t)((w)[6])) << 48) |	\

From owner-svn-src-head@FreeBSD.ORG  Sat Mar 21 10:10:34 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 31A991065672;
	Sat, 21 Mar 2009 10:10:34 +0000 (UTC)
	(envelope-from maxim@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 063668FC21;
	Sat, 21 Mar 2009 10:10:34 +0000 (UTC)
	(envelope-from maxim@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2LAAXGh029346;
	Sat, 21 Mar 2009 10:10:33 GMT (envelope-from maxim@svn.freebsd.org)
Received: (from maxim@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2LAAX5G029345;
	Sat, 21 Mar 2009 10:10:33 GMT (envelope-from maxim@svn.freebsd.org)
Message-Id: <200903211010.n2LAAX5G029345@svn.freebsd.org>
From: Maxim Konovalov 
Date: Sat, 21 Mar 2009 10:10:33 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190196 - head/lib/libc/nls
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 21 Mar 2009 10:10:34 -0000

Author: maxim
Date: Sat Mar 21 10:10:33 2009
New Revision: 190196
URL: http://svn.freebsd.org/changeset/base/190196

Log:
  o Spell.

Modified:
  head/lib/libc/nls/ru_RU.KOI8-R.msg   (contents, props changed)

Modified: head/lib/libc/nls/ru_RU.KOI8-R.msg
==============================================================================
Binary file (source and/or target). No diff available.

From owner-svn-src-head@FreeBSD.ORG  Sat Mar 21 11:03:21 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 60C0E1065670
	for ; Sat, 21 Mar 2009 11:03:21 +0000 (UTC)
	(envelope-from christoph.mallon@gmx.de)
Received: from mail.gmx.net (mail.gmx.net [213.165.64.20])
	by mx1.freebsd.org (Postfix) with SMTP id D480C8FC39
	for ; Sat, 21 Mar 2009 11:03:19 +0000 (UTC)
	(envelope-from christoph.mallon@gmx.de)
Received: (qmail invoked by alias); 21 Mar 2009 11:03:17 -0000
Received: from p54A3DBD1.dip.t-dialin.net (EHLO tron.homeunix.org)
	[84.163.219.209]
	by mail.gmx.net (mp064) with SMTP; 21 Mar 2009 12:03:17 +0100
X-Authenticated: #1673122
X-Provags-ID: V01U2FsdGVkX185NZM6mIM5MXGxgzHOpzInVIwoe0t0sQB/X0XaKE
	T9uG/uYuemZObQ
Message-ID: <49C4C974.5050209@gmx.de>
Date: Sat, 21 Mar 2009 12:03:16 +0100
From: Christoph Mallon 
User-Agent: Thunderbird 2.0.0.19 (X11/20090103)
MIME-Version: 1.0
To: Marius Strobl 
References: <200903192029.n2JKTN54074599@svn.freebsd.org>
In-Reply-To: <200903192029.n2JKTN54074599@svn.freebsd.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Y-GMX-Trusted: 0
X-FuHaFi: 0.4
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r190098 - in head/sys/sparc64: fhc sparc64
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 21 Mar 2009 11:03:21 -0000

Hi Marius,

I think this change makes the code worse from point of the compiler and 
for people reading it. Please read my explanation below.


Marius Strobl schrieb:
> Author: marius
> Date: Thu Mar 19 20:29:23 2009
> New Revision: 190098
> URL: http://svn.freebsd.org/changeset/base/190098
> 
> Log:
>   - Failing to register as interrupt controller during attach shouldn't
>     be fatal so just inform about this instead of panicing.
>   - Sort device methods.
>   - Take advantage of KOBJMETHOD_END.
>   - Remove some redundant variables.
> 
> Modified:
>   head/sys/sparc64/fhc/fhc.c
>   head/sys/sparc64/sparc64/upa.c
> 
> Modified: head/sys/sparc64/fhc/fhc.c
> ==============================================================================
> --- head/sys/sparc64/fhc/fhc.c	Thu Mar 19 20:24:30 2009	(r190097)
> +++ head/sys/sparc64/fhc/fhc.c	Thu Mar 19 20:29:23 2009	(r190098)
[...]
> @@ -165,9 +165,7 @@ fhc_attach(device_t dev)
>  	int central;
>  	int error;
>  	int i;
> -	int nintr;
> -	int nreg;
> -	int rid;
> +	int j;
>  
>  	sc = device_get_softc(dev);
>  	node = ofw_bus_get_node(dev);
> @@ -177,9 +175,9 @@ fhc_attach(device_t dev)
>  		central = 1;
>  
>  	for (i = 0; i < FHC_NREG; i++) {
> -		rid = i;
> +		j = i;
>  		sc->sc_memres[i] = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
> -		    &rid, RF_ACTIVE);
> +		    &j, RF_ACTIVE);
>  		if (sc->sc_memres[i] == NULL) {
>  			device_printf(dev, "cannot allocate resource %d\n", i);
>  			error = ENXIO;
[...]
> @@ -259,11 +258,13 @@ fhc_attach(device_t dev)
>  			 * the IGN and the IGN is constant for all devices
>  			 * on that FireHose controller.
>  			 */
> -			if (intr_controller_register(INTMAP_VEC(sc->sc_ign,
> +			j = intr_controller_register(INTMAP_VEC(sc->sc_ign,
>  			    INTINO(bus_read_4(fica->fica_memres, FHC_IMAP))),
> -			    &fhc_ic, fica) != 0)
> -				panic("%s: could not register interrupt "
> -				    "controller for map %d", __func__, i);
> +			    &fhc_ic, fica);
> +			if (j != 0)
> +				device_printf(dev, "could not register "
> +				    "interrupt controller for map %d (%d)\n",
> +				    i, j);
>  		}
>  	} else {
>  		snprintf(ledname, sizeof(ledname), "board%d", board);
> @@ -276,9 +277,9 @@ fhc_attach(device_t dev)
>  			free(fdi, M_DEVBUF);
>  			continue;
>  		}
> -		nreg = OF_getprop_alloc(child, "reg", sizeof(*reg),
> +		i = OF_getprop_alloc(child, "reg", sizeof(*reg),
>  		    (void **)®);
> -		if (nreg == -1) {
> +		if (i == -1) {
>  			device_printf(dev, "<%s>: incomplete\n",
>  			    fdi->fdi_obdinfo.obd_name);
>  			ofw_bus_gen_destroy_devinfo(&fdi->fdi_obdinfo);
> @@ -286,19 +287,19 @@ fhc_attach(device_t dev)
>  			continue;
>  		}
>  		resource_list_init(&fdi->fdi_rl);
> -		for (i = 0; i < nreg; i++)
> -			resource_list_add(&fdi->fdi_rl, SYS_RES_MEMORY, i,
> -			    reg[i].sbr_offset, reg[i].sbr_offset +
> -			    reg[i].sbr_size, reg[i].sbr_size);
> +		for (j = 0; j < i; j++)
> +			resource_list_add(&fdi->fdi_rl, SYS_RES_MEMORY, j,
> +			    reg[j].sbr_offset, reg[j].sbr_offset +
> +			    reg[j].sbr_size, reg[j].sbr_size);
>  		free(reg, M_OFWPROP);
>  		if (central == 1) {
> -			nintr = OF_getprop_alloc(child, "interrupts",
> +			i = OF_getprop_alloc(child, "interrupts",
>  			    sizeof(*intr), (void **)&intr);
> -			if (nintr != -1) {
> -				for (i = 0; i < nintr; i++) {
> -					iv = INTMAP_VEC(sc->sc_ign, intr[i]);
> +			if (i != -1) {
> +				for (j = 0; j < i; j++) {
> +					iv = INTMAP_VEC(sc->sc_ign, intr[j]);
>  					resource_list_add(&fdi->fdi_rl,
> -					    SYS_RES_IRQ, i, iv, iv, 1);
> +					    SYS_RES_IRQ, j, iv, iv, 1);
>  				}
>  				free(intr, M_OFWPROP);
>  			}
> 

These variables are not redundant. Before the variables had clear names 
(like rid or nregs, nintr), now they are called i and j, which carries 
no semantics at all.
Also j has its address taken AND you use this variable in several 
different contexts (replacement for rid, later as loop counter). This 
makes it impossible[0] for the compiler to do many useful optimisations 
like keeping the value of the variable in a register!
More local variables cost nothing - especially no stack space, if this 
is your concern - on any somewhat modern compiler. Use as many of them 
as you want for code clarity. Do not reuse variables, whose address is 
taken, because often it is impossible for the compiler to do any 
optimisations.

Here's a very small example:

#include 
void f(int*);
void g(void)
{
   int i;
   f(&i); // The address of i escapes here
   for (i = 0; i != 10; ++i)
     printf("%d", i);
}

The generated code:
g:
         subl    $28, %esp
         leal    24(%esp), %eax // The address of i
         movl    %eax, (%esp)
         call    f
         xorl    %eax, %eax
         movl    $0, 24(%esp) // write 0 to the spill slot of i
         .p2align 4,,7
.L2:
         movl    %eax, 4(%esp)
         movl    $.LC0, (%esp)
         call    printf
         movl    24(%esp), %eax // i is reloaded here
         addl    $1, %eax
         cmpl    $10, %eax
         movl    %eax, 24(%esp) // i is spilled here
         jne     .L2
         addl    $28, %esp
         ret


Now lets pass a new variable int j; to f(&j), but still use i for the loop:
g:
         pushl   %ebx
         xorl    %ebx, %ebx // initialise i with 0
         subl    $24, %esp
         leal    20(%esp), %eax // The address of j
         movl    %eax, (%esp)
         call    f
         .p2align 4,,7
.L2:
	/* i is held in register %ebx in the whole loop, no spills, no
	 * reloads */
         movl    %ebx, 4(%esp)
         addl    $1, %ebx
         movl    $.LC0, (%esp)
         call    printf
         cmpl    $10, %ebx
         jne     .L2
         addl    $24, %esp
         popl    %ebx
         ret

In short: A variable whose address is not taken is A Good Thing(TM), 
because the compiler knows "everything" about it and can do many useful 
optimisations. You can have any number of non-aliased (i.e. address not 
taken) variables. They cost nothing. If a value carries a specific 
meaning, use a new local variable with a useful name, this improves the 
clarity for people who read and try to understand the code.
The old rule "use as few as possible local variables, because they cost 
stack space" is dead since many, many years.

Sorry for the long essay, but I deem it important to tell how compilers 
work these day.

Regards
	Christoph


[0] It's impossible because the address is passed to a function, whose 
body is not known here, so the compiler has to assume the worst, i.e. 
the address of the variable is stored to a global pointer and the value 
can be modified at any time by any other function call with unknown body 
and so it has to reload it in most places where it is used.

From owner-svn-src-head@FreeBSD.ORG  Sat Mar 21 11:17:24 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8F4B31065670
	for ; Sat, 21 Mar 2009 11:17:24 +0000 (UTC)
	(envelope-from christoph.mallon@gmx.de)
Received: from mail.gmx.net (mail.gmx.net [213.165.64.20])
	by mx1.freebsd.org (Postfix) with SMTP id EFEFD8FC19
	for ; Sat, 21 Mar 2009 11:17:23 +0000 (UTC)
	(envelope-from christoph.mallon@gmx.de)
Received: (qmail invoked by alias); 21 Mar 2009 11:17:22 -0000
Received: from p54A3DBD1.dip.t-dialin.net (EHLO tron.homeunix.org)
	[84.163.219.209]
	by mail.gmx.net (mp005) with SMTP; 21 Mar 2009 12:17:22 +0100
X-Authenticated: #1673122
X-Provags-ID: V01U2FsdGVkX19BEK5zCWVBUC1cJP1WaPviu6hYqcvm4BjC1cTgL0
	Hooi9pI64DB1Rp
Message-ID: <49C4CCC1.6010704@gmx.de>
Date: Sat, 21 Mar 2009 12:17:21 +0100
From: Christoph Mallon 
User-Agent: Thunderbird 2.0.0.19 (X11/20090103)
MIME-Version: 1.0
To: Gabor Kovesdan 
References: <200903161633.n2GGX966065825@svn.freebsd.org>
In-Reply-To: <200903161633.n2GGX966065825@svn.freebsd.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Y-GMX-Trusted: 0
X-FuHaFi: 0.5
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r189883 - head/lib/libc/nls
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 21 Mar 2009 11:17:24 -0000

Gabor Kovesdan schrieb:
> Author: gabor (doc,ports committer)
> Date: Mon Mar 16 16:33:08 2009
> New Revision: 189883
> URL: http://svn.freebsd.org/changeset/base/189883
> 
> Log:
>   - Add Brazilian Portuguese catalog [1]
>   - Fixes for German catalog [2]
>   
>   PR:		kern/132694 [1], conf/80504 [2]
>   Submitted by:	Murilo Opsfelder  [1],
>   		brueffer [2]
> 
> Added:
>   head/lib/libc/nls/pt_BR.ISO8859-1.msg   (contents, props changed)
> Modified:
>   head/lib/libc/nls/Makefile.inc
>   head/lib/libc/nls/de_DE.ISO8859-1.msg
> 
[...]
> Modified: head/lib/libc/nls/de_DE.ISO8859-1.msg
> ==============================================================================
> --- head/lib/libc/nls/de_DE.ISO8859-1.msg	Mon Mar 16 16:15:14 2009	(r189882)
> +++ head/lib/libc/nls/de_DE.ISO8859-1.msg	Mon Mar 16 16:33:08 2009	(r189883)
[...]
>  $ ETXTBSY
> -26 Ausf�hrbare Datei wird benutzt
> +26 Text-Datei ist belegt

The old translation was better. The English original is bad. It's way 
more clear what a "ausführbare Datei" (executable file) is than what is 
meant by "Text-Datei" (text file).

[...]
>  $ ERANGE
> -34 Ergebnis zu gro� oder zu klein
> +34 Ergebnis zu gro�

The old translation was better. The English original is bad, because 
ERANGE can also mean that the result is too small ("oder zu klein").

[...]
> @@ -224,7 +208,7 @@ $ SIGBUS
>  $ SIGSEGV
>  11 Illegaler Speicherzugriff
>  $ SIGSYS
> -12 Ung�ltiger Systemaufruf
> +12 Ung�ltiger Speicherzugriff

The new translation is plain wrong (it seems to be c&p from SIGSEGV 
above). The old translation was correct.

	Christoph

From owner-svn-src-head@FreeBSD.ORG  Sat Mar 21 11:24:04 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0486B1065677;
	Sat, 21 Mar 2009 11:24:03 +0000 (UTC)
	(envelope-from gabor@FreeBSD.org)
Received: from server.mypc.hu (server.mypc.hu [87.229.73.95])
	by mx1.freebsd.org (Postfix) with ESMTP id 98A9E8FC13;
	Sat, 21 Mar 2009 11:24:03 +0000 (UTC)
	(envelope-from gabor@FreeBSD.org)
Received: from localhost (localhost [127.0.0.1])
	by server.mypc.hu (Postfix) with ESMTP id A8CAC14D875C;
	Sat, 21 Mar 2009 12:24:02 +0100 (CET)
X-Virus-Scanned: amavisd-new at t-hosting.hu
Received: from server.mypc.hu ([127.0.0.1])
	by localhost (server.mypc.hu [127.0.0.1]) (amavisd-new, port 10024)
	with LMTP id KETdBDFcCtdr; Sat, 21 Mar 2009 12:24:01 +0100 (CET)
Received: from [192.168.1.105] (unknown [80.98.231.64])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by server.mypc.hu (Postfix) with ESMTPSA id F03F614D8038;
	Sat, 21 Mar 2009 12:24:00 +0100 (CET)
Message-ID: <49C4CE4D.6000000@FreeBSD.org>
Date: Sat, 21 Mar 2009 12:23:57 +0100
From: =?UTF-8?B?R8OhYm9yIEvDtnZlc2TDoW4=?= 
User-Agent: Thunderbird 2.0.0.21 (Windows/20090302)
MIME-Version: 1.0
To: Christoph Mallon 
References: <200903161633.n2GGX966065825@svn.freebsd.org>
	<49C4CCC1.6010704@gmx.de>
In-Reply-To: <49C4CCC1.6010704@gmx.de>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, Christian Brueffer 
Subject: Re: svn commit: r189883 - head/lib/libc/nls
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 21 Mar 2009 11:24:07 -0000


>
> The new translation is plain wrong (it seems to be c&p from SIGSEGV 
> above). The old translation was correct.
I'm sorry if I made things worse, these changes was based on brueffer@'s 
PR. I can't comment on the language part because - unfortunately - I 
almost completely forgot German since the grammar school. I CC'd 
Christian, I hope you can work this out with him. He is a committer, so 
he can make changes to the catalog.

Regards,

-- 
Gabor Kovesdan
FreeBSD Volunteer

EMAIL: gabor@FreeBSD.org .:|:. gabor@kovesdan.org
WEB:   http://people.FreeBSD.org/~gabor .:|:. http://kovesdan.org


From owner-svn-src-head@FreeBSD.ORG  Sat Mar 21 13:03:56 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3BB931065672;
	Sat, 21 Mar 2009 13:03:56 +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 A8FF28FC13;
	Sat, 21 Mar 2009 13:03:55 +0000 (UTC)
	(envelope-from marius@alchemy.franken.de)
Received: from alchemy.franken.de (localhost [127.0.0.1])
	by alchemy.franken.de (8.14.3/8.14.3/ALCHEMY.FRANKEN.DE) with ESMTP id
	n2LD3Whl061548; Sat, 21 Mar 2009 14:03:54 +0100 (CET)
	(envelope-from marius@alchemy.franken.de)
Received: (from marius@localhost)
	by alchemy.franken.de (8.14.3/8.14.3/Submit) id n2LD3Whr061547;
	Sat, 21 Mar 2009 14:03:32 +0100 (CET) (envelope-from marius)
Date: Sat, 21 Mar 2009 14:03:32 +0100
From: Marius Strobl 
To: Christoph Mallon 
Message-ID: <20090321130332.GD67783@alchemy.franken.de>
References: <200903192029.n2JKTN54074599@svn.freebsd.org>
	<49C4C974.5050209@gmx.de>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <49C4C974.5050209@gmx.de>
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: r190098 - in head/sys/sparc64: fhc sparc64
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 21 Mar 2009 13:03:56 -0000

On Sat, Mar 21, 2009 at 12:03:16PM +0100, Christoph Mallon wrote:
> Hi Marius,
> 
> I think this change makes the code worse from point of the compiler and 
> for people reading it. Please read my explanation below.
> 
> 
> Marius Strobl schrieb:
> >Author: marius
> >Date: Thu Mar 19 20:29:23 2009
> >New Revision: 190098
> >URL: http://svn.freebsd.org/changeset/base/190098
> >
> >Log:
> >  - Failing to register as interrupt controller during attach shouldn't
> >    be fatal so just inform about this instead of panicing.
> >  - Sort device methods.
> >  - Take advantage of KOBJMETHOD_END.
> >  - Remove some redundant variables.
> >
> >Modified:
> >  head/sys/sparc64/fhc/fhc.c
> >  head/sys/sparc64/sparc64/upa.c
> >
> >Modified: head/sys/sparc64/fhc/fhc.c
> >==============================================================================
> >--- head/sys/sparc64/fhc/fhc.c	Thu Mar 19 20:24:30 2009 (r190097)
> >+++ head/sys/sparc64/fhc/fhc.c	Thu Mar 19 20:29:23 2009 (r190098)
> [...]
> >@@ -165,9 +165,7 @@ fhc_attach(device_t dev)
> > 	int central;
> > 	int error;
> > 	int i;
> >-	int nintr;
> >-	int nreg;
> >-	int rid;
> >+	int j;
> > 
> > 	sc = device_get_softc(dev);
> > 	node = ofw_bus_get_node(dev);
> >@@ -177,9 +175,9 @@ fhc_attach(device_t dev)
> > 		central = 1;
> > 
> > 	for (i = 0; i < FHC_NREG; i++) {
> >-		rid = i;
> >+		j = i;
> > 		sc->sc_memres[i] = bus_alloc_resource_any(dev, 
> > 		SYS_RES_MEMORY,
> >-		    &rid, RF_ACTIVE);
> >+		    &j, RF_ACTIVE);
> > 		if (sc->sc_memres[i] == NULL) {
> > 			device_printf(dev, "cannot allocate resource %d\n", 
> > 			i);
> > 			error = ENXIO;
> [...]
> >@@ -259,11 +258,13 @@ fhc_attach(device_t dev)
> > 			 * the IGN and the IGN is constant for all devices
> > 			 * on that FireHose controller.
> > 			 */
> >-			if (intr_controller_register(INTMAP_VEC(sc->sc_ign,
> >+			j = intr_controller_register(INTMAP_VEC(sc->sc_ign,
> > 			    INTINO(bus_read_4(fica->fica_memres, FHC_IMAP))),
> >-			    &fhc_ic, fica) != 0)
> >-				panic("%s: could not register interrupt "
> >-				    "controller for map %d", __func__, i);
> >+			    &fhc_ic, fica);
> >+			if (j != 0)
> >+				device_printf(dev, "could not register "
> >+				    "interrupt controller for map %d (%d)\n",
> >+				    i, j);
> > 		}
> > 	} else {
> > 		snprintf(ledname, sizeof(ledname), "board%d", board);
> >@@ -276,9 +277,9 @@ fhc_attach(device_t dev)
> > 			free(fdi, M_DEVBUF);
> > 			continue;
> > 		}
> >-		nreg = OF_getprop_alloc(child, "reg", sizeof(*reg),
> >+		i = OF_getprop_alloc(child, "reg", sizeof(*reg),
> > 		    (void **)®);
> >-		if (nreg == -1) {
> >+		if (i == -1) {
> > 			device_printf(dev, "<%s>: incomplete\n",
> > 			    fdi->fdi_obdinfo.obd_name);
> > 			ofw_bus_gen_destroy_devinfo(&fdi->fdi_obdinfo);
> >@@ -286,19 +287,19 @@ fhc_attach(device_t dev)
> > 			continue;
> > 		}
> > 		resource_list_init(&fdi->fdi_rl);
> >-		for (i = 0; i < nreg; i++)
> >-			resource_list_add(&fdi->fdi_rl, SYS_RES_MEMORY, i,
> >-			    reg[i].sbr_offset, reg[i].sbr_offset +
> >-			    reg[i].sbr_size, reg[i].sbr_size);
> >+		for (j = 0; j < i; j++)
> >+			resource_list_add(&fdi->fdi_rl, SYS_RES_MEMORY, j,
> >+			    reg[j].sbr_offset, reg[j].sbr_offset +
> >+			    reg[j].sbr_size, reg[j].sbr_size);
> > 		free(reg, M_OFWPROP);
> > 		if (central == 1) {
> >-			nintr = OF_getprop_alloc(child, "interrupts",
> >+			i = OF_getprop_alloc(child, "interrupts",
> > 			    sizeof(*intr), (void **)&intr);
> >-			if (nintr != -1) {
> >-				for (i = 0; i < nintr; i++) {
> >-					iv = INTMAP_VEC(sc->sc_ign, intr[i]);
> >+			if (i != -1) {
> >+				for (j = 0; j < i; j++) {
> >+					iv = INTMAP_VEC(sc->sc_ign, intr[j]);
> > 					resource_list_add(&fdi->fdi_rl,
> >-					    SYS_RES_IRQ, i, iv, iv, 1);
> >+					    SYS_RES_IRQ, j, iv, iv, 1);
> > 				}
> > 				free(intr, M_OFWPROP);
> > 			}
> >
> 
> These variables are not redundant. Before the variables had clear names 
> (like rid or nregs, nintr), now they are called i and j, which carries 
> no semantics at all.

IMO the code is simple enough so that the variable names do not
need to carry semantics for clearity, the fact that just two
reused temporary variables are enough for the whole function
underlines this.

> Also j has its address taken AND you use this variable in several 
> different contexts (replacement for rid, later as loop counter). This 
> makes it impossible[0] for the compiler to do many useful optimisations 
> like keeping the value of the variable in a register!

It's good to know that doing so may costs performance in general,
as this is an bus attach function performance totally isn't an
issue here though.

> More local variables cost nothing - especially no stack space, if this 
> is your concern - on any somewhat modern compiler. Use as many of them 
> as you want for code clarity. Do not reuse variables, whose address is 
> taken, because often it is impossible for the compiler to do any 
> optimisations.

My motivation for using fewer local variables is that style(9)
mandates to not define variables in nested scope and to sort
them, so reusing them reduces code churn in the long term.
IIRC you said elsewhere that you're unhappy with at least the
former rule but you should work on getting style(9) then.

> 
> Here's a very small example:
> 
> #include 
> void f(int*);
> void g(void)
> {
>   int i;
>   f(&i); // The address of i escapes here
>   for (i = 0; i != 10; ++i)
>     printf("%d", i);
> }
> 
> The generated code:
> g:
>         subl    $28, %esp
>         leal    24(%esp), %eax // The address of i
>         movl    %eax, (%esp)
>         call    f
>         xorl    %eax, %eax
>         movl    $0, 24(%esp) // write 0 to the spill slot of i
>         .p2align 4,,7
> .L2:
>         movl    %eax, 4(%esp)
>         movl    $.LC0, (%esp)
>         call    printf
>         movl    24(%esp), %eax // i is reloaded here
>         addl    $1, %eax
>         cmpl    $10, %eax
>         movl    %eax, 24(%esp) // i is spilled here
>         jne     .L2
>         addl    $28, %esp
>         ret
> 
> 
> Now lets pass a new variable int j; to f(&j), but still use i for the loop:
> g:
>         pushl   %ebx
>         xorl    %ebx, %ebx // initialise i with 0
>         subl    $24, %esp
>         leal    20(%esp), %eax // The address of j
>         movl    %eax, (%esp)
>         call    f
>         .p2align 4,,7
> .L2:
> 	/* i is held in register %ebx in the whole loop, no spills, no
> 	 * reloads */
>         movl    %ebx, 4(%esp)
>         addl    $1, %ebx
>         movl    $.LC0, (%esp)
>         call    printf
>         cmpl    $10, %ebx
>         jne     .L2
>         addl    $24, %esp
>         popl    %ebx
>         ret
> 
> In short: A variable whose address is not taken is A Good Thing(TM), 
> because the compiler knows "everything" about it and can do many useful 
> optimisations. You can have any number of non-aliased (i.e. address not 
> taken) variables. They cost nothing. If a value carries a specific 
> meaning, use a new local variable with a useful name, this improves the 
> clarity for people who read and try to understand the code.
> The old rule "use as few as possible local variables, because they cost 
> stack space" is dead since many, many years.
> 
> Sorry for the long essay, but I deem it important to tell how compilers 
> work these day.
> 
> Regards
> 	Christoph
> 
> 
> [0] It's impossible because the address is passed to a function, whose 
> body is not known here, so the compiler has to assume the worst, i.e. 
> the address of the variable is stored to a global pointer and the value 
> can be modified at any time by any other function call with unknown body 
> and so it has to reload it in most places where it is used.

Marius


From owner-svn-src-head@FreeBSD.ORG  Sat Mar 21 13:42:13 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E29CD106566C;
	Sat, 21 Mar 2009 13:42:13 +0000 (UTC)
	(envelope-from bms@incunabulum.net)
Received: from out2.smtp.messagingengine.com (out2.smtp.messagingengine.com
	[66.111.4.26]) by mx1.freebsd.org (Postfix) with ESMTP id A8BA18FC0A;
	Sat, 21 Mar 2009 13:42:13 +0000 (UTC)
	(envelope-from bms@incunabulum.net)
Received: from compute2.internal (compute2.internal [10.202.2.42])
	by out1.messagingengine.com (Postfix) with ESMTP id 20A682F8128;
	Sat, 21 Mar 2009 09:42:13 -0400 (EDT)
Received: from heartbeat2.messagingengine.com ([10.202.2.161])
	by compute2.internal (MEProxy); Sat, 21 Mar 2009 09:42:13 -0400
X-Sasl-enc: +CQcwctGUd4LFmX7irU64dwjHpcRLDEA047tIM2f2Q5F 1237642932
Received: from anglepoise.lon.incunabulum.net
	(82-35-112-254.cable.ubr07.dals.blueyonder.co.uk [82.35.112.254])
	by mail.messagingengine.com (Postfix) with ESMTPSA id 1FAE64D4FD;
	Sat, 21 Mar 2009 09:42:12 -0400 (EDT)
Message-ID: <49C4EEB2.4080507@incunabulum.net>
Date: Sat, 21 Mar 2009 13:42:10 +0000
From: Bruce Simpson 
User-Agent: Thunderbird 2.0.0.19 (X11/20090125)
MIME-Version: 1.0
To: Robert Watson 
References: <200903142010.n2EKAESF006945@svn.freebsd.org>
	<20090320140015.GA17645@hub.freebsd.org>
	<20090320153405.GA62675@zim.MIT.EDU> <49C3BCD4.4030605@freebsd.org>
	<1237567495.1993.2.camel@localhost> <49C3D518.6070105@freebsd.org>
	<1237573175.1993.19.camel@localhost>
	
In-Reply-To: 
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Cc: src-committers@freebsd.org, svn-src-all@freebsd.org,
	Vasil Dimov , Sam Leffler ,
	svn-src-head@freebsd.org, Coleman Kane 
Subject: Re: svn commit: r189828 - in head: include 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, 21 Mar 2009 13:42:14 -0000

Robert Watson wrote:
> On Fri, 20 Mar 2009, Coleman Kane wrote:
>
>> I've found that many of the GNU apps are notorious for this. I really 
>> can't say that I know why libassuan or gnupg explicitly require GNU 
>> pth, rather than first attempting to use POSIX pthread API. Their 
>> configure scripts both want to search for and run pth-config, and 
>> fail to enable some sort of threaded features if it doesn't exist. I 
>> already tried removing pth stuff from both port Makefiles to see what 
>> would happen. I didn't spend much time on it after I figured out that 
>> devel/pth would just work if I removed the signal.h include.
>>
>> I am guessing that some non-standard extensions which GNU pth 
>> provides are not provided by the normal POSIX spec.
>>
>> In fact, libassuan just goes ahead and uses a bunch of pth_* 
>> overrides for dealing with them in a thread-safe manner (waitpid, 
>> read, write, select, usleep).
>
> Historically, pthreads implementations were highly variable in 
> quality, completeness, etc.  It wouldn't surprise me if the 
> persistence of applications linking against pth isn't, in part, a 
> response to that (now-historic) situation.

No, this isn't the only reason. There are a few issues with threading 
and fork() -- other implementations support forking and rethreading 
processes, something which bends the POSIX rules (it is not expressly 
forbidden by them), but ours hasn't. This was causing some of the Python 
regression tests to fail for 'multiprocessing' and 'threading'.

Since POSIX semaphores appear to be fixed, however, we should be able to 
get away with building Python on FreeBSD with them natively. kib@ has 
committed the rtld fix which makes this possible in 8-CURRENT. For now, 
ie until such fixes can be MFCed, I've committed support to the 
lang/python26 port to enable it to be built against GNU Pth.

cheers
BMS

From owner-svn-src-head@FreeBSD.ORG  Sat Mar 21 15:46:37 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id EE25D106564A;
	Sat, 21 Mar 2009 15:46:37 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C1B598FC18;
	Sat, 21 Mar 2009 15:46:37 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2LFkbb2039750;
	Sat, 21 Mar 2009 15:46:37 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2LFkbps039749;
	Sat, 21 Mar 2009 15:46:37 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <200903211546.n2LFkbps039749@svn.freebsd.org>
From: Rui Paulo 
Date: Sat, 21 Mar 2009 15:46:37 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190201 - head/contrib/tcpdump
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 21 Mar 2009 15:46:38 -0000

Author: rpaulo
Date: Sat Mar 21 15:46:37 2009
New Revision: 190201
URL: http://svn.freebsd.org/changeset/base/190201

Log:
  Exclude list for tcpdump imports.

Added:
  head/contrib/tcpdump/FREEBSD-Xlist

Added: head/contrib/tcpdump/FREEBSD-Xlist
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/contrib/tcpdump/FREEBSD-Xlist	Sat Mar 21 15:46:37 2009	(r190201)
@@ -0,0 +1,3 @@
+$FreeBSD$
+*/Readme.win32
+*/win32

From owner-svn-src-head@FreeBSD.ORG  Sat Mar 21 16:08:42 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 64D371065674;
	Sat, 21 Mar 2009 16:08:42 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 37C598FC22;
	Sat, 21 Mar 2009 16:08:42 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2LG8eoM040221;
	Sat, 21 Mar 2009 16:08:40 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2LG8eaK040220;
	Sat, 21 Mar 2009 16:08:40 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <200903211608.n2LG8eaK040220@svn.freebsd.org>
From: Rui Paulo 
Date: Sat, 21 Mar 2009 16:08:40 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190202 - head/contrib/tcpdump
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 21 Mar 2009 16:08:42 -0000

Author: rpaulo
Date: Sat Mar 21 16:08:40 2009
New Revision: 190202
URL: http://svn.freebsd.org/changeset/base/190202

Log:
  Fix a path.

Modified:
  head/contrib/tcpdump/FREEBSD-Xlist

Modified: head/contrib/tcpdump/FREEBSD-Xlist
==============================================================================
--- head/contrib/tcpdump/FREEBSD-Xlist	Sat Mar 21 15:46:37 2009	(r190201)
+++ head/contrib/tcpdump/FREEBSD-Xlist	Sat Mar 21 16:08:40 2009	(r190202)
@@ -1,3 +1,3 @@
 $FreeBSD$
-*/Readme.win32
+Readme.win32
 */win32

From owner-svn-src-head@FreeBSD.ORG  Sat Mar 21 17:01:29 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E03DC106566B;
	Sat, 21 Mar 2009 17:01:29 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id B32F18FC17;
	Sat, 21 Mar 2009 17:01:29 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2LH1Tcu041483;
	Sat, 21 Mar 2009 17:01:29 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2LH1Tvu041482;
	Sat, 21 Mar 2009 17:01:29 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <200903211701.n2LH1Tvu041482@svn.freebsd.org>
From: Rui Paulo 
Date: Sat, 21 Mar 2009 17:01: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: r190205 - head/contrib/tcpdump
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 21 Mar 2009 17:01:34 -0000

Author: rpaulo
Date: Sat Mar 21 17:01:29 2009
New Revision: 190205
URL: http://svn.freebsd.org/changeset/base/190205

Log:
  Fix incorrect path of the svn:mergeinfo property.

Modified:
  head/contrib/tcpdump/   (props changed)

From owner-svn-src-head@FreeBSD.ORG  Sat Mar 21 17:09:01 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 37114106566C;
	Sat, 21 Mar 2009 17:09:01 +0000 (UTC) (envelope-from gnn@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 243078FC13;
	Sat, 21 Mar 2009 17:09:01 +0000 (UTC) (envelope-from gnn@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2LH90G2041678;
	Sat, 21 Mar 2009 17:09:00 GMT (envelope-from gnn@svn.freebsd.org)
Received: (from gnn@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2LH90li041677;
	Sat, 21 Mar 2009 17:09:00 GMT (envelope-from gnn@svn.freebsd.org)
Message-Id: <200903211709.n2LH90li041677@svn.freebsd.org>
From: "George V. Neville-Neil" 
Date: Sat, 21 Mar 2009 17:09: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: r190206 - head/sys/dev/cxgb
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 21 Mar 2009 17:09:01 -0000

Author: gnn
Date: Sat Mar 21 17:09:00 2009
New Revision: 190206
URL: http://svn.freebsd.org/changeset/base/190206

Log:
  Fix a bug in the recent update to the Chelsio driver.
  The tick routine was not being restarted in the init_locked routine
  which could resulted in loss of carrier when updating the MTU.
  
  Submitted by:	Navdeep Parhar at Chelsio
  MFC after:	3 weeks

Modified:
  head/sys/dev/cxgb/cxgb_main.c

Modified: head/sys/dev/cxgb/cxgb_main.c
==============================================================================
--- head/sys/dev/cxgb/cxgb_main.c	Sat Mar 21 17:01:29 2009	(r190205)
+++ head/sys/dev/cxgb/cxgb_main.c	Sat Mar 21 17:09:00 2009	(r190206)
@@ -1912,6 +1912,7 @@ cxgb_init_locked(struct port_info *p)
 	device_printf(sc->dev, "enabling interrupts on port=%d\n", p->port_id);
 	t3_port_intr_enable(sc, p->port_id);
 
+ 	callout_reset(&sc->cxgb_tick_ch, CXGB_TICKS(sc), cxgb_tick, sc);
 	t3_sge_reset_adapter(sc);
 
 	ifp->if_drv_flags |= IFF_DRV_RUNNING;

From owner-svn-src-head@FreeBSD.ORG  Sat Mar 21 18:30:25 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DCAEC106564A;
	Sat, 21 Mar 2009 18:30:25 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C72DA8FC0A;
	Sat, 21 Mar 2009 18:30:25 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2LIUPs2043448;
	Sat, 21 Mar 2009 18:30:25 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2LIUPXJ043439;
	Sat, 21 Mar 2009 18:30:25 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <200903211830.n2LIUPXJ043439@svn.freebsd.org>
From: Rui Paulo 
Date: Sat, 21 Mar 2009 18: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: r190207 - in head/contrib/tcpdump: . lbl missing tests
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 21 Mar 2009 18:30:26 -0000

Author: rpaulo
Date: Sat Mar 21 18:30:25 2009
New Revision: 190207
URL: http://svn.freebsd.org/changeset/base/190207

Log:
  Merge tcpdump 4.0.0 from the vendor branch.

Added:
  head/contrib/tcpdump/INSTALL.txt
     - copied unchanged from r190206, vendor/tcpdump/dist/INSTALL.txt
  head/contrib/tcpdump/checksum.c
     - copied unchanged from r190206, vendor/tcpdump/dist/checksum.c
  head/contrib/tcpdump/print-bt.c
     - copied unchanged from r190206, vendor/tcpdump/dist/print-bt.c
  head/contrib/tcpdump/print-cfm.c
     - copied unchanged from r190206, vendor/tcpdump/dist/print-cfm.c
  head/contrib/tcpdump/print-dtp.c
     - copied unchanged from r190206, vendor/tcpdump/dist/print-dtp.c
  head/contrib/tcpdump/print-lldp.c
     - copied unchanged from r190206, vendor/tcpdump/dist/print-lldp.c
  head/contrib/tcpdump/print-lwapp.c
     - copied unchanged from r190206, vendor/tcpdump/dist/print-lwapp.c
  head/contrib/tcpdump/print-mpcp.c
     - copied unchanged from r190206, vendor/tcpdump/dist/print-mpcp.c
  head/contrib/tcpdump/print-rrcp.c
     - copied unchanged from r190206, vendor/tcpdump/dist/print-rrcp.c
  head/contrib/tcpdump/print-sflow.c
     - copied unchanged from r190206, vendor/tcpdump/dist/print-sflow.c
  head/contrib/tcpdump/print-udld.c
     - copied unchanged from r190206, vendor/tcpdump/dist/print-udld.c
  head/contrib/tcpdump/print-vqp.c
     - copied unchanged from r190206, vendor/tcpdump/dist/print-vqp.c
  head/contrib/tcpdump/print-vtp.c
     - copied unchanged from r190206, vendor/tcpdump/dist/print-vtp.c
Deleted:
  head/contrib/tcpdump/FILES
  head/contrib/tcpdump/INSTALL
  head/contrib/tcpdump/Makefile-devel-adds
  head/contrib/tcpdump/PLATFORMS
  head/contrib/tcpdump/Readme.Win32
  head/contrib/tcpdump/TODO
  head/contrib/tcpdump/tests/
Modified:
  head/contrib/tcpdump/   (props changed)
  head/contrib/tcpdump/CHANGES
  head/contrib/tcpdump/CREDITS
  head/contrib/tcpdump/Makefile.in
  head/contrib/tcpdump/README
  head/contrib/tcpdump/VERSION
  head/contrib/tcpdump/addrtoname.c
  head/contrib/tcpdump/addrtoname.h
  head/contrib/tcpdump/af.c
  head/contrib/tcpdump/af.h
  head/contrib/tcpdump/aodv.h
  head/contrib/tcpdump/appletalk.h
  head/contrib/tcpdump/arcnet.h
  head/contrib/tcpdump/atm.h
  head/contrib/tcpdump/atmuni31.h
  head/contrib/tcpdump/bgp.h
  head/contrib/tcpdump/bootp.h
  head/contrib/tcpdump/bpf_dump.c
  head/contrib/tcpdump/chdlc.h
  head/contrib/tcpdump/config.h.in
  head/contrib/tcpdump/configure
  head/contrib/tcpdump/configure.in
  head/contrib/tcpdump/dccp.h
  head/contrib/tcpdump/decnet.h
  head/contrib/tcpdump/enc.h
  head/contrib/tcpdump/ether.h
  head/contrib/tcpdump/ethertype.h
  head/contrib/tcpdump/extract.h
  head/contrib/tcpdump/fddi.h
  head/contrib/tcpdump/gmpls.c
  head/contrib/tcpdump/gmpls.h
  head/contrib/tcpdump/gmt2local.c
  head/contrib/tcpdump/gmt2local.h
  head/contrib/tcpdump/icmp6.h
  head/contrib/tcpdump/ieee802_11.h
  head/contrib/tcpdump/ieee802_11_radio.h
  head/contrib/tcpdump/igrp.h
  head/contrib/tcpdump/interface.h
  head/contrib/tcpdump/ip.h
  head/contrib/tcpdump/ip6.h
  head/contrib/tcpdump/ipfc.h
  head/contrib/tcpdump/ipproto.c
  head/contrib/tcpdump/ipproto.h
  head/contrib/tcpdump/ipsec_doi.h
  head/contrib/tcpdump/ipx.h
  head/contrib/tcpdump/isakmp.h
  head/contrib/tcpdump/l2tp.h
  head/contrib/tcpdump/l2vpn.c
  head/contrib/tcpdump/l2vpn.h
  head/contrib/tcpdump/lane.h
  head/contrib/tcpdump/lbl/os-osf4.h
  head/contrib/tcpdump/lbl/os-solaris2.h
  head/contrib/tcpdump/lbl/os-sunos4.h
  head/contrib/tcpdump/lbl/os-ultrix4.h
  head/contrib/tcpdump/llc.h
  head/contrib/tcpdump/machdep.c
  head/contrib/tcpdump/machdep.h
  head/contrib/tcpdump/makemib
  head/contrib/tcpdump/missing/addrinfo.h
  head/contrib/tcpdump/missing/datalinks.c
  head/contrib/tcpdump/missing/dlnames.c
  head/contrib/tcpdump/missing/getaddrinfo.c
  head/contrib/tcpdump/missing/getnameinfo.c
  head/contrib/tcpdump/missing/inet_aton.c
  head/contrib/tcpdump/missing/inet_ntop.c
  head/contrib/tcpdump/missing/inet_pton.c
  head/contrib/tcpdump/missing/snprintf.c
  head/contrib/tcpdump/missing/strdup.c
  head/contrib/tcpdump/missing/strlcat.c
  head/contrib/tcpdump/missing/strlcpy.c
  head/contrib/tcpdump/missing/strsep.c
  head/contrib/tcpdump/mpls.h
  head/contrib/tcpdump/nameser.h
  head/contrib/tcpdump/netbios.h
  head/contrib/tcpdump/netdissect.h
  head/contrib/tcpdump/nfs.h
  head/contrib/tcpdump/nfsfh.h
  head/contrib/tcpdump/nlpid.c
  head/contrib/tcpdump/nlpid.h
  head/contrib/tcpdump/ntp.h
  head/contrib/tcpdump/oakley.h
  head/contrib/tcpdump/ospf.h
  head/contrib/tcpdump/ospf6.h
  head/contrib/tcpdump/oui.c
  head/contrib/tcpdump/oui.h
  head/contrib/tcpdump/parsenfsfh.c
  head/contrib/tcpdump/pcap-missing.h
  head/contrib/tcpdump/pcap_dump_ftell.c
  head/contrib/tcpdump/pmap_prot.h
  head/contrib/tcpdump/ppp.h
  head/contrib/tcpdump/print-802_11.c
  head/contrib/tcpdump/print-ah.c
  head/contrib/tcpdump/print-aodv.c
  head/contrib/tcpdump/print-ap1394.c
  head/contrib/tcpdump/print-arcnet.c
  head/contrib/tcpdump/print-arp.c
  head/contrib/tcpdump/print-ascii.c
  head/contrib/tcpdump/print-atalk.c
  head/contrib/tcpdump/print-atm.c
  head/contrib/tcpdump/print-beep.c
  head/contrib/tcpdump/print-bfd.c
  head/contrib/tcpdump/print-bgp.c
  head/contrib/tcpdump/print-bootp.c
  head/contrib/tcpdump/print-cdp.c
  head/contrib/tcpdump/print-chdlc.c
  head/contrib/tcpdump/print-cip.c
  head/contrib/tcpdump/print-cnfp.c
  head/contrib/tcpdump/print-dccp.c
  head/contrib/tcpdump/print-decnet.c
  head/contrib/tcpdump/print-dhcp6.c
  head/contrib/tcpdump/print-domain.c
  head/contrib/tcpdump/print-dvmrp.c
  head/contrib/tcpdump/print-eap.c
  head/contrib/tcpdump/print-egp.c
  head/contrib/tcpdump/print-eigrp.c
  head/contrib/tcpdump/print-enc.c
  head/contrib/tcpdump/print-esp.c
  head/contrib/tcpdump/print-ether.c
  head/contrib/tcpdump/print-fddi.c
  head/contrib/tcpdump/print-fr.c
  head/contrib/tcpdump/print-frag6.c
  head/contrib/tcpdump/print-gre.c
  head/contrib/tcpdump/print-hsrp.c
  head/contrib/tcpdump/print-icmp.c
  head/contrib/tcpdump/print-icmp6.c
  head/contrib/tcpdump/print-igmp.c
  head/contrib/tcpdump/print-igrp.c
  head/contrib/tcpdump/print-ip.c
  head/contrib/tcpdump/print-ip6.c
  head/contrib/tcpdump/print-ip6opts.c
  head/contrib/tcpdump/print-ipcomp.c
  head/contrib/tcpdump/print-ipfc.c
  head/contrib/tcpdump/print-ipx.c
  head/contrib/tcpdump/print-isakmp.c
  head/contrib/tcpdump/print-isoclns.c
  head/contrib/tcpdump/print-juniper.c
  head/contrib/tcpdump/print-krb.c
  head/contrib/tcpdump/print-l2tp.c
  head/contrib/tcpdump/print-lane.c
  head/contrib/tcpdump/print-ldp.c
  head/contrib/tcpdump/print-llc.c
  head/contrib/tcpdump/print-lmp.c
  head/contrib/tcpdump/print-lspping.c
  head/contrib/tcpdump/print-lwres.c
  head/contrib/tcpdump/print-mobile.c
  head/contrib/tcpdump/print-mobility.c
  head/contrib/tcpdump/print-mpls.c
  head/contrib/tcpdump/print-msdp.c
  head/contrib/tcpdump/print-netbios.c
  head/contrib/tcpdump/print-nfs.c
  head/contrib/tcpdump/print-ntp.c
  head/contrib/tcpdump/print-null.c
  head/contrib/tcpdump/print-ospf.c
  head/contrib/tcpdump/print-ospf6.c
  head/contrib/tcpdump/print-pflog.c
  head/contrib/tcpdump/print-pgm.c
  head/contrib/tcpdump/print-pim.c
  head/contrib/tcpdump/print-ppp.c
  head/contrib/tcpdump/print-pppoe.c
  head/contrib/tcpdump/print-pptp.c
  head/contrib/tcpdump/print-radius.c
  head/contrib/tcpdump/print-raw.c
  head/contrib/tcpdump/print-rip.c
  head/contrib/tcpdump/print-ripng.c
  head/contrib/tcpdump/print-rsvp.c
  head/contrib/tcpdump/print-rt6.c
  head/contrib/tcpdump/print-rx.c
  head/contrib/tcpdump/print-sctp.c
  head/contrib/tcpdump/print-sip.c
  head/contrib/tcpdump/print-sl.c
  head/contrib/tcpdump/print-sll.c
  head/contrib/tcpdump/print-slow.c
  head/contrib/tcpdump/print-smb.c
  head/contrib/tcpdump/print-snmp.c
  head/contrib/tcpdump/print-stp.c
  head/contrib/tcpdump/print-sunatm.c
  head/contrib/tcpdump/print-sunrpc.c
  head/contrib/tcpdump/print-symantec.c
  head/contrib/tcpdump/print-syslog.c
  head/contrib/tcpdump/print-tcp.c
  head/contrib/tcpdump/print-telnet.c
  head/contrib/tcpdump/print-tftp.c
  head/contrib/tcpdump/print-timed.c
  head/contrib/tcpdump/print-token.c
  head/contrib/tcpdump/print-udp.c
  head/contrib/tcpdump/print-vjc.c
  head/contrib/tcpdump/print-vrrp.c
  head/contrib/tcpdump/print-wb.c
  head/contrib/tcpdump/print-zephyr.c
  head/contrib/tcpdump/route6d.h
  head/contrib/tcpdump/rpc_auth.h
  head/contrib/tcpdump/rpc_msg.h
  head/contrib/tcpdump/rx.h
  head/contrib/tcpdump/sctpConstants.h
  head/contrib/tcpdump/sctpHeader.h
  head/contrib/tcpdump/setsignal.c
  head/contrib/tcpdump/setsignal.h
  head/contrib/tcpdump/slcompress.h
  head/contrib/tcpdump/slip.h
  head/contrib/tcpdump/sll.h
  head/contrib/tcpdump/smb.h
  head/contrib/tcpdump/smbutil.c
  head/contrib/tcpdump/strcasecmp.c
  head/contrib/tcpdump/tcp.h
  head/contrib/tcpdump/tcpdump-stdinc.h
  head/contrib/tcpdump/tcpdump.1
  head/contrib/tcpdump/tcpdump.c
  head/contrib/tcpdump/telnet.h
  head/contrib/tcpdump/tftp.h
  head/contrib/tcpdump/timed.h
  head/contrib/tcpdump/token.h
  head/contrib/tcpdump/udp.h
  head/contrib/tcpdump/util.c
  head/contrib/tcpdump/vfprintf.c

Modified: head/contrib/tcpdump/CHANGES
==============================================================================
--- head/contrib/tcpdump/CHANGES	Sat Mar 21 17:09:00 2009	(r190206)
+++ head/contrib/tcpdump/CHANGES	Sat Mar 21 18:30:25 2009	(r190207)
@@ -1,20 +1,36 @@
-$Header: /tcpdump/master/tcpdump/CHANGES,v 1.87.2.17 2007/09/13 13:39:44 ken Exp $
+$Header: /tcpdump/master/tcpdump/CHANGES,v 1.98.2.2 2008-10-15 23:26:30 ken Exp $
 
-Mon.	September 10, 2007.  ken@xelerance.com.  Summary for 0.9.8 tcpdump release
-	Rework ARP printer
-	Rework OSPFv3 printer
-	Add support for Frame-Relay ARP
-	Decode DHCP Option 121 (RFC 3442 Classless Static Route)
-	Decode DHCP Option 249 (MS Classless Static Route) the same as Option 121
-	TLV: Add support for Juniper .pcap extensions
-	Print EGP header in new-world-order style
-	Converted print-isakmp.c to NETDISSECT
-	Moved AF specific stuff into af.h
-	Test subsystem now table driven, and saves outputs and diffs to one place
+Mon.    October 27, 2008.  ken@netfunctional.ca.  Summary for 4.0.0 tcpdump release
+        Add support for Bluetooth Sniffing
+        Add support for Realtek Remote Control Protocol (openrrcp.org.ru)
+        Add support for 802.11 AVS
+        Add support for SMB over TCP
+        Add support for 4 byte BGP AS printing
+        Add support for compiling on case-insensitive file systems
+        Add support for ikev2 printing
+        Update support for decoding AFS
+        Update DHCPv6 printer
+        Use newer libpcap API's (allows -B option on all platforms)
+        Add -I to turn on monitor mode
+        Bugfixes in lldp, lspping, dccp, ESP, NFS printers
+        Cleanup unused files and various cruft
+
+Mon.    September 10, 2007.  ken@xelerance.com.  Summary for 3.9.8 tcpdump release
+        Rework ARP printer
+        Rework OSPFv3 printer
+        Add support for Frame-Relay ARP
+        Decode DHCP Option 121 (RFC 3442 Classless Static Route)
+        Decode DHCP Option 249 (MS Classless Static Route) the same as Option 121
+        TLV: Add support for Juniper .pcap extensions
+        Print EGP header in new-world-order style
+        Converted print-isakmp.c to NETDISSECT
+        Moved AF specific stuff into af.h
+        Test subsystem now table driven, and saves outputs and diffs to one place
         Require  for pf definitions - allows reading of pflog formatted 
          libpcap files on an OS other than where the file was generated
 
-Wed.	July 23, 2007.  mcr@xelerance.com.  Summary for 0.9.7 tcpdump release
+
+Wed.	July 23, 2007.  mcr@xelerance.com.  Summary for 3.9.7 libpcap release
 
     	NFS: Print unsigned values as such. 
 	RX: parse safely.

Modified: head/contrib/tcpdump/CREDITS
==============================================================================
--- head/contrib/tcpdump/CREDITS	Sat Mar 21 17:09:00 2009	(r190206)
+++ head/contrib/tcpdump/CREDITS	Sat Mar 21 18:30:25 2009	(r190207)
@@ -1,147 +1,165 @@
 This file lists people who have contributed to tcpdump:
 
 The current maintainers:
-	Bill Fenner			
-        David Young                     
-	Fulvio Risso			
-	Guy Harris	 		
-	Hannes Gredler			
-	Jun-ichiro itojun Hagino	
-	Michael Richardson	 	
+	Bill Fenner			
+        David Young                     
+	Fulvio Risso			
+	Guy Harris	 		
+	Hannes Gredler			
+	Michael Richardson	 	
 
 Additional people who have contributed patches:
 
-        Aaron Campbell                  
-	Alfredo Andres			
-	Albert Chin			
-	Andrew Brown			
-	Andrew Church			
-	Andrew Hintz			
-	Andrew Tridgell			
-        Andy Heffernan                  
-	Arkadiusz Miskiewicz 		
-	Armando L. Caro Jr.		
-	Arnaldo Carvalho de Melo	
-	Atsushi Onoe			
-	Ben Smithurst			
-	Brent L. Bates			
-	Brian Ginsbach			
-	Bruce M. Simpson		
-	Carles Kishimoto Bisbe          
-	Charlie Lenahan			
-	Charles M. Hannum		
-	Chris Cogdon			
-	Chris G. Demetriou		
-	Christian Sievers		
-	Chris Jepeway			
-	Chris Larson			
-	Craig Rodrigues			
-	Crist J. Clark			
-	Daniel Hagerty 			
-	Darren Reed			
-	David Binderman			
-	David Smith			
-	David Young			
-	Don Ebright			
-	Eddie Kohler			
-	Francis Dupont			
-	Francisco Matias Cuenca-Acuna	
-	Frank Volf			
-	Fulvio Risso			
-	George Bakos			
-	Gerald Combs			
-	Gert Doering			
-        Greg Stark                      
-	Gilbert Ramirez Jr.		
-	Gisle Vanem			
-        Hannes Viertel                  
-	Hank Leininger			
-	Harry Raaymakers		
-	Heinz-Ado Arnolds		
-	Hendrik Scholz			
-	Ian McDonald			
-        Jacek Tobiasz                   
-	Jakob Schlyter			
-	Jan Oravec			
-	Jason R. Thorpe			
-	Jefferson Ogata 		
-	Jeffrey Hutzelman		
-	Jesper Peterson			
-	Jim Hutchins			
-        Jonathan Heusser                
-	Tatuya Jinmei			
-	Jørgen Thomsen			 
-	Julian Cowley			
-	Kaarthik Sivakumar		
-	Kazushi Sugyo			
-	Kelly Carmichael		
-	Ken Hornstein			
-	Kevin Steves			
-	Klaus Klein			
- 	Kris Kennaway			
-	Krzysztof Halasa		
-	Larry Lile			
-	Lennert Buytenhek 		
-	Loris Degioanni			
-	Love Hörnquist-Åstrand		
-	Maciej W. Rozycki		
-	Manu Pathak			
-	Marc A. Lehmann			
-	Mark Ellzey Thomas		
-	Marko Kiiskila			
-	Markus Schöpflin		
-	Marshall Rose			
-	Martin Husemann			
-	Max Laier			
-	Michael Madore			
-	Michael Shalayeff		
-	Michael Shields			
-	Michael T. Stolarchuk		
-	Michele "mydecay" Marchetto	
-	Monroe Williams 		
-	Motonori Shindo			
-	Nathan J. Williams		
-	Nathaniel Couper-Noles		
-	Neil T. Spring			
-	Niels Provos			
-	Nickolai Zeldovich		
-        Nicolas Ferrero                 
-	Noritoshi Demizu		
-	Olaf Kirch 			
-	Onno van der Linden		
-	Pascal Hennequin 		
-	Pasvorn Boonmark		
-	Paul Mundt			
-	Paul S. Traina			
-	Pavlin Radoslavov		
-	Pekka Savola 				
-	Peter Fales			
-	Peter Jeremy			
-					
-	Phil Wood			
-	Rafal Maszkowski		
-	Raphael Raimbault		
-	Rick Cheng                      
-	Rick Jones			
-	Rick Watson			
-	Rob Braun			
-	Roderick Schertler		
-	Sami Farin			
-	Scott Rose			
-	Sebastian Krahmer		
-	Sebastien Vincent		
-	Seth Webster			
-	Shinsuke Suzuki			
-	Steinar Haug			
-        Swaminathan Chandrasekaran      
-	Takashi Yamamoto		
-	Terry Kennedy			
+        Aaron Campbell                  
+	Alfredo Andres			
+	Albert Chin			
+	Ananth Suryanarayana 		
+        Andrea Bittau                   
+	Andrew Brown			
+	Andrew Church			
+	Andrew Hintz			
+	Andrew Silent			
+	Andrew Tridgell			
+        Andy Heffernan                  
+	Arkadiusz Miskiewicz 		
+	Armando L. Caro Jr. 		
+	Arnaldo Carvalho de Melo	
+	Ben Byer			
+	Atsushi Onoe			
+	Ben Smithurst			
+	Bjoern A. Zeeb			
+	Brent L. Bates			
+	Brian Ginsbach			
+	Bruce M. Simpson		
+	Carles Kishimoto Bisbe          
+	Charlie Lenahan			
+	Charles M. Hannum		
+	Chris Cogdon			
+	Chris G. Demetriou		
+	Christian Sievers		
+	Chris Jepeway			
+	Chris Larson			
+	Craig Rodrigues			
+	Crist J. Clark			
+	Daniel Hagerty 			
+	Darren Reed			
+	David Binderman			
+	David Smith			
+	David Young			
+	Don Ebright			
+	Eddie Kohler			
+	Florent Drouin			
+	Francis Dupont			
+	Francisco Matias Cuenca-Acuna	
+	Francois-Xavier Le Bail		
+	Frank Volf			
+	Fulvio Risso			
+	George Bakos			
+	Gerald Combs			
+        Gerrit Renker                   
+	Gert Doering			
+	Greg Minshall			
+        Greg Stark                      
+	Gilbert Ramirez Jr.		
+	Gisle Vanem			
+        Hannes Viertel                  
+	Hank Leininger			
+	Harry Raaymakers		
+	Heinz-Ado Arnolds		
+	Hendrik Scholz			
+	Ian McDonald			
+        Jacek Tobiasz                   
+	Jakob Schlyter			
+	Jan Oravec			
+	Jason R. Thorpe			
+	Jefferson Ogata 		
+	Jeffrey Hutzelman		
+	Jesper Peterson			
+	Jim Hutchins			
+        Jonathan Heusser                
+	Tatuya Jinmei			
+	Joerg Mayer			
+	Jørgen Thomsen			 
+	Julian Cowley			
+	Kaarthik Sivakumar		
+	Kazushi Sugyo			
+	Kelly Carmichael		
+	Ken Hornstein			
+	Kevin Steves			
+	Klaus Klein			
+ 	Kris Kennaway			
+	Krzysztof Halasa		
+	Larry Lile			
+	Lennert Buytenhek 		
+	Loris Degioanni			
+	Love Hörnquist-Åstrand		
+	Luis Martin Garcia		
+	Maciej W. Rozycki		
+	Manu Pathak			
+	Marc Binderberger		
+	Marc A. Lehmann			
+	Mark Ellzey Thomas		
+	Marko Kiiskila			
+	Markus Schöpflin		
+	Marshall Rose			
+	Martin Husemann			
+	Max Laier			
+	Michael A. Meffie III		
+	Michael Madore			
+	Michael Shalayeff		
+	Michael Shields			
+	Michael T. Stolarchuk		
+	Michele "mydecay" Marchetto	
+	Mike Frysinger			
+	Monroe Williams 		
+	Motonori Shindo			
+	Nathan J. Williams		
+	Nathaniel Couper-Noles		
+	Neil T. Spring			
+	Niels Provos			
+	Nickolai Zeldovich		
+        Nicolas Ferrero                 
+	Noritoshi Demizu		
+	Olaf Kirch 			
+	Onno van der Linden		
+	Paolo Abeni			
+	Pascal Hennequin 		
+	Pasvorn Boonmark		
+	Paul Mundt			
+	Paul S. Traina			
+	Pavlin Radoslavov		
+	Pekka Savola 				
+	Peter Fales			
+	Peter Jeremy			
+					
+	Phil Wood			
+	Rafal Maszkowski		
+	Raphael Raimbault		
+	Rick Cheng                      
+	Rick Jones			
+	Rick Watson			
+	Rob Braun			
+	Roderick Schertler		
+	Sagun Shakya			
+	Sami Farin			
+	Scott Rose			
+	Sebastian Krahmer		
+	Sebastien Raveau		
+	Sebastien Vincent		
+	Sepherosa Ziehau		
+	Seth Webster			
+	Shinsuke Suzuki			
+	Steinar Haug			
+        Swaminathan Chandrasekaran      
+	Takashi Yamamoto		
+	Terry Kennedy			
 	Timo Koskiahde
-	Tony Li				
-	Uns Lider			
-	Victor Oppleman			
-	Wesley Griffin			
-	Wilbert de Graaf		
+	Tony Li				
+	Uns Lider			
+	Victor Oppleman			
+	Wesley Griffin			
+	Wilbert de Graaf		
+        Will Drewry                     
 	Yen Yen Lim
 	Yoshifumi Nishida
 
@@ -149,3 +167,6 @@ The original LBL crew:
 	Steve McCanne
 	Craig Leres
 	Van Jacobson
+
+Past maintainers:
+	Jun-ichiro itojun Hagino	

Copied: head/contrib/tcpdump/INSTALL.txt (from r190206, vendor/tcpdump/dist/INSTALL.txt)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/contrib/tcpdump/INSTALL.txt	Sat Mar 21 18:30:25 2009	(r190207, copy of r190206, vendor/tcpdump/dist/INSTALL.txt)
@@ -0,0 +1,254 @@
+@(#) $Header: /tcpdump/master/tcpdump/INSTALL.txt,v 1.1.2.1 2008-02-06 10:49:22 guy Exp $ (LBL)
+
+If you have not built libpcap, and your system does not have libpcap
+installed, install libpcap first.  Your system might provide a version
+of libpcap that can be installed; if so, to compile tcpdump you might
+need to install a "developer" version of libpcap as well as the
+"run-time" version.  You can also install tcpdump.org's version of
+libpcap; see the README file in this directory for the ftp location.
+
+You will need an ANSI C compiler to build tcpdump. The configure script
+will abort if your compiler is not ANSI compliant. If this happens, use
+the GNU C compiler, available via anonymous ftp:
+
+	ftp://ftp.gnu.org/pub/gnu/gcc/
+
+After libpcap has been built (either install it with "make install" or
+make sure both the libpcap and tcpdump source trees are in the same
+directory), run ./configure (a shell script).  "configure" will
+determine your system attributes and generate an appropriate Makefile
+from Makefile.in.  Now build tcpdump by running "make".
+
+If everything builds ok, su and type "make install".  This will install
+tcpdump and the manual entry.  Any user will be able to use tcpdump to
+read saved captures.  Whether a user will be able to capture traffic
+depends on the OS and the configuration of the system; see the tcpdump
+man page for details.  DO NOT give untrusted users the ability to
+capture traffic.  If a user can capture traffic, he or she could use
+utilities such as tcpdump to capture any traffic on your net, including
+passwords.
+
+Note that most systems ship tcpdump, but usually an older version.
+Remember to remove or rename the installed binary when upgrading.
+
+If your system is not one which we have tested tcpdump on, you may have
+to modify the configure script and Makefile.in. Please send us patches
+for any modifications you need to make.
+
+Please see "PLATFORMS" for notes about tested platforms.
+
+
+FILES
+-----
+CHANGES		- description of differences between releases
+CREDITS		- people that have helped tcpdump along
+FILES		- list of files exported as part of the distribution
+INSTALL.txt	- this file
+LICENSE		- the license under which tcpdump is distributed
+Makefile.in	- compilation rules (input to the configure script)
+README		- description of distribution
+Readme.Win32	- notes on building tcpdump on Win32 systems (with WinPcap)
+VERSION		- version of this release
+acconfig.h	- autoconf input
+aclocal.m4	- autoconf macros
+addrtoname.c	- address to hostname routines
+addrtoname.h	- address to hostname definitions
+ah.h		- IPSEC Authentication Header definitions
+aodv.h		- AODV definitions
+appletalk.h	- AppleTalk definitions
+arcnet.h	- ARCNET definitions
+atime.awk	- TCP ack awk script
+atm.h		- ATM traffic type definitions
+atmuni31.h	- ATM Q.2931 definitions
+bgp.h		- BGP declarations
+bootp.h		- BOOTP definitions
+bpf_dump.c	- BPF program printing routines, in case libpcap doesn't
+		  have them
+chdlc.h		- Cisco HDLC definitions
+cpack.c		- functions to extract packed data
+cpack.h		- declarations of functions to extract packed data
+config.guess	- autoconf support
+config.h.in	- autoconf input
+config.sub	- autoconf support
+configure	- configure script (run this first)
+configure.in	- configure script source
+dccp.h		- DCCP definitions
+decnet.h	- DECnet definitions
+decode_prefix.h	- Declarations of "decode_prefix{4,6}()"
+enc.h		- OpenBSD IPsec encapsulation BPF layer definitions
+esp.h		- IPSEC Encapsulating Security Payload definitions
+ether.h		- Ethernet definitions
+ethertype.h	- Ethernet type value definitions
+extract.h	- alignment definitions
+fddi.h		- Fiber Distributed Data Interface definitions
+gmpls.c		- GMPLS definitions
+gmpls.h		- GMPLS declarations
+gmt2local.c	- time conversion routines
+gmt2local.h	- time conversion prototypes
+icmp6.h		- ICMPv6 definitiions
+ieee802_11.h	- IEEE 802.11 definitions
+ieee802_11_radio.h - radiotap header definitions
+igrp.h		- Interior Gateway Routing Protocol definitions
+install-sh	- BSD style install script
+interface.h	- globals, prototypes and definitions
+ip.h		- IP definitions
+ip6.h		- IPv6 definitions
+ipfc.h		- IP-over-Fibre Channel definitions
+ipproto.c	- IP protocol type value-to-name table
+ipproto.h	- IP protocol type value definitions
+ipsec_doi.h	- ISAKMP packet definitions - RFC2407
+ipx.h		- IPX definitions
+isakmp.h	- ISAKMP packet definitions - RFC2408
+l2vpn.c		- L2VPN encapsulation value-to-name table
+l2vpn.h		- L2VPN encapsulation definitions
+l2tp.h		- Layer Two Tunneling Protocol definitions
+lane.h		- ATM LANE definitions
+lbl/os-*.h	- OS-dependent defines and prototypes
+llc.h		- LLC definitions
+machdep.c	- machine dependent routines
+machdep.h	- machine dependent definitions
+makemib		- mib to header script
+mib.h		- mib definitions
+missing/*	- replacements for missing library functions
+mkdep		- construct Makefile dependency list
+mpls.h		- MPLS definitions
+nameser.h	- DNS definitions
+netbios.h	- NETBIOS definitions
+netdissect.h	- definitions and declarations for tcpdump-as-library
+		  (under development)
+nfs.h		- Network File System V2 definitions
+nfsfh.h		- Network File System file handle definitions
+nlpid.c		- OSI NLPID value-to-name table
+nlpid.h		- OSI NLPID definitions
+ntp.h		- Network Time Protocol definitions
+oakley.h	- ISAKMP packet definitions - RFC2409
+ospf.h		- Open Shortest Path First definitions
+ospf6.h		- IPv6 Open Shortest Path First definitions
+packetdat.awk	- TCP chunk summary awk script
+parsenfsfh.c	- Network File System file parser routines
+pcap_dump_ftell.c - pcap_dump_ftell() implementation, in case libpcap
+		doesn't have it
+pcap-missing.h	- declarations of functions possibly missing from libpcap
+pmap_prot.h	- definitions for ONC RPC portmapper protocol
+ppp.h		- Point to Point Protocol definitions
+print-802_11.c	- IEEE 802.11 printer routines
+print-ap1394.c	- Apple IP-over-IEEE 1394 printer routines
+print-ah.c	- IPSEC Authentication Header printer routines
+print-aodv.c	- AODV printer routines
+print-arcnet.c	- ARCNET printer routines
+print-arp.c	- Address Resolution Protocol printer routines
+print-ascii.c	- ASCII packet dump routines
+print-atalk.c	- AppleTalk printer routines
+print-atm.c	- ATM printer routines
+print-beep.c	- BEEP printer routines
+print-bgp.c	- Border Gateway Protocol printer routines
+print-bootp.c	- BOOTP and IPv4 DHCP printer routines
+print-bt.c	- Bluetooth printer routines
+print-cdp.c	- Cisco Discovery Protocol printer routines
+print-chdlc.c	- Cisco HDLC printer routines
+print-cip.c	- Classical-IP over ATM routines
+print-cnfp.c	- Cisco NetFlow printer routines
+print-dccp.c	- DCCP printer routines
+print-decnet.c	- DECnet printer routines
+print-dhcp6.c	- IPv6 DHCP printer routines
+print-domain.c	- Domain Name System printer routines
+print-dvmrp.c	- Distance Vector Multicast Routing Protocol printer routines
+print-eap.c	- EAP printer routines
+print-enc.c	- OpenBSD IPsec encapsulation BPF layer printer routines
+print-egp.c	- External Gateway Protocol printer routines
+print-esp.c	- IPSEC Encapsulating Security Payload printer routines
+print-ether.c	- Ethernet printer routines
+print-fddi.c	- Fiber Distributed Data Interface printer routines
+print-fr.c	- Frame Relay printer routines
+print-frag6.c	- IPv6 fragmentation header printer routines
+print-gre.c	- Generic Routing Encapsulation printer routines
+print-hsrp.c	- Cisco Hot Standby Router Protocol printer routines
+print-icmp.c	- Internet Control Message Protocol printer routines
+print-icmp6.c	- IPv6 Internet Control Message Protocol printer routines
+print-igmp.c	- Internet Group Management Protocol printer routines
+print-igrp.c	- Interior Gateway Routing Protocol printer routines
+print-ip.c	- IP printer routines
+print-ip6.c	- IPv6 printer routines
+print-ip6opts.c	- IPv6 header option printer routines
+print-ipcomp.c	- IP Payload Compression Protocol printer routines
+print-ipx.c	- IPX printer routines
+print-isakmp.c	- Internet Security Association and Key Management Protocol
+print-isoclns.c	- ISO CLNS, ESIS, and ISIS printer routines
+print-krb.c	- Kerberos printer routines
+print-l2tp.c	- Layer Two Tunneling Protocol printer routines
+print-lane.c	- ATM LANE printer routines
+print-llc.c	- IEEE 802.2 LLC printer routines
+print-lspping.c	- LSPPING printer routines
+print-lwres.c	- Lightweight Resolver protocol printer routines
+print-mobile.c	- IPv4 mobility printer routines
+print-mobility.c - IPv6 mobility printer routines
+print-mpls.c	- Multi-Protocol Label Switching printer routines
+print-msdp.c	- Multicast Source Discovery Protocol printer routines
+print-netbios.c	- NetBIOS frame protocol printer routines
+print-nfs.c	- Network File System printer routines
+print-ntp.c	- Network Time Protocol printer routines
+print-null.c	- BSD loopback device printer routines
+print-ospf.c	- Open Shortest Path First printer routines
+print-ospf6.c	- IPv6 Open Shortest Path First printer routines
+print-pflog.c	- OpenBSD packet filter log file printer routines
+print-pgm.c	- Pragmatic General Multicast printer routines
+print-pim.c	- Protocol Independent Multicast printer routines
+print-ppp.c	- Point to Point Protocol printer routines
+print-pppoe.c	- PPP-over-Ethernet printer routines
+print-pptp.c	- Point-to-Point Tunnelling Protocol printer routines
+print-radius.c	- Radius protocol printer routines
+print-raw.c	- Raw IP printer routines
+print-rip.c	- Routing Information Protocol printer routines
+print-ripng.c	- IPv6 Routing Information Protocol printer routines
+print-rrcp.c	- Realtek Remote Control Protocol routines
+print-rsvp.c	- Resource reSerVation Protocol (RSVP) printer routines
+print-rt6.c	- IPv6 routing header printer routines
+print-rx.c	- AFS RX printer routines
+print-sctp.c	- Stream Control Transmission Protocol printer routines
+print-sip.c	- SIP printer routines
+print-sl.c	- Compressed Serial Line Internet Protocol printer routines
+print-sll.c	- Linux "cooked" capture printer routines
+print-slow.c	- IEEE "slow protocol" (802.3ad) printer routines
+print-smb.c	- SMB/CIFS printer routines
+print-snmp.c	- Simple Network Management Protocol printer routines
+print-stp.c	- IEEE 802.1d spanning tree protocol printer routines
+print-sunatm.c	- SunATM DLPI capture printer routines
+print-sunrpc.c	- Sun Remote Procedure Call printer routines
+print-symantec.c - Symantec Enterprise Firewall printer routines
+print-tcp.c	- TCP printer routines
+print-telnet.c	- Telnet option printer routines
+print-tftp.c	- Trivial File Transfer Protocol printer routines
+print-timed.c	- BSD time daemon protocol printer routines
+print-token.c	- Token Ring printer routines
+print-udp.c	- UDP printer routines
+print-vjc.c	- PPP Van Jacobson compression (RFC1144) printer routines
+print-vrrp.c	- Virtual Router Redundancy Protocol
+print-wb.c	- White Board printer routines
+print-zephyr.c	- Zephyr printer routines
+route6d.h	- packet definition for IPv6 Routing Information Protocol
+rpc_auth.h	- definitions for ONC RPC authentication
+rpc_msg.h	- definitions for ONC RPC messages
+rx.h		- AFS RX definitions
+sctpConstants.h	- Stream Control Transmission Protocol constant definitions
+sctpHeader.h	- Stream Control Transmission Protocol packet definitions
+send-ack.awk	- unidirectional tcp send/ack awk script
+setsignal.c	- OS-independent signal routines
+setsignal.h	- OS-independent signal prototypes
+slcompress.h	- SLIP/PPP Van Jacobson compression (RFC1144) definitions
+slip.h		- SLIP definitions
+sll.h		- Linux "cooked" capture definitions
+smb.h		- SMB/CIFS definitions
+smbutil.c	- SMB/CIFS utility routines
+stime.awk	- TCP send awk script
+strcasecmp.c	- missing routine
+tcp.h		- TCP definitions
+tcpdump.1	- manual entry
+tcpdump.c	- main program
+telnet.h	- Telnet definitions
+tftp.h		- TFTP definitions
+timed.h		- BSD time daemon protocol definitions
+token.h		- Token Ring definitions
+udp.h		- UDP definitions
+util.c		- utility routines
+vfprintf.c	- emulation routine
+win32		- headers and routines for building on Win32 systems

Modified: head/contrib/tcpdump/Makefile.in
==============================================================================
--- head/contrib/tcpdump/Makefile.in	Sat Mar 21 17:09:00 2009	(r190206)
+++ head/contrib/tcpdump/Makefile.in	Sat Mar 21 18:30:25 2009	(r190207)
@@ -17,7 +17,7 @@
 #  WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
 #  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 #
-# @(#) $Header: /tcpdump/master/tcpdump/Makefile.in,v 1.293.2.7 2007/09/12 19:48:50 guy Exp $ (LBL)
+# @(#) $Header: /tcpdump/master/tcpdump/Makefile.in,v 1.317.2.4 2008-05-27 07:14:26 guy Exp $ (LBL)
 
 #
 # Various configurable paths (remember to edit Makefile.in, not Makefile)
@@ -57,6 +57,7 @@ LIBS = @LIBS@
 INSTALL = @INSTALL@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_DATA = @INSTALL_DATA@
+RANLIB = @RANLIB@
 
 # Explicitly define compilation rule since SunOS 4's make doesn't like gcc.
 # Also, gcc does not remove the .o before forking 'as', which can be a
@@ -65,45 +66,122 @@ INSTALL_DATA = @INSTALL_DATA@
 	@rm -f $@
 	$(CC) $(CFLAGS) -c $(srcdir)/$*.c
 
-CSRC =	addrtoname.c af.c cpack.c gmpls.c oui.c gmt2local.c ipproto.c \
+CSRC =	addrtoname.c af.c checksum.c cpack.c gmpls.c oui.c gmt2local.c ipproto.c \
         nlpid.c l2vpn.c machdep.c parsenfsfh.c \
 	print-802_11.c print-ap1394.c print-ah.c print-arcnet.c \
 	print-aodv.c print-arp.c print-ascii.c print-atalk.c print-atm.c \
-	print-beep.c print-bfd.c print-bgp.c print-bootp.c print-cdp.c \
-	print-chdlc.c print-cip.c print-cnfp.c print-dccp.c print-decnet.c \
-	print-domain.c print-dvmrp.c print-enc.c print-egp.c \
+	print-beep.c print-bfd.c print-bgp.c print-bootp.c print-bt.c \
+	print-cdp.c print-cfm.c print-chdlc.c print-cip.c print-cnfp.c \
+	print-dccp.c print-decnet.c \
+	print-domain.c print-dtp.c print-dvmrp.c print-enc.c print-egp.c \
 	print-eap.c print-eigrp.c\
 	print-esp.c print-ether.c print-fddi.c print-fr.c \
 	print-gre.c print-hsrp.c print-icmp.c print-igmp.c \
 	print-igrp.c print-ip.c print-ipcomp.c print-ipfc.c \
-	print-ipx.c print-isakmp.c print-isoclns.c print-juniper.c print-krb.c \
-	print-l2tp.c print-lane.c print-ldp.c print-llc.c \
-        print-lmp.c print-lspping.c \
-	print-lwres.c print-mobile.c print-mpls.c print-msdp.c \
+	print-ipx.c print-isoclns.c print-juniper.c print-krb.c \
+	print-l2tp.c print-lane.c print-ldp.c print-lldp.c print-llc.c \
+        print-lmp.c print-lspping.c print-lwapp.c \
+	print-lwres.c print-mobile.c print-mpcp.c print-mpls.c print-msdp.c \
 	print-nfs.c print-ntp.c print-null.c print-olsr.c print-ospf.c \
-	print-pgm.c print-pim.c print-ppp.c print-pppoe.c \
-	print-pptp.c print-radius.c print-raw.c print-rip.c \
-	print-rsvp.c print-rx.c print-sctp.c print-sip.c print-sl.c print-sll.c \
+	print-pgm.c print-pim.c print-ppp.c print-pppoe.c print-pptp.c \
+	print-radius.c print-raw.c print-rip.c print-rrcp.c print-rsvp.c \
+	print-rx.c print-sctp.c print-sflow.c print-sip.c print-sl.c print-sll.c \
 	print-slow.c print-snmp.c print-stp.c print-sunatm.c print-sunrpc.c \
 	print-symantec.c print-syslog.c print-tcp.c print-telnet.c print-tftp.c \
-	print-timed.c print-token.c print-udp.c print-vjc.c print-vrrp.c \
+	print-timed.c print-token.c print-udld.c print-udp.c \
+	print-vjc.c print-vqp.c print-vrrp.c print-vtp.c \
 	print-wb.c print-zephyr.c setsignal.c tcpdump.c util.c
 
+LIBNETDISSECT_SRC=print-isakmp.c
+LIBNETDISSECT_OBJ=$(LIBNETDISSECT_SRC:.c=.o)
+LIBNETDISSECT=libnetdissect.a
+
 LOCALSRC = @LOCALSRC@
 GENSRC = version.c
 LIBOBJS = @LIBOBJS@
 
-SRC =	$(CSRC) $(GENSRC) $(LOCALSRC)
+SRC =	$(CSRC) $(GENSRC) $(LOCALSRC) $(LIBNETDISSECT_SRC)
 
 # We would like to say "OBJ = $(SRC:.c=.o)" but Ultrix's make cannot
 # hack the extra indirection
-OBJ =	$(CSRC:.c=.o) $(GENSRC:.c=.o) $(LOCALSRC:.c=.o) $(LIBOBJS)
-HDR =   addrtoname.h appletalk.h bootp.h cpack.h dccp.h decnet.h \
-	ethertype.h extract.h fddi.h gmt2local.h igrp.h interface.h \
-	ipx.h llc.h machdep.h mib.h nfsfh.h nfsv2.h ntp.h ospf.h \
+OBJ =	$(CSRC:.c=.o) $(GENSRC:.c=.o) $(LOCALSRC:.c=.o) $(LIBOBJS) $(LIBNETDISSECT_OBJ)
+HDR = \
+	acconfig.h \
+	addrtoname.h \
+	af.h \
+	ah.h \
+	aodv.h \
+	appletalk.h \
+	arcnet.h \
+	atm.h \
+	atmuni31.h \
+	bootp.h \
+	bgp.h \
+	chdlc.h \
+	cpack.h \
+	dccp.h \
+	decnet.h \
+	decode_prefix.h \
+	enc.h \
+	esp.h \
+	ether.h \
+	ethertype.h \
+	extract.h \
+	fddi.h \
+	gmpls.h \
+	gmt2local.h \
+	icmp6.h \
+	ieee802_11.h \
+	ieee802_11_radio.h \
+	igrp.h \
+	interface.h \
+	interface.h \
+	ip.h \
+	ip6.h \
+	ipfc.h \
+	ipproto.h \
+	ipsec_doi.h \
+	ipx.h \
+	isakmp.h \
+	l2tp.h \
+	l2vpn.h \
+	lane.h \
+	llc.h \
+	machdep.h \
+	mib.h \
+	mpls.h \
+	nameser.h \
+	netbios.h \
+	netdissect.h \
+	nfs.h \
+	nfsfh.h \
+	nlpid.h \
+	ntp.h \
+	oakley.h \
+	ospf.h \
+	ospf6.h \
+	oui.h \
+	pcap-missing.h \
+	pmap_prot.h \
+	ppp.h \
+	route6d.h \
+	rpc_auth.h \
+	rpc_msg.h \
+	rx.h \
+	sctpConstants.h \
+	sctpHeader.h \
 	setsignal.h \
-	gnuc.h ipsec_doi.h isakmp.h l2tp.h nameser.h \
-	netbios.h oakley.h ospf6.h pf.h ppp.h route6d.h
+	slcompress.h \
+	slip.h \
+	sll.h \
+	smb.h \
+	tcp.h \
+	tcpdump-stdinc.h \
+	telnet.h \
+	tftp.h \
+	timed.h \
+	token.h \
+	udp.h
 
 TAGHDR = \
 	/usr/include/arpa/tftp.h \
@@ -120,12 +198,92 @@ TAGFILES = $(SRC) $(HDR) $(TAGHDR)
 
 CLEANFILES = $(PROG) $(OBJ) $(GENSRC)
 
+EXTRA_DIST = \
+	CHANGES \
+	CREDITS \
+	INSTALL.txt \
+	LICENSE \
+	Makefile.in \
+	README \
+	Readme.Win32 \
+	VERSION \
+	aclocal.m4 \
+	atime.awk \
+	bpf_dump.c \
+	config.guess \
+	config.h.in \
+	config.sub \
+	configure \
+	configure.in \
+	install-sh \
+	lbl/os-osf4.h \
+	lbl/os-solaris2.h \
+	lbl/os-sunos4.h \
+	lbl/os-ultrix4.h \
+	makemib \
+	missing/addrinfo.h \
+	missing/addrsize.h \
+	missing/bittypes.h \
+	missing/dlnames.c \
+	missing/datalinks.c \
+	missing/getaddrinfo.c \
+	missing/getnameinfo.c \
+	missing/inet_aton.c \
+	missing/inet_ntop.c \
+	missing/inet_pton.c \
+	missing/resolv6.h \
+	missing/resolv_ext.h \
+	missing/snprintf.c \
+	missing/sockstorage.h \
+	missing/strdup.c \
+	missing/strlcat.c \
+	missing/strlcpy.c \
+	missing/strsep.c \
+	mkdep \
+	packetdat.awk \
+	pcap_dump_ftell.c \
+	print-dhcp6.c \
+	print-frag6.c \
+	print-icmp6.c \
+	print-ip6.c \
+	print-ip6opts.c \
+	print-mobility.c \
+	print-netbios.c \
+	print-ospf6.c \
+	print-pflog.c \
+	print-ripng.c \
+	print-rt6.c \
+	print-smb.c \
+	send-ack.awk \
+	smbutil.c \
+	stime.awk \
+	strcasecmp.c \
+	tcpdump.1 \
+	vfprintf.c \
+	win32/Include/Arpa/tftp.h \
+	win32/Include/errno.h \
+	win32/Include/getopt.h \
+	win32/Include/inetprivate.h \
+	win32/Include/telnet.h \
+	win32/Include/w32_fzs.h \
+	win32/Include/Netinet/in_systm.h \
+	win32/Include/Netinet/ip.h \
+	win32/Src/getopt.c \
+	win32/prj/GNUmakefile \
+	win32/prj/WinDump.dsp \
+	win32/prj/WinDump.dsw
+
 all: $(PROG)
 
 $(PROG): $(OBJ) @V_PCAPDEP@
 	@rm -f $@
 	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJ) $(LIBS)
 
+$(LIBNETDISSECT): $(LIBNETDISSECT_OBJ)
+	@rm -f $@
+	$(AR) cr $@ $(LIBNETDISSECT_OBJ) 
+	$(RANLIB) $@
+
 datalinks.o: $(srcdir)/missing/datalinks.c
 	$(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/datalinks.c
 dlnames.o: $(srcdir)/missing/dlnames.c
@@ -154,12 +312,20 @@ version.o: version.c
 
 version.c: $(srcdir)/VERSION
 	@rm -f $@
-	sed -e 's/.*/char version[] = "&";/' $(srcdir)/VERSION > $@
+	if grep CVS ${srcdir}/VERSION >/dev/null; then \
+		read ver <${srcdir}/VERSION; \
+		echo $$ver | tr -d '\012'; \
+		date +_%Y_%m_%d; \
+	else \
+		cat ${srcdir}/VERSION; \
+	fi | sed -e 's/.*/char version[] = "&";/' > $@
+
 
-install:
+install: all
 	[ -d $(DESTDIR)$(sbindir) ] || \
 	    (mkdir -p $(DESTDIR)$(sbindir); chmod 755 $(DESTDIR)$(sbindir))
 	$(INSTALL_PROGRAM) $(PROG) $(DESTDIR)$(sbindir)/$(PROG)
+	$(INSTALL_PROGRAM) $(PROG) $(DESTDIR)$(sbindir)/$(PROG).`cat ${srcdir}/VERSION`
 	[ -d $(DESTDIR)$(mandir)/man1 ] || \
 	    (mkdir -p $(DESTDIR)$(mandir)/man1; chmod 755 $(DESTDIR)$(mandir)/man1)
 	$(INSTALL_DATA) $(srcdir)/$(PROG).1 $(DESTDIR)$(mandir)/man1/$(PROG).1
@@ -183,10 +349,15 @@ distclean:
 tags: $(TAGFILES)
 	ctags -wtd $(TAGFILES)
 
+TAGS: $(TAGFILES)
+	etags $(TAGFILES)
+
 releasetar:
 	@cwd=`pwd` ; dir=`basename $$cwd` ; name=$(PROG)-`cat VERSION` ; \
-	   list="" ; make distclean; cd ..; mkdir -p n; cd n; ln -s ../$$dir $$name; \
-	   tar -c -z -f $$name.tar.gz $$name/. ;
+	   mkdir $$name; \
+	   tar cf - $(CSRC) $(HDR) $(LIBNETDISSECT_SRC) $(EXTRA_DIST) | (cd $$name; tar xf -); \
+	   tar -c -z -f $$name.tar.gz $$name; \
+	   rm -rf $$name
 
 depend: $(GENSRC)
 	${srcdir}/mkdep -c $(CC) $(DEFS) $(INCLS) $(SRC)

Modified: head/contrib/tcpdump/README
==============================================================================
--- head/contrib/tcpdump/README	Sat Mar 21 17:09:00 2009	(r190206)
+++ head/contrib/tcpdump/README	Sat Mar 21 18:30:25 2009	(r190207)
@@ -1,10 +1,11 @@
-@(#) $Header: /tcpdump/master/tcpdump/README,v 1.65.2.1 2007/09/14 01:03:12 guy Exp $ (LBL)
+@(#) $Header: /tcpdump/master/tcpdump/README,v 1.66.2.1 2008-05-30 01:38:20 guy Exp $ (LBL)
 
 TCPDUMP 3.9
 Now maintained by "The Tcpdump Group"
 See 		www.tcpdump.org
 
-Please send inquiries/comments/reports to 	tcpdump-workers@tcpdump.org
+Please send inquiries/comments/reports to:
+	tcpdump-workers@lists.tcpdump.org
 
 Anonymous CVS is available via:
 	cvs -d :pserver:cvs.tcpdump.org:/tcpdump/master login
@@ -68,15 +69,14 @@ trace files. See the above distribution 
 documentation.
 
 Problems, bugs, questions, desirable enhancements, etc. should be sent
-to the address "tcpdump-workers@tcpdump.org".  Bugs, support requests,
-and feature requests may also be submitted on the SourceForge site for
-tcpdump at
+to the address "tcpdump-workers@lists.tcpdump.org".  Bugs, support
+requests, and feature requests may also be submitted on the SourceForge
+site for tcpdump at
 
 	http://sourceforge.net/projects/tcpdump/
 
 Source code contributions, etc. should be sent to the email address
-"patches@tcpdump.org", or submitted as patches on the SourceForge site
-for tcpdump.
+submitted as patches on the SourceForge site for tcpdump.
 
 Current versions can be found at www.tcpdump.org, or the SourceForge
 site for tcpdump.

Modified: head/contrib/tcpdump/VERSION
==============================================================================
--- head/contrib/tcpdump/VERSION	Sat Mar 21 17:09:00 2009	(r190206)
+++ head/contrib/tcpdump/VERSION	Sat Mar 21 18:30:25 2009	(r190207)
@@ -1 +1 @@
-3.9.8
+4.0.0

Modified: head/contrib/tcpdump/addrtoname.c
==============================================================================
--- head/contrib/tcpdump/addrtoname.c	Sat Mar 21 17:09:00 2009	(r190206)
+++ head/contrib/tcpdump/addrtoname.c	Sat Mar 21 18:30:25 2009	(r190207)
@@ -25,7 +25,7 @@
  */
 #ifndef lint
 static const char rcsid[] _U_ =
-    "@(#) $Header: /tcpdump/master/tcpdump/addrtoname.c,v 1.108.2.9 2007/09/14 00:26:18 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/addrtoname.c,v 1.119 2007-08-08 14:06:34 hannes Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -81,7 +81,6 @@ extern int ether_ntohost(char *, const s
  */
 
 #define HASHNAMESIZE 4096
-#define BUFSIZE 128
 
 struct hnamemem {
 	u_int32_t addr;
@@ -511,14 +510,19 @@ etheraddr_string(register const u_char *
 }
 
 const char *
-linkaddr_string(const u_char *ep, const unsigned int len)
+linkaddr_string(const u_char *ep, const unsigned int type, const unsigned int len)
 {
 	register u_int i;
 	register char *cp;
 	register struct enamemem *tp;
 
-	if (len == ETHER_ADDR_LEN)	/* XXX not totally correct... */
-		return etheraddr_string(ep);
+	if (type == LINKADDR_ETHER && len == ETHER_ADDR_LEN) {
+            return etheraddr_string(ep);
+        }
+
+        if (type == LINKADDR_FRELAY) {
+            return q922_string(ep);
+        }
 
 	tp = lookup_bytestring(ep, len);
 	if (tp->e_name)

Modified: head/contrib/tcpdump/addrtoname.h
==============================================================================
--- head/contrib/tcpdump/addrtoname.h	Sat Mar 21 17:09:00 2009	(r190206)

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

From owner-svn-src-head@FreeBSD.ORG  Sat Mar 21 18:40:39 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0A88A106566C;
	Sat, 21 Mar 2009 18:40:39 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D15448FC28;
	Sat, 21 Mar 2009 18:40:38 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2LIecxa043725;
	Sat, 21 Mar 2009 18:40:38 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2LIecRN043724;
	Sat, 21 Mar 2009 18:40:38 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <200903211840.n2LIecRN043724@svn.freebsd.org>
From: Rui Paulo 
Date: Sat, 21 Mar 2009 18:40: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: r190208 - head/usr.sbin/tcpdump/tcpdump
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 21 Mar 2009 18:40:39 -0000

Author: rpaulo
Date: Sat Mar 21 18:40:38 2009
New Revision: 190208
URL: http://svn.freebsd.org/changeset/base/190208

Log:
  Add new build targets for tcpdump 4.0.0.

Modified:
  head/usr.sbin/tcpdump/tcpdump/Makefile

Modified: head/usr.sbin/tcpdump/tcpdump/Makefile
==============================================================================
--- head/usr.sbin/tcpdump/tcpdump/Makefile	Sat Mar 21 18:30:25 2009	(r190207)
+++ head/usr.sbin/tcpdump/tcpdump/Makefile	Sat Mar 21 18:40:38 2009	(r190208)
@@ -7,28 +7,31 @@ TCPDUMP_DISTDIR?= ${.CURDIR}/../../../co
 
 PROG=	tcpdump
 
-SRCS =	addrtoname.c af.c cpack.c gmpls.c oui.c gmt2local.c ipproto.c \
-        nlpid.c l2vpn.c machdep.c parsenfsfh.c \
+SRCS =	addrtoname.c af.c checksum.c cpack.c gmpls.c oui.c gmt2local.c \
+        ipproto.c nlpid.c l2vpn.c machdep.c parsenfsfh.c \
 	print-802_11.c print-ap1394.c print-ah.c print-arcnet.c \
 	print-aodv.c print-arp.c print-ascii.c print-atalk.c print-atm.c \
 	print-beep.c print-bfd.c print-bgp.c print-bootp.c print-cdp.c \
-	print-chdlc.c print-cip.c print-cnfp.c print-dccp.c print-decnet.c \
-	print-domain.c print-dvmrp.c print-enc.c print-egp.c \
-	print-eap.c print-eigrp.c\
+	print-cfm.c print-chdlc.c print-cip.c print-cnfp.c print-dccp.c \
+	print-decnet.c print-domain.c print-dtp.c print-dvmrp.c print-enc.c \
+	print-egp.c print-eap.c print-eigrp.c \
 	print-esp.c print-ether.c print-fddi.c print-fr.c \
 	print-gre.c print-hsrp.c print-icmp.c print-igmp.c \
 	print-igrp.c print-ip.c print-ipcomp.c print-ipfc.c \
 	print-ipx.c print-isakmp.c print-isoclns.c print-juniper.c print-krb.c \
-	print-l2tp.c print-lane.c print-ldp.c print-llc.c \
+	print-l2tp.c print-lane.c print-ldp.c print-lldp.c print-llc.c \
         print-lmp.c print-lspping.c \
-	print-lwres.c print-mobile.c print-mpls.c print-msdp.c \
+	print-lwapp.c print-lwres.c print-mobile.c print-mpls.c print-msdp.c \
+	print-mpcp.c \
 	print-nfs.c print-ntp.c print-null.c print-olsr.c print-ospf.c \
 	print-pgm.c print-pim.c print-ppp.c print-pppoe.c \
 	print-pptp.c print-radius.c print-raw.c print-rip.c \
-	print-rsvp.c print-rx.c print-sctp.c print-sip.c print-sl.c print-sll.c \
+	print-rrcp.c print-rsvp.c print-rx.c print-sctp.c print-sflow.c \
+	print-sip.c print-sl.c print-sll.c \
 	print-slow.c print-snmp.c print-stp.c print-sunatm.c print-sunrpc.c \
 	print-symantec.c print-syslog.c print-tcp.c print-telnet.c print-tftp.c \
-	print-timed.c print-token.c print-udp.c print-vjc.c print-vrrp.c \
+	print-timed.c print-token.c print-udld.c print-udp.c print-vjc.c \
+	print-vqp.c print-vrrp.c print-vtp.c \
 	print-wb.c print-zephyr.c setsignal.c tcpdump.c util.c \
 	print-smb.c smbutil.c \
 	version.c

From owner-svn-src-head@FreeBSD.ORG  Sat Mar 21 19:09:33 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id F096D106564A;
	Sat, 21 Mar 2009 19:09:33 +0000 (UTC) (envelope-from phk@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id DEC2C8FC0C;
	Sat, 21 Mar 2009 19:09:33 +0000 (UTC) (envelope-from phk@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2LJ9XkB044328;
	Sat, 21 Mar 2009 19:09:33 GMT (envelope-from phk@svn.freebsd.org)
Received: (from phk@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2LJ9XWM044327;
	Sat, 21 Mar 2009 19:09:33 GMT (envelope-from phk@svn.freebsd.org)
Message-Id: <200903211909.n2LJ9XWM044327@svn.freebsd.org>
From: Poul-Henning Kamp 
Date: Sat, 21 Mar 2009 19:09: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: r190209 - head/tools/tools/sysbuild
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 21 Mar 2009 19:09:34 -0000

Author: phk
Date: Sat Mar 21 19:09:33 2009
New Revision: 190209
URL: http://svn.freebsd.org/changeset/base/190209

Log:
  Wrap a long line.
  
  Save a copy of the CONFIGFILES before we spam them.

Modified:
  head/tools/tools/sysbuild/sysbuild.sh

Modified: head/tools/tools/sysbuild/sysbuild.sh
==============================================================================
--- head/tools/tools/sysbuild/sysbuild.sh	Sat Mar 21 18:40:38 2009	(r190208)
+++ head/tools/tools/sysbuild/sysbuild.sh	Sat Mar 21 19:09:33 2009	(r190209)
@@ -420,8 +420,7 @@ log_it Installworld
 	> /mnt/_.iw 2>&1
 
 log_it distribution
-(cd /usr/src/etc && make -m /usr/src/share/mk distribution \
-	DESTDIR=/mnt ${SRCCONF} ) \
+(cd /usr/src/etc && make -m /usr/src/share/mk distribution DESTDIR=/mnt ${SRCCONF} ) \
 	> /mnt/_.dist 2>&1
 
 log_it Installkernel
@@ -512,6 +511,12 @@ if [ "x$SERCONS" != "xfalse" ] ; then
 fi
 
 log_it move config files
+(
+	cd /mnt
+	mkdir root/configfiles_dist
+	find ${CONFIGFILES} -print | cpio -dumpv root/configfiles_dist
+)
+
 (cd / && find ${CONFIGFILES} -print | cpio -dumpv /mnt)
 
 log_it final_root

From owner-svn-src-head@FreeBSD.ORG  Sat Mar 21 20:16:15 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D388410656BB;
	Sat, 21 Mar 2009 20:16:15 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A7AE48FC14;
	Sat, 21 Mar 2009 20:16:15 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2LKGFbw045530;
	Sat, 21 Mar 2009 20:16:15 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2LKGFbD045529;
	Sat, 21 Mar 2009 20:16:15 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <200903212016.n2LKGFbD045529@svn.freebsd.org>
From: Rui Paulo 
Date: Sat, 21 Mar 2009 20:16:15 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190210 - head/contrib/libpcap
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 21 Mar 2009 20:16:17 -0000

Author: rpaulo
Date: Sat Mar 21 20:16:15 2009
New Revision: 190210
URL: http://svn.freebsd.org/changeset/base/190210

Log:
  Add exclude list for libpcap.

Added:
  head/contrib/libpcap/FREEBSD-Xlist

Added: head/contrib/libpcap/FREEBSD-Xlist
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/contrib/libpcap/FREEBSD-Xlist	Sat Mar 21 20:16:15 2009	(r190210)
@@ -0,0 +1,3 @@
+$FreeBSD$
+*/README.*
+*/Win32

From owner-svn-src-head@FreeBSD.ORG  Sat Mar 21 20:18:32 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B4AA8106566B;
	Sat, 21 Mar 2009 20:18:32 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 891148FC08;
	Sat, 21 Mar 2009 20:18:32 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2LKIWYG045601;
	Sat, 21 Mar 2009 20:18:32 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2LKIW7A045600;
	Sat, 21 Mar 2009 20:18:32 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <200903212018.n2LKIW7A045600@svn.freebsd.org>
From: Rui Paulo 
Date: Sat, 21 Mar 2009 20:18: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: r190211 - in head/contrib: libpcap tcpdump
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 21 Mar 2009 20:18:33 -0000

Author: rpaulo
Date: Sat Mar 21 20:18:32 2009
New Revision: 190211
URL: http://svn.freebsd.org/changeset/base/190211

Log:
  Add svn:keywords.

Modified:
  head/contrib/libpcap/FREEBSD-Xlist   (props changed)
  head/contrib/tcpdump/FREEBSD-Xlist   (props changed)

From owner-svn-src-head@FreeBSD.ORG  Sat Mar 21 20:34:42 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 35A43106564A;
	Sat, 21 Mar 2009 20:34:42 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 0A2448FC0C;
	Sat, 21 Mar 2009 20:34:42 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2LKYfEI046018;
	Sat, 21 Mar 2009 20:34:41 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2LKYfGS046017;
	Sat, 21 Mar 2009 20:34:41 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <200903212034.n2LKYfGS046017@svn.freebsd.org>
From: Rui Paulo 
Date: Sat, 21 Mar 2009 20:34: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: r190212 - head/contrib/libpcap
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 21 Mar 2009 20:34:42 -0000

Author: rpaulo
Date: Sat Mar 21 20:34:41 2009
New Revision: 190212
URL: http://svn.freebsd.org/changeset/base/190212

Log:
  Add a couple more paths.

Modified:
  head/contrib/libpcap/FREEBSD-Xlist

Modified: head/contrib/libpcap/FREEBSD-Xlist
==============================================================================
--- head/contrib/libpcap/FREEBSD-Xlist	Sat Mar 21 20:18:32 2009	(r190211)
+++ head/contrib/libpcap/FREEBSD-Xlist	Sat Mar 21 20:34:41 2009	(r190212)
@@ -1,3 +1,5 @@
 $FreeBSD$
 */README.*
+*/msdos
+*/SUNOS4
 */Win32

From owner-svn-src-head@FreeBSD.ORG  Sat Mar 21 20:39:22 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E5D77106564A;
	Sat, 21 Mar 2009 20:39:22 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id BA7F18FC20;
	Sat, 21 Mar 2009 20:39:22 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2LKdMGZ046142;
	Sat, 21 Mar 2009 20:39:22 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2LKdM7F046141;
	Sat, 21 Mar 2009 20:39:22 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <200903212039.n2LKdM7F046141@svn.freebsd.org>
From: Rui Paulo 
Date: Sat, 21 Mar 2009 20:39: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: r190213 - head/contrib/libpcap
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 21 Mar 2009 20:39:23 -0000

Author: rpaulo
Date: Sat Mar 21 20:39:22 2009
New Revision: 190213
URL: http://svn.freebsd.org/changeset/base/190213

Log:
  Add Mac OS X stuff.

Modified:
  head/contrib/libpcap/FREEBSD-Xlist

Modified: head/contrib/libpcap/FREEBSD-Xlist
==============================================================================
--- head/contrib/libpcap/FREEBSD-Xlist	Sat Mar 21 20:34:41 2009	(r190212)
+++ head/contrib/libpcap/FREEBSD-Xlist	Sat Mar 21 20:39:22 2009	(r190213)
@@ -3,3 +3,5 @@ $FreeBSD$
 */msdos
 */SUNOS4
 */Win32
+*/ChmodBPF
+*/*.plist

From owner-svn-src-head@FreeBSD.ORG  Sat Mar 21 21:49:08 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 81746106564A;
	Sat, 21 Mar 2009 21:49:08 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 3B6978FC0A;
	Sat, 21 Mar 2009 21:49:08 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2LLn81E047921;
	Sat, 21 Mar 2009 21:49:08 GMT (envelope-from rwatson@svn.freebsd.org)
Received: (from rwatson@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2LLn8gf047920;
	Sat, 21 Mar 2009 21:49:08 GMT (envelope-from rwatson@svn.freebsd.org)
Message-Id: <200903212149.n2LLn8gf047920@svn.freebsd.org>
From: Robert Watson 
Date: Sat, 21 Mar 2009 21:49:08 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190220 - head/sys/nfsclient
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 21 Mar 2009 21:49:08 -0000

Author: rwatson
Date: Sat Mar 21 21:49:07 2009
New Revision: 190220
URL: http://svn.freebsd.org/changeset/base/190220

Log:
  In nfs_request(), always exit using the nfsmout label once we're
  definitely doing an NFSv2 or NFSv3 RPC, rather than sometimes doing
  so and sometimes not.  This makes it easier to add a DTrace return
  probe at a single point in the function.
  
  MFC after:	1 week

Modified:
  head/sys/nfsclient/nfs_krpc.c

Modified: head/sys/nfsclient/nfs_krpc.c
==============================================================================
--- head/sys/nfsclient/nfs_krpc.c	Sat Mar 21 21:37:53 2009	(r190219)
+++ head/sys/nfsclient/nfs_krpc.c	Sat Mar 21 21:49:07 2009	(r190220)
@@ -493,11 +493,8 @@ tryagain:
 		error = EACCES;
 	}
 	md = mrep;
-	if (error) {
-		m_freem(mreq);
-		AUTH_DESTROY(auth);
-		return (error);
-	}
+	if (error)
+		goto nfsmout;
 
 	KASSERT(mrep != NULL, ("mrep shouldn't be NULL if no error\n"));
 
@@ -535,9 +532,7 @@ tryagain:
 			error |= NFSERR_RETERR;
 		} else
 			m_freem(mrep);
-		m_freem(mreq);
-		AUTH_DESTROY(auth);
-		return (error);
+		goto nfsmout;
 	}
 
 	m_freem(mreq);

From owner-svn-src-head@FreeBSD.ORG  Sat Mar 21 21:56:23 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 62488106566B;
	Sat, 21 Mar 2009 21:56:23 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 510668FC0C;
	Sat, 21 Mar 2009 21:56:23 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2LLuNuu048091;
	Sat, 21 Mar 2009 21:56:23 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2LLuNJo048090;
	Sat, 21 Mar 2009 21:56:23 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <200903212156.n2LLuNJo048090@svn.freebsd.org>
From: Rui Paulo 
Date: Sat, 21 Mar 2009 21:56: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: r190221 - head/contrib/tcpdump
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 21 Mar 2009 21:56:23 -0000

Author: rpaulo
Date: Sat Mar 21 21:56:23 2009
New Revision: 190221
URL: http://svn.freebsd.org/changeset/base/190221

Log:
  Fix WITHOUT_IPV6=yes build.
  
  Reported by:	Andrzej Tobola ato at iem.pw.edu.pl

Modified:
  head/contrib/tcpdump/print-enc.c

Modified: head/contrib/tcpdump/print-enc.c
==============================================================================
--- head/contrib/tcpdump/print-enc.c	Sat Mar 21 21:49:07 2009	(r190220)
+++ head/contrib/tcpdump/print-enc.c	Sat Mar 21 21:56:23 2009	(r190221)
@@ -77,9 +77,11 @@ enc_if_print(const struct pcap_pkthdr *h
 	case AF_INET:
 		ip_print(gndo, p, length);
 		break;
+#ifdef INET6
 	case AF_INET6:
 		ip6_print(p, length);
 		break;
+#endif
 	}
 
 out:

From owner-svn-src-head@FreeBSD.ORG  Sat Mar 21 22:38:07 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0B4D31065674
	for ; Sat, 21 Mar 2009 22:38:07 +0000 (UTC)
	(envelope-from cokane@FreeBSD.org)
Received: from mail-out1.fuse.net (mail-out1.fuse.net [216.68.8.175])
	by mx1.freebsd.org (Postfix) with ESMTP id B34BF8FC17
	for ; Sat, 21 Mar 2009 22:38:06 +0000 (UTC)
	(envelope-from cokane@FreeBSD.org)
X-CNFS-Analysis: v=1.0 c=1 a=r_5zXaxxhK4A:10 a=SrmVwFdnOH0A:10
	a=mDV3o1hIAAAA:8 a=iXrWV3IHTMQtWm9SJiAA:9
	a=X-D4vy8NFgGkqlJuF_YA:7 a=wFsLiGvrkMBix0cfZpiivGM1HdMA:4
	a=LY0hPdMaydYA:10 a=6CIx0o2FfOGwQPuIGgIA:9
	a=_6ckyramvSZzqsk_hj1p5-sESLUA:4 a=rPt6xJ-oxjAA:10
X-CM-Score: 0
X-Scanned-by: Cloudmark Authority Engine
Authentication-Results: gwout1 smtp.mail=cokane@FreeBSD.org; spf=softfail
Received-SPF: softfail (gwout1: transitional domain FreeBSD.org does not
	designate 74.215.227.9 as permitted sender)
Received: from [74.215.227.9] ([74.215.227.9:50463] helo=discordia)
	by gwout1 (envelope-from )
	(ecelerity 2.2.2.37 r(28805/28810M)) with ESMTP
	id F6/21-27669-D4C65C94; Sat, 21 Mar 2009 18:38:05 -0400
Received: by discordia (Postfix, from userid 103)
	id 1F24435A7F1; Sat, 21 Mar 2009 18:38:05 -0400 (EDT)
X-Spam-Checker-Version: SpamAssassin 3.1.8-gr1 (2007-02-13) on discordia
X-Spam-Level: 
X-Spam-Status: No, score=-4.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00
	autolearn=ham version=3.1.8-gr1
Received: from [172.20.1.3] (erwin.int.cokane.org [172.20.1.3])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by discordia (Postfix) with ESMTP id 0DE1035A7E0;
	Sat, 21 Mar 2009 18:37:58 -0400 (EDT)
From: Coleman Kane 
To: Bruce Simpson 
In-Reply-To: <49C4EEB2.4080507@incunabulum.net>
References: <200903142010.n2EKAESF006945@svn.freebsd.org>
	<20090320140015.GA17645@hub.freebsd.org>
	<20090320153405.GA62675@zim.MIT.EDU>  <49C3BCD4.4030605@freebsd.org>
	<1237567495.1993.2.camel@localhost>  <49C3D518.6070105@freebsd.org>
	<1237573175.1993.19.camel@localhost>
	
	<49C4EEB2.4080507@incunabulum.net>
Content-Type: multipart/signed; micalg="pgp-sha1";
	protocol="application/pgp-signature";
	boundary="=-m9HS7Bx7IKXHzeTQgbB6"
Organization: FreeBSD Project
Date: Sat, 21 Mar 2009 18:36:32 -0400
Message-Id: <1237674992.1690.8.camel@localhost>
Mime-Version: 1.0
X-Mailer: Evolution 2.24.5 FreeBSD GNOME Team Port 
Cc: src-committers@freebsd.org, svn-src-all@freebsd.org,
	Vasil Dimov , Sam Leffler ,
	Robert Watson , svn-src-head@freebsd.org
Subject: Re: svn commit: r189828 - in head: include 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, 21 Mar 2009 22:38:07 -0000


--=-m9HS7Bx7IKXHzeTQgbB6
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

On Sat, 2009-03-21 at 13:42 +0000, Bruce Simpson wrote:
> Robert Watson wrote:
> > On Fri, 20 Mar 2009, Coleman Kane wrote:
> >
> >> I've found that many of the GNU apps are notorious for this. I really=20
> >> can't say that I know why libassuan or gnupg explicitly require GNU=20
> >> pth, rather than first attempting to use POSIX pthread API. Their=20
> >> configure scripts both want to search for and run pth-config, and=20
> >> fail to enable some sort of threaded features if it doesn't exist. I=20
> >> already tried removing pth stuff from both port Makefiles to see what=20
> >> would happen. I didn't spend much time on it after I figured out that=20
> >> devel/pth would just work if I removed the signal.h include.
> >>
> >> I am guessing that some non-standard extensions which GNU pth=20
> >> provides are not provided by the normal POSIX spec.
> >>
> >> In fact, libassuan just goes ahead and uses a bunch of pth_*=20
> >> overrides for dealing with them in a thread-safe manner (waitpid,=20
> >> read, write, select, usleep).
> >
> > Historically, pthreads implementations were highly variable in=20
> > quality, completeness, etc.  It wouldn't surprise me if the=20
> > persistence of applications linking against pth isn't, in part, a=20
> > response to that (now-historic) situation.
>=20
> No, this isn't the only reason. There are a few issues with threading=20
> and fork() -- other implementations support forking and rethreading=20
> processes, something which bends the POSIX rules (it is not expressly=20
> forbidden by them), but ours hasn't. This was causing some of the Python=20
> regression tests to fail for 'multiprocessing' and 'threading'.
>=20
> Since POSIX semaphores appear to be fixed, however, we should be able to=20
> get away with building Python on FreeBSD with them natively. kib@ has=20
> committed the rtld fix which makes this possible in 8-CURRENT. For now,=20
> ie until such fixes can be MFCed, I've committed support to the=20
> lang/python26 port to enable it to be built against GNU Pth.
>=20
> cheers
> BMS

=46rom what I can tell, pth provides a superset of the POSIX thread API.
GnuPG and libassuan use some of the higher-level APIs provided by pth
(such as pth's implementation of stdio functions).

Namely, the functions described here:
      * http://www.gnu.org/software/pth/pth-manual.html#generalized_posix_r=
eplacement_api
      * http://www.gnu.org/software/pth/pth-manual.html#standard_posix_repl=
acement_api

These appear to provide thread-blocking versions of the standard-C I/O
calls, rather than the process-blocking variants that are common.
Basically, it comes with pre-written recipes for common multi-threaded
I/O problems. GnuPG and libassuan use this part of Pth's API, rather
than rolling their own I/O routines based upon POSIX or SUS standards.

--=20
Coleman Kane

--=-m9HS7Bx7IKXHzeTQgbB6
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (FreeBSD)

iEYEABECAAYFAknFa+sACgkQcMSxQcXat5eiYgCghLwt5t88/y0uv3gxGH4HbRmU
KcEAn1yjHhszdCH3oqP1k6zWFiMsFG2f
=oR3u
-----END PGP SIGNATURE-----

--=-m9HS7Bx7IKXHzeTQgbB6--


From owner-svn-src-head@FreeBSD.ORG  Sat Mar 21 22:58:09 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6F42D1065747;
	Sat, 21 Mar 2009 22:58:09 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 59B0B8FC16;
	Sat, 21 Mar 2009 22:58:09 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2LMw9QS049594;
	Sat, 21 Mar 2009 22:58:09 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2LMw9v0049588;
	Sat, 21 Mar 2009 22:58:09 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <200903212258.n2LMw9v0049588@svn.freebsd.org>
From: Rui Paulo 
Date: Sat, 21 Mar 2009 22:58: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: r190225 - in head/contrib/libpcap: . bpf/net doc
	missing net packaging pcap
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 21 Mar 2009 22:58:10 -0000

Author: rpaulo
Date: Sat Mar 21 22:58:08 2009
New Revision: 190225
URL: http://svn.freebsd.org/changeset/base/190225

Log:
  Merge libpcap 1.0.0.

Added:
  head/contrib/libpcap/chmod_bpf
     - copied unchanged from r190215, vendor/libpcap/dist/chmod_bpf
  head/contrib/libpcap/dlpisubs.c
     - copied unchanged from r190215, vendor/libpcap/dist/dlpisubs.c
  head/contrib/libpcap/dlpisubs.h
     - copied unchanged from r190215, vendor/libpcap/dist/dlpisubs.h
  head/contrib/libpcap/fad-sita.c
     - copied unchanged from r190215, vendor/libpcap/dist/fad-sita.c
  head/contrib/libpcap/filtertest.c
     - copied unchanged from r190215, vendor/libpcap/dist/filtertest.c
  head/contrib/libpcap/findalldevstest.c
     - copied unchanged from r190215, vendor/libpcap/dist/findalldevstest.c
  head/contrib/libpcap/ieee80211.h
     - copied unchanged from r190215, vendor/libpcap/dist/ieee80211.h
  head/contrib/libpcap/missing/
     - copied from r190215, vendor/libpcap/dist/missing/
  head/contrib/libpcap/net/
     - copied from r190215, vendor/libpcap/dist/net/
  head/contrib/libpcap/pcap/
     - copied from r190215, vendor/libpcap/dist/pcap/
  head/contrib/libpcap/pcap-bt-linux.c
     - copied unchanged from r190215, vendor/libpcap/dist/pcap-bt-linux.c
  head/contrib/libpcap/pcap-bt-linux.h
     - copied unchanged from r190215, vendor/libpcap/dist/pcap-bt-linux.h
  head/contrib/libpcap/pcap-config.1
     - copied unchanged from r190215, vendor/libpcap/dist/pcap-config.1
  head/contrib/libpcap/pcap-config.in
     - copied unchanged from r190215, vendor/libpcap/dist/pcap-config.in
  head/contrib/libpcap/pcap-filter.manmisc
  head/contrib/libpcap/pcap-filter.manmisc.in
     - copied unchanged from r190215, vendor/libpcap/dist/pcap-filter.manmisc.in
  head/contrib/libpcap/pcap-libdlpi.c
     - copied unchanged from r190215, vendor/libpcap/dist/pcap-libdlpi.c
  head/contrib/libpcap/pcap-linktype.manmisc
  head/contrib/libpcap/pcap-linktype.manmisc.in
     - copied unchanged from r190215, vendor/libpcap/dist/pcap-linktype.manmisc.in
  head/contrib/libpcap/pcap-savefile.manfile
  head/contrib/libpcap/pcap-savefile.manfile.in
     - copied unchanged from r190215, vendor/libpcap/dist/pcap-savefile.manfile.in
  head/contrib/libpcap/pcap-sita.c
     - copied unchanged from r190215, vendor/libpcap/dist/pcap-sita.c
  head/contrib/libpcap/pcap-sita.h
     - copied unchanged from r190215, vendor/libpcap/dist/pcap-sita.h
  head/contrib/libpcap/pcap-sita.html
     - copied unchanged from r190215, vendor/libpcap/dist/pcap-sita.html
  head/contrib/libpcap/pcap-usb-linux.c
     - copied unchanged from r190215, vendor/libpcap/dist/pcap-usb-linux.c
  head/contrib/libpcap/pcap-usb-linux.h
     - copied unchanged from r190215, vendor/libpcap/dist/pcap-usb-linux.h
  head/contrib/libpcap/pcap.3pcap
  head/contrib/libpcap/pcap.3pcap.in
     - copied unchanged from r190215, vendor/libpcap/dist/pcap.3pcap.in
  head/contrib/libpcap/pcap_activate.3pcap
     - copied unchanged from r190215, vendor/libpcap/dist/pcap_activate.3pcap
  head/contrib/libpcap/pcap_breakloop.3pcap
     - copied unchanged from r190215, vendor/libpcap/dist/pcap_breakloop.3pcap
  head/contrib/libpcap/pcap_can_set_rfmon.3pcap
     - copied unchanged from r190215, vendor/libpcap/dist/pcap_can_set_rfmon.3pcap
  head/contrib/libpcap/pcap_close.3pcap
     - copied unchanged from r190215, vendor/libpcap/dist/pcap_close.3pcap
  head/contrib/libpcap/pcap_compile.3pcap
  head/contrib/libpcap/pcap_compile.3pcap.in
     - copied unchanged from r190215, vendor/libpcap/dist/pcap_compile.3pcap.in
  head/contrib/libpcap/pcap_create.3pcap
     - copied unchanged from r190215, vendor/libpcap/dist/pcap_create.3pcap
  head/contrib/libpcap/pcap_datalink.3pcap
  head/contrib/libpcap/pcap_datalink.3pcap.in
     - copied unchanged from r190215, vendor/libpcap/dist/pcap_datalink.3pcap.in
  head/contrib/libpcap/pcap_datalink_name_to_val.3pcap
     - copied unchanged from r190215, vendor/libpcap/dist/pcap_datalink_name_to_val.3pcap
  head/contrib/libpcap/pcap_datalink_val_to_name.3pcap
     - copied unchanged from r190215, vendor/libpcap/dist/pcap_datalink_val_to_name.3pcap
  head/contrib/libpcap/pcap_dump.3pcap
     - copied unchanged from r190215, vendor/libpcap/dist/pcap_dump.3pcap
  head/contrib/libpcap/pcap_dump_close.3pcap
     - copied unchanged from r190215, vendor/libpcap/dist/pcap_dump_close.3pcap
  head/contrib/libpcap/pcap_dump_file.3pcap
     - copied unchanged from r190215, vendor/libpcap/dist/pcap_dump_file.3pcap
  head/contrib/libpcap/pcap_dump_flush.3pcap
     - copied unchanged from r190215, vendor/libpcap/dist/pcap_dump_flush.3pcap
  head/contrib/libpcap/pcap_dump_ftell.3pcap
     - copied unchanged from r190215, vendor/libpcap/dist/pcap_dump_ftell.3pcap
  head/contrib/libpcap/pcap_dump_open.3pcap
  head/contrib/libpcap/pcap_dump_open.3pcap.in
     - copied unchanged from r190215, vendor/libpcap/dist/pcap_dump_open.3pcap.in
  head/contrib/libpcap/pcap_file.3pcap
     - copied unchanged from r190215, vendor/libpcap/dist/pcap_file.3pcap
  head/contrib/libpcap/pcap_fileno.3pcap
     - copied unchanged from r190215, vendor/libpcap/dist/pcap_fileno.3pcap
  head/contrib/libpcap/pcap_findalldevs.3pcap
     - copied unchanged from r190215, vendor/libpcap/dist/pcap_findalldevs.3pcap
  head/contrib/libpcap/pcap_free_datalinks.3pcap
     - copied unchanged from r190215, vendor/libpcap/dist/pcap_free_datalinks.3pcap
  head/contrib/libpcap/pcap_freealldevs.3pcap
     - copied unchanged from r190215, vendor/libpcap/dist/pcap_freealldevs.3pcap
  head/contrib/libpcap/pcap_freecode.3pcap
     - copied unchanged from r190215, vendor/libpcap/dist/pcap_freecode.3pcap
  head/contrib/libpcap/pcap_get_selectable_fd.3pcap
     - copied unchanged from r190215, vendor/libpcap/dist/pcap_get_selectable_fd.3pcap
  head/contrib/libpcap/pcap_geterr.3pcap
     - copied unchanged from r190215, vendor/libpcap/dist/pcap_geterr.3pcap
  head/contrib/libpcap/pcap_inject.3pcap
     - copied unchanged from r190215, vendor/libpcap/dist/pcap_inject.3pcap
  head/contrib/libpcap/pcap_is_swapped.3pcap
     - copied unchanged from r190215, vendor/libpcap/dist/pcap_is_swapped.3pcap
  head/contrib/libpcap/pcap_lib_version.3pcap
     - copied unchanged from r190215, vendor/libpcap/dist/pcap_lib_version.3pcap
  head/contrib/libpcap/pcap_list_datalinks.3pcap
  head/contrib/libpcap/pcap_list_datalinks.3pcap.in
     - copied unchanged from r190215, vendor/libpcap/dist/pcap_list_datalinks.3pcap.in
  head/contrib/libpcap/pcap_lookupdev.3pcap
     - copied unchanged from r190215, vendor/libpcap/dist/pcap_lookupdev.3pcap
  head/contrib/libpcap/pcap_lookupnet.3pcap
     - copied unchanged from r190215, vendor/libpcap/dist/pcap_lookupnet.3pcap
  head/contrib/libpcap/pcap_loop.3pcap
     - copied unchanged from r190215, vendor/libpcap/dist/pcap_loop.3pcap
  head/contrib/libpcap/pcap_major_version.3pcap
     - copied unchanged from r190215, vendor/libpcap/dist/pcap_major_version.3pcap
  head/contrib/libpcap/pcap_next_ex.3pcap
     - copied unchanged from r190215, vendor/libpcap/dist/pcap_next_ex.3pcap
  head/contrib/libpcap/pcap_offline_filter.3pcap
     - copied unchanged from r190215, vendor/libpcap/dist/pcap_offline_filter.3pcap
  head/contrib/libpcap/pcap_open_dead.3pcap
  head/contrib/libpcap/pcap_open_dead.3pcap.in
     - copied unchanged from r190215, vendor/libpcap/dist/pcap_open_dead.3pcap.in
  head/contrib/libpcap/pcap_open_live.3pcap
     - copied unchanged from r190215, vendor/libpcap/dist/pcap_open_live.3pcap
  head/contrib/libpcap/pcap_open_offline.3pcap
  head/contrib/libpcap/pcap_open_offline.3pcap.in
     - copied unchanged from r190215, vendor/libpcap/dist/pcap_open_offline.3pcap.in
  head/contrib/libpcap/pcap_set_buffer_size.3pcap
     - copied unchanged from r190215, vendor/libpcap/dist/pcap_set_buffer_size.3pcap
  head/contrib/libpcap/pcap_set_datalink.3pcap
     - copied unchanged from r190215, vendor/libpcap/dist/pcap_set_datalink.3pcap
  head/contrib/libpcap/pcap_set_promisc.3pcap
     - copied unchanged from r190215, vendor/libpcap/dist/pcap_set_promisc.3pcap
  head/contrib/libpcap/pcap_set_rfmon.3pcap
     - copied unchanged from r190215, vendor/libpcap/dist/pcap_set_rfmon.3pcap
  head/contrib/libpcap/pcap_set_snaplen.3pcap
     - copied unchanged from r190215, vendor/libpcap/dist/pcap_set_snaplen.3pcap
  head/contrib/libpcap/pcap_set_timeout.3pcap
     - copied unchanged from r190215, vendor/libpcap/dist/pcap_set_timeout.3pcap
  head/contrib/libpcap/pcap_setdirection.3pcap
     - copied unchanged from r190215, vendor/libpcap/dist/pcap_setdirection.3pcap
  head/contrib/libpcap/pcap_setfilter.3pcap
     - copied unchanged from r190215, vendor/libpcap/dist/pcap_setfilter.3pcap
  head/contrib/libpcap/pcap_setnonblock.3pcap
     - copied unchanged from r190215, vendor/libpcap/dist/pcap_setnonblock.3pcap
  head/contrib/libpcap/pcap_snapshot.3pcap
     - copied unchanged from r190215, vendor/libpcap/dist/pcap_snapshot.3pcap
  head/contrib/libpcap/pcap_stats.3pcap
     - copied unchanged from r190215, vendor/libpcap/dist/pcap_stats.3pcap
  head/contrib/libpcap/pcap_statustostr.3pcap
     - copied unchanged from r190215, vendor/libpcap/dist/pcap_statustostr.3pcap
  head/contrib/libpcap/pcap_strerror.3pcap
     - copied unchanged from r190215, vendor/libpcap/dist/pcap_strerror.3pcap
  head/contrib/libpcap/runlex.sh
     - copied unchanged from r190215, vendor/libpcap/dist/runlex.sh
Deleted:
  head/contrib/libpcap/FILES
  head/contrib/libpcap/README.Win32
  head/contrib/libpcap/README.aix
  head/contrib/libpcap/README.dag
  head/contrib/libpcap/README.hpux
  head/contrib/libpcap/README.linux
  head/contrib/libpcap/README.macosx
  head/contrib/libpcap/README.septel
  head/contrib/libpcap/README.tru64
  head/contrib/libpcap/acsite.m4
  head/contrib/libpcap/doc/pcap.html
  head/contrib/libpcap/doc/pcap.txt
  head/contrib/libpcap/doc/pcap.xml
  head/contrib/libpcap/pcap-nit.h
  head/contrib/libpcap/pcap-pf.h
  head/contrib/libpcap/pcap.3
  head/contrib/libpcap/pcap1.h
  head/contrib/libpcap/sll.h
Modified:
  head/contrib/libpcap/   (props changed)
  head/contrib/libpcap/CHANGES
  head/contrib/libpcap/CREDITS
  head/contrib/libpcap/INSTALL.txt
  head/contrib/libpcap/Makefile.in
  head/contrib/libpcap/README
  head/contrib/libpcap/VERSION
  head/contrib/libpcap/atmuni31.h
  head/contrib/libpcap/bpf/net/bpf_filter.c
  head/contrib/libpcap/bpf_dump.c
  head/contrib/libpcap/bpf_image.c
  head/contrib/libpcap/config.h.in
  head/contrib/libpcap/configure
  head/contrib/libpcap/configure.in
  head/contrib/libpcap/etherent.c
  head/contrib/libpcap/ethertype.h
  head/contrib/libpcap/fad-getad.c
  head/contrib/libpcap/fad-gifc.c
  head/contrib/libpcap/fad-glifc.c
  head/contrib/libpcap/fad-win32.c
  head/contrib/libpcap/gencode.c
  head/contrib/libpcap/gencode.h
  head/contrib/libpcap/grammar.y
  head/contrib/libpcap/inet.c
  head/contrib/libpcap/mkdep
  head/contrib/libpcap/nametoaddr.c
  head/contrib/libpcap/optimize.c
  head/contrib/libpcap/packaging/pcap.spec.in
  head/contrib/libpcap/pcap-bpf.c
  head/contrib/libpcap/pcap-bpf.h
  head/contrib/libpcap/pcap-dag.c
  head/contrib/libpcap/pcap-dag.h
  head/contrib/libpcap/pcap-dlpi.c
  head/contrib/libpcap/pcap-dos.c
  head/contrib/libpcap/pcap-enet.c
  head/contrib/libpcap/pcap-int.h
  head/contrib/libpcap/pcap-linux.c
  head/contrib/libpcap/pcap-namedb.h
  head/contrib/libpcap/pcap-nit.c
  head/contrib/libpcap/pcap-null.c
  head/contrib/libpcap/pcap-pf.c
  head/contrib/libpcap/pcap-septel.c
  head/contrib/libpcap/pcap-septel.h
  head/contrib/libpcap/pcap-snit.c
  head/contrib/libpcap/pcap-snoop.c
  head/contrib/libpcap/pcap-stdinc.h
  head/contrib/libpcap/pcap-win32.c
  head/contrib/libpcap/pcap.c
  head/contrib/libpcap/pcap.h
  head/contrib/libpcap/savefile.c
  head/contrib/libpcap/scanner.l

Modified: head/contrib/libpcap/CHANGES
==============================================================================
--- head/contrib/libpcap/CHANGES	Sat Mar 21 22:35:44 2009	(r190224)
+++ head/contrib/libpcap/CHANGES	Sat Mar 21 22:58:08 2009	(r190225)
@@ -1,28 +1,41 @@
-@(#) $Header: /tcpdump/master/libpcap/CHANGES,v 1.59.2.13 2007/09/12 22:40:04 ken Exp $ (LBL)
+@(#) $Header: /tcpdump/master/libpcap/CHANGES,v 1.67.2.4 2008-10-28 00:27:42 ken Exp $ (LBL)
 
-Mon.	September 10, 2007.  ken@xelerance.com.  Summary for 0.9.8 libpcap release
-	Change build process to put public libpcap headers into pcap subir
-	DLT: Add value for IPMI IPMB packets
-	DLT: Add value for u10 Networks boards
-	Require  for pf definitions - allows reading of pflog formatted 
-	 libpcap files on an OS other than where the file was generated
-
-Wed.	July 23, 2007.  mcr@xelerance.com.  Summary for 0.9.7 libpcap release
-
-	FIXED version file to be 0.9.7 instead of 0.9.5.
-	added flags/configuration for cloning bpf device.
-	added DLT_MTP2_WITH_PHDR support (PPI)
-        "fix" the "memory leak" in icode_to_fcode() -- documentation bug
-        Various link-layer types, with a pseudo-header, for SITA http://www.sita.aero/
-	introduces support for the DAG ERF type TYPE_COLOR_MC_HDLC_POS.
-	Basic BPF filtering support for DLT_MTP2_WITH_PHDR is also added.
-        check for IPv4 and IPv6, even for DLT_RAW 
-	add support for DLT_JUNIPER_ISM
-  	Pick up changes from NetBSD: many from tron, christos, drochner
-	Allocate DLT_ for 802.15.4 without any header munging, for Mikko Saarnivala.
-	Header for 802.16 MAC Common Part Sublayer plus a radiotap radio header
+Mon.    October 27, 2008.  ken@netfunctional.ca.  Summary for 1.0.0 libpcap release
+	Compile with IPv6 support by default
+	Compile with large file support on by default
+	Add pcap-config script, which deals with -I/-L flags for compiling
+	DLT: Add IPMB
+	DLT: Add LAPD
+	DLT: Add AX25 (AX.25 w/KISS header)
+	DLT: Add JUNIPER_ST
+	802.15.4 support
+	Variable length 802.11 header support
+	X2E data type support 
+	SITA ACN Interface support - see README.sita
+	Support for zerocopy BPF on platforms that support it
+	Better support for dealing with VLAN tagging/stripping on Linux
+	Fix dynamic library support on OSX
+	Return PCAP_ERROR_IFACE_NOT_UP if the interface isn't 'UP', so applications
+	 can print better diagnostic information
+	Return PCAP_ERROR_PERM_DENIED if we don't have permission to open a device, so
+	 applications can tell the user they need to go play with permissions
+	On Linux, ignore ENETDOWN so we can continue to capture packets if the 
+	 interface goes down and comes back up again.
+	On Linux, support new tpacket frame headers (2.6.27+)
+	On Mac OS X, add scripts for changing permissions on /dev/pbf* and launchd plist
+	On Solaris, support 'passive mode' on systems that support it
+	Fixes to autoconf and general build environment
+	Man page reorganization + cleanup
+	Autogenerate VERSION numbers better
+
+Mon.    September 10, 2007.  ken@xelerance.com.  Summary for 0.9.8 libpcap release
+        Change build process to put public libpcap headers into pcap subir
+        DLT: Add value for IPMI IPMB packets
+        DLT: Add value for u10 Networks boards
+        Require  for pf definitions - allows reading of pflog formatted 
+         libpcap files on an OS other than where the file was generated
 
-Wed.	April 25, 2007. ken@xelerance.com.  Summary for 0.9.6 libpcap release
+Wed.	April 25, 2007.  ken@xelerance.com.  Summary for 0.9.6 libpcap release
 
 	Put the public libpcap headers into a pcap subdirectory in both the
 	 source directory and the target include directory, and have include

Modified: head/contrib/libpcap/CREDITS
==============================================================================
--- head/contrib/libpcap/CREDITS	Sat Mar 21 22:35:44 2009	(r190224)
+++ head/contrib/libpcap/CREDITS	Sat Mar 21 22:58:08 2009	(r190225)
@@ -1,108 +1,126 @@
 This file lists people who have contributed to libpcap:
 
 The current maintainers:
-	Bill Fenner			
-	Fulvio Risso			
-	Guy Harris	 		
-	Hannes Gredler			
-	Jun-ichiro itojun Hagino	
-	Michael Richardson	 	
+	Bill Fenner			
+	Fulvio Risso			
+	Guy Harris	 		
+	Hannes Gredler			
+	Michael Richardson	 	
 
 Additional people who have contributed patches:
 
-	Alan Bawden			
-	Alexey Kuznetsov		
-	Albert Chin			
-	Andrew Brown			
-	Antti Kantee			
-	Arkadiusz Miskiewicz		
-	Armando L. Caro Jr.		
-	Assar Westerlund	 	
-	Brian Ginsbach			
-	Charles M. Hannum		
-	Chris G. Demetriou		
-	Chris Lightfoot			
-	Chris Pepper			
-	Daniele Orlandi			
-	Darren Reed			
-	David Kaelbling			
-	David Young			
-	Dean Gaudet			
-	Don Ebright			 
-	Dug Song			
-	Eric Anderson			
-        Erik de Castro Lopo             
-	Florent Drouin			
-	Franz Schaefer			
-	Gianluca Varenni		
-	Gilbert Hoyek			
-	Gisle Vanem			
-	Graeme Hewson			
-	Greg Stark			
-	Greg Troxel			
-	Guillaume Pelat			
-	Hyung Sik Yoon			
-	Igor Khristophorov		
-	Jan-Philip Velders		
-	Jason R. Thorpe			
-	Javier Achirica			
-	Jean Tourrilhes			
-	Jefferson Ogata			
-	Jesper Peterson			
-	John Bankier			
-	Jon Lindgren			
-	Juergen Schoenwaelder		
-	Jung-uk Kim			
-	Kazushi Sugyo			
-	Klaus Klein			
-	Koryn Grant			
-	Krzysztof Halasa		
-	Lorenzo Cavallaro		
-	Loris Degioanni			
-	Love Hörnquist-Åstrand		
-	Maciej W. Rozycki		
-	Marcus Felipe Pereira		
-	Mark C. Brown			
-	Mark Pizzolato			
-	Martin Husemann			
-	Matthew Luckie			
-	Max Laier			
-	Mike Kershaw			
-	Mike Wiacek			
-	Monroe Williams			
-	Nicolas Dade			
-	Octavian Cerna			
-	Olaf Kirch			
-	Ollie Wild			
-	Onno van der Linden		
-	Patrick Marie			
-	Paul Mundt			
-	Pavel Kankovsky			
-	Pawel Pokrywka			
-	Peter Fales			
-	Peter Jeremy			
-	Phil Wood			
-	Rafal Maszkowski		
-					
-	Rick Jones			
-	Scott Barron			
-	Scott Gifford			
-	Sebastian Krahmer		
-	Shaun Clowes			
-	Solomon Peachy			
-	Stefan Hudson			
-	Stephen Donnelly		
-	Takashi Yamamoto		
-        Tanaka Shin-ya                  
-	Tony Li				
-	Torsten Landschoff	 	
-	Uns Lider			
-	Uwe Girlich			
-	Xianjie Zhang			
+	Alan Bawden			
+	Alexander 'Leo' Bergolth	
+	Alexey Kuznetsov		
+	Albert Chin			
+	Andrew Brown			
+	Antti Kantee			
+	Arien Vijn			
+	Arkadiusz Miskiewicz		
+	Armando L. Caro Jr.		
+	Assar Westerlund	 	
+	Brian Ginsbach			
+	Charles M. Hannum		
+	Chris G. Demetriou		
+	Chris Lightfoot			
+	Chris Pepper			
+	Christian Peron			
+	Daniele Orlandi			
+	Darren Reed			
+	David Kaelbling			
+	David Young			
+	Dean Gaudet			
+	Don Ebright			 
+	Dug Song			
+	Eric Anderson			
+	Erik de Castro Lopo		
+	Florent Drouin			
+	Franz Schaefer			
+	Fulko Hew			
+	Gianluca Varenni		
+	Gilbert Hoyek			
+	Gisle Vanem			
+	Gisle Vanem			
+	Graeme Hewson			
+	Greg Stark			
+	Greg Troxel			
+	Gregor Maier			
+	Guillaume Pelat			
+	Hagen Paul Pfeifer		
+	Hyung Sik Yoon			
+	Igor Khristophorov		
+	Jan-Philip Velders		
+	Jason R. Thorpe			
+	Javier Achirica			
+	Jean Tourrilhes			
+	Jefferson Ogata			
+	Jesper Peterson			
+	Joerg Mayer			
+	John Bankier			
+	Jon Lindgren			
+	Juergen Schoenwaelder		
+	Jung-uk Kim			
+	Kazushi Sugyo			
+	Klaus Klein			
+	Koryn Grant			
+	Kris Katterjohn			
+	Krzysztof Halasa		
+	Lorenzo Cavallaro		
+	Loris Degioanni			
+	Love Hörnquist-Åstrand		
+	Luis Martin Garcia		
+	Maciej W. Rozycki		
+	Marcus Felipe Pereira		
+	Mark C. Brown			
+	Mark Pizzolato			
+	Martin Husemann			
+	Matthew Luckie			
+	Max Laier			
+	Mike Frysinger			
+	Mike Kershaw			
+	Mike Wiacek			
+	Monroe Williams			
+	Nicolas Dade			
+	Octavian Cerna			
+	Olaf Kirch			
+	Ollie Wild			
+	Onno van der Linden		
+	Paolo Abeni			
+	Patrick Marie			
+	Patrick McHardy			
+	Paul Mundt			
+	Pavel Kankovsky			
+	Pawel Pokrywka			
+	Peter Fales			
+	Peter Jeremy			
+	Phil Wood			
+	Rafal Maszkowski		
+					
+	Richard Stearn			
+	Rick Jones			
+	Sagun Shakya			
+	Scott Barron			
+	Scott Gifford			
+	Sebastian Krahmer		
+	Sepherosa Ziehau		
+	Shaun Clowes			
+	Solomon Peachy			
+	Stefan Hudson			
+	Stephen Donnelly		
+	Takashi Yamamoto		
+	Tanaka Shin-ya			
+	Tony Li				
+	Torsten Landschoff	 	
+	Uns Lider			
+	Uwe Girlich			
+	Xianjie Zhang			
 	Yen Yen Lim
-	Yoann Vandoorselaere		
+	Yoann Vandoorselaere		
 
 The original LBL crew:
 	Steve McCanne
 	Craig Leres
 	Van Jacobson
+
+Past maintainers:
+	Jun-ichiro itojun Hagino	

Modified: head/contrib/libpcap/INSTALL.txt
==============================================================================
--- head/contrib/libpcap/INSTALL.txt	Sat Mar 21 22:35:44 2009	(r190224)
+++ head/contrib/libpcap/INSTALL.txt	Sat Mar 21 22:58:08 2009	(r190225)
@@ -1,4 +1,4 @@
-@(#) $Header: /tcpdump/master/libpcap/INSTALL.txt,v 1.12.2.2 2007/09/12 19:17:24 guy Exp $ (LBL)
+@(#) $Header: /tcpdump/master/libpcap/INSTALL.txt,v 1.21.2.8 2008-06-12 20:25:38 guy Exp $ (LBL)
 
 To build libpcap, run "./configure" (a shell script). The configure
 script will determine your system attributes and generate an
@@ -211,8 +211,7 @@ Read the README.aix file for information
 configuring your system to be able to support libpcap.
 
 If you use NeXTSTEP, you will not be able to build libpcap from this
-release. We hope to support this operating system in some future
-release of libpcap.
+release.
 
 If you use SINIX, you should be able to build libpcap from this
 release. It is known to compile and run on SINIX-Y/N 5.42 with the C-DS
@@ -229,22 +228,22 @@ Another workaround is to use flex and bi
 
 If you use SCO, you might have trouble building libpcap from this
 release. We do not have a machine running SCO and have not had reports
-of anyone successfully building on it. Since SCO apparently supports
-DLPI, it's possible the current version works. Meanwhile, SCO provides
-a tcpdump binary as part of their "Network/Security Tools" package:
-
-    http://www.sco.com/technology/internet/goodies/#SECURITY
-
-There is also a README that explains how to enable packet capture.
-
-If you use UnixWare, you will not be able to build libpcap from this
-release. We hope to support this operating system in some future
-release of libpcap. Meanwhile, there appears to be an UnixWare port of
-libpcap 0.0 (and tcpdump 3.0) in:
-
-    ftp://ftp1.freebird.org/pub/mirror/freebird/internet/systools/
-
-UnixWare appears to use a hacked version of DLPI.
+of anyone successfully building on it; the current release of libpcap
+does not compile on SCO OpenServer 5.  Although SCO apparently supports
+DLPI to some extent, the DLPI in OpenServer 5 is very non-standard, and
+it appears that completely new code would need to be written to capture
+network traffic.  SCO do not appear to provide tcpdump binaries for
+OpenServer 5 or OpenServer 6 as part of SCO Skunkware:
+
+	http://www.sco.com/skunkware/
+
+If you use UnixWare, you might be able to build libpcap from this
+release, or you might not.  We do not have a machine running UnixWare,
+so we have not tested it; however, SCO provide packages for libpcap
+0.6.2 and tcpdump 3.7.1 in the UnixWare 7/Open UNIX 8 part of SCO
+Skunkware, and the source package for libpcap 0.6.2 is not changed from
+the libpcap 0.6.2 source release, so this release of libpcap might also
+build without changes on UnixWare 7.
 
 If linking tcpdump fails with "Undefined: _alloca" when using bison on
 a Sun4, your version of bison is broken. In any case version 1.16 or
@@ -298,7 +297,6 @@ CHANGES		- description of differences be
 ChmodBPF/*	- Mac OS X startup item to set ownership and permissions
 		  on /dev/bpf*
 CREDITS		- people that have helped libpcap along
-FILES		- list of files exported as part of the distribution
 INSTALL.txt	- this file
 LICENSE		- the license under which tcpdump is distributed
 Makefile.in	- compilation rules (input to the configure script)
@@ -309,6 +307,7 @@ README.hpux	- notes on using libpcap on 
 README.linux	- notes on using libpcap on Linux
 README.macosx	- notes on using libpcap on Mac OS X
 README.septel   - notes on using libpcap to capture on Intel/Septel devices
+README.sita	- notes on using libpcap to capture on SITA devices
 README.tru64	- notes on using libpcap on Digital/Tru64 UNIX
 README.Win32	- notes on using libpcap on Win32 systems (with WinPcap)
 SUNOS4		- pre-SunOS 4.1 replacement kernel nit modules
@@ -326,16 +325,22 @@ config.h.in	- autoconf input
 config.sub	- autoconf support
 configure	- configure script (run this first)
 configure.in	- configure script source
+dlpisubs.c	- DLPI-related functions for pcap-dlpi.c and pcap-libdlpi.c
+dlpisubs.h	- DLPI-related function declarations
 etherent.c	- /etc/ethers support routines
 ethertype.h	- Ethernet protocol types and names definitions
 fad-getad.c	- pcap_findalldevs() for systems with getifaddrs()
 fad-gifc.c	- pcap_findalldevs() for systems with only SIOCGIFLIST
 fad-glifc.c	- pcap_findalldevs() for systems with SIOCGLIFCONF
 fad-null.c	- pcap_findalldevs() for systems without capture support
+fad-sita.c	- pcap_findalldevs() for systems with SITA support
 fad-win32.c	- pcap_findalldevs() for WinPcap
+filtertest.c	- test program for BPF compiler
+findalldevstest.c - test program for pcap_findalldevs()
 gencode.c	- BPF code generation routines
 gencode.h	- BPF code generation definitions
 grammar.y	- filter string grammar
+ieee80211.h	- 802.11 definitions
 inet.c		- network routines
 install-sh	- BSD style install script
 lbl/os-*.h	- OS-dependent defines and prototypes
@@ -348,8 +353,16 @@ nlpid.h		- OSI network layer protocol id
 net		- symlink to bpf/net
 optimize.c	- BPF optimization routines
 packaging	- packaging information for building libpcap RPMs
+pcap/bluetooth.h - public definition of DLT_BLUETOOTH_HCI_H4_WITH_PHDR header
+pcap/bpf.h	- BPF definitions
+pcap/namedb.h	- public libpcap name database definitions
+pcap/pcap.h	- public libpcap definitions
+pcap/sll.h	- public definition of DLT_LINUX_SLL header
+pcap/usb.h	- public definition of DLT_USB header
 pcap-bpf.c	- BSD Packet Filter support
-pcap-bpf.h	- BPF definitions
+pcap-bpf.h	- header for backwards compatibility
+pcap-bt-linux.c	- Bluetooth capture support for Linux
+pcap-bt-linux.h	- Bluetooth capture support for Linux
 pcap-dag.c	- Endace DAG device capture support
 pcap-dag.h	- Endace DAG device capture support
 pcap-dlpi.c	- Data Link Provider Interface support
@@ -357,26 +370,34 @@ pcap-dos.c	- MS-DOS capture support
 pcap-dos.h	- headers for MS-DOS capture support
 pcap-enet.c	- enet support
 pcap-int.h	- internal libpcap definitions
+pcap-libdlpi.c	- Data Link Provider Interface support for systems with libdlpi
 pcap-linux.c	- Linux packet socket support
-pcap-namedb.h	- public libpcap name database definitions
+pcap-namedb.h	- header for backwards compatibility
 pcap-nit.c	- SunOS Network Interface Tap support
 pcap-nit.h	- SunOS Network Interface Tap definitions
 pcap-null.c	- dummy monitor support (allows offline use of libpcap)
 pcap-pf.c	- Ultrix and Digital/Tru64 UNIX Packet Filter support
 pcap-pf.h	- Ultrix and Digital/Tru64 UNIX Packet Filter definitions
-pcap-septel.c   - INTEL/Septel device capture support
-pcap-septel.h   - INTEL/Septel device capture support
+pcap-septel.c   - Intel/Septel device capture support
+pcap-septel.h   - Intel/Septel device capture support
+pcap-sita.c	- SITA device capture support
+pcap-sita.h	- SITA device capture support
+pcap-sita.html	- SITA device capture documentation
 pcap-stdinc.h	- includes and #defines for compiling on Win32 systems
 pcap-snit.c	- SunOS 4.x STREAMS-based Network Interface Tap support
 pcap-snoop.c	- IRIX Snoop network monitoring support
+pcap-usb-linux.c - USB capture support for Linux
+pcap-usb-linux.h - USB capture support for Linux
 pcap-win32.c	- WinPcap capture support
-pcap.3		- manual entry
+pcap.3pcap	- manual entry for the library
 pcap.c		- pcap utility routines
-pcap.h		- public libpcap definitions
+pcap.h		- header for backwards compatibility
+pcap_*.3pcap	- manual entries for library functions
+pcap-filter.4	- manual entry for filter syntax
+pcap-linktype.4	- manual entry for link-layer header types
 ppp.h		- Point to Point Protocol definitions
-rawss7.h	- information on DLT_ types for SS7
+runlex.sh	- wrapper for Lex/Flex
 savefile.c	- offline support
 scanner.l	- filter string scanner
-sll.h		- definitions for Linux cooked mode fake link-layer header
 sunatmpos.h	- definitions for SunATM capturing
 Win32		- headers and routines for building on Win32 systems

Modified: head/contrib/libpcap/Makefile.in
==============================================================================
--- head/contrib/libpcap/Makefile.in	Sat Mar 21 22:35:44 2009	(r190224)
+++ head/contrib/libpcap/Makefile.in	Sat Mar 21 22:58:08 2009	(r190225)
@@ -17,7 +17,7 @@
 #  WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
 #  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 #
-# @(#) $Header: /tcpdump/master/libpcap/Makefile.in,v 1.99.2.2 2007/07/24 02:35:15 mcr Exp $ (LBL)
+# @(#) $Header: /tcpdump/master/libpcap/Makefile.in,v 1.108.2.28 2008-10-23 22:13:21 guy Exp $ (LBL)
 
 #
 # Various configurable paths (remember to edit Makefile.in, not Makefile)
@@ -26,11 +26,14 @@
 # Top level hierarchy
 prefix = @prefix@
 exec_prefix = @exec_prefix@
+datarootdir = @datarootdir@
+# Pathname of directory to install the configure program
+bindir = @bindir@
 # Pathname of directory to install the include files
 includedir = @includedir@
 # Pathname of directory to install the library
 libdir =  @libdir@
-# Pathname of directory to install the man page
+# Pathname of directory to install the man pages
 mandir = @mandir@
 
 # VPATH
@@ -47,6 +50,7 @@ INCLS = -I. @V_INCLS@
 DEFS = @DEFS@ @V_DEFS@
 LIBS = @V_LIBS@
 DAGLIBS = @DAGLIBS@
+DEPLIBS = @DEPLIBS@
 DYEXT = @DYEXT@
 PROG=libpcap
 
@@ -73,7 +77,7 @@ YACC = @V_YACC@
 	@rm -f $@
 	$(CC) $(CFLAGS) -c $(srcdir)/$*.c
 
-PSRC =	pcap-@V_PCAP@.c
+PSRC =	pcap-@V_PCAP@.c @USB_SRC@ @BT_SRC@
 FSRC =  fad-@V_FINDALLDEVS@.c
 SSRC =  @SSRC@
 CSRC =	pcap.c inet.c gencode.c optimize.c nametoaddr.c \
@@ -86,10 +90,31 @@ SRC =	$(PSRC) $(FSRC) $(CSRC) $(SSRC) $(
 # We would like to say "OBJ = $(SRC:.c=.o)" but Ultrix's make cannot
 # hack the extra indirection
 OBJ =	$(PSRC:.c=.o) $(FSRC:.c=.o) $(CSRC:.c=.o) $(SSRC:.c=.o) $(GENSRC:.c=.o) $(LIBOBJS)
-HDR =	pcap.h pcap-int.h pcap-namedb.h pcap-nit.h pcap-pf.h \
-	ethertype.h gencode.h gnuc.h
+HDR = \
+	acconfig.h \
+	arcnet.h \
+	atmuni31.h \
+	ethertype.h \
+	gencode.h \
+	ieee80211.h \
+	llc.h \
+	nlpid.h \
+	pcap/bluetooth.h \
+	pcap/bpf.h \
+	pcap/namedb.h \
+	pcap/pcap.h \
+	pcap/sll.h \
+	pcap/usb.h \
+	pcap/vlan.h \
+	pcap.h \
+	pcap-int.h \
+	pcap-namedb.h \
+	pcap-stdinc.h \
+	ppp.h \
+	sunatmpos.h
+
 GENHDR = \
-	tokdefs.h version.h
+	scanner.h tokdefs.h version.h
 
 TAGHDR = \
 	pcap-bpf.h
@@ -99,11 +124,198 @@ TAGFILES = \
 
 CLEANFILES = $(OBJ) libpcap.a $(GENSRC) $(GENHDR) lex.yy.c
 
-all: libpcap.a
+MAN1 = pcap-config.1
+
+MAN3PCAP_EXPAND = \
+	pcap.3pcap.in \
+	pcap_compile.3pcap.in \
+	pcap_datalink.3pcap.in \
+	pcap_dump_open.3pcap.in \
+	pcap_list_datalinks.3pcap.in \
+	pcap_open_dead.3pcap.in \
+	pcap_open_offline.3pcap.in
+
+MAN3PCAP_NOEXPAND = \
+	pcap_activate.3pcap \
+	pcap_breakloop.3pcap \
+	pcap_can_set_rfmon.3pcap \
+	pcap_close.3pcap \
+	pcap_create.3pcap \
+	pcap_datalink_name_to_val.3pcap \
+	pcap_datalink_val_to_name.3pcap \
+	pcap_dump.3pcap \
+	pcap_dump_close.3pcap \
+	pcap_dump_file.3pcap \
+	pcap_dump_flush.3pcap \
+	pcap_dump_ftell.3pcap \
+	pcap_file.3pcap \
+	pcap_fileno.3pcap \
+	pcap_findalldevs.3pcap \
+	pcap_freealldevs.3pcap \
+	pcap_freecode.3pcap \
+	pcap_free_datalinks.3pcap \
+	pcap_get_selectable_fd.3pcap \
+	pcap_geterr.3pcap \
+	pcap_inject.3pcap \
+	pcap_is_swapped.3pcap \
+	pcap_lib_version.3pcap \
+	pcap_lookupdev.3pcap \
+	pcap_lookupnet.3pcap \
+	pcap_loop.3pcap \
+	pcap_major_version.3pcap \
+	pcap_next_ex.3pcap \
+	pcap_offline_filter.3pcap \
+	pcap_open_live.3pcap \
+	pcap_set_buffer_size.3pcap \
+	pcap_set_datalink.3pcap \
+	pcap_set_promisc.3pcap \
+	pcap_set_rfmon.3pcap \
+	pcap_set_snaplen.3pcap \
+	pcap_set_timeout.3pcap \
+	pcap_setdirection.3pcap \
+	pcap_setfilter.3pcap \
+	pcap_setnonblock.3pcap \
+	pcap_snapshot.3pcap \
+	pcap_stats.3pcap \
+	pcap_statustostr.3pcap \
+	pcap_strerror.3pcap
+
+MAN3PCAP = $(MAN3PCAP_NOEXPAND) $(MAN3PCAP_EXPAND:.in=)
+
+MANFILE = \
+	pcap-savefile.manfile.in
+
+MANMISC = \
+	pcap-filter.manmisc.in \
+	pcap-linktype.manmisc.in
+
+EXTRA_DIST = \
+	CHANGES \
+	ChmodBPF/ChmodBPF \
+	ChmodBPF/StartupParameters.plist \
+	CREDITS \
+	INSTALL.txt \
+	LICENSE \
+	Makefile.in \
+	README \
+	README.aix \
+	README.dag \
+	README.hpux \
+	README.linux \
+	README.macosx \
+	README.septel \
+	README.sita \
+	README.tru64 \
+	README.Win32 \
+	SUNOS4/nit_if.o.sparc \
+	SUNOS4/nit_if.o.sun3 \
+	SUNOS4/nit_if.o.sun4c.4.0.3c \
+	TODO \
+	VERSION \
+	aclocal.m4 \
+	bpf/net/bpf_filter.c \
+	chmod_bpf \
+	config.guess \
+	config.h.in \
+	config.sub \
+	configure \
+	configure.in \
+	dlpisubs.c \
+	dlpisubs.h \
+	fad-getad.c \
+	fad-gifc.c \
+	fad-glifc.c \
+	fad-null.c \
+	fad-sita.c \
+	fad-win32.c \
+	filtertest.c \
+	findalldevstest.c \
+	grammar.y \
+	install-sh \
+	lbl/os-aix4.h \
+	lbl/os-hpux11.h \
+	lbl/os-osf4.h \
+	lbl/os-osf5.h \
+	lbl/os-solaris2.h \
+	lbl/os-sunos4.h \
+	lbl/os-ultrix4.h \
+	missing/snprintf.c \
+	mkdep \
+	msdos/bin2c.c \
+	msdos/common.dj \
+	msdos/makefile \
+	msdos/makefile.dj \
+	msdos/makefile.wc \
+	msdos/ndis2.c \
+	msdos/ndis2.h \
+	msdos/ndis_0.asm \
+	msdos/pkt_rx0.asm \
+	msdos/pkt_rx1.s \
+	msdos/pktdrvr.c \
+	msdos/pktdrvr.h \
+	msdos/readme.dos \
+	net/bpf_filter.c \
+	org.tcpdump.chmod_bpf.plist \
+	packaging/pcap.spec.in \
+	pcap-bpf.c \
+	pcap-bpf.h \
+	pcap-bt-linux.c \
+	pcap-bt-linux.h \
+	pcap-config.in \
+	pcap-dag.c \
+	pcap-dag.h \
+	pcap-dlpi.c \
+	pcap-dos.c \
+	pcap-dos.h \
+	pcap-enet.c \
+	pcap-int.h \
+	pcap-libdlpi.c \
+	pcap-linux.c \
+	pcap-namedb.h \
+	pcap-nit.c \
+	pcap-null.c \
+	pcap-pf.c \
+	pcap-septel.c \
+	pcap-septel.h \
+	pcap-sita.h \
+	pcap-sita.c \
+	pcap-sita.html \
+	pcap-snit.c \
+	pcap-snoop.c \
+	pcap-usb-linux.c \
+	pcap-usb-linux.h \
+	pcap-win32.c \
+	runlex.sh \
+	scanner.l \
+	Win32/Include/Gnuc.h \
+	Win32/Include/addrinfo.h \
+	Win32/Include/bittypes.h \
+	Win32/Include/cdecl_ext.h \
+	Win32/Include/inetprivate.h \
+	Win32/Include/ip6_misc.h \
+	Win32/Include/sockstorage.h \
+	Win32/Include/arpa/nameser.h \
+	Win32/Include/net/if.h \
+	Win32/Include/net/netdb.h \
+	Win32/Include/net/paths.h \
+	Win32/Prj/libpcap.dsp \
+	Win32/Prj/libpcap.dsw \
+	Win32/Src/ffs.c \
+	Win32/Src/gai_strerror.c \
+	Win32/Src/getaddrinfo.c \
+	Win32/Src/getnetbynm.c \
+	Win32/Src/getnetent.c \
+	Win32/Src/getopt.c \
+	Win32/Src/getservent.c \
+	Win32/Src/inet_aton.c \
+	Win32/Src/inet_net.c \
+	Win32/Src/inet_pton.c
+
+all: libpcap.a pcap-config
 
 libpcap.a: $(OBJ)
 	@rm -f $@
-	ar rc $@ $(OBJ) $(LIBS)
+	$(AR) rc $@ $(OBJ) $(LIBS)
 	$(RANLIB) $@
 
 shared: libpcap.$(DYEXT)
@@ -114,19 +326,27 @@ shared: libpcap.$(DYEXT)
 #
 libpcap.so: $(OBJ)
 	@rm -f $@
-	$(CC) -shared -o $@.`cat VERSION` $(OBJ) $(DAGLIBS)
+	$(CC) -shared -Wl,-soname,$@.1 -o $@.`cat $(srcdir)/VERSION` $(OBJ) $(DAGLIBS)
 
-# the following rule succeeds, but the result is untested.
+#
+# The following rule succeeds, but the result is untested.
+#
+# XXX - OS X installs the library as "libpcap.A.dylib", with that as the
+# install_name, and sets the current version to 1 as well.  VERSION
+# might contain a not-purely-numeric version number, but
+# -current_version requires a purely numeric version, so this won't
+# work with top-of-tree builds.
+#
 libpcap.dylib: $(OBJ)
 	rm -f libpcap*.dylib
-	$(CC) -dynamiclib -undefined error -o libpcap.`cat VERSION`.dylib $(OBJ) \
-		-install_name $(libdir)/libpcap.0.dylib -compatibility_version `cat VERSION` \
-		-current_version `cat VERSION`
-
+	$(CC) -dynamiclib -undefined error -o libpcap.`cat $(srcdir)/VERSION`.dylib $(OBJ) \
+		-install_name $(libdir)/libpcap.A.dylib \
+		-compatibility_version 1 \
+		-current_version `sed 's/[^0-9.].*$$//' $(srcdir)/VERSION`
 
 scanner.c: $(srcdir)/scanner.l
 	@rm -f $@
-	$(LEX) -t $< > $$$$.$@; mv $$$$.$@ $@
+	./runlex.sh $(LEX) -o$@ $<
 
 scanner.o: scanner.c tokdefs.h
 	$(CC) $(CFLAGS) -c scanner.c
@@ -172,43 +392,135 @@ bpf_filter.c: $(srcdir)/bpf/net/bpf_filt
 bpf_filter.o: bpf_filter.c
 	$(CC) $(CFLAGS) -c bpf_filter.c
 
-install: libpcap.a 
+#
+# Generate the pcap-config script.
+#
+pcap-config: pcap-config.in Makefile
+	@rm -f $@ $@.tmp
+	sed -e 's|@includedir[@]|$(includedir)|g' \
+	    -e 's|@libdir[@]|$(libdir)|g' \
+	    -e 's|@DEPLIBS[@]|$(DEPLIBS)|g' \
+	    pcap-config.in >$@.tmp
+	mv $@.tmp $@
+	chmod a+x $@
+
+#
+# Test programs - not built by default, and not installed.
+#
+filtertest: filtertest.c libpcap.a
+	$(CC) $(CFLAGS) -I. -L. -o filtertest filtertest.c libpcap.a
+
+findalldevstest: findalldevstest.c libpcap.a
+	$(CC) $(CFLAGS) -I. -L. -o findalldevstest findalldevstest.c libpcap.a
+
+install: libpcap.a pcap-config
 	[ -d $(DESTDIR)$(libdir) ] || \
 	    (mkdir -p $(DESTDIR)$(libdir); chmod 755 $(DESTDIR)$(libdir))
 	$(INSTALL_DATA) libpcap.a $(DESTDIR)$(libdir)/libpcap.a
 	$(RANLIB) $(DESTDIR)$(libdir)/libpcap.a
 	[ -d $(DESTDIR)$(includedir) ] || \
 	    (mkdir -p $(DESTDIR)$(includedir); chmod 755 $(DESTDIR)$(includedir))
+	[ -d $(DESTDIR)$(includedir)/pcap ] || \
+	    (mkdir -p $(DESTDIR)$(includedir)/pcap; chmod 755 $(DESTDIR)$(includedir)/pcap)
+	[ -d $(DESTDIR)$(mandir)/man1 ] || \
+	    (mkdir -p $(DESTDIR)$(mandir)/man1; chmod 755 $(DESTDIR)$(mandir)/man1)
+	[ -d $(DESTDIR)$(mandir)/man3 ] || \
+	    (mkdir -p $(DESTDIR)$(mandir)/man3; chmod 755 $(DESTDIR)$(mandir)/man3)
+	[ -d $(DESTDIR)$(mandir)/man@MAN_FILE_FORMATS@ ] || \
+	    (mkdir -p $(DESTDIR)$(mandir)/man@MAN_FILE_FORMATS@; chmod 755 $(DESTDIR)$(mandir)/man@MAN_FILE_FORMATS@)
+	[ -d $(DESTDIR)$(mandir)/man@MAN_MISC_INFO@ ] || \
+	    (mkdir -p $(DESTDIR)$(mandir)/man@MAN_MISC_INFO@; chmod 755 $(DESTDIR)$(mandir)/man@MAN_MISC_INFO@)
+	$(INSTALL_DATA) $(srcdir)/pcap/pcap.h \
+	    $(DESTDIR)$(includedir)/pcap/pcap.h
+	$(INSTALL_DATA) $(srcdir)/pcap/bpf.h \
+	    $(DESTDIR)$(includedir)/pcap/bpf.h
+	$(INSTALL_DATA) $(srcdir)/pcap/namedb.h \
+	    $(DESTDIR)$(includedir)/pcap/namedb.h
+	$(INSTALL_DATA) $(srcdir)/pcap/sll.h \
+	    $(DESTDIR)$(includedir)/pcap/sll.h
+	$(INSTALL_DATA) $(srcdir)/pcap/usb.h \
+	    $(DESTDIR)$(includedir)/pcap/usb.h
 	$(INSTALL_DATA) $(srcdir)/pcap.h $(DESTDIR)$(includedir)/pcap.h
 	$(INSTALL_DATA) $(srcdir)/pcap-bpf.h \
 	    $(DESTDIR)$(includedir)/pcap-bpf.h
 	$(INSTALL_DATA) $(srcdir)/pcap-namedb.h \
 	    $(DESTDIR)$(includedir)/pcap-namedb.h
-	[ -d $(DESTDIR)$(mandir)/man3 ] || \
-		(mkdir -p $(DESTDIR)$(mandir)/man3; chmod 755 $(DESTDIR)$(mandir)/man3)
-	$(INSTALL_DATA) $(srcdir)/pcap.3 \
-	    $(DESTDIR)$(mandir)/man3/pcap.3
+	$(INSTALL_PROGRAM) pcap-config $(DESTDIR)$(bindir)/pcap-config
+	for i in $(MAN1); do \
+		$(INSTALL_DATA) $(srcdir)/$$i \
+		    $(DESTDIR)$(mandir)/man1/$$i; done
+	for i in $(MAN3PCAP); do \
+		$(INSTALL_DATA) $(srcdir)/$$i \
+		    $(DESTDIR)$(mandir)/man3/$$i; done
+	ln $(DESTDIR)$(mandir)/man3/pcap_datalink_val_to_name.3pcap \
+		 $(DESTDIR)$(mandir)/man3/pcap_datalink_val_to_description.3pcap
+	ln $(DESTDIR)$(mandir)/man3/pcap_dump_open.3pcap \
+		 $(DESTDIR)$(mandir)/man3/pcap_dump_fopen.3pcap
+	ln $(DESTDIR)$(mandir)/man3/pcap_geterr.3pcap \
+		 $(DESTDIR)$(mandir)/man3/pcap_perror.3pcap
+	ln $(DESTDIR)$(mandir)/man3/pcap_inject.3pcap \
+		 $(DESTDIR)$(mandir)/man3/pcap_sendpacket.3pcap
+	ln $(DESTDIR)$(mandir)/man3/pcap_loop.3pcap \
+		 $(DESTDIR)$(mandir)/man3/pcap_dispatch.3pcap
+	ln $(DESTDIR)$(mandir)/man3/pcap_major_version.3pcap \
+		 $(DESTDIR)$(mandir)/man3/pcap_minor_version.3pcap
+	ln $(DESTDIR)$(mandir)/man3/pcap_next_ex.3pcap \
+		 $(DESTDIR)$(mandir)/man3/pcap_next.3pcap
+	ln $(DESTDIR)$(mandir)/man3/pcap_open_offline.3pcap \
+		 $(DESTDIR)$(mandir)/man3/pcap_fopen_offline.3pcap
+	ln $(DESTDIR)$(mandir)/man3/pcap_setnonblock.3pcap \
+		 $(DESTDIR)$(mandir)/man3/pcap_getnonblock.3pcap
+	for i in $(MANFILE); do \
+		$(INSTALL_DATA) $(srcdir)/`echo $$i | sed 's/.manfile.in/.manfile/'` \
+		    $(DESTDIR)$(mandir)/man@MAN_FILE_FORMATS@/`echo $$i | sed 's/.manfile.in/.@MAN_FILE_FORMATS@/'`; done
+	for i in $(MANMISC); do \
+		$(INSTALL_DATA) $(srcdir)/`echo $$i | sed 's/.manmisc.in/.manmisc/'` \
+		    $(DESTDIR)$(mandir)/man@MAN_MISC_INFO@/`echo $$i | sed 's/.manmisc.in/.@MAN_MISC_INFO@/'`; done
 
 install-shared: install-shared-$(DYEXT)
 install-shared-so: libpcap.so
 	$(INSTALL_PROGRAM) libpcap.so.`cat VERSION` $(DESTDIR)$(libdir)/libpcap.so.`cat VERSION`
 install-shared-dylib: libpcap.dylib
 	$(INSTALL_PROGRAM) libpcap.`cat VERSION`.dylib $(DESTDIR)$(libdir)/libpcap.`cat VERSION`.dylib
-	VER=`cat VERSION`; cd $(DESTDIR)$(libdir) && ln -sf libpcap.$$VER.dylib libpcap.0.dylib;  ln -sf libpcap.0.dylib libpcap.dylib
+	VER=`cat VERSION`; cd $(DESTDIR)$(libdir) && ln -sf libpcap.$$VER.dylib libpcap.A.dylib;  ln -sf libpcap.A.dylib libpcap.dylib
 
 uninstall:
 	rm -f $(DESTDIR)$(libdir)/libpcap.a
+	rm -f $(DESTDIR)$(includedir)/pcap/pcap.h
+	rm -f $(DESTDIR)$(includedir)/pcap/bpf.h
+	rm -f $(DESTDIR)$(includedir)/pcap/namedb.h
+	rm -f $(DESTDIR)$(includedir)/pcap/sll.h
+	rm -f $(DESTDIR)$(includedir)/pcap/usb.h
+	-rmdir $(DESTDIR)$(includedir)/pcap
 	rm -f $(DESTDIR)$(includedir)/pcap.h
 	rm -f $(DESTDIR)$(includedir)/pcap-bpf.h
 	rm -f $(DESTDIR)$(includedir)/pcap-namedb.h
-	rm -f $(DESTDIR)$(mandir)/man3/pcap.3
+	for i in $(MAN1); do \
+		rm -f $(DESTDIR)$(mandir)/man1/$$i; done
+	for i in $(MAN3PCAP); do \
+		rm -f $(DESTDIR)$(mandir)/man3/$$i; done
+	rm -f  $(DESTDIR)$(mandir)/man3/pcap_datalink_val_to_description.3pcap
+	rm -f  $(DESTDIR)$(mandir)/man3/pcap_dump_fopen.3pcap
+	rm -f  $(DESTDIR)$(mandir)/man3/pcap_perror.3pcap
+	rm -f  $(DESTDIR)$(mandir)/man3/pcap_sendpacket.3pcap
+	rm -f  $(DESTDIR)$(mandir)/man3/pcap_dispatch.3pcap
+	rm -f  $(DESTDIR)$(mandir)/man3/pcap_minor_version.3pcap
+	rm -f  $(DESTDIR)$(mandir)/man3/pcap_next.3pcap
+	rm -f  $(DESTDIR)$(mandir)/man3/pcap_fopen_offline.3pcap
+	rm -f  $(DESTDIR)$(mandir)/man3/pcap_getnonblock.3pcap
+	for i in $(MANFILE); do \
+		rm -f $(DESTDIR)$(mandir)/man@MAN_FILE_FORMATS@/`echo $$i | sed 's/.manfile.in/.@MAN_FILE_FORMATS@/'`; done
+	for i in $(MANMISC); do \
+		rm -f $(DESTDIR)$(mandir)/man@MAN_MISC_INFO@/`echo $$i | sed 's/.manmisc.in/.@MAN_MISC_INFO@/'`; done
 
 clean:
 	rm -f $(CLEANFILES) libpcap*.dylib libpcap.so*
 
 distclean: clean
 	rm -f Makefile config.cache config.log config.status \
-	    config.h gnuc.h os-proto.h bpf_filter.c stamp-h stamp-h.in
+	    config.h gnuc.h os-proto.h bpf_filter.c pcap-config \
+	    stamp-h stamp-h.in
+	rm -f $(MAN3PCAP_EXPAND:.in=) $(MANFILE:.in=) $(MANMISC:.in=)
 	rm -rf autom4te.cache
 
 tags: $(TAGFILES)
@@ -220,8 +532,12 @@ packaging/pcap.spec: packaging/pcap.spec
 
 releasetar:
 	@cwd=`pwd` ; dir=`basename $$cwd` ; name=$(PROG)-`cat VERSION` ; \
-	   list="" ; make distclean; cd ..; mkdir -p n; cd n; ln -s ../$$dir $$name; \
-	   tar -c -z -f $$name.tar.gz $$name/. ;
+	   mkdir $$name; \
+	   tar cf - $(CSRC) $(HDR) $(MAN1) $(MAN3PCAP_EXPAND) \
+	      $(MAN3PCAP_NOEXPAND) $(MANFILE) $(MANMISC) $(EXTRA_DIST) | \
+	      (cd $$name; tar xf -); \
+	   tar -c -z -f $$name.tar.gz $$name; \
+	   rm -rf $$name
 
 depend:	$(GENSRC) $(GENHDR) bpf_filter.c
 	./mkdep -c $(CC) $(DEFS) $(INCLS) $(SRC)

Modified: head/contrib/libpcap/README
==============================================================================
--- head/contrib/libpcap/README	Sat Mar 21 22:35:44 2009	(r190224)
+++ head/contrib/libpcap/README	Sat Mar 21 22:58:08 2009	(r190225)
@@ -1,20 +1,22 @@
-@(#) $Header: /tcpdump/master/libpcap/README,v 1.30 2004/10/12 02:02:28 guy Exp $ (LBL)
+@(#) $Header: /tcpdump/master/libpcap/README,v 1.30.4.3 2008-10-17 10:39:20 ken Exp $ (LBL)
 
-LIBPCAP 0.9
-Now maintained by "The Tcpdump Group"
-See 		www.tcpdump.org
+LIBPCAP 1.0.0
 
-Please send inquiries/comments/reports to 	tcpdump-workers@tcpdump.org
+www.tcpdump.org
+
+Please send inquiries/comments/reports to:
+	tcpdump-workers@lists.tcpdump.org
 
 Anonymous CVS is available via:
 	cvs -d :pserver:tcpdump@cvs.tcpdump.org:/tcpdump/master login
 	(password "anoncvs")
 	cvs -d :pserver:tcpdump@cvs.tcpdump.org:/tcpdump/master checkout libpcap
 
-Version 0.9 of LIBPCAP can be retrieved with the CVS tag "libpcap_0_9rel1":
-	cvs -d :pserver:tcpdump@cvs.tcpdump.org:/tcpdump/master checkout -r libpcap_0_9rel1 libpcap
+Version 1.0.0 of LIBPCAP can be retrieved with the CVS tag "libpcap_1_0":
+	cvs -d :pserver:tcpdump@cvs.tcpdump.org:/tcpdump/master checkout -r libpcap_1_0 libpcap
 
-Please send patches against the master copy to patches@tcpdump.org.
+Please submit patches against the master copy to the libpcap project on
+sourceforge.net.
 
 formerly from 	Lawrence Berkeley National Laboratory
 		Network Research Group 
@@ -30,8 +32,6 @@ require this functionality, we've create
 to ease in porting and to alleviate the need for several
 system-dependent packet capture modules in each application.
 
-Note well: this interface is new and is likely to change.
-
 For some platforms there are README.{system} files that discuss issues
 with the OS's interface for packet capture on those platforms, such as
 how to enable support for that interface in the OS, if it's not built in
@@ -77,16 +77,28 @@ Linux, in the 2.2 kernel and later kerne
 mechanism that accepts BPF filters; see the README.linux file for
 information on configuring that option.
 
+Note to Linux distributions and *BSD systems that include libpcap:
+
+There's now a rule to make a shared library, which should work on Linux 
+and *BSD (and OS X).
+
+It sets the soname of the library to "libpcap.so.1"; this is what it 
+should be, *NOT* libpcap.so.1.0 or libpcap.so.1.0.0 or something such as 
+that.
+
+We've been maintaining binary compatibility between libpcap releases for 
+quite a while; there's no reason to tie a binary linked with libpcap to 
+a particular release of libpcap.
+
 Problems, bugs, questions, desirable enhancements, etc. should be sent
-to the address "tcpdump-workers@tcpdump.org".  Bugs, support requests,
-and feature requests may also be submitted on the SourceForge site for
-libpcap at
+to the address "tcpdump-workers@lists.tcpdump.org".  Bugs, support
+requests, and feature requests may also be submitted on the SourceForge
+site for libpcap at
 
 	http://sourceforge.net/projects/libpcap/
 
 Source code contributions, etc. should be sent to the email address
-"patches@tcpdump.org", or submitted as patches on the SourceForge site
-for libpcap.
+submitted as patches on the SourceForge site for libpcap.
 
 Current versions can be found at www.tcpdump.org, or the SourceForge
 site for libpcap.

Modified: head/contrib/libpcap/VERSION
==============================================================================
--- head/contrib/libpcap/VERSION	Sat Mar 21 22:35:44 2009	(r190224)
+++ head/contrib/libpcap/VERSION	Sat Mar 21 22:58:08 2009	(r190225)

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

From owner-svn-src-head@FreeBSD.ORG  Sat Mar 21 22:59:03 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 391331065673;
	Sat, 21 Mar 2009 22:59:03 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 266A88FC17;
	Sat, 21 Mar 2009 22:59:03 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2LMx3Ds049648;
	Sat, 21 Mar 2009 22:59:03 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2LMx2tJ049646;
	Sat, 21 Mar 2009 22:59:02 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <200903212259.n2LMx2tJ049646@svn.freebsd.org>
From: Rui Paulo 
Date: Sat, 21 Mar 2009 22: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: r190226 - head/lib/libpcap
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 21 Mar 2009 22:59:04 -0000

Author: rpaulo
Date: Sat Mar 21 22:59:02 2009
New Revision: 190226
URL: http://svn.freebsd.org/changeset/base/190226

Log:
  Support files for new libpcap 1.0.0.
  Includes a shlib bump.

Modified:
  head/lib/libpcap/Makefile
  head/lib/libpcap/config.h

Modified: head/lib/libpcap/Makefile
==============================================================================
--- head/lib/libpcap/Makefile	Sat Mar 21 22:58:08 2009	(r190225)
+++ head/lib/libpcap/Makefile	Sat Mar 21 22:59:02 2009	(r190226)
@@ -11,56 +11,72 @@ SRCS=	grammar.y tokdefs.h version.h pcap
 	etherent.c savefile.c bpf_filter.c bpf_image.c bpf_dump.c \
 	scanner.l version.c
 INCS=	pcap.h pcap-int.h pcap-namedb.h pcap-bpf.h
-MAN=	pcap.3
-MLINKS=	pcap.3 pcap_open_live.3 \
-	pcap.3 pcap_open_dead.3 \
-	pcap.3 pcap_open_offline.3 \
-	pcap.3 pcap_fopen_offline.3 \
-	pcap.3 pcap_dump_open.3 \
-	pcap.3 pcap_dump_fopen.3 \
-	pcap.3 pcap_setnonblock.3 \
-	pcap.3 pcap_getnonblock.3 \
-	pcap.3 pcap_findalldevs.3 \
-	pcap.3 pcap_freealldevs.3 \
-	pcap.3 pcap_lookupdev.3 \
-	pcap.3 pcap_lookupnet.3 \
-	pcap.3 pcap_dispatch.3 \
-	pcap.3 pcap_loop.3 \
-	pcap.3 pcap_dump.3 \
-	pcap.3 pcap_compile.3 \
-	pcap.3 pcap_setfilter.3 \
-	pcap.3 pcap_freecode.3 \
-	pcap.3 pcap_setdirection.3 \
-	pcap.3 pcap_next.3 \
-	pcap.3 pcap_next_ex.3 \
-	pcap.3 pcap_breakloop.3 \
-	pcap.3 pcap_inject.3 \
-	pcap.3 pcap_sendpacket.3 \
-	pcap.3 pcap_datalink.3 \
-	pcap.3 pcap_list_datalinks.3 \
-	pcap.3 pcap_set_datalink.3 \
-	pcap.3 pcap_datalink_name_to_val.3 \
-	pcap.3 pcap_datalink_val_to_name.3 \
-	pcap.3 pcap_datalink_val_to_description.3 \
-	pcap.3 pcap_snapshot.3 \
-	pcap.3 pcap_is_swapped.3 \
-	pcap.3 pcap_major_version.3 \
-	pcap.3 pcap_minor_version.3 \
-	pcap.3 pcap_stats.3 \
-	pcap.3 pcap_file.3 \
-	pcap.3 pcap_fileno.3 \
-	pcap.3 pcap_get_selectable_fd.3 \
-	pcap.3 pcap_perror.3 \
-	pcap.3 pcap_geterr.3 \
-	pcap.3 pcap_strerror.3 \
-	pcap.3 pcap_lib_version.3 \
-	pcap.3 pcap_close.3 \
-	pcap.3 pcap_dump_flush.3 \
-	pcap.3 pcap_dump_ftell.3 \
-	pcap.3 pcap_dump_file.3 \
-	pcap.3 pcap_dump_close.3
-
-CLEANFILES=tokdefs.h version.h version.c
+MAN=	pcap.3 \
+	pcap_activate.3 \
+	pcap_breakloop.3 \
+	pcap_can_set_rfmon.3 \
+	pcap_close.3 \
+	pcap_compile.3 \
+	pcap_create.3 \
+	pcap_datalink.3 \
+	pcap_datalink_name_to_val.3 \
+	pcap_datalink_val_to_name.3 \
+	pcap_dump.3 \
+	pcap_dump_close.3 \
+	pcap_dump_file.3 \
+	pcap_dump_flush.3 \
+	pcap_dump_ftell.3 \
+	pcap_dump_open.3 \
+	pcap_file.3 \
+	pcap_fileno.3 \
+	pcap_findalldevs.3 \
+	pcap_free_datalinks.3 \
+	pcap_freealldevs.3 \
+	pcap_freecode.3 \
+	pcap_get_selectable_fd.3 \
+	pcap_geterr.3 \
+	pcap_inject.3 \
+	pcap_is_swapped.3 \
+	pcap_lib_version.3 \
+	pcap_list_datalinks.3 \
+	pcap_lookupdev.3 \
+	pcap_lookupnet.3 \
+	pcap_loop.3 \
+	pcap_major_version.3 \
+	pcap_next_ex.3 \
+	pcap_offline_filter.3 \
+	pcap_open_dead.3 \
+	pcap_open_live.3 \
+	pcap_open_offline.3 \
+	pcap_set_buffer_size.3 \
+	pcap_set_datalink.3 \
+	pcap_set_promisc.3 \
+	pcap_set_rfmon.3 \
+	pcap_set_snaplen.3 \
+	pcap_set_timeout.3 \
+	pcap_setdirection.3 \
+	pcap_setfilter.3 \
+	pcap_setnonblock.3 \
+	pcap_snapshot.3 \
+	pcap_stats.3 \
+	pcap_statustostr.3 \
+	pcap_strerror.3 \
+	pcap-savefile.5 \
+	pcap-filter.7 \
+	pcap-linktype.7
+MLINKS=	pcap_datalink_val_to_name.3 pcap_datalink_val_to_description.3 \
+	pcap_dump_open.3 pcap_dump_fopen.3 \
+	pcap_geterr.3 pcap_perror.3 \
+	pcap_inject.3 pcap_sendpacket.3 \
+	pcap_loop.3 pcap_dispatch.3 \
+	pcap_major_version.3 pcap_minor_version.3 \
+	pcap_next_ex.3 pcap_next.3 \
+	pcap_open_offline.3 pcap_fopen_offline.3 \
+	pcap_setnonblock.3 pcap_getnonblock.3
+
+# Our man pages are a special copy from the distdir. See bellow.
+CLEANFILES+=${MAN}
+CLEANFILES+=tokdefs.h version.h version.c
 
 YFLAGS+=-p pcapyy
 LFLAGS+=-Ppcapyy
@@ -74,7 +90,7 @@ CFLAGS+=-DINET6
 CFLAGS+=-DHAVE_NET_PFVAR_H
 .endif
 
-SHLIB_MAJOR=5
+SHLIB_MAJOR=6
 
 #
 # Magic to grab sources out of src/contrib
@@ -95,4 +111,20 @@ version.h: ${PCAP_DISTDIR}/VERSION
 tokdefs.h: grammar.h
 	ln -sf grammar.h tokdefs.h
 
+
+#
+# Magic to convert the man pages to something non Solarish
+#
+.for _page in ${MAN}
+${_page}:
+	if [ -f ${PCAP_DISTDIR}/${_page:S/3$/3pcap/} ]; then		\
+		F=${_page:S/3$/3pcap/}; 				\
+	elif [ -f ${PCAP_DISTDIR}/${_page:S/5$/manfile/} ]; then	\
+		F=${_page:S/5$/manfile/};				\
+	else								\
+		F=${_page:S/7$/manmisc/};				\
+	fi;								\
+	sed -e 's/3PCAP/3/g' ${PCAP_DISTDIR}/$$F > ${_page}
+.endfor
+
 .include 

Modified: head/lib/libpcap/config.h
==============================================================================
--- head/lib/libpcap/config.h	Sat Mar 21 22:58:08 2009	(r190225)
+++ head/lib/libpcap/config.h	Sat Mar 21 22:59:02 2009	(r190226)
@@ -17,6 +17,9 @@
 /* define if you have a cloning BPF device */
 #define HAVE_CLONING_BPF 1
 
+/* define if you have dag_get_stream_erf_types() */
+/* #undef HAVE_DAG_GET_STREAM_ERF_TYPES */
+
 /* define if you have the DAG API */
 /* #undef HAVE_DAG_API */
 
@@ -30,12 +33,18 @@
    don't. */
 #define HAVE_DECL_ETHER_HOSTTON 1
 
+/* if passive_req_t primitive exists */
+/* #undef HAVE_DLPI_PASSIVE */
+
 /* define if you have a /dev/dlpi */
 /* #undef HAVE_DEV_DLPI */
 
 /* Define to 1 if you have the `ether_hostton' function. */
 #define HAVE_ETHER_HOSTTON 1
 
+/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
+#define HAVE_FSEEKO 1
+
 /* on HP-UX 10.20 or later */
 /* #undef HAVE_HPUX10_20_OR_LATER */
 
@@ -48,9 +57,18 @@
 /* Define to 1 if you have the  header file. */
 #define HAVE_INTTYPES_H 1
 
+/* if libdlpi exists */
+/* #undef HAVE_LIBDLPI */
+
 /* Define to 1 if you have the  header file. */
 #define HAVE_LIMITS_H 1
 
+/* if tp_vlan_tci exists */
+/* #undef HAVE_LINUX_TPACKET_AUXDATA_TP_VLAN_TCI */
+
+/* Define to 1 if you have the  header file. */
+/* #undef HAVE_LINUX_WIRELESS_H */
+
 /* Define to 1 if you have the  header file. */
 #define HAVE_MEMORY_H 1
 
@@ -60,6 +78,9 @@
 /* Define to 1 if you have the  header file. */
 #define HAVE_NETINET_IF_ETHER_H 1
 
+/* Define to 1 if you have the  header file. */
+#define HAVE_NET_IF_MEDIA_H 1
+
 /* Define to 1 if you have the  header file. */
 /* See Makefile */
 /* #undef HAVE_NET_PFVAR_H */
@@ -84,6 +105,9 @@
 
 /* if struct sockaddr_storage exists */
 #define HAVE_SOCKADDR_STORAGE 1
+ 
+/* define if socklen_t is defined */
+#define HAVE_SOCKLEN_T 1
 
 /* On solaris */
 /* #undef HAVE_SOLARIS */
@@ -139,6 +163,9 @@
 /* Define to 1 if you have the `vsnprintf' function. */
 #define HAVE_VSNPRINTF 1
 
+/* define if the system supports zerocopy BPF */
+#define	HAVE_ZEROCOPY_BPF 1
+
 /* define if your compiler has __attribute__ */
 #define HAVE___ATTRIBUTE__ 1
 
@@ -148,6 +175,9 @@
 /* if unaligned access fails */
 /* #undef LBL_ALIGN */
 
+/* path for device for USB sniffing */
+/* #undef LINUX_USB_MON_DEV */
+
 /* Define to 1 if netinet/ether.h declares `ether_hostton' */
 /* #undef NETINET_ETHER_H_DECLARES_ETHER_HOSTTON */
 
@@ -175,6 +205,15 @@
 /* /dev/dlpi directory */
 /* #undef PCAP_DEV_PREFIX */
 
+/* target host supports Bluetooth sniffing */
+/* #undef PCAP_SUPPORT_BT */
+
+/* target host supports USB sniffing */
+/* #undef PCAP_SUPPORT_USB */
+
+/* include ACN support */
+/* #undef SITA */
+
 /* Define to 1 if you have the ANSI C header files. */
 #define STDC_HEADERS 1
 
@@ -184,6 +223,15 @@
 /* needed on HP-UX */
 /* #undef _HPUX_SOURCE */
 
+/* Number of bits in a file offset, on hosts where this is settable. */
+/* #undef _FILE_OFFSET_BITS */
+
+/* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2).  */
+/* #undef _LARGEFILE_SOURCE */
+
+/* Define for large files, on AIX-style hosts. */
+/* #undef _LARGE_FILES */
+
 /* define on AIX to get certain functions */
 /* #undef _SUN */
 
@@ -199,5 +247,8 @@
 /* if we have u_int32_t */
 /* #undef u_int32_t */
 
+/* if we have u_int64_t */
+/* #undef u_int64_t */
+
 /* if we have u_int8_t */
 /* #undef u_int8_t */

From owner-svn-src-head@FreeBSD.ORG  Sat Mar 21 23:00:40 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C78C6106564A;
	Sat, 21 Mar 2009 23:00:40 +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 B55A48FC15;
	Sat, 21 Mar 2009 23:00:40 +0000 (UTC)
	(envelope-from dougb@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2LN0eWD049751;
	Sat, 21 Mar 2009 23:00:40 GMT (envelope-from dougb@svn.freebsd.org)
Received: (from dougb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2LN0eIO049748;
	Sat, 21 Mar 2009 23:00:40 GMT (envelope-from dougb@svn.freebsd.org)
Message-Id: <200903212300.n2LN0eIO049748@svn.freebsd.org>
From: Doug Barton 
Date: Sat, 21 Mar 2009 23:00: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: r190227 - in head/contrib/bind9: . lib/dns
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 21 Mar 2009 23:00:41 -0000

Author: dougb
Date: Sat Mar 21 23:00:40 2009
New Revision: 190227
URL: http://svn.freebsd.org/changeset/base/190227

Log:
  Merge from vendor/bind9/dist as of the 9.4.3-P2 import

Modified:
  head/contrib/bind9/   (props changed)
  head/contrib/bind9/CHANGES
  head/contrib/bind9/lib/dns/validator.c
  head/contrib/bind9/version

Modified: head/contrib/bind9/CHANGES
==============================================================================
--- head/contrib/bind9/CHANGES	Sat Mar 21 22:59:02 2009	(r190226)
+++ head/contrib/bind9/CHANGES	Sat Mar 21 23:00:40 2009	(r190227)
@@ -1,3 +1,8 @@
+	--- 9.4.3-P2 released ---
+
+2579.	[bug]		DNSSEC lookaside validation failed to handle unknown
+			algorithms. [RT #19479]
+
 	--- 9.4.3-P1 released ---
 
 2522.	[security]	Handle -1 from DSA_do_verify().

Modified: head/contrib/bind9/lib/dns/validator.c
==============================================================================
--- head/contrib/bind9/lib/dns/validator.c	Sat Mar 21 22:59:02 2009	(r190226)
+++ head/contrib/bind9/lib/dns/validator.c	Sat Mar 21 23:00:40 2009	(r190227)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: validator.c,v 1.119.18.41 2008/08/21 04:59:42 marka Exp $ */
+/* $Id: validator.c,v 1.119.18.41.2.1 2009/03/17 02:23:49 marka Exp $ */
 
 /*! \file */
 
@@ -211,6 +211,37 @@ exit_check(dns_validator_t *val) {
 	return (ISC_TRUE);
 }
 
+/*
+ * Check that we have atleast one supported algorithm in the DLV RRset.
+ */
+static inline isc_boolean_t
+dlv_algorithm_supported(dns_validator_t *val) {
+	dns_rdata_t rdata = DNS_RDATA_INIT;
+	dns_rdata_dlv_t dlv;
+	isc_result_t result;
+
+	for (result = dns_rdataset_first(&val->dlv);
+	     result == ISC_R_SUCCESS;
+	     result = dns_rdataset_next(&val->dlv)) {
+		dns_rdata_reset(&rdata);
+		dns_rdataset_current(&val->dlv, &rdata);
+		result = dns_rdata_tostruct(&rdata, &dlv, NULL);
+		RUNTIME_CHECK(result == ISC_R_SUCCESS);
+
+		if (!dns_resolver_algorithm_supported(val->view->resolver,
+						      val->event->name,
+						      dlv.algorithm))
+			continue;
+
+		if (dlv.digest_type != DNS_DSDIGEST_SHA256 &&
+		    dlv.digest_type != DNS_DSDIGEST_SHA1)
+			continue;
+
+		return (ISC_TRUE);
+	}
+	return (ISC_FALSE);
+}
+
 /*%
  * Look in the NSEC record returned from a DS query to see if there is
  * a NS RRset at this name.  If it is found we are at a delegation point.
@@ -2297,19 +2328,36 @@ dlvfetched(isc_task_t *task, isc_event_t
 				sizeof(namebuf));
 		dns_rdataset_clone(&val->frdataset, &val->dlv);
 		val->havedlvsep = ISC_TRUE;
-		validator_log(val, ISC_LOG_DEBUG(3), "DLV %s found", namebuf);
-		dlv_validator_start(val);
+		if (dlv_algorithm_supported(val)) {
+			validator_log(val, ISC_LOG_DEBUG(3), "DLV %s found",
+				      namebuf);
+			dlv_validator_start(val);
+		} else {
+			validator_log(val, ISC_LOG_DEBUG(3),
+				      "DLV %s found with no supported algorithms",
+				      namebuf);
+			markanswer(val);
+			validator_done(val, ISC_R_SUCCESS);
+		}
 	} else if (eresult == DNS_R_NXRRSET ||
 		   eresult == DNS_R_NXDOMAIN ||
 		   eresult == DNS_R_NCACHENXRRSET ||
 		   eresult == DNS_R_NCACHENXDOMAIN) {
-		   result = finddlvsep(val, ISC_TRUE);
+		result = finddlvsep(val, ISC_TRUE);
 		if (result == ISC_R_SUCCESS) {
-			dns_name_format(dns_fixedname_name(&val->dlvsep),
-					namebuf, sizeof(namebuf));
-			validator_log(val, ISC_LOG_DEBUG(3), "DLV %s found",
-				      namebuf);
-			dlv_validator_start(val);
+			if (dlv_algorithm_supported(val)) {
+				dns_name_format(dns_fixedname_name(&val->dlvsep),
+						namebuf, sizeof(namebuf));
+				validator_log(val, ISC_LOG_DEBUG(3),
+					      "DLV %s found", namebuf);
+				dlv_validator_start(val);
+			} else {
+				validator_log(val, ISC_LOG_DEBUG(3),
+					      "DLV %s found with no supported "
+					      "algorithms", namebuf);
+				markanswer(val);
+				validator_done(val, ISC_R_SUCCESS);
+			}
 		} else if (result == ISC_R_NOTFOUND) {
 			validator_log(val, ISC_LOG_DEBUG(3), "DLV not found");
 			markanswer(val);
@@ -2372,9 +2420,16 @@ startfinddlvsep(dns_validator_t *val, dn
 	}
 	dns_name_format(dns_fixedname_name(&val->dlvsep), namebuf,
 			sizeof(namebuf));
-	validator_log(val, ISC_LOG_DEBUG(3), "DLV %s found", namebuf);
-	dlv_validator_start(val);
-	return (DNS_R_WAIT);
+	if (dlv_algorithm_supported(val)) {
+		validator_log(val, ISC_LOG_DEBUG(3), "DLV %s found", namebuf);
+		dlv_validator_start(val);
+		return (DNS_R_WAIT);
+	} 
+	validator_log(val, ISC_LOG_DEBUG(3), "DLV %s found with no supported "
+		      "algorithms", namebuf);
+	markanswer(val);
+	validator_done(val, ISC_R_SUCCESS);
+	return (ISC_R_SUCCESS);
 }
 
 /*%

Modified: head/contrib/bind9/version
==============================================================================
--- head/contrib/bind9/version	Sat Mar 21 22:59:02 2009	(r190226)
+++ head/contrib/bind9/version	Sat Mar 21 23:00:40 2009	(r190227)
@@ -1,4 +1,4 @@
-# $Id: version,v 1.29.134.23.2.1 2008/12/24 00:21:22 marka Exp $
+# $Id: version,v 1.29.134.23.2.2 2009/03/17 02:23:49 marka Exp $
 #
 # This file must follow /bin/sh rules.  It is imported directly via
 # configure.
@@ -7,4 +7,4 @@ MAJORVER=9
 MINORVER=4
 PATCHVER=3
 RELEASETYPE=-P
-RELEASEVER=1
+RELEASEVER=2

From owner-svn-src-head@FreeBSD.ORG  Sat Mar 21 23:08:05 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 056251065672;
	Sat, 21 Mar 2009 23:08:05 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id DCA018FC14;
	Sat, 21 Mar 2009 23:08:04 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2LN84xc050009;
	Sat, 21 Mar 2009 23:08:04 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2LN84NS050008;
	Sat, 21 Mar 2009 23:08:04 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <200903212308.n2LN84NS050008@svn.freebsd.org>
From: Rui Paulo 
Date: Sat, 21 Mar 2009 23:08: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: r190229 - head/contrib/libpcap
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 21 Mar 2009 23:08:05 -0000

Author: rpaulo
Date: Sat Mar 21 23:08:04 2009
New Revision: 190229
URL: http://svn.freebsd.org/changeset/base/190229

Log:
  Finish merge of zerocopy bpf.

Modified:
  head/contrib/libpcap/pcap-bpf.c

Modified: head/contrib/libpcap/pcap-bpf.c
==============================================================================
--- head/contrib/libpcap/pcap-bpf.c	Sat Mar 21 23:03:56 2009	(r190228)
+++ head/contrib/libpcap/pcap-bpf.c	Sat Mar 21 23:08:04 2009	(r190229)
@@ -721,159 +721,6 @@ pcap_stats_bpf(pcap_t *p, struct pcap_st
 	return (0);
 }
 
-#ifdef BIOCGETBUFMODE
-/*
- * Zero-copy BPF buffer routines to check for and acknowledge BPF data in
- * shared memory buffers.
- *
- * pcap_next_zbuf_shm(): Check for a newly available shared memory buffer,
- * and set up p->buffer and cc to reflect one if available.  Notice that if
- * there was no prior buffer, we select zbuf1 as this will be the first
- * buffer filled for a fresh BPF session.
- */
-static int
-pcap_next_zbuf_shm(pcap_t *p, int *cc)
-{
-	struct bpf_zbuf_header *bzh;
-
-	if (p->zbuffer == p->zbuf2 || p->zbuffer == NULL) {
-		bzh = (struct bpf_zbuf_header *)p->zbuf1;
-		if (bzh->bzh_user_gen !=
-		    atomic_load_acq_int(&bzh->bzh_kernel_gen)) {
-			p->bzh = bzh;
-			p->zbuffer = (u_char *)p->zbuf1;
-			p->buffer = p->zbuffer + sizeof(*bzh);
-			*cc = bzh->bzh_kernel_len;
-			return (1);
-		}
-	} else if (p->zbuffer == p->zbuf1) {
-		bzh = (struct bpf_zbuf_header *)p->zbuf2;
-		if (bzh->bzh_user_gen !=
-		    atomic_load_acq_int(&bzh->bzh_kernel_gen)) {
-			p->bzh = bzh;
-			p->zbuffer = (u_char *)p->zbuf2;
-			p->buffer = p->zbuffer + sizeof(*bzh);
-			*cc = bzh->bzh_kernel_len;
-			return (1);
-		}
-	}
-	*cc = 0;
-	return (0);
-}
-
-/*
- * pcap_next_zbuf() -- Similar to pcap_next_zbuf_shm(), except wait using
- * select() for data or a timeout, and possibly force rotation of the buffer
- * in the event we time out or are in immediate mode.  Invoke the shared
- * memory check before doing system calls in order to avoid doing avoidable
- * work.
- */
-static int
-pcap_next_zbuf(pcap_t *p, int *cc)
-{
-	struct bpf_zbuf bz;
-	struct timeval tv;
-	struct timespec cur;
-	fd_set r_set;
-	int data, r;
-	int tmout, expire;
-
-#define TSTOMILLI(ts) (((ts)->tv_sec * 1000) + ((ts)->tv_nsec / 1000000))
-	/*
-	 * Start out by seeing whether anything is waiting by checking the
-	 * next shared memory buffer for data.
-	 */
-	data = pcap_next_zbuf_shm(p, cc);
-	if (data)
-		return (data);
-	/*
-	 * If a previous sleep was interrupted due to signal delivery, make
-	 * sure that the timeout gets adjusted accordingly.  This requires
-	 * that we analyze when the timeout should be been expired, and
-	 * subtract the current time from that.  If after this operation,
-	 * our timeout is less then or equal to zero, handle it like a
-	 * regular timeout.
-	 */
-	tmout = p->to_ms;
-	if (tmout)
-		(void) clock_gettime(CLOCK_MONOTONIC, &cur);
-	if (p->interrupted && p->to_ms) {
-		expire = TSTOMILLI(&p->firstsel) + p->to_ms;
-		tmout = expire - TSTOMILLI(&cur);
-#undef TSTOMILLI
-		if (tmout <= 0) {
-			p->interrupted = 0;
-			data = pcap_next_zbuf_shm(p, cc);
-			if (data)
-				return (data);
-			if (ioctl(p->fd, BIOCROTZBUF, &bz) < 0) {
-				(void) snprintf(p->errbuf, PCAP_ERRBUF_SIZE,
-				    "BIOCROTZBUF: %s", strerror(errno));
-				return (-1);
-			}
-			return (pcap_next_zbuf_shm(p, cc));
-		}
-	}
-	/*
-	 * No data in the buffer, so must use select() to wait for data or
-	 * the next timeout.
-	 */
-	FD_ZERO(&r_set);
-	FD_SET(p->fd, &r_set);
-	if (tmout != 0) {
-		tv.tv_sec = tmout / 1000;
-		tv.tv_usec = (tmout * 1000) % 1000000;
-	}
-	r = select(p->fd + 1, &r_set, NULL, NULL, p->to_ms != 0 ? &tv :
-	    NULL);
-	if (r < 0 && errno == EINTR) {
-		if (!p->interrupted && p->to_ms) {
-			p->interrupted = 1;
-			p->firstsel = cur;
-		}
-		return (0);
-	} else if (r < 0) {
-		(void) snprintf(p->errbuf, PCAP_ERRBUF_SIZE,
-		    "select: %s", strerror(errno));
-		return (-1);
-	}
-	p->interrupted = 0;
-	/*
-	 * Check again for data, which may exist now that we've either been
-	 * woken up as a result of data or timed out.  Try the "there's data"
-	 * case first since it doesn't require a system call.
-	 */
-	data = pcap_next_zbuf_shm(p, cc);
-	if (data)
-		return (data);
-
-	/*
-	 * Try forcing a buffer rotation to dislodge timed out or immediate
-	 * data.
-	 */
-	if (ioctl(p->fd, BIOCROTZBUF, &bz) < 0) {
-		(void) snprintf(p->errbuf, PCAP_ERRBUF_SIZE,
-		    "BIOCROTZBUF: %s", strerror(errno));
-		return (-1);
-	}
-	return (pcap_next_zbuf_shm(p, cc));
-}
-
-/*
- * Notify kernel that we are done with the buffer.  We don't reset zbuffer so
- * that we know which buffer to use next time around.
- */
-static int
-pcap_ack_zbuf(pcap_t *p)
-{
-
-	atomic_store_rel_int(&p->bzh->bzh_user_gen, p->bzh->bzh_kernel_gen);
-	p->bzh = NULL;
-	p->buffer = NULL;
-	return (0);
-}
-#endif
-
 static int
 pcap_read_bpf(pcap_t *p, int cnt, pcap_handler callback, u_char *user)
 {
@@ -881,9 +728,6 @@ pcap_read_bpf(pcap_t *p, int cnt, pcap_h
 	int n = 0;
 	register u_char *bp, *ep;
 	u_char *datap;
-#ifdef BIOCSETBUFMODE
-	int i;
-#endif
 #ifdef PCAP_FDDIPAD
 	register int pad;
 #endif

From owner-svn-src-head@FreeBSD.ORG  Sat Mar 21 23:08:54 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6C682106567D
	for ; Sat, 21 Mar 2009 23:08:54 +0000 (UTC)
	(envelope-from christoph.mallon@gmx.de)
Received: from mail.gmx.net (mail.gmx.net [213.165.64.20])
	by mx1.freebsd.org (Postfix) with SMTP id C17648FC31
	for ; Sat, 21 Mar 2009 23:08:53 +0000 (UTC)
	(envelope-from christoph.mallon@gmx.de)
Received: (qmail invoked by alias); 21 Mar 2009 23:08:51 -0000
Received: from p54A3DBD1.dip.t-dialin.net (EHLO tron.homeunix.org)
	[84.163.219.209]
	by mail.gmx.net (mp016) with SMTP; 22 Mar 2009 00:08:51 +0100
X-Authenticated: #1673122
X-Provags-ID: V01U2FsdGVkX19q72BJfgdqt/tXk4e5BeHLWX6GU2QjJx5Yj1bsoy
	/Jkala1uT8ysfN
Message-ID: <49C5737F.1050902@gmx.de>
Date: Sun, 22 Mar 2009 00:08:47 +0100
From: Christoph Mallon 
User-Agent: Thunderbird 2.0.0.19 (X11/20090103)
MIME-Version: 1.0
To: Marius Strobl 
References: <200903192029.n2JKTN54074599@svn.freebsd.org>	<49C4C974.5050209@gmx.de>
	<20090321130332.GD67783@alchemy.franken.de>
In-Reply-To: <20090321130332.GD67783@alchemy.franken.de>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Y-GMX-Trusted: 0
X-FuHaFi: 0.61
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r190098 - in head/sys/sparc64: fhc sparc64
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 21 Mar 2009 23:08:55 -0000

Marius Strobl schrieb:
> On Sat, Mar 21, 2009 at 12:03:16PM +0100, Christoph Mallon wrote:
>> These variables are not redundant. Before the variables had clear names 
>> (like rid or nregs, nintr), now they are called i and j, which carries 
>> no semantics at all.
> 
> IMO the code is simple enough so that the variable names do not
> need to carry semantics for clearity, the fact that just two
> reused temporary variables are enough for the whole function
> underlines this.

The function is about 170 lines long, so allow me to disagree that it is 
"simple enough". Also the number of variables, which are live at once, 
is to my experience not a good measure for code complexity (A high 
number usually indicates high complexity, but a low number does not 
indicate low complexity).

>> Also j has its address taken AND you use this variable in several 
>> different contexts (replacement for rid, later as loop counter). This 
>> makes it impossible[0] for the compiler to do many useful optimisations 
>> like keeping the value of the variable in a register!
> 
> It's good to know that doing so may costs performance in general,
> as this is an bus attach function performance totally isn't an
> issue here though.

I'm equally concerned with code clarity. A reader has to figure out the 
def-use-chains when he tries to understand the code. Distinct variables 
can make this task easier (ideally every variable, except for loop 
counters, is const so there is only one point where it is assigned).
Also re-using address-taken variables in contexts where the address is 
not necessary usually results in larger machine code.
It's interesting to note that here the needs for a compiler to be able 
to produce "good" code and clarity of code for a human reader nicely 
correlate.

>> More local variables cost nothing - especially no stack space, if this 
>> is your concern - on any somewhat modern compiler. Use as many of them 
>> as you want for code clarity. Do not reuse variables, whose address is 
>> taken, because often it is impossible for the compiler to do any 
>> optimisations.
> 
> My motivation for using fewer local variables is that style(9)
> mandates to not define variables in nested scope and to sort
> them, so reusing them reduces code churn in the long term.
> IIRC you said elsewhere that you're unhappy with at least the
> former rule but you should work on getting style(9) then.

You are right, I disagree with quite some rules in style(9) and this 
particular rule I disagree with the most. But looking at the history, 
making any suggestions here to change it will only result in the biggest 
bikeshed ever built. Hm, seeing here that these rules encourage people 
to actively reduce code clarity, I'll contemplate about making a suggestion.

	Christoph

From owner-svn-src-head@FreeBSD.ORG  Sat Mar 21 23:13:48 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E5F3F1065674;
	Sat, 21 Mar 2009 23:13:48 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D26918FC2D;
	Sat, 21 Mar 2009 23:13:48 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2LNDmtc050147;
	Sat, 21 Mar 2009 23:13:48 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2LNDmru050146;
	Sat, 21 Mar 2009 23:13:48 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <200903212313.n2LNDmru050146@svn.freebsd.org>
From: Rui Paulo 
Date: Sat, 21 Mar 2009 23:13: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: r190230 - head/contrib/libpcap
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 21 Mar 2009 23:13:50 -0000

Author: rpaulo
Date: Sat Mar 21 23:13:48 2009
New Revision: 190230
URL: http://svn.freebsd.org/changeset/base/190230

Log:
  Remove remaining references to BIOCSETBUFMODE ifdefs. We now have
  another ifdef for zerocopy bpf.

Modified:
  head/contrib/libpcap/pcap-bpf.c

Modified: head/contrib/libpcap/pcap-bpf.c
==============================================================================
--- head/contrib/libpcap/pcap-bpf.c	Sat Mar 21 23:08:04 2009	(r190229)
+++ head/contrib/libpcap/pcap-bpf.c	Sat Mar 21 23:13:48 2009	(r190230)
@@ -93,10 +93,6 @@ static int odmlockid = 0;
 
 #endif /* _AIX */
 
-#ifdef BIOCSETBUFMODE
-#include 
-#endif
-
 #include 
 #include 
 #include 
@@ -1893,9 +1889,6 @@ pcap_activate_bpf(pcap_t *p)
 			goto bad;
 		}
 	}
-#ifdef BIOCSETBUFMODE
-	p->timeout = to_ms;
-#endif
 
 #ifdef _AIX
 #ifdef	BIOCIMMEDIATE

From owner-svn-src-head@FreeBSD.ORG  Sat Mar 21 23:58:58 2009
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B5846106566C;
	Sat, 21 Mar 2009 23:58:58 +0000 (UTC) (envelope-from imp@bsdimp.com)
Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85])
	by mx1.freebsd.org (Postfix) with ESMTP id 5D78B8FC15;
	Sat, 21 Mar 2009 23:58:58 +0000 (UTC) (envelope-from imp@bsdimp.com)
Received: from localhost (localhost [127.0.0.1])
	by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id n2LNvLNo028071;
	Sat, 21 Mar 2009 17:57:21 -0600 (MDT) (envelope-from imp@bsdimp.com)
Date: Sat, 21 Mar 2009 17:57:56 -0600 (MDT)
Message-Id: <20090321.175756.-434257642.imp@bsdimp.com>
To: christoph.mallon@gmx.de
From: "M. Warner Losh" 
In-Reply-To: <49C5737F.1050902@gmx.de>
References: <49C4C974.5050209@gmx.de>
	<20090321130332.GD67783@alchemy.franken.de>
	<49C5737F.1050902@gmx.de>
X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org, marius@alchemy.franken.de
Subject: Re: svn commit: r190098 - in head/sys/sparc64: fhc sparc64
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 21 Mar 2009 23:58:59 -0000

I'll point out that style(9) doesn't say use as few local variables as
possible...  That part is completely unspecified.

Warner