From owner-svn-src-stable-8@FreeBSD.ORG Sun Apr 4 14:57:47 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 45EE6106564A; Sun, 4 Apr 2010 14:57:47 +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 32E328FC15; Sun, 4 Apr 2010 14:57:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o34Evlb3043290; Sun, 4 Apr 2010 14:57:47 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o34Evl2H043287; Sun, 4 Apr 2010 14:57:47 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201004041457.o34Evl2H043287@svn.freebsd.org> From: Marius Strobl Date: Sun, 4 Apr 2010 14:57:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206162 - in stable/8/sys/sparc64: include sparc64 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Apr 2010 14:57:47 -0000 Author: marius Date: Sun Apr 4 14:57:46 2010 New Revision: 206162 URL: http://svn.freebsd.org/changeset/base/206162 Log: MFC: r205269 o Add support for UltraSparc-IV+: - Swap the configuration of the first and second large dTLB as with US-IV+ these can only hold entries of certain page sizes each, which we happened to chose the non-working way around. - Additionally ensure that the large iTLB is set up to hold 8k pages (currently this happens to be a NOP though). - Add a workaround for US-IV+ erratum #2. - Turn off dTLB parity error reporting as otherwise we get seemingly false positives when copying in the user window by simulating a fill trap on return to usermode. Given that these parity errors can be avoided by disabling multi issue mode and the problem could be reproduced with a second machine this appears to be a silicon bug of some sort. - Add a membar #Sync also before the stores to ASI_DCACHE_TAG. While at it, turn of interrupts across the whole cheetah_cache_flush() for simplicity instead of around every flush. This should have next to no impact as for cheetah-class machines we typically only need to flush the caches a few times during boot when recovering from peeking/poking non-existent PCI devices, if at all. - Just use KERNBASE for FLUSH as we also do elsewhere as the US-IV+ documentation doesn't seem to mention that these CPUs also ignore the address like previous cheetah-class CPUs do. Again the code changing LSU_IC is executed seldom enough that the negligible optimization of using %g0 instead should have no real impact. With these changes FreeBSD runs stable on V890 equipped with US-IV+ and -j128 buildworlds in a loop for days are no problem. Unfortunately, the performance isn't were it should be as a buildworld on a 4x1.5GHz US-IV+ V890 takes nearly 3h while on a V440 with (theoretically) less powerfull 4x1.5GHz US-IIIi it takes just over 1h. It's unclear whether this is related to the supposed silicon bug mentioned above or due to another issue. The documentation (which contains a sever bug in the description of the bits added to the context registers though) at least doesn't mention any requirements for changes in the CPU handling besides those implemented and the cache as well as the TLB configurations and handling look fine. o Re-arrange cheetah_init() so it's easier to add support for SPARC64 V up to VIIIfx CPUs, which only require parts of this initialization. Committed from: EH2010 Modified: stable/8/sys/sparc64/include/dcr.h stable/8/sys/sparc64/sparc64/cheetah.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/sparc64/include/dcr.h ============================================================================== --- stable/8/sys/sparc64/include/dcr.h Sun Apr 4 14:57:45 2010 (r206161) +++ stable/8/sys/sparc64/include/dcr.h Sun Apr 4 14:57:46 2010 (r206162) @@ -57,6 +57,10 @@ #define DCR_BPM_BITS 2 #define DCR_BPM_MASK \ (((1UL << DCR_BPM_BITS) - 1) << DCR_BPM_SHIFT) +#define DCR_BPM_1HIST_GSHARE (0UL << DCR_BPM_SHIFT) +#define DCR_BPM_2HIST_GSHARE (1UL << DCR_BPM_SHIFT) +#define DCR_BPM_PC (2UL << DCR_BPM_SHIFT) +#define DCR_BPM_2HIST_MIXED (3UL << DCR_BPM_SHIFT) #define DCR_JPE (1UL << 15) #define DCR_ITPE (1UL << 16) Modified: stable/8/sys/sparc64/sparc64/cheetah.c ============================================================================== --- stable/8/sys/sparc64/sparc64/cheetah.c Sun Apr 4 14:57:45 2010 (r206161) +++ stable/8/sys/sparc64/sparc64/cheetah.c Sun Apr 4 14:57:46 2010 (r206162) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2003 Jake Burkholder. - * Copyright (c) 2005, 2008 Marius Strobl + * Copyright (c) 2005, 2008, 2010 Marius Strobl * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -49,9 +49,6 @@ __FBSDID("$FreeBSD$"); #include #include -/* A FLUSH is required after changing LSU_IC (the address is ignored). */ -#define CHEETAH_FLUSH_LSU_IC() __asm __volatile("flush %%g0" : :) - #define CHEETAH_ICACHE_TAG_LOWER 0x30 /* @@ -60,6 +57,7 @@ __FBSDID("$FreeBSD$"); void cheetah_init(u_int cpu_impl) { + u_long val; register_t s; /* @@ -68,14 +66,6 @@ cheetah_init(u_int cpu_impl) */ s = intr_disable(); - /* - * Ensure DCR_IFPOE is disabled as long as we haven't implemented - * support for it (if ever) as most if not all firmware versions - * apparently turn it on. Not making use of DCR_IFPOE should also - * avoid Cheetah erratum #109. - */ - wr(asr18, rd(asr18) & ~DCR_IFPOE, 0); - /* Ensure the TSB Extension Registers hold 0 as TSB_Base. */ stxa(AA_DMMU_TSB_PEXT_REG, ASI_DMMU, 0); @@ -93,25 +83,58 @@ cheetah_init(u_int cpu_impl) membar(Sync); /* - * Ensure that the dt512_0 is set to hold 8k pages for all three - * contexts and configure the dt512_1 to hold 4MB pages for them - * (e.g. for direct mappings). - * NB: according to documentation, this requires a contex demap - * _before_ changing the corresponding page size, but we hardly - * can flush our locked pages here, so we use a demap all instead. + * Configure the first large dTLB to hold 4MB pages (e.g. for direct + * mappings) for all three contexts and ensure the second one is set + * up to hold 8k pages for them. Note that this is constraint by + * US-IV+, whose large dTLBs can only hold entries of certain page + * sizes each. + * For US-IV+, additionally ensure that the large iTLB is set up to + * hold 8k pages for nucleus and primary context (still no secondary + * iMMU context. + * NB: according to documentation, changing the page size of the same + * context requires a context demap before changing the corresponding + * page size, but we hardly can flush our locked pages here, so we use + * a demap all instead. */ stxa(TLB_DEMAP_ALL, ASI_DMMU_DEMAP, 0); membar(Sync); - stxa(AA_DMMU_PCXR, ASI_DMMU, - (TS_8K << TLB_PCXR_N_PGSZ0_SHIFT) | - (TS_4M << TLB_PCXR_N_PGSZ1_SHIFT) | - (TS_8K << TLB_PCXR_P_PGSZ0_SHIFT) | - (TS_4M << TLB_PCXR_P_PGSZ1_SHIFT)); - stxa(AA_DMMU_SCXR, ASI_DMMU, - (TS_8K << TLB_SCXR_S_PGSZ0_SHIFT) | - (TS_4M << TLB_SCXR_S_PGSZ1_SHIFT)); + val = (TS_4M << TLB_PCXR_N_PGSZ0_SHIFT) | + (TS_8K << TLB_PCXR_N_PGSZ1_SHIFT) | + (TS_4M << TLB_PCXR_P_PGSZ0_SHIFT) | + (TS_8K << TLB_PCXR_P_PGSZ1_SHIFT); + if (cpu_impl == CPU_IMPL_ULTRASPARCIVp) + val |= (TS_8K << TLB_PCXR_N_PGSZ_I_SHIFT) | + (TS_8K << TLB_PCXR_P_PGSZ_I_SHIFT); + stxa(AA_DMMU_PCXR, ASI_DMMU, val); + val = (TS_4M << TLB_SCXR_S_PGSZ0_SHIFT) | + (TS_8K << TLB_SCXR_S_PGSZ1_SHIFT); + stxa(AA_DMMU_SCXR, ASI_DMMU, val); flush(KERNBASE); + /* + * Ensure DCR_IFPOE is disabled as long as we haven't implemented + * support for it (if ever) as most if not all firmware versions + * apparently turn it on. Not making use of DCR_IFPOE should also + * avoid Cheetah erratum #109. + */ + val = rd(asr18) & ~DCR_IFPOE; + if (cpu_impl == CPU_IMPL_ULTRASPARCIVp) { + /* + * Ensure the branch prediction mode is set to PC indexing + * in order to work around US-IV+ erratum #2. + */ + val = (val & ~DCR_BPM_MASK) | DCR_BPM_PC; + /* + * XXX disable dTLB parity error reporting as otherwise we + * get seemingly false positives when copying in the user + * window by simulating a fill trap on return to usermode in + * case single issue is disabled, which thus appears to be + * a CPU bug. + */ + val &= ~DCR_DTPE; + } + wr(asr18, val, 0); + intr_restore(s); } @@ -125,11 +148,11 @@ cheetah_cache_enable(u_int cpu_impl) lsu = ldxa(0, ASI_LSU_CTL_REG); if (cpu_impl == CPU_IMPL_ULTRASPARCIII) { - /* Disable P$ due to Cheetah erratum #18. */ + /* Disable P$ due to US-III erratum #18. */ lsu &= ~LSU_PE; } stxa(0, ASI_LSU_CTL_REG, lsu | LSU_IC | LSU_DC); - CHEETAH_FLUSH_LSU_IC(); + flush(KERNBASE); } /* @@ -139,21 +162,35 @@ void cheetah_cache_flush(void) { u_long addr, lsu; + register_t s; + s = intr_disable(); for (addr = 0; addr < PCPU_GET(cache.dc_size); addr += PCPU_GET(cache.dc_linesize)) - stxa_sync(addr, ASI_DCACHE_TAG, 0); + /* + * Note that US-IV+ additionally require a membar #Sync before + * a load or store to ASI_DCACHE_TAG. + */ + __asm __volatile( + "membar #Sync;" + "stxa %%g0, [%0] %1;" + "membar #Sync" + : : "r" (addr), "n" (ASI_DCACHE_TAG)); /* The I$ must be disabled when flushing it so ensure it's off. */ lsu = ldxa(0, ASI_LSU_CTL_REG); stxa(0, ASI_LSU_CTL_REG, lsu & ~(LSU_IC)); - CHEETAH_FLUSH_LSU_IC(); + flush(KERNBASE); for (addr = CHEETAH_ICACHE_TAG_LOWER; addr < PCPU_GET(cache.ic_size) * 2; addr += PCPU_GET(cache.ic_linesize) * 2) - stxa_sync(addr, ASI_ICACHE_TAG, 0); + __asm __volatile( + "stxa %%g0, [%0] %1;" + "membar #Sync" + : : "r" (addr), "n" (ASI_ICACHE_TAG)); stxa(0, ASI_LSU_CTL_REG, lsu); - CHEETAH_FLUSH_LSU_IC(); + flush(KERNBASE); + intr_restore(s); } /* @@ -165,9 +202,11 @@ cheetah_dcache_page_inval(vm_paddr_t spa vm_paddr_t pa; void *cookie; - KASSERT((spa & PAGE_MASK) == 0, ("%s: pa not page aligned", __func__)); + KASSERT((spa & PAGE_MASK) == 0, + ("%s: pa not page aligned", __func__)); cookie = ipi_dcache_page_inval(tl_ipi_cheetah_dcache_page_inval, spa); - for (pa = spa; pa < spa + PAGE_SIZE; pa += PCPU_GET(cache.dc_linesize)) + for (pa = spa; pa < spa + PAGE_SIZE; + pa += PCPU_GET(cache.dc_linesize)) stxa_sync(pa, ASI_DCACHE_INVALIDATE, 0); ipi_wait(cookie); } From owner-svn-src-stable-8@FreeBSD.ORG Sun Apr 4 15:37:47 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E3C61106566B; Sun, 4 Apr 2010 15:37:47 +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 D19548FC1D; Sun, 4 Apr 2010 15:37:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o34Fbl11052189; Sun, 4 Apr 2010 15:37:47 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o34FblJg052187; Sun, 4 Apr 2010 15:37:47 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <201004041537.o34FblJg052187@svn.freebsd.org> From: Robert Noland Date: Sun, 4 Apr 2010 15:37:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206164 - stable/8/sys/dev/agp X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Apr 2010 15:37:48 -0000 Author: rnoland Date: Sun Apr 4 15:37:47 2010 New Revision: 206164 URL: http://svn.freebsd.org/changeset/base/206164 Log: MFC r205096, r205102 Add AGP support for Intel Pineview and Ironlake chipsets. Modified: stable/8/sys/dev/agp/agp_i810.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/agp/agp_i810.c ============================================================================== --- stable/8/sys/dev/agp/agp_i810.c Sun Apr 4 15:21:09 2010 (r206163) +++ stable/8/sys/dev/agp/agp_i810.c Sun Apr 4 15:37:47 2010 (r206164) @@ -70,6 +70,7 @@ enum { CHIP_I915, /* 915G/915GM */ CHIP_I965, /* G965 */ CHIP_G33, /* G33/Q33/Q35 */ + CHIP_IGD, /* Pineview */ CHIP_G4X, /* G45/Q45 */ }; @@ -163,6 +164,10 @@ static const struct agp_i810_match { "Intel G33 SVGA controller"}, {0x29D28086, CHIP_G33, 0x00020000, "Intel Q33 SVGA controller"}, + {0xA0018086, CHIP_IGD, 0x00010000, + "Intel Pineview SVGA controller"}, + {0xA0118086, CHIP_IGD, 0x00010000, + "Intel Pineview (M) SVGA controller"}, {0x2A028086, CHIP_I965, 0x00020000, "Intel GM965 SVGA controller"}, {0x2A128086, CHIP_I965, 0x00020000, @@ -170,13 +175,17 @@ static const struct agp_i810_match { {0x2A428086, CHIP_G4X, 0x00020000, "Intel GM45 SVGA controller"}, {0x2E028086, CHIP_G4X, 0x00020000, - "Intel 4 Series SVGA controller"}, + "Intel Eaglelake SVGA controller"}, {0x2E128086, CHIP_G4X, 0x00020000, "Intel Q45 SVGA controller"}, {0x2E228086, CHIP_G4X, 0x00020000, "Intel G45 SVGA controller"}, {0x2E328086, CHIP_G4X, 0x00020000, "Intel G41 SVGA controller"}, + {0x00428086, CHIP_G4X, 0x00020000, + "Intel Ironlake (D) SVGA controller"}, + {0x00468086, CHIP_G4X, 0x00020000, + "Intel Ironlake (M) SVGA controller"}, {0, 0, 0, NULL} }; @@ -286,6 +295,7 @@ agp_i810_probe(device_t dev) case CHIP_I915: case CHIP_I965: case CHIP_G33: + case CHIP_IGD: case CHIP_G4X: deven = pci_read_config(bdev, AGP_I915_DEVEN, 4); if ((deven & AGP_I915_DEVEN_D2F0) == @@ -351,6 +361,7 @@ agp_i810_dump_regs(device_t dev) case CHIP_I915: case CHIP_I965: case CHIP_G33: + case CHIP_IGD: case CHIP_G4X: device_printf(dev, "AGP_I855_GCC1: 0x%02x\n", pci_read_config(sc->bdev, AGP_I855_GCC1, 1)); @@ -386,6 +397,7 @@ agp_i810_attach(device_t dev) break; case CHIP_I915: case CHIP_G33: + case CHIP_IGD: sc->sc_res_spec = agp_i915_res_spec; agp_set_aperture_resource(dev, AGP_I915_GMADR); break; @@ -401,7 +413,8 @@ agp_i810_attach(device_t dev) return error; if (sc->chiptype != CHIP_I965 && sc->chiptype != CHIP_G33 && - sc->chiptype != CHIP_G4X && ptoa((vm_paddr_t)Maxmem) > 0xfffffffful) + sc->chiptype != CHIP_IGD && sc->chiptype != CHIP_G4X && + ptoa((vm_paddr_t)Maxmem) > 0xfffffffful) { device_printf(dev, "agp_i810.c does not support physical " "memory above 4GB.\n"); @@ -491,7 +504,7 @@ agp_i810_attach(device_t dev) gatt->ag_physical = pgtblctl & ~1; } else if (sc->chiptype == CHIP_I855 || sc->chiptype == CHIP_I915 || sc->chiptype == CHIP_I965 || sc->chiptype == CHIP_G33 || - sc->chiptype == CHIP_G4X) { + sc->chiptype == CHIP_IGD || sc->chiptype == CHIP_G4X) { unsigned int gcc1, pgtblctl, stolen, gtt_size; /* Stolen memory is set up at the beginning of the aperture by @@ -553,6 +566,7 @@ agp_i810_attach(device_t dev) return EINVAL; } break; + case CHIP_IGD: case CHIP_G4X: gtt_size = 0; break; @@ -587,6 +601,7 @@ agp_i810_attach(device_t dev) if (sc->chiptype == CHIP_I915 || sc->chiptype == CHIP_I965 || sc->chiptype == CHIP_G33 || + sc->chiptype == CHIP_IGD || sc->chiptype == CHIP_G4X) { stolen = 48 * 1024; } else { @@ -597,6 +612,7 @@ agp_i810_attach(device_t dev) if (sc->chiptype == CHIP_I915 || sc->chiptype == CHIP_I965 || sc->chiptype == CHIP_G33 || + sc->chiptype == CHIP_IGD || sc->chiptype == CHIP_G4X) { stolen = 64 * 1024; } else { @@ -606,6 +622,7 @@ agp_i810_attach(device_t dev) case AGP_G33_GCC1_GMS_STOLEN_128M: if (sc->chiptype == CHIP_I965 || sc->chiptype == CHIP_G33 || + sc->chiptype == CHIP_IGD || sc->chiptype == CHIP_G4X) { stolen = 128 * 1024; } else { @@ -615,6 +632,7 @@ agp_i810_attach(device_t dev) case AGP_G33_GCC1_GMS_STOLEN_256M: if (sc->chiptype == CHIP_I965 || sc->chiptype == CHIP_G33 || + sc->chiptype == CHIP_IGD || sc->chiptype == CHIP_G4X) { stolen = 256 * 1024; } else { @@ -783,6 +801,7 @@ agp_i810_set_aperture(device_t dev, u_in case CHIP_I915: case CHIP_I965: case CHIP_G33: + case CHIP_IGD: case CHIP_G4X: return agp_generic_set_aperture(dev, aperture); } @@ -803,7 +822,7 @@ agp_i810_write_gtt_entry(device_t dev, i pte = (u_int32_t)physical | 1; if (sc->chiptype == CHIP_I965 || sc->chiptype == CHIP_G33 || - sc->chiptype == CHIP_G4X) { + sc->chiptype == CHIP_IGD || sc->chiptype == CHIP_G4X) { pte |= (physical & 0x0000000f00000000ull) >> 28; } else { /* If we do actually have memory above 4GB on an older system, @@ -823,6 +842,7 @@ agp_i810_write_gtt_entry(device_t dev, i break; case CHIP_I915: case CHIP_G33: + case CHIP_IGD: bus_write_4(sc->sc_res[1], (offset >> AGP_PAGE_SHIFT) * 4, pte); break; From owner-svn-src-stable-8@FreeBSD.ORG Sun Apr 4 15:42:53 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 05E85106566B; Sun, 4 Apr 2010 15:42:53 +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 E7B0F8FC08; Sun, 4 Apr 2010 15:42:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o34FgqPR053371; Sun, 4 Apr 2010 15:42:52 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o34Fgqvm053368; Sun, 4 Apr 2010 15:42:52 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <201004041542.o34Fgqvm053368@svn.freebsd.org> From: Robert Noland Date: Sun, 4 Apr 2010 15:42:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206165 - in stable/8/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Apr 2010 15:42:53 -0000 Author: rnoland Date: Sun Apr 4 15:42:52 2010 New Revision: 206165 URL: http://svn.freebsd.org/changeset/base/206165 Log: MFC r203289,r203367 Enable MTRR on all VIA CPUs that claim support Modified: stable/8/sys/amd64/amd64/amd64_mem.c stable/8/sys/i386/i386/i686_mem.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/amd64/amd64/amd64_mem.c ============================================================================== --- stable/8/sys/amd64/amd64/amd64_mem.c Sun Apr 4 15:37:47 2010 (r206164) +++ stable/8/sys/amd64/amd64/amd64_mem.c Sun Apr 4 15:42:52 2010 (r206165) @@ -707,11 +707,8 @@ amd64_mem_drvinit(void *unused) switch (cpu_vendor_id) { case CPU_VENDOR_INTEL: case CPU_VENDOR_AMD: - break; case CPU_VENDOR_CENTAUR: - if (cpu_exthigh >= 0x80000008) - break; - /* FALLTHROUGH */ + break; default: return; } Modified: stable/8/sys/i386/i386/i686_mem.c ============================================================================== --- stable/8/sys/i386/i386/i686_mem.c Sun Apr 4 15:37:47 2010 (r206164) +++ stable/8/sys/i386/i386/i686_mem.c Sun Apr 4 15:42:52 2010 (r206165) @@ -707,11 +707,8 @@ i686_mem_drvinit(void *unused) switch (cpu_vendor_id) { case CPU_VENDOR_INTEL: case CPU_VENDOR_AMD: - break; case CPU_VENDOR_CENTAUR: - if (cpu_exthigh >= 0x80000008) - break; - /* FALLTHROUGH */ + break; default: return; } From owner-svn-src-stable-8@FreeBSD.ORG Sun Apr 4 15:46:46 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F822106566B; Sun, 4 Apr 2010 15:46:46 +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 5DE8D8FC21; Sun, 4 Apr 2010 15:46:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o34FkkGP054281; Sun, 4 Apr 2010 15:46:46 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o34Fkkgh054277; Sun, 4 Apr 2010 15:46:46 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <201004041546.o34Fkkgh054277@svn.freebsd.org> From: Robert Noland Date: Sun, 4 Apr 2010 15:46:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206166 - stable/8/sys/dev/drm X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Apr 2010 15:46:46 -0000 Author: rnoland Date: Sun Apr 4 15:46:46 2010 New Revision: 206166 URL: http://svn.freebsd.org/changeset/base/206166 Log: MFC r205120,r205126 Add drm support for Intel Pineview chips. Modified: stable/8/sys/dev/drm/drm_pciids.h stable/8/sys/dev/drm/i915_drv.h stable/8/sys/dev/drm/i915_reg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/drm/drm_pciids.h ============================================================================== --- stable/8/sys/dev/drm/drm_pciids.h Sun Apr 4 15:42:52 2010 (r206165) +++ stable/8/sys/dev/drm/drm_pciids.h Sun Apr 4 15:46:46 2010 (r206166) @@ -549,7 +549,9 @@ {0x8086, 0x29B2, CHIP_I9XX|CHIP_I915, "Intel Q35"}, \ {0x8086, 0x29D2, CHIP_I9XX|CHIP_I915, "Intel Q33"}, \ {0x8086, 0x2A42, CHIP_I9XX|CHIP_I965, "Mobile IntelĀ® GM45 Express Chipset"}, \ - {0x8086, 0x2E02, CHIP_I9XX|CHIP_I965, "Intel Integrated Graphics Device"}, \ + {0x8086, 0x2E02, CHIP_I9XX|CHIP_I965, "Intel Eaglelake"}, \ + {0x8086, 0xA001, CHIP_I9XX|CHIP_I965, "Intel Pineview"}, \ + {0x8086, 0xA011, CHIP_I9XX|CHIP_I965, "Intel Pineview (M)"}, \ {0x8086, 0x2E12, CHIP_I9XX|CHIP_I965, "Intel Q45/Q43"}, \ {0x8086, 0x2E22, CHIP_I9XX|CHIP_I965, "Intel G45/G43"}, \ {0x8086, 0x2E32, CHIP_I9XX|CHIP_I965, "Intel G41"}, \ Modified: stable/8/sys/dev/drm/i915_drv.h ============================================================================== --- stable/8/sys/dev/drm/i915_drv.h Sun Apr 4 15:42:52 2010 (r206165) +++ stable/8/sys/dev/drm/i915_drv.h Sun Apr 4 15:46:46 2010 (r206166) @@ -657,15 +657,21 @@ extern int i915_wait_ring(struct drm_dev (dev)->pci_device == 0x2E32 || \ IS_GM45(dev)) +#define IS_IGDG(dev) ((dev)->pci_device == 0xa001) +#define IS_IGDGM(dev) ((dev)->pci_device == 0xa011) +#define IS_IGD(dev) (IS_IGDG(dev) || IS_IGDGM(dev)) + #define IS_G33(dev) ((dev)->pci_device == 0x29C2 || \ (dev)->pci_device == 0x29B2 || \ - (dev)->pci_device == 0x29D2) + (dev)->pci_device == 0x29D2 || \ + IS_IGD(dev)) #define IS_I9XX(dev) (IS_I915G(dev) || IS_I915GM(dev) || IS_I945G(dev) || \ IS_I945GM(dev) || IS_I965G(dev) || IS_G33(dev)) #define IS_MOBILE(dev) (IS_I830(dev) || IS_I85X(dev) || IS_I915GM(dev) || \ - IS_I945GM(dev) || IS_I965GM(dev) || IS_GM45(dev)) + IS_I945GM(dev) || IS_I965GM(dev) || IS_GM45(dev) || \ + IS_IGD(dev)) #define I915_NEED_GFX_HWS(dev) (IS_G33(dev) || IS_GM45(dev) || IS_G4X(dev)) Modified: stable/8/sys/dev/drm/i915_reg.h ============================================================================== --- stable/8/sys/dev/drm/i915_reg.h Sun Apr 4 15:42:52 2010 (r206165) +++ stable/8/sys/dev/drm/i915_reg.h Sun Apr 4 15:46:46 2010 (r206166) @@ -362,6 +362,7 @@ __FBSDID("$FreeBSD$"); #define DPLLB_LVDS_P2_CLOCK_DIV_7 (1 << 24) /* i915 */ #define DPLL_P2_CLOCK_DIV_MASK 0x03000000 /* i915 */ #define DPLL_FPA01_P1_POST_DIV_MASK 0x00ff0000 /* i915 */ +#define DPLL_FPA01_P1_POST_DIV_MASK_IGD 0x00ff8000 /* IGD */ #define I915_FIFO_UNDERRUN_STATUS (1UL<<31) #define I915_CRC_ERROR_ENABLE (1UL<<29) @@ -438,6 +439,7 @@ __FBSDID("$FreeBSD$"); */ #define DPLL_FPA01_P1_POST_DIV_MASK_I830_LVDS 0x003f0000 #define DPLL_FPA01_P1_POST_DIV_SHIFT 16 +#define DPLL_FPA01_P1_POST_DIV_SHIFT_IGD 15 /* i830, required in DVO non-gang */ #define PLL_P2_DIVIDE_BY_4 (1 << 23) #define PLL_P1_DIVIDE_BY_TWO (1 << 21) /* i830 */ @@ -504,10 +506,12 @@ __FBSDID("$FreeBSD$"); #define FPB0 0x06048 #define FPB1 0x0604c #define FP_N_DIV_MASK 0x003f0000 +#define FP_N_IGD_DIV_MASK 0x00ff0000 #define FP_N_DIV_SHIFT 16 #define FP_M1_DIV_MASK 0x00003f00 #define FP_M1_DIV_SHIFT 8 #define FP_M2_DIV_MASK 0x0000003f +#define FP_M2_IGD_DIV_MASK 0x000000ff #define FP_M2_DIV_SHIFT 0 #define DPLL_TEST 0x606c #define DPLLB_TEST_SDVO_DIV_1 (0 << 22) From owner-svn-src-stable-8@FreeBSD.ORG Sun Apr 4 23:13:26 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD4D4106566B; Sun, 4 Apr 2010 23:13:26 +0000 (UTC) (envelope-from oliver.pntr@gmail.com) Received: from mail-bw0-f216.google.com (mail-bw0-f216.google.com [209.85.218.216]) by mx1.freebsd.org (Postfix) with ESMTP id 876FB8FC18; Sun, 4 Apr 2010 23:13:25 +0000 (UTC) Received: by bwz8 with SMTP id 8so2679372bwz.3 for ; Sun, 04 Apr 2010 16:13:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:received:message-id:subject:from:to:cc:content-type; bh=jNy5vvkmf5uPe+kn7cm96kcxXZ469iEn73EXN2nzNbk=; b=Upf3453ElwzJJ6aAKPEXWGLBG4Y4jR9bW1HiD2Tqh7BxuzZ5yKekDd+VkoA7TPdOYD MNareDcYm5/hyJ7Td+P/TwlDxPSz+6kGVjfGa8w7cYr4pWOekBI6dOHr2CTXtmQWWymo 3xtcJ4HQaHwgPClFwJw3toAqU0BcPjTppSOLI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=rz50ejuPck2UZILTKHInNkzFMgxVhjRUsFY+JnSeNxssfftlfCyAe+K9N3zexSn6zW 9XYgYdvBtBpQK19vyAQr3UtUqmnVs4sk5/4Xutbk6uMy/cbbwvP+A1t6xaY1pG+bnmpR I8osTJimy4eVEZgG1ehskRhR2DUoQqscQ/Dt0= MIME-Version: 1.0 Received: by 10.204.119.11 with HTTP; Sun, 4 Apr 2010 16:13:24 -0700 (PDT) In-Reply-To: <201003271815.o2RIFIKH063154@svn.freebsd.org> References: <201003271815.o2RIFIKH063154@svn.freebsd.org> Date: Mon, 5 Apr 2010 00:13:24 +0100 Received: by 10.204.16.73 with SMTP id n9mr1645941bka.21.1270422804278; Sun, 04 Apr 2010 16:13:24 -0700 (PDT) Message-ID: From: Oliver Pinter To: Edward Tomasz Napierala Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r205772 - in stable/8/sbin/geom: class/cache core X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Apr 2010 23:13:26 -0000 hi! can you this man pages add to 7-STABLE? On 3/27/10, Edward Tomasz Napierala wrote: > Author: trasz > Date: Sat Mar 27 18:15:18 2010 > New Revision: 205772 > URL: http://svn.freebsd.org/changeset/base/205772 > > Log: > MFC r201432: > > Add manual page for gcache(8). > > Added: > stable/8/sbin/geom/class/cache/gcache.8 > - copied unchanged from r201432, head/sbin/geom/class/cache/gcache.8 > Modified: > stable/8/sbin/geom/class/cache/Makefile > stable/8/sbin/geom/core/geom.8 > Directory Properties: > stable/8/sbin/geom/ (props changed) > stable/8/sbin/geom/class/stripe/ (props changed) > > Modified: stable/8/sbin/geom/class/cache/Makefile > ============================================================================== > --- stable/8/sbin/geom/class/cache/Makefile Sat Mar 27 18:12:00 > 2010 (r205771) > +++ stable/8/sbin/geom/class/cache/Makefile Sat Mar 27 18:15:18 > 2010 (r205772) > @@ -3,6 +3,5 @@ > .PATH: ${.CURDIR}/../../misc > > CLASS= cache > -NO_MAN= # notyet > > .include > > Copied: stable/8/sbin/geom/class/cache/gcache.8 (from r201432, > head/sbin/geom/class/cache/gcache.8) > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ stable/8/sbin/geom/class/cache/gcache.8 Sat Mar 27 18:15:18 > 2010 (r205772, copy of r201432, head/sbin/geom/class/cache/gcache.8) > @@ -0,0 +1,192 @@ > +.\"- > +.\" Copyright (c) 2010 Edward Tomasz Napierala > +.\" 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 THE VOICES IN HIS HEAD > BE > +.\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR > +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF > +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR > BUSINESS > +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN > +.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) > +.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF > THE > +.\" POSSIBILITY OF SUCH DAMAGE. > +.\" > +.\" $FreeBSD$ > +.\" > +.Dd January 3, 2010 > +.Dt GCACHE 8 > +.Os > +.Sh NAME > +.Nm gcache > +.Nd "control utility for CACHE GEOM class" > +.Sh SYNOPSIS > +.Nm > +.Cm create > +.Op Fl v > +.Op Fl b Ar blocksize > +.Op Fl s Ar size > +.Ar name > +.Ar prov > +.Nm > +.Cm configure > +.Op Fl v > +.Op Fl b Ar blocksize > +.Op Fl s Ar size > +.Ar name > +.Nm > +.Cm destroy > +.Op Fl fv > +.Ar name > +.Nm > +.Cm label > +.Op Fl v > +.Op Fl b Ar blocksize > +.Op Fl s Ar size > +.Ar name > +.Ar prov > +.Nm > +.Cm stop > +.Op Fl fv > +.Ar name ... > +.Nm > +.Cm clear > +.Op Fl v > +.Ar prov ... > +.Nm > +.Cm dump > +.Ar prov ... > +.Nm > +.Cm list > +.Nm > +.Cm status > +.Op Fl s Ar name > +.Nm > +.Cm load > +.Op Fl v > +.Nm > +.Cm unload > +.Op Fl v > +.Sh DESCRIPTION > +The > +.Nm > +utility is used to control GEOM cache, which can > +speed up read performance by sending fixed size > +read requests to its consumer. It has been developed to address > +the problem of a horrible read performance of a 64k blocksize FS > +residing on a RAID3 array with 8 data components, where a single > +disk component would only get 8k read requests, thus effectively > +killing disk performance under high load. > +.Pp > +Caching can be configured using two different methods: > +.Dq manual > +or > +.Dq automatic . > +When using the > +.Dq manual > +method, no metadata are stored on the devices, so the cached > +device has to be configured by hand every time it is needed. > +The > +.Dq automatic > +method uses on-disk metadata to detect devices. > +Once devices are labeled, they will be automatically detected and > +configured. > +.Pp > +The first argument to > +.Nm > +indicates an action to be performed: > +.Bl -tag -width ".Cm destroy" > +.It Cm create > +Cache the given devices with specified > +.Ar name . > +This is the > +.Dq manual > +method. > +The kernel module > +.Pa geom_cache.ko > +will be loaded if it is not loaded already. > +.It Cm label > +Cache the given devices with the specified > +.Ar name . > +This is the > +.Dq automatic > +method, where metadata are stored in every device's last sector. > +The kernel module > +.Pa geom_cache.ko > +will be loaded if it is not loaded already. > +.It Cm stop > +Turn off existing cache device by its > +.Ar name . > +This command does not touch on-disk metadata! > +.It Cm destroy > +Same as > +.Cm stop . > +.It Cm clear > +Clear metadata on the given devices. > +.It Cm dump > +Dump metadata stored on the given devices. > +.It Cm list > +See > +.Xr geom 8 . > +.It Cm status > +See > +.Xr geom 8 . > +.It Cm load > +See > +.Xr geom 8 . > +.It Cm unload > +See > +.Xr geom 8 . > +.El > +.Pp > +Additional options: > +.Bl -tag -width indent > +.It Fl f > +Force the removal of the specified cache device. > +.It Fl v > +Be more verbose. > +.El > +.Sh SYSCTL VARIABLES > +The following > +.Xr sysctl 8 > +variables can be used to control the behavior of the > +.Nm CACHE > +GEOM class. > +The default value is shown next to each variable. > +.Bl -tag -width indent > +.It Va kern.geom.cache.used_hi : No 20 > +.It Va kern.geom.cache.used_lo : No 5 > +.It Va kern.geom.cache.idletime : No 5 > +.It Va kern.geom.cache.timeout : No 10 > +.It Va kern.geom.cache.enable : No 1 > +.It Va kern.geom.cache.debug : No 0 > +Debug level of the > +.Nm CACHE > +GEOM class. > +This can be set to a number between 0 and 3 inclusive. > +If set to 0 minimal debug information is printed, and if set to 3 the > +maximum amount of debug information is printed. > +.El > +.Sh EXIT STATUS > +Exit status is 0 on success, and 1 if the command fails. > +.Sh SEE ALSO > +.Xr geom 4 , > +.Xr geom 8 > +.Sh HISTORY > +The > +.Nm > +utility appeared in > +.Fx 7.0 . > +.Sh AUTHORS > +.An Ruslan Ermilov Aq ru@FreeBSD.org > > Modified: stable/8/sbin/geom/core/geom.8 > ============================================================================== > --- stable/8/sbin/geom/core/geom.8 Sat Mar 27 18:12:00 2010 (r205771) > +++ stable/8/sbin/geom/core/geom.8 Sat Mar 27 18:15:18 2010 (r205772) > @@ -166,7 +166,7 @@ geom md unload > .Sh SEE ALSO > .Xr libgeom 3 , > .Xr geom 4 , > -.\" .Xr gcache 8 , > +.Xr gcache 8 , > .Xr gconcat 8 , > .Xr geli 8 , > .Xr gjournal 8 , > _______________________________________________ > svn-src-stable@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-stable > To unsubscribe, send any mail to "svn-src-stable-unsubscribe@freebsd.org" > From owner-svn-src-stable-8@FreeBSD.ORG Mon Apr 5 03:56:31 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E0B8F1065674 for ; Mon, 5 Apr 2010 03:56:30 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id 866198FC1A for ; Mon, 5 Apr 2010 03:56:30 +0000 (UTC) Received: (qmail 22498 invoked by uid 399); 5 Apr 2010 03:56:29 -0000 Received: from localhost (HELO foreign.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 5 Apr 2010 03:56:29 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4BB95F6C.7070202@FreeBSD.org> Date: Sun, 04 Apr 2010 20:56:28 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.1.9) Gecko/20100330 Thunderbird/3.0.4 MIME-Version: 1.0 To: Jilles Tjoelker References: <201003282019.o2SKJfPg033857@svn.freebsd.org> <4BAFBBFA.7020701@FreeBSD.org> <20100328210630.GA2086@stack.nl> <4BAFE1EE.9040908@FreeBSD.org> <20100329173214.GA17249@stack.nl> In-Reply-To: <20100329173214.GA17249@stack.nl> X-Enigmail-Version: 1.0.1 OpenPGP: id=D5B2F0FB Content-Type: multipart/mixed; boundary="------------070707050009090200000503" Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r205806 - stable/8/etc X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Apr 2010 03:56:31 -0000 This is a multi-part message in MIME format. --------------070707050009090200000503 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On 03/29/10 10:32, Jilles Tjoelker wrote: > On Sun, Mar 28, 2010 at 04:10:38PM -0700, Doug Barton wrote: >> On 03/28/10 14:06, Jilles Tjoelker wrote: >>> On Sun, Mar 28, 2010 at 01:28:42PM -0700, Doug Barton wrote: >>>> Probably my fault for not saying something sooner, but there is a >>>> problem with the code in head that sometimes causes it to loop >>>> repeatedly even though pwait exits successfully. I am trying to track it >>>> down, but since it only happens about once every 10 shutdowns it's been >>>> difficult. > >>> There is a difference between the two methods in what is waited for >>> exactly. pwait(1) will wait for the process to terminate; if it is >>> applied to a zombie it will return immediately (printing the exit status >>> if -v was given). On the other hand, kill(1) will continue to return >>> success until the process has been waited for by its parent. > >> The process that I see this with most often is devd, does that fit the >> model you're describing? > > Possibly. This would mainly happen because init has been busy, I think > (or if the parent isn't init). > >> What are the implications of moving on after a >> successful pwait even though there is still a zombie process? > > For shutdown/stop, nothing. > > For restart, there may be problems if a restarted daemon checks the > validity of the pid in the pidfile using kill(). Ok, in that case I'm not really comfortable with the idea of ignoring the results of kill -0, however I've come up with what I think is a good solution in the attached patch. Based on your description and my ongoing analysis the problem I was seeing with the long string of the same pid repeated over and over seems to be a side effect of pwait returning successfully (thus the || sleep 2 never kicks in) but 'kill -0' still being able to see the pid. So, I've moved the sleep up so that if we're not in the first pass but kill -0 is still seeing the pid that we sleep for 1 second, then proceed. I think that'll handle both the problem I saw, and the odd case where pwait doesn't return successfully. Sound good? Doug -- ... and that's just a little bit of history repeating. -- Propellerheads Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/ --------------070707050009090200000503 Content-Type: text/plain; name="wait_for_pids.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="wait_for_pids.diff" Index: rc.subr =================================================================== --- rc.subr (revision 206117) +++ rc.subr (working copy) @@ -359,12 +359,14 @@ if [ -z "$_list" ]; then return fi - _prefix= + + local _prefix= while true; do _nlist=""; for _j in $_list; do if kill -0 $_j 2>/dev/null; then _nlist="${_nlist}${_nlist:+ }$_j" + [ -n "$_prefix" ] && sleep 1 fi done if [ -z "$_nlist" ]; then @@ -373,7 +375,7 @@ _list=$_nlist echo -n ${_prefix:-"Waiting for PIDS: "}$_list _prefix=", " - pwait $_list 2>/dev/null || sleep 2 + pwait $_list 2>/dev/null done if [ -n "$_prefix" ]; then echo "." --------------070707050009090200000503-- From owner-svn-src-stable-8@FreeBSD.ORG Mon Apr 5 13:33:55 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 20A271065694; Mon, 5 Apr 2010 13:33:55 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0F1EA8FC16; Mon, 5 Apr 2010 13:33:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o35DXs2d042654; Mon, 5 Apr 2010 13:33:54 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o35DXs5X042651; Mon, 5 Apr 2010 13:33:54 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <201004051333.o35DXs5X042651@svn.freebsd.org> From: Randall Stewart Date: Mon, 5 Apr 2010 13:33:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206180 - stable/8/sys/kern X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Apr 2010 13:33:55 -0000 Author: rrs Date: Mon Apr 5 13:33:54 2010 New Revision: 206180 URL: http://svn.freebsd.org/changeset/base/206180 Log: MFC of 204670: ------------------------- sched_getparam was just plain broke for time-share processes. It did not return an error but instead just let garbage be passed back. This I fix so it actually properly translates the priority the process is at to a posix's high means more priority. I also fix it so that if the ULE scheduler has bumped it up to a realtime process you get back a sane value i.e. the highest priority (63 for time-share). sched_setscheduler() had the setting of the timeshare class priority disabled. With some notes about rejecting the posix high numbers is greater priority and use nice instead. This fix also adjusts that to work, with the cavet that a t-s process may well get bumped up or down i.e. the setscheduler() will NOT change the nice value only the current priority. I think this is reasonable considering if the user wants to play with nice then he can. At least all the posix'ish interfaces now respond sanely. ----------------------- Modified: stable/8/sys/kern/kern_resource.c stable/8/sys/kern/ksched.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/kern/kern_resource.c ============================================================================== --- stable/8/sys/kern/kern_resource.c Mon Apr 5 11:00:21 2010 (r206179) +++ stable/8/sys/kern/kern_resource.c Mon Apr 5 13:33:54 2010 (r206180) @@ -471,14 +471,20 @@ rtp_to_pri(struct rtprio *rtp, struct th u_char newpri; u_char oldpri; - if (rtp->prio > RTP_PRIO_MAX) - return (EINVAL); thread_lock(td); switch (RTP_PRIO_BASE(rtp->type)) { case RTP_PRIO_REALTIME: + if (rtp->prio > RTP_PRIO_MAX) { + thread_unlock(td); + return (EINVAL); + } newpri = PRI_MIN_REALTIME + rtp->prio; break; case RTP_PRIO_NORMAL: + if (rtp->prio > (PRI_MAX_TIMESHARE - PRI_MIN_TIMESHARE)) { + thread_unlock(td); + return (EINVAL); + } newpri = PRI_MIN_TIMESHARE + rtp->prio; break; case RTP_PRIO_IDLE: Modified: stable/8/sys/kern/ksched.c ============================================================================== --- stable/8/sys/kern/ksched.c Mon Apr 5 11:00:21 2010 (r206179) +++ stable/8/sys/kern/ksched.c Mon Apr 5 13:33:54 2010 (r206180) @@ -81,9 +81,8 @@ ksched_detach(struct ksched *ks) * higher priority. It also permits sched_setparam to be * implementation defined for SCHED_OTHER. I don't like * the notion of inverted priorites for normal processes when - * you can use "setpriority" for that. + * you can use "setpriority" for that. * - * I'm rejecting sched_setparam for SCHED_OTHER with EINVAL. */ /* Macros to convert between the unix (lower numerically is higher priority) @@ -93,6 +92,9 @@ ksched_detach(struct ksched *ks) #define p4prio_to_rtpprio(P) (RTP_PRIO_MAX - (P)) #define rtpprio_to_p4prio(P) (RTP_PRIO_MAX - (P)) +#define p4prio_to_tsprio(P) ((PRI_MAX_TIMESHARE - PRI_MIN_TIMESHARE) - (P)) +#define tsprio_to_p4prio(P) ((PRI_MAX_TIMESHARE - PRI_MIN_TIMESHARE) - (P)) + /* These improve readability a bit for me: */ #define P1B_PRIO_MIN rtpprio_to_p4prio(RTP_PRIO_MAX) @@ -134,9 +136,6 @@ ksched_setparam(struct ksched *ksched, if (e == 0) { - if (policy == SCHED_OTHER) - e = EINVAL; - else e = ksched_setscheduler(ksched, td, policy, param); } @@ -152,7 +151,16 @@ ksched_getparam(struct ksched *ksched, pri_to_rtp(td, &rtp); if (RTP_PRIO_IS_REALTIME(rtp.type)) param->sched_priority = rtpprio_to_p4prio(rtp.prio); - + else { + if (PRI_MIN_TIMESHARE < rtp.prio) + /* + * The interactive score has it to min realtime + * so we must show max (64 most likely + */ + param->sched_priority = (PRI_MAX_TIMESHARE - PRI_MIN_TIMESHARE); + else + param->sched_priority = tsprio_to_p4prio(rtp.prio); + } return 0; } @@ -191,11 +199,14 @@ ksched_setscheduler(struct ksched *ksche break; case SCHED_OTHER: - { + if (param->sched_priority >= 0 && + param->sched_priority <= (PRI_MAX_TIMESHARE - PRI_MIN_TIMESHARE)) { rtp.type = RTP_PRIO_NORMAL; rtp.prio = p4prio_to_rtpprio(param->sched_priority); rtp_to_pri(&rtp, td); - } + } else + e = EINVAL; + break; default: From owner-svn-src-stable-8@FreeBSD.ORG Mon Apr 5 13:48:23 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CB5A9106564A; Mon, 5 Apr 2010 13:48:23 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B8FD58FC15; Mon, 5 Apr 2010 13:48:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o35DmNdG045926; Mon, 5 Apr 2010 13:48:23 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o35DmNot045918; Mon, 5 Apr 2010 13:48:23 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <201004051348.o35DmNot045918@svn.freebsd.org> From: Randall Stewart Date: Mon, 5 Apr 2010 13:48:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206181 - in stable/8/sys: dev/xen/netback netinet netinet6 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Apr 2010 13:48:23 -0000 Author: rrs Date: Mon Apr 5 13:48:23 2010 New Revision: 206181 URL: http://svn.freebsd.org/changeset/base/206181 Log: MFC of 2 items to fix the csum for v6 issue: Revision 205075 and 205104: ---------205075---------- With the recent change of the sctp checksum to support offload, no delayed checksum was added to the ip6 output code. This causes cards that do not support SCTP checksum offload to have SCTP packets that are IPv6 NOT have the sctp checksum performed. Thus you could not communicate with a peer. This adds the missing bits to make the checksum happen for these cards. ------------------------- ---------205104---------- The proper fix for the delayed SCTP checksum is to have the delayed function take an argument as to the offset to the SCTP header. This allows it to work for V4 and V6. This of course means changing all callers of the function to either pass the header len, if they have it, or create it (ip_hl << 2 or sizeof(ip6_hdr)). ------------------------- PR: 144529 Modified: stable/8/sys/dev/xen/netback/netback.c stable/8/sys/netinet/ip_divert.c stable/8/sys/netinet/ip_ipsec.c stable/8/sys/netinet/ip_output.c stable/8/sys/netinet/sctp_crc32.c stable/8/sys/netinet/sctp_crc32.h stable/8/sys/netinet6/ip6_output.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/xen/netback/netback.c ============================================================================== --- stable/8/sys/dev/xen/netback/netback.c Mon Apr 5 13:33:54 2010 (r206180) +++ stable/8/sys/dev/xen/netback/netback.c Mon Apr 5 13:48:23 2010 (r206181) @@ -302,7 +302,7 @@ fixup_checksum(struct mbuf *m) m->m_pkthdr.csum_flags &= ~CSUM_TCP; #ifdef SCTP } else if (sw_csum & CSUM_SCTP) { - sctp_delayed_cksum(m); + sctp_delayed_cksum(m, iphlen); sw_csum &= ~CSUM_SCTP; #endif } else { Modified: stable/8/sys/netinet/ip_divert.c ============================================================================== --- stable/8/sys/netinet/ip_divert.c Mon Apr 5 13:33:54 2010 (r206180) +++ stable/8/sys/netinet/ip_divert.c Mon Apr 5 13:48:23 2010 (r206181) @@ -234,7 +234,7 @@ divert_packet(struct mbuf *m, int incomi #ifdef SCTP if (m->m_pkthdr.csum_flags & CSUM_SCTP) { ip->ip_len = ntohs(ip->ip_len); - sctp_delayed_cksum(m); + sctp_delayed_cksum(m, (uint32_t)(ip->ip_hl << 2)); m->m_pkthdr.csum_flags &= ~CSUM_SCTP; ip->ip_len = htons(ip->ip_len); } Modified: stable/8/sys/netinet/ip_ipsec.c ============================================================================== --- stable/8/sys/netinet/ip_ipsec.c Mon Apr 5 13:33:54 2010 (r206180) +++ stable/8/sys/netinet/ip_ipsec.c Mon Apr 5 13:48:23 2010 (r206181) @@ -343,7 +343,7 @@ ip_ipsec_output(struct mbuf **m, struct } #ifdef SCTP if ((*m)->m_pkthdr.csum_flags & CSUM_SCTP) { - sctp_delayed_cksum(*m); + sctp_delayed_cksum(*m, (uint32_t)(ip->ip_hl << 2)); (*m)->m_pkthdr.csum_flags &= ~CSUM_SCTP; } #endif Modified: stable/8/sys/netinet/ip_output.c ============================================================================== --- stable/8/sys/netinet/ip_output.c Mon Apr 5 13:33:54 2010 (r206180) +++ stable/8/sys/netinet/ip_output.c Mon Apr 5 13:48:23 2010 (r206181) @@ -589,7 +589,7 @@ passout: } #ifdef SCTP if (sw_csum & CSUM_SCTP) { - sctp_delayed_cksum(m); + sctp_delayed_cksum(m, (uint32_t)(ip->ip_hl << 2)); sw_csum &= ~CSUM_SCTP; } #endif @@ -731,7 +731,7 @@ ip_fragment(struct ip *ip, struct mbuf * #ifdef SCTP if (m0->m_pkthdr.csum_flags & CSUM_SCTP && (if_hwassist_flags & CSUM_IP_FRAGS) == 0) { - sctp_delayed_cksum(m0); + sctp_delayed_cksum(m0, hlen); m0->m_pkthdr.csum_flags &= ~CSUM_SCTP; } #endif Modified: stable/8/sys/netinet/sctp_crc32.c ============================================================================== --- stable/8/sys/netinet/sctp_crc32.c Mon Apr 5 13:33:54 2010 (r206180) +++ stable/8/sys/netinet/sctp_crc32.c Mon Apr 5 13:48:23 2010 (r206181) @@ -127,14 +127,12 @@ sctp_calculate_cksum(struct mbuf *m, uin void -sctp_delayed_cksum(struct mbuf *m) +sctp_delayed_cksum(struct mbuf *m, uint32_t offset) { struct ip *ip; uint32_t checksum; - uint32_t offset; ip = mtod(m, struct ip *); - offset = ip->ip_hl << 2; checksum = sctp_calculate_cksum(m, offset); SCTP_STAT_DECR(sctps_sendhwcrc); SCTP_STAT_INCR(sctps_sendswcrc); Modified: stable/8/sys/netinet/sctp_crc32.h ============================================================================== --- stable/8/sys/netinet/sctp_crc32.h Mon Apr 5 13:33:54 2010 (r206180) +++ stable/8/sys/netinet/sctp_crc32.h Mon Apr 5 13:48:23 2010 (r206181) @@ -39,7 +39,7 @@ __FBSDID("$FreeBSD$"); #if defined(_KERNEL) || defined(__Userspace__) uint32_t sctp_calculate_cksum(struct mbuf *, uint32_t); -void sctp_delayed_cksum(struct mbuf *); +void sctp_delayed_cksum(struct mbuf *, uint32_t offset); #endif /* _KERNEL */ Modified: stable/8/sys/netinet6/ip6_output.c ============================================================================== --- stable/8/sys/netinet6/ip6_output.c Mon Apr 5 13:33:54 2010 (r206180) +++ stable/8/sys/netinet6/ip6_output.c Mon Apr 5 13:48:23 2010 (r206181) @@ -66,6 +66,7 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" #include "opt_inet6.h" #include "opt_ipsec.h" +#include "opt_sctp.h" #include #include @@ -102,6 +103,10 @@ __FBSDID("$FreeBSD$"); #include #include #endif /* IPSEC */ +#ifdef SCTP +#include +#include +#endif #include #include @@ -208,6 +213,9 @@ ip6_output(struct mbuf *m0, struct ip6_p struct route_in6 *ro_pmtu = NULL; int hdrsplit = 0; int needipsec = 0; +#ifdef SCTP + int sw_csum; +#endif #ifdef IPSEC struct ipsec_output_state state; struct ip6_rthdr *rh = NULL; @@ -829,6 +837,10 @@ again: } m->m_pkthdr.csum_flags |= CSUM_IP_CHECKED | CSUM_IP_VALID; +#ifdef SCTP + if (m->m_pkthdr.csum_flags & CSUM_SCTP) + m->m_pkthdr.csum_flags |= CSUM_SCTP_VALID; +#endif error = netisr_queue(NETISR_IPV6, m); goto done; } else @@ -857,6 +869,13 @@ passout: * 4: if dontfrag == 1 && alwaysfrag == 1 * error, as we cannot handle this conflicting request */ +#ifdef SCTP + sw_csum = m->m_pkthdr.csum_flags & ~ifp->if_hwassist; + if (sw_csum & CSUM_SCTP) { + sctp_delayed_cksum(m, sizeof(struct ip6_hdr)); + sw_csum &= ~CSUM_SCTP; + } +#endif tlen = m->m_pkthdr.len; if (opt && (opt->ip6po_flags & IP6PO_DONTFRAG)) From owner-svn-src-stable-8@FreeBSD.ORG Mon Apr 5 16:11:42 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D183E106564A; Mon, 5 Apr 2010 16:11:42 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BD0E28FC18; Mon, 5 Apr 2010 16:11:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o35GBgLR077692; Mon, 5 Apr 2010 16:11:42 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o35GBgmJ077683; Mon, 5 Apr 2010 16:11:42 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201004051611.o35GBgmJ077683@svn.freebsd.org> From: Alan Cox Date: Mon, 5 Apr 2010 16:11:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206183 - in stable/8/sys: amd64/amd64 amd64/include i386/i386 i386/include X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Apr 2010 16:11:42 -0000 Author: alc Date: Mon Apr 5 16:11:42 2010 New Revision: 206183 URL: http://svn.freebsd.org/changeset/base/206183 Log: MFC r204907, r204913, r205402, r205573, r205573 Implement AMD's recommended workaround for Erratum 383 on Family 10h processors. Enable machine check exceptions by default. Modified: stable/8/sys/amd64/amd64/mca.c stable/8/sys/amd64/amd64/pmap.c stable/8/sys/amd64/include/md_var.h stable/8/sys/amd64/include/specialreg.h stable/8/sys/i386/i386/mca.c stable/8/sys/i386/i386/pmap.c stable/8/sys/i386/include/md_var.h stable/8/sys/i386/include/specialreg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/amd64/amd64/mca.c ============================================================================== --- stable/8/sys/amd64/amd64/mca.c Mon Apr 5 14:15:51 2010 (r206182) +++ stable/8/sys/amd64/amd64/mca.c Mon Apr 5 16:11:42 2010 (r206183) @@ -60,11 +60,20 @@ static int mca_count; /* Number of reco SYSCTL_NODE(_hw, OID_AUTO, mca, CTLFLAG_RD, NULL, "Machine Check Architecture"); -static int mca_enabled = 0; +static int mca_enabled = 1; TUNABLE_INT("hw.mca.enabled", &mca_enabled); SYSCTL_INT(_hw_mca, OID_AUTO, enabled, CTLFLAG_RDTUN, &mca_enabled, 0, "Administrative toggle for machine check support"); +static int amd10h_L1TP = 1; +TUNABLE_INT("hw.mca.amd10h_L1TP", &amd10h_L1TP); +SYSCTL_INT(_hw_mca, OID_AUTO, amd10h_L1TP, CTLFLAG_RDTUN, &amd10h_L1TP, 0, + "Administrative toggle for logging of level one TLB parity (L1TP) errors"); + +int workaround_erratum383; +SYSCTL_INT(_hw_mca, OID_AUTO, erratum383, CTLFLAG_RD, &workaround_erratum383, 0, + "Is the workaround for Erratum 383 on AMD Family 10h processors enabled?"); + static STAILQ_HEAD(, mca_internal) mca_records; static struct callout mca_timer; static int mca_ticks = 3600; /* Check hourly by default. */ @@ -527,7 +536,7 @@ void mca_init(void) { uint64_t mcg_cap; - uint64_t ctl; + uint64_t ctl, mask; int skip; int i; @@ -535,6 +544,15 @@ mca_init(void) if (!mca_enabled || !(cpu_feature & CPUID_MCE)) return; + /* + * On AMD Family 10h processors, unless logging of level one TLB + * parity (L1TP) errors is disabled, enable the recommended workaround + * for Erratum 383. + */ + if (cpu_vendor_id == CPU_VENDOR_AMD && + CPUID_TO_FAMILY(cpu_id) == 0x10 && amd10h_L1TP) + workaround_erratum383 = 1; + if (cpu_feature & CPUID_MCA) { if (PCPU_GET(cpuid) == 0) mca_setup(); @@ -545,6 +563,19 @@ mca_init(void) /* Enable MCA features. */ wrmsr(MSR_MCG_CTL, MCG_CTL_ENABLE); + /* + * Disable logging of level one TLB parity (L1TP) errors by + * the data cache as an alternative workaround for AMD Family + * 10h Erratum 383. Unlike the recommended workaround, there + * is no performance penalty to this workaround. However, + * L1TP errors will go unreported. + */ + if (cpu_vendor_id == CPU_VENDOR_AMD && + CPUID_TO_FAMILY(cpu_id) == 0x10 && !amd10h_L1TP) { + mask = rdmsr(MSR_MC0_CTL_MASK); + if ((mask & (1UL << 5)) == 0) + wrmsr(MSR_MC0_CTL_MASK, mask | (1UL << 5)); + } for (i = 0; i < (mcg_cap & MCG_CAP_COUNT); i++) { /* By default enable logging of all errors. */ ctl = 0xffffffffffffffffUL; Modified: stable/8/sys/amd64/amd64/pmap.c ============================================================================== --- stable/8/sys/amd64/amd64/pmap.c Mon Apr 5 14:15:51 2010 (r206182) +++ stable/8/sys/amd64/amd64/pmap.c Mon Apr 5 16:11:42 2010 (r206183) @@ -7,7 +7,7 @@ * All rights reserved. * Copyright (c) 2003 Peter Wemm * All rights reserved. - * Copyright (c) 2005-2008 Alan L. Cox + * Copyright (c) 2005-2010 Alan L. Cox * All rights reserved. * * This code is derived from software contributed to Berkeley by @@ -252,6 +252,9 @@ static void pmap_remove_entry(struct pma static void pmap_insert_entry(pmap_t pmap, vm_offset_t va, vm_page_t m); static boolean_t pmap_try_insert_pv_entry(pmap_t pmap, vm_offset_t va, vm_page_t m); +static void pmap_update_pde(pmap_t pmap, vm_offset_t va, pd_entry_t *pde, + pd_entry_t newpde); +static void pmap_update_pde_invalidate(vm_offset_t va, pd_entry_t newpde); static vm_page_t pmap_allocpde(pmap_t pmap, vm_offset_t va, int flags); static vm_page_t pmap_allocpte(pmap_t pmap, vm_offset_t va, int flags); @@ -654,13 +657,13 @@ pmap_init(void) pv_entry_high_water = 9 * (pv_entry_max / 10); /* - * Disable large page mappings by default if the kernel is running in - * a virtual machine on an AMD Family 10h processor. This is a work- - * around for Erratum 383. + * If the kernel is running in a virtual machine on an AMD Family 10h + * processor, then it must assume that MCA is enabled by the virtual + * machine monitor. */ if (vm_guest == VM_GUEST_VM && cpu_vendor_id == CPU_VENDOR_AMD && CPUID_TO_FAMILY(cpu_id) == 0x10) - pg_ps_enabled = 0; + workaround_erratum383 = 1; /* * Are large page mappings enabled? @@ -795,6 +798,45 @@ pmap_cache_bits(int mode, boolean_t is_p cache_bits |= PG_NC_PWT; return (cache_bits); } + +/* + * After changing the page size for the specified virtual address in the page + * table, flush the corresponding entries from the processor's TLB. Only the + * calling processor's TLB is affected. + * + * The calling thread must be pinned to a processor. + */ +static void +pmap_update_pde_invalidate(vm_offset_t va, pd_entry_t newpde) +{ + u_long cr4; + + if ((newpde & PG_PS) == 0) + /* Demotion: flush a specific 2MB page mapping. */ + invlpg(va); + else if ((newpde & PG_G) == 0) + /* + * Promotion: flush every 4KB page mapping from the TLB + * because there are too many to flush individually. + */ + invltlb(); + else { + /* + * Promotion: flush every 4KB page mapping from the TLB, + * including any global (PG_G) mappings. + */ + cr4 = rcr4(); + load_cr4(cr4 & ~CR4_PGE); + /* + * Although preemption at this point could be detrimental to + * performance, it would not lead to an error. PG_G is simply + * ignored if CR4.PGE is clear. Moreover, in case this block + * is re-entered, the load_cr4() either above or below will + * modify CR4.PGE flushing the TLB. + */ + load_cr4(cr4 | CR4_PGE); + } +} #ifdef SMP /* * For SMP, these functions have to use the IPI mechanism for coherence. @@ -891,6 +933,69 @@ pmap_invalidate_cache(void) smp_cache_flush(); sched_unpin(); } + +struct pde_action { + cpumask_t store; /* processor that updates the PDE */ + cpumask_t invalidate; /* processors that invalidate their TLB */ + vm_offset_t va; + pd_entry_t *pde; + pd_entry_t newpde; +}; + +static void +pmap_update_pde_action(void *arg) +{ + struct pde_action *act = arg; + + if (act->store == PCPU_GET(cpumask)) + pde_store(act->pde, act->newpde); +} + +static void +pmap_update_pde_teardown(void *arg) +{ + struct pde_action *act = arg; + + if ((act->invalidate & PCPU_GET(cpumask)) != 0) + pmap_update_pde_invalidate(act->va, act->newpde); +} + +/* + * Change the page size for the specified virtual address in a way that + * prevents any possibility of the TLB ever having two entries that map the + * same virtual address using different page sizes. This is the recommended + * workaround for Erratum 383 on AMD Family 10h processors. It prevents a + * machine check exception for a TLB state that is improperly diagnosed as a + * hardware error. + */ +static void +pmap_update_pde(pmap_t pmap, vm_offset_t va, pd_entry_t *pde, pd_entry_t newpde) +{ + struct pde_action act; + cpumask_t active, cpumask; + + sched_pin(); + cpumask = PCPU_GET(cpumask); + if (pmap == kernel_pmap) + active = all_cpus; + else + active = pmap->pm_active; + if ((active & PCPU_GET(other_cpus)) != 0) { + act.store = cpumask; + act.invalidate = active; + act.va = va; + act.pde = pde; + act.newpde = newpde; + smp_rendezvous_cpus(cpumask | active, + smp_no_rendevous_barrier, pmap_update_pde_action, + pmap_update_pde_teardown, &act); + } else { + pde_store(pde, newpde); + if ((active & cpumask) != 0) + pmap_update_pde_invalidate(va, newpde); + } + sched_unpin(); +} #else /* !SMP */ /* * Normal, non-SMP, invalidation functions. @@ -928,6 +1033,15 @@ pmap_invalidate_cache(void) wbinvd(); } + +static void +pmap_update_pde(pmap_t pmap, vm_offset_t va, pd_entry_t *pde, pd_entry_t newpde) +{ + + pde_store(pde, newpde); + if (pmap == kernel_pmap || pmap->pm_active) + pmap_update_pde_invalidate(va, newpde); +} #endif /* !SMP */ static void @@ -2310,7 +2424,10 @@ pmap_demote_pde(pmap_t pmap, pd_entry_t * processor changing the setting of PG_A and/or PG_M between * the read above and the store below. */ - pde_store(pde, newpde); + if (workaround_erratum383) + pmap_update_pde(pmap, va, pde, newpde); + else + pde_store(pde, newpde); /* * Invalidate a stale recursive mapping of the page table page. @@ -2926,7 +3043,10 @@ setpte: /* * Map the superpage. */ - pde_store(pde, PG_PS | newpde); + if (workaround_erratum383) + pmap_update_pde(pmap, va, pde, PG_PS | newpde); + else + pde_store(pde, PG_PS | newpde); pmap_pde_promotions++; CTR2(KTR_PMAP, "pmap_promote_pde: success for va %#lx" Modified: stable/8/sys/amd64/include/md_var.h ============================================================================== --- stable/8/sys/amd64/include/md_var.h Mon Apr 5 14:15:51 2010 (r206182) +++ stable/8/sys/amd64/include/md_var.h Mon Apr 5 16:11:42 2010 (r206183) @@ -61,6 +61,7 @@ extern char sigcode[]; extern int szsigcode; extern uint64_t *vm_page_dump; extern int vm_page_dump_size; +extern int workaround_erratum383; extern int _udatasel; extern int _ucodesel; extern int _ucode32sel; Modified: stable/8/sys/amd64/include/specialreg.h ============================================================================== --- stable/8/sys/amd64/include/specialreg.h Mon Apr 5 14:15:51 2010 (r206182) +++ stable/8/sys/amd64/include/specialreg.h Mon Apr 5 16:11:42 2010 (r206183) @@ -506,6 +506,7 @@ #define MSR_TOP_MEM 0xc001001a /* boundary for ram below 4G */ #define MSR_TOP_MEM2 0xc001001d /* boundary for ram above 4G */ #define MSR_K8_UCODE_UPDATE 0xc0010020 /* update microcode */ +#define MSR_MC0_CTL_MASK 0xc0010044 /* VIA ACE crypto featureset: for via_feature_rng */ #define VIA_HAS_RNG 1 /* cpu has RNG */ Modified: stable/8/sys/i386/i386/mca.c ============================================================================== --- stable/8/sys/i386/i386/mca.c Mon Apr 5 14:15:51 2010 (r206182) +++ stable/8/sys/i386/i386/mca.c Mon Apr 5 16:11:42 2010 (r206183) @@ -60,11 +60,20 @@ static int mca_count; /* Number of reco SYSCTL_NODE(_hw, OID_AUTO, mca, CTLFLAG_RD, NULL, "Machine Check Architecture"); -static int mca_enabled = 0; +static int mca_enabled = 1; TUNABLE_INT("hw.mca.enabled", &mca_enabled); SYSCTL_INT(_hw_mca, OID_AUTO, enabled, CTLFLAG_RDTUN, &mca_enabled, 0, "Administrative toggle for machine check support"); +static int amd10h_L1TP = 1; +TUNABLE_INT("hw.mca.amd10h_L1TP", &amd10h_L1TP); +SYSCTL_INT(_hw_mca, OID_AUTO, amd10h_L1TP, CTLFLAG_RDTUN, &amd10h_L1TP, 0, + "Administrative toggle for logging of level one TLB parity (L1TP) errors"); + +int workaround_erratum383; +SYSCTL_INT(_hw_mca, OID_AUTO, erratum383, CTLFLAG_RD, &workaround_erratum383, 0, + "Is the workaround for Erratum 383 on AMD Family 10h processors enabled?"); + static STAILQ_HEAD(, mca_internal) mca_records; static struct callout mca_timer; static int mca_ticks = 3600; /* Check hourly by default. */ @@ -527,7 +536,7 @@ void mca_init(void) { uint64_t mcg_cap; - uint64_t ctl; + uint64_t ctl, mask; int skip; int i; @@ -535,6 +544,15 @@ mca_init(void) if (!mca_enabled || !(cpu_feature & CPUID_MCE)) return; + /* + * On AMD Family 10h processors, unless logging of level one TLB + * parity (L1TP) errors is disabled, enable the recommended workaround + * for Erratum 383. + */ + if (cpu_vendor_id == CPU_VENDOR_AMD && + CPUID_TO_FAMILY(cpu_id) == 0x10 && amd10h_L1TP) + workaround_erratum383 = 1; + if (cpu_feature & CPUID_MCA) { if (PCPU_GET(cpuid) == 0) mca_setup(); @@ -545,6 +563,19 @@ mca_init(void) /* Enable MCA features. */ wrmsr(MSR_MCG_CTL, MCG_CTL_ENABLE); + /* + * Disable logging of level one TLB parity (L1TP) errors by + * the data cache as an alternative workaround for AMD Family + * 10h Erratum 383. Unlike the recommended workaround, there + * is no performance penalty to this workaround. However, + * L1TP errors will go unreported. + */ + if (cpu_vendor_id == CPU_VENDOR_AMD && + CPUID_TO_FAMILY(cpu_id) == 0x10 && !amd10h_L1TP) { + mask = rdmsr(MSR_MC0_CTL_MASK); + if ((mask & (1UL << 5)) == 0) + wrmsr(MSR_MC0_CTL_MASK, mask | (1UL << 5)); + } for (i = 0; i < (mcg_cap & MCG_CAP_COUNT); i++) { /* By default enable logging of all errors. */ ctl = 0xffffffffffffffffUL; Modified: stable/8/sys/i386/i386/pmap.c ============================================================================== --- stable/8/sys/i386/i386/pmap.c Mon Apr 5 14:15:51 2010 (r206182) +++ stable/8/sys/i386/i386/pmap.c Mon Apr 5 16:11:42 2010 (r206183) @@ -5,7 +5,7 @@ * All rights reserved. * Copyright (c) 1994 David Greenman * All rights reserved. - * Copyright (c) 2005-2008 Alan L. Cox + * Copyright (c) 2005-2010 Alan L. Cox * All rights reserved. * * This code is derived from software contributed to Berkeley by @@ -293,6 +293,7 @@ static void pmap_insert_pt_page(pmap_t p static void pmap_fill_ptp(pt_entry_t *firstpte, pt_entry_t newpte); static boolean_t pmap_is_modified_pvh(struct md_page *pvh); static void pmap_kenter_attr(vm_offset_t va, vm_paddr_t pa, int mode); +static void pmap_kenter_pde(vm_offset_t va, pd_entry_t newpde); static vm_page_t pmap_lookup_pt_page(pmap_t pmap, vm_offset_t va); static void pmap_pde_attr(pd_entry_t *pde, int cache_bits); static void pmap_promote_pde(pmap_t pmap, pd_entry_t *pde, vm_offset_t va); @@ -311,6 +312,9 @@ static void pmap_remove_entry(struct pma static void pmap_insert_entry(pmap_t pmap, vm_offset_t va, vm_page_t m); static boolean_t pmap_try_insert_pv_entry(pmap_t pmap, vm_offset_t va, vm_page_t m); +static void pmap_update_pde(pmap_t pmap, vm_offset_t va, pd_entry_t *pde, + pd_entry_t newpde); +static void pmap_update_pde_invalidate(vm_offset_t va, pd_entry_t newpde); static vm_page_t pmap_allocpte(pmap_t pmap, vm_offset_t va, int flags); @@ -395,6 +399,13 @@ pmap_bootstrap(vm_paddr_t firstaddr) kernel_pmap->pm_active = -1; /* don't allow deactivation */ TAILQ_INIT(&kernel_pmap->pm_pvchunk); LIST_INIT(&allpmaps); + + /* + * Request a spin mutex so that changes to allpmaps cannot be + * preempted by smp_rendezvous_cpus(). Otherwise, + * pmap_update_pde_kernel() could access allpmaps while it is + * being changed. + */ mtx_init(&allpmaps_lock, "allpmaps", NULL, MTX_SPIN); mtx_lock_spin(&allpmaps_lock); LIST_INSERT_HEAD(&allpmaps, kernel_pmap, pm_list); @@ -678,19 +689,21 @@ pmap_init(void) pv_entry_high_water = 9 * (pv_entry_max / 10); /* - * Disable large page mappings by default if the kernel is running in - * a virtual machine on an AMD Family 10h processor. This is a work- - * around for Erratum 383. + * If the kernel is running in a virtual machine on an AMD Family 10h + * processor, then it must assume that MCA is enabled by the virtual + * machine monitor. */ if (vm_guest == VM_GUEST_VM && cpu_vendor_id == CPU_VENDOR_AMD && CPUID_TO_FAMILY(cpu_id) == 0x10) - pg_ps_enabled = 0; + workaround_erratum383 = 1; /* - * Are large page mappings enabled? + * Are large page mappings supported and enabled? */ TUNABLE_INT_FETCH("vm.pmap.pg_ps_enabled", &pg_ps_enabled); - if (pg_ps_enabled) { + if (pseflag == 0) + pg_ps_enabled = 0; + else if (pg_ps_enabled) { KASSERT(MAXPAGESIZES > 1 && pagesizes[1] == 0, ("pmap_init: can't assign to pagesizes[1]")); pagesizes[1] = NBPDR; @@ -836,6 +849,69 @@ pmap_cache_bits(int mode, boolean_t is_p cache_bits |= PG_NC_PWT; return (cache_bits); } + +/* + * The caller is responsible for maintaining TLB consistency. + */ +static void +pmap_kenter_pde(vm_offset_t va, pd_entry_t newpde) +{ + pd_entry_t *pde; + pmap_t pmap; + boolean_t PTD_updated; + + PTD_updated = FALSE; + mtx_lock_spin(&allpmaps_lock); + LIST_FOREACH(pmap, &allpmaps, pm_list) { + if ((pmap->pm_pdir[PTDPTDI] & PG_FRAME) == (PTDpde[0] & + PG_FRAME)) + PTD_updated = TRUE; + pde = pmap_pde(pmap, va); + pde_store(pde, newpde); + } + mtx_unlock_spin(&allpmaps_lock); + KASSERT(PTD_updated, + ("pmap_kenter_pde: current page table is not in allpmaps")); +} + +/* + * After changing the page size for the specified virtual address in the page + * table, flush the corresponding entries from the processor's TLB. Only the + * calling processor's TLB is affected. + * + * The calling thread must be pinned to a processor. + */ +static void +pmap_update_pde_invalidate(vm_offset_t va, pd_entry_t newpde) +{ + u_long cr4; + + if ((newpde & PG_PS) == 0) + /* Demotion: flush a specific 2MB page mapping. */ + invlpg(va); + else if ((newpde & PG_G) == 0) + /* + * Promotion: flush every 4KB page mapping from the TLB + * because there are too many to flush individually. + */ + invltlb(); + else { + /* + * Promotion: flush every 4KB page mapping from the TLB, + * including any global (PG_G) mappings. + */ + cr4 = rcr4(); + load_cr4(cr4 & ~CR4_PGE); + /* + * Although preemption at this point could be detrimental to + * performance, it would not lead to an error. PG_G is simply + * ignored if CR4.PGE is clear. Moreover, in case this block + * is re-entered, the load_cr4() either above or below will + * modify CR4.PGE flushing the TLB. + */ + load_cr4(cr4 | CR4_PGE); + } +} #ifdef SMP /* * For SMP, these functions have to use the IPI mechanism for coherence. @@ -932,6 +1008,92 @@ pmap_invalidate_cache(void) smp_cache_flush(); sched_unpin(); } + +struct pde_action { + cpumask_t store; /* processor that updates the PDE */ + cpumask_t invalidate; /* processors that invalidate their TLB */ + vm_offset_t va; + pd_entry_t *pde; + pd_entry_t newpde; +}; + +static void +pmap_update_pde_kernel(void *arg) +{ + struct pde_action *act = arg; + pd_entry_t *pde; + pmap_t pmap; + + if (act->store == PCPU_GET(cpumask)) + /* + * Elsewhere, this operation requires allpmaps_lock for + * synchronization. Here, it does not because it is being + * performed in the context of an all_cpus rendezvous. + */ + LIST_FOREACH(pmap, &allpmaps, pm_list) { + pde = pmap_pde(pmap, act->va); + pde_store(pde, act->newpde); + } +} + +static void +pmap_update_pde_user(void *arg) +{ + struct pde_action *act = arg; + + if (act->store == PCPU_GET(cpumask)) + pde_store(act->pde, act->newpde); +} + +static void +pmap_update_pde_teardown(void *arg) +{ + struct pde_action *act = arg; + + if ((act->invalidate & PCPU_GET(cpumask)) != 0) + pmap_update_pde_invalidate(act->va, act->newpde); +} + +/* + * Change the page size for the specified virtual address in a way that + * prevents any possibility of the TLB ever having two entries that map the + * same virtual address using different page sizes. This is the recommended + * workaround for Erratum 383 on AMD Family 10h processors. It prevents a + * machine check exception for a TLB state that is improperly diagnosed as a + * hardware error. + */ +static void +pmap_update_pde(pmap_t pmap, vm_offset_t va, pd_entry_t *pde, pd_entry_t newpde) +{ + struct pde_action act; + cpumask_t active, cpumask; + + sched_pin(); + cpumask = PCPU_GET(cpumask); + if (pmap == kernel_pmap) + active = all_cpus; + else + active = pmap->pm_active; + if ((active & PCPU_GET(other_cpus)) != 0) { + act.store = cpumask; + act.invalidate = active; + act.va = va; + act.pde = pde; + act.newpde = newpde; + smp_rendezvous_cpus(cpumask | active, + smp_no_rendevous_barrier, pmap == kernel_pmap ? + pmap_update_pde_kernel : pmap_update_pde_user, + pmap_update_pde_teardown, &act); + } else { + if (pmap == kernel_pmap) + pmap_kenter_pde(va, newpde); + else + pde_store(pde, newpde); + if ((active & cpumask) != 0) + pmap_update_pde_invalidate(va, newpde); + } + sched_unpin(); +} #else /* !SMP */ /* * Normal, non-SMP, 486+ invalidation functions. @@ -969,6 +1131,18 @@ pmap_invalidate_cache(void) wbinvd(); } + +static void +pmap_update_pde(pmap_t pmap, vm_offset_t va, pd_entry_t *pde, pd_entry_t newpde) +{ + + if (pmap == kernel_pmap) + pmap_kenter_pde(va, newpde); + else + pde_store(pde, newpde); + if (pmap == kernel_pmap || pmap->pm_active) + pmap_update_pde_invalidate(va, newpde); +} #endif /* !SMP */ void @@ -1842,12 +2016,9 @@ SYSCTL_PROC(_vm, OID_AUTO, kvm_free, CTL void pmap_growkernel(vm_offset_t addr) { - struct pmap *pmap; vm_paddr_t ptppaddr; vm_page_t nkpg; pd_entry_t newpdir; - pt_entry_t *pde; - boolean_t updated_PTD; mtx_assert(&kernel_map->system_mtx, MA_OWNED); if (kernel_vm_end == 0) { @@ -1889,18 +2060,7 @@ pmap_growkernel(vm_offset_t addr) newpdir = (pd_entry_t) (ptppaddr | PG_V | PG_RW | PG_A | PG_M); pdir_pde(KPTD, kernel_vm_end) = pgeflag | newpdir; - updated_PTD = FALSE; - mtx_lock_spin(&allpmaps_lock); - LIST_FOREACH(pmap, &allpmaps, pm_list) { - if ((pmap->pm_pdir[PTDPTDI] & PG_FRAME) == (PTDpde[0] & - PG_FRAME)) - updated_PTD = TRUE; - pde = pmap_pde(pmap, kernel_vm_end); - pde_store(pde, newpdir); - } - mtx_unlock_spin(&allpmaps_lock); - KASSERT(updated_PTD, - ("pmap_growkernel: current page table is not in allpmaps")); + pmap_kenter_pde(kernel_vm_end, newpdir); kernel_vm_end = (kernel_vm_end + PAGE_SIZE * NPTEPG) & ~(PAGE_SIZE * NPTEPG - 1); if (kernel_vm_end - 1 >= kernel_map->max_offset) { kernel_vm_end = kernel_map->max_offset; @@ -2344,7 +2504,6 @@ static boolean_t pmap_demote_pde(pmap_t pmap, pd_entry_t *pde, vm_offset_t va) { pd_entry_t newpde, oldpde; - pmap_t allpmaps_entry; pt_entry_t *firstpte, newpte; vm_paddr_t mptepa; vm_page_t free, mpte; @@ -2450,25 +2609,11 @@ pmap_demote_pde(pmap_t pmap, pd_entry_t * processor changing the setting of PG_A and/or PG_M between * the read above and the store below. */ - if (pmap == kernel_pmap) { - /* - * A harmless race exists between this loop and the bcopy() - * in pmap_pinit() that initializes the kernel segment of - * the new page table directory. Specifically, that bcopy() - * may copy the new PDE from the PTD to the new page table - * before this loop updates that new page table. - */ - mtx_lock_spin(&allpmaps_lock); - LIST_FOREACH(allpmaps_entry, &allpmaps, pm_list) { - pde = pmap_pde(allpmaps_entry, va); - KASSERT(*pde == newpde || (*pde & PG_PTE_PROMOTE) == - (oldpde & PG_PTE_PROMOTE), - ("pmap_demote_pde: pde was %#jx, expected %#jx", - (uintmax_t)*pde, (uintmax_t)oldpde)); - pde_store(pde, newpde); - } - mtx_unlock_spin(&allpmaps_lock); - } else + if (workaround_erratum383) + pmap_update_pde(pmap, va, pde, newpde); + else if (pmap == kernel_pmap) + pmap_kenter_pde(va, newpde); + else pde_store(pde, newpde); if (firstpte == PADDR2) mtx_unlock(&PMAP2mutex); @@ -2987,7 +3132,6 @@ static void pmap_promote_pde(pmap_t pmap, pd_entry_t *pde, vm_offset_t va) { pd_entry_t newpde; - pmap_t allpmaps_entry; pt_entry_t *firstpte, oldpte, pa, *pte; vm_offset_t oldpteva; vm_page_t mpte; @@ -3091,14 +3235,11 @@ setpte: /* * Map the superpage. */ - if (pmap == kernel_pmap) { - mtx_lock_spin(&allpmaps_lock); - LIST_FOREACH(allpmaps_entry, &allpmaps, pm_list) { - pde = pmap_pde(allpmaps_entry, va); - pde_store(pde, PG_PS | newpde); - } - mtx_unlock_spin(&allpmaps_lock); - } else + if (workaround_erratum383) + pmap_update_pde(pmap, va, pde, PG_PS | newpde); + else if (pmap == kernel_pmap) + pmap_kenter_pde(va, PG_PS | newpde); + else pde_store(pde, PG_PS | newpde); pmap_pde_promotions++; Modified: stable/8/sys/i386/include/md_var.h ============================================================================== --- stable/8/sys/i386/include/md_var.h Mon Apr 5 14:15:51 2010 (r206182) +++ stable/8/sys/i386/include/md_var.h Mon Apr 5 16:11:42 2010 (r206183) @@ -73,6 +73,7 @@ extern int szosigcode; #endif extern uint32_t *vm_page_dump; extern int vm_page_dump_size; +extern int workaround_erratum383; typedef void alias_for_inthand_t(u_int cs, u_int ef, u_int esp, u_int ss); struct thread; Modified: stable/8/sys/i386/include/specialreg.h ============================================================================== --- stable/8/sys/i386/include/specialreg.h Mon Apr 5 14:15:51 2010 (r206182) +++ stable/8/sys/i386/include/specialreg.h Mon Apr 5 16:11:42 2010 (r206183) @@ -551,6 +551,7 @@ /* AMD64 MSR's */ #define MSR_EFER 0xc0000080 /* extended features */ #define MSR_K8_UCODE_UPDATE 0xc0010020 /* update microcode */ +#define MSR_MC0_CTL_MASK 0xc0010044 /* VIA ACE crypto featureset: for via_feature_rng */ #define VIA_HAS_RNG 1 /* cpu has RNG */ From owner-svn-src-stable-8@FreeBSD.ORG Mon Apr 5 17:32:49 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE4EB1065676; Mon, 5 Apr 2010 17:32:49 +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 DBEB68FC13; Mon, 5 Apr 2010 17:32:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o35HWn1K095645; Mon, 5 Apr 2010 17:32:49 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o35HWnUp095643; Mon, 5 Apr 2010 17:32:49 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201004051732.o35HWnUp095643@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 5 Apr 2010 17:32:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206185 - stable/8/sys/net X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Apr 2010 17:32:50 -0000 Author: jkim Date: Mon Apr 5 17:32:49 2010 New Revision: 206185 URL: http://svn.freebsd.org/changeset/base/206185 Log: MFC: r205858 Check the pointer to JIT binary filter before its de-allocation. Modified: stable/8/sys/net/bpf.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/net/bpf.c ============================================================================== --- stable/8/sys/net/bpf.c Mon Apr 5 17:26:23 2010 (r206184) +++ stable/8/sys/net/bpf.c Mon Apr 5 17:32:49 2010 (r206185) @@ -1865,13 +1865,14 @@ bpf_freed(struct bpf_d *d) * free. */ bpf_free(d); - if (d->bd_rfilter) { + if (d->bd_rfilter != NULL) { free((caddr_t)d->bd_rfilter, M_BPF); #ifdef BPF_JITTER - bpf_destroy_jit_filter(d->bd_bfilter); + if (d->bd_bfilter != NULL) + bpf_destroy_jit_filter(d->bd_bfilter); #endif } - if (d->bd_wfilter) + if (d->bd_wfilter != NULL) free((caddr_t)d->bd_wfilter, M_BPF); mtx_destroy(&d->bd_mtx); } From owner-svn-src-stable-8@FreeBSD.ORG Mon Apr 5 17:37:36 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 140F2106566C; Mon, 5 Apr 2010 17:37:36 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 01E3C8FC14; Mon, 5 Apr 2010 17:37:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o35HbZqJ096752; Mon, 5 Apr 2010 17:37:35 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o35HbZVh096751; Mon, 5 Apr 2010 17:37:35 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201004051737.o35HbZVh096751@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 5 Apr 2010 17:37:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206187 - stable/8/sys/net X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Apr 2010 17:37:36 -0000 Author: jkim Date: Mon Apr 5 17:37:35 2010 New Revision: 206187 URL: http://svn.freebsd.org/changeset/base/206187 Log: MFC: r205095 Fix a style(9) nit. Modified: stable/8/sys/net/bpf.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/net/bpf.c ============================================================================== --- stable/8/sys/net/bpf.c Mon Apr 5 17:33:33 2010 (r206186) +++ stable/8/sys/net/bpf.c Mon Apr 5 17:37:35 2010 (r206187) @@ -1577,8 +1577,7 @@ filt_bpfread(struct knote *kn, long hint kn->kn_data = d->bd_slen; if (d->bd_hbuf) kn->kn_data += d->bd_hlen; - } - else if (d->bd_rtout > 0 && d->bd_state == BPF_IDLE) { + } else if (d->bd_rtout > 0 && d->bd_state == BPF_IDLE) { callout_reset(&d->bd_callout, d->bd_rtout, bpf_timed_out, d); d->bd_state = BPF_WAITING; From owner-svn-src-stable-8@FreeBSD.ORG Mon Apr 5 17:56:41 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 54D291065672; Mon, 5 Apr 2010 17:56:41 +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 2CD968FC1B; Mon, 5 Apr 2010 17:56:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o35HufHw001177; Mon, 5 Apr 2010 17:56:41 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o35HufsX001172; Mon, 5 Apr 2010 17:56:41 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201004051756.o35HufsX001172@svn.freebsd.org> From: Marius Strobl Date: Mon, 5 Apr 2010 17:56:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206188 - in stable/8/sys/sparc64: fhc pci sbus X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Apr 2010 17:56:41 -0000 Author: marius Date: Mon Apr 5 17:56:40 2010 New Revision: 206188 URL: http://svn.freebsd.org/changeset/base/206188 Log: MFC: r206018 - Take advantage of the INTCLR_* macros. - Right-justify the backslashes as per style(9). Modified: stable/8/sys/sparc64/fhc/fhc.c stable/8/sys/sparc64/pci/psycho.c stable/8/sys/sparc64/pci/schizo.c stable/8/sys/sparc64/sbus/sbus.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/sparc64/fhc/fhc.c ============================================================================== --- stable/8/sys/sparc64/fhc/fhc.c Mon Apr 5 17:37:35 2010 (r206187) +++ stable/8/sys/sparc64/fhc/fhc.c Mon Apr 5 17:56:40 2010 (r206188) @@ -208,7 +208,7 @@ fhc_attach(device_t dev) printf("model unknown\n"); for (i = FHC_FANFAIL; i <= FHC_TOD; i++) { - bus_write_4(sc->sc_memres[i], FHC_ICLR, 0x0); + bus_write_4(sc->sc_memres[i], FHC_ICLR, INTCLR_IDLE); (void)bus_read_4(sc->sc_memres[i], FHC_ICLR); } @@ -391,7 +391,7 @@ fhc_intr_clear(void *arg) struct intr_vector *iv = arg; struct fhc_icarg *fica = iv->iv_icarg; - bus_write_4(fica->fica_memres, FHC_ICLR, 0x0); + bus_write_4(fica->fica_memres, FHC_ICLR, INTCLR_IDLE); (void)bus_read_4(fica->fica_memres, FHC_ICLR); } Modified: stable/8/sys/sparc64/pci/psycho.c ============================================================================== --- stable/8/sys/sparc64/pci/psycho.c Mon Apr 5 17:37:35 2010 (r206187) +++ stable/8/sys/sparc64/pci/psycho.c Mon Apr 5 17:56:40 2010 (r206188) @@ -188,13 +188,13 @@ struct psycho_dma_sync { uint8_t pds_func; /* func. of farest PCI dev. */ }; -#define PSYCHO_READ8(sc, off) \ +#define PSYCHO_READ8(sc, off) \ bus_read_8((sc)->sc_mem_res, (off)) -#define PSYCHO_WRITE8(sc, off, v) \ +#define PSYCHO_WRITE8(sc, off, v) \ bus_write_8((sc)->sc_mem_res, (off), (v)) -#define PCICTL_READ8(sc, off) \ +#define PCICTL_READ8(sc, off) \ PSYCHO_READ8((sc), (sc)->sc_pcictl + (off)) -#define PCICTL_WRITE8(sc, off, v) \ +#define PCICTL_WRITE8(sc, off, v) \ PSYCHO_WRITE8((sc), (sc)->sc_pcictl + (off), (v)) /* @@ -523,7 +523,7 @@ psycho_attach(device_t dev) (u_long)intrmap, (u_long)PSYCHO_READ8(sc, intrmap), (u_long)intrclr); PSYCHO_WRITE8(sc, intrmap, INTMAP_VEC(sc->sc_ign, i)); - PSYCHO_WRITE8(sc, intrclr, 0); + PSYCHO_WRITE8(sc, intrclr, INTCLR_IDLE); PSYCHO_WRITE8(sc, intrmap, INTMAP_ENABLE(INTMAP_VEC(sc->sc_ign, i), PCPU_GET(mid))); @@ -1137,7 +1137,7 @@ psycho_intr_clear(void *arg) struct intr_vector *iv = arg; struct psycho_icarg *pica = iv->iv_icarg; - PSYCHO_WRITE8(pica->pica_sc, pica->pica_clr, 0); + PSYCHO_WRITE8(pica->pica_sc, pica->pica_clr, INTCLR_IDLE); } static int Modified: stable/8/sys/sparc64/pci/schizo.c ============================================================================== --- stable/8/sys/sparc64/pci/schizo.c Mon Apr 5 17:37:35 2010 (r206187) +++ stable/8/sys/sparc64/pci/schizo.c Mon Apr 5 17:56:40 2010 (r206188) @@ -189,26 +189,26 @@ struct schizo_dma_sync { #define SCHIZO_PERF_CNT_QLTY 100 -#define SCHIZO_SPC_READ_8(spc, sc, offs) \ +#define SCHIZO_SPC_READ_8(spc, sc, offs) \ bus_read_8((sc)->sc_mem_res[(spc)], (offs)) -#define SCHIZO_SPC_WRITE_8(spc, sc, offs, v) \ +#define SCHIZO_SPC_WRITE_8(spc, sc, offs, v) \ bus_write_8((sc)->sc_mem_res[(spc)], (offs), (v)) -#define SCHIZO_PCI_READ_8(sc, offs) \ +#define SCHIZO_PCI_READ_8(sc, offs) \ SCHIZO_SPC_READ_8(STX_PCI, (sc), (offs)) -#define SCHIZO_PCI_WRITE_8(sc, offs, v) \ +#define SCHIZO_PCI_WRITE_8(sc, offs, v) \ SCHIZO_SPC_WRITE_8(STX_PCI, (sc), (offs), (v)) -#define SCHIZO_CTRL_READ_8(sc, offs) \ +#define SCHIZO_CTRL_READ_8(sc, offs) \ SCHIZO_SPC_READ_8(STX_CTRL, (sc), (offs)) -#define SCHIZO_CTRL_WRITE_8(sc, offs, v) \ +#define SCHIZO_CTRL_WRITE_8(sc, offs, v) \ SCHIZO_SPC_WRITE_8(STX_CTRL, (sc), (offs), (v)) -#define SCHIZO_PCICFG_READ_8(sc, offs) \ +#define SCHIZO_PCICFG_READ_8(sc, offs) \ SCHIZO_SPC_READ_8(STX_PCICFG, (sc), (offs)) -#define SCHIZO_PCICFG_WRITE_8(sc, offs, v) \ +#define SCHIZO_PCICFG_WRITE_8(sc, offs, v) \ SCHIZO_SPC_WRITE_8(STX_PCICFG, (sc), (offs), (v)) -#define SCHIZO_ICON_READ_8(sc, offs) \ +#define SCHIZO_ICON_READ_8(sc, offs) \ SCHIZO_SPC_READ_8(STX_ICON, (sc), (offs)) -#define SCHIZO_ICON_WRITE_8(sc, offs, v) \ +#define SCHIZO_ICON_WRITE_8(sc, offs, v) \ SCHIZO_SPC_WRITE_8(STX_ICON, (sc), (offs), (v)) struct schizo_desc { @@ -1054,7 +1054,7 @@ schizo_dma_sync_stub(void *arg) for (; atomic_cmpset_acq_32(&sc->sc_cdma_state, SCHIZO_CDMA_STATE_DONE, SCHIZO_CDMA_STATE_PENDING) == 0;) ; - SCHIZO_PCI_WRITE_8(sc, sc->sc_cdma_clr, 1); + SCHIZO_PCI_WRITE_8(sc, sc->sc_cdma_clr, INTCLR_RECEIVED); microuptime(&cur); end.tv_sec = 1; end.tv_usec = 0; @@ -1139,7 +1139,7 @@ schizo_intr_clear(void *arg) struct intr_vector *iv = arg; struct schizo_icarg *sica = iv->iv_icarg; - SCHIZO_PCI_WRITE_8(sica->sica_sc, sica->sica_clr, 0); + SCHIZO_PCI_WRITE_8(sica->sica_sc, sica->sica_clr, INTCLR_IDLE); } static int Modified: stable/8/sys/sparc64/sbus/sbus.c ============================================================================== --- stable/8/sys/sparc64/sbus/sbus.c Mon Apr 5 17:37:35 2010 (r206187) +++ stable/8/sys/sparc64/sbus/sbus.c Mon Apr 5 17:56:40 2010 (r206188) @@ -171,9 +171,9 @@ struct sbus_softc { void *sc_pf_ihand; }; -#define SYSIO_READ8(sc, off) \ +#define SYSIO_READ8(sc, off) \ bus_read_8((sc)->sc_sysio_res, (off)) -#define SYSIO_WRITE8(sc, off, v) \ +#define SYSIO_WRITE8(sc, off, v) \ bus_write_8((sc)->sc_sysio_res, (off), (v)) static device_probe_t sbus_probe; @@ -697,7 +697,7 @@ sbus_intr_clear(void *arg) struct intr_vector *iv = arg; struct sbus_icarg *sica = iv->iv_icarg; - SYSIO_WRITE8(sica->sica_sc, sica->sica_clr, 0); + SYSIO_WRITE8(sica->sica_sc, sica->sica_clr, INTCLR_IDLE); } static int From owner-svn-src-stable-8@FreeBSD.ORG Mon Apr 5 17:58:48 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3FFD0106566B; Mon, 5 Apr 2010 17:58: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 1328E8FC16; Mon, 5 Apr 2010 17:58:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o35Hwls3001775; Mon, 5 Apr 2010 17:58:47 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o35HwlrU001773; Mon, 5 Apr 2010 17:58:47 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201004051758.o35HwlrU001773@svn.freebsd.org> From: Marius Strobl Date: Mon, 5 Apr 2010 17:58:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206191 - stable/8/sys/sparc64/pci X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Apr 2010 17:58:48 -0000 Author: marius Date: Mon Apr 5 17:58:47 2010 New Revision: 206191 URL: http://svn.freebsd.org/changeset/base/206191 Log: MFC: r206019 Don't re-implement device_get_nameunit(9). Modified: stable/8/sys/sparc64/pci/apb.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/sparc64/pci/apb.c ============================================================================== --- stable/8/sys/sparc64/pci/apb.c Mon Apr 5 17:58:47 2010 (r206190) +++ stable/8/sys/sparc64/pci/apb.c Mon Apr 5 17:58:47 2010 (r206191) @@ -223,8 +223,7 @@ apb_alloc_resource(device_t dev, device_ */ if (start == 0 && end == ~0) { device_printf(dev, "can't decode default resource id %d for " - "%s%d, bypassing\n", *rid, device_get_name(child), - device_get_unit(child)); + "%s, bypassing\n", *rid, device_get_nameunit(child)); goto passup; } @@ -236,31 +235,28 @@ apb_alloc_resource(device_t dev, device_ switch (type) { case SYS_RES_IOPORT: if (!apb_checkrange(sc->sc_iomap, APB_IO_SCALE, start, end)) { - device_printf(dev, "device %s%d requested unsupported " - "I/O range 0x%lx-0x%lx\n", device_get_name(child), - device_get_unit(child), start, end); + device_printf(dev, "device %s requested unsupported " + "I/O range 0x%lx-0x%lx\n", + device_get_nameunit(child), start, end); return (NULL); } if (bootverbose) device_printf(sc->sc_bsc.ops_pcib_sc.dev, "device " - "%s%d requested decoded I/O range 0x%lx-0x%lx\n", - device_get_name(child), device_get_unit(child), - start, end); + "%s requested decoded I/O range 0x%lx-0x%lx\n", + device_get_nameunit(child), start, end); break; case SYS_RES_MEMORY: if (!apb_checkrange(sc->sc_memmap, APB_MEM_SCALE, start, end)) { - device_printf(dev, "device %s%d requested unsupported " + device_printf(dev, "device %s requested unsupported " "memory range 0x%lx-0x%lx\n", - device_get_name(child), device_get_unit(child), - start, end); + device_get_nameunit(child), start, end); return (NULL); } if (bootverbose) device_printf(sc->sc_bsc.ops_pcib_sc.dev, "device " - "%s%d requested decoded memory range 0x%lx-0x%lx\n", - device_get_name(child), device_get_unit(child), - start, end); + "%s requested decoded memory range 0x%lx-0x%lx\n", + device_get_nameunit(child), start, end); break; default: From owner-svn-src-stable-8@FreeBSD.ORG Mon Apr 5 18:04:01 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CE0431065672; Mon, 5 Apr 2010 18:04: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 AFDBF8FC13; Mon, 5 Apr 2010 18:04:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o35I41qj003035; Mon, 5 Apr 2010 18:04:01 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o35I413M003032; Mon, 5 Apr 2010 18:04:01 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201004051804.o35I413M003032@svn.freebsd.org> From: Marius Strobl Date: Mon, 5 Apr 2010 18:04:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206192 - stable/8/sys/sparc64/pci X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Apr 2010 18:04:02 -0000 Author: marius Date: Mon Apr 5 18:04:01 2010 New Revision: 206192 URL: http://svn.freebsd.org/changeset/base/206192 Log: MFC: r206020 Use device_get_nameunit(9) rather than device_get_name(9) so one can identify the reporting bridge in machines with multiple PCI domains. Modified: stable/8/sys/sparc64/pci/psycho.c stable/8/sys/sparc64/pci/schizo.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/sparc64/pci/psycho.c ============================================================================== --- stable/8/sys/sparc64/pci/psycho.c Mon Apr 5 17:58:47 2010 (r206191) +++ stable/8/sys/sparc64/pci/psycho.c Mon Apr 5 18:04:01 2010 (r206192) @@ -808,7 +808,7 @@ psycho_ue(void *arg) if ((afsr & UEAFSR_P_DTE) != 0) iommu_decode_fault(sc->sc_is, afar); panic("%s: uncorrectable DMA error AFAR %#lx AFSR %#lx", - device_get_name(sc->sc_dev), (u_long)afar, (u_long)afsr); + device_get_nameunit(sc->sc_dev), (u_long)afar, (u_long)afsr); return (FILTER_HANDLED); } @@ -838,7 +838,7 @@ psycho_pci_bus(void *arg) afar = PCICTL_READ8(sc, PCR_AFA); afsr = PCICTL_READ8(sc, PCR_AFS); panic("%s: PCI bus %c error AFAR %#lx AFSR %#lx", - device_get_name(sc->sc_dev), 'A' + sc->sc_half, (u_long)afar, + device_get_nameunit(sc->sc_dev), 'A' + sc->sc_half, (u_long)afar, (u_long)afsr); return (FILTER_HANDLED); } Modified: stable/8/sys/sparc64/pci/schizo.c ============================================================================== --- stable/8/sys/sparc64/pci/schizo.c Mon Apr 5 17:58:47 2010 (r206191) +++ stable/8/sys/sparc64/pci/schizo.c Mon Apr 5 18:04:01 2010 (r206192) @@ -803,7 +803,7 @@ schizo_pci_bus(void *arg) } panic("%s: PCI bus %c error AFAR %#llx AFSR %#llx PCI CSR %#llx " - "IOMMU %#llx STATUS %#llx", device_get_name(sc->sc_dev), + "IOMMU %#llx STATUS %#llx", device_get_nameunit(sc->sc_dev), 'A' + sc->sc_half, (unsigned long long)afar, (unsigned long long)afsr, (unsigned long long)csr, (unsigned long long)iommu, (unsigned long long)status); @@ -838,7 +838,7 @@ schizo_ue(void *arg) break; mtx_unlock_spin(sc->sc_mtx); panic("%s: uncorrectable DMA error AFAR %#llx AFSR %#llx", - device_get_name(sc->sc_dev), (unsigned long long)afar, + device_get_nameunit(sc->sc_dev), (unsigned long long)afar, (unsigned long long)afsr); return (FILTER_HANDLED); } @@ -872,7 +872,7 @@ schizo_host_bus(void *arg) uint64_t errlog; errlog = SCHIZO_CTRL_READ_8(sc, STX_CTRL_BUS_ERRLOG); - panic("%s: %s error %#llx", device_get_name(sc->sc_dev), + panic("%s: %s error %#llx", device_get_nameunit(sc->sc_dev), sc->sc_mode == SCHIZO_MODE_TOM ? "JBus" : "Safari", (unsigned long long)errlog); return (FILTER_HANDLED); From owner-svn-src-stable-8@FreeBSD.ORG Mon Apr 5 18:22:43 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 52A0D106564A; Mon, 5 Apr 2010 18:22:43 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3E4FA8FC0A; Mon, 5 Apr 2010 18:22:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o35IMhfa007337; Mon, 5 Apr 2010 18:22:43 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o35IMhQb007332; Mon, 5 Apr 2010 18:22:43 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201004051822.o35IMhQb007332@svn.freebsd.org> From: Matt Jacob Date: Mon, 5 Apr 2010 18:22:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206196 - stable/8/sys/dev/isp X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Apr 2010 18:22:43 -0000 Author: mjacob Date: Mon Apr 5 18:22:42 2010 New Revision: 206196 URL: http://svn.freebsd.org/changeset/base/206196 Log: This is an MFC of 205698 Clean up some printing stuff so that we can have a bit finer control on debug output. Add a new platform function requirement to allow for printing based upon the ITL nexus instead of the isp unit plus channel, target and lun. This allows some printouts and error messages from the core code to appear in the same format as the platform's subsystem (in FreeBSD's case, CAM path). Modified: stable/8/sys/dev/isp/isp.c stable/8/sys/dev/isp/isp_freebsd.c stable/8/sys/dev/isp/isp_freebsd.h stable/8/sys/dev/isp/ispvar.h Modified: stable/8/sys/dev/isp/isp.c ============================================================================== --- stable/8/sys/dev/isp/isp.c Mon Apr 5 18:05:09 2010 (r206195) +++ stable/8/sys/dev/isp/isp.c Mon Apr 5 18:22:42 2010 (r206196) @@ -74,14 +74,9 @@ __FBSDID("$FreeBSD$"); */ static const char fconf[] = "Chan %d PortDB[%d] changed:\n current =(0x%x@0x%06x 0x%08x%08x 0x%08x%08x)\n database=(0x%x@0x%06x 0x%08x%08x 0x%08x%08x)"; static const char notresp[] = "Not RESPONSE in RESPONSE Queue (type 0x%x) @ idx %d (next %d) nlooked %d"; -static const char xact1[] = "HBA attempted queued transaction with disconnect not set for %d.%d.%d"; -static const char xact2[] = "HBA attempted queued transaction to target routine %d on target %d bus %d"; -static const char xact3[] = "HBA attempted queued cmd for %d.%d.%d when queueing disabled"; -static const char pskip[] = "SCSI phase skipped for target %d.%d.%d"; static const char topology[] = "Chan %d WWPN 0x%08x%08x PortID 0x%06x N-Port Handle %d, Connection '%s'"; -static const char finmsg[] = "%d.%d.%d: FIN dl%d resid %ld STS 0x%x SKEY %c XS_ERR=0x%x"; static const char sc4[] = "NVRAM"; -static const char bun[] = "bad underrun for %d.%d (count %d, resid %d, status %s)"; +static const char bun[] = "bad underrun (count %d, resid %d, status %s)"; static const char lipd[] = "Chan %d LIP destroyed %d active commands"; static const char sacq[] = "unable to acquire scratch area"; @@ -107,6 +102,7 @@ static const uint8_t alpa_map[] = { /* * Local function prototypes. */ +static void isp_prt_endcmd(ispsoftc_t *, XS_T *); static int isp_parse_async(ispsoftc_t *, uint16_t); static int isp_parse_async_fc(ispsoftc_t *, uint16_t); static int isp_handle_other_response(ispsoftc_t *, int, isphdr_t *, uint32_t *); @@ -1431,10 +1427,8 @@ isp_scsi_channel_init(ispsoftc_t *isp, i (sdp->isp_devparam[tgt].goal_offset << 8) | (sdp->isp_devparam[tgt].goal_period); } - isp_prt(isp, ISP_LOGDEBUG0, - "Initial Settings bus%d tgt%d flags 0x%x off 0x%x per 0x%x", - chan, tgt, mbs.param[2], mbs.param[3] >> 8, - mbs.param[3] & 0xff); + isp_prt(isp, ISP_LOGDEBUG0, "Initial Settings bus%d tgt%d flags 0x%x off 0x%x per 0x%x", + chan, tgt, mbs.param[2], mbs.param[3] >> 8, mbs.param[3] & 0xff); isp_mboxcmd(isp, &mbs); if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { sdf = DPARM_SAFE_DFLT; @@ -1705,8 +1699,7 @@ isp_fibre_init(ispsoftc_t *isp) isp_prt(isp, ISP_LOGERR, sacq); return; } - isp_prt(isp, ISP_LOGDEBUG0, - "isp_fibre_init: fwopt 0x%x xfwopt 0x%x zfwopt 0x%x", + isp_prt(isp, ISP_LOGDEBUG0, "isp_fibre_init: fwopt 0x%x xfwopt 0x%x zfwopt 0x%x", icbp->icb_fwoptions, icbp->icb_xfwoptions, icbp->icb_zfwoptions); isp_put_icb(isp, icbp, (isp_icb_t *)fcp->isp_scratch); @@ -4432,7 +4425,7 @@ isp_start(XS_T *xs) */ return (dmaresult); } - isp_prt(isp, ISP_LOGDEBUG0, "START cmd for %d.%d.%d cmd 0x%x datalen %ld", XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs), XS_CDBP(xs)[0], (long) XS_XFRLEN(xs)); + isp_xs_prt(isp, xs, ISP_LOGDEBUG0, "START cmd cdb[0]=0x%x datalen %ld", XS_CDBP(xs)[0], (long) XS_XFRLEN(xs)); isp->isp_nactive++; return (CMD_QUEUED); } @@ -5245,7 +5238,7 @@ again: } else { ptr = rnames[resp[FCP_RSPNS_CODE_OFFSET]]; } - isp_prt(isp, ISP_LOGWARN, "%d.%d.%d FCP RESPONSE, LENGTH %u: %s CDB0=0x%02x", XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs), rlen, ptr, XS_CDBP(xs)[0] & 0xff); + isp_xs_prt(isp, xs, ISP_LOGWARN, "FCP RESPONSE, LENGTH %u: %s CDB0=0x%02x", rlen, ptr, XS_CDBP(xs)[0] & 0xff); if (resp[FCP_RSPNS_CODE_OFFSET] != 0) { XS_SETERR(xs, HBA_BOTCH); } @@ -5322,25 +5315,9 @@ again: isp_destroy_handle(isp, sp->req_handle); if (((isp->isp_dblev & (ISP_LOGDEBUG1|ISP_LOGDEBUG2|ISP_LOGDEBUG3))) || - ((isp->isp_dblev & ISP_LOGDEBUG0) && ((!XS_NOERR(xs)) || - (*XS_STSP(xs) != SCSI_GOOD)))) { - char skey; - if (req_state_flags & RQSF_GOT_SENSE) { - skey = XS_SNSKEY(xs) & 0xf; - if (skey < 10) - skey += '0'; - else - skey += 'a' - 10; - } else if (*XS_STSP(xs) == SCSI_CHECK) { - skey = '?'; - } else { - skey = '.'; - } - isp_prt(isp, ISP_LOGALL, finmsg, XS_CHANNEL(xs), - XS_TGT(xs), XS_LUN(xs), XS_XFRLEN(xs), (long) XS_GET_RESID(xs), - *XS_STSP(xs), skey, XS_ERR(xs)); + ((isp->isp_dblev & (ISP_LOGDEBUG0|ISP_LOG_CWARN) && ((!XS_NOERR(xs)) || (*XS_STSP(xs) != SCSI_GOOD))))) { + isp_prt_endcmd(isp, xs); } - if (isp->isp_nactive > 0) { isp->isp_nactive--; } @@ -5390,6 +5367,25 @@ out: * Support routines. */ +static void +isp_prt_endcmd(ispsoftc_t *isp, XS_T *xs) +{ + char cdbstr[16 * 5 + 1]; + int i, lim; + + lim = XS_CDBLEN(xs) > 16? 16 : XS_CDBLEN(xs); + ISP_SNPRINTF(cdbstr, sizeof (cdbstr), "0x%02x ", XS_CDBP(xs)[0]); + for (i = 1; i < lim; i++) { + ISP_SNPRINTF(cdbstr, sizeof (cdbstr), "%s0x%02x ", cdbstr, XS_CDBP(xs)[i]); + } + if (XS_SENSE_VALID(xs)) { + isp_xs_prt(isp, xs, ISP_LOGALL, "FIN dl%d resid %ld CDB=%s KEY/ASC/ASCQ=0x%02x/0x%02x/0x%02x", + XS_XFRLEN(xs), (long) XS_GET_RESID(xs), cdbstr, XS_SNSKEY(xs), XS_SNSASC(xs), XS_SNSASCQ(xs)); + } else { + isp_xs_prt(isp, xs, ISP_LOGALL, "FIN dl%d resid %ld CDB=%s STS 0x%x XS_ERR=0x%x", XS_XFRLEN(xs), (long) XS_GET_RESID(xs), cdbstr, *XS_STSP(xs), XS_ERR(xs)); + } +} + /* * Parse an ASYNC mailbox complete * @@ -5934,8 +5930,7 @@ isp_parse_async_fc(ispsoftc_t *isp, uint */ static int -isp_handle_other_response(ispsoftc_t *isp, int type, - isphdr_t *hp, uint32_t *optrp) +isp_handle_other_response(ispsoftc_t *isp, int type, isphdr_t *hp, uint32_t *optrp) { switch (type) { case RQSTYPE_STATUS_CONT: @@ -6007,24 +6002,18 @@ isp_parse_status(ispsoftc_t *isp, ispsta case RQCS_INCOMPLETE: if ((sp->req_state_flags & RQSF_GOT_TARGET) == 0) { - isp_prt(isp, ISP_LOGDEBUG1, - "Selection Timeout for %d.%d.%d", - XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs)); + isp_xs_prt(isp, xs, ISP_LOGDEBUG1, "Selection Timeout"); if (XS_NOERR(xs)) { XS_SETERR(xs, HBA_SELTIMEOUT); *rp = XS_XFRLEN(xs); } return; } - isp_prt(isp, ISP_LOGERR, - "command incomplete for %d.%d.%d, state 0x%x", - XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs), - sp->req_state_flags); + isp_xs_prt(isp, xs, ISP_LOGERR, "Command Incomplete, state 0x%x", sp->req_state_flags); break; case RQCS_DMA_ERROR: - isp_prt(isp, ISP_LOGERR, "DMA error for command on %d.%d.%d", - XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs)); + isp_xs_prt(isp, xs, ISP_LOGERR, "DMA Error"); *rp = XS_XFRLEN(xs); break; @@ -6078,18 +6067,14 @@ isp_parse_status(ispsoftc_t *isp, ispsta if (sp->req_status_flags & RQSTF_NEGOTIATION) { ISP_SNPRINTF(buf, sizeof (buf), "%s Negotiation", buf); } - isp_prt(isp, ISP_LOGERR, "%s", buf); - isp_prt(isp, ISP_LOGERR, "transport error for %d.%d.%d:\n%s", - XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs), buf); + isp_xs_prt(isp, xs, ISP_LOGERR, "Transport Error: %s", buf); *rp = XS_XFRLEN(xs); break; } case RQCS_RESET_OCCURRED: { int chan; - isp_prt(isp, ISP_LOGWARN, - "bus reset destroyed command for %d.%d.%d", - XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs)); + isp_xs_prt(isp, xs, ISP_LOGWARN, "Bus Reset destroyed command"); for (chan = 0; chan < isp->isp_nchan; chan++) { FCPARAM(isp, chan)->sendmarker = 1; } @@ -6100,8 +6085,7 @@ isp_parse_status(ispsoftc_t *isp, ispsta return; } case RQCS_ABORTED: - isp_prt(isp, ISP_LOGERR, "command aborted for %d.%d.%d", - XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs)); + isp_xs_prt(isp, xs, ISP_LOGERR, "Command Aborted"); ISP_SET_SENDMARKER(isp, XS_CHANNEL(xs), 1); if (XS_NOERR(xs)) { XS_SETERR(xs, HBA_ABORTED); @@ -6109,8 +6093,7 @@ isp_parse_status(ispsoftc_t *isp, ispsta return; case RQCS_TIMEOUT: - isp_prt(isp, ISP_LOGWARN, "command timed out for %d.%d.%d", - XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs)); + isp_xs_prt(isp, xs, ISP_LOGWARN, "Command timed out"); /* * XXX: Check to see if we logged out of the device. */ @@ -6121,83 +6104,62 @@ isp_parse_status(ispsoftc_t *isp, ispsta case RQCS_DATA_OVERRUN: XS_SET_RESID(xs, sp->req_resid); - isp_prt(isp, ISP_LOGERR, "data overrun (%ld) for command on %d.%d.%d", - (long) XS_GET_RESID(xs), XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs)); + isp_xs_prt(isp, xs, ISP_LOGERR, "data overrun (%ld)", (long) XS_GET_RESID(xs)); if (XS_NOERR(xs)) { XS_SETERR(xs, HBA_DATAOVR); } return; case RQCS_COMMAND_OVERRUN: - isp_prt(isp, ISP_LOGERR, - "command overrun for command on %d.%d.%d", - XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs)); + isp_xs_prt(isp, xs, ISP_LOGERR, "command overrun"); break; case RQCS_STATUS_OVERRUN: - isp_prt(isp, ISP_LOGERR, - "status overrun for command on %d.%d.%d", - XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs)); + isp_xs_prt(isp, xs, ISP_LOGERR, "status overrun"); break; case RQCS_BAD_MESSAGE: - isp_prt(isp, ISP_LOGERR, - "msg not COMMAND COMPLETE after status %d.%d.%d", - XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs)); + isp_xs_prt(isp, xs, ISP_LOGERR, "msg not COMMAND COMPLETE after status"); break; case RQCS_NO_MESSAGE_OUT: - isp_prt(isp, ISP_LOGERR, - "No MESSAGE OUT phase after selection on %d.%d.%d", - XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs)); + isp_xs_prt(isp, xs, ISP_LOGERR, "No MESSAGE OUT phase after selection"); break; case RQCS_EXT_ID_FAILED: - isp_prt(isp, ISP_LOGERR, "EXTENDED IDENTIFY failed %d.%d.%d", - XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs)); + isp_xs_prt(isp, xs, ISP_LOGERR, "EXTENDED IDENTIFY failed"); break; case RQCS_IDE_MSG_FAILED: - isp_prt(isp, ISP_LOGERR, - "INITIATOR DETECTED ERROR rejected by %d.%d.%d", - XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs)); + isp_xs_prt(isp, xs, ISP_LOGERR, "INITIATOR DETECTED ERROR rejected"); break; case RQCS_ABORT_MSG_FAILED: - isp_prt(isp, ISP_LOGERR, "ABORT OPERATION rejected by %d.%d.%d", - XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs)); + isp_xs_prt(isp, xs, ISP_LOGERR, "ABORT OPERATION rejected"); break; case RQCS_REJECT_MSG_FAILED: - isp_prt(isp, ISP_LOGERR, "MESSAGE REJECT rejected by %d.%d.%d", - XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs)); + isp_xs_prt(isp, xs, ISP_LOGERR, "MESSAGE REJECT rejected"); break; case RQCS_NOP_MSG_FAILED: - isp_prt(isp, ISP_LOGERR, "NOP rejected by %d.%d.%d", - XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs)); + isp_xs_prt(isp, xs, ISP_LOGERR, "NOP rejected"); break; case RQCS_PARITY_ERROR_MSG_FAILED: - isp_prt(isp, ISP_LOGERR, - "MESSAGE PARITY ERROR rejected by %d.%d.%d", - XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs)); + isp_xs_prt(isp, xs, ISP_LOGERR, "MESSAGE PARITY ERROR rejected"); break; case RQCS_DEVICE_RESET_MSG_FAILED: - isp_prt(isp, ISP_LOGWARN, - "BUS DEVICE RESET rejected by %d.%d.%d", - XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs)); + isp_xs_prt(isp, xs, ISP_LOGWARN, "BUS DEVICE RESET rejected"); break; case RQCS_ID_MSG_FAILED: - isp_prt(isp, ISP_LOGERR, "IDENTIFY rejected by %d.%d.%d", - XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs)); + isp_xs_prt(isp, xs, ISP_LOGERR, "IDENTIFY rejected"); break; case RQCS_UNEXP_BUS_FREE: - isp_prt(isp, ISP_LOGERR, "%d.%d.%d had an unexpected bus free", - XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs)); + isp_xs_prt(isp, xs, ISP_LOGERR, "Unexpected Bus Free"); break; case RQCS_DATA_UNDERRUN: @@ -6205,9 +6167,7 @@ isp_parse_status(ispsoftc_t *isp, ispsta if (IS_FC(isp)) { int ru_marked = (sp->req_scsi_status & RQCS_RU) != 0; if (!ru_marked || sp->req_resid > XS_XFRLEN(xs)) { - isp_prt(isp, ISP_LOGWARN, bun, XS_TGT(xs), - XS_LUN(xs), XS_XFRLEN(xs), sp->req_resid, - (ru_marked)? "marked" : "not marked"); + isp_xs_prt(isp, xs, ISP_LOGWARN, bun, XS_XFRLEN(xs), sp->req_resid, (ru_marked)? "marked" : "not marked"); if (XS_NOERR(xs)) { XS_SETERR(xs, HBA_BOTCH); } @@ -6222,18 +6182,15 @@ isp_parse_status(ispsoftc_t *isp, ispsta } case RQCS_XACT_ERR1: - isp_prt(isp, ISP_LOGERR, xact1, XS_CHANNEL(xs), - XS_TGT(xs), XS_LUN(xs)); + isp_xs_prt(isp, xs, ISP_LOGERR, "HBA attempted queued transaction with disconnect not set"); break; case RQCS_XACT_ERR2: - isp_prt(isp, ISP_LOGERR, xact2, - XS_LUN(xs), XS_TGT(xs), XS_CHANNEL(xs)); + isp_xs_prt(isp, xs, ISP_LOGERR, "HBA attempted queued transaction to target routine %d", XS_LUN(xs)); break; case RQCS_XACT_ERR3: - isp_prt(isp, ISP_LOGERR, xact3, - XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs)); + isp_xs_prt(isp, xs, ISP_LOGERR, "HBA attempted queued cmd when queueing disabled"); break; case RQCS_BAD_ENTRY: @@ -6241,9 +6198,7 @@ isp_parse_status(ispsoftc_t *isp, ispsta break; case RQCS_QUEUE_FULL: - isp_prt(isp, ISP_LOGDEBUG0, - "internal queues full for %d.%d.%d status 0x%x", - XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs), *XS_STSP(xs)); + isp_xs_prt(isp, xs, ISP_LOGDEBUG0, "internal queues full status 0x%x", *XS_STSP(xs)); /* * If QFULL or some other status byte is set, then this @@ -6267,23 +6222,18 @@ isp_parse_status(ispsoftc_t *isp, ispsta return; case RQCS_PHASE_SKIPPED: - isp_prt(isp, ISP_LOGERR, pskip, XS_CHANNEL(xs), - XS_TGT(xs), XS_LUN(xs)); + isp_xs_prt(isp, xs, ISP_LOGERR, "SCSI phase skipped"); break; case RQCS_ARQS_FAILED: - isp_prt(isp, ISP_LOGERR, - "Auto Request Sense failed for %d.%d.%d", - XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs)); + isp_xs_prt(isp, xs, ISP_LOGERR, "Auto Request Sense Failed"); if (XS_NOERR(xs)) { XS_SETERR(xs, HBA_ARQFAIL); } return; case RQCS_WIDE_FAILED: - isp_prt(isp, ISP_LOGERR, - "Wide Negotiation failed for %d.%d.%d", - XS_TGT(xs), XS_LUN(xs), XS_CHANNEL(xs)); + isp_xs_prt(isp, xs, ISP_LOGERR, "Wide Negotiation Failed"); if (IS_SCSI(isp)) { sdparam *sdp = SDPARAM(isp, XS_CHANNEL(xs)); sdp->isp_devparam[XS_TGT(xs)].goal_flags &= ~DPARM_WIDE; @@ -6296,9 +6246,7 @@ isp_parse_status(ispsoftc_t *isp, ispsta return; case RQCS_SYNCXFER_FAILED: - isp_prt(isp, ISP_LOGERR, - "SDTR Message failed for target %d.%d.%d", - XS_TGT(xs), XS_LUN(xs), XS_CHANNEL(xs)); + isp_xs_prt(isp, xs, ISP_LOGERR, "SDTR Message Failed"); if (IS_SCSI(isp)) { sdparam *sdp = SDPARAM(isp, XS_CHANNEL(xs)); sdp += XS_CHANNEL(xs); @@ -6309,9 +6257,7 @@ isp_parse_status(ispsoftc_t *isp, ispsta break; case RQCS_LVD_BUSERR: - isp_prt(isp, ISP_LOGERR, - "Bad LVD condition while talking to %d.%d.%d", - XS_TGT(xs), XS_LUN(xs), XS_CHANNEL(xs)); + isp_xs_prt(isp, xs, ISP_LOGERR, "Bad LVD condition"); break; case RQCS_PORT_UNAVAILABLE: @@ -6381,8 +6327,7 @@ isp_parse_status(ispsoftc_t *isp, ispsta } static void -isp_parse_status_24xx(ispsoftc_t *isp, isp24xx_statusreq_t *sp, - XS_T *xs, long *rp) +isp_parse_status_24xx(ispsoftc_t *isp, isp24xx_statusreq_t *sp, XS_T *xs, long *rp) { int ru_marked, sv_marked; int chan = XS_CHANNEL(xs); @@ -6395,19 +6340,15 @@ isp_parse_status_24xx(ispsoftc_t *isp, i return; case RQCS_DMA_ERROR: - isp_prt(isp, ISP_LOGERR, "DMA error for command on %d.%d.%d", - XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs)); + isp_xs_prt(isp, xs, ISP_LOGERR, "DMA error"); break; case RQCS_TRANSPORT_ERROR: - isp_prt(isp, ISP_LOGERR, "transport error for %d.%d.%d", - XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs)); + isp_xs_prt(isp, xs, ISP_LOGERR, "Transport Error"); break; case RQCS_RESET_OCCURRED: - isp_prt(isp, ISP_LOGWARN, - "reset destroyed command for %d.%d.%d", - XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs)); + isp_xs_prt(isp, xs, ISP_LOGWARN, "reset destroyed command"); FCPARAM(isp, chan)->sendmarker = 1; if (XS_NOERR(xs)) { XS_SETERR(xs, HBA_BUSRESET); @@ -6415,8 +6356,7 @@ isp_parse_status_24xx(ispsoftc_t *isp, i return; case RQCS_ABORTED: - isp_prt(isp, ISP_LOGERR, "command aborted for %d.%d.%d", - XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs)); + isp_xs_prt(isp, xs, ISP_LOGERR, "Command Aborted"); FCPARAM(isp, chan)->sendmarker = 1; if (XS_NOERR(xs)) { XS_SETERR(xs, HBA_ABORTED); @@ -6424,8 +6364,7 @@ isp_parse_status_24xx(ispsoftc_t *isp, i return; case RQCS_TIMEOUT: - isp_prt(isp, ISP_LOGWARN, "command timed out for %d.%d.%d", - XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs)); + isp_xs_prt(isp, xs, ISP_LOGWARN, "Command Timed Out"); if (XS_NOERR(xs)) { XS_SETERR(xs, HBA_CMDTIMEOUT); } @@ -6433,9 +6372,7 @@ isp_parse_status_24xx(ispsoftc_t *isp, i case RQCS_DATA_OVERRUN: XS_SET_RESID(xs, sp->req_resid); - isp_prt(isp, ISP_LOGERR, - "data overrun for command on %d.%d.%d", - XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs)); + isp_xs_prt(isp, xs, ISP_LOGERR, "Data Overrun"); if (XS_NOERR(xs)) { XS_SETERR(xs, HBA_DATAOVR); } @@ -6468,19 +6405,14 @@ isp_parse_status_24xx(ispsoftc_t *isp, i sv_marked = (sp->req_scsi_status & (RQCS_SV|RQCS_RV)) != 0; if ((ru_marked == 0 && sv_marked == 0) || (sp->req_resid > XS_XFRLEN(xs))) { - isp_prt(isp, ISP_LOGWARN, bun, XS_TGT(xs), - XS_LUN(xs), XS_XFRLEN(xs), sp->req_resid, - (ru_marked)? "marked" : "not marked"); + isp_xs_prt(isp, xs, ISP_LOGWARN, bun, XS_XFRLEN(xs), sp->req_resid, (ru_marked)? "marked" : "not marked"); if (XS_NOERR(xs)) { XS_SETERR(xs, HBA_BOTCH); } return; } XS_SET_RESID(xs, sp->req_resid); - isp_prt(isp, ISP_LOGDEBUG0, - "%d.%d.%d data underrun (%d) for command 0x%x", - XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs), - sp->req_resid, XS_CDBP(xs)[0] & 0xff); + isp_xs_prt(isp, xs, ISP_LOGDEBUG0, "Data Underrun (%d) for command 0x%x", sp->req_resid, XS_CDBP(xs)[0] & 0xff); if (XS_NOERR(xs)) { XS_SETERR(xs, HBA_NOERROR); } @@ -7381,8 +7313,7 @@ isp_spi_update(ispsoftc_t *isp, int chan if (sdp->isp_devparam[tgt].dev_enable == 0) { sdp->isp_devparam[tgt].dev_update = 0; sdp->isp_devparam[tgt].dev_refresh = 0; - isp_prt(isp, ISP_LOGDEBUG0, - "skipping target %d bus %d update", tgt, chan); + isp_prt(isp, ISP_LOGDEBUG0, "skipping target %d bus %d update", tgt, chan); continue; } /* @@ -7438,10 +7369,8 @@ isp_spi_update(ispsoftc_t *isp, int chan sdp->isp_devparam[tgt].actv_flags &= ~DPARM_TQING; sdp->isp_devparam[tgt].actv_flags |= (sdp->isp_devparam[tgt].goal_flags & DPARM_TQING); - isp_prt(isp, ISP_LOGDEBUG0, - "bus %d set tgt %d flags 0x%x off 0x%x period 0x%x", - chan, tgt, mbs.param[2], mbs.param[3] >> 8, - mbs.param[3] & 0xff); + isp_prt(isp, ISP_LOGDEBUG0, "bus %d set tgt %d flags 0x%x off 0x%x period 0x%x", + chan, tgt, mbs.param[2], mbs.param[3] >> 8, mbs.param[3] & 0xff); get = 0; } else { continue; @@ -7775,8 +7704,7 @@ isp_read_nvram(ispsoftc_t *isp, int bus) nvram_data[2] != 'P') { if (isp->isp_bustype != ISP_BT_SBUS) { isp_prt(isp, ISP_LOGWARN, "invalid NVRAM header"); - isp_prt(isp, ISP_LOGDEBUG0, "%x %x %x", - nvram_data[0], nvram_data[1], nvram_data[2]); + isp_prt(isp, ISP_LOGDEBUG0, "%x %x %x", nvram_data[0], nvram_data[1], nvram_data[2]); } retval = -1; goto out; @@ -8291,8 +8219,7 @@ isp_parse_nvram_2100(ispsoftc_t *isp, ui ISP2100_NVRAM_TOV(nvram_data)); fcp->isp_xfwoptions = ISP2100_XFW_OPTIONS(nvram_data); fcp->isp_zfwoptions = ISP2100_ZFW_OPTIONS(nvram_data); - isp_prt(isp, ISP_LOGDEBUG0, - "xfwoptions 0x%x zfw options 0x%x", + isp_prt(isp, ISP_LOGDEBUG0, "xfwoptions 0x%x zfw options 0x%x", ISP2100_XFW_OPTIONS(nvram_data), ISP2100_ZFW_OPTIONS(nvram_data)); } Modified: stable/8/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/8/sys/dev/isp/isp_freebsd.c Mon Apr 5 18:05:09 2010 (r206195) +++ stable/8/sys/dev/isp/isp_freebsd.c Mon Apr 5 18:22:42 2010 (r206196) @@ -5420,6 +5420,20 @@ isp_prt(ispsoftc_t *isp, int level, cons printf("\n"); } +void +isp_xs_prt(ispsoftc_t *isp, XS_T *xs, int level, const char *fmt, ...) +{ + va_list ap; + if (level != ISP_LOGALL && (level & isp->isp_dblev) == 0) { + return; + } + xpt_print_path(xs->ccb_h.path); + va_start(ap, fmt); + vprintf(fmt, ap); + va_end(ap); + printf("\n"); +} + uint64_t isp_nanotime_sub(struct timespec *b, struct timespec *a) { Modified: stable/8/sys/dev/isp/isp_freebsd.h ============================================================================== --- stable/8/sys/dev/isp/isp_freebsd.h Mon Apr 5 18:05:09 2010 (r206195) +++ stable/8/sys/dev/isp/isp_freebsd.h Mon Apr 5 18:22:42 2010 (r206196) @@ -424,6 +424,8 @@ default: \ imin((sizeof((ccb)->sense_data)), ccb->sense_len) #define XS_SNSKEY(ccb) ((ccb)->sense_data.flags & 0xf) +#define XS_SNSASC(ccb) ((ccb)->sense_data.add_sense_code) +#define XS_SNSASCQ(ccb) ((ccb)->sense_data.add_sense_code_qual) #define XS_TAG_P(ccb) \ (((ccb)->ccb_h.flags & CAM_TAG_ACTION_VALID) && \ (ccb)->tag_action != CAM_TAG_ACTION_NONE) @@ -461,7 +463,7 @@ default: \ (xs)->ccb_h.status |= CAM_AUTOSNS_VALID; \ memcpy(&(xs)->sense_data, sense_ptr, imin(XS_SNSLEN(xs), sense_len)) -#define XS_SET_STATE_STAT(a, b, c) +#define XS_SENSE_VALID(xs) (((xs)->ccb_h.status & CAM_AUTOSNS_VALID) != 0) #define DEFAULT_FRAMESIZE(isp) isp->isp_osinfo.framesize #define DEFAULT_EXEC_THROTTLE(isp) isp->isp_osinfo.exec_throttle @@ -593,6 +595,7 @@ extern int isp_autoconfig; * Platform Library Functions */ void isp_prt(ispsoftc_t *, int level, const char *, ...) __printflike(3, 4); +void isp_xs_prt(ispsoftc_t *, XS_T *, int level, const char *, ...) __printflike(4, 5); uint64_t isp_nanotime_sub(struct timespec *, struct timespec *); int isp_mbox_acquire(ispsoftc_t *); void isp_mbox_wait_complete(ispsoftc_t *, mbreg_t *); Modified: stable/8/sys/dev/isp/ispvar.h ============================================================================== --- stable/8/sys/dev/isp/ispvar.h Mon Apr 5 18:05:09 2010 (r206195) +++ stable/8/sys/dev/isp/ispvar.h Mon Apr 5 18:22:42 2010 (r206196) @@ -954,12 +954,13 @@ void isp_async(ispsoftc_t *, ispasync_t, /* * Platform Dependent Error and Debug Printout * - * Generally this is: + * Two required functions for each platform must be provided: * * void isp_prt(ispsoftc_t *, int level, const char *, ...) + * void isp_xs_prt(ispsoftc_t *, XS_T *, int level, const char *, ...) * * but due to compiler differences on different platforms this won't be - * formally done here. Instead, it goes in each platform definition file. + * formally defined here. Instead, they go in each platform definition file. */ #define ISP_LOGALL 0x0 /* log always */ @@ -972,6 +973,7 @@ void isp_async(ispsoftc_t *, ispasync_t, #define ISP_LOGDEBUG2 0x40 /* log most debug messages */ #define ISP_LOGDEBUG3 0x80 /* log high frequency debug messages */ #define ISP_LOGSANCFG 0x100 /* log SAN configuration */ +#define ISP_LOG_CWARN 0x200 /* log SCSI command "warnings" (e.g., check conditions) */ #define ISP_LOGTINFO 0x1000 /* log informational messages (target mode) */ #define ISP_LOGTDEBUG0 0x2000 /* log simple debug messages (target mode) */ #define ISP_LOGTDEBUG1 0x4000 /* log intermediate debug messages (target) */ @@ -1045,6 +1047,8 @@ void isp_async(ispsoftc_t *, ispasync_t, * XS_SNSP(xs) gets a pointer to the associate sense data * XS_SNSLEN(xs) gets the length of sense data storage * XS_SNSKEY(xs) dereferences XS_SNSP to get the current stored Sense Key + * XS_SNSASC(xs) dereferences XS_SNSP to get the current stored Additional Sense Code + * XS_SNSASCQ(xs) dereferences XS_SNSP to get the current stored Additional Sense Code Qualifier * XS_TAG_P(xs) predicate of whether this command should be tagged * XS_TAG_TYPE(xs) which type of tag to use * XS_SETERR(xs) set error state @@ -1065,6 +1069,8 @@ void isp_async(ispsoftc_t *, ispasync_t, * * XS_SAVE_SENSE(xs, sp, len) save sense data * + * XS_SENSE_VALID(xs) indicates whether sense is valid + * * DEFAULT_FRAMESIZE(ispsoftc_t *) Default Frame Size * DEFAULT_EXEC_THROTTLE(ispsoftc_t *) Default Execution Throttle * From owner-svn-src-stable-8@FreeBSD.ORG Mon Apr 5 18:25:30 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7CC31106564A; Mon, 5 Apr 2010 18:25:30 +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 5F58F8FC0C; Mon, 5 Apr 2010 18:25:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o35IPUc5008064; Mon, 5 Apr 2010 18:25:30 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o35IPUg6008062; Mon, 5 Apr 2010 18:25:30 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201004051825.o35IPUg6008062@svn.freebsd.org> From: Marius Strobl Date: Mon, 5 Apr 2010 18:25:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206198 - stable/8/sys/sparc64/sparc64 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Apr 2010 18:25:30 -0000 Author: marius Date: Mon Apr 5 18:25:30 2010 New Revision: 206198 URL: http://svn.freebsd.org/changeset/base/206198 Log: MFC: r206086 - Try do deal gracefully with correctable ECC errors. - Improve the reporting of unhandled kernel and user traps. Modified: stable/8/sys/sparc64/sparc64/trap.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/sparc64/sparc64/trap.c ============================================================================== --- stable/8/sys/sparc64/sparc64/trap.c Mon Apr 5 18:22:48 2010 (r206197) +++ stable/8/sys/sparc64/sparc64/trap.c Mon Apr 5 18:25:30 2010 (r206198) @@ -106,6 +106,7 @@ void trap(struct trapframe *tf); void syscall(struct trapframe *tf); static int fetch_syscall_args(struct thread *td, struct syscall_args *sa); +static int trap_cecc(void); static int trap_pfault(struct thread *td, struct trapframe *tf); extern char copy_fault[]; @@ -240,6 +241,10 @@ int debugger_on_signal = 0; SYSCTL_INT(_debug, OID_AUTO, debugger_on_signal, CTLFLAG_RW, &debugger_on_signal, 0, ""); +u_int corrected_ecc = 0; +SYSCTL_UINT(_machdep, OID_AUTO, corrected_ecc, CTLFLAG_RD, &corrected_ecc, 0, + "corrected ECC errors"); + /* * SUNW,set-trap-table allows to take over %tba from the PROM, which * will turn off interrupts and handle outstanding ones while doing so, @@ -308,10 +313,16 @@ trap(struct trapframe *tf) case T_SPILL: sig = rwindow_save(td); break; + case T_CORRECTED_ECC_ERROR: + sig = trap_cecc(); + break; default: - if (tf->tf_type < 0 || tf->tf_type >= T_MAX || - trap_sig[tf->tf_type] == -1) - panic("trap: bad trap type"); + if (tf->tf_type < 0 || tf->tf_type >= T_MAX) + panic("trap: bad trap type %#lx (user)", + tf->tf_type); + else if (trap_sig[tf->tf_type] == -1) + panic("trap: %s (user)", + trap_msg[tf->tf_type]); sig = trap_sig[tf->tf_type]; break; } @@ -400,18 +411,53 @@ trap(struct trapframe *tf) } error = 1; break; + case T_CORRECTED_ECC_ERROR: + error = trap_cecc(); + break; default: error = 1; break; } - if (error != 0) - panic("trap: %s", trap_msg[tf->tf_type & ~T_KERNEL]); + if (error != 0) { + tf->tf_type &= ~T_KERNEL; + if (tf->tf_type < 0 || tf->tf_type >= T_MAX) + panic("trap: bad trap type %#lx (kernel)", + tf->tf_type); + else if (trap_sig[tf->tf_type] == -1) + panic("trap: %s (kernel)", + trap_msg[tf->tf_type]); + } } CTR1(KTR_TRAP, "trap: td=%p return", td); } static int +trap_cecc(void) +{ + u_long eee; + + /* + * Turn off (non-)correctable error reporting while we're dealing + * with the error. + */ + eee = ldxa(0, ASI_ESTATE_ERROR_EN_REG); + stxa_sync(0, ASI_ESTATE_ERROR_EN_REG, eee & ~(AA_ESTATE_NCEEN | + AA_ESTATE_CEEN)); + /* Flush the caches in order ensure no corrupt data got installed. */ + cache_flush(); + /* Ensure the caches are still turned on (should be). */ + cache_enable(PCPU_GET(impl)); + /* Clear the the error from the AFSR. */ + stxa_sync(0, ASI_AFSR, ldxa(0, ASI_AFSR)); + corrected_ecc++; + printf("corrected ECC error\n"); + /* Turn (non-)correctable error reporting back on. */ + stxa_sync(0, ASI_ESTATE_ERROR_EN_REG, eee); + return (0); +} + +static int trap_pfault(struct thread *td, struct trapframe *tf) { struct vmspace *vm; @@ -667,7 +713,7 @@ syscall(struct trapframe *tf) */ WITNESS_WARN(WARN_PANIC, NULL, "System call %s returning", (sa.code >= 0 && sa.code < SYS_MAXSYSCALL) ? - syscallnames[sa.code] : "???"); + syscallnames[sa.code] : "???"); KASSERT(td->td_critnest == 0, ("System call %s returning in a critical section", (sa.code >= 0 && sa.code < SYS_MAXSYSCALL) ? From owner-svn-src-stable-8@FreeBSD.ORG Mon Apr 5 18:33:42 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A082106566B; Mon, 5 Apr 2010 18:33:42 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4CB398FC13; Mon, 5 Apr 2010 18:33:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o35IXguk010001; Mon, 5 Apr 2010 18:33:42 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o35IXgKZ010000; Mon, 5 Apr 2010 18:33:42 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201004051833.o35IXgKZ010000@svn.freebsd.org> From: Matt Jacob Date: Mon, 5 Apr 2010 18:33:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206201 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Apr 2010 18:33:42 -0000 Author: mjacob Date: Mon Apr 5 18:33:42 2010 New Revision: 206201 URL: http://svn.freebsd.org/changeset/base/206201 Log: Handle the missing props changes for my MFC of 205698 (206196) Modified: Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) From owner-svn-src-stable-8@FreeBSD.ORG Mon Apr 5 18:36:47 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AAE6A106564A; Mon, 5 Apr 2010 18:36:47 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 98E878FC14; Mon, 5 Apr 2010 18:36:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o35IalDX010772; Mon, 5 Apr 2010 18:36:47 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o35Ialel010770; Mon, 5 Apr 2010 18:36:47 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201004051836.o35Ialel010770@svn.freebsd.org> From: Matt Jacob Date: Mon, 5 Apr 2010 18:36:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206202 - stable/8/sys/dev/isp X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Apr 2010 18:36:47 -0000 Author: mjacob Date: Mon Apr 5 18:36:47 2010 New Revision: 206202 URL: http://svn.freebsd.org/changeset/base/206202 Log: This is an MFC of 205712. D'oh- isp_handle_index' logic was reversed (not used in FreeBSD). Modified: stable/8/sys/dev/isp/isp_library.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/isp/isp_library.c ============================================================================== --- stable/8/sys/dev/isp/isp_library.c Mon Apr 5 18:33:42 2010 (r206201) +++ stable/8/sys/dev/isp/isp_library.c Mon Apr 5 18:36:47 2010 (r206202) @@ -294,10 +294,10 @@ uint32_t isp_handle_index(ispsoftc_t *isp, uint32_t handle) { if (!ISP_VALID_HANDLE(isp, handle)) { - return (handle & ISP_HANDLE_CMD_MASK); - } else { isp_prt(isp, ISP_LOGERR, "%s: bad handle 0x%x", __func__, handle); return (ISP_BAD_HANDLE_INDEX); + } else { + return (handle & ISP_HANDLE_CMD_MASK); } } From owner-svn-src-stable-8@FreeBSD.ORG Mon Apr 5 18:46:29 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA7881065672; Mon, 5 Apr 2010 18:46:29 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 96FAA8FC17; Mon, 5 Apr 2010 18:46:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o35IkTS7012970; Mon, 5 Apr 2010 18:46:29 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o35IkTFB012966; Mon, 5 Apr 2010 18:46:29 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201004051846.o35IkTFB012966@svn.freebsd.org> From: Jack F Vogel Date: Mon, 5 Apr 2010 18:46:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206204 - stable/8/sys/dev/ixgbe X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Apr 2010 18:46:29 -0000 Author: jfv Date: Mon Apr 5 18:46:29 2010 New Revision: 206204 URL: http://svn.freebsd.org/changeset/base/206204 Log: MFC of version 2.1.7 of the ixgbe driver. Modified: stable/8/sys/dev/ixgbe/LICENSE stable/8/sys/dev/ixgbe/ixgbe.c stable/8/sys/dev/ixgbe/ixgbe.h stable/8/sys/dev/ixgbe/ixgbe_82598.c stable/8/sys/dev/ixgbe/ixgbe_82599.c stable/8/sys/dev/ixgbe/ixgbe_api.c stable/8/sys/dev/ixgbe/ixgbe_api.h stable/8/sys/dev/ixgbe/ixgbe_common.c stable/8/sys/dev/ixgbe/ixgbe_common.h stable/8/sys/dev/ixgbe/ixgbe_osdep.h stable/8/sys/dev/ixgbe/ixgbe_phy.c stable/8/sys/dev/ixgbe/ixgbe_phy.h stable/8/sys/dev/ixgbe/ixgbe_type.h Modified: stable/8/sys/dev/ixgbe/LICENSE ============================================================================== --- stable/8/sys/dev/ixgbe/LICENSE Mon Apr 5 18:38:18 2010 (r206203) +++ stable/8/sys/dev/ixgbe/LICENSE Mon Apr 5 18:46:29 2010 (r206204) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2009, Intel Corporation + Copyright (c) 2001-2010, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: stable/8/sys/dev/ixgbe/ixgbe.c ============================================================================== --- stable/8/sys/dev/ixgbe/ixgbe.c Mon Apr 5 18:38:18 2010 (r206203) +++ stable/8/sys/dev/ixgbe/ixgbe.c Mon Apr 5 18:46:29 2010 (r206204) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2009, Intel Corporation + Copyright (c) 2001-2010, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -46,7 +46,7 @@ int ixgbe_display_debug_stat /********************************************************************* * Driver version *********************************************************************/ -char ixgbe_driver_version[] = "1.8.9"; +char ixgbe_driver_version[] = "2.1.7"; /********************************************************************* * PCI Device ID Table @@ -64,16 +64,20 @@ static ixgbe_vendor_info_t ixgbe_vendor_ {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598AF_SINGLE_PORT, 0, 0, 0}, {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598EB_CX4, 0, 0, 0}, {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598AT, 0, 0, 0}, + {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598AT2, 0, 0, 0}, {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598, 0, 0, 0}, {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598_DA_DUAL_PORT, 0, 0, 0}, {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598_CX4_DUAL_PORT, 0, 0, 0}, {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598EB_XF_LR, 0, 0, 0}, - {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598AT, 0, 0, 0}, {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598_SR_DUAL_PORT_EM, 0, 0, 0}, {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598EB_SFP_LOM, 0, 0, 0}, {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_KX4, 0, 0, 0}, + {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_KX4_MEZZ, 0, 0, 0}, {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_SFP, 0, 0, 0}, {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_XAUI_LOM, 0, 0, 0}, + {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_CX4, 0, 0, 0}, + {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_T3_LOM, 0, 0, 0}, + {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_COMBO_BACKPLANE, 0, 0, 0}, /* required last entry */ {0, 0, 0, 0, 0} }; @@ -102,9 +106,8 @@ static int ixgbe_mq_start_locked(struct static void ixgbe_qflush(struct ifnet *); #endif static int ixgbe_ioctl(struct ifnet *, u_long, caddr_t); -static void ixgbe_watchdog(struct adapter *); -static void ixgbe_init(void *); -static void ixgbe_init_locked(struct adapter *); +static void ixgbe_init(void *); +static int ixgbe_init_locked(struct adapter *); static void ixgbe_stop(void *); static void ixgbe_media_status(struct ifnet *, struct ifmediareq *); static int ixgbe_media_change(struct ifnet *); @@ -116,8 +119,8 @@ static int ixgbe_allocate_queues(struct static int ixgbe_setup_msix(struct adapter *); static void ixgbe_free_pci_resources(struct adapter *); static void ixgbe_local_timer(void *); -static int ixgbe_hardware_init(struct adapter *); static void ixgbe_setup_interface(device_t, struct adapter *); +static void ixgbe_config_link(struct adapter *); static int ixgbe_allocate_transmit_buffers(struct tx_ring *); static int ixgbe_setup_transmit_structures(struct adapter *); @@ -132,21 +135,21 @@ static int ixgbe_setup_receive_ring(stru static void ixgbe_initialize_receive_units(struct adapter *); static void ixgbe_free_receive_structures(struct adapter *); static void ixgbe_free_receive_buffers(struct rx_ring *); +static void ixgbe_setup_hw_rsc(struct rx_ring *); -static void ixgbe_init_moderation(struct adapter *); static void ixgbe_enable_intr(struct adapter *); static void ixgbe_disable_intr(struct adapter *); static void ixgbe_update_stats_counters(struct adapter *); static bool ixgbe_txeof(struct tx_ring *); -static bool ixgbe_rxeof(struct rx_ring *, int); -static void ixgbe_rx_checksum(u32, struct mbuf *); +static bool ixgbe_rxeof(struct ix_queue *, int); +static void ixgbe_rx_checksum(u32, struct mbuf *, u32); static void ixgbe_set_promisc(struct adapter *); static void ixgbe_disable_promisc(struct adapter *); static void ixgbe_set_multi(struct adapter *); static void ixgbe_print_hw_stats(struct adapter *); static void ixgbe_print_debug_info(struct adapter *); static void ixgbe_update_link_status(struct adapter *); -static int ixgbe_get_buf(struct rx_ring *, int, u8); +static void ixgbe_refresh_mbufs(struct rx_ring *, int); static int ixgbe_xmit(struct tx_ring *, struct mbuf **); static int ixgbe_sysctl_stats(SYSCTL_HANDLER_ARGS); static int ixgbe_sysctl_debug(SYSCTL_HANDLER_ARGS); @@ -166,7 +169,9 @@ static void ixgbe_setup_vlan_hw_support( static void ixgbe_register_vlan(void *, struct ifnet *, u16); static void ixgbe_unregister_vlan(void *, struct ifnet *, u16); -static void ixgbe_update_aim(struct rx_ring *); +static __inline void ixgbe_rx_discard(struct rx_ring *, int); +static __inline void ixgbe_rx_input(struct rx_ring *, struct ifnet *, + struct mbuf *, u32); /* Support for pluggable optic modules */ static bool ixgbe_sfp_probe(struct adapter *); @@ -175,17 +180,19 @@ static bool ixgbe_sfp_probe(struct adapt static void ixgbe_legacy_irq(void *); /* The MSI/X Interrupt handlers */ -static void ixgbe_msix_tx(void *); -static void ixgbe_msix_rx(void *); +static void ixgbe_msix_que(void *); static void ixgbe_msix_link(void *); /* Deferred interrupt tasklets */ -static void ixgbe_handle_tx(void *, int); -static void ixgbe_handle_rx(void *, int); +static void ixgbe_handle_que(void *, int); static void ixgbe_handle_link(void *, int); static void ixgbe_handle_msf(void *, int); static void ixgbe_handle_mod(void *, int); +#ifdef IXGBE_FDIR +static void ixgbe_atr(struct tx_ring *, struct mbuf *); +static void ixgbe_reinit_fdir(void *, int); +#endif /********************************************************************* * FreeBSD Device Interface Entry Points @@ -215,23 +222,16 @@ MODULE_DEPEND(ixgbe, ether, 1, 1, 1); */ /* -** These parameters are used in Adaptive -** Interrupt Moderation. The value is set -** into EITR and controls the interrupt -** frequency. They can be modified but -** be careful in tuning them. +** AIM: Adaptive Interrupt Moderation +** which means that the interrupt rate +** is varied over time based on the +** traffic for that interrupt vector */ static int ixgbe_enable_aim = TRUE; TUNABLE_INT("hw.ixgbe.enable_aim", &ixgbe_enable_aim); -static int ixgbe_low_latency = IXGBE_LOW_LATENCY; -TUNABLE_INT("hw.ixgbe.low_latency", &ixgbe_low_latency); -static int ixgbe_ave_latency = IXGBE_AVE_LATENCY; -TUNABLE_INT("hw.ixgbe.ave_latency", &ixgbe_ave_latency); -static int ixgbe_bulk_latency = IXGBE_BULK_LATENCY; -TUNABLE_INT("hw.ixgbe.bulk_latency", &ixgbe_bulk_latency); /* How many packets rxeof tries to clean at a time */ -static int ixgbe_rx_process_limit = 100; +static int ixgbe_rx_process_limit = 128; TUNABLE_INT("hw.ixgbe.rx_process_limit", &ixgbe_rx_process_limit); /* Flow control setting, default to full */ @@ -239,6 +239,15 @@ static int ixgbe_flow_control = ixgbe_fc TUNABLE_INT("hw.ixgbe.flow_control", &ixgbe_flow_control); /* +** Smart speed setting, default to on +** this only works as a compile option +** right now as its during attach, set +** this to 'ixgbe_smart_speed_off' to +** disable. +*/ +static int ixgbe_smart_speed = ixgbe_smart_speed_on; + +/* * MSIX should be the default for best performance, * but this allows it to be forced off for testing. */ @@ -255,23 +264,27 @@ static bool ixgbe_header_split = TRUE; TUNABLE_INT("hw.ixgbe.hdr_split", &ixgbe_header_split); /* - * Number of Queues, should normally - * be left at 0, it then autoconfigures to - * the number of cpus. Each queue is a pair - * of RX and TX rings with a dedicated interrupt + * Number of Queues, can be set to 0, + * it then autoconfigures based on the + * number of cpus. Each queue is a pair + * of RX and TX rings with a msix vector */ static int ixgbe_num_queues = 0; TUNABLE_INT("hw.ixgbe.num_queues", &ixgbe_num_queues); -/* Number of TX descriptors per ring */ -static int ixgbe_txd = DEFAULT_TXD; +/* +** Number of TX descriptors per ring, +** setting higher than RX as this seems +** the better performing choice. +*/ +static int ixgbe_txd = PERFORM_TXD; TUNABLE_INT("hw.ixgbe.txd", &ixgbe_txd); /* Number of RX descriptors per ring */ -static int ixgbe_rxd = DEFAULT_RXD; +static int ixgbe_rxd = PERFORM_RXD; TUNABLE_INT("hw.ixgbe.rxd", &ixgbe_rxd); -/* Total number of Interfaces - need for config sanity check */ +/* Keep running tab on them for sanity check */ static int ixgbe_total_ports; /* @@ -288,6 +301,27 @@ static u32 ixgbe_shadow_vfta[IXGBE_VFTA_ */ static int ixgbe_num_segs = IXGBE_82598_SCATTER; +#ifdef IXGBE_FDIR +/* +** For Flow Director: this is the +** number of TX packets we sample +** for the filter pool, this means +** every 20th packet will be probed. +** +** This feature can be disabled by +** setting this to 0. +*/ +static int atr_sample_rate = 20; +/* +** Flow Director actually 'steals' +** part of the packet buffer as its +** filter pool, this variable controls +** how much it uses: +** 0 = 64K, 1 = 128K, 2 = 256K +*/ +static int fdir_pballoc = 1; +#endif + /********************************************************************* * Device identification routine * @@ -356,7 +390,7 @@ ixgbe_attach(device_t dev) struct adapter *adapter; struct ixgbe_hw *hw; int error = 0; - u16 pci_device_id; + u16 pci_device_id, csum; u32 ctrl_ext; INIT_DEBUGOUT("ixgbe_attach: begin"); @@ -376,12 +410,18 @@ ixgbe_attach(device_t dev) case IXGBE_DEV_ID_82598EB_CX4 : adapter->optics = IFM_10G_CX4; break; + case IXGBE_DEV_ID_82598 : case IXGBE_DEV_ID_82598AF_DUAL_PORT : case IXGBE_DEV_ID_82598_DA_DUAL_PORT : case IXGBE_DEV_ID_82598AF_SINGLE_PORT : + case IXGBE_DEV_ID_82598_SR_DUAL_PORT_EM : + case IXGBE_DEV_ID_82598EB_SFP_LOM : case IXGBE_DEV_ID_82598AT : adapter->optics = IFM_10G_SR; break; + case IXGBE_DEV_ID_82598AT2 : + adapter->optics = IFM_10G_T; + break; case IXGBE_DEV_ID_82598EB_XF_LR : adapter->optics = IFM_10G_LR; break; @@ -390,11 +430,18 @@ ixgbe_attach(device_t dev) ixgbe_num_segs = IXGBE_82599_SCATTER; break; case IXGBE_DEV_ID_82599_KX4 : + case IXGBE_DEV_ID_82599_KX4_MEZZ: + case IXGBE_DEV_ID_82599_CX4 : adapter->optics = IFM_10G_CX4; ixgbe_num_segs = IXGBE_82599_SCATTER; break; case IXGBE_DEV_ID_82599_XAUI_LOM : + case IXGBE_DEV_ID_82599_COMBO_BACKPLANE : + ixgbe_num_segs = IXGBE_82599_SCATTER; + break; + case IXGBE_DEV_ID_82599_T3_LOM: ixgbe_num_segs = IXGBE_82599_SCATTER; + adapter->optics = IFM_10G_T; default: break; } @@ -420,21 +467,6 @@ ixgbe_attach(device_t dev) OID_AUTO, "enable_aim", CTLTYPE_INT|CTLFLAG_RW, &ixgbe_enable_aim, 1, "Interrupt Moderation"); - SYSCTL_ADD_INT(device_get_sysctl_ctx(dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "low_latency", CTLTYPE_INT|CTLFLAG_RW, - &ixgbe_low_latency, 1, "Low Latency"); - - SYSCTL_ADD_INT(device_get_sysctl_ctx(dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "ave_latency", CTLTYPE_INT|CTLFLAG_RW, - &ixgbe_ave_latency, 1, "Average Latency"); - - SYSCTL_ADD_INT(device_get_sysctl_ctx(dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "bulk_latency", CTLTYPE_INT|CTLFLAG_RW, - &ixgbe_bulk_latency, 1, "Bulk Latency"); - /* Set up the timer callout */ callout_init_mtx(&adapter->timer, &adapter->core_mtx, 0); @@ -504,10 +536,37 @@ ixgbe_attach(device_t dev) goto err_late; } - /* Initialize the hardware */ - if (ixgbe_hardware_init(adapter)) { - device_printf(dev,"Unable to initialize the hardware\n"); + /* Make sure we have a good EEPROM before we read from it */ + if (ixgbe_validate_eeprom_checksum(&adapter->hw, &csum) < 0) { + device_printf(dev,"The EEPROM Checksum Is Not Valid\n"); + error = EIO; + goto err_late; + } + + /* Pick up the smart speed setting */ + if (hw->mac.type == ixgbe_mac_82599EB) + hw->phy.smart_speed = ixgbe_smart_speed; + + /* Get Hardware Flow Control setting */ + hw->fc.requested_mode = ixgbe_fc_full; + hw->fc.pause_time = IXGBE_FC_PAUSE; + hw->fc.low_water = IXGBE_FC_LO; + hw->fc.high_water = IXGBE_FC_HI; + hw->fc.send_xon = TRUE; + + error = ixgbe_init_hw(hw); + if (error == IXGBE_ERR_EEPROM_VERSION) { + device_printf(dev, "This device is a pre-production adapter/" + "LOM. Please be aware there may be issues associated " + "with your hardware.\n If you are experiencing problems " + "please contact your Intel or hardware representative " + "who provided you with this hardware.\n"); + } else if (error == IXGBE_ERR_SFP_NOT_SUPPORTED) + device_printf(dev,"Unsupported SFP+ Module\n"); + + if (error) { error = EIO; + device_printf(dev,"Hardware Initialization Failure\n"); goto err_late; } @@ -521,22 +580,6 @@ ixgbe_attach(device_t dev) /* Setup OS specific network interface */ ixgbe_setup_interface(dev, adapter); -#ifdef IXGBE_IEEE1588 - /* - ** Setup the timer: IEEE 1588 support - */ - adapter->cycles.read = ixgbe_read_clock; - adapter->cycles.mask = (u64)-1; - adapter->cycles.mult = 1; - adapter->cycles.shift = IXGBE_TSYNC_SHIFT; - IXGBE_WRITE_REG(&adapter->hw, IXGBE_TIMINCA, (1<<24) | - IXGBE_TSYNC_CYCLE_TIME * IXGBE_TSYNC_SHIFT); - IXGBE_WRITE_REG(&adapter->hw, IXGBE_SYSTIML, 0x00000000); - IXGBE_WRITE_REG(&adapter->hw, IXGBE_SYSTIMH, 0xFF800000); - - // JFV - this is not complete yet -#endif - /* Sysctl for limiting the amount of work done in the taskqueue */ ixgbe_add_rx_process_limit(adapter, "rx_processing_limit", "max number of rx packets to process", &adapter->rx_process_limit, @@ -551,6 +594,25 @@ ixgbe_attach(device_t dev) adapter->vlan_detach = EVENTHANDLER_REGISTER(vlan_unconfig, ixgbe_unregister_vlan, adapter, EVENTHANDLER_PRI_FIRST); + /* Print PCIE bus type/speed/width info */ + ixgbe_get_bus_info(hw); + device_printf(dev,"PCI Express Bus: Speed %s %s\n", + ((hw->bus.speed == ixgbe_bus_speed_5000) ? "5.0Gb/s": + (hw->bus.speed == ixgbe_bus_speed_2500) ? "2.5Gb/s":"Unknown"), + (hw->bus.width == ixgbe_bus_width_pcie_x8) ? "Width x8" : + (hw->bus.width == ixgbe_bus_width_pcie_x4) ? "Width x4" : + (hw->bus.width == ixgbe_bus_width_pcie_x1) ? "Width x1" : + ("Unknown")); + + if ((hw->bus.width <= ixgbe_bus_width_pcie_x4) && + (hw->bus.speed == ixgbe_bus_speed_2500)) { + device_printf(dev, "PCI-Express bandwidth available" + " for this card\n is not sufficient for" + " optimal performance.\n"); + device_printf(dev, "For optimal performance a x8 " + "PCIE, or x4 PCIE 2 slot is required.\n"); + } + /* let hardware know driver is loaded */ ctrl_ext = IXGBE_READ_REG(hw, IXGBE_CTRL_EXT); ctrl_ext |= IXGBE_CTRL_EXT_DRV_LOAD; @@ -581,8 +643,7 @@ static int ixgbe_detach(device_t dev) { struct adapter *adapter = device_get_softc(dev); - struct tx_ring *txr = adapter->tx_rings; - struct rx_ring *rxr = adapter->rx_rings; + struct ix_queue *que = adapter->queues; u32 ctrl_ext; INIT_DEBUGOUT("ixgbe_detach: begin"); @@ -597,17 +658,10 @@ ixgbe_detach(device_t dev) ixgbe_stop(adapter); IXGBE_CORE_UNLOCK(adapter); - for (int i = 0; i < adapter->num_queues; i++, txr++) { - if (txr->tq) { - taskqueue_drain(txr->tq, &txr->tx_task); - taskqueue_free(txr->tq); - } - } - - for (int i = 0; i < adapter->num_queues; i++, rxr++) { - if (rxr->tq) { - taskqueue_drain(rxr->tq, &rxr->rx_task); - taskqueue_free(rxr->tq); + for (int i = 0; i < adapter->num_queues; i++, que++) { + if (que->tq) { + taskqueue_drain(que->tq, &que->que_task); + taskqueue_free(que->tq); } } @@ -616,6 +670,9 @@ ixgbe_detach(device_t dev) taskqueue_drain(adapter->tq, &adapter->link_task); taskqueue_drain(adapter->tq, &adapter->mod_task); taskqueue_drain(adapter->tq, &adapter->msf_task); +#ifdef IXGBE_FDIR + taskqueue_drain(adapter->tq, &adapter->fdir_task); +#endif taskqueue_free(adapter->tq); } @@ -700,8 +757,8 @@ ixgbe_start_locked(struct tx_ring *txr, /* Send a copy of the frame to the BPF listener */ ETHER_BPF_MTAP(ifp, m_head); - /* Set timeout in case hardware has problems transmitting */ - txr->watchdog_timer = IXGBE_TX_TIMEOUT; + /* Set watchdog on */ + txr->watchdog_check = TRUE; } return; @@ -741,6 +798,9 @@ ixgbe_mq_start(struct ifnet *ifp, struct /* Which queue to use */ if ((m->m_flags & M_FLOWID) != 0) i = m->m_pkthdr.flowid % adapter->num_queues; + else /* use the cpu we're on */ + i = curcpu % adapter->num_queues; + txr = &adapter->tx_rings[i]; if (IXGBE_TX_TRYLOCK(txr)) { @@ -757,53 +817,47 @@ ixgbe_mq_start_locked(struct ifnet *ifp, { struct adapter *adapter = txr->adapter; struct mbuf *next; - int err = 0; + int enqueued, err = 0; - if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { - err = drbr_enqueue(ifp, txr->br, m); + if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != + IFF_DRV_RUNNING || adapter->link_active == 0) { + if (m != NULL) + err = drbr_enqueue(ifp, txr->br, m); return (err); } - if (m == NULL) /* Called by tasklet */ - goto process; - - /* If nothing queued go right to xmit */ - if (!drbr_needs_enqueue(ifp, txr->br)) { - if (ixgbe_xmit(txr, &m)) { - if (m && (err = drbr_enqueue(ifp, txr->br, m)) != 0) - return (err); - } else { - /* Success, update stats */ - drbr_stats_update(ifp, m->m_pkthdr.len, m->m_flags); - /* Send a copy of the frame to the BPF listener */ - ETHER_BPF_MTAP(ifp, m); - /* Set the watchdog */ - txr->watchdog_timer = IXGBE_TX_TIMEOUT; - } - - } else if ((err = drbr_enqueue(ifp, txr->br, m)) != 0) - return (err); - -process: - if (drbr_empty(ifp, txr->br)) - return (err); + enqueued = 0; + if (m == NULL) { + next = drbr_dequeue(ifp, txr->br); + } else if (drbr_needs_enqueue(ifp, txr->br)) { + if ((err = drbr_enqueue(ifp, txr->br, m)) != 0) + return (err); + next = drbr_dequeue(ifp, txr->br); + } else + next = m; /* Process the queue */ - while (TRUE) { - if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + while (next != NULL) { + if ((err = ixgbe_xmit(txr, &next)) != 0) { + if (next != NULL) + err = drbr_enqueue(ifp, txr->br, next); break; - next = drbr_dequeue(ifp, txr->br); - if (next == NULL) + } + enqueued++; + drbr_stats_update(ifp, next->m_pkthdr.len, next->m_flags); + /* Send a copy of the frame to the BPF listener */ + ETHER_BPF_MTAP(ifp, next); + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) break; - if (ixgbe_xmit(txr, &next)) + if (txr->tx_avail <= IXGBE_TX_OP_THRESHOLD) { + ifp->if_drv_flags |= IFF_DRV_OACTIVE; break; - ETHER_BPF_MTAP(ifp, next); - /* Set the watchdog */ - txr->watchdog_timer = IXGBE_TX_TIMEOUT; + } + next = drbr_dequeue(ifp, txr->br); } - - if (txr->tx_avail <= IXGBE_TX_OP_THRESHOLD) - ifp->if_drv_flags |= IFF_DRV_OACTIVE; + + if (enqueued > 0) + txr->watchdog_check = TRUE; return (err); } @@ -840,29 +894,12 @@ ixgbe_qflush(struct ifnet *ifp) static int ixgbe_ioctl(struct ifnet * ifp, u_long command, caddr_t data) { - struct adapter *adapter = ifp->if_softc; - struct ifreq *ifr = (struct ifreq *) data; -#ifdef INET - struct ifaddr *ifa = (struct ifaddr *) data; -#endif + struct adapter *adapter = ifp->if_softc; + struct ifreq *ifr = (struct ifreq *) data; int error = 0; switch (command) { - case SIOCSIFADDR: -#ifdef INET - IOCTL_DEBUGOUT("ioctl: SIOCxIFADDR (Get/Set Interface Addr)"); - if (ifa->ifa_addr->sa_family == AF_INET) { - ifp->if_flags |= IFF_UP; - if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) { - IXGBE_CORE_LOCK(adapter); - ixgbe_init_locked(adapter); - IXGBE_CORE_UNLOCK(adapter); - } - arp_ifinit(ifp, ifa); - } else -#endif - ether_ioctl(ifp, command, data); - break; + case SIOCSIFMTU: IOCTL_DEBUGOUT("ioctl: SIOCSIFMTU (Set Interface MTU)"); if (ifr->ifr_mtu > IXGBE_MAX_FRAME_SIZE - ETHER_HDR_LEN) { @@ -872,7 +909,7 @@ ixgbe_ioctl(struct ifnet * ifp, u_long c ifp->if_mtu = ifr->ifr_mtu; adapter->max_frame_size = ifp->if_mtu + ETHER_HDR_LEN + ETHER_CRC_LEN; - ixgbe_init_locked(adapter); + error = ixgbe_init_locked(adapter); IXGBE_CORE_UNLOCK(adapter); } break; @@ -887,7 +924,7 @@ ixgbe_ioctl(struct ifnet * ifp, u_long c ixgbe_set_promisc(adapter); } } else - ixgbe_init_locked(adapter); + error = ixgbe_init_locked(adapter); } else if (ifp->if_drv_flags & IFF_DRV_RUNNING) ixgbe_stop(adapter); @@ -922,21 +959,15 @@ ixgbe_ioctl(struct ifnet * ifp, u_long c ifp->if_capenable ^= IFCAP_LRO; if (mask & IFCAP_VLAN_HWTAGGING) ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING; - if (ifp->if_drv_flags & IFF_DRV_RUNNING) - ixgbe_init(adapter); + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { + IXGBE_CORE_LOCK(adapter); + error = ixgbe_init_locked(adapter); + IXGBE_CORE_UNLOCK(adapter); + } VLAN_CAPABILITIES(ifp); break; } -#ifdef IXGBE_IEEE1588 - /* - ** IOCTL support for Precision Time (IEEE 1588) Support - */ - case SIOCSHWTSTAMP: - error = ixgbe_hwtstamp_ioctl(adapter, ifp); - break; -#endif - default: IOCTL_DEBUGOUT1("ioctl: UNKNOWN (0x%X)\n", (int)command); error = ether_ioctl(ifp, command, data); @@ -947,84 +978,6 @@ ixgbe_ioctl(struct ifnet * ifp, u_long c } /********************************************************************* - * Watchdog entry point - * - * This routine is called by the local timer - * to detect hardware hangs . - * - **********************************************************************/ - -static void -ixgbe_watchdog(struct adapter *adapter) -{ - device_t dev = adapter->dev; - struct tx_ring *txr = adapter->tx_rings; - struct ixgbe_hw *hw = &adapter->hw; - bool tx_hang = FALSE; - - IXGBE_CORE_LOCK_ASSERT(adapter); - - /* - * The timer is set to 5 every time ixgbe_start() queues a packet. - * Then ixgbe_txeof() keeps resetting to 5 as long as it cleans at - * least one descriptor. - * Finally, anytime all descriptors are clean the timer is - * set to 0. - */ - for (int i = 0; i < adapter->num_queues; i++, txr++) { - u32 head, tail; - - IXGBE_TX_LOCK(txr); - if (txr->watchdog_timer == 0 || --txr->watchdog_timer) { - IXGBE_TX_UNLOCK(txr); - continue; - } else { - head = IXGBE_READ_REG(hw, IXGBE_TDH(i)); - tail = IXGBE_READ_REG(hw, IXGBE_TDT(i)); - if (head == tail) { /* last minute check */ - IXGBE_TX_UNLOCK(txr); - continue; - } - /* Well, seems something is really hung */ - tx_hang = TRUE; - IXGBE_TX_UNLOCK(txr); - break; - } - } - if (tx_hang == FALSE) - return; - - /* - * If we are in this routine because of pause frames, then don't - * reset the hardware. - */ - if (IXGBE_READ_REG(hw, IXGBE_TFCS) & IXGBE_TFCS_TXOFF) { - txr = adapter->tx_rings; /* reset pointer */ - for (int i = 0; i < adapter->num_queues; i++, txr++) { - IXGBE_TX_LOCK(txr); - txr->watchdog_timer = IXGBE_TX_TIMEOUT; - IXGBE_TX_UNLOCK(txr); - } - return; - } - - - device_printf(adapter->dev, "Watchdog timeout -- resetting\n"); - for (int i = 0; i < adapter->num_queues; i++, txr++) { - device_printf(dev,"Queue(%d) tdh = %d, hw tdt = %d\n", i, - IXGBE_READ_REG(hw, IXGBE_TDH(i)), - IXGBE_READ_REG(hw, IXGBE_TDT(i))); - device_printf(dev,"TX(%d) desc avail = %d," - "Next TX to Clean = %d\n", - i, txr->tx_avail, txr->next_tx_to_clean); - } - adapter->ifp->if_drv_flags &= ~IFF_DRV_RUNNING; - adapter->watchdog_events++; - - ixgbe_init_locked(adapter); -} - -/********************************************************************* * Init entry point * * This routine is used in two ways. It is used by the stack as @@ -1036,42 +989,39 @@ ixgbe_watchdog(struct adapter *adapter) **********************************************************************/ #define IXGBE_MHADD_MFS_SHIFT 16 -static void +static int ixgbe_init_locked(struct adapter *adapter) { struct ifnet *ifp = adapter->ifp; device_t dev = adapter->dev; - struct ixgbe_hw *hw; + struct ixgbe_hw *hw = &adapter->hw; u32 k, txdctl, mhadd, gpie; u32 rxdctl, rxctrl; - int err; - - INIT_DEBUGOUT("ixgbe_init: begin"); - hw = &adapter->hw; mtx_assert(&adapter->core_mtx, MA_OWNED); + INIT_DEBUGOUT("ixgbe_init: begin"); + ixgbe_reset_hw(hw); + hw->adapter_stopped = FALSE; + ixgbe_stop_adapter(hw); + callout_stop(&adapter->timer); - ixgbe_stop(adapter); + /* reprogram the RAR[0] in case user changed it. */ + ixgbe_set_rar(hw, 0, adapter->hw.mac.addr, 0, IXGBE_RAH_AV); /* Get the latest mac address, User can use a LAA */ - bcopy(IF_LLADDR(adapter->ifp), adapter->hw.mac.addr, + bcopy(IF_LLADDR(adapter->ifp), hw->mac.addr, IXGBE_ETH_LENGTH_OF_ADDRESS); - ixgbe_set_rar(&adapter->hw, 0, adapter->hw.mac.addr, 0, 1); - adapter->hw.addr_ctrl.rar_used_count = 1; - - /* Initialize the hardware */ - if (ixgbe_hardware_init(adapter)) { - device_printf(dev, "Unable to initialize the hardware\n"); - return; - } + ixgbe_set_rar(hw, 0, hw->mac.addr, 0, 1); + hw->addr_ctrl.rar_used_count = 1; /* Prepare transmit descriptors and buffers */ if (ixgbe_setup_transmit_structures(adapter)) { device_printf(dev,"Could not setup transmit structures\n"); ixgbe_stop(adapter); - return; + return (ENOMEM); } + ixgbe_init_hw(hw); ixgbe_initialize_transmit_units(adapter); /* Setup Multicast table */ @@ -1090,18 +1040,15 @@ ixgbe_init_locked(struct adapter *adapte if (ixgbe_setup_receive_structures(adapter)) { device_printf(dev,"Could not setup receive structures\n"); ixgbe_stop(adapter); - return; + return (ENOMEM); } /* Configure RX settings */ ixgbe_initialize_receive_units(adapter); - /* Configure Interrupt Moderation */ - ixgbe_init_moderation(adapter); - gpie = IXGBE_READ_REG(&adapter->hw, IXGBE_GPIE); - if (adapter->hw.mac.type == ixgbe_mac_82599EB) { + if (hw->mac.type == ixgbe_mac_82599EB) { gpie |= IXGBE_SDP1_GPIEN; gpie |= IXGBE_SDP2_GPIEN; } @@ -1116,39 +1063,49 @@ ixgbe_init_locked(struct adapter *adapte gpie |= IXGBE_GPIE_EIAME | IXGBE_GPIE_PBA_SUPPORT | IXGBE_GPIE_OCD; } - IXGBE_WRITE_REG(&adapter->hw, IXGBE_GPIE, gpie); + IXGBE_WRITE_REG(hw, IXGBE_GPIE, gpie); /* Set the various hardware offload abilities */ ifp->if_hwassist = 0; if (ifp->if_capenable & IFCAP_TSO4) ifp->if_hwassist |= CSUM_TSO; if (ifp->if_capenable & IFCAP_TXCSUM) - ifp->if_hwassist = (CSUM_TCP | CSUM_UDP); - + ifp->if_hwassist |= (CSUM_TCP | CSUM_UDP); +#if __FreeBSD_version >= 800000 + if (hw->mac.type == ixgbe_mac_82599EB) + ifp->if_hwassist |= CSUM_SCTP; +#endif /* Set MTU size */ if (ifp->if_mtu > ETHERMTU) { - mhadd = IXGBE_READ_REG(&adapter->hw, IXGBE_MHADD); + mhadd = IXGBE_READ_REG(hw, IXGBE_MHADD); mhadd &= ~IXGBE_MHADD_MFS_MASK; mhadd |= adapter->max_frame_size << IXGBE_MHADD_MFS_SHIFT; - IXGBE_WRITE_REG(&adapter->hw, IXGBE_MHADD, mhadd); + IXGBE_WRITE_REG(hw, IXGBE_MHADD, mhadd); } /* Now enable all the queues */ for (int i = 0; i < adapter->num_queues; i++) { - txdctl = IXGBE_READ_REG(&adapter->hw, IXGBE_TXDCTL(i)); + txdctl = IXGBE_READ_REG(hw, IXGBE_TXDCTL(i)); txdctl |= IXGBE_TXDCTL_ENABLE; /* Set WTHRESH to 8, burst writeback */ txdctl |= (8 << 16); - IXGBE_WRITE_REG(&adapter->hw, IXGBE_TXDCTL(i), txdctl); + IXGBE_WRITE_REG(hw, IXGBE_TXDCTL(i), txdctl); } for (int i = 0; i < adapter->num_queues; i++) { - rxdctl = IXGBE_READ_REG(&adapter->hw, IXGBE_RXDCTL(i)); - /* PTHRESH set to 32 */ - rxdctl |= 0x0020; + rxdctl = IXGBE_READ_REG(hw, IXGBE_RXDCTL(i)); + if (hw->mac.type == ixgbe_mac_82598EB) { + /* + ** PTHRESH = 21 + ** HTHRESH = 4 + ** WTHRESH = 8 + */ + rxdctl &= ~0x3FFFFF; + rxdctl |= 0x080420; + } rxdctl |= IXGBE_RXDCTL_ENABLE; - IXGBE_WRITE_REG(&adapter->hw, IXGBE_RXDCTL(i), rxdctl); + IXGBE_WRITE_REG(hw, IXGBE_RXDCTL(i), rxdctl); for (k = 0; k < 10; k++) { if (IXGBE_READ_REG(hw, IXGBE_RXDCTL(i)) & IXGBE_RXDCTL_ENABLE) @@ -1165,10 +1122,10 @@ ixgbe_init_locked(struct adapter *adapte /* Enable Receive engine */ rxctrl = IXGBE_READ_REG(hw, IXGBE_RXCTRL); - if (adapter->hw.mac.type == ixgbe_mac_82598EB) + if (hw->mac.type == ixgbe_mac_82598EB) rxctrl |= IXGBE_RXCTRL_DMBYPS; rxctrl |= IXGBE_RXCTRL_RXEN; - IXGBE_WRITE_REG(hw, IXGBE_RXCTRL, rxctrl); + ixgbe_enable_rx_dma(hw, rxctrl); callout_reset(&adapter->timer, hz, ixgbe_local_timer, adapter); @@ -1180,33 +1137,36 @@ ixgbe_init_locked(struct adapter *adapte ixgbe_set_ivar(adapter, 0, 0, 1); } - ixgbe_enable_intr(adapter); +#ifdef IXGBE_FDIR + /* Init Flow director */ + if (hw->mac.type == ixgbe_mac_82599EB) + ixgbe_init_fdir_signature_82599(&adapter->hw, fdir_pballoc); +#endif /* ** Check on any SFP devices that ** need to be kick-started */ - err = hw->phy.ops.identify(hw); - if (err == IXGBE_ERR_SFP_NOT_SUPPORTED) { - device_printf(dev, - "Unsupported SFP+ module type was detected.\n"); - ixgbe_detach(dev); - return; - } - if (ixgbe_is_sfp(hw)) { - if (hw->phy.multispeed_fiber) { - hw->mac.ops.setup_sfp(hw); - taskqueue_enqueue(adapter->tq, &adapter->msf_task); - } else - taskqueue_enqueue(adapter->tq, &adapter->mod_task); - } else - taskqueue_enqueue(adapter->tq, &adapter->link_task); + if (hw->phy.type == ixgbe_phy_none) { + int err = hw->phy.ops.identify(hw); + if (err == IXGBE_ERR_SFP_NOT_SUPPORTED) { + device_printf(dev, + "Unsupported SFP+ module type was detected.\n"); + return (EIO); + } + } + + /* Config/Enable Link */ + ixgbe_config_link(adapter); + + /* And now turn on interrupts */ + ixgbe_enable_intr(adapter); /* Now inform the stack we're ready */ ifp->if_drv_flags |= IFF_DRV_RUNNING; ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; - return; + return (0); } static void @@ -1268,7 +1228,7 @@ ixgbe_disable_queue(struct adapter *adap } static inline void -ixgbe_rearm_rx_queues(struct adapter *adapter, u64 queues) +ixgbe_rearm_queues(struct adapter *adapter, u64 queues) { u32 mask; @@ -1283,34 +1243,22 @@ ixgbe_rearm_rx_queues(struct adapter *ad } } -static void -ixgbe_handle_rx(void *context, int pending) -{ - struct rx_ring *rxr = context; - struct adapter *adapter = rxr->adapter; - u32 loop = MAX_LOOP; - bool more; - - do { - more = ixgbe_rxeof(rxr, -1); - } while (loop-- && more); - /* Reenable this interrupt */ - ixgbe_enable_queue(adapter, rxr->msix); -} static void -ixgbe_handle_tx(void *context, int pending) +ixgbe_handle_que(void *context, int pending) { - struct tx_ring *txr = context; - struct adapter *adapter = txr->adapter; + struct ix_queue *que = context; + struct adapter *adapter = que->adapter; + struct tx_ring *txr = que->txr; struct ifnet *ifp = adapter->ifp; u32 loop = MAX_LOOP; - bool more; + bool more_rx, more_tx; IXGBE_TX_LOCK(txr); do { - more = ixgbe_txeof(txr); - } while (loop-- && more); + more_rx = ixgbe_rxeof(que, adapter->rx_process_limit); + more_tx = ixgbe_txeof(txr); + } while (loop-- && (more_rx || more_tx)); if (ifp->if_drv_flags & IFF_DRV_RUNNING) { #if __FreeBSD_version >= 800000 @@ -1324,7 +1272,7 @@ ixgbe_handle_tx(void *context, int pendi IXGBE_TX_UNLOCK(txr); /* Reenable this interrupt */ - ixgbe_enable_queue(adapter, txr->msix); + ixgbe_enable_queue(adapter, que->msix); } @@ -1337,33 +1285,32 @@ ixgbe_handle_tx(void *context, int pendi static void ixgbe_legacy_irq(void *arg) { - struct adapter *adapter = arg; + struct ix_queue *que = arg; + struct adapter *adapter = que->adapter; struct ixgbe_hw *hw = &adapter->hw; struct tx_ring *txr = adapter->tx_rings; - struct rx_ring *rxr = adapter->rx_rings; - bool more; + bool more_tx, more_rx; u32 reg_eicr, loop = MAX_LOOP; reg_eicr = IXGBE_READ_REG(hw, IXGBE_EICR); + ++que->irqs; if (reg_eicr == 0) { ixgbe_enable_intr(adapter); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-8@FreeBSD.ORG Mon Apr 5 20:39:44 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B6C36106564A; Mon, 5 Apr 2010 20:39:44 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A44BC8FC0C; Mon, 5 Apr 2010 20:39:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o35Kdi2g038462; Mon, 5 Apr 2010 20:39:44 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o35KdiVt038451; Mon, 5 Apr 2010 20:39:44 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201004052039.o35KdiVt038451@svn.freebsd.org> From: Jack F Vogel Date: Mon, 5 Apr 2010 20:39:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206211 - in stable/8/sys: conf dev/e1000 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Apr 2010 20:39:44 -0000 Author: jfv Date: Mon Apr 5 20:39:44 2010 New Revision: 206211 URL: http://svn.freebsd.org/changeset/base/206211 Log: MFC of the em/igb drivers Added: stable/8/sys/dev/e1000/if_lem.c (contents, props changed) stable/8/sys/dev/e1000/if_lem.h (contents, props changed) Modified: stable/8/sys/conf/files stable/8/sys/dev/e1000/LICENSE stable/8/sys/dev/e1000/e1000_80003es2lan.c stable/8/sys/dev/e1000/e1000_80003es2lan.h stable/8/sys/dev/e1000/e1000_82540.c stable/8/sys/dev/e1000/e1000_82541.c stable/8/sys/dev/e1000/e1000_82542.c stable/8/sys/dev/e1000/e1000_82543.c stable/8/sys/dev/e1000/e1000_82571.c stable/8/sys/dev/e1000/e1000_82575.c stable/8/sys/dev/e1000/e1000_82575.h stable/8/sys/dev/e1000/e1000_api.c stable/8/sys/dev/e1000/e1000_api.h stable/8/sys/dev/e1000/e1000_defines.h stable/8/sys/dev/e1000/e1000_hw.h stable/8/sys/dev/e1000/e1000_ich8lan.c stable/8/sys/dev/e1000/e1000_ich8lan.h stable/8/sys/dev/e1000/e1000_mac.c stable/8/sys/dev/e1000/e1000_mac.h stable/8/sys/dev/e1000/e1000_manage.c stable/8/sys/dev/e1000/e1000_osdep.h stable/8/sys/dev/e1000/e1000_phy.c stable/8/sys/dev/e1000/e1000_phy.h stable/8/sys/dev/e1000/e1000_regs.h stable/8/sys/dev/e1000/if_em.c stable/8/sys/dev/e1000/if_em.h stable/8/sys/dev/e1000/if_igb.c stable/8/sys/dev/e1000/if_igb.h Modified: stable/8/sys/conf/files ============================================================================== --- stable/8/sys/conf/files Mon Apr 5 20:12:54 2010 (r206210) +++ stable/8/sys/conf/files Mon Apr 5 20:39:44 2010 (r206211) @@ -899,6 +899,8 @@ dev/eisa/eisa_if.m standard dev/eisa/eisaconf.c optional eisa dev/e1000/if_em.c optional em inet \ compile-with "${NORMAL_C} -I$S/dev/e1000" +dev/e1000/if_lem.c optional em inet \ + compile-with "${NORMAL_C} -I$S/dev/e1000" dev/e1000/if_igb.c optional igb inet \ compile-with "${NORMAL_C} -I$S/dev/e1000" dev/e1000/e1000_80003es2lan.c optional em | igb \ Modified: stable/8/sys/dev/e1000/LICENSE ============================================================================== --- stable/8/sys/dev/e1000/LICENSE Mon Apr 5 20:12:54 2010 (r206210) +++ stable/8/sys/dev/e1000/LICENSE Mon Apr 5 20:39:44 2010 (r206211) @@ -1,6 +1,6 @@ $FreeBSD$ - Copyright (c) 2001-2008, Intel Corporation + Copyright (c) 2001-2010, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: stable/8/sys/dev/e1000/e1000_80003es2lan.c ============================================================================== --- stable/8/sys/dev/e1000/e1000_80003es2lan.c Mon Apr 5 20:12:54 2010 (r206210) +++ stable/8/sys/dev/e1000/e1000_80003es2lan.c Mon Apr 5 20:39:44 2010 (r206211) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2009, Intel Corporation + Copyright (c) 2001-2010, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -171,7 +171,7 @@ static s32 e1000_init_nvm_params_80003es break; } - nvm->type = e1000_nvm_eeprom_spi; + nvm->type = e1000_nvm_eeprom_spi; size = (u16)((eecd & E1000_EECD_SIZE_EX_MASK) >> E1000_EECD_SIZE_EX_SHIFT); @@ -206,17 +206,22 @@ static s32 e1000_init_nvm_params_80003es static s32 e1000_init_mac_params_80003es2lan(struct e1000_hw *hw) { struct e1000_mac_info *mac = &hw->mac; - s32 ret_val = E1000_SUCCESS; DEBUGFUNC("e1000_init_mac_params_80003es2lan"); - /* Set media type */ + /* Set media type and media-dependent function pointers */ switch (hw->device_id) { case E1000_DEV_ID_80003ES2LAN_SERDES_DPT: hw->phy.media_type = e1000_media_type_internal_serdes; + mac->ops.check_for_link = e1000_check_for_serdes_link_generic; + mac->ops.setup_physical_interface = + e1000_setup_fiber_serdes_link_generic; break; default: hw->phy.media_type = e1000_media_type_copper; + mac->ops.check_for_link = e1000_check_for_copper_link_generic; + mac->ops.setup_physical_interface = + e1000_setup_copper_link_80003es2lan; break; } @@ -226,10 +231,14 @@ static s32 e1000_init_mac_params_80003es mac->rar_entry_count = E1000_RAR_ENTRIES; /* Set if part includes ASF firmware */ mac->asf_firmware_present = TRUE; - /* Set if manageability features are enabled. */ + /* FWSM register */ + mac->has_fwsm = TRUE; + /* ARC supported; valid only if manageability features are enabled. */ mac->arc_subsystem_valid = (E1000_READ_REG(hw, E1000_FWSM) & E1000_FWSM_MODE_MASK) ? TRUE : FALSE; + /* Adaptive IFS not supported */ + mac->adaptive_ifs = FALSE; /* Function pointers */ @@ -241,27 +250,6 @@ static s32 e1000_init_mac_params_80003es mac->ops.init_hw = e1000_init_hw_80003es2lan; /* link setup */ mac->ops.setup_link = e1000_setup_link_generic; - /* physical interface link setup */ - mac->ops.setup_physical_interface = - (hw->phy.media_type == e1000_media_type_copper) - ? e1000_setup_copper_link_80003es2lan - : e1000_setup_fiber_serdes_link_generic; - /* check for link */ - switch (hw->phy.media_type) { - case e1000_media_type_copper: - mac->ops.check_for_link = e1000_check_for_copper_link_generic; - break; - case e1000_media_type_fiber: - mac->ops.check_for_link = e1000_check_for_fiber_link_generic; - break; - case e1000_media_type_internal_serdes: - mac->ops.check_for_link = e1000_check_for_serdes_link_generic; - break; - default: - ret_val = -E1000_ERR_CONFIG; - goto out; - break; - } /* check management mode */ mac->ops.check_mng_mode = e1000_check_mng_mode_generic; /* multicast address update */ @@ -270,8 +258,6 @@ static s32 e1000_init_mac_params_80003es mac->ops.write_vfta = e1000_write_vfta_generic; /* clearing VFTA */ mac->ops.clear_vfta = e1000_clear_vfta_generic; - /* setting MTA */ - mac->ops.mta_set = e1000_mta_set_generic; /* read mac address */ mac->ops.read_mac_addr = e1000_read_mac_addr_80003es2lan; /* ID LED init */ @@ -290,8 +276,10 @@ static s32 e1000_init_mac_params_80003es /* link info */ mac->ops.get_link_up_info = e1000_get_link_up_info_80003es2lan; -out: - return ret_val; + /* set lan id for port to determine which phy lock to use */ + hw->mac.ops.set_lan_id(hw); + + return E1000_SUCCESS; } /** @@ -307,7 +295,6 @@ void e1000_init_function_pointers_80003e hw->mac.ops.init_params = e1000_init_mac_params_80003es2lan; hw->nvm.ops.init_params = e1000_init_nvm_params_80003es2lan; hw->phy.ops.init_params = e1000_init_phy_params_80003es2lan; - e1000_get_bus_info_pcie_generic(hw); } /** @@ -342,7 +329,6 @@ static void e1000_release_phy_80003es2la e1000_release_swfw_sync_80003es2lan(hw, mask); } - /** * e1000_acquire_mac_csr_80003es2lan - Acquire rights to access Kumeran register * @hw: pointer to the HW structure @@ -532,28 +518,36 @@ static s32 e1000_read_phy_reg_gg82563_80 goto out; } - /* - * The "ready" bit in the MDIC register may be incorrectly set - * before the device has completed the "Page Select" MDI - * transaction. So we wait 200us after each MDI command... - */ - usec_delay(200); + if (hw->dev_spec._80003es2lan.mdic_wa_enable == TRUE) { + /* + * The "ready" bit in the MDIC register may be incorrectly set + * before the device has completed the "Page Select" MDI + * transaction. So we wait 200us after each MDI command... + */ + usec_delay(200); - /* ...and verify the command was successful. */ - ret_val = e1000_read_phy_reg_mdic(hw, page_select, &temp); + /* ...and verify the command was successful. */ + ret_val = e1000_read_phy_reg_mdic(hw, page_select, &temp); - if (((u16)offset >> GG82563_PAGE_SHIFT) != temp) { - ret_val = -E1000_ERR_PHY; - e1000_release_phy_80003es2lan(hw); - goto out; - } + if (((u16)offset >> GG82563_PAGE_SHIFT) != temp) { + ret_val = -E1000_ERR_PHY; + e1000_release_phy_80003es2lan(hw); + goto out; + } - usec_delay(200); + usec_delay(200); - ret_val = e1000_read_phy_reg_mdic(hw, MAX_PHY_REG_ADDRESS & offset, - data); + ret_val = e1000_read_phy_reg_mdic(hw, + MAX_PHY_REG_ADDRESS & offset, + data); + + usec_delay(200); + } else { + ret_val = e1000_read_phy_reg_mdic(hw, + MAX_PHY_REG_ADDRESS & offset, + data); + } - usec_delay(200); e1000_release_phy_80003es2lan(hw); out: @@ -599,29 +593,36 @@ static s32 e1000_write_phy_reg_gg82563_8 goto out; } + if (hw->dev_spec._80003es2lan.mdic_wa_enable == TRUE) { + /* + * The "ready" bit in the MDIC register may be incorrectly set + * before the device has completed the "Page Select" MDI + * transaction. So we wait 200us after each MDI command... + */ + usec_delay(200); - /* - * The "ready" bit in the MDIC register may be incorrectly set - * before the device has completed the "Page Select" MDI - * transaction. So we wait 200us after each MDI command... - */ - usec_delay(200); + /* ...and verify the command was successful. */ + ret_val = e1000_read_phy_reg_mdic(hw, page_select, &temp); - /* ...and verify the command was successful. */ - ret_val = e1000_read_phy_reg_mdic(hw, page_select, &temp); + if (((u16)offset >> GG82563_PAGE_SHIFT) != temp) { + ret_val = -E1000_ERR_PHY; + e1000_release_phy_80003es2lan(hw); + goto out; + } - if (((u16)offset >> GG82563_PAGE_SHIFT) != temp) { - ret_val = -E1000_ERR_PHY; - e1000_release_phy_80003es2lan(hw); - goto out; - } + usec_delay(200); - usec_delay(200); + ret_val = e1000_write_phy_reg_mdic(hw, + MAX_PHY_REG_ADDRESS & offset, + data); - ret_val = e1000_write_phy_reg_mdic(hw, MAX_PHY_REG_ADDRESS & offset, - data); + usec_delay(200); + } else { + ret_val = e1000_write_phy_reg_mdic(hw, + MAX_PHY_REG_ADDRESS & offset, + data); + } - usec_delay(200); e1000_release_phy_80003es2lan(hw); out: @@ -802,13 +803,13 @@ static s32 e1000_get_cable_length_80003e index = phy_data & GG82563_DSPD_CABLE_LENGTH; - if (index >= GG82563_CABLE_LENGTH_TABLE_SIZE + 5) { - ret_val = E1000_ERR_PHY; + if (index >= GG82563_CABLE_LENGTH_TABLE_SIZE - 5) { + ret_val = -E1000_ERR_PHY; goto out; } phy->min_cable_length = e1000_gg82563_cable_length_table[index]; - phy->max_cable_length = e1000_gg82563_cable_length_table[index+5]; + phy->max_cable_length = e1000_gg82563_cable_length_table[index + 5]; phy->cable_length = (phy->min_cable_length + phy->max_cable_length) / 2; @@ -916,10 +917,9 @@ static s32 e1000_init_hw_80003es2lan(str /* Initialize identification LED */ ret_val = mac->ops.id_led_init(hw); - if (ret_val) { + if (ret_val) DEBUGOUT("Error initializing identification LED\n"); /* This is not fatal and we should not stop init due to this */ - } /* Disabling VLAN filtering */ DEBUGOUT("Initializing the IEEE VLAN\n"); @@ -969,6 +969,19 @@ static s32 e1000_init_hw_80003es2lan(str reg_data &= ~0x00100000; E1000_WRITE_REG_ARRAY(hw, E1000_FFLT, 0x0001, reg_data); + /* default to TRUE to enable the MDIC W/A */ + hw->dev_spec._80003es2lan.mdic_wa_enable = TRUE; + + ret_val = e1000_read_kmrn_reg_80003es2lan(hw, + E1000_KMRNCTRLSTA_OFFSET >> + E1000_KMRNCTRLSTA_OFFSET_SHIFT, + &i); + if (!ret_val) { + if ((i & E1000_KMRNCTRLSTA_OPMODE_MASK) == + E1000_KMRNCTRLSTA_OPMODE_INBAND_MDIO) + hw->dev_spec._80003es2lan.mdic_wa_enable = FALSE; + } + /* * Clear all of the statistics registers (clear on read). It is * important that we do this after we have tried to establish link @@ -1035,72 +1048,73 @@ static s32 e1000_copper_link_setup_gg825 DEBUGFUNC("e1000_copper_link_setup_gg82563_80003es2lan"); - if (!phy->reset_disable) { - ret_val = hw->phy.ops.read_reg(hw, GG82563_PHY_MAC_SPEC_CTRL, - &data); - if (ret_val) - goto out; + if (phy->reset_disable) + goto skip_reset; - data |= GG82563_MSCR_ASSERT_CRS_ON_TX; - /* Use 25MHz for both link down and 1000Base-T for Tx clock. */ - data |= GG82563_MSCR_TX_CLK_1000MBPS_25; + ret_val = hw->phy.ops.read_reg(hw, GG82563_PHY_MAC_SPEC_CTRL, + &data); + if (ret_val) + goto out; - ret_val = hw->phy.ops.write_reg(hw, GG82563_PHY_MAC_SPEC_CTRL, - data); - if (ret_val) - goto out; + data |= GG82563_MSCR_ASSERT_CRS_ON_TX; + /* Use 25MHz for both link down and 1000Base-T for Tx clock. */ + data |= GG82563_MSCR_TX_CLK_1000MBPS_25; - /* - * Options: - * MDI/MDI-X = 0 (default) - * 0 - Auto for all speeds - * 1 - MDI mode - * 2 - MDI-X mode - * 3 - Auto for 1000Base-T only (MDI-X for 10/100Base-T modes) - */ - ret_val = hw->phy.ops.read_reg(hw, GG82563_PHY_SPEC_CTRL, &data); - if (ret_val) - goto out; + ret_val = hw->phy.ops.write_reg(hw, GG82563_PHY_MAC_SPEC_CTRL, + data); + if (ret_val) + goto out; - data &= ~GG82563_PSCR_CROSSOVER_MODE_MASK; + /* + * Options: + * MDI/MDI-X = 0 (default) + * 0 - Auto for all speeds + * 1 - MDI mode + * 2 - MDI-X mode + * 3 - Auto for 1000Base-T only (MDI-X for 10/100Base-T modes) + */ + ret_val = hw->phy.ops.read_reg(hw, GG82563_PHY_SPEC_CTRL, &data); + if (ret_val) + goto out; - switch (phy->mdix) { - case 1: - data |= GG82563_PSCR_CROSSOVER_MODE_MDI; - break; - case 2: - data |= GG82563_PSCR_CROSSOVER_MODE_MDIX; - break; - case 0: - default: - data |= GG82563_PSCR_CROSSOVER_MODE_AUTO; - break; - } + data &= ~GG82563_PSCR_CROSSOVER_MODE_MASK; - /* - * Options: - * disable_polarity_correction = 0 (default) - * Automatic Correction for Reversed Cable Polarity - * 0 - Disabled - * 1 - Enabled - */ - data &= ~GG82563_PSCR_POLARITY_REVERSAL_DISABLE; - if (phy->disable_polarity_correction) - data |= GG82563_PSCR_POLARITY_REVERSAL_DISABLE; + switch (phy->mdix) { + case 1: + data |= GG82563_PSCR_CROSSOVER_MODE_MDI; + break; + case 2: + data |= GG82563_PSCR_CROSSOVER_MODE_MDIX; + break; + case 0: + default: + data |= GG82563_PSCR_CROSSOVER_MODE_AUTO; + break; + } - ret_val = hw->phy.ops.write_reg(hw, GG82563_PHY_SPEC_CTRL, data); - if (ret_val) - goto out; + /* + * Options: + * disable_polarity_correction = 0 (default) + * Automatic Correction for Reversed Cable Polarity + * 0 - Disabled + * 1 - Enabled + */ + data &= ~GG82563_PSCR_POLARITY_REVERSAL_DISABLE; + if (phy->disable_polarity_correction) + data |= GG82563_PSCR_POLARITY_REVERSAL_DISABLE; - /* SW Reset the PHY so all changes take effect */ - ret_val = hw->phy.ops.commit(hw); - if (ret_val) { - DEBUGOUT("Error Resetting the PHY\n"); - goto out; - } + ret_val = hw->phy.ops.write_reg(hw, GG82563_PHY_SPEC_CTRL, data); + if (ret_val) + goto out; + /* SW Reset the PHY so all changes take effect */ + ret_val = hw->phy.ops.commit(hw); + if (ret_val) { + DEBUGOUT("Error Resetting the PHY\n"); + goto out; } +skip_reset: /* Bypass Rx and Tx FIFO's */ ret_val = e1000_write_kmrn_reg_80003es2lan(hw, E1000_KMRNCTRLSTA_OFFSET_FIFO_CTRL, @@ -1303,7 +1317,6 @@ static s32 e1000_cfg_kmrn_10_100_80003es tipg |= DEFAULT_TIPG_IPGT_10_100_80003ES2LAN; E1000_WRITE_REG(hw, E1000_TIPG, tipg); - do { ret_val = hw->phy.ops.read_reg(hw, GG82563_PHY_KMRN_MODE_CTRL, ®_data); @@ -1357,7 +1370,6 @@ static s32 e1000_cfg_kmrn_1000_80003es2l tipg |= DEFAULT_TIPG_IPGT_1000_80003ES2LAN; E1000_WRITE_REG(hw, E1000_TIPG, tipg); - do { ret_val = hw->phy.ops.read_reg(hw, GG82563_PHY_KMRN_MODE_CTRL, ®_data); Modified: stable/8/sys/dev/e1000/e1000_80003es2lan.h ============================================================================== --- stable/8/sys/dev/e1000/e1000_80003es2lan.h Mon Apr 5 20:12:54 2010 (r206210) +++ stable/8/sys/dev/e1000/e1000_80003es2lan.h Mon Apr 5 20:39:44 2010 (r206211) @@ -1,6 +1,6 @@ -/******************************************************************************* +/****************************************************************************** - Copyright (c) 2001-2008, Intel Corporation + Copyright (c) 2001-2009, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -29,9 +29,8 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*******************************************************************************/ -/* $FreeBSD$ */ - +******************************************************************************/ +/*$FreeBSD$*/ #ifndef _E1000_80003ES2LAN_H_ #define _E1000_80003ES2LAN_H_ @@ -49,6 +48,9 @@ #define E1000_KMRNCTRLSTA_HD_CTRL_1000_DEFAULT 0x0000 #define E1000_KMRNCTRLSTA_OPMODE_E_IDLE 0x2000 +#define E1000_KMRNCTRLSTA_OPMODE_MASK 0x000C +#define E1000_KMRNCTRLSTA_OPMODE_INBAND_MDIO 0x0004 + #define E1000_TCTL_EXT_GCEX_MASK 0x000FFC00 /* Gigabit Carry Extend Padding */ #define DEFAULT_TCTL_EXT_GCEX_80003ES2LAN 0x00010000 Modified: stable/8/sys/dev/e1000/e1000_82540.c ============================================================================== --- stable/8/sys/dev/e1000/e1000_82540.c Mon Apr 5 20:12:54 2010 (r206210) +++ stable/8/sys/dev/e1000/e1000_82540.c Mon Apr 5 20:39:44 2010 (r206211) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2009, Intel Corporation + Copyright (c) 2001-2010, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -228,8 +228,6 @@ static s32 e1000_init_mac_params_82540(s mac->ops.write_vfta = e1000_write_vfta_generic; /* clearing VFTA */ mac->ops.clear_vfta = e1000_clear_vfta_generic; - /* setting MTA */ - mac->ops.mta_set = e1000_mta_set_generic; /* read mac address */ mac->ops.read_mac_addr = e1000_read_mac_addr_82540; /* ID LED init */ Modified: stable/8/sys/dev/e1000/e1000_82541.c ============================================================================== --- stable/8/sys/dev/e1000/e1000_82541.c Mon Apr 5 20:12:54 2010 (r206210) +++ stable/8/sys/dev/e1000/e1000_82541.c Mon Apr 5 20:39:44 2010 (r206211) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2009, Intel Corporation + Copyright (c) 2001-2010, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -59,6 +59,7 @@ static s32 e1000_set_d3_lplu_state_8254 static s32 e1000_setup_led_82541(struct e1000_hw *hw); static s32 e1000_cleanup_led_82541(struct e1000_hw *hw); static void e1000_clear_hw_cntrs_82541(struct e1000_hw *hw); +static s32 e1000_read_mac_addr_82541(struct e1000_hw *hw); static s32 e1000_config_dsp_after_link_change_82541(struct e1000_hw *hw, bool link_up); static s32 e1000_phy_init_script_82541(struct e1000_hw *hw); @@ -259,8 +260,8 @@ static s32 e1000_init_mac_params_82541(s mac->ops.write_vfta = e1000_write_vfta_generic; /* clearing VFTA */ mac->ops.clear_vfta = e1000_clear_vfta_generic; - /* setting MTA */ - mac->ops.mta_set = e1000_mta_set_generic; + /* read mac address */ + mac->ops.read_mac_addr = e1000_read_mac_addr_82541; /* ID LED init */ mac->ops.id_led_init = e1000_id_led_init_generic; /* setup LED */ @@ -1292,3 +1293,35 @@ static void e1000_clear_hw_cntrs_82541(s E1000_READ_REG(hw, E1000_MGTPDC); E1000_READ_REG(hw, E1000_MGTPTC); } + +/** + * e1000_read_mac_addr_82541 - Read device MAC address + * @hw: pointer to the HW structure + * + * Reads the device MAC address from the EEPROM and stores the value. + **/ +static s32 e1000_read_mac_addr_82541(struct e1000_hw *hw) +{ + s32 ret_val = E1000_SUCCESS; + u16 offset, nvm_data, i; + + DEBUGFUNC("e1000_read_mac_addr"); + + for (i = 0; i < ETH_ADDR_LEN; i += 2) { + offset = i >> 1; + ret_val = hw->nvm.ops.read(hw, offset, 1, &nvm_data); + if (ret_val) { + DEBUGOUT("NVM Read Error\n"); + goto out; + } + hw->mac.perm_addr[i] = (u8)(nvm_data & 0xFF); + hw->mac.perm_addr[i+1] = (u8)(nvm_data >> 8); + } + + for (i = 0; i < ETH_ADDR_LEN; i++) + hw->mac.addr[i] = hw->mac.perm_addr[i]; + +out: + return ret_val; +} + Modified: stable/8/sys/dev/e1000/e1000_82542.c ============================================================================== --- stable/8/sys/dev/e1000/e1000_82542.c Mon Apr 5 20:12:54 2010 (r206210) +++ stable/8/sys/dev/e1000/e1000_82542.c Mon Apr 5 20:39:44 2010 (r206211) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2009, Intel Corporation + Copyright (c) 2001-2010, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -134,8 +134,6 @@ static s32 e1000_init_mac_params_82542(s mac->ops.write_vfta = e1000_write_vfta_generic; /* clearing VFTA */ mac->ops.clear_vfta = e1000_clear_vfta_generic; - /* setting MTA */ - mac->ops.mta_set = e1000_mta_set_generic; /* read mac address */ mac->ops.read_mac_addr = e1000_read_mac_addr_82542; /* set RAR */ Modified: stable/8/sys/dev/e1000/e1000_82543.c ============================================================================== --- stable/8/sys/dev/e1000/e1000_82543.c Mon Apr 5 20:12:54 2010 (r206210) +++ stable/8/sys/dev/e1000/e1000_82543.c Mon Apr 5 20:39:44 2010 (r206211) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2008, Intel Corporation + Copyright (c) 2001-2010, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -63,7 +63,6 @@ static s32 e1000_led_on_82543(struct e1 static s32 e1000_led_off_82543(struct e1000_hw *hw); static void e1000_write_vfta_82543(struct e1000_hw *hw, u32 offset, u32 value); -static void e1000_mta_set_82543(struct e1000_hw *hw, u32 hash_value); static void e1000_clear_hw_cntrs_82543(struct e1000_hw *hw); static s32 e1000_config_mac_to_phy_82543(struct e1000_hw *hw); static bool e1000_init_phy_disabled_82543(struct e1000_hw *hw); @@ -75,6 +74,8 @@ static void e1000_shift_out_mdi_bits_825 u16 count); static bool e1000_tbi_compatibility_enabled_82543(struct e1000_hw *hw); static void e1000_set_tbi_sbp_82543(struct e1000_hw *hw, bool state); +static s32 e1000_read_mac_addr_82543(struct e1000_hw *hw); + /** * e1000_init_phy_params_82543 - Init PHY func ptrs. @@ -244,8 +245,8 @@ static s32 e1000_init_mac_params_82543(s mac->ops.write_vfta = e1000_write_vfta_82543; /* clearing VFTA */ mac->ops.clear_vfta = e1000_clear_vfta_generic; - /* setting MTA */ - mac->ops.mta_set = e1000_mta_set_82543; + /* read mac address */ + mac->ops.read_mac_addr = e1000_read_mac_addr_82543; /* turn on/off LED */ mac->ops.led_on = e1000_led_on_82543; mac->ops.led_off = e1000_led_off_82543; @@ -1477,45 +1478,6 @@ static void e1000_write_vfta_82543(struc } /** - * e1000_mta_set_82543 - Set multicast filter table address - * @hw: pointer to the HW structure - * @hash_value: determines the MTA register and bit to set - * - * The multicast table address is a register array of 32-bit registers. - * The hash_value is used to determine what register the bit is in, the - * current value is read, the new bit is OR'd in and the new value is - * written back into the register. - **/ -static void e1000_mta_set_82543(struct e1000_hw *hw, u32 hash_value) -{ - u32 hash_bit, hash_reg, mta, temp; - - DEBUGFUNC("e1000_mta_set_82543"); - - hash_reg = (hash_value >> 5); - - /* - * If we are on an 82544 and we are trying to write an odd offset - * in the MTA, save off the previous entry before writing and - * restore the old value after writing. - */ - if ((hw->mac.type == e1000_82544) && (hash_reg & 1)) { - hash_reg &= (hw->mac.mta_reg_count - 1); - hash_bit = hash_value & 0x1F; - mta = E1000_READ_REG_ARRAY(hw, E1000_MTA, hash_reg); - mta |= (1 << hash_bit); - temp = E1000_READ_REG_ARRAY(hw, E1000_MTA, hash_reg - 1); - - E1000_WRITE_REG_ARRAY(hw, E1000_MTA, hash_reg, mta); - E1000_WRITE_FLUSH(hw); - E1000_WRITE_REG_ARRAY(hw, E1000_MTA, hash_reg - 1, temp); - E1000_WRITE_FLUSH(hw); - } else { - e1000_mta_set_generic(hw, hash_value); - } -} - -/** * e1000_led_on_82543 - Turn on SW controllable LED * @hw: pointer to the HW structure * @@ -1600,3 +1562,41 @@ static void e1000_clear_hw_cntrs_82543(s E1000_READ_REG(hw, E1000_TSCTC); E1000_READ_REG(hw, E1000_TSCTFC); } + +/** + * e1000_read_mac_addr_82543 - Read device MAC address + * @hw: pointer to the HW structure + * + * Reads the device MAC address from the EEPROM and stores the value. + * Since devices with two ports use the same EEPROM, we increment the + * last bit in the MAC address for the second port. + * + **/ +s32 e1000_read_mac_addr_82543(struct e1000_hw *hw) +{ + s32 ret_val = E1000_SUCCESS; + u16 offset, nvm_data, i; + + DEBUGFUNC("e1000_read_mac_addr"); + + for (i = 0; i < ETH_ADDR_LEN; i += 2) { + offset = i >> 1; + ret_val = hw->nvm.ops.read(hw, offset, 1, &nvm_data); + if (ret_val) { + DEBUGOUT("NVM Read Error\n"); + goto out; + } + hw->mac.perm_addr[i] = (u8)(nvm_data & 0xFF); + hw->mac.perm_addr[i+1] = (u8)(nvm_data >> 8); + } + + /* Flip last bit of mac address if we're on second port */ + if (hw->bus.func == E1000_FUNC_1) + hw->mac.perm_addr[5] ^= 1; + + for (i = 0; i < ETH_ADDR_LEN; i++) + hw->mac.addr[i] = hw->mac.perm_addr[i]; + +out: + return ret_val; +} Modified: stable/8/sys/dev/e1000/e1000_82571.c ============================================================================== --- stable/8/sys/dev/e1000/e1000_82571.c Mon Apr 5 20:12:54 2010 (r206210) +++ stable/8/sys/dev/e1000/e1000_82571.c Mon Apr 5 20:39:44 2010 (r206211) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2009, Intel Corporation + Copyright (c) 2001-2010, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -46,7 +46,6 @@ * 82573E Gigabit Ethernet Controller (Copper) * 82573L Gigabit Ethernet Controller * 82574L Gigabit Network Connection - * 82574L Gigabit Network Connection * 82583V Gigabit Network Connection */ @@ -106,7 +105,6 @@ static s32 e1000_init_phy_params_82571(s phy->reset_delay_us = 100; phy->ops.acquire = e1000_get_hw_semaphore_82571; - phy->ops.check_polarity = e1000_check_polarity_igp; phy->ops.check_reset_block = e1000_check_reset_block_generic; phy->ops.release = e1000_put_hw_semaphore_82571; phy->ops.reset = e1000_phy_hw_reset_generic; @@ -121,6 +119,7 @@ static s32 e1000_init_phy_params_82571(s phy->type = e1000_phy_igp_2; phy->ops.get_cfg_done = e1000_get_cfg_done_82571; phy->ops.get_info = e1000_get_phy_info_igp; + phy->ops.check_polarity = e1000_check_polarity_igp; phy->ops.force_speed_duplex = e1000_phy_force_speed_duplex_igp; phy->ops.get_cable_length = e1000_get_cable_length_igp_2; phy->ops.read_reg = e1000_read_phy_reg_igp; @@ -132,6 +131,7 @@ static s32 e1000_init_phy_params_82571(s /* Verify PHY ID */ if (phy->id != IGP01E1000_I_PHY_ID) { ret_val = -E1000_ERR_PHY; + DEBUGOUT1("PHY ID unknown: type = 0x%08x\n", phy->id); goto out; } break; @@ -139,6 +139,7 @@ static s32 e1000_init_phy_params_82571(s phy->type = e1000_phy_m88; phy->ops.get_cfg_done = e1000_get_cfg_done_generic; phy->ops.get_info = e1000_get_phy_info_m88; + phy->ops.check_polarity = e1000_check_polarity_m88; phy->ops.commit = e1000_phy_sw_reset_generic; phy->ops.force_speed_duplex = e1000_phy_force_speed_duplex_m88; phy->ops.get_cable_length = e1000_get_cable_length_m88; @@ -155,11 +156,12 @@ static s32 e1000_init_phy_params_82571(s goto out; } break; - case e1000_82583: case e1000_82574: + case e1000_82583: phy->type = e1000_phy_bm; phy->ops.get_cfg_done = e1000_get_cfg_done_generic; phy->ops.get_info = e1000_get_phy_info_m88; + phy->ops.check_polarity = e1000_check_polarity_m88; phy->ops.commit = e1000_phy_sw_reset_generic; phy->ops.force_speed_duplex = e1000_phy_force_speed_duplex_m88; phy->ops.get_cable_length = e1000_get_cable_length_m88; @@ -266,28 +268,42 @@ static s32 e1000_init_nvm_params_82571(s static s32 e1000_init_mac_params_82571(struct e1000_hw *hw) { struct e1000_mac_info *mac = &hw->mac; - s32 ret_val = E1000_SUCCESS; u32 swsm = 0; u32 swsm2 = 0; bool force_clear_smbi = FALSE; DEBUGFUNC("e1000_init_mac_params_82571"); - /* Set media type */ + /* Set media type and media-dependent function pointers */ switch (hw->device_id) { case E1000_DEV_ID_82571EB_FIBER: case E1000_DEV_ID_82572EI_FIBER: case E1000_DEV_ID_82571EB_QUAD_FIBER: hw->phy.media_type = e1000_media_type_fiber; + mac->ops.setup_physical_interface = + e1000_setup_fiber_serdes_link_82571; + mac->ops.check_for_link = e1000_check_for_fiber_link_generic; + mac->ops.get_link_up_info = + e1000_get_speed_and_duplex_fiber_serdes_generic; break; case E1000_DEV_ID_82571EB_SERDES: case E1000_DEV_ID_82571EB_SERDES_DUAL: case E1000_DEV_ID_82571EB_SERDES_QUAD: case E1000_DEV_ID_82572EI_SERDES: hw->phy.media_type = e1000_media_type_internal_serdes; + mac->ops.setup_physical_interface = + e1000_setup_fiber_serdes_link_82571; + mac->ops.check_for_link = e1000_check_for_serdes_link_82571; + mac->ops.get_link_up_info = + e1000_get_speed_and_duplex_fiber_serdes_generic; break; default: hw->phy.media_type = e1000_media_type_copper; + mac->ops.setup_physical_interface = + e1000_setup_copper_link_82571; + mac->ops.check_for_link = e1000_check_for_copper_link_generic; + mac->ops.get_link_up_info = + e1000_get_speed_and_duplex_copper_generic; break; } @@ -297,70 +313,25 @@ static s32 e1000_init_mac_params_82571(s mac->rar_entry_count = E1000_RAR_ENTRIES; /* Set if part includes ASF firmware */ mac->asf_firmware_present = TRUE; - /* Set if manageability features are enabled. */ - mac->arc_subsystem_valid = - (E1000_READ_REG(hw, E1000_FWSM) & E1000_FWSM_MODE_MASK) - ? TRUE : FALSE; + /* Adaptive IFS supported */ + mac->adaptive_ifs = TRUE; /* Function pointers */ /* bus type/speed/width */ mac->ops.get_bus_info = e1000_get_bus_info_pcie_generic; - /* function id */ - switch (hw->mac.type) { - case e1000_82573: - case e1000_82574: - case e1000_82583: - mac->ops.set_lan_id = e1000_set_lan_id_single_port; - break; - default: - break; - } /* reset */ mac->ops.reset_hw = e1000_reset_hw_82571; /* hw initialization */ mac->ops.init_hw = e1000_init_hw_82571; /* link setup */ mac->ops.setup_link = e1000_setup_link_82571; - /* physical interface link setup */ - mac->ops.setup_physical_interface = - (hw->phy.media_type == e1000_media_type_copper) - ? e1000_setup_copper_link_82571 - : e1000_setup_fiber_serdes_link_82571; - /* check for link */ - switch (hw->phy.media_type) { - case e1000_media_type_copper: - mac->ops.check_for_link = e1000_check_for_copper_link_generic; - break; - case e1000_media_type_fiber: - mac->ops.check_for_link = e1000_check_for_fiber_link_generic; - break; - case e1000_media_type_internal_serdes: - mac->ops.check_for_link = e1000_check_for_serdes_link_82571; - break; - default: - ret_val = -E1000_ERR_CONFIG; - goto out; - break; - } - /* check management mode */ - switch (hw->mac.type) { - case e1000_82574: - case e1000_82583: - mac->ops.check_mng_mode = e1000_check_mng_mode_82574; - break; - default: - mac->ops.check_mng_mode = e1000_check_mng_mode_generic; - break; - } /* multicast address update */ mac->ops.update_mc_addr_list = e1000_update_mc_addr_list_generic; /* writing VFTA */ mac->ops.write_vfta = e1000_write_vfta_generic; /* clearing VFTA */ mac->ops.clear_vfta = e1000_clear_vfta_82571; - /* setting MTA */ - mac->ops.mta_set = e1000_mta_set_generic; /* read mac address */ mac->ops.read_mac_addr = e1000_read_mac_addr_82571; /* ID LED init */ @@ -371,24 +342,42 @@ static s32 e1000_init_mac_params_82571(s mac->ops.setup_led = e1000_setup_led_generic; /* cleanup LED */ mac->ops.cleanup_led = e1000_cleanup_led_generic; - /* turn on/off LED */ + /* turn off LED */ + mac->ops.led_off = e1000_led_off_generic; + /* clear hardware counters */ + mac->ops.clear_hw_cntrs = e1000_clear_hw_cntrs_82571; + + /* MAC-specific function pointers */ switch (hw->mac.type) { + case e1000_82573: + mac->ops.set_lan_id = e1000_set_lan_id_single_port; + mac->ops.check_mng_mode = e1000_check_mng_mode_generic; + mac->ops.led_on = e1000_led_on_generic; + + /* FWSM register */ + mac->has_fwsm = TRUE; + /* + * ARC supported; valid only if manageability features are + * enabled. + */ + mac->arc_subsystem_valid = + (E1000_READ_REG(hw, E1000_FWSM) & E1000_FWSM_MODE_MASK) + ? TRUE : FALSE; + break; case e1000_82574: case e1000_82583: + mac->ops.set_lan_id = e1000_set_lan_id_single_port; + mac->ops.check_mng_mode = e1000_check_mng_mode_82574; mac->ops.led_on = e1000_led_on_82574; break; default: + mac->ops.check_mng_mode = e1000_check_mng_mode_generic; mac->ops.led_on = e1000_led_on_generic; + + /* FWSM register */ + mac->has_fwsm = TRUE; break; } - mac->ops.led_off = e1000_led_off_generic; - /* clear hardware counters */ - mac->ops.clear_hw_cntrs = e1000_clear_hw_cntrs_82571; - /* link info */ - mac->ops.get_link_up_info = - (hw->phy.media_type == e1000_media_type_copper) - ? e1000_get_speed_and_duplex_copper_generic - : e1000_get_speed_and_duplex_fiber_serdes_generic; /* * Ensure that the inter-port SWSM.SMBI lock bit is clear before @@ -434,8 +423,7 @@ static s32 e1000_init_mac_params_82571(s */ hw->dev_spec._82571.smb_counter = 0; -out: - return ret_val; + return E1000_SUCCESS; } /** @@ -501,7 +489,6 @@ static s32 e1000_get_phy_id_82571(struct ret_val = -E1000_ERR_PHY; break; } - out: return ret_val; } @@ -512,7 +499,7 @@ out: * * Acquire the HW semaphore to access the PHY or NVM **/ -s32 e1000_get_hw_semaphore_82571(struct e1000_hw *hw) +static s32 e1000_get_hw_semaphore_82571(struct e1000_hw *hw) { u32 swsm; s32 ret_val = E1000_SUCCESS; @@ -577,7 +564,7 @@ out: * * Release hardware semaphore used to access the PHY or NVM **/ -void e1000_put_hw_semaphore_82571(struct e1000_hw *hw) +static void e1000_put_hw_semaphore_82571(struct e1000_hw *hw) { u32 swsm; @@ -610,9 +597,9 @@ static s32 e1000_acquire_nvm_82571(struc goto out; switch (hw->mac.type) { + case e1000_82573: case e1000_82574: case e1000_82583: - case e1000_82573: break; default: ret_val = e1000_acquire_nvm_generic(hw); @@ -831,7 +818,8 @@ static s32 e1000_get_cfg_done_82571(stru DEBUGFUNC("e1000_get_cfg_done_82571"); while (timeout) { - if (E1000_READ_REG(hw, E1000_EEMNGCTL) & E1000_NVM_CFG_DONE_PORT_0) + if (E1000_READ_REG(hw, E1000_EEMNGCTL) & + E1000_NVM_CFG_DONE_PORT_0) break; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-8@FreeBSD.ORG Mon Apr 5 21:43:23 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6BB631065687; Mon, 5 Apr 2010 21:43:23 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 405BF8FC0C; Mon, 5 Apr 2010 21:43:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o35LhNUU052900; Mon, 5 Apr 2010 21:43:23 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o35LhNFt052897; Mon, 5 Apr 2010 21:43:23 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201004052143.o35LhNFt052897@svn.freebsd.org> From: Jack F Vogel Date: Mon, 5 Apr 2010 21:43:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206215 - in stable/8/sys/modules: em ixgbe X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Apr 2010 21:43:23 -0000 Author: jfv Date: Mon Apr 5 21:43:22 2010 New Revision: 206215 URL: http://svn.freebsd.org/changeset/base/206215 Log: Add missing module Makefile for ixgbe and em MFCs Modified: stable/8/sys/modules/em/Makefile stable/8/sys/modules/ixgbe/Makefile Modified: stable/8/sys/modules/em/Makefile ============================================================================== --- stable/8/sys/modules/em/Makefile Mon Apr 5 21:36:04 2010 (r206214) +++ stable/8/sys/modules/em/Makefile Mon Apr 5 21:43:22 2010 (r206215) @@ -2,15 +2,19 @@ .PATH: ${.CURDIR}/../../dev/e1000 KMOD = if_em SRCS = device_if.h bus_if.h pci_if.h opt_inet.h -SRCS += if_em.c $(SHARED_SRCS) -SHARED_SRCS = e1000_api.c e1000_phy.c e1000_nvm.c e1000_mac.c e1000_manage.c -SHARED_SRCS += e1000_80003es2lan.c e1000_82542.c e1000_82541.c e1000_82543.c -SHARED_SRCS += e1000_82540.c e1000_ich8lan.c e1000_82571.c e1000_osdep.c -SHARED_SRCS += e1000_82575.c +SRCS += $(CORE_SRC) $(LEGACY_SRC) +SRCS += $(COMMON_SHARED) $(LEGACY_SHARED) $(PCIE_SHARED) +CORE_SRC = if_em.c e1000_osdep.c +# This is the Legacy, pre-PCIE source, it can be +# undefined when using modular driver if not needed +LEGACY_SRC += if_lem.c +COMMON_SHARED = e1000_api.c e1000_phy.c e1000_nvm.c e1000_mac.c e1000_manage.c +PCIE_SHARED = e1000_80003es2lan.c e1000_ich8lan.c e1000_82571.c e1000_82575.c +LEGACY_SHARED = e1000_82540.c e1000_82542.c e1000_82541.c e1000_82543.c -CFLAGS+= -I${.CURDIR}/../../dev/e1000 +CFLAGS += -I${.CURDIR}/../../dev/e1000 -# DEVICE_POLLING gives you Legacy interrupt handling +# DEVICE_POLLING for a non-interrupt-driven method #CFLAGS += -DDEVICE_POLLING clean: Modified: stable/8/sys/modules/ixgbe/Makefile ============================================================================== --- stable/8/sys/modules/ixgbe/Makefile Mon Apr 5 21:36:04 2010 (r206214) +++ stable/8/sys/modules/ixgbe/Makefile Mon Apr 5 21:43:22 2010 (r206215) @@ -6,7 +6,7 @@ SRCS += ixgbe.c # Shared source SRCS += ixgbe_common.c ixgbe_api.c ixgbe_phy.c SRCS += ixgbe_82599.c ixgbe_82598.c -CFLAGS+= -I${.CURDIR}/../../dev/ixgbe -DSMP +CFLAGS+= -I${.CURDIR}/../../dev/ixgbe -DSMP -DIXGBE_FDIR clean: rm -f device_if.h bus_if.h pci_if.h setdef* *_StripErr From owner-svn-src-stable-8@FreeBSD.ORG Mon Apr 5 23:29:27 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4C16106578C; Mon, 5 Apr 2010 23:29:27 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C008C8FC1B; Mon, 5 Apr 2010 23:29:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o35NTRRp076703; Mon, 5 Apr 2010 23:29:27 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o35NTR8O076698; Mon, 5 Apr 2010 23:29:27 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201004052329.o35NTR8O076698@svn.freebsd.org> From: Navdeep Parhar Date: Mon, 5 Apr 2010 23:29:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206220 - in stable/8/sys: dev/cxgb dev/cxgb/common dev/cxgb/ulp/iw_cxgb dev/cxgb/ulp/tom modules/cxgb/cxgb X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Apr 2010 23:29:28 -0000 Author: np Date: Mon Apr 5 23:29:27 2010 New Revision: 206220 URL: http://svn.freebsd.org/changeset/base/206220 Log: cxgb(4) MFCs: r204271,r204274,r204348,r204921,r205944,r205945,r205946,r205947,r205948,r205949,r205950,r206109 r204271: Accessing an mbuf after it has been handed off to the hardware is a bad race as it could already have been tx'd and freed by that time. Place the bpf tap just _before_ writing the gen bit. This fixes a panic when running tcpdump on a cxgb interface. r204274: There is no need to test __FreeBSD_version for features that have been around for a long time now (7.1-ish or even earlier); assume they are present. These includes MSI, TSO, LRO, VLAN, INTR_FILTERS, FIRMWARE, etc. Also, eliminate some dead code and clean up in other places as part of this quick once-over. r204348: Support IFCAP_VLANHWTSO in cxgb(4). It works with or without vlanhwtag. While here, remove old DPRINTFs and tidy up the capability code a bit. r204921: Better TwinAx transceiver detection. Originally submitted by: (This is a rewritten, corrected version of that patch) r205944: Refresh the firmware version immediately after it is upgraded (or downgraded). r205945: Improved PHY EDC settings. r205946: Do not attempt to retrieve interrupt information before it is available. r205947: Fix build with "nooptions INET" r205948: Fix tx drop statistics. r205949: Fix signed/unsigned mix-up that allowed txq->in_use to grow beyond txq->size. r205950: Multiple fixes related to queue set sizing and resources: - Only the tunnelq (TXQ_ETH) requires a buf_ring, an ifq, and the watchdog/timer callouts. Do not allocate these for the other tx queues. - Use 16k jumbo clusters only on offload capable cards by default. - Do not allocate a full tx ring for the offload queue if the card is not offload capable. - Slightly better freelist size calculation. - Fix nmbjumbo4 typo, remove unneeded global variables. r206109: Increase response queue size to avoid starvation, add a counter to track it when it does occur. Deleted: stable/8/sys/dev/cxgb/common/cxgb_version.h stable/8/sys/dev/cxgb/cxgb_config.h Modified: stable/8/sys/dev/cxgb/common/cxgb_ael1002.c stable/8/sys/dev/cxgb/common/cxgb_common.h stable/8/sys/dev/cxgb/common/cxgb_t3_hw.c stable/8/sys/dev/cxgb/cxgb_adapter.h stable/8/sys/dev/cxgb/cxgb_main.c stable/8/sys/dev/cxgb/cxgb_offload.h stable/8/sys/dev/cxgb/cxgb_osdep.h stable/8/sys/dev/cxgb/cxgb_sge.c stable/8/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb.c stable/8/sys/dev/cxgb/ulp/tom/cxgb_cpl_socket.c stable/8/sys/modules/cxgb/cxgb/Makefile Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/cxgb/common/cxgb_ael1002.c ============================================================================== --- stable/8/sys/dev/cxgb/common/cxgb_ael1002.c Mon Apr 5 22:15:06 2010 (r206219) +++ stable/8/sys/dev/cxgb/common/cxgb_ael1002.c Mon Apr 5 23:29:27 2010 (r206220) @@ -446,7 +446,7 @@ static int ael2xxx_get_module_type(struc return v; if (v == 0x1) - return phy_modtype_twinax; + goto twinax; if (v == 0x10) return phy_modtype_sr; if (v == 0x20) @@ -454,6 +454,17 @@ static int ael2xxx_get_module_type(struc if (v == 0x40) return phy_modtype_lrm; + v = ael_i2c_rd(phy, MODULE_DEV_ADDR, 8); + if (v < 0) + return v; + if (v == 4) { + v = ael_i2c_rd(phy, MODULE_DEV_ADDR, 60); + if (v < 0) + return v; + if (v & 0x1) + goto twinax; + } + v = ael_i2c_rd(phy, MODULE_DEV_ADDR, 6); if (v < 0) return v; @@ -465,6 +476,7 @@ static int ael2xxx_get_module_type(struc return v; if (v & 0x80) { +twinax: v = ael_i2c_rd(phy, MODULE_DEV_ADDR, 0x12); if (v < 0) return v; @@ -1435,395 +1447,439 @@ static int ael2020_setup_twinax_edc(stru 0xd803, 0x40aa, 0xd804, 0x401c, 0xd805, 0x401e, - 0xd806, 0x2ff4, - 0xd807, 0x3dc4, - 0xd808, 0x2035, - 0xd809, 0x3035, - 0xd80a, 0x6524, - 0xd80b, 0x2cb2, - 0xd80c, 0x3012, - 0xd80d, 0x1002, - 0xd80e, 0x26e2, - 0xd80f, 0x3022, - 0xd810, 0x1002, - 0xd811, 0x27d2, - 0xd812, 0x3022, + 0xd806, 0x20c5, + 0xd807, 0x3c05, + 0xd808, 0x6536, + 0xd809, 0x2fe4, + 0xd80a, 0x3dc4, + 0xd80b, 0x6624, + 0xd80c, 0x2ff4, + 0xd80d, 0x3dc4, + 0xd80e, 0x2035, + 0xd80f, 0x30a5, + 0xd810, 0x6524, + 0xd811, 0x2ca2, + 0xd812, 0x3012, 0xd813, 0x1002, - 0xd814, 0x2822, - 0xd815, 0x3012, + 0xd814, 0x27e2, + 0xd815, 0x3022, 0xd816, 0x1002, - 0xd817, 0x2492, + 0xd817, 0x28d2, 0xd818, 0x3022, 0xd819, 0x1002, - 0xd81a, 0x2772, + 0xd81a, 0x2892, 0xd81b, 0x3012, 0xd81c, 0x1002, - 0xd81d, 0x23d2, + 0xd81d, 0x24e2, 0xd81e, 0x3022, 0xd81f, 0x1002, - 0xd820, 0x22cd, - 0xd821, 0x301d, - 0xd822, 0x27f2, - 0xd823, 0x3022, - 0xd824, 0x1002, - 0xd825, 0x5553, - 0xd826, 0x0307, - 0xd827, 0x2522, - 0xd828, 0x3022, - 0xd829, 0x1002, - 0xd82a, 0x2142, - 0xd82b, 0x3012, - 0xd82c, 0x1002, - 0xd82d, 0x4016, - 0xd82e, 0x5e63, - 0xd82f, 0x0344, - 0xd830, 0x2142, + 0xd820, 0x27e2, + 0xd821, 0x3012, + 0xd822, 0x1002, + 0xd823, 0x2422, + 0xd824, 0x3022, + 0xd825, 0x1002, + 0xd826, 0x22cd, + 0xd827, 0x301d, + 0xd828, 0x28f2, + 0xd829, 0x3022, + 0xd82a, 0x1002, + 0xd82b, 0x5553, + 0xd82c, 0x0307, + 0xd82d, 0x2572, + 0xd82e, 0x3022, + 0xd82f, 0x1002, + 0xd830, 0x21a2, 0xd831, 0x3012, 0xd832, 0x1002, - 0xd833, 0x400e, - 0xd834, 0x2522, - 0xd835, 0x3022, - 0xd836, 0x1002, - 0xd837, 0x2b52, - 0xd838, 0x3012, - 0xd839, 0x1002, - 0xd83a, 0x2742, + 0xd833, 0x4016, + 0xd834, 0x5e63, + 0xd835, 0x0344, + 0xd836, 0x21a2, + 0xd837, 0x3012, + 0xd838, 0x1002, + 0xd839, 0x400e, + 0xd83a, 0x2572, 0xd83b, 0x3022, 0xd83c, 0x1002, - 0xd83d, 0x25e2, - 0xd83e, 0x3022, + 0xd83d, 0x2b22, + 0xd83e, 0x3012, 0xd83f, 0x1002, - 0xd840, 0x2fa4, - 0xd841, 0x3dc4, - 0xd842, 0x6624, - 0xd843, 0x414b, - 0xd844, 0x56b3, - 0xd845, 0x03c6, - 0xd846, 0x866b, - 0xd847, 0x400c, - 0xd848, 0x2712, - 0xd849, 0x3012, - 0xd84a, 0x1002, - 0xd84b, 0x2c4b, - 0xd84c, 0x309b, - 0xd84d, 0x56b3, - 0xd84e, 0x03c3, - 0xd84f, 0x866b, - 0xd850, 0x400c, - 0xd851, 0x2272, - 0xd852, 0x3022, - 0xd853, 0x1002, - 0xd854, 0x2742, - 0xd855, 0x3022, - 0xd856, 0x1002, - 0xd857, 0x25e2, - 0xd858, 0x3022, - 0xd859, 0x1002, - 0xd85a, 0x2fb4, - 0xd85b, 0x3dc4, - 0xd85c, 0x6624, - 0xd85d, 0x56b3, - 0xd85e, 0x03c3, - 0xd85f, 0x866b, - 0xd860, 0x401c, - 0xd861, 0x2c45, - 0xd862, 0x3095, - 0xd863, 0x5b53, - 0xd864, 0x2372, - 0xd865, 0x3012, - 0xd866, 0x13c2, - 0xd867, 0x5cc3, - 0xd868, 0x2712, - 0xd869, 0x3012, - 0xd86a, 0x1312, - 0xd86b, 0x2b52, + 0xd840, 0x2842, + 0xd841, 0x3022, + 0xd842, 0x1002, + 0xd843, 0x26e2, + 0xd844, 0x3022, + 0xd845, 0x1002, + 0xd846, 0x2fa4, + 0xd847, 0x3dc4, + 0xd848, 0x6624, + 0xd849, 0x2e8b, + 0xd84a, 0x303b, + 0xd84b, 0x56b3, + 0xd84c, 0x03c6, + 0xd84d, 0x866b, + 0xd84e, 0x400c, + 0xd84f, 0x2782, + 0xd850, 0x3012, + 0xd851, 0x1002, + 0xd852, 0x2c4b, + 0xd853, 0x309b, + 0xd854, 0x56b3, + 0xd855, 0x03c3, + 0xd856, 0x866b, + 0xd857, 0x400c, + 0xd858, 0x22a2, + 0xd859, 0x3022, + 0xd85a, 0x1002, + 0xd85b, 0x2842, + 0xd85c, 0x3022, + 0xd85d, 0x1002, + 0xd85e, 0x26e2, + 0xd85f, 0x3022, + 0xd860, 0x1002, + 0xd861, 0x2fb4, + 0xd862, 0x3dc4, + 0xd863, 0x6624, + 0xd864, 0x56b3, + 0xd865, 0x03c3, + 0xd866, 0x866b, + 0xd867, 0x401c, + 0xd868, 0x2c45, + 0xd869, 0x3095, + 0xd86a, 0x5b53, + 0xd86b, 0x23d2, 0xd86c, 0x3012, - 0xd86d, 0x1002, - 0xd86e, 0x2742, - 0xd86f, 0x3022, - 0xd870, 0x1002, - 0xd871, 0x2582, - 0xd872, 0x3022, - 0xd873, 0x1002, - 0xd874, 0x2142, - 0xd875, 0x3012, - 0xd876, 0x1002, - 0xd877, 0x628f, - 0xd878, 0x2985, - 0xd879, 0x33a5, - 0xd87a, 0x25e2, - 0xd87b, 0x3022, - 0xd87c, 0x1002, - 0xd87d, 0x5653, - 0xd87e, 0x03d2, - 0xd87f, 0x401e, - 0xd880, 0x6f72, - 0xd881, 0x1002, - 0xd882, 0x628f, - 0xd883, 0x2304, - 0xd884, 0x3c84, - 0xd885, 0x6436, - 0xd886, 0xdff4, - 0xd887, 0x6436, - 0xd888, 0x2ff5, - 0xd889, 0x3005, - 0xd88a, 0x8656, - 0xd88b, 0xdfba, - 0xd88c, 0x56a3, - 0xd88d, 0xd05a, - 0xd88e, 0x2972, - 0xd88f, 0x3012, - 0xd890, 0x1392, - 0xd891, 0xd05a, - 0xd892, 0x56a3, - 0xd893, 0xdfba, - 0xd894, 0x0383, - 0xd895, 0x6f72, - 0xd896, 0x1002, - 0xd897, 0x2b45, - 0xd898, 0x3005, - 0xd899, 0x4178, - 0xd89a, 0x5653, - 0xd89b, 0x0384, - 0xd89c, 0x2a62, - 0xd89d, 0x3012, - 0xd89e, 0x1002, - 0xd89f, 0x2f05, - 0xd8a0, 0x3005, - 0xd8a1, 0x41c8, - 0xd8a2, 0x5653, - 0xd8a3, 0x0382, - 0xd8a4, 0x0002, - 0xd8a5, 0x4218, - 0xd8a6, 0x2474, - 0xd8a7, 0x3c84, - 0xd8a8, 0x6437, - 0xd8a9, 0xdff4, - 0xd8aa, 0x6437, - 0xd8ab, 0x2ff5, - 0xd8ac, 0x3c05, - 0xd8ad, 0x8757, - 0xd8ae, 0xb888, - 0xd8af, 0x9787, - 0xd8b0, 0xdff4, - 0xd8b1, 0x6724, - 0xd8b2, 0x866a, - 0xd8b3, 0x6f72, - 0xd8b4, 0x1002, - 0xd8b5, 0x2641, - 0xd8b6, 0x3021, - 0xd8b7, 0x1001, - 0xd8b8, 0xc620, - 0xd8b9, 0x0000, - 0xd8ba, 0xc621, - 0xd8bb, 0x0000, - 0xd8bc, 0xc622, - 0xd8bd, 0x00ce, - 0xd8be, 0xc623, - 0xd8bf, 0x007f, - 0xd8c0, 0xc624, - 0xd8c1, 0x0032, - 0xd8c2, 0xc625, - 0xd8c3, 0x0000, - 0xd8c4, 0xc627, - 0xd8c5, 0x0000, - 0xd8c6, 0xc628, - 0xd8c7, 0x0000, - 0xd8c8, 0xc62c, + 0xd86d, 0x13c2, + 0xd86e, 0x5cc3, + 0xd86f, 0x2782, + 0xd870, 0x3012, + 0xd871, 0x1312, + 0xd872, 0x2b22, + 0xd873, 0x3012, + 0xd874, 0x1002, + 0xd875, 0x2842, + 0xd876, 0x3022, + 0xd877, 0x1002, + 0xd878, 0x2622, + 0xd879, 0x3022, + 0xd87a, 0x1002, + 0xd87b, 0x21a2, + 0xd87c, 0x3012, + 0xd87d, 0x1002, + 0xd87e, 0x628f, + 0xd87f, 0x2985, + 0xd880, 0x33a5, + 0xd881, 0x26e2, + 0xd882, 0x3022, + 0xd883, 0x1002, + 0xd884, 0x5653, + 0xd885, 0x03d2, + 0xd886, 0x401e, + 0xd887, 0x6f72, + 0xd888, 0x1002, + 0xd889, 0x628f, + 0xd88a, 0x2304, + 0xd88b, 0x3c84, + 0xd88c, 0x6436, + 0xd88d, 0xdff4, + 0xd88e, 0x6436, + 0xd88f, 0x2ff5, + 0xd890, 0x3005, + 0xd891, 0x8656, + 0xd892, 0xdfba, + 0xd893, 0x56a3, + 0xd894, 0xd05a, + 0xd895, 0x29e2, + 0xd896, 0x3012, + 0xd897, 0x1392, + 0xd898, 0xd05a, + 0xd899, 0x56a3, + 0xd89a, 0xdfba, + 0xd89b, 0x0383, + 0xd89c, 0x6f72, + 0xd89d, 0x1002, + 0xd89e, 0x2a64, + 0xd89f, 0x3014, + 0xd8a0, 0x2005, + 0xd8a1, 0x3d75, + 0xd8a2, 0xc451, + 0xd8a3, 0x29a2, + 0xd8a4, 0x3022, + 0xd8a5, 0x1002, + 0xd8a6, 0x178c, + 0xd8a7, 0x1898, + 0xd8a8, 0x19a4, + 0xd8a9, 0x1ab0, + 0xd8aa, 0x1bbc, + 0xd8ab, 0x1cc8, + 0xd8ac, 0x1dd3, + 0xd8ad, 0x1ede, + 0xd8ae, 0x1fe9, + 0xd8af, 0x20f4, + 0xd8b0, 0x21ff, + 0xd8b1, 0x0000, + 0xd8b2, 0x2741, + 0xd8b3, 0x3021, + 0xd8b4, 0x1001, + 0xd8b5, 0xc620, + 0xd8b6, 0x0000, + 0xd8b7, 0xc621, + 0xd8b8, 0x0000, + 0xd8b9, 0xc622, + 0xd8ba, 0x00e2, + 0xd8bb, 0xc623, + 0xd8bc, 0x007f, + 0xd8bd, 0xc624, + 0xd8be, 0x00ce, + 0xd8bf, 0xc625, + 0xd8c0, 0x0000, + 0xd8c1, 0xc627, + 0xd8c2, 0x0000, + 0xd8c3, 0xc628, + 0xd8c4, 0x0000, + 0xd8c5, 0xc90a, + 0xd8c6, 0x3a7c, + 0xd8c7, 0xc62c, + 0xd8c8, 0x0000, 0xd8c9, 0x0000, - 0xd8ca, 0x0000, - 0xd8cb, 0x2641, - 0xd8cc, 0x3021, - 0xd8cd, 0x1001, - 0xd8ce, 0xc502, - 0xd8cf, 0x53ac, - 0xd8d0, 0xc503, - 0xd8d1, 0x2cd3, - 0xd8d2, 0xc600, - 0xd8d3, 0x2a6e, - 0xd8d4, 0xc601, - 0xd8d5, 0x2a2c, - 0xd8d6, 0xc605, - 0xd8d7, 0x5557, - 0xd8d8, 0xc60c, - 0xd8d9, 0x5400, - 0xd8da, 0xc710, - 0xd8db, 0x0700, - 0xd8dc, 0xc711, - 0xd8dd, 0x0f06, - 0xd8de, 0xc718, - 0xd8df, 0x0700, - 0xd8e0, 0xc719, - 0xd8e1, 0x0f06, - 0xd8e2, 0xc720, - 0xd8e3, 0x4700, - 0xd8e4, 0xc721, - 0xd8e5, 0x0f06, - 0xd8e6, 0xc728, - 0xd8e7, 0x0700, - 0xd8e8, 0xc729, - 0xd8e9, 0x1207, - 0xd8ea, 0xc801, - 0xd8eb, 0x7f50, - 0xd8ec, 0xc802, - 0xd8ed, 0x7760, - 0xd8ee, 0xc803, - 0xd8ef, 0x7fce, - 0xd8f0, 0xc804, - 0xd8f1, 0x520e, - 0xd8f2, 0xc805, - 0xd8f3, 0x5c11, - 0xd8f4, 0xc806, - 0xd8f5, 0x3c51, - 0xd8f6, 0xc807, - 0xd8f7, 0x4061, - 0xd8f8, 0xc808, - 0xd8f9, 0x49c1, - 0xd8fa, 0xc809, - 0xd8fb, 0x3840, - 0xd8fc, 0xc80a, - 0xd8fd, 0x0000, - 0xd8fe, 0xc821, - 0xd8ff, 0x0002, - 0xd900, 0xc822, - 0xd901, 0x0046, - 0xd902, 0xc844, - 0xd903, 0x182f, - 0xd904, 0xc013, - 0xd905, 0xf341, - 0xd906, 0xc084, - 0xd907, 0x0030, - 0xd908, 0xc904, - 0xd909, 0x1401, - 0xd90a, 0xcb0c, - 0xd90b, 0x0004, - 0xd90c, 0xcb0e, - 0xd90d, 0xa00a, - 0xd90e, 0xcb0f, - 0xd90f, 0xc0c0, - 0xd910, 0xcb10, - 0xd911, 0xc0c0, - 0xd912, 0xcb11, - 0xd913, 0x00a0, - 0xd914, 0xcb12, - 0xd915, 0x0007, - 0xd916, 0xc241, - 0xd917, 0xa000, - 0xd918, 0xc243, - 0xd919, 0x7fe0, - 0xd91a, 0xc604, - 0xd91b, 0x000e, - 0xd91c, 0xc609, - 0xd91d, 0x00f5, - 0xd91e, 0xc611, - 0xd91f, 0x000e, - 0xd920, 0xc660, - 0xd921, 0x9600, - 0xd922, 0xc687, - 0xd923, 0x0004, - 0xd924, 0xc60a, - 0xd925, 0x04f5, - 0xd926, 0x0000, - 0xd927, 0x2641, - 0xd928, 0x3021, - 0xd929, 0x1001, - 0xd92a, 0xc620, - 0xd92b, 0x14e5, - 0xd92c, 0xc621, - 0xd92d, 0xc53d, - 0xd92e, 0xc622, - 0xd92f, 0x3cbe, - 0xd930, 0xc623, - 0xd931, 0x4452, - 0xd932, 0xc624, - 0xd933, 0xc5c5, - 0xd934, 0xc625, - 0xd935, 0xe01e, - 0xd936, 0xc627, - 0xd937, 0x0000, - 0xd938, 0xc628, - 0xd939, 0x0000, - 0xd93a, 0xc62c, - 0xd93b, 0x0000, + 0xd8ca, 0x2741, + 0xd8cb, 0x3021, + 0xd8cc, 0x1001, + 0xd8cd, 0xc502, + 0xd8ce, 0x53ac, + 0xd8cf, 0xc503, + 0xd8d0, 0x2cd3, + 0xd8d1, 0xc600, + 0xd8d2, 0x2a6e, + 0xd8d3, 0xc601, + 0xd8d4, 0x2a2c, + 0xd8d5, 0xc605, + 0xd8d6, 0x5557, + 0xd8d7, 0xc60c, + 0xd8d8, 0x5400, + 0xd8d9, 0xc710, + 0xd8da, 0x0700, + 0xd8db, 0xc711, + 0xd8dc, 0x0f06, + 0xd8dd, 0xc718, + 0xd8de, 0x700, + 0xd8df, 0xc719, + 0xd8e0, 0x0f06, + 0xd8e1, 0xc720, + 0xd8e2, 0x4700, + 0xd8e3, 0xc721, + 0xd8e4, 0x0f06, + 0xd8e5, 0xc728, + 0xd8e6, 0x0700, + 0xd8e7, 0xc729, + 0xd8e8, 0x1207, + 0xd8e9, 0xc801, + 0xd8ea, 0x7f50, + 0xd8eb, 0xc802, + 0xd8ec, 0x7760, + 0xd8ed, 0xc803, + 0xd8ee, 0x7fce, + 0xd8ef, 0xc804, + 0xd8f0, 0x520e, + 0xd8f1, 0xc805, + 0xd8f2, 0x5c11, + 0xd8f3, 0xc806, + 0xd8f4, 0x3c51, + 0xd8f5, 0xc807, + 0xd8f6, 0x4061, + 0xd8f7, 0xc808, + 0xd8f8, 0x49c1, + 0xd8f9, 0xc809, + 0xd8fa, 0x3840, + 0xd8fb, 0xc80a, + 0xd8fc, 0x0000, + 0xd8fd, 0xc821, + 0xd8fe, 0x0002, + 0xd8ff, 0xc822, + 0xd900, 0x0046, + 0xd901, 0xc844, + 0xd902, 0x182f, + 0xd903, 0xc849, + 0xd904, 0x0400, + 0xd905, 0xc84a, + 0xd906, 0x0002, + 0xd907, 0xc013, + 0xd908, 0xf341, + 0xd909, 0xc084, + 0xd90a, 0x0030, + 0xd90b, 0xc904, + 0xd90c, 0x1401, + 0xd90d, 0xcb0c, + 0xd90e, 0x0004, + 0xd90f, 0xcb0e, + 0xd910, 0xa00a, + 0xd911, 0xcb0f, + 0xd912, 0xc0c0, + 0xd913, 0xcb10, + 0xd914, 0xc0c0, + 0xd915, 0xcb11, + 0xd916, 0x00a0, + 0xd917, 0xcb12, + 0xd918, 0x0007, + 0xd919, 0xc241, + 0xd91a, 0xa000, + 0xd91b, 0xc243, + 0xd91c, 0x7fe0, + 0xd91d, 0xc604, + 0xd91e, 0x000e, + 0xd91f, 0xc609, + 0xd920, 0x00f5, + 0xd921, 0xc611, + 0xd922, 0x000e, + 0xd923, 0xc660, + 0xd924, 0x9600, + 0xd925, 0xc687, + 0xd926, 0x0004, + 0xd927, 0xc60a, + 0xd928, 0x04f5, + 0xd929, 0x0000, + 0xd92a, 0x2741, + 0xd92b, 0x3021, + 0xd92c, 0x1001, + 0xd92d, 0xc620, + 0xd92e, 0x14e5, + 0xd92f, 0xc621, + 0xd930, 0xc53d, + 0xd931, 0xc622, + 0xd932, 0x3cbe, + 0xd933, 0xc623, + 0xd934, 0x4452, + 0xd935, 0xc624, + 0xd936, 0xc5c5, + 0xd937, 0xc625, + 0xd938, 0xe01e, + 0xd939, 0xc627, + 0xd93a, 0x0000, + 0xd93b, 0xc628, 0xd93c, 0x0000, - 0xd93d, 0x2b84, - 0xd93e, 0x3c74, - 0xd93f, 0x6435, - 0xd940, 0xdff4, - 0xd941, 0x6435, - 0xd942, 0x2806, - 0xd943, 0x3006, - 0xd944, 0x8565, - 0xd945, 0x2b24, - 0xd946, 0x3c24, - 0xd947, 0x6436, - 0xd948, 0x1002, - 0xd949, 0x2b24, - 0xd94a, 0x3c24, - 0xd94b, 0x6436, - 0xd94c, 0x4045, - 0xd94d, 0x8656, - 0xd94e, 0x5663, - 0xd94f, 0x0302, - 0xd950, 0x401e, - 0xd951, 0x1002, - 0xd952, 0x2807, - 0xd953, 0x31a7, - 0xd954, 0x20c4, - 0xd955, 0x3c24, - 0xd956, 0x6724, - 0xd957, 0x1002, - 0xd958, 0x2807, - 0xd959, 0x3187, - 0xd95a, 0x20c4, - 0xd95b, 0x3c24, - 0xd95c, 0x6724, - 0xd95d, 0x1002, - 0xd95e, 0x24f4, - 0xd95f, 0x3c64, - 0xd960, 0x6436, - 0xd961, 0xdff4, - 0xd962, 0x6436, - 0xd963, 0x1002, - 0xd964, 0x2006, - 0xd965, 0x3d76, - 0xd966, 0xc161, - 0xd967, 0x6134, - 0xd968, 0x6135, - 0xd969, 0x5443, - 0xd96a, 0x0303, - 0xd96b, 0x6524, - 0xd96c, 0x00fb, + 0xd93d, 0xc62c, + 0xd93e, 0x0000, + 0xd93f, 0xc90a, + 0xd940, 0x3a7c, + 0xd941, 0x0000, + 0xd942, 0x2b84, + 0xd943, 0x3c74, + 0xd944, 0x6435, + 0xd945, 0xdff4, + 0xd946, 0x6435, + 0xd947, 0x2806, + 0xd948, 0x3006, + 0xd949, 0x8565, + 0xd94a, 0x2b24, + 0xd94b, 0x3c24, + 0xd94c, 0x6436, + 0xd94d, 0x1002, + 0xd94e, 0x2b24, + 0xd94f, 0x3c24, + 0xd950, 0x6436, + 0xd951, 0x4045, + 0xd952, 0x8656, + 0xd953, 0x5663, + 0xd954, 0x0302, + 0xd955, 0x401e, + 0xd956, 0x1002, + 0xd957, 0x2807, + 0xd958, 0x31a7, + 0xd959, 0x20c4, + 0xd95a, 0x3c24, + 0xd95b, 0x6724, + 0xd95c, 0x2ff7, + 0xd95d, 0x30f7, + 0xd95e, 0x20c4, + 0xd95f, 0x3c04, + 0xd960, 0x6724, + 0xd961, 0x1002, + 0xd962, 0x2807, + 0xd963, 0x3187, + 0xd964, 0x20c4, + 0xd965, 0x3c24, + 0xd966, 0x6724, + 0xd967, 0x2fe4, + 0xd968, 0x3dc4, + 0xd969, 0x6437, + 0xd96a, 0x20c4, + 0xd96b, 0x3c04, + 0xd96c, 0x6724, 0xd96d, 0x1002, - 0xd96e, 0x20d4, - 0xd96f, 0x3c24, - 0xd970, 0x2025, - 0xd971, 0x3005, - 0xd972, 0x6524, + 0xd96e, 0x24f4, + 0xd96f, 0x3c64, + 0xd970, 0x6436, + 0xd971, 0xdff4, + 0xd972, 0x6436, 0xd973, 0x1002, - 0xd974, 0xd019, - 0xd975, 0x2104, - 0xd976, 0x3c24, - 0xd977, 0x2105, - 0xd978, 0x3805, - 0xd979, 0x6524, - 0xd97a, 0xdff4, - 0xd97b, 0x4005, - 0xd97c, 0x6524, - 0xd97d, 0x2e8d, - 0xd97e, 0x303d, - 0xd97f, 0x2408, - 0xd980, 0x35d8, - 0xd981, 0x5dd3, - 0xd982, 0x0307, - 0xd983, 0x8887, - 0xd984, 0x63a7, - 0xd985, 0x8887, - 0xd986, 0x63a7, - 0xd987, 0xdffd, - 0xd988, 0x00f9, - 0xd989, 0x1002, - 0xd98a, 0x0000, + 0xd974, 0x2006, + 0xd975, 0x3d76, + 0xd976, 0xc161, + 0xd977, 0x6134, + 0xd978, 0x6135, + 0xd979, 0x5443, + 0xd97a, 0x0303, + 0xd97b, 0x6524, + 0xd97c, 0x00fb, + 0xd97d, 0x1002, + 0xd97e, 0x20d4, + 0xd97f, 0x3c24, + 0xd980, 0x2025, + 0xd981, 0x3005, + 0xd982, 0x6524, + 0xd983, 0x1002, + 0xd984, 0xd019, + 0xd985, 0x2104, + 0xd986, 0x3c24, + 0xd987, 0x2105, + 0xd988, 0x3805, + 0xd989, 0x6524, + 0xd98a, 0xdff4, + 0xd98b, 0x4005, + 0xd98c, 0x6524, + 0xd98d, 0x2e8d, + 0xd98e, 0x303d, + 0xd98f, 0x2408, + 0xd990, 0x35d8, + 0xd991, 0x5dd3, + 0xd992, 0x0307, + 0xd993, 0x8887, + 0xd994, 0x63a7, + 0xd995, 0x8887, + 0xd996, 0x63a7, + 0xd997, 0xdffd, + 0xd998, 0x00f9, + 0xd999, 0x1002, + 0xd99a, 0x866a, + 0xd99b, 0x6138, + 0xd99c, 0x5883, + 0xd99d, 0x2aa2, + 0xd99e, 0x3022, + 0xd99f, 0x1302, + 0xd9a0, 0x2ff7, + 0xd9a1, 0x3007, + 0xd9a2, 0x8785, + 0xd9a3, 0xb887, + 0xd9a4, 0x8786, + 0xd9a5, 0xb8c6, + 0xd9a6, 0x5a53, + 0xd9a7, 0x29b2, + 0xd9a8, 0x3022, + 0xd9a9, 0x13c2, + 0xd9aa, 0x2474, + 0xd9ab, 0x3c84, + 0xd9ac, 0x64d7, + 0xd9ad, 0x64d7, + 0xd9ae, 0x2ff5, + 0xd9af, 0x3c05, + 0xd9b0, 0x8757, + 0xd9b1, 0xb886, + 0xd9b2, 0x9767, + 0xd9b3, 0x67c4, + 0xd9b4, 0x6f72, + 0xd9b5, 0x1002, + 0xd9b6, 0x0000, }; int i, err; @@ -1944,10 +2000,14 @@ static struct reg_val ael2020_reset_regs { MDIO_DEV_PMA_PMD, 0xcd40, 0xffff, 0x0001 }, + { MDIO_DEV_PMA_PMD, 0xca12, 0xffff, 0x0100 }, + { MDIO_DEV_PMA_PMD, 0xca22, 0xffff, 0x0100 }, + { MDIO_DEV_PMA_PMD, 0xca42, 0xffff, 0x0100 }, { MDIO_DEV_PMA_PMD, 0xff02, 0xffff, 0x0023 }, { MDIO_DEV_PMA_PMD, 0xff03, 0xffff, 0x0000 }, { MDIO_DEV_PMA_PMD, 0xff04, 0xffff, 0x0000 }, + { MDIO_DEV_PMA_PMD, 0xc20d, 0xffff, 0x0002 }, /* end */ { 0, 0, 0, 0 } }; @@ -1975,6 +2035,7 @@ static int ael2020_reset(struct cphy *ph err = set_phy_regs(phy, ael2020_reset_regs); if (err) return err; + msleep(100); /* determine module type and perform appropriate initialization */ err = ael2020_get_module_type(phy, 0); @@ -2079,6 +2140,8 @@ int t3_ael2020_phy_prep(pinfo_t *pinfo, err = set_phy_regs(phy, ael2020_reset_regs); if (err) return err; + msleep(100); + err = ael2020_get_module_type(phy, 0); if (err >= 0) phy->modtype = err; Modified: stable/8/sys/dev/cxgb/common/cxgb_common.h ============================================================================== --- stable/8/sys/dev/cxgb/common/cxgb_common.h Mon Apr 5 22:15:06 2010 (r206219) +++ stable/8/sys/dev/cxgb/common/cxgb_common.h Mon Apr 5 23:29:27 2010 (r206220) @@ -314,6 +314,7 @@ struct qset_params { / unsigned int rspq_size; /* # of entries in response queue */ unsigned int fl_size; /* # of entries in regular free list */ unsigned int jumbo_size; /* # of entries in jumbo free list */ + unsigned int jumbo_buf_size; /* buffer size of jumbo entry */ unsigned int txq_size[SGE_TXQ_PER_SET]; /* Tx queue sizes */ unsigned int cong_thres; /* FL congestion threshold */ unsigned int vector; /* Interrupt (line or vector) number */ @@ -392,11 +393,9 @@ struct adapter_params { const struct adapter_info *info; -#ifdef CONFIG_CHELSIO_T3_CORE unsigned short mtus[NMTUS]; unsigned short a_wnd[NCCTRL_WIN]; unsigned short b_wnd[NCCTRL_WIN]; -#endif unsigned int nports; /* # of ethernet ports */ unsigned int chan_map; /* bitmap of in-use Tx channels */ unsigned int stats_update_period; /* MAC stats accumulation period */ @@ -650,11 +649,7 @@ static inline int is_10G(const adapter_t static inline int is_offload(const adapter_t *adap) { -#if defined(CONFIG_CHELSIO_T3_CORE) return adap->params.offload; -#else - return 0; -#endif } static inline unsigned int core_ticks_per_usec(const adapter_t *adap) @@ -772,7 +767,6 @@ void t3_mc5_intr_handler(struct mc5 *mc5 int t3_read_mc5_range(const struct mc5 *mc5, unsigned int start, unsigned int n, u32 *buf); -#ifdef CONFIG_CHELSIO_T3_CORE int t3_tp_set_coalescing_size(adapter_t *adap, unsigned int size, int psh); void t3_tp_set_max_rxsize(adapter_t *adap, unsigned int size); void t3_tp_get_mib_stats(adapter_t *adap, struct tp_mib_stats *tps); @@ -793,7 +787,6 @@ void t3_get_tx_sched(adapter_t *adap, un void t3_read_pace_tbl(adapter_t *adap, unsigned int pace_vals[NTX_SCHED]); void t3_set_pace_tbl(adapter_t *adap, unsigned int *pace_vals, unsigned int start, unsigned int n); -#endif int t3_get_up_la(adapter_t *adapter, u32 *stopped, u32 *index, u32 *size, void *data); Modified: stable/8/sys/dev/cxgb/common/cxgb_t3_hw.c ============================================================================== --- stable/8/sys/dev/cxgb/common/cxgb_t3_hw.c Mon Apr 5 22:15:06 2010 (r206219) +++ stable/8/sys/dev/cxgb/common/cxgb_t3_hw.c Mon Apr 5 23:29:27 2010 (r206220) @@ -3263,7 +3263,6 @@ static void tp_set_timers(adapter_t *ada #undef SECONDS } -#ifdef CONFIG_CHELSIO_T3_CORE /** * t3_tp_set_coalescing_size - set receive coalescing size * @adap: the adapter @@ -3566,7 +3565,6 @@ int t3_set_proto_sram(adapter_t *adap, c } return 0; } -#endif /** * t3_config_trace_filter - configure one of the tracing filters @@ -4150,14 +4148,12 @@ int t3_init_hw(adapter_t *adapter, u32 f if (tp_init(adapter, &adapter->params.tp)) goto out_err; -#ifdef CONFIG_CHELSIO_T3_CORE t3_tp_set_coalescing_size(adapter, min(adapter->params.sge.max_pkt_size, MAX_RX_COALESCING_LEN), 1); t3_tp_set_max_rxsize(adapter, min(adapter->params.sge.max_pkt_size, 16384U)); ulp_config(adapter, &adapter->params.tp); -#endif if (is_pcie(adapter)) config_pcie(adapter); else @@ -4471,8 +4467,6 @@ int __devinit t3_prep_adapter(adapter_t if (reset && t3_reset_adapter(adapter)) return -1; - t3_sge_prep(adapter, &adapter->params.sge); - if (adapter->params.vpd.mclk) { struct tp_params *p = &adapter->params.tp; @@ -4501,6 +4495,8 @@ int __devinit t3_prep_adapter(adapter_t t3_mc7_size(&adapter->pmtx) && t3_mc7_size(&adapter->cm); + t3_sge_prep(adapter, &adapter->params.sge); + if (is_offload(adapter)) { adapter->params.mc5.nservers = DEFAULT_NSERVERS; /* PR 6487. TOE and filtering are mutually exclusive */ @@ -4508,10 +4504,8 @@ int __devinit t3_prep_adapter(adapter_t adapter->params.mc5.nroutes = 0; t3_mc5_prep(adapter, &adapter->mc5, MC5_MODE_144_BIT); -#ifdef CONFIG_CHELSIO_T3_CORE init_mtus(adapter->params.mtus); init_cong_ctrl(adapter->params.a_wnd, adapter->params.b_wnd); -#endif } early_hw_init(adapter, ai); Modified: stable/8/sys/dev/cxgb/cxgb_adapter.h ============================================================================== --- stable/8/sys/dev/cxgb/cxgb_adapter.h Mon Apr 5 22:15:06 2010 (r206219) +++ stable/8/sys/dev/cxgb/cxgb_adapter.h Mon Apr 5 23:29:27 2010 (r206220) @@ -46,6 +46,7 @@ $FreeBSD$ #include #include #include +#include *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-8@FreeBSD.ORG Mon Apr 5 23:43:24 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4E274106564A; Mon, 5 Apr 2010 23:43:24 +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 3B6BD8FC0C; Mon, 5 Apr 2010 23:43:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o35NhONu079942; Mon, 5 Apr 2010 23:43:24 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o35NhO8B079938; Mon, 5 Apr 2010 23:43:24 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201004052343.o35NhO8B079938@svn.freebsd.org> From: Edwin Groothuis Date: Mon, 5 Apr 2010 23:43:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206221 - stable/8/share/zoneinfo X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Apr 2010 23:43:24 -0000 Author: edwin Date: Mon Apr 5 23:43:23 2010 New Revision: 206221 URL: http://svn.freebsd.org/changeset/base/206221 Log: MFC of tzdata2010h: From tzdata2010h: - Tunis will not go into DST this year. - Pakistan will not go into DST this year. From tzdata2010g: - Bangladesh cancels DST. - Palestine goes into DST one day later than expected. - Russian timezones update: Europe/Samara goes to Moscow time. Asia/Kamchatka goes to Moscow+8 time. Asia/Anadyr goes to Moscow+8 time. Modified: stable/8/share/zoneinfo/asia stable/8/share/zoneinfo/europe stable/8/share/zoneinfo/zone.tab Directory Properties: stable/8/share/zoneinfo/ (props changed) Modified: stable/8/share/zoneinfo/asia ============================================================================== --- stable/8/share/zoneinfo/asia Mon Apr 5 23:29:27 2010 (r206220) +++ stable/8/share/zoneinfo/asia Mon Apr 5 23:43:23 2010 (r206221) @@ -1,4 +1,4 @@ -# @(#)asia 8.56 +# @(#)asia 8.58 # This file is in the public domain, so clarified as of # 2009-05-17 by Arthur David Olson. @@ -214,42 +214,20 @@ Zone Asia/Bahrain 3:22:20 - LMT 1920 # # 2010 midnight. The decision came at a cabinet meeting at the Prime # Minister's Office last night..." -# From Danvin Ruangchan (2009-12-24): -# ...the news mentions DST will be turned off again 7 months after March -# 31st on Oct 31, 2010. - -# From Arthur David Olson (2009-12-26): -# Indeed, "The government will advance again the Banglasdesh Standard -# Time by one one hour on March 31 next year by enforcing the Daylight -# Saving Time (DST) for seven months. It will continue till October 31 -# until further notice." I take that last sentence as the -# establishment of a rule. - -# From Nobutomo Nakano (2010-02-19): -# We received a report from Bangladesh saying that the start/end of -# Bangladesh DST is incorrect. Currently we have only the Bengali version -# of the official mail from BTRC which describes the following: -# -# "From 2010 each year when local standard time is about to reach -# March 31 at 10:59:00 PM clocks are turned forward 1 hour (11:59:00 PM) -# and when local daylight time is about to October 31 at 11:59:00 PM -# clocks are turned backward 1 hour (10:59:00 PM)." -# -# So, DST will start/end 1 minute earlier. - -# From Arthur David Olson (2010-03-03): -# The file -# -# http://www.cabinet.gov/bd/file_upload/news_events/en_169.pdf +# From Alexander Krivenyshev (2010-03-22): +# According to Bangladesh newspaper "The Daily Star," +# Cabinet cancels Daylight Saving Time +# +# http://www.thedailystar.net/newDesign/latest_news.php?nid=22817 +# +# or +# +# http://www.worldtimezone.com/dst_news/dst_news_bangladesh06.html # -# is in Bengali; it does contain two "31"s as well as two "11.59"s and a "10.59" -# which is consistent with the information provided by Nobutomo Nakano. # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Dhaka 2009 only - Jun 19 23:00 1:00 S Rule Dhaka 2009 only - Dec 31 23:59 0 - -Rule Dhaka 2010 max - Mar 31 22:59 1:00 S -Rule Dhaka 2010 max - Oct 31 23:59 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Dhaka 6:01:40 - LMT 1890 @@ -2129,6 +2107,32 @@ Zone Asia/Karachi 4:28:12 - LMT 1907 # http://www.worldtimezone.com/dst_news/dst_news_gazastrip02.html # +# From Alexander Krivenyshev (2010-03-19): +# According to Voice of Palestine DST will last for 191 days, from March +# 26, 2010 till "the last Sunday before the tenth day of Tishri +# (October), each year" (October 03, 2010?) +# +# +# http://palvoice.org/forums/showthread.php?t=245697 +# +# (in Arabic) +# or +# +# http://www.worldtimezone.com/dst_news/dst_news_westbank03.html +# + +# From Steffen Thorsen (2010-03-24): +# ...Ma'an News Agency reports that Hamas cabinet has decided it will +# start one day later, at 12:01am. Not sure if they really mean 12:01am or +# noon though: +# +# +# http://www.maannews.net/eng/ViewDetails.aspx?ID=271178 +# +# (Ma'an News Agency) +# "At 12:01am Friday, clocks in Israel and the West Bank will change to +# 1:01am, while Gaza clocks will change at 12:01am Saturday morning." + # The rules for Egypt are stolen from the `africa' file. # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule EgyptAsia 1957 only - May 10 0:00 1:00 S @@ -2146,7 +2150,8 @@ Rule Palestine 2006 2008 - Apr 1 0:00 1 Rule Palestine 2006 only - Sep 22 0:00 0 - Rule Palestine 2007 only - Sep Thu>=8 2:00 0 - Rule Palestine 2008 only - Aug lastFri 2:00 0 - -Rule Palestine 2009 max - Mar lastFri 0:00 1:00 S +Rule Palestine 2009 only - Mar lastFri 0:00 1:00 S +Rule Palestine 2010 max - Mar lastSat 0:01 1:00 S Rule Palestine 2009 max - Sep Fri>=1 2:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Modified: stable/8/share/zoneinfo/europe ============================================================================== --- stable/8/share/zoneinfo/europe Mon Apr 5 23:29:27 2010 (r206220) +++ stable/8/share/zoneinfo/europe Mon Apr 5 23:43:23 2010 (r206221) @@ -1,5 +1,5 @@ #
-# @(#)europe	8.25
+# @(#)europe	8.26
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -2041,7 +2041,9 @@ Zone Europe/Samara	 3:20:36 -	LMT	1919 J
 			 3:00	Russia	KUY%sT	1991 Mar 31 2:00s
 			 2:00	Russia	KUY%sT	1991 Sep 29 2:00s
 			 3:00	-	KUYT	1991 Oct 20 3:00
-			 4:00	Russia	SAM%sT	# Samara Time
+			 4:00	Russia	SAM%sT	2010 Mar 28 2:00s # Samara Time
+			 3:00	Russia	SAM%sT
+
 #
 # From Oscar van Vlijmen (2001-08-25): [This region consists of]
 # Respublika Bashkortostan, Komi-Permyatskij avtonomnyj okrug,
@@ -2194,7 +2196,8 @@ Zone Asia/Kamchatka	10:34:36 -	LMT	1922 
 			11:00	-	PETT	1930 Jun 21 # P-K Time
 			12:00	Russia	PET%sT	1991 Mar 31 2:00s
 			11:00	Russia	PET%sT	1992 Jan 19 2:00s
-			12:00	Russia	PET%sT
+			12:00	Russia	PET%sT	2010 Mar 28 2:00s
+			11:00	Russia	PET%sT
 #
 # Chukotskij avtonomnyj okrug
 Zone Asia/Anadyr	11:49:56 -	LMT	1924 May  2
@@ -2202,7 +2205,8 @@ Zone Asia/Anadyr	11:49:56 -	LMT	1924 May
 			13:00	Russia	ANA%sT	1982 Apr  1 0:00s
 			12:00	Russia	ANA%sT	1991 Mar 31 2:00s
 			11:00	Russia	ANA%sT	1992 Jan 19 2:00s
-			12:00	Russia	ANA%sT
+			12:00	Russia	ANA%sT	2010 Mar 28 2:00s
+			11:00	Russia	ANA%sT
 
 # Serbia
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]

Modified: stable/8/share/zoneinfo/zone.tab
==============================================================================
--- stable/8/share/zoneinfo/zone.tab	Mon Apr  5 23:29:27 2010	(r206220)
+++ stable/8/share/zoneinfo/zone.tab	Mon Apr  5 23:43:23 2010	(r206221)
@@ -1,5 +1,5 @@
 # 
-# @(#)zone.tab	8.34
+# @(#)zone.tab	8.35
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 #
@@ -330,7 +330,7 @@ RS	+4450+02030	Europe/Belgrade
 RU	+5443+02030	Europe/Kaliningrad	Moscow-01 - Kaliningrad
 RU	+5545+03735	Europe/Moscow	Moscow+00 - west Russia
 RU	+4844+04425	Europe/Volgograd	Moscow+00 - Caspian Sea
-RU	+5312+05009	Europe/Samara	Moscow+01 - Samara, Udmurtia
+RU	+5312+05009	Europe/Samara	Moscow - Samara, Udmurtia
 RU	+5651+06036	Asia/Yekaterinburg	Moscow+02 - Urals
 RU	+5500+07324	Asia/Omsk	Moscow+03 - west Siberia
 RU	+5502+08255	Asia/Novosibirsk	Moscow+03 - Novosibirsk
@@ -341,8 +341,8 @@ RU	+6200+12940	Asia/Yakutsk	Moscow+06 - 
 RU	+4310+13156	Asia/Vladivostok	Moscow+07 - Amur River
 RU	+4658+14242	Asia/Sakhalin	Moscow+07 - Sakhalin Island
 RU	+5934+15048	Asia/Magadan	Moscow+08 - Magadan
-RU	+5301+15839	Asia/Kamchatka	Moscow+09 - Kamchatka
-RU	+6445+17729	Asia/Anadyr	Moscow+10 - Bering Sea
+RU	+5301+15839	Asia/Kamchatka	Moscow+08 - Kamchatka
+RU	+6445+17729	Asia/Anadyr	Moscow+08 - Bering Sea
 RW	-0157+03004	Africa/Kigali
 SA	+2438+04643	Asia/Riyadh
 SB	-0932+16012	Pacific/Guadalcanal

From owner-svn-src-stable-8@FreeBSD.ORG  Mon Apr  5 23:55:04 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 82C8E1065670;
	Mon,  5 Apr 2010 23:55:04 +0000 (UTC) (envelope-from np@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 69F318FC08;
	Mon,  5 Apr 2010 23:55:04 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o35Nt4oT083097;
	Mon, 5 Apr 2010 23:55:04 GMT (envelope-from np@svn.freebsd.org)
Received: (from np@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o35Nt4Mc083091;
	Mon, 5 Apr 2010 23:55:04 GMT (envelope-from np@svn.freebsd.org)
Message-Id: <201004052355.o35Nt4Mc083091@svn.freebsd.org>
From: Navdeep Parhar 
Date: Mon, 5 Apr 2010 23:55:04 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206224 - stable/8/usr.sbin/cxgbtool
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Mon, 05 Apr 2010 23:55:04 -0000

Author: np
Date: Mon Apr  5 23:55:04 2010
New Revision: 206224
URL: http://svn.freebsd.org/changeset/base/206224

Log:
  MFC r204267: Allow cxgbtool to build with WARNS=6

Modified:
  stable/8/usr.sbin/cxgbtool/cxgbtool.c
  stable/8/usr.sbin/cxgbtool/reg_defs.c
  stable/8/usr.sbin/cxgbtool/reg_defs_t3.c
  stable/8/usr.sbin/cxgbtool/reg_defs_t3b.c
  stable/8/usr.sbin/cxgbtool/reg_defs_t3c.c
Directory Properties:
  stable/8/usr.sbin/cxgbtool/   (props changed)

Modified: stable/8/usr.sbin/cxgbtool/cxgbtool.c
==============================================================================
--- stable/8/usr.sbin/cxgbtool/cxgbtool.c	Mon Apr  5 23:45:25 2010	(r206223)
+++ stable/8/usr.sbin/cxgbtool/cxgbtool.c	Mon Apr  5 23:55:04 2010	(r206224)
@@ -85,7 +85,8 @@ struct reg_info { 
 
 static const char *progname;
 
-static void __attribute__((noreturn)) usage(FILE *fp)
+static void
+usage(FILE *fp)
 {
 	fprintf(fp, "Usage: %s  [operation]\n", progname);
 	fprintf(fp,
@@ -136,7 +137,8 @@ doit(const char *iff_name, unsigned long
 	return ioctl(fd, cmd, data) < 0 ? -1 : 0;
 }
 
-static int get_int_arg(const char *s, uint32_t *valp)
+static int
+get_int_arg(const char *s, uint32_t *valp)
 {
 	char *p;
 
@@ -172,11 +174,12 @@ write_reg(const char *iff_name, uint32_t
 		err(1, "register write");
 }
 
-static int register_io(int argc, char *argv[], int start_arg,
+static int
+register_io(int argc, char *argv[], int start_arg,
 		       const char *iff_name)
 {
 	char *p;
-	uint32_t addr, val = 0, write = 0;
+	uint32_t addr, val = 0, w = 0;
 
 	if (argc != start_arg + 1) return -1;
 
@@ -184,14 +187,14 @@ static int register_io(int argc, char *a
 	if (p == argv[start_arg]) return -1;
 	if (*p == '=' && p[1]) {
 		val = strtoul(p + 1, &p, 0);
-		write = 1;
+		w = 1;
 	}
 	if (*p) {
 		warnx("bad parameter \"%s\"", argv[start_arg]);
 		return -1;
 	}
 
-	if (write)
+	if (w)
 		write_reg(iff_name, addr, val);
 	else {
 		val = read_reg(iff_name, addr);
@@ -200,9 +203,9 @@ static int register_io(int argc, char *a
 	return 0;
 }
 
-static int mdio_io(int argc, char *argv[], int start_arg, const char *iff_name) 
+static int
+mdio_io(int argc, char *argv[], int start_arg, const char *iff_name) 
 { 
-        struct ifreq ifr; 
         struct ch_mii_data p;
         unsigned int cmd, phy_addr, reg, mmd, val; 
  
@@ -230,12 +233,14 @@ static int mdio_io(int argc, char *argv[
         return 0; 
 } 
 
-static inline uint32_t xtract(uint32_t val, int shift, int len)
+static inline
+uint32_t xtract(uint32_t val, int shift, int len)
 {
 	return (val >> shift) & ((1 << len) - 1);
 }
 
-static int dump_block_regs(const struct reg_info *reg_array, uint32_t *regs)
+static int
+dump_block_regs(const struct reg_info *reg_array, uint32_t *regs)
 {
 	uint32_t reg_val = 0; // silence compiler warning
 
@@ -254,7 +259,8 @@ static int dump_block_regs(const struct 
 	return 1;
 }
 
-static int dump_regs_t2(int argc, char *argv[], int start_arg, uint32_t *regs)
+static int
+dump_regs_t2(int argc, char *argv[], int start_arg, uint32_t *regs)
 {
 	int match = 0;
 	char *block_name = NULL;
@@ -292,8 +298,8 @@ static int dump_regs_t2(int argc, char *
 }
 
 #if defined(CONFIG_T3_REGS)
-static int dump_regs_t3(int argc, char *argv[], int start_arg, uint32_t *regs,
-			int is_pcie)
+static int
+dump_regs_t3(int argc, char *argv[], int start_arg, uint32_t *regs, int is_pcie)
 {
 	int match = 0;
 	char *block_name = NULL;
@@ -353,8 +359,9 @@ static int dump_regs_t3(int argc, char *
 	return 0;
 }
 
-static int dump_regs_t3b(int argc, char *argv[], int start_arg, uint32_t *regs,
-			 int is_pcie)
+static int
+dump_regs_t3b(int argc, char *argv[], int start_arg, uint32_t *regs,
+    int is_pcie)
 {
 	int match = 0;
 	char *block_name = NULL;
@@ -414,8 +421,9 @@ static int dump_regs_t3b(int argc, char 
 	return 0;
 }
 
-static int dump_regs_t3c(int argc, char *argv[], int start_arg, uint32_t *regs,
-			 int is_pcie)
+static int
+dump_regs_t3c(int argc, char *argv[], int start_arg, uint32_t *regs,
+    int is_pcie)
 {
 	int match = 0;
 	char *block_name = NULL;
@@ -479,7 +487,7 @@ static int dump_regs_t3c(int argc, char 
 static int
 dump_regs(int argc, char *argv[], int start_arg, const char *iff_name)
 {
-	int i, vers, revision, is_pcie;
+	int vers, revision, is_pcie;
 	struct ch_ifconf_regs regs;
 
 	regs.len = REGDUMP_SIZE;
@@ -514,7 +522,8 @@ dump_regs(int argc, char *argv[], int st
 	return 0;
 }
 
-static int t3_meminfo(const uint32_t *regs)
+static int
+t3_meminfo(const uint32_t *regs)
 {
 	enum {
 		SG_EGR_CNTX_BADDR       = 0x58,
@@ -592,11 +601,16 @@ static int t3_meminfo(const uint32_t *re
 	return 0;
 }
 
-static int meminfo(int argc, char *argv[], int start_arg, const char *iff_name)
+static int
+meminfo(int argc, char *argv[], int start_arg, const char *iff_name)
 {
 	int vers;
 	struct ch_ifconf_regs regs;
 
+	(void) argc;
+	(void) argv;
+	(void) start_arg;
+
 	regs.len = REGDUMP_SIZE;
 	if ((regs.data = malloc(regs.len)) == NULL)
 		err(1, "can't malloc");
@@ -612,11 +626,11 @@ static int meminfo(int argc, char *argv[
 	return 0;
 }
 
-static int mtu_tab_op(int argc, char *argv[], int start_arg,
-		      const char *iff_name)
+static int
+mtu_tab_op(int argc, char *argv[], int start_arg, const char *iff_name)
 {
 	struct ch_mtus m;
-	int i;
+	unsigned int i;
 
 	if (argc == start_arg) {
 		if (doit(iff_name, CHELSIO_GETMTUTAB, &m) < 0)
@@ -649,13 +663,14 @@ static int mtu_tab_op(int argc, char *ar
 }
 
 #ifdef CHELSIO_INTERNAL
-static void show_egress_cntxt(uint32_t data[])
+static void
+show_egress_cntxt(uint32_t data[])
 {
 	printf("credits:      %u\n", data[0] & 0x7fff);
 	printf("GTS:          %u\n", (data[0] >> 15) & 1);
 	printf("index:        %u\n", data[0] >> 16);
 	printf("queue size:   %u\n", data[1] & 0xffff);
-	printf("base address: 0x%llx\n",
+	printf("base address: 0x%" PRIx64 "\n",
 	       ((data[1] >> 16) | ((uint64_t)data[2] << 16) |
 	       (((uint64_t)data[3] & 0xf) << 48)) << 12);
 	printf("rsp queue #:  %u\n", (data[3] >> 4) & 7);
@@ -667,9 +682,10 @@ static void show_egress_cntxt(uint32_t d
 	printf("valid:        %u\n", (data[3] >> 31) & 1);
 }
 
-static void show_fl_cntxt(uint32_t data[])
+static void
+show_fl_cntxt(uint32_t data[])
 {
-	printf("base address: 0x%llx\n",
+	printf("base address: 0x%" PRIx64 "\n",
 	       ((uint64_t)data[0] | ((uint64_t)data[1] & 0xfffff) << 32) << 12);
 	printf("index:        %u\n", (data[1] >> 20) | ((data[2] & 0xf) << 12));
 	printf("queue size:   %u\n", (data[2] >> 4) & 0xffff);
@@ -680,11 +696,12 @@ static void show_fl_cntxt(uint32_t data[
 	printf("GTS:          %u\n", (data[3] >> 31) & 1);
 }
 
-static void show_response_cntxt(uint32_t data[])
+static void
+show_response_cntxt(uint32_t data[])
 {
 	printf("index:        %u\n", data[0] & 0xffff);
 	printf("size:         %u\n", data[0] >> 16);
-	printf("base address: 0x%llx\n",
+	printf("base address: 0x%" PRIx64 "\n",
 	       ((uint64_t)data[1] | ((uint64_t)data[2] & 0xfffff) << 32) << 12);
 	printf("MSI-X/RspQ:   %u\n", (data[2] >> 20) & 0x3f);
 	printf("intr enable:  %u\n", (data[2] >> 26) & 1);
@@ -694,11 +711,12 @@ static void show_response_cntxt(uint32_t
 	printf("FL threshold: %u\n", data[3]);
 }
 
-static void show_cq_cntxt(uint32_t data[])
+static void
+show_cq_cntxt(uint32_t data[])
 {
 	printf("index:            %u\n", data[0] & 0xffff);
 	printf("size:             %u\n", data[0] >> 16);
-	printf("base address:     0x%llx\n",
+	printf("base address:     0x%" PRIx64 "\n",
 	       ((uint64_t)data[1] | ((uint64_t)data[2] & 0xfffff) << 32) << 12);
 	printf("rsp queue #:      %u\n", (data[2] >> 20) & 0x3f);
 	printf("AN:               %u\n", (data[2] >> 26) & 1);
@@ -710,8 +728,8 @@ static void show_cq_cntxt(uint32_t data[
 	printf("credit threshold: %u\n", data[3] >> 16);
 }
 
-static int get_sge_context(int argc, char *argv[], int start_arg,
-			   const char *iff_name)
+static int
+get_sge_context(int argc, char *argv[], int start_arg, const char *iff_name)
 {
 	struct ch_cntxt ctx;
 
@@ -750,8 +768,8 @@ static int get_sge_context(int argc, cha
 
 #define ntohll(x) be64toh((x))
 
-static int get_sge_desc(int argc, char *argv[], int start_arg,
-			const char *iff_name)
+static int
+get_sge_desc(int argc, char *argv[], int start_arg, const char *iff_name)
 {
 	uint64_t *p, wr_hdr;
 	unsigned int n = 1, qset, qnum;
@@ -796,7 +814,8 @@ static int get_sge_desc(int argc, char *
 }
 #endif
 
-static int get_tcb2(int argc, char *argv[], int start_arg, const char *iff_name)
+static int
+get_tcb2(int argc, char *argv[], int start_arg, const char *iff_name)
 {
 	uint64_t *d;
 	unsigned int i;
@@ -835,8 +854,9 @@ static int get_tcb2(int argc, char *argv
 	return 0;
 }
 
-static int get_pm_page_spec(const char *s, unsigned int *page_size,
-			    unsigned int *num_pages)
+static int
+get_pm_page_spec(const char *s, unsigned int *page_size,
+    unsigned int *num_pages)
 {
 	char *p;
 	unsigned long val;
@@ -854,7 +874,8 @@ static int get_pm_page_spec(const char *
 	return *p;
 }
 
-static int conf_pm(int argc, char *argv[], int start_arg, const char *iff_name)
+static int
+conf_pm(int argc, char *argv[], int start_arg, const char *iff_name)
 {
 	struct ch_pm pm;
 
@@ -884,8 +905,8 @@ static int conf_pm(int argc, char *argv[
 }
 
 #ifdef	CHELSIO_INTERNAL
-static int dump_tcam(int argc, char *argv[], int start_arg,
-		     const char *iff_name)
+static int
+dump_tcam(int argc, char *argv[], int start_arg, const char *iff_name)
 {
 	unsigned int nwords;
 	struct ch_tcam_word op;
@@ -907,7 +928,8 @@ static int dump_tcam(int argc, char *arg
 	return 0;
 }
 
-static void hexdump_8b(unsigned int start, uint64_t *data, unsigned int len)
+static void
+hexdump_8b(unsigned int start, uint64_t *data, unsigned int len)
 {
 	int i;
 
@@ -920,8 +942,8 @@ static void hexdump_8b(unsigned int star
 	}
 }
 
-static int dump_mc7(int argc, char *argv[], int start_arg,
-		    const char *iff_name)
+static int
+dump_mc7(int argc, char *argv[], int start_arg, const char *iff_name)
 {
 	struct ch_mem_range mem;
 	unsigned int mem_id, addr, len;
@@ -959,10 +981,11 @@ static int dump_mc7(int argc, char *argv
 }
 #endif
 
-/* Max FW size is 32K including version, +4 bytes for the checksum. */
+/* Max FW size is 64K including version, +4 bytes for the checksum. */
 #define MAX_FW_IMAGE_SIZE (64 * 1024)
 
-static int load_fw(int argc, char *argv[], int start_arg, const char *iff_name)
+static int
+load_fw(int argc, char *argv[], int start_arg, const char *iff_name)
 {
 	int fd, len;
 	struct ch_mem_range op;
@@ -979,12 +1002,13 @@ static int load_fw(int argc, char *argv[
 	if (!op.buf)
 		err(1, "load firmware");
 
-	op.len = read(fd, op.buf, MAX_FW_IMAGE_SIZE + 1);
-	if (op.len < 0)
+	len = read(fd, op.buf, MAX_FW_IMAGE_SIZE + 1);
+	if (len < 0)
 		err(1, "load firmware");
- 	if (op.len > MAX_FW_IMAGE_SIZE)
+ 	if (len > MAX_FW_IMAGE_SIZE)
 		errx(1, "FW image too large");
 
+	op.len = len;
 	if (doit(iff_name, CHELSIO_LOAD_FW, &op) < 0)
 		err(1, "load firmware");
 	return 0;
@@ -993,8 +1017,8 @@ static int load_fw(int argc, char *argv[
 /* Max BOOT size is 255*512 bytes including the BIOS boot ROM basic header */
 #define MAX_BOOT_IMAGE_SIZE (0xff * 512)
 
-static int load_boot(int argc, char *argv[],
-		     int start_arg, const char *iff_name)
+static int
+load_boot(int argc, char *argv[], int start_arg, const char *iff_name)
 {
 	int fd, len;
 	struct ch_mem_range op;
@@ -1024,7 +1048,8 @@ static int load_boot(int argc, char *arg
 	return 0;
 }
 
-static int dump_proto_sram(const char *iff_name)
+static int
+dump_proto_sram(const char *iff_name)
 {
 	int i, j;
 	uint8_t buf[PROTO_SRAM_SIZE];
@@ -1054,15 +1079,20 @@ static int dump_proto_sram(const char *i
 	return 0;
 }
 
-static int proto_sram_op(int argc, char *argv[], int start_arg,
+static int
+proto_sram_op(int argc, char *argv[], int start_arg,
 			 const char *iff_name)
 {
+	(void) argv;
+	(void) start_arg;
+
 	if (argc == start_arg)
 		return dump_proto_sram(iff_name);
 	return -1;
 }
 
-static int dump_qset_params(const char *iff_name)
+static int
+dump_qset_params(const char *iff_name)
 {
 	struct ch_qset_params qp;
 
@@ -1084,10 +1114,10 @@ static int dump_qset_params(const char *
 	return 0;
 }
 
-static int qset_config(int argc, char *argv[], int start_arg,
-		       const char *iff_name)
+static int
+qset_config(int argc, char *argv[], int start_arg, const char *iff_name)
 {
-	struct ch_qset_params qp;
+	(void) argv;
 
 	if (argc == start_arg)
 		return dump_qset_params(iff_name);
@@ -1095,11 +1125,13 @@ static int qset_config(int argc, char *a
 	return -1;
 }
 
-static int qset_num_config(int argc, char *argv[], int start_arg,
-			   const char *iff_name)
+static int
+qset_num_config(int argc, char *argv[], int start_arg, const char *iff_name)
 {
 	struct ch_reg reg;
 
+	(void) argv;
+
 	if (argc == start_arg) {
 		if (doit(iff_name, CHELSIO_GET_QSET_NUM, ®) < 0)
 			err(1, "get qsets");
@@ -1113,7 +1145,8 @@ static int qset_num_config(int argc, cha
 /*
  * Parse a string containing an IP address with an optional network prefix.
  */
-static int parse_ipaddr(const char *s, uint32_t *addr, uint32_t *mask)
+static int
+parse_ipaddr(const char *s, uint32_t *addr, uint32_t *mask)
 {
 	char *p, *slash;
 	struct in_addr ia;
@@ -1143,7 +1176,8 @@ static int parse_ipaddr(const char *s, u
 /*
  * Parse a string containing a value and an optional colon separated mask.
  */
-static int parse_val_mask_param(const char *s, uint32_t *val, uint32_t *mask)
+static int
+parse_val_mask_param(const char *s, uint32_t *val, uint32_t *mask)
 {
 	char *p;
 
@@ -1156,14 +1190,15 @@ static int parse_val_mask_param(const ch
 	return *p ? -1 : 0;
 }
 
-static int parse_trace_param(const char *s, uint32_t *val, uint32_t *mask)
+static int
+parse_trace_param(const char *s, uint32_t *val, uint32_t *mask)
 {
 	return strchr(s, '.') ? parse_ipaddr(s, val, mask) :
 				parse_val_mask_param(s, val, mask);
 }
 
-static int trace_config(int argc, char *argv[], int start_arg,
-			const char *iff_name)
+static int
+trace_config(int argc, char *argv[], int start_arg, const char *iff_name)
 {
 	uint32_t val, mask;
 	struct ch_trace trace;
@@ -1238,7 +1273,8 @@ static int trace_config(int argc, char *
 	return 0;
 }
 
-static int get_sched_param(int argc, char *argv[], int pos, unsigned int *valp)
+static int
+get_sched_param(int argc, char *argv[], int pos, unsigned int *valp)
 {
 	if (pos + 1 >= argc)
 		errx(1, "missing value for %s", argv[pos]);
@@ -1247,7 +1283,8 @@ static int get_sched_param(int argc, cha
 	return 0;
 }
 
-static int tx_sched(int argc, char *argv[], int start_arg, const char *iff_name)
+static int
+tx_sched(int argc, char *argv[], int start_arg, const char *iff_name)
 {
 	struct ch_hw_sched op;
 	unsigned int idx, val;
@@ -1293,7 +1330,8 @@ static int tx_sched(int argc, char *argv
 	return 0;
 }
 
-static int pktsched(int argc, char *argv[], int start_arg, const char *iff_name)
+static int
+pktsched(int argc, char *argv[], int start_arg, const char *iff_name)
 {
 	struct ch_pktsched_params op;
 	unsigned int idx, min = -1, max, binding = -1;
@@ -1333,20 +1371,29 @@ static int pktsched(int argc, char *argv
 	return 0;
 }
 
-static int clear_stats(int argc, char *argv[], int start_arg,
-		       const char *iff_name)
+static int
+clear_stats(int argc, char *argv[], int start_arg, const char *iff_name)
 {
+	(void) argc;
+	(void) argv;
+	(void) start_arg;
+
 	if (doit(iff_name, CHELSIO_CLEAR_STATS, NULL) < 0)
 		 err(1, "clearstats");
 
 	return 0;
 }
 
-static int get_up_la(int argc, char *argv[], int start_arg, const char *iff_name)
+static int
+get_up_la(int argc, char *argv[], int start_arg, const char *iff_name)
 {
 	struct ch_up_la la;
 	int i, idx, max_idx, entries;
 
+	(void) argc;
+	(void) argv;
+	(void) start_arg;
+
 	la.stopped = 0;
 	la.idx = -1;
 	la.bufsize = LA_BUFSIZE;
@@ -1372,11 +1419,16 @@ static int get_up_la(int argc, char *arg
 	return 0;
 }
 
-static int get_up_ioqs(int argc, char *argv[], int start_arg, const char *iff_name)
+static int
+get_up_ioqs(int argc, char *argv[], int start_arg, const char *iff_name)
 {
 	struct ch_up_ioqs ioqs;
 	int i, entries;
 
+	(void) argc;
+	(void) argv;
+	(void) start_arg;
+
 	bzero(&ioqs, sizeof(ioqs));
 	ioqs.bufsize = IOQS_BUFSIZE;
 	ioqs.data = malloc(IOQS_BUFSIZE);
@@ -1465,10 +1517,12 @@ run_cmd(int argc, char *argv[], const ch
 static int
 run_cmd_loop(int argc, char *argv[], const char *iff_name)
 {
-	int n, i;
+	int n;
+	unsigned int i;
 	char buf[64];
 	char *args[8], *s;
 
+	(void) argc;
 	args[0] = argv[0];
 	args[1] = argv[1];
 
@@ -1481,11 +1535,8 @@ run_cmd_loop(int argc, char *argv[], con
 	for (;;) {
 		fprintf(stdout, "> ");
 		fflush(stdout);
-		n = read(STDIN_FILENO, buf, sizeof(buf));
-		if (n > sizeof(buf) - 1) {
-			fprintf(stdout, "too much input.\n");
-			return (0);
-		} else if (n <= 0)
+		n = read(STDIN_FILENO, buf, sizeof(buf) - 1);
+		if (n <= 0)
 			return (0);
 
 		if (buf[--n] != '\n')

Modified: stable/8/usr.sbin/cxgbtool/reg_defs.c
==============================================================================
--- stable/8/usr.sbin/cxgbtool/reg_defs.c	Mon Apr  5 23:45:25 2010	(r206223)
+++ stable/8/usr.sbin/cxgbtool/reg_defs.c	Mon Apr  5 23:55:04 2010	(r206224)
@@ -106,7 +106,7 @@ struct reg_info sge_regs[] = {
 		{ "Packet_Too_Big", 3, 1 },
 		{ "Packet_Mismatch", 4, 1 },
 	{ "SG_RESPACCUTIMER", 0xc0, 0 },
-	{ NULL }
+	{ NULL, 0, 0 }
 };
 
 struct reg_info mc3_regs[] = {
@@ -196,7 +196,7 @@ struct reg_info mc3_regs[] = {
 		{ "MC3_Uncorr_Err", 1, 1 },
 		{ "MC3_Parity_Err", 2, 8 },
 		{ "MC3_Addr_Err", 10, 1 },
-	{ NULL }
+	{ NULL, 0, 0 }
 };
 
 struct reg_info mc4_regs[] = {
@@ -276,7 +276,7 @@ struct reg_info mc4_regs[] = {
 		{ "MC4_Corr_Err", 0, 1 },
 		{ "MC4_Uncorr_Err", 1, 1 },
 		{ "MC4_Addr_Err", 2, 1 },
-	{ NULL }
+	{ NULL, 0, 0 }
 };
 
 struct reg_info tpi_regs[] = {
@@ -290,7 +290,7 @@ struct reg_info tpi_regs[] = {
 		{ "INT_DIR", 31, 1 },
 	{ "TPI_PAR", 0x29c, 0 },
 		{ "TPIPAR", 0, 7 },
-	{ NULL }
+	{ NULL, 0, 0 }
 };
 
 struct reg_info tp_regs[] = {
@@ -509,7 +509,7 @@ struct reg_info tp_regs[] = {
 		{ "DROP_TICKS_CNT", 4, 26 },
 		{ "NUM_PKTS_DROPPED", 0, 4 },
 	{ "TP_TX_DROP_COUNT", 0x4bc, 0 },
-	{ NULL }
+	{ NULL, 0, 0 }
 };
 
 struct reg_info rat_regs[] = {
@@ -532,7 +532,7 @@ struct reg_info rat_regs[] = {
 		{ "CspiFramingError", 1, 1 },
 		{ "SgeFramingError", 2, 1 },
 		{ "TpFramingError", 3, 1 },
-	{ NULL }
+	{ NULL, 0, 0 }
 };
 
 struct reg_info cspi_regs[] = {
@@ -560,7 +560,7 @@ struct reg_info cspi_regs[] = {
 		{ "TXDrop", 2, 1 },
 		{ "RXOverflow", 3, 1 },
 		{ "RAMParityErr", 4, 1 },
-	{ NULL }
+	{ NULL, 0, 0 }
 };
 
 struct reg_info espi_regs[] = {
@@ -660,7 +660,7 @@ struct reg_info espi_regs[] = {
 		{ "Error_Ack", 9, 1 },
 		{ "Unmapped_Err", 10, 1 },
 		{ "Transaction_Timer", 16, 8 },
-	{ NULL }
+	{ NULL, 0, 0 }
 };
 
 struct reg_info ulp_regs[] = {
@@ -682,7 +682,7 @@ struct reg_info ulp_regs[] = {
 		{ "Pm_E2C_Wrt_Full", 24, 1 },
 		{ "Pm_C2E_Wrt_Full", 25, 1 },
 	{ "ULP_PIO_CTRL", 0x998, 0 },
-	{ NULL }
+	{ NULL, 0, 0 }
 };
 
 struct reg_info pl_regs[] = {
@@ -712,7 +712,7 @@ struct reg_info pl_regs[] = {
 		{ "PL_Intr_CSPI", 9, 1 },
 		{ "PL_Intr_PCIX", 10, 1 },
 		{ "PL_Intr_EXT", 11, 1 },
-	{ NULL }
+	{ NULL, 0, 0 }
 };
 
 struct reg_info mc5_regs[] = {
@@ -833,5 +833,5 @@ struct reg_info mc5_regs[] = {
 	{ "MC5_DATA_WRITE_CMD", 0xcf4, 0 },
 	{ "MC5_DATA_READ_CMD", 0xcf8, 0 },
 	{ "MC5_MASK_WRITE_CMD", 0xcfc, 0 },
-	{ NULL }
+	{ NULL, 0, 0 }
 };

Modified: stable/8/usr.sbin/cxgbtool/reg_defs_t3.c
==============================================================================
--- stable/8/usr.sbin/cxgbtool/reg_defs_t3.c	Mon Apr  5 23:45:25 2010	(r206223)
+++ stable/8/usr.sbin/cxgbtool/reg_defs_t3.c	Mon Apr  5 23:55:04 2010	(r206224)
@@ -140,7 +140,7 @@ struct reg_info sge3_regs[] = {
 		{ "DrbPriThrsh", 0, 16 },
 	{ "SG_DEBUG_INDEX", 0x78, 0 },
 	{ "SG_DEBUG_DATA", 0x7c, 0 },
-	{ NULL }
+	{ NULL, 0, 0 }
 };
 
 struct reg_info pcix1_regs[] = {
@@ -212,7 +212,7 @@ struct reg_info pcix1_regs[] = {
 		{ "WakeUp0", 2, 1 },
 		{ "SleepMode1", 1, 1 },
 		{ "SleepMode0", 0, 1 },
-	{ NULL }
+	{ NULL, 0, 0 }
 };
 
 struct reg_info pcie0_regs[] = {
@@ -411,7 +411,7 @@ struct reg_info pcie0_regs[] = {
 		{ "BISTDone", 24, 8 },
 		{ "BISTCycleThresh", 3, 16 },
 		{ "BISTMode", 0, 3 },
-	{ NULL }
+	{ NULL, 0, 0 }
 };
 
 struct reg_info t3dbg_regs[] = {
@@ -557,7 +557,7 @@ struct reg_info t3dbg_regs[] = {
 		{ "PMON_CDEL_MANUAL", 4, 1 },
 		{ "PMON_MANUAL", 1, 1 },
 		{ "PMON_AUTO", 0, 1 },
-	{ NULL }
+	{ NULL, 0, 0 }
 };
 
 struct reg_info mc7_pmrx_regs[] = {
@@ -674,7 +674,7 @@ struct reg_info mc7_pmrx_regs[] = {
 		{ "PE", 2, 15 },
 		{ "UE", 1, 1 },
 		{ "CE", 0, 1 },
-	{ NULL }
+	{ NULL, 0, 0 }
 };
 
 struct reg_info mc7_pmtx_regs[] = {
@@ -791,7 +791,7 @@ struct reg_info mc7_pmtx_regs[] = {
 		{ "PE", 2, 15 },
 		{ "UE", 1, 1 },
 		{ "CE", 0, 1 },
-	{ NULL }
+	{ NULL, 0, 0 }
 };
 
 struct reg_info mc7_cm_regs[] = {
@@ -908,7 +908,7 @@ struct reg_info mc7_cm_regs[] = {
 		{ "PE", 2, 15 },
 		{ "UE", 1, 1 },
 		{ "CE", 0, 1 },
-	{ NULL }
+	{ NULL, 0, 0 }
 };
 
 struct reg_info cim_regs[] = {
@@ -1024,7 +1024,7 @@ struct reg_info cim_regs[] = {
 	{ "CIM_CDEBUGDATA", 0x2d0, 0 },
 		{ "CDebugDataH", 16, 16 },
 		{ "CDebugDataL", 0, 16 },
-	{ NULL }
+	{ NULL, 0, 0 }
 };
 
 struct reg_info tp1_regs[] = {
@@ -1384,7 +1384,7 @@ struct reg_info tp1_regs[] = {
 	{ "TP_EMBED_OP_FIELD3", 0x4f4, 0 },
 	{ "TP_EMBED_OP_FIELD4", 0x4f8, 0 },
 	{ "TP_EMBED_OP_FIELD5", 0x4fc, 0 },
-	{ NULL }
+	{ NULL, 0, 0 }
 };
 
 struct reg_info ulp2_rx_regs[] = {
@@ -1428,7 +1428,7 @@ struct reg_info ulp2_rx_regs[] = {
 	{ "ULPRX_RQ_ULIMIT", 0x538, 0 },
 	{ "ULPRX_PBL_LLIMIT", 0x53c, 0 },
 	{ "ULPRX_PBL_ULIMIT", 0x540, 0 },
-	{ NULL }
+	{ NULL, 0, 0 }
 };
 
 struct reg_info ulp2_tx_regs[] = {
@@ -1456,7 +1456,7 @@ struct reg_info ulp2_tx_regs[] = {
 	{ "ULPTX_DMA_WEIGHT", 0x5ac, 0 },
 		{ "D1_WEIGHT", 16, 16 },
 		{ "D0_WEIGHT", 0, 16 },
-	{ NULL }
+	{ NULL, 0, 0 }
 };
 
 struct reg_info pm1_rx_regs[] = {
@@ -1500,7 +1500,7 @@ struct reg_info pm1_rx_regs[] = {
 		{ "ocspi1_ofifo2x_Tx_framing_error", 6, 1 },
 		{ "iespi_par_error", 3, 3 },
 		{ "ocspi_par_error", 0, 3 },
-	{ NULL }
+	{ NULL, 0, 0 }
 };
 
 struct reg_info pm1_tx_regs[] = {
@@ -1544,7 +1544,7 @@ struct reg_info pm1_tx_regs[] = {
 		{ "oespi1_ofifo2x_Tx_framing_error", 6, 1 },
 		{ "icspi_par_error", 3, 3 },
 		{ "oespi_par_error", 0, 3 },
-	{ NULL }
+	{ NULL, 0, 0 }
 };
 
 struct reg_info mps0_regs[] = {
@@ -1585,7 +1585,7 @@ struct reg_info mps0_regs[] = {
 		{ "RXTpParErr", 4, 2 },
 		{ "TX1TpParErr", 2, 2 },
 		{ "TX0TpParErr", 0, 2 },
-	{ NULL }
+	{ NULL, 0, 0 }
 };
 
 struct reg_info cpl_switch_regs[] = {
@@ -1616,7 +1616,7 @@ struct reg_info cpl_switch_regs[] = {
 		{ "cpl_map_tbl_idx", 0, 8 },
 	{ "CPL_MAP_TBL_DATA", 0x65c, 0 },
 		{ "cpl_map_tbl_data", 0, 8 },
-	{ NULL }
+	{ NULL, 0, 0 }
 };
 
 struct reg_info smb0_regs[] = {
@@ -1682,7 +1682,7 @@ struct reg_info smb0_regs[] = {
 		{ "DebugDataL", 0, 16 },
 	{ "SMB_DEBUG_LA", 0x69c, 0 },
 		{ "DebugLAReqAddr", 0, 10 },
-	{ NULL }
+	{ NULL, 0, 0 }
 };
 
 struct reg_info i2cm0_regs[] = {
@@ -1695,7 +1695,7 @@ struct reg_info i2cm0_regs[] = {
 		{ "Ack", 30, 1 },
 		{ "Cont", 1, 1 },
 		{ "Op", 0, 1 },
-	{ NULL }
+	{ NULL, 0, 0 }
 };
 
 struct reg_info mi1_regs[] = {
@@ -1714,7 +1714,7 @@ struct reg_info mi1_regs[] = {
 		{ "Busy", 31, 1 },
 		{ "Inc", 2, 1 },
 		{ "Op", 0, 2 },
-	{ NULL }
+	{ NULL, 0, 0 }
 };
 
 struct reg_info jm1_regs[] = {
@@ -1727,7 +1727,7 @@ struct reg_info jm1_regs[] = {
 	{ "JM_OP", 0x6cc, 0 },
 		{ "Busy", 31, 1 },
 		{ "Cnt", 0, 5 },
-	{ NULL }
+	{ NULL, 0, 0 }
 };
 
 struct reg_info sf1_regs[] = {
@@ -1737,7 +1737,7 @@ struct reg_info sf1_regs[] = {
 		{ "Cont", 3, 1 },
 		{ "ByteCnt", 1, 2 },
 		{ "Op", 0, 1 },
-	{ NULL }
+	{ NULL, 0, 0 }
 };
 
 struct reg_info pl3_regs[] = {
@@ -1839,7 +1839,7 @@ struct reg_info pl3_regs[] = {
 	{ "PL_REV", 0x6f4, 0 },
 		{ "Rev", 0, 4 },
 	{ "PL_CLI", 0x6f8, 0 },
-	{ NULL }
+	{ NULL, 0, 0 }
 };
 
 struct reg_info mc5a_regs[] = {
@@ -2010,7 +2010,7 @@ struct reg_info mc5a_regs[] = {
 		{ "ReadCmd", 0, 20 },
 	{ "MC5_DB_MASK_WRITE_CMD", 0x7fc, 0 },
 		{ "MaskWr", 0, 16 },
-	{ NULL }
+	{ NULL, 0, 0 }
 };
 
 struct reg_info xgmac0_0_regs[] = {
@@ -2341,7 +2341,7 @@ struct reg_info xgmac0_0_regs[] = {
 	{ "XGM_RX_SPI4_SOP_EOP_CNT", 0x9ac, 0 },
 		{ "RxSPI4SopCnt", 16, 16 },
 		{ "RxSPI4EopCnt", 0, 16 },
-	{ NULL }
+	{ NULL, 0, 0 }
 };
 
 struct reg_info xgmac0_1_regs[] = {
@@ -2672,5 +2672,5 @@ struct reg_info xgmac0_1_regs[] = {
 	{ "XGM_RX_SPI4_SOP_EOP_CNT", 0xbac, 0 },
 		{ "RxSPI4SopCnt", 16, 16 },
 		{ "RxSPI4EopCnt", 0, 16 },
-	{ NULL }
+	{ NULL, 0, 0 }
 };

Modified: stable/8/usr.sbin/cxgbtool/reg_defs_t3b.c
==============================================================================
--- stable/8/usr.sbin/cxgbtool/reg_defs_t3b.c	Mon Apr  5 23:45:25 2010	(r206223)
+++ stable/8/usr.sbin/cxgbtool/reg_defs_t3b.c	Mon Apr  5 23:55:04 2010	(r206224)
@@ -150,7 +150,7 @@ struct reg_info t3b_sge3_regs[] = {
 		{ "DrbPriThrsh", 0, 16 },
 	{ "SG_DEBUG_INDEX", 0x78, 0 },
 	{ "SG_DEBUG_DATA", 0x7c, 0 },
-	{ NULL }
+	{ NULL, 0, 0 }
 };
 
 struct reg_info t3b_pcix1_regs[] = {
@@ -222,7 +222,7 @@ struct reg_info t3b_pcix1_regs[] = {
 		{ "WakeUp0", 2, 1 },
 		{ "SleepMode1", 1, 1 },
 		{ "SleepMode0", 0, 1 },
-	{ NULL }
+	{ NULL, 0, 0 }
 };
 
 struct reg_info t3b_pcie0_regs[] = {
@@ -376,7 +376,7 @@ struct reg_info t3b_pcie0_regs[] = {
 		{ "BeaconDetect", 2, 1 },
 		{ "RxDetect", 1, 1 },
 		{ "TxIdleDetect", 0, 1 },
-	{ NULL }
+	{ NULL, 0, 0 }
 };
 
 struct reg_info t3b_t3dbg_regs[] = {
@@ -557,7 +557,7 @@ struct reg_info t3b_t3dbg_regs[] = {
 		{ "BSEnLane1", 4, 1 },
 		{ "BSInSelLane0", 1, 2 },
 		{ "BSEnLane0", 0, 1 },
-	{ NULL }
+	{ NULL, 0, 0 }
 };
 
 struct reg_info t3b_mc7_pmrx_regs[] = {
@@ -678,7 +678,7 @@ struct reg_info t3b_mc7_pmrx_regs[] = {
 		{ "PE", 2, 15 },
 		{ "UE", 1, 1 },
 		{ "CE", 0, 1 },
-	{ NULL }
+	{ NULL, 0, 0 }
 };
 
 struct reg_info t3b_mc7_pmtx_regs[] = {
@@ -799,7 +799,7 @@ struct reg_info t3b_mc7_pmtx_regs[] = {
 		{ "PE", 2, 15 },
 		{ "UE", 1, 1 },
 		{ "CE", 0, 1 },
-	{ NULL }
+	{ NULL, 0, 0 }
 };
 
 struct reg_info t3b_mc7_cm_regs[] = {
@@ -920,7 +920,7 @@ struct reg_info t3b_mc7_cm_regs[] = {
 		{ "PE", 2, 15 },
 		{ "UE", 1, 1 },
 		{ "CE", 0, 1 },
-	{ NULL }
+	{ NULL, 0, 0 }
 };
 
 struct reg_info t3b_cim_regs[] = {
@@ -1047,7 +1047,7 @@ struct reg_info t3b_cim_regs[] = {
 		{ "PILADbgWrPtr", 0, 9 },
 	{ "CIM_PO_LA_DEBUGDATA", 0x2e8, 0 },
 	{ "CIM_PI_LA_DEBUGDATA", 0x2ec, 0 },
-	{ NULL }
+	{ NULL, 0, 0 }
 };
 
 struct reg_info t3b_tp1_regs[] = {
@@ -1453,7 +1453,7 @@ struct reg_info t3b_tp1_regs[] = {
 	{ "TP_EMBED_OP_FIELD3", 0x4f4, 0 },
 	{ "TP_EMBED_OP_FIELD4", 0x4f8, 0 },
 	{ "TP_EMBED_OP_FIELD5", 0x4fc, 0 },
-	{ NULL }
+	{ NULL, 0, 0 }
 };
 
 struct reg_info t3b_ulp2_rx_regs[] = {
@@ -1497,7 +1497,7 @@ struct reg_info t3b_ulp2_rx_regs[] = {
 	{ "ULPRX_RQ_ULIMIT", 0x538, 0 },
 	{ "ULPRX_PBL_LLIMIT", 0x53c, 0 },
 	{ "ULPRX_PBL_ULIMIT", 0x540, 0 },
-	{ NULL }
+	{ NULL, 0, 0 }
 };
 
 struct reg_info t3b_ulp2_tx_regs[] = {
@@ -1525,7 +1525,7 @@ struct reg_info t3b_ulp2_tx_regs[] = {
 	{ "ULPTX_DMA_WEIGHT", 0x5ac, 0 },
 		{ "D1_WEIGHT", 16, 16 },
 		{ "D0_WEIGHT", 0, 16 },
-	{ NULL }
+	{ NULL, 0, 0 }
 };
 
 struct reg_info t3b_pm1_rx_regs[] = {
@@ -1569,7 +1569,7 @@ struct reg_info t3b_pm1_rx_regs[] = {
 		{ "ocspi1_ofifo2x_Tx_framing_error", 6, 1 },
 		{ "iespi_par_error", 3, 3 },
 		{ "ocspi_par_error", 0, 3 },
-	{ NULL }

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

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Apr  6 00:46:49 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B441E1065675;
	Tue,  6 Apr 2010 00:46:49 +0000 (UTC)
	(envelope-from delphij@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A23468FC23;
	Tue,  6 Apr 2010 00:46:49 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o360kn7v094496;
	Tue, 6 Apr 2010 00:46:49 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o360knnT094494;
	Tue, 6 Apr 2010 00:46:49 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201004060046.o360knnT094494@svn.freebsd.org>
From: Xin LI 
Date: Tue, 6 Apr 2010 00:46:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206225 - stable/8/share/man/man3
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 06 Apr 2010 00:46:49 -0000

Author: delphij
Date: Tue Apr  6 00:46:49 2010
New Revision: 206225
URL: http://svn.freebsd.org/changeset/base/206225

Log:
  MFC r205520:
  
  Correct cross reference.

Modified:
  stable/8/share/man/man3/pthread_affinity_np.3
Directory Properties:
  stable/8/share/man/man3/   (props changed)

Modified: stable/8/share/man/man3/pthread_affinity_np.3
==============================================================================
--- stable/8/share/man/man3/pthread_affinity_np.3	Mon Apr  5 23:55:04 2010	(r206224)
+++ stable/8/share/man/man3/pthread_affinity_np.3	Tue Apr  6 00:46:49 2010	(r206225)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd January 12, 2010
+.Dd March 23, 2010
 .Dt PTHREAD_AFFINITY_NP 3
 .Os
 .Sh NAME
@@ -125,8 +125,8 @@ operation.
 .Xr cpuset_setid 2 ,
 .Xr CPU_SET 3 ,
 .Xr pthread 3 ,
-.Xr pthread_attr_get_affinity_np 3 ,
-.Xr pthread_attr_set_affinity_np 3
+.Xr pthread_attr_getaffinity_np 3 ,
+.Xr pthread_attr_setaffinity_np 3
 .Sh STANDARDS
 The
 .Nm pthread_getaffinity_np

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Apr  6 00:50:24 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C7B89106566B;
	Tue,  6 Apr 2010 00:50:23 +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 B5DB18FC15;
	Tue,  6 Apr 2010 00:50:23 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o360oNHv095359;
	Tue, 6 Apr 2010 00:50:23 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o360oNCS095357;
	Tue, 6 Apr 2010 00:50:23 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201004060050.o360oNCS095357@svn.freebsd.org>
From: Xin LI 
Date: Tue, 6 Apr 2010 00:50:23 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206227 - stable/8/sys/dev/ppc
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 06 Apr 2010 00:50:24 -0000

Author: delphij
Date: Tue Apr  6 00:50:23 2010
New Revision: 206227
URL: http://svn.freebsd.org/changeset/base/206227

Log:
  MFC r205534:
  
  Add PCI ID for MCS9901's parallel port.
  
  PR:		kern/144713
  Submitted by:	gcooper

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

Modified: stable/8/sys/dev/ppc/ppc_pci.c
==============================================================================
--- stable/8/sys/dev/ppc/ppc_pci.c	Tue Apr  6 00:47:33 2010	(r206226)
+++ stable/8/sys/dev/ppc/ppc_pci.c	Tue Apr  6 00:50:23 2010	(r206227)
@@ -89,6 +89,7 @@ static struct pci_id pci_ids[] = {
 	{ 0x84031415, "Oxford Semiconductor OX12PCI840 Parallel port", 0x10 },
 	{ 0x95131415, "Oxford Semiconductor OX16PCI954 Parallel port", 0x10 },
 	{ 0x98059710, "NetMos NM9805 1284 Printer port", 0x10 },
+	{ 0x99019710, "MosChip MCS9901 PCIe to Peripheral Controller", 0x10 },
 	{ 0xffff }
 };
 

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Apr  6 04:10:30 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3EC9F1065677;
	Tue,  6 Apr 2010 04:10:30 +0000 (UTC)
	(envelope-from jhay@meraka.csir.co.za)
Received: from zibbi.meraka.csir.co.za (unknown [IPv6:2001:4200:7000:2::1])
	by mx1.freebsd.org (Postfix) with ESMTP id 6DE348FC1E;
	Tue,  6 Apr 2010 04:10:29 +0000 (UTC)
Received: by zibbi.meraka.csir.co.za (Postfix, from userid 3973)
	id 28EEF39824; Tue,  6 Apr 2010 06:10:23 +0200 (SAST)
Date: Tue, 6 Apr 2010 06:10:23 +0200
From: John Hay 
To: Jack F Vogel 
Message-ID: <20100406041023.GA4829@zibbi.meraka.csir.co.za>
References: <201004052143.o35LhNFt052897@svn.freebsd.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <201004052143.o35LhNFt052897@svn.freebsd.org>
User-Agent: Mutt/1.4.2.3i
Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, svn-src-stable-8@freebsd.org
Subject: Re: svn commit: r206215 - in stable/8/sys/modules: em ixgbe
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 06 Apr 2010 04:10:30 -0000

Hi Jack,

On Mon, Apr 05, 2010 at 09:43:23PM +0000, Jack F Vogel wrote:
> Author: jfv
> Date: Mon Apr  5 21:43:22 2010
> New Revision: 206215
> URL: http://svn.freebsd.org/changeset/base/206215
> 
> Log:
>   Add missing module Makefile for ixgbe and em MFCs
> 
> Modified:
>   stable/8/sys/modules/em/Makefile
>   stable/8/sys/modules/ixgbe/Makefile

I notice that in ixgbe/Makefile KMOD is ixgbe. Should it not be if_ixgbe?
Most other network drivers have if_ in front. It is not because of this
commit because it is like that in current too. I also see ixgbe is not
listed in modules/Makefile, so it will not be built automatically with
the rest. Any reason not to add it?

Thanks

John
-- 
John Hay -- jhay@meraka.csir.co.za / jhay@FreeBSD.org

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Apr  6 05:41:49 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BBA9B106566C;
	Tue,  6 Apr 2010 05:41:49 +0000 (UTC)
	(envelope-from jfvogel@gmail.com)
Received: from mail-bw0-f216.google.com (mail-bw0-f216.google.com
	[209.85.218.216])
	by mx1.freebsd.org (Postfix) with ESMTP id 8B1F38FC23;
	Tue,  6 Apr 2010 05:41:45 +0000 (UTC)
Received: by bwz8 with SMTP id 8so3493754bwz.3
	for ; Mon, 05 Apr 2010 22:41:44 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:received:in-reply-to:references
	:date:received:message-id:subject:from:to:cc:content-type;
	bh=wLcajAg9Qzw/OEB7BXrOBeWE0LQgEwX1mE6GdsVmKkg=;
	b=csLRMXz2aJYjP6gPbDRjoJT+QuoDinSiRthVlwG6T2UZyg5/kziJvWOH4hraq6+XwQ
	vKf9NmxdlaJa35rlaOSBzXTc4cSXRGYfFfHu4zm6jReB5qTHcATsqSuzomnl0WomnpSO
	HNMVZABnfT5LRtXZZs/ov0LHqXL0Ruxy9utgQ=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type;
	b=J1KAXyT6CIEOswomahzQKac3wNOSxi8KzTmLAIACCBRPnS1MY7bZgNWOqAR6VpVQNm
	e6s1q0Tp27m98/kNHv5+brasj4qJ3lUZl6K0gw9BXODXrwE5suB2jVzrkjzIYFI6hrBf
	SLv/nSLDBnDVr2RbtMEmHEzcxFJmxuEXr+/uo=
MIME-Version: 1.0
Received: by 10.204.59.6 with HTTP; Mon, 5 Apr 2010 22:41:44 -0700 (PDT)
In-Reply-To: <20100406041023.GA4829@zibbi.meraka.csir.co.za>
References: <201004052143.o35LhNFt052897@svn.freebsd.org>
	<20100406041023.GA4829@zibbi.meraka.csir.co.za>
Date: Mon, 5 Apr 2010 22:41:44 -0700
Received: by 10.204.2.196 with SMTP id 4mr726042bkk.121.1270532504548; Mon, 05 
	Apr 2010 22:41:44 -0700 (PDT)
Message-ID: 
From: Jack Vogel 
To: John Hay 
Content-Type: text/plain; charset=ISO-8859-1
X-Content-Filtered-By: Mailman/MimeDel 2.1.5
Cc: Jack F Vogel , svn-src-stable@freebsd.org,
	svn-src-all@freebsd.org, src-committers@freebsd.org,
	svn-src-stable-8@freebsd.org
Subject: Re: svn commit: r206215 - in stable/8/sys/modules: em ixgbe
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 06 Apr 2010 05:41:49 -0000

Its been without the if_ prefix for a couple years :) However if enough
people's sense of propriety is offended I suppose I could change it.

As for adding it to the modules/Makefile, the main reason it was not
was that the users of 10G were very small, but that is changing so
I suppose its time to add it.  Will take care of that soon.

Jack


On Mon, Apr 5, 2010 at 9:10 PM, John Hay  wrote:

> Hi Jack,
>
> On Mon, Apr 05, 2010 at 09:43:23PM +0000, Jack F Vogel wrote:
> > Author: jfv
> > Date: Mon Apr  5 21:43:22 2010
> > New Revision: 206215
> > URL: http://svn.freebsd.org/changeset/base/206215
> >
> > Log:
> >   Add missing module Makefile for ixgbe and em MFCs
> >
> > Modified:
> >   stable/8/sys/modules/em/Makefile
> >   stable/8/sys/modules/ixgbe/Makefile
>
> I notice that in ixgbe/Makefile KMOD is ixgbe. Should it not be if_ixgbe?
> Most other network drivers have if_ in front. It is not because of this
> commit because it is like that in current too. I also see ixgbe is not
> listed in modules/Makefile, so it will not be built automatically with
> the rest. Any reason not to add it?
>
> Thanks
>
> John
> --
> John Hay -- jhay@meraka.csir.co.za / jhay@FreeBSD.org
>

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Apr  6 06:06:32 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8EF61106564A;
	Tue,  6 Apr 2010 06:06:32 +0000 (UTC)
	(envelope-from jhay@meraka.csir.co.za)
Received: from zibbi.meraka.csir.co.za (unknown [IPv6:2001:4200:7000:2::1])
	by mx1.freebsd.org (Postfix) with ESMTP id BC31E8FC15;
	Tue,  6 Apr 2010 06:06:31 +0000 (UTC)
Received: by zibbi.meraka.csir.co.za (Postfix, from userid 3973)
	id 7820F39824; Tue,  6 Apr 2010 08:06:25 +0200 (SAST)
Date: Tue, 6 Apr 2010 08:06:25 +0200
From: John Hay 
To: Jack Vogel 
Message-ID: <20100406060625.GA15546@zibbi.meraka.csir.co.za>
References: <201004052143.o35LhNFt052897@svn.freebsd.org>
	<20100406041023.GA4829@zibbi.meraka.csir.co.za>
	
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: Jack F Vogel , svn-src-stable@freebsd.org,
	svn-src-all@freebsd.org, src-committers@freebsd.org,
	svn-src-stable-8@freebsd.org
Subject: Re: svn commit: r206215 - in stable/8/sys/modules: em ixgbe
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 06 Apr 2010 06:06:32 -0000

On Mon, Apr 05, 2010 at 10:41:44PM -0700, Jack Vogel wrote:
> Its been without the if_ prefix for a couple years :) However if enough
> people's sense of propriety is offended I suppose I could change it.

I think because it was not hooked up in modules/Makefile before, it will
not be a problem to change it. :-)
> 
> As for adding it to the modules/Makefile, the main reason it was not
> was that the users of 10G were very small, but that is changing so
> I suppose its time to add it.  Will take care of that soon.

Thanks

John

> 
> Jack
> 
> 
> On Mon, Apr 5, 2010 at 9:10 PM, John Hay  wrote:
> 
> > Hi Jack,
> >
> > On Mon, Apr 05, 2010 at 09:43:23PM +0000, Jack F Vogel wrote:
> > > Author: jfv
> > > Date: Mon Apr  5 21:43:22 2010
> > > New Revision: 206215
> > > URL: http://svn.freebsd.org/changeset/base/206215
> > >
> > > Log:
> > >   Add missing module Makefile for ixgbe and em MFCs
> > >
> > > Modified:
> > >   stable/8/sys/modules/em/Makefile
> > >   stable/8/sys/modules/ixgbe/Makefile
> >
> > I notice that in ixgbe/Makefile KMOD is ixgbe. Should it not be if_ixgbe?
> > Most other network drivers have if_ in front. It is not because of this
> > commit because it is like that in current too. I also see ixgbe is not
> > listed in modules/Makefile, so it will not be built automatically with
> > the rest. Any reason not to add it?
> >
> > Thanks
> >
> > John
> > --
> > John Hay -- jhay@meraka.csir.co.za / jhay@FreeBSD.org
> >

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Apr  6 10:32:26 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CB3D51065678;
	Tue,  6 Apr 2010 10:32:26 +0000 (UTC)
	(envelope-from trasz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id BA2008FC15;
	Tue,  6 Apr 2010 10:32:26 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o36AWQIc033805;
	Tue, 6 Apr 2010 10:32:26 GMT (envelope-from trasz@svn.freebsd.org)
Received: (from trasz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o36AWQfE033803;
	Tue, 6 Apr 2010 10:32:26 GMT (envelope-from trasz@svn.freebsd.org)
Message-Id: <201004061032.o36AWQfE033803@svn.freebsd.org>
From: Edward Tomasz Napierala 
Date: Tue, 6 Apr 2010 10:32:26 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206262 - stable/8/secure
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 06 Apr 2010 10:32:26 -0000

Author: trasz
Date: Tue Apr  6 10:32:26 2010
New Revision: 206262
URL: http://svn.freebsd.org/changeset/base/206262

Log:
  MFC r201210:
  
  Remove pppd, it's gone.

Modified:
  stable/8/secure/Makefile
Directory Properties:
  stable/8/secure/   (props changed)
  stable/8/secure/usr.bin/bdes/   (props changed)

Modified: stable/8/secure/Makefile
==============================================================================
--- stable/8/secure/Makefile	Tue Apr  6 10:09:03 2010	(r206261)
+++ stable/8/secure/Makefile	Tue Apr  6 10:32:26 2010	(r206262)
@@ -7,8 +7,7 @@ SUBDIR= lib libexec usr.bin usr.sbin
 # These are the programs which depend on crypto, but not Kerberos.
 SPROGS=	lib/libfetch lib/libpam lib/libradius lib/libtelnet	\
 	bin/ed libexec/telnetd usr.bin/fetch usr.bin/telnet	\
-	usr.sbin/pkg_install usr.sbin/ppp usr.sbin/pppd		\
-	usr.sbin/tcpdump/tcpdump
+	usr.sbin/pkg_install usr.sbin/ppp usr.sbin/tcpdump/tcpdump
 .if ${MK_SENDMAIL} != "no"
 SPROGS+=usr.sbin/sendmail
 .endif

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Apr  6 10:34:15 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E1F8C106566B;
	Tue,  6 Apr 2010 10:34:15 +0000 (UTC)
	(envelope-from trasz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D0F7F8FC15;
	Tue,  6 Apr 2010 10:34:15 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o36AYFkO034449;
	Tue, 6 Apr 2010 10:34:15 GMT (envelope-from trasz@svn.freebsd.org)
Received: (from trasz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o36AYFdU034447;
	Tue, 6 Apr 2010 10:34:15 GMT (envelope-from trasz@svn.freebsd.org)
Message-Id: <201004061034.o36AYFdU034447@svn.freebsd.org>
From: Edward Tomasz Napierala 
Date: Tue, 6 Apr 2010 10:34:15 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206263 - stable/8/usr.sbin/crunch/examples
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 06 Apr 2010 10:34:16 -0000

Author: trasz
Date: Tue Apr  6 10:34:15 2010
New Revision: 206263
URL: http://svn.freebsd.org/changeset/base/206263

Log:
  MFC r201211:
  
  Remove pppd and SLIP-related stuff.

Modified:
  stable/8/usr.sbin/crunch/examples/really-big.conf
Directory Properties:
  stable/8/usr.sbin/crunch/examples/   (props changed)

Modified: stable/8/usr.sbin/crunch/examples/really-big.conf
==============================================================================
--- stable/8/usr.sbin/crunch/examples/really-big.conf	Tue Apr  6 10:32:26 2010	(r206262)
+++ stable/8/usr.sbin/crunch/examples/really-big.conf	Tue Apr  6 10:34:15 2010	(r206263)
@@ -27,7 +27,7 @@ progs badsect bim clri disklabel dmesg d
 progs ifconfig init mknod modload modunload mount mount_isofs
 progs mount_lofs mount_msdosfs mount_portalfs mountd
 progs newfs nfsd nfsiod ping quotacheck reboot restore route routed savecore
-progs shutdown slattach swapon ttyflags tunefs umount
+progs shutdown  swapon ttyflags tunefs umount
 # shell scripts: fastboot
 
 ln dump rdump
@@ -71,7 +71,7 @@ progs ac accton amd arp bad144 catman ch
 progs dev_mkdb diskpart edquota flcopy gettable grfinfo hilinfo htable inetd
 progs iostat iteconfig kvm_mkdb mtree named portmap pppd
 progs pstat pwd_mkdb quot quotaon rarpd rbootd repquota rmt rpc.bootparamd
-progs rwhod sa sliplogin slstats spray sysctl syslogd tcpdump
+progs rwhod sa spray sysctl syslogd tcpdump
 progs traceroute trpt trsp update vipw vnconfig ypbind yppoll ypset
 
 special amd srcdir /usr/src/usr.sbin/amd/amd

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Apr  6 10:58:40 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D9F38106564A;
	Tue,  6 Apr 2010 10:58:40 +0000 (UTC)
	(envelope-from trasz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C66258FC1A;
	Tue,  6 Apr 2010 10:58:40 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o36Awe6s041745;
	Tue, 6 Apr 2010 10:58:40 GMT (envelope-from trasz@svn.freebsd.org)
Received: (from trasz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o36Awex0041740;
	Tue, 6 Apr 2010 10:58:40 GMT (envelope-from trasz@svn.freebsd.org)
Message-Id: <201004061058.o36Awex0041740@svn.freebsd.org>
From: Edward Tomasz Napierala 
Date: Tue, 6 Apr 2010 10:58:40 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206265 - in stable/8: . etc/mtree share/examples
	share/examples/pppd share/examples/slattach
	share/examples/sliplogin share/examples/startslip
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 06 Apr 2010 10:58:41 -0000

Author: trasz
Date: Tue Apr  6 10:58:40 2010
New Revision: 206265
URL: http://svn.freebsd.org/changeset/base/206265

Log:
  MFC r201213:
  
  Remove examples for pppd and SLIP-related stuff.
  
  PR:		conf/144950

Deleted:
  stable/8/share/examples/pppd/
  stable/8/share/examples/slattach/
  stable/8/share/examples/sliplogin/
  stable/8/share/examples/startslip/
Modified:
  stable/8/ObsoleteFiles.inc   (contents, props changed)
  stable/8/etc/mtree/BSD.usr.dist
  stable/8/share/examples/Makefile
Directory Properties:
  stable/8/etc/mtree/   (props changed)
  stable/8/share/examples/   (props changed)

Modified: stable/8/ObsoleteFiles.inc
==============================================================================
--- stable/8/ObsoleteFiles.inc	Tue Apr  6 10:43:01 2010	(r206264)
+++ stable/8/ObsoleteFiles.inc	Tue Apr  6 10:58:40 2010	(r206265)
@@ -27,6 +27,29 @@ OLD_FILES+=usr/share/man/man1/gcpio.1.gz
 # 20100301: vesa and dpms promoted to be i386/amd64 common
 OLD_FILES+=usr/include/machine/pc/vesa.h
 OLD_FILES+=usr/share/man/man4/i386/dpms.4.gz
+# 20091229: remove no longer relevant examples
+OLD_FILES+=usr/share/examples/pppd/auth-down.sample
+OLD_FILES+=usr/share/examples/pppd/auth-up.sample
+OLD_FILES+=usr/share/examples/pppd/chap-secrets.sample
+OLD_FILES+=usr/share/examples/pppd/chat.sh.sample
+OLD_FILES+=usr/share/examples/pppd/ip-down.sample
+OLD_FILES+=usr/share/examples/pppd/ip-up.sample
+OLD_FILES+=usr/share/examples/pppd/options.sample
+OLD_FILES+=usr/share/examples/pppd/pap-secrets.sample
+OLD_FILES+=usr/share/examples/pppd/ppp.deny.sample
+OLD_FILES+=usr/share/examples/pppd/ppp.shells.sample
+OLD_DIRS+=usr/share/examples/pppd
+OLD_FILES+=usr/share/examples/slattach/unit-command.sh
+OLD_DIRS+=usr/share/examples/slattach
+OLD_FILES+=usr/share/examples/sliplogin/slip.hosts
+OLD_FILES+=usr/share/examples/sliplogin/slip.login
+OLD_FILES+=usr/share/examples/sliplogin/slip.logout
+OLD_FILES+=usr/share/examples/sliplogin/slip.slparms
+OLD_DIRS+=usr/share/examples/sliplogin
+OLD_FILES+=usr/share/examples/startslip/sldown.sh
+OLD_FILES+=usr/share/examples/startslip/slip.sh
+OLD_FILES+=usr/share/examples/startslip/slup.sh
+OLD_DIRS+=usr/share/examples/startslip
 # 20091218: removal of rc.early(8) link
 OLD_FILES+=usr/share/man/man8/rc.early.8.gz
 # 20091027: pselect.3 implemented as syscall

Modified: stable/8/etc/mtree/BSD.usr.dist
==============================================================================
--- stable/8/etc/mtree/BSD.usr.dist	Tue Apr  6 10:43:01 2010	(r206264)
+++ stable/8/etc/mtree/BSD.usr.dist	Tue Apr  6 10:58:40 2010	(r206265)
@@ -265,8 +265,6 @@
             ..
             ppp
             ..
-            pppd
-            ..
             printing
             ..
             scsi_target
@@ -283,16 +281,10 @@
                 srcs
                 ..
             ..
-            slattach
-            ..
-            sliplogin
-            ..
             smbfs
                 print
                 ..
             ..
-            startslip
-            ..
             sunrpc
                 dir
                 ..

Modified: stable/8/share/examples/Makefile
==============================================================================
--- stable/8/share/examples/Makefile	Tue Apr  6 10:43:01 2010	(r206264)
+++ stable/8/share/examples/Makefile	Tue Apr  6 10:58:40 2010	(r206265)
@@ -24,13 +24,9 @@ LDIRS=	BSD_daemon \
 	portal \
 	ppi \
 	ppp \
-	pppd \
 	printing \
 	ses \
 	scsi_target \
-	slattach \
-	sliplogin \
-	startslip \
 	sunrpc
 
 XFILES=	BSD_daemon/FreeBSD.pfa \
@@ -135,16 +131,6 @@ XFILES=	BSD_daemon/FreeBSD.pfa \
 	ppp/ppp.secret.sample \
 	ppp/ppp.secret.span-isp \
 	ppp/ppp.secret.span-isp.working \
-	pppd/auth-down.sample \
-	pppd/auth-up.sample \
-	pppd/chap-secrets.sample \
-	pppd/chat.sh.sample \
-	pppd/ip-down.sample \
-	pppd/ip-up.sample \
-	pppd/options.sample \
-	pppd/pap-secrets.sample \
-	pppd/ppp.deny.sample \
-	pppd/ppp.shells.sample \
 	printing/README \
 	printing/diablo-if-net \
 	printing/hpdf \
@@ -187,14 +173,6 @@ XFILES=	BSD_daemon/FreeBSD.pfa \
 	scsi_target/scsi_target.h \
 	scsi_target/scsi_target.8 \
 	scsi_target/scsi_cmds.c \
-	slattach/unit-command.sh \
-	sliplogin/slip.hosts \
-	sliplogin/slip.login \
-	sliplogin/slip.logout \
-	sliplogin/slip.slparms \
-	startslip/sldown.sh \
-	startslip/slip.sh \
-	startslip/slup.sh \
 	sunrpc/Makefile \
 	sunrpc/dir/Makefile \
 	sunrpc/dir/dir.x \

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Apr  6 13:04:27 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 92EE2106564A;
	Tue,  6 Apr 2010 13:04:27 +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 80E4A8FC13;
	Tue,  6 Apr 2010 13:04:27 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o36D4RN0072278;
	Tue, 6 Apr 2010 13:04:27 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o36D4R3I072276;
	Tue, 6 Apr 2010 13:04:27 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201004061304.o36D4R3I072276@svn.freebsd.org>
From: Rui Paulo 
Date: Tue, 6 Apr 2010 13:04:27 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206269 - stable/8/sbin/ifconfig
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 06 Apr 2010 13:04:27 -0000

Author: rpaulo
Date: Tue Apr  6 13:04:27 2010
New Revision: 206269
URL: http://svn.freebsd.org/changeset/base/206269

Log:
  MFC r205514:
   Add a missing LINE_BREAK() after printing the roaming parameters in
   verbose mode.
  
   Sponsored by:	iXsystems, inc.

Modified:
  stable/8/sbin/ifconfig/ifieee80211.c
Directory Properties:
  stable/8/sbin/ifconfig/   (props changed)

Modified: stable/8/sbin/ifconfig/ifieee80211.c
==============================================================================
--- stable/8/sbin/ifconfig/ifieee80211.c	Tue Apr  6 12:44:28 2010	(r206268)
+++ stable/8/sbin/ifconfig/ifieee80211.c	Tue Apr  6 13:04:27 2010	(r206269)
@@ -4516,6 +4516,7 @@ end:
 		} else {
 			LINE_BREAK();
 			list_roam(s);
+			LINE_BREAK();
 		}
 	}
 

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Apr  6 14:07:48 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A67C0106566C;
	Tue,  6 Apr 2010 14:07: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 93C0F8FC13;
	Tue,  6 Apr 2010 14:07:48 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o36E7mHi086380;
	Tue, 6 Apr 2010 14:07:48 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o36E7m67086378;
	Tue, 6 Apr 2010 14:07:48 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201004061407.o36E7m67086378@svn.freebsd.org>
From: Rui Paulo 
Date: Tue, 6 Apr 2010 14:07:48 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206271 - stable/8/sys/net80211
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 06 Apr 2010 14:07:48 -0000

Author: rpaulo
Date: Tue Apr  6 14:07:48 2010
New Revision: 206271
URL: http://svn.freebsd.org/changeset/base/206271

Log:
  MFC r203422, r205516:
  
   When receiving a management frame, pass the mbuf to bpf before calling
   iv_recv_mgmt(). iv_recv_mgmt() will generate management frame
   responses
   and pass them to bpf before the management frame that triggered the
   response.
  
   PR:		144323
   Submitted by:	Alexander Egorenkov 
   Sponsored by:	iXsystems, inc.

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

Modified: stable/8/sys/net80211/ieee80211_hostap.c
==============================================================================
--- stable/8/sys/net80211/ieee80211_hostap.c	Tue Apr  6 13:12:11 2010	(r206270)
+++ stable/8/sys/net80211/ieee80211_hostap.c	Tue Apr  6 14:07:48 2010	(r206271)
@@ -884,6 +884,14 @@ hostap_input(struct ieee80211_node *ni, 
 			wh = mtod(m, struct ieee80211_frame *);
 			wh->i_fc[1] &= ~IEEE80211_FC1_WEP;
 		}
+		/*
+		 * Pass the packet to radiotap before calling iv_recv_mgmt().
+		 * Otherwise iv_recv_mgmt() might pass another packet to
+		 * radiotap, resulting in out of order packet captures.
+		 */
+		if (ieee80211_radiotap_active_vap(vap))
+			ieee80211_radiotap_rx(vap, m);
+		need_tap = 0;
 		vap->iv_recv_mgmt(ni, m, subtype, rssi, nf);
 		goto out;
 

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Apr  6 17:57:27 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D26FB106564A;
	Tue,  6 Apr 2010 17:57:27 +0000 (UTC)
	(envelope-from kensmith@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A7A998FC0A;
	Tue,  6 Apr 2010 17:57:27 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o36HvRAZ037433;
	Tue, 6 Apr 2010 17:57:27 GMT (envelope-from kensmith@svn.freebsd.org)
Received: (from kensmith@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o36HvRv7037432;
	Tue, 6 Apr 2010 17:57:27 GMT (envelope-from kensmith@svn.freebsd.org)
Message-Id: <201004061757.o36HvRv7037432@svn.freebsd.org>
From: Ken Smith 
Date: Tue, 6 Apr 2010 17:57:27 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206278 - stable/8/release/scripts
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 06 Apr 2010 17:57:27 -0000

Author: kensmith
Date: Tue Apr  6 17:57:27 2010
New Revision: 206278
URL: http://svn.freebsd.org/changeset/base/206278

Log:
  Merge r204044:
  
  Provide a script that can be used to create the memstick images.

Added:
  stable/8/release/scripts/make-memstick.sh
     - copied unchanged from r204044, head/release/scripts/make-memstick.sh
Modified:
Directory Properties:
  stable/8/release/   (props changed)
  stable/8/release/picobsd/   (props changed)
  stable/8/release/picobsd/floppy.tree/sbin/   (props changed)
  stable/8/release/picobsd/qemu/   (props changed)

Copied: stable/8/release/scripts/make-memstick.sh (from r204044, head/release/scripts/make-memstick.sh)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/8/release/scripts/make-memstick.sh	Tue Apr  6 17:57:27 2010	(r206278, copy of r204044, head/release/scripts/make-memstick.sh)
@@ -0,0 +1,83 @@
+#!/bin/sh
+#
+# This script generates a "memstick image" (image that can be copied to a
+# USB memory stick) from a directory tree.  Note that the script does not
+# clean up after itself very well for error conditions on purpose so the
+# problem can be diagnosed (full filesystem most likely but ...).
+#
+# Usage: make-memstick.sh  
+#
+# $FreeBSD$
+#
+
+PATH=/bin:/usr/bin:/sbin:/usr/sbin
+export PATH
+
+BLOCKSIZE=10240
+
+if [ $# -ne 2 ]; then
+  echo "make-memstick.sh /path/to/directory /path/to/image/file"
+  exit 1
+fi
+
+tempfile="${2}.$$"
+
+if [ ! -d ${1} ]; then
+  echo "${1} must be a directory"
+  exit 1
+fi
+
+if [ -e ${2} ]; then
+  echo "won't overwrite ${2}"
+  exit 1
+fi
+
+rm -f ${tempfile}
+makefs ${tempfile} ${1}
+if [ $? -ne 0 ]; then
+  echo "makefs failed"
+  exit 1
+fi
+
+#
+# Use $BLOCKSIZE for transfers to improve efficiency.  When calculating
+# how many blocks to transfer "+ 2" is to account for truncation in the
+# division and to provide space for the label.
+#
+
+filesize=`stat -f "%z" ${tempfile}`
+blocks=$(($filesize / ${BLOCKSIZE} + 2))
+dd if=/dev/zero of=${2} bs=${BLOCKSIZE} count=${blocks}
+if [ $? -ne 0 ]; then
+  echo "creation of image file failed"
+  exit 1
+fi
+
+unit=`mdconfig -a -t vnode -f ${2}`
+if [ $? -ne 0 ]; then
+  echo "mdconfig failed"
+  exit 1
+fi
+
+fdisk -BIq /dev/${unit}
+if [ $? -ne 0 ]; then
+  echo "fdisk failed"
+  exit 1
+fi
+
+bsdlabel -B -w /dev/${unit}
+if [ $? -ne 0 ]; then
+  echo "bsdlabel failed"
+  exit 1
+fi
+
+dd if=${tempfile} of=/dev/${unit}a bs=$BLOCKSIZE conv=sync
+if [ $? -ne 0 ]; then
+  echo "copying filesystem into image file failed"
+  exit 1
+fi
+
+mdconfig -d -u ${unit}
+
+rm -f ${tempfile}
+

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Apr  6 21:39:18 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 94CCD106566C;
	Tue,  6 Apr 2010 21:39:18 +0000 (UTC)
	(envelope-from danger@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 806E28FC0A;
	Tue,  6 Apr 2010 21:39:18 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o36LdIF2087338;
	Tue, 6 Apr 2010 21:39:18 GMT (envelope-from danger@svn.freebsd.org)
Received: (from danger@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o36LdISe087335;
	Tue, 6 Apr 2010 21:39:18 GMT (envelope-from danger@svn.freebsd.org)
Message-Id: <201004062139.o36LdISe087335@svn.freebsd.org>
From: Daniel Gerzo 
Date: Tue, 6 Apr 2010 21:39:18 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206287 - in stable/8/cddl/contrib/opensolaris/cmd: zfs
	zpool
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 06 Apr 2010 21:39:18 -0000

Author: danger (doc committer)
Date: Tue Apr  6 21:39:18 2010
New Revision: 206287
URL: http://svn.freebsd.org/changeset/base/206287

Log:
  Merge r205659:
  - update zfs and zpool manual pages to match the current state of the source
  
  PR:		144984
  Submitted by:	mm@
  Approved by:	pjd@
  Obtained from:	OpenSolaris

Modified:
  stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs.8
  stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool.8
Directory Properties:
  stable/8/cddl/contrib/opensolaris/   (props changed)
  stable/8/cddl/contrib/opensolaris/cmd/zdb/   (props changed)
  stable/8/cddl/contrib/opensolaris/cmd/zfs/   (props changed)
  stable/8/cddl/contrib/opensolaris/lib/libzfs/   (props changed)

Modified: stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs.8
==============================================================================
--- stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs.8	Tue Apr  6 20:09:13 2010	(r206286)
+++ stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs.8	Tue Apr  6 21:39:18 2010	(r206287)
@@ -1,24 +1,9 @@
 '\" te
-.\" CDDL HEADER START
-.\"
-.\" The contents of this file are subject to the terms of the
-.\" Common Development and Distribution License (the "License").  
-.\" You may not use this file except in compliance with the License.
-.\"
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-.\" or http://www.opensolaris.org/os/licensing.
-.\" See the License for the specific language governing permissions
-.\" and limitations under the License.
-.\"
-.\" When distributing Covered Code, include this CDDL HEADER in each
-.\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-.\" If applicable, add the following below this CDDL HEADER, with the
-.\" fields enclosed by brackets "[]" replaced with your own identifying
-.\" information: Portions Copyright [yyyy] [name of copyright owner]
-.\"
-.\" CDDL HEADER END
-.\" Copyright (c) 2007 Sun Microsystems, Inc. All Rights Reserved.
-.TH zfs 1M "8 Apr 2008" "SunOS 5.11" "System Administration Commands"
+.\" Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved.
+.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
+.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
+.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
+.TH zfs 1M "14 Feb 2009" "SunOS 5.11" "System Administration Commands"
 .SH NAME
 zfs \- configures ZFS file systems
 .SH SYNOPSIS
@@ -44,7 +29,8 @@ zfs \- configures ZFS file systems
 
 .LP
 .nf
-\fBzfs\fR \fBsnapshot\fR [\fB-r\fR] \fIfilesystem@snapname\fR|\fIvolume@snapname\fR
+\fBzfs\fR \fBsnapshot\fR [\fB-r\fR] [\fB-o\fR \fIproperty\fR=\fIvalue\fR]... 
+      \fIfilesystem@snapname\fR|\fIvolume@snapname\fR
 .fi
 
 .LP
@@ -54,7 +40,7 @@ zfs \- configures ZFS file systems
 
 .LP
 .nf
-\fBzfs\fR \fBclone\fR [\fB-p\fR] \fIsnapshot\fR \fIfilesystem\fR|\fIvolume\fR
+\fBzfs\fR \fBclone\fR [\fB-p\fR] [\fB-o\fR \fIproperty\fR=\fIvalue\fR] ... \fIsnapshot\fR \fIfilesystem\fR|\fIvolume\fR
 .fi
 
 .LP
@@ -65,7 +51,7 @@ zfs \- configures ZFS file systems
 .LP
 .nf
 \fBzfs\fR \fBrename\fR \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR 
-    \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR
+     \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR
 .fi
 
 .LP
@@ -81,23 +67,23 @@ zfs \- configures ZFS file systems
 .LP
 .nf
 \fBzfs\fR \fBlist\fR [\fB-rH\fR] [\fB-o\fR \fIproperty\fR[,...]] [\fB-t\fR \fItype\fR[,...]]
-    [\fB-s\fR \fIproperty\fR] ... [\fB-S\fR \fIproperty\fR ... [\fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR] ...
+     [\fB-s\fR \fIproperty\fR] ... [\fB-S\fR \fIproperty\fR] ... [\fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR] ...
 .fi
 
 .LP
 .nf
-\fBzfs\fR \fBset\fR \fIproperty\fR=\fIvalue\fR \fIfilesystem\fR|\fIvolume\fR ...
+\fBzfs\fR \fBset\fR \fIproperty\fR=\fIvalue\fR \fIfilesystem\fR|\fIvolume\fR|snapshot ...
 .fi
 
 .LP
 .nf
 \fBzfs\fR \fBget\fR [\fB-rHp\fR] [\fB-o\fR \fIfield\fR[,...]] [\fB-s\fR \fIsource\fR[,...]] "\fIall\fR" | \fIproperty\fR[,...]
-     \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR ...
+      \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR ...
 .fi
 
 .LP
 .nf
-\fBzfs\fR \fBinherit\fR [\fB-r\fR] \fIproperty\fR \fIfilesystem\fR|\fIvolume\fR ...
+\fBzfs\fR \fBinherit\fR [\fB-r\fR] \fIproperty\fR \fIfilesystem\fR|\fIvolume|snapshot\fR ...
 .fi
 
 .LP
@@ -132,12 +118,12 @@ zfs \- configures ZFS file systems
 
 .LP
 .nf
-\fBzfs\fR \fBunshare\fR  \fB-a\fR \fIfilesystem\fR|\fImountpoint\fR
+\fBzfs\fR \fBunshare\fR \fB-a\fR \fIfilesystem\fR|\fImountpoint\fR
 .fi
 
 .LP
 .nf
-\fBzfs\fR \fBsend\fR [\fB-vR\fR] [\fB-\fR[\fB-iI\fR] \fIsnapshot\fR] \fIsnapshot\fR
+\fBzfs\fR \fBsend\fR [\fB-vR\fR] [\fB-\fR[\fBiI\fR] \fIsnapshot\fR] \fIsnapshot\fR
 .fi
 
 .LP
@@ -153,7 +139,7 @@ zfs \- configures ZFS file systems
 .LP
 .nf
 \fBzfs\fR \fBallow\fR [\fB-ldug\fR] "\fIeveryone\fR"|\fIuser\fR|\fIgroup\fR[,...] \fIperm\fR|\fI@setname\fR[,...] 
-    \fIfilesystem\fR|\fIvolume\fR
+     \fIfilesystem\fR|\fIvolume\fR
 .fi
 
 .LP
@@ -174,7 +160,7 @@ zfs \- configures ZFS file systems
 .LP
 .nf
 \fBzfs\fR \fBunallow\fR [\fB-rldug\fR] "\fIeveryone\fR"|\fIuser\fR|\fIgroup\fR[,...] [\fIperm\fR|@\fIsetname\fR[,... ]] 
-    \fIfilesystem\fR|\fIvolume\fR
+     \fIfilesystem\fR|\fIvolume\fR
 .fi
 
 .LP
@@ -192,20 +178,10 @@ zfs \- configures ZFS file systems
 \fBzfs\fR \fBunallow\fR [\fB-r\fR] \fB-s\fR @setname [\fIperm\fR|@\fIsetname\fR[,... ]] \fIfilesystem\fR|\fIvolume\fR
 .fi
 
-.LP
-.nf
-\fBzfs\fR \fBjail\fR \fBjailid\fR \fB\fIfilesystem\fR\fR
-.fi
-.LP
-.nf
-\fBzfs\fR \fBunjail\fR \fBjailid\fR \fB\fIfilesystem\fR\fR
-.fi
-
 .SH DESCRIPTION
 .sp
 .LP
-The \fBzfs\fR command configures \fBZFS\fR datasets within a \fBZFS\fR storage pool, as described in \fBzpool\fR(1M). A
-dataset is identified by a unique path within the \fBZFS\fR namespace. For example:
+The \fBzfs\fR command configures \fBZFS\fR datasets within a \fBZFS\fR storage pool, as described in \fBzpool\fR(1M). A dataset is identified by a unique path within the \fBZFS\fR namespace. For example:
 .sp
 .in +2
 .nf
@@ -226,9 +202,9 @@ A dataset can be one of the following:
 .na
 \fB\fIfile system\fR\fR
 .ad
-.RS 15n
-.rt  
-A standard \fBPOSIX\fR file system. \fBZFS\fR file systems can be mounted within the standard file system namespace and behave like any other file system.
+.sp .6
+.RS 4n
+A \fBZFS\fR dataset of type "filesystem" that can be mounted within the standard system namespace and behaves like other file systems. While \fBZFS\fR file systems are designed to be \fBPOSIX\fR compliant, known issues exist that prevent compliance in some cases. Applications that depend on standards conformance might fail due to nonstandard behavior when checking file system free space.
 .RE
 
 .sp
@@ -237,8 +213,8 @@ A standard \fBPOSIX\fR file system. \fBZ
 .na
 \fB\fIvolume\fR\fR
 .ad
-.RS 15n
-.rt  
+.sp .6
+.RS 4n
 A logical volume exported as a raw or block device. This type of dataset should only be used under special circumstances. File systems are typically used in most environments. Volumes cannot be used in a non-global zone.
 .RE
 
@@ -248,8 +224,8 @@ A logical volume exported as a raw or bl
 .na
 \fB\fIsnapshot\fR\fR
 .ad
-.RS 15n
-.rt  
+.sp .6
+.RS 4n
 A read-only version of a file system or volume at a given point in time. It is specified as \fIfilesystem@name\fR or \fIvolume@name\fR.
 .RE
 
@@ -272,20 +248,17 @@ A snapshot is a read-only copy of a file
 Snapshots can have arbitrary names. Snapshots of volumes can be cloned or rolled back, but cannot be accessed independently.
 .sp
 .LP
-File system snapshots can be accessed under the ".zfs/snapshot" directory in the root of the file system. Snapshots are automatically mounted on demand and may be unmounted at regular intervals. The visibility of the ".zfs" directory can be controlled by the "snapdir"
-property.
+File system snapshots can be accessed under the ".zfs/snapshot" directory in the root of the file system. Snapshots are automatically mounted on demand and may be unmounted at regular intervals. The visibility of the ".zfs" directory can be controlled by the "snapdir" property.
 .SS "Clones"
 .sp
 .LP
 A clone is a writable volume or file system whose initial contents are the same as another dataset. As with snapshots, creating a clone is nearly instantaneous, and initially consumes no additional space.
 .sp
 .LP
-Clones can only be created from a snapshot. When a snapshot is cloned, it creates an implicit dependency between the parent and child. Even though the clone is created somewhere else in the dataset hierarchy, the original snapshot cannot be destroyed as long as a clone exists. The "origin"
-property exposes this dependency, and the \fBdestroy\fR command lists any such dependencies, if they exist.
+Clones can only be created from a snapshot. When a snapshot is cloned, it creates an implicit dependency between the parent and child. Even though the clone is created somewhere else in the dataset hierarchy, the original snapshot cannot be destroyed as long as a clone exists. The "origin" property exposes this dependency, and the \fBdestroy\fR command lists any such dependencies, if they exist.
 .sp
 .LP
-The clone parent-child dependency relationship can be reversed by using the "\fBpromote\fR" subcommand. This causes the "origin" file system to become a clone of the specified file system, which makes it possible to destroy the file system that the clone
-was created from.
+The clone parent-child dependency relationship can be reversed by using the "\fBpromote\fR" subcommand. This causes the "origin" file system to become a clone of the specified file system, which makes it possible to destroy the file system that the clone was created from.
 .SS "Mount Points"
 .sp
 .LP
@@ -301,8 +274,7 @@ A file system can also have a mount poin
 A file system mountpoint property of "none" prevents the file system from being mounted.
 .sp
 .LP
-If needed, \fBZFS\fR file systems can also be managed with traditional tools (\fBmount\fR, \fBumount\fR, \fB/etc/vfstab\fR). If a file system's mount point is set to "legacy", \fBZFS\fR makes no attempt to manage
-the file system, and the administrator is responsible for mounting and unmounting the file system.
+If needed, \fBZFS\fR file systems can also be managed with traditional tools (\fBmount\fR, \fBumount\fR, \fB/etc/vfstab\fR). If a file system's mount point is set to "legacy", \fBZFS\fR makes no attempt to manage the file system, and the administrator is responsible for mounting and unmounting the file system.
 .SS "Zones"
 .sp
 .LP
@@ -312,8 +284,7 @@ A \fBZFS\fR file system can be added to 
 The physical properties of an added file system are controlled by the global administrator. However, the zone administrator can create, modify, or destroy files within the added file system, depending on how the file system is mounted.
 .sp
 .LP
-A dataset can also be delegated to a non-global zone by using zonecfg's "\fBadd dataset\fR" subcommand. You cannot delegate a dataset to one zone and the children of the same dataset to another zone. The zone administrator can change properties of the dataset or
-any of its children. However, the "quota" property is controlled by the global administrator.
+A dataset can also be delegated to a non-global zone by using zonecfg's "\fBadd dataset\fR" subcommand. You cannot delegate a dataset to one zone and the children of the same dataset to another zone. The zone administrator can change properties of the dataset or any of its children. However, the "quota" property is controlled by the global administrator.
 .sp
 .LP
 A \fBZFS\fR volume can be added as a device to a non-global zone by using zonecfg's "\fBadd device\fR" subcommand. However, its physical properties can only be modified by the global administrator.
@@ -329,15 +300,13 @@ The global administrator can forcibly cl
 .SS "Native Properties"
 .sp
 .LP
-Properties are divided into two types, native properties and user defined properties. Native properties either export internal statistics or control \fBZFS\fR behavior. In addition, native properties are either editable or read-only. User properties have no effect on \fBZFS\fR behavior,
-but you can use them to annotate datasets in a way that is meaningful in your environment. For more information about user properties, see the "User Properties" section.
+Properties are divided into two types, native properties and user defined properties. Native properties either export internal statistics or control \fBZFS\fR behavior. In addition, native properties are either editable or read-only. User properties have no effect on \fBZFS\fR behavior, but you can use them to annotate datasets in a way that is meaningful in your environment. For more information about user properties, see the "User Properties" section.
 .sp
 .LP
-Every dataset has a set of properties that export statistics about the dataset as well as control various behavior. Properties are inherited from the parent unless overridden by the child. Snapshot properties can not be edited; they always inherit their inheritable properties. Properties
-that are not applicable to snapshots are not displayed.
+Every dataset has a set of properties that export statistics about the dataset as well as control various behavior. Properties are inherited from the parent unless overridden by the child. Some properties only apply to certain types of datasets (file systems, volumes or snapshots).
 .sp
 .LP
-The values of numeric properties can be specified using the following human-readable suffixes (for example, "k", "KB", "M", "Gb", etc, up to Z for zettabyte). The following are all valid (and equal) specifications: 
+The values of numeric properties can be specified using human-readable suffixes (for example, "k", "KB", "M", "Gb", etc, up to Z for zettabyte). The following are all valid (and equal) specifications: 
 .sp
 .in +2
 .nf
@@ -360,8 +329,7 @@ The following native properties consist 
 .ad
 .sp .6
 .RS 4n
-The amount of space available to the dataset and all its children, assuming that there is no other activity in the pool. Because space is shared within a pool, availability can be limited by any number of factors, including physical pool size, quotas, reservations, or other datasets
-within the pool.
+The amount of space available to the dataset and all its children, assuming that there is no other activity in the pool. Because space is shared within a pool, availability can be limited by any number of factors, including physical pool size, quotas, reservations, or other datasets within the pool.
 .sp
 This property can also be referred to by its shortened column name, "avail".
 .RE
@@ -418,8 +386,7 @@ For cloned file systems or volumes, the 
 .ad
 .sp .6
 .RS 4n
-The amount of data that is accessible by this dataset, which may or may not be shared with other datasets in the pool. When a snapshot or clone is created, it initially references the same amount of space as the file system or snapshot it was created from, since its contents are
-identical.
+The amount of data that is accessible by this dataset, which may or may not be shared with other datasets in the pool. When a snapshot or clone is created, it initially references the same amount of space as the file system or snapshot it was created from, since its contents are identical.
 .sp
 This property can also be referred to by its shortened column name, "refer".
 .RE
@@ -432,7 +399,7 @@ This property can also be referred to by
 .ad
 .sp .6
 .RS 4n
-The type of dataset: "filesystem", "volume", "snapshot", or "clone".
+The type of dataset: "filesystem", "volume", or "snapshot".
 .RE
 
 .sp
@@ -443,11 +410,9 @@ The type of dataset: "filesystem", "volu
 .ad
 .sp .6
 .RS 4n
-The amount of space consumed by this dataset and all its descendents. This is the value that is checked against this dataset's quota and reservation. The space used does not include this dataset's reservation, but does take into account the reservations of any descendent datasets.
-The amount of space that a dataset consumes from its parent, as well as the amount of space that are freed if this dataset is recursively destroyed, is the greater of its space used and its reservation.
+The amount of space consumed by this dataset and all its descendents. This is the value that is checked against this dataset's quota and reservation. The space used does not include this dataset's reservation, but does take into account the reservations of any descendent datasets. The amount of space that a dataset consumes from its parent, as well as the amount of space that are freed if this dataset is recursively destroyed, is the greater of its space used and its reservation.
 .sp
-When snapshots (see the "Snapshots" section) are created, their space is initially shared between the snapshot and the file system, and possibly with previous snapshots. As the file system changes, space that was previously shared becomes unique to the snapshot, and counted in
-the snapshot's space used. Additionally, deleting snapshots can increase the amount of space unique to (and used by) other snapshots.
+When snapshots (see the "Snapshots" section) are created, their space is initially shared between the snapshot and the file system, and possibly with previous snapshots. As the file system changes, space that was previously shared becomes unique to the snapshot, and counted in the snapshot's space used. Additionally, deleting snapshots can increase the amount of space unique to (and used by) other snapshots.
 .sp
 The amount of space used, available, or referenced does not take into account pending changes. Pending changes are generally accounted for within a few seconds. Committing a change to a disk using \fBfsync\fR(3c) or \fBO_SYNC\fR does not necessarily guarantee that the space usage information is updated immediately.
 .RE
@@ -456,12 +421,66 @@ The amount of space used, available, or 
 .ne 2
 .mk
 .na
+\fBusedby*\fR
+.ad
+.sp .6
+.RS 4n
+The \fBusedby*\fR snapshots decompose the "used" properties into the various reasons that space is used. Specifically, \fBused\fR = \fBusedbychildren\fR + \fBusedbydataset\fR + \fBusedbyrefreservation\fR +, \fBusedbysnapshots\fR. These properties are only available for datasets created on zpool "version 13" pools.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fBusedbychildren\fR
+.ad
+.sp .6
+.RS 4n
+The amount of space used by children of this dataset, which would be freed if all the dataset's children were destroyed.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fBusedbydataset\fR
+.ad
+.sp .6
+.RS 4n
+The amount of space used by this dataset itself, which would be freed if the dataset were destroyed (after first removing any \fBrefreservation\fR and destroying any necessary snapshots or descendents).
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fBusedbyrefreservation\fR
+.ad
+.sp .6
+.RS 4n
+The amount of space used by a \fBrefreservation\fR set on this dataset, which would be freed if the \fBrefreservation\fR was removed.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fBusedbysnapshots\fR
+.ad
+.sp .6
+.RS 4n
+The amount of space consumed by snapshots of this dataset. In particular, it is the amount of space that would be freed if all of this dataset's snapshots were destroyed. Note that this is not simply the sum of the snapshots' "used" properties because space can be shared by multiple snapshots
+.RE
+
+.sp
+.ne 2
+.mk
+.na
 \fBvolblocksize=\fIblocksize\fR\fR
 .ad
 .sp .6
 .RS 4n
-For volumes, specifies the block size of the volume. The \fBblocksize\fR cannot be changed once the volume has been written, so it should be set at volume creation time. The default \fBblocksize\fR for volumes is 8 Kbytes. Any power of 2 from 512 bytes
-to 128 Kbytes is valid.
+For volumes, specifies the block size of the volume. The \fBblocksize\fR cannot be changed once the volume has been written, so it should be set at volume creation time. The default \fBblocksize\fR for volumes is 8 Kbytes. Any power of 2 from 512 bytes to 128 Kbytes is valid.
 .sp
 This property can also be referred to by its shortened column name, "volblock".
 .RE
@@ -473,15 +492,13 @@ The following native properties can be u
 .ne 2
 .mk
 .na
-\fBaclinherit=\fBdiscard\fR | \fBnoallow\fR | \fBrestricted\fR | \fBpassthrough\fR\fR
+\fBaclinherit=\fBdiscard\fR | \fBnoallow\fR | \fBrestricted\fR | \fBpassthrough\fR | \fBpassthrough-x\fR\fR
 .ad
 .sp .6
 .RS 4n
-Controls how \fBACL\fR entries are inherited when files and directories are created. A file system with an "aclinherit" property of "\fBdiscard\fR" does not inherit any \fBACL\fR entries. A file system with an "aclinherit"
-property value of "\fBnoallow\fR" only inherits inheritable \fBACL\fR entries that specify "deny" permissions. The property value "\fBrestricted\fR" (the default) removes the "\fBwrite_acl\fR" and "\fBwrite_owner\fR" permissions when the \fBACL\fR entry is inherited. A file system with an "aclinherit" property value of "\fBpassthrough\fR" inherits all inheritable \fBACL\fR entries without any modifications made to the \fBACL\fR entries when they are inherited.
+Controls how \fBACL\fR entries are inherited when files and directories are created. A file system with an "aclinherit" property of "\fBdiscard\fR" does not inherit any \fBACL\fR entries. A file system with an "aclinherit" property value of "\fBnoallow\fR" only inherits inheritable \fBACL\fR entries that specify "deny" permissions. The property value "\fBrestricted\fR" (the default) removes the "\fBwrite_acl\fR" and "\fBwrite_owner\fR" permissions when the \fBACL\fR entry is inherited. A file system with an "aclinherit" property value of "\fBpassthrough\fR" inherits all inheritable \fBACL\fR entries without any modifications made to the \fBACL\fR entries when they are inherited. A file system with an "aclinherit" property value of "\fBpassthrough-x\fR" has the same meaning as "\fBpassthrough\fR", except that the \fBowner@\fR, \fBgroup@\fR, and \fBeveryone@\fR \fBACE\fRs inherit the execute permission only if the file creation mode also requests the execute bit.
 .sp
-When the property value is set to "\fBpassthrough\fR," files are created with a mode determined by the inheritable \fBACE\fRs. If no inheritable \fBACE\fRs exist that affect the mode, then the mode is set in accordance to the requested mode
-from the application.
+When the property value is set to "\fBpassthrough\fR," files are created with a mode determined by the inheritable \fBACE\fRs. If no inheritable \fBACE\fRs exist that affect the mode, then the mode is set in accordance to the requested mode from the application.
 .RE
 
 .sp
@@ -492,9 +509,7 @@ from the application.
 .ad
 .sp .6
 .RS 4n
-Controls how an \fBACL\fR is modified during \fBchmod\fR(2). A file system with an "aclmode" property of "\fBdiscard\fR"
-deletes all \fBACL\fR entries that do not represent the mode of the file. An "aclmode" property of "\fBgroupmask\fR" (the default) reduces user or group permissions. The permissions are reduced, such that they are no greater than the group permission
-bits, unless it is a user entry that has the same \fBUID\fR as the owner of the file or directory. In this case, the \fBACL\fR permissions are reduced so that they are no greater than owner permission bits. A file system with an "aclmode" property of "\fBpassthrough\fR" indicates that no changes are made to the \fBACL\fR other than generating the necessary \fBACL\fR entries to represent the new mode of the file or directory.
+Controls how an \fBACL\fR is modified during \fBchmod\fR(2). A file system with an "aclmode" property of "\fBdiscard\fR" deletes all \fBACL\fR entries that do not represent the mode of the file. An "aclmode" property of "\fBgroupmask\fR" (the default) reduces user or group permissions. The permissions are reduced, such that they are no greater than the group permission bits, unless it is a user entry that has the same \fBUID\fR as the owner of the file or directory. In this case, the \fBACL\fR permissions are reduced so that they are no greater than owner permission bits. A file system with an "aclmode" property of "\fBpassthrough\fR" indicates that no changes are made to the \fBACL\fR other than generating the necessary \fBACL\fR entries to represent the new mode of the file or directory.
 .RE
 
 .sp
@@ -505,8 +520,7 @@ bits, unless it is a user entry that has
 .ad
 .sp .6
 .RS 4n
-Controls whether the access time for files is updated when they are read. Turning this property off avoids producing write traffic when reading files and can result in significant performance gains, though it might confuse mailers and other similar utilities. The default value
-is "on".
+Controls whether the access time for files is updated when they are read. Turning this property off avoids producing write traffic when reading files and can result in significant performance gains, though it might confuse mailers and other similar utilities. The default value is "on".
 .RE
 
 .sp
@@ -517,12 +531,9 @@ is "on".
 .ad
 .sp .6
 .RS 4n
-If this property is set to "\fBoff\fR", the file system cannot be mounted, and is ignored by "\fBzfs mount -a\fR". Setting this property to "\fBoff\fR" is similar to setting the "mountpoint"
-property to "\fBnone\fR", except that the dataset still has a normal "mountpoint" property, which can be inherited. Setting this property to "\fBoff\fR" allows datasets to be used solely as a mechanism to inherit properties. One example
-of setting canmount=\fBoff\fR is to have two datasets with the same mountpoint, so that the children of both datasets appear in the same directory, but might have different inherited characteristics.
+If this property is set to "\fBoff\fR", the file system cannot be mounted, and is ignored by "\fBzfs mount -a\fR". Setting this property to "\fBoff\fR" is similar to setting the "mountpoint" property to "\fBnone\fR", except that the dataset still has a normal "mountpoint" property, which can be inherited. Setting this property to "\fBoff\fR" allows datasets to be used solely as a mechanism to inherit properties. One example of setting canmount=\fBoff\fR is to have two datasets with the same mountpoint, so that the children of both datasets appear in the same directory, but might have different inherited characteristics.
 .sp
-When the "\fBnoauto\fR" option is set, a dataset can only be mounted and unmounted explicitly. The dataset is not mounted automatically when the dataset is created or imported, nor is it mounted by the "\fBzfs mount -a\fR" command or unmounted
-by the "\fBzfs unmount -a\fR" command. 
+When the "\fBnoauto\fR" option is set, a dataset can only be mounted and unmounted explicitly. The dataset is not mounted automatically when the dataset is created or imported, nor is it mounted by the "\fBzfs mount -a\fR" command or unmounted by the "\fBzfs unmount -a\fR" command. 
 .sp
 This property is not inherited.
 .RE
@@ -535,8 +546,7 @@ This property is not inherited.
 .ad
 .sp .6
 .RS 4n
-Controls the checksum used to verify data integrity. The default value is "on", which automatically selects an appropriate algorithm (currently, \fIfletcher4\fR, but this may change in future releases). The value "off" disables integrity
-checking on user data. Disabling checksums is NOT a recommended practice.
+Controls the checksum used to verify data integrity. The default value is "on", which automatically selects an appropriate algorithm (currently, \fIfletcher2\fR, but this may change in future releases). The value "off" disables integrity checking on user data. Disabling checksums is NOT a recommended practice.
 .RE
 
 .sp
@@ -547,9 +557,7 @@ checking on user data. Disabling checksu
 .ad
 .sp .6
 .RS 4n
-Controls the compression algorithm used for this dataset. The "lzjb" compression algorithm is optimized for performance while providing decent data compression. Setting compression to "on" uses the "lzjb" compression algorithm. The "gzip"
-compression algorithm uses the same compression as the \fBgzip\fR(1) command. You can specify the "gzip" level by using the value "gzip-\fIN\fR" where \fIN\fR is
-an integer from 1 (fastest) to 9 (best compression ratio). Currently, "gzip" is equivalent to "gzip-6" (which is also the default for \fBgzip\fR(1)).
+Controls the compression algorithm used for this dataset. The "lzjb" compression algorithm is optimized for performance while providing decent data compression. Setting compression to "on" uses the "lzjb" compression algorithm. The "gzip" compression algorithm uses the same compression as the \fBgzip\fR(1) command. You can specify the "gzip" level by using the value "gzip-\fIN\fR" where \fIN\fR is an integer from 1 (fastest) to 9 (best compression ratio). Currently, "gzip" is equivalent to "gzip-6" (which is also the default for \fBgzip\fR(1)).
 .sp
 This property can also be referred to by its shortened column name "compress".
 .RE
@@ -562,8 +570,7 @@ This property can also be referred to by
 .ad
 .sp .6
 .RS 4n
-Controls the number of copies of data stored for this dataset. These copies are in addition to any redundancy provided by the pool, for example, mirroring or raid-z. The copies are stored on different disks, if possible. The space used by multiple copies is charged to the associated
-file and dataset, changing the "used" property and counting against quotas and reservations.
+Controls the number of copies of data stored for this dataset. These copies are in addition to any redundancy provided by the pool, for example, mirroring or raid-z. The copies are stored on different disks, if possible. The space used by multiple copies is charged to the associated file and dataset, changing the "used" property and counting against quotas and reservations.
 .sp
 Changing this property only affects newly-written data. Therefore, set this property at file system creation time by using the "\fB-o\fR copies=" option.
 .RE
@@ -600,8 +607,7 @@ Controls whether processes can be execut
 .RS 4n
 Controls the mount point used for this file system. See the "Mount Points" section for more information on how this property is used. 
 .sp
-When the mountpoint property is changed for a file system, the file system and any children that inherit the mount point are unmounted. If the new value is "legacy", then they remain unmounted. Otherwise, they are automatically remounted in the new location if the property was
-previously "legacy" or "none", or if they were mounted before the property was changed. In addition, any shared file systems are unshared and shared in the new location.
+When the mountpoint property is changed for a file system, the file system and any children that inherit the mount point are unmounted. If the new value is "legacy", then they remain unmounted. Otherwise, they are automatically remounted in the new location if the property was previously "legacy" or "none", or if they were mounted before the property was changed. In addition, any shared file systems are unshared and shared in the new location.
 .RE
 
 .sp
@@ -612,7 +618,18 @@ previously "legacy" or "none", or if the
 .ad
 .sp .6
 .RS 4n
-Controls whether the file system should be mounted with "\fBnbmand\fR" (Non Blocking mandatory locks). This is used for \fBCIFS\fR clients. 	Changes to this property only take effect when the file system is umounted and remounted. See \fBmount\fR(1M) for more information on "\fBnbmand\fR" mounts.
+Controls whether the file system should be mounted with "\fBnbmand\fR" (Non Blocking mandatory locks). This is used for \fBCIFS\fR clients. Changes to this property only take effect when the file system is umounted and remounted. See \fBmount\fR(1M) for more information on "\fBnbmand\fR" mounts.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fBprimarycache=\fIall\fR | \fInone\fR | \fImetadata\fR\fR
+.ad
+.sp .6
+.RS 4n
+Controls what is cached in the primary cache (ARC). If this property is set to "all", then both user data and metadata is cached. If this property is set to "none", then neither user data nor metadata is cached. If this property is set to "metadata", then only metadata is cached. The default value is "all".
 .RE
 
 .sp
@@ -623,8 +640,7 @@ Controls whether the file system should 
 .ad
 .sp .6
 .RS 4n
-Limits the amount of space a dataset and its descendents can consume. This property enforces a hard limit on the amount of space used. This includes all space consumed by descendents, including file systems and snapshots. Setting a quota on a descendent of a dataset that already
-has a quota does not override the ancestor's quota, but rather imposes an additional limit.
+Limits the amount of space a dataset and its descendents can consume. This property enforces a hard limit on the amount of space used. This includes all space consumed by descendents, including file systems and snapshots. Setting a quota on a descendent of a dataset that already has a quota does not override the ancestor's quota, but rather imposes an additional limit.
 .sp
 Quotas cannot be set on volumes, as the "volsize" property acts as an implicit quota.
 .RE
@@ -650,11 +666,9 @@ This property can also be referred to by
 .ad
 .sp .6
 .RS 4n
-Specifies a suggested block size for files in the file system. This property is designed solely for use with database workloads that access files in fixed-size records. \fBZFS\fR automatically tunes block sizes according to internal algorithms optimized for typical
-access patterns. 
+Specifies a suggested block size for files in the file system. This property is designed solely for use with database workloads that access files in fixed-size records. \fBZFS\fR automatically tunes block sizes according to internal algorithms optimized for typical access patterns. 
 .sp
-For databases that create very large files but access them in small random chunks, these algorithms may be suboptimal. Specifying a "recordsize" greater than or equal to the record size of the database can result in significant performance gains. Use of this property for general
-purpose file systems is strongly discouraged, and may adversely affect performance.
+For databases that create very large files but access them in small random chunks, these algorithms may be suboptimal. Specifying a "recordsize" greater than or equal to the record size of the database can result in significant performance gains. Use of this property for general purpose file systems is strongly discouraged, and may adversely affect performance.
 .sp
 The size specified must be a power of two greater than or equal to 512 and less than or equal to 128 Kbytes.
 .sp
@@ -682,8 +696,7 @@ Limits the amount of space a dataset can
 .ad
 .sp .6
 .RS 4n
-The minimum amount of space guaranteed to a dataset, not including its descendents. When the amount of space used is below this value, the dataset is treated as if it were taking up the amount of space specified by \fBrefreservation\fR. The \fBrefreservation\fR reservation
-is accounted for in the parent datasets' space used, and counts against the parent datasets' quotas and reservations.
+The minimum amount of space guaranteed to a dataset, not including its descendents. When the amount of space used is below this value, the dataset is treated as if it were taking up the amount of space specified by \fBrefreservation\fR. The \fBrefreservation\fR reservation is accounted for in the parent datasets' space used, and counts against the parent datasets' quotas and reservations.
 .sp
 If \fBrefreservation\fR is set, a snapshot is only allowed if there is enough free pool space outside of this reservation to accommodate the current number of "referenced" bytes in the dataset.
 .sp
@@ -698,8 +711,7 @@ This property can also be referred to by
 .ad
 .sp .6
 .RS 4n
-The minimum amount of space guaranteed to a dataset and its descendents. When the amount of space used is below this value, the dataset is treated as if it were taking up the amount of space specified by its reservation. Reservations are accounted for in the parent datasets' space
-used, and count against the parent datasets' quotas and reservations.
+The minimum amount of space guaranteed to a dataset and its descendents. When the amount of space used is below this value, the dataset is treated as if it were taking up the amount of space specified by its reservation. Reservations are accounted for in the parent datasets' space used, and count against the parent datasets' quotas and reservations.
 .sp
 This property can also be referred to by its shortened column name, "reserv".
 .RE
@@ -708,6 +720,17 @@ This property can also be referred to by
 .ne 2
 .mk
 .na
+\fBsecondarycache=\fIall\fR | \fInone\fR | \fImetadata\fR\fR
+.ad
+.sp .6
+.RS 4n
+Controls what is cached in the secondary cache (L2ARC). If this property is set to "all", then both user data and metadata is cached. If this property is set to "none", then neither user data nor metadata is cached. If this property is set to "metadata", then only metadata is cached. The default value is "all".
+.RE
+
+.sp
+.ne 2
+.mk
+.na
 \fBsetuid=\fIon\fR | \fIoff\fR\fR
 .ad
 .sp .6
@@ -723,8 +746,7 @@ Controls whether the set-\fBUID\fR bit i
 .ad
 .sp .6
 .RS 4n
-Like the "sharenfs" property, "shareiscsi" indicates whether a \fBZFS\fR volume is exported as an \fBiSCSI\fR target. The acceptable values for this property are "on", "off", and "type=disk".
-The default value is "off". In the future, other target types might be supported. For example, "tape".
+Like the "sharenfs" property, "shareiscsi" indicates whether a \fBZFS\fR volume is exported as an \fBiSCSI\fR target. The acceptable values for this property are "on", "off", and "type=disk". The default value is "off". In the future, other target types might be supported. For example, "tape".
 .sp
 You might want to set "shareiscsi=on" for a file system so that all \fBZFS\fR volumes within the file system are shared by default. Setting this property on a file system has no direct effect, however.
 .RE
@@ -737,15 +759,13 @@ You might want to set "shareiscsi=on" fo
 .ad
 .sp .6
 .RS 4n
-Controls whether the file system is shared by using the Solaris \fBCIFS\fR service, and what options are to be used. A file system with the "\fBsharesmb\fR" property set to "off" is managed through traditional tools such as \fBsharemgr\fR(1M). Otherwise, the file system is automatically shared and unshared with the "zfs share" and "zfs unshare" commands. If the property is set to "on",
-the \fBsharemgr\fR(1M) command is invoked with no options. Otherwise, the \fBsharemgr\fR(1M) command is invoked with options equivalent to the contents of this property.
+Controls whether the file system is shared by using the Solaris \fBCIFS\fR service, and what options are to be used. A file system with the "\fBsharesmb\fR" property set to "off" is managed through traditional tools such as \fBsharemgr\fR(1M). Otherwise, the file system is automatically shared and unshared with the \fBzfs share\fR and \fBzfs unshare\fR commands. If the property is set to \fBon\fR, the \fBsharemgr\fR(1M) command is invoked with no options. Otherwise, the \fBsharemgr\fR(1M) command is invoked with options equivalent to the contents of this property.
+.sp
+Because \fBSMB\fR shares requires a resource name, a unique resource name is constructed from the dataset name. The constructed name is a copy of the dataset name except that the characters in the dataset name, which would be illegal in the resource name, are replaced with underscore (\fB_\fR) characters. A pseudo property "name" is also supported that allows you to replace the data set name with a specified name. The specified name is then used to replace the prefix dataset in the case of inheritance. For example, if the dataset \fBdata/home/john\fR is set to \fBname=john\fR, then \fBdata/home/john\fR has a resource name of \fBjohn\fR. If a child dataset of \fBdata/home/john/backups\fR, it has a resource name of \fBjohn_backups\fR.
 .sp
-Because \fBSMB\fR shares requires a resource name, a unique resource name is constructed from the dataset name. The constructed name is a copy of the dataset name except that the characters in the dataset name, which would be illegal in the resource name, are replaced with underscore
-(_) characters. A pseudo property "name" is also supported that allows you to replace the data set name with a specified name. The specified name is then used to replace the prefix dataset in the case of inheritance. For example, if the dataset "\fBdata/home/john\fR"
-is set to "name=john", then "\fBdata/home/john\fR" has a resource name of "john". If a child dataset of "\fBdata/home/john/backups\fR", it has a resource name of "john_backups".
+When SMB shares are created, the SMB share name appears as an entry in the \fB\&.zfs/shares\fR directory. You can use the \fBls\fR or \fBchmod\fR command to display the share-level ACLs on the entries in this directory.
 .sp
-When the "sharesmb" property is changed for a dataset, the dataset and any children inheriting the property are re-shared with the new options, only if the property was previously set to "off", or if they were shared before the property was changed. If the new property
-is set to "off", the file systems are unshared.
+When the \fBsharesmb\fR property is changed for a dataset, the dataset and any children inheriting the property are re-shared with the new options, only if the property was previously set to \fBoff\fR, or if they were shared before the property was changed. If the new property is set to \fBoff\fR, the file systems are unshared.
 .RE
 
 .sp
@@ -756,11 +776,9 @@ is set to "off", the file systems are un
 .ad
 .sp .6
 .RS 4n
-Controls whether the file system is shared via \fBNFS\fR, and what options are used. A file system with a"\fBsharenfs\fR" property of "off" is managed through traditional tools such as \fBshare\fR(1M), \fBunshare\fR(1M), and \fBdfstab\fR(4). Otherwise, the file system is automatically shared and unshared with the "\fBzfs share\fR" and "\fBzfs unshare\fR" commands. If the property is set to "on",
-the \fBshare\fR(1M) command is invoked with no options. Otherwise, the \fBshare\fR(1M) command is invoked with options equivalent to the contents of this property.
+Controls whether the file system is shared via \fBNFS\fR, and what options are used. A file system with a"\fBsharenfs\fR" property of "off" is managed through traditional tools such as \fBshare\fR(1M), \fBunshare\fR(1M), and \fBdfstab\fR(4). Otherwise, the file system is automatically shared and unshared with the "\fBzfs share\fR" and "\fBzfs unshare\fR" commands. If the property is set to "on", the \fBshare\fR(1M) command is invoked with no options. Otherwise, the \fBshare\fR(1M) command is invoked with options equivalent to the contents of this property.
 .sp
-When the "sharenfs" property is changed for a dataset, the dataset and any children inheriting the property are re-shared with the new options, only if the property was previously "off", or if they were shared before the property was changed. If the new property is "off",
-the file systems are unshared.
+When the "sharenfs" property is changed for a dataset, the dataset and any children inheriting the property are re-shared with the new options, only if the property was previously "off", or if they were shared before the property was changed. If the new property is "off", the file systems are unshared.
 .RE
 
 .sp
@@ -793,14 +811,11 @@ The on-disk version of this file system,
 .ad
 .sp .6
 .RS 4n
-For volumes, specifies the logical size of the volume. By default, creating a volume establishes a reservation of equal size. For storage pools with a version number of 9 or higher, a \fBrefreservation\fR is set instead. Any changes to \fBvolsize\fR are
-reflected in an equivalent change to the reservation (or \fBrefreservation\fR). The \fBvolsize\fR can only be set to a multiple of \fBvolblocksize\fR, and cannot be zero.
+For volumes, specifies the logical size of the volume. By default, creating a volume establishes a reservation of equal size. For storage pools with a version number of 9 or higher, a \fBrefreservation\fR is set instead. Any changes to \fBvolsize\fR are reflected in an equivalent change to the reservation (or \fBrefreservation\fR). The \fBvolsize\fR can only be set to a multiple of \fBvolblocksize\fR, and cannot be zero.
 .sp
-The reservation is kept equal to the volume's logical size to prevent unexpected behavior for consumers. Without the reservation, the volume could run out of space, resulting in undefined behavior or data corruption, depending on how the volume is used. These effects can also occur when
-the volume size is changed while it is in use (particularly when shrinking the size). Extreme care should be used when adjusting the volume size.
+The reservation is kept equal to the volume's logical size to prevent unexpected behavior for consumers. Without the reservation, the volume could run out of space, resulting in undefined behavior or data corruption, depending on how the volume is used. These effects can also occur when the volume size is changed while it is in use (particularly when shrinking the size). Extreme care should be used when adjusting the volume size.
 .sp
-Though not recommended, a "sparse volume" (also known as "thin provisioning") can be created by specifying the \fB-s\fR option to the "\fBzfs create -V\fR" command, or by changing the reservation after the volume has been created.
-A "sparse volume" is a volume where the reservation is less then the volume size. Consequently, writes to a sparse volume can fail with \fBENOSPC\fR when the pool is low on space. For a sparse volume, changes to \fBvolsize\fR are not reflected in the reservation.
+Though not recommended, a "sparse volume" (also known as "thin provisioning") can be created by specifying the \fB-s\fR option to the "\fBzfs create -V\fR" command, or by changing the reservation after the volume has been created. A "sparse volume" is a volume where the reservation is less then the volume size. Consequently, writes to a sparse volume can fail with \fBENOSPC\fR when the pool is low on space. For a sparse volume, changes to \fBvolsize\fR are not reflected in the reservation.
 .RE
 
 .sp
@@ -838,8 +853,7 @@ Controls whether the dataset is managed 
 
 .sp
 .LP
-The following three properties cannot be changed after the file system is created, and therefore, should be set when the file system is created. If the properties are not set with the "\fBzfs create\fR" command, these properties are inherited from the parent dataset.
-If the parent dataset lacks these properties due to having been created prior to these features being supported, the new file system will have the default values for these properties.
+The following three properties cannot be changed after the file system is created, and therefore, should be set when the file system is created. If the properties are not set with the "\fBzfs create\fR" or "\fBzpool create\fR" commands, these properties are inherited from the parent dataset. If the parent dataset lacks these properties due to having been created prior to these features being supported, the new file system will have the default values for these properties.
 .sp
 .ne 2
 .mk
@@ -848,11 +862,9 @@ If the parent dataset lacks these proper
 .ad
 .sp .6
 .RS 4n
-Indicates whether the file name matching algorithm used by the file system should be case-sensitive, case-insensitive, or allow a combination of both styles of matching. The default value for the "\fBcasesensitivity\fR" property is "\fBsensitive\fR."
-Traditionally, UNIX and POSIX file systems have case-sensitive file names.
+Indicates whether the file name matching algorithm used by the file system should be case-sensitive, case-insensitive, or allow a combination of both styles of matching. The default value for the "\fBcasesensitivity\fR" property is "\fBsensitive\fR." Traditionally, UNIX and POSIX file systems have case-sensitive file names.
 .sp
-The "\fBmixed\fR" value for the "\fBcasesensitivity\fR" property indicates that the file system can support requests for both case-sensitive and case-insensitive matching behavior. Currently, case-insensitive matching behavior on a file system
-that supports mixed behavior is limited to the Solaris CIFS server product. For more information about the "mixed" value behavior, see the \fIZFS Administration Guide\fR.
+The "\fBmixed\fR" value for the "\fBcasesensitivity\fR" property indicates that the file system can support requests for both case-sensitive and case-insensitive matching behavior. Currently, case-insensitive matching behavior on a file system that supports mixed behavior is limited to the Solaris CIFS server product. For more information about the "mixed" value behavior, see the \fIZFS Administration Guide\fR.
 .RE
 
 .sp
@@ -863,20 +875,7 @@ that supports mixed behavior is limited 
 .ad
 .sp .6
 .RS 4n
-Indicates whether the file system should perform a \fBunicode\fR normalization of file names whenever two file names are compared, and which normalization algorithm should be used. File names are always stored unmodified, names are normalized as part of any comparison
-process. If this property is set to a legal value other than "\fBnone\fR," and the "\fButf8only\fR" property was left unspecified, the "\fButf8only\fR" property is automatically set to "\fBon\fR."
-The default value of the "\fBnormalization\fR" property is "\fBnone\fR." This property cannot be changed after the file system is created.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fBjailed =\fIon\fR | \fIoff\fR\fR
-.ad
-.sp .6
-.RS 4n
-Controls whether the dataset is managed from within a jail. The default value is "off".
+Indicates whether the file system should perform a \fBunicode\fR normalization of file names whenever two file names are compared, and which normalization algorithm should be used. File names are always stored unmodified, names are normalized as part of any comparison process. If this property is set to a legal value other than "\fBnone\fR," and the "\fButf8only\fR" property was left unspecified, the "\fButf8only\fR" property is automatically set to "\fBon\fR." The default value of the "\fBnormalization\fR" property is "\fBnone\fR." This property cannot be changed after the file system is created.
 .RE
 
 .sp
@@ -887,63 +886,52 @@ Controls whether the dataset is managed 
 .ad
 .sp .6
 .RS 4n
-Indicates whether the file system should reject file names that include characters that are not present in the \fBUTF-8\fR character code set. If this property is explicitly set to "\fBoff\fR," the normalization property must either not be
-explicitly set or be set to "\fBnone\fR." The default value for the "\fButf8only\fR" property is "off." This property cannot be changed after the file system is created.
+Indicates whether the file system should reject file names that include characters that are not present in the \fBUTF-8\fR character code set. If this property is explicitly set to "\fBoff\fR," the normalization property must either not be explicitly set or be set to "\fBnone\fR." The default value for the "\fButf8only\fR" property is "off." This property cannot be changed after the file system is created.
 .RE
 
 .sp
 .LP
-The "\fBcasesensitivity\fR," "\fBnormalization\fR," and "\fButf8only\fR" properties are also new permissions that can be assigned to non-privileged users by using the \fBZFS\fR delegated administration
-feature.
+The "\fBcasesensitivity\fR," "\fBnormalization\fR," and "\fButf8only\fR" properties are also new permissions that can be assigned to non-privileged users by using the \fBZFS\fR delegated administration feature.
 .SS "Temporary Mount Point Properties"
 .sp
 .LP
-When a file system is mounted, either through \fBmount\fR(1M) for legacy mounts or the "\fBzfs mount\fR" command for normal file systems,
-its mount options are set according to its properties. The correlation between properties and mount options is as follows:
+When a file system is mounted, either through \fBmount\fR(1M) for legacy mounts or the "\fBzfs mount\fR" command for normal file systems, its mount options are set according to its properties. The correlation between properties and mount options is as follows:
 .sp
 .in +2
 .nf
     PROPERTY                MOUNT OPTION
-    devices                 devices/nodevices
-    exec                    exec/noexec
-    readonly                ro/rw
-    setuid                  setuid/nosetuid
-    xattr                   xattr/noxattr
+     devices                 devices/nodevices
+     exec                    exec/noexec
+     readonly                ro/rw
+     setuid                  setuid/nosetuid
+     xattr                   xattr/noxattr
 .fi
 .in -2
 .sp
 
 .sp
 .LP
-In addition, these options can be set on a per-mount basis using the \fB-o\fR option, without affecting the property that is stored on disk. The values specified on the command line override the values stored in the dataset. The \fB-nosuid\fR option is an alias for "nodevices,nosetuid".
-These properties are reported as "temporary" by the "\fBzfs get\fR" command. If the properties are changed while the dataset is mounted, the new setting overrides any temporary settings.
+In addition, these options can be set on a per-mount basis using the \fB-o\fR option, without affecting the property that is stored on disk. The values specified on the command line override the values stored in the dataset. The \fB-nosuid\fR option is an alias for "nodevices,nosetuid". These properties are reported as "temporary" by the "\fBzfs get\fR" command. If the properties are changed while the dataset is mounted, the new setting overrides any temporary settings.
 .SS "User Properties"
 .sp
 .LP
-In addition to the standard native properties, \fBZFS\fR supports arbitrary user properties. User properties have no effect on \fBZFS\fR behavior, but applications or administrators can use them to annotate datasets.
-.sp
-.LP
-User property names must contain a colon (":") character, to distinguish them from native properties. They might contain lowercase letters, numbers, and the following punctuation characters: colon (":"), dash ("-"), period ("."), and underscore
-("_"). The expected convention is that the property name is divided into two portions such as "\fImodule\fR:\fIproperty\fR", but this namespace is not enforced by \fBZFS\fR. User property names can be at most 256 characters,
-and cannot begin with a dash ("-").
+In addition to the standard native properties, \fBZFS\fR supports arbitrary user properties. User properties have no effect on \fBZFS\fR behavior, but applications or administrators can use them to annotate datasets (file systems, volumes, and snapshots).
 .sp
 .LP
-When making programmatic use of user properties, it is strongly suggested to use a reversed \fBDNS\fR domain name for the \fImodule\fR component of property names to reduce the chance that two independently-developed packages use the same property name for
-different purposes. Property names beginning with "com.sun." are reserved for use by Sun Microsystems.
+User property names must contain a colon (":") character to distinguish them from native properties. They may contain lowercase letters, numbers, and the following punctuation characters: colon (":"), dash ("-"), period ("."), and underscore ("_"). The expected convention is that the property name is divided into two portions such as "\fImodule\fR:\fIproperty\fR", but this namespace is not enforced by \fBZFS\fR. User property names can be at most 256 characters, and cannot begin with a dash ("-").
 .sp
 .LP
-The values of user properties are arbitrary strings, are always inherited, and are never validated. All of the commands that operate on properties ("zfs list", "zfs get", "zfs set", etc.) can be used to manipulate both native properties and user properties.
-Use the "\fBzfs inherit\fR" command to clear a user property . If the property is not defined in any parent dataset, it is removed entirely. Property values are limited to 1024 characters.
-.SS "Volumes as Swap or Dump Devices"
+When making programmatic use of user properties, it is strongly suggested to use a reversed \fBDNS\fR domain name for the \fImodule\fR component of property names to reduce the chance that two independently-developed packages use the same property name for different purposes. Property names beginning with "com.sun." are reserved for use by Sun Microsystems.
 .sp
 .LP
-To set up a swap area, create a \fBZFS\fR volume of a specific size and then enable swap on that device. For more information, see the EXAMPLES section.
+The values of user properties are arbitrary strings, are always inherited, and are never validated. All of the commands that operate on properties ("zfs list", "zfs get", "zfs set", etc.) can be used to manipulate both native properties and user properties. Use the "\fBzfs inherit\fR" command to clear a user property . If the property is not defined in any parent dataset, it is removed entirely. Property values are limited to 1024 characters.
+.SS "ZFS Volumes as Swap or Dump Devices"
 .sp
 .LP
-Do not swap to a file on a \fBZFS\fR file system. A \fBZFS\fR swap file configuration is not supported.
+During an initial installation or a live upgrade from a \fBUFS\fR file system, a swap device and dump device are created on \fBZFS\fR volumes in the \fBZFS\fR root pool. By default, the swap area size is based on 1/2 the size of physical memory up to 2 Gbytes. The size of the dump device depends on the kernel's requirements at installation time. Separate \fBZFS\fR volumes must be used for the swap area and dump devices. Do not swap to a file on a \fBZFS\fR file system. A \fBZFS\fR swap file configuration is not supported. 
 .sp
 .LP
-Using a \fBZFS\fR volume as a dump device is not supported.
+If you need to change your swap area or dump device after the system is installed or upgraded, use the \fBswap\fR(1M) and \fBdumpadm\fR(1M) commands. If you need to change the size of your swap area or dump device, see the \fISolaris ZFS Administration Guide\fR.
 .SH SUBCOMMANDS
 .sp
 .LP
@@ -974,10 +962,9 @@ Creates a new \fBZFS\fR file system. The
 .na
 \fB\fB-p\fR\fR
 .ad
-.RS 21n
-.rt  
-Creates all the non-existing parent datasets. Datasets created in this manner are automatically mounted according to the "mountpoint" property inherited from their parent. Any property specified on the command line using the \fB-o\fR option is ignored. If
-the target filesystem already exists, the operation completes successfully.
+.sp .6
+.RS 4n
+Creates all the non-existing parent datasets. Datasets created in this manner are automatically mounted according to the "mountpoint" property inherited from their parent. Any property specified on the command line using the \fB-o\fR option is ignored. If the target filesystem already exists, the operation completes successfully.
 .RE
 
 .sp
@@ -986,10 +973,9 @@ the target filesystem already exists, th
 .na
 \fB\fB-o\fR \fIproperty\fR=\fIvalue\fR\fR
 .ad
-.RS 21n
-.rt  
-Sets the specified property as if "\fBzfs set property=value\fR" was invoked at the same time the dataset was created. Any editable \fBZFS\fR property can also be set at creation time. Multiple \fB-o\fR options can be specified. An
-error results if the same property is specified in multiple \fB-o\fR options.
+.sp .6
+.RS 4n
+Sets the specified property as if "\fBzfs set property=value\fR" was invoked at the same time the dataset was created. Any editable \fBZFS\fR property can also be set at creation time. Multiple \fB-o\fR options can be specified. An error results if the same property is specified in multiple \fB-o\fR options.
 .RE
 
 .RE
@@ -1002,8 +988,7 @@ error results if the same property is sp
 .ad
 .sp .6
 .RS 4n
-Creates a volume of the given size. The volume is exported as a block device in \fB/dev/zvol/{dsk,rdsk}/\fIpath\fR\fR, where \fIpath\fR is the name of the volume in the \fBZFS\fR namespace. The size represents
-the logical size as exported by the device. By default, a reservation of equal size is created.
+Creates a volume of the given size. The volume is exported as a block device in \fB/dev/zvol/{dsk,rdsk}/\fIpath\fR\fR, where \fIpath\fR is the name of the volume in the \fBZFS\fR namespace. The size represents the logical size as exported by the device. By default, a reservation of equal size is created.
 .sp
 \fIsize\fR is automatically rounded up to the nearest 128 Kbytes to ensure that the volume has an integral number of blocks regardless of \fIblocksize\fR.
 .sp
@@ -1012,10 +997,9 @@ the logical size as exported by the devi
 .na
 \fB\fB-p\fR\fR
 .ad
-.RS 21n
-.rt  
-Creates all the non-existing parent datasets. Datasets created in this manner are automatically mounted according to the "mountpoint" property inherited from their parent. Any property specified on the command line using the \fB-o\fR option is ignored. If
-the target filesystem already exists, the operation completes successfully.
+.sp .6
+.RS 4n
+Creates all the non-existing parent datasets. Datasets created in this manner are automatically mounted according to the "mountpoint" property inherited from their parent. Any property specified on the command line using the \fB-o\fR option is ignored. If the target filesystem already exists, the operation completes successfully.
 .RE
 
 .sp
@@ -1024,8 +1008,8 @@ the target filesystem already exists, th
 .na
 \fB\fB-s\fR\fR
 .ad
-.RS 21n
-.rt  
+.sp .6
+.RS 4n
 Creates a sparse volume with no reservation. See "volsize" in the Native Properties section for more information about sparse volumes.
 .RE
 
@@ -1035,10 +1019,9 @@ Creates a sparse volume with no reservat
 .na
 \fB\fB-o\fR \fIproperty\fR=\fIvalue\fR\fR
 .ad
-.RS 21n
-.rt  
-Sets the specified property as if "\fBzfs set property=value\fR" was invoked at the same time the dataset was created. Any editable \fBZFS\fR property can also be set at creation time. Multiple \fB-o\fR options can be specified. An
-error results if the same property is specified in multiple \fB-o\fR options.
+.sp .6
+.RS 4n
+Sets the specified property as if "\fBzfs set property=value\fR" was invoked at the same time the dataset was created. Any editable \fBZFS\fR property can also be set at creation time. Multiple \fB-o\fR options can be specified. An error results if the same property is specified in multiple \fB-o\fR options.
 .RE
 
 .sp
@@ -1047,10 +1030,9 @@ error results if the same property is sp
 .na
 \fB\fB-b\fR \fIblocksize\fR\fR
 .ad
-.RS 21n
-.rt  
-Equivalent to "\fB\fR\fB-o\fR \fBvolblocksize=\fIblocksize\fR\fR". If this option is specified in conjunction with "\fB\fR\fB-o\fR \fBvolblocksize\fR", the resulting
-behavior is undefined.
+.sp .6
+.RS 4n
+Equivalent to "\fB\fR\fB-o\fR \fBvolblocksize=\fIblocksize\fR\fR". If this option is specified in conjunction with "\fB\fR\fB-o\fR \fBvolblocksize\fR", the resulting behavior is undefined.
 .RE
 
 .RE
@@ -1070,8 +1052,8 @@ Destroys the given dataset. By default, 
 .na
 \fB\fB-r\fR\fR
 .ad
-.RS 6n
-.rt  
+.sp .6
+.RS 4n
 Recursively destroy all children. If a snapshot is specified, destroy all snapshots with this name in descendent file systems.
 .RE
 
@@ -1081,8 +1063,8 @@ Recursively destroy all children. If a s
 .na
 \fB\fB-R\fR\fR
 .ad
-.RS 6n
-.rt  
+.sp .6
+.RS 4n
 Recursively destroy all dependents, including cloned file systems outside the target hierarchy. If a snapshot is specified, destroy all snapshots with this name in descendent file systems.
 .RE
 
@@ -1092,8 +1074,8 @@ Recursively destroy all dependents, incl
 .na
 \fB\fB-f\fR\fR
 .ad
-.RS 6n
-.rt  
+.sp .6
+.RS 4n
 Force an unmount of any file systems using the "\fBunmount -f\fR" command. This option has no effect on non-file systems or unmounted file systems.
 .RE
 
@@ -1104,7 +1086,7 @@ Extreme care should be taken when applyi
 .ne 2
 .mk
 .na
-\fB\fBzfs snapshot\fR [\fB-r\fR] \fIfilesystem@snapname\fR|\fIvolume@snapname\fR\fR
+\fB\fBzfs snapshot\fR [\fB-r\fR] [\fB-o\fR \fIproperty\fR=\fIvalue\fR] ... \fIfilesystem@snapname\fR|\fIvolume@snapname\fR\fR
 .ad
 .sp .6
 .RS 4n
@@ -1115,11 +1097,22 @@ Creates a snapshot with the given name. 
 .na
 \fB\fB-r\fR\fR
 .ad
-.RS 6n
-.rt  
+.sp .6
+.RS 4n
 Recursively create snapshots of all descendent datasets. Snapshots are taken atomically, so that all recursive snapshots correspond to the same moment in time.
 .RE
 
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-o\fR \fIproperty\fR=\fIvalue\fR\fR
+.ad
+.sp .6
+.RS 4n
+Sets the specified property; see "\fBzfs create\fR" for details.
+.RE
+
 .RE
 
 .sp
@@ -1130,16 +1123,15 @@ Recursively create snapshots of all desc
 .ad
 .sp .6
 .RS 4n
-Roll back the given dataset to a previous snapshot. When a dataset is rolled back, all data that has changed since the snapshot is discarded, and the dataset reverts to the state at the time of the snapshot. By default, the command refuses to roll back to a snapshot other than
-the most recent one. In order to do so, all intermediate snapshots must be destroyed by specifying the \fB-r\fR option.
+Roll back the given dataset to a previous snapshot. When a dataset is rolled back, all data that has changed since the snapshot is discarded, and the dataset reverts to the state at the time of the snapshot. By default, the command refuses to roll back to a snapshot other than the most recent one. In order to do so, all intermediate snapshots must be destroyed by specifying the \fB-r\fR option.
 .sp
 .ne 2
 .mk
 .na
 \fB\fB-r\fR\fR
 .ad
-.RS 6n
-.rt  
+.sp .6
+.RS 4n
 Recursively destroy any snapshots more recent than the one specified.
 .RE
 
@@ -1149,8 +1141,8 @@ Recursively destroy any snapshots more r
 .na
 \fB\fB-R\fR\fR
 .ad
-.RS 6n
-.rt  
+.sp .6
+.RS 4n
 Recursively destroy any more recent snapshots, as well as any clones of those snapshots.
 .RE
 
@@ -1160,8 +1152,8 @@ Recursively destroy any more recent snap
 .na
 \fB\fB-f\fR\fR
 .ad
-.RS 6n
-.rt  
+.sp .6
+.RS 4n
 Used with the \fB-R\fR option to force an unmount of any clone file systems that are to be destroyed.
 .RE
 
@@ -1171,7 +1163,7 @@ Used with the \fB-R\fR option to force a
 .ne 2
 .mk
 .na
-\fB\fBzfs clone\fR [\fB-p\fR] \fIsnapshot\fR \fIfilesystem\fR|\fIvolume\fR\fR
+\fB\fBzfs clone\fR [\fB-p\fR] [\fB-o\fR \fIproperty\fR=\fIvalue\fR] ... \fIsnapshot\fR \fIfilesystem\fR|\fIvolume\fR\fR
 .ad
 .sp .6
 .RS 4n
@@ -1182,11 +1174,22 @@ Creates a clone of the given snapshot. S
 .na
 \fB\fB-p\fR\fR
 .ad
-.RS 6n
-.rt  
+.sp .6
+.RS 4n
 Creates all the non-existing parent datasets. Datasets created in this manner are automatically mounted according to the "mountpoint" property inherited from their parent. If the target filesystem or volume already exists, the operation completes successfully.
 .RE
 
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-o\fR \fIproperty\fR=\fIvalue\fR\fR
+.ad
+.sp .6
+.RS 4n
+Sets the specified property; see "\fBzfs create\fR" for details.
+.RE
+
 .RE
 
 .sp
@@ -1197,11 +1200,9 @@ Creates all the non-existing parent data
 .ad
 .sp .6
 .RS 4n
-Promotes a clone file system to no longer be dependent on its "origin" snapshot. This makes it possible to destroy the file system that the clone was created from. The clone parent-child dependency relationship is reversed, so that the "origin" file system
-becomes a clone of the specified file system. 
+Promotes a clone file system to no longer be dependent on its "origin" snapshot. This makes it possible to destroy the file system that the clone was created from. The clone parent-child dependency relationship is reversed, so that the "origin" file system becomes a clone of the specified file system. 
 .sp
-The snapshot that was cloned, and any snapshots previous to this snapshot, are now owned by the promoted clone. The space they use moves from the "origin" file system to the promoted clone, so enough space must be available to accommodate these snapshots. No new space is consumed
-by this operation, but the space accounting is adjusted. The promoted clone must not have any conflicting snapshot names of its own. The "\fBrename\fR" subcommand can be used to rename any conflicting snapshots.
+The snapshot that was cloned, and any snapshots previous to this snapshot, are now owned by the promoted clone. The space they use moves from the "origin" file system to the promoted clone, so enough space must be available to accommodate these snapshots. No new space is consumed by this operation, but the space accounting is adjusted. The promoted clone must not have any conflicting snapshot names of its own. The "\fBrename\fR" subcommand can be used to rename any conflicting snapshots.
 .RE
 
 .sp
@@ -1216,21 +1217,19 @@ by this operation, but the space account
 .ad
 .br
 .na
-\fB\fBzfs
-rename\fR [\fB-p\fR] \fIfilesystem\fR|\fIvolume\fR \fIfilesystem\fR|\fIvolume\fR\fR
+\fB\fBzfs rename\fR [\fB-p\fR] \fIfilesystem\fR|\fIvolume\fR \fIfilesystem\fR|\fIvolume\fR\fR
 .ad
 .sp .6
 .RS 4n
-Renames the given dataset. The new target can be located anywhere in the \fBZFS\fR hierarchy, with the exception of snapshots. Snapshots can only be renamed within the parent file system or volume. When renaming a snapshot, the parent file system of the snapshot does
-not need to be specified as part of the second argument. Renamed file systems can inherit new mount points, in which case they are unmounted and remounted at the new mount point.
+Renames the given dataset. The new target can be located anywhere in the \fBZFS\fR hierarchy, with the exception of snapshots. Snapshots can only be renamed within the parent file system or volume. When renaming a snapshot, the parent file system of the snapshot does not need to be specified as part of the second argument. Renamed file systems can inherit new mount points, in which case they are unmounted and remounted at the new mount point.
 .sp
 .ne 2
 .mk
 .na
 \fB\fB-p\fR\fR
 .ad
-.RS 6n
-.rt  
+.sp .6
+.RS 4n
 Creates all the non-existing parent datasets. Datasets created in this manner are automatically mounted according to the "mountpoint" property inherited from their parent.
 .RE
 
@@ -1259,7 +1258,7 @@ Recursively rename the snapshots of all 
 .ad
 .sp .6
 .RS 4n
-Lists the property information for the given datasets in tabular form. If specified, you can list property information by the absolute pathname or the relative pathname. By default, all datasets are displayed and contain the following fields:
+Lists the property information for the given datasets in tabular form. If specified, you can list property information by the absolute pathname or the relative pathname. By default, all file systems and volumes are displayed. Snapshots are displayed if the "listsnaps" property is "on" (the default is "off") . The following fields are displayed:

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

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Apr  6 23:03:21 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 171D1106566C;
	Tue,  6 Apr 2010 23:03:21 +0000 (UTC)
	(envelope-from rmacklem@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 040838FC14;
	Tue,  6 Apr 2010 23:03:21 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o36N3K3c005976;
	Tue, 6 Apr 2010 23:03:20 GMT (envelope-from rmacklem@svn.freebsd.org)
Received: (from rmacklem@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o36N3KEd005974;
	Tue, 6 Apr 2010 23:03:20 GMT (envelope-from rmacklem@svn.freebsd.org)
Message-Id: <201004062303.o36N3KEd005974@svn.freebsd.org>
From: Rick Macklem 
Date: Tue, 6 Apr 2010 23:03:20 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206288 - stable/8/sys/rpc
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 06 Apr 2010 23:03:21 -0000

Author: rmacklem
Date: Tue Apr  6 23:03:20 2010
New Revision: 206288
URL: http://svn.freebsd.org/changeset/base/206288

Log:
  MFC: r205562
  When the regular NFS server replied to a UDP client out of the replay
  cache, it did not free the request argument mbuf list, resulting in a leak.
  This patch fixes that leak.
  
  PR:	kern/144330

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

Modified: stable/8/sys/rpc/svc.c
==============================================================================
--- stable/8/sys/rpc/svc.c	Tue Apr  6 21:39:18 2010	(r206287)
+++ stable/8/sys/rpc/svc.c	Tue Apr  6 23:03:20 2010	(r206288)
@@ -819,9 +819,11 @@ svc_getreq(SVCXPRT *xprt, struct svc_req
 					free(r->rq_addr, M_SONAME);
 					r->rq_addr = NULL;
 				}
+				m_freem(args);
 				goto call_done;
 
 			default:
+				m_freem(args);
 				goto call_done;
 			}
 		}

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Apr  6 23:14:43 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5A582106566B;
	Tue,  6 Apr 2010 23:14:43 +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 44B518FC13;
	Tue,  6 Apr 2010 23:14:43 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o36NEh9d009230;
	Tue, 6 Apr 2010 23:14:43 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o36NEh2o009225;
	Tue, 6 Apr 2010 23:14:43 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <201004062314.o36NEh2o009225@svn.freebsd.org>
From: Andrew Thompson 
Date: Tue, 6 Apr 2010 23:14:43 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206289 - in stable/8/sys: conf contrib/dev/run dev/usb
	dev/usb/wlan modules modules/runfw modules/usb modules/usb/run
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 06 Apr 2010 23:14:43 -0000

Author: thompsa
Date: Tue Apr  6 23:14:43 2010
New Revision: 206289
URL: http://svn.freebsd.org/changeset/base/206289

Log:
  MFC r203134
  
   Add run(4), a driver for Ralink RT2700U/RT2800U/RT3000U USB 802.11agn devices.
  
   This driver was written for OpenBSD by Damien Bergamini and ported over by
   Akinori Furukoshi.

Added:
  stable/8/sys/contrib/dev/run/
     - copied from r203134, head/sys/contrib/dev/run/
  stable/8/sys/dev/usb/wlan/if_run.c
     - copied unchanged from r203134, head/sys/dev/usb/wlan/if_run.c
  stable/8/sys/dev/usb/wlan/if_runreg.h
     - copied unchanged from r203134, head/sys/dev/usb/wlan/if_runreg.h
  stable/8/sys/dev/usb/wlan/if_runvar.h
     - copied unchanged from r203134, head/sys/dev/usb/wlan/if_runvar.h
  stable/8/sys/modules/runfw/
     - copied from r203134, head/sys/modules/runfw/
  stable/8/sys/modules/usb/run/
     - copied from r203134, head/sys/modules/usb/run/
Modified:
  stable/8/sys/conf/files
  stable/8/sys/dev/usb/usbdevs
  stable/8/sys/modules/Makefile
  stable/8/sys/modules/usb/Makefile
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/conf/files
==============================================================================
--- stable/8/sys/conf/files	Tue Apr  6 23:03:20 2010	(r206288)
+++ stable/8/sys/conf/files	Tue Apr  6 23:14:43 2010	(r206289)
@@ -1717,6 +1717,7 @@ dev/usb/net/uhso.c		optional uhso
 # USB WLAN drivers
 #
 dev/usb/wlan/if_rum.c		optional rum
+dev/usb/wlan/if_run.c		optional run
 dev/usb/wlan/if_uath.c		optional uath
 dev/usb/wlan/if_upgt.c		optional upgt
 dev/usb/wlan/if_ural.c		optional ural

Modified: stable/8/sys/dev/usb/usbdevs
==============================================================================
--- stable/8/sys/dev/usb/usbdevs	Tue Apr  6 23:03:20 2010	(r206288)
+++ stable/8/sys/dev/usb/usbdevs	Tue Apr  6 23:14:43 2010	(r206289)
@@ -524,6 +524,7 @@ vendor ELCON		0x0db7	ELCON Systemtechnik
 vendor NETAC		0x0dd8	Netac
 vendor SITECOMEU	0x0df6	Sitecom Europe
 vendor MOBILEACTION	0x0df7	Mobile Action
+vendor AMIGO		0x0e0b	Amigo Technology
 vendor SPEEDDRAGON	0x0e55	Speed Dragon Multimedia
 vendor HAWKING		0x0e66	Hawking
 vendor FOSSIL		0x0e67	Fossil, Inc
@@ -589,12 +590,14 @@ vendor NETGEAR3		0x1385	Netgear
 vendor BALTECH		0x13ad	Baltech
 vendor CISCOLINKSYS	0x13b1	Cisco-Linksys
 vendor SHARK		0x13d2	Shark
+vendor AZUREWAVE	0x13d3	AsureWave
 vendor EMTEC		0x13fe	Emtec
 vendor NOVATEL		0x1410	Novatel Wireless
 vendor MERLIN		0x1416	Merlin
 vendor WISTRONNEWEB	0x1435	Wistron NeWeb
 vendor RADIOSHACK	0x1453	Radio Shack
 vendor HUAWEI3COM	0x1472	Huawei-3Com
+vendor ABOCOM2		0x1482	AboCom Systems
 vendor SILICOM		0x1485	Silicom
 vendor RALINK		0x148f	Ralink Technology
 vendor IMAGINATION	0x149a	Imagination Technologies
@@ -610,6 +613,7 @@ vendor OQO		0x1557	OQO
 vendor UMEDIA		0x157e	U-MEDIA Communications
 vendor FIBERLINE	0x1582	Fiberline
 vendor SPARKLAN		0x15a9	SparkLAN
+vendor AMIT2		0x15c5	AMIT
 vendor SOHOWARE		0x15e8	SOHOware
 vendor UMAX		0x1606	UMAX Data Systems
 vendor INSIDEOUT	0x1608	Inside Out Networks
@@ -617,6 +621,7 @@ vendor AMOI		0x1614	Amoi Electronics
 vendor GOODWAY		0x1631	Good Way Technology
 vendor ENTREGA		0x1645	Entrega
 vendor ACTIONTEC	0x1668	Actiontec Electronics
+vendor CISCOLINKSYS2	0x167b  Cisco-Linksys
 vendor ATHEROS		0x168c	Atheros Communications
 vendor GIGASET		0x1690	Gigaset
 vendor GLOBALSUN	0x16ab	Global Sun Technology
@@ -626,6 +631,8 @@ vendor CMOTECH		0x16d8	C-motech
 vendor AXESSTEL		0x1726  Axesstel Co., Ltd.
 vendor LINKSYS4		0x1737	Linksys
 vendor SENAO		0x1740	Senao
+vendor ASUS2		0x1761	ASUS
+vendor SWEEX2		0x177f	Sweex
 vendor METAGEEK		0x1781	MetaGeek
 vendor AMIT		0x18c5	AMIT
 vendor QCOM		0x18e8	Qcom
@@ -637,11 +644,15 @@ vendor TCTMOBILE	0x1bbb  TCT Mobile
 vendor TELIT		0x1bc7  Telit
 vendor MPMAN		0x1cae	MpMan
 vendor DRESDENELEKTRONIK 0x1cf1 dresden elektronik
+vendor PEGATRON		0x1d4d	Pegatron
 vendor QISDA		0x1da5  Qisda
 vendor ALINK		0x1e0e  Alink
+vendor AIRTIES		0x1eda	AirTies
 vendor DLINK		0x2001	D-Link
 vendor PLANEX2		0x2019	Planex Communications
 vendor TLAYTECH		0x20b9	Tlay Tech
+vendor ENCORE		0x203d	Encore
+vendor PARA		0x20b8	PARA Industrial
 vendor ERICSSON		0x2282	Ericsson
 vendor MOTOROLA2	0x22b8	Motorola
 vendor TRIPPLITE	0x2478	Tripp-Lite
@@ -667,6 +678,7 @@ vendor ZINWELL		0x5a57	Zinwell
 vendor SITECOM		0x6189	Sitecom
 vendor ARKMICRO		0x6547	Arkmicro Technologies Inc.
 vendor 3COM2		0x6891	3Com
+vendor EDIMAX		0x7392	Edimax
 vendor INTEL		0x8086	Intel
 vendor INTEL2		0x8087	Intel
 vendor SITECOM2		0x9016	Sitecom
@@ -701,6 +713,12 @@ product 3COMUSR USR56K		0x3021	U.S. Robo
 /* AboCom products */
 product ABOCOM XX1		0x110c	XX1
 product ABOCOM XX2		0x200c	XX2
+product ABOCOM RT2770		0x2770	RT2770
+product ABOCOM RT2870		0x2870	RT2870
+product ABOCOM RT3070		0x3070	RT3070
+product ABOCOM RT3071		0x3071	RT3071
+product ABOCOM RT3072		0x3072	RT3072
+product ABOCOM2 RT2870_1	0x3c09	RT2870
 product ABOCOM URE450		0x4000	URE450 Ethernet Adapter
 product ABOCOM UFE1000		0x4002	UFE1000 Fast Ethernet Adapter
 product ABOCOM DSB650TX_PNA	0x4003	1/10/100 Ethernet Adapter
@@ -731,6 +749,17 @@ product ACCTON SMCWUSBTG2_NF	0x4507	SMCW
 product ACCTON SMCWUSBTG2	0x4508	SMCWUSBT-G2
 product ACCTON PRISM_GT		0x4521	PrismGT USB 2.0 WLAN
 product ACCTON SS1001		0x5046	SpeedStream Ethernet Adapter
+product ACCTON RT2870_2		0x6618	RT2870
+product ACCTON RT3070		0x7511	RT3070
+product ACCTON RT2770		0x7512	RT2770
+product ACCTON RT2870_3		0x7522	RT2870
+product ACCTON RT2870_5		0x8522	RT2870
+product ACCTON RT3070_4		0xa512	RT3070
+product ACCTON RT2870_4		0xa618	RT2870
+product	ACCTON RT3070_1		0xa701	RT3070
+product	ACCTON RT3070_2		0xa702	RT3070
+product ACCTON RT2870_1		0xb522	RT2870
+product	ACCTON RT3070_3		0xc522	RT3070
 product ACCTON ZD1211B		0xe501	ZD1211B
 
 /* Aceeca products */
@@ -833,6 +862,9 @@ product AIRPLUS MCD650		0x3198	MCD650 mo
 /* AirPrime products */
 product AIRPRIME PC5220		0x0112	CDMA Wireless PC Card
 
+/* AirTies products */
+product AIRTIES RT3070		0x2310	RT3070
+
 /* AKS products */
 product AKS USBHASP		0x0001	USB-HASP 0.06
 
@@ -872,8 +904,20 @@ product APC UPS			0x0002	Uninterruptible
 product AMBIT WLAN		0x0302	WLAN
 product AMBIT NTL_250		0x6098	NTL 250 cable modem
 
+/* American Power Conversion products */
+product APC UPS			0x0002	Uninterruptible Power Supply
+
+/* Amigo Technology products */
+product AMIGO RT2870_1		0x9031	RT2870
+product AMIGO RT2870_2		0x9041	RT2870
+
 /* AMIT products */
 product AMIT CGWLUSB2GO		0x0002	CG-WLUSB2GO
+product AMIT CGWLUSB2GNR	0x0008	CG-WLUSB2GNR
+product AMIT RT2870_1		0x0012	RT2870
+
+/* AMIT(2) products */
+product AMIT2 RT2870		0x0008	RT2870
 
 /* Anchor products */
 product ANCHOR EZUSB		0x2131	EZUSB
@@ -933,6 +977,7 @@ product ASIX AX88772		0x7720	AX88772
 product ASIX AX88772A		0x772a	AX88772A USB 2.0 10/100 Ethernet
 
 /* ASUS products */
+product ASUS2 USBN11		0x0b05	USB-N11
 product ASUS WL167G		0x1707	WL-167g Wireless Adapter
 product ASUS WL159G		0x170c	WL-159g
 product ASUS A9T_WIFI		0x171b	A9T wireless
@@ -940,6 +985,12 @@ product ASUS P5B_WIFI		0x171d	P5B wirele
 product ASUS RT2573_1		0x1723	RT2573
 product ASUS RT2573_2		0x1724	RT2573
 product ASUS LCM		0x1726	LCM display
+product ASUS RT2870_1		0x1731	RT2870
+product ASUS RT2870_2		0x1732	RT2870
+product ASUS RT2870_3		0x1742	RT2870
+product ASUS RT2870_4		0x1760	RT2870
+product ASUS RT2870_5		0x1761	RT2870
+product	ASUS RT3070		0x1784	RT3070
 product ASUS P535		0x420f	ASUS P535 PDA
 product	ASUS GMSC		0x422f	ASUS Generic Mass Storage
 product ASUS RT2570		0x1706	RT2500USB Wireless Adapter
@@ -976,6 +1027,13 @@ product AVISION 1200U		0x0268	1200U scan
 /* Axesstel products */
 product AXESSTEL DATAMODEM	0x1000  Data Modem
 
+/* AsureWave products */
+product AZUREWAVE RT2870_1	0x3247	RT2870
+product AZUREWAVE RT2870_2	0x3262	RT2870
+product AZUREWAVE RT3070_1	0x3273	RT3070
+product	AZUREWAVE RT3070_2	0x3284	RT3070
+product	AZUREWAVE RT3070_3	0x3305	RT3070
+
 /* Baltech products */
 product BALTECH CARDREADER	0x9999	Card reader
 
@@ -1006,8 +1064,13 @@ product BELKIN F5D7050A		0x705a	F5D7050A
 /* Also sold as 'Ativa 802.11g wireless card' */
 product BELKIN F5D7050_V4000	0x705c	F5D7050 v4000 Wireless Adapter
 product BELKIN F5D7050E		0x705e	F5D7050E Wireless Adapter
+product BELKIN RT2870_1		0x8053	RT2870
+product BELKIN RT2870_2		0x805c	RT2870
+product BELKIN F5D8053V3	0x815c	F5D8053 v3
+product BELKIN F5D8055		0x825a	F5D8055
 product BELKIN F5D9050V3	0x905b	F5D9050 ver 3 Wireless Adapter
 product BELKIN2 F5U002		0x0002	F5U002 Parallel printer
+product BELKIN F6D4050V1	0x935a	F6D4050 v1
 
 /* Billionton products */
 product BILLIONTON USB100	0x0986	USB100N 10/100 FastEthernet
@@ -1084,6 +1147,7 @@ product CISCOLINKSYS HU200TS	0x001a	HU20
 product CISCOLINKSYS WUSB54GC	0x0020	WUSB54GC
 product CISCOLINKSYS WUSB54GR	0x0023	WUSB54GR
 product CISCOLINKSYS WUSBF54G	0x0024	WUSBF54G
+product	CISCOLINKSYS2	RT3070	0x4001	RT3070
 
 /* CMOTECH products */
 product CMOTECH CNU510		0x5141	CDMA Technologies USB modem
@@ -1110,6 +1174,15 @@ product CONCEPTRONIC AR5523_2	0x7811	AR5
 product CONCEPTRONIC AR5523_2_NF	0x7812	AR5523 (no firmware)
 product CONCEPTRONIC2 C54RU	0x3c02	C54RU WLAN
 product CONCEPTRONIC2 C54RU2	0x3c22	C54RU
+product CONCEPTRONIC2 VIGORN61	0x3c25	VIGORN61
+product CONCEPTRONIC2 RT2870_1	0x3c06	RT2870
+product CONCEPTRONIC2 RT2870_2	0x3c07	RT2870
+product CONCEPTRONIC2 RT2870_7	0x3c09	RT2870
+product CONCEPTRONIC2 RT2870_8	0x3c12	RT2870
+product CONCEPTRONIC2 RT2870_3	0x3c23	RT2870
+product CONCEPTRONIC2 RT2870_4	0x3c25	RT2870
+product CONCEPTRONIC2 RT2870_5	0x3c27	RT2870
+product CONCEPTRONIC2 RT2870_6	0x3c28	RT2870
 
 /* Connectix products */
 product CONNECTIX QUICKCAM	0x0001	QuickCam
@@ -1124,6 +1197,12 @@ product COREGA FETHER_USB2_TX	0x0017	FEt
 product COREGA WLUSB_11_KEY	0x001a	ULUSB-11 Key
 product COREGA CGWLUSB2GL	0x002d	CG-WLUSB2GL
 product COREGA CGWLUSB2GPX	0x002e	CG-WLUSB2GPX
+product COREGA RT2870_1		0x002f	RT2870
+product COREGA RT2870_2		0x003c	RT2870
+product COREGA RT2870_3		0x003f	RT2870
+product COREGA RT3070		0x0041	RT3070
+product COREGA CGWLUSB300GNM	0x0042	CG-WLUSB300GNM
+
 product COREGA WLUSB_11_STICK	0x7613	WLAN USB Stick 11
 product COREGA FETHER_USB_TXC	0x9601	FEther USB-TXC
 
@@ -1152,6 +1231,7 @@ product CYBERPOWER 1500CAVRLCD	0x0501	15
 
 /* CyberTAN Technology products */
 product CYBERTAN TG54USB	0x1666	TG54USB
+product CYBERTAN RT2870		0x1828	RT2870
 
 /* Cypress Semiconductor products */
 product CYPRESS MOUSE		0x0001	mouse
@@ -1229,6 +1309,8 @@ product DLINK DWLAG122		0x3a04	DWL-AG122
 product DLINK DWLAG122_NF	0x3a05	DWL-AG122 (no firmware)
 product DLINK DWLG122		0x3c00	DWL-G122 b1 Wireless Adapter
 product DLINK DUBE100B1		0x3c05	DUB-E100 rev B1
+product DLINK RT2870		0x3c09	RT2870
+product DLINK RT3072		0x3c0a	RT3072
 product DLINK DSB650C		0x4000	10Mbps Ethernet
 product DLINK DSB650TX1		0x4001	10/100 Ethernet
 product DLINK DSB650TX		0x4002	10/100 Ethernet
@@ -1241,7 +1323,15 @@ product DLINK2 DWA120		0x3a0e	DWA-120
 product DLINK2 DWLG122C1	0x3c03	DWL-G122 c1
 product DLINK2 WUA1340		0x3c04	WUA-1340
 product DLINK2 DWA111		0x3c06	DWA-111
+product DLINK2 RT2870_1		0x3c09	RT2870
 product DLINK2 DWA110		0x3c07	DWA-110
+product DLINK2 RT3072		0x3c0a	RT3072
+product DLINK2 RT3070_1		0x3c0d	RT3070
+product DLINK2 RT3070_2		0x3c0e	RT3070
+product DLINK2 RT3070_3		0x3c0f	RT3070
+product DLINK2 RT2870_2		0x3c11	RT2870
+product DLINK2 DWA130		0x3c13	DWA-130
+product DLINK2 RT3070_4		0x3c15	RT3070
 product DLINK3 DWM652		0x3e04	DWM-652
 
 /* DMI products */
@@ -1257,6 +1347,12 @@ product DRESDENELEKTRONIK WIRELESSHANDHE
 /* Dynastream Innovations */
 product DYNASTREAM ANTDEVBOARD	0x1003	ANT dev board
 
+/* Edimax products */
+product EDIMAX EW7318USG	0x7318	USB Wireless dongle
+product EDIMAX RT2870_1		0x7711	RT2870
+product EDIMAX EW7717		0x7717	EW-7717
+product EDIMAX EW7718		0x7718	EW-7718
+
 /* Eicon Networks */
 product EICON DIVA852		0x4905	Diva 852 ISDN TA
 
@@ -1285,6 +1381,11 @@ product ELSA USB2ETHERNET	0x3000	Microli
 /* EMS products */
 product EMS DUAL_SHOOTER	0x0003	PSX gun controller converter
 
+/* Encore products */
+product ENCORE RT3070_1		0x1480	RT3070
+product ENCORE RT3070_2		0x14a1	RT3070
+product ENCORE RT3070_3		0x14a9	RT3070
+
 /* Entrega products */
 product ENTREGA 1S		0x0001	1S serial
 product ENTREGA 2S		0x0002	2S serial
@@ -1429,6 +1530,11 @@ product GIGASET SMCWUSBTG_NF	0x0711	SMCW
 product GIGASET AR5523		0x0712	AR5523
 product GIGASET AR5523_NF	0x0713	AR5523 (no firmware)
 product GIGASET RT2573		0x0722	RT2573
+product GIGASET RT3070_1	0x0740	RT3070
+product GIGASET RT3070_2	0x0744	RT3070
+product GIGABYTE RT2870_1	0x800b	RT2870
+product GIGABYTE GNWB31N	0x800c	GN-WB31N
+product GIGABYTE GNWB32L	0x800d	GN-WB32L
 
 /* Global Sun Technology product */
 product GLOBALSUN AR5523_1	0x7801	AR5523
@@ -1464,6 +1570,7 @@ product GUILLEMOT DALEADER	0xa300	DA Lea
 product GUILLEMOT HWGUSB254	0xe000	HWGUSB2-54 WLAN
 product GUILLEMOT HWGUSB254LB	0xe010	HWGUSB2-54-LB
 product GUILLEMOT HWGUSB254V2AP	0xe020	HWGUSB2-54V2-AP
+product GUILLEMOT HWNU300	0xe030	HWNU-300
 
 /* Hagiwara products */
 product HAGIWARA FGSM		0x0002	FlashGate SmartMedia Card Reader
@@ -1482,6 +1589,10 @@ product HANDSPRING TREO600	0x0300	Handsp
 product HAUPPAUGE WINTV_USB_FM	0x4d12	WinTV USB FM
 
 /* Hawking Technologies products */
+product HAWKING RT2870_1	0x0001	RT2870
+product HAWKING RT2870_2	0x0003	RT2870
+product HAWKING HWUN2		0x0009	HWUN2
+product HAWKING RT3070		0x000b	RT3070
 product HAWKING UF100		0x400c	10/100 USB Ethernet
 
 /* Hitachi, Ltd. products */
@@ -1528,6 +1639,7 @@ product HP 2215			0x1016	iPAQ 22xx/Jorna
 product HP 568J			0x1116	Jornada 568
 product HP 930C			0x1204	DeskJet 930c
 product HP P2000U		0x1801	Inkjet P-2000U
+product HP HS2300		0x1e1d  HS2300 HSDPA (aka MC8775)
 product HP 640C			0x2004	DeskJet 640c
 product HP 4670V		0x3005	ScanJet 4670v
 product HP P1100		0x3102	Photosmart P1100
@@ -1655,6 +1767,10 @@ product IODATA USBETTXS		0x0913	USB ETTX
 product IODATA USBWNB11A	0x0919	USB WN-B11
 product IODATA USBWNB11		0x0922	USB Airport WN-B11
 product IODATA ETGUS2		0x0930	ETG-US2
+product IODATA RT3072_1		0x0944	RT3072
+product IODATA RT3072_2		0x0945	RT3072
+product IODATA RT3072_3		0x0947	RT3072
+product IODATA RT3072_4		0x0948	RT3072
 product IODATA USBRSAQ		0x0a03	Serial USB-RSAQ1
 product IODATA2 USB2SC		0x0a09	USB2.0-SCSI Bridge USB2-SC
 
@@ -1779,7 +1895,11 @@ product LINKSYS2 WUSB11		0x2219	WUSB11 W
 product LINKSYS2 USB200M	0x2226	USB 2.0 10/100 Ethernet
 product LINKSYS3 WUSB11v28	0x2233	WUSB11 v2.8 Wireless Adapter
 product LINKSYS4 USB1000	0x0039	USB1000
+product LINKSYS4 WUSB100	0x0070	WUSB100
+product LINKSYS4 WUSB600N	0x0071	WUSB600N
 product LINKSYS4 WUSB54GCV2	0x0073	WUSB54GC v2
+product LINKSYS4 WUSB54GCV3	0x0077	WUSB54GC v3
+product LINKSYS4 WUSB600NV2	0x0079	WUSB600N v2
 
 /* Logitech products */
 product LOGITECH M2452		0x0203	M2452 keyboard
@@ -1809,6 +1929,9 @@ product LOGITECH QUICKCAMPRO2	0xd001	Qui
 /* Logitec Corp. products */
 product LOGITEC LDR_H443SU2	0x0033	DVD Multi-plus unit LDR-H443SU2
 product LOGITEC LDR_H443U2	0x00b3	DVD Multi-plus unit LDR-H443U2
+product LOGITEC RT2870_1	0x0162	RT2870
+product LOGITEC RT2870_2	0x0163	RT2870
+product LOGITEC RT2870_3	0x0164	RT2870
 
 /* Lucent products */
 product LUCENT EVALKIT		0x1001	USS-720 evaluation kit
@@ -1846,7 +1969,10 @@ product MELCO PCOPRS1		0x00b3	PC-OP-RS1 
 product MELCO SG54HP		0x00d8	WLI-U2-SG54HP
 product MELCO G54HP		0x00d9	WLI-U2-G54HP
 product MELCO KG54L		0x00da	WLI-U2-KG54L
+product MELCO WLIUCG300N	0x00e8	WLI-UC-G300N
 product MELCO SG54HG		0x00f4	WLI-U2-SG54HG
+product MELCO WLIUCAG300N	0x012e	WLI-UC-AG300N
+product MELCO WLIUCGN		0x015d	WLI-UC-GN
 
 /* Merlin products */
 product MERLIN V620             0x1110  Merlin V620
@@ -1864,15 +1990,25 @@ product MGE UPS2		0xffff	MGE UPS SYSTEMS
 
 /* Micro Star International products */
 product MSI BT_DONGLE		0x1967	Bluetooth USB dongle
+product MSI RT3070_1		0x3820	RT3070
+product MSI RT3070_2		0x3821	RT3070
+product MSI RT3070_3		0x3870	RT3070
 product MSI UB11B		0x6823	UB11B
 product MSI RT2570		0x6861	RT2570
 product MSI RT2570_2		0x6865	RT2570
 product MSI RT2570_3		0x6869	RT2570
 product MSI RT2573_1		0x6874	RT2573
 product MSI RT2573_2		0x6877	RT2573
+product MSI RT3070_4		0x6899	RT3070
+product MSI RT3070_5		0x821a	RT3070
+product MSI RT3070_6		0x870a	RT3070
+product MSI RT3070_7		0x899a	RT3070
 product MSI RT2573_3		0xa861	RT2573
 product MSI RT2573_4		0xa874	RT2573
 
+/* Microdia products */
+product MICRODIA TWINKLECAM	0x600d	TwinkleCam USB camera
+
 /* Microsoft products */
 product MICROSOFT SIDEPREC	0x0008	SideWinder Precision Pro
 product MICROSOFT INTELLIMOUSE	0x0009	IntelliMouse
@@ -2021,8 +2157,12 @@ product NIKON D300		0x041a  Digital Came
 product NOVATECH NV902		0x9020	NovaTech NV-902W
 product NOVATECH RT2573		0x9021	RT2573
 
+/* Nokia products */
+product NOKIA N958GB		0x0070	Nokia N95 8GBc
+
 /* Novatel Wireless products */
 product NOVATEL V640		0x1100	Merlin V620
+product NOVATEL CDMA_MODEM	0x1110	Novatel Wireless Merlin CDMA
 product NOVATEL V620		0x1110	Merlin V620
 product NOVATEL V740		0x1120	Merlin V740
 product NOVATEL V720		0x1130	Merlin V720
@@ -2034,6 +2174,7 @@ product NOVATEL X950D		0x1450	Merlin X95
 product NOVATEL ES620		0x2100	Expedite ES620
 product NOVATEL E725		0x2120	Expedite E725
 product NOVATEL ES620_2		0x2130	Expedite ES620
+product NOVATEL ES620		0x2100	ES620 CDMA
 product NOVATEL U720		0x2110	Merlin U720
 product NOVATEL EU730		0x2400	Expedite EU730
 product NOVATEL EU740		0x2410	Expedite EU740
@@ -2140,6 +2281,14 @@ product PANASONIC KXLCB20AN	0x0d0a	CD-R 
 product PANASONIC KXLCB35AN	0x0d0e	DVD-ROM & CD-R/RW
 product PANASONIC SDCAAE	0x1b00	MultiMediaCard
 
+/* PARA Industrial products */
+product PARA RT3070		0x8888	RT3070
+ 	 
+/* Pegatron products */
+product PEGATRON RT2870		0x0002	RT2870
+product PEGATRON RT3070		0x000c	RT3070
+product PEGATRON RT3070_2	0x000e	RT3070
+
 /* Peracom products */
 product PERACOM SERIAL1		0x0001	Serial
 product PERACOM ENET		0x0002	Ethernet
@@ -2157,6 +2306,7 @@ product PHILIPS SPE3030CC	0x083a	USB 2.0
 product PHILIPS SNU5600		0x1236	SNU5600
 product PHILIPS UM10016		0x1552	ISP 1581 Hi-Speed USB MPEG2 Encoder Reference Kit
 product PHILIPS DIVAUSB		0x1801	DIVA USB mp3 player
+product PHILIPS RT2870		0x200f	RT2870
 
 /* Philips Semiconductor products */
 product PHILIPSSEMI HUB1122	0x1122	HUB
@@ -2172,11 +2322,15 @@ product PLANEX GW_US11H		0x14ea	GW-US11H
 product PLANEX2 GW_US11S	0x3220	GW-US11S WLAN
 product PLANEX2 GW_US54GXS	0x5303	GW-US54GXS WLAN
 product PLANEX2 GWUS54HP	0xab01	GW-US54HP
+product PLANEX2 GWUS300MINIS	0xab24	GW-US300MiniS
+product PLANEX2	RT3070		0xab25	RT3070
 product PLANEX2 GWUS54MINI2	0xab50	GW-US54Mini2
 product PLANEX2 GWUS54SG	0xc002	GW-US54SG
 product PLANEX2 GWUS54GZL	0xc007	GW-US54GZL
 product PLANEX2 GWUS54GD	0xed01	GW-US54GD
 product PLANEX2 GWUSMM		0xed02	GW-USMM
+product PLANEX2 RT2870		0xed06	RT2870
+product PLANEX2 GWUSMICRON	0xed14	GW-USMicroN
 product PLANEX3 GWUS54GZ	0xab10	GW-US54GZ
 product PLANEX3 GU1000T		0xab11	GU-1000T
 product PLANEX3 GWUS54MINI	0xab13	GW-US54Mini
@@ -2234,6 +2388,7 @@ product PUTERCOM UPA100		0x047e	USB-1284
 product QCOM RT2573		0x6196	RT2573
 product QCOM RT2573_2		0x6229	RT2573
 product QCOM RT2573_3		0x6238	RT2573
+product QCOM RT2870		0x6259	RT2870
 
 /* Qisda products */
 product QISDA H21_1		0x4512	3G modem
@@ -2320,6 +2475,8 @@ product QUALCOMMINC E2002	0x2002	3G mode
 product QUALCOMMINC E2003	0x2003	3G modem
 
 /* Quanta products */
+/* Quanta products */
+product QUANTA RT3070		0x0304	RT3070
 product QUANTA Q101		0xea02	HSDPA modem
 product QUANTA Q111		0xea03	HSDPA modem
 product QUANTA GLX		0xea04	HSDPA modem
@@ -2340,9 +2497,16 @@ product RAINBOW IKEY2000	0x1200	i-Key 20
 
 /* Ralink Technology products */
 product RALINK RT2570		0x1706	RT2500USB Wireless Adapter
+product RALINK RT2070		0x2070	RT2070
 product RALINK RT2570_2		0x2570	RT2500USB Wireless Adapter
 product RALINK RT2573		0x2573	RT2501USB Wireless Adapter
 product RALINK RT2671		0x2671	RT2601USB Wireless Adapter
+product RALINK RT2770		0x2770	RT2770
+product RALINK RT2870		0x2870	RT2870
+product RALINK RT3070		0x3070	RT3070
+product RALINK RT3071		0x3071	RT3071
+product RALINK RT3072		0x3072	RT3072
+product RALINK RT3572		0x3572	RT3572
 product RALINK RT2570_3		0x9020	RT2500USB Wireless Adapter
 product RALINK RT2573_2		0x9021	RT2501USB Wireless Adapter
 
@@ -2383,6 +2547,7 @@ product SAGEM XG76NA		0x0062	XG-76NA
 product SAMSUNG ML6060		0x3008	ML-6060 laser printer
 product SAMSUNG YP_U2		0x5050	YP-U2 MP3 Player
 product SAMSUNG I500		0x6601	I500 Palm USB Phone 
+product SAMSUNG2 RT2870_1	0x2018	RT2870
 
 /* Samsung Techwin products */
 product SAMSUNG_TECHWIN DIGIMAX_410	0x000a	Digimax 410
@@ -2406,7 +2571,18 @@ product SCANLOGIC SL11R		0x0002	SL11R ID
 product SCANLOGIC 336CX		0x0300	Phantom 336CX - C3 scanner
 
 /* Senao products */
+product SENAO RT2870_3		0x0605	RT2870
+product SENAO RT2870_4		0x0615	RT2870
 product SENAO NUB8301		0x2000	NUB-8301
+product SENAO RT2870_1		0x9701	RT2870
+product SENAO RT2870_2		0x9702	RT2870
+product SENAO RT3070		0x9703	RT3070
+product SENAO RT3071		0x9705	RT3071
+product SENAO RT3072_1		0x9706	RT3072
+product SENAO RT3072_2		0x9707	RT3072
+product SENAO RT3072_3		0x9708	RT3072
+product SENAO RT3072_4		0x9709	RT3072
+product SENAO RT3072_5		0x9801	RT3072
 
 /* ShanTou products */
 product SHANTOU ST268		0x0268	ST268
@@ -2453,7 +2629,9 @@ product SIEMENS3 X75		0x0004	X75
 product SIERRA EM5625		0x0017	EM5625
 product SIERRA MC5720_2		0x0018	MC5720
 product SIERRA MC5725		0x0020	MC5725
+product SIERRA AIRCARD580	0x0112	Sierra Wireless AirCard 580
 product SIERRA AIRCARD595	0x0019	Sierra Wireless AirCard 595
+product SIERRA AC595U		0x0120	Sierra Wireless AirCard 595U
 product SIERRA AC597E		0x0021	Sierra Wireless AirCard 597E
 product SIERRA EM5725		0x0022	EM5725
 product SIERRA C597		0x0023	Sierra Wireless Compass 597
@@ -2553,8 +2731,24 @@ product SITECOM SERIAL		0x2068	USB to se
 product SITECOM2 WL022		0x182d	WL-022
 
 /* Sitecom Europe products */
+product SITECOMEU RT2870_1	0x0017	RT2870
 product SITECOMEU WL168V1	0x000d	WL-168 v1
 product SITECOMEU WL168V4	0x0028	WL-168 v4
+product SITECOMEU RT2870_2	0x002b	RT2870
+product SITECOMEU RT2870_3	0x002c	RT2870
+product SITECOMEU RT2870_4	0x002d	RT2870
+product SITECOMEU RT2770	0x0039	RT2770
+product SITECOMEU RT3070_2	0x003b	RT3070
+product SITECOMEU RT3070_3	0x003c	RT3070
+product SITECOMEU RT3070_4	0x003d	RT3070
+product SITECOMEU RT3070	0x003e	RT3070
+product SITECOMEU WL608		0x003f	WL-608
+product SITECOMEU RT3072_1	0x0041	RT3072
+product SITECOMEU RT3072_2	0x0042	RT3072
+product SITECOMEU RT3072_3	0x0047	RT3072
+product SITECOMEU RT3072_4	0x0048	RT3072
+product SITECOMEU RT3072_5	0x004a	RT3072
+product SITECOMEU RT3072_6	0x004d	RT3072
 product SITECOMEU LN028		0x061c	LN-028
 product SITECOMEU WL113		0x9071	WL-113
 product SITECOMEU ZD1211B	0x9075	ZD1211B
@@ -2612,7 +2806,9 @@ product SOURCENEXT KEIKAI8	0x039f	Keikai
 product SOURCENEXT KEIKAI8_CHG	0x012e	KeikaiDenwa 8 with charger
 
 /* SparkLAN products */
-product SPARKLAN RT2573		0x0004	 RT2573
+product SPARKLAN RT2573		0x0004	RT2573
+product SPARKLAN RT2870_1	0x0006	RT2870
+product SPARKLAN RT3070		0x0010	RT3070
 
 /* Sphairon Access Systems GmbH products */
 product SPHAIRON UB801R		0x0110	UB801R
@@ -2682,6 +2878,8 @@ product SURECOM RT2573		0x31f3	RT2573
 
 /* Sweex products */
 product SWEEX ZD1211		0x1809	ZD1211
+product SWEEX2 LW303		0x0302	LW303
+product SWEEX2 LW313		0x0313	LW313
 
 /* System TALKS, Inc. */
 product SYSTEMTALKS SGCX2UL	0x1920	SGC-X2UL
@@ -2775,6 +2973,7 @@ product UMEDIA TEW444UBEU_NF	0x3007	TEW-
 product UMEDIA TEW429UB_A	0x300a	TEW-429UB_A
 product UMEDIA TEW429UB		0x300b	TEW-429UB
 product UMEDIA TEW429UBC1	0x300d	TEW-429UB C1
+product UMEDIA RT2870_1		0x300e	RT2870
 product UMEDIA ALL0298V2	0x3204	ALL0298 v2
 product UMEDIA AR5523_2		0x3205	AR5523
 product UMEDIA AR5523_2_NF	0x3206	AR5523 (no firmware)
@@ -2884,9 +3083,16 @@ product ZCOM AR5523		0x0012	AR5523
 product ZCOM AR5523_NF		0x0013	AR5523 driver (no firmware)
 product ZCOM XM142		0x0015	XM-142
 product ZCOM ZD1211B		0x001a	ZD1211B
+product ZCOM RT2870_1		0x0022	RT2870
+product ZCOM RT2870_2		0x0025	RT2870
 
 /* Zinwell products */
 product ZINWELL RT2570		0x0260	RT2570
+product ZINWELL RT2870_1	0x0280	RT2870
+product ZINWELL RT2870_2	0x0282	RT2870
+product ZINWELL RT3072_1	0x0283	RT3072
+product ZINWELL RT3072_2	0x0284	RT3072
+product ZINWELL RT3070		0x5257	RT3070
 
 /* Zoom Telephonics, Inc. products */
 product ZOOM 2986L		0x9700	2986L Fax modem
@@ -2907,3 +3113,4 @@ product ZYXEL AG225H		0x3409	AG-225H
 product ZYXEL M202		0x340a	M-202
 product ZYXEL G220V2		0x340f	G-220 v2
 product ZYXEL G202		0x3410	G-202
+product ZYXEL RT2870_1		0x3416	RT2870

Copied: stable/8/sys/dev/usb/wlan/if_run.c (from r203134, head/sys/dev/usb/wlan/if_run.c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/8/sys/dev/usb/wlan/if_run.c	Tue Apr  6 23:14:43 2010	(r206289, copy of r203134, head/sys/dev/usb/wlan/if_run.c)
@@ -0,0 +1,4143 @@
+/*	$FreeBSD$	*/
+
+/*-
+ * Copyright (c) 2008,2009 Damien Bergamini 
+ *	ported to FreeBSD by Akinori Furukoshi 
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* release date Jan. 09, 2010 */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+/*-
+ * Ralink Technology RT2700U/RT2800U/RT3000U chipset driver.
+ * http://www.ralinktech.com/
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include "usbdevs.h"
+
+#define USB_DEBUG_VAR run_debug
+#include 
+
+#include "if_runreg.h"		/* shared with ral(4) */
+#include "if_runvar.h"
+
+#define nitems(_a)      (sizeof((_a)) / sizeof((_a)[0]))
+
+#if	USB_DEBUG
+#define RUN_DEBUG
+#endif
+
+#ifdef	RUN_DEBUG
+int run_debug = 0;
+SYSCTL_NODE(_hw_usb, OID_AUTO, run, CTLFLAG_RW, 0, "USB run");
+SYSCTL_INT(_hw_usb_run, OID_AUTO, debug, CTLFLAG_RW, &run_debug, 0,
+    "run debug level");
+#endif
+
+#define IEEE80211_HAS_ADDR4(wh) \
+	(((wh)->i_fc[1] & IEEE80211_FC1_DIR_MASK) == IEEE80211_FC1_DIR_DSTODS)
+
+static const struct usb_device_id run_devs[] = {
+    { USB_VP(USB_VENDOR_ABOCOM,		USB_PRODUCT_ABOCOM_RT2770) },
+    { USB_VP(USB_VENDOR_ABOCOM,		USB_PRODUCT_ABOCOM_RT2870) },
+    { USB_VP(USB_VENDOR_ABOCOM,		USB_PRODUCT_ABOCOM_RT3070) },
+    { USB_VP(USB_VENDOR_ABOCOM,		USB_PRODUCT_ABOCOM_RT3071) },
+    { USB_VP(USB_VENDOR_ABOCOM,		USB_PRODUCT_ABOCOM_RT3072) },
+    { USB_VP(USB_VENDOR_ABOCOM2,	USB_PRODUCT_ABOCOM2_RT2870_1) },
+    { USB_VP(USB_VENDOR_ACCTON,		USB_PRODUCT_ACCTON_RT2770) },
+    { USB_VP(USB_VENDOR_ACCTON,		USB_PRODUCT_ACCTON_RT2870_1) },
+    { USB_VP(USB_VENDOR_ACCTON,		USB_PRODUCT_ACCTON_RT2870_2) },
+    { USB_VP(USB_VENDOR_ACCTON,		USB_PRODUCT_ACCTON_RT2870_3) },
+    { USB_VP(USB_VENDOR_ACCTON,		USB_PRODUCT_ACCTON_RT2870_4) },
+    { USB_VP(USB_VENDOR_ACCTON,		USB_PRODUCT_ACCTON_RT2870_5) },
+    { USB_VP(USB_VENDOR_ACCTON,		USB_PRODUCT_ACCTON_RT3070_1) },
+    { USB_VP(USB_VENDOR_ACCTON,		USB_PRODUCT_ACCTON_RT3070_2) },
+    { USB_VP(USB_VENDOR_ACCTON,		USB_PRODUCT_ACCTON_RT3070_3) },
+    { USB_VP(USB_VENDOR_ACCTON,		USB_PRODUCT_ACCTON_RT3070_4) },
+    { USB_VP(USB_VENDOR_AIRTIES,	USB_PRODUCT_AIRTIES_RT3070) },
+    { USB_VP(USB_VENDOR_AMIGO,		USB_PRODUCT_AMIGO_RT2870_1) },
+    { USB_VP(USB_VENDOR_AMIGO,		USB_PRODUCT_AMIGO_RT2870_2) },
+    { USB_VP(USB_VENDOR_AMIT,		USB_PRODUCT_AMIT_CGWLUSB2GNR) },
+    { USB_VP(USB_VENDOR_AMIT,		USB_PRODUCT_AMIT_RT2870_1) },
+    { USB_VP(USB_VENDOR_AMIT2,		USB_PRODUCT_AMIT2_RT2870) },
+    { USB_VP(USB_VENDOR_ASUS,		USB_PRODUCT_ASUS_RT2870_1) },
+    { USB_VP(USB_VENDOR_ASUS,		USB_PRODUCT_ASUS_RT2870_2) },
+    { USB_VP(USB_VENDOR_ASUS,		USB_PRODUCT_ASUS_RT2870_3) },
+    { USB_VP(USB_VENDOR_ASUS,		USB_PRODUCT_ASUS_RT2870_4) },
+    { USB_VP(USB_VENDOR_ASUS,		USB_PRODUCT_ASUS_RT2870_5) },
+    { USB_VP(USB_VENDOR_ASUS2,		USB_PRODUCT_ASUS2_USBN11) },
+    { USB_VP(USB_VENDOR_AZUREWAVE,	USB_PRODUCT_AZUREWAVE_RT2870_1) },
+    { USB_VP(USB_VENDOR_AZUREWAVE,	USB_PRODUCT_AZUREWAVE_RT2870_2) },
+    { USB_VP(USB_VENDOR_AZUREWAVE,	USB_PRODUCT_AZUREWAVE_RT3070_1) },
+    { USB_VP(USB_VENDOR_AZUREWAVE,	USB_PRODUCT_AZUREWAVE_RT3070_2) },
+    { USB_VP(USB_VENDOR_AZUREWAVE,	USB_PRODUCT_AZUREWAVE_RT3070_3) },
+    { USB_VP(USB_VENDOR_BELKIN,		USB_PRODUCT_BELKIN_F5D8053V3) },
+    { USB_VP(USB_VENDOR_BELKIN,		USB_PRODUCT_BELKIN_F5D8055) },
+    { USB_VP(USB_VENDOR_BELKIN,		USB_PRODUCT_BELKIN_F6D4050V1) },
+    { USB_VP(USB_VENDOR_BELKIN,		USB_PRODUCT_BELKIN_RT2870_1) },
+    { USB_VP(USB_VENDOR_BELKIN,		USB_PRODUCT_BELKIN_RT2870_2) },
+    { USB_VP(USB_VENDOR_CONCEPTRONIC2,	USB_PRODUCT_CONCEPTRONIC2_RT2870_1) },
+    { USB_VP(USB_VENDOR_CONCEPTRONIC2,	USB_PRODUCT_CONCEPTRONIC2_RT2870_2) },
+    { USB_VP(USB_VENDOR_CONCEPTRONIC2,	USB_PRODUCT_CONCEPTRONIC2_RT2870_3) },
+    { USB_VP(USB_VENDOR_CONCEPTRONIC2,	USB_PRODUCT_CONCEPTRONIC2_RT2870_4) },
+    { USB_VP(USB_VENDOR_CONCEPTRONIC2,	USB_PRODUCT_CONCEPTRONIC2_RT2870_5) },
+    { USB_VP(USB_VENDOR_CONCEPTRONIC2,	USB_PRODUCT_CONCEPTRONIC2_RT2870_6) },
+    { USB_VP(USB_VENDOR_CONCEPTRONIC2,	USB_PRODUCT_CONCEPTRONIC2_RT2870_7) },
+    { USB_VP(USB_VENDOR_CONCEPTRONIC2,	USB_PRODUCT_CONCEPTRONIC2_RT2870_8) },
+    { USB_VP(USB_VENDOR_CONCEPTRONIC2,	USB_PRODUCT_CONCEPTRONIC2_VIGORN61) },
+    { USB_VP(USB_VENDOR_COREGA,		USB_PRODUCT_COREGA_CGWLUSB300GNM) },
+    { USB_VP(USB_VENDOR_COREGA,		USB_PRODUCT_COREGA_RT2870_1) },
+    { USB_VP(USB_VENDOR_COREGA,		USB_PRODUCT_COREGA_RT2870_2) },
+    { USB_VP(USB_VENDOR_COREGA,		USB_PRODUCT_COREGA_RT2870_3) },
+    { USB_VP(USB_VENDOR_COREGA,		USB_PRODUCT_COREGA_RT3070) },
+    { USB_VP(USB_VENDOR_CYBERTAN,	USB_PRODUCT_CYBERTAN_RT2870) },
+    { USB_VP(USB_VENDOR_DLINK,		USB_PRODUCT_DLINK_RT2870) },
+    { USB_VP(USB_VENDOR_DLINK,		USB_PRODUCT_DLINK_RT3072) },
+    { USB_VP(USB_VENDOR_DLINK2,		USB_PRODUCT_DLINK2_DWA130) },
+    { USB_VP(USB_VENDOR_DLINK2,		USB_PRODUCT_DLINK2_RT2870_1) },
+    { USB_VP(USB_VENDOR_DLINK2,		USB_PRODUCT_DLINK2_RT2870_2) },
+    { USB_VP(USB_VENDOR_DLINK2,		USB_PRODUCT_DLINK2_RT3070_1) },
+    { USB_VP(USB_VENDOR_DLINK2,		USB_PRODUCT_DLINK2_RT3070_2) },
+    { USB_VP(USB_VENDOR_DLINK2,		USB_PRODUCT_DLINK2_RT3070_3) },
+    { USB_VP(USB_VENDOR_DLINK2,		USB_PRODUCT_DLINK2_RT3070_4) },
+    { USB_VP(USB_VENDOR_DLINK2,		USB_PRODUCT_DLINK2_RT3072) },
+    { USB_VP(USB_VENDOR_EDIMAX,		USB_PRODUCT_EDIMAX_EW7717) },
+    { USB_VP(USB_VENDOR_EDIMAX,		USB_PRODUCT_EDIMAX_EW7718) },
+    { USB_VP(USB_VENDOR_EDIMAX,		USB_PRODUCT_EDIMAX_RT2870_1) },
+    { USB_VP(USB_VENDOR_ENCORE,		USB_PRODUCT_ENCORE_RT3070_1) },
+    { USB_VP(USB_VENDOR_ENCORE,		USB_PRODUCT_ENCORE_RT3070_2) },
+    { USB_VP(USB_VENDOR_ENCORE,		USB_PRODUCT_ENCORE_RT3070_3) },
+    { USB_VP(USB_VENDOR_GIGABYTE,	USB_PRODUCT_GIGABYTE_GNWB31N) },
+    { USB_VP(USB_VENDOR_GIGABYTE,	USB_PRODUCT_GIGABYTE_GNWB32L) },
+    { USB_VP(USB_VENDOR_GIGABYTE,	USB_PRODUCT_GIGABYTE_RT2870_1) },
+    { USB_VP(USB_VENDOR_GIGASET,	USB_PRODUCT_GIGASET_RT3070_1) },
+    { USB_VP(USB_VENDOR_GIGASET,	USB_PRODUCT_GIGASET_RT3070_2) },
+    { USB_VP(USB_VENDOR_GUILLEMOT,	USB_PRODUCT_GUILLEMOT_HWNU300) },
+    { USB_VP(USB_VENDOR_HAWKING,	USB_PRODUCT_HAWKING_HWUN2) },
+    { USB_VP(USB_VENDOR_HAWKING,	USB_PRODUCT_HAWKING_RT2870_1) },
+    { USB_VP(USB_VENDOR_HAWKING,	USB_PRODUCT_HAWKING_RT2870_2) },
+    { USB_VP(USB_VENDOR_HAWKING,	USB_PRODUCT_HAWKING_RT3070) },
+    { USB_VP(USB_VENDOR_IODATA,		USB_PRODUCT_IODATA_RT3072_1) },
+    { USB_VP(USB_VENDOR_IODATA,		USB_PRODUCT_IODATA_RT3072_2) },
+    { USB_VP(USB_VENDOR_IODATA,		USB_PRODUCT_IODATA_RT3072_3) },
+    { USB_VP(USB_VENDOR_IODATA,		USB_PRODUCT_IODATA_RT3072_4) },
+    { USB_VP(USB_VENDOR_LINKSYS4,	USB_PRODUCT_LINKSYS4_WUSB100) },
+    { USB_VP(USB_VENDOR_LINKSYS4,	USB_PRODUCT_LINKSYS4_WUSB54GCV3) },
+    { USB_VP(USB_VENDOR_LINKSYS4,	USB_PRODUCT_LINKSYS4_WUSB600N) },
+    { USB_VP(USB_VENDOR_LINKSYS4,	USB_PRODUCT_LINKSYS4_WUSB600NV2) },
+    { USB_VP(USB_VENDOR_LOGITEC,	USB_PRODUCT_LOGITEC_RT2870_1) },
+    { USB_VP(USB_VENDOR_LOGITEC,	USB_PRODUCT_LOGITEC_RT2870_2) },
+    { USB_VP(USB_VENDOR_LOGITEC,	USB_PRODUCT_LOGITEC_RT2870_3) },
+    { USB_VP(USB_VENDOR_MELCO,		USB_PRODUCT_MELCO_WLIUCAG300N) },
+    { USB_VP(USB_VENDOR_MELCO,		USB_PRODUCT_MELCO_WLIUCG300N) },
+    { USB_VP(USB_VENDOR_MELCO,		USB_PRODUCT_MELCO_WLIUCGN) },
+    { USB_VP(USB_VENDOR_MSI,		USB_PRODUCT_MSI_RT3070_1) },
+    { USB_VP(USB_VENDOR_MSI,		USB_PRODUCT_MSI_RT3070_2) },
+    { USB_VP(USB_VENDOR_MSI,		USB_PRODUCT_MSI_RT3070_3) },
+    { USB_VP(USB_VENDOR_MSI,		USB_PRODUCT_MSI_RT3070_4) },
+    { USB_VP(USB_VENDOR_MSI,		USB_PRODUCT_MSI_RT3070_5) },
+    { USB_VP(USB_VENDOR_MSI,		USB_PRODUCT_MSI_RT3070_6) },
+    { USB_VP(USB_VENDOR_MSI,		USB_PRODUCT_MSI_RT3070_7) },
+    { USB_VP(USB_VENDOR_PARA,		USB_PRODUCT_PARA_RT3070) },
+    { USB_VP(USB_VENDOR_PEGATRON,	USB_PRODUCT_PEGATRON_RT2870) },
+    { USB_VP(USB_VENDOR_PEGATRON,	USB_PRODUCT_PEGATRON_RT3070) },
+    { USB_VP(USB_VENDOR_PEGATRON,	USB_PRODUCT_PEGATRON_RT3070_2) },
+    { USB_VP(USB_VENDOR_PHILIPS,	USB_PRODUCT_PHILIPS_RT2870) },
+    { USB_VP(USB_VENDOR_PLANEX2,	USB_PRODUCT_PLANEX2_GWUS300MINIS) },
+    { USB_VP(USB_VENDOR_PLANEX2,	USB_PRODUCT_PLANEX2_GWUSMICRON) },
+    { USB_VP(USB_VENDOR_PLANEX2,	USB_PRODUCT_PLANEX2_RT2870) },
+    { USB_VP(USB_VENDOR_PLANEX2,	USB_PRODUCT_PLANEX2_RT3070) },
+    { USB_VP(USB_VENDOR_QCOM,		USB_PRODUCT_QCOM_RT2870) },
+    { USB_VP(USB_VENDOR_QUANTA,		USB_PRODUCT_QUANTA_RT3070) },
+    { USB_VP(USB_VENDOR_RALINK,		USB_PRODUCT_RALINK_RT2070) },
+    { USB_VP(USB_VENDOR_RALINK,		USB_PRODUCT_RALINK_RT2770) },
+    { USB_VP(USB_VENDOR_RALINK,		USB_PRODUCT_RALINK_RT2870) },
+    { USB_VP(USB_VENDOR_RALINK,		USB_PRODUCT_RALINK_RT3070) },
+    { USB_VP(USB_VENDOR_RALINK,		USB_PRODUCT_RALINK_RT3071) },
+    { USB_VP(USB_VENDOR_RALINK,		USB_PRODUCT_RALINK_RT3072) },
+    { USB_VP(USB_VENDOR_RALINK,		USB_PRODUCT_RALINK_RT3572) },
+    { USB_VP(USB_VENDOR_SAMSUNG2,	USB_PRODUCT_SAMSUNG2_RT2870_1) },
+    { USB_VP(USB_VENDOR_SENAO,		USB_PRODUCT_SENAO_RT2870_1) },
+    { USB_VP(USB_VENDOR_SENAO,		USB_PRODUCT_SENAO_RT2870_2) },
+    { USB_VP(USB_VENDOR_SENAO,		USB_PRODUCT_SENAO_RT2870_3) },
+    { USB_VP(USB_VENDOR_SENAO,		USB_PRODUCT_SENAO_RT2870_4) },
+    { USB_VP(USB_VENDOR_SENAO,		USB_PRODUCT_SENAO_RT3070) },
+    { USB_VP(USB_VENDOR_SENAO,		USB_PRODUCT_SENAO_RT3071) },
+    { USB_VP(USB_VENDOR_SENAO,		USB_PRODUCT_SENAO_RT3072_1) },
+    { USB_VP(USB_VENDOR_SENAO,		USB_PRODUCT_SENAO_RT3072_2) },
+    { USB_VP(USB_VENDOR_SENAO,		USB_PRODUCT_SENAO_RT3072_3) },
+    { USB_VP(USB_VENDOR_SENAO,		USB_PRODUCT_SENAO_RT3072_4) },
+    { USB_VP(USB_VENDOR_SENAO,		USB_PRODUCT_SENAO_RT3072_5) },
+    { USB_VP(USB_VENDOR_SITECOMEU,	USB_PRODUCT_SITECOMEU_RT2770) },
+    { USB_VP(USB_VENDOR_SITECOMEU,	USB_PRODUCT_SITECOMEU_RT2870_1) },
+    { USB_VP(USB_VENDOR_SITECOMEU,	USB_PRODUCT_SITECOMEU_RT2870_2) },
+    { USB_VP(USB_VENDOR_SITECOMEU,	USB_PRODUCT_SITECOMEU_RT2870_3) },
+    { USB_VP(USB_VENDOR_SITECOMEU,	USB_PRODUCT_SITECOMEU_RT2870_4) },
+    { USB_VP(USB_VENDOR_SITECOMEU,	USB_PRODUCT_SITECOMEU_RT3070) },
+    { USB_VP(USB_VENDOR_SITECOMEU,	USB_PRODUCT_SITECOMEU_RT3070_2) },
+    { USB_VP(USB_VENDOR_SITECOMEU,	USB_PRODUCT_SITECOMEU_RT3070_3) },
+    { USB_VP(USB_VENDOR_SITECOMEU,	USB_PRODUCT_SITECOMEU_RT3070_4) },
+    { USB_VP(USB_VENDOR_SITECOMEU,	USB_PRODUCT_SITECOMEU_RT3072_1) },
+    { USB_VP(USB_VENDOR_SITECOMEU,	USB_PRODUCT_SITECOMEU_RT3072_2) },
+    { USB_VP(USB_VENDOR_SITECOMEU,	USB_PRODUCT_SITECOMEU_RT3072_3) },
+    { USB_VP(USB_VENDOR_SITECOMEU,	USB_PRODUCT_SITECOMEU_RT3072_4) },
+    { USB_VP(USB_VENDOR_SITECOMEU,	USB_PRODUCT_SITECOMEU_RT3072_5) },
+    { USB_VP(USB_VENDOR_SITECOMEU,	USB_PRODUCT_SITECOMEU_RT3072_6) },
+    { USB_VP(USB_VENDOR_SITECOMEU,	USB_PRODUCT_SITECOMEU_WL608) },
+    { USB_VP(USB_VENDOR_SPARKLAN,	USB_PRODUCT_SPARKLAN_RT2870_1) },
+    { USB_VP(USB_VENDOR_SPARKLAN,	USB_PRODUCT_SPARKLAN_RT3070) },
+    { USB_VP(USB_VENDOR_SWEEX2,		USB_PRODUCT_SWEEX2_LW303) },
+    { USB_VP(USB_VENDOR_SWEEX2,		USB_PRODUCT_SWEEX2_LW313) },
+    { USB_VP(USB_VENDOR_UMEDIA,		USB_PRODUCT_UMEDIA_RT2870_1) },
+    { USB_VP(USB_VENDOR_ZCOM,		USB_PRODUCT_ZCOM_RT2870_1) },
+    { USB_VP(USB_VENDOR_ZCOM,		USB_PRODUCT_ZCOM_RT2870_2) },
+    { USB_VP(USB_VENDOR_ZINWELL,	USB_PRODUCT_ZINWELL_RT2870_1) },
+    { USB_VP(USB_VENDOR_ZINWELL,	USB_PRODUCT_ZINWELL_RT2870_2) },
+    { USB_VP(USB_VENDOR_ZINWELL,	USB_PRODUCT_ZINWELL_RT3070) },
+    { USB_VP(USB_VENDOR_ZINWELL,	USB_PRODUCT_ZINWELL_RT3072_1) },
+    { USB_VP(USB_VENDOR_ZINWELL,	USB_PRODUCT_ZINWELL_RT3072_2) },
+    { USB_VP(USB_VENDOR_ZYXEL,		USB_PRODUCT_ZYXEL_RT2870_1) },
+};
+
+MODULE_DEPEND(run, wlan, 1, 1, 1);
+MODULE_DEPEND(run, wlan_amrr, 1, 1, 1);
+MODULE_DEPEND(run, usb, 1, 1, 1);
+MODULE_DEPEND(run, firmware, 1, 1, 1);
+
+static device_probe_t	run_match;
+static device_attach_t	run_attach;
+static device_detach_t	run_detach;
+
+static usb_callback_t	run_bulk_rx_callback;
+static usb_callback_t	run_bulk_tx_callback0;
+static usb_callback_t	run_bulk_tx_callback1;
+static usb_callback_t	run_bulk_tx_callback2;
+static usb_callback_t	run_bulk_tx_callback3;
+static usb_callback_t	run_bulk_tx_callback4;
+static usb_callback_t	run_bulk_tx_callback5;
+
+static void	run_bulk_tx_callbackN(struct usb_xfer *xfer,
+		    usb_error_t error, unsigned int index);
+static struct ieee80211vap *run_vap_create(struct ieee80211com *,
+		    const char name[IFNAMSIZ], int unit, int opmode, int flags,
+		    const uint8_t bssid[IEEE80211_ADDR_LEN], const uint8_t
+		    mac[IEEE80211_ADDR_LEN]);
+static void	run_vap_delete(struct ieee80211vap *);
+static void	run_setup_tx_list(struct run_softc *,
+		    struct run_endpoint_queue *);
+static void	run_unsetup_tx_list(struct run_softc *,
+		    struct run_endpoint_queue *);
+static int	run_load_microcode(struct run_softc *);
+static int	run_reset(struct run_softc *);
+static usb_error_t run_do_request(struct run_softc *,
+		    struct usb_device_request *, void *);
+static int	run_read(struct run_softc *, uint16_t, uint32_t *);
+static int	run_read_region_1(struct run_softc *, uint16_t, uint8_t *, int);
+static int	run_write_2(struct run_softc *, uint16_t, uint16_t);
+static int	run_write(struct run_softc *, uint16_t, uint32_t);
+static int	run_write_region_1(struct run_softc *, uint16_t,
+		    const uint8_t *, int);
+static int	run_set_region_4(struct run_softc *, uint16_t, uint32_t, int);
+static int	run_efuse_read_2(struct run_softc *, uint16_t, uint16_t *);
+static int	run_eeprom_read_2(struct run_softc *, uint16_t, uint16_t *);
+static int	run_rt2870_rf_write(struct run_softc *, uint8_t, uint32_t);
+static int	run_rt3070_rf_read(struct run_softc *, uint8_t, uint8_t *);
+static int	run_rt3070_rf_write(struct run_softc *, uint8_t, uint8_t);
+static int	run_bbp_read(struct run_softc *, uint8_t, uint8_t *);
+static int	run_bbp_write(struct run_softc *, uint8_t, uint8_t);
+static int	run_mcu_cmd(struct run_softc *, uint8_t, uint16_t);
+static const char *run_get_rf(int);
+static int	run_read_eeprom(struct run_softc *);
+static struct ieee80211_node *run_node_alloc(struct ieee80211vap *,
+			    const uint8_t mac[IEEE80211_ADDR_LEN]);
+static int	run_media_change(struct ifnet *);
+static int	run_newstate(struct ieee80211vap *, enum ieee80211_state, int);
+static int	run_wme_update(struct ieee80211com *);
+static void	run_wme_update_cb(void *, int);
+static void	run_key_update_begin(struct ieee80211vap *);
+static void	run_key_update_end(struct ieee80211vap *);
+static int	run_key_set(struct ieee80211vap *, const struct ieee80211_key *,
+			    const uint8_t mac[IEEE80211_ADDR_LEN]);
+static int	run_key_delete(struct ieee80211vap *,
+		    const struct ieee80211_key *);
+static void	run_amrr_start(struct run_softc *, struct ieee80211_node *);
+static void	run_amrr_to(void *);
+static void	run_amrr_cb(void *, int);
+static void	run_iter_func(void *, struct ieee80211_node *);
+static void	run_newassoc(struct ieee80211_node *, int);
+static void	run_rx_frame(struct run_softc *, struct mbuf *, uint32_t);
+static void	run_tx_free(struct run_endpoint_queue *pq,
+		    struct run_tx_data *, int);
+static void	run_set_tx_desc(struct run_softc *, struct run_tx_data *,
+		    uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t);
+static int	run_tx(struct run_softc *, struct mbuf *,
+		    struct ieee80211_node *);
+static int	run_tx_mgt(struct run_softc *, struct mbuf *,
+		    struct ieee80211_node *);
+static int	run_sendprot(struct run_softc *, const struct mbuf *,
+		    struct ieee80211_node *, int, int);
+static int	run_tx_param(struct run_softc *, struct mbuf *,
+		    struct ieee80211_node *,
+		    const struct ieee80211_bpf_params *);
+static int	run_raw_xmit(struct ieee80211_node *, struct mbuf *,
+		    const struct ieee80211_bpf_params *);
+static void	run_start(struct ifnet *);
+static int	run_ioctl(struct ifnet *, u_long, caddr_t);
+static void	run_select_chan_group(struct run_softc *, int);
+static void	run_set_rx_antenna(struct run_softc *, int);
+static void	run_rt2870_set_chan(struct run_softc *, u_int);
+static void	run_rt3070_set_chan(struct run_softc *, u_int);
+static int	run_set_chan(struct run_softc *, struct ieee80211_channel *);
+static void	run_set_channel(struct ieee80211com *);
+static void	run_scan_start(struct ieee80211com *);
+static void	run_scan_end(struct ieee80211com *);
+static uint8_t	run_rate2mcs(uint8_t);
+static void	run_update_beacon(struct ieee80211vap *, int);
+static void	run_update_beacon_locked(struct ieee80211vap *, int);
+static void	run_updateprot(struct ieee80211com *);
+static void	run_usb_timeout_cb(void *, int);
+static void	run_reset_livelock(struct run_softc *);
+static void	run_enable_tsf_sync(struct run_softc *);
+static void	run_enable_mrr(struct run_softc *);
+static void	run_set_txpreamble(struct run_softc *);
+static void	run_set_basicrates(struct run_softc *);
+static void	run_set_leds(struct run_softc *, uint16_t);
+static void	run_set_bssid(struct run_softc *, const uint8_t *);
+static void	run_set_macaddr(struct run_softc *, const uint8_t *);
+static void	run_updateslot(struct ifnet *);
+static int8_t	run_rssi2dbm(struct run_softc *, uint8_t, uint8_t);
+static void	run_update_promisc_locked(struct ifnet *);
+static void	run_update_promisc(struct ifnet *);
+static int	run_bbp_init(struct run_softc *);
+static int	run_rt3070_rf_init(struct run_softc *);
+static int	run_rt3070_filter_calib(struct run_softc *, uint8_t, uint8_t,
+		    uint8_t *);
+static int	run_txrx_enable(struct run_softc *);
+static void	run_init(void *);
+static void	run_init_locked(struct run_softc *);
+static void	run_stop(void *);
+static void	run_delay(struct run_softc *, unsigned int);
+
+static const struct {
+	uint32_t	reg;
+	uint32_t	val;
+} rt2870_def_mac[] = {
+	RT2870_DEF_MAC
+};
+
+static const struct {
+	uint8_t	reg;
+	uint8_t	val;
+} rt2860_def_bbp[] = {
+	RT2860_DEF_BBP
+};
+
+static const struct rfprog {

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

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Apr  6 23:15:17 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0CF7910656A5;
	Tue,  6 Apr 2010 23:15:17 +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 ED8358FC1B;
	Tue,  6 Apr 2010 23:15:16 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o36NFGjI009425;
	Tue, 6 Apr 2010 23:15:16 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o36NFGv9009422;
	Tue, 6 Apr 2010 23:15:16 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <201004062315.o36NFGv9009422@svn.freebsd.org>
From: Andrew Thompson 
Date: Tue, 6 Apr 2010 23:15:16 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206290 - stable/8/sys/dev/usb/wlan
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 06 Apr 2010 23:15:17 -0000

Author: thompsa
Date: Tue Apr  6 23:15:16 2010
New Revision: 206290
URL: http://svn.freebsd.org/changeset/base/206290

Log:
  MFC r203137
  
   Release the firmware after loading to the device.

Modified:
  stable/8/sys/dev/usb/wlan/if_run.c
  stable/8/sys/dev/usb/wlan/if_runvar.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/usb/wlan/if_run.c
==============================================================================
--- stable/8/sys/dev/usb/wlan/if_run.c	Tue Apr  6 23:14:43 2010	(r206289)
+++ stable/8/sys/dev/usb/wlan/if_run.c	Tue Apr  6 23:15:16 2010	(r206290)
@@ -803,22 +803,25 @@ int
 run_load_microcode(struct run_softc *sc)
 {
 	usb_device_request_t req;
+	const struct firmware *fw;
 	const u_char *base;
 	uint32_t tmp;
 	int ntries, error;
 	const uint64_t *temp;
 	uint64_t bytes;
 
-	if((sc->fwp = firmware_get("runfw")) == NULL){
+	fw = firmware_get("runfw");
+	if(fw == NULL){
 		printf("%s: failed loadfirmware of file %s (error %d)\n",
 		    device_get_nameunit(sc->sc_dev), "runfw", ENOENT);
 		return ENOENT;
 	}
 
-	if (sc->fwp->datasize != 8192) {
+	if (fw->datasize != 8192) {
 		printf("%s: invalid firmware size (should be 8KB)\n",
 		    device_get_nameunit(sc->sc_dev));
-		return EINVAL;
+		error = EINVAL;
+		goto fail;
 	}
 
 	/*
@@ -827,7 +830,7 @@ run_load_microcode(struct run_softc *sc)
 	 * first half (4KB) is for rt2870,
 	 * last half is for rt3071.
 	 */
-	base = sc->fwp->data;
+	base = fw->data;
 	if ((sc->mac_rev >> 16) != 0x2860 &&
 	    (sc->mac_rev >> 16) != 0x2872 &&
 	    (sc->mac_rev >> 16) != 0x3070 &&
@@ -840,10 +843,14 @@ run_load_microcode(struct run_softc *sc)
 		    device_get_nameunit(sc->sc_dev));
 
 	/* cheap sanity check */
-	temp = sc->fwp->data;
+	temp = fw->data;
 	bytes = *temp;
-	if(bytes != be64toh(0xffffff0210280210))
-		return EINVAL;
+	if(bytes != be64toh(0xffffff0210280210)) {
+		printf("%s: firmware checksum failed\n",
+		    device_get_nameunit(sc->sc_dev));
+		error = EINVAL;
+		goto fail;
+	}
 
 	run_read(sc, RT2860_ASIC_VER_ID, &tmp);
 	/* write microcode image */
@@ -856,19 +863,23 @@ run_load_microcode(struct run_softc *sc)
 	USETW(req.wValue, 8);
 	USETW(req.wIndex, 0);
 	USETW(req.wLength, 0);
-	if ((error = usbd_do_request(sc->sc_udev, &sc->sc_mtx, &req, NULL)) != 0)
-		return error;
+	if ((error = usbd_do_request(sc->sc_udev, &sc->sc_mtx, &req, NULL)) != 0) {
+		printf("%s: firmware reset failed\n",
+		    device_get_nameunit(sc->sc_dev));
+		goto fail;
+	}
 
 	run_delay(sc, 10);
 
 	run_write(sc, RT2860_H2M_MAILBOX, 0);
 	if ((error = run_mcu_cmd(sc, RT2860_MCU_CMD_BOOT, 0)) != 0)
-		return error;
+		goto fail;
 
 	/* wait until microcontroller is ready */
 	for (ntries = 0; ntries < 1000; ntries++) {
-		if ((error = run_read(sc, RT2860_SYS_CTRL, &tmp)) != 0)
-			return error;
+		if ((error = run_read(sc, RT2860_SYS_CTRL, &tmp)) != 0) {
+			goto fail;
+		}
 		if (tmp & RT2860_MCU_READY)
 			break;
 		run_delay(sc, 10);
@@ -876,11 +887,14 @@ run_load_microcode(struct run_softc *sc)
 	if (ntries == 1000) {
 		printf("%s: timeout waiting for MCU to initialize\n",
 		    device_get_nameunit(sc->sc_dev));
-		return ETIMEDOUT;
+		error = ETIMEDOUT;
+		goto fail;
 	}
 	DPRINTF("microcode successfully loaded after %d tries\n", ntries);
 
-	return 0;
+fail:
+	firmware_put(fw, FIRMWARE_UNLOAD);
+	return (error);
 }
 
 int

Modified: stable/8/sys/dev/usb/wlan/if_runvar.h
==============================================================================
--- stable/8/sys/dev/usb/wlan/if_runvar.h	Tue Apr  6 23:14:43 2010	(r206289)
+++ stable/8/sys/dev/usb/wlan/if_runvar.h	Tue Apr  6 23:15:16 2010	(r206290)
@@ -154,8 +154,6 @@ struct run_softc {
 	int				(*sc_srom_read)(struct run_softc *,
 					    uint16_t, uint16_t *);
 
-	const struct firmware		*fwp;
-
 	uint32_t			mac_rev;
 	uint8_t				rf_rev;
 	uint8_t				freq;

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Apr  6 23:15:44 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D50461065676;
	Tue,  6 Apr 2010 23:15:44 +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 C19948FC28;
	Tue,  6 Apr 2010 23:15:44 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o36NFiLT009598;
	Tue, 6 Apr 2010 23:15:44 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o36NFi1w009596;
	Tue, 6 Apr 2010 23:15:44 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <201004062315.o36NFi1w009596@svn.freebsd.org>
From: Andrew Thompson 
Date: Tue, 6 Apr 2010 23:15:44 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206291 - stable/8/sys/dev/usb/wlan
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 06 Apr 2010 23:15:44 -0000

Author: thompsa
Date: Tue Apr  6 23:15:44 2010
New Revision: 206291
URL: http://svn.freebsd.org/changeset/base/206291

Log:
  MFC r203138
  
   Use device_printf rather than printf + device_get_nameunit.

Modified:
  stable/8/sys/dev/usb/wlan/if_run.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/usb/wlan/if_run.c
==============================================================================
--- stable/8/sys/dev/usb/wlan/if_run.c	Tue Apr  6 23:15:16 2010	(r206290)
+++ stable/8/sys/dev/usb/wlan/if_run.c	Tue Apr  6 23:15:44 2010	(r206291)
@@ -535,8 +535,8 @@ run_attach(device_t self)
 		run_delay(sc, 10);
 	}
 	if (ntries == 100) {
-		printf("%s: timeout waiting for NIC to initialize\n",
-		    device_get_nameunit(sc->sc_dev));
+		device_printf(sc->sc_dev,
+		    "timeout waiting for NIC to initialize\n");
 		RUN_UNLOCK(sc);
 		goto detach;
 	}
@@ -544,14 +544,13 @@ run_attach(device_t self)
 	/* retrieve RF rev. no and various other things from EEPROM */
 	run_read_eeprom(sc);
 
-	printf("%s: MAC/BBP RT%04X (rev 0x%04X), RF %s (MIMO %dT%dR), "
-	    "address %s\n", device_get_nameunit(sc->sc_dev), sc->mac_rev >> 16,
-	    sc->mac_rev & 0xffff, run_get_rf(sc->rf_rev), sc->ntxchains,
-	    sc->nrxchains, ether_sprintf(sc->sc_bssid));
+	device_printf(sc->sc_dev,
+	    "MAC/BBP RT%04X (rev 0x%04X), RF %s (MIMO %dT%dR), address %s\n",
+	    sc->mac_rev >> 16, sc->mac_rev & 0xffff, run_get_rf(sc->rf_rev),
+	    sc->ntxchains, sc->nrxchains, ether_sprintf(sc->sc_bssid));
 
 	if ((error = run_load_microcode(sc)) != 0) {
-		printf("%s: could not load 8051 microcode\n",
-		    device_get_nameunit(sc->sc_dev));
+		device_printf(sc->sc_dev, "could not load 8051 microcode\n");
 		RUN_UNLOCK(sc);
 		goto detach;
 	}
@@ -560,8 +559,7 @@ run_attach(device_t self)
 
 	ifp = sc->sc_ifp = if_alloc(IFT_IEEE80211);
 	if(ifp == NULL){
-		printf("%s: can not if_alloc()\n",
-		    device_get_nameunit(sc->sc_dev));
+		device_printf(sc->sc_dev, "can not if_alloc()\n");
 		goto detach;
 	}
 	ic = ifp->if_l2com;
@@ -812,14 +810,14 @@ run_load_microcode(struct run_softc *sc)
 
 	fw = firmware_get("runfw");
 	if(fw == NULL){
-		printf("%s: failed loadfirmware of file %s (error %d)\n",
-		    device_get_nameunit(sc->sc_dev), "runfw", ENOENT);
+		device_printf(sc->sc_dev,
+		    "failed loadfirmware of file %s\n", "runfw");
 		return ENOENT;
 	}
 
 	if (fw->datasize != 8192) {
-		printf("%s: invalid firmware size (should be 8KB)\n",
-		    device_get_nameunit(sc->sc_dev));
+		device_printf(sc->sc_dev,
+		    "invalid firmware size (should be 8KB)\n");
 		error = EINVAL;
 		goto fail;
 	}
@@ -836,18 +834,15 @@ run_load_microcode(struct run_softc *sc)
 	    (sc->mac_rev >> 16) != 0x3070 &&
 	    (sc->mac_rev >> 16) != 0x3572){
 		base += 4096;
-		printf("%s: You are using firmware RT3071.\n",
-		    device_get_nameunit(sc->sc_dev));
+		device_printf(sc->sc_dev, "loading RT3071 firmware\n");
 	} else
-		printf("%s: You are using firmware RT2870.\n",
-		    device_get_nameunit(sc->sc_dev));
+		device_printf(sc->sc_dev, "loading RT2870 firmware\n");
 
 	/* cheap sanity check */
 	temp = fw->data;
 	bytes = *temp;
 	if(bytes != be64toh(0xffffff0210280210)) {
-		printf("%s: firmware checksum failed\n",
-		    device_get_nameunit(sc->sc_dev));
+		device_printf(sc->sc_dev, "firmware checksum failed\n");
 		error = EINVAL;
 		goto fail;
 	}
@@ -864,8 +859,7 @@ run_load_microcode(struct run_softc *sc)
 	USETW(req.wIndex, 0);
 	USETW(req.wLength, 0);
 	if ((error = usbd_do_request(sc->sc_udev, &sc->sc_mtx, &req, NULL)) != 0) {
-		printf("%s: firmware reset failed\n",
-		    device_get_nameunit(sc->sc_dev));
+		device_printf(sc->sc_dev, "firmware reset failed\n");
 		goto fail;
 	}
 
@@ -885,8 +879,8 @@ run_load_microcode(struct run_softc *sc)
 		run_delay(sc, 10);
 	}
 	if (ntries == 1000) {
-		printf("%s: timeout waiting for MCU to initialize\n",
-		    device_get_nameunit(sc->sc_dev));
+		device_printf(sc->sc_dev,
+		    "timeout waiting for MCU to initialize\n");
 		error = ETIMEDOUT;
 		goto fail;
 	}
@@ -3892,8 +3886,7 @@ run_init_locked(struct run_softc *sc)
 		run_delay(sc, 10);
 	}
 	if (ntries == 100) {
-		printf("%s: timeout waiting for DMA engine\n",
-		    device_get_nameunit(sc->sc_dev));
+		device_printf(sc->sc_dev, "timeout waiting for DMA engine\n");
 		goto fail;
 	}
 	tmp &= 0xff0;
@@ -3909,8 +3902,7 @@ run_init_locked(struct run_softc *sc)
 	run_write(sc, RT2860_USB_DMA_CFG, 0);
 
 	if (run_reset(sc) != 0) {
-		printf("%s: could not reset chipset\n",
-		    device_get_nameunit(sc->sc_dev));
+		device_printf(sc->sc_dev, "could not reset chipset\n");
 		goto fail;
 	}
 
@@ -3954,8 +3946,7 @@ run_init_locked(struct run_softc *sc)
 	run_delay(sc, 10);
 
 	if (run_bbp_init(sc) != 0) {
-		printf("%s: could not initialize BBP\n",
-		    device_get_nameunit(sc->sc_dev));
+		device_printf(sc->sc_dev, "could not initialize BBP\n");
 		goto fail;
 	}
 

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Apr  6 23:16:10 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 02FF7106566C;
	Tue,  6 Apr 2010 23:16:10 +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 E3F228FC13;
	Tue,  6 Apr 2010 23:16:09 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o36NG9KM009773;
	Tue, 6 Apr 2010 23:16:09 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o36NG9rn009771;
	Tue, 6 Apr 2010 23:16:09 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <201004062316.o36NG9rn009771@svn.freebsd.org>
From: Andrew Thompson 
Date: Tue, 6 Apr 2010 23:16:09 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206292 - stable/8/sys/dev/usb/wlan
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 06 Apr 2010 23:16:10 -0000

Author: thompsa
Date: Tue Apr  6 23:16:09 2010
New Revision: 206292
URL: http://svn.freebsd.org/changeset/base/206292

Log:
  MFC r203139
  
   Add device ID.
  
  PR:		usb/142427

Modified:
  stable/8/sys/dev/usb/wlan/if_rum.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/usb/wlan/if_rum.c
==============================================================================
--- stable/8/sys/dev/usb/wlan/if_rum.c	Tue Apr  6 23:15:44 2010	(r206291)
+++ stable/8/sys/dev/usb/wlan/if_rum.c	Tue Apr  6 23:16:09 2010	(r206292)
@@ -104,6 +104,7 @@ static const struct usb_device_id rum_de
     RUM_DEV(COREGA, CGWLUSB2GPX),
     RUM_DEV(DICKSMITH, CWD854F),
     RUM_DEV(DICKSMITH, RT2573),
+    RUM_DEV(EDIMAX, EW7318USG),
     RUM_DEV(DLINK2, DWLG122C1),
     RUM_DEV(DLINK2, WUA1340),
     RUM_DEV(DLINK2, DWA111),

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Apr  6 23:16:40 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C59031065691;
	Tue,  6 Apr 2010 23:16: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 B2B0F8FC24;
	Tue,  6 Apr 2010 23:16:40 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o36NGe3u009978;
	Tue, 6 Apr 2010 23:16:40 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o36NGedL009976;
	Tue, 6 Apr 2010 23:16:40 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <201004062316.o36NGedL009976@svn.freebsd.org>
From: Andrew Thompson 
Date: Tue, 6 Apr 2010 23:16:40 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206293 - stable/8/sys/dev/usb/controller
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 06 Apr 2010 23:16:40 -0000

Author: thompsa
Date: Tue Apr  6 23:16:40 2010
New Revision: 206293
URL: http://svn.freebsd.org/changeset/base/206293

Log:
  MFC r203140
  
   Optimise EHCI ISOC HS done check.
  
  Submitted by:	Hans Petter Selasky

Modified:
  stable/8/sys/dev/usb/controller/ehci.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/usb/controller/ehci.c
==============================================================================
--- stable/8/sys/dev/usb/controller/ehci.c	Tue Apr  6 23:16:09 2010	(r206292)
+++ stable/8/sys/dev/usb/controller/ehci.c	Tue Apr  6 23:16:40 2010	(r206293)
@@ -1340,25 +1340,22 @@ ehci_check_transfer(struct usb_xfer *xfe
 		}
 	} else if (methods == &ehci_device_isoc_hs_methods) {
 		ehci_itd_t *td;
+		uint8_t n = (xfer->nframes & 7);
 
 		/* isochronous high speed transfer */
 
+		/* check last transfer */
 		td = xfer->td_transfer_last;
 		usb_pc_cpu_invalidate(td->page_cache);
-		status =
-		    td->itd_status[0] | td->itd_status[1] |
-		    td->itd_status[2] | td->itd_status[3] |
-		    td->itd_status[4] | td->itd_status[5] |
-		    td->itd_status[6] | td->itd_status[7];
+		if (n == 0)
+			status = td->itd_status[7];
+		else
+			status = td->itd_status[n-1];
 
 		/* also check first transfer */
 		td = xfer->td_transfer_first;
 		usb_pc_cpu_invalidate(td->page_cache);
-		status |=
-		    td->itd_status[0] | td->itd_status[1] |
-		    td->itd_status[2] | td->itd_status[3] |
-		    td->itd_status[4] | td->itd_status[5] |
-		    td->itd_status[6] | td->itd_status[7];
+		status |= td->itd_status[0];
 
 		/* if no transactions are active we continue */
 		if (!(status & htohc32(sc, EHCI_ITD_ACTIVE))) {

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Apr  6 23:17:14 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 680041065676;
	Tue,  6 Apr 2010 23:17:14 +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 3A3D08FC1E;
	Tue,  6 Apr 2010 23:17:14 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o36NHErk010169;
	Tue, 6 Apr 2010 23:17:14 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o36NHEt7010166;
	Tue, 6 Apr 2010 23:17:14 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <201004062317.o36NHEt7010166@svn.freebsd.org>
From: Andrew Thompson 
Date: Tue, 6 Apr 2010 23:17:14 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206294 - stable/8/sys/dev/usb/wlan
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 06 Apr 2010 23:17:14 -0000

Author: thompsa
Date: Tue Apr  6 23:17:13 2010
New Revision: 206294
URL: http://svn.freebsd.org/changeset/base/206294

Log:
  MFC r203141
  
   Attempt to recover on a TX error rather than stopping all transfers.
  
  Submitted by:	Hans Petter Selesky

Modified:
  stable/8/sys/dev/usb/wlan/if_rum.c
  stable/8/sys/dev/usb/wlan/if_zyd.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/usb/wlan/if_rum.c
==============================================================================
--- stable/8/sys/dev/usb/wlan/if_rum.c	Tue Apr  6 23:16:40 2010	(r206293)
+++ stable/8/sys/dev/usb/wlan/if_rum.c	Tue Apr  6 23:17:13 2010	(r206294)
@@ -845,13 +845,18 @@ tr_setup:
 			usbd_xfer_set_priv(xfer, NULL);
 		}
 
-		if (error == USB_ERR_STALLED) {
-			/* try to clear stall first */
+		if (error != USB_ERR_CANCELLED) {
+			if (error == USB_ERR_TIMEOUT)
+				device_printf(sc->sc_dev, "device timeout\n");
+
+			/*
+			 * Try to clear stall first, also if other
+			 * errors occur, hence clearing stall
+			 * introduces a 50 ms delay:
+			 */
 			usbd_xfer_set_stall(xfer);
 			goto tr_setup;
 		}
-		if (error == USB_ERR_TIMEOUT)
-			device_printf(sc->sc_dev, "device timeout\n");
 		break;
 	}
 }

Modified: stable/8/sys/dev/usb/wlan/if_zyd.c
==============================================================================
--- stable/8/sys/dev/usb/wlan/if_zyd.c	Tue Apr  6 23:16:40 2010	(r206293)
+++ stable/8/sys/dev/usb/wlan/if_zyd.c	Tue Apr  6 23:17:13 2010	(r206294)
@@ -2449,13 +2449,18 @@ tr_setup:
 		if (data != NULL)
 			zyd_tx_free(data, error);
 
-		if (error == USB_ERR_STALLED) {
-			/* try to clear stall first */
+		if (error != USB_ERR_CANCELLED) {
+			if (error == USB_ERR_TIMEOUT)
+				device_printf(sc->sc_dev, "device timeout\n");
+
+			/*
+			 * Try to clear stall first, also if other
+			 * errors occur, hence clearing stall
+			 * introduces a 50 ms delay:
+			 */
 			usbd_xfer_set_stall(xfer);
 			goto tr_setup;
 		}
-		if (error == USB_ERR_TIMEOUT)
-			device_printf(sc->sc_dev, "device timeout\n");
 		break;
 	}
 }

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Apr  6 23:17:44 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2ADF61065674;
	Tue,  6 Apr 2010 23:17:44 +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 17CEA8FC18;
	Tue,  6 Apr 2010 23:17:44 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o36NHhcR010379;
	Tue, 6 Apr 2010 23:17:43 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o36NHhsC010377;
	Tue, 6 Apr 2010 23:17:43 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <201004062317.o36NHhsC010377@svn.freebsd.org>
From: Andrew Thompson 
Date: Tue, 6 Apr 2010 23:17:43 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206295 - stable/8/sys/dev/usb
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 06 Apr 2010 23:17:44 -0000

Author: thompsa
Date: Tue Apr  6 23:17:43 2010
New Revision: 206295
URL: http://svn.freebsd.org/changeset/base/206295

Log:
  MFC r203142
  
   Sync usb products to perforce.

Modified:
  stable/8/sys/dev/usb/usbdevs
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/usb/usbdevs
==============================================================================
--- stable/8/sys/dev/usb/usbdevs	Tue Apr  6 23:17:13 2010	(r206294)
+++ stable/8/sys/dev/usb/usbdevs	Tue Apr  6 23:17:43 2010	(r206295)
@@ -1117,6 +1117,7 @@ product CCYU ED1064		0x2136	EasyDisk ED1
 
 /* Century products */
 product CENTURY EX35QUAT	0x011e	Century USB Disk Enclosure
+product CENTURY EX35SW4_SB4	0x011f	Century USB Disk Enclosure
 
 /* Cherry products */
 product CHERRY MY3000KBD	0x0001	My3000 keyboard
@@ -1336,6 +1337,7 @@ product DLINK3 DWM652		0x3e04	DWM-652
 
 /* DMI products */
 product DMI CFSM_RW		0xa109	CF/SM Reader/Writer
+product DMI DISK		0x2bcf	Generic Disk
 
 /* DrayTek products */
 product DRAYTEK VIGOR550	0x0550	Vigor550
@@ -2147,6 +2149,7 @@ product NETGEAR3 WG111T		0x4250	WG111T
 product NETGEAR3 WG111T_NF	0x4251	WG111T (no firmware)
 product NETGEAR3 WPN111		0x5f00	WPN111
 product NETGEAR3 WPN111_NF	0x5f01	WPN111 (no firmware)
+product NETGEAR3 WPN111_2	0x5f02	WPN111
 
 /* Nikon products */
 product NIKON E990		0x0102	Digital Camera E990

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Apr  6 23:18:09 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B921B106567B;
	Tue,  6 Apr 2010 23:18:09 +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 A5EFC8FC1E;
	Tue,  6 Apr 2010 23:18:09 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o36NI9ug010554;
	Tue, 6 Apr 2010 23:18:09 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o36NI9iw010534;
	Tue, 6 Apr 2010 23:18:09 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <201004062318.o36NI9iw010534@svn.freebsd.org>
From: Andrew Thompson 
Date: Tue, 6 Apr 2010 23:18:09 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206296 - stable/8/sys/dev/usb/wlan
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 06 Apr 2010 23:18:09 -0000

Author: thompsa
Date: Tue Apr  6 23:18:09 2010
New Revision: 206296
URL: http://svn.freebsd.org/changeset/base/206296

Log:
  MFC r203143
  
   Add the Netgear WPN111

Modified:
  stable/8/sys/dev/usb/wlan/if_uath.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/usb/wlan/if_uath.c
==============================================================================
--- stable/8/sys/dev/usb/wlan/if_uath.c	Tue Apr  6 23:17:43 2010	(r206295)
+++ stable/8/sys/dev/usb/wlan/if_uath.c	Tue Apr  6 23:18:09 2010	(r206296)
@@ -188,6 +188,7 @@ static const struct usb_device_id uath_d
 	UATH_DEV(NETGEAR,		WG111U),
 	UATH_DEV(NETGEAR3,		WG111T),
 	UATH_DEV(NETGEAR3,		WPN111),
+	UATH_DEV(NETGEAR3,		WPN111_2),
 	UATH_DEV(UMEDIA,		TEW444UBEU),
 	UATH_DEV(UMEDIA,		AR5523_2),
 	UATH_DEV(UMEDIA,		AR5523_3),

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Apr  6 23:18:41 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B82B3106566B;
	Tue,  6 Apr 2010 23:18:41 +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 A4A718FC1D;
	Tue,  6 Apr 2010 23:18:41 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o36NIf8G010733;
	Tue, 6 Apr 2010 23:18:41 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o36NIfTf010731;
	Tue, 6 Apr 2010 23:18:41 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <201004062318.o36NIfTf010731@svn.freebsd.org>
From: Andrew Thompson 
Date: Tue, 6 Apr 2010 23:18:41 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206297 - stable/8/sys/dev/usb/quirk
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 06 Apr 2010 23:18:41 -0000

Author: thompsa
Date: Tue Apr  6 23:18:41 2010
New Revision: 206297
URL: http://svn.freebsd.org/changeset/base/206297

Log:
  MFC r203144
  
   Add null check on quirk lookup and add a couple of umass quirks.
  
  Submitted by:	Hans Petter Selesky

Modified:
  stable/8/sys/dev/usb/quirk/usb_quirk.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/usb/quirk/usb_quirk.c
==============================================================================
--- stable/8/sys/dev/usb/quirk/usb_quirk.c	Tue Apr  6 23:18:09 2010	(r206296)
+++ stable/8/sys/dev/usb/quirk/usb_quirk.c	Tue Apr  6 23:18:41 2010	(r206297)
@@ -169,12 +169,14 @@ static struct usb_quirk_entry usb_quirks
 	USB_QUIRK(CENTURY, EX35QUAT, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB,
 	    UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_FORCE_SHORT_INQ,
 	    UQ_MSC_NO_START_STOP, UQ_MSC_IGNORE_RESIDUE),
+	USB_QUIRK(CENTURY, EX35SW4_SB4, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE),
 	USB_QUIRK(CYPRESS, XX6830XX, 0x0000, 0xffff, UQ_MSC_NO_GETMAXLUN,
 	    UQ_MSC_NO_SYNC_CACHE),
 	USB_QUIRK(DESKNOTE, UCR_61S2B, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB,
 	    UQ_MSC_FORCE_PROTO_SCSI),
 	USB_QUIRK(DMI, CFSM_RW, 0x0000, 0xffff, UQ_MSC_FORCE_PROTO_SCSI,
 	    UQ_MSC_NO_GETMAXLUN),
+	USB_QUIRK(DMI, DISK, 0x000, 0xffff, UQ_MSC_NO_SYNC_CACHE),
 	USB_QUIRK(EPSON, STYLUS_875DC, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_CBI,
 	    UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_INQUIRY),
 	USB_QUIRK(EPSON, STYLUS_895, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB,
@@ -259,8 +261,6 @@ static struct usb_quirk_entry usb_quirks
 	    UQ_MSC_FORCE_PROTO_SCSI),
 	USB_QUIRK(MITSUMI, CDRRW, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_CBI |
 	    UQ_MSC_FORCE_PROTO_ATAPI),
-	USB_QUIRK(MITSUMI, FDD, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB,
-	    UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_GETMAXLUN),
 	USB_QUIRK(MOTOROLA2, E398, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB,
 	    UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_FORCE_SHORT_INQ,
 	    UQ_MSC_NO_INQUIRY_EVPD, UQ_MSC_NO_GETMAXLUN),
@@ -680,6 +680,10 @@ usb_quirk_ioctl(unsigned long cmd, caddr
 		mtx_lock(&usb_quirk_mtx);
 		pqe = usb_quirk_get_entry(pgq->vid, pgq->pid,
 		    pgq->bcdDeviceLow, pgq->bcdDeviceHigh, 1);
+		if (pqe == NULL) {
+			mtx_unlock(&usb_quirk_mtx);
+			return (EINVAL);
+		}
 		for (x = 0; x != USB_SUB_QUIRKS_MAX; x++) {
 			if (pqe->quirks[x] == UQ_NONE) {
 				pqe->quirks[x] = y;
@@ -714,6 +718,10 @@ usb_quirk_ioctl(unsigned long cmd, caddr
 		mtx_lock(&usb_quirk_mtx);
 		pqe = usb_quirk_get_entry(pgq->vid, pgq->pid,
 		    pgq->bcdDeviceLow, pgq->bcdDeviceHigh, 0);
+		if (pqe == NULL) {
+			mtx_unlock(&usb_quirk_mtx);
+			return (EINVAL);
+		}
 		for (x = 0; x != USB_SUB_QUIRKS_MAX; x++) {
 			if (pqe->quirks[x] == y) {
 				pqe->quirks[x] = UQ_NONE;

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Apr  6 23:19:12 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2AA6A1065697;
	Tue,  6 Apr 2010 23:19: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 172698FC27;
	Tue,  6 Apr 2010 23:19:12 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o36NJB3u010911;
	Tue, 6 Apr 2010 23:19:11 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o36NJBVT010909;
	Tue, 6 Apr 2010 23:19:11 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <201004062319.o36NJBVT010909@svn.freebsd.org>
From: Andrew Thompson 
Date: Tue, 6 Apr 2010 23:19:11 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206298 - stable/8/sys/dev/usb/storage
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 06 Apr 2010 23:19:12 -0000

Author: thompsa
Date: Tue Apr  6 23:19:11 2010
New Revision: 206298
URL: http://svn.freebsd.org/changeset/base/206298

Log:
  MFC r203145
  
   Simplify attach for UMASS_PROTO_CBI_I mode and change some switch() returns
   into breaks.
  
  Submitted by:	Hans Petter Selesky

Modified:
  stable/8/sys/dev/usb/storage/umass.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/usb/storage/umass.c
==============================================================================
--- stable/8/sys/dev/usb/storage/umass.c	Tue Apr  6 23:18:41 2010	(r206297)
+++ stable/8/sys/dev/usb/storage/umass.c	Tue Apr  6 23:19:11 2010	(r206298)
@@ -671,7 +671,7 @@ static struct usb_config umass_cbi_confi
 		.type = UE_INTERRUPT,
 		.endpoint = UE_ADDR_ANY,
 		.direction = UE_DIR_IN,
-		.flags = {.short_xfer_ok = 1,},
+		.flags = {.short_xfer_ok = 1,.no_pipe_ok = 1,},
 		.bufsize = sizeof(umass_cbi_sbl_t),
 		.callback = &umass_t_cbi_status_callback,
 		.timeout = 5000,	/* ms */
@@ -984,9 +984,7 @@ umass_attach(device_t dev)
 
 		err = usbd_transfer_setup(uaa->device,
 		    &uaa->info.bIfaceIndex, sc->sc_xfer, umass_cbi_config,
-		    (sc->sc_proto & UMASS_PROTO_CBI_I) ?
-		    UMASS_T_CBI_MAX : (UMASS_T_CBI_MAX - 2), sc,
-		    &sc->sc_mtx);
+		    UMASS_T_CBI_MAX, sc, &sc->sc_mtx);
 
 		/* skip reset first time */
 		sc->sc_last_xfer_index = UMASS_T_CBI_COMMAND;
@@ -1676,7 +1674,7 @@ umass_t_cbi_reset1_callback(struct usb_x
 	switch (USB_GET_STATE(xfer)) {
 	case USB_ST_TRANSFERRED:
 		umass_transfer_start(sc, UMASS_T_CBI_RESET2);
-		return;
+		break;
 
 	case USB_ST_SETUP:
 		/*
@@ -1723,11 +1721,14 @@ umass_t_cbi_reset1_callback(struct usb_x
 		usbd_xfer_set_frame_len(xfer, 1, sizeof(buf));
 		usbd_xfer_set_frames(xfer, 2);
 		usbd_transfer_submit(xfer);
-		return;
+		break;
 
 	default:			/* Error */
-		umass_tr_error(xfer, error);
-		return;
+		if (error == USB_ERR_CANCELLED)
+			umass_tr_error(xfer, error);
+		else
+			umass_transfer_start(sc, UMASS_T_CBI_RESET2);
+		break;
 
 	}
 }
@@ -1772,17 +1773,17 @@ tr_transferred:
 		} else {
 			umass_transfer_start(sc, next_xfer);
 		}
-		return;
+		break;
 
 	case USB_ST_SETUP:
 		if (usbd_clear_stall_callback(xfer, sc->sc_xfer[stall_xfer])) {
 			goto tr_transferred;	/* should not happen */
 		}
-		return;
+		break;
 
 	default:			/* Error */
 		umass_tr_error(xfer, error);
-		return;
+		break;
 
 	}
 }
@@ -1805,7 +1806,7 @@ umass_t_cbi_command_callback(struct usb_
 			    (sc, (sc->sc_transfer.dir == DIR_IN) ?
 			    UMASS_T_CBI_DATA_READ : UMASS_T_CBI_DATA_WRITE);
 		}
-		return;
+		break;
 
 	case USB_ST_SETUP:
 
@@ -1844,12 +1845,13 @@ umass_t_cbi_command_callback(struct usb_
 
 			usbd_transfer_submit(xfer);
 		}
-		return;
+		break;
 
 	default:			/* Error */
 		umass_tr_error(xfer, error);
-		return;
-
+		/* skip reset */
+		sc->sc_last_xfer_index = UMASS_T_CBI_COMMAND;
+		break;
 	}
 }
 
@@ -1885,7 +1887,7 @@ umass_t_cbi_data_read_callback(struct us
 
 		if (sc->sc_transfer.data_rem == 0) {
 			umass_cbi_start_status(sc);
-			return;
+			break;
 		}
 		if (max_bulk > sc->sc_transfer.data_rem) {
 			max_bulk = sc->sc_transfer.data_rem;
@@ -1899,7 +1901,7 @@ umass_t_cbi_data_read_callback(struct us
 		usbd_xfer_set_frame_len(xfer, 0, max_bulk);
 #endif
 		usbd_transfer_submit(xfer);
-		return;
+		break;
 
 	default:			/* Error */
 		if ((error == USB_ERR_CANCELLED) ||
@@ -1908,7 +1910,7 @@ umass_t_cbi_data_read_callback(struct us
 		} else {
 			umass_transfer_start(sc, UMASS_T_CBI_DATA_RD_CS);
 		}
-		return;
+		break;
 
 	}
 }
@@ -1948,7 +1950,7 @@ umass_t_cbi_data_write_callback(struct u
 
 		if (sc->sc_transfer.data_rem == 0) {
 			umass_cbi_start_status(sc);
-			return;
+			break;
 		}
 		if (max_bulk > sc->sc_transfer.data_rem) {
 			max_bulk = sc->sc_transfer.data_rem;
@@ -1965,7 +1967,7 @@ umass_t_cbi_data_write_callback(struct u
 #endif
 
 		usbd_transfer_submit(xfer);
-		return;
+		break;
 
 	default:			/* Error */
 		if ((error == USB_ERR_CANCELLED) ||
@@ -1974,7 +1976,7 @@ umass_t_cbi_data_write_callback(struct u
 		} else {
 			umass_transfer_start(sc, UMASS_T_CBI_DATA_WR_CS);
 		}
-		return;
+		break;
 
 	}
 }
@@ -2035,7 +2037,7 @@ umass_t_cbi_status_callback(struct usb_x
 			(sc->sc_transfer.callback)
 			    (sc, ccb, residue, status);
 
-			return;
+			break;
 
 		} else {
 
@@ -2060,7 +2062,7 @@ umass_t_cbi_status_callback(struct usb_x
 				(sc->sc_transfer.callback)
 				    (sc, ccb, residue, status);
 
-				return;
+				break;
 			}
 		}
 
@@ -2070,13 +2072,13 @@ umass_t_cbi_status_callback(struct usb_x
 tr_setup:
 		usbd_xfer_set_frame_len(xfer, 0, usbd_xfer_max_len(xfer));
 		usbd_transfer_submit(xfer);
-		return;
+		break;
 
 	default:			/* Error */
 		DPRINTF(sc, UDMASS_CBI, "Failed to read CSW: %s\n",
 		    usbd_errstr(error));
 		umass_tr_error(xfer, error);
-		return;
+		break;
 
 	}
 }

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Apr  6 23:19:44 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 067FA1065670;
	Tue,  6 Apr 2010 23:19:43 +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 AAF6F8FC1E;
	Tue,  6 Apr 2010 23:19:43 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o36NJhpM011121;
	Tue, 6 Apr 2010 23:19:43 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o36NJhxq011117;
	Tue, 6 Apr 2010 23:19:43 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <201004062319.o36NJhxq011117@svn.freebsd.org>
From: Andrew Thompson 
Date: Tue, 6 Apr 2010 23:19:43 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206299 - stable/8/sys/dev/usb/storage
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 06 Apr 2010 23:19:44 -0000

Author: thompsa
Date: Tue Apr  6 23:19:43 2010
New Revision: 206299
URL: http://svn.freebsd.org/changeset/base/206299

Log:
  MFC r203146
  
   Rework cam error handling to fix Mitsumi floppy drives.
  
  Submitted by:	mav

Modified:
  stable/8/sys/dev/usb/storage/umass.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/usb/storage/umass.c
==============================================================================
--- stable/8/sys/dev/usb/storage/umass.c	Tue Apr  6 23:19:11 2010	(r206298)
+++ stable/8/sys/dev/usb/storage/umass.c	Tue Apr  6 23:19:43 2010	(r206299)
@@ -2594,11 +2594,19 @@ umass_cam_cb(struct umass_softc *sc, uni
 
 	default:
 		/*
-		 * the wire protocol failed and will have recovered
-		 * (hopefully).  We return an error to CAM and let CAM retry
-		 * the command if necessary.
+		 * The wire protocol failed and will hopefully have
+		 * recovered. We return an error to CAM and let CAM
+		 * retry the command if necessary. In case of SCSI IO
+		 * commands we ask the CAM layer to check the
+		 * condition first. This is a quick hack to make
+		 * certain devices work.
 		 */
-		ccb->ccb_h.status = CAM_REQ_CMP_ERR;
+		if (ccb->ccb_h.func_code == XPT_SCSI_IO) {
+			ccb->ccb_h.status = CAM_SCSI_STATUS_ERROR;
+			ccb->csio.scsi_status = SCSI_STATUS_CHECK_COND;
+		} else {
+			ccb->ccb_h.status = CAM_REQ_CMP_ERR;
+		}
 		xpt_done(ccb);
 		break;
 	}

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Apr  6 23:20:14 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2CFC7106566C;
	Tue,  6 Apr 2010 23:20:14 +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 F35B68FC14;
	Tue,  6 Apr 2010 23:20:13 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o36NKDVG011309;
	Tue, 6 Apr 2010 23:20:13 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o36NKDIn011306;
	Tue, 6 Apr 2010 23:20:13 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <201004062320.o36NKDIn011306@svn.freebsd.org>
From: Andrew Thompson 
Date: Tue, 6 Apr 2010 23:20:13 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206300 - in stable/8/sys/dev/usb: . serial
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 06 Apr 2010 23:20:14 -0000

Author: thompsa
Date: Tue Apr  6 23:20:13 2010
New Revision: 206300
URL: http://svn.freebsd.org/changeset/base/206300

Log:
  MFC r203506
  
   Properly name the 0x0016 ZTE product as MF633R now that its known.

Modified:
  stable/8/sys/dev/usb/serial/u3g.c
  stable/8/sys/dev/usb/usbdevs
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/usb/serial/u3g.c
==============================================================================
--- stable/8/sys/dev/usb/serial/u3g.c	Tue Apr  6 23:19:43 2010	(r206299)
+++ stable/8/sys/dev/usb/serial/u3g.c	Tue Apr  6 23:20:13 2010	(r206300)
@@ -362,7 +362,6 @@ static const struct usb_device_id u3g_de
 	U3G_DEV(QUALCOMMINC, E0012, 0),
 	U3G_DEV(QUALCOMMINC, E0013, 0),
 	U3G_DEV(QUALCOMMINC, E0014, 0),
-	U3G_DEV(QUALCOMMINC, E0016, 0),
 	U3G_DEV(QUALCOMMINC, E0017, 0),
 	U3G_DEV(QUALCOMMINC, E0018, 0),
 	U3G_DEV(QUALCOMMINC, E0019, 0),
@@ -409,6 +408,7 @@ static const struct usb_device_id u3g_de
 	U3G_DEV(QUALCOMMINC, E2003, 0),
 	U3G_DEV(QUALCOMMINC, MF626, 0),
 	U3G_DEV(QUALCOMMINC, MF628, 0),
+	U3G_DEV(QUALCOMMINC, MF633R, 0),
 	U3G_DEV(QUANTA, GKE, 0),
 	U3G_DEV(QUANTA, GLE, 0),
 	U3G_DEV(QUANTA, GLX, 0),

Modified: stable/8/sys/dev/usb/usbdevs
==============================================================================
--- stable/8/sys/dev/usb/usbdevs	Tue Apr  6 23:19:43 2010	(r206299)
+++ stable/8/sys/dev/usb/usbdevs	Tue Apr  6 23:20:13 2010	(r206300)
@@ -2430,7 +2430,7 @@ product QUALCOMMINC E0012	0x0012	3G mode
 product QUALCOMMINC E0013	0x0013	3G modem
 product QUALCOMMINC E0014	0x0014	3G modem
 product QUALCOMMINC MF628	0x0015	3G modem
-product QUALCOMMINC E0016	0x0016	3G modem
+product QUALCOMMINC MF633R	0x0016	ZTE WCDMA modem
 product QUALCOMMINC E0017	0x0017	3G modem
 product QUALCOMMINC E0018	0x0018	3G modem
 product QUALCOMMINC E0019	0x0019	3G modem

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Apr  6 23:20:41 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DCC07106567B;
	Tue,  6 Apr 2010 23:20:41 +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 B7DCD8FC16;
	Tue,  6 Apr 2010 23:20:41 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o36NKfPN011492;
	Tue, 6 Apr 2010 23:20:41 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o36NKfki011489;
	Tue, 6 Apr 2010 23:20:41 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <201004062320.o36NKfki011489@svn.freebsd.org>
From: Andrew Thompson 
Date: Tue, 6 Apr 2010 23:20:41 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206301 - in stable/8/sys/dev/usb: . serial
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 06 Apr 2010 23:20:42 -0000

Author: thompsa
Date: Tue Apr  6 23:20:41 2010
New Revision: 206301
URL: http://svn.freebsd.org/changeset/base/206301

Log:
  MFC r203507
  
   The ZTE MF633R modem has a different type of cdrom driver disk, add the product
   ID and use a standard scsi eject.
  
  Reported by:	Patrick Lamaiziere

Modified:
  stable/8/sys/dev/usb/serial/u3g.c
  stable/8/sys/dev/usb/usbdevs
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/usb/serial/u3g.c
==============================================================================
--- stable/8/sys/dev/usb/serial/u3g.c	Tue Apr  6 23:20:13 2010	(r206300)
+++ stable/8/sys/dev/usb/serial/u3g.c	Tue Apr  6 23:20:41 2010	(r206301)
@@ -498,6 +498,7 @@ static const struct usb_device_id u3g_de
 	U3G_DEV(NOVATEL, ZEROCD, U3GINIT_SCSIEJECT),
 	U3G_DEV(OPTION, GTICON322, U3GINIT_REZERO),
 	U3G_DEV(QUALCOMMINC, ZTE_STOR, U3GINIT_ZTESTOR),
+	U3G_DEV(QUALCOMMINC, ZTE_STOR2, U3GINIT_SCSIEJECT),
 	U3G_DEV(SIERRA, TRUINSTALL, U3GINIT_SIERRA),
 #undef	U3G_DEV
 };

Modified: stable/8/sys/dev/usb/usbdevs
==============================================================================
--- stable/8/sys/dev/usb/usbdevs	Tue Apr  6 23:20:13 2010	(r206300)
+++ stable/8/sys/dev/usb/usbdevs	Tue Apr  6 23:20:41 2010	(r206301)
@@ -2456,6 +2456,7 @@ product QUALCOMMINC E0048	0x0048	3G mode
 product QUALCOMMINC E0049	0x0049	3G modem
 product QUALCOMMINC E0051	0x0051	3G modem
 product QUALCOMMINC E0052	0x0052	3G modem
+product QUALCOMMINC ZTE_STOR2	0x0053	USB ZTE Storage
 product QUALCOMMINC E0054	0x0054	3G modem
 product QUALCOMMINC E0055	0x0055	3G modem
 product QUALCOMMINC E0057	0x0057	3G modem

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Apr  6 23:21:06 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 627E11065670;
	Tue,  6 Apr 2010 23:21:06 +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 4F1378FC0A;
	Tue,  6 Apr 2010 23:21:06 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o36NL696011667;
	Tue, 6 Apr 2010 23:21:06 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o36NL6px011663;
	Tue, 6 Apr 2010 23:21:06 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <201004062321.o36NL6px011663@svn.freebsd.org>
From: Andrew Thompson 
Date: Tue, 6 Apr 2010 23:21:06 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206302 - stable/8/sys/dev/usb/controller
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 06 Apr 2010 23:21:06 -0000

Author: thompsa
Date: Tue Apr  6 23:21:06 2010
New Revision: 206302
URL: http://svn.freebsd.org/changeset/base/206302

Log:
  MFC r203693
  
   Disable the use of the IAAD usb doorbell on NVidia controllers as it can cause
   the hardware to stall.
  
  Submitted by:	Hans Petter Selasky

Modified:
  stable/8/sys/dev/usb/controller/ehci.c
  stable/8/sys/dev/usb/controller/ehci.h
  stable/8/sys/dev/usb/controller/ehci_pci.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/usb/controller/ehci.c
==============================================================================
--- stable/8/sys/dev/usb/controller/ehci.c	Tue Apr  6 23:20:41 2010	(r206301)
+++ stable/8/sys/dev/usb/controller/ehci.c	Tue Apr  6 23:21:06 2010	(r206302)
@@ -92,15 +92,23 @@ __FBSDID("$FreeBSD$");
 #if USB_DEBUG
 static int ehcidebug = 0;
 static int ehcinohighspeed = 0;
+static int ehciiaadbug = 0;
+static int ehcilostintrbug = 0;
 
 SYSCTL_NODE(_hw_usb, OID_AUTO, ehci, CTLFLAG_RW, 0, "USB ehci");
 SYSCTL_INT(_hw_usb_ehci, OID_AUTO, debug, CTLFLAG_RW,
     &ehcidebug, 0, "Debug level");
 SYSCTL_INT(_hw_usb_ehci, OID_AUTO, no_hs, CTLFLAG_RW,
     &ehcinohighspeed, 0, "Disable High Speed USB");
+SYSCTL_INT(_hw_usb_ehci, OID_AUTO, iaadbug, CTLFLAG_RW,
+    &ehciiaadbug, 0, "Enable doorbell bug workaround");
+SYSCTL_INT(_hw_usb_ehci, OID_AUTO, lostintrbug, CTLFLAG_RW,
+    &ehcilostintrbug, 0, "Enable lost interrupt bug workaround");
 
 TUNABLE_INT("hw.usb.ehci.debug", &ehcidebug);
 TUNABLE_INT("hw.usb.ehci.no_hs", &ehcinohighspeed);
+TUNABLE_INT("hw.usb.ehci.iaadbug", &ehciiaadbug);
+TUNABLE_INT("hw.usb.ehci.lostintrbug", &ehcilostintrbug);
 
 static void ehci_dump_regs(ehci_softc_t *sc);
 static void ehci_dump_sqh(ehci_softc_t *sc, ehci_qh_t *sqh);
@@ -251,6 +259,10 @@ ehci_init(ehci_softc_t *sc)
 	usb_callout_init_mtx(&sc->sc_tmo_poll, &sc->sc_bus.bus_mtx, 0);
 
 #if USB_DEBUG
+	if (ehciiaadbug)
+		sc->sc_flags |= EHCI_SCFLG_IAADBUG;
+	if (ehcilostintrbug)
+		sc->sc_flags |= EHCI_SCFLG_LOSTINTRBUG;
 	if (ehcidebug > 2) {
 		ehci_dump_regs(sc);
 	}
@@ -2280,6 +2292,13 @@ ehci_device_bulk_start(struct usb_xfer *
 	/* put transfer on interrupt queue */
 	ehci_transfer_intr_enqueue(xfer);
 
+	/* 
+	 * XXX Certain nVidia chipsets choke when using the IAAD
+	 * feature too frequently.
+	 */
+	if (sc->sc_flags & EHCI_SCFLG_IAADBUG)
+		return;
+
 	/* XXX Performance quirk: Some Host Controllers have a too low
 	 * interrupt rate. Issue an IAAD to stimulate the Host
 	 * Controller after queueing the BULK transfer.

Modified: stable/8/sys/dev/usb/controller/ehci.h
==============================================================================
--- stable/8/sys/dev/usb/controller/ehci.h	Tue Apr  6 23:20:41 2010	(r206301)
+++ stable/8/sys/dev/usb/controller/ehci.h	Tue Apr  6 23:21:06 2010	(r206302)
@@ -350,6 +350,7 @@ typedef struct ehci_softc {
 #define	EHCI_SCFLG_BIGEMMIO	0x0010	/* big-endian byte order MMIO */
 #define	EHCI_SCFLG_TT		0x0020	/* transaction translator present */
 #define	EHCI_SCFLG_LOSTINTRBUG	0x0040	/* workaround for VIA / ATI chipsets */
+#define	EHCI_SCFLG_IAADBUG	0x0080	/* workaround for nVidia chipsets */
 
 	uint8_t	sc_offs;		/* offset to operational registers */
 	uint8_t	sc_doorbell_disable;	/* set on doorbell failure */

Modified: stable/8/sys/dev/usb/controller/ehci_pci.c
==============================================================================
--- stable/8/sys/dev/usb/controller/ehci_pci.c	Tue Apr  6 23:20:41 2010	(r206301)
+++ stable/8/sys/dev/usb/controller/ehci_pci.c	Tue Apr  6 23:21:06 2010	(r206302)
@@ -466,6 +466,19 @@ ehci_pci_attach(device_t self)
 		break;
 	}
 
+	/* Doorbell feature workaround */
+	switch (pci_get_vendor(self)) {
+	case PCI_EHCI_VENDORID_NVIDIA:
+	case PCI_EHCI_VENDORID_NVIDIA2:
+		sc->sc_flags |= EHCI_SCFLG_IAADBUG;
+		if (bootverbose)
+			device_printf(self,
+			    "Doorbell workaround enabled\n");
+		break;
+	default:
+		break;
+	}
+
 	err = ehci_init(sc);
 	if (!err) {
 		err = device_probe_and_attach(sc->sc_bus.bdev);

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Apr  6 23:21:30 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8680F106564A;
	Tue,  6 Apr 2010 23:21:30 +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 725A28FC13;
	Tue,  6 Apr 2010 23:21:30 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o36NLU10011837;
	Tue, 6 Apr 2010 23:21:30 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o36NLUTS011835;
	Tue, 6 Apr 2010 23:21:30 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <201004062321.o36NLUTS011835@svn.freebsd.org>
From: Andrew Thompson 
Date: Tue, 6 Apr 2010 23:21:30 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206303 - stable/8/sys/dev/usb/input
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 06 Apr 2010 23:21:30 -0000

Author: thompsa
Date: Tue Apr  6 23:21:30 2010
New Revision: 206303
URL: http://svn.freebsd.org/changeset/base/206303

Log:
  MFC r203896
  
   Detect when we are polling from kernel via cngetc() in the boot process and
   reserve the keypresses so they do not get passed to syscons.
  
  Submitted by:	Hans Petter Selasky

Modified:
  stable/8/sys/dev/usb/input/ukbd.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/usb/input/ukbd.c
==============================================================================
--- stable/8/sys/dev/usb/input/ukbd.c	Tue Apr  6 23:21:06 2010	(r206302)
+++ stable/8/sys/dev/usb/input/ukbd.c	Tue Apr  6 23:21:30 2010	(r206303)
@@ -151,6 +151,7 @@ struct ukbd_softc {
 	struct ukbd_data sc_ndata;
 	struct ukbd_data sc_odata;
 
+	struct thread *sc_poll_thread;
 	struct usb_device *sc_udev;
 	struct usb_interface *sc_iface;
 	struct usb_xfer *sc_xfer[UKBD_N_TRANSFER];
@@ -174,9 +175,10 @@ struct ukbd_softc {
 #define	UKBD_FLAG_APPLE_SWAP	0x0100
 #define	UKBD_FLAG_TIMER_RUNNING	0x0200
 
-	int32_t	sc_mode;		/* input mode (K_XLATE,K_RAW,K_CODE) */
-	int32_t	sc_state;		/* shift/lock key state */
-	int32_t	sc_accents;		/* accent key index (> 0) */
+	int	sc_mode;		/* input mode (K_XLATE,K_RAW,K_CODE) */
+	int	sc_state;		/* shift/lock key state */
+	int	sc_accents;		/* accent key index (> 0) */
+	int	sc_poll_tick_last;
 
 	uint16_t sc_inputs;
 	uint16_t sc_inputhead;
@@ -187,6 +189,7 @@ struct ukbd_softc {
 	uint8_t	sc_iface_no;
 	uint8_t sc_kbd_id;
 	uint8_t sc_led_id;
+	uint8_t sc_poll_detected;
 };
 
 #define	KEY_ERROR	  0x01
@@ -281,6 +284,9 @@ static int	ukbd_ioctl(keyboard_t *, u_lo
 static int	ukbd_enable(keyboard_t *);
 static int	ukbd_disable(keyboard_t *);
 static void	ukbd_interrupt(struct ukbd_softc *);
+static int	ukbd_is_polling(struct ukbd_softc *);
+static int	ukbd_polls_other_thread(struct ukbd_softc *);
+static void	ukbd_event_keyinput(struct ukbd_softc *);
 
 static device_probe_t ukbd_probe;
 static device_attach_t ukbd_attach;
@@ -331,8 +337,21 @@ ukbd_do_poll(struct ukbd_softc *sc, uint
 {
 	DPRINTFN(2, "polling\n");
 
-	if (kdb_active == 0)
+	/* update stats about last polling event */
+	sc->sc_poll_tick_last = ticks;
+	sc->sc_poll_detected = 1;
+
+	if (kdb_active == 0) {
+		while (sc->sc_inputs == 0) {
+			/* make sure the USB code gets a chance to run */
+			pause("UKBD", 1);
+
+			/* check if we should wait */
+			if (!wait)
+				break;
+		}
 		return;		/* Only poll if KDB is active */
+	}
 
 	while (sc->sc_inputs == 0) {
 
@@ -366,9 +385,13 @@ ukbd_get_key(struct ukbd_softc *sc, uint
 		/* start transfer, if not already started */
 		usbd_transfer_start(sc->sc_xfer[UKBD_INTR_DT]);
 	}
-	if (sc->sc_flags & UKBD_FLAG_POLLING) {
+
+	if (ukbd_polls_other_thread(sc))
+		return (-1);
+
+	if (sc->sc_flags & UKBD_FLAG_POLLING)
 		ukbd_do_poll(sc, wait);
-	}
+
 	if (sc->sc_inputs == 0) {
 		c = -1;
 	} else {
@@ -389,14 +412,13 @@ ukbd_interrupt(struct ukbd_softc *sc)
 	uint32_t o_mod;
 	uint32_t now = sc->sc_time_ms;
 	uint32_t dtime;
-	uint32_t c;
 	uint8_t key;
 	uint8_t i;
 	uint8_t j;
 
-	if (sc->sc_ndata.keycode[0] == KEY_ERROR) {
-		goto done;
-	}
+	if (sc->sc_ndata.keycode[0] == KEY_ERROR)
+		return;
+
 	n_mod = sc->sc_ndata.modifiers;
 	o_mod = sc->sc_odata.modifiers;
 	if (n_mod != o_mod) {
@@ -469,14 +491,22 @@ pfound:	;
 
 	sc->sc_odata = sc->sc_ndata;
 
-	bcopy(sc->sc_ntime, sc->sc_otime, sizeof(sc->sc_otime));
+	memcpy(sc->sc_otime, sc->sc_ntime, sizeof(sc->sc_otime));
+
+	ukbd_event_keyinput(sc);
+}
+
+static void
+ukbd_event_keyinput(struct ukbd_softc *sc)
+{
+	int c;
+
+	if (ukbd_is_polling(sc))
+		return;
+
+	if (sc->sc_inputs == 0)
+		return;
 
-	if (sc->sc_inputs == 0) {
-		goto done;
-	}
-	if (sc->sc_flags & UKBD_FLAG_POLLING) {
-		goto done;
-	}
 	if (KBD_IS_ACTIVE(&sc->sc_kbd) &&
 	    KBD_IS_BUSY(&sc->sc_kbd)) {
 		/* let the callback function process the input */
@@ -488,8 +518,6 @@ pfound:	;
 			c = ukbd_read_char(&sc->sc_kbd, 0);
 		} while (c != NOKEY);
 	}
-done:
-	return;
 }
 
 static void
@@ -499,12 +527,14 @@ ukbd_timeout(void *arg)
 
 	mtx_assert(&Giant, MA_OWNED);
 
-	if (!(sc->sc_flags & UKBD_FLAG_POLLING)) {
-		sc->sc_time_ms += 25;	/* milliseconds */
-	}
+	sc->sc_time_ms += 25;	/* milliseconds */
+
 	ukbd_interrupt(sc);
 
-	if (ukbd_any_key_pressed(sc)) {
+	/* Make sure any leftover key events gets read out */
+	ukbd_event_keyinput(sc);
+
+	if (ukbd_any_key_pressed(sc) || (sc->sc_inputs != 0)) {
 		ukbd_start_timer(sc);
 	} else {
 		sc->sc_flags &= ~UKBD_FLAG_TIMER_RUNNING;
@@ -837,6 +867,18 @@ ukbd_attach(device_t dev)
 	 */
 	KBD_PROBE_DONE(kbd);
 
+	/*
+	 * Set boot protocol if we need the quirk.
+	 */
+	if (usb_test_quirk(uaa, UQ_KBD_BOOTPROTO)) {
+		err = usbd_req_set_protocol(sc->sc_udev, NULL, 
+			sc->sc_iface_index, 0);
+		if (err != USB_ERR_NORMAL_COMPLETION) {
+			DPRINTF("set protocol error=%s\n", usbd_errstr(err));
+			goto detach;
+		}
+	}
+
 	/* figure out if there is an ID byte in the data */
 	err = usbd_req_get_hid_desc(uaa->device, NULL, &hid_ptr,
 	    &hid_len, M_TEMP, uaa->info.bIfaceIndex);
@@ -880,10 +922,14 @@ ukbd_attach(device_t dev)
 	/* ignore if SETIDLE fails, hence it is not crucial */
 	err = usbd_req_set_idle(sc->sc_udev, NULL, sc->sc_iface_index, 0, 0);
 
+	mtx_lock(&Giant);
+
 	ukbd_ioctl(kbd, KDSETLED, (caddr_t)&sc->sc_state);
 
 	KBD_INIT_DONE(kbd);
 
+	mtx_unlock(&Giant);
+
 	if (kbd_register(kbd) < 0) {
 		goto detach;
 	}
@@ -925,9 +971,8 @@ ukbd_detach(device_t dev)
 
 	DPRINTF("\n");
 
-	if (sc->sc_flags & UKBD_FLAG_POLLING) {
-		panic("cannot detach polled keyboard\n");
-	}
+	mtx_lock(&Giant);
+
 	sc->sc_flags |= UKBD_FLAG_GONE;
 
 	usb_callout_stop(&sc->sc_callout);
@@ -954,6 +999,8 @@ ukbd_detach(device_t dev)
 	}
 	sc->sc_kbd.kb_flags = 0;
 
+	mtx_unlock(&Giant);
+
 	usbd_transfer_unsetup(sc->sc_xfer, UKBD_N_TRANSFER);
 
 	usb_callout_drain(&sc->sc_callout);
@@ -969,8 +1016,12 @@ ukbd_resume(device_t dev)
 {
 	struct ukbd_softc *sc = device_get_softc(dev);
 
+	mtx_lock(&Giant);
+
 	ukbd_clear_state(&sc->sc_kbd);
 
+	mtx_unlock(&Giant);
+
 	return (0);
 }
 
@@ -1076,13 +1127,19 @@ ukbd_check(keyboard_t *kbd)
 			mtx_unlock(&Giant);
 			return (retval);
 		}
-		ukbd_do_poll(sc, 0);
 	} else {
 		/* XXX the keyboard layer requires Giant */
 		if (!mtx_owned(&Giant))
 			return (0);
 	}
 
+	/* check if key belongs to this thread */
+	if (ukbd_polls_other_thread(sc))
+		return (0);
+
+	if (sc->sc_flags & UKBD_FLAG_POLLING)
+		ukbd_do_poll(sc, 0);
+
 #ifdef UKBD_EMULATE_ATSCANCODE
 	if (sc->sc_buffered_char[0]) {
 		return (1);
@@ -1118,6 +1175,10 @@ ukbd_check_char(keyboard_t *kbd)
 			return (0);
 	}
 
+	/* check if key belongs to this thread */
+	if (ukbd_polls_other_thread(sc))
+		return (0);
+
 	if ((sc->sc_composed_char > 0) &&
 	    (!(sc->sc_flags & UKBD_FLAG_COMPOSE))) {
 		return (1);
@@ -1156,6 +1217,10 @@ ukbd_read(keyboard_t *kbd, int wait)
 			return (-1);
 	}
 
+	/* check if key belongs to this thread */
+	if (ukbd_polls_other_thread(sc))
+		return (-1);
+
 #ifdef UKBD_EMULATE_ATSCANCODE
 	if (sc->sc_buffered_char[0]) {
 		scancode = sc->sc_buffered_char[0];
@@ -1220,6 +1285,10 @@ ukbd_read_char(keyboard_t *kbd, int wait
 			return (NOKEY);
 	}
 
+	/* check if key belongs to this thread */
+	if (ukbd_polls_other_thread(sc))
+		return (NOKEY);
+
 next_code:
 
 	/* do we have a composed char to return ? */
@@ -1419,7 +1488,17 @@ ukbd_ioctl(keyboard_t *kbd, u_long cmd, 
 		 * keyboard system must get out of "Giant" first, before the
 		 * CPU can proceed here ...
 		 */
-		return (EINVAL);
+		switch (cmd) {
+		case KDGKBMODE:
+		case KDSKBMODE:
+			/* workaround for Geli */
+			mtx_lock(&Giant);
+			i = ukbd_ioctl(kbd, cmd, arg);
+			mtx_unlock(&Giant);
+			return (i);
+		default:
+			return (EINVAL);
+		}
 	}
 
 	switch (cmd) {
@@ -1445,7 +1524,8 @@ ukbd_ioctl(keyboard_t *kbd, u_long cmd, 
 		case K_RAW:
 		case K_CODE:
 			if (sc->sc_mode != *(int *)arg) {
-				ukbd_clear_state(kbd);
+				if (ukbd_is_polling(sc) == 0)
+					ukbd_clear_state(kbd);
 				sc->sc_mode = *(int *)arg;
 			}
 			break;
@@ -1552,7 +1632,11 @@ ukbd_clear_state(keyboard_t *kbd)
 	struct ukbd_softc *sc = kbd->kb_data;
 
 	if (!mtx_owned(&Giant)) {
-		return;			/* XXX */
+		/* XXX cludge */
+		mtx_lock(&Giant);
+		ukbd_clear_state(kbd);
+		mtx_unlock(&Giant);
+		return;
 	}
 
 	sc->sc_flags &= ~(UKBD_FLAG_COMPOSE | UKBD_FLAG_POLLING);
@@ -1563,10 +1647,10 @@ ukbd_clear_state(keyboard_t *kbd)
 	sc->sc_buffered_char[0] = 0;
 	sc->sc_buffered_char[1] = 0;
 #endif
-	bzero(&sc->sc_ndata, sizeof(sc->sc_ndata));
-	bzero(&sc->sc_odata, sizeof(sc->sc_odata));
-	bzero(&sc->sc_ntime, sizeof(sc->sc_ntime));
-	bzero(&sc->sc_otime, sizeof(sc->sc_otime));
+	memset(&sc->sc_ndata, 0, sizeof(sc->sc_ndata));
+	memset(&sc->sc_odata, 0, sizeof(sc->sc_odata));
+	memset(&sc->sc_ntime, 0, sizeof(sc->sc_ntime));
+	memset(&sc->sc_otime, 0, sizeof(sc->sc_otime));
 }
 
 /* save the internal state, not used */
@@ -1584,6 +1668,30 @@ ukbd_set_state(keyboard_t *kbd, void *bu
 }
 
 static int
+ukbd_is_polling(struct ukbd_softc *sc)
+{
+	int delta;
+
+	if (sc->sc_flags & UKBD_FLAG_POLLING)
+		return (1);	/* polling */
+
+	delta = ticks - sc->sc_poll_tick_last;
+	if ((delta < 0) || (delta >= hz)) {
+		sc->sc_poll_detected = 0;
+		return (0);		/* not polling */
+	}
+
+	return (sc->sc_poll_detected);
+}
+
+static int
+ukbd_polls_other_thread(struct ukbd_softc *sc)
+{
+	return (ukbd_is_polling(sc) &&
+	    (sc->sc_poll_thread != curthread));
+}
+
+static int
 ukbd_poll(keyboard_t *kbd, int on)
 {
 	struct ukbd_softc *sc = kbd->kb_data;
@@ -1599,8 +1707,10 @@ ukbd_poll(keyboard_t *kbd, int on)
 
 	if (on) {
 		sc->sc_flags |= UKBD_FLAG_POLLING;
+		sc->sc_poll_thread = curthread;
 	} else {
 		sc->sc_flags &= ~UKBD_FLAG_POLLING;
+		ukbd_start_timer(sc);	/* start timer */
 	}
 	return (0);
 }

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Apr  6 23:21:55 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 45073106564A;
	Tue,  6 Apr 2010 23:21: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 31D238FC24;
	Tue,  6 Apr 2010 23:21:55 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o36NLtqo011976;
	Tue, 6 Apr 2010 23:21:55 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o36NLtpO011973;
	Tue, 6 Apr 2010 23:21:55 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <201004062321.o36NLtpO011973@svn.freebsd.org>
From: Andrew Thompson 
Date: Tue, 6 Apr 2010 23:21:55 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206304 - stable/8/sys/dev/usb/quirk
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 06 Apr 2010 23:21:55 -0000

Author: thompsa
Date: Tue Apr  6 23:21:54 2010
New Revision: 206304
URL: http://svn.freebsd.org/changeset/base/206304

Log:
  MFC r203899
  
   Add UQ_KBD_BOOTPROTO quirk needed in r203896

Modified:
  stable/8/sys/dev/usb/quirk/usb_quirk.c
  stable/8/sys/dev/usb/quirk/usb_quirk.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/usb/quirk/usb_quirk.c
==============================================================================
--- stable/8/sys/dev/usb/quirk/usb_quirk.c	Tue Apr  6 23:21:30 2010	(r206303)
+++ stable/8/sys/dev/usb/quirk/usb_quirk.c	Tue Apr  6 23:21:54 2010	(r206304)
@@ -459,6 +459,7 @@ static const char *usb_quirk_str[USB_QUI
 	[UQ_BUS_POWERED]	= "UQ_BUS_POWERED",
 	[UQ_HID_IGNORE]		= "UQ_HID_IGNORE",
 	[UQ_KBD_IGNORE]		= "UQ_KBD_IGNORE",
+	[UQ_KBD_BOOTPROTO]	= "UQ_KBD_BOOTPROTO",
 	[UQ_MS_BAD_CLASS]	= "UQ_MS_BAD_CLASS",
 	[UQ_MS_LEADING_BYTE]	= "UQ_MS_LEADING_BYTE",
 	[UQ_MS_REVZ]		= "UQ_MS_REVZ",

Modified: stable/8/sys/dev/usb/quirk/usb_quirk.h
==============================================================================
--- stable/8/sys/dev/usb/quirk/usb_quirk.h	Tue Apr  6 23:21:30 2010	(r206303)
+++ stable/8/sys/dev/usb/quirk/usb_quirk.h	Tue Apr  6 23:21:54 2010	(r206304)
@@ -45,6 +45,7 @@ enum {	/* keep in sync with usb_quirk_st
 	UQ_BUS_POWERED,		/* device is bus powered, despite claim */
 	UQ_HID_IGNORE,		/* device should be ignored by hid class */
 	UQ_KBD_IGNORE,		/* device should be ignored by kbd class */
+	UQ_KBD_BOOTPROTO,	/* device should set the boot protocol */
 	UQ_MS_BAD_CLASS,	/* doesn't identify properly */
 	UQ_MS_LEADING_BYTE,	/* mouse sends an unknown leading byte */
 	UQ_MS_REVZ,		/* mouse has Z-axis reversed */

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Apr  6 23:22:20 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 169D7106568D;
	Tue,  6 Apr 2010 23:22:20 +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 035718FC19;
	Tue,  6 Apr 2010 23:22:20 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o36NMJq8012162;
	Tue, 6 Apr 2010 23:22:19 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o36NMJVN012160;
	Tue, 6 Apr 2010 23:22:19 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <201004062322.o36NMJVN012160@svn.freebsd.org>
From: Andrew Thompson 
Date: Tue, 6 Apr 2010 23:22:19 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206305 - stable/8/sys/dev/usb/serial
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 06 Apr 2010 23:22:20 -0000

Author: thompsa
Date: Tue Apr  6 23:22:19 2010
New Revision: 206305
URL: http://svn.freebsd.org/changeset/base/206305

Log:
  MFC r203903
  
   Make umodem more tolerant for devices which modem descriptors are misplaced.
  
  Reported by:	Erick Wales
  Submitted by:	Hans Petter Selasky

Modified:
  stable/8/sys/dev/usb/serial/umodem.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/usb/serial/umodem.c
==============================================================================
--- stable/8/sys/dev/usb/serial/umodem.c	Tue Apr  6 23:21:54 2010	(r206304)
+++ stable/8/sys/dev/usb/serial/umodem.c	Tue Apr  6 23:22:19 2010	(r206305)
@@ -312,11 +312,16 @@ umodem_attach(device_t dev)
 		    0 - 1, UDESCSUB_CDC_UNION, 0 - 1);
 
 		if ((cud == NULL) || (cud->bLength < sizeof(*cud))) {
-			device_printf(dev, "no CM or union descriptor\n");
-			goto detach;
+			device_printf(dev, "Missing descriptor. "
+			    "Assuming data interface is next.\n");
+			if (sc->sc_ctrl_iface_no == 0xFF)
+				goto detach;
+			else
+				sc->sc_data_iface_no = 
+				    sc->sc_ctrl_iface_no + 1;
+		} else {
+			sc->sc_data_iface_no = cud->bSlaveInterface[0];
 		}
-
-		sc->sc_data_iface_no = cud->bSlaveInterface[0];
 	} else {
 		sc->sc_data_iface_no = cmd->bDataInterface;
 	}

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Apr  6 23:22:47 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BC5ED1065677;
	Tue,  6 Apr 2010 23:22: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 A89FB8FC0A;
	Tue,  6 Apr 2010 23:22:47 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o36NMlpC012337;
	Tue, 6 Apr 2010 23:22:47 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o36NMlr9012332;
	Tue, 6 Apr 2010 23:22:47 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <201004062322.o36NMlr9012332@svn.freebsd.org>
From: Andrew Thompson 
Date: Tue, 6 Apr 2010 23:22:47 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206306 - in stable/8/sys/dev/usb: . serial
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 06 Apr 2010 23:22:47 -0000

Author: thompsa
Date: Tue Apr  6 23:22:47 2010
New Revision: 206306
URL: http://svn.freebsd.org/changeset/base/206306

Log:
  MFC r203905
  
   Add support for the E1752 3G modem and the required eject command.
  
  Submitted by:	Milan Obuch

Modified:
  stable/8/sys/dev/usb/serial/u3g.c
  stable/8/sys/dev/usb/usb_msctest.c
  stable/8/sys/dev/usb/usb_msctest.h
  stable/8/sys/dev/usb/usbdevs
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/usb/serial/u3g.c
==============================================================================
--- stable/8/sys/dev/usb/serial/u3g.c	Tue Apr  6 23:22:19 2010	(r206305)
+++ stable/8/sys/dev/usb/serial/u3g.c	Tue Apr  6 23:22:47 2010	(r206306)
@@ -92,6 +92,7 @@ SYSCTL_INT(_hw_usb_u3g, OID_AUTO, debug,
 #define	U3GINIT_CMOTECH		6	/* Requires CMOTECH SCSI command */
 #define	U3GINIT_WAIT		7	/* Device reappears after a delay */
 #define	U3GINIT_SAEL_M460	8	/* Requires vendor init */
+#define	U3GINIT_HUAWEISCSI	9	/* Requires Huawei SCSI init command */
 
 enum {
 	U3G_BULK_WR,
@@ -281,6 +282,7 @@ static const struct usb_device_id u3g_de
 	U3G_DEV(HUAWEI, E220, U3GINIT_HUAWEI),
 	U3G_DEV(HUAWEI, E220BIS, U3GINIT_HUAWEI),
 	U3G_DEV(HUAWEI, MOBILE, U3GINIT_HUAWEI),
+	U3G_DEV(HUAWEI, E1752, U3GINIT_HUAWEISCSI),
 	U3G_DEV(KYOCERA2, CDMA_MSM_K, 0),
 	U3G_DEV(KYOCERA2, KPC680, 0),
 	U3G_DEV(MERLIN, V620, 0),
@@ -649,6 +651,9 @@ u3g_test_autoinst(void *arg, struct usb_
 		case U3GINIT_HUAWEI:
 			error = u3g_huawei_init(udev);
 			break;
+		case U3GINIT_HUAWEISCSI:
+			error = usb_msc_eject(udev, 0, MSC_EJECT_HUAWEI);
+			break;
 		case U3GINIT_SCSIEJECT:
 			error = usb_msc_eject(udev, 0, MSC_EJECT_STOPUNIT);
 			break;

Modified: stable/8/sys/dev/usb/usb_msctest.c
==============================================================================
--- stable/8/sys/dev/usb/usb_msctest.c	Tue Apr  6 23:22:19 2010	(r206305)
+++ stable/8/sys/dev/usb/usb_msctest.c	Tue Apr  6 23:22:47 2010	(r206306)
@@ -94,6 +94,9 @@ static uint8_t scsi_ztestor_eject[] =   
 					  0x01, 0x01, 0x01, 0x01, 0x00, 0x00 };
 static uint8_t scsi_cmotech_eject[] =   { 0xff, 0x52, 0x44, 0x45, 0x56, 0x43,
 					  0x48, 0x47 };
+static uint8_t scsi_huawei_eject[] =	{ 0x11, 0x06, 0x00, 0x00, 0x00, 0x00,
+					  0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+					  0x00, 0x00, 0x00, 0x00 };
 
 #define	BULK_SIZE		64	/* dummy */
 #define	ERR_CSW_FAILED		-1
@@ -611,6 +614,11 @@ usb_msc_eject(struct usb_device *udev, u
 		    &scsi_cmotech_eject, sizeof(scsi_cmotech_eject),
 		    USB_MS_HZ);
 		break;
+	case MSC_EJECT_HUAWEI:
+		err = bbb_command_start(sc, DIR_IN, 0, NULL, 0,
+		    &scsi_huawei_eject, sizeof(scsi_huawei_eject),
+		    USB_MS_HZ);
+		break;
 	default:
 		printf("usb_msc_eject: unknown eject method (%d)\n", method);
 		break;

Modified: stable/8/sys/dev/usb/usb_msctest.h
==============================================================================
--- stable/8/sys/dev/usb/usb_msctest.h	Tue Apr  6 23:22:19 2010	(r206305)
+++ stable/8/sys/dev/usb/usb_msctest.h	Tue Apr  6 23:22:47 2010	(r206306)
@@ -31,7 +31,8 @@ enum {
 	MSC_EJECT_STOPUNIT,
 	MSC_EJECT_REZERO,
 	MSC_EJECT_ZTESTOR,
-	MSC_EJECT_CMOTECH
+	MSC_EJECT_CMOTECH,
+	MSC_EJECT_HUAWEI,
 };
 
 int usb_iface_is_cdrom(struct usb_device *udev,

Modified: stable/8/sys/dev/usb/usbdevs
==============================================================================
--- stable/8/sys/dev/usb/usbdevs	Tue Apr  6 23:22:19 2010	(r206305)
+++ stable/8/sys/dev/usb/usbdevs	Tue Apr  6 23:22:47 2010	(r206306)
@@ -1723,6 +1723,7 @@ product HUAWEI E143C		0x143c	3G modem
 product HUAWEI E143D		0x143d	3G modem
 product HUAWEI E143E		0x143e	3G modem
 product HUAWEI E143F		0x143f	3G modem
+product HUAWEI E1752		0x1446	3G modem
 product HUAWEI E14AC		0x14ac	3G modem
 
 /* HUAWEI 3com products */

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Apr  6 23:23:20 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 20E061065702;
	Tue,  6 Apr 2010 23:23:20 +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 E736F8FC16;
	Tue,  6 Apr 2010 23:23:19 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o36NNJ2N012554;
	Tue, 6 Apr 2010 23:23:19 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o36NNJI4012551;
	Tue, 6 Apr 2010 23:23:19 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <201004062323.o36NNJI4012551@svn.freebsd.org>
From: Andrew Thompson 
Date: Tue, 6 Apr 2010 23:23:19 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206307 - in stable/8/sys/dev/usb: . serial
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 06 Apr 2010 23:23:20 -0000

Author: thompsa
Date: Tue Apr  6 23:23:19 2010
New Revision: 206307
URL: http://svn.freebsd.org/changeset/base/206307

Log:
  MFC r203906
  
   Add device ID for the FTDI 4232H.
  
  PR:		usb/143832
  Submitted by:	UEMURA Tetsuya

Modified:
  stable/8/sys/dev/usb/serial/uftdi.c
  stable/8/sys/dev/usb/usbdevs
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/usb/serial/uftdi.c
==============================================================================
--- stable/8/sys/dev/usb/serial/uftdi.c	Tue Apr  6 23:22:47 2010	(r206306)
+++ stable/8/sys/dev/usb/serial/uftdi.c	Tue Apr  6 23:23:19 2010	(r206307)
@@ -224,6 +224,7 @@ static struct usb_device_id uftdi_devs[]
 	UFTDI_DEV(FTDI, SERIAL_8U100AX, SIO),
 	UFTDI_DEV(FTDI, SERIAL_2232C, 8U232AM),
 	UFTDI_DEV(FTDI, SERIAL_2232D, 8U232AM),
+	UFTDI_DEV(FTDI, SERIAL_4232H, 8U232AM),
 	UFTDI_DEV(FTDI, SERIAL_8U232AM, 8U232AM),
 	UFTDI_DEV(FTDI, SERIAL_8U232AM4, 8U232AM),
 	UFTDI_DEV(FTDI, SEMC_DSS20, 8U232AM),

Modified: stable/8/sys/dev/usb/usbdevs
==============================================================================
--- stable/8/sys/dev/usb/usbdevs	Tue Apr  6 23:22:47 2010	(r206306)
+++ stable/8/sys/dev/usb/usbdevs	Tue Apr  6 23:23:19 2010	(r206307)
@@ -1472,6 +1472,7 @@ product FTDI SERIAL_8U232AM	0x6001	8U232
 product FTDI SERIAL_8U232AM4	0x6004	8U232AM Serial
 product FTDI SERIAL_2232C	0x6010	FT2232C Dual port Serial
 product FTDI SERIAL_2232D	0x9e90	FT2232D Dual port Serial
+product FTDI SERIAL_4232H	0x6011	FT4232H Quad port Serial
 /* Gude Analog- und Digitalsysteme products also uses FTDI's id: */
 product FTDI TACTRIX_OPENPORT_13M 0xcc48 OpenPort 1.3 Mitsubishi
 product FTDI TACTRIX_OPENPORT_13S 0xcc49 OpenPort 1.3 Subaru

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Apr  6 23:23:45 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 632F01065672;
	Tue,  6 Apr 2010 23:23:43 +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 4EF478FC27;
	Tue,  6 Apr 2010 23:23:43 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o36NNh9A012689;
	Tue, 6 Apr 2010 23:23:43 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o36NNh1t012687;
	Tue, 6 Apr 2010 23:23:43 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <201004062323.o36NNh1t012687@svn.freebsd.org>
From: Andrew Thompson 
Date: Tue, 6 Apr 2010 23:23:43 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206308 - stable/8/sys/dev/usb/controller
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 06 Apr 2010 23:23:45 -0000

Author: thompsa
Date: Tue Apr  6 23:23:43 2010
New Revision: 206308
URL: http://svn.freebsd.org/changeset/base/206308

Log:
  MFC r205005
  
   Wrap the proc wakeup special case for ddb in ifdef DDB.
  
  Submitted by:	Giovanni Trematerra

Modified:
  stable/8/sys/dev/usb/controller/usb_controller.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/usb/controller/usb_controller.c
==============================================================================
--- stable/8/sys/dev/usb/controller/usb_controller.c	Tue Apr  6 23:23:19 2010	(r206307)
+++ stable/8/sys/dev/usb/controller/usb_controller.c	Tue Apr  6 23:23:43 2010	(r206308)
@@ -24,6 +24,8 @@
  * SUCH DAMAGE.
  */
 
+#include "opt_ddb.h"
+
 #include 
 #include 
 #include 
@@ -220,6 +222,7 @@ usb_bus_explore(struct usb_proc_msg *pm)
 			bus->driver_added_refcount = 1;
 		}
 
+#ifdef DDB
 		/*
 		 * The following three lines of code are only here to
 		 * recover from DDB:
@@ -227,6 +230,7 @@ usb_bus_explore(struct usb_proc_msg *pm)
 		usb_proc_rewakeup(&bus->control_xfer_proc);
 		usb_proc_rewakeup(&bus->giant_callback_proc);
 		usb_proc_rewakeup(&bus->non_giant_callback_proc);
+#endif
 
 		USB_BUS_UNLOCK(bus);
 
@@ -289,11 +293,13 @@ usb_power_wdog(void *arg)
 	usb_callout_reset(&bus->power_wdog,
 	    4 * hz, usb_power_wdog, arg);
 
+#ifdef DDB
 	/*
 	 * The following line of code is only here to recover from
 	 * DDB:
 	 */
 	usb_proc_rewakeup(&bus->explore_proc);	/* recover from DDB */
+#endif
 
 	USB_BUS_UNLOCK(bus);
 

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Apr  6 23:24:07 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B126F106566C;
	Tue,  6 Apr 2010 23:24:07 +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 9E0DB8FC21;
	Tue,  6 Apr 2010 23:24:07 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o36NO71l012861;
	Tue, 6 Apr 2010 23:24:07 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o36NO7dI012859;
	Tue, 6 Apr 2010 23:24:07 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <201004062324.o36NO7dI012859@svn.freebsd.org>
From: Andrew Thompson 
Date: Tue, 6 Apr 2010 23:24:07 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206309 - stable/8/sys/dev/usb
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 06 Apr 2010 23:24:07 -0000

Author: thompsa
Date: Tue Apr  6 23:24:07 2010
New Revision: 206309
URL: http://svn.freebsd.org/changeset/base/206309

Log:
  MFC r205026
  
   Reapply r185998 which was overwritten at some point.

Modified:
  stable/8/sys/dev/usb/usbdevs
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/usb/usbdevs
==============================================================================
--- stable/8/sys/dev/usb/usbdevs	Tue Apr  6 23:23:43 2010	(r206308)
+++ stable/8/sys/dev/usb/usbdevs	Tue Apr  6 23:24:07 2010	(r206309)
@@ -2010,9 +2010,6 @@ product MSI RT3070_7		0x899a	RT3070
 product MSI RT2573_3		0xa861	RT2573
 product MSI RT2573_4		0xa874	RT2573
 
-/* Microdia products */
-product MICRODIA TWINKLECAM	0x600d	TwinkleCam USB camera
-
 /* Microsoft products */
 product MICROSOFT SIDEPREC	0x0008	SideWinder Precision Pro
 product MICROSOFT INTELLIMOUSE	0x0009	IntelliMouse

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Apr  6 23:24:29 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id F0FD61065670;
	Tue,  6 Apr 2010 23:24:29 +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 DD68D8FC1E;
	Tue,  6 Apr 2010 23:24:29 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o36NOTLt013027;
	Tue, 6 Apr 2010 23:24:29 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o36NOToi013025;
	Tue, 6 Apr 2010 23:24:29 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <201004062324.o36NOToi013025@svn.freebsd.org>
From: Andrew Thompson 
Date: Tue, 6 Apr 2010 23:24:29 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206310 - stable/8/sys/dev/usb/serial
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 06 Apr 2010 23:24:30 -0000

Author: thompsa
Date: Tue Apr  6 23:24:29 2010
New Revision: 206310
URL: http://svn.freebsd.org/changeset/base/206310

Log:
  MFC r205029
  
   Use wMaxPacketSize for the uftdi input buffer size.
  
  Submitted by:	Hans Petter Selasky

Modified:
  stable/8/sys/dev/usb/serial/uftdi.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/usb/serial/uftdi.c
==============================================================================
--- stable/8/sys/dev/usb/serial/uftdi.c	Tue Apr  6 23:24:07 2010	(r206309)
+++ stable/8/sys/dev/usb/serial/uftdi.c	Tue Apr  6 23:24:29 2010	(r206310)
@@ -91,8 +91,6 @@ SYSCTL_INT(_hw_usb_uftdi, OID_AUTO, debu
 #define	UFTDI_CONFIG_INDEX	0
 #define	UFTDI_IFACE_INDEX	0
 
-#define	UFTDI_IBUFSIZE 64		/* bytes, maximum number of bytes per
-					 * frame */
 #define	UFTDI_OBUFSIZE 64		/* bytes, cannot be increased due to
 					 * do size encoding */
 
@@ -173,7 +171,7 @@ static const struct usb_config uftdi_con
 		.type = UE_BULK,
 		.endpoint = UE_ADDR_ANY,
 		.direction = UE_DIR_IN,
-		.bufsize = UFTDI_IBUFSIZE,
+		.bufsize = 0,		/* use wMaxPacketSize */
 		.flags = {.pipe_bof = 1,.short_xfer_ok = 1,},
 		.callback = &uftdi_read_callback,
 	},

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Apr  6 23:24:56 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 14DF41065675;
	Tue,  6 Apr 2010 23:24:56 +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 A4C7F8FC26;
	Tue,  6 Apr 2010 23:24:55 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o36NOttp013171;
	Tue, 6 Apr 2010 23:24:55 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o36NOt4b013166;
	Tue, 6 Apr 2010 23:24:55 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <201004062324.o36NOt4b013166@svn.freebsd.org>
From: Andrew Thompson 
Date: Tue, 6 Apr 2010 23:24:55 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206311 - stable/8/sys/dev/usb/template
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 06 Apr 2010 23:24:56 -0000

Author: thompsa
Date: Tue Apr  6 23:24:55 2010
New Revision: 206311
URL: http://svn.freebsd.org/changeset/base/206311

Log:
  MFC r205030
  
   - make the usb_temp_setup() and usb_temp_unsetup() functions public so that
     other modules can generate USB descriptors.
   - extend the vendor specific request function by one length pointer argument,
     because not all descriptors store the length in the first byte. For example
     HID descriptors.
  
  Submitted by:	Hans Petter Selasky

Modified:
  stable/8/sys/dev/usb/template/usb_template.c
  stable/8/sys/dev/usb/template/usb_template.h
  stable/8/sys/dev/usb/template/usb_template_mtp.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/usb/template/usb_template.c
==============================================================================
--- stable/8/sys/dev/usb/template/usb_template.c	Tue Apr  6 23:24:29 2010	(r206310)
+++ stable/8/sys/dev/usb/template/usb_template.c	Tue Apr  6 23:24:55 2010	(r206311)
@@ -98,13 +98,10 @@ static void	*usb_temp_get_config_desc(st
 static const void *usb_temp_get_string_desc(struct usb_device *, uint16_t,
 		    uint8_t);
 static const void *usb_temp_get_vendor_desc(struct usb_device *,
-		    const struct usb_device_request *);
+		    const struct usb_device_request *, uint16_t *plen);
 static const void *usb_temp_get_hub_desc(struct usb_device *);
 static usb_error_t usb_temp_get_desc(struct usb_device *,
 		    struct usb_device_request *, const void **, uint16_t *);
-static usb_error_t usb_temp_setup(struct usb_device *,
-		    const struct usb_temp_device_desc *);
-static void	usb_temp_unsetup(struct usb_device *);
 static usb_error_t usb_temp_setup_by_index(struct usb_device *,
 		    uint16_t index);
 static void	usb_temp_init(void *);
@@ -1035,7 +1032,7 @@ usb_temp_get_config_desc(struct usb_devi
  *------------------------------------------------------------------------*/
 static const void *
 usb_temp_get_vendor_desc(struct usb_device *udev,
-    const struct usb_device_request *req)
+    const struct usb_device_request *req, uint16_t *plen)
 {
 	const struct usb_temp_device_desc *tdd;
 
@@ -1046,7 +1043,7 @@ usb_temp_get_vendor_desc(struct usb_devi
 	if (tdd->getVendorDesc == NULL) {
 		return (NULL);
 	}
-	return ((tdd->getVendorDesc) (req));
+	return ((tdd->getVendorDesc) (req, plen));
 }
 
 /*------------------------------------------------------------------------*
@@ -1109,7 +1106,6 @@ usb_temp_get_desc(struct usb_device *ude
 		default:
 			goto tr_stalled;
 		}
-		break;
 	case UT_READ_CLASS_DEVICE:
 		switch (req->bRequest) {
 		case UR_GET_DESCRIPTOR:
@@ -1117,11 +1113,6 @@ usb_temp_get_desc(struct usb_device *ude
 		default:
 			goto tr_stalled;
 		}
-		break;
-	case UT_READ_VENDOR_DEVICE:
-	case UT_READ_VENDOR_OTHER:
-		buf = usb_temp_get_vendor_desc(udev, req);
-		goto tr_valid;
 	default:
 		goto tr_stalled;
 	}
@@ -1158,7 +1149,6 @@ tr_handle_get_descriptor:
 	default:
 		goto tr_stalled;
 	}
-	goto tr_stalled;
 
 tr_handle_get_class_descriptor:
 	if (req->wValue[0]) {
@@ -1168,17 +1158,20 @@ tr_handle_get_class_descriptor:
 	goto tr_valid;
 
 tr_valid:
-	if (buf == NULL) {
+	if (buf == NULL)
 		goto tr_stalled;
-	}
-	if (len == 0) {
+	if (len == 0)
 		len = buf[0];
-	}
 	*pPtr = buf;
 	*pLength = len;
 	return (0);	/* success */
 
 tr_stalled:
+	/* try to get a vendor specific descriptor */
+	len = 0;
+	buf = usb_temp_get_vendor_desc(udev, req, &len);
+	if (buf != NULL)
+		goto tr_valid;
 	*pPtr = NULL;
 	*pLength = 0;
 	return (0);	/* we ignore failures */
@@ -1195,7 +1188,7 @@ tr_stalled:
  *    0: Success
  * Else: Failure
  *------------------------------------------------------------------------*/
-static usb_error_t
+usb_error_t
 usb_temp_setup(struct usb_device *udev,
     const struct usb_temp_device_desc *tdd)
 {
@@ -1285,7 +1278,7 @@ error:
  * This function frees any memory associated with the currently
  * setup template, if any.
  *------------------------------------------------------------------------*/
-static void
+void
 usb_temp_unsetup(struct usb_device *udev)
 {
 	if (udev->usb_template_ptr) {

Modified: stable/8/sys/dev/usb/template/usb_template.h
==============================================================================
--- stable/8/sys/dev/usb/template/usb_template.h	Tue Apr  6 23:24:29 2010	(r206310)
+++ stable/8/sys/dev/usb/template/usb_template.h	Tue Apr  6 23:24:55 2010	(r206311)
@@ -31,7 +31,7 @@
 #define	_USB_TEMPLATE_H_
 
 typedef const void *(usb_temp_get_string_desc_t)(uint16_t lang_id, uint8_t string_index);
-typedef const void *(usb_temp_get_vendor_desc_t)(const struct usb_device_request *req);
+typedef const void *(usb_temp_get_vendor_desc_t)(const struct usb_device_request *req, uint16_t *plen);
 
 struct usb_temp_packet_size {
 	uint16_t mps[USB_SPEED_MAX];
@@ -98,5 +98,8 @@ extern const struct usb_temp_device_desc
 extern const struct usb_temp_device_desc usb_template_msc;	/* Mass Storage Class */
 extern const struct usb_temp_device_desc usb_template_mtp;	/* Message Transfer
 								 * Protocol */
+usb_error_t	usb_temp_setup(struct usb_device *,
+		    const struct usb_temp_device_desc *);
+void	usb_temp_unsetup(struct usb_device *);
 
 #endif					/* _USB_TEMPLATE_H_ */

Modified: stable/8/sys/dev/usb/template/usb_template_mtp.c
==============================================================================
--- stable/8/sys/dev/usb/template/usb_template_mtp.c	Tue Apr  6 23:24:29 2010	(r206310)
+++ stable/8/sys/dev/usb/template/usb_template_mtp.c	Tue Apr  6 23:24:55 2010	(r206311)
@@ -211,7 +211,7 @@ const struct usb_temp_device_desc usb_te
  * Else: Success. Pointer to vendor descriptor is returned.
  *------------------------------------------------------------------------*/
 static const void *
-mtp_get_vendor_desc(const struct usb_device_request *req)
+mtp_get_vendor_desc(const struct usb_device_request *req, uint16_t *plen)
 {
 	static const uint8_t dummy_desc[0x28] = {
 		0x28, 0, 0, 0, 0, 1, 4, 0,

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Apr  6 23:25:20 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 475761065703;
	Tue,  6 Apr 2010 23:25:20 +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 3417F8FC1A;
	Tue,  6 Apr 2010 23:25:20 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o36NPK1x013347;
	Tue, 6 Apr 2010 23:25:20 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o36NPKg6013345;
	Tue, 6 Apr 2010 23:25:20 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <201004062325.o36NPKg6013345@svn.freebsd.org>
From: Andrew Thompson 
Date: Tue, 6 Apr 2010 23:25:20 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206312 - stable/8/sys/dev/usb/serial
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 06 Apr 2010 23:25:20 -0000

Author: thompsa
Date: Tue Apr  6 23:25:19 2010
New Revision: 206312
URL: http://svn.freebsd.org/changeset/base/206312

Log:
  MFC r205031
  
   It appears that some UVISOR devices do not handle when the clear stall command
   is issued at the beginning of the initial IN/OUT data transfers.  Reason
   unknown, probably firmware fault. Now the stall is only cleared on data
   transfer errors.
  
  PR:		usb/144199
  Submitted by:	Hans Petter Selasky

Modified:
  stable/8/sys/dev/usb/serial/uvisor.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/usb/serial/uvisor.c
==============================================================================
--- stable/8/sys/dev/usb/serial/uvisor.c	Tue Apr  6 23:24:55 2010	(r206311)
+++ stable/8/sys/dev/usb/serial/uvisor.c	Tue Apr  6 23:25:19 2010	(r206312)
@@ -345,11 +345,6 @@ uvisor_attach(device_t dev)
 		DPRINTF("could not allocate all pipes\n");
 		goto detach;
 	}
-	/* clear stall at first run */
-	mtx_lock(&sc->sc_mtx);
-	usbd_xfer_set_stall(sc->sc_xfer[UVISOR_BULK_DT_WR]);
-	usbd_xfer_set_stall(sc->sc_xfer[UVISOR_BULK_DT_RD]);
-	mtx_unlock(&sc->sc_mtx);
 
 	error = ucom_attach(&sc->sc_super_ucom, &sc->sc_ucom, 1, sc,
 	    &uvisor_callback, &sc->sc_mtx);

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Apr  6 23:25:53 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DCAE71065672;
	Tue,  6 Apr 2010 23:25: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 B0BAA8FC22;
	Tue,  6 Apr 2010 23:25:53 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o36NPrvq013558;
	Tue, 6 Apr 2010 23:25:53 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o36NPrlt013555;
	Tue, 6 Apr 2010 23:25:53 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <201004062325.o36NPrlt013555@svn.freebsd.org>
From: Andrew Thompson 
Date: Tue, 6 Apr 2010 23:25:53 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206313 - in stable/8/sys/dev/usb: . serial
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 06 Apr 2010 23:25:54 -0000

Author: thompsa
Date: Tue Apr  6 23:25:53 2010
New Revision: 206313
URL: http://svn.freebsd.org/changeset/base/206313

Log:
  MFC r205032
  
   Add new uvisor(4) device ID.
  
  PR:		usb/144201

Modified:
  stable/8/sys/dev/usb/serial/uvisor.c
  stable/8/sys/dev/usb/usbdevs
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/usb/serial/uvisor.c
==============================================================================
--- stable/8/sys/dev/usb/serial/uvisor.c	Tue Apr  6 23:25:19 2010	(r206312)
+++ stable/8/sys/dev/usb/serial/uvisor.c	Tue Apr  6 23:25:53 2010	(r206313)
@@ -263,6 +263,7 @@ MODULE_DEPEND(uvisor, usb, 1, 1, 1);
 static const struct usb_device_id uvisor_devs[] = {
 #define	UVISOR_DEV(v,p,i) { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, i) }
 	UVISOR_DEV(ACEECA, MEZ1000, UVISOR_FLAG_PALM4),
+	UVISOR_DEV(ALPHASMART, DANA_SYNC, UVISOR_FLAG_PALM4),
 	UVISOR_DEV(GARMIN, IQUE_3600, UVISOR_FLAG_PALM4),
 	UVISOR_DEV(FOSSIL, WRISTPDA, UVISOR_FLAG_PALM4),
 	UVISOR_DEV(HANDSPRING, VISOR, UVISOR_FLAG_VISOR),

Modified: stable/8/sys/dev/usb/usbdevs
==============================================================================
--- stable/8/sys/dev/usb/usbdevs	Tue Apr  6 23:25:19 2010	(r206312)
+++ stable/8/sys/dev/usb/usbdevs	Tue Apr  6 23:25:53 2010	(r206313)
@@ -407,6 +407,7 @@ vendor STSN		0x07ef	STSN
 vendor CENTURY		0x07f7	Century Corp
 vendor ZOOM		0x0803	Zoom Telephonics
 vendor PCS		0x0810	Personal Communication Systems
+vendor ALPHASMART	0x081e	AlphaSmart, Inc.
 vendor BROADLOGIC	0x0827	BroadLogic
 vendor HANDSPRING	0x082d	Handspring
 vendor PALM		0x0830	Palm Computing
@@ -892,6 +893,10 @@ product ALTEC ASC495		0xff05	ASC495 Spea
 /* Allied Telesyn International products */
 product ALLIEDTELESYN ATUSB100	0xb100	AT-USB100
 
+/* AlphaSmart, Inc. products */
+product ALPHASMART DANA_KB	0xdbac	AlphaSmart Dana Keyboard
+product ALPHASMART DANA_SYNC	0xdf00	AlphaSmart Dana HotSync
+
 /* Amoi products */
 product AMOI H01		0x0800	H01 3G modem
 product AMOI H01A		0x7002	H01A 3G modem

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Apr  6 23:26:17 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AA7581065697;
	Tue,  6 Apr 2010 23:26:17 +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 7CBC28FC2C;
	Tue,  6 Apr 2010 23:26:17 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o36NQHGn013731;
	Tue, 6 Apr 2010 23:26:17 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o36NQH9E013729;
	Tue, 6 Apr 2010 23:26:17 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <201004062326.o36NQH9E013729@svn.freebsd.org>
From: Andrew Thompson 
Date: Tue, 6 Apr 2010 23:26:17 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206314 - stable/8/sys/dev/usb/template
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 06 Apr 2010 23:26:17 -0000

Author: thompsa
Date: Tue Apr  6 23:26:17 2010
New Revision: 206314
URL: http://svn.freebsd.org/changeset/base/206314

Log:
  MFC r205033
  
   isochronous endpoint descriptors should have two more bytes which are zero by
   default.
  
  Submitted by:	Hans Petter Selasky

Modified:
  stable/8/sys/dev/usb/template/usb_template.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/usb/template/usb_template.c
==============================================================================
--- stable/8/sys/dev/usb/template/usb_template.c	Tue Apr  6 23:25:53 2010	(r206313)
+++ stable/8/sys/dev/usb/template/usb_template.c	Tue Apr  6 23:26:17 2010	(r206314)
@@ -162,15 +162,23 @@ usb_make_endpoint_desc(struct usb_temp_s
 	const void **rd;
 	uint16_t old_size;
 	uint16_t mps;
-	uint8_t ea = 0;			/* Endpoint Address */
-	uint8_t et = 0;			/* Endpiont Type */
+	uint8_t ea;			/* Endpoint Address */
+	uint8_t et;			/* Endpiont Type */
 
 	/* Reserve memory */
 	old_size = temp->size;
-	temp->size += sizeof(*ed);
 
-	/* Scan all Raw Descriptors first */
+	ea = (ted->bEndpointAddress & (UE_ADDR | UE_DIR_IN | UE_DIR_OUT));
+	et = (ted->bmAttributes & UE_XFERTYPE);
+
+	if (et == UE_ISOCHRONOUS) {
+		/* account for extra byte fields */
+		temp->size += sizeof(*ed) + 2;
+	} else {
+		temp->size += sizeof(*ed);
+	}
 
+	/* Scan all Raw Descriptors first */
 	rd = ted->ppRawDesc;
 	if (rd) {
 		while (*rd) {
@@ -192,8 +200,6 @@ usb_make_endpoint_desc(struct usb_temp_s
 		/* escape for Zero Max Packet Size */
 		mps = 0;
 	}
-	ea = (ted->bEndpointAddress & (UE_ADDR | UE_DIR_IN | UE_DIR_OUT));
-	et = (ted->bmAttributes & UE_XFERTYPE);
 
 	/*
 	 * Fill out the real USB endpoint descriptor
@@ -201,7 +207,10 @@ usb_make_endpoint_desc(struct usb_temp_s
 	 */
 	if (temp->buf) {
 		ed = USB_ADD_BYTES(temp->buf, old_size);
-		ed->bLength = sizeof(*ed);
+		if (et == UE_ISOCHRONOUS)
+			ed->bLength = sizeof(*ed) + 2;
+		else
+			ed->bLength = sizeof(*ed);
 		ed->bDescriptorType = UDESC_ENDPOINT;
 		ed->bEndpointAddress = ea;
 		ed->bmAttributes = ted->bmAttributes;

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Apr  6 23:26:40 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A698C1065690;
	Tue,  6 Apr 2010 23:26: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 929D28FC19;
	Tue,  6 Apr 2010 23:26:40 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o36NQejb013867;
	Tue, 6 Apr 2010 23:26:40 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o36NQeuM013865;
	Tue, 6 Apr 2010 23:26:40 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <201004062326.o36NQeuM013865@svn.freebsd.org>
From: Andrew Thompson 
Date: Tue, 6 Apr 2010 23:26:40 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206315 - stable/8/sys/dev/usb/controller
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 06 Apr 2010 23:26:40 -0000

Author: thompsa
Date: Tue Apr  6 23:26:40 2010
New Revision: 206315
URL: http://svn.freebsd.org/changeset/base/206315

Log:
  MFC r205034
  
   For USS820 driver we need to manually reset TX FIFO at each SETUP transaction
   because the chip doesn't do this by itself.
  
  Submitted by:	Hans Petter Selasky

Modified:
  stable/8/sys/dev/usb/controller/uss820dci.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/usb/controller/uss820dci.c
==============================================================================
--- stable/8/sys/dev/usb/controller/uss820dci.c	Tue Apr  6 23:26:17 2010	(r206314)
+++ stable/8/sys/dev/usb/controller/uss820dci.c	Tue Apr  6 23:26:40 2010	(r206315)
@@ -333,6 +333,14 @@ uss820dci_setup_rx(struct uss820dci_td *
 	} else {
 		sc->sc_dv_addr = 0xFF;
 	}
+
+	/* reset TX FIFO */
+	temp = USS820_READ_1(sc, USS820_TXCON);
+	temp |= USS820_TXCON_TXCLR;
+	USS820_WRITE_1(sc, USS820_TXCON, temp);
+	temp &= ~USS820_TXCON_TXCLR;
+	USS820_WRITE_1(sc, USS820_TXCON, temp);
+
 	return (0);			/* complete */
 
 setup_not_complete:

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Apr  6 23:27:05 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6E482106567D;
	Tue,  6 Apr 2010 23:27:05 +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 411848FC12;
	Tue,  6 Apr 2010 23:27:05 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o36NR5Fo014038;
	Tue, 6 Apr 2010 23:27:05 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o36NR5lk014036;
	Tue, 6 Apr 2010 23:27:05 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <201004062327.o36NR5lk014036@svn.freebsd.org>
From: Andrew Thompson 
Date: Tue, 6 Apr 2010 23:27:05 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206316 - stable/8/sys/dev/usb
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 06 Apr 2010 23:27:05 -0000

Author: thompsa
Date: Tue Apr  6 23:27:04 2010
New Revision: 206316
URL: http://svn.freebsd.org/changeset/base/206316

Log:
  MFC r205035
  
   Make sure there is a way to reset the endpoint FIFO on transfer errors for
   ISOCHRONOUS transfers
  
  Submitted by:	Hans Petter Selasky

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

Modified: stable/8/sys/dev/usb/usb_transfer.c
==============================================================================
--- stable/8/sys/dev/usb/usb_transfer.c	Tue Apr  6 23:26:40 2010	(r206315)
+++ stable/8/sys/dev/usb/usb_transfer.c	Tue Apr  6 23:27:04 2010	(r206316)
@@ -2410,21 +2410,24 @@ usbd_pipe_start(struct usb_xfer_queue *p
 	 * Check if we are supposed to stall the endpoint:
 	 */
 	if (xfer->flags.stall_pipe) {
+		struct usb_device *udev;
+		struct usb_xfer_root *info;
+
 		/* clear stall command */
 		xfer->flags.stall_pipe = 0;
 
+		/* get pointer to USB device */
+		info = xfer->xroot;
+		udev = info->udev;
+
 		/*
 		 * Only stall BULK and INTERRUPT endpoints.
 		 */
 		type = (ep->edesc->bmAttributes & UE_XFERTYPE);
 		if ((type == UE_BULK) ||
 		    (type == UE_INTERRUPT)) {
-			struct usb_device *udev;
-			struct usb_xfer_root *info;
 			uint8_t did_stall;
 
-			info = xfer->xroot;
-			udev = info->udev;
 			did_stall = 1;
 
 			if (udev->flags.usb_mode == USB_MODE_DEVICE) {
@@ -2452,6 +2455,17 @@ usbd_pipe_start(struct usb_xfer_queue *p
 				ep->is_stalled = 1;
 				return;
 			}
+		} else if (type == UE_ISOCHRONOUS) {
+
+			/* 
+			 * Make sure any FIFO overflow or other FIFO
+			 * error conditions go away by resetting the
+			 * endpoint FIFO through the clear stall
+			 * method.
+			 */
+			if (udev->flags.usb_mode == USB_MODE_DEVICE) {
+				(udev->bus->methods->clear_stall) (udev, ep);
+			}
 		}
 	}
 	/* Set or clear stall complete - special case */

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Apr  6 23:27:31 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 61AFE1065673;
	Tue,  6 Apr 2010 23:27:31 +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 4E3B08FC20;
	Tue,  6 Apr 2010 23:27:31 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o36NRV1j014209;
	Tue, 6 Apr 2010 23:27:31 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o36NRVTt014207;
	Tue, 6 Apr 2010 23:27:31 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <201004062327.o36NRVTt014207@svn.freebsd.org>
From: Andrew Thompson 
Date: Tue, 6 Apr 2010 23:27:31 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206317 - stable/8/sys/dev/usb
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 06 Apr 2010 23:27:31 -0000

Author: thompsa
Date: Tue Apr  6 23:27:31 2010
New Revision: 206317
URL: http://svn.freebsd.org/changeset/base/206317

Log:
  MFC r205038
  
   add new vendor ID for APACER
  
  Submitted by:	Paul B Mahol

Modified:
  stable/8/sys/dev/usb/usbdevs
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/usb/usbdevs
==============================================================================
--- stable/8/sys/dev/usb/usbdevs	Tue Apr  6 23:27:04 2010	(r206316)
+++ stable/8/sys/dev/usb/usbdevs	Tue Apr  6 23:27:31 2010	(r206317)
@@ -545,6 +545,7 @@ vendor FALCOM		0x0f94	Falcom Wireless Co
 vendor RIM		0x0fca	Research In Motion
 vendor DYNASTREAM	0x0fcf	Dynastream Innovations
 vendor QUALCOMM		0x1004	Qualcomm
+vendor APACER		0x1005	Apacer
 vendor DESKNOTE		0x1019	Desknote
 vendor GIGABYTE		0x1044	GIGABYTE
 vendor WESTERN		0x1058	Western Digital

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Apr  6 23:27:55 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B13321065678;
	Tue,  6 Apr 2010 23:27: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 9E3668FC22;
	Tue,  6 Apr 2010 23:27:55 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o36NRt0d014345;
	Tue, 6 Apr 2010 23:27:55 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o36NRt3K014343;
	Tue, 6 Apr 2010 23:27:55 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <201004062327.o36NRt3K014343@svn.freebsd.org>
From: Andrew Thompson 
Date: Tue, 6 Apr 2010 23:27:55 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206318 - stable/8/sys/dev/usb
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 06 Apr 2010 23:27:55 -0000

Author: thompsa
Date: Tue Apr  6 23:27:55 2010
New Revision: 206318
URL: http://svn.freebsd.org/changeset/base/206318

Log:
  MFC r205039
  
   Add new device ID for the SMC 2514HUB
  
  Submitted by:	Alexander Best

Modified:
  stable/8/sys/dev/usb/usbdevs
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/usb/usbdevs
==============================================================================
--- stable/8/sys/dev/usb/usbdevs	Tue Apr  6 23:27:31 2010	(r206317)
+++ stable/8/sys/dev/usb/usbdevs	Tue Apr  6 23:27:55 2010	(r206318)
@@ -2778,6 +2778,7 @@ product SMC 2202USB		0x0200	10/100 Ether
 product SMC 2206USB		0x0201	EZ Connect USB Ethernet
 product SMC 2862WG		0xee13	EZ Connect Wireless Adapter
 product SMC2 2020HUB		0x2020	USB Hub
+product SMC2 2514HUB		0x2514	USB Hub
 product SMC3 2662WUSB		0xa002	2662W-AR Wireless
 
 /* SOHOware products */

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Apr  6 23:28:19 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 184AC106567F;
	Tue,  6 Apr 2010 23:28:19 +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 E08968FC1D;
	Tue,  6 Apr 2010 23:28:18 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o36NSI5L014519;
	Tue, 6 Apr 2010 23:28:18 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o36NSI7p014517;
	Tue, 6 Apr 2010 23:28:18 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <201004062328.o36NSI7p014517@svn.freebsd.org>
From: Andrew Thompson 
Date: Tue, 6 Apr 2010 23:28:18 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206319 - stable/8/sys/dev/usb/input
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 06 Apr 2010 23:28:19 -0000

Author: thompsa
Date: Tue Apr  6 23:28:18 2010
New Revision: 206319
URL: http://svn.freebsd.org/changeset/base/206319

Log:
  MFC r205040
  
   extend search for Apple Function Key.
  
  PR:		usb/144414
  Submitted by:	Hans Petter Selasky

Modified:
  stable/8/sys/dev/usb/input/ukbd.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/usb/input/ukbd.c
==============================================================================
--- stable/8/sys/dev/usb/input/ukbd.c	Tue Apr  6 23:27:55 2010	(r206318)
+++ stable/8/sys/dev/usb/input/ukbd.c	Tue Apr  6 23:28:18 2010	(r206319)
@@ -883,28 +883,33 @@ ukbd_attach(device_t dev)
 	err = usbd_req_get_hid_desc(uaa->device, NULL, &hid_ptr,
 	    &hid_len, M_TEMP, uaa->info.bIfaceIndex);
 	if (err == 0) {
+		uint8_t apple_keys = 0;
 		uint8_t temp_id;
 
 		/* investigate if this is an Apple Keyboard */
 		if (hid_locate(hid_ptr, hid_len,
 		    HID_USAGE2(HUP_CONSUMER, HUG_APPLE_EJECT),
 		    hid_input, 0, &sc->sc_loc_apple_eject, &flags,
-		    &sc->sc_kbd_id)) {
+		    &temp_id)) {
 			if (flags & HIO_VARIABLE)
 				sc->sc_flags |= UKBD_FLAG_APPLE_EJECT | 
 				    UKBD_FLAG_APPLE_SWAP;
-			if (hid_locate(hid_ptr, hid_len,
-			    HID_USAGE2(0xFFFF, 0x0003),
-			    hid_input, 0, &sc->sc_loc_apple_fn, &flags,
-			    &temp_id)) {
-				if (flags & HIO_VARIABLE)
-					sc->sc_flags |= UKBD_FLAG_APPLE_FN |
-					    UKBD_FLAG_APPLE_SWAP;
-				if (temp_id != sc->sc_kbd_id) {
-					DPRINTF("HID IDs mismatch\n");
-				}
-			}
-		} else {
+			DPRINTFN(1, "Found Apple eject-key\n");
+			apple_keys = 1;
+			sc->sc_kbd_id = temp_id;
+		}
+		if (hid_locate(hid_ptr, hid_len,
+		    HID_USAGE2(0xFFFF, 0x0003),
+		    hid_input, 0, &sc->sc_loc_apple_fn, &flags,
+		    &temp_id)) {
+			if (flags & HIO_VARIABLE)
+				sc->sc_flags |= UKBD_FLAG_APPLE_FN |
+				    UKBD_FLAG_APPLE_SWAP;
+			DPRINTFN(1, "Found Apple FN-key\n");
+			apple_keys = 1;
+			sc->sc_kbd_id = temp_id;
+		}
+		if (apple_keys == 0) {
 			/* 
 			 * Assume the first HID ID contains the
 			 * keyboard data

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Apr  6 23:28:47 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 375CE106566C;
	Tue,  6 Apr 2010 23:28: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 231888FC1C;
	Tue,  6 Apr 2010 23:28:47 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o36NSlBO014695;
	Tue, 6 Apr 2010 23:28:47 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o36NSlBC014691;
	Tue, 6 Apr 2010 23:28:47 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <201004062328.o36NSlBC014691@svn.freebsd.org>
From: Andrew Thompson 
Date: Tue, 6 Apr 2010 23:28:47 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206320 - in stable/8/sys/dev/usb: . wlan
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 06 Apr 2010 23:28:47 -0000

Author: thompsa
Date: Tue Apr  6 23:28:46 2010
New Revision: 206320
URL: http://svn.freebsd.org/changeset/base/206320

Log:
  MFC r205042
  
   - Integrate latest driver code from OpenBSD
   - Drain our tasks from the ieee80211 taskqueue
   - Add more IDs
  
  Submitted by:	Akinori Furukoshi

Modified:
  stable/8/sys/dev/usb/usbdevs
  stable/8/sys/dev/usb/wlan/if_run.c
  stable/8/sys/dev/usb/wlan/if_runreg.h
  stable/8/sys/dev/usb/wlan/if_runvar.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/usb/usbdevs
==============================================================================
--- stable/8/sys/dev/usb/usbdevs	Tue Apr  6 23:28:18 2010	(r206319)
+++ stable/8/sys/dev/usb/usbdevs	Tue Apr  6 23:28:46 2010	(r206320)
@@ -277,6 +277,7 @@ vendor LACIE		0x059f	LaCie
 vendor FUJIFILM		0x05a2	Fuji Film
 vendor ARC		0x05a3	ARC
 vendor ORTEK		0x05a4	Ortek
+vendor CISCOLINKSYS3	0x05a6	Cisco-Linksys
 vendor BOSE		0x05a7	Bose
 vendor OMNIVISION	0x05a9	OmniVision
 vendor INSYSTEM		0x05ab	In-System Design
@@ -546,6 +547,7 @@ vendor RIM		0x0fca	Research In Motion
 vendor DYNASTREAM	0x0fcf	Dynastream Innovations
 vendor QUALCOMM		0x1004	Qualcomm
 vendor APACER		0x1005	Apacer
+vendor MOTOROLA4	0x100d	Motorola
 vendor DESKNOTE		0x1019	Desknote
 vendor GIGABYTE		0x1044	GIGABYTE
 vendor WESTERN		0x1058	Western Digital
@@ -642,6 +644,7 @@ vendor LINKSYS3		0x1915	Linksys
 vendor QUALCOMMINC	0x19d2	Qualcomm, Incorporated
 vendor WCH2		0x1a86	QinHeng Electronics
 vendor STELERA		0x1a8d	Stelera Wireless
+vendor OVISLINK		0x1b75	OvisLink
 vendor TCTMOBILE	0x1bbb  TCT Mobile
 vendor TELIT		0x1bc7  Telit
 vendor MPMAN		0x1cae	MpMan
@@ -683,6 +686,7 @@ vendor 3COM2		0x6891	3Com
 vendor EDIMAX		0x7392	Edimax
 vendor INTEL		0x8086	Intel
 vendor INTEL2		0x8087	Intel
+vendor ALLWIN		0x8516	ALLWIN Tech
 vendor SITECOM2		0x9016	Sitecom
 vendor MOSCHIP		0x9710	MosChip Semiconductor
 vendor MARVELL		0x9e88	Marvell Technology Group Ltd.
@@ -762,6 +766,7 @@ product	ACCTON RT3070_1		0xa701	RT3070
 product	ACCTON RT3070_2		0xa702	RT3070
 product ACCTON RT2870_1		0xb522	RT2870
 product	ACCTON RT3070_3		0xc522	RT3070
+product	ACCTON RT3070_5		0xd522	RT3070
 product ACCTON ZD1211B		0xe501	ZD1211B
 
 /* Aceeca products */
@@ -894,6 +899,15 @@ product ALTEC ASC495		0xff05	ASC495 Spea
 /* Allied Telesyn International products */
 product ALLIEDTELESYN ATUSB100	0xb100	AT-USB100
 
+/* ALLWIN Tech products */
+product ALLWIN RT2070		0x2070	RT2070
+product ALLWIN RT2770		0x2770	RT2770
+product ALLWIN RT2870		0x2870	RT2870
+product ALLWIN RT3070		0x3070	RT3070
+product ALLWIN RT3071		0x3071	RT3071
+product ALLWIN RT3072		0x3072	RT3072
+product ALLWIN RT3572		0x3572	RT3572
+
 /* AlphaSmart, Inc. products */
 product ALPHASMART DANA_KB	0xdbac	AlphaSmart Dana Keyboard
 product ALPHASMART DANA_SYNC	0xdf00	AlphaSmart Dana HotSync
@@ -996,7 +1010,8 @@ product ASUS RT2870_2		0x1732	RT2870
 product ASUS RT2870_3		0x1742	RT2870
 product ASUS RT2870_4		0x1760	RT2870
 product ASUS RT2870_5		0x1761	RT2870
-product	ASUS RT3070		0x1784	RT3070
+product	ASUS USBN13		0x1784	USB-N13
+product	ASUS RT3070_1		0x1790	RT3070
 product ASUS P535		0x420f	ASUS P535 PDA
 product	ASUS GMSC		0x422f	ASUS Generic Mass Storage
 product ASUS RT2570		0x1706	RT2500USB Wireless Adapter
@@ -1154,7 +1169,8 @@ product CISCOLINKSYS HU200TS	0x001a	HU20
 product CISCOLINKSYS WUSB54GC	0x0020	WUSB54GC
 product CISCOLINKSYS WUSB54GR	0x0023	WUSB54GR
 product CISCOLINKSYS WUSBF54G	0x0024	WUSBF54G
-product	CISCOLINKSYS2	RT3070	0x4001	RT3070
+product	CISCOLINKSYS2 RT3070	0x4001	RT3070
+product	CISCOLINKSYS3 RT3070	0x0101	RT3070
 
 /* CMOTECH products */
 product CMOTECH CNU510		0x5141	CDMA Technologies USB modem
@@ -1181,6 +1197,8 @@ product CONCEPTRONIC AR5523_2	0x7811	AR5
 product CONCEPTRONIC AR5523_2_NF	0x7812	AR5523 (no firmware)
 product CONCEPTRONIC2 C54RU	0x3c02	C54RU WLAN
 product CONCEPTRONIC2 C54RU2	0x3c22	C54RU
+product CONCEPTRONIC2 RT3070_1	0x3c08	RT3070
+product CONCEPTRONIC2 RT3070_2	0x3c11	RT3070
 product CONCEPTRONIC2 VIGORN61	0x3c25	VIGORN61
 product CONCEPTRONIC2 RT2870_1	0x3c06	RT2870
 product CONCEPTRONIC2 RT2870_2	0x3c07	RT2870
@@ -1333,12 +1351,14 @@ product DLINK2 DWA111		0x3c06	DWA-111
 product DLINK2 RT2870_1		0x3c09	RT2870
 product DLINK2 DWA110		0x3c07	DWA-110
 product DLINK2 RT3072		0x3c0a	RT3072
+product DLINK2 RT3072_1		0x3c0b	RT3072
 product DLINK2 RT3070_1		0x3c0d	RT3070
 product DLINK2 RT3070_2		0x3c0e	RT3070
 product DLINK2 RT3070_3		0x3c0f	RT3070
 product DLINK2 RT2870_2		0x3c11	RT2870
 product DLINK2 DWA130		0x3c13	DWA-130
 product DLINK2 RT3070_4		0x3c15	RT3070
+product DLINK2 RT3070_5		0x3c16	RT3070
 product DLINK3 DWM652		0x3e04	DWM-652
 
 /* DMI products */
@@ -1909,6 +1929,7 @@ product LINKSYS4 WUSB100	0x0070	WUSB100
 product LINKSYS4 WUSB600N	0x0071	WUSB600N
 product LINKSYS4 WUSB54GCV2	0x0073	WUSB54GC v2
 product LINKSYS4 WUSB54GCV3	0x0077	WUSB54GC v3
+product LINKSYS4 RT3070		0x0078	RT3070
 product LINKSYS4 WUSB600NV2	0x0079	WUSB600N v2
 
 /* Logitech products */
@@ -1982,6 +2003,8 @@ product MELCO KG54L		0x00da	WLI-U2-KG54L
 product MELCO WLIUCG300N	0x00e8	WLI-UC-G300N
 product MELCO SG54HG		0x00f4	WLI-U2-SG54HG
 product MELCO WLIUCAG300N	0x012e	WLI-UC-AG300N
+product MELCO RT2870_1		0x0148	RT2870
+product MELCO RT2870_2		0x0150	RT2870
 product MELCO WLIUCGN		0x015d	WLI-UC-GN
 
 /* Merlin products */
@@ -2002,7 +2025,9 @@ product MGE UPS2		0xffff	MGE UPS SYSTEMS
 product MSI BT_DONGLE		0x1967	Bluetooth USB dongle
 product MSI RT3070_1		0x3820	RT3070
 product MSI RT3070_2		0x3821	RT3070
+product MSI RT3070_8		0x3822	RT3070
 product MSI RT3070_3		0x3870	RT3070
+product MSI RT3070_9		0x3871	RT3070
 product MSI UB11B		0x6823	UB11B
 product MSI RT2570		0x6861	RT2570
 product MSI RT2570_2		0x6865	RT2570
@@ -2011,7 +2036,9 @@ product MSI RT2573_1		0x6874	RT2573
 product MSI RT2573_2		0x6877	RT2573
 product MSI RT3070_4		0x6899	RT3070
 product MSI RT3070_5		0x821a	RT3070
+product MSI RT3070_10		0x822a	RT3070
 product MSI RT3070_6		0x870a	RT3070
+product MSI RT3070_11		0x871a	RT3070
 product MSI RT3070_7		0x899a	RT3070
 product MSI RT2573_3		0xa861	RT2573
 product MSI RT2573_4		0xa874	RT2573
@@ -2092,6 +2119,8 @@ product MOTOROLA2 A41XV32X	0x2a22	A41x/V
 product MOTOROLA2 E398		0x4810	E398 Mobile Phone
 product MOTOROLA2 USBLAN	0x600c	USBLAN
 product MOTOROLA2 USBLAN2	0x6027	USBLAN
+product MOTOROLA4 RT2770	0x9031	RT2770
+product MOTOROLA4 RT3070	0x9032	RT3070
 
 /* MultiTech products */
 product MULTITECH ATLAS		0xf101	MT5634ZBA-USB modem
@@ -2262,6 +2291,9 @@ product OPTION MODHSXPA		0xd013	Globetro
 product OPTION ICON321		0xd031	Globetrotter HSUPA
 product OPTION ICON505		0xd055	Globetrotter iCON 505
 
+/* OvisLink product */
+product OVISLINK RT3072		0x3072	RT3072
+
 /* OQO */
 product OQO WIFI01		0x0002	model 01 WiFi interface
 product OQO BT01		0x0003	model 01 Bluetooth interface
@@ -2296,6 +2328,7 @@ product PARA RT3070		0x8888	RT3070
 product PEGATRON RT2870		0x0002	RT2870
 product PEGATRON RT3070		0x000c	RT3070
 product PEGATRON RT3070_2	0x000e	RT3070
+product PEGATRON RT3070_3	0x0010	RT3070
 
 /* Peracom products */
 product PERACOM SERIAL1		0x0001	Serial
@@ -2515,7 +2548,9 @@ product RALINK RT2870		0x2870	RT2870
 product RALINK RT3070		0x3070	RT3070
 product RALINK RT3071		0x3071	RT3071
 product RALINK RT3072		0x3072	RT3072
+product RALINK RT3370		0x3370	RT3370
 product RALINK RT3572		0x3572	RT3572
+product RALINK RT8070		0x8070	RT8070
 product RALINK RT2570_3		0x9020	RT2500USB Wireless Adapter
 product RALINK RT2573_2		0x9021	RT2501USB Wireless Adapter
 
@@ -2752,6 +2787,7 @@ product SITECOMEU RT3070_3	0x003c	RT3070
 product SITECOMEU RT3070_4	0x003d	RT3070
 product SITECOMEU RT3070	0x003e	RT3070
 product SITECOMEU WL608		0x003f	WL-608
+product SITECOMEU RT3071	0x0040	RT3071
 product SITECOMEU RT3072_1	0x0041	RT3072
 product SITECOMEU RT3072_2	0x0042	RT3072
 product SITECOMEU RT3072_3	0x0047	RT3072
@@ -2888,6 +2924,7 @@ product SURECOM RT2573		0x31f3	RT2573
 
 /* Sweex products */
 product SWEEX ZD1211		0x1809	ZD1211
+product SWEEX2 LW153		0x0153	LW153
 product SWEEX2 LW303		0x0302	LW303
 product SWEEX2 LW313		0x0313	LW313
 
@@ -2943,6 +2980,7 @@ product TOPRE HHKB		0x0100	HHKB Professi
 
 /* Toshiba Corporation products */
 product TOSHIBA POCKETPC_E740	0x0706	PocketPC e740
+product TOSHIBA RT3070		0x0a07	RT3070
 product TOSHIBA G450		0x0d45	G450 modem
 product TOSHIBA HSDPA		0x1302	G450 modem
 
@@ -3124,3 +3162,4 @@ product ZYXEL M202		0x340a	M-202
 product ZYXEL G220V2		0x340f	G-220 v2
 product ZYXEL G202		0x3410	G-202
 product ZYXEL RT2870_1		0x3416	RT2870
+product ZYXEL RT2870_2		0x341a	RT2870

Modified: stable/8/sys/dev/usb/wlan/if_run.c
==============================================================================
--- stable/8/sys/dev/usb/wlan/if_run.c	Tue Apr  6 23:28:18 2010	(r206319)
+++ stable/8/sys/dev/usb/wlan/if_run.c	Tue Apr  6 23:28:46 2010	(r206320)
@@ -1,8 +1,9 @@
 /*	$FreeBSD$	*/
 
 /*-
- * Copyright (c) 2008,2009 Damien Bergamini 
- *	ported to FreeBSD by Akinori Furukoshi 
+ * Copyright (c) 2008,2010 Damien Bergamini 
+ * ported to FreeBSD by Akinori Furukoshi 
+ * USB Consulting, Hans Petter Selasky 
  *
  * Permission to use, copy, modify, and distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above
@@ -17,8 +18,6 @@
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* release date Jan. 09, 2010 */
-
 #include 
 __FBSDID("$FreeBSD$");
 
@@ -107,11 +106,20 @@ static const struct usb_device_id run_de
     { USB_VP(USB_VENDOR_ACCTON,		USB_PRODUCT_ACCTON_RT2870_3) },
     { USB_VP(USB_VENDOR_ACCTON,		USB_PRODUCT_ACCTON_RT2870_4) },
     { USB_VP(USB_VENDOR_ACCTON,		USB_PRODUCT_ACCTON_RT2870_5) },
+    { USB_VP(USB_VENDOR_ACCTON,		USB_PRODUCT_ACCTON_RT3070) },
     { USB_VP(USB_VENDOR_ACCTON,		USB_PRODUCT_ACCTON_RT3070_1) },
     { USB_VP(USB_VENDOR_ACCTON,		USB_PRODUCT_ACCTON_RT3070_2) },
     { USB_VP(USB_VENDOR_ACCTON,		USB_PRODUCT_ACCTON_RT3070_3) },
     { USB_VP(USB_VENDOR_ACCTON,		USB_PRODUCT_ACCTON_RT3070_4) },
+    { USB_VP(USB_VENDOR_ACCTON,		USB_PRODUCT_ACCTON_RT3070_5) },
     { USB_VP(USB_VENDOR_AIRTIES,	USB_PRODUCT_AIRTIES_RT3070) },
+    { USB_VP(USB_VENDOR_ALLWIN,		USB_PRODUCT_ALLWIN_RT2070) },
+    { USB_VP(USB_VENDOR_ALLWIN,		USB_PRODUCT_ALLWIN_RT2770) },
+    { USB_VP(USB_VENDOR_ALLWIN,		USB_PRODUCT_ALLWIN_RT2870) },
+    { USB_VP(USB_VENDOR_ALLWIN,		USB_PRODUCT_ALLWIN_RT3070) },
+    { USB_VP(USB_VENDOR_ALLWIN,		USB_PRODUCT_ALLWIN_RT3071) },
+    { USB_VP(USB_VENDOR_ALLWIN,		USB_PRODUCT_ALLWIN_RT3072) },
+    { USB_VP(USB_VENDOR_ALLWIN,		USB_PRODUCT_ALLWIN_RT3572) },
     { USB_VP(USB_VENDOR_AMIGO,		USB_PRODUCT_AMIGO_RT2870_1) },
     { USB_VP(USB_VENDOR_AMIGO,		USB_PRODUCT_AMIGO_RT2870_2) },
     { USB_VP(USB_VENDOR_AMIT,		USB_PRODUCT_AMIT_CGWLUSB2GNR) },
@@ -122,6 +130,8 @@ static const struct usb_device_id run_de
     { USB_VP(USB_VENDOR_ASUS,		USB_PRODUCT_ASUS_RT2870_3) },
     { USB_VP(USB_VENDOR_ASUS,		USB_PRODUCT_ASUS_RT2870_4) },
     { USB_VP(USB_VENDOR_ASUS,		USB_PRODUCT_ASUS_RT2870_5) },
+    { USB_VP(USB_VENDOR_ASUS,		USB_PRODUCT_ASUS_USBN13) },
+    { USB_VP(USB_VENDOR_ASUS,		USB_PRODUCT_ASUS_RT3070_1) },
     { USB_VP(USB_VENDOR_ASUS2,		USB_PRODUCT_ASUS2_USBN11) },
     { USB_VP(USB_VENDOR_AZUREWAVE,	USB_PRODUCT_AZUREWAVE_RT2870_1) },
     { USB_VP(USB_VENDOR_AZUREWAVE,	USB_PRODUCT_AZUREWAVE_RT2870_2) },
@@ -133,6 +143,8 @@ static const struct usb_device_id run_de
     { USB_VP(USB_VENDOR_BELKIN,		USB_PRODUCT_BELKIN_F6D4050V1) },
     { USB_VP(USB_VENDOR_BELKIN,		USB_PRODUCT_BELKIN_RT2870_1) },
     { USB_VP(USB_VENDOR_BELKIN,		USB_PRODUCT_BELKIN_RT2870_2) },
+    { USB_VP(USB_VENDOR_CISCOLINKSYS2,	USB_PRODUCT_CISCOLINKSYS2_RT3070) },
+    { USB_VP(USB_VENDOR_CISCOLINKSYS3,	USB_PRODUCT_CISCOLINKSYS2_RT3070) },
     { USB_VP(USB_VENDOR_CONCEPTRONIC2,	USB_PRODUCT_CONCEPTRONIC2_RT2870_1) },
     { USB_VP(USB_VENDOR_CONCEPTRONIC2,	USB_PRODUCT_CONCEPTRONIC2_RT2870_2) },
     { USB_VP(USB_VENDOR_CONCEPTRONIC2,	USB_PRODUCT_CONCEPTRONIC2_RT2870_3) },
@@ -141,6 +153,8 @@ static const struct usb_device_id run_de
     { USB_VP(USB_VENDOR_CONCEPTRONIC2,	USB_PRODUCT_CONCEPTRONIC2_RT2870_6) },
     { USB_VP(USB_VENDOR_CONCEPTRONIC2,	USB_PRODUCT_CONCEPTRONIC2_RT2870_7) },
     { USB_VP(USB_VENDOR_CONCEPTRONIC2,	USB_PRODUCT_CONCEPTRONIC2_RT2870_8) },
+    { USB_VP(USB_VENDOR_CONCEPTRONIC2,	USB_PRODUCT_CONCEPTRONIC2_RT3070_1) },
+    { USB_VP(USB_VENDOR_CONCEPTRONIC2,	USB_PRODUCT_CONCEPTRONIC2_RT3070_2) },
     { USB_VP(USB_VENDOR_CONCEPTRONIC2,	USB_PRODUCT_CONCEPTRONIC2_VIGORN61) },
     { USB_VP(USB_VENDOR_COREGA,		USB_PRODUCT_COREGA_CGWLUSB300GNM) },
     { USB_VP(USB_VENDOR_COREGA,		USB_PRODUCT_COREGA_RT2870_1) },
@@ -157,7 +171,9 @@ static const struct usb_device_id run_de
     { USB_VP(USB_VENDOR_DLINK2,		USB_PRODUCT_DLINK2_RT3070_2) },
     { USB_VP(USB_VENDOR_DLINK2,		USB_PRODUCT_DLINK2_RT3070_3) },
     { USB_VP(USB_VENDOR_DLINK2,		USB_PRODUCT_DLINK2_RT3070_4) },
+    { USB_VP(USB_VENDOR_DLINK2,		USB_PRODUCT_DLINK2_RT3070_5) },
     { USB_VP(USB_VENDOR_DLINK2,		USB_PRODUCT_DLINK2_RT3072) },
+    { USB_VP(USB_VENDOR_DLINK2,		USB_PRODUCT_DLINK2_RT3072_1) },
     { USB_VP(USB_VENDOR_EDIMAX,		USB_PRODUCT_EDIMAX_EW7717) },
     { USB_VP(USB_VENDOR_EDIMAX,		USB_PRODUCT_EDIMAX_EW7718) },
     { USB_VP(USB_VENDOR_EDIMAX,		USB_PRODUCT_EDIMAX_RT2870_1) },
@@ -178,6 +194,7 @@ static const struct usb_device_id run_de
     { USB_VP(USB_VENDOR_IODATA,		USB_PRODUCT_IODATA_RT3072_2) },
     { USB_VP(USB_VENDOR_IODATA,		USB_PRODUCT_IODATA_RT3072_3) },
     { USB_VP(USB_VENDOR_IODATA,		USB_PRODUCT_IODATA_RT3072_4) },
+    { USB_VP(USB_VENDOR_LINKSYS4,	USB_PRODUCT_LINKSYS4_RT3070) },
     { USB_VP(USB_VENDOR_LINKSYS4,	USB_PRODUCT_LINKSYS4_WUSB100) },
     { USB_VP(USB_VENDOR_LINKSYS4,	USB_PRODUCT_LINKSYS4_WUSB54GCV3) },
     { USB_VP(USB_VENDOR_LINKSYS4,	USB_PRODUCT_LINKSYS4_WUSB600N) },
@@ -185,9 +202,13 @@ static const struct usb_device_id run_de
     { USB_VP(USB_VENDOR_LOGITEC,	USB_PRODUCT_LOGITEC_RT2870_1) },
     { USB_VP(USB_VENDOR_LOGITEC,	USB_PRODUCT_LOGITEC_RT2870_2) },
     { USB_VP(USB_VENDOR_LOGITEC,	USB_PRODUCT_LOGITEC_RT2870_3) },
+    { USB_VP(USB_VENDOR_MELCO,		USB_PRODUCT_MELCO_RT2870_1) },
+    { USB_VP(USB_VENDOR_MELCO,		USB_PRODUCT_MELCO_RT2870_2) },
     { USB_VP(USB_VENDOR_MELCO,		USB_PRODUCT_MELCO_WLIUCAG300N) },
     { USB_VP(USB_VENDOR_MELCO,		USB_PRODUCT_MELCO_WLIUCG300N) },
     { USB_VP(USB_VENDOR_MELCO,		USB_PRODUCT_MELCO_WLIUCGN) },
+    { USB_VP(USB_VENDOR_MOTOROLA4,	USB_PRODUCT_MOTOROLA4_RT2770) },
+    { USB_VP(USB_VENDOR_MOTOROLA4,	USB_PRODUCT_MOTOROLA4_RT3070) },
     { USB_VP(USB_VENDOR_MSI,		USB_PRODUCT_MSI_RT3070_1) },
     { USB_VP(USB_VENDOR_MSI,		USB_PRODUCT_MSI_RT3070_2) },
     { USB_VP(USB_VENDOR_MSI,		USB_PRODUCT_MSI_RT3070_3) },
@@ -195,10 +216,16 @@ static const struct usb_device_id run_de
     { USB_VP(USB_VENDOR_MSI,		USB_PRODUCT_MSI_RT3070_5) },
     { USB_VP(USB_VENDOR_MSI,		USB_PRODUCT_MSI_RT3070_6) },
     { USB_VP(USB_VENDOR_MSI,		USB_PRODUCT_MSI_RT3070_7) },
+    { USB_VP(USB_VENDOR_MSI,		USB_PRODUCT_MSI_RT3070_8) },
+    { USB_VP(USB_VENDOR_MSI,		USB_PRODUCT_MSI_RT3070_9) },
+    { USB_VP(USB_VENDOR_MSI,		USB_PRODUCT_MSI_RT3070_10) },
+    { USB_VP(USB_VENDOR_MSI,		USB_PRODUCT_MSI_RT3070_11) },
+    { USB_VP(USB_VENDOR_OVISLINK,	USB_PRODUCT_OVISLINK_RT3072) },
     { USB_VP(USB_VENDOR_PARA,		USB_PRODUCT_PARA_RT3070) },
     { USB_VP(USB_VENDOR_PEGATRON,	USB_PRODUCT_PEGATRON_RT2870) },
     { USB_VP(USB_VENDOR_PEGATRON,	USB_PRODUCT_PEGATRON_RT3070) },
     { USB_VP(USB_VENDOR_PEGATRON,	USB_PRODUCT_PEGATRON_RT3070_2) },
+    { USB_VP(USB_VENDOR_PEGATRON,	USB_PRODUCT_PEGATRON_RT3070_3) },
     { USB_VP(USB_VENDOR_PHILIPS,	USB_PRODUCT_PHILIPS_RT2870) },
     { USB_VP(USB_VENDOR_PLANEX2,	USB_PRODUCT_PLANEX2_GWUS300MINIS) },
     { USB_VP(USB_VENDOR_PLANEX2,	USB_PRODUCT_PLANEX2_GWUSMICRON) },
@@ -212,7 +239,9 @@ static const struct usb_device_id run_de
     { USB_VP(USB_VENDOR_RALINK,		USB_PRODUCT_RALINK_RT3070) },
     { USB_VP(USB_VENDOR_RALINK,		USB_PRODUCT_RALINK_RT3071) },
     { USB_VP(USB_VENDOR_RALINK,		USB_PRODUCT_RALINK_RT3072) },
+    { USB_VP(USB_VENDOR_RALINK,		USB_PRODUCT_RALINK_RT3370) },
     { USB_VP(USB_VENDOR_RALINK,		USB_PRODUCT_RALINK_RT3572) },
+    { USB_VP(USB_VENDOR_RALINK,		USB_PRODUCT_RALINK_RT8070) },
     { USB_VP(USB_VENDOR_SAMSUNG2,	USB_PRODUCT_SAMSUNG2_RT2870_1) },
     { USB_VP(USB_VENDOR_SENAO,		USB_PRODUCT_SENAO_RT2870_1) },
     { USB_VP(USB_VENDOR_SENAO,		USB_PRODUCT_SENAO_RT2870_2) },
@@ -234,6 +263,7 @@ static const struct usb_device_id run_de
     { USB_VP(USB_VENDOR_SITECOMEU,	USB_PRODUCT_SITECOMEU_RT3070_2) },
     { USB_VP(USB_VENDOR_SITECOMEU,	USB_PRODUCT_SITECOMEU_RT3070_3) },
     { USB_VP(USB_VENDOR_SITECOMEU,	USB_PRODUCT_SITECOMEU_RT3070_4) },
+    { USB_VP(USB_VENDOR_SITECOMEU,	USB_PRODUCT_SITECOMEU_RT3071) },
     { USB_VP(USB_VENDOR_SITECOMEU,	USB_PRODUCT_SITECOMEU_RT3072_1) },
     { USB_VP(USB_VENDOR_SITECOMEU,	USB_PRODUCT_SITECOMEU_RT3072_2) },
     { USB_VP(USB_VENDOR_SITECOMEU,	USB_PRODUCT_SITECOMEU_RT3072_3) },
@@ -243,8 +273,10 @@ static const struct usb_device_id run_de
     { USB_VP(USB_VENDOR_SITECOMEU,	USB_PRODUCT_SITECOMEU_WL608) },
     { USB_VP(USB_VENDOR_SPARKLAN,	USB_PRODUCT_SPARKLAN_RT2870_1) },
     { USB_VP(USB_VENDOR_SPARKLAN,	USB_PRODUCT_SPARKLAN_RT3070) },
+    { USB_VP(USB_VENDOR_SWEEX2,		USB_PRODUCT_SWEEX2_LW153) },
     { USB_VP(USB_VENDOR_SWEEX2,		USB_PRODUCT_SWEEX2_LW303) },
     { USB_VP(USB_VENDOR_SWEEX2,		USB_PRODUCT_SWEEX2_LW313) },
+    { USB_VP(USB_VENDOR_TOSHIBA,	USB_PRODUCT_TOSHIBA_RT3070) },
     { USB_VP(USB_VENDOR_UMEDIA,		USB_PRODUCT_UMEDIA_RT2870_1) },
     { USB_VP(USB_VENDOR_ZCOM,		USB_PRODUCT_ZCOM_RT2870_1) },
     { USB_VP(USB_VENDOR_ZCOM,		USB_PRODUCT_ZCOM_RT2870_2) },
@@ -254,6 +286,7 @@ static const struct usb_device_id run_de
     { USB_VP(USB_VENDOR_ZINWELL,	USB_PRODUCT_ZINWELL_RT3072_1) },
     { USB_VP(USB_VENDOR_ZINWELL,	USB_PRODUCT_ZINWELL_RT3072_2) },
     { USB_VP(USB_VENDOR_ZYXEL,		USB_PRODUCT_ZYXEL_RT2870_1) },
+    { USB_VP(USB_VENDOR_ZYXEL,		USB_PRODUCT_ZYXEL_RT2870_2) },
 };
 
 MODULE_DEPEND(run, wlan, 1, 1, 1);
@@ -340,10 +373,12 @@ static int	run_raw_xmit(struct ieee80211
 		    const struct ieee80211_bpf_params *);
 static void	run_start(struct ifnet *);
 static int	run_ioctl(struct ifnet *, u_long, caddr_t);
+static void	run_set_agc(struct run_softc *, uint8_t);
 static void	run_select_chan_group(struct run_softc *, int);
 static void	run_set_rx_antenna(struct run_softc *, int);
 static void	run_rt2870_set_chan(struct run_softc *, u_int);
 static void	run_rt3070_set_chan(struct run_softc *, u_int);
+static void	run_rt3572_set_chan(struct run_softc *, u_int);
 static int	run_set_chan(struct run_softc *, struct ieee80211_channel *);
 static void	run_set_channel(struct ieee80211com *);
 static void	run_scan_start(struct ieee80211com *);
@@ -369,6 +404,7 @@ static int	run_bbp_init(struct run_softc
 static int	run_rt3070_rf_init(struct run_softc *);
 static int	run_rt3070_filter_calib(struct run_softc *, uint8_t, uint8_t,
 		    uint8_t *);
+static void	run_rt3070_rf_setup(struct run_softc *);
 static int	run_txrx_enable(struct run_softc *);
 static void	run_init(void *);
 static void	run_init_locked(struct run_softc *);
@@ -398,8 +434,8 @@ static const struct rfprog {
 
 struct {
 	uint8_t	n, r, k;
-} run_rf3020_freqs[] = {
-	RT3070_RF3020
+} rt3070_freqs[] = {
+	RT3070_RF3052
 };
 
 static const struct {
@@ -407,6 +443,8 @@ static const struct {
 	uint8_t	val;
 } rt3070_def_rf[] = {
 	RT3070_DEF_RF
+},rt3572_def_rf[] = {
+	RT3572_DEF_RF
 };
 
 static const struct usb_config run_config[RUN_N_XFER] = {
@@ -502,6 +540,7 @@ run_attach(device_t self)
 	struct usb_attach_arg *uaa = device_get_ivars(self);
 	struct ieee80211com *ic;
 	struct ifnet *ifp;
+	uint32_t ver;
 	int i, ntries, error;
 	uint8_t iface_index, bands;
 
@@ -513,11 +552,10 @@ run_attach(device_t self)
 	    MTX_NETWORK_LOCK, MTX_DEF);
 
 	iface_index = RT2860_IFACE_INDEX;
-	/* Rx transfer has own lock */
 	error = usbd_transfer_setup(uaa->device, &iface_index,
 	    sc->sc_xfer, run_config, RUN_N_XFER, sc, &sc->sc_mtx);
 	if (error) {
-		device_printf(self, "could not allocate USB Tx transfers, "
+		device_printf(self, "could not allocate USB transfers, "
 		    "err=%s\n", usbd_errstr(error));
 		goto detach;
 	}
@@ -526,11 +564,11 @@ run_attach(device_t self)
 
 	/* wait for the chip to settle */
 	for (ntries = 0; ntries < 100; ntries++) {
-		if (run_read(sc, RT2860_ASIC_VER_ID, &sc->mac_rev) != 0){
+		if (run_read(sc, RT2860_ASIC_VER_ID, &ver) != 0){
 			RUN_UNLOCK(sc);
 			goto detach;
 		}
-		if (sc->mac_rev != 0 && sc->mac_rev != 0xffffffff)
+		if (ver != 0 && ver != 0xffffffff)
 			break;
 		run_delay(sc, 10);
 	}
@@ -540,13 +578,15 @@ run_attach(device_t self)
 		RUN_UNLOCK(sc);
 		goto detach;
 	}
+	sc->mac_ver = ver >> 16;
+	sc->mac_rev = ver & 0xffff;
 
 	/* retrieve RF rev. no and various other things from EEPROM */
 	run_read_eeprom(sc);
 
 	device_printf(sc->sc_dev,
 	    "MAC/BBP RT%04X (rev 0x%04X), RF %s (MIMO %dT%dR), address %s\n",
-	    sc->mac_rev >> 16, sc->mac_rev & 0xffff, run_get_rf(sc->rf_rev),
+	    sc->mac_ver, sc->mac_rev, run_get_rf(sc->rf_rev),
 	    sc->ntxchains, sc->nrxchains, ether_sprintf(sc->sc_bssid));
 
 	if ((error = run_load_microcode(sc)) != 0) {
@@ -609,7 +649,9 @@ run_attach(device_t self)
 	 * Do this by own because h/w supports
 	 * more channels than ieee80211_init_channels()
 	 */
-	if (sc->rf_rev == RT2860_RF_2750 || sc->rf_rev == RT2860_RF_2850) {
+	if (sc->rf_rev == RT2860_RF_2750 ||
+	    sc->rf_rev == RT2860_RF_2850 ||
+	    sc->rf_rev == RT3070_RF_3052) {
 		/* set supported .11a rates */
 		for (i = 14; i < nitems(rt2860_rf2850); i++) {
 			uint8_t chan = rt2860_rf2850[i].chan;
@@ -743,11 +785,15 @@ run_vap_delete(struct ieee80211vap *vap)
 
 	sc = ifp->if_softc;
 
-	if (ifp && ifp->if_flags & IFF_UP){
-		RUN_LOCK(sc);
-		run_stop(sc);
-		RUN_UNLOCK(sc);
-	}
+	RUN_LOCK(sc);
+	sc->sc_rvp->amrr_run = RUN_AMRR_OFF;
+	RUN_UNLOCK(sc);
+
+	/* drain them all */
+	usb_callout_drain(&sc->sc_rvp->amrr_ch);
+	ieee80211_draintask(ic, &sc->sc_rvp->amrr_task);
+	ieee80211_draintask(ic, &sc->wme_task);
+	ieee80211_draintask(ic, &sc->usb_timeout_task);
 
 	ieee80211_amrr_cleanup(&rvp->amrr);
 	ieee80211_vap_detach(vap);
@@ -808,7 +854,9 @@ run_load_microcode(struct run_softc *sc)
 	const uint64_t *temp;
 	uint64_t bytes;
 
+	RUN_UNLOCK(sc);
 	fw = firmware_get("runfw");
+	RUN_LOCK(sc);
 	if(fw == NULL){
 		device_printf(sc->sc_dev,
 		    "failed loadfirmware of file %s\n", "runfw");
@@ -829,14 +877,11 @@ run_load_microcode(struct run_softc *sc)
 	 * last half is for rt3071.
 	 */
 	base = fw->data;
-	if ((sc->mac_rev >> 16) != 0x2860 &&
-	    (sc->mac_rev >> 16) != 0x2872 &&
-	    (sc->mac_rev >> 16) != 0x3070 &&
-	    (sc->mac_rev >> 16) != 0x3572){
+	if ((sc->mac_ver) != 0x2860 &&
+	    (sc->mac_ver) != 0x2872 &&
+	    (sc->mac_ver) != 0x3070){ 
 		base += 4096;
-		device_printf(sc->sc_dev, "loading RT3071 firmware\n");
-	} else
-		device_printf(sc->sc_dev, "loading RT2870 firmware\n");
+	}
 
 	/* cheap sanity check */
 	temp = fw->data;
@@ -866,7 +911,7 @@ run_load_microcode(struct run_softc *sc)
 	run_delay(sc, 10);
 
 	run_write(sc, RT2860_H2M_MAILBOX, 0);
-	if ((error = run_mcu_cmd(sc, RT2860_MCU_CMD_BOOT, 0)) != 0)
+	if ((error = run_mcu_cmd(sc, RT2860_MCU_CMD_RFRESET, 0)) != 0)
 		goto fail;
 
 	/* wait until microcontroller is ready */
@@ -884,7 +929,8 @@ run_load_microcode(struct run_softc *sc)
 		error = ETIMEDOUT;
 		goto fail;
 	}
-	DPRINTF("microcode successfully loaded after %d tries\n", ntries);
+	device_printf(sc->sc_dev, "firmware %s loaded\n",
+	    (base == fw->data) ? "RT2870" : "RT3071");
 
 fail:
 	firmware_put(fw, FIRMWARE_UNLOAD);
@@ -1283,7 +1329,7 @@ run_read_eeprom(struct run_softc *sc)
 
 	/* check whether the ROM is eFUSE ROM or EEPROM */
 	sc->sc_srom_read = run_eeprom_read_2;
-	if ((sc->mac_rev & 0xfff00000) >= 0x30700000) {
+	if (sc->mac_ver >= 0x3070) {
 		run_read(sc, RT3070_EFUSE_CTRL, &tmp);
 		DPRINTF("EFUSE_CTRL=0x%08x\n", tmp);
 		if (tmp & RT3070_SEL_EFUSE)
@@ -1305,21 +1351,32 @@ run_read_eeprom(struct run_softc *sc)
 	sc->sc_bssid[4] = val & 0xff;
 	sc->sc_bssid[5] = val >> 8;
 
-	/* read default BBP settings */
-	for (i = 0; i < 8; i++) {
+	/* read vender BBP settings */
+	for (i = 0; i < 10; i++) {
 		run_srom_read(sc, RT2860_EEPROM_BBP_BASE + i, &val);
 		sc->bbp[i].val = val & 0xff;
 		sc->bbp[i].reg = val >> 8;
 		DPRINTF("BBP%d=0x%02x\n", sc->bbp[i].reg, sc->bbp[i].val);
 	}
+	if (sc->mac_ver >= 0x3071) {
+		/* read vendor RF settings */
+		for (i = 0; i < 10; i++) {
+			run_srom_read(sc, RT3071_EEPROM_RF_BASE + i, &val);
+			sc->rf[i].val = val & 0xff;
+			sc->rf[i].reg = val >> 8;
+			DPRINTF("RF%d=0x%02x\n", sc->rf[i].reg,
+			    sc->rf[i].val);
+		}
+	}
 
 	/* read RF frequency offset from EEPROM */
 	run_srom_read(sc, RT2860_EEPROM_FREQ_LEDS, &val);
 	sc->freq = ((val & 0xff) != 0xff) ? val & 0xff : 0;
 	DPRINTF("EEPROM freq offset %d\n", sc->freq & 0xff);
 
-	if ((sc->leds = val >> 8) != 0xff) {
+	if (val >> 8 != 0xff) {
 		/* read LEDs operating mode */
+		sc->leds = val >> 8;
 		run_srom_read(sc, RT2860_EEPROM_LED1, &sc->led[0]);
 		run_srom_read(sc, RT2860_EEPROM_LED2, &sc->led[1]);
 		run_srom_read(sc, RT2860_EEPROM_LED3, &sc->led[2]);
@@ -1337,7 +1394,12 @@ run_read_eeprom(struct run_softc *sc)
 	run_srom_read(sc, RT2860_EEPROM_ANTENNA, &val);
 	if (val == 0xffff) {
 		DPRINTF("invalid EEPROM antenna info, using default\n");
-		if ((sc->mac_rev >> 16) >= 0x3070) {
+		if (sc->mac_ver == 0x3572) {
+			/* default to RF3052 2T2R */
+			sc->rf_rev = RT3070_RF_3052;
+			sc->ntxchains = 2;
+			sc->nrxchains = 2;
+		} else if (sc->mac_ver >= 0x3070) {
 			/* default to RF3020 1T1R */
 			sc->rf_rev = RT3070_RF_3020;
 			sc->ntxchains = 1;
@@ -1356,13 +1418,18 @@ run_read_eeprom(struct run_softc *sc)
 	DPRINTF("EEPROM RF rev=0x%02x chains=%dT%dR\n",
 	    sc->rf_rev, sc->ntxchains, sc->nrxchains);
 
-	/* check if RF supports automatic Tx access gain control */
 	run_srom_read(sc, RT2860_EEPROM_CONFIG, &val);
 	DPRINTF("EEPROM CFG 0x%04x\n", val);
+	/* check if driver should patch the DAC issue */
+	if ((val >> 8) != 0xff)
+		sc->patch_dac = (val >> 15) & 1;
 	if ((val & 0xff) != 0xff) {
 		sc->ext_5ghz_lna = (val >> 3) & 1;
 		sc->ext_2ghz_lna = (val >> 2) & 1;
+		/* check if RF supports automatic Tx access gain control */
 		sc->calib_2ghz = sc->calib_5ghz = (val >> 1) & 1;
+		/* check if we have a hardware radio switch */
+		sc->rfswitch = val & 1;
 	}
 
 	/* read power settings for 2GHz channels */
@@ -1385,7 +1452,7 @@ run_read_eeprom(struct run_softc *sc)
 		    rt2860_rf2850[i].chan, sc->txpow1[i], sc->txpow2[i]);
 	}
 	/* read power settings for 5GHz channels */
-	for (i = 0; i < 36; i += 2) {
+	for (i = 0; i < 40; i += 2) {
 		run_srom_read(sc, RT2860_EEPROM_PWR5GHZ_BASE1 + i / 2, &val);
 		sc->txpow1[i + 14] = (int8_t)(val & 0xff);
 		sc->txpow1[i + 15] = (int8_t)(val >> 8);
@@ -1395,7 +1462,7 @@ run_read_eeprom(struct run_softc *sc)
 		sc->txpow2[i + 15] = (int8_t)(val >> 8);
 	}
 	/* fix broken Tx power entries */
-	for (i = 0; i < 36; i++) {
+	for (i = 0; i < 40; i++) {
 		if (sc->txpow1[14 + i] < -7 || sc->txpow1[14 + i] > 15)
 			sc->txpow1[14 + i] = 5;
 		if (sc->txpow2[14 + i] < -7 || sc->txpow2[14 + i] > 15)
@@ -1444,14 +1511,32 @@ run_read_eeprom(struct run_softc *sc)
 	sc->rssi_2ghz[0] = val & 0xff;	/* Ant A */
 	sc->rssi_2ghz[1] = val >> 8;	/* Ant B */
 	run_srom_read(sc, RT2860_EEPROM_RSSI2_2GHZ, &val);
-	sc->rssi_2ghz[2] = val & 0xff;	/* Ant C */
+	if (sc->mac_ver >= 0x3070) {
+		/*
+		 * On RT3070 chips (limited to 2 Rx chains), this ROM
+		 * field contains the Tx mixer gain for the 2GHz band.
+		 */
+		if ((val & 0xff) != 0xff)
+			sc->txmixgain_2ghz = val & 0x7;
+		DPRINTF("tx mixer gain=%u (2GHz)\n", sc->txmixgain_2ghz);
+	} else
+		sc->rssi_2ghz[2] = val & 0xff;	/* Ant C */
 	sc->lna[2] = val >> 8;		/* channel group 2 */
 
 	run_srom_read(sc, RT2860_EEPROM_RSSI1_5GHZ, &val);
 	sc->rssi_5ghz[0] = val & 0xff;	/* Ant A */
 	sc->rssi_5ghz[1] = val >> 8;	/* Ant B */
 	run_srom_read(sc, RT2860_EEPROM_RSSI2_5GHZ, &val);
-	sc->rssi_5ghz[2] = val & 0xff;	/* Ant C */
+	if (sc->mac_ver == 0x3572) {
+		/*
+		 * On RT3572 chips (limited to 2 Rx chains), this ROM
+		 * field contains the Tx mixer gain for the 5GHz band.
+		 */
+		if ((val & 0xff) != 0xff)
+			sc->txmixgain_5ghz = val & 0x7;
+		DPRINTF("tx mixer gain=%u (5GHz)\n", sc->txmixgain_5ghz);
+	} else
+		sc->rssi_5ghz[2] = val & 0xff;	/* Ant C */
 	sc->lna[3] = val >> 8;		/* channel group 3 */
 
 	run_srom_read(sc, RT2860_EEPROM_LNA, &val);
@@ -2639,7 +2724,7 @@ run_tx(struct run_softc *sc, struct mbuf
 			dur = rt2860_rates[ridx].sp_ack_dur;
 		else
 			dur = rt2860_rates[ridx].lp_ack_dur;
-		*(uint16_t *)wh->i_dur = htole16(dur + sc->sifs);
+		*(uint16_t *)wh->i_dur = htole16(dur);
 	}
 
 	/* reserve slots for mgmt packets, just in case */
@@ -3006,9 +3091,26 @@ run_ioctl(struct ifnet *ifp, u_long cmd,
 }
 
 static void
+run_set_agc(struct run_softc *sc, uint8_t agc)
+{
+	uint8_t bbp;
+
+	if (sc->mac_ver == 0x3572) {
+		run_bbp_read(sc, 27, &bbp);
+		bbp &= ~(0x3 << 5);
+		run_bbp_write(sc, 27, bbp | 0 << 5);	/* select Rx0 */
+		run_bbp_write(sc, 66, agc);
+		run_bbp_write(sc, 27, bbp | 1 << 5);	/* select Rx1 */
+		run_bbp_write(sc, 66, agc);
+	} else
+		run_bbp_write(sc, 66, agc);
+}
+
+static void
 run_select_chan_group(struct run_softc *sc, int group)
 {
 	uint32_t tmp;
+	uint8_t agc;
 
 	run_bbp_write(sc, 62, 0x37 - sc->lna[group]);
 	run_bbp_write(sc, 63, 0x37 - sc->lna[group]);
@@ -3024,13 +3126,14 @@ run_select_chan_group(struct run_softc *
 			run_bbp_write(sc, 75, 0x50);
 		}
 	} else {
-		if (sc->ext_5ghz_lna) {
+		if (sc->mac_ver == 0x3572)
+			run_bbp_write(sc, 82, 0x94);
+		else
 			run_bbp_write(sc, 82, 0xf2);
+		if (sc->ext_5ghz_lna)
 			run_bbp_write(sc, 75, 0x46);
-		} else {
-			run_bbp_write(sc, 82, 0xf2);
+		else 
 			run_bbp_write(sc, 75, 0x50);
-		}
 	}
 
 	run_read(sc, RT2860_TX_BAND_CFG, &tmp);
@@ -3053,13 +3156,26 @@ run_select_chan_group(struct run_softc *
 		if (sc->nrxchains > 1)
 			tmp |= RT2860_LNA_PE_A1_EN;
 	}
-	run_write(sc, RT2860_TX_PIN_CFG, tmp);
+	if (sc->mac_ver == 0x3572) {
+		run_rt3070_rf_write(sc, 8, 0x00);
+		run_write(sc, RT2860_TX_PIN_CFG, tmp);
+		run_rt3070_rf_write(sc, 8, 0x80);
+	} else
+		run_write(sc, RT2860_TX_PIN_CFG, tmp);
 
 	/* set initial AGC value */
-	if (group == 0)
-		run_bbp_write(sc, 66, 0x2e + sc->lna[0]);
-	else
-		run_bbp_write(sc, 66, 0x32 + (sc->lna[group] * 5) / 3);
+	if (group == 0) {	/* 2GHz band */
+		if (sc->mac_ver >= 0x3070)
+			agc = 0x1c + sc->lna[0] * 2;
+		else
+			agc = 0x2e + sc->lna[0];
+	} else {		/* 5GHz band */
+		if (sc->mac_ver == 0x3572)
+			agc = 0x22 + (sc->lna[group] * 5) / 3;
+		else
+			agc = 0x32 + (sc->lna[group] * 5) / 3;
+	}
+	run_set_agc(sc, agc);
 }
 
 static void
@@ -3122,18 +3238,22 @@ run_rt3070_set_chan(struct run_softc *sc
 {
 	int8_t txpow1, txpow2;
 	uint8_t rf;
+	int i;
 
 	/* RT3070 is 2GHz only */
 	KASSERT(chan >= 1 && chan <= 14, ("wrong channel selected\n"));
 
+	/* find the settings for this channel (we know it exists) */
+	for (i = 0; rt2860_rf2850[i].chan != chan; i++);
+
 	/* use Tx power values from EEPROM */
-	txpow1 = sc->txpow1[chan - 1];
-	txpow2 = sc->txpow2[chan - 1];
+	txpow1 = sc->txpow1[i];
+	txpow2 = sc->txpow2[i];
 
-	run_rt3070_rf_write(sc, 2, run_rf3020_freqs[chan - 1].n);
-	run_rt3070_rf_write(sc, 3, run_rf3020_freqs[chan - 1].k);
+	run_rt3070_rf_write(sc, 2, rt3070_freqs[i].n);
+	run_rt3070_rf_write(sc, 3, rt3070_freqs[i].k);
 	run_rt3070_rf_read(sc, 6, &rf);
-	rf = (rf & ~0x03) | run_rf3020_freqs[chan - 1].r;
+	rf = (rf & ~0x03) | rt3070_freqs[i].r;
 	run_rt3070_rf_write(sc, 6, rf);
 
 	/* set Tx0 power */
@@ -3164,12 +3284,166 @@ run_rt3070_set_chan(struct run_softc *sc
 	run_rt3070_rf_write(sc, 23, rf);
 
 	/* program RF filter */
-	run_rt3070_rf_write(sc, 24, sc->rf24_20mhz);
-	run_rt3070_rf_write(sc, 31, sc->rf24_20mhz);
+	run_rt3070_rf_read(sc, 24, &rf);	/* Tx */
+	rf = (rf & ~0x3f) | sc->rf24_20mhz;
+	run_rt3070_rf_write(sc, 24, rf);
+	run_rt3070_rf_read(sc, 31, &rf);	/* Rx */
+	rf = (rf & ~0x3f) | sc->rf24_20mhz;
+	run_rt3070_rf_write(sc, 31, rf);
+
+	/* enable RF tuning */
+	run_rt3070_rf_read(sc, 7, &rf);
+	run_rt3070_rf_write(sc, 7, rf | 0x01);
+}
+
+static void
+run_rt3572_set_chan(struct run_softc *sc, u_int chan)
+{
+	int8_t txpow1, txpow2;
+	uint32_t tmp;
+	uint8_t rf;
+	int i;
+
+	/* find the settings for this channel (we know it exists) */
+	for (i = 0; rt2860_rf2850[i].chan != chan; i++);
+
+	/* use Tx power values from EEPROM */
+	txpow1 = sc->txpow1[i];
+	txpow2 = sc->txpow2[i];
+
+	if (chan <= 14) {
+		run_bbp_write(sc, 25, sc->bbp25);
+		run_bbp_write(sc, 26, sc->bbp26);
+	} else {
+		/* enable IQ phase correction */
+		run_bbp_write(sc, 25, 0x09);
+		run_bbp_write(sc, 26, 0xff);
+	}
+
+	run_rt3070_rf_write(sc, 2, rt3070_freqs[i].n);
+	run_rt3070_rf_write(sc, 3, rt3070_freqs[i].k);
+	run_rt3070_rf_read(sc, 6, &rf);
+	rf  = (rf & ~0x0f) | rt3070_freqs[i].r;
+	rf |= (chan <= 14) ? 0x08 : 0x04;
+	run_rt3070_rf_write(sc, 6, rf);
+
+	/* set PLL mode */
+	run_rt3070_rf_read(sc, 5, &rf);
+	rf &= ~(0x08 | 0x04);
+	rf |= (chan <= 14) ? 0x04 : 0x08;
+	run_rt3070_rf_write(sc, 5, rf);
+
+	/* set Tx power for chain 0 */
+	if (chan <= 14)
+		rf = 0x60 | txpow1;
+	else
+		rf = 0xe0 | (txpow1 & 0xc) << 1 | (txpow1 & 0x3);
+	run_rt3070_rf_write(sc, 12, rf);
+
+	/* set Tx power for chain 1 */
+	if (chan <= 14)
+		rf = 0x60 | txpow2;
+	else
+		rf = 0xe0 | (txpow2 & 0xc) << 1 | (txpow2 & 0x3);
+	run_rt3070_rf_write(sc, 13, rf);
+
+	/* set Tx/Rx streams */
+	run_rt3070_rf_read(sc, 1, &rf);
+	rf &= ~0xfc;
+	if (sc->ntxchains == 1)
+		rf |= 1 << 7 | 1 << 5;  /* 1T: disable Tx chains 2 & 3 */
+	else if (sc->ntxchains == 2)
+		rf |= 1 << 7;           /* 2T: disable Tx chain 3 */
+	if (sc->nrxchains == 1)
+		rf |= 1 << 6 | 1 << 4;  /* 1R: disable Rx chains 2 & 3 */
+	else if (sc->nrxchains == 2)
+		rf |= 1 << 6;           /* 2R: disable Rx chain 3 */
+	run_rt3070_rf_write(sc, 1, rf);
+
+	/* set RF offset */
+	run_rt3070_rf_read(sc, 23, &rf);
+	rf = (rf & ~0x7f) | sc->freq;
+	run_rt3070_rf_write(sc, 23, rf);
+
+	/* program RF filter */
+	rf = sc->rf24_20mhz;
+	run_rt3070_rf_write(sc, 24, rf);	/* Tx */
+	run_rt3070_rf_write(sc, 31, rf);	/* Rx */
+
+	/* enable RF tuning */
+	run_rt3070_rf_read(sc, 7, &rf);
+	rf = (chan <= 14) ? 0xd8 : ((rf & ~0xc8) | 0x14);
+	run_rt3070_rf_write(sc, 7, rf);
+
+	/* TSSI */
+	rf = (chan <= 14) ? 0xc3 : 0xc0;
+	run_rt3070_rf_write(sc, 9, rf);
+
+	/* set loop filter 1 */
+	run_rt3070_rf_write(sc, 10, 0xf1);
+	/* set loop filter 2 */
+	run_rt3070_rf_write(sc, 11, (chan <= 14) ? 0xb9 : 0x00);
+
+	/* set tx_mx2_ic */
+	run_rt3070_rf_write(sc, 15, (chan <= 14) ? 0x53 : 0x43);
+	/* set tx_mx1_ic */
+	if (chan <= 14)
+		rf = 0x48 | sc->txmixgain_2ghz;
+	else
+		rf = 0x78 | sc->txmixgain_5ghz;
+	run_rt3070_rf_write(sc, 16, rf);
+
+	/* set tx_lo1 */
+	run_rt3070_rf_write(sc, 17, 0x23);
+	/* set tx_lo2 */
+	if (chan <= 14)
+		rf = 0x93;
+	else if (chan <= 64)
+		rf = 0xb7;
+	else if (chan <= 128)
+		rf = 0x74;
+	else
+		rf = 0x72;
+	run_rt3070_rf_write(sc, 19, rf);
+
+	/* set rx_lo1 */
+	if (chan <= 14)
+		rf = 0xb3;
+	else if (chan <= 64)
+		rf = 0xf6;
+	else if (chan <= 128)
+		rf = 0xf4;
+	else
+		rf = 0xf3;
+	run_rt3070_rf_write(sc, 20, rf);
+
+	/* set pfd_delay */
+	if (chan <= 14)
+		rf = 0x15;
+	else if (chan <= 64)
+		rf = 0x3d;
+	else
+		rf = 0x01;
+	run_rt3070_rf_write(sc, 25, rf);
+
+	/* set rx_lo2 */
+	run_rt3070_rf_write(sc, 26, (chan <= 14) ? 0x85 : 0x87);
+	/* set ldo_rf_vc */
+	run_rt3070_rf_write(sc, 27, (chan <= 14) ? 0x00 : 0x01);
+	/* set drv_cc */
+	run_rt3070_rf_write(sc, 29, (chan <= 14) ? 0x9b : 0x9f);
+
+	run_read(sc, RT2860_GPIO_CTRL, &tmp);
+	tmp &= ~0x8080;
+	if (chan <= 14)
+		tmp |= 0x80;
+	run_write(sc, RT2860_GPIO_CTRL, tmp);
 
 	/* enable RF tuning */
 	run_rt3070_rf_read(sc, 7, &rf);
 	run_rt3070_rf_write(sc, 7, rf | 0x01);
+
+	run_delay(sc, 2);
 }
 
 static void
@@ -3178,13 +3452,11 @@ run_set_rx_antenna(struct run_softc *sc,
 	uint32_t tmp;
 
 	if (aux) {
-		run_read(sc, RT2860_PCI_EECTRL, &tmp);
-		run_write(sc, RT2860_PCI_EECTRL, tmp & ~RT2860_C);
+		run_mcu_cmd(sc, RT2860_MCU_CMD_ANTSEL, 0);
 		run_read(sc, RT2860_GPIO_CTRL, &tmp);
 		run_write(sc, RT2860_GPIO_CTRL, (tmp & ~0x0808) | 0x08);
 	} else {
-		run_read(sc, RT2860_PCI_EECTRL, &tmp);
-		run_write(sc, RT2860_PCI_EECTRL, tmp | RT2860_C);
+		run_mcu_cmd(sc, RT2860_MCU_CMD_ANTSEL, 1);
 		run_read(sc, RT2860_GPIO_CTRL, &tmp);
 		run_write(sc, RT2860_GPIO_CTRL, tmp & ~0x0808);
 	}
@@ -3200,14 +3472,13 @@ run_set_chan(struct run_softc *sc, struc
 	if (chan == 0 || chan == IEEE80211_CHAN_ANY)
 		return EINVAL;
 
-	if ((sc->mac_rev >> 16) >= 0x3070)
+	if (sc->mac_ver == 0x3572)
+		run_rt3572_set_chan(sc, chan);
+	else if (sc->mac_ver >= 0x3070)
 		run_rt3070_set_chan(sc, chan);
 	else
 		run_rt2870_set_chan(sc, chan);
 
-	/* 802.11a uses a 16 microseconds short interframe space */
-	sc->sifs = IEEE80211_IS_CHAN_5GHZ(c) ? 16 : 10;
-
 	/* determine channel group */
 	if (chan <= 14)
 		group = 0;
@@ -3373,7 +3644,7 @@ run_usb_timeout_cb(void *arg, int pendin
 	struct run_softc *sc = arg;
 	struct ieee80211vap *vap = &sc->sc_rvp->vap;
 
-	RUN_LOCK_ASSERT(sc, MA_OWNED);
+	RUN_LOCK(sc);
 
 	if(vap->iv_state == IEEE80211_S_RUN &&
 	    vap->iv_opmode != IEEE80211_M_STA)
@@ -3384,6 +3655,8 @@ run_usb_timeout_cb(void *arg, int pendin
 		ieee80211_cancel_scan(vap);
 	} else
 		DPRINTF("timeout by unknown cause\n");
+
+	RUN_UNLOCK(sc);

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

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Apr  6 23:29:14 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AA0421065673;
	Tue,  6 Apr 2010 23:29:14 +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 8E3A58FC26;
	Tue,  6 Apr 2010 23:29:14 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o36NTEjw014870;
	Tue, 6 Apr 2010 23:29:14 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o36NTEjC014868;
	Tue, 6 Apr 2010 23:29:14 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <201004062329.o36NTEjC014868@svn.freebsd.org>
From: Andrew Thompson 
Date: Tue, 6 Apr 2010 23:29:14 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206321 - stable/8/sys/dev/usb
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 06 Apr 2010 23:29:14 -0000

Author: thompsa
Date: Tue Apr  6 23:29:14 2010
New Revision: 206321
URL: http://svn.freebsd.org/changeset/base/206321

Log:
  MFC r205043
  
   Add device ID for the NATURAL4000 keyboard

Modified:
  stable/8/sys/dev/usb/usbdevs
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/usb/usbdevs
==============================================================================
--- stable/8/sys/dev/usb/usbdevs	Tue Apr  6 23:28:46 2010	(r206320)
+++ stable/8/sys/dev/usb/usbdevs	Tue Apr  6 23:29:14 2010	(r206321)
@@ -2062,6 +2062,7 @@ product MICROSOFT WLNOTEBOOK2	0x00e1	Wir
 product MICROSOFT WLNOTEBOOK3	0x00d2	Wireless Optical Mouse 3000 (Model 1049)
 product MICROSOFT WLUSBMOUSE	0x00b9	Wireless USB Mouse
 product MICROSOFT XBOX360	0x0292	XBOX 360 WLAN
+product MICROSOFT NATURAL4000	0x00db	Natural Ergonomic Keyboard 4000
 
 /* Microtech products */
 product MICROTECH SCSIDB25	0x0004	USB-SCSI-DB25

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Apr  6 23:29:38 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 972151065680;
	Tue,  6 Apr 2010 23:29:38 +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 83F668FC17;
	Tue,  6 Apr 2010 23:29:38 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o36NTcQo015037;
	Tue, 6 Apr 2010 23:29:38 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o36NTcno015035;
	Tue, 6 Apr 2010 23:29:38 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <201004062329.o36NTcno015035@svn.freebsd.org>
From: Andrew Thompson 
Date: Tue, 6 Apr 2010 23:29:38 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206322 - stable/8/sys/dev/usb
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 06 Apr 2010 23:29:38 -0000

Author: thompsa
Date: Tue Apr  6 23:29:38 2010
New Revision: 206322
URL: http://svn.freebsd.org/changeset/base/206322

Log:
  MFC r205801
  
   Add a couple of usb product IDs.
  
  Submitted by:	Dmitry Luhtionov @ gmail.com

Modified:
  stable/8/sys/dev/usb/usbdevs
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/usb/usbdevs
==============================================================================
--- stable/8/sys/dev/usb/usbdevs	Tue Apr  6 23:29:14 2010	(r206321)
+++ stable/8/sys/dev/usb/usbdevs	Tue Apr  6 23:29:38 2010	(r206322)
@@ -2519,12 +2519,14 @@ product QUALCOMMINC E2003	0x2003	3G mode
 
 /* Quanta products */
 /* Quanta products */
+product QUANTA RW6815_1		0x00ce	HP iPAQ rw6815
 product QUANTA RT3070		0x0304	RT3070
 product QUANTA Q101		0xea02	HSDPA modem
 product QUANTA Q111		0xea03	HSDPA modem
 product QUANTA GLX		0xea04	HSDPA modem
 product QUANTA GKE		0xea05	HSDPA modem
 product QUANTA GLE		0xea06	HSDPA modem
+product QUANTA RW6815_2		0xf003	HP iPAQ rw6815
 
 /* Qtronix products */
 product QTRONIX 980N		0x2011	Scorpion-980N keyboard
@@ -2732,6 +2734,7 @@ product SIERRA AIRCARD875	0x6820	Aircard
 product SIERRA TRUINSTALL	0x0fff	Aircard Tru Installer
 
 /* Sigmatel products */
+product SIGMATEL WBT_3052	0x4200	WBT-3052 IrDA/USB Bridge
 product SIGMATEL I_BEAD100	0x8008	i-Bead 100 MP3 Player
 
 /* SIIG products */

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Apr  6 23:30:02 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AECDC106564A;
	Tue,  6 Apr 2010 23:30: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 966C78FC13;
	Tue,  6 Apr 2010 23:30:02 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o36NU2Hd015185;
	Tue, 6 Apr 2010 23:30:02 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o36NU2gM015182;
	Tue, 6 Apr 2010 23:30:02 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <201004062330.o36NU2gM015182@svn.freebsd.org>
From: Andrew Thompson 
Date: Tue, 6 Apr 2010 23:30:02 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206323 - stable/8/sys/dev/usb/controller
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 06 Apr 2010 23:30:02 -0000

Author: thompsa
Date: Tue Apr  6 23:30:02 2010
New Revision: 206323
URL: http://svn.freebsd.org/changeset/base/206323

Log:
  MFC r205802
  
   Add PCI IDs for two more nForce controllers.
  
  Submitted by:	Dmitry Luhtionov @ gmail.com

Modified:
  stable/8/sys/dev/usb/controller/ehci_pci.c
  stable/8/sys/dev/usb/controller/ohci_pci.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/usb/controller/ehci_pci.c
==============================================================================
--- stable/8/sys/dev/usb/controller/ehci_pci.c	Tue Apr  6 23:29:38 2010	(r206322)
+++ stable/8/sys/dev/usb/controller/ehci_pci.c	Tue Apr  6 23:30:02 2010	(r206323)
@@ -215,6 +215,8 @@ ehci_pci_match(device_t self)
 		return "NVIDIA nForce3 250 USB 2.0 controller";
 	case 0x005b10de:
 		return "NVIDIA nForce4 USB 2.0 controller";
+	case 0x036d10de:
+		return "NVIDIA nForce MCP55 USB 2.0 controller";
 	case 0x03f210de:
 		return "NVIDIA nForce MCP61 USB 2.0 controller";
 	case 0x0aa610de:

Modified: stable/8/sys/dev/usb/controller/ohci_pci.c
==============================================================================
--- stable/8/sys/dev/usb/controller/ohci_pci.c	Tue Apr  6 23:29:38 2010	(r206322)
+++ stable/8/sys/dev/usb/controller/ohci_pci.c	Tue Apr  6 23:30:02 2010	(r206323)
@@ -173,6 +173,8 @@ ohci_pci_match(device_t self)
 	case 0x00d710de:
 		return ("nVidia nForce3 USB Controller");
 
+	case 0x036c10de:
+		return ("nVidia nForce MCP55 USB Controller");
 	case 0x03f110de:
 		return ("nVidia nForce MCP61 USB Controller");
 	case 0x0aa510de:

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Apr  6 23:30:31 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4EAD81065672;
	Tue,  6 Apr 2010 23:30:31 +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 3B4DA8FC12;
	Tue,  6 Apr 2010 23:30:31 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o36NUVZk015392;
	Tue, 6 Apr 2010 23:30:31 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o36NUVDg015390;
	Tue, 6 Apr 2010 23:30:31 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <201004062330.o36NUVDg015390@svn.freebsd.org>
From: Andrew Thompson 
Date: Tue, 6 Apr 2010 23:30:31 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206324 - stable/8/sys/dev/usb
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 06 Apr 2010 23:30:31 -0000

Author: thompsa
Date: Tue Apr  6 23:30:30 2010
New Revision: 206324
URL: http://svn.freebsd.org/changeset/base/206324

Log:
  MFC r205803
  
   Make sure the bsd_urb_list gets initialised and that new URB's are queued at
   the end of the list.
  
  Submitted by:	Hans Petter Selasky

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

Modified: stable/8/sys/dev/usb/usb_compat_linux.c
==============================================================================
--- stable/8/sys/dev/usb/usb_compat_linux.c	Tue Apr  6 23:30:02 2010	(r206323)
+++ stable/8/sys/dev/usb/usb_compat_linux.c	Tue Apr  6 23:30:30 2010	(r206324)
@@ -435,7 +435,7 @@ usb_submit_urb(struct urb *urb, uint16_t
 	    uhe->bsd_xfer[1]) {
 		/* we are ready! */
 
-		TAILQ_INSERT_HEAD(&uhe->bsd_urb_list, urb, bsd_urb_list);
+		TAILQ_INSERT_TAIL(&uhe->bsd_urb_list, urb, bsd_urb_list);
 
 		urb->status = -EINPROGRESS;
 
@@ -908,6 +908,7 @@ usb_linux_create_usb_device(struct usb_d
 				if (p_uhe) {
 					bcopy(ed, &p_uhe->desc, sizeof(p_uhe->desc));
 					p_uhe->bsd_iface_index = iface_index - 1;
+					TAILQ_INIT(&p_uhe->bsd_urb_list);
 					p_uhe++;
 				}
 				if (p_uhi) {

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Apr  6 23:30:57 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A2F2B106564A;
	Tue,  6 Apr 2010 23:30:57 +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 8EEF18FC0C;
	Tue,  6 Apr 2010 23:30:57 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o36NUvKa015537;
	Tue, 6 Apr 2010 23:30:57 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o36NUvhM015535;
	Tue, 6 Apr 2010 23:30:57 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <201004062330.o36NUvhM015535@svn.freebsd.org>
From: Andrew Thompson 
Date: Tue, 6 Apr 2010 23:30:57 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206325 - stable/8/sys/dev/usb/input
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 06 Apr 2010 23:30:57 -0000

Author: thompsa
Date: Tue Apr  6 23:30:57 2010
New Revision: 206325
URL: http://svn.freebsd.org/changeset/base/206325

Log:
  MFC r205804
  
   Do not swap Apple keys when detecting Apple-FN keyboards.
  
  Reported by:	Steven Noonan
  Submitted by:	Hans Petter Selasky

Modified:
  stable/8/sys/dev/usb/input/ukbd.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/usb/input/ukbd.c
==============================================================================
--- stable/8/sys/dev/usb/input/ukbd.c	Tue Apr  6 23:30:30 2010	(r206324)
+++ stable/8/sys/dev/usb/input/ukbd.c	Tue Apr  6 23:30:57 2010	(r206325)
@@ -903,8 +903,7 @@ ukbd_attach(device_t dev)
 		    hid_input, 0, &sc->sc_loc_apple_fn, &flags,
 		    &temp_id)) {
 			if (flags & HIO_VARIABLE)
-				sc->sc_flags |= UKBD_FLAG_APPLE_FN |
-				    UKBD_FLAG_APPLE_SWAP;
+				sc->sc_flags |= UKBD_FLAG_APPLE_FN;
 			DPRINTFN(1, "Found Apple FN-key\n");
 			apple_keys = 1;
 			sc->sc_kbd_id = temp_id;

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Apr  6 23:31:23 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5A38F1065784;
	Tue,  6 Apr 2010 23:31:23 +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 2C4798FC0A;
	Tue,  6 Apr 2010 23:31:23 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o36NVNfw015660;
	Tue, 6 Apr 2010 23:31:23 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o36NVNIr015657;
	Tue, 6 Apr 2010 23:31:23 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <201004062331.o36NVNIr015657@svn.freebsd.org>
From: Andrew Thompson 
Date: Tue, 6 Apr 2010 23:31:23 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206326 - in stable/8/sys/dev/usb: . quirk
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 06 Apr 2010 23:31:23 -0000

Author: thompsa
Date: Tue Apr  6 23:31:22 2010
New Revision: 206326
URL: http://svn.freebsd.org/changeset/base/206326

Log:
  MFC r205805
  
   Do not sync cache for the PL2506
  
  PR:		usb/144915
  Submitted by:	Monty Hall

Modified:
  stable/8/sys/dev/usb/quirk/usb_quirk.c
  stable/8/sys/dev/usb/usbdevs
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/usb/quirk/usb_quirk.c
==============================================================================
--- stable/8/sys/dev/usb/quirk/usb_quirk.c	Tue Apr  6 23:30:57 2010	(r206325)
+++ stable/8/sys/dev/usb/quirk/usb_quirk.c	Tue Apr  6 23:31:22 2010	(r206326)
@@ -317,6 +317,8 @@ static struct usb_quirk_entry usb_quirks
 	USB_QUIRK(PNY, ATTACHE2, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB,
 	    UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_IGNORE_RESIDUE,
 	    UQ_MSC_NO_START_STOP),
+	USB_QUIRK(PROLIFIC, PL2506, 0x0000, 0xffff,
+	    UQ_MSC_NO_SYNC_CACHE),
 	USB_QUIRK_VP(USB_VENDOR_SAMSUNG_TECHWIN,
 	    USB_PRODUCT_SAMSUNG_TECHWIN_DIGIMAX_410, UQ_MSC_FORCE_WIRE_BBB,
 	    UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_INQUIRY),

Modified: stable/8/sys/dev/usb/usbdevs
==============================================================================
--- stable/8/sys/dev/usb/usbdevs	Tue Apr  6 23:30:57 2010	(r206325)
+++ stable/8/sys/dev/usb/usbdevs	Tue Apr  6 23:31:22 2010	(r206326)
@@ -2419,6 +2419,7 @@ product PROLIFIC PL2303		0x2303	PL2303 S
 product PROLIFIC PL2305		0x2305	Parallel printer
 product PROLIFIC ATAPI4		0x2307	ATAPI-4 Controller
 product PROLIFIC PL2501		0x2501	PL2501 Host-Host interface
+product PROLIFIC PL2506		0x2506	PL2506 USB to IDE Bridge
 product PROLIFIC PHAROS		0xaaa0	Prolific Pharos
 product PROLIFIC RSAQ3		0xaaa2	PL2303 Serial Adapter (IODATA USB-RSAQ3)
 product PROLIFIC2 WSIM		0x2001	Willcom WSIM

From owner-svn-src-stable-8@FreeBSD.ORG  Wed Apr  7 00:25:04 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7151E1065783;
	Wed,  7 Apr 2010 00:25:04 +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 5D6498FC15;
	Wed,  7 Apr 2010 00:25:04 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o370P4IL027691;
	Wed, 7 Apr 2010 00:25:04 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o370P4jL027688;
	Wed, 7 Apr 2010 00:25:04 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <201004070025.o370P4jL027688@svn.freebsd.org>
From: Andrew Thompson 
Date: Wed, 7 Apr 2010 00:25:04 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206327 - in stable/8/sys/dev/usb: . wlan
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Wed, 07 Apr 2010 00:25:04 -0000

Author: thompsa
Date: Wed Apr  7 00:25:03 2010
New Revision: 206327
URL: http://svn.freebsd.org/changeset/base/206327

Log:
  MFC r202608
  
   Remove a hack to attach TRENDnet TEW-504UB/EU, this has been solved.

Modified:
  stable/8/sys/dev/usb/usbdevs
  stable/8/sys/dev/usb/wlan/if_uath.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/usb/usbdevs
==============================================================================
--- stable/8/sys/dev/usb/usbdevs	Tue Apr  6 23:31:22 2010	(r206326)
+++ stable/8/sys/dev/usb/usbdevs	Wed Apr  7 00:25:03 2010	(r206327)
@@ -3030,7 +3030,6 @@ product UMEDIA RT2870_1		0x300e	RT2870
 product UMEDIA ALL0298V2	0x3204	ALL0298 v2
 product UMEDIA AR5523_2		0x3205	AR5523
 product UMEDIA AR5523_2_NF	0x3206	AR5523 (no firmware)
-product UMEDIA AR5523_3		0x3207	AR5523
 
 /* Universal Access products */
 product UNIACCESS PANACHE	0x0101	Panache Surf USB ISDN Adapter

Modified: stable/8/sys/dev/usb/wlan/if_uath.c
==============================================================================
--- stable/8/sys/dev/usb/wlan/if_uath.c	Tue Apr  6 23:31:22 2010	(r206326)
+++ stable/8/sys/dev/usb/wlan/if_uath.c	Wed Apr  7 00:25:03 2010	(r206327)
@@ -191,7 +191,6 @@ static const struct usb_device_id uath_d
 	UATH_DEV(NETGEAR3,		WPN111_2),
 	UATH_DEV(UMEDIA,		TEW444UBEU),
 	UATH_DEV(UMEDIA,		AR5523_2),
-	UATH_DEV(UMEDIA,		AR5523_3),
 	UATH_DEV(WISTRONNEWEB,		AR5523_1),
 	UATH_DEV(WISTRONNEWEB,		AR5523_2),
 	UATH_DEV(ZCOM,			AR5523)

From owner-svn-src-stable-8@FreeBSD.ORG  Wed Apr  7 00:26:39 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CF847106566C;
	Wed,  7 Apr 2010 00:26:39 +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 BC3718FC18;
	Wed,  7 Apr 2010 00:26:39 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o370QdSq028098;
	Wed, 7 Apr 2010 00:26:39 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o370Qd95028096;
	Wed, 7 Apr 2010 00:26:39 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <201004070026.o370Qd95028096@svn.freebsd.org>
From: Andrew Thompson 
Date: Wed, 7 Apr 2010 00:26:39 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206328 - stable/8/sys/dev/usb
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Wed, 07 Apr 2010 00:26:39 -0000

Author: thompsa
Date: Wed Apr  7 00:26:39 2010
New Revision: 206328
URL: http://svn.freebsd.org/changeset/base/206328

Log:
  MFC r202609
  
   Product ID of D-Link DWA-120 after loading the firmware is incorrect.

Modified:
  stable/8/sys/dev/usb/usbdevs
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/usb/usbdevs
==============================================================================
--- stable/8/sys/dev/usb/usbdevs	Wed Apr  7 00:25:03 2010	(r206327)
+++ stable/8/sys/dev/usb/usbdevs	Wed Apr  7 00:26:39 2010	(r206328)
@@ -1343,8 +1343,8 @@ product DLINK DSB650TX_PNA	0x4003	1/10/1
 product DLINK DSB650TX3		0x400b	10/100 Ethernet
 product DLINK DSB650TX2		0x4102	10/100 Ethernet
 product DLINK DSB650		0xabc1	10/100 Ethernet
+product DLINK2 DWA120		0x3a0c	DWA-120
 product DLINK2 DWA120_NF	0x3a0d	DWA-120 (no firmware)
-product DLINK2 DWA120		0x3a0e	DWA-120
 product DLINK2 DWLG122C1	0x3c03	DWL-G122 c1
 product DLINK2 WUA1340		0x3c04	WUA-1340
 product DLINK2 DWA111		0x3c06	DWA-111

From owner-svn-src-stable-8@FreeBSD.ORG  Wed Apr  7 00:28:00 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 50FFD106566C;
	Wed,  7 Apr 2010 00:28:00 +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 3CAEA8FC0C;
	Wed,  7 Apr 2010 00:28:00 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o370S0Vl028462;
	Wed, 7 Apr 2010 00:28:00 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o370S0pp028459;
	Wed, 7 Apr 2010 00:28:00 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <201004070028.o370S0pp028459@svn.freebsd.org>
From: Andrew Thompson 
Date: Wed, 7 Apr 2010 00:28:00 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206329 - stable/8/sys/dev/usb/wlan
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Wed, 07 Apr 2010 00:28:01 -0000

Author: thompsa
Date: Wed Apr  7 00:27:59 2010
New Revision: 206329
URL: http://svn.freebsd.org/changeset/base/206329

Log:
  MFC r203087
  
   adds sysctl knobs to show rate statistics that it could be useful to
   debug slow TX speed.

Modified:
  stable/8/sys/dev/usb/wlan/if_urtw.c
  stable/8/sys/dev/usb/wlan/if_urtwvar.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/usb/wlan/if_urtw.c
==============================================================================
--- stable/8/sys/dev/usb/wlan/if_urtw.c	Wed Apr  7 00:26:39 2010	(r206328)
+++ stable/8/sys/dev/usb/wlan/if_urtw.c	Wed Apr  7 00:27:59 2010	(r206329)
@@ -762,6 +762,7 @@ static int		urtw_compute_txtime(uint16_t
 			    uint8_t);
 static void		urtw_updateslot(struct ifnet *);
 static void		urtw_updateslottask(void *, int);
+static void		urtw_sysctl_node(struct urtw_softc *);
 
 static int
 urtw_match(device_t dev)
@@ -906,6 +907,8 @@ urtw_attach(device_t dev)
 	    &sc->sc_rxtap.wr_ihdr, sizeof(sc->sc_rxtap),
 	    URTW_RX_RADIOTAP_PRESENT);
 
+	urtw_sysctl_node(sc);
+
 	if (bootverbose)
 		ieee80211_announce(ic);
 	return (0);
@@ -1703,6 +1706,8 @@ urtw_tx_start(struct urtw_softc *sc, str
 			rate = urtw_rtl2rate(sc->sc_currate);
 	}
 
+	sc->sc_stats.txrates[sc->sc_currate]++;
+
 	if (IEEE80211_IS_MULTICAST(wh->i_addr1))
 		txdur = pkttime = urtw_compute_txtime(m0->m_pkthdr.len +
 		    IEEE80211_CRC_LEN, rate, 0, 0);
@@ -4372,6 +4377,54 @@ fail:
 	URTW_UNLOCK(sc);
 }
 
+static void
+urtw_sysctl_node(struct urtw_softc *sc)
+{
+#define	URTW_SYSCTL_STAT_ADD32(c, h, n, p, d)	\
+	SYSCTL_ADD_UINT(c, h, OID_AUTO, n, CTLFLAG_RD, p, 0, d)
+	struct sysctl_ctx_list *ctx;
+	struct sysctl_oid_list *child, *parent;
+	struct sysctl_oid *tree;
+	struct urtw_stats *stats = &sc->sc_stats;
+
+	ctx = device_get_sysctl_ctx(sc->sc_dev);
+	child = SYSCTL_CHILDREN(device_get_sysctl_tree(sc->sc_dev));
+
+	tree = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "stats", CTLFLAG_RD,
+	    NULL, "URTW statistics");
+	parent = SYSCTL_CHILDREN(tree);
+
+	/* Tx statistics. */
+	tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "tx", CTLFLAG_RD,
+	    NULL, "Tx MAC statistics");
+	child = SYSCTL_CHILDREN(tree);
+	URTW_SYSCTL_STAT_ADD32(ctx, child, "1m", &stats->txrates[0],
+	    "1 Mbit/s");
+	URTW_SYSCTL_STAT_ADD32(ctx, child, "2m", &stats->txrates[1],
+	    "2 Mbit/s");
+	URTW_SYSCTL_STAT_ADD32(ctx, child, "5.5m", &stats->txrates[2],
+	    "5.5 Mbit/s");
+	URTW_SYSCTL_STAT_ADD32(ctx, child, "6m", &stats->txrates[4],
+	    "6 Mbit/s");
+	URTW_SYSCTL_STAT_ADD32(ctx, child, "9m", &stats->txrates[5],
+	    "9 Mbit/s");
+	URTW_SYSCTL_STAT_ADD32(ctx, child, "11m", &stats->txrates[3],
+	    "11 Mbit/s");
+	URTW_SYSCTL_STAT_ADD32(ctx, child, "12m", &stats->txrates[6],
+	    "12 Mbit/s");
+	URTW_SYSCTL_STAT_ADD32(ctx, child, "18m", &stats->txrates[7],
+	    "18 Mbit/s");
+	URTW_SYSCTL_STAT_ADD32(ctx, child, "24m", &stats->txrates[8],
+	    "24 Mbit/s");
+	URTW_SYSCTL_STAT_ADD32(ctx, child, "36m", &stats->txrates[9],
+	    "36 Mbit/s");
+	URTW_SYSCTL_STAT_ADD32(ctx, child, "48m", &stats->txrates[10],
+	    "48 Mbit/s");
+	URTW_SYSCTL_STAT_ADD32(ctx, child, "54m", &stats->txrates[11],
+	    "54 Mbit/s");
+#undef URTW_SYSCTL_STAT_ADD32
+}
+
 static device_method_t urtw_methods[] = {
 	DEVMETHOD(device_probe, urtw_match),
 	DEVMETHOD(device_attach, urtw_attach),

Modified: stable/8/sys/dev/usb/wlan/if_urtwvar.h
==============================================================================
--- stable/8/sys/dev/usb/wlan/if_urtwvar.h	Wed Apr  7 00:26:39 2010	(r206328)
+++ stable/8/sys/dev/usb/wlan/if_urtwvar.h	Wed Apr  7 00:27:59 2010	(r206329)
@@ -81,6 +81,10 @@ struct urtw_tx_radiotap_header {
 	((1 << IEEE80211_RADIOTAP_FLAGS) |				\
 	 (1 << IEEE80211_RADIOTAP_CHANNEL))
 
+struct urtw_stats {
+	unsigned int			txrates[12];
+};
+
 struct urtw_vap {
 	struct ieee80211vap		vap;
 	int				(*newstate)(struct ieee80211vap *,
@@ -169,6 +173,8 @@ struct urtw_softc {
 	uint64_t			sc_txstatus;	/* only for 8187B */
 	struct task			sc_updateslot_task;
 
+	struct urtw_stats		sc_stats;
+
 	struct	urtw_rx_radiotap_header	sc_rxtap;
 	int				sc_rxtap_len;
 	struct	urtw_tx_radiotap_header	sc_txtap;

From owner-svn-src-stable-8@FreeBSD.ORG  Wed Apr  7 00:30:25 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AC4F1106566B;
	Wed,  7 Apr 2010 00:30:25 +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 984538FC0A;
	Wed,  7 Apr 2010 00:30:25 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o370UP9h029468;
	Wed, 7 Apr 2010 00:30:25 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o370UPcl029465;
	Wed, 7 Apr 2010 00:30:25 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <201004070030.o370UPcl029465@svn.freebsd.org>
From: Andrew Thompson 
Date: Wed, 7 Apr 2010 00:30:25 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206330 - in stable/8/sys/dev/usb: . quirk
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Wed, 07 Apr 2010 00:30:25 -0000

Author: thompsa
Date: Wed Apr  7 00:30:25 2010
New Revision: 206330
URL: http://svn.freebsd.org/changeset/base/206330

Log:
  MFC r205681
  
   - add some usb devices (scanner, printer, usb storage)
   - add quirks for the usb storage

Modified:
  stable/8/sys/dev/usb/quirk/usb_quirk.c
  stable/8/sys/dev/usb/usbdevs
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/usb/quirk/usb_quirk.c
==============================================================================
--- stable/8/sys/dev/usb/quirk/usb_quirk.c	Wed Apr  7 00:27:59 2010	(r206329)
+++ stable/8/sys/dev/usb/quirk/usb_quirk.c	Wed Apr  7 00:30:25 2010	(r206330)
@@ -227,6 +227,7 @@ static struct usb_quirk_entry usb_quirks
 	USB_QUIRK(IOMEGA, ZIP100, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB,
 	    UQ_MSC_FORCE_PROTO_SCSI,
 	    UQ_MSC_NO_TEST_UNIT_READY), /* XXX ZIP drives can also use ATAPI */
+	USB_QUIRK(JMICRON, JM20336, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE),
 	USB_QUIRK(JMICRON, JM20337, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB,
 	    UQ_MSC_FORCE_PROTO_SCSI,
 	    UQ_MSC_NO_SYNC_CACHE),
@@ -444,6 +445,7 @@ static struct usb_quirk_entry usb_quirks
 	USB_QUIRK(ACTIONS, MP4, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB,
 	    UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_SYNC_CACHE),
 	USB_QUIRK(ASUS, GMSC, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE),
+	USB_QUIRK(UNKNOWN4, USBMEMSTICK, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE),
 };
 #undef USB_QUIRK_VP
 #undef USB_QUIRK

Modified: stable/8/sys/dev/usb/usbdevs
==============================================================================
--- stable/8/sys/dev/usb/usbdevs	Wed Apr  7 00:27:59 2010	(r206329)
+++ stable/8/sys/dev/usb/usbdevs	Wed Apr  7 00:30:25 2010	(r206330)
@@ -65,6 +65,7 @@ $FreeBSD$
 vendor UNKNOWN1		0x0053	Unknown vendor
 vendor UNKNOWN2		0x0105	Unknown vendor
 vendor EGALAX2		0x0123	eGalax, Inc.
+vendor UNKNOWN4		0x0204	Unknown vendor
 vendor HUMAX		0x02ad	HUMAX
 vendor LTS		0x0386	LTS
 vendor BWCT		0x03da	Bernd Walter Computer Technology
@@ -1105,6 +1106,7 @@ product BROADCOM BCM2033	0x2033	BCM2033 
 
 /* Brother Industries products */
 product BROTHER HL1050		0x0002	HL-1050 laser printer
+product BROTHER MFC8600_9650	0x0100	MFC8600/9650 multifunction device
 
 /* Behavior Technology Computer products */
 product BTC BTC7932		0x6782	Keyboard with mouse port
@@ -1819,6 +1821,7 @@ product JABLOTRON PC60B		0x0001	PC-60B
 product JATON EDA		0x5704	Ethernet
 
 /* JMicron products */
+product JMICRON JM20336		0x2336	USB to SATA Bridge
 product JMICRON JM20337		0x2338	USB to ATA/ATAPI Bridge
 
 /* JVC products */
@@ -2134,6 +2137,7 @@ product MUSTEK 1200UB		0x0006	1200 UB sc
 product MUSTEK 1200USBPLUS	0x0007	1200 USB Plus scanner
 product MUSTEK 1200CUPLUS	0x0008	1200 CU Plus scanner
 product MUSTEK BEARPAW1200F	0x0010	BearPaw 1200F scanner
+product MUSTEK BEARPAW2400TA	0x0218	BearPaw 2400TA scanner
 product MUSTEK BEARPAW1200TA	0x021e	BearPaw 1200TA scanner
 product MUSTEK 600USB		0x0873	600 USB scanner
 product MUSTEK MDC800		0xa800	MDC-800 digital camera
@@ -3034,6 +3038,9 @@ product UMEDIA AR5523_2_NF	0x3206	AR5523
 /* Universal Access products */
 product UNIACCESS PANACHE	0x0101	Panache Surf USB ISDN Adapter
 
+/* Unknown vendors */
+product UNKNOWN4 USBMEMSTICK	0x6025	Flash Disk CBM
+
 /* U.S. Robotics products */
 product USR USR5423		0x0121	USR5423 WLAN
 

From owner-svn-src-stable-8@FreeBSD.ORG  Wed Apr  7 00:33:00 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 71ED31065673;
	Wed,  7 Apr 2010 00:33:00 +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 4369E8FC14;
	Wed,  7 Apr 2010 00:33:00 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o370X0k0030270;
	Wed, 7 Apr 2010 00:33:00 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o370X0Pl030266;
	Wed, 7 Apr 2010 00:33:00 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <201004070033.o370X0Pl030266@svn.freebsd.org>
From: Andrew Thompson 
Date: Wed, 7 Apr 2010 00:33:00 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206331 - stable/8/sys/dev/usb
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Wed, 07 Apr 2010 00:33:00 -0000

Author: thompsa
Date: Wed Apr  7 00:32:59 2010
New Revision: 206331
URL: http://svn.freebsd.org/changeset/base/206331

Log:
  MFC r205036
  
   Implement USB kernel driver detach from userland.
  
  Submitted by:	Hans Petter Selasky

Modified:
  stable/8/sys/dev/usb/usb_device.c
  stable/8/sys/dev/usb/usb_device.h
  stable/8/sys/dev/usb/usb_generic.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/usb/usb_device.c
==============================================================================
--- stable/8/sys/dev/usb/usb_device.c	Wed Apr  7 00:30:25 2010	(r206330)
+++ stable/8/sys/dev/usb/usb_device.c	Wed Apr  7 00:32:59 2010	(r206331)
@@ -80,7 +80,6 @@
 static void	usb_init_endpoint(struct usb_device *, uint8_t,
 		    struct usb_endpoint_descriptor *, struct usb_endpoint *);
 static void	usb_unconfigure(struct usb_device *, uint8_t);
-static void	usb_detach_device(struct usb_device *, uint8_t, uint8_t);
 static void	usb_detach_device_sub(struct usb_device *, device_t *,
 		    uint8_t);
 static uint8_t	usb_probe_and_attach_sub(struct usb_device *,

Modified: stable/8/sys/dev/usb/usb_device.h
==============================================================================
--- stable/8/sys/dev/usb/usb_device.h	Wed Apr  7 00:30:25 2010	(r206330)
+++ stable/8/sys/dev/usb/usb_device.h	Wed Apr  7 00:32:59 2010	(r206331)
@@ -196,6 +196,7 @@ struct usb_device *usb_alloc_device(devi
 		    enum usb_dev_speed speed, enum usb_hc_mode mode);
 usb_error_t	usb_probe_and_attach(struct usb_device *udev,
 		    uint8_t iface_index);
+void		usb_detach_device(struct usb_device *, uint8_t, uint8_t);
 usb_error_t	usb_reset_iface_endpoints(struct usb_device *udev,
 		    uint8_t iface_index);
 usb_error_t	usbd_set_config_index(struct usb_device *udev, uint8_t index);

Modified: stable/8/sys/dev/usb/usb_generic.c
==============================================================================
--- stable/8/sys/dev/usb/usb_generic.c	Wed Apr  7 00:30:25 2010	(r206330)
+++ stable/8/sys/dev/usb/usb_generic.c	Wed Apr  7 00:32:59 2010	(r206331)
@@ -2095,17 +2095,32 @@ ugen_ioctl_post(struct usb_fifo *f, u_lo
 		break;
 
 	case USB_IFACE_DRIVER_ACTIVE:
-		/* TODO */
-		*u.pint = 0;
+
+		n = *u.pint & 0xFF;
+
+		iface = usbd_get_iface(f->udev, n);
+
+		if (iface && iface->subdev)
+			error = 0;
+		else
+			error = ENXIO;
 		break;
 
 	case USB_IFACE_DRIVER_DETACH:
-		/* TODO */
+
 		error = priv_check(curthread, PRIV_DRIVER);
-		if (error) {
+
+		if (error)
+			break;
+
+		n = *u.pint & 0xFF;
+
+		if (n == USB_IFACE_INDEX_ANY) {
+			error = EINVAL;
 			break;
 		}
-		error = EINVAL;
+
+		usb_detach_device(f->udev, n, 0);
 		break;
 
 	case USB_SET_POWER_MODE:

From owner-svn-src-stable-8@FreeBSD.ORG  Wed Apr  7 00:34:05 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7615F1065674;
	Wed,  7 Apr 2010 00:34:05 +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 6216E8FC1A;
	Wed,  7 Apr 2010 00:34:05 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o370Y5vA030569;
	Wed, 7 Apr 2010 00:34:05 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o370Y5gN030563;
	Wed, 7 Apr 2010 00:34:05 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <201004070034.o370Y5gN030563@svn.freebsd.org>
From: Andrew Thompson 
Date: Wed, 7 Apr 2010 00:34:05 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206332 - stable/8/lib/libusb
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Wed, 07 Apr 2010 00:34:05 -0000

Author: thompsa
Date: Wed Apr  7 00:34:05 2010
New Revision: 206332
URL: http://svn.freebsd.org/changeset/base/206332

Log:
  MFC r203147
  
   Add a function to check if the usb devices is still connected.
  
  Submitted by:	Hans Petter Selasky

Modified:
  stable/8/lib/libusb/libusb20.3
  stable/8/lib/libusb/libusb20.c
  stable/8/lib/libusb/libusb20.h
  stable/8/lib/libusb/libusb20_int.h
  stable/8/lib/libusb/libusb20_ugen20.c
Directory Properties:
  stable/8/lib/libusb/   (props changed)
  stable/8/lib/libusb/usb.h   (props changed)

Modified: stable/8/lib/libusb/libusb20.3
==============================================================================
--- stable/8/lib/libusb/libusb20.3	Wed Apr  7 00:32:59 2010	(r206331)
+++ stable/8/lib/libusb/libusb20.3	Wed Apr  7 00:34:05 2010	(r206332)
@@ -143,6 +143,8 @@ USB access library (libusb -lusb)
 .Ft int
 .Fn libusb20_dev_reset "struct libusb20_device *pdev"
 .Ft int
+.Fn libusb20_dev_check_connected "struct libusb20_device *pdev"
+.Ft int
 .Fn libusb20_dev_set_power_mode "struct libusb20_device *pdev" "uint8_t power_mode"
 .Ft uint8_t
 .Fn libusb20_dev_get_power_mode "struct libusb20_device *pdev"
@@ -677,6 +679,15 @@ the last set USB configuration.
 This function returns zero on success else a LIBUSB20_ERROR value is
 returned.
 .
+.
+.Pp
+.
+.Fn libusb20_dev_check_connected
+will check if an opened USB device is still connected.
+.
+This function returns zero if the device is still connected else a LIBUSB20_ERROR value is returned.
+.
+.
 .Pp
 .
 .Fn libusb20_dev_set_power_mode

Modified: stable/8/lib/libusb/libusb20.c
==============================================================================
--- stable/8/lib/libusb/libusb20.c	Wed Apr  7 00:32:59 2010	(r206331)
+++ stable/8/lib/libusb/libusb20.c	Wed Apr  7 00:34:05 2010	(r206332)
@@ -67,6 +67,7 @@ dummy_callback(struct libusb20_transfer 
 #define	dummy_set_config_index (void *)dummy_int
 #define	dummy_set_alt_index (void *)dummy_int
 #define	dummy_reset_device (void *)dummy_int
+#define	dummy_check_connected (void *)dummy_int
 #define	dummy_set_power_mode (void *)dummy_int
 #define	dummy_get_power_mode (void *)dummy_int
 #define	dummy_kernel_driver_active (void *)dummy_int
@@ -673,6 +674,15 @@ libusb20_dev_reset(struct libusb20_devic
 }
 
 int
+libusb20_dev_check_connected(struct libusb20_device *pdev)
+{
+	int error;
+
+	error = pdev->methods->check_connected(pdev);
+	return (error);
+}
+
+int
 libusb20_dev_set_power_mode(struct libusb20_device *pdev, uint8_t power_mode)
 {
 	int error;

Modified: stable/8/lib/libusb/libusb20.h
==============================================================================
--- stable/8/lib/libusb/libusb20.h	Wed Apr  7 00:32:59 2010	(r206331)
+++ stable/8/lib/libusb/libusb20.h	Wed Apr  7 00:34:05 2010	(r206332)
@@ -250,6 +250,7 @@ int	libusb20_dev_request_sync(struct lib
 int	libusb20_dev_req_string_sync(struct libusb20_device *pdev, uint8_t index, uint16_t langid, void *ptr, uint16_t len);
 int	libusb20_dev_req_string_simple_sync(struct libusb20_device *pdev, uint8_t index, void *ptr, uint16_t len);
 int	libusb20_dev_reset(struct libusb20_device *pdev);
+int	libusb20_dev_check_connected(struct libusb20_device *pdev);
 int	libusb20_dev_set_power_mode(struct libusb20_device *pdev, uint8_t power_mode);
 uint8_t	libusb20_dev_get_power_mode(struct libusb20_device *pdev);
 int	libusb20_dev_set_alt_index(struct libusb20_device *pdev, uint8_t iface_index, uint8_t alt_index);

Modified: stable/8/lib/libusb/libusb20_int.h
==============================================================================
--- stable/8/lib/libusb/libusb20_int.h	Wed Apr  7 00:32:59 2010	(r206331)
+++ stable/8/lib/libusb/libusb20_int.h	Wed Apr  7 00:34:05 2010	(r206332)
@@ -101,6 +101,7 @@ typedef int (libusb20_set_power_mode_t)(
 typedef int (libusb20_get_power_mode_t)(struct libusb20_device *pdev, uint8_t *power_mode);
 typedef int (libusb20_set_alt_index_t)(struct libusb20_device *pdev, uint8_t iface_index, uint8_t alt_index);
 typedef int (libusb20_set_config_index_t)(struct libusb20_device *pdev, uint8_t index);
+typedef int (libusb20_check_connected_t)(struct libusb20_device *pdev);
 
 /* USB transfer specific */
 typedef int (libusb20_tr_open_t)(struct libusb20_transfer *xfer, uint32_t MaxBufSize, uint32_t MaxFrameCount, uint8_t ep_no);
@@ -117,6 +118,7 @@ typedef void (libusb20_tr_cancel_async_t
   m(n, kernel_driver_active) \
   m(n, process) \
   m(n, reset_device) \
+  m(n, check_connected) \
   m(n, set_power_mode) \
   m(n, get_power_mode) \
   m(n, set_alt_index) \

Modified: stable/8/lib/libusb/libusb20_ugen20.c
==============================================================================
--- stable/8/lib/libusb/libusb20_ugen20.c	Wed Apr  7 00:32:59 2010	(r206331)
+++ stable/8/lib/libusb/libusb20_ugen20.c	Wed Apr  7 00:34:05 2010	(r206332)
@@ -67,6 +67,7 @@ static libusb20_get_config_index_t ugen2
 static libusb20_set_config_index_t ugen20_set_config_index;
 static libusb20_set_alt_index_t ugen20_set_alt_index;
 static libusb20_reset_device_t ugen20_reset_device;
+static libusb20_check_connected_t ugen20_check_connected;
 static libusb20_set_power_mode_t ugen20_set_power_mode;
 static libusb20_get_power_mode_t ugen20_get_power_mode;
 static libusb20_kernel_driver_active_t ugen20_kernel_driver_active;
@@ -553,6 +554,25 @@ ugen20_reset_device(struct libusb20_devi
 }
 
 static int
+ugen20_check_connected(struct libusb20_device *pdev)
+{
+	uint32_t plugtime;
+	int error = 0;
+
+	if (ioctl(pdev->file_ctrl, USB_GET_PLUGTIME, &plugtime)) {
+		error = LIBUSB20_ERROR_NO_DEVICE;
+		goto done;
+	}
+
+	if (pdev->session_data.plugtime != plugtime) {
+		error = LIBUSB20_ERROR_NO_DEVICE;
+		goto done;
+	}
+done:
+	return (error);
+}
+
+static int
 ugen20_set_power_mode(struct libusb20_device *pdev, uint8_t power_mode)
 {
 	int temp;

From owner-svn-src-stable-8@FreeBSD.ORG  Wed Apr  7 02:24:42 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 829C7106564A;
	Wed,  7 Apr 2010 02:24:42 +0000 (UTC)
	(envelope-from nwhitehorn@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 6C18D8FC14;
	Wed,  7 Apr 2010 02:24:42 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o372Oguo058031;
	Wed, 7 Apr 2010 02:24:42 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Received: (from nwhitehorn@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o372OgHA058011;
	Wed, 7 Apr 2010 02:24:42 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Message-Id: <201004070224.o372OgHA058011@svn.freebsd.org>
From: Nathan Whitehorn 
Date: Wed, 7 Apr 2010 02:24:42 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206336 - in stable/8: . sys/amd64/amd64 sys/amd64/conf
	sys/amd64/include sys/amd64/linux32 sys/compat/freebsd32
	sys/compat/ia32 sys/conf sys/fs/procfs sys/ia64/conf
	sys/ia64/ia64 sys/i...
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Wed, 07 Apr 2010 02:24:42 -0000

Author: nwhitehorn
Date: Wed Apr  7 02:24:41 2010
New Revision: 206336
URL: http://svn.freebsd.org/changeset/base/206336

Log:
  MFC r205014,205015:
  
  Provide groundwork for 32-bit binary compatibility on non-x86 platforms,
  for upcoming 64-bit PowerPC and MIPS support. This renames the COMPAT_IA32
  option to COMPAT_FREEBSD32, removes some IA32-specific code from MI parts
  of the kernel and enhances the freebsd32 compatibility code to support
  big-endian platforms.
  
  This MFC is required for MFCs of later changes to the freebsd32
  compatibility from HEAD.
  
  Requested by:	kib

Modified:
  stable/8/UPDATING
  stable/8/sys/amd64/amd64/db_trace.c
  stable/8/sys/amd64/amd64/exception.S
  stable/8/sys/amd64/amd64/vm_machdep.c
  stable/8/sys/amd64/conf/GENERIC
  stable/8/sys/amd64/conf/NOTES
  stable/8/sys/amd64/conf/XENHVM
  stable/8/sys/amd64/include/elf.h
  stable/8/sys/amd64/include/reg.h
  stable/8/sys/amd64/linux32/linux32_sysvec.c
  stable/8/sys/compat/freebsd32/freebsd32.h
  stable/8/sys/compat/freebsd32/freebsd32_misc.c
  stable/8/sys/compat/freebsd32/freebsd32_util.h
  stable/8/sys/compat/freebsd32/syscalls.master
  stable/8/sys/compat/ia32/ia32_reg.h
  stable/8/sys/compat/ia32/ia32_sysvec.c
  stable/8/sys/conf/files.amd64
  stable/8/sys/conf/files.ia64
  stable/8/sys/conf/options.amd64
  stable/8/sys/conf/options.ia64
  stable/8/sys/fs/procfs/procfs_dbregs.c
  stable/8/sys/fs/procfs/procfs_fpregs.c
  stable/8/sys/fs/procfs/procfs_ioctl.c
  stable/8/sys/fs/procfs/procfs_map.c
  stable/8/sys/fs/procfs/procfs_regs.c
  stable/8/sys/ia64/conf/GENERIC
  stable/8/sys/ia64/conf/NOTES
  stable/8/sys/ia64/ia64/exception.S
  stable/8/sys/ia64/ia64/genassym.c
  stable/8/sys/ia64/ia64/machdep.c
  stable/8/sys/ia64/include/elf.h
  stable/8/sys/ia64/include/reg.h
  stable/8/sys/kern/imgact_elf.c
  stable/8/sys/kern/kern_jail.c
  stable/8/sys/kern/kern_module.c
  stable/8/sys/kern/kern_thr.c
  stable/8/sys/kern/kern_umtx.c
  stable/8/sys/kern/sys_generic.c
  stable/8/sys/kern/sys_process.c
  stable/8/sys/kern/uipc_socket.c
  stable/8/sys/kern/vfs_aio.c
  stable/8/sys/modules/linux/Makefile
  stable/8/sys/modules/procfs/Makefile
  stable/8/sys/sys/ptrace.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/UPDATING
==============================================================================
--- stable/8/UPDATING	Wed Apr  7 01:53:00 2010	(r206335)
+++ stable/8/UPDATING	Wed Apr  7 02:24:41 2010	(r206336)
@@ -15,6 +15,12 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8.
 	debugging tools present in HEAD were left in place because
 	sun4v support still needs work to become production ready.
 
+20100406:
+	The kernel option COMPAT_IA32 has been replaced with COMPAT_FREEBSD32
+	to allow 32-bit compatibility on non-x86 platforms. All kernel
+	configurations on amd64 and ia64 platforms using these options must
+	be modified accordingly.
+
 20100125:
 	Introduce the kernel thread "deadlock resolver" (which can be enabled
 	via the DEADLKRES option, see NOTES for more details) and the

Modified: stable/8/sys/amd64/amd64/db_trace.c
==============================================================================
--- stable/8/sys/amd64/amd64/db_trace.c	Wed Apr  7 01:53:00 2010	(r206335)
+++ stable/8/sys/amd64/amd64/db_trace.c	Wed Apr  7 02:24:41 2010	(r206336)
@@ -319,7 +319,7 @@ db_nextframe(struct amd64_frame **fp, db
 			frame_type = INTERRUPT;
 		else if (strcmp(name, "Xfast_syscall") == 0)
 			frame_type = SYSCALL;
-#ifdef COMPAT_IA32
+#ifdef COMPAT_FREEBSD32
 		else if (strcmp(name, "Xint0x80_syscall") == 0)
 			frame_type = SYSCALL;
 #endif

Modified: stable/8/sys/amd64/amd64/exception.S
==============================================================================
--- stable/8/sys/amd64/amd64/exception.S	Wed Apr  7 01:53:00 2010	(r206335)
+++ stable/8/sys/amd64/amd64/exception.S	Wed Apr  7 02:24:41 2010	(r206336)
@@ -572,7 +572,7 @@ ENTRY(fork_trampoline)
  * included.
  */
 
-#ifdef COMPAT_IA32
+#ifdef COMPAT_FREEBSD32
 	.data
 	.p2align 4
 	.text

Modified: stable/8/sys/amd64/amd64/vm_machdep.c
==============================================================================
--- stable/8/sys/amd64/amd64/vm_machdep.c	Wed Apr  7 01:53:00 2010	(r206335)
+++ stable/8/sys/amd64/amd64/vm_machdep.c	Wed Apr  7 02:24:41 2010	(r206336)
@@ -439,7 +439,7 @@ cpu_set_upcall_kse(struct thread *td, vo
 	 */
 	cpu_thread_clean(td);
 
-#ifdef COMPAT_IA32
+#ifdef COMPAT_FREEBSD32
 	if (td->td_proc->p_sysent->sv_flags & SV_ILP32) {
 		/*
 	 	 * Set the trap frame to point at the beginning of the uts
@@ -490,7 +490,7 @@ cpu_set_user_tls(struct thread *td, void
 	if ((u_int64_t)tls_base >= VM_MAXUSER_ADDRESS)
 		return (EINVAL);
 
-#ifdef COMPAT_IA32
+#ifdef COMPAT_FREEBSD32
 	if (td->td_proc->p_sysent->sv_flags & SV_ILP32) {
 		td->td_pcb->pcb_gsbase = (register_t)tls_base;
 		return (0);

Modified: stable/8/sys/amd64/conf/GENERIC
==============================================================================
--- stable/8/sys/amd64/conf/GENERIC	Wed Apr  7 01:53:00 2010	(r206335)
+++ stable/8/sys/amd64/conf/GENERIC	Wed Apr  7 02:24:41 2010	(r206336)
@@ -54,7 +54,7 @@ options 	PSEUDOFS		# Pseudo-filesystem f
 options 	GEOM_PART_GPT		# GUID Partition Tables.
 options 	GEOM_LABEL		# Provides labelization
 options 	COMPAT_43TTY		# BSD 4.3 TTY compat (sgtty)
-options 	COMPAT_IA32		# Compatible with i386 binaries
+options 	COMPAT_FREEBSD32	# Compatible with i386 binaries
 options 	COMPAT_FREEBSD4		# Compatible with FreeBSD4
 options 	COMPAT_FREEBSD5		# Compatible with FreeBSD5
 options 	COMPAT_FREEBSD6		# Compatible with FreeBSD6

Modified: stable/8/sys/amd64/conf/NOTES
==============================================================================
--- stable/8/sys/amd64/conf/NOTES	Wed Apr  7 01:53:00 2010	(r206335)
+++ stable/8/sys/amd64/conf/NOTES	Wed Apr  7 02:24:41 2010	(r206336)
@@ -445,7 +445,7 @@ options 	PMAP_SHPGPERPROC=201
 #XXX these 32 bit binaries is added.
 
 # Enable 32-bit runtime support for FreeBSD/i386 binaries.
-options 	COMPAT_IA32
+options 	COMPAT_FREEBSD32
 
 # Enable iBCS2 runtime support for SCO and ISC binaries
 #XXX#options 	IBCS2
@@ -456,7 +456,7 @@ options 	COMPAT_IA32
 # Enable Linux ABI emulation
 #XXX#options 	COMPAT_LINUX
 
-# Enable 32-bit Linux ABI emulation (requires COMPAT_43 and COMPAT_IA32)
+# Enable 32-bit Linux ABI emulation (requires COMPAT_43 and COMPAT_FREEBSD32)
 options 	COMPAT_LINUX32
 
 # Enable the linux-like proc filesystem support (requires COMPAT_LINUX32

Modified: stable/8/sys/amd64/conf/XENHVM
==============================================================================
--- stable/8/sys/amd64/conf/XENHVM	Wed Apr  7 01:53:00 2010	(r206335)
+++ stable/8/sys/amd64/conf/XENHVM	Wed Apr  7 02:24:41 2010	(r206336)
@@ -55,7 +55,7 @@ options 	PSEUDOFS		# Pseudo-filesystem f
 options 	GEOM_PART_GPT		# GUID Partition Tables.
 options 	GEOM_LABEL		# Provides labelization
 options 	COMPAT_43TTY		# BSD 4.3 TTY compat (sgtty)
-options 	COMPAT_IA32		# Compatible with i386 binaries
+options 	COMPAT_FREEBSD32	# Compatible with i386 binaries
 options 	COMPAT_FREEBSD4		# Compatible with FreeBSD4
 options 	COMPAT_FREEBSD5		# Compatible with FreeBSD5
 options 	COMPAT_FREEBSD6		# Compatible with FreeBSD6

Modified: stable/8/sys/amd64/include/elf.h
==============================================================================
--- stable/8/sys/amd64/include/elf.h	Wed Apr  7 01:53:00 2010	(r206335)
+++ stable/8/sys/amd64/include/elf.h	Wed Apr  7 02:24:41 2010	(r206336)
@@ -42,6 +42,7 @@
 #include 
 
 #define	ELF_ARCH	EM_X86_64
+#define	ELF_ARCH32	EM_386
 
 #define	ELF_MACHINE_OK(x) ((x) == EM_X86_64)
 

Modified: stable/8/sys/amd64/include/reg.h
==============================================================================
--- stable/8/sys/amd64/include/reg.h	Wed Apr  7 01:53:00 2010	(r206335)
+++ stable/8/sys/amd64/include/reg.h	Wed Apr  7 02:24:41 2010	(r206336)
@@ -37,6 +37,10 @@
 #ifndef _MACHINE_REG_H_
 #define	_MACHINE_REG_H_
 
+#if defined(_KERNEL) && !defined(_STANDALONE)
+#include "opt_compat.h"
+#endif
+
 /*
  * Register set accessible via /proc/$pid/regs and PT_{SET,GET}REGS.
  */
@@ -116,6 +120,11 @@ struct dbreg {
 #define	DBREG_DRX(d,x)	((d)->dr[(x)])	/* reference dr0 - dr15 by
 					   register number */
 
+#ifdef COMPAT_FREEBSD32
+#include 
+#include 
+#endif
+
 #ifdef _KERNEL
 /*
  * XXX these interfaces are MI, so they should be declared in a MI place.

Modified: stable/8/sys/amd64/linux32/linux32_sysvec.c
==============================================================================
--- stable/8/sys/amd64/linux32/linux32_sysvec.c	Wed Apr  7 01:53:00 2010	(r206335)
+++ stable/8/sys/amd64/linux32/linux32_sysvec.c	Wed Apr  7 02:24:41 2010	(r206336)
@@ -34,8 +34,8 @@
 __FBSDID("$FreeBSD$");
 #include "opt_compat.h"
 
-#ifndef COMPAT_IA32
-#error "Unable to compile Linux-emulator due to missing COMPAT_IA32 option!"
+#ifndef COMPAT_FREEBSD32
+#error "Unable to compile Linux-emulator due to missing COMPAT_FREEBSD32 option!"
 #endif
 
 #define	__ELF_WORD_SIZE	32

Modified: stable/8/sys/compat/freebsd32/freebsd32.h
==============================================================================
--- stable/8/sys/compat/freebsd32/freebsd32.h	Wed Apr  7 01:53:00 2010	(r206335)
+++ stable/8/sys/compat/freebsd32/freebsd32.h	Wed Apr  7 02:24:41 2010	(r206336)
@@ -29,6 +29,9 @@
 #ifndef _COMPAT_FREEBSD32_FREEBSD32_H_
 #define _COMPAT_FREEBSD32_FREEBSD32_H_
 
+#include 
+#include 
+
 #define PTRIN(v)	(void *)(uintptr_t) (v)
 #define PTROUT(v)	(u_int32_t)(uintptr_t) (v)
 
@@ -197,4 +200,25 @@ struct i386_ldt_args32 {
 	uint32_t num;
 };
 
+/*
+ * Alternative layouts for 
+ */
+struct prstatus32 {
+        int     pr_version;
+        u_int   pr_statussz;
+        u_int   pr_gregsetsz;
+        u_int   pr_fpregsetsz;
+        int     pr_osreldate;
+        int     pr_cursig;
+        pid_t   pr_pid;
+        struct reg32 pr_reg;
+};
+
+struct prpsinfo32 {
+        int     pr_version;
+        u_int   pr_psinfosz;
+        char    pr_fname[PRFNAMESZ+1];
+        char    pr_psargs[PRARGSZ+1];
+};
+
 #endif /* !_COMPAT_FREEBSD32_FREEBSD32_H_ */

Modified: stable/8/sys/compat/freebsd32/freebsd32_misc.c
==============================================================================
--- stable/8/sys/compat/freebsd32/freebsd32_misc.c	Wed Apr  7 01:53:00 2010	(r206335)
+++ stable/8/sys/compat/freebsd32/freebsd32_misc.c	Wed Apr  7 02:24:41 2010	(r206336)
@@ -31,6 +31,8 @@ __FBSDID("$FreeBSD$");
 #include "opt_inet.h"
 #include "opt_inet6.h"
 
+#define __ELF_WORD_SIZE 32
+
 #include 
 #include 
 #include 
@@ -44,6 +46,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 		/* Must come after sys/malloc.h */
+#include 
 #include 
 #include 
 #include 
@@ -91,6 +94,7 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
+#include 
 
 #include 
 
@@ -115,6 +119,16 @@ CTASSERT(sizeof(struct sigaction32) == 2
 static int freebsd32_kevent_copyout(void *arg, struct kevent *kevp, int count);
 static int freebsd32_kevent_copyin(void *arg, struct kevent *kevp, int count);
 
+#if BYTE_ORDER == BIG_ENDIAN
+#define PAIR32TO64(type, name) ((name ## 2) | ((type)(name ## 1) << 32))
+#define RETVAL_HI 0	
+#define RETVAL_LO 1	
+#else
+#define PAIR32TO64(type, name) ((name ## 1) | ((type)(name ## 2) << 32))
+#define RETVAL_HI 1	
+#define RETVAL_LO 0	
+#endif
+
 int
 freebsd32_wait4(struct thread *td, struct freebsd32_wait4_args *uap)
 {
@@ -426,8 +440,7 @@ freebsd32_mmap(struct thread *td, struct
 	int prot	 = uap->prot;
 	int flags	 = uap->flags;
 	int fd		 = uap->fd;
-	off_t pos	 = (uap->poslo
-			    | ((off_t)uap->poshi << 32));
+	off_t pos	 = PAIR32TO64(off_t,uap->pos);
 #ifdef __ia64__
 	vm_size_t pageoff;
 	int error;
@@ -523,8 +536,8 @@ freebsd6_freebsd32_mmap(struct thread *t
 	ap.prot = uap->prot;
 	ap.flags = uap->flags;
 	ap.fd = uap->fd;
-	ap.poslo = uap->poslo;
-	ap.poshi = uap->poshi;
+	ap.pos1 = uap->pos1;
+	ap.pos2 = uap->pos2;
 
 	return (freebsd32_mmap(td, &ap));
 }
@@ -586,7 +599,6 @@ freebsd32_select(struct thread *td, stru
 	} else
 		tvp = NULL;
 	/*
-	 * XXX big-endian needs to convert the fd_sets too.
 	 * XXX Do pointers need PTRIN()?
 	 */
 	return (kern_select(td, uap->nd, uap->in, uap->ou, uap->ex, tvp,
@@ -620,7 +632,6 @@ freebsd32_pselect(struct thread *td, str
 	} else
 		uset = NULL;
 	/*
-	 * XXX big-endian needs to convert the fd_sets too.
 	 * XXX Do pointers need PTRIN()?
 	 */
 	error = kern_pselect(td, uap->nd, uap->in, uap->ou, uap->ex, tvp,
@@ -843,7 +854,7 @@ freebsd32_preadv(struct thread *td, stru
 	error = freebsd32_copyinuio(uap->iovp, uap->iovcnt, &auio);
 	if (error)
 		return (error);
-	error = kern_preadv(td, uap->fd, auio, uap->offset);
+	error = kern_preadv(td, uap->fd, auio, PAIR32TO64(off_t,uap->offset));
 	free(auio, M_IOV);
 	return (error);
 }
@@ -857,7 +868,7 @@ freebsd32_pwritev(struct thread *td, str
 	error = freebsd32_copyinuio(uap->iovp, uap->iovcnt, &auio);
 	if (error)
 		return (error);
-	error = kern_pwritev(td, uap->fd, auio, uap->offset);
+	error = kern_pwritev(td, uap->fd, auio, PAIR32TO64(off_t,uap->offset));
 	free(auio, M_IOV);
 	return (error);
 }
@@ -1982,7 +1993,7 @@ freebsd32_pread(struct thread *td, struc
 	ap.fd = uap->fd;
 	ap.buf = uap->buf;
 	ap.nbyte = uap->nbyte;
-	ap.offset = (uap->offsetlo | ((off_t)uap->offsethi << 32));
+	ap.offset = PAIR32TO64(off_t,uap->offset);
 	return (pread(td, &ap));
 }
 
@@ -1994,7 +2005,7 @@ freebsd32_pwrite(struct thread *td, stru
 	ap.fd = uap->fd;
 	ap.buf = uap->buf;
 	ap.nbyte = uap->nbyte;
-	ap.offset = (uap->offsetlo | ((off_t)uap->offsethi << 32));
+	ap.offset = PAIR32TO64(off_t,uap->offset);
 	return (pwrite(td, &ap));
 }
 
@@ -2006,13 +2017,13 @@ freebsd32_lseek(struct thread *td, struc
 	off_t pos;
 
 	ap.fd = uap->fd;
-	ap.offset = (uap->offsetlo | ((off_t)uap->offsethi << 32));
+	ap.offset = PAIR32TO64(off_t,uap->offset);
 	ap.whence = uap->whence;
 	error = lseek(td, &ap);
 	/* Expand the quad return into two parts for eax and edx */
 	pos = *(off_t *)(td->td_retval);
-	td->td_retval[0] = pos & 0xffffffff;	/* %eax */
-	td->td_retval[1] = pos >> 32;		/* %edx */
+	td->td_retval[RETVAL_LO] = pos & 0xffffffff;	/* %eax */
+	td->td_retval[RETVAL_HI] = pos >> 32;		/* %edx */
 	return error;
 }
 
@@ -2022,7 +2033,7 @@ freebsd32_truncate(struct thread *td, st
 	struct truncate_args ap;
 
 	ap.path = uap->path;
-	ap.length = (uap->lengthlo | ((off_t)uap->lengthhi << 32));
+	ap.length = PAIR32TO64(off_t,uap->length);
 	return (truncate(td, &ap));
 }
 
@@ -2032,7 +2043,7 @@ freebsd32_ftruncate(struct thread *td, s
 	struct ftruncate_args ap;
 
 	ap.fd = uap->fd;
-	ap.length = (uap->lengthlo | ((off_t)uap->lengthhi << 32));
+	ap.length = PAIR32TO64(off_t,uap->length);
 	return (ftruncate(td, &ap));
 }
 
@@ -2064,7 +2075,7 @@ freebsd6_freebsd32_pread(struct thread *
 	ap.fd = uap->fd;
 	ap.buf = uap->buf;
 	ap.nbyte = uap->nbyte;
-	ap.offset = (uap->offsetlo | ((off_t)uap->offsethi << 32));
+	ap.offset = PAIR32TO64(off_t,uap->offset);
 	return (pread(td, &ap));
 }
 
@@ -2076,7 +2087,7 @@ freebsd6_freebsd32_pwrite(struct thread 
 	ap.fd = uap->fd;
 	ap.buf = uap->buf;
 	ap.nbyte = uap->nbyte;
-	ap.offset = (uap->offsetlo | ((off_t)uap->offsethi << 32));
+	ap.offset = PAIR32TO64(off_t,uap->offset);
 	return (pwrite(td, &ap));
 }
 
@@ -2088,13 +2099,13 @@ freebsd6_freebsd32_lseek(struct thread *
 	off_t pos;
 
 	ap.fd = uap->fd;
-	ap.offset = (uap->offsetlo | ((off_t)uap->offsethi << 32));
+	ap.offset = PAIR32TO64(off_t,uap->offset);
 	ap.whence = uap->whence;
 	error = lseek(td, &ap);
 	/* Expand the quad return into two parts for eax and edx */
 	pos = *(off_t *)(td->td_retval);
-	td->td_retval[0] = pos & 0xffffffff;	/* %eax */
-	td->td_retval[1] = pos >> 32;		/* %edx */
+	td->td_retval[RETVAL_LO] = pos & 0xffffffff;	/* %eax */
+	td->td_retval[RETVAL_HI] = pos >> 32;		/* %edx */
 	return error;
 }
 
@@ -2104,7 +2115,7 @@ freebsd6_freebsd32_truncate(struct threa
 	struct truncate_args ap;
 
 	ap.path = uap->path;
-	ap.length = (uap->lengthlo | ((off_t)uap->lengthhi << 32));
+	ap.length = PAIR32TO64(off_t,uap->length);
 	return (truncate(td, &ap));
 }
 
@@ -2114,7 +2125,7 @@ freebsd6_freebsd32_ftruncate(struct thre
 	struct ftruncate_args ap;
 
 	ap.fd = uap->fd;
-	ap.length = (uap->lengthlo | ((off_t)uap->lengthhi << 32));
+	ap.length = PAIR32TO64(off_t,uap->length);
 	return (ftruncate(td, &ap));
 }
 #endif /* COMPAT_FREEBSD6 */
@@ -2141,7 +2152,7 @@ freebsd32_do_sendfile(struct thread *td,
 
 	ap.fd = uap->fd;
 	ap.s = uap->s;
-	ap.offset = (uap->offsetlo | ((off_t)uap->offsethi << 32));
+	ap.offset = PAIR32TO64(off_t,uap->offset);
 	ap.nbytes = uap->nbytes;
 	ap.hdtr = (struct sf_hdtr *)uap->hdtr;		/* XXX not used */
 	ap.sbytes = uap->sbytes;
@@ -2879,7 +2890,7 @@ freebsd32_cpuset_setid(struct thread *td
 	struct cpuset_setid_args ap;
 
 	ap.which = uap->which;
-	ap.id = (uap->idlo | ((id_t)uap->idhi << 32));
+	ap.id = PAIR32TO64(id_t,uap->id);
 	ap.setid = uap->setid;
 
 	return (cpuset_setid(td, &ap));
@@ -2893,7 +2904,7 @@ freebsd32_cpuset_getid(struct thread *td
 
 	ap.level = uap->level;
 	ap.which = uap->which;
-	ap.id = (uap->idlo | ((id_t)uap->idhi << 32));
+	ap.id = PAIR32TO64(id_t,uap->id);
 	ap.setid = uap->setid;
 
 	return (cpuset_getid(td, &ap));
@@ -2907,7 +2918,7 @@ freebsd32_cpuset_getaffinity(struct thre
 
 	ap.level = uap->level;
 	ap.which = uap->which;
-	ap.id = (uap->idlo | ((id_t)uap->idhi << 32));
+	ap.id = PAIR32TO64(id_t,uap->id);
 	ap.cpusetsize = uap->cpusetsize;
 	ap.mask = uap->mask;
 
@@ -2922,7 +2933,7 @@ freebsd32_cpuset_setaffinity(struct thre
 
 	ap.level = uap->level;
 	ap.which = uap->which;
-	ap.id = (uap->idlo | ((id_t)uap->idhi << 32));
+	ap.id = PAIR32TO64(id_t,uap->id);
 	ap.cpusetsize = uap->cpusetsize;
 	ap.mask = uap->mask;
 
@@ -3072,3 +3083,123 @@ syscall32_module_handler(struct module *
 		return (error);
 	}
 }
+
+register_t *
+freebsd32_copyout_strings(struct image_params *imgp)
+{
+	int argc, envc;
+	u_int32_t *vectp;
+	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 *));
+
+	/*
+	 * install sigcode
+	 */
+	if (szsigcode)
+		copyout(imgp->proc->p_sysent->sv_sigcode,
+			((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.
+	 */
+	if (imgp->auxargs) {
+		/*
+		 * 'AT_COUNT*2' is size for the ELF Auxargs data. This is for
+		 * lower compatibility.
+		 */
+		imgp->auxarg_size = (imgp->auxarg_size) ? imgp->auxarg_size
+			: (AT_COUNT * 2);
+		/*
+		 * The '+ 2' is for the null pointers at the end of each of
+		 * 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 + execpath_len) *
+		    sizeof(u_int32_t));
+	} else
+		/*
+		 * The '+ 2' is for the null pointers at the end of each of
+		 * the arg and env vector sets
+		 */
+		vectp = (u_int32_t *)
+			(destp - (imgp->args->argc + imgp->args->envc + 2) * sizeof(u_int32_t));
+
+	/*
+	 * vectp also becomes our initial stack base
+	 */
+	stack_base = vectp;
+
+	stringp = imgp->args->begin_argv;
+	argc = imgp->args->argc;
+	envc = imgp->args->envc;
+	/*
+	 * Copy out strings - arguments and environment.
+	 */
+	copyout(stringp, destp, ARG_MAX - imgp->args->stringspace);
+
+	/*
+	 * Fill in "ps_strings" struct for ps, w, etc.
+	 */
+	suword32(&arginfo->ps_argvstr, (u_int32_t)(intptr_t)vectp);
+	suword32(&arginfo->ps_nargvstr, argc);
+
+	/*
+	 * Fill in argument portion of vector table.
+	 */
+	for (; argc > 0; --argc) {
+		suword32(vectp++, (u_int32_t)(intptr_t)destp);
+		while (*stringp++ != 0)
+			destp++;
+		destp++;
+	}
+
+	/* a null vector table pointer separates the argp's from the envp's */
+	suword32(vectp++, 0);
+
+	suword32(&arginfo->ps_envstr, (u_int32_t)(intptr_t)vectp);
+	suword32(&arginfo->ps_nenvstr, envc);
+
+	/*
+	 * Fill in environment portion of vector table.
+	 */
+	for (; envc > 0; --envc) {
+		suword32(vectp++, (u_int32_t)(intptr_t)destp);
+		while (*stringp++ != 0)
+			destp++;
+		destp++;
+	}
+
+	/* end of vector table is a null pointer */
+	suword32(vectp, 0);
+
+	return ((register_t *)stack_base);
+}
+

Modified: stable/8/sys/compat/freebsd32/freebsd32_util.h
==============================================================================
--- stable/8/sys/compat/freebsd32/freebsd32_util.h	Wed Apr  7 01:53:00 2010	(r206335)
+++ stable/8/sys/compat/freebsd32/freebsd32_util.h	Wed Apr  7 02:24:41 2010	(r206336)
@@ -83,4 +83,6 @@ int    syscall32_register(int *offset, s
 int    syscall32_deregister(int *offset, struct sysent *old_sysent);
 int    syscall32_module_handler(struct module *mod, int what, void *arg);
 
+register_t *freebsd32_copyout_strings(struct image_params *imgp);
+
 #endif /* !_COMPAT_FREEBSD32_FREEBSD32_UTIL_H_ */

Modified: stable/8/sys/compat/freebsd32/syscalls.master
==============================================================================
--- stable/8/sys/compat/freebsd32/syscalls.master	Wed Apr  7 01:53:00 2010	(r206335)
+++ stable/8/sys/compat/freebsd32/syscalls.master	Wed Apr  7 02:24:41 2010	(r206336)
@@ -53,6 +53,10 @@
 #include 
 #include 
 
+#if !defined(PAD64_REQUIRED) && defined(__powerpc__)
+#define PAD64_REQUIRED
+#endif
+
 ; Reserved/unimplemented system calls in the range 0-150 inclusive
 ; are reserved for use in future Berkeley releases.
 ; Additional system calls implemented in vendor and other
@@ -195,7 +199,6 @@
 93	AUE_SELECT	STD	{ int freebsd32_select(int nd, fd_set *in, \
 				    fd_set *ou, fd_set *ex, \
 				    struct timeval32 *tv); }
-; XXX need to override for big-endian - little-endian should work fine.
 94	AUE_NULL	UNIMPL	setdopt
 95	AUE_FSYNC	NOPROTO	{ int fsync(int fd); }
 96	AUE_SETPRIORITY	NOPROTO	{ int setpriority(int which, int who, \
@@ -316,12 +319,10 @@
 172	AUE_NULL	UNIMPL	nosys
 173	AUE_PREAD	COMPAT6	{ ssize_t freebsd32_pread(int fd, void *buf, \
 				    size_t nbyte, int pad, \
-				    u_int32_t offsetlo, u_int32_t offsethi); }
-; XXX note - bigendian is different
+				    u_int32_t offset1, u_int32_t offset2); }
 174	AUE_PWRITE	COMPAT6	{ ssize_t freebsd32_pwrite(int fd, \
 				    const void *buf, size_t nbyte, int pad, \
-				    u_int32_t offsetlo, u_int32_t offsethi); }
-; XXX note - bigendian is different
+				    u_int32_t offset1, u_int32_t offset2); }
 175	AUE_NULL	UNIMPL	nosys
 176	AUE_NTP_ADJTIME	NOPROTO	{ int ntp_adjtime(struct timex *tp); }
 177	AUE_NULL	UNIMPL	sfork (BSD/OS 2.x)
@@ -356,21 +357,17 @@
 				    char *buf, u_int count, int32_t *basep); }
 197	AUE_MMAP	COMPAT6	{ caddr_t freebsd32_mmap(caddr_t addr, \
 				    size_t len, int prot, int flags, int fd, \
-				    int pad, u_int32_t poslo, \
-				    u_int32_t poshi); }
+				    int pad, u_int32_t pos1, u_int32_t pos2); }
 198	AUE_NULL	NOPROTO	{ int nosys(void); } __syscall \
 				    __syscall_args int
-; XXX note - bigendian is different
 199	AUE_LSEEK	COMPAT6	{ off_t freebsd32_lseek(int fd, int pad, \
-				    u_int32_t offsetlo, u_int32_t offsethi, \
+				    u_int32_t offset1, u_int32_t offset2, \
 				    int whence); }
-; XXX note - bigendian is different
 200	AUE_TRUNCATE	COMPAT6	{ int freebsd32_truncate(char *path, \
-				    int pad, u_int32_t lengthlo, \
-				    u_int32_t lengthhi); }
-; XXX note - bigendian is different
+				    int pad, u_int32_t length1, \
+				    u_int32_t length2); }
 201	AUE_FTRUNCATE	COMPAT6	{ int freebsd32_ftruncate(int fd, int pad, \
-				    u_int32_t lengthlo, u_int32_t lengthhi); }
+				    u_int32_t length1, u_int32_t length2); }
 202	AUE_SYSCTL	STD	{ int freebsd32_sysctl(int *name, \
 				    u_int namelen, void *old, \
 				    u_int32_t *oldlenp, void *new, \
@@ -403,7 +400,7 @@
 
 ;
 ; The following were introduced with NetBSD/4.4Lite-2
-; They are initialized by thier respective modules/sysinits
+; They are initialized by their respective modules/sysinits
 ; XXX PROBLEM!!
 220	AUE_SEMCTL	COMPAT7	{ int freebsd32_semctl(int semid, int semnum, \
 				    int cmd, union semun32 *arg); }
@@ -504,12 +501,12 @@
 ; 289 and 290 from NetBSD (OpenBSD: 267 and 268)
 289	AUE_PREADV	STD	{ ssize_t freebsd32_preadv(int fd, \
 					struct iovec32 *iovp, \
-					u_int iovcnt, off_t offset); }
-; XXX note - bigendian is different
+					u_int iovcnt, \
+					u_int32_t offset1, u_int32_t offset2); }
 290	AUE_PWRITEV	STD	{ ssize_t freebsd32_pwritev(int fd, \
 					struct iovec32 *iovp, \
-					u_int iovcnt, off_t offset); }
-; XXX note - bigendian is different
+					u_int iovcnt, \
+					u_int32_t offset1, u_int32_t offset2); }
 291	AUE_NULL	UNIMPL	nosys
 292	AUE_NULL	UNIMPL	nosys
 293	AUE_NULL	UNIMPL	nosys
@@ -582,9 +579,8 @@
 334	AUE_NULL	NOPROTO	{ int sched_rr_get_interval (pid_t pid, \
 				    struct timespec *interval); }
 335	AUE_NULL	NOPROTO	{ int utrace(const void *addr, size_t len); }
-; XXX note - bigendian is different
 336	AUE_SENDFILE	COMPAT4	{ int freebsd32_sendfile(int fd, int s, \
-				    u_int32_t offsetlo, u_int32_t offsethi, \
+				    u_int32_t offset1, u_int32_t offset2, \
 				    size_t nbytes, struct sf_hdtr32 *hdtr, \
 				    off_t *sbytes, int flags); }
 337	AUE_NULL	NOPROTO	{ int kldsym(int fileid, int cmd, \
@@ -687,7 +683,7 @@
 392	AUE_NULL	NOPROTO	{ int uuidgen(struct uuid *store, \
 				    int count); }
 393	AUE_SENDFILE	STD	{ int freebsd32_sendfile(int fd, int s, \
-				    u_int32_t offsetlo, u_int32_t offsethi, \
+				    u_int32_t offset1, u_int32_t offset2, \
 				    size_t nbytes, struct sf_hdtr32 *hdtr, \
 				    off_t *sbytes, int flags); }
 394	AUE_NULL	UNIMPL	mac_syscall
@@ -821,42 +817,74 @@
 474	AUE_NULL	NOPROTO	{ int sctp_generic_recvmsg(int sd, struct iovec *iov, int iovlen, \
 				    struct sockaddr * from, __socklen_t *fromlenaddr, \
 				    struct sctp_sndrcvinfo *sinfo, int *msg_flags); }
+#ifdef PAD64_REQUIRED
 475	AUE_PREAD	STD	{ ssize_t freebsd32_pread(int fd, \
 				    void *buf,size_t nbyte, \
-				    u_int32_t offsetlo, u_int32_t offsethi); }
+				    int pad, \
+				    u_int32_t offset1, u_int32_t offset2); }
 476	AUE_PWRITE	STD	{ ssize_t freebsd32_pwrite(int fd, \
 				    const void *buf, size_t nbyte, \
-				    u_int32_t offsetlo, u_int32_t offsethi); }
+				    int pad, \
+				    u_int32_t offset1, u_int32_t offset2); }
 477	AUE_MMAP	STD 	{ caddr_t freebsd32_mmap(caddr_t addr, \
 				    size_t len, int prot, int flags, int fd, \
-				    u_int32_t poslo, u_int32_t poshi); }
+				    int pad, \
+				    u_int32_t pos1, u_int32_t pos2); }
 478	AUE_LSEEK	STD	{ off_t freebsd32_lseek(int fd, \
-				    u_int32_t offsetlo, u_int32_t offsethi, \
+				    int pad, \
+				    u_int32_t offset1, u_int32_t offset2, \
 				    int whence); }
 479	AUE_TRUNCATE	STD	{ int freebsd32_truncate(char *path, \
-				    u_int32_t lengthlo, u_int32_t lengthhi); }
+				    int pad, \
+				    u_int32_t length1, u_int32_t length2); }
 480	AUE_FTRUNCATE	STD	{ int freebsd32_ftruncate(int fd, \
-				    u_int32_t lengthlo, u_int32_t lengthhi); }
+				    int pad, \
+				    u_int32_t length1, u_int32_t length2); }
+#else
+475	AUE_PREAD	STD	{ ssize_t freebsd32_pread(int fd, \
+				    void *buf,size_t nbyte, \
+				    u_int32_t offset1, u_int32_t offset2); }
+476	AUE_PWRITE	STD	{ ssize_t freebsd32_pwrite(int fd, \
+				    const void *buf, size_t nbyte, \
+				    u_int32_t offset1, u_int32_t offset2); }
+477	AUE_MMAP	STD 	{ caddr_t freebsd32_mmap(caddr_t addr, \
+				    size_t len, int prot, int flags, int fd, \
+				    u_int32_t pos1, u_int32_t pos2); }
+478	AUE_LSEEK	STD	{ off_t freebsd32_lseek(int fd, \
+				    u_int32_t offset1, u_int32_t offset2, \
+				    int whence); }
+479	AUE_TRUNCATE	STD	{ int freebsd32_truncate(char *path, \
+				    u_int32_t length1, u_int32_t length2); }
+480	AUE_FTRUNCATE	STD	{ int freebsd32_ftruncate(int fd, \
+				    u_int32_t length1, u_int32_t length2); }
+#endif
 481	AUE_KILL	NOPROTO	{ int thr_kill2(pid_t pid, long id, int sig); }
 482	AUE_SHMOPEN	NOPROTO	{ int shm_open(const char *path, int flags, \
 				    mode_t mode); }
 483	AUE_SHMUNLINK	NOPROTO	{ int shm_unlink(const char *path); }
 484	AUE_NULL	NOPROTO	{ int cpuset(cpusetid_t *setid); }
+#ifdef PAD64_REQUIRED
+485	AUE_NULL	STD	{ int freebsd32_cpuset_setid(cpuwhich_t which, \
+				    int pad, \
+				    u_int32_t id1, u_int32_t id2, \
+				    cpusetid_t setid); }
+#else
 485	AUE_NULL	STD	{ int freebsd32_cpuset_setid(cpuwhich_t which, \
-				    uint32_t idlo, uint32_t idhi, \
+				    u_int32_t id1, u_int32_t id2, \
 				    cpusetid_t setid); }
+#endif
 486	AUE_NULL	STD	{ int freebsd32_cpuset_getid(cpulevel_t level, \
 				    cpuwhich_t which, \
-				    uint32_t idlo, uint32_t idhi, \
+				    u_int32_t id1, u_int32_t id2, \
 				    cpusetid_t *setid); }
 487	AUE_NULL	STD	{ int freebsd32_cpuset_getaffinity( \
 				    cpulevel_t level, cpuwhich_t which, \
-				    uint32_t idlo, uint32_t idhi, \
+				    u_int32_t id1, u_int32_t id2, \
 				    size_t cpusetsize, \
 				    cpuset_t *mask); }
 488	AUE_NULL	STD	{ int freebsd32_cpuset_setaffinity( \
 				    cpulevel_t level, cpuwhich_t which, \
-				    uint32_t idlo, uint32_t idhi, \
+				    u_int32_t id1, u_int32_t id2, \
 				    size_t cpusetsize, \
 				    const cpuset_t *mask); }
 489	AUE_FACCESSAT	NOPROTO	{ int faccessat(int fd, char *path, int mode, \

Modified: stable/8/sys/compat/ia32/ia32_reg.h
==============================================================================
--- stable/8/sys/compat/ia32/ia32_reg.h	Wed Apr  7 01:53:00 2010	(r206335)
+++ stable/8/sys/compat/ia32/ia32_reg.h	Wed Apr  7 02:24:41 2010	(r206336)
@@ -105,29 +105,6 @@ struct save87 {
 	u_char	sv_pad[64];	/* padding; used by emulators */
 };
 
-
-/*
- * Alternative layouts for 
- * Used in core dumps, the reason for this file existing.
- */
-struct prstatus32 {
-	int	pr_version;
-	u_int	pr_statussz;
-	u_int	pr_gregsetsz;
-	u_int	pr_fpregsetsz;
-	int	pr_osreldate;
-	int	pr_cursig;
-	pid_t	pr_pid;
-	struct reg32 pr_reg;
-};
-
-struct prpsinfo32 {
-	int	pr_version;
-	u_int	pr_psinfosz;
-	char	pr_fname[PRFNAMESZ+1];
-	char	pr_psargs[PRARGSZ+1];
-};
-
 /*
  * Wrappers and converters.
  */

Modified: stable/8/sys/compat/ia32/ia32_sysvec.c
==============================================================================
--- stable/8/sys/compat/ia32/ia32_sysvec.c	Wed Apr  7 01:53:00 2010	(r206335)
+++ stable/8/sys/compat/ia32/ia32_sysvec.c	Wed Apr  7 02:24:41 2010	(r206336)
@@ -93,7 +93,6 @@ CTASSERT(sizeof(struct ia32_ucontext4) =
 CTASSERT(sizeof(struct ia32_sigframe4) == 408);
 #endif
 
-static register_t *ia32_copyout_strings(struct image_params *imgp);
 static void ia32_fixlimit(struct rlimit *rl, int which);
 
 SYSCTL_NODE(_compat, OID_AUTO, ia32, CTLFLAG_RW, 0, "ia32 mode");
@@ -132,7 +131,7 @@ struct sysentvec ia32_freebsd_sysvec = {
 	.sv_usrstack	= FREEBSD32_USRSTACK,
 	.sv_psstrings	= FREEBSD32_PS_STRINGS,
 	.sv_stackprot	= VM_PROT_ALL,
-	.sv_copyout_strings	= ia32_copyout_strings,
+	.sv_copyout_strings	= freebsd32_copyout_strings,
 	.sv_setregs	= ia32_setregs,
 	.sv_fixlimit	= ia32_fixlimit,
 	.sv_maxssiz	= &ia32_maxssiz,
@@ -194,127 +193,6 @@ elf32_dump_thread(struct thread *td __un
 {
 }
 
-
-/* XXX may be freebsd32 MI */
-static register_t *
-ia32_copyout_strings(struct image_params *imgp)
-{
-	int argc, envc;
-	u_int32_t *vectp;
-	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 *));
-
-	/*
-	 * install sigcode
-	 */
-	if (szsigcode)
-		copyout(imgp->proc->p_sysent->sv_sigcode,
-			((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.
-	 */
-	if (imgp->auxargs) {
-		/*
-		 * 'AT_COUNT*2' is size for the ELF Auxargs data. This is for
-		 * lower compatibility.
-		 */
-		imgp->auxarg_size = (imgp->auxarg_size) ? imgp->auxarg_size
-			: (AT_COUNT * 2);
-		/*
-		 * The '+ 2' is for the null pointers at the end of each of
-		 * 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 + execpath_len) *
-		    sizeof(u_int32_t));
-	} else
-		/*
-		 * The '+ 2' is for the null pointers at the end of each of
-		 * the arg and env vector sets
-		 */
-		vectp = (u_int32_t *)
-			(destp - (imgp->args->argc + imgp->args->envc + 2) * sizeof(u_int32_t));
-
-	/*
-	 * vectp also becomes our initial stack base
-	 */
-	stack_base = vectp;
-
-	stringp = imgp->args->begin_argv;
-	argc = imgp->args->argc;
-	envc = imgp->args->envc;
-	/*
-	 * Copy out strings - arguments and environment.
-	 */
-	copyout(stringp, destp, ARG_MAX - imgp->args->stringspace);
-
-	/*
-	 * Fill in "ps_strings" struct for ps, w, etc.
-	 */
-	suword32(&arginfo->ps_argvstr, (u_int32_t)(intptr_t)vectp);
-	suword32(&arginfo->ps_nargvstr, argc);
-
-	/*
-	 * Fill in argument portion of vector table.
-	 */
-	for (; argc > 0; --argc) {
-		suword32(vectp++, (u_int32_t)(intptr_t)destp);
-		while (*stringp++ != 0)
-			destp++;
-		destp++;
-	}
-
-	/* a null vector table pointer separates the argp's from the envp's */
-	suword32(vectp++, 0);
-
-	suword32(&arginfo->ps_envstr, (u_int32_t)(intptr_t)vectp);
-	suword32(&arginfo->ps_nenvstr, envc);
-
-	/*
-	 * Fill in environment portion of vector table.
-	 */
-	for (; envc > 0; --envc) {
-		suword32(vectp++, (u_int32_t)(intptr_t)destp);
-		while (*stringp++ != 0)
-			destp++;
-		destp++;
-	}
-
-	/* end of vector table is a null pointer */
-	suword32(vectp, 0);
-
-	return ((register_t *)stack_base);
-}
-
 static void
 ia32_fixlimit(struct rlimit *rl, int which)
 {

Modified: stable/8/sys/conf/files.amd64
==============================================================================
--- stable/8/sys/conf/files.amd64	Wed Apr  7 01:53:00 2010	(r206335)
+++ stable/8/sys/conf/files.amd64	Wed Apr  7 02:24:41 2010	(r206336)
@@ -236,20 +236,20 @@ kern/link_elf_obj.c		standard
 #
 # IA32 binary support
 #
-#amd64/ia32/ia32_exception.S	optional	compat_ia32
-amd64/ia32/ia32_reg.c		optional	compat_ia32
-amd64/ia32/ia32_signal.c	optional	compat_ia32
-amd64/ia32/ia32_sigtramp.S	optional	compat_ia32
-amd64/ia32/ia32_syscall.c	optional	compat_ia32
-amd64/ia32/ia32_misc.c		optional	compat_ia32
-compat/freebsd32/freebsd32_ioctl.c	optional	compat_ia32
-compat/freebsd32/freebsd32_misc.c	optional	compat_ia32
-compat/freebsd32/freebsd32_syscalls.c	optional	compat_ia32
-compat/freebsd32/freebsd32_sysent.c	optional	compat_ia32
-compat/ia32/ia32_sysvec.c	optional	compat_ia32
+#amd64/ia32/ia32_exception.S	optional	compat_freebsd32
+amd64/ia32/ia32_reg.c		optional	compat_freebsd32
+amd64/ia32/ia32_signal.c	optional	compat_freebsd32
+amd64/ia32/ia32_sigtramp.S	optional	compat_freebsd32
+amd64/ia32/ia32_syscall.c	optional	compat_freebsd32
+amd64/ia32/ia32_misc.c		optional	compat_freebsd32
+compat/freebsd32/freebsd32_ioctl.c	optional	compat_freebsd32
+compat/freebsd32/freebsd32_misc.c	optional	compat_freebsd32
+compat/freebsd32/freebsd32_syscalls.c	optional	compat_freebsd32
+compat/freebsd32/freebsd32_sysent.c	optional	compat_freebsd32
+compat/ia32/ia32_sysvec.c	optional	compat_freebsd32
 compat/linprocfs/linprocfs.c	optional	linprocfs
 compat/linsysfs/linsysfs.c	optional	linsysfs
-kern/imgact_elf32.c		optional	compat_ia32
+kern/imgact_elf32.c		optional	compat_freebsd32
 #
 # Linux/i386 binary support
 #

Modified: stable/8/sys/conf/files.ia64
==============================================================================
--- stable/8/sys/conf/files.ia64	Wed Apr  7 01:53:00 2010	(r206335)
+++ stable/8/sys/conf/files.ia64	Wed Apr  7 02:24:41 2010	(r206336)
@@ -28,11 +28,11 @@ ukbdmap.h			optional	ukbd_dflt_keymap	\
 	no-obj no-implicit-rule before-depend				\
 	clean		"ukbdmap.h"
 #
-compat/freebsd32/freebsd32_ioctl.c	optional	compat_ia32
-compat/freebsd32/freebsd32_misc.c	optional	compat_ia32
-compat/freebsd32/freebsd32_syscalls.c	optional	compat_ia32
-compat/freebsd32/freebsd32_sysent.c	optional	compat_ia32
-compat/ia32/ia32_sysvec.c		optional	compat_ia32
+compat/freebsd32/freebsd32_ioctl.c	optional	compat_freebsd32
+compat/freebsd32/freebsd32_misc.c	optional	compat_freebsd32
+compat/freebsd32/freebsd32_syscalls.c	optional	compat_freebsd32
+compat/freebsd32/freebsd32_sysent.c	optional	compat_freebsd32
+compat/ia32/ia32_sysvec.c		optional	compat_freebsd32
 contrib/ia64/libuwx/src/uwx_bstream.c		standard
 contrib/ia64/libuwx/src/uwx_context.c		standard
 contrib/ia64/libuwx/src/uwx_env.c		standard
@@ -69,10 +69,10 @@ ia64/acpica/madt.c		optional	acpi
 ia64/disasm/disasm_decode.c	standard
 ia64/disasm/disasm_extract.c	standard
 ia64/disasm/disasm_format.c	standard
-ia64/ia32/ia32_misc.c		optional	compat_ia32

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

From owner-svn-src-stable-8@FreeBSD.ORG  Wed Apr  7 02:25:36 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BE1B01065670;
	Wed,  7 Apr 2010 02:25:36 +0000 (UTC)
	(envelope-from nwhitehorn@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id AB25E8FC0A;
	Wed,  7 Apr 2010 02:25:36 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o372PaO5058271;
	Wed, 7 Apr 2010 02:25:36 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Received: (from nwhitehorn@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o372Pal4058266;
	Wed, 7 Apr 2010 02:25:36 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Message-Id: <201004070225.o372Pal4058266@svn.freebsd.org>
From: Nathan Whitehorn 
Date: Wed, 7 Apr 2010 02:25:36 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206337 - stable/8/sys/compat/freebsd32
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Wed, 07 Apr 2010 02:25:36 -0000

Author: nwhitehorn
Date: Wed Apr  7 02:25:36 2010
New Revision: 206337
URL: http://svn.freebsd.org/changeset/base/206337

Log:
  Regen after MFC of COMPAT_FREEBSD32.

Modified:
  stable/8/sys/compat/freebsd32/freebsd32_proto.h
  stable/8/sys/compat/freebsd32/freebsd32_syscall.h
  stable/8/sys/compat/freebsd32/freebsd32_syscalls.c
  stable/8/sys/compat/freebsd32/freebsd32_sysent.c

Modified: stable/8/sys/compat/freebsd32/freebsd32_proto.h
==============================================================================
--- stable/8/sys/compat/freebsd32/freebsd32_proto.h	Wed Apr  7 02:24:41 2010	(r206336)
+++ stable/8/sys/compat/freebsd32/freebsd32_proto.h	Wed Apr  7 02:25:36 2010	(r206337)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 200725 2009-12-19 11:47:00Z kib 
+ * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 206336 2010-04-07 02:24:41Z nwhitehorn 
  */
 
 #ifndef _FREEBSD32_SYSPROTO_H_
@@ -32,6 +32,9 @@ struct thread;
 #define	PADR_(t)	0
 #endif
 
+#if !defined(PAD64_REQUIRED) && defined(__powerpc__)
+#define PAD64_REQUIRED
+#endif
 struct freebsd32_wait4_args {
 	char pid_l_[PADL_(int)]; int pid; char pid_r_[PADR_(int)];
 	char status_l_[PADL_(int *)]; int * status; char status_r_[PADR_(int *)];
@@ -223,13 +226,15 @@ struct freebsd32_preadv_args {
 	char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
 	char iovp_l_[PADL_(struct iovec32 *)]; struct iovec32 * iovp; char iovp_r_[PADR_(struct iovec32 *)];
 	char iovcnt_l_[PADL_(u_int)]; u_int iovcnt; char iovcnt_r_[PADR_(u_int)];
-	char offset_l_[PADL_(off_t)]; off_t offset; char offset_r_[PADR_(off_t)];
+	char offset1_l_[PADL_(u_int32_t)]; u_int32_t offset1; char offset1_r_[PADR_(u_int32_t)];
+	char offset2_l_[PADL_(u_int32_t)]; u_int32_t offset2; char offset2_r_[PADR_(u_int32_t)];
 };
 struct freebsd32_pwritev_args {
 	char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
 	char iovp_l_[PADL_(struct iovec32 *)]; struct iovec32 * iovp; char iovp_r_[PADR_(struct iovec32 *)];
 	char iovcnt_l_[PADL_(u_int)]; u_int iovcnt; char iovcnt_r_[PADR_(u_int)];
-	char offset_l_[PADL_(off_t)]; off_t offset; char offset_r_[PADR_(off_t)];
+	char offset1_l_[PADL_(u_int32_t)]; u_int32_t offset1; char offset1_r_[PADR_(u_int32_t)];
+	char offset2_l_[PADL_(u_int32_t)]; u_int32_t offset2; char offset2_r_[PADR_(u_int32_t)];
 };
 struct freebsd32_modstat_args {
 	char modid_l_[PADL_(int)]; int modid; char modid_r_[PADR_(int)];
@@ -294,8 +299,8 @@ struct freebsd32_nmount_args {
 struct freebsd32_sendfile_args {
 	char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
 	char s_l_[PADL_(int)]; int s; char s_r_[PADR_(int)];
-	char offsetlo_l_[PADL_(u_int32_t)]; u_int32_t offsetlo; char offsetlo_r_[PADR_(u_int32_t)];
-	char offsethi_l_[PADL_(u_int32_t)]; u_int32_t offsethi; char offsethi_r_[PADR_(u_int32_t)];
+	char offset1_l_[PADL_(u_int32_t)]; u_int32_t offset1; char offset1_r_[PADR_(u_int32_t)];
+	char offset2_l_[PADL_(u_int32_t)]; u_int32_t offset2; char offset2_r_[PADR_(u_int32_t)];
 	char nbytes_l_[PADL_(size_t)]; size_t nbytes; char nbytes_r_[PADR_(size_t)];
 	char hdtr_l_[PADL_(struct sf_hdtr32 *)]; struct sf_hdtr32 * hdtr; char hdtr_r_[PADR_(struct sf_hdtr32 *)];
 	char sbytes_l_[PADL_(off_t *)]; off_t * sbytes; char sbytes_r_[PADR_(off_t *)];
@@ -343,19 +348,22 @@ struct freebsd32_aio_fsync_args {
 	char op_l_[PADL_(int)]; int op; char op_r_[PADR_(int)];
 	char aiocbp_l_[PADL_(struct aiocb32 *)]; struct aiocb32 * aiocbp; char aiocbp_r_[PADR_(struct aiocb32 *)];
 };
+#ifdef PAD64_REQUIRED
 struct freebsd32_pread_args {
 	char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
 	char buf_l_[PADL_(void *)]; void * buf; char buf_r_[PADR_(void *)];
 	char nbyte_l_[PADL_(size_t)]; size_t nbyte; char nbyte_r_[PADR_(size_t)];
-	char offsetlo_l_[PADL_(u_int32_t)]; u_int32_t offsetlo; char offsetlo_r_[PADR_(u_int32_t)];
-	char offsethi_l_[PADL_(u_int32_t)]; u_int32_t offsethi; char offsethi_r_[PADR_(u_int32_t)];
+	char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)];
+	char offset1_l_[PADL_(u_int32_t)]; u_int32_t offset1; char offset1_r_[PADR_(u_int32_t)];
+	char offset2_l_[PADL_(u_int32_t)]; u_int32_t offset2; char offset2_r_[PADR_(u_int32_t)];
 };
 struct freebsd32_pwrite_args {
 	char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
 	char buf_l_[PADL_(const void *)]; const void * buf; char buf_r_[PADR_(const void *)];
 	char nbyte_l_[PADL_(size_t)]; size_t nbyte; char nbyte_r_[PADR_(size_t)];
-	char offsetlo_l_[PADL_(u_int32_t)]; u_int32_t offsetlo; char offsetlo_r_[PADR_(u_int32_t)];
-	char offsethi_l_[PADL_(u_int32_t)]; u_int32_t offsethi; char offsethi_r_[PADR_(u_int32_t)];
+	char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)];
+	char offset1_l_[PADL_(u_int32_t)]; u_int32_t offset1; char offset1_r_[PADR_(u_int32_t)];
+	char offset2_l_[PADL_(u_int32_t)]; u_int32_t offset2; char offset2_r_[PADR_(u_int32_t)];
 };
 struct freebsd32_mmap_args {
 	char addr_l_[PADL_(caddr_t)]; caddr_t addr; char addr_r_[PADR_(caddr_t)];
@@ -363,51 +371,106 @@ struct freebsd32_mmap_args {
 	char prot_l_[PADL_(int)]; int prot; char prot_r_[PADR_(int)];
 	char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)];
 	char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
-	char poslo_l_[PADL_(u_int32_t)]; u_int32_t poslo; char poslo_r_[PADR_(u_int32_t)];
-	char poshi_l_[PADL_(u_int32_t)]; u_int32_t poshi; char poshi_r_[PADR_(u_int32_t)];
+	char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)];
+	char pos1_l_[PADL_(u_int32_t)]; u_int32_t pos1; char pos1_r_[PADR_(u_int32_t)];
+	char pos2_l_[PADL_(u_int32_t)]; u_int32_t pos2; char pos2_r_[PADR_(u_int32_t)];
 };
 struct freebsd32_lseek_args {
 	char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
-	char offsetlo_l_[PADL_(u_int32_t)]; u_int32_t offsetlo; char offsetlo_r_[PADR_(u_int32_t)];
-	char offsethi_l_[PADL_(u_int32_t)]; u_int32_t offsethi; char offsethi_r_[PADR_(u_int32_t)];
+	char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)];
+	char offset1_l_[PADL_(u_int32_t)]; u_int32_t offset1; char offset1_r_[PADR_(u_int32_t)];
+	char offset2_l_[PADL_(u_int32_t)]; u_int32_t offset2; char offset2_r_[PADR_(u_int32_t)];
 	char whence_l_[PADL_(int)]; int whence; char whence_r_[PADR_(int)];
 };
 struct freebsd32_truncate_args {
 	char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
-	char lengthlo_l_[PADL_(u_int32_t)]; u_int32_t lengthlo; char lengthlo_r_[PADR_(u_int32_t)];
-	char lengthhi_l_[PADL_(u_int32_t)]; u_int32_t lengthhi; char lengthhi_r_[PADR_(u_int32_t)];
+	char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)];
+	char length1_l_[PADL_(u_int32_t)]; u_int32_t length1; char length1_r_[PADR_(u_int32_t)];
+	char length2_l_[PADL_(u_int32_t)]; u_int32_t length2; char length2_r_[PADR_(u_int32_t)];
 };
 struct freebsd32_ftruncate_args {
 	char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
-	char lengthlo_l_[PADL_(u_int32_t)]; u_int32_t lengthlo; char lengthlo_r_[PADR_(u_int32_t)];
-	char lengthhi_l_[PADL_(u_int32_t)]; u_int32_t lengthhi; char lengthhi_r_[PADR_(u_int32_t)];
+	char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)];
+	char length1_l_[PADL_(u_int32_t)]; u_int32_t length1; char length1_r_[PADR_(u_int32_t)];
+	char length2_l_[PADL_(u_int32_t)]; u_int32_t length2; char length2_r_[PADR_(u_int32_t)];
+};
+#else
+struct freebsd32_pread_args {
+	char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
+	char buf_l_[PADL_(void *)]; void * buf; char buf_r_[PADR_(void *)];
+	char nbyte_l_[PADL_(size_t)]; size_t nbyte; char nbyte_r_[PADR_(size_t)];
+	char offset1_l_[PADL_(u_int32_t)]; u_int32_t offset1; char offset1_r_[PADR_(u_int32_t)];
+	char offset2_l_[PADL_(u_int32_t)]; u_int32_t offset2; char offset2_r_[PADR_(u_int32_t)];
+};
+struct freebsd32_pwrite_args {
+	char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
+	char buf_l_[PADL_(const void *)]; const void * buf; char buf_r_[PADR_(const void *)];
+	char nbyte_l_[PADL_(size_t)]; size_t nbyte; char nbyte_r_[PADR_(size_t)];
+	char offset1_l_[PADL_(u_int32_t)]; u_int32_t offset1; char offset1_r_[PADR_(u_int32_t)];
+	char offset2_l_[PADL_(u_int32_t)]; u_int32_t offset2; char offset2_r_[PADR_(u_int32_t)];
+};
+struct freebsd32_mmap_args {
+	char addr_l_[PADL_(caddr_t)]; caddr_t addr; char addr_r_[PADR_(caddr_t)];
+	char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)];
+	char prot_l_[PADL_(int)]; int prot; char prot_r_[PADR_(int)];
+	char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)];
+	char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
+	char pos1_l_[PADL_(u_int32_t)]; u_int32_t pos1; char pos1_r_[PADR_(u_int32_t)];
+	char pos2_l_[PADL_(u_int32_t)]; u_int32_t pos2; char pos2_r_[PADR_(u_int32_t)];
+};
+struct freebsd32_lseek_args {
+	char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
+	char offset1_l_[PADL_(u_int32_t)]; u_int32_t offset1; char offset1_r_[PADR_(u_int32_t)];
+	char offset2_l_[PADL_(u_int32_t)]; u_int32_t offset2; char offset2_r_[PADR_(u_int32_t)];
+	char whence_l_[PADL_(int)]; int whence; char whence_r_[PADR_(int)];
+};
+struct freebsd32_truncate_args {
+	char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
+	char length1_l_[PADL_(u_int32_t)]; u_int32_t length1; char length1_r_[PADR_(u_int32_t)];
+	char length2_l_[PADL_(u_int32_t)]; u_int32_t length2; char length2_r_[PADR_(u_int32_t)];
+};
+struct freebsd32_ftruncate_args {
+	char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
+	char length1_l_[PADL_(u_int32_t)]; u_int32_t length1; char length1_r_[PADR_(u_int32_t)];
+	char length2_l_[PADL_(u_int32_t)]; u_int32_t length2; char length2_r_[PADR_(u_int32_t)];
+};
+#endif
+#ifdef PAD64_REQUIRED
+struct freebsd32_cpuset_setid_args {
+	char which_l_[PADL_(cpuwhich_t)]; cpuwhich_t which; char which_r_[PADR_(cpuwhich_t)];
+	char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)];
+	char id1_l_[PADL_(u_int32_t)]; u_int32_t id1; char id1_r_[PADR_(u_int32_t)];
+	char id2_l_[PADL_(u_int32_t)]; u_int32_t id2; char id2_r_[PADR_(u_int32_t)];
+	char setid_l_[PADL_(cpusetid_t)]; cpusetid_t setid; char setid_r_[PADR_(cpusetid_t)];
 };
+#else
 struct freebsd32_cpuset_setid_args {
 	char which_l_[PADL_(cpuwhich_t)]; cpuwhich_t which; char which_r_[PADR_(cpuwhich_t)];
-	char idlo_l_[PADL_(uint32_t)]; uint32_t idlo; char idlo_r_[PADR_(uint32_t)];
-	char idhi_l_[PADL_(uint32_t)]; uint32_t idhi; char idhi_r_[PADR_(uint32_t)];
+	char id1_l_[PADL_(u_int32_t)]; u_int32_t id1; char id1_r_[PADR_(u_int32_t)];
+	char id2_l_[PADL_(u_int32_t)]; u_int32_t id2; char id2_r_[PADR_(u_int32_t)];
 	char setid_l_[PADL_(cpusetid_t)]; cpusetid_t setid; char setid_r_[PADR_(cpusetid_t)];
 };
+#endif
 struct freebsd32_cpuset_getid_args {
 	char level_l_[PADL_(cpulevel_t)]; cpulevel_t level; char level_r_[PADR_(cpulevel_t)];
 	char which_l_[PADL_(cpuwhich_t)]; cpuwhich_t which; char which_r_[PADR_(cpuwhich_t)];
-	char idlo_l_[PADL_(uint32_t)]; uint32_t idlo; char idlo_r_[PADR_(uint32_t)];
-	char idhi_l_[PADL_(uint32_t)]; uint32_t idhi; char idhi_r_[PADR_(uint32_t)];
+	char id1_l_[PADL_(u_int32_t)]; u_int32_t id1; char id1_r_[PADR_(u_int32_t)];
+	char id2_l_[PADL_(u_int32_t)]; u_int32_t id2; char id2_r_[PADR_(u_int32_t)];
 	char setid_l_[PADL_(cpusetid_t *)]; cpusetid_t * setid; char setid_r_[PADR_(cpusetid_t *)];
 };
 struct freebsd32_cpuset_getaffinity_args {
 	char level_l_[PADL_(cpulevel_t)]; cpulevel_t level; char level_r_[PADR_(cpulevel_t)];
 	char which_l_[PADL_(cpuwhich_t)]; cpuwhich_t which; char which_r_[PADR_(cpuwhich_t)];
-	char idlo_l_[PADL_(uint32_t)]; uint32_t idlo; char idlo_r_[PADR_(uint32_t)];
-	char idhi_l_[PADL_(uint32_t)]; uint32_t idhi; char idhi_r_[PADR_(uint32_t)];
+	char id1_l_[PADL_(u_int32_t)]; u_int32_t id1; char id1_r_[PADR_(u_int32_t)];
+	char id2_l_[PADL_(u_int32_t)]; u_int32_t id2; char id2_r_[PADR_(u_int32_t)];
 	char cpusetsize_l_[PADL_(size_t)]; size_t cpusetsize; char cpusetsize_r_[PADR_(size_t)];
 	char mask_l_[PADL_(cpuset_t *)]; cpuset_t * mask; char mask_r_[PADR_(cpuset_t *)];
 };
 struct freebsd32_cpuset_setaffinity_args {
 	char level_l_[PADL_(cpulevel_t)]; cpulevel_t level; char level_r_[PADR_(cpulevel_t)];
 	char which_l_[PADL_(cpuwhich_t)]; cpuwhich_t which; char which_r_[PADR_(cpuwhich_t)];
-	char idlo_l_[PADL_(uint32_t)]; uint32_t idlo; char idlo_r_[PADR_(uint32_t)];
-	char idhi_l_[PADL_(uint32_t)]; uint32_t idhi; char idhi_r_[PADR_(uint32_t)];
+	char id1_l_[PADL_(u_int32_t)]; u_int32_t id1; char id1_r_[PADR_(u_int32_t)];
+	char id2_l_[PADL_(u_int32_t)]; u_int32_t id2; char id2_r_[PADR_(u_int32_t)];
 	char cpusetsize_l_[PADL_(size_t)]; size_t cpusetsize; char cpusetsize_r_[PADR_(size_t)];
 	char mask_l_[PADL_(const cpuset_t *)]; const cpuset_t * mask; char mask_r_[PADR_(const cpuset_t *)];
 };
@@ -461,6 +524,9 @@ struct freebsd32_pselect_args {
 	char ts_l_[PADL_(const struct timespec32 *)]; const struct timespec32 * ts; char ts_r_[PADR_(const struct timespec32 *)];
 	char sm_l_[PADL_(const sigset_t *)]; const sigset_t * sm; char sm_r_[PADR_(const sigset_t *)];
 };
+#if !defined(PAD64_REQUIRED) && defined(__powerpc__)
+#define PAD64_REQUIRED
+#endif
 int	freebsd32_wait4(struct thread *, struct freebsd32_wait4_args *);
 int	freebsd32_recvmsg(struct thread *, struct freebsd32_recvmsg_args *);
 int	freebsd32_sendmsg(struct thread *, struct freebsd32_sendmsg_args *);
@@ -526,13 +592,26 @@ int	freebsd32_thr_suspend(struct thread 
 int	freebsd32_umtx_op(struct thread *, struct freebsd32_umtx_op_args *);
 int	freebsd32_thr_new(struct thread *, struct freebsd32_thr_new_args *);
 int	freebsd32_aio_fsync(struct thread *, struct freebsd32_aio_fsync_args *);
+#ifdef PAD64_REQUIRED
 int	freebsd32_pread(struct thread *, struct freebsd32_pread_args *);
 int	freebsd32_pwrite(struct thread *, struct freebsd32_pwrite_args *);
 int	freebsd32_mmap(struct thread *, struct freebsd32_mmap_args *);
 int	freebsd32_lseek(struct thread *, struct freebsd32_lseek_args *);
 int	freebsd32_truncate(struct thread *, struct freebsd32_truncate_args *);
 int	freebsd32_ftruncate(struct thread *, struct freebsd32_ftruncate_args *);
+#else
+int	freebsd32_pread(struct thread *, struct freebsd32_pread_args *);
+int	freebsd32_pwrite(struct thread *, struct freebsd32_pwrite_args *);
+int	freebsd32_mmap(struct thread *, struct freebsd32_mmap_args *);
+int	freebsd32_lseek(struct thread *, struct freebsd32_lseek_args *);
+int	freebsd32_truncate(struct thread *, struct freebsd32_truncate_args *);
+int	freebsd32_ftruncate(struct thread *, struct freebsd32_ftruncate_args *);
+#endif
+#ifdef PAD64_REQUIRED
 int	freebsd32_cpuset_setid(struct thread *, struct freebsd32_cpuset_setid_args *);
+#else
+int	freebsd32_cpuset_setid(struct thread *, struct freebsd32_cpuset_setid_args *);
+#endif
 int	freebsd32_cpuset_getid(struct thread *, struct freebsd32_cpuset_getid_args *);
 int	freebsd32_cpuset_getaffinity(struct thread *, struct freebsd32_cpuset_getaffinity_args *);
 int	freebsd32_cpuset_setaffinity(struct thread *, struct freebsd32_cpuset_setaffinity_args *);
@@ -548,6 +627,9 @@ int	freebsd32_pselect(struct thread *, s
 
 #ifdef COMPAT_43
 
+#if !defined(PAD64_REQUIRED) && defined(__powerpc__)
+#define PAD64_REQUIRED
+#endif
 struct ofreebsd32_sigaction_args {
 	char signum_l_[PADL_(int)]; int signum; char signum_r_[PADR_(int)];
 	char nsa_l_[PADL_(struct osigaction32 *)]; struct osigaction32 * nsa; char nsa_r_[PADR_(struct osigaction32 *)];
@@ -575,6 +657,12 @@ struct ofreebsd32_sigstack_args {
 	char nss_l_[PADL_(struct sigstack32 *)]; struct sigstack32 * nss; char nss_r_[PADR_(struct sigstack32 *)];
 	char oss_l_[PADL_(struct sigstack32 *)]; struct sigstack32 * oss; char oss_r_[PADR_(struct sigstack32 *)];
 };
+#ifdef PAD64_REQUIRED
+#else
+#endif
+#ifdef PAD64_REQUIRED
+#else
+#endif
 int	ofreebsd32_sigaction(struct thread *, struct ofreebsd32_sigaction_args *);
 int	ofreebsd32_sigprocmask(struct thread *, struct ofreebsd32_sigprocmask_args *);
 int	ofreebsd32_sigpending(struct thread *, struct ofreebsd32_sigpending_args *);
@@ -589,6 +677,9 @@ int	ofreebsd32_sigstack(struct thread *,
 
 #ifdef COMPAT_FREEBSD4
 
+#if !defined(PAD64_REQUIRED) && defined(__powerpc__)
+#define PAD64_REQUIRED
+#endif
 struct freebsd4_freebsd32_getfsstat_args {
 	char buf_l_[PADL_(struct statfs32 *)]; struct statfs32 * buf; char buf_r_[PADR_(struct statfs32 *)];
 	char bufsize_l_[PADL_(long)]; long bufsize; char bufsize_r_[PADR_(long)];
@@ -609,8 +700,8 @@ struct freebsd4_freebsd32_fhstatfs_args 
 struct freebsd4_freebsd32_sendfile_args {
 	char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
 	char s_l_[PADL_(int)]; int s; char s_r_[PADR_(int)];
-	char offsetlo_l_[PADL_(u_int32_t)]; u_int32_t offsetlo; char offsetlo_r_[PADR_(u_int32_t)];
-	char offsethi_l_[PADL_(u_int32_t)]; u_int32_t offsethi; char offsethi_r_[PADR_(u_int32_t)];
+	char offset1_l_[PADL_(u_int32_t)]; u_int32_t offset1; char offset1_r_[PADR_(u_int32_t)];
+	char offset2_l_[PADL_(u_int32_t)]; u_int32_t offset2; char offset2_r_[PADR_(u_int32_t)];
 	char nbytes_l_[PADL_(size_t)]; size_t nbytes; char nbytes_r_[PADR_(size_t)];
 	char hdtr_l_[PADL_(struct sf_hdtr32 *)]; struct sf_hdtr32 * hdtr; char hdtr_r_[PADR_(struct sf_hdtr32 *)];
 	char sbytes_l_[PADL_(off_t *)]; off_t * sbytes; char sbytes_r_[PADR_(off_t *)];
@@ -624,6 +715,12 @@ struct freebsd4_freebsd32_sigaction_args
 struct freebsd4_freebsd32_sigreturn_args {
 	char sigcntxp_l_[PADL_(const struct freebsd4_freebsd32_ucontext *)]; const struct freebsd4_freebsd32_ucontext * sigcntxp; char sigcntxp_r_[PADR_(const struct freebsd4_freebsd32_ucontext *)];
 };
+#ifdef PAD64_REQUIRED
+#else
+#endif
+#ifdef PAD64_REQUIRED
+#else
+#endif
 int	freebsd4_freebsd32_getfsstat(struct thread *, struct freebsd4_freebsd32_getfsstat_args *);
 int	freebsd4_freebsd32_statfs(struct thread *, struct freebsd4_freebsd32_statfs_args *);
 int	freebsd4_freebsd32_fstatfs(struct thread *, struct freebsd4_freebsd32_fstatfs_args *);
@@ -637,21 +734,24 @@ int	freebsd4_freebsd32_sigreturn(struct 
 
 #ifdef COMPAT_FREEBSD6
 
+#if !defined(PAD64_REQUIRED) && defined(__powerpc__)
+#define PAD64_REQUIRED
+#endif
 struct freebsd6_freebsd32_pread_args {
 	char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
 	char buf_l_[PADL_(void *)]; void * buf; char buf_r_[PADR_(void *)];
 	char nbyte_l_[PADL_(size_t)]; size_t nbyte; char nbyte_r_[PADR_(size_t)];
 	char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)];
-	char offsetlo_l_[PADL_(u_int32_t)]; u_int32_t offsetlo; char offsetlo_r_[PADR_(u_int32_t)];
-	char offsethi_l_[PADL_(u_int32_t)]; u_int32_t offsethi; char offsethi_r_[PADR_(u_int32_t)];
+	char offset1_l_[PADL_(u_int32_t)]; u_int32_t offset1; char offset1_r_[PADR_(u_int32_t)];
+	char offset2_l_[PADL_(u_int32_t)]; u_int32_t offset2; char offset2_r_[PADR_(u_int32_t)];
 };
 struct freebsd6_freebsd32_pwrite_args {
 	char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
 	char buf_l_[PADL_(const void *)]; const void * buf; char buf_r_[PADR_(const void *)];
 	char nbyte_l_[PADL_(size_t)]; size_t nbyte; char nbyte_r_[PADR_(size_t)];
 	char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)];
-	char offsetlo_l_[PADL_(u_int32_t)]; u_int32_t offsetlo; char offsetlo_r_[PADR_(u_int32_t)];
-	char offsethi_l_[PADL_(u_int32_t)]; u_int32_t offsethi; char offsethi_r_[PADR_(u_int32_t)];
+	char offset1_l_[PADL_(u_int32_t)]; u_int32_t offset1; char offset1_r_[PADR_(u_int32_t)];
+	char offset2_l_[PADL_(u_int32_t)]; u_int32_t offset2; char offset2_r_[PADR_(u_int32_t)];
 };
 struct freebsd6_freebsd32_mmap_args {
 	char addr_l_[PADL_(caddr_t)]; caddr_t addr; char addr_r_[PADR_(caddr_t)];
@@ -660,28 +760,34 @@ struct freebsd6_freebsd32_mmap_args {
 	char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)];
 	char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
 	char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)];
-	char poslo_l_[PADL_(u_int32_t)]; u_int32_t poslo; char poslo_r_[PADR_(u_int32_t)];
-	char poshi_l_[PADL_(u_int32_t)]; u_int32_t poshi; char poshi_r_[PADR_(u_int32_t)];
+	char pos1_l_[PADL_(u_int32_t)]; u_int32_t pos1; char pos1_r_[PADR_(u_int32_t)];
+	char pos2_l_[PADL_(u_int32_t)]; u_int32_t pos2; char pos2_r_[PADR_(u_int32_t)];
 };
 struct freebsd6_freebsd32_lseek_args {
 	char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
 	char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)];
-	char offsetlo_l_[PADL_(u_int32_t)]; u_int32_t offsetlo; char offsetlo_r_[PADR_(u_int32_t)];
-	char offsethi_l_[PADL_(u_int32_t)]; u_int32_t offsethi; char offsethi_r_[PADR_(u_int32_t)];
+	char offset1_l_[PADL_(u_int32_t)]; u_int32_t offset1; char offset1_r_[PADR_(u_int32_t)];
+	char offset2_l_[PADL_(u_int32_t)]; u_int32_t offset2; char offset2_r_[PADR_(u_int32_t)];
 	char whence_l_[PADL_(int)]; int whence; char whence_r_[PADR_(int)];
 };
 struct freebsd6_freebsd32_truncate_args {
 	char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
 	char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)];
-	char lengthlo_l_[PADL_(u_int32_t)]; u_int32_t lengthlo; char lengthlo_r_[PADR_(u_int32_t)];
-	char lengthhi_l_[PADL_(u_int32_t)]; u_int32_t lengthhi; char lengthhi_r_[PADR_(u_int32_t)];
+	char length1_l_[PADL_(u_int32_t)]; u_int32_t length1; char length1_r_[PADR_(u_int32_t)];
+	char length2_l_[PADL_(u_int32_t)]; u_int32_t length2; char length2_r_[PADR_(u_int32_t)];
 };
 struct freebsd6_freebsd32_ftruncate_args {
 	char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
 	char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)];
-	char lengthlo_l_[PADL_(u_int32_t)]; u_int32_t lengthlo; char lengthlo_r_[PADR_(u_int32_t)];
-	char lengthhi_l_[PADL_(u_int32_t)]; u_int32_t lengthhi; char lengthhi_r_[PADR_(u_int32_t)];
+	char length1_l_[PADL_(u_int32_t)]; u_int32_t length1; char length1_r_[PADR_(u_int32_t)];
+	char length2_l_[PADL_(u_int32_t)]; u_int32_t length2; char length2_r_[PADR_(u_int32_t)];
 };
+#ifdef PAD64_REQUIRED
+#else
+#endif
+#ifdef PAD64_REQUIRED
+#else
+#endif
 int	freebsd6_freebsd32_pread(struct thread *, struct freebsd6_freebsd32_pread_args *);
 int	freebsd6_freebsd32_pwrite(struct thread *, struct freebsd6_freebsd32_pwrite_args *);
 int	freebsd6_freebsd32_mmap(struct thread *, struct freebsd6_freebsd32_mmap_args *);
@@ -694,6 +800,9 @@ int	freebsd6_freebsd32_ftruncate(struct 
 
 #ifdef COMPAT_FREEBSD7
 
+#if !defined(PAD64_REQUIRED) && defined(__powerpc__)
+#define PAD64_REQUIRED
+#endif
 struct freebsd7_freebsd32_semctl_args {
 	char semid_l_[PADL_(int)]; int semid; char semid_r_[PADR_(int)];
 	char semnum_l_[PADL_(int)]; int semnum; char semnum_r_[PADR_(int)];
@@ -710,6 +819,12 @@ struct freebsd7_freebsd32_shmctl_args {
 	char cmd_l_[PADL_(int)]; int cmd; char cmd_r_[PADR_(int)];
 	char buf_l_[PADL_(struct shmid_ds32_old *)]; struct shmid_ds32_old * buf; char buf_r_[PADR_(struct shmid_ds32_old *)];
 };
+#ifdef PAD64_REQUIRED
+#else
+#endif
+#ifdef PAD64_REQUIRED
+#else
+#endif
 int	freebsd7_freebsd32_semctl(struct thread *, struct freebsd7_freebsd32_semctl_args *);
 int	freebsd7_freebsd32_msgctl(struct thread *, struct freebsd7_freebsd32_msgctl_args *);
 int	freebsd7_freebsd32_shmctl(struct thread *, struct freebsd7_freebsd32_shmctl_args *);
@@ -811,6 +926,13 @@ int	freebsd7_freebsd32_shmctl(struct thr
 #define	FREEBSD32_SYS_AUE_freebsd32_lseek	AUE_LSEEK
 #define	FREEBSD32_SYS_AUE_freebsd32_truncate	AUE_TRUNCATE
 #define	FREEBSD32_SYS_AUE_freebsd32_ftruncate	AUE_FTRUNCATE
+#define	FREEBSD32_SYS_AUE_freebsd32_pread	AUE_PREAD
+#define	FREEBSD32_SYS_AUE_freebsd32_pwrite	AUE_PWRITE
+#define	FREEBSD32_SYS_AUE_freebsd32_mmap	AUE_MMAP
+#define	FREEBSD32_SYS_AUE_freebsd32_lseek	AUE_LSEEK
+#define	FREEBSD32_SYS_AUE_freebsd32_truncate	AUE_TRUNCATE
+#define	FREEBSD32_SYS_AUE_freebsd32_ftruncate	AUE_FTRUNCATE
+#define	FREEBSD32_SYS_AUE_freebsd32_cpuset_setid	AUE_NULL
 #define	FREEBSD32_SYS_AUE_freebsd32_cpuset_setid	AUE_NULL
 #define	FREEBSD32_SYS_AUE_freebsd32_cpuset_getid	AUE_NULL
 #define	FREEBSD32_SYS_AUE_freebsd32_cpuset_getaffinity	AUE_NULL

Modified: stable/8/sys/compat/freebsd32/freebsd32_syscall.h
==============================================================================
--- stable/8/sys/compat/freebsd32/freebsd32_syscall.h	Wed Apr  7 02:24:41 2010	(r206336)
+++ stable/8/sys/compat/freebsd32/freebsd32_syscall.h	Wed Apr  7 02:25:36 2010	(r206337)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 200725 2009-12-19 11:47:00Z kib 
+ * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 206336 2010-04-07 02:24:41Z nwhitehorn 
  */
 
 #define	FREEBSD32_SYS_syscall	0
@@ -354,11 +354,18 @@
 #define	FREEBSD32_SYS_freebsd32_lseek	478
 #define	FREEBSD32_SYS_freebsd32_truncate	479
 #define	FREEBSD32_SYS_freebsd32_ftruncate	480
+#define	FREEBSD32_SYS_freebsd32_pread	475
+#define	FREEBSD32_SYS_freebsd32_pwrite	476
+#define	FREEBSD32_SYS_freebsd32_mmap	477
+#define	FREEBSD32_SYS_freebsd32_lseek	478
+#define	FREEBSD32_SYS_freebsd32_truncate	479
+#define	FREEBSD32_SYS_freebsd32_ftruncate	480
 #define	FREEBSD32_SYS_thr_kill2	481
 #define	FREEBSD32_SYS_shm_open	482
 #define	FREEBSD32_SYS_shm_unlink	483
 #define	FREEBSD32_SYS_cpuset	484
 #define	FREEBSD32_SYS_freebsd32_cpuset_setid	485
+#define	FREEBSD32_SYS_freebsd32_cpuset_setid	485
 #define	FREEBSD32_SYS_freebsd32_cpuset_getid	486
 #define	FREEBSD32_SYS_freebsd32_cpuset_getaffinity	487
 #define	FREEBSD32_SYS_freebsd32_cpuset_setaffinity	488

Modified: stable/8/sys/compat/freebsd32/freebsd32_syscalls.c
==============================================================================
--- stable/8/sys/compat/freebsd32/freebsd32_syscalls.c	Wed Apr  7 02:24:41 2010	(r206336)
+++ stable/8/sys/compat/freebsd32/freebsd32_syscalls.c	Wed Apr  7 02:25:36 2010	(r206337)
@@ -3,10 +3,13 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 200725 2009-12-19 11:47:00Z kib 
+ * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 206336 2010-04-07 02:24:41Z nwhitehorn 
  */
 
 const char *freebsd32_syscallnames[] = {
+#if !defined(PAD64_REQUIRED) && defined(__powerpc__)
+#define PAD64_REQUIRED
+#endif
 	"syscall",			/* 0 = syscall */
 	"exit",			/* 1 = exit */
 	"fork",			/* 2 = fork */
@@ -482,17 +485,30 @@ const char *freebsd32_syscallnames[] = {
 	"sctp_generic_sendmsg",			/* 472 = sctp_generic_sendmsg */
 	"sctp_generic_sendmsg_iov",			/* 473 = sctp_generic_sendmsg_iov */
 	"sctp_generic_recvmsg",			/* 474 = sctp_generic_recvmsg */
+#ifdef PAD64_REQUIRED
 	"freebsd32_pread",			/* 475 = freebsd32_pread */
 	"freebsd32_pwrite",			/* 476 = freebsd32_pwrite */
 	"freebsd32_mmap",			/* 477 = freebsd32_mmap */
 	"freebsd32_lseek",			/* 478 = freebsd32_lseek */
 	"freebsd32_truncate",			/* 479 = freebsd32_truncate */
 	"freebsd32_ftruncate",			/* 480 = freebsd32_ftruncate */
+#else
+	"freebsd32_pread",			/* 475 = freebsd32_pread */
+	"freebsd32_pwrite",			/* 476 = freebsd32_pwrite */
+	"freebsd32_mmap",			/* 477 = freebsd32_mmap */
+	"freebsd32_lseek",			/* 478 = freebsd32_lseek */
+	"freebsd32_truncate",			/* 479 = freebsd32_truncate */
+	"freebsd32_ftruncate",			/* 480 = freebsd32_ftruncate */
+#endif
 	"thr_kill2",			/* 481 = thr_kill2 */
 	"shm_open",			/* 482 = shm_open */
 	"shm_unlink",			/* 483 = shm_unlink */
 	"cpuset",			/* 484 = cpuset */
+#ifdef PAD64_REQUIRED
+	"freebsd32_cpuset_setid",			/* 485 = freebsd32_cpuset_setid */
+#else
 	"freebsd32_cpuset_setid",			/* 485 = freebsd32_cpuset_setid */
+#endif
 	"freebsd32_cpuset_getid",			/* 486 = freebsd32_cpuset_getid */
 	"freebsd32_cpuset_getaffinity",			/* 487 = freebsd32_cpuset_getaffinity */
 	"freebsd32_cpuset_setaffinity",			/* 488 = freebsd32_cpuset_setaffinity */

Modified: stable/8/sys/compat/freebsd32/freebsd32_sysent.c
==============================================================================
--- stable/8/sys/compat/freebsd32/freebsd32_sysent.c	Wed Apr  7 02:24:41 2010	(r206336)
+++ stable/8/sys/compat/freebsd32/freebsd32_sysent.c	Wed Apr  7 02:25:36 2010	(r206337)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 200725 2009-12-19 11:47:00Z kib 
+ * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 206336 2010-04-07 02:24:41Z nwhitehorn 
  */
 
 #include "opt_compat.h"
@@ -44,6 +44,9 @@
 
 /* The casts are bogus but will do for now. */
 struct sysent freebsd32_sysent[] = {
+#if !defined(PAD64_REQUIRED) && defined(__powerpc__)
+#define PAD64_REQUIRED
+#endif
 	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 },		/* 0 = syscall */
 	{ AS(sys_exit_args), (sy_call_t *)sys_exit, AUE_EXIT, NULL, 0, 0, 0 },	/* 1 = exit */
 	{ 0, (sy_call_t *)fork, AUE_FORK, NULL, 0, 0, 0 },		/* 2 = fork */
@@ -519,17 +522,30 @@ struct sysent freebsd32_sysent[] = {
 	{ AS(sctp_generic_sendmsg_args), (sy_call_t *)sctp_generic_sendmsg, AUE_NULL, NULL, 0, 0, 0 },	/* 472 = sctp_generic_sendmsg */
 	{ AS(sctp_generic_sendmsg_iov_args), (sy_call_t *)sctp_generic_sendmsg_iov, AUE_NULL, NULL, 0, 0, 0 },	/* 473 = sctp_generic_sendmsg_iov */
 	{ AS(sctp_generic_recvmsg_args), (sy_call_t *)sctp_generic_recvmsg, AUE_NULL, NULL, 0, 0, 0 },	/* 474 = sctp_generic_recvmsg */
+#ifdef PAD64_REQUIRED
+	{ AS(freebsd32_pread_args), (sy_call_t *)freebsd32_pread, AUE_PREAD, NULL, 0, 0, 0 },	/* 475 = freebsd32_pread */
+	{ AS(freebsd32_pwrite_args), (sy_call_t *)freebsd32_pwrite, AUE_PWRITE, NULL, 0, 0, 0 },	/* 476 = freebsd32_pwrite */
+	{ AS(freebsd32_mmap_args), (sy_call_t *)freebsd32_mmap, AUE_MMAP, NULL, 0, 0, 0 },	/* 477 = freebsd32_mmap */
+	{ AS(freebsd32_lseek_args), (sy_call_t *)freebsd32_lseek, AUE_LSEEK, NULL, 0, 0, 0 },	/* 478 = freebsd32_lseek */
+	{ AS(freebsd32_truncate_args), (sy_call_t *)freebsd32_truncate, AUE_TRUNCATE, NULL, 0, 0, 0 },	/* 479 = freebsd32_truncate */
+	{ AS(freebsd32_ftruncate_args), (sy_call_t *)freebsd32_ftruncate, AUE_FTRUNCATE, NULL, 0, 0, 0 },	/* 480 = freebsd32_ftruncate */
+#else
 	{ AS(freebsd32_pread_args), (sy_call_t *)freebsd32_pread, AUE_PREAD, NULL, 0, 0, 0 },	/* 475 = freebsd32_pread */
 	{ AS(freebsd32_pwrite_args), (sy_call_t *)freebsd32_pwrite, AUE_PWRITE, NULL, 0, 0, 0 },	/* 476 = freebsd32_pwrite */
 	{ AS(freebsd32_mmap_args), (sy_call_t *)freebsd32_mmap, AUE_MMAP, NULL, 0, 0, 0 },	/* 477 = freebsd32_mmap */
 	{ AS(freebsd32_lseek_args), (sy_call_t *)freebsd32_lseek, AUE_LSEEK, NULL, 0, 0, 0 },	/* 478 = freebsd32_lseek */
 	{ AS(freebsd32_truncate_args), (sy_call_t *)freebsd32_truncate, AUE_TRUNCATE, NULL, 0, 0, 0 },	/* 479 = freebsd32_truncate */
 	{ AS(freebsd32_ftruncate_args), (sy_call_t *)freebsd32_ftruncate, AUE_FTRUNCATE, NULL, 0, 0, 0 },	/* 480 = freebsd32_ftruncate */
+#endif
 	{ AS(thr_kill2_args), (sy_call_t *)thr_kill2, AUE_KILL, NULL, 0, 0, 0 },	/* 481 = thr_kill2 */
 	{ AS(shm_open_args), (sy_call_t *)shm_open, AUE_SHMOPEN, NULL, 0, 0, 0 },	/* 482 = shm_open */
 	{ AS(shm_unlink_args), (sy_call_t *)shm_unlink, AUE_SHMUNLINK, NULL, 0, 0, 0 },	/* 483 = shm_unlink */
 	{ AS(cpuset_args), (sy_call_t *)cpuset, AUE_NULL, NULL, 0, 0, 0 },	/* 484 = cpuset */
+#ifdef PAD64_REQUIRED
 	{ AS(freebsd32_cpuset_setid_args), (sy_call_t *)freebsd32_cpuset_setid, AUE_NULL, NULL, 0, 0, 0 },	/* 485 = freebsd32_cpuset_setid */
+#else
+	{ AS(freebsd32_cpuset_setid_args), (sy_call_t *)freebsd32_cpuset_setid, AUE_NULL, NULL, 0, 0, 0 },	/* 485 = freebsd32_cpuset_setid */
+#endif
 	{ AS(freebsd32_cpuset_getid_args), (sy_call_t *)freebsd32_cpuset_getid, AUE_NULL, NULL, 0, 0, 0 },	/* 486 = freebsd32_cpuset_getid */
 	{ AS(freebsd32_cpuset_getaffinity_args), (sy_call_t *)freebsd32_cpuset_getaffinity, AUE_NULL, NULL, 0, 0, 0 },	/* 487 = freebsd32_cpuset_getaffinity */
 	{ AS(freebsd32_cpuset_setaffinity_args), (sy_call_t *)freebsd32_cpuset_setaffinity, AUE_NULL, NULL, 0, 0, 0 },	/* 488 = freebsd32_cpuset_setaffinity */

From owner-svn-src-stable-8@FreeBSD.ORG  Wed Apr  7 12:42:50 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 02724106567A;
	Wed,  7 Apr 2010 12:42:50 +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 E340B8FC1B;
	Wed,  7 Apr 2010 12:42:49 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o37Cgnxa097835;
	Wed, 7 Apr 2010 12:42:49 GMT (envelope-from luigi@svn.freebsd.org)
Received: (from luigi@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o37Cgnfs097834;
	Wed, 7 Apr 2010 12:42:49 GMT (envelope-from luigi@svn.freebsd.org)
Message-Id: <201004071242.o37Cgnfs097834@svn.freebsd.org>
From: Luigi Rizzo 
Date: Wed, 7 Apr 2010 12:42:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206340 - stable/8/sys/netinet/ipfw
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Wed, 07 Apr 2010 12:42:50 -0000

Author: luigi
Date: Wed Apr  7 12:42:49 2010
New Revision: 206340
URL: http://svn.freebsd.org/changeset/base/206340

Log:
  fix breakage in ipfw removal.

Modified:
  stable/8/sys/netinet/ipfw/ip_fw_sockopt.c

Modified: stable/8/sys/netinet/ipfw/ip_fw_sockopt.c
==============================================================================
--- stable/8/sys/netinet/ipfw/ip_fw_sockopt.c	Wed Apr  7 08:23:58 2010	(r206339)
+++ stable/8/sys/netinet/ipfw/ip_fw_sockopt.c	Wed Apr  7 12:42:49 2010	(r206340)
@@ -232,12 +232,49 @@ ipfw_reap_rules(struct ip_fw *head)
 	}
 }
 
+/*
+ * Used by del_entry() to check if a rule should be kept.
+ * Returns 1 if the rule must be kept, 0 otherwise.
+ *
+ * Called with cmd = {0,1,5}.
+ * cmd == 0 matches on rule numbers, excludes rules in RESVD_SET if n == 0 ;
+ * cmd == 1 matches on set numbers only, rule numbers are ignored;
+ * cmd == 5 matches on rule and set numbers.
+ *
+ * n == 0 is a wildcard for rule numbers, there is no wildcard for sets.
+ *
+ * Rules to keep are
+ *	(default || reserved || !match_set || !match_number)
+ * where
+ *   default ::= (rule->rulenum == IPFW_DEFAULT_RULE)
+ *	// the default rule is always protected
+ *
+ *   reserved ::= (cmd == 0 && n == 0 && rule->set == RESVD_SET)
+ *	// RESVD_SET is protected only if cmd == 0 and n == 0 ("ipfw flush")
+ *
+ *   match_set ::= (cmd == 0 || rule->set == set)
+ *	// set number is ignored for cmd == 0
+ *
+ *   match_number ::= (cmd == 1 || n == 0 || n == rule->rulenum)
+ *	// number is ignored for cmd == 1 or n == 0
+ *
+ */
+static int
+keep_rule(struct ip_fw *rule, uint8_t cmd, uint8_t set, uint32_t n)
+{
+	return
+		 (rule->rulenum == IPFW_DEFAULT_RULE)		||
+		 (cmd == 0 && n == 0 && rule->set == RESVD_SET)	||
+		!(cmd == 0 || rule->set == set)			||
+		!(cmd == 1 || n == 0 || n == rule->rulenum);
+}
+
 /**
- * Remove all rules with given number, and also do set manipulation.
+ * Remove all rules with given number, or do set manipulation.
  * Assumes chain != NULL && *chain != NULL.
  *
- * The argument is an u_int32_t. The low 16 bit are the rule or set number,
- * the next 8 bits are the new set, the top 8 bits are the command:
+ * The argument is an uint32_t. The low 16 bit are the rule or set number;
+ * the next 8 bits are the new set; the top 8 bits indicate the command:
  *
  *	0	delete rules numbered "rulenum"
  *	1	delete rules in set "rulenum"
@@ -247,26 +284,26 @@ ipfw_reap_rules(struct ip_fw *head)
  *	5	delete rules "rulenum" and set "new_set"
  */
 static int
-del_entry(struct ip_fw_chain *chain, u_int32_t arg)
+del_entry(struct ip_fw_chain *chain, uint32_t arg)
 {
 	struct ip_fw *rule;
-	uint32_t rulenum;	/* rule or old_set */
+	uint32_t num;	/* rule number or old_set */
 	uint8_t cmd, new_set;
-	int start, end = 0, i, ofs, n;
+	int start, end, i, ofs, n;
 	struct ip_fw **map = NULL;
 	int error = 0;
 
-	rulenum = arg & 0xffff;
+	num = arg & 0xffff;
 	cmd = (arg >> 24) & 0xff;
 	new_set = (arg >> 16) & 0xff;
 
 	if (cmd > 5 || new_set > RESVD_SET)
 		return EINVAL;
 	if (cmd == 0 || cmd == 2 || cmd == 5) {
-		if (rulenum >= IPFW_DEFAULT_RULE)
+		if (num >= IPFW_DEFAULT_RULE)
 			return EINVAL;
 	} else {
-		if (rulenum > RESVD_SET)	/* old_set */
+		if (num > RESVD_SET)	/* old_set */
 			return EINVAL;
 	}
 
@@ -274,20 +311,24 @@ del_entry(struct ip_fw_chain *chain, u_i
 	chain->reap = NULL;	/* prepare for deletions */
 
 	switch (cmd) {
-	case 0:	/* delete rules "rulenum" (rulenum == 0 matches all) */
+	case 0:	/* delete rules "num" (num == 0 matches all) */
 	case 1:	/* delete all rules in set N */
 	case 5: /* delete rules with number N and set "new_set". */
 
 		/*
 		 * Locate first rule to delete (start), the rule after
 		 * the last one to delete (end), and count how many
-		 * rules to delete (n)
+		 * rules to delete (n). Always use keep_rule() to
+		 * determine which rules to keep.
 		 */
 		n = 0;
-		if (cmd == 1) { /* look for a specific set, must scan all */
-			new_set = rulenum;
-			for (start = -1, i = 0; i < chain->n_rules; i++) {
-				if (chain->map[i]->set != new_set)
+		if (cmd == 1) {
+			/* look for a specific set including RESVD_SET.
+			 * Must scan the entire range, ignore num.
+			 */
+			new_set = num;
+			for (start = -1, end = i = 0; i < chain->n_rules; i++) {
+				if (keep_rule(chain->map[i], cmd, new_set, 0))
 					continue;
 				if (start < 0)
 					start = i;
@@ -296,61 +337,54 @@ del_entry(struct ip_fw_chain *chain, u_i
 			}
 			end++;	/* first non-matching */
 		} else {
-			start = ipfw_find_rule(chain, rulenum, 0);
+			/* Optimized search on rule numbers */
+			start = ipfw_find_rule(chain, num, 0);
 			for (end = start; end < chain->n_rules; end++) {
 				rule = chain->map[end];
-				if (rulenum > 0 && rule->rulenum != rulenum)
+				if (num > 0 && rule->rulenum != num)
 					break;
-				if (rule->set != RESVD_SET &&
-				    (cmd == 0 || rule->set == new_set) )
+				if (!keep_rule(rule, cmd, new_set, num))
 					n++;
 			}
 		}
-		if (n == 0 && arg == 0)
-			break; /* special case, flush on empty ruleset */
-		/* allocate the map, if needed */
-		if (n > 0)
+
+		if (n == 0) {
+			/* A flush request (arg == 0) on empty ruleset
+			 * returns with no error. On the contrary,
+			 * if there is no match on a specific request,
+			 * we return EINVAL.
+			 */
+			error = (arg == 0) ? 0 : EINVAL;
+			break;
+		}
+
+		/* We have something to delete. Allocate the new map */
 			map = get_map(chain, -n, 1 /* locked */);
-		if (n == 0 || map == NULL) {
+		if (map == NULL) {
 			error = EINVAL;
 			break;
 		}
-		/*
-		 * bcopy the initial part of the map, then individually
-		 * copy all matching entries between start and end,
-		 * and then bcopy the final part.
-		 * Once we are done we can swap maps and clean up the
-		 * deleted rules (unfortunately we need to repeat a
-		 * convoluted test). Rules to keep are
-		 *	(set == RESVD_SET || !match_set || !match_rule)
-		 * where
-		 *   match_set ::= (cmd == 0 || rule->set == new_set)
-		 *   match_rule ::= (cmd == 1 || rule->rulenum == rulenum)
-		 */
+
+		/* 1. bcopy the initial part of the map */
 		if (start > 0)
 			bcopy(chain->map, map, start * sizeof(struct ip_fw *));
+		/* 2. copy active rules between start and end */
 		for (i = ofs = start; i < end; i++) {
 			rule = chain->map[i];
-			if (rule->set == RESVD_SET ||
-			    !(cmd == 0 || rule->set == new_set) ||
-			    !(cmd == 1 || rule->rulenum == rulenum) ) {
-				map[ofs++] = chain->map[i];
-			}
+			if (keep_rule(rule, cmd, new_set, num))
+				map[ofs++] = rule;
 		}
+		/* 3. copy the final part of the map */
 		bcopy(chain->map + end, map + ofs,
 			(chain->n_rules - end) * sizeof(struct ip_fw *));
-
+		/* 4. swap the maps (under BH_LOCK) */
 		map = swap_map(chain, map, chain->n_rules - n);
-		/* now remove the rules deleted */
+		/* 5. now remove the rules deleted from the old map */
 		for (i = start; i < end; i++) {
 			int l;
 			rule = map[i];
-			/* same test as above */
-			if (rule->set == RESVD_SET ||
-			    !(cmd == 0 || rule->set == new_set) ||
-			    !(cmd == 1 || rule->rulenum == rulenum) )
+			if (keep_rule(rule, cmd, new_set, num))
 				continue;
-
 			l = RULESIZE(rule);
 			chain->static_len -= l;
 			ipfw_remove_dyn_children(rule);
@@ -359,32 +393,38 @@ del_entry(struct ip_fw_chain *chain, u_i
 		}
 		break;
 
-	case 2:	/* move rules with given number to new set */
-		for (i = 0; i < chain->n_rules; i++) {
+	/*
+	 * In the next 3 cases the loop stops at (n_rules - 1)
+	 * because the default rule is never eligible..
+	 */
+
+	case 2:	/* move rules with given RULE number to new set */
+		for (i = 0; i < chain->n_rules - 1; i++) {
 			rule = chain->map[i];
-			if (rule->rulenum == rulenum)
+			if (rule->rulenum == num)
 				rule->set = new_set;
 		}
 		break;
 
-	case 3: /* move rules with given set number to new set */
-		for (i = 0; i < chain->n_rules; i++) {
+	case 3: /* move rules with given SET number to new set */
+		for (i = 0; i < chain->n_rules - 1; i++) {
 			rule = chain->map[i];
-			if (rule->set == rulenum)
+			if (rule->set == num)
 				rule->set = new_set;
 		}
 		break;
 
 	case 4: /* swap two sets */
-		for (i = 0; i < chain->n_rules; i++) {
+		for (i = 0; i < chain->n_rules - 1; i++) {
 			rule = chain->map[i];
-			if (rule->set == rulenum)
+			if (rule->set == num)
 				rule->set = new_set;
 			else if (rule->set == new_set)
-				rule->set = rulenum;
+				rule->set = num;
 		}
 		break;
 	}
+
 	rule = chain->reap;
 	chain->reap = NULL;
 	IPFW_UH_WUNLOCK(chain);

From owner-svn-src-stable-8@FreeBSD.ORG  Wed Apr  7 13:18:59 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2F96B1065689;
	Wed,  7 Apr 2010 13:18:59 +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 1B99D8FC1F;
	Wed,  7 Apr 2010 13:18:59 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o37DIx4W005967;
	Wed, 7 Apr 2010 13:18:59 GMT (envelope-from luigi@svn.freebsd.org)
Received: (from luigi@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o37DIww4005962;
	Wed, 7 Apr 2010 13:18:58 GMT (envelope-from luigi@svn.freebsd.org)
Message-Id: <201004071318.o37DIww4005962@svn.freebsd.org>
From: Luigi Rizzo 
Date: Wed, 7 Apr 2010 13:18:58 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206342 - in stable/8/sys: conf modules/dummynet
	netinet/ipfw netinet/ipfw/test
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Wed, 07 Apr 2010 13:18:59 -0000

Author: luigi
Date: Wed Apr  7 13:18:58 2010
New Revision: 206342
URL: http://svn.freebsd.org/changeset/base/206342

Log:
  add priority scheduler.

Added:
  stable/8/sys/netinet/ipfw/dn_sched_prio.c   (contents, props changed)
Modified:
  stable/8/sys/conf/files
  stable/8/sys/modules/dummynet/Makefile
  stable/8/sys/netinet/ipfw/test/Makefile

Modified: stable/8/sys/conf/files
==============================================================================
--- stable/8/sys/conf/files	Wed Apr  7 13:02:20 2010	(r206341)
+++ stable/8/sys/conf/files	Wed Apr  7 13:18:58 2010	(r206342)
@@ -2480,9 +2480,10 @@ netinet/in_rmx.c		optional inet
 netinet/ip_divert.c		optional inet ipdivert ipfirewall
 netinet/ipfw/dn_heap.c		optional inet dummynet
 netinet/ipfw/dn_sched_fifo.c	optional inet dummynet
+netinet/ipfw/dn_sched_prio.c	optional inet dummynet 
+netinet/ipfw/dn_sched_qfq.c	optional inet dummynet 
 netinet/ipfw/dn_sched_rr.c	optional inet dummynet
 netinet/ipfw/dn_sched_wf2q.c	optional inet dummynet 
-netinet/ipfw/dn_sched_qfq.c	optional inet dummynet 
 netinet/ipfw/ip_dummynet.c	optional inet dummynet
 netinet/ipfw/ip_dn_io.c		optional inet dummynet
 netinet/ipfw/ip_dn_glue.c	optional inet dummynet

Modified: stable/8/sys/modules/dummynet/Makefile
==============================================================================
--- stable/8/sys/modules/dummynet/Makefile	Wed Apr  7 13:02:20 2010	(r206341)
+++ stable/8/sys/modules/dummynet/Makefile	Wed Apr  7 13:18:58 2010	(r206342)
@@ -7,6 +7,7 @@ KMOD=   dummynet
 SRCS=   ip_dummynet.c
 SRCS+= ip_dn_glue.c ip_dn_io.c
 SRCS+= dn_heap.c dn_sched_fifo.c dn_sched_qfq.c dn_sched_rr.c dn_sched_wf2q.c
+SRCS+= dn_sched_prio.c
 SRCS+=	opt_inet6.h
 
 .if !defined(KERNBUILDDIR)

Added: stable/8/sys/netinet/ipfw/dn_sched_prio.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/8/sys/netinet/ipfw/dn_sched_prio.c	Wed Apr  7 13:18:58 2010	(r206342)
@@ -0,0 +1,229 @@
+/*
+ * Copyright (c) 2010 Riccardo Panicucci, Universita` di Pisa
+ * 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$
+ */
+#ifdef _KERNEL
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 	/* IFNAMSIZ */
+#include 
+#include 		/* ipfw_rule_ref */
+#include 	/* flow_id */
+#include 
+#include 
+#include 
+#include 
+#else
+#include 
+#endif
+
+#define DN_SCHED_PRIO	5 //XXX
+
+#if !defined(_KERNEL) || !defined(__linux__)
+#define test_bit(ix, pData)	((*pData) & (1<<(ix)))
+#define __set_bit(ix, pData)	(*pData) |= (1<<(ix))
+#define __clear_bit(ix, pData)	(*pData) &= ~(1<<(ix))
+#endif
+
+#ifdef __MIPSEL__
+#define __clear_bit(ix, pData)	(*pData) &= ~(1<<(ix))
+#endif
+
+/* Size of the array of queues pointers. */
+#define BITMAP_T	unsigned long
+#define MAXPRIO		(sizeof(BITMAP_T) * 8)
+
+/*
+ * The scheduler instance contains an array of pointers to queues,
+ * one for each priority, and a bitmap listing backlogged queues.
+ */
+struct prio_si {
+	BITMAP_T bitmap;			/* array bitmap */
+	struct dn_queue *q_array[MAXPRIO];	/* Array of queues pointers */
+};
+
+/*
+ * If a queue with the same priority is already backlogged, use
+ * that one instead of the queue passed as argument.
+ */
+static int 
+prio_enqueue(struct dn_sch_inst *_si, struct dn_queue *q, struct mbuf *m)
+{
+	struct prio_si *si = (struct prio_si *)(_si + 1);
+	int prio = q->fs->fs.par[0];
+
+	if (test_bit(prio, &si->bitmap) == 0) {
+		/* No queue with this priority, insert */
+		__set_bit(prio, &si->bitmap);
+		si->q_array[prio] = q;
+	} else { /* use the existing queue */
+		q = si->q_array[prio];
+	}
+	if (dn_enqueue(q, m, 0))
+		return 1;
+	return 0;
+}
+
+/*
+ * Packets are dequeued only from the highest priority queue.
+ * The function ffs() return the lowest bit in the bitmap that rapresent
+ * the array index (-1) which contains the pointer to the highest priority
+ * queue.
+ * After the dequeue, if this queue become empty, it is index is removed
+ * from the bitmap.
+ * Scheduler is idle if the bitmap is empty
+ *
+ * NOTE: highest priority is 0, lowest is sched->max_prio_q
+ */
+static struct mbuf *
+prio_dequeue(struct dn_sch_inst *_si)
+{
+	struct prio_si *si = (struct prio_si *)(_si + 1);
+	struct mbuf *m;
+	struct dn_queue *q;
+	int prio;
+
+	if (si->bitmap == 0) /* scheduler idle */
+		return NULL;
+
+	prio = ffs(si->bitmap) - 1;
+
+	/* Take the highest priority queue in the scheduler */
+	q = si->q_array[prio];
+	// assert(q)
+
+	m = dn_dequeue(q);
+	if (q->mq.head == NULL) {
+		/* Queue is now empty, remove from scheduler
+		 * and mark it
+		 */
+		si->q_array[prio] = NULL;
+		__clear_bit(prio, &si->bitmap);
+	}
+	return m;
+}
+
+static int
+prio_new_sched(struct dn_sch_inst *_si)
+{
+	struct prio_si *si = (struct prio_si *)(_si + 1);
+
+	bzero(si->q_array, sizeof(si->q_array));
+	si->bitmap = 0;
+
+	return 0;
+}
+
+static int
+prio_new_fsk(struct dn_fsk *fs)
+{
+	/* Check if the prioritiy is between 0 and MAXPRIO-1 */
+	ipdn_bound_var(&fs->fs.par[0], 0, 0, MAXPRIO - 1, "PRIO priority");
+	return 0;
+}
+
+static int
+prio_new_queue(struct dn_queue *q)
+{
+	struct prio_si *si = (struct prio_si *)(q->_si + 1);
+	int prio = q->fs->fs.par[0];
+	struct dn_queue *oldq;
+
+	q->ni.oid.subtype = DN_SCHED_PRIO;
+
+	if (q->mq.head == NULL)
+		return 0;
+
+	/* Queue already full, must insert in the scheduler or append
+	 * mbufs to existing queue. This partly duplicates prio_enqueue
+	 */
+	if (test_bit(prio, &si->bitmap) == 0) {
+		/* No queue with this priority, insert */
+		__set_bit(prio, &si->bitmap);
+		si->q_array[prio] = q;
+	} else if ( (oldq = si->q_array[prio]) != q) {
+		/* must append to the existing queue.
+		 * can simply append q->mq.head to q2->...
+		 * and add the counters to those of q2
+		 */
+		oldq->mq.tail->m_nextpkt = q->mq.head;
+		oldq->mq.tail = q->mq.tail;
+		oldq->ni.length += q->ni.length;
+		q->ni.length = 0;
+		oldq->ni.len_bytes += q->ni.len_bytes;
+		q->ni.len_bytes = 0;
+		q->mq.tail = q->mq.head = NULL;
+	}
+	return 0;
+}
+
+static int
+prio_free_queue(struct dn_queue *q)
+{
+	int prio = q->fs->fs.par[0];
+	struct prio_si *si = (struct prio_si *)(q->_si + 1);
+
+	if (si->q_array[prio] == q) {
+		si->q_array[prio] = NULL;
+		__clear_bit(prio, &si->bitmap);
+	}
+	return 0;
+}
+
+
+static struct dn_alg prio_desc = {
+	_SI( .type = ) DN_SCHED_PRIO,
+	_SI( .name = ) "PRIO",
+	_SI( .flags = ) DN_MULTIQUEUE,
+
+	/* we need extra space in the si and the queue */
+	_SI( .schk_datalen = ) 0,
+	_SI( .si_datalen = ) sizeof(struct prio_si),
+	_SI( .q_datalen = ) 0,
+
+	_SI( .enqueue = ) prio_enqueue,
+	_SI( .dequeue = ) prio_dequeue,
+
+	_SI( .config = )  NULL,
+	_SI( .destroy = )  NULL,
+	_SI( .new_sched = ) prio_new_sched,
+	_SI( .free_sched = ) NULL,
+
+	_SI( .new_fsk = ) prio_new_fsk,
+	_SI( .free_fsk = )  NULL,
+
+	_SI( .new_queue = ) prio_new_queue,
+	_SI( .free_queue = ) prio_free_queue,
+};
+
+
+DECLARE_DNSCHED_MODULE(dn_prio, &prio_desc);

Modified: stable/8/sys/netinet/ipfw/test/Makefile
==============================================================================
--- stable/8/sys/netinet/ipfw/test/Makefile	Wed Apr  7 13:02:20 2010	(r206341)
+++ stable/8/sys/netinet/ipfw/test/Makefile	Wed Apr  7 13:18:58 2010	(r206342)
@@ -6,9 +6,10 @@
 
 SCHED_SRCS = test_dn_sched.c
 SCHED_SRCS += dn_sched_fifo.c
-SCHED_SRCS += dn_sched_wf2q.c
+SCHED_SRCS += dn_sched_prio.c
 SCHED_SRCS += dn_sched_qfq.c
 SCHED_SRCS += dn_sched_rr.c
+SCHED_SRCS += dn_sched_wf2q.c
 SCHED_SRCS += dn_heap.c
 SCHED_SRCS += main.c
 

From owner-svn-src-stable-8@FreeBSD.ORG  Wed Apr  7 14:09:30 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 37D4C106566B;
	Wed,  7 Apr 2010 14:09:30 +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 06AF68FC14;
	Wed,  7 Apr 2010 14:09:30 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o37E9TVU017136;
	Wed, 7 Apr 2010 14:09:29 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o37E9T2l017133;
	Wed, 7 Apr 2010 14:09:29 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201004071409.o37E9T2l017133@svn.freebsd.org>
From: Konstantin Belousov 
Date: Wed, 7 Apr 2010 14:09:29 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206344 - stable/8/sys/compat/freebsd32
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Wed, 07 Apr 2010 14:09:30 -0000

Author: kib
Date: Wed Apr  7 14:09:29 2010
New Revision: 206344
URL: http://svn.freebsd.org/changeset/base/206344

Log:
  MFC r205319:
  Make freebsd32_copyiniov() available outside of freebsd32_misc.

Modified:
  stable/8/sys/compat/freebsd32/freebsd32_misc.c
  stable/8/sys/compat/freebsd32/freebsd32_util.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/compat/freebsd32/freebsd32_misc.c
==============================================================================
--- stable/8/sys/compat/freebsd32/freebsd32_misc.c	Wed Apr  7 13:21:52 2010	(r206343)
+++ stable/8/sys/compat/freebsd32/freebsd32_misc.c	Wed Apr  7 14:09:29 2010	(r206344)
@@ -873,7 +873,7 @@ freebsd32_pwritev(struct thread *td, str
 	return (error);
 }
 
-static int
+int
 freebsd32_copyiniov(struct iovec32 *iovp32, u_int iovcnt, struct iovec **iovp,
     int error)
 {

Modified: stable/8/sys/compat/freebsd32/freebsd32_util.h
==============================================================================
--- stable/8/sys/compat/freebsd32/freebsd32_util.h	Wed Apr  7 13:21:52 2010	(r206343)
+++ stable/8/sys/compat/freebsd32/freebsd32_util.h	Wed Apr  7 14:09:29 2010	(r206344)
@@ -84,5 +84,8 @@ int    syscall32_deregister(int *offset,
 int    syscall32_module_handler(struct module *mod, int what, void *arg);
 
 register_t *freebsd32_copyout_strings(struct image_params *imgp);
+struct iovec32;
+int	freebsd32_copyiniov(struct iovec32 *iovp, u_int iovcnt,
+	    struct iovec **iov, int error);
 
 #endif /* !_COMPAT_FREEBSD32_FREEBSD32_UTIL_H_ */

From owner-svn-src-stable-8@FreeBSD.ORG  Wed Apr  7 14:16:15 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 679621065680;
	Wed,  7 Apr 2010 14:16:15 +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 3C31F8FC22;
	Wed,  7 Apr 2010 14:16:15 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o37EGFqA018662;
	Wed, 7 Apr 2010 14:16:15 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o37EGFlw018660;
	Wed, 7 Apr 2010 14:16:15 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201004071416.o37EGFlw018660@svn.freebsd.org>
From: Konstantin Belousov 
Date: Wed, 7 Apr 2010 14:16:15 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206345 - stable/8/sys/kern
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Wed, 07 Apr 2010 14:16:15 -0000

Author: kib
Date: Wed Apr  7 14:16:14 2010
New Revision: 206345
URL: http://svn.freebsd.org/changeset/base/206345

Log:
  MFC r205318:
  Properly handle compat32 calls to sctp generic sendmsd/recvmsg functions that
  take iov.

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

Modified: stable/8/sys/kern/uipc_syscalls.c
==============================================================================
--- stable/8/sys/kern/uipc_syscalls.c	Wed Apr  7 14:09:29 2010	(r206344)
+++ stable/8/sys/kern/uipc_syscalls.c	Wed Apr  7 14:16:14 2010	(r206345)
@@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -69,6 +70,9 @@ __FBSDID("$FreeBSD$");
 #ifdef KTRACE
 #include 
 #endif
+#ifdef COMPAT_FREEBSD32
+#include 
+#endif
 
 #include 
 
@@ -2513,7 +2517,13 @@ sctp_generic_sendmsg_iov(td, uap)
 	if (error)
 		goto sctp_bad1;
 
-	error = copyiniov(uap->iov, uap->iovlen, &iov, EMSGSIZE);
+#ifdef COMPAT_FREEBSD32
+	if (SV_CURPROC_FLAG(SV_ILP32))
+		error = freebsd32_copyiniov((struct iovec32 *)uap->iov,
+		    uap->iovlen, &iov, EMSGSIZE);
+	else
+#endif
+		error = copyiniov(uap->iov, uap->iovlen, &iov, EMSGSIZE);
 	if (error)
 		goto sctp_bad1;
 #ifdef KTRACE
@@ -2615,10 +2625,15 @@ sctp_generic_recvmsg(td, uap)
 	if (error) {
 		return (error);
 	}
-	error = copyiniov(uap->iov, uap->iovlen, &iov, EMSGSIZE);
-	if (error) {
+#ifdef COMPAT_FREEBSD32
+	if (SV_CURPROC_FLAG(SV_ILP32))
+		error = freebsd32_copyiniov((struct iovec32 *)uap->iov,
+		    uap->iovlen, &iov, EMSGSIZE);
+	else
+#endif
+		error = copyiniov(uap->iov, uap->iovlen, &iov, EMSGSIZE);
+	if (error)
 		goto out1;
-	}
 
 	so = fp->f_data;
 #ifdef MAC

From owner-svn-src-stable-8@FreeBSD.ORG  Wed Apr  7 14:22:38 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DF89E1065670;
	Wed,  7 Apr 2010 14:22:38 +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 B3F098FC08;
	Wed,  7 Apr 2010 14:22:38 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o37EMcVj020125;
	Wed, 7 Apr 2010 14:22:38 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o37EMc38020122;
	Wed, 7 Apr 2010 14:22:38 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201004071422.o37EMc38020122@svn.freebsd.org>
From: Konstantin Belousov 
Date: Wed, 7 Apr 2010 14:22:38 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206346 - in stable/8/sys: compat/freebsd32 sys
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Wed, 07 Apr 2010 14:22:39 -0000

Author: kib
Date: Wed Apr  7 14:22:38 2010
New Revision: 206346
URL: http://svn.freebsd.org/changeset/base/206346

Log:
  MFC r205320:
  For SYSCALL_MODULE_HELPER, use "sys/" module name.
  For SYSCALL32_MODULE_HELPER, use "sys32/" module name.
  This avoids modules name conflict when compat32 syscall does not
  need shims.

Modified:
  stable/8/sys/compat/freebsd32/freebsd32_util.h
  stable/8/sys/sys/sysent.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/compat/freebsd32/freebsd32_util.h
==============================================================================
--- stable/8/sys/compat/freebsd32/freebsd32_util.h	Wed Apr  7 14:16:14 2010	(r206345)
+++ stable/8/sys/compat/freebsd32/freebsd32_util.h	Wed Apr  7 14:22:38 2010	(r206346)
@@ -61,7 +61,7 @@ static struct syscall_module_data name##
 };                                                             \
                                                                \
 static moduledata_t name##32_mod = {                           \
-       #name,                                                  \
+       "sys32/" #name,                                         \
        syscall32_module_handler,                               \
        &name##_syscall32_mod                                   \
 };                                                             \

Modified: stable/8/sys/sys/sysent.h
==============================================================================
--- stable/8/sys/sys/sysent.h	Wed Apr  7 14:16:14 2010	(r206345)
+++ stable/8/sys/sys/sysent.h	Wed Apr  7 14:22:38 2010	(r206346)
@@ -149,7 +149,7 @@ static struct syscall_module_data name##
 };								\
 								\
 static moduledata_t name##_mod = {				\
-	#name,							\
+	"sys/" #name,						\
 	syscall_module_handler,					\
 	&name##_syscall_mod					\
 };								\

From owner-svn-src-stable-8@FreeBSD.ORG  Wed Apr  7 14:28:48 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4B5A81065674;
	Wed,  7 Apr 2010 14:28:48 +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 39B0A8FC14;
	Wed,  7 Apr 2010 14:28:48 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o37ESmap021628;
	Wed, 7 Apr 2010 14:28:48 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o37ESmIM021623;
	Wed, 7 Apr 2010 14:28:48 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201004071428.o37ESmIM021623@svn.freebsd.org>
From: Konstantin Belousov 
Date: Wed, 7 Apr 2010 14:28:48 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206347 - in stable/8/sys: compat/freebsd32 kern sys
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Wed, 07 Apr 2010 14:28:48 -0000

Author: kib
Date: Wed Apr  7 14:28:47 2010
New Revision: 206347
URL: http://svn.freebsd.org/changeset/base/206347

Log:
  MFC r205321:
  Introduce SYSCALL_INIT_HELPER and SYSCALL32_INIT_HELPER macros and
  neccessary support functions to allow registering dynamically loaded
  syscalls from the MOD_LOAD handlers. Helpers handle registration
  failures semi-automatically.

Modified:
  stable/8/sys/compat/freebsd32/freebsd32_misc.c
  stable/8/sys/compat/freebsd32/freebsd32_util.h
  stable/8/sys/kern/kern_syscalls.c
  stable/8/sys/sys/sysent.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/compat/freebsd32/freebsd32_misc.c
==============================================================================
--- stable/8/sys/compat/freebsd32/freebsd32_misc.c	Wed Apr  7 14:22:38 2010	(r206346)
+++ stable/8/sys/compat/freebsd32/freebsd32_misc.c	Wed Apr  7 14:28:47 2010	(r206347)
@@ -3084,6 +3084,36 @@ syscall32_module_handler(struct module *
 	}
 }
 
+int
+syscall32_helper_register(struct syscall_helper_data *sd)
+{
+	struct syscall_helper_data *sd1;
+	int error;
+
+	for (sd1 = sd; sd1->syscall_no != NO_SYSCALL; sd1++) {
+		error = syscall32_register(&sd1->syscall_no, &sd1->new_sysent,
+		    &sd1->old_sysent);
+		if (error != 0) {
+			syscall32_helper_unregister(sd);
+			return (error);
+		}
+		sd1->registered = 1;
+	}
+	return (0);
+}
+
+int
+syscall32_helper_unregister(struct syscall_helper_data *sd)
+{
+	struct syscall_helper_data *sd1;
+
+	for (sd1 = sd; sd1->registered != 0; sd1++) {
+		syscall32_deregister(&sd1->syscall_no, &sd1->old_sysent);
+		sd1->registered = 0;
+	}
+	return (0);
+}
+
 register_t *
 freebsd32_copyout_strings(struct image_params *imgp)
 {

Modified: stable/8/sys/compat/freebsd32/freebsd32_util.h
==============================================================================
--- stable/8/sys/compat/freebsd32/freebsd32_util.h	Wed Apr  7 14:22:38 2010	(r206346)
+++ stable/8/sys/compat/freebsd32/freebsd32_util.h	Wed Apr  7 14:28:47 2010	(r206347)
@@ -78,10 +78,21 @@ SYSCALL32_MODULE(syscallname,           
     & syscallname##_syscall32, & syscallname##_sysent32,\
     NULL, NULL);
 
+#define SYSCALL32_INIT_HELPER(syscallname) {			\
+    .new_sysent = {						\
+	.sy_narg = (sizeof(struct syscallname ## _args )	\
+	    / sizeof(register_t)),				\
+	.sy_call = (sy_call_t *)& syscallname,			\
+    },								\
+    .syscall_no = FREEBSD32_SYS_##syscallname			\
+}
+
 int    syscall32_register(int *offset, struct sysent *new_sysent,
 	    struct sysent *old_sysent);
 int    syscall32_deregister(int *offset, struct sysent *old_sysent);
 int    syscall32_module_handler(struct module *mod, int what, void *arg);
+int    syscall32_helper_register(struct syscall_helper_data *sd);
+int    syscall32_helper_unregister(struct syscall_helper_data *sd);
 
 register_t *freebsd32_copyout_strings(struct image_params *imgp);
 struct iovec32;

Modified: stable/8/sys/kern/kern_syscalls.c
==============================================================================
--- stable/8/sys/kern/kern_syscalls.c	Wed Apr  7 14:22:38 2010	(r206346)
+++ stable/8/sys/kern/kern_syscalls.c	Wed Apr  7 14:28:47 2010	(r206347)
@@ -135,3 +135,33 @@ syscall_module_handler(struct module *mo
 	else
 		return (0);
 }
+
+int
+syscall_helper_register(struct syscall_helper_data *sd)
+{
+	struct syscall_helper_data *sd1;
+	int error;
+
+	for (sd1 = sd; sd1->syscall_no != NO_SYSCALL; sd1++) {
+		error = syscall_register(&sd1->syscall_no, &sd1->new_sysent,
+		    &sd1->old_sysent);
+		if (error != 0) {
+			syscall_helper_unregister(sd);
+			return (error);
+		}
+		sd1->registered = 1;
+	}
+	return (0);
+}
+
+int
+syscall_helper_unregister(struct syscall_helper_data *sd)
+{
+	struct syscall_helper_data *sd1;
+
+	for (sd1 = sd; sd1->registered != 0; sd1++) {
+		syscall_deregister(&sd1->syscall_no, &sd1->old_sysent);
+		sd1->registered = 0;
+	}
+	return (0);
+}

Modified: stable/8/sys/sys/sysent.h
==============================================================================
--- stable/8/sys/sys/sysent.h	Wed Apr  7 14:22:38 2010	(r206346)
+++ stable/8/sys/sys/sysent.h	Wed Apr  7 14:28:47 2010	(r206347)
@@ -166,10 +166,34 @@ SYSCALL_MODULE(syscallname,					\
 	(sysent[SYS_##syscallname].sy_call != (sy_call_t *)lkmnosys &&	\
 	sysent[SYS_##syscallname].sy_call != (sy_call_t *)lkmressys)
 
+/*
+ * Syscall registration helpers with resource allocation handling.
+ */
+struct syscall_helper_data {
+	struct sysent new_sysent;
+	struct sysent old_sysent;
+	int syscall_no;
+	int registered;
+};
+#define SYSCALL_INIT_HELPER(syscallname) {			\
+    .new_sysent = {						\
+	.sy_narg = (sizeof(struct syscallname ## _args )	\
+	    / sizeof(register_t)),				\
+	.sy_call = (sy_call_t *)& syscallname,			\
+	.sy_auevent = SYS_AUE_##syscallname			\
+    },								\
+    .syscall_no = SYS_##syscallname				\
+}
+#define SYSCALL_INIT_LAST {					\
+    .syscall_no = NO_SYSCALL					\
+}
+
 int	syscall_register(int *offset, struct sysent *new_sysent,
 	    struct sysent *old_sysent);
 int	syscall_deregister(int *offset, struct sysent *old_sysent);
 int	syscall_module_handler(struct module *mod, int what, void *arg);
+int	syscall_helper_register(struct syscall_helper_data *sd);
+int	syscall_helper_unregister(struct syscall_helper_data *sd);
 
 /* Special purpose system call functions. */
 struct nosys_args;

From owner-svn-src-stable-8@FreeBSD.ORG  Wed Apr  7 14:35:10 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5CA41106566B;
	Wed,  7 Apr 2010 14:35:10 +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 4B4EF8FC1F;
	Wed,  7 Apr 2010 14:35:10 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o37EZAnQ023098;
	Wed, 7 Apr 2010 14:35:10 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o37EZATu023094;
	Wed, 7 Apr 2010 14:35:10 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201004071435.o37EZATu023094@svn.freebsd.org>
From: Konstantin Belousov 
Date: Wed, 7 Apr 2010 14:35:10 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206348 - in stable/8/sys: compat/freebsd32 kern
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Wed, 07 Apr 2010 14:35:10 -0000

Author: kib
Date: Wed Apr  7 14:35:09 2010
New Revision: 206348
URL: http://svn.freebsd.org/changeset/base/206348

Log:
  MFC r205322:
  Move SysV IPC freebsd32 compat shims helpers from freebsd32_misc.c to
  sysv_ipc.c.

Modified:
  stable/8/sys/compat/freebsd32/freebsd32_ipc.h
  stable/8/sys/compat/freebsd32/freebsd32_misc.c
  stable/8/sys/kern/sysv_ipc.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/compat/freebsd32/freebsd32_ipc.h
==============================================================================
--- stable/8/sys/compat/freebsd32/freebsd32_ipc.h	Wed Apr  7 14:28:47 2010	(r206347)
+++ stable/8/sys/compat/freebsd32/freebsd32_ipc.h	Wed Apr  7 14:35:09 2010	(r206348)
@@ -147,6 +147,14 @@ struct shmid_ds32_old {
 	int32_t		shm_ctime;
 	uint32_t	shm_internal;
 };
+
+void	freebsd32_ipcperm_old_in(struct ipc_perm32_old *ip32,
+	    struct ipc_perm *ip);
+void	freebsd32_ipcperm_old_out(struct ipc_perm *ip,
+	    struct ipc_perm32_old *ip32);
 #endif
 
+void	freebsd32_ipcperm_in(struct ipc_perm32 *ip32, struct ipc_perm *ip);
+void	freebsd32_ipcperm_out(struct ipc_perm *ip, struct ipc_perm32 *ip32);
+
 #endif /* !_COMPAT_FREEBSD32_FREEBSD32_IPC_H_ */

Modified: stable/8/sys/compat/freebsd32/freebsd32_misc.c
==============================================================================
--- stable/8/sys/compat/freebsd32/freebsd32_misc.c	Wed Apr  7 14:28:47 2010	(r206347)
+++ stable/8/sys/compat/freebsd32/freebsd32_misc.c	Wed Apr  7 14:35:09 2010	(r206348)
@@ -1400,60 +1400,6 @@ freebsd4_freebsd32_fhstatfs(struct threa
 }
 #endif
 
-#if defined(COMPAT_FREEBSD4) || defined(COMPAT_FREEBSD5) || \
-    defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD7)
-static void
-freebsd32_ipcperm_old_in(struct ipc_perm32_old *ip32, struct ipc_perm *ip)
-{
-
-	CP(*ip32, *ip, cuid);
-	CP(*ip32, *ip, cgid);
-	CP(*ip32, *ip, uid);
-	CP(*ip32, *ip, gid);
-	CP(*ip32, *ip, mode);
-	CP(*ip32, *ip, seq);
-	CP(*ip32, *ip, key);
-}
-
-static void
-freebsd32_ipcperm_old_out(struct ipc_perm *ip, struct ipc_perm32_old *ip32)
-{
-
-	CP(*ip, *ip32, cuid);
-	CP(*ip, *ip32, cgid);
-	CP(*ip, *ip32, uid);
-	CP(*ip, *ip32, gid);
-	CP(*ip, *ip32, mode);
-	CP(*ip, *ip32, seq);
-	CP(*ip, *ip32, key);
-}
-#endif
-
-static void
-freebsd32_ipcperm_in(struct ipc_perm32 *ip32, struct ipc_perm *ip)
-{
-
-	CP(*ip32, *ip, cuid);
-	CP(*ip32, *ip, cgid);
-	CP(*ip32, *ip, uid);
-	CP(*ip32, *ip, gid);
-	CP(*ip32, *ip, mode);
-	CP(*ip32, *ip, seq);
-	CP(*ip32, *ip, key);
-}
-
-static void
-freebsd32_ipcperm_out(struct ipc_perm *ip, struct ipc_perm32 *ip32)
-{
-
-	CP(*ip, *ip32, cuid);
-	CP(*ip, *ip32, cgid);
-	CP(*ip, *ip32, uid);
-	CP(*ip, *ip32, gid);
-	CP(*ip, *ip32, mode);
-	CP(*ip, *ip32, seq);
-	CP(*ip, *ip32, key);
-}
 
 int
 freebsd32_semsys(struct thread *td, struct freebsd32_semsys_args *uap)

Modified: stable/8/sys/kern/sysv_ipc.c
==============================================================================
--- stable/8/sys/kern/sysv_ipc.c	Wed Apr  7 14:28:47 2010	(r206347)
+++ stable/8/sys/kern/sysv_ipc.c	Wed Apr  7 14:35:09 2010	(r206348)
@@ -178,3 +178,69 @@ ipcperm_new2old(struct ipc_perm *new, st
 	old->key = new->key;
 }
 #endif
+
+#ifdef COMPAT_FREEBSD32
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#if defined(COMPAT_FREEBSD4) || defined(COMPAT_FREEBSD5) || \
+    defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD7)
+void
+freebsd32_ipcperm_old_in(struct ipc_perm32_old *ip32, struct ipc_perm *ip)
+{
+
+	CP(*ip32, *ip, cuid);
+	CP(*ip32, *ip, cgid);
+	CP(*ip32, *ip, uid);
+	CP(*ip32, *ip, gid);
+	CP(*ip32, *ip, mode);
+	CP(*ip32, *ip, seq);
+	CP(*ip32, *ip, key);
+}
+
+void
+freebsd32_ipcperm_old_out(struct ipc_perm *ip, struct ipc_perm32_old *ip32)
+{
+
+	CP(*ip, *ip32, cuid);
+	CP(*ip, *ip32, cgid);
+	CP(*ip, *ip32, uid);
+	CP(*ip, *ip32, gid);
+	CP(*ip, *ip32, mode);
+	CP(*ip, *ip32, seq);
+	CP(*ip, *ip32, key);
+}
+#endif
+
+void
+freebsd32_ipcperm_in(struct ipc_perm32 *ip32, struct ipc_perm *ip)
+{
+
+	CP(*ip32, *ip, cuid);
+	CP(*ip32, *ip, cgid);
+	CP(*ip32, *ip, uid);
+	CP(*ip32, *ip, gid);
+	CP(*ip32, *ip, mode);
+	CP(*ip32, *ip, seq);
+	CP(*ip32, *ip, key);
+}
+
+void
+freebsd32_ipcperm_out(struct ipc_perm *ip, struct ipc_perm32 *ip32)
+{
+
+	CP(*ip, *ip32, cuid);
+	CP(*ip, *ip32, cgid);
+	CP(*ip, *ip32, uid);
+	CP(*ip, *ip32, gid);
+	CP(*ip, *ip32, mode);
+	CP(*ip, *ip32, seq);
+	CP(*ip, *ip32, key);
+}
+#endif

From owner-svn-src-stable-8@FreeBSD.ORG  Wed Apr  7 14:46:29 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 32A80106564A;
	Wed,  7 Apr 2010 14:46: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 1FE9C8FC1C;
	Wed,  7 Apr 2010 14:46:29 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o37EkTHh025680;
	Wed, 7 Apr 2010 14:46:29 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o37EkTZ1025674;
	Wed, 7 Apr 2010 14:46:29 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201004071446.o37EkTZ1025674@svn.freebsd.org>
From: Konstantin Belousov 
Date: Wed, 7 Apr 2010 14:46:29 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206349 - in stable/8/sys: compat/freebsd32 kern
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Wed, 07 Apr 2010 14:46:29 -0000

Author: kib
Date: Wed Apr  7 14:46:28 2010
New Revision: 206349
URL: http://svn.freebsd.org/changeset/base/206349

Log:
  MFC r205323:
  Move SysV IPC freebsd32 compat shims from freebsd32_misc.c to corresponding
  sysv_{msg,sem,shm}.c files.
  
  Mark SysV IPC freebsd32 syscalls as NOSTD and add required
  SYSCALL_INIT_HELPER/SYSCALL32_INIT_HELPERs to provide auto
  register/unregister on module load.
  
  This makes COMPAT_FREEBSD32 functional with SysV IPC compiled and loaded
  as modules.

Modified:
  stable/8/sys/compat/freebsd32/freebsd32_misc.c
  stable/8/sys/compat/freebsd32/syscalls.master
  stable/8/sys/kern/sysv_msg.c
  stable/8/sys/kern/sysv_sem.c
  stable/8/sys/kern/sysv_shm.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/compat/freebsd32/freebsd32_misc.c
==============================================================================
--- stable/8/sys/compat/freebsd32/freebsd32_misc.c	Wed Apr  7 14:35:09 2010	(r206348)
+++ stable/8/sys/compat/freebsd32/freebsd32_misc.c	Wed Apr  7 14:46:28 2010	(r206349)
@@ -1402,536 +1402,6 @@ freebsd4_freebsd32_fhstatfs(struct threa
 
 
 int
-freebsd32_semsys(struct thread *td, struct freebsd32_semsys_args *uap)
-{
-
-#if defined(COMPAT_FREEBSD4) || defined(COMPAT_FREEBSD5) || \
-    defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD7)
-	switch (uap->which) {
-	case 0:
-		return (freebsd7_freebsd32_semctl(td,
-		    (struct freebsd7_freebsd32_semctl_args *)&uap->a2));
-	default:
-		return (semsys(td, (struct semsys_args *)uap));
-	}
-#else
-	return (nosys(td, NULL));
-#endif
-}
-
-#if defined(COMPAT_FREEBSD4) || defined(COMPAT_FREEBSD5) || \
-    defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD7)
-int
-freebsd7_freebsd32_semctl(struct thread *td,
-    struct freebsd7_freebsd32_semctl_args *uap)
-{
-	struct semid_ds32_old dsbuf32;
-	struct semid_ds dsbuf;
-	union semun semun;
-	union semun32 arg;
-	register_t rval;
-	int error;
-
-	switch (uap->cmd) {
-	case SEM_STAT:
-	case IPC_SET:
-	case IPC_STAT:
-	case GETALL:
-	case SETVAL:
-	case SETALL:
-		error = copyin(uap->arg, &arg, sizeof(arg));
-		if (error)
-			return (error);		
-		break;
-	}
-
-	switch (uap->cmd) {
-	case SEM_STAT:
-	case IPC_STAT:
-		semun.buf = &dsbuf;
-		break;
-	case IPC_SET:
-		error = copyin(PTRIN(arg.buf), &dsbuf32, sizeof(dsbuf32));
-		if (error)
-			return (error);
-		freebsd32_ipcperm_old_in(&dsbuf32.sem_perm, &dsbuf.sem_perm);
-		PTRIN_CP(dsbuf32, dsbuf, sem_base);
-		CP(dsbuf32, dsbuf, sem_nsems);
-		CP(dsbuf32, dsbuf, sem_otime);
-		CP(dsbuf32, dsbuf, sem_ctime);
-		semun.buf = &dsbuf;
-		break;
-	case GETALL:
-	case SETALL:
-		semun.array = PTRIN(arg.array);
-		break;
-	case SETVAL:
-		semun.val = arg.val;
-		break;
-	}
-
-	error = kern_semctl(td, uap->semid, uap->semnum, uap->cmd, &semun,
-	    &rval);
-	if (error)
-		return (error);
-
-	switch (uap->cmd) {
-	case SEM_STAT:
-	case IPC_STAT:
-		bzero(&dsbuf32, sizeof(dsbuf32));
-		freebsd32_ipcperm_old_out(&dsbuf.sem_perm, &dsbuf32.sem_perm);
-		PTROUT_CP(dsbuf, dsbuf32, sem_base);
-		CP(dsbuf, dsbuf32, sem_nsems);
-		CP(dsbuf, dsbuf32, sem_otime);
-		CP(dsbuf, dsbuf32, sem_ctime);
-		error = copyout(&dsbuf32, PTRIN(arg.buf), sizeof(dsbuf32));
-		break;
-	}
-
-	if (error == 0)
-		td->td_retval[0] = rval;
-	return (error);
-}
-#endif
-
-int
-freebsd32_semctl(struct thread *td, struct freebsd32_semctl_args *uap)
-{
-	struct semid_ds32 dsbuf32;
-	struct semid_ds dsbuf;
-	union semun semun;
-	union semun32 arg;
-	register_t rval;
-	int error;
-
-	switch (uap->cmd) {
-	case SEM_STAT:
-	case IPC_SET:
-	case IPC_STAT:
-	case GETALL:
-	case SETVAL:
-	case SETALL:
-		error = copyin(uap->arg, &arg, sizeof(arg));
-		if (error)
-			return (error);		
-		break;
-	}
-
-	switch (uap->cmd) {
-	case SEM_STAT:
-	case IPC_STAT:
-		semun.buf = &dsbuf;
-		break;
-	case IPC_SET:
-		error = copyin(PTRIN(arg.buf), &dsbuf32, sizeof(dsbuf32));
-		if (error)
-			return (error);
-		freebsd32_ipcperm_in(&dsbuf32.sem_perm, &dsbuf.sem_perm);
-		PTRIN_CP(dsbuf32, dsbuf, sem_base);
-		CP(dsbuf32, dsbuf, sem_nsems);
-		CP(dsbuf32, dsbuf, sem_otime);
-		CP(dsbuf32, dsbuf, sem_ctime);
-		semun.buf = &dsbuf;
-		break;
-	case GETALL:
-	case SETALL:
-		semun.array = PTRIN(arg.array);
-		break;
-	case SETVAL:
-		semun.val = arg.val;
-		break;		
-	}
-
-	error = kern_semctl(td, uap->semid, uap->semnum, uap->cmd, &semun,
-	    &rval);
-	if (error)
-		return (error);
-
-	switch (uap->cmd) {
-	case SEM_STAT:
-	case IPC_STAT:
-		bzero(&dsbuf32, sizeof(dsbuf32));
-		freebsd32_ipcperm_out(&dsbuf.sem_perm, &dsbuf32.sem_perm);
-		PTROUT_CP(dsbuf, dsbuf32, sem_base);
-		CP(dsbuf, dsbuf32, sem_nsems);
-		CP(dsbuf, dsbuf32, sem_otime);
-		CP(dsbuf, dsbuf32, sem_ctime);
-		error = copyout(&dsbuf32, PTRIN(arg.buf), sizeof(dsbuf32));
-		break;
-	}
-
-	if (error == 0)
-		td->td_retval[0] = rval;
-	return (error);
-}
-
-int
-freebsd32_msgsys(struct thread *td, struct freebsd32_msgsys_args *uap)
-{
-
-#if defined(COMPAT_FREEBSD4) || defined(COMPAT_FREEBSD5) || \
-    defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD7)
-	switch (uap->which) {
-	case 0:
-		return (freebsd7_freebsd32_msgctl(td,
-		    (struct freebsd7_freebsd32_msgctl_args *)&uap->a2));
-	case 2:
-		return (freebsd32_msgsnd(td,
-		    (struct freebsd32_msgsnd_args *)&uap->a2));
-	case 3:
-		return (freebsd32_msgrcv(td,
-		    (struct freebsd32_msgrcv_args *)&uap->a2));
-	default:
-		return (msgsys(td, (struct msgsys_args *)uap));
-	}
-#else
-	return (nosys(td, NULL));
-#endif
-}
-
-#if defined(COMPAT_FREEBSD4) || defined(COMPAT_FREEBSD5) || \
-    defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD7)
-int
-freebsd7_freebsd32_msgctl(struct thread *td,
-    struct freebsd7_freebsd32_msgctl_args *uap)
-{
-	struct msqid_ds msqbuf;
-	struct msqid_ds32_old msqbuf32;
-	int error;
-
-	if (uap->cmd == IPC_SET) {
-		error = copyin(uap->buf, &msqbuf32, sizeof(msqbuf32));
-		if (error)
-			return (error);
-		freebsd32_ipcperm_old_in(&msqbuf32.msg_perm, &msqbuf.msg_perm);
-		PTRIN_CP(msqbuf32, msqbuf, msg_first);
-		PTRIN_CP(msqbuf32, msqbuf, msg_last);
-		CP(msqbuf32, msqbuf, msg_cbytes);
-		CP(msqbuf32, msqbuf, msg_qnum);
-		CP(msqbuf32, msqbuf, msg_qbytes);
-		CP(msqbuf32, msqbuf, msg_lspid);
-		CP(msqbuf32, msqbuf, msg_lrpid);
-		CP(msqbuf32, msqbuf, msg_stime);
-		CP(msqbuf32, msqbuf, msg_rtime);
-		CP(msqbuf32, msqbuf, msg_ctime);
-	}
-	error = kern_msgctl(td, uap->msqid, uap->cmd, &msqbuf);
-	if (error)
-		return (error);
-	if (uap->cmd == IPC_STAT) {
-		bzero(&msqbuf32, sizeof(msqbuf32));
-		freebsd32_ipcperm_old_out(&msqbuf.msg_perm, &msqbuf32.msg_perm);
-		PTROUT_CP(msqbuf, msqbuf32, msg_first);
-		PTROUT_CP(msqbuf, msqbuf32, msg_last);
-		CP(msqbuf, msqbuf32, msg_cbytes);
-		CP(msqbuf, msqbuf32, msg_qnum);
-		CP(msqbuf, msqbuf32, msg_qbytes);
-		CP(msqbuf, msqbuf32, msg_lspid);
-		CP(msqbuf, msqbuf32, msg_lrpid);
-		CP(msqbuf, msqbuf32, msg_stime);
-		CP(msqbuf, msqbuf32, msg_rtime);
-		CP(msqbuf, msqbuf32, msg_ctime);
-		error = copyout(&msqbuf32, uap->buf, sizeof(struct msqid_ds32));
-	}
-	return (error);
-}
-#endif
-
-int
-freebsd32_msgctl(struct thread *td, struct freebsd32_msgctl_args *uap)
-{
-	struct msqid_ds msqbuf;
-	struct msqid_ds32 msqbuf32;
-	int error;
-
-	if (uap->cmd == IPC_SET) {
-		error = copyin(uap->buf, &msqbuf32, sizeof(msqbuf32));
-		if (error)
-			return (error);
-		freebsd32_ipcperm_in(&msqbuf32.msg_perm, &msqbuf.msg_perm);
-		PTRIN_CP(msqbuf32, msqbuf, msg_first);
-		PTRIN_CP(msqbuf32, msqbuf, msg_last);
-		CP(msqbuf32, msqbuf, msg_cbytes);
-		CP(msqbuf32, msqbuf, msg_qnum);
-		CP(msqbuf32, msqbuf, msg_qbytes);
-		CP(msqbuf32, msqbuf, msg_lspid);
-		CP(msqbuf32, msqbuf, msg_lrpid);
-		CP(msqbuf32, msqbuf, msg_stime);
-		CP(msqbuf32, msqbuf, msg_rtime);
-		CP(msqbuf32, msqbuf, msg_ctime);
-	}
-	error = kern_msgctl(td, uap->msqid, uap->cmd, &msqbuf);
-	if (error)
-		return (error);
-	if (uap->cmd == IPC_STAT) {
-		freebsd32_ipcperm_out(&msqbuf.msg_perm, &msqbuf32.msg_perm);
-		PTROUT_CP(msqbuf, msqbuf32, msg_first);
-		PTROUT_CP(msqbuf, msqbuf32, msg_last);
-		CP(msqbuf, msqbuf32, msg_cbytes);
-		CP(msqbuf, msqbuf32, msg_qnum);
-		CP(msqbuf, msqbuf32, msg_qbytes);
-		CP(msqbuf, msqbuf32, msg_lspid);
-		CP(msqbuf, msqbuf32, msg_lrpid);
-		CP(msqbuf, msqbuf32, msg_stime);
-		CP(msqbuf, msqbuf32, msg_rtime);
-		CP(msqbuf, msqbuf32, msg_ctime);
-		error = copyout(&msqbuf32, uap->buf, sizeof(struct msqid_ds32));
-	}
-	return (error);
-}
-
-int
-freebsd32_msgsnd(struct thread *td, struct freebsd32_msgsnd_args *uap)
-{
-	const void *msgp;
-	long mtype;
-	int32_t mtype32;
-	int error;
-
-	msgp = PTRIN(uap->msgp);
-	if ((error = copyin(msgp, &mtype32, sizeof(mtype32))) != 0)
-		return (error);
-	mtype = mtype32;
-	return (kern_msgsnd(td, uap->msqid,
-	    (const char *)msgp + sizeof(mtype32),
-	    uap->msgsz, uap->msgflg, mtype));
-}
-
-int
-freebsd32_msgrcv(struct thread *td, struct freebsd32_msgrcv_args *uap)
-{
-	void *msgp;
-	long mtype;
-	int32_t mtype32;
-	int error;
-
-	msgp = PTRIN(uap->msgp);
-	if ((error = kern_msgrcv(td, uap->msqid,
-	    (char *)msgp + sizeof(mtype32), uap->msgsz,
-	    uap->msgtyp, uap->msgflg, &mtype)) != 0)
-		return (error);
-	mtype32 = (int32_t)mtype;
-	return (copyout(&mtype32, msgp, sizeof(mtype32)));
-}
-
-int
-freebsd32_shmsys(struct thread *td, struct freebsd32_shmsys_args *uap)
-{
-
-#if defined(COMPAT_FREEBSD4) || defined(COMPAT_FREEBSD5) || \
-    defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD7)
-	switch (uap->which) {
-	case 0:	{	/* shmat */
-		struct shmat_args ap;
-
-		ap.shmid = uap->a2;
-		ap.shmaddr = PTRIN(uap->a3);
-		ap.shmflg = uap->a4;
-		return (sysent[SYS_shmat].sy_call(td, &ap));
-	}
-	case 2: {	/* shmdt */
-		struct shmdt_args ap;
-
-		ap.shmaddr = PTRIN(uap->a2);
-		return (sysent[SYS_shmdt].sy_call(td, &ap));
-	}
-	case 3: {	/* shmget */
-		struct shmget_args ap;
-
-		ap.key = uap->a2;
-		ap.size = uap->a3;
-		ap.shmflg = uap->a4;
-		return (sysent[SYS_shmget].sy_call(td, &ap));
-	}
-	case 4: {	/* shmctl */
-		struct freebsd7_freebsd32_shmctl_args ap;
-
-		ap.shmid = uap->a2;
-		ap.cmd = uap->a3;
-		ap.buf = PTRIN(uap->a4);
-		return (freebsd7_freebsd32_shmctl(td, &ap));
-	}
-	case 1:		/* oshmctl */
-	default:
-		return (EINVAL);
-	}
-#else
-	return (nosys(td, NULL));
-#endif
-}
-
-#if defined(COMPAT_FREEBSD4) || defined(COMPAT_FREEBSD5) || \
-    defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD7)
-int
-freebsd7_freebsd32_shmctl(struct thread *td,
-    struct freebsd7_freebsd32_shmctl_args *uap)
-{
-	int error = 0;
-	union {
-		struct shmid_ds shmid_ds;
-		struct shm_info shm_info;
-		struct shminfo shminfo;
-	} u;
-	union {
-		struct shmid_ds32_old shmid_ds32;
-		struct shm_info32 shm_info32;
-		struct shminfo32 shminfo32;
-	} u32;
-	size_t sz;
-
-	if (uap->cmd == IPC_SET) {
-		if ((error = copyin(uap->buf, &u32.shmid_ds32,
-		    sizeof(u32.shmid_ds32))))
-			goto done;
-		freebsd32_ipcperm_old_in(&u32.shmid_ds32.shm_perm,
-		    &u.shmid_ds.shm_perm);
-		CP(u32.shmid_ds32, u.shmid_ds, shm_segsz);
-		CP(u32.shmid_ds32, u.shmid_ds, shm_lpid);
-		CP(u32.shmid_ds32, u.shmid_ds, shm_cpid);
-		CP(u32.shmid_ds32, u.shmid_ds, shm_nattch);
-		CP(u32.shmid_ds32, u.shmid_ds, shm_atime);
-		CP(u32.shmid_ds32, u.shmid_ds, shm_dtime);
-		CP(u32.shmid_ds32, u.shmid_ds, shm_ctime);
-	}
-	
-	error = kern_shmctl(td, uap->shmid, uap->cmd, (void *)&u, &sz);
-	if (error)
-		goto done;
-	
-	/* Cases in which we need to copyout */
-	switch (uap->cmd) {
-	case IPC_INFO:
-		CP(u.shminfo, u32.shminfo32, shmmax);
-		CP(u.shminfo, u32.shminfo32, shmmin);
-		CP(u.shminfo, u32.shminfo32, shmmni);
-		CP(u.shminfo, u32.shminfo32, shmseg);
-		CP(u.shminfo, u32.shminfo32, shmall);
-		error = copyout(&u32.shminfo32, uap->buf,
-		    sizeof(u32.shminfo32));
-		break;
-	case SHM_INFO:
-		CP(u.shm_info, u32.shm_info32, used_ids);
-		CP(u.shm_info, u32.shm_info32, shm_rss);
-		CP(u.shm_info, u32.shm_info32, shm_tot);
-		CP(u.shm_info, u32.shm_info32, shm_swp);
-		CP(u.shm_info, u32.shm_info32, swap_attempts);
-		CP(u.shm_info, u32.shm_info32, swap_successes);
-		error = copyout(&u32.shm_info32, uap->buf,
-		    sizeof(u32.shm_info32));
-		break;
-	case SHM_STAT:
-	case IPC_STAT:
-		freebsd32_ipcperm_old_out(&u.shmid_ds.shm_perm,
-		    &u32.shmid_ds32.shm_perm);
-		if (u.shmid_ds.shm_segsz > INT32_MAX)
-			u32.shmid_ds32.shm_segsz = INT32_MAX;
-		else
-			CP(u.shmid_ds, u32.shmid_ds32, shm_segsz);
-		CP(u.shmid_ds, u32.shmid_ds32, shm_lpid);
-		CP(u.shmid_ds, u32.shmid_ds32, shm_cpid);
-		CP(u.shmid_ds, u32.shmid_ds32, shm_nattch);
-		CP(u.shmid_ds, u32.shmid_ds32, shm_atime);
-		CP(u.shmid_ds, u32.shmid_ds32, shm_dtime);
-		CP(u.shmid_ds, u32.shmid_ds32, shm_ctime);
-		u32.shmid_ds32.shm_internal = 0;
-		error = copyout(&u32.shmid_ds32, uap->buf,
-		    sizeof(u32.shmid_ds32));
-		break;
-	}
-
-done:
-	if (error) {
-		/* Invalidate the return value */
-		td->td_retval[0] = -1;
-	}
-	return (error);
-}
-#endif
-
-int
-freebsd32_shmctl(struct thread *td, struct freebsd32_shmctl_args *uap)
-{
-	int error = 0;
-	union {
-		struct shmid_ds shmid_ds;
-		struct shm_info shm_info;
-		struct shminfo shminfo;
-	} u;
-	union {
-		struct shmid_ds32 shmid_ds32;
-		struct shm_info32 shm_info32;
-		struct shminfo32 shminfo32;
-	} u32;
-	size_t sz;
-	
-	if (uap->cmd == IPC_SET) {
-		if ((error = copyin(uap->buf, &u32.shmid_ds32,
-		    sizeof(u32.shmid_ds32))))
-			goto done;
-		freebsd32_ipcperm_in(&u32.shmid_ds32.shm_perm,
-		    &u.shmid_ds.shm_perm);
-		CP(u32.shmid_ds32, u.shmid_ds, shm_segsz);
-		CP(u32.shmid_ds32, u.shmid_ds, shm_lpid);
-		CP(u32.shmid_ds32, u.shmid_ds, shm_cpid);
-		CP(u32.shmid_ds32, u.shmid_ds, shm_nattch);
-		CP(u32.shmid_ds32, u.shmid_ds, shm_atime);
-		CP(u32.shmid_ds32, u.shmid_ds, shm_dtime);
-		CP(u32.shmid_ds32, u.shmid_ds, shm_ctime);
-	}
-	
-	error = kern_shmctl(td, uap->shmid, uap->cmd, (void *)&u, &sz);
-	if (error)
-		goto done;
-	
-	/* Cases in which we need to copyout */
-	switch (uap->cmd) {
-	case IPC_INFO:
-		CP(u.shminfo, u32.shminfo32, shmmax);
-		CP(u.shminfo, u32.shminfo32, shmmin);
-		CP(u.shminfo, u32.shminfo32, shmmni);
-		CP(u.shminfo, u32.shminfo32, shmseg);
-		CP(u.shminfo, u32.shminfo32, shmall);
-		error = copyout(&u32.shminfo32, uap->buf,
-		    sizeof(u32.shminfo32));
-		break;
-	case SHM_INFO:
-		CP(u.shm_info, u32.shm_info32, used_ids);
-		CP(u.shm_info, u32.shm_info32, shm_rss);
-		CP(u.shm_info, u32.shm_info32, shm_tot);
-		CP(u.shm_info, u32.shm_info32, shm_swp);
-		CP(u.shm_info, u32.shm_info32, swap_attempts);
-		CP(u.shm_info, u32.shm_info32, swap_successes);
-		error = copyout(&u32.shm_info32, uap->buf,
-		    sizeof(u32.shm_info32));
-		break;
-	case SHM_STAT:
-	case IPC_STAT:
-		freebsd32_ipcperm_out(&u.shmid_ds.shm_perm,
-		    &u32.shmid_ds32.shm_perm);
-		if (u.shmid_ds.shm_segsz > INT32_MAX)
-			u32.shmid_ds32.shm_segsz = INT32_MAX;
-		else
-			CP(u.shmid_ds, u32.shmid_ds32, shm_segsz);
-		CP(u.shmid_ds, u32.shmid_ds32, shm_lpid);
-		CP(u.shmid_ds, u32.shmid_ds32, shm_cpid);
-		CP(u.shmid_ds, u32.shmid_ds32, shm_nattch);
-		CP(u.shmid_ds, u32.shmid_ds32, shm_atime);
-		CP(u.shmid_ds, u32.shmid_ds32, shm_dtime);
-		CP(u.shmid_ds, u32.shmid_ds32, shm_ctime);
-		error = copyout(&u32.shmid_ds32, uap->buf,
-		    sizeof(u32.shmid_ds32));
-		break;
-	}
-
-done:
-	if (error) {
-		/* Invalidate the return value */
-		td->td_retval[0] = -1;
-	}
-	return (error);
-}
-
-int
 freebsd32_pread(struct thread *td, struct freebsd32_pread_args *uap)
 {
 	struct pread_args ap;

Modified: stable/8/sys/compat/freebsd32/syscalls.master
==============================================================================
--- stable/8/sys/compat/freebsd32/syscalls.master	Wed Apr  7 14:35:09 2010	(r206348)
+++ stable/8/sys/compat/freebsd32/syscalls.master	Wed Apr  7 14:46:28 2010	(r206349)
@@ -310,11 +310,11 @@
 				    struct rtprio *rtp); }
 167	AUE_NULL	UNIMPL	nosys
 168	AUE_NULL	UNIMPL	nosys
-169	AUE_SEMSYS	STD	{ int freebsd32_semsys(int which, int a2, \
+169	AUE_SEMSYS	NOSTD	{ int freebsd32_semsys(int which, int a2, \
 				    int a3, int a4, int a5); }
-170	AUE_MSGSYS	STD	{ int freebsd32_msgsys(int which, int a2, \
+170	AUE_MSGSYS	NOSTD	{ int freebsd32_msgsys(int which, int a2, \
 				    int a3, int a4, int a5, int a6); }
-171	AUE_SHMSYS	STD	{ int freebsd32_shmsys(uint32_t which, uint32_t a2, \
+171	AUE_SHMSYS	NOSTD	{ int freebsd32_shmsys(uint32_t which, uint32_t a2, \
 				    uint32_t a3, uint32_t a4); }
 172	AUE_NULL	UNIMPL	nosys
 173	AUE_PREAD	COMPAT6	{ ssize_t freebsd32_pread(int fd, void *buf, \
@@ -402,26 +402,29 @@
 ; The following were introduced with NetBSD/4.4Lite-2
 ; They are initialized by their respective modules/sysinits
 ; XXX PROBLEM!!
-220	AUE_SEMCTL	COMPAT7	{ int freebsd32_semctl(int semid, int semnum, \
+220	AUE_SEMCTL	COMPAT7|NOSTD	{ int freebsd32_semctl( \
+				    int semid, int semnum, \
 				    int cmd, union semun32 *arg); }
-221	AUE_SEMGET	NOPROTO	{ int semget(key_t key, int nsems, \
+221	AUE_SEMGET	NOSTD|NOPROTO	{ int semget(key_t key, int nsems, \
 				    int semflg); }
-222	AUE_SEMOP	NOPROTO	{ int semop(int semid, struct sembuf *sops, \
-				    u_int nsops); }
+222	AUE_SEMOP	NOSTD|NOPROTO	{ int semop(int semid, \
+				    struct sembuf *sops, u_int nsops); }
 223	AUE_NULL	UNIMPL	semconfig
-224	AUE_MSGCTL	COMPAT7	{ int freebsd32_msgctl(int msqid, int cmd, \
+224	AUE_MSGCTL	COMPAT7|NOSTD	{ int freebsd32_msgctl( \
+				    int msqid, int cmd, \
 				    struct msqid_ds32_old *buf); }
-225	AUE_MSGGET	NOPROTO	{ int msgget(key_t key, int msgflg); }
-226	AUE_MSGSND	STD	{ int freebsd32_msgsnd(int msqid, void *msgp, \
+225	AUE_MSGGET	NOSTD|NOPROTO	{ int msgget(key_t key, int msgflg); }
+226	AUE_MSGSND	NOSTD	{ int freebsd32_msgsnd(int msqid, void *msgp, \
 				    size_t msgsz, int msgflg); }
-227	AUE_MSGRCV	STD	{ int freebsd32_msgrcv(int msqid, void *msgp, \
+227	AUE_MSGRCV	NOSTD	{ int freebsd32_msgrcv(int msqid, void *msgp, \
 				    size_t msgsz, long msgtyp, int msgflg); }
-228	AUE_SHMAT	NOPROTO	{ int shmat(int shmid, void *shmaddr, \
+228	AUE_SHMAT	NOSTD|NOPROTO	{ int shmat(int shmid, void *shmaddr, \
 				    int shmflg); }
-229	AUE_SHMCTL	COMPAT7	{ int freebsd32_shmctl(int shmid, int cmd, \
+229	AUE_SHMCTL	COMPAT7|NOSTD	{ int freebsd32_shmctl( \
+				    int shmid, int cmd, \
 				    struct shmid_ds32_old *buf); }
-230	AUE_SHMDT	NOPROTO	{ int shmdt(void *shmaddr); }
-231	AUE_SHMGET	NOPROTO	{ int shmget(key_t key, int size, \
+230	AUE_SHMDT	NOSTD|NOPROTO	{ int shmdt(void *shmaddr); }
+231	AUE_SHMGET	NOSTD|NOPROTO	{ int shmget(key_t key, int size, \
 				    int shmflg); }
 ;
 232	AUE_NULL	STD 	{ int freebsd32_clock_gettime(clockid_t clock_id, \
@@ -926,11 +929,11 @@
 				    unsigned int iovcnt, int flags); }
 508	AUE_NULL	NOPROTO	{ int jail_remove(int jid); }
 509	AUE_CLOSEFROM	NOPROTO	{ int closefrom(int lowfd); }
-510	AUE_SEMCTL	STD { int freebsd32_semctl(int semid, int semnum, \
+510	AUE_SEMCTL	NOSTD { int freebsd32_semctl(int semid, int semnum, \
 				    int cmd, union semun32 *arg); }
-511	AUE_MSGCTL	STD	{ int freebsd32_msgctl(int msqid, int cmd, \
+511	AUE_MSGCTL	NOSTD	{ int freebsd32_msgctl(int msqid, int cmd, \
 				    struct msqid_ds32 *buf); }
-512	AUE_SHMCTL	STD	{ int freebsd32_shmctl(int shmid, int cmd, \
+512	AUE_SHMCTL	NOSTD	{ int freebsd32_shmctl(int shmid, int cmd, \
 				    struct shmid_ds32 *buf); }
 513	AUE_LPATHCONF	NOPROTO	{ int lpathconf(char *path, int name); }
 514	AUE_CAP_NEW	UNIMPL	cap_new

Modified: stable/8/sys/kern/sysv_msg.c
==============================================================================
--- stable/8/sys/kern/sysv_msg.c	Wed Apr  7 14:35:09 2010	(r206348)
+++ stable/8/sys/kern/sysv_msg.c	Wed Apr  7 14:46:28 2010	(r206349)
@@ -74,7 +74,7 @@ __FBSDID("$FreeBSD$");
 
 static MALLOC_DEFINE(M_MSG, "msg", "SVID compatible message queues");
 
-static void msginit(void);
+static int msginit(void);
 static int msgunload(void);
 static int sysvmsg_modload(struct module *, int, void *);
 
@@ -152,10 +152,45 @@ static struct msg *msghdrs;	/* MSGTQL ms
 static struct msqid_kernel *msqids;	/* MSGMNI msqid_kernel struct's */
 static struct mtx msq_mtx;	/* global mutex for message queues. */
 
-static void
+static struct syscall_helper_data msg_syscalls[] = {
+	SYSCALL_INIT_HELPER(msgctl),
+	SYSCALL_INIT_HELPER(msgget),
+	SYSCALL_INIT_HELPER(msgsnd),
+	SYSCALL_INIT_HELPER(msgrcv),
+#if defined(COMPAT_FREEBSD4) || defined(COMPAT_FREEBSD5) || \
+    defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD7)
+	SYSCALL_INIT_HELPER(msgsys),
+	SYSCALL_INIT_HELPER(freebsd7_msgctl),
+#endif
+	SYSCALL_INIT_LAST
+};
+
+#ifdef COMPAT_FREEBSD32
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+static struct syscall_helper_data msg32_syscalls[] = {
+	SYSCALL32_INIT_HELPER(freebsd32_msgctl),
+	SYSCALL32_INIT_HELPER(freebsd32_msgsnd),
+	SYSCALL32_INIT_HELPER(freebsd32_msgrcv),
+	SYSCALL32_INIT_HELPER(msgget),
+	SYSCALL32_INIT_HELPER(freebsd32_msgsys),
+#if defined(COMPAT_FREEBSD4) || defined(COMPAT_FREEBSD5) || \
+    defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD7)
+	SYSCALL32_INIT_HELPER(freebsd7_freebsd32_msgctl),
+#endif
+	SYSCALL_INIT_LAST
+};
+#endif
+
+static int
 msginit()
 {
-	register int i;
+	int i, error;
 
 	TUNABLE_INT_FETCH("kern.ipc.msgseg", &msginfo.msgseg);
 	TUNABLE_INT_FETCH("kern.ipc.msgssz", &msginfo.msgssz);
@@ -235,6 +270,16 @@ msginit()
 #endif
 	}
 	mtx_init(&msq_mtx, "msq", NULL, MTX_DEF);
+
+	error = syscall_helper_register(msg_syscalls);
+	if (error != 0)
+		return (error);
+#ifdef COMPAT_FREEBSD32
+	error = syscall32_helper_register(msg32_syscalls);
+	if (error != 0)
+		return (error);
+#endif
+	return (0);
 }
 
 static int
@@ -246,6 +291,11 @@ msgunload()
 	int i;
 #endif
 
+	syscall_helper_unregister(msg_syscalls);
+#ifdef COMPAT_FREEBSD32
+	syscall32_helper_unregister(msg32_syscalls);
+#endif
+
 	for (msqid = 0; msqid < msginfo.msgmni; msqid++) {
 		/*
 		 * Look for an unallocated and unlocked msqid_ds.
@@ -283,7 +333,9 @@ sysvmsg_modload(struct module *module, i
 
 	switch (cmd) {
 	case MOD_LOAD:
-		msginit();
+		error = msginit();
+		if (error != 0)
+			msgunload();
 		break;
 	case MOD_UNLOAD:
 		error = msgunload();
@@ -303,11 +355,6 @@ static moduledata_t sysvmsg_mod = {
 	NULL
 };
 
-SYSCALL_MODULE_HELPER(msgctl);
-SYSCALL_MODULE_HELPER(msgget);
-SYSCALL_MODULE_HELPER(msgsnd);
-SYSCALL_MODULE_HELPER(msgrcv);
-
 DECLARE_MODULE(sysvmsg, sysvmsg_mod, SI_SUB_SYSV_MSG, SI_ORDER_FIRST);
 MODULE_VERSION(sysvmsg, 1);
 
@@ -1257,10 +1304,159 @@ SYSCTL_INT(_kern_ipc, OID_AUTO, msgseg, 
 SYSCTL_PROC(_kern_ipc, OID_AUTO, msqids, CTLFLAG_RD,
     NULL, 0, sysctl_msqids, "", "Message queue IDs");
 
+#ifdef COMPAT_FREEBSD32
+int
+freebsd32_msgsys(struct thread *td, struct freebsd32_msgsys_args *uap)
+{
+
+#if defined(COMPAT_FREEBSD4) || defined(COMPAT_FREEBSD5) || \
+    defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD7)
+	switch (uap->which) {
+	case 0:
+		return (freebsd7_freebsd32_msgctl(td,
+		    (struct freebsd7_freebsd32_msgctl_args *)&uap->a2));
+	case 2:
+		return (freebsd32_msgsnd(td,
+		    (struct freebsd32_msgsnd_args *)&uap->a2));
+	case 3:
+		return (freebsd32_msgrcv(td,
+		    (struct freebsd32_msgrcv_args *)&uap->a2));
+	default:
+		return (msgsys(td, (struct msgsys_args *)uap));
+	}
+#else
+	return (nosys(td, NULL));
+#endif
+}
+
+#if defined(COMPAT_FREEBSD4) || defined(COMPAT_FREEBSD5) || \
+    defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD7)
+int
+freebsd7_freebsd32_msgctl(struct thread *td,
+    struct freebsd7_freebsd32_msgctl_args *uap)
+{
+	struct msqid_ds msqbuf;
+	struct msqid_ds32_old msqbuf32;
+	int error;
+
+	if (uap->cmd == IPC_SET) {
+		error = copyin(uap->buf, &msqbuf32, sizeof(msqbuf32));
+		if (error)
+			return (error);
+		freebsd32_ipcperm_old_in(&msqbuf32.msg_perm, &msqbuf.msg_perm);
+		PTRIN_CP(msqbuf32, msqbuf, msg_first);
+		PTRIN_CP(msqbuf32, msqbuf, msg_last);
+		CP(msqbuf32, msqbuf, msg_cbytes);
+		CP(msqbuf32, msqbuf, msg_qnum);
+		CP(msqbuf32, msqbuf, msg_qbytes);
+		CP(msqbuf32, msqbuf, msg_lspid);
+		CP(msqbuf32, msqbuf, msg_lrpid);
+		CP(msqbuf32, msqbuf, msg_stime);
+		CP(msqbuf32, msqbuf, msg_rtime);
+		CP(msqbuf32, msqbuf, msg_ctime);
+	}
+	error = kern_msgctl(td, uap->msqid, uap->cmd, &msqbuf);
+	if (error)
+		return (error);
+	if (uap->cmd == IPC_STAT) {
+		bzero(&msqbuf32, sizeof(msqbuf32));
+		freebsd32_ipcperm_old_out(&msqbuf.msg_perm, &msqbuf32.msg_perm);
+		PTROUT_CP(msqbuf, msqbuf32, msg_first);
+		PTROUT_CP(msqbuf, msqbuf32, msg_last);
+		CP(msqbuf, msqbuf32, msg_cbytes);
+		CP(msqbuf, msqbuf32, msg_qnum);
+		CP(msqbuf, msqbuf32, msg_qbytes);
+		CP(msqbuf, msqbuf32, msg_lspid);
+		CP(msqbuf, msqbuf32, msg_lrpid);
+		CP(msqbuf, msqbuf32, msg_stime);
+		CP(msqbuf, msqbuf32, msg_rtime);
+		CP(msqbuf, msqbuf32, msg_ctime);
+		error = copyout(&msqbuf32, uap->buf, sizeof(struct msqid_ds32));
+	}
+	return (error);
+}
+#endif
+
+int
+freebsd32_msgctl(struct thread *td, struct freebsd32_msgctl_args *uap)
+{
+	struct msqid_ds msqbuf;
+	struct msqid_ds32 msqbuf32;
+	int error;
+
+	if (uap->cmd == IPC_SET) {
+		error = copyin(uap->buf, &msqbuf32, sizeof(msqbuf32));
+		if (error)
+			return (error);
+		freebsd32_ipcperm_in(&msqbuf32.msg_perm, &msqbuf.msg_perm);
+		PTRIN_CP(msqbuf32, msqbuf, msg_first);
+		PTRIN_CP(msqbuf32, msqbuf, msg_last);
+		CP(msqbuf32, msqbuf, msg_cbytes);
+		CP(msqbuf32, msqbuf, msg_qnum);
+		CP(msqbuf32, msqbuf, msg_qbytes);
+		CP(msqbuf32, msqbuf, msg_lspid);
+		CP(msqbuf32, msqbuf, msg_lrpid);
+		CP(msqbuf32, msqbuf, msg_stime);
+		CP(msqbuf32, msqbuf, msg_rtime);
+		CP(msqbuf32, msqbuf, msg_ctime);
+	}
+	error = kern_msgctl(td, uap->msqid, uap->cmd, &msqbuf);
+	if (error)
+		return (error);
+	if (uap->cmd == IPC_STAT) {
+		freebsd32_ipcperm_out(&msqbuf.msg_perm, &msqbuf32.msg_perm);
+		PTROUT_CP(msqbuf, msqbuf32, msg_first);
+		PTROUT_CP(msqbuf, msqbuf32, msg_last);
+		CP(msqbuf, msqbuf32, msg_cbytes);
+		CP(msqbuf, msqbuf32, msg_qnum);
+		CP(msqbuf, msqbuf32, msg_qbytes);
+		CP(msqbuf, msqbuf32, msg_lspid);
+		CP(msqbuf, msqbuf32, msg_lrpid);
+		CP(msqbuf, msqbuf32, msg_stime);
+		CP(msqbuf, msqbuf32, msg_rtime);
+		CP(msqbuf, msqbuf32, msg_ctime);
+		error = copyout(&msqbuf32, uap->buf, sizeof(struct msqid_ds32));
+	}
+	return (error);
+}
+
+int
+freebsd32_msgsnd(struct thread *td, struct freebsd32_msgsnd_args *uap)
+{
+	const void *msgp;
+	long mtype;
+	int32_t mtype32;
+	int error;
+
+	msgp = PTRIN(uap->msgp);
+	if ((error = copyin(msgp, &mtype32, sizeof(mtype32))) != 0)
+		return (error);
+	mtype = mtype32;
+	return (kern_msgsnd(td, uap->msqid,
+	    (const char *)msgp + sizeof(mtype32),
+	    uap->msgsz, uap->msgflg, mtype));
+}
+
+int
+freebsd32_msgrcv(struct thread *td, struct freebsd32_msgrcv_args *uap)
+{
+	void *msgp;
+	long mtype;
+	int32_t mtype32;
+	int error;
+
+	msgp = PTRIN(uap->msgp);
+	if ((error = kern_msgrcv(td, uap->msqid,
+	    (char *)msgp + sizeof(mtype32), uap->msgsz,
+	    uap->msgtyp, uap->msgflg, &mtype)) != 0)
+		return (error);
+	mtype32 = (int32_t)mtype;
+	return (copyout(&mtype32, msgp, sizeof(mtype32)));
+}
+#endif
+
 #if defined(COMPAT_FREEBSD4) || defined(COMPAT_FREEBSD5) || \
     defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD7)
-SYSCALL_MODULE_HELPER(msgsys);
-SYSCALL_MODULE_HELPER(freebsd7_msgctl);
 
 /* XXX casting to (sy_call_t *) is bogus, as usual. */
 static sy_call_t *msgcalls[] = {
@@ -1295,7 +1491,9 @@ msgsys(td, uap)
 	return (error);
 }
 
+#ifndef CP
 #define CP(src, dst, fld)	do { (dst).fld = (src).fld; } while (0)
+#endif
 
 #ifndef _SYS_SYSPROTO_H_
 struct freebsd7_msgctl_args {

Modified: stable/8/sys/kern/sysv_sem.c
==============================================================================
--- stable/8/sys/kern/sysv_sem.c	Wed Apr  7 14:35:09 2010	(r206348)
+++ stable/8/sys/kern/sysv_sem.c	Wed Apr  7 14:46:28 2010	(r206349)
@@ -70,7 +70,7 @@ static MALLOC_DEFINE(M_SEM, "sem", "SVID
 #define DPRINTF(a)
 #endif
 
-static void seminit(void);
+static int seminit(void);
 static int sysvsem_modload(struct module *, int, void *);
 static int semunload(void);
 static void semexit_myhook(void *arg, struct proc *p);
@@ -214,10 +214,43 @@ SYSCTL_INT(_kern_ipc, OID_AUTO, semaem, 
 SYSCTL_PROC(_kern_ipc, OID_AUTO, sema, CTLFLAG_RD,
     NULL, 0, sysctl_sema, "", "");
 
-static void
+static struct syscall_helper_data sem_syscalls[] = {
+	SYSCALL_INIT_HELPER(__semctl),
+	SYSCALL_INIT_HELPER(semget),
+	SYSCALL_INIT_HELPER(semop),
+#if defined(COMPAT_FREEBSD4) || defined(COMPAT_FREEBSD5) || \
+    defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD7)
+	SYSCALL_INIT_HELPER(semsys),
+	SYSCALL_INIT_HELPER(freebsd7___semctl),
+#endif
+	SYSCALL_INIT_LAST
+};
+
+#ifdef COMPAT_FREEBSD32
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+static struct syscall_helper_data sem32_syscalls[] = {
+	SYSCALL32_INIT_HELPER(freebsd32_semctl),
+	SYSCALL32_INIT_HELPER(semget),
+	SYSCALL32_INIT_HELPER(semop),
+	SYSCALL32_INIT_HELPER(freebsd32_semsys),
+#if defined(COMPAT_FREEBSD4) || defined(COMPAT_FREEBSD5) || \
+    defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD7)
+	SYSCALL32_INIT_HELPER(freebsd7_freebsd32_semctl),
+#endif
+	SYSCALL_INIT_LAST
+};
+#endif
+
+static int
 seminit(void)
 {
-	int i;
+	int i, error;
 
 	TUNABLE_INT_FETCH("kern.ipc.semmap", &seminfo.semmap);
 	TUNABLE_INT_FETCH("kern.ipc.semmni", &seminfo.semmni);
@@ -258,6 +291,16 @@ seminit(void)
 	mtx_init(&sem_undo_mtx, "semu", NULL, MTX_DEF);
 	semexit_tag = EVENTHANDLER_REGISTER(process_exit, semexit_myhook, NULL,
 	    EVENTHANDLER_PRI_ANY);
+
+	error = syscall_helper_register(sem_syscalls);
+	if (error != 0)
+		return (error);
+#ifdef COMPAT_FREEBSD32
+	error = syscall32_helper_register(sem32_syscalls);
+	if (error != 0)
+		return (error);
+#endif
+	return (0);
 }
 
 static int
@@ -269,6 +312,10 @@ semunload(void)
 	if (semtot != 0)
 		return (EBUSY);
 
+#ifdef COMPAT_FREEBSD32
+	syscall32_helper_unregister(sem32_syscalls);
+#endif
+	syscall_helper_unregister(sem_syscalls);
 	EVENTHANDLER_DEREGISTER(process_exit, semexit_tag);
 #ifdef MAC
 	for (i = 0; i < seminfo.semmni; i++)
@@ -292,7 +339,9 @@ sysvsem_modload(struct module *module, i
 
 	switch (cmd) {
 	case MOD_LOAD:
-		seminit();
+		error = seminit();
+		if (error != 0)
+			semunload();
 		break;
 	case MOD_UNLOAD:
 		error = semunload();
@@ -312,10 +361,6 @@ static moduledata_t sysvsem_mod = {
 	NULL
 };
 
-SYSCALL_MODULE_HELPER(__semctl);
-SYSCALL_MODULE_HELPER(semget);
-SYSCALL_MODULE_HELPER(semop);
-

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

From owner-svn-src-stable-8@FreeBSD.ORG  Wed Apr  7 14:47:56 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 04DC9106566B;
	Wed,  7 Apr 2010 14:47:56 +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 E7A418FC1B;
	Wed,  7 Apr 2010 14:47:55 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o37EltnX026058;
	Wed, 7 Apr 2010 14:47:55 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o37Elt9i026055;
	Wed, 7 Apr 2010 14:47:55 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201004071447.o37Elt9i026055@svn.freebsd.org>
From: Konstantin Belousov 
Date: Wed, 7 Apr 2010 14:47:55 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206350 - in stable/8/sys: compat/freebsd32 kern
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Wed, 07 Apr 2010 14:47:56 -0000

Author: kib
Date: Wed Apr  7 14:47:55 2010
New Revision: 206350
URL: http://svn.freebsd.org/changeset/base/206350

Log:
  MFC r205324:
  Implement compat32 shims for ksem syscalls.

Modified:
  stable/8/sys/compat/freebsd32/syscalls.master
  stable/8/sys/kern/uipc_sem.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/compat/freebsd32/syscalls.master
==============================================================================
--- stable/8/sys/compat/freebsd32/syscalls.master	Wed Apr  7 14:46:28 2010	(r206349)
+++ stable/8/sys/compat/freebsd32/syscalls.master	Wed Apr  7 14:47:55 2010	(r206350)
@@ -698,16 +698,19 @@
 398	AUE_FHSTATFS	NOPROTO	{ int fhstatfs(const struct fhandle *u_fhp, \
 				    struct statfs *buf); }
 399	AUE_NULL	UNIMPL	nosys
-; XXX implement these?
-400	AUE_NULL	UNIMPL	ksem_close
-401	AUE_NULL	UNIMPL	ksem_post
-402	AUE_NULL	UNIMPL	ksem_wait
-403	AUE_NULL	UNIMPL	ksem_trywait
-404	AUE_NULL	UNIMPL	ksem_init
-405	AUE_NULL	UNIMPL	ksem_open
-406	AUE_NULL	UNIMPL	ksem_unlink
-407	AUE_NULL	UNIMPL	ksem_getvalue
-408	AUE_NULL	UNIMPL	ksem_destroy
+400	AUE_NULL	NOSTD|NOPROTO	{ int ksem_close(semid_t id); }
+401	AUE_NULL	NOSTD|NOPROTO	{ int ksem_post(semid_t id); }
+402	AUE_NULL	NOSTD|NOPROTO	{ int ksem_wait(semid_t id); }
+403	AUE_NULL	NOSTD|NOPROTO	{ int ksem_trywait(semid_t id); }
+404	AUE_NULL	NOSTD	{ int freebsd32_ksem_init(semid_t *idp, \
+				    unsigned int value); }
+405	AUE_NULL	NOSTD	{ int freebsd32_ksem_open(semid_t *idp, \
+				    const char *name, int oflag, \
+				    mode_t mode, unsigned int value); }
+406	AUE_NULL	NOSTD|NOPROTO	{ int ksem_unlink(const char *name); }
+407	AUE_NULL	NOSTD|NOPROTO	{ int ksem_getvalue(semid_t id, \
+				    int *val); }
+408	AUE_NULL	NOSTD|NOPROTO	{ int ksem_destroy(semid_t id); }
 409	AUE_NULL	UNIMPL	__mac_get_pid
 410	AUE_NULL	UNIMPL	__mac_get_link
 411	AUE_NULL	UNIMPL	__mac_set_link
@@ -766,7 +769,8 @@
 				    const char *path, int attrnamespace, \
 				    void *data, size_t nbytes); }
 440	AUE_NULL	UNIMPL	kse_switchin
-441	AUE_NULL	UNIMPL	ksem_timedwait
+441	AUE_NULL	NOSTD	{ int freebsd32_ksem_timedwait(semid_t id, \
+				    const struct timespec32 *abstime); }
 442	AUE_NULL	STD	{ int freebsd32_thr_suspend( \
 				    const struct timespec32 *timeout); }
 443	AUE_NULL	NOPROTO	{ int thr_wake(long id); }

Modified: stable/8/sys/kern/uipc_sem.c
==============================================================================
--- stable/8/sys/kern/uipc_sem.c	Wed Apr  7 14:46:28 2010	(r206349)
+++ stable/8/sys/kern/uipc_sem.c	Wed Apr  7 14:47:55 2010	(r206350)
@@ -34,6 +34,7 @@
 #include 
 __FBSDID("$FreeBSD$");
 
+#include "opt_compat.h"
 #include "opt_posix.h"
 
 #include 
@@ -113,7 +114,7 @@ static struct ksem *ksem_alloc(struct uc
 		    unsigned int value);
 static int	ksem_create(struct thread *td, const char *path,
 		    semid_t *semidp, mode_t mode, unsigned int value,
-		    int flags);
+		    int flags, int compat32);
 static void	ksem_drop(struct ksem *ks);
 static int	ksem_get(struct thread *td, semid_t id, struct file **fpp);
 static struct ksem *ksem_hold(struct ksem *ks);
@@ -375,16 +376,44 @@ ksem_remove(char *path, Fnv32_t fnv, str
 	return (ENOENT);
 }
 
+static int
+ksem_create_copyout_semid(struct thread *td, semid_t *semidp, int fd,
+    int compat32)
+{
+	semid_t semid;
+#ifdef COMPAT_FREEBSD32
+	int32_t semid32;
+#endif
+	void *ptr;
+	size_t ptrs;
+
+#ifdef COMPAT_FREEBSD32
+	if (compat32) {
+		semid32 = fd;
+		ptr = &semid32;
+		ptrs = sizeof(semid32);
+	} else {
+#endif
+		semid = fd;
+		ptr = &semid;
+		ptrs = sizeof(semid);
+		compat32 = 0; /* silence gcc */
+#ifdef COMPAT_FREEBSD32
+	}
+#endif
+
+	return (copyout(ptr, semidp, ptrs));
+}
+
 /* Other helper routines. */
 static int
 ksem_create(struct thread *td, const char *name, semid_t *semidp, mode_t mode,
-    unsigned int value, int flags)
+    unsigned int value, int flags, int compat32)
 {
 	struct filedesc *fdp;
 	struct ksem *ks;
 	struct file *fp;
 	char *path;
-	semid_t semid;
 	Fnv32_t fnv;
 	int error, fd;
 
@@ -405,8 +434,7 @@ ksem_create(struct thread *td, const cha
 	 * premature, but it is a lot easier to handle errors as opposed
 	 * to later when we've possibly created a new semaphore, etc.
 	 */
-	semid = fd;
-	error = copyout(&semid, semidp, sizeof(semid));
+	error = ksem_create_copyout_semid(td, semidp, fd, compat32);
 	if (error) {
 		fdclose(fdp, fp, fd, td);
 		fdrop(fp, td);
@@ -531,7 +559,7 @@ ksem_init(struct thread *td, struct ksem
 {
 
 	return (ksem_create(td, NULL, uap->idp, S_IRWXU | S_IRWXG, uap->value,
-	    0));
+	    0, 0));
 }
 
 #ifndef _SYS_SYSPROTO_H_
@@ -552,7 +580,7 @@ ksem_open(struct thread *td, struct ksem
 	if ((uap->oflag & ~(O_CREAT | O_EXCL)) != 0)
 		return (EINVAL);
 	return (ksem_create(td, uap->name, uap->idp, uap->mode, uap->value,
-	    uap->oflag));
+	    uap->oflag, 0));
 }
 
 #ifndef _SYS_SYSPROTO_H_
@@ -833,38 +861,85 @@ err:
 	return (error);
 }
 
-#define	SYSCALL_DATA(syscallname)				\
-static int syscallname##_syscall = SYS_##syscallname;		\
-static int syscallname##_registered;				\
-static struct sysent syscallname##_old_sysent;			\
-MAKE_SYSENT(syscallname);
-
-#define	SYSCALL_REGISTER(syscallname) do {				\
-	error = syscall_register(& syscallname##_syscall,		\
-	    & syscallname##_sysent, & syscallname##_old_sysent);	\
-	if (error)							\
-		return (error);						\
-	syscallname##_registered = 1;					\
-} while(0)
-
-#define	SYSCALL_DEREGISTER(syscallname) do {				\
-	if (syscallname##_registered) {					\
-		syscallname##_registered = 0;				\
-		syscall_deregister(& syscallname##_syscall,		\
-		    & syscallname##_old_sysent);			\
-	}								\
-} while(0)
-
-SYSCALL_DATA(ksem_init);
-SYSCALL_DATA(ksem_open);
-SYSCALL_DATA(ksem_unlink);
-SYSCALL_DATA(ksem_close);
-SYSCALL_DATA(ksem_post);
-SYSCALL_DATA(ksem_wait);
-SYSCALL_DATA(ksem_timedwait);
-SYSCALL_DATA(ksem_trywait);
-SYSCALL_DATA(ksem_getvalue);
-SYSCALL_DATA(ksem_destroy);
+static struct syscall_helper_data ksem_syscalls[] = {
+	SYSCALL_INIT_HELPER(ksem_init),
+	SYSCALL_INIT_HELPER(ksem_open),
+	SYSCALL_INIT_HELPER(ksem_unlink),
+	SYSCALL_INIT_HELPER(ksem_close),
+	SYSCALL_INIT_HELPER(ksem_post),
+	SYSCALL_INIT_HELPER(ksem_wait),
+	SYSCALL_INIT_HELPER(ksem_timedwait),
+	SYSCALL_INIT_HELPER(ksem_trywait),
+	SYSCALL_INIT_HELPER(ksem_getvalue),
+	SYSCALL_INIT_HELPER(ksem_destroy),
+	SYSCALL_INIT_LAST
+};
+
+#ifdef COMPAT_FREEBSD32
+#include 
+#include 
+#include 
+#include 
+#include 
+
+int
+freebsd32_ksem_init(struct thread *td, struct freebsd32_ksem_init_args *uap)
+{
+
+	return (ksem_create(td, NULL, uap->idp, S_IRWXU | S_IRWXG, uap->value,
+	    0, 1));
+}
+
+int
+freebsd32_ksem_open(struct thread *td, struct freebsd32_ksem_open_args *uap)
+{
+
+	if ((uap->oflag & ~(O_CREAT | O_EXCL)) != 0)
+		return (EINVAL);
+	return (ksem_create(td, uap->name, uap->idp, uap->mode, uap->value,
+	    uap->oflag, 1));
+}
+
+int
+freebsd32_ksem_timedwait(struct thread *td,
+    struct freebsd32_ksem_timedwait_args *uap)
+{
+	struct timespec32 abstime32;
+	struct timespec *ts, abstime;
+	int error;
+
+	/*
+	 * We allow a null timespec (wait forever).
+	 */
+	if (uap->abstime == NULL)
+		ts = NULL;
+	else {
+		error = copyin(uap->abstime, &abstime32, sizeof(abstime32));
+		if (error != 0)
+			return (error);
+		CP(abstime32, abstime, tv_sec);
+		CP(abstime32, abstime, tv_nsec);
+		if (abstime.tv_nsec >= 1000000000 || abstime.tv_nsec < 0)
+			return (EINVAL);
+		ts = &abstime;
+	}
+	return (kern_sem_wait(td, uap->id, 0, ts));
+}
+
+static struct syscall_helper_data ksem32_syscalls[] = {
+	SYSCALL32_INIT_HELPER(freebsd32_ksem_init),
+	SYSCALL32_INIT_HELPER(freebsd32_ksem_open),
+	SYSCALL32_INIT_HELPER(ksem_unlink),
+	SYSCALL32_INIT_HELPER(ksem_close),
+	SYSCALL32_INIT_HELPER(ksem_post),
+	SYSCALL32_INIT_HELPER(ksem_wait),
+	SYSCALL32_INIT_HELPER(freebsd32_ksem_timedwait),
+	SYSCALL32_INIT_HELPER(ksem_trywait),
+	SYSCALL32_INIT_HELPER(ksem_getvalue),
+	SYSCALL32_INIT_HELPER(ksem_destroy),
+	SYSCALL_INIT_LAST
+};
+#endif
 
 static int
 ksem_module_init(void)
@@ -878,16 +953,14 @@ ksem_module_init(void)
 	p31b_setcfg(CTL_P1003_1B_SEM_NSEMS_MAX, SEM_MAX);
 	p31b_setcfg(CTL_P1003_1B_SEM_VALUE_MAX, SEM_VALUE_MAX);
 
-	SYSCALL_REGISTER(ksem_init);
-	SYSCALL_REGISTER(ksem_open);
-	SYSCALL_REGISTER(ksem_unlink);
-	SYSCALL_REGISTER(ksem_close);
-	SYSCALL_REGISTER(ksem_post);
-	SYSCALL_REGISTER(ksem_wait);
-	SYSCALL_REGISTER(ksem_timedwait);
-	SYSCALL_REGISTER(ksem_trywait);
-	SYSCALL_REGISTER(ksem_getvalue);
-	SYSCALL_REGISTER(ksem_destroy);
+	error = syscall_helper_register(ksem_syscalls);
+	if (error)
+		return (error);
+#ifdef COMPAT_FREEBSD32
+	error = syscall32_helper_register(ksem32_syscalls);
+	if (error)
+		return (error);
+#endif
 	return (0);
 }
 
@@ -895,16 +968,10 @@ static void
 ksem_module_destroy(void)
 {
 
-	SYSCALL_DEREGISTER(ksem_init);
-	SYSCALL_DEREGISTER(ksem_open);
-	SYSCALL_DEREGISTER(ksem_unlink);
-	SYSCALL_DEREGISTER(ksem_close);
-	SYSCALL_DEREGISTER(ksem_post);
-	SYSCALL_DEREGISTER(ksem_wait);
-	SYSCALL_DEREGISTER(ksem_timedwait);
-	SYSCALL_DEREGISTER(ksem_trywait);
-	SYSCALL_DEREGISTER(ksem_getvalue);
-	SYSCALL_DEREGISTER(ksem_destroy);
+#ifdef COMPAT_FREEBSD32
+	syscall32_helper_unregister(ksem32_syscalls);
+#endif
+	syscall_helper_unregister(ksem_syscalls);
 
 	hashdestroy(ksem_dictionary, M_KSEM, ksem_hash);
 	sx_destroy(&ksem_dict_lock);

From owner-svn-src-stable-8@FreeBSD.ORG  Wed Apr  7 14:49:35 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9C06D1065678;
	Wed,  7 Apr 2010 14:49:35 +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 8A5408FC15;
	Wed,  7 Apr 2010 14:49:35 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o37EnZ75026471;
	Wed, 7 Apr 2010 14:49:35 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o37EnZLt026467;
	Wed, 7 Apr 2010 14:49:35 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201004071449.o37EnZLt026467@svn.freebsd.org>
From: Konstantin Belousov 
Date: Wed, 7 Apr 2010 14:49:35 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206351 - in stable/8/sys: compat/freebsd32 kern
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Wed, 07 Apr 2010 14:49:35 -0000

Author: kib
Date: Wed Apr  7 14:49:35 2010
New Revision: 206351
URL: http://svn.freebsd.org/changeset/base/206351

Log:
  MFC r205325:
  Implement compat32 shims for mqueuefs.

Modified:
  stable/8/sys/compat/freebsd32/freebsd32.h
  stable/8/sys/compat/freebsd32/syscalls.master
  stable/8/sys/kern/uipc_mqueue.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/compat/freebsd32/freebsd32.h
==============================================================================
--- stable/8/sys/compat/freebsd32/freebsd32.h	Wed Apr  7 14:47:55 2010	(r206350)
+++ stable/8/sys/compat/freebsd32/freebsd32.h	Wed Apr  7 14:49:35 2010	(r206351)
@@ -221,4 +221,12 @@ struct prpsinfo32 {
         char    pr_psargs[PRARGSZ+1];
 };
 
+struct mq_attr32 {
+	int	mq_flags;
+	int	mq_maxmsg;
+	int	mq_msgsize;
+	int	mq_curmsgs;
+	int	__reserved[4];
+};
+
 #endif /* !_COMPAT_FREEBSD32_FREEBSD32_H_ */

Modified: stable/8/sys/compat/freebsd32/syscalls.master
==============================================================================
--- stable/8/sys/compat/freebsd32/syscalls.master	Wed Apr  7 14:47:55 2010	(r206350)
+++ stable/8/sys/compat/freebsd32/syscalls.master	Wed Apr  7 14:49:35 2010	(r206351)
@@ -798,12 +798,23 @@
 				    int param_size); }
 456	AUE_NULL	NOPROTO	{ int sigqueue(pid_t pid, int signum, \
 				    void *value); }
-457	AUE_NULL	UNIMPL	kmq_open
-458	AUE_NULL	UNIMPL	kmq_setattr
-459	AUE_NULL	UNIMPL	kmq_timedreceive
-460	AUE_NULL	UNIMPL  kmq_timedsend
-461	AUE_NULL	UNIMPL	kmq_notify
-462	AUE_NULL	UNIMPL	kmq_unlink
+457	AUE_NULL	NOSTD	{ int freebsd32_kmq_open( \
+				    const char *path, int flags, mode_t mode, \
+				    const struct mq_attr32 *attr); }
+458	AUE_NULL	NOSTD	{ int freebsd32_kmq_setattr(int mqd, \
+				    const struct mq_attr32 *attr,	\
+				    struct mq_attr32 *oattr); }
+459	AUE_NULL	NOSTD	{ int freebsd32_kmq_timedreceive(int mqd, \
+				    char *msg_ptr, size_t msg_len,	\
+				    unsigned *msg_prio,			\
+				    const struct timespec32 *abs_timeout); }
+460	AUE_NULL	NOSTD	{ int freebsd32_kmq_timedsend(int mqd,	\
+				    const char *msg_ptr, size_t msg_len,\
+				    unsigned msg_prio,			\
+				    const struct timespec32 *abs_timeout);}
+461	AUE_NULL	NOPROTO|NOSTD	{ int kmq_notify(int mqd,	\
+				    const struct sigevent *sigev); }
+462	AUE_NULL	NOPROTO|NOSTD	{ int kmq_unlink(const char *path); }
 463	AUE_NULL	NOPROTO	{ int abort2(const char *why, int nargs, void **args); }
 464	AUE_NULL 	NOPROTO	{ int thr_set_name(long id, const char *name); }
 465	AUE_NULL	NOSTD	{ int freebsd32_aio_fsync(int op, \

Modified: stable/8/sys/kern/uipc_mqueue.c
==============================================================================
--- stable/8/sys/kern/uipc_mqueue.c	Wed Apr  7 14:47:55 2010	(r206350)
+++ stable/8/sys/kern/uipc_mqueue.c	Wed Apr  7 14:49:35 2010	(r206351)
@@ -45,6 +45,8 @@
 #include 
 __FBSDID("$FreeBSD$");
 
+#include "opt_compat.h"
+
 #include 
 #include 
 #include 
@@ -1616,7 +1618,7 @@ mqueue_send(struct mqueue *mq, const cha
 	const struct timespec *abs_timeout)
 {
 	struct mqueue_msg *msg;
-	struct timespec ets, ts, ts2;
+	struct timespec ts, ts2;
 	struct timeval tv;
 	int error;
 
@@ -1652,15 +1654,12 @@ mqueue_send(struct mqueue *mq, const cha
 	if (error != EAGAIN)
 		goto bad;
 
-	error = copyin(abs_timeout, &ets, sizeof(ets));
-	if (error != 0)
-		goto bad;
-	if (ets.tv_nsec >= 1000000000 || ets.tv_nsec < 0) {
+	if (abs_timeout->tv_nsec >= 1000000000 || abs_timeout->tv_nsec < 0) {
 		error = EINVAL;
 		goto bad;
 	}
 	for (;;) {
-		ts2 = ets;
+		ts2 = *abs_timeout;
 		getnanotime(&ts);
 		timespecsub(&ts2, &ts);
 		if (ts2.tv_sec < 0 || (ts2.tv_sec == 0 && ts2.tv_nsec <= 0)) {
@@ -1767,7 +1766,7 @@ mqueue_receive(struct mqueue *mq, char *
 	const struct timespec *abs_timeout)
 {
 	struct mqueue_msg *msg;
-	struct timespec ets, ts, ts2;
+	struct timespec ts, ts2;
 	struct timeval tv;
 	int error;
 
@@ -1798,16 +1797,13 @@ mqueue_receive(struct mqueue *mq, char *
 	if (error != EAGAIN)
 		return (error);
 
-	error = copyin(abs_timeout, &ets, sizeof(ets));
-	if (error != 0)
-		return (error);
-	if (ets.tv_nsec >= 1000000000 || ets.tv_nsec < 0) {
+	if (abs_timeout->tv_nsec >= 1000000000 || abs_timeout->tv_nsec < 0) {
 		error = EINVAL;
 		return (error);
 	}
 
 	for (;;) {
-		ts2 = ets;
+		ts2 = *abs_timeout;
 		getnanotime(&ts);
 		timespecsub(&ts2, &ts);
 		if (ts2.tv_sec < 0 || (ts2.tv_sec == 0 && ts2.tv_nsec <= 0)) {
@@ -1928,40 +1924,28 @@ notifier_remove(struct proc *p, struct m
 	PROC_UNLOCK(p);
 }
 
-/*
- * Syscall to open a message queue.
- */
-int
-kmq_open(struct thread *td, struct kmq_open_args *uap)
+static int
+kern_kmq_open(struct thread *td, const char *upath, int flags, mode_t mode,
+    const struct mq_attr *attr)
 {
 	char path[MQFS_NAMELEN + 1];
-	struct mq_attr attr, *pattr;
 	struct mqfs_node *pn;
 	struct filedesc *fdp;
 	struct file *fp;
 	struct mqueue *mq;
-	int fd, error, len, flags, cmode;
-
-	if ((uap->flags & O_ACCMODE) == O_ACCMODE)
-		return (EINVAL);
+	int fd, error, len, cmode;
 
 	fdp = td->td_proc->p_fd;
-	flags = FFLAGS(uap->flags);
-	cmode = (((uap->mode & ~fdp->fd_cmask) & ALLPERMS) & ~S_ISTXT);
+	cmode = (((mode & ~fdp->fd_cmask) & ALLPERMS) & ~S_ISTXT);
 	mq = NULL;
-	if ((flags & O_CREAT) && (uap->attr != NULL)) {
-		error = copyin(uap->attr, &attr, sizeof(attr));
-		if (error)
-			return (error);
-		if (attr.mq_maxmsg <= 0 || attr.mq_maxmsg > maxmsg)
+	if ((flags & O_CREAT) != 0 && attr != NULL) {
+		if (attr->mq_maxmsg <= 0 || attr->mq_maxmsg > maxmsg)
 			return (EINVAL);
-		if (attr.mq_msgsize <= 0 || attr.mq_msgsize > maxmsgsize)
+		if (attr->mq_msgsize <= 0 || attr->mq_msgsize > maxmsgsize)
 			return (EINVAL);
-		pattr = &attr;
-	} else
-		pattr = NULL;
+	}
 
-	error = copyinstr(uap->path, path, MQFS_NAMELEN + 1, NULL);
+	error = copyinstr(upath, path, MQFS_NAMELEN + 1, NULL);
         if (error)
 		return (error);
 
@@ -1984,7 +1968,7 @@ kmq_open(struct thread *td, struct kmq_o
 		if (!(flags & O_CREAT)) {
 			error = ENOENT;
 		} else {
-			mq = mqueue_alloc(pattr);
+			mq = mqueue_alloc(attr);
 			if (mq == NULL) {
 				error = ENFILE;
 			} else {
@@ -2039,6 +2023,27 @@ kmq_open(struct thread *td, struct kmq_o
 }
 
 /*
+ * Syscall to open a message queue.
+ */
+int
+kmq_open(struct thread *td, struct kmq_open_args *uap)
+{
+	struct mq_attr attr;
+	int flags, error;
+
+	if ((uap->flags & O_ACCMODE) == O_ACCMODE)
+		return (EINVAL);
+	flags = FFLAGS(uap->flags);
+	if ((flags & O_CREAT) != 0 && uap->attr != NULL) {
+		error = copyin(uap->attr, &attr, sizeof(attr));
+		if (error)
+			return (error);
+	}
+	return (kern_kmq_open(td, uap->path, flags, uap->mode,
+	    uap->attr != NULL ? &attr : NULL));
+}
+
+/*
  * Syscall to unlink a message queue.
  */
 int
@@ -2114,39 +2119,52 @@ getmq_write(struct thread *td, int fd, s
 	return _getmq(td, fd, fget_write, fpp, ppn, pmq);
 }
 
-int
-kmq_setattr(struct thread *td, struct kmq_setattr_args *uap)
+static int
+kern_kmq_setattr(struct thread *td, int mqd, const struct mq_attr *attr,
+    struct mq_attr *oattr)
 {
 	struct mqueue *mq;
 	struct file *fp;
-	struct mq_attr attr, oattr;
 	u_int oflag, flag;
 	int error;
 
-	if (uap->attr) {
-		error = copyin(uap->attr, &attr, sizeof(attr));
-		if (error)
-			return (error);
-		if (attr.mq_flags & ~O_NONBLOCK)
-			return (EINVAL);
-	}
-	error = getmq(td, uap->mqd, &fp, NULL, &mq);
+	if (attr != NULL && (attr->mq_flags & ~O_NONBLOCK) != 0)
+		return (EINVAL);
+	error = getmq(td, mqd, &fp, NULL, &mq);
 	if (error)
 		return (error);
-	oattr.mq_maxmsg  = mq->mq_maxmsg;
-	oattr.mq_msgsize = mq->mq_msgsize;
-	oattr.mq_curmsgs = mq->mq_curmsgs;
-	if (uap->attr) {
+	oattr->mq_maxmsg  = mq->mq_maxmsg;
+	oattr->mq_msgsize = mq->mq_msgsize;
+	oattr->mq_curmsgs = mq->mq_curmsgs;
+	if (attr != NULL) {
 		do {
 			oflag = flag = fp->f_flag;
 			flag &= ~O_NONBLOCK;
-			flag |= (attr.mq_flags & O_NONBLOCK);
+			flag |= (attr->mq_flags & O_NONBLOCK);
 		} while (atomic_cmpset_int(&fp->f_flag, oflag, flag) == 0);
 	} else
 		oflag = fp->f_flag;
-	oattr.mq_flags = (O_NONBLOCK & oflag);
+	oattr->mq_flags = (O_NONBLOCK & oflag);
 	fdrop(fp, td);
-	if (uap->oattr)
+	return (error);
+}
+
+int
+kmq_setattr(struct thread *td, struct kmq_setattr_args *uap)
+{
+	struct mq_attr attr, oattr;
+	int error;
+
+	if (uap->attr != NULL) {
+		error = copyin(uap->attr, &attr, sizeof(attr));
+		if (error != 0)
+			return (error);
+	}
+	error = kern_kmq_setattr(td, uap->mqd, uap->attr != NULL ? &attr : NULL,
+	    &oattr);
+	if (error != 0)
+		return (error);
+	if (uap->oattr != NULL)
 		error = copyout(&oattr, uap->oattr, sizeof(oattr));
 	return (error);
 }
@@ -2156,15 +2174,23 @@ kmq_timedreceive(struct thread *td, stru
 {
 	struct mqueue *mq;
 	struct file *fp;
+	struct timespec *abs_timeout, ets;
 	int error;
 	int waitok;
 
 	error = getmq_read(td, uap->mqd, &fp, NULL, &mq);
 	if (error)
 		return (error);
+	if (uap->abs_timeout != NULL) {
+		error = copyin(uap->abs_timeout, &ets, sizeof(ets));
+		if (error != 0)
+			return (error);
+		abs_timeout = &ets;
+	} else
+		abs_timeout = NULL;
 	waitok = !(fp->f_flag & O_NONBLOCK);
 	error = mqueue_receive(mq, uap->msg_ptr, uap->msg_len,
-		uap->msg_prio, waitok, uap->abs_timeout);
+		uap->msg_prio, waitok, abs_timeout);
 	fdrop(fp, td);
 	return (error);
 }
@@ -2174,14 +2200,22 @@ kmq_timedsend(struct thread *td, struct 
 {
 	struct mqueue *mq;
 	struct file *fp;
+	struct timespec *abs_timeout, ets;
 	int error, waitok;
 
 	error = getmq_write(td, uap->mqd, &fp, NULL, &mq);
 	if (error)
 		return (error);
+	if (uap->abs_timeout != NULL) {
+		error = copyin(uap->abs_timeout, &ets, sizeof(ets));
+		if (error != 0)
+			return (error);
+		abs_timeout = &ets;
+	} else
+		abs_timeout = NULL;
 	waitok = !(fp->f_flag & O_NONBLOCK);
 	error = mqueue_send(mq, uap->msg_ptr, uap->msg_len,
-		uap->msg_prio, waitok, uap->abs_timeout);
+		uap->msg_prio, waitok, abs_timeout);
 	fdrop(fp, td);
 	return (error);
 }
@@ -2505,12 +2539,219 @@ static struct vfsops mqfs_vfsops = {
 	.vfs_statfs		= mqfs_statfs,
 };
 
-SYSCALL_MODULE_HELPER(kmq_open);
-SYSCALL_MODULE_HELPER(kmq_setattr);
-SYSCALL_MODULE_HELPER(kmq_timedsend);
-SYSCALL_MODULE_HELPER(kmq_timedreceive);
-SYSCALL_MODULE_HELPER(kmq_notify);
-SYSCALL_MODULE_HELPER(kmq_unlink);
+static struct vfsconf mqueuefs_vfsconf = {
+	.vfc_version = VFS_VERSION,
+	.vfc_name = "mqueuefs",
+	.vfc_vfsops = &mqfs_vfsops,
+	.vfc_typenum = -1,
+	.vfc_flags = VFCF_SYNTHETIC
+};
+
+static struct syscall_helper_data mq_syscalls[] = {
+	SYSCALL_INIT_HELPER(kmq_open),
+	SYSCALL_INIT_HELPER(kmq_setattr),
+	SYSCALL_INIT_HELPER(kmq_timedsend),
+	SYSCALL_INIT_HELPER(kmq_timedreceive),
+	SYSCALL_INIT_HELPER(kmq_notify),
+	SYSCALL_INIT_HELPER(kmq_unlink),
+	SYSCALL_INIT_LAST
+};
+
+#ifdef COMPAT_FREEBSD32
+#include 
+#include 
+#include 
+#include 
+
+static void
+mq_attr_from32(const struct mq_attr32 *from, struct mq_attr *to)
+{
+
+	to->mq_flags = from->mq_flags;
+	to->mq_maxmsg = from->mq_maxmsg;
+	to->mq_msgsize = from->mq_msgsize;
+	to->mq_curmsgs = from->mq_curmsgs;
+}
+
+static void
+mq_attr_to32(const struct mq_attr *from, struct mq_attr32 *to)
+{
+
+	to->mq_flags = from->mq_flags;
+	to->mq_maxmsg = from->mq_maxmsg;
+	to->mq_msgsize = from->mq_msgsize;
+	to->mq_curmsgs = from->mq_curmsgs;
+}
+
+int
+freebsd32_kmq_open(struct thread *td, struct freebsd32_kmq_open_args *uap)
+{
+	struct mq_attr attr;
+	struct mq_attr32 attr32;
+	int flags, error;
+
+	if ((uap->flags & O_ACCMODE) == O_ACCMODE)
+		return (EINVAL);
+	flags = FFLAGS(uap->flags);
+	if ((flags & O_CREAT) != 0 && uap->attr != NULL) {
+		error = copyin(uap->attr, &attr32, sizeof(attr32));
+		if (error)
+			return (error);
+		mq_attr_from32(&attr32, &attr);
+	}
+	return (kern_kmq_open(td, uap->path, flags, uap->mode,
+	    uap->attr != NULL ? &attr : NULL));
+}
+
+int
+freebsd32_kmq_setattr(struct thread *td, struct freebsd32_kmq_setattr_args *uap)
+{
+	struct mq_attr attr, oattr;
+	struct mq_attr32 attr32, oattr32;
+	int error;
+
+	if (uap->attr != NULL) {
+		error = copyin(uap->attr, &attr32, sizeof(attr32));
+		if (error != 0)
+			return (error);
+		mq_attr_from32(&attr32, &attr);
+	}
+	error = kern_kmq_setattr(td, uap->mqd, uap->attr != NULL ? &attr : NULL,
+	    &oattr);
+	if (error != 0)
+		return (error);
+	if (uap->oattr != NULL) {
+		mq_attr_to32(&oattr, &oattr32);
+		error = copyout(&oattr32, uap->oattr, sizeof(oattr32));
+	}
+	return (error);
+}
+
+int
+freebsd32_kmq_timedsend(struct thread *td,
+    struct freebsd32_kmq_timedsend_args *uap)
+{
+	struct mqueue *mq;
+	struct file *fp;
+	struct timespec32 ets32;
+	struct timespec *abs_timeout, ets;
+	int error;
+	int waitok;
+
+	error = getmq_read(td, uap->mqd, &fp, NULL, &mq);
+	if (error)
+		return (error);
+	if (uap->abs_timeout != NULL) {
+		error = copyin(uap->abs_timeout, &ets32, sizeof(ets32));
+		if (error != 0)
+			return (error);
+		CP(ets32, ets, tv_sec);
+		CP(ets32, ets, tv_nsec);
+		abs_timeout = &ets;
+	} else
+		abs_timeout = NULL;
+	waitok = !(fp->f_flag & O_NONBLOCK);
+	error = mqueue_send(mq, uap->msg_ptr, uap->msg_len,
+		uap->msg_prio, waitok, abs_timeout);
+	fdrop(fp, td);
+	return (error);
+}
+
+int
+freebsd32_kmq_timedreceive(struct thread *td,
+    struct freebsd32_kmq_timedreceive_args *uap)
+{
+	struct mqueue *mq;
+	struct file *fp;
+	struct timespec32 ets32;
+	struct timespec *abs_timeout, ets;
+	int error, waitok;
+
+	error = getmq_write(td, uap->mqd, &fp, NULL, &mq);
+	if (error)
+		return (error);
+	if (uap->abs_timeout != NULL) {
+		error = copyin(uap->abs_timeout, &ets32, sizeof(ets32));
+		if (error != 0)
+			return (error);
+		CP(ets32, ets, tv_sec);
+		CP(ets32, ets, tv_nsec);
+		abs_timeout = &ets;
+	} else
+		abs_timeout = NULL;
+	waitok = !(fp->f_flag & O_NONBLOCK);
+	error = mqueue_receive(mq, uap->msg_ptr, uap->msg_len,
+		uap->msg_prio, waitok, abs_timeout);
+	fdrop(fp, td);
+	return (error);
+}
+
+static struct syscall_helper_data mq32_syscalls[] = {
+	SYSCALL32_INIT_HELPER(freebsd32_kmq_open),
+	SYSCALL32_INIT_HELPER(freebsd32_kmq_setattr),
+	SYSCALL32_INIT_HELPER(freebsd32_kmq_timedsend),
+	SYSCALL32_INIT_HELPER(freebsd32_kmq_timedreceive),
+	SYSCALL32_INIT_HELPER(kmq_notify),
+	SYSCALL32_INIT_HELPER(kmq_unlink),
+	SYSCALL_INIT_LAST
+};
+#endif
+
+static int
+mqinit(void)
+{
+	int error;
+
+	error = syscall_helper_register(mq_syscalls);
+	if (error != 0)
+		return (error);
+#ifdef COMPAT_FREEBSD32
+	error = syscall32_helper_register(mq32_syscalls);
+	if (error != 0)
+		return (error);
+#endif
+	return (0);
+}
 
-VFS_SET(mqfs_vfsops, mqueuefs, VFCF_SYNTHETIC);
+static int
+mqunload(void)
+{
+
+#ifdef COMPAT_FREEBSD32
+	syscall32_helper_unregister(mq32_syscalls);
+#endif
+	syscall_helper_unregister(mq_syscalls);
+	return (0);
+}
+
+static int
+mq_modload(struct module *module, int cmd, void *arg)
+{
+	int error = 0;
+
+	error = vfs_modevent(module, cmd, arg);
+	if (error != 0)
+		return (error);
+
+	switch (cmd) {
+	case MOD_LOAD:
+		error = mqinit();
+		if (error != 0)
+			mqunload();
+		break;
+	case MOD_UNLOAD:
+		error = mqunload();
+		break;
+	default:
+		break;
+	}
+	return (error);
+}
+
+static moduledata_t mqueuefs_mod = {
+	"mqueuefs",
+	mq_modload,
+	&mqueuefs_vfsconf
+};
+DECLARE_MODULE(mqueuefs, mqueuefs_mod, SI_SUB_VFS, SI_ORDER_MIDDLE);
 MODULE_VERSION(mqueuefs, 1);

From owner-svn-src-stable-8@FreeBSD.ORG  Wed Apr  7 14:50:58 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9E0521065670;
	Wed,  7 Apr 2010 14:50:58 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 8DBB08FC14;
	Wed,  7 Apr 2010 14:50:58 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o37EowdL026817;
	Wed, 7 Apr 2010 14:50:58 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o37EowEZ026815;
	Wed, 7 Apr 2010 14:50:58 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201004071450.o37EowEZ026815@svn.freebsd.org>
From: Konstantin Belousov 
Date: Wed, 7 Apr 2010 14:50:58 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206352 - stable/8/sys/kern
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Wed, 07 Apr 2010 14:50:58 -0000

Author: kib
Date: Wed Apr  7 14:50:58 2010
New Revision: 206352
URL: http://svn.freebsd.org/changeset/base/206352

Log:
  MFC r205326:
  Convert aio syscall registration to SYSCALL_INIT_HELPER.

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

Modified: stable/8/sys/kern/vfs_aio.c
==============================================================================
--- stable/8/sys/kern/vfs_aio.c	Wed Apr  7 14:49:35 2010	(r206351)
+++ stable/8/sys/kern/vfs_aio.c	Wed Apr  7 14:50:58 2010	(r206352)
@@ -334,7 +334,7 @@ static TAILQ_HEAD(,aiocblist) aio_jobs;	
 static struct unrhdr *aiod_unr;
 
 void		aio_init_aioinfo(struct proc *p);
-static void	aio_onceonly(void);
+static int	aio_onceonly(void);
 static int	aio_free_entry(struct aiocblist *aiocbe);
 static void	aio_process(struct aiocblist *aiocbe);
 static int	aio_newproc(int *);
@@ -411,18 +411,47 @@ static moduledata_t aio_mod = {
 	NULL
 };
 
-SYSCALL_MODULE_HELPER(aio_cancel);
-SYSCALL_MODULE_HELPER(aio_error);
-SYSCALL_MODULE_HELPER(aio_fsync);
-SYSCALL_MODULE_HELPER(aio_read);
-SYSCALL_MODULE_HELPER(aio_return);
-SYSCALL_MODULE_HELPER(aio_suspend);
-SYSCALL_MODULE_HELPER(aio_waitcomplete);
-SYSCALL_MODULE_HELPER(aio_write);
-SYSCALL_MODULE_HELPER(lio_listio);
-SYSCALL_MODULE_HELPER(oaio_read);
-SYSCALL_MODULE_HELPER(oaio_write);
-SYSCALL_MODULE_HELPER(olio_listio);
+static struct syscall_helper_data aio_syscalls[] = {
+	SYSCALL_INIT_HELPER(aio_cancel),
+	SYSCALL_INIT_HELPER(aio_error),
+	SYSCALL_INIT_HELPER(aio_fsync),
+	SYSCALL_INIT_HELPER(aio_read),
+	SYSCALL_INIT_HELPER(aio_return),
+	SYSCALL_INIT_HELPER(aio_suspend),
+	SYSCALL_INIT_HELPER(aio_waitcomplete),
+	SYSCALL_INIT_HELPER(aio_write),
+	SYSCALL_INIT_HELPER(lio_listio),
+	SYSCALL_INIT_HELPER(oaio_read),
+	SYSCALL_INIT_HELPER(oaio_write),
+	SYSCALL_INIT_HELPER(olio_listio),
+	SYSCALL_INIT_LAST
+};
+
+#ifdef COMPAT_FREEBSD32
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+static struct syscall_helper_data aio32_syscalls[] = {
+	SYSCALL32_INIT_HELPER(freebsd32_aio_return),
+	SYSCALL32_INIT_HELPER(freebsd32_aio_suspend),
+	SYSCALL32_INIT_HELPER(freebsd32_aio_cancel),
+	SYSCALL32_INIT_HELPER(freebsd32_aio_error),
+	SYSCALL32_INIT_HELPER(freebsd32_aio_fsync),
+	SYSCALL32_INIT_HELPER(freebsd32_aio_read),
+	SYSCALL32_INIT_HELPER(freebsd32_aio_write),
+	SYSCALL32_INIT_HELPER(freebsd32_aio_waitcomplete),
+	SYSCALL32_INIT_HELPER(freebsd32_lio_listio),
+	SYSCALL32_INIT_HELPER(freebsd32_oaio_read),
+	SYSCALL32_INIT_HELPER(freebsd32_oaio_write),
+	SYSCALL32_INIT_HELPER(freebsd32_olio_listio),
+	SYSCALL_INIT_LAST
+};
+#endif
 
 DECLARE_MODULE(aio, aio_mod,
 	SI_SUB_VFS, SI_ORDER_ANY);
@@ -431,9 +460,10 @@ MODULE_VERSION(aio, 1);
 /*
  * Startup initialization
  */
-static void
+static int
 aio_onceonly(void)
 {
+	int error;
 
 	/* XXX: should probably just use so->callback */
 	aio_swake = &aio_swake_cb;
@@ -466,6 +496,16 @@ aio_onceonly(void)
 	p31b_setcfg(CTL_P1003_1B_AIO_LISTIO_MAX, AIO_LISTIO_MAX);
 	p31b_setcfg(CTL_P1003_1B_AIO_MAX, MAX_AIO_QUEUE);
 	p31b_setcfg(CTL_P1003_1B_AIO_PRIO_DELTA_MAX, 0);
+
+	error = syscall_helper_register(aio_syscalls);
+	if (error)
+		return (error);
+#ifdef COMPAT_FREEBSD32
+	error = syscall32_helper_register(aio32_syscalls);
+	if (error)
+		return (error);
+#endif
+	return (0);
 }
 
 /*
@@ -487,6 +527,11 @@ aio_unload(void)
 	if (!unloadable)
 		return (EOPNOTSUPP);
 
+#ifdef COMPAT_FREEBSD32
+	syscall32_helper_unregister(aio32_syscalls);
+#endif
+	syscall_helper_unregister(aio_syscalls);
+
 	error = kqueue_del_filteropts(EVFILT_AIO);
 	if (error)
 		return error;
@@ -2525,13 +2570,6 @@ filt_lio(struct knote *kn, long hint)
 }
 
 #ifdef COMPAT_FREEBSD32
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
 
 struct __aiocb_private32 {
 	int32_t	status;
@@ -2940,16 +2978,4 @@ freebsd32_lio_listio(struct thread *td, 
 	return (error);
 }
 
-SYSCALL32_MODULE_HELPER(freebsd32_aio_return);
-SYSCALL32_MODULE_HELPER(freebsd32_aio_suspend);
-SYSCALL32_MODULE_HELPER(freebsd32_aio_cancel);
-SYSCALL32_MODULE_HELPER(freebsd32_aio_error);
-SYSCALL32_MODULE_HELPER(freebsd32_aio_fsync);
-SYSCALL32_MODULE_HELPER(freebsd32_aio_read);
-SYSCALL32_MODULE_HELPER(freebsd32_aio_write);
-SYSCALL32_MODULE_HELPER(freebsd32_aio_waitcomplete);
-SYSCALL32_MODULE_HELPER(freebsd32_lio_listio);
-SYSCALL32_MODULE_HELPER(freebsd32_oaio_read);
-SYSCALL32_MODULE_HELPER(freebsd32_oaio_write);
-SYSCALL32_MODULE_HELPER(freebsd32_olio_listio);
 #endif

From owner-svn-src-stable-8@FreeBSD.ORG  Wed Apr  7 14:52:43 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5116A1065672;
	Wed,  7 Apr 2010 14:52:43 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 40E678FC14;
	Wed,  7 Apr 2010 14:52:43 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o37Eqhu2027268;
	Wed, 7 Apr 2010 14:52:43 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o37EqhYa027266;
	Wed, 7 Apr 2010 14:52:43 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201004071452.o37EqhYa027266@svn.freebsd.org>
From: Konstantin Belousov 
Date: Wed, 7 Apr 2010 14:52:43 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206353 - stable/8/sys/compat/freebsd32
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Wed, 07 Apr 2010 14:52:43 -0000

Author: kib
Date: Wed Apr  7 14:52:42 2010
New Revision: 206353
URL: http://svn.freebsd.org/changeset/base/206353

Log:
  MFC r205327:
  Remove empty line.

Modified:
  stable/8/sys/compat/freebsd32/freebsd32_misc.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/compat/freebsd32/freebsd32_misc.c
==============================================================================
--- stable/8/sys/compat/freebsd32/freebsd32_misc.c	Wed Apr  7 14:50:58 2010	(r206352)
+++ stable/8/sys/compat/freebsd32/freebsd32_misc.c	Wed Apr  7 14:52:42 2010	(r206353)
@@ -1400,7 +1400,6 @@ freebsd4_freebsd32_fhstatfs(struct threa
 }
 #endif
 
-
 int
 freebsd32_pread(struct thread *td, struct freebsd32_pread_args *uap)
 {

From owner-svn-src-stable-8@FreeBSD.ORG  Wed Apr  7 14:53:49 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7146D1065674;
	Wed,  7 Apr 2010 14:53:49 +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 601E58FC16;
	Wed,  7 Apr 2010 14:53:49 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o37ErnYu027542;
	Wed, 7 Apr 2010 14:53:49 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o37ErnTi027537;
	Wed, 7 Apr 2010 14:53:49 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201004071453.o37ErnTi027537@svn.freebsd.org>
From: Konstantin Belousov 
Date: Wed, 7 Apr 2010 14:53:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206354 - stable/8/sys/compat/freebsd32
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Wed, 07 Apr 2010 14:53:49 -0000

Author: kib
Date: Wed Apr  7 14:53:49 2010
New Revision: 206354
URL: http://svn.freebsd.org/changeset/base/206354

Log:
  Regen.

Modified:
  stable/8/sys/compat/freebsd32/freebsd32_proto.h
  stable/8/sys/compat/freebsd32/freebsd32_syscall.h
  stable/8/sys/compat/freebsd32/freebsd32_syscalls.c
  stable/8/sys/compat/freebsd32/freebsd32_sysent.c

Modified: stable/8/sys/compat/freebsd32/freebsd32_proto.h
==============================================================================
--- stable/8/sys/compat/freebsd32/freebsd32_proto.h	Wed Apr  7 14:52:42 2010	(r206353)
+++ stable/8/sys/compat/freebsd32/freebsd32_proto.h	Wed Apr  7 14:53:49 2010	(r206354)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 206336 2010-04-07 02:24:41Z nwhitehorn 
+ * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 206351 2010-04-07 14:49:35Z kib 
  */
 
 #ifndef _FREEBSD32_SYSPROTO_H_
@@ -306,6 +306,17 @@ struct freebsd32_sendfile_args {
 	char sbytes_l_[PADL_(off_t *)]; off_t * sbytes; char sbytes_r_[PADR_(off_t *)];
 	char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)];
 };
+struct freebsd32_ksem_init_args {
+	char idp_l_[PADL_(semid_t *)]; semid_t * idp; char idp_r_[PADR_(semid_t *)];
+	char value_l_[PADL_(unsigned int)]; unsigned int value; char value_r_[PADR_(unsigned int)];
+};
+struct freebsd32_ksem_open_args {
+	char idp_l_[PADL_(semid_t *)]; semid_t * idp; char idp_r_[PADR_(semid_t *)];
+	char name_l_[PADL_(const char *)]; const char * name; char name_r_[PADR_(const char *)];
+	char oflag_l_[PADL_(int)]; int oflag; char oflag_r_[PADR_(int)];
+	char mode_l_[PADL_(mode_t)]; mode_t mode; char mode_r_[PADR_(mode_t)];
+	char value_l_[PADL_(unsigned int)]; unsigned int value; char value_r_[PADR_(unsigned int)];
+};
 struct freebsd32_sigaction_args {
 	char sig_l_[PADL_(int)]; int sig; char sig_r_[PADR_(int)];
 	char act_l_[PADL_(struct sigaction32 *)]; struct sigaction32 * act; char act_r_[PADR_(struct sigaction32 *)];
@@ -330,6 +341,10 @@ struct freebsd32_umtx_lock_args {
 struct freebsd32_umtx_unlock_args {
 	char umtx_l_[PADL_(struct umtx *)]; struct umtx * umtx; char umtx_r_[PADR_(struct umtx *)];
 };
+struct freebsd32_ksem_timedwait_args {
+	char id_l_[PADL_(semid_t)]; semid_t id; char id_r_[PADR_(semid_t)];
+	char abstime_l_[PADL_(const struct timespec32 *)]; const struct timespec32 * abstime; char abstime_r_[PADR_(const struct timespec32 *)];
+};
 struct freebsd32_thr_suspend_args {
 	char timeout_l_[PADL_(const struct timespec32 *)]; const struct timespec32 * timeout; char timeout_r_[PADR_(const struct timespec32 *)];
 };
@@ -344,6 +359,31 @@ struct freebsd32_thr_new_args {
 	char param_l_[PADL_(struct thr_param32 *)]; struct thr_param32 * param; char param_r_[PADR_(struct thr_param32 *)];
 	char param_size_l_[PADL_(int)]; int param_size; char param_size_r_[PADR_(int)];
 };
+struct freebsd32_kmq_open_args {
+	char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
+	char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)];
+	char mode_l_[PADL_(mode_t)]; mode_t mode; char mode_r_[PADR_(mode_t)];
+	char attr_l_[PADL_(const struct mq_attr32 *)]; const struct mq_attr32 * attr; char attr_r_[PADR_(const struct mq_attr32 *)];
+};
+struct freebsd32_kmq_setattr_args {
+	char mqd_l_[PADL_(int)]; int mqd; char mqd_r_[PADR_(int)];
+	char attr_l_[PADL_(const struct mq_attr32 *)]; const struct mq_attr32 * attr; char attr_r_[PADR_(const struct mq_attr32 *)];
+	char oattr_l_[PADL_(struct mq_attr32 *)]; struct mq_attr32 * oattr; char oattr_r_[PADR_(struct mq_attr32 *)];
+};
+struct freebsd32_kmq_timedreceive_args {
+	char mqd_l_[PADL_(int)]; int mqd; char mqd_r_[PADR_(int)];
+	char msg_ptr_l_[PADL_(char *)]; char * msg_ptr; char msg_ptr_r_[PADR_(char *)];
+	char msg_len_l_[PADL_(size_t)]; size_t msg_len; char msg_len_r_[PADR_(size_t)];
+	char msg_prio_l_[PADL_(unsigned *)]; unsigned * msg_prio; char msg_prio_r_[PADR_(unsigned *)];
+	char abs_timeout_l_[PADL_(const struct timespec32 *)]; const struct timespec32 * abs_timeout; char abs_timeout_r_[PADR_(const struct timespec32 *)];
+};
+struct freebsd32_kmq_timedsend_args {
+	char mqd_l_[PADL_(int)]; int mqd; char mqd_r_[PADR_(int)];
+	char msg_ptr_l_[PADL_(const char *)]; const char * msg_ptr; char msg_ptr_r_[PADR_(const char *)];
+	char msg_len_l_[PADL_(size_t)]; size_t msg_len; char msg_len_r_[PADR_(size_t)];
+	char msg_prio_l_[PADL_(unsigned)]; unsigned msg_prio; char msg_prio_r_[PADR_(unsigned)];
+	char abs_timeout_l_[PADL_(const struct timespec32 *)]; const struct timespec32 * abs_timeout; char abs_timeout_r_[PADR_(const struct timespec32 *)];
+};
 struct freebsd32_aio_fsync_args {
 	char op_l_[PADL_(int)]; int op; char op_r_[PADR_(int)];
 	char aiocbp_l_[PADL_(struct aiocb32 *)]; struct aiocb32 * aiocbp; char aiocbp_r_[PADR_(struct aiocb32 *)];
@@ -581,6 +621,8 @@ int	freebsd32_aio_waitcomplete(struct th
 int	freebsd32_kevent(struct thread *, struct freebsd32_kevent_args *);
 int	freebsd32_nmount(struct thread *, struct freebsd32_nmount_args *);
 int	freebsd32_sendfile(struct thread *, struct freebsd32_sendfile_args *);
+int	freebsd32_ksem_init(struct thread *, struct freebsd32_ksem_init_args *);
+int	freebsd32_ksem_open(struct thread *, struct freebsd32_ksem_open_args *);
 int	freebsd32_sigaction(struct thread *, struct freebsd32_sigaction_args *);
 int	freebsd32_sigreturn(struct thread *, struct freebsd32_sigreturn_args *);
 int	freebsd32_getcontext(struct thread *, struct freebsd32_getcontext_args *);
@@ -588,9 +630,14 @@ int	freebsd32_setcontext(struct thread *
 int	freebsd32_swapcontext(struct thread *, struct freebsd32_swapcontext_args *);
 int	freebsd32_umtx_lock(struct thread *, struct freebsd32_umtx_lock_args *);
 int	freebsd32_umtx_unlock(struct thread *, struct freebsd32_umtx_unlock_args *);
+int	freebsd32_ksem_timedwait(struct thread *, struct freebsd32_ksem_timedwait_args *);
 int	freebsd32_thr_suspend(struct thread *, struct freebsd32_thr_suspend_args *);
 int	freebsd32_umtx_op(struct thread *, struct freebsd32_umtx_op_args *);
 int	freebsd32_thr_new(struct thread *, struct freebsd32_thr_new_args *);
+int	freebsd32_kmq_open(struct thread *, struct freebsd32_kmq_open_args *);
+int	freebsd32_kmq_setattr(struct thread *, struct freebsd32_kmq_setattr_args *);
+int	freebsd32_kmq_timedreceive(struct thread *, struct freebsd32_kmq_timedreceive_args *);
+int	freebsd32_kmq_timedsend(struct thread *, struct freebsd32_kmq_timedsend_args *);
 int	freebsd32_aio_fsync(struct thread *, struct freebsd32_aio_fsync_args *);
 #ifdef PAD64_REQUIRED
 int	freebsd32_pread(struct thread *, struct freebsd32_pread_args *);
@@ -909,6 +956,8 @@ int	freebsd7_freebsd32_shmctl(struct thr
 #define	FREEBSD32_SYS_AUE_freebsd32_kevent	AUE_NULL
 #define	FREEBSD32_SYS_AUE_freebsd32_nmount	AUE_NMOUNT
 #define	FREEBSD32_SYS_AUE_freebsd32_sendfile	AUE_SENDFILE
+#define	FREEBSD32_SYS_AUE_freebsd32_ksem_init	AUE_NULL
+#define	FREEBSD32_SYS_AUE_freebsd32_ksem_open	AUE_NULL
 #define	FREEBSD32_SYS_AUE_freebsd32_sigaction	AUE_SIGACTION
 #define	FREEBSD32_SYS_AUE_freebsd32_sigreturn	AUE_SIGRETURN
 #define	FREEBSD32_SYS_AUE_freebsd32_getcontext	AUE_NULL
@@ -916,9 +965,14 @@ int	freebsd7_freebsd32_shmctl(struct thr
 #define	FREEBSD32_SYS_AUE_freebsd32_swapcontext	AUE_NULL
 #define	FREEBSD32_SYS_AUE_freebsd32_umtx_lock	AUE_NULL
 #define	FREEBSD32_SYS_AUE_freebsd32_umtx_unlock	AUE_NULL
+#define	FREEBSD32_SYS_AUE_freebsd32_ksem_timedwait	AUE_NULL
 #define	FREEBSD32_SYS_AUE_freebsd32_thr_suspend	AUE_NULL
 #define	FREEBSD32_SYS_AUE_freebsd32_umtx_op	AUE_NULL
 #define	FREEBSD32_SYS_AUE_freebsd32_thr_new	AUE_NULL
+#define	FREEBSD32_SYS_AUE_freebsd32_kmq_open	AUE_NULL
+#define	FREEBSD32_SYS_AUE_freebsd32_kmq_setattr	AUE_NULL
+#define	FREEBSD32_SYS_AUE_freebsd32_kmq_timedreceive	AUE_NULL
+#define	FREEBSD32_SYS_AUE_freebsd32_kmq_timedsend	AUE_NULL
 #define	FREEBSD32_SYS_AUE_freebsd32_aio_fsync	AUE_NULL
 #define	FREEBSD32_SYS_AUE_freebsd32_pread	AUE_PREAD
 #define	FREEBSD32_SYS_AUE_freebsd32_pwrite	AUE_PWRITE

Modified: stable/8/sys/compat/freebsd32/freebsd32_syscall.h
==============================================================================
--- stable/8/sys/compat/freebsd32/freebsd32_syscall.h	Wed Apr  7 14:52:42 2010	(r206353)
+++ stable/8/sys/compat/freebsd32/freebsd32_syscall.h	Wed Apr  7 14:53:49 2010	(r206354)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 206336 2010-04-07 02:24:41Z nwhitehorn 
+ * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 206351 2010-04-07 14:49:35Z kib 
  */
 
 #define	FREEBSD32_SYS_syscall	0
@@ -303,6 +303,15 @@
 #define	FREEBSD32_SYS_statfs	396
 #define	FREEBSD32_SYS_fstatfs	397
 #define	FREEBSD32_SYS_fhstatfs	398
+#define	FREEBSD32_SYS_ksem_close	400
+#define	FREEBSD32_SYS_ksem_post	401
+#define	FREEBSD32_SYS_ksem_wait	402
+#define	FREEBSD32_SYS_ksem_trywait	403
+#define	FREEBSD32_SYS_freebsd32_ksem_init	404
+#define	FREEBSD32_SYS_freebsd32_ksem_open	405
+#define	FREEBSD32_SYS_ksem_unlink	406
+#define	FREEBSD32_SYS_ksem_getvalue	407
+#define	FREEBSD32_SYS_ksem_destroy	408
 #define	FREEBSD32_SYS_extattr_set_link	412
 #define	FREEBSD32_SYS_extattr_get_link	413
 #define	FREEBSD32_SYS_extattr_delete_link	414
@@ -325,6 +334,7 @@
 #define	FREEBSD32_SYS_extattr_list_fd	437
 #define	FREEBSD32_SYS_extattr_list_file	438
 #define	FREEBSD32_SYS_extattr_list_link	439
+#define	FREEBSD32_SYS_freebsd32_ksem_timedwait	441
 #define	FREEBSD32_SYS_freebsd32_thr_suspend	442
 #define	FREEBSD32_SYS_thr_wake	443
 #define	FREEBSD32_SYS_kldunloadf	444
@@ -340,6 +350,12 @@
 #define	FREEBSD32_SYS_freebsd32_umtx_op	454
 #define	FREEBSD32_SYS_freebsd32_thr_new	455
 #define	FREEBSD32_SYS_sigqueue	456
+#define	FREEBSD32_SYS_freebsd32_kmq_open	457
+#define	FREEBSD32_SYS_freebsd32_kmq_setattr	458
+#define	FREEBSD32_SYS_freebsd32_kmq_timedreceive	459
+#define	FREEBSD32_SYS_freebsd32_kmq_timedsend	460
+#define	FREEBSD32_SYS_kmq_notify	461
+#define	FREEBSD32_SYS_kmq_unlink	462
 #define	FREEBSD32_SYS_abort2	463
 #define	FREEBSD32_SYS_thr_set_name	464
 #define	FREEBSD32_SYS_freebsd32_aio_fsync	465

Modified: stable/8/sys/compat/freebsd32/freebsd32_syscalls.c
==============================================================================
--- stable/8/sys/compat/freebsd32/freebsd32_syscalls.c	Wed Apr  7 14:52:42 2010	(r206353)
+++ stable/8/sys/compat/freebsd32/freebsd32_syscalls.c	Wed Apr  7 14:53:49 2010	(r206354)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 206336 2010-04-07 02:24:41Z nwhitehorn 
+ * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 206351 2010-04-07 14:49:35Z kib 
  */
 
 const char *freebsd32_syscallnames[] = {
@@ -410,15 +410,15 @@ const char *freebsd32_syscallnames[] = {
 	"fstatfs",			/* 397 = fstatfs */
 	"fhstatfs",			/* 398 = fhstatfs */
 	"#399",			/* 399 = nosys */
-	"#400",			/* 400 = ksem_close */
-	"#401",			/* 401 = ksem_post */
-	"#402",			/* 402 = ksem_wait */
-	"#403",			/* 403 = ksem_trywait */
-	"#404",			/* 404 = ksem_init */
-	"#405",			/* 405 = ksem_open */
-	"#406",			/* 406 = ksem_unlink */
-	"#407",			/* 407 = ksem_getvalue */
-	"#408",			/* 408 = ksem_destroy */
+	"ksem_close",			/* 400 = ksem_close */
+	"ksem_post",			/* 401 = ksem_post */
+	"ksem_wait",			/* 402 = ksem_wait */
+	"ksem_trywait",			/* 403 = ksem_trywait */
+	"freebsd32_ksem_init",			/* 404 = freebsd32_ksem_init */
+	"freebsd32_ksem_open",			/* 405 = freebsd32_ksem_open */
+	"ksem_unlink",			/* 406 = ksem_unlink */
+	"ksem_getvalue",			/* 407 = ksem_getvalue */
+	"ksem_destroy",			/* 408 = ksem_destroy */
 	"#409",			/* 409 = __mac_get_pid */
 	"#410",			/* 410 = __mac_get_link */
 	"#411",			/* 411 = __mac_set_link */
@@ -451,7 +451,7 @@ const char *freebsd32_syscallnames[] = {
 	"extattr_list_file",			/* 438 = extattr_list_file */
 	"extattr_list_link",			/* 439 = extattr_list_link */
 	"#440",			/* 440 = kse_switchin */
-	"#441",			/* 441 = ksem_timedwait */
+	"freebsd32_ksem_timedwait",			/* 441 = freebsd32_ksem_timedwait */
 	"freebsd32_thr_suspend",			/* 442 = freebsd32_thr_suspend */
 	"thr_wake",			/* 443 = thr_wake */
 	"kldunloadf",			/* 444 = kldunloadf */
@@ -467,12 +467,12 @@ const char *freebsd32_syscallnames[] = {
 	"freebsd32_umtx_op",			/* 454 = freebsd32_umtx_op */
 	"freebsd32_thr_new",			/* 455 = freebsd32_thr_new */
 	"sigqueue",			/* 456 = sigqueue */
-	"#457",			/* 457 = kmq_open */
-	"#458",			/* 458 = kmq_setattr */
-	"#459",			/* 459 = kmq_timedreceive */
-	"#460",			/* 460 = kmq_timedsend */
-	"#461",			/* 461 = kmq_notify */
-	"#462",			/* 462 = kmq_unlink */
+	"freebsd32_kmq_open",			/* 457 = freebsd32_kmq_open */
+	"freebsd32_kmq_setattr",			/* 458 = freebsd32_kmq_setattr */
+	"freebsd32_kmq_timedreceive",			/* 459 = freebsd32_kmq_timedreceive */
+	"freebsd32_kmq_timedsend",			/* 460 = freebsd32_kmq_timedsend */
+	"kmq_notify",			/* 461 = kmq_notify */
+	"kmq_unlink",			/* 462 = kmq_unlink */
 	"abort2",			/* 463 = abort2 */
 	"thr_set_name",			/* 464 = thr_set_name */
 	"freebsd32_aio_fsync",			/* 465 = freebsd32_aio_fsync */

Modified: stable/8/sys/compat/freebsd32/freebsd32_sysent.c
==============================================================================
--- stable/8/sys/compat/freebsd32/freebsd32_sysent.c	Wed Apr  7 14:52:42 2010	(r206353)
+++ stable/8/sys/compat/freebsd32/freebsd32_sysent.c	Wed Apr  7 14:53:49 2010	(r206354)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 206336 2010-04-07 02:24:41Z nwhitehorn 
+ * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 206351 2010-04-07 14:49:35Z kib 
  */
 
 #include "opt_compat.h"
@@ -216,9 +216,9 @@ struct sysent freebsd32_sysent[] = {
 	{ AS(rtprio_args), (sy_call_t *)rtprio, AUE_RTPRIO, NULL, 0, 0, 0 },	/* 166 = rtprio */
 	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 },			/* 167 = nosys */
 	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 },			/* 168 = nosys */
-	{ AS(freebsd32_semsys_args), (sy_call_t *)freebsd32_semsys, AUE_SEMSYS, NULL, 0, 0, 0 },	/* 169 = freebsd32_semsys */
-	{ AS(freebsd32_msgsys_args), (sy_call_t *)freebsd32_msgsys, AUE_MSGSYS, NULL, 0, 0, 0 },	/* 170 = freebsd32_msgsys */
-	{ AS(freebsd32_shmsys_args), (sy_call_t *)freebsd32_shmsys, AUE_SHMSYS, NULL, 0, 0, 0 },	/* 171 = freebsd32_shmsys */
+	{ AS(freebsd32_semsys_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0 },	/* 169 = freebsd32_semsys */
+	{ AS(freebsd32_msgsys_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0 },	/* 170 = freebsd32_msgsys */
+	{ AS(freebsd32_shmsys_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0 },	/* 171 = freebsd32_shmsys */
 	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 },			/* 172 = nosys */
 	{ compat6(AS(freebsd6_freebsd32_pread_args),freebsd32_pread), AUE_PREAD, NULL, 0, 0, 0 },	/* 173 = freebsd6 freebsd32_pread */
 	{ compat6(AS(freebsd6_freebsd32_pwrite_args),freebsd32_pwrite), AUE_PWRITE, NULL, 0, 0, 0 },	/* 174 = freebsd6 freebsd32_pwrite */
@@ -267,18 +267,18 @@ struct sysent freebsd32_sysent[] = {
 	{ AS(nosys_args), (sy_call_t *)lkmnosys, AUE_NULL, NULL, 0, 0, 0 },	/* 217 = lkmnosys */
 	{ AS(nosys_args), (sy_call_t *)lkmnosys, AUE_NULL, NULL, 0, 0, 0 },	/* 218 = lkmnosys */
 	{ AS(nosys_args), (sy_call_t *)lkmnosys, AUE_NULL, NULL, 0, 0, 0 },	/* 219 = lkmnosys */
-	{ compat7(AS(freebsd7_freebsd32_semctl_args),freebsd32_semctl), AUE_SEMCTL, NULL, 0, 0, 0 },	/* 220 = freebsd7 freebsd32_semctl */
-	{ AS(semget_args), (sy_call_t *)semget, AUE_SEMGET, NULL, 0, 0, 0 },	/* 221 = semget */
-	{ AS(semop_args), (sy_call_t *)semop, AUE_SEMOP, NULL, 0, 0, 0 },	/* 222 = semop */
+	{ 0, (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0 },		/* 220 = freebsd7 freebsd32_semctl */
+	{ AS(semget_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0 },	/* 221 = semget */
+	{ AS(semop_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0 },	/* 222 = semop */
 	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 },			/* 223 = semconfig */
-	{ compat7(AS(freebsd7_freebsd32_msgctl_args),freebsd32_msgctl), AUE_MSGCTL, NULL, 0, 0, 0 },	/* 224 = freebsd7 freebsd32_msgctl */
-	{ AS(msgget_args), (sy_call_t *)msgget, AUE_MSGGET, NULL, 0, 0, 0 },	/* 225 = msgget */
-	{ AS(freebsd32_msgsnd_args), (sy_call_t *)freebsd32_msgsnd, AUE_MSGSND, NULL, 0, 0, 0 },	/* 226 = freebsd32_msgsnd */
-	{ AS(freebsd32_msgrcv_args), (sy_call_t *)freebsd32_msgrcv, AUE_MSGRCV, NULL, 0, 0, 0 },	/* 227 = freebsd32_msgrcv */
-	{ AS(shmat_args), (sy_call_t *)shmat, AUE_SHMAT, NULL, 0, 0, 0 },	/* 228 = shmat */
-	{ compat7(AS(freebsd7_freebsd32_shmctl_args),freebsd32_shmctl), AUE_SHMCTL, NULL, 0, 0, 0 },	/* 229 = freebsd7 freebsd32_shmctl */
-	{ AS(shmdt_args), (sy_call_t *)shmdt, AUE_SHMDT, NULL, 0, 0, 0 },	/* 230 = shmdt */
-	{ AS(shmget_args), (sy_call_t *)shmget, AUE_SHMGET, NULL, 0, 0, 0 },	/* 231 = shmget */
+	{ 0, (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0 },		/* 224 = freebsd7 freebsd32_msgctl */
+	{ AS(msgget_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0 },	/* 225 = msgget */
+	{ AS(freebsd32_msgsnd_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0 },	/* 226 = freebsd32_msgsnd */
+	{ AS(freebsd32_msgrcv_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0 },	/* 227 = freebsd32_msgrcv */
+	{ AS(shmat_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0 },	/* 228 = shmat */
+	{ 0, (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0 },		/* 229 = freebsd7 freebsd32_shmctl */
+	{ AS(shmdt_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0 },	/* 230 = shmdt */
+	{ AS(shmget_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0 },	/* 231 = shmget */
 	{ AS(freebsd32_clock_gettime_args), (sy_call_t *)freebsd32_clock_gettime, AUE_NULL, NULL, 0, 0, 0 },	/* 232 = freebsd32_clock_gettime */
 	{ AS(freebsd32_clock_settime_args), (sy_call_t *)freebsd32_clock_settime, AUE_CLOCK_SETTIME, NULL, 0, 0, 0 },	/* 233 = freebsd32_clock_settime */
 	{ AS(freebsd32_clock_getres_args), (sy_call_t *)freebsd32_clock_getres, AUE_NULL, NULL, 0, 0, 0 },	/* 234 = freebsd32_clock_getres */
@@ -447,15 +447,15 @@ struct sysent freebsd32_sysent[] = {
 	{ AS(fstatfs_args), (sy_call_t *)fstatfs, AUE_FSTATFS, NULL, 0, 0, 0 },	/* 397 = fstatfs */
 	{ AS(fhstatfs_args), (sy_call_t *)fhstatfs, AUE_FHSTATFS, NULL, 0, 0, 0 },	/* 398 = fhstatfs */
 	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 },			/* 399 = nosys */
-	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 },			/* 400 = ksem_close */
-	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 },			/* 401 = ksem_post */
-	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 },			/* 402 = ksem_wait */
-	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 },			/* 403 = ksem_trywait */
-	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 },			/* 404 = ksem_init */
-	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 },			/* 405 = ksem_open */
-	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 },			/* 406 = ksem_unlink */
-	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 },			/* 407 = ksem_getvalue */
-	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 },			/* 408 = ksem_destroy */
+	{ AS(ksem_close_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0 },	/* 400 = ksem_close */
+	{ AS(ksem_post_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0 },	/* 401 = ksem_post */
+	{ AS(ksem_wait_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0 },	/* 402 = ksem_wait */
+	{ AS(ksem_trywait_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0 },	/* 403 = ksem_trywait */
+	{ AS(freebsd32_ksem_init_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0 },	/* 404 = freebsd32_ksem_init */
+	{ AS(freebsd32_ksem_open_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0 },	/* 405 = freebsd32_ksem_open */
+	{ AS(ksem_unlink_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0 },	/* 406 = ksem_unlink */
+	{ AS(ksem_getvalue_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0 },	/* 407 = ksem_getvalue */
+	{ AS(ksem_destroy_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0 },	/* 408 = ksem_destroy */
 	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 },			/* 409 = __mac_get_pid */
 	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 },			/* 410 = __mac_get_link */
 	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 },			/* 411 = __mac_set_link */
@@ -488,7 +488,7 @@ struct sysent freebsd32_sysent[] = {
 	{ AS(extattr_list_file_args), (sy_call_t *)extattr_list_file, AUE_EXTATTR_LIST_FILE, NULL, 0, 0, 0 },	/* 438 = extattr_list_file */
 	{ AS(extattr_list_link_args), (sy_call_t *)extattr_list_link, AUE_EXTATTR_LIST_LINK, NULL, 0, 0, 0 },	/* 439 = extattr_list_link */
 	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 },			/* 440 = kse_switchin */
-	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 },			/* 441 = ksem_timedwait */
+	{ AS(freebsd32_ksem_timedwait_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0 },	/* 441 = freebsd32_ksem_timedwait */
 	{ AS(freebsd32_thr_suspend_args), (sy_call_t *)freebsd32_thr_suspend, AUE_NULL, NULL, 0, 0, 0 },	/* 442 = freebsd32_thr_suspend */
 	{ AS(thr_wake_args), (sy_call_t *)thr_wake, AUE_NULL, NULL, 0, 0, 0 },	/* 443 = thr_wake */
 	{ AS(kldunloadf_args), (sy_call_t *)kldunloadf, AUE_MODUNLOAD, NULL, 0, 0, 0 },	/* 444 = kldunloadf */
@@ -504,12 +504,12 @@ struct sysent freebsd32_sysent[] = {
 	{ AS(freebsd32_umtx_op_args), (sy_call_t *)freebsd32_umtx_op, AUE_NULL, NULL, 0, 0, 0 },	/* 454 = freebsd32_umtx_op */
 	{ AS(freebsd32_thr_new_args), (sy_call_t *)freebsd32_thr_new, AUE_NULL, NULL, 0, 0, 0 },	/* 455 = freebsd32_thr_new */
 	{ AS(sigqueue_args), (sy_call_t *)sigqueue, AUE_NULL, NULL, 0, 0, 0 },	/* 456 = sigqueue */
-	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 },			/* 457 = kmq_open */
-	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 },			/* 458 = kmq_setattr */
-	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 },			/* 459 = kmq_timedreceive */
-	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 },			/* 460 = kmq_timedsend */
-	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 },			/* 461 = kmq_notify */
-	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 },			/* 462 = kmq_unlink */
+	{ AS(freebsd32_kmq_open_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0 },	/* 457 = freebsd32_kmq_open */
+	{ AS(freebsd32_kmq_setattr_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0 },	/* 458 = freebsd32_kmq_setattr */
+	{ AS(freebsd32_kmq_timedreceive_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0 },	/* 459 = freebsd32_kmq_timedreceive */
+	{ AS(freebsd32_kmq_timedsend_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0 },	/* 460 = freebsd32_kmq_timedsend */
+	{ AS(kmq_notify_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0 },	/* 461 = kmq_notify */
+	{ AS(kmq_unlink_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0 },	/* 462 = kmq_unlink */
 	{ AS(abort2_args), (sy_call_t *)abort2, AUE_NULL, NULL, 0, 0, 0 },	/* 463 = abort2 */
 	{ AS(thr_set_name_args), (sy_call_t *)thr_set_name, AUE_NULL, NULL, 0, 0, 0 },	/* 464 = thr_set_name */
 	{ AS(freebsd32_aio_fsync_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0 },	/* 465 = freebsd32_aio_fsync */
@@ -570,9 +570,9 @@ struct sysent freebsd32_sysent[] = {
 	{ AS(freebsd32_jail_set_args), (sy_call_t *)freebsd32_jail_set, AUE_NULL, NULL, 0, 0, 0 },	/* 507 = freebsd32_jail_set */
 	{ AS(jail_remove_args), (sy_call_t *)jail_remove, AUE_NULL, NULL, 0, 0, 0 },	/* 508 = jail_remove */
 	{ AS(closefrom_args), (sy_call_t *)closefrom, AUE_CLOSEFROM, NULL, 0, 0, 0 },	/* 509 = closefrom */
-	{ AS(freebsd32_semctl_args), (sy_call_t *)freebsd32_semctl, AUE_SEMCTL, NULL, 0, 0, 0 },	/* 510 = freebsd32_semctl */
-	{ AS(freebsd32_msgctl_args), (sy_call_t *)freebsd32_msgctl, AUE_MSGCTL, NULL, 0, 0, 0 },	/* 511 = freebsd32_msgctl */
-	{ AS(freebsd32_shmctl_args), (sy_call_t *)freebsd32_shmctl, AUE_SHMCTL, NULL, 0, 0, 0 },	/* 512 = freebsd32_shmctl */
+	{ AS(freebsd32_semctl_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0 },	/* 510 = freebsd32_semctl */
+	{ AS(freebsd32_msgctl_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0 },	/* 511 = freebsd32_msgctl */
+	{ AS(freebsd32_shmctl_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0 },	/* 512 = freebsd32_shmctl */
 	{ AS(lpathconf_args), (sy_call_t *)lpathconf, AUE_LPATHCONF, NULL, 0, 0, 0 },	/* 513 = lpathconf */
 	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 },			/* 514 = cap_new */
 	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 },			/* 515 = cap_getrights */

From owner-svn-src-stable-8@FreeBSD.ORG  Wed Apr  7 14:59:08 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4DE181065672;
	Wed,  7 Apr 2010 14:59:08 +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 3D0898FC0C;
	Wed,  7 Apr 2010 14:59:08 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o37Ex8vg028750;
	Wed, 7 Apr 2010 14:59:08 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o37Ex8Eb028747;
	Wed, 7 Apr 2010 14:59:08 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201004071459.o37Ex8Eb028747@svn.freebsd.org>
From: Rui Paulo 
Date: Wed, 7 Apr 2010 14:59:08 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206355 - stable/8/sys/net80211
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Wed, 07 Apr 2010 14:59:08 -0000

Author: rpaulo
Date: Wed Apr  7 14:59:07 2010
New Revision: 206355
URL: http://svn.freebsd.org/changeset/base/206355

Log:
  MFC r205986:
   Constify vap argument of ieee80211_{note,discard}* functions.

Modified:
  stable/8/sys/net80211/ieee80211_input.c
  stable/8/sys/net80211/ieee80211_var.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/net80211/ieee80211_input.c
==============================================================================
--- stable/8/sys/net80211/ieee80211_input.c	Wed Apr  7 14:53:49 2010	(r206354)
+++ stable/8/sys/net80211/ieee80211_input.c	Wed Apr  7 14:59:07 2010	(r206355)
@@ -734,7 +734,8 @@ ieee80211_ssid_mismatch(struct ieee80211
  * Return the bssid of a frame.
  */
 static const uint8_t *
-ieee80211_getbssid(struct ieee80211vap *vap, const struct ieee80211_frame *wh)
+ieee80211_getbssid(const struct ieee80211vap *vap,
+	const struct ieee80211_frame *wh)
 {
 	if (vap->iv_opmode == IEEE80211_M_STA)
 		return wh->i_addr2;
@@ -748,7 +749,7 @@ ieee80211_getbssid(struct ieee80211vap *
 #include 
 
 void
-ieee80211_note(struct ieee80211vap *vap, const char *fmt, ...)
+ieee80211_note(const struct ieee80211vap *vap, const char *fmt, ...)
 {
 	char buf[128];		/* XXX */
 	va_list ap;
@@ -761,7 +762,7 @@ ieee80211_note(struct ieee80211vap *vap,
 }
 
 void
-ieee80211_note_frame(struct ieee80211vap *vap,
+ieee80211_note_frame(const struct ieee80211vap *vap,
 	const struct ieee80211_frame *wh,
 	const char *fmt, ...)
 {
@@ -776,7 +777,7 @@ ieee80211_note_frame(struct ieee80211vap
 }
 
 void
-ieee80211_note_mac(struct ieee80211vap *vap,
+ieee80211_note_mac(const struct ieee80211vap *vap,
 	const uint8_t mac[IEEE80211_ADDR_LEN],
 	const char *fmt, ...)
 {
@@ -790,7 +791,7 @@ ieee80211_note_mac(struct ieee80211vap *
 }
 
 void
-ieee80211_discard_frame(struct ieee80211vap *vap,
+ieee80211_discard_frame(const struct ieee80211vap *vap,
 	const struct ieee80211_frame *wh,
 	const char *type, const char *fmt, ...)
 {
@@ -811,7 +812,7 @@ ieee80211_discard_frame(struct ieee80211
 }
 
 void
-ieee80211_discard_ie(struct ieee80211vap *vap,
+ieee80211_discard_ie(const struct ieee80211vap *vap,
 	const struct ieee80211_frame *wh,
 	const char *type, const char *fmt, ...)
 {
@@ -830,7 +831,7 @@ ieee80211_discard_ie(struct ieee80211vap
 }
 
 void
-ieee80211_discard_mac(struct ieee80211vap *vap,
+ieee80211_discard_mac(const struct ieee80211vap *vap,
 	const uint8_t mac[IEEE80211_ADDR_LEN],
 	const char *type, const char *fmt, ...)
 {

Modified: stable/8/sys/net80211/ieee80211_var.h
==============================================================================
--- stable/8/sys/net80211/ieee80211_var.h	Wed Apr  7 14:53:49 2010	(r206354)
+++ stable/8/sys/net80211/ieee80211_var.h	Wed Apr  7 14:59:07 2010	(r206355)
@@ -848,10 +848,10 @@ ieee80211_htchanflags(const struct ieee8
 	if (ieee80211_msg(_vap, _m))					\
 		ieee80211_note_frame(_vap, _wh, _fmt, __VA_ARGS__);	\
 } while (0)
-void	ieee80211_note(struct ieee80211vap *, const char *, ...);
-void	ieee80211_note_mac(struct ieee80211vap *,
+void	ieee80211_note(const struct ieee80211vap *, const char *, ...);
+void	ieee80211_note_mac(const struct ieee80211vap *,
 		const uint8_t mac[IEEE80211_ADDR_LEN], const char *, ...);
-void	ieee80211_note_frame(struct ieee80211vap *,
+void	ieee80211_note_frame(const struct ieee80211vap *,
 		const struct ieee80211_frame *, const char *, ...);
 #define	ieee80211_msg_debug(_vap) \
 	((_vap)->iv_debug & IEEE80211_MSG_DEBUG)
@@ -889,11 +889,11 @@ void	ieee80211_note_frame(struct ieee802
 		ieee80211_discard_mac(_vap, _mac, _type, _fmt, __VA_ARGS__);\
 } while (0)
 
-void ieee80211_discard_frame(struct ieee80211vap *,
+void ieee80211_discard_frame(const struct ieee80211vap *,
 	const struct ieee80211_frame *, const char *type, const char *fmt, ...);
-void ieee80211_discard_ie(struct ieee80211vap *,
+void ieee80211_discard_ie(const struct ieee80211vap *,
 	const struct ieee80211_frame *, const char *type, const char *fmt, ...);
-void ieee80211_discard_mac(struct ieee80211vap *,
+void ieee80211_discard_mac(const struct ieee80211vap *,
 	const uint8_t mac[IEEE80211_ADDR_LEN], const char *type,
 	const char *fmt, ...);
 #else

From owner-svn-src-stable-8@FreeBSD.ORG  Wed Apr  7 15:19:53 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 34045106566B;
	Wed,  7 Apr 2010 15:19:53 +0000 (UTC)
	(envelope-from rmacklem@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 240878FC17;
	Wed,  7 Apr 2010 15:19:53 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o37FJr6h033418;
	Wed, 7 Apr 2010 15:19:53 GMT (envelope-from rmacklem@svn.freebsd.org)
Received: (from rmacklem@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o37FJr6x033416;
	Wed, 7 Apr 2010 15:19:53 GMT (envelope-from rmacklem@svn.freebsd.org)
Message-Id: <201004071519.o37FJr6x033416@svn.freebsd.org>
From: Rick Macklem 
Date: Wed, 7 Apr 2010 15:19:53 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206357 - stable/8/sys/fs/nfs
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Wed, 07 Apr 2010 15:19:53 -0000

Author: rmacklem
Date: Wed Apr  7 15:19:52 2010
New Revision: 206357
URL: http://svn.freebsd.org/changeset/base/206357

Log:
  MFC: r205572
  Fix the experimental NFS subsystem so that it uses the correct
  preprocessor macro name for not requiring strict data alignment.

Modified:
  stable/8/sys/fs/nfs/nfs_commonport.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/fs/nfs/nfs_commonport.c
==============================================================================
--- stable/8/sys/fs/nfs/nfs_commonport.c	Wed Apr  7 15:09:35 2010	(r206356)
+++ stable/8/sys/fs/nfs/nfs_commonport.c	Wed Apr  7 15:19:52 2010	(r206357)
@@ -117,7 +117,7 @@ struct mtx nfs_slock_mutex;
 /* local functions */
 static int nfssvc_call(struct thread *, struct nfssvc_args *, struct ucred *);
 
-#if defined(__i386__)
+#ifdef __NO_STRICT_ALIGNMENT
 /*
  * These architectures don't need re-alignment, so just return.
  */
@@ -127,7 +127,7 @@ newnfs_realign(struct mbuf **pm)
 
 	return;
 }
-#else
+#else	/* !__NO_STRICT_ALIGNMENT */
 /*
  *	newnfs_realign:
  *
@@ -185,7 +185,7 @@ newnfs_realign(struct mbuf **pm)
 		pm = &m->m_next;
 	}
 }
-#endif	/* !__i386__ */
+#endif	/* __NO_STRICT_ALIGNMENT */
 
 #ifdef notdef
 static void

From owner-svn-src-stable-8@FreeBSD.ORG  Wed Apr  7 17:58:29 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E404C1065674;
	Wed,  7 Apr 2010 17:58:29 +0000 (UTC)
	(envelope-from mjacob@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D3A078FC16;
	Wed,  7 Apr 2010 17:58:29 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o37HwTAh069287;
	Wed, 7 Apr 2010 17:58:29 GMT (envelope-from mjacob@svn.freebsd.org)
Received: (from mjacob@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o37HwTfD069285;
	Wed, 7 Apr 2010 17:58:29 GMT (envelope-from mjacob@svn.freebsd.org)
Message-Id: <201004071758.o37HwTfD069285@svn.freebsd.org>
From: Matt Jacob 
Date: Wed, 7 Apr 2010 17:58:29 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206373 - stable/8/sys/cam
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Wed, 07 Apr 2010 17:58:30 -0000

Author: mjacob
Date: Wed Apr  7 17:58:29 2010
New Revision: 206373
URL: http://svn.freebsd.org/changeset/base/206373

Log:
  This is an MFC of 205993
  
  For unhandled actions in xpt_action_default, remember to call
  xpt_done for queued requests. This solves the problem of
  indefinite hangs for unspecified transports when XPT_SCAN_BUS
  is called.
  
  A few minor cosmetics elsewhere.

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

Modified: stable/8/sys/cam/cam_xpt.c
==============================================================================
--- stable/8/sys/cam/cam_xpt.c	Wed Apr  7 17:52:32 2010	(r206372)
+++ stable/8/sys/cam/cam_xpt.c	Wed Apr  7 17:58:29 2010	(r206373)
@@ -2375,6 +2375,7 @@ xpt_action_default(union ccb *start_ccb)
 		if (start_ccb->ccb_h.func_code == XPT_ATA_IO) {
 			start_ccb->ataio.resid = 0;
 		}
+		/* FALLTHROUGH */
 	case XPT_RESET_DEV:
 	case XPT_ENG_EXEC:
 	{
@@ -2883,6 +2884,9 @@ xpt_action_default(union ccb *start_ccb)
 	case XPT_ENG_INQ:
 		/* XXX Implement */
 		start_ccb->ccb_h.status = CAM_PROVIDE_FAIL;
+		if (start_ccb->ccb_h.func_code & XPT_FC_DEV_QUEUED) {
+			xpt_done(start_ccb);
+		}
 		break;
 	}
 }
@@ -3925,7 +3929,7 @@ xpt_dev_async_default(u_int32_t async_co
 		      struct cam_et *target, struct cam_ed *device,
 		      void *async_arg)
 {
-	printf("xpt_dev_async called\n");
+	printf("%s called\n", __func__);
 }
 
 u_int32_t
@@ -4827,4 +4831,3 @@ camisr_runqueue(void *V_queue)
 		(*ccb_h->cbfcnp)(ccb_h->path->periph, (union ccb *)ccb_h);
 	}
 }
-

From owner-svn-src-stable-8@FreeBSD.ORG  Wed Apr  7 19:04:36 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E5264106566C;
	Wed,  7 Apr 2010 19:04:36 +0000 (UTC) (envelope-from ume@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D1EA08FC08;
	Wed,  7 Apr 2010 19:04:36 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o37J4ajH084511;
	Wed, 7 Apr 2010 19:04:36 GMT (envelope-from ume@svn.freebsd.org)
Received: (from ume@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o37J4auP084503;
	Wed, 7 Apr 2010 19:04:36 GMT (envelope-from ume@svn.freebsd.org)
Message-Id: <201004071904.o37J4auP084503@svn.freebsd.org>
From: Hajimu UMEMOTO 
Date: Wed, 7 Apr 2010 19:04:36 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206382 - in stable/8: . etc etc/defaults etc/rc.d
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Wed, 07 Apr 2010 19:04:37 -0000

Author: ume
Date: Wed Apr  7 19:04:36 2010
New Revision: 206382
URL: http://svn.freebsd.org/changeset/base/206382

Log:
  MFC r200028, r201193, r201752, r201930, r202460, r200672, r206375:
  Unify rc.firewall and rc.firewall6, and obsolete rc.firewall6 and
  rc.d/ip6fw.

Deleted:
  stable/8/etc/rc.d/ip6fw
  stable/8/etc/rc.firewall6
Modified:
  stable/8/ObsoleteFiles.inc   (contents, props changed)
  stable/8/UPDATING   (contents, props changed)
  stable/8/etc/Makefile
  stable/8/etc/defaults/rc.conf
  stable/8/etc/rc.d/Makefile
  stable/8/etc/rc.d/ipfw
  stable/8/etc/rc.firewall
Directory Properties:
  stable/8/etc/   (props changed)
  stable/8/etc/mtree/   (props changed)

Modified: stable/8/ObsoleteFiles.inc
==============================================================================
--- stable/8/ObsoleteFiles.inc	Wed Apr  7 18:52:51 2010	(r206381)
+++ stable/8/ObsoleteFiles.inc	Wed Apr  7 19:04:36 2010	(r206382)
@@ -14,6 +14,9 @@
 # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last.
 #
 
+# 20100408: unify rc.firewall and rc.firewall6.
+OLD_FILES+=etc/rc.d/ip6fw
+OLD_FILES+=etc/rc.firewall6
 # 20100330: [ia64] Sync with 9-current
 .if ${TARGET_ARCH} == "ia64"
 OLD_FILES+=usr/include/machine/nexusvar.h

Modified: stable/8/UPDATING
==============================================================================
--- stable/8/UPDATING	Wed Apr  7 18:52:51 2010	(r206381)
+++ stable/8/UPDATING	Wed Apr  7 19:04:36 2010	(r206382)
@@ -15,6 +15,19 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8.
 	debugging tools present in HEAD were left in place because
 	sun4v support still needs work to become production ready.
 
+20100408:
+	The rc.firewall and rc.firewall6 were unified, and
+	rc.firewall6 and rc.d/ip6fw were removed.
+	According to the removal of rc.d/ip6fw, ipv6_firewall_* rc
+	variables are obsoleted.  Instead, the following new rc
+	variables are added to rc.d/ipfw:
+
+		firewall_client_net_ipv6, firewall_simple_iif_ipv6,
+		firewall_simple_inet_ipv6, firewall_simple_oif_ipv6,
+		firewall_simple_onet_ipv6
+
+	The meanings correspond to the relevant IPv4 variables.
+
 20100406:
 	The kernel option COMPAT_IA32 has been replaced with COMPAT_FREEBSD32
 	to allow 32-bit compatibility on non-x86 platforms. All kernel

Modified: stable/8/etc/Makefile
==============================================================================
--- stable/8/etc/Makefile	Wed Apr  7 18:52:51 2010	(r206381)
+++ stable/8/etc/Makefile	Wed Apr  7 19:04:36 2010	(r206382)
@@ -15,7 +15,7 @@ BIN1=	auth.conf \
 	inetd.conf libalias.conf login.access login.conf mac.conf motd \
 	netconfig network.subr networks newsyslog.conf nsswitch.conf \
 	phones profile protocols \
-	rc rc.bsdextended rc.firewall rc.firewall6 rc.initdiskless \
+	rc rc.bsdextended rc.firewall rc.initdiskless \
 	rc.sendmail rc.shutdown \
 	rc.subr remote rpc services shells \
 	sysctl.conf syslog.conf \

Modified: stable/8/etc/defaults/rc.conf
==============================================================================
--- stable/8/etc/defaults/rc.conf	Wed Apr  7 18:52:51 2010	(r206381)
+++ stable/8/etc/defaults/rc.conf	Wed Apr  7 19:04:36 2010	(r206382)
@@ -120,7 +120,10 @@ firewall_logging="NO"		# Set to YES to e
 firewall_flags=""		# Flags passed to ipfw when type is a file
 firewall_coscripts=""		# List of executables/scripts to run after
 				# firewall starts/stops
-firewall_client_net="192.0.2.0/24" # Network address for "client" firewall.
+firewall_client_net="192.0.2.0/24" # IPv4 Network address for "client"
+				# firewall.
+#firewall_client_net_ipv6="2001:db8:2:1::/64" # IPv6 network prefix for
+				# "client" firewall.
 firewall_simple_iif="ed1"	# Inside network interface for "simple"
 				# firewall.
 firewall_simple_inet="192.0.2.16/28" # Inside network address for "simple"
@@ -129,6 +132,14 @@ firewall_simple_oif="ed0"	# Outside netw
 				# firewall.
 firewall_simple_onet="192.0.2.0/28" # Outside network address for "simple"
 				# firewall.
+#firewall_simple_iif_ipv6="ed1"	# Inside IPv6 network interface for "simple"
+				# firewall.
+#firewall_simple_inet_ipv6="2001:db8:2:800::/56" # Inside IPv6 network prefix
+				# for "simple" firewall.
+#firewall_simple_oif_ipv6="ed0"	# Outside IPv6 network interface for "simple"
+				# firewall.
+#firewall_simple_onet_ipv6="2001:db8:2:0::/56" # Outside IPv6 network prefix
+				# for "simple" firewall.
 firewall_myservices=""		# List of TCP ports on which this host
 				# offers services for "workstation" firewall.
 firewall_allowservices=""	# List of IPs which have access to
@@ -479,13 +490,6 @@ ipv6_faith_prefix="NO"		# Set faith pref
 				# faithd(8) setup.
 ipv6_ipv4mapping="NO"		# Set to "YES" to enable IPv4 mapped IPv6 addr
 				# communication. (like ::ffff:a.b.c.d)
-ipv6_firewall_enable="NO"	# Set to YES to enable IPv6 firewall
-				# functionality
-ipv6_firewall_script="/etc/rc.firewall6" # Which script to run to set up the IPv6 firewall
-ipv6_firewall_type="UNKNOWN"	# IPv6 Firewall type (see /etc/rc.firewall6)
-ipv6_firewall_quiet="NO"	# Set to YES to suppress rule display
-ipv6_firewall_logging="NO"	# Set to YES to enable events logging
-ipv6_firewall_flags=""		# Flags passed to ip6fw when type is a file
 ipv6_ipfilter_rules="/etc/ipf6.rules"	# rules definition file for ipfilter,
 					# see /usr/src/contrib/ipfilter/rules
 					# for examples

Modified: stable/8/etc/rc.d/Makefile
==============================================================================
--- stable/8/etc/rc.d/Makefile	Wed Apr  7 18:52:51 2010	(r206381)
+++ stable/8/etc/rc.d/Makefile	Wed Apr  7 19:04:36 2010	(r206382)
@@ -15,7 +15,7 @@ FILES=	DAEMON FILESYSTEMS LOGIN NETWORKI
 	hcsecd \
 	hostapd hostid hostid_save hostname \
 	inetd initrandom \
-	ip6addrctl ip6fw ipfilter ipfs ipfw ipmon \
+	ip6addrctl ipfilter ipfs ipfw ipmon \
 	ipnat ipsec ipxrouted \
 	jail \
 	kadmind kerberos keyserv kldxref kpasswdd \

Modified: stable/8/etc/rc.d/ipfw
==============================================================================
--- stable/8/etc/rc.d/ipfw	Wed Apr  7 18:52:51 2010	(r206381)
+++ stable/8/etc/rc.d/ipfw	Wed Apr  7 19:04:36 2010	(r206382)
@@ -18,6 +18,8 @@ start_postcmd="ipfw_poststart"
 stop_cmd="ipfw_stop"
 required_modules="ipfw"
 
+set_rcvar_obsolete ipv6_firewall_enable
+
 ipfw_prestart()
 {
 	if checkyesno dummynet_enable; then
@@ -72,7 +74,13 @@ ipfw_poststart()
 	# Enable the firewall
 	#
 	if ! ${SYSCTL_W} net.inet.ip.fw.enable=1 1>/dev/null 2>&1; then
-		warn "failed to enable firewall"
+		warn "failed to enable IPv4 firewall"
+	fi
+	if afexists inet6; then
+		if ! ${SYSCTL_W} net.inet6.ip6.fw.enable=1 1>/dev/null 2>&1
+		then
+			warn "failed to enable IPv6 firewall"
+		fi
 	fi
 }
 
@@ -83,6 +91,9 @@ ipfw_stop()
 	# Disable the firewall
 	#
 	${SYSCTL_W} net.inet.ip.fw.enable=0
+	if afexists inet6; then
+		${SYSCTL_W} net.inet6.ip6.fw.enable=0
+	fi
 
 	# Stop firewall coscripts
 	#

Modified: stable/8/etc/rc.firewall
==============================================================================
--- stable/8/etc/rc.firewall	Wed Apr  7 18:52:51 2010	(r206381)
+++ stable/8/etc/rc.firewall	Wed Apr  7 19:04:36 2010	(r206382)
@@ -85,12 +85,42 @@ setup_loopback () {
 	${fwcmd} add 100 pass all from any to any via lo0
 	${fwcmd} add 200 deny all from any to 127.0.0.0/8
 	${fwcmd} add 300 deny ip from 127.0.0.0/8 to any
+	if [ $ipv6_available -eq 0 ]; then
+		${fwcmd} add 400 deny all from any to ::1
+		${fwcmd} add 500 deny all from ::1 to any
+	fi
+}
+
+setup_ipv6_mandatory () {
+	[ $ipv6_available -eq 0 ] || return 0
+
+	############
+	# Only in rare cases do you want to change these rules
+	#
+	# ND
+	#
+	# DAD
+	${fwcmd} add pass ipv6-icmp from :: to ff02::/16
+	# RS, RA, NS, NA, redirect...
+	${fwcmd} add pass ipv6-icmp from fe80::/10 to fe80::/10
+	${fwcmd} add pass ipv6-icmp from fe80::/10 to ff02::/16
+
+	# Allow ICMPv6 destination unreach
+	${fwcmd} add pass ipv6-icmp from any to any icmp6types 1
+
+	# Allow NS/NA/toobig (don't filter it out)
+	${fwcmd} add pass ipv6-icmp from any to any icmp6types 2,135,136
 }
 
 if [ -n "${1}" ]; then
 	firewall_type="${1}"
 fi
 
+. /etc/rc.subr
+. /etc/network.subr
+afexists inet6
+ipv6_available=$?
+
 ############
 # Set quiet mode if requested
 #
@@ -109,6 +139,7 @@ esac
 ${fwcmd} -f flush
 
 setup_loopback
+setup_ipv6_mandatory
 
 ############
 # Network Address Translation.  All packets are passed to natd(8)
@@ -166,11 +197,13 @@ case ${firewall_type} in
 	# against people from outside your own network.
 	#
 	# Configuration:
-	#  firewall_client_net:		Network address of local network.
+	#  firewall_client_net:		Network address of local IPv4 network.
+	#  firewall_client_net_ipv6:	Network address of local IPv6 network.
 	############
 
 	# set this to your local network
 	net="$firewall_client_net"
+	net6="$firewall_client_net_ipv6"
 
 	# Allow limited broadcast traffic from my own net.
 	${fwcmd} add pass all from ${net} to 255.255.255.255
@@ -178,6 +211,18 @@ case ${firewall_type} in
 	# Allow any traffic to or from my own net.
 	${fwcmd} add pass all from me to ${net}
 	${fwcmd} add pass all from ${net} to me
+	if [ -n "$net6" ]; then
+		${fwcmd} add pass all from me to ${net6}
+		${fwcmd} add pass all from ${net6} to me
+	fi
+
+	if [ -n "$net6" ]; then
+		# Allow any link-local multicast traffic
+		${fwcmd} add pass all from fe80::/10 to ff02::/16
+		${fwcmd} add pass all from ${net6} to ff02::/16
+		# Allow DHCPv6
+		${fwcmd} add pass udp from fe80::/10 to me 546
+	fi
 
 	# Allow TCP through if setup succeeded
 	${fwcmd} add pass tcp from any to any established
@@ -212,23 +257,38 @@ case ${firewall_type} in
 	# on the inside at this machine for those services.
 	#
 	# Configuration:
-	#  firewall_simple_iif:		Inside network interface.
-	#  firewall_simple_inet:	Inside network address.
-	#  firewall_simple_oif:		Outside network interface.
-	#  firewall_simple_onet:	Outside network address.
+	#  firewall_simple_iif:		Inside IPv4 network interface.
+	#  firewall_simple_inet:	Inside IPv4 network address.
+	#  firewall_simple_oif:		Outside IPv4 network interface.
+	#  firewall_simple_onet:	Outside IPv4 network address.
+	#  firewall_simple_iif_ipv6:	Inside IPv6 network interface.
+	#  firewall_simple_inet_ipv6:	Inside IPv6 network prefix.
+	#  firewall_simple_oif_ipv6:	Outside IPv6 network interface.
+	#  firewall_simple_onet_ipv6:	Outside IPv6 network prefix.
 	############
 
 	# set these to your outside interface network
 	oif="$firewall_simple_oif"
 	onet="$firewall_simple_onet"
+	oif6="${firewall_simple_oif_ipv6:-$firewall_simple_oif}"
+	onet6="$firewall_simple_onet_ipv6"
 
 	# set these to your inside interface network
 	iif="$firewall_simple_iif"
 	inet="$firewall_simple_inet"
+	iif6="${firewall_simple_iif_ipv6:-$firewall_simple_iif}"
+	inet6="$firewall_simple_inet_ipv6"
 
 	# Stop spoofing
 	${fwcmd} add deny all from ${inet} to any in via ${oif}
 	${fwcmd} add deny all from ${onet} to any in via ${iif}
+	if [ -n "$inet6" ]; then
+		${fwcmd} add deny all from ${inet6} to any in via ${oif6}
+		if [ -n "$onet6" ]; then
+			${fwcmd} add deny all from ${onet6} to any in \
+			    via ${iif6}
+		fi
+	fi
 
 	# Stop RFC1918 nets on the outside interface
 	${fwcmd} add deny all from any to 10.0.0.0/8 via ${oif}
@@ -254,7 +314,7 @@ case ${firewall_type} in
 	case ${natd_enable} in
 	[Yy][Ee][Ss])
 		if [ -n "${natd_interface}" ]; then
-			${fwcmd} add divert natd all from any to any via ${natd_interface}
+			${fwcmd} add divert natd ip4 from any to any via ${natd_interface}
 		fi
 		;;
 	esac
@@ -273,6 +333,55 @@ case ${firewall_type} in
 	${fwcmd} add deny all from 224.0.0.0/4 to any via ${oif}
 	${fwcmd} add deny all from 240.0.0.0/4 to any via ${oif}
 
+	if [ -n "$inet6" ]; then
+		# Stop unique local unicast address on the outside interface
+		${fwcmd} add deny all from fc00::/7 to any via ${oif6}
+		${fwcmd} add deny all from any to fc00::/7 via ${oif6}
+
+		# Stop site-local on the outside interface
+		${fwcmd} add deny all from fec0::/10 to any via ${oif6}
+		${fwcmd} add deny all from any to fec0::/10 via ${oif6}
+
+		# Disallow "internal" addresses to appear on the wire.
+		${fwcmd} add deny all from ::ffff:0.0.0.0/96 to any \
+		    via ${oif6}
+		${fwcmd} add deny all from any to ::ffff:0.0.0.0/96 \
+		    via ${oif6}
+
+		# Disallow packets to malicious IPv4 compatible prefix.
+		${fwcmd} add deny all from ::224.0.0.0/100 to any via ${oif6}
+		${fwcmd} add deny all from any to ::224.0.0.0/100 via ${oif6}
+		${fwcmd} add deny all from ::127.0.0.0/104 to any via ${oif6}
+		${fwcmd} add deny all from any to ::127.0.0.0/104 via ${oif6}
+		${fwcmd} add deny all from ::0.0.0.0/104 to any via ${oif6}
+		${fwcmd} add deny all from any to ::0.0.0.0/104 via ${oif6}
+		${fwcmd} add deny all from ::255.0.0.0/104 to any via ${oif6}
+		${fwcmd} add deny all from any to ::255.0.0.0/104 via ${oif6}
+
+		${fwcmd} add deny all from ::0.0.0.0/96 to any via ${oif6}
+		${fwcmd} add deny all from any to ::0.0.0.0/96 via ${oif6}
+
+		# Disallow packets to malicious 6to4 prefix.
+		${fwcmd} add deny all from 2002:e000::/20 to any via ${oif6}
+		${fwcmd} add deny all from any to 2002:e000::/20 via ${oif6}
+		${fwcmd} add deny all from 2002:7f00::/24 to any via ${oif6}
+		${fwcmd} add deny all from any to 2002:7f00::/24 via ${oif6}
+		${fwcmd} add deny all from 2002:0000::/24 to any via ${oif6}
+		${fwcmd} add deny all from any to 2002:0000::/24 via ${oif6}
+		${fwcmd} add deny all from 2002:ff00::/24 to any via ${oif6}
+		${fwcmd} add deny all from any to 2002:ff00::/24 via ${oif6}
+
+		${fwcmd} add deny all from 2002:0a00::/24 to any via ${oif6}
+		${fwcmd} add deny all from any to 2002:0a00::/24 via ${oif6}
+		${fwcmd} add deny all from 2002:ac10::/28 to any via ${oif6}
+		${fwcmd} add deny all from any to 2002:ac10::/28 via ${oif6}
+		${fwcmd} add deny all from 2002:c0a8::/32 to any via ${oif6}
+		${fwcmd} add deny all from any to 2002:c0a8::/32 via ${oif6}
+
+		${fwcmd} add deny all from ff05::/16 to any via ${oif6}
+		${fwcmd} add deny all from any to ff05::/16 via ${oif6}
+	fi
+
 	# Allow TCP through if setup succeeded
 	${fwcmd} add pass tcp from any to any established
 
@@ -291,7 +400,11 @@ case ${firewall_type} in
 	${fwcmd} add pass tcp from any to me 80 setup
 
 	# Reject&Log all setup of incoming connections from the outside
-	${fwcmd} add deny log tcp from any to any in via ${oif} setup
+	${fwcmd} add deny log ip4 from any to any in via ${oif} setup proto tcp
+	if [ -n "$inet6" ]; then
+		${fwcmd} add deny log ip6 from any to any in via ${oif6} \
+		    setup proto tcp
+	fi
 
 	# Allow setup of any other TCP connection
 	${fwcmd} add pass tcp from any to any setup
@@ -324,7 +437,7 @@ case ${firewall_type} in
 	#  firewall_nologports:		List of TCP/UDP ports for which
 	#				 denied incomming packets are not
 	#				 logged.
-	
+
 	# Allow packets for which a state has been built.
 	${fwcmd} add check-state
 
@@ -335,18 +448,30 @@ case ${firewall_type} in
 	${fwcmd} add pass tcp  from me to any setup keep-state
 	${fwcmd} add pass udp  from me to any       keep-state
 	${fwcmd} add pass icmp from me to any       keep-state
+	if [ $ipv6_available -eq 0 ]; then
+		${fwcmd} add pass ipv6-icmp from me to any keep-state
+	fi
 
 	# Allow DHCP.
 	${fwcmd} add pass udp  from 0.0.0.0 68 to 255.255.255.255 67 out
 	${fwcmd} add pass udp  from any 67     to me 68 in
 	${fwcmd} add pass udp  from any 67     to 255.255.255.255 68 in
+	if [ $ipv6_available -eq 0 ]; then
+		${fwcmd} add pass udp from fe80::/10 to me 546 in
+	fi
 	# Some servers will ping the IP while trying to decide if it's 
 	# still in use.
 	${fwcmd} add pass icmp from any to any icmptype 8
+	if [ $ipv6_available -eq 0 ]; then
+		${fwcmd} add pass ipv6-icmp from any to any icmp6type 128,129
+	fi
 
 	# Allow "mandatory" ICMP in.
 	${fwcmd} add pass icmp from any to any icmptype 3,4,11
-	
+	if [ $ipv6_available -eq 0 ]; then
+		${fwcmd} add pass ipv6-icmp from any to any icmp6type 3
+	fi
+
 	# Add permits for this workstations published services below
 	# Only IPs and nets in firewall_allowservices is allowed in.
 	# If you really wish to let anyone use services on your 
@@ -370,7 +495,7 @@ case ${firewall_type} in
 	for i in ${firewall_trusted} ; do
 	  ${fwcmd} add pass ip from $i to me
 	done
-	
+
 	${fwcmd} add 65000 count ip from any to any
 
 	# Drop packets to ports where we don't want logging

From owner-svn-src-stable-8@FreeBSD.ORG  Wed Apr  7 22:19:46 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A3765106564A;
	Wed,  7 Apr 2010 22:19:46 +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 9056E8FC1B;
	Wed,  7 Apr 2010 22:19:46 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o37MJkKD027678;
	Wed, 7 Apr 2010 22:19:46 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o37MJklb027676;
	Wed, 7 Apr 2010 22:19:46 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201004072219.o37MJklb027676@svn.freebsd.org>
From: Andriy Gapon 
Date: Wed, 7 Apr 2010 22:19:46 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206385 - stable/8/usr.bin/indent
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Wed, 07 Apr 2010 22:19:46 -0000

Author: avg
Date: Wed Apr  7 22:19:46 2010
New Revision: 206385
URL: http://svn.freebsd.org/changeset/base/206385

Log:
  MFC r205988: indent(1): correctly handle case/label at the very start of a function

Modified:
  stable/8/usr.bin/indent/indent.c
Directory Properties:
  stable/8/usr.bin/indent/   (props changed)

Modified: stable/8/usr.bin/indent/indent.c
==============================================================================
--- stable/8/usr.bin/indent/indent.c	Wed Apr  7 21:38:42 2010	(r206384)
+++ stable/8/usr.bin/indent/indent.c	Wed Apr  7 22:19:46 2010	(r206385)
@@ -675,7 +675,7 @@ check_type:
 		ps.want_blank = true;
 		break;
 	    }
-	    if (ps.in_decl) {
+	    if (ps.in_or_st) {
 		*e_code++ = ':';
 		ps.want_blank = false;
 		break;

From owner-svn-src-stable-8@FreeBSD.ORG  Thu Apr  8 00:52:29 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1BD421065675;
	Thu,  8 Apr 2010 00:52:29 +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 0A7BF8FC13;
	Thu,  8 Apr 2010 00:52:29 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o380qSVD062066;
	Thu, 8 Apr 2010 00:52:28 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o380qSQW062064;
	Thu, 8 Apr 2010 00:52:28 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201004080052.o380qSQW062064@svn.freebsd.org>
From: Xin LI 
Date: Thu, 8 Apr 2010 00:52:28 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206389 - stable/8/sys/net
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Thu, 08 Apr 2010 00:52:29 -0000

Author: delphij
Date: Thu Apr  8 00:52:28 2010
New Revision: 206389
URL: http://svn.freebsd.org/changeset/base/206389

Log:
  MFC r204901
  
  Remove the check for IFF_DRV_OACTIVE right before adding a port into lagg
  interface.  The check itself seems to be coming from OpenBSD but does not
  seem to be useful for our code.
  
  Discussed with:	thomasa

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

Modified: stable/8/sys/net/if_lagg.c
==============================================================================
--- stable/8/sys/net/if_lagg.c	Thu Apr  8 00:50:43 2010	(r206388)
+++ stable/8/sys/net/if_lagg.c	Thu Apr  8 00:52:28 2010	(r206389)
@@ -424,10 +424,6 @@ lagg_port_create(struct lagg_softc *sc, 
 	if (sc->sc_count >= LAGG_MAX_PORTS)
 		return (ENOSPC);
 
-	/* New lagg port has to be in an idle state */
-	if (ifp->if_drv_flags & IFF_DRV_OACTIVE)
-		return (EBUSY);
-
 	/* Check if port has already been associated to a lagg */
 	if (ifp->if_lagg != NULL)
 		return (EBUSY);

From owner-svn-src-stable-8@FreeBSD.ORG  Thu Apr  8 07:43:16 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 10048106564A;
	Thu,  8 Apr 2010 07:43:16 +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 F0FE18FC16;
	Thu,  8 Apr 2010 07:43:15 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o387hFtl054120;
	Thu, 8 Apr 2010 07:43:15 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o387hFlR054118;
	Thu, 8 Apr 2010 07:43:15 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201004080743.o387hFlR054118@svn.freebsd.org>
From: Andriy Gapon 
Date: Thu, 8 Apr 2010 07:43:15 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206393 - stable/8/lib/libc/db/man
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Thu, 08 Apr 2010 07:43:16 -0000

Author: avg
Date: Thu Apr  8 07:43:15 2010
New Revision: 206393
URL: http://svn.freebsd.org/changeset/base/206393

Log:
  MFC r206177: hash.3: fix a factual mistake in the man page

Modified:
  stable/8/lib/libc/db/man/hash.3
Directory Properties:
  stable/8/lib/libc/   (props changed)
  stable/8/lib/libc/stdtime/   (props changed)

Modified: stable/8/lib/libc/db/man/hash.3
==============================================================================
--- stable/8/lib/libc/db/man/hash.3	Thu Apr  8 06:48:20 2010	(r206392)
+++ stable/8/lib/libc/db/man/hash.3	Thu Apr  8 07:43:15 2010	(r206393)
@@ -78,7 +78,7 @@ The
 element
 defines the
 .Nm
-table bucket size, and is, by default, 256 bytes.
+table bucket size, and is, by default, 4096 bytes.
 It may be preferable to increase the page size for disk-resident tables
 and tables with large data items.
 .It Va ffactor

From owner-svn-src-stable-8@FreeBSD.ORG  Thu Apr  8 18:33:35 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E12441065675;
	Thu,  8 Apr 2010 18:33:35 +0000 (UTC)
	(envelope-from mjacob@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id CFBAC8FC1B;
	Thu,  8 Apr 2010 18:33:35 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o38IXZH0099639;
	Thu, 8 Apr 2010 18:33:35 GMT (envelope-from mjacob@svn.freebsd.org)
Received: (from mjacob@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o38IXZZT099637;
	Thu, 8 Apr 2010 18:33:35 GMT (envelope-from mjacob@svn.freebsd.org)
Message-Id: <201004081833.o38IXZZT099637@svn.freebsd.org>
From: Matt Jacob 
Date: Thu, 8 Apr 2010 18:33:35 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206401 - stable/8/sys/cam/scsi
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Thu, 08 Apr 2010 18:33:36 -0000

Author: mjacob
Date: Thu Apr  8 18:33:35 2010
New Revision: 206401
URL: http://svn.freebsd.org/changeset/base/206401

Log:
  This is an MFC of 206029
  Add a couple missing basic mode page codes.

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

Modified: stable/8/sys/cam/scsi/scsi_all.h
==============================================================================
--- stable/8/sys/cam/scsi/scsi_all.h	Thu Apr  8 18:32:13 2010	(r206400)
+++ stable/8/sys/cam/scsi/scsi_all.h	Thu Apr  8 18:33:35 2010	(r206401)
@@ -170,6 +170,8 @@ struct scsi_mode_sense_6
 #define	SMS_PAGE_CODE 			0x3F
 #define SMS_VENDOR_SPECIFIC_PAGE	0x00
 #define SMS_DISCONNECT_RECONNECT_PAGE	0x02
+#define SMS_FORMAT_DEVICE_PAGE		0x03
+#define SMS_GEOMETRY_PAGE		0x04
 #define SMS_CACHE_PAGE			0x08
 #define SMS_PERIPHERAL_DEVICE_PAGE	0x09
 #define SMS_CONTROL_MODE_PAGE		0x0A

From owner-svn-src-stable-8@FreeBSD.ORG  Fri Apr  9 01:14:40 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 388BB106566C;
	Fri,  9 Apr 2010 01:14:40 +0000 (UTC)
	(envelope-from rmacklem@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 280318FC08;
	Fri,  9 Apr 2010 01:14:40 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o391Eert087939;
	Fri, 9 Apr 2010 01:14:40 GMT (envelope-from rmacklem@svn.freebsd.org)
Received: (from rmacklem@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o391Eef7087937;
	Fri, 9 Apr 2010 01:14:40 GMT (envelope-from rmacklem@svn.freebsd.org)
Message-Id: <201004090114.o391Eef7087937@svn.freebsd.org>
From: Rick Macklem 
Date: Fri, 9 Apr 2010 01:14:40 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206406 - stable/8/sys/nfsserver
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Fri, 09 Apr 2010 01:14:40 -0000

Author: rmacklem
Date: Fri Apr  9 01:14:39 2010
New Revision: 206406
URL: http://svn.freebsd.org/changeset/base/206406

Log:
  MFC: r205661
  Patch the regular NFS server so that it returns ESTALE to the client
  for all errors returned by VFS_FHTOVP(). This is required to ensure
  that EIO doesn't get returned to the client when ZFS is used as the
  server file system.

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

Modified: stable/8/sys/nfsserver/nfs_srvsubs.c
==============================================================================
--- stable/8/sys/nfsserver/nfs_srvsubs.c	Fri Apr  9 01:14:11 2010	(r206405)
+++ stable/8/sys/nfsserver/nfs_srvsubs.c	Fri Apr  9 01:14:39 2010	(r206406)
@@ -1128,6 +1128,9 @@ nfsrv_fhtovp(fhandle_t *fhp, int lockfla
 		}
 	}
 	error = VFS_FHTOVP(mp, &fhp->fh_fid, vpp);
+	if (error != 0)
+		/* Make sure the server replies ESTALE to the client. */
+		error = ESTALE;
 	vfs_unbusy(mp);
 	if (error)
 		goto out;

From owner-svn-src-stable-8@FreeBSD.ORG  Fri Apr  9 01:33:13 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2936A106566B;
	Fri,  9 Apr 2010 01:33:13 +0000 (UTC)
	(envelope-from rmacklem@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 186F48FC14;
	Fri,  9 Apr 2010 01:33:13 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o391XChu092145;
	Fri, 9 Apr 2010 01:33:12 GMT (envelope-from rmacklem@svn.freebsd.org)
Received: (from rmacklem@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o391XCgH092143;
	Fri, 9 Apr 2010 01:33:12 GMT (envelope-from rmacklem@svn.freebsd.org)
Message-Id: <201004090133.o391XCgH092143@svn.freebsd.org>
From: Rick Macklem 
Date: Fri, 9 Apr 2010 01:33:12 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206407 - stable/8/sys/fs/nfsserver
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Fri, 09 Apr 2010 01:33:13 -0000

Author: rmacklem
Date: Fri Apr  9 01:33:12 2010
New Revision: 206407
URL: http://svn.freebsd.org/changeset/base/206407

Log:
  MFC: r205663
  Patch the experimental NFS server in a manner analagous to r205661
  for the regular NFS server, to ensure that ESTALE is
  returned to the client for all errors returned by VFS_FHTOVP().

Modified:
  stable/8/sys/fs/nfsserver/nfs_nfsdport.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/fs/nfsserver/nfs_nfsdport.c
==============================================================================
--- stable/8/sys/fs/nfsserver/nfs_nfsdport.c	Fri Apr  9 01:14:39 2010	(r206406)
+++ stable/8/sys/fs/nfsserver/nfs_nfsdport.c	Fri Apr  9 01:33:12 2010	(r206407)
@@ -2443,6 +2443,9 @@ nfsvno_fhtovp(struct mount *mp, fhandle_
 	*credp = NULL;
 	exp->nes_numsecflavor = 0;
 	error = VFS_FHTOVP(mp, &fhp->fh_fid, vpp);
+	if (error != 0)
+		/* Make sure the server replies ESTALE to the client. */
+		error = ESTALE;
 	if (nam && !error) {
 		error = VFS_CHECKEXP(mp, nam, &exp->nes_exflag, credp,
 		    &exp->nes_numsecflavor, &secflavors);

From owner-svn-src-stable-8@FreeBSD.ORG  Fri Apr  9 06:40:30 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D5561106566B;
	Fri,  9 Apr 2010 06:40:30 +0000 (UTC) (envelope-from alc@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C430A8FC21;
	Fri,  9 Apr 2010 06:40:30 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o396eUkJ042150;
	Fri, 9 Apr 2010 06:40:30 GMT (envelope-from alc@svn.freebsd.org)
Received: (from alc@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o396eUIM042149;
	Fri, 9 Apr 2010 06:40:30 GMT (envelope-from alc@svn.freebsd.org)
Message-Id: <201004090640.o396eUIM042149@svn.freebsd.org>
From: Alan Cox 
Date: Fri, 9 Apr 2010 06:40:30 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206410 - stable/8/sys/vm
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Fri, 09 Apr 2010 06:40:31 -0000

Author: alc
Date: Fri Apr  9 06:40:30 2010
New Revision: 206410
URL: http://svn.freebsd.org/changeset/base/206410

Log:
  MFC r206174
    vm_reserv_alloc_page() should never be called on an OBJT_SG object, just
    as it is never called on an OBJT_DEVICE object.  (This change should have
    been included in r195840.)

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

Modified: stable/8/sys/vm/vm_page.c
==============================================================================
--- stable/8/sys/vm/vm_page.c	Fri Apr  9 02:39:20 2010	(r206409)
+++ stable/8/sys/vm/vm_page.c	Fri Apr  9 06:40:30 2010	(r206410)
@@ -1084,6 +1084,7 @@ vm_page_alloc(vm_object_t object, vm_pin
 			return (NULL);
 #if VM_NRESERVLEVEL > 0
 		} else if (object == NULL || object->type == OBJT_DEVICE ||
+		    object->type == OBJT_SG ||
 		    (object->flags & OBJ_COLORED) == 0 ||
 		    (m = vm_reserv_alloc_page(object, pindex)) == NULL) {
 #else

From owner-svn-src-stable-8@FreeBSD.ORG  Fri Apr  9 08:39:29 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2E03A1065670;
	Fri,  9 Apr 2010 08:39: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 023F88FC08;
	Fri,  9 Apr 2010 08:39:29 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o398dSEE049426;
	Fri, 9 Apr 2010 08:39:28 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o398dSlL049421;
	Fri, 9 Apr 2010 08:39:28 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201004090839.o398dSlL049421@svn.freebsd.org>
From: Konstantin Belousov 
Date: Fri, 9 Apr 2010 08:39:28 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206413 - in stable/8/sys: fs/deadfs kern sys
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Fri, 09 Apr 2010 08:39:29 -0000

Author: kib
Date: Fri Apr  9 08:39:28 2010
New Revision: 206413
URL: http://svn.freebsd.org/changeset/base/206413

Log:
  MFC r206093:
  Add function vop_rename_fail(9) that performs needed cleanup for locks
  and references of the VOP_RENAME(9) arguments. Use vop_rename_fail()
  in deadfs_rename().

Modified:
  stable/8/sys/fs/deadfs/dead_vnops.c
  stable/8/sys/kern/vfs_subr.c
  stable/8/sys/sys/vnode.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/fs/deadfs/dead_vnops.c
==============================================================================
--- stable/8/sys/fs/deadfs/dead_vnops.c	Fri Apr  9 08:20:43 2010	(r206412)
+++ stable/8/sys/fs/deadfs/dead_vnops.c	Fri Apr  9 08:39:28 2010	(r206413)
@@ -225,13 +225,7 @@ dead_rename(ap)
 		struct componentname *a_tcnp;
 	} */ *ap;
 {
-	if (ap->a_tvp)
-		vput(ap->a_tvp);
-	if (ap->a_tdvp == ap->a_tvp)
-		vrele(ap->a_tdvp);
-	else
-		vput(ap->a_tdvp);
-	vrele(ap->a_fdvp);
-	vrele(ap->a_fvp);
+
+	vop_rename_fail(ap);
 	return (EXDEV);
 }

Modified: stable/8/sys/kern/vfs_subr.c
==============================================================================
--- stable/8/sys/kern/vfs_subr.c	Fri Apr  9 08:20:43 2010	(r206412)
+++ stable/8/sys/kern/vfs_subr.c	Fri Apr  9 08:39:28 2010	(r206413)
@@ -3749,6 +3749,20 @@ assert_vop_slocked(struct vnode *vp, con
 #endif /* DEBUG_VFS_LOCKS */
 
 void
+vop_rename_fail(struct vop_rename_args *ap)
+{
+
+	if (ap->a_tvp != NULL)
+		vput(ap->a_tvp);
+	if (ap->a_tdvp == ap->a_tvp)
+		vrele(ap->a_tdvp);
+	else
+		vput(ap->a_tdvp);
+	vrele(ap->a_fdvp);
+	vrele(ap->a_fvp);
+}
+
+void
 vop_rename_pre(void *ap)
 {
 	struct vop_rename_args *a = ap;

Modified: stable/8/sys/sys/vnode.h
==============================================================================
--- stable/8/sys/sys/vnode.h	Fri Apr  9 08:20:43 2010	(r206412)
+++ stable/8/sys/sys/vnode.h	Fri Apr  9 08:39:28 2010	(r206413)
@@ -720,6 +720,8 @@ void	vop_symlink_post(void *a, int rc);
 void	vop_unlock_post(void *a, int rc);
 void	vop_unlock_pre(void *a);
 
+void	vop_rename_fail(struct vop_rename_args *ap);
+
 #define	VOP_WRITE_PRE(ap)						\
 	struct vattr va;						\
 	int error, osize, ooffset, noffset;				\

From owner-svn-src-stable-8@FreeBSD.ORG  Fri Apr  9 08:45:30 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 823BF106568D;
	Fri,  9 Apr 2010 08:45:30 +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 56B068FC13;
	Fri,  9 Apr 2010 08:45:30 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o398jUXw055139;
	Fri, 9 Apr 2010 08:45:30 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o398jU6J055136;
	Fri, 9 Apr 2010 08:45:30 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201004090845.o398jU6J055136@svn.freebsd.org>
From: Konstantin Belousov 
Date: Fri, 9 Apr 2010 08:45:30 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206414 - stable/8/sys/kern
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Fri, 09 Apr 2010 08:45:30 -0000

Author: kib
Date: Fri Apr  9 08:45:30 2010
New Revision: 206414
URL: http://svn.freebsd.org/changeset/base/206414

Log:
  MFC r206094:
  Supply default implementation of VOP_RENAME() that does neccessary
  unlocks and unreferences for argument vnodes, as expected by
  kern_renameat(9), and returns EOPNOTSUPP. This fixes locks and
  reference leaks when rename is attempted on fs that does not
  implement rename.

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

Modified: stable/8/sys/kern/vfs_default.c
==============================================================================
--- stable/8/sys/kern/vfs_default.c	Fri Apr  9 08:39:28 2010	(r206413)
+++ stable/8/sys/kern/vfs_default.c	Fri Apr  9 08:45:30 2010	(r206414)
@@ -67,6 +67,7 @@ __FBSDID("$FreeBSD$");
 #include 
 
 static int	vop_nolookup(struct vop_lookup_args *);
+static int	vop_norename(struct vop_rename_args *);
 static int	vop_nostrategy(struct vop_strategy_args *);
 static int	get_next_dirent(struct vnode *vp, struct dirent **dpp,
 				char *dirbuf, int dirbuflen, off_t *off,
@@ -113,6 +114,7 @@ struct vop_vector default_vnodeops = {
 	.vop_poll =		vop_nopoll,
 	.vop_putpages =		vop_stdputpages,
 	.vop_readlink =		VOP_EINVAL,
+	.vop_rename =		vop_norename,
 	.vop_revoke =		VOP_PANIC,
 	.vop_strategy =		vop_nostrategy,
 	.vop_unlock =		vop_stdunlock,
@@ -206,6 +208,20 @@ vop_nolookup(ap)
 }
 
 /*
+ * vop_norename:
+ *
+ * Handle unlock and reference counting for arguments of vop_rename
+ * for filesystems that do not implement rename operation.
+ */
+static int
+vop_norename(struct vop_rename_args *ap)
+{
+
+	vop_rename_fail(ap);
+	return (EOPNOTSUPP);
+}
+
+/*
  *	vop_nostrategy:
  *
  *	Strategy routine for VFS devices that have none.

From owner-svn-src-stable-8@FreeBSD.ORG  Fri Apr  9 22:50:36 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BB792106566C;
	Fri,  9 Apr 2010 22:50:36 +0000 (UTC)
	(envelope-from emaste@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A91DB8FC18;
	Fri,  9 Apr 2010 22:50:36 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o39Moaud091466;
	Fri, 9 Apr 2010 22:50:36 GMT (envelope-from emaste@svn.freebsd.org)
Received: (from emaste@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o39Moa3I091464;
	Fri, 9 Apr 2010 22:50:36 GMT (envelope-from emaste@svn.freebsd.org)
Message-Id: <201004092250.o39Moa3I091464@svn.freebsd.org>
From: Ed Maste 
Date: Fri, 9 Apr 2010 22:50:36 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206434 - stable/8/share/man/man9
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Fri, 09 Apr 2010 22:50:36 -0000

Author: emaste
Date: Fri Apr  9 22:50:36 2010
New Revision: 206434
URL: http://svn.freebsd.org/changeset/base/206434

Log:
  MFC r206383:
    Remove extraneous '>'.

Modified:
  stable/8/share/man/man9/stack.9
Directory Properties:
  stable/8/share/man/man9/   (props changed)

Modified: stable/8/share/man/man9/stack.9
==============================================================================
--- stable/8/share/man/man9/stack.9	Fri Apr  9 22:50:28 2010	(r206433)
+++ stable/8/share/man/man9/stack.9	Fri Apr  9 22:50:36 2010	(r206434)
@@ -34,7 +34,7 @@
 .Nm stack
 .Nd kernel thread stack tracing routines
 .Sh SYNOPSIS
-.In sys/param.h>
+.In sys/param.h
 .In sys/stack.h
 In the kernel configuration file:
 .Cd "options DDB"

From owner-svn-src-stable-8@FreeBSD.ORG  Sat Apr 10 14:28:59 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3635F106566B;
	Sat, 10 Apr 2010 14:28:59 +0000 (UTC) (envelope-from jh@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 18CC48FC17;
	Sat, 10 Apr 2010 14:28:59 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3AESwcR006094;
	Sat, 10 Apr 2010 14:28:58 GMT (envelope-from jh@svn.freebsd.org)
Received: (from jh@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3AESwLi006092;
	Sat, 10 Apr 2010 14:28:58 GMT (envelope-from jh@svn.freebsd.org)
Message-Id: <201004101428.o3AESwLi006092@svn.freebsd.org>
From: Jaakko Heinonen 
Date: Sat, 10 Apr 2010 14:28:58 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206458 - stable/8/sys/geom
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Sat, 10 Apr 2010 14:28:59 -0000

Author: jh
Date: Sat Apr 10 14:28:58 2010
New Revision: 206458
URL: http://svn.freebsd.org/changeset/base/206458

Log:
  MFC r205385:
  
  Escape characters unsafe for XML output in GEOM class, instance and
  provider names.
  
  - Characters in range 0x01-0x1f except '\t', '\n', and '\r' are replaced
    with '?'. Those characters are disallowed in XML.
  - '&', '<', '>', '\'', '"' and characters in range 0x7f-0xff are
    replaced with XML numeric character reference.
  
  If the kern.geom.confxml sysctl provides invalid XML, libgeom
  geom_xml2tree() fails and utilities using it do not work. Unsafe
  characters are common in msdosfs and cd9660 labels.
  
  PR:		kern/104389

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

Modified: stable/8/sys/geom/geom_dump.c
==============================================================================
--- stable/8/sys/geom/geom_dump.c	Sat Apr 10 13:54:00 2010	(r206457)
+++ stable/8/sys/geom/geom_dump.c	Sat Apr 10 14:28:58 2010	(r206458)
@@ -154,6 +154,28 @@ g_conftxt(void *p, int flag)
 
 
 static void
+g_conf_print_escaped(struct sbuf *sb, const char *fmt, const char *str)
+{
+	struct sbuf *s;
+	const u_char *c;
+
+	s = sbuf_new_auto();
+
+	for (c = str; *c != '\0'; c++) {
+		if (*c == '&' || *c == '<' || *c == '>' ||
+		    *c == '\'' || *c == '"' || *c > 0x7e)
+			sbuf_printf(s, "&#x%X;", *c);
+		else if (*c == '\t' || *c == '\n' || *c == '\r' || *c > 0x1f)
+			sbuf_putc(s, *c);
+		else
+			sbuf_putc(s, '?');
+	}
+	sbuf_finish(s);
+	sbuf_printf(sb, fmt, sbuf_data(s));
+	sbuf_delete(s);
+}
+
+static void
 g_conf_consumer(struct sbuf *sb, struct g_consumer *cp)
 {
 
@@ -181,7 +203,7 @@ g_conf_provider(struct sbuf *sb, struct 
 	sbuf_printf(sb, "\t  \n", pp->geom);
 	sbuf_printf(sb, "\t  r%dw%de%d\n",
 	    pp->acr, pp->acw, pp->ace);
-	sbuf_printf(sb, "\t  %s\n", pp->name);
+	g_conf_print_escaped(sb, "\t  %s\n", pp->name);
 	sbuf_printf(sb, "\t  %jd\n",
 	    (intmax_t)pp->mediasize);
 	sbuf_printf(sb, "\t  %u\n", pp->sectorsize);
@@ -204,7 +226,7 @@ g_conf_geom(struct sbuf *sb, struct g_ge
 
 	sbuf_printf(sb, "    \n", gp);
 	sbuf_printf(sb, "      \n", gp->class);
-	sbuf_printf(sb, "      %s\n", gp->name);
+	g_conf_print_escaped(sb, "      %s\n", gp->name);
 	sbuf_printf(sb, "      %d\n", gp->rank);
 	if (gp->flags & G_GEOM_WITHER)
 		sbuf_printf(sb, "      \n");
@@ -233,7 +255,7 @@ g_conf_class(struct sbuf *sb, struct g_c
 	struct g_geom *gp2;
 
 	sbuf_printf(sb, "  \n", mp);
-	sbuf_printf(sb, "    %s\n", mp->name);
+	g_conf_print_escaped(sb, "    %s\n", mp->name);
 	LIST_FOREACH(gp2, &mp->geom, geom) {
 		if (gp != NULL && gp != gp2)
 			continue;