From owner-svn-src-all@FreeBSD.ORG Sun Jul 21 03:51:25 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2E7535C3; Sun, 21 Jul 2013 03:51:25 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1FA66A8; Sun, 21 Jul 2013 03:51:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6L3pO0a056825; Sun, 21 Jul 2013 03:51:24 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6L3pOQv056824; Sun, 21 Jul 2013 03:51:24 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201307210351.r6L3pOQv056824@svn.freebsd.org> From: Adrian Chadd Date: Sun, 21 Jul 2013 03:51:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253507 - head/sys/mips/atheros X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Jul 2013 03:51:25 -0000 Author: adrian Date: Sun Jul 21 03:51:24 2013 New Revision: 253507 URL: http://svnweb.freebsd.org/changeset/base/253507 Log: Add two new CPU specific definitions - the watchdog clock frequency and the UART clock frequency. The AR933x and AR934x have separate PLL settings for these. Modified: head/sys/mips/atheros/ar71xx_cpudef.h Modified: head/sys/mips/atheros/ar71xx_cpudef.h ============================================================================== --- head/sys/mips/atheros/ar71xx_cpudef.h Sat Jul 20 22:35:32 2013 (r253506) +++ head/sys/mips/atheros/ar71xx_cpudef.h Sun Jul 21 03:51:24 2013 (r253507) @@ -121,10 +121,14 @@ extern uint32_t u_ar71xx_refclk; extern uint32_t u_ar71xx_cpu_freq; extern uint32_t u_ar71xx_ahb_freq; extern uint32_t u_ar71xx_ddr_freq; +extern uint32_t u_ar71xx_uart_freq; +extern uint32_t u_ar71xx_wdt_freq; static inline uint64_t ar71xx_refclk(void) { return u_ar71xx_refclk; } static inline uint64_t ar71xx_cpu_freq(void) { return u_ar71xx_cpu_freq; } static inline uint64_t ar71xx_ahb_freq(void) { return u_ar71xx_ahb_freq; } static inline uint64_t ar71xx_ddr_freq(void) { return u_ar71xx_ddr_freq; } - +static inline uint64_t ar71xx_uart_freq(void) { return u_ar71xx_uart_freq; } +static inline uint64_t ar71xx_wdt_freq(void) { return u_ar71xx_wdt_freq; } + #endif From owner-svn-src-all@FreeBSD.ORG Sun Jul 21 03:52:53 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3F218735; Sun, 21 Jul 2013 03:52:53 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 21268D3; Sun, 21 Jul 2013 03:52:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6L3qrRJ057023; Sun, 21 Jul 2013 03:52:53 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6L3qqRS057016; Sun, 21 Jul 2013 03:52:52 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201307210352.r6L3qqRS057016@svn.freebsd.org> From: Adrian Chadd Date: Sun, 21 Jul 2013 03:52:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253508 - head/sys/mips/atheros X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Jul 2013 03:52:53 -0000 Author: adrian Date: Sun Jul 21 03:52:52 2013 New Revision: 253508 URL: http://svnweb.freebsd.org/changeset/base/253508 Log: Initialise the watchdog and UART frequencies. For all pre-AR933x chips, the frequency is just the APB frequency. For the AR933x, the UART frequency is different but we just hacked around it. For the AR934x, there's a different PLL setting for these, so they have to be broken out. Modified: head/sys/mips/atheros/ar71xx_chip.c head/sys/mips/atheros/ar724x_chip.c head/sys/mips/atheros/ar91xx_chip.c head/sys/mips/atheros/ar933x_chip.c Modified: head/sys/mips/atheros/ar71xx_chip.c ============================================================================== --- head/sys/mips/atheros/ar71xx_chip.c Sun Jul 21 03:51:24 2013 (r253507) +++ head/sys/mips/atheros/ar71xx_chip.c Sun Jul 21 03:52:52 2013 (r253508) @@ -78,6 +78,8 @@ __FBSDID("$FreeBSD$"); uint32_t u_ar71xx_cpu_freq; uint32_t u_ar71xx_ahb_freq; uint32_t u_ar71xx_ddr_freq; +uint32_t u_ar71xx_uart_freq; +uint32_t u_ar71xx_wdt_freq; uint32_t u_ar71xx_refclk; static void @@ -107,6 +109,8 @@ ar71xx_chip_detect_sys_frequency(void) div = (((pll >> AR71XX_AHB_DIV_SHIFT) & AR71XX_AHB_DIV_MASK) + 1) * 2; u_ar71xx_ahb_freq = u_ar71xx_cpu_freq / div; + u_ar71xx_wdt_freq = u_ar71xx_cpu_freq / div; + u_ar71xx_uart_freq = u_ar71xx_cpu_freq / div; } /* Modified: head/sys/mips/atheros/ar724x_chip.c ============================================================================== --- head/sys/mips/atheros/ar724x_chip.c Sun Jul 21 03:51:24 2013 (r253507) +++ head/sys/mips/atheros/ar724x_chip.c Sun Jul 21 03:52:52 2013 (r253508) @@ -90,6 +90,8 @@ ar724x_chip_detect_sys_frequency(void) div = (((pll >> AR724X_AHB_DIV_SHIFT) & AR724X_AHB_DIV_MASK) + 1) * 2; u_ar71xx_ahb_freq = u_ar71xx_cpu_freq / div; + u_ar71xx_wdt_freq = u_ar71xx_cpu_freq / div; + u_ar71xx_uart_freq = u_ar71xx_cpu_freq / div; } static void Modified: head/sys/mips/atheros/ar91xx_chip.c ============================================================================== --- head/sys/mips/atheros/ar91xx_chip.c Sun Jul 21 03:51:24 2013 (r253507) +++ head/sys/mips/atheros/ar91xx_chip.c Sun Jul 21 03:52:52 2013 (r253508) @@ -84,6 +84,8 @@ ar91xx_chip_detect_sys_frequency(void) div = (((pll >> AR91XX_AHB_DIV_SHIFT) & AR91XX_AHB_DIV_MASK) + 1) * 2; u_ar71xx_ahb_freq = u_ar71xx_cpu_freq / div; + u_ar71xx_uart_freq = u_ar71xx_cpu_freq / div; + u_ar71xx_wdt_freq = u_ar71xx_cpu_freq / div; } static void Modified: head/sys/mips/atheros/ar933x_chip.c ============================================================================== --- head/sys/mips/atheros/ar933x_chip.c Sun Jul 21 03:51:24 2013 (r253507) +++ head/sys/mips/atheros/ar933x_chip.c Sun Jul 21 03:52:52 2013 (r253508) @@ -114,6 +114,10 @@ ar933x_chip_detect_sys_frequency(void) AR933X_PLL_CLOCK_CTRL_AHB_DIV_MASK) + 1; u_ar71xx_ahb_freq = freq / t; } + + /* XXX uart should be the refclk, no? */ + u_ar71xx_uart_freq = u_ar71xx_ahb_freq; + u_ar71xx_wdt_freq = u_ar71xx_ahb_freq; } static void From owner-svn-src-all@FreeBSD.ORG Sun Jul 21 03:54:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 32A92875; Sun, 21 Jul 2013 03:54:41 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0A44DDC; Sun, 21 Jul 2013 03:54:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6L3seIY057259; Sun, 21 Jul 2013 03:54:40 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6L3sesJ057255; Sun, 21 Jul 2013 03:54:40 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201307210354.r6L3sesJ057255@svn.freebsd.org> From: Adrian Chadd Date: Sun, 21 Jul 2013 03:54:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253509 - head/sys/mips/atheros X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Jul 2013 03:54:41 -0000 Author: adrian Date: Sun Jul 21 03:54:39 2013 New Revision: 253509 URL: http://svnweb.freebsd.org/changeset/base/253509 Log: Use the UART frequency when programming the UART clock. This allows the 16550 support to work correctly on the upcoming AR934x support. Modified: head/sys/mips/atheros/uart_bus_ar71xx.c head/sys/mips/atheros/uart_bus_ar933x.c head/sys/mips/atheros/uart_cpu_ar71xx.c head/sys/mips/atheros/uart_cpu_ar933x.c Modified: head/sys/mips/atheros/uart_bus_ar71xx.c ============================================================================== --- head/sys/mips/atheros/uart_bus_ar71xx.c Sun Jul 21 03:52:52 2013 (r253508) +++ head/sys/mips/atheros/uart_bus_ar71xx.c Sun Jul 21 03:54:39 2013 (r253509) @@ -70,7 +70,7 @@ uart_ar71xx_probe(device_t dev) struct uart_softc *sc; uint64_t freq; - freq = ar71xx_ahb_freq(); + freq = ar71xx_uart_freq(); sc = device_get_softc(dev); sc->sc_sysdev = SLIST_FIRST(&uart_sysdevs); Modified: head/sys/mips/atheros/uart_bus_ar933x.c ============================================================================== --- head/sys/mips/atheros/uart_bus_ar933x.c Sun Jul 21 03:52:52 2013 (r253508) +++ head/sys/mips/atheros/uart_bus_ar933x.c Sun Jul 21 03:54:39 2013 (r253509) @@ -72,7 +72,7 @@ uart_ar933x_probe(device_t dev) struct uart_softc *sc; uint64_t freq; - freq = ar71xx_refclk(); + freq = ar71xx_uart_freq(); sc = device_get_softc(dev); sc->sc_sysdev = SLIST_FIRST(&uart_sysdevs); Modified: head/sys/mips/atheros/uart_cpu_ar71xx.c ============================================================================== --- head/sys/mips/atheros/uart_cpu_ar71xx.c Sun Jul 21 03:52:52 2013 (r253508) +++ head/sys/mips/atheros/uart_cpu_ar71xx.c Sun Jul 21 03:54:39 2013 (r253509) @@ -56,7 +56,7 @@ uart_cpu_getdev(int devtype, struct uart { uint64_t freq; - freq = ar71xx_ahb_freq(); + freq = ar71xx_uart_freq(); di->ops = uart_getops(&uart_ns8250_class); di->bas.chan = 0; Modified: head/sys/mips/atheros/uart_cpu_ar933x.c ============================================================================== --- head/sys/mips/atheros/uart_cpu_ar933x.c Sun Jul 21 03:52:52 2013 (r253508) +++ head/sys/mips/atheros/uart_cpu_ar933x.c Sun Jul 21 03:54:39 2013 (r253509) @@ -58,7 +58,7 @@ uart_cpu_getdev(int devtype, struct uart { uint64_t freq; - freq = ar71xx_refclk(); + freq = ar71xx_uart_freq(); di->ops = uart_getops(&uart_ar933x_class); di->bas.chan = 0; From owner-svn-src-all@FreeBSD.ORG Sun Jul 21 03:55:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3C2799B1; Sun, 21 Jul 2013 03:55:19 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2E869E6; Sun, 21 Jul 2013 03:55:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6L3tJNO057438; Sun, 21 Jul 2013 03:55:19 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6L3tJZS057437; Sun, 21 Jul 2013 03:55:19 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201307210355.r6L3tJZS057437@svn.freebsd.org> From: Adrian Chadd Date: Sun, 21 Jul 2013 03:55:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253510 - head/sys/mips/atheros X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Jul 2013 03:55:19 -0000 Author: adrian Date: Sun Jul 21 03:55:18 2013 New Revision: 253510 URL: http://svnweb.freebsd.org/changeset/base/253510 Log: Teach the GPIO code about the AR934x GPIO register and pin counts. Modified: head/sys/mips/atheros/ar71xx_gpio.c Modified: head/sys/mips/atheros/ar71xx_gpio.c ============================================================================== --- head/sys/mips/atheros/ar71xx_gpio.c Sun Jul 21 03:54:39 2013 (r253509) +++ head/sys/mips/atheros/ar71xx_gpio.c Sun Jul 21 03:55:18 2013 (r253510) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "gpio_if.h" @@ -90,13 +91,23 @@ static int ar71xx_gpio_pin_toggle(device static void ar71xx_gpio_function_enable(struct ar71xx_gpio_softc *sc, uint32_t mask) { - GPIO_SET_BITS(sc, AR71XX_GPIO_FUNCTION, mask); + if (ar71xx_soc == AR71XX_SOC_AR9341 || + ar71xx_soc == AR71XX_SOC_AR9342 || + ar71xx_soc == AR71XX_SOC_AR9344) + GPIO_SET_BITS(sc, AR934X_GPIO_REG_FUNC, mask); + else + GPIO_SET_BITS(sc, AR71XX_GPIO_FUNCTION, mask); } static void ar71xx_gpio_function_disable(struct ar71xx_gpio_softc *sc, uint32_t mask) { - GPIO_CLEAR_BITS(sc, AR71XX_GPIO_FUNCTION, mask); + if (ar71xx_soc == AR71XX_SOC_AR9341 || + ar71xx_soc == AR71XX_SOC_AR9342 || + ar71xx_soc == AR71XX_SOC_AR9344) + GPIO_CLEAR_BITS(sc, AR934X_GPIO_REG_FUNC, mask); + else + GPIO_CLEAR_BITS(sc, AR71XX_GPIO_FUNCTION, mask); } static void @@ -141,6 +152,10 @@ ar71xx_gpio_pin_max(device_t dev, int *m case AR71XX_SOC_AR9331: *maxpin = AR933X_GPIO_COUNT - 1; break; + case AR71XX_SOC_AR9341: + case AR71XX_SOC_AR9342: + case AR71XX_SOC_AR9344: + *maxpin = AR934X_GPIO_COUNT - 1; default: *maxpin = AR71XX_GPIO_PINS - 1; } From owner-svn-src-all@FreeBSD.ORG Sun Jul 21 03:56:58 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 35A33AF4; Sun, 21 Jul 2013 03:56:58 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 267DAEF; Sun, 21 Jul 2013 03:56:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6L3uwkI057652; Sun, 21 Jul 2013 03:56:58 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6L3uvS2057648; Sun, 21 Jul 2013 03:56:57 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201307210356.r6L3uvS2057648@svn.freebsd.org> From: Adrian Chadd Date: Sun, 21 Jul 2013 03:56:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253511 - head/sys/mips/atheros X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Jul 2013 03:56:58 -0000 Author: adrian Date: Sun Jul 21 03:56:57 2013 New Revision: 253511 URL: http://svnweb.freebsd.org/changeset/base/253511 Log: Implement some initial AR934x support routines. This code reads the PLL configuration registers and correctly programs things so the UART and such can come up. There's MIPS74k platform issues that need fixing; but this at least brings things up enough to echo stuff out the serial port and allow for interactive debugging with ddb. Tested: * AR71xx SoCs * AR933x SoC * AR9344 board (DB120) Obtained from: Qualcomm Atheros; Linux/OpenWRT Added: head/sys/mips/atheros/ar934x_chip.c (contents, props changed) head/sys/mips/atheros/ar934x_chip.h (contents, props changed) Modified: head/sys/mips/atheros/ar71xx_setup.c head/sys/mips/atheros/files.ar71xx Modified: head/sys/mips/atheros/ar71xx_setup.c ============================================================================== --- head/sys/mips/atheros/ar71xx_setup.c Sun Jul 21 03:55:18 2013 (r253510) +++ head/sys/mips/atheros/ar71xx_setup.c Sun Jul 21 03:56:57 2013 (r253511) @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include @@ -62,6 +63,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #define AR71XX_SYS_TYPE_LEN 128 @@ -158,6 +160,30 @@ ar71xx_detect_sys_type(void) ar71xx_cpu_ops = &ar933x_chip_def; break; + case REV_ID_MAJOR_AR9341: + minor = 0; + rev = (id & AR934X_REV_ID_REVISION_MASK); + chip = "9341"; + ar71xx_soc = AR71XX_SOC_AR9341; + ar71xx_cpu_ops = &ar934x_chip_def; + break; + + case REV_ID_MAJOR_AR9342: + minor = 0; + rev = (id & AR934X_REV_ID_REVISION_MASK); + chip = "9342"; + ar71xx_soc = AR71XX_SOC_AR9342; + ar71xx_cpu_ops = &ar934x_chip_def; + break; + + case REV_ID_MAJOR_AR9344: + minor = 0; + rev = (id & AR934X_REV_ID_REVISION_MASK); + chip = "9344"; + ar71xx_soc = AR71XX_SOC_AR9344; + ar71xx_cpu_ops = &ar934x_chip_def; + break; + default: panic("ar71xx: unknown chip id:0x%08x\n", id); } Added: head/sys/mips/atheros/ar934x_chip.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/atheros/ar934x_chip.c Sun Jul 21 03:56:57 2013 (r253511) @@ -0,0 +1,333 @@ +/*- + * Copyright (c) 2013 Adrian Chadd + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_ddb.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include +#include + +static void +ar934x_chip_detect_mem_size(void) +{ +} + +static uint32_t +ar934x_get_pll_freq(uint32_t ref, uint32_t ref_div, uint32_t nint, + uint32_t nfrac, uint32_t frac, uint32_t out_div) +{ + uint64_t t; + uint32_t ret; + + t = u_ar71xx_refclk; + t *= nint; + t = t / ref_div; + ret = t; + + t = u_ar71xx_refclk; + t *= nfrac; + t = t / (ref_div * frac); + ret += t; + + ret /= (1 << out_div); + return (ret); +} + +static void +ar934x_chip_detect_sys_frequency(void) +{ + uint32_t pll, out_div, ref_div, nint, nfrac, frac, clk_ctrl, postdiv; + uint32_t cpu_pll, ddr_pll; + uint32_t bootstrap; + + bootstrap = ATH_READ_REG(AR934X_RESET_REG_BOOTSTRAP); + if (bootstrap & AR934X_BOOTSTRAP_REF_CLK_40) + u_ar71xx_refclk = 40 * 1000 * 1000; + else + u_ar71xx_refclk = 25 * 1000 * 1000; + + pll = ATH_READ_REG(AR934X_SRIF_CPU_DPLL2_REG); + if (pll & AR934X_SRIF_DPLL2_LOCAL_PLL) { + out_div = (pll >> AR934X_SRIF_DPLL2_OUTDIV_SHIFT) & + AR934X_SRIF_DPLL2_OUTDIV_MASK; + pll = ATH_READ_REG(AR934X_SRIF_CPU_DPLL1_REG); + nint = (pll >> AR934X_SRIF_DPLL1_NINT_SHIFT) & + AR934X_SRIF_DPLL1_NINT_MASK; + nfrac = pll & AR934X_SRIF_DPLL1_NFRAC_MASK; + ref_div = (pll >> AR934X_SRIF_DPLL1_REFDIV_SHIFT) & + AR934X_SRIF_DPLL1_REFDIV_MASK; + frac = 1 << 18; + } else { + pll = ATH_READ_REG(AR934X_PLL_CPU_CONFIG_REG); + out_div = (pll >> AR934X_PLL_CPU_CONFIG_OUTDIV_SHIFT) & + AR934X_PLL_CPU_CONFIG_OUTDIV_MASK; + ref_div = (pll >> AR934X_PLL_CPU_CONFIG_REFDIV_SHIFT) & + AR934X_PLL_CPU_CONFIG_REFDIV_MASK; + nint = (pll >> AR934X_PLL_CPU_CONFIG_NINT_SHIFT) & + AR934X_PLL_CPU_CONFIG_NINT_MASK; + nfrac = (pll >> AR934X_PLL_CPU_CONFIG_NFRAC_SHIFT) & + AR934X_PLL_CPU_CONFIG_NFRAC_MASK; + frac = 1 << 6; + } + + cpu_pll = ar934x_get_pll_freq(u_ar71xx_refclk, ref_div, nint, + nfrac, frac, out_div); + + pll = ATH_READ_REG(AR934X_SRIF_DDR_DPLL2_REG); + if (pll & AR934X_SRIF_DPLL2_LOCAL_PLL) { + out_div = (pll >> AR934X_SRIF_DPLL2_OUTDIV_SHIFT) & + AR934X_SRIF_DPLL2_OUTDIV_MASK; + pll = ATH_READ_REG(AR934X_SRIF_DDR_DPLL1_REG); + nint = (pll >> AR934X_SRIF_DPLL1_NINT_SHIFT) & + AR934X_SRIF_DPLL1_NINT_MASK; + nfrac = pll & AR934X_SRIF_DPLL1_NFRAC_MASK; + ref_div = (pll >> AR934X_SRIF_DPLL1_REFDIV_SHIFT) & + AR934X_SRIF_DPLL1_REFDIV_MASK; + frac = 1 << 18; + } else { + pll = ATH_READ_REG(AR934X_PLL_DDR_CONFIG_REG); + out_div = (pll >> AR934X_PLL_DDR_CONFIG_OUTDIV_SHIFT) & + AR934X_PLL_DDR_CONFIG_OUTDIV_MASK; + ref_div = (pll >> AR934X_PLL_DDR_CONFIG_REFDIV_SHIFT) & + AR934X_PLL_DDR_CONFIG_REFDIV_MASK; + nint = (pll >> AR934X_PLL_DDR_CONFIG_NINT_SHIFT) & + AR934X_PLL_DDR_CONFIG_NINT_MASK; + nfrac = (pll >> AR934X_PLL_DDR_CONFIG_NFRAC_SHIFT) & + AR934X_PLL_DDR_CONFIG_NFRAC_MASK; + frac = 1 << 10; + } + + ddr_pll = ar934x_get_pll_freq(u_ar71xx_refclk, ref_div, nint, + nfrac, frac, out_div); + + clk_ctrl = ATH_READ_REG(AR934X_PLL_CPU_DDR_CLK_CTRL_REG); + + postdiv = (clk_ctrl >> AR934X_PLL_CPU_DDR_CLK_CTRL_CPU_POST_DIV_SHIFT) & + AR934X_PLL_CPU_DDR_CLK_CTRL_CPU_POST_DIV_MASK; + + if (clk_ctrl & AR934X_PLL_CPU_DDR_CLK_CTRL_CPU_PLL_BYPASS) + u_ar71xx_cpu_freq = u_ar71xx_refclk; + else if (clk_ctrl & AR934X_PLL_CPU_DDR_CLK_CTRL_CPUCLK_FROM_CPUPLL) + u_ar71xx_cpu_freq = cpu_pll / (postdiv + 1); + else + u_ar71xx_cpu_freq = ddr_pll / (postdiv + 1); + + postdiv = (clk_ctrl >> AR934X_PLL_CPU_DDR_CLK_CTRL_DDR_POST_DIV_SHIFT) & + AR934X_PLL_CPU_DDR_CLK_CTRL_DDR_POST_DIV_MASK; + + if (clk_ctrl & AR934X_PLL_CPU_DDR_CLK_CTRL_DDR_PLL_BYPASS) + u_ar71xx_ddr_freq = u_ar71xx_refclk; + else if (clk_ctrl & AR934X_PLL_CPU_DDR_CLK_CTRL_DDRCLK_FROM_DDRPLL) + u_ar71xx_ddr_freq = ddr_pll / (postdiv + 1); + else + u_ar71xx_ddr_freq = cpu_pll / (postdiv + 1); + + postdiv = (clk_ctrl >> AR934X_PLL_CPU_DDR_CLK_CTRL_AHB_POST_DIV_SHIFT) & + AR934X_PLL_CPU_DDR_CLK_CTRL_AHB_POST_DIV_MASK; + + if (clk_ctrl & AR934X_PLL_CPU_DDR_CLK_CTRL_AHB_PLL_BYPASS) + u_ar71xx_ahb_freq = u_ar71xx_refclk; + else if (clk_ctrl & AR934X_PLL_CPU_DDR_CLK_CTRL_AHBCLK_FROM_DDRPLL) + u_ar71xx_ahb_freq = ddr_pll / (postdiv + 1); + else + u_ar71xx_ahb_freq = cpu_pll / (postdiv + 1); + + u_ar71xx_wdt_freq = u_ar71xx_refclk; + u_ar71xx_uart_freq = u_ar71xx_refclk; +} + +static void +ar934x_chip_device_stop(uint32_t mask) +{ + uint32_t reg; + + reg = ATH_READ_REG(AR934X_RESET_REG_RESET_MODULE); + ATH_WRITE_REG(AR934X_RESET_REG_RESET_MODULE, reg | mask); +} + +static void +ar934x_chip_device_start(uint32_t mask) +{ + uint32_t reg; + + reg = ATH_READ_REG(AR934X_RESET_REG_RESET_MODULE); + ATH_WRITE_REG(AR934X_RESET_REG_RESET_MODULE, reg & ~mask); +} + +static int +ar934x_chip_device_stopped(uint32_t mask) +{ + uint32_t reg; + + reg = ATH_READ_REG(AR934X_RESET_REG_RESET_MODULE); + return ((reg & mask) == mask); +} + +static void +ar934x_chip_set_mii_speed(uint32_t unit, uint32_t speed) +{ + + /* XXX TODO */ + return; +} + +/* + * XXX TODO !! + */ +static void +ar934x_chip_set_pll_ge(int unit, int speed, uint32_t pll) +{ + + switch (unit) { + case 0: + /* XXX TODO */ + break; + case 1: + /* XXX TODO */ + break; + default: + printf("%s: invalid PLL set for arge unit: %d\n", + __func__, unit); + return; + } +} + +static void +ar934x_chip_ddr_flush_ge(int unit) +{ + + switch (unit) { + case 0: + ar71xx_ddr_flush(AR934X_DDR_REG_FLUSH_GE0); + break; + case 1: + ar71xx_ddr_flush(AR934X_DDR_REG_FLUSH_GE1); + break; + default: + printf("%s: invalid DDR flush for arge unit: %d\n", + __func__, unit); + return; + } +} + +static void +ar934x_chip_ddr_flush_ip2(void) +{ + + ar71xx_ddr_flush(AR934X_DDR_REG_FLUSH_WMAC); +} + +static uint32_t +ar934x_chip_get_eth_pll(unsigned int mac, int speed) +{ +#if 0 + uint32_t pll; + + switch (speed) { + case 10: + pll = AR933X_PLL_VAL_10; + break; + case 100: + pll = AR933X_PLL_VAL_100; + break; + case 1000: + pll = AR933X_PLL_VAL_1000; + break; + default: + printf("%s%d: invalid speed %d\n", __func__, mac, speed); + pll = 0; + } + return (pll); +#endif + return (0); +} + +static void +ar934x_chip_init_usb_peripheral(void) +{ + uint32_t reg; + + reg = ATH_READ_REG(AR934X_RESET_REG_BOOTSTRAP); + if (reg & AR934X_BOOTSTRAP_USB_MODE_DEVICE) + return; + + ar71xx_device_stop(AR934X_RESET_USBSUS_OVERRIDE); + DELAY(100); + + ar71xx_device_start(AR934X_RESET_USB_PHY); + DELAY(100); + + ar71xx_device_start(AR934X_RESET_USB_PHY_ANALOG); + DELAY(100); + + ar71xx_device_start(AR934X_RESET_USB_HOST); + DELAY(100); +} + +struct ar71xx_cpu_def ar934x_chip_def = { + &ar934x_chip_detect_mem_size, + &ar934x_chip_detect_sys_frequency, + &ar934x_chip_device_stop, + &ar934x_chip_device_start, + &ar934x_chip_device_stopped, + &ar934x_chip_set_pll_ge, + &ar934x_chip_set_mii_speed, + &ar71xx_chip_set_mii_if, + &ar934x_chip_ddr_flush_ge, + &ar934x_chip_get_eth_pll, + &ar934x_chip_ddr_flush_ip2, + &ar934x_chip_init_usb_peripheral +}; Added: head/sys/mips/atheros/ar934x_chip.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/atheros/ar934x_chip.h Sun Jul 21 03:56:57 2013 (r253511) @@ -0,0 +1,34 @@ +/*- + * Copyright (c) 2013 Adrian Chadd + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* $FreeBSD$ */ + +#ifndef __AR934X_CHIP_H__ +#define __AR934X_CHIP_H__ + +extern struct ar71xx_cpu_def ar934x_chip_def; + +#endif Modified: head/sys/mips/atheros/files.ar71xx ============================================================================== --- head/sys/mips/atheros/files.ar71xx Sun Jul 21 03:55:18 2013 (r253510) +++ head/sys/mips/atheros/files.ar71xx Sun Jul 21 03:56:57 2013 (r253511) @@ -25,6 +25,7 @@ mips/atheros/ar71xx_chip.c standard mips/atheros/ar724x_chip.c standard mips/atheros/ar91xx_chip.c standard mips/atheros/ar933x_chip.c standard +mips/atheros/ar934x_chip.c standard mips/atheros/ar71xx_fixup.c optional ar71xx_ath_eeprom dev/hwpmc/hwpmc_mips24k.c optional hwpmc_mips24k From owner-svn-src-all@FreeBSD.ORG Sun Jul 21 04:00:49 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D1C12C4B; Sun, 21 Jul 2013 04:00:49 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B2F85106; Sun, 21 Jul 2013 04:00:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6L40n8o059820; Sun, 21 Jul 2013 04:00:49 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6L40mXC059815; Sun, 21 Jul 2013 04:00:48 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201307210400.r6L40mXC059815@svn.freebsd.org> From: Adrian Chadd Date: Sun, 21 Jul 2013 04:00:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253512 - head/sys/mips/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Jul 2013 04:00:49 -0000 Author: adrian Date: Sun Jul 21 04:00:48 2013 New Revision: 253512 URL: http://svnweb.freebsd.org/changeset/base/253512 Log: Add some initial board support for the AR934x and the Qualcomm Atheros DB120 development board. The AR934x SoCs are a MIPS74k based system with increased RAM addressing space, some scratch-pad RAM, an improved gige switch PHY and 2x2 or 3x3 on-board dual-band wifi. This support isn't complete by any stretch; it's just enough to bring the board up for others to tinker with. Notably, the MIPS74k support is broken. However it boots enough to echo some basic probe/attach messages, before dying somewhere in the TLB code. Thankyou to Qualcomm Atheros for their continued support of me doing open source work with their hardware. Tested: * AR9344, mips74k Added: head/sys/mips/conf/AR934X_BASE (contents, props changed) head/sys/mips/conf/AR934X_BASE.hints (contents, props changed) head/sys/mips/conf/DB120 (contents, props changed) head/sys/mips/conf/DB120.hints (contents, props changed) Added: head/sys/mips/conf/AR934X_BASE ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/AR934X_BASE Sun Jul 21 04:00:48 2013 (r253512) @@ -0,0 +1,124 @@ +# +# AR91XX -- Kernel configuration base file for the Atheros AR913x SoC. +# +# This file (and the hints file accompanying it) are not designed to be +# used by themselves. Instead, users of this file should create a kernel +# config file which includes this file (which gets the basic hints), then +# override the default options (adding devices as needed) and adding +# hints as needed (for example, the GPIO and LAN PHY.) +# +# $FreeBSD$ +# + +machine mips mips +ident AR934X_BASE +cpu CPU_MIPS4KC +makeoptions KERNLOADADDR=0x80050000 +options HZ=1000 + +files "../atheros/files.ar71xx" +hints "AR934X_BASE.hints" + +makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols +# makeoptions MODULES_OVERRIDE="random gpio ar71xx if_gif if_gre if_bridge bridgestp usb wlan wlan_xauth wlan_acl wlan_wep wlan_tkip wlan_ccmp wlan_rssadapt wlan_amrr ath ath_ahb hwpmc" +makeoptions MODULES_OVERRIDE="" + +options DDB +options KDB +options ALQ + +options SCHED_4BSD #4BSD scheduler +options INET #InterNETworking +#options INET6 #InterNETworking +#options NFSCL #Network Filesystem Client +options PSEUDOFS #Pseudo-filesystem framework +options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions + +# Don't include the SCSI/CAM strings in the default build +options SCSI_NO_SENSE_STRINGS +options SCSI_NO_OP_STRINGS + +# .. And no sysctl strings +options NO_SYSCTL_DESCR + +# Limit IO size +options NBUF=128 + +# Limit UMTX hash size +# options UMTX_NUM_CHAINS=64 + +# PMC +#options HWPMC_HOOKS +#device hwpmc +#device hwpmc_mips24k + +# options NFS_LEGACYRPC +# Debugging for use in -current +#options INVARIANTS +#options INVARIANT_SUPPORT +#options WITNESS +#options WITNESS_SKIPSPIN +options FFS #Berkeley Fast Filesystem +#options SOFTUPDATES #Enable FFS soft updates support +#options UFS_ACL #Support for access control lists +#options UFS_DIRHASH #Improve performance on big directories +options NO_FFS_SNAPSHOT # We don't require snapshot support + +# Wireless NIC cards +options IEEE80211_DEBUG +options IEEE80211_SUPPORT_MESH +options IEEE80211_SUPPORT_TDMA +options IEEE80211_SUPPORT_SUPERG +options IEEE80211_ALQ # 802.11 ALQ logging support +device wlan # 802.11 support +device wlan_wep # 802.11 WEP support +device wlan_ccmp # 802.11 CCMP support +device wlan_tkip # 802.11 TKIP support +device wlan_xauth # 802.11 hostap support + +# ath(4) +device ath # Atheros network device +device ath_rate_sample +device ath_ahb # Atheros host bus glue +options ATH_DEBUG +options ATH_DIAGAPI +option ATH_ENABLE_11N +option AH_DEBUG_ALQ + +#device ath_hal +device ath_ar9300 # AR9330 HAL; no need for the others +option AH_DEBUG +option AH_SUPPORT_AR5416 # 11n HAL support +option AH_SUPPORT_AR9340 # Chipset support +option AH_DEBUG_ALQ +option AH_AR5416_INTERRUPT_MITIGATION + +device mii +device arge + +device usb +options USB_EHCI_BIG_ENDIAN_DESC # handle big-endian byte order +options USB_DEBUG +options USB_HOST_ALIGN=32 # AR71XX (MIPS in general?) requires this +device ehci + +device scbus +device umass +device da + +device spibus +device ar71xx_spi +device mx25l +device ar71xx_wdog + +device uart +device uart_ar71xx + +device loop +device ether +device md +device bpf +device random +device if_bridge +device gpio +device gpioled Added: head/sys/mips/conf/AR934X_BASE.hints ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/AR934X_BASE.hints Sun Jul 21 04:00:48 2013 (r253512) @@ -0,0 +1,61 @@ +# This file (and the kernel config file accompanying it) are not designed +# to be used by themselves. Instead, users of this file should create a +# kernel # config file which includes this file (which gets the basic hints), +# then override the default options (adding devices as needed) and adding +# hints as needed (for example, the GPIO and LAN PHY.) + +# $FreeBSD$ + +hint.apb.0.at="nexus0" +hint.apb.0.irq=4 + +# uart0 +hint.uart.0.at="apb0" +# NB: This isn't an ns8250 UART +hint.uart.0.maddr=0x18020003 +hint.uart.0.msize=0x18 +hint.uart.0.irq=3 + +#ehci - note the 0x100 offset for the AR913x/AR724x +hint.ehci.0.at="nexus0" +hint.ehci.0.maddr=0x1b000100 +hint.ehci.0.msize=0x00001000 +hint.ehci.0.irq=1 + +hint.arge.0.at="nexus0" +hint.arge.0.maddr=0x19000000 +hint.arge.0.msize=0x1000 +hint.arge.0.irq=2 + +hint.arge.1.at="nexus0" +hint.arge.1.maddr=0x1a000000 +hint.arge.1.msize=0x1000 +hint.arge.1.irq=3 + +# XXX The ath device hangs off of the AHB, rather than the Nexus. +hint.ath.0.at="nexus0" +hint.ath.0.maddr=0x18100000 +hint.ath.0.msize=0x20000 +hint.ath.0.irq=0 +hint.ath.0.vendor_id=0x168c +hint.ath.0.device_id=0x0031 +# Set this to define where the ath calibration data +# should be fetched from in physical memory. +# hint.ath.0.eepromaddr=0x1fff1000 + +# SPI flash +hint.spi.0.at="nexus0" +hint.spi.0.maddr=0x1f000000 +hint.spi.0.msize=0x10 + +hint.mx25l.0.at="spibus0" +hint.mx25l.0.cs=0 + +# Watchdog +hint.ar71xx_wdog.0.at="nexus0" + +# The GPIO function and pin mask is configured per-board +hint.gpio.0.at="apb0" +hint.gpio.0.maddr=0x18040000 +hint.gpio.0.msize=0x1000 +hint.gpio.0.irq=2 Added: head/sys/mips/conf/DB120 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/DB120 Sun Jul 21 04:00:48 2013 (r253512) @@ -0,0 +1,46 @@ +# +# DB120 - the AR9344 SoC reference design +# +# $FreeBSD$ +# + +# Include the default AR934x parameters +include "AR934X_BASE" + +ident DB120 + +# Override hints with board values +hints "DB120.hints" + +# Force the board memory - the base DB120 has 128MB RAM +options AR71XX_REALMEM=(32*1024*1024) + +# i2c GPIO bus +#device gpioiic +#device iicbb +#device iicbus +#device iic + +# Options required for miiproxy and mdiobus +options ARGE_MDIO # Export an MDIO bus separate from arge +device miiproxy # MDIO bus <-> MII PHY rendezvous + +device etherswitch +device arswitch + +# read MSDOS formatted disks - USB +#options MSDOSFS + +# Enable the uboot environment stuff rather then the +# redboot stuff. +options AR71XX_ENV_UBOOT + +# uzip - to boot natively from flash +device geom_uncompress +options GEOM_UNCOMPRESS + +# Used for the static uboot partition map +device geom_map + +# Boot off of the rootfs, as defined in the geom_map setup. +options ROOTDEVNAME=\"ufs:map/rootfs.uncompress\" Added: head/sys/mips/conf/DB120.hints ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/DB120.hints Sun Jul 21 04:00:48 2013 (r253512) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +# This is a placeholder until the hardware support is complete. From owner-svn-src-all@FreeBSD.ORG Sun Jul 21 05:23:34 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C6995658; Sun, 21 Jul 2013 05:23:34 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B13FD295; Sun, 21 Jul 2013 05:23:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6L5NYwK084680; Sun, 21 Jul 2013 05:23:34 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6L5NYqh084679; Sun, 21 Jul 2013 05:23:34 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201307210523.r6L5NYqh084679@svn.freebsd.org> From: Glen Barber Date: Sun, 21 Jul 2013 05:23:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253513 - head/release X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Jul 2013 05:23:34 -0000 Author: gjb Date: Sun Jul 21 05:23:34 2013 New Revision: 253513 URL: http://svnweb.freebsd.org/changeset/base/253513 Log: Create memstick images with the '.img' filename extension. Requested by: many Approved by: kib (mentor) MFC after: 3 days X-MFC-To: stable/9 only Modified: head/release/Makefile Modified: head/release/Makefile ============================================================================== --- head/release/Makefile Sun Jul 21 04:00:48 2013 (r253512) +++ head/release/Makefile Sun Jul 21 05:23:34 2013 (r253513) @@ -4,7 +4,7 @@ # # User-driven targets: # cdrom: Builds release CD-ROM media (release.iso) -# memstick: Builds memory stick image (memstick) +# memstick: Builds memory stick image (memstick.img) # ftp: Sets up FTP distribution area (ftp) # release: Build all media and FTP distribution area # install: Copies all release media into ${DESTDIR} @@ -73,8 +73,8 @@ RELEASE_TARGETS+= cdrom IMAGES+= release.iso bootonly.iso .endif .if exists(${.CURDIR}/${TARGET}/make-memstick.sh) -RELEASE_TARGETS+= memstick -IMAGES+= memstick +RELEASE_TARGETS+= memstick.img +IMAGES+= memstick.img .endif .include @@ -167,7 +167,8 @@ release.iso: system bootonly.iso: bootonly sh ${.CURDIR}/${TARGET}/mkisoimages.sh -b FreeBSD_Install ${.TARGET} bootonly -memstick: system +memstick: memstick.img +memstick.img: system sh ${.CURDIR}/${TARGET}/make-memstick.sh release ${.TARGET} packagesystem: base.txz kernel.txz ${EXTRA_PACKAGES} @@ -191,7 +192,7 @@ clean: rm -f *.txz MANIFEST rm -f system rm -rf release bootonly - rm -f release.iso bootonly.iso memstick + rm -f release.iso bootonly.iso memstick.img install: .if defined(DESTDIR) && !empty(DESTDIR) From owner-svn-src-all@FreeBSD.ORG Sun Jul 21 06:59:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 71969723; Sun, 21 Jul 2013 06:59:57 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6567477B; Sun, 21 Jul 2013 06:59:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6L6xvaM012362; Sun, 21 Jul 2013 06:59:57 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6L6xvHX012361; Sun, 21 Jul 2013 06:59:57 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201307210659.r6L6xvHX012361@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Sun, 21 Jul 2013 06:59:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253514 - head/lib/libfetch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Jul 2013 06:59:57 -0000 Author: des Date: Sun Jul 21 06:59:56 2013 New Revision: 253514 URL: http://svnweb.freebsd.org/changeset/base/253514 Log: Use the correct request syntax for proxied (tunneled) HTTPS requests. PR: bin/180666 MFC after: 3 days Modified: head/lib/libfetch/http.c Modified: head/lib/libfetch/http.c ============================================================================== --- head/lib/libfetch/http.c Sun Jul 21 05:23:34 2013 (r253513) +++ head/lib/libfetch/http.c Sun Jul 21 06:59:56 2013 (r253514) @@ -1581,7 +1581,7 @@ http_request(struct url *URL, const char if (verbose) fetch_info("requesting %s://%s%s", url->scheme, host, url->doc); - if (purl) { + if (purl && strcasecmp(URL->scheme, SCHEME_HTTPS) != 0) { http_cmd(conn, "%s %s://%s%s HTTP/1.1", op, url->scheme, host, url->doc); } else { From owner-svn-src-all@FreeBSD.ORG Sun Jul 21 07:24:26 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A5FC4D88; Sun, 21 Jul 2013 07:24:26 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7E0C786C; Sun, 21 Jul 2013 07:24:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6L7OQ7c021119; Sun, 21 Jul 2013 07:24:26 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6L7OQOC021118; Sun, 21 Jul 2013 07:24:26 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201307210724.r6L7OQOC021118@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Sun, 21 Jul 2013 07:24:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253515 - head/usr.bin/fetch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Jul 2013 07:24:26 -0000 Author: des Date: Sun Jul 21 07:24:25 2013 New Revision: 253515 URL: http://svnweb.freebsd.org/changeset/base/253515 Log: mdoc nit Modified: head/usr.bin/fetch/fetch.1 Modified: head/usr.bin/fetch/fetch.1 ============================================================================== --- head/usr.bin/fetch/fetch.1 Sun Jul 21 06:59:56 2013 (r253514) +++ head/usr.bin/fetch/fetch.1 Sun Jul 21 07:24:25 2013 (r253515) @@ -249,7 +249,8 @@ for a description of additional environm .Ev HTTP_REFERER , .Ev HTTP_USER_AGENT , .Ev NETRC , -.Ev NO_PROXY No and +.Ev NO_PROXY +and .Ev no_proxy . .Sh EXIT STATUS The From owner-svn-src-all@FreeBSD.ORG Sun Jul 21 11:59:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 57A59ACA; Sun, 21 Jul 2013 11:59:42 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 394EB6E7; Sun, 21 Jul 2013 11:59:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6LBxfiA001976; Sun, 21 Jul 2013 11:59:41 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6LBxfMd001975; Sun, 21 Jul 2013 11:59:41 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201307211159.r6LBxfMd001975@svn.freebsd.org> From: Hiroki Sato Date: Sun, 21 Jul 2013 11:59:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253517 - head/sbin/route X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Jul 2013 11:59:42 -0000 Author: hrs Date: Sun Jul 21 11:59:41 2013 New Revision: 253517 URL: http://svnweb.freebsd.org/changeset/base/253517 Log: - Fix nflag in routename(). - Display a AF_LINK address in #linkN when sdl_{nlen,alen,slen) == 0 and sdl_index != 0. - Reduce unnecessary loop in pmsg_addrs(). - Remove iso_ntoa(). This is not used. Modified: head/sbin/route/route.c Modified: head/sbin/route/route.c ============================================================================== --- head/sbin/route/route.c Sun Jul 21 10:48:50 2013 (r253516) +++ head/sbin/route/route.c Sun Jul 21 11:59:41 2013 (r253517) @@ -120,7 +120,6 @@ static void set_metric(char *, int); static int set_sofib(int); static void sockaddr(char *, struct sockaddr *, size_t); static void sodump(struct sockaddr *, const char *); -extern char *iso_ntoa(void); struct fibl { TAILQ_ENTRY(fibl) fl_next; @@ -493,6 +492,7 @@ retry: const char * routename(struct sockaddr *sa) { + struct sockaddr_dl *sdl; const char *cp; static char line[MAXHOSTNAMELEN + 1]; #ifdef INET @@ -523,7 +523,7 @@ routename(struct sockaddr *sa) cp = NULL; if (in.s_addr == INADDR_ANY && nflag == 0) return ("default"); - if (nflag != 0) { + if (nflag == 0) { hp = gethostbyaddr((char *)&in, sizeof (struct in_addr), AF_INET); if (hp != NULL) { @@ -574,7 +574,18 @@ routename(struct sockaddr *sa) break; case AF_LINK: - return (link_ntoa((struct sockaddr_dl *)(void *)sa)); + sdl = (struct sockaddr_dl *)(void *)sa; + + if (sdl->sdl_nlen == 0 && + sdl->sdl_alen == 0 && + sdl->sdl_slen == 0) { + n = snprintf(line, sizeof(line), "link#%d", + sdl->sdl_index); + if (n > (int)sizeof(line)) + line[0] = '\0'; + return (line); + } else + return (link_ntoa(sdl)); break; default: @@ -602,6 +613,7 @@ routename(struct sockaddr *sa) const char * netname(struct sockaddr *sa) { + struct sockaddr_dl *sdl; static char line[MAXHOSTNAMELEN + 1]; int n; #ifdef INET @@ -670,7 +682,18 @@ netname(struct sockaddr *sa) break; case AF_LINK: - return (link_ntoa((struct sockaddr_dl *)(void *)sa)); + sdl = (struct sockaddr_dl *)(void *)sa; + + if (sdl->sdl_nlen == 0 && + sdl->sdl_alen == 0 && + sdl->sdl_slen == 0) { + n = snprintf(line, sizeof(line), "link#%d", + sdl->sdl_index); + if (n > (int)sizeof(line)) + line[0] = '\0'; + return (line); + } else + return (link_ntoa(sdl)); break; default: @@ -1560,7 +1583,7 @@ print_rtmsg(struct rt_msghdr *rtm, size_ rtm->rtm_version); return; } - if (rtm->rtm_type < sizeof(msgtypes) / sizeof(msgtypes[0])) + if (rtm->rtm_type < nitems(msgtypes)) (void)printf("%s: ", msgtypes[rtm->rtm_type]); else (void)printf("unknown type %d: ", rtm->rtm_type); @@ -1660,6 +1683,7 @@ print_getmsg(struct rt_msghdr *rtm, int if (rtm->rtm_msglen > msglen) { warnx("message length mismatch, in packet %d, returned %d", rtm->rtm_msglen, msglen); + return; } if (rtm->rtm_errno) { errno = rtm->rtm_errno; @@ -1696,9 +1720,8 @@ print_getmsg(struct rt_msghdr *rtm, int #define lock(f) ((rtm->rtm_rmx.rmx_locks & __CONCAT(RTV_,f)) ? 'L' : ' ') #define msec(u) (((u) + 500) / 1000) /* usec to msec */ - - printf("\n%s\n", "\ - recvpipe sendpipe ssthresh rtt,msec mtu weight expire"); + printf("\n%9s %9s %9s %9s %9s %10s %9s\n", "recvpipe", + "sendpipe", "ssthresh", "rtt,msec", "mtu ", "weight", "expire"); printf("%8ld%c ", rtm->rtm_rmx.rmx_recvpipe, lock(RPIPE)); printf("%8ld%c ", rtm->rtm_rmx.rmx_sendpipe, lock(SPIPE)); printf("%8ld%c ", rtm->rtm_rmx.rmx_ssthresh, lock(SSTHRESH)); @@ -1749,8 +1772,8 @@ pmsg_addrs(char *cp, int addrs, size_t l (void)printf("\nsockaddrs: "); printb(addrs, addrnames); putchar('\n'); - for (i = 1; i != 0; i <<= 1) - if (i & addrs) { + for (i = 0; i < RTAX_MAX; i++) + if (addrs & (1 << i)) { sa = (struct sockaddr *)cp; if (len == 0 || len < SA_SIZE(sa)) { (void)printf(errfmt, __func__, len); From owner-svn-src-all@FreeBSD.ORG Sun Jul 21 12:47:34 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 43CF3641; Sun, 21 Jul 2013 12:47:34 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 363EC9D0; Sun, 21 Jul 2013 12:47:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6LClYAt016961; Sun, 21 Jul 2013 12:47:34 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6LClYvj016960; Sun, 21 Jul 2013 12:47:34 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201307211247.r6LClYvj016960@svn.freebsd.org> From: Andrew Turner Date: Sun, 21 Jul 2013 12:47:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253518 - head/lib/libc/arm/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Jul 2013 12:47:34 -0000 Author: andrew Date: Sun Jul 21 12:47:33 2013 New Revision: 253518 URL: http://svnweb.freebsd.org/changeset/base/253518 Log: Teach siglongjmp about the VFP version of the setjmp buffer. This fixes a bug where a call to sigsetjmp followed by siglongjmp may fail when run on a machine with VFP enabled. Modified: head/lib/libc/arm/gen/sigsetjmp.S Modified: head/lib/libc/arm/gen/sigsetjmp.S ============================================================================== --- head/lib/libc/arm/gen/sigsetjmp.S Sun Jul 21 11:59:41 2013 (r253517) +++ head/lib/libc/arm/gen/sigsetjmp.S Sun Jul 21 12:47:33 2013 (r253518) @@ -57,8 +57,10 @@ ENTRY(sigsetjmp) WEAK_ALIAS(__siglongjmp, siglongjmp) ENTRY(siglongjmp) - ldr r2, .L_setjmp_magic - ldr r3, [r0] - teq r2, r3 + ldr r2, .L_setjmp_magic /* load magic */ + ldr r3, [r0] /* get magic from jmp_buf */ + bic r3, r3, #(_JB_MAGIC__SETJMP ^ _JB_MAGIC__SETJMP_VFP) + /* ignore VFP-ness of magic */ + teq r2, r3 /* magic correct? */ beq PIC_SYM(_C_LABEL(_longjmp), PLT) b PIC_SYM(_C_LABEL(longjmp), PLT) From owner-svn-src-all@FreeBSD.ORG Sun Jul 21 13:39:16 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 10F26687; Sun, 21 Jul 2013 13:39:16 +0000 (UTC) Date: Sun, 21 Jul 2013 13:39:16 +0000 From: Alexey Dokuchaev To: Glen Barber Subject: Re: svn commit: r253513 - head/release Message-ID: <20130721133915.GA36573@FreeBSD.org> References: <201307210523.r6L5NYqh084679@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201307210523.r6L5NYqh084679@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Jul 2013 13:39:16 -0000 On Sun, Jul 21, 2013 at 05:23:34AM +0000, Glen Barber wrote: > New Revision: 253513 > URL: http://svnweb.freebsd.org/changeset/base/253513 > > Log: > Create memstick images with the '.img' filename extension. > > Requested by: many > [...] Is there any work being done to merge the .iso and .img into single, hybrid bootable image (c.g. Haiku)? I've asked this question before, but I cannot recall now what was the outcome if it... ./danfe From owner-svn-src-all@FreeBSD.ORG Sun Jul 21 14:27:08 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 03DB3B3B; Sun, 21 Jul 2013 14:27:08 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id EA349FF4; Sun, 21 Jul 2013 14:27:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6LER7i2048227; Sun, 21 Jul 2013 14:27:07 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6LER7gk048225; Sun, 21 Jul 2013 14:27:07 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201307211427.r6LER7gk048225@svn.freebsd.org> From: Hiroki Sato Date: Sun, 21 Jul 2013 14:27:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253519 - head/sbin/route X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Jul 2013 14:27:08 -0000 Author: hrs Date: Sun Jul 21 14:27:07 2013 New Revision: 253519 URL: http://svnweb.freebsd.org/changeset/base/253519 Log: - Use getnameinfo() for both of AF_INET and AF_INET6 in routename(). - Add missing "static". Modified: head/sbin/route/route.c Modified: head/sbin/route/route.c ============================================================================== --- head/sbin/route/route.c Sun Jul 21 12:47:33 2013 (r253518) +++ head/sbin/route/route.c Sun Jul 21 14:27:07 2013 (r253519) @@ -135,7 +135,7 @@ static int fiboptlist_range(const char * static void usage(const char *) __dead2; -void +static void usage(const char *cp) { if (cp != NULL) @@ -489,15 +489,12 @@ retry: return (error); } -const char * +static const char * routename(struct sockaddr *sa) { struct sockaddr_dl *sdl; const char *cp; - static char line[MAXHOSTNAMELEN + 1]; -#ifdef INET - struct hostent *hp; -#endif + static char line[NI_MAXHOST]; static char domain[MAXHOSTNAMELEN + 1]; static int first = 1, n; @@ -511,63 +508,71 @@ routename(struct sockaddr *sa) domain[0] = '\0'; } + /* If the address is zero-filled, use "default". */ if (sa->sa_len == 0 && nflag == 0) return ("default"); +#if defined(INET) || defined(INET6) switch (sa->sa_family) { #ifdef INET case AF_INET: - { - struct in_addr in; - - in = ((struct sockaddr_in *)(void *)sa)->sin_addr; - cp = NULL; - if (in.s_addr == INADDR_ANY && nflag == 0) - return ("default"); - if (nflag == 0) { - hp = gethostbyaddr((char *)&in, sizeof (struct in_addr), - AF_INET); - if (hp != NULL) { - char *cptr; - cptr = strchr(hp->h_name, '.'); - if (cptr != NULL && - strcmp(cptr + 1, domain) == 0) - *cptr = '\0'; - cp = hp->h_name; - } - } - if (cp != NULL) { - strncpy(line, cp, sizeof(line) - 1); - line[sizeof(line) - 1] = '\0'; - } else - (void)sprintf(line, "%s", inet_ntoa(in)); + /* If the address is zero-filled, use "default". */ + if (nflag == 0 && + ((struct sockaddr_in *)(void *)sa)->sin_addr.s_addr == + INADDR_ANY) + return("default"); break; - } - #endif #ifdef INET6 case AF_INET6: - { - struct sockaddr_in6 sin6; /* use static var for safety */ - int niflags = 0; - - /* Check if the address is ::. If true, use "default". */ + /* If the address is zero-filled, use "default". */ if (nflag == 0 && IN6_IS_ADDR_UNSPECIFIED(&((struct sockaddr_in6 *)(void *)sa)->sin6_addr)) return("default"); - memset(&sin6, 0, sizeof(sin6)); - memcpy(&sin6, sa, sa->sa_len); - sin6.sin6_len = sizeof(struct sockaddr_in6); - sin6.sin6_family = AF_INET6; - if (nflag) - niflags |= NI_NUMERICHOST; - if (getnameinfo((struct sockaddr *)&sin6, sin6.sin6_len, - line, sizeof(line), NULL, 0, niflags) != 0) + break; +#endif + } +#endif + + switch (sa->sa_family) { +#if defined(INET) || defined(INET6) +#ifdef INET + case AF_INET: +#endif +#ifdef INET6 + case AF_INET6: +#endif + { + struct sockaddr_storage ss; + int error; + char *p; + + memset(&ss, 0, sizeof(ss)); + if (sa->sa_len == 0) + ss.ss_family = sa->sa_family; + else + memcpy(&ss, sa, sa->sa_len); + /* Expand sa->sa_len because it could be shortened. */ + if (sa->sa_family == AF_INET) + ss.ss_len = sizeof(struct sockaddr_in); + else if (sa->sa_family == AF_INET6) + ss.ss_len = sizeof(struct sockaddr_in6); + error = getnameinfo((struct sockaddr *)&ss, ss.ss_len, + line, sizeof(line), NULL, 0, + (nflag == 0) ? 0 : NI_NUMERICHOST); + if (error) { + warnx("getnameinfo(): %s", gai_strerror(error)); strncpy(line, "invalid", sizeof(line)); + } + + /* Remove the domain part if any. */ + p = strchr(line, '.'); + if (p != NULL && strcmp(p + 1, domain) == 0) + *p = '\0'; return (line); + break; } #endif - case AF_APPLETALK: (void)snprintf(line, sizeof(line), "atalk %s", atalk_ntoa(((struct sockaddr_at *)(void *)sa)->sat_addr)); @@ -610,7 +615,7 @@ routename(struct sockaddr *sa) * Return the name of the network whose address is given. * The address is assumed to be that of a net, not a host. */ -const char * +static const char * netname(struct sockaddr *sa) { struct sockaddr_dl *sdl; @@ -1153,6 +1158,9 @@ getaddr(int idx, char *str, struct hoste aflen = sizeof(struct sockaddr_dl); #endif } +#ifndef INET + hpp = NULL; +#endif rtm_addrs |= (1 << idx); if (idx > RTAX_MAX) From owner-svn-src-all@FreeBSD.ORG Sun Jul 21 15:26:26 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0A338D33; Sun, 21 Jul 2013 15:26:26 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F1BEE3E0; Sun, 21 Jul 2013 15:26:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6LFQP6a066799; Sun, 21 Jul 2013 15:26:25 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6LFQPXY066798; Sun, 21 Jul 2013 15:26:25 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201307211526.r6LFQPXY066798@svn.freebsd.org> From: Hiroki Sato Date: Sun, 21 Jul 2013 15:26:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253520 - head/etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Jul 2013 15:26:26 -0000 Author: hrs Date: Sun Jul 21 15:26:25 2013 New Revision: 253520 URL: http://svnweb.freebsd.org/changeset/base/253520 Log: Do not set ND6_IFF_ACCEPT_RTADV on if_bridge(4) interfaces when ipv6_enable=yes. MFC after: 3 days Modified: head/etc/network.subr Modified: head/etc/network.subr ============================================================================== --- head/etc/network.subr Sun Jul 21 14:27:07 2013 (r253519) +++ head/etc/network.subr Sun Jul 21 15:26:25 2013 (r253520) @@ -113,9 +113,18 @@ ifconfig_up() # backward compatibility: $ipv6_enable case $ipv6_enable in [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1) - if ! checkyesno ipv6_gateway_enable; then - _ipv6_opts="${_ipv6_opts} accept_rtadv" - fi + case $1 in + bridge[0-9]*) + # No accept_rtadv by default on if_bridge(4) + # to avoid a conflict with the member + # interfaces. + ;; + *) + if ! checkyesno ipv6_gateway_enable; then + _ipv6_opts="${_ipv6_opts} accept_rtadv" + fi + ;; + esac ;; esac @@ -550,9 +559,18 @@ ipv6_autoconfif() [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1) if checkyesno ipv6_gateway_enable; then return 1 - else - return 0 fi + case $1 in + bridge[0-9]*) + # No accept_rtadv by default on if_bridge(4) + # to avoid a conflict with the member + # interfaces. + return 1 + ;; + *) + return 0 + ;; + esac ;; esac From owner-svn-src-all@FreeBSD.ORG Sun Jul 21 16:17:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 82E0AB02; Sun, 21 Jul 2013 16:17:37 +0000 (UTC) (envelope-from Devin.Teske@fisglobal.com) Received: from mx1.fisglobal.com (mx1.fisglobal.com [199.200.24.190]) by mx1.freebsd.org (Postfix) with ESMTP id 49F258B6; Sun, 21 Jul 2013 16:17:36 +0000 (UTC) Received: from smtp.fisglobal.com ([10.132.206.17]) by ltcfislmsgpa06.fnfis.com (8.14.5/8.14.5) with ESMTP id r6LGHSnx002205 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Sun, 21 Jul 2013 11:17:28 -0500 Received: from LTCFISWMSGMB21.FNFIS.com ([10.132.99.23]) by LTCFISWMSGHT06.FNFIS.com ([10.132.206.17]) with mapi id 14.02.0309.002; Sun, 21 Jul 2013 11:17:27 -0500 From: "Teske, Devin" To: Alexey Dokuchaev Subject: Re: svn commit: r253513 - head/release Thread-Topic: svn commit: r253513 - head/release Thread-Index: AQHOhdJ2FlUUZwfcZkq9aC0Vc2SteZlvd48AgAAsMQA= Date: Sun, 21 Jul 2013 16:17:26 +0000 Message-ID: <13CA24D6AB415D428143D44749F57D7201FD2BF2@ltcfiswmsgmb21> References: <201307210523.r6L5NYqh084679@svn.freebsd.org> <20130721133915.GA36573@FreeBSD.org> In-Reply-To: <20130721133915.GA36573@FreeBSD.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.132.253.121] Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.10.8794, 1.0.431, 0.0.0000 definitions=2013-07-20_06:2013-07-19,2013-07-20,1970-01-01 signatures=0 Cc: "svn-src-head@freebsd.org" , Glen Barber , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Devin Teske X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Devin Teske List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Jul 2013 16:17:37 -0000 On Jul 21, 2013, at 6:39 AM, Alexey Dokuchaev wrote: > On Sun, Jul 21, 2013 at 05:23:34AM +0000, Glen Barber wrote: >> New Revision: 253513 >> URL: http://svnweb.freebsd.org/changeset/base/253513 >>=20 >> Log: >> Create memstick images with the '.img' filename extension. >>=20 >> Requested by: many >> [...] >=20 > Is there any work being done to merge the .iso and .img into single, > hybrid bootable image (c.g. Haiku)? I've asked this question before, > but I cannot recall now what was the outcome if it... >=20 I have been doing this for years @ $work with sysinstall. Since the death o= f sysinstall, I've been working on the replacement. However, you can downlo= ad Hybrid ISO/IMG images here: http://druidbsd.sourceforge.net/download.shtml#FreeBSD_Druid or here: http://sourceforge.net/projects/druidbsd/files/ and here's PDF documentation on how to use it: http://druidbsd.cvs.sourceforge.net/viewvc/druidbsd/druidbsd/druid/src/doc/= FreeBSD_Druid_User_Guide.pdf?view=3Dlog and here's the instructions on how to "burn" it (including full instruction= s for pretty much every Operating System; and even some tools for Windoze): http://druidbsd.cvs.sourceforge.net/viewvc/druidbsd/druidbsd/druid/src/tool= s/ Please... Feel free to ask questions. --=20 Devin P.S. It's *so* much more than *just* taking the installer and Hybridizing i= t to work with CD versus USB seamlessly. The "Druid" line is a master-work = that took 7 years to produce. P.P.S. Been working on rewriting other aspects of the installer before we r= evisit the idea of merging Druid components to achieve what you're asking. = For now, we have the Druid to show us a proof-of-concept that it's not only= achievable, but it's damned slick when you do get to the hybridized arena. _____________ The information contained in this message is proprietary and/or confidentia= l. If you are not the intended recipient, please: (i) delete the message an= d all copies; (ii) do not disclose, distribute or use the message in any ma= nner; and (iii) notify the sender immediately. In addition, please be aware= that any message addressed to our domain is subject to archiving and revie= w by persons other than the intended recipient. Thank you. From owner-svn-src-all@FreeBSD.ORG Sun Jul 21 16:38:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 16ABAFE7; Sun, 21 Jul 2013 16:38:17 +0000 (UTC) (envelope-from Devin.Teske@fisglobal.com) Received: from mx1.fisglobal.com (mx1.fisglobal.com [199.200.24.190]) by mx1.freebsd.org (Postfix) with ESMTP id D248F961; Sun, 21 Jul 2013 16:38:16 +0000 (UTC) Received: from smtp.fisglobal.com ([10.132.206.15]) by ltcfislmsgpa07.fnfis.com (8.14.5/8.14.5) with ESMTP id r6LGcFjG017887 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Sun, 21 Jul 2013 11:38:15 -0500 Received: from LTCFISWMSGMB21.FNFIS.com ([10.132.99.23]) by LTCFISWMSGHT04.FNFIS.com ([10.132.206.15]) with mapi id 14.02.0309.002; Sun, 21 Jul 2013 11:38:14 -0500 From: "Teske, Devin" To: Alexey Dokuchaev Subject: Re: svn commit: r253513 - head/release Thread-Topic: svn commit: r253513 - head/release Thread-Index: AQHOhdJ2FlUUZwfcZkq9aC0Vc2SteZlvd48AgAAyAIA= Date: Sun, 21 Jul 2013 16:38:13 +0000 Message-ID: <13CA24D6AB415D428143D44749F57D7201FD2CDB@ltcfiswmsgmb21> References: <201307210523.r6L5NYqh084679@svn.freebsd.org> <20130721133915.GA36573@FreeBSD.org> In-Reply-To: <20130721133915.GA36573@FreeBSD.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.132.253.121] Content-Type: text/plain; charset="us-ascii" Content-ID: <43948B66A5E7A44EBBCCA904BDDD08CB@fisglobal.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.10.8794, 1.0.431, 0.0.0000 definitions=2013-07-20_06:2013-07-19,2013-07-20,1970-01-01 signatures=0 Cc: "svn-src-head@freebsd.org" , Glen Barber , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Devin Teske X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Devin Teske List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Jul 2013 16:38:17 -0000 On Jul 21, 2013, at 6:39 AM, Alexey Dokuchaev wrote: > On Sun, Jul 21, 2013 at 05:23:34AM +0000, Glen Barber wrote: >> New Revision: 253513 >> URL: http://svnweb.freebsd.org/changeset/base/253513 >>=20 >> Log: >> Create memstick images with the '.img' filename extension. >>=20 >> Requested by: many >> [...] >=20 > Is there any work being done to merge the .iso and .img into single, > hybrid bootable image (c.g. Haiku)? I wonder how Haiku does it. I use ISOLINUX (part of the SYSLINUX family) as my boot loader. The ISO9660 layer boots ISOLINUX and then chain-loads the mfsroot, displayi= ng my beastie Forth menu. Then from the mfsroot boot environment, sysinstall runs /install.cfg: http://druidbsd.cvs.sourceforge.net/viewvc/druidbsd/druidbsd/druid/dep/free= bsd/mfsroot/standard/src/install.cfg?revision=3D1.1&view=3Dmarkup which runs a small script: http://druidbsd.cvs.sourceforge.net/viewvc/druidbsd/druidbsd/druid/dep/free= bsd/mfsroot/standard/src/fis/load_menu?revision=3D1.1&view=3Dmarkup Which looks for /dev/iso9660/VOL_ID Where VOL_ID is set by the mkisofs(8) `-V VOL_ID' flag when producing the = boot media. See "BOOT_VOLID" in my GNUMakefile that calls mkisofs(8): http://druidbsd.cvs.sourceforge.net/viewvc/druidbsd/druidbsd/druid/GNUmakef= ile.in?revision=3D1.7&view=3Dmarkup Now here's the trick... It doesn't matter whether you burned the ISO to a CD/DVD or you imaged it t= o a USB Thumb... ... phk's GEOM layer picks up and creates /dev/iso9660/VOL_ID regardless of= what medium you booted from (so-long as it was an ISO that was post-proces= sed with the ISOLINUX utility "isohybrid"). So in my hybridized installer, I have a bootstrap script that runs before s= ysinstall that mounts /dev/iso9660/VOL_ID to /cdrom and I end up using /cdr= om always. That's the very basic *gist* of how I achieve hybrid booting for FreeBSD. O= f course... that's only the *start*. Of course, to get sysinstall to instal= l from /cdrom, I had to code a new media access module called "mediaSetNull= FS": http://druidbsd.cvs.sourceforge.net/viewvc/druidbsd/druidbsd/druid/dep/free= bsd/patches/local_patches/usr.sbin%3A%3Asysinstall%3A%3Anullfs.c.patch?view= =3Dmarkup Whose job is (when you configure your installation to use this access metho= d) is to take the path given and do a mount_nullfs from point-A to point-B = *prior* to doing the chroot into the formatted disk (here, like all media a= ccess methods, the point-B is "/dist" within the chroot environment). Of course... moving forward... we would need to re-apply logistics to bsdin= stall to work with ISOLINUX and isohybrid images -- though I gather it woul= d be even easier than making sysinstall work. > I've asked this question before, > but I cannot recall now what was the outcome if it... >=20 Did I answer you last time? Just curious. I've been doing this for a while. --=20 Devin _____________ The information contained in this message is proprietary and/or confidentia= l. If you are not the intended recipient, please: (i) delete the message an= d all copies; (ii) do not disclose, distribute or use the message in any ma= nner; and (iii) notify the sender immediately. In addition, please be aware= that any message addressed to our domain is subject to archiving and revie= w by persons other than the intended recipient. Thank you. From owner-svn-src-all@FreeBSD.ORG Sun Jul 21 16:56:13 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C20F94CD; Sun, 21 Jul 2013 16:56:13 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from mail.allbsd.org (gatekeeper.allbsd.org [IPv6:2001:2f0:104:e001::32]) by mx1.freebsd.org (Postfix) with ESMTP id AC19F9E6; Sun, 21 Jul 2013 16:56:12 +0000 (UTC) Received: from alph.d.allbsd.org (p2049-ipbf1102funabasi.chiba.ocn.ne.jp [122.26.101.49]) (authenticated bits=128) by mail.allbsd.org (8.14.5/8.14.5) with ESMTP id r6LGttLL081606 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 22 Jul 2013 01:56:05 +0900 (JST) (envelope-from hrs@FreeBSD.org) Received: from localhost (localhost [IPv6:::1]) (authenticated bits=0) by alph.d.allbsd.org (8.14.5/8.14.5) with ESMTP id r6LGtrq7016671; Mon, 22 Jul 2013 01:55:55 +0900 (JST) (envelope-from hrs@FreeBSD.org) Date: Mon, 22 Jul 2013 01:55:46 +0900 (JST) Message-Id: <20130722.015546.1238134239830261918.hrs@allbsd.org> To: danfe@FreeBSD.org, dteske@FreeBSD.org Subject: Re: svn commit: r253513 - head/release From: Hiroki Sato In-Reply-To: <13CA24D6AB415D428143D44749F57D7201FD2BF2@ltcfiswmsgmb21> References: <201307210523.r6L5NYqh084679@svn.freebsd.org> <20130721133915.GA36573@FreeBSD.org> <13CA24D6AB415D428143D44749F57D7201FD2BF2@ltcfiswmsgmb21> X-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530 FFD7 4F2C D3D8 2793 CF2D X-Mailer: Mew version 6.5 on Emacs 24.3 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Multipart/Signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="--Security_Multipart(Mon_Jul_22_01_55_46_2013_986)--" Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.97.4 at gatekeeper.allbsd.org X-Virus-Status: Clean X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (mail.allbsd.org [133.31.130.32]); Mon, 22 Jul 2013 01:56:05 +0900 (JST) X-Spam-Status: No, score=-90.6 required=13.0 tests=CONTENT_TYPE_PRESENT, DIRECTOCNDYN,DYN_PBL,RCVD_IN_PBL,SPF_SOFTFAIL,USER_IN_WHITELIST autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on gatekeeper.allbsd.org Cc: svn-src-head@FreeBSD.org, gjb@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Jul 2013 16:56:13 -0000 ----Security_Multipart(Mon_Jul_22_01_55_46_2013_986)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit "Teske, Devin" wrote in <13CA24D6AB415D428143D44749F57D7201FD2BF2@ltcfiswmsgmb21>: De> De> On Jul 21, 2013, at 6:39 AM, Alexey Dokuchaev wrote: De> De> > On Sun, Jul 21, 2013 at 05:23:34AM +0000, Glen Barber wrote: De> >> New Revision: 253513 De> >> URL: http://svnweb.freebsd.org/changeset/base/253513 De> >> De> >> Log: De> >> Create memstick images with the '.img' filename extension. De> >> De> >> Requested by: many De> >> [...] De> > De> > Is there any work being done to merge the .iso and .img into single, De> > hybrid bootable image (c.g. Haiku)? I've asked this question before, De> > but I cannot recall now what was the outcome if it... De> > De> De> I have been doing this for years @ $work with sysinstall. Since the De> death of sysinstall, I've been working on the replacement. However, De> you can download Hybrid ISO/IMG images here: It is possible to create a hybrid image of ISO9660 and USB memory image because ISO images for sparc64 have a similar structure and we can reuse the build procedure. I have a patch to create such images, but there is a concern that recent memory images become >700MB. Is it still useful? -- Hiroki ----Security_Multipart(Mon_Jul_22_01_55_46_2013_986)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.13 (FreeBSD) iEYEABECAAYFAlHsEpIACgkQTyzT2CeTzy0oGgCfR4FuVHwqrJRECezOp0/6ZtxR A+8AoIW+84gCRZPRk9+7FQ1ObI3jwZfY =Sx6h -----END PGP SIGNATURE----- ----Security_Multipart(Mon_Jul_22_01_55_46_2013_986)---- From owner-svn-src-all@FreeBSD.ORG Sun Jul 21 18:18:24 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 84E32986; Sun, 21 Jul 2013 18:18:24 +0000 (UTC) (envelope-from Devin.Teske@fisglobal.com) Received: from mx1.fisglobal.com (mx1.fisglobal.com [199.200.24.190]) by mx1.freebsd.org (Postfix) with ESMTP id 491FAC45; Sun, 21 Jul 2013 18:18:23 +0000 (UTC) Received: from smtp.fisglobal.com ([10.132.206.15]) by ltcfislmsgpa07.fnfis.com (8.14.5/8.14.5) with ESMTP id r6LIIMWS030541 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Sun, 21 Jul 2013 13:18:22 -0500 Received: from LTCFISWMSGMB21.FNFIS.com ([10.132.99.23]) by LTCFISWMSGHT04.FNFIS.com ([10.132.206.15]) with mapi id 14.02.0309.002; Sun, 21 Jul 2013 13:18:20 -0500 From: "Teske, Devin" To: Hiroki Sato Subject: Re: svn commit: r253513 - head/release Thread-Topic: svn commit: r253513 - head/release Thread-Index: AQHOhdJ2FlUUZwfcZkq9aC0Vc2SteZlvd48AgAAsMQCAAAq2AIAAFw8A Date: Sun, 21 Jul 2013 18:18:18 +0000 Message-ID: <13CA24D6AB415D428143D44749F57D7201FD2F7D@ltcfiswmsgmb21> References: <201307210523.r6L5NYqh084679@svn.freebsd.org> <20130721133915.GA36573@FreeBSD.org> <13CA24D6AB415D428143D44749F57D7201FD2BF2@ltcfiswmsgmb21> <20130722.015546.1238134239830261918.hrs@allbsd.org> In-Reply-To: <20130722.015546.1238134239830261918.hrs@allbsd.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.132.253.121] Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.10.8794, 1.0.431, 0.0.0000 definitions=2013-07-21_06:2013-07-19,2013-07-21,1970-01-01 signatures=0 Cc: Alexey Dokuchaev , "src-committers@FreeBSD.org" , "svn-src-all@FreeBSD.org" , Glen Barber , "svn-src-head@FreeBSD.org" , Devin Teske X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Devin Teske List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Jul 2013 18:18:24 -0000 On Jul 21, 2013, at 9:55 AM, Hiroki Sato wrote: > "Teske, Devin" wrote > in <13CA24D6AB415D428143D44749F57D7201FD2BF2@ltcfiswmsgmb21>: >=20 > De> > De> On Jul 21, 2013, at 6:39 AM, Alexey Dokuchaev wrote: > De> > De> > On Sun, Jul 21, 2013 at 05:23:34AM +0000, Glen Barber wrote: > De> >> New Revision: 253513 > De> >> URL: https://urldefense.proofpoint.com/v1/url?u=3Dhttp://svnweb.fr= eebsd.org/changeset/base/253513&k=3D%2FbkpAUdJWZuiTILCq%2FFnQg%3D%3D%0A&r= =3DMrjs6vR4%2Faj2Ns9%2FssHJjg%3D%3D%0A&m=3DICzrrPRprsUfeSXmW22PbvhR4zFtb5xx= NHgyzQmaW38%3D%0A&s=3Dab088fdca0bfa1bc85c9bae0aaa04a30f6c37b8815a87d255b1e0= 26794ecbccf > De> >> > De> >> Log: > De> >> Create memstick images with the '.img' filename extension. > De> >> > De> >> Requested by: many > De> >> [...] > De> > > De> > Is there any work being done to merge the .iso and .img into single, > De> > hybrid bootable image (c.g. Haiku)? I've asked this question befor= e, > De> > but I cannot recall now what was the outcome if it... > De> > > De> > De> I have been doing this for years @ $work with sysinstall. Since the > De> death of sysinstall, I've been working on the replacement. However, > De> you can download Hybrid ISO/IMG images here: >=20 > It is possible to create a hybrid image of ISO9660 and USB memory > image because ISO images for sparc64 have a similar structure and we > can reuse the build procedure. I have a patch to create such images, > but there is a concern that recent memory images become >700MB. Is > it still useful? >=20 Yes. Because we can burn them to DVD for read-only optical and we can use 2= GB, 4GB, or greater-sized USB Thumbs. @ $work we've been able to keep the size of the ISOs down by using sysinsta= ll from an mfsroot. =3D=3D=3D ASIDE: I recently analyzed what we would need to put bsdinstall+bsdconfig i= nto an mfsroot to do similar things as sysinstall... (sorted alphabetically) /bin/sh /usr/sbin/pkg_add* awk bsdlabel** cat cdcontrol chmod chown cksum c= mp cp=20 date df dhclient dialog dumpfs ee fdisk fetch find ftp grep host hostname i= d=20 ifconfig kill ldconfig ln ls md5 mkdir mktemp mount mount_cd9660 mount_msdo= sfs=20 mount_nfs moused mv nc pkg_delete* pw rm route rtsol sed sleep sort stat st= ty=20 sysctl tail tr umount uname vidcontrol (optional functionality requirements; not required in mfsroot) Xdialog logger su sudo touch xauth xterm * bsdconfig(8) yet to be updated for pkg (for configPackages) ** bsdconfig(8) yet to be updated to use gpart to probe for disks (for medi= aSet*) =3D=3D=3D Despite the fact that what we've only published builds under 600MB, in-hous= e @ $work, I've made so-called "super discs" that contain multiple arches += multiple releases. For example, I once made a multi-GB DVD that contained = 4.11, 8.1-32, 8.1-64, 8.3-32, 8.3-64, 9.0-32, and 9.0-64 (plus several util= ities like memtest86, memtest86+, memtest86+SMP, windiag, Derik's Boot-And-= Nuke, TuffTest Pro, SpinRite, WD Velociraptor FW updates, Seagate SeaTools = (both GUI and Txt version), and yet even more. I think the resulting ISO wa= s about 2.7GB. It fit nicely on a 3GB thumb-drive I had and it burned well = to DVD. It was very nice being able to walk around with one disc or one thu= mb drive and be prepared for anything/everything. (I carry one one me at all times in my coat pocket ^_^) So yeah... >700MB shouldn't be a problem. --=20 Devin _____________ The information contained in this message is proprietary and/or confidentia= l. If you are not the intended recipient, please: (i) delete the message an= d all copies; (ii) do not disclose, distribute or use the message in any ma= nner; and (iii) notify the sender immediately. In addition, please be aware= that any message addressed to our domain is subject to archiving and revie= w by persons other than the intended recipient. Thank you. From owner-svn-src-all@FreeBSD.ORG Sun Jul 21 18:37:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 32393E54; Sun, 21 Jul 2013 18:37:39 +0000 (UTC) (envelope-from kientzle@freebsd.org) Received: from monday.kientzle.com (99-115-135-74.uvs.sntcca.sbcglobal.net [99.115.135.74]) by mx1.freebsd.org (Postfix) with ESMTP id E7F02CC5; Sun, 21 Jul 2013 18:37:38 +0000 (UTC) Received: (from root@localhost) by monday.kientzle.com (8.14.4/8.14.4) id r6LIbWsr033546; Sun, 21 Jul 2013 18:37:32 GMT (envelope-from kientzle@freebsd.org) Received: from [192.168.2.123] (CiscoE3000 [192.168.1.65]) by kientzle.com with SMTP id ykvsiua35miqa6f8jyngie3ay6; Sun, 21 Jul 2013 18:37:31 +0000 (UTC) (envelope-from kientzle@freebsd.org) Subject: Re: svn commit: r251709 - head/sys/vm Mime-Version: 1.0 (Apple Message framework v1283) Content-Type: text/plain; charset=us-ascii From: Tim Kientzle In-Reply-To: <0AA48233-11CD-482E-82DE-E0F8C833E36E@kientzle.com> Date: Sun, 21 Jul 2013 11:37:30 -0700 Content-Transfer-Encoding: 7bit Message-Id: <49DCB494-32B5-46D7-89FC-8B03477EC945@freebsd.org> References: <201306132105.r5DL5c4F013089@svn.freebsd.org> <20130615113503.4f5509dd@bender.Home> <20130618233450.71d9d03b@bender.Home> <0AA48233-11CD-482E-82DE-E0F8C833E36E@kientzle.com> To: Andrew Turner , Jeff Roberson X-Mailer: Apple Mail (2.1283) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Jul 2013 18:37:39 -0000 >> On Sat, 15 Jun 2013 11:35:03 +0100 >> Andrew Turner wrote: >> >>> On Thu, 13 Jun 2013 21:05:38 +0000 (UTC) >>> Jeff Roberson wrote: >>> >>>> Author: jeff >>>> Date: Thu Jun 13 21:05:38 2013 >>>> New Revision: 251709 >>>> URL: http://svnweb.freebsd.org/changeset/base/251709 >>>> >>>> Log: >>>> - Convert the slab free item list from a linked array of indices >>>> to a bitmap using sys/bitset. This is much simpler, has lower space >>>> overhead and is cheaper in most cases. >>>> - Use a second bitmap for invariants asserts and improve the >>>> quality of the asserts as well as the number of erroneous conditions >>>> that we will catch. >>>> - Drastically simplify sizing code. Special case refcnt zones >>>> since they will be going away. >>>> - Update stale comments. >>> >>> This broke booting for my on the Raspberry Pi for me. If I revert just >>> this change the board boots as expected. Kernel output from the boot >>> failure follows. As Andrew pointed out some time ago, this broke armv6 with: panic: lock "vm map (user)" 0xc09cc050 already initialized I put in some debug printfs and verified that this is actually the first time that vm_map_zinit is called. So I don't think the lock is actually being re-initialized; rather I think it's a problem with uninitialized memory. The following seems to fix it for me: Index: sys/vm/vm_map.c =================================================================== --- sys/vm/vm_map.c (revision 253514) +++ sys/vm/vm_map.c (working copy) @@ -239,8 +239,7 @@ vm_map_t map; map = (vm_map_t)mem; - map->nentries = 0; - map->size = 0; + memset(map, 0, sizeof(*map)); mtx_init(&map->system_mtx, "vm map (system)", NULL, MTX_DEF | MTX_DUPOK); sx_init(&map->lock, "vm map (user)"); return (0); From owner-svn-src-all@FreeBSD.ORG Sun Jul 21 19:17:47 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5F1EFD93; Sun, 21 Jul 2013 19:17:47 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 50B4CE57; Sun, 21 Jul 2013 19:17:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6LJHl0d041111; Sun, 21 Jul 2013 19:17:47 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6LJHlKu041110; Sun, 21 Jul 2013 19:17:47 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201307211917.r6LJHlKu041110@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 21 Jul 2013 19:17:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253525 - head/sys/compat/freebsd32 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Jul 2013 19:17:47 -0000 Author: kib Date: Sun Jul 21 19:17:46 2013 New Revision: 253525 URL: http://svnweb.freebsd.org/changeset/base/253525 Log: Cosmetic change, use the same union name on the left and right sides of the conversion. Tested by: Petr Salinger Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/compat/freebsd32/freebsd32_misc.c Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Sun Jul 21 17:23:49 2013 (r253524) +++ head/sys/compat/freebsd32/freebsd32_misc.c Sun Jul 21 19:17:46 2013 (r253525) @@ -2410,7 +2410,7 @@ siginfo_to_siginfo32(const siginfo_t *sr dst->si_uid = src->si_uid; dst->si_status = src->si_status; dst->si_addr = (uintptr_t)src->si_addr; - dst->si_value.sigval_int = src->si_value.sival_int; + dst->si_value.sival_int = src->si_value.sival_int; dst->si_timerid = src->si_timerid; dst->si_overrun = src->si_overrun; } From owner-svn-src-all@FreeBSD.ORG Sun Jul 21 19:21:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 87202F07; Sun, 21 Jul 2013 19:21:19 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5EDE3E64; Sun, 21 Jul 2013 19:21:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6LJLJ3U043601; Sun, 21 Jul 2013 19:21:19 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6LJLJZt043600; Sun, 21 Jul 2013 19:21:19 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201307211921.r6LJLJZt043600@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 21 Jul 2013 19:21:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253526 - head/tools/regression/aio/aiotest X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Jul 2013 19:21:19 -0000 Author: kib Date: Sun Jul 21 19:21:18 2013 New Revision: 253526 URL: http://svnweb.freebsd.org/changeset/base/253526 Log: Fix several warnings. Fix crash in aio_pty_cleanup() by initializing the pointer before dereferencing. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/tools/regression/aio/aiotest/aiotest.c Modified: head/tools/regression/aio/aiotest/aiotest.c ============================================================================== --- head/tools/regression/aio/aiotest/aiotest.c Sun Jul 21 19:17:46 2013 (r253525) +++ head/tools/regression/aio/aiotest/aiotest.c Sun Jul 21 19:21:18 2013 (r253526) @@ -49,6 +49,7 @@ #include #include #include +#include #include #include #include @@ -269,7 +270,7 @@ aio_write_test(struct aio_context *ac) if (len != ac->ac_buflen) { aio_cleanup(ac); errx(-1, "FAIL: %s: aio_write_test: aio_waitcomplete: short " - "write (%d)", ac->ac_test, len); + "write (%jd)", ac->ac_test, (intmax_t)len); } } @@ -329,7 +330,7 @@ aio_read_test(struct aio_context *ac) if (len != ac->ac_buflen) { aio_cleanup(ac); errx(-1, "FAIL: %s: aio_read_test: aio_waitcomplete: short " - "read (%d)", ac->ac_test, len); + "read (%jd)", ac->ac_test, (intmax_t)len); } if (aio_test_buffer(ac->ac_buffer, ac->ac_buflen, ac->ac_seed) == 0) { @@ -366,7 +367,7 @@ aio_file_cleanup(void *arg) #define FILE_LEN GLOBAL_MAX #define FILE_TIMEOUT 30 -static int +static void aio_file_test(void) { char pathname[PATH_MAX]; @@ -414,7 +415,7 @@ aio_fifo_cleanup(void *arg) #define FIFO_LEN 256 #define FIFO_TIMEOUT 30 -static int +static void aio_fifo_test(void) { int error, read_fd = -1, write_fd = -1; @@ -481,7 +482,7 @@ aio_unix_socketpair_cleanup(void *arg) #define UNIX_SOCKETPAIR_LEN 256 #define UNIX_SOCKETPAIR_TIMEOUT 30 -static int +static void aio_unix_socketpair_test(void) { struct aio_unix_socketpair_arg arg; @@ -515,13 +516,14 @@ aio_pty_cleanup(void *arg) { struct aio_pty_arg *apa; + apa = arg; close(apa->apa_read_fd); close(apa->apa_write_fd); }; #define PTY_LEN 256 #define PTY_TIMEOUT 30 -static int +static void aio_pty_test(void) { struct aio_pty_arg arg; @@ -573,7 +575,7 @@ aio_pipe_cleanup(void *arg) #define PIPE_LEN 256 #define PIPE_TIMEOUT 30 -static int +static void aio_pipe_test(void) { struct aio_context ac; @@ -628,7 +630,7 @@ aio_md_cleanup(void *arg) #define MD_LEN GLOBAL_MAX #define MD_TIMEOUT 30 -static int +static void aio_md_test(void) { int error, fd, i, mdctl_fd, unit; From owner-svn-src-all@FreeBSD.ORG Sun Jul 21 19:33:49 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 47A2A35B; Sun, 21 Jul 2013 19:33:49 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 289A8ED7; Sun, 21 Jul 2013 19:33:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6LJXnX9048711; Sun, 21 Jul 2013 19:33:49 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6LJXm5p048706; Sun, 21 Jul 2013 19:33:48 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201307211933.r6LJXm5p048706@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 21 Jul 2013 19:33:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253527 - in head/sys: compat/freebsd32 kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Jul 2013 19:33:49 -0000 Author: kib Date: Sun Jul 21 19:33:48 2013 New Revision: 253527 URL: http://svnweb.freebsd.org/changeset/base/253527 Log: Move the convert_sigevent32() utility function into freebsd32_misc.c for consumption outside the vfs_aio.c. For SIGEV_THREAD_ID and SIGEV_SIGNAL notification delivery methods, also copy in the sigev_value, since librt event pumping loop compares note generation number with the value passed through sigev_value. Tested by: Petr Salinger Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/compat/freebsd32/freebsd32_misc.c head/sys/compat/freebsd32/freebsd32_signal.h head/sys/kern/vfs_aio.c Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Sun Jul 21 19:21:18 2013 (r253526) +++ head/sys/compat/freebsd32/freebsd32_misc.c Sun Jul 21 19:33:48 2013 (r253527) @@ -2912,3 +2912,29 @@ freebsd32_posix_fadvise(struct thread *t return (kern_posix_fadvise(td, uap->fd, PAIR32TO64(off_t, uap->offset), PAIR32TO64(off_t, uap->len), uap->advice)); } + +int +convert_sigevent32(struct sigevent32 *sig32, struct sigevent *sig) +{ + + CP(*sig32, *sig, sigev_notify); + switch (sig->sigev_notify) { + case SIGEV_NONE: + break; + case SIGEV_THREAD_ID: + CP(*sig32, *sig, sigev_notify_thread_id); + /* FALLTHROUGH */ + case SIGEV_SIGNAL: + CP(*sig32, *sig, sigev_signo); + PTRIN_CP(*sig32, *sig, sigev_value.sival_ptr); + break; + case SIGEV_KEVENT: + CP(*sig32, *sig, sigev_notify_kqueue); + CP(*sig32, *sig, sigev_notify_kevent_flags); + PTRIN_CP(*sig32, *sig, sigev_value.sival_ptr); + break; + default: + return (EINVAL); + } + return (0); +} Modified: head/sys/compat/freebsd32/freebsd32_signal.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_signal.h Sun Jul 21 19:21:18 2013 (r253526) +++ head/sys/compat/freebsd32/freebsd32_signal.h Sun Jul 21 19:33:48 2013 (r253527) @@ -97,6 +97,8 @@ struct sigevent32 { } _sigev_un; }; +struct sigevent; +int convert_sigevent32(struct sigevent32 *sig32, struct sigevent *sig); void siginfo_to_siginfo32(const siginfo_t *src, struct siginfo32 *dst); #endif /* !_COMPAT_FREEBSD32_SIGNAL_H_ */ Modified: head/sys/kern/vfs_aio.c ============================================================================== --- head/sys/kern/vfs_aio.c Sun Jul 21 19:21:18 2013 (r253526) +++ head/sys/kern/vfs_aio.c Sun Jul 21 19:33:48 2013 (r253527) @@ -2755,31 +2755,6 @@ aiocb32_copyin_old_sigevent(struct aiocb } static int -convert_sigevent32(struct sigevent32 *sig32, struct sigevent *sig) -{ - - CP(*sig32, *sig, sigev_notify); - switch (sig->sigev_notify) { - case SIGEV_NONE: - break; - case SIGEV_THREAD_ID: - CP(*sig32, *sig, sigev_notify_thread_id); - /* FALLTHROUGH */ - case SIGEV_SIGNAL: - CP(*sig32, *sig, sigev_signo); - break; - case SIGEV_KEVENT: - CP(*sig32, *sig, sigev_notify_kqueue); - CP(*sig32, *sig, sigev_notify_kevent_flags); - PTRIN_CP(*sig32, *sig, sigev_value.sival_ptr); - break; - default: - return (EINVAL); - } - return (0); -} - -static int aiocb32_copyin(struct aiocb *ujob, struct aiocb *kjob) { struct aiocb32 job32; From owner-svn-src-all@FreeBSD.ORG Sun Jul 21 19:36:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3726E4BC; Sun, 21 Jul 2013 19:36:54 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 27869EEF; Sun, 21 Jul 2013 19:36:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6LJasiK049364; Sun, 21 Jul 2013 19:36:54 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6LJasor049363; Sun, 21 Jul 2013 19:36:54 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201307211936.r6LJasor049363@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 21 Jul 2013 19:36:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253528 - head/sys/compat/freebsd32 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Jul 2013 19:36:54 -0000 Author: kib Date: Sun Jul 21 19:36:53 2013 New Revision: 253528 URL: http://svnweb.freebsd.org/changeset/base/253528 Log: The freebsd32_lio_listio() compat syscall takes the struct sigevent32. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/compat/freebsd32/syscalls.master Modified: head/sys/compat/freebsd32/syscalls.master ============================================================================== --- head/sys/compat/freebsd32/syscalls.master Sun Jul 21 19:33:48 2013 (r253527) +++ head/sys/compat/freebsd32/syscalls.master Sun Jul 21 19:36:53 2013 (r253528) @@ -476,7 +476,7 @@ struct aiocb32 *aiocbp); } 257 AUE_NULL NOSTD { int freebsd32_lio_listio(int mode, \ struct aiocb32 * const *acb_list, \ - int nent, struct sigevent *sig); } + int nent, struct sigevent32 *sig); } 258 AUE_NULL UNIMPL nosys 259 AUE_NULL UNIMPL nosys 260 AUE_NULL UNIMPL nosys From owner-svn-src-all@FreeBSD.ORG Sun Jul 21 19:40:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 93A246F4; Sun, 21 Jul 2013 19:40:31 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 76485F08; Sun, 21 Jul 2013 19:40:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6LJeVwZ052057; Sun, 21 Jul 2013 19:40:31 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6LJeVMs052054; Sun, 21 Jul 2013 19:40:31 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201307211940.r6LJeVMs052054@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 21 Jul 2013 19:40:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253529 - in head/sys: compat/freebsd32 kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Jul 2013 19:40:31 -0000 Author: kib Date: Sun Jul 21 19:40:30 2013 New Revision: 253529 URL: http://svnweb.freebsd.org/changeset/base/253529 Log: Wrap kmq_notify(2) for compat32 to properly consume struct sigevent32 argument. Reviewed and tested by: Petr Salinger Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/compat/freebsd32/syscalls.master head/sys/kern/uipc_mqueue.c Modified: head/sys/compat/freebsd32/syscalls.master ============================================================================== --- head/sys/compat/freebsd32/syscalls.master Sun Jul 21 19:36:53 2013 (r253528) +++ head/sys/compat/freebsd32/syscalls.master Sun Jul 21 19:40:30 2013 (r253529) @@ -825,8 +825,8 @@ 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); } +461 AUE_NULL NOSTD { int freebsd32_kmq_notify(int mqd, \ + const struct sigevent32 *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); } Modified: head/sys/kern/uipc_mqueue.c ============================================================================== --- head/sys/kern/uipc_mqueue.c Sun Jul 21 19:36:53 2013 (r253528) +++ head/sys/kern/uipc_mqueue.c Sun Jul 21 19:40:30 2013 (r253529) @@ -2235,10 +2235,9 @@ sys_kmq_timedsend(struct thread *td, str return (error); } -int -sys_kmq_notify(struct thread *td, struct kmq_notify_args *uap) +static int +kern_kmq_notify(struct thread *td, int mqd, struct sigevent *sigev) { - struct sigevent ev; struct filedesc *fdp; struct proc *p; struct mqueue *mq; @@ -2246,34 +2245,31 @@ sys_kmq_notify(struct thread *td, struct struct mqueue_notifier *nt, *newnt = NULL; int error; - p = td->td_proc; - fdp = td->td_proc->p_fd; - if (uap->sigev) { - error = copyin(uap->sigev, &ev, sizeof(ev)); - if (error) - return (error); - if (ev.sigev_notify != SIGEV_SIGNAL && - ev.sigev_notify != SIGEV_THREAD_ID && - ev.sigev_notify != SIGEV_NONE) + if (sigev != NULL) { + if (sigev->sigev_notify != SIGEV_SIGNAL && + sigev->sigev_notify != SIGEV_THREAD_ID && + sigev->sigev_notify != SIGEV_NONE) return (EINVAL); - if ((ev.sigev_notify == SIGEV_SIGNAL || - ev.sigev_notify == SIGEV_THREAD_ID) && - !_SIG_VALID(ev.sigev_signo)) + if ((sigev->sigev_notify == SIGEV_SIGNAL || + sigev->sigev_notify == SIGEV_THREAD_ID) && + !_SIG_VALID(sigev->sigev_signo)) return (EINVAL); } - error = getmq(td, uap->mqd, &fp, NULL, &mq); + p = td->td_proc; + fdp = td->td_proc->p_fd; + error = getmq(td, mqd, &fp, NULL, &mq); if (error) return (error); again: FILEDESC_SLOCK(fdp); - fp2 = fget_locked(fdp, uap->mqd); + fp2 = fget_locked(fdp, mqd); if (fp2 == NULL) { FILEDESC_SUNLOCK(fdp); error = EBADF; goto out; } #ifdef CAPABILITIES - error = cap_check(cap_rights(fdp, uap->mqd), CAP_POLL_EVENT); + error = cap_check(cap_rights(fdp, mqd), CAP_POLL_EVENT); if (error) { FILEDESC_SUNLOCK(fdp); goto out; @@ -2286,12 +2282,12 @@ again: } mtx_lock(&mq->mq_mutex); FILEDESC_SUNLOCK(fdp); - if (uap->sigev != NULL) { + if (sigev != NULL) { if (mq->mq_notifier != NULL) { error = EBUSY; } else { PROC_LOCK(p); - nt = notifier_search(p, uap->mqd); + nt = notifier_search(p, mqd); if (nt == NULL) { if (newnt == NULL) { PROC_UNLOCK(p); @@ -2314,10 +2310,10 @@ again: nt->nt_ksi.ksi_flags |= KSI_INS | KSI_EXT; nt->nt_ksi.ksi_code = SI_MESGQ; nt->nt_proc = p; - nt->nt_ksi.ksi_mqd = uap->mqd; + nt->nt_ksi.ksi_mqd = mqd; notifier_insert(p, nt); } - nt->nt_sigev = ev; + nt->nt_sigev = *sigev; mq->mq_notifier = nt; PROC_UNLOCK(p); /* @@ -2330,7 +2326,7 @@ again: mqueue_send_notification(mq); } } else { - notifier_remove(p, mq, uap->mqd); + notifier_remove(p, mq, mqd); } mtx_unlock(&mq->mq_mutex); @@ -2341,6 +2337,23 @@ out: return (error); } +int +sys_kmq_notify(struct thread *td, struct kmq_notify_args *uap) +{ + struct sigevent ev, *evp; + int error; + + if (uap->sigev == NULL) { + evp = NULL; + } else { + error = copyin(uap->sigev, &ev, sizeof(ev)); + if (error != 0) + return (error); + evp = &ev; + } + return (kern_kmq_notify(td, uap->mqd, evp)); +} + static void mqueue_fdclose(struct thread *td, int fd, struct file *fp) { @@ -2637,6 +2650,7 @@ static struct syscall_helper_data mq_sys #ifdef COMPAT_FREEBSD32 #include #include +#include #include #include @@ -2763,12 +2777,33 @@ freebsd32_kmq_timedreceive(struct thread return (error); } +int +freebsd32_kmq_notify(struct thread *td, struct freebsd32_kmq_notify_args *uap) +{ + struct sigevent ev, *evp; + struct sigevent32 ev32; + int error; + + if (uap->sigev == NULL) { + evp = NULL; + } else { + error = copyin(uap->sigev, &ev32, sizeof(ev32)); + if (error != 0) + return (error); + error = convert_sigevent32(&ev32, &ev); + if (error != 0) + return (error); + evp = &ev; + } + return (kern_kmq_notify(td, uap->mqd, evp)); +} + 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_COMPAT(kmq_notify), + SYSCALL32_INIT_HELPER(freebsd32_kmq_notify), SYSCALL32_INIT_HELPER_COMPAT(kmq_unlink), SYSCALL_INIT_LAST }; From owner-svn-src-all@FreeBSD.ORG Sun Jul 21 19:43:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3BF1887D; Sun, 21 Jul 2013 19:43:54 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1E7A6F20; Sun, 21 Jul 2013 19:43:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6LJhsU6052868; Sun, 21 Jul 2013 19:43:54 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6LJhr5q052860; Sun, 21 Jul 2013 19:43:53 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201307211943.r6LJhr5q052860@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 21 Jul 2013 19:43:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253530 - in head/sys: compat/freebsd32 kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Jul 2013 19:43:54 -0000 Author: kib Date: Sun Jul 21 19:43:52 2013 New Revision: 253530 URL: http://svnweb.freebsd.org/changeset/base/253530 Log: Implement compat32 wrappers for the ktimer_* syscalls. Reported, reviewed and tested by: Petr Salinger Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/compat/freebsd32/freebsd32.h head/sys/compat/freebsd32/freebsd32_misc.c head/sys/compat/freebsd32/syscalls.master head/sys/kern/kern_time.c head/sys/sys/syscallsubr.h Modified: head/sys/compat/freebsd32/freebsd32.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32.h Sun Jul 21 19:40:30 2013 (r253529) +++ head/sys/compat/freebsd32/freebsd32.h Sun Jul 21 19:43:52 2013 (r253530) @@ -69,6 +69,15 @@ struct timespec32 { CP((src).fld,(dst).fld,tv_nsec); \ } while (0) +struct itimerspec32 { + struct timespec32 it_interval; + struct timespec32 it_value; +}; +#define ITS_CP(src, dst) do { \ + TS_CP((src), (dst), it_interval); \ + TS_CP((src), (dst), it_value); \ +} while (0) + struct rusage32 { struct timeval32 ru_utime; struct timeval32 ru_stime; Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Sun Jul 21 19:40:30 2013 (r253529) +++ head/sys/compat/freebsd32/freebsd32_misc.c Sun Jul 21 19:43:52 2013 (r253530) @@ -2331,6 +2331,70 @@ freebsd32_clock_getres(struct thread *td return (error); } +int freebsd32_ktimer_create(struct thread *td, + struct freebsd32_ktimer_create_args *uap) +{ + struct sigevent32 ev32; + struct sigevent ev, *evp; + int error, id; + + if (uap->evp == NULL) { + evp = NULL; + } else { + evp = &ev; + error = copyin(uap->evp, &ev32, sizeof(ev32)); + if (error != 0) + return (error); + error = convert_sigevent32(&ev32, &ev); + if (error != 0) + return (error); + } + error = kern_ktimer_create(td, uap->clock_id, evp, &id, -1); + if (error == 0) { + error = copyout(&id, uap->timerid, sizeof(int)); + if (error != 0) + kern_ktimer_delete(td, id); + } + return (error); +} + +int +freebsd32_ktimer_settime(struct thread *td, + struct freebsd32_ktimer_settime_args *uap) +{ + struct itimerspec32 val32, oval32; + struct itimerspec val, oval, *ovalp; + int error; + + error = copyin(uap->value, &val32, sizeof(val32)); + if (error != 0) + return (error); + ITS_CP(val32, val); + ovalp = uap->ovalue != NULL ? &oval : NULL; + error = kern_ktimer_settime(td, uap->timerid, uap->flags, &val, ovalp); + if (error == 0 && uap->ovalue != NULL) { + ITS_CP(oval, oval32); + error = copyout(&oval32, uap->ovalue, sizeof(oval32)); + } + return (error); +} + +int +freebsd32_ktimer_gettime(struct thread *td, + struct freebsd32_ktimer_gettime_args *uap) +{ + struct itimerspec32 val32; + struct itimerspec val; + int error; + + error = kern_ktimer_gettime(td, uap->timerid, &val); + if (error == 0) { + ITS_CP(val, val32); + error = copyout(&val32, uap->value, sizeof(val32)); + } + return (error); +} + int freebsd32_clock_getcpuclockid2(struct thread *td, struct freebsd32_clock_getcpuclockid2_args *uap) Modified: head/sys/compat/freebsd32/syscalls.master ============================================================================== --- head/sys/compat/freebsd32/syscalls.master Sun Jul 21 19:40:30 2013 (r253529) +++ head/sys/compat/freebsd32/syscalls.master Sun Jul 21 19:43:52 2013 (r253530) @@ -441,11 +441,17 @@ const struct timespec32 *tp); } 234 AUE_NULL STD { int freebsd32_clock_getres(clockid_t clock_id, \ struct timespec32 *tp); } -235 AUE_NULL UNIMPL timer_create -236 AUE_NULL UNIMPL timer_delete -237 AUE_NULL UNIMPL timer_settime -238 AUE_NULL UNIMPL timer_gettime -239 AUE_NULL UNIMPL timer_getoverrun +235 AUE_NULL STD { int freebsd32_ktimer_create(\ + clockid_t clock_id, \ + struct sigevent32 *evp, int *timerid); } +236 AUE_NULL NOPROTO { int ktimer_delete(int timerid); } +237 AUE_NULL STD { int freebsd32_ktimer_settime(int timerid,\ + int flags, \ + const struct itimerspec32 *value, \ + struct itimerspec32 *ovalue); } +238 AUE_NULL STD { int freebsd32_ktimer_gettime(int timerid,\ + struct itimerspec32 *value); } +239 AUE_NULL NOPROTO { int ktimer_getoverrun(int timerid); } 240 AUE_NULL STD { int freebsd32_nanosleep( \ const struct timespec32 *rqtp, \ struct timespec32 *rmtp); } Modified: head/sys/kern/kern_time.c ============================================================================== --- head/sys/kern/kern_time.c Sun Jul 21 19:40:30 2013 (r253529) +++ head/sys/kern/kern_time.c Sun Jul 21 19:43:52 2013 (r253530) @@ -98,9 +98,6 @@ static int realtimer_settime(struct itim static int realtimer_delete(struct itimer *); static void realtimer_clocktime(clockid_t, struct timespec *); static void realtimer_expire(void *); -static int kern_timer_create(struct thread *, clockid_t, - struct sigevent *, int *, int); -static int kern_timer_delete(struct thread *, int); int register_posix_clock(int, struct kclock *); void itimer_fire(struct itimer *it); @@ -1067,31 +1064,30 @@ struct ktimer_create_args { int sys_ktimer_create(struct thread *td, struct ktimer_create_args *uap) { - struct sigevent *evp1, ev; + struct sigevent *evp, ev; int id; int error; - if (uap->evp != NULL) { + if (uap->evp == NULL) { + evp = NULL; + } else { error = copyin(uap->evp, &ev, sizeof(ev)); if (error != 0) return (error); - evp1 = &ev; - } else - evp1 = NULL; - - error = kern_timer_create(td, uap->clock_id, evp1, &id, -1); - + evp = &ev; + } + error = kern_ktimer_create(td, uap->clock_id, evp, &id, -1); if (error == 0) { error = copyout(&id, uap->timerid, sizeof(int)); if (error != 0) - kern_timer_delete(td, id); + kern_ktimer_delete(td, id); } return (error); } -static int -kern_timer_create(struct thread *td, clockid_t clock_id, - struct sigevent *evp, int *timerid, int preset_id) +int +kern_ktimer_create(struct thread *td, clockid_t clock_id, struct sigevent *evp, + int *timerid, int preset_id) { struct proc *p = td->td_proc; struct itimer *it; @@ -1206,7 +1202,8 @@ struct ktimer_delete_args { int sys_ktimer_delete(struct thread *td, struct ktimer_delete_args *uap) { - return (kern_timer_delete(td, uap->timerid)); + + return (kern_ktimer_delete(td, uap->timerid)); } static struct itimer * @@ -1228,8 +1225,8 @@ itimer_find(struct proc *p, int timerid) return (it); } -static int -kern_timer_delete(struct thread *td, int timerid) +int +kern_ktimer_delete(struct thread *td, int timerid) { struct proc *p = td->td_proc; struct itimer *it; @@ -1271,35 +1268,40 @@ struct ktimer_settime_args { int sys_ktimer_settime(struct thread *td, struct ktimer_settime_args *uap) { - struct proc *p = td->td_proc; - struct itimer *it; struct itimerspec val, oval, *ovalp; int error; error = copyin(uap->value, &val, sizeof(val)); if (error != 0) return (error); - - if (uap->ovalue != NULL) - ovalp = &oval; - else - ovalp = NULL; + ovalp = uap->ovalue != NULL ? &oval : NULL; + error = kern_ktimer_settime(td, uap->timerid, uap->flags, &val, ovalp); + if (error == 0 && uap->ovalue != NULL) + error = copyout(ovalp, uap->ovalue, sizeof(*ovalp)); + return (error); +} + +int +kern_ktimer_settime(struct thread *td, int timer_id, int flags, + struct itimerspec *val, struct itimerspec *oval) +{ + struct proc *p; + struct itimer *it; + int error; + p = td->td_proc; PROC_LOCK(p); - if (uap->timerid < 3 || - (it = itimer_find(p, uap->timerid)) == NULL) { + if (timer_id < 3 || (it = itimer_find(p, timer_id)) == NULL) { PROC_UNLOCK(p); error = EINVAL; } else { PROC_UNLOCK(p); itimer_enter(it); - error = CLOCK_CALL(it->it_clockid, timer_settime, - (it, uap->flags, &val, ovalp)); + error = CLOCK_CALL(it->it_clockid, timer_settime, (it, + flags, val, oval)); itimer_leave(it); ITIMER_UNLOCK(it); } - if (error == 0 && uap->ovalue != NULL) - error = copyout(ovalp, uap->ovalue, sizeof(*ovalp)); return (error); } @@ -1312,26 +1314,34 @@ struct ktimer_gettime_args { int sys_ktimer_gettime(struct thread *td, struct ktimer_gettime_args *uap) { - struct proc *p = td->td_proc; - struct itimer *it; struct itimerspec val; int error; + error = kern_ktimer_gettime(td, uap->timerid, &val); + if (error == 0) + error = copyout(&val, uap->value, sizeof(val)); + return (error); +} + +int +kern_ktimer_gettime(struct thread *td, int timer_id, struct itimerspec *val) +{ + struct proc *p; + struct itimer *it; + int error; + + p = td->td_proc; PROC_LOCK(p); - if (uap->timerid < 3 || - (it = itimer_find(p, uap->timerid)) == NULL) { + if (timer_id < 3 || (it = itimer_find(p, timer_id)) == NULL) { PROC_UNLOCK(p); error = EINVAL; } else { PROC_UNLOCK(p); itimer_enter(it); - error = CLOCK_CALL(it->it_clockid, timer_gettime, - (it, &val)); + error = CLOCK_CALL(it->it_clockid, timer_gettime, (it, val)); itimer_leave(it); ITIMER_UNLOCK(it); } - if (error == 0) - error = copyout(&val, uap->value, sizeof(val)); return (error); } @@ -1626,7 +1636,7 @@ itimers_event_hook_exit(void *arg, struc panic("unhandled event"); for (; i < TIMER_MAX; ++i) { if ((it = its->its_timers[i]) != NULL) - kern_timer_delete(curthread, i); + kern_ktimer_delete(curthread, i); } if (its->its_timers[0] == NULL && its->its_timers[1] == NULL && Modified: head/sys/sys/syscallsubr.h ============================================================================== --- head/sys/sys/syscallsubr.h Sun Jul 21 19:40:30 2013 (r253529) +++ head/sys/sys/syscallsubr.h Sun Jul 21 19:43:52 2013 (r253530) @@ -228,6 +228,13 @@ int kern_symlink(struct thread *td, char enum uio_seg segflg); int kern_symlinkat(struct thread *td, char *path1, int fd, char *path2, enum uio_seg segflg); +int kern_ktimer_create(struct thread *td, clockid_t clock_id, + struct sigevent *evp, int *timerid, int preset_id); +int kern_ktimer_delete(struct thread *, int); +int kern_ktimer_settime(struct thread *td, int timer_id, int flags, + struct itimerspec *val, struct itimerspec *oval); +int kern_ktimer_gettime(struct thread *td, int timer_id, + struct itimerspec *val); int kern_thr_new(struct thread *td, struct thr_param *param); int kern_thr_suspend(struct thread *td, struct timespec *tsp); int kern_truncate(struct thread *td, char *path, enum uio_seg pathseg, From owner-svn-src-all@FreeBSD.ORG Sun Jul 21 19:44:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 36DDE9C5; Sun, 21 Jul 2013 19:44:55 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 28268F2D; Sun, 21 Jul 2013 19:44:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6LJitD5053222; Sun, 21 Jul 2013 19:44:55 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6LJisO7053215; Sun, 21 Jul 2013 19:44:54 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201307211944.r6LJisO7053215@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 21 Jul 2013 19:44:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253531 - head/sys/compat/freebsd32 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Jul 2013 19:44:55 -0000 Author: kib Date: Sun Jul 21 19:44:53 2013 New Revision: 253531 URL: http://svnweb.freebsd.org/changeset/base/253531 Log: Regenerate. Modified: head/sys/compat/freebsd32/freebsd32_proto.h head/sys/compat/freebsd32/freebsd32_syscall.h head/sys/compat/freebsd32/freebsd32_syscalls.c head/sys/compat/freebsd32/freebsd32_sysent.c head/sys/compat/freebsd32/freebsd32_systrace_args.c Modified: head/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_proto.h Sun Jul 21 19:43:52 2013 (r253530) +++ head/sys/compat/freebsd32/freebsd32_proto.h Sun Jul 21 19:44:53 2013 (r253531) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 253494 2013-07-20 13:39:41Z kib + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 253530 2013-07-21 19:43:52Z kib */ #ifndef _FREEBSD32_SYSPROTO_H_ @@ -208,6 +208,21 @@ struct freebsd32_clock_getres_args { char clock_id_l_[PADL_(clockid_t)]; clockid_t clock_id; char clock_id_r_[PADR_(clockid_t)]; char tp_l_[PADL_(struct timespec32 *)]; struct timespec32 * tp; char tp_r_[PADR_(struct timespec32 *)]; }; +struct freebsd32_ktimer_create_args { + char clock_id_l_[PADL_(clockid_t)]; clockid_t clock_id; char clock_id_r_[PADR_(clockid_t)]; + char evp_l_[PADL_(struct sigevent32 *)]; struct sigevent32 * evp; char evp_r_[PADR_(struct sigevent32 *)]; + char timerid_l_[PADL_(int *)]; int * timerid; char timerid_r_[PADR_(int *)]; +}; +struct freebsd32_ktimer_settime_args { + char timerid_l_[PADL_(int)]; int timerid; char timerid_r_[PADR_(int)]; + char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; + char value_l_[PADL_(const struct itimerspec32 *)]; const struct itimerspec32 * value; char value_r_[PADR_(const struct itimerspec32 *)]; + char ovalue_l_[PADL_(struct itimerspec32 *)]; struct itimerspec32 * ovalue; char ovalue_r_[PADR_(struct itimerspec32 *)]; +}; +struct freebsd32_ktimer_gettime_args { + char timerid_l_[PADL_(int)]; int timerid; char timerid_r_[PADR_(int)]; + char value_l_[PADL_(struct itimerspec32 *)]; struct itimerspec32 * value; char value_r_[PADR_(struct itimerspec32 *)]; +}; struct freebsd32_nanosleep_args { char rqtp_l_[PADL_(const struct timespec32 *)]; const struct timespec32 * rqtp; char rqtp_r_[PADR_(const struct timespec32 *)]; char rmtp_l_[PADL_(struct timespec32 *)]; struct timespec32 * rmtp; char rmtp_r_[PADR_(struct timespec32 *)]; @@ -228,7 +243,7 @@ struct freebsd32_lio_listio_args { char mode_l_[PADL_(int)]; int mode; char mode_r_[PADR_(int)]; char acb_list_l_[PADL_(struct aiocb32 *const *)]; struct aiocb32 *const * acb_list; char acb_list_r_[PADR_(struct aiocb32 *const *)]; char nent_l_[PADL_(int)]; int nent; char nent_r_[PADR_(int)]; - char sig_l_[PADL_(struct sigevent *)]; struct sigevent * sig; char sig_r_[PADR_(struct sigevent *)]; + char sig_l_[PADL_(struct sigevent32 *)]; struct sigevent32 * sig; char sig_r_[PADR_(struct sigevent32 *)]; }; struct freebsd32_lutimes_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; @@ -400,6 +415,10 @@ struct freebsd32_kmq_timedsend_args { 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_notify_args { + char mqd_l_[PADL_(int)]; int mqd; char mqd_r_[PADR_(int)]; + char sigev_l_[PADL_(const struct sigevent32 *)]; const struct sigevent32 * sigev; char sigev_r_[PADR_(const struct sigevent32 *)]; +}; 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 *)]; @@ -673,6 +692,9 @@ int freebsd32_msgrcv(struct thread *, st int freebsd32_clock_gettime(struct thread *, struct freebsd32_clock_gettime_args *); int freebsd32_clock_settime(struct thread *, struct freebsd32_clock_settime_args *); int freebsd32_clock_getres(struct thread *, struct freebsd32_clock_getres_args *); +int freebsd32_ktimer_create(struct thread *, struct freebsd32_ktimer_create_args *); +int freebsd32_ktimer_settime(struct thread *, struct freebsd32_ktimer_settime_args *); +int freebsd32_ktimer_gettime(struct thread *, struct freebsd32_ktimer_gettime_args *); int freebsd32_nanosleep(struct thread *, struct freebsd32_nanosleep_args *); int freebsd32_clock_getcpuclockid2(struct thread *, struct freebsd32_clock_getcpuclockid2_args *); int freebsd32_aio_read(struct thread *, struct freebsd32_aio_read_args *); @@ -714,6 +736,7 @@ int freebsd32_kmq_open(struct thread *, 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_kmq_notify(struct thread *, struct freebsd32_kmq_notify_args *); int freebsd32_aio_fsync(struct thread *, struct freebsd32_aio_fsync_args *); #ifdef PAD64_REQUIRED int freebsd32_pread(struct thread *, struct freebsd32_pread_args *); @@ -1072,6 +1095,9 @@ int freebsd7_freebsd32_shmctl(struct thr #define FREEBSD32_SYS_AUE_freebsd32_clock_gettime AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_clock_settime AUE_CLOCK_SETTIME #define FREEBSD32_SYS_AUE_freebsd32_clock_getres AUE_NULL +#define FREEBSD32_SYS_AUE_freebsd32_ktimer_create AUE_NULL +#define FREEBSD32_SYS_AUE_freebsd32_ktimer_settime AUE_NULL +#define FREEBSD32_SYS_AUE_freebsd32_ktimer_gettime AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_nanosleep AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_clock_getcpuclockid2 AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_aio_read AUE_NULL @@ -1117,6 +1143,7 @@ int freebsd7_freebsd32_shmctl(struct thr #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_kmq_notify 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: head/sys/compat/freebsd32/freebsd32_syscall.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscall.h Sun Jul 21 19:43:52 2013 (r253530) +++ head/sys/compat/freebsd32/freebsd32_syscall.h Sun Jul 21 19:44:53 2013 (r253531) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 253494 2013-07-20 13:39:41Z kib + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 253530 2013-07-21 19:43:52Z kib */ #define FREEBSD32_SYS_syscall 0 @@ -206,6 +206,11 @@ #define FREEBSD32_SYS_freebsd32_clock_gettime 232 #define FREEBSD32_SYS_freebsd32_clock_settime 233 #define FREEBSD32_SYS_freebsd32_clock_getres 234 +#define FREEBSD32_SYS_freebsd32_ktimer_create 235 +#define FREEBSD32_SYS_ktimer_delete 236 +#define FREEBSD32_SYS_freebsd32_ktimer_settime 237 +#define FREEBSD32_SYS_freebsd32_ktimer_gettime 238 +#define FREEBSD32_SYS_ktimer_getoverrun 239 #define FREEBSD32_SYS_freebsd32_nanosleep 240 #define FREEBSD32_SYS_ffclock_getcounter 241 #define FREEBSD32_SYS_ffclock_setestimate 242 @@ -360,7 +365,7 @@ #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_freebsd32_kmq_notify 461 #define FREEBSD32_SYS_kmq_unlink 462 #define FREEBSD32_SYS_abort2 463 #define FREEBSD32_SYS_thr_set_name 464 Modified: head/sys/compat/freebsd32/freebsd32_syscalls.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscalls.c Sun Jul 21 19:43:52 2013 (r253530) +++ head/sys/compat/freebsd32/freebsd32_syscalls.c Sun Jul 21 19:44:53 2013 (r253531) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 253494 2013-07-20 13:39:41Z kib + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 253530 2013-07-21 19:43:52Z kib */ const char *freebsd32_syscallnames[] = { @@ -245,11 +245,11 @@ const char *freebsd32_syscallnames[] = { "freebsd32_clock_gettime", /* 232 = freebsd32_clock_gettime */ "freebsd32_clock_settime", /* 233 = freebsd32_clock_settime */ "freebsd32_clock_getres", /* 234 = freebsd32_clock_getres */ - "#235", /* 235 = timer_create */ - "#236", /* 236 = timer_delete */ - "#237", /* 237 = timer_settime */ - "#238", /* 238 = timer_gettime */ - "#239", /* 239 = timer_getoverrun */ + "freebsd32_ktimer_create", /* 235 = freebsd32_ktimer_create */ + "ktimer_delete", /* 236 = ktimer_delete */ + "freebsd32_ktimer_settime", /* 237 = freebsd32_ktimer_settime */ + "freebsd32_ktimer_gettime", /* 238 = freebsd32_ktimer_gettime */ + "ktimer_getoverrun", /* 239 = ktimer_getoverrun */ "freebsd32_nanosleep", /* 240 = freebsd32_nanosleep */ "ffclock_getcounter", /* 241 = ffclock_getcounter */ "ffclock_setestimate", /* 242 = ffclock_setestimate */ @@ -471,7 +471,7 @@ const char *freebsd32_syscallnames[] = { "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 */ + "freebsd32_kmq_notify", /* 461 = freebsd32_kmq_notify */ "kmq_unlink", /* 462 = kmq_unlink */ "abort2", /* 463 = abort2 */ "thr_set_name", /* 464 = thr_set_name */ Modified: head/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_sysent.c Sun Jul 21 19:43:52 2013 (r253530) +++ head/sys/compat/freebsd32/freebsd32_sysent.c Sun Jul 21 19:44:53 2013 (r253531) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 253494 2013-07-20 13:39:41Z kib + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 253530 2013-07-21 19:43:52Z kib */ #include "opt_compat.h" @@ -282,11 +282,11 @@ struct sysent freebsd32_sysent[] = { { AS(freebsd32_clock_gettime_args), (sy_call_t *)freebsd32_clock_gettime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 232 = freebsd32_clock_gettime */ { AS(freebsd32_clock_settime_args), (sy_call_t *)freebsd32_clock_settime, AUE_CLOCK_SETTIME, NULL, 0, 0, 0, SY_THR_STATIC }, /* 233 = freebsd32_clock_settime */ { AS(freebsd32_clock_getres_args), (sy_call_t *)freebsd32_clock_getres, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 234 = freebsd32_clock_getres */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 235 = timer_create */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 236 = timer_delete */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 237 = timer_settime */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 238 = timer_gettime */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 239 = timer_getoverrun */ + { AS(freebsd32_ktimer_create_args), (sy_call_t *)freebsd32_ktimer_create, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 235 = freebsd32_ktimer_create */ + { AS(ktimer_delete_args), (sy_call_t *)sys_ktimer_delete, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 236 = ktimer_delete */ + { AS(freebsd32_ktimer_settime_args), (sy_call_t *)freebsd32_ktimer_settime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 237 = freebsd32_ktimer_settime */ + { AS(freebsd32_ktimer_gettime_args), (sy_call_t *)freebsd32_ktimer_gettime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 238 = freebsd32_ktimer_gettime */ + { AS(ktimer_getoverrun_args), (sy_call_t *)sys_ktimer_getoverrun, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 239 = ktimer_getoverrun */ { AS(freebsd32_nanosleep_args), (sy_call_t *)freebsd32_nanosleep, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 240 = freebsd32_nanosleep */ { AS(ffclock_getcounter_args), (sy_call_t *)sys_ffclock_getcounter, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 241 = ffclock_getcounter */ { AS(ffclock_setestimate_args), (sy_call_t *)sys_ffclock_setestimate, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 242 = ffclock_setestimate */ @@ -508,7 +508,7 @@ struct sysent freebsd32_sysent[] = { { AS(freebsd32_kmq_setattr_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 458 = freebsd32_kmq_setattr */ { AS(freebsd32_kmq_timedreceive_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 459 = freebsd32_kmq_timedreceive */ { AS(freebsd32_kmq_timedsend_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 460 = freebsd32_kmq_timedsend */ - { AS(kmq_notify_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 461 = kmq_notify */ + { AS(freebsd32_kmq_notify_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 461 = freebsd32_kmq_notify */ { AS(kmq_unlink_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 462 = kmq_unlink */ { AS(abort2_args), (sy_call_t *)sys_abort2, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 463 = abort2 */ { AS(thr_set_name_args), (sy_call_t *)sys_thr_set_name, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 464 = thr_set_name */ Modified: head/sys/compat/freebsd32/freebsd32_systrace_args.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_systrace_args.c Sun Jul 21 19:43:52 2013 (r253530) +++ head/sys/compat/freebsd32/freebsd32_systrace_args.c Sun Jul 21 19:44:53 2013 (r253531) @@ -1195,6 +1195,47 @@ systrace_args(int sysnum, void *params, *n_args = 2; break; } + /* freebsd32_ktimer_create */ + case 235: { + struct freebsd32_ktimer_create_args *p = params; + iarg[0] = p->clock_id; /* clockid_t */ + uarg[1] = (intptr_t) p->evp; /* struct sigevent32 * */ + uarg[2] = (intptr_t) p->timerid; /* int * */ + *n_args = 3; + break; + } + /* ktimer_delete */ + case 236: { + struct ktimer_delete_args *p = params; + iarg[0] = p->timerid; /* int */ + *n_args = 1; + break; + } + /* freebsd32_ktimer_settime */ + case 237: { + struct freebsd32_ktimer_settime_args *p = params; + iarg[0] = p->timerid; /* int */ + iarg[1] = p->flags; /* int */ + uarg[2] = (intptr_t) p->value; /* const struct itimerspec32 * */ + uarg[3] = (intptr_t) p->ovalue; /* struct itimerspec32 * */ + *n_args = 4; + break; + } + /* freebsd32_ktimer_gettime */ + case 238: { + struct freebsd32_ktimer_gettime_args *p = params; + iarg[0] = p->timerid; /* int */ + uarg[1] = (intptr_t) p->value; /* struct itimerspec32 * */ + *n_args = 2; + break; + } + /* ktimer_getoverrun */ + case 239: { + struct ktimer_getoverrun_args *p = params; + iarg[0] = p->timerid; /* int */ + *n_args = 1; + break; + } /* freebsd32_nanosleep */ case 240: { struct freebsd32_nanosleep_args *p = params; @@ -1293,7 +1334,7 @@ systrace_args(int sysnum, void *params, iarg[0] = p->mode; /* int */ uarg[1] = (intptr_t) p->acb_list; /* struct aiocb32 *const * */ iarg[2] = p->nent; /* int */ - uarg[3] = (intptr_t) p->sig; /* struct sigevent * */ + uarg[3] = (intptr_t) p->sig; /* struct sigevent32 * */ *n_args = 4; break; } @@ -2406,11 +2447,11 @@ systrace_args(int sysnum, void *params, *n_args = 5; break; } - /* kmq_notify */ + /* freebsd32_kmq_notify */ case 461: { - struct kmq_notify_args *p = params; + struct freebsd32_kmq_notify_args *p = params; iarg[0] = p->mqd; /* int */ - uarg[1] = (intptr_t) p->sigev; /* const struct sigevent * */ + uarg[1] = (intptr_t) p->sigev; /* const struct sigevent32 * */ *n_args = 2; break; } @@ -5110,6 +5151,74 @@ systrace_entry_setargdesc(int sysnum, in break; }; break; + /* freebsd32_ktimer_create */ + case 235: + switch(ndx) { + case 0: + p = "clockid_t"; + break; + case 1: + p = "struct sigevent32 *"; + break; + case 2: + p = "int *"; + break; + default: + break; + }; + break; + /* ktimer_delete */ + case 236: + switch(ndx) { + case 0: + p = "int"; + break; + default: + break; + }; + break; + /* freebsd32_ktimer_settime */ + case 237: + switch(ndx) { + case 0: + p = "int"; + break; + case 1: + p = "int"; + break; + case 2: + p = "const struct itimerspec32 *"; + break; + case 3: + p = "struct itimerspec32 *"; + break; + default: + break; + }; + break; + /* freebsd32_ktimer_gettime */ + case 238: + switch(ndx) { + case 0: + p = "int"; + break; + case 1: + p = "struct itimerspec32 *"; + break; + default: + break; + }; + break; + /* ktimer_getoverrun */ + case 239: + switch(ndx) { + case 0: + p = "int"; + break; + default: + break; + }; + break; /* freebsd32_nanosleep */ case 240: switch(ndx) { @@ -5266,7 +5375,7 @@ systrace_entry_setargdesc(int sysnum, in p = "int"; break; case 3: - p = "struct sigevent *"; + p = "struct sigevent32 *"; break; default: break; @@ -7121,14 +7230,14 @@ systrace_entry_setargdesc(int sysnum, in break; }; break; - /* kmq_notify */ + /* freebsd32_kmq_notify */ case 461: switch(ndx) { case 0: p = "int"; break; case 1: - p = "const struct sigevent *"; + p = "const struct sigevent32 *"; break; default: break; @@ -9336,6 +9445,31 @@ systrace_return_setargdesc(int sysnum, i if (ndx == 0 || ndx == 1) p = "int"; break; + /* freebsd32_ktimer_create */ + case 235: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* ktimer_delete */ + case 236: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* freebsd32_ktimer_settime */ + case 237: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* freebsd32_ktimer_gettime */ + case 238: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* ktimer_getoverrun */ + case 239: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* freebsd32_nanosleep */ case 240: if (ndx == 0 || ndx == 1) @@ -10056,7 +10190,7 @@ systrace_return_setargdesc(int sysnum, i if (ndx == 0 || ndx == 1) p = "int"; break; - /* kmq_notify */ + /* freebsd32_kmq_notify */ case 461: if (ndx == 0 || ndx == 1) p = "int"; From owner-svn-src-all@FreeBSD.ORG Sun Jul 21 20:45:24 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9006E575; Sun, 21 Jul 2013 20:45:24 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 66A72191; Sun, 21 Jul 2013 20:45:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6LKjNEd077667; Sun, 21 Jul 2013 20:45:23 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6LKjNMU077666; Sun, 21 Jul 2013 20:45:23 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201307212045.r6LKjNMU077666@svn.freebsd.org> From: Hans Petter Selasky Date: Sun, 21 Jul 2013 20:45:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253532 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Jul 2013 20:45:24 -0000 Author: hselasky Date: Sun Jul 21 20:45:23 2013 New Revision: 253532 URL: http://svnweb.freebsd.org/changeset/base/253532 Log: Fix an XHCI regression: The Block Event Interrupts, BEI, feature does not work like expected with the Renesas XHCI chipsets. Revert feature. While at it correct the TD SIZE computation in case of Zero Length Packet, ZLP, in the end of a multi frame USB transfer. MFC after: 1 week PR: usb/180726 Modified: head/sys/dev/usb/controller/xhci.c Modified: head/sys/dev/usb/controller/xhci.c ============================================================================== --- head/sys/dev/usb/controller/xhci.c Sun Jul 21 19:44:53 2013 (r253531) +++ head/sys/dev/usb/controller/xhci.c Sun Jul 21 20:45:23 2013 (r253532) @@ -1682,7 +1682,6 @@ restart: /* fill out buffer pointers */ if (average == 0) { - npkt = 0; memset(&buf_res, 0, sizeof(buf_res)); } else { usbd_get_page(temp->pc, temp->offset + @@ -1697,15 +1696,17 @@ restart: buf_res.length = XHCI_TD_PAGE_SIZE; npkt_off += buf_res.length; - - /* setup npkt */ - npkt = (len_old - npkt_off + temp->max_packet_size - 1) / - temp->max_packet_size; - - if (npkt > 31) - npkt = 31; } + /* setup npkt */ + npkt = (len_old - npkt_off + temp->max_packet_size - 1) / + temp->max_packet_size; + + if (npkt == 0) + npkt = 1; + else if (npkt > 31) + npkt = 31; + /* fill out TRB's */ td->td_trb[x].qwTrb0 = htole64((uint64_t)buf_res.physaddr); @@ -1719,9 +1720,7 @@ restart: switch (temp->trb_type) { case XHCI_TRB_TYPE_ISOCH: - /* BEI: Interrupts are inhibited until EOT */ dword = XHCI_TRB_3_CHAIN_BIT | XHCI_TRB_3_CYCLE_BIT | - XHCI_TRB_3_BEI_BIT | XHCI_TRB_3_TBC_SET(temp->tbc) | XHCI_TRB_3_TLBPC_SET(temp->tlbpc); if (td != td_first) { @@ -1756,10 +1755,8 @@ restart: dword |= XHCI_TRB_3_DIR_IN; break; default: /* XHCI_TRB_TYPE_NORMAL */ - /* BEI: Interrupts are inhibited until EOT */ dword = XHCI_TRB_3_CHAIN_BIT | XHCI_TRB_3_CYCLE_BIT | XHCI_TRB_3_TYPE_SET(XHCI_TRB_TYPE_NORMAL) | - XHCI_TRB_3_BEI_BIT | XHCI_TRB_3_TBC_SET(temp->tbc) | XHCI_TRB_3_TLBPC_SET(temp->tlbpc); if (temp->direction == UE_DIR_IN) @@ -1838,6 +1835,7 @@ restart: usb_pc_cpu_flush(td_first->page_cache); } + /* clear TD SIZE to zero, hence this is the last TRB */ /* remove chain bit because this is the last TRB in the chain */ td->td_trb[td->ntrb - 1].dwTrb2 &= ~htole32(XHCI_TRB_2_TDSZ_SET(15)); td->td_trb[td->ntrb - 1].dwTrb3 &= ~htole32(XHCI_TRB_3_CHAIN_BIT); From owner-svn-src-all@FreeBSD.ORG Mon Jul 22 00:44:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 327AB5B0; Mon, 22 Jul 2013 00:44:38 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 245381AE1; Mon, 22 Jul 2013 00:44:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6M0icm7002016; Mon, 22 Jul 2013 00:44:38 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6M0ibWR002015; Mon, 22 Jul 2013 00:44:37 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201307220044.r6M0ibWR002015@svn.freebsd.org> From: Mateusz Guzik Date: Mon, 22 Jul 2013 00:44:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253537 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Jul 2013 00:44:38 -0000 Author: mjg Date: Mon Jul 22 00:44:37 2013 New Revision: 253537 URL: http://svnweb.freebsd.org/changeset/base/253537 Log: Remove duplicate assertion from tdsendsignal. MFC after: 2 weeks Modified: head/sys/kern/kern_sig.c Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Sun Jul 21 23:10:45 2013 (r253536) +++ head/sys/kern/kern_sig.c Mon Jul 22 00:44:37 2013 (r253537) @@ -2063,10 +2063,8 @@ tdsendsignal(struct proc *p, struct thre if (td == NULL) { td = sigtd(p, sig, prop); sigqueue = &p->p_sigqueue; - } else { - KASSERT(td->td_proc == p, ("invalid thread")); + } else sigqueue = &td->td_sigqueue; - } SDT_PROBE(proc, kernel, , signal_send, td, p, sig, 0, 0 ); From owner-svn-src-all@FreeBSD.ORG Mon Jul 22 02:07:16 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 531B3D99; Mon, 22 Jul 2013 02:07:16 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 43BD41CB6; Mon, 22 Jul 2013 02:07:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6M27Gvn068483; Mon, 22 Jul 2013 02:07:16 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6M27Gt2068482; Mon, 22 Jul 2013 02:07:16 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201307220207.r6M27Gt2068482@svn.freebsd.org> From: Mateusz Guzik Date: Mon, 22 Jul 2013 02:07:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253538 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Jul 2013 02:07:16 -0000 Author: mjg Date: Mon Jul 22 02:07:15 2013 New Revision: 253538 URL: http://svnweb.freebsd.org/changeset/base/253538 Log: Remove cr_prison NULL check from proc_to_reap. Userspace processes always have a prison. MFC after: 2 weeks Modified: head/sys/kern/kern_exit.c Modified: head/sys/kern/kern_exit.c ============================================================================== --- head/sys/kern/kern_exit.c Mon Jul 22 00:44:37 2013 (r253537) +++ head/sys/kern/kern_exit.c Mon Jul 22 02:07:15 2013 (r253538) @@ -918,8 +918,7 @@ proc_to_reap(struct thread *td, struct p } break; case P_JAILID: - if (p->p_ucred->cr_prison == NULL || - (p->p_ucred->cr_prison->pr_id != (int)id)) { + if (p->p_ucred->cr_prison->pr_id != (int)id) { PROC_UNLOCK(p); return (0); } From owner-svn-src-all@FreeBSD.ORG Mon Jul 22 03:55:15 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A894D7A9; Mon, 22 Jul 2013 03:55:15 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9AABF2095; Mon, 22 Jul 2013 03:55:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6M3tFLP002069; Mon, 22 Jul 2013 03:55:15 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6M3tF7O002068; Mon, 22 Jul 2013 03:55:15 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201307220355.r6M3tF7O002068@svn.freebsd.org> From: Warner Losh Date: Mon, 22 Jul 2013 03:55:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253539 - head/sys/mips/cavium X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Jul 2013 03:55:15 -0000 Author: imp Date: Mon Jul 22 03:55:15 2013 New Revision: 253539 URL: http://svnweb.freebsd.org/changeset/base/253539 Log: This file isn't derived from anything delivered by Berkeley, so remove this statement. Modified: head/sys/mips/cavium/std.octeon1 Modified: head/sys/mips/cavium/std.octeon1 ============================================================================== --- head/sys/mips/cavium/std.octeon1 Mon Jul 22 02:07:15 2013 (r253538) +++ head/sys/mips/cavium/std.octeon1 Mon Jul 22 03:55:15 2013 (r253539) @@ -1,7 +1,3 @@ -# /* -# * This product includes software developed by the University of -# * California, Berkeley and its contributors." -# */ # $FreeBSD$ # files "../cavium/files.octeon1" From owner-svn-src-all@FreeBSD.ORG Mon Jul 22 05:45:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A8E7B532; Mon, 22 Jul 2013 05:45:55 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 80F9B22DE; Mon, 22 Jul 2013 05:45:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6M5jtvs035021; Mon, 22 Jul 2013 05:45:55 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6M5js9g035020; Mon, 22 Jul 2013 05:45:54 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201307220545.r6M5js9g035020@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 22 Jul 2013 05:45:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253540 - head/sys/dev/bge X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Jul 2013 05:45:55 -0000 Author: yongari Date: Mon Jul 22 05:45:54 2013 New Revision: 253540 URL: http://svnweb.freebsd.org/changeset/base/253540 Log: 5725 family of devices corrupts TSO packets when TSO DMA buffers cross into regions which are within MSS bytes of a 4GB boundary. If we encounter the condition, drop the packet. Reviewed by: Geans Pin geanspin@Broacom Modified: head/sys/dev/bge/if_bge.c Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Mon Jul 22 03:55:15 2013 (r253539) +++ head/sys/dev/bge/if_bge.c Mon Jul 22 05:45:54 2013 (r253540) @@ -5257,17 +5257,51 @@ bge_encap(struct bge_softc *sc, struct m csum_flags |= BGE_TXBDFLAG_VLAN_TAG; vlan_tag = m->m_pkthdr.ether_vtag; } - for (i = 0; ; i++) { - d = &sc->bge_ldata.bge_tx_ring[idx]; - d->bge_addr.bge_addr_lo = BGE_ADDR_LO(segs[i].ds_addr); - d->bge_addr.bge_addr_hi = BGE_ADDR_HI(segs[i].ds_addr); - d->bge_len = segs[i].ds_len; - d->bge_flags = csum_flags; - d->bge_vlan_tag = vlan_tag; - d->bge_mss = mss; - if (i == nsegs - 1) - break; - BGE_INC(idx, BGE_TX_RING_CNT); + + if (sc->bge_asicrev == BGE_ASICREV_BCM5762 && + (m->m_pkthdr.csum_flags & CSUM_TSO) != 0) { + /* + * 5725 family of devices corrupts TSO packets when TSO DMA + * buffers cross into regions which are within MSS bytes of + * a 4GB boundary. If we encounter the condition, drop the + * packet. + */ + for (i = 0; ; i++) { + d = &sc->bge_ldata.bge_tx_ring[idx]; + d->bge_addr.bge_addr_lo = BGE_ADDR_LO(segs[i].ds_addr); + d->bge_addr.bge_addr_hi = BGE_ADDR_HI(segs[i].ds_addr); + d->bge_len = segs[i].ds_len; + if (d->bge_addr.bge_addr_lo + segs[i].ds_len + mss < + d->bge_addr.bge_addr_lo) + break; + d->bge_flags = csum_flags; + d->bge_vlan_tag = vlan_tag; + d->bge_mss = mss; + if (i == nsegs - 1) + break; + BGE_INC(idx, BGE_TX_RING_CNT); + } + if (i != nsegs - 1) { + bus_dmamap_sync(sc->bge_cdata.bge_tx_mtag, map, + BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(sc->bge_cdata.bge_tx_mtag, map); + m_freem(*m_head); + *m_head = NULL; + return (EIO); + } + } else { + for (i = 0; ; i++) { + d = &sc->bge_ldata.bge_tx_ring[idx]; + d->bge_addr.bge_addr_lo = BGE_ADDR_LO(segs[i].ds_addr); + d->bge_addr.bge_addr_hi = BGE_ADDR_HI(segs[i].ds_addr); + d->bge_len = segs[i].ds_len; + d->bge_flags = csum_flags; + d->bge_vlan_tag = vlan_tag; + d->bge_mss = mss; + if (i == nsegs - 1) + break; + BGE_INC(idx, BGE_TX_RING_CNT); + } } /* Mark the last segment as end of packet... */ From owner-svn-src-all@FreeBSD.ORG Mon Jul 22 06:55:40 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id EC0FEF5A; Mon, 22 Jul 2013 06:55:40 +0000 (UTC) Date: Mon, 22 Jul 2013 06:55:40 +0000 From: Alexey Dokuchaev To: Devin Teske Subject: Re: svn commit: r253513 - head/release Message-ID: <20130722065540.GA74176@FreeBSD.org> References: <201307210523.r6L5NYqh084679@svn.freebsd.org> <20130721133915.GA36573@FreeBSD.org> <13CA24D6AB415D428143D44749F57D7201FD2BF2@ltcfiswmsgmb21> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <13CA24D6AB415D428143D44749F57D7201FD2BF2@ltcfiswmsgmb21> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: "svn-src-head@freebsd.org" , Glen Barber , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Jul 2013 06:55:41 -0000 On Sun, Jul 21, 2013 at 04:17:26PM +0000, Teske, Devin wrote: > On Jul 21, 2013, at 6:39 AM, Alexey Dokuchaev wrote: > > Is there any work being done to merge the .iso and .img into single, > > hybrid bootable image (c.g. Haiku)? I've asked this question before, > > but I cannot recall now what was the outcome if it... > > I have been doing this for years @ $work with sysinstall. [...] > > P.S. It's *so* much more than *just* taking the installer and Hybridizing > it to work with CD versus USB seamlessly. The "Druid" line is a master- > work that took 7 years to produce. > > P.P.S. Been working on rewriting other aspects of the installer before we > revisit the idea of merging Druid components to achieve what you're > asking. For now, we have the Druid to show us a proof-of-concept that it's > not only achievable, but it's damned slick when you do get to the > hybridized arena. Undersood, thanks for the info. Looking forward to see it merged one day to both installer and release generation code. ./danfe From owner-svn-src-all@FreeBSD.ORG Mon Jul 22 08:46:15 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E6536B72; Mon, 22 Jul 2013 08:46:15 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BEBA32AE2; Mon, 22 Jul 2013 08:46:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6M8kFhX090047; Mon, 22 Jul 2013 08:46:15 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6M8kFOw090046; Mon, 22 Jul 2013 08:46:15 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201307220846.r6M8kFOw090046@svn.freebsd.org> From: Colin Percival Date: Mon, 22 Jul 2013 08:46:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253541 - head/contrib/openbsm/m4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Jul 2013 08:46:16 -0000 Author: cperciva Date: Mon Jul 22 08:46:15 2013 New Revision: 253541 URL: http://svnweb.freebsd.org/changeset/base/253541 Log: Remove weirdly-named autofoo file. This is not needed for the (FreeBSD) build, and freebsd-update chokes on it. 9.2-RELEASE candidate. Approved by: rwatson MFC after: 3 days Deleted: head/contrib/openbsm/m4/lt~obsolete.m4 From owner-svn-src-all@FreeBSD.ORG Mon Jul 22 12:07:58 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 422E5F67; Mon, 22 Jul 2013 12:07:58 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3379529FD; Mon, 22 Jul 2013 12:07:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6MC7wwp050440; Mon, 22 Jul 2013 12:07:58 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6MC7wZa050439; Mon, 22 Jul 2013 12:07:58 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201307221207.r6MC7wZa050439@svn.freebsd.org> From: Glen Barber Date: Mon, 22 Jul 2013 12:07:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253542 - head/release X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Jul 2013 12:07:58 -0000 Author: gjb Date: Mon Jul 22 12:07:57 2013 New Revision: 253542 URL: http://svnweb.freebsd.org/changeset/base/253542 Log: For consistency with previous releases, name the cdrom install cd 'disc1.iso'. Discussed with: re@ team Approved by: kib (mentor) MFC after: 3 days X-MFC-To: stable/9 only Modified: head/release/Makefile Modified: head/release/Makefile ============================================================================== --- head/release/Makefile Mon Jul 22 08:46:15 2013 (r253541) +++ head/release/Makefile Mon Jul 22 12:07:57 2013 (r253542) @@ -3,7 +3,7 @@ # Makefile for building releases and release media. # # User-driven targets: -# cdrom: Builds release CD-ROM media (release.iso) +# cdrom: Builds release CD-ROM media (disc1.iso) # memstick: Builds memory stick image (memstick.img) # ftp: Sets up FTP distribution area (ftp) # release: Build all media and FTP distribution area @@ -70,7 +70,7 @@ RELEASE_TARGETS= ftp IMAGES= .if exists(${.CURDIR}/${TARGET}/mkisoimages.sh) RELEASE_TARGETS+= cdrom -IMAGES+= release.iso bootonly.iso +IMAGES+= disc1.iso bootonly.iso .endif .if exists(${.CURDIR}/${TARGET}/make-memstick.sh) RELEASE_TARGETS+= memstick.img @@ -161,7 +161,8 @@ bootonly: packagesystem echo hostid_enable=\"NO\" >> bootonly/etc/rc.conf cp ${.CURDIR}/rc.local bootonly/etc -release.iso: system +release.iso: disc1.iso +disc1.iso: system sh ${.CURDIR}/${TARGET}/mkisoimages.sh -b FreeBSD_Install ${.TARGET} release bootonly.iso: bootonly @@ -175,7 +176,7 @@ packagesystem: base.txz kernel.txz ${EXT sh ${.CURDIR}/scripts/make-manifest.sh *.txz > MANIFEST touch ${.TARGET} -cdrom: release.iso bootonly.iso +cdrom: disc1.iso bootonly.iso ftp: packagesystem rm -rf ftp mkdir -p ftp @@ -192,7 +193,7 @@ clean: rm -f *.txz MANIFEST rm -f system rm -rf release bootonly - rm -f release.iso bootonly.iso memstick.img + rm -f disc1.iso bootonly.iso memstick.img install: .if defined(DESTDIR) && !empty(DESTDIR) From owner-svn-src-all@FreeBSD.ORG Mon Jul 22 12:56:50 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BEBE51F7; Mon, 22 Jul 2013 12:56:50 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id ABE102C84; Mon, 22 Jul 2013 12:56:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6MCuoqq065265; Mon, 22 Jul 2013 12:56:50 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6MCuoge065264; Mon, 22 Jul 2013 12:56:50 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201307221256.r6MCuoge065264@svn.freebsd.org> From: Gavin Atkinson Date: Mon, 22 Jul 2013 12:56:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253543 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Jul 2013 12:56:50 -0000 Author: gavin Date: Mon Jul 22 12:56:50 2013 New Revision: 253543 URL: http://svnweb.freebsd.org/changeset/base/253543 Log: Update mirror list to more closely match http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/mirrors-ftp.html MFC after: 1 week Modified: head/usr.sbin/bsdinstall/scripts/mirrorselect Modified: head/usr.sbin/bsdinstall/scripts/mirrorselect ============================================================================== --- head/usr.sbin/bsdinstall/scripts/mirrorselect Mon Jul 22 12:07:57 2013 (r253542) +++ head/usr.sbin/bsdinstall/scripts/mirrorselect Mon Jul 22 12:56:50 2013 (r253543) @@ -41,7 +41,6 @@ MIRROR=`dialog --backtitle "FreeBSD Inst ftp://ftp.freebsd.org "Main Site"\ ftp://ftp.freebsd.org "IPv6 Main Site"\ ftp://ftp3.ie.freebsd.org "IPv6 Ireland"\ - ftp://ftp.il.freebsd.org "IPv6 Israel"\ ftp://ftp2.jp.freebsd.org "IPv6 Japan"\ ftp://ftp4.se.freebsd.org "IPv6 Sweden"\ ftp://ftp4.us.freebsd.org "IPv6 USA"\ @@ -53,45 +52,34 @@ MIRROR=`dialog --backtitle "FreeBSD Inst ftp://ftp5.freebsd.org "Primary #5"\ ftp://ftp6.freebsd.org "Primary #6"\ ftp://ftp7.freebsd.org "Primary #7"\ - ftp://ftp8.freebsd.org "Primary #8"\ - ftp://ftp9.freebsd.org "Primary #9"\ ftp://ftp10.freebsd.org "Primary #10"\ ftp://ftp11.freebsd.org "Primary #11"\ ftp://ftp12.freebsd.org "Primary #12"\ ftp://ftp13.freebsd.org "Primary #13"\ ftp://ftp14.freebsd.org "Primary #14"\ - ftp://ftp.ar.freebsd.org "Argentina"\ + ftp://ftp1.am.freebsd.org "Armenia"\ ftp://ftp.au.freebsd.org "Australia"\ ftp://ftp2.au.freebsd.org "Australia #2"\ ftp://ftp3.au.freebsd.org "Australia #3"\ ftp://ftp.at.freebsd.org "Austria"\ - ftp://ftp2.at.freebsd.org "Austria #2"\ - ftp://ftp.br.freebsd.org "Brazil"\ ftp://ftp2.br.freebsd.org "Brazil #2"\ ftp://ftp3.br.freebsd.org "Brazil #3"\ ftp://ftp4.br.freebsd.org "Brazil #4"\ - ftp://ftp5.br.freebsd.org "Brazil #5"\ - ftp://ftp6.br.freebsd.org "Brazil #6"\ - ftp://ftp7.br.freebsd.org "Brazil #7"\ ftp://ftp.ca.freebsd.org "Canada"\ ftp://ftp.cn.freebsd.org "China"\ - ftp://ftp2.cn.freebsd.org "China #2"\ - ftp://ftp.hr.freebsd.org "Croatia"\ ftp://ftp.cz.freebsd.org "Czech Republic"\ ftp://ftp.dk.freebsd.org "Denmark"\ - ftp://ftp2.dk.freebsd.org "Denmark #2"\ ftp://ftp.ee.freebsd.org "Estonia"\ ftp://ftp.fi.freebsd.org "Finland"\ ftp://ftp.fr.freebsd.org "France"\ - ftp://ftp2.fr.freebsd.org "IPv6 France #2"\ ftp://ftp3.fr.freebsd.org "France #3"\ ftp://ftp4.fr.freebsd.org "IPv6 France #4"\ ftp://ftp5.fr.freebsd.org "France #5"\ ftp://ftp6.fr.freebsd.org "France #6"\ + ftp://ftp7.fr.freebsd.org "France #7"\ ftp://ftp8.fr.freebsd.org "IPv6 France #8"\ ftp://ftp.de.freebsd.org "Germany"\ ftp://ftp2.de.freebsd.org "Germany #2"\ - ftp://ftp3.de.freebsd.org "Germany #3"\ ftp://ftp4.de.freebsd.org "Germany #4"\ ftp://ftp5.de.freebsd.org "Germany #5"\ ftp://ftp6.de.freebsd.org "Germany #6"\ @@ -99,10 +87,7 @@ MIRROR=`dialog --backtitle "FreeBSD Inst ftp://ftp8.de.freebsd.org "Germany #8"\ ftp://ftp.gr.freebsd.org "Greece"\ ftp://ftp2.gr.freebsd.org "Greece #2"\ - ftp://ftp.hu.freebsd.org "Hungary"\ ftp://ftp.is.freebsd.org "Iceland"\ - ftp://ftp.ie.freebsd.org "Ireland"\ - ftp://ftp2.ie.freebsd.org "Ireland #2"\ ftp://ftp3.ie.freebsd.org "Ireland #3"\ ftp://ftp.il.freebsd.org "Israel"\ ftp://ftp.it.freebsd.org "Italy"\ @@ -117,32 +102,26 @@ MIRROR=`dialog --backtitle "FreeBSD Inst ftp://ftp9.jp.freebsd.org "Japan #9"\ ftp://ftp.kr.freebsd.org "Korea"\ ftp://ftp2.kr.freebsd.org "Korea #2"\ + ftp://ftp.lv.freebsd.org "Latvia"\ ftp://ftp.lt.freebsd.org "Lithuania"\ ftp://ftp.nl.freebsd.org "Netherlands"\ ftp://ftp2.nl.freebsd.org "Netherlands #2"\ + ftp://ftp.nz.freebsd.org "New Zealand"\ ftp://ftp.no.freebsd.org "Norway"\ - ftp://ftp3.no.freebsd.org "Norway #3"\ ftp://ftp.pl.freebsd.org "Poland"\ ftp://ftp2.pl.freebsd.org "Poland #2"\ - ftp://ftp5.pl.freebsd.org "Poland #5"\ - ftp://ftp.pt.freebsd.org "Portugal"\ - ftp://ftp2.pt.freebsd.org "Portugal #2"\ - ftp://ftp4.pt.freebsd.org "Portugal #4"\ - ftp://ftp.ro.freebsd.org "Romania"\ ftp://ftp.ru.freebsd.org "Russia"\ ftp://ftp2.ru.freebsd.org "Russia #2"\ - ftp://ftp3.ru.freebsd.org "Russia #3"\ ftp://ftp4.ru.freebsd.org "Russia #4"\ - ftp://ftp.sg.freebsd.org "Singapore"\ + ftp://ftp5.ru.freebsd.org "Russia #5"\ + ftp://ftp6.ru.freebsd.org "Russia #6"\ ftp://ftp.sk.freebsd.org "Slovak Republic"\ + ftp://ftp2.sk.freebsd.org "Slovak Republic #2"\ ftp://ftp.si.freebsd.org "Slovenia"\ - ftp://ftp2.si.freebsd.org "Slovenia #2"\ ftp://ftp.za.freebsd.org "South Africa"\ ftp://ftp2.za.freebsd.org "South Africa #2"\ - ftp://ftp3.za.freebsd.org "South Africa #3"\ ftp://ftp4.za.freebsd.org "South Africa #4"\ ftp://ftp.es.freebsd.org "Spain"\ - ftp://ftp2.es.freebsd.org "Spain #2"\ ftp://ftp3.es.freebsd.org "Spain #3"\ ftp://ftp.se.freebsd.org "Sweden"\ ftp://ftp2.se.freebsd.org "Sweden #2"\ @@ -151,39 +130,29 @@ MIRROR=`dialog --backtitle "FreeBSD Inst ftp://ftp5.se.freebsd.org "Sweden #5"\ ftp://ftp6.se.freebsd.org "Sweden #6"\ ftp://ftp.ch.freebsd.org "Switzerland"\ - ftp://ftp2.ch.freebsd.org "Switzerland #2"\ ftp://ftp.tw.freebsd.org "Taiwan"\ ftp://ftp2.tw.freebsd.org "Taiwan #2"\ ftp://ftp3.tw.freebsd.org "Taiwan #3"\ ftp://ftp4.tw.freebsd.org "Taiwan #4"\ ftp://ftp6.tw.freebsd.org "Taiwan #6"\ ftp://ftp11.tw.freebsd.org "Taiwan #11"\ - ftp://ftp.tr.freebsd.org "Turkey"\ ftp://ftp2.tr.freebsd.org "Turkey #2"\ ftp://ftp.uk.freebsd.org "UK"\ ftp://ftp2.uk.freebsd.org "UK #2"\ ftp://ftp3.uk.freebsd.org "UK #3"\ ftp://ftp4.uk.freebsd.org "UK #4"\ ftp://ftp5.uk.freebsd.org "UK #5"\ - ftp://ftp6.uk.freebsd.org "UK #6"\ ftp://ftp.ua.freebsd.org "Ukraine"\ - ftp://ftp2.ua.freebsd.org "Ukraine #2"\ - ftp://ftp5.ua.freebsd.org "Ukraine #5"\ - ftp://ftp6.ua.freebsd.org "Ukraine #6"\ ftp://ftp7.ua.freebsd.org "Ukraine #7"\ - ftp://ftp8.ua.freebsd.org "Ukraine #8"\ ftp://ftp1.us.freebsd.org "USA #1"\ ftp://ftp2.us.freebsd.org "USA #2"\ ftp://ftp3.us.freebsd.org "USA #3"\ ftp://ftp4.us.freebsd.org "USA #4"\ ftp://ftp5.us.freebsd.org "USA #5"\ ftp://ftp6.us.freebsd.org "USA #6"\ - ftp://ftp7.us.freebsd.org "USA #7"\ ftp://ftp8.us.freebsd.org "USA #8"\ - ftp://ftp9.us.freebsd.org "USA #9"\ ftp://ftp10.us.freebsd.org "USA #10"\ ftp://ftp11.us.freebsd.org "USA #11"\ - ftp://ftp12.us.freebsd.org "USA #12"\ ftp://ftp13.us.freebsd.org "USA #13"\ ftp://ftp14.us.freebsd.org "USA #14"\ ftp://ftp15.us.freebsd.org "USA #15"\ From owner-svn-src-all@FreeBSD.ORG Mon Jul 22 13:39:34 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 627D7D0E; Mon, 22 Jul 2013 13:39:34 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 441A42ECE; Mon, 22 Jul 2013 13:39:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6MDdY6C078042; Mon, 22 Jul 2013 13:39:34 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6MDdXWc078038; Mon, 22 Jul 2013 13:39:33 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201307221339.r6MDdXWc078038@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 22 Jul 2013 13:39:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253544 - in head/sys: dev/usb/gadget modules/usb modules/usb/g_audio modules/usb/g_keyboard modules/usb/g_modem modules/usb/g_mouse X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Jul 2013 13:39:34 -0000 Author: hselasky Date: Mon Jul 22 13:39:33 2013 New Revision: 253544 URL: http://svnweb.freebsd.org/changeset/base/253544 Log: Add some USB gadget example drivers for USB audio, USB keyboard, USB mouse and USB modem classes. Hopefully someone will find these examples useful when implementing USB device side drivers using the FreeBSD USB stack. Added: head/sys/dev/usb/gadget/ head/sys/dev/usb/gadget/g_audio.c (contents, props changed) head/sys/dev/usb/gadget/g_audio.h (contents, props changed) head/sys/dev/usb/gadget/g_keyboard.c (contents, props changed) head/sys/dev/usb/gadget/g_keyboard.h (contents, props changed) head/sys/dev/usb/gadget/g_modem.c (contents, props changed) head/sys/dev/usb/gadget/g_modem.h (contents, props changed) head/sys/dev/usb/gadget/g_mouse.c (contents, props changed) head/sys/dev/usb/gadget/g_mouse.h (contents, props changed) head/sys/modules/usb/g_audio/ head/sys/modules/usb/g_audio/Makefile (contents, props changed) head/sys/modules/usb/g_keyboard/ head/sys/modules/usb/g_keyboard/Makefile (contents, props changed) head/sys/modules/usb/g_modem/ head/sys/modules/usb/g_modem/Makefile (contents, props changed) head/sys/modules/usb/g_mouse/ head/sys/modules/usb/g_mouse/Makefile (contents, props changed) Modified: head/sys/modules/usb/Makefile Added: head/sys/dev/usb/gadget/g_audio.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb/gadget/g_audio.c Mon Jul 22 13:39:33 2013 (r253544) @@ -0,0 +1,613 @@ +/* $FreeBSD$ */ +/*- + * Copyright (c) 2010 Hans Petter Selasky. 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. + */ + +/* + * USB audio specs: http://www.usb.org/developers/devclass_docs/audio10.pdf + * http://www.usb.org/developers/devclass_docs/frmts10.pdf + * http://www.usb.org/developers/devclass_docs/termt10.pdf + */ + +#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 "usb_if.h" + +#define USB_DEBUG_VAR g_audio_debug +#include + +#include + +enum { + G_AUDIO_ISOC0_RD, + G_AUDIO_ISOC1_RD, + G_AUDIO_ISOC0_WR, + G_AUDIO_ISOC1_WR, + G_AUDIO_N_TRANSFER, +}; + +struct g_audio_softc { + struct mtx sc_mtx; + struct usb_callout sc_callout; + struct usb_callout sc_watchdog; + struct usb_xfer *sc_xfer[G_AUDIO_N_TRANSFER]; + + int sc_mode; + int sc_pattern_len; + int sc_throughput; + int sc_tx_interval; + int sc_state; + int sc_noise_rem; + + int8_t sc_pattern[G_AUDIO_MAX_STRLEN]; + + uint16_t sc_data_len[2][G_AUDIO_FRAMES]; + + int16_t sc_data_buf[2][G_AUDIO_BUFSIZE / 2]; + + uint8_t sc_volume_setting[32]; + uint8_t sc_volume_limit[32]; + uint8_t sc_sample_rate[32]; +}; + +static SYSCTL_NODE(_hw_usb, OID_AUTO, g_audio, CTLFLAG_RW, 0, "USB audio gadget"); + +#ifdef USB_DEBUG +static int g_audio_debug = 0; + +SYSCTL_INT(_hw_usb_g_audio, OID_AUTO, debug, CTLFLAG_RW, + &g_audio_debug, 0, "Debug level"); +#endif + +static int g_audio_mode = 0; + +SYSCTL_INT(_hw_usb_g_audio, OID_AUTO, mode, CTLFLAG_RW, + &g_audio_mode, 0, "Mode selection"); + +static int g_audio_pattern_interval = 1000; + +SYSCTL_INT(_hw_usb_g_audio, OID_AUTO, pattern_interval, CTLFLAG_RW, + &g_audio_pattern_interval, 0, "Pattern interval in milliseconds"); + +static char g_audio_pattern_data[G_AUDIO_MAX_STRLEN]; + +SYSCTL_STRING(_hw_usb_g_audio, OID_AUTO, pattern, CTLFLAG_RW, + &g_audio_pattern_data, sizeof(g_audio_pattern_data), "Data pattern"); + +static int g_audio_throughput; + +SYSCTL_INT(_hw_usb_g_audio, OID_AUTO, throughput, CTLFLAG_RD, + &g_audio_throughput, sizeof(g_audio_throughput), "Throughput in bytes per second"); + +static device_probe_t g_audio_probe; +static device_attach_t g_audio_attach; +static device_detach_t g_audio_detach; +static usb_handle_request_t g_audio_handle_request; + +static usb_callback_t g_audio_isoc_read_callback; +static usb_callback_t g_audio_isoc_write_callback; + +static devclass_t g_audio_devclass; + +static void g_audio_watchdog(void *arg); +static void g_audio_timeout(void *arg); + +static device_method_t g_audio_methods[] = { + /* USB interface */ + DEVMETHOD(usb_handle_request, g_audio_handle_request), + + /* Device interface */ + DEVMETHOD(device_probe, g_audio_probe), + DEVMETHOD(device_attach, g_audio_attach), + DEVMETHOD(device_detach, g_audio_detach), + + DEVMETHOD_END +}; + +static driver_t g_audio_driver = { + .name = "g_audio", + .methods = g_audio_methods, + .size = sizeof(struct g_audio_softc), +}; + +DRIVER_MODULE(g_audio, uhub, g_audio_driver, g_audio_devclass, 0, 0); +MODULE_DEPEND(g_audio, usb, 1, 1, 1); + +static const struct usb_config g_audio_config[G_AUDIO_N_TRANSFER] = { + + [G_AUDIO_ISOC0_RD] = { + .type = UE_ISOCHRONOUS, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_RX, + .flags = {.ext_buffer = 1,.pipe_bof = 1,.short_xfer_ok = 1,}, + .bufsize = G_AUDIO_BUFSIZE, + .callback = &g_audio_isoc_read_callback, + .frames = G_AUDIO_FRAMES, + .usb_mode = USB_MODE_DEVICE, + .if_index = 1, + }, + + [G_AUDIO_ISOC1_RD] = { + .type = UE_ISOCHRONOUS, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_RX, + .flags = {.ext_buffer = 1,.pipe_bof = 1,.short_xfer_ok = 1,}, + .bufsize = G_AUDIO_BUFSIZE, + .callback = &g_audio_isoc_read_callback, + .frames = G_AUDIO_FRAMES, + .usb_mode = USB_MODE_DEVICE, + .if_index = 1, + }, + + [G_AUDIO_ISOC0_WR] = { + .type = UE_ISOCHRONOUS, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_TX, + .flags = {.ext_buffer = 1,.pipe_bof = 1,}, + .bufsize = G_AUDIO_BUFSIZE, + .callback = &g_audio_isoc_write_callback, + .frames = G_AUDIO_FRAMES, + .usb_mode = USB_MODE_DEVICE, + .if_index = 2, + }, + + [G_AUDIO_ISOC1_WR] = { + .type = UE_ISOCHRONOUS, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_TX, + .flags = {.ext_buffer = 1,.pipe_bof = 1,}, + .bufsize = G_AUDIO_BUFSIZE, + .callback = &g_audio_isoc_write_callback, + .frames = G_AUDIO_FRAMES, + .usb_mode = USB_MODE_DEVICE, + .if_index = 2, + }, +}; + +static void +g_audio_timeout_reset(struct g_audio_softc *sc) +{ + int i = g_audio_pattern_interval; + + sc->sc_tx_interval = i; + + if (i <= 0) + i = 1; + else if (i > 1023) + i = 1023; + + i = USB_MS_TO_TICKS(i); + + usb_callout_reset(&sc->sc_callout, i, &g_audio_timeout, sc); +} + +static void +g_audio_timeout(void *arg) +{ + struct g_audio_softc *sc = arg; + + sc->sc_mode = g_audio_mode; + + memcpy(sc->sc_pattern, g_audio_pattern_data, sizeof(sc->sc_pattern)); + + sc->sc_pattern[G_AUDIO_MAX_STRLEN - 1] = 0; + + sc->sc_pattern_len = strlen(sc->sc_pattern); + + if (sc->sc_mode != G_AUDIO_MODE_LOOP) { + usbd_transfer_start(sc->sc_xfer[G_AUDIO_ISOC0_WR]); + usbd_transfer_start(sc->sc_xfer[G_AUDIO_ISOC1_WR]); + } + g_audio_timeout_reset(sc); +} + +static void +g_audio_watchdog_reset(struct g_audio_softc *sc) +{ + usb_callout_reset(&sc->sc_watchdog, hz, &g_audio_watchdog, sc); +} + +static void +g_audio_watchdog(void *arg) +{ + struct g_audio_softc *sc = arg; + int i; + + i = sc->sc_throughput; + + sc->sc_throughput = 0; + + g_audio_throughput = i; + + g_audio_watchdog_reset(sc); +} + +static int +g_audio_probe(device_t dev) +{ + struct usb_attach_arg *uaa = device_get_ivars(dev); + + DPRINTFN(11, "\n"); + + if (uaa->usb_mode != USB_MODE_DEVICE) + return (ENXIO); + + if ((uaa->info.bInterfaceClass == UICLASS_AUDIO) && + (uaa->info.bInterfaceSubClass == UISUBCLASS_AUDIOCONTROL)) + return (0); + + return (ENXIO); +} + +static int +g_audio_attach(device_t dev) +{ + struct g_audio_softc *sc = device_get_softc(dev); + struct usb_attach_arg *uaa = device_get_ivars(dev); + int error; + int i; + uint8_t iface_index[3]; + + DPRINTFN(11, "\n"); + + device_set_usb_desc(dev); + + mtx_init(&sc->sc_mtx, "g_audio", NULL, MTX_DEF); + + usb_callout_init_mtx(&sc->sc_callout, &sc->sc_mtx, 0); + usb_callout_init_mtx(&sc->sc_watchdog, &sc->sc_mtx, 0); + + sc->sc_mode = G_AUDIO_MODE_SILENT; + + sc->sc_noise_rem = 1; + + for (i = 0; i != G_AUDIO_FRAMES; i++) { + sc->sc_data_len[0][i] = G_AUDIO_BUFSIZE / G_AUDIO_FRAMES; + sc->sc_data_len[1][i] = G_AUDIO_BUFSIZE / G_AUDIO_FRAMES; + } + + iface_index[0] = uaa->info.bIfaceIndex; + iface_index[1] = uaa->info.bIfaceIndex + 1; + iface_index[2] = uaa->info.bIfaceIndex + 2; + + error = usbd_set_alt_interface_index(uaa->device, iface_index[1], 1); + if (error) { + DPRINTF("alt iface setting error=%s\n", usbd_errstr(error)); + goto detach; + } + error = usbd_set_alt_interface_index(uaa->device, iface_index[2], 1); + if (error) { + DPRINTF("alt iface setting error=%s\n", usbd_errstr(error)); + goto detach; + } + error = usbd_transfer_setup(uaa->device, + iface_index, sc->sc_xfer, g_audio_config, + G_AUDIO_N_TRANSFER, sc, &sc->sc_mtx); + + if (error) { + DPRINTF("error=%s\n", usbd_errstr(error)); + goto detach; + } + usbd_set_parent_iface(uaa->device, iface_index[1], iface_index[0]); + usbd_set_parent_iface(uaa->device, iface_index[2], iface_index[0]); + + mtx_lock(&sc->sc_mtx); + + usbd_transfer_start(sc->sc_xfer[G_AUDIO_ISOC0_RD]); + usbd_transfer_start(sc->sc_xfer[G_AUDIO_ISOC1_RD]); + + usbd_transfer_start(sc->sc_xfer[G_AUDIO_ISOC0_WR]); + usbd_transfer_start(sc->sc_xfer[G_AUDIO_ISOC1_WR]); + + g_audio_timeout_reset(sc); + + g_audio_watchdog_reset(sc); + + mtx_unlock(&sc->sc_mtx); + + return (0); /* success */ + +detach: + g_audio_detach(dev); + + return (ENXIO); /* error */ +} + +static int +g_audio_detach(device_t dev) +{ + struct g_audio_softc *sc = device_get_softc(dev); + + DPRINTF("\n"); + + mtx_lock(&sc->sc_mtx); + usb_callout_stop(&sc->sc_callout); + usb_callout_stop(&sc->sc_watchdog); + mtx_unlock(&sc->sc_mtx); + + usbd_transfer_unsetup(sc->sc_xfer, G_AUDIO_N_TRANSFER); + + usb_callout_drain(&sc->sc_callout); + usb_callout_drain(&sc->sc_watchdog); + + mtx_destroy(&sc->sc_mtx); + + return (0); +} + + +static int32_t +g_noise(struct g_audio_softc *sc) +{ + uint32_t temp; + const uint32_t prime = 0xFFFF1D; + + if (sc->sc_noise_rem & 1) { + sc->sc_noise_rem += prime; + } + sc->sc_noise_rem /= 2; + + temp = sc->sc_noise_rem; + + /* unsigned to signed conversion */ + + temp ^= 0x800000; + if (temp & 0x800000) { + temp |= (-0x800000); + } + return temp; +} + +static void +g_audio_make_samples(struct g_audio_softc *sc, int16_t *ptr, int samples) +{ + int i; + int j; + + for (i = 0; i != samples; i++) { + + j = g_noise(sc); + + if ((sc->sc_state < 0) || (sc->sc_state >= sc->sc_pattern_len)) + sc->sc_state = 0; + + if (sc->sc_pattern_len != 0) { + j = (j * sc->sc_pattern[sc->sc_state]) >> 16; + sc->sc_state++; + } + *ptr++ = j / 256; + *ptr++ = j / 256; + } +} + +static void +g_audio_isoc_write_callback(struct usb_xfer *xfer, usb_error_t error) +{ + struct g_audio_softc *sc = usbd_xfer_softc(xfer); + int actlen; + int aframes; + int nr = (xfer == sc->sc_xfer[G_AUDIO_ISOC0_WR]) ? 0 : 1; + int16_t *ptr; + int i; + + usbd_xfer_status(xfer, &actlen, NULL, &aframes, NULL); + + DPRINTF("st=%d aframes=%d actlen=%d bytes\n", + USB_GET_STATE(xfer), aframes, actlen); + + switch (USB_GET_STATE(xfer)) { + case USB_ST_TRANSFERRED: + + sc->sc_throughput += actlen; + + if (sc->sc_mode == G_AUDIO_MODE_LOOP) + break; /* sync with RX */ + + case USB_ST_SETUP: +tr_setup: + + ptr = sc->sc_data_buf[nr]; + + if (sc->sc_mode == G_AUDIO_MODE_PATTERN) { + + for (i = 0; i != G_AUDIO_FRAMES; i++) { + + usbd_xfer_set_frame_data(xfer, i, ptr, sc->sc_data_len[nr][i]); + + g_audio_make_samples(sc, ptr, (G_AUDIO_BUFSIZE / G_AUDIO_FRAMES) / 2); + + ptr += (G_AUDIO_BUFSIZE / G_AUDIO_FRAMES) / 2; + } + } else if (sc->sc_mode == G_AUDIO_MODE_LOOP) { + + for (i = 0; i != G_AUDIO_FRAMES; i++) { + + usbd_xfer_set_frame_data(xfer, i, ptr, sc->sc_data_len[nr][i] & ~3); + + g_audio_make_samples(sc, ptr, sc->sc_data_len[nr][i] / 4); + + ptr += (G_AUDIO_BUFSIZE / G_AUDIO_FRAMES) / 2; + } + } + break; + + default: /* Error */ + DPRINTF("error=%s\n", usbd_errstr(error)); + + if (error != USB_ERR_CANCELLED) { + /* try to clear stall first */ + usbd_xfer_set_stall(xfer); + goto tr_setup; + } + break; + } +} + +static void +g_audio_isoc_read_callback(struct usb_xfer *xfer, usb_error_t error) +{ + struct g_audio_softc *sc = usbd_xfer_softc(xfer); + int actlen; + int aframes; + int nr = (xfer == sc->sc_xfer[G_AUDIO_ISOC0_RD]) ? 0 : 1; + int16_t *ptr; + int i; + + usbd_xfer_status(xfer, &actlen, NULL, &aframes, NULL); + + DPRINTF("st=%d aframes=%d actlen=%d bytes\n", + USB_GET_STATE(xfer), aframes, actlen); + + switch (USB_GET_STATE(xfer)) { + case USB_ST_TRANSFERRED: + + sc->sc_throughput += actlen; + + for (i = 0; i != G_AUDIO_FRAMES; i++) { + sc->sc_data_len[nr][i] = usbd_xfer_frame_len(xfer, i); + } + + usbd_transfer_start(sc->sc_xfer[G_AUDIO_ISOC0_WR]); + usbd_transfer_start(sc->sc_xfer[G_AUDIO_ISOC1_WR]); + + break; + + case USB_ST_SETUP: +tr_setup: + ptr = sc->sc_data_buf[nr]; + + for (i = 0; i != G_AUDIO_FRAMES; i++) { + + usbd_xfer_set_frame_data(xfer, i, ptr, + G_AUDIO_BUFSIZE / G_AUDIO_FRAMES); + + ptr += (G_AUDIO_BUFSIZE / G_AUDIO_FRAMES) / 2; + } + + usbd_transfer_submit(xfer); + break; + + default: /* Error */ + DPRINTF("error=%s\n", usbd_errstr(error)); + + if (error != USB_ERR_CANCELLED) { + /* try to clear stall first */ + usbd_xfer_set_stall(xfer); + goto tr_setup; + } + break; + } +} + + +static int +g_audio_handle_request(device_t dev, + const void *preq, void **pptr, uint16_t *plen, + uint16_t offset, uint8_t *pstate) +{ + struct g_audio_softc *sc = device_get_softc(dev); + const struct usb_device_request *req = preq; + uint8_t is_complete = *pstate; + + if (!is_complete) { + if ((req->bmRequestType == UT_READ_CLASS_INTERFACE) && + (req->bRequest == 0x82 /* get min */ )) { + + if (offset == 0) { + USETW(sc->sc_volume_limit, 0); + *plen = 2; + *pptr = &sc->sc_volume_limit; + } else { + *plen = 0; + } + return (0); + } else if ((req->bmRequestType == UT_READ_CLASS_INTERFACE) && + (req->bRequest == 0x83 /* get max */ )) { + + if (offset == 0) { + USETW(sc->sc_volume_limit, 0x2000); + *plen = 2; + *pptr = &sc->sc_volume_limit; + } else { + *plen = 0; + } + return (0); + } else if ((req->bmRequestType == UT_READ_CLASS_INTERFACE) && + (req->bRequest == 0x84 /* get residue */ )) { + + if (offset == 0) { + USETW(sc->sc_volume_limit, 0); + *plen = 2; + *pptr = &sc->sc_volume_limit; + } else { + *plen = 0; + } + return (0); + } else if ((req->bmRequestType == UT_WRITE_CLASS_INTERFACE) && + (req->bRequest == 0x01 /* set value */ )) { + + if (offset == 0) { + *plen = sizeof(sc->sc_volume_setting); + *pptr = &sc->sc_volume_setting; + } else { + *plen = 0; + } + return (0); + } else if ((req->bmRequestType == UT_WRITE_CLASS_ENDPOINT) && + (req->bRequest == 0x01 /* set value */ )) { + + if (offset == 0) { + *plen = sizeof(sc->sc_sample_rate); + *pptr = &sc->sc_sample_rate; + } else { + *plen = 0; + } + return (0); + } + } + return (ENXIO); /* use builtin handler */ +} Added: head/sys/dev/usb/gadget/g_audio.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb/gadget/g_audio.h Mon Jul 22 13:39:33 2013 (r253544) @@ -0,0 +1,40 @@ +/* $FreeBSD$ */ +/*- + * Copyright (c) 2010 Hans Petter Selasky. 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. + */ + +#ifndef _G_AUDIO_H_ +#define _G_AUDIO_H_ + +#define G_AUDIO_MAX_STRLEN 32 /* chars */ +#define G_AUDIO_FRAMES 8 +#define G_AUDIO_BUFSIZE (G_AUDIO_FRAMES * 2 * 2 * 48) /* units */ + +#define G_AUDIO_MODE_SILENT 0 +#define G_AUDIO_MODE_DUMP 1 +#define G_AUDIO_MODE_LOOP 2 +#define G_AUDIO_MODE_PATTERN 3 +#define G_AUDIO_MODE_MAX 4 + +#endif /* _G_AUDIO_H_ */ Added: head/sys/dev/usb/gadget/g_keyboard.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb/gadget/g_keyboard.c Mon Jul 22 13:39:33 2013 (r253544) @@ -0,0 +1,411 @@ +/* $FreeBSD$ */ +/*- + * Copyright (c) 2010 Hans Petter Selasky. 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. + */ + +/* + * HID spec: http://www.usb.org/developers/devclass_docs/HID1_11.pdf + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include "usb_if.h" + +#define USB_DEBUG_VAR g_keyboard_debug +#include + +#include + +static SYSCTL_NODE(_hw_usb, OID_AUTO, g_keyboard, CTLFLAG_RW, 0, "USB keyboard gadget"); + +#ifdef USB_DEBUG +static int g_keyboard_debug = 0; + +SYSCTL_INT(_hw_usb_g_keyboard, OID_AUTO, debug, CTLFLAG_RW, + &g_keyboard_debug, 0, "Debug level"); +#endif + +static int g_keyboard_mode = 0; + +SYSCTL_INT(_hw_usb_g_keyboard, OID_AUTO, mode, CTLFLAG_RW, + &g_keyboard_mode, 0, "Mode selection"); + +static int g_keyboard_key_press_interval = 1000; + +SYSCTL_INT(_hw_usb_g_keyboard, OID_AUTO, key_press_interval, CTLFLAG_RW, + &g_keyboard_key_press_interval, 0, "Key Press Interval in milliseconds"); + +static char g_keyboard_key_press_pattern[G_KEYBOARD_MAX_STRLEN]; + +SYSCTL_STRING(_hw_usb_g_keyboard, OID_AUTO, key_press_pattern, CTLFLAG_RW, + g_keyboard_key_press_pattern, sizeof(g_keyboard_key_press_pattern), + "Key Press Patterns"); + +#define UPROTO_BOOT_KEYBOARD 1 + +#define G_KEYBOARD_NMOD 8 /* units */ +#define G_KEYBOARD_NKEYCODE 6 /* units */ + +struct g_keyboard_data { + uint8_t modifiers; +#define MOD_CONTROL_L 0x01 +#define MOD_CONTROL_R 0x10 +#define MOD_SHIFT_L 0x02 +#define MOD_SHIFT_R 0x20 +#define MOD_ALT_L 0x04 +#define MOD_ALT_R 0x40 +#define MOD_WIN_L 0x08 +#define MOD_WIN_R 0x80 + uint8_t reserved; + uint8_t keycode[G_KEYBOARD_NKEYCODE]; +}; + +enum { + G_KEYBOARD_INTR_DT, + G_KEYBOARD_N_TRANSFER, +}; + +struct g_keyboard_softc { + struct mtx sc_mtx; + struct usb_callout sc_callout; + struct g_keyboard_data sc_data[2]; + struct usb_xfer *sc_xfer[G_KEYBOARD_N_TRANSFER]; + + int sc_mode; + int sc_state; + int sc_pattern_len; + + char sc_pattern[G_KEYBOARD_MAX_STRLEN]; + + uint8_t sc_led_state[4]; +}; + +static device_probe_t g_keyboard_probe; +static device_attach_t g_keyboard_attach; +static device_detach_t g_keyboard_detach; +static usb_handle_request_t g_keyboard_handle_request; +static usb_callback_t g_keyboard_intr_callback; + +static devclass_t g_keyboard_devclass; + +static device_method_t g_keyboard_methods[] = { + /* USB interface */ + DEVMETHOD(usb_handle_request, g_keyboard_handle_request), + + /* Device interface */ + DEVMETHOD(device_probe, g_keyboard_probe), + DEVMETHOD(device_attach, g_keyboard_attach), + DEVMETHOD(device_detach, g_keyboard_detach), + + DEVMETHOD_END +}; + +static driver_t g_keyboard_driver = { + .name = "g_keyboard", + .methods = g_keyboard_methods, + .size = sizeof(struct g_keyboard_softc), +}; + +DRIVER_MODULE(g_keyboard, uhub, g_keyboard_driver, g_keyboard_devclass, 0, 0); +MODULE_DEPEND(g_keyboard, usb, 1, 1, 1); + +static const struct usb_config g_keyboard_config[G_KEYBOARD_N_TRANSFER] = { + [G_KEYBOARD_INTR_DT] = { + .type = UE_INTERRUPT, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_IN, + .flags = {.ext_buffer = 1,.pipe_bof = 1,}, + .bufsize = sizeof(struct g_keyboard_data), + .callback = &g_keyboard_intr_callback, + .frames = 2, + .usb_mode = USB_MODE_DEVICE, + }, +}; + +static void g_keyboard_timeout(void *arg); + +static void +g_keyboard_timeout_reset(struct g_keyboard_softc *sc) +{ + int i = g_keyboard_key_press_interval; + + if (i <= 0) + i = 1; + else if (i > 1023) + i = 1023; + + i = USB_MS_TO_TICKS(i); + + usb_callout_reset(&sc->sc_callout, i, &g_keyboard_timeout, sc); +} + +static void +g_keyboard_timeout(void *arg) +{ + struct g_keyboard_softc *sc = arg; + + sc->sc_mode = g_keyboard_mode; + + memcpy(sc->sc_pattern, g_keyboard_key_press_pattern, sizeof(sc->sc_pattern)); + + sc->sc_pattern[G_KEYBOARD_MAX_STRLEN - 1] = 0; + + sc->sc_pattern_len = strlen(sc->sc_pattern); + + DPRINTFN(11, "Timeout %p\n", sc->sc_xfer[G_KEYBOARD_INTR_DT]); + + usbd_transfer_start(sc->sc_xfer[G_KEYBOARD_INTR_DT]); + + g_keyboard_timeout_reset(sc); +} + +static int +g_keyboard_probe(device_t dev) +{ + struct usb_attach_arg *uaa = device_get_ivars(dev); + + DPRINTFN(11, "\n"); + + if (uaa->usb_mode != USB_MODE_DEVICE) + return (ENXIO); + + if ((uaa->info.bInterfaceClass == UICLASS_HID) && + (uaa->info.bInterfaceSubClass == UISUBCLASS_BOOT) && + (uaa->info.bInterfaceProtocol == UPROTO_BOOT_KEYBOARD)) + return (0); + + return (ENXIO); +} + +static int +g_keyboard_attach(device_t dev) +{ + struct g_keyboard_softc *sc = device_get_softc(dev); + struct usb_attach_arg *uaa = device_get_ivars(dev); + int error; + + DPRINTFN(11, "\n"); + + device_set_usb_desc(dev); + + mtx_init(&sc->sc_mtx, "g_keyboard", NULL, MTX_DEF); + + usb_callout_init_mtx(&sc->sc_callout, &sc->sc_mtx, 0); + + sc->sc_mode = G_KEYBOARD_MODE_SILENT; + + error = usbd_transfer_setup(uaa->device, + &uaa->info.bIfaceIndex, sc->sc_xfer, g_keyboard_config, + G_KEYBOARD_N_TRANSFER, sc, &sc->sc_mtx); + + if (error) { + DPRINTF("error=%s\n", usbd_errstr(error)); + goto detach; + } + mtx_lock(&sc->sc_mtx); + g_keyboard_timeout_reset(sc); + mtx_unlock(&sc->sc_mtx); + + return (0); /* success */ + +detach: + g_keyboard_detach(dev); + + return (ENXIO); /* error */ +} + +static int +g_keyboard_detach(device_t dev) +{ + struct g_keyboard_softc *sc = device_get_softc(dev); + + DPRINTF("\n"); + + mtx_lock(&sc->sc_mtx); + usb_callout_stop(&sc->sc_callout); + mtx_unlock(&sc->sc_mtx); + + usbd_transfer_unsetup(sc->sc_xfer, G_KEYBOARD_N_TRANSFER); + + usb_callout_drain(&sc->sc_callout); + + mtx_destroy(&sc->sc_mtx); + + return (0); +} + +static uint8_t +g_keyboard_get_keycode(struct g_keyboard_softc *sc, int index) +{ + int key; + int mod = sc->sc_pattern_len; + + if (mod == 0) + index = 0; + else + index %= mod; + + if ((index >= 0) && (index < sc->sc_pattern_len)) + key = sc->sc_pattern[index]; + else + key = 'a'; + + if (key >= 'a' && key <= 'z') + return (key - 'a' + 0x04); + else + return (0x04); +} + +static void +g_keyboard_intr_callback(struct usb_xfer *xfer, usb_error_t error) +{ + struct g_keyboard_softc *sc = usbd_xfer_softc(xfer); + int actlen; + int aframes; + + usbd_xfer_status(xfer, &actlen, NULL, &aframes, NULL); + + DPRINTF("st=%d aframes=%d actlen=%d bytes\n", + USB_GET_STATE(xfer), aframes, actlen); + + switch (USB_GET_STATE(xfer)) { + case USB_ST_TRANSFERRED: + break; + + case USB_ST_SETUP: +tr_setup: + if (sc->sc_mode == G_KEYBOARD_MODE_SILENT) { + memset(&sc->sc_data, 0, sizeof(sc->sc_data)); + usbd_xfer_set_frame_data(xfer, 0, &sc->sc_data[0], sizeof(sc->sc_data[0])); + usbd_xfer_set_frame_data(xfer, 1, &sc->sc_data[1], sizeof(sc->sc_data[1])); + usbd_xfer_set_frames(xfer, 2); + usbd_transfer_submit(xfer); + + } else if (sc->sc_mode == G_KEYBOARD_MODE_PATTERN) { + + memset(&sc->sc_data, 0, sizeof(sc->sc_data)); + + if ((sc->sc_state < 0) || (sc->sc_state >= G_KEYBOARD_MAX_STRLEN)) + sc->sc_state = 0; + + switch (sc->sc_state % 6) { + case 0: + sc->sc_data[0].keycode[0] = + g_keyboard_get_keycode(sc, sc->sc_state + 0); + case 1: *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Jul 22 13:56:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C0BF5728; Mon, 22 Jul 2013 13:56:36 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A2CFC2FC8; Mon, 22 Jul 2013 13:56:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6MDuaKF083659; Mon, 22 Jul 2013 13:56:36 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6MDuaX1083657; Mon, 22 Jul 2013 13:56:36 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201307221356.r6MDuaX1083657@svn.freebsd.org> From: Devin Teske Date: Mon, 22 Jul 2013 13:56:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253545 - in head/usr.sbin/bsdconfig: include share/media X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Jul 2013 13:56:36 -0000 Author: dteske Date: Mon Jul 22 13:56:35 2013 New Revision: 253545 URL: http://svnweb.freebsd.org/changeset/base/253545 Log: Sync-up with bsdinstall(8) FTP mirrorselect changes. SVN r224656: Add back ftp4, a new machine has taken its place. ftp2 and ftp8 are both IPv6 capable mirrors. cvsup4/ftp4 have already been added to the handbook. NOTE: Except put IPv6 entries in IPv6 section at the top of the list SVN r225467: Add ftp4.se.freebsd.org to the IPv4 and IPv6 mirror lists. SVN r235228: Add the IPv6 tag to ftp4.fr.freebsd.org. NOTE: Except dup entry into IPv6 section. SVN r243832: - Remove snapshots.se.freebsd.org [1] - Add ftp6.se.freebsd.org SVN r243854: Remove snapshots.jp.freebsd.org. It stopped working years ago. SVN r253543: Update mirror list to more closely match http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/mirrors-ftp.html MFC after: 1 week Modified: head/usr.sbin/bsdconfig/include/messages.subr head/usr.sbin/bsdconfig/share/media/ftp.subr Modified: head/usr.sbin/bsdconfig/include/messages.subr ============================================================================== --- head/usr.sbin/bsdconfig/include/messages.subr Mon Jul 22 13:39:33 2013 (r253544) +++ head/usr.sbin/bsdconfig/include/messages.subr Mon Jul 22 13:56:35 2013 (r253545) @@ -42,7 +42,7 @@ msg_all_desc="All available packages in msg_always_try_sudo_when_run_as="Always try sudo(8) when run as %s" msg_arabic_desc="Ported software for Arab countries." msg_archivers_desc="Utilities for archiving and unarchiving data." -msg_argentina="Argentina" +msg_armenia="Armenia" msg_assume_network_is_already_configured="Running multi-user, assume that the network is already configured?" msg_assume_yes_to_all_non_critical_dialogs="Assume \"Yes\" answers to all non-critical dialogs" msg_astro_desc="Applications related to astronomy." @@ -92,7 +92,6 @@ msg_couldnt_connect_to_proxy="Couldn't c msg_couldnt_connect_to_server="Couldn't connect to server" msg_couldnt_open_ftp_connection="Couldn't open FTP connection to %s:\n %s." msg_created_path="Created %s" -msg_croatia="Croatia" msg_czech_republic="Czech Republic" msg_databases_desc="Database software." msg_debugging="Debugging" @@ -154,7 +153,6 @@ msg_hostname_variable_not_set="WARNING: msg_http_direct="HTTP Direct" msg_http_proxy="HTTP Proxy" msg_hungarian_desc="Ported software for the Hungarian market." -msg_hungary="Hungary" msg_iceland="Iceland" msg_install_from_a_dos_partition="Install from a DOS partition" msg_install_from_a_floppy_disk_set="Install from a floppy disk set" @@ -195,6 +193,7 @@ msg_kld_desc="Kernel loadable modules." msg_korea="Korea" msg_korean_desc="Ported software for the Korean market." msg_lang_desc="Computer languages." +msg_latvia="Latvia" msg_length_of_specified_url_is_too_long="Length of specified URL is %u characters. Allowable maximum is %u." msg_linux_desc="Linux programs that can run under binary compatibility." msg_lisp_desc="Software related to the Lisp language." @@ -226,6 +225,7 @@ msg_netherlands="Netherlands" msg_netmask="Netmask" msg_network_configuration="Network Configuration" msg_network_interface_information_required="Network interface information required" +msg_new_zealand="New Zealand" msg_news_desc="USENET News support software." msg_next_page="Next page" msg_nfailed_attempts="%u incorrect password attempts" @@ -298,7 +298,6 @@ msg_please_specify_url_of_freebsd_http_d msg_poland="Poland" msg_polish_desc="Ported software for the Polish market." msg_ports_mgmt_desc="Utilities for managing ports and packages." -msg_portugal="Portugal" msg_portuguese_desc="Ported software for the Portuguese market." msg_previous_page="Previous page" msg_previous_syntax_errors="%s: Not overwriting \`%s' due to previous syntax errors" @@ -323,7 +322,6 @@ msg_review="Review" msg_review_desc="Review/perform pending actions" msg_review_help="Install, Re-Install, or Un-install selected packages and dependencies" msg_reviewing_selected_packages="Reviewing %u selected packages:" -msg_romania="Romania" msg_ruby_desc="Software related to the Ruby language." msg_rubygems_desc="Ports of RubyGems packages." msg_russia="Russia" @@ -340,11 +338,8 @@ msg_select_a_site_thats_close="Select a msg_selected="selected" msg_server_error_when_requesting_url="Server error when requesting %s, you could try an other server" msg_shells_desc="Various shells (tcsh, bash, etc)." -msg_singapore="Singapore" msg_slovak_republic="Slovak Republic" msg_slovenia="Slovenia" -msg_snapshots_server_japan="Snapshots Server Japan" -msg_snapshots_server_sweden="Snapshots Server Sweden" msg_sorry_invalid_url="Sorry, %s is an invalid URL!" msg_sorry_package_was_not_found_in_the_index="Sorry, package %s was not found in the INDEX." msg_sorry_try_again="Sorry, try again." Modified: head/usr.sbin/bsdconfig/share/media/ftp.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/ftp.subr Mon Jul 22 13:39:33 2013 (r253544) +++ head/usr.sbin/bsdconfig/share/media/ftp.subr Mon Jul 22 13:56:35 2013 (r253545) @@ -75,14 +75,12 @@ f_dialog_menu_media_ftp() local menu_list=" '$msg_main_site' 'ftp.freebsd.org' 'URL' '$msg_specify_some_other_ftp_site' - '$msg_snapshots_server_japan' - 'snapshots.jp.freebsd.org' - '$msg_snapshots_server_sweden' - 'snapshots.se.freebsd.org' 'IPv6 $msg_main_site' 'ftp.freebsd.org' + ' IPv6 $msg_france' 'ftp4.fr.freebsd.org' + ' IPv6 $msg_france #8' 'ftp8.fr.freebsd.org' ' IPv6 $msg_ireland' 'ftp3.ie.freebsd.org' - ' IPv6 $msg_israel' 'ftp.il.freebsd.org' ' IPv6 $msg_japan' 'ftp2.jp.freebsd.org' + ' IPv6 $msg_sweden' 'ftp4.se.freebsd.org' ' IPv6 $msg_usa' 'ftp4.us.freebsd.org' ' IPv6 $msg_turkey' 'ftp2.tr.freebsd.org' '$msg_primary' 'ftp1.freebsd.org' @@ -92,44 +90,34 @@ f_dialog_menu_media_ftp() ' $msg_primary #5' 'ftp5.freebsd.org' ' $msg_primary #6' 'ftp6.freebsd.org' ' $msg_primary #7' 'ftp7.freebsd.org' - ' $msg_primary #8' 'ftp8.freebsd.org' - ' $msg_primary #9' 'ftp9.freebsd.org' ' $msg_primary #10' 'ftp10.freebsd.org' ' $msg_primary #11' 'ftp11.freebsd.org' ' $msg_primary #12' 'ftp12.freebsd.org' ' $msg_primary #13' 'ftp13.freebsd.org' ' $msg_primary #14' 'ftp14.freebsd.org' - '$msg_argentina' 'ftp.ar.freebsd.org' + '$msg_armenia' 'ftp1.am.freebsd.org' '$msg_australia' 'ftp.au.freebsd.org' ' $msg_australia #2' 'ftp2.au.freebsd.org' ' $msg_australia #3' 'ftp3.au.freebsd.org' '$msg_austria' 'ftp.at.freebsd.org' - ' $msg_austria #2' 'ftp2.at.freebsd.org' - '$msg_brazil' 'ftp.br.freebsd.org' - ' $msg_brazil #2' 'ftp2.br.freebsd.org' + '$msg_brazil' 'ftp2.br.freebsd.org' ' $msg_brazil #3' 'ftp3.br.freebsd.org' ' $msg_brazil #4' 'ftp4.br.freebsd.org' - ' $msg_brazil #5' 'ftp5.br.freebsd.org' - ' $msg_brazil #6' 'ftp6.br.freebsd.org' - ' $msg_brazil #7' 'ftp7.br.freebsd.org' '$msg_canada' 'ftp.ca.freebsd.org' '$msg_china' 'ftp.cn.freebsd.org' - ' $msg_china #2' 'ftp2.cn.freebsd.org' - '$msg_croatia' 'ftp.hr.freebsd.org' '$msg_czech_republic' 'ftp.cz.freebsd.org' '$msg_denmark' 'ftp.dk.freebsd.org' - ' $msg_denmark #2' 'ftp2.dk.freebsd.org' '$msg_estonia' 'ftp.ee.freebsd.org' '$msg_finland' 'ftp.fi.freebsd.org' '$msg_france' 'ftp.fr.freebsd.org' - ' $msg_france #2' 'ftp2.fr.freebsd.org' ' $msg_france #3' 'ftp3.fr.freebsd.org' + ' $msg_france #4' 'ftp4.fr.freebsd.org' ' $msg_france #5' 'ftp5.fr.freebsd.org' ' $msg_france #6' 'ftp6.fr.freebsd.org' + ' $msg_france #7' 'ftp7.fr.freebsd.org' ' $msg_france #8' 'ftp8.fr.freebsd.org' '$msg_germany' 'ftp.de.freebsd.org' ' $msg_germany #2' 'ftp2.de.freebsd.org' - ' $msg_germany #3' 'ftp3.de.freebsd.org' ' $msg_germany #4' 'ftp4.de.freebsd.org' ' $msg_germany #5' 'ftp5.de.freebsd.org' ' $msg_germany #6' 'ftp6.de.freebsd.org' @@ -137,11 +125,8 @@ f_dialog_menu_media_ftp() ' $msg_germany #8' 'ftp8.de.freebsd.org' '$msg_greece' 'ftp.gr.freebsd.org' ' $msg_greece #2' 'ftp2.gr.freebsd.org' - '$msg_hungary' 'ftp.hu.freebsd.org' '$msg_iceland' 'ftp.is.freebsd.org' - '$msg_ireland' 'ftp.ie.freebsd.org' - ' $msg_ireland #2' 'ftp2.ie.freebsd.org' - ' $msg_ireland #3' 'ftp3.ie.freebsd.org' + '$msg_ireland' 'ftp3.ie.freebsd.org' '$msg_israel' 'ftp.il.freebsd.org' '$msg_italy' 'ftp.it.freebsd.org' '$msg_japan' 'ftp.jp.freebsd.org' @@ -155,72 +140,57 @@ f_dialog_menu_media_ftp() ' $msg_japan #9' 'ftp9.jp.freebsd.org' '$msg_korea' 'ftp.kr.freebsd.org' ' $msg_korea #2' 'ftp2.kr.freebsd.org' + '$msg_latvia' 'ftp.lv.freebsd.org' '$msg_lithuania' 'ftp.lt.freebsd.org' '$msg_netherlands' 'ftp.nl.freebsd.org' ' $msg_netherlands #2' 'ftp2.nl.freebsd.org' + '$msg_new_zealand' 'ftp.nz.freebsd.org' '$msg_norway' 'ftp.no.freebsd.org' - ' $msg_norway #3' 'ftp3.no.freebsd.org' '$msg_poland' 'ftp.pl.freebsd.org' ' $msg_poland #2' 'ftp2.pl.freebsd.org' - ' $msg_poland #5' 'ftp5.pl.freebsd.org' - '$msg_portugal' 'ftp.pt.freebsd.org' - ' $msg_portugal #2' 'ftp2.pt.freebsd.org' - ' $msg_portugal #4' 'ftp4.pt.freebsd.org' - '$msg_romania' 'ftp.ro.freebsd.org' '$msg_russia' 'ftp.ru.freebsd.org' ' $msg_russia #2' 'ftp2.ru.freebsd.org' - ' $msg_russia #3' 'ftp3.ru.freebsd.org' ' $msg_russia #4' 'ftp4.ru.freebsd.org' - '$msg_singapore' 'ftp.sg.freebsd.org' + ' $msg_russia #5' 'ftp5.ru.freebsd.org' + ' $msg_russia #6' 'ftp6.ru.freebsd.org' '$msg_slovak_republic' 'ftp.sk.freebsd.org' + ' $msg_slovak_republic #2' 'ftp2.sk.freebsd.org' '$msg_slovenia' 'ftp.si.freebsd.org' - ' $msg_slovenia #2' 'ftp2.si.freebsd.org' '$msg_south_africa' 'ftp.za.freebsd.org' ' $msg_south_africa #2' 'ftp2.za.freebsd.org' - ' $msg_south_africa #3' 'ftp3.za.freebsd.org' ' $msg_south_africa #4' 'ftp4.za.freebsd.org' '$msg_spain' 'ftp.es.freebsd.org' - ' $msg_spain #2' 'ftp2.es.freebsd.org' ' $msg_spain #3' 'ftp3.es.freebsd.org' '$msg_sweden' 'ftp.se.freebsd.org' ' $msg_sweden #2' 'ftp2.se.freebsd.org' ' $msg_sweden #3' 'ftp3.se.freebsd.org' ' $msg_sweden #4' 'ftp4.se.freebsd.org' ' $msg_sweden #5' 'ftp5.se.freebsd.org' + ' $msg_sweden #6' 'ftp6.se.freebsd.org' '$msg_switzerland' 'ftp.ch.freebsd.org' - ' $msg_switzerland #2' 'ftp2.ch.freebsd.org' '$msg_taiwan' 'ftp.tw.freebsd.org' ' $msg_taiwan #2' 'ftp2.tw.freebsd.org' ' $msg_taiwan #3' 'ftp3.tw.freebsd.org' ' $msg_taiwan #4' 'ftp4.tw.freebsd.org' ' $msg_taiwan #6' 'ftp6.tw.freebsd.org' ' $msg_taiwan #11' 'ftp11.tw.freebsd.org' - '$msg_turkey' 'ftp.tr.freebsd.org' - ' $msg_turkey #2' 'ftp2.tr.freebsd.org' + '$msg_turkey' 'ftp2.tr.freebsd.org' '$msg_uk' 'ftp.uk.freebsd.org' ' $msg_uk #2' 'ftp2.uk.freebsd.org' ' $msg_uk #3' 'ftp3.uk.freebsd.org' ' $msg_uk #4' 'ftp4.uk.freebsd.org' ' $msg_uk #5' 'ftp5.uk.freebsd.org' - ' $msg_uk #6' 'ftp6.uk.freebsd.org' '$msg_ukraine' 'ftp.ua.freebsd.org' - ' $msg_ukraine #2' 'ftp2.ua.freebsd.org' - ' $msg_ukraine #5' 'ftp5.ua.freebsd.org' - ' $msg_ukraine #6' 'ftp6.ua.freebsd.org' ' $msg_ukraine #7' 'ftp7.ua.freebsd.org' - ' $msg_ukraine #8' 'ftp8.ua.freebsd.org' '$msg_usa #1' 'ftp1.us.freebsd.org' ' $msg_usa #2' 'ftp2.us.freebsd.org' ' $msg_usa #3' 'ftp3.us.freebsd.org' ' $msg_usa #4' 'ftp4.us.freebsd.org' ' $msg_usa #5' 'ftp5.us.freebsd.org' ' $msg_usa #6' 'ftp6.us.freebsd.org' - ' $msg_usa #7' 'ftp7.us.freebsd.org' ' $msg_usa #8' 'ftp8.us.freebsd.org' - ' $msg_usa #9' 'ftp9.us.freebsd.org' ' $msg_usa #10' 'ftp10.us.freebsd.org' ' $msg_usa #11' 'ftp11.us.freebsd.org' - ' $msg_usa #12' 'ftp12.us.freebsd.org' ' $msg_usa #13' 'ftp13.us.freebsd.org' ' $msg_usa #14' 'ftp14.us.freebsd.org' ' $msg_usa #15' 'ftp15.us.freebsd.org' From owner-svn-src-all@FreeBSD.ORG Mon Jul 22 14:23:47 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7F254412; Mon, 22 Jul 2013 14:23:47 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4DE55215E; Mon, 22 Jul 2013 14:23:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6MENlGk092854; Mon, 22 Jul 2013 14:23:47 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6MENlwa092853; Mon, 22 Jul 2013 14:23:47 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201307221423.r6MENlwa092853@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 22 Jul 2013 14:23:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253546 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Jul 2013 14:23:47 -0000 Author: glebius Date: Mon Jul 22 14:23:46 2013 New Revision: 253546 URL: http://svnweb.freebsd.org/changeset/base/253546 Log: Fix build. Modified: head/share/mk/bsd.own.mk Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Mon Jul 22 13:56:35 2013 (r253545) +++ head/share/mk/bsd.own.mk Mon Jul 22 14:23:46 2013 (r253546) @@ -385,7 +385,8 @@ __DEFAULT_NO_OPTIONS = \ OFED \ OPENSSH_NONE_CIPHER \ SHARED_TOOLCHAIN \ - SVN + SVN \ + USB_GADGET_EXAMPLES # # Default behaviour of some options depends on the architecture. Unfortunately From owner-svn-src-all@FreeBSD.ORG Mon Jul 22 15:49:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3B777A3B; Mon, 22 Jul 2013 15:49:02 +0000 (UTC) (envelope-from hps@bitfrost.no) Received: from mta.bitpro.no (mta.bitpro.no [92.42.64.202]) by mx1.freebsd.org (Postfix) with ESMTP id ED8872586; Mon, 22 Jul 2013 15:49:01 +0000 (UTC) Received: from mail.lockless.no (mail.lockless.no [46.29.221.38]) by mta.bitpro.no (Postfix) with ESMTP id 39E7E7A0D7; Mon, 22 Jul 2013 17:49:00 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail.lockless.no (Postfix) with ESMTP id C09858EF83C; Mon, 22 Jul 2013 17:49:03 +0200 (CEST) X-Virus-Scanned: by amavisd-new-2.6.4 (20090625) (Debian) at lockless.no Received: from mail.lockless.no ([127.0.0.1]) by localhost (mail.lockless.no [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id url6sFQZrK1K; Mon, 22 Jul 2013 17:48:57 +0200 (CEST) Received: from laptop015.hselasky.homeunix.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) by mail.lockless.no (Postfix) with ESMTPSA id 6A2C28EF83B; Mon, 22 Jul 2013 17:48:57 +0200 (CEST) Message-ID: <51ED54C4.8050206@bitfrost.no> Date: Mon, 22 Jul 2013 17:50:28 +0200 From: Hans Petter Selasky Organization: Bitfrost A/S User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130522 Thunderbird/17.0.6 MIME-Version: 1.0 To: Gleb Smirnoff Subject: Re: svn commit: r253546 - head/share/mk References: <201307221423.r6MENlwa092853@svn.freebsd.org> In-Reply-To: <201307221423.r6MENlwa092853@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Jul 2013 15:49:02 -0000 On 07/22/13 16:23, Gleb Smirnoff wrote: > Author: glebius > Date: Mon Jul 22 14:23:46 2013 > New Revision: 253546 > URL: http://svnweb.freebsd.org/changeset/base/253546 > > Log: > Fix build. > > Modified: > head/share/mk/bsd.own.mk > > Modified: head/share/mk/bsd.own.mk > ============================================================================== > --- head/share/mk/bsd.own.mk Mon Jul 22 13:56:35 2013 (r253545) > +++ head/share/mk/bsd.own.mk Mon Jul 22 14:23:46 2013 (r253546) > @@ -385,7 +385,8 @@ __DEFAULT_NO_OPTIONS = \ > OFED \ > OPENSSH_NONE_CIPHER \ > SHARED_TOOLCHAIN \ > - SVN > + SVN \ > + USB_GADGET_EXAMPLES > > # > # Default behaviour of some options depends on the architecture. Unfortunately > > Thanks! --HPS From owner-svn-src-all@FreeBSD.ORG Mon Jul 22 18:18:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 15C7646F; Mon, 22 Jul 2013 18:18:22 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 05D992CF3; Mon, 22 Jul 2013 18:18:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6MIILgZ067624; Mon, 22 Jul 2013 18:18:21 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6MIILsK067623; Mon, 22 Jul 2013 18:18:21 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201307221818.r6MIILsK067623@svn.freebsd.org> From: Ed Maste Date: Mon, 22 Jul 2013 18:18:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253548 - head/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Jul 2013 18:18:22 -0000 Author: emaste Date: Mon Jul 22 18:18:21 2013 New Revision: 253548 URL: http://svnweb.freebsd.org/changeset/base/253548 Log: Document EINVAL error return from PT_LWPINFO Modified: head/lib/libc/sys/ptrace.2 Modified: head/lib/libc/sys/ptrace.2 ============================================================================== --- head/lib/libc/sys/ptrace.2 Mon Jul 22 15:02:55 2013 (r253547) +++ head/lib/libc/sys/ptrace.2 Mon Jul 22 18:18:21 2013 (r253548) @@ -2,7 +2,7 @@ .\" $NetBSD: ptrace.2,v 1.2 1995/02/27 12:35:37 cgd Exp $ .\" .\" This file is in the public domain. -.Dd February 7, 2013 +.Dd July 22, 2013 .Dt PTRACE 2 .Os .Sh NAME @@ -556,6 +556,14 @@ was attempted on a process with no valid was given an invalid value for .Fa pve_entry . This can also be caused by changes to the VM map of the process. +.It +The size (in +.Fa data ) +provided to +.Dv PT_LWPINFO +was less than or equal to zero, or larger than the +.Vt ptrace_lwpinfo +structure known to the kernel. .El .It Bq Er EBUSY .Bl -bullet -compact From owner-svn-src-all@FreeBSD.ORG Mon Jul 22 18:37:08 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C4C67773; Mon, 22 Jul 2013 18:37:08 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B4CF82DC1; Mon, 22 Jul 2013 18:37:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6MIb8q7073392; Mon, 22 Jul 2013 18:37:08 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6MIb7bX073383; Mon, 22 Jul 2013 18:37:07 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201307221837.r6MIb7bX073383@svn.freebsd.org> From: "Kenneth D. Merry" Date: Mon, 22 Jul 2013 18:37:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253549 - in head/sys: cam dev/mps sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Jul 2013 18:37:08 -0000 Author: ken Date: Mon Jul 22 18:37:07 2013 New Revision: 253549 URL: http://svnweb.freebsd.org/changeset/base/253549 Log: CAM and mps(4) driver scanning changes. Add a PIM_NOSCAN flag to the CAM path inquiry CCB. This tells CAM not to perform a rescan on a bus when it is registered. We now use this flag in the mps(4) driver. Since it knows what devices it has attached, it is more efficient for it to just issue a target rescan on the targets that are attached. Also, remove the private rescan thread from the mps(4) driver in favor of the rescan thread already built into CAM. Without this change, but with the change above, the MPS scanner could run before or during CAM's initial setup, which would cause duplicate device reprobes and announcements. sys/param.h: Bump __FreeBSD_version to 1000039 for the inclusion of the PIM_RESCAN CAM path inquiry flag. sys/cam/cam_ccb.h: sys/cam/cam_xpt.c: Added a PIM_NOSCAN flag. If a SIM sets this in the path inquiry ccb, then CAM won't rescan the bus in xpt_bus_regsister. sys/dev/mps/mps_sas.c For versions of FreeBSD that have the PIM_NOSCAN path inquiry flag, don't freeze the sim queue during scanning, because CAM won't be scanning this bus. Instead, hold up the boot. Don't call mpssas_rescan_target in mpssas_startup_decrement; it's redundant and I don't know why it was in there. Set PIM_NOSCAN in path inquiry CCBs. Remove methods related to the internal rescan daemon. Always use async events to trigger a probe for EEDP support. In older versions of FreeBSD where AC_ADVINFO_CHANGED is not available, use AC_FOUND_DEVICE and issue the necessary READ CAPACITY manually. Provide a path to xpt_register_async() so that we only receive events for our own SCSI domain. Improve error reporting in cases where setup for EEDP detection fails. sys/dev/mps/mps_sas.h: Remove softc flags and data related to the scanner thread. sys/dev/mps/mps_sas_lsi.c: Unconditionally rescan the target whenever a device is added. Sponsored by: Spectra Logic MFC after: 1 week Modified: head/sys/cam/cam_ccb.h head/sys/cam/cam_xpt.c head/sys/dev/mps/mps_sas.c head/sys/dev/mps/mps_sas.h head/sys/dev/mps/mps_sas_lsi.c head/sys/sys/param.h Modified: head/sys/cam/cam_ccb.h ============================================================================== --- head/sys/cam/cam_ccb.h Mon Jul 22 18:18:21 2013 (r253548) +++ head/sys/cam/cam_ccb.h Mon Jul 22 18:37:07 2013 (r253549) @@ -571,6 +571,7 @@ typedef enum { PIM_NO_6_BYTE = 0x08, /* Do not send 6-byte commands */ PIM_SEQSCAN = 0x04, /* Do bus scans sequentially, not in parallel */ PIM_UNMAPPED = 0x02, + PIM_NOSCAN = 0x01 /* SIM does its own scanning */ } pi_miscflag; /* Path Inquiry CCB */ Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Mon Jul 22 18:18:21 2013 (r253548) +++ head/sys/cam/cam_xpt.c Mon Jul 22 18:37:07 2013 (r253549) @@ -3895,18 +3895,23 @@ xpt_bus_register(struct cam_sim *sim, de /* Notify interested parties */ if (sim->path_id != CAM_XPT_PATH_ID) { - union ccb *scan_ccb; xpt_async(AC_PATH_REGISTERED, path, &cpi); - /* Initiate bus rescan. */ - scan_ccb = xpt_alloc_ccb_nowait(); - if (scan_ccb != NULL) { - scan_ccb->ccb_h.path = path; - scan_ccb->ccb_h.func_code = XPT_SCAN_BUS; - scan_ccb->crcn.flags = 0; - xpt_rescan(scan_ccb); + if ((cpi.hba_misc & PIM_NOSCAN) == 0) { + union ccb *scan_ccb; + + /* Initiate bus rescan. */ + scan_ccb = xpt_alloc_ccb_nowait(); + if (scan_ccb != NULL) { + scan_ccb->ccb_h.path = path; + scan_ccb->ccb_h.func_code = XPT_SCAN_BUS; + scan_ccb->crcn.flags = 0; + xpt_rescan(scan_ccb); + } else + xpt_print(path, + "Can't allocate CCB to scan bus\n"); } else - xpt_print(path, "Can't allocate CCB to scan bus\n"); + xpt_free_path(path); } else xpt_free_path(path); return (CAM_SUCCESS); Modified: head/sys/dev/mps/mps_sas.c ============================================================================== --- head/sys/dev/mps/mps_sas.c Mon Jul 22 18:18:21 2013 (r253548) +++ head/sys/dev/mps/mps_sas.c Mon Jul 22 18:37:07 2013 (r253549) @@ -136,14 +136,12 @@ static void mpssas_action_smpio(struct m static void mpssas_resetdev_complete(struct mps_softc *, struct mps_command *); static int mpssas_send_abort(struct mps_softc *sc, struct mps_command *tm, struct mps_command *cm); static int mpssas_send_reset(struct mps_softc *sc, struct mps_command *tm, uint8_t type); -static void mpssas_rescan(struct mpssas_softc *sassc, union ccb *ccb); -static void mpssas_rescan_done(struct cam_periph *periph, union ccb *done_ccb); -static void mpssas_scanner_thread(void *arg); -#if __FreeBSD_version >= 1000006 static void mpssas_async(void *callback_arg, uint32_t code, struct cam_path *path, void *arg); -#else -static void mpssas_check_eedp(struct mpssas_softc *sassc); +#if (__FreeBSD_version < 901503) || \ + ((__FreeBSD_version >= 1000000) && (__FreeBSD_version < 1000006)) +static void mpssas_check_eedp(struct mps_softc *sc, struct cam_path *path, + struct ccb_getdev *cgd); static void mpssas_read_cap_done(struct cam_periph *periph, union ccb *done_ccb); #endif static int mpssas_send_portenable(struct mps_softc *sc); @@ -202,8 +200,12 @@ mpssas_startup_decrement(struct mpssas_s mps_dprint(sassc->sc, MPS_INIT, "%s releasing simq\n", __func__); sassc->flags &= ~MPSSAS_IN_STARTUP; +#if __FreeBSD_version >= 1000039 + xpt_release_boot(); +#else xpt_release_simq(sassc->sim, 1); mpssas_rescan_target(sassc->sc, NULL); +#endif } mps_dprint(sassc->sc, MPS_INIT, "%s refcount %u\n", __func__, sassc->startup_refcount); @@ -254,7 +256,6 @@ mpssas_free_tm(struct mps_softc *sc, str mps_free_high_priority_command(sc, tm); } - void mpssas_rescan_target(struct mps_softc *sc, struct mpssas_target *targ) { @@ -292,7 +293,7 @@ mpssas_rescan_target(struct mps_softc *s ccb->ccb_h.func_code = XPT_SCAN_TGT; mps_dprint(sc, MPS_TRACE, "%s targetid %u\n", __func__, targetid); - mpssas_rescan(sassc, ccb); + xpt_rescan(ccb); } static void @@ -690,9 +691,7 @@ int mps_attach_sas(struct mps_softc *sc) { struct mpssas_softc *sassc; -#if __FreeBSD_version >= 1000006 cam_status status; -#endif int unit, error = 0; MPS_FUNCTRACE(sc); @@ -740,16 +739,7 @@ mps_attach_sas(struct mps_softc *sc) taskqueue_start_threads(&sassc->ev_tq, 1, 255, "%s taskq", device_get_nameunit(sc->mps_dev)); - TAILQ_INIT(&sassc->ccb_scanq); - error = mps_kproc_create(mpssas_scanner_thread, sassc, - &sassc->rescan_thread, 0, 0, "mps_scan%d", unit); - if (error) { - mps_printf(sc, "Error %d starting rescan thread\n", error); - goto out; - } - mps_lock(sc); - sassc->flags |= MPSSAS_SCANTHREAD; /* * XXX There should be a bus for every port on the adapter, but since @@ -764,12 +754,16 @@ mps_attach_sas(struct mps_softc *sc) } /* - * Assume that discovery events will start right away. Freezing - * the simq will prevent the CAM boottime scanner from running - * before discovery is complete. + * Assume that discovery events will start right away. + * + * Hold off boot until discovery is complete. */ sassc->flags |= MPSSAS_IN_STARTUP | MPSSAS_IN_DISCOVERY; +#if __FreeBSD_version >= 1000039 + xpt_hold_boot(); +#else xpt_freeze_simq(sassc->sim, 1); +#endif sc->sassc->startup_refcount = 0; callout_init(&sassc->discovery_callout, 1 /*mpsafe*/); @@ -777,14 +771,42 @@ mps_attach_sas(struct mps_softc *sc) sassc->tm_count = 0; -#if __FreeBSD_version >= 1000006 - status = xpt_register_async(AC_ADVINFO_CHANGED, mpssas_async, sc, NULL); + /* + * Register for async events so we can determine the EEDP + * capabilities of devices. + */ + status = xpt_create_path(&sassc->path, /*periph*/NULL, + cam_sim_path(sc->sassc->sim), CAM_TARGET_WILDCARD, + CAM_LUN_WILDCARD); if (status != CAM_REQ_CMP) { - mps_dprint(sc, MPS_ERROR, - "Error %#x registering async handler for " - "AC_ADVINFO_CHANGED events\n", status); - } + mps_printf(sc, "Error %#x creating sim path\n", status); + sassc->path = NULL; + } else { + int event; + +#if (__FreeBSD_version >= 1000006) || \ + ((__FreeBSD_version >= 901503) && (__FreeBSD_version < 1000000)) + event = AC_ADVINFO_CHANGED; +#else + event = AC_FOUND_DEVICE; #endif + status = xpt_register_async(event, mpssas_async, sc, + sassc->path); + if (status != CAM_REQ_CMP) { + mps_dprint(sc, MPS_ERROR, + "Error %#x registering async handler for " + "AC_ADVINFO_CHANGED events\n", status); + xpt_free_path(sassc->path); + sassc->path = NULL; + } + } + if (status != CAM_REQ_CMP) { + /* + * EEDP use is the exception, not the rule. + * Warn the user, but do not fail to attach. + */ + mps_printf(sc, "EEDP capabilities disabled.\n"); + } mps_unlock(sc); @@ -823,9 +845,11 @@ mps_detach_sas(struct mps_softc *sc) mps_lock(sc); /* Deregister our async handler */ -#if __FreeBSD_version >= 1000006 - xpt_register_async(0, mpssas_async, sc, NULL); -#endif + if (sassc->path != NULL) { + xpt_register_async(0, mpssas_async, sc, sassc->path); + xpt_free_path(sassc->path); + sassc->path = NULL; + } if (sassc->flags & MPSSAS_IN_STARTUP) xpt_release_simq(sassc->sim, 1); @@ -835,15 +859,7 @@ mps_detach_sas(struct mps_softc *sc) cam_sim_free(sassc->sim, FALSE); } - if (sassc->flags & MPSSAS_SCANTHREAD) { - sassc->flags |= MPSSAS_SHUTDOWN; - wakeup(&sassc->ccb_scanq); - - if (sassc->flags & MPSSAS_SCANTHREAD) { - msleep(&sassc->flags, &sc->mps_mtx, PRIBIO, - "mps_shutdown", 30 * hz); - } - } + sassc->flags |= MPSSAS_SHUTDOWN; mps_unlock(sc); if (sassc->devq != NULL) @@ -934,7 +950,11 @@ mpssas_action(struct cam_sim *sim, union cpi->version_num = 1; cpi->hba_inquiry = PI_SDTR_ABLE|PI_TAG_ABLE|PI_WIDE_16; cpi->target_sprt = 0; +#if __FreeBSD_version >= 1000039 + cpi->hba_misc = PIM_NOBUSRESET | PIM_UNMAPPED | PIM_NOSCAN; +#else cpi->hba_misc = PIM_NOBUSRESET | PIM_UNMAPPED; +#endif cpi->hba_eng_cnt = 0; cpi->max_target = sassc->sc->facts->MaxTargets - 1; cpi->max_lun = 255; @@ -3126,114 +3146,6 @@ mpssas_poll(struct cam_sim *sim) } static void -mpssas_rescan_done(struct cam_periph *periph, union ccb *done_ccb) -{ - struct mpssas_softc *sassc; - char path_str[64]; - - if (done_ccb == NULL) - return; - - sassc = (struct mpssas_softc *)done_ccb->ccb_h.ppriv_ptr1; - - mtx_assert(&sassc->sc->mps_mtx, MA_OWNED); - - xpt_path_string(done_ccb->ccb_h.path, path_str, sizeof(path_str)); - mps_dprint(sassc->sc, MPS_XINFO, "Completing rescan for %s\n", path_str); - - xpt_free_path(done_ccb->ccb_h.path); - xpt_free_ccb(done_ccb); - -#if __FreeBSD_version < 1000006 - /* - * Before completing scan, get EEDP stuff for all of the existing - * targets. - */ - mpssas_check_eedp(sassc); -#endif - -} - -/* thread to handle bus rescans */ -static void -mpssas_scanner_thread(void *arg) -{ - struct mpssas_softc *sassc; - struct mps_softc *sc; - union ccb *ccb; - - sassc = (struct mpssas_softc *)arg; - sc = sassc->sc; - - MPS_FUNCTRACE(sc); - - mps_lock(sc); - for (;;) { - /* Sleep for 1 second and check the queue status*/ - msleep(&sassc->ccb_scanq, &sc->mps_mtx, PRIBIO, - "mps_scanq", 1 * hz); - if (sassc->flags & MPSSAS_SHUTDOWN) { - mps_dprint(sc, MPS_XINFO, "Scanner shutting down\n"); - break; - } -next_work: - // Get first work. - ccb = (union ccb *)TAILQ_FIRST(&sassc->ccb_scanq); - if (ccb == NULL) - continue; - // Got first work. - TAILQ_REMOVE(&sassc->ccb_scanq, &ccb->ccb_h, sim_links.tqe); - xpt_action(ccb); - if (sassc->flags & MPSSAS_SHUTDOWN) { - mps_dprint(sc, MPS_XINFO, "Scanner shutting down\n"); - break; - } - goto next_work; - } - - sassc->flags &= ~MPSSAS_SCANTHREAD; - wakeup(&sassc->flags); - mps_unlock(sc); - mps_dprint(sc, MPS_TRACE, "Scanner exiting\n"); - mps_kproc_exit(0); -} - -/* - * This function will send READ_CAP_16 to find out EEDP protection mode. - * It will check inquiry data before sending READ_CAP_16. - * Callback for READ_CAP_16 is "mpssas_read_cap_done". - * This is insternal scsi command and we need to take care release of devq, if - * CAM_DEV_QFRZN is set. Driver needs to release devq if it has frozen any. - * xpt_release_devq is called from mpssas_read_cap_done. - * - * All other commands will be handled by periph layer and there it will - * check for "CAM_DEV_QFRZN" and release of devq will be done. - */ -static void -mpssas_rescan(struct mpssas_softc *sassc, union ccb *ccb) -{ - char path_str[64]; - - MPS_FUNCTRACE(sassc->sc); - - mtx_assert(&sassc->sc->mps_mtx, MA_OWNED); - - if (ccb == NULL) - return; - - xpt_path_string(ccb->ccb_h.path, path_str, sizeof(path_str)); - mps_dprint(sassc->sc, MPS_XINFO, "Queueing rescan for %s\n", path_str); - - /* Prepare request */ - ccb->ccb_h.ppriv_ptr1 = sassc; - ccb->ccb_h.cbfcnp = mpssas_rescan_done; - xpt_setup_ccb(&ccb->ccb_h, ccb->ccb_h.path, MPS_PRIORITY_XPT); - TAILQ_INSERT_TAIL(&sassc->ccb_scanq, &ccb->ccb_h, sim_links.tqe); - wakeup(&sassc->ccb_scanq); -} - -#if __FreeBSD_version >= 1000006 -static void mpssas_async(void *callback_arg, uint32_t code, struct cam_path *path, void *arg) { @@ -3242,6 +3154,8 @@ mpssas_async(void *callback_arg, uint32_ sc = (struct mps_softc *)callback_arg; switch (code) { +#if (__FreeBSD_version >= 1000006) || \ + ((__FreeBSD_version >= 901503) && (__FreeBSD_version < 1000000)) case AC_ADVINFO_CHANGED: { struct mpssas_target *target; struct mpssas_softc *sassc; @@ -3264,13 +3178,6 @@ mpssas_async(void *callback_arg, uint32_ break; /* - * We're only interested in devices that are attached to - * this controller. - */ - if (xpt_path_path_id(path) != sassc->sim->path_id) - break; - - /* * We should have a handle for this, but check to make sure. */ target = &sassc->targets[xpt_path_target_id(path)]; @@ -3321,177 +3228,147 @@ mpssas_async(void *callback_arg, uint32_ } break; } +#else + case AC_FOUND_DEVICE: { + struct ccb_getdev *cgd; + + cgd = arg; + mpssas_check_eedp(sc, path, cgd); + break; + } +#endif default: break; } } -#else /* __FreeBSD_version >= 1000006 */ +#if (__FreeBSD_version < 901503) || \ + ((__FreeBSD_version >= 1000000) && (__FreeBSD_version < 1000006)) static void -mpssas_check_eedp(struct mpssas_softc *sassc) +mpssas_check_eedp(struct mps_softc *sc, struct cam_path *path, + struct ccb_getdev *cgd) { - struct mps_softc *sc = sassc->sc; + struct mpssas_softc *sassc = sc->sassc; struct ccb_scsiio *csio; struct scsi_read_capacity_16 *scsi_cmd; struct scsi_read_capacity_eedp *rcap_buf; - union ccb *ccb; - path_id_t pathid = cam_sim_path(sassc->sim); + path_id_t pathid; target_id_t targetid; lun_id_t lunid; - struct cam_periph *found_periph; + union ccb *ccb; + struct cam_path *local_path; struct mpssas_target *target; struct mpssas_lun *lun; uint8_t found_lun; - struct ccb_getdev cgd; char path_str[64]; - /* - * Issue a READ CAPACITY 16 command to each LUN of each target. This - * info is used to determine if the LUN is formatted for EEDP support. - */ - for (targetid = 0; targetid < sc->facts->MaxTargets; targetid++) { - target = &sassc->targets[targetid]; - if (target->handle == 0x0) { - continue; - } - - lunid = 0; - do { - ccb = xpt_alloc_ccb_nowait(); - if (ccb == NULL) { - mps_dprint(sc, MPS_ERROR, "Unable to alloc CCB " - "for EEDP support.\n"); - return; - } + sassc = sc->sassc; + pathid = cam_sim_path(sassc->sim); + targetid = xpt_path_target_id(path); + lunid = xpt_path_lun_id(path); - if (xpt_create_path(&ccb->ccb_h.path, NULL, - pathid, targetid, lunid) != CAM_REQ_CMP) { - mps_dprint(sc, MPS_ERROR, "Unable to create " - "path for EEDP support\n"); - xpt_free_ccb(ccb); - return; - } + target = &sassc->targets[targetid]; + if (target->handle == 0x0) + return; - /* - * If a periph is returned, the LUN exists. Create an - * entry in the target's LUN list. - */ - if ((found_periph = cam_periph_find(ccb->ccb_h.path, - NULL)) != NULL) { - /* - * If LUN is already in list, don't create a new - * one. - */ - found_lun = FALSE; - SLIST_FOREACH(lun, &target->luns, lun_link) { - if (lun->lun_id == lunid) { - found_lun = TRUE; - break; - } - } - if (!found_lun) { - lun = malloc(sizeof(struct mpssas_lun), - M_MPT2, M_NOWAIT | M_ZERO); - if (lun == NULL) { - mps_dprint(sc, MPS_ERROR, - "Unable to alloc LUN for " - "EEDP support.\n"); - xpt_free_path(ccb->ccb_h.path); - xpt_free_ccb(ccb); - return; - } - lun->lun_id = lunid; - SLIST_INSERT_HEAD(&target->luns, lun, - lun_link); - } - lunid++; - /* Before Issuing READ CAPACITY 16, - * check Device type. - */ - xpt_setup_ccb(&cgd.ccb_h, ccb->ccb_h.path, - CAM_PRIORITY_NORMAL); - cgd.ccb_h.func_code = XPT_GDEV_TYPE; - xpt_action((union ccb *)&cgd); + /* + * Determine if the device is EEDP capable. + * + * If this flag is set in the inquiry data, + * the device supports protection information, + * and must support the 16 byte read + * capacity command, otherwise continue without + * sending read cap 16 + */ + if ((cgd->inq_data.spc3_flags & SPC3_SID_PROTECT) == 0) + return; - /* - * If this flag is set in the inquiry data, - * the device supports protection information, - * and must support the 16 byte read - * capacity command, otherwise continue without - * sending read cap 16 - */ + /* + * Issue a READ CAPACITY 16 command. This info + * is used to determine if the LUN is formatted + * for EEDP support. + */ + ccb = xpt_alloc_ccb_nowait(); + if (ccb == NULL) { + mps_dprint(sc, MPS_ERROR, "Unable to alloc CCB " + "for EEDP support.\n"); + return; + } - xpt_path_string(ccb->ccb_h.path, path_str, - sizeof(path_str)); + if (xpt_create_path(&local_path, xpt_periph, + pathid, targetid, lunid) != CAM_REQ_CMP) { + mps_dprint(sc, MPS_ERROR, "Unable to create " + "path for EEDP support\n"); + xpt_free_ccb(ccb); + return; + } - if ((cgd.inq_data.spc3_flags & - SPC3_SID_PROTECT) == 0) { - xpt_free_path(ccb->ccb_h.path); - xpt_free_ccb(ccb); - continue; - } - - mps_dprint(sc, MPS_XINFO, - "Sending read cap: path %s" - " handle %d\n", path_str, target->handle ); - - /* - * Issue a READ CAPACITY 16 command for the LUN. - * The mpssas_read_cap_done function will load - * the read cap info into the LUN struct. - */ - rcap_buf = - malloc(sizeof(struct scsi_read_capacity_eedp), - M_MPT2, M_NOWAIT| M_ZERO); - if (rcap_buf == NULL) { - mps_dprint(sc, MPS_ERROR, "Unable to alloc read " - "capacity buffer for EEDP support.\n"); - xpt_free_path(ccb->ccb_h.path); - xpt_free_ccb(ccb); - return; - } - csio = &ccb->csio; - csio->ccb_h.func_code = XPT_SCSI_IO; - csio->ccb_h.flags = CAM_DIR_IN; - csio->ccb_h.retry_count = 4; - csio->ccb_h.cbfcnp = mpssas_read_cap_done; - csio->ccb_h.timeout = 60000; - csio->data_ptr = (uint8_t *)rcap_buf; - csio->dxfer_len = sizeof(struct - scsi_read_capacity_eedp); - csio->sense_len = MPS_SENSE_LEN; - csio->cdb_len = sizeof(*scsi_cmd); - csio->tag_action = MSG_SIMPLE_Q_TAG; - - scsi_cmd = (struct scsi_read_capacity_16 *) - &csio->cdb_io.cdb_bytes; - bzero(scsi_cmd, sizeof(*scsi_cmd)); - scsi_cmd->opcode = 0x9E; - scsi_cmd->service_action = SRC16_SERVICE_ACTION; - ((uint8_t *)scsi_cmd)[13] = sizeof(struct - scsi_read_capacity_eedp); + /* + * If LUN is already in list, don't create a new + * one. + */ + found_lun = FALSE; + SLIST_FOREACH(lun, &target->luns, lun_link) { + if (lun->lun_id == lunid) { + found_lun = TRUE; + break; + } + } + if (!found_lun) { + lun = malloc(sizeof(struct mpssas_lun), M_MPT2, + M_NOWAIT | M_ZERO); + if (lun == NULL) { + mps_dprint(sc, MPS_ERROR, + "Unable to alloc LUN for EEDP support.\n"); + xpt_free_path(local_path); + xpt_free_ccb(ccb); + return; + } + lun->lun_id = lunid; + SLIST_INSERT_HEAD(&target->luns, lun, + lun_link); + } - /* - * Set the path, target and lun IDs for the READ - * CAPACITY request. - */ - ccb->ccb_h.path_id = - xpt_path_path_id(ccb->ccb_h.path); - ccb->ccb_h.target_id = - xpt_path_target_id(ccb->ccb_h.path); - ccb->ccb_h.target_lun = - xpt_path_lun_id(ccb->ccb_h.path); + xpt_path_string(local_path, path_str, sizeof(path_str)); + mps_dprint(sc, MPS_INFO, "Sending read cap: path %s handle %d\n", + path_str, target->handle); - ccb->ccb_h.ppriv_ptr1 = sassc; - xpt_action(ccb); - } else { - xpt_free_path(ccb->ccb_h.path); - xpt_free_ccb(ccb); - } - } while (found_periph); + /* + * Issue a READ CAPACITY 16 command for the LUN. + * The mpssas_read_cap_done function will load + * the read cap info into the LUN struct. + */ + rcap_buf = malloc(sizeof(struct scsi_read_capacity_eedp), + M_MPT2, M_NOWAIT | M_ZERO); + if (rcap_buf == NULL) { + mps_dprint(sc, MPS_FAULT, + "Unable to alloc read capacity buffer for EEDP support.\n"); + xpt_free_path(ccb->ccb_h.path); + xpt_free_ccb(ccb); + return; } -} + xpt_setup_ccb(&ccb->ccb_h, local_path, CAM_PRIORITY_XPT); + csio = &ccb->csio; + csio->ccb_h.func_code = XPT_SCSI_IO; + csio->ccb_h.flags = CAM_DIR_IN; + csio->ccb_h.retry_count = 4; + csio->ccb_h.cbfcnp = mpssas_read_cap_done; + csio->ccb_h.timeout = 60000; + csio->data_ptr = (uint8_t *)rcap_buf; + csio->dxfer_len = sizeof(struct scsi_read_capacity_eedp); + csio->sense_len = MPS_SENSE_LEN; + csio->cdb_len = sizeof(*scsi_cmd); + csio->tag_action = MSG_SIMPLE_Q_TAG; + + scsi_cmd = (struct scsi_read_capacity_16 *)&csio->cdb_io.cdb_bytes; + bzero(scsi_cmd, sizeof(*scsi_cmd)); + scsi_cmd->opcode = 0x9E; + scsi_cmd->service_action = SRC16_SERVICE_ACTION; + ((uint8_t *)scsi_cmd)[13] = sizeof(struct scsi_read_capacity_eedp); + ccb->ccb_h.ppriv_ptr1 = sassc; + xpt_action(ccb); +} static void mpssas_read_cap_done(struct cam_periph *periph, union ccb *done_ccb) @@ -3556,7 +3433,8 @@ mpssas_read_cap_done(struct cam_periph * xpt_free_path(done_ccb->ccb_h.path); xpt_free_ccb(done_ccb); } -#endif /* __FreeBSD_version >= 1000006 */ +#endif /* (__FreeBSD_version < 901503) || \ + ((__FreeBSD_version >= 1000000) && (__FreeBSD_version < 1000006)) */ int mpssas_startup(struct mps_softc *sc) Modified: head/sys/dev/mps/mps_sas.h ============================================================================== --- head/sys/dev/mps/mps_sas.h Mon Jul 22 18:18:21 2013 (r253548) +++ head/sys/dev/mps/mps_sas.h Mon Jul 22 18:37:07 2013 (r253549) @@ -87,7 +87,6 @@ struct mpssas_softc { #define MPSSAS_DISCOVERY_TIMEOUT_PENDING (1 << 2) #define MPSSAS_QUEUE_FROZEN (1 << 3) #define MPSSAS_SHUTDOWN (1 << 4) -#define MPSSAS_SCANTHREAD (1 << 5) struct mpssas_target *targets; struct cam_devq *devq; struct cam_sim *sim; @@ -101,9 +100,6 @@ struct mpssas_softc { u_int tm_count; struct proc *sysctl_proc; - TAILQ_HEAD(, ccb_hdr) ccb_scanq; - struct proc *rescan_thread; - struct taskqueue *ev_tq; struct task ev_task; TAILQ_HEAD(, mps_fw_event_work) ev_queue; Modified: head/sys/dev/mps/mps_sas_lsi.c ============================================================================== --- head/sys/dev/mps/mps_sas_lsi.c Mon Jul 22 18:18:21 2013 (r253548) +++ head/sys/dev/mps/mps_sas_lsi.c Mon Jul 22 18:37:07 2013 (r253549) @@ -699,7 +699,10 @@ mpssas_add_device(struct mps_softc *sc, mps_dprint(sc, MPS_MAPPING, "Found device <%s> <%s> <0x%04x> <%d/%d>\n", devstring, mps_describe_table(mps_linkrate_names, targ->linkrate), targ->handle, targ->encl_handle, targ->encl_slot); + +#if __FreeBSD_version < 1000039 if ((sassc->flags & MPSSAS_IN_STARTUP) == 0) +#endif mpssas_rescan_target(sc, targ); mps_dprint(sc, MPS_MAPPING, "Target id 0x%x added\n", targ->tid); out: Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Mon Jul 22 18:18:21 2013 (r253548) +++ head/sys/sys/param.h Mon Jul 22 18:37:07 2013 (r253549) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1000038 /* Master, propagated to newvers */ +#define __FreeBSD_version 1000039 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@FreeBSD.ORG Mon Jul 22 18:41:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 79A4EAAD; Mon, 22 Jul 2013 18:41:54 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6A0BB2DF4; Mon, 22 Jul 2013 18:41:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6MIfs52075670; Mon, 22 Jul 2013 18:41:54 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6MIfsoQ075667; Mon, 22 Jul 2013 18:41:54 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201307221841.r6MIfsoQ075667@svn.freebsd.org> From: "Kenneth D. Merry" Date: Mon, 22 Jul 2013 18:41:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253550 - head/sys/dev/mps X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Jul 2013 18:41:54 -0000 Author: ken Date: Mon Jul 22 18:41:53 2013 New Revision: 253550 URL: http://svnweb.freebsd.org/changeset/base/253550 Log: Merge in phase 14+ -> 16 mps driver fixes from LSI: --------------------------------------------------------------- System panics during a Port reset with ouststanding I/O --------------------------------------------------------------- It is possible to call mps_mapping_free_memory after this memory is already freed, causing a panic. Removed this extra call to mps_mappiing_free_memory and call mps_mapping_exit in place of the mps_mapping_free_memory call so that any outstanding mapping items can be flushed before memory is freed. --------------------------------------------------------------- Correct memory leak during a Port reset with ouststanding I/O --------------------------------------------------------------- In mps_reinit function, the mapping memory was not being freed before being re-allocated. Added line to call the memory free function for mapping memory. --------------------------------------------------------------- Use CAM_SIM_QUEUED flag in Driver IO path. --------------------------------------------------------------- This flag informs the XPT that successful abort of a CCB requires an abort ccb to be issued to the SIM. While processing SCSI IO's, set the CAM_SIM_QUEUED flag in the status for the IO. When the command completes, clear this flag. --------------------------------------------------------------- Check for CAM_REQ_INPROG in I/O path. --------------------------------------------------------------- Added a check in mpssas_action_scsiio for the In Progress status for the IO. If this flag is set, the IO has already been aborted by the upper layer (before CAM_SIM_QUEUED was set) and there is no need to send the IO. The request will be completed without error. --------------------------------------------------------------- Improve "doorbell handshake method" for mps_get_iocfacts --------------------------------------------------------------- Removed call to get Port Facts since this information is not used currently. Added mps_iocfacts_allocate function to allocate memory that is based on IOC Facts data. Added mps_iocfacts_free function to free memory that is based on IOC Facts data. Both of the functions are used when a Diag Reset is performed or when the driver is attached/detached. This is needed in case IOC Facts changes after a Diag Reset, which could happen if FW is upgraded. Moved call of mps_bases_static_config_pages from the attach routine to after the IOC is ready to process accesses based on the new memory allocations (instead of polling through the Doorbell). --------------------------------------------------------------- Set TimeStamp in INIT message in millisecond format Set the IOC --------------------------------------------------------------- --------------------------------------------------------------- Prefer mps_wait_command to mps_request_polled --------------------------------------------------------------- Instead of using mps_request_polled, call mps_wait_command whenever possible. Change the mps_wait_command function to check the current context and either use interrupt context or poll if required by using the pause or DELAY function. Added a check after waiting 50mSecs to see if the command has timed out. This is only done if polliing, the msleep command will automatically timeout if the command has taken too long to complete. --------------------------------------------------------------- Integrated RAID: Volume Activation Failed error message is displayed though the volume has been activated. --------------------------------------------------------------- Instead of failing an IOCTL request that does not have a large enough buffer to hold the complete reply, copy as much data from the reply as possible into the user's buffer and log a message saying that the user's buffer was smaller than the returned data. --------------------------------------------------------------- mapping_add_new_device failure due to persistent table FULL --------------------------------------------------------------- When a new device is added, if it is determined that the device persistent table is being used and is full, instead of displaying a message for this condition every time, only log a message if the MPS_INFO bit is set in the debug_flags. Submitted by: LSI MFC after: 1 week Modified: head/sys/dev/mps/mps.c head/sys/dev/mps/mps_config.c head/sys/dev/mps/mps_mapping.c head/sys/dev/mps/mps_sas.c head/sys/dev/mps/mps_sas_lsi.c head/sys/dev/mps/mps_user.c head/sys/dev/mps/mpsvar.h Modified: head/sys/dev/mps/mps.c ============================================================================== --- head/sys/dev/mps/mps.c Mon Jul 22 18:37:07 2013 (r253549) +++ head/sys/dev/mps/mps.c Mon Jul 22 18:41:53 2013 (r253550) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -61,6 +62,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include @@ -73,13 +75,19 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include static int mps_diag_reset(struct mps_softc *sc, int sleep_flag); static int mps_init_queues(struct mps_softc *sc); static int mps_message_unit_reset(struct mps_softc *sc, int sleep_flag); static int mps_transition_operational(struct mps_softc *sc); +static int mps_iocfacts_allocate(struct mps_softc *sc, uint8_t attaching); +static void mps_iocfacts_free(struct mps_softc *sc); static void mps_startup(void *arg); static int mps_send_iocinit(struct mps_softc *sc); +static int mps_alloc_queues(struct mps_softc *sc); +static int mps_alloc_replies(struct mps_softc *sc); +static int mps_alloc_requests(struct mps_softc *sc); static int mps_attach_log(struct mps_softc *sc); static __inline void mps_complete_command(struct mps_softc *sc, struct mps_command *cm); @@ -89,6 +97,7 @@ static void mps_config_complete(struct m static void mps_periodic(void *); static int mps_reregister_events(struct mps_softc *sc); static void mps_enqueue_request(struct mps_softc *sc, struct mps_command *cm); +static int mps_get_iocfacts(struct mps_softc *sc, MPI2_IOC_FACTS_REPLY *facts); static int mps_wait_db_ack(struct mps_softc *sc, int timeout, int sleep_flag); SYSCTL_NODE(_hw, OID_AUTO, mps, CTLFLAG_RD, 0, "MPS Driver Parameters"); @@ -149,7 +158,8 @@ mps_diag_reset(struct mps_softc *sc,int mpt2_reset_magic[i]); /* wait 100 msec */ if (mtx_owned(&sc->mps_mtx) && sleep_flag == CAN_SLEEP) - msleep(&sc->msleep_fake_chan, &sc->mps_mtx, 0, "mpsdiag", hz/10); + msleep(&sc->msleep_fake_chan, &sc->mps_mtx, 0, + "mpsdiag", hz/10); else if (sleep_flag == CAN_SLEEP) pause("mpsdiag", hz/10); else @@ -173,7 +183,8 @@ mps_diag_reset(struct mps_softc *sc,int for (i = 0; i < 60000; i++) { /* wait 50 msec */ if (mtx_owned(&sc->mps_mtx) && sleep_flag == CAN_SLEEP) - msleep(&sc->msleep_fake_chan, &sc->mps_mtx, 0, "mpsdiag", hz/20); + msleep(&sc->msleep_fake_chan, &sc->mps_mtx, 0, + "mpsdiag", hz/20); else if (sleep_flag == CAN_SLEEP) pause("mpsdiag", hz/20); else @@ -303,9 +314,357 @@ mps_transition_operational(struct mps_so return (error); } +/* + * This is called during attach and when re-initializing due to a Diag Reset. + * IOC Facts is used to allocate many of the structures needed by the driver. + * If called from attach, de-allocation is not required because the driver has + * not allocated any structures yet, but if called from a Diag Reset, previously + * allocated structures based on IOC Facts will need to be freed and re- + * allocated bases on the latest IOC Facts. + */ +static int +mps_iocfacts_allocate(struct mps_softc *sc, uint8_t attaching) +{ + int error, i; + Mpi2IOCFactsReply_t saved_facts; + uint8_t saved_mode, reallocating; + struct mpssas_lun *lun, *lun_tmp; + struct mpssas_target *targ; + + mps_dprint(sc, MPS_TRACE, "%s\n", __func__); + + /* Save old IOC Facts and then only reallocate if Facts have changed */ + if (!attaching) { + bcopy(sc->facts, &saved_facts, sizeof(MPI2_IOC_FACTS_REPLY)); + } + + /* + * Get IOC Facts. In all cases throughout this function, panic if doing + * a re-initialization and only return the error if attaching so the OS + * can handle it. + */ + if ((error = mps_get_iocfacts(sc, sc->facts)) != 0) { + if (attaching) { + mps_dprint(sc, MPS_FAULT, "%s failed to get IOC Facts " + "with error %d\n", __func__, error); + return (error); + } else { + panic("%s failed to get IOC Facts with error %d\n", + __func__, error); + } + } + + mps_print_iocfacts(sc, sc->facts); + + snprintf(sc->fw_version, sizeof(sc->fw_version), + "%02d.%02d.%02d.%02d", + sc->facts->FWVersion.Struct.Major, + sc->facts->FWVersion.Struct.Minor, + sc->facts->FWVersion.Struct.Unit, + sc->facts->FWVersion.Struct.Dev); + + mps_printf(sc, "Firmware: %s, Driver: %s\n", sc->fw_version, + MPS_DRIVER_VERSION); + mps_printf(sc, "IOCCapabilities: %b\n", sc->facts->IOCCapabilities, + "\20" "\3ScsiTaskFull" "\4DiagTrace" "\5SnapBuf" "\6ExtBuf" + "\7EEDP" "\10BiDirTarg" "\11Multicast" "\14TransRetry" "\15IR" + "\16EventReplay" "\17RaidAccel" "\20MSIXIndex" "\21HostDisc"); + + /* + * If the chip doesn't support event replay then a hard reset will be + * required to trigger a full discovery. Do the reset here then + * retransition to Ready. A hard reset might have already been done, + * but it doesn't hurt to do it again. Only do this if attaching, not + * for a Diag Reset. + */ + if (attaching) { + if ((sc->facts->IOCCapabilities & + MPI2_IOCFACTS_CAPABILITY_EVENT_REPLAY) == 0) { + mps_diag_reset(sc, NO_SLEEP); + if ((error = mps_transition_ready(sc)) != 0) { + mps_dprint(sc, MPS_FAULT, "%s failed to " + "transition to ready with error %d\n", + __func__, error); + return (error); + } + } + } + + /* + * Set flag if IR Firmware is loaded. If the RAID Capability has + * changed from the previous IOC Facts, log a warning, but only if + * checking this after a Diag Reset and not during attach. + */ + saved_mode = sc->ir_firmware; + if (sc->facts->IOCCapabilities & + MPI2_IOCFACTS_CAPABILITY_INTEGRATED_RAID) + sc->ir_firmware = 1; + if (!attaching) { + if (sc->ir_firmware != saved_mode) { + mps_dprint(sc, MPS_FAULT, "%s new IR/IT mode in IOC " + "Facts does not match previous mode\n", __func__); + } + } + + /* Only deallocate and reallocate if relevant IOC Facts have changed */ + reallocating = FALSE; + if ((!attaching) && + ((saved_facts.MsgVersion != sc->facts->MsgVersion) || + (saved_facts.HeaderVersion != sc->facts->HeaderVersion) || + (saved_facts.MaxChainDepth != sc->facts->MaxChainDepth) || + (saved_facts.RequestCredit != sc->facts->RequestCredit) || + (saved_facts.ProductID != sc->facts->ProductID) || + (saved_facts.IOCCapabilities != sc->facts->IOCCapabilities) || + (saved_facts.IOCRequestFrameSize != + sc->facts->IOCRequestFrameSize) || + (saved_facts.MaxTargets != sc->facts->MaxTargets) || + (saved_facts.MaxSasExpanders != sc->facts->MaxSasExpanders) || + (saved_facts.MaxEnclosures != sc->facts->MaxEnclosures) || + (saved_facts.HighPriorityCredit != sc->facts->HighPriorityCredit) || + (saved_facts.MaxReplyDescriptorPostQueueDepth != + sc->facts->MaxReplyDescriptorPostQueueDepth) || + (saved_facts.ReplyFrameSize != sc->facts->ReplyFrameSize) || + (saved_facts.MaxVolumes != sc->facts->MaxVolumes) || + (saved_facts.MaxPersistentEntries != + sc->facts->MaxPersistentEntries))) { + reallocating = TRUE; + } + + /* + * Some things should be done if attaching or re-allocating after a Diag + * Reset, but are not needed after a Diag Reset if the FW has not + * changed. + */ + if (attaching || reallocating) { + /* + * Check if controller supports FW diag buffers and set flag to + * enable each type. + */ + if (sc->facts->IOCCapabilities & + MPI2_IOCFACTS_CAPABILITY_DIAG_TRACE_BUFFER) + sc->fw_diag_buffer_list[MPI2_DIAG_BUF_TYPE_TRACE]. + enabled = TRUE; + if (sc->facts->IOCCapabilities & + MPI2_IOCFACTS_CAPABILITY_SNAPSHOT_BUFFER) + sc->fw_diag_buffer_list[MPI2_DIAG_BUF_TYPE_SNAPSHOT]. + enabled = TRUE; + if (sc->facts->IOCCapabilities & + MPI2_IOCFACTS_CAPABILITY_EXTENDED_BUFFER) + sc->fw_diag_buffer_list[MPI2_DIAG_BUF_TYPE_EXTENDED]. + enabled = TRUE; + + /* + * Set flag if EEDP is supported and if TLR is supported. + */ + if (sc->facts->IOCCapabilities & MPI2_IOCFACTS_CAPABILITY_EEDP) + sc->eedp_enabled = TRUE; + if (sc->facts->IOCCapabilities & MPI2_IOCFACTS_CAPABILITY_TLR) + sc->control_TLR = TRUE; + + /* + * Size the queues. Since the reply queues always need one free + * entry, we'll just deduct one reply message here. + */ + sc->num_reqs = MIN(MPS_REQ_FRAMES, sc->facts->RequestCredit); + sc->num_replies = MIN(MPS_REPLY_FRAMES + MPS_EVT_REPLY_FRAMES, + sc->facts->MaxReplyDescriptorPostQueueDepth) - 1; + + /* + * Initialize all Tail Queues + */ + TAILQ_INIT(&sc->req_list); + TAILQ_INIT(&sc->high_priority_req_list); + TAILQ_INIT(&sc->chain_list); + TAILQ_INIT(&sc->tm_list); + } + + /* + * If doing a Diag Reset and the FW is significantly different + * (reallocating will be set above in IOC Facts comparison), then all + * buffers based on the IOC Facts will need to be freed before they are + * reallocated. + */ + if (reallocating) { + mps_iocfacts_free(sc); + + /* + * The number of targets is based on IOC Facts, so free all of + * the allocated LUNs for each target and then the target buffer + * itself. + */ + for (i=0; i< saved_facts.MaxTargets; i++) { + targ = &sc->sassc->targets[i]; + SLIST_FOREACH_SAFE(lun, &targ->luns, lun_link, + lun_tmp) { + free(lun, M_MPT2); + } + } + free(sc->sassc->targets, M_MPT2); + + sc->sassc->targets = malloc(sizeof(struct mpssas_target) * + sc->facts->MaxTargets, M_MPT2, M_WAITOK|M_ZERO); + if (!sc->sassc->targets) { + panic("%s failed to alloc targets with error %d\n", + __func__, ENOMEM); + } + } + + /* + * Any deallocation has been completed. Now start reallocating + * if needed. Will only need to reallocate if attaching or if the new + * IOC Facts are different from the previous IOC Facts after a Diag + * Reset. Targets have already been allocated above if needed. + */ + if (attaching || reallocating) { + if (((error = mps_alloc_queues(sc)) != 0) || + ((error = mps_alloc_replies(sc)) != 0) || + ((error = mps_alloc_requests(sc)) != 0)) { + if (attaching ) { + mps_dprint(sc, MPS_FAULT, "%s failed to alloc " + "queues with error %d\n", __func__, error); + mps_free(sc); + return (error); + } else { + panic("%s failed to alloc queues with error " + "%d\n", __func__, error); + } + } + } + + /* Always initialize the queues */ + bzero(sc->free_queue, sc->fqdepth * 4); + mps_init_queues(sc); + + /* + * Always get the chip out of the reset state, but only panic if not + * attaching. If attaching and there is an error, that is handled by + * the OS. + */ + error = mps_transition_operational(sc); + if (error != 0) { + if (attaching) { + mps_printf(sc, "%s failed to transition to operational " + "with error %d\n", __func__, error); + mps_free(sc); + return (error); + } else { + panic("%s failed to transition to operational with " + "error %d\n", __func__, error); + } + } + + /* + * Finish the queue initialization. + * These are set here instead of in mps_init_queues() because the + * IOC resets these values during the state transition in + * mps_transition_operational(). The free index is set to 1 + * because the corresponding index in the IOC is set to 0, and the + * IOC treats the queues as full if both are set to the same value. + * Hence the reason that the queue can't hold all of the possible + * replies. + */ + sc->replypostindex = 0; + mps_regwrite(sc, MPI2_REPLY_FREE_HOST_INDEX_OFFSET, sc->replyfreeindex); + mps_regwrite(sc, MPI2_REPLY_POST_HOST_INDEX_OFFSET, 0); + + /* + * Attach the subsystems so they can prepare their event masks. + */ + /* XXX Should be dynamic so that IM/IR and user modules can attach */ + if (attaching) { + if (((error = mps_attach_log(sc)) != 0) || + ((error = mps_attach_sas(sc)) != 0) || + ((error = mps_attach_user(sc)) != 0)) { + mps_printf(sc, "%s failed to attach all subsystems: " + "error %d\n", __func__, error); + mps_free(sc); + return (error); + } + + if ((error = mps_pci_setup_interrupts(sc)) != 0) { + mps_printf(sc, "%s failed to setup interrupts\n", + __func__); + mps_free(sc); + return (error); + } + } + + /* + * Set flag if this is a WD controller. This shouldn't ever change, but + * reset it after a Diag Reset, just in case. + */ + sc->WD_available = FALSE; + if (pci_get_device(sc->mps_dev) == MPI2_MFGPAGE_DEVID_SSS6200) + sc->WD_available = TRUE; + + return (error); +} + +/* + * This is called if memory is being free (during detach for example) and when + * buffers need to be reallocated due to a Diag Reset. + */ +static void +mps_iocfacts_free(struct mps_softc *sc) +{ + struct mps_command *cm; + int i; + + mps_dprint(sc, MPS_TRACE, "%s\n", __func__); + + if (sc->post_busaddr != 0) + bus_dmamap_unload(sc->queues_dmat, sc->queues_map); + if (sc->post_queue != NULL) + bus_dmamem_free(sc->queues_dmat, sc->post_queue, + sc->queues_map); + if (sc->queues_dmat != NULL) + bus_dma_tag_destroy(sc->queues_dmat); + + if (sc->chain_busaddr != 0) + bus_dmamap_unload(sc->chain_dmat, sc->chain_map); + if (sc->chain_frames != NULL) + bus_dmamem_free(sc->chain_dmat, sc->chain_frames, + sc->chain_map); + if (sc->chain_dmat != NULL) + bus_dma_tag_destroy(sc->chain_dmat); + + if (sc->sense_busaddr != 0) + bus_dmamap_unload(sc->sense_dmat, sc->sense_map); + if (sc->sense_frames != NULL) + bus_dmamem_free(sc->sense_dmat, sc->sense_frames, + sc->sense_map); + if (sc->sense_dmat != NULL) + bus_dma_tag_destroy(sc->sense_dmat); + + if (sc->reply_busaddr != 0) + bus_dmamap_unload(sc->reply_dmat, sc->reply_map); + if (sc->reply_frames != NULL) + bus_dmamem_free(sc->reply_dmat, sc->reply_frames, + sc->reply_map); + if (sc->reply_dmat != NULL) + bus_dma_tag_destroy(sc->reply_dmat); + + if (sc->req_busaddr != 0) + bus_dmamap_unload(sc->req_dmat, sc->req_map); + if (sc->req_frames != NULL) + bus_dmamem_free(sc->req_dmat, sc->req_frames, sc->req_map); + if (sc->req_dmat != NULL) + bus_dma_tag_destroy(sc->req_dmat); + + if (sc->chains != NULL) + free(sc->chains, M_MPT2); + if (sc->commands != NULL) { + for (i = 1; i < sc->num_reqs; i++) { + cm = &sc->commands[i]; + bus_dmamap_destroy(sc->buffer_dmat, cm->cm_dmamap); + } + free(sc->commands, M_MPT2); + } + if (sc->buffer_dmat != NULL) + bus_dma_tag_destroy(sc->buffer_dmat); +} + /* - * XXX Some of this should probably move to mps.c - * * The terms diag reset and hard reset are used interchangeably in the MPI * docs to mean resetting the controller chip. In this code diag reset * cleans everything up, and the hard reset function just sends the reset @@ -317,7 +676,6 @@ int mps_reinit(struct mps_softc *sc) { int error; - uint32_t db; MPS_FUNCTRACE(sc); @@ -335,6 +693,9 @@ mps_reinit(struct mps_softc *sc) */ sc->mps_flags |= MPS_FLAGS_DIAGRESET; + /* + * Mask interrupts here. + */ mps_dprint(sc, MPS_INIT, "%s mask interrupts\n", __func__); mps_mask_intr(sc); @@ -351,39 +712,42 @@ mps_reinit(struct mps_softc *sc) /* Give the I/O subsystem special priority to get itself prepared */ mpssas_handle_reinit(sc); - /* reinitialize queues after the reset */ - bzero(sc->free_queue, sc->fqdepth * 4); - mps_init_queues(sc); - - /* get the chip out of the reset state */ - error = mps_transition_operational(sc); - if (error != 0) - /* XXXSL No need to panic here */ - panic("%s transition operational failed with error %d\n", + /* + * Get IOC Facts and allocate all structures based on this information. + * The attach function will also call mps_iocfacts_allocate at startup. + * If relevant values have changed in IOC Facts, this function will free + * all of the memory based on IOC Facts and reallocate that memory. + */ + if ((error = mps_iocfacts_allocate(sc, FALSE)) != 0) { + panic("%s IOC Facts based allocation failed with error %d\n", __func__, error); + } - /* Reinitialize the reply queue. This is delicate because this - * function is typically invoked by task mgmt completion callbacks, - * which are called by the interrupt thread. We need to make sure - * the interrupt handler loop will exit when we return to it, and - * that it will recognize the indexes we've changed. + /* + * Mapping structures will be re-allocated after getting IOC Page8, so + * free these structures here. */ - sc->replypostindex = 0; - mps_regwrite(sc, MPI2_REPLY_FREE_HOST_INDEX_OFFSET, sc->replyfreeindex); - mps_regwrite(sc, MPI2_REPLY_POST_HOST_INDEX_OFFSET, sc->replypostindex); - - db = mps_regread(sc, MPI2_DOORBELL_OFFSET); - mps_dprint(sc, MPS_INIT, "%s doorbell 0x%08x\n", __func__, db); - - mps_dprint(sc, MPS_INIT, "%s unmask interrupts post %u free %u\n", - __func__, sc->replypostindex, sc->replyfreeindex); + mps_mapping_exit(sc); + /* + * The static page function currently read is IOC Page8. Others can be + * added in future. It's possible that the values in IOC Page8 have + * changed after a Diag Reset due to user modification, so always read + * these. Interrupts are masked, so unmask them before getting config + * pages. + */ mps_unmask_intr(sc); + sc->mps_flags &= ~MPS_FLAGS_DIAGRESET; + mps_base_static_config_pages(sc); - mps_dprint(sc, MPS_INIT, "%s restarting post %u free %u\n", __func__, - sc->replypostindex, sc->replyfreeindex); + /* + * Some mapping info is based in IOC Page8 data, so re-initialize the + * mapping tables. + */ + mps_mapping_initialize(sc); - /* restart will reload the event masks clobbered by the reset, and + /* + * Restart will reload the event masks clobbered by the reset, and * then enable the port. */ mps_reregister_events(sc); @@ -392,8 +756,6 @@ mps_reinit(struct mps_softc *sc) mps_dprint(sc, MPS_INFO, "%s finished sc %p post %u free %u\n", __func__, sc, sc->replypostindex, sc->replyfreeindex); - sc->mps_flags &= ~MPS_FLAGS_DIAGRESET; - return 0; } @@ -639,48 +1001,13 @@ mps_get_iocfacts(struct mps_softc *sc, M } static int -mps_get_portfacts(struct mps_softc *sc, MPI2_PORT_FACTS_REPLY *facts, int port) -{ - MPI2_PORT_FACTS_REQUEST *request; - MPI2_PORT_FACTS_REPLY *reply; - struct mps_command *cm; - int error; - - MPS_FUNCTRACE(sc); - - if ((cm = mps_alloc_command(sc)) == NULL) - return (EBUSY); - request = (MPI2_PORT_FACTS_REQUEST *)cm->cm_req; - request->Function = MPI2_FUNCTION_PORT_FACTS; - request->PortNumber = port; - cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE; - cm->cm_data = NULL; - error = mps_request_polled(sc, cm); - reply = (MPI2_PORT_FACTS_REPLY *)cm->cm_reply; - if (reply == NULL) { - mps_printf(sc, "%s NULL reply\n", __func__); - goto done; - } - if ((reply->IOCStatus & MPI2_IOCSTATUS_MASK) != MPI2_IOCSTATUS_SUCCESS) { - mps_printf(sc, - "%s error %d iocstatus 0x%x iocloginfo 0x%x type 0x%x\n", - __func__, error, reply->IOCStatus, reply->IOCLogInfo, - reply->PortType); - error = ENXIO; - } - bcopy(reply, facts, sizeof(MPI2_PORT_FACTS_REPLY)); -done: - mps_free_command(sc, cm); - - return (error); -} - -static int mps_send_iocinit(struct mps_softc *sc) { MPI2_IOC_INIT_REQUEST init; MPI2_DEFAULT_REPLY reply; int req_sz, reply_sz, error; + struct timeval now; + uint64_t time_in_msec; MPS_FUNCTRACE(sc); @@ -709,8 +1036,10 @@ mps_send_iocinit(struct mps_softc *sc) init.ReplyDescriptorPostQueueAddress.Low = htole32((uint32_t)sc->post_busaddr); init.ReplyFreeQueueAddress.High = 0; init.ReplyFreeQueueAddress.Low = htole32((uint32_t)sc->free_busaddr); - init.TimeStamp.High = 0; - init.TimeStamp.Low = htole32((uint32_t)time_uptime); + getmicrotime(&now); + time_in_msec = (now.tv_sec * 1000 + now.tv_usec/1000); + init.TimeStamp.High = htole32((time_in_msec >> 32) & 0xFFFFFFFF); + init.TimeStamp.Low = htole32(time_in_msec & 0xFFFFFFFF); error = mps_request_sync(sc, &init, &reply, req_sz, reply_sz, 5); if ((reply.IOCStatus & MPI2_IOCSTATUS_MASK) != MPI2_IOCSTATUS_SUCCESS) @@ -1124,7 +1453,7 @@ mps_setup_sysctl(struct mps_softc *sc) int mps_attach(struct mps_softc *sc) { - int i, error; + int error; mps_get_tunables(sc); @@ -1146,151 +1475,20 @@ mps_attach(struct mps_softc *sc) __func__, __LINE__); return (ENOMEM); } - if ((error = mps_get_iocfacts(sc, sc->facts)) != 0) - return (error); - - mps_print_iocfacts(sc, sc->facts); - - snprintf(sc->fw_version, sizeof(sc->fw_version), - "%02d.%02d.%02d.%02d", - sc->facts->FWVersion.Struct.Major, - sc->facts->FWVersion.Struct.Minor, - sc->facts->FWVersion.Struct.Unit, - sc->facts->FWVersion.Struct.Dev); - - mps_printf(sc, "Firmware: %s, Driver: %s\n", sc->fw_version, - MPS_DRIVER_VERSION); - mps_printf(sc, "IOCCapabilities: %b\n", sc->facts->IOCCapabilities, - "\20" "\3ScsiTaskFull" "\4DiagTrace" "\5SnapBuf" "\6ExtBuf" - "\7EEDP" "\10BiDirTarg" "\11Multicast" "\14TransRetry" "\15IR" - "\16EventReplay" "\17RaidAccel" "\20MSIXIndex" "\21HostDisc"); /* - * If the chip doesn't support event replay then a hard reset will be - * required to trigger a full discovery. Do the reset here then - * retransition to Ready. A hard reset might have already been done, - * but it doesn't hurt to do it again. - */ - if ((sc->facts->IOCCapabilities & - MPI2_IOCFACTS_CAPABILITY_EVENT_REPLAY) == 0) { - mps_diag_reset(sc, NO_SLEEP); - if ((error = mps_transition_ready(sc)) != 0) - return (error); - } - - /* - * Set flag if IR Firmware is loaded. - */ - if (sc->facts->IOCCapabilities & - MPI2_IOCFACTS_CAPABILITY_INTEGRATED_RAID) - sc->ir_firmware = 1; - - /* - * Check if controller supports FW diag buffers and set flag to enable - * each type. - */ - if (sc->facts->IOCCapabilities & - MPI2_IOCFACTS_CAPABILITY_DIAG_TRACE_BUFFER) - sc->fw_diag_buffer_list[MPI2_DIAG_BUF_TYPE_TRACE].enabled = - TRUE; - if (sc->facts->IOCCapabilities & - MPI2_IOCFACTS_CAPABILITY_SNAPSHOT_BUFFER) - sc->fw_diag_buffer_list[MPI2_DIAG_BUF_TYPE_SNAPSHOT].enabled = - TRUE; - if (sc->facts->IOCCapabilities & - MPI2_IOCFACTS_CAPABILITY_EXTENDED_BUFFER) - sc->fw_diag_buffer_list[MPI2_DIAG_BUF_TYPE_EXTENDED].enabled = - TRUE; - - /* - * Set flag if EEDP is supported and if TLR is supported. - */ - if (sc->facts->IOCCapabilities & MPI2_IOCFACTS_CAPABILITY_EEDP) - sc->eedp_enabled = TRUE; - if (sc->facts->IOCCapabilities & MPI2_IOCFACTS_CAPABILITY_TLR) - sc->control_TLR = TRUE; - - /* - * Size the queues. Since the reply queues always need one free entry, - * we'll just deduct one reply message here. - */ - sc->num_reqs = MIN(MPS_REQ_FRAMES, sc->facts->RequestCredit); - sc->num_replies = MIN(MPS_REPLY_FRAMES + MPS_EVT_REPLY_FRAMES, - sc->facts->MaxReplyDescriptorPostQueueDepth) - 1; - TAILQ_INIT(&sc->req_list); - TAILQ_INIT(&sc->high_priority_req_list); - TAILQ_INIT(&sc->chain_list); - TAILQ_INIT(&sc->tm_list); - - if (((error = mps_alloc_queues(sc)) != 0) || - ((error = mps_alloc_replies(sc)) != 0) || - ((error = mps_alloc_requests(sc)) != 0)) { - mps_printf(sc, "%s failed to alloc\n", __func__); - mps_free(sc); - return (error); - } - - if (((error = mps_init_queues(sc)) != 0) || - ((error = mps_transition_operational(sc)) != 0)) { - mps_printf(sc, "%s failed to transition operational\n", __func__); - mps_free(sc); - return (error); - } - - /* - * Finish the queue initialization. - * These are set here instead of in mps_init_queues() because the - * IOC resets these values during the state transition in - * mps_transition_operational(). The free index is set to 1 - * because the corresponding index in the IOC is set to 0, and the - * IOC treats the queues as full if both are set to the same value. - * Hence the reason that the queue can't hold all of the possible - * replies. - */ - sc->replypostindex = 0; - mps_regwrite(sc, MPI2_REPLY_FREE_HOST_INDEX_OFFSET, sc->replyfreeindex); - mps_regwrite(sc, MPI2_REPLY_POST_HOST_INDEX_OFFSET, 0); - - sc->pfacts = malloc(sizeof(MPI2_PORT_FACTS_REPLY) * - sc->facts->NumberOfPorts, M_MPT2, M_ZERO|M_WAITOK); - if(!sc->pfacts) { - device_printf(sc->mps_dev, "Cannot allocate memory %s %d\n", - __func__, __LINE__); - return (ENOMEM); - } - for (i = 0; i < sc->facts->NumberOfPorts; i++) { - if ((error = mps_get_portfacts(sc, &sc->pfacts[i], i)) != 0) { - mps_printf(sc, "%s failed to get portfacts for port %d\n", - __func__, i); - mps_free(sc); - return (error); - } - mps_print_portfacts(sc, &sc->pfacts[i]); - } - - /* Attach the subsystems so they can prepare their event masks. */ - /* XXX Should be dynamic so that IM/IR and user modules can attach */ - if (((error = mps_attach_log(sc)) != 0) || - ((error = mps_attach_sas(sc)) != 0) || - ((error = mps_attach_user(sc)) != 0)) { - mps_printf(sc, "%s failed to attach all subsystems: error %d\n", - __func__, error); - mps_free(sc); - return (error); - } - - if ((error = mps_pci_setup_interrupts(sc)) != 0) { - mps_printf(sc, "%s failed to setup interrupts\n", __func__); - mps_free(sc); + * Get IOC Facts and allocate all structures based on this information. + * A Diag Reset will also call mps_iocfacts_allocate and re-read the IOC + * Facts. If relevant values have changed in IOC Facts, this function + * will free all of the memory based on IOC Facts and reallocate that + * memory. If this fails, any allocated memory should already be freed. + */ + if ((error = mps_iocfacts_allocate(sc, TRUE)) != 0) { + mps_dprint(sc, MPS_FAULT, "%s IOC Facts based allocation " + "failed with error %d\n", __func__, error); return (error); } - /* - * The static page function currently read is ioc page8. Others can be - * added in future. - */ - mps_base_static_config_pages(sc); - /* Start the periodic watchdog check on the IOC Doorbell */ mps_periodic(sc); @@ -1333,7 +1531,9 @@ mps_startup(void *arg) mps_lock(sc); mps_unmask_intr(sc); + /* initialize device mapping tables */ + mps_base_static_config_pages(sc); mps_mapping_initialize(sc); mpssas_startup(sc); mps_unlock(sc); @@ -1416,8 +1616,7 @@ mps_detach_log(struct mps_softc *sc) int mps_free(struct mps_softc *sc) { - struct mps_command *cm; - int i, error; + int error; /* Turn off the watchdog */ mps_lock(sc); @@ -1443,62 +1642,15 @@ mps_free(struct mps_softc *sc) if (sc->facts != NULL) free(sc->facts, M_MPT2); - if (sc->pfacts != NULL) - free(sc->pfacts, M_MPT2); - - if (sc->post_busaddr != 0) - bus_dmamap_unload(sc->queues_dmat, sc->queues_map); - if (sc->post_queue != NULL) - bus_dmamem_free(sc->queues_dmat, sc->post_queue, - sc->queues_map); - if (sc->queues_dmat != NULL) - bus_dma_tag_destroy(sc->queues_dmat); - - if (sc->chain_busaddr != 0) - bus_dmamap_unload(sc->chain_dmat, sc->chain_map); - if (sc->chain_frames != NULL) - bus_dmamem_free(sc->chain_dmat, sc->chain_frames,sc->chain_map); - if (sc->chain_dmat != NULL) - bus_dma_tag_destroy(sc->chain_dmat); - - if (sc->sense_busaddr != 0) - bus_dmamap_unload(sc->sense_dmat, sc->sense_map); - if (sc->sense_frames != NULL) - bus_dmamem_free(sc->sense_dmat, sc->sense_frames,sc->sense_map); - if (sc->sense_dmat != NULL) - bus_dma_tag_destroy(sc->sense_dmat); - - if (sc->reply_busaddr != 0) - bus_dmamap_unload(sc->reply_dmat, sc->reply_map); - if (sc->reply_frames != NULL) - bus_dmamem_free(sc->reply_dmat, sc->reply_frames,sc->reply_map); - if (sc->reply_dmat != NULL) - bus_dma_tag_destroy(sc->reply_dmat); - - if (sc->req_busaddr != 0) - bus_dmamap_unload(sc->req_dmat, sc->req_map); - if (sc->req_frames != NULL) - bus_dmamem_free(sc->req_dmat, sc->req_frames, sc->req_map); - if (sc->req_dmat != NULL) - bus_dma_tag_destroy(sc->req_dmat); - - if (sc->chains != NULL) - free(sc->chains, M_MPT2); - if (sc->commands != NULL) { - for (i = 1; i < sc->num_reqs; i++) { - cm = &sc->commands[i]; - bus_dmamap_destroy(sc->buffer_dmat, cm->cm_dmamap); - } - free(sc->commands, M_MPT2); - } - if (sc->buffer_dmat != NULL) - bus_dma_tag_destroy(sc->buffer_dmat); + /* + * Free all buffers that are based on IOC Facts. A Diag Reset may need + * to free these buffers too. + */ + mps_iocfacts_free(sc); if (sc->sysctl_tree != NULL) sysctl_ctx_free(&sc->sysctl_ctx); - mps_mapping_free_memory(sc); - /* Deregister the shutdown function */ if (sc->shutdown_eh != NULL) EVENTHANDLER_DEREGISTER(shutdown_final, sc->shutdown_eh); @@ -1925,7 +2077,7 @@ mps_reregister_events(struct mps_softc * /* first, reregister events */ - for (i = 0; i < MPI2_EVENT_NOTIFY_EVENTMASK_WORDS; i++) + for (i = 0; i < MPI2_EVENT_NOTIFY_EVENTMASK_WORDS; i++) sc->event_mask[i] = -1; TAILQ_FOREACH(eh, &sc->event_list, eh_list) { @@ -1957,7 +2109,8 @@ mps_reregister_events(struct mps_softc * error = mps_map_command(sc, cm); - mps_dprint(sc, MPS_TRACE, "%s finished with error %d\n", __func__, error); + mps_dprint(sc, MPS_TRACE, "%s finished with error %d\n", __func__, + error); return (error); } @@ -2313,26 +2466,50 @@ mps_map_command(struct mps_softc *sc, st * be executed and enqueued automatically. Other errors come from msleep(). */ int -mps_wait_command(struct mps_softc *sc, struct mps_command *cm, int timeout) +mps_wait_command(struct mps_softc *sc, struct mps_command *cm, int timeout, + int sleep_flag) { int error, rc; + struct timeval cur_time, start_time; - mtx_assert(&sc->mps_mtx, MA_OWNED); - - if(sc->mps_flags & MPS_FLAGS_DIAGRESET) + if (sc->mps_flags & MPS_FLAGS_DIAGRESET) return EBUSY; cm->cm_complete = NULL; - cm->cm_flags |= MPS_CM_FLAGS_WAKEUP; + cm->cm_flags |= (MPS_CM_FLAGS_WAKEUP + MPS_CM_FLAGS_POLLED); error = mps_map_command(sc, cm); if ((error != 0) && (error != EINPROGRESS)) return (error); - error = msleep(cm, &sc->mps_mtx, 0, "mpswait", timeout*hz); + + // Check for context and wait for 50 mSec at a time until time has + // expired or the command has finished. If msleep can't be used, need + // to poll. + if (curthread->td_no_sleeping != 0) + sleep_flag = NO_SLEEP; + getmicrotime(&start_time); + if (mtx_owned(&sc->mps_mtx) && sleep_flag == CAN_SLEEP) { + error = msleep(cm, &sc->mps_mtx, 0, "mpswait", timeout*hz); + } else { + while ((cm->cm_flags & MPS_CM_FLAGS_COMPLETE) == 0) { + mps_intr_locked(sc); + if (sleep_flag == CAN_SLEEP) + pause("mpswait", hz/20); + else + DELAY(50000); + + getmicrotime(&cur_time); + if ((cur_time.tv_sec - start_time.tv_sec) > timeout) { + error = EWOULDBLOCK; + break; + } + } + } + if (error == EWOULDBLOCK) { mps_dprint(sc, MPS_FAULT, "Calling Reinit from %s\n", __func__); rc = mps_reinit(sc); - mps_dprint(sc, MPS_FAULT, "Reinit %s\n", - (rc == 0) ? "success" : "failed"); + mps_dprint(sc, MPS_FAULT, "Reinit %s\n", (rc == 0) ? "success" : + "failed"); error = ETIMEDOUT; } return (error); @@ -2432,7 +2609,7 @@ mps_read_config_page(struct mps_softc *s cm->cm_complete = mps_config_complete; return (mps_map_command(sc, cm)); } else { - error = mps_wait_command(sc, cm, 0); + error = mps_wait_command(sc, cm, 0, CAN_SLEEP); if (error) { mps_dprint(sc, MPS_FAULT, "Error %d reading config page\n", error); Modified: head/sys/dev/mps/mps_config.c ============================================================================== --- head/sys/dev/mps/mps_config.c Mon Jul 22 18:37:07 2013 (r253549) +++ head/sys/dev/mps/mps_config.c Mon Jul 22 18:41:53 2013 (r253550) @@ -93,12 +93,15 @@ mps_config_get_ioc_pg8(struct mps_softc request->Header.PageVersion = MPI2_IOCPAGE8_PAGEVERSION; cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE; cm->cm_data = NULL; - error = mps_request_polled(sc, cm); + error = mps_wait_command(sc, cm, 60, CAN_SLEEP); reply = (MPI2_CONFIG_REPLY *)cm->cm_reply; if (error || (reply == NULL)) { /* FIXME */ - /* If the poll returns error then we need to do diag reset */ - printf("%s: poll for header completed with error %d", + /* + * If the request returns an error then we need to do a diag + * reset + */ + printf("%s: request for header completed with error %d", __func__, error); error = ENXIO; goto out; @@ -107,7 +110,10 @@ mps_config_get_ioc_pg8(struct mps_softc bcopy(reply, mpi_reply, sizeof(MPI2_CONFIG_REPLY)); if (ioc_status != MPI2_IOCSTATUS_SUCCESS) { /* FIXME */ - /* If the poll returns error then we need to do diag reset */ + /* + * If the request returns an error then we need to do a diag + * reset + */ printf("%s: header read with error; iocstatus = 0x%x\n", __func__, ioc_status); error = ENXIO; @@ -144,12 +150,16 @@ mps_config_get_ioc_pg8(struct mps_softc goto out; } cm->cm_data = page; - error = mps_request_polled(sc, cm); + + error = mps_wait_command(sc, cm, 60, CAN_SLEEP); reply = (MPI2_CONFIG_REPLY *)cm->cm_reply; if (error || (reply == NULL)) { /* FIXME */ - /* If the poll returns error then we need to do diag reset */ - printf("%s: poll for page completed with error %d", + /* + * If the request returns an error then we need to do a diag + * reset + */ + printf("%s: request for page completed with error %d", __func__, error); error = ENXIO; goto out; @@ -158,7 +168,10 @@ mps_config_get_ioc_pg8(struct mps_softc bcopy(reply, mpi_reply, sizeof(MPI2_CONFIG_REPLY)); if (ioc_status != MPI2_IOCSTATUS_SUCCESS) { /* FIXME */ - /* If the poll returns error then we need to do diag reset */ + /* + * If the request returns an error then we need to do a diag + * reset + */ printf("%s: page read with error; iocstatus = 0x%x\n", __func__, ioc_status); error = ENXIO; @@ -211,6 +224,11 @@ mps_config_get_man_pg10(struct mps_softc request->Header.PageVersion = MPI2_MANUFACTURING10_PAGEVERSION; cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE; cm->cm_data = NULL; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Jul 22 19:21:29 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6900664A; Mon, 22 Jul 2013 19:21:29 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5A4182FA0; Mon, 22 Jul 2013 19:21:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6MJLTe0088261; Mon, 22 Jul 2013 19:21:29 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6MJLT4Y088260; Mon, 22 Jul 2013 19:21:29 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201307221921.r6MJLT4Y088260@svn.freebsd.org> From: Sergey Kandaurov Date: Mon, 22 Jul 2013 19:21:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253551 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Jul 2013 19:21:29 -0000 Author: pluknet Date: Mon Jul 22 19:21:28 2013 New Revision: 253551 URL: http://svnweb.freebsd.org/changeset/base/253551 Log: Update chipset support list for ath_hal. This adds "device ath_ar9300". PR: docs/180743 Reviewed by: adrian Modified: head/share/man/man4/ath_hal.4 Modified: head/share/man/man4/ath_hal.4 ============================================================================== --- head/share/man/man4/ath_hal.4 Mon Jul 22 18:41:53 2013 (r253550) +++ head/share/man/man4/ath_hal.4 Mon Jul 22 19:21:28 2013 (r253551) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\"/ -.Dd August 28, 2011 +.Dd July 22, 2013 .Dt ATH_HAL 4 .Os .Sh NAME @@ -56,11 +56,13 @@ or .Cd "device ath_ar9280" .Cd "device ath_ar9285" .Cd "device ath_ar9287" +.Cd "device ath_ar9300" .Cd "options AH_SUPPORT_AR5416" .Sh DESCRIPTION The hal provides hardware support for wireless network adapters based on the Atheros AR5210, AR5211, AR5212, AR5213, AR2413, AR2417, AR2425, -AR5413, AR5416, AR5418, AR5424, AR9160, AR9220, AR9280, AR9285 and AR9287 +AR5413, AR5416, AR5418, AR5424, AR9160, AR9220, AR9280, AR9285, AR9287, +AR9380, AR9390, AR9580, AR9590, AR9562 and QCA9565 chips (and companion RF/baseband parts). This code is part of the .Xr ath 4 From owner-svn-src-all@FreeBSD.ORG Mon Jul 22 19:32:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id AE71BA2C; Mon, 22 Jul 2013 19:32:42 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A02812030; Mon, 22 Jul 2013 19:32:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6MJWgRi091346; Mon, 22 Jul 2013 19:32:42 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6MJWgPB091345; Mon, 22 Jul 2013 19:32:42 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201307221932.r6MJWgPB091345@svn.freebsd.org> From: Sergey Kandaurov Date: Mon, 22 Jul 2013 19:32:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253552 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Jul 2013 19:32:42 -0000 Author: pluknet Date: Mon Jul 22 19:32:42 2013 New Revision: 253552 URL: http://svnweb.freebsd.org/changeset/base/253552 Log: Add TP-LINK TL-WDN4800. PR: docs/180743 Reviewed by: adrian Modified: head/share/man/man4/ath_hal.4 Modified: head/share/man/man4/ath_hal.4 ============================================================================== --- head/share/man/man4/ath_hal.4 Mon Jul 22 19:21:28 2013 (r253551) +++ head/share/man/man4/ath_hal.4 Mon Jul 22 19:32:42 2013 (r253552) @@ -130,6 +130,7 @@ module: .It "Sony PCWA-C300S AR5212 Cardbus b/g" .It "Sony PCWA-C500 AR5210 Cardbus a" .It "3Com 3CRPAG175 AR5212 CardBus a/b/g" +.It "TP-LINK TL-WDN4800 AR9380 PCIe a/b/g/n" .El .Sh SEE ALSO .Xr ath 4 From owner-svn-src-all@FreeBSD.ORG Mon Jul 22 21:47:15 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 89DF828D; Mon, 22 Jul 2013 21:47:15 +0000 (UTC) (envelope-from jlh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7AEDD26D4; Mon, 22 Jul 2013 21:47:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6MLlFB3031685; Mon, 22 Jul 2013 21:47:15 GMT (envelope-from jlh@svn.freebsd.org) Received: (from jlh@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6MLlFaX031684; Mon, 22 Jul 2013 21:47:15 GMT (envelope-from jlh@svn.freebsd.org) Message-Id: <201307222147.r6MLlFaX031684@svn.freebsd.org> From: Jeremie Le Hen Date: Mon, 22 Jul 2013 21:47:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253554 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Jul 2013 21:47:15 -0000 Author: jlh Date: Mon Jul 22 21:47:14 2013 New Revision: 253554 URL: http://svnweb.freebsd.org/changeset/base/253554 Log: Fix a panic in the racct code when munlock(2) is called with incorrect values. The racct code in sys_munlock() assumed that the boundaries provided by the userland were correct as long as vm_map_unwire() returned successfully. However the latter contains its own logic and sometimes manages to do something out of those boundaries, even if they are buggy. This change makes the racct code to use the accounting done by the vm layer, as it is done in other places such as vm_mlock(). Despite fixing the panic, Alan Cox pointed that this code is still race-y though: two simultaneous callers will produce incorrect values. Reviewed by: alc MFC after: 7 days Modified: head/sys/vm/vm_mmap.c Modified: head/sys/vm/vm_mmap.c ============================================================================== --- head/sys/vm/vm_mmap.c Mon Jul 22 19:38:21 2013 (r253553) +++ head/sys/vm/vm_mmap.c Mon Jul 22 21:47:14 2013 (r253554) @@ -1224,6 +1224,7 @@ sys_munlock(td, uap) { vm_offset_t addr, end, last, start; vm_size_t size; + vm_map_t map; int error; error = priv_check(td, PRIV_VM_MUNLOCK); @@ -1241,7 +1242,9 @@ sys_munlock(td, uap) #ifdef RACCT if (error == KERN_SUCCESS) { PROC_LOCK(td->td_proc); - racct_sub(td->td_proc, RACCT_MEMLOCK, ptoa(end - start)); + map = &td->td_proc->p_vmspace->vm_map; + racct_set(td->td_proc, RACCT_MEMLOCK, + ptoa(pmap_wired_count(map->pmap))); PROC_UNLOCK(td->td_proc); } #endif From owner-svn-src-all@FreeBSD.ORG Mon Jul 22 22:16:48 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 19773A9F; Mon, 22 Jul 2013 22:16:48 +0000 (UTC) (envelope-from jlh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 098F327F4; Mon, 22 Jul 2013 22:16:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6MMGlQH041448; Mon, 22 Jul 2013 22:16:47 GMT (envelope-from jlh@svn.freebsd.org) Received: (from jlh@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6MMGlPX041447; Mon, 22 Jul 2013 22:16:47 GMT (envelope-from jlh@svn.freebsd.org) Message-Id: <201307222216.r6MMGlPX041447@svn.freebsd.org> From: Jeremie Le Hen Date: Mon, 22 Jul 2013 22:16:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253556 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Jul 2013 22:16:48 -0000 Author: jlh Date: Mon Jul 22 22:16:47 2013 New Revision: 253556 URL: http://svnweb.freebsd.org/changeset/base/253556 Log: Fix previous commit when option RACCT is not used. MFC after: 7 days Modified: head/sys/vm/vm_mmap.c Modified: head/sys/vm/vm_mmap.c ============================================================================== --- head/sys/vm/vm_mmap.c Mon Jul 22 22:09:27 2013 (r253555) +++ head/sys/vm/vm_mmap.c Mon Jul 22 22:16:47 2013 (r253556) @@ -1224,7 +1224,9 @@ sys_munlock(td, uap) { vm_offset_t addr, end, last, start; vm_size_t size; +#ifdef RACCT vm_map_t map; +#endif int error; error = priv_check(td, PRIV_VM_MUNLOCK); From owner-svn-src-all@FreeBSD.ORG Tue Jul 23 02:11:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id AEBDF1F3; Tue, 23 Jul 2013 02:11:22 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9E7CD2F8A; Tue, 23 Jul 2013 02:11:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6N2BMaS014082; Tue, 23 Jul 2013 02:11:22 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6N2BMsJ014081; Tue, 23 Jul 2013 02:11:22 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201307230211.r6N2BMsJ014081@svn.freebsd.org> From: Marcel Moolenaar Date: Tue, 23 Jul 2013 02:11:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253558 - head/sys/ia64/ia64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jul 2013 02:11:22 -0000 Author: marcel Date: Tue Jul 23 02:11:22 2013 New Revision: 253558 URL: http://svnweb.freebsd.org/changeset/base/253558 Log: In pmap_mapdev(), if the physical memory range is not covered by an EFI memory descriptor, don't return NULL as the virtual address, return the direct-mapped uncacheable virtual address for it. At first, this was needed only for the Altix 350, but now even some high-end HP machines have devices mapped to physical addresses that aren't covered by the EFI memory map. Modified: head/sys/ia64/ia64/pmap.c Modified: head/sys/ia64/ia64/pmap.c ============================================================================== --- head/sys/ia64/ia64/pmap.c Mon Jul 22 23:08:36 2013 (r253557) +++ head/sys/ia64/ia64/pmap.c Tue Jul 23 02:11:22 2013 (r253558) @@ -2451,7 +2451,7 @@ pmap_mapdev(vm_paddr_t pa, vm_size_t sz) if (md == NULL) { printf("%s: [%#lx..%#lx] not covered by memory descriptor\n", __func__, pa, pa + sz - 1); - return (NULL); + return ((void *)IA64_PHYS_TO_RR6(pa)); } if (md->md_type == EFI_MD_TYPE_FREE) { From owner-svn-src-all@FreeBSD.ORG Tue Jul 23 02:38:24 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 2C4B0805; Tue, 23 Jul 2013 02:38:24 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1DFC0204F; Tue, 23 Jul 2013 02:38:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6N2cNrK021051; Tue, 23 Jul 2013 02:38:23 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6N2cNtg021050; Tue, 23 Jul 2013 02:38:23 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201307230238.r6N2cNtg021050@svn.freebsd.org> From: Marcel Moolenaar Date: Tue, 23 Jul 2013 02:38:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253559 - head/sys/ia64/ia64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jul 2013 02:38:24 -0000 Author: marcel Date: Tue Jul 23 02:38:23 2013 New Revision: 253559 URL: http://svnweb.freebsd.org/changeset/base/253559 Log: In ia64_mca_init(), don't limit the allocation of the info block to fall within the first 256MB of memory. The origin/reason for that limitation is not known, but it's not believed to be required for proper initialization. What is known is that the Altix 350 does not have physical memory at that address (by virtue of the address space bits). Keep the boundary at 256MB so that the info block will be covered by a single direct-mapped translation. While here, change the flags to M_NOWAIT to eliminate confusion. It does not change the behaviour of contigmalloc(). What is does is makes the flags argument explicitly say what the actual behaviour is. Modified: head/sys/ia64/ia64/mca.c Modified: head/sys/ia64/ia64/mca.c ============================================================================== --- head/sys/ia64/ia64/mca.c Tue Jul 23 02:11:22 2013 (r253558) +++ head/sys/ia64/ia64/mca.c Tue Jul 23 02:38:23 2013 (r253559) @@ -284,8 +284,8 @@ ia64_mca_init(void) } max_size = round_page(max_size); - p = (max_size) ? contigmalloc(max_size, M_TEMP, 0, 0ul, - 256*1024*1024 - 1, PAGE_SIZE, 256*1024*1024) : NULL; + p = (max_size) ? contigmalloc(max_size, M_TEMP, M_NOWAIT, 0ul, ~0ul, + PAGE_SIZE, 256*1024*1024) : NULL; if (p != NULL) { mca_info_block = IA64_PHYS_TO_RR7(ia64_tpa((u_int64_t)p)); From owner-svn-src-all@FreeBSD.ORG Tue Jul 23 03:03:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4182DEC0; Tue, 23 Jul 2013 03:03:18 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 32FE52237; Tue, 23 Jul 2013 03:03:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6N33IJi030661; Tue, 23 Jul 2013 03:03:18 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6N33Hi1030660; Tue, 23 Jul 2013 03:03:17 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201307230303.r6N33Hi1030660@svn.freebsd.org> From: Marcel Moolenaar Date: Tue, 23 Jul 2013 03:03:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253560 - head/sys/ia64/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jul 2013 03:03:18 -0000 Author: marcel Date: Tue Jul 23 03:03:17 2013 New Revision: 253560 URL: http://svnweb.freebsd.org/changeset/base/253560 Log: In pci_cfgregread() and pci_cfgregwrite(), multiplex the domain and bus number into the bus argument. The bus number occupies the least significant 8 bits. The PCI domain occupies the most significant 24 bits. On the Altix 350, the PCI domain is a required parameter, but changing the prototype of the pci_cfgreg*() functions to include a separate domain argument has wide-spread consequences across the supported architectures. We'd be changing a known interface. Multiplexing is an acceptable kluge to give us what we need with manageable impact. Note that the PCI bus number fits in 8 bits, so the multiplexing of the domain is a backward compatible change. Modified: head/sys/ia64/pci/pci_cfgreg.c Modified: head/sys/ia64/pci/pci_cfgreg.c ============================================================================== --- head/sys/ia64/pci/pci_cfgreg.c Tue Jul 23 02:38:23 2013 (r253559) +++ head/sys/ia64/pci/pci_cfgreg.c Tue Jul 23 03:03:17 2013 (r253560) @@ -70,7 +70,7 @@ pci_cfgregread(int bus, int slot, int fu register_t is; u_long addr; - addr = pci_sal_address(0, bus, slot, func, reg); + addr = pci_sal_address(bus >> 8, bus & 0xff, slot, func, reg); if (addr == ~0ul) return (~0); @@ -91,7 +91,7 @@ pci_cfgregwrite(int bus, int slot, int f register_t is; u_long addr; - addr = pci_sal_address(0, bus, slot, func, reg); + addr = pci_sal_address(bus >> 8, bus & 0xff, slot, func, reg); if (addr == ~0ul) return; From owner-svn-src-all@FreeBSD.ORG Tue Jul 23 10:23:43 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E875D6CF; Tue, 23 Jul 2013 10:23:43 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D9E9C2561; Tue, 23 Jul 2013 10:23:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6NANhIF065714; Tue, 23 Jul 2013 10:23:43 GMT (envelope-from theraven@svn.freebsd.org) Received: (from theraven@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6NANhGf065713; Tue, 23 Jul 2013 10:23:43 GMT (envelope-from theraven@svn.freebsd.org) Message-Id: <201307231023.r6NANhGf065713@svn.freebsd.org> From: David Chisnall Date: Tue, 23 Jul 2013 10:23:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253563 - head/contrib/libstdc++/include/c_std X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jul 2013 10:23:44 -0000 Author: theraven Date: Tue Jul 23 10:23:43 2013 New Revision: 253563 URL: http://svnweb.freebsd.org/changeset/base/253563 Log: Add isnan() and isinf() to the global namespace in libstdc++'s . The standard (n3242, section 17.6.1.1, paragraph 4) says that, because these are declared as macros in the C specification (even though they are implemented as functions in the C++ library) they should be in the global namespace. A surprising number of configure checks rely on this. It was broken by recent cleanups to math.h. Modified: head/contrib/libstdc++/include/c_std/std_cmath.h Modified: head/contrib/libstdc++/include/c_std/std_cmath.h ============================================================================== --- head/contrib/libstdc++/include/c_std/std_cmath.h Tue Jul 23 05:11:22 2013 (r253562) +++ head/contrib/libstdc++/include/c_std/std_cmath.h Tue Jul 23 10:23:43 2013 (r253563) @@ -589,6 +589,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std) { return ::__gnu_cxx::__capture_isunordered(__f1, __f2); } _GLIBCXX_END_NAMESPACE +using std::isnan; +using std::isinf; #endif /* _GLIBCXX_USE_C99_FP_MACROS_DYNAMIC */ #endif From owner-svn-src-all@FreeBSD.ORG Tue Jul 23 10:25:34 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id EC67793B; Tue, 23 Jul 2013 10:25:34 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DCAC0257A; Tue, 23 Jul 2013 10:25:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6NAPYwm065987; Tue, 23 Jul 2013 10:25:34 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6NAPYw8065985; Tue, 23 Jul 2013 10:25:34 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201307231025.r6NAPYw8065985@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 23 Jul 2013 10:25:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253564 - head/sys/netgraph X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jul 2013 10:25:35 -0000 Author: glebius Date: Tue Jul 23 10:25:34 2013 New Revision: 253564 URL: http://svnweb.freebsd.org/changeset/base/253564 Log: Add constant for PPP-Max-PayLoad tag. Submitted by: Dmitry Luhtionov Modified: head/sys/netgraph/ng_pppoe.c head/sys/netgraph/ng_pppoe.h Modified: head/sys/netgraph/ng_pppoe.c ============================================================================== --- head/sys/netgraph/ng_pppoe.c Tue Jul 23 10:23:43 2013 (r253563) +++ head/sys/netgraph/ng_pppoe.c Tue Jul 23 10:25:34 2013 (r253564) @@ -1887,6 +1887,7 @@ scan_tags(sessp sp, const struct pppoe_h case PTT_SRV_ERR: case PTT_SYS_ERR: case PTT_GEN_ERR: + case PTT_MAX_PAYL: break; } pt = (const struct pppoe_tag*)ptn; Modified: head/sys/netgraph/ng_pppoe.h ============================================================================== --- head/sys/netgraph/ng_pppoe.h Tue Jul 23 10:23:43 2013 (r253563) +++ head/sys/netgraph/ng_pppoe.h Tue Jul 23 10:25:34 2013 (r253564) @@ -172,6 +172,7 @@ struct ngpppoe_sts { #define PTT_AC_COOKIE (0x0104) #define PTT_VENDOR (0x0105) #define PTT_RELAY_SID (0x0110) +#define PTT_MAX_PAYL (0x0120) /* PPP-Max-Payload (RFC4638) */ #define PTT_SRV_ERR (0x0201) #define PTT_SYS_ERR (0x0202) #define PTT_GEN_ERR (0x0203) @@ -188,6 +189,7 @@ struct ngpppoe_sts { #define PTT_AC_COOKIE (0x0401) #define PTT_VENDOR (0x0501) #define PTT_RELAY_SID (0x1001) +#define PTT_MAX_PAYL (0x2001) /* PPP-Max-Payload (RFC4638) */ #define PTT_SRV_ERR (0x0102) #define PTT_SYS_ERR (0x0202) #define PTT_GEN_ERR (0x0302) From owner-svn-src-all@FreeBSD.ORG Tue Jul 23 11:16:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 141E35BB; Tue, 23 Jul 2013 11:16:41 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 058D02846; Tue, 23 Jul 2013 11:16:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6NBGenq081218; Tue, 23 Jul 2013 11:16:40 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6NBGe6E081216; Tue, 23 Jul 2013 11:16:40 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201307231116.r6NBGe6E081216@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 23 Jul 2013 11:16:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253565 - in head/sys: kern vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jul 2013 11:16:41 -0000 Author: glebius Date: Tue Jul 23 11:16:40 2013 New Revision: 253565 URL: http://svnweb.freebsd.org/changeset/base/253565 Log: Revert r249590 and in case if mp_ncpus isn't initialized use MAXCPU. This allows us to init counter zone at early stage of boot. Reviewed by: kib Tested by: Lytochkin Boris Modified: head/sys/kern/subr_counter.c head/sys/vm/uma_core.c Modified: head/sys/kern/subr_counter.c ============================================================================== --- head/sys/kern/subr_counter.c Tue Jul 23 10:25:34 2013 (r253564) +++ head/sys/kern/subr_counter.c Tue Jul 23 11:16:40 2013 (r253565) @@ -104,4 +104,4 @@ counter_startup(void) uint64_pcpu_zone = uma_zcreate("uint64 pcpu", sizeof(uint64_t), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_PCPU); } -SYSINIT(counter, SI_SUB_CPU, SI_ORDER_FOURTH, counter_startup, NULL); +SYSINIT(counter, SI_SUB_KMEM, SI_ORDER_ANY, counter_startup, NULL); Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Tue Jul 23 10:25:34 2013 (r253564) +++ head/sys/vm/uma_core.c Tue Jul 23 11:16:40 2013 (r253565) @@ -1139,9 +1139,10 @@ keg_small_init(uma_keg_t keg) u_int shsize; if (keg->uk_flags & UMA_ZONE_PCPU) { - KASSERT(mp_ncpus > 0, ("%s: ncpus %d\n", __func__, mp_ncpus)); + u_int ncpus = mp_ncpus ? mp_ncpus : MAXCPU; + keg->uk_slabsize = sizeof(struct pcpu); - keg->uk_ppera = howmany(mp_ncpus * sizeof(struct pcpu), + keg->uk_ppera = howmany(ncpus * sizeof(struct pcpu), PAGE_SIZE); } else { keg->uk_slabsize = UMA_SLAB_SIZE; From owner-svn-src-all@FreeBSD.ORG Tue Jul 23 12:20:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B9F72BF0; Tue, 23 Jul 2013 12:20:28 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 909272B57; Tue, 23 Jul 2013 12:20:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6NCKSG1001600; Tue, 23 Jul 2013 12:20:28 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6NCKSCJ001596; Tue, 23 Jul 2013 12:20:28 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201307231220.r6NCKSCJ001596@svn.freebsd.org> From: Gavin Atkinson Date: Tue, 23 Jul 2013 12:20:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253566 - in head/usr.sbin: bsdconfig/include bsdconfig/share/media bsdinstall/scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jul 2013 12:20:28 -0000 Author: gavin Date: Tue Jul 23 12:20:27 2013 New Revision: 253566 URL: http://svnweb.freebsd.org/changeset/base/253566 Log: Remove ftp2.tr.freebsd.org, it is out of date. MFC after: 3 days Modified: head/usr.sbin/bsdconfig/include/messages.subr head/usr.sbin/bsdconfig/share/media/ftp.subr head/usr.sbin/bsdinstall/scripts/mirrorselect Modified: head/usr.sbin/bsdconfig/include/messages.subr ============================================================================== --- head/usr.sbin/bsdconfig/include/messages.subr Tue Jul 23 11:16:40 2013 (r253565) +++ head/usr.sbin/bsdconfig/include/messages.subr Tue Jul 23 12:20:27 2013 (r253566) @@ -360,7 +360,6 @@ msg_tk_desc="Tk and packages that depend msg_try_dhcp_configuration="Do you want to try DHCP configuration of the interface?" msg_try_ipv6_configuration="Do you want to try IPv6 configuration of the interface?" msg_try_sudo_only_this_once="Try sudo(8) only this once" -msg_turkey="Turkey" msg_ufs="UFS" msg_uk="UK" msg_ukraine="Ukraine" Modified: head/usr.sbin/bsdconfig/share/media/ftp.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/ftp.subr Tue Jul 23 11:16:40 2013 (r253565) +++ head/usr.sbin/bsdconfig/share/media/ftp.subr Tue Jul 23 12:20:27 2013 (r253566) @@ -174,7 +174,6 @@ f_dialog_menu_media_ftp() ' $msg_taiwan #4' 'ftp4.tw.freebsd.org' ' $msg_taiwan #6' 'ftp6.tw.freebsd.org' ' $msg_taiwan #11' 'ftp11.tw.freebsd.org' - '$msg_turkey' 'ftp2.tr.freebsd.org' '$msg_uk' 'ftp.uk.freebsd.org' ' $msg_uk #2' 'ftp2.uk.freebsd.org' ' $msg_uk #3' 'ftp3.uk.freebsd.org' Modified: head/usr.sbin/bsdinstall/scripts/mirrorselect ============================================================================== --- head/usr.sbin/bsdinstall/scripts/mirrorselect Tue Jul 23 11:16:40 2013 (r253565) +++ head/usr.sbin/bsdinstall/scripts/mirrorselect Tue Jul 23 12:20:27 2013 (r253566) @@ -136,7 +136,6 @@ MIRROR=`dialog --backtitle "FreeBSD Inst ftp://ftp4.tw.freebsd.org "Taiwan #4"\ ftp://ftp6.tw.freebsd.org "Taiwan #6"\ ftp://ftp11.tw.freebsd.org "Taiwan #11"\ - ftp://ftp2.tr.freebsd.org "Turkey #2"\ ftp://ftp.uk.freebsd.org "UK"\ ftp://ftp2.uk.freebsd.org "UK #2"\ ftp://ftp3.uk.freebsd.org "UK #3"\ From owner-svn-src-all@FreeBSD.ORG Tue Jul 23 13:40:27 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D2C36368; Tue, 23 Jul 2013 13:40:27 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C39AA2EEF; Tue, 23 Jul 2013 13:40:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6NDeRDi024192; Tue, 23 Jul 2013 13:40:27 GMT (envelope-from loos@svn.freebsd.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6NDeRHu024191; Tue, 23 Jul 2013 13:40:27 GMT (envelope-from loos@svn.freebsd.org) Message-Id: <201307231340.r6NDeRHu024191@svn.freebsd.org> From: Luiz Otavio O Souza Date: Tue, 23 Jul 2013 13:40:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253568 - head/sbin/etherswitchcfg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jul 2013 13:40:27 -0000 Author: loos Date: Tue Jul 23 13:40:26 2013 New Revision: 253568 URL: http://svnweb.freebsd.org/changeset/base/253568 Log: Fix the usage error message. The valid range is up to max. vlan - 1 since vlangroups starts at 0. Approved by: adrian (mentor) Modified: head/sbin/etherswitchcfg/etherswitchcfg.c Modified: head/sbin/etherswitchcfg/etherswitchcfg.c ============================================================================== --- head/sbin/etherswitchcfg/etherswitchcfg.c Tue Jul 23 12:22:37 2013 (r253567) +++ head/sbin/etherswitchcfg/etherswitchcfg.c Tue Jul 23 13:40:26 2013 (r253568) @@ -626,7 +626,9 @@ main(int argc, char *argv[]) newmode(&cfg, MODE_PORT); } else if (sscanf(argv[0], "vlangroup%d", &cfg.unit) == 1) { if (cfg.unit < 0 || cfg.unit >= cfg.info.es_nvlangroups) - errx(EX_USAGE, "port unit must be between 0 and %d", cfg.info.es_nvlangroups); + errx(EX_USAGE, + "vlangroup unit must be between 0 and %d", + cfg.info.es_nvlangroups - 1); newmode(&cfg, MODE_VLANGROUP); } else if (strcmp(argv[0], "config") == 0) { newmode(&cfg, MODE_CONFIG); From owner-svn-src-all@FreeBSD.ORG Tue Jul 23 13:56:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id EFEF5A82; Tue, 23 Jul 2013 13:56:39 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DDF672FCB; Tue, 23 Jul 2013 13:56:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6NDuddN029464; Tue, 23 Jul 2013 13:56:39 GMT (envelope-from loos@svn.freebsd.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6NDuc4I029458; Tue, 23 Jul 2013 13:56:38 GMT (envelope-from loos@svn.freebsd.org) Message-Id: <201307231356.r6NDuc4I029458@svn.freebsd.org> From: Luiz Otavio O Souza Date: Tue, 23 Jul 2013 13:56:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253569 - in head: sbin/etherswitchcfg sys/dev/etherswitch sys/dev/etherswitch/ip17x sys/dev/etherswitch/rtl8366 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jul 2013 13:56:40 -0000 Author: loos Date: Tue Jul 23 13:56:38 2013 New Revision: 253569 URL: http://svnweb.freebsd.org/changeset/base/253569 Log: Add a new flag (ETHERSWITCH_VID_VALID) to say what vlangroups are in use. This fix the case when etherswitch is printing the information of port 0 vlan group (in port based vlan mode) with no member ports. Add the ETHERSWITCH_VID_VALID support to ip17x driver. Add the ETHERSWITCH_VID_VALID support to rt8366 driver. arswitch doesn't need to be updated as it doesn't support vlans management yet. Approved by: adrian (mentor) Modified: head/sbin/etherswitchcfg/etherswitchcfg.c head/sys/dev/etherswitch/etherswitch.h head/sys/dev/etherswitch/ip17x/ip175c.c head/sys/dev/etherswitch/ip17x/ip175d.c head/sys/dev/etherswitch/ip17x/ip17x_vlans.c head/sys/dev/etherswitch/rtl8366/rtl8366rb.c Modified: head/sbin/etherswitchcfg/etherswitchcfg.c ============================================================================== --- head/sbin/etherswitchcfg/etherswitchcfg.c Tue Jul 23 13:40:26 2013 (r253568) +++ head/sbin/etherswitchcfg/etherswitchcfg.c Tue Jul 23 13:56:38 2013 (r253569) @@ -471,8 +471,9 @@ print_vlangroup(struct cfg *cfg, int vla vg.es_vlangroup = vlangroup; if (ioctl(cfg->fd, IOETHERSWITCHGETVLANGROUP, &vg) != 0) err(EX_OSERR, "ioctl(IOETHERSWITCHGETVLANGROUP)"); - if (vg.es_vid == 0 && vg.es_member_ports == 0) + if ((vg.es_vid & ETHERSWITCH_VID_VALID) == 0) return; + vg.es_vid &= ETHERSWITCH_VID_MASK; printf("vlangroup%d:\n", vlangroup); if (cfg->conf.vlan_mode == ETHERSWITCH_VLAN_PORT) printf("\tport: %d\n", vg.es_vid); Modified: head/sys/dev/etherswitch/etherswitch.h ============================================================================== --- head/sys/dev/etherswitch/etherswitch.h Tue Jul 23 13:40:26 2013 (r253568) +++ head/sys/dev/etherswitch/etherswitch.h Tue Jul 23 13:56:38 2013 (r253569) @@ -26,6 +26,8 @@ struct etherswitch_phyreg { typedef struct etherswitch_phyreg etherswitch_phyreg_t; #define ETHERSWITCH_NAMEMAX 64 +#define ETHERSWITCH_VID_MASK 0xfff +#define ETHERSWITCH_VID_VALID (1 << 12) #define ETHERSWITCH_VLAN_ISL (1 << 0) /* ISL */ #define ETHERSWITCH_VLAN_PORT (1 << 1) /* Port based vlan */ #define ETHERSWITCH_VLAN_DOT1Q (1 << 2) /* 802.1q */ Modified: head/sys/dev/etherswitch/ip17x/ip175c.c ============================================================================== --- head/sys/dev/etherswitch/ip17x/ip175c.c Tue Jul 23 13:40:26 2013 (r253568) +++ head/sys/dev/etherswitch/ip17x/ip175c.c Tue Jul 23 13:56:38 2013 (r253569) @@ -147,9 +147,9 @@ ip175c_dot1q_vlan_setup(struct ip17x_sof memset(vlans, 0, sizeof(vlans)); for (i = 0; i < IP17X_MAX_VLANS; i++) { v = &sc->vlan[i]; - if (v->vlanid == 0) + if ((v->vlanid & ETHERSWITCH_VID_VALID) == 0) continue; - vlans[v->vlanid] = v->ports; + vlans[v->vlanid & ETHERSWITCH_VID_MASK] = v->ports; } for (j = 0, i = 1; i <= IP17X_MAX_VLANS / 2; i++) { Modified: head/sys/dev/etherswitch/ip17x/ip175d.c ============================================================================== --- head/sys/dev/etherswitch/ip17x/ip175d.c Tue Jul 23 13:40:26 2013 (r253568) +++ head/sys/dev/etherswitch/ip17x/ip175d.c Tue Jul 23 13:56:38 2013 (r253569) @@ -94,7 +94,8 @@ ip175d_hw_setup(struct ip17x_softc *sc) striptag[i] = 0; v = &sc->vlan[i]; - if (v->vlanid == 0 || sc->vlan_mode == 0) { + if ((v->vlanid & ETHERSWITCH_VID_VALID) == 0 || + sc->vlan_mode == 0) { /* Vlangroup disabled. Reset the filter. */ ip17x_writephy(sc->sc_dev, 22, 14 + i, i + 1); ports[i] = 0x3f; @@ -105,7 +106,8 @@ ip175d_hw_setup(struct ip17x_softc *sc) ports[i] = v->ports; /* Setup the filter, write the VLAN id. */ - ip17x_writephy(sc->sc_dev, 22, 14 + i, v->vlanid); + ip17x_writephy(sc->sc_dev, 22, 14 + i, + v->vlanid & ETHERSWITCH_VID_MASK); for (j = 0; j < MII_NPHY; j++) { if ((ports[i] & (1 << j)) == 0) Modified: head/sys/dev/etherswitch/ip17x/ip17x_vlans.c ============================================================================== --- head/sys/dev/etherswitch/ip17x/ip17x_vlans.c Tue Jul 23 13:40:26 2013 (r253568) +++ head/sys/dev/etherswitch/ip17x/ip17x_vlans.c Tue Jul 23 13:56:38 2013 (r253569) @@ -74,7 +74,7 @@ ip17x_reset_vlans(struct ip17x_softc *sc if (((1 << phy) & sc->phymask) == 0) continue; v = &sc->vlan[i]; - v->vlanid = i++; + v->vlanid = i++ | ETHERSWITCH_VID_VALID; v->ports = (1 << sc->cpuport); for (j = 0; j < MII_NPHY; j++) { if (((1 << j) & sc->phymask) == 0) @@ -90,10 +90,10 @@ ip17x_reset_vlans(struct ip17x_softc *sc * members of vlan 1. */ v = &sc->vlan[0]; - v->vlanid = 1; - /* Set PVID for everyone. */ + v->vlanid = 1 | ETHERSWITCH_VID_VALID; + /* Set PVID to 1 for everyone. */ for (i = 0; i < sc->numports; i++) - sc->pvid[i] = v->vlanid; + sc->pvid[i] = 1; for (i = 0; i < MII_NPHY; i++) { if ((sc->phymask & (1 << i)) == 0) continue; @@ -148,11 +148,29 @@ ip17x_setvgroup(device_t dev, etherswitc return (EINVAL); /* IP175C don't support VLAN IDs > 15. */ - if (IP17X_IS_SWITCH(sc, IP175C) && vg->es_vid > IP175C_LAST_VLAN) + if (IP17X_IS_SWITCH(sc, IP175C) && + (vg->es_vid & ETHERSWITCH_VID_MASK) > IP175C_LAST_VLAN) return (EINVAL); /* Vlan ID. */ - sc->vlan[vg->es_vlangroup].vlanid = vg->es_vid; + if (sc->vlan_mode == ETHERSWITCH_VLAN_DOT1Q) { + for (i = 0; i < sc->info.es_nvlangroups; i++) { + /* Is this Vlan ID already set in another vlangroup ? */ + if (i != vg->es_vlangroup && + sc->vlan[i].vlanid & ETHERSWITCH_VID_VALID && + (sc->vlan[i].vlanid & ETHERSWITCH_VID_MASK) == + (vg->es_vid & ETHERSWITCH_VID_MASK)) + return (EINVAL); + } + sc->vlan[vg->es_vlangroup].vlanid = vg->es_vid & + ETHERSWITCH_VID_MASK; + /* Setting the vlanid to zero disables the vlangroup. */ + if (sc->vlan[vg->es_vlangroup].vlanid == 0) { + sc->vlan[vg->es_vlangroup].ports = 0; + return (sc->hal.ip17x_hw_setup(sc)); + } + sc->vlan[vg->es_vlangroup].vlanid |= ETHERSWITCH_VID_VALID; + } /* Member Ports. */ sc->vlan[vg->es_vlangroup].ports = 0; Modified: head/sys/dev/etherswitch/rtl8366/rtl8366rb.c ============================================================================== --- head/sys/dev/etherswitch/rtl8366/rtl8366rb.c Tue Jul 23 13:40:26 2013 (r253568) +++ head/sys/dev/etherswitch/rtl8366/rtl8366rb.c Tue Jul 23 13:56:38 2013 (r253569) @@ -619,7 +619,7 @@ rtl_getvgroup(device_t dev, etherswitch_ for (i=0; i<3; i++) vmcr[i] = rtl_readreg(dev, RTL8366RB_VMCR(i, vg->es_vlangroup)); - vg->es_vid = RTL8366RB_VMCR_VID(vmcr); + vg->es_vid = RTL8366RB_VMCR_VID(vmcr) | ETHERSWITCH_VID_VALID; vg->es_member_ports = RTL8366RB_VMCR_MEMBER(vmcr); vg->es_untagged_ports = RTL8366RB_VMCR_UNTAG(vmcr); vg->es_fid = RTL8366RB_VMCR_FID(vmcr); From owner-svn-src-all@FreeBSD.ORG Tue Jul 23 14:02:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D26F3D12; Tue, 23 Jul 2013 14:02:39 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C35552021; Tue, 23 Jul 2013 14:02:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6NE2dUN032099; Tue, 23 Jul 2013 14:02:39 GMT (envelope-from loos@svn.freebsd.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6NE2dr2032094; Tue, 23 Jul 2013 14:02:39 GMT (envelope-from loos@svn.freebsd.org) Message-Id: <201307231402.r6NE2dr2032094@svn.freebsd.org> From: Luiz Otavio O Souza Date: Tue, 23 Jul 2013 14:02:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253570 - head/sys/dev/etherswitch/arswitch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jul 2013 14:02:40 -0000 Author: loos Date: Tue Jul 23 14:02:38 2013 New Revision: 253570 URL: http://svnweb.freebsd.org/changeset/base/253570 Log: Fix the arswitch instability problem. It turns out that the arswitch_writereg() routine was writing the registers in the wrong order. Revert -r241918 as the root problem is now fixed. Remove another workaround from arswitch_ar7240.c. Simplify and fix the code on arswitch_writephy() by using arswitch_writereg(). While here remove a redundant declaration from arswitchvar.h. Approved by: adrian (mentor) Modified: head/sys/dev/etherswitch/arswitch/arswitch_7240.c head/sys/dev/etherswitch/arswitch/arswitch_phy.c head/sys/dev/etherswitch/arswitch/arswitch_reg.c head/sys/dev/etherswitch/arswitch/arswitchvar.h Modified: head/sys/dev/etherswitch/arswitch/arswitch_7240.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_7240.c Tue Jul 23 13:56:38 2013 (r253569) +++ head/sys/dev/etherswitch/arswitch/arswitch_7240.c Tue Jul 23 14:02:38 2013 (r253570) @@ -75,12 +75,6 @@ ar7240_hw_setup(struct arswitch_softc *s arswitch_writereg(sc->sc_dev, AR8X16_REG_CPU_PORT, AR8X16_CPU_PORT_EN | AR8X16_CPU_MIRROR_DIS); - /* - * Let things settle; probing PHY4 doesn't seem reliable - * without a litle delay. - */ - DELAY(1000); - return (0); } Modified: head/sys/dev/etherswitch/arswitch/arswitch_phy.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_phy.c Tue Jul 23 13:56:38 2013 (r253569) +++ head/sys/dev/etherswitch/arswitch/arswitch_phy.c Tue Jul 23 14:02:38 2013 (r253570) @@ -127,16 +127,13 @@ arswitch_writephy(device_t dev, int phy, return (ENXIO); ARSWITCH_LOCK(sc); - err = arswitch_writereg_lsb(dev, AR8X16_REG_MDIO_CTRL, - (data & AR8X16_MDIO_CTRL_DATA_MASK)); - if (err != 0) - goto out; - err = arswitch_writereg_msb(dev, AR8X16_REG_MDIO_CTRL, + err = arswitch_writereg(dev, AR8X16_REG_MDIO_CTRL, AR8X16_MDIO_CTRL_BUSY | AR8X16_MDIO_CTRL_MASTER_EN | AR8X16_MDIO_CTRL_CMD_WRITE | (phy << AR8X16_MDIO_CTRL_PHY_ADDR_SHIFT) | - (reg << AR8X16_MDIO_CTRL_REG_ADDR_SHIFT)); + (reg << AR8X16_MDIO_CTRL_REG_ADDR_SHIFT) | + (data & AR8X16_MDIO_CTRL_DATA_MASK)); if (err != 0) goto out; for (timeout = 100; timeout--; ) { Modified: head/sys/dev/etherswitch/arswitch/arswitch_reg.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_reg.c Tue Jul 23 13:56:38 2013 (r253569) +++ head/sys/dev/etherswitch/arswitch/arswitch_reg.c Tue Jul 23 14:02:38 2013 (r253570) @@ -72,17 +72,10 @@ arswitch_split_setpage(device_t dev, uin *phy = (((addr) >> 6) & 0x07) | 0x10; *reg = ((addr) >> 1) & 0x1f; - /* - * The earlier code would only switch the page - * over if the page were different. Experiments have - * shown that this is unstable. - * - * Hence, the page is always set here. - * - * See PR kern/172968 - */ - MDIO_WRITEREG(device_get_parent(dev), 0x18, 0, page); - sc->page = page; + if (sc->page != page) { + MDIO_WRITEREG(device_get_parent(dev), 0x18, 0, page); + sc->page = page; + } } /* @@ -171,8 +164,8 @@ arswitch_writereg(device_t dev, int addr { /* XXX Check the first write too? */ - arswitch_writereg_lsb(dev, addr, value); - return (arswitch_writereg_msb(dev, addr, value)); + arswitch_writereg_msb(dev, addr, value); + return (arswitch_writereg_lsb(dev, addr, value)); } int Modified: head/sys/dev/etherswitch/arswitch/arswitchvar.h ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitchvar.h Tue Jul 23 13:56:38 2013 (r253569) +++ head/sys/dev/etherswitch/arswitch/arswitchvar.h Tue Jul 23 14:02:38 2013 (r253570) @@ -42,8 +42,6 @@ typedef enum { #define AR8X16_IS_SWITCH(_sc, _type) \ (!!((_sc)->sc_switchtype == AR8X16_SWITCH_ ## _type)) -struct arswitch_softc; - struct arswitch_softc { struct mtx sc_mtx; /* serialize access to softc */ device_t sc_dev; From owner-svn-src-all@FreeBSD.ORG Tue Jul 23 14:14:26 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C63F1347; Tue, 23 Jul 2013 14:14:26 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B609F20CD; Tue, 23 Jul 2013 14:14:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6NEEQS2035684; Tue, 23 Jul 2013 14:14:26 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6NEEP5l035673; Tue, 23 Jul 2013 14:14:25 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201307231414.r6NEEP5l035673@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Tue, 23 Jul 2013 14:14:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253571 - in head: sys/netinet sys/netinet6 sys/netipsec usr.bin/netstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jul 2013 14:14:27 -0000 Author: ae Date: Tue Jul 23 14:14:24 2013 New Revision: 253571 URL: http://svnweb.freebsd.org/changeset/base/253571 Log: Remove the large part of struct ipsecstat. Only few fields of this structure is used, but they already have equal fields in the struct newipsecstat, that was introduced with FAST_IPSEC and then was merged together with old ipsecstat structure. This fixes kernel stack overflow on some architectures after migration ipsecstat to PCPU counters. Reported by: Taku YAMAMOTO, Maciej Milewski Modified: head/sys/netinet/sctp_input.c head/sys/netinet/tcp_input.c head/sys/netinet/udp_usrreq.c head/sys/netinet6/ip6_forward.c head/sys/netinet6/raw_ip6.c head/sys/netinet6/udp6_usrreq.c head/sys/netipsec/ipsec.h head/usr.bin/netstat/ipsec.c Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Tue Jul 23 14:02:38 2013 (r253570) +++ head/sys/netinet/sctp_input.c Tue Jul 23 14:14:24 2013 (r253571) @@ -5705,7 +5705,7 @@ sctp_common_input_processing(struct mbuf #ifdef INET case AF_INET: if (ipsec4_in_reject(m, &inp->ip_inp.inp)) { - IPSECSTAT_INC(in_polvio); + IPSECSTAT_INC(ips_in_polvio); SCTP_STAT_INCR(sctps_hdrops); goto out; } @@ -5714,7 +5714,7 @@ sctp_common_input_processing(struct mbuf #ifdef INET6 case AF_INET6: if (ipsec6_in_reject(m, &inp->ip_inp.inp)) { - IPSEC6STAT_INC(in_polvio); + IPSEC6STAT_INC(ips_in_polvio); SCTP_STAT_INCR(sctps_hdrops); goto out; } Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Tue Jul 23 14:02:38 2013 (r253570) +++ head/sys/netinet/tcp_input.c Tue Jul 23 14:14:24 2013 (r253571) @@ -899,12 +899,12 @@ findpcb: #ifdef IPSEC #ifdef INET6 if (isipv6 && ipsec6_in_reject(m, inp)) { - IPSEC6STAT_INC(in_polvio); + IPSEC6STAT_INC(ips_in_polvio); goto dropunlock; } else #endif /* INET6 */ if (ipsec4_in_reject(m, inp) != 0) { - IPSECSTAT_INC(in_polvio); + IPSECSTAT_INC(ips_in_polvio); goto dropunlock; } #endif /* IPSEC */ Modified: head/sys/netinet/udp_usrreq.c ============================================================================== --- head/sys/netinet/udp_usrreq.c Tue Jul 23 14:02:38 2013 (r253570) +++ head/sys/netinet/udp_usrreq.c Tue Jul 23 14:14:24 2013 (r253571) @@ -282,7 +282,7 @@ udp_append(struct inpcb *inp, struct ip /* Check AH/ESP integrity. */ if (ipsec4_in_reject(n, inp)) { m_freem(n); - IPSECSTAT_INC(in_polvio); + IPSECSTAT_INC(ips_in_polvio); return; } #ifdef IPSEC_NAT_T @@ -1294,7 +1294,7 @@ udp4_espdecap(struct inpcb *inp, struct if (minlen > m->m_pkthdr.len) minlen = m->m_pkthdr.len; if ((m = m_pullup(m, minlen)) == NULL) { - IPSECSTAT_INC(in_inval); + IPSECSTAT_INC(ips_in_inval); return (NULL); /* Bypass caller processing. */ } data = mtod(m, caddr_t); /* Points to ip header. */ @@ -1334,7 +1334,7 @@ udp4_espdecap(struct inpcb *inp, struct uint32_t spi; if (payload <= sizeof(struct esp)) { - IPSECSTAT_INC(in_inval); + IPSECSTAT_INC(ips_in_inval); m_freem(m); return (NULL); /* Discard. */ } @@ -1355,7 +1355,7 @@ udp4_espdecap(struct inpcb *inp, struct tag = m_tag_get(PACKET_TAG_IPSEC_NAT_T_PORTS, 2 * sizeof(uint16_t), M_NOWAIT); if (tag == NULL) { - IPSECSTAT_INC(in_nomem); + IPSECSTAT_INC(ips_in_nomem); m_freem(m); return (NULL); /* Discard. */ } Modified: head/sys/netinet6/ip6_forward.c ============================================================================== --- head/sys/netinet6/ip6_forward.c Tue Jul 23 14:02:38 2013 (r253570) +++ head/sys/netinet6/ip6_forward.c Tue Jul 23 14:14:24 2013 (r253571) @@ -120,7 +120,7 @@ ip6_forward(struct mbuf *m, int srcrt) * before forwarding packet actually. */ if (ipsec6_in_reject(m, NULL)) { - IPSEC6STAT_INC(in_polvio); + IPSEC6STAT_INC(ips_in_polvio); m_freem(m); return; } @@ -182,7 +182,7 @@ ip6_forward(struct mbuf *m, int srcrt) sp = ipsec_getpolicybyaddr(m, IPSEC_DIR_OUTBOUND, IP_FORWARDING, &error); if (sp == NULL) { - IPSEC6STAT_INC(out_inval); + IPSEC6STAT_INC(ips_out_inval); IP6STAT_INC(ip6s_cantforward); if (mcopy) { #if 0 @@ -203,7 +203,7 @@ ip6_forward(struct mbuf *m, int srcrt) /* * This packet is just discarded. */ - IPSEC6STAT_INC(out_polvio); + IPSEC6STAT_INC(ips_out_polvio); IP6STAT_INC(ip6s_cantforward); KEY_FREESP(&sp); if (mcopy) { Modified: head/sys/netinet6/raw_ip6.c ============================================================================== --- head/sys/netinet6/raw_ip6.c Tue Jul 23 14:02:38 2013 (r253570) +++ head/sys/netinet6/raw_ip6.c Tue Jul 23 14:14:24 2013 (r253571) @@ -269,7 +269,7 @@ rip6_input(struct mbuf **mp, int *offp, */ if (n && ipsec6_in_reject(n, last)) { m_freem(n); - IPSEC6STAT_INC(in_polvio); + IPSEC6STAT_INC(ips_in_polvio); /* Do not inject data into pcb. */ } else #endif /* IPSEC */ @@ -301,7 +301,7 @@ rip6_input(struct mbuf **mp, int *offp, */ if ((last != NULL) && ipsec6_in_reject(m, last)) { m_freem(m); - IPSEC6STAT_INC(in_polvio); + IPSEC6STAT_INC(ips_in_polvio); IP6STAT_DEC(ip6s_delivered); /* Do not inject data into pcb. */ INP_RUNLOCK(last); Modified: head/sys/netinet6/udp6_usrreq.c ============================================================================== --- head/sys/netinet6/udp6_usrreq.c Tue Jul 23 14:02:38 2013 (r253570) +++ head/sys/netinet6/udp6_usrreq.c Tue Jul 23 14:14:24 2013 (r253571) @@ -141,7 +141,7 @@ udp6_append(struct inpcb *inp, struct mb /* Check AH/ESP integrity. */ if (ipsec6_in_reject(n, inp)) { m_freem(n); - IPSEC6STAT_INC(in_polvio); + IPSEC6STAT_INC(ips_in_polvio); return; } #endif /* IPSEC */ Modified: head/sys/netipsec/ipsec.h ============================================================================== --- head/sys/netipsec/ipsec.h Tue Jul 23 14:02:38 2013 (r253570) +++ head/sys/netipsec/ipsec.h Tue Jul 23 14:14:24 2013 (r253571) @@ -217,43 +217,17 @@ struct secspacq { /* statistics for ipsec processing */ struct ipsecstat { - uint64_t in_success; /* succeeded inbound process */ - uint64_t in_polvio; - /* security policy violation for inbound process */ - uint64_t in_nosa; /* inbound SA is unavailable */ - uint64_t in_inval; /* inbound processing failed due to EINVAL */ - uint64_t in_nomem; /* inbound processing failed due to ENOBUFS */ - uint64_t in_badspi; /* failed getting a SPI */ - uint64_t in_ahreplay; /* AH replay check failed */ - uint64_t in_espreplay; /* ESP replay check failed */ - uint64_t in_ahauthsucc; /* AH authentication success */ - uint64_t in_ahauthfail; /* AH authentication failure */ - uint64_t in_espauthsucc; /* ESP authentication success */ - uint64_t in_espauthfail; /* ESP authentication failure */ - uint64_t in_esphist[256]; - uint64_t in_ahhist[256]; - uint64_t in_comphist[256]; - uint64_t out_success; /* succeeded outbound process */ - uint64_t out_polvio; - /* security policy violation for outbound process */ - uint64_t out_nosa; /* outbound SA is unavailable */ - uint64_t out_inval; /* outbound process failed due to EINVAL */ - uint64_t out_nomem; /* inbound processing failed due to ENOBUFS */ - uint64_t out_noroute; /* there is no route */ - uint64_t out_esphist[256]; - uint64_t out_ahhist[256]; - uint64_t out_comphist[256]; - - uint64_t spdcachelookup; - uint64_t spdcachemiss; - uint64_t ips_in_polvio; /* input: sec policy violation */ + uint64_t ips_in_nomem; /* input: no memory available */ + uint64_t ips_in_inval; /* input: generic error */ + uint64_t ips_out_polvio; /* output: sec policy violation */ uint64_t ips_out_nosa; /* output: SA unavailable */ uint64_t ips_out_nomem; /* output: no memory available */ uint64_t ips_out_noroute; /* output: no route available */ uint64_t ips_out_inval; /* output: generic error */ uint64_t ips_out_bundlesa; /* output: bundled SA processed */ + uint64_t ips_mbcoalesced; /* mbufs coalesced during clone */ uint64_t ips_clcoalesced; /* clusters coalesced during clone */ uint64_t ips_clcopied; /* clusters copied during clone */ Modified: head/usr.bin/netstat/ipsec.c ============================================================================== --- head/usr.bin/netstat/ipsec.c Tue Jul 23 14:02:38 2013 (r253570) +++ head/usr.bin/netstat/ipsec.c Tue Jul 23 14:14:24 2013 (r253571) @@ -166,84 +166,18 @@ static struct val2str ipsec_compnames[] { -1, NULL }, }; -static void ipsec_hist(const u_quad_t *hist, size_t histmax, - const struct val2str *name, const char *title); static void print_ipsecstats(const struct ipsecstat *ipsecstat); - -/* - * Dump IPSEC statistics structure. - */ -static void -ipsec_hist(const u_quad_t *hist, size_t histmax, const struct val2str *name, - const char *title) -{ - int first; - size_t proto; - const struct val2str *p; - - first = 1; - for (proto = 0; proto < histmax; proto++) { - if (hist[proto] <= 0) - continue; - if (first) { - printf("\t%s histogram:\n", title); - first = 0; - } - for (p = name; p && p->str; p++) { - if (p->val == (int)proto) - break; - } - if (p && p->str) { - printf("\t\t%s: %ju\n", p->str, (uintmax_t)hist[proto]); - } else { - printf("\t\t#%ld: %ju\n", (long)proto, - (uintmax_t)hist[proto]); - } - } -} - static void print_ipsecstats(const struct ipsecstat *ipsecstat) { #define p(f, m) if (ipsecstat->f || sflag <= 1) \ printf(m, (uintmax_t)ipsecstat->f, plural(ipsecstat->f)) -#define pes(f, m) if (ipsecstat->f || sflag <= 1) \ - printf(m, (uintmax_t)ipsecstat->f, plurales(ipsecstat->f)) -#define hist(f, n, t) \ - ipsec_hist((f), sizeof(f)/sizeof(f[0]), (n), (t)); - - p(in_success, "\t%ju inbound packet%s processed successfully\n"); - p(in_polvio, "\t%ju inbound packet%s violated process security " - "policy\n"); - p(in_nosa, "\t%ju inbound packet%s with no SA available\n"); - p(in_inval, "\t%ju invalid inbound packet%s\n"); - p(in_nomem, "\t%ju inbound packet%s failed due to insufficient memory\n"); - p(in_badspi, "\t%ju inbound packet%s failed getting SPI\n"); - p(in_ahreplay, "\t%ju inbound packet%s failed on AH replay check\n"); - p(in_espreplay, "\t%ju inbound packet%s failed on ESP replay check\n"); - p(in_ahauthsucc, "\t%ju inbound packet%s considered authentic\n"); - p(in_ahauthfail, "\t%ju inbound packet%s failed on authentication\n"); - hist(ipsecstat->in_ahhist, ipsec_ahnames, "AH input"); - hist(ipsecstat->in_esphist, ipsec_espnames, "ESP input"); - hist(ipsecstat->in_comphist, ipsec_compnames, "IPComp input"); - - p(out_success, "\t%ju outbound packet%s processed successfully\n"); - p(out_polvio, "\t%ju outbound packet%s violated process security " - "policy\n"); - p(out_nosa, "\t%ju outbound packet%s with no SA available\n"); - p(out_inval, "\t%ju invalid outbound packet%s\n"); - p(out_nomem, "\t%ju outbound packet%s failed due to insufficient memory\n"); - p(out_noroute, "\t%ju outbound packet%s with no route\n"); - hist(ipsecstat->out_ahhist, ipsec_ahnames, "AH output"); - hist(ipsecstat->out_esphist, ipsec_espnames, "ESP output"); - hist(ipsecstat->out_comphist, ipsec_compnames, "IPComp output"); - p(spdcachelookup, "\t%ju SPD cache lookup%s\n"); - pes(spdcachemiss, "\t%ju SPD cache miss%s\n"); -#undef pes -#undef hist p(ips_in_polvio, "\t%ju inbound packet%s violated process " "security policy\n"); + p(ips_in_nomem, "\t%ju inbound packet%s failed due to " + "insufficient memory\n"); + p(ips_in_inval, "\t%ju invalid inbound packet%s\n"); p(ips_out_polvio, "\t%ju outbound packet%s violated process " "security policy\n"); p(ips_out_nosa, "\t%ju outbound packet%s with no SA available\n"); From owner-svn-src-all@FreeBSD.ORG Tue Jul 23 14:24:25 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 00DD977C; Tue, 23 Jul 2013 14:24:24 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E280B2152; Tue, 23 Jul 2013 14:24:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6NEOOSa038598; Tue, 23 Jul 2013 14:24:24 GMT (envelope-from loos@svn.freebsd.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6NEOMHD038582; Tue, 23 Jul 2013 14:24:22 GMT (envelope-from loos@svn.freebsd.org) Message-Id: <201307231424.r6NEOMHD038582@svn.freebsd.org> From: Luiz Otavio O Souza Date: Tue, 23 Jul 2013 14:24:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253572 - in head/sys: conf dev/etherswitch/arswitch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jul 2013 14:24:25 -0000 Author: loos Date: Tue Jul 23 14:24:22 2013 New Revision: 253572 URL: http://svnweb.freebsd.org/changeset/base/253572 Log: Add the support for 802.1q and port based vlans for arswitch. Tested on: RB450G (standalone ar8316), RSPRO (standalone ar8316) and TPLink MR-3220 (ar724x integrated switch). Approved by: adrian (mentor) Obtained from: zrouter Added: head/sys/dev/etherswitch/arswitch/arswitch_vlans.c (contents, props changed) head/sys/dev/etherswitch/arswitch/arswitch_vlans.h (contents, props changed) Modified: head/sys/conf/files head/sys/dev/etherswitch/arswitch/arswitch.c head/sys/dev/etherswitch/arswitch/arswitch_7240.c head/sys/dev/etherswitch/arswitch/arswitch_8216.c head/sys/dev/etherswitch/arswitch/arswitch_8226.c head/sys/dev/etherswitch/arswitch/arswitch_8316.c head/sys/dev/etherswitch/arswitch/arswitch_reg.c head/sys/dev/etherswitch/arswitch/arswitch_reg.h head/sys/dev/etherswitch/arswitch/arswitchreg.h head/sys/dev/etherswitch/arswitch/arswitchvar.h Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Jul 23 14:14:24 2013 (r253571) +++ head/sys/conf/files Tue Jul 23 14:24:22 2013 (r253572) @@ -1368,6 +1368,7 @@ dev/etherswitch/arswitch/arswitch_8216.c dev/etherswitch/arswitch/arswitch_8226.c optional arswitch dev/etherswitch/arswitch/arswitch_8316.c optional arswitch dev/etherswitch/arswitch/arswitch_7240.c optional arswitch +dev/etherswitch/arswitch/arswitch_vlans.c optional arswitch dev/etherswitch/etherswitch.c optional etherswitch dev/etherswitch/etherswitch_if.m optional etherswitch dev/etherswitch/ip17x/ip17x.c optional ip17x Modified: head/sys/dev/etherswitch/arswitch/arswitch.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch.c Tue Jul 23 14:14:24 2013 (r253571) +++ head/sys/dev/etherswitch/arswitch/arswitch.c Tue Jul 23 14:24:22 2013 (r253572) @@ -58,6 +58,7 @@ #include #include #include +#include #include #include @@ -162,6 +163,74 @@ arswitch_attach_phys(struct arswitch_sof } static int +arswitch_reset(device_t dev) +{ + + arswitch_writereg(dev, AR8X16_REG_MASK_CTRL, + AR8X16_MASK_CTRL_SOFT_RESET); + DELAY(1000); + if (arswitch_readreg(dev, AR8X16_REG_MASK_CTRL) & + AR8X16_MASK_CTRL_SOFT_RESET) { + device_printf(dev, "unable to reset switch\n"); + return (-1); + } + return (0); +} + +static int +arswitch_set_vlan_mode(struct arswitch_softc *sc, uint32_t mode) +{ + + /* Check for invalid modes. */ + if ((mode & sc->info.es_vlan_caps) != mode) + return (EINVAL); + + switch (mode) { + case ETHERSWITCH_VLAN_DOT1Q: + sc->vlan_mode = ETHERSWITCH_VLAN_DOT1Q; + break; + case ETHERSWITCH_VLAN_PORT: + sc->vlan_mode = ETHERSWITCH_VLAN_PORT; + break; + default: + sc->vlan_mode = 0; + }; + + /* Reset VLANs. */ + arswitch_reset_vlans(sc); + + return (0); +} + +static void +arswitch_ports_init(struct arswitch_softc *sc) +{ + int port; + + /* Port0 - CPU */ + arswitch_writereg(sc->sc_dev, AR8X16_REG_PORT_STS(0), + (AR8X16_IS_SWITCH(sc, AR8216) ? + AR8X16_PORT_STS_SPEED_100 : AR8X16_PORT_STS_SPEED_1000) | + (AR8X16_IS_SWITCH(sc, AR8216) ? 0 : AR8X16_PORT_STS_RXFLOW) | + (AR8X16_IS_SWITCH(sc, AR8216) ? 0 : AR8X16_PORT_STS_TXFLOW) | + AR8X16_PORT_STS_RXMAC | + AR8X16_PORT_STS_TXMAC | + AR8X16_PORT_STS_DUPLEX); + arswitch_writereg(sc->sc_dev, AR8X16_REG_PORT_CTRL(0), + arswitch_readreg(sc->sc_dev, AR8X16_REG_PORT_CTRL(0)) & + ~AR8X16_PORT_CTRL_HEADER); + + for (port = 1; port <= sc->numphys; port++) { + /* Set ports to auto negotiation. */ + arswitch_writereg(sc->sc_dev, AR8X16_REG_PORT_STS(port), + AR8X16_PORT_STS_LINK_AUTO); + arswitch_writereg(sc->sc_dev, AR8X16_REG_PORT_CTRL(port), + arswitch_readreg(sc->sc_dev, AR8X16_REG_PORT_CTRL(port)) & + ~AR8X16_PORT_CTRL_HEADER); + } +} + +static int arswitch_attach(device_t dev) { struct arswitch_softc *sc; @@ -190,11 +259,8 @@ arswitch_attach(device_t dev) else return (ENXIO); - /* - * XXX these two should be part of the switch attach function - */ + /* Common defaults. */ sc->info.es_nports = 5; /* XXX technically 6, but 6th not used */ - sc->info.es_nvlangroups = 16; /* XXX Defaults for externally connected AR8316 */ sc->numphys = 4; @@ -211,34 +277,20 @@ arswitch_attach(device_t dev) (void) resource_int_value(device_get_name(dev), device_get_unit(dev), "is_gmii", &sc->is_gmii); - /* - * This requires much more setup depending upon each chip, including: - * - * + Proper reinitialisation of the PHYs; - * + Initialising the VLAN table; - * + Initialising the port access table and CPU flood/broadcast - * configuration; - * + Other things I haven't yet thought of. - */ -#ifdef NOTYET - arswitch_writereg(dev, AR8X16_REG_MASK_CTRL, - AR8X16_MASK_CTRL_SOFT_RESET); - DELAY(1000); - if (arswitch_readreg(dev, AR8X16_REG_MASK_CTRL) & - AR8X16_MASK_CTRL_SOFT_RESET) { - device_printf(dev, "unable to reset switch\n"); - return (ENXIO); - } -#endif + if (sc->numphys > AR8X16_NUM_PHYS) + sc->numphys = AR8X16_NUM_PHYS; - err = sc->hal.arswitch_hw_setup(sc); - if (err != 0) - return (err); + /* Reset the switch. */ + if (arswitch_reset(dev)) + return (ENXIO); err = sc->hal.arswitch_hw_global_setup(sc); if (err != 0) return (err); + /* Initialize the switch ports. */ + arswitch_ports_init(sc); + /* * Attach the PHYs and complete the bus enumeration. */ @@ -246,6 +298,15 @@ arswitch_attach(device_t dev) if (err != 0) return (err); + /* Default to ingress filters off. */ + err = arswitch_set_vlan_mode(sc, 0); + if (err != 0) + return (err); + + err = sc->hal.arswitch_hw_setup(sc); + if (err != 0) + return (err); + bus_generic_probe(dev); bus_enumerate_hinted_children(dev); err = bus_generic_attach(dev); @@ -428,19 +489,37 @@ arswitch_getinfo(device_t dev) static int arswitch_getport(device_t dev, etherswitch_port_t *p) { - struct arswitch_softc *sc = device_get_softc(dev); + struct arswitch_softc *sc; + struct ifmediareq *ifmr; struct mii_data *mii; - struct ifmediareq *ifmr = &p->es_ifmr; + uint32_t reg; int err; - - if (p->es_port < 0 || p->es_port >= AR8X16_NUM_PORTS) + + sc = device_get_softc(dev); + if (p->es_port < 0 || p->es_port > sc->numphys) return (ENXIO); - p->es_pvid = 0; + + ARSWITCH_LOCK(sc); + + /* Retrieve the PVID. */ + arswitch_get_pvid(sc, p->es_port, &p->es_pvid); + + /* Port flags. */ + reg = arswitch_readreg(sc->sc_dev, AR8X16_REG_PORT_CTRL(p->es_port)); + if (reg & AR8X16_PORT_CTRL_DOUBLE_TAG) + p->es_flags |= ETHERSWITCH_PORT_DOUBLE_TAG; + reg >>= AR8X16_PORT_CTRL_EGRESS_VLAN_MODE_SHIFT; + if ((reg & 0x3) == AR8X16_PORT_CTRL_EGRESS_VLAN_MODE_ADD) + p->es_flags |= ETHERSWITCH_PORT_ADDTAG; + if ((reg & 0x3) == AR8X16_PORT_CTRL_EGRESS_VLAN_MODE_STRIP) + p->es_flags |= ETHERSWITCH_PORT_STRIPTAG; + ARSWITCH_UNLOCK(sc); mii = arswitch_miiforport(sc, p->es_port); if (p->es_port == 0) { /* fill in fixed values for CPU port */ p->es_flags |= ETHERSWITCH_PORT_CPU; + ifmr = &p->es_ifmr; ifmr->ifm_count = 0; ifmr->ifm_current = ifmr->ifm_active = IFM_ETHER | IFM_1000_T | IFM_FDX; @@ -457,29 +536,58 @@ arswitch_getport(device_t dev, etherswit return (0); } -/* - * XXX doesn't yet work? - */ static int arswitch_setport(device_t dev, etherswitch_port_t *p) { int err; + uint32_t reg; struct arswitch_softc *sc; struct ifmedia *ifm; struct mii_data *mii; struct ifnet *ifp; - /* - * XXX check the sc numphys, or the #define ? - */ - if (p->es_port < 0 || p->es_port >= AR8X16_NUM_PHYS) + sc = device_get_softc(dev); + if (p->es_port < 0 || p->es_port > sc->numphys) return (ENXIO); - sc = device_get_softc(dev); + /* Port flags. */ + if (sc->vlan_mode == ETHERSWITCH_VLAN_DOT1Q) { - /* - * XXX TODO: don't set the CPU port? - */ + ARSWITCH_LOCK(sc); + /* Set the PVID. */ + if (p->es_pvid != 0) + arswitch_set_pvid(sc, p->es_port, p->es_pvid); + + /* Mutually exclusive. */ + if (p->es_flags & ETHERSWITCH_PORT_ADDTAG && + p->es_flags & ETHERSWITCH_PORT_STRIPTAG) { + ARSWITCH_UNLOCK(sc); + return (EINVAL); + } + + reg = 0; + if (p->es_flags & ETHERSWITCH_PORT_DOUBLE_TAG) + reg |= AR8X16_PORT_CTRL_DOUBLE_TAG; + if (p->es_flags & ETHERSWITCH_PORT_ADDTAG) + reg |= AR8X16_PORT_CTRL_EGRESS_VLAN_MODE_ADD << + AR8X16_PORT_CTRL_EGRESS_VLAN_MODE_SHIFT; + if (p->es_flags & ETHERSWITCH_PORT_STRIPTAG) + reg |= AR8X16_PORT_CTRL_EGRESS_VLAN_MODE_STRIP << + AR8X16_PORT_CTRL_EGRESS_VLAN_MODE_SHIFT; + + err = arswitch_modifyreg(sc->sc_dev, + AR8X16_REG_PORT_CTRL(p->es_port), + 0x3 << AR8X16_PORT_CTRL_EGRESS_VLAN_MODE_SHIFT | + AR8X16_PORT_CTRL_DOUBLE_TAG, reg); + + ARSWITCH_UNLOCK(sc); + if (err) + return (err); + } + + /* Do not allow media changes on CPU port. */ + if (p->es_port == AR8X16_PORT_CPU) + return (0); mii = arswitch_miiforport(sc, p->es_port); if (mii == NULL) @@ -488,28 +596,7 @@ arswitch_setport(device_t dev, etherswit ifp = arswitch_ifpforport(sc, p->es_port); ifm = &mii->mii_media; - err = ifmedia_ioctl(ifp, &p->es_ifr, ifm, SIOCSIFMEDIA); - return (err); -} - -static int -arswitch_getvgroup(device_t dev, etherswitch_vlangroup_t *vg) -{ - - /* XXX not implemented yet */ - vg->es_vid = 0; - vg->es_member_ports = 0; - vg->es_untagged_ports = 0; - vg->es_fid = 0; - return (0); -} - -static int -arswitch_setvgroup(device_t dev, etherswitch_vlangroup_t *vg) -{ - - /* XXX not implemented yet */ - return (0); + return (ifmedia_ioctl(ifp, &p->es_ifr, ifm, SIOCSIFMEDIA)); } static void @@ -546,6 +633,38 @@ arswitch_ifmedia_sts(struct ifnet *ifp, ifmr->ifm_status = mii->mii_media_status; } +static int +arswitch_getconf(device_t dev, etherswitch_conf_t *conf) +{ + struct arswitch_softc *sc; + + sc = device_get_softc(dev); + + /* Return the VLAN mode. */ + conf->cmd = ETHERSWITCH_CONF_VLAN_MODE; + conf->vlan_mode = sc->vlan_mode; + + return (0); +} + +static int +arswitch_setconf(device_t dev, etherswitch_conf_t *conf) +{ + struct arswitch_softc *sc; + int err; + + sc = device_get_softc(dev); + + /* Set the VLAN mode. */ + if (conf->cmd & ETHERSWITCH_CONF_VLAN_MODE) { + err = arswitch_set_vlan_mode(sc, conf->vlan_mode); + if (err != 0) + return (err); + } + + return (0); +} + static device_method_t arswitch_methods[] = { /* Device interface */ DEVMETHOD(device_probe, arswitch_probe), @@ -576,6 +695,8 @@ static device_method_t arswitch_methods[ DEVMETHOD(etherswitch_setport, arswitch_setport), DEVMETHOD(etherswitch_getvgroup, arswitch_getvgroup), DEVMETHOD(etherswitch_setvgroup, arswitch_setvgroup), + DEVMETHOD(etherswitch_getconf, arswitch_getconf), + DEVMETHOD(etherswitch_setconf, arswitch_setconf), DEVMETHOD_END }; Modified: head/sys/dev/etherswitch/arswitch/arswitch_7240.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_7240.c Tue Jul 23 14:14:24 2013 (r253571) +++ head/sys/dev/etherswitch/arswitch/arswitch_7240.c Tue Jul 23 14:24:22 2013 (r253572) @@ -71,10 +71,6 @@ static int ar7240_hw_setup(struct arswitch_softc *sc) { - /* Enable CPU port; disable mirror port */ - arswitch_writereg(sc->sc_dev, AR8X16_REG_CPU_PORT, - AR8X16_CPU_PORT_EN | AR8X16_CPU_MIRROR_DIS); - return (0); } @@ -85,6 +81,10 @@ static int ar7240_hw_global_setup(struct arswitch_softc *sc) { + /* Enable CPU port; disable mirror port */ + arswitch_writereg(sc->sc_dev, AR8X16_REG_CPU_PORT, + AR8X16_CPU_PORT_EN | AR8X16_CPU_MIRROR_DIS); + /* Setup TAG priority mapping */ arswitch_writereg(sc->sc_dev, AR8X16_REG_TAG_PRIO, 0xfa50); @@ -133,4 +133,9 @@ ar7240_attach(struct arswitch_softc *sc) sc->hal.arswitch_hw_setup = ar7240_hw_setup; sc->hal.arswitch_hw_global_setup = ar7240_hw_global_setup; + + /* Set the switch vlan capabilities. */ + sc->info.es_vlan_caps = ETHERSWITCH_VLAN_DOT1Q | + ETHERSWITCH_VLAN_PORT | ETHERSWITCH_VLAN_DOUBLE_TAG; + sc->info.es_nvlangroups = AR8X16_MAX_VLANS; } Modified: head/sys/dev/etherswitch/arswitch/arswitch_8216.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_8216.c Tue Jul 23 14:14:24 2013 (r253571) +++ head/sys/dev/etherswitch/arswitch/arswitch_8216.c Tue Jul 23 14:24:22 2013 (r253572) @@ -89,4 +89,6 @@ ar8216_attach(struct arswitch_softc *sc) sc->hal.arswitch_hw_setup = ar8216_hw_setup; sc->hal.arswitch_hw_global_setup = ar8216_hw_global_setup; + + sc->info.es_nvlangroups = 0; } Modified: head/sys/dev/etherswitch/arswitch/arswitch_8226.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_8226.c Tue Jul 23 14:14:24 2013 (r253571) +++ head/sys/dev/etherswitch/arswitch/arswitch_8226.c Tue Jul 23 14:24:22 2013 (r253572) @@ -89,4 +89,6 @@ ar8226_attach(struct arswitch_softc *sc) sc->hal.arswitch_hw_setup = ar8226_hw_setup; sc->hal.arswitch_hw_global_setup = ar8226_hw_global_setup; + + sc->info.es_nvlangroups = 0; } Modified: head/sys/dev/etherswitch/arswitch/arswitch_8316.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_8316.c Tue Jul 23 14:14:24 2013 (r253571) +++ head/sys/dev/etherswitch/arswitch/arswitch_8316.c Tue Jul 23 14:24:22 2013 (r253572) @@ -127,7 +127,18 @@ static int ar8316_hw_global_setup(struct arswitch_softc *sc) { - arswitch_writereg(sc->sc_dev, 0x38, 0xc000050e); + arswitch_writereg(sc->sc_dev, 0x38, AR8X16_MAGIC); + + /* Enable CPU port and disable mirror port. */ + arswitch_writereg(sc->sc_dev, AR8X16_REG_CPU_PORT, + AR8X16_CPU_PORT_EN | AR8X16_CPU_MIRROR_DIS); + + /* Setup TAG priority mapping. */ + arswitch_writereg(sc->sc_dev, AR8X16_REG_TAG_PRIO, 0xfa50); + + /* Enable ARP frame acknowledge. */ + arswitch_modifyreg(sc->sc_dev, AR8X16_REG_AT_CTRL, 0, + AR8X16_AT_CTRL_ARP_EN); /* * Flood address table misses to all ports, and enable forwarding of @@ -136,9 +147,14 @@ ar8316_hw_global_setup(struct arswitch_s arswitch_writereg(sc->sc_dev, AR8X16_REG_FLOOD_MASK, AR8X16_FLOOD_MASK_BCAST_TO_CPU | 0x003f003f); + /* Enable jumbo frames. */ arswitch_modifyreg(sc->sc_dev, AR8X16_REG_GLOBAL_CTRL, AR8316_GLOBAL_CTRL_MTU_MASK, 9018 + 8 + 2); + /* Setup service TAG. */ + arswitch_modifyreg(sc->sc_dev, AR8X16_REG_SERVICE_TAG, + AR8X16_SERVICE_TAG_MASK, 0); + return (0); } @@ -148,4 +164,9 @@ ar8316_attach(struct arswitch_softc *sc) sc->hal.arswitch_hw_setup = ar8316_hw_setup; sc->hal.arswitch_hw_global_setup = ar8316_hw_global_setup; + + /* Set the switch vlan capabilities. */ + sc->info.es_vlan_caps = ETHERSWITCH_VLAN_DOT1Q | + ETHERSWITCH_VLAN_PORT | ETHERSWITCH_VLAN_DOUBLE_TAG; + sc->info.es_nvlangroups = AR8X16_MAX_VLANS; } Modified: head/sys/dev/etherswitch/arswitch/arswitch_reg.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_reg.c Tue Jul 23 14:14:24 2013 (r253571) +++ head/sys/dev/etherswitch/arswitch/arswitch_reg.c Tue Jul 23 14:24:22 2013 (r253572) @@ -178,3 +178,24 @@ arswitch_modifyreg(device_t dev, int add value |= set; return (arswitch_writereg(dev, addr, value)); } + +int +arswitch_waitreg(device_t dev, int addr, int mask, int val, int timeout) +{ + int err, v; + + err = -1; + while (1) { + v = arswitch_readreg(dev, addr); + v &= mask; + if (v == val) { + err = 0; + break; + } + if (!timeout) + break; + DELAY(1); + timeout--; + } + return (err); +} Modified: head/sys/dev/etherswitch/arswitch/arswitch_reg.h ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_reg.h Tue Jul 23 14:14:24 2013 (r253571) +++ head/sys/dev/etherswitch/arswitch/arswitch_reg.h Tue Jul 23 14:24:22 2013 (r253572) @@ -34,6 +34,7 @@ extern void arswitch_writedbg(device_t d extern int arswitch_readreg(device_t dev, int addr); extern int arswitch_writereg(device_t dev, int addr, int value); extern int arswitch_modifyreg(device_t dev, int addr, int mask, int set); +extern int arswitch_waitreg(device_t, int, int, int, int); extern int arswitch_readreg_lsb(device_t dev, int addr); extern int arswitch_readreg_msb(device_t dev, int addr); Added: head/sys/dev/etherswitch/arswitch/arswitch_vlans.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/etherswitch/arswitch/arswitch_vlans.c Tue Jul 23 14:24:22 2013 (r253572) @@ -0,0 +1,375 @@ +/*- + * Copyright (c) 2013 Luiz Otavio O Souza. + * Copyright (c) 2011-2012 Stefan Bethke. + * Copyright (c) 2012 Adrian Chadd. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include +#include +#include +#include +#include + +#include + +#include + +#include +#include +#include +#include +#include + +#include "mdio_if.h" +#include "miibus_if.h" +#include "etherswitch_if.h" + +static int +arswitch_vlan_op(struct arswitch_softc *sc, uint32_t op, uint32_t vid, + uint32_t data) +{ + int err; + + if (arswitch_waitreg(sc->sc_dev, AR8X16_REG_VLAN_CTRL, + AR8X16_VLAN_ACTIVE, 0, 5)) + return (EBUSY); + + /* Load the vlan data if needed. */ + if (op == AR8X16_VLAN_OP_LOAD) { + err = arswitch_writereg(sc->sc_dev, AR8X16_REG_VLAN_DATA, + (data & AR8X16_VLAN_MEMBER) | AR8X16_VLAN_VALID); + if (err) + return (err); + } + + if (vid != 0) + op |= ((vid & ETHERSWITCH_VID_MASK) << AR8X16_VLAN_VID_SHIFT); + op |= AR8X16_VLAN_ACTIVE; + arswitch_writereg(sc->sc_dev, AR8X16_REG_VLAN_CTRL, op); + + /* Wait for command processing. */ + if (arswitch_waitreg(sc->sc_dev, AR8X16_REG_VLAN_CTRL, + AR8X16_VLAN_ACTIVE, 0, 5)) + return (EBUSY); + + return (0); +} + +static int +arswitch_flush_dot1q_vlan(struct arswitch_softc *sc) +{ + + ARSWITCH_LOCK_ASSERT(sc, MA_OWNED); + return (arswitch_vlan_op(sc, AR8X16_VLAN_OP_FLUSH, 0, 0)); +} + +static int +arswitch_purge_dot1q_vlan(struct arswitch_softc *sc, int vid) +{ + + ARSWITCH_LOCK_ASSERT(sc, MA_OWNED); + return (arswitch_vlan_op(sc, AR8X16_VLAN_OP_PURGE, vid, 0)); +} + +static int +arswitch_get_dot1q_vlan(struct arswitch_softc *sc, uint32_t *ports, int vid) +{ + uint32_t reg; + int err; + + ARSWITCH_LOCK_ASSERT(sc, MA_OWNED); + err = arswitch_vlan_op(sc, AR8X16_VLAN_OP_GET, vid, 0); + if (err) + return (err); + + reg = arswitch_readreg(sc->sc_dev, AR8X16_REG_VLAN_DATA); + if ((reg & AR8X16_VLAN_VALID) == 0) { + *ports = 0; + return (EINVAL); + } + reg &= ((1 << (sc->numphys + 1)) - 1); + *ports = reg; + return (0); +} + +static int +arswitch_set_dot1q_vlan(struct arswitch_softc *sc, uint32_t ports, int vid) +{ + int err; + + ARSWITCH_LOCK_ASSERT(sc, MA_OWNED); + err = arswitch_vlan_op(sc, AR8X16_VLAN_OP_LOAD, vid, ports); + if (err) + return (err); + return (0); +} + +static int +arswitch_get_port_vlan(struct arswitch_softc *sc, uint32_t *ports, int vid) +{ + int port; + uint32_t reg; + + ARSWITCH_LOCK_ASSERT(sc, MA_OWNED); + /* For port based vlans the vlanid is the same as the port index. */ + port = vid & ETHERSWITCH_VID_MASK; + reg = arswitch_readreg(sc->sc_dev, AR8X16_REG_PORT_VLAN(port)); + *ports = (reg >> AR8X16_PORT_VLAN_DEST_PORTS_SHIFT); + *ports &= AR8X16_VLAN_MEMBER; + return (0); +} + +static int +arswitch_set_port_vlan(struct arswitch_softc *sc, uint32_t ports, int vid) +{ + int err, port; + + ARSWITCH_LOCK_ASSERT(sc, MA_OWNED); + /* For port based vlans the vlanid is the same as the port index. */ + port = vid & ETHERSWITCH_VID_MASK; + err = arswitch_modifyreg(sc->sc_dev, AR8X16_REG_PORT_VLAN(port), + AR8X16_VLAN_MEMBER << AR8X16_PORT_VLAN_DEST_PORTS_SHIFT, + (ports & AR8X16_VLAN_MEMBER) << AR8X16_PORT_VLAN_DEST_PORTS_SHIFT); + if (err) + return (err); + return (0); +} + +/* + * Reset vlans to default state. + */ +void +arswitch_reset_vlans(struct arswitch_softc *sc) +{ + uint32_t ports; + int i, j; + + ARSWITCH_LOCK_ASSERT(sc, MA_NOTOWNED); + + ARSWITCH_LOCK(sc); + + /* Reset all vlan data. */ + memset(sc->vid, 0, sizeof(sc->vid)); + + /* Disable the QinQ and egress filters for all ports. */ + for (i = 0; i <= sc->numphys; i++) { + if (arswitch_modifyreg(sc->sc_dev, AR8X16_REG_PORT_CTRL(i), + 0x3 << AR8X16_PORT_CTRL_EGRESS_VLAN_MODE_SHIFT | + AR8X16_PORT_CTRL_DOUBLE_TAG, 0)) { + ARSWITCH_UNLOCK(sc); + return; + } + } + + if (arswitch_flush_dot1q_vlan(sc)) { + ARSWITCH_UNLOCK(sc); + return; + } + + if (sc->vlan_mode == ETHERSWITCH_VLAN_DOT1Q) { + /* + * Reset the port based vlan settings and turn on the + * ingress filter for all ports. + */ + ports = 0; + for (i = 0; i <= sc->numphys; i++) + arswitch_modifyreg(sc->sc_dev, + AR8X16_REG_PORT_VLAN(i), + AR8X16_PORT_VLAN_MODE_MASK | + AR8X16_VLAN_MEMBER << + AR8X16_PORT_VLAN_DEST_PORTS_SHIFT, + AR8X16_PORT_VLAN_MODE_SECURE << + AR8X16_PORT_VLAN_MODE_SHIFT); + + /* + * Setup vlan 1 as PVID for all switch ports. Add all ports + * as members of vlan 1. + */ + sc->vid[0] = 1; + /* Set PVID for everyone. */ + for (i = 0; i <= sc->numphys; i++) + arswitch_set_pvid(sc, i, sc->vid[0]); + ports = 0; + for (i = 0; i <= sc->numphys; i++) + ports |= (1 << i); + arswitch_set_dot1q_vlan(sc, ports, sc->vid[0]); + sc->vid[0] |= ETHERSWITCH_VID_VALID; + } else if (sc->vlan_mode == ETHERSWITCH_VLAN_PORT) { + /* Initialize the port based vlans. */ + for (i = 0; i <= sc->numphys; i++) { + sc->vid[i] = i | ETHERSWITCH_VID_VALID; + ports = 0; + for (j = 0; j <= sc->numphys; j++) + ports |= (1 << j); + arswitch_modifyreg(sc->sc_dev, + AR8X16_REG_PORT_VLAN(i), + AR8X16_PORT_VLAN_MODE_MASK | + AR8X16_VLAN_MEMBER << + AR8X16_PORT_VLAN_DEST_PORTS_SHIFT, + ports << AR8X16_PORT_VLAN_DEST_PORTS_SHIFT | + AR8X16_PORT_VLAN_MODE_SECURE << + AR8X16_PORT_VLAN_MODE_PORT_ONLY); + } + } else { + /* Disable the ingress filter and get everyone on all vlans. */ + for (i = 0; i <= sc->numphys; i++) + arswitch_modifyreg(sc->sc_dev, + AR8X16_REG_PORT_VLAN(i), + AR8X16_PORT_VLAN_MODE_MASK | + AR8X16_VLAN_MEMBER << + AR8X16_PORT_VLAN_DEST_PORTS_SHIFT, + AR8X16_VLAN_MEMBER << + AR8X16_PORT_VLAN_DEST_PORTS_SHIFT | + AR8X16_PORT_VLAN_MODE_SECURE << + AR8X16_PORT_VLAN_MODE_PORT_ONLY); + } + ARSWITCH_UNLOCK(sc); +} + +int +arswitch_getvgroup(device_t dev, etherswitch_vlangroup_t *vg) +{ + struct arswitch_softc *sc; + int err; + + sc = device_get_softc(dev); + ARSWITCH_LOCK_ASSERT(sc, MA_NOTOWNED); + + if (vg->es_vlangroup > sc->info.es_nvlangroups) + return (EINVAL); + + /* Reset the members ports. */ + vg->es_untagged_ports = 0; + vg->es_member_ports = 0; + + /* Not supported. */ + vg->es_fid = 0; + + /* Vlan ID. */ + ARSWITCH_LOCK(sc); + vg->es_vid = sc->vid[vg->es_vlangroup]; + if ((vg->es_vid & ETHERSWITCH_VID_VALID) == 0) { + ARSWITCH_UNLOCK(sc); + return (0); + } + + /* Member Ports. */ + switch (sc->vlan_mode) { + case ETHERSWITCH_VLAN_DOT1Q: + err = arswitch_get_dot1q_vlan(sc, &vg->es_member_ports, + vg->es_vid); + break; + case ETHERSWITCH_VLAN_PORT: + err = arswitch_get_port_vlan(sc, &vg->es_member_ports, + vg->es_vid); + break; + default: + vg->es_member_ports = 0; + err = -1; + } + ARSWITCH_UNLOCK(sc); + vg->es_untagged_ports = vg->es_member_ports; + return (err); +} + +int +arswitch_setvgroup(device_t dev, etherswitch_vlangroup_t *vg) +{ + struct arswitch_softc *sc; + int err, vid; + + sc = device_get_softc(dev); + ARSWITCH_LOCK_ASSERT(sc, MA_NOTOWNED); + + /* Check VLAN mode. */ + if (sc->vlan_mode == 0) + return (EINVAL); + + /* + * Check if we are changing the vlanid for an already used vtu entry. + * Then purge the entry first. + */ + ARSWITCH_LOCK(sc); + vid = sc->vid[vg->es_vlangroup]; + if (sc->vlan_mode == ETHERSWITCH_VLAN_DOT1Q && + (vid & ETHERSWITCH_VID_VALID) != 0 && + (vid & ETHERSWITCH_VID_MASK) != + (vg->es_vid & ETHERSWITCH_VID_MASK)) { + err = arswitch_purge_dot1q_vlan(sc, vid); + if (err) { + ARSWITCH_UNLOCK(sc); + return (err); + } + } + + /* Vlan ID. */ + if (sc->vlan_mode == ETHERSWITCH_VLAN_DOT1Q) { + sc->vid[vg->es_vlangroup] = vg->es_vid & ETHERSWITCH_VID_MASK; + /* Setting the vlanid to zero disables the vlangroup. */ + if (sc->vid[vg->es_vlangroup] == 0) { + ARSWITCH_UNLOCK(sc); + return (0); + } + sc->vid[vg->es_vlangroup] |= ETHERSWITCH_VID_VALID; + vid = sc->vid[vg->es_vlangroup]; + } + + /* Member Ports. */ + switch (sc->vlan_mode) { + case ETHERSWITCH_VLAN_DOT1Q: + err = arswitch_set_dot1q_vlan(sc, vg->es_member_ports, vid); + break; + case ETHERSWITCH_VLAN_PORT: + err = arswitch_set_port_vlan(sc, vg->es_member_ports, vid); + break; + default: + err = -1; + } + ARSWITCH_UNLOCK(sc); + return (err); +} + +int +arswitch_get_pvid(struct arswitch_softc *sc, int port, int *pvid) +{ + uint32_t reg; + + ARSWITCH_LOCK_ASSERT(sc, MA_OWNED); + reg = arswitch_readreg(sc->sc_dev, AR8X16_REG_PORT_VLAN(port)); + *pvid = reg & 0xfff; + return (0); +} + +int +arswitch_set_pvid(struct arswitch_softc *sc, int port, int pvid) +{ + + ARSWITCH_LOCK_ASSERT(sc, MA_OWNED); + return (arswitch_modifyreg(sc->sc_dev, + AR8X16_REG_PORT_VLAN(port), 0xfff, pvid)); +} Added: head/sys/dev/etherswitch/arswitch/arswitch_vlans.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/etherswitch/arswitch/arswitch_vlans.h Tue Jul 23 14:24:22 2013 (r253572) @@ -0,0 +1,38 @@ +/*- + * Copyright (c) 2013 Luiz Otavio O Souza. + * Copyright (c) 2011-2012 Stefan Bethke. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ +#ifndef __ARSWITCH_VLANS_H__ +#define __ARSWITCH_VLANS_H__ + +void arswitch_reset_vlans(struct arswitch_softc *); +int arswitch_getvgroup(device_t, etherswitch_vlangroup_t *); +int arswitch_setvgroup(device_t, etherswitch_vlangroup_t *); +int arswitch_get_pvid(struct arswitch_softc *, int, int *); +int arswitch_set_pvid(struct arswitch_softc *, int, int); + +#endif /* __ARSWITCH_VLANS_H__ */ Modified: head/sys/dev/etherswitch/arswitch/arswitchreg.h ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitchreg.h Tue Jul 23 14:14:24 2013 (r253571) +++ head/sys/dev/etherswitch/arswitch/arswitchreg.h Tue Jul 23 14:24:22 2013 (r253572) @@ -114,7 +114,7 @@ #define AR8X16_VLAN_PRIO_EN (1 << 31) #define AR8X16_REG_VLAN_DATA 0x0044 -#define AR8X16_VLAN_MEMBER 0x000003ff +#define AR8X16_VLAN_MEMBER 0x0000003f #define AR8X16_VLAN_VALID (1 << 11) #define AR8X16_REG_ARL_CTRL0 0x0050 Modified: head/sys/dev/etherswitch/arswitch/arswitchvar.h ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitchvar.h Tue Jul 23 14:14:24 2013 (r253571) +++ head/sys/dev/etherswitch/arswitch/arswitchvar.h Tue Jul 23 14:24:22 2013 (r253572) @@ -57,6 +57,10 @@ struct arswitch_softc { struct callout callout_tick; etherswitch_info_t info; + /* VLANs support */ + int vid[AR8X16_MAX_VLANS]; + uint32_t vlan_mode; + struct { int (* arswitch_hw_setup) (struct arswitch_softc *); int (* arswitch_hw_global_setup) (struct arswitch_softc *); From owner-svn-src-all@FreeBSD.ORG Tue Jul 23 14:48:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 22191FBA; Tue, 23 Jul 2013 14:48:38 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 13AE82269; Tue, 23 Jul 2013 14:48:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6NEmbDJ044824; Tue, 23 Jul 2013 14:48:37 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6NEmbeo044823; Tue, 23 Jul 2013 14:48:37 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201307231448.r6NEmbeo044823@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 23 Jul 2013 14:48:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253573 - head/sys/fs/tmpfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jul 2013 14:48:38 -0000 Author: nwhitehorn Date: Tue Jul 23 14:48:37 2013 New Revision: 253573 URL: http://svnweb.freebsd.org/changeset/base/253573 Log: tmpfs works perfectly fine with -o union -- there is no reason to exclude it from the list of options. Modified: head/sys/fs/tmpfs/tmpfs_vfsops.c Modified: head/sys/fs/tmpfs/tmpfs_vfsops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vfsops.c Tue Jul 23 14:24:22 2013 (r253572) +++ head/sys/fs/tmpfs/tmpfs_vfsops.c Tue Jul 23 14:48:37 2013 (r253573) @@ -79,7 +79,7 @@ static int tmpfs_statfs(struct mount *, static const char *tmpfs_opts[] = { "from", "size", "maxfilesize", "inodes", "uid", "gid", "mode", "export", - NULL + "union", NULL }; static const char *tmpfs_updateopts[] = { From owner-svn-src-all@FreeBSD.ORG Tue Jul 23 16:49:24 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 88D8180; Tue, 23 Jul 2013 16:49:24 +0000 (UTC) (envelope-from marck@rinet.ru) Received: from woozle.rinet.ru (woozle.rinet.ru [195.54.192.68]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 16A41296B; Tue, 23 Jul 2013 16:49:23 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by woozle.rinet.ru (8.14.5/8.14.5) with ESMTP id r6NGnKt3080776; Tue, 23 Jul 2013 20:49:20 +0400 (MSK) (envelope-from marck@rinet.ru) Date: Tue, 23 Jul 2013 20:49:20 +0400 (MSK) From: Dmitry Morozovsky To: Nathan Whitehorn Subject: Re: svn commit: r253573 - head/sys/fs/tmpfs In-Reply-To: <201307231448.r6NEmbeo044823@svn.freebsd.org> Message-ID: References: <201307231448.r6NEmbeo044823@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-NCC-RegID: ru.rinet X-OpenPGP-Key-ID: 6B691B03 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (woozle.rinet.ru [0.0.0.0]); Tue, 23 Jul 2013 20:49:20 +0400 (MSK) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jul 2013 16:49:24 -0000 Nathan, On Tue, 23 Jul 2013, Nathan Whitehorn wrote: > Author: nwhitehorn > Date: Tue Jul 23 14:48:37 2013 > New Revision: 253573 > URL: http://svnweb.freebsd.org/changeset/base/253573 > > Log: > tmpfs works perfectly fine with -o union -- there is no reason to exclude it > from the list of options. Any plans to MFC this, at least to stable/9 after 9.2-R (or preferably before ;) ? -- Sincerely, D.Marck [DM5020, MCK-RIPE, DM3-RIPN] [ FreeBSD committer: marck@FreeBSD.org ] ------------------------------------------------------------------------ *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru *** ------------------------------------------------------------------------ From owner-svn-src-all@FreeBSD.ORG Tue Jul 23 19:34:09 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A19D54E5; Tue, 23 Jul 2013 19:34:09 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 799B1210C; Tue, 23 Jul 2013 19:34:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6NJY92C035203; Tue, 23 Jul 2013 19:34:09 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6NJY9gU035202; Tue, 23 Jul 2013 19:34:09 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201307231934.r6NJY9gU035202@svn.freebsd.org> From: Ed Maste Date: Tue, 23 Jul 2013 19:34:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253580 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jul 2013 19:34:09 -0000 Author: emaste Date: Tue Jul 23 19:34:09 2013 New Revision: 253580 URL: http://svnweb.freebsd.org/changeset/base/253580 Log: Generate debug data release dist sets If WITH_DEBUG_FILES is set the standalone debug data will be excluded from each ${dist}.txz and placed in a ${dist}.debug.txz. Submitted by: gjb Reviewed by: brooks Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue Jul 23 16:17:46 2013 (r253579) +++ head/Makefile.inc1 Tue Jul 23 19:34:09 2013 (r253580) @@ -833,6 +833,18 @@ distributeworld installworld: installche awk 'BEGIN { print "#${MTREE_MAGIC}" } !/ type=/ { file = $$1 } / type=/ { if ($$1 == file) { sub(/^\.\/${dist}\//, "./"); print } }' > \ ${DESTDIR}/${DISTDIR}/${dist}.meta .endfor +.if ${MK_DEBUG_FILES} != "no" +. for dist in base ${EXTRA_DISTRIBUTIONS} + @# For each file that exists in this dist, print the corresponding + @# line from the METALOG. This relies on the fact that + @# a line containing only the filename will sort immediatly before + @# the relevant mtree line. + cd ${DESTDIR}/${DISTDIR}; \ + find ./${dist}/usr/lib/debug | sort -u ${METALOG} - | \ + awk 'BEGIN { print "#${MTREE_MAGIC}" } !/ type=/ { file = $$1 } / type=/ { if ($$1 == file) { sub(/^\.\/${dist}\//, "./"); print } }' > \ + ${DESTDIR}/${DISTDIR}/${dist}.debug.meta +. endfor +.endif .endif .endif @@ -841,13 +853,29 @@ packageworld: .if defined(NO_ROOT) ${_+_}cd ${DESTDIR}/${DISTDIR}/${dist}; \ tar cvJf ${DESTDIR}/${DISTDIR}/${dist}.txz \ + --exclude usr/lib/debug \ @${DESTDIR}/${DISTDIR}/${dist}.meta .else ${_+_}cd ${DESTDIR}/${DISTDIR}/${dist}; \ - tar cvJf ${DESTDIR}/${DISTDIR}/${dist}.txz . + tar cvJf ${DESTDIR}/${DISTDIR}/${dist}.txz \ + --exclude usr/lib/debug . .endif .endfor +.if ${MK_DEBUG_FILES} != "no" +. for dist in base ${EXTRA_DISTRIBUTIONS} +. if defined(NO_ROOT) + ${_+_}cd ${DESTDIR}/${DISTDIR}/${dist}; \ + tar cvJf ${DESTDIR}/${DISTDIR}/${dist}.debug.txz \ + @${DESTDIR}/${DISTDIR}/${dist}.debug.meta +. else + ${_+_}cd ${DESTDIR}/${DISTDIR}/${dist}; \ + tar cvJfL ${DESTDIR}/${DISTDIR}/${dist}.debug.txz \ + usr/lib/debug +. endif +. endfor +.endif + # # reinstall # From owner-svn-src-all@FreeBSD.ORG Tue Jul 23 21:09:27 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1E797E96; Tue, 23 Jul 2013 21:09:27 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0F19E255A; Tue, 23 Jul 2013 21:09:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6NL9Q7Q064054; Tue, 23 Jul 2013 21:09:26 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6NL9QJ7064052; Tue, 23 Jul 2013 21:09:26 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201307232109.r6NL9QJ7064052@svn.freebsd.org> From: Jilles Tjoelker Date: Tue, 23 Jul 2013 21:09:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253581 - in head: lib/libc/gen tools/regression/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jul 2013 21:09:27 -0000 Author: jilles Date: Tue Jul 23 21:09:26 2013 New Revision: 253581 URL: http://svnweb.freebsd.org/changeset/base/253581 Log: wordexp(): Fix syntax validation for backslashes in single-quotes. Modified: head/lib/libc/gen/wordexp.c head/tools/regression/lib/libc/gen/test-wordexp.c Modified: head/lib/libc/gen/wordexp.c ============================================================================== --- head/lib/libc/gen/wordexp.c Tue Jul 23 19:34:09 2013 (r253580) +++ head/lib/libc/gen/wordexp.c Tue Jul 23 21:09:26 2013 (r253581) @@ -251,7 +251,8 @@ we_check(const char *words, int flags) while ((c = *words++) != '\0') { switch (c) { case '\\': - quote ^= 1; + if (squote == 0) + quote ^= 1; continue; case '\'': if (quote + dquote == 0) Modified: head/tools/regression/lib/libc/gen/test-wordexp.c ============================================================================== --- head/tools/regression/lib/libc/gen/test-wordexp.c Tue Jul 23 19:34:09 2013 (r253580) +++ head/tools/regression/lib/libc/gen/test-wordexp.c Tue Jul 23 21:09:26 2013 (r253581) @@ -195,6 +195,18 @@ main(int argc, char *argv[]) r = wordexp("test } test", &we, 0); assert(r == WRDE_BADCHAR); + /* WRDE_SYNTAX */ + r = wordexp("'", &we, 0); + assert(r == WRDE_SYNTAX); + r = wordexp("'", &we, WRDE_UNDEF); + assert(r == WRDE_SYNTAX); + r = wordexp("'\\'", &we, 0); + assert(r == 0); + assert(we.we_wordc == 1); + assert(strcmp(we.we_wordv[0], "\\") == 0); + assert(we.we_wordv[1] == NULL); + wordfree(&we); + /* With a SIGCHLD handler that reaps all zombies. */ sa.sa_flags = 0; sigemptyset(&sa.sa_mask); From owner-svn-src-all@FreeBSD.ORG Tue Jul 23 22:17:01 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C9762452; Tue, 23 Jul 2013 22:17:01 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A00D328A4; Tue, 23 Jul 2013 22:17:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6NMH1uw085272; Tue, 23 Jul 2013 22:17:01 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6NMH1Ln085270; Tue, 23 Jul 2013 22:17:01 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201307232217.r6NMH1Ln085270@svn.freebsd.org> From: Neel Natu Date: Tue, 23 Jul 2013 22:17:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253582 - head/sys/amd64/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jul 2013 22:17:01 -0000 Author: neel Date: Tue Jul 23 22:17:00 2013 New Revision: 253582 URL: http://svnweb.freebsd.org/changeset/base/253582 Log: Fix a bug introduced in r252646 that causes a page with the PG_PTE_PAT bit set to be interpreted as a superpage. This is because PG_PTE_PAT is at the same bit position in PTE as PG_PS is in a PDE. This caused a number of regressions on amd64 systems: panic when starting X applications, freeze during shutdown etc. Pointy hat to: me Tested by: gperez@entel.upc.edu, joel, dumbbell Reviewed by: kib Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Tue Jul 23 21:09:26 2013 (r253581) +++ head/sys/amd64/amd64/pmap.c Tue Jul 23 22:17:00 2013 (r253582) @@ -4401,6 +4401,7 @@ pmap_remove_pages(pmap_t pmap) int64_t bit; uint64_t inuse, bitmask; int allfree, field, freed, idx; + boolean_t superpage; vm_paddr_t pa; if (pmap != PCPU_GET(curpmap)) { @@ -4427,12 +4428,26 @@ pmap_remove_pages(pmap_t pmap) pte = pmap_pdpe_to_pde(pte, pv->pv_va); tpte = *pte; if ((tpte & (PG_PS | PG_V)) == PG_V) { + superpage = FALSE; ptepde = tpte; pte = (pt_entry_t *)PHYS_TO_DMAP(tpte & PG_FRAME); pte = &pte[pmap_pte_index(pv->pv_va)]; tpte = *pte; + } else { + /* + * Keep track whether 'tpte' is a + * superpage explicitly instead of + * relying on PG_PS being set. + * + * This is because PG_PS is numerically + * identical to PG_PTE_PAT and thus a + * regular page could be mistaken for + * a superpage. + */ + superpage = TRUE; } + if ((tpte & PG_V) == 0) { panic("bad pte va %lx pte %lx", pv->pv_va, tpte); @@ -4446,7 +4461,7 @@ pmap_remove_pages(pmap_t pmap) continue; } - if (tpte & PG_PS) + if (superpage) pa = tpte & PG_PS_FRAME; else pa = tpte & PG_FRAME; @@ -4468,7 +4483,7 @@ pmap_remove_pages(pmap_t pmap) * Update the vm_page_t clean/reference bits. */ if ((tpte & (PG_M | PG_RW)) == (PG_M | PG_RW)) { - if ((tpte & PG_PS) != 0) { + if (superpage) { for (mt = m; mt < &m[NBPDR / PAGE_SIZE]; mt++) vm_page_dirty(mt); } else @@ -4479,7 +4494,7 @@ pmap_remove_pages(pmap_t pmap) /* Mark free */ pc->pc_map[field] |= bitmask; - if ((tpte & PG_PS) != 0) { + if (superpage) { pmap_resident_count_dec(pmap, NBPDR / PAGE_SIZE); pvh = pa_to_pvh(tpte & PG_PS_FRAME); TAILQ_REMOVE(&pvh->pv_list, pv, pv_next); From owner-svn-src-all@FreeBSD.ORG Tue Jul 23 22:39:27 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1E145B67; Tue, 23 Jul 2013 22:39:27 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D68D32A0E; Tue, 23 Jul 2013 22:39:26 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7::edc1:b60c:f542:38d1] (unknown [IPv6:2001:7b8:3a7:0:edc1:b60c:f542:38d1]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id A6EC85C5A; Wed, 24 Jul 2013 00:39:16 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\)) Subject: Re: svn commit: r253504 - head/sbin/route From: Dimitry Andric In-Reply-To: <201307201646.r6KGkpM6054344@svn.freebsd.org> Date: Wed, 24 Jul 2013 00:39:15 +0200 Content-Transfer-Encoding: 7bit Message-Id: <36E48152-1A64-432D-A32D-75059A56E181@FreeBSD.org> References: <201307201646.r6KGkpM6054344@svn.freebsd.org> To: Hiroki Sato X-Mailer: Apple Mail (2.1508) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jul 2013 22:39:27 -0000 On Jul 20, 2013, at 18:46, Hiroki Sato wrote: > Author: hrs > Date: Sat Jul 20 16:46:51 2013 > New Revision: 253504 > URL: http://svnweb.freebsd.org/changeset/base/253504 > > Log: > - Simplify getaddr() and print_getmsg() by using RTAX_* instead of RTA_* > as the argument. > - Reduce unnecessary loop in print_getmsg(). > > Modified: > head/sbin/route/route.c Hi, This breaks /etc/rc.d/defaultroute, since it relies on "route -n get -inet default" printing a line with "interface:" in it. Before r253504 it prints: route to: 0.0.0.0 destination: 0.0.0.0 mask: 56.18.1.0 gateway: router.example.com fib: 0 interface: em0 flags: recvpipe sendpipe ssthresh rtt,msec mtu weight expire 0 0 0 0 1500 1 0 (note also the mask seems to be busted, and even though -n is given, the hostname of the gateway is printed, but this is another issue) At r253504 it gives: route to: 0.0.0.0 destination: 0.0.0.0 mask: 56.18.1.0 gateway: router.example.com fib: 0 flags: recvpipe sendpipe ssthresh rtt,msec mtu weight expire 0 0 0 0 1500 1 0 So for some reason, the interface: line is gone.. -Dimitry From owner-svn-src-all@FreeBSD.ORG Tue Jul 23 22:52:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 475533FB; Tue, 23 Jul 2013 22:52:39 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 390552AD8; Tue, 23 Jul 2013 22:52:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6NMqdI6096649; Tue, 23 Jul 2013 22:52:39 GMT (envelope-from jeff@svn.freebsd.org) Received: (from jeff@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6NMqdF0096648; Tue, 23 Jul 2013 22:52:39 GMT (envelope-from jeff@svn.freebsd.org) Message-Id: <201307232252.r6NMqdF0096648@svn.freebsd.org> From: Jeff Roberson Date: Tue, 23 Jul 2013 22:52:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253583 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jul 2013 22:52:39 -0000 Author: jeff Date: Tue Jul 23 22:52:38 2013 New Revision: 253583 URL: http://svnweb.freebsd.org/changeset/base/253583 Log: - Correct a stale comment. We don't have vclean() anymore. The work is done by vgonel() and destroy_vobject() should only be called once from VOP_INACTIVE(). Sponsored by: EMC / Isilon Storage Division Modified: head/sys/vm/vnode_pager.c Modified: head/sys/vm/vnode_pager.c ============================================================================== --- head/sys/vm/vnode_pager.c Tue Jul 23 22:17:00 2013 (r253582) +++ head/sys/vm/vnode_pager.c Tue Jul 23 22:52:38 2013 (r253583) @@ -158,11 +158,6 @@ vnode_destroy_vobject(struct vnode *vp) VM_OBJECT_WLOCK(obj); if (obj->ref_count == 0) { /* - * vclean() may be called twice. The first time - * removes the primary reference to the object, - * the second time goes one further and is a - * special-case to terminate the object. - * * don't double-terminate the object */ if ((obj->flags & OBJ_DEAD) == 0) From owner-svn-src-all@FreeBSD.ORG Tue Jul 23 22:53:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 652AB538; Tue, 23 Jul 2013 22:53:02 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 563692ADE; Tue, 23 Jul 2013 22:53:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6NMr2vl096734; Tue, 23 Jul 2013 22:53:02 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6NMr2dh096733; Tue, 23 Jul 2013 22:53:02 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201307232253.r6NMr2dh096733@svn.freebsd.org> From: Jim Harris Date: Tue, 23 Jul 2013 22:53:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r253584 - stable/9/share/man/man9 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jul 2013 22:53:02 -0000 Author: jimharris Date: Tue Jul 23 22:53:01 2013 New Revision: 253584 URL: http://svnweb.freebsd.org/changeset/base/253584 Log: MFC r253434: Add bus_dmamap_load_bio and bus_dmamap_load_ccb to bus_dma(9). Approved by: re (marius) Modified: stable/9/share/man/man9/bus_dma.9 Directory Properties: stable/9/share/man/man9/ (props changed) Modified: stable/9/share/man/man9/bus_dma.9 ============================================================================== --- stable/9/share/man/man9/bus_dma.9 Tue Jul 23 22:52:38 2013 (r253583) +++ stable/9/share/man/man9/bus_dma.9 Tue Jul 23 22:53:01 2013 (r253584) @@ -60,7 +60,7 @@ .\" $FreeBSD$ .\" $NetBSD: bus_dma.9,v 1.25 2002/10/14 13:43:16 wiz Exp $ .\" -.Dd May 12, 2009 +.Dd July 17, 2013 .Dt BUS_DMA 9 .Os .Sh NAME @@ -70,6 +70,8 @@ .Nm bus_dmamap_create , .Nm bus_dmamap_destroy , .Nm bus_dmamap_load , +.Nm bus_dmamap_load_bio , +.Nm bus_dmamap_load_ccb , .Nm bus_dmamap_load_mbuf , .Nm bus_dmamap_load_mbuf_sg , .Nm bus_dmamap_load_uio , @@ -97,6 +99,14 @@ "bus_size_t buflen" "bus_dmamap_callback_t *callback" "void *callback_arg" \ "int flags" .Ft int +.Fn bus_dmamap_load_bio "bus_dma_tag_t dmat" "bus_dmamap_t map" \ +"struct bio *bio" "bus_dmamap_callback_t *callback" "void *callback_arg" \ +"int flags" +.Ft int +.Fn bus_dmamap_load_ccb "bus_dma_tag_t dmat" "bus_dmamap_t map" \ +"union ccb *ccb" "bus_dmamap_callback_t *callback" "void *callback_arg" \ +"int flags" +.Ft int .Fn bus_dmamap_load_mbuf "bus_dma_tag_t dmat" "bus_dmamap_t map" \ "struct mbuf *mbuf" "bus_dmamap_callback2_t *callback" "void *callback_arg" \ "int flags" @@ -199,7 +209,10 @@ Client specified callback for receiving the load of a .Vt bus_dmamap_t via -.Fn bus_dmamap_load . +.Fn bus_dmamap_load , +.Fn bus_dmamap_load_bio +or +.Fn bus_dmamap_load_ccb . Callbacks are of the format: .Bl -tag -width indent .It Ft void @@ -624,6 +637,49 @@ This array is only valid during the scop A mapping could not be achieved within the segment constraints provided in the tag even though the requested allocation size was less than maxsize. .El +.It Fn bus_dmamap_load_bio "dmat" "map" "bio" "callback" "callback_arg" "flags" +This is a variation of +.Fn bus_dmamap_load +which maps buffers pointed to by +.Fa bio +for DMA transfers. +.Fa bio +may point to either a mapped or unmapped buffer. +.It Fn bus_dmamap_load_ccb "dmat" "map" "ccb" "callback" "callback_arg" "flags" +This is a variation of +.Fn bus_dmamap_load +which maps data pointed to by +.Fa ccb +for DMA transfers. +The data for +.Fa ccb +may be any of the following types: +.Bl -tag -width ".Er CAM_DATA_SG_PADDR" +.It CAM_DATA_VADDR +The data is a single KVA buffer. +.It CAM_DATA_PADDR +The data is a single bus address range. +.It CAM_DATA_SG +The data is a scatter/gather list of KVA buffers. +.It CAM_DATA_SG_PADDR +The data is a scatter/gather list of bus address ranges. +.It CAM_DATA_BIO +The data is contained in a +.Vt struct bio +attached to the CCB. +.El +.Pp +.Fn bus_dmamap_load_ccb +supports the following CCB XPT function codes: +.Pp +.Bl -item -offset indent -compact +.It +XPT_ATA_IO +.It +XPT_CONT_TARGET_IO +.It +XPT_SCSI_IO +.El .It Fn bus_dmamap_load_mbuf "dmat" "map" "mbuf" "callback2" "callback_arg" \ "flags" This is a variation of @@ -898,12 +954,16 @@ These functions include: .It .Fn bus_dmamap_load .It -.Fn bus_dmamap_load_uio +.Fn bus_dmamap_load_bio +.It +.Fn bus_dmamap_load_ccb .It .Fn bus_dmamap_load_mbuf .It .Fn bus_dmamap_load_mbuf_sg .It +.Fn bus_dmamap_load_uio +.It .Fn bus_dmamap_unload .It .Fn bus_dmamap_sync From owner-svn-src-all@FreeBSD.ORG Tue Jul 23 23:43:01 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C722122A; Tue, 23 Jul 2013 23:43:01 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A85972CD0; Tue, 23 Jul 2013 23:43:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6NNh1Vl012545; Tue, 23 Jul 2013 23:43:01 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6NNh1Th012542; Tue, 23 Jul 2013 23:43:01 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201307232343.r6NNh1Th012542@svn.freebsd.org> From: Neel Natu Date: Tue, 23 Jul 2013 23:43:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253585 - head/sys/amd64/vmm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jul 2013 23:43:02 -0000 Author: neel Date: Tue Jul 23 23:43:00 2013 New Revision: 253585 URL: http://svnweb.freebsd.org/changeset/base/253585 Log: Add support for emulation of the "or r/m, imm8" instruction. Submitted by: Zhixiang Yu (zxyu.core@gmail.com) Obtained from: GSoC 2013 (AHCI device emulation for bhyve) Modified: head/sys/amd64/vmm/vmm_instruction_emul.c Modified: head/sys/amd64/vmm/vmm_instruction_emul.c ============================================================================== --- head/sys/amd64/vmm/vmm_instruction_emul.c Tue Jul 23 22:53:01 2013 (r253584) +++ head/sys/amd64/vmm/vmm_instruction_emul.c Tue Jul 23 23:43:00 2013 (r253585) @@ -60,6 +60,7 @@ enum { VIE_OP_TYPE_NONE = 0, VIE_OP_TYPE_MOV, VIE_OP_TYPE_AND, + VIE_OP_TYPE_OR, VIE_OP_TYPE_LAST }; @@ -94,7 +95,13 @@ static const struct vie_op one_byte_opco .op_byte = 0x81, .op_type = VIE_OP_TYPE_AND, .op_flags = VIE_OP_F_IMM, - } + }, + [0x83] = { + /* XXX Group 1 extended opcode - not just OR */ + .op_byte = 0x83, + .op_type = VIE_OP_TYPE_OR, + .op_flags = VIE_OP_F_IMM8, + }, }; /* struct vie.mod */ @@ -338,8 +345,8 @@ emulate_and(void *vm, int vcpuid, uint64 break; case 0x81: /* - * AND reg (ModRM:reg) with immediate and store the - * result in reg + * AND mem (ModRM:r/m) with immediate and store the + * result in mem. * * 81/ and r/m32, imm32 * REX.W + 81/ and r/m64, imm32 sign-extended to 64 @@ -371,6 +378,52 @@ emulate_and(void *vm, int vcpuid, uint64 return (error); } +static int +emulate_or(void *vm, int vcpuid, uint64_t gpa, struct vie *vie, + mem_region_read_t memread, mem_region_write_t memwrite, void *arg) +{ + int error, size; + uint64_t val1; + + size = 4; + error = EINVAL; + + switch (vie->op.op_byte) { + case 0x83: + /* + * OR mem (ModRM:r/m) with immediate and store the + * result in mem. + * + * 83/ OR r/m32, imm8 sign-extended to 32 + * REX.W + 83/ OR r/m64, imm8 sign-extended to 64 + * + * Currently, only the OR operation of the 0x83 opcode + * is implemented (ModRM:reg = b001). + */ + if ((vie->reg & 7) != 1) + break; + + if (vie->rex_w) + size = 8; + + /* get the first operand */ + error = memread(vm, vcpuid, gpa, &val1, size, arg); + if (error) + break; + + /* + * perform the operation with the pre-fetched immediate + * operand and write the result + */ + val1 |= vie->immediate; + error = memwrite(vm, vcpuid, gpa, val1, size, arg); + break; + default: + break; + } + return (error); +} + int vmm_emulate_instruction(void *vm, int vcpuid, uint64_t gpa, struct vie *vie, mem_region_read_t memread, mem_region_write_t memwrite, @@ -390,6 +443,10 @@ vmm_emulate_instruction(void *vm, int vc error = emulate_and(vm, vcpuid, gpa, vie, memread, memwrite, memarg); break; + case VIE_OP_TYPE_OR: + error = emulate_or(vm, vcpuid, gpa, vie, + memread, memwrite, memarg); + break; default: error = EINVAL; break; From owner-svn-src-all@FreeBSD.ORG Tue Jul 23 23:56:48 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 42B47AB6; Tue, 23 Jul 2013 23:56:48 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from mail.allbsd.org (gatekeeper.allbsd.org [IPv6:2001:2f0:104:e001::32]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 33A1E2D79; Tue, 23 Jul 2013 23:56:47 +0000 (UTC) Received: from alph.d.allbsd.org (p2049-ipbf1102funabasi.chiba.ocn.ne.jp [122.26.101.49]) (authenticated bits=128) by mail.allbsd.org (8.14.5/8.14.5) with ESMTP id r6NNuPA5020016 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 24 Jul 2013 08:56:35 +0900 (JST) (envelope-from hrs@FreeBSD.org) Received: from localhost (localhost [IPv6:::1]) (authenticated bits=0) by alph.d.allbsd.org (8.14.5/8.14.5) with ESMTP id r6NNuNqY059916; Wed, 24 Jul 2013 08:56:24 +0900 (JST) (envelope-from hrs@FreeBSD.org) Date: Wed, 24 Jul 2013 08:56:14 +0900 (JST) Message-Id: <20130724.085614.2164169266116807765.hrs@allbsd.org> To: dim@FreeBSD.org Subject: Re: svn commit: r253504 - head/sbin/route From: Hiroki Sato In-Reply-To: <36E48152-1A64-432D-A32D-75059A56E181@FreeBSD.org> References: <201307201646.r6KGkpM6054344@svn.freebsd.org> <36E48152-1A64-432D-A32D-75059A56E181@FreeBSD.org> X-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530 FFD7 4F2C D3D8 2793 CF2D X-Mailer: Mew version 6.5 on Emacs 24.3 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Multipart/Signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="--Security_Multipart(Wed_Jul_24_08_56_14_2013_916)--" Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.97.4 at gatekeeper.allbsd.org X-Virus-Status: Clean X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (mail.allbsd.org [133.31.130.32]); Wed, 24 Jul 2013 08:56:35 +0900 (JST) X-Spam-Status: No, score=-90.6 required=13.0 tests=CONTENT_TYPE_PRESENT, DIRECTOCNDYN,DYN_PBL,RCVD_IN_PBL,SPF_SOFTFAIL,USER_IN_WHITELIST autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on gatekeeper.allbsd.org Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jul 2013 23:56:48 -0000 ----Security_Multipart(Wed_Jul_24_08_56_14_2013_916)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Dimitry Andric wrote in <36E48152-1A64-432D-A32D-75059A56E181@FreeBSD.org>: di> On Jul 20, 2013, at 18:46, Hiroki Sato wrote: di> > Author: hrs di> > Date: Sat Jul 20 16:46:51 2013 di> > New Revision: 253504 di> > URL: http://svnweb.freebsd.org/changeset/base/253504 di> > di> > Log: di> > - Simplify getaddr() and print_getmsg() by using RTAX_* instead of RTA_* di> > as the argument. di> > - Reduce unnecessary loop in print_getmsg(). di> > di> > Modified: di> > head/sbin/route/route.c di> di> Hi, di> di> This breaks /etc/rc.d/defaultroute, since it relies on "route -n get di> -inet default" printing a line with "interface:" in it. Before r253504 di> it prints: di> di> route to: 0.0.0.0 di> destination: 0.0.0.0 di> mask: 56.18.1.0 di> gateway: router.example.com di> fib: 0 di> interface: em0 di> flags: di> recvpipe sendpipe ssthresh rtt,msec mtu weight expire di> 0 0 0 0 1500 1 0 di> di> (note also the mask seems to be busted, and even though -n is given, the di> hostname of the gateway is printed, but this is another issue) di> di> At r253504 it gives: di> di> route to: 0.0.0.0 di> destination: 0.0.0.0 di> mask: 56.18.1.0 di> gateway: router.example.com di> fib: 0 di> flags: di> recvpipe sendpipe ssthresh rtt,msec mtu weight expire di> 0 0 0 0 1500 1 0 di> di> So for some reason, the interface: line is gone.. Gr, sorry. This is my fault. I will fix it soon. -- Hiroki ----Security_Multipart(Wed_Jul_24_08_56_14_2013_916)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.13 (FreeBSD) iEYEABECAAYFAlHvGB4ACgkQTyzT2CeTzy26JgCgjUCXO+5qutYBakFiliwrv6oZ RgIAoMH/g1s4xWbWmrv1O/tCoa2wVw/j =g5Pa -----END PGP SIGNATURE----- ----Security_Multipart(Wed_Jul_24_08_56_14_2013_916)---- From owner-svn-src-all@FreeBSD.ORG Wed Jul 24 01:08:46 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DDD75B80; Wed, 24 Jul 2013 01:08:45 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CD431206A; Wed, 24 Jul 2013 01:08:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6O18jIR037909; Wed, 24 Jul 2013 01:08:45 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6O18jMr037901; Wed, 24 Jul 2013 01:08:45 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201307240108.r6O18jMr037901@svn.freebsd.org> From: Craig Rodrigues Date: Wed, 24 Jul 2013 01:08:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r253586 - stable/9/sbin/mount X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jul 2013 01:08:46 -0000 Author: rodrigc Date: Wed Jul 24 01:08:45 2013 New Revision: 253586 URL: http://svnweb.freebsd.org/changeset/base/253586 Log: MFC 253433: In this GRN, Marcel Moolenaar overhauled the logic for mounting the root file system on bootup: |------------------------------------------------------------------------ |r214006 | marcel | 2010-10-17 22:01:53 -0700 (Sun, 17 Oct 2010) | 20 lines | | Re-implement the root mount logic using a recursive approach, whereby each |root file system (starting with devfs and a synthesized configuration) can |contain directives for mounting another file system as root. |------------------------------------------------------------------------ This commit adds a mount.conf(8) man page which documents the root mount logic. mount.conf(8) also provides some examples for the /.mount.conf file, which can be used to change the root mount behavior. Reviewed by: marcel bjk MFC: 253445: Minor mdoc fixes Approved by: re (gjb) Added: stable/9/sbin/mount/mount.conf.8 - copied, changed from r253433, head/sbin/mount/mount.conf.8 Modified: stable/9/sbin/mount/Makefile (contents, props changed) Directory Properties: stable/9/sbin/mount/ (props changed) Modified: stable/9/sbin/mount/Makefile ============================================================================== --- stable/9/sbin/mount/Makefile Tue Jul 23 23:43:00 2013 (r253585) +++ stable/9/sbin/mount/Makefile Wed Jul 24 01:08:45 2013 (r253586) @@ -3,7 +3,7 @@ PROG= mount SRCS= mount.c mount_fs.c getmntopts.c vfslist.c -MAN= mount.8 +MAN= mount.8 mount.conf.8 # We do NOT install the getmntopts.3 man page. DPADD= ${LIBUTIL} Copied and modified: stable/9/sbin/mount/mount.conf.8 (from r253433, head/sbin/mount/mount.conf.8) ============================================================================== --- head/sbin/mount/mount.conf.8 Wed Jul 17 19:32:07 2013 (r253433, copy source) +++ stable/9/sbin/mount/mount.conf.8 Wed Jul 24 01:08:45 2013 (r253586) @@ -43,7 +43,7 @@ using the logic in the function in .Pa src/sys/kern/vfs_mountroot.c . The root mount logic can be described as follows: -.Bl -enum +.Bl -enum .It The kernel will synthesize in memory a config file with default directives for mounting @@ -58,7 +58,7 @@ as the root file system. Next, the kernel will parse the in-memory config file created in step 1 and try to mount the actual root file system. See -.Sx FILE FORMAT +.Sx FILE FORMAT for the format of the config file. .It When the actual root file system is mounted, @@ -67,7 +67,7 @@ will be re-mounted on the .Pa /dev directory. .It -If a +If a .Pa /.mount.conf file does not exist in the root file system which was just mounted, the root mount logic stops here. @@ -110,7 +110,7 @@ mount -t {FS} -o {OPTIONS} {MOUNTPOINT} .Ed .Pp If this is successfully mounted, -further lines in +further lines in .Pa .mount.conf are ignored. If all lines in @@ -164,7 +164,7 @@ can manually enter the root file system Finally if that does not work, the kernel will panic. .Bd -literal -offset indent .Li .onfail panic -.LI .timeout 3 +.Li .timeout 3 cd9660:/dev/cd0 ro .Li .timeout 0 cd9660:/dev/acd0 ro @@ -211,7 +211,7 @@ The following example will direct the kernel to do a unionfs mount on a directory .Pa /jail/freebsd-8-stable -which has a +which has a .Xr chroot 2 environment. .Bd -literal -offset indent @@ -228,13 +228,13 @@ exist so that the root mount logic can p If this directory does not exist, the system may hang during the bootup process. .Sh SEE ALSO -.Xr boot 8 , +.Xr nmount 2 , +.Xr md 4 , .Xr boot.config 5 , .Xr fstab 5 , +.Xr boot 8 , .Xr loader 8 , -.Xr mount 8 , -.Xr md 4 , -.Xr nmount 2 +.Xr mount 8 .Sh HISTORY The .Nm From owner-svn-src-all@FreeBSD.ORG Wed Jul 24 01:12:29 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 23B4BCE7; Wed, 24 Jul 2013 01:12:29 +0000 (UTC) (envelope-from linimon@lonesome.com) Received: from mail.soaustin.net (pancho.soaustin.net [76.74.250.40]) by mx1.freebsd.org (Postfix) with ESMTP id 08580207F; Wed, 24 Jul 2013 01:12:28 +0000 (UTC) Received: by mail.soaustin.net (Postfix, from userid 502) id 6D85C5606D; Tue, 23 Jul 2013 20:12:28 -0500 (CDT) Date: Tue, 23 Jul 2013 20:12:28 -0500 From: Mark Linimon To: David Chisnall Subject: Re: svn commit: r253563 - head/contrib/libstdc++/include/c_std Message-ID: <20130724011228.GB20455@lonesome.com> References: <201307231023.r6NANhGf065713@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201307231023.r6NANhGf065713@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jul 2013 01:12:29 -0000 On Tue, Jul 23, 2013 at 10:23:43AM +0000, David Chisnall wrote: > A surprising number of configure checks rely on this. It was broken by recent > cleanups to math.h. Once you have the experiences with the ports tree that I have had, you will no longer assume anything about how ports configure checks work (or many other similar items.) Whatever the number, I would hardly find it surprising. The quality of code in the ports collection varies wildly. Some of it is truly professional-quality. Some of it is written by people who cannot even tie their own shoelaces. The bulk of it is somewhere in the middle -- and many of those people simply do not have the patience or aptitude to understand the multitude of build and configure systems that are out there. We simply don't have the several thousand people that it would probably take to audit the tens of millions of lines of code involved. I would like to very politely suggest that regression testing such changes beforehand is a far more effective strategy -- both technical and inter-personal -- than simply assuming that either port authors or maintainers will get such issues correct. They can be subtle, and there are an indefinite number of them. mcl From owner-svn-src-all@FreeBSD.ORG Wed Jul 24 01:25:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id F400C6C; Wed, 24 Jul 2013 01:25:56 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E5A7A20F3; Wed, 24 Jul 2013 01:25:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6O1PuOq043671; Wed, 24 Jul 2013 01:25:56 GMT (envelope-from jeff@svn.freebsd.org) Received: (from jeff@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6O1PuQG043670; Wed, 24 Jul 2013 01:25:56 GMT (envelope-from jeff@svn.freebsd.org) Message-Id: <201307240125.r6O1PuQG043670@svn.freebsd.org> From: Jeff Roberson Date: Wed, 24 Jul 2013 01:25:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253587 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jul 2013 01:25:57 -0000 Author: jeff Date: Wed Jul 24 01:25:56 2013 New Revision: 253587 URL: http://svnweb.freebsd.org/changeset/base/253587 Log: - Remove the long obsolete 'vm_pageout_algorithm' experiment. Discussed with: alc Sponsored by: EMC / Isilon Storage Division Modified: head/sys/vm/vm_pageout.c Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Wed Jul 24 01:08:45 2013 (r253586) +++ head/sys/vm/vm_pageout.c Wed Jul 24 01:25:56 2013 (r253587) @@ -157,7 +157,6 @@ static int vm_pageout_stats; static int vm_pageout_stats_interval; static int vm_pageout_full_stats; static int vm_pageout_full_stats_interval; -static int vm_pageout_algorithm; static int defer_swap_pageouts; static int disable_swap_pageouts; @@ -169,9 +168,6 @@ static int vm_swap_enabled = 1; static int vm_swap_idle_enabled = 0; #endif -SYSCTL_INT(_vm, VM_PAGEOUT_ALGORITHM, pageout_algorithm, - CTLFLAG_RW, &vm_pageout_algorithm, 0, "LRU page mgmt"); - SYSCTL_INT(_vm, OID_AUTO, max_launder, CTLFLAG_RW, &vm_max_launder, 0, "Limit dirty flushes in pageout"); @@ -756,9 +752,7 @@ vm_pageout_object_deactivate_pages(pmap_ if (actcount == 0) { p->act_count -= min(p->act_count, ACT_DECLINE); - if (!remove_mode && - (vm_pageout_algorithm || - p->act_count == 0)) { + if (!remove_mode && p->act_count == 0) { pmap_remove_all(p); vm_page_deactivate(p); } else @@ -1356,8 +1350,7 @@ relock_queues: vm_page_requeue_locked(m); else { m->act_count -= min(m->act_count, ACT_DECLINE); - if (vm_pageout_algorithm || - object->ref_count == 0 || + if (object->ref_count == 0 || m->act_count == 0) { page_shortage--; /* Dequeue to avoid later lock recursion. */ From owner-svn-src-all@FreeBSD.ORG Wed Jul 24 02:01:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3B16D4BA; Wed, 24 Jul 2013 02:01:02 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2B89721F0; Wed, 24 Jul 2013 02:01:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6O212j9055868; Wed, 24 Jul 2013 02:01:02 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6O212L9055867; Wed, 24 Jul 2013 02:01:02 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201307240201.r6O212L9055867@svn.freebsd.org> From: Justin Hibbits Date: Wed, 24 Jul 2013 02:01:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253588 - head/sys/powerpc/ofw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jul 2013 02:01:02 -0000 Author: jhibbits Date: Wed Jul 24 02:01:01 2013 New Revision: 253588 URL: http://svnweb.freebsd.org/changeset/base/253588 Log: Increase the size of the OFW bounce buffer to 4 pages. With this I can now run 'ofwdump -ap' on my quad G5. MFC after: 9.2 branch Modified: head/sys/powerpc/ofw/ofw_real.c Modified: head/sys/powerpc/ofw/ofw_real.c ============================================================================== --- head/sys/powerpc/ofw/ofw_real.c Wed Jul 24 01:25:56 2013 (r253587) +++ head/sys/powerpc/ofw/ofw_real.c Wed Jul 24 02:01:01 2013 (r253588) @@ -210,12 +210,12 @@ ofw_real_bounce_alloc(void *junk) mtx_lock(&of_bounce_mtx); - of_bounce_virt = contigmalloc(PAGE_SIZE, M_OFWREAL, 0, 0, + of_bounce_virt = contigmalloc(4 * PAGE_SIZE, M_OFWREAL, 0, 0, ulmin(platform_real_maxaddr(), BUS_SPACE_MAXADDR_32BIT), PAGE_SIZE, - PAGE_SIZE); + 4 * PAGE_SIZE); of_bounce_phys = vtophys(of_bounce_virt); - of_bounce_size = PAGE_SIZE; + of_bounce_size = 4 * PAGE_SIZE; /* * For virtual-mode OF, direct map this physical address so that From owner-svn-src-all@FreeBSD.ORG Wed Jul 24 04:05:49 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2909789E; Wed, 24 Jul 2013 04:05:49 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1AE152763; Wed, 24 Jul 2013 04:05:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6O45mo7094916; Wed, 24 Jul 2013 04:05:48 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6O45mD9094915; Wed, 24 Jul 2013 04:05:48 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201307240405.r6O45mD9094915@svn.freebsd.org> From: Hiroki Sato Date: Wed, 24 Jul 2013 04:05:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253589 - head/sbin/route X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jul 2013 04:05:49 -0000 Author: hrs Date: Wed Jul 24 04:05:48 2013 New Revision: 253589 URL: http://svnweb.freebsd.org/changeset/base/253589 Log: Fix a bug in cp += SA_SIZE() in RTA_* loop. This could prevent RTA_IFP from displaying correctly in route get subcommand. Spotted by: dim Modified: head/sbin/route/route.c Modified: head/sbin/route/route.c ============================================================================== --- head/sbin/route/route.c Wed Jul 24 02:01:01 2013 (r253588) +++ head/sbin/route/route.c Wed Jul 24 04:05:48 2013 (r253589) @@ -1699,16 +1699,15 @@ print_getmsg(struct rt_msghdr *rtm, int return; } cp = ((char *)(rtm + 1)); - for (i = 0; i < RTAX_MAX; i++) { - if (rtm->rtm_addrs & (1 << i)) + for (i = 0; i < RTAX_MAX; i++) + if (rtm->rtm_addrs & (1 << i)) { sp[i] = (struct sockaddr *)cp; - cp += SA_SIZE((struct sockaddr *)cp); - } - if (rtm->rtm_addrs & RTA_IFP) { - if (sp[RTAX_IFP]->sa_family != AF_LINK || - ((struct sockaddr_dl *)(void *)sp[RTAX_IFP])->sdl_nlen == 0) + cp += SA_SIZE((struct sockaddr *)cp); + } + if ((rtm->rtm_addrs & RTA_IFP) && + (sp[RTAX_IFP]->sa_family != AF_LINK || + ((struct sockaddr_dl *)(void *)sp[RTAX_IFP])->sdl_nlen == 0)) sp[RTAX_IFP] = NULL; - } if (sp[RTAX_DST] && sp[RTAX_NETMASK]) sp[RTAX_NETMASK]->sa_family = sp[RTAX_DST]->sa_family; /* XXX */ if (sp[RTAX_DST]) From owner-svn-src-all@FreeBSD.ORG Wed Jul 24 04:06:50 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 428CD9F2; Wed, 24 Jul 2013 04:06:50 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from mail.allbsd.org (gatekeeper.allbsd.org [IPv6:2001:2f0:104:e001::32]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 38C9D2773; Wed, 24 Jul 2013 04:06:49 +0000 (UTC) Received: from alph.d.allbsd.org (p2049-ipbf1102funabasi.chiba.ocn.ne.jp [122.26.101.49]) (authenticated bits=128) by mail.allbsd.org (8.14.5/8.14.5) with ESMTP id r6O46UZq048032 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 24 Jul 2013 13:06:40 +0900 (JST) (envelope-from hrs@FreeBSD.org) Received: from localhost (localhost [IPv6:::1]) (authenticated bits=0) by alph.d.allbsd.org (8.14.5/8.14.5) with ESMTP id r6O46SVF062121; Wed, 24 Jul 2013 13:06:29 +0900 (JST) (envelope-from hrs@FreeBSD.org) Date: Wed, 24 Jul 2013 13:06:20 +0900 (JST) Message-Id: <20130724.130620.474995323688503714.hrs@allbsd.org> To: dim@FreeBSD.org Subject: Re: svn commit: r253504 - head/sbin/route From: Hiroki Sato In-Reply-To: <36E48152-1A64-432D-A32D-75059A56E181@FreeBSD.org> References: <201307201646.r6KGkpM6054344@svn.freebsd.org> <36E48152-1A64-432D-A32D-75059A56E181@FreeBSD.org> X-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530 FFD7 4F2C D3D8 2793 CF2D X-Mailer: Mew version 6.5 on Emacs 24.3 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Multipart/Signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="--Security_Multipart(Wed_Jul_24_13_06_20_2013_456)--" Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.97.4 at gatekeeper.allbsd.org X-Virus-Status: Clean X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (mail.allbsd.org [133.31.130.32]); Wed, 24 Jul 2013 13:06:40 +0900 (JST) X-Spam-Status: No, score=-90.6 required=13.0 tests=CONTENT_TYPE_PRESENT, DIRECTOCNDYN,DYN_PBL,RCVD_IN_PBL,SPF_SOFTFAIL,USER_IN_WHITELIST autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on gatekeeper.allbsd.org Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jul 2013 04:06:50 -0000 ----Security_Multipart(Wed_Jul_24_13_06_20_2013_456)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Dimitry Andric wrote in <36E48152-1A64-432D-A32D-75059A56E181@FreeBSD.org>: di> On Jul 20, 2013, at 18:46, Hiroki Sato wrote: di> > Author: hrs di> > Date: Sat Jul 20 16:46:51 2013 di> > New Revision: 253504 di> > URL: http://svnweb.freebsd.org/changeset/base/253504 di> > di> > Log: di> > - Simplify getaddr() and print_getmsg() by using RTAX_* instead of RTA_* di> > as the argument. di> > - Reduce unnecessary loop in print_getmsg(). di> > di> > Modified: di> > head/sbin/route/route.c di> di> Hi, di> di> This breaks /etc/rc.d/defaultroute, since it relies on "route -n get di> -inet default" printing a line with "interface:" in it. Before r253504 di> it prints: di> di> route to: 0.0.0.0 di> destination: 0.0.0.0 di> mask: 56.18.1.0 di> gateway: router.example.com di> fib: 0 di> interface: em0 di> flags: di> recvpipe sendpipe ssthresh rtt,msec mtu weight expire di> 0 0 0 0 1500 1 0 di> di> (note also the mask seems to be busted, and even though -n is given, the di> hostname of the gateway is printed, but this is another issue) di> di> At r253504 it gives: di> di> route to: 0.0.0.0 di> destination: 0.0.0.0 di> mask: 56.18.1.0 di> gateway: router.example.com di> fib: 0 di> flags: di> recvpipe sendpipe ssthresh rtt,msec mtu weight expire di> 0 0 0 0 1500 1 0 di> di> So for some reason, the interface: line is gone.. Should be fixed in r253589. Sorry for the breakage. -- Hiroki ----Security_Multipart(Wed_Jul_24_13_06_20_2013_456)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.13 (FreeBSD) iEYEABECAAYFAlHvUrwACgkQTyzT2CeTzy3gwQCgxvuFVfYCWBcgBdTzAn+TCGPd VcgAoJ2Rx+OLSwmpYC9OCUNBn26O5cMo =7oXP -----END PGP SIGNATURE----- ----Security_Multipart(Wed_Jul_24_13_06_20_2013_456)---- From owner-svn-src-all@FreeBSD.ORG Wed Jul 24 04:24:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 062BAD70; Wed, 24 Jul 2013 04:24:22 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E9CA1280A; Wed, 24 Jul 2013 04:24:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6O4OLPL000916; Wed, 24 Jul 2013 04:24:21 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6O4OLEZ000913; Wed, 24 Jul 2013 04:24:21 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201307240424.r6O4OLEZ000913@svn.freebsd.org> From: Marcel Moolenaar Date: Wed, 24 Jul 2013 04:24:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253590 - in head/sys: kern net sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jul 2013 04:24:22 -0000 Author: marcel Date: Wed Jul 24 04:24:21 2013 New Revision: 253590 URL: http://svnweb.freebsd.org/changeset/base/253590 Log: Decouple the UUID generator from network interfaces by having MAC addresses added to the UUID generator using uuid_ether_add(). The UUID generator keeps an arbitrary number of MAC addresses, under the assumption that they are rarely removed (= uuid_ether_del()). This achieves the following: 1. It brings up closer to having the network stack as a loadable module. 2. It allows the UUID generator to filter MAC addresses for best results (= highest chance of uniqeness). 3. MAC addresses can come from anywhere, irrespactive of whether it's used for an interface or not. A side-effect of the change is that when no MAC addresses have been added, a random multicast MAC address is created once and re-used if needed. Previusly, when a random MAC address was needed, it was created for every call. Thus, a change in behaviour is introduced for when no MAC addresses exist. Obtained from: Juniper Networks, Inc. Modified: head/sys/kern/kern_uuid.c head/sys/net/if_ethersubr.c head/sys/sys/uuid.h Modified: head/sys/kern/kern_uuid.c ============================================================================== --- head/sys/kern/kern_uuid.c Wed Jul 24 04:05:48 2013 (r253589) +++ head/sys/kern/kern_uuid.c Wed Jul 24 04:24:21 2013 (r253590) @@ -71,54 +71,41 @@ struct uuid_private { CTASSERT(sizeof(struct uuid_private) == 16); +struct uuid_macaddr { + uint16_t state; +#define UUID_ETHER_EMPTY 0 +#define UUID_ETHER_RANDOM 1 +#define UUID_ETHER_UNIQUE 2 + uint16_t node[UUID_NODE_LEN>>1]; +}; + static struct uuid_private uuid_last; +#define UUID_NETHER 4 +static struct uuid_macaddr uuid_ether[UUID_NETHER]; + static struct mtx uuid_mutex; MTX_SYSINIT(uuid_lock, &uuid_mutex, "UUID generator mutex lock", MTX_DEF); /* - * Return the first MAC address we encounter or, if none was found, - * construct a sufficiently random multicast address. We don't try - * to return the same MAC address as previously returned. We always - * generate a new multicast address if no MAC address exists in the - * system. - * It would be nice to know if 'ifnet' or any of its sub-structures - * has been changed in any way. If not, we could simply skip the - * scan and safely return the MAC address we returned before. + * Return the first MAC address added in the array. If it's empty, then + * construct a sufficiently random multicast MAC address first. Any + * addresses added later will bump the random MAC address up tp the next + * index. */ static void uuid_node(uint16_t *node) { - struct ifnet *ifp; - struct ifaddr *ifa; - struct sockaddr_dl *sdl; int i; - CURVNET_SET(TD_TO_VNET(curthread)); - IFNET_RLOCK_NOSLEEP(); - TAILQ_FOREACH(ifp, &V_ifnet, if_link) { - /* Walk the address list */ - IF_ADDR_RLOCK(ifp); - TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { - sdl = (struct sockaddr_dl*)ifa->ifa_addr; - if (sdl != NULL && sdl->sdl_family == AF_LINK && - sdl->sdl_type == IFT_ETHER) { - /* Got a MAC address. */ - bcopy(LLADDR(sdl), node, UUID_NODE_LEN); - IF_ADDR_RUNLOCK(ifp); - IFNET_RUNLOCK_NOSLEEP(); - CURVNET_RESTORE(); - return; - } - } - IF_ADDR_RUNLOCK(ifp); + if (uuid_ether[0].state == UUID_ETHER_EMPTY) { + for (i = 0; i < (UUID_NODE_LEN>>1); i++) + uuid_ether[0].node[i] = (uint16_t)arc4random(); + *((uint8_t*)uuid_ether[0].node) |= 0x01; + uuid_ether[0].state = UUID_ETHER_RANDOM; } - IFNET_RUNLOCK_NOSLEEP(); - for (i = 0; i < (UUID_NODE_LEN>>1); i++) - node[i] = (uint16_t)arc4random(); - *((uint8_t*)node) |= 0x01; - CURVNET_RESTORE(); + node[i] = uuid_ether[0].node[i]; } /* @@ -211,6 +198,77 @@ sys_uuidgen(struct thread *td, struct uu } int +uuid_ether_add(const uint8_t *addr) +{ + int i; + uint8_t c; + + /* + * Validate input. No multicast addresses and no addresses that + * are all zeroes. + */ + if (addr[0] & 0x01) + return (EINVAL); + c = 0; + for (i = 0; i < UUID_NODE_LEN; i++) + c += addr[i]; + if (c == 0) + return (EINVAL); + + mtx_lock(&uuid_mutex); + + /* Make sure the MAC isn't known already and that there's space. */ + i = 0; + while (i < UUID_NETHER && uuid_ether[i].state == UUID_ETHER_UNIQUE) { + if (!bcmp(addr, uuid_ether[i].node, UUID_NODE_LEN)) { + mtx_unlock(&uuid_mutex); + return (EEXIST); + } + i++; + } + if (i == UUID_NETHER) { + mtx_unlock(&uuid_mutex); + return (ENOSPC); + } + + /* Insert MAC at index, moving the non-empty entry if possible. */ + if (uuid_ether[i].state == UUID_ETHER_RANDOM && i < UUID_NETHER - 1) + uuid_ether[i + 1] = uuid_ether[i]; + uuid_ether[i].state = UUID_ETHER_UNIQUE; + bcopy(addr, uuid_ether[i].node, UUID_NODE_LEN); + mtx_unlock(&uuid_mutex); + return (0); +} + +int +uuid_ether_del(const uint8_t *addr) +{ + int i; + + mtx_lock(&uuid_mutex); + i = 0; + while (i < UUID_NETHER && uuid_ether[i].state == UUID_ETHER_UNIQUE && + bcmp(addr, uuid_ether[i].node, UUID_NODE_LEN)) + i++; + if (i == UUID_NETHER || uuid_ether[i].state != UUID_ETHER_UNIQUE) { + mtx_unlock(&uuid_mutex); + return (ENOENT); + } + + /* Remove it by shifting higher index entries down. */ + while (i < UUID_NETHER - 1 && uuid_ether[i].state != UUID_ETHER_EMPTY) { + uuid_ether[i] = uuid_ether[i + 1]; + i++; + } + if (uuid_ether[i].state != UUID_ETHER_EMPTY) { + uuid_ether[i].state = UUID_ETHER_EMPTY; + bzero(uuid_ether[i].node, UUID_NODE_LEN); + } + mtx_unlock(&uuid_mutex); + return (0); +} + +int snprintf_uuid(char *buf, size_t sz, struct uuid *uuid) { struct uuid_private *id; Modified: head/sys/net/if_ethersubr.c ============================================================================== --- head/sys/net/if_ethersubr.c Wed Jul 24 04:05:48 2013 (r253589) +++ head/sys/net/if_ethersubr.c Wed Jul 24 04:24:21 2013 (r253590) @@ -48,6 +48,7 @@ #include #include #include +#include #include #include @@ -926,6 +927,8 @@ ether_ifattach(struct ifnet *ifp, const break; if (i != ifp->if_addrlen) if_printf(ifp, "Ethernet address: %6D\n", lla, ":"); + + uuid_ether_add(LLADDR(sdl)); } /* @@ -934,6 +937,11 @@ ether_ifattach(struct ifnet *ifp, const void ether_ifdetach(struct ifnet *ifp) { + struct sockaddr_dl *sdl; + + sdl = (struct sockaddr_dl *)(ifp->if_addr->ifa_addr); + uuid_ether_del(LLADDR(sdl)); + if (IFP2AC(ifp)->ac_netgraph != NULL) { KASSERT(ng_ether_detach_p != NULL, ("ng_ether_detach_p is NULL")); Modified: head/sys/sys/uuid.h ============================================================================== --- head/sys/sys/uuid.h Wed Jul 24 04:05:48 2013 (r253589) +++ head/sys/sys/uuid.h Wed Jul 24 04:24:21 2013 (r253590) @@ -58,6 +58,9 @@ struct sbuf; struct uuid *kern_uuidgen(struct uuid *, size_t); +int uuid_ether_add(const uint8_t *); +int uuid_ether_del(const uint8_t *); + int snprintf_uuid(char *, size_t, struct uuid *); int printf_uuid(struct uuid *); int sbuf_printf_uuid(struct sbuf *, struct uuid *); From owner-svn-src-all@FreeBSD.ORG Wed Jul 24 06:13:01 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B0C5C467; Wed, 24 Jul 2013 06:13:01 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A27B92B69; Wed, 24 Jul 2013 06:13:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6O6D0wi034130; Wed, 24 Jul 2013 06:13:00 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6O6D09Y034129; Wed, 24 Jul 2013 06:13:00 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201307240613.r6O6D09Y034129@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 24 Jul 2013 06:13:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253591 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jul 2013 06:13:01 -0000 Author: glebius Date: Wed Jul 24 06:13:00 2013 New Revision: 253591 URL: http://svnweb.freebsd.org/changeset/base/253591 Log: Since r251709 a slab no longer use 8-bit indicies to manage items, thus remove a stale comment. Reviewed by: jeff Modified: head/sys/vm/uma_int.h Modified: head/sys/vm/uma_int.h ============================================================================== --- head/sys/vm/uma_int.h Wed Jul 24 04:24:21 2013 (r253590) +++ head/sys/vm/uma_int.h Wed Jul 24 06:13:00 2013 (r253591) @@ -49,14 +49,6 @@ * 10% memory waste we potentially allocate a separate uma_slab_t if this will * improve the number of items per slab that will fit. * - * Other potential space optimizations are storing the 8bit of linkage in space - * wasted between items due to alignment problems. This may yield a much better - * memory footprint for certain sizes of objects. Another alternative is to - * increase the UMA_SLAB_SIZE, or allow for dynamic slab sizes. I prefer - * dynamic slab sizes because we could stick with 8 bit indices and only use - * large slab sizes for zones with a lot of waste per slab. This may create - * inefficiencies in the vm subsystem due to fragmentation in the address space. - * * The only really gross cases, with regards to memory waste, are for those * items that are just over half the page size. You can get nearly 50% waste, * so you fall back to the memory footprint of the power of two allocator. I From owner-svn-src-all@FreeBSD.ORG Wed Jul 24 07:12:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 92963C53; Wed, 24 Jul 2013 07:12:59 +0000 (UTC) (envelope-from erwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 803362DA1; Wed, 24 Jul 2013 07:12:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6O7CxYJ053115; Wed, 24 Jul 2013 07:12:59 GMT (envelope-from erwin@svn.freebsd.org) Received: (from erwin@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6O7CuKL053097; Wed, 24 Jul 2013 07:12:56 GMT (envelope-from erwin@svn.freebsd.org) Message-Id: <201307240712.r6O7CuKL053097@svn.freebsd.org> From: Erwin Lansing Date: Wed, 24 Jul 2013 07:12:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r253592 - in vendor/bind9/dist: . bin bin/check bin/confgen bin/dig bin/dig/include/dig bin/dnssec bin/named bin/named/include/named bin/named/unix bin/nsupdate bin/rndc bin/tools doc/a... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jul 2013 07:12:59 -0000 Author: erwin Date: Wed Jul 24 07:12:55 2013 New Revision: 253592 URL: http://svnweb.freebsd.org/changeset/base/253592 Log: Vendor import of Bind 9.8.5-P1 Approved by: delphij (mentor) Sponsored by: DK Hostmaster A/S Added: vendor/bind9/dist/lib/dns/rdata/generic/eui48_108.c vendor/bind9/dist/lib/dns/rdata/generic/eui48_108.h vendor/bind9/dist/lib/dns/rdata/generic/eui64_109.c vendor/bind9/dist/lib/dns/rdata/generic/eui64_109.h vendor/bind9/dist/lib/dns/rdata/generic/l32_105.c vendor/bind9/dist/lib/dns/rdata/generic/l32_105.h vendor/bind9/dist/lib/dns/rdata/generic/l64_106.c vendor/bind9/dist/lib/dns/rdata/generic/l64_106.h vendor/bind9/dist/lib/dns/rdata/generic/lp_107.c vendor/bind9/dist/lib/dns/rdata/generic/lp_107.h vendor/bind9/dist/lib/dns/rdata/generic/nid_104.c vendor/bind9/dist/lib/dns/rdata/generic/nid_104.h vendor/bind9/dist/lib/dns/rdata/generic/uri_256.c vendor/bind9/dist/lib/dns/rdata/generic/uri_256.h vendor/bind9/dist/lib/isc/include/isc/regex.h vendor/bind9/dist/lib/isc/regex.c vendor/bind9/dist/libtool.m4/libtool.m4 vendor/bind9/dist/libtool.m4/ltoptions.m4 vendor/bind9/dist/libtool.m4/ltsugar.m4 vendor/bind9/dist/libtool.m4/ltversion.m4 vendor/bind9/dist/libtool.m4/lt~obsolete.m4 Replaced: vendor/bind9/dist/libtool.m4/ Modified: vendor/bind9/dist/CHANGES vendor/bind9/dist/COPYRIGHT vendor/bind9/dist/FAQ vendor/bind9/dist/FAQ.xml vendor/bind9/dist/Makefile.in vendor/bind9/dist/README vendor/bind9/dist/aclocal.m4 vendor/bind9/dist/bin/Makefile.in vendor/bind9/dist/bin/check/check-tool.c vendor/bind9/dist/bin/check/named-checkconf.c vendor/bind9/dist/bin/check/named-checkzone.8 vendor/bind9/dist/bin/check/named-checkzone.c vendor/bind9/dist/bin/check/named-checkzone.docbook vendor/bind9/dist/bin/check/named-checkzone.html vendor/bind9/dist/bin/confgen/keygen.c vendor/bind9/dist/bin/confgen/rndc-confgen.c vendor/bind9/dist/bin/dig/dig.1 vendor/bind9/dist/bin/dig/dig.c vendor/bind9/dist/bin/dig/dig.docbook vendor/bind9/dist/bin/dig/dig.html vendor/bind9/dist/bin/dig/dighost.c vendor/bind9/dist/bin/dig/host.c vendor/bind9/dist/bin/dig/include/dig/dig.h vendor/bind9/dist/bin/dnssec/dnssec-keyfromlabel.c vendor/bind9/dist/bin/dnssec/dnssec-keygen.c vendor/bind9/dist/bin/dnssec/dnssec-revoke.c vendor/bind9/dist/bin/dnssec/dnssec-settime.c vendor/bind9/dist/bin/dnssec/dnssec-signzone.c vendor/bind9/dist/bin/named/Makefile.in vendor/bind9/dist/bin/named/client.c vendor/bind9/dist/bin/named/config.c vendor/bind9/dist/bin/named/control.c vendor/bind9/dist/bin/named/controlconf.c vendor/bind9/dist/bin/named/include/named/client.h vendor/bind9/dist/bin/named/include/named/globals.h vendor/bind9/dist/bin/named/include/named/server.h vendor/bind9/dist/bin/named/interfacemgr.c vendor/bind9/dist/bin/named/log.c vendor/bind9/dist/bin/named/logconf.c vendor/bind9/dist/bin/named/lwresd.c vendor/bind9/dist/bin/named/main.c vendor/bind9/dist/bin/named/named.conf.5 vendor/bind9/dist/bin/named/named.conf.docbook vendor/bind9/dist/bin/named/named.conf.html vendor/bind9/dist/bin/named/query.c vendor/bind9/dist/bin/named/server.c vendor/bind9/dist/bin/named/statschannel.c vendor/bind9/dist/bin/named/tkeyconf.c vendor/bind9/dist/bin/named/tsigconf.c vendor/bind9/dist/bin/named/unix/dlz_dlopen_driver.c vendor/bind9/dist/bin/named/update.c vendor/bind9/dist/bin/named/xfrout.c vendor/bind9/dist/bin/named/zoneconf.c vendor/bind9/dist/bin/nsupdate/nsupdate.c vendor/bind9/dist/bin/rndc/rndc.c vendor/bind9/dist/bin/tools/genrandom.c vendor/bind9/dist/bin/tools/isc-hmac-fixup.8 vendor/bind9/dist/bin/tools/isc-hmac-fixup.docbook vendor/bind9/dist/bin/tools/isc-hmac-fixup.html vendor/bind9/dist/config.h.in vendor/bind9/dist/config.threads.in vendor/bind9/dist/configure.in vendor/bind9/dist/doc/arm/Bv9ARM-book.xml vendor/bind9/dist/doc/arm/Bv9ARM.ch01.html vendor/bind9/dist/doc/arm/Bv9ARM.ch02.html vendor/bind9/dist/doc/arm/Bv9ARM.ch03.html vendor/bind9/dist/doc/arm/Bv9ARM.ch04.html vendor/bind9/dist/doc/arm/Bv9ARM.ch05.html vendor/bind9/dist/doc/arm/Bv9ARM.ch06.html vendor/bind9/dist/doc/arm/Bv9ARM.ch07.html vendor/bind9/dist/doc/arm/Bv9ARM.ch08.html vendor/bind9/dist/doc/arm/Bv9ARM.ch09.html vendor/bind9/dist/doc/arm/Bv9ARM.ch10.html vendor/bind9/dist/doc/arm/Bv9ARM.html vendor/bind9/dist/doc/arm/Bv9ARM.pdf vendor/bind9/dist/doc/arm/man.arpaname.html vendor/bind9/dist/doc/arm/man.ddns-confgen.html vendor/bind9/dist/doc/arm/man.dig.html vendor/bind9/dist/doc/arm/man.dnssec-dsfromkey.html vendor/bind9/dist/doc/arm/man.dnssec-keyfromlabel.html vendor/bind9/dist/doc/arm/man.dnssec-keygen.html vendor/bind9/dist/doc/arm/man.dnssec-revoke.html vendor/bind9/dist/doc/arm/man.dnssec-settime.html vendor/bind9/dist/doc/arm/man.dnssec-signzone.html vendor/bind9/dist/doc/arm/man.genrandom.html vendor/bind9/dist/doc/arm/man.host.html vendor/bind9/dist/doc/arm/man.isc-hmac-fixup.html vendor/bind9/dist/doc/arm/man.named-checkconf.html vendor/bind9/dist/doc/arm/man.named-checkzone.html vendor/bind9/dist/doc/arm/man.named-journalprint.html vendor/bind9/dist/doc/arm/man.named.html vendor/bind9/dist/doc/arm/man.nsec3hash.html vendor/bind9/dist/doc/arm/man.nsupdate.html vendor/bind9/dist/doc/arm/man.rndc-confgen.html vendor/bind9/dist/doc/arm/man.rndc.conf.html vendor/bind9/dist/doc/arm/man.rndc.html vendor/bind9/dist/doc/arm/pkcs11.xml vendor/bind9/dist/doc/misc/options vendor/bind9/dist/isc-config.sh.in vendor/bind9/dist/lib/Makefile.in vendor/bind9/dist/lib/bind9/Makefile.in vendor/bind9/dist/lib/bind9/api vendor/bind9/dist/lib/bind9/check.c vendor/bind9/dist/lib/dns/Makefile.in vendor/bind9/dist/lib/dns/acache.c vendor/bind9/dist/lib/dns/adb.c vendor/bind9/dist/lib/dns/api vendor/bind9/dist/lib/dns/cache.c vendor/bind9/dist/lib/dns/client.c vendor/bind9/dist/lib/dns/db.c vendor/bind9/dist/lib/dns/dispatch.c vendor/bind9/dist/lib/dns/dlz.c vendor/bind9/dist/lib/dns/dnssec.c vendor/bind9/dist/lib/dns/dst_api.c vendor/bind9/dist/lib/dns/dst_internal.h vendor/bind9/dist/lib/dns/dst_openssl.h vendor/bind9/dist/lib/dns/ecdb.c vendor/bind9/dist/lib/dns/gen.c vendor/bind9/dist/lib/dns/gssapictx.c vendor/bind9/dist/lib/dns/include/dns/acache.h vendor/bind9/dist/lib/dns/include/dns/db.h vendor/bind9/dist/lib/dns/include/dns/message.h vendor/bind9/dist/lib/dns/include/dns/name.h vendor/bind9/dist/lib/dns/include/dns/ncache.h vendor/bind9/dist/lib/dns/include/dns/nsec.h vendor/bind9/dist/lib/dns/include/dns/nsec3.h vendor/bind9/dist/lib/dns/include/dns/rdata.h vendor/bind9/dist/lib/dns/include/dns/result.h vendor/bind9/dist/lib/dns/include/dns/rpz.h vendor/bind9/dist/lib/dns/include/dns/types.h vendor/bind9/dist/lib/dns/include/dns/validator.h vendor/bind9/dist/lib/dns/include/dns/view.h vendor/bind9/dist/lib/dns/include/dns/zone.h vendor/bind9/dist/lib/dns/include/dst/dst.h vendor/bind9/dist/lib/dns/master.c vendor/bind9/dist/lib/dns/message.c vendor/bind9/dist/lib/dns/name.c vendor/bind9/dist/lib/dns/ncache.c vendor/bind9/dist/lib/dns/nsec.c vendor/bind9/dist/lib/dns/nsec3.c vendor/bind9/dist/lib/dns/openssl_link.c vendor/bind9/dist/lib/dns/openssldsa_link.c vendor/bind9/dist/lib/dns/opensslecdsa_link.c vendor/bind9/dist/lib/dns/opensslgost_link.c vendor/bind9/dist/lib/dns/opensslrsa_link.c vendor/bind9/dist/lib/dns/peer.c vendor/bind9/dist/lib/dns/rbt.c vendor/bind9/dist/lib/dns/rbtdb.c vendor/bind9/dist/lib/dns/rdata.c vendor/bind9/dist/lib/dns/rdata/any_255/tsig_250.c vendor/bind9/dist/lib/dns/rdata/generic/dlv_32769.c vendor/bind9/dist/lib/dns/rdata/generic/mx_15.c vendor/bind9/dist/lib/dns/rdata/generic/sshfp_44.c vendor/bind9/dist/lib/dns/rdata/generic/txt_16.c vendor/bind9/dist/lib/dns/rdata/in_1/naptr_35.c vendor/bind9/dist/lib/dns/rdata/in_1/nsap_22.c vendor/bind9/dist/lib/dns/request.c vendor/bind9/dist/lib/dns/resolver.c vendor/bind9/dist/lib/dns/result.c vendor/bind9/dist/lib/dns/rootns.c vendor/bind9/dist/lib/dns/rpz.c vendor/bind9/dist/lib/dns/sdb.c vendor/bind9/dist/lib/dns/sdlz.c vendor/bind9/dist/lib/dns/spnego.c vendor/bind9/dist/lib/dns/spnego_asn1.c vendor/bind9/dist/lib/dns/ssu.c vendor/bind9/dist/lib/dns/ssu_external.c vendor/bind9/dist/lib/dns/tkey.c vendor/bind9/dist/lib/dns/tsig.c vendor/bind9/dist/lib/dns/validator.c vendor/bind9/dist/lib/dns/view.c vendor/bind9/dist/lib/dns/xfrin.c vendor/bind9/dist/lib/dns/zone.c vendor/bind9/dist/lib/export/dns/Makefile.in vendor/bind9/dist/lib/export/irs/Makefile.in vendor/bind9/dist/lib/export/isc/Makefile.in vendor/bind9/dist/lib/export/isc/include/isc/Makefile.in vendor/bind9/dist/lib/export/isc/nls/Makefile.in vendor/bind9/dist/lib/export/isc/nothreads/Makefile.in vendor/bind9/dist/lib/export/isc/pthreads/Makefile.in vendor/bind9/dist/lib/export/isc/unix/Makefile.in vendor/bind9/dist/lib/export/isccfg/Makefile.in vendor/bind9/dist/lib/export/samples/Makefile.in vendor/bind9/dist/lib/export/samples/nsprobe.c vendor/bind9/dist/lib/export/samples/sample-async.c vendor/bind9/dist/lib/export/samples/sample-gai.c vendor/bind9/dist/lib/export/samples/sample-request.c vendor/bind9/dist/lib/export/samples/sample-update.c vendor/bind9/dist/lib/export/samples/sample.c vendor/bind9/dist/lib/irs/api vendor/bind9/dist/lib/irs/dnsconf.c vendor/bind9/dist/lib/irs/getaddrinfo.c vendor/bind9/dist/lib/irs/getnameinfo.c vendor/bind9/dist/lib/irs/resconf.c vendor/bind9/dist/lib/isc/Makefile.in vendor/bind9/dist/lib/isc/api vendor/bind9/dist/lib/isc/buffer.c vendor/bind9/dist/lib/isc/include/isc/Makefile.in vendor/bind9/dist/lib/isc/include/isc/buffer.h vendor/bind9/dist/lib/isc/include/isc/file.h vendor/bind9/dist/lib/isc/include/isc/list.h vendor/bind9/dist/lib/isc/include/isc/mem.h vendor/bind9/dist/lib/isc/include/isc/namespace.h vendor/bind9/dist/lib/isc/include/isc/region.h vendor/bind9/dist/lib/isc/include/isc/sockaddr.h vendor/bind9/dist/lib/isc/include/isc/socket.h vendor/bind9/dist/lib/isc/include/isc/task.h vendor/bind9/dist/lib/isc/include/isc/timer.h vendor/bind9/dist/lib/isc/inet_aton.c vendor/bind9/dist/lib/isc/mem.c vendor/bind9/dist/lib/isc/nothreads/Makefile.in vendor/bind9/dist/lib/isc/parseint.c vendor/bind9/dist/lib/isc/pthreads/thread.c vendor/bind9/dist/lib/isc/ratelimiter.c vendor/bind9/dist/lib/isc/sockaddr.c vendor/bind9/dist/lib/isc/sparc64/include/isc/atomic.h vendor/bind9/dist/lib/isc/symtab.c vendor/bind9/dist/lib/isc/task.c vendor/bind9/dist/lib/isc/taskpool.c vendor/bind9/dist/lib/isc/timer.c vendor/bind9/dist/lib/isc/timer_api.c vendor/bind9/dist/lib/isc/unix/entropy.c vendor/bind9/dist/lib/isc/unix/file.c vendor/bind9/dist/lib/isc/unix/include/isc/time.h vendor/bind9/dist/lib/isc/unix/net.c vendor/bind9/dist/lib/isc/unix/socket.c vendor/bind9/dist/lib/isc/unix/time.c vendor/bind9/dist/lib/isccc/api vendor/bind9/dist/lib/isccc/cc.c vendor/bind9/dist/lib/isccfg/Makefile.in vendor/bind9/dist/lib/isccfg/aclconf.c vendor/bind9/dist/lib/isccfg/api vendor/bind9/dist/lib/isccfg/include/isccfg/cfg.h vendor/bind9/dist/lib/isccfg/namedconf.c vendor/bind9/dist/lib/isccfg/parser.c vendor/bind9/dist/lib/lwres/api vendor/bind9/dist/lib/lwres/context.c vendor/bind9/dist/lib/lwres/getaddrinfo.c vendor/bind9/dist/lib/lwres/getipnode.c vendor/bind9/dist/lib/lwres/getnameinfo.c vendor/bind9/dist/lib/lwres/getrrset.c vendor/bind9/dist/lib/lwres/lwinetaton.c vendor/bind9/dist/lib/lwres/print.c vendor/bind9/dist/ltmain.sh vendor/bind9/dist/make/rules.in vendor/bind9/dist/version Modified: vendor/bind9/dist/CHANGES ============================================================================== --- vendor/bind9/dist/CHANGES Wed Jul 24 06:13:00 2013 (r253591) +++ vendor/bind9/dist/CHANGES Wed Jul 24 07:12:55 2013 (r253592) @@ -1,20 +1,386 @@ - --- 9.8.4-P2 released --- + --- 9.8.5-P1 released --- -3516. [security] Removed the check for regex.h in configure in order - to disable regex syntax checking, as it exposes - BIND to a critical flaw in libregex on some - platforms. [RT #32688] +3584. [security] Caching data from an incompletely signed zone could + trigger an assertion failure in resolver.c [RT #33690] - --- 9.8.4-P1 released --- + --- 9.8.5 released --- -3407. [security] Named could die on specific queries with dns64 enabled. - [Addressed in change #3388 for BIND 9.8.5 and 9.9.3.] +3568. [cleanup] Add a product description line to the version file, + to be reported by named -v/-V. [RT #33366] - --- 9.8.4 released --- +3567. [bug] Silence clang static analyzer warnings. [RT #33365] + +3563. [contrib] zone2sqlite failed with some table names. [RT #33375] + +3561. [bug] dig: issue a warning if an EDNS query returns FORMERR + or NOTIMP. Adjust usage message. [RT #33363] + + --- 9.8.5rc1 released --- + +3560. [bug] isc-config.sh did not honor includedir and libdir + when set via configure. [RT #33345] + +3559. [func] Check that both forms of Sender Policy Framework + records exist or do not exist. [RT #33355] + +3558. [bug] IXFR of a DLZ stored zone was broken. [RT #33331] + +3556. [maint] Added AAAA for D.ROOT-SERVERS.NET. + +3555. [bug] Address theoretical race conditions in acache.c + (change #3553 was incomplete). [RT #33252] + +3553. [bug] Address suspected double free in acache. [RT #33252] + +3552. [bug] Wrong getopt option string for 'nsupdate -r'. + [RT #33280] + +3549. [doc] Documentation for "request-nsid" was missing. + [RT #33153] + +3548. [bug] The NSID request code in resolver.c was broken + resulting in invalid EDNS options being sent. + [RT #33153] + +3547. [bug] Some malformed unknown rdata records were not properly + detected and rejected. [RT #33129] + +3056. [func] Added support for URI resource record. [RT #23386] + + --- 9.8.5rc1 released --- + +3546. [func] Add EUI48 and EUI64 types. [RT #33082] + +3544. [contrib] check5011.pl: Script to report the status of + managed keys as recorded in managed-keys.bind. + Contributed by Tony Finch + +3543. [bug] Update socket structure before attaching to socket + manager after accept. [RT #33084] + +3542. [bug] masterformat system test was broken. [RT #33086] + +3541. [bug] Parts of libdns were not properly initialized when + built in libexport mode. [RT #33028] + +3540. [test] libt_api: t_info and t_assert were not thread safe. + +3539. [port] win32: timestamp format didn't match other platforms. + +3538. [test] Running "make test" now requires loopback interfaces + to be set up. [RT #32452] + +3537. [tuning] Slave zones, when updated, now send NOTIFY messages + to peers before being dumped to disk rather than + after. [RT #27242] + +3535. [bug] Minor win32 cleanups. [RT #32962] + +3534. [bug] Extra text after an embedded NULL was ignored when + parsing zone files. [RT #32699] + +3533. [contrib] query-loc-0.4.0: memory leaks. [RT #32960] + +3532. [contrib] zkt: fixed buffer overrun, resource leaks. [RT #32960] + +3531. [bug] win32: A uninitialized value could be returned on out + of memory. [RT #32960] + +3530. [contrib] Better RTT tracking in queryperf. [RT #30128] + +3526. [cleanup] Set up dependencies for unit tests correctly during + build. [RT #32803] + +3521. [bug] Address memory leak in opensslecdsa_link.c. [RT #32249] + +3520. [bug] 'mctx' was not being referenced counted in some places + where it should have been. [RT #32794] + + --- 9.8.5b2 released --- + +3517. [bug] Reorder destruction to avoid shutdown race. [RT #32777] + +3515. [port] '%T' is not portable in strftime(). [RT #32763] + +3514. [bug] The ranges for valid key sizes in ddns-confgen and + rndc-confgen were too constrained. Keys up to 512 + bits are now allowed for most algorithms, and up + to 1024 bits for hmac-sha384 and hmac-sha512. + [RT #32753] + +3509. [cleanup] Added a product line to version file to allow for + easy naming of different products (BIND + vs BIND ESV, for example). [RT #32755] + +3508. [contrib] queryperf was incorrectly rejecting the -T option. + [RT #32338] + +3503. [doc] Clarify size_spec syntax. [RT #32449] + +3500. [security] Support NAPTR regular expression validation on + all platforms without using libregex, which + can be vulnerable to memory exhaustion attack + (CVE-2013-2266). [RT #32688] + +3499. [doc] Corrected ARM documentation of built-in zones. + [RT #32694] + +3498. [bug] zone statistics for zones which matched a potential + empty zone could have their zone-statistics setting + overridden. + +3496. [func] Improvements to RPZ performance. The "response-policy" + syntax now includes a "min-ns-dots" clause, with + default 1, to exclude top-level domains from + NSIP and NSDNAME checking. --enable-rpz-nsip and + --enable-rpz-nsdname are now the default. [RT #32251] + +3489. [bug] --enable-developer now turns on ISC_LIST_CHECKINIT. + When cloning a rdataset do not copy the link contents. + [RT #32651] + +3488. [bug] Use after free error with DH generated keys. [RT #32649] + +3487. [bug] Change 3444 was not complete. There was a additional + place where the NOQNAME proof needed to be saved. + [RT #32629] + +3486. [bug] named could crash when using TKEY-negotiated keys + that had been deleted and then recreated. [RT #32506] + +3485. [cleanup] Only compile openssl_gostlink.c if we support GOST. + +3481. [cleanup] Removed use of const const in atf. + +3479. [bug] Address potential memory leaks in gssapi support + code. [RT #32405] + +3478. [port] Fix a build failure in strict C99 environments + [RT #32475] + +3474. [bug] nsupdate could assert when the local and remote + address families didn't match. [RT #22897] + +3470. [bug] Slave zones could fail to dump when successfully + refreshing after an initial failure. [RT #31276] + + --- 9.8.5b1 released --- + +3468. [security] RPZ rules to generate A records (but not AAAA records) + could trigger an assertion failure when used in + conjunction with DNS64 (CVE-2012-5689). [RT #32141] + +3467. [bug] Added checks in dnssec-keygen and dnssec-settime + to check for delete date < inactive date. [RT #31719] + +3465. [bug] Handle isolated reserved ports. [RT #31778] + +3464. [maint] Updates to PKCS#11 openssl patches, supporting + versions 0.9.8x, 1.0.0j, 1.0.1c [RT #29749] + +3463. [doc] Clarify managed-keys syntax in ARM. [RT #32232] + +3462. [doc] Clarify server selection behavior of dig when using + -4 or -6 options. [RT #32181] + +3461. [bug] Negative responses could incorrectly have AD=1 + set. [RT #32237] + +3458. [bug] Return FORMERR when presented with a overly long + domain named in a request. [RT #29682] + +3457. [protocol] Add ILNP records (NID, LP, L32, L64). [RT #31836] + +3456. [port] g++47: ATF failed to compile. [RT #32012] + +3455. [contrib] queryperf: fix getopt option list. [RT #32338] + +3454. [port] sparc64: improve atomic support. [RT #25182] + +3452. [bug] Accept duplicate singleton records. [RT #32329] + +3451. [port] Increase per thread stack size from 64K to 1M. + [RT #32230] + +3450. [bug] Stop logfileconfig system test spam system logs. + [RT #32315] + +3449. [bug] gen.c: use the pre-processor to construct format + strings so that compiler can perform sanity checks; + check the snprintf results. [RT #17576] + +3448. [bug] The allow-query-on ACL was not processed correctly. + [RT #29486] + +3447. [port] Add support for libxml2-2.9.x [RT #32231] + +3446. [port] win32: Add source ID (see change #3400) to build. + [RT #31683] + +3445. [bug] Warn about zone files with blank owner names + immediately after $ORIGIN directives. [RT #31848] + +3444. [bug] The NOQNAME proof was not being returned from cached + insecure responses. [RT #21409] + +3443. [bug] ddns-confgen: Some TSIG algorithms were incorrectly + rejected when generating keys. [RT #31927] + +3442. [port] Net::DNS 0.69 introduced a non backwards compatible + change. [RT #32216] + +3441. [maint] D.ROOT-SERVERS.NET is now 199.7.91.13. + +3440. [bug] Reorder get_key_struct to not trigger a assertion when + cleaning up due to out of memory error. [RT #32131] + +3439. [bug] contrib/dlz error checking fixes. [RT #32102] + +3438. [bug] Don't accept unknown data escape in quotes. [RT #32031] + +3437. [bug] isc_buffer_init -> isc_buffer_constinit to initialize + buffers with constant data. [RT #32064] + +3436. [bug] Check malloc/calloc return values. [RT #32088] + +3435. [bug] Cross compilation support in configure was broken. + [RT #32078] + +3431. [bug] ddns-confgen: Some valid key algorithms were + not accepted. [RT #31927] + +3430. [bug] win32: isc_time_formatISO8601 was missing the + 'T' between the date and time. [RT #32044] + +3429. [bug] dns_zone_getserial2 could a return success without + returning a valid serial. [RT #32007] + +3428. [cleanup] dig: Add timezone to date output. [RT #2269] + +3427. [bug] dig +trace incorrectly displayed name server + addresses instead of names. [RT #31641] + +3425. [bug] "acacheentry" reference counting was broken resulting + in use after free. [RT #31908] + +3422. [bug] Added a clear error message for when the SOA does not + match the referral. [RT #31281] + +3421. [bug] Named loops when re-signing if all keys are offline. + [RT #31916] + +3420. [bug] Address VPATH compilation issues. [RT #31879] + +3419. [bug] Memory leak on validation cancel. [RT #31869] + +3415. [bug] named could die with a REQUIRE failure if a validation + was canceled. [RT #31804] + +3412. [bug] Copy timeval structure from control message data. + [RT #31548] + +3411. [tuning] Use IPV6_USE_MIN_MTU or equivalent with TCP in addition + to UDP. [RT #31690] + +3410. [bug] Addressed Coverity warnings. [RT #31626] + +3409. [contrib] contrib/dane/mkdane.sh: Tool to generate TLSA RR's + from X.509 certificates, for use with DANE + (DNS-based Authentication of Named Entities). + [RT #30513] + +3406. [bug] mem.c: Fix compilation errors when building with + ISC_MEM_TRACKLINES or ISC_MEMPOOL_NAMES disabled. + Also, ISC_MEM_DEBUG is no longer optional. [RT #31559] + +3405. [bug] Handle time going backwards in acache. [RT #31253] + +3404. [bug] dnssec-signzone: When re-signing a zone, remove + RRSIG and NSEC records from nodes that used to be + in-zone but are now below a zone cut. [RT #31556] + +3403. [bug] Silence noisy OpenSSL logging. [RT #31497] + +3402. [test] The IPv6 interface numbers used for system + tests were incorrect on some platforms. [RT #25085] + +3401. [bug] Addressed Coverity warnings. [RT #31484] + +3400. [cleanup] "named -V" can now report a source ID string, defined + in the "srcid" file in the build tree and normally set + to the most recent git hash. [RT #31494] + +3397. [bug] dig crashed when using +nssearch with +tcp. [RT #25298] + +3396. [bug] OPT records were incorrectly removed from signed, + truncated responses. [RT #31439] + +3395. [protocol] Add RFC 6598 reverse zones to built in empty zones + list, 64.100.IN-ADDR.ARPA ... 127.100.IN-ADDR.ARPA. + [RT #31336] + +3394. [bug] Adjust 'successfully validated after lower casing + signer' log level and category. [RT #31414] + +3393. [bug] 'host -C' could core dump if REFUSED was received. + [RT #31381] + +3391. [bug] A DNSKEY lookup that encountered a CNAME failed. + [RT #31262] + +3390. [bug] Silence clang compiler warnings. [RT #30417] + +3389. [bug] Always return NOERROR (not 0) in TSIG. [RT #31275] + +3388. [bug] Fixed several Coverity warnings. + Note: This change includes a fix for a bug that + was subsequently determined to be an exploitable + security vulnerability, CVE-2012-5688: named could + die on specific queries with dns64 enabled. + [RT #30996] + +3386. [bug] Address locking violation when generating new NSEC / + NSEC3 chains. [RT #31224] + +3384. [bug] Improved logging of crypto errors. [RT #30963] 3383. [security] A certain combination of records in the RBT could - cause named to hang while populating the additional - section of a response. [RT #31090] + cause named to hang while populating the additional + section of a response. [RT #31090] + +3382. [bug] SOA query from slave used use-v6-udp-ports range, + if set, regardless of the address family in use. + [RT #24173] + +3381. [contrib] Update queryperf to support more RR types. + [RT #30762] + +3380. [bug] named could die if a nonexistent master list was + referenced in a also-notify. [RT #31004] + +3379. [bug] isc_interval_zero and isc_time_epoch should be + "const (type)* const". [RT #31069] + +3378. [bug] Handle missing 'managed-keys-directory' better. + [RT #30625] + +3376. [bug] Lack of EDNS support was being recorded without a + successful response. [RT #30811] + +3375. [func] Check that 'rndc dumpdb' works on a empty cache. + [RT #30808] + +3374. [bug] isc_parse_uint32 failed to return a range error on + systems with 64 bit longs. [RT #30232] + +3372. [bug] Silence spurious "deleted from unreachable cache" + messages. [RT #30501] + +3371. [bug] AD=1 should behave like DO=1 when deciding whether to + add NS RRsets to the additional section or not. + [RT #30479] + + --- 9.8.4 released --- 3373. [bug] win32: open raw files in binary mode. [RT #30944] @@ -135,11 +501,11 @@ --- 9.8.3 released --- 3318. [tuning] Reduce the amount of work performed while holding a - bucket lock when finshed with a fetch context. + bucket lock when finished with a fetch context. [RT #29239] -3314. [bug] The masters list could be updated while refesh_callback - and stub_callback were using it. [RT #26732] +3314. [bug] The masters list could be updated while stub_callback + or refresh_callback were using it. [RT #26732] 3313. [protocol] Add TLSA record type. [RT #28989] @@ -151,7 +517,7 @@ 3310. [test] Increase table size for mutex profiling. [RT #28809] -3309. [bug] resolver.c:fctx_finddone() was not threadsafe. +3309. [bug] resolver.c:fctx_finddone() was not thread safe. [RT #27995] 3307. [bug] Add missing ISC_LANG_BEGINDECLS and ISC_LANG_ENDDECLS. @@ -328,7 +694,7 @@ 3234. [bug] 'make depend' produced invalid makefiles. [RT #26830] -3231. [bug] named could fail to send a uncompressable zone. +3231. [bug] named could fail to send a incompressible zone. [RT #26796] 3230. [bug] 'dig axfr' failed to properly handle a multi-message @@ -345,7 +711,7 @@ 3226. [bug] Address minor resource leakages. [RT #26624] -3221. [bug] Fixed a potential coredump on shutdown due to +3221. [bug] Fixed a potential core dump on shutdown due to referencing fetch context after it's been freed. [RT #26720] @@ -369,7 +735,7 @@ 3209. [func] Add "dnssec-lookaside 'no'". [RT #24858] -3208. [bug] 'dig -y' handle unknown tsig alorithm better. +3208. [bug] 'dig -y' handle unknown tsig algorithm better. [RT #25522] 3207. [contrib] Fixed build error in Berkeley DB DLZ module. [RT #26444] @@ -672,7 +1038,7 @@ 3077. [bug] zone.c:zone_refreshkeys() incorrectly called dns_zone_attach(), use zone->irefs instead. [RT #23303] -3075. [bug] dns_dnssec_findzonekeys{2} used a inconsistant +3075. [bug] dns_dnssec_findzonekeys{2} used a inconsistent timestamp when determining which keys are active. [RT #23642] @@ -686,7 +1052,7 @@ 3072. [bug] dns_dns64_aaaaok() potential NULL pointer dereference. [RT #20256] -3071. [bug] has_nsec could be used unintialised in +3071. [bug] has_nsec could be used uninitialized in update.c:next_active. [RT #20256] 3070. [bug] dnssec-signzone potential NULL pointer dereference. @@ -732,7 +1098,7 @@ 3052. [test] Fixed last autosign test report. [RT #23256] -3051. [bug] NS records obsure DNAME records at the bottom of the +3051. [bug] NS records obscure DNAME records at the bottom of the zone if both are present. [RT #23035] 3050. [bug] The autosign system test was timing dependent. @@ -742,7 +1108,7 @@ 3049. [bug] Save and restore the gid when creating creating named.pid at startup. [RT #23290] -3048. [bug] Fully separate view key mangement. [RT #23419] +3048. [bug] Fully separate view key management. [RT #23419] 3047. [bug] DNSKEY NODATA responses not cached fixed in validator.c. Tests added to dnssec system test. @@ -1079,7 +1445,7 @@ no data response. [RT #21744] 2952. [port] win32: named-checkzone and named-checkconf failed - to initialise winsock. [RT #21932] + to initialize winsock. [RT #21932] 2951. [bug] named failed to generate a correct signed response in a optout, delegation only zone with no secure @@ -1125,7 +1491,7 @@ in use. [RT# 21868] 2938. [bug] When generating signed responses, from a signed zone - that uses NSEC3, named would use a uninitialised + that uses NSEC3, named would use a uninitialized pointer if it needed to skip a NSEC3 record because it didn't match the selected NSEC3PARAM record for zone. [RT# 21868] @@ -1179,7 +1545,7 @@ revisit the issue and complete the fix later. [RT #21710] -2930. [experimental] New "rndc addzone" and "rndc delzone" commads +2930. [experimental] New "rndc addzone" and "rndc delzone" commands allow dynamic addition and deletion of zones. To enable this feature, specify a "new-zone-file" option at the view or options level in named.conf. @@ -1355,7 +1721,7 @@ successfully responds to the query using plain DNS. [RT #20930] -2873. [bug] Cancelling a dynamic update via the dns/client module +2873. [bug] Canceling a dynamic update via the dns/client module could trigger an assertion failure. [RT #21133] 2872. [bug] Modify dns/client.c:dns_client_createx() to only @@ -1397,7 +1763,7 @@ 2860. [bug] named-checkconf's usage was out of date. [RT #21039] -2859. [bug] When cancelling validation it was possible to leak +2859. [bug] When canceling validation it was possible to leak memory. [RT #20800] 2858. [bug] RTT estimates were not being adjusted on ICMP errors. @@ -1950,7 +2316,7 @@ 2695. [func] DHCP/DDNS - update fdwatch code for use by DHCP. Modify the api to isc_sockfdwatch_t (the - callback functon for isc_socket_fdwatchcreate) + callback function for isc_socket_fdwatchcreate) to include information about the direction (read or write) and add isc_socket_fdwatchpoke. [RT #20253] @@ -2015,7 +2381,7 @@ sets the time when a key is no longer used for signing but is still published. - The "unpublished" date (-U) is deprecated in - favour of "deleted" (-D). + favor of "deleted" (-D). [RT #20247] 2676. [bug] --with-export-installdir should have been @@ -2461,7 +2827,7 @@ 2553. [bug] Reference leak on DNSSEC validation errors. [RT #19291] -2552. [bug] zero-no-soa-ttl-cache was not being honoured. +2552. [bug] zero-no-soa-ttl-cache was not being honored. [RT #19340] 2551. [bug] Potential Reference leak on return. [RT #19341] @@ -2514,7 +2880,7 @@ 2534. [func] Check NAPTR records regular expressions and replacement strings to ensure they are syntactically - valid and consistant. [RT #18168] + valid and consistent. [RT #18168] 2533. [doc] ARM: document @ (at-sign). [RT #17144] Modified: vendor/bind9/dist/COPYRIGHT ============================================================================== --- vendor/bind9/dist/COPYRIGHT Wed Jul 24 06:13:00 2013 (r253591) +++ vendor/bind9/dist/COPYRIGHT Wed Jul 24 07:12:55 2013 (r253592) @@ -1,4 +1,4 @@ -Copyright (C) 2004-2012 Internet Systems Consortium, Inc. ("ISC") +Copyright (C) 2004-2013 Internet Systems Consortium, Inc. ("ISC") Copyright (C) 1996-2003 Internet Software Consortium. Permission to use, copy, modify, and/or distribute this software for any Modified: vendor/bind9/dist/FAQ ============================================================================== --- vendor/bind9/dist/FAQ Wed Jul 24 06:13:00 2013 (r253591) +++ vendor/bind9/dist/FAQ Wed Jul 24 07:12:55 2013 (r253592) @@ -1,6 +1,6 @@ Frequently Asked Questions about BIND 9 -Copyright © 2004-2010 Internet Systems Consortium, Inc. ("ISC") +Copyright © 2004-2010, 2013 Internet Systems Consortium, Inc. ("ISC") Copyright © 2000-2003 Internet Software Consortium. @@ -869,7 +869,7 @@ A: If you run Tiger(Mac OS 10.4) or late Copy the key statement from /etc/rndc.conf into /etc/rndc.key, e.g.: key "rndc-key" { - algorithm hmac-md5; + algorithm hmac-sha256; secret "uvceheVuqf17ZwIcTydddw=="; }; Modified: vendor/bind9/dist/FAQ.xml ============================================================================== --- vendor/bind9/dist/FAQ.xml Wed Jul 24 06:13:00 2013 (r253591) +++ vendor/bind9/dist/FAQ.xml Wed Jul 24 07:12:55 2013 (r253592) @@ -1,7 +1,7 @@