From owner-svn-src-stable-8@FreeBSD.ORG Sun Nov 28 00:53:44 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E1A41065670; Sun, 28 Nov 2010 00:53:44 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 415638FC14; Sun, 28 Nov 2010 00:53:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAS0riEl027084; Sun, 28 Nov 2010 00:53:44 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAS0riii027081; Sun, 28 Nov 2010 00:53:44 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201011280053.oAS0riii027081@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Sun, 28 Nov 2010 00:53:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215961 - in stable/8/sys/mips: atheros conf X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Nov 2010 00:53:44 -0000 Author: gonzo Date: Sun Nov 28 00:53:43 2010 New Revision: 215961 URL: http://svn.freebsd.org/changeset/base/215961 Log: MFC r211509: add the PLL set functions to cpuops Modified: stable/8/sys/mips/atheros/ar71xx_cpudef.h stable/8/sys/mips/conf/AR71XX Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/mips/alchemy/ (props changed) stable/8/sys/mips/atheros/ (props changed) stable/8/sys/mips/cavium/ (props changed) stable/8/sys/mips/cavium/dev/ (props changed) stable/8/sys/mips/rmi/ (props changed) stable/8/sys/mips/rmi/dev/ (props changed) stable/8/sys/mips/sibyte/ (props changed) Modified: stable/8/sys/mips/atheros/ar71xx_cpudef.h ============================================================================== --- stable/8/sys/mips/atheros/ar71xx_cpudef.h Sun Nov 28 00:52:02 2010 (r215960) +++ stable/8/sys/mips/atheros/ar71xx_cpudef.h Sun Nov 28 00:53:43 2010 (r215961) @@ -81,6 +81,16 @@ static inline int ar71xx_device_stopped( return ar71xx_cpu_ops->ar71xx_chip_device_stopped(mask); } +static inline void ar71xx_device_set_pll_ge0(int speed) +{ + ar71xx_cpu_ops->ar71xx_chip_set_pll_ge0(speed); +} + +static inline void ar71xx_device_set_pll_ge1(int speed) +{ + ar71xx_cpu_ops->ar71xx_chip_set_pll_ge1(speed); +} + static inline void ar71xx_device_flush_ddr_ge0(void) { ar71xx_cpu_ops->ar71xx_chip_ddr_flush_ge0(); Modified: stable/8/sys/mips/conf/AR71XX ============================================================================== --- stable/8/sys/mips/conf/AR71XX Sun Nov 28 00:52:02 2010 (r215960) +++ stable/8/sys/mips/conf/AR71XX Sun Nov 28 00:53:43 2010 (r215961) @@ -62,7 +62,7 @@ device ath # Atheros pci/ca options ATH_DEBUG device ath_hal option AH_SUPPORT_AR5416 -option AH_RXCFG_SDMAMW_4BYTES # See NOTES for details of this WAR +# option AH_RXCFG_SDMAMW_4BYTES # See NOTES for details of this WAR device ath_rate_sample device mii @@ -74,12 +74,12 @@ options USB_EHCI_BIG_ENDIAN_DESC device ohci device ehci -device gpio -device gpioled +# device gpio +# device gpioled -device spibus -device ar71xx_spi -device mx25l +# device spibus +# device ar71xx_spi +# device mx25l # device geom_redboot device ar71xx_wdog From owner-svn-src-stable-8@FreeBSD.ORG Sun Nov 28 01:08:42 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DE3521065672; Sun, 28 Nov 2010 01:08:42 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B19448FC19; Sun, 28 Nov 2010 01:08:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAS18gsD028437; Sun, 28 Nov 2010 01:08:42 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAS18geT028435; Sun, 28 Nov 2010 01:08:42 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201011280108.oAS18geT028435@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Sun, 28 Nov 2010 01:08:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215965 - stable/8/sys/mips/atheros X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Nov 2010 01:08:43 -0000 Author: gonzo Date: Sun Nov 28 01:08:42 2010 New Revision: 215965 URL: http://svn.freebsd.org/changeset/base/215965 Log: init_static_kenv is available only in 9-CURRENT, replace its functionality with custom solution Modified: stable/8/sys/mips/atheros/ar71xx_machdep.c Modified: stable/8/sys/mips/atheros/ar71xx_machdep.c ============================================================================== --- stable/8/sys/mips/atheros/ar71xx_machdep.c Sun Nov 28 01:03:06 2010 (r215964) +++ stable/8/sys/mips/atheros/ar71xx_machdep.c Sun Nov 28 01:08:42 2010 (r215965) @@ -66,6 +66,26 @@ uint32_t ar711_base_mac[ETHER_ADDR_LEN]; /* 4KB static data aread to keep a copy of the bootload env until the dynamic kenv is setup */ char boot1_env[4096]; +int boot1_env_pos = 0; + +static void +static_setenv(char *n, char *v) +{ + int nlen, vlen; + + nlen = strlen(n); + vlen = strlen(v); + if (boot1_env_pos + nlen + vlen + 2 > sizeof(boot1_env)) { + printf("*** Environment could not be copied in full\n"); + return; + } + memcpy (&boot1_env[boot1_env_pos], n, nlen); + boot1_env_pos += nlen + 1; + boot1_env[boot1_env_pos-1] = '\0'; + memcpy (&boot1_env[boot1_env_pos], v, vlen); + boot1_env_pos += vlen + 1; + boot1_env[boot1_env_pos-1] = '\0'; +} /* * We get a string in from Redboot with the all the arguments together, @@ -93,9 +113,8 @@ parse_argv(char *str) } else { n = strsep(&v, "="); if (v == NULL) - setenv(n, "1"); - else - setenv(n, v); + v = "1"; + static_setenv(n, v); } } } @@ -200,7 +219,6 @@ platform_start(__register_t a0 __unused, platform_counter_freq = ar71xx_cpu_freq(); mips_timer_init_params(platform_counter_freq, 1); cninit(); - init_static_kenv(boot1_env, sizeof(boot1_env)); printf("CPU platform: %s\n", ar71xx_get_system_type()); printf("CPU Frequency=%d MHz\n", u_ar71xx_cpu_freq / 1000000); @@ -229,11 +247,12 @@ platform_start(__register_t a0 __unused, if (MIPS_IS_VALID_PTR(envp)) { for (i = 0; envp[i]; i+=2) { printf(" %s = %s\n", envp[i], envp[i+1]); - setenv(envp[i], envp[i+1]); + static_setenv(envp[i], envp[i+1]); } } else printf ("envp is invalid\n"); + kern_envp = boot1_env; /* * "ethaddr" is passed via envp on RedBoot platforms From owner-svn-src-stable-8@FreeBSD.ORG Sun Nov 28 01:18:12 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 33C31106566C; Sun, 28 Nov 2010 01:18:12 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 21B308FC12; Sun, 28 Nov 2010 01:18:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAS1ICR2029505; Sun, 28 Nov 2010 01:18:12 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAS1ICEb029503; Sun, 28 Nov 2010 01:18:12 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201011280118.oAS1ICEb029503@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Sun, 28 Nov 2010 01:18:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215967 - stable/8/sys/mips/conf X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Nov 2010 01:18:12 -0000 Author: gonzo Date: Sun Nov 28 01:18:11 2010 New Revision: 215967 URL: http://svn.freebsd.org/changeset/base/215967 Log: Remove options that are not available in 8 Modified: stable/8/sys/mips/conf/AR71XX Modified: stable/8/sys/mips/conf/AR71XX ============================================================================== --- stable/8/sys/mips/conf/AR71XX Sun Nov 28 01:16:37 2010 (r215966) +++ stable/8/sys/mips/conf/AR71XX Sun Nov 28 01:18:11 2010 (r215967) @@ -62,7 +62,6 @@ device ath # Atheros pci/ca options ATH_DEBUG device ath_hal option AH_SUPPORT_AR5416 -# option AH_RXCFG_SDMAMW_4BYTES # See NOTES for details of this WAR device ath_rate_sample device mii @@ -74,13 +73,8 @@ options USB_EHCI_BIG_ENDIAN_DESC device ohci device ehci -# device gpio -# device gpioled - -# device spibus -# device ar71xx_spi -# device mx25l -# device geom_redboot +device spibus +device ar71xx_spi device ar71xx_wdog From owner-svn-src-stable-8@FreeBSD.ORG Sun Nov 28 03:41:32 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DAFD7106564A; Sun, 28 Nov 2010 03:41:32 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 901A28FC0A; Sun, 28 Nov 2010 03:41:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAS3fWHe044848; Sun, 28 Nov 2010 03:41:32 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAS3fWEJ044844; Sun, 28 Nov 2010 03:41:32 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201011280341.oAS3fWEJ044844@svn.freebsd.org> From: Jack F Vogel Date: Sun, 28 Nov 2010 03:41:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215970 - in stable/8/sys: conf dev/ixgbe modules/ixgbe X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Nov 2010 03:41:33 -0000 Author: jfv Date: Sun Nov 28 03:41:32 2010 New Revision: 215970 URL: http://svn.freebsd.org/changeset/base/215970 Log: MFC: r215911, r215913, r215914 Added: stable/8/sys/dev/ixgbe/ixgbe_mbx.c (contents, props changed) stable/8/sys/dev/ixgbe/ixgbe_mbx.h (contents, props changed) stable/8/sys/dev/ixgbe/ixgbe_vf.c (contents, props changed) stable/8/sys/dev/ixgbe/ixgbe_vf.h (contents, props changed) stable/8/sys/dev/ixgbe/ixv.c (contents, props changed) stable/8/sys/dev/ixgbe/ixv.h (contents, props changed) Modified: stable/8/sys/conf/files stable/8/sys/dev/ixgbe/ixgbe.c stable/8/sys/dev/ixgbe/ixgbe.h stable/8/sys/dev/ixgbe/ixgbe_82598.c stable/8/sys/dev/ixgbe/ixgbe_82599.c stable/8/sys/dev/ixgbe/ixgbe_api.c stable/8/sys/dev/ixgbe/ixgbe_api.h stable/8/sys/dev/ixgbe/ixgbe_common.c stable/8/sys/dev/ixgbe/ixgbe_common.h stable/8/sys/dev/ixgbe/ixgbe_osdep.h stable/8/sys/dev/ixgbe/ixgbe_phy.c stable/8/sys/dev/ixgbe/ixgbe_phy.h stable/8/sys/dev/ixgbe/ixgbe_type.h stable/8/sys/modules/ixgbe/Makefile Modified: stable/8/sys/conf/files ============================================================================== --- stable/8/sys/conf/files Sun Nov 28 01:56:44 2010 (r215969) +++ stable/8/sys/conf/files Sun Nov 28 03:41:32 2010 (r215970) @@ -1210,12 +1210,18 @@ dev/ixgb/ixgb_ee.c optional ixgb dev/ixgb/ixgb_hw.c optional ixgb dev/ixgbe/ixgbe.c optional ixgbe inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" +dev/ixgbe/ixv.c optional ixgbe inet \ + compile-with "${NORMAL_C} -I$S/dev/ixgbe" dev/ixgbe/ixgbe_phy.c optional ixgbe inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" dev/ixgbe/ixgbe_api.c optional ixgbe inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" dev/ixgbe/ixgbe_common.c optional ixgbe inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" +dev/ixgbe/ixgbe_mbx.c optional ixgbe inet \ + compile-with "${NORMAL_C} -I$S/dev/ixgbe" +dev/ixgbe/ixgbe_vf.c optional ixgbe inet \ + compile-with "${NORMAL_C} -I$S/dev/ixgbe" dev/ixgbe/ixgbe_82598.c optional ixgbe inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" dev/ixgbe/ixgbe_82599.c optional ixgbe inet \ Modified: stable/8/sys/dev/ixgbe/ixgbe.c ============================================================================== --- stable/8/sys/dev/ixgbe/ixgbe.c Sun Nov 28 01:56:44 2010 (r215969) +++ stable/8/sys/dev/ixgbe/ixgbe.c Sun Nov 28 03:41:32 2010 (r215970) @@ -46,7 +46,7 @@ int ixgbe_display_debug_stat /********************************************************************* * Driver version *********************************************************************/ -char ixgbe_driver_version[] = "2.2.1"; +char ixgbe_driver_version[] = "2.3.6"; /********************************************************************* * PCI Device ID Table @@ -78,6 +78,8 @@ static ixgbe_vendor_info_t ixgbe_vendor_ {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_CX4, 0, 0, 0}, {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_T3_LOM, 0, 0, 0}, {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_COMBO_BACKPLANE, 0, 0, 0}, + {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_BACKPLANE_FCOE, 0, 0, 0}, + {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_SFP_FCOE, 0, 0, 0}, /* required last entry */ {0, 0, 0, 0, 0} }; @@ -118,9 +120,9 @@ static int ixgbe_allocate_legacy(st static int ixgbe_allocate_queues(struct adapter *); static int ixgbe_setup_msix(struct adapter *); static void ixgbe_free_pci_resources(struct adapter *); -static void ixgbe_local_timer(void *); -static int ixgbe_setup_interface(device_t, struct adapter *); -static void ixgbe_config_link(struct adapter *); +static void ixgbe_local_timer(void *); +static int ixgbe_setup_interface(device_t, struct adapter *); +static void ixgbe_config_link(struct adapter *); static int ixgbe_allocate_transmit_buffers(struct tx_ring *); static int ixgbe_setup_transmit_structures(struct adapter *); @@ -144,16 +146,12 @@ static bool ixgbe_txeof(struct tx_ring * static bool ixgbe_rxeof(struct ix_queue *, int); static void ixgbe_rx_checksum(u32, struct mbuf *, u32); static void ixgbe_set_promisc(struct adapter *); -static void ixgbe_disable_promisc(struct adapter *); static void ixgbe_set_multi(struct adapter *); -static void ixgbe_print_hw_stats(struct adapter *); -static void ixgbe_print_debug_info(struct adapter *); static void ixgbe_update_link_status(struct adapter *); static void ixgbe_refresh_mbufs(struct rx_ring *, int); static int ixgbe_xmit(struct tx_ring *, struct mbuf **); -static int ixgbe_sysctl_stats(SYSCTL_HANDLER_ARGS); -static int ixgbe_sysctl_debug(SYSCTL_HANDLER_ARGS); static int ixgbe_set_flowcntl(SYSCTL_HANDLER_ARGS); +static int ixgbe_set_advertise(SYSCTL_HANDLER_ARGS); static int ixgbe_dma_malloc(struct adapter *, bus_size_t, struct ixgbe_dma_alloc *, int); static void ixgbe_dma_free(struct adapter *, struct ixgbe_dma_alloc *); @@ -169,6 +167,8 @@ static void ixgbe_setup_vlan_hw_support( static void ixgbe_register_vlan(void *, struct ifnet *, u16); static void ixgbe_unregister_vlan(void *, struct ifnet *, u16); +static void ixgbe_add_hw_stats(struct adapter *adapter); + static __inline void ixgbe_rx_discard(struct rx_ring *, int); static __inline void ixgbe_rx_input(struct rx_ring *, struct ifnet *, struct mbuf *, u32); @@ -211,7 +211,7 @@ static driver_t ixgbe_driver = { "ix", ixgbe_methods, sizeof(struct adapter), }; -static devclass_t ixgbe_devclass; +devclass_t ixgbe_devclass; DRIVER_MODULE(ixgbe, pci, ixgbe_driver, ixgbe_devclass, 0, 0); MODULE_DEPEND(ixgbe, pci, 1, 1, 1); @@ -230,6 +230,9 @@ MODULE_DEPEND(ixgbe, ether, 1, 1, 1); static int ixgbe_enable_aim = TRUE; TUNABLE_INT("hw.ixgbe.enable_aim", &ixgbe_enable_aim); +static int ixgbe_max_interrupt_rate = (8000000 / IXGBE_LOW_LATENCY); +TUNABLE_INT("hw.ixgbe.max_interrupt_rate", &ixgbe_max_interrupt_rate); + /* How many packets rxeof tries to clean at a time */ static int ixgbe_rx_process_limit = 128; TUNABLE_INT("hw.ixgbe.rx_process_limit", &ixgbe_rx_process_limit); @@ -288,13 +291,6 @@ TUNABLE_INT("hw.ixgbe.rxd", &ixgbe_rxd); static int ixgbe_total_ports; /* -** Shadow VFTA table, this is needed because -** the real filter table gets cleared during -** a soft reset and we need to repopulate it. -*/ -static u32 ixgbe_shadow_vfta[IXGBE_VFTA_SIZE]; - -/* ** The number of scatter-gather segments ** differs for 82598 and 82599, default to ** the former. @@ -445,24 +441,21 @@ ixgbe_attach(device_t dev) ixgbe_num_segs = IXGBE_82599_SCATTER; adapter->optics = IFM_10G_T; default: + ixgbe_num_segs = IXGBE_82599_SCATTER; break; } /* SYSCTL APIs */ - SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "stats", CTLTYPE_INT | CTLFLAG_RW, - adapter, 0, ixgbe_sysctl_stats, "I", "Statistics"); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "debug", CTLTYPE_INT | CTLFLAG_RW, - adapter, 0, ixgbe_sysctl_debug, "I", "Debug Info"); + OID_AUTO, "flow_control", CTLTYPE_INT | CTLFLAG_RW, + adapter, 0, ixgbe_set_flowcntl, "I", "Flow Control"); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "flow_control", CTLTYPE_INT | CTLFLAG_RW, - adapter, 0, ixgbe_set_flowcntl, "I", "Flow Control"); + OID_AUTO, "advertise_gig", CTLTYPE_INT | CTLFLAG_RW, + adapter, 0, ixgbe_set_advertise, "I", "1G Link"); SYSCTL_ADD_INT(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), @@ -630,6 +623,8 @@ ixgbe_attach(device_t dev) ctrl_ext |= IXGBE_CTRL_EXT_DRV_LOAD; IXGBE_WRITE_REG(hw, IXGBE_CTRL_EXT, ctrl_ext); + ixgbe_add_hw_stats(adapter); + INIT_DEBUGOUT("ixgbe_attach: end"); return (0); err_late: @@ -774,8 +769,8 @@ ixgbe_start_locked(struct tx_ring *txr, ETHER_BPF_MTAP(ifp, m_head); /* Set watchdog on */ - txr->watchdog_check = TRUE; txr->watchdog_time = ticks; + txr->queue_status = IXGBE_QUEUE_WORKING; } return; @@ -845,6 +840,10 @@ ixgbe_mq_start_locked(struct ifnet *ifp, return (err); } + /* Call cleanup if number of TX descriptors low */ + if (txr->tx_avail <= IXGBE_TX_CLEANUP_THRESHOLD) + ixgbe_txeof(txr); + enqueued = 0; if (m == NULL) { next = drbr_dequeue(ifp, txr->br); @@ -877,7 +876,7 @@ ixgbe_mq_start_locked(struct ifnet *ifp, if (enqueued > 0) { /* Set watchdog on */ - txr->watchdog_check = TRUE; + txr->queue_status = IXGBE_QUEUE_WORKING; txr->watchdog_time = ticks; } @@ -942,7 +941,6 @@ ixgbe_ioctl(struct ifnet * ifp, u_long c if ((ifp->if_drv_flags & IFF_DRV_RUNNING)) { if ((ifp->if_flags ^ adapter->if_flags) & (IFF_PROMISC | IFF_ALLMULTI)) { - ixgbe_disable_promisc(adapter); ixgbe_set_promisc(adapter); } } else @@ -981,6 +979,8 @@ ixgbe_ioctl(struct ifnet * ifp, u_long c ifp->if_capenable ^= IFCAP_LRO; if (mask & IFCAP_VLAN_HWTAGGING) ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING; + if (mask & IFCAP_VLAN_HWFILTER) + ifp->if_capenable ^= IFCAP_VLAN_HWFILTER; if (ifp->if_drv_flags & IFF_DRV_RUNNING) { IXGBE_CORE_LOCK(adapter); ixgbe_init_locked(adapter); @@ -1035,6 +1035,18 @@ ixgbe_init_locked(struct adapter *adapte ixgbe_set_rar(hw, 0, hw->mac.addr, 0, 1); hw->addr_ctrl.rar_used_count = 1; + /* Set the various hardware offload abilities */ + ifp->if_hwassist = 0; + if (ifp->if_capenable & IFCAP_TSO4) + ifp->if_hwassist |= CSUM_TSO; + if (ifp->if_capenable & IFCAP_TXCSUM) { + ifp->if_hwassist |= (CSUM_TCP | CSUM_UDP); +#if __FreeBSD_version >= 800000 + if (hw->mac.type == ixgbe_mac_82599EB) + ifp->if_hwassist |= CSUM_SCTP; +#endif + } + /* Prepare transmit descriptors and buffers */ if (ixgbe_setup_transmit_structures(adapter)) { device_printf(dev,"Could not setup transmit structures\n"); @@ -1052,10 +1064,12 @@ ixgbe_init_locked(struct adapter *adapte ** Determine the correct mbuf pool ** for doing jumbo/headersplit */ - if (ifp->if_mtu > ETHERMTU) + if (adapter->max_frame_size <= 2048) + adapter->rx_mbuf_sz = MCLBYTES; + else if (adapter->max_frame_size <= 4096) adapter->rx_mbuf_sz = MJUMPAGESIZE; else - adapter->rx_mbuf_sz = MCLBYTES; + adapter->rx_mbuf_sz = MJUM9BYTES; /* Prepare receive descriptors and buffers */ if (ixgbe_setup_receive_structures(adapter)) { @@ -1086,18 +1100,6 @@ ixgbe_init_locked(struct adapter *adapte } IXGBE_WRITE_REG(hw, IXGBE_GPIE, gpie); - /* Set the various hardware offload abilities */ - ifp->if_hwassist = 0; - if (ifp->if_capenable & IFCAP_TSO4) - ifp->if_hwassist |= CSUM_TSO; - if (ifp->if_capenable & IFCAP_TXCSUM) { - ifp->if_hwassist |= (CSUM_TCP | CSUM_UDP); -#if __FreeBSD_version >= 800000 - if (hw->mac.type == ixgbe_mac_82599EB) - ifp->if_hwassist |= CSUM_SCTP; -#endif - } - /* Set MTU size */ if (ifp->if_mtu > ETHERMTU) { mhadd = IXGBE_READ_REG(hw, IXGBE_MHADD); @@ -1140,7 +1142,7 @@ ixgbe_init_locked(struct adapter *adapte IXGBE_WRITE_REG(hw, IXGBE_RDT(i), adapter->num_rx_desc - 1); } - /* Set up VLAN offloads and filter */ + /* Set up VLAN support and filter */ ixgbe_setup_vlan_hw_support(adapter); /* Enable Receive engine */ @@ -1754,10 +1756,6 @@ ixgbe_xmit(struct tx_ring *txr, struct m ++txr->total_packets; IXGBE_WRITE_REG(&adapter->hw, IXGBE_TDT(txr->me), i); - /* Do a clean if descriptors are low */ - if (txr->tx_avail <= IXGBE_TX_CLEANUP_THRESHOLD) - ixgbe_txeof(txr); - return (0); xmit_fail: @@ -1769,11 +1767,13 @@ xmit_fail: static void ixgbe_set_promisc(struct adapter *adapter) { - u_int32_t reg_rctl; struct ifnet *ifp = adapter->ifp; reg_rctl = IXGBE_READ_REG(&adapter->hw, IXGBE_FCTRL); + reg_rctl &= (~IXGBE_FCTRL_UPE); + reg_rctl &= (~IXGBE_FCTRL_MPE); + IXGBE_WRITE_REG(&adapter->hw, IXGBE_FCTRL, reg_rctl); if (ifp->if_flags & IFF_PROMISC) { reg_rctl |= (IXGBE_FCTRL_UPE | IXGBE_FCTRL_MPE); @@ -1786,20 +1786,6 @@ ixgbe_set_promisc(struct adapter *adapte return; } -static void -ixgbe_disable_promisc(struct adapter * adapter) -{ - u_int32_t reg_rctl; - - reg_rctl = IXGBE_READ_REG(&adapter->hw, IXGBE_FCTRL); - - reg_rctl &= (~IXGBE_FCTRL_UPE); - reg_rctl &= (~IXGBE_FCTRL_MPE); - IXGBE_WRITE_REG(&adapter->hw, IXGBE_FCTRL, reg_rctl); - - return; -} - /********************************************************************* * Multicast Update @@ -1893,7 +1879,6 @@ static void ixgbe_local_timer(void *arg) { struct adapter *adapter = arg; - struct ifnet *ifp = adapter->ifp; device_t dev = adapter->dev; struct tx_ring *txr = adapter->tx_rings; @@ -1907,31 +1892,22 @@ ixgbe_local_timer(void *arg) ixgbe_update_link_status(adapter); ixgbe_update_stats_counters(adapter); - /* Debug display */ - if (ixgbe_display_debug_stats && ifp->if_drv_flags & IFF_DRV_RUNNING) - ixgbe_print_hw_stats(adapter); - /* * If the interface has been paused * then don't do the watchdog check */ if (IXGBE_READ_REG(&adapter->hw, IXGBE_TFCS) & IXGBE_TFCS_TXOFF) goto out; + /* - ** Check for time since any descriptor was cleaned + ** Check status on the TX queues for a hang */ - for (int i = 0; i < adapter->num_queues; i++, txr++) { - IXGBE_TX_LOCK(txr); - if (txr->watchdog_check == FALSE) { - IXGBE_TX_UNLOCK(txr); - continue; - } - if ((ticks - txr->watchdog_time) > IXGBE_WATCHDOG) + for (int i = 0; i < adapter->num_queues; i++, txr++) + if (txr->queue_status == IXGBE_QUEUE_HUNG) goto hung; - IXGBE_TX_UNLOCK(txr); - } + out: - ixgbe_rearm_queues(adapter, adapter->que_mask); + ixgbe_rearm_queues(adapter, adapter->que_mask); callout_reset(&adapter->timer, hz, ixgbe_local_timer, adapter); return; @@ -1979,7 +1955,7 @@ ixgbe_update_link_status(struct adapter adapter->link_active = FALSE; for (int i = 0; i < adapter->num_queues; i++, txr++) - txr->watchdog_check = FALSE; + txr->queue_status = IXGBE_QUEUE_IDLE; } } @@ -1999,6 +1975,7 @@ ixgbe_stop(void *arg) { struct ifnet *ifp; struct adapter *adapter = arg; + struct ixgbe_hw *hw = &adapter->hw; ifp = adapter->ifp; mtx_assert(&adapter->core_mtx, MA_OWNED); @@ -2009,9 +1986,12 @@ ixgbe_stop(void *arg) /* Tell the stack that the interface is no longer active */ ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); - ixgbe_reset_hw(&adapter->hw); - adapter->hw.adapter_stopped = FALSE; - ixgbe_stop_adapter(&adapter->hw); + ixgbe_reset_hw(hw); + hw->adapter_stopped = FALSE; + ixgbe_stop_adapter(hw); + /* Turn off the laser */ + if (hw->phy.multispeed_fiber) + ixgbe_disable_tx_laser(hw); callout_stop(&adapter->timer); /* reprogram the RAR[0] in case user changed it. */ @@ -2236,6 +2216,9 @@ ixgbe_setup_msix(struct adapter *adapter if (ixgbe_num_queues != 0) queues = ixgbe_num_queues; + /* Set max queues to 8 */ + else if (queues > 8) + queues = 8; /* ** Want one vector (RX/TX pair) per queue @@ -2408,10 +2391,22 @@ ixgbe_setup_interface(device_t dev, stru ifp->if_capabilities |= IFCAP_HWCSUM | IFCAP_TSO4 | IFCAP_VLAN_HWCSUM; ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU; - ifp->if_capabilities |= IFCAP_JUMBO_MTU | IFCAP_LRO; - + ifp->if_capabilities |= IFCAP_JUMBO_MTU; ifp->if_capenable = ifp->if_capabilities; + /* Don't enable LRO by default */ + ifp->if_capabilities |= IFCAP_LRO; + + /* + ** Dont turn this on by default, if vlans are + ** created on another pseudo device (eg. lagg) + ** then vlan events are not passed thru, breaking + ** operation, but with HW FILTER off it works. If + ** using vlans directly on the em driver you can + ** enable this and get full hardware tag filtering. + */ + ifp->if_capabilities |= IFCAP_VLAN_HWFILTER; + /* * Specify the media types supported by this adapter and register * callbacks to update media and link information @@ -2444,6 +2439,7 @@ ixgbe_config_link(struct adapter *adapte if (sfp) { if (hw->phy.multispeed_fiber) { hw->mac.ops.setup_sfp(hw); + ixgbe_enable_tx_laser(hw); taskqueue_enqueue(adapter->tq, &adapter->msf_task); } else taskqueue_enqueue(adapter->tq, &adapter->mod_task); @@ -2850,7 +2846,7 @@ ixgbe_initialize_transmit_units(struct a /* Setup Transmit Descriptor Cmd Settings */ txr->txd_cmd = IXGBE_TXD_CMD_IFCS; - txr->watchdog_check = FALSE; + txr->queue_status = IXGBE_QUEUE_IDLE; /* Disable Head Writeback */ switch (hw->mac.type) { @@ -3189,7 +3185,7 @@ ixgbe_atr(struct tx_ring *txr, struct mb { struct adapter *adapter = txr->adapter; struct ix_queue *que; - struct ixgbe_atr_input atr_input; + union ixgbe_atr_input atr_input; struct ip *ip; struct tcphdr *th; struct udphdr *uh; @@ -3233,7 +3229,7 @@ ixgbe_atr(struct tx_ring *txr, struct mb return; } - memset(&atr_input, 0, sizeof(struct ixgbe_atr_input)); + memset(&atr_input, 0, sizeof(union ixgbe_atr_input)); vlan_id = htole16(mp->m_pkthdr.ether_vtag); src_ipv4_addr = ip->ip_src.s_addr; @@ -3268,15 +3264,18 @@ ixgbe_txeof(struct tx_ring *txr) { struct adapter *adapter = txr->adapter; struct ifnet *ifp = adapter->ifp; - u32 first, last, done; + u32 first, last, done, processed; struct ixgbe_tx_buf *tx_buffer; struct ixgbe_legacy_tx_desc *tx_desc, *eop_desc; mtx_assert(&txr->tx_mtx, MA_OWNED); - if (txr->tx_avail == adapter->num_tx_desc) + if (txr->tx_avail == adapter->num_tx_desc) { + txr->queue_status = IXGBE_QUEUE_IDLE; return FALSE; + } + processed = 0; first = txr->next_to_clean; tx_buffer = &txr->tx_buffers[first]; /* For cleanup we just use legacy struct */ @@ -3308,6 +3307,7 @@ ixgbe_txeof(struct tx_ring *txr) tx_desc->lower.data = 0; tx_desc->buffer_addr = 0; ++txr->tx_avail; + ++processed; if (tx_buffer->m_head) { txr->bytes += @@ -3350,6 +3350,15 @@ ixgbe_txeof(struct tx_ring *txr) txr->next_to_clean = first; /* + ** Watchdog calculation, we know there's + ** work outstanding or the first return + ** would have been taken, so none processed + ** for too long indicates a hang. + */ + if ((!processed) && ((ticks - txr->watchdog_time) > IXGBE_WATCHDOG)) + txr->queue_status = IXGBE_QUEUE_HUNG; + + /* * If we have enough room, clear IFF_DRV_OACTIVE to tell the stack that * it is OK to send packets. If there are no pending descriptors, * clear the timeout. Otherwise, if some descriptors have been freed, @@ -3358,7 +3367,7 @@ ixgbe_txeof(struct tx_ring *txr) if (txr->tx_avail > IXGBE_TX_CLEANUP_THRESHOLD) { ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; if (txr->tx_avail == adapter->num_tx_desc) { - txr->watchdog_check = FALSE; + txr->queue_status = IXGBE_QUEUE_IDLE; return FALSE; } } @@ -3389,51 +3398,59 @@ ixgbe_refresh_mbufs(struct rx_ring *rxr, cleaned = -1; /* Signify no completions */ while (i != limit) { rxbuf = &rxr->rx_buffers[i]; - if ((rxbuf->m_head == NULL) && (rxr->hdr_split)) { + if (rxr->hdr_split == FALSE) + goto no_split; + + if (rxbuf->m_head == NULL) { mh = m_gethdr(M_DONTWAIT, MT_DATA); if (mh == NULL) goto update; - mh->m_pkthdr.len = mh->m_len = MHLEN; - mh->m_len = MHLEN; - mh->m_flags |= M_PKTHDR; - m_adj(mh, ETHER_ALIGN); - /* Get the memory mapping */ - error = bus_dmamap_load_mbuf_sg(rxr->htag, - rxbuf->hmap, mh, hseg, &nsegs, BUS_DMA_NOWAIT); - if (error != 0) { - printf("GET BUF: dmamap load" - " failure - %d\n", error); - m_free(mh); - goto update; - } - rxbuf->m_head = mh; - bus_dmamap_sync(rxr->htag, rxbuf->hmap, - BUS_DMASYNC_PREREAD); - rxr->rx_base[i].read.hdr_addr = - htole64(hseg[0].ds_addr); + } else + mh = rxbuf->m_head; + + mh->m_pkthdr.len = mh->m_len = MHLEN; + mh->m_len = MHLEN; + mh->m_flags |= M_PKTHDR; + /* Get the memory mapping */ + error = bus_dmamap_load_mbuf_sg(rxr->htag, + rxbuf->hmap, mh, hseg, &nsegs, BUS_DMA_NOWAIT); + if (error != 0) { + printf("Refresh mbufs: hdr dmamap load" + " failure - %d\n", error); + m_free(mh); + rxbuf->m_head = NULL; + goto update; } + rxbuf->m_head = mh; + bus_dmamap_sync(rxr->htag, rxbuf->hmap, + BUS_DMASYNC_PREREAD); + rxr->rx_base[i].read.hdr_addr = htole64(hseg[0].ds_addr); +no_split: if (rxbuf->m_pack == NULL) { mp = m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, adapter->rx_mbuf_sz); if (mp == NULL) goto update; - mp->m_pkthdr.len = mp->m_len = adapter->rx_mbuf_sz; - /* Get the memory mapping */ - error = bus_dmamap_load_mbuf_sg(rxr->ptag, - rxbuf->pmap, mp, pseg, &nsegs, BUS_DMA_NOWAIT); - if (error != 0) { - printf("GET BUF: dmamap load" - " failure - %d\n", error); - m_free(mp); - goto update; - } - rxbuf->m_pack = mp; - bus_dmamap_sync(rxr->ptag, rxbuf->pmap, - BUS_DMASYNC_PREREAD); - rxr->rx_base[i].read.pkt_addr = - htole64(pseg[0].ds_addr); + } else + mp = rxbuf->m_pack; + + mp->m_pkthdr.len = mp->m_len = adapter->rx_mbuf_sz; + /* Get the memory mapping */ + error = bus_dmamap_load_mbuf_sg(rxr->ptag, + rxbuf->pmap, mp, pseg, &nsegs, BUS_DMA_NOWAIT); + if (error != 0) { + printf("Refresh mbufs: payload dmamap load" + " failure - %d\n", error); + m_free(mp); + rxbuf->m_pack = NULL; + goto update; } + rxbuf->m_pack = mp; + bus_dmamap_sync(rxr->ptag, rxbuf->pmap, + BUS_DMASYNC_PREREAD); + rxr->rx_base[i].read.pkt_addr = + htole64(pseg[0].ds_addr); cleaned = i; /* Calculate next index */ @@ -3495,9 +3512,9 @@ ixgbe_allocate_receive_buffers(struct rx BUS_SPACE_MAXADDR, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ - MJUMPAGESIZE, /* maxsize */ + MJUM9BYTES, /* maxsize */ 1, /* nsegments */ - MJUMPAGESIZE, /* maxsegsize */ + MJUM9BYTES, /* maxsegsize */ 0, /* flags */ NULL, /* lockfunc */ NULL, /* lockfuncarg */ @@ -4021,25 +4038,33 @@ ixgbe_rx_input(struct rx_ring *rxr, stru static __inline void ixgbe_rx_discard(struct rx_ring *rxr, int i) { - struct adapter *adapter = rxr->adapter; struct ixgbe_rx_buf *rbuf; - struct mbuf *mh, *mp; rbuf = &rxr->rx_buffers[i]; - if (rbuf->fmp != NULL) /* Partial chain ? */ + + if (rbuf->fmp != NULL) {/* Partial chain ? */ + rbuf->fmp->m_flags |= M_PKTHDR; m_freem(rbuf->fmp); + rbuf->fmp = NULL; + } - mh = rbuf->m_head; - mp = rbuf->m_pack; + /* + ** With advanced descriptors the writeback + ** clobbers the buffer addrs, so its easier + ** to just free the existing mbufs and take + ** the normal refresh path to get new buffers + ** and mapping. + */ + if (rbuf->m_head) { + m_free(rbuf->m_head); + rbuf->m_head = NULL; + } + + if (rbuf->m_pack) { + m_free(rbuf->m_pack); + rbuf->m_pack = NULL; + } - /* Reuse loaded DMA map and just update mbuf chain */ - mh->m_len = MHLEN; - mh->m_flags |= M_PKTHDR; - mh->m_next = NULL; - - mp->m_len = mp->m_pkthdr.len = adapter->rx_mbuf_sz; - mp->m_data = mp->m_ext.ext_buf; - mp->m_next = NULL; return; } @@ -4104,15 +4129,15 @@ ixgbe_rxeof(struct ix_queue *que, int co vtag = le16toh(cur->wb.upper.vlan); eop = ((staterr & IXGBE_RXD_STAT_EOP) != 0); - /* Make sure all parts of a bad packet are discarded */ + /* Make sure bad packets are discarded */ if (((staterr & IXGBE_RXDADV_ERR_FRAME_ERR_MASK) != 0) || (rxr->discard)) { ifp->if_ierrors++; rxr->rx_discarded++; - if (!eop) - rxr->discard = TRUE; - else + if (eop) rxr->discard = FALSE; + else + rxr->discard = TRUE; ixgbe_rx_discard(rxr, i); goto next_desc; } @@ -4123,7 +4148,7 @@ ixgbe_rxeof(struct ix_queue *que, int co ** not be fragmented across sequential ** descriptors, rather the next descriptor ** is indicated in bits of the descriptor. - ** This also means that we might process + ** This also means that we might proceses ** more than one packet at a time, something ** that has never been true before, it ** required eliminating global chain pointers @@ -4204,7 +4229,8 @@ ixgbe_rxeof(struct ix_queue *que, int co } else { /* Singlet, prepare to send */ sendmp = mh; - if (staterr & IXGBE_RXD_STAT_VP) { + if ((adapter->num_vlans) && + (staterr & IXGBE_RXD_STAT_VP)) { sendmp->m_pkthdr.ether_vtag = vtag; sendmp->m_flags |= M_VLANTAG; } @@ -4370,12 +4396,13 @@ ixgbe_register_vlan(void *arg, struct if if ((vtag == 0) || (vtag > 4095)) /* Invalid */ return; + IXGBE_CORE_LOCK(adapter); index = (vtag >> 5) & 0x7F; bit = vtag & 0x1F; - ixgbe_shadow_vfta[index] |= (1 << bit); + adapter->shadow_vfta[index] |= (1 << bit); ++adapter->num_vlans; - /* Re-init to load the changes */ - ixgbe_init(adapter); + ixgbe_init_locked(adapter); + IXGBE_CORE_UNLOCK(adapter); } /* @@ -4395,17 +4422,20 @@ ixgbe_unregister_vlan(void *arg, struct if ((vtag == 0) || (vtag > 4095)) /* Invalid */ return; + IXGBE_CORE_LOCK(adapter); index = (vtag >> 5) & 0x7F; bit = vtag & 0x1F; - ixgbe_shadow_vfta[index] &= ~(1 << bit); + adapter->shadow_vfta[index] &= ~(1 << bit); --adapter->num_vlans; /* Re-init to load the changes */ - ixgbe_init(adapter); + ixgbe_init_locked(adapter); + IXGBE_CORE_UNLOCK(adapter); } static void ixgbe_setup_vlan_hw_support(struct adapter *adapter) { + struct ifnet *ifp = adapter->ifp; struct ixgbe_hw *hw = &adapter->hw; u32 ctrl; @@ -4424,14 +4454,16 @@ ixgbe_setup_vlan_hw_support(struct adapt ** we need to repopulate it now. */ for (int i = 0; i < IXGBE_VFTA_SIZE; i++) - if (ixgbe_shadow_vfta[i] != 0) + if (adapter->shadow_vfta[i] != 0) IXGBE_WRITE_REG(hw, IXGBE_VFTA(i), - ixgbe_shadow_vfta[i]); + adapter->shadow_vfta[i]); - /* Enable the Filter Table */ ctrl = IXGBE_READ_REG(hw, IXGBE_VLNCTRL); - ctrl &= ~IXGBE_VLNCTRL_CFIEN; - ctrl |= IXGBE_VLNCTRL_VFE; + /* Enable the Filter Table if enabled */ + if (ifp->if_capenable & IFCAP_VLAN_HWFILTER) { + ctrl &= ~IXGBE_VLNCTRL_CFIEN; + ctrl |= IXGBE_VLNCTRL_VFE; + } if (hw->mac.type == ixgbe_mac_82598EB) ctrl |= IXGBE_VLNCTRL_VME; IXGBE_WRITE_REG(hw, IXGBE_VLNCTRL, ctrl); @@ -4580,6 +4612,12 @@ static void ixgbe_configure_ivars(struct adapter *adapter) { struct ix_queue *que = adapter->queues; + u32 newitr; + + if (ixgbe_max_interrupt_rate > 0) + newitr = (8000000 / ixgbe_max_interrupt_rate) & 0x0FF8; + else + newitr = 0; for (int i = 0; i < adapter->num_queues; i++, que++) { /* First the RX queue entry */ @@ -4588,7 +4626,7 @@ ixgbe_configure_ivars(struct adapter *ad ixgbe_set_ivar(adapter, i, que->msix, 1); /* Set an Initial EITR value */ IXGBE_WRITE_REG(&adapter->hw, - IXGBE_EITR(que->msix), IXGBE_LOW_LATENCY); + IXGBE_EITR(que->msix), newitr); } /* For the Link interrupt */ @@ -4725,6 +4763,9 @@ ixgbe_update_stats_counters(struct adapt u64 total_missed_rx = 0; adapter->stats.crcerrs += IXGBE_READ_REG(hw, IXGBE_CRCERRS); + adapter->stats.illerrc += IXGBE_READ_REG(hw, IXGBE_ILLERRC); + adapter->stats.errbc += IXGBE_READ_REG(hw, IXGBE_ERRBC); + adapter->stats.mspdc += IXGBE_READ_REG(hw, IXGBE_MSPDC); for (int i = 0; i < 8; i++) { u32 mp; @@ -4736,20 +4777,45 @@ ixgbe_update_stats_counters(struct adapt /* Running comprehensive total for stats display */ total_missed_rx += adapter->stats.mpc[i]; if (hw->mac.type == ixgbe_mac_82598EB) - adapter->stats.rnbc[i] += IXGBE_READ_REG(hw, IXGBE_RNBC(i)); + adapter->stats.rnbc[i] += + IXGBE_READ_REG(hw, IXGBE_RNBC(i)); + adapter->stats.pxontxc[i] += + IXGBE_READ_REG(hw, IXGBE_PXONTXC(i)); + adapter->stats.pxonrxc[i] += + IXGBE_READ_REG(hw, IXGBE_PXONRXC(i)); + adapter->stats.pxofftxc[i] += + IXGBE_READ_REG(hw, IXGBE_PXOFFTXC(i)); + adapter->stats.pxoffrxc[i] += + IXGBE_READ_REG(hw, IXGBE_PXOFFRXC(i)); + adapter->stats.pxon2offc[i] += + IXGBE_READ_REG(hw, IXGBE_PXON2OFFCNT(i)); + } + for (int i = 0; i < 16; i++) { + adapter->stats.qprc[i] += IXGBE_READ_REG(hw, IXGBE_QPRC(i)); + adapter->stats.qptc[i] += IXGBE_READ_REG(hw, IXGBE_QPTC(i)); + adapter->stats.qbrc[i] += IXGBE_READ_REG(hw, IXGBE_QBRC(i)); + adapter->stats.qbrc[i] += + ((u64)IXGBE_READ_REG(hw, IXGBE_QBRC(i)) << 32); + adapter->stats.qbtc[i] += IXGBE_READ_REG(hw, IXGBE_QBTC(i)); + adapter->stats.qbtc[i] += + ((u64)IXGBE_READ_REG(hw, IXGBE_QBTC(i)) << 32); + adapter->stats.qprdc[i] += IXGBE_READ_REG(hw, IXGBE_QPRDC(i)); } + adapter->stats.mlfc += IXGBE_READ_REG(hw, IXGBE_MLFC); + adapter->stats.mrfc += IXGBE_READ_REG(hw, IXGBE_MRFC); + adapter->stats.rlec += IXGBE_READ_REG(hw, IXGBE_RLEC); /* Hardware workaround, gprc counts missed packets */ adapter->stats.gprc += IXGBE_READ_REG(hw, IXGBE_GPRC); adapter->stats.gprc -= missed_rx; if (hw->mac.type == ixgbe_mac_82599EB) { - adapter->stats.gorc += IXGBE_READ_REG(hw, IXGBE_GORCL); - IXGBE_READ_REG(hw, IXGBE_GORCH); /* clears register */ - adapter->stats.gotc += IXGBE_READ_REG(hw, IXGBE_GOTCL); - IXGBE_READ_REG(hw, IXGBE_GOTCH); /* clears register */ - adapter->stats.tor += IXGBE_READ_REG(hw, IXGBE_TORL); - IXGBE_READ_REG(hw, IXGBE_TORH); /* clears register */ + adapter->stats.gorc += IXGBE_READ_REG(hw, IXGBE_GORCL) + + ((u64)IXGBE_READ_REG(hw, IXGBE_GORCH) << 32); + adapter->stats.gotc += IXGBE_READ_REG(hw, IXGBE_GOTCL) + + ((u64)IXGBE_READ_REG(hw, IXGBE_GOTCH) << 32); + adapter->stats.tor += IXGBE_READ_REG(hw, IXGBE_TORL) + + ((u64)IXGBE_READ_REG(hw, IXGBE_TORH) << 32); adapter->stats.lxonrxc += IXGBE_READ_REG(hw, IXGBE_LXONRXCNT); adapter->stats.lxoffrxc += IXGBE_READ_REG(hw, IXGBE_LXOFFRXCNT); } else { @@ -4770,14 +4836,12 @@ ixgbe_update_stats_counters(struct adapt adapter->stats.mprc += IXGBE_READ_REG(hw, IXGBE_MPRC); adapter->stats.mprc -= bprc; - adapter->stats.roc += IXGBE_READ_REG(hw, IXGBE_ROC); adapter->stats.prc64 += IXGBE_READ_REG(hw, IXGBE_PRC64); adapter->stats.prc127 += IXGBE_READ_REG(hw, IXGBE_PRC127); adapter->stats.prc255 += IXGBE_READ_REG(hw, IXGBE_PRC255); adapter->stats.prc511 += IXGBE_READ_REG(hw, IXGBE_PRC511); adapter->stats.prc1023 += IXGBE_READ_REG(hw, IXGBE_PRC1023); adapter->stats.prc1522 += IXGBE_READ_REG(hw, IXGBE_PRC1522); - adapter->stats.rlec += IXGBE_READ_REG(hw, IXGBE_RLEC); lxon = IXGBE_READ_REG(hw, IXGBE_LXONTXC); adapter->stats.lxontxc += lxon; @@ -4795,14 +4859,27 @@ ixgbe_update_stats_counters(struct adapt adapter->stats.ruc += IXGBE_READ_REG(hw, IXGBE_RUC); adapter->stats.rfc += IXGBE_READ_REG(hw, IXGBE_RFC); + adapter->stats.roc += IXGBE_READ_REG(hw, IXGBE_ROC); adapter->stats.rjc += IXGBE_READ_REG(hw, IXGBE_RJC); + adapter->stats.mngprc += IXGBE_READ_REG(hw, IXGBE_MNGPRC); + adapter->stats.mngpdc += IXGBE_READ_REG(hw, IXGBE_MNGPDC); + adapter->stats.mngptc += IXGBE_READ_REG(hw, IXGBE_MNGPTC); adapter->stats.tpr += IXGBE_READ_REG(hw, IXGBE_TPR); + adapter->stats.tpt += IXGBE_READ_REG(hw, IXGBE_TPT); adapter->stats.ptc127 += IXGBE_READ_REG(hw, IXGBE_PTC127); adapter->stats.ptc255 += IXGBE_READ_REG(hw, IXGBE_PTC255); adapter->stats.ptc511 += IXGBE_READ_REG(hw, IXGBE_PTC511); adapter->stats.ptc1023 += IXGBE_READ_REG(hw, IXGBE_PTC1023); adapter->stats.ptc1522 += IXGBE_READ_REG(hw, IXGBE_PTC1522); adapter->stats.bptc += IXGBE_READ_REG(hw, IXGBE_BPTC); + adapter->stats.xec += IXGBE_READ_REG(hw, IXGBE_XEC); + adapter->stats.fccrc += IXGBE_READ_REG(hw, IXGBE_FCCRC); + adapter->stats.fclast += IXGBE_READ_REG(hw, IXGBE_FCLAST); + adapter->stats.fcoerpdc += IXGBE_READ_REG(hw, IXGBE_FCOERPDC); + adapter->stats.fcoeprc += IXGBE_READ_REG(hw, IXGBE_FCOEPRC); + adapter->stats.fcoeptc += IXGBE_READ_REG(hw, IXGBE_FCOEPTC); + adapter->stats.fcoedwrc += IXGBE_READ_REG(hw, IXGBE_FCOEDWRC); + adapter->stats.fcoedwtc += IXGBE_READ_REG(hw, IXGBE_FCOEDWTC); /* Fill out the OS statistics structure */ @@ -4818,147 +4895,372 @@ ixgbe_update_stats_counters(struct adapt adapter->stats.rlec; } - -/********************************************************************** - * - * This routine is called only when ixgbe_display_debug_stats is enabled. - * This routine provides a way to take a look at important statistics - * maintained by the driver and hardware. - * - **********************************************************************/ -static void -ixgbe_print_hw_stats(struct adapter * adapter) +/** ixgbe_sysctl_tdh_handler - Handler function + * Retrieves the TDH value from the hardware + */ +static int +ixgbe_sysctl_tdh_handler(SYSCTL_HANDLER_ARGS) { - device_t dev = adapter->dev; - + int error; - device_printf(dev,"Std Mbuf Failed = %lu\n", - adapter->mbuf_defrag_failed); - device_printf(dev,"Missed Packets = %llu\n", - (long long)adapter->stats.mpc[0]); - device_printf(dev,"Receive length errors = %llu\n", - ((long long)adapter->stats.roc + - (long long)adapter->stats.ruc)); - device_printf(dev,"Crc errors = %llu\n", - (long long)adapter->stats.crcerrs); - device_printf(dev,"Driver dropped packets = %lu\n", - adapter->dropped_pkts); - device_printf(dev, "watchdog timeouts = %ld\n", - adapter->watchdog_events); - - device_printf(dev,"XON Rcvd = %llu\n", - (long long)adapter->stats.lxonrxc); - device_printf(dev,"XON Xmtd = %llu\n", - (long long)adapter->stats.lxontxc); - device_printf(dev,"XOFF Rcvd = %llu\n", - (long long)adapter->stats.lxoffrxc); - device_printf(dev,"XOFF Xmtd = %llu\n", - (long long)adapter->stats.lxofftxc); - - device_printf(dev,"Total Packets Rcvd = %llu\n", - (long long)adapter->stats.tpr); - device_printf(dev,"Good Packets Rcvd = %llu\n", - (long long)adapter->stats.gprc); - device_printf(dev,"Good Packets Xmtd = %llu\n", - (long long)adapter->stats.gptc); - device_printf(dev,"TSO Transmissions = %lu\n", - adapter->tso_tx); + struct tx_ring *txr = ((struct tx_ring *)oidp->oid_arg1); + if (!txr) return 0; - return; + unsigned val = IXGBE_READ_REG(&txr->adapter->hw, IXGBE_TDH(txr->me)); + error = sysctl_handle_int(oidp, &val, 0, req); + if (error || !req->newptr) + return error; + return 0; } -/********************************************************************** - * - * This routine is called only when em_display_debug_stats is enabled. - * This routine provides a way to take a look at important statistics - * maintained by the driver and hardware. - * - **********************************************************************/ -static void -ixgbe_print_debug_info(struct adapter *adapter) +/** ixgbe_sysctl_tdt_handler - Handler function + * Retrieves the TDT value from the hardware + */ +static int +ixgbe_sysctl_tdt_handler(SYSCTL_HANDLER_ARGS) { - device_t dev = adapter->dev; - struct ixgbe_hw *hw = &adapter->hw; - struct ix_queue *que = adapter->queues; - struct rx_ring *rxr; - struct tx_ring *txr; - struct lro_ctrl *lro; - - device_printf(dev,"Error Byte Count = %u \n", - IXGBE_READ_REG(hw, IXGBE_ERRBC)); + int error; - for (int i = 0; i < adapter->num_queues; i++, que++) { - txr = que->txr; - rxr = que->rxr; - lro = &rxr->lro; - device_printf(dev,"QUE(%d) IRQs Handled: %lu\n", - que->msix, (long)que->irqs); - device_printf(dev,"RX[%d]: rdh = %d, hw rdt = %d\n", - i, IXGBE_READ_REG(hw, IXGBE_RDH(i)), - IXGBE_READ_REG(hw, IXGBE_RDT(i))); - device_printf(dev,"TX[%d] tdh = %d, hw tdt = %d\n", i, - IXGBE_READ_REG(hw, IXGBE_TDH(i)), - IXGBE_READ_REG(hw, IXGBE_TDT(i))); - device_printf(dev,"RX(%d) Packets Received: %lld\n", - rxr->me, (long long)rxr->rx_packets); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-8@FreeBSD.ORG Sun Nov 28 04:55:31 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DF465106564A; Sun, 28 Nov 2010 04:55:31 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B1DAD8FC12; Sun, 28 Nov 2010 04:55:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAS4tVRK053234; Sun, 28 Nov 2010 04:55:31 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAS4tVhb053233; Sun, 28 Nov 2010 04:55:31 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201011280455.oAS4tVhb053233@svn.freebsd.org> From: "Jayachandran C." Date: Sun, 28 Nov 2010 04:55:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215972 - in stable/8/sys/mips: alchemy atheros cavium cavium/dev rmi rmi/dev sibyte X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Nov 2010 04:55:32 -0000 Author: jchandra Date: Sun Nov 28 04:55:31 2010 New Revision: 215972 URL: http://svn.freebsd.org/changeset/base/215972 Log: Remove mergeinfo under sys/mips/ by r215938. Modified: Directory Properties: stable/8/sys/mips/alchemy/ (props changed) stable/8/sys/mips/atheros/ (props changed) stable/8/sys/mips/cavium/ (props changed) stable/8/sys/mips/cavium/dev/ (props changed) stable/8/sys/mips/rmi/ (props changed) stable/8/sys/mips/rmi/dev/ (props changed) stable/8/sys/mips/sibyte/ (props changed) From owner-svn-src-stable-8@FreeBSD.ORG Sun Nov 28 06:43:40 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0D85E1065675; Sun, 28 Nov 2010 06:43:40 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D3CA88FC1A; Sun, 28 Nov 2010 06:43:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAS6hdfr064060; Sun, 28 Nov 2010 06:43:39 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAS6hdd3064056; Sun, 28 Nov 2010 06:43:39 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201011280643.oAS6hdd3064056@svn.freebsd.org> From: "Jayachandran C." Date: Sun, 28 Nov 2010 06:43:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215979 - in stable/8/sys: mips/mips vm X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Nov 2010 06:43:40 -0000 Author: jchandra Date: Sun Nov 28 06:43:39 2010 New Revision: 215979 URL: http://svn.freebsd.org/changeset/base/215979 Log: MFC r215973 The current implementation of vm_page_alloc_freelist() does not handle order > 0 correctly. Remove order parameter to the function and use it only for order 0 pages. Modified: stable/8/sys/mips/mips/pmap.c stable/8/sys/vm/vm_page.c stable/8/sys/vm/vm_page.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/mips/mips/pmap.c ============================================================================== --- stable/8/sys/mips/mips/pmap.c Sun Nov 28 06:25:17 2010 (r215978) +++ stable/8/sys/mips/mips/pmap.c Sun Nov 28 06:43:39 2010 (r215979) @@ -1072,7 +1072,7 @@ pmap_alloc_pte_page(unsigned int index, { vm_page_t m; - m = vm_page_alloc_freelist(VM_FREELIST_DIRECT, 0, req); + m = vm_page_alloc_freelist(VM_FREELIST_DIRECT, req); if (m == NULL) return (NULL); Modified: stable/8/sys/vm/vm_page.c ============================================================================== --- stable/8/sys/vm/vm_page.c Sun Nov 28 06:25:17 2010 (r215978) +++ stable/8/sys/vm/vm_page.c Sun Nov 28 06:43:39 2010 (r215979) @@ -1314,12 +1314,12 @@ vm_page_alloc_init(vm_page_t m) /* * vm_page_alloc_freelist: * - * Allocate a page from the specified freelist with specified order. + * Allocate a page from the specified freelist. * Only the ALLOC_CLASS values in req are honored, other request flags * are ignored. */ vm_page_t -vm_page_alloc_freelist(int flind, int order, int req) +vm_page_alloc_freelist(int flind, int req) { struct vnode *drop; vm_page_t m; @@ -1336,7 +1336,7 @@ vm_page_alloc_freelist(int flind, int or cnt.v_free_count + cnt.v_cache_count > cnt.v_interrupt_free_min) || (page_req == VM_ALLOC_INTERRUPT && cnt.v_free_count + cnt.v_cache_count > 0)) { - m = vm_phys_alloc_freelist_pages(flind, VM_FREEPOOL_DIRECT, order); + m = vm_phys_alloc_freelist_pages(flind, VM_FREEPOOL_DIRECT, 0); } if (m == NULL) { mtx_unlock(&vm_page_queue_free_mtx); Modified: stable/8/sys/vm/vm_page.h ============================================================================== --- stable/8/sys/vm/vm_page.h Sun Nov 28 06:25:17 2010 (r215978) +++ stable/8/sys/vm/vm_page.h Sun Nov 28 06:43:39 2010 (r215979) @@ -303,7 +303,7 @@ void vm_pageq_remove(vm_page_t m); void vm_page_activate (vm_page_t); vm_page_t vm_page_alloc (vm_object_t, vm_pindex_t, int); -vm_page_t vm_page_alloc_freelist(int, int, int); +vm_page_t vm_page_alloc_freelist(int, int); struct vnode *vm_page_alloc_init(vm_page_t); vm_page_t vm_page_grab (vm_object_t, vm_pindex_t, int); void vm_page_cache(vm_page_t); From owner-svn-src-stable-8@FreeBSD.ORG Sun Nov 28 07:03:22 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EB521106564A; Sun, 28 Nov 2010 07:03:21 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D75818FC08; Sun, 28 Nov 2010 07:03:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAS73L4P067008; Sun, 28 Nov 2010 07:03:21 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAS73Llh067002; Sun, 28 Nov 2010 07:03:21 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201011280703.oAS73Llh067002@svn.freebsd.org> From: Andrew Thompson Date: Sun, 28 Nov 2010 07:03:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215980 - in stable/8/sys/dev/usb: . quirk serial wlan X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Nov 2010 07:03:22 -0000 Author: thompsa Date: Sun Nov 28 07:03:21 2010 New Revision: 215980 URL: http://svn.freebsd.org/changeset/base/215980 Log: MFC r213804,213879,213880,214800 Add new device IDs. Modified: stable/8/sys/dev/usb/quirk/usb_quirk.c stable/8/sys/dev/usb/serial/u3g.c stable/8/sys/dev/usb/usbdevs stable/8/sys/dev/usb/wlan/if_rum.c stable/8/sys/dev/usb/wlan/if_upgt.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- stable/8/sys/dev/usb/quirk/usb_quirk.c Sun Nov 28 06:43:39 2010 (r215979) +++ stable/8/sys/dev/usb/quirk/usb_quirk.c Sun Nov 28 07:03:21 2010 (r215980) @@ -120,6 +120,7 @@ static struct usb_quirk_entry usb_quirks USB_QUIRK(MGE, UPS2, 0x0000, 0xffff, UQ_HID_IGNORE), USB_QUIRK(APPLE, IPHONE, 0x0000, 0xffff, UQ_HID_IGNORE), USB_QUIRK(APPLE, IPHONE_3G, 0x0000, 0xffff, UQ_HID_IGNORE), + USB_QUIRK(MEGATEC, UPS, 0x0000, 0xffff, UQ_HID_IGNORE), /* Devices which should be ignored by both ukbd and uhid */ USB_QUIRK(CYPRESS, WISPY1A, 0x0000, 0xffff, UQ_KBD_IGNORE, UQ_HID_IGNORE), USB_QUIRK(METAGEEK, WISPY1B, 0x0000, 0xffff, UQ_KBD_IGNORE, UQ_HID_IGNORE), Modified: stable/8/sys/dev/usb/serial/u3g.c ============================================================================== --- stable/8/sys/dev/usb/serial/u3g.c Sun Nov 28 06:43:39 2010 (r215979) +++ stable/8/sys/dev/usb/serial/u3g.c Sun Nov 28 07:03:21 2010 (r215980) @@ -285,11 +285,12 @@ static const struct usb_device_id u3g_de U3G_DEV(HUAWEI, E220BIS, U3GINIT_HUAWEI), U3G_DEV(HUAWEI, MOBILE, U3GINIT_HUAWEI), U3G_DEV(HUAWEI, E1752, U3GINIT_HUAWEISCSI), - U3G_DEV(HUAWEI, K3765_INIT, U3GINIT_HUAWEISCSI), + U3G_DEV(HUAWEI, K3765, U3GINIT_HUAWEI), U3G_DEV(KYOCERA2, CDMA_MSM_K, 0), U3G_DEV(KYOCERA2, KPC680, 0), U3G_DEV(LONGCHEER, WM66, U3GINIT_HUAWEI), U3G_DEV(MERLIN, V620, 0), + U3G_DEV(NEOTEL, PRIME, 0), U3G_DEV(NOVATEL, E725, 0), U3G_DEV(NOVATEL, ES620, 0), U3G_DEV(NOVATEL, ES620_2, 0), Modified: stable/8/sys/dev/usb/usbdevs ============================================================================== --- stable/8/sys/dev/usb/usbdevs Sun Nov 28 06:43:39 2010 (r215979) +++ stable/8/sys/dev/usb/usbdevs Sun Nov 28 07:03:21 2010 (r215980) @@ -2526,7 +2526,7 @@ product PHILIPS RT2870 0x200f RT2870 product PHILIPSSEMI HUB1122 0x1122 HUB /* Megatec */ -product MEGATEC UPS 0x5161 Protocol based UPS +product MEGATEC UPS 0x5161 Phoenixtec protocol based UPS /* P.I. Engineering products */ product PIENGINEERING PS2USB 0x020b PS2 to Mac USB Adapter Modified: stable/8/sys/dev/usb/wlan/if_rum.c ============================================================================== --- stable/8/sys/dev/usb/wlan/if_rum.c Sun Nov 28 06:43:39 2010 (r215979) +++ stable/8/sys/dev/usb/wlan/if_rum.c Sun Nov 28 07:03:21 2010 (r215980) @@ -118,6 +118,8 @@ static const struct usb_device_id rum_de RUM_DEV(HUAWEI3COM, WUB320G), RUM_DEV(MELCO, G54HP), RUM_DEV(MELCO, SG54HP), + RUM_DEV(MELCO, WLRUCG), + RUM_DEV(MELCO, WLRUCGAOSS), RUM_DEV(MSI, RT2573_1), RUM_DEV(MSI, RT2573_2), RUM_DEV(MSI, RT2573_3), Modified: stable/8/sys/dev/usb/wlan/if_upgt.c ============================================================================== --- stable/8/sys/dev/usb/wlan/if_upgt.c Sun Nov 28 06:43:39 2010 (r215979) +++ stable/8/sys/dev/usb/wlan/if_upgt.c Sun Nov 28 07:03:21 2010 (r215980) @@ -182,6 +182,7 @@ static const struct usb_device_id upgt_d UPGT_DEV(FSC, E5400), UPGT_DEV(GLOBESPAN, PRISM_GT_1), UPGT_DEV(GLOBESPAN, PRISM_GT_2), + UPGT_DEV(NETGEAR, WG111V2_2), UPGT_DEV(INTERSIL, PRISM_GT), UPGT_DEV(SMC, 2862WG), UPGT_DEV(USR, USR5422), From owner-svn-src-stable-8@FreeBSD.ORG Sun Nov 28 07:04:29 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1EE96106566C; Sun, 28 Nov 2010 07:04:29 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 01FE38FC15; Sun, 28 Nov 2010 07:04:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAS74SFf067234; Sun, 28 Nov 2010 07:04:28 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAS74Sr3067230; Sun, 28 Nov 2010 07:04:28 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201011280704.oAS74Sr3067230@svn.freebsd.org> From: Andrew Thompson Date: Sun, 28 Nov 2010 07:04:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215981 - in stable/8/sys/dev/usb: . net X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Nov 2010 07:04:29 -0000 Author: thompsa Date: Sun Nov 28 07:04:28 2010 New Revision: 215981 URL: http://svn.freebsd.org/changeset/base/215981 Log: MFC r213809 USB network (NCM driver): - correct the ethernet payload remainder which must be post-offseted by -14 bytes instead of 0 bytes. This is not very clearly defined in the NCM specification. Modified: stable/8/sys/dev/usb/net/if_cdce.c stable/8/sys/dev/usb/net/if_cdcereg.h stable/8/sys/dev/usb/usb_cdc.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/usb/net/if_cdce.c ============================================================================== --- stable/8/sys/dev/usb/net/if_cdce.c Sun Nov 28 07:03:21 2010 (r215980) +++ stable/8/sys/dev/usb/net/if_cdce.c Sun Nov 28 07:04:28 2010 (r215981) @@ -110,10 +110,13 @@ static uint32_t cdce_m_crc32(struct mbuf #ifdef USB_DEBUG static int cdce_debug = 0; +static int cdce_tx_interval = 0; SYSCTL_NODE(_hw_usb, OID_AUTO, cdce, CTLFLAG_RW, 0, "USB CDC-Ethernet"); SYSCTL_INT(_hw_usb_cdce, OID_AUTO, debug, CTLFLAG_RW, &cdce_debug, 0, "Debug level"); +SYSCTL_INT(_hw_usb_cdce, OID_AUTO, interval, CTLFLAG_RW, &cdce_tx_interval, 0, + "NCM transmit interval in ms"); #endif static const struct usb_config cdce_config[CDCE_N_TRANSFER] = { @@ -192,7 +195,7 @@ static const struct usb_config cdce_ncm_ .if_index = 0, .frames = CDCE_NCM_TX_FRAMES_MAX, .bufsize = (CDCE_NCM_TX_FRAMES_MAX * CDCE_NCM_TX_MAXLEN), - .flags = {.pipe_bof = 1,.force_short_xfer = 1,}, + .flags = {.pipe_bof = 1,}, .callback = cdce_ncm_bulk_write_callback, .timeout = 10000, /* 10 seconds */ .usb_mode = USB_MODE_DUAL, /* both modes */ @@ -294,9 +297,22 @@ cdce_ncm_init(struct cdce_softc *sc) { struct usb_ncm_parameters temp; struct usb_device_request req; - uDWord value; + struct usb_ncm_func_descriptor *ufd; + uint8_t value[8]; int err; + ufd = usbd_find_descriptor(sc->sc_ue.ue_udev, NULL, + sc->sc_ifaces_index[1], UDESC_CS_INTERFACE, 0 - 1, + UCDC_NCM_FUNC_DESC_SUBTYPE, 0 - 1); + + /* verify length of NCM functional descriptor */ + if (ufd != NULL) { + if (ufd->bLength < sizeof(*ufd)) + ufd = NULL; + else + DPRINTFN(1, "Found NCM functional descriptor.\n"); + } + req.bmRequestType = UT_READ_CLASS_INTERFACE; req.bRequest = UCDC_NCM_GET_NTB_PARAMETERS; USETW(req.wValue, 0); @@ -317,17 +333,19 @@ cdce_ncm_init(struct cdce_softc *sc) sc->sc_ncm.tx_remainder = UGETW(temp.wNdpOutPayloadRemainder); sc->sc_ncm.tx_modulus = UGETW(temp.wNdpOutDivisor); sc->sc_ncm.tx_struct_align = UGETW(temp.wNdpOutAlignment); + sc->sc_ncm.tx_nframe = UGETW(temp.wNtbOutMaxDatagrams); } else { sc->sc_ncm.rx_max = UGETDW(temp.dwNtbOutMaxSize); sc->sc_ncm.tx_max = UGETDW(temp.dwNtbInMaxSize); sc->sc_ncm.tx_remainder = UGETW(temp.wNdpInPayloadRemainder); sc->sc_ncm.tx_modulus = UGETW(temp.wNdpInDivisor); sc->sc_ncm.tx_struct_align = UGETW(temp.wNdpInAlignment); + sc->sc_ncm.tx_nframe = UGETW(temp.wNtbOutMaxDatagrams); } /* Verify maximum receive length */ - if (err || (sc->sc_ncm.rx_max < 32) || + if ((sc->sc_ncm.rx_max < 32) || (sc->sc_ncm.rx_max > CDCE_NCM_RX_MAXLEN)) { DPRINTFN(1, "Using default maximum receive length\n"); sc->sc_ncm.rx_max = CDCE_NCM_RX_MAXLEN; @@ -335,7 +353,7 @@ cdce_ncm_init(struct cdce_softc *sc) /* Verify maximum transmit length */ - if (err || (sc->sc_ncm.tx_max < 32) || + if ((sc->sc_ncm.tx_max < 32) || (sc->sc_ncm.tx_max > CDCE_NCM_TX_MAXLEN)) { DPRINTFN(1, "Using default maximum transmit length\n"); sc->sc_ncm.tx_max = CDCE_NCM_TX_MAXLEN; @@ -347,7 +365,7 @@ cdce_ncm_init(struct cdce_softc *sc) * - not greater than the maximum transmit length * - not less than four bytes */ - if (err || (sc->sc_ncm.tx_struct_align < 4) || + if ((sc->sc_ncm.tx_struct_align < 4) || (sc->sc_ncm.tx_struct_align != ((-sc->sc_ncm.tx_struct_align) & sc->sc_ncm.tx_struct_align)) || (sc->sc_ncm.tx_struct_align >= sc->sc_ncm.tx_max)) { @@ -361,7 +379,7 @@ cdce_ncm_init(struct cdce_softc *sc) * - not greater than the maximum transmit length * - not less than four bytes */ - if (err || (sc->sc_ncm.tx_modulus < 4) || + if ((sc->sc_ncm.tx_modulus < 4) || (sc->sc_ncm.tx_modulus != ((-sc->sc_ncm.tx_modulus) & sc->sc_ncm.tx_modulus)) || (sc->sc_ncm.tx_modulus >= sc->sc_ncm.tx_max)) { @@ -371,11 +389,30 @@ cdce_ncm_init(struct cdce_softc *sc) /* Verify that the payload remainder */ - if (err || (sc->sc_ncm.tx_remainder >= sc->sc_ncm.tx_modulus)) { + if ((sc->sc_ncm.tx_remainder >= sc->sc_ncm.tx_modulus)) { DPRINTFN(1, "Using default transmit remainder: 0 bytes\n"); sc->sc_ncm.tx_remainder = 0; } + /* + * Offset the TX remainder so that IP packet payload starts at + * the tx_modulus. This is not too clear in the specification. + */ + + sc->sc_ncm.tx_remainder = + (sc->sc_ncm.tx_remainder - ETHER_HDR_LEN) & + (sc->sc_ncm.tx_modulus - 1); + + /* Verify max datagrams */ + + if (sc->sc_ncm.tx_nframe == 0 || + sc->sc_ncm.tx_nframe > (CDCE_NCM_SUBFRAMES_MAX - 1)) { + DPRINTFN(1, "Using default max " + "subframes: %u units\n", CDCE_NCM_SUBFRAMES_MAX - 1); + /* need to reserve one entry for zero padding */ + sc->sc_ncm.tx_nframe = (CDCE_NCM_SUBFRAMES_MAX - 1); + } + /* Additional configuration, will fail in device side mode, which is OK. */ req.bmRequestType = UT_WRITE_CLASS_INTERFACE; @@ -383,8 +420,17 @@ cdce_ncm_init(struct cdce_softc *sc) USETW(req.wValue, 0); req.wIndex[0] = sc->sc_ifaces_index[1]; req.wIndex[1] = 0; - USETW(req.wLength, 4); - USETDW(value, sc->sc_ncm.rx_max); + + if (ufd != NULL && + (ufd->bmNetworkCapabilities & UCDC_NCM_CAP_MAX_DGRAM)) { + USETW(req.wLength, 8); + USETDW(value, sc->sc_ncm.rx_max); + USETW(value + 4, (CDCE_NCM_SUBFRAMES_MAX - 1)); + USETW(value + 6, 0); + } else { + USETW(req.wLength, 4); + USETDW(value, sc->sc_ncm.rx_max); + } err = usbd_do_request_flags(sc->sc_ue.ue_udev, NULL, &req, &value, 0, NULL, 1000 /* ms */); @@ -567,7 +613,7 @@ alloc_transfers: } else { - bzero(sc->sc_ue.ue_eaddr, sizeof(sc->sc_ue.ue_eaddr)); + memset(sc->sc_ue.ue_eaddr, 0, sizeof(sc->sc_ue.ue_eaddr)); for (i = 0; i != (ETHER_ADDR_LEN * 2); i++) { @@ -983,6 +1029,18 @@ cdce_handle_request(device_t dev, } #if CDCE_HAVE_NCM +static void +cdce_ncm_tx_zero(struct usb_page_cache *pc, + uint32_t start, uint32_t end) +{ + if (start >= CDCE_NCM_TX_MAXLEN) + return; + if (end > CDCE_NCM_TX_MAXLEN) + end = CDCE_NCM_TX_MAXLEN; + + usbd_frame_zero(pc, start, end - start); +} + static uint8_t cdce_ncm_fill_tx_frames(struct usb_xfer *xfer, uint8_t index) { @@ -993,7 +1051,8 @@ cdce_ncm_fill_tx_frames(struct usb_xfer uint32_t rem; uint32_t offset; uint32_t last_offset; - uint32_t n; + uint16_t n; + uint8_t retval; usbd_xfer_set_frame_offset(xfer, index * CDCE_NCM_TX_MAXLEN, index); @@ -1003,11 +1062,17 @@ cdce_ncm_fill_tx_frames(struct usb_xfer /* Store last valid offset before alignment */ last_offset = offset; - /* Align offset correctly */ - offset = sc->sc_ncm.tx_remainder - - ((0UL - offset) & (0UL - sc->sc_ncm.tx_modulus)); + /* Align offset */ + offset = CDCE_NCM_ALIGN(sc->sc_ncm.tx_remainder, + offset, sc->sc_ncm.tx_modulus); - for (n = 0; n != CDCE_NCM_SUBFRAMES_MAX; n++) { + /* Zero pad */ + cdce_ncm_tx_zero(pc, last_offset, offset); + + /* buffer full */ + retval = 2; + + for (n = 0; n != sc->sc_ncm.tx_nframe; n++) { /* check if end of transmit buffer is reached */ @@ -1020,8 +1085,11 @@ cdce_ncm_fill_tx_frames(struct usb_xfer IFQ_DRV_DEQUEUE(&(ifp->if_snd), m); - if (m == NULL) + if (m == NULL) { + /* buffer not full */ + retval = 1; break; + } if (m->m_pkthdr.len > rem) { if (n == 0) { @@ -1047,9 +1115,12 @@ cdce_ncm_fill_tx_frames(struct usb_xfer /* Store last valid offset before alignment */ last_offset = offset; - /* Align offset correctly */ - offset = sc->sc_ncm.tx_remainder - - ((0UL - offset) & (0UL - sc->sc_ncm.tx_modulus)); + /* Align offset */ + offset = CDCE_NCM_ALIGN(sc->sc_ncm.tx_remainder, + offset, sc->sc_ncm.tx_modulus); + + /* Zero pad */ + cdce_ncm_tx_zero(pc, last_offset, offset); /* * If there's a BPF listener, bounce a copy @@ -1067,7 +1138,7 @@ cdce_ncm_fill_tx_frames(struct usb_xfer } if (n == 0) - return (1); + return (0); rem = (sizeof(sc->sc_ncm.dpt) + (4 * n) + 4); @@ -1079,8 +1150,22 @@ cdce_ncm_fill_tx_frames(struct usb_xfer USETW(sc->sc_ncm.dp[n].wFrameIndex, 0); } + offset = last_offset; + + /* Align offset */ + offset = CDCE_NCM_ALIGN(0, offset, CDCE_NCM_TX_MINLEN); + + /* Optimise, save bandwidth and force short termination */ + if (offset >= sc->sc_ncm.tx_max) + offset = sc->sc_ncm.tx_max; + else + offset ++; + + /* Zero pad */ + cdce_ncm_tx_zero(pc, last_offset, offset); + /* set frame length */ - usbd_xfer_set_frame_len(xfer, index, last_offset); + usbd_xfer_set_frame_len(xfer, index, offset); /* Fill out 16-bit header */ sc->sc_ncm.hdr.dwSignature[0] = 'N'; @@ -1088,7 +1173,7 @@ cdce_ncm_fill_tx_frames(struct usb_xfer sc->sc_ncm.hdr.dwSignature[2] = 'M'; sc->sc_ncm.hdr.dwSignature[3] = 'H'; USETW(sc->sc_ncm.hdr.wHeaderLength, sizeof(sc->sc_ncm.hdr)); - USETW(sc->sc_ncm.hdr.wBlockLength, last_offset); + USETW(sc->sc_ncm.hdr.wBlockLength, offset); USETW(sc->sc_ncm.hdr.wSequence, sc->sc_ncm.tx_seq); USETW(sc->sc_ncm.hdr.wDptIndex, sizeof(sc->sc_ncm.hdr)); @@ -1106,7 +1191,7 @@ cdce_ncm_fill_tx_frames(struct usb_xfer sizeof(sc->sc_ncm.dpt)); usbd_copy_in(pc, sizeof(sc->sc_ncm.hdr) + sizeof(sc->sc_ncm.dpt), &(sc->sc_ncm.dp), sizeof(sc->sc_ncm.dp)); - return (0); + return (retval); } static void @@ -1115,6 +1200,7 @@ cdce_ncm_bulk_write_callback(struct usb_ struct cdce_softc *sc = usbd_xfer_softc(xfer); struct ifnet *ifp = uether_getifp(&sc->sc_ue); uint16_t x; + uint8_t temp; int actlen; int aframes; @@ -1128,11 +1214,19 @@ cdce_ncm_bulk_write_callback(struct usb_ case USB_ST_SETUP: for (x = 0; x != CDCE_NCM_TX_FRAMES_MAX; x++) { - if (cdce_ncm_fill_tx_frames(xfer, x)) + temp = cdce_ncm_fill_tx_frames(xfer, x); + if (temp == 0) + break; + if (temp == 1) { + x++; break; + } } if (x != 0) { +#ifdef USB_DEBUG + usbd_xfer_set_interval(xfer, cdce_tx_interval); +#endif usbd_xfer_set_frames(xfer, x); usbd_transfer_submit(xfer); } Modified: stable/8/sys/dev/usb/net/if_cdcereg.h ============================================================================== --- stable/8/sys/dev/usb/net/if_cdcereg.h Sun Nov 28 07:03:21 2010 (r215980) +++ stable/8/sys/dev/usb/net/if_cdcereg.h Sun Nov 28 07:04:28 2010 (r215981) @@ -38,7 +38,8 @@ #define CDCE_FRAMES_MAX 8 /* units */ #define CDCE_IND_SIZE_MAX 32 /* bytes */ -#define CDCE_NCM_TX_MAXLEN 2048UL /* bytes */ +#define CDCE_NCM_TX_MINLEN 512 /* bytes, must be power of two */ +#define CDCE_NCM_TX_MAXLEN (1UL << 14) /* bytes */ #define CDCE_NCM_TX_FRAMES_MAX 8 /* units */ #define CDCE_NCM_RX_MAXLEN (1UL << 14) /* bytes */ @@ -46,6 +47,10 @@ #define CDCE_NCM_SUBFRAMES_MAX 32 /* units */ +#define CDCE_NCM_ALIGN(rem,off,mod) \ + ((uint32_t)(((uint32_t)(rem)) - \ + ((uint32_t)((-(uint32_t)(off)) & (-(uint32_t)(mod)))))) + #ifndef CDCE_HAVE_NCM #define CDCE_HAVE_NCM 1 #endif @@ -68,6 +73,7 @@ struct cdce_ncm { uint16_t tx_modulus; uint16_t tx_struct_align; uint16_t tx_seq; + uint16_t tx_nframe; }; struct cdce_softc { Modified: stable/8/sys/dev/usb/usb_cdc.h ============================================================================== --- stable/8/sys/dev/usb/usb_cdc.h Sun Nov 28 07:03:21 2010 (r215980) +++ stable/8/sys/dev/usb/usb_cdc.h Sun Nov 28 07:04:28 2010 (r215981) @@ -248,6 +248,7 @@ struct usb_ncm_func_descriptor { #define UCDC_NCM_CAP_ENCAP 0x04 #define UCDC_NCM_CAP_MAX_DATA 0x08 #define UCDC_NCM_CAP_CRCMODE 0x10 +#define UCDC_NCM_CAP_MAX_DGRAM 0x20 } __packed; /* Communications interface specific class request codes */ @@ -283,7 +284,7 @@ struct usb_ncm_parameters { uWord wNdpOutDivisor; uWord wNdpOutPayloadRemainder; uWord wNdpOutAlignment; - uWord wReserved26; + uWord wNtbOutMaxDatagrams; } __packed; /* Communications interface specific class notification codes */ From owner-svn-src-stable-8@FreeBSD.ORG Sun Nov 28 07:16:53 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A4810106566B; Sun, 28 Nov 2010 07:16:53 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 90C968FC17; Sun, 28 Nov 2010 07:16:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAS7Gr2K069207; Sun, 28 Nov 2010 07:16:53 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAS7GrNN069200; Sun, 28 Nov 2010 07:16:53 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201011280716.oAS7GrNN069200@svn.freebsd.org> From: Andrew Thompson Date: Sun, 28 Nov 2010 07:16:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215982 - stable/8/lib/libusb X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Nov 2010 07:16:53 -0000 Author: thompsa Date: Sun Nov 28 07:16:53 2010 New Revision: 215982 URL: http://svn.freebsd.org/changeset/base/215982 Log: MFC r213848 - Add a new API function to check the connected status of the USB handle in the LibUSB v1.0 and LibUSB v0.1 interfaces. Modified: stable/8/lib/libusb/libusb.3 stable/8/lib/libusb/libusb.h stable/8/lib/libusb/libusb10.c stable/8/lib/libusb/libusb20_compat01.c stable/8/lib/libusb/usb.h (contents, props changed) Directory Properties: stable/8/lib/libusb/ (props changed) Modified: stable/8/lib/libusb/libusb.3 ============================================================================== --- stable/8/lib/libusb/libusb.3 Sun Nov 28 07:04:28 2010 (r215981) +++ stable/8/lib/libusb/libusb.3 Sun Nov 28 07:16:53 2010 (r215982) @@ -240,6 +240,14 @@ been disconnected and a LIBUSB_ERROR cod .Pp . .Ft int +.Fn libusb_check_connected "libusb_device_handle *devh" +Test if USB device is still connected. Returns 0 on success, +LIBUSB_ERROR_NO_DEVICE if has been disconnected and a LIBUSB_ERROR +code on failure. +. +.Pp +. +.Ft int .Fn libusb_kernel_driver_active "libusb_device_handle *devh" "int interface" Determine if a driver is active on a interface. Returns 0 if no kernel driver is active, returns 1 if a kernel driver is active, returns LIBUSB_ERROR_NO_DEVICE @@ -522,6 +530,7 @@ The library is also compliant with LibUS .Fn usb_find_devices .Fn usb_device .Fn usb_get_busses +.Fn usb_check_connected . .Sh SEE ALSO .Xr libusb20 3 , Modified: stable/8/lib/libusb/libusb.h ============================================================================== --- stable/8/lib/libusb/libusb.h Sun Nov 28 07:04:28 2010 (r215981) +++ stable/8/lib/libusb/libusb.h Sun Nov 28 07:16:53 2010 (r215982) @@ -317,6 +317,7 @@ int libusb_set_configuration(libusb_devi int libusb_claim_interface(libusb_device_handle * devh, int interface_number); int libusb_release_interface(libusb_device_handle * devh, int interface_number); int libusb_reset_device(libusb_device_handle * devh); +int libusb_check_connected(libusb_device_handle * devh); int libusb_kernel_driver_active(libusb_device_handle * devh, int interface); int libusb_get_driver_np(libusb_device_handle * devh, int interface, char *name, int namelen); int libusb_get_driver(libusb_device_handle * devh, int interface, char *name, int namelen); Modified: stable/8/lib/libusb/libusb10.c ============================================================================== --- stable/8/lib/libusb/libusb10.c Sun Nov 28 07:04:28 2010 (r215981) +++ stable/8/lib/libusb/libusb10.c Sun Nov 28 07:16:53 2010 (r215982) @@ -678,6 +678,21 @@ libusb_reset_device(struct libusb20_devi } int +libusb_check_connected(struct libusb20_device *pdev) +{ + libusb_device *dev; + int err; + + dev = libusb_get_device(pdev); + if (dev == NULL) + return (LIBUSB_ERROR_INVALID_PARAM); + + err = libusb20_dev_check_connected(pdev); + + return (err ? LIBUSB_ERROR_NO_DEVICE : 0); +} + +int libusb_kernel_driver_active(struct libusb20_device *pdev, int interface) { if (pdev == NULL) Modified: stable/8/lib/libusb/libusb20_compat01.c ============================================================================== --- stable/8/lib/libusb/libusb20_compat01.c Sun Nov 28 07:04:28 2010 (r215981) +++ stable/8/lib/libusb/libusb20_compat01.c Sun Nov 28 07:16:53 2010 (r215982) @@ -795,6 +795,19 @@ usb_reset(usb_dev_handle * dev) return (usb_close(dev)); } +int +usb_check_connected(usb_dev_handle * dev) +{ + int err; + + err = libusb20_dev_check_connected((void *)dev); + + if (err) + return (-1); + + return (0); +} + const char * usb_strerror(void) { Modified: stable/8/lib/libusb/usb.h ============================================================================== --- stable/8/lib/libusb/usb.h Sun Nov 28 07:04:28 2010 (r215981) +++ stable/8/lib/libusb/usb.h Sun Nov 28 07:16:53 2010 (r215982) @@ -291,6 +291,7 @@ int usb_set_altinterface(usb_dev_handle int usb_resetep(usb_dev_handle * dev, unsigned int ep); int usb_clear_halt(usb_dev_handle * dev, unsigned int ep); int usb_reset(usb_dev_handle * dev); +int usb_check_connected(usb_dev_handle * dev); const char *usb_strerror(void); void usb_init(void); void usb_set_debug(int level); From owner-svn-src-stable-8@FreeBSD.ORG Sun Nov 28 07:18:15 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 65E32106566B; Sun, 28 Nov 2010 07:18:15 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3827E8FC16; Sun, 28 Nov 2010 07:18:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAS7IF4I069484; Sun, 28 Nov 2010 07:18:15 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAS7IFt1069481; Sun, 28 Nov 2010 07:18:15 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201011280718.oAS7IFt1069481@svn.freebsd.org> From: Andrew Thompson Date: Sun, 28 Nov 2010 07:18:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215983 - stable/8/lib/libusb X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Nov 2010 07:18:15 -0000 Author: thompsa Date: Sun Nov 28 07:18:14 2010 New Revision: 215983 URL: http://svn.freebsd.org/changeset/base/215983 Log: MFC r215253 Fix LibUSB v1.0 compliancy. 1) We need to allow the USB callback to free the USB transfer itself. 2) The USB transfer buffer should only be automatically freed when freeing the USB transfer. Modified: stable/8/lib/libusb/libusb10.c stable/8/lib/libusb/libusb10_io.c Directory Properties: stable/8/lib/libusb/ (props changed) stable/8/lib/libusb/usb.h (props changed) Modified: stable/8/lib/libusb/libusb10.c ============================================================================== --- stable/8/lib/libusb/libusb10.c Sun Nov 28 07:16:53 2010 (r215982) +++ stable/8/lib/libusb/libusb10.c Sun Nov 28 07:18:14 2010 (r215983) @@ -800,6 +800,10 @@ libusb_free_transfer(struct libusb_trans if (uxfer == NULL) return; /* be NULL safe */ + /* check if we should free the transfer buffer */ + if (uxfer->flags & LIBUSB_TRANSFER_FREE_BUFFER) + free(uxfer->buffer); + sxfer = (struct libusb_super_transfer *)( (uint8_t *)uxfer - sizeof(*sxfer)); Modified: stable/8/lib/libusb/libusb10_io.c ============================================================================== --- stable/8/lib/libusb/libusb10_io.c Sun Nov 28 07:16:53 2010 (r215982) +++ stable/8/lib/libusb/libusb10_io.c Sun Nov 28 07:18:14 2010 (r215983) @@ -187,6 +187,8 @@ do_done: /* Do all done callbacks */ while ((sxfer = TAILQ_FIRST(&ctx->tr_done))) { + uint8_t flags; + TAILQ_REMOVE(&ctx->tr_done, sxfer, entry); sxfer->entry.tqe_prev = NULL; @@ -197,13 +199,14 @@ do_done: uxfer = (struct libusb_transfer *)( ((uint8_t *)sxfer) + sizeof(*sxfer)); + /* Allow the callback to free the transfer itself. */ + flags = uxfer->flags; + if (uxfer->callback != NULL) (uxfer->callback) (uxfer); - if (uxfer->flags & LIBUSB_TRANSFER_FREE_BUFFER) - free(uxfer->buffer); - - if (uxfer->flags & LIBUSB_TRANSFER_FREE_TRANSFER) + /* Check if the USB transfer should be automatically freed. */ + if (flags & LIBUSB_TRANSFER_FREE_TRANSFER) libusb_free_transfer(uxfer); CTX_LOCK(ctx); From owner-svn-src-stable-8@FreeBSD.ORG Sun Nov 28 07:19:11 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B3C77106564A; Sun, 28 Nov 2010 07:19:11 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A042D8FC12; Sun, 28 Nov 2010 07:19:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAS7JB32069713; Sun, 28 Nov 2010 07:19:11 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAS7JBEq069711; Sun, 28 Nov 2010 07:19:11 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201011280719.oAS7JBEq069711@svn.freebsd.org> From: Andrew Thompson Date: Sun, 28 Nov 2010 07:19:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215984 - stable/8/lib/libusb X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Nov 2010 07:19:11 -0000 Author: thompsa Date: Sun Nov 28 07:19:11 2010 New Revision: 215984 URL: http://svn.freebsd.org/changeset/base/215984 Log: MFC r215450 Correct description of the return values of the LibUSB v1.0 libusb_control_transfer() function. PR: usb/151851 Modified: stable/8/lib/libusb/libusb.3 Directory Properties: stable/8/lib/libusb/ (props changed) stable/8/lib/libusb/usb.h (props changed) Modified: stable/8/lib/libusb/libusb.3 ============================================================================== --- stable/8/lib/libusb/libusb.3 Sun Nov 28 07:18:14 2010 (r215983) +++ stable/8/lib/libusb/libusb.3 Sun Nov 28 07:19:11 2010 (r215984) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 14, 2010 +.Dd November 18, 2010 .Dt LIBUSB 3 .Os .Sh NAME @@ -380,10 +380,15 @@ LIBUSB_ERROR code on failure. .Pp .Ft int .Fn libusb_control_transfer "libusb_device_handle *devh" "uint8_t bmRequestType" "uint8_t bRequest" "uint16_t wValue" "uint16_t wIndex" "unsigned char *data" "uint16_t wLength" "unsigned int timeout" -Perform a USB control transfer. Returns 0 on success, LIBUSB_ERROR_TIMEOUT -if the transfer timeout, LIBUSB_ERROR_PIPE if the control request was not -supported, LIBUSB_ERROR_NO_DEVICE if the device has been disconnected and -LIBUSB_ERROR code on other failure. +Perform a USB control transfer. Returns the actual number of bytes +transferred on success in the range from and including zero until and +including +.Xa wLength . +On error a libusb error code is returned, for example +LIBUSB_ERROR_TIMEOUT if the transfer timeout, LIBUSB_ERROR_PIPE if the +control request was not supported, LIBUSB_ERROR_NO_DEVICE if the +device has been disconnected or another LIBUSB_ERROR code on other failures. +The libusb error codes are always negative. . .Pp .Ft int From owner-svn-src-stable-8@FreeBSD.ORG Sun Nov 28 07:23:05 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EB14F106566B; Sun, 28 Nov 2010 07:23:05 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D7B8D8FC0C; Sun, 28 Nov 2010 07:23:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAS7N57a070541; Sun, 28 Nov 2010 07:23:05 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAS7N56D070539; Sun, 28 Nov 2010 07:23:05 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201011280723.oAS7N56D070539@svn.freebsd.org> From: Andrew Thompson Date: Sun, 28 Nov 2010 07:23:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215985 - stable/8/sys/dev/usb X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Nov 2010 07:23:06 -0000 Author: thompsa Date: Sun Nov 28 07:23:05 2010 New Revision: 215985 URL: http://svn.freebsd.org/changeset/base/215985 Log: MFC r213431 Correct IOCTL return code. Modified: stable/8/sys/dev/usb/usb_dev.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/usb/usb_dev.c ============================================================================== --- stable/8/sys/dev/usb/usb_dev.c Sun Nov 28 07:19:11 2010 (r215984) +++ stable/8/sys/dev/usb/usb_dev.c Sun Nov 28 07:23:05 2010 (r215985) @@ -1479,7 +1479,7 @@ usb_static_ioctl(struct cdev *dev, u_lon struct usb_read_dir *urd; void* data; } u; - int err = ENOTTY; + int err; u.data = data; switch (cmd) { @@ -1495,6 +1495,7 @@ usb_static_ioctl(struct cdev *dev, u_lon break; case USB_GET_TEMPLATE: *(int *)data = usb_template; + err = 0; break; case USB_SET_TEMPLATE: err = priv_check(curthread, PRIV_DRIVER); @@ -1502,6 +1503,9 @@ usb_static_ioctl(struct cdev *dev, u_lon break; usb_template = *(int *)data; break; + default: + err = ENOTTY; + break; } return (err); } From owner-svn-src-stable-8@FreeBSD.ORG Sun Nov 28 07:28:11 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2E1E9106564A; Sun, 28 Nov 2010 07:28:11 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1A60E8FC0A; Sun, 28 Nov 2010 07:28:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAS7SBaX071637; Sun, 28 Nov 2010 07:28:11 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAS7SAHp071635; Sun, 28 Nov 2010 07:28:10 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201011280728.oAS7SAHp071635@svn.freebsd.org> From: Andrew Thompson Date: Sun, 28 Nov 2010 07:28:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215986 - stable/8/sys/dev/usb/serial X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Nov 2010 07:28:11 -0000 Author: thompsa Date: Sun Nov 28 07:28:10 2010 New Revision: 215986 URL: http://svn.freebsd.org/changeset/base/215986 Log: MFC r213872 Fix forwarding of Line Register Status changes to TTY layer. PR: usb/149675 Modified: stable/8/sys/dev/usb/serial/usb_serial.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/usb/serial/usb_serial.c ============================================================================== --- stable/8/sys/dev/usb/serial/usb_serial.c Sun Nov 28 07:23:05 2010 (r215985) +++ stable/8/sys/dev/usb/serial/usb_serial.c Sun Nov 28 07:28:10 2010 (r215986) @@ -942,6 +942,7 @@ ucom_cfg_status_change(struct usb_proc_m uint8_t new_msr; uint8_t new_lsr; uint8_t onoff; + uint8_t lsr_delta; tp = sc->sc_tty; @@ -965,6 +966,7 @@ ucom_cfg_status_change(struct usb_proc_m return; } onoff = ((sc->sc_msr ^ new_msr) & SER_DCD); + lsr_delta = (sc->sc_lsr ^ new_lsr); sc->sc_msr = new_msr; sc->sc_lsr = new_lsr; @@ -977,6 +979,30 @@ ucom_cfg_status_change(struct usb_proc_m ttydisc_modem(tp, onoff); } + + if ((lsr_delta & ULSR_BI) && (sc->sc_lsr & ULSR_BI)) { + + DPRINTF("BREAK detected\n"); + + ttydisc_rint(tp, 0, TRE_BREAK); + ttydisc_rint_done(tp); + } + + if ((lsr_delta & ULSR_FE) && (sc->sc_lsr & ULSR_FE)) { + + DPRINTF("Frame error detected\n"); + + ttydisc_rint(tp, 0, TRE_FRAMING); + ttydisc_rint_done(tp); + } + + if ((lsr_delta & ULSR_PE) && (sc->sc_lsr & ULSR_PE)) { + + DPRINTF("Parity error detected\n"); + + ttydisc_rint(tp, 0, TRE_PARITY); + ttydisc_rint_done(tp); + } } void From owner-svn-src-stable-8@FreeBSD.ORG Sun Nov 28 07:29:57 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 397BA106566C; Sun, 28 Nov 2010 07:29:57 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2638B8FC23; Sun, 28 Nov 2010 07:29:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAS7Tvmr072002; Sun, 28 Nov 2010 07:29:57 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAS7TvNC071999; Sun, 28 Nov 2010 07:29:57 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201011280729.oAS7TvNC071999@svn.freebsd.org> From: Andrew Thompson Date: Sun, 28 Nov 2010 07:29:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215987 - stable/8/sys/dev/usb/storage X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Nov 2010 07:29:57 -0000 Author: thompsa Date: Sun Nov 28 07:29:56 2010 New Revision: 215987 URL: http://svn.freebsd.org/changeset/base/215987 Log: MFC r213931 (mav) Allow umass to use bigger transactions for USB 3.0 devices. Modified: stable/8/sys/dev/usb/storage/umass.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/usb/storage/umass.c ============================================================================== --- stable/8/sys/dev/usb/storage/umass.c Sun Nov 28 07:28:10 2010 (r215986) +++ stable/8/sys/dev/usb/storage/umass.c Sun Nov 28 07:29:56 2010 (r215987) @@ -2418,6 +2418,7 @@ umass_cam_action(struct cam_sim *sim, un case USB_SPEED_SUPER: cpi->base_transfer_speed = UMASS_SUPER_TRANSFER_SPEED; + cpi->maxio = MAXPHYS; break; case USB_SPEED_HIGH: cpi->base_transfer_speed = From owner-svn-src-stable-8@FreeBSD.ORG Sun Nov 28 09:52:07 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 26E14106566C; Sun, 28 Nov 2010 09:52:07 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ED92B8FC1E; Sun, 28 Nov 2010 09:52:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAS9q6Kf094506; Sun, 28 Nov 2010 09:52:06 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAS9q6l6094504; Sun, 28 Nov 2010 09:52:06 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201011280952.oAS9q6l6094504@svn.freebsd.org> From: Martin Matuska Date: Sun, 28 Nov 2010 09:52:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215992 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Nov 2010 09:52:07 -0000 Author: mm Date: Sun Nov 28 09:52:06 2010 New Revision: 215992 URL: http://svn.freebsd.org/changeset/base/215992 Log: MFC r213634, r213673: MFC r213634: Change FAPPEND to IO_APPEND as this is a ioflag and not a fflag. This corrects writing to append-only files on ZFS. MFC r213673 (pjd): Provide internal ioflags() function that converts ioflag provided by FreeBSD's VFS to OpenSolaris-specific ioflag expected by ZFS. Use it for read and write operations. PR: kern/149495 [1], kern/151082 [2] Submitted by: Daniel Zhelev [1], Michael Naef [2] Reviewed by: mm (r213673) Approved by: delphij (mentor) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sun Nov 28 09:35:56 2010 (r215991) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sun Nov 28 09:52:06 2010 (r215992) @@ -682,7 +682,7 @@ zfs_prefault_write(ssize_t n, struct uio * IN: vp - vnode of file to be written to. * uio - structure supplying write location, range info, * and data buffer. - * ioflag - IO_APPEND flag set if in append mode. + * ioflag - FAPPEND flag set if in append mode. * cr - credentials of caller. * ct - caller context (NFS/CIFS fem monitor only) * @@ -749,7 +749,7 @@ zfs_write(vnode_t *vp, uio_t *uio, int i /* * If in append mode, set the io offset pointer to eof. */ - if (ioflag & IO_APPEND) { + if (ioflag & FAPPEND) { /* * Range lock for a file append: * The value for the start of range will be determined by @@ -4176,6 +4176,21 @@ zfs_setsecattr(vnode_t *vp, vsecattr_t * } static int +ioflags(int ioflags) +{ + int flags = 0; + + if (ioflags & IO_APPEND) + flags |= FAPPEND; + if (ioflags & IO_NDELAY) + flags |= FNONBLOCK; + if (ioflags & IO_SYNC) + flags |= (FSYNC | FDSYNC | FRSYNC); + + return (flags); +} + +static int zfs_getpages(struct vnode *vp, vm_page_t *m, int count, int reqpage) { znode_t *zp = VTOZ(vp); @@ -4322,7 +4337,8 @@ zfs_freebsd_read(ap) } */ *ap; { - return (zfs_read(ap->a_vp, ap->a_uio, ap->a_ioflag, ap->a_cred, NULL)); + return (zfs_read(ap->a_vp, ap->a_uio, ioflags(ap->a_ioflag), + ap->a_cred, NULL)); } static int @@ -4335,7 +4351,8 @@ zfs_freebsd_write(ap) } */ *ap; { - return (zfs_write(ap->a_vp, ap->a_uio, ap->a_ioflag, ap->a_cred, NULL)); + return (zfs_write(ap->a_vp, ap->a_uio, ioflags(ap->a_ioflag), + ap->a_cred, NULL)); } static int From owner-svn-src-stable-8@FreeBSD.ORG Sun Nov 28 12:26:15 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B5EF71065679; Sun, 28 Nov 2010 12:26:15 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 89A698FC13; Sun, 28 Nov 2010 12:26:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oASCQFfL013713; Sun, 28 Nov 2010 12:26:15 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oASCQFnb013711; Sun, 28 Nov 2010 12:26:15 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201011281226.oASCQFnb013711@svn.freebsd.org> From: Andriy Gapon Date: Sun, 28 Nov 2010 12:26:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215995 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Nov 2010 12:26:15 -0000 Author: avg Date: Sun Nov 28 12:26:15 2010 New Revision: 215995 URL: http://svn.freebsd.org/changeset/base/215995 Log: MFC r215401: zfs+sendfile: populate all requested pages, not just those already cached Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sun Nov 28 11:02:18 2010 (r215994) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sun Nov 28 12:26:15 2010 (r215995) @@ -67,6 +67,7 @@ #include #include #include +#include /* * Programming rules. @@ -464,7 +465,7 @@ again: uiomove_fromphys(&m, off, bytes, uio); VM_OBJECT_LOCK(obj); vm_page_wakeup(m); - } else if (m != NULL && uio->uio_segflg == UIO_NOCOPY) { + } else if (uio->uio_segflg == UIO_NOCOPY) { /* * The code below is here to make sendfile(2) work * correctly with ZFS. As pointed out by ups@ @@ -474,9 +475,19 @@ again: */ KASSERT(off == 0, ("unexpected offset in mappedread for sendfile")); - if (vm_page_sleep_if_busy(m, FALSE, "zfsmrb")) + if (m != NULL && vm_page_sleep_if_busy(m, FALSE, "zfsmrb")) goto again; - vm_page_busy(m); + if (m == NULL) { + m = vm_page_alloc(obj, OFF_TO_IDX(start), + VM_ALLOC_NOBUSY | VM_ALLOC_NORMAL); + if (m == NULL) { + VM_OBJECT_UNLOCK(obj); + VM_WAIT; + VM_OBJECT_LOCK(obj); + goto again; + } + } + vm_page_io_start(m); VM_OBJECT_UNLOCK(obj); if (dirbytes > 0) { error = dmu_read_uio(os, zp->z_id, uio, @@ -494,7 +505,7 @@ again: VM_OBJECT_LOCK(obj); if (error == 0) m->valid = VM_PAGE_BITS_ALL; - vm_page_wakeup(m); + vm_page_io_finish(m); if (error == 0) { uio->uio_resid -= bytes; uio->uio_offset += bytes; From owner-svn-src-stable-8@FreeBSD.ORG Sun Nov 28 14:57:37 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B622D1065672; Sun, 28 Nov 2010 14:57:37 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A43708FC1B; Sun, 28 Nov 2010 14:57:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oASEvb6G022113; Sun, 28 Nov 2010 14:57:37 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oASEvb8C022111; Sun, 28 Nov 2010 14:57:37 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201011281457.oASEvb8C022111@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 28 Nov 2010 14:57:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215999 - stable/8/sys/netinet6 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Nov 2010 14:57:37 -0000 Author: bz Date: Sun Nov 28 14:57:37 2010 New Revision: 215999 URL: http://svn.freebsd.org/changeset/base/215999 Log: MFC r215418: No need to re-initialize the callout. We initially do it in in6_lltable_new() right after allocation. Worse, we are losing the right flags here. Modified: stable/8/sys/netinet6/nd6.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/netinet6/nd6.c ============================================================================== --- stable/8/sys/netinet6/nd6.c Sun Nov 28 14:55:00 2010 (r215998) +++ stable/8/sys/netinet6/nd6.c Sun Nov 28 14:57:37 2010 (r215999) @@ -847,10 +847,8 @@ nd6_lookup(struct in6_addr *addr6, int f llflags |= LLE_EXCLUSIVE; ln = lla_lookup(LLTABLE6(ifp), llflags, (struct sockaddr *)&sin6); - if ((ln != NULL) && (flags & LLE_CREATE)) { + if ((ln != NULL) && (flags & LLE_CREATE)) ln->ln_state = ND6_LLINFO_NOSTATE; - callout_init(&ln->ln_timer_ch, 0); - } return (ln); } From owner-svn-src-stable-8@FreeBSD.ORG Sun Nov 28 15:57:23 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4F0C0106564A; Sun, 28 Nov 2010 15:57:23 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3C8B38FC08; Sun, 28 Nov 2010 15:57:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oASFvNPW024732; Sun, 28 Nov 2010 15:57:23 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oASFvN87024730; Sun, 28 Nov 2010 15:57:23 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201011281557.oASFvN87024730@svn.freebsd.org> From: Marius Strobl Date: Sun, 28 Nov 2010 15:57:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216000 - stable/8/sys/dev/mii X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Nov 2010 15:57:23 -0000 Author: marius Date: Sun Nov 28 15:57:22 2010 New Revision: 216000 URL: http://svn.freebsd.org/changeset/base/216000 Log: MFC: r215905 Ensure Bay flow control is disabled as we're going to use IEEE 802.3 annex 31B full duplex flow control instead. Modified: stable/8/sys/dev/mii/inphy.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/mii/inphy.c ============================================================================== --- stable/8/sys/dev/mii/inphy.c Sun Nov 28 14:57:37 2010 (r215999) +++ stable/8/sys/dev/mii/inphy.c Sun Nov 28 15:57:22 2010 (r216000) @@ -77,6 +77,7 @@ DRIVER_MODULE(inphy, miibus, inphy_drive static int inphy_service(struct mii_softc *, struct mii_data *, int); static void inphy_status(struct mii_softc *); +static void inphy_reset(struct mii_softc *); static const struct mii_phydesc inphys[] = { MII_PHY_DESC(INTEL, I82553C), @@ -119,7 +120,7 @@ inphy_attach(device_t dev) IFM_MAKEWORD(IFM_ETHER, IFM_100_TX, IFM_LOOP, sc->mii_inst), MII_MEDIA_100_TX, NULL); - mii_phy_reset(sc); + inphy_reset(sc); sc->mii_capabilities = PHY_READ(sc, MII_BMSR) & ma->mii_capmask; device_printf(dev, " "); @@ -206,3 +207,14 @@ inphy_status(struct mii_softc *sc) } else mii->mii_media_active = ife->ifm_media; } + +static void +inphy_reset(struct mii_softc *sc) +{ + + mii_phy_reset(sc); + + /* Ensure Bay flow control is disabled. */ + PHY_WRITE(sc, MII_INPHY_SCR, + PHY_READ(sc, MII_INPHY_SCR) & ~SCR_FLOWCTL); +} From owner-svn-src-stable-8@FreeBSD.ORG Sun Nov 28 15:59:40 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0DB9B106564A; Sun, 28 Nov 2010 15:59:40 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EE9758FC17; Sun, 28 Nov 2010 15:59:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oASFxdXa024933; Sun, 28 Nov 2010 15:59:39 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oASFxdGS024929; Sun, 28 Nov 2010 15:59:39 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201011281559.oASFxdGS024929@svn.freebsd.org> From: Marius Strobl Date: Sun, 28 Nov 2010 15:59:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216002 - stable/8/sys/dev/fxp X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Nov 2010 15:59:40 -0000 Author: marius Date: Sun Nov 28 15:59:39 2010 New Revision: 216002 URL: http://svn.freebsd.org/changeset/base/216002 Log: MFC: r215906 Fix and implement missing parts of flow control support. This also removes the dev.fxp.%d.noflow tunable as the same effect can now be achieved with ifconfig(8) by setting the flowcontrol media option as desired (besides the tunable never having a chance to actually enable flow control support so far). In joint forces with: yongari Modified: stable/8/sys/dev/fxp/if_fxp.c stable/8/sys/dev/fxp/if_fxpreg.h stable/8/sys/dev/fxp/if_fxpvar.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/fxp/if_fxp.c ============================================================================== --- stable/8/sys/dev/fxp/if_fxp.c Sun Nov 28 15:57:26 2010 (r216001) +++ stable/8/sys/dev/fxp/if_fxp.c Sun Nov 28 15:59:39 2010 (r216002) @@ -224,7 +224,7 @@ static void fxp_rxcsum(struct fxp_softc static int fxp_intr_body(struct fxp_softc *sc, struct ifnet *ifp, uint8_t statack, int count); static void fxp_init(void *xsc); -static void fxp_init_body(struct fxp_softc *sc); +static void fxp_init_body(struct fxp_softc *sc, int); static void fxp_tick(void *xsc); static void fxp_start(struct ifnet *ifp); static void fxp_start_body(struct ifnet *ifp); @@ -261,6 +261,7 @@ static void fxp_serial_ifmedia_sts(stru static int fxp_miibus_readreg(device_t dev, int phy, int reg); static int fxp_miibus_writereg(device_t dev, int phy, int reg, int value); +static void fxp_miibus_statchg(device_t dev); static void fxp_load_ucode(struct fxp_softc *sc); static void fxp_update_stats(struct fxp_softc *sc); static void fxp_sysctl_node(struct fxp_softc *sc); @@ -286,6 +287,7 @@ static device_method_t fxp_methods[] = { /* MII interface */ DEVMETHOD(miibus_readreg, fxp_miibus_readreg), DEVMETHOD(miibus_writereg, fxp_miibus_writereg), + DEVMETHOD(miibus_statchg, fxp_miibus_statchg), { 0, 0 } }; @@ -329,8 +331,8 @@ fxp_scb_wait(struct fxp_softc *sc) while (CSR_READ_1(sc, FXP_CSR_SCB_COMMAND) && --i) DELAY(2); if (i == 0) { - flowctl.b[0] = CSR_READ_1(sc, FXP_CSR_FLOWCONTROL); - flowctl.b[1] = CSR_READ_1(sc, FXP_CSR_FLOWCONTROL + 1); + flowctl.b[0] = CSR_READ_1(sc, FXP_CSR_FC_THRESH); + flowctl.b[1] = CSR_READ_1(sc, FXP_CSR_FC_STATUS); device_printf(sc->dev, "SCB timeout: 0x%x 0x%x 0x%x 0x%x\n", CSR_READ_1(sc, FXP_CSR_SCB_COMMAND), CSR_READ_1(sc, FXP_CSR_SCB_STATACK), @@ -426,8 +428,7 @@ fxp_attach(device_t dev) uint32_t val; uint16_t data, myea[ETHER_ADDR_LEN / 2]; u_char eaddr[ETHER_ADDR_LEN]; - int i, pmc, prefer_iomap; - int error; + int error, flags, i, pmc, prefer_iomap; error = 0; sc = device_get_softc(dev); @@ -807,11 +808,14 @@ fxp_attach(device_t dev) /* * i82557 wedge when isolating all of their PHYs. */ + flags = MIIF_NOISOLATE; + if (sc->revision >= FXP_REV_82558_A4) + flags |= MIIF_DOPAUSE; error = mii_attach(dev, &sc->miibus, ifp, fxp_ifmedia_upd, fxp_ifmedia_sts, BMSR_DEFCAPMASK, MII_PHY_ANY, - MII_OFFSET_ANY, MIIF_NOISOLATE); + MII_OFFSET_ANY, flags); if (error != 0) { - device_printf(dev, "attaching PHYs failed\n"); + device_printf(dev, "attaching PHYs failed\n"); goto fail; } } @@ -894,7 +898,7 @@ fxp_attach(device_t dev) FXP_LOCK(sc); /* Clear wakeup events. */ CSR_WRITE_1(sc, FXP_CSR_PMDR, CSR_READ_1(sc, FXP_CSR_PMDR)); - fxp_init_body(sc); + fxp_init_body(sc, 1); fxp_stop(sc); FXP_UNLOCK(sc); } @@ -1056,7 +1060,7 @@ fxp_suspend(device_t dev) pmstat |= PCIM_PSTAT_PME | PCIM_PSTAT_PMEENABLE; sc->flags |= FXP_FLAG_WOL; /* Reconfigure hardware to accept magic frames. */ - fxp_init_body(sc); + fxp_init_body(sc, 1); } pci_write_config(sc->dev, pmc + PCIR_POWER_STATUS, pmstat, 2); } @@ -1098,7 +1102,7 @@ fxp_resume(device_t dev) /* reinitialize interface if necessary */ if (ifp->if_flags & IFF_UP) - fxp_init_body(sc); + fxp_init_body(sc, 1); sc->suspended = 0; @@ -2106,7 +2110,7 @@ fxp_tick(void *xsc) if (sc->rx_idle_secs > FXP_MAX_RX_IDLE) { sc->rx_idle_secs = 0; if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) - fxp_init_body(sc); + fxp_init_body(sc, 1); return; } /* @@ -2204,7 +2208,7 @@ fxp_watchdog(struct fxp_softc *sc) device_printf(sc->dev, "device timeout\n"); sc->ifp->if_oerrors++; - fxp_init_body(sc); + fxp_init_body(sc, 1); } /* @@ -2218,7 +2222,7 @@ fxp_init(void *xsc) struct fxp_softc *sc = xsc; FXP_LOCK(sc); - fxp_init_body(sc); + fxp_init_body(sc, 1); FXP_UNLOCK(sc); } @@ -2227,9 +2231,10 @@ fxp_init(void *xsc) * softc lock held. */ static void -fxp_init_body(struct fxp_softc *sc) +fxp_init_body(struct fxp_softc *sc, int setmedia) { struct ifnet *ifp = sc->ifp; + struct mii_data *mii; struct fxp_cb_config *cbp; struct fxp_cb_ias *cb_ias; struct fxp_cb_tx *tcbp; @@ -2364,7 +2369,7 @@ fxp_init_body(struct fxp_softc *sc) cbp->vlan_strip_en = ((sc->flags & FXP_FLAG_EXT_RFA) != 0 && (ifp->if_capenable & IFCAP_VLAN_HWTAGGING) != 0) ? 1 : 0; - if (sc->tunable_noflow || sc->revision == FXP_REV_82557) { + if (sc->revision == FXP_REV_82557) { /* * The 82557 has no hardware flow control, the values * below are the defaults for the chip. @@ -2378,12 +2383,30 @@ fxp_init_body(struct fxp_softc *sc) cbp->fc_filter = 0; cbp->pri_fc_loc = 1; } else { - cbp->fc_delay_lsb = 0x1f; - cbp->fc_delay_msb = 0x01; + /* Set pause RX FIFO threshold to 1KB. */ + CSR_WRITE_1(sc, FXP_CSR_FC_THRESH, 1); + /* Set pause time. */ + cbp->fc_delay_lsb = 0xff; + cbp->fc_delay_msb = 0xff; cbp->pri_fc_thresh = 3; - cbp->tx_fc_dis = 0; /* enable transmit FC */ - cbp->rx_fc_restop = 1; /* enable FC restop frames */ - cbp->rx_fc_restart = 1; /* enable FC restart frames */ + mii = device_get_softc(sc->miibus); + if ((IFM_OPTIONS(mii->mii_media_active) & + IFM_ETH_TXPAUSE) != 0) + /* enable transmit FC */ + cbp->tx_fc_dis = 0; + else + /* disable transmit FC */ + cbp->tx_fc_dis = 1; + if ((IFM_OPTIONS(mii->mii_media_active) & + IFM_ETH_RXPAUSE) != 0) { + /* enable FC restart/restop frames */ + cbp->rx_fc_restart = 1; + cbp->rx_fc_restop = 1; + } else { + /* disable FC restart/restop frames */ + cbp->rx_fc_restart = 0; + cbp->rx_fc_restop = 0; + } cbp->fc_filter = !prm; /* drop FC frames to host */ cbp->pri_fc_loc = 1; /* FC pri location (byte31) */ } @@ -2482,10 +2505,7 @@ fxp_init_body(struct fxp_softc *sc) CSR_WRITE_4(sc, FXP_CSR_SCB_GENERAL, sc->fxp_desc.rx_head->rx_addr); fxp_scb_cmd(sc, FXP_SCB_COMMAND_RU_START); - /* - * Set current media. - */ - if (sc->miibus != NULL) + if (sc->miibus != NULL && setmedia != 0) mii_mediachg(device_get_softc(sc->miibus)); ifp->if_drv_flags |= IFF_DRV_RUNNING; @@ -2742,6 +2762,31 @@ fxp_miibus_writereg(device_t dev, int ph return (0); } +static void +fxp_miibus_statchg(device_t dev) +{ + struct fxp_softc *sc; + struct mii_data *mii; + struct ifnet *ifp; + + sc = device_get_softc(dev); + mii = device_get_softc(sc->miibus); + ifp = sc->ifp; + if (mii == NULL || ifp == NULL || + (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || + (mii->mii_media_status & (IFM_AVALID | IFM_ACTIVE)) != + (IFM_AVALID | IFM_ACTIVE)) + return; + + /* + * Call fxp_init_body in order to adjust the flow control settings. + * Note that the 82557 doesn't support hardware flow control. + */ + if (sc->revision == FXP_REV_82557) + return; + fxp_init_body(sc, 0); +} + static int fxp_ioctl(struct ifnet *ifp, u_long command, caddr_t data) { @@ -2763,9 +2808,9 @@ fxp_ioctl(struct ifnet *ifp, u_long comm if (((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) && ((ifp->if_flags ^ sc->if_flags) & (IFF_PROMISC | IFF_ALLMULTI | IFF_LINK0)) != 0) - fxp_init_body(sc); + fxp_init_body(sc, 1); else if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) - fxp_init_body(sc); + fxp_init_body(sc, 1); } else { if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) fxp_stop(sc); @@ -2867,7 +2912,7 @@ fxp_ioctl(struct ifnet *ifp, u_long comm reinit++; } if (reinit > 0 && ifp->if_flags & IFF_UP) - fxp_init_body(sc); + fxp_init_body(sc, 1); FXP_UNLOCK(sc); VLAN_CAPABILITIES(ifp); break; @@ -3058,22 +3103,16 @@ fxp_sysctl_node(struct fxp_softc *sc) "FXP driver receive interrupt microcode bundle size limit"); SYSCTL_ADD_INT(ctx, child,OID_AUTO, "rnr", CTLFLAG_RD, &sc->rnr, 0, "FXP RNR events"); - SYSCTL_ADD_INT(ctx, child, - OID_AUTO, "noflow", CTLFLAG_RW, &sc->tunable_noflow, 0, - "FXP flow control disabled"); /* * Pull in device tunables. */ sc->tunable_int_delay = TUNABLE_INT_DELAY; sc->tunable_bundle_max = TUNABLE_BUNDLE_MAX; - sc->tunable_noflow = 1; (void) resource_int_value(device_get_name(sc->dev), device_get_unit(sc->dev), "int_delay", &sc->tunable_int_delay); (void) resource_int_value(device_get_name(sc->dev), device_get_unit(sc->dev), "bundle_max", &sc->tunable_bundle_max); - (void) resource_int_value(device_get_name(sc->dev), - device_get_unit(sc->dev), "noflow", &sc->tunable_noflow); sc->rnr = 0; hsp = &sc->fxp_hwstats; Modified: stable/8/sys/dev/fxp/if_fxpreg.h ============================================================================== --- stable/8/sys/dev/fxp/if_fxpreg.h Sun Nov 28 15:57:26 2010 (r216001) +++ stable/8/sys/dev/fxp/if_fxpreg.h Sun Nov 28 15:59:39 2010 (r216002) @@ -45,7 +45,8 @@ #define FXP_CSR_FLASHCONTROL 12 /* flash control (2 bytes) */ #define FXP_CSR_EEPROMCONTROL 14 /* eeprom control (2 bytes) */ #define FXP_CSR_MDICONTROL 16 /* mdi control (4 bytes) */ -#define FXP_CSR_FLOWCONTROL 0x19 /* flow control (2 bytes) */ +#define FXP_CSR_FC_THRESH 0x19 /* flow control (1 byte) */ +#define FXP_CSR_FC_STATUS 0x1A /* flow control status (1 byte) */ #define FXP_CSR_PMDR 0x1B /* power management driver (1 byte) */ #define FXP_CSR_GENCONTROL 0x1C /* general control (1 byte) */ Modified: stable/8/sys/dev/fxp/if_fxpvar.h ============================================================================== --- stable/8/sys/dev/fxp/if_fxpvar.h Sun Nov 28 15:57:26 2010 (r216001) +++ stable/8/sys/dev/fxp/if_fxpvar.h Sun Nov 28 15:59:39 2010 (r216002) @@ -210,7 +210,6 @@ struct fxp_softc { device_t dev; int tunable_int_delay; /* interrupt delay value for ucode */ int tunable_bundle_max; /* max # frames per interrupt (ucode) */ - int tunable_noflow; /* flow control disabled */ int rnr; /* RNR events */ int eeprom_size; /* size of serial EEPROM */ int suspended; /* 0 = normal 1 = suspended or dead */ From owner-svn-src-stable-8@FreeBSD.ORG Sun Nov 28 16:03:01 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EF20F1065672; Sun, 28 Nov 2010 16:03:01 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DCAFC8FC0C; Sun, 28 Nov 2010 16:03:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oASG31SE025349; Sun, 28 Nov 2010 16:03:01 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oASG31jT025347; Sun, 28 Nov 2010 16:03:01 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201011281603.oASG31jT025347@svn.freebsd.org> From: Marius Strobl Date: Sun, 28 Nov 2010 16:03:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216004 - stable/8/share/man/man4 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Nov 2010 16:03:02 -0000 Author: marius Date: Sun Nov 28 16:03:01 2010 New Revision: 216004 URL: http://svn.freebsd.org/changeset/base/216004 Log: MFC: r215907 Remove the description of the dev.fxp.%d.noflow tunable as it was removed in r215906 (MFC'ed to stable/8 in r216002) and the flowcontrol media option now should be set as desired via ifconfig(8) instead. Modified: stable/8/share/man/man4/fxp.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/fxp.4 ============================================================================== --- stable/8/share/man/man4/fxp.4 Sun Nov 28 15:59:45 2010 (r216003) +++ stable/8/share/man/man4/fxp.4 Sun Nov 28 16:03:01 2010 (r216004) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 12, 2010 +.Dd November 26, 2010 .Dt FXP 4 .Os .Sh NAME @@ -166,9 +166,6 @@ Number of packets that will be bundled, generated. This is only effective if the Intel microcode is loaded. The accepted range is 1 to 65535, the default is 6. -.It Va dev.fxp.%d.noflow -Controls whether flow control should be used or not. -The default is 1 (no flow control). .El .Sh SYSCTL VARIABLES The following variables are available as From owner-svn-src-stable-8@FreeBSD.ORG Sun Nov 28 16:09:37 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5CF3F106566C; Sun, 28 Nov 2010 16:09:37 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4A80D8FC19; Sun, 28 Nov 2010 16:09:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oASG9bGM025955; Sun, 28 Nov 2010 16:09:37 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oASG9blR025952; Sun, 28 Nov 2010 16:09:37 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201011281609.oASG9blR025952@svn.freebsd.org> From: Marius Strobl Date: Sun, 28 Nov 2010 16:09:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216006 - stable/8/sys/dev/mii X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Nov 2010 16:09:37 -0000 Author: marius Date: Sun Nov 28 16:09:36 2010 New Revision: 216006 URL: http://svn.freebsd.org/changeset/base/216006 Log: MFC: r215923 Allow pause support advertisement to be turned off again. Submitted by: yongari (ip1000phy(4)) Modified: stable/8/sys/dev/mii/e1000phy.c stable/8/sys/dev/mii/ip1000phy.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/mii/e1000phy.c ============================================================================== --- stable/8/sys/dev/mii/e1000phy.c Sun Nov 28 16:03:03 2010 (r216005) +++ stable/8/sys/dev/mii/e1000phy.c Sun Nov 28 16:09:36 2010 (r216006) @@ -498,6 +498,7 @@ e1000phy_mii_phy_auto(struct e1000phy_so sc = &esc->mii_sc; if ((sc->mii_flags & MIIF_HAVEFIBER) == 0) { reg = PHY_READ(sc, E1000_AR); + reg &= ~(E1000_AR_PAUSE | E1000_AR_ASM_DIR); reg |= E1000_AR_10T | E1000_AR_10T_FD | E1000_AR_100TX | E1000_AR_100TX_FD; if ((media & IFM_FLOW) != 0 || Modified: stable/8/sys/dev/mii/ip1000phy.c ============================================================================== --- stable/8/sys/dev/mii/ip1000phy.c Sun Nov 28 16:03:03 2010 (r216005) +++ stable/8/sys/dev/mii/ip1000phy.c Sun Nov 28 16:09:36 2010 (r216006) @@ -348,6 +348,7 @@ ip1000phy_mii_phy_auto(struct mii_softc reg = 0; if (isc->model == MII_MODEL_ICPLUS_IP1001) { reg = PHY_READ(sc, IP1000PHY_MII_ANAR); + reg &= ~(IP1000PHY_ANAR_PAUSE | IP1000PHY_ANAR_APAUSE); reg |= IP1000PHY_ANAR_NP; } reg |= IP1000PHY_ANAR_10T | IP1000PHY_ANAR_10T_FDX | From owner-svn-src-stable-8@FreeBSD.ORG Sun Nov 28 16:25:16 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C4DC1106564A; Sun, 28 Nov 2010 16:25:16 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B22658FC17; Sun, 28 Nov 2010 16:25:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oASGPGqh027217; Sun, 28 Nov 2010 16:25:16 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oASGPGCq027215; Sun, 28 Nov 2010 16:25:16 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201011281625.oASGPGCq027215@svn.freebsd.org> From: Colin Percival Date: Sun, 28 Nov 2010 16:25:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216008 - stable/8/sys/i386/conf X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Nov 2010 16:25:16 -0000 Author: cperciva Date: Sun Nov 28 16:25:16 2010 New Revision: 216008 URL: http://svn.freebsd.org/changeset/base/216008 Log: MFC r204157: Remove atkbd and friends, since they cause the XEN kernel to panic. PR: kern/148262, kern/149853 Modified: stable/8/sys/i386/conf/XEN Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/i386/conf/XEN ============================================================================== --- stable/8/sys/i386/conf/XEN Sun Nov 28 16:09:40 2010 (r216007) +++ stable/8/sys/i386/conf/XEN Sun Nov 28 16:25:16 2010 (r216008) @@ -66,12 +66,12 @@ options SMP # Symmetric MultiProcesso device apic # I/O APIC -device atkbdc # AT keyboard controller -device atkbd # AT keyboard +#device atkbdc # AT keyboard controller +#device atkbd # AT keyboard device psm # PS/2 mouse device pci -device kbdmux # keyboard multiplexer +#device kbdmux # keyboard multiplexer # Pseudo devices. device loop # Network loopback From owner-svn-src-stable-8@FreeBSD.ORG Sun Nov 28 16:31:39 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AFF171065672; Sun, 28 Nov 2010 16:31:39 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 841D48FC1D; Sun, 28 Nov 2010 16:31:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oASGVdwF027693; Sun, 28 Nov 2010 16:31:39 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oASGVdeA027691; Sun, 28 Nov 2010 16:31:39 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201011281631.oASGVdeA027691@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 28 Nov 2010 16:31:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216009 - stable/8/sys/netinet6 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Nov 2010 16:31:39 -0000 Author: bz Date: Sun Nov 28 16:31:39 2010 New Revision: 216009 URL: http://svn.freebsd.org/changeset/base/216009 Log: MFC r215423: Do not initialize flag variables before needed. Consistently use the LLE_ prefix for lla_lookup() and the ND6_ prefix for nd6_lookup() even though both are defined the same. Use the right flag variable when checking each. No real functional change. Modified: stable/8/sys/netinet6/nd6.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/netinet6/nd6.c ============================================================================== --- stable/8/sys/netinet6/nd6.c Sun Nov 28 16:25:16 2010 (r216008) +++ stable/8/sys/netinet6/nd6.c Sun Nov 28 16:31:39 2010 (r216009) @@ -832,7 +832,7 @@ nd6_lookup(struct in6_addr *addr6, int f { struct sockaddr_in6 sin6; struct llentry *ln; - int llflags = 0; + int llflags; bzero(&sin6, sizeof(sin6)); sin6.sin6_len = sizeof(struct sockaddr_in6); @@ -841,13 +841,14 @@ nd6_lookup(struct in6_addr *addr6, int f IF_AFDATA_LOCK_ASSERT(ifp); + llflags = 0; if (flags & ND6_CREATE) llflags |= LLE_CREATE; if (flags & ND6_EXCLUSIVE) llflags |= LLE_EXCLUSIVE; ln = lla_lookup(LLTABLE6(ifp), llflags, (struct sockaddr *)&sin6); - if ((ln != NULL) && (flags & LLE_CREATE)) + if ((ln != NULL) && (llflags & LLE_CREATE)) ln->ln_state = ND6_LLINFO_NOSTATE; return (ln); @@ -1384,7 +1385,7 @@ nd6_cache_lladdr(struct ifnet *ifp, stru int do_update; int olladdr; int llchange; - int flags = 0; + int flags; int newstate = 0; uint16_t router = 0; struct sockaddr_in6 sin6; @@ -1411,13 +1412,13 @@ nd6_cache_lladdr(struct ifnet *ifp, stru * Spec says nothing in sections for RA, RS and NA. There's small * description on it in NS section (RFC 2461 7.2.3). */ - flags |= lladdr ? ND6_EXCLUSIVE : 0; + flags = lladdr ? ND6_EXCLUSIVE : 0; IF_AFDATA_LOCK(ifp); ln = nd6_lookup(from, flags, ifp); if (ln == NULL) { - flags |= LLE_EXCLUSIVE; - ln = nd6_lookup(from, flags |ND6_CREATE, ifp); + flags |= ND6_EXCLUSIVE; + ln = nd6_lookup(from, flags | ND6_CREATE, ifp); IF_AFDATA_UNLOCK(ifp); is_newentry = 1; } else { From owner-svn-src-stable-8@FreeBSD.ORG Sun Nov 28 17:02:02 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CAC36106564A; Sun, 28 Nov 2010 17:02:02 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B84388FC14; Sun, 28 Nov 2010 17:02:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oASH22uu030198; Sun, 28 Nov 2010 17:02:02 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oASH22sp030196; Sun, 28 Nov 2010 17:02:02 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201011281702.oASH22sp030196@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 28 Nov 2010 17:02:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216010 - stable/8/sys/netinet6 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Nov 2010 17:02:02 -0000 Author: bz Date: Sun Nov 28 17:02:02 2010 New Revision: 216010 URL: http://svn.freebsd.org/changeset/base/216010 Log: MFC r215559: In case of an early return from the function there is no need to zero the route upfront, so defer as long as we can. Modified: stable/8/sys/netinet6/nd6_nbr.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/netinet6/nd6_nbr.c ============================================================================== --- stable/8/sys/netinet6/nd6_nbr.c Sun Nov 28 16:31:39 2010 (r216009) +++ stable/8/sys/netinet6/nd6_nbr.c Sun Nov 28 17:02:02 2010 (r216010) @@ -388,8 +388,6 @@ nd6_ns_output(struct ifnet *ifp, const s caddr_t mac; struct route_in6 ro; - bzero(&ro, sizeof(ro)); - if (IN6_IS_ADDR_MULTICAST(taddr6)) return; @@ -416,6 +414,8 @@ nd6_ns_output(struct ifnet *ifp, const s return; m->m_pkthdr.rcvif = NULL; + bzero(&ro, sizeof(ro)); + if (daddr6 == NULL || IN6_IS_ADDR_MULTICAST(daddr6)) { m->m_flags |= M_MCAST; im6o.im6o_multicast_ifp = ifp; From owner-svn-src-stable-8@FreeBSD.ORG Sun Nov 28 17:23:29 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 195BF106566C; Sun, 28 Nov 2010 17:23:29 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 06B0D8FC0C; Sun, 28 Nov 2010 17:23:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oASHNS8O032117; Sun, 28 Nov 2010 17:23:28 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oASHNS3a032116; Sun, 28 Nov 2010 17:23:28 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201011281723.oASHNS3a032116@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 28 Nov 2010 17:23:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216011 - stable/8/sys/net X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Nov 2010 17:23:29 -0000 Author: bz Date: Sun Nov 28 17:23:28 2010 New Revision: 216011 URL: http://svn.freebsd.org/changeset/base/216011 Log: MFC r215641: Add a missing ';' and change the debugging sysctl from xint to int. Submitted by: Mikolaj Golub (to.my.trociny gmail.com) Modified: stable/8/sys/net/if_epair.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/net/if_epair.c ============================================================================== --- stable/8/sys/net/if_epair.c Sun Nov 28 17:02:02 2010 (r216010) +++ stable/8/sys/net/if_epair.c Sun Nov 28 17:23:28 2010 (r216011) @@ -78,7 +78,7 @@ SYSCTL_NODE(_net_link, OID_AUTO, epair, #ifdef EPAIR_DEBUG static int epair_debug = 0; -SYSCTL_XINT(_net_link_epair, OID_AUTO, epair_debug, CTLFLAG_RW, +SYSCTL_INT(_net_link_epair, OID_AUTO, epair_debug, CTLFLAG_RW, &epair_debug, 0, "if_epair(4) debugging."); #define DPRINTF(fmt, arg...) \ if (epair_debug) \ @@ -311,7 +311,7 @@ epair_nh_drainedcpu(u_int cpuid) if ((ifp->if_drv_flags & IFF_DRV_OACTIVE) != 0) { /* Our "hw"q overflew again. */ - epair_dpcpu->epair_drv_flags |= IFF_DRV_OACTIVE + epair_dpcpu->epair_drv_flags |= IFF_DRV_OACTIVE; DPRINTF("hw queue length overflow at %u\n", epair_nh.nh_qlimit); break; From owner-svn-src-stable-8@FreeBSD.ORG Sun Nov 28 18:59:53 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 81459106564A; Sun, 28 Nov 2010 18:59:53 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6E27E8FC12; Sun, 28 Nov 2010 18:59:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oASIxrs4039263; Sun, 28 Nov 2010 18:59:53 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oASIxrgv039261; Sun, 28 Nov 2010 18:59:53 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201011281859.oASIxrgv039261@svn.freebsd.org> From: Colin Percival Date: Sun, 28 Nov 2010 18:59:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216015 - stable/8/sys/kern X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Nov 2010 18:59:53 -0000 Author: cperciva Date: Sun Nov 28 18:59:52 2010 New Revision: 216015 URL: http://svn.freebsd.org/changeset/base/216015 Log: MFC r215665,r215732: Don't lose seconds to integer overflow if we go more than one second between calls to tc_windup. Modified: stable/8/sys/kern/kern_tc.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/kern/kern_tc.c ============================================================================== --- stable/8/sys/kern/kern_tc.c Sun Nov 28 18:53:57 2010 (r216014) +++ stable/8/sys/kern/kern_tc.c Sun Nov 28 18:59:52 2010 (r216015) @@ -440,6 +440,16 @@ tc_windup(void) ncount = 0; th->th_offset_count += delta; th->th_offset_count &= th->th_counter->tc_counter_mask; + while (delta > th->th_counter->tc_frequency) { + /* Eat complete unadjusted seconds. */ + delta -= th->th_counter->tc_frequency; + th->th_offset.sec++; + } + if ((delta > th->th_counter->tc_frequency / 2) && + (th->th_scale * delta < ((uint64_t)1 << 63))) { + /* The product th_scale * delta just barely overflows. */ + th->th_offset.sec++; + } bintime_addx(&th->th_offset, th->th_scale * delta); /* From owner-svn-src-stable-8@FreeBSD.ORG Sun Nov 28 20:56:51 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F98A106564A; Sun, 28 Nov 2010 20:56:51 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7C9988FC16; Sun, 28 Nov 2010 20:56:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oASKupW4047158; Sun, 28 Nov 2010 20:56:51 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oASKupWi047155; Sun, 28 Nov 2010 20:56:51 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201011282056.oASKupWi047155@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 28 Nov 2010 20:56:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216017 - in stable/8/etc: defaults periodic/daily rc.d X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Nov 2010 20:56:51 -0000 Author: pjd Date: Sun Nov 28 20:56:51 2010 New Revision: 216017 URL: http://svn.freebsd.org/changeset/base/216017 Log: MFC r215799: Add gptboot_enable rc variable, which allows to turn gptboot reporting off in case user wants to implement his own actions and doesn't want the attributes to vanish. Obtained from: Wheel Systems Sp. z o.o. http://www.wheelsystems.com Modified: stable/8/etc/defaults/rc.conf stable/8/etc/rc.d/gptboot Directory Properties: stable/8/etc/ (props changed) stable/8/etc/periodic/daily/ (props changed) stable/8/etc/periodic/daily/800.scrub-zfs (props changed) stable/8/etc/periodic/security/ (props changed) Modified: stable/8/etc/defaults/rc.conf ============================================================================== --- stable/8/etc/defaults/rc.conf Sun Nov 28 19:26:20 2010 (r216016) +++ stable/8/etc/defaults/rc.conf Sun Nov 28 20:56:51 2010 (r216017) @@ -58,6 +58,8 @@ rc_conf_files="/etc/rc.conf /etc/rc.conf # ZFS support zfs_enable="NO" # Set to YES to automatically mount ZFS file systems +gptboot_enable="YES" # GPT boot success/failure reporting. + # Experimental - test before enabling gbde_autoattach_all="NO" # YES automatically mounts gbde devices from fstab gbde_devices="NO" # Devices to automatically attach (list, or AUTO) Modified: stable/8/etc/rc.d/gptboot ============================================================================== --- stable/8/etc/rc.d/gptboot Sun Nov 28 19:26:20 2010 (r216016) +++ stable/8/etc/rc.d/gptboot Sun Nov 28 20:56:51 2010 (r216017) @@ -34,6 +34,7 @@ . /etc/rc.subr name="gptboot" +rcvar=`set_rcvar` start_cmd="gptboot_report" gptboot_report() From owner-svn-src-stable-8@FreeBSD.ORG Sun Nov 28 22:07:09 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 30F001065670; Sun, 28 Nov 2010 22:07:09 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1C1C08FC15; Sun, 28 Nov 2010 22:07:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oASM79ls050479; Sun, 28 Nov 2010 22:07:09 GMT (envelope-from n_hibma@svn.freebsd.org) Received: (from n_hibma@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oASM791M050471; Sun, 28 Nov 2010 22:07:09 GMT (envelope-from n_hibma@svn.freebsd.org) Message-Id: <201011282207.oASM791M050471@svn.freebsd.org> From: Nick Hibma Date: Sun, 28 Nov 2010 22:07:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216018 - in stable/8: share/man/man4 sys/dev/usb/quirk sys/dev/usb/serial usr.sbin/usbconfig X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Nov 2010 22:07:09 -0000 Author: n_hibma Date: Sun Nov 28 22:07:08 2010 New Revision: 216018 URL: http://svn.freebsd.org/changeset/base/216018 Log: MFC r215095,215104: Add quirks for 3G MSC resets. Add a man page for the usb_quirks module. Added: stable/8/share/man/man4/usb_quirk.4 - copied unchanged from r215104, head/share/man/man4/usb_quirk.4 Modified: stable/8/share/man/man4/Makefile stable/8/share/man/man4/u3g.4 stable/8/sys/dev/usb/quirk/usb_quirk.c stable/8/sys/dev/usb/quirk/usb_quirk.h stable/8/sys/dev/usb/serial/u3g.c stable/8/usr.sbin/usbconfig/usbconfig.8 Directory Properties: stable/8/share/man/man4/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/usr.sbin/usbconfig/ (props changed) Modified: stable/8/share/man/man4/Makefile ============================================================================== --- stable/8/share/man/man4/Makefile Sun Nov 28 20:56:51 2010 (r216017) +++ stable/8/share/man/man4/Makefile Sun Nov 28 22:07:08 2010 (r216018) @@ -459,6 +459,7 @@ MAN= aac.4 \ urio.4 \ ${_urtw.4} \ usb.4 \ + usb_quirk.4 \ uslcom.4 \ utopia.4 \ uvisor.4 \ Modified: stable/8/share/man/man4/u3g.4 ============================================================================== --- stable/8/share/man/man4/u3g.4 Sun Nov 28 20:56:51 2010 (r216017) +++ stable/8/share/man/man4/u3g.4 Sun Nov 28 22:07:08 2010 (r216018) @@ -85,26 +85,19 @@ In some of these devices a mass storage .Xr umass 4 driver is present which contains Windows and Mac OS X drivers. The device starts up in disk mode (TruInstall, ZeroCD, etc.) and requires -additional commands to switch it to modem mode. +additional commands to switch it to modem mode. If your device is not +switching automatically, please try to add quirks. See +.Xr usbconfig 5 +and +.Xr usb_quirk 4 . .Pp -The -.Xr u3gstub 4 -device will attach temporarily to a 3G device with a mass storage device and -force it to switch to modem mode, -The attach and detach of -.Xr u3gstub -and any driver disk device present on the 3G device is hidden, unless the -machine was booted in verbose mode (see -.Xr boot 8 ) . -To temporarily unhide the device, set -.Va debug.bootverbose -to 1 using -.Xr sysctl 8 -and replug the device. .Sh SEE ALSO .Xr tty 4 , .Xr ucom 4 , -.Xr usb 4 +.XR u3g 4 , +.Xr usb 4 , +.Xr usb_quirk 4 , +.Xr usbconfig 5 .Sh HISTORY The .Nm Copied: stable/8/share/man/man4/usb_quirk.4 (from r215104, head/share/man/man4/usb_quirk.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/share/man/man4/usb_quirk.4 Sun Nov 28 22:07:08 2010 (r216018, copy of r215104, head/share/man/man4/usb_quirk.4) @@ -0,0 +1,196 @@ +.\" +.\" Copyright (c) 2010 AnyWi Technologies +.\" All rights reserved. +.\" +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +.\" +.\" $FreeBSD$ +.\" +.Dd November 9, 2010 +.Dt USB_QUIRK 4 +.Os +.Sh NAME +.Nm usb_quirk +.Nd USB quirks module +.Sh SYNOPSIS +To compile this module into the kernel, +place the following line in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device ucom" +.Ed +.Pp +Alternatively, to load the module at boot +time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +usb_quirk_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +module provides support for dynamically adding and removing quirks for +USB devices with +.Xr usbconfig 5 . +.Sh General quirks: +.Bl -tag -width Ds +.It UQ_AUDIO_SWAP_LR +swap left and right channels +.It UQ_AU_INP_ASYNC +input is async despite claim of adaptive +.It UQ_AU_NO_FRAC +don't adjust for fractional samples +.It UQ_AU_NO_XU +audio device has broken extension unit +.It UQ_BAD_ADC +bad audio spec version number +.It UQ_BAD_AUDIO +device claims audio class, but isn't +.It UQ_BROKEN_BIDIR +printer has broken bidir mode +.It UQ_BUS_POWERED +device is bus powered, despite claim +.It UQ_HID_IGNORE +device should be ignored by hid class +.It UQ_KBD_IGNORE +device should be ignored by kbd class +.It UQ_KBD_BOOTPROTO +device should set the boot protocol +.It UQ_MS_BAD_CLASS +doesn't identify properly +.It UQ_MS_LEADING_BYTE +mouse sends an unknown leading byte +.It UQ_MS_REVZ +mouse has Z-axis reversed +.It UQ_NO_STRINGS +string descriptors are broken +.It UQ_OPEN_CLEARSTALL +device needs clear endpoint stall +.It UQ_POWER_CLAIM +hub lies about power status +.It UQ_SPUR_BUT_UP +spurious mouse button up events +.It UQ_SWAP_UNICODE +has some Unicode strings swapped +.It UQ_CFG_INDEX_1 +select configuration index 1 by default +.It UQ_CFG_INDEX_2 +select configuration index 2 by default +.It UQ_CFG_INDEX_3 +select configuration index 3 by default +.It UQ_CFG_INDEX_4 +select configuration index 4 by default +.It UQ_CFG_INDEX_0 +select configuration index 0 by default +.It UQ_ASSUME_CM_OVER_DATA +assume cm over data feature +.El +.Sh USB Mass Storage Quirks +.Bl -tag -width Ds +.It UQ_MSC_NO_TEST_UNIT_READY +send start/stop instead of TUR +.It UQ_MSC_NO_RS_CLEAR_UA +does not reset Unit Att. +.It UQ_MSC_NO_START_STOP +does not support start/stop +.It UQ_MSC_NO_GETMAXLUN +does not support get max LUN +.It UQ_MSC_NO_INQUIRY +fake generic inq response +.It UQ_MSC_NO_INQUIRY_EVPD +does not support inq EVPD +.It UQ_MSC_NO_SYNC_CACHE +does not support sync cache +.It UQ_MSC_SHUTTLE_INIT +requires Shuttle init sequence +.It UQ_MSC_ALT_IFACE_1 +switch to alternate interface 1 +.It UQ_MSC_FLOPPY_SPEED +does floppy speeds (20kb/s) +.It UQ_MSC_IGNORE_RESIDUE +gets residue wrong +.It UQ_MSC_WRONG_CSWSIG +uses wrong CSW signature +.It UQ_MSC_RBC_PAD_TO_12 +pad RBC requests to 12 bytes +.It UQ_MSC_READ_CAP_OFFBY1 +reports sector count, not max sec. +.It UQ_MSC_FORCE_SHORT_INQ +does not support full inq. +.It UQ_MSC_FORCE_WIRE_BBB +force BBB wire protocol +.It UQ_MSC_FORCE_WIRE_CBI +force CBI wire protocol +.It UQ_MSC_FORCE_WIRE_CBI_I +force CBI with int. wire protocol +.It UQ_MSC_FORCE_PROTO_SCSI +force SCSI command protocol +.It UQ_MSC_FORCE_PROTO_ATAPI +force ATAPI command protocol +.It UQ_MSC_FORCE_PROTO_UFI +force UFI command protocol +.It UQ_MSC_FORCE_PROTO_RBC +force RBC command protocol +.El +.Sh Mass Storage Change (u3g) quirks: +.Bl -tag -width Ds +.It UQ_MSC_EJECT_HUAWEI +ejects after Huawei USB command +.It UQ_MSC_EJECT_SIERRA +ejects after Sierra USB command +.It UQ_MSC_EJECT_SCSIEJECT +ejects after SCSI eject command +0x1b0000000200 +.It UQ_MSC_EJECT_REZERO +ejects after SCSI rezero command +0x010000000000 +.It UQ_MSC_EJECT_ZTESTOR +ejects after ZTE SCSI command +0x850101011801010101010000 +.It UQ_MSC_EJECT_CMOTECH +ejects after C-motech SCSI command +0xff52444556434847 +.It UQ_MSC_EJECT_WAIT +wait for the device to eject +.It UQ_MSC_EJECT_SAEL_M460 +ejects after Sael USB commands +.It UQ_MSC_EJECT_HUAWEISCSI +ejects after Huawei SCSI command +0x11060000000000000000000000000000 +.It UQ_MSC_EJECT_TCT +ejects after TCT SCSI command +0x06f504025270 +.El +See +.Pa /sys/dev/usb/quirk/usb_quirk.h +for the complete list of supported quirks. +.Sh EXAMPLES +After attaching a +.Nm u3g +device which appears as a USB device on +.Pa ugen0.3 : +.Bd -literal -offset indent +usbconfig -d ugen0.3 add_quirk UQ_MSC_EJECT_WAIT +.Ed +.Sh SEE ALSO +.Xr usb_quirk 4 , +.Xr usbconfig 5 +.Sh HISTORY +The +.Nm +module appeared in +.Fx 8.0 , +and was written by +.An Hans Petter Selasky Aq hselasky@FreeBSD.org . +This manual page was written by +.An Nick Hibma Aq n_hibma@FreeBSD.org . Modified: stable/8/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- stable/8/sys/dev/usb/quirk/usb_quirk.c Sun Nov 28 20:56:51 2010 (r216017) +++ stable/8/sys/dev/usb/quirk/usb_quirk.c Sun Nov 28 22:07:08 2010 (r216018) @@ -512,6 +512,16 @@ static const char *usb_quirk_str[USB_QUI [UQ_MSC_FORCE_PROTO_ATAPI] = "UQ_MSC_FORCE_PROTO_ATAPI", [UQ_MSC_FORCE_PROTO_UFI] = "UQ_MSC_FORCE_PROTO_UFI", [UQ_MSC_FORCE_PROTO_RBC] = "UQ_MSC_FORCE_PROTO_RBC", + [UQ_MSC_EJECT_HUAWEI] = "UQ_MSC_EJECT_HUAWEI", + [UQ_MSC_EJECT_SIERRA] = "UQ_MSC_EJECT_SIERRA", + [UQ_MSC_EJECT_SCSIEJECT] = "UQ_MSC_EJECT_SCSIEJECT", + [UQ_MSC_EJECT_REZERO] = "UQ_MSC_EJECT_REZERO", + [UQ_MSC_EJECT_ZTESTOR] = "UQ_MSC_EJECT_ZTESTOR", + [UQ_MSC_EJECT_CMOTECH] = "UQ_MSC_EJECT_CMOTECH", + [UQ_MSC_EJECT_WAIT] = "UQ_MSC_EJECT_WAIT", + [UQ_MSC_EJECT_SAEL_M460] = "UQ_MSC_EJECT_SAEL_M460", + [UQ_MSC_EJECT_HUAWEISCSI] = "UQ_MSC_EJECT_HUAWEISCSI", + [UQ_MSC_EJECT_TCT] = "UQ_MSC_EJECT_TCT", }; /*------------------------------------------------------------------------* Modified: stable/8/sys/dev/usb/quirk/usb_quirk.h ============================================================================== --- stable/8/sys/dev/usb/quirk/usb_quirk.h Sun Nov 28 20:56:51 2010 (r216017) +++ stable/8/sys/dev/usb/quirk/usb_quirk.h Sun Nov 28 22:07:08 2010 (r216018) @@ -27,11 +27,14 @@ #ifndef _USB_QUIRK_H_ #define _USB_QUIRK_H_ -/* NOTE: UQ_NONE is not a valid quirk */ -enum { /* keep in sync with usb_quirk_str table */ - UQ_NONE, +enum { + /* + * Keep in sync with theusb_quirk_str usb_quirk.c, and with the + * share/man/man4/usb_quirk.4 + */ + UQ_NONE, /* not a valid quirk */ - UQ_MATCH_VENDOR_ONLY, + UQ_MATCH_VENDOR_ONLY, /* match quirk on vendor only */ /* Various quirks */ @@ -59,31 +62,43 @@ enum { /* keep in sync with usb_quirk_st UQ_CFG_INDEX_3, /* select configuration index 3 by default */ UQ_CFG_INDEX_4, /* select configuration index 4 by default */ UQ_CFG_INDEX_0, /* select configuration index 0 by default */ - UQ_ASSUME_CM_OVER_DATA, /* modem device breaks on cm over data */ + UQ_ASSUME_CM_OVER_DATA, /* assume cm over data feature */ /* USB Mass Storage Quirks. See "storage/umass.c" for a detailed description. */ - UQ_MSC_NO_TEST_UNIT_READY, - UQ_MSC_NO_RS_CLEAR_UA, - UQ_MSC_NO_START_STOP, - UQ_MSC_NO_GETMAXLUN, - UQ_MSC_NO_INQUIRY, - UQ_MSC_NO_INQUIRY_EVPD, - UQ_MSC_NO_SYNC_CACHE, - UQ_MSC_SHUTTLE_INIT, - UQ_MSC_ALT_IFACE_1, - UQ_MSC_FLOPPY_SPEED, - UQ_MSC_IGNORE_RESIDUE, - UQ_MSC_WRONG_CSWSIG, - UQ_MSC_RBC_PAD_TO_12, - UQ_MSC_READ_CAP_OFFBY1, - UQ_MSC_FORCE_SHORT_INQ, - UQ_MSC_FORCE_WIRE_BBB, - UQ_MSC_FORCE_WIRE_CBI, - UQ_MSC_FORCE_WIRE_CBI_I, - UQ_MSC_FORCE_PROTO_SCSI, - UQ_MSC_FORCE_PROTO_ATAPI, - UQ_MSC_FORCE_PROTO_UFI, - UQ_MSC_FORCE_PROTO_RBC, + UQ_MSC_NO_TEST_UNIT_READY, /* send start/stop instead of TUR */ + UQ_MSC_NO_RS_CLEAR_UA, /* does not reset Unit Att. */ + UQ_MSC_NO_START_STOP, /* does not support start/stop */ + UQ_MSC_NO_GETMAXLUN, /* does not support get max LUN */ + UQ_MSC_NO_INQUIRY, /* fake generic inq response */ + UQ_MSC_NO_INQUIRY_EVPD, /* does not support inq EVPD */ + UQ_MSC_NO_SYNC_CACHE, /* does not support sync cache */ + UQ_MSC_SHUTTLE_INIT, /* requires Shuttle init sequence */ + UQ_MSC_ALT_IFACE_1, /* switch to alternate interface 1 */ + UQ_MSC_FLOPPY_SPEED, /* does floppy speeds (20kb/s) */ + UQ_MSC_IGNORE_RESIDUE, /* gets residue wrong */ + UQ_MSC_WRONG_CSWSIG, /* uses wrong CSW signature */ + UQ_MSC_RBC_PAD_TO_12, /* pad RBC requests to 12 bytes */ + UQ_MSC_READ_CAP_OFFBY1, /* reports sector count, not max sec. */ + UQ_MSC_FORCE_SHORT_INQ, /* does not support full inq. */ + UQ_MSC_FORCE_WIRE_BBB, /* force BBB wire protocol */ + UQ_MSC_FORCE_WIRE_CBI, /* force CBI wire protocol */ + UQ_MSC_FORCE_WIRE_CBI_I, /* force CBI with int. wire protocol */ + UQ_MSC_FORCE_PROTO_SCSI, /* force SCSI command protocol */ + UQ_MSC_FORCE_PROTO_ATAPI, /* force ATAPI command protocol */ + UQ_MSC_FORCE_PROTO_UFI, /* force UFI command protocol */ + UQ_MSC_FORCE_PROTO_RBC, /* force RBC command protocol */ + + /* Ejection of mass storage (driver disk) */ + UQ_MSC_EJECT_HUAWEI, /* ejects after Huawei USB command */ + UQ_MSC_EJECT_SIERRA, /* ejects after Sierra USB command */ + UQ_MSC_EJECT_SCSIEJECT, /* ejects after SCSI eject command */ + UQ_MSC_EJECT_REZERO, /* ejects after SCSI rezero command */ + UQ_MSC_EJECT_ZTESTOR, /* ejects after ZTE SCSI command */ + UQ_MSC_EJECT_CMOTECH, /* ejects after C-motech SCSI cmd */ + UQ_MSC_EJECT_WAIT, /* wait for the device to eject */ + UQ_MSC_EJECT_SAEL_M460, /* ejects after Sael USB commands */ + UQ_MSC_EJECT_HUAWEISCSI, /* ejects after Huawei SCSI command */ + UQ_MSC_EJECT_TCT, /* ejects after TCT SCSI command */ USB_QUIRK_MAX }; Modified: stable/8/sys/dev/usb/serial/u3g.c ============================================================================== --- stable/8/sys/dev/usb/serial/u3g.c Sun Nov 28 20:56:51 2010 (r216017) +++ stable/8/sys/dev/usb/serial/u3g.c Sun Nov 28 22:07:08 2010 (r216018) @@ -62,6 +62,7 @@ #include #include +#include #ifdef USB_DEBUG static int u3g_debug = 0; @@ -84,6 +85,7 @@ SYSCTL_INT(_hw_usb_u3g, OID_AUTO, debug, #define U3GSP_HSPA 6 #define U3GSP_MAX 7 +/* Eject methods; See also usb_quirks.h:UQ_MSC_EJECT_* */ #define U3GINIT_HUAWEI 1 /* Requires Huawei init command */ #define U3GINIT_SIERRA 2 /* Requires Sierra init command */ #define U3GINIT_SCSIEJECT 3 /* Requires SCSI eject command */ @@ -643,6 +645,7 @@ u3g_test_autoinst(void *arg, struct usb_ struct usb_interface *iface; struct usb_interface_descriptor *id; int error; + unsigned long method; if (uaa->dev_state != UAA_DEV_READY) return; @@ -653,10 +656,37 @@ u3g_test_autoinst(void *arg, struct usb_ id = iface->idesc; if (id == NULL || id->bInterfaceClass != UICLASS_MASS) return; - if (usbd_lookup_id_by_uaa(u3g_devs, sizeof(u3g_devs), uaa)) + + if (usb_test_quirk(uaa, UQ_MSC_EJECT_HUAWEI)) + method = U3GINIT_HUAWEI; + else if (usb_test_quirk(uaa, UQ_MSC_EJECT_SIERRA)) + method = U3GINIT_SIERRA; + else if (usb_test_quirk(uaa, UQ_MSC_EJECT_SCSIEJECT)) + method = U3GINIT_SCSIEJECT; + else if (usb_test_quirk(uaa, UQ_MSC_EJECT_REZERO)) + method = U3GINIT_REZERO; + else if (usb_test_quirk(uaa, UQ_MSC_EJECT_ZTESTOR)) + method = U3GINIT_ZTESTOR; + else if (usb_test_quirk(uaa, UQ_MSC_EJECT_CMOTECH)) + method = U3GINIT_CMOTECH; + else if (usb_test_quirk(uaa, UQ_MSC_EJECT_WAIT)) + method = U3GINIT_WAIT; + else if (usb_test_quirk(uaa, UQ_MSC_EJECT_HUAWEISCSI)) + method = U3GINIT_HUAWEISCSI; + else if (usb_test_quirk(uaa, UQ_MSC_EJECT_TCT)) + method = U3GINIT_TCT; + else if (usbd_lookup_id_by_uaa(u3g_devs, sizeof(u3g_devs), uaa) == 0) + method = USB_GET_DRIVER_INFO(uaa); + else return; /* no device match */ - switch (USB_GET_DRIVER_INFO(uaa)) { + if (bootverbose) { + printf("Ejecting 0x%04x:0x%04x using method %ld\n", + uaa->info.idVendor, uaa->info.idProduct, + USB_GET_DRIVER_INFO(uaa)); + } + + switch (method) { case U3GINIT_HUAWEI: error = u3g_huawei_init(udev); break; @@ -747,8 +777,10 @@ u3g_attach(device_t dev) DPRINTF("sc=%p\n", sc); type = USB_GET_DRIVER_INFO(uaa); - if (type == U3GINIT_SAEL_M460) + if (type == U3GINIT_SAEL_M460 + || usb_test_quirk(uaa, UQ_MSC_EJECT_SAEL_M460)) { u3g_sael_m460_init(uaa->device); + } /* copy in USB config */ for (n = 0; n != U3G_N_TRANSFER; n++) Modified: stable/8/usr.sbin/usbconfig/usbconfig.8 ============================================================================== --- stable/8/usr.sbin/usbconfig/usbconfig.8 Sun Nov 28 20:56:51 2010 (r216017) +++ stable/8/usr.sbin/usbconfig/usbconfig.8 Sun Nov 28 22:07:08 2010 (r216018) @@ -92,5 +92,9 @@ Display a list of available quirk names: .Pp .Dl usbconfig dump_quirk_names .Pp +See +.Xr usb_quirk 4 +for more information on quirks. .Sh SEE ALSO -.Xr usb 4 +.Xr usb 4 , +.Xr usb_quirk 4 From owner-svn-src-stable-8@FreeBSD.ORG Mon Nov 29 01:28:13 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1AB05106564A; Mon, 29 Nov 2010 01:28:13 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 079DD8FC0A; Mon, 29 Nov 2010 01:28:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAT1SCZu075003; Mon, 29 Nov 2010 01:28:12 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAT1SCUd075000; Mon, 29 Nov 2010 01:28:12 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201011290128.oAT1SCUd075000@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 29 Nov 2010 01:28:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216023 - stable/8/sys/dev/alc X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Nov 2010 01:28:13 -0000 Author: yongari Date: Mon Nov 29 01:28:12 2010 New Revision: 216023 URL: http://svn.freebsd.org/changeset/base/216023 Log: MFC r215850: Enable ethernet flow-control on all alc(4) controllers. This change should reduce a lot of dropped frames under high network load. Modified: stable/8/sys/dev/alc/if_alc.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/alc/if_alc.c ============================================================================== --- stable/8/sys/dev/alc/if_alc.c Mon Nov 29 00:04:08 2010 (r216022) +++ stable/8/sys/dev/alc/if_alc.c Mon Nov 29 01:28:12 2010 (r216023) @@ -974,7 +974,7 @@ alc_attach(device_t dev) /* Set up MII bus. */ error = mii_attach(dev, &sc->alc_miibus, ifp, alc_mediachange, alc_mediastatus, BMSR_DEFCAPMASK, sc->alc_phyaddr, MII_OFFSET_ANY, - 0); + MIIF_DOPAUSE); if (error != 0) { device_printf(dev, "attaching PHYs failed\n"); goto fail; @@ -2475,12 +2475,10 @@ alc_mac_config(struct alc_softc *sc) } if ((IFM_OPTIONS(mii->mii_media_active) & IFM_FDX) != 0) { reg |= MAC_CFG_FULL_DUPLEX; -#ifdef notyet if ((IFM_OPTIONS(mii->mii_media_active) & IFM_ETH_TXPAUSE) != 0) reg |= MAC_CFG_TX_FC; if ((IFM_OPTIONS(mii->mii_media_active) & IFM_ETH_RXPAUSE) != 0) reg |= MAC_CFG_RX_FC; -#endif } CSR_WRITE_4(sc, ALC_MAC_CFG, reg); } From owner-svn-src-stable-8@FreeBSD.ORG Mon Nov 29 01:33:25 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 81D461065670; Mon, 29 Nov 2010 01:33:25 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6EE338FC08; Mon, 29 Nov 2010 01:33:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAT1XPqb075883; Mon, 29 Nov 2010 01:33:25 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAT1XPuO075881; Mon, 29 Nov 2010 01:33:25 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201011290133.oAT1XPuO075881@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 29 Nov 2010 01:33:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216025 - stable/8/sys/dev/jme X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Nov 2010 01:33:25 -0000 Author: yongari Date: Mon Nov 29 01:33:25 2010 New Revision: 216025 URL: http://svn.freebsd.org/changeset/base/216025 Log: MFC r215847: Disable retrying RX descriptor loading. The counter is used to set number of retry to be performed whenever controller found RX descriptor was empty. RX empty interrupt is generated only when the retry counter is over. Experimentation shows retrying RX descriptor loading increased number of dropped frames under flow-control enabled environments so disable it and have controller generate RX empty interrupt as fast as it can. While I'm here fix RXCSR_DESC_RT_CNT macro. Modified: stable/8/sys/dev/jme/if_jmereg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/jme/if_jmereg.h ============================================================================== --- stable/8/sys/dev/jme/if_jmereg.h Mon Nov 29 01:30:49 2010 (r216024) +++ stable/8/sys/dev/jme/if_jmereg.h Mon Nov 29 01:33:25 2010 (r216025) @@ -275,8 +275,8 @@ #define RXCSR_RXQ2 2 #define RXCSR_RXQ3 3 #define RXCSR_DESC_RT_CNT(x) \ - ((((x) / 4) << RXCSR_DESC_RT_CNT_SHIFT) & RXCSR_DESC_RT_CNT_MASK) -#define RXCSR_DESC_RT_CNT_DEFAULT 32 + (((x) << RXCSR_DESC_RT_CNT_SHIFT) & RXCSR_DESC_RT_CNT_MASK) +#define RXCSR_DESC_RT_CNT_DEFAULT 0 /* Rx queue descriptor base address. 16bytes alignment needed. */ #define JME_RXDBA_LO 0x0024 From owner-svn-src-stable-8@FreeBSD.ORG Mon Nov 29 01:36:16 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D25A106564A; Mon, 29 Nov 2010 01:36:16 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0A1A08FC12; Mon, 29 Nov 2010 01:36:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAT1aFw0076369; Mon, 29 Nov 2010 01:36:15 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAT1aFqk076367; Mon, 29 Nov 2010 01:36:15 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201011290136.oAT1aFqk076367@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 29 Nov 2010 01:36:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216027 - stable/8/sys/dev/jme X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Nov 2010 01:36:16 -0000 Author: yongari Date: Mon Nov 29 01:36:15 2010 New Revision: 216027 URL: http://svn.freebsd.org/changeset/base/216027 Log: MFC r215848: Allocate 1 MSI/MSI-X vector. Originally jme(4) was designed to support multi-queue but the hardware limitation made it hard to implement supporting multi-queue. Allocating more than necessary vectors is resource waste and it can be added back when we implement multi-queue support. Modified: stable/8/sys/dev/jme/if_jme.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/jme/if_jme.c ============================================================================== --- stable/8/sys/dev/jme/if_jme.c Mon Nov 29 01:34:43 2010 (r216026) +++ stable/8/sys/dev/jme/if_jme.c Mon Nov 29 01:36:15 2010 (r216027) @@ -201,13 +201,6 @@ static struct resource_spec jme_irq_spec static struct resource_spec jme_irq_spec_msi[] = { { SYS_RES_IRQ, 1, RF_ACTIVE }, - { SYS_RES_IRQ, 2, RF_ACTIVE }, - { SYS_RES_IRQ, 3, RF_ACTIVE }, - { SYS_RES_IRQ, 4, RF_ACTIVE }, - { SYS_RES_IRQ, 5, RF_ACTIVE }, - { SYS_RES_IRQ, 6, RF_ACTIVE }, - { SYS_RES_IRQ, 7, RF_ACTIVE }, - { SYS_RES_IRQ, 8, RF_ACTIVE }, { -1, 0, 0 } }; @@ -586,11 +579,16 @@ jme_attach(device_t dev) device_printf(dev, "MSI count : %d\n", msic); } + /* Use 1 MSI/MSI-X. */ + if (msixc > 1) + msixc = 1; + if (msic > 1) + msic = 1; /* Prefer MSIX over MSI. */ if (msix_disable == 0 || msi_disable == 0) { - if (msix_disable == 0 && msixc == JME_MSIX_MESSAGES && + if (msix_disable == 0 && msixc > 0 && pci_alloc_msix(dev, &msixc) == 0) { - if (msic == JME_MSIX_MESSAGES) { + if (msixc == 1) { device_printf(dev, "Using %d MSIX messages.\n", msixc); sc->jme_flags |= JME_FLAG_MSIX; @@ -599,9 +597,8 @@ jme_attach(device_t dev) pci_release_msi(dev); } if (msi_disable == 0 && (sc->jme_flags & JME_FLAG_MSIX) == 0 && - msic == JME_MSI_MESSAGES && - pci_alloc_msi(dev, &msic) == 0) { - if (msic == JME_MSI_MESSAGES) { + msic > 0 && pci_alloc_msi(dev, &msic) == 0) { + if (msic == 1) { device_printf(dev, "Using %d MSI messages.\n", msic); sc->jme_flags |= JME_FLAG_MSI; @@ -794,13 +791,7 @@ jme_attach(device_t dev) taskqueue_start_threads(&sc->jme_tq, 1, PI_NET, "%s taskq", device_get_nameunit(sc->jme_dev)); - if ((sc->jme_flags & JME_FLAG_MSIX) != 0) - msic = JME_MSIX_MESSAGES; - else if ((sc->jme_flags & JME_FLAG_MSI) != 0) - msic = JME_MSI_MESSAGES; - else - msic = 1; - for (i = 0; i < msic; i++) { + for (i = 0; i < 1; i++) { error = bus_setup_intr(dev, sc->jme_irq[i], INTR_TYPE_NET | INTR_MPSAFE, jme_intr, NULL, sc, &sc->jme_intrhand[i]); @@ -828,7 +819,7 @@ jme_detach(device_t dev) { struct jme_softc *sc; struct ifnet *ifp; - int i, msic; + int i; sc = device_get_softc(dev); @@ -863,14 +854,7 @@ jme_detach(device_t dev) sc->jme_ifp = NULL; } - msic = 1; - if ((sc->jme_flags & JME_FLAG_MSIX) != 0) - msic = JME_MSIX_MESSAGES; - else if ((sc->jme_flags & JME_FLAG_MSI) != 0) - msic = JME_MSI_MESSAGES; - else - msic = 1; - for (i = 0; i < msic; i++) { + for (i = 0; i < 1; i++) { if (sc->jme_intrhand[i] != NULL) { bus_teardown_intr(dev, sc->jme_irq[i], sc->jme_intrhand[i]); From owner-svn-src-stable-8@FreeBSD.ORG Mon Nov 29 01:38:42 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 31CC9106564A; Mon, 29 Nov 2010 01:38:42 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1EC248FC08; Mon, 29 Nov 2010 01:38:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAT1cgrZ076713; Mon, 29 Nov 2010 01:38:42 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAT1cgaY076711; Mon, 29 Nov 2010 01:38:42 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201011290138.oAT1cgaY076711@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 29 Nov 2010 01:38:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216029 - stable/8/sys/dev/jme X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Nov 2010 01:38:42 -0000 Author: yongari Date: Mon Nov 29 01:38:41 2010 New Revision: 216029 URL: http://svn.freebsd.org/changeset/base/216029 Log: MFC r215849: Enable ethernet flow-control on all jme(4) controllers. Modified: stable/8/sys/dev/jme/if_jme.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/jme/if_jme.c ============================================================================== --- stable/8/sys/dev/jme/if_jme.c Mon Nov 29 01:37:27 2010 (r216028) +++ stable/8/sys/dev/jme/if_jme.c Mon Nov 29 01:38:41 2010 (r216029) @@ -740,7 +740,7 @@ jme_attach(device_t dev) /* Set up MII bus. */ error = mii_attach(dev, &sc->jme_miibus, ifp, jme_mediachange, jme_mediastatus, BMSR_DEFCAPMASK, sc->jme_phyaddr, MII_OFFSET_ANY, - 0); + MIIF_DOPAUSE); if (error != 0) { device_printf(dev, "attaching PHYs failed\n"); goto fail; @@ -2024,12 +2024,10 @@ jme_mac_config(struct jme_softc *sc) txmac &= ~(TXMAC_COLL_ENB | TXMAC_CARRIER_SENSE | TXMAC_BACKOFF | TXMAC_CARRIER_EXT | TXMAC_FRAME_BURST); -#ifdef notyet if ((IFM_OPTIONS(mii->mii_media_active) & IFM_ETH_TXPAUSE) != 0) txpause |= TXPFC_PAUSE_ENB; if ((IFM_OPTIONS(mii->mii_media_active) & IFM_ETH_RXPAUSE) != 0) rxmac |= RXMAC_FC_ENB; -#endif /* Disable retry transmit timer/retry limit. */ CSR_WRITE_4(sc, JME_TXTRHD, CSR_READ_4(sc, JME_TXTRHD) & ~(TXTRHD_RT_PERIOD_ENB | TXTRHD_RT_LIMIT_ENB)); From owner-svn-src-stable-8@FreeBSD.ORG Mon Nov 29 01:41:56 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 99A9F106566B; Mon, 29 Nov 2010 01:41:56 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 86B678FC13; Mon, 29 Nov 2010 01:41:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAT1fuBq077129; Mon, 29 Nov 2010 01:41:56 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAT1fu81077127; Mon, 29 Nov 2010 01:41:56 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201011290141.oAT1fu81077127@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 29 Nov 2010 01:41:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216031 - stable/8/sys/dev/re X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Nov 2010 01:41:56 -0000 Author: yongari Date: Mon Nov 29 01:41:56 2010 New Revision: 216031 URL: http://svn.freebsd.org/changeset/base/216031 Log: MFC r215329: Add flow control for all re(4) controllers. re(4) controllers do not provide any MAC configuration interface for resolved flow control parameters. There is even no register that configures water mark which will control generation of pause frames. However enabling flow control surely enhanced performance a lot. Modified: stable/8/sys/dev/re/if_re.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/re/if_re.c ============================================================================== --- stable/8/sys/dev/re/if_re.c Mon Nov 29 01:39:46 2010 (r216030) +++ stable/8/sys/dev/re/if_re.c Mon Nov 29 01:41:56 2010 (r216031) @@ -1449,7 +1449,7 @@ re_attach(device_t dev) if (sc->rl_type == RL_8169) phy = 1; error = mii_attach(dev, &sc->rl_miibus, ifp, re_ifmedia_upd, - re_ifmedia_sts, BMSR_DEFCAPMASK, phy, MII_OFFSET_ANY, 0); + re_ifmedia_sts, BMSR_DEFCAPMASK, phy, MII_OFFSET_ANY, MIIF_DOPAUSE); if (error != 0) { device_printf(dev, "attaching PHYs failed\n"); goto fail; From owner-svn-src-stable-8@FreeBSD.ORG Mon Nov 29 01:45:26 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EDB1D1065674; Mon, 29 Nov 2010 01:45:25 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C08628FC20; Mon, 29 Nov 2010 01:45:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAT1jPNi077653; Mon, 29 Nov 2010 01:45:25 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAT1jPj5077650; Mon, 29 Nov 2010 01:45:25 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201011290145.oAT1jPj5077650@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 29 Nov 2010 01:45:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216033 - stable/8/sys/dev/xl X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Nov 2010 01:45:26 -0000 Author: yongari Date: Mon Nov 29 01:45:25 2010 New Revision: 216033 URL: http://svn.freebsd.org/changeset/base/216033 Log: MFC r215328: Add flow control for 3C905B and newer controllers. Note, these controllers support RX pause only. Reviewed by: marius Modified: stable/8/sys/dev/xl/if_xl.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/xl/if_xl.c ============================================================================== --- stable/8/sys/dev/xl/if_xl.c Mon Nov 29 01:43:17 2010 (r216032) +++ stable/8/sys/dev/xl/if_xl.c Mon Nov 29 01:45:25 2010 (r216033) @@ -555,6 +555,7 @@ xl_miibus_statchg(device_t dev) { struct xl_softc *sc; struct mii_data *mii; + uint8_t macctl; sc = device_get_softc(dev); mii = device_get_softc(sc->xl_miibus); @@ -563,11 +564,22 @@ xl_miibus_statchg(device_t dev) /* Set ASIC's duplex mode to match the PHY. */ XL_SEL_WIN(3); - if ((mii->mii_media_active & IFM_GMASK) == IFM_FDX) - CSR_WRITE_1(sc, XL_W3_MAC_CTRL, XL_MACCTRL_DUPLEX); - else - CSR_WRITE_1(sc, XL_W3_MAC_CTRL, - (CSR_READ_1(sc, XL_W3_MAC_CTRL) & ~XL_MACCTRL_DUPLEX)); + macctl = CSR_READ_1(sc, XL_W3_MAC_CTRL); + if ((IFM_OPTIONS(mii->mii_media_active) & IFM_FDX) != 0) { + macctl |= XL_MACCTRL_DUPLEX; + if (sc->xl_type == XL_TYPE_905B) { + if ((IFM_OPTIONS(mii->mii_media_active) & + IFM_ETH_RXPAUSE) != 0) + macctl |= XL_MACCTRL_FLOW_CONTROL_ENB; + else + macctl &= ~XL_MACCTRL_FLOW_CONTROL_ENB; + } + } else { + macctl &= ~XL_MACCTRL_DUPLEX; + if (sc->xl_type == XL_TYPE_905B) + macctl &= ~XL_MACCTRL_FLOW_CONTROL_ENB; + } + CSR_WRITE_1(sc, XL_W3_MAC_CTRL, macctl); } /* @@ -1464,7 +1476,8 @@ xl_attach(device_t dev) if ((sc->xl_flags & XL_FLAG_PHYOK) == 0) phy = 24; error = mii_attach(dev, &sc->xl_miibus, ifp, xl_ifmedia_upd, - xl_ifmedia_sts, BMSR_DEFCAPMASK, phy, MII_OFFSET_ANY, 0); + xl_ifmedia_sts, BMSR_DEFCAPMASK, phy, MII_OFFSET_ANY, + sc->xl_type == XL_TYPE_905B ? MIIF_DOPAUSE : 0); if (error != 0) { device_printf(dev, "attaching PHYs failed\n"); goto fail; From owner-svn-src-stable-8@FreeBSD.ORG Mon Nov 29 03:38:41 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 35A55106564A; Mon, 29 Nov 2010 03:38:41 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 21A158FC16; Mon, 29 Nov 2010 03:38:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAT3cfHm089021; Mon, 29 Nov 2010 03:38:41 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAT3cfOu089018; Mon, 29 Nov 2010 03:38:41 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201011290338.oAT3cfOu089018@svn.freebsd.org> From: Andrew Thompson Date: Mon, 29 Nov 2010 03:38:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216035 - in stable/8/sys/dev/usb: . serial X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Nov 2010 03:38:41 -0000 Author: thompsa Date: Mon Nov 29 03:38:40 2010 New Revision: 216035 URL: http://svn.freebsd.org/changeset/base/216035 Log: MFC r214726,214852,215258,215734 Sync all u3g device ids from head. Modified: stable/8/sys/dev/usb/serial/u3g.c stable/8/sys/dev/usb/usbdevs Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/usb/serial/u3g.c ============================================================================== --- stable/8/sys/dev/usb/serial/u3g.c Mon Nov 29 01:50:58 2010 (r216034) +++ stable/8/sys/dev/usb/serial/u3g.c Mon Nov 29 03:38:40 2010 (r216035) @@ -281,16 +281,19 @@ static const struct usb_device_id u3g_de U3G_DEV(HUAWEI, E143D, U3GINIT_HUAWEI), U3G_DEV(HUAWEI, E143E, U3GINIT_HUAWEI), U3G_DEV(HUAWEI, E143F, U3GINIT_HUAWEI), - U3G_DEV(HUAWEI, E14AC, U3GINIT_HUAWEI), U3G_DEV(HUAWEI, E180V, U3GINIT_HUAWEI), U3G_DEV(HUAWEI, E220, U3GINIT_HUAWEI), U3G_DEV(HUAWEI, E220BIS, U3GINIT_HUAWEI), U3G_DEV(HUAWEI, MOBILE, U3GINIT_HUAWEI), U3G_DEV(HUAWEI, E1752, U3GINIT_HUAWEISCSI), + U3G_DEV(HUAWEI, E1820, U3GINIT_HUAWEISCSI), U3G_DEV(HUAWEI, K3765, U3GINIT_HUAWEI), + U3G_DEV(HUAWEI, K3765_INIT, U3GINIT_HUAWEISCSI), U3G_DEV(KYOCERA2, CDMA_MSM_K, 0), U3G_DEV(KYOCERA2, KPC680, 0), U3G_DEV(LONGCHEER, WM66, U3GINIT_HUAWEI), + U3G_DEV(LONGCHEER, DISK, U3GINIT_TCT), + U3G_DEV(LONGCHEER, W14, 0), U3G_DEV(MERLIN, V620, 0), U3G_DEV(NEOTEL, PRIME, 0), U3G_DEV(NOVATEL, E725, 0), @@ -413,7 +416,6 @@ static const struct usb_device_id u3g_de U3G_DEV(QUALCOMMINC, E0078, 0), U3G_DEV(QUALCOMMINC, E0082, 0), U3G_DEV(QUALCOMMINC, E0086, 0), - U3G_DEV(QUALCOMMINC, E2000, U3GINIT_SCSIEJECT), U3G_DEV(QUALCOMMINC, E2002, 0), U3G_DEV(QUALCOMMINC, E2003, 0), U3G_DEV(QUALCOMMINC, MF626, 0), @@ -700,7 +702,8 @@ u3g_test_autoinst(void *arg, struct usb_ error = usb_msc_eject(udev, 0, MSC_EJECT_REZERO); break; case U3GINIT_ZTESTOR: - error = usb_msc_eject(udev, 0, MSC_EJECT_ZTESTOR); + error = usb_msc_eject(udev, 0, MSC_EJECT_STOPUNIT); + error |= usb_msc_eject(udev, 0, MSC_EJECT_ZTESTOR); break; case U3GINIT_CMOTECH: error = usb_msc_eject(udev, 0, MSC_EJECT_CMOTECH); Modified: stable/8/sys/dev/usb/usbdevs ============================================================================== --- stable/8/sys/dev/usb/usbdevs Mon Nov 29 01:50:58 2010 (r216034) +++ stable/8/sys/dev/usb/usbdevs Mon Nov 29 03:38:40 2010 (r216035) @@ -1796,8 +1796,8 @@ product HTC LEGENDINTERNET 0x0ffe HTC Le /* HUAWEI products */ product HUAWEI MOBILE 0x1001 Huawei Mobile -product HUAWEI E220 0x1003 Huawei HSDPA modem -product HUAWEI E220BIS 0x1004 Huawei HSDPA modem +product HUAWEI E220 0x1003 HSDPA modem +product HUAWEI E220BIS 0x1004 HSDPA modem product HUAWEI E1401 0x1401 3G modem product HUAWEI E1402 0x1402 3G modem product HUAWEI E1403 0x1403 3G modem @@ -1809,7 +1809,7 @@ product HUAWEI E1408 0x1408 3G modem product HUAWEI E1409 0x1409 3G modem product HUAWEI E140A 0x140a 3G modem product HUAWEI E140B 0x140b 3G modem -product HUAWEI E180V 0x140c Huawei Mobile E180V +product HUAWEI E180V 0x140c E180V product HUAWEI E140D 0x140d 3G modem product HUAWEI E140E 0x140e 3G modem product HUAWEI E140F 0x140f 3G modem @@ -1863,8 +1863,8 @@ product HUAWEI E143E 0x143e 3G modem product HUAWEI E143F 0x143f 3G modem product HUAWEI E1752 0x1446 3G modem product HUAWEI K3765 0x1465 3G modem -product HUAWEI E14AC 0x14ac 3G modem -product HUAWEI K3765_INIT 0x1520 HUAWEI Mobile K3765 Initial +product HUAWEI E1820 0x14ac E1820 HSPA+ USB Slider +product HUAWEI K3765_INIT 0x1520 K3765 Initial /* HUAWEI 3com products */ product HUAWEI3COM WUB320G 0x0009 Aolynk WUB320g @@ -2094,7 +2094,10 @@ product LOGITEC RT2870_2 0x0163 RT2870 product LOGITEC RT2870_3 0x0164 RT2870 /* Longcheer Holdings, Ltd. products */ -product LONGCHEER WM66 0x6061 Longcheer WM66 HSDPA USB modem +product LONGCHEER WM66 0x6061 Longcheer WM66 HSDPA +product LONGCHEER W14 0x9603 Mobilcom W14 +product LONGCHEER DISK 0xf000 Driver disk + /* Lucent products */ product LUCENT EVALKIT 0x1001 USS-720 evaluation kit @@ -2620,15 +2623,11 @@ product QISDA H20_2 0x4519 3G modem /* Qualcomm products */ product QUALCOMM CDMA_MSM 0x6000 CDMA Technologies MSM phone +product QUALCOMM2 MF330 0x6613 MF330 product QUALCOMM2 RWT_FCT 0x3100 RWT FCT-CDMA 2000 1xRTT modem product QUALCOMM2 CDMA_MSM 0x3196 CDMA Technologies MSM modem product QUALCOMM2 AC8700 0x6000 AC8700 -product QUALCOMM2 MF330 0x6613 MF330 product QUALCOMMINC CDMA_MSM 0x0001 CDMA Technologies MSM modem -product QUALCOMMINC ZTE_STOR 0x2000 USB ZTE Storage -product QUALCOMMINC AC8710 0xfff1 3G modem -product QUALCOMMINC AC2726 0xfff5 3G modem -product QUALCOMMINC AC8700 0xfffe CDMA 1xEVDO USB modem product QUALCOMMINC E0002 0x0002 3G modem product QUALCOMMINC E0003 0x0003 3G modem product QUALCOMMINC E0004 0x0004 3G modem @@ -2694,9 +2693,12 @@ product QUALCOMMINC E0076 0x0076 3G mode product QUALCOMMINC E0078 0x0078 3G modem product QUALCOMMINC E0082 0x0082 3G modem product QUALCOMMINC E0086 0x0086 3G modem -product QUALCOMMINC E2000 0x2000 3G modem +product QUALCOMMINC ZTE_STOR 0x2000 USB ZTE Storage product QUALCOMMINC E2002 0x2002 3G modem product QUALCOMMINC E2003 0x2003 3G modem +product QUALCOMMINC AC8710 0xfff1 3G modem +product QUALCOMMINC AC2726 0xfff5 3G modem +product QUALCOMMINC AC8700 0xfffe CDMA 1xEVDO USB modem /* Quanta products */ product QUANTA RW6815_1 0x00ce HP iPAQ rw6815 @@ -3279,9 +3281,6 @@ product UMEDIA AR5523_2_NF 0x3206 AR5523 /* Universal Access products */ product UNIACCESS PANACHE 0x0101 Panache Surf USB ISDN Adapter -/* Unknown vendors */ -product UNKNOWN5 USB2IDEBRIDGE 0x00ff USB 2.0 ATA/SATA Bridge - /* USI products */ product USI MC60 0x10c5 MC60 Serial From owner-svn-src-stable-8@FreeBSD.ORG Mon Nov 29 04:25:44 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7EE80106566B; Mon, 29 Nov 2010 04:25:44 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6BF118FC08; Mon, 29 Nov 2010 04:25:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAT4Pip4091485; Mon, 29 Nov 2010 04:25:44 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAT4PiNS091483; Mon, 29 Nov 2010 04:25:44 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201011290425.oAT4PiNS091483@svn.freebsd.org> From: Matt Jacob Date: Mon, 29 Nov 2010 04:25:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216036 - stable/8/sys/dev/isp X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Nov 2010 04:25:44 -0000 Author: mjacob Date: Mon Nov 29 04:25:44 2010 New Revision: 216036 URL: http://svn.freebsd.org/changeset/base/216036 Log: This is an MFC of 215951 Partially revert 208119. We were overwriting tunable settings. Modified: stable/8/sys/dev/isp/isp_freebsd.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/8/sys/dev/isp/isp_freebsd.c Mon Nov 29 03:38:40 2010 (r216035) +++ stable/8/sys/dev/isp/isp_freebsd.c Mon Nov 29 04:25:44 2010 (r216036) @@ -141,9 +141,6 @@ isp_attach_chan(ispsoftc_t *isp, struct fc->path = path; fc->isp = isp; fc->ready = 1; - fc->gone_device_time = isp_gone_device_time; - fc->loop_down_limit = isp_loop_down_limit; - fc->hysteresis = isp_fabric_hysteresis; callout_init_mtx(&fc->ldt, &isp->isp_osinfo.lock, 0); callout_init_mtx(&fc->gdt, &isp->isp_osinfo.lock, 0); From owner-svn-src-stable-8@FreeBSD.ORG Mon Nov 29 04:29:36 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F0F95106566B; Mon, 29 Nov 2010 04:29:36 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DE3A18FC14; Mon, 29 Nov 2010 04:29:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAT4TaWF091775; Mon, 29 Nov 2010 04:29:36 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAT4TaDd091773; Mon, 29 Nov 2010 04:29:36 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201011290429.oAT4TaDd091773@svn.freebsd.org> From: Matt Jacob Date: Mon, 29 Nov 2010 04:29:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216037 - stable/8/sys/dev/isp X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Nov 2010 04:29:37 -0000 Author: mjacob Date: Mon Nov 29 04:29:36 2010 New Revision: 216037 URL: http://svn.freebsd.org/changeset/base/216037 Log: This is an MFC of 208542,208543 Treat PRLI the same as PLOGI and make a database entry for it (target mode). Modified: stable/8/sys/dev/isp/isp_freebsd.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/8/sys/dev/isp/isp_freebsd.c Mon Nov 29 04:25:44 2010 (r216036) +++ stable/8/sys/dev/isp/isp_freebsd.c Mon Nov 29 04:29:36 2010 (r216037) @@ -2603,7 +2603,14 @@ isp_handle_platform_notify_24xx(ispsoftc msg = "PRLO"; break; case PLOGI: - msg = "PLOGI"; + case PRLI: + /* + * Treat PRLI the same as PLOGI and make a database entry for it. + */ + if (inot->in_status_subcode == PLOGI) + msg = "PLOGI"; + else + msg = "PRLI"; if (ISP_FW_NEWER_THAN(isp, 4, 0, 25)) { ptr = (uint8_t *)inot; /* point to unswizzled entry! */ wwn = (((uint64_t) ptr[IN24XX_PLOGI_WWPN_OFF]) << 56) | @@ -2619,9 +2626,6 @@ isp_handle_platform_notify_24xx(ispsoftc } isp_add_wwn_entry(isp, chan, wwn, nphdl, portid); break; - case PRLI: - msg = "PRLI"; - break; case PDISC: msg = "PDISC"; break; From owner-svn-src-stable-8@FreeBSD.ORG Mon Nov 29 04:31:25 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B509C106564A; Mon, 29 Nov 2010 04:31:25 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A27108FC18; Mon, 29 Nov 2010 04:31:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAT4VP1u091955; Mon, 29 Nov 2010 04:31:25 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAT4VP1H091953; Mon, 29 Nov 2010 04:31:25 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201011290431.oAT4VP1H091953@svn.freebsd.org> From: Matt Jacob Date: Mon, 29 Nov 2010 04:31:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216038 - stable/8/sys/dev/isp X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Nov 2010 04:31:25 -0000 Author: mjacob Date: Mon Nov 29 04:31:25 2010 New Revision: 216038 URL: http://svn.freebsd.org/changeset/base/216038 Log: This is an MFC of 208548 Don't leak CCBs for every ABORT. Modified: stable/8/sys/dev/isp/isp_freebsd.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/8/sys/dev/isp/isp_freebsd.c Mon Nov 29 04:29:36 2010 (r216037) +++ stable/8/sys/dev/isp/isp_freebsd.c Mon Nov 29 04:31:25 2010 (r216038) @@ -4418,7 +4418,10 @@ isp_action(struct cam_sim *sim, union cc ccb->ccb_h.status = CAM_REQ_INVALID; break; } - xpt_done(ccb); + /* + * This is not a queued CCB, so the caller expects it to be + * complete when control is returned. + */ break; } #define IS_CURRENT_SETTINGS(c) (c->type == CTS_TYPE_CURRENT_SETTINGS) From owner-svn-src-stable-8@FreeBSD.ORG Mon Nov 29 04:57:47 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B71B106564A; Mon, 29 Nov 2010 04:57:47 +0000 (UTC) (envelope-from gad@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E2A1B8FC15; Mon, 29 Nov 2010 04:57:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAT4vkXr094572; Mon, 29 Nov 2010 04:57:46 GMT (envelope-from gad@svn.freebsd.org) Received: (from gad@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAT4vkPS094570; Mon, 29 Nov 2010 04:57:46 GMT (envelope-from gad@svn.freebsd.org) Message-Id: <201011290457.oAT4vkPS094570@svn.freebsd.org> From: Garance A Drosehn Date: Mon, 29 Nov 2010 04:57:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216039 - stable/8/usr.sbin/lpr/lpd X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Nov 2010 04:57:47 -0000 Author: gad Date: Mon Nov 29 04:57:46 2010 New Revision: 216039 URL: http://svn.freebsd.org/changeset/base/216039 Log: = MFC of r211190: - Improve the wait4data() routine so it behaves better when checking print-jobs which have last-modification times that are in the future. This shouldn't happen, of course, but it can. And when it did happen, the previous check could cause completely-spooled jobs to sit in the queue for 20 minutes per job. The new code waits until the last-modify time is not changing, instead of making decisions based on the specific value of last-modify. Modified: stable/8/usr.sbin/lpr/lpd/printjob.c Directory Properties: stable/8/usr.sbin/lpr/ (props changed) Modified: stable/8/usr.sbin/lpr/lpd/printjob.c ============================================================================== --- stable/8/usr.sbin/lpr/lpd/printjob.c Mon Nov 29 04:31:25 2010 (r216038) +++ stable/8/usr.sbin/lpr/lpd/printjob.c Mon Nov 29 04:57:46 2010 (r216039) @@ -1263,8 +1263,9 @@ wait4data(struct printer *pp, const char { const char *cp; int statres; + u_int sleepreq; size_t dlen, hlen; - time_t amtslept, checktime; + time_t amtslept, cur_time, prev_mtime; struct stat statdf; /* Skip these checks if the print job is from the local host. */ @@ -1297,15 +1298,30 @@ wait4data(struct printer *pp, const char /* * The file exists, so keep waiting until the data file has not - * changed for some reasonable amount of time. + * changed for some reasonable amount of time. Extra care is + * taken when computing wait-times, just in case there are data + * files with a last-modify time in the future. While that is + * very unlikely to happen, it can happen when the system has + * a flakey time-of-day clock. */ - while (statres == 0 && amtslept < MAXWAIT_4DATA) { - checktime = time(NULL) - MINWAIT_4DATA; - if (statdf.st_mtime <= checktime) - break; + prev_mtime = statdf.st_mtime; + cur_time = time(NULL); + if (statdf.st_mtime >= cur_time - MINWAIT_4DATA) { + if (statdf.st_mtime >= cur_time) /* some TOD oddity */ + sleepreq = MINWAIT_4DATA; + else + sleepreq = cur_time - statdf.st_mtime; if (amtslept == 0) pstatus(pp, "Waiting for data file from remote host"); - amtslept += MINWAIT_4DATA - sleep(MINWAIT_4DATA); + amtslept += sleepreq - sleep(sleepreq); + statres = stat(dfile, &statdf); + } + sleepreq = MINWAIT_4DATA; + while (statres == 0 && amtslept < MAXWAIT_4DATA) { + if (statdf.st_mtime == prev_mtime) + break; + prev_mtime = statdf.st_mtime; + amtslept += sleepreq - sleep(sleepreq); statres = stat(dfile, &statdf); } From owner-svn-src-stable-8@FreeBSD.ORG Mon Nov 29 08:04:11 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2086C1065693; Mon, 29 Nov 2010 08:04:11 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0E8788FC12; Mon, 29 Nov 2010 08:04:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAT84AKx012502; Mon, 29 Nov 2010 08:04:10 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAT84AXw012500; Mon, 29 Nov 2010 08:04:10 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201011290804.oAT84AXw012500@svn.freebsd.org> From: Attilio Rao Date: Mon, 29 Nov 2010 08:04:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216042 - stable/8/sys/kern X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Nov 2010 08:04:11 -0000 Author: attilio Date: Mon Nov 29 08:04:10 2010 New Revision: 216042 URL: http://svn.freebsd.org/changeset/base/216042 Log: MFC r215544,215683: Scan the list in reverse order for the shutdown handlers of loaded modules. This way, when there is a dependency between two modules, the handler of the latter probed runs first. Sponsored by: Sandvine Incorporated Modified: stable/8/sys/kern/kern_module.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/kern/kern_module.c ============================================================================== --- stable/8/sys/kern/kern_module.c Mon Nov 29 06:50:30 2010 (r216041) +++ stable/8/sys/kern/kern_module.c Mon Nov 29 08:04:10 2010 (r216042) @@ -46,7 +46,6 @@ __FBSDID("$FreeBSD$"); static MALLOC_DEFINE(M_MODULE, "module", "module data structures"); -typedef TAILQ_HEAD(, module) modulelist_t; struct module { TAILQ_ENTRY(module) link; /* chain together all modules */ TAILQ_ENTRY(module) flink; /* all modules in a file */ @@ -61,7 +60,7 @@ struct module { #define MOD_EVENT(mod, type) (mod)->handler((mod), (type), (mod)->arg) -static modulelist_t modules; +static TAILQ_HEAD(modulelist, module) modules; struct sx modules_sx; static int nextid = 1; static void module_shutdown(void *, int); @@ -101,7 +100,7 @@ module_shutdown(void *arg1, int arg2) return; mtx_lock(&Giant); MOD_SLOCK; - TAILQ_FOREACH(mod, &modules, link) + TAILQ_FOREACH_REVERSE(mod, &modules, modulelist, link) MOD_EVENT(mod, MOD_SHUTDOWN); MOD_SUNLOCK; mtx_unlock(&Giant); From owner-svn-src-stable-8@FreeBSD.ORG Mon Nov 29 08:12:22 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 030E81065670; Mon, 29 Nov 2010 08:12:21 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AE37A8FC0C; Mon, 29 Nov 2010 08:12:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAT8CLbw013311; Mon, 29 Nov 2010 08:12:21 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAT8CLjB013309; Mon, 29 Nov 2010 08:12:21 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201011290812.oAT8CLjB013309@svn.freebsd.org> From: Attilio Rao Date: Mon, 29 Nov 2010 08:12:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216043 - stable/8/sys/boot/common X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Nov 2010 08:12:22 -0000 Author: attilio Date: Mon Nov 29 08:12:21 2010 New Revision: 216043 URL: http://svn.freebsd.org/changeset/base/216043 Log: MFC r215758,215811: Make this printf output more verbose. Sponsored by: Sandvine Incorporated Modified: stable/8/sys/boot/common/load_elf.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/boot/common/load_elf.c ============================================================================== --- stable/8/sys/boot/common/load_elf.c Mon Nov 29 08:04:10 2010 (r216042) +++ stable/8/sys/boot/common/load_elf.c Mon Nov 29 08:12:21 2010 (r216043) @@ -453,7 +453,8 @@ __elfN(loadimage)(struct preloaded_file } result = archsw.arch_readin(ef->fd, lastaddr, shdr[i].sh_size); if (result < 0 || (size_t)result != shdr[i].sh_size) { - printf("\nelf" __XSTRING(__ELF_WORD_SIZE) "_loadimage: could not read symbols - skipped!"); + printf("\nelf" __XSTRING(__ELF_WORD_SIZE) "_loadimage: could not read symbols - skipped! (%ju != %ju)", (uintmax_t)result, + (uintmax_t)shdr[i].sh_size); lastaddr = ssym; ssym = 0; goto nosyms; From owner-svn-src-stable-8@FreeBSD.ORG Mon Nov 29 08:16:49 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 49B79106566B; Mon, 29 Nov 2010 08:16:49 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 37E8B8FC15; Mon, 29 Nov 2010 08:16:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAT8GngS013825; Mon, 29 Nov 2010 08:16:49 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAT8Gnka013823; Mon, 29 Nov 2010 08:16:49 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201011290816.oAT8Gnka013823@svn.freebsd.org> From: Attilio Rao Date: Mon, 29 Nov 2010 08:16:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216044 - stable/8/sys/sys X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Nov 2010 08:16:49 -0000 Author: attilio Date: Mon Nov 29 08:16:48 2010 New Revision: 216044 URL: http://svn.freebsd.org/changeset/base/216044 Log: MFC r215821: Add a missing CTL description from CVS revision 1.147. Sponsored by: Sandvine Incorporated Modified: stable/8/sys/sys/sysctl.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/sys/sysctl.h ============================================================================== --- stable/8/sys/sys/sysctl.h Mon Nov 29 08:12:21 2010 (r216043) +++ stable/8/sys/sys/sysctl.h Mon Nov 29 08:16:48 2010 (r216044) @@ -452,6 +452,7 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_e { "logsigexit", CTLTYPE_INT }, \ { "iov_max", CTLTYPE_INT }, \ { "hostuuid", CTLTYPE_STRING }, \ + { "arc4rand", CTLTYPE_OPAQUE }, \ } /* From owner-svn-src-stable-8@FreeBSD.ORG Mon Nov 29 09:24:03 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 89983106566C; Mon, 29 Nov 2010 09:24:03 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 777598FC08; Mon, 29 Nov 2010 09:24:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAT9O3ch020165; Mon, 29 Nov 2010 09:24:03 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAT9O3Hg020163; Mon, 29 Nov 2010 09:24:03 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201011290924.oAT9O3Hg020163@svn.freebsd.org> From: Kevin Lo Date: Mon, 29 Nov 2010 09:24:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216048 - stable/8/usr.sbin/kbdmap X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Nov 2010 09:24:03 -0000 Author: kevlo Date: Mon Nov 29 09:24:03 2010 New Revision: 216048 URL: http://svn.freebsd.org/changeset/base/216048 Log: MFC r216047: Fix fd leak in get_font Modified: stable/8/usr.sbin/kbdmap/kbdmap.c Modified: stable/8/usr.sbin/kbdmap/kbdmap.c ============================================================================== --- stable/8/usr.sbin/kbdmap/kbdmap.c Mon Nov 29 09:21:26 2010 (r216047) +++ stable/8/usr.sbin/kbdmap/kbdmap.c Mon Nov 29 09:24:03 2010 (r216048) @@ -229,6 +229,7 @@ get_font(void) } else fprintf(stderr, "Could not open %s for reading\n", sysconfig); + fclose(fp); return fnt; } From owner-svn-src-stable-8@FreeBSD.ORG Mon Nov 29 09:27:10 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E66F106564A; Mon, 29 Nov 2010 09:27:10 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id D15868FC08; Mon, 29 Nov 2010 09:27:09 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id oAT9R6l5037053 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 29 Nov 2010 11:27:06 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id oAT9R6Wf011738; Mon, 29 Nov 2010 11:27:06 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id oAT9R6S2011737; Mon, 29 Nov 2010 11:27:06 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 29 Nov 2010 11:27:06 +0200 From: Kostik Belousov To: Kevin Lo Message-ID: <20101129092706.GU2392@deviant.kiev.zoral.com.ua> References: <201011290924.oAT9O3Hg020163@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Ou79bgwyJGkEGHtw" Content-Disposition: inline In-Reply-To: <201011290924.oAT9O3Hg020163@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r216048 - stable/8/usr.sbin/kbdmap X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Nov 2010 09:27:10 -0000 --Ou79bgwyJGkEGHtw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Nov 29, 2010 at 09:24:03AM +0000, Kevin Lo wrote: > Author: kevlo > Date: Mon Nov 29 09:24:03 2010 > New Revision: 216048 > URL: http://svn.freebsd.org/changeset/base/216048 >=20 > Log: > MFC r216047: > Fix fd leak in get_font >=20 > Modified: > stable/8/usr.sbin/kbdmap/kbdmap.c This commit both lacks mergeinfo recorded, and was done without proper MFC period. The minimal time to merge into stable branches is 3 days. --Ou79bgwyJGkEGHtw Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAkzzcekACgkQC3+MBN1Mb4hKDACeJQeidwOHZ8gsTHF1DRoHsYjp NY0AmwUdzmjbzs3YnSfj+Phq4MiKsFcI =VUNi -----END PGP SIGNATURE----- --Ou79bgwyJGkEGHtw-- From owner-svn-src-stable-8@FreeBSD.ORG Mon Nov 29 10:22:45 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 931AC1065743; Mon, 29 Nov 2010 10:22:45 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 80C028FC0A; Mon, 29 Nov 2010 10:22:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oATAMjdL024190; Mon, 29 Nov 2010 10:22:45 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oATAMjT4024188; Mon, 29 Nov 2010 10:22:45 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201011291022.oATAMjT4024188@svn.freebsd.org> From: Kevin Lo Date: Mon, 29 Nov 2010 10:22:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216051 - stable/8/usr.sbin/kbdmap X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Nov 2010 10:22:45 -0000 Author: kevlo Date: Mon Nov 29 10:22:45 2010 New Revision: 216051 URL: http://svn.freebsd.org/changeset/base/216051 Log: Revert previous change since it's without proper MFC period. Requested by kib Modified: stable/8/usr.sbin/kbdmap/kbdmap.c Modified: stable/8/usr.sbin/kbdmap/kbdmap.c ============================================================================== --- stable/8/usr.sbin/kbdmap/kbdmap.c Mon Nov 29 10:21:45 2010 (r216050) +++ stable/8/usr.sbin/kbdmap/kbdmap.c Mon Nov 29 10:22:45 2010 (r216051) @@ -229,7 +229,6 @@ get_font(void) } else fprintf(stderr, "Could not open %s for reading\n", sysconfig); - fclose(fp); return fnt; } From owner-svn-src-stable-8@FreeBSD.ORG Mon Nov 29 10:48:46 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B5C69106566C; Mon, 29 Nov 2010 10:48:46 +0000 (UTC) (envelope-from kevlo@ns.kevlo.org) Received: from ns.kevlo.org (kevlo.org [220.128.136.52]) by mx1.freebsd.org (Postfix) with ESMTP id 3F1558FC15; Mon, 29 Nov 2010 10:48:46 +0000 (UTC) Received: from ns.kevlo.org (kevlo@localhost [127.0.0.1]) by ns.kevlo.org (8.14.3/8.14.3) with ESMTP id oATAOunr029402; Mon, 29 Nov 2010 18:24:57 +0800 (CST) Received: (from kevlo@localhost) by ns.kevlo.org (8.14.3/8.14.3/Submit) id oATAOuQ4031340; Mon, 29 Nov 2010 18:24:56 +0800 (CST) Date: Mon, 29 Nov 2010 18:24:56 +0800 From: Kevin Lo To: Kostik Belousov Message-ID: <20101129102456.GA2541@ns.kevlo.org> References: <201011290924.oAT9O3Hg020163@svn.freebsd.org> <20101129092706.GU2392@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20101129092706.GU2392@deviant.kiev.zoral.com.ua> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r216048 - stable/8/usr.sbin/kbdmap X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Nov 2010 10:48:46 -0000 On Mon, Nov 29, 2010 at 11:27:06AM +0200, Kostik Belousov wrote: > On Mon, Nov 29, 2010 at 09:24:03AM +0000, Kevin Lo wrote: > > Author: kevlo > > Date: Mon Nov 29 09:24:03 2010 > > New Revision: 216048 > > URL: http://svn.freebsd.org/changeset/base/216048 > > > > Log: > > MFC r216047: > > Fix fd leak in get_font > > > > Modified: > > stable/8/usr.sbin/kbdmap/kbdmap.c > This commit both lacks mergeinfo recorded, and was done without proper > MFC period. The minimal time to merge into stable branches is 3 days. I backed it out. Sorry for the mess! Kevin From owner-svn-src-stable-8@FreeBSD.ORG Mon Nov 29 13:36:21 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F26B1065673; Mon, 29 Nov 2010 13:36:21 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D5D508FC0C; Mon, 29 Nov 2010 13:36:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oATDaKua042759; Mon, 29 Nov 2010 13:36:20 GMT (envelope-from gallatin@svn.freebsd.org) Received: (from gallatin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oATDaKc1042757; Mon, 29 Nov 2010 13:36:20 GMT (envelope-from gallatin@svn.freebsd.org) Message-Id: <201011291336.oATDaKc1042757@svn.freebsd.org> From: Andrew Gallatin Date: Mon, 29 Nov 2010 13:36:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216054 - stable/8/sys/dev/mxge X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Nov 2010 13:36:21 -0000 Author: gallatin Date: Mon Nov 29 13:36:20 2010 New Revision: 216054 URL: http://svn.freebsd.org/changeset/base/216054 Log: MFC 215686: Fix a TSO checksum bug on mxge(4): The Myri10GE NIC will assume all TSO frames contain partial checksum, and will emit TSO segments with bad TCP checksums if a TSO frame contains a full checksum. The mxge driver takes care to make sure that TSO is disabled when checksum offload is disabled for this reason. However, modules that modify packet contents (like pf) may end up completing a checksum on a TSO frame, leading to the NIC emitting TSO segments with bad checksums. To workaround this, restore the partial checksum in the mxge driver when we're fed a TSO frame with a full checksum. Modified: stable/8/sys/dev/mxge/if_mxge.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/mxge/if_mxge.c ============================================================================== --- stable/8/sys/dev/mxge/if_mxge.c Mon Nov 29 11:55:17 2010 (r216053) +++ stable/8/sys/dev/mxge/if_mxge.c Mon Nov 29 13:36:20 2010 (r216054) @@ -1855,9 +1855,20 @@ mxge_encap_tso(struct mxge_slice_state * tcp = (struct tcphdr *)((char *)ip + (ip->ip_hl << 2)); cum_len = -(ip_off + ((ip->ip_hl + tcp->th_off) << 2)); + cksum_offset = ip_off + (ip->ip_hl << 2); /* TSO implies checksum offload on this hardware */ - cksum_offset = ip_off + (ip->ip_hl << 2); + if (__predict_false((m->m_pkthdr.csum_flags & (CSUM_TCP)) == 0)) { + /* + * If packet has full TCP csum, replace it with pseudo hdr + * sum that the NIC expects, otherwise the NIC will emit + * packets with bad TCP checksums. + */ + m->m_pkthdr.csum_flags = CSUM_TCP; + m->m_pkthdr.csum_data = offsetof(struct tcphdr, th_sum); + tcp->th_sum = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr, + htons(IPPROTO_TCP + (m->m_pkthdr.len - cksum_offset))); + } flags = MXGEFW_FLAGS_TSO_HDR | MXGEFW_FLAGS_FIRST; From owner-svn-src-stable-8@FreeBSD.ORG Mon Nov 29 15:06:50 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5A8E9106567A; Mon, 29 Nov 2010 15:06:50 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id BD16D8FC17; Mon, 29 Nov 2010 15:06:49 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id oATF6jK4068290 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 29 Nov 2010 17:06:45 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id oATF6jgG013688; Mon, 29 Nov 2010 17:06:45 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id oATF6j5l013687; Mon, 29 Nov 2010 17:06:45 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 29 Nov 2010 17:06:45 +0200 From: Kostik Belousov To: Kevin Lo Message-ID: <20101129150645.GV2392@deviant.kiev.zoral.com.ua> References: <201011290924.oAT9O3Hg020163@svn.freebsd.org> <20101129092706.GU2392@deviant.kiev.zoral.com.ua> <20101129102456.GA2541@ns.kevlo.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="kKUuh2uDRSZyqMVS" Content-Disposition: inline In-Reply-To: <20101129102456.GA2541@ns.kevlo.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r216048 - stable/8/usr.sbin/kbdmap X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Nov 2010 15:06:50 -0000 --kKUuh2uDRSZyqMVS Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Nov 29, 2010 at 06:24:56PM +0800, Kevin Lo wrote: > On Mon, Nov 29, 2010 at 11:27:06AM +0200, Kostik Belousov wrote: > > On Mon, Nov 29, 2010 at 09:24:03AM +0000, Kevin Lo wrote: > > > Author: kevlo > > > Date: Mon Nov 29 09:24:03 2010 > > > New Revision: 216048 > > > URL: http://svn.freebsd.org/changeset/base/216048 > > >=20 > > > Log: > > > MFC r216047: > > > Fix fd leak in get_font > > >=20 > > > Modified: > > > stable/8/usr.sbin/kbdmap/kbdmap.c > > This commit both lacks mergeinfo recorded, and was done without proper > > MFC period. The minimal time to merge into stable branches is 3 days. >=20 > I backed it out. Sorry for the mess! Thank you. --kKUuh2uDRSZyqMVS Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAkzzwYEACgkQC3+MBN1Mb4iGbwCgveLVRPnmxjIwj2lVzV85bbNU 78UAoOF7kVDg9wImzcldLI9X0A8iBEBO =VmrA -----END PGP SIGNATURE----- --kKUuh2uDRSZyqMVS-- From owner-svn-src-stable-8@FreeBSD.ORG Mon Nov 29 20:01:19 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2476E106564A; Mon, 29 Nov 2010 20:01:19 +0000 (UTC) (envelope-from cvs-src@yandex.ru) Received: from forward14.mail.yandex.net (forward14.mail.yandex.net [95.108.130.92]) by mx1.freebsd.org (Postfix) with ESMTP id C24CC8FC18; Mon, 29 Nov 2010 20:01:18 +0000 (UTC) Received: from smtp13.mail.yandex.net (smtp13.mail.yandex.net [95.108.130.68]) by forward14.mail.yandex.net (Yandex) with ESMTP id BBCBC4E507AE; Mon, 29 Nov 2010 22:45:28 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1291059928; bh=i40I1KB1QCXZsnnRfEvmFoVKeCzHlpNyUET9FMktWNI=; h=Message-ID:Date:From:MIME-Version:To:CC:Subject:References: In-Reply-To:Content-Type:Content-Transfer-Encoding; b=BWUlq3gcN9Owo5NQMn9H9QrDeAv0LJ5nC0jEMptG1X15a/IQUDhxu7MLjRYt9bBGQ rxxfN/brtVAhR3mHmZPIW7hfqgBO3XzlOIUskBaRGbFWYVWYhuUOzXk5Sn9YbcVnOn Blxn2jcyzlWESg7U9R3EFsM37rLZ4SrAlyINA2gA= Received: from smeshariki2.local (unknown [77.66.145.223]) by smtp13.mail.yandex.net (Yandex) with ESMTPSA id D75B941580A9; Mon, 29 Nov 2010 22:45:18 +0300 (MSK) Message-ID: <4CF402AB.8010503@yandex.ru> Date: Mon, 29 Nov 2010 22:44:43 +0300 From: Ruslan Mahmatkhanov User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; ru-RU; rv:1.9.2.12) Gecko/20101029 Thunderbird/3.1.6 MIME-Version: 1.0 To: Nick Hibma References: <201011282207.oASM791M050471@svn.freebsd.org> In-Reply-To: <201011282207.oASM791M050471@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r216018 - in stable/8: share/man/man4 sys/dev/usb/quirk sys/dev/usb/serial usr.sbin/usbconfig X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Nov 2010 20:01:19 -0000 29.11.2010 01:07, Nick Hibma пишет: > Author: n_hibma > Date: Sun Nov 28 22:07:08 2010 > New Revision: 216018 > URL: http://svn.freebsd.org/changeset/base/216018 > > Log: > MFC r215095,215104: > > Add quirks for 3G MSC resets. > Add a man page for the usb_quirks module. > > Copied: stable/8/share/man/man4/usb_quirk.4 (from r215104, head/share/man/man4/usb_quirk.4) > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ stable/8/share/man/man4/usb_quirk.4 Sun Nov 28 22:07:08 2010 (r216018, copy of r215104, head/share/man/man4/usb_quirk.4) > +.Sh EXAMPLES > +After attaching a > +.Nm u3g > +device which appears as a USB device on > +.Pa ugen0.3 : > +.Bd -literal -offset indent > +usbconfig -d ugen0.3 add_quirk UQ_MSC_EJECT_WAIT > +.Ed > +.Sh SEE ALSO > +.Xr usb_quirk 4 , ^^^^^^^^^^^^^^^^^^^^ Thank you for the this page! It seems like it references itself. -- Regards, Ruslan From owner-svn-src-stable-8@FreeBSD.ORG Tue Nov 30 08:39:05 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E13B4106566B; Tue, 30 Nov 2010 08:39:05 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CF3BC8FC15; Tue, 30 Nov 2010 08:39:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAU8d5LN059962; Tue, 30 Nov 2010 08:39:05 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAU8d5Rc059960; Tue, 30 Nov 2010 08:39:05 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201011300839.oAU8d5Rc059960@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 30 Nov 2010 08:39:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216073 - stable/8/sys/crypto/aesni X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Nov 2010 08:39:06 -0000 Author: kib Date: Tue Nov 30 08:39:05 2010 New Revision: 216073 URL: http://svn.freebsd.org/changeset/base/216073 Log: MFC r215942: Remove DEBUG sections. Approved by: re (bz) Modified: stable/8/sys/crypto/aesni/aesni_wrap.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/crypto/aesni/aesni_wrap.c ============================================================================== --- stable/8/sys/crypto/aesni/aesni_wrap.c Tue Nov 30 08:25:57 2010 (r216072) +++ stable/8/sys/crypto/aesni/aesni_wrap.c Tue Nov 30 08:39:05 2010 (r216073) @@ -37,22 +37,6 @@ __FBSDID("$FreeBSD$"); MALLOC_DECLARE(M_AESNI); -#ifdef DEBUG -static void -ps_len(const char *string, const uint8_t *data, int length) -{ - int i; - - printf("%-12s[0x", string); - for(i = 0; i < length; i++) { - if (i % AES_BLOCK_LEN == 0 && i > 0) - printf("+"); - printf("%02x", data[i]); - } - printf("]\n"); -} -#endif - void aesni_encrypt_cbc(int rounds, const void *key_schedule, size_t len, const uint8_t *from, uint8_t *to, const uint8_t iv[AES_BLOCK_LEN]) @@ -60,11 +44,6 @@ aesni_encrypt_cbc(int rounds, const void const uint8_t *ivp; size_t i; -#ifdef DEBUG - ps_len("AES CBC encrypt iv:", iv, AES_BLOCK_LEN); - ps_len("from:", from, len); -#endif - len /= AES_BLOCK_LEN; ivp = iv; for (i = 0; i < len; i++) { @@ -73,9 +52,6 @@ aesni_encrypt_cbc(int rounds, const void from += AES_BLOCK_LEN; to += AES_BLOCK_LEN; } -#ifdef DEBUG - ps_len("to:", to - len * AES_BLOCK_LEN, len * AES_BLOCK_LEN); -#endif } void From owner-svn-src-stable-8@FreeBSD.ORG Tue Nov 30 22:25:45 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0D8ED1065675; Tue, 30 Nov 2010 22:25:45 +0000 (UTC) (envelope-from gibbs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EF03C8FC13; Tue, 30 Nov 2010 22:25:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAUMPinF040160; Tue, 30 Nov 2010 22:25:44 GMT (envelope-from gibbs@svn.freebsd.org) Received: (from gibbs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAUMPiRc040158; Tue, 30 Nov 2010 22:25:44 GMT (envelope-from gibbs@svn.freebsd.org) Message-Id: <201011302225.oAUMPiRc040158@svn.freebsd.org> From: "Justin T. Gibbs" Date: Tue, 30 Nov 2010 22:25:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216087 - stable/8/sys/kern X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Nov 2010 22:25:45 -0000 Author: gibbs Date: Tue Nov 30 22:25:44 2010 New Revision: 216087 URL: http://svn.freebsd.org/changeset/base/216087 Log: Merge revision 211236 form current: Allow interrupt driven config hooks to be registered from config hook callbacks. Interrupt driven configuration hooks serve two purposes: they are a mechanism for registering for a callback that is invoked once interrupt services are available, and they hold off root device selection so long as any configuration hooks are still active. Before this change, it was not possible to safely register additional hooks from the context of a configuration hook callback. The need for this feature arises when interrupts are required to discover new devices (e.g. access to the XenStore to find para-virtualized devices) which in turn also require the ability to hold off root device selection until some lengthy, interrupt driven, configuration task has completed (e.g. Xen front/back device driver negotiation). More specifically, the mutex protecting the list of active configuration hooks is never held during a callback, and static information is used to ensure proper ordering and only a single callback to each hook even when faced with registration or removal of a hook during an active run. Sponsored by: Spectra Logic Corporation Approved by: re (kib) Modified: stable/8/sys/kern/subr_autoconf.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/kern/subr_autoconf.c ============================================================================== --- stable/8/sys/kern/subr_autoconf.c Tue Nov 30 21:26:21 2010 (r216086) +++ stable/8/sys/kern/subr_autoconf.c Tue Nov 30 22:25:44 2010 (r216087) @@ -55,11 +55,12 @@ __FBSDID("$FreeBSD$"); */ static TAILQ_HEAD(, intr_config_hook) intr_config_hook_list = TAILQ_HEAD_INITIALIZER(intr_config_hook_list); +static struct intr_config_hook *next_to_notify; static struct mtx intr_config_hook_lock; MTX_SYSINIT(intr_config_hook, &intr_config_hook_lock, "intr config", MTX_DEF); /* ARGSUSED */ -static void run_interrupt_driven_config_hooks(void *dummy); +static void run_interrupt_driven_config_hooks(void); /* * If we wait too long for an interrupt-driven config hook to return, print @@ -91,19 +92,46 @@ run_interrupt_driven_config_hooks_warnin } static void -run_interrupt_driven_config_hooks(void *dummy) +run_interrupt_driven_config_hooks() { - struct intr_config_hook *hook_entry, *next_entry; - int warned; + static int running; + struct intr_config_hook *hook_entry; mtx_lock(&intr_config_hook_lock); - TAILQ_FOREACH_SAFE(hook_entry, &intr_config_hook_list, ich_links, - next_entry) { + + /* + * If hook processing is already active, any newly + * registered hooks will eventually be notified. + * Let the currently running session issue these + * notifications. + */ + if (running != 0) { + mtx_unlock(&intr_config_hook_lock); + return; + } + running = 1; + + while (next_to_notify != NULL) { + hook_entry = next_to_notify; + next_to_notify = TAILQ_NEXT(hook_entry, ich_links); mtx_unlock(&intr_config_hook_lock); (*hook_entry->ich_func)(hook_entry->ich_arg); mtx_lock(&intr_config_hook_lock); } + running = 0; + mtx_unlock(&intr_config_hook_lock); +} + +static void +boot_run_interrupt_driven_config_hooks(void *dummy) +{ + int warned; + + run_interrupt_driven_config_hooks(); + + /* Block boot processing until all hooks are disestablished. */ + mtx_lock(&intr_config_hook_lock); warned = 0; while (!TAILQ_EMPTY(&intr_config_hook_list)) { if (msleep(&intr_config_hook_list, &intr_config_hook_lock, @@ -117,8 +145,9 @@ run_interrupt_driven_config_hooks(void * } mtx_unlock(&intr_config_hook_lock); } + SYSINIT(intr_config_hooks, SI_SUB_INT_CONFIG_HOOKS, SI_ORDER_FIRST, - run_interrupt_driven_config_hooks, NULL); + boot_run_interrupt_driven_config_hooks, NULL); /* * Register a hook that will be called after "cold" @@ -141,10 +170,16 @@ config_intrhook_establish(struct intr_co return (1); } TAILQ_INSERT_TAIL(&intr_config_hook_list, hook, ich_links); + if (next_to_notify == NULL) + next_to_notify = hook; mtx_unlock(&intr_config_hook_lock); if (cold == 0) + /* + * XXX Call from a task since not all drivers expect + * to be re-entered at the time a hook is established. + */ /* XXX Sufficient for modules loaded after initial config??? */ - run_interrupt_driven_config_hooks(NULL); + run_interrupt_driven_config_hooks(); return (0); } @@ -161,6 +196,8 @@ config_intrhook_disestablish(struct intr panic("config_intrhook_disestablish: disestablishing an " "unestablished hook"); + if (next_to_notify == hook) + next_to_notify = TAILQ_NEXT(hook, ich_links); TAILQ_REMOVE(&intr_config_hook_list, hook, ich_links); /* Wakeup anyone watching the list */ From owner-svn-src-stable-8@FreeBSD.ORG Wed Dec 1 15:28:23 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 95CDA106564A; Wed, 1 Dec 2010 15:28:23 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 83DAA8FC08; Wed, 1 Dec 2010 15:28:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB1FSNoj020136; Wed, 1 Dec 2010 15:28:23 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB1FSNHO020134; Wed, 1 Dec 2010 15:28:23 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201012011528.oB1FSNHO020134@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 1 Dec 2010 15:28:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216096 - stable/8/sys/kern X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Dec 2010 15:28:23 -0000 Author: kib Date: Wed Dec 1 15:28:23 2010 New Revision: 216096 URL: http://svn.freebsd.org/changeset/base/216096 Log: MFC r215797: Allow shared-locked vnode to be passed to vunref(9). Approved by: re (bz) Modified: stable/8/sys/kern/vfs_subr.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/kern/vfs_subr.c ============================================================================== --- stable/8/sys/kern/vfs_subr.c Wed Dec 1 08:07:32 2010 (r216095) +++ stable/8/sys/kern/vfs_subr.c Wed Dec 1 15:28:23 2010 (r216096) @@ -2189,7 +2189,7 @@ vputx(struct vnode *vp, int func) KASSERT(vp != NULL, ("vputx: null vp")); if (func == VPUTX_VUNREF) - ASSERT_VOP_ELOCKED(vp, "vunref"); + ASSERT_VOP_LOCKED(vp, "vunref"); else if (func == VPUTX_VPUT) ASSERT_VOP_LOCKED(vp, "vput"); else @@ -2227,12 +2227,22 @@ vputx(struct vnode *vp, int func) * as VI_DOINGINACT to avoid recursion. */ vp->v_iflag |= VI_OWEINACT; - if (func == VPUTX_VRELE) { + switch (func) { + case VPUTX_VRELE: error = vn_lock(vp, LK_EXCLUSIVE | LK_INTERLOCK); VI_LOCK(vp); - } else if (func == VPUTX_VPUT && VOP_ISLOCKED(vp) != LK_EXCLUSIVE) { - error = VOP_LOCK(vp, LK_UPGRADE | LK_INTERLOCK | LK_NOWAIT); - VI_LOCK(vp); + break; + case VPUTX_VPUT: + if (VOP_ISLOCKED(vp) != LK_EXCLUSIVE) { + error = VOP_LOCK(vp, LK_UPGRADE | LK_INTERLOCK | + LK_NOWAIT); + VI_LOCK(vp); + } + break; + case VPUTX_VUNREF: + if (VOP_ISLOCKED(vp) != LK_EXCLUSIVE) + error = EBUSY; + break; } if (vp->v_usecount > 0) vp->v_iflag &= ~VI_OWEINACT; From owner-svn-src-stable-8@FreeBSD.ORG Wed Dec 1 15:31:31 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CF169106564A; Wed, 1 Dec 2010 15:31:31 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BD61E8FC1E; Wed, 1 Dec 2010 15:31:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB1FVVHM020367; Wed, 1 Dec 2010 15:31:31 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB1FVVKI020365; Wed, 1 Dec 2010 15:31:31 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201012011531.oB1FVVKI020365@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 1 Dec 2010 15:31:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216097 - stable/8/share/man/man9 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Dec 2010 15:31:31 -0000 Author: kib Date: Wed Dec 1 15:31:31 2010 New Revision: 216097 URL: http://svn.freebsd.org/changeset/base/216097 Log: MFC r215798: Remove the note about possible unlocking during vunref(9). Approved by: re (bz) Modified: stable/8/share/man/man9/vrele.9 Directory Properties: stable/8/share/man/man9/ (props changed) Modified: stable/8/share/man/man9/vrele.9 ============================================================================== --- stable/8/share/man/man9/vrele.9 Wed Dec 1 15:28:23 2010 (r216096) +++ stable/8/share/man/man9/vrele.9 Wed Dec 1 15:31:31 2010 (r216097) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 17, 2010 +.Dd November 20, 2010 .Dt VRELE 9 .Os .Sh NAME @@ -74,10 +74,6 @@ with less overhead. The .Fn vunref function takes a locked vnode as argument, and returns with the vnode locked. -Nonetheless, the -.Fn vunref -might drop the vnode lock during the operation, so caller should not expect -that non-doomed vnode is still non-doomed after the function returned. .Pp Any code in the system which signified its use of a vnode by usecount should call one of the listed function to decrement use counter. From owner-svn-src-stable-8@FreeBSD.ORG Thu Dec 2 00:49:03 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 30F5C1065673; Thu, 2 Dec 2010 00:49:03 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1EC518FC22; Thu, 2 Dec 2010 00:49:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB20n3hx062168; Thu, 2 Dec 2010 00:49:03 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB20n2vG062166; Thu, 2 Dec 2010 00:49:02 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201012020049.oB20n2vG062166@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 2 Dec 2010 00:49:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216102 - stable/8/sys/kern X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Dec 2010 00:49:03 -0000 Author: kib Date: Thu Dec 2 00:49:02 2010 New Revision: 216102 URL: http://svn.freebsd.org/changeset/base/216102 Log: MFC r215838: Account i/o done on cdevs. Approved by: re (bz) Modified: stable/8/sys/kern/kern_physio.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/kern/kern_physio.c ============================================================================== --- stable/8/sys/kern/kern_physio.c Thu Dec 2 00:47:55 2010 (r216101) +++ stable/8/sys/kern/kern_physio.c Thu Dec 2 00:49:02 2010 (r216102) @@ -57,10 +57,13 @@ physio(struct cdev *dev, struct uio *uio for (i = 0; i < uio->uio_iovcnt; i++) { while (uio->uio_iov[i].iov_len) { bp->b_flags = 0; - if (uio->uio_rw == UIO_READ) + if (uio->uio_rw == UIO_READ) { bp->b_iocmd = BIO_READ; - else + curthread->td_ru.ru_inblock++; + } else { bp->b_iocmd = BIO_WRITE; + curthread->td_ru.ru_oublock++; + } bp->b_iodone = bdone; bp->b_data = uio->uio_iov[i].iov_base; bp->b_bcount = uio->uio_iov[i].iov_len; From owner-svn-src-stable-8@FreeBSD.ORG Thu Dec 2 09:09:47 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 53D961065674; Thu, 2 Dec 2010 09:09:47 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4053A8FC18; Thu, 2 Dec 2010 09:09:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB299lRi092380; Thu, 2 Dec 2010 09:09:47 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB299lsh092376; Thu, 2 Dec 2010 09:09:47 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201012020909.oB299lsh092376@svn.freebsd.org> From: Bruce Cran Date: Thu, 2 Dec 2010 09:09:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216116 - stable/8/usr.sbin/sysinstall X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Dec 2010 09:09:47 -0000 Author: brucec Date: Thu Dec 2 09:09:46 2010 New Revision: 216116 URL: http://svn.freebsd.org/changeset/base/216116 Log: MFC r216052: Update the serial port device names. They changed in 8.0 because the default driver is now uart(4). PR: bin/140887 Submitted by: Joe Barbish MFC r216053: If no floppy drive is installed kldBrowser() can generate an error early on. Initialize menu and count so the cleanup code doesn't try and use their uninitialized values. PR: bin/152270 Submitted by: Remi LAURENT Approved by: re (kensmith) Modified: stable/8/usr.sbin/sysinstall/devices.c stable/8/usr.sbin/sysinstall/menus.c stable/8/usr.sbin/sysinstall/modules.c Directory Properties: stable/8/usr.sbin/sysinstall/ (props changed) Modified: stable/8/usr.sbin/sysinstall/devices.c ============================================================================== --- stable/8/usr.sbin/sysinstall/devices.c Thu Dec 2 06:40:21 2010 (r216115) +++ stable/8/usr.sbin/sysinstall/devices.c Thu Dec 2 09:09:46 2010 (r216116) @@ -91,7 +91,7 @@ static struct _devname { DISK("ipsd%d", "IBM ServeRAID RAID array", 4), DISK("mfid%d", "LSI MegaRAID SAS array", 4), FLOPPY("fd%d", "floppy drive unit A", 4), - SERIAL("cuad%d", "%s on device %s (COM%d)", 16), + SERIAL("cuau%d", "%s on device %s (COM%d)", 16), USB("da%da", "USB Mass Storage Device", 16), NETWORK("ae", "Attansic/Atheros L2 Fast Ethernet"), NETWORK("age", "Attansic/Atheros L1 Gigabit Ethernet"), Modified: stable/8/usr.sbin/sysinstall/menus.c ============================================================================== --- stable/8/usr.sbin/sysinstall/menus.c Thu Dec 2 06:40:21 2010 (r216115) +++ stable/8/usr.sbin/sysinstall/menus.c Thu Dec 2 09:09:46 2010 (r216116) @@ -426,10 +426,10 @@ DMenu MenuMousePort = { { { "1 BusMouse", "PC-98x1 bus mouse (/dev/mse0)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/mse0" }, - { "2 COM1", "Serial mouse on COM1 (/dev/cuad0)", - dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/cuad0" }, - { "3 COM2", "Serial mouse on COM2 (/dev/cuad1)", - dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/cuad1" }, + { "2 COM1", "Serial mouse on COM1 (/dev/cuau0)", + dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/cuau0" }, + { "3 COM2", "Serial mouse on COM2 (/dev/cuau1)", + dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/cuau1" }, { NULL } }, }; #else @@ -442,14 +442,14 @@ DMenu MenuMousePort = { NULL, { { "1 PS/2", "PS/2 style mouse (/dev/psm0)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/psm0" }, - { "2 COM1", "Serial mouse on COM1 (/dev/cuad0)", - dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/cuad0" }, - { "3 COM2", "Serial mouse on COM2 (/dev/cuad1)", - dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/cuad1" }, - { "4 COM3", "Serial mouse on COM3 (/dev/cuad2)", - dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/cuad2" }, - { "5 COM4", "Serial mouse on COM4 (/dev/cuad3)", - dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/cuad3" }, + { "2 COM1", "Serial mouse on COM1 (/dev/cuau0)", + dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/cuau0" }, + { "3 COM2", "Serial mouse on COM2 (/dev/cuau1)", + dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/cuau1" }, + { "4 COM3", "Serial mouse on COM3 (/dev/cuau2)", + dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/cuau2" }, + { "5 COM4", "Serial mouse on COM4 (/dev/cuau3)", + dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/cuau3" }, { "6 BusMouse", "Logitech, ATI or MS bus mouse (/dev/mse0)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/mse0" }, { NULL } }, Modified: stable/8/usr.sbin/sysinstall/modules.c ============================================================================== --- stable/8/usr.sbin/sysinstall/modules.c Thu Dec 2 06:40:21 2010 (r216115) +++ stable/8/usr.sbin/sysinstall/modules.c Thu Dec 2 09:09:46 2010 (r216116) @@ -123,13 +123,14 @@ driverFloppyCheck(void) int kldBrowser(dialogMenuItem *self) { - DMenu *menu; + DMenu *menu = NULL; int i, what = DITEM_SUCCESS, msize, count; DIR *dir; struct dirent *de; char *err; err = NULL; + count = 0; if (DITEM_STATUS(mediaSetFloppy(NULL)) == DITEM_FAILURE) { err = "Unable to set media device to floppy."; @@ -142,7 +143,6 @@ kldBrowser(dialogMenuItem *self) } msize = sizeof(DMenu) + (sizeof(dialogMenuItem) * 2); - count = 0; if ((menu = malloc(msize)) == NULL) { err = "Failed to allocate memory for menu"; goto errout; From owner-svn-src-stable-8@FreeBSD.ORG Thu Dec 2 10:39:45 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 28E701065674; Thu, 2 Dec 2010 10:39:45 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 154988FC1A; Thu, 2 Dec 2010 10:39:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB2AdiBq000313; Thu, 2 Dec 2010 10:39:44 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB2AdiBZ000309; Thu, 2 Dec 2010 10:39:44 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201012021039.oB2AdiBZ000309@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 2 Dec 2010 10:39:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216118 - stable/8/sys/netinet6 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Dec 2010 10:39:45 -0000 Author: bz Date: Thu Dec 2 10:39:44 2010 New Revision: 216118 URL: http://svn.freebsd.org/changeset/base/216118 Log: MFC r216022: Plug well observed races on la_hold entries with the callout handler. Call the handler function with the lock held, return unlocked as we might free the entry. Rework functions later in the call graph to be either called with the lock held or, only if needed, unlocked. Place asserts to document and tighten assumptions on various lle locking, which were not always true before. We call nd6_ns_output() unlocked and the assignment of ip6->ip6_src was decentralized to minimize possible complexity introduced with the formerly missing locking there. This also resulted in a push down of local variable scopes into smaller blocks. Reported by: many Submitted by: Dmitrij Tejblum (tejblum yandex-team.ru) (original version) Tested by: remko PR: kern/148857 Approved by: re (kib) Modified: stable/8/sys/netinet6/in6.c stable/8/sys/netinet6/nd6.c stable/8/sys/netinet6/nd6_nbr.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/netinet6/in6.c ============================================================================== --- stable/8/sys/netinet6/in6.c Thu Dec 2 09:10:45 2010 (r216117) +++ stable/8/sys/netinet6/in6.c Thu Dec 2 10:39:44 2010 (r216118) @@ -2325,10 +2325,12 @@ in6_lltable_new(const struct sockaddr *l if (lle == NULL) /* NB: caller generates msg */ return NULL; - callout_init(&lle->base.ln_timer_ch, CALLOUT_MPSAFE); lle->l3_addr6 = *(const struct sockaddr_in6 *)l3addr; lle->base.lle_refcnt = 1; LLE_LOCK_INIT(&lle->base); + callout_init_rw(&lle->base.ln_timer_ch, &lle->base.lle_lock, + CALLOUT_RETURNUNLOCKED); + return &lle->base; } Modified: stable/8/sys/netinet6/nd6.c ============================================================================== --- stable/8/sys/netinet6/nd6.c Thu Dec 2 09:10:45 2010 (r216117) +++ stable/8/sys/netinet6/nd6.c Thu Dec 2 10:39:44 2010 (r216118) @@ -403,6 +403,8 @@ nd6_llinfo_settimer_locked(struct llentr { int canceled; + LLE_WLOCK_ASSERT(ln); + if (tick < 0) { ln->la_expire = 0; ln->ln_ntick = 0; @@ -443,6 +445,7 @@ nd6_llinfo_timer(void *arg) KASSERT(arg != NULL, ("%s: arg NULL", __func__)); ln = (struct llentry *)arg; + LLE_WLOCK_ASSERT(ln); ifp = ln->lle_tbl->llt_ifp; CURVNET_SET(ifp->if_vnet); @@ -450,10 +453,10 @@ nd6_llinfo_timer(void *arg) if (ln->ln_ntick > 0) { if (ln->ln_ntick > INT_MAX) { ln->ln_ntick -= INT_MAX; - nd6_llinfo_settimer(ln, INT_MAX); + nd6_llinfo_settimer_locked(ln, INT_MAX); } else { ln->ln_ntick = 0; - nd6_llinfo_settimer(ln, ln->ln_ntick); + nd6_llinfo_settimer_locked(ln, ln->ln_ntick); } goto done; } @@ -474,8 +477,10 @@ nd6_llinfo_timer(void *arg) case ND6_LLINFO_INCOMPLETE: if (ln->la_asked < V_nd6_mmaxtries) { ln->la_asked++; - nd6_llinfo_settimer(ln, (long)ndi->retrans * hz / 1000); + nd6_llinfo_settimer_locked(ln, (long)ndi->retrans * hz / 1000); + LLE_WUNLOCK(ln); nd6_ns_output(ifp, NULL, dst, ln, 0); + LLE_WLOCK(ln); } else { struct mbuf *m = ln->la_hold; if (m) { @@ -483,24 +488,24 @@ nd6_llinfo_timer(void *arg) /* * assuming every packet in la_hold has the - * same IP header + * same IP header. Send error after unlock. */ m0 = m->m_nextpkt; m->m_nextpkt = NULL; - icmp6_error2(m, ICMP6_DST_UNREACH, - ICMP6_DST_UNREACH_ADDR, 0, ifp); - ln->la_hold = m0; clear_llinfo_pqueue(ln); } (void)nd6_free(ln, 0); ln = NULL; + if (m != NULL) + icmp6_error2(m, ICMP6_DST_UNREACH, + ICMP6_DST_UNREACH_ADDR, 0, ifp); } break; case ND6_LLINFO_REACHABLE: if (!ND6_LLINFO_PERMANENT(ln)) { ln->ln_state = ND6_LLINFO_STALE; - nd6_llinfo_settimer(ln, (long)V_nd6_gctimer * hz); + nd6_llinfo_settimer_locked(ln, (long)V_nd6_gctimer * hz); } break; @@ -517,27 +522,34 @@ nd6_llinfo_timer(void *arg) /* We need NUD */ ln->la_asked = 1; ln->ln_state = ND6_LLINFO_PROBE; - nd6_llinfo_settimer(ln, (long)ndi->retrans * hz / 1000); + nd6_llinfo_settimer_locked(ln, (long)ndi->retrans * hz / 1000); + LLE_WUNLOCK(ln); nd6_ns_output(ifp, dst, dst, ln, 0); + LLE_WLOCK(ln); } else { ln->ln_state = ND6_LLINFO_STALE; /* XXX */ - nd6_llinfo_settimer(ln, (long)V_nd6_gctimer * hz); + nd6_llinfo_settimer_locked(ln, (long)V_nd6_gctimer * hz); } break; case ND6_LLINFO_PROBE: if (ln->la_asked < V_nd6_umaxtries) { ln->la_asked++; - nd6_llinfo_settimer(ln, (long)ndi->retrans * hz / 1000); + nd6_llinfo_settimer_locked(ln, (long)ndi->retrans * hz / 1000); + LLE_WUNLOCK(ln); nd6_ns_output(ifp, dst, dst, ln, 0); + LLE_WLOCK(ln); } else { (void)nd6_free(ln, 0); ln = NULL; } break; + default: + panic("%s: paths in a dark night can be confusing: %d", + __func__, ln->ln_state); } done: if (ln != NULL) - LLE_FREE(ln); + LLE_FREE_LOCKED(ln); CURVNET_RESTORE(); } @@ -992,7 +1004,9 @@ nd6_free(struct llentry *ln, int gc) { struct llentry *next; struct nd_defrouter *dr; - struct ifnet *ifp=NULL; + struct ifnet *ifp; + + LLE_WLOCK_ASSERT(ln); /* * we used to have pfctlinput(PRC_HOSTDEAD) here. @@ -1000,12 +1014,13 @@ nd6_free(struct llentry *ln, int gc) */ /* cancel timer */ - nd6_llinfo_settimer(ln, -1); + nd6_llinfo_settimer_locked(ln, -1); + + ifp = ln->lle_tbl->llt_ifp; if (!V_ip6_forwarding) { - int s; - s = splnet(); - dr = defrouter_lookup(&L3_ADDR_SIN6(ln)->sin6_addr, ln->lle_tbl->llt_ifp); + + dr = defrouter_lookup(&L3_ADDR_SIN6(ln)->sin6_addr, ifp); if (dr != NULL && dr->expire && ln->ln_state == ND6_LLINFO_STALE && gc) { @@ -1022,15 +1037,16 @@ nd6_free(struct llentry *ln, int gc) * but we intentionally keep it just in case. */ if (dr->expire > time_second) - nd6_llinfo_settimer(ln, + nd6_llinfo_settimer_locked(ln, (dr->expire - time_second) * hz); else - nd6_llinfo_settimer(ln, (long)V_nd6_gctimer * hz); - splx(s); - LLE_WLOCK(ln); + nd6_llinfo_settimer_locked(ln, + (long)V_nd6_gctimer * hz); + + next = LIST_NEXT(ln, lle_next); LLE_REMREF(ln); LLE_WUNLOCK(ln); - return (LIST_NEXT(ln, lle_next)); + return (next); } if (ln->ln_router || dr) { @@ -1039,7 +1055,7 @@ nd6_free(struct llentry *ln, int gc) * is in the Default Router List. * See a corresponding comment in nd6_na_input(). */ - rt6_flush(&L3_ADDR_SIN6(ln)->sin6_addr, ln->lle_tbl->llt_ifp); + rt6_flush(&L3_ADDR_SIN6(ln)->sin6_addr, ifp); } if (dr) { @@ -1067,11 +1083,13 @@ nd6_free(struct llentry *ln, int gc) pfxlist_onlink_check(); /* - * refresh default router list + * Refresh default router list. Have to unlock as + * it calls into nd6_lookup(), still holding a ref. */ + LLE_WUNLOCK(ln); defrouter_select(); + LLE_WLOCK(ln); } - splx(s); } /* @@ -1082,7 +1100,11 @@ nd6_free(struct llentry *ln, int gc) */ next = LIST_NEXT(ln, lle_next); - ifp = ln->lle_tbl->llt_ifp; + /* + * Save to unlock. We still hold an extra reference and will not + * free(9) in llentry_free() if someone else holds one as well. + */ + LLE_WUNLOCK(ln); IF_AFDATA_LOCK(ifp); LLE_WLOCK(ln); LLE_REMREF(ln); @@ -1804,6 +1826,9 @@ nd6_output_lle(struct ifnet *ifp, struct LLE_RUNLOCK(ln); goto retry; } + + LLE_WLOCK_ASSERT(ln); + if (ln->la_hold) { struct mbuf *m_hold; int i; @@ -1825,17 +1850,7 @@ nd6_output_lle(struct ifnet *ifp, struct } else { ln->la_hold = m; } - /* - * We did the lookup (no lle arg) so we - * need to do the unlock here - */ - if (lle == NULL) { - if (flags & LLE_EXCLUSIVE) - LLE_WUNLOCK(ln); - else - LLE_RUNLOCK(ln); - } - + /* * If there has been no NS for the neighbor after entering the * INCOMPLETE state, send the first solicitation. @@ -1843,10 +1858,21 @@ nd6_output_lle(struct ifnet *ifp, struct if (!ND6_LLINFO_PERMANENT(ln) && ln->la_asked == 0) { ln->la_asked++; - nd6_llinfo_settimer(ln, + nd6_llinfo_settimer_locked(ln, (long)ND_IFINFO(ifp)->retrans * hz / 1000); + LLE_WUNLOCK(ln); nd6_ns_output(ifp, NULL, &dst->sin6_addr, ln, 0); + if (lle != NULL && ln == lle) + LLE_WLOCK(lle); + + } else if (lle == NULL || ln != lle) { + /* + * We did the lookup (no lle arg) so we + * need to do the unlock here. + */ + LLE_WUNLOCK(ln); } + return (0); sendpkt: Modified: stable/8/sys/netinet6/nd6_nbr.c ============================================================================== --- stable/8/sys/netinet6/nd6_nbr.c Thu Dec 2 09:10:45 2010 (r216117) +++ stable/8/sys/netinet6/nd6_nbr.c Thu Dec 2 10:39:44 2010 (r216118) @@ -381,7 +381,6 @@ nd6_ns_output(struct ifnet *ifp, const s struct mbuf *m; struct ip6_hdr *ip6; struct nd_neighbor_solicit *nd_ns; - struct in6_addr *src, src_in; struct ip6_moptions im6o; int icmp6len; int maxlen; @@ -465,28 +464,35 @@ nd6_ns_output(struct ifnet *ifp, const s * - saddr6 belongs to the outgoing interface. * Otherwise, we perform the source address selection as usual. */ - struct ip6_hdr *hip6; /* hold ip6 */ - struct in6_addr *hsrc = NULL; + struct in6_addr *hsrc; - if ((ln != NULL) && ln->la_hold) { - /* - * assuming every packet in la_hold has the same IP - * header - */ - hip6 = mtod(ln->la_hold, struct ip6_hdr *); - /* XXX pullup? */ - if (sizeof(*hip6) < ln->la_hold->m_len) - hsrc = &hip6->ip6_src; - else - hsrc = NULL; + hsrc = NULL; + if (ln != NULL) { + LLE_RLOCK(ln); + if (ln->la_hold != NULL) { + struct ip6_hdr *hip6; /* hold ip6 */ + + /* + * assuming every packet in la_hold has the same IP + * header + */ + hip6 = mtod(ln->la_hold, struct ip6_hdr *); + /* XXX pullup? */ + if (sizeof(*hip6) < ln->la_hold->m_len) { + ip6->ip6_src = hip6->ip6_src; + hsrc = &hip6->ip6_src; + } + } + LLE_RUNLOCK(ln); } if (hsrc && (ifa = (struct ifaddr *)in6ifa_ifpwithaddr(ifp, hsrc)) != NULL) { - src = hsrc; + /* ip6_src set already. */ ifa_free(ifa); } else { int error; struct sockaddr_in6 dst_sa; + struct in6_addr src_in; bzero(&dst_sa, sizeof(dst_sa)); dst_sa.sin6_family = AF_INET6; @@ -504,7 +510,7 @@ nd6_ns_output(struct ifnet *ifp, const s error)); goto bad; } - src = &src_in; + ip6->ip6_src = src_in; } } else { /* @@ -514,10 +520,8 @@ nd6_ns_output(struct ifnet *ifp, const s * above), but we do so here explicitly to make the intention * clearer. */ - bzero(&src_in, sizeof(src_in)); - src = &src_in; + bzero(&ip6->ip6_src, sizeof(ip6->ip6_src)); } - ip6->ip6_src = *src; nd_ns = (struct nd_neighbor_solicit *)(ip6 + 1); nd_ns->nd_ns_type = ND_NEIGHBOR_SOLICIT; nd_ns->nd_ns_code = 0; From owner-svn-src-stable-8@FreeBSD.ORG Thu Dec 2 15:58:54 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA6EE1065670; Thu, 2 Dec 2010 15:58:54 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 695E88FC25; Thu, 2 Dec 2010 15:58:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB2FwsZq014878; Thu, 2 Dec 2010 15:58:54 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB2FwsIT014875; Thu, 2 Dec 2010 15:58:54 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201012021558.oB2FwsIT014875@svn.freebsd.org> From: John Baldwin Date: Thu, 2 Dec 2010 15:58:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216123 - in stable/8/sys: dev/pci i386/pci X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Dec 2010 15:58:54 -0000 Author: jhb Date: Thu Dec 2 15:58:54 2010 New Revision: 216123 URL: http://svn.freebsd.org/changeset/base/216123 Log: MFC 215820: Add device IDs for two more ServerWorks Host-PCI bridges so that we can read their starting PCI bus number for older systems that do not support ACPI (or have a broken _BBN method). Approved by: re (kib) Modified: stable/8/sys/dev/pci/pci_pci.c stable/8/sys/i386/pci/pci_bus.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/pci/pci_pci.c ============================================================================== --- stable/8/sys/dev/pci/pci_pci.c Thu Dec 2 15:10:27 2010 (r216122) +++ stable/8/sys/dev/pci/pci_pci.c Thu Dec 2 15:58:54 2010 (r216123) @@ -716,7 +716,9 @@ host_pcib_get_busno(pci_read_config_fn r case 0x00171166: case 0x01011166: case 0x010f1014: + case 0x01101166: case 0x02011166: + case 0x02251166: case 0x03021014: *busnum = read_config(bus, slot, func, 0x44, 1); break; Modified: stable/8/sys/i386/pci/pci_bus.c ============================================================================== --- stable/8/sys/i386/pci/pci_bus.c Thu Dec 2 15:10:27 2010 (r216122) +++ stable/8/sys/i386/pci/pci_bus.c Thu Dec 2 15:58:54 2010 (r216123) @@ -204,6 +204,9 @@ legacy_pcib_is_host_bridge(int bus, int break; } break; + case 0x1A308086: + s = "Intel 82845 Host to PCI bridge"; + break; /* AMD -- vendor 0x1022 */ case 0x30001022: @@ -304,6 +307,8 @@ legacy_pcib_is_host_bridge(int bus, int case 0x00171166: /* FALLTHROUGH */ case 0x01011166: + case 0x01101166: + case 0x02251166: s = "ServerWorks host to PCI bridge(unknown chipset)"; *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1); break; From owner-svn-src-stable-8@FreeBSD.ORG Fri Dec 3 16:21:12 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DB32C106564A; Fri, 3 Dec 2010 16:21:12 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C8A028FC1F; Fri, 3 Dec 2010 16:21:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB3GLCA0097049; Fri, 3 Dec 2010 16:21:12 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB3GLCeJ097047; Fri, 3 Dec 2010 16:21:12 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201012031621.oB3GLCeJ097047@svn.freebsd.org> From: Colin Percival Date: Fri, 3 Dec 2010 16:21:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216152 - stable/8/usr.sbin/crashinfo X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Dec 2010 16:21:13 -0000 Author: cperciva Date: Fri Dec 3 16:21:12 2010 New Revision: 216152 URL: http://svn.freebsd.org/changeset/base/216152 Log: MFC r216077: Teach crashinfo(8) about the kern.bootfile sysctl. Approved by: re (bz) Modified: stable/8/usr.sbin/crashinfo/crashinfo.sh Directory Properties: stable/8/usr.sbin/crashinfo/ (props changed) Modified: stable/8/usr.sbin/crashinfo/crashinfo.sh ============================================================================== --- stable/8/usr.sbin/crashinfo/crashinfo.sh Fri Dec 3 16:17:53 2010 (r216151) +++ stable/8/usr.sbin/crashinfo/crashinfo.sh Fri Dec 3 16:21:12 2010 (r216152) @@ -53,7 +53,7 @@ find_kernel() }' $INFO) # Look for a matching kernel version. - for k in /boot/kernel/kernel $(ls -t /boot/*/kernel); do + for k in `sysctl -n kern.bootfile` $(ls -t /boot/*/kernel); do kvers=$(echo 'printf " Version String: %s", version' | \ gdb -x /dev/stdin -batch $k 2>/dev/null) if [ "$ivers" = "$kvers" ]; then From owner-svn-src-stable-8@FreeBSD.ORG Fri Dec 3 16:40:48 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 360071065672; Fri, 3 Dec 2010 16:40:48 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2318D8FC0C; Fri, 3 Dec 2010 16:40:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB3GemoL098364; Fri, 3 Dec 2010 16:40:48 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB3Gem8Z098360; Fri, 3 Dec 2010 16:40:48 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201012031640.oB3Gem8Z098360@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 3 Dec 2010 16:40:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216155 - stable/8/sys/crypto/via X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Dec 2010 16:40:48 -0000 Author: kib Date: Fri Dec 3 16:40:47 2010 New Revision: 216155 URL: http://svn.freebsd.org/changeset/base/216155 Log: MFC r215864: MFaesni r215427: Only save FPU context when not executing in the context of the crypto thread. Approved by: re (bz) Modified: stable/8/sys/crypto/via/padlock.c stable/8/sys/crypto/via/padlock_cipher.c stable/8/sys/crypto/via/padlock_hash.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/crypto/via/padlock.c ============================================================================== --- stable/8/sys/crypto/via/padlock.c Fri Dec 3 16:37:37 2010 (r216154) +++ stable/8/sys/crypto/via/padlock.c Fri Dec 3 16:40:47 2010 (r216155) @@ -170,7 +170,7 @@ padlock_newsession(device_t dev, uint32_ struct padlock_session *ses = NULL; struct cryptoini *encini, *macini; struct thread *td; - int error; + int error, saved_ctx; if (sidp == NULL || cri == NULL) return (EINVAL); @@ -238,10 +238,18 @@ padlock_newsession(device_t dev, uint32_ if (macini != NULL) { td = curthread; - error = fpu_kern_enter(td, &ses->ses_fpu_ctx, FPU_KERN_NORMAL); + if (!is_fpu_kern_thread(0)) { + error = fpu_kern_enter(td, &ses->ses_fpu_ctx, + FPU_KERN_NORMAL); + saved_ctx = 1; + } else { + error = 0; + saved_ctx = 0; + } if (error == 0) { error = padlock_hash_setup(ses, macini); - fpu_kern_leave(td, &ses->ses_fpu_ctx); + if (saved_ctx) + fpu_kern_leave(td, &ses->ses_fpu_ctx); } if (error != 0) { padlock_freesession_one(sc, ses, 0); Modified: stable/8/sys/crypto/via/padlock_cipher.c ============================================================================== --- stable/8/sys/crypto/via/padlock_cipher.c Fri Dec 3 16:37:37 2010 (r216154) +++ stable/8/sys/crypto/via/padlock_cipher.c Fri Dec 3 16:40:47 2010 (r216155) @@ -205,7 +205,7 @@ padlock_cipher_process(struct padlock_se struct thread *td; u_char *buf, *abuf; uint32_t *key; - int allocated, error; + int allocated, error, saved_ctx; buf = padlock_cipher_alloc(enccrd, crp, &allocated); if (buf == NULL) @@ -250,14 +250,21 @@ padlock_cipher_process(struct padlock_se } td = curthread; - error = fpu_kern_enter(td, &ses->ses_fpu_ctx, FPU_KERN_NORMAL); + if (!is_fpu_kern_thread(0)) { + error = fpu_kern_enter(td, &ses->ses_fpu_ctx, FPU_KERN_NORMAL); + saved_ctx = 1; + } else { + error = 0; + saved_ctx = 0; + } if (error != 0) goto out; padlock_cbc(abuf, abuf, enccrd->crd_len / AES_BLOCK_LEN, key, cw, ses->ses_iv); - fpu_kern_leave(td, &ses->ses_fpu_ctx); + if (saved_ctx) + fpu_kern_leave(td, &ses->ses_fpu_ctx); if (allocated) { crypto_copyback(crp->crp_flags, crp->crp_buf, enccrd->crd_skip, Modified: stable/8/sys/crypto/via/padlock_hash.c ============================================================================== --- stable/8/sys/crypto/via/padlock_hash.c Fri Dec 3 16:37:37 2010 (r216154) +++ stable/8/sys/crypto/via/padlock_hash.c Fri Dec 3 16:40:47 2010 (r216155) @@ -366,17 +366,24 @@ padlock_hash_process(struct padlock_sess struct cryptop *crp) { struct thread *td; - int error; + int error, saved_ctx; td = curthread; - error = fpu_kern_enter(td, &ses->ses_fpu_ctx, FPU_KERN_NORMAL); + if (!is_fpu_kern_thread(0)) { + error = fpu_kern_enter(td, &ses->ses_fpu_ctx, FPU_KERN_NORMAL); + saved_ctx = 1; + } else { + error = 0; + saved_ctx = 0; + } if (error != 0) return (error); if ((maccrd->crd_flags & CRD_F_KEY_EXPLICIT) != 0) padlock_hash_key_setup(ses, maccrd->crd_key, maccrd->crd_klen); error = padlock_authcompute(ses, maccrd, crp->crp_buf, crp->crp_flags); - fpu_kern_leave(td, &ses->ses_fpu_ctx); + if (saved_ctx) + fpu_kern_leave(td, &ses->ses_fpu_ctx); return (error); } From owner-svn-src-stable-8@FreeBSD.ORG Fri Dec 3 21:52:01 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AE4FF106566C; Fri, 3 Dec 2010 21:52:01 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9C50F8FC14; Fri, 3 Dec 2010 21:52:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB3Lq1Qb035129; Fri, 3 Dec 2010 21:52:01 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB3Lq1bh035126; Fri, 3 Dec 2010 21:52:01 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201012032152.oB3Lq1bh035126@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 3 Dec 2010 21:52:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216160 - stable/8/sys/fs/procfs X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Dec 2010 21:52:01 -0000 Author: kib Date: Fri Dec 3 21:52:01 2010 New Revision: 216160 URL: http://svn.freebsd.org/changeset/base/216160 Log: MFC r216120: For /proc//{regs,fpregs} read access, require the thread to be in stopped state. Otherwise, return EBUSY as is done for write case. Approved by: re (bz) Modified: stable/8/sys/fs/procfs/procfs_fpregs.c stable/8/sys/fs/procfs/procfs_regs.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/fs/procfs/procfs_fpregs.c ============================================================================== --- stable/8/sys/fs/procfs/procfs_fpregs.c Fri Dec 3 21:06:30 2010 (r216159) +++ stable/8/sys/fs/procfs/procfs_fpregs.c Fri Dec 3 21:52:01 2010 (r216160) @@ -97,6 +97,10 @@ procfs_doprocfpregs(PFS_FILL_ARGS) PROC_UNLOCK(p); return (EPERM); } + if (!P_SHOULDSTOP(p)) { + PROC_UNLOCK(p); + return (EBUSY); + } /* XXXKSE: */ td2 = FIRST_THREAD_IN_PROC(p); Modified: stable/8/sys/fs/procfs/procfs_regs.c ============================================================================== --- stable/8/sys/fs/procfs/procfs_regs.c Fri Dec 3 21:06:30 2010 (r216159) +++ stable/8/sys/fs/procfs/procfs_regs.c Fri Dec 3 21:52:01 2010 (r216160) @@ -97,6 +97,10 @@ procfs_doprocregs(PFS_FILL_ARGS) PROC_UNLOCK(p); return (EPERM); } + if (!P_SHOULDSTOP(p)) { + PROC_UNLOCK(p); + return (EBUSY); + } /* XXXKSE: */ td2 = FIRST_THREAD_IN_PROC(p); From owner-svn-src-stable-8@FreeBSD.ORG Fri Dec 3 22:07:07 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C64E1065672; Fri, 3 Dec 2010 22:07:07 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 87E0B8FC27; Fri, 3 Dec 2010 22:07:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB3M77fW038225; Fri, 3 Dec 2010 22:07:07 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB3M77JC038214; Fri, 3 Dec 2010 22:07:07 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201012032207.oB3M77JC038214@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 3 Dec 2010 22:07:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216162 - in stable/8/sys: amd64/amd64 amd64/ia32 amd64/include i386/i386 i386/include i386/isa pc98/pc98 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Dec 2010 22:07:07 -0000 Author: kib Date: Fri Dec 3 22:07:07 2010 New Revision: 216162 URL: http://svn.freebsd.org/changeset/base/216162 Log: MFC r209463: Fix bugs on pc98, use npxgetuserregs() instead of npxgetregs() for get_fpcontext(), and npxsetuserregs() for set_fpcontext). Also, note that usercontext is not initialized anymore in fpstate_drop(). Systematically replace references to npxgetregs() and npxsetregs() by npxgetuserregs() and npxsetuserregs() in comments. MFC r215865: Remove npxgetregs(), npxsetregs(), fpugetregs() and fpusetregs() functions, they are unused. Remove 'user' from npxgetuserregs() etc. names. For {npx,fpu}{get,set}regs(), always use pcb->pcb_user_save for FPU context storage. MFC r216012: Calling fill_fpregs() for curthread is legitimate, and ELF coredump does this. Approved by: re (bz) Modified: stable/8/sys/amd64/amd64/fpu.c stable/8/sys/amd64/amd64/machdep.c stable/8/sys/amd64/ia32/ia32_reg.c stable/8/sys/amd64/ia32/ia32_signal.c stable/8/sys/amd64/include/fpu.h stable/8/sys/i386/i386/machdep.c stable/8/sys/i386/include/npx.h stable/8/sys/i386/isa/npx.c stable/8/sys/pc98/pc98/machdep.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/amd64/amd64/fpu.c ============================================================================== --- stable/8/sys/amd64/amd64/fpu.c Fri Dec 3 21:54:10 2010 (r216161) +++ stable/8/sys/amd64/amd64/fpu.c Fri Dec 3 22:07:07 2010 (r216162) @@ -426,9 +426,7 @@ fpudna(void) fxrstor(&fpu_initialstate); if (pcb->pcb_initial_fpucw != __INITIAL_FPUCW__) fldcw(pcb->pcb_initial_fpucw); - pcb->pcb_flags |= PCB_FPUINITDONE; - if (PCB_USER_FPU(pcb)) - pcb->pcb_flags |= PCB_USERFPUINITDONE; + fpuuserinited(curthread); } else fxrstor(pcb->pcb_save); critical_exit(); @@ -448,60 +446,50 @@ fpudrop() } /* - * Get the state of the FPU without dropping ownership (if possible). - * It returns the FPU ownership status. + * Get the user state of the FPU into pcb->pcb_user_save without + * dropping ownership (if possible). It returns the FPU ownership + * status. */ int -fpugetuserregs(struct thread *td, struct savefpu *addr) +fpugetregs(struct thread *td) { struct pcb *pcb; pcb = td->td_pcb; if ((pcb->pcb_flags & PCB_USERFPUINITDONE) == 0) { - bcopy(&fpu_initialstate, addr, sizeof(fpu_initialstate)); - addr->sv_env.en_cw = pcb->pcb_initial_fpucw; - return (_MC_FPOWNED_NONE); + bcopy(&fpu_initialstate, &pcb->pcb_user_save, + sizeof(fpu_initialstate)); + pcb->pcb_user_save.sv_env.en_cw = pcb->pcb_initial_fpucw; + fpuuserinited(td); + return (_MC_FPOWNED_PCB); } critical_enter(); if (td == PCPU_GET(fpcurthread) && PCB_USER_FPU(pcb)) { - fxsave(addr); + fxsave(&pcb->pcb_user_save); critical_exit(); return (_MC_FPOWNED_FPU); } else { critical_exit(); - bcopy(&pcb->pcb_user_save, addr, sizeof(*addr)); return (_MC_FPOWNED_PCB); } } -int -fpugetregs(struct thread *td, struct savefpu *addr) +void +fpuuserinited(struct thread *td) { struct pcb *pcb; pcb = td->td_pcb; - if ((pcb->pcb_flags & PCB_FPUINITDONE) == 0) { - bcopy(&fpu_initialstate, addr, sizeof(fpu_initialstate)); - addr->sv_env.en_cw = pcb->pcb_initial_fpucw; - return (_MC_FPOWNED_NONE); - } - critical_enter(); - if (td == PCPU_GET(fpcurthread)) { - fxsave(addr); - critical_exit(); - return (_MC_FPOWNED_FPU); - } else { - critical_exit(); - bcopy(pcb->pcb_save, addr, sizeof(*addr)); - return (_MC_FPOWNED_PCB); - } + if (PCB_USER_FPU(pcb)) + pcb->pcb_flags |= PCB_FPUINITDONE; + pcb->pcb_flags |= PCB_USERFPUINITDONE; } /* * Set the state of the FPU. */ void -fpusetuserregs(struct thread *td, struct savefpu *addr) +fpusetregs(struct thread *td, struct savefpu *addr) { struct pcb *pcb; @@ -514,31 +502,10 @@ fpusetuserregs(struct thread *td, struct } else { critical_exit(); bcopy(addr, &td->td_pcb->pcb_user_save, sizeof(*addr)); - if (PCB_USER_FPU(pcb)) - pcb->pcb_flags |= PCB_FPUINITDONE; - pcb->pcb_flags |= PCB_USERFPUINITDONE; + fpuuserinited(td); } } -void -fpusetregs(struct thread *td, struct savefpu *addr) -{ - struct pcb *pcb; - - pcb = td->td_pcb; - critical_enter(); - if (td == PCPU_GET(fpcurthread)) { - fxrstor(addr); - critical_exit(); - } else { - critical_exit(); - bcopy(addr, td->td_pcb->pcb_save, sizeof(*addr)); - } - if (PCB_USER_FPU(pcb)) - pcb->pcb_flags |= PCB_USERFPUINITDONE; - pcb->pcb_flags |= PCB_FPUINITDONE; -} - /* * On AuthenticAMD processors, the fxrstor instruction does not restore * the x87's stored last instruction pointer, last data pointer, and last Modified: stable/8/sys/amd64/amd64/machdep.c ============================================================================== --- stable/8/sys/amd64/amd64/machdep.c Fri Dec 3 21:54:10 2010 (r216161) +++ stable/8/sys/amd64/amd64/machdep.c Fri Dec 3 22:07:07 2010 (r216162) @@ -1964,6 +1964,9 @@ int fill_fpregs(struct thread *td, struct fpreg *fpregs) { + KASSERT(td == curthread || TD_IS_SUSPENDED(td), + ("not suspended thread %p", td)); + fpugetregs(td); fill_fpregs_xmm(&td->td_pcb->pcb_user_save, fpregs); return (0); } @@ -1974,6 +1977,7 @@ set_fpregs(struct thread *td, struct fpr { set_fpregs_xmm(fpregs, &td->td_pcb->pcb_user_save); + fpuuserinited(td); return (0); } @@ -2088,8 +2092,9 @@ static void get_fpcontext(struct thread *td, mcontext_t *mcp) { - mcp->mc_ownedfp = fpugetuserregs(td, - (struct savefpu *)&mcp->mc_fpstate); + mcp->mc_ownedfp = fpugetregs(td); + bcopy(&td->td_pcb->pcb_user_save, &mcp->mc_fpstate, + sizeof(mcp->mc_fpstate)); mcp->mc_fpformat = fpuformat(); } @@ -2109,7 +2114,7 @@ set_fpcontext(struct thread *td, const m mcp->mc_ownedfp == _MC_FPOWNED_PCB) { fpstate = (struct savefpu *)&mcp->mc_fpstate; fpstate->sv_env.en_mxcsr &= cpu_mxcsr_mask; - fpusetuserregs(td, fpstate); + fpusetregs(td, fpstate); } else return (EINVAL); return (0); @@ -2127,10 +2132,10 @@ fpstate_drop(struct thread *td) * XXX force a full drop of the fpu. The above only drops it if we * owned it. * - * XXX I don't much like fpugetregs()'s semantics of doing a full + * XXX I don't much like fpugetuserregs()'s semantics of doing a full * drop. Dropping only to the pcb matches fnsave's behaviour. * We only need to drop to !PCB_INITDONE in sendsig(). But - * sendsig() is the only caller of fpugetregs()... perhaps we just + * sendsig() is the only caller of fpugetuserregs()... perhaps we just * have too many layers. */ curthread->td_pcb->pcb_flags &= ~(PCB_FPUINITDONE | Modified: stable/8/sys/amd64/ia32/ia32_reg.c ============================================================================== --- stable/8/sys/amd64/ia32/ia32_reg.c Fri Dec 3 21:54:10 2010 (r216161) +++ stable/8/sys/amd64/ia32/ia32_reg.c Fri Dec 3 22:07:07 2010 (r216162) @@ -145,13 +145,18 @@ set_regs32(struct thread *td, struct reg int fill_fpregs32(struct thread *td, struct fpreg32 *regs) { - struct save87 *sv_87 = (struct save87 *)regs; - struct env87 *penv_87 = &sv_87->sv_env; - struct savefpu *sv_fpu = &td->td_pcb->pcb_user_save; - struct envxmm *penv_xmm = &sv_fpu->sv_env; + struct savefpu *sv_fpu; + struct save87 *sv_87; + struct env87 *penv_87; + struct envxmm *penv_xmm; int i; bzero(regs, sizeof(*regs)); + sv_87 = (struct save87 *)regs; + penv_87 = &sv_87->sv_env; + fpugetregs(td); + sv_fpu = &td->td_pcb->pcb_user_save; + penv_xmm = &sv_fpu->sv_env; /* FPU control/status */ penv_87->en_cw = penv_xmm->en_cw; @@ -200,6 +205,7 @@ set_fpregs32(struct thread *td, struct f sv_fpu->sv_fp[i].fp_acc = sv_87->sv_ac[i]; for (i = 8; i < 16; ++i) bzero(&sv_fpu->sv_fp[i].fp_acc, sizeof(sv_fpu->sv_fp[i].fp_acc)); + fpuuserinited(td); return (0); } Modified: stable/8/sys/amd64/ia32/ia32_signal.c ============================================================================== --- stable/8/sys/amd64/ia32/ia32_signal.c Fri Dec 3 21:54:10 2010 (r216161) +++ stable/8/sys/amd64/ia32/ia32_signal.c Fri Dec 3 22:07:07 2010 (r216162) @@ -98,8 +98,9 @@ ia32_get_fpcontext(struct thread *td, st * 64bit instruction and data pointers. Ignore the difference * for now, it should be irrelevant for most applications. */ - mcp->mc_ownedfp = fpugetuserregs(td, - (struct savefpu *)&mcp->mc_fpstate); + mcp->mc_ownedfp = fpugetregs(td); + bcopy(&td->td_pcb->pcb_user_save, &mcp->mc_fpstate, + sizeof(mcp->mc_fpstate)); mcp->mc_fpformat = fpuformat(); } @@ -116,7 +117,7 @@ ia32_set_fpcontext(struct thread *td, co fpstate_drop(td); else if (mcp->mc_ownedfp == _MC_FPOWNED_FPU || mcp->mc_ownedfp == _MC_FPOWNED_PCB) { - fpusetuserregs(td, (struct savefpu *)&mcp->mc_fpstate); + fpusetregs(td, (struct savefpu *)&mcp->mc_fpstate); } else return (EINVAL); return (0); Modified: stable/8/sys/amd64/include/fpu.h ============================================================================== --- stable/8/sys/amd64/include/fpu.h Fri Dec 3 21:54:10 2010 (r216161) +++ stable/8/sys/amd64/include/fpu.h Fri Dec 3 22:07:07 2010 (r216162) @@ -112,12 +112,11 @@ void fpudna(void); void fpudrop(void); void fpuexit(struct thread *td); int fpuformat(void); -int fpugetregs(struct thread *td, struct savefpu *addr); -int fpugetuserregs(struct thread *td, struct savefpu *addr); +int fpugetregs(struct thread *td); void fpuinit(void); void fpusetregs(struct thread *td, struct savefpu *addr); -void fpusetuserregs(struct thread *td, struct savefpu *addr); int fputrap(void); +void fpuuserinited(struct thread *td); int fpu_kern_enter(struct thread *td, struct fpu_kern_ctx *ctx, u_int flags); int fpu_kern_leave(struct thread *td, struct fpu_kern_ctx *ctx); Modified: stable/8/sys/i386/i386/machdep.c ============================================================================== --- stable/8/sys/i386/i386/machdep.c Fri Dec 3 21:54:10 2010 (r216161) +++ stable/8/sys/i386/i386/machdep.c Fri Dec 3 22:07:07 2010 (r216162) @@ -632,13 +632,6 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sf.sf_uc.uc_mcontext.mc_gs = rgs(); bcopy(regs, &sf.sf_uc.uc_mcontext.mc_fs, sizeof(*regs)); sf.sf_uc.uc_mcontext.mc_len = sizeof(sf.sf_uc.uc_mcontext); /* magic */ - - /* - * The get_fpcontext() call must be placed before assignments - * to mc_fsbase and mc_gsbase due to the alignment-override - * code in get_fpcontext() that possibly clobbers 12 bytes of - * mcontext after mc_fpstate. - */ get_fpcontext(td, &sf.sf_uc.uc_mcontext); fpstate_drop(td); /* @@ -3186,28 +3179,34 @@ set_fpregs_xmm(sv_87, sv_xmm) int fill_fpregs(struct thread *td, struct fpreg *fpregs) { + + KASSERT(td == curthread || TD_IS_SUSPENDED(td), + ("not suspended thread %p", td)); + npxgetregs(td); #ifdef CPU_ENABLE_SSE - if (cpu_fxsr) { + if (cpu_fxsr) fill_fpregs_xmm(&td->td_pcb->pcb_user_save.sv_xmm, - (struct save87 *)fpregs); - return (0); - } + (struct save87 *)fpregs); + else #endif /* CPU_ENABLE_SSE */ - bcopy(&td->td_pcb->pcb_user_save.sv_87, fpregs, sizeof *fpregs); + bcopy(&td->td_pcb->pcb_user_save.sv_87, fpregs, + sizeof(*fpregs)); return (0); } int set_fpregs(struct thread *td, struct fpreg *fpregs) { + #ifdef CPU_ENABLE_SSE - if (cpu_fxsr) { + if (cpu_fxsr) set_fpregs_xmm((struct save87 *)fpregs, &td->td_pcb->pcb_user_save.sv_xmm); - return (0); - } + else #endif /* CPU_ENABLE_SSE */ - bcopy(fpregs, &td->td_pcb->pcb_user_save.sv_87, sizeof *fpregs); + bcopy(fpregs, &td->td_pcb->pcb_user_save.sv_87, + sizeof(*fpregs)); + npxuserinited(td); return (0); } @@ -3249,13 +3248,6 @@ get_mcontext(struct thread *td, mcontext mcp->mc_esp = tp->tf_esp; mcp->mc_ss = tp->tf_ss; mcp->mc_len = sizeof(*mcp); - - /* - * The get_fpcontext() call must be placed before assignments - * to mc_fsbase and mc_gsbase due to the alignment-override - * code in get_fpcontext() that possibly clobbers 12 bytes of - * mcontext after mc_fpstate. - */ get_fpcontext(td, mcp); sdp = &td->td_pcb->pcb_fsd; mcp->mc_fsbase = sdp->sd_hibase << 24 | sdp->sd_lobase; @@ -3306,39 +3298,14 @@ set_mcontext(struct thread *td, const mc static void get_fpcontext(struct thread *td, mcontext_t *mcp) { + #ifndef DEV_NPX mcp->mc_fpformat = _MC_FPFMT_NODEV; mcp->mc_ownedfp = _MC_FPOWNED_NONE; #else - union savefpu *addr; - - /* - * XXX mc_fpstate might be misaligned, since its declaration is not - * unportabilized using __attribute__((aligned(16))) like the - * declaration of struct savemm, and anyway, alignment doesn't work - * for auto variables since we don't use gcc's pessimal stack - * alignment. Work around this by abusing the spare fields after - * mcp->mc_fpstate. - * - * XXX unpessimize most cases by only aligning when fxsave might be - * called, although this requires knowing too much about - * npxgetregs()'s internals. - */ - addr = (union savefpu *)&mcp->mc_fpstate; - if (td == PCPU_GET(fpcurthread) && -#ifdef CPU_ENABLE_SSE - cpu_fxsr && -#endif - ((uintptr_t)(void *)addr & 0xF)) { - do - addr = (void *)((char *)addr + 4); - while ((uintptr_t)(void *)addr & 0xF); - } - mcp->mc_ownedfp = npxgetuserregs(td, addr); - if (addr != (union savefpu *)&mcp->mc_fpstate) { - bcopy(addr, &mcp->mc_fpstate, sizeof(mcp->mc_fpstate)); - bzero(&mcp->mc_spare2, sizeof(mcp->mc_spare2)); - } + mcp->mc_ownedfp = npxgetregs(td); + bcopy(&td->td_pcb->pcb_user_save, &mcp->mc_fpstate, + sizeof(mcp->mc_fpstate)); mcp->mc_fpformat = npxformat(); #endif } @@ -3346,7 +3313,6 @@ get_fpcontext(struct thread *td, mcontex static int set_fpcontext(struct thread *td, const mcontext_t *mcp) { - union savefpu *addr; if (mcp->mc_fpformat == _MC_FPFMT_NODEV) return (0); @@ -3358,34 +3324,14 @@ set_fpcontext(struct thread *td, const m fpstate_drop(td); else if (mcp->mc_ownedfp == _MC_FPOWNED_FPU || mcp->mc_ownedfp == _MC_FPOWNED_PCB) { - /* XXX align as above. */ - addr = (union savefpu *)&mcp->mc_fpstate; - if (td == PCPU_GET(fpcurthread) && -#ifdef CPU_ENABLE_SSE - cpu_fxsr && -#endif - ((uintptr_t)(void *)addr & 0xF)) { - do - addr = (void *)((char *)addr + 4); - while ((uintptr_t)(void *)addr & 0xF); - bcopy(&mcp->mc_fpstate, addr, sizeof(mcp->mc_fpstate)); - } #ifdef DEV_NPX #ifdef CPU_ENABLE_SSE if (cpu_fxsr) - addr->sv_xmm.sv_env.en_mxcsr &= cpu_mxcsr_mask; + ((union savefpu *)&mcp->mc_fpstate)->sv_xmm.sv_env. + en_mxcsr &= cpu_mxcsr_mask; #endif - /* - * XXX we violate the dubious requirement that npxsetregs() - * be called with interrupts disabled. - */ - npxsetuserregs(td, addr); + npxsetregs(td, (union savefpu *)&mcp->mc_fpstate); #endif - /* - * Don't bother putting things back where they were in the - * misaligned case, since we know that the caller won't use - * them again. - */ } else return (EINVAL); return (0); Modified: stable/8/sys/i386/include/npx.h ============================================================================== --- stable/8/sys/i386/include/npx.h Fri Dec 3 21:54:10 2010 (r216161) +++ stable/8/sys/i386/include/npx.h Fri Dec 3 22:07:07 2010 (r216162) @@ -151,13 +151,12 @@ int npxdna(void); void npxdrop(void); void npxexit(struct thread *td); int npxformat(void); -int npxgetregs(struct thread *td, union savefpu *addr); -int npxgetuserregs(struct thread *td, union savefpu *addr); +int npxgetregs(struct thread *td); void npxinit(void); void npxsave(union savefpu *addr); void npxsetregs(struct thread *td, union savefpu *addr); -void npxsetuserregs(struct thread *td, union savefpu *addr); int npxtrap(void); +void npxuserinited(struct thread *); int fpu_kern_enter(struct thread *td, struct fpu_kern_ctx *ctx, u_int flags); int fpu_kern_leave(struct thread *td, struct fpu_kern_ctx *ctx); Modified: stable/8/sys/i386/isa/npx.c ============================================================================== --- stable/8/sys/i386/isa/npx.c Fri Dec 3 21:54:10 2010 (r216161) +++ stable/8/sys/i386/isa/npx.c Fri Dec 3 22:07:07 2010 (r216162) @@ -684,9 +684,7 @@ npxdna(void) fpurstor(&npx_initialstate); if (pcb->pcb_initial_npxcw != __INITIAL_NPXCW__) fldcw(pcb->pcb_initial_npxcw); - pcb->pcb_flags |= PCB_NPXINITDONE; - if (PCB_USER_FPU(pcb)) - pcb->pcb_flags |= PCB_NPXUSERINITDONE; + npxuserinited(curthread); } else { /* * The following fpurstor() may cause an IRQ13 when the @@ -767,11 +765,12 @@ npxdrop() } /* - * Get the state of the FPU without dropping ownership (if possible). - * It returns the FPU ownership status. + * Get the user state of the FPU into pcb->pcb_user_save without + * dropping ownership (if possible). It returns the FPU ownership + * status. */ int -npxgetregs(struct thread *td, union savefpu *addr) +npxgetregs(struct thread *td) { struct pcb *pcb; @@ -780,48 +779,15 @@ npxgetregs(struct thread *td, union save pcb = td->td_pcb; if ((pcb->pcb_flags & PCB_NPXINITDONE) == 0) { - bcopy(&npx_initialstate, addr, sizeof(npx_initialstate)); - SET_FPU_CW(addr, pcb->pcb_initial_npxcw); - return (_MC_FPOWNED_NONE); - } - critical_enter(); - if (td == PCPU_GET(fpcurthread)) { - fpusave(addr); -#ifdef CPU_ENABLE_SSE - if (!cpu_fxsr) -#endif - /* - * fnsave initializes the FPU and destroys whatever - * context it contains. Make sure the FPU owner - * starts with a clean state next time. - */ - npxdrop(); - critical_exit(); - return (_MC_FPOWNED_FPU); - } else { - critical_exit(); - bcopy(pcb->pcb_save, addr, sizeof(*addr)); + bcopy(&npx_initialstate, &pcb->pcb_user_save, + sizeof(npx_initialstate)); + SET_FPU_CW(&pcb->pcb_user_save, pcb->pcb_initial_npxcw); + npxuserinited(td); return (_MC_FPOWNED_PCB); } -} - -int -npxgetuserregs(struct thread *td, union savefpu *addr) -{ - struct pcb *pcb; - - if (!hw_float) - return (_MC_FPOWNED_NONE); - - pcb = td->td_pcb; - if ((pcb->pcb_flags & PCB_NPXUSERINITDONE) == 0) { - bcopy(&npx_initialstate, addr, sizeof(npx_initialstate)); - SET_FPU_CW(addr, pcb->pcb_initial_npxcw); - return (_MC_FPOWNED_NONE); - } critical_enter(); - if (td == PCPU_GET(fpcurthread) && PCB_USER_FPU(pcb)) { - fpusave(addr); + if (td == PCPU_GET(fpcurthread)) { + fpusave(&pcb->pcb_user_save); #ifdef CPU_ENABLE_SSE if (!cpu_fxsr) #endif @@ -835,42 +801,24 @@ npxgetuserregs(struct thread *td, union return (_MC_FPOWNED_FPU); } else { critical_exit(); - bcopy(&pcb->pcb_user_save, addr, sizeof(*addr)); return (_MC_FPOWNED_PCB); } } -/* - * Set the state of the FPU. - */ void -npxsetregs(struct thread *td, union savefpu *addr) +npxuserinited(struct thread *td) { struct pcb *pcb; - if (!hw_float) - return; - pcb = td->td_pcb; - critical_enter(); - if (td == PCPU_GET(fpcurthread)) { -#ifdef CPU_ENABLE_SSE - if (!cpu_fxsr) -#endif - fnclex(); /* As in npxdrop(). */ - fpurstor(addr); - critical_exit(); - } else { - critical_exit(); - bcopy(addr, pcb->pcb_save, sizeof(*addr)); - } if (PCB_USER_FPU(pcb)) - pcb->pcb_flags |= PCB_NPXUSERINITDONE; - pcb->pcb_flags |= PCB_NPXINITDONE; + pcb->pcb_flags |= PCB_NPXINITDONE; + pcb->pcb_flags |= PCB_NPXUSERINITDONE; } + void -npxsetuserregs(struct thread *td, union savefpu *addr) +npxsetregs(struct thread *td, union savefpu *addr) { struct pcb *pcb; @@ -884,15 +832,17 @@ npxsetuserregs(struct thread *td, union if (!cpu_fxsr) #endif fnclex(); /* As in npxdrop(). */ - fpurstor(addr); + if (((uintptr_t)addr & 0xf) != 0) { + bcopy(addr, &pcb->pcb_user_save, sizeof(*addr)); + fpurstor(&pcb->pcb_user_save); + } else + fpurstor(addr); critical_exit(); pcb->pcb_flags |= PCB_NPXUSERINITDONE | PCB_NPXINITDONE; } else { critical_exit(); bcopy(addr, &pcb->pcb_user_save, sizeof(*addr)); - if (PCB_USER_FPU(pcb)) - pcb->pcb_flags |= PCB_NPXINITDONE; - pcb->pcb_flags |= PCB_NPXUSERINITDONE; + npxuserinited(td); } } Modified: stable/8/sys/pc98/pc98/machdep.c ============================================================================== --- stable/8/sys/pc98/pc98/machdep.c Fri Dec 3 21:54:10 2010 (r216161) +++ stable/8/sys/pc98/pc98/machdep.c Fri Dec 3 22:07:07 2010 (r216162) @@ -567,13 +567,6 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sf.sf_uc.uc_mcontext.mc_gs = rgs(); bcopy(regs, &sf.sf_uc.uc_mcontext.mc_fs, sizeof(*regs)); sf.sf_uc.uc_mcontext.mc_len = sizeof(sf.sf_uc.uc_mcontext); /* magic */ - - /* - * The get_fpcontext() call must be placed before assignments - * to mc_fsbase and mc_gsbase due to the alignment-override - * code in get_fpcontext() that possibly clobbers 12 bytes of - * mcontext after mc_fpstate. - */ get_fpcontext(td, &sf.sf_uc.uc_mcontext); fpstate_drop(td); /* @@ -2526,28 +2519,33 @@ set_fpregs_xmm(sv_87, sv_xmm) int fill_fpregs(struct thread *td, struct fpreg *fpregs) { + + KASSERT(TD_IS_SUSPENDED(td), ("not suspended thread %p", td)); + npxgetregs(td); #ifdef CPU_ENABLE_SSE - if (cpu_fxsr) { - fill_fpregs_xmm(&td->td_pcb->pcb_save->sv_xmm, - (struct save87 *)fpregs); - return (0); - } + if (cpu_fxsr) + fill_fpregs_xmm(&td->td_pcb->pcb_user_save.sv_xmm, + (struct save87 *)fpregs); + else #endif /* CPU_ENABLE_SSE */ - bcopy(&td->td_pcb->pcb_save->sv_87, fpregs, sizeof *fpregs); + bcopy(&td->td_pcb->pcb_user_save.sv_87, fpregs, + sizeof(*fpregs)); return (0); } int set_fpregs(struct thread *td, struct fpreg *fpregs) { + #ifdef CPU_ENABLE_SSE - if (cpu_fxsr) { + if (cpu_fxsr) set_fpregs_xmm((struct save87 *)fpregs, - &td->td_pcb->pcb_save->sv_xmm); - return (0); - } + &td->td_pcb->pcb_user_save.sv_xmm); + else #endif /* CPU_ENABLE_SSE */ - bcopy(fpregs, &td->td_pcb->pcb_save->sv_87, sizeof *fpregs); + bcopy(fpregs, &td->td_pcb->pcb_user_save.sv_87, + sizeof(*fpregs)); + npxuserinited(td); return (0); } @@ -2589,13 +2587,6 @@ get_mcontext(struct thread *td, mcontext mcp->mc_esp = tp->tf_esp; mcp->mc_ss = tp->tf_ss; mcp->mc_len = sizeof(*mcp); - - /* - * The get_fpcontext() call must be placed before assignments - * to mc_fsbase and mc_gsbase due to the alignment-override - * code in get_fpcontext() that possibly clobbers 12 bytes of - * mcontext after mc_fpstate. - */ get_fpcontext(td, mcp); sdp = &td->td_pcb->pcb_fsd; mcp->mc_fsbase = sdp->sd_hibase << 24 | sdp->sd_lobase; @@ -2646,39 +2637,14 @@ set_mcontext(struct thread *td, const mc static void get_fpcontext(struct thread *td, mcontext_t *mcp) { + #ifndef DEV_NPX mcp->mc_fpformat = _MC_FPFMT_NODEV; mcp->mc_ownedfp = _MC_FPOWNED_NONE; #else - union savefpu *addr; - - /* - * XXX mc_fpstate might be misaligned, since its declaration is not - * unportabilized using __attribute__((aligned(16))) like the - * declaration of struct savemm, and anyway, alignment doesn't work - * for auto variables since we don't use gcc's pessimal stack - * alignment. Work around this by abusing the spare fields after - * mcp->mc_fpstate. - * - * XXX unpessimize most cases by only aligning when fxsave might be - * called, although this requires knowing too much about - * npxgetregs()'s internals. - */ - addr = (union savefpu *)&mcp->mc_fpstate; - if (td == PCPU_GET(fpcurthread) && -#ifdef CPU_ENABLE_SSE - cpu_fxsr && -#endif - ((uintptr_t)(void *)addr & 0xF)) { - do - addr = (void *)((char *)addr + 4); - while ((uintptr_t)(void *)addr & 0xF); - } - mcp->mc_ownedfp = npxgetregs(td, addr); - if (addr != (union savefpu *)&mcp->mc_fpstate) { - bcopy(addr, &mcp->mc_fpstate, sizeof(mcp->mc_fpstate)); - bzero(&mcp->mc_spare2, sizeof(mcp->mc_spare2)); - } + mcp->mc_ownedfp = npxgetregs(td); + bcopy(&td->td_pcb->pcb_user_save, &mcp->mc_fpstate, + sizeof(mcp->mc_fpstate)); mcp->mc_fpformat = npxformat(); #endif } @@ -2686,7 +2652,6 @@ get_fpcontext(struct thread *td, mcontex static int set_fpcontext(struct thread *td, const mcontext_t *mcp) { - union savefpu *addr; if (mcp->mc_fpformat == _MC_FPFMT_NODEV) return (0); @@ -2698,34 +2663,14 @@ set_fpcontext(struct thread *td, const m fpstate_drop(td); else if (mcp->mc_ownedfp == _MC_FPOWNED_FPU || mcp->mc_ownedfp == _MC_FPOWNED_PCB) { - /* XXX align as above. */ - addr = (union savefpu *)&mcp->mc_fpstate; - if (td == PCPU_GET(fpcurthread) && -#ifdef CPU_ENABLE_SSE - cpu_fxsr && -#endif - ((uintptr_t)(void *)addr & 0xF)) { - do - addr = (void *)((char *)addr + 4); - while ((uintptr_t)(void *)addr & 0xF); - bcopy(&mcp->mc_fpstate, addr, sizeof(mcp->mc_fpstate)); - } #ifdef DEV_NPX #ifdef CPU_ENABLE_SSE if (cpu_fxsr) - addr->sv_xmm.sv_env.en_mxcsr &= cpu_mxcsr_mask; + ((union savefpu *)&mcp->mc_fpstate)->sv_xmm.sv_env. + en_mxcsr &= cpu_mxcsr_mask; #endif - /* - * XXX we violate the dubious requirement that npxsetregs() - * be called with interrupts disabled. - */ - npxsetregs(td, addr); + npxsetregs(td, (union savefpu *)&mcp->mc_fpstate); #endif - /* - * Don't bother putting things back where they were in the - * misaligned case, since we know that the caller won't use - * them again. - */ } else return (EINVAL); return (0); @@ -2750,7 +2695,8 @@ fpstate_drop(struct thread *td) * sendsig() is the only caller of npxgetregs()... perhaps we just * have too many layers. */ - curthread->td_pcb->pcb_flags &= ~PCB_NPXINITDONE; + curthread->td_pcb->pcb_flags &= ~(PCB_NPXINITDONE | + PCB_NPXUSERINITDONE); critical_exit(); } From owner-svn-src-stable-8@FreeBSD.ORG Fri Dec 3 22:47:54 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 10B2B1065674; Fri, 3 Dec 2010 22:47:54 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F2DFB8FC0C; Fri, 3 Dec 2010 22:47:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB3Mlr4M043541; Fri, 3 Dec 2010 22:47:53 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB3Mlr50043539; Fri, 3 Dec 2010 22:47:53 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201012032247.oB3Mlr50043539@svn.freebsd.org> From: Colin Percival Date: Fri, 3 Dec 2010 22:47:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216164 - stable/8/contrib/binutils/bfd X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Dec 2010 22:47:54 -0000 Author: cperciva Date: Fri Dec 3 22:47:53 2010 New Revision: 216164 URL: http://svn.freebsd.org/changeset/base/216164 Log: MFC r215105: Uninitialized buffers considered harmful. Approved by: re (bz) Modified: stable/8/contrib/binutils/bfd/opncls.c Directory Properties: stable/8/contrib/binutils/ (props changed) Modified: stable/8/contrib/binutils/bfd/opncls.c ============================================================================== --- stable/8/contrib/binutils/bfd/opncls.c Fri Dec 3 22:27:51 2010 (r216163) +++ stable/8/contrib/binutils/bfd/opncls.c Fri Dec 3 22:47:53 2010 (r216164) @@ -1151,7 +1151,7 @@ bfd_fill_in_gnu_debuglink_section (bfd * debuglink_size &= ~3; debuglink_size += 4; - contents = malloc (debuglink_size); + contents = bfd_zmalloc (debuglink_size); if (contents == NULL) { /* XXX Should we delete the section from the bfd ? */