From owner-svn-src-head@FreeBSD.ORG Sun Feb 8 00:16:25 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 30C80106566C; Sun, 8 Feb 2009 00:16:25 +0000 (UTC) (envelope-from wkoszek@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 144C78FC21; Sun, 8 Feb 2009 00:16:25 +0000 (UTC) (envelope-from wkoszek@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n180GOl0006828; Sun, 8 Feb 2009 00:16:24 GMT (envelope-from wkoszek@svn.freebsd.org) Received: (from wkoszek@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n180GOP7006827; Sun, 8 Feb 2009 00:16:24 GMT (envelope-from wkoszek@svn.freebsd.org) Message-Id: <200902080016.n180GOP7006827@svn.freebsd.org> From: "Wojciech A. Koszek" Date: Sun, 8 Feb 2009 00:16:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188297 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Feb 2009 00:16:27 -0000 Author: wkoszek Date: Sun Feb 8 00:16:24 2009 New Revision: 188297 URL: http://svn.freebsd.org/changeset/base/188297 Log: Resort NOTES a bit to easily distinguish, which comments are actual and refer to used options, and which comments are obseleted. Reviewed by: imp Modified: head/sys/conf/NOTES Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Sat Feb 7 21:07:58 2009 (r188296) +++ head/sys/conf/NOTES Sun Feb 8 00:16:24 2009 (r188297) @@ -714,40 +714,81 @@ device mn # Munich32x/Falc54 Nx64kbit/s # # Network interfaces: # The `loop' device is MANDATORY when networking is enabled. +device loop + # The `ether' device provides generic code to handle # Ethernets; it is MANDATORY when an Ethernet device driver is # configured or token-ring is enabled. +device ether + # The `vlan' device implements the VLAN tagging of Ethernet frames # according to IEEE 802.1Q. It requires `device miibus'. +device vlan + # The `wlan' device provides generic code to support 802.11 # drivers, including host AP mode; it is MANDATORY for the wi, # and ath drivers and will eventually be required by all 802.11 drivers. +device wlan +options IEEE80211_DEBUG #enable debugging msgs +options IEEE80211_AMPDU_AGE #age frames in AMPDU reorder q's + # The `wlan_wep', `wlan_tkip', and `wlan_ccmp' devices provide # support for WEP, TKIP, and AES-CCMP crypto protocols optionally # used with 802.11 devices that depend on the `wlan' module. +device wlan_wep +device wlan_ccmp +device wlan_tkip + # The `wlan_xauth' device provides support for external (i.e. user-mode) # authenticators for use with 802.11 drivers that use the `wlan' # module and support 802.1x and/or WPA security protocols. +device wlan_xauth + # The `wlan_acl' device provides a MAC-based access control mechanism # for use with 802.11 drivers operating in ap mode and using the # `wlan' module. +# The 'wlan_amrr' device provides AMRR transmit rate control algorithm +device wlan_acl +device wlan_amrr + +# Generic TokenRing +device token + # The `fddi' device provides generic code to support FDDI. +device fddi + # The `arcnet' device provides generic code to support Arcnet. +device arcnet + # The `sppp' device serves a similar role for certain types # of synchronous PPP links (like `cx', `ar'). +device sppp + # The `sl' device implements the Serial Line IP (SLIP) service. # The `ppp' device implements the Point-to-Point Protocol. + + # The `bpf' device enables the Berkeley Packet Filter. Be # aware of the legal and administrative consequences of enabling this # option. The number of devices determines the maximum number of # simultaneous BPF clients programs runnable. DHCP requires bpf. +device bpf + # The `disc' device implements a minimal network interface, # which throws away all packets sent and never receives any. It is # included for testing and benchmarking purposes. +device disc + # The `edsc' device implements a minimal Ethernet interface, # which discards all packets sent and receives none. +device edsc + # The `tap' device is a pty-like virtual Ethernet interface -# The `tun' device implements (user-)ppp and nos-tun +device tap + +# The `tun' device implements (user-)ppp and nos-tun(8) +device tun + # The `gif' device implements IPv6 over IP4 tunneling, # IPv4 over IPv6 tunneling, IPv4 over IPv4 tunneling and # IPv6 over IPv6 tunneling. @@ -755,17 +796,45 @@ device mn # Munich32x/Falc54 Nx64kbit/s # GRE and MOBILE, as specified in the RFC1701 and RFC2004. # The XBONEHACK option allows the same pair of addresses to be configured on # multiple gif interfaces. +device gif +device gre +options XBONEHACK + # The `faith' device captures packets sent to it and diverts them # to the IPv4/IPv6 translation daemon. # The `stf' device implements 6to4 encapsulation. +device faith +device stf + # The `ef' device provides support for multiple ethernet frame types # specified via ETHER_* options. See ef(4) for details. -# +device ef +options ETHER_II # enable Ethernet_II frame +options ETHER_8023 # enable Ethernet_802.3 (Novell) frame +options ETHER_8022 # enable Ethernet_802.2 frame +options ETHER_SNAP # enable Ethernet_802.2/SNAP frame + # The pf packet filter consists of three devices: # The `pf' device provides /dev/pf and the firewall code itself. # The `pflog' device provides the pflog0 interface which logs packets. # The `pfsync' device provides the pfsync0 interface used for # synchronization of firewall state tables (over the net). +device pf +device pflog +device pfsync + +# Bridge interface. +device if_bridge + +# Common Address Redundancy Protocol. See carp(4) for more details. +device carp + +# IPsec interface. +device enc + +# Link aggregation interface. +device lagg + # # The PPP_BSDCOMP option enables support for compress(1) style entire # packet compression, the PPP_DEFLATE is for zlib/gzip style compression. @@ -773,47 +842,7 @@ device mn # Munich32x/Falc54 Nx64kbit/s # events for resetting the demand dial activity timer - requires bpf. # See pppd(8) for more details. # -device ether #Generic Ethernet -device vlan #VLAN support (needs miibus) -device wlan #802.11 support -options IEEE80211_DEBUG #enable debugging msgs -options IEEE80211_AMPDU_AGE #age frames in AMPDU reorder q's -device wlan_wep #802.11 WEP support -device wlan_ccmp #802.11 CCMP support -device wlan_tkip #802.11 TKIP support -device wlan_xauth #802.11 external authenticator support -device wlan_acl #802.11 MAC ACL support -device wlan_amrr #AMRR transmit rate control algorithm -device token #Generic TokenRing -device fddi #Generic FDDI -device arcnet #Generic Arcnet -device sppp #Generic Synchronous PPP -device loop #Network loopback device -device bpf #Berkeley packet filter -device disc #Discard device based on loopback -device edsc #Ethernet discard device -device tap #Virtual Ethernet driver -device tun #Tunnel driver (ppp(8), nos-tun(8)) -device gre #IP over IP tunneling -device if_bridge #Bridge interface -device pf #PF OpenBSD packet-filter firewall -device pflog #logging support interface for PF -device pfsync #synchronization interface for PF -device carp #Common Address Redundancy Protocol -device enc #IPsec interface -device lagg #Link aggregation interface - -device ef # Multiple ethernet frames support -options ETHER_II # enable Ethernet_II frame -options ETHER_8023 # enable Ethernet_802.3 (Novell) frame -options ETHER_8022 # enable Ethernet_802.2 frame -options ETHER_SNAP # enable Ethernet_802.2/SNAP frame -# for IPv6 -device gif #IPv6 and IPv4 tunneling -options XBONEHACK -device faith #for IPv6 and IPv4 translation -device stf #6to4 IPv6 over IPv4 encapsulation # # Internet family options: From owner-svn-src-head@FreeBSD.ORG Sun Feb 8 03:02:06 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84CF41065672; Sun, 8 Feb 2009 03:02:06 +0000 (UTC) (envelope-from piso@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 73CA18FC18; Sun, 8 Feb 2009 03:02:06 +0000 (UTC) (envelope-from piso@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n18326vR009976; Sun, 8 Feb 2009 03:02:06 GMT (envelope-from piso@svn.freebsd.org) Received: (from piso@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n18326KV009975; Sun, 8 Feb 2009 03:02:06 GMT (envelope-from piso@svn.freebsd.org) Message-Id: <200902080302.n18326KV009975@svn.freebsd.org> From: Paolo Pisati Date: Sun, 8 Feb 2009 03:02:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188298 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Feb 2009 03:02:06 -0000 Author: piso Date: Sun Feb 8 03:02:06 2009 New Revision: 188298 URL: http://svn.freebsd.org/changeset/base/188298 Log: Fix LIBALIAS option for a static kernel. Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun Feb 8 00:16:24 2009 (r188297) +++ head/sys/conf/files Sun Feb 8 03:02:06 2009 (r188298) @@ -2387,6 +2387,7 @@ netinet/libalias/alias_db.c optional lib netinet/libalias/alias_mod.c optional libalias | netgraph_nat netinet/libalias/alias_proxy.c optional libalias | netgraph_nat netinet/libalias/alias_util.c optional libalias | netgraph_nat +netinet/libalias/alias_sctp.c optional libalias | netgraph_nat netinet6/dest6.c optional inet6 netinet6/frag6.c optional inet6 netinet6/icmp6.c optional inet6 From owner-svn-src-head@FreeBSD.ORG Sun Feb 8 03:03:55 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D9CD106564A; Sun, 8 Feb 2009 03:03:55 +0000 (UTC) (envelope-from piso@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5D1108FC08; Sun, 8 Feb 2009 03:03:55 +0000 (UTC) (envelope-from piso@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1833t1A010042; Sun, 8 Feb 2009 03:03:55 GMT (envelope-from piso@svn.freebsd.org) Received: (from piso@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1833trt010041; Sun, 8 Feb 2009 03:03:55 GMT (envelope-from piso@svn.freebsd.org) Message-Id: <200902080303.n1833trt010041@svn.freebsd.org> From: Paolo Pisati Date: Sun, 8 Feb 2009 03:03:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188299 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Feb 2009 03:03:55 -0000 Author: piso Date: Sun Feb 8 03:03:55 2009 New Revision: 188299 URL: http://svn.freebsd.org/changeset/base/188299 Log: Silent LINT: add 2 stubs (update_crc32 and sctp_finalize_crc32) to fix LIBALIAS + SCTP_NO_CSUM case. Modified: head/sys/netinet/sctp_crc32.c Modified: head/sys/netinet/sctp_crc32.c ============================================================================== --- head/sys/netinet/sctp_crc32.c Sun Feb 8 03:02:06 2009 (r188298) +++ head/sys/netinet/sctp_crc32.c Sun Feb 8 03:03:55 2009 (r188299) @@ -729,7 +729,18 @@ sctp_finalize_crc32(uint32_t crc32c) #endif return (crc32c); } +#else +uint32_t +update_crc32(uint32_t crc32c, unsigned char *buffer, unsigned int length) { + + return (0); +} +uint32_t +sctp_finalize_crc32(uint32_t crc32c) +{ + return (0); +} #endif /* !defined(SCTP_WITH_NO_CSUM) */ #if defined(SCTP_WITH_NO_CSUM) From owner-svn-src-head@FreeBSD.ORG Sun Feb 8 03:25:18 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA632106566B; Sun, 8 Feb 2009 03:25:18 +0000 (UTC) (envelope-from nyan@jp.FreeBSD.org) Received: from sakura.ccs.furiru.org (unknown [IPv6:2001:2f0:104:8060::1]) by mx1.freebsd.org (Postfix) with ESMTP id 714CA8FC0A; Sun, 8 Feb 2009 03:25:18 +0000 (UTC) (envelope-from nyan@jp.FreeBSD.org) Received: from localhost (authenticated bits=0) by sakura.ccs.furiru.org (unknown) with ESMTP id n183PEuO006103; Sun, 8 Feb 2009 12:25:16 +0900 (JST) (envelope-from nyan@jp.FreeBSD.org) Date: Sun, 08 Feb 2009 12:25:14 +0900 (JST) Message-Id: <20090208.122514.27801215.nyan@jp.FreeBSD.org> To: wkoszek@FreeBSD.org From: Takahashi Yoshihiro In-Reply-To: <20090206235424.GK83537@FreeBSD.org> References: <200902070015.n170FU58075372@svn.freebsd.org> <20090206235424.GK83537@FreeBSD.org> X-Mailer: Mew version 6.2 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r188257 - head/sys/pc98/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Feb 2009 03:25:19 -0000 In article <20090206235424.GK83537@FreeBSD.org> "Wojciech A. Koszek" writes: >> +# EPSON_BOUNCEDMA: XXX >> +# EPSON_MEMWIN: XXX > > Those had no respective comment lines, and I didn't know what those options do. > I expect someone to fill those, or at least present 'ready to commit' comments > on what they do. EPSON_BOUNCEDMA was to use a bounce buffer to upper 15MB, but it's broken now. EPSON_MEMWIN disables 15-16MB chunk, and enables EPSON memory window. --- TAKAHASHI Yoshihiro From owner-svn-src-head@FreeBSD.ORG Sun Feb 8 06:44:58 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DAFA91065675; Sun, 8 Feb 2009 06:44:58 +0000 (UTC) (envelope-from deischen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C90708FC19; Sun, 8 Feb 2009 06:44:58 +0000 (UTC) (envelope-from deischen@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n186iwSf014294; Sun, 8 Feb 2009 06:44:58 GMT (envelope-from deischen@svn.freebsd.org) Received: (from deischen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n186iwcN014293; Sun, 8 Feb 2009 06:44:58 GMT (envelope-from deischen@svn.freebsd.org) Message-Id: <200902080644.n186iwcN014293@svn.freebsd.org> From: Daniel Eischen Date: Sun, 8 Feb 2009 06:44:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188300 - head/lib/libc_r/uthread X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Feb 2009 06:44:59 -0000 Author: deischen Date: Sun Feb 8 06:44:58 2009 New Revision: 188300 URL: http://svn.freebsd.org/changeset/base/188300 Log: Fix leak of kqueue() file descriptors when linked with static libc_r. PR: 58687 Submitted by: Jonathon Lennox Modified: head/lib/libc_r/uthread/uthread_init.c Modified: head/lib/libc_r/uthread/uthread_init.c ============================================================================== --- head/lib/libc_r/uthread/uthread_init.c Sun Feb 8 03:03:55 2009 (r188299) +++ head/lib/libc_r/uthread/uthread_init.c Sun Feb 8 06:44:58 2009 (r188300) @@ -95,6 +95,7 @@ static void *references[] = { &_getsockopt, &_ioctl, &_kevent, + &_kqueue, &_listen, &_nanosleep, &_open, From owner-svn-src-head@FreeBSD.ORG Sun Feb 8 07:02:42 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ABCFC106566C; Sun, 8 Feb 2009 07:02:42 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9A0498FC12; Sun, 8 Feb 2009 07:02:42 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1872gtH014671; Sun, 8 Feb 2009 07:02:42 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1872gbB014670; Sun, 8 Feb 2009 07:02:42 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200902080702.n1872gbB014670@svn.freebsd.org> From: Warner Losh Date: Sun, 8 Feb 2009 07:02:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188301 - head/sys/amd64/pci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Feb 2009 07:02:43 -0000 Author: imp Date: Sun Feb 8 07:02:42 2009 New Revision: 188301 URL: http://svn.freebsd.org/changeset/base/188301 Log: Correct parameter types for pcib_{read,write}_config by fixing the protptyoes for the legacy_* impelemtnations of these kobj methods. Modified: head/sys/amd64/pci/pci_bus.c Modified: head/sys/amd64/pci/pci_bus.c ============================================================================== --- head/sys/amd64/pci/pci_bus.c Sun Feb 8 06:44:58 2009 (r188300) +++ head/sys/amd64/pci/pci_bus.c Sun Feb 8 07:02:42 2009 (r188301) @@ -55,9 +55,9 @@ legacy_pcib_maxslots(device_t dev) /* read configuration space register */ -u_int32_t -legacy_pcib_read_config(device_t dev, int bus, int slot, int func, - int reg, int bytes) +uint32_t +legacy_pcib_read_config(device_t dev, u_int bus, u_int slot, u_int func, + u_int reg, int bytes) { return(pci_cfgregread(bus, slot, func, reg, bytes)); } @@ -65,8 +65,8 @@ legacy_pcib_read_config(device_t dev, in /* write configuration space register */ void -legacy_pcib_write_config(device_t dev, int bus, int slot, int func, - int reg, u_int32_t data, int bytes) +legacy_pcib_write_config(device_t dev, u_int bus, u_int slot, u_int func, + u_int reg, uint32_t data, int bytes) { pci_cfgregwrite(bus, slot, func, reg, data, bytes); } From owner-svn-src-head@FreeBSD.ORG Sun Feb 8 07:03:34 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5A9F8106567E; Sun, 8 Feb 2009 07:03:34 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 48A268FC1B; Sun, 8 Feb 2009 07:03:34 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1873YlP014723; Sun, 8 Feb 2009 07:03:34 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1873YQi014722; Sun, 8 Feb 2009 07:03:34 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200902080703.n1873YQi014722@svn.freebsd.org> From: Warner Losh Date: Sun, 8 Feb 2009 07:03:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188302 - head/sys/amd64/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Feb 2009 07:03:35 -0000 Author: imp Date: Sun Feb 8 07:03:34 2009 New Revision: 188302 URL: http://svn.freebsd.org/changeset/base/188302 Log: Companion for r188301: fix the prototypes. Modified: head/sys/amd64/include/legacyvar.h Modified: head/sys/amd64/include/legacyvar.h ============================================================================== --- head/sys/amd64/include/legacyvar.h Sun Feb 8 07:02:42 2009 (r188301) +++ head/sys/amd64/include/legacyvar.h Sun Feb 8 07:03:34 2009 (r188302) @@ -43,12 +43,12 @@ LEGACY_ACCESSOR(pcibus, PCIBUS, uint3 #undef LEGACY_ACCESSOR int legacy_pcib_maxslots(device_t dev); -uint32_t legacy_pcib_read_config(device_t dev, int bus, int slot, int func, - int reg, int bytes); +uint32_t legacy_pcib_read_config(device_t dev, u_int bus, u_int slot, + u_int func, u_int reg, int bytes); int legacy_pcib_read_ivar(device_t dev, device_t child, int which, uintptr_t *result); -void legacy_pcib_write_config(device_t dev, int bus, int slot, int func, - int reg, u_int32_t data, int bytes); +void legacy_pcib_write_config(device_t dev, u_int bus, u_int slot, + u_int func, u_int reg, uint32_t data, int bytes); int legacy_pcib_write_ivar(device_t dev, device_t child, int which, uintptr_t value); struct resource *legacy_pcib_alloc_resource(device_t dev, device_t child, From owner-svn-src-head@FreeBSD.ORG Sun Feb 8 07:05:24 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A6E33106566C; Sun, 8 Feb 2009 07:05:23 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 94DF28FC08; Sun, 8 Feb 2009 07:05:23 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1875NKj014798; Sun, 8 Feb 2009 07:05:23 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1875NNd014796; Sun, 8 Feb 2009 07:05:23 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200902080705.n1875NNd014796@svn.freebsd.org> From: Warner Losh Date: Sun, 8 Feb 2009 07:05:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188303 - head/sys/geom/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Feb 2009 07:05:24 -0000 Author: imp Date: Sun Feb 8 07:05:23 2009 New Revision: 188303 URL: http://svn.freebsd.org/changeset/base/188303 Log: Fix g_part_*dumpconf to return void to match kobj definition. Fix g_part_*name to return a const char * rather than a char *. Modified: head/sys/geom/part/g_part_bsd.c head/sys/geom/part/g_part_mbr.c Modified: head/sys/geom/part/g_part_bsd.c ============================================================================== --- head/sys/geom/part/g_part_bsd.c Sun Feb 8 07:03:34 2009 (r188302) +++ head/sys/geom/part/g_part_bsd.c Sun Feb 8 07:05:23 2009 (r188303) @@ -60,12 +60,12 @@ static int g_part_bsd_add(struct g_part_ struct g_part_parms *); static int g_part_bsd_create(struct g_part_table *, struct g_part_parms *); static int g_part_bsd_destroy(struct g_part_table *, struct g_part_parms *); -static int g_part_bsd_dumpconf(struct g_part_table *, struct g_part_entry *, +static void g_part_bsd_dumpconf(struct g_part_table *, struct g_part_entry *, struct sbuf *, const char *); static int g_part_bsd_dumpto(struct g_part_table *, struct g_part_entry *); static int g_part_bsd_modify(struct g_part_table *, struct g_part_entry *, struct g_part_parms *); -static char *g_part_bsd_name(struct g_part_table *, struct g_part_entry *, +static const char *g_part_bsd_name(struct g_part_table *, struct g_part_entry *, char *, size_t); static int g_part_bsd_probe(struct g_part_table *, struct g_consumer *); static int g_part_bsd_read(struct g_part_table *, struct g_consumer *); @@ -216,7 +216,7 @@ g_part_bsd_destroy(struct g_part_table * return (0); } -static int +static void g_part_bsd_dumpconf(struct g_part_table *table, struct g_part_entry *baseentry, struct sbuf *sb, const char *indent) { @@ -233,7 +233,6 @@ g_part_bsd_dumpconf(struct g_part_table } else { /* confxml: scheme information */ } - return (0); } static int @@ -262,7 +261,7 @@ g_part_bsd_modify(struct g_part_table *b return (0); } -static char * +static const char * g_part_bsd_name(struct g_part_table *table, struct g_part_entry *baseentry, char *buf, size_t bufsz) { Modified: head/sys/geom/part/g_part_mbr.c ============================================================================== --- head/sys/geom/part/g_part_mbr.c Sun Feb 8 07:03:34 2009 (r188302) +++ head/sys/geom/part/g_part_mbr.c Sun Feb 8 07:05:23 2009 (r188303) @@ -62,12 +62,12 @@ static int g_part_mbr_add(struct g_part_ static int g_part_mbr_bootcode(struct g_part_table *, struct g_part_parms *); static int g_part_mbr_create(struct g_part_table *, struct g_part_parms *); static int g_part_mbr_destroy(struct g_part_table *, struct g_part_parms *); -static int g_part_mbr_dumpconf(struct g_part_table *, struct g_part_entry *, +static void g_part_mbr_dumpconf(struct g_part_table *, struct g_part_entry *, struct sbuf *, const char *); static int g_part_mbr_dumpto(struct g_part_table *, struct g_part_entry *); static int g_part_mbr_modify(struct g_part_table *, struct g_part_entry *, struct g_part_parms *); -static char *g_part_mbr_name(struct g_part_table *, struct g_part_entry *, +static const char *g_part_mbr_name(struct g_part_table *, struct g_part_entry *, char *, size_t); static int g_part_mbr_probe(struct g_part_table *, struct g_consumer *); static int g_part_mbr_read(struct g_part_table *, struct g_consumer *); @@ -256,7 +256,7 @@ g_part_mbr_destroy(struct g_part_table * return (0); } -static int +static void g_part_mbr_dumpconf(struct g_part_table *table, struct g_part_entry *baseentry, struct sbuf *sb, const char *indent) { @@ -275,7 +275,6 @@ g_part_mbr_dumpconf(struct g_part_table } else { /* confxml: scheme information */ } - return (0); } static int @@ -303,7 +302,7 @@ g_part_mbr_modify(struct g_part_table *b return (0); } -static char * +static const char * g_part_mbr_name(struct g_part_table *table, struct g_part_entry *baseentry, char *buf, size_t bufsz) { From owner-svn-src-head@FreeBSD.ORG Sun Feb 8 08:13:36 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B5B0106566C; Sun, 8 Feb 2009 08:13:36 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 49A748FC0C; Sun, 8 Feb 2009 08:13:36 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n188Dao4016089; Sun, 8 Feb 2009 08:13:36 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n188DaPV016088; Sun, 8 Feb 2009 08:13:36 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200902080813.n188DaPV016088@svn.freebsd.org> From: Warner Losh Date: Sun, 8 Feb 2009 08:13:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188304 - head/sys/mips/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Feb 2009 08:13:36 -0000 Author: imp Date: Sun Feb 8 08:13:36 2009 New Revision: 188304 URL: http://svn.freebsd.org/changeset/base/188304 Log: Retire NO_DMA completely. Modified: head/sys/mips/mips/busdma_machdep.c Modified: head/sys/mips/mips/busdma_machdep.c ============================================================================== --- head/sys/mips/mips/busdma_machdep.c Sun Feb 8 07:05:23 2009 (r188303) +++ head/sys/mips/mips/busdma_machdep.c Sun Feb 8 08:13:36 2009 (r188304) @@ -187,7 +187,6 @@ busdma_lock_mutex(void *arg, bus_dma_loc * with the tag are meant to never be defered. * XXX Should have a way to identify which driver is responsible here. */ -#ifndef NO_DMA static void dflt_lock(void *arg, bus_dma_lock_op_t op) { @@ -197,7 +196,6 @@ dflt_lock(void *arg, bus_dma_lock_op_t o printf("DRIVER_ERROR: busdma dflt_lock called\n"); #endif } -#endif static __inline bus_dmamap_t _busdma_alloc_dmamap(void) @@ -238,7 +236,6 @@ bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t maxsegsz, int flags, bus_dma_lock_t *lockfunc, void *lockfuncarg, bus_dma_tag_t *dmat) { -#ifndef NO_DMA bus_dma_tag_t newtag; int error = 0; @@ -313,10 +310,6 @@ bus_dma_tag_create(bus_dma_tag_t parent, CTR4(KTR_BUSDMA, "%s returned tag %p tag flags 0x%x error %d", __func__, newtag, (newtag != NULL ? newtag->flags : 0), error); return (error); -#else - return ENOSYS; -#endif - } int From owner-svn-src-head@FreeBSD.ORG Sun Feb 8 08:26:59 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 30849106566C; Sun, 8 Feb 2009 08:26:58 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DE6CE8FC0C; Sun, 8 Feb 2009 08:26:58 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n188QwO4016350; Sun, 8 Feb 2009 08:26:58 GMT (envelope-from keramida@svn.freebsd.org) Received: (from keramida@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n188QwpD016349; Sun, 8 Feb 2009 08:26:58 GMT (envelope-from keramida@svn.freebsd.org) Message-Id: <200902080826.n188QwpD016349@svn.freebsd.org> From: Giorgos Keramidas Date: Sun, 8 Feb 2009 08:26:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188305 - head/lib/libc/stdlib X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Feb 2009 08:26:59 -0000 Author: keramida (doc committer) Date: Sun Feb 8 08:26:58 2009 New Revision: 188305 URL: http://svn.freebsd.org/changeset/base/188305 Log: Fix language on atol(3) manpage. Add a COMPATIBILITY section stating that in FreeBSD the atol() and atoll() functions affect errno in the same way as strtol() and stroll(). PR: docs/126487 Submitted by: edwin Reviewed by: trhodes, gabor MFC after: 1 week Modified: head/lib/libc/stdlib/atol.3 Modified: head/lib/libc/stdlib/atol.3 ============================================================================== --- head/lib/libc/stdlib/atol.3 Sun Feb 8 08:13:36 2009 (r188304) +++ head/lib/libc/stdlib/atol.3 Sun Feb 8 08:26:58 2009 (r188305) @@ -32,7 +32,7 @@ .\" @(#)atol.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd November 28, 2001 +.Dd February 1, 2009 .Dt ATOL 3 .Os .Sh NAME @@ -78,13 +78,42 @@ representation. It is equivalent to: .Pp .Dl "strtoll(nptr, (char **)NULL, 10);" +.Sh COMPATIBILITY +The +.Fx +implementations of the +.Fn atol +and +.Fn atoll +functions are thin wrappers around +.Fn strtol +and +.Fn stroll +respectively, so these functions will affect the value of +.Va errno +in the same way that the +.Fn strtol +and +.Fn stroll +functions are able to. +This behavior of +.Fn atol +and +.Fn atoll +is not required by +.St -isoC +or +.St -isoC-c99 , +but it is allowed by all of +.St -isoC , St -isoC-99 +and +.St -p1003.1-2001 . .Sh ERRORS The functions .Fn atol and .Fn atoll -need not -affect the value of +may affect the value of .Va errno on an error. .Sh SEE ALSO From owner-svn-src-head@FreeBSD.ORG Sun Feb 8 09:27:08 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0247710656BE; Sun, 8 Feb 2009 09:27:08 +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 E30738FC0A; Sun, 8 Feb 2009 09:27:07 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n189R7iP017508; Sun, 8 Feb 2009 09:27:07 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n189R7B4017499; Sun, 8 Feb 2009 09:27:07 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200902080927.n189R7B4017499@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 8 Feb 2009 09:27:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188306 - in head/sys: netinet netinet6 netipsec X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Feb 2009 09:27:08 -0000 Author: bz Date: Sun Feb 8 09:27:07 2009 New Revision: 188306 URL: http://svn.freebsd.org/changeset/base/188306 Log: Try to remove/assimilate as much of formerly IPv4/6 specific (duplicate) code in sys/netipsec/ipsec.c and fold it into common, INET/6 independent functions. The file local functions ipsec4_setspidx_inpcb() and ipsec6_setspidx_inpcb() were 1:1 identical after the change in r186528. Rename to ipsec_setspidx_inpcb() and remove the duplicate. Public functions ipsec[46]_get_policy() were 1:1 identical. Remove one copy and merge in the factored out code from ipsec_get_policy() into the other. The public function left is now called ipsec_get_policy() and callers were adapted. Public functions ipsec[46]_set_policy() were 1:1 identical. Rename file local ipsec_set_policy() function to ipsec_set_policy_internal(). Remove one copy of the public functions, rename the other to ipsec_set_policy() and adapt callers. Public functions ipsec[46]_hdrsiz() were logically identical (ignoring one questionable assert in the v6 version). Rename the file local ipsec_hdrsiz() to ipsec_hdrsiz_internal(), the public function to ipsec_hdrsiz(), remove the duplicate copy and adapt the callers. The v6 version had been unused anyway. Cleanup comments. Public functions ipsec[46]_in_reject() were logically identical apart from statistics. Move the common code into a file local ipsec46_in_reject() leaving vimage+statistics in small AF specific wrapper functions. Note: unfortunately we already have a public ipsec_in_reject(). Reviewed by: sam Discussed with: rwatson (renaming to *_internal) MFC after: 26 days X-MFC: keep wrapper functions for public symbols? Modified: head/sys/netinet/ip_ipsec.c head/sys/netinet/ip_output.c head/sys/netinet/tcp_subr.c head/sys/netinet6/ip6_forward.c head/sys/netinet6/ip6_ipsec.c head/sys/netinet6/ip6_output.c head/sys/netipsec/ipsec.c head/sys/netipsec/ipsec.h head/sys/netipsec/ipsec6.h Modified: head/sys/netinet/ip_ipsec.c ============================================================================== --- head/sys/netinet/ip_ipsec.c Sun Feb 8 08:26:58 2009 (r188305) +++ head/sys/netinet/ip_ipsec.c Sun Feb 8 09:27:07 2009 (r188306) @@ -218,9 +218,7 @@ ip_ipsec_mtu(struct mbuf *m, int mtu) &ipsecerror); if (sp != NULL) { /* count IPsec header size */ - ipsechdr = ipsec4_hdrsiz(m, - IPSEC_DIR_OUTBOUND, - NULL); + ipsechdr = ipsec_hdrsiz(m, IPSEC_DIR_OUTBOUND, NULL); /* * find the correct route for outer IPv4 Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Sun Feb 8 08:26:58 2009 (r188305) +++ head/sys/netinet/ip_output.c Sun Feb 8 09:27:07 2009 (r188306) @@ -1050,7 +1050,7 @@ ip_ctloutput(struct socket *so, struct s if ((error = soopt_mcopyin(sopt, m)) != 0) /* XXX */ break; req = mtod(m, caddr_t); - error = ipsec4_set_policy(inp, sopt->sopt_name, req, + error = ipsec_set_policy(inp, sopt->sopt_name, req, m->m_len, (sopt->sopt_td != NULL) ? sopt->sopt_td->td_ucred : NULL); m_freem(m); @@ -1171,7 +1171,7 @@ ip_ctloutput(struct socket *so, struct s req = mtod(m, caddr_t); len = m->m_len; } - error = ipsec4_get_policy(sotoinpcb(so), req, len, &m); + error = ipsec_get_policy(sotoinpcb(so), req, len, &m); if (error == 0) error = soopt_mcopyout(sopt, m); /* XXX */ if (error == 0) Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Sun Feb 8 08:26:58 2009 (r188305) +++ head/sys/netinet/tcp_subr.c Sun Feb 8 09:27:07 2009 (r188306) @@ -1744,7 +1744,7 @@ ipsec_hdrsiz_tcp(struct tcpcb *tp) m->m_pkthdr.len = m->m_len = sizeof(struct ip6_hdr) + sizeof(struct tcphdr); tcpip_fillheaders(inp, ip6, th); - hdrsiz = ipsec6_hdrsiz(m, IPSEC_DIR_OUTBOUND, inp); + hdrsiz = ipsec_hdrsiz(m, IPSEC_DIR_OUTBOUND, inp); } else #endif /* INET6 */ { @@ -1752,7 +1752,7 @@ ipsec_hdrsiz_tcp(struct tcpcb *tp) th = (struct tcphdr *)(ip + 1); m->m_pkthdr.len = m->m_len = sizeof(struct tcpiphdr); tcpip_fillheaders(inp, ip, th); - hdrsiz = ipsec4_hdrsiz(m, IPSEC_DIR_OUTBOUND, inp); + hdrsiz = ipsec_hdrsiz(m, IPSEC_DIR_OUTBOUND, inp); } m_free(m); Modified: head/sys/netinet6/ip6_forward.c ============================================================================== --- head/sys/netinet6/ip6_forward.c Sun Feb 8 08:26:58 2009 (r188305) +++ head/sys/netinet6/ip6_forward.c Sun Feb 8 09:27:07 2009 (r188306) @@ -457,7 +457,7 @@ skip_routing: sp = ipsec_getpolicybyaddr(mcopy, IPSEC_DIR_OUTBOUND, IP_FORWARDING, &ipsecerror); if (sp) { - ipsechdrsiz = ipsec6_hdrsiz(mcopy, + ipsechdrsiz = ipsec_hdrsiz(mcopy, IPSEC_DIR_OUTBOUND, NULL); if (ipsechdrsiz < mtu) mtu -= ipsechdrsiz; Modified: head/sys/netinet6/ip6_ipsec.c ============================================================================== --- head/sys/netinet6/ip6_ipsec.c Sun Feb 8 08:26:58 2009 (r188305) +++ head/sys/netinet6/ip6_ipsec.c Sun Feb 8 09:27:07 2009 (r188306) @@ -341,9 +341,7 @@ ip6_ipsec_mtu(struct mbuf *m) &ipsecerror); if (sp != NULL) { /* count IPsec header size */ - ipsechdr = ipsec4_hdrsiz(m, - IPSEC_DIR_OUTBOUND, - NULL); + ipsechdr = ipsec_hdrsiz(m, IPSEC_DIR_OUTBOUND, NULL); /* * find the correct route for outer IPv4 Modified: head/sys/netinet6/ip6_output.c ============================================================================== --- head/sys/netinet6/ip6_output.c Sun Feb 8 08:26:58 2009 (r188305) +++ head/sys/netinet6/ip6_output.c Sun Feb 8 09:27:07 2009 (r188306) @@ -1799,7 +1799,7 @@ do { \ if ((error = soopt_mcopyin(sopt, m)) != 0) /* XXX */ break; req = mtod(m, caddr_t); - error = ipsec6_set_policy(in6p, optname, req, + error = ipsec_set_policy(in6p, optname, req, m->m_len, (sopt->sopt_td != NULL) ? sopt->sopt_td->td_ucred : NULL); m_freem(m); @@ -2024,7 +2024,7 @@ do { \ req = mtod(m, caddr_t); len = m->m_len; } - error = ipsec6_get_policy(in6p, req, len, mp); + error = ipsec_get_policy(in6p, req, len, mp); if (error == 0) error = soopt_mcopyout(sopt, m); /* XXX */ if (error == 0 && m) Modified: head/sys/netipsec/ipsec.c ============================================================================== --- head/sys/netipsec/ipsec.c Sun Feb 8 08:26:58 2009 (r188305) +++ head/sys/netipsec/ipsec.c Sun Feb 8 09:27:07 2009 (r188306) @@ -228,10 +228,7 @@ SYSCTL_V_STRUCT(V_NET, vnet_ipsec, _net_ "IPsec IPv6 statistics."); #endif /* INET6 */ -static int ipsec4_setspidx_inpcb __P((struct mbuf *, struct inpcb *)); -#ifdef INET6 -static int ipsec6_setspidx_inpcb __P((struct mbuf *, struct inpcb *)); -#endif +static int ipsec_setspidx_inpcb __P((struct mbuf *, struct inpcb *)); static int ipsec_setspidx __P((struct mbuf *, struct secpolicyindex *, int)); static void ipsec4_get_ulp __P((struct mbuf *m, struct secpolicyindex *, int)); static int ipsec4_setspidx_ipaddr __P((struct mbuf *, struct secpolicyindex *)); @@ -241,11 +238,7 @@ static int ipsec6_setspidx_ipaddr __P((s #endif static void ipsec_delpcbpolicy __P((struct inpcbpolicy *)); static struct secpolicy *ipsec_deepcopy_policy __P((struct secpolicy *src)); -static int ipsec_set_policy __P((struct secpolicy **pcb_sp, - int optname, caddr_t request, size_t len, struct ucred *cred)); -static int ipsec_get_policy __P((struct secpolicy *pcb_sp, struct mbuf **mp)); static void vshiftl __P((unsigned char *, int, int)); -static size_t ipsec_hdrsiz __P((struct secpolicy *)); MALLOC_DEFINE(M_IPSEC_INPCB, "inpcbpolicy", "inpcb-resident ipsec policy"); @@ -358,7 +351,7 @@ static struct secpolicy * ipsec_getpolicybysock(struct mbuf *m, u_int dir, struct inpcb *inp, int *error) { INIT_VNET_IPSEC(curvnet); - struct inpcbpolicy *pcbsp = NULL; + struct inpcbpolicy *pcbsp; struct secpolicy *currsp = NULL; /* Policy on socket. */ struct secpolicy *sp; @@ -369,20 +362,11 @@ ipsec_getpolicybysock(struct mbuf *m, u_ ("invalid direction %u", dir)); /* Set spidx in pcb. */ - if (inp->inp_vflag & INP_IPV6PROTO) { -#ifdef INET6 - *error = ipsec6_setspidx_inpcb(m, inp); - pcbsp = inp->inp_sp; -#else - *error = EINVAL; /* Should not happen. */ -#endif - } else { - *error = ipsec4_setspidx_inpcb(m, inp); - pcbsp = inp->inp_sp; - } + *error = ipsec_setspidx_inpcb(m, inp); if (*error) return (NULL); + pcbsp = inp->inp_sp; IPSEC_ASSERT(pcbsp != NULL, ("null pcbsp")); switch (dir) { case IPSEC_DIR_INBOUND: @@ -538,7 +522,7 @@ ipsec4_checkpolicy(struct mbuf *m, u_int } static int -ipsec4_setspidx_inpcb(struct mbuf *m, struct inpcb *inp) +ipsec_setspidx_inpcb(struct mbuf *m, struct inpcb *inp) { int error; @@ -561,33 +545,6 @@ ipsec4_setspidx_inpcb(struct mbuf *m, st return (error); } -#ifdef INET6 -static int -ipsec6_setspidx_inpcb(struct mbuf *m, struct inpcb *inp) -{ - int error; - - IPSEC_ASSERT(inp != NULL, ("null inp")); - IPSEC_ASSERT(inp->inp_sp != NULL, ("null inp_sp")); - IPSEC_ASSERT(inp->inp_sp->sp_out != NULL && inp->inp_sp->sp_in != NULL, - ("null sp_in || sp_out")); - - error = ipsec_setspidx(m, &inp->inp_sp->sp_in->spidx, 1); - if (error == 0) { - inp->inp_sp->sp_in->spidx.dir = IPSEC_DIR_INBOUND; - inp->inp_sp->sp_out->spidx = inp->inp_sp->sp_in->spidx; - inp->inp_sp->sp_out->spidx.dir = IPSEC_DIR_OUTBOUND; - } else { - bzero(&inp->inp_sp->sp_in->spidx, - sizeof(inp->inp_sp->sp_in->spidx)); - bzero(&inp->inp_sp->sp_out->spidx, - sizeof(inp->inp_sp->sp_in->spidx)); - } - - return (error); -} -#endif - /* * Configure security policy index (src/dst/proto/sport/dport) * by looking at the content of mbuf. @@ -1036,8 +993,8 @@ fail: /* Set policy and IPsec request if present. */ static int -ipsec_set_policy(struct secpolicy **pcb_sp, int optname, caddr_t request, - size_t len, struct ucred *cred) +ipsec_set_policy_internal(struct secpolicy **pcb_sp, int optname, + caddr_t request, size_t len, struct ucred *cred) { INIT_VNET_IPSEC(curvnet); struct sadb_x_policy *xpl; @@ -1056,7 +1013,7 @@ ipsec_set_policy(struct secpolicy **pcb_ kdebug_sadb_x_policy((struct sadb_ext *)xpl)); /* Check policy type. */ - /* ipsec_set_policy() accepts IPSEC, ENTRUST and BYPASS. */ + /* ipsec_set_policy_internal() accepts IPSEC, ENTRUST and BYPASS. */ if (xpl->sadb_x_policy_type == IPSEC_POLICY_DISCARD || xpl->sadb_x_policy_type == IPSEC_POLICY_NONE) return (EINVAL); @@ -1084,30 +1041,8 @@ ipsec_set_policy(struct secpolicy **pcb_ return (0); } -static int -ipsec_get_policy(struct secpolicy *pcb_sp, struct mbuf **mp) -{ - INIT_VNET_IPSEC(curvnet); - - /* Sanity check. */ - if (pcb_sp == NULL || mp == NULL) - return (EINVAL); - - *mp = key_sp2msg(pcb_sp); - if (!*mp) { - ipseclog((LOG_DEBUG, "%s: No more memory.\n", __func__)); - return (ENOBUFS); - } - - (*mp)->m_type = MT_DATA; - KEYDEBUG(KEYDEBUG_IPSEC_DUMP, - printf("%s:\n", __func__); kdebug_mbuf(*mp)); - - return (0); -} - int -ipsec4_set_policy(struct inpcb *inp, int optname, caddr_t request, +ipsec_set_policy(struct inpcb *inp, int optname, caddr_t request, size_t len, struct ucred *cred) { INIT_VNET_IPSEC(curvnet); @@ -1135,11 +1070,11 @@ ipsec4_set_policy(struct inpcb *inp, int return (EINVAL); } - return (ipsec_set_policy(pcb_sp, optname, request, len, cred)); + return (ipsec_set_policy_internal(pcb_sp, optname, request, len, cred)); } int -ipsec4_get_policy(struct inpcb *inp, caddr_t request, size_t len, +ipsec_get_policy(struct inpcb *inp, caddr_t request, size_t len, struct mbuf **mp) { INIT_VNET_IPSEC(curvnet); @@ -1168,7 +1103,21 @@ ipsec4_get_policy(struct inpcb *inp, cad return (EINVAL); } - return (ipsec_get_policy(pcb_sp, mp)); + /* Sanity check. Should be an IPSEC_ASSERT. */ + if (pcb_sp == NULL) + return (EINVAL); + + *mp = key_sp2msg(pcb_sp); + if (!*mp) { + ipseclog((LOG_DEBUG, "%s: No more memory.\n", __func__)); + return (ENOBUFS); + } + + (*mp)->m_type = MT_DATA; + KEYDEBUG(KEYDEBUG_IPSEC_DUMP, + printf("%s:\n", __func__); kdebug_mbuf(*mp)); + + return (0); } /* Delete policy in PCB. */ @@ -1192,73 +1141,6 @@ ipsec_delete_pcbpolicy(struct inpcb *inp return (0); } -#ifdef INET6 -int -ipsec6_set_policy(struct inpcb *inp, int optname, caddr_t request, - size_t len, struct ucred *cred) -{ - INIT_VNET_IPSEC(curvnet); - struct sadb_x_policy *xpl; - struct secpolicy **pcb_sp; - - /* Sanity check. */ - if (inp == NULL || request == NULL) - return (EINVAL); - if (len < sizeof(*xpl)) - return (EINVAL); - xpl = (struct sadb_x_policy *)request; - - /* Select direction. */ - switch (xpl->sadb_x_policy_dir) { - case IPSEC_DIR_INBOUND: - pcb_sp = &inp->inp_sp->sp_in; - break; - case IPSEC_DIR_OUTBOUND: - pcb_sp = &inp->inp_sp->sp_out; - break; - default: - ipseclog((LOG_ERR, "%s: invalid direction=%u\n", __func__, - xpl->sadb_x_policy_dir)); - return (EINVAL); - } - - return (ipsec_set_policy(pcb_sp, optname, request, len, cred)); -} - -int -ipsec6_get_policy(struct inpcb *inp, caddr_t request, size_t len, - struct mbuf **mp) -{ - INIT_VNET_IPSEC(curvnet); - struct sadb_x_policy *xpl; - struct secpolicy *pcb_sp; - - /* Sanity check. */ - if (inp == NULL || request == NULL || mp == NULL) - return (EINVAL); - IPSEC_ASSERT(inp->inp_sp != NULL, ("null inp_sp")); - if (len < sizeof(*xpl)) - return (EINVAL); - xpl = (struct sadb_x_policy *)request; - - /* Select direction. */ - switch (xpl->sadb_x_policy_dir) { - case IPSEC_DIR_INBOUND: - pcb_sp = inp->inp_sp->sp_in; - break; - case IPSEC_DIR_OUTBOUND: - pcb_sp = inp->inp_sp->sp_out; - break; - default: - ipseclog((LOG_ERR, "%s: invalid direction=%u\n", __func__, - xpl->sadb_x_policy_dir)); - return (EINVAL); - } - - return (ipsec_get_policy(pcb_sp, mp)); -} -#endif - /* * Return current level. * Either IPSEC_LEVEL_USE or IPSEC_LEVEL_REQUIRE are always returned. @@ -1437,15 +1319,9 @@ ipsec_in_reject(struct secpolicy *sp, st return (0); /* Valid. */ } -/* - * Check AH/ESP integrity. - * This function is called from tcp_input(), udp_input(), - * and {ah,esp}4_input for tunnel mode. - */ -int -ipsec4_in_reject(struct mbuf *m, struct inpcb *inp) +static int +ipsec46_in_reject(struct mbuf *m, struct inpcb *inp) { - INIT_VNET_IPSEC(curvnet); struct secpolicy *sp; int error; int result; @@ -1464,8 +1340,6 @@ ipsec4_in_reject(struct mbuf *m, struct if (sp != NULL) { result = ipsec_in_reject(sp, m); - if (result) - V_ipsec4stat.ips_in_polvio++; KEY_FREESP(&sp); } else { result = 0; /* XXX Should be panic? @@ -1474,6 +1348,24 @@ ipsec4_in_reject(struct mbuf *m, struct return (result); } +/* + * Check AH/ESP integrity. + * This function is called from tcp_input(), udp_input(), + * and {ah,esp}4_input for tunnel mode. + */ +int +ipsec4_in_reject(struct mbuf *m, struct inpcb *inp) +{ + INIT_VNET_IPSEC(curvnet); + int result; + + result = ipsec46_in_reject(m, inp); + if (result) + V_ipsec4stat.ips_in_polvio++; + + return (result); +} + #ifdef INET6 /* * Check AH/ESP integrity. @@ -1484,31 +1376,12 @@ int ipsec6_in_reject(struct mbuf *m, struct inpcb *inp) { INIT_VNET_IPSEC(curvnet); - struct secpolicy *sp = NULL; - int error; int result; - /* Sanity check. */ - if (m == NULL) - return (0); /* XXX Should be panic? */ - - /* Get SP for this packet. - * When we are called from ip_forward(), we call - * ipsec_getpolicybyaddr() with IP_FORWARDING flag. - */ - if (inp == NULL) - sp = ipsec_getpolicybyaddr(m, IPSEC_DIR_INBOUND, IP_FORWARDING, &error); - else - sp = ipsec_getpolicybysock(m, IPSEC_DIR_INBOUND, inp, &error); + result = ipsec46_in_reject(m, inp); + if (result) + V_ipsec6stat.ips_in_polvio++; - if (sp != NULL) { - result = ipsec_in_reject(sp, m); - if (result) - V_ipsec6stat.ips_in_polvio++; - KEY_FREESP(&sp); - } else { - result = 0; - } return (result); } #endif @@ -1519,7 +1392,7 @@ ipsec6_in_reject(struct mbuf *m, struct * NOTE: SP passed is freed in this function. */ static size_t -ipsec_hdrsiz(struct secpolicy *sp) +ipsec_hdrsiz_internal(struct secpolicy *sp) { INIT_VNET_IPSEC(curvnet); struct ipsecrequest *isr; @@ -1577,9 +1450,12 @@ ipsec_hdrsiz(struct secpolicy *sp) return (size); } -/* This function is called from ip_forward() and ipsec4_hdrsize_tcp(). */ +/* + * This function is called from ipsec_hdrsiz_tcp(), ip_ipsec_mtu(), + * disabled ip6_ipsec_mtu() and ip6_forward(). + */ size_t -ipsec4_hdrsiz(struct mbuf *m, u_int dir, struct inpcb *inp) +ipsec_hdrsiz(struct mbuf *m, u_int dir, struct inpcb *inp) { INIT_VNET_IPSEC(curvnet); struct secpolicy *sp; @@ -1598,7 +1474,7 @@ ipsec4_hdrsiz(struct mbuf *m, u_int dir, sp = ipsec_getpolicybysock(m, dir, inp, &error); if (sp != NULL) { - size = ipsec_hdrsiz(sp); + size = ipsec_hdrsiz_internal(sp); KEYDEBUG(KEYDEBUG_IPSEC_DATA, printf("%s: size:%lu.\n", __func__, (unsigned long)size)); @@ -1612,40 +1488,6 @@ ipsec4_hdrsiz(struct mbuf *m, u_int dir, return (size); } -#ifdef INET6 -/* This function is called from ipsec6_hdrsize_tcp(), - * and maybe from ip6_forward(). - */ -size_t -ipsec6_hdrsiz(struct mbuf *m, u_int dir, struct inpcb *inp) -{ - INIT_VNET_IPSEC(curvnet); - struct secpolicy *sp; - int error; - size_t size; - - IPSEC_ASSERT(m != NULL, ("null mbuf")); - IPSEC_ASSERT(inp == NULL || inp->inp_socket != NULL, - ("socket w/o inpcb")); - - /* Get SP for this packet. */ - /* XXX Is it right to call with IP_FORWARDING. */ - if (inp == NULL) - sp = ipsec_getpolicybyaddr(m, dir, IP_FORWARDING, &error); - else - sp = ipsec_getpolicybysock(m, dir, inp, &error); - - if (sp == NULL) - return (0); - size = ipsec_hdrsiz(sp); - KEYDEBUG(KEYDEBUG_IPSEC_DATA, - printf("%s: size:%lu.\n", __func__, (unsigned long)size)); - KEY_FREESP(&sp); - - return (size); -} -#endif /*INET6*/ - /* * Check the variable replay window. * ipsec_chkreplay() performs replay check before ICV verification. Modified: head/sys/netipsec/ipsec.h ============================================================================== --- head/sys/netipsec/ipsec.h Sun Feb 8 08:26:58 2009 (r188305) +++ head/sys/netipsec/ipsec.h Sun Feb 8 09:27:07 2009 (r188306) @@ -374,9 +374,9 @@ extern int ipsec_copy_policy extern u_int ipsec_get_reqlevel __P((struct ipsecrequest *)); extern int ipsec_in_reject __P((struct secpolicy *, struct mbuf *)); -extern int ipsec4_set_policy __P((struct inpcb *inp, int optname, +extern int ipsec_set_policy __P((struct inpcb *inp, int optname, caddr_t request, size_t len, struct ucred *cred)); -extern int ipsec4_get_policy __P((struct inpcb *inpcb, caddr_t request, +extern int ipsec_get_policy __P((struct inpcb *inpcb, caddr_t request, size_t len, struct mbuf **mp)); extern int ipsec_delete_pcbpolicy __P((struct inpcb *)); extern int ipsec4_in_reject __P((struct mbuf *, struct inpcb *)); @@ -386,7 +386,7 @@ struct tcpcb; extern int ipsec_chkreplay __P((u_int32_t, struct secasvar *)); extern int ipsec_updatereplay __P((u_int32_t, struct secasvar *)); -extern size_t ipsec4_hdrsiz __P((struct mbuf *, u_int, struct inpcb *)); +extern size_t ipsec_hdrsiz __P((struct mbuf *, u_int, struct inpcb *)); extern size_t ipsec_hdrsiz_tcp __P((struct tcpcb *)); union sockaddr_union; Modified: head/sys/netipsec/ipsec6.h ============================================================================== --- head/sys/netipsec/ipsec6.h Sun Feb 8 08:26:58 2009 (r188305) +++ head/sys/netipsec/ipsec6.h Sun Feb 8 09:27:07 2009 (r188306) @@ -50,16 +50,8 @@ extern int ip6_ipsec_ecn; struct inpcb; -extern int ipsec6_set_policy __P((struct inpcb *inp, int optname, - caddr_t request, size_t len, struct ucred *cred)); -extern int ipsec6_get_policy - __P((struct inpcb *inp, caddr_t request, size_t len, struct mbuf **mp)); extern int ipsec6_in_reject __P((struct mbuf *, struct inpcb *)); -struct tcp6cb; - -extern size_t ipsec6_hdrsiz __P((struct mbuf *, u_int, struct inpcb *)); - struct ip6_hdr; extern const char *ipsec6_logpacketstr __P((struct ip6_hdr *, u_int32_t)); From owner-svn-src-head@FreeBSD.ORG Sun Feb 8 10:21:26 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D28D106564A; Sun, 8 Feb 2009 10:21:26 +0000 (UTC) (envelope-from wkoszek@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3BFC48FC0A; Sun, 8 Feb 2009 10:21:26 +0000 (UTC) (envelope-from wkoszek@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n18ALQEv020825; Sun, 8 Feb 2009 10:21:26 GMT (envelope-from wkoszek@svn.freebsd.org) Received: (from wkoszek@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n18ALQd5020824; Sun, 8 Feb 2009 10:21:26 GMT (envelope-from wkoszek@svn.freebsd.org) Message-Id: <200902081021.n18ALQd5020824@svn.freebsd.org> From: "Wojciech A. Koszek" Date: Sun, 8 Feb 2009 10:21:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188307 - head/sys/pc98/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Feb 2009 10:21:26 -0000 Author: wkoszek Date: Sun Feb 8 10:21:25 2009 New Revision: 188307 URL: http://svn.freebsd.org/changeset/base/188307 Log: Bring missing comments on EPSON_BOUNCEDMA and EPSON_MEMWIN flags. Submitted by: nyan Modified: head/sys/pc98/conf/NOTES Modified: head/sys/pc98/conf/NOTES ============================================================================== --- head/sys/pc98/conf/NOTES Sun Feb 8 09:27:07 2009 (r188306) +++ head/sys/pc98/conf/NOTES Sun Feb 8 10:21:25 2009 (r188307) @@ -272,8 +272,11 @@ device isa # reset the CPU for reboot. This is needed on some systems with broken # keyboard controllers. # -# EPSON_BOUNCEDMA: XXX -# EPSON_MEMWIN: XXX +# EPSON_BOUNCEDMA was to use a bounce buffer to upper 15MB, but it's +# broken now. +# +# EPSON_MEMWIN disables 15-16MB chunk, and enables EPSON memory window. +# options AUTO_EOI_1 From owner-svn-src-head@FreeBSD.ORG Sun Feb 8 12:12:19 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6017D106568D; Sun, 8 Feb 2009 12:12:19 +0000 (UTC) (envelope-from wkoszek@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4EEFD8FC1F; Sun, 8 Feb 2009 12:12:19 +0000 (UTC) (envelope-from wkoszek@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n18CCJ9f022823; Sun, 8 Feb 2009 12:12:19 GMT (envelope-from wkoszek@svn.freebsd.org) Received: (from wkoszek@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n18CCJm5022822; Sun, 8 Feb 2009 12:12:19 GMT (envelope-from wkoszek@svn.freebsd.org) Message-Id: <200902081212.n18CCJm5022822@svn.freebsd.org> From: "Wojciech A. Koszek" Date: Sun, 8 Feb 2009 12:12:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188308 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Feb 2009 12:12:20 -0000 Author: wkoszek Date: Sun Feb 8 12:12:19 2009 New Revision: 188308 URL: http://svn.freebsd.org/changeset/base/188308 Log: Add missing pcfclock description. Modified: head/sys/conf/NOTES Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Sun Feb 8 10:21:25 2009 (r188307) +++ head/sys/conf/NOTES Sun Feb 8 12:12:19 2009 (r188308) @@ -2352,6 +2352,7 @@ device ds1672 # ppi General-purpose I/O ("Geek Port") + IEEE1284 I/O # pps Pulse per second Timing Interface # lpbb Philips official parallel port I2C bit-banging interface +# pcfclock Parallel port clock driver. # # Supported interfaces: # ppc ISA-bus parallel port interfaces. From owner-svn-src-head@FreeBSD.ORG Sun Feb 8 12:33:05 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ABB6D10656C7; Sun, 8 Feb 2009 12:33:05 +0000 (UTC) (envelope-from wkoszek@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7FF708FC22; Sun, 8 Feb 2009 12:33:05 +0000 (UTC) (envelope-from wkoszek@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n18CX5hA023302; Sun, 8 Feb 2009 12:33:05 GMT (envelope-from wkoszek@svn.freebsd.org) Received: (from wkoszek@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n18CX5n5023301; Sun, 8 Feb 2009 12:33:05 GMT (envelope-from wkoszek@svn.freebsd.org) Message-Id: <200902081233.n18CX5n5023301@svn.freebsd.org> From: "Wojciech A. Koszek" Date: Sun, 8 Feb 2009 12:33:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188309 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Feb 2009 12:33:06 -0000 Author: wkoszek Date: Sun Feb 8 12:33:05 2009 New Revision: 188309 URL: http://svn.freebsd.org/changeset/base/188309 Log: Further NOTES cleanup -- following drivers didn't survive TTY-ng and aren't included in NOTES anyway: cy(4), rc(4), rp(4). si(4) doesn't belong to global NOTES. Modified: head/sys/conf/NOTES Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Sun Feb 8 12:12:19 2009 (r188308) +++ head/sys/conf/NOTES Sun Feb 8 12:33:05 2009 (r188309) @@ -2138,44 +2138,9 @@ device tnt4882 # scd: Sony CD-ROM using proprietary (non-ATAPI) interface # mcd: Mitsumi CD-ROM using proprietary (non-ATAPI) interface # bktr: Brooktree bt848/848a/849a/878/879 video capture and TV Tuner board -# cy: Cyclades serial driver # joy: joystick (including IO DATA PCJOY PC Card joystick) -# rc: RISCom/8 multiport card -# rp: Comtrol Rocketport(ISA/PCI) - single card -# si: Specialix SI/XIO 4-32 port terminal multiplexor # cmx: OmniKey CardMan 4040 pccard smartcard reader -# Notes on the Comtrol Rocketport driver: -# -# The exact values used for rp0 depend on how many boards you have -# in the system. The manufacturer's sample configs are listed as: -# -# device rp # core driver support -# -# Comtrol Rocketport ISA single card -# hint.rp.0.at="isa" -# hint.rp.0.port="0x280" -# -# If instead you have two ISA cards, one installed at 0x100 and the -# second installed at 0x180, then you should add the following to -# your kernel probe hints: -# hint.rp.0.at="isa" -# hint.rp.0.port="0x100" -# hint.rp.1.at="isa" -# hint.rp.1.port="0x180" -# -# For 4 ISA cards, it might be something like this: -# hint.rp.0.at="isa" -# hint.rp.0.port="0x180" -# hint.rp.1.at="isa" -# hint.rp.1.port="0x100" -# hint.rp.2.at="isa" -# hint.rp.2.port="0x340" -# hint.rp.3.at="isa" -# hint.rp.3.port="0x240" -# -# For PCI cards, you need no hints. - # Mitsumi CD-ROM device mcd hint.mcd.0.at="isa" From owner-svn-src-head@FreeBSD.ORG Sun Feb 8 12:40:34 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C0B71065845; Sun, 8 Feb 2009 12:40:34 +0000 (UTC) (envelope-from wkoszek@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 448068FC20; Sun, 8 Feb 2009 12:40:34 +0000 (UTC) (envelope-from wkoszek@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n18CeYOE023471; Sun, 8 Feb 2009 12:40:34 GMT (envelope-from wkoszek@svn.freebsd.org) Received: (from wkoszek@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n18CeYWh023470; Sun, 8 Feb 2009 12:40:34 GMT (envelope-from wkoszek@svn.freebsd.org) Message-Id: <200902081240.n18CeYWh023470@svn.freebsd.org> From: "Wojciech A. Koszek" Date: Sun, 8 Feb 2009 12:40:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188310 - head/sys/i386/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Feb 2009 12:40:36 -0000 Author: wkoszek Date: Sun Feb 8 12:40:33 2009 New Revision: 188310 URL: http://svn.freebsd.org/changeset/base/188310 Log: si(4) seems to build without a problem. However, since noone noticed lack of this driver, put it in a comment. Modified: head/sys/i386/conf/NOTES Modified: head/sys/i386/conf/NOTES ============================================================================== --- head/sys/i386/conf/NOTES Sun Feb 8 12:33:05 2009 (r188309) +++ head/sys/i386/conf/NOTES Sun Feb 8 12:40:33 2009 (r188310) @@ -721,6 +721,7 @@ device glxsb # AMD Geode LX Security B # pbio: Parallel (8255 PPI) basic I/O (mode 0) port (e.g. Advantech PCL-724) # spic: Sony Programmable I/O controller (VAIO notebooks) # asmc: Apple System Management Controller +# si: Specialix International SI/XIO or SX intelligent serial card driver # Notes on APM # The flags takes the following meaning for apm0: @@ -758,6 +759,8 @@ device spic hint.spic.0.at="isa" hint.spic.0.port="0x10a0" device asmc +#device si + # # Laptop/Notebook options: # From owner-svn-src-head@FreeBSD.ORG Sun Feb 8 14:04:08 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A34F810656E8; Sun, 8 Feb 2009 14:04:08 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 918ED8FC08; Sun, 8 Feb 2009 14:04:08 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n18E48vN025253; Sun, 8 Feb 2009 14:04:08 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n18E48RK025251; Sun, 8 Feb 2009 14:04:08 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200902081404.n18E48RK025251@svn.freebsd.org> From: Robert Watson Date: Sun, 8 Feb 2009 14:04:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188311 - in head/sys: nfsserver security/audit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Feb 2009 14:04:09 -0000 Author: rwatson Date: Sun Feb 8 14:04:08 2009 New Revision: 188311 URL: http://svn.freebsd.org/changeset/base/188311 Log: Audit the flag argument to the nfssvc(2) system call. Obtained from: TrustedBSD Project Sponsored by: Apple, Inc. Modified: head/sys/nfsserver/nfs_syscalls.c head/sys/security/audit/audit_bsm.c Modified: head/sys/nfsserver/nfs_syscalls.c ============================================================================== --- head/sys/nfsserver/nfs_syscalls.c Sun Feb 8 12:40:33 2009 (r188310) +++ head/sys/nfsserver/nfs_syscalls.c Sun Feb 8 14:04:08 2009 (r188311) @@ -137,6 +137,8 @@ nfssvc(struct thread *td, struct nfssvc_ KASSERT(!mtx_owned(&Giant), ("nfssvc(): called with Giant")); + AUDIT_ARG(cmd, uap->flag); + error = priv_check(td, PRIV_NFS_DAEMON); if (error) return (error); Modified: head/sys/security/audit/audit_bsm.c ============================================================================== --- head/sys/security/audit/audit_bsm.c Sun Feb 8 12:40:33 2009 (r188310) +++ head/sys/security/audit/audit_bsm.c Sun Feb 8 14:04:08 2009 (r188311) @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999-2005 Apple Inc. + * Copyright (c) 1999-2009 Apple Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -639,7 +639,6 @@ kaudit_to_bsm(struct kaudit_record *kar, case AUE_MODLOAD: case AUE_MODUNLOAD: case AUE_MSGSYS: - case AUE_NFS_SVC: case AUE_NTP_ADJTIME: case AUE_PIPE: case AUE_PROFILE: @@ -1017,6 +1016,13 @@ kaudit_to_bsm(struct kaudit_record *kar, } /* FALLTHROUGH */ + case AUE_NFS_SVC: + if (ARG_IS_VALID(kar, ARG_CMD)) { + tok = au_to_arg32(1, "request", ar->ar_arg_cmd); + kau_write(rec, tok); + } + break; + case AUE_UMOUNT: UPATH1_VNODE1_TOKENS; break; From owner-svn-src-head@FreeBSD.ORG Sun Feb 8 14:24:36 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 48347106566B; Sun, 8 Feb 2009 14:24:36 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3722A8FC0A; Sun, 8 Feb 2009 14:24:36 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n18EOabY025722; Sun, 8 Feb 2009 14:24:36 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n18EOaCJ025721; Sun, 8 Feb 2009 14:24:36 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200902081424.n18EOaCJ025721@svn.freebsd.org> From: Robert Watson Date: Sun, 8 Feb 2009 14:24:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188312 - head/sys/security/audit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Feb 2009 14:24:36 -0000 Author: rwatson Date: Sun Feb 8 14:24:35 2009 New Revision: 188312 URL: http://svn.freebsd.org/changeset/base/188312 Log: Audit AUE_MAC_EXECVE; currently just the standard AUE_EXECVE arguments and not the label. Obtained from: TrustedBSD Project Sponsored by: Apple, Inc. MFC after: 1 week Modified: head/sys/security/audit/audit_bsm.c Modified: head/sys/security/audit/audit_bsm.c ============================================================================== --- head/sys/security/audit/audit_bsm.c Sun Feb 8 14:04:08 2009 (r188311) +++ head/sys/security/audit/audit_bsm.c Sun Feb 8 14:24:35 2009 (r188312) @@ -791,6 +791,7 @@ kaudit_to_bsm(struct kaudit_record *kar, /* FALLTHROUGH */ case AUE_EXECVE: + case AUE_MAC_EXECVE: if (ARG_IS_VALID(kar, ARG_ARGV)) { tok = au_to_exec_args(ar->ar_arg_argv, ar->ar_arg_argc); From owner-svn-src-head@FreeBSD.ORG Sun Feb 8 14:39:35 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D42A106566B; Sun, 8 Feb 2009 14:39:35 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7130D8FC0A; Sun, 8 Feb 2009 14:39:35 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n18EdZQ1026016; Sun, 8 Feb 2009 14:39:35 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n18EdZuN026014; Sun, 8 Feb 2009 14:39:35 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200902081439.n18EdZuN026014@svn.freebsd.org> From: Robert Watson Date: Sun, 8 Feb 2009 14:39:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188313 - head/sys/security/audit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Feb 2009 14:39:36 -0000 Author: rwatson Date: Sun Feb 8 14:39:35 2009 New Revision: 188313 URL: http://svn.freebsd.org/changeset/base/188313 Log: Change various routines that are responsible for transforming audit event IDs based on arguments to return au_event_t rather than int. Obtained from: TrustedBSD Project Sponsored by: Apple, Inc. MFC after: 1 week Modified: head/sys/security/audit/audit_bsm_klib.c head/sys/security/audit/audit_private.h Modified: head/sys/security/audit/audit_bsm_klib.c ============================================================================== --- head/sys/security/audit/audit_bsm_klib.c Sun Feb 8 14:24:35 2009 (r188312) +++ head/sys/security/audit/audit_bsm_klib.c Sun Feb 8 14:39:35 2009 (r188313) @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999-2008 Apple Inc. + * Copyright (c) 1999-2009 Apple Inc. * Copyright (c) 2005 Robert N. M. Watson * All rights reserved. * @@ -346,7 +346,7 @@ audit_flags_and_error_to_openevent(int o /* * Convert a MSGCTL command to a specific event. */ -int +au_event_t audit_msgctl_to_event(int cmd) { @@ -369,7 +369,7 @@ audit_msgctl_to_event(int cmd) /* * Convert a SEMCTL command to a specific event. */ -int +au_event_t audit_semctl_to_event(int cmd) { @@ -413,7 +413,7 @@ audit_semctl_to_event(int cmd) /* * Convert a command for the auditon() system call to a audit event. */ -int +au_event_t auditon_command_event(int cmd) { Modified: head/sys/security/audit/audit_private.h ============================================================================== --- head/sys/security/audit/audit_private.h Sun Feb 8 14:24:35 2009 (r188312) +++ head/sys/security/audit/audit_private.h Sun Feb 8 14:39:35 2009 (r188313) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1999-2005 Apple Inc. + * Copyright (c) 1999-2009 Apple Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -306,10 +306,10 @@ void au_evclassmap_insert(au_event_t e au_class_t au_event_class(au_event_t event); au_event_t audit_ctlname_to_sysctlevent(int name[], uint64_t valid_arg); au_event_t audit_flags_and_error_to_openevent(int oflags, int error); -int audit_msgctl_to_event(int cmd); -int audit_semctl_to_event(int cmr); +au_event_t audit_msgctl_to_event(int cmd); +au_event_t audit_semctl_to_event(int cmr); void audit_canon_path(struct thread *td, char *path, char *cpath); -int auditon_command_event(int cmd); +au_event_t auditon_command_event(int cmd); /* * Audit trigger events notify user space of kernel audit conditions From owner-svn-src-head@FreeBSD.ORG Sun Feb 8 14:43:20 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CBB4E1065672; Sun, 8 Feb 2009 14:43:20 +0000 (UTC) (envelope-from wkoszek@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9F0D38FC22; Sun, 8 Feb 2009 14:43:20 +0000 (UTC) (envelope-from wkoszek@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n18EhK2e026118; Sun, 8 Feb 2009 14:43:20 GMT (envelope-from wkoszek@svn.freebsd.org) Received: (from wkoszek@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n18EhK23026117; Sun, 8 Feb 2009 14:43:20 GMT (envelope-from wkoszek@svn.freebsd.org) Message-Id: <200902081443.n18EhK23026117@svn.freebsd.org> From: "Wojciech A. Koszek" Date: Sun, 8 Feb 2009 14:43:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188314 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Feb 2009 14:43:22 -0000 Author: wkoszek Date: Sun Feb 8 14:43:20 2009 New Revision: 188314 URL: http://svn.freebsd.org/changeset/base/188314 Log: Fix several filenames for "make clean" target. Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun Feb 8 14:39:35 2009 (r188313) +++ head/sys/conf/files Sun Feb 8 14:43:20 2009 (r188314) @@ -1036,7 +1036,7 @@ iwnfw.fwo optional iwnfw \ dependency "iwn.fw" \ compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwn.fw" \ no-implicit-rule \ - clean "iwn.fwo" + clean "iwnfw.fwo" iwn.fw optional iwnfw \ dependency ".PHONY" \ compile-with "uudecode -o ${.TARGET} $S/contrib/dev/iwn/iwlwifi-4965-4.44.17.fw.uu" \ @@ -1234,7 +1234,7 @@ rt2561fw.fwo optional rt2561fw | ralfw dependency "rt2561.fw" \ compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} rt2561.fw" \ no-implicit-rule \ - clean "rt2561.fwo" + clean "rt2561fw.fwo" rt2561.fw optional rt2561fw | ralfw \ dependency ".PHONY" \ compile-with "uudecode -o ${.TARGET} $S/contrib/dev/ral/rt2561.fw.uu" \ @@ -1248,7 +1248,7 @@ rt2561sfw.fwo optional rt2561sfw | ral dependency "rt2561s.fw" \ compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} rt2561s.fw" \ no-implicit-rule \ - clean "rt2561s.fwo" + clean "rt2561sfw.fwo" rt2561s.fw optional rt2561sfw | ralfw \ dependency ".PHONY" \ compile-with "uudecode -o ${.TARGET} $S/contrib/dev/ral/rt2561s.fw.uu" \ @@ -1262,7 +1262,7 @@ rt2661fw.fwo optional rt2661fw | ralfw dependency "rt2661.fw" \ compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} rt2661.fw" \ no-implicit-rule \ - clean "rt2661.fwo" + clean "rt2661fw.fwo" rt2661.fw optional rt2661fw | ralfw \ dependency ".PHONY" \ compile-with "uudecode -o ${.TARGET} $S/contrib/dev/ral/rt2661.fw.uu" \ @@ -1276,7 +1276,7 @@ rt2860fw.fwo optional rt2860fw | ralfw dependency "rt2860.fw" \ compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} rt2860.fw" \ no-implicit-rule \ - clean "rt2860.fwo" + clean "rt2860fw.fwo" rt2860.fw optional rt2860fw | ralfw \ dependency ".PHONY" \ compile-with "uudecode -o ${.TARGET} $S/contrib/dev/ral/rt2860.fw.uu" \ @@ -1697,7 +1697,7 @@ wpifw.fwo optional wpifw \ dependency "wpi.fw" \ compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} wpi.fw" \ no-implicit-rule \ - clean "wpi.fwo" + clean "wpifw.fwo" wpi.fw optional wpifw \ dependency ".PHONY" \ compile-with "uudecode -o ${.TARGET} $S/contrib/dev/wpi/iwlwifi-3945-2.14.4.fw.uu" \ From owner-svn-src-head@FreeBSD.ORG Sun Feb 8 15:38:31 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D62E1065670; Sun, 8 Feb 2009 15:38:31 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7BEE78FC1C; Sun, 8 Feb 2009 15:38:31 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n18FcVrh027122; Sun, 8 Feb 2009 15:38:31 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n18FcVMN027121; Sun, 8 Feb 2009 15:38:31 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200902081538.n18FcVMN027121@svn.freebsd.org> From: Robert Watson Date: Sun, 8 Feb 2009 15:38:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188315 - head/sys/security/audit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Feb 2009 15:38:32 -0000 Author: rwatson Date: Sun Feb 8 15:38:31 2009 New Revision: 188315 URL: http://svn.freebsd.org/changeset/base/188315 Log: Set the lower bound on queue size for an audit pipe to 1 instead of 0, as an audit pipe with a queue length of 0 is less useful. Obtained from: TrustedBSD Project Sponsored by: Apple, Inc. MFC after: 1 week Modified: head/sys/security/audit/audit_pipe.c Modified: head/sys/security/audit/audit_pipe.c ============================================================================== --- head/sys/security/audit/audit_pipe.c Sun Feb 8 14:43:20 2009 (r188314) +++ head/sys/security/audit/audit_pipe.c Sun Feb 8 15:38:31 2009 (r188315) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Robert N. M. Watson - * Copyright (c) 2008 Apple, Inc. + * Copyright (c) 2008-2009 Apple, Inc. * All rights reserved. * * This software was developed by Robert Watson for the TrustedBSD Project. @@ -76,7 +76,7 @@ static MALLOC_DEFINE(M_AUDIT_PIPE_PRESEL * Audit pipe buffer parameters. */ #define AUDIT_PIPE_QLIMIT_DEFAULT (128) -#define AUDIT_PIPE_QLIMIT_MIN (0) +#define AUDIT_PIPE_QLIMIT_MIN (1) #define AUDIT_PIPE_QLIMIT_MAX (1024) /* From owner-svn-src-head@FreeBSD.ORG Sun Feb 8 16:43:47 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6DBA4106564A; Sun, 8 Feb 2009 16:43:47 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from ebb.errno.com (ebb.errno.com [69.12.149.25]) by mx1.freebsd.org (Postfix) with ESMTP id 441728FC0C; Sun, 8 Feb 2009 16:43:47 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from trouble.errno.com (trouble.errno.com [10.0.0.248]) (authenticated bits=0) by ebb.errno.com (8.13.6/8.12.6) with ESMTP id n18GhknW012593 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 8 Feb 2009 08:43:47 -0800 (PST) (envelope-from sam@freebsd.org) Message-ID: <498F0BC2.2050302@freebsd.org> Date: Sun, 08 Feb 2009 08:43:46 -0800 From: Sam Leffler Organization: FreeBSD Project User-Agent: Thunderbird 2.0.0.18 (X11/20081209) MIME-Version: 1.0 To: "Wojciech A. Koszek" References: <200902081233.n18CX5n5023301@svn.freebsd.org> In-Reply-To: <200902081233.n18CX5n5023301@svn.freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-DCC-Rhyolite-Metrics: ebb.errno.com; whitelist Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r188309 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Feb 2009 16:43:47 -0000 Wojciech A. Koszek wrote: > Author: wkoszek > Date: Sun Feb 8 12:33:05 2009 > New Revision: 188309 > URL: http://svn.freebsd.org/changeset/base/188309 > > Log: > Further NOTES cleanup -- following drivers didn't survive TTY-ng > and aren't included in NOTES anyway: cy(4), rc(4), rp(4). > > si(4) doesn't belong to global NOTES. > > I'm not sure I agree w/ yanking drivers entirely because they don't work. If they are commented out w/ a note why this will help people find them and possibly resuscitate them. If they are well and truly gone from then tree then sure--but as of today they are still in svn. Sam From owner-svn-src-head@FreeBSD.ORG Sun Feb 8 16:58:05 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 64453106566B; Sun, 8 Feb 2009 16:58:05 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 528978FC08; Sun, 8 Feb 2009 16:58:05 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n18Gw5HK028636; Sun, 8 Feb 2009 16:58:05 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n18Gw5hN028634; Sun, 8 Feb 2009 16:58:05 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <200902081658.n18Gw5hN028634@svn.freebsd.org> From: Hajimu UMEMOTO Date: Sun, 8 Feb 2009 16:58:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188316 - head/lib/libc/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Feb 2009 16:58:05 -0000 Author: ume Date: Sun Feb 8 16:58:05 2009 New Revision: 188316 URL: http://svn.freebsd.org/changeset/base/188316 Log: Shutup warning for DNAME RR. PR: bin/127591 Submitted by: "Eugene M. Kim" <20080111.freebsd.org__at__ab.ote.we.lv> MFC after: 1 week Modified: head/lib/libc/net/getaddrinfo.c head/lib/libc/net/gethostbydns.c Modified: head/lib/libc/net/getaddrinfo.c ============================================================================== --- head/lib/libc/net/getaddrinfo.c Sun Feb 8 15:38:31 2009 (r188315) +++ head/lib/libc/net/getaddrinfo.c Sun Feb 8 16:58:05 2009 (r188316) @@ -1863,7 +1863,8 @@ getanswer(const querybuf *answer, int an } } else if (type != qtype) { #ifdef DEBUG - if (type != T_KEY && type != T_SIG) + if (type != T_KEY && type != T_SIG && + type != ns_t_dname) syslog(LOG_NOTICE|LOG_AUTH, "gethostby*.getanswer: asked for \"%s %s %s\", got type \"%s\"", qname, p_class(C_IN), p_type(qtype), Modified: head/lib/libc/net/gethostbydns.c ============================================================================== --- head/lib/libc/net/gethostbydns.c Sun Feb 8 15:38:31 2009 (r188315) +++ head/lib/libc/net/gethostbydns.c Sun Feb 8 16:58:05 2009 (r188316) @@ -294,7 +294,7 @@ gethostanswer(const querybuf *answer, in continue; } if (type != qtype) { - if (type != T_SIG) + if (type != T_SIG && type != ns_t_dname) syslog(LOG_NOTICE|LOG_AUTH, "gethostby*.gethostanswer: asked for \"%s %s %s\", got type \"%s\"", qname, p_class(C_IN), p_type(qtype), From owner-svn-src-head@FreeBSD.ORG Sun Feb 8 19:18:33 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9A796106566B; Sun, 8 Feb 2009 19:18:33 +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 881148FC1C; Sun, 8 Feb 2009 19:18:33 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n18JIXrY031640; Sun, 8 Feb 2009 19:18:33 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n18JIXvD031637; Sun, 8 Feb 2009 19:18:33 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200902081918.n18JIXvD031637@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 8 Feb 2009 19:18:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188318 - head/sys/fs/tmpfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Feb 2009 19:18:34 -0000 Author: kib Date: Sun Feb 8 19:18:33 2009 New Revision: 188318 URL: http://svn.freebsd.org/changeset/base/188318 Log: Lookup up the directory entry for the tmpfs node that are deleted by both node pointer and name component. This does the right thing for hardlinks to the same node in the same directory. Submitted by: Yoshihiro Ota PR: kern/131356 MFC after: 2 weeks Modified: head/sys/fs/tmpfs/tmpfs.h head/sys/fs/tmpfs/tmpfs_subr.c head/sys/fs/tmpfs/tmpfs_vnops.c Modified: head/sys/fs/tmpfs/tmpfs.h ============================================================================== --- head/sys/fs/tmpfs/tmpfs.h Sun Feb 8 17:49:32 2009 (r188317) +++ head/sys/fs/tmpfs/tmpfs.h Sun Feb 8 19:18:33 2009 (r188318) @@ -408,9 +408,8 @@ int tmpfs_alloc_file(struct vnode *, str void tmpfs_dir_attach(struct vnode *, struct tmpfs_dirent *); void tmpfs_dir_detach(struct vnode *, struct tmpfs_dirent *); struct tmpfs_dirent * tmpfs_dir_lookup(struct tmpfs_node *node, + struct tmpfs_node *f, struct componentname *cnp); -struct tmpfs_dirent *tmpfs_dir_search(struct tmpfs_node *node, - struct tmpfs_node *f); int tmpfs_dir_getdotdent(struct tmpfs_node *, struct uio *); int tmpfs_dir_getdotdotdent(struct tmpfs_node *, struct uio *); struct tmpfs_dirent * tmpfs_dir_lookupbycookie(struct tmpfs_node *, off_t); Modified: head/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_subr.c Sun Feb 8 17:49:32 2009 (r188317) +++ head/sys/fs/tmpfs/tmpfs_subr.c Sun Feb 8 19:18:33 2009 (r188318) @@ -571,7 +571,8 @@ tmpfs_dir_detach(struct vnode *vp, struc * Returns a pointer to the entry when found, otherwise NULL. */ struct tmpfs_dirent * -tmpfs_dir_lookup(struct tmpfs_node *node, struct componentname *cnp) +tmpfs_dir_lookup(struct tmpfs_node *node, struct tmpfs_node *f, + struct componentname *cnp) { boolean_t found; struct tmpfs_dirent *de; @@ -583,6 +584,8 @@ tmpfs_dir_lookup(struct tmpfs_node *node found = 0; TAILQ_FOREACH(de, &node->tn_dir.tn_dirhead, td_entries) { + if (f != NULL && de->td_node != f) + continue; MPASS(cnp->cn_namelen < 0xffff); if (de->td_namelen == (uint16_t)cnp->cn_namelen && bcmp(de->td_name, cnp->cn_nameptr, de->td_namelen) == 0) { @@ -595,20 +598,6 @@ tmpfs_dir_lookup(struct tmpfs_node *node return found ? de : NULL; } -struct tmpfs_dirent * -tmpfs_dir_search(struct tmpfs_node *node, struct tmpfs_node *f) -{ - struct tmpfs_dirent *de; - - TMPFS_VALIDATE_DIR(node); - node->tn_status |= TMPFS_NODE_ACCESSED; - TAILQ_FOREACH(de, &node->tn_dir.tn_dirhead, td_entries) { - if (de->td_node == f) - return (de); - } - return (NULL); -} - /* --------------------------------------------------------------------- */ /* Modified: head/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vnops.c Sun Feb 8 17:49:32 2009 (r188317) +++ head/sys/fs/tmpfs/tmpfs_vnops.c Sun Feb 8 19:18:33 2009 (r188318) @@ -104,7 +104,7 @@ tmpfs_lookup(struct vop_cachedlookup_arg *vpp = dvp; error = 0; } else { - de = tmpfs_dir_lookup(dnode, cnp); + de = tmpfs_dir_lookup(dnode, NULL, cnp); if (de == NULL) { /* The entry was not found in the directory. * This is OK if we are creating or renaming an @@ -772,7 +772,7 @@ tmpfs_remove(struct vop_remove_args *v) dnode = VP_TO_TMPFS_DIR(dvp); node = VP_TO_TMPFS_NODE(vp); tmp = VFS_TO_TMPFS(vp->v_mount); - de = tmpfs_dir_search(dnode, node); + de = tmpfs_dir_lookup(dnode, node, v->a_cnp); MPASS(de != NULL); /* Files marked as immutable or append-only cannot be deleted. */ @@ -919,7 +919,7 @@ tmpfs_rename(struct vop_rename_args *v) } fdnode = VP_TO_TMPFS_DIR(fdvp); fnode = VP_TO_TMPFS_NODE(fvp); - de = tmpfs_dir_search(fdnode, fnode); + de = tmpfs_dir_lookup(fdnode, fnode, fcnp); /* Avoid manipulating '.' and '..' entries. */ if (de == NULL) { @@ -1031,7 +1031,7 @@ tmpfs_rename(struct vop_rename_args *v) * from the target directory. */ if (tvp != NULL) { /* Remove the old entry from the target directory. */ - de = tmpfs_dir_search(tdnode, tnode); + de = tmpfs_dir_lookup(tdnode, tnode, tcnp); tmpfs_dir_detach(tdvp, de); /* Free the directory entry we just deleted. Note that the @@ -1119,7 +1119,7 @@ tmpfs_rmdir(struct vop_rmdir_args *v) /* Get the directory entry associated with node (vp). This was * filled by tmpfs_lookup while looking up the entry. */ - de = tmpfs_dir_search(dnode, node); + de = tmpfs_dir_lookup(dnode, node, v->a_cnp); MPASS(TMPFS_DIRENT_MATCHES(de, v->a_cnp->cn_nameptr, v->a_cnp->cn_namelen)); From owner-svn-src-head@FreeBSD.ORG Sun Feb 8 19:37:02 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 90B031065686; Sun, 8 Feb 2009 19:37:02 +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 7DFD78FC12; Sun, 8 Feb 2009 19:37:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n18Jb2FR032005; Sun, 8 Feb 2009 19:37:02 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n18Jb2gq032004; Sun, 8 Feb 2009 19:37:02 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200902081937.n18Jb2gq032004@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 8 Feb 2009 19:37:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188319 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Feb 2009 19:37:03 -0000 Author: kib Date: Sun Feb 8 19:37:01 2009 New Revision: 188319 URL: http://svn.freebsd.org/changeset/base/188319 Log: Style. Modified: head/sys/vm/vm_fault.c Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Sun Feb 8 19:18:33 2009 (r188318) +++ head/sys/vm/vm_fault.c Sun Feb 8 19:37:01 2009 (r188319) @@ -135,6 +135,7 @@ struct faultstate { static inline void release_page(struct faultstate *fs) { + vm_page_wakeup(fs->m); vm_page_lock_queues(); vm_page_deactivate(fs->m); @@ -145,6 +146,7 @@ release_page(struct faultstate *fs) static inline void unlock_map(struct faultstate *fs) { + if (fs->lookup_still_valid) { vm_map_lookup_done(fs->map, fs->entry); fs->lookup_still_valid = FALSE; From owner-svn-src-head@FreeBSD.ORG Sun Feb 8 19:41:08 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B57B1065673; Sun, 8 Feb 2009 19:41:08 +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 798088FC12; Sun, 8 Feb 2009 19:41:08 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n18Jf8bt032118; Sun, 8 Feb 2009 19:41:08 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n18Jf834032117; Sun, 8 Feb 2009 19:41:08 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200902081941.n18Jf834032117@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 8 Feb 2009 19:41:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188320 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Feb 2009 19:41:09 -0000 Author: kib Date: Sun Feb 8 19:41:08 2009 New Revision: 188320 URL: http://svn.freebsd.org/changeset/base/188320 Log: Do not leak the MAP_ENTRY_IN_TRANSITION flag when copying map entry on fork. Otherwise, copied entry cannot be removed in the child map. Reviewed by: tegge MFC after: 2 weeks Modified: head/sys/vm/vm_map.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Sun Feb 8 19:37:01 2009 (r188319) +++ head/sys/vm/vm_map.c Sun Feb 8 19:41:08 2009 (r188320) @@ -2738,7 +2738,8 @@ vmspace_fork(struct vmspace *vm1) */ new_entry = vm_map_entry_create(new_map); *new_entry = *old_entry; - new_entry->eflags &= ~MAP_ENTRY_USER_WIRED; + new_entry->eflags &= ~(MAP_ENTRY_USER_WIRED | + MAP_ENTRY_IN_TRANSITION); new_entry->wired_count = 0; /* @@ -2764,7 +2765,8 @@ vmspace_fork(struct vmspace *vm1) */ new_entry = vm_map_entry_create(new_map); *new_entry = *old_entry; - new_entry->eflags &= ~MAP_ENTRY_USER_WIRED; + new_entry->eflags &= ~(MAP_ENTRY_USER_WIRED | + MAP_ENTRY_IN_TRANSITION); new_entry->wired_count = 0; new_entry->object.vm_object = NULL; vm_map_entry_link(new_map, new_map->header.prev, From owner-svn-src-head@FreeBSD.ORG Sun Feb 8 19:44:50 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D6896106566B; Sun, 8 Feb 2009 19:44:50 +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 C51598FC1C; Sun, 8 Feb 2009 19:44:50 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n18Jioub032225; Sun, 8 Feb 2009 19:44:50 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n18Jiojs032224; Sun, 8 Feb 2009 19:44:50 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200902081944.n18Jiojs032224@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 8 Feb 2009 19:44:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188321 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Feb 2009 19:44:51 -0000 Author: kib Date: Sun Feb 8 19:44:50 2009 New Revision: 188321 URL: http://svn.freebsd.org/changeset/base/188321 Log: Assert that vnode is exclusively locked when its vm object is resized. Reviewed by: tegge Modified: head/sys/vm/vnode_pager.c Modified: head/sys/vm/vnode_pager.c ============================================================================== --- head/sys/vm/vnode_pager.c Sun Feb 8 19:41:08 2009 (r188320) +++ head/sys/vm/vnode_pager.c Sun Feb 8 19:44:50 2009 (r188321) @@ -367,6 +367,7 @@ vnode_pager_setsize(vp, nsize) if ((object = vp->v_object) == NULL) return; + ASSERT_VOP_ELOCKED(vp, "vnode_pager_setsize and not locked vnode"); VM_OBJECT_LOCK(object); if (nsize == object->un_pager.vnp.vnp_size) { /* From owner-svn-src-head@FreeBSD.ORG Sun Feb 8 19:55:03 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C484E106566C; Sun, 8 Feb 2009 19:55: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 AEEFC8FC20; Sun, 8 Feb 2009 19:55:03 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n18Jt3UP032531; Sun, 8 Feb 2009 19:55:03 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n18Jt3Po032530; Sun, 8 Feb 2009 19:55:03 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200902081955.n18Jt3Po032530@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 8 Feb 2009 19:55:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188323 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Feb 2009 19:55:04 -0000 Author: kib Date: Sun Feb 8 19:55:03 2009 New Revision: 188323 URL: http://svn.freebsd.org/changeset/base/188323 Log: Lock the new map in vmspace_fork(). The newly allocated map should not be accessible outside vmspace_fork() yet, but locking it would satisfy the protocol of the vm_map_entry_link() and other functions called from vmspace_fork(). Use trylock that is supposedly cannot fail, to silence WITNESS warning of the nested acquisition of the sx lock with the same name. Suggested and reviewed by: tegge Modified: head/sys/vm/vm_map.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Sun Feb 8 19:53:37 2009 (r188322) +++ head/sys/vm/vm_map.c Sun Feb 8 19:55:03 2009 (r188323) @@ -2679,6 +2679,7 @@ vmspace_fork(struct vmspace *vm1) vm_map_entry_t old_entry; vm_map_entry_t new_entry; vm_object_t object; + int locked; vm_map_lock(old_map); @@ -2689,6 +2690,8 @@ vmspace_fork(struct vmspace *vm1) vm2->vm_daddr = vm1->vm_daddr; vm2->vm_maxsaddr = vm1->vm_maxsaddr; new_map = &vm2->vm_map; /* XXX */ + locked = vm_map_trylock(new_map); /* trylock to silence WITNESS */ + KASSERT(locked, ("vmspace_fork: lock failed")); new_map->timestamp = 1; old_entry = old_map->header.next; @@ -2780,6 +2783,8 @@ vmspace_fork(struct vmspace *vm1) } unlock_and_return: vm_map_unlock(old_map); + if (vm2 != NULL) + vm_map_unlock(new_map); return (vm2); } From owner-svn-src-head@FreeBSD.ORG Sun Feb 8 20:00:35 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 705E2106566B; Sun, 8 Feb 2009 20:00:35 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5E9138FC0C; Sun, 8 Feb 2009 20:00:35 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n18K0Xku032763; Sun, 8 Feb 2009 20:00:33 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n18K0XQl032762; Sun, 8 Feb 2009 20:00:33 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200902082000.n18K0XQl032762@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 8 Feb 2009 20:00:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188325 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Feb 2009 20:00:36 -0000 Author: kib Date: Sun Feb 8 20:00:33 2009 New Revision: 188325 URL: http://svn.freebsd.org/changeset/base/188325 Log: Add the comments to vm_map_simplify_entry() and vmspace_fork(), describing why several calls to vm_deallocate_object() with locked map do not result in the acquisition of the vnode lock after map lock. Suggested and reviewed by: tegge Modified: head/sys/vm/vm_map.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Sun Feb 8 19:55:13 2009 (r188324) +++ head/sys/vm/vm_map.c Sun Feb 8 20:00:33 2009 (r188325) @@ -1350,6 +1350,16 @@ vm_map_simplify_entry(vm_map_t map, vm_m entry->offset = prev->offset; if (entry->prev != &map->header) vm_map_entry_resize_free(map, entry->prev); + + /* + * If the backing object is the vnode object, + * vm_object_deallocate() results in a call to + * vrele(). Because the reference to the + * object is not last, vrele() does not lock + * the vnode, and map lock can be kept without + * causing vnode lock to be taken after the + * map lock. + */ if (prev->object.vm_object) vm_object_deallocate(prev->object.vm_object); vm_map_entry_dispose(map, prev); @@ -1371,6 +1381,10 @@ vm_map_simplify_entry(vm_map_t map, vm_m vm_map_entry_unlink(map, next); entry->end = next->end; vm_map_entry_resize_free(map, entry); + + /* + * See comment above. + */ if (next->object.vm_object) vm_object_deallocate(next->object.vm_object); vm_map_entry_dispose(map, next); @@ -2729,6 +2743,12 @@ vmspace_fork(struct vmspace *vm1) /* Transfer the second reference too. */ vm_object_reference( old_entry->object.vm_object); + + /* + * As in vm_map_simplify_entry(), the + * vnode lock may not be acquired in + * this call to vm_object_deallocate(). + */ vm_object_deallocate(object); object = old_entry->object.vm_object; } From owner-svn-src-head@FreeBSD.ORG Sun Feb 8 20:02:58 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9EFE11065670; Sun, 8 Feb 2009 20:02:58 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8C4098FC18; Sun, 8 Feb 2009 20:02:58 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n18K2wsL032874; Sun, 8 Feb 2009 20:02:58 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n18K2wwM032871; Sun, 8 Feb 2009 20:02:58 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902082002.n18K2wwM032871@svn.freebsd.org> From: Sam Leffler Date: Sun, 8 Feb 2009 20:02:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188327 - head/tools/tools/ath/athstats X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Feb 2009 20:02:59 -0000 Author: sam Date: Sun Feb 8 20:02:58 2009 New Revision: 188327 URL: http://svn.freebsd.org/changeset/base/188327 Log: o use humanize_number to print totals o shrink some fields now that we don't have to worry about overflow Modified: head/tools/tools/ath/athstats/Makefile head/tools/tools/ath/athstats/athstats.c head/tools/tools/ath/athstats/statfoo.c Modified: head/tools/tools/ath/athstats/Makefile ============================================================================== --- head/tools/tools/ath/athstats/Makefile Sun Feb 8 20:00:36 2009 (r188326) +++ head/tools/tools/ath/athstats/Makefile Sun Feb 8 20:02:58 2009 (r188327) @@ -4,6 +4,9 @@ PROG= athstats SRCS= main.c statfoo.c athstats.c +DPADD= ${LIBUTIL} +LDADD= -lutil + .include SRCDIR= ${.CURDIR}/../../../.. Modified: head/tools/tools/ath/athstats/athstats.c ============================================================================== --- head/tools/tools/ath/athstats/athstats.c Sun Feb 8 20:00:36 2009 (r188326) +++ head/tools/tools/ath/athstats/athstats.c Sun Feb 8 20:02:58 2009 (r188327) @@ -46,6 +46,7 @@ #include #include #include +#include #include "ah.h" #include "ah_desc.h" @@ -67,15 +68,15 @@ static const struct fmt athstats[] = { #define S_INPUT 0 - { 8, "input", "input", "data frames received" }, + { 7, "input", "input", "data frames received" }, #define S_OUTPUT AFTER(S_INPUT) - { 8, "output", "output", "data frames transmit" }, + { 7, "output", "output", "data frames transmit" }, #define S_TX_ALTRATE AFTER(S_OUTPUT) { 7, "altrate", "altrate", "tx frames with an alternate rate" }, #define S_TX_SHORTRETRY AFTER(S_TX_ALTRATE) - { 7, "short", "short", "short on-chip tx retries" }, + { 6, "short", "short", "short on-chip tx retries" }, #define S_TX_LONGRETRY AFTER(S_TX_SHORTRETRY) - { 7, "long", "long", "long on-chip tx retries" }, + { 6, "long", "long", "long on-chip tx retries" }, #define S_TX_XRETRIES AFTER(S_TX_LONGRETRY) { 6, "xretry", "xretry", "tx failed 'cuz too many retries" }, #define S_MIB AFTER(S_TX_XRETRIES) @@ -201,7 +202,7 @@ static const struct fmt athstats[] = { #define S_BE_NOMBUF AFTER(S_RX_PHY_CCK_RESTART) { 4, "benombuf", "benombuf", "beacon setup failed 'cuz no mbuf" }, #define S_BE_XMIT AFTER(S_BE_NOMBUF) - { 7, "bexmit", "bexmit", "beacons transmitted" }, + { 6, "bexmit", "bexmit", "beacons transmitted" }, #define S_PER_CAL AFTER(S_BE_XMIT) { 4, "pcal", "pcal", "periodic calibrations" }, #define S_PER_CALFAIL AFTER(S_PER_CAL) @@ -210,13 +211,13 @@ static const struct fmt athstats[] = { { 4, "prfga", "prfga", "rfgain value change" }, #if ATH_SUPPORT_TDMA #define S_TDMA_UPDATE AFTER(S_PER_RFGAIN) - { 5, "tdmau", "tdmau", "TDMA slot timing updates" }, + { 6, "tdmau", "tdmau", "TDMA slot timing updates" }, #define S_TDMA_TIMERS AFTER(S_TDMA_UPDATE) - { 5, "tdmab", "tdmab", "TDMA slot update set beacon timers" }, + { 6, "tdmab", "tdmab", "TDMA slot update set beacon timers" }, #define S_TDMA_TSF AFTER(S_TDMA_TIMERS) - { 5, "tdmat", "tdmat", "TDMA slot update set TSF" }, + { 6, "tdmat", "tdmat", "TDMA slot update set TSF" }, #define S_TDMA_TSFADJ AFTER(S_TDMA_TSF) - { 8, "tdmadj", "tdmadj", "TDMA slot adjust (usecs, smoothed)" }, + { 6, "tdmadj", "tdmadj", "TDMA slot adjust (usecs, smoothed)" }, #define S_TDMA_ACK AFTER(S_TDMA_TSFADJ) { 5, "tdmack", "tdmack", "TDMA tx failed 'cuz ACK required" }, #define S_RATE_CALLS AFTER(S_TDMA_ACK) @@ -306,9 +307,9 @@ static const struct fmt athstats[] = { #define S_ANI_STEPDOWN AFTER(S_ANI_STEPUP) { 5, "step-","STEP-", "ANI decreased first step level" }, #define S_ANI_OFDMERRS AFTER(S_ANI_STEPDOWN) - { 8, "ofdm", "OFDM", "cumulative OFDM phy error count" }, + { 7, "ofdm", "OFDM", "cumulative OFDM phy error count" }, #define S_ANI_CCKERRS AFTER(S_ANI_OFDMERRS) - { 8, "cck", "CCK", "cumulative CCK phy error count" }, + { 7, "cck", "CCK", "cumulative CCK phy error count" }, #define S_ANI_RESET AFTER(S_ANI_CCKERRS) { 5, "reset","RESET", "ANI parameters zero'd for non-STA operation" }, #define S_ANI_LZERO AFTER(S_ANI_RESET) @@ -316,15 +317,15 @@ static const struct fmt athstats[] = { #define S_ANI_LNEG AFTER(S_ANI_LZERO) { 5, "lneg", "LNEG", "ANI calculated listen time < 0" }, #define S_MIB_ACKBAD AFTER(S_ANI_LNEG) - { 5, "ackbad","ACKBAD", "missing ACK's" }, + { 7, "ackbad","ACKBAD", "missing ACK's" }, #define S_MIB_RTSBAD AFTER(S_MIB_ACKBAD) - { 5, "rtsbad","RTSBAD", "RTS without CTS" }, + { 7, "rtsbad","RTSBAD", "RTS without CTS" }, #define S_MIB_RTSGOOD AFTER(S_MIB_RTSBAD) - { 5, "rtsgood","RTSGOOD", "successful RTS" }, + { 7, "rtsgood","RTSGOOD", "successful RTS" }, #define S_MIB_FCSBAD AFTER(S_MIB_RTSGOOD) - { 5, "fcsbad","FCSBAD", "bad FCS" }, + { 7, "fcsbad","FCSBAD", "bad FCS" }, #define S_MIB_BEACONS AFTER(S_MIB_FCSBAD) - { 5, "beacons","beacons", "beacons received" }, + { 7, "beacons","beacons", "beacons received" }, #define S_NODE_AVGBRSSI AFTER(S_MIB_BEACONS) { 3, "avgbrssi","BSI", "average rssi (beacons only)" }, #define S_NODE_AVGRSSI AFTER(S_NODE_AVGBRSSI) @@ -335,37 +336,37 @@ static const struct fmt athstats[] = { #else #define S_ANT_TX0 AFTER(S_ANT_TXSWITCH) #endif /* ATH_SUPPORT_ANI */ - { 8, "tx0", "ant0(tx)", "frames tx on antenna 0" }, + { 7, "tx0", "ant0(tx)", "frames tx on antenna 0" }, #define S_ANT_TX1 AFTER(S_ANT_TX0) - { 8, "tx1", "ant1(tx)", "frames tx on antenna 1" }, + { 7, "tx1", "ant1(tx)", "frames tx on antenna 1" }, #define S_ANT_TX2 AFTER(S_ANT_TX1) - { 8, "tx2", "ant2(tx)", "frames tx on antenna 2" }, + { 7, "tx2", "ant2(tx)", "frames tx on antenna 2" }, #define S_ANT_TX3 AFTER(S_ANT_TX2) - { 8, "tx3", "ant3(tx)", "frames tx on antenna 3" }, + { 7, "tx3", "ant3(tx)", "frames tx on antenna 3" }, #define S_ANT_TX4 AFTER(S_ANT_TX3) - { 8, "tx4", "ant4(tx)", "frames tx on antenna 4" }, + { 7, "tx4", "ant4(tx)", "frames tx on antenna 4" }, #define S_ANT_TX5 AFTER(S_ANT_TX4) - { 8, "tx5", "ant5(tx)", "frames tx on antenna 5" }, + { 7, "tx5", "ant5(tx)", "frames tx on antenna 5" }, #define S_ANT_TX6 AFTER(S_ANT_TX5) - { 8, "tx6", "ant6(tx)", "frames tx on antenna 6" }, + { 7, "tx6", "ant6(tx)", "frames tx on antenna 6" }, #define S_ANT_TX7 AFTER(S_ANT_TX6) - { 8, "tx7", "ant7(tx)", "frames tx on antenna 7" }, + { 7, "tx7", "ant7(tx)", "frames tx on antenna 7" }, #define S_ANT_RX0 AFTER(S_ANT_TX7) - { 8, "rx0", "ant0(rx)", "frames rx on antenna 0" }, + { 7, "rx0", "ant0(rx)", "frames rx on antenna 0" }, #define S_ANT_RX1 AFTER(S_ANT_RX0) - { 8, "rx1", "ant1(rx)", "frames rx on antenna 1" }, + { 7, "rx1", "ant1(rx)", "frames rx on antenna 1" }, #define S_ANT_RX2 AFTER(S_ANT_RX1) - { 8, "rx2", "ant2(rx)", "frames rx on antenna 2" }, + { 7, "rx2", "ant2(rx)", "frames rx on antenna 2" }, #define S_ANT_RX3 AFTER(S_ANT_RX2) - { 8, "rx3", "ant3(rx)", "frames rx on antenna 3" }, + { 7, "rx3", "ant3(rx)", "frames rx on antenna 3" }, #define S_ANT_RX4 AFTER(S_ANT_RX3) - { 8, "rx4", "ant4(rx)", "frames rx on antenna 4" }, + { 7, "rx4", "ant4(rx)", "frames rx on antenna 4" }, #define S_ANT_RX5 AFTER(S_ANT_RX4) - { 8, "rx5", "ant5(rx)", "frames rx on antenna 5" }, + { 7, "rx5", "ant5(rx)", "frames rx on antenna 5" }, #define S_ANT_RX6 AFTER(S_ANT_RX5) - { 8, "rx6", "ant6(rx)", "frames rx on antenna 6" }, + { 7, "rx6", "ant6(rx)", "frames rx on antenna 6" }, #define S_ANT_RX7 AFTER(S_ANT_RX6) - { 8, "rx7", "ant7(rx)", "frames rx on antenna 7" }, + { 7, "rx7", "ant7(rx)", "frames rx on antenna 7" }, #define S_TX_SIGNAL AFTER(S_ANT_RX7) { 4, "asignal", "asig", "signal of last ack (dBm)" }, #define S_RX_SIGNAL AFTER(S_TX_SIGNAL) @@ -710,32 +711,38 @@ ath_get_curstat(struct statfoo *sf, int #undef STAT } +int +hnprintf(char *b, size_t bs, const char *fmt, int64_t v) +{ + humanize_number(b, bs, v, "", HN_AUTOSCALE, HN_NOSPACE); +} + static int ath_get_totstat(struct statfoo *sf, int s, char b[], size_t bs) { struct athstatfoo_p *wf = (struct athstatfoo_p *) sf; #define STAT(x) \ - snprintf(b, bs, "%u", wf->total.ath.ast_##x); return 1 + hnprintf(b, bs, "%u", (int64_t) wf->total.ath.ast_##x); return 1 #define PHY(x) \ - snprintf(b, bs, "%u", wf->total.ath.ast_rx_phy[x]); return 1 + hnprintf(b, bs, "%u", (int64_t) wf->total.ath.ast_rx_phy[x]); return 1 #define ANI(x) \ - snprintf(b, bs, "%u", wf->total.ani_state.x); return 1 + hnprintf(b, bs, "%u", (int64_t) wf->total.ani_state.x); return 1 #define ANISTAT(x) \ - snprintf(b, bs, "%u", wf->total.ani_stats.ast_ani_##x); return 1 + hnprintf(b, bs, "%u", (int64_t) wf->total.ani_stats.ast_ani_##x); return 1 #define MIBSTAT(x) \ - snprintf(b, bs, "%u", wf->total.ani_stats.ast_mibstats.x); return 1 + hnprintf(b, bs, "%u", (int64_t) wf->total.ani_stats.ast_mibstats.x); return 1 #define TXANT(x) \ - snprintf(b, bs, "%u", wf->total.ath.ast_ant_tx[x]); return 1 + hnprintf(b, bs, "%u", (int64_t) wf->total.ath.ast_ant_tx[x]); return 1 #define RXANT(x) \ - snprintf(b, bs, "%u", wf->total.ath.ast_ant_rx[x]); return 1 + hnprintf(b, bs, "%u", (int64_t) wf->total.ath.ast_ant_rx[x]); return 1 switch (s) { case S_INPUT: - snprintf(b, bs, "%lu", + hnprintf(b, bs, "%lu", wf->total.ath.ast_rx_packets - wf->total.ath.ast_rx_mgt); return 1; case S_OUTPUT: - snprintf(b, bs, "%lu", wf->total.ath.ast_tx_packets); + hnprintf(b, bs, "%lu", wf->total.ath.ast_tx_packets); return 1; case S_RATE: snprintrate(b, bs, wf->total.ath.ast_tx_rate); Modified: head/tools/tools/ath/athstats/statfoo.c ============================================================================== --- head/tools/tools/ath/athstats/statfoo.c Sun Feb 8 20:00:36 2009 (r188326) +++ head/tools/tools/ath/athstats/statfoo.c Sun Feb 8 20:02:58 2009 (r188327) @@ -109,7 +109,7 @@ statfoo_print_current(struct statfoo *sf for (cp = sf->fmts; *cp != '\0'; cp++) { if (*cp & 0x80) { const struct fmt *f = &sf->stats[*cp &~ 0x80]; - if (sf->get_curstat(sf, *cp &~ 0x80, buf, sizeof(buf))) + if (sf->get_curstat(sf, *cp &~ 0x80, buf, f->width)) fprintf(fd, "%*s", f->width, buf); } else putc(*cp, fd); @@ -126,7 +126,7 @@ statfoo_print_total(struct statfoo *sf, for (cp = sf->fmts; *cp != '\0'; cp++) { if (*cp & 0x80) { const struct fmt *f = &sf->stats[*cp &~ 0x80]; - if (sf->get_totstat(sf, *cp &~ 0x80, buf, sizeof(buf))) + if (sf->get_totstat(sf, *cp &~ 0x80, buf, f->width)) fprintf(fd, "%*s", f->width, buf); } else putc(*cp, fd); From owner-svn-src-head@FreeBSD.ORG Sun Feb 8 20:15:09 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 057661065673; Sun, 8 Feb 2009 20:15:09 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E793F8FC1A; Sun, 8 Feb 2009 20:15:08 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n18KF8eR033178; Sun, 8 Feb 2009 20:15:08 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n18KF8WA033177; Sun, 8 Feb 2009 20:15:08 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200902082015.n18KF8WA033177@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 8 Feb 2009 20:15:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188329 - head/sys/geom/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Feb 2009 20:15:09 -0000 Author: marcel Date: Sun Feb 8 20:15:08 2009 New Revision: 188329 URL: http://svn.freebsd.org/changeset/base/188329 Log: o Add the "PART::scheme" attribute that returns the name of the underlying partitioning scheme. o Put the start and end of the partition in the XML configuration. The start and end are the LBAs of the first and last sector (resp.) of the partition. They are currently identical to the offset and size attributes, which describe the partition as an offset and size in bytes, but may not in the future. The start and end will be used for the logical partition boundaries and may include metadata. The offset and size will always represent the useful storage space within the partition. Typically these two notions are the same, but for logical partitions in an extended partition, the EBR is more naturally treated as being part of the partition. Modified: head/sys/geom/part/g_part.c Modified: head/sys/geom/part/g_part.c ============================================================================== --- head/sys/geom/part/g_part.c Sun Feb 8 20:07:50 2009 (r188328) +++ head/sys/geom/part/g_part.c Sun Feb 8 20:15:08 2009 (r188329) @@ -1579,6 +1579,10 @@ g_part_dumpconf(struct sbuf *sb, const c entry = pp->private; if (entry == NULL) return; + sbuf_printf(sb, "%s%ju\n", indent, + (uintmax_t)entry->gpe_start); + sbuf_printf(sb, "%s%ju\n", indent, + (uintmax_t)entry->gpe_end); sbuf_printf(sb, "%s%u\n", indent, entry->gpe_index); sbuf_printf(sb, "%s%s\n", indent, @@ -1687,6 +1691,9 @@ g_part_start(struct bio *bp) if (g_handleattr_int(bp, "PART::offset", table->gpt_offset + entry->gpe_start)) return; + if (g_handleattr_str(bp, "PART::scheme", + table->gpt_scheme->name)) + return; if (!strcmp("GEOM::kerneldump", bp->bio_attribute)) { /* * Check that the partition is suitable for kernel From owner-svn-src-head@FreeBSD.ORG Sun Feb 8 20:19:19 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7241C1065672; Sun, 8 Feb 2009 20:19:19 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 556F48FC1A; Sun, 8 Feb 2009 20:19:19 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n18KJJN2033281; Sun, 8 Feb 2009 20:19:19 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n18KJJFk033280; Sun, 8 Feb 2009 20:19:19 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200902082019.n18KJJFk033280@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 8 Feb 2009 20:19:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188330 - head/sbin/geom/class/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Feb 2009 20:19:20 -0000 Author: marcel Date: Sun Feb 8 20:19:19 2009 New Revision: 188330 URL: http://svn.freebsd.org/changeset/base/188330 Log: Prefer the start and end attributes over the offset and size attributes. The start and end more accurately describe the space taken by a partition. The offset and size are used to describe the effective (usable) storage of that partition. Modified: head/sbin/geom/class/part/geom_part.c Modified: head/sbin/geom/class/part/geom_part.c ============================================================================== --- head/sbin/geom/class/part/geom_part.c Sun Feb 8 20:15:08 2009 (r188329) +++ head/sbin/geom/class/part/geom_part.c Sun Feb 8 20:19:19 2009 (r188330) @@ -187,17 +187,23 @@ static struct gprovider * find_provider(struct ggeom *gp, unsigned long long minsector) { struct gprovider *pp, *bestpp; - unsigned long long offset; + const char *s; unsigned long long sector, bestsector; bestpp = NULL; LIST_FOREACH(pp, &gp->lg_provider, lg_provider) { - offset = atoll(find_provcfg(pp, "offset")); - sector = offset / pp->lg_sectorsize; + s = find_provcfg(pp, "start"); + if (s == NULL) { + s = find_provcfg(pp, "offset"); + sector = atoll(s) / pp->lg_sectorsize; + } else + sector = atoll(s); + if (sector < minsector) continue; if (bestpp != NULL && sector >= bestsector) continue; + bestpp = pp; bestsector = sector; } @@ -240,7 +246,7 @@ gpart_show_geom(struct ggeom *gp, const struct gprovider *pp; const char *s, *scheme; unsigned long long first, last, sector, end; - unsigned long long offset, length, secsz; + unsigned long long length, secsz; int idx, wblocks, wname; scheme = find_geomcfg(gp, "scheme"); @@ -258,14 +264,24 @@ gpart_show_geom(struct ggeom *gp, const scheme, fmtsize(pp->lg_mediasize)); while ((pp = find_provider(gp, first)) != NULL) { - s = find_provcfg(pp, "offset"); - offset = atoll(s); - sector = offset / secsz; - s = find_provcfg(pp, "length"); - length = atoll(s); + s = find_provcfg(pp, "start"); + if (s == NULL) { + s = find_provcfg(pp, "offset"); + sector = atoll(s) / secsz; + } else + sector = atoll(s); + + s = find_provcfg(pp, "end"); + if (s == NULL) { + s = find_provcfg(pp, "length"); + length = atoll(s) / secsz; + end = sector + length - 1; + } else { + end = atoll(s); + length = end - sector + 1; + } s = find_provcfg(pp, "index"); idx = atoi(s); - end = sector + length / secsz; if (first < sector) { printf(" %*llu %*llu %*s - free - (%s)\n", wblocks, first, wblocks, sector - first, @@ -273,16 +289,17 @@ gpart_show_geom(struct ggeom *gp, const fmtsize((sector - first) * secsz)); } printf(" %*llu %*llu %*d %s %s (%s)\n", - wblocks, sector, wblocks, end - sector, + wblocks, sector, wblocks, length, wname, idx, find_provcfg(pp, element), fmtattrib(pp), fmtsize(pp->lg_mediasize)); - first = end; + first = end + 1; } if (first <= last) { + length = last - first + 1; printf(" %*llu %*llu %*s - free - (%s)\n", - wblocks, first, wblocks, last - first + 1, + wblocks, first, wblocks, length, wname, "", - fmtsize((last - first + 1) * secsz)); + fmtsize(length * secsz)); } printf("\n"); } From owner-svn-src-head@FreeBSD.ORG Sun Feb 8 20:23:46 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C23A1065676; Sun, 8 Feb 2009 20:23:46 +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 5C6988FC08; Sun, 8 Feb 2009 20:23:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n18KNkEp033405; Sun, 8 Feb 2009 20:23:46 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n18KNkdV033402; Sun, 8 Feb 2009 20:23:46 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200902082023.n18KNkdV033402@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 8 Feb 2009 20:23:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188331 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Feb 2009 20:23:54 -0000 Author: kib Date: Sun Feb 8 20:23:46 2009 New Revision: 188331 URL: http://svn.freebsd.org/changeset/base/188331 Log: Do not sleep for vnode lock while holding map lock in vm_fault. Try to acquire vnode lock for OBJT_VNODE object after map lock is dropped. Because we have the busy page(s) in the object, sleeping there would result in deadlock with vnode resize. Try to get lock without sleeping, and, if the attempt failed, drop the state, lock the vnode, and restart the fault handler from the start with already locked vnode. Because the vnode_pager_lock() function is inlined in vm_fault(), axe it. Based on suggestion by: alc Reviewed by: tegge, alc Tested by: pho Modified: head/sys/vm/vm_fault.c head/sys/vm/vnode_pager.c head/sys/vm/vnode_pager.h Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Sun Feb 8 20:19:19 2009 (r188330) +++ head/sys/vm/vm_fault.c Sun Feb 8 20:23:46 2009 (r188331) @@ -130,6 +130,7 @@ struct faultstate { vm_map_entry_t entry; int lookup_still_valid; struct vnode *vp; + int vfslocked; }; static inline void @@ -171,13 +172,11 @@ unlock_and_deallocate(struct faultstate vm_object_deallocate(fs->first_object); unlock_map(fs); if (fs->vp != NULL) { - int vfslocked; - - vfslocked = VFS_LOCK_GIANT(fs->vp->v_mount); vput(fs->vp); fs->vp = NULL; - VFS_UNLOCK_GIANT(vfslocked); } + VFS_UNLOCK_GIANT(fs->vfslocked); + fs->vfslocked = 0; } /* @@ -218,12 +217,17 @@ vm_fault(vm_map_t map, vm_offset_t vaddr vm_object_t next_object; vm_page_t marray[VM_FAULT_READ]; int hardfault; - int faultcount; + int faultcount, ahead, behind; struct faultstate fs; + struct vnode *vp; + int locked, error; hardfault = 0; growstack = TRUE; PCPU_INC(cnt.v_vm_faults); + fs.vp = NULL; + fs.vfslocked = 0; + faultcount = behind = 0; RetryFault:; @@ -289,21 +293,9 @@ RetryFault:; * Bump the paging-in-progress count to prevent size changes (e.g. * truncation operations) during I/O. This must be done after * obtaining the vnode lock in order to avoid possible deadlocks. - * - * XXX vnode_pager_lock() can block without releasing the map lock. */ - if (fs.first_object->flags & OBJ_NEEDGIANT) - mtx_lock(&Giant); VM_OBJECT_LOCK(fs.first_object); vm_object_reference_locked(fs.first_object); - fs.vp = vnode_pager_lock(fs.first_object); - KASSERT(fs.vp == NULL || !fs.map->system_map, - ("vm_fault: vnode-backed object mapped by system map")); - KASSERT((fs.first_object->flags & OBJ_NEEDGIANT) == 0 || - !fs.map->system_map, - ("vm_fault: Object requiring giant mapped by system map")); - if (fs.first_object->flags & OBJ_NEEDGIANT) - mtx_unlock(&Giant); vm_object_pip_add(fs.first_object, 1); fs.lookup_still_valid = TRUE; @@ -380,14 +372,6 @@ RetryFault:; fs.first_m = NULL; } unlock_map(&fs); - if (fs.vp != NULL) { - int vfslck; - - vfslck = VFS_LOCK_GIANT(fs.vp->v_mount); - vput(fs.vp); - fs.vp = NULL; - VFS_UNLOCK_GIANT(vfslck); - } VM_OBJECT_LOCK(fs.object); if (fs.m == vm_page_lookup(fs.object, fs.pindex)) { @@ -441,7 +425,9 @@ RetryFault:; } #endif fs.m = vm_page_alloc(fs.object, fs.pindex, - (fs.vp || fs.object->backing_object)? VM_ALLOC_NORMAL: VM_ALLOC_ZERO); + (fs.object->type == OBJT_VNODE || + fs.object->backing_object != NULL) ? + VM_ALLOC_NORMAL : VM_ALLOC_ZERO); } if (fs.m == NULL) { unlock_and_deallocate(&fs); @@ -464,7 +450,6 @@ readrest: if (TRYPAGER) { int rv; int reqpage = 0; - int ahead, behind; u_char behavior = vm_map_entry_behavior(fs.entry); if (behavior == MAP_ENTRY_BEHAV_RANDOM) { @@ -527,6 +512,65 @@ readrest: } if (is_first_object_locked) VM_OBJECT_UNLOCK(fs.first_object); + + /* + * Call the pager to retrieve the data, if any, after + * releasing the lock on the map. We hold a ref on + * fs.object and the pages are VPO_BUSY'd. + */ + unlock_map(&fs); + +vnode_lock: + if (fs.object->type == OBJT_VNODE) { + vp = fs.object->handle; + if (vp == fs.vp) + goto vnode_locked; + else if (fs.vp != NULL) { + vput(fs.vp); + fs.vp = NULL; + } + locked = VOP_ISLOCKED(vp); + + if (VFS_NEEDSGIANT(vp->v_mount) && !fs.vfslocked) { + fs.vfslocked = 1; + if (!mtx_trylock(&Giant)) { + VM_OBJECT_UNLOCK(fs.object); + mtx_lock(&Giant); + VM_OBJECT_LOCK(fs.object); + goto vnode_lock; + } + } + if (locked != LK_EXCLUSIVE) + locked = LK_SHARED; + /* Do not sleep for vnode lock while fs.m is busy */ + error = vget(vp, locked | LK_CANRECURSE | + LK_NOWAIT, curthread); + if (error != 0) { + int vfslocked; + + vfslocked = fs.vfslocked; + fs.vfslocked = 0; /* Keep Giant */ + vhold(vp); + release_page(&fs); + unlock_and_deallocate(&fs); + error = vget(vp, locked | LK_RETRY | + LK_CANRECURSE, curthread); + vdrop(vp); + fs.vp = vp; + fs.vfslocked = vfslocked; + KASSERT(error == 0, + ("vm_fault: vget failed")); + goto RetryFault; + } + fs.vp = vp; + } +vnode_locked: + KASSERT(fs.vp == NULL || !fs.map->system_map, + ("vm_fault: vnode-backed object mapped by system map")); + KASSERT((fs.first_object->flags & OBJ_NEEDGIANT) == 0 || + !fs.map->system_map, + ("vm_fault: Object requiring giant mapped by system map")); + /* * now we find out if any other pages should be paged * in at this time this routine checks to see if the @@ -547,22 +591,6 @@ readrest: faultcount = vm_fault_additional_pages( fs.m, behind, ahead, marray, &reqpage); - /* - * update lastr imperfectly (we do not know how much - * getpages will actually read), but good enough. - * - * XXX The following assignment modifies the map - * without holding a write lock on it. - */ - fs.entry->lastr = fs.pindex + faultcount - behind; - - /* - * Call the pager to retrieve the data, if any, after - * releasing the lock on the map. We hold a ref on - * fs.object and the pages are VPO_BUSY'd. - */ - unlock_map(&fs); - rv = faultcount ? vm_pager_get_pages(fs.object, marray, faultcount, reqpage) : VM_PAGER_FAIL; @@ -839,6 +867,15 @@ readrest: prot &= retry_prot; } } + /* + * update lastr imperfectly (we do not know how much + * getpages will actually read), but good enough. + * + * XXX The following assignment modifies the map + * without holding a write lock on it. + */ + fs.entry->lastr = fs.pindex + faultcount - behind; + if (prot & VM_PROT_WRITE) { vm_object_set_writeable_dirty(fs.object); Modified: head/sys/vm/vnode_pager.c ============================================================================== --- head/sys/vm/vnode_pager.c Sun Feb 8 20:19:19 2009 (r188330) +++ head/sys/vm/vnode_pager.c Sun Feb 8 20:23:46 2009 (r188331) @@ -1174,56 +1174,3 @@ vnode_pager_generic_putpages(vp, m, byte } return rtvals[0]; } - -struct vnode * -vnode_pager_lock(vm_object_t first_object) -{ - struct vnode *vp; - vm_object_t backing_object, object; - int locked, lockf; - - VM_OBJECT_LOCK_ASSERT(first_object, MA_OWNED); - for (object = first_object; object != NULL; object = backing_object) { - if (object->type != OBJT_VNODE) { - if ((backing_object = object->backing_object) != NULL) - VM_OBJECT_LOCK(backing_object); - if (object != first_object) - VM_OBJECT_UNLOCK(object); - continue; - } - retry: - if (object->flags & OBJ_DEAD) { - if (object != first_object) - VM_OBJECT_UNLOCK(object); - return NULL; - } - vp = object->handle; - locked = VOP_ISLOCKED(vp); - VI_LOCK(vp); - VM_OBJECT_UNLOCK(object); - if (first_object != object) - VM_OBJECT_UNLOCK(first_object); - VFS_ASSERT_GIANT(vp->v_mount); - if (locked == LK_EXCLUSIVE) - lockf = LK_CANRECURSE | LK_INTERLOCK | LK_RETRY | - LK_EXCLUSIVE; - else - lockf = LK_CANRECURSE | LK_INTERLOCK | LK_RETRY | - LK_SHARED; - if (vget(vp, lockf, curthread)) { - VM_OBJECT_LOCK(first_object); - if (object != first_object) - VM_OBJECT_LOCK(object); - if (object->type != OBJT_VNODE) { - if (object != first_object) - VM_OBJECT_UNLOCK(object); - return NULL; - } - printf("vnode_pager_lock: retrying\n"); - goto retry; - } - VM_OBJECT_LOCK(first_object); - return (vp); - } - return NULL; -} Modified: head/sys/vm/vnode_pager.h ============================================================================== --- head/sys/vm/vnode_pager.h Sun Feb 8 20:19:19 2009 (r188330) +++ head/sys/vm/vnode_pager.h Sun Feb 8 20:23:46 2009 (r188331) @@ -39,7 +39,6 @@ #define _VNODE_PAGER_ 1 #ifdef _KERNEL -struct vnode *vnode_pager_lock(vm_object_t); /* * XXX Generic routines; currently called by badly written FS code; these From owner-svn-src-head@FreeBSD.ORG Sun Feb 8 20:29:38 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 356121065689; Sun, 8 Feb 2009 20:29:38 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CAF808FC13; Sun, 8 Feb 2009 20:29:37 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n18KTbDi033596; Sun, 8 Feb 2009 20:29:37 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n18KTbWP033595; Sun, 8 Feb 2009 20:29:37 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902082029.n18KTbWP033595@svn.freebsd.org> From: Sam Leffler Date: Sun, 8 Feb 2009 20:29:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188332 - head/sys/dev/cfi X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Feb 2009 20:29:39 -0000 Author: sam Date: Sun Feb 8 20:29:37 2009 New Revision: 188332 URL: http://svn.freebsd.org/changeset/base/188332 Log: fix typo Submitted by: Christoph Mallon Modified: head/sys/dev/cfi/cfi_core.c Modified: head/sys/dev/cfi/cfi_core.c ============================================================================== --- head/sys/dev/cfi/cfi_core.c Sun Feb 8 20:23:46 2009 (r188331) +++ head/sys/dev/cfi/cfi_core.c Sun Feb 8 20:29:37 2009 (r188332) @@ -439,7 +439,7 @@ cfi_write_block(struct cfi_softc *sc) * at the factory with a unique 64-bit number which is immutable. * The other segment is left blank for User (OEM) programming. * The User/OEM segment is One Time Programmable (OTP). It can also - * be locked to prevent any firther writes by setting bit 0 of the + * be locked to prevent any further writes by setting bit 0 of the * Protection Lock Register (PLR). The PLR can written only once. */ From owner-svn-src-head@FreeBSD.ORG Sun Feb 8 20:30:52 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE9311065748; Sun, 8 Feb 2009 20:30:51 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DAAD08FC24; Sun, 8 Feb 2009 20:30:51 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n18KUphl033656; Sun, 8 Feb 2009 20:30:51 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n18KUpj1033655; Sun, 8 Feb 2009 20:30:51 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200902082030.n18KUpj1033655@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 8 Feb 2009 20:30:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188333 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Feb 2009 20:30:54 -0000 Author: kib Date: Sun Feb 8 20:30:51 2009 New Revision: 188333 URL: http://svn.freebsd.org/changeset/base/188333 Log: In vm_map_sync(), do not call vm_object_sync() while holding map lock. Reference object, drop the map lock, and then call vm_object_sync(). The object sync might require vnode lock for OBJT_VNODE type objects. Reviewed by: tegge Tested by: pho Modified: head/sys/vm/vm_map.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Sun Feb 8 20:29:37 2009 (r188332) +++ head/sys/vm/vm_map.c Sun Feb 8 20:30:51 2009 (r188333) @@ -2304,6 +2304,7 @@ vm_map_sync( vm_size_t size; vm_object_t object; vm_ooffset_t offset; + unsigned int last_timestamp; vm_map_lock_read(map); VM_MAP_RANGE_CHECK(map, start, end); @@ -2338,8 +2339,7 @@ vm_map_sync( * Make a second pass, cleaning/uncaching pages from the indicated * objects as we go. */ - for (current = entry; current != &map->header && current->start < end; - current = current->next) { + for (current = entry; current != &map->header && current->start < end;) { offset = current->offset + (start - current->start); size = (end <= current->end ? end : current->end) - start; if (current->eflags & MAP_ENTRY_IS_SUB_MAP) { @@ -2359,8 +2359,16 @@ vm_map_sync( } else { object = current->object.vm_object; } + vm_object_reference(object); + last_timestamp = map->timestamp; + vm_map_unlock_read(map); vm_object_sync(object, offset, size, syncio, invalidate); start += size; + vm_object_deallocate(object); + vm_map_lock_read(map); + if (last_timestamp == map->timestamp || + !vm_map_lookup_entry(map, start, ¤t)) + current = current->next; } vm_map_unlock_read(map); From owner-svn-src-head@FreeBSD.ORG Sun Feb 8 20:39:18 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 74FAA1065670; Sun, 8 Feb 2009 20:39:18 +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 626728FC08; Sun, 8 Feb 2009 20:39:18 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n18KdIol033855; Sun, 8 Feb 2009 20:39:18 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n18KdIZS033850; Sun, 8 Feb 2009 20:39:18 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200902082039.n18KdIZS033850@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 8 Feb 2009 20:39:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188334 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Feb 2009 20:39:19 -0000 Author: kib Date: Sun Feb 8 20:39:17 2009 New Revision: 188334 URL: http://svn.freebsd.org/changeset/base/188334 Log: Do not call vm_object_deallocate() from vm_map_delete(), because we hold the map lock there, and might need the vnode lock for OBJT_VNODE objects. Postpone object deallocation until caller of vm_map_delete() drops the map lock. Link the map entries to be freed into the freelist, that is released by the new helper function vm_map_entry_free_freelist(). Reviewed by: tegge, alc Tested by: pho Modified: head/sys/vm/vm_kern.c head/sys/vm/vm_map.c head/sys/vm/vm_map.h head/sys/vm/vm_mmap.c head/sys/vm/vm_unix.c Modified: head/sys/vm/vm_kern.c ============================================================================== --- head/sys/vm/vm_kern.c Sun Feb 8 20:30:51 2009 (r188333) +++ head/sys/vm/vm_kern.c Sun Feb 8 20:39:17 2009 (r188334) @@ -271,7 +271,7 @@ kmem_malloc(map, size, flags) int flags; { vm_offset_t offset, i; - vm_map_entry_t entry; + vm_map_entry_t entry, freelist; vm_offset_t addr; vm_page_t m; int pflags; @@ -355,8 +355,10 @@ retry: vm_page_unlock_queues(); } VM_OBJECT_UNLOCK(kmem_object); - vm_map_delete(map, addr, addr + size); + freelist = NULL; + vm_map_delete(map, addr, addr + size, &freelist); vm_map_unlock(map); + vm_map_entry_free_freelist(map, freelist); return (0); } if (flags & M_ZERO && (m->flags & PG_ZERO) == 0) @@ -455,14 +457,18 @@ kmem_free_wakeup(map, addr, size) vm_offset_t addr; vm_size_t size; { + vm_map_entry_t freelist; + freelist = NULL; vm_map_lock(map); - (void) vm_map_delete(map, trunc_page(addr), round_page(addr + size)); + (void) vm_map_delete(map, trunc_page(addr), round_page(addr + size), + &freelist); if (map->needs_wakeup) { map->needs_wakeup = FALSE; vm_map_wakeup(map); } vm_map_unlock(map); + vm_map_entry_free_freelist(map, freelist); } /* Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Sun Feb 8 20:30:51 2009 (r188333) +++ head/sys/vm/vm_map.c Sun Feb 8 20:39:17 2009 (r188334) @@ -1261,16 +1261,19 @@ vm_map_fixed(vm_map_t map, vm_object_t o vm_offset_t start, vm_size_t length, vm_prot_t prot, vm_prot_t max, int cow) { + vm_map_entry_t freelist; vm_offset_t end; int result; - vm_map_lock(map); end = start + length; + freelist = NULL; + vm_map_lock(map); VM_MAP_RANGE_CHECK(map, start, end); - (void) vm_map_delete(map, start, end); + (void) vm_map_delete(map, start, end, &freelist); result = vm_map_insert(map, object, offset, start, end, prot, max, cow); vm_map_unlock(map); + vm_map_entry_free_freelist(map, freelist); return (result); } @@ -2392,6 +2395,23 @@ vm_map_entry_unwire(vm_map_t map, vm_map entry->wired_count = 0; } +void +vm_map_entry_free_freelist(vm_map_t map, vm_map_entry_t freelist) +{ + vm_map_entry_t e; + vm_object_t object; + + while (freelist != NULL) { + e = freelist; + freelist = freelist->next; + if ((e->eflags & MAP_ENTRY_IS_SUB_MAP) == 0) { + object = e->object.vm_object; + vm_object_deallocate(object); + } + vm_map_entry_dispose(map, e); + } +} + /* * vm_map_entry_delete: [ internal use only ] * @@ -2424,10 +2444,8 @@ vm_map_entry_delete(vm_map_t map, vm_map object->size = offidxstart; } VM_OBJECT_UNLOCK(object); - vm_object_deallocate(object); - } - - vm_map_entry_dispose(map, entry); + } else + entry->object.vm_object = NULL; } /* @@ -2437,7 +2455,8 @@ vm_map_entry_delete(vm_map_t map, vm_map * map. */ int -vm_map_delete(vm_map_t map, vm_offset_t start, vm_offset_t end) +vm_map_delete(vm_map_t map, vm_offset_t start, vm_offset_t end, + vm_map_entry_t *freelist) { vm_map_entry_t entry; vm_map_entry_t first_entry; @@ -2514,6 +2533,8 @@ vm_map_delete(vm_map_t map, vm_offset_t * modify bits will be set in the wrong object!) */ vm_map_entry_delete(map, entry); + entry->next = *freelist; + *freelist = entry; entry = next; } return (KERN_SUCCESS); @@ -2528,12 +2549,15 @@ vm_map_delete(vm_map_t map, vm_offset_t int vm_map_remove(vm_map_t map, vm_offset_t start, vm_offset_t end) { + vm_map_entry_t freelist; int result; + freelist = NULL; vm_map_lock(map); VM_MAP_RANGE_CHECK(map, start, end); - result = vm_map_delete(map, start, end); + result = vm_map_delete(map, start, end, &freelist); vm_map_unlock(map); + vm_map_entry_free_freelist(map, freelist); return (result); } Modified: head/sys/vm/vm_map.h ============================================================================== --- head/sys/vm/vm_map.h Sun Feb 8 20:30:51 2009 (r188333) +++ head/sys/vm/vm_map.h Sun Feb 8 20:39:17 2009 (r188334) @@ -157,6 +157,8 @@ vm_map_entry_system_wired_count(vm_map_e { return (entry->wired_count - vm_map_entry_user_wired_count(entry)); } + +void vm_map_entry_free_freelist(vm_map_t map, vm_map_entry_t freelist); #endif /* _KERNEL */ /* @@ -336,7 +338,7 @@ long vmspace_wired_count(struct vmspace #ifdef _KERNEL boolean_t vm_map_check_protection (vm_map_t, vm_offset_t, vm_offset_t, vm_prot_t); vm_map_t vm_map_create(pmap_t, vm_offset_t, vm_offset_t); -int vm_map_delete (vm_map_t, vm_offset_t, vm_offset_t); +int vm_map_delete(vm_map_t, vm_offset_t, vm_offset_t, vm_map_entry_t *); int vm_map_find(vm_map_t, vm_object_t, vm_ooffset_t, vm_offset_t *, vm_size_t, int, vm_prot_t, vm_prot_t, int); int vm_map_fixed(vm_map_t, vm_object_t, vm_ooffset_t, vm_offset_t, vm_size_t, Modified: head/sys/vm/vm_mmap.c ============================================================================== --- head/sys/vm/vm_mmap.c Sun Feb 8 20:30:51 2009 (r188333) +++ head/sys/vm/vm_mmap.c Sun Feb 8 20:39:17 2009 (r188334) @@ -552,6 +552,7 @@ munmap(td, uap) vm_offset_t addr; vm_size_t size, pageoff; vm_map_t map; + vm_map_entry_t freelist; addr = (vm_offset_t) uap->addr; size = uap->len; @@ -571,6 +572,7 @@ munmap(td, uap) map = &td->td_proc->p_vmspace->vm_map; if (addr < vm_map_min(map) || addr + size > vm_map_max(map)) return (EINVAL); + freelist = NULL; vm_map_lock(map); #ifdef HWPMC_HOOKS /* @@ -593,8 +595,9 @@ munmap(td, uap) } #endif /* returns nothing but KERN_SUCCESS anyway */ - vm_map_delete(map, addr, addr + size); + vm_map_delete(map, addr, addr + size, &freelist); vm_map_unlock(map); + vm_map_entry_free_freelist(map, freelist); return (0); } Modified: head/sys/vm/vm_unix.c ============================================================================== --- head/sys/vm/vm_unix.c Sun Feb 8 20:30:51 2009 (r188333) +++ head/sys/vm/vm_unix.c Sun Feb 8 20:39:17 2009 (r188334) @@ -72,6 +72,7 @@ obreak(td, uap) struct obreak_args *uap; { struct vmspace *vm = td->td_proc->p_vmspace; + vm_map_entry_t freelist; vm_offset_t new, old, base; rlim_t datalim, vmemlim; int rv; @@ -85,6 +86,7 @@ obreak(td, uap) do_map_wirefuture = FALSE; new = round_page((vm_offset_t)uap->nsize); + freelist = NULL; vm_map_lock(&vm->vm_map); base = round_page((vm_offset_t) vm->vm_daddr); @@ -138,7 +140,7 @@ obreak(td, uap) do_map_wirefuture = TRUE; } } else if (new < old) { - rv = vm_map_delete(&vm->vm_map, new, old); + rv = vm_map_delete(&vm->vm_map, new, old, &freelist); if (rv != KERN_SUCCESS) { error = ENOMEM; goto done; @@ -147,6 +149,7 @@ obreak(td, uap) } done: vm_map_unlock(&vm->vm_map); + vm_map_entry_free_freelist(&vm->vm_map, freelist); if (do_map_wirefuture) (void) vm_map_wire(&vm->vm_map, old, new, From owner-svn-src-head@FreeBSD.ORG Sun Feb 8 20:52:10 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A866106566C; Sun, 8 Feb 2009 20:52:10 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 18C808FC16; Sun, 8 Feb 2009 20:52:10 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n18Kq9bm034107; Sun, 8 Feb 2009 20:52:09 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n18Kq91t034106; Sun, 8 Feb 2009 20:52:09 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200902082052.n18Kq91t034106@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 8 Feb 2009 20:52:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188335 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Feb 2009 20:52:10 -0000 Author: kib Date: Sun Feb 8 20:52:09 2009 New Revision: 188335 URL: http://svn.freebsd.org/changeset/base/188335 Log: Improve comments, correct English. Submitted by: alc Modified: head/sys/vm/vm_map.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Sun Feb 8 20:39:17 2009 (r188334) +++ head/sys/vm/vm_map.c Sun Feb 8 20:52:09 2009 (r188335) @@ -1355,13 +1355,13 @@ vm_map_simplify_entry(vm_map_t map, vm_m vm_map_entry_resize_free(map, entry->prev); /* - * If the backing object is the vnode object, - * vm_object_deallocate() results in a call to - * vrele(). Because the reference to the - * object is not last, vrele() does not lock - * the vnode, and map lock can be kept without - * causing vnode lock to be taken after the - * map lock. + * If the backing object is a vnode object, + * vm_object_deallocate() calls vrele(). + * However, vrele() does not lock the vnode + * because the vnode has additional + * references. Thus, the map lock can be kept + * without causing a lock-order reversal with + * the vnode lock. */ if (prev->object.vm_object) vm_object_deallocate(prev->object.vm_object); @@ -2778,7 +2778,7 @@ vmspace_fork(struct vmspace *vm1) /* * As in vm_map_simplify_entry(), the - * vnode lock may not be acquired in + * vnode lock will not be acquired in * this call to vm_object_deallocate(). */ vm_object_deallocate(object); From owner-svn-src-head@FreeBSD.ORG Sun Feb 8 21:08:00 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD695106564A; Sun, 8 Feb 2009 21:08:00 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9B7498FC19; Sun, 8 Feb 2009 21:08:00 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n18L80SC034417; Sun, 8 Feb 2009 21:08:00 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n18L80vC034416; Sun, 8 Feb 2009 21:08:00 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200902082108.n18L80vC034416@svn.freebsd.org> From: Andrew Thompson Date: Sun, 8 Feb 2009 21:08:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188336 - head/sys/dev/usb2/controller X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Feb 2009 21:08:01 -0000 Author: thompsa Date: Sun Feb 8 21:08:00 2009 New Revision: 188336 URL: http://svn.freebsd.org/changeset/base/188336 Log: The NRL value in the queue head must be zero for interrupt transfers. This was diagnosed using a USB analyser obtained through a FreeBSD Foundation grant. Thanks to: FreeBSD Foundation Modified: head/sys/dev/usb2/controller/ehci2.c Modified: head/sys/dev/usb2/controller/ehci2.c ============================================================================== --- head/sys/dev/usb2/controller/ehci2.c Sun Feb 8 20:52:09 2009 (r188335) +++ head/sys/dev/usb2/controller/ehci2.c Sun Feb 8 21:08:00 2009 (r188336) @@ -1892,7 +1892,9 @@ ehci_setup_standard_chain(struct usb2_xf if (usb2_get_speed(xfer->xroot->udev) == USB_SPEED_HIGH) { qh_endp |= (EHCI_QH_SET_EPS(EHCI_QH_SPEED_HIGH) | - EHCI_QH_DTC | EHCI_QH_SET_NRL(8)); + EHCI_QH_DTC); + if (methods != &ehci_device_intr_methods) + qh_endp |= EHCI_QH_SET_NRL(8); } else { if (usb2_get_speed(xfer->xroot->udev) == USB_SPEED_FULL) { From owner-svn-src-head@FreeBSD.ORG Sun Feb 8 21:20:13 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 670181065670; Sun, 8 Feb 2009 21:20:13 +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 5586A8FC12; Sun, 8 Feb 2009 21:20:13 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n18LKDdm034691; Sun, 8 Feb 2009 21:20:13 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n18LKDYM034690; Sun, 8 Feb 2009 21:20:13 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200902082120.n18LKDYM034690@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 8 Feb 2009 21:20:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188337 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Feb 2009 21:20:13 -0000 Author: kib Date: Sun Feb 8 21:20:13 2009 New Revision: 188337 URL: http://svn.freebsd.org/changeset/base/188337 Log: Remove no longer valid comment. Submitted by: alc Modified: head/sys/vm/vm_fault.c Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Sun Feb 8 21:08:00 2009 (r188336) +++ head/sys/vm/vm_fault.c Sun Feb 8 21:20:13 2009 (r188337) @@ -584,9 +584,6 @@ vnode_locked: * vm_page_t passed to the routine. * * fs.m plus the additional pages are VPO_BUSY'd. - * - * XXX vm_fault_additional_pages() can block - * without releasing the map lock. */ faultcount = vm_fault_additional_pages( fs.m, behind, ahead, marray, &reqpage); From owner-svn-src-head@FreeBSD.ORG Sun Feb 8 21:32:12 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 20E82106566B; Sun, 8 Feb 2009 21:32:12 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout016.mac.com (asmtpout016.mac.com [17.148.16.91]) by mx1.freebsd.org (Postfix) with ESMTP id 08A808FC17; Sun, 8 Feb 2009 21:32:11 +0000 (UTC) (envelope-from xcllnt@mac.com) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=US-ASCII; format=flowed Received: from [192.168.4.253] (xcllnt.net [75.101.29.67]) by asmtp016.mac.com (Sun Java(tm) System Messaging Server 6.3-7.03 (built Aug 7 2008; 32bit)) with ESMTPSA id <0KER00LM8NTMAN40@asmtp016.mac.com>; Sun, 08 Feb 2009 13:32:11 -0800 (PST) Message-id: <2F95FB8C-44CA-4F1D-BF96-4C2C3C6BB06C@mac.com> From: Marcel Moolenaar To: Warner Losh In-reply-to: <200902080705.n1875NNd014796@svn.freebsd.org> Date: Sun, 08 Feb 2009 13:32:09 -0800 References: <200902080705.n1875NNd014796@svn.freebsd.org> X-Mailer: Apple Mail (2.930.3) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r188303 - head/sys/geom/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Feb 2009 21:32:13 -0000 On Feb 7, 2009, at 11:05 PM, Warner Losh wrote: > Author: imp > Date: Sun Feb 8 07:05:23 2009 > New Revision: 188303 > URL: http://svn.freebsd.org/changeset/base/188303 > > Log: > Fix g_part_*dumpconf to return void to match kobj definition. > Fix g_part_*name to return a const char * rather than a char *. This is worse than before because you didn't change apm, gpt, pc98 and vtoc8. Please change them all. Thanks, -- Marcel Moolenaar xcllnt@mac.com From owner-svn-src-head@FreeBSD.ORG Sun Feb 8 21:54:51 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D94710656BE; Sun, 8 Feb 2009 21:54:51 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5AEB78FC0C; Sun, 8 Feb 2009 21:54:51 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n18Lsp2p035510; Sun, 8 Feb 2009 21:54:51 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n18LspRB035509; Sun, 8 Feb 2009 21:54:51 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200902082154.n18LspRB035509@svn.freebsd.org> From: Kip Macy Date: Sun, 8 Feb 2009 21:54:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188341 - head/sys/i386/xen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Feb 2009 21:54:53 -0000 Author: kmacy Date: Sun Feb 8 21:54:51 2009 New Revision: 188341 URL: http://svn.freebsd.org/changeset/base/188341 Log: Don't try to directly update page tables Modified: head/sys/i386/xen/pmap.c Modified: head/sys/i386/xen/pmap.c ============================================================================== --- head/sys/i386/xen/pmap.c Sun Feb 8 21:50:47 2009 (r188340) +++ head/sys/i386/xen/pmap.c Sun Feb 8 21:54:51 2009 (r188341) @@ -3713,14 +3713,17 @@ pmap_remove_write(vm_page_t m) retry: oldpte = *pte; if ((oldpte & PG_RW) != 0) { + vm_paddr_t newpte = oldpte & ~(PG_RW | PG_M); + /* * Regardless of whether a pte is 32 or 64 bits * in size, PG_RW and PG_M are among the least * significant 32 bits. */ - if (!atomic_cmpset_int((u_int *)pte, oldpte, - oldpte & ~(PG_RW | PG_M))) + PT_SET_VA_MA(pte, newpte, TRUE); + if (*pte != newpte) goto retry; + if ((oldpte & PG_M) != 0) vm_page_dirty(m); pmap_invalidate_page(pmap, pv->pv_va); From owner-svn-src-head@FreeBSD.ORG Sun Feb 8 22:02:47 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 15837106566C; Sun, 8 Feb 2009 22:02:47 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0402D8FC17; Sun, 8 Feb 2009 22:02:47 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n18M2kkP035844; Sun, 8 Feb 2009 22:02:46 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n18M2kQ3035843; Sun, 8 Feb 2009 22:02:46 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200902082202.n18M2kQ3035843@svn.freebsd.org> From: Tim Kientzle Date: Sun, 8 Feb 2009 22:02:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188343 - head/usr.bin/tar X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Feb 2009 22:02:47 -0000 Author: kientzle Date: Sun Feb 8 22:02:46 2009 New Revision: 188343 URL: http://svn.freebsd.org/changeset/base/188343 Log: When copying file data to the archive, don't write more than was read. This seems to have only affected the shar writer, since other formats proactively truncate output to the originally-advertised size. PR: bin/131244 MFC after: 7 days Modified: head/usr.bin/tar/write.c Modified: head/usr.bin/tar/write.c ============================================================================== --- head/usr.bin/tar/write.c Sun Feb 8 22:01:20 2009 (r188342) +++ head/usr.bin/tar/write.c Sun Feb 8 22:02:46 2009 (r188343) @@ -972,7 +972,7 @@ write_file_data(struct bsdtar *bsdtar, s siginfo_printinfo(bsdtar, progress); bytes_written = archive_write_data(a, bsdtar->buff, - FILEDATABUFLEN); + bytes_read); if (bytes_written < 0) { /* Write failed; this is bad */ bsdtar_warnc(bsdtar, 0, "%s", archive_error_string(a)); From owner-svn-src-head@FreeBSD.ORG Sun Feb 8 22:04:17 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BFB40106566B; Sun, 8 Feb 2009 22:04:17 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ADA3F8FC13; Sun, 8 Feb 2009 22:04:17 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n18M4HEi035991; Sun, 8 Feb 2009 22:04:17 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n18M4Hw5035990; Sun, 8 Feb 2009 22:04:17 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200902082204.n18M4Hw5035990@svn.freebsd.org> From: Tim Kientzle Date: Sun, 8 Feb 2009 22:04:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188344 - head/usr.bin/tar X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Feb 2009 22:04:18 -0000 Author: kientzle Date: Sun Feb 8 22:04:17 2009 New Revision: 188344 URL: http://svn.freebsd.org/changeset/base/188344 Log: Fix multiple -s options. MFC after: 7 days Modified: head/usr.bin/tar/subst.c Modified: head/usr.bin/tar/subst.c ============================================================================== --- head/usr.bin/tar/subst.c Sun Feb 8 22:02:46 2009 (r188343) +++ head/usr.bin/tar/subst.c Sun Feb 8 22:04:17 2009 (r188344) @@ -202,7 +202,7 @@ apply_substitution(struct bsdtar *bsdtar if (symlink_only && !rule->symlink) continue; if (regexec(&rule->re, name, 10, matches, 0)) - break; + continue; got_match = 1; print_match |= rule->print; From owner-svn-src-head@FreeBSD.ORG Sun Feb 8 22:08:48 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ECCA3106566B; Sun, 8 Feb 2009 22:08:48 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DB9538FC18; Sun, 8 Feb 2009 22:08:48 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n18M8m9f036218; Sun, 8 Feb 2009 22:08:48 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n18M8m8B036217; Sun, 8 Feb 2009 22:08:48 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200902082208.n18M8m8B036217@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sun, 8 Feb 2009 22:08:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188345 - head/sys/cam X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Feb 2009 22:08:49 -0000 Author: trasz Date: Sun Feb 8 22:08:48 2009 New Revision: 188345 URL: http://svn.freebsd.org/changeset/base/188345 Log: Remove an overzealous check. Submitted by: das Reviewed by: scottl Approved by: rwatson (mentor, implicit) Sponsored by: FreeBSD Foundation Modified: head/sys/cam/cam_xpt.c Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Sun Feb 8 22:04:17 2009 (r188344) +++ head/sys/cam/cam_xpt.c Sun Feb 8 22:08:48 2009 (r188345) @@ -4178,7 +4178,7 @@ xpt_path_string(struct cam_path *path, c struct sbuf sb; #ifdef INVARIANTS - if (path != NULL && path->bus != NULL && path->bus->sim != NULL) + if (path != NULL && path->bus != NULL) mtx_assert(path->bus->sim->mtx, MA_OWNED); #endif From owner-svn-src-head@FreeBSD.ORG Sun Feb 8 22:17:24 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E53FF106566B; Sun, 8 Feb 2009 22:17:24 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CA1448FC08; Sun, 8 Feb 2009 22:17:24 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n18MHO2g036525; Sun, 8 Feb 2009 22:17:24 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n18MHOdt036521; Sun, 8 Feb 2009 22:17:24 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <200902082217.n18MHOdt036521@svn.freebsd.org> From: Alan Cox Date: Sun, 8 Feb 2009 22:17:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188348 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Feb 2009 22:17:25 -0000 Author: alc Date: Sun Feb 8 22:17:24 2009 New Revision: 188348 URL: http://svn.freebsd.org/changeset/base/188348 Log: Eliminate OBJ_NEEDGIANT. After r188331, OBJ_NEEDGIANT's only use is by a redundant assertion in vm_fault(). Reviewed by: kib Modified: head/sys/vm/vm_fault.c head/sys/vm/vm_object.c head/sys/vm/vm_object.h head/sys/vm/vnode_pager.c Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Sun Feb 8 22:13:57 2009 (r188347) +++ head/sys/vm/vm_fault.c Sun Feb 8 22:17:24 2009 (r188348) @@ -567,9 +567,6 @@ vnode_lock: vnode_locked: KASSERT(fs.vp == NULL || !fs.map->system_map, ("vm_fault: vnode-backed object mapped by system map")); - KASSERT((fs.first_object->flags & OBJ_NEEDGIANT) == 0 || - !fs.map->system_map, - ("vm_fault: Object requiring giant mapped by system map")); /* * now we find out if any other pages should be paged Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Sun Feb 8 22:13:57 2009 (r188347) +++ head/sys/vm/vm_object.c Sun Feb 8 22:17:24 2009 (r188348) @@ -1273,11 +1273,9 @@ vm_object_shadow( source->shadow_count++; source->generation++; #if VM_NRESERVLEVEL > 0 - result->flags |= source->flags & (OBJ_NEEDGIANT | OBJ_COLORED); + result->flags |= source->flags & OBJ_COLORED; result->pg_color = (source->pg_color + OFF_TO_IDX(*offset)) & ((1 << (VM_NFREEORDER - 1)) - 1); -#else - result->flags |= source->flags & OBJ_NEEDGIANT; #endif VM_OBJECT_UNLOCK(source); } @@ -1349,7 +1347,6 @@ vm_object_split(vm_map_entry_t entry) orig_object->backing_object_offset + entry->offset; new_object->backing_object = source; } - new_object->flags |= orig_object->flags & OBJ_NEEDGIANT; retry: if ((m = TAILQ_FIRST(&orig_object->memq)) != NULL) { if (m->pindex < offidxstart) { Modified: head/sys/vm/vm_object.h ============================================================================== --- head/sys/vm/vm_object.h Sun Feb 8 22:13:57 2009 (r188347) +++ head/sys/vm/vm_object.h Sun Feb 8 22:17:24 2009 (r188348) @@ -147,7 +147,6 @@ struct vm_object { #define OBJ_COLORED 0x1000 /* pg_color is defined */ #define OBJ_ONEMAPPING 0x2000 /* One USE (a single, non-forked) mapping flag */ #define OBJ_DISCONNECTWNT 0x4000 /* disconnect from vnode wanted */ -#define OBJ_NEEDGIANT 0x8000 /* object requires Giant */ #define IDX_TO_OFF(idx) (((vm_ooffset_t)(idx)) << PAGE_SHIFT) #define OFF_TO_IDX(off) ((vm_pindex_t)(((vm_ooffset_t)(off)) >> PAGE_SHIFT)) Modified: head/sys/vm/vnode_pager.c ============================================================================== --- head/sys/vm/vnode_pager.c Sun Feb 8 22:13:57 2009 (r188347) +++ head/sys/vm/vnode_pager.c Sun Feb 8 22:17:24 2009 (r188348) @@ -223,8 +223,6 @@ retry: object->un_pager.vnp.vnp_size = size; object->handle = handle; - if (VFS_NEEDSGIANT(vp->v_mount)) - vm_object_set_flag(object, OBJ_NEEDGIANT); VI_LOCK(vp); if (vp->v_object != NULL) { /* From owner-svn-src-head@FreeBSD.ORG Sun Feb 8 22:42:30 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EF843106566B; Sun, 8 Feb 2009 22:42:30 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id AAC588FC14; Sun, 8 Feb 2009 22:42:30 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id n18Md8Lo008484; Sun, 8 Feb 2009 15:39:08 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Sun, 08 Feb 2009 15:39:11 -0700 (MST) Message-Id: <20090208.153911.-2127818638.imp@bsdimp.com> To: xcllnt@mac.com From: "M. Warner Losh" In-Reply-To: <2F95FB8C-44CA-4F1D-BF96-4C2C3C6BB06C@mac.com> References: <200902080705.n1875NNd014796@svn.freebsd.org> <2F95FB8C-44CA-4F1D-BF96-4C2C3C6BB06C@mac.com> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r188303 - head/sys/geom/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Feb 2009 22:42:31 -0000 In message: <2F95FB8C-44CA-4F1D-BF96-4C2C3C6BB06C@mac.com> Marcel Moolenaar writes: : : On Feb 7, 2009, at 11:05 PM, Warner Losh wrote: : : > Author: imp : > Date: Sun Feb 8 07:05:23 2009 : > New Revision: 188303 : > URL: http://svn.freebsd.org/changeset/base/188303 : > : > Log: : > Fix g_part_*dumpconf to return void to match kobj definition. : > Fix g_part_*name to return a const char * rather than a char *. : : This is worse than before because you didn't change : apm, gpt, pc98 and vtoc8. Please change them all. Will do. I'm working my way through the platforms with the extra-picky compile-time checking. Didn't think to grep for them all, but I really should have. My bad. Warner From owner-svn-src-head@FreeBSD.ORG Sun Feb 8 22:54:59 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6624D1065674; Sun, 8 Feb 2009 22:54:59 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 53A588FC1A; Sun, 8 Feb 2009 22:54:59 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n18MsxXN037313; Sun, 8 Feb 2009 22:54:59 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n18MsxVt037307; Sun, 8 Feb 2009 22:54:59 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200902082254.n18MsxVt037307@svn.freebsd.org> From: Warner Losh Date: Sun, 8 Feb 2009 22:54:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188350 - in head/sys: amd64/amd64 arm/arm dev/usb2/core i386/i386 ia64/ia64 sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Feb 2009 22:55:00 -0000 Author: imp Date: Sun Feb 8 22:54:58 2009 New Revision: 188350 URL: http://svn.freebsd.org/changeset/base/188350 Log: When bouncing pages, allow a new option to preserve the intra-page offset. This is needed for the ehci hardware buffer rings that assume this behavior. This is an interim solution, and a more general one is being worked on. This solution doesn't break anything that doesn't ask for it directly. The mbuf and uio variants with this flag likely don't work and haven't been tested. Universe builds with these changes. I don't have a huge-memory machine to test these changes with, but will be happy to work with folks that do and hps if this changes turns out not to be sufficient. Submitted by: alfred@ from Hans Peter Selasky's original Modified: head/sys/amd64/amd64/busdma_machdep.c head/sys/arm/arm/busdma_machdep.c head/sys/dev/usb2/core/usb2_busdma.c head/sys/i386/i386/busdma_machdep.c head/sys/ia64/ia64/busdma_machdep.c head/sys/sys/bus_dma.h Modified: head/sys/amd64/amd64/busdma_machdep.c ============================================================================== --- head/sys/amd64/amd64/busdma_machdep.c Sun Feb 8 22:31:31 2009 (r188349) +++ head/sys/amd64/amd64/busdma_machdep.c Sun Feb 8 22:54:58 2009 (r188350) @@ -1128,6 +1128,13 @@ add_bounce_page(bus_dma_tag_t dmat, bus_ bz->active_bpages++; mtx_unlock(&bounce_lock); + if (dmat->flags & BUS_DMA_KEEP_PG_OFFSET) { + /* page offset needs to be preserved */ + bpage->vaddr &= ~PAGE_MASK; + bpage->busaddr &= ~PAGE_MASK; + bpage->vaddr |= vaddr & PAGE_MASK; + bpage->busaddr |= vaddr & PAGE_MASK; + } bpage->datavaddr = vaddr; bpage->datacount = size; STAILQ_INSERT_TAIL(&(map->bpages), bpage, links); Modified: head/sys/arm/arm/busdma_machdep.c ============================================================================== --- head/sys/arm/arm/busdma_machdep.c Sun Feb 8 22:31:31 2009 (r188349) +++ head/sys/arm/arm/busdma_machdep.c Sun Feb 8 22:54:58 2009 (r188350) @@ -1417,6 +1417,13 @@ add_bounce_page(bus_dma_tag_t dmat, bus_ bz->active_bpages++; mtx_unlock(&bounce_lock); + if (dmat->flags & BUS_DMA_KEEP_PG_OFFSET) { + /* page offset needs to be preserved */ + bpage->vaddr &= ~PAGE_MASK; + bpage->busaddr &= ~PAGE_MASK; + bpage->vaddr |= vaddr & PAGE_MASK; + bpage->busaddr |= vaddr & PAGE_MASK; + } bpage->datavaddr = vaddr; bpage->datacount = size; STAILQ_INSERT_TAIL(&(map->bpages), bpage, links); Modified: head/sys/dev/usb2/core/usb2_busdma.c ============================================================================== --- head/sys/dev/usb2/core/usb2_busdma.c Sun Feb 8 22:31:31 2009 (r188349) +++ head/sys/dev/usb2/core/usb2_busdma.c Sun Feb 8 22:54:58 2009 (r188350) @@ -351,7 +351,7 @@ usb2_dma_tag_create(struct usb2_dma_tag (2 + (size / USB_PAGE_SIZE)) : 1, /* maxsegsz */ (align == 1) ? USB_PAGE_SIZE : size, - /* flags */ 0, + /* flags */ BUS_DMA_KEEP_PG_OFFSET, /* lockfn */ &usb2_dma_lock_cb, /* lockarg */ NULL, &tag)) { Modified: head/sys/i386/i386/busdma_machdep.c ============================================================================== --- head/sys/i386/i386/busdma_machdep.c Sun Feb 8 22:31:31 2009 (r188349) +++ head/sys/i386/i386/busdma_machdep.c Sun Feb 8 22:54:58 2009 (r188350) @@ -1146,6 +1146,13 @@ add_bounce_page(bus_dma_tag_t dmat, bus_ bz->active_bpages++; mtx_unlock(&bounce_lock); + if (dmat->flags & BUS_DMA_KEEP_PG_OFFSET) { + /* page offset needs to be preserved */ + bpage->vaddr &= ~PAGE_MASK; + bpage->busaddr &= ~PAGE_MASK; + bpage->vaddr |= vaddr & PAGE_MASK; + bpage->busaddr |= vaddr & PAGE_MASK; + } bpage->datavaddr = vaddr; bpage->datacount = size; STAILQ_INSERT_TAIL(&(map->bpages), bpage, links); Modified: head/sys/ia64/ia64/busdma_machdep.c ============================================================================== --- head/sys/ia64/ia64/busdma_machdep.c Sun Feb 8 22:31:31 2009 (r188349) +++ head/sys/ia64/ia64/busdma_machdep.c Sun Feb 8 22:54:58 2009 (r188350) @@ -936,6 +936,13 @@ add_bounce_page(bus_dma_tag_t dmat, bus_ active_bpages++; mtx_unlock(&bounce_lock); + if (dmat->flags & BUS_DMA_KEEP_PG_OFFSET) { + /* page offset needs to be preserved */ + bpage->vaddr &= ~PAGE_MASK; + bpage->busaddr &= ~PAGE_MASK; + bpage->vaddr |= vaddr & PAGE_MASK; + bpage->busaddr |= vaddr & PAGE_MASK; + } bpage->datavaddr = vaddr; bpage->datacount = size; STAILQ_INSERT_TAIL(&(map->bpages), bpage, links); Modified: head/sys/sys/bus_dma.h ============================================================================== --- head/sys/sys/bus_dma.h Sun Feb 8 22:31:31 2009 (r188349) +++ head/sys/sys/bus_dma.h Sun Feb 8 22:54:58 2009 (r188350) @@ -102,6 +102,13 @@ #define BUS_DMA_NOWRITE 0x100 #define BUS_DMA_NOCACHE 0x200 +/* + * The following flag is a DMA tag hint that the page offset of the + * loaded kernel virtual address must be preserved in the first + * physical segment address, when the KVA is loaded into DMA. + */ +#define BUS_DMA_KEEP_PG_OFFSET 0x400 + /* Forwards needed by prototypes below. */ struct mbuf; struct uio; From owner-svn-src-head@FreeBSD.ORG Sun Feb 8 23:01:29 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 58AF01065673; Sun, 8 Feb 2009 23:01:29 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout017.mac.com (asmtpout017.mac.com [17.148.16.92]) by mx1.freebsd.org (Postfix) with ESMTP id 411008FC0C; Sun, 8 Feb 2009 23:01:29 +0000 (UTC) (envelope-from xcllnt@mac.com) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Received: from [192.168.4.253] (xcllnt.net [75.101.29.67]) by asmtp017.mac.com (Sun Java(tm) System Messaging Server 6.3-7.03 (built Aug 7 2008; 32bit)) with ESMTPSA id <0KER001UURY9NQ00@asmtp017.mac.com>; Sun, 08 Feb 2009 15:01:22 -0800 (PST) Message-id: <9E40268E-A2E2-4CAA-AAFE-EB2491175CEE@mac.com> From: Marcel Moolenaar To: Warner Losh In-reply-to: <200902082254.n18MsxVt037307@svn.freebsd.org> Date: Sun, 08 Feb 2009 15:01:21 -0800 References: <200902082254.n18MsxVt037307@svn.freebsd.org> X-Mailer: Apple Mail (2.930.3) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r188350 - in head/sys: amd64/amd64 arm/arm dev/usb2/core i386/i386 ia64/ia64 sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Feb 2009 23:01:29 -0000 On Feb 8, 2009, at 2:54 PM, Warner Losh wrote: > Author: imp > Date: Sun Feb 8 22:54:58 2009 > New Revision: 188350 > URL: http://svn.freebsd.org/changeset/base/188350 > > Log: > When bouncing pages, allow a new option to preserve the intra-page > offset. This is needed for the ehci hardware buffer rings that > assume > this behavior. I thought we ended up with always doing that? Bounce buffers may or may not be used, so if the page offset must be zero for bounce buffers, they must be zero for the original DMA request. I see no value in re-aligning the DMA request to a page boundary when bounce buffers are used, but it is required in some cases to not realign. Hence, why not always (and unconditionally) preserve the alignment? -- Marcel Moolenaar xcllnt@mac.com From owner-svn-src-head@FreeBSD.ORG Sun Feb 8 23:39:30 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7976D1065673; Sun, 8 Feb 2009 23:39:30 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 679298FC1B; Sun, 8 Feb 2009 23:39:30 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n18NdUGC038264; Sun, 8 Feb 2009 23:39:30 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n18NdUZw038263; Sun, 8 Feb 2009 23:39:30 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200902082339.n18NdUZw038263@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 8 Feb 2009 23:39:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188352 - head/sys/geom/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Feb 2009 23:39:31 -0000 Author: marcel Date: Sun Feb 8 23:39:30 2009 New Revision: 188352 URL: http://svn.freebsd.org/changeset/base/188352 Log: Allow gpe_offset to be set by the scheme. When gpe_offset is zero, or invalid, initialize it to the start of the partition. Adjust the mediasize when the offset lies somewhere inside the partition. Modified: head/sys/geom/part/g_part.c Modified: head/sys/geom/part/g_part.c ============================================================================== --- head/sys/geom/part/g_part.c Sun Feb 8 23:12:29 2009 (r188351) +++ head/sys/geom/part/g_part.c Sun Feb 8 23:39:30 2009 (r188352) @@ -244,7 +244,8 @@ g_part_new_entry(struct g_part_table *ta LIST_INSERT_HEAD(&table->gpt_entry, entry, gpe_entry); else LIST_INSERT_AFTER(last, entry, gpe_entry); - } + } else + entry->gpe_offset = 0; entry->gpe_start = start; entry->gpe_end = end; return (entry); @@ -257,11 +258,14 @@ g_part_new_provider(struct g_geom *gp, s char buf[32]; struct g_consumer *cp; struct g_provider *pp; + off_t offset; cp = LIST_FIRST(&gp->consumer); pp = cp->provider; - entry->gpe_offset = entry->gpe_start * pp->sectorsize; + offset = entry->gpe_start * pp->sectorsize; + if (entry->gpe_offset < offset) + entry->gpe_offset = offset; if (entry->gpe_pp == NULL) { entry->gpe_pp = g_new_providerf(gp, "%s%s", gp->name, @@ -271,6 +275,7 @@ g_part_new_provider(struct g_geom *gp, s entry->gpe_pp->index = entry->gpe_index - 1; /* index is 1-based. */ entry->gpe_pp->mediasize = (entry->gpe_end - entry->gpe_start + 1) * pp->sectorsize; + entry->gpe_pp->mediasize -= entry->gpe_offset - offset; entry->gpe_pp->sectorsize = pp->sectorsize; entry->gpe_pp->flags = pp->flags & G_PF_CANDELETE; if (pp->stripesize > 0) { From owner-svn-src-head@FreeBSD.ORG Sun Feb 8 23:43:37 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 043BC106564A; Sun, 8 Feb 2009 23:43:36 +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 B32538FC12; Sun, 8 Feb 2009 23:43:36 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n18NhalR038366; Sun, 8 Feb 2009 23:43:36 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n18Nha37038365; Sun, 8 Feb 2009 23:43:36 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <200902082343.n18Nha37038365@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Sun, 8 Feb 2009 23:43:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188353 - head/sys/mips/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Feb 2009 23:43:37 -0000 Author: gonzo Date: Sun Feb 8 23:43:36 2009 New Revision: 188353 URL: http://svn.freebsd.org/changeset/base/188353 Log: - Fix in_cksum for big-endian MIPS: use correct compile-time check. Modified: head/sys/mips/mips/in_cksum.c Modified: head/sys/mips/mips/in_cksum.c ============================================================================== --- head/sys/mips/mips/in_cksum.c Sun Feb 8 23:39:30 2009 (r188352) +++ head/sys/mips/mips/in_cksum.c Sun Feb 8 23:43:36 2009 (r188353) @@ -69,7 +69,7 @@ __FBSDID("$FreeBSD$"); } static const u_int32_t in_masks[] = { -#ifndef _MISEB +#if _BYTE_ORDER == _LITTLE_ENDIAN /*0 bytes*/ /*1 byte*/ /*2 bytes*/ /*3 bytes*/ 0x00000000, 0x000000FF, 0x0000FFFF, 0x00FFFFFF, /* offset 0 */ 0x00000000, 0x0000FF00, 0x00FFFF00, 0xFFFFFF00, /* offset 1 */ From owner-svn-src-head@FreeBSD.ORG Sun Feb 8 23:51:45 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 059E2106566C; Sun, 8 Feb 2009 23:51:45 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E62988FC17; Sun, 8 Feb 2009 23:51:44 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n18Npiut038554; Sun, 8 Feb 2009 23:51:44 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n18Npihc038550; Sun, 8 Feb 2009 23:51:44 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200902082351.n18Npihc038550@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 8 Feb 2009 23:51:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188354 - in head/sys: geom/part modules/geom/geom_part modules/geom/geom_part/geom_part_ebr X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Feb 2009 23:51:45 -0000 Author: marcel Date: Sun Feb 8 23:51:44 2009 New Revision: 188354 URL: http://svn.freebsd.org/changeset/base/188354 Log: Add the EBR scheme. The EBR scheme supports the Extended Boot Records found inside extended partitions and used to create logical partitions. At this time write/modify support is not (yet) present. The EBR and MBR schemes both check the parent scheme. The MBR will back-off when nested under another MBR, whereas the EBR only nests under a MBR. Added: head/sys/geom/part/g_part_ebr.c (contents, props changed) head/sys/modules/geom/geom_part/geom_part_ebr/ head/sys/modules/geom/geom_part/geom_part_ebr/Makefile (contents, props changed) Modified: head/sys/geom/part/g_part_mbr.c head/sys/modules/geom/geom_part/Makefile Added: head/sys/geom/part/g_part_ebr.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/geom/part/g_part_ebr.c Sun Feb 8 23:51:44 2009 (r188354) @@ -0,0 +1,339 @@ +/*- + * Copyright (c) 2007-2009 Marcel Moolenaar + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "g_part_if.h" + +#define EBRSIZE 512 + +struct g_part_ebr_table { + struct g_part_table base; +}; + +struct g_part_ebr_entry { + struct g_part_entry base; + struct dos_partition ent; +}; + +static int g_part_ebr_add(struct g_part_table *, struct g_part_entry *, + struct g_part_parms *); +static int g_part_ebr_create(struct g_part_table *, struct g_part_parms *); +static int g_part_ebr_destroy(struct g_part_table *, struct g_part_parms *); +static void g_part_ebr_dumpconf(struct g_part_table *, struct g_part_entry *, + struct sbuf *, const char *); +static int g_part_ebr_dumpto(struct g_part_table *, struct g_part_entry *); +static int g_part_ebr_modify(struct g_part_table *, struct g_part_entry *, + struct g_part_parms *); +static const char *g_part_ebr_name(struct g_part_table *, struct g_part_entry *, + char *, size_t); +static int g_part_ebr_probe(struct g_part_table *, struct g_consumer *); +static int g_part_ebr_read(struct g_part_table *, struct g_consumer *); +static int g_part_ebr_setunset(struct g_part_table *, struct g_part_entry *, + const char *, unsigned int); +static const char *g_part_ebr_type(struct g_part_table *, struct g_part_entry *, + char *, size_t); +static int g_part_ebr_write(struct g_part_table *, struct g_consumer *); + +static kobj_method_t g_part_ebr_methods[] = { + KOBJMETHOD(g_part_add, g_part_ebr_add), + KOBJMETHOD(g_part_create, g_part_ebr_create), + KOBJMETHOD(g_part_destroy, g_part_ebr_destroy), + KOBJMETHOD(g_part_dumpconf, g_part_ebr_dumpconf), + KOBJMETHOD(g_part_dumpto, g_part_ebr_dumpto), + KOBJMETHOD(g_part_modify, g_part_ebr_modify), + KOBJMETHOD(g_part_name, g_part_ebr_name), + KOBJMETHOD(g_part_probe, g_part_ebr_probe), + KOBJMETHOD(g_part_read, g_part_ebr_read), + KOBJMETHOD(g_part_setunset, g_part_ebr_setunset), + KOBJMETHOD(g_part_type, g_part_ebr_type), + KOBJMETHOD(g_part_write, g_part_ebr_write), + { 0, 0 } +}; + +static struct g_part_scheme g_part_ebr_scheme = { + "EBR", + g_part_ebr_methods, + sizeof(struct g_part_ebr_table), + .gps_entrysz = sizeof(struct g_part_ebr_entry), + .gps_minent = 1, + .gps_maxent = INT_MAX, +}; +G_PART_SCHEME_DECLARE(g_part_ebr); + +static void +ebr_entry_decode(const char *p, struct dos_partition *ent) +{ + ent->dp_flag = p[0]; + ent->dp_shd = p[1]; + ent->dp_ssect = p[2]; + ent->dp_scyl = p[3]; + ent->dp_typ = p[4]; + ent->dp_ehd = p[5]; + ent->dp_esect = p[6]; + ent->dp_ecyl = p[7]; + ent->dp_start = le32dec(p + 8); + ent->dp_size = le32dec(p + 12); +} + +static int +g_part_ebr_add(struct g_part_table *basetable, struct g_part_entry *baseentry, + struct g_part_parms *gpp) +{ + + return (ENOSYS); +} + +static int +g_part_ebr_create(struct g_part_table *basetable, struct g_part_parms *gpp) +{ + + return (ENOSYS); +} + +static int +g_part_ebr_destroy(struct g_part_table *basetable, struct g_part_parms *gpp) +{ + + /* Wipe the first sector to clear the partitioning. */ + basetable->gpt_smhead |= 1; + return (0); +} + +static void +g_part_ebr_dumpconf(struct g_part_table *table, struct g_part_entry *baseentry, + struct sbuf *sb, const char *indent) +{ + struct g_part_ebr_entry *entry; + + entry = (struct g_part_ebr_entry *)baseentry; + if (indent == NULL) { + /* conftxt: libdisk compatibility */ + sbuf_printf(sb, " xs MBREXT xt %u", entry->ent.dp_typ); + } else if (entry != NULL) { + /* confxml: partition entry information */ + sbuf_printf(sb, "%s%u\n", indent, + entry->ent.dp_typ); + if (entry->ent.dp_flag & 0x80) + sbuf_printf(sb, "%sactive\n", indent); + } else { + /* confxml: scheme information */ + } +} + +static int +g_part_ebr_dumpto(struct g_part_table *table, struct g_part_entry *baseentry) +{ + struct g_part_ebr_entry *entry; + + /* Allow dumping to a FreeBSD partition only. */ + entry = (struct g_part_ebr_entry *)baseentry; + return ((entry->ent.dp_typ == DOSPTYP_386BSD) ? 1 : 0); +} + +static int +g_part_ebr_modify(struct g_part_table *basetable, + struct g_part_entry *baseentry, struct g_part_parms *gpp) +{ + + return (ENOSYS); +} + +static const char * +g_part_ebr_name(struct g_part_table *table, struct g_part_entry *entry, + char *buf, size_t bufsz) +{ + + snprintf(buf, bufsz, ".%08u", entry->gpe_index); + return (buf); +} + +static int +g_part_ebr_probe(struct g_part_table *table, struct g_consumer *cp) +{ + char psn[8]; + struct g_provider *pp; + u_char *buf, *p; + int error, index, res, sum; + uint16_t magic; + + pp = cp->provider; + + /* Sanity-check the provider. */ + if (pp->sectorsize < EBRSIZE || pp->mediasize < pp->sectorsize) + return (ENOSPC); + if (pp->sectorsize > 4096) + return (ENXIO); + + /* Check that we have a parent and that it's a MBR. */ + if (table->gpt_depth == 0) + return (ENXIO); + error = g_getattr("PART::scheme", cp, &psn); + if (error) + return (error); + if (strcmp(psn, "MBR")) + return (ENXIO); + + /* Check that there's a EBR. */ + buf = g_read_data(cp, 0L, pp->sectorsize, &error); + if (buf == NULL) + return (error); + + /* We goto out on mismatch. */ + res = ENXIO; + + magic = le16dec(buf + DOSMAGICOFFSET); + if (magic != DOSMAGIC) + goto out; + + /* The sector is all zeroes, except for the partition entries. */ + sum = 0; + for (index = 0; index < DOSPARTOFF; index++) + sum += buf[index]; + if (sum != 0) + goto out; + + for (index = 0; index < NDOSPART; index++) { + p = buf + DOSPARTOFF + index * DOSPARTSIZE; + if (p[0] != 0 && p[0] != 0x80) + goto out; + if (index < 2) + continue; + /* The 3rd & 4th entries are always zero. */ + if ((le64dec(p+0) + le64dec(p+8)) != 0) + goto out; + } + + res = G_PART_PROBE_PRI_HIGH; + + out: + g_free(buf); + return (res); +} + +static int +g_part_ebr_read(struct g_part_table *basetable, struct g_consumer *cp) +{ + struct dos_partition ent[2]; + struct g_provider *pp; + struct g_part_entry *baseentry; + struct g_part_ebr_table *table; + struct g_part_ebr_entry *entry; + u_char *buf; + off_t ofs, msize; + u_int lba; + int error, index; + + pp = cp->provider; + table = (struct g_part_ebr_table *)basetable; + msize = pp->mediasize / pp->sectorsize; + + lba = 0; + while (1) { + ofs = (off_t)lba * pp->sectorsize; + buf = g_read_data(cp, ofs, pp->sectorsize, &error); + if (buf == NULL) + return (error); + + ebr_entry_decode(buf + DOSPARTOFF + 0 * DOSPARTSIZE, ent + 0); + ebr_entry_decode(buf + DOSPARTOFF + 1 * DOSPARTSIZE, ent + 1); + g_free(buf); + + if (ent[0].dp_typ == 0) + break; + + if (ent[0].dp_typ == 5 && ent[1].dp_typ == 0) { + lba = ent[0].dp_start; + continue; + } + + index = (lba / basetable->gpt_sectors) + 1; + baseentry = (struct g_part_entry *)g_part_new_entry(basetable, + index, lba, lba + ent[0].dp_start + ent[0].dp_size - 1); + baseentry->gpe_offset = (off_t)(lba + ent[0].dp_start) * + pp->sectorsize; + entry = (struct g_part_ebr_entry *)baseentry; + entry->ent = ent[0]; + + if (ent[1].dp_typ == 0) + break; + + lba = ent[1].dp_start; + } + + basetable->gpt_entries = msize / basetable->gpt_sectors; + basetable->gpt_first = 0; + basetable->gpt_last = msize - (msize % basetable->gpt_sectors) - 1; + return (0); +} + +static int +g_part_ebr_setunset(struct g_part_table *table, struct g_part_entry *baseentry, + const char *attrib, unsigned int set) +{ + + return (ENOSYS); +} + +static const char * +g_part_ebr_type(struct g_part_table *basetable, struct g_part_entry *baseentry, + char *buf, size_t bufsz) +{ + struct g_part_ebr_entry *entry; + int type; + + entry = (struct g_part_ebr_entry *)baseentry; + type = entry->ent.dp_typ; + if (type == DOSPTYP_386BSD) + return (g_part_alias_name(G_PART_ALIAS_FREEBSD)); + snprintf(buf, bufsz, "!%d", type); + return (buf); +} + +static int +g_part_ebr_write(struct g_part_table *basetable, struct g_consumer *cp) +{ + + return (ENOSYS); +} Modified: head/sys/geom/part/g_part_mbr.c ============================================================================== --- head/sys/geom/part/g_part_mbr.c Sun Feb 8 23:43:36 2009 (r188353) +++ head/sys/geom/part/g_part_mbr.c Sun Feb 8 23:51:44 2009 (r188354) @@ -314,6 +314,7 @@ g_part_mbr_name(struct g_part_table *tab static int g_part_mbr_probe(struct g_part_table *table, struct g_consumer *cp) { + char psn[8]; struct g_provider *pp; u_char *buf, *p; int error, index, res, sum; @@ -327,6 +328,11 @@ g_part_mbr_probe(struct g_part_table *ta if (pp->sectorsize > 4096) return (ENXIO); + /* We don't nest under an MBR (see EBR instead). */ + error = g_getattr("PART::scheme", cp, &psn); + if (error == 0 && strcmp(psn, g_part_mbr_scheme.name) == 0) + return (ELOOP); + /* Check that there's a MBR. */ buf = g_read_data(cp, 0L, pp->sectorsize, &error); if (buf == NULL) Modified: head/sys/modules/geom/geom_part/Makefile ============================================================================== --- head/sys/modules/geom/geom_part/Makefile Sun Feb 8 23:43:36 2009 (r188353) +++ head/sys/modules/geom/geom_part/Makefile Sun Feb 8 23:51:44 2009 (r188354) @@ -2,6 +2,7 @@ SUBDIR= geom_part_apm \ geom_part_bsd \ + geom_part_ebr \ geom_part_gpt \ geom_part_mbr \ geom_part_pc98 \ Added: head/sys/modules/geom/geom_part/geom_part_ebr/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/geom/geom_part/geom_part_ebr/Makefile Sun Feb 8 23:51:44 2009 (r188354) @@ -0,0 +1,12 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../../../geom/part + +KMOD= geom_part_ebr +SRCS= g_part_ebr.c + +SRCS+= bus_if.h device_if.h g_part_if.h + +MFILES= kern/bus_if.m kern/device_if.m geom/part/g_part_if.m + +.include From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 00:06:27 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A12FF106564A; Mon, 9 Feb 2009 00:06:27 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 5B0A08FC1B; Mon, 9 Feb 2009 00:06:27 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id n1905BdG009408; Sun, 8 Feb 2009 17:05:12 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Sun, 08 Feb 2009 17:05:15 -0700 (MST) Message-Id: <20090208.170515.1031215309.imp@bsdimp.com> To: xcllnt@mac.com From: "M. Warner Losh" In-Reply-To: <9E40268E-A2E2-4CAA-AAFE-EB2491175CEE@mac.com> References: <200902082254.n18MsxVt037307@svn.freebsd.org> <9E40268E-A2E2-4CAA-AAFE-EB2491175CEE@mac.com> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r188350 - in head/sys: amd64/amd64 arm/arm dev/usb2/core i386/i386 ia64/ia64 sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Feb 2009 00:06:28 -0000 In message: <9E40268E-A2E2-4CAA-AAFE-EB2491175CEE@mac.com> Marcel Moolenaar writes: : : On Feb 8, 2009, at 2:54 PM, Warner Losh wrote: : : > Author: imp : > Date: Sun Feb 8 22:54:58 2009 : > New Revision: 188350 : > URL: http://svn.freebsd.org/changeset/base/188350 : > : > Log: : > When bouncing pages, allow a new option to preserve the intra-page : > offset. This is needed for the ehci hardware buffer rings that : > assume : > this behavior. : : I thought we ended up with always doing that? : : Bounce buffers may or may not be used, so if the page offset : must be zero for bounce buffers, they must be zero for the : original DMA request. I see no value in re-aligning the DMA : request to a page boundary when bounce buffers are used, but : it is required in some cases to not realign. Hence, why not : always (and unconditionally) preserve the alignment? I'm not entirely sure either. However, at this stage of the game I'd rather be a little conservative in what we change and do a more careful and thorough analysis. One area we do need to fix is the inability to flush a subset of the range. Warner From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 00:09:59 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6EEA5106566C; Mon, 9 Feb 2009 00:09:59 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout022.mac.com (asmtpout022.mac.com [17.148.16.97]) by mx1.freebsd.org (Postfix) with ESMTP id 574D58FC0C; Mon, 9 Feb 2009 00:09:59 +0000 (UTC) (envelope-from xcllnt@mac.com) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Received: from [192.168.4.253] (xcllnt.net [75.101.29.67]) by asmtp022.mac.com (Sun Java(tm) System Messaging Server 6.3-7.03 (built Aug 7 2008; 32bit)) with ESMTPSA id <0KER00BHAV3ZPZ10@asmtp022.mac.com>; Sun, 08 Feb 2009 16:09:36 -0800 (PST) Message-id: <34EFBA0C-FB99-42DB-BF5C-A889348AD393@mac.com> From: Marcel Moolenaar To: "M. Warner Losh" In-reply-to: <20090208.170515.1031215309.imp@bsdimp.com> Date: Sun, 08 Feb 2009 16:09:35 -0800 References: <200902082254.n18MsxVt037307@svn.freebsd.org> <9E40268E-A2E2-4CAA-AAFE-EB2491175CEE@mac.com> <20090208.170515.1031215309.imp@bsdimp.com> X-Mailer: Apple Mail (2.930.3) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r188350 - in head/sys: amd64/amd64 arm/arm dev/usb2/core i386/i386 ia64/ia64 sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Feb 2009 00:10:00 -0000 On Feb 8, 2009, at 4:05 PM, M. Warner Losh wrote: > In message: <9E40268E-A2E2-4CAA-AAFE-EB2491175CEE@mac.com> > Marcel Moolenaar writes: > : > : On Feb 8, 2009, at 2:54 PM, Warner Losh wrote: > : > : > Author: imp > : > Date: Sun Feb 8 22:54:58 2009 > : > New Revision: 188350 > : > URL: http://svn.freebsd.org/changeset/base/188350 > : > > : > Log: > : > When bouncing pages, allow a new option to preserve the intra- > page > : > offset. This is needed for the ehci hardware buffer rings that > : > assume > : > this behavior. > : > : I thought we ended up with always doing that? > : > : Bounce buffers may or may not be used, so if the page offset > : must be zero for bounce buffers, they must be zero for the > : original DMA request. I see no value in re-aligning the DMA > : request to a page boundary when bounce buffers are used, but > : it is required in some cases to not realign. Hence, why not > : always (and unconditionally) preserve the alignment? > > I'm not entirely sure either. However, at this stage of the game I'd > rather be a little conservative in what we change and do a more > careful and thorough analysis. Fair enough. -- Marcel Moolenaar xcllnt@mac.com From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 01:00:12 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3FD3B106568F; Mon, 9 Feb 2009 01:00:12 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.freebsd.org (Postfix) with ESMTP id B42598FC1D; Mon, 9 Feb 2009 01:00:11 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from phobos.local ([192.168.254.200]) (authenticated bits=0) by pooker.samsco.org (8.14.2/8.14.2) with ESMTP id n19105Tc044067; Sun, 8 Feb 2009 18:00:05 -0700 (MST) (envelope-from scottl@samsco.org) Message-ID: <498F8015.8000704@samsco.org> Date: Sun, 08 Feb 2009 18:00:05 -0700 From: Scott Long User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.13) Gecko/20080313 SeaMonkey/1.1.9 MIME-Version: 1.0 To: Marcel Moolenaar References: <200902082254.n18MsxVt037307@svn.freebsd.org> <9E40268E-A2E2-4CAA-AAFE-EB2491175CEE@mac.com> <20090208.170515.1031215309.imp@bsdimp.com> <34EFBA0C-FB99-42DB-BF5C-A889348AD393@mac.com> In-Reply-To: <34EFBA0C-FB99-42DB-BF5C-A889348AD393@mac.com> X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=3.8 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.1.8 X-Spam-Checker-Version: SpamAssassin 3.1.8 (2007-02-13) on pooker.samsco.org Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, "M. Warner Losh" Subject: Re: svn commit: r188350 - in head/sys: amd64/amd64 arm/arm dev/usb2/core i386/i386 ia64/ia64 sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Feb 2009 01:00:13 -0000 Marcel Moolenaar wrote: > > On Feb 8, 2009, at 4:05 PM, M. Warner Losh wrote: > >> In message: <9E40268E-A2E2-4CAA-AAFE-EB2491175CEE@mac.com> >> Marcel Moolenaar writes: >> : >> : On Feb 8, 2009, at 2:54 PM, Warner Losh wrote: >> : >> : > Author: imp >> : > Date: Sun Feb 8 22:54:58 2009 >> : > New Revision: 188350 >> : > URL: http://svn.freebsd.org/changeset/base/188350 >> : > >> : > Log: >> : > When bouncing pages, allow a new option to preserve the intra-page >> : > offset. This is needed for the ehci hardware buffer rings that >> : > assume >> : > this behavior. >> : >> : I thought we ended up with always doing that? >> : >> : Bounce buffers may or may not be used, so if the page offset >> : must be zero for bounce buffers, they must be zero for the >> : original DMA request. I see no value in re-aligning the DMA >> : request to a page boundary when bounce buffers are used, but >> : it is required in some cases to not realign. Hence, why not >> : always (and unconditionally) preserve the alignment? >> >> I'm not entirely sure either. However, at this stage of the game I'd >> rather be a little conservative in what we change and do a more >> careful and thorough analysis. > > Fair enough. > Busdma allows you to request bouncing for realignment. Unconditionally preserving the page offset when bouncing defeats this. Also, it has never preserved the offset. I have no idea if this was intentional or not. Scott From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 04:39:17 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F73A106566C; Mon, 9 Feb 2009 04:39:17 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F229E8FC16; Mon, 9 Feb 2009 04:39:16 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n194dG63045565; Mon, 9 Feb 2009 04:39:16 GMT (envelope-from weongyo@svn.freebsd.org) Received: (from weongyo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n194dGSK045564; Mon, 9 Feb 2009 04:39:16 GMT (envelope-from weongyo@svn.freebsd.org) Message-Id: <200902090439.n194dGSK045564@svn.freebsd.org> From: Weongyo Jeong Date: Mon, 9 Feb 2009 04:39:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188380 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Feb 2009 04:39:17 -0000 Author: weongyo Date: Mon Feb 9 04:39:16 2009 New Revision: 188380 URL: http://svn.freebsd.org/changeset/base/188380 Log: mark M_LASTFRAG at the last fragment. Reviewed by: sam MFC after: 3 weeks Modified: head/sys/net80211/ieee80211_output.c Modified: head/sys/net80211/ieee80211_output.c ============================================================================== --- head/sys/net80211/ieee80211_output.c Mon Feb 9 04:02:53 2009 (r188379) +++ head/sys/net80211/ieee80211_output.c Mon Feb 9 04:39:16 2009 (r188380) @@ -1376,6 +1376,9 @@ ieee80211_fragment(struct ieee80211vap * remainder -= payload; off += payload; } while (remainder != 0); + + /* set the last fragment */ + m->m_flags |= M_LASTFRAG; whf->i_fc[1] &= ~IEEE80211_FC1_MORE_FRAG; /* strip first mbuf now that everything has been copied */ From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 04:59:13 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6CD92106567A; Mon, 9 Feb 2009 04:59: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 5B7158FC12; Mon, 9 Feb 2009 04:59:13 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n194xDPm045929; Mon, 9 Feb 2009 04:59:13 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n194xDa3045928; Mon, 9 Feb 2009 04:59:13 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200902090459.n194xDa3045928@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 9 Feb 2009 04:59:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188381 - head/sys/dev/re X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Feb 2009 04:59:13 -0000 Author: yongari Date: Mon Feb 9 04:59:13 2009 New Revision: 188381 URL: http://svn.freebsd.org/changeset/base/188381 Log: Reclaim transmitted frames in re_tick(). This is for PCIe controllers that lose Tx completion interrupts under certain conditions. With this change it's safe to use MSI on PCIe controllers so enable MSI on these controllers. Modified: head/sys/dev/re/if_re.c Modified: head/sys/dev/re/if_re.c ============================================================================== --- head/sys/dev/re/if_re.c Mon Feb 9 04:39:16 2009 (r188380) +++ head/sys/dev/re/if_re.c Mon Feb 9 04:59:13 2009 (r188381) @@ -156,7 +156,7 @@ MODULE_DEPEND(re, miibus, 1, 1, 1); #include "miibus_if.h" /* Tunables. */ -static int msi_disable = 1; +static int msi_disable = 0; TUNABLE_INT("hw.re.msi_disable", &msi_disable); #define RE_CSUM_FEATURES (CSUM_IP | CSUM_TCP | CSUM_UDP) @@ -2064,6 +2064,13 @@ re_tick(void *xsc) mii_tick(mii); if ((sc->rl_flags & RL_FLAG_LINK) == 0) re_miibus_statchg(sc->rl_dev); + /* + * Reclaim transmitted frames here. Technically it is not + * necessary to do here but it ensures periodic reclamation + * regardless of Tx completion interrupt which seems to be + * lost on PCIe based controllers under certain situations. + */ + re_txeof(sc); re_watchdog(sc); callout_reset(&sc->rl_stat_callout, hz, re_tick, sc); } From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 05:09:52 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9F0D1106566B; Mon, 9 Feb 2009 05:09:52 +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 8D45E8FC17; Mon, 9 Feb 2009 05:09:52 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1959qL6046149; Mon, 9 Feb 2009 05:09:52 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1959qEV046148; Mon, 9 Feb 2009 05:09:52 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200902090509.n1959qEV046148@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 9 Feb 2009 05:09:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188382 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Feb 2009 05:09:53 -0000 Author: yongari Date: Mon Feb 9 05:09:52 2009 New Revision: 188382 URL: http://svn.freebsd.org/changeset/base/188382 Log: Document loader tunable hw.re.msi_disable. Bump .Dd Modified: head/share/man/man4/re.4 Modified: head/share/man/man4/re.4 ============================================================================== --- head/share/man/man4/re.4 Mon Feb 9 04:59:13 2009 (r188381) +++ head/share/man/man4/re.4 Mon Feb 9 05:09:52 2009 (r188382) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 14, 2006 +.Dd February 9, 2009 .Dt RE 4 .Os .Sh NAME @@ -169,6 +169,16 @@ USRobotics USR997902 Gigabit Ethernet (8 .It Xterasys XN-152 10/100/1000 NIC (8169) .El +.Sh LOADER TUNABLES +Tunables can be set at the +.Xr loader 8 +prompt before booting the kernel or stored in +.Xr loader.conf 5 . +.Bl -tag -width "xxxxxx" +.It Va hw.re.msi_disable +This tunable disables MSI support on the Ethernet hardware. +The default value is 0. +.El .Sh DIAGNOSTICS .Bl -diag .It "re%d: couldn't map memory" From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 05:37:55 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A5F1106564A; Mon, 9 Feb 2009 05:37:55 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout011.mac.com (asmtpout011.mac.com [17.148.16.86]) by mx1.freebsd.org (Postfix) with ESMTP id 70A928FC08; Mon, 9 Feb 2009 05:37:55 +0000 (UTC) (envelope-from xcllnt@mac.com) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=US-ASCII; format=flowed Received: from [192.168.4.253] (xcllnt.net [75.101.29.67]) by asmtp011.mac.com (Sun Java(tm) System Messaging Server 6.3-7.03 (built Aug 7 2008; 32bit)) with ESMTPSA id <0KES00CC2AB6U370@asmtp011.mac.com>; Sun, 08 Feb 2009 21:37:55 -0800 (PST) Message-id: <94616FBD-4638-4C51-990C-06A943B1BA2A@mac.com> From: Marcel Moolenaar To: Scott Long In-reply-to: <498F8015.8000704@samsco.org> Date: Sun, 08 Feb 2009 21:37:53 -0800 References: <200902082254.n18MsxVt037307@svn.freebsd.org> <9E40268E-A2E2-4CAA-AAFE-EB2491175CEE@mac.com> <20090208.170515.1031215309.imp@bsdimp.com> <34EFBA0C-FB99-42DB-BF5C-A889348AD393@mac.com> <498F8015.8000704@samsco.org> X-Mailer: Apple Mail (2.930.3) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, "M. Warner Losh" Subject: Re: svn commit: r188350 - in head/sys: amd64/amd64 arm/arm dev/usb2/core i386/i386 ia64/ia64 sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Feb 2009 05:37:56 -0000 On Feb 8, 2009, at 5:00 PM, Scott Long wrote: > Busdma allows you to request bouncing for realignment. How exactly? -- Marcel Moolenaar xcllnt@mac.com From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 06:23:21 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D64091065672; Mon, 9 Feb 2009 06:23:21 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C56208FC1B; Mon, 9 Feb 2009 06:23:21 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n196NLmo047519; Mon, 9 Feb 2009 06:23:21 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n196NLmL047518; Mon, 9 Feb 2009 06:23:21 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <200902090623.n196NLmL047518@svn.freebsd.org> From: Alan Cox Date: Mon, 9 Feb 2009 06:23:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188383 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Feb 2009 06:23:22 -0000 Author: alc Date: Mon Feb 9 06:23:21 2009 New Revision: 188383 URL: http://svn.freebsd.org/changeset/base/188383 Log: Avoid some cases of unnecessary page queues locking by vm_fault's delete- behind heuristic. Modified: head/sys/vm/vm_fault.c Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Mon Feb 9 05:09:52 2009 (r188382) +++ head/sys/vm/vm_fault.c Mon Feb 9 06:23:21 2009 (r188383) @@ -212,7 +212,7 @@ vm_fault(vm_map_t map, vm_offset_t vaddr { vm_prot_t prot; int is_first_object_locked, result; - boolean_t growstack, wired; + boolean_t are_queues_locked, growstack, wired; int map_generation; vm_object_t next_object; vm_page_t marray[VM_FAULT_READ]; @@ -480,7 +480,7 @@ readrest: else firstpindex = fs.first_pindex - 2 * VM_FAULT_READ; - vm_page_lock_queues(); + are_queues_locked = FALSE; /* * note: partially valid pages cannot be * included in the lookahead - NFS piecemeal @@ -495,8 +495,13 @@ readrest: if (mt == NULL || (mt->valid != VM_PAGE_BITS_ALL)) break; if (mt->busy || - (mt->oflags & VPO_BUSY) || - mt->hold_count || + (mt->oflags & VPO_BUSY)) + continue; + if (!are_queues_locked) { + are_queues_locked = TRUE; + vm_page_lock_queues(); + } + if (mt->hold_count || mt->wire_count) continue; pmap_remove_all(mt); @@ -506,7 +511,8 @@ readrest: vm_page_cache(mt); } } - vm_page_unlock_queues(); + if (are_queues_locked) + vm_page_unlock_queues(); ahead += behind; behind = 0; } From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 11:27:58 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B7481065C6B; Mon, 9 Feb 2009 11:27:58 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7F6578FC31; Mon, 9 Feb 2009 11:27:56 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n19BRujM058643; Mon, 9 Feb 2009 11:27:56 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n19BRuxi058642; Mon, 9 Feb 2009 11:27:56 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200902091127.n19BRuxi058642@svn.freebsd.org> From: Ed Schouten Date: Mon, 9 Feb 2009 11:27:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188385 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Feb 2009 11:28:07 -0000 Author: ed Date: Mon Feb 9 11:27:56 2009 New Revision: 188385 URL: http://svn.freebsd.org/changeset/base/188385 Log: Remove a stale comment from the clists code. We don't support quote bits. Modified: head/sys/kern/subr_clist.c Modified: head/sys/kern/subr_clist.c ============================================================================== --- head/sys/kern/subr_clist.c Mon Feb 9 10:28:16 2009 (r188384) +++ head/sys/kern/subr_clist.c Mon Feb 9 11:27:56 2009 (r188385) @@ -85,10 +85,6 @@ cblock_alloc_cblocks(int number) for (i = 0; i < number; ++i) { cbp = malloc(sizeof *cbp, M_CLIST, M_WAITOK); - /* - * Freed cblocks have zero quotes and garbage elsewhere. - * Set the may-have-quote bit to force zeroing the quotes. - */ cblock_free(cbp); } } From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 11:32:24 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1887C1065C3A; Mon, 9 Feb 2009 11:32:24 +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 F3A6B8FC2C; Mon, 9 Feb 2009 11:32:23 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n19BWNcu058764; Mon, 9 Feb 2009 11:32:23 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n19BWNdc058763; Mon, 9 Feb 2009 11:32:23 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200902091132.n19BWNdc058763@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 9 Feb 2009 11:32:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188386 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Feb 2009 11:32:28 -0000 Author: kib Date: Mon Feb 9 11:32:23 2009 New Revision: 188386 URL: http://svn.freebsd.org/changeset/base/188386 Log: Comment out the assertion from r188321. It is not valid for nfs. Reported by: alc Modified: head/sys/vm/vnode_pager.c Modified: head/sys/vm/vnode_pager.c ============================================================================== --- head/sys/vm/vnode_pager.c Mon Feb 9 11:27:56 2009 (r188385) +++ head/sys/vm/vnode_pager.c Mon Feb 9 11:32:23 2009 (r188386) @@ -365,7 +365,7 @@ vnode_pager_setsize(vp, nsize) if ((object = vp->v_object) == NULL) return; - ASSERT_VOP_ELOCKED(vp, "vnode_pager_setsize and not locked vnode"); +/* ASSERT_VOP_ELOCKED(vp, "vnode_pager_setsize and not locked vnode"); */ VM_OBJECT_LOCK(object); if (nsize == object->un_pager.vnp.vnp_size) { /* From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 11:41:54 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B0E7E10656C5; Mon, 9 Feb 2009 11:41:54 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9ECD18FC17; Mon, 9 Feb 2009 11:41:54 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n19BfsLC058987; Mon, 9 Feb 2009 11:41:54 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n19Bfsk5058986; Mon, 9 Feb 2009 11:41:54 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <200902091141.n19Bfsk5058986@svn.freebsd.org> From: Randall Stewart Date: Mon, 9 Feb 2009 11:41:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188387 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Feb 2009 11:41:57 -0000 Author: rrs Date: Mon Feb 9 11:41:54 2009 New Revision: 188387 URL: http://svn.freebsd.org/changeset/base/188387 Log: Fix INET only build breakage with SCTP - pointy hat to me :-) Modified: head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Mon Feb 9 11:32:23 2009 (r188386) +++ head/sys/netinet/sctputil.c Mon Feb 9 11:41:54 2009 (r188387) @@ -6550,7 +6550,9 @@ sctp_log_trace(uint32_t subsys, const ch #include #include #include +#ifdef INET6 #include +#endif static void sctp_recv_udp_tunneled_packet(struct mbuf *m, int off, struct inpcb *ignored) From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 11:42:23 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5CB6810657D8; Mon, 9 Feb 2009 11:42:23 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 49AA78FC20; Mon, 9 Feb 2009 11:42:23 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n19BgNML059033; Mon, 9 Feb 2009 11:42:23 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n19BgNnb059032; Mon, 9 Feb 2009 11:42:23 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <200902091142.n19BgNnb059032@svn.freebsd.org> From: Randall Stewart Date: Mon, 9 Feb 2009 11:42:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188388 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Feb 2009 11:42:26 -0000 Author: rrs Date: Mon Feb 9 11:42:23 2009 New Revision: 188388 URL: http://svn.freebsd.org/changeset/base/188388 Log: Fix minor spacing problem found by s9indent from last commit. Modified: head/sys/netinet/sctp_crc32.c Modified: head/sys/netinet/sctp_crc32.c ============================================================================== --- head/sys/netinet/sctp_crc32.c Mon Feb 9 11:41:54 2009 (r188387) +++ head/sys/netinet/sctp_crc32.c Mon Feb 9 11:42:23 2009 (r188388) @@ -729,10 +729,11 @@ sctp_finalize_crc32(uint32_t crc32c) #endif return (crc32c); } + #else uint32_t -update_crc32(uint32_t crc32c, unsigned char *buffer, unsigned int length) { - +update_crc32(uint32_t crc32c, unsigned char *buffer, unsigned int length) +{ return (0); } @@ -741,6 +742,7 @@ sctp_finalize_crc32(uint32_t crc32c) { return (0); } + #endif /* !defined(SCTP_WITH_NO_CSUM) */ #if defined(SCTP_WITH_NO_CSUM) From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 12:58:27 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E5AF51065672; Mon, 9 Feb 2009 12:58:27 +0000 (UTC) (envelope-from root@dchagin.static.corbina.ru) Received: from contrabass.post.ru (contrabass.post.ru [85.21.78.5]) by mx1.freebsd.org (Postfix) with ESMTP id 95C9C8FC12; Mon, 9 Feb 2009 12:58:27 +0000 (UTC) (envelope-from root@dchagin.static.corbina.ru) Received: from corbina.ru (mail.post.ru [195.14.50.16]) by contrabass.post.ru (Postfix) with ESMTP id 9DE1B53FE9; Mon, 9 Feb 2009 15:41:43 +0300 (MSK) X-Virus-Scanned: by cgpav Uf39PSi9pFi9oFi9 Received: from [10.208.17.3] (HELO dchagin.static.corbina.ru) by corbina.ru (CommuniGate Pro SMTP 5.1.14) with ESMTPS id 1614091631; Mon, 09 Feb 2009 15:41:43 +0300 Received: from dchagin.static.corbina.ru (localhost.chd.net [127.0.0.1]) by dchagin.static.corbina.ru (8.14.3/8.14.3) with ESMTP id n19CfhvW009917; Mon, 9 Feb 2009 15:41:43 +0300 (MSK) (envelope-from root@dchagin.static.corbina.ru) Received: (from root@localhost) by dchagin.static.corbina.ru (8.14.3/8.14.3/Submit) id n19CffW1009916; Mon, 9 Feb 2009 15:41:41 +0300 (MSK) (envelope-from root) Date: Mon, 9 Feb 2009 15:41:41 +0300 From: Chagin Dmitry To: Randall Stewart Message-ID: <20090209124141.GA2071@dchagin.static.corbina.ru> References: <200902091142.n19BgNnb059032@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200902091142.n19BgNnb059032@svn.freebsd.org> User-Agent: Mutt/1.5.18 (2008-05-17) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r188388 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Feb 2009 12:58:28 -0000 On Mon, Feb 09, 2009 at 11:42:23AM +0000, Randall Stewart wrote: > Author: rrs > Date: Mon Feb 9 11:42:23 2009 > New Revision: 188388 > URL: http://svn.freebsd.org/changeset/base/188388 > > Log: > Fix minor spacing problem found by s9indent from last > commit. > > Modified: > head/sys/netinet/sctp_crc32.c > > Modified: head/sys/netinet/sctp_crc32.c > ============================================================================== > --- head/sys/netinet/sctp_crc32.c Mon Feb 9 11:41:54 2009 (r188387) > +++ head/sys/netinet/sctp_crc32.c Mon Feb 9 11:42:23 2009 (r188388) > @@ -729,10 +729,11 @@ sctp_finalize_crc32(uint32_t crc32c) > #endif > return (crc32c); > } > + > #else > uint32_t > -update_crc32(uint32_t crc32c, unsigned char *buffer, unsigned int length) { > - > +update_crc32(uint32_t crc32c, unsigned char *buffer, unsigned int length) > +{ > return (0); > } > > @@ -741,6 +742,7 @@ sctp_finalize_crc32(uint32_t crc32c) > { > return (0); > } > + > #endif /* !defined(SCTP_WITH_NO_CSUM) */ > > #if defined(SCTP_WITH_NO_CSUM) What would you say about this? (I do not have SCTP option in the kernel config) linking kernel.debug alias_sctp.o(.text+0x1744): In function `TxAbortErrorM': /work/pub/head/sys/netinet/libalias/alias_sctp.c:946: undefined reference to `update_crc32' alias_sctp.o(.text+0x174b):/work/pub/head/sys/netinet/libalias/alias_sctp.c:946: undefined reference to `sctp_finalize_crc32' *** Error code 1 Stop in /tank/obj/work/pub/head/sys/YOY. *** Error code 1 -- Have fun! chd From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 13:15:08 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5478C1065673; Mon, 9 Feb 2009 13:15:08 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mail.cksoft.de (mail.cksoft.de [62.111.66.27]) by mx1.freebsd.org (Postfix) with ESMTP id 052BF8FC1D; Mon, 9 Feb 2009 13:15:07 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from localhost (amavis.str.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id 2928741C677; Mon, 9 Feb 2009 14:15:06 +0100 (CET) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([62.111.66.27]) by localhost (amavis.str.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id AY4UzMsn6aUA; Mon, 9 Feb 2009 14:15:05 +0100 (CET) Received: by mail.cksoft.de (Postfix, from userid 66) id AF01341C667; Mon, 9 Feb 2009 14:15:05 +0100 (CET) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id BD6B54448EC; Mon, 9 Feb 2009 13:10:30 +0000 (UTC) Date: Mon, 9 Feb 2009 13:10:30 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: Chagin Dmitry In-Reply-To: <20090209124141.GA2071@dchagin.static.corbina.ru> Message-ID: <20090209130910.C93725@maildrop.int.zabbadoz.net> References: <200902091142.n19BgNnb059032@svn.freebsd.org> <20090209124141.GA2071@dchagin.static.corbina.ru> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, Randall Stewart , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r188388 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Feb 2009 13:15:09 -0000 On Mon, 9 Feb 2009, Chagin Dmitry wrote: Hi, > What would you say about this? (I do not have SCTP option in the kernel config) > > linking kernel.debug > alias_sctp.o(.text+0x1744): In function `TxAbortErrorM': > /work/pub/head/sys/netinet/libalias/alias_sctp.c:946: undefined reference to `update_crc32' > alias_sctp.o(.text+0x174b):/work/pub/head/sys/netinet/libalias/alias_sctp.c:946: undefined reference to `sctp_finalize_crc32' > *** Error code 1 This is unrelated to this commit. This is a problem with piso's libalias commit; you have to remove that option from your kernel config as well if you remove SCTP. /bz -- Bjoern A. Zeeb The greatest risk is not taking one. From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 13:29:03 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 82557106567C; Mon, 9 Feb 2009 13:29:03 +0000 (UTC) (envelope-from mbr@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 706A18FC1A; Mon, 9 Feb 2009 13:29:03 +0000 (UTC) (envelope-from mbr@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n19DT21j061118; Mon, 9 Feb 2009 13:29:02 GMT (envelope-from mbr@svn.freebsd.org) Received: (from mbr@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n19DT2eH061117; Mon, 9 Feb 2009 13:29:02 GMT (envelope-from mbr@svn.freebsd.org) Message-Id: <200902091329.n19DT2eH061117@svn.freebsd.org> From: Martin Blapp Date: Mon, 9 Feb 2009 13:29:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188390 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Feb 2009 13:29:04 -0000 Author: mbr Date: Mon Feb 9 13:29:01 2009 New Revision: 188390 URL: http://svn.freebsd.org/changeset/base/188390 Log: s/SS_FDREF/SS_NOFDREF/ Modified: head/sys/kern/uipc_debug.c Modified: head/sys/kern/uipc_debug.c ============================================================================== --- head/sys/kern/uipc_debug.c Mon Feb 9 12:22:49 2009 (r188389) +++ head/sys/kern/uipc_debug.c Mon Feb 9 13:29:01 2009 (r188390) @@ -145,7 +145,7 @@ db_print_sostate(short so_state) comma = 0; if (so_state & SS_NOFDREF) { - db_printf("%sSS_FDREF", comma ? ", " : ""); + db_printf("%sSS_NOFDREF", comma ? ", " : ""); comma = 1; } if (so_state & SS_ISCONNECTED) { From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 13:37:37 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 48F2C106566B; Mon, 9 Feb 2009 13:37:37 +0000 (UTC) (envelope-from root@dchagin.static.corbina.ru) Received: from contrabass.post.ru (contrabass.post.ru [85.21.78.5]) by mx1.freebsd.org (Postfix) with ESMTP id EA38A8FC13; Mon, 9 Feb 2009 13:37:36 +0000 (UTC) (envelope-from root@dchagin.static.corbina.ru) Received: from corbina.ru (mail.post.ru [195.14.50.16]) by contrabass.post.ru (Postfix) with ESMTP id 1DBD954BE3; Mon, 9 Feb 2009 16:37:36 +0300 (MSK) X-Virus-Scanned: by cgpav Uf39PSi9pFi9oFi9 Received: from [10.208.17.3] (HELO dchagin.static.corbina.ru) by corbina.ru (CommuniGate Pro SMTP 5.1.14) with ESMTPS id 1614199340; Mon, 09 Feb 2009 16:37:36 +0300 Received: from dchagin.static.corbina.ru (localhost.chd.net [127.0.0.1]) by dchagin.static.corbina.ru (8.14.3/8.14.3) with ESMTP id n19DbZQ0034649; Mon, 9 Feb 2009 16:37:35 +0300 (MSK) (envelope-from root@dchagin.static.corbina.ru) Received: (from root@localhost) by dchagin.static.corbina.ru (8.14.3/8.14.3/Submit) id n19DbULW034648; Mon, 9 Feb 2009 16:37:30 +0300 (MSK) (envelope-from root) Date: Mon, 9 Feb 2009 16:37:30 +0300 From: Chagin Dmitry To: "Bjoern A. Zeeb" Message-ID: <20090209133730.GA34589@dchagin.static.corbina.ru> References: <200902091142.n19BgNnb059032@svn.freebsd.org> <20090209124141.GA2071@dchagin.static.corbina.ru> <20090209130910.C93725@maildrop.int.zabbadoz.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090209130910.C93725@maildrop.int.zabbadoz.net> User-Agent: Mutt/1.5.18 (2008-05-17) Cc: svn-src-head@freebsd.org, Randall Stewart , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r188388 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Feb 2009 13:37:37 -0000 On Mon, Feb 09, 2009 at 01:10:30PM +0000, Bjoern A. Zeeb wrote: > On Mon, 9 Feb 2009, Chagin Dmitry wrote: > > Hi, > > > What would you say about this? (I do not have SCTP option in the kernel config) > > > > linking kernel.debug > > alias_sctp.o(.text+0x1744): In function `TxAbortErrorM': > > /work/pub/head/sys/netinet/libalias/alias_sctp.c:946: undefined reference to `update_crc32' > > alias_sctp.o(.text+0x174b):/work/pub/head/sys/netinet/libalias/alias_sctp.c:946: undefined reference to `sctp_finalize_crc32' > > *** Error code 1 > > This is unrelated to this commit. > I know. I think that this is not better than the previous COMMIT. > This is a problem with piso's libalias commit; you have to remove that > option from your kernel config as well if you remove SCTP. > > /bz > why? linking kernel.debug ip_fw_nat.o(.text+0xbc): In function `ifaddr_change': /work/pub/head/sys/netinet/ip_fw_nat.c:103: undefined reference to `LibAliasSetAddress' ip_fw_nat.o(.text+0x545): In function `del_redir_spool_cfg': /work/pub/head/sys/netinet/ip_fw_nat.c:162: undefined reference to `LibAliasRedirectDelete' ip_fw_nat.o(.text+0x75b): In function `ipfw_nat_del': /work/pub/head/sys/netinet/ip_fw_nat.c:500: undefined reference to `LibAliasUninit' ip_fw_nat.o(.text+0x922): In function `ipfw_nat_cfg': /work/pub/head/sys/netinet/ip_fw_nat.c:464: undefined reference to `LibAliasSetMode' ip_fw_nat.o(.text+0x92f):/work/pub/head/sys/netinet/ip_fw_nat.c:465: undefined reference to `LibAliasSetAddress' ip_fw_nat.o(.text+0xab4):/work/pub/head/sys/netinet/ip_fw_nat.c:234: undefined reference to `LibAliasAddServer' ip_fw_nat.o(.text+0xbc4):/work/pub/head/sys/netinet/ip_fw_nat.c:198: undefined reference to `LibAliasRedirectAddr' ip_fw_nat.o(.text+0xbf0):/work/pub/head/sys/netinet/ip_fw_nat.c:218: undefined reference to `LibAliasRedirectProto' ip_fw_nat.o(.text+0xc6d):/work/pub/head/sys/netinet/ip_fw_nat.c:207: undefined reference to `LibAliasRedirectPort' ip_fw_nat.o(.text+0xcff):/work/pub/head/sys/netinet/ip_fw_nat.c:437: undefined reference to `LibAliasInit' ip_fw_nat.o(.text+0xeea): In function `ipfw_nat_modevent': -- Have fun! chd From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 13:56:04 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B1D9106566C; Mon, 9 Feb 2009 13:56:04 +0000 (UTC) (envelope-from p.pisati@oltrelinux.com) Received: from mail0.tomato.it (mail0.tomato.it [213.92.0.53]) by mx1.freebsd.org (Postfix) with SMTP id D4E4F8FC19; Mon, 9 Feb 2009 13:55:52 +0000 (UTC) (envelope-from p.pisati@oltrelinux.com) Received: from wlf.contactlab.it (unknown [172.16.7.101]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by mail0.tomato.it (Postfix) with ESMTPS id C216128432; Mon, 9 Feb 2009 14:46:35 +0100 (CET) Received: from ferret.tomato.lan (62.101.64.91) by wfl.contactlab.it (172.16.7.101) with Microsoft SMTP Server id 8.1.240.5; Mon, 9 Feb 2009 14:47:36 +0100 Message-ID: <4990334C.9040100@oltrelinux.com> Date: Mon, 9 Feb 2009 14:44:44 +0100 From: Paolo Pisati User-Agent: Thunderbird 2.0.0.16 (X11/20080815) MIME-Version: 1.0 To: Chagin Dmitry References: <200902091142.n19BgNnb059032@svn.freebsd.org> <20090209124141.GA2071@dchagin.static.corbina.ru> <20090209130910.C93725@maildrop.int.zabbadoz.net> <20090209133730.GA34589@dchagin.static.corbina.ru> In-Reply-To: <20090209133730.GA34589@dchagin.static.corbina.ru> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, "Bjoern A. Zeeb" , svn-src-all@freebsd.org, src-committers@freebsd.org, Randall Stewart Subject: Re: svn commit: r188388 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Feb 2009 13:56:04 -0000 Chagin Dmitry wrote: > > linking kernel.debug > ip_fw_nat.o(.text+0xbc): In function `ifaddr_change': > /work/pub/head/sys/netinet/ip_fw_nat.c:103: undefined reference to `LibAliasSetAddress' > ip_fw_nat.o(.text+0x545): In function `del_redir_spool_cfg': > /work/pub/head/sys/netinet/ip_fw_nat.c:162: undefined reference to `LibAliasRedirectDelete' > ip_fw_nat.o(.text+0x75b): In function `ipfw_nat_del': > /work/pub/head/sys/netinet/ip_fw_nat.c:500: undefined reference to `LibAliasUninit' > ip_fw_nat.o(.text+0x922): In function `ipfw_nat_cfg': > /work/pub/head/sys/netinet/ip_fw_nat.c:464: undefined reference to `LibAliasSetMode' > ip_fw_nat.o(.text+0x92f):/work/pub/head/sys/netinet/ip_fw_nat.c:465: undefined reference to `LibAliasSetAddress' > ip_fw_nat.o(.text+0xab4):/work/pub/head/sys/netinet/ip_fw_nat.c:234: undefined reference to `LibAliasAddServer' > ip_fw_nat.o(.text+0xbc4):/work/pub/head/sys/netinet/ip_fw_nat.c:198: undefined reference to `LibAliasRedirectAddr' > ip_fw_nat.o(.text+0xbf0):/work/pub/head/sys/netinet/ip_fw_nat.c:218: undefined reference to `LibAliasRedirectProto' > ip_fw_nat.o(.text+0xc6d):/work/pub/head/sys/netinet/ip_fw_nat.c:207: undefined reference to `LibAliasRedirectPort' > ip_fw_nat.o(.text+0xcff):/work/pub/head/sys/netinet/ip_fw_nat.c:437: undefined reference to `LibAliasInit' > ip_fw_nat.o(.text+0xeea): In function `ipfw_nat_modevent': > if you want IPFIREWALL_NAT, you need LIBALIAS. -- bye, P. From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 13:56:04 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0D3271065670; Mon, 9 Feb 2009 13:56:04 +0000 (UTC) (envelope-from p.pisati@oltrelinux.com) Received: from mail0.tomato.it (mail0.tomato.it [213.92.0.53]) by mx1.freebsd.org (Postfix) with SMTP id D867B8FC1A; Mon, 9 Feb 2009 13:55:52 +0000 (UTC) (envelope-from p.pisati@oltrelinux.com) Received: from wlf.contactlab.it (unknown [172.16.7.101]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by mail0.tomato.it (Postfix) with ESMTPS id 7F61128496; Mon, 9 Feb 2009 14:39:49 +0100 (CET) Received: from ferret.tomato.lan (62.101.64.91) by wfl.contactlab.it (172.16.7.101) with Microsoft SMTP Server id 8.1.240.5; Mon, 9 Feb 2009 14:40:50 +0100 Message-ID: <499031B6.3030600@oltrelinux.com> Date: Mon, 9 Feb 2009 14:37:58 +0100 From: Paolo Pisati User-Agent: Thunderbird 2.0.0.16 (X11/20080815) MIME-Version: 1.0 To: "Bjoern A. Zeeb" References: <200902091142.n19BgNnb059032@svn.freebsd.org> <20090209124141.GA2071@dchagin.static.corbina.ru> <20090209130910.C93725@maildrop.int.zabbadoz.net> In-Reply-To: <20090209130910.C93725@maildrop.int.zabbadoz.net> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, Randall Stewart , svn-src-all@freebsd.org, src-committers@freebsd.org, Chagin Dmitry Subject: Re: svn commit: r188388 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Feb 2009 13:56:05 -0000 Bjoern A. Zeeb wrote: > > This is unrelated to this commit. > > This is a problem with piso's libalias commit; you have to remove that > option from your kernel config as well if you remove SCTP. or in other words IPFIREWALL_NAT now requires SCTP. In case this dependence is felt like an impossible burden for someone, i'll do the usual pointer dance. -- bye, P. From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 14:31:45 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8DF98106568E; Mon, 9 Feb 2009 14:31:45 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.freebsd.org (Postfix) with ESMTP id 3D6A88FC1C; Mon, 9 Feb 2009 14:31:44 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from phobos.local ([192.168.254.200]) (authenticated bits=0) by pooker.samsco.org (8.14.2/8.14.2) with ESMTP id n19EVcfK047164; Mon, 9 Feb 2009 07:31:39 -0700 (MST) (envelope-from scottl@samsco.org) Message-ID: <49903E4A.8000408@samsco.org> Date: Mon, 09 Feb 2009 07:31:38 -0700 From: Scott Long User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.13) Gecko/20080313 SeaMonkey/1.1.9 MIME-Version: 1.0 To: Marcel Moolenaar References: <200902082254.n18MsxVt037307@svn.freebsd.org> <9E40268E-A2E2-4CAA-AAFE-EB2491175CEE@mac.com> <20090208.170515.1031215309.imp@bsdimp.com> <34EFBA0C-FB99-42DB-BF5C-A889348AD393@mac.com> <498F8015.8000704@samsco.org> <94616FBD-4638-4C51-990C-06A943B1BA2A@mac.com> In-Reply-To: <94616FBD-4638-4C51-990C-06A943B1BA2A@mac.com> X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=3.8 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.1.8 X-Spam-Checker-Version: SpamAssassin 3.1.8 (2007-02-13) on pooker.samsco.org Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, "M. Warner Losh" Subject: Re: svn commit: r188350 - in head/sys: amd64/amd64 arm/arm dev/usb2/core i386/i386 ia64/ia64 sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Feb 2009 14:31:46 -0000 Marcel Moolenaar wrote: > > On Feb 8, 2009, at 5:00 PM, Scott Long wrote: > >> Busdma allows you to request bouncing for realignment. > > How exactly? > By specifying an alignment greater than 1 in the tag. Scott From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 14:39:37 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9BED2106572A; Mon, 9 Feb 2009 14:39:37 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 666B68FC37; Mon, 9 Feb 2009 14:39:37 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (pool-98-109-39-197.nwrknj.fios.verizon.net [98.109.39.197]) by cyrus.watson.org (Postfix) with ESMTPSA id DBC4E46B03; Mon, 9 Feb 2009 09:39:36 -0500 (EST) Received: from localhost (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.14.3/8.14.3) with ESMTP id n19EdPWG004084; Mon, 9 Feb 2009 09:39:30 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: Marcel Moolenaar Date: Mon, 9 Feb 2009 09:23:45 -0500 User-Agent: KMail/1.9.7 References: <200902082254.n18MsxVt037307@svn.freebsd.org> <498F8015.8000704@samsco.org> <94616FBD-4638-4C51-990C-06A943B1BA2A@mac.com> In-Reply-To: <94616FBD-4638-4C51-990C-06A943B1BA2A@mac.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200902090923.45887.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Mon, 09 Feb 2009 09:39:30 -0500 (EST) X-Virus-Scanned: ClamAV 0.94.2/8967/Mon Feb 9 03:38:55 2009 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: svn-src-head@freebsd.org, Scott Long , src-committers@freebsd.org, svn-src-all@freebsd.org, "M. Warner Losh" Subject: Re: svn commit: r188350 - in head/sys: amd64/amd64 arm/arm dev/usb2/core i386/i386 ia64/ia64 sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Feb 2009 14:39:40 -0000 On Monday 09 February 2009 12:37:53 am Marcel Moolenaar wrote: > > On Feb 8, 2009, at 5:00 PM, Scott Long wrote: > > > Busdma allows you to request bouncing for realignment. > > How exactly? The 'align' parameter to bus_dma_tag_create(). If your hardware needs buffers to be aligned on a 4-byte boundary and you bus_dmamap_load() a buffer where 'addr % 4 != 0', then the buffer is bounced. Since by default the new buffer starts on a page boundary, it satifies the 'addr % 4'. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 15:53:13 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D14DC1065679 for ; Mon, 9 Feb 2009 15:53:13 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from mx0.deglitch.com (backbone.deglitch.com [IPv6:2001:16d8:fffb:4::abba]) by mx1.freebsd.org (Postfix) with ESMTP id 8262C8FC0C for ; Mon, 9 Feb 2009 15:53:13 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from DSPAM-Daemon (localhost [127.0.0.1]) by mx0.deglitch.com (Postfix) with SMTP id 8CBD98FC2D for ; Mon, 9 Feb 2009 18:53:12 +0300 (MSK) Received: from orion.SpringDaemons.com (drsun1.static.corbina.ru [85.21.245.235]) by mx0.deglitch.com (Postfix) with ESMTPA id 239228FC1D; Mon, 9 Feb 2009 18:53:10 +0300 (MSK) Received: from orion (localhost [127.0.0.1]) by orion.SpringDaemons.com (Postfix) with SMTP id 237833996E; Mon, 9 Feb 2009 18:53:31 +0300 (MSK) Date: Mon, 9 Feb 2009 18:53:26 +0300 From: Stanislav Sedov To: Warner Losh Message-Id: <20090209185326.7f92c449.stas@FreeBSD.org> In-Reply-To: <200902082254.n18MsxVt037307@svn.freebsd.org> References: <200902082254.n18MsxVt037307@svn.freebsd.org> Organization: The FreeBSD Project X-XMPP: ssedov@jabber.ru X-Voice: +7 916 849 20 23 X-PGP-Fingerprint: F21E D6CC 5626 9609 6CE2 A385 2BF5 5993 EB26 9581 X-Mailer: carrier-pigeon Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-DSPAM-Result: Whitelisted X-DSPAM-Processed: Mon Feb 9 18:53:12 2009 X-DSPAM-Confidence: 0.9899 X-DSPAM-Improbability: 1 in 9809 chance of being spam X-DSPAM-Probability: 0.0000 X-DSPAM-Signature: 49905168967001927946153 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r188350 - in head/sys: amd64/amd64 arm/arm dev/usb2/core i386/i386 ia64/ia64 sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Feb 2009 15:53:18 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Sun, 8 Feb 2009 22:54:58 +0000 (UTC) Warner Losh mentioned: > Universe builds with these changes. I don't have a huge-memory > machine to test these changes with, but will be happy to work with > folks that do and hps if this changes turns out not to be sufficient. > I can confirm that this fixes EHCI for me (well, I haven't tested this patch yet, but old version from hps did). - -- Stanislav Sedov ST4096-RIPE -----BEGIN PGP SIGNATURE----- iEYEARECAAYFAkmQUXsACgkQK/VZk+smlYF08ACfepUrJwHC3yWbkbE+9UejQAK9 wPsAn3CTxKlN8N+AiN2CBz8H+XMW2BOf =OQrg -----END PGP SIGNATURE----- !DSPAM:49905168967001927946153! From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 15:55:22 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 51FAF106564A; Mon, 9 Feb 2009 15:55:22 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4015C8FC17; Mon, 9 Feb 2009 15:55:22 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n19FtMwu064378; Mon, 9 Feb 2009 15:55:22 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n19FtMQC064375; Mon, 9 Feb 2009 15:55:22 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200902091555.n19FtMQC064375@svn.freebsd.org> From: Ed Schouten Date: Mon, 9 Feb 2009 15:55:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188391 - in head/sys/dev/syscons: . teken X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Feb 2009 15:55:22 -0000 Author: ed Date: Mon Feb 9 15:55:21 2009 New Revision: 188391 URL: http://svn.freebsd.org/changeset/base/188391 Log: Properly implement GIO_ATTR and CONS_GETINFO. It seems I didn't implement these two ioctl()'s properly, which meant vidcontrol couldn't properly obtain certain terminal parameters. Modified: head/sys/dev/syscons/scterm-teken.c head/sys/dev/syscons/teken/teken.c head/sys/dev/syscons/teken/teken.h Modified: head/sys/dev/syscons/scterm-teken.c ============================================================================== --- head/sys/dev/syscons/scterm-teken.c Mon Feb 9 13:29:01 2009 (r188390) +++ head/sys/dev/syscons/scterm-teken.c Mon Feb 9 15:55:21 2009 (r188391) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include static void scteken_revattr(unsigned char, teken_attr_t *); +static unsigned int scteken_attr(const teken_attr_t *); static sc_term_init_t scteken_init; static sc_term_term_t scteken_term; @@ -165,21 +166,25 @@ static int scteken_ioctl(scr_stat *scp, struct tty *tp, u_long cmd, caddr_t data, struct thread *td) { + teken_stat *ts = scp->ts; vid_info_t *vi; + unsigned int attr; switch (cmd) { case GIO_ATTR: /* get current attributes */ - *(int*)data = SC_NORM_ATTR; + *(int*)data = + scteken_attr(teken_get_curattr(&ts->ts_teken)); return (0); case CONS_GETINFO: /* get current (virtual) console info */ - /* XXX: INCORRECT! */ vi = (vid_info_t *)data; if (vi->size != sizeof(struct vid_info)) return EINVAL; - vi->mv_norm.fore = SC_NORM_ATTR & 0x0f; - vi->mv_norm.back = (SC_NORM_ATTR >> 4) & 0x0f; - vi->mv_rev.fore = SC_NORM_ATTR & 0x0f; - vi->mv_rev.back = (SC_NORM_ATTR >> 4) & 0x0f; + + attr = scteken_attr(teken_get_defattr(&ts->ts_teken)); + vi->mv_norm.fore = attr & 0x0f; + vi->mv_norm.back = (attr >> 4) & 0x0f; + vi->mv_rev.fore = vi->mv_norm.back; + vi->mv_rev.back = vi->mv_norm.fore; /* * The other fields are filled by the upper routine. XXX */ @@ -280,7 +285,7 @@ scteken_revattr(unsigned char color, tek } } -static inline unsigned int +static unsigned int scteken_attr(const teken_attr_t *a) { unsigned int attr = 0; @@ -300,7 +305,7 @@ scteken_attr(const teken_attr_t *a) attr |= FG_BLINK; #endif /* FG_BLINK */ - return (attr << 8); + return (attr); } static void @@ -337,7 +342,7 @@ scteken_putchar(void *arg, const teken_p } else #endif /* TEKEN_UTF8 */ { - attr = scteken_attr(a); + attr = scteken_attr(a) << 8; ch = c; } @@ -373,7 +378,7 @@ scteken_fill(void *arg, const teken_rect } else #endif /* TEKEN_UTF8 */ { - attr = scteken_attr(a); + attr = scteken_attr(a) << 8; ch = c; } Modified: head/sys/dev/syscons/teken/teken.c ============================================================================== --- head/sys/dev/syscons/teken/teken.c Mon Feb 9 13:29:01 2009 (r188390) +++ head/sys/dev/syscons/teken/teken.c Mon Feb 9 15:55:21 2009 (r188391) @@ -329,6 +329,20 @@ teken_set_cursor(teken_t *t, const teken t->t_cursor = *p; } +const teken_attr_t * +teken_get_curattr(teken_t *t) +{ + + return (&t->t_curattr); +} + +const teken_attr_t * +teken_get_defattr(teken_t *t) +{ + + return (&t->t_defattr); +} + void teken_set_defattr(teken_t *t, const teken_attr_t *a) { Modified: head/sys/dev/syscons/teken/teken.h ============================================================================== --- head/sys/dev/syscons/teken/teken.h Mon Feb 9 13:29:01 2009 (r188390) +++ head/sys/dev/syscons/teken/teken.h Mon Feb 9 15:55:21 2009 (r188391) @@ -170,7 +170,9 @@ void teken_init(teken_t *, const teken_f /* Deliver character input. */ void teken_input(teken_t *, const void *, size_t); -/* Set teken attributes. */ +/* Get/set teken attributes. */ +const teken_attr_t *teken_get_curattr(teken_t *); +const teken_attr_t *teken_get_defattr(teken_t *); void teken_set_cursor(teken_t *, const teken_pos_t *); void teken_set_defattr(teken_t *, const teken_attr_t *); void teken_set_winsize(teken_t *, const teken_pos_t *); From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 16:03:41 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 412151065670; Mon, 9 Feb 2009 16:03:41 +0000 (UTC) (envelope-from rrs@lakerest.net) Received: from lakerest.net (unknown [IPv6:2001:240:585:2:203:6dff:fe1a:4ddc]) by mx1.freebsd.org (Postfix) with ESMTP id BB3EA8FC19; Mon, 9 Feb 2009 16:03:40 +0000 (UTC) (envelope-from rrs@lakerest.net) Received: from [10.1.1.53] ([10.1.1.53]) (authenticated bits=0) by lakerest.net (8.14.3/8.14.3) with ESMTP id n19G3m9x042646 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Mon, 9 Feb 2009 11:03:48 -0500 (EST) (envelope-from rrs@lakerest.net) DKIM-Signature: a=rsa-sha1; c=simple/simple; d=lakerest.net; s=mail; t=1234195429; h=Cc:Message-Id:From:To:In-Reply-To:Content-Type: Content-Transfer-Encoding:Mime-Version:Subject:Date:References: X-Mailer; b=Ce2pTUjd8RBs4iUtWKPRfoA2W5AUcSA1Ksl2Zm9AeyIcvU9SGSJhl6r KCEnLYt8ArZ5Ve5M8wBS8qPgiiN22OA== Message-Id: <32F47187-B1D5-4EE3-A1ED-0FE4CD5998AC@lakerest.net> From: Randall Stewart To: Chagin Dmitry , Paolo Pisati In-Reply-To: <20090209124141.GA2071@dchagin.static.corbina.ru> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v930.3) Date: Mon, 9 Feb 2009 11:03:38 -0500 References: <200902091142.n19BgNnb059032@svn.freebsd.org> <20090209124141.GA2071@dchagin.static.corbina.ru> X-Mailer: Apple Mail (2.930.3) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r188388 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Feb 2009 16:03:42 -0000 Hmm.. My guess is it has to do with the NAT stuff that Paolo is working on. Basically the ipfw/nat is becoming SCTP aware and I believe we made the sctp_crc32c routines public so that he could access them. Paolo: maybe you need to include and then do some sort of #ifdef SCTP #endif Around the csum calls int crc32?? R On Feb 9, 2009, at 7:41 AM, Chagin Dmitry wrote: > On Mon, Feb 09, 2009 at 11:42:23AM +0000, Randall Stewart wrote: >> Author: rrs >> Date: Mon Feb 9 11:42:23 2009 >> New Revision: 188388 >> URL: http://svn.freebsd.org/changeset/base/188388 >> >> Log: >> Fix minor spacing problem found by s9indent from last >> commit. >> >> Modified: >> head/sys/netinet/sctp_crc32.c >> >> Modified: head/sys/netinet/sctp_crc32.c >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- head/sys/netinet/sctp_crc32.c Mon Feb 9 11:41:54 2009 (r188387) >> +++ head/sys/netinet/sctp_crc32.c Mon Feb 9 11:42:23 2009 (r188388) >> @@ -729,10 +729,11 @@ sctp_finalize_crc32(uint32_t crc32c) >> #endif >> return (crc32c); >> } >> + >> #else >> uint32_t >> -update_crc32(uint32_t crc32c, unsigned char *buffer, unsigned int >> length) { >> - >> +update_crc32(uint32_t crc32c, unsigned char *buffer, unsigned int >> length) >> +{ >> return (0); >> } >> >> @@ -741,6 +742,7 @@ sctp_finalize_crc32(uint32_t crc32c) >> { >> return (0); >> } >> + >> #endif /* !defined(SCTP_WITH_NO_CSUM) */ >> >> #if defined(SCTP_WITH_NO_CSUM) > > > What would you say about this? (I do not have SCTP option in the > kernel config) > > linking kernel.debug > alias_sctp.o(.text+0x1744): In function `TxAbortErrorM': > /work/pub/head/sys/netinet/libalias/alias_sctp.c:946: undefined > reference to `update_crc32' > alias_sctp.o(.text+0x174b):/work/pub/head/sys/netinet/libalias/ > alias_sctp.c:946: undefined reference to `sctp_finalize_crc32' > *** Error code 1 > > Stop in /tank/obj/work/pub/head/sys/YOY. > *** Error code 1 > > > -- > Have fun! > chd > ------------------------------ Randall Stewart 803-317-4952 (cell) 803-345-0391(direct) From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 16:53:37 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B75031065675; Mon, 9 Feb 2009 16:53:37 +0000 (UTC) (envelope-from fjoe@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A679A8FC17; Mon, 9 Feb 2009 16:53:37 +0000 (UTC) (envelope-from fjoe@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n19GrbXs065500; Mon, 9 Feb 2009 16:53:37 GMT (envelope-from fjoe@svn.freebsd.org) Received: (from fjoe@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n19GrbIB065499; Mon, 9 Feb 2009 16:53:37 GMT (envelope-from fjoe@svn.freebsd.org) Message-Id: <200902091653.n19GrbIB065499@svn.freebsd.org> From: Max Khon Date: Mon, 9 Feb 2009 16:53:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188392 - head/sys/pci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Feb 2009 16:53:38 -0000 Author: fjoe Date: Mon Feb 9 16:53:37 2009 New Revision: 188392 URL: http://svn.freebsd.org/changeset/base/188392 Log: Destroy TX tag outside of loop scope. Found with: Coverity Prevent(tm) CID: 3886 Modified: head/sys/pci/if_rl.c Modified: head/sys/pci/if_rl.c ============================================================================== --- head/sys/pci/if_rl.c Mon Feb 9 15:55:21 2009 (r188391) +++ head/sys/pci/if_rl.c Mon Feb 9 16:53:37 2009 (r188392) @@ -1151,9 +1151,9 @@ rl_dma_free(struct rl_softc *sc) sc->rl_cdata.rl_tx_dmamap[i]); sc->rl_cdata.rl_tx_dmamap[i] = NULL; } + } bus_dma_tag_destroy(sc->rl_cdata.rl_tx_tag); sc->rl_cdata.rl_tx_tag = NULL; - } } if (sc->rl_parent_tag != NULL) { From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 16:57:07 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A90EC1065789; Mon, 9 Feb 2009 16:57:07 +0000 (UTC) (envelope-from fjoe@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 96C9D8FC1C; Mon, 9 Feb 2009 16:57:07 +0000 (UTC) (envelope-from fjoe@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n19Gv7X5065624; Mon, 9 Feb 2009 16:57:07 GMT (envelope-from fjoe@svn.freebsd.org) Received: (from fjoe@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n19Gv7sY065623; Mon, 9 Feb 2009 16:57:07 GMT (envelope-from fjoe@svn.freebsd.org) Message-Id: <200902091657.n19Gv7sY065623@svn.freebsd.org> From: Max Khon Date: Mon, 9 Feb 2009 16:57:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188393 - head/sys/dev/firewire X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Feb 2009 16:57:09 -0000 Author: fjoe Date: Mon Feb 9 16:57:07 2009 New Revision: 188393 URL: http://svn.freebsd.org/changeset/base/188393 Log: Remove unused variable. Found with: Coverity Prevent(tm) CID: 3693 Modified: head/sys/dev/firewire/sbp.c Modified: head/sys/dev/firewire/sbp.c ============================================================================== --- head/sys/dev/firewire/sbp.c Mon Feb 9 16:53:37 2009 (r188392) +++ head/sys/dev/firewire/sbp.c Mon Feb 9 16:57:07 2009 (r188393) @@ -330,12 +330,11 @@ static char *orb_status1_serial_bus_erro static void sbp_identify(driver_t *driver, device_t parent) { - device_t child; SBP_DEBUG(0) printf("sbp_identify\n"); END_DEBUG - child = BUS_ADD_CHILD(parent, 0, "sbp", device_get_unit(parent)); + BUS_ADD_CHILD(parent, 0, "sbp", device_get_unit(parent)); } /* From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 16:58:18 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C01210657AD; Mon, 9 Feb 2009 16:58:18 +0000 (UTC) (envelope-from fjoe@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 767A48FC25; Mon, 9 Feb 2009 16:58:18 +0000 (UTC) (envelope-from fjoe@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n19GwIDJ065680; Mon, 9 Feb 2009 16:58:18 GMT (envelope-from fjoe@svn.freebsd.org) Received: (from fjoe@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n19GwIOk065678; Mon, 9 Feb 2009 16:58:18 GMT (envelope-from fjoe@svn.freebsd.org) Message-Id: <200902091658.n19GwIOk065678@svn.freebsd.org> From: Max Khon Date: Mon, 9 Feb 2009 16:58:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188394 - head/sys/dev/firewire X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Feb 2009 16:58:21 -0000 Author: fjoe Date: Mon Feb 9 16:58:18 2009 New Revision: 188394 URL: http://svn.freebsd.org/changeset/base/188394 Log: Do not self-initialize a variable. Found with: Coverity Prevent(tm) CID: 3864, 3865 Modified: head/sys/dev/firewire/if_fwe.c head/sys/dev/firewire/if_fwip.c Modified: head/sys/dev/firewire/if_fwe.c ============================================================================== --- head/sys/dev/firewire/if_fwe.c Mon Feb 9 16:57:07 2009 (r188393) +++ head/sys/dev/firewire/if_fwe.c Mon Feb 9 16:58:18 2009 (r188394) @@ -445,7 +445,7 @@ fwe_ioctl(struct ifnet *ifp, u_long cmd, #ifdef DEVICE_POLLING { struct ifreq *ifr = (struct ifreq *) data; - struct firewire_comm *fc = fc = fwe->fd.fc; + struct firewire_comm *fc = fwe->fd.fc; if (ifr->ifr_reqcap & IFCAP_POLLING && !(ifp->if_capenable & IFCAP_POLLING)) { Modified: head/sys/dev/firewire/if_fwip.c ============================================================================== --- head/sys/dev/firewire/if_fwip.c Mon Feb 9 16:57:07 2009 (r188393) +++ head/sys/dev/firewire/if_fwip.c Mon Feb 9 16:58:18 2009 (r188394) @@ -427,7 +427,7 @@ fwip_ioctl(struct ifnet *ifp, u_long cmd #ifdef DEVICE_POLLING { struct ifreq *ifr = (struct ifreq *) data; - struct firewire_comm *fc = fc = fwip->fd.fc; + struct firewire_comm *fc = fwip->fd.fc; if (ifr->ifr_reqcap & IFCAP_POLLING && !(ifp->if_capenable & IFCAP_POLLING)) { From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 17:02:34 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 758E1106566C; Mon, 9 Feb 2009 17:02:34 +0000 (UTC) (envelope-from gary.jennejohn@freenet.de) Received: from mout1.freenet.de (mout1.freenet.de [IPv6:2001:748:100:40::2:3]) by mx1.freebsd.org (Postfix) with ESMTP id 0851B8FC14; Mon, 9 Feb 2009 17:02:34 +0000 (UTC) (envelope-from gary.jennejohn@freenet.de) Received: from [195.4.92.23] (helo=13.mx.freenet.de) by mout1.freenet.de with esmtpa (ID gary.jennejohn@freenet.de) (port 25) (Exim 4.69 #76) id 1LWZWi-0001J6-FO; Mon, 09 Feb 2009 18:02:32 +0100 Received: from ta904.t.pppool.de ([89.55.169.4]:50567 helo=ernst.jennejohn.org) by 13.mx.freenet.de with esmtpa (ID gary.jennejohn@freenet.de) (port 25) (Exim 4.69 #76) id 1LWZWi-0003Wv-5o; Mon, 09 Feb 2009 18:02:32 +0100 Date: Mon, 9 Feb 2009 18:02:30 +0100 From: Gary Jennejohn To: Warner Losh Message-ID: <20090209180230.66841d6e@ernst.jennejohn.org> In-Reply-To: <200902082254.n18MsxVt037307@svn.freebsd.org> References: <200902082254.n18MsxVt037307@svn.freebsd.org> X-Mailer: Claws Mail 3.7.0 (GTK+ 2.14.7; amd64-portbld-freebsd8.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r188350 - in head/sys: amd64/amd64 arm/arm dev/usb2/core i386/i386 ia64/ia64 sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: gary.jennejohn@freenet.de List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Feb 2009 17:02:35 -0000 On Sun, 8 Feb 2009 22:54:58 +0000 (UTC) Warner Losh wrote: > Author: imp > Date: Sun Feb 8 22:54:58 2009 > New Revision: 188350 > URL: http://svn.freebsd.org/changeset/base/188350 > > Log: > When bouncing pages, allow a new option to preserve the intra-page > offset. This is needed for the ehci hardware buffer rings that assume > this behavior. > [big snip] This fixes things for me with AMD64 and 6GB of RAM. Thanks! --- Gary Jennejohn From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 17:02:54 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 71EF01065688; Mon, 9 Feb 2009 17:02:54 +0000 (UTC) (envelope-from fjoe@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 618CB8FC20; Mon, 9 Feb 2009 17:02:54 +0000 (UTC) (envelope-from fjoe@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n19H2sUH065876; Mon, 9 Feb 2009 17:02:54 GMT (envelope-from fjoe@svn.freebsd.org) Received: (from fjoe@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n19H2sdt065875; Mon, 9 Feb 2009 17:02:54 GMT (envelope-from fjoe@svn.freebsd.org) Message-Id: <200902091702.n19H2sdt065875@svn.freebsd.org> From: Max Khon Date: Mon, 9 Feb 2009 17:02:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188395 - head/sys/cam X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Feb 2009 17:02:54 -0000 Author: fjoe Date: Mon Feb 9 17:02:54 2009 New Revision: 188395 URL: http://svn.freebsd.org/changeset/base/188395 Log: cam_periph_alloc: fix "invalid periph name" error condition Found with: Coverity Prevent(tm) CID: 130 Modified: head/sys/cam/cam_periph.c Modified: head/sys/cam/cam_periph.c ============================================================================== --- head/sys/cam/cam_periph.c Mon Feb 9 16:58:18 2009 (r188394) +++ head/sys/cam/cam_periph.c Mon Feb 9 17:02:54 2009 (r188395) @@ -171,7 +171,7 @@ cam_periph_alloc(periph_ctor_t *periph_c break; } xpt_unlock_buses(); - if (p_drv == NULL) { + if (*p_drv == NULL) { printf("cam_periph_alloc: invalid periph name '%s'\n", name); return (CAM_REQ_INVALID); } From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 17:07:30 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 015631065678; Mon, 9 Feb 2009 17:07:30 +0000 (UTC) (envelope-from fjoe@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E4B8A8FC24; Mon, 9 Feb 2009 17:07:29 +0000 (UTC) (envelope-from fjoe@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n19H7TiD066042; Mon, 9 Feb 2009 17:07:29 GMT (envelope-from fjoe@svn.freebsd.org) Received: (from fjoe@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n19H7T64066041; Mon, 9 Feb 2009 17:07:29 GMT (envelope-from fjoe@svn.freebsd.org) Message-Id: <200902091707.n19H7T64066041@svn.freebsd.org> From: Max Khon Date: Mon, 9 Feb 2009 17:07:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188396 - head/sys/dev/de X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Feb 2009 17:07:30 -0000 Author: fjoe Date: Mon Feb 9 17:07:29 2009 New Revision: 188396 URL: http://svn.freebsd.org/changeset/base/188396 Log: tulip_busdma_cleanup: pass correct vaddr (2nd arg) to bus_dmamem_free() Found with: Coverity Prevent(tm) CID: 1998 Modified: head/sys/dev/de/if_de.c Modified: head/sys/dev/de/if_de.c ============================================================================== --- head/sys/dev/de/if_de.c Mon Feb 9 17:02:54 2009 (r188395) +++ head/sys/dev/de/if_de.c Mon Feb 9 17:07:29 2009 (r188396) @@ -4561,7 +4561,7 @@ tulip_busdma_cleanup(tulip_softc_t * con sc->tulip_setup_dma_addr = 0; } if (sc->tulip_setupbuf != NULL) { - bus_dmamem_free(sc->tulip_setup_tag, sc->tulip_setupdata, + bus_dmamem_free(sc->tulip_setup_tag, sc->tulip_setupbuf, sc->tulip_setup_map); sc->tulip_setup_map = NULL; sc->tulip_setupbuf = NULL; From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 17:10:58 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 99FA51065676; Mon, 9 Feb 2009 17:10:58 +0000 (UTC) (envelope-from gary.jennejohn@freenet.de) Received: from mout1.freenet.de (mout1.freenet.de [IPv6:2001:748:100:40::2:3]) by mx1.freebsd.org (Postfix) with ESMTP id 58BC48FC18; Mon, 9 Feb 2009 17:10:58 +0000 (UTC) (envelope-from gary.jennejohn@freenet.de) Received: from [195.4.92.16] (helo=6.mx.freenet.de) by mout1.freenet.de with esmtpa (ID gary.jennejohn@freenet.de) (port 25) (Exim 4.69 #76) id 1LWZer-0002tG-Nq; Mon, 09 Feb 2009 18:10:57 +0100 Received: from ta904.t.pppool.de ([89.55.169.4]:45645 helo=ernst.jennejohn.org) by 6.mx.freenet.de with esmtpa (ID gary.jennejohn@freenet.de) (port 25) (Exim 4.69 #76) id 1LWZer-0002Ds-FM; Mon, 09 Feb 2009 18:10:57 +0100 Date: Mon, 9 Feb 2009 18:10:56 +0100 From: Gary Jennejohn To: Pyun YongHyeon Message-ID: <20090209181056.40db0ba2@ernst.jennejohn.org> In-Reply-To: <200902090459.n194xDa3045928@svn.freebsd.org> References: <200902090459.n194xDa3045928@svn.freebsd.org> X-Mailer: Claws Mail 3.7.0 (GTK+ 2.14.7; amd64-portbld-freebsd8.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r188381 - head/sys/dev/re X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: gary.jennejohn@freenet.de List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Feb 2009 17:11:00 -0000 On Mon, 9 Feb 2009 04:59:13 +0000 (UTC) Pyun YongHyeon wrote: > Author: yongari > Date: Mon Feb 9 04:59:13 2009 > New Revision: 188381 > URL: http://svn.freebsd.org/changeset/base/188381 > > Log: > Reclaim transmitted frames in re_tick(). This is for PCIe > controllers that lose Tx completion interrupts under certain > conditions. With this change it's safe to use MSI on PCIe > controllers so enable MSI on these controllers. > > Modified: > head/sys/dev/re/if_re.c > This does not work with my re(4). When I allow MSI it never transmits. I noticed this while booting when the sendmail startup hung. A test with ping(8) showed that there was no output (or maybe no input, hard to tell with ping). Here dmesg output when it fails: re0: port 0xde00-0xdeff mem 0xfdaff000-0xfdafffff,0xfdae0000-0xfdaeffff irq 18 at device 0.0 on pci2 re0: Using 2 MSI messages re0: Chip rev. 0x3c000000 re0: MAC rev. 0x00400000 re0: Ethernet address: 00:1f:d0:8f:5a:43 re0: [FILTER] re0: [FILTER] re0: link state changed to UP Here dmesg output when it succeeds: re0: port 0xde00-0xdeff mem 0xfdaff000-0xfdafffff,0xfdae0000-0xfdaeffff irq 18 at device 0.0 on pci2 re0: turning off MSI enable bit. re0: Chip rev. 0x3c000000 re0: MAC rev. 0x00400000 re0: Ethernet address: 00:1f:d0:8f:5a:43 re0: [FILTER] re0: link state changed to UP And here pciconf output: re0@pci0:2:0:0: class=0x020000 card=0xe0001458 chip=0x816810ec rev=0x02 hdr=0x00 vendor = 'Realtek Semiconductor' device = 'RTL8168/8111 PCI-E Gigabit Ethernet NIC' class = network subclass = ethernet --- Gary Jennejohn From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 17:37:17 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5EDC8106564A; Mon, 9 Feb 2009 17:37:17 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4E1998FC1C; Mon, 9 Feb 2009 17:37:17 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n19HbHoQ066667; Mon, 9 Feb 2009 17:37:17 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n19HbH8i066666; Mon, 9 Feb 2009 17:37:17 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <200902091737.n19HbH8i066666@svn.freebsd.org> From: Randall Stewart Date: Mon, 9 Feb 2009 17:37:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188398 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Feb 2009 17:37:17 -0000 Author: rrs Date: Mon Feb 9 17:37:17 2009 New Revision: 188398 URL: http://svn.freebsd.org/changeset/base/188398 Log: Add padding to then end of the xsctp_xxx structures to allow future changes to be able to maintain ABI compatibility Modified: head/sys/netinet/sctp_uio.h Modified: head/sys/netinet/sctp_uio.h ============================================================================== --- head/sys/netinet/sctp_uio.h Mon Feb 9 17:14:49 2009 (r188397) +++ head/sys/netinet/sctp_uio.h Mon Feb 9 17:37:17 2009 (r188398) @@ -987,6 +987,7 @@ struct xsctp_inpcb { uint16_t local_port; uint16_t qlen; uint16_t maxqlen; + uint32_t extra_padding[8]; /* future */ }; struct xsctp_tcb { @@ -1017,12 +1018,14 @@ struct xsctp_tcb { struct sctp_timeval start_time; /* sctpAssocEntry 16 */ struct sctp_timeval discontinuity_time; /* sctpAssocEntry 17 */ sctp_assoc_t assoc_id; /* sctpAssocEntry 1 */ + uint32_t extra_padding[8]; /* future */ }; struct xsctp_laddr { union sctp_sockstore address; /* sctpAssocLocalAddrEntry 1/2 */ uint32_t last; struct sctp_timeval start_time; /* sctpAssocLocalAddrEntry 3 */ + uint32_t extra_padding[8]; /* future */ }; struct xsctp_raddr { @@ -1039,6 +1042,7 @@ struct xsctp_raddr { uint8_t confirmed; /* */ uint8_t heartbeat_enabled; /* sctpAssocLocalRemEntry 4 */ struct sctp_timeval start_time; /* sctpAssocLocalRemEntry 8 */ + uint32_t extra_padding[8]; /* future */ }; #define SCTP_MAX_LOGGING_SIZE 30000 From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 17:48:58 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2369A106566C; Mon, 9 Feb 2009 17:48:58 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout011.mac.com (asmtpout011.mac.com [17.148.16.86]) by mx1.freebsd.org (Postfix) with ESMTP id 08A4B8FC21; Mon, 9 Feb 2009 17:48:57 +0000 (UTC) (envelope-from xcllnt@mac.com) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=US-ASCII; format=flowed Received: from macbook-pro.jnpr.net (natint3.juniper.net [66.129.224.36]) by asmtp011.mac.com (Sun Java(tm) System Messaging Server 6.3-7.03 (built Aug 7 2008; 32bit)) with ESMTPSA id <0KET00KE285K0S00@asmtp011.mac.com>; Mon, 09 Feb 2009 09:48:57 -0800 (PST) Message-id: <859425A6-0F8F-4DE5-9229-4119A1009AD2@mac.com> From: Marcel Moolenaar To: Scott Long In-reply-to: <49903E4A.8000408@samsco.org> Date: Mon, 09 Feb 2009 09:48:54 -0800 References: <200902082254.n18MsxVt037307@svn.freebsd.org> <9E40268E-A2E2-4CAA-AAFE-EB2491175CEE@mac.com> <20090208.170515.1031215309.imp@bsdimp.com> <34EFBA0C-FB99-42DB-BF5C-A889348AD393@mac.com> <498F8015.8000704@samsco.org> <94616FBD-4638-4C51-990C-06A943B1BA2A@mac.com> <49903E4A.8000408@samsco.org> X-Mailer: Apple Mail (2.930.3) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, "M. Warner Losh" Subject: Re: svn commit: r188350 - in head/sys: amd64/amd64 arm/arm dev/usb2/core i386/i386 ia64/ia64 sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Feb 2009 17:48:59 -0000 On Feb 9, 2009, at 6:31 AM, Scott Long wrote: > Marcel Moolenaar wrote: >> On Feb 8, 2009, at 5:00 PM, Scott Long wrote: >>> Busdma allows you to request bouncing for realignment. >> How exactly? > > By specifying an alignment greater than 1 in the tag. This does not guarantee bounce buffering and without bounce buffering you don't have realignment. -- Marcel Moolenaar xcllnt@mac.com From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 17:51:53 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F33D106566B; Mon, 9 Feb 2009 17:51:53 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout020.mac.com (asmtpout020.mac.com [17.148.16.95]) by mx1.freebsd.org (Postfix) with ESMTP id 64EEE8FC0A; Mon, 9 Feb 2009 17:51:53 +0000 (UTC) (envelope-from xcllnt@mac.com) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Received: from rajreddy-lnx.jnpr.net (natint3.juniper.net [66.129.224.36]) by asmtp020.mac.com (Sun Java(tm) System Messaging Server 6.3-7.03 (built Aug 7 2008; 32bit)) with ESMTPSA id <0KET007VS89UH380@asmtp020.mac.com>; Mon, 09 Feb 2009 09:51:34 -0800 (PST) Message-id: <2EA5FEEB-E676-4D1B-9700-399C783F4590@mac.com> From: Marcel Moolenaar To: John Baldwin In-reply-to: <200902090923.45887.jhb@freebsd.org> Date: Mon, 09 Feb 2009 09:51:28 -0800 References: <200902082254.n18MsxVt037307@svn.freebsd.org> <498F8015.8000704@samsco.org> <94616FBD-4638-4C51-990C-06A943B1BA2A@mac.com> <200902090923.45887.jhb@freebsd.org> X-Mailer: Apple Mail (2.930.3) Cc: svn-src-head@freebsd.org, Scott Long , src-committers@freebsd.org, svn-src-all@freebsd.org, "M. Warner Losh" Subject: Re: svn commit: r188350 - in head/sys: amd64/amd64 arm/arm dev/usb2/core i386/i386 ia64/ia64 sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Feb 2009 17:51:54 -0000 On Feb 9, 2009, at 6:23 AM, John Baldwin wrote: > On Monday 09 February 2009 12:37:53 am Marcel Moolenaar wrote: >> >> On Feb 8, 2009, at 5:00 PM, Scott Long wrote: >> >>> Busdma allows you to request bouncing for realignment. >> >> How exactly? > > The 'align' parameter to bus_dma_tag_create(). If your hardware > needs buffers > to be aligned on a 4-byte boundary and you bus_dmamap_load() a buffer > where 'addr % 4 != 0', then the buffer is bounced. Since by default > the new > buffer starts on a page boundary, it satifies the 'addr % 4'. But according to the man page, bounce buffering may not be implemented or not be applicable to a platform. It seems to me that you cannot depend on this side-effect in a generic driver. Are you guys talking only in terms of i386 or is this generally applicable? -- Marcel Moolenaar xcllnt@mac.com From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 18:03:32 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6711510656C0; Mon, 9 Feb 2009 18:03:32 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 54B788FC0A; Mon, 9 Feb 2009 18:03:32 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n19I3W25067385; Mon, 9 Feb 2009 18:03:32 GMT (envelope-from cognet@svn.freebsd.org) Received: (from cognet@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n19I3W4T067382; Mon, 9 Feb 2009 18:03:32 GMT (envelope-from cognet@svn.freebsd.org) Message-Id: <200902091803.n19I3W4T067382@svn.freebsd.org> From: Olivier Houchard Date: Mon, 9 Feb 2009 18:03:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188403 - in head/sys: amd64/amd64 arm/arm i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Feb 2009 18:03:33 -0000 Author: cognet Date: Mon Feb 9 18:03:31 2009 New Revision: 188403 URL: http://svn.freebsd.org/changeset/base/188403 Log: The bounce zone sees its page number increased if multiple dma maps use it in the same dma tag. However, it can happen multiple dma tags share the same bounce zone too, so add a per-bounce zone map counter, and check it instead of the dma tag map counter, to know if we have to alloc more pages. Reported by: miwi Reviewed by: scottl Modified: head/sys/amd64/amd64/busdma_machdep.c head/sys/arm/arm/busdma_machdep.c head/sys/i386/i386/busdma_machdep.c Modified: head/sys/amd64/amd64/busdma_machdep.c ============================================================================== --- head/sys/amd64/amd64/busdma_machdep.c Mon Feb 9 18:01:54 2009 (r188402) +++ head/sys/amd64/amd64/busdma_machdep.c Mon Feb 9 18:03:31 2009 (r188403) @@ -93,6 +93,7 @@ struct bounce_zone { int active_bpages; int total_bounced; int total_deferred; + int map_count; bus_size_t alignment; bus_size_t boundary; bus_addr_t lowaddr; @@ -418,7 +419,7 @@ bus_dmamap_create(bus_dma_tag_t dmat, in else maxpages = MIN(MAX_BPAGES, Maxmem -atop(dmat->lowaddr)); if ((dmat->flags & BUS_DMA_MIN_ALLOC_COMP) == 0 - || (dmat->map_count > 0 && bz->total_bpages < maxpages)) { + || (bz->map_count > 0 && bz->total_bpages < maxpages)) { int pages; pages = MAX(atop(dmat->maxsize), 1); @@ -434,6 +435,7 @@ bus_dmamap_create(bus_dma_tag_t dmat, in error = 0; } } + bz->map_count++; } else { *mapp = NULL; } @@ -457,6 +459,8 @@ bus_dmamap_destroy(bus_dma_tag_t dmat, b __func__, dmat, EBUSY); return (EBUSY); } + if (dmat->bounce_zone) + dmat->bounce_zone->map_count--; free(map, M_DEVBUF); } dmat->map_count--; @@ -989,6 +993,7 @@ alloc_bounce_zone(bus_dma_tag_t dmat) bz->lowaddr = dmat->lowaddr; bz->alignment = dmat->alignment; bz->boundary = dmat->boundary; + bz->map_count = 0; snprintf(bz->zoneid, 8, "zone%d", busdma_zonecount); busdma_zonecount++; snprintf(bz->lowaddrid, 18, "%#jx", (uintmax_t)bz->lowaddr); Modified: head/sys/arm/arm/busdma_machdep.c ============================================================================== --- head/sys/arm/arm/busdma_machdep.c Mon Feb 9 18:01:54 2009 (r188402) +++ head/sys/arm/arm/busdma_machdep.c Mon Feb 9 18:03:31 2009 (r188403) @@ -112,6 +112,7 @@ struct bounce_zone { int active_bpages; int total_bounced; int total_deferred; + int map_count; bus_size_t alignment; bus_size_t boundary; bus_addr_t lowaddr; @@ -523,7 +524,7 @@ bus_dmamap_create(bus_dma_tag_t dmat, in */ maxpages = MAX_BPAGES; if ((dmat->flags & BUS_DMA_MIN_ALLOC_COMP) == 0 - || (dmat->map_count > 0 && bz->total_bpages < maxpages)) { + || (bz->map_count > 0 && bz->total_bpages < maxpages)) { int pages; pages = MAX(atop(dmat->maxsize), 1); @@ -539,6 +540,7 @@ bus_dmamap_create(bus_dma_tag_t dmat, in error = 0; } } + bz->map_count++; } CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", __func__, dmat, dmat->flags, error); @@ -560,6 +562,8 @@ bus_dmamap_destroy(bus_dma_tag_t dmat, b __func__, dmat, EBUSY); return (EBUSY); } + if (dmat->bounce_zone) + dmat->bounce_zone->map_count--; dmat->map_count--; CTR2(KTR_BUSDMA, "%s: tag %p error 0", __func__, dmat); return (0); @@ -1277,6 +1281,7 @@ alloc_bounce_zone(bus_dma_tag_t dmat) bz->lowaddr = dmat->lowaddr; bz->alignment = dmat->alignment; bz->boundary = dmat->boundary; + bz->map_count = 0; snprintf(bz->zoneid, 8, "zone%d", busdma_zonecount); busdma_zonecount++; snprintf(bz->lowaddrid, 18, "%#jx", (uintmax_t)bz->lowaddr); Modified: head/sys/i386/i386/busdma_machdep.c ============================================================================== --- head/sys/i386/i386/busdma_machdep.c Mon Feb 9 18:01:54 2009 (r188402) +++ head/sys/i386/i386/busdma_machdep.c Mon Feb 9 18:03:31 2009 (r188403) @@ -98,6 +98,7 @@ struct bounce_zone { int active_bpages; int total_bounced; int total_deferred; + int map_count; bus_size_t alignment; bus_size_t boundary; bus_addr_t lowaddr; @@ -431,7 +432,7 @@ bus_dmamap_create(bus_dma_tag_t dmat, in else maxpages = MIN(MAX_BPAGES, Maxmem -atop(dmat->lowaddr)); if ((dmat->flags & BUS_DMA_MIN_ALLOC_COMP) == 0 - || (dmat->map_count > 0 && bz->total_bpages < maxpages)) { + || (bz->map_count > 0 && bz->total_bpages < maxpages)) { int pages; pages = MAX(atop(dmat->maxsize), 1); @@ -447,6 +448,7 @@ bus_dmamap_create(bus_dma_tag_t dmat, in error = 0; } } + bz->map_count++; } else { *mapp = NULL; } @@ -470,6 +472,8 @@ bus_dmamap_destroy(bus_dma_tag_t dmat, b __func__, dmat, EBUSY); return (EBUSY); } + if (dmat->bounce_zone) + dmat->bounce_zone->map_count--; free(map, M_DEVBUF); } dmat->map_count--; @@ -1007,6 +1011,7 @@ alloc_bounce_zone(bus_dma_tag_t dmat) bz->lowaddr = dmat->lowaddr; bz->alignment = dmat->alignment; bz->boundary = dmat->boundary; + bz->map_count = 0; snprintf(bz->zoneid, 8, "zone%d", busdma_zonecount); busdma_zonecount++; snprintf(bz->lowaddrid, 18, "%#jx", (uintmax_t)bz->lowaddr); From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 18:19:58 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A0A5C1065672; Mon, 9 Feb 2009 18:19:58 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8FB798FC08; Mon, 9 Feb 2009 18:19:58 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n19IJweJ067750; Mon, 9 Feb 2009 18:19:58 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n19IJwJX067749; Mon, 9 Feb 2009 18:19:58 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200902091819.n19IJwJX067749@svn.freebsd.org> From: Robert Watson Date: Mon, 9 Feb 2009 18:19:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188404 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Feb 2009 18:19:59 -0000 Author: rwatson Date: Mon Feb 9 18:19:58 2009 New Revision: 188404 URL: http://svn.freebsd.org/changeset/base/188404 Log: Remove extra 'comma = 0' in socket state printing code, which otherwise could lead to an extra comma in output. Submitted by: Christoph Mallon Modified: head/sys/kern/uipc_debug.c Modified: head/sys/kern/uipc_debug.c ============================================================================== --- head/sys/kern/uipc_debug.c Mon Feb 9 18:03:31 2009 (r188403) +++ head/sys/kern/uipc_debug.c Mon Feb 9 18:19:58 2009 (r188404) @@ -172,7 +172,6 @@ db_print_sostate(short so_state) db_printf("%sSS_ISCONFIRMING", comma ? ", " : ""); comma = 1; } - comma = 0; if (so_state & SS_PROTOREF) { db_printf("%sSS_PROTOREF", comma ? ", " : ""); comma = 1; From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 18:33:31 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 58C81106564A; Mon, 9 Feb 2009 18:33:31 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 0BD698FC12; Mon, 9 Feb 2009 18:33:30 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id n19IUnxk027985; Mon, 9 Feb 2009 11:30:49 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Mon, 09 Feb 2009 11:30:53 -0700 (MST) Message-Id: <20090209.113053.65361811.imp@bsdimp.com> To: xcllnt@mac.com From: "M. Warner Losh" In-Reply-To: <2EA5FEEB-E676-4D1B-9700-399C783F4590@mac.com> References: <94616FBD-4638-4C51-990C-06A943B1BA2A@mac.com> <200902090923.45887.jhb@freebsd.org> <2EA5FEEB-E676-4D1B-9700-399C783F4590@mac.com> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, scottl@samsco.org, src-committers@freebsd.org, svn-src-all@freebsd.org, jhb@freebsd.org Subject: Re: svn commit: r188350 - in head/sys: amd64/amd64 arm/arm dev/usb2/core i386/i386 ia64/ia64 sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Feb 2009 18:33:31 -0000 In message: <2EA5FEEB-E676-4D1B-9700-399C783F4590@mac.com> Marcel Moolenaar writes: : : On Feb 9, 2009, at 6:23 AM, John Baldwin wrote: : : > On Monday 09 February 2009 12:37:53 am Marcel Moolenaar wrote: : >> : >> On Feb 8, 2009, at 5:00 PM, Scott Long wrote: : >> : >>> Busdma allows you to request bouncing for realignment. : >> : >> How exactly? : > : > The 'align' parameter to bus_dma_tag_create(). If your hardware : > needs buffers : > to be aligned on a 4-byte boundary and you bus_dmamap_load() a buffer : > where 'addr % 4 != 0', then the buffer is bounced. Since by default : > the new : > buffer starts on a page boundary, it satifies the 'addr % 4'. : : But according to the man page, bounce buffering may not : be implemented or not be applicable to a platform. It : seems to me that you cannot depend on this side-effect : in a generic driver. Are you guys talking only in terms : of i386 or is this generally applicable? There's no bounce buffering on MIPS right now, for example... There likely should be, but it isn't there now. Warner From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 18:43:42 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E88DD106566B; Mon, 9 Feb 2009 18:43:42 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id B5C938FC12; Mon, 9 Feb 2009 18:43:42 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (pool-98-109-39-197.nwrknj.fios.verizon.net [98.109.39.197]) by cyrus.watson.org (Postfix) with ESMTPSA id 2C6E346B23; Mon, 9 Feb 2009 13:43:42 -0500 (EST) Received: from localhost (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.14.3/8.14.3) with ESMTP id n19IhZit005666; Mon, 9 Feb 2009 13:43:36 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: Marcel Moolenaar Date: Mon, 9 Feb 2009 13:42:15 -0500 User-Agent: KMail/1.9.7 References: <200902082254.n18MsxVt037307@svn.freebsd.org> <200902090923.45887.jhb@freebsd.org> <2EA5FEEB-E676-4D1B-9700-399C783F4590@mac.com> In-Reply-To: <2EA5FEEB-E676-4D1B-9700-399C783F4590@mac.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200902091342.16078.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Mon, 09 Feb 2009 13:43:36 -0500 (EST) X-Virus-Scanned: ClamAV 0.94.2/8968/Mon Feb 9 10:06:24 2009 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: svn-src-head@freebsd.org, Scott Long , src-committers@freebsd.org, svn-src-all@freebsd.org, "M. Warner Losh" Subject: Re: svn commit: r188350 - in head/sys: amd64/amd64 arm/arm dev/usb2/core i386/i386 ia64/ia64 sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Feb 2009 18:43:44 -0000 On Monday 09 February 2009 12:51:28 pm Marcel Moolenaar wrote: > > On Feb 9, 2009, at 6:23 AM, John Baldwin wrote: > > > On Monday 09 February 2009 12:37:53 am Marcel Moolenaar wrote: > >> > >> On Feb 8, 2009, at 5:00 PM, Scott Long wrote: > >> > >>> Busdma allows you to request bouncing for realignment. > >> > >> How exactly? > > > > The 'align' parameter to bus_dma_tag_create(). If your hardware > > needs buffers > > to be aligned on a 4-byte boundary and you bus_dmamap_load() a buffer > > where 'addr % 4 != 0', then the buffer is bounced. Since by default > > the new > > buffer starts on a page boundary, it satifies the 'addr % 4'. > > But according to the man page, bounce buffering may not > be implemented or not be applicable to a platform. It > seems to me that you cannot depend on this side-effect > in a generic driver. Are you guys talking only in terms > of i386 or is this generally applicable? All of the platforms that do bounce buffering will honor this. If a given platform doesn't support bounce buffering then I imagine it will fail misaligned requests with an error. It would probably make it easier to support bounce buffering on more platforms if some of the support code for managing bounce zones could be moved into a subr_busdma.c or the like since much of it is copy and pasted. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 18:51:37 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D8D0106566B; Mon, 9 Feb 2009 18:51:37 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.freebsd.org (Postfix) with ESMTP id BF8478FC1D; Mon, 9 Feb 2009 18:51:36 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from phobos.local ([192.168.254.200]) (authenticated bits=0) by pooker.samsco.org (8.14.2/8.14.2) with ESMTP id n19IpURQ048344; Mon, 9 Feb 2009 11:51:31 -0700 (MST) (envelope-from scottl@samsco.org) Message-ID: <49907B32.8080307@samsco.org> Date: Mon, 09 Feb 2009 11:51:30 -0700 From: Scott Long User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.13) Gecko/20080313 SeaMonkey/1.1.9 MIME-Version: 1.0 To: "M. Warner Losh" References: <94616FBD-4638-4C51-990C-06A943B1BA2A@mac.com> <200902090923.45887.jhb@freebsd.org> <2EA5FEEB-E676-4D1B-9700-399C783F4590@mac.com> <20090209.113053.65361811.imp@bsdimp.com> In-Reply-To: <20090209.113053.65361811.imp@bsdimp.com> X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=3.8 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.1.8 X-Spam-Checker-Version: SpamAssassin 3.1.8 (2007-02-13) on pooker.samsco.org Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, xcllnt@mac.com, src-committers@freebsd.org, jhb@freebsd.org Subject: Re: svn commit: r188350 - in head/sys: amd64/amd64 arm/arm dev/usb2/core i386/i386 ia64/ia64 sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Feb 2009 18:51:37 -0000 M. Warner Losh wrote: > In message: <2EA5FEEB-E676-4D1B-9700-399C783F4590@mac.com> > Marcel Moolenaar writes: > : > : On Feb 9, 2009, at 6:23 AM, John Baldwin wrote: > : > : > On Monday 09 February 2009 12:37:53 am Marcel Moolenaar wrote: > : >> > : >> On Feb 8, 2009, at 5:00 PM, Scott Long wrote: > : >> > : >>> Busdma allows you to request bouncing for realignment. > : >> > : >> How exactly? > : > > : > The 'align' parameter to bus_dma_tag_create(). If your hardware > : > needs buffers > : > to be aligned on a 4-byte boundary and you bus_dmamap_load() a buffer > : > where 'addr % 4 != 0', then the buffer is bounced. Since by default > : > the new > : > buffer starts on a page boundary, it satifies the 'addr % 4'. > : > : But according to the man page, bounce buffering may not > : be implemented or not be applicable to a platform. It > : seems to me that you cannot depend on this side-effect > : in a generic driver. Are you guys talking only in terms > : of i386 or is this generally applicable? > > There's no bounce buffering on MIPS right now, for example... There > likely should be, but it isn't there now. > > Warner So yes, it's only available really on amd64 and i386 at the moment. No reason why it can't be available elsewhere, and I'm working on factoring all of the bounce logic out into an MD file so it can be made available. For architectures that use an IOMMU, there's probably no reason why re-alignment can't use the IOMMU instead of bouncing. Scott From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 19:00:44 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 43E6B1065716; Mon, 9 Feb 2009 19:00:44 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id E3D5C8FC2A; Mon, 9 Feb 2009 19:00:43 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id n19IxSCR028320; Mon, 9 Feb 2009 11:59:28 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Mon, 09 Feb 2009 11:59:32 -0700 (MST) Message-Id: <20090209.115932.1098202471.imp@bsdimp.com> To: scottl@samsco.org From: "M. Warner Losh" In-Reply-To: <49907B32.8080307@samsco.org> References: <2EA5FEEB-E676-4D1B-9700-399C783F4590@mac.com> <20090209.113053.65361811.imp@bsdimp.com> <49907B32.8080307@samsco.org> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, xcllnt@mac.com, src-committers@freebsd.org, jhb@freebsd.org Subject: Re: svn commit: r188350 - in head/sys: amd64/amd64 arm/arm dev/usb2/core i386/i386 ia64/ia64 sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Feb 2009 19:00:45 -0000 In message: <49907B32.8080307@samsco.org> Scott Long writes: : M. Warner Losh wrote: : > In message: <2EA5FEEB-E676-4D1B-9700-399C783F4590@mac.com> : > Marcel Moolenaar writes: : > : : > : On Feb 9, 2009, at 6:23 AM, John Baldwin wrote: : > : : > : > On Monday 09 February 2009 12:37:53 am Marcel Moolenaar wrote: : > : >> : > : >> On Feb 8, 2009, at 5:00 PM, Scott Long wrote: : > : >> : > : >>> Busdma allows you to request bouncing for realignment. : > : >> : > : >> How exactly? : > : > : > : > The 'align' parameter to bus_dma_tag_create(). If your hardware : > : > needs buffers : > : > to be aligned on a 4-byte boundary and you bus_dmamap_load() a buffer : > : > where 'addr % 4 != 0', then the buffer is bounced. Since by default : > : > the new : > : > buffer starts on a page boundary, it satifies the 'addr % 4'. : > : : > : But according to the man page, bounce buffering may not : > : be implemented or not be applicable to a platform. It : > : seems to me that you cannot depend on this side-effect : > : in a generic driver. Are you guys talking only in terms : > : of i386 or is this generally applicable? : > : > There's no bounce buffering on MIPS right now, for example... There : > likely should be, but it isn't there now. : > : > Warner : : So yes, it's only available really on amd64 and i386 at the moment. No : reason why it can't be available elsewhere, and I'm working on factoring : all of the bounce logic out into an MD file so it can be made available. : For architectures that use an IOMMU, there's probably no reason why : re-alignment can't use the IOMMU instead of bouncing. arm also does bounce buffering, but not for memory address space reasons. Warner From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 19:01:01 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5F2E11065697 for ; Mon, 9 Feb 2009 19:01:01 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from ebb.errno.com (ebb.errno.com [69.12.149.25]) by mx1.freebsd.org (Postfix) with ESMTP id 138048FC2D for ; Mon, 9 Feb 2009 19:01:01 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from trouble.errno.com (trouble.errno.com [10.0.0.248]) (authenticated bits=0) by ebb.errno.com (8.13.6/8.12.6) with ESMTP id n19J0sgO020987 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 9 Feb 2009 11:00:55 -0800 (PST) (envelope-from sam@freebsd.org) Message-ID: <49907D66.9010405@freebsd.org> Date: Mon, 09 Feb 2009 11:00:54 -0800 From: Sam Leffler Organization: FreeBSD Project User-Agent: Thunderbird 2.0.0.18 (X11/20081209) MIME-Version: 1.0 To: Scott Long References: <94616FBD-4638-4C51-990C-06A943B1BA2A@mac.com> <200902090923.45887.jhb@freebsd.org> <2EA5FEEB-E676-4D1B-9700-399C783F4590@mac.com> <20090209.113053.65361811.imp@bsdimp.com> <49907B32.8080307@samsco.org> In-Reply-To: <49907B32.8080307@samsco.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-DCC-URT-Metrics: ebb.errno.com; whitelist Cc: src-committers@freebsd.org, jhb@freebsd.org, svn-src-all@freebsd.org, xcllnt@mac.com, svn-src-head@freebsd.org, "M. Warner Losh" Subject: Re: svn commit: r188350 - in head/sys: amd64/amd64 arm/arm dev/usb2/core i386/i386 ia64/ia64 sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Feb 2009 19:01:03 -0000 Scott Long wrote: > M. Warner Losh wrote: >> In message: <2EA5FEEB-E676-4D1B-9700-399C783F4590@mac.com> >> Marcel Moolenaar writes: >> : : On Feb 9, 2009, at 6:23 AM, John Baldwin wrote: >> : : > On Monday 09 February 2009 12:37:53 am Marcel Moolenaar wrote: >> : >> >> : >> On Feb 8, 2009, at 5:00 PM, Scott Long wrote: >> : >> >> : >>> Busdma allows you to request bouncing for realignment. >> : >> >> : >> How exactly? >> : > >> : > The 'align' parameter to bus_dma_tag_create(). If your hardware >> : > needs buffers >> : > to be aligned on a 4-byte boundary and you bus_dmamap_load() a >> buffer >> : > where 'addr % 4 != 0', then the buffer is bounced. Since by >> default : > the new >> : > buffer starts on a page boundary, it satifies the 'addr % 4'. >> : : But according to the man page, bounce buffering may not >> : be implemented or not be applicable to a platform. It >> : seems to me that you cannot depend on this side-effect >> : in a generic driver. Are you guys talking only in terms >> : of i386 or is this generally applicable? >> >> There's no bounce buffering on MIPS right now, for example... There >> likely should be, but it isn't there now. >> >> Warner > > So yes, it's only available really on amd64 and i386 at the moment. > No reason why it can't be available elsewhere, and I'm working on > factoring > all of the bounce logic out into an MD file so it can be made available. > For architectures that use an IOMMU, there's probably no reason why > re-alignment can't use the IOMMU instead of bouncing. ARM does bounce buffers. Looks like it'll bounce for mis-aligned data. Sam From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 19:10:42 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A7264106566C for ; Mon, 9 Feb 2009 19:10:42 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from ebb.errno.com (ebb.errno.com [69.12.149.25]) by mx1.freebsd.org (Postfix) with ESMTP id 5832D8FC26 for ; Mon, 9 Feb 2009 19:10:42 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from trouble.errno.com (trouble.errno.com [10.0.0.248]) (authenticated bits=0) by ebb.errno.com (8.13.6/8.12.6) with ESMTP id n19JAeZE021049 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 9 Feb 2009 11:10:40 -0800 (PST) (envelope-from sam@freebsd.org) Message-ID: <49907FB0.9050901@freebsd.org> Date: Mon, 09 Feb 2009 11:10:40 -0800 From: Sam Leffler Organization: FreeBSD Project User-Agent: Thunderbird 2.0.0.18 (X11/20081209) MIME-Version: 1.0 To: "M. Warner Losh" References: <2EA5FEEB-E676-4D1B-9700-399C783F4590@mac.com> <20090209.113053.65361811.imp@bsdimp.com> <49907B32.8080307@samsco.org> <20090209.115932.1098202471.imp@bsdimp.com> In-Reply-To: <20090209.115932.1098202471.imp@bsdimp.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-DCC-URT-Metrics: ebb.errno.com; whitelist Cc: scottl@samsco.org, src-committers@freebsd.org, jhb@freebsd.org, svn-src-all@freebsd.org, xcllnt@mac.com, svn-src-head@freebsd.org Subject: Re: svn commit: r188350 - in head/sys: amd64/amd64 arm/arm dev/usb2/core i386/i386 ia64/ia64 sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Feb 2009 19:10:43 -0000 M. Warner Losh wrote: > In message: <49907B32.8080307@samsco.org> > Scott Long writes: > : M. Warner Losh wrote: > : > In message: <2EA5FEEB-E676-4D1B-9700-399C783F4590@mac.com> > : > Marcel Moolenaar writes: > : > : > : > : On Feb 9, 2009, at 6:23 AM, John Baldwin wrote: > : > : > : > : > On Monday 09 February 2009 12:37:53 am Marcel Moolenaar wrote: > : > : >> > : > : >> On Feb 8, 2009, at 5:00 PM, Scott Long wrote: > : > : >> > : > : >>> Busdma allows you to request bouncing for realignment. > : > : >> > : > : >> How exactly? > : > : > > : > : > The 'align' parameter to bus_dma_tag_create(). If your hardware > : > : > needs buffers > : > : > to be aligned on a 4-byte boundary and you bus_dmamap_load() a buffer > : > : > where 'addr % 4 != 0', then the buffer is bounced. Since by default > : > : > the new > : > : > buffer starts on a page boundary, it satifies the 'addr % 4'. > : > : > : > : But according to the man page, bounce buffering may not > : > : be implemented or not be applicable to a platform. It > : > : seems to me that you cannot depend on this side-effect > : > : in a generic driver. Are you guys talking only in terms > : > : of i386 or is this generally applicable? > : > > : > There's no bounce buffering on MIPS right now, for example... There > : > likely should be, but it isn't there now. > : > > : > Warner > : > : So yes, it's only available really on amd64 and i386 at the moment. No > : reason why it can't be available elsewhere, and I'm working on factoring > : all of the bounce logic out into an MD file so it can be made available. > : For architectures that use an IOMMU, there's probably no reason why > : re-alignment can't use the IOMMU instead of bouncing. > > arm also does bounce buffering, but not for memory address space reasons. > Not sure what you mean my "address space reasons" but it bounces for PCI dma above 64M on ixp4xx. Sam From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 19:18:36 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6220B1065677; Mon, 9 Feb 2009 19:18:36 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout013.mac.com (asmtpout013.mac.com [17.148.16.88]) by mx1.freebsd.org (Postfix) with ESMTP id 473A78FC0C; Mon, 9 Feb 2009 19:18:36 +0000 (UTC) (envelope-from xcllnt@mac.com) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Received: from amoghe-t43.jnpr.net (natint3.juniper.net [66.129.224.36]) by asmtp013.mac.com (Sun Java(tm) System Messaging Server 6.3-7.03 (built Aug 7 2008; 32bit)) with ESMTPSA id <0KET005LMCAUDB80@asmtp013.mac.com>; Mon, 09 Feb 2009 11:18:31 -0800 (PST) Message-id: <0AA26479-B36A-4412-BF2B-7D4C573BC266@mac.com> From: Marcel Moolenaar To: John Baldwin In-reply-to: <200902091342.16078.jhb@freebsd.org> Date: Mon, 09 Feb 2009 11:18:29 -0800 References: <200902082254.n18MsxVt037307@svn.freebsd.org> <200902090923.45887.jhb@freebsd.org> <2EA5FEEB-E676-4D1B-9700-399C783F4590@mac.com> <200902091342.16078.jhb@freebsd.org> X-Mailer: Apple Mail (2.930.3) Cc: svn-src-head@freebsd.org, Scott Long , src-committers@freebsd.org, svn-src-all@freebsd.org, "M. Warner Losh" Subject: Re: svn commit: r188350 - in head/sys: amd64/amd64 arm/arm dev/usb2/core i386/i386 ia64/ia64 sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Feb 2009 19:18:36 -0000 On Feb 9, 2009, at 10:42 AM, John Baldwin wrote: >>> The 'align' parameter to bus_dma_tag_create(). If your hardware >>> needs buffers >>> to be aligned on a 4-byte boundary and you bus_dmamap_load() a >>> buffer >>> where 'addr % 4 != 0', then the buffer is bounced. Since by default >>> the new >>> buffer starts on a page boundary, it satifies the 'addr % 4'. >> >> But according to the man page, bounce buffering may not >> be implemented or not be applicable to a platform. It >> seems to me that you cannot depend on this side-effect >> in a generic driver. Are you guys talking only in terms >> of i386 or is this generally applicable? > > All of the platforms that do bounce buffering will honor this. If a > given > platform doesn't support bounce buffering then I imagine it will fail > misaligned requests with an error. It would probably make it easier > to > support bounce buffering on more platforms if some of the support > code for > managing bounce zones could be moved into a subr_busdma.c or the > like since > much of it is copy and pasted. Very much agreed with the unification in subr_busdma.c. If the shared implementation then grows a IOMMU interface, then platforms with a IOMMU can avoid bounce buffering when possible (i.e. no re-alignment is needed or enough free IOMMU mappings exist to avoid the bounce buffering). -- Marcel Moolenaar xcllnt@mac.com From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 19:20:09 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 226F210656F8; Mon, 9 Feb 2009 19:20:09 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.freebsd.org (Postfix) with ESMTP id C05088FC12; Mon, 9 Feb 2009 19:20:08 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from phobos.local ([192.168.254.200]) (authenticated bits=0) by pooker.samsco.org (8.14.2/8.14.2) with ESMTP id n19JK3Mv048520; Mon, 9 Feb 2009 12:20:03 -0700 (MST) (envelope-from scottl@samsco.org) Message-ID: <499081E3.9050009@samsco.org> Date: Mon, 09 Feb 2009 12:20:03 -0700 From: Scott Long User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.13) Gecko/20080313 SeaMonkey/1.1.9 MIME-Version: 1.0 To: Marcel Moolenaar References: <200902082254.n18MsxVt037307@svn.freebsd.org> <200902090923.45887.jhb@freebsd.org> <2EA5FEEB-E676-4D1B-9700-399C783F4590@mac.com> <200902091342.16078.jhb@freebsd.org> <0AA26479-B36A-4412-BF2B-7D4C573BC266@mac.com> In-Reply-To: <0AA26479-B36A-4412-BF2B-7D4C573BC266@mac.com> X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=3.8 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.1.8 X-Spam-Checker-Version: SpamAssassin 3.1.8 (2007-02-13) on pooker.samsco.org Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, "M. Warner Losh" , John Baldwin Subject: Re: svn commit: r188350 - in head/sys: amd64/amd64 arm/arm dev/usb2/core i386/i386 ia64/ia64 sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Feb 2009 19:20:10 -0000 Marcel Moolenaar wrote: > > On Feb 9, 2009, at 10:42 AM, John Baldwin wrote: > >>>> The 'align' parameter to bus_dma_tag_create(). If your hardware >>>> needs buffers >>>> to be aligned on a 4-byte boundary and you bus_dmamap_load() a buffer >>>> where 'addr % 4 != 0', then the buffer is bounced. Since by default >>>> the new >>>> buffer starts on a page boundary, it satifies the 'addr % 4'. >>> >>> But according to the man page, bounce buffering may not >>> be implemented or not be applicable to a platform. It >>> seems to me that you cannot depend on this side-effect >>> in a generic driver. Are you guys talking only in terms >>> of i386 or is this generally applicable? >> >> All of the platforms that do bounce buffering will honor this. If a >> given >> platform doesn't support bounce buffering then I imagine it will fail >> misaligned requests with an error. It would probably make it easier to >> support bounce buffering on more platforms if some of the support code >> for >> managing bounce zones could be moved into a subr_busdma.c or the like >> since >> much of it is copy and pasted. > > Very much agreed with the unification in subr_busdma.c. > > If the shared implementation then grows a IOMMU interface, > then platforms with a IOMMU can avoid bounce buffering > when possible (i.e. no re-alignment is needed or enough > free IOMMU mappings exist to avoid the bounce buffering). > Yes, this work in progress. Scott From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 19:24:37 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A16410656EC; Mon, 9 Feb 2009 19:24:37 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 1DF8A8FC16; Mon, 9 Feb 2009 19:24:33 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id n19JMFJZ028617; Mon, 9 Feb 2009 12:22:15 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Mon, 09 Feb 2009 12:22:20 -0700 (MST) Message-Id: <20090209.122220.-1691636592.imp@bsdimp.com> To: sam@freebsd.org From: "M. Warner Losh" In-Reply-To: <49907FB0.9050901@freebsd.org> References: <49907B32.8080307@samsco.org> <20090209.115932.1098202471.imp@bsdimp.com> <49907FB0.9050901@freebsd.org> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: scottl@samsco.org, src-committers@freebsd.org, jhb@freebsd.org, svn-src-all@freebsd.org, xcllnt@mac.com, svn-src-head@freebsd.org Subject: Re: svn commit: r188350 - in head/sys: amd64/amd64 arm/arm dev/usb2/core i386/i386 ia64/ia64 sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Feb 2009 19:24:38 -0000 In message: <49907FB0.9050901@freebsd.org> Sam Leffler writes: : M. Warner Losh wrote: : > arm also does bounce buffering, but not for memory address space reasons. : > : : Not sure what you mean my "address space reasons" but it bounces for PCI : dma above 64M on ixp4xx. That's exactly what I mean. Warner From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 20:13:56 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B70A106571F; Mon, 9 Feb 2009 20:13:56 +0000 (UTC) (envelope-from lulf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 372D88FC1D; Mon, 9 Feb 2009 20:13:56 +0000 (UTC) (envelope-from lulf@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n19KDuWM070010; Mon, 9 Feb 2009 20:13:56 GMT (envelope-from lulf@svn.freebsd.org) Received: (from lulf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n19KDuAF070009; Mon, 9 Feb 2009 20:13:56 GMT (envelope-from lulf@svn.freebsd.org) Message-Id: <200902092013.n19KDuAF070009@svn.freebsd.org> From: Ulf Lilleengen Date: Mon, 9 Feb 2009 20:13:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188405 - head/contrib/csup X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Feb 2009 20:13:58 -0000 Author: lulf Date: Mon Feb 9 20:13:55 2009 New Revision: 188405 URL: http://svn.freebsd.org/changeset/base/188405 Log: - Fix an issue where file attributes were not installed correctly during a Touch and SetAttrs operation. - SetAttrs and Touch were incorrectly switched. Modified: head/contrib/csup/updater.c Modified: head/contrib/csup/updater.c ============================================================================== --- head/contrib/csup/updater.c Mon Feb 9 18:19:58 2009 (r188404) +++ head/contrib/csup/updater.c Mon Feb 9 20:13:55 2009 (r188405) @@ -1656,10 +1656,12 @@ updater_rcsedit(struct updater *up, stru if (rf == NULL) { fattr_maskout(oldfattr, ~FA_MODTIME); - if (fattr_equal(oldfattr, sr->sr_serverattr) == 0) + if (fattr_equal(oldfattr, sr->sr_serverattr)) lprintf(1, " SetAttrs %s", fup->coname); else lprintf(1, " Touch %s", fup->coname); + /* Install new attributes. */ + fattr_install(sr->sr_serverattr, fup->destpath, NULL); if (fup->attic) lprintf(1, " -> Attic"); lprintf(1, "\n"); From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 20:42:51 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B775D106566C; Mon, 9 Feb 2009 20:42:51 +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 A60398FC13; Mon, 9 Feb 2009 20:42:51 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n19Kgp2K070605; Mon, 9 Feb 2009 20:42:51 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n19KgpbY070604; Mon, 9 Feb 2009 20:42:51 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200902092042.n19KgpbY070604@svn.freebsd.org> From: John Baldwin Date: Mon, 9 Feb 2009 20:42:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188406 - head/sys/fs/udf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Feb 2009 20:42:52 -0000 Author: jhb Date: Mon Feb 9 20:42:51 2009 New Revision: 188406 URL: http://svn.freebsd.org/changeset/base/188406 Log: Use the same style as the rest of the file for the optional data string after each path component rather than a GCC-ism. Modified: head/sys/fs/udf/ecma167-udf.h Modified: head/sys/fs/udf/ecma167-udf.h ============================================================================== --- head/sys/fs/udf/ecma167-udf.h Mon Feb 9 20:13:55 2009 (r188405) +++ head/sys/fs/udf/ecma167-udf.h Mon Feb 9 20:42:51 2009 (r188406) @@ -359,7 +359,7 @@ struct path_component { uint8_t type; uint8_t length; uint16_t version; - uint8_t identifier[0]; + uint8_t identifier[1]; } __packed; #define UDF_PATH_ROOT 2 #define UDF_PATH_DOTDOT 3 From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 20:50:23 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C802C1065676; Mon, 9 Feb 2009 20:50:23 +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 B511F8FC26; Mon, 9 Feb 2009 20:50:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n19KoN5j070778; Mon, 9 Feb 2009 20:50:23 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n19KoN3X070776; Mon, 9 Feb 2009 20:50:23 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200902092050.n19KoN3X070776@svn.freebsd.org> From: John Baldwin Date: Mon, 9 Feb 2009 20:50:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188407 - head/sys/fs/udf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Feb 2009 20:50:24 -0000 Author: jhb Date: Mon Feb 9 20:50:23 2009 New Revision: 188407 URL: http://svn.freebsd.org/changeset/base/188407 Log: Mark udf(4) MPSAFE and add support for shared vnode locks during pathname lookups: - Honor the caller's locking flags in udf_root() and udf_vget(). - Set VV_ROOT for the root vnode in udf_vget() instead of only doing it in udf_root(). - Honor the requested locking flags during pathname lookups in udf_lookup(). - Release the buffer holding the directory data before looking up the vnode for a given file to avoid a LOR between the "udf" vnode locks and "bufwait". - Use vn_vget_ino() to handle ".." lookups. - Special case "." lookups instead of calling udf_vget(). We have to do extra checking for the vnode lock for "." lookups. Modified: head/sys/fs/udf/udf_vfsops.c head/sys/fs/udf/udf_vnops.c Modified: head/sys/fs/udf/udf_vfsops.c ============================================================================== --- head/sys/fs/udf/udf_vfsops.c Mon Feb 9 20:42:51 2009 (r188406) +++ head/sys/fs/udf/udf_vfsops.c Mon Feb 9 20:50:23 2009 (r188407) @@ -344,6 +344,7 @@ udf_mountfs(struct vnode *devvp, struct mp->mnt_stat.f_fsid.val[1] = mp->mnt_vfc->vfc_typenum; MNT_ILOCK(mp); mp->mnt_flag |= MNT_LOCAL; + mp->mnt_kern_flag |= MNTK_MPSAFE | MNTK_LOOKUP_SHARED; MNT_IUNLOCK(mp); udfmp->im_mountp = mp; udfmp->im_dev = devvp->v_rdev; @@ -546,22 +547,13 @@ static int udf_root(struct mount *mp, int flags, struct vnode **vpp, struct thread *td) { struct udf_mnt *udfmp; - struct vnode *vp; ino_t id; - int error; udfmp = VFSTOUDFFS(mp); id = udf_getid(&udfmp->root_icb); - error = udf_vget(mp, id, LK_EXCLUSIVE, vpp); - if (error) - return error; - - vp = *vpp; - vp->v_vflag |= VV_ROOT; - - return (0); + return (udf_vget(mp, id, flags, vpp)); } static int @@ -597,6 +589,22 @@ udf_vget(struct mount *mp, ino_t ino, in if (error || *vpp != NULL) return (error); + /* + * We must promote to an exclusive lock for vnode creation. This + * can happen if lookup is passed LOCKSHARED. + */ + if ((flags & LK_TYPE_MASK) == LK_SHARED) { + flags &= ~LK_TYPE_MASK; + flags |= LK_EXCLUSIVE; + } + + /* + * We do not lock vnode creation as it is believed to be too + * expensive for such rare case as simultaneous creation of vnode + * for same ino by different processes. We just allow them to race + * and check later to decide who wins. Let the race begin! + */ + td = curthread; udfmp = VFSTOUDFFS(mp); @@ -689,6 +697,13 @@ udf_vget(struct mount *mp, ino_t ino, in vp->v_type = VLNK; break; } + + if (vp->v_type != VFIFO) + VN_LOCK_ASHARE(vp); + + if (ino == udf_getid(&udfmp->root_icb)) + vp->v_vflag |= VV_ROOT; + *vpp = vp; return (0); Modified: head/sys/fs/udf/udf_vnops.c ============================================================================== --- head/sys/fs/udf/udf_vnops.c Mon Feb 9 20:42:51 2009 (r188406) +++ head/sys/fs/udf/udf_vnops.c Mon Feb 9 20:50:23 2009 (r188407) @@ -1068,13 +1068,14 @@ udf_lookup(struct vop_cachedlookup_args long namelen; ino_t id = 0; int offset, error = 0; - int numdirpasses, fsize; + int fsize, lkflags, ltype, numdirpasses; dvp = a->a_dvp; node = VTON(dvp); udfmp = node->udfmp; nameiop = a->a_cnp->cn_nameiop; flags = a->a_cnp->cn_flags; + lkflags = a->a_cnp->cn_lkflags; nameptr = a->a_cnp->cn_nameptr; namelen = a->a_cnp->cn_namelen; fsize = le64toh(node->fentry->inf_len); @@ -1135,20 +1136,35 @@ lookloop: /* Did we have a match? */ if (id) { - if (flags & ISDOTDOT) - VOP_UNLOCK(dvp, 0); - error = udf_vget(udfmp->im_mountp, id, LK_EXCLUSIVE, &tdp); - if (flags & ISDOTDOT) - vn_lock(dvp, LK_EXCLUSIVE|LK_RETRY); - if (!error) { + /* + * Remember where this entry was if it's the final + * component. + */ + if ((flags & ISLASTCN) && nameiop == LOOKUP) + node->diroff = ds->offset + ds->off; + if (numdirpasses == 2) + nchstats.ncs_pass2++; + udf_closedir(ds); + + if (flags & ISDOTDOT) { + error = vn_vget_ino(dvp, id, lkflags, &tdp); + } else if (node->hash_id == id) { + VREF(dvp); /* we want ourself, ie "." */ /* - * Remember where this entry was if it's the final - * component. + * When we lookup "." we still can be asked to lock it + * differently. */ - if ((flags & ISLASTCN) && nameiop == LOOKUP) - node->diroff = ds->offset + ds->off; - if (numdirpasses == 2) - nchstats.ncs_pass2++; + ltype = lkflags & LK_TYPE_MASK; + if (ltype != VOP_ISLOCKED(dvp)) { + if (ltype == LK_EXCLUSIVE) + vn_lock(dvp, LK_UPGRADE | LK_RETRY); + else /* if (ltype == LK_SHARED) */ + vn_lock(dvp, LK_DOWNGRADE | LK_RETRY); + } + tdp = dvp; + } else + error = udf_vget(udfmp->im_mountp, id, lkflags, &tdp); + if (!error) { *vpp = tdp; /* Put this entry in the cache */ if (flags & MAKEENTRY) @@ -1162,6 +1178,7 @@ lookloop: udf_closedir(ds); goto lookloop; } + udf_closedir(ds); /* Enter name into cache as non-existant */ if (flags & MAKEENTRY) @@ -1175,7 +1192,6 @@ lookloop: } } - udf_closedir(ds); return (error); } From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 21:34:06 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A4B9910656DE; Mon, 9 Feb 2009 21:34:06 +0000 (UTC) (envelope-from lulf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 91D748FC0A; Mon, 9 Feb 2009 21:34:06 +0000 (UTC) (envelope-from lulf@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n19LY6u6071753; Mon, 9 Feb 2009 21:34:06 GMT (envelope-from lulf@svn.freebsd.org) Received: (from lulf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n19LY6Lw071752; Mon, 9 Feb 2009 21:34:06 GMT (envelope-from lulf@svn.freebsd.org) Message-Id: <200902092134.n19LY6Lw071752@svn.freebsd.org> From: Ulf Lilleengen Date: Mon, 9 Feb 2009 21:34:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188408 - head/lib/libdisk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Feb 2009 21:34:09 -0000 Author: lulf Date: Mon Feb 9 21:34:06 2009 New Revision: 188408 URL: http://svn.freebsd.org/changeset/base/188408 Log: - Sanitize disk parameters retrieved from GEOM, as they are not guaranteed to have sane values. It caused sysinstall to crash when installing on certain SD cards. Discussed with: marcel Modified: head/lib/libdisk/open_disk.c Modified: head/lib/libdisk/open_disk.c ============================================================================== --- head/lib/libdisk/open_disk.c Mon Feb 9 20:50:23 2009 (r188407) +++ head/lib/libdisk/open_disk.c Mon Feb 9 21:34:06 2009 (r188408) @@ -127,6 +127,9 @@ Int_Open_Disk(const char *name, char *co name, a, b, line); } + /* Sanitize the parameters. */ + Sanitize_Bios_Geom(d); + /* * Calculate the number of cylinders this disk must have. If we have * an obvious insanity, we set the number of cylinders to zero. From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 21:47:40 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9F0F21065670; Mon, 9 Feb 2009 21:47:40 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8B85D8FC08; Mon, 9 Feb 2009 21:47:40 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n19LleZx072053; Mon, 9 Feb 2009 21:47:40 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n19LldCV072041; Mon, 9 Feb 2009 21:47:39 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200902092147.n19LldCV072041@svn.freebsd.org> From: Andrew Thompson Date: Mon, 9 Feb 2009 21:47:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188409 - head/sys/dev/usb2/controller X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Feb 2009 21:47:41 -0000 Author: thompsa Date: Mon Feb 9 21:47:39 2009 New Revision: 188409 URL: http://svn.freebsd.org/changeset/base/188409 Log: MFp4 //depot/projects/usb; 157069,157296,157375,157384,157430 - Change "usb2_pause_mtx" so that it takes the timeout value in ticks - USB controller: EHCI High Speed Interrupt endpoint fix. - Fix OHCI and EHCI counting bug when multiple TD's are involved in a short USB transfer and a short packet happens on the non-last TD in the USB transfer frame. - USB process naming cleanup. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb2/controller/at91dci.c head/sys/dev/usb2/controller/at91dci_atmelarm.c head/sys/dev/usb2/controller/atmegadci.c head/sys/dev/usb2/controller/ehci2.c head/sys/dev/usb2/controller/ehci2.h head/sys/dev/usb2/controller/ehci2_pci.c head/sys/dev/usb2/controller/musb2_otg.c head/sys/dev/usb2/controller/ohci2.c head/sys/dev/usb2/controller/uhci2.c head/sys/dev/usb2/controller/usb2_controller.c head/sys/dev/usb2/controller/uss820dci.c Modified: head/sys/dev/usb2/controller/at91dci.c ============================================================================== --- head/sys/dev/usb2/controller/at91dci.c Mon Feb 9 21:34:06 2009 (r188408) +++ head/sys/dev/usb2/controller/at91dci.c Mon Feb 9 21:47:39 2009 (r188409) @@ -275,7 +275,7 @@ at91dci_wakeup_peer(struct usb2_xfer *xf DELAY(8000); } else { /* Wait for reset to complete. */ - usb2_pause_mtx(&sc->sc_bus.bus_mtx, 8); + usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 125); } AT91_UDP_WRITE_4(sc, AT91_UDP_GSTATE, 0); @@ -1395,7 +1395,7 @@ at91dci_init(struct at91dci_softc *sc) (sc->sc_clocks_on) (sc->sc_clocks_arg); } /* wait a little for things to stabilise */ - usb2_pause_mtx(&sc->sc_bus.bus_mtx, 1); + usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 1000); /* disable and clear all interrupts */ Modified: head/sys/dev/usb2/controller/at91dci_atmelarm.c ============================================================================== --- head/sys/dev/usb2/controller/at91dci_atmelarm.c Mon Feb 9 21:34:06 2009 (r188408) +++ head/sys/dev/usb2/controller/at91dci_atmelarm.c Mon Feb 9 21:47:39 2009 (r188409) @@ -168,7 +168,7 @@ at91_udp_attach(device_t dev) at91_udp_pull_down(sc); /* wait 10ms for pulldown to stabilise */ - usb2_pause_mtx(NULL, 10); + usb2_pause_mtx(NULL, hz / 100); sc->sc_iclk = at91_pmc_clock_ref("udc_clk"); sc->sc_fclk = at91_pmc_clock_ref("udpck"); Modified: head/sys/dev/usb2/controller/atmegadci.c ============================================================================== --- head/sys/dev/usb2/controller/atmegadci.c Mon Feb 9 21:34:06 2009 (r188408) +++ head/sys/dev/usb2/controller/atmegadci.c Mon Feb 9 21:47:39 2009 (r188409) @@ -221,7 +221,7 @@ atmegadci_wakeup_peer(struct usb2_xfer * DELAY(8000); } else { /* Wait for reset to complete. */ - usb2_pause_mtx(&sc->sc_bus.bus_mtx, 8); + usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 125); } /* hardware should have cleared RMWKUP bit */ @@ -1253,7 +1253,7 @@ atmegadci_init(struct atmegadci_softc *s (sc->sc_clocks_on) (&sc->sc_bus); /* wait a little for things to stabilise */ - usb2_pause_mtx(&sc->sc_bus.bus_mtx, 1); + usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 1000); /* enable interrupts */ ATMEGA_WRITE_1(sc, ATMEGA_UDIEN, Modified: head/sys/dev/usb2/controller/ehci2.c ============================================================================== --- head/sys/dev/usb2/controller/ehci2.c Mon Feb 9 21:34:06 2009 (r188408) +++ head/sys/dev/usb2/controller/ehci2.c Mon Feb 9 21:47:39 2009 (r188409) @@ -177,7 +177,7 @@ ehci_hc_reset(ehci_softc_t *sc) EOWRITE4(sc, EHCI_USBCMD, 0); /* Halt controller */ for (n = 0; n != 100; n++) { - usb2_pause_mtx(&sc->sc_bus.bus_mtx, 1); + usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 1000); hcr = EOREAD4(sc, EHCI_USBSTS); if (hcr & EHCI_STS_HCH) { hcr = 0; @@ -193,7 +193,7 @@ ehci_hc_reset(ehci_softc_t *sc) EOWRITE4(sc, EHCI_USBCMD, EHCI_CMD_HCRESET); for (n = 0; n != 100; n++) { - usb2_pause_mtx(&sc->sc_bus.bus_mtx, 1); + usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 1000); hcr = EOREAD4(sc, EHCI_USBCMD); if (!(hcr & EHCI_CMD_HCRESET)) { if (sc->sc_flags & EHCI_SCFLG_SETMODE) @@ -478,7 +478,7 @@ ehci_init(ehci_softc_t *sc) EOWRITE4(sc, EHCI_CONFIGFLAG, EHCI_CONF_CF); for (i = 0; i < 100; i++) { - usb2_pause_mtx(NULL, 1); + usb2_pause_mtx(NULL, hz / 1000); hcr = EOREAD4(sc, EHCI_USBSTS) & EHCI_STS_HCH; if (!hcr) { break; @@ -511,11 +511,12 @@ ehci_detach(ehci_softc_t *sc) if (ehci_hc_reset(sc)) { DPRINTF("reset failed!\n"); } - /* XXX let stray task complete */ - usb2_pause_mtx(&sc->sc_bus.bus_mtx, 50); USB_BUS_UNLOCK(&sc->sc_bus); + /* XXX let stray task complete */ + usb2_pause_mtx(NULL, hz / 20); + usb2_callout_drain(&sc->sc_tmo_pcd); } @@ -549,7 +550,7 @@ ehci_suspend(ehci_softc_t *sc) if (hcr == 0) { break; } - usb2_pause_mtx(&sc->sc_bus.bus_mtx, 1); + usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 1000); } if (hcr != 0) { @@ -563,7 +564,7 @@ ehci_suspend(ehci_softc_t *sc) if (hcr == EHCI_STS_HCH) { break; } - usb2_pause_mtx(&sc->sc_bus.bus_mtx, 1); + usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 1000); } if (hcr != EHCI_STS_HCH) { @@ -607,7 +608,7 @@ ehci_resume(ehci_softc_t *sc) if (hcr) { usb2_pause_mtx(&sc->sc_bus.bus_mtx, - USB_RESUME_WAIT); + USB_MS_TO_TICKS(USB_RESUME_WAIT)); for (i = 1; i <= sc->sc_noport; i++) { cmd = EOREAD4(sc, EHCI_PORTSC(i)); @@ -625,16 +626,17 @@ ehci_resume(ehci_softc_t *sc) if (hcr != EHCI_STS_HCH) { break; } - usb2_pause_mtx(&sc->sc_bus.bus_mtx, 1); + usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 1000); } if (hcr == EHCI_STS_HCH) { device_printf(sc->sc_bus.bdev, "config timeout\n"); } - usb2_pause_mtx(&sc->sc_bus.bus_mtx, - USB_RESUME_WAIT); USB_BUS_UNLOCK(&sc->sc_bus); + usb2_pause_mtx(NULL, + USB_MS_TO_TICKS(USB_RESUME_WAIT)); + /* catch any lost interrupts */ ehci_do_poll(&sc->sc_bus); } @@ -1140,6 +1142,9 @@ ehci_non_isoc_done_sub(struct usb2_xfer td = xfer->td_transfer_cache; td_alt_next = td->alt_next; + if (xfer->aframes != xfer->nframes) { + xfer->frlengths[xfer->aframes] = 0; + } while (1) { usb2_pc_cpu_invalidate(td->page_cache); @@ -1148,8 +1153,8 @@ ehci_non_isoc_done_sub(struct usb2_xfer len = EHCI_QTD_GET_BYTES(status); /* - * Verify the status length and subtract - * the remainder from "frlengths[]": + * Verify the status length and + * add the length to "frlengths[]": */ if (len > td->len) { /* should not happen */ @@ -1157,7 +1162,7 @@ ehci_non_isoc_done_sub(struct usb2_xfer "0x%04x/0x%04x bytes\n", len, td->len); status |= EHCI_QTD_HALTED; } else if (xfer->aframes != xfer->nframes) { - xfer->frlengths[xfer->aframes] -= len; + xfer->frlengths[xfer->aframes] += td->len - len; } /* Check for last transfer */ if (((void *)td) == xfer->td_transfer_last) { @@ -3214,9 +3219,9 @@ ehci_root_ctrl_done(struct usb2_xfer *xf /* wait 20ms for resume sequence to complete */ if (use_polling) { /* polling */ - DELAY(20 * 1000); + DELAY(20000); } else { - usb2_pause_mtx(&sc->sc_bus.bus_mtx, 20); + usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 50); } EOWRITE4(sc, port, v & ~(EHCI_PS_SUSP | @@ -3225,9 +3230,9 @@ ehci_root_ctrl_done(struct usb2_xfer *xf /* settle time */ if (use_polling) { /* polling */ - DELAY(4 * 1000); + DELAY(4000); } else { - usb2_pause_mtx(&sc->sc_bus.bus_mtx, 4); + usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 250); } break; case UHF_PORT_POWER: @@ -3383,7 +3388,7 @@ ehci_root_ctrl_done(struct usb2_xfer *xf } else { /* Wait for reset to complete. */ usb2_pause_mtx(&sc->sc_bus.bus_mtx, - USB_PORT_ROOT_RESET_DELAY); + USB_MS_TO_TICKS(USB_PORT_ROOT_RESET_DELAY)); } /* Terminate reset sequence. */ @@ -3396,7 +3401,7 @@ ehci_root_ctrl_done(struct usb2_xfer *xf } else { /* Wait for HC to complete reset. */ usb2_pause_mtx(&sc->sc_bus.bus_mtx, - EHCI_PORT_RESET_COMPLETE); + USB_MS_TO_TICKS(EHCI_PORT_RESET_COMPLETE)); } v = EOREAD4(sc, port); Modified: head/sys/dev/usb2/controller/ehci2.h ============================================================================== --- head/sys/dev/usb2/controller/ehci2.h Mon Feb 9 21:34:06 2009 (r188408) +++ head/sys/dev/usb2/controller/ehci2.h Mon Feb 9 21:47:39 2009 (r188409) @@ -468,7 +468,6 @@ typedef struct ehci_softc { struct ehci_sitd *sc_isoc_fs_p_last[EHCI_VIRTUAL_FRAMELIST_COUNT]; struct ehci_itd *sc_isoc_hs_p_last[EHCI_VIRTUAL_FRAMELIST_COUNT]; void *sc_intr_hdl; - device_t sc_dev; bus_size_t sc_io_size; bus_space_tag_t sc_io_tag; bus_space_handle_t sc_io_hdl; Modified: head/sys/dev/usb2/controller/ehci2_pci.c ============================================================================== --- head/sys/dev/usb2/controller/ehci2_pci.c Mon Feb 9 21:34:06 2009 (r188408) +++ head/sys/dev/usb2/controller/ehci2_pci.c Mon Feb 9 21:47:39 2009 (r188409) @@ -237,7 +237,6 @@ ehci_pci_attach(device_t self) USB_GET_DMA_TAG(self), &ehci_iterate_hw_softc)) { return (ENOMEM); } - sc->sc_dev = self; pci_enable_busmaster(self); @@ -456,7 +455,7 @@ ehci_pci_takecontroller(device_t self) "timed out waiting for BIOS\n"); break; } - usb2_pause_mtx(NULL, 10); /* wait 10ms */ + usb2_pause_mtx(NULL, hz / 100); /* wait 10ms */ } } } Modified: head/sys/dev/usb2/controller/musb2_otg.c ============================================================================== --- head/sys/dev/usb2/controller/musb2_otg.c Mon Feb 9 21:34:06 2009 (r188408) +++ head/sys/dev/usb2/controller/musb2_otg.c Mon Feb 9 21:47:39 2009 (r188409) @@ -223,7 +223,7 @@ musbotg_wakeup_peer(struct usb2_xfer *xf DELAY(8000); } else { /* Wait for reset to complete. */ - usb2_pause_mtx(&sc->sc_bus.bus_mtx, 8); + usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 125); } temp = MUSB2_READ_1(sc, MUSB2_REG_POWER); @@ -1708,7 +1708,7 @@ musbotg_init(struct musbotg_softc *sc) (sc->sc_clocks_on) (sc->sc_clocks_arg); } /* wait a little for things to stabilise */ - usb2_pause_mtx(&sc->sc_bus.bus_mtx, 1); + usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 1000); /* disable all interrupts */ @@ -1721,7 +1721,7 @@ musbotg_init(struct musbotg_softc *sc) musbotg_pull_common(sc, 0); /* wait a little bit (10ms) */ - usb2_pause_mtx(&sc->sc_bus.bus_mtx, 10); + usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 100); /* disable double packet buffering */ MUSB2_WRITE_2(sc, MUSB2_REG_RXDBDIS, 0xFFFF); Modified: head/sys/dev/usb2/controller/ohci2.c ============================================================================== --- head/sys/dev/usb2/controller/ohci2.c Mon Feb 9 21:34:06 2009 (r188408) +++ head/sys/dev/usb2/controller/ohci2.c Mon Feb 9 21:47:39 2009 (r188409) @@ -168,7 +168,7 @@ ohci_controller_init(ohci_softc_t *sc) DPRINTF("SMM active, request owner change\n"); OWRITE4(sc, OHCI_COMMAND_STATUS, OHCI_OCR); for (i = 0; (i < 100) && (ctl & OHCI_IR); i++) { - usb2_pause_mtx(NULL, 1); + usb2_pause_mtx(NULL, hz / 1000); ctl = OREAD4(sc, OHCI_CONTROL); } if (ctl & OHCI_IR) { @@ -181,7 +181,8 @@ ohci_controller_init(ohci_softc_t *sc) DPRINTF("cold started\n"); reset: /* controller was cold started */ - usb2_pause_mtx(NULL, USB_BUS_RESET_DELAY); + usb2_pause_mtx(NULL, + USB_MS_TO_TICKS(USB_BUS_RESET_DELAY)); } /* @@ -191,7 +192,8 @@ reset: DPRINTF("%s: resetting\n", device_get_nameunit(sc->sc_bus.bdev)); OWRITE4(sc, OHCI_CONTROL, OHCI_HCFS_RESET); - usb2_pause_mtx(NULL, USB_BUS_RESET_DELAY); + usb2_pause_mtx(NULL, + USB_MS_TO_TICKS(USB_BUS_RESET_DELAY)); /* we now own the host controller and the bus has been reset */ ival = OHCI_GET_IVAL(OREAD4(sc, OHCI_FM_INTERVAL)); @@ -253,7 +255,8 @@ reset: desca = OREAD4(sc, OHCI_RH_DESCRIPTOR_A); OWRITE4(sc, OHCI_RH_DESCRIPTOR_A, desca | OHCI_NOCP); OWRITE4(sc, OHCI_RH_STATUS, OHCI_LPSC); /* Enable port power */ - usb2_pause_mtx(NULL, OHCI_ENABLE_POWER_DELAY); + usb2_pause_mtx(NULL, + USB_MS_TO_TICKS(OHCI_ENABLE_POWER_DELAY)); OWRITE4(sc, OHCI_RH_DESCRIPTOR_A, desca); /* @@ -262,7 +265,8 @@ reset: */ sc->sc_noport = 0; for (i = 0; (i < 10) && (sc->sc_noport == 0); i++) { - usb2_pause_mtx(NULL, OHCI_READ_DESC_DELAY); + usb2_pause_mtx(NULL, + USB_MS_TO_TICKS(OHCI_READ_DESC_DELAY)); sc->sc_noport = OHCI_GET_NDP(OREAD4(sc, OHCI_RH_DESCRIPTOR_A)); } @@ -417,11 +421,11 @@ ohci_detach(struct ohci_softc *sc) OWRITE4(sc, OHCI_INTERRUPT_DISABLE, OHCI_ALL_INTRS); OWRITE4(sc, OHCI_CONTROL, OHCI_HCFS_RESET); - /* XXX let stray task complete */ - usb2_pause_mtx(&sc->sc_bus.bus_mtx, 50); - USB_BUS_UNLOCK(&sc->sc_bus); + /* XXX let stray task complete */ + usb2_pause_mtx(NULL, hz / 20); + usb2_callout_drain(&sc->sc_tmo_rhsc); } @@ -455,7 +459,7 @@ ohci_suspend(ohci_softc_t *sc) OWRITE4(sc, OHCI_CONTROL, ctl); usb2_pause_mtx(&sc->sc_bus.bus_mtx, - USB_RESUME_WAIT); + USB_MS_TO_TICKS(USB_RESUME_WAIT)); USB_BUS_UNLOCK(&sc->sc_bus); } @@ -485,10 +489,12 @@ ohci_resume(ohci_softc_t *sc) ctl = OREAD4(sc, OHCI_CONTROL); ctl |= OHCI_HCFS_RESUME; OWRITE4(sc, OHCI_CONTROL, ctl); - usb2_pause_mtx(&sc->sc_bus.bus_mtx, USB_RESUME_DELAY); + usb2_pause_mtx(&sc->sc_bus.bus_mtx, + USB_MS_TO_TICKS(USB_RESUME_DELAY)); ctl = (ctl & ~OHCI_HCFS_MASK) | OHCI_HCFS_OPERATIONAL; OWRITE4(sc, OHCI_CONTROL, ctl); - usb2_pause_mtx(&sc->sc_bus.bus_mtx, USB_RESUME_RECOVERY); + usb2_pause_mtx(&sc->sc_bus.bus_mtx, + USB_MS_TO_TICKS(USB_RESUME_RECOVERY)); sc->sc_control = sc->sc_intre = 0; USB_BUS_UNLOCK(&sc->sc_bus); @@ -827,6 +833,9 @@ ohci_non_isoc_done_sub(struct usb2_xfer td_alt_next = td->alt_next; td_flags = 0; + if (xfer->aframes != xfer->nframes) { + xfer->frlengths[xfer->aframes] = 0; + } while (1) { usb2_pc_cpu_invalidate(td->page_cache); @@ -850,10 +859,15 @@ ohci_non_isoc_done_sub(struct usb2_xfer cc = OHCI_CC_STALL; } else if (xfer->aframes != xfer->nframes) { /* - * subtract remaining length from - * "frlengths[]" + * Sum up total transfer length + * in "frlengths[]": */ - xfer->frlengths[xfer->aframes] -= temp; + xfer->frlengths[xfer->aframes] += td->len - temp; + } + } else { + if (xfer->aframes != xfer->nframes) { + /* transfer was complete */ + xfer->frlengths[xfer->aframes] += td->len; } } /* Check for last transfer */ @@ -2401,7 +2415,7 @@ ohci_root_ctrl_done(struct usb2_xfer *xf DELAY(USB_PORT_ROOT_RESET_DELAY * 1000); } else { usb2_pause_mtx(&sc->sc_bus.bus_mtx, - USB_PORT_ROOT_RESET_DELAY); + USB_MS_TO_TICKS(USB_PORT_ROOT_RESET_DELAY)); } if ((OREAD4(sc, port) & UPS_RESET) == 0) { Modified: head/sys/dev/usb2/controller/uhci2.c ============================================================================== --- head/sys/dev/usb2/controller/uhci2.c Mon Feb 9 21:34:06 2009 (r188408) +++ head/sys/dev/usb2/controller/uhci2.c Mon Feb 9 21:47:39 2009 (r188409) @@ -271,7 +271,7 @@ uhci_reset(uhci_softc_t *sc) /* wait */ usb2_pause_mtx(&sc->sc_bus.bus_mtx, - USB_BUS_RESET_DELAY); + USB_MS_TO_TICKS(USB_BUS_RESET_DELAY)); /* terminate all transfers */ @@ -283,7 +283,7 @@ uhci_reset(uhci_softc_t *sc) while (n--) { /* wait one millisecond */ - usb2_pause_mtx(&sc->sc_bus.bus_mtx, 1); + usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 1000); if (!(UREAD2(sc, UHCI_CMD) & UHCI_CMD_HCRESET)) { goto done_1; @@ -299,7 +299,7 @@ done_1: while (n--) { /* wait one millisecond */ - usb2_pause_mtx(&sc->sc_bus.bus_mtx, 1); + usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 1000); /* check if HC is stopped */ if (UREAD2(sc, UHCI_STS) & UHCI_STS_HCH) { @@ -345,7 +345,7 @@ uhci_start(uhci_softc_t *sc) while (n--) { /* wait one millisecond */ - usb2_pause_mtx(&sc->sc_bus.bus_mtx, 1); + usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 1000); /* check that controller has started */ @@ -636,7 +636,8 @@ uhci_suspend(uhci_softc_t *sc) UHCICMD(sc, UHCI_CMD_EGSM); - usb2_pause_mtx(&sc->sc_bus.bus_mtx, USB_RESUME_WAIT); + usb2_pause_mtx(&sc->sc_bus.bus_mtx, + USB_MS_TO_TICKS(USB_RESUME_WAIT)); USB_BUS_UNLOCK(&sc->sc_bus); } @@ -655,7 +656,7 @@ uhci_resume(uhci_softc_t *sc) UHCICMD(sc, UHCI_CMD_FGR); usb2_pause_mtx(&sc->sc_bus.bus_mtx, - USB_RESUME_DELAY); + USB_MS_TO_TICKS(USB_RESUME_DELAY)); /* and start traffic again */ @@ -2408,7 +2409,7 @@ uhci_portreset(uhci_softc_t *sc, uint16_ if (use_polling) { DELAY(10000); } else { - usb2_pause_mtx(&sc->sc_bus.bus_mtx, 10); + usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 100); } } @@ -2420,7 +2421,7 @@ uhci_portreset(uhci_softc_t *sc, uint16_ DELAY(USB_PORT_ROOT_RESET_DELAY * 1000); } else { usb2_pause_mtx(&sc->sc_bus.bus_mtx, - USB_PORT_ROOT_RESET_DELAY); + USB_MS_TO_TICKS(USB_PORT_ROOT_RESET_DELAY)); } DPRINTFN(4, "uhci port %d reset, status0 = 0x%04x\n", @@ -2453,7 +2454,7 @@ uhci_portreset(uhci_softc_t *sc, uint16_ DELAY(USB_PORT_RESET_DELAY * 1000); } else { usb2_pause_mtx(&sc->sc_bus.bus_mtx, - USB_PORT_RESET_DELAY); + USB_MS_TO_TICKS(USB_PORT_RESET_DELAY)); } x = UREAD2(sc, port); @@ -2780,9 +2781,9 @@ uhci_root_ctrl_done(struct usb2_xfer *xf /* wait 20ms for resume sequence to complete */ if (use_polling) { /* polling */ - DELAY(20 * 1000); + DELAY(20000); } else { - usb2_pause_mtx(&sc->sc_bus.bus_mtx, 20); + usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 50); } /* clear suspend and resume detect */ @@ -2790,7 +2791,7 @@ uhci_root_ctrl_done(struct usb2_xfer *xf UHCI_PORTSC_SUSP)); /* wait a little bit */ - usb2_pause_mtx(&sc->sc_bus.bus_mtx, 2); + usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 500); sc->sc_isresumed |= (1 << index); Modified: head/sys/dev/usb2/controller/usb2_controller.c ============================================================================== --- head/sys/dev/usb2/controller/usb2_controller.c Mon Feb 9 21:34:06 2009 (r188408) +++ head/sys/dev/usb2/controller/usb2_controller.c Mon Feb 9 21:47:39 2009 (r188409) @@ -168,16 +168,16 @@ usb2_detach(device_t dev) /* Get rid of USB callback processes */ - usb2_proc_unsetup(&bus->giant_callback_proc); - usb2_proc_unsetup(&bus->non_giant_callback_proc); + usb2_proc_free(&bus->giant_callback_proc); + usb2_proc_free(&bus->non_giant_callback_proc); /* Get rid of USB roothub process */ - usb2_proc_unsetup(&bus->roothub_proc); + usb2_proc_free(&bus->roothub_proc); /* Get rid of USB explore process */ - usb2_proc_unsetup(&bus->explore_proc); + usb2_proc_free(&bus->explore_proc); return (0); } @@ -375,6 +375,8 @@ usb2_bus_attach(struct usb2_proc_msg *pm static void usb2_attach_sub(device_t dev, struct usb2_bus *bus) { + const char *pname = device_get_nameunit(dev); + /* Initialise USB process messages */ bus->explore_msg[0].hdr.pm_callback = &usb2_bus_explore; bus->explore_msg[0].bus = bus; @@ -398,20 +400,20 @@ usb2_attach_sub(device_t dev, struct usb /* Create USB explore, roothub and callback processes */ - if (usb2_proc_setup(&bus->giant_callback_proc, - &bus->bus_mtx, USB_PRI_MED)) { + if (usb2_proc_create(&bus->giant_callback_proc, + &bus->bus_mtx, pname, USB_PRI_MED)) { printf("WARNING: Creation of USB Giant " "callback process failed.\n"); - } else if (usb2_proc_setup(&bus->non_giant_callback_proc, - &bus->bus_mtx, USB_PRI_HIGH)) { + } else if (usb2_proc_create(&bus->non_giant_callback_proc, + &bus->bus_mtx, pname, USB_PRI_HIGH)) { printf("WARNING: Creation of USB non-Giant " "callback process failed.\n"); - } else if (usb2_proc_setup(&bus->roothub_proc, - &bus->bus_mtx, USB_PRI_HIGH)) { + } else if (usb2_proc_create(&bus->roothub_proc, + &bus->bus_mtx, pname, USB_PRI_HIGH)) { printf("WARNING: Creation of USB roothub " "process failed.\n"); - } else if (usb2_proc_setup(&bus->explore_proc, - &bus->bus_mtx, USB_PRI_MED)) { + } else if (usb2_proc_create(&bus->explore_proc, + &bus->bus_mtx, pname, USB_PRI_MED)) { printf("WARNING: Creation of USB explore " "process failed.\n"); } else { Modified: head/sys/dev/usb2/controller/uss820dci.c ============================================================================== --- head/sys/dev/usb2/controller/uss820dci.c Mon Feb 9 21:34:06 2009 (r188408) +++ head/sys/dev/usb2/controller/uss820dci.c Mon Feb 9 21:47:39 2009 (r188409) @@ -1335,7 +1335,7 @@ uss820dci_init(struct uss820dci_softc *s uss820dci_pull_down(sc); /* wait 10ms for pulldown to stabilise */ - usb2_pause_mtx(&sc->sc_bus.bus_mtx, 10); + usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 100); /* check hardware revision */ temp = USS820_READ_1(sc, USS820_REV); From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 21:50:04 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6FB051065680; Mon, 9 Feb 2009 21:50:04 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5B54C8FC29; Mon, 9 Feb 2009 21:50:04 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n19Lo4Bn072150; Mon, 9 Feb 2009 21:50:04 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n19Lo4bK072147; Mon, 9 Feb 2009 21:50:04 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200902092150.n19Lo4bK072147@svn.freebsd.org> From: Andrew Thompson Date: Mon, 9 Feb 2009 21:50:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188410 - head/sys/dev/usb2/controller X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Feb 2009 21:50:05 -0000 Author: thompsa Date: Mon Feb 9 21:50:04 2009 New Revision: 188410 URL: http://svn.freebsd.org/changeset/base/188410 Log: MFp4 //depot/projects/usb - Bring in ehci2_ixp4xx.c and ehci2_mbus.c from dev/usb. Submitted by: Hans Petter Selasky Added: head/sys/dev/usb2/controller/ehci2_ixp4xx.c (contents, props changed) head/sys/dev/usb2/controller/ehci2_mbus.c (contents, props changed) Added: head/sys/dev/usb2/controller/ehci2_ixp4xx.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb2/controller/ehci2_ixp4xx.c Mon Feb 9 21:50:04 2009 (r188410) @@ -0,0 +1,349 @@ +/*- + * Copyright (c) 2008 Sam Leffler. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * IXP435 attachment driver for the USB Enhanced Host Controller. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_bus.h" + +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +#define EHCI_VENDORID_IXP4XX 0x42fa05 +#define EHCI_HC_DEVSTR "IXP4XX Integrated USB 2.0 controller" + +struct ixp_ehci_softc { + ehci_softc_t base; /* storage for EHCI code */ + bus_space_tag_t iot; + bus_space_handle_t ioh; + struct bus_space tag; /* tag for private bus space ops */ +}; + +static device_attach_t ehci_ixp_attach; +static device_detach_t ehci_ixp_detach; +static device_shutdown_t ehci_ixp_shutdown; +static device_suspend_t ehci_ixp_suspend; +static device_resume_t ehci_ixp_resume; + +static uint8_t ehci_bs_r_1(void *, bus_space_handle_t, bus_size_t); +static void ehci_bs_w_1(void *, bus_space_handle_t, bus_size_t, u_int8_t); +static uint16_t ehci_bs_r_2(void *, bus_space_handle_t, bus_size_t); +static void ehci_bs_w_2(void *, bus_space_handle_t, bus_size_t, uint16_t); +static uint32_t ehci_bs_r_4(void *, bus_space_handle_t, bus_size_t); +static void ehci_bs_w_4(void *, bus_space_handle_t, bus_size_t, uint32_t); + +static int +ehci_ixp_suspend(device_t self) +{ + ehci_softc_t *sc = device_get_softc(self); + int err; + + err = bus_generic_suspend(self); + if (err) + return (err); + ehci_suspend(sc); + return (0); +} + +static int +ehci_ixp_resume(device_t self) +{ + ehci_softc_t *sc = device_get_softc(self); + + ehci_resume(sc); + + bus_generic_resume(self); + + return (0); +} + +static int +ehci_ixp_shutdown(device_t self) +{ + ehci_softc_t *sc = device_get_softc(self); + int err; + + err = bus_generic_shutdown(self); + if (err) + return (err); + ehci_shutdown(sc); + + return (0); +} + +static int +ehci_ixp_probe(device_t self) +{ + + device_set_desc(self, EHCI_HC_DEVSTR); + + return (BUS_PROBE_DEFAULT); +} + +static int +ehci_ixp_attach(device_t self) +{ + struct ixp_ehci_softc *isc = device_get_softc(self); + ehci_softc_t *sc = &isc->base; + int err; + int rid; + + /* initialise some bus fields */ + sc->sc_bus.parent = self; + sc->sc_bus.devices = sc->sc_devices; + sc->sc_bus.devices_max = EHCI_MAX_DEVICES; + + /* get all DMA memory */ + if (usb2_bus_mem_alloc_all(&sc->sc_bus, + USB_GET_DMA_TAG(self), &ehci_iterate_hw_softc)) { + return (ENOMEM); + } + + sc->sc_bus.usbrev = USB_REV_2_0; + + /* NB: hints fix the memory location and irq */ + + rid = 0; + sc->sc_io_res = bus_alloc_resource_any(self, SYS_RES_MEMORY, &rid, RF_ACTIVE); + if (!sc->sc_io_res) { + device_printf(self, "Could not map memory\n"); + goto error; + } + + /* + * Craft special resource for bus space ops that handle + * byte-alignment of non-word addresses. Also, since + * we're already intercepting bus space ops we handle + * the register window offset that could otherwise be + * done with bus_space_subregion. + */ + isc->iot = rman_get_bustag(sc->sc_io_res); + isc->tag.bs_cookie = isc->iot; + /* read single */ + isc->tag.bs_r_1 = ehci_bs_r_1, + isc->tag.bs_r_2 = ehci_bs_r_2, + isc->tag.bs_r_4 = ehci_bs_r_4, + /* write (single) */ + isc->tag.bs_w_1 = ehci_bs_w_1, + isc->tag.bs_w_2 = ehci_bs_w_2, + isc->tag.bs_w_4 = ehci_bs_w_4, + + sc->sc_io_tag = &isc->tag; + sc->sc_io_hdl = rman_get_bushandle(sc->sc_io_res); + sc->sc_io_size = IXP435_USB1_SIZE - 0x100; + + rid = 0; + sc->sc_irq_res = bus_alloc_resource_any(self, SYS_RES_IRQ, &rid, + RF_ACTIVE); + if (sc->sc_irq_res == NULL) { + device_printf(self, "Could not allocate irq\n"); + goto error; + } + sc->sc_bus.bdev = device_add_child(self, "usbus", -1); + if (!sc->sc_bus.bdev) { + device_printf(self, "Could not add USB device\n"); + goto error; + } + device_set_ivars(sc->sc_bus.bdev, &sc->sc_bus); + device_set_desc(sc->sc_bus.bdev, EHCI_HC_DEVSTR); + + sprintf(sc->sc_vendor, "Intel"); + + + err = bus_setup_intr(self, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, + NULL, (void *)(void *)ehci_interrupt, sc, &sc->sc_intr_hdl); + if (err) { + device_printf(self, "Could not setup irq, %d\n", err); + sc->sc_intr_hdl = NULL; + goto error; + } + + /* + * Arrange to force Host mode, select big-endian byte alignment, + * and arrange to not terminate reset operations (the adapter + * will ignore it if we do but might as well save a reg write). + * Also, the controller has an embedded Transaction Translator + * which means port speed must be read from the Port Status + * register following a port enable. + */ + sc->sc_flags |= EHCI_SCFLG_TT + | EHCI_SCFLG_SETMODE + | EHCI_SCFLG_BIGEDESC + | EHCI_SCFLG_BIGEMMIO + | EHCI_SCFLG_NORESTERM + ; + + err = ehci_init(sc); + if (!err) { + err = device_probe_and_attach(sc->sc_bus.bdev); + } + if (err) { + device_printf(self, "USB init failed err=%d\n", err); + goto error; + } + return (0); + +error: + ehci_ixp_detach(self); + return (ENXIO); +} + +static int +ehci_ixp_detach(device_t self) +{ + struct ixp_ehci_softc *isc = device_get_softc(self); + ehci_softc_t *sc = &isc->base; + device_t bdev; + int err; + + if (sc->sc_bus.bdev) { + bdev = sc->sc_bus.bdev; + device_detach(bdev); + device_delete_child(self, bdev); + } + /* during module unload there are lots of children leftover */ + device_delete_all_children(self); + + /* + * disable interrupts that might have been switched on in ehci_init + */ + if (sc->sc_io_res) { + EWRITE4(sc, EHCI_USBINTR, 0); + } + + if (sc->sc_irq_res && sc->sc_intr_hdl) { + /* + * only call ehci_detach() after ehci_init() + */ + ehci_detach(sc); + + err = bus_teardown_intr(self, sc->sc_irq_res, sc->sc_intr_hdl); + + if (err) + /* XXX or should we panic? */ + device_printf(self, "Could not tear down irq, %d\n", + err); + sc->sc_intr_hdl = NULL; + } + + if (sc->sc_irq_res) { + bus_release_resource(self, SYS_RES_IRQ, 0, sc->sc_irq_res); + sc->sc_irq_res = NULL; + } + if (sc->sc_io_res) { + bus_release_resource(self, SYS_RES_MEMORY, 0, + sc->sc_io_res); + sc->sc_io_res = NULL; + } + usb2_bus_mem_free_all(&sc->sc_bus, &ehci_iterate_hw_softc); + + return (0); +} + +/* + * Bus space accessors for PIO operations. + */ + +static uint8_t +ehci_bs_r_1(void *t, bus_space_handle_t h, bus_size_t o) +{ + return bus_space_read_1((bus_space_tag_t) t, h, + 0x100 + (o &~ 3) + (3 - (o & 3))); +} + +static void +ehci_bs_w_1(void *t, bus_space_handle_t h, bus_size_t o, u_int8_t v) +{ + panic("%s", __func__); +} + +static uint16_t +ehci_bs_r_2(void *t, bus_space_handle_t h, bus_size_t o) +{ + return bus_space_read_2((bus_space_tag_t) t, h, + 0x100 + (o &~ 3) + (2 - (o & 3))); +} + +static void +ehci_bs_w_2(void *t, bus_space_handle_t h, bus_size_t o, uint16_t v) +{ + panic("%s", __func__); +} + +static uint32_t +ehci_bs_r_4(void *t, bus_space_handle_t h, bus_size_t o) +{ + return bus_space_read_4((bus_space_tag_t) t, h, 0x100 + o); +} + +static void +ehci_bs_w_4(void *t, bus_space_handle_t h, bus_size_t o, uint32_t v) +{ + bus_space_write_4((bus_space_tag_t) t, h, 0x100 + o, v); +} + +static device_method_t ehci_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, ehci_ixp_probe), + DEVMETHOD(device_attach, ehci_ixp_attach), + DEVMETHOD(device_detach, ehci_ixp_detach), + DEVMETHOD(device_suspend, ehci_ixp_suspend), + DEVMETHOD(device_resume, ehci_ixp_resume), + DEVMETHOD(device_shutdown, ehci_ixp_shutdown), + + /* Bus interface */ + DEVMETHOD(bus_print_child, bus_generic_print_child), + + {0, 0} +}; + +static driver_t ehci_driver = { + "ehci", + ehci_methods, + sizeof(struct ixp_ehci_softc), +}; + +static devclass_t ehci_devclass; + +DRIVER_MODULE(ehci, ixp, ehci_driver, ehci_devclass, 0, 0); +MODULE_DEPEND(ehci, usb2_controller, 1, 1, 1); +MODULE_DEPEND(ehci, usb2_core, 1, 1, 1); Added: head/sys/dev/usb2/controller/ehci2_mbus.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb2/controller/ehci2_mbus.c Mon Feb 9 21:50:04 2009 (r188410) @@ -0,0 +1,365 @@ +/*- + * Copyright (C) 2008 MARVELL INTERNATIONAL LTD. + * All rights reserved. + * + * Developed by Semihalf. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of MARVELL nor the names of contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * MBus attachment driver for the USB Enhanced Host Controller. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_bus.h" + +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +#define EHCI_VENDORID_MRVL 0x1286 +#define EHCI_HC_DEVSTR "Marvell Integrated USB 2.0 controller" + +static device_attach_t ehci_mbus_attach; +static device_detach_t ehci_mbus_detach; +static device_shutdown_t ehci_mbus_shutdown; +static device_suspend_t ehci_mbus_suspend; +static device_resume_t ehci_mbus_resume; + +static int err_intr(void *arg); + +static struct resource *irq_err; +static void *ih_err; + +#define USB_BRIDGE_INTR_CAUSE 0x210 +#define USB_BRIDGE_INTR_MASK 0x214 + +#define MV_USB_ADDR_DECODE_ERR (1 << 0) +#define MV_USB_HOST_UNDERFLOW (1 << 1) +#define MV_USB_HOST_OVERFLOW (1 << 2) +#define MV_USB_DEVICE_UNDERFLOW (1 << 3) + +static int +ehci_mbus_suspend(device_t self) +{ + ehci_softc_t *sc = device_get_softc(self); + int err; + + err = bus_generic_suspend(self); + if (err) + return (err); + ehci_suspend(sc); + return (0); +} + +static int +ehci_mbus_resume(device_t self) +{ + ehci_softc_t *sc = device_get_softc(self); + + ehci_resume(sc); + + bus_generic_resume(self); + + return (0); +} + +static int +ehci_mbus_shutdown(device_t self) +{ + ehci_softc_t *sc = device_get_softc(self); + int err; + + err = bus_generic_shutdown(self); + if (err) + return (err); + ehci_shutdown(sc); + + return (0); +} + +static int +ehci_mbus_probe(device_t self) +{ + + device_set_desc(self, EHCI_HC_DEVSTR); + + return (BUS_PROBE_DEFAULT); +} + +static int +ehci_mbus_attach(device_t self) +{ + ehci_softc_t *sc = device_get_softc(self); + bus_space_handle_t bsh; + int err; + int rid; + + /* initialise some bus fields */ + sc->sc_bus.parent = self; + sc->sc_bus.devices = sc->sc_devices; + sc->sc_bus.devices_max = EHCI_MAX_DEVICES; + + /* get all DMA memory */ + if (usb2_bus_mem_alloc_all(&sc->sc_bus, + USB_GET_DMA_TAG(self), &ehci_iterate_hw_softc)) { + return (ENOMEM); + } + + sc->sc_bus.usbrev = USB_REV_2_0; + + rid = 0; + sc->sc_io_res = bus_alloc_resource_any(self, SYS_RES_MEMORY, &rid, RF_ACTIVE); + if (!sc->sc_io_res) { + device_printf(self, "Could not map memory\n"); + goto error; + } + sc->sc_io_tag = rman_get_bustag(sc->sc_io_res); + bsh = rman_get_bushandle(sc->sc_io_res); + sc->sc_io_size = MV_USB_SIZE - MV_USB_HOST_OFST; + + /* + * Marvell EHCI host controller registers start at certain offset within + * the whole USB registers range, so create a subregion for the host + * mode configuration purposes. + */ + if (bus_space_subregion(sc->sc_io_tag, bsh, MV_USB_HOST_OFST, + sc->sc_io_size, &sc->sc_io_hdl) != 0) + panic("%s: unable to subregion USB host registers", + device_get_name(self)); + + rid = 0; + irq_err = bus_alloc_resource_any(self, SYS_RES_IRQ, &rid, + RF_SHAREABLE | RF_ACTIVE); + if (irq_err == NULL) { + device_printf(self, "Could not allocate error irq\n"); + ehci_mbus_detach(self); + return (ENXIO); + } + + /* + * Notice: Marvell EHCI controller has TWO interrupt lines, so make sure to + * use the correct rid for the main one (controller interrupt) -- + * refer to obio_devices[] for the right resource number to use here. + */ + rid = 1; + sc->sc_irq_res = bus_alloc_resource_any(self, SYS_RES_IRQ, &rid, + RF_SHAREABLE | RF_ACTIVE); + if (sc->sc_irq_res == NULL) { + device_printf(self, "Could not allocate irq\n"); + goto error; + } + + sc->sc_bus.bdev = device_add_child(self, "usbus", -1); + if (!sc->sc_bus.bdev) { + device_printf(self, "Could not add USB device\n"); + goto error; + } + device_set_ivars(sc->sc_bus.bdev, &sc->sc_bus); + device_set_desc(sc->sc_bus.bdev, EHCI_HC_DEVSTR); + + sprintf(sc->sc_vendor, "Marvell"); + + err = bus_setup_intr(self, irq_err, INTR_FAST | INTR_TYPE_BIO, + err_intr, NULL, sc, &ih_err); + if (err) { + device_printf(self, "Could not setup error irq, %d\n", err); + ih_err = NULL; + goto error; + } + + EWRITE4(sc, USB_BRIDGE_INTR_MASK, MV_USB_ADDR_DECODE_ERR | + MV_USB_HOST_UNDERFLOW | MV_USB_HOST_OVERFLOW | + MV_USB_DEVICE_UNDERFLOW); + + err = bus_setup_intr(self, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, + NULL, (void *)(void *)ehci_interrupt, sc, &sc->sc_intr_hdl); + if (err) { + device_printf(self, "Could not setup irq, %d\n", err); + sc->sc_intr_hdl = NULL; + goto error; + } + + /* + * Workaround for Marvell integrated EHCI controller: reset of + * the EHCI core clears the USBMODE register, which sets the core in + * an undefined state (neither host nor agent), so it needs to be set + * again for proper operation. + * + * Refer to errata document MV-S500832-00D.pdf (p. 5.24 GL USB-2) for + * details. + */ + sc->sc_flags |= EHCI_SCFLG_SETMODE; + if (bootverbose) + device_printf(self, "5.24 GL USB-2 workaround enabled\n"); + + /* XXX all MV chips need it? */ + sc->sc_flags |= EHCI_SCFLG_FORCESPEED | EHCI_SCFLG_NORESTERM; + + err = ehci_init(sc); + if (!err) { + err = device_probe_and_attach(sc->sc_bus.bdev); + } + if (err) { + device_printf(self, "USB init failed err=%d\n", err); + goto error; + } + return (0); + +error: + ehci_mbus_detach(self); + return (ENXIO); +} + +static int +ehci_mbus_detach(device_t self) +{ + ehci_softc_t *sc = device_get_softc(self); + device_t bdev; + int err; + + if (sc->sc_bus.bdev) { + bdev = sc->sc_bus.bdev; + device_detach(bdev); + device_delete_child(self, bdev); + } + /* during module unload there are lots of children leftover */ + device_delete_all_children(self); + + /* + * disable interrupts that might have been switched on in ehci_init + */ + if (sc->sc_io_res) { + EWRITE4(sc, EHCI_USBINTR, 0); + EWRITE4(sc, USB_BRIDGE_INTR_MASK, 0); + } + if (sc->sc_irq_res && sc->sc_intr_hdl) { + /* + * only call ehci_detach() after ehci_init() + */ + ehci_detach(sc); + + err = bus_teardown_intr(self, sc->sc_irq_res, sc->sc_intr_hdl); + + if (err) + /* XXX or should we panic? */ + device_printf(self, "Could not tear down irq, %d\n", + err); + sc->sc_intr_hdl = NULL; + } + if (irq_err && ih_err) { + err = bus_teardown_intr(self, irq_err, ih_err); + + if (err) + device_printf(self, "Could not tear down irq, %d\n", + err); + ih_err = NULL; + } + if (irq_err) { + bus_release_resource(self, SYS_RES_IRQ, 0, irq_err); + irq_err = NULL; + } + if (sc->sc_irq_res) { + bus_release_resource(self, SYS_RES_IRQ, 1, sc->sc_irq_res); + sc->sc_irq_res = NULL; + } + if (sc->sc_io_res) { + bus_release_resource(self, SYS_RES_MEMORY, 0, + sc->sc_io_res); + sc->sc_io_res = NULL; + } + usb2_bus_mem_free_all(&sc->sc_bus, &ehci_iterate_hw_softc); + + return (0); +} + +static int +err_intr(void *arg) +{ + ehci_softc_t *sc = arg; + unsigned int cause; + + cause = EREAD4(sc, USB_BRIDGE_INTR_CAUSE); + if (cause) { + printf("IRQ ERR: cause: 0x%08x\n", cause); + if (cause & MV_USB_ADDR_DECODE_ERR) + printf("IRQ ERR: Address decoding error\n"); + if (cause & MV_USB_HOST_UNDERFLOW) + printf("IRQ ERR: USB Host Underflow\n"); + if (cause & MV_USB_HOST_OVERFLOW) + printf("IRQ ERR: USB Host Overflow\n"); + if (cause & MV_USB_DEVICE_UNDERFLOW) + printf("IRQ ERR: USB Device Underflow\n"); + if (cause & ~(MV_USB_ADDR_DECODE_ERR | MV_USB_HOST_UNDERFLOW | + MV_USB_HOST_OVERFLOW | MV_USB_DEVICE_UNDERFLOW)) + printf("IRQ ERR: Unknown error\n"); + + EWRITE4(sc, USB_BRIDGE_INTR_CAUSE, 0); + } + return (FILTER_HANDLED); +} + +static device_method_t ehci_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, ehci_mbus_probe), + DEVMETHOD(device_attach, ehci_mbus_attach), + DEVMETHOD(device_detach, ehci_mbus_detach), + DEVMETHOD(device_suspend, ehci_mbus_suspend), + DEVMETHOD(device_resume, ehci_mbus_resume), + DEVMETHOD(device_shutdown, ehci_mbus_shutdown), + + /* Bus interface */ + DEVMETHOD(bus_print_child, bus_generic_print_child), + + {0, 0} +}; + +static driver_t ehci_driver = { + "ehci", + ehci_methods, + sizeof(ehci_softc_t), +}; + +static devclass_t ehci_devclass; + +DRIVER_MODULE(ehci, mbus, ehci_driver, ehci_devclass, 0, 0); +MODULE_DEPEND(ehci, usb2_controller, 1, 1, 1); +MODULE_DEPEND(ehci, usb2_core, 1, 1, 1); From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 21:56:34 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 26EFB106566B; Mon, 9 Feb 2009 21:56:34 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 13AB18FC12; Mon, 9 Feb 2009 21:56:34 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n19LuXLt072333; Mon, 9 Feb 2009 21:56:33 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n19LuXc5072322; Mon, 9 Feb 2009 21:56:33 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200902092156.n19LuXc5072322@svn.freebsd.org> From: Andrew Thompson Date: Mon, 9 Feb 2009 21:56:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188411 - head/sys/dev/usb2/core X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Feb 2009 21:56:34 -0000 Author: thompsa Date: Mon Feb 9 21:56:33 2009 New Revision: 188411 URL: http://svn.freebsd.org/changeset/base/188411 Log: MFp4 //depot/projects/usb; 157069, 157429, 157430 - Change "usb2_pause_mtx" so that it takes the timeout value in ticks - Factor out USB ethernet and USB serial driver specific control request. - USB process naming cleanup. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb2/core/usb2_core.h head/sys/dev/usb2/core/usb2_device.c head/sys/dev/usb2/core/usb2_hub.c head/sys/dev/usb2/core/usb2_msctest.c head/sys/dev/usb2/core/usb2_process.c head/sys/dev/usb2/core/usb2_process.h head/sys/dev/usb2/core/usb2_request.c head/sys/dev/usb2/core/usb2_request.h head/sys/dev/usb2/core/usb2_transfer.c head/sys/dev/usb2/core/usb2_util.c head/sys/dev/usb2/core/usb2_util.h Modified: head/sys/dev/usb2/core/usb2_core.h ============================================================================== --- head/sys/dev/usb2/core/usb2_core.h Mon Feb 9 21:50:04 2009 (r188410) +++ head/sys/dev/usb2/core/usb2_core.h Mon Feb 9 21:56:33 2009 (r188411) @@ -434,6 +434,7 @@ uint8_t usb2_clear_stall_callback(struct uint8_t usb2_get_interface_altindex(struct usb2_interface *iface); usb2_error_t usb2_set_alt_interface_index(struct usb2_device *udev, uint8_t iface_index, uint8_t alt_index); +uint8_t usb2_get_mode(struct usb2_device *udev); uint8_t usb2_get_speed(struct usb2_device *udev); uint32_t usb2_get_isoc_fps(struct usb2_device *udev); usb2_error_t usb2_transfer_setup(struct usb2_device *udev, Modified: head/sys/dev/usb2/core/usb2_device.c ============================================================================== --- head/sys/dev/usb2/core/usb2_device.c Mon Feb 9 21:50:04 2009 (r188410) +++ head/sys/dev/usb2/core/usb2_device.c Mon Feb 9 21:56:33 2009 (r188411) @@ -1401,7 +1401,8 @@ usb2_alloc_device(device_t parent_dev, s "(ignored)\n", udev->address); } /* allow device time to set new address */ - usb2_pause_mtx(&Giant, USB_SET_ADDRESS_SETTLE); + usb2_pause_mtx(&Giant, + USB_MS_TO_TICKS(USB_SET_ADDRESS_SETTLE)); } else { /* We are not self powered */ udev->flags.self_powered = 0; @@ -1951,6 +1952,20 @@ usb2_check_strings(struct usb2_device *u } } +/* + * Returns: + * See: USB_MODE_XXX + */ +uint8_t +usb2_get_mode(struct usb2_device *udev) +{ + return (udev->flags.usb2_mode); +} + +/* + * Returns: + * See: USB_SPEED_XXX + */ uint8_t usb2_get_speed(struct usb2_device *udev) { Modified: head/sys/dev/usb2/core/usb2_hub.c ============================================================================== --- head/sys/dev/usb2/core/usb2_hub.c Mon Feb 9 21:50:04 2009 (r188410) +++ head/sys/dev/usb2/core/usb2_hub.c Mon Feb 9 21:56:33 2009 (r188411) @@ -335,7 +335,8 @@ repeat: /* wait for maximum device power up time */ - usb2_pause_mtx(&Giant, USB_PORT_POWERUP_DELAY); + usb2_pause_mtx(&Giant, + USB_MS_TO_TICKS(USB_PORT_POWERUP_DELAY)); /* reset port, which implies enabling it */ @@ -736,7 +737,7 @@ uhub_attach(device_t dev) goto error; } /* wait with power off for a while */ - usb2_pause_mtx(&Giant, USB_POWER_DOWN_TIME); + usb2_pause_mtx(&Giant, USB_MS_TO_TICKS(USB_POWER_DOWN_TIME)); /* * To have the best chance of success we do things in the exact same @@ -794,7 +795,7 @@ uhub_attach(device_t dev) portno); /* wait for stable power */ - usb2_pause_mtx(&Giant, pwrdly); + usb2_pause_mtx(&Giant, USB_MS_TO_TICKS(pwrdly)); } device_printf(dev, "%d port%s with %d " @@ -1666,7 +1667,7 @@ usb2_dev_resume_peer(struct usb2_device return; } /* resume settle time */ - usb2_pause_mtx(&Giant, USB_PORT_RESUME_DELAY); + usb2_pause_mtx(&Giant, USB_MS_TO_TICKS(USB_PORT_RESUME_DELAY)); if (bus->methods->device_resume != NULL) { /* resume USB device on the USB controller */ @@ -1802,7 +1803,7 @@ repeat: /* do DMA delay */ temp = usb2_get_dma_delay(udev->bus); - usb2_pause_mtx(&Giant, temp); + usb2_pause_mtx(&Giant, USB_MS_TO_TICKS(temp)); } /* suspend current port */ Modified: head/sys/dev/usb2/core/usb2_msctest.c ============================================================================== --- head/sys/dev/usb2/core/usb2_msctest.c Mon Feb 9 21:50:04 2009 (r188410) +++ head/sys/dev/usb2/core/usb2_msctest.c Mon Feb 9 21:56:33 2009 (r188411) @@ -562,7 +562,7 @@ repeat_inquiry: goto done; } } else if ((err != 2) && --timeout) { - usb2_pause_mtx(&sc->mtx, USB_MS_HZ); + usb2_pause_mtx(&sc->mtx, hz); goto repeat_inquiry; } err = USB_ERR_INVAL; Modified: head/sys/dev/usb2/core/usb2_process.c ============================================================================== --- head/sys/dev/usb2/core/usb2_process.c Mon Feb 9 21:50:04 2009 (r188410) +++ head/sys/dev/usb2/core/usb2_process.c Mon Feb 9 21:56:33 2009 (r188411) @@ -164,7 +164,7 @@ usb2_process(void *arg) } /*------------------------------------------------------------------------* - * usb2_proc_setup + * usb2_proc_create * * This function will create a process using the given "prio" that can * execute callbacks. The mutex pointed to by "p_mtx" will be applied @@ -176,8 +176,9 @@ usb2_process(void *arg) * 0: success * Else: failure *------------------------------------------------------------------------*/ -uint8_t -usb2_proc_setup(struct usb2_process *up, struct mtx *p_mtx, uint8_t prio) +int +usb2_proc_create(struct usb2_process *up, struct mtx *p_mtx, + const char *pmesg, uint8_t prio) { up->up_mtx = p_mtx; up->up_prio = prio; @@ -188,7 +189,7 @@ usb2_proc_setup(struct usb2_process *up, usb2_cv_init(&up->up_drain, "dmsg"); if (USB_THREAD_CREATE(&usb2_process, up, - &up->up_ptr, "usbproc")) { + &up->up_ptr, pmesg)) { DPRINTFN(0, "Unable to create USB process."); up->up_ptr = NULL; goto error; @@ -196,12 +197,12 @@ usb2_proc_setup(struct usb2_process *up, return (0); error: - usb2_proc_unsetup(up); - return (1); + usb2_proc_free(up); + return (ENOMEM); } /*------------------------------------------------------------------------* - * usb2_proc_unsetup + * usb2_proc_free * * NOTE: If the structure pointed to by "up" is all zero, this * function does nothing. @@ -210,7 +211,7 @@ error: * removed nor called. *------------------------------------------------------------------------*/ void -usb2_proc_unsetup(struct usb2_process *up) +usb2_proc_free(struct usb2_process *up) { if (!(up->up_mtx)) { /* not initialised */ Modified: head/sys/dev/usb2/core/usb2_process.h ============================================================================== --- head/sys/dev/usb2/core/usb2_process.h Mon Feb 9 21:50:04 2009 (r188410) +++ head/sys/dev/usb2/core/usb2_process.h Mon Feb 9 21:56:33 2009 (r188411) @@ -79,12 +79,12 @@ struct usb2_process { uint8_t usb2_proc_cwait(struct usb2_process *up, int timeout); uint8_t usb2_proc_is_gone(struct usb2_process *up); -uint8_t usb2_proc_setup(struct usb2_process *up, struct mtx *p_mtx, - uint8_t prio); +int usb2_proc_create(struct usb2_process *up, struct mtx *p_mtx, + const char *pmesg, uint8_t prio); void usb2_proc_csignal(struct usb2_process *up); void usb2_proc_drain(struct usb2_process *up); void usb2_proc_mwait(struct usb2_process *up, void *pm0, void *pm1); -void usb2_proc_unsetup(struct usb2_process *up); +void usb2_proc_free(struct usb2_process *up); void *usb2_proc_msignal(struct usb2_process *up, void *pm0, void *pm1); #endif /* _USB2_PROCESS_H_ */ Modified: head/sys/dev/usb2/core/usb2_request.c ============================================================================== --- head/sys/dev/usb2/core/usb2_request.c Mon Feb 9 21:50:04 2009 (r188410) +++ head/sys/dev/usb2/core/usb2_request.c Mon Feb 9 21:56:33 2009 (r188411) @@ -371,7 +371,7 @@ usb2_do_request_flags(struct usb2_device if (temp > 0) { usb2_pause_mtx( xfer->xroot->xfer_mtx, - temp); + USB_MS_TO_TICKS(temp)); } #endif xfer->flags.manual_status = 0; @@ -477,6 +477,49 @@ done: } /*------------------------------------------------------------------------* + * usb2_do_request_proc - factored out code + * + * This function is factored out code. It does basically the same like + * usb2_do_request_flags, except it will check the status of the + * passed process argument before doing the USB request. If the + * process is draining the USB_ERR_IOERROR code will be returned. It + * is assumed that the mutex associated with the process is locked + * when calling this function. + *------------------------------------------------------------------------*/ +usb2_error_t +usb2_do_request_proc(struct usb2_device *udev, struct usb2_process *pproc, + struct usb2_device_request *req, void *data, uint32_t flags, + uint16_t *actlen, uint32_t timeout) +{ + usb2_error_t err; + uint16_t len; + + /* get request data length */ + len = UGETW(req->wLength); + + /* check if the device is being detached */ + if (usb2_proc_is_gone(pproc)) { + err = USB_ERR_IOERROR; + goto done; + } + + /* forward the USB request */ + err = usb2_do_request_flags(udev, pproc->up_mtx, + req, data, flags, actlen, timeout); + +done: + /* on failure we zero the data */ + /* on short packet we zero the unused data */ + if ((len != 0) && (req->bmRequestType & UE_DIR_IN)) { + if (err) + memset(data, 0, len); + else if (actlen && *actlen != len) + memset(((uint8_t *)data) + *actlen, 0, len - *actlen); + } + return (err); +} + +/*------------------------------------------------------------------------* * usb2_req_reset_port * * This function will instruct an USB HUB to perform a reset sequence @@ -520,11 +563,11 @@ usb2_req_reset_port(struct usb2_device * while (1) { #if USB_DEBUG /* wait for the device to recover from reset */ - usb2_pause_mtx(mtx, pr_poll_delay); + usb2_pause_mtx(mtx, USB_MS_TO_TICKS(pr_poll_delay)); n += pr_poll_delay; #else /* wait for the device to recover from reset */ - usb2_pause_mtx(mtx, USB_PORT_RESET_DELAY); + usb2_pause_mtx(mtx, USB_MS_TO_TICKS(USB_PORT_RESET_DELAY)); n += USB_PORT_RESET_DELAY; #endif err = usb2_req_get_port_status(udev, mtx, &ps, port); @@ -559,10 +602,10 @@ usb2_req_reset_port(struct usb2_device * } #if USB_DEBUG /* wait for the device to recover from reset */ - usb2_pause_mtx(mtx, pr_recovery_delay); + usb2_pause_mtx(mtx, USB_MS_TO_TICKS(pr_recovery_delay)); #else /* wait for the device to recover from reset */ - usb2_pause_mtx(mtx, USB_PORT_RESET_RECOVERY); + usb2_pause_mtx(mtx, USB_MS_TO_TICKS(USB_PORT_RESET_RECOVERY)); #endif done: @@ -624,7 +667,7 @@ usb2_req_get_desc(struct usb2_device *ud } retries--; - usb2_pause_mtx(mtx, 200); + usb2_pause_mtx(mtx, hz / 5); continue; } @@ -1369,7 +1412,7 @@ retry: udev->address = old_addr; /* allow device time to set new address */ - usb2_pause_mtx(mtx, USB_SET_ADDRESS_SETTLE); + usb2_pause_mtx(mtx, USB_MS_TO_TICKS(USB_SET_ADDRESS_SETTLE)); /* get the device descriptor */ err = usb2_req_get_desc(udev, mtx, &udev->ddesc, @@ -1389,7 +1432,7 @@ retry: done: if (err && do_retry) { /* give the USB firmware some time to load */ - usb2_pause_mtx(mtx, 500); + usb2_pause_mtx(mtx, hz / 2); /* no more retries after this retry */ do_retry = 0; /* try again */ Modified: head/sys/dev/usb2/core/usb2_request.h ============================================================================== --- head/sys/dev/usb2/core/usb2_request.h Mon Feb 9 21:50:04 2009 (r188410) +++ head/sys/dev/usb2/core/usb2_request.h Mon Feb 9 21:56:33 2009 (r188411) @@ -27,9 +27,14 @@ #ifndef _USB2_REQUEST_H_ #define _USB2_REQUEST_H_ +struct usb2_process; + usb2_error_t usb2_do_request_flags(struct usb2_device *udev, struct mtx *mtx, struct usb2_device_request *req, void *data, uint32_t flags, uint16_t *actlen, uint32_t timeout); +usb2_error_t usb2_do_request_proc(struct usb2_device *udev, struct usb2_process *pproc, + struct usb2_device_request *req, void *data, uint32_t flags, + uint16_t *actlen, uint32_t timeout); usb2_error_t usb2_req_clear_hub_feature(struct usb2_device *udev, struct mtx *mtx, uint16_t sel); usb2_error_t usb2_req_clear_port_feature(struct usb2_device *udev, Modified: head/sys/dev/usb2/core/usb2_transfer.c ============================================================================== --- head/sys/dev/usb2/core/usb2_transfer.c Mon Feb 9 21:50:04 2009 (r188410) +++ head/sys/dev/usb2/core/usb2_transfer.c Mon Feb 9 21:56:33 2009 (r188411) @@ -1066,7 +1066,8 @@ usb2_transfer_unsetup_sub(struct usb2_xf if (needs_delay) { temp = usb2_get_dma_delay(info->bus); - usb2_pause_mtx(&info->bus->bus_mtx, temp); + usb2_pause_mtx(&info->bus->bus_mtx, + USB_MS_TO_TICKS(temp)); } /* make sure that our done messages are not queued anywhere */ Modified: head/sys/dev/usb2/core/usb2_util.c ============================================================================== --- head/sys/dev/usb2/core/usb2_util.c Mon Feb 9 21:50:04 2009 (r188410) +++ head/sys/dev/usb2/core/usb2_util.c Mon Feb 9 21:56:33 2009 (r188411) @@ -124,36 +124,37 @@ device_set_usb2_desc(device_t dev) /*------------------------------------------------------------------------* * usb2_pause_mtx - factored out code * - * This function will delay the code by the passed number of - * milliseconds. The passed mutex "mtx" will be dropped while waiting, - * if "mtx" is not NULL. The number of milliseconds per second is 1024 - * for sake of optimisation. + * This function will delay the code by the passed number of system + * ticks. The passed mutex "mtx" will be dropped while waiting, if + * "mtx" is not NULL. *------------------------------------------------------------------------*/ void -usb2_pause_mtx(struct mtx *mtx, uint32_t ms) +usb2_pause_mtx(struct mtx *mtx, int _ticks) { + if (mtx != NULL) + mtx_unlock(mtx); + if (cold) { - ms = (ms + 1) * 1024; - DELAY(ms); + /* convert to milliseconds */ + _ticks = (_ticks * 1000) / hz; + /* convert to microseconds, rounded up */ + _ticks = (_ticks + 1) * 1000; + DELAY(_ticks); } else { - ms = USB_MS_TO_TICKS(ms); /* * Add one to the number of ticks so that we don't return * too early! */ - ms++; - - if (mtx != NULL) - mtx_unlock(mtx); + _ticks++; - if (pause("USBWAIT", ms)) { + if (pause("USBWAIT", _ticks)) { /* ignore */ } - if (mtx != NULL) - mtx_lock(mtx); } + if (mtx != NULL) + mtx_lock(mtx); } /*------------------------------------------------------------------------* Modified: head/sys/dev/usb2/core/usb2_util.h ============================================================================== --- head/sys/dev/usb2/core/usb2_util.h Mon Feb 9 21:50:04 2009 (r188410) +++ head/sys/dev/usb2/core/usb2_util.h Mon Feb 9 21:56:33 2009 (r188411) @@ -31,7 +31,7 @@ int device_delete_all_children(device_t uint32_t usb2_get_devid(device_t dev); uint8_t usb2_make_str_desc(void *ptr, uint16_t max_len, const char *s); void device_set_usb2_desc(device_t dev); -void usb2_pause_mtx(struct mtx *mtx, uint32_t ms); +void usb2_pause_mtx(struct mtx *mtx, int _ticks); void usb2_printBCD(char *p, uint16_t p_len, uint16_t bcd); void usb2_trim_spaces(char *p); From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 22:02:38 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4F9AC1065670; Mon, 9 Feb 2009 22:02:38 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3A9DE8FC17; Mon, 9 Feb 2009 22:02:38 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n19M2cgv072511; Mon, 9 Feb 2009 22:02:38 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n19M2c5p072509; Mon, 9 Feb 2009 22:02:38 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200902092202.n19M2c5p072509@svn.freebsd.org> From: Andrew Thompson Date: Mon, 9 Feb 2009 22:02:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188412 - in head/sys/dev/usb2: ethernet include template X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Feb 2009 22:02:38 -0000 Author: thompsa Date: Mon Feb 9 22:02:38 2009 New Revision: 188412 URL: http://svn.freebsd.org/changeset/base/188412 Log: MFp4 //depot/projects/usb; 157100 1. Move most of the ifnet logic into the usb2_ethernet module, this includes, - make all usb ethernet interfaces named ue%d - handle all threading in usb2_ethernet - provide default ioctl handler - handle mbuf rx - provide locked callbacks for init,start,stop,etc 2. Cleanup CDC-Ethernet driver. Submitted by: Hans Petter Selasky Obtained from: svn.freebsd.org/base/user/thompsa/usb [1] Modified: head/sys/dev/usb2/ethernet/if_aue2.c head/sys/dev/usb2/ethernet/if_auereg.h head/sys/dev/usb2/ethernet/if_axe2.c head/sys/dev/usb2/ethernet/if_axereg.h head/sys/dev/usb2/ethernet/if_cdce2.c head/sys/dev/usb2/ethernet/if_cdcereg.h head/sys/dev/usb2/ethernet/if_cue2.c head/sys/dev/usb2/ethernet/if_cuereg.h head/sys/dev/usb2/ethernet/if_kue2.c head/sys/dev/usb2/ethernet/if_kuereg.h head/sys/dev/usb2/ethernet/if_rue2.c head/sys/dev/usb2/ethernet/if_ruereg.h head/sys/dev/usb2/ethernet/if_udav2.c head/sys/dev/usb2/ethernet/if_udavreg.h head/sys/dev/usb2/ethernet/usb2_ethernet.c head/sys/dev/usb2/ethernet/usb2_ethernet.h head/sys/dev/usb2/include/usb2_cdc.h head/sys/dev/usb2/template/usb2_template_cdce.c Modified: head/sys/dev/usb2/ethernet/if_aue2.c ============================================================================== --- head/sys/dev/usb2/ethernet/if_aue2.c Mon Feb 9 21:56:33 2009 (r188411) +++ head/sys/dev/usb2/ethernet/if_aue2.c Mon Feb 9 22:02:38 2009 (r188412) @@ -2,6 +2,9 @@ * Copyright (c) 1997, 1998, 1999, 2000 * Bill Paul . All rights reserved. * + * Copyright (c) 2006 + * Alfred Perlstein . All rights reserved. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -40,6 +43,9 @@ __FBSDID("$FreeBSD$"); * Written by Bill Paul * Electrical Engineering Department * Columbia University, New York City + * + * SMP locking by Alfred Perlstein . + * RED Inc. */ /* @@ -58,13 +64,8 @@ __FBSDID("$FreeBSD$"); * the controller uses an external PHY chip, it's possible that board * designers might simply choose a 10Mbps PHY. * - * Registers are accessed using usb2_do_request(). Packet transfers are - * done using usb2_transfer() and friends. - */ - -/* - * NOTE: all function names beginning like "aue_cfg_" can only - * be called from within the config thread function ! + * Registers are accessed using usb2_ether_do_request(). Packet + * transfers are done using usb2_transfer() and friends. */ #include @@ -72,15 +73,11 @@ __FBSDID("$FreeBSD$"); #include #include -#define usb2_config_td_cc usb2_ether_cc -#define usb2_config_td_softc aue_softc - #define USB_DEBUG_VAR aue_debug #include #include #include -#include #include #include #include @@ -89,11 +86,6 @@ __FBSDID("$FreeBSD$"); #include #include -MODULE_DEPEND(aue, usb2_ethernet, 1, 1, 1); -MODULE_DEPEND(aue, usb2_core, 1, 1, 1); -MODULE_DEPEND(aue, ether, 1, 1, 1); -MODULE_DEPEND(aue, miibus, 1, 1, 1); - #if USB_DEBUG static int aue_debug = 0; @@ -106,74 +98,74 @@ SYSCTL_INT(_hw_usb2_aue, OID_AUTO, debug * Various supported device vendors/products. */ static const struct usb2_device_id aue_devs[] = { - {USB_VPI(USB_VENDOR_3COM, USB_PRODUCT_3COM_3C460B, AUE_FLAG_PII)}, - {USB_VPI(USB_VENDOR_ABOCOM, USB_PRODUCT_ABOCOM_DSB650TX_PNA, 0)}, - {USB_VPI(USB_VENDOR_ABOCOM, USB_PRODUCT_ABOCOM_UFE1000, AUE_FLAG_LSYS)}, - {USB_VPI(USB_VENDOR_ABOCOM, USB_PRODUCT_ABOCOM_XX10, 0)}, - {USB_VPI(USB_VENDOR_ABOCOM, USB_PRODUCT_ABOCOM_XX1, AUE_FLAG_PNA | AUE_FLAG_PII)}, - {USB_VPI(USB_VENDOR_ABOCOM, USB_PRODUCT_ABOCOM_XX2, AUE_FLAG_PII)}, - {USB_VPI(USB_VENDOR_ABOCOM, USB_PRODUCT_ABOCOM_XX4, AUE_FLAG_PNA)}, - {USB_VPI(USB_VENDOR_ABOCOM, USB_PRODUCT_ABOCOM_XX5, AUE_FLAG_PNA)}, - {USB_VPI(USB_VENDOR_ABOCOM, USB_PRODUCT_ABOCOM_XX6, AUE_FLAG_PII)}, - {USB_VPI(USB_VENDOR_ABOCOM, USB_PRODUCT_ABOCOM_XX7, AUE_FLAG_PII)}, - {USB_VPI(USB_VENDOR_ABOCOM, USB_PRODUCT_ABOCOM_XX8, AUE_FLAG_PII)}, - {USB_VPI(USB_VENDOR_ABOCOM, USB_PRODUCT_ABOCOM_XX9, AUE_FLAG_PNA)}, - {USB_VPI(USB_VENDOR_ACCTON, USB_PRODUCT_ACCTON_SS1001, AUE_FLAG_PII)}, - {USB_VPI(USB_VENDOR_ACCTON, USB_PRODUCT_ACCTON_USB320_EC, 0)}, - {USB_VPI(USB_VENDOR_ADMTEK, USB_PRODUCT_ADMTEK_PEGASUSII_2, AUE_FLAG_PII)}, - {USB_VPI(USB_VENDOR_ADMTEK, USB_PRODUCT_ADMTEK_PEGASUSII_3, AUE_FLAG_PII)}, - {USB_VPI(USB_VENDOR_ADMTEK, USB_PRODUCT_ADMTEK_PEGASUSII_4, AUE_FLAG_PII)}, - {USB_VPI(USB_VENDOR_ADMTEK, USB_PRODUCT_ADMTEK_PEGASUSII, AUE_FLAG_PII)}, - {USB_VPI(USB_VENDOR_ADMTEK, USB_PRODUCT_ADMTEK_PEGASUS, AUE_FLAG_PNA | AUE_FLAG_DUAL_PHY)}, - {USB_VPI(USB_VENDOR_AEI, USB_PRODUCT_AEI_FASTETHERNET, AUE_FLAG_PII)}, - {USB_VPI(USB_VENDOR_ALLIEDTELESYN, USB_PRODUCT_ALLIEDTELESYN_ATUSB100, AUE_FLAG_PII)}, - {USB_VPI(USB_VENDOR_ATEN, USB_PRODUCT_ATEN_UC110T, AUE_FLAG_PII)}, - {USB_VPI(USB_VENDOR_BELKIN, USB_PRODUCT_BELKIN_USB2LAN, AUE_FLAG_PII)}, - {USB_VPI(USB_VENDOR_BILLIONTON, USB_PRODUCT_BILLIONTON_USB100, 0)}, - {USB_VPI(USB_VENDOR_BILLIONTON, USB_PRODUCT_BILLIONTON_USBE100, AUE_FLAG_PII)}, - {USB_VPI(USB_VENDOR_BILLIONTON, USB_PRODUCT_BILLIONTON_USBEL100, 0)}, - {USB_VPI(USB_VENDOR_BILLIONTON, USB_PRODUCT_BILLIONTON_USBLP100, AUE_FLAG_PNA)}, - {USB_VPI(USB_VENDOR_COREGA, USB_PRODUCT_COREGA_FETHER_USB_TXS, AUE_FLAG_PII)}, - {USB_VPI(USB_VENDOR_COREGA, USB_PRODUCT_COREGA_FETHER_USB_TX, 0)}, - {USB_VPI(USB_VENDOR_DLINK, USB_PRODUCT_DLINK_DSB650TX1, AUE_FLAG_LSYS)}, - {USB_VPI(USB_VENDOR_DLINK, USB_PRODUCT_DLINK_DSB650TX2, AUE_FLAG_LSYS | AUE_FLAG_PII)}, - {USB_VPI(USB_VENDOR_DLINK, USB_PRODUCT_DLINK_DSB650TX3, AUE_FLAG_LSYS | AUE_FLAG_PII)}, - {USB_VPI(USB_VENDOR_DLINK, USB_PRODUCT_DLINK_DSB650TX4, AUE_FLAG_LSYS | AUE_FLAG_PII)}, - {USB_VPI(USB_VENDOR_DLINK, USB_PRODUCT_DLINK_DSB650TX_PNA, AUE_FLAG_PNA)}, - {USB_VPI(USB_VENDOR_DLINK, USB_PRODUCT_DLINK_DSB650TX, AUE_FLAG_LSYS)}, - {USB_VPI(USB_VENDOR_DLINK, USB_PRODUCT_DLINK_DSB650, AUE_FLAG_LSYS)}, - {USB_VPI(USB_VENDOR_ELCON, USB_PRODUCT_ELCON_PLAN, AUE_FLAG_PNA | AUE_FLAG_PII)}, - {USB_VPI(USB_VENDOR_ELECOM, USB_PRODUCT_ELECOM_LDUSB20, AUE_FLAG_PII)}, - {USB_VPI(USB_VENDOR_ELECOM, USB_PRODUCT_ELECOM_LDUSBLTX, AUE_FLAG_PII)}, - {USB_VPI(USB_VENDOR_ELECOM, USB_PRODUCT_ELECOM_LDUSBTX0, 0)}, - {USB_VPI(USB_VENDOR_ELECOM, USB_PRODUCT_ELECOM_LDUSBTX1, AUE_FLAG_LSYS)}, - {USB_VPI(USB_VENDOR_ELECOM, USB_PRODUCT_ELECOM_LDUSBTX2, 0)}, - {USB_VPI(USB_VENDOR_ELECOM, USB_PRODUCT_ELECOM_LDUSBTX3, AUE_FLAG_LSYS)}, - {USB_VPI(USB_VENDOR_ELSA, USB_PRODUCT_ELSA_USB2ETHERNET, 0)}, - {USB_VPI(USB_VENDOR_GIGABYTE, USB_PRODUCT_GIGABYTE_GNBR402W, 0)}, - {USB_VPI(USB_VENDOR_HAWKING, USB_PRODUCT_HAWKING_UF100, AUE_FLAG_PII)}, - {USB_VPI(USB_VENDOR_HP, USB_PRODUCT_HP_HN210E, AUE_FLAG_PII)}, - {USB_VPI(USB_VENDOR_IODATA, USB_PRODUCT_IODATA_USBETTXS, AUE_FLAG_PII)}, - {USB_VPI(USB_VENDOR_IODATA, USB_PRODUCT_IODATA_USBETTX, 0)}, - {USB_VPI(USB_VENDOR_KINGSTON, USB_PRODUCT_KINGSTON_KNU101TX, 0)}, - {USB_VPI(USB_VENDOR_LINKSYS, USB_PRODUCT_LINKSYS_USB100H1, AUE_FLAG_LSYS | AUE_FLAG_PNA)}, - {USB_VPI(USB_VENDOR_LINKSYS, USB_PRODUCT_LINKSYS_USB100TX, AUE_FLAG_LSYS)}, - {USB_VPI(USB_VENDOR_LINKSYS, USB_PRODUCT_LINKSYS_USB10TA, AUE_FLAG_LSYS)}, - {USB_VPI(USB_VENDOR_LINKSYS, USB_PRODUCT_LINKSYS_USB10TX1, AUE_FLAG_LSYS | AUE_FLAG_PII)}, - {USB_VPI(USB_VENDOR_LINKSYS, USB_PRODUCT_LINKSYS_USB10TX2, AUE_FLAG_LSYS | AUE_FLAG_PII)}, - {USB_VPI(USB_VENDOR_LINKSYS, USB_PRODUCT_LINKSYS_USB10T, AUE_FLAG_LSYS)}, - {USB_VPI(USB_VENDOR_MELCO, USB_PRODUCT_MELCO_LUA2TX5, AUE_FLAG_PII)}, - {USB_VPI(USB_VENDOR_MELCO, USB_PRODUCT_MELCO_LUATX1, 0)}, - {USB_VPI(USB_VENDOR_MELCO, USB_PRODUCT_MELCO_LUATX5, 0)}, - {USB_VPI(USB_VENDOR_MICROSOFT, USB_PRODUCT_MICROSOFT_MN110, AUE_FLAG_PII)}, - {USB_VPI(USB_VENDOR_NETGEAR, USB_PRODUCT_NETGEAR_FA101, AUE_FLAG_PII)}, - {USB_VPI(USB_VENDOR_SIEMENS, USB_PRODUCT_SIEMENS_SPEEDSTREAM, AUE_FLAG_PII)}, - {USB_VPI(USB_VENDOR_SIIG2, USB_PRODUCT_SIIG2_USBTOETHER, AUE_FLAG_PII)}, - {USB_VPI(USB_VENDOR_SMARTBRIDGES, USB_PRODUCT_SMARTBRIDGES_SMARTNIC, AUE_FLAG_PII)}, - {USB_VPI(USB_VENDOR_SMC, USB_PRODUCT_SMC_2202USB, 0)}, - {USB_VPI(USB_VENDOR_SMC, USB_PRODUCT_SMC_2206USB, AUE_FLAG_PII)}, - {USB_VPI(USB_VENDOR_SOHOWARE, USB_PRODUCT_SOHOWARE_NUB100, 0)}, - {USB_VPI(USB_VENDOR_SOHOWARE, USB_PRODUCT_SOHOWARE_NUB110, AUE_FLAG_PII)}, + {USB_VPI(USB_VENDOR_3COM, USB_PRODUCT_3COM_3C460B, AUE_FLAG_PII)}, + {USB_VPI(USB_VENDOR_ABOCOM, USB_PRODUCT_ABOCOM_DSB650TX_PNA, 0)}, + {USB_VPI(USB_VENDOR_ABOCOM, USB_PRODUCT_ABOCOM_UFE1000, AUE_FLAG_LSYS)}, + {USB_VPI(USB_VENDOR_ABOCOM, USB_PRODUCT_ABOCOM_XX10, 0)}, + {USB_VPI(USB_VENDOR_ABOCOM, USB_PRODUCT_ABOCOM_XX1, AUE_FLAG_PNA | AUE_FLAG_PII)}, + {USB_VPI(USB_VENDOR_ABOCOM, USB_PRODUCT_ABOCOM_XX2, AUE_FLAG_PII)}, + {USB_VPI(USB_VENDOR_ABOCOM, USB_PRODUCT_ABOCOM_XX4, AUE_FLAG_PNA)}, + {USB_VPI(USB_VENDOR_ABOCOM, USB_PRODUCT_ABOCOM_XX5, AUE_FLAG_PNA)}, + {USB_VPI(USB_VENDOR_ABOCOM, USB_PRODUCT_ABOCOM_XX6, AUE_FLAG_PII)}, + {USB_VPI(USB_VENDOR_ABOCOM, USB_PRODUCT_ABOCOM_XX7, AUE_FLAG_PII)}, + {USB_VPI(USB_VENDOR_ABOCOM, USB_PRODUCT_ABOCOM_XX8, AUE_FLAG_PII)}, + {USB_VPI(USB_VENDOR_ABOCOM, USB_PRODUCT_ABOCOM_XX9, AUE_FLAG_PNA)}, + {USB_VPI(USB_VENDOR_ACCTON, USB_PRODUCT_ACCTON_SS1001, AUE_FLAG_PII)}, + {USB_VPI(USB_VENDOR_ACCTON, USB_PRODUCT_ACCTON_USB320_EC, 0)}, + {USB_VPI(USB_VENDOR_ADMTEK, USB_PRODUCT_ADMTEK_PEGASUSII_2, AUE_FLAG_PII)}, + {USB_VPI(USB_VENDOR_ADMTEK, USB_PRODUCT_ADMTEK_PEGASUSII_3, AUE_FLAG_PII)}, + {USB_VPI(USB_VENDOR_ADMTEK, USB_PRODUCT_ADMTEK_PEGASUSII_4, AUE_FLAG_PII)}, + {USB_VPI(USB_VENDOR_ADMTEK, USB_PRODUCT_ADMTEK_PEGASUSII, AUE_FLAG_PII)}, + {USB_VPI(USB_VENDOR_ADMTEK, USB_PRODUCT_ADMTEK_PEGASUS, AUE_FLAG_PNA | AUE_FLAG_DUAL_PHY)}, + {USB_VPI(USB_VENDOR_AEI, USB_PRODUCT_AEI_FASTETHERNET, AUE_FLAG_PII)}, + {USB_VPI(USB_VENDOR_ALLIEDTELESYN, USB_PRODUCT_ALLIEDTELESYN_ATUSB100, AUE_FLAG_PII)}, + {USB_VPI(USB_VENDOR_ATEN, USB_PRODUCT_ATEN_UC110T, AUE_FLAG_PII)}, + {USB_VPI(USB_VENDOR_BELKIN, USB_PRODUCT_BELKIN_USB2LAN, AUE_FLAG_PII)}, + {USB_VPI(USB_VENDOR_BILLIONTON, USB_PRODUCT_BILLIONTON_USB100, 0)}, + {USB_VPI(USB_VENDOR_BILLIONTON, USB_PRODUCT_BILLIONTON_USBE100, AUE_FLAG_PII)}, + {USB_VPI(USB_VENDOR_BILLIONTON, USB_PRODUCT_BILLIONTON_USBEL100, 0)}, + {USB_VPI(USB_VENDOR_BILLIONTON, USB_PRODUCT_BILLIONTON_USBLP100, AUE_FLAG_PNA)}, + {USB_VPI(USB_VENDOR_COREGA, USB_PRODUCT_COREGA_FETHER_USB_TXS, AUE_FLAG_PII)}, + {USB_VPI(USB_VENDOR_COREGA, USB_PRODUCT_COREGA_FETHER_USB_TX, 0)}, + {USB_VPI(USB_VENDOR_DLINK, USB_PRODUCT_DLINK_DSB650TX1, AUE_FLAG_LSYS)}, + {USB_VPI(USB_VENDOR_DLINK, USB_PRODUCT_DLINK_DSB650TX2, AUE_FLAG_LSYS | AUE_FLAG_PII)}, + {USB_VPI(USB_VENDOR_DLINK, USB_PRODUCT_DLINK_DSB650TX3, AUE_FLAG_LSYS | AUE_FLAG_PII)}, + {USB_VPI(USB_VENDOR_DLINK, USB_PRODUCT_DLINK_DSB650TX4, AUE_FLAG_LSYS | AUE_FLAG_PII)}, + {USB_VPI(USB_VENDOR_DLINK, USB_PRODUCT_DLINK_DSB650TX_PNA, AUE_FLAG_PNA)}, + {USB_VPI(USB_VENDOR_DLINK, USB_PRODUCT_DLINK_DSB650TX, AUE_FLAG_LSYS)}, + {USB_VPI(USB_VENDOR_DLINK, USB_PRODUCT_DLINK_DSB650, AUE_FLAG_LSYS)}, + {USB_VPI(USB_VENDOR_ELCON, USB_PRODUCT_ELCON_PLAN, AUE_FLAG_PNA | AUE_FLAG_PII)}, + {USB_VPI(USB_VENDOR_ELECOM, USB_PRODUCT_ELECOM_LDUSB20, AUE_FLAG_PII)}, + {USB_VPI(USB_VENDOR_ELECOM, USB_PRODUCT_ELECOM_LDUSBLTX, AUE_FLAG_PII)}, + {USB_VPI(USB_VENDOR_ELECOM, USB_PRODUCT_ELECOM_LDUSBTX0, 0)}, + {USB_VPI(USB_VENDOR_ELECOM, USB_PRODUCT_ELECOM_LDUSBTX1, AUE_FLAG_LSYS)}, + {USB_VPI(USB_VENDOR_ELECOM, USB_PRODUCT_ELECOM_LDUSBTX2, 0)}, + {USB_VPI(USB_VENDOR_ELECOM, USB_PRODUCT_ELECOM_LDUSBTX3, AUE_FLAG_LSYS)}, + {USB_VPI(USB_VENDOR_ELSA, USB_PRODUCT_ELSA_USB2ETHERNET, 0)}, + {USB_VPI(USB_VENDOR_GIGABYTE, USB_PRODUCT_GIGABYTE_GNBR402W, 0)}, + {USB_VPI(USB_VENDOR_HAWKING, USB_PRODUCT_HAWKING_UF100, AUE_FLAG_PII)}, + {USB_VPI(USB_VENDOR_HP, USB_PRODUCT_HP_HN210E, AUE_FLAG_PII)}, + {USB_VPI(USB_VENDOR_IODATA, USB_PRODUCT_IODATA_USBETTXS, AUE_FLAG_PII)}, + {USB_VPI(USB_VENDOR_IODATA, USB_PRODUCT_IODATA_USBETTX, 0)}, + {USB_VPI(USB_VENDOR_KINGSTON, USB_PRODUCT_KINGSTON_KNU101TX, 0)}, + {USB_VPI(USB_VENDOR_LINKSYS, USB_PRODUCT_LINKSYS_USB100H1, AUE_FLAG_LSYS | AUE_FLAG_PNA)}, + {USB_VPI(USB_VENDOR_LINKSYS, USB_PRODUCT_LINKSYS_USB100TX, AUE_FLAG_LSYS)}, + {USB_VPI(USB_VENDOR_LINKSYS, USB_PRODUCT_LINKSYS_USB10TA, AUE_FLAG_LSYS)}, + {USB_VPI(USB_VENDOR_LINKSYS, USB_PRODUCT_LINKSYS_USB10TX1, AUE_FLAG_LSYS | AUE_FLAG_PII)}, + {USB_VPI(USB_VENDOR_LINKSYS, USB_PRODUCT_LINKSYS_USB10TX2, AUE_FLAG_LSYS | AUE_FLAG_PII)}, + {USB_VPI(USB_VENDOR_LINKSYS, USB_PRODUCT_LINKSYS_USB10T, AUE_FLAG_LSYS)}, + {USB_VPI(USB_VENDOR_MELCO, USB_PRODUCT_MELCO_LUA2TX5, AUE_FLAG_PII)}, + {USB_VPI(USB_VENDOR_MELCO, USB_PRODUCT_MELCO_LUATX1, 0)}, + {USB_VPI(USB_VENDOR_MELCO, USB_PRODUCT_MELCO_LUATX5, 0)}, + {USB_VPI(USB_VENDOR_MICROSOFT, USB_PRODUCT_MICROSOFT_MN110, AUE_FLAG_PII)}, + {USB_VPI(USB_VENDOR_NETGEAR, USB_PRODUCT_NETGEAR_FA101, AUE_FLAG_PII)}, + {USB_VPI(USB_VENDOR_SIEMENS, USB_PRODUCT_SIEMENS_SPEEDSTREAM, AUE_FLAG_PII)}, + {USB_VPI(USB_VENDOR_SIIG2, USB_PRODUCT_SIIG2_USBTOETHER, AUE_FLAG_PII)}, + {USB_VPI(USB_VENDOR_SMARTBRIDGES, USB_PRODUCT_SMARTBRIDGES_SMARTNIC, AUE_FLAG_PII)}, + {USB_VPI(USB_VENDOR_SMC, USB_PRODUCT_SMC_2202USB, 0)}, + {USB_VPI(USB_VENDOR_SMC, USB_PRODUCT_SMC_2206USB, AUE_FLAG_PII)}, + {USB_VPI(USB_VENDOR_SOHOWARE, USB_PRODUCT_SOHOWARE_NUB100, 0)}, + {USB_VPI(USB_VENDOR_SOHOWARE, USB_PRODUCT_SOHOWARE_NUB110, AUE_FLAG_PII)}, }; /* prototypes */ @@ -182,48 +174,34 @@ static device_probe_t aue_probe; static device_attach_t aue_attach; static device_detach_t aue_detach; static device_shutdown_t aue_shutdown; +static miibus_readreg_t aue_miibus_readreg; +static miibus_writereg_t aue_miibus_writereg; +static miibus_statchg_t aue_miibus_statchg; -static usb2_callback_t aue_intr_clear_stall_callback; static usb2_callback_t aue_intr_callback; -static usb2_callback_t aue_bulk_read_clear_stall_callback; static usb2_callback_t aue_bulk_read_callback; -static usb2_callback_t aue_bulk_write_clear_stall_callback; static usb2_callback_t aue_bulk_write_callback; -static void aue_cfg_do_request(struct aue_softc *, - struct usb2_device_request *, void *); -static uint8_t aue_cfg_csr_read_1(struct aue_softc *, uint16_t); -static uint16_t aue_cfg_csr_read_2(struct aue_softc *, uint16_t); -static void aue_cfg_csr_write_1(struct aue_softc *, uint16_t, uint8_t); -static void aue_cfg_csr_write_2(struct aue_softc *, uint16_t, uint16_t); -static void aue_cfg_eeprom_getword(struct aue_softc *, uint8_t, uint8_t *); -static void aue_cfg_read_eeprom(struct aue_softc *, uint8_t *, uint16_t, +static usb2_ether_fn_t aue_attach_post; +static usb2_ether_fn_t aue_init; +static usb2_ether_fn_t aue_stop; +static usb2_ether_fn_t aue_start; +static usb2_ether_fn_t aue_tick; +static usb2_ether_fn_t aue_setmulti; +static usb2_ether_fn_t aue_setpromisc; + +static uint8_t aue_csr_read_1(struct aue_softc *, uint16_t); +static uint16_t aue_csr_read_2(struct aue_softc *, uint16_t); +static void aue_csr_write_1(struct aue_softc *, uint16_t, uint8_t); +static void aue_csr_write_2(struct aue_softc *, uint16_t, uint16_t); +static void aue_eeprom_getword(struct aue_softc *, int, uint16_t *); +static void aue_read_eeprom(struct aue_softc *, uint8_t *, uint16_t, uint16_t); +static void aue_reset(struct aue_softc *); +static void aue_reset_pegasus_II(struct aue_softc *); -static miibus_readreg_t aue_cfg_miibus_readreg; -static miibus_writereg_t aue_cfg_miibus_writereg; -static miibus_statchg_t aue_cfg_miibus_statchg; - -static usb2_config_td_command_t aue_cfg_setmulti; -static usb2_config_td_command_t aue_cfg_first_time_setup; -static usb2_config_td_command_t aue_config_copy; -static usb2_config_td_command_t aue_cfg_tick; -static usb2_config_td_command_t aue_cfg_pre_init; -static usb2_config_td_command_t aue_cfg_init; -static usb2_config_td_command_t aue_cfg_promisc_upd; -static usb2_config_td_command_t aue_cfg_ifmedia_upd; -static usb2_config_td_command_t aue_cfg_pre_stop; -static usb2_config_td_command_t aue_cfg_stop; - -static void aue_cfg_reset_pegasus_II(struct aue_softc *); -static void aue_cfg_reset(struct aue_softc *); -static void aue_start_cb(struct ifnet *); -static void aue_init_cb(void *); -static void aue_start_transfers(struct aue_softc *); -static int aue_ifmedia_upd_cb(struct ifnet *); -static void aue_ifmedia_sts_cb(struct ifnet *, struct ifmediareq *); -static int aue_ioctl_cb(struct ifnet *, u_long, caddr_t); -static void aue_watchdog(void *); +static int aue_ifmedia_upd(struct ifnet *); +static void aue_ifmedia_sts(struct ifnet *, struct ifmediareq *); static const struct usb2_config aue_config[AUE_N_TRANSFER] = { @@ -233,7 +211,7 @@ static const struct usb2_config aue_conf .direction = UE_DIR_OUT, .mh.bufsize = (MCLBYTES + 2), .mh.flags = {.pipe_bof = 1,.force_short_xfer = 1,}, - .mh.callback = &aue_bulk_write_callback, + .mh.callback = aue_bulk_write_callback, .mh.timeout = 10000, /* 10 seconds */ }, @@ -243,29 +221,7 @@ static const struct usb2_config aue_conf .direction = UE_DIR_IN, .mh.bufsize = (MCLBYTES + 4 + ETHER_CRC_LEN), .mh.flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, - .mh.callback = &aue_bulk_read_callback, - }, - - [AUE_BULK_CS_WR] = { - .type = UE_CONTROL, - .endpoint = 0x00, /* Control pipe */ - .direction = UE_DIR_ANY, - .mh.bufsize = sizeof(struct usb2_device_request), - .mh.flags = {}, - .mh.callback = &aue_bulk_write_clear_stall_callback, - .mh.timeout = 1000, /* 1 second */ - .mh.interval = 50, /* 50ms */ - }, - - [AUE_BULK_CS_RD] = { - .type = UE_CONTROL, - .endpoint = 0x00, /* Control pipe */ - .direction = UE_DIR_ANY, - .mh.bufsize = sizeof(struct usb2_device_request), - .mh.flags = {}, - .mh.callback = &aue_bulk_read_clear_stall_callback, - .mh.timeout = 1000, /* 1 second */ - .mh.interval = 50, /* 50ms */ + .mh.callback = aue_bulk_read_callback, }, [AUE_INTR_DT_RD] = { @@ -274,18 +230,7 @@ static const struct usb2_config aue_conf .direction = UE_DIR_IN, .mh.flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, .mh.bufsize = 0, /* use wMaxPacketSize */ - .mh.callback = &aue_intr_callback, - }, - - [AUE_INTR_CS_RD] = { - .type = UE_CONTROL, - .endpoint = 0x00, /* Control pipe */ - .direction = UE_DIR_ANY, - .mh.bufsize = sizeof(struct usb2_device_request), - .mh.flags = {}, - .mh.callback = &aue_intr_clear_stall_callback, - .mh.timeout = 1000, /* 1 second */ - .mh.interval = 50, /* 50ms */ + .mh.callback = aue_intr_callback, }, }; @@ -301,9 +246,9 @@ static device_method_t aue_methods[] = { DEVMETHOD(bus_driver_added, bus_generic_driver_added), /* MII interface */ - DEVMETHOD(miibus_readreg, aue_cfg_miibus_readreg), - DEVMETHOD(miibus_writereg, aue_cfg_miibus_writereg), - DEVMETHOD(miibus_statchg, aue_cfg_miibus_statchg), + DEVMETHOD(miibus_readreg, aue_miibus_readreg), + DEVMETHOD(miibus_writereg, aue_miibus_writereg), + DEVMETHOD(miibus_statchg, aue_miibus_statchg), {0, 0} }; @@ -318,44 +263,34 @@ static devclass_t aue_devclass; DRIVER_MODULE(aue, ushub, aue_driver, aue_devclass, NULL, 0); DRIVER_MODULE(miibus, aue, miibus_driver, miibus_devclass, 0, 0); +MODULE_DEPEND(aue, usb2_ethernet, 1, 1, 1); +MODULE_DEPEND(aue, usb2_core, 1, 1, 1); +MODULE_DEPEND(aue, ether, 1, 1, 1); +MODULE_DEPEND(aue, miibus, 1, 1, 1); -static void -aue_cfg_do_request(struct aue_softc *sc, struct usb2_device_request *req, - void *data) -{ - uint16_t length; - usb2_error_t err; - - if (usb2_config_td_is_gone(&sc->sc_config_td)) { - goto error; - } - err = usb2_do_request_flags - (sc->sc_udev, &sc->sc_mtx, req, data, 0, NULL, 1000); - - if (err) { - - DPRINTF("device request failed, err=%s " - "(ignored)\n", usb2_errstr(err)); - -error: - length = UGETW(req->wLength); - - if ((req->bmRequestType & UT_READ) && length) { - bzero(data, length); - } - } -} +static const struct usb2_ether_methods aue_ue_methods = { + .ue_attach_post = aue_attach_post, + .ue_start = aue_start, + .ue_init = aue_init, + .ue_stop = aue_stop, + .ue_tick = aue_tick, + .ue_setmulti = aue_setmulti, + .ue_setpromisc = aue_setpromisc, + .ue_mii_upd = aue_ifmedia_upd, + .ue_mii_sts = aue_ifmedia_sts, +}; -#define AUE_CFG_SETBIT(sc, reg, x) \ - aue_cfg_csr_write_1(sc, reg, aue_cfg_csr_read_1(sc, reg) | (x)) +#define AUE_SETBIT(sc, reg, x) \ + aue_csr_write_1(sc, reg, aue_csr_read_1(sc, reg) | (x)) -#define AUE_CFG_CLRBIT(sc, reg, x) \ - aue_cfg_csr_write_1(sc, reg, aue_cfg_csr_read_1(sc, reg) & ~(x)) +#define AUE_CLRBIT(sc, reg, x) \ + aue_csr_write_1(sc, reg, aue_csr_read_1(sc, reg) & ~(x)) static uint8_t -aue_cfg_csr_read_1(struct aue_softc *sc, uint16_t reg) +aue_csr_read_1(struct aue_softc *sc, uint16_t reg) { struct usb2_device_request req; + usb2_error_t err; uint8_t val; req.bmRequestType = UT_READ_VENDOR_DEVICE; @@ -364,14 +299,17 @@ aue_cfg_csr_read_1(struct aue_softc *sc, USETW(req.wIndex, reg); USETW(req.wLength, 1); - aue_cfg_do_request(sc, &req, &val); + err = usb2_ether_do_request(&sc->sc_ue, &req, &val, 1000); + if (err) + return (0); return (val); } static uint16_t -aue_cfg_csr_read_2(struct aue_softc *sc, uint16_t reg) +aue_csr_read_2(struct aue_softc *sc, uint16_t reg) { struct usb2_device_request req; + usb2_error_t err; uint16_t val; req.bmRequestType = UT_READ_VENDOR_DEVICE; @@ -380,12 +318,14 @@ aue_cfg_csr_read_2(struct aue_softc *sc, USETW(req.wIndex, reg); USETW(req.wLength, 2); - aue_cfg_do_request(sc, &req, &val); + err = usb2_ether_do_request(&sc->sc_ue, &req, &val, 1000); + if (err) + return (0); return (le16toh(val)); } static void -aue_cfg_csr_write_1(struct aue_softc *sc, uint16_t reg, uint8_t val) +aue_csr_write_1(struct aue_softc *sc, uint16_t reg, uint8_t val) { struct usb2_device_request req; @@ -396,11 +336,13 @@ aue_cfg_csr_write_1(struct aue_softc *sc USETW(req.wIndex, reg); USETW(req.wLength, 1); - aue_cfg_do_request(sc, &req, &val); + if (usb2_ether_do_request(&sc->sc_ue, &req, &val, 1000)) { + /* error ignored */ + } } static void -aue_cfg_csr_write_2(struct aue_softc *sc, uint16_t reg, uint16_t val) +aue_csr_write_2(struct aue_softc *sc, uint16_t reg, uint16_t val) { struct usb2_device_request req; @@ -412,196 +354,154 @@ aue_cfg_csr_write_2(struct aue_softc *sc val = htole16(val); - aue_cfg_do_request(sc, &req, &val); + if (usb2_ether_do_request(&sc->sc_ue, &req, &val, 1000)) { + /* error ignored */ + } } /* * Read a word of data stored in the EEPROM at address 'addr.' */ static void -aue_cfg_eeprom_getword(struct aue_softc *sc, uint8_t addr, - uint8_t *dest) +aue_eeprom_getword(struct aue_softc *sc, int addr, uint16_t *dest) { - uint16_t i; - - aue_cfg_csr_write_1(sc, AUE_EE_REG, addr); - aue_cfg_csr_write_1(sc, AUE_EE_CTL, AUE_EECTL_READ); - - for (i = 0;; i++) { + int i; + uint16_t word = 0; - if (i < AUE_TIMEOUT) { + aue_csr_write_1(sc, AUE_EE_REG, addr); + aue_csr_write_1(sc, AUE_EE_CTL, AUE_EECTL_READ); - if (aue_cfg_csr_read_1(sc, AUE_EE_CTL) & AUE_EECTL_DONE) { - break; - } - if (usb2_config_td_sleep(&sc->sc_config_td, hz / 100)) { - break; - } - } else { - DPRINTF("EEPROM read timed out!\n"); + for (i = 0; i != AUE_TIMEOUT; i++) { + if (aue_csr_read_1(sc, AUE_EE_CTL) & AUE_EECTL_DONE) + break; + if (usb2_ether_pause(&sc->sc_ue, hz / 100)) break; - } } - i = aue_cfg_csr_read_2(sc, AUE_EE_DATA); + if (i == AUE_TIMEOUT) + device_printf(sc->sc_ue.ue_dev, "EEPROM read timed out\n"); - dest[0] = (i & 0xFF); - dest[1] = (i >> 8); + word = aue_csr_read_2(sc, AUE_EE_DATA); + *dest = word; } /* * Read a sequence of words from the EEPROM. */ static void -aue_cfg_read_eeprom(struct aue_softc *sc, uint8_t *dest, +aue_read_eeprom(struct aue_softc *sc, uint8_t *dest, uint16_t off, uint16_t len) { - uint16_t i; + uint16_t *ptr = (uint16_t *)dest; + int i; - for (i = 0; i < len; i++) { - aue_cfg_eeprom_getword(sc, off + i, dest + (i * 2)); - } + for (i = 0; i != len; i++, ptr++) + aue_eeprom_getword(sc, off + i, ptr); } static int -aue_cfg_miibus_readreg(device_t dev, int phy, int reg) +aue_miibus_readreg(device_t dev, int phy, int reg) { struct aue_softc *sc = device_get_softc(dev); - uint16_t i; - uint8_t do_unlock; + int i, locked; + uint16_t val = 0; - /* avoid recursive locking */ - if (mtx_owned(&sc->sc_mtx)) { - do_unlock = 0; - } else { - mtx_lock(&sc->sc_mtx); - do_unlock = 1; - } + locked = mtx_owned(&sc->sc_mtx); + if (!locked) + AUE_LOCK(sc); /* - * The Am79C901 HomePNA PHY actually contains - * two transceivers: a 1Mbps HomePNA PHY and a - * 10Mbps full/half duplex ethernet PHY with - * NWAY autoneg. However in the ADMtek adapter, - * only the 1Mbps PHY is actually connected to - * anything, so we ignore the 10Mbps one. It - * happens to be configured for MII address 3, - * so we filter that out. + * The Am79C901 HomePNA PHY actually contains two transceivers: a 1Mbps + * HomePNA PHY and a 10Mbps full/half duplex ethernet PHY with NWAY + * autoneg. However in the ADMtek adapter, only the 1Mbps PHY is + * actually connected to anything, so we ignore the 10Mbps one. It + * happens to be configured for MII address 3, so we filter that out. */ if (sc->sc_flags & AUE_FLAG_DUAL_PHY) { - - if (phy == 3) { - i = 0; + if (phy == 3) goto done; - } #if 0 - if (phy != 1) { - i = 0; + if (phy != 1) goto done; - } #endif } - aue_cfg_csr_write_1(sc, AUE_PHY_ADDR, phy); - aue_cfg_csr_write_1(sc, AUE_PHY_CTL, reg | AUE_PHYCTL_READ); - - for (i = 0;; i++) { + aue_csr_write_1(sc, AUE_PHY_ADDR, phy); + aue_csr_write_1(sc, AUE_PHY_CTL, reg | AUE_PHYCTL_READ); - if (i < AUE_TIMEOUT) { - - if (aue_cfg_csr_read_1(sc, AUE_PHY_CTL) & AUE_PHYCTL_DONE) { - break; - } - if (usb2_config_td_sleep(&sc->sc_config_td, hz / 100)) { - break; - } - } else { - DPRINTF("MII read timed out\n"); + for (i = 0; i != AUE_TIMEOUT; i++) { + if (aue_csr_read_1(sc, AUE_PHY_CTL) & AUE_PHYCTL_DONE) + break; + if (usb2_ether_pause(&sc->sc_ue, hz / 100)) break; - } } - i = aue_cfg_csr_read_2(sc, AUE_PHY_DATA); + if (i == AUE_TIMEOUT) + device_printf(sc->sc_ue.ue_dev, "MII read timed out\n"); + + val = aue_csr_read_2(sc, AUE_PHY_DATA); done: - if (do_unlock) { - mtx_unlock(&sc->sc_mtx); - } - return (i); + if (!locked) + AUE_UNLOCK(sc); + return (val); } static int -aue_cfg_miibus_writereg(device_t dev, int phy, int reg, int data) +aue_miibus_writereg(device_t dev, int phy, int reg, int data) { struct aue_softc *sc = device_get_softc(dev); - uint16_t i; - uint8_t do_unlock; + int i; + int locked; - if (phy == 3) { + if (phy == 3) return (0); - } - /* avoid recursive locking */ - if (mtx_owned(&sc->sc_mtx)) { - do_unlock = 0; - } else { - mtx_lock(&sc->sc_mtx); - do_unlock = 1; - } - aue_cfg_csr_write_2(sc, AUE_PHY_DATA, data); - aue_cfg_csr_write_1(sc, AUE_PHY_ADDR, phy); - aue_cfg_csr_write_1(sc, AUE_PHY_CTL, reg | AUE_PHYCTL_WRITE); - - for (i = 0;; i++) { - - if (i < AUE_TIMEOUT) { - if (aue_cfg_csr_read_1(sc, AUE_PHY_CTL) & AUE_PHYCTL_DONE) { - break; - } - if (usb2_config_td_sleep(&sc->sc_config_td, hz / 100)) { - break; - } - } else { - DPRINTF("MII write timed out\n"); + locked = mtx_owned(&sc->sc_mtx); + if (!locked) + AUE_LOCK(sc); + + aue_csr_write_2(sc, AUE_PHY_DATA, data); + aue_csr_write_1(sc, AUE_PHY_ADDR, phy); + aue_csr_write_1(sc, AUE_PHY_CTL, reg | AUE_PHYCTL_WRITE); + + for (i = 0; i != AUE_TIMEOUT; i++) { + if (aue_csr_read_1(sc, AUE_PHY_CTL) & AUE_PHYCTL_DONE) + break; + if (usb2_ether_pause(&sc->sc_ue, hz / 100)) break; - } } - if (do_unlock) { - mtx_unlock(&sc->sc_mtx); - } + if (i == AUE_TIMEOUT) + device_printf(sc->sc_ue.ue_dev, "MII read timed out\n"); + + if (!locked) + AUE_UNLOCK(sc); return (0); } static void -aue_cfg_miibus_statchg(device_t dev) +aue_miibus_statchg(device_t dev) { struct aue_softc *sc = device_get_softc(dev); struct mii_data *mii = GET_MII(sc); - uint8_t do_unlock; - - /* avoid recursive locking */ - if (mtx_owned(&sc->sc_mtx)) { - do_unlock = 0; - } else { - mtx_lock(&sc->sc_mtx); - do_unlock = 1; - } - - AUE_CFG_CLRBIT(sc, AUE_CTL0, AUE_CTL0_RX_ENB | AUE_CTL0_TX_ENB); + int locked; - if (IFM_SUBTYPE(mii->mii_media_active) == IFM_100_TX) { - AUE_CFG_SETBIT(sc, AUE_CTL1, AUE_CTL1_SPEEDSEL); - } else { - AUE_CFG_CLRBIT(sc, AUE_CTL1, AUE_CTL1_SPEEDSEL); - } + locked = mtx_owned(&sc->sc_mtx); + if (!locked) + AUE_LOCK(sc); + + AUE_CLRBIT(sc, AUE_CTL0, AUE_CTL0_RX_ENB | AUE_CTL0_TX_ENB); + if (IFM_SUBTYPE(mii->mii_media_active) == IFM_100_TX) + AUE_SETBIT(sc, AUE_CTL1, AUE_CTL1_SPEEDSEL); + else + AUE_CLRBIT(sc, AUE_CTL1, AUE_CTL1_SPEEDSEL); - if ((mii->mii_media_active & IFM_GMASK) == IFM_FDX) { - AUE_CFG_SETBIT(sc, AUE_CTL1, AUE_CTL1_DUPLEX); - } else { - AUE_CFG_CLRBIT(sc, AUE_CTL1, AUE_CTL1_DUPLEX); - } + if ((mii->mii_media_active & IFM_GMASK) == IFM_FDX) + AUE_SETBIT(sc, AUE_CTL1, AUE_CTL1_DUPLEX); + else + AUE_CLRBIT(sc, AUE_CTL1, AUE_CTL1_DUPLEX); - AUE_CFG_SETBIT(sc, AUE_CTL0, AUE_CTL0_RX_ENB | AUE_CTL0_TX_ENB); + AUE_SETBIT(sc, AUE_CTL0, AUE_CTL0_RX_ENB | AUE_CTL0_TX_ENB); /* * Set the LED modes on the LinkSys adapter. @@ -611,75 +511,80 @@ aue_cfg_miibus_statchg(device_t dev) if (sc->sc_flags & AUE_FLAG_LSYS) { uint16_t auxmode; - auxmode = aue_cfg_miibus_readreg(dev, 0, 0x1b); - aue_cfg_miibus_writereg(dev, 0, 0x1b, auxmode | 0x04); - } - if (do_unlock) { - mtx_unlock(&sc->sc_mtx); + auxmode = aue_miibus_readreg(dev, 0, 0x1b); + aue_miibus_writereg(dev, 0, 0x1b, auxmode | 0x04); } + if (!locked) + AUE_UNLOCK(sc); } +#define AUE_BITS 6 static void -aue_cfg_setmulti(struct aue_softc *sc, - struct usb2_config_td_cc *cc, uint16_t refcount) +aue_setmulti(struct usb2_ether *ue) { - uint16_t i; + struct aue_softc *sc = usb2_ether_getsc(ue); + struct ifnet *ifp = usb2_ether_getifp(ue); + struct ifmultiaddr *ifma; + uint32_t h = 0; + uint32_t i; + uint8_t hashtbl[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; + + AUE_LOCK_ASSERT(sc, MA_OWNED); - if ((cc->if_flags & IFF_ALLMULTI) || - (cc->if_flags & IFF_PROMISC)) { - AUE_CFG_SETBIT(sc, AUE_CTL0, AUE_CTL0_ALLMULTI); + if (ifp->if_flags & IFF_ALLMULTI || ifp->if_flags & IFF_PROMISC) { + AUE_SETBIT(sc, AUE_CTL0, AUE_CTL0_ALLMULTI); return; } - AUE_CFG_CLRBIT(sc, AUE_CTL0, AUE_CTL0_ALLMULTI); - /* clear existing ones */ - for (i = 0; i < 8; i++) { - aue_cfg_csr_write_1(sc, AUE_MAR0 + i, 0); - } + AUE_CLRBIT(sc, AUE_CTL0, AUE_CTL0_ALLMULTI); /* now program new ones */ - for (i = 0; i < 8; i++) { - aue_cfg_csr_write_1(sc, AUE_MAR0 + i, cc->if_hash[i]); + IF_ADDR_LOCK(ifp); + TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + if (ifma->ifma_addr->sa_family != AF_LINK) + continue; + h = ether_crc32_le(LLADDR((struct sockaddr_dl *) + ifma->ifma_addr), ETHER_ADDR_LEN) & ((1 << AUE_BITS) - 1); + hashtbl[(h >> 3)] |= 1 << (h & 0x7); } + IF_ADDR_UNLOCK(ifp); + + /* write the hashtable */ + for (i = 0; i != 8; i++) + aue_csr_write_1(sc, AUE_MAR0 + i, hashtbl[i]); } static void -aue_cfg_reset_pegasus_II(struct aue_softc *sc) +aue_reset_pegasus_II(struct aue_softc *sc) { /* Magic constants taken from Linux driver. */ - aue_cfg_csr_write_1(sc, AUE_REG_1D, 0); - aue_cfg_csr_write_1(sc, AUE_REG_7B, 2); + aue_csr_write_1(sc, AUE_REG_1D, 0); + aue_csr_write_1(sc, AUE_REG_7B, 2); #if 0 if ((sc->sc_flags & HAS_HOME_PNA) && mii_mode) - aue_cfg_csr_write_1(sc, AUE_REG_81, 6); + aue_csr_write_1(sc, AUE_REG_81, 6); else #endif - aue_cfg_csr_write_1(sc, AUE_REG_81, 2); + aue_csr_write_1(sc, AUE_REG_81, 2); } static void -aue_cfg_reset(struct aue_softc *sc) +aue_reset(struct aue_softc *sc) { - uint16_t i; + int i; - AUE_CFG_SETBIT(sc, AUE_CTL1, AUE_CTL1_RESETMAC); + AUE_SETBIT(sc, AUE_CTL1, AUE_CTL1_RESETMAC); - for (i = 0;; i++) { - - if (i < AUE_TIMEOUT) { - - if (!(aue_cfg_csr_read_1(sc, AUE_CTL1) & AUE_CTL1_RESETMAC)) { - break; - } - if (usb2_config_td_sleep(&sc->sc_config_td, hz / 100)) { - break; - } - } else { - DPRINTF("reset timed out\n"); + for (i = 0; i != AUE_TIMEOUT; i++) { + if (!(aue_csr_read_1(sc, AUE_CTL1) & AUE_CTL1_RESETMAC)) + break; + if (usb2_ether_pause(&sc->sc_ue, hz / 100)) break; - } } + if (i == AUE_TIMEOUT) + device_printf(sc->sc_ue.ue_dev, "reset failed\n"); + /* * The PHY(s) attached to the Pegasus chip may be held * in reset until we flip on the GPIO outputs. Make sure @@ -689,24 +594,32 @@ aue_cfg_reset(struct aue_softc *sc) * Note: We force all of the GPIO pins low first, *then* * enable the ones we want. */ - aue_cfg_csr_write_1(sc, AUE_GPIO0, (AUE_GPIO_OUT0 | AUE_GPIO_SEL0)); - aue_cfg_csr_write_1(sc, AUE_GPIO0, (AUE_GPIO_OUT0 | AUE_GPIO_SEL0 | - AUE_GPIO_SEL1)); + aue_csr_write_1(sc, AUE_GPIO0, AUE_GPIO_OUT0|AUE_GPIO_SEL0); + aue_csr_write_1(sc, AUE_GPIO0, AUE_GPIO_OUT0|AUE_GPIO_SEL0|AUE_GPIO_SEL1); if (sc->sc_flags & AUE_FLAG_LSYS) { /* Grrr. LinkSys has to be different from everyone else. */ - aue_cfg_csr_write_1(sc, AUE_GPIO0, - (AUE_GPIO_SEL0 | AUE_GPIO_SEL1)); - aue_cfg_csr_write_1(sc, AUE_GPIO0, - (AUE_GPIO_SEL0 | - AUE_GPIO_SEL1 | - AUE_GPIO_OUT0)); - } - if (sc->sc_flags & AUE_FLAG_PII) { - aue_cfg_reset_pegasus_II(sc); + aue_csr_write_1(sc, AUE_GPIO0, AUE_GPIO_SEL0|AUE_GPIO_SEL1); + aue_csr_write_1(sc, AUE_GPIO0, + AUE_GPIO_SEL0|AUE_GPIO_SEL1|AUE_GPIO_OUT0); } - /* wait a little while for the chip to get its brains in order: */ - usb2_config_td_sleep(&sc->sc_config_td, hz / 100); + if (sc->sc_flags & AUE_FLAG_PII) + aue_reset_pegasus_II(sc); + + /* Wait a little while for the chip to get its brains in order: */ + usb2_ether_pause(&sc->sc_ue, hz / 100); +} + +static void +aue_attach_post(struct usb2_ether *ue) +{ + struct aue_softc *sc = usb2_ether_getsc(ue); + + /* reset the adapter */ + aue_reset(sc); + + /* get station address from the EEPROM */ + aue_read_eeprom(sc, ue->ue_eaddr, 0, 3); } /* @@ -717,26 +630,22 @@ aue_probe(device_t dev) { struct usb2_attach_arg *uaa = device_get_ivars(dev); - if (uaa->usb2_mode != USB_MODE_HOST) { + if (uaa->usb2_mode != USB_MODE_HOST) return (ENXIO); - } - if (uaa->info.bConfigIndex != AUE_CONFIG_INDEX) { + if (uaa->info.bConfigIndex != AUE_CONFIG_INDEX) return (ENXIO); - } - if (uaa->info.bIfaceIndex != AUE_IFACE_IDX) { + if (uaa->info.bIfaceIndex != AUE_IFACE_IDX) return (ENXIO); - } /* - * Belkin USB Bluetooth dongles of the F8T012xx1 model series - * conflict with older Belkin USB2LAN adapters. Skip if_aue if - * we detect one of the devices that look like Bluetooth - * adapters. + * Belkin USB Bluetooth dongles of the F8T012xx1 model series conflict + * with older Belkin USB2LAN adapters. Skip if_aue if we detect one of + * the devices that look like Bluetooth adapters. */ - if ((uaa->info.idVendor == USB_VENDOR_BELKIN) && - (uaa->info.idProduct == USB_PRODUCT_BELKIN_F8T012) && - (uaa->info.bcdDevice == 0x0413)) { + if (uaa->info.idVendor == USB_VENDOR_BELKIN && + uaa->info.idProduct == USB_PRODUCT_BELKIN_F8T012 && + uaa->info.bcdDevice == 0x0413) return (ENXIO); - } + return (usb2_lookup_id_by_uaa(aue_devs, sizeof(aue_devs), uaa)); } @@ -749,53 +658,40 @@ aue_attach(device_t dev) { struct usb2_attach_arg *uaa = device_get_ivars(dev); struct aue_softc *sc = device_get_softc(dev); - int32_t error; + struct usb2_ether *ue = &sc->sc_ue; uint8_t iface_index; + int error; - sc->sc_udev = uaa->device; - sc->sc_dev = dev; - sc->sc_unit = device_get_unit(dev); sc->sc_flags = USB_GET_DRIVER_INFO(uaa); if (uaa->info.bcdDevice >= 0x0201) { - sc->sc_flags |= AUE_FLAG_VER_2; /* XXX currently undocumented */ + /* XXX currently undocumented */ + sc->sc_flags |= AUE_FLAG_VER_2; } - device_set_usb2_desc(dev); - - snprintf(sc->sc_name, sizeof(sc->sc_name), "%s", - device_get_nameunit(dev)); - - mtx_init(&sc->sc_mtx, "aue lock", NULL, MTX_DEF | MTX_RECURSE); - usb2_callout_init_mtx(&sc->sc_watchdog, &sc->sc_mtx, 0); + device_set_usb2_desc(dev); + mtx_init(&sc->sc_mtx, device_get_nameunit(dev), NULL, MTX_DEF); iface_index = AUE_IFACE_IDX; error = usb2_transfer_setup(uaa->device, &iface_index, sc->sc_xfer, aue_config, AUE_N_TRANSFER, sc, &sc->sc_mtx); if (error) { - device_printf(dev, "allocating USB " - "transfers failed!\n"); + device_printf(dev, "allocating USB transfers failed!\n"); goto detach; } - error = usb2_config_td_setup(&sc->sc_config_td, sc, &sc->sc_mtx, - NULL, sizeof(struct usb2_config_td_cc), 16); + + ue->ue_sc = sc; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 22:05:25 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E28CC106564A; Mon, 9 Feb 2009 22:05:25 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CF0188FC1F; Mon, 9 Feb 2009 22:05:25 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n19M5PkV072609; Mon, 9 Feb 2009 22:05:25 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n19M5PV0072603; Mon, 9 Feb 2009 22:05:25 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200902092205.n19M5PV0072603@svn.freebsd.org> From: Andrew Thompson Date: Mon, 9 Feb 2009 22:05:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188413 - head/sys/dev/usb2/serial X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Feb 2009 22:05:26 -0000 Author: thompsa Date: Mon Feb 9 22:05:25 2009 New Revision: 188413 URL: http://svn.freebsd.org/changeset/base/188413 Log: MFp4 //depot/projects/usb; 157069, 157136, 157143, 157145, 157429 - USB serial drivers cleanup, factor out code - Simplify line state programming - Integrate uslcom from old USB stack Submitted by: Hans Petter Selasky Added: head/sys/dev/usb2/serial/uslcom2.c (contents, props changed) Modified: head/sys/dev/usb2/serial/u3g2.c head/sys/dev/usb2/serial/uark2.c head/sys/dev/usb2/serial/ubsa2.c head/sys/dev/usb2/serial/ubser2.c head/sys/dev/usb2/serial/uchcom2.c head/sys/dev/usb2/serial/ucycom2.c head/sys/dev/usb2/serial/ufoma2.c head/sys/dev/usb2/serial/uftdi2.c head/sys/dev/usb2/serial/ugensa2.c head/sys/dev/usb2/serial/uipaq2.c head/sys/dev/usb2/serial/ulpt2.c head/sys/dev/usb2/serial/umct2.c head/sys/dev/usb2/serial/umodem2.c head/sys/dev/usb2/serial/umoscom2.c head/sys/dev/usb2/serial/uplcom2.c head/sys/dev/usb2/serial/usb2_serial.c head/sys/dev/usb2/serial/usb2_serial.h head/sys/dev/usb2/serial/uvisor2.c head/sys/dev/usb2/serial/uvscom2.c Modified: head/sys/dev/usb2/serial/u3g2.c ============================================================================== --- head/sys/dev/usb2/serial/u3g2.c Mon Feb 9 22:02:38 2009 (r188412) +++ head/sys/dev/usb2/serial/u3g2.c Mon Feb 9 22:05:25 2009 (r188413) @@ -88,7 +88,7 @@ struct u3g_speeds_s { enum { U3G_BULK_WR, U3G_BULK_RD, - U3G_N_TRANSFER = 2, + U3G_N_TRANSFER, }; struct u3g_softc { @@ -98,11 +98,8 @@ struct u3g_softc { struct usb2_xfer *sc_xfer[U3G_MAXPORTS][U3G_N_TRANSFER]; struct usb2_device *sc_udev; - uint8_t sc_iface_no; /* interface number */ - uint8_t sc_iface_index; /* interface index */ uint8_t sc_lsr; /* local status register */ uint8_t sc_msr; /* U3G status register */ - struct u3g_speeds_s sc_speed; uint8_t sc_numports; }; @@ -148,6 +145,7 @@ static const struct usb2_com_callback u3 .usb2_com_stop_write = &u3g_stop_write, }; +#if 0 static const struct u3g_speeds_s u3g_speeds[U3GSP_MAX] = { [U3GSP_GPRS] = {64000, 64000}, [U3GSP_EDGE] = {384000, 64000}, @@ -157,6 +155,7 @@ static const struct u3g_speeds_s u3g_spe [U3GSP_HSUPA] = {1200000, 384000}, [U3GSP_HSPA] = {7200000, 384000}, }; +#endif static device_method_t u3g_methods[] = { DEVMETHOD(device_probe, u3g_probe), @@ -385,8 +384,12 @@ u3g_attach(device_t dev) struct usb2_config u3g_config_tmp[U3G_N_TRANSFER]; struct usb2_attach_arg *uaa = device_get_ivars(dev); struct u3g_softc *sc = device_get_softc(dev); - uint8_t n; + struct usb2_interface *iface; + struct usb2_interface_descriptor *id; uint8_t m; + uint8_t n; + uint8_t i; + uint8_t x; int error; DPRINTF("sc=%p\n", sc); @@ -398,30 +401,56 @@ u3g_attach(device_t dev) device_set_usb2_desc(dev); sc->sc_udev = uaa->device; - sc->sc_iface_no = uaa->info.bIfaceNum; - sc->sc_iface_index = uaa->info.bIfaceIndex; - sc->sc_speed = u3g_speeds[U3G_GET_SPEED(uaa)]; - for (m = 0; m != U3G_MAXPORTS; m++) { + x = 0; /* interface index */ + i = 0; /* endpoint index */ + m = 0; /* number of ports */ + + while (m != U3G_MAXPORTS) { /* update BULK endpoint index */ for (n = 0; n != U3G_N_TRANSFER; n++) - u3g_config_tmp[n].ep_index = m; + u3g_config_tmp[n].ep_index = i; + + iface = usb2_get_iface(uaa->device, x); + if (iface == NULL) { + if (m != 0) + break; /* end of interfaces */ + DPRINTF("did not find any modem endpoints\n"); + goto detach; + } + + id = usb2_get_interface_descriptor(iface); + if ((id == NULL) || + (id->bInterfaceClass != UICLASS_VENDOR)) { + /* next interface */ + x++; + i = 0; + continue; + } /* try to allocate a set of BULK endpoints */ - error = usb2_transfer_setup(uaa->device, &sc->sc_iface_index, + error = usb2_transfer_setup(uaa->device, &x, sc->sc_xfer[m], u3g_config_tmp, U3G_N_TRANSFER, &sc->sc_ucom[m], &Giant); - if (error) { - if (m != 0) - break; /* end of endpoints */ - DPRINTF("could not allocate all pipes\n"); - goto detach; + /* next interface */ + x++; + i = 0; + continue; } + + /* grab other interface, if any */ + if (x != uaa->info.bIfaceIndex) + usb2_set_parent_iface(uaa->device, x, + uaa->info.bIfaceIndex); + /* set stall by default */ usb2_transfer_set_stall(sc->sc_xfer[m][U3G_BULK_WR]); usb2_transfer_set_stall(sc->sc_xfer[m][U3G_BULK_RD]); + + m++; /* found one port */ + i++; /* next endpoint index */ } sc->sc_numports = m; Modified: head/sys/dev/usb2/serial/uark2.c ============================================================================== --- head/sys/dev/usb2/serial/uark2.c Mon Feb 9 22:02:38 2009 (r188412) +++ head/sys/dev/usb2/serial/uark2.c Mon Feb 9 22:05:25 2009 (r188413) @@ -64,9 +64,7 @@ enum { UARK_BULK_DT_WR, UARK_BULK_DT_RD, - UARK_BULK_CS_WR, - UARK_BULK_CS_RD, - UARK_N_TRANSFER = 4, + UARK_N_TRANSFER, }; struct uark_softc { @@ -76,9 +74,6 @@ struct uark_softc { struct usb2_xfer *sc_xfer[UARK_N_TRANSFER]; struct usb2_device *sc_udev; - uint8_t sc_flags; -#define UARK_FLAG_BULK_READ_STALL 0x01 -#define UARK_FLAG_BULK_WRITE_STALL 0x02 uint8_t sc_msr; uint8_t sc_lsr; }; @@ -90,9 +85,7 @@ static device_attach_t uark_attach; static device_detach_t uark_detach; static usb2_callback_t uark_bulk_write_callback; -static usb2_callback_t uark_bulk_write_clear_stall_callback; static usb2_callback_t uark_bulk_read_callback; -static usb2_callback_t uark_bulk_read_clear_stall_callback; static void uark_start_read(struct usb2_com_softc *); static void uark_stop_read(struct usb2_com_softc *); @@ -125,28 +118,6 @@ static const struct usb2_config .mh.flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, .mh.callback = &uark_bulk_read_callback, }, - - [UARK_BULK_CS_WR] = { - .type = UE_CONTROL, - .endpoint = 0x00, /* Control pipe */ - .direction = UE_DIR_ANY, - .mh.bufsize = sizeof(struct usb2_device_request), - .mh.flags = {}, - .mh.callback = &uark_bulk_write_clear_stall_callback, - .mh.timeout = 1000, /* 1 second */ - .mh.interval = 50, /* 50ms */ - }, - - [UARK_BULK_CS_RD] = { - .type = UE_CONTROL, - .endpoint = 0x00, /* Control pipe */ - .direction = UE_DIR_ANY, - .mh.bufsize = sizeof(struct usb2_device_request), - .mh.flags = {}, - .mh.callback = &uark_bulk_read_clear_stall_callback, - .mh.timeout = 1000, /* 1 second */ - .mh.interval = 50, /* 50ms */ - }, }; static const struct usb2_com_callback uark_callback = { @@ -224,8 +195,8 @@ uark_attach(device_t dev) goto detach; } /* clear stall at first run */ - sc->sc_flags |= (UARK_FLAG_BULK_WRITE_STALL | - UARK_FLAG_BULK_READ_STALL); + usb2_transfer_set_stall(sc->sc_xfer[UARK_BULK_DT_WR]); + usb2_transfer_set_stall(sc->sc_xfer[UARK_BULK_DT_RD]); error = usb2_com_attach(&sc->sc_super_ucom, &sc->sc_ucom, 1, sc, &uark_callback, &Giant); @@ -261,10 +232,7 @@ uark_bulk_write_callback(struct usb2_xfe switch (USB_GET_STATE(xfer)) { case USB_ST_SETUP: case USB_ST_TRANSFERRED: - if (sc->sc_flags & UARK_FLAG_BULK_WRITE_STALL) { - usb2_transfer_start(sc->sc_xfer[UARK_BULK_CS_WR]); - return; - } +tr_setup: if (usb2_com_get_data(&sc->sc_ucom, xfer->frbuffers, 0, UARK_BUF_SIZE, &actlen)) { xfer->frlengths[0] = actlen; @@ -274,8 +242,9 @@ uark_bulk_write_callback(struct usb2_xfe default: /* Error */ if (xfer->error != USB_ERR_CANCELLED) { - sc->sc_flags |= UARK_FLAG_BULK_WRITE_STALL; - usb2_transfer_start(sc->sc_xfer[UARK_BULK_CS_WR]); + /* try to clear stall first */ + xfer->flags.stall_pipe = 1; + goto tr_setup; } return; @@ -283,19 +252,6 @@ uark_bulk_write_callback(struct usb2_xfe } static void -uark_bulk_write_clear_stall_callback(struct usb2_xfer *xfer) -{ - struct uark_softc *sc = xfer->priv_sc; - struct usb2_xfer *xfer_other = sc->sc_xfer[UARK_BULK_DT_WR]; - - if (usb2_clear_stall_callback(xfer, xfer_other)) { - DPRINTF("stall cleared\n"); - sc->sc_flags &= ~UARK_FLAG_BULK_WRITE_STALL; - usb2_transfer_start(xfer_other); - } -} - -static void uark_bulk_read_callback(struct usb2_xfer *xfer) { struct uark_softc *sc = xfer->priv_sc; @@ -306,34 +262,18 @@ uark_bulk_read_callback(struct usb2_xfer xfer->actlen); case USB_ST_SETUP: - if (sc->sc_flags & UARK_FLAG_BULK_READ_STALL) { - usb2_transfer_start(sc->sc_xfer[UARK_BULK_CS_RD]); - } else { - xfer->frlengths[0] = xfer->max_data_length; - usb2_start_hardware(xfer); - } +tr_setup: + xfer->frlengths[0] = xfer->max_data_length; + usb2_start_hardware(xfer); return; default: /* Error */ if (xfer->error != USB_ERR_CANCELLED) { - sc->sc_flags |= UARK_FLAG_BULK_READ_STALL; - usb2_transfer_start(sc->sc_xfer[UARK_BULK_CS_RD]); + /* try to clear stall first */ + xfer->flags.stall_pipe = 1; + goto tr_setup; } return; - - } -} - -static void -uark_bulk_read_clear_stall_callback(struct usb2_xfer *xfer) -{ - struct uark_softc *sc = xfer->priv_sc; - struct usb2_xfer *xfer_other = sc->sc_xfer[UARK_BULK_DT_RD]; - - if (usb2_clear_stall_callback(xfer, xfer_other)) { - DPRINTF("stall cleared\n"); - sc->sc_flags &= ~UARK_FLAG_BULK_READ_STALL; - usb2_transfer_start(xfer_other); } } @@ -350,7 +290,6 @@ uark_stop_read(struct usb2_com_softc *uc { struct uark_softc *sc = ucom->sc_parent; - usb2_transfer_stop(sc->sc_xfer[UARK_BULK_CS_RD]); usb2_transfer_stop(sc->sc_xfer[UARK_BULK_DT_RD]); } @@ -367,7 +306,6 @@ uark_stop_write(struct usb2_com_softc *u { struct uark_softc *sc = ucom->sc_parent; - usb2_transfer_stop(sc->sc_xfer[UARK_BULK_CS_WR]); usb2_transfer_stop(sc->sc_xfer[UARK_BULK_DT_WR]); } @@ -454,18 +392,14 @@ uark_cfg_write(struct uark_softc *sc, ui struct usb2_device_request req; usb2_error_t err; - if (usb2_com_cfg_is_gone(&sc->sc_ucom)) { - return; - } req.bmRequestType = UARK_WRITE; req.bRequest = UARK_REQUEST; USETW(req.wValue, value); USETW(req.wIndex, index); USETW(req.wLength, 0); - err = usb2_do_request_flags - (sc->sc_udev, &Giant, &req, NULL, 0, NULL, 1000); - + err = usb2_com_cfg_do_request(sc->sc_udev, &sc->sc_ucom, + &req, NULL, 0, 1000); if (err) { DPRINTFN(0, "device request failed, err=%s " "(ignored)\n", usb2_errstr(err)); Modified: head/sys/dev/usb2/serial/ubsa2.c ============================================================================== --- head/sys/dev/usb2/serial/ubsa2.c Mon Feb 9 22:02:38 2009 (r188412) +++ head/sys/dev/usb2/serial/ubsa2.c Mon Feb 9 22:05:25 2009 (r188413) @@ -143,11 +143,8 @@ SYSCTL_INT(_hw_usb2_ubsa, OID_AUTO, debu enum { UBSA_BULK_DT_WR, UBSA_BULK_DT_RD, - UBSA_BULK_CS_WR, - UBSA_BULK_CS_RD, UBSA_INTR_DT_RD, - UBSA_INTR_CS_RD, - UBSA_N_TRANSFER = 6, + UBSA_N_TRANSFER, }; struct ubsa_softc { @@ -157,11 +154,6 @@ struct ubsa_softc { struct usb2_xfer *sc_xfer[UBSA_N_TRANSFER]; struct usb2_device *sc_udev; - uint16_t sc_flag; -#define UBSA_FLAG_WRITE_STALL 0x0001 -#define UBSA_FLAG_READ_STALL 0x0002 -#define UBSA_FLAG_INTR_STALL 0x0004 - uint8_t sc_iface_no; /* interface number */ uint8_t sc_iface_index; /* interface index */ uint8_t sc_lsr; /* local status register */ @@ -173,11 +165,8 @@ static device_attach_t ubsa_attach; static device_detach_t ubsa_detach; static usb2_callback_t ubsa_write_callback; -static usb2_callback_t ubsa_write_clear_stall_callback; static usb2_callback_t ubsa_read_callback; -static usb2_callback_t ubsa_read_clear_stall_callback; static usb2_callback_t ubsa_intr_callback; -static usb2_callback_t ubsa_intr_clear_stall_callback; static void ubsa_cfg_request(struct ubsa_softc *, uint8_t, uint16_t); static void ubsa_cfg_set_dtr(struct usb2_com_softc *, uint8_t); @@ -212,26 +201,6 @@ static const struct usb2_config ubsa_con .mh.callback = &ubsa_read_callback, }, - [UBSA_BULK_CS_WR] = { - .type = UE_CONTROL, - .endpoint = 0x00, /* Control pipe */ - .direction = UE_DIR_ANY, - .mh.bufsize = sizeof(struct usb2_device_request), - .mh.callback = &ubsa_write_clear_stall_callback, - .mh.timeout = 1000, /* 1 second */ - .mh.interval = 50, /* 50ms */ - }, - - [UBSA_BULK_CS_RD] = { - .type = UE_CONTROL, - .endpoint = 0x00, /* Control pipe */ - .direction = UE_DIR_ANY, - .mh.bufsize = sizeof(struct usb2_device_request), - .mh.callback = &ubsa_read_clear_stall_callback, - .mh.timeout = 1000, /* 1 second */ - .mh.interval = 50, /* 50ms */ - }, - [UBSA_INTR_DT_RD] = { .type = UE_INTERRUPT, .endpoint = UE_ADDR_ANY, @@ -240,16 +209,6 @@ static const struct usb2_config ubsa_con .mh.bufsize = 0, /* use wMaxPacketSize */ .mh.callback = &ubsa_intr_callback, }, - - [UBSA_INTR_CS_RD] = { - .type = UE_CONTROL, - .endpoint = 0x00, /* Control pipe */ - .direction = UE_DIR_ANY, - .mh.bufsize = sizeof(struct usb2_device_request), - .mh.callback = &ubsa_intr_clear_stall_callback, - .mh.timeout = 1000, /* 1 second */ - .mh.interval = 50, /* 50ms */ - }, }; static const struct usb2_com_callback ubsa_callback = { @@ -343,8 +302,8 @@ ubsa_attach(device_t dev) goto detach; } /* clear stall at first run */ - sc->sc_flag |= (UBSA_FLAG_WRITE_STALL | - UBSA_FLAG_READ_STALL); + usb2_transfer_set_stall(sc->sc_xfer[UBSA_BULK_DT_WR]); + usb2_transfer_set_stall(sc->sc_xfer[UBSA_BULK_DT_RD]); error = usb2_com_attach(&sc->sc_super_ucom, &sc->sc_ucom, 1, sc, &ubsa_callback, &Giant); @@ -379,9 +338,6 @@ ubsa_cfg_request(struct ubsa_softc *sc, struct usb2_device_request req; usb2_error_t err; - if (usb2_com_cfg_is_gone(&sc->sc_ucom)) { - return; - } req.bmRequestType = UT_WRITE_VENDOR_DEVICE; req.bRequest = index; USETW(req.wValue, value); @@ -389,9 +345,8 @@ ubsa_cfg_request(struct ubsa_softc *sc, req.wIndex[1] = 0; USETW(req.wLength, 0); - err = usb2_do_request_flags - (sc->sc_udev, &Giant, &req, NULL, 0, NULL, 1000); - + err = usb2_com_cfg_do_request(sc->sc_udev, &sc->sc_ucom, + &req, NULL, 0, 1000); if (err) { DPRINTFN(0, "device request failed, err=%s " "(ignored)\n", usb2_errstr(err)); @@ -544,11 +499,9 @@ ubsa_stop_read(struct usb2_com_softc *uc struct ubsa_softc *sc = ucom->sc_parent; /* stop interrupt endpoint */ - usb2_transfer_stop(sc->sc_xfer[UBSA_INTR_CS_RD]); usb2_transfer_stop(sc->sc_xfer[UBSA_INTR_DT_RD]); /* stop read endpoint */ - usb2_transfer_stop(sc->sc_xfer[UBSA_BULK_CS_RD]); usb2_transfer_stop(sc->sc_xfer[UBSA_BULK_DT_RD]); } @@ -565,7 +518,6 @@ ubsa_stop_write(struct usb2_com_softc *u { struct ubsa_softc *sc = ucom->sc_parent; - usb2_transfer_stop(sc->sc_xfer[UBSA_BULK_CS_WR]); usb2_transfer_stop(sc->sc_xfer[UBSA_BULK_DT_WR]); } @@ -589,10 +541,7 @@ ubsa_write_callback(struct usb2_xfer *xf switch (USB_GET_STATE(xfer)) { case USB_ST_SETUP: case USB_ST_TRANSFERRED: - if (sc->sc_flag & UBSA_FLAG_WRITE_STALL) { - usb2_transfer_start(sc->sc_xfer[UBSA_BULK_CS_WR]); - return; - } +tr_setup: if (usb2_com_get_data(&sc->sc_ucom, xfer->frbuffers, 0, UBSA_BSIZE, &actlen)) { @@ -603,8 +552,9 @@ ubsa_write_callback(struct usb2_xfer *xf default: /* Error */ if (xfer->error != USB_ERR_CANCELLED) { - sc->sc_flag |= UBSA_FLAG_WRITE_STALL; - usb2_transfer_start(sc->sc_xfer[UBSA_BULK_CS_WR]); + /* try to clear stall first */ + xfer->flags.stall_pipe = 1; + goto tr_setup; } return; @@ -612,19 +562,6 @@ ubsa_write_callback(struct usb2_xfer *xf } static void -ubsa_write_clear_stall_callback(struct usb2_xfer *xfer) -{ - struct ubsa_softc *sc = xfer->priv_sc; - struct usb2_xfer *xfer_other = sc->sc_xfer[UBSA_BULK_DT_WR]; - - if (usb2_clear_stall_callback(xfer, xfer_other)) { - DPRINTF("stall cleared\n"); - sc->sc_flag &= ~UBSA_FLAG_WRITE_STALL; - usb2_transfer_start(xfer_other); - } -} - -static void ubsa_read_callback(struct usb2_xfer *xfer) { struct ubsa_softc *sc = xfer->priv_sc; @@ -634,18 +571,16 @@ ubsa_read_callback(struct usb2_xfer *xfe usb2_com_put_data(&sc->sc_ucom, xfer->frbuffers, 0, xfer->actlen); case USB_ST_SETUP: - if (sc->sc_flag & UBSA_FLAG_READ_STALL) { - usb2_transfer_start(sc->sc_xfer[UBSA_BULK_CS_RD]); - } else { - xfer->frlengths[0] = xfer->max_data_length; - usb2_start_hardware(xfer); - } +tr_setup: + xfer->frlengths[0] = xfer->max_data_length; + usb2_start_hardware(xfer); return; default: /* Error */ if (xfer->error != USB_ERR_CANCELLED) { - sc->sc_flag |= UBSA_FLAG_READ_STALL; - usb2_transfer_start(sc->sc_xfer[UBSA_BULK_CS_RD]); + /* try to clear stall first */ + xfer->flags.stall_pipe = 1; + goto tr_setup; } return; @@ -653,19 +588,6 @@ ubsa_read_callback(struct usb2_xfer *xfe } static void -ubsa_read_clear_stall_callback(struct usb2_xfer *xfer) -{ - struct ubsa_softc *sc = xfer->priv_sc; - struct usb2_xfer *xfer_other = sc->sc_xfer[UBSA_BULK_DT_RD]; - - if (usb2_clear_stall_callback(xfer, xfer_other)) { - DPRINTF("stall cleared\n"); - sc->sc_flag &= ~UBSA_FLAG_READ_STALL; - usb2_transfer_start(xfer_other); - } -} - -static void ubsa_intr_callback(struct usb2_xfer *xfer) { struct ubsa_softc *sc = xfer->priv_sc; @@ -695,33 +617,18 @@ ubsa_intr_callback(struct usb2_xfer *xfe } case USB_ST_SETUP: - if (sc->sc_flag & UBSA_FLAG_INTR_STALL) { - usb2_transfer_start(sc->sc_xfer[UBSA_INTR_CS_RD]); - } else { - xfer->frlengths[0] = xfer->max_data_length; - usb2_start_hardware(xfer); - } +tr_setup: + xfer->frlengths[0] = xfer->max_data_length; + usb2_start_hardware(xfer); return; default: /* Error */ if (xfer->error != USB_ERR_CANCELLED) { - sc->sc_flag |= UBSA_FLAG_INTR_STALL; - usb2_transfer_start(sc->sc_xfer[UBSA_INTR_CS_RD]); + /* try to clear stall first */ + xfer->flags.stall_pipe = 1; + goto tr_setup; } return; } } - -static void -ubsa_intr_clear_stall_callback(struct usb2_xfer *xfer) -{ - struct ubsa_softc *sc = xfer->priv_sc; - struct usb2_xfer *xfer_other = sc->sc_xfer[UBSA_INTR_DT_RD]; - - if (usb2_clear_stall_callback(xfer, xfer_other)) { - DPRINTF("stall cleared\n"); - sc->sc_flag &= ~UBSA_FLAG_INTR_STALL; - usb2_transfer_start(xfer_other); - } -} Modified: head/sys/dev/usb2/serial/ubser2.c ============================================================================== --- head/sys/dev/usb2/serial/ubser2.c Mon Feb 9 22:02:38 2009 (r188412) +++ head/sys/dev/usb2/serial/ubser2.c Mon Feb 9 22:05:25 2009 (r188413) @@ -113,9 +113,7 @@ SYSCTL_INT(_hw_usb2_ubser, OID_AUTO, deb enum { UBSER_BULK_DT_WR, UBSER_BULK_DT_RD, - UBSER_BULK_CS_WR, - UBSER_BULK_CS_RD, - UBSER_N_TRANSFER = 4, + UBSER_N_TRANSFER, }; struct ubser_softc { @@ -128,10 +126,6 @@ struct ubser_softc { uint16_t sc_tx_size; uint8_t sc_numser; - uint8_t sc_flags; -#define UBSER_FLAG_READ_STALL 0x01 -#define UBSER_FLAG_WRITE_STALL 0x02 - uint8_t sc_iface_no; uint8_t sc_iface_index; uint8_t sc_curr_tx_unit; @@ -144,9 +138,7 @@ static device_probe_t ubser_probe; static device_attach_t ubser_attach; static device_detach_t ubser_detach; -static usb2_callback_t ubser_write_clear_stall_callback; static usb2_callback_t ubser_write_callback; -static usb2_callback_t ubser_read_clear_stall_callback; static usb2_callback_t ubser_read_callback; static int ubser_pre_param(struct usb2_com_softc *, struct termios *); @@ -177,28 +169,6 @@ static const struct usb2_config ubser_co .mh.flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, .mh.callback = &ubser_read_callback, }, - - [UBSER_BULK_CS_WR] = { - .type = UE_CONTROL, - .endpoint = 0x00, /* Control pipe */ - .direction = UE_DIR_ANY, - .mh.bufsize = sizeof(struct usb2_device_request), - .mh.flags = {}, - .mh.callback = &ubser_write_clear_stall_callback, - .mh.timeout = 1000, /* 1 second */ - .mh.interval = 50, /* 50ms */ - }, - - [UBSER_BULK_CS_RD] = { - .type = UE_CONTROL, - .endpoint = 0x00, /* Control pipe */ - .direction = UE_DIR_ANY, - .mh.bufsize = sizeof(struct usb2_device_request), - .mh.flags = {}, - .mh.callback = &ubser_read_clear_stall_callback, - .mh.timeout = 1000, /* 1 second */ - .mh.interval = 50, /* 50ms */ - }, }; static const struct usb2_com_callback ubser_callback = { @@ -311,8 +281,8 @@ ubser_attach(device_t dev) } mtx_lock(&Giant); - sc->sc_flags |= (UBSER_FLAG_READ_STALL | - UBSER_FLAG_WRITE_STALL); + usb2_transfer_set_stall(sc->sc_xfer[UBSER_BULK_DT_WR]); + usb2_transfer_set_stall(sc->sc_xfer[UBSER_BULK_DT_RD]); usb2_transfer_start(sc->sc_xfer[UBSER_BULK_DT_RD]); @@ -329,22 +299,11 @@ static int ubser_detach(device_t dev) { struct ubser_softc *sc = device_get_softc(dev); - uint8_t n; DPRINTF("\n"); usb2_com_detach(&sc->sc_super_ucom, sc->sc_ucom, sc->sc_numser); - /* - * need to stop all transfers atomically, hence when clear stall - * completes, it might start other transfers ! - */ - mtx_lock(&Giant); - for (n = 0; n < UBSER_N_TRANSFER; n++) { - usb2_transfer_stop(sc->sc_xfer[n]); - } - mtx_unlock(&Giant); - usb2_transfer_unsetup(sc->sc_xfer, UBSER_N_TRANSFER); return (0); @@ -409,19 +368,6 @@ ubser_inc_tx_unit(struct ubser_softc *sc } static void -ubser_write_clear_stall_callback(struct usb2_xfer *xfer) -{ - struct ubser_softc *sc = xfer->priv_sc; - struct usb2_xfer *xfer_other = sc->sc_xfer[UBSER_BULK_DT_WR]; - - if (usb2_clear_stall_callback(xfer, xfer_other)) { - DPRINTF("stall cleared\n"); - sc->sc_flags &= ~UBSER_FLAG_WRITE_STALL; - usb2_transfer_start(xfer_other); - } -} - -static void ubser_write_callback(struct usb2_xfer *xfer) { struct ubser_softc *sc = xfer->priv_sc; @@ -432,10 +378,7 @@ ubser_write_callback(struct usb2_xfer *x switch (USB_GET_STATE(xfer)) { case USB_ST_SETUP: case USB_ST_TRANSFERRED: - if (sc->sc_flags & UBSER_FLAG_WRITE_STALL) { - usb2_transfer_start(sc->sc_xfer[UBSER_BULK_CS_WR]); - return; - } +tr_setup: do { if (usb2_com_get_data(sc->sc_ucom + sc->sc_curr_tx_unit, xfer->frbuffers, 1, sc->sc_tx_size - 1, @@ -460,8 +403,9 @@ ubser_write_callback(struct usb2_xfer *x default: /* Error */ if (xfer->error != USB_ERR_CANCELLED) { - sc->sc_flags |= UBSER_FLAG_WRITE_STALL; - usb2_transfer_start(sc->sc_xfer[UBSER_BULK_CS_WR]); + /* try to clear stall first */ + xfer->flags.stall_pipe = 1; + goto tr_setup; } return; @@ -469,19 +413,6 @@ ubser_write_callback(struct usb2_xfer *x } static void -ubser_read_clear_stall_callback(struct usb2_xfer *xfer) -{ - struct ubser_softc *sc = xfer->priv_sc; - struct usb2_xfer *xfer_other = sc->sc_xfer[UBSER_BULK_DT_RD]; - - if (usb2_clear_stall_callback(xfer, xfer_other)) { - DPRINTF("stall cleared\n"); - sc->sc_flags &= ~UBSER_FLAG_READ_STALL; - usb2_transfer_start(xfer_other); - } -} - -static void ubser_read_callback(struct usb2_xfer *xfer) { struct ubser_softc *sc = xfer->priv_sc; @@ -504,18 +435,15 @@ ubser_read_callback(struct usb2_xfer *xf case USB_ST_SETUP: tr_setup: - if (sc->sc_flags & UBSER_FLAG_READ_STALL) { - usb2_transfer_start(sc->sc_xfer[UBSER_BULK_CS_RD]); - } else { - xfer->frlengths[0] = xfer->max_data_length; - usb2_start_hardware(xfer); - } + xfer->frlengths[0] = xfer->max_data_length; + usb2_start_hardware(xfer); return; default: /* Error */ if (xfer->error != USB_ERR_CANCELLED) { - sc->sc_flags |= UBSER_FLAG_READ_STALL; - usb2_transfer_start(sc->sc_xfer[UBSER_BULK_CS_RD]); + /* try to clear stall first */ + xfer->flags.stall_pipe = 1; + goto tr_setup; } return; @@ -540,9 +468,8 @@ ubser_cfg_set_break(struct usb2_com_soft req.wIndex[1] = 0; USETW(req.wLength, 0); - err = usb2_do_request_flags - (sc->sc_udev, &Giant, &req, NULL, 0, NULL, 1000); - + err = usb2_com_cfg_do_request(sc->sc_udev, ucom, + &req, NULL, 0, 1000); if (err) { DPRINTFN(0, "send break failed, error=%s\n", usb2_errstr(err)); @@ -571,7 +498,6 @@ ubser_stop_read(struct usb2_com_softc *u { struct ubser_softc *sc = ucom->sc_parent; - usb2_transfer_stop(sc->sc_xfer[UBSER_BULK_CS_RD]); usb2_transfer_stop(sc->sc_xfer[UBSER_BULK_DT_RD]); } @@ -588,6 +514,5 @@ ubser_stop_write(struct usb2_com_softc * { struct ubser_softc *sc = ucom->sc_parent; - usb2_transfer_stop(sc->sc_xfer[UBSER_BULK_CS_WR]); usb2_transfer_stop(sc->sc_xfer[UBSER_BULK_DT_WR]); } Modified: head/sys/dev/usb2/serial/uchcom2.c ============================================================================== --- head/sys/dev/usb2/serial/uchcom2.c Mon Feb 9 22:02:38 2009 (r188412) +++ head/sys/dev/usb2/serial/uchcom2.c Mon Feb 9 22:05:25 2009 (r188413) @@ -148,11 +148,8 @@ SYSCTL_INT(_hw_usb2_uchcom, OID_AUTO, de enum { UCHCOM_BULK_DT_WR, UCHCOM_BULK_DT_RD, - UCHCOM_BULK_CS_WR, - UCHCOM_BULK_CS_RD, UCHCOM_INTR_DT_RD, - UCHCOM_INTR_CS_RD, - UCHCOM_N_TRANSFER = 6, + UCHCOM_N_TRANSFER, }; struct uchcom_softc { @@ -167,10 +164,6 @@ struct uchcom_softc { uint8_t sc_version; uint8_t sc_msr; uint8_t sc_lsr; /* local status register */ - uint8_t sc_flag; -#define UCHCOM_FLAG_INTR_STALL 0x01 -#define UCHCOM_FLAG_READ_STALL 0x02 -#define UCHCOM_FLAG_WRITE_STALL 0x04 }; struct uchcom_divider { @@ -230,11 +223,8 @@ static device_attach_t uchcom_attach; static device_detach_t uchcom_detach; static usb2_callback_t uchcom_intr_callback; -static usb2_callback_t uchcom_intr_clear_stall_callback; static usb2_callback_t uchcom_write_callback; -static usb2_callback_t uchcom_write_clear_stall_callback; static usb2_callback_t uchcom_read_callback; -static usb2_callback_t uchcom_read_clear_stall_callback; static const struct usb2_config uchcom_config_data[UCHCOM_N_TRANSFER] = { @@ -256,26 +246,6 @@ static const struct usb2_config uchcom_c .mh.callback = &uchcom_read_callback, }, - [UCHCOM_BULK_CS_WR] = { - .type = UE_CONTROL, - .endpoint = 0x00, /* Control pipe */ - .direction = UE_DIR_ANY, - .mh.bufsize = sizeof(struct usb2_device_request), - .mh.callback = &uchcom_write_clear_stall_callback, - .mh.timeout = 1000, /* 1 second */ - .mh.interval = 50, /* 50ms */ - }, - - [UCHCOM_BULK_CS_RD] = { - .type = UE_CONTROL, - .endpoint = 0x00, /* Control pipe */ - .direction = UE_DIR_ANY, - .mh.bufsize = sizeof(struct usb2_device_request), - .mh.callback = &uchcom_read_clear_stall_callback, - .mh.timeout = 1000, /* 1 second */ - .mh.interval = 50, /* 50ms */ - }, - [UCHCOM_INTR_DT_RD] = { .type = UE_INTERRUPT, .endpoint = UE_ADDR_ANY, @@ -284,16 +254,6 @@ static const struct usb2_config uchcom_c .mh.bufsize = 0, /* use wMaxPacketSize */ .mh.callback = &uchcom_intr_callback, }, - - [UCHCOM_INTR_CS_RD] = { - .type = UE_CONTROL, - .endpoint = 0x00, /* Control pipe */ - .direction = UE_DIR_ANY, - .mh.bufsize = sizeof(struct usb2_device_request), - .mh.callback = &uchcom_intr_clear_stall_callback, - .mh.timeout = 1000, /* 1 second */ - .mh.interval = 50, /* 50ms */ - }, }; struct usb2_com_callback uchcom_callback = { @@ -378,8 +338,8 @@ uchcom_attach(device_t dev) sc->sc_rts = 1; /* clear stall at first run */ - sc->sc_flag |= (UCHCOM_FLAG_READ_STALL | - UCHCOM_FLAG_WRITE_STALL); + usb2_transfer_set_stall(sc->sc_xfer[UCHCOM_BULK_DT_WR]); + usb2_transfer_set_stall(sc->sc_xfer[UCHCOM_BULK_DT_RD]); error = usb2_com_attach(&sc->sc_super_ucom, &sc->sc_ucom, 1, sc, &uchcom_callback, &Giant); @@ -412,35 +372,6 @@ uchcom_detach(device_t dev) */ static void -uchcom_do_request(struct uchcom_softc *sc, - struct usb2_device_request *req, void *data) -{ - uint16_t length; - uint16_t actlen; - usb2_error_t err; - - length = UGETW(req->wLength); - actlen = 0; - - if (usb2_com_cfg_is_gone(&sc->sc_ucom)) { - goto done; - } - err = usb2_do_request_flags(sc->sc_udev, &Giant, req, - data, USB_SHORT_XFER_OK, &actlen, 1000); - - if (err) { - DPRINTFN(0, "device request failed, err=%s " - "(ignored)\n", usb2_errstr(err)); - } -done: - if (length != actlen) { - if (req->bmRequestType & UT_READ) { - bzero(USB_ADD_BYTES(data, actlen), length - actlen); - } - } -} - -static void uchcom_ctrl_write(struct uchcom_softc *sc, uint8_t reqno, uint16_t value, uint16_t index) { @@ -452,7 +383,8 @@ uchcom_ctrl_write(struct uchcom_softc *s USETW(req.wIndex, index); USETW(req.wLength, 0); - uchcom_do_request(sc, &req, NULL); + usb2_com_cfg_do_request(sc->sc_udev, + &sc->sc_ucom, &req, NULL, 0, 1000); } static void @@ -467,7 +399,8 @@ uchcom_ctrl_read(struct uchcom_softc *sc USETW(req.wIndex, index); USETW(req.wLength, buflen); - uchcom_do_request(sc, &req, buf); + usb2_com_cfg_do_request(sc->sc_udev, + &sc->sc_ucom, &req, buf, USB_SHORT_XFER_OK, 1000); } static void @@ -812,7 +745,6 @@ uchcom_stop_read(struct usb2_com_softc * usb2_transfer_stop(sc->sc_xfer[UCHCOM_INTR_DT_RD]); /* stop read endpoint */ - usb2_transfer_stop(sc->sc_xfer[UCHCOM_BULK_CS_RD]); usb2_transfer_stop(sc->sc_xfer[UCHCOM_BULK_DT_RD]); } @@ -829,7 +761,6 @@ uchcom_stop_write(struct usb2_com_softc { struct uchcom_softc *sc = ucom->sc_parent; - usb2_transfer_stop(sc->sc_xfer[UCHCOM_BULK_CS_WR]); usb2_transfer_stop(sc->sc_xfer[UCHCOM_BULK_DT_WR]); } @@ -859,37 +790,22 @@ uchcom_intr_callback(struct usb2_xfer *x usb2_com_status_change(&sc->sc_ucom); } case USB_ST_SETUP: - if (sc->sc_flag & UCHCOM_FLAG_INTR_STALL) { - usb2_transfer_start(sc->sc_xfer[UCHCOM_INTR_CS_RD]); - } else { - xfer->frlengths[0] = xfer->max_data_length; - usb2_start_hardware(xfer); - } +tr_setup: + xfer->frlengths[0] = xfer->max_data_length; + usb2_start_hardware(xfer); break; default: /* Error */ if (xfer->error != USB_ERR_CANCELLED) { - sc->sc_flag |= UCHCOM_FLAG_INTR_STALL; - usb2_transfer_start(sc->sc_xfer[UCHCOM_INTR_CS_RD]); + /* try to clear stall first */ + xfer->flags.stall_pipe = 1; + goto tr_setup; } break; } } static void -uchcom_intr_clear_stall_callback(struct usb2_xfer *xfer) -{ - struct uchcom_softc *sc = xfer->priv_sc; - struct usb2_xfer *xfer_other = sc->sc_xfer[UCHCOM_INTR_DT_RD]; - - if (usb2_clear_stall_callback(xfer, xfer_other)) { - DPRINTF("stall cleared\n"); - sc->sc_flag &= ~UCHCOM_FLAG_INTR_STALL; - usb2_transfer_start(xfer_other); - } -} - -static void uchcom_write_callback(struct usb2_xfer *xfer) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 22:06:52 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CC46D106564A; Mon, 9 Feb 2009 22:06:52 +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 BA46D8FC24; Mon, 9 Feb 2009 22:06:52 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n19M6qgx072671; Mon, 9 Feb 2009 22:06:52 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n19M6qu1072670; Mon, 9 Feb 2009 22:06:52 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200902092206.n19M6qu1072670@svn.freebsd.org> From: Andrew Thompson Date: Mon, 9 Feb 2009 22:06:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188414 - head/sys/dev/usb2/misc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Feb 2009 22:06:53 -0000 Author: thompsa Date: Mon Feb 9 22:06:52 2009 New Revision: 188414 URL: http://svn.freebsd.org/changeset/base/188414 Log: MFp4 //depot/projects/usb; 157069 - Change "usb2_pause_mtx" so that it takes the timeout value in ticks Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb2/misc/ufm2.c Modified: head/sys/dev/usb2/misc/ufm2.c ============================================================================== --- head/sys/dev/usb2/misc/ufm2.c Mon Feb 9 22:05:25 2009 (r188413) +++ head/sys/dev/usb2/misc/ufm2.c Mon Feb 9 22:06:52 2009 (r188414) @@ -288,10 +288,7 @@ ufm_get_stat(struct ufm_softc *sc, void * Note, there's a 240ms settle time before the status * will be valid, so sleep that amount. */ - - mtx_lock(&sc->sc_mtx); - usb2_pause_mtx(&sc->sc_mtx, USB_MS_HZ / 4); - mtx_unlock(&sc->sc_mtx); + usb2_pause_mtx(NULL, hz / 4); if (ufm_do_req(sc, UFM_CMD0, 0x00, 0x24, &ret)) { From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 22:09:21 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 604CE106564A; Mon, 9 Feb 2009 22:09: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 4DDAE8FC12; Mon, 9 Feb 2009 22:09:21 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n19M9LOJ072759; Mon, 9 Feb 2009 22:09:21 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n19M9LAm072758; Mon, 9 Feb 2009 22:09:21 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200902092209.n19M9LAm072758@svn.freebsd.org> From: Andrew Thompson Date: Mon, 9 Feb 2009 22:09:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188415 - head/sys/dev/usb2/storage X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Feb 2009 22:09:21 -0000 Author: thompsa Date: Mon Feb 9 22:09:21 2009 New Revision: 188415 URL: http://svn.freebsd.org/changeset/base/188415 Log: MFp4 //depot/projects/usb; 157203 - Remove CAM layer quirks Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb2/storage/umass2.c Modified: head/sys/dev/usb2/storage/umass2.c ============================================================================== --- head/sys/dev/usb2/storage/umass2.c Mon Feb 9 22:06:52 2009 (r188414) +++ head/sys/dev/usb2/storage/umass2.c Mon Feb 9 22:09:21 2009 (r188415) @@ -168,7 +168,6 @@ SYSCTL_INT(_hw_usb2_umass, OID_AUTO, deb #endif #define UMASS_GONE ((struct umass_softc *)1) -#define UMASS_MAXUNIT 64 /* XXX temporary */ #define UMASS_BULK_SIZE (1 << 17) #define UMASS_CBI_DIAGNOSTIC_CMDLEN 12 /* bytes */ @@ -1044,7 +1043,6 @@ static uint8_t umass_atapi_transform(str static uint8_t umass_no_transform(struct umass_softc *, uint8_t *, uint8_t); static uint8_t umass_std_transform(struct umass_softc *, union ccb *, uint8_t *, uint8_t); -static int umass_driver_loaded(struct module *, int what, void *); #if USB_DEBUG static void umass_bbb_dump_cbw(struct umass_softc *, umass_bbb_cbw_t *); @@ -1267,9 +1265,6 @@ static const uint8_t fake_inq_data[SHORT #define UFI_COMMAND_LENGTH 12 /* UFI commands are always 12 bytes */ #define ATAPI_COMMAND_LENGTH 12 /* ATAPI commands are always 12 bytes */ -static struct cam_sim *umass_sim[UMASS_MAXUNIT]; -static struct mtx umass_mtx; - static devclass_t umass_devclass; static device_method_t umass_methods[] = { @@ -1286,7 +1281,7 @@ static driver_t umass_driver = { .size = sizeof(struct umass_softc), }; -DRIVER_MODULE(umass, ushub, umass_driver, umass_devclass, umass_driver_loaded, 0); +DRIVER_MODULE(umass, ushub, umass_driver, umass_devclass, NULL, 0); MODULE_DEPEND(umass, usb2_storage, 1, 1, 1); MODULE_DEPEND(umass, usb2_core, 1, 1, 1); MODULE_DEPEND(umass, cam, 1, 1, 1); @@ -1444,11 +1439,6 @@ umass_attach(device_t dev) struct usb2_interface_descriptor *id; int32_t err; - if (device_get_unit(dev) >= UMASS_MAXUNIT) { - device_printf(dev, "Maxunit(%u) limit reached!\n", - UMASS_MAXUNIT); - return (ENOMEM); - } /* * NOTE: the softc struct is bzero-ed in device_set_driver. * We can safely call umass_detach without specifically @@ -1466,6 +1456,9 @@ umass_attach(device_t dev) device_set_usb2_desc(dev); + mtx_init(&sc->sc_mtx, device_get_nameunit(dev), + NULL, MTX_DEF | MTX_RECURSE); + /* get interface index */ id = usb2_get_interface_descriptor(uaa->iface); @@ -1534,7 +1527,7 @@ umass_attach(device_t dev) err = usb2_transfer_setup(uaa->device, &uaa->info.bIfaceIndex, sc->sc_xfer, umass_bbb_config, - UMASS_T_BBB_MAX, sc, &umass_mtx); + UMASS_T_BBB_MAX, sc, &sc->sc_mtx); /* skip reset first time */ sc->sc_last_xfer_index = UMASS_T_BBB_COMMAND; @@ -1545,7 +1538,7 @@ umass_attach(device_t dev) &uaa->info.bIfaceIndex, sc->sc_xfer, umass_cbi_config, (sc->sc_proto & UMASS_PROTO_CBI_I) ? UMASS_T_CBI_MAX : (UMASS_T_CBI_MAX - 2), sc, - &umass_mtx); + &sc->sc_mtx); /* skip reset first time */ sc->sc_last_xfer_index = UMASS_T_CBI_COMMAND; @@ -1587,7 +1580,7 @@ umass_attach(device_t dev) * some devices need a delay after that the configuration value is * set to function properly: */ - usb2_pause_mtx(&Giant, USB_MS_HZ); + usb2_pause_mtx(&Giant, hz); /* register the SIM */ err = umass_cam_attach_sim(sc); @@ -1618,12 +1611,12 @@ umass_detach(device_t dev) usb2_transfer_unsetup(sc->sc_xfer, UMASS_T_MAX); #if (__FreeBSD_version >= 700037) - mtx_lock(&umass_mtx); + mtx_lock(&sc->sc_mtx); #endif umass_cam_detach_sim(sc); #if (__FreeBSD_version >= 700037) - mtx_unlock(&umass_mtx); + mtx_unlock(&sc->sc_mtx); #endif return (0); /* success */ @@ -1687,7 +1680,7 @@ umass_cancel_ccb(struct umass_softc *sc) { union ccb *ccb; - mtx_assert(&umass_mtx, MA_OWNED); + mtx_assert(&sc->sc_mtx, MA_OWNED); ccb = sc->sc_transfer.ccb; sc->sc_transfer.ccb = NULL; @@ -2599,10 +2592,6 @@ umass_cam_attach_sim(struct umass_softc { struct cam_devq *devq; /* Per device Queue */ - if (umass_sim[sc->sc_unit] != NULL) { - sc->sc_sim = umass_sim[sc->sc_unit]; - goto register_only; - } /* * A HBA is attached to the CAM layer. * @@ -2620,7 +2609,7 @@ umass_cam_attach_sim(struct umass_softc sc /* priv */ , sc->sc_unit /* unit number */ , #if (__FreeBSD_version >= 700037) - &umass_mtx /* mutex */ , + &sc->sc_mtx /* mutex */ , #endif 1 /* maximum device openings */ , 0 /* maximum tagged device openings */ , @@ -2630,33 +2619,27 @@ umass_cam_attach_sim(struct umass_softc cam_simq_free(devq); return (ENOMEM); } - umass_sim[sc->sc_unit] = sc->sc_sim; - -register_only: - - /* update the softc pointer */ - sc->sc_sim->softc = sc; #if (__FreeBSD_version >= 700037) - mtx_lock(&umass_mtx); + mtx_lock(&sc->sc_mtx); #endif #if (__FreeBSD_version >= 700048) if (xpt_bus_register(sc->sc_sim, sc->sc_dev, sc->sc_unit) != CAM_SUCCESS) { - mtx_unlock(&umass_mtx); + mtx_unlock(&sc->sc_mtx); return (ENOMEM); } #else if (xpt_bus_register(sc->sc_sim, sc->sc_unit) != CAM_SUCCESS) { #if (__FreeBSD_version >= 700037) - mtx_unlock(&umass_mtx); + mtx_unlock(&sc->sc_mtx); #endif return (ENOMEM); } #endif #if (__FreeBSD_version >= 700037) - mtx_unlock(&umass_mtx); + mtx_unlock(&sc->sc_mtx); #endif return (0); } @@ -2698,14 +2681,14 @@ umass_cam_rescan(struct umass_softc *sc) return; } #if (__FreeBSD_version >= 700037) - mtx_lock(&umass_mtx); + mtx_lock(&sc->sc_mtx); #endif if (xpt_create_path(&path, xpt_periph, cam_sim_path(sc->sc_sim), CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { #if (__FreeBSD_version >= 700037) - mtx_unlock(&umass_mtx); + mtx_unlock(&sc->sc_mtx); #endif free(ccb, M_USBDEV); return; @@ -2717,7 +2700,7 @@ umass_cam_rescan(struct umass_softc *sc) xpt_action(ccb); #if (__FreeBSD_version >= 700037) - mtx_unlock(&umass_mtx); + mtx_unlock(&sc->sc_mtx); #endif /* The scan is in progress now. */ @@ -2755,14 +2738,11 @@ umass_cam_attach(struct umass_softc *sc) static void umass_cam_detach_sim(struct umass_softc *sc) { - if (sc->sc_sim) { + if (sc->sc_sim != NULL) { if (xpt_bus_deregister(cam_sim_path(sc->sc_sim))) { -#if 0 /* NOTYET */ - cam_sim_free(sc->sc_sim, /* free_devq */ TRUE); -#else /* accessing the softc is not possible after this */ sc->sc_sim->softc = UMASS_GONE; -#endif + cam_sim_free(sc->sc_sim, /* free_devq */ TRUE); } else { panic("%s: CAM layer is busy!\n", sc->sc_name); @@ -2787,7 +2767,7 @@ umass_cam_action(struct cam_sim *sim, un } if (sc) { #if (__FreeBSD_version < 700037) - mtx_lock(&umass_mtx); + mtx_lock(&sc->sc_mtx); #endif } /* @@ -3071,7 +3051,7 @@ umass_cam_action(struct cam_sim *sim, un done: #if (__FreeBSD_version < 700037) if (sc) { - mtx_unlock(&umass_mtx); + mtx_unlock(&sc->sc_mtx); } #endif return; @@ -3638,28 +3618,3 @@ umass_dump_buffer(struct umass_softc *sc } #endif - -static int -umass_driver_loaded(struct module *mod, int what, void *arg) -{ - uint16_t x; - - switch (what) { - case MOD_LOAD: - mtx_init(&umass_mtx, "UMASS lock", NULL, (MTX_DEF | MTX_RECURSE)); - break; - - case MOD_UNLOAD: - for (x = 0; x != UMASS_MAXUNIT; x++) { - /* cleanup */ - if (umass_sim[x]) - cam_sim_free(umass_sim[x], /* free_devq */ TRUE); - } - mtx_destroy(&umass_mtx); - break; - default: - return (EOPNOTSUPP); - } - - return (0); -} From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 22:11:02 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E9C791065670; Mon, 9 Feb 2009 22:11:02 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D6FFD8FC19; Mon, 9 Feb 2009 22:11:02 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n19MB2Vs072847; Mon, 9 Feb 2009 22:11:02 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n19MB2hV072846; Mon, 9 Feb 2009 22:11:02 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200902092211.n19MB2hV072846@svn.freebsd.org> From: Andrew Thompson Date: Mon, 9 Feb 2009 22:11:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188416 - head/sys/dev/usb2/sound X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Feb 2009 22:11:04 -0000 Author: thompsa Date: Mon Feb 9 22:11:02 2009 New Revision: 188416 URL: http://svn.freebsd.org/changeset/base/188416 Log: MFp4 //depot/projects/usb; 157069, 157255 - Change "usb2_pause_mtx" so that it takes the timeout value in ticks - Make sure that attach waits for the generic probe to leave room for firware loader drivers and device specific USB Audio drivers like USB phone adapters Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb2/sound/uaudio2.c Modified: head/sys/dev/usb2/sound/uaudio2.c ============================================================================== --- head/sys/dev/usb2/sound/uaudio2.c Mon Feb 9 22:09:21 2009 (r188415) +++ head/sys/dev/usb2/sound/uaudio2.c Mon Feb 9 22:11:02 2009 (r188416) @@ -539,9 +539,12 @@ uaudio_probe(device_t dev) { struct usb2_attach_arg *uaa = device_get_ivars(dev); - if (uaa->usb2_mode != USB_MODE_HOST) { + if (uaa->usb2_mode != USB_MODE_HOST) return (ENXIO); - } + + if (uaa->use_generic == 0) + return (ENXIO); + /* trigger on the control interface */ if ((uaa->info.bInterfaceClass == UICLASS_AUDIO) && @@ -725,9 +728,7 @@ repeat: if (error) { device_printf(dev, "Waiting for sound application to exit!\n"); - mtx_lock(&Giant); - usb2_pause_mtx(&Giant, 2000); - mtx_unlock(&Giant); + usb2_pause_mtx(NULL, 2 * hz); goto repeat; /* try again */ } return (0); /* success */ From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 22:12:47 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E1444106566C; Mon, 9 Feb 2009 22:12:47 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CE7BD8FC20; Mon, 9 Feb 2009 22:12:47 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n19MCl7l072912; Mon, 9 Feb 2009 22:12:47 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n19MClrY072910; Mon, 9 Feb 2009 22:12:47 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200902092212.n19MClrY072910@svn.freebsd.org> From: Andrew Thompson Date: Mon, 9 Feb 2009 22:12:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188417 - head/sys/dev/usb2/wlan X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Feb 2009 22:12:48 -0000 Author: thompsa Date: Mon Feb 9 22:12:47 2009 New Revision: 188417 URL: http://svn.freebsd.org/changeset/base/188417 Log: MFp4 //depot/projects/usb; 157412 Sync from svn.freebsd.org/base/user/thompsa/usb which is a minimal changeset from oldUSB (no config_td). This excludes the taskqueue changes (for the moment) as requested. Modified: head/sys/dev/usb2/wlan/if_rum2.c head/sys/dev/usb2/wlan/if_rumreg.h head/sys/dev/usb2/wlan/if_rumvar.h head/sys/dev/usb2/wlan/if_ural2.c head/sys/dev/usb2/wlan/if_uralreg.h head/sys/dev/usb2/wlan/if_uralvar.h head/sys/dev/usb2/wlan/if_zyd2.c head/sys/dev/usb2/wlan/if_zydfw.h head/sys/dev/usb2/wlan/if_zydreg.h Modified: head/sys/dev/usb2/wlan/if_rum2.c ============================================================================== --- head/sys/dev/usb2/wlan/if_rum2.c Mon Feb 9 22:11:02 2009 (r188416) +++ head/sys/dev/usb2/wlan/if_rum2.c Mon Feb 9 22:12:47 2009 (r188417) @@ -1,3 +1,5 @@ +/* $FreeBSD$ */ + /*- * Copyright (c) 2005-2007 Damien Bergamini * Copyright (c) 2006 Niall O'Higgins @@ -16,11 +18,6 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* - * NOTE: all function names beginning like "rum_cfg_" can only - * be called from within the config thread function ! - */ - #include __FBSDID("$FreeBSD$"); @@ -34,15 +31,11 @@ __FBSDID("$FreeBSD$"); #include #include -#define usb2_config_td_cc rum_config_copy -#define usb2_config_td_softc rum_softc - #define USB_DEBUG_VAR rum_debug #include #include #include -#include #include #include #include @@ -61,928 +54,817 @@ SYSCTL_INT(_hw_usb2_rum, OID_AUTO, debug "Debug level"); #endif -/* prototypes */ +#define rum_do_request(sc,req,data) \ + usb2_do_request_proc((sc)->sc_udev, &(sc)->sc_tq, req, data, 0, NULL, 5000) + +static const struct usb2_device_id rum_devs[] = { + { USB_VP(USB_VENDOR_ABOCOM, USB_PRODUCT_ABOCOM_HWU54DM) }, + { USB_VP(USB_VENDOR_ABOCOM, USB_PRODUCT_ABOCOM_RT2573_2) }, + { USB_VP(USB_VENDOR_ABOCOM, USB_PRODUCT_ABOCOM_RT2573_3) }, + { USB_VP(USB_VENDOR_ABOCOM, USB_PRODUCT_ABOCOM_RT2573_4) }, + { USB_VP(USB_VENDOR_ABOCOM, USB_PRODUCT_ABOCOM_WUG2700) }, + { USB_VP(USB_VENDOR_AMIT, USB_PRODUCT_AMIT_CGWLUSB2GO) }, + { USB_VP(USB_VENDOR_ASUS, USB_PRODUCT_ASUS_RT2573_1) }, + { USB_VP(USB_VENDOR_ASUS, USB_PRODUCT_ASUS_RT2573_2) }, + { USB_VP(USB_VENDOR_BELKIN, USB_PRODUCT_BELKIN_F5D7050A) }, + { USB_VP(USB_VENDOR_BELKIN, USB_PRODUCT_BELKIN_F5D9050V3) }, + { USB_VP(USB_VENDOR_CISCOLINKSYS, USB_PRODUCT_CISCOLINKSYS_WUSB54GC) }, + { USB_VP(USB_VENDOR_CISCOLINKSYS, USB_PRODUCT_CISCOLINKSYS_WUSB54GR) }, + { USB_VP(USB_VENDOR_CONCEPTRONIC2, USB_PRODUCT_CONCEPTRONIC2_C54RU2) }, + { USB_VP(USB_VENDOR_COREGA, USB_PRODUCT_COREGA_CGWLUSB2GL) }, + { USB_VP(USB_VENDOR_COREGA, USB_PRODUCT_COREGA_CGWLUSB2GPX) }, + { USB_VP(USB_VENDOR_DICKSMITH, USB_PRODUCT_DICKSMITH_CWD854F) }, + { USB_VP(USB_VENDOR_DICKSMITH, USB_PRODUCT_DICKSMITH_RT2573) }, + { USB_VP(USB_VENDOR_DLINK2, USB_PRODUCT_DLINK2_DWLG122C1) }, + { USB_VP(USB_VENDOR_DLINK2, USB_PRODUCT_DLINK2_WUA1340) }, + { USB_VP(USB_VENDOR_DLINK2, USB_PRODUCT_DLINK2_DWA111) }, + { USB_VP(USB_VENDOR_DLINK2, USB_PRODUCT_DLINK2_DWA110) }, + { USB_VP(USB_VENDOR_GIGABYTE, USB_PRODUCT_GIGABYTE_GNWB01GS) }, + { USB_VP(USB_VENDOR_GIGABYTE, USB_PRODUCT_GIGABYTE_GNWI05GS) }, + { USB_VP(USB_VENDOR_GIGASET, USB_PRODUCT_GIGASET_RT2573) }, + { USB_VP(USB_VENDOR_GOODWAY, USB_PRODUCT_GOODWAY_RT2573) }, + { USB_VP(USB_VENDOR_GUILLEMOT, USB_PRODUCT_GUILLEMOT_HWGUSB254LB) }, + { USB_VP(USB_VENDOR_GUILLEMOT, USB_PRODUCT_GUILLEMOT_HWGUSB254V2AP) }, + { USB_VP(USB_VENDOR_HUAWEI3COM, USB_PRODUCT_HUAWEI3COM_WUB320G) }, + { USB_VP(USB_VENDOR_MELCO, USB_PRODUCT_MELCO_G54HP) }, + { USB_VP(USB_VENDOR_MELCO, USB_PRODUCT_MELCO_SG54HP) }, + { USB_VP(USB_VENDOR_MSI, USB_PRODUCT_MSI_RT2573_1) }, + { USB_VP(USB_VENDOR_MSI, USB_PRODUCT_MSI_RT2573_2) }, + { USB_VP(USB_VENDOR_MSI, USB_PRODUCT_MSI_RT2573_3) }, + { USB_VP(USB_VENDOR_MSI, USB_PRODUCT_MSI_RT2573_4) }, + { USB_VP(USB_VENDOR_NOVATECH, USB_PRODUCT_NOVATECH_RT2573) }, + { USB_VP(USB_VENDOR_PLANEX2, USB_PRODUCT_PLANEX2_GWUS54HP) }, + { USB_VP(USB_VENDOR_PLANEX2, USB_PRODUCT_PLANEX2_GWUS54MINI2) }, + { USB_VP(USB_VENDOR_PLANEX2, USB_PRODUCT_PLANEX2_GWUSMM) }, + { USB_VP(USB_VENDOR_QCOM, USB_PRODUCT_QCOM_RT2573) }, + { USB_VP(USB_VENDOR_QCOM, USB_PRODUCT_QCOM_RT2573_2) }, + { USB_VP(USB_VENDOR_RALINK, USB_PRODUCT_RALINK_RT2573) }, + { USB_VP(USB_VENDOR_RALINK, USB_PRODUCT_RALINK_RT2573_2) }, + { USB_VP(USB_VENDOR_RALINK, USB_PRODUCT_RALINK_RT2671) }, + { USB_VP(USB_VENDOR_SITECOMEU, USB_PRODUCT_SITECOMEU_WL113R2) }, + { USB_VP(USB_VENDOR_SITECOMEU, USB_PRODUCT_SITECOMEU_WL172) }, + { USB_VP(USB_VENDOR_SPARKLAN, USB_PRODUCT_SPARKLAN_RT2573) }, + { USB_VP(USB_VENDOR_SURECOM, USB_PRODUCT_SURECOM_RT2573) }, +}; + +MODULE_DEPEND(rum, wlan, 1, 1, 1); +MODULE_DEPEND(rum, wlan_amrr, 1, 1, 1); +MODULE_DEPEND(rum, usb2_wlan, 1, 1, 1); +MODULE_DEPEND(rum, usb2_core, 1, 1, 1); -static device_probe_t rum_probe; +static device_probe_t rum_match; static device_attach_t rum_attach; static device_detach_t rum_detach; static usb2_callback_t rum_bulk_read_callback; -static usb2_callback_t rum_bulk_read_clear_stall_callback; static usb2_callback_t rum_bulk_write_callback; -static usb2_callback_t rum_bulk_write_clear_stall_callback; -static usb2_config_td_command_t rum_cfg_first_time_setup; -static usb2_config_td_command_t rum_config_copy; -static usb2_config_td_command_t rum_cfg_scan_start; -static usb2_config_td_command_t rum_cfg_scan_end; -static usb2_config_td_command_t rum_cfg_select_band; -static usb2_config_td_command_t rum_cfg_set_chan; -static usb2_config_td_command_t rum_cfg_enable_tsf_sync; -static usb2_config_td_command_t rum_cfg_enable_mrr; -static usb2_config_td_command_t rum_cfg_update_slot; -static usb2_config_td_command_t rum_cfg_select_antenna; -static usb2_config_td_command_t rum_cfg_set_txpreamble; -static usb2_config_td_command_t rum_cfg_update_promisc; -static usb2_config_td_command_t rum_cfg_pre_init; -static usb2_config_td_command_t rum_cfg_init; -static usb2_config_td_command_t rum_cfg_pre_stop; -static usb2_config_td_command_t rum_cfg_stop; -static usb2_config_td_command_t rum_cfg_amrr_timeout; -static usb2_config_td_command_t rum_cfg_prepare_beacon; -static usb2_config_td_command_t rum_cfg_newstate; - -static const char *rum_get_rf(uint32_t); -static int rum_ioctl_cb(struct ifnet *, u_long, caddr_t); -static void rum_std_command(struct ieee80211com *, usb2_config_td_command_t *); -static void rum_scan_start_cb(struct ieee80211com *); -static void rum_scan_end_cb(struct ieee80211com *); -static void rum_set_channel_cb(struct ieee80211com *); -static uint16_t rum_cfg_eeprom_read_2(struct rum_softc *, uint16_t); -static uint32_t rum_cfg_bbp_disbusy(struct rum_softc *); -static uint32_t rum_cfg_read(struct rum_softc *, uint16_t); -static uint8_t rum_cfg_bbp_init(struct rum_softc *); -static uint8_t rum_cfg_bbp_read(struct rum_softc *, uint8_t); -static void rum_cfg_amrr_start(struct rum_softc *); -static void rum_cfg_bbp_write(struct rum_softc *, uint8_t, uint8_t); -static void rum_cfg_do_request(struct rum_softc *, - struct usb2_device_request *, void *); -static void rum_cfg_eeprom_read(struct rum_softc *, uint16_t, void *, - uint16_t); -static void rum_cfg_load_microcode(struct rum_softc *, const uint8_t *, - uint16_t); -static void rum_cfg_read_eeprom(struct rum_softc *); -static void rum_cfg_read_multi(struct rum_softc *, uint16_t, void *, - uint16_t); -static void rum_cfg_rf_write(struct rum_softc *, uint8_t, uint32_t); -static void rum_cfg_set_bssid(struct rum_softc *, uint8_t *); -static void rum_cfg_set_macaddr(struct rum_softc *, uint8_t *); -static void rum_cfg_write(struct rum_softc *, uint16_t, uint32_t); -static void rum_cfg_write_multi(struct rum_softc *, uint16_t, void *, - uint16_t); -static void rum_end_of_commands(struct rum_softc *); -static void rum_init_cb(void *); -static void rum_start_cb(struct ifnet *); -static void rum_watchdog(void *); -static uint8_t rum_get_rssi(struct rum_softc *, uint8_t); +static usb2_proc_callback_t rum_attach_post; +static usb2_proc_callback_t rum_task; +static usb2_proc_callback_t rum_scantask; +static usb2_proc_callback_t rum_promisctask; +static usb2_proc_callback_t rum_amrr_task; +static usb2_proc_callback_t rum_init_task; +static usb2_proc_callback_t rum_stop_task; + static struct ieee80211vap *rum_vap_create(struct ieee80211com *, - const char[], int, int, int, const uint8_t[], - const uint8_t[]); -static void rum_vap_delete(struct ieee80211vap *); + const char name[IFNAMSIZ], int unit, int opmode, + int flags, const uint8_t bssid[IEEE80211_ADDR_LEN], + const uint8_t mac[IEEE80211_ADDR_LEN]); +static void rum_vap_delete(struct ieee80211vap *); +static void rum_tx_free(struct rum_tx_data *, int); +static void rum_setup_tx_list(struct rum_softc *); +static void rum_unsetup_tx_list(struct rum_softc *); +static int rum_newstate(struct ieee80211vap *, + enum ieee80211_state, int); +static void rum_setup_tx_desc(struct rum_softc *, + struct rum_tx_desc *, uint32_t, uint16_t, int, + int); +static int rum_tx_mgt(struct rum_softc *, struct mbuf *, + struct ieee80211_node *); +static int rum_tx_raw(struct rum_softc *, struct mbuf *, + struct ieee80211_node *, + const struct ieee80211_bpf_params *); +static int rum_tx_data(struct rum_softc *, struct mbuf *, + struct ieee80211_node *); +static void rum_start(struct ifnet *); +static int rum_ioctl(struct ifnet *, u_long, caddr_t); +static void rum_eeprom_read(struct rum_softc *, uint16_t, void *, + int); +static uint32_t rum_read(struct rum_softc *, uint16_t); +static void rum_read_multi(struct rum_softc *, uint16_t, void *, + int); +static void rum_write(struct rum_softc *, uint16_t, uint32_t); +static void rum_write_multi(struct rum_softc *, uint16_t, void *, + size_t); +static void rum_bbp_write(struct rum_softc *, uint8_t, uint8_t); +static uint8_t rum_bbp_read(struct rum_softc *, uint8_t); +static void rum_rf_write(struct rum_softc *, uint8_t, uint32_t); +static void rum_select_antenna(struct rum_softc *); +static void rum_enable_mrr(struct rum_softc *); +static void rum_set_txpreamble(struct rum_softc *); +static void rum_set_basicrates(struct rum_softc *); +static void rum_select_band(struct rum_softc *, + struct ieee80211_channel *); +static void rum_set_chan(struct rum_softc *, + struct ieee80211_channel *); +static void rum_enable_tsf_sync(struct rum_softc *); +static void rum_update_slot(struct ifnet *); +static void rum_set_bssid(struct rum_softc *, const uint8_t *); +static void rum_set_macaddr(struct rum_softc *, const uint8_t *); +static const char *rum_get_rf(int); +static void rum_read_eeprom(struct rum_softc *); +static int rum_bbp_init(struct rum_softc *); +static void rum_init(void *); +static int rum_load_microcode(struct rum_softc *, const u_char *, + size_t); +static int rum_prepare_beacon(struct rum_softc *, + struct ieee80211vap *); +static int rum_raw_xmit(struct ieee80211_node *, struct mbuf *, + const struct ieee80211_bpf_params *); static struct ieee80211_node *rum_node_alloc(struct ieee80211vap *, - const uint8_t[]); -static void rum_newassoc(struct ieee80211_node *, int); -static void rum_cfg_disable_tsf_sync(struct rum_softc *); -static void rum_cfg_set_run(struct rum_softc *, struct rum_config_copy *); -static void rum_fill_write_queue(struct rum_softc *); -static void rum_tx_clean_queue(struct rum_softc *); -static void rum_tx_freem(struct mbuf *); -static void rum_tx_mgt(struct rum_softc *, struct mbuf *, - struct ieee80211_node *); -static struct ieee80211vap *rum_get_vap(struct rum_softc *); -static void rum_tx_data(struct rum_softc *, struct mbuf *, - struct ieee80211_node *); -static void rum_tx_prot(struct rum_softc *, const struct mbuf *, - struct ieee80211_node *, uint8_t, uint16_t); -static void rum_tx_raw(struct rum_softc *, struct mbuf *, - struct ieee80211_node *, - const struct ieee80211_bpf_params *); -static int rum_raw_xmit_cb(struct ieee80211_node *, struct mbuf *, - const struct ieee80211_bpf_params *); -static void rum_setup_desc_and_tx(struct rum_softc *, struct mbuf *, - uint32_t, uint16_t, uint16_t); -static int rum_newstate_cb(struct ieee80211vap *, - enum ieee80211_state nstate, int arg); -static void rum_update_mcast_cb(struct ifnet *); -static void rum_update_promisc_cb(struct ifnet *); - -/* various supported device vendors/products */ -static const struct usb2_device_id rum_devs[] = { - {USB_VPI(USB_VENDOR_ABOCOM, USB_PRODUCT_ABOCOM_HWU54DM, 0)}, - {USB_VPI(USB_VENDOR_ABOCOM, USB_PRODUCT_ABOCOM_RT2573_2, 0)}, - {USB_VPI(USB_VENDOR_ABOCOM, USB_PRODUCT_ABOCOM_RT2573_3, 0)}, - {USB_VPI(USB_VENDOR_ABOCOM, USB_PRODUCT_ABOCOM_RT2573_4, 0)}, - {USB_VPI(USB_VENDOR_ABOCOM, USB_PRODUCT_ABOCOM_WUG2700, 0)}, - {USB_VPI(USB_VENDOR_AMIT, USB_PRODUCT_AMIT_CGWLUSB2GO, 0)}, - {USB_VPI(USB_VENDOR_ASUS, USB_PRODUCT_ASUS_RT2573_1, 0)}, - {USB_VPI(USB_VENDOR_ASUS, USB_PRODUCT_ASUS_RT2573_2, 0)}, - {USB_VPI(USB_VENDOR_BELKIN, USB_PRODUCT_BELKIN_F5D7050A, 0)}, - {USB_VPI(USB_VENDOR_BELKIN, USB_PRODUCT_BELKIN_F5D9050V3, 0)}, - {USB_VPI(USB_VENDOR_CISCOLINKSYS, USB_PRODUCT_CISCOLINKSYS_WUSB54GC, 0)}, - {USB_VPI(USB_VENDOR_CISCOLINKSYS, USB_PRODUCT_CISCOLINKSYS_WUSB54GR, 0)}, - {USB_VPI(USB_VENDOR_CONCEPTRONIC2, USB_PRODUCT_CONCEPTRONIC2_C54RU2, 0)}, - {USB_VPI(USB_VENDOR_COREGA, USB_PRODUCT_COREGA_CGWLUSB2GL, 0)}, - {USB_VPI(USB_VENDOR_COREGA, USB_PRODUCT_COREGA_CGWLUSB2GPX, 0)}, - {USB_VPI(USB_VENDOR_DICKSMITH, USB_PRODUCT_DICKSMITH_CWD854F, 0)}, - {USB_VPI(USB_VENDOR_DICKSMITH, USB_PRODUCT_DICKSMITH_RT2573, 0)}, - {USB_VPI(USB_VENDOR_DLINK2, USB_PRODUCT_DLINK2_DWLG122C1, 0)}, - {USB_VPI(USB_VENDOR_DLINK2, USB_PRODUCT_DLINK2_WUA1340, 0)}, - {USB_VPI(USB_VENDOR_DLINK2, USB_PRODUCT_DLINK2_DWA111, 0)}, - {USB_VPI(USB_VENDOR_DLINK2, USB_PRODUCT_DLINK2_DWA110, 0)}, - {USB_VPI(USB_VENDOR_GIGABYTE, USB_PRODUCT_GIGABYTE_GNWB01GS, 0)}, - {USB_VPI(USB_VENDOR_GIGABYTE, USB_PRODUCT_GIGABYTE_GNWI05GS, 0)}, - {USB_VPI(USB_VENDOR_GIGASET, USB_PRODUCT_GIGASET_RT2573, 0)}, - {USB_VPI(USB_VENDOR_GOODWAY, USB_PRODUCT_GOODWAY_RT2573, 0)}, - {USB_VPI(USB_VENDOR_GUILLEMOT, USB_PRODUCT_GUILLEMOT_HWGUSB254LB, 0)}, - {USB_VPI(USB_VENDOR_GUILLEMOT, USB_PRODUCT_GUILLEMOT_HWGUSB254V2AP, 0)}, - {USB_VPI(USB_VENDOR_HUAWEI3COM, USB_PRODUCT_HUAWEI3COM_WUB320G, 0)}, - {USB_VPI(USB_VENDOR_MELCO, USB_PRODUCT_MELCO_G54HP, 0)}, - {USB_VPI(USB_VENDOR_MELCO, USB_PRODUCT_MELCO_SG54HP, 0)}, - {USB_VPI(USB_VENDOR_MELCO, USB_PRODUCT_MELCO_SG54HG, 0)}, - {USB_VPI(USB_VENDOR_MSI, USB_PRODUCT_MSI_RT2573_1, 0)}, - {USB_VPI(USB_VENDOR_MSI, USB_PRODUCT_MSI_RT2573_2, 0)}, - {USB_VPI(USB_VENDOR_MSI, USB_PRODUCT_MSI_RT2573_3, 0)}, - {USB_VPI(USB_VENDOR_MSI, USB_PRODUCT_MSI_RT2573_4, 0)}, - {USB_VPI(USB_VENDOR_NOVATECH, USB_PRODUCT_NOVATECH_RT2573, 0)}, - {USB_VPI(USB_VENDOR_PLANEX2, USB_PRODUCT_PLANEX2_GWUS54HP, 0)}, - {USB_VPI(USB_VENDOR_PLANEX2, USB_PRODUCT_PLANEX2_GWUS54MINI2, 0)}, - {USB_VPI(USB_VENDOR_PLANEX2, USB_PRODUCT_PLANEX2_GWUSMM, 0)}, - {USB_VPI(USB_VENDOR_QCOM, USB_PRODUCT_QCOM_RT2573, 0)}, - {USB_VPI(USB_VENDOR_QCOM, USB_PRODUCT_QCOM_RT2573_2, 0)}, - {USB_VPI(USB_VENDOR_RALINK, USB_PRODUCT_RALINK_RT2573, 0)}, - {USB_VPI(USB_VENDOR_RALINK, USB_PRODUCT_RALINK_RT2573_2, 0)}, - {USB_VPI(USB_VENDOR_RALINK, USB_PRODUCT_RALINK_RT2671, 0)}, - {USB_VPI(USB_VENDOR_SITECOMEU, USB_PRODUCT_SITECOMEU_WL113R2, 0)}, - {USB_VPI(USB_VENDOR_SITECOMEU, USB_PRODUCT_SITECOMEU_WL172, 0)}, - {USB_VPI(USB_VENDOR_SPARKLAN, USB_PRODUCT_SPARKLAN_RT2573, 0)}, - {USB_VPI(USB_VENDOR_SURECOM, USB_PRODUCT_SURECOM_RT2573, 0)}, + const uint8_t mac[IEEE80211_ADDR_LEN]); +static void rum_newassoc(struct ieee80211_node *, int); +static void rum_scan_start(struct ieee80211com *); +static void rum_scan_end(struct ieee80211com *); +static void rum_set_channel(struct ieee80211com *); +static int rum_get_rssi(struct rum_softc *, uint8_t); +static void rum_amrr_start(struct rum_softc *, + struct ieee80211_node *); +static void rum_amrr_timeout(void *); +static void rum_queue_command(struct rum_softc *, + usb2_proc_callback_t *, struct usb2_proc_msg *, + struct usb2_proc_msg *); + +static const struct { + uint32_t reg; + uint32_t val; +} rum_def_mac[] = { + { RT2573_TXRX_CSR0, 0x025fb032 }, + { RT2573_TXRX_CSR1, 0x9eaa9eaf }, + { RT2573_TXRX_CSR2, 0x8a8b8c8d }, + { RT2573_TXRX_CSR3, 0x00858687 }, + { RT2573_TXRX_CSR7, 0x2e31353b }, + { RT2573_TXRX_CSR8, 0x2a2a2a2c }, + { RT2573_TXRX_CSR15, 0x0000000f }, + { RT2573_MAC_CSR6, 0x00000fff }, + { RT2573_MAC_CSR8, 0x016c030a }, + { RT2573_MAC_CSR10, 0x00000718 }, + { RT2573_MAC_CSR12, 0x00000004 }, + { RT2573_MAC_CSR13, 0x00007f00 }, + { RT2573_SEC_CSR0, 0x00000000 }, + { RT2573_SEC_CSR1, 0x00000000 }, + { RT2573_SEC_CSR5, 0x00000000 }, + { RT2573_PHY_CSR1, 0x000023b0 }, + { RT2573_PHY_CSR5, 0x00040a06 }, + { RT2573_PHY_CSR6, 0x00080606 }, + { RT2573_PHY_CSR7, 0x00000408 }, + { RT2573_AIFSN_CSR, 0x00002273 }, + { RT2573_CWMIN_CSR, 0x00002344 }, + { RT2573_CWMAX_CSR, 0x000034aa } }; -struct rum_def_mac { - uint32_t reg; - uint32_t val; -}; - -static const struct rum_def_mac rum_def_mac[] = { - {RT2573_TXRX_CSR0, 0x025fb032}, - {RT2573_TXRX_CSR1, 0x9eaa9eaf}, - {RT2573_TXRX_CSR2, 0x8a8b8c8d}, - {RT2573_TXRX_CSR3, 0x00858687}, - {RT2573_TXRX_CSR7, 0x2e31353b}, - {RT2573_TXRX_CSR8, 0x2a2a2a2c}, - {RT2573_TXRX_CSR15, 0x0000000f}, - {RT2573_MAC_CSR6, 0x00000fff}, - {RT2573_MAC_CSR8, 0x016c030a}, - {RT2573_MAC_CSR10, 0x00000718}, - {RT2573_MAC_CSR12, 0x00000004}, - {RT2573_MAC_CSR13, 0x00007f00}, - {RT2573_SEC_CSR0, 0x00000000}, - {RT2573_SEC_CSR1, 0x00000000}, - {RT2573_SEC_CSR5, 0x00000000}, - {RT2573_PHY_CSR1, 0x000023b0}, - {RT2573_PHY_CSR5, 0x00040a06}, - {RT2573_PHY_CSR6, 0x00080606}, - {RT2573_PHY_CSR7, 0x00000408}, - {RT2573_AIFSN_CSR, 0x00002273}, - {RT2573_CWMIN_CSR, 0x00002344}, - {RT2573_CWMAX_CSR, 0x000034aa} -}; - -struct rum_def_bbp { +static const struct { uint8_t reg; uint8_t val; +} rum_def_bbp[] = { + { 3, 0x80 }, + { 15, 0x30 }, + { 17, 0x20 }, + { 21, 0xc8 }, + { 22, 0x38 }, + { 23, 0x06 }, + { 24, 0xfe }, + { 25, 0x0a }, + { 26, 0x0d }, + { 32, 0x0b }, + { 34, 0x12 }, + { 37, 0x07 }, + { 39, 0xf8 }, + { 41, 0x60 }, + { 53, 0x10 }, + { 54, 0x18 }, + { 60, 0x10 }, + { 61, 0x04 }, + { 62, 0x04 }, + { 75, 0xfe }, + { 86, 0xfe }, + { 88, 0xfe }, + { 90, 0x0f }, + { 99, 0x00 }, + { 102, 0x16 }, + { 107, 0x04 } }; -static const struct rum_def_bbp rum_def_bbp[] = { - {3, 0x80}, - {15, 0x30}, - {17, 0x20}, - {21, 0xc8}, - {22, 0x38}, - {23, 0x06}, - {24, 0xfe}, - {25, 0x0a}, - {26, 0x0d}, - {32, 0x0b}, - {34, 0x12}, - {37, 0x07}, - {39, 0xf8}, - {41, 0x60}, - {53, 0x10}, - {54, 0x18}, - {60, 0x10}, - {61, 0x04}, - {62, 0x04}, - {75, 0xfe}, - {86, 0xfe}, - {88, 0xfe}, - {90, 0x0f}, - {99, 0x00}, - {102, 0x16}, - {107, 0x04} -}; - -struct rfprog { - uint8_t chan; - uint32_t r1, r2, r3, r4; -}; - -static const struct rfprog rum_rf5226[] = { - {1, 0x00b03, 0x001e1, 0x1a014, 0x30282}, - {2, 0x00b03, 0x001e1, 0x1a014, 0x30287}, - {3, 0x00b03, 0x001e2, 0x1a014, 0x30282}, - {4, 0x00b03, 0x001e2, 0x1a014, 0x30287}, - {5, 0x00b03, 0x001e3, 0x1a014, 0x30282}, - {6, 0x00b03, 0x001e3, 0x1a014, 0x30287}, - {7, 0x00b03, 0x001e4, 0x1a014, 0x30282}, - {8, 0x00b03, 0x001e4, 0x1a014, 0x30287}, - {9, 0x00b03, 0x001e5, 0x1a014, 0x30282}, - {10, 0x00b03, 0x001e5, 0x1a014, 0x30287}, - {11, 0x00b03, 0x001e6, 0x1a014, 0x30282}, - {12, 0x00b03, 0x001e6, 0x1a014, 0x30287}, - {13, 0x00b03, 0x001e7, 0x1a014, 0x30282}, - {14, 0x00b03, 0x001e8, 0x1a014, 0x30284}, - - {34, 0x00b03, 0x20266, 0x36014, 0x30282}, - {38, 0x00b03, 0x20267, 0x36014, 0x30284}, - {42, 0x00b03, 0x20268, 0x36014, 0x30286}, - {46, 0x00b03, 0x20269, 0x36014, 0x30288}, - - {36, 0x00b03, 0x00266, 0x26014, 0x30288}, - {40, 0x00b03, 0x00268, 0x26014, 0x30280}, - {44, 0x00b03, 0x00269, 0x26014, 0x30282}, - {48, 0x00b03, 0x0026a, 0x26014, 0x30284}, - {52, 0x00b03, 0x0026b, 0x26014, 0x30286}, - {56, 0x00b03, 0x0026c, 0x26014, 0x30288}, - {60, 0x00b03, 0x0026e, 0x26014, 0x30280}, - {64, 0x00b03, 0x0026f, 0x26014, 0x30282}, - - {100, 0x00b03, 0x0028a, 0x2e014, 0x30280}, - {104, 0x00b03, 0x0028b, 0x2e014, 0x30282}, - {108, 0x00b03, 0x0028c, 0x2e014, 0x30284}, - {112, 0x00b03, 0x0028d, 0x2e014, 0x30286}, - {116, 0x00b03, 0x0028e, 0x2e014, 0x30288}, - {120, 0x00b03, 0x002a0, 0x2e014, 0x30280}, - {124, 0x00b03, 0x002a1, 0x2e014, 0x30282}, - {128, 0x00b03, 0x002a2, 0x2e014, 0x30284}, - {132, 0x00b03, 0x002a3, 0x2e014, 0x30286}, - {136, 0x00b03, 0x002a4, 0x2e014, 0x30288}, - {140, 0x00b03, 0x002a6, 0x2e014, 0x30280}, - - {149, 0x00b03, 0x002a8, 0x2e014, 0x30287}, - {153, 0x00b03, 0x002a9, 0x2e014, 0x30289}, - {157, 0x00b03, 0x002ab, 0x2e014, 0x30281}, - {161, 0x00b03, 0x002ac, 0x2e014, 0x30283}, - {165, 0x00b03, 0x002ad, 0x2e014, 0x30285} -}; - -static const struct rfprog rum_rf5225[] = { - {1, 0x00b33, 0x011e1, 0x1a014, 0x30282}, - {2, 0x00b33, 0x011e1, 0x1a014, 0x30287}, - {3, 0x00b33, 0x011e2, 0x1a014, 0x30282}, - {4, 0x00b33, 0x011e2, 0x1a014, 0x30287}, - {5, 0x00b33, 0x011e3, 0x1a014, 0x30282}, - {6, 0x00b33, 0x011e3, 0x1a014, 0x30287}, - {7, 0x00b33, 0x011e4, 0x1a014, 0x30282}, - {8, 0x00b33, 0x011e4, 0x1a014, 0x30287}, - {9, 0x00b33, 0x011e5, 0x1a014, 0x30282}, - {10, 0x00b33, 0x011e5, 0x1a014, 0x30287}, - {11, 0x00b33, 0x011e6, 0x1a014, 0x30282}, - {12, 0x00b33, 0x011e6, 0x1a014, 0x30287}, - {13, 0x00b33, 0x011e7, 0x1a014, 0x30282}, - {14, 0x00b33, 0x011e8, 0x1a014, 0x30284}, - - {34, 0x00b33, 0x01266, 0x26014, 0x30282}, - {38, 0x00b33, 0x01267, 0x26014, 0x30284}, - {42, 0x00b33, 0x01268, 0x26014, 0x30286}, - {46, 0x00b33, 0x01269, 0x26014, 0x30288}, - - {36, 0x00b33, 0x01266, 0x26014, 0x30288}, - {40, 0x00b33, 0x01268, 0x26014, 0x30280}, - {44, 0x00b33, 0x01269, 0x26014, 0x30282}, - {48, 0x00b33, 0x0126a, 0x26014, 0x30284}, - {52, 0x00b33, 0x0126b, 0x26014, 0x30286}, - {56, 0x00b33, 0x0126c, 0x26014, 0x30288}, - {60, 0x00b33, 0x0126e, 0x26014, 0x30280}, - {64, 0x00b33, 0x0126f, 0x26014, 0x30282}, - - {100, 0x00b33, 0x0128a, 0x2e014, 0x30280}, - {104, 0x00b33, 0x0128b, 0x2e014, 0x30282}, - {108, 0x00b33, 0x0128c, 0x2e014, 0x30284}, - {112, 0x00b33, 0x0128d, 0x2e014, 0x30286}, - {116, 0x00b33, 0x0128e, 0x2e014, 0x30288}, - {120, 0x00b33, 0x012a0, 0x2e014, 0x30280}, - {124, 0x00b33, 0x012a1, 0x2e014, 0x30282}, - {128, 0x00b33, 0x012a2, 0x2e014, 0x30284}, - {132, 0x00b33, 0x012a3, 0x2e014, 0x30286}, - {136, 0x00b33, 0x012a4, 0x2e014, 0x30288}, - {140, 0x00b33, 0x012a6, 0x2e014, 0x30280}, - - {149, 0x00b33, 0x012a8, 0x2e014, 0x30287}, - {153, 0x00b33, 0x012a9, 0x2e014, 0x30289}, - {157, 0x00b33, 0x012ab, 0x2e014, 0x30281}, - {161, 0x00b33, 0x012ac, 0x2e014, 0x30283}, - {165, 0x00b33, 0x012ad, 0x2e014, 0x30285} +static const struct rfprog { + uint8_t chan; + uint32_t r1, r2, r3, r4; +} rum_rf5226[] = { + { 1, 0x00b03, 0x001e1, 0x1a014, 0x30282 }, + { 2, 0x00b03, 0x001e1, 0x1a014, 0x30287 }, + { 3, 0x00b03, 0x001e2, 0x1a014, 0x30282 }, + { 4, 0x00b03, 0x001e2, 0x1a014, 0x30287 }, + { 5, 0x00b03, 0x001e3, 0x1a014, 0x30282 }, + { 6, 0x00b03, 0x001e3, 0x1a014, 0x30287 }, + { 7, 0x00b03, 0x001e4, 0x1a014, 0x30282 }, + { 8, 0x00b03, 0x001e4, 0x1a014, 0x30287 }, + { 9, 0x00b03, 0x001e5, 0x1a014, 0x30282 }, + { 10, 0x00b03, 0x001e5, 0x1a014, 0x30287 }, + { 11, 0x00b03, 0x001e6, 0x1a014, 0x30282 }, + { 12, 0x00b03, 0x001e6, 0x1a014, 0x30287 }, + { 13, 0x00b03, 0x001e7, 0x1a014, 0x30282 }, + { 14, 0x00b03, 0x001e8, 0x1a014, 0x30284 }, + + { 34, 0x00b03, 0x20266, 0x36014, 0x30282 }, + { 38, 0x00b03, 0x20267, 0x36014, 0x30284 }, + { 42, 0x00b03, 0x20268, 0x36014, 0x30286 }, + { 46, 0x00b03, 0x20269, 0x36014, 0x30288 }, + + { 36, 0x00b03, 0x00266, 0x26014, 0x30288 }, + { 40, 0x00b03, 0x00268, 0x26014, 0x30280 }, + { 44, 0x00b03, 0x00269, 0x26014, 0x30282 }, + { 48, 0x00b03, 0x0026a, 0x26014, 0x30284 }, + { 52, 0x00b03, 0x0026b, 0x26014, 0x30286 }, + { 56, 0x00b03, 0x0026c, 0x26014, 0x30288 }, + { 60, 0x00b03, 0x0026e, 0x26014, 0x30280 }, + { 64, 0x00b03, 0x0026f, 0x26014, 0x30282 }, + + { 100, 0x00b03, 0x0028a, 0x2e014, 0x30280 }, + { 104, 0x00b03, 0x0028b, 0x2e014, 0x30282 }, + { 108, 0x00b03, 0x0028c, 0x2e014, 0x30284 }, + { 112, 0x00b03, 0x0028d, 0x2e014, 0x30286 }, + { 116, 0x00b03, 0x0028e, 0x2e014, 0x30288 }, + { 120, 0x00b03, 0x002a0, 0x2e014, 0x30280 }, + { 124, 0x00b03, 0x002a1, 0x2e014, 0x30282 }, + { 128, 0x00b03, 0x002a2, 0x2e014, 0x30284 }, + { 132, 0x00b03, 0x002a3, 0x2e014, 0x30286 }, + { 136, 0x00b03, 0x002a4, 0x2e014, 0x30288 }, + { 140, 0x00b03, 0x002a6, 0x2e014, 0x30280 }, + + { 149, 0x00b03, 0x002a8, 0x2e014, 0x30287 }, + { 153, 0x00b03, 0x002a9, 0x2e014, 0x30289 }, + { 157, 0x00b03, 0x002ab, 0x2e014, 0x30281 }, + { 161, 0x00b03, 0x002ac, 0x2e014, 0x30283 }, + { 165, 0x00b03, 0x002ad, 0x2e014, 0x30285 } +}, rum_rf5225[] = { + { 1, 0x00b33, 0x011e1, 0x1a014, 0x30282 }, + { 2, 0x00b33, 0x011e1, 0x1a014, 0x30287 }, + { 3, 0x00b33, 0x011e2, 0x1a014, 0x30282 }, + { 4, 0x00b33, 0x011e2, 0x1a014, 0x30287 }, + { 5, 0x00b33, 0x011e3, 0x1a014, 0x30282 }, + { 6, 0x00b33, 0x011e3, 0x1a014, 0x30287 }, + { 7, 0x00b33, 0x011e4, 0x1a014, 0x30282 }, + { 8, 0x00b33, 0x011e4, 0x1a014, 0x30287 }, + { 9, 0x00b33, 0x011e5, 0x1a014, 0x30282 }, + { 10, 0x00b33, 0x011e5, 0x1a014, 0x30287 }, + { 11, 0x00b33, 0x011e6, 0x1a014, 0x30282 }, + { 12, 0x00b33, 0x011e6, 0x1a014, 0x30287 }, + { 13, 0x00b33, 0x011e7, 0x1a014, 0x30282 }, + { 14, 0x00b33, 0x011e8, 0x1a014, 0x30284 }, + + { 34, 0x00b33, 0x01266, 0x26014, 0x30282 }, + { 38, 0x00b33, 0x01267, 0x26014, 0x30284 }, + { 42, 0x00b33, 0x01268, 0x26014, 0x30286 }, + { 46, 0x00b33, 0x01269, 0x26014, 0x30288 }, + + { 36, 0x00b33, 0x01266, 0x26014, 0x30288 }, + { 40, 0x00b33, 0x01268, 0x26014, 0x30280 }, + { 44, 0x00b33, 0x01269, 0x26014, 0x30282 }, + { 48, 0x00b33, 0x0126a, 0x26014, 0x30284 }, + { 52, 0x00b33, 0x0126b, 0x26014, 0x30286 }, + { 56, 0x00b33, 0x0126c, 0x26014, 0x30288 }, + { 60, 0x00b33, 0x0126e, 0x26014, 0x30280 }, + { 64, 0x00b33, 0x0126f, 0x26014, 0x30282 }, + + { 100, 0x00b33, 0x0128a, 0x2e014, 0x30280 }, + { 104, 0x00b33, 0x0128b, 0x2e014, 0x30282 }, + { 108, 0x00b33, 0x0128c, 0x2e014, 0x30284 }, + { 112, 0x00b33, 0x0128d, 0x2e014, 0x30286 }, + { 116, 0x00b33, 0x0128e, 0x2e014, 0x30288 }, + { 120, 0x00b33, 0x012a0, 0x2e014, 0x30280 }, + { 124, 0x00b33, 0x012a1, 0x2e014, 0x30282 }, + { 128, 0x00b33, 0x012a2, 0x2e014, 0x30284 }, + { 132, 0x00b33, 0x012a3, 0x2e014, 0x30286 }, + { 136, 0x00b33, 0x012a4, 0x2e014, 0x30288 }, + { 140, 0x00b33, 0x012a6, 0x2e014, 0x30280 }, + + { 149, 0x00b33, 0x012a8, 0x2e014, 0x30287 }, + { 153, 0x00b33, 0x012a9, 0x2e014, 0x30289 }, + { 157, 0x00b33, 0x012ab, 0x2e014, 0x30281 }, + { 161, 0x00b33, 0x012ac, 0x2e014, 0x30283 }, + { 165, 0x00b33, 0x012ad, 0x2e014, 0x30285 } }; static const struct usb2_config rum_config[RUM_N_TRANSFER] = { - [RUM_BULK_DT_WR] = { + [RUM_BULK_WR] = { .type = UE_BULK, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, .mh.bufsize = (MCLBYTES + RT2573_TX_DESC_SIZE + 8), .mh.flags = {.pipe_bof = 1,.force_short_xfer = 1,}, - .mh.callback = &rum_bulk_write_callback, + .mh.callback = rum_bulk_write_callback, .mh.timeout = 5000, /* ms */ }, - - [RUM_BULK_DT_RD] = { + [RUM_BULK_RD] = { .type = UE_BULK, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, .mh.bufsize = (MCLBYTES + RT2573_RX_DESC_SIZE), .mh.flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, - .mh.callback = &rum_bulk_read_callback, - }, - - [RUM_BULK_CS_WR] = { - .type = UE_CONTROL, - .endpoint = 0x00, /* Control pipe */ - .direction = UE_DIR_ANY, - .mh.bufsize = sizeof(struct usb2_device_request), - .mh.callback = &rum_bulk_write_clear_stall_callback, - .mh.timeout = 1000, /* 1 second */ - .mh.interval = 50, /* 50ms */ - }, - - [RUM_BULK_CS_RD] = { - .type = UE_CONTROL, - .endpoint = 0x00, /* Control pipe */ - .direction = UE_DIR_ANY, - .mh.bufsize = sizeof(struct usb2_device_request), - .mh.callback = &rum_bulk_read_clear_stall_callback, - .mh.timeout = 1000, /* 1 second */ - .mh.interval = 50, /* 50ms */ + .mh.callback = rum_bulk_read_callback, }, }; -static devclass_t rum_devclass; - -static device_method_t rum_methods[] = { - DEVMETHOD(device_probe, rum_probe), - DEVMETHOD(device_attach, rum_attach), - DEVMETHOD(device_detach, rum_detach), - {0, 0} -}; - -static driver_t rum_driver = { - .name = "rum", - .methods = rum_methods, - .size = sizeof(struct rum_softc), -}; - -DRIVER_MODULE(rum, ushub, rum_driver, rum_devclass, NULL, 0); -MODULE_DEPEND(rum, usb2_wlan, 1, 1, 1); -MODULE_DEPEND(rum, usb2_core, 1, 1, 1); -MODULE_DEPEND(rum, wlan, 1, 1, 1); -MODULE_DEPEND(rum, wlan_amrr, 1, 1, 1); - static int -rum_probe(device_t dev) +rum_match(device_t self) { - struct usb2_attach_arg *uaa = device_get_ivars(dev); + struct usb2_attach_arg *uaa = device_get_ivars(self); - if (uaa->usb2_mode != USB_MODE_HOST) { + if (uaa->usb2_mode != USB_MODE_HOST) return (ENXIO); - } - if (uaa->info.bConfigIndex != 0) { + if (uaa->info.bConfigIndex != 0) return (ENXIO); - } - if (uaa->info.bIfaceIndex != RT2573_IFACE_INDEX) { + if (uaa->info.bIfaceIndex != RT2573_IFACE_INDEX) return (ENXIO); - } + return (usb2_lookup_id_by_uaa(rum_devs, sizeof(rum_devs), uaa)); } static int -rum_attach(device_t dev) +rum_attach(device_t self) { - struct usb2_attach_arg *uaa = device_get_ivars(dev); - struct rum_softc *sc = device_get_softc(dev); - int error; + struct usb2_attach_arg *uaa = device_get_ivars(self); + struct rum_softc *sc = device_get_softc(self); uint8_t iface_index; + int error; - device_set_usb2_desc(dev); - - mtx_init(&sc->sc_mtx, "rum lock", MTX_NETWORK_LOCK, - MTX_DEF | MTX_RECURSE); - - snprintf(sc->sc_name, sizeof(sc->sc_name), "%s", - device_get_nameunit(dev)); - + device_set_usb2_desc(self); sc->sc_udev = uaa->device; - sc->sc_unit = device_get_unit(dev); + sc->sc_dev = self; - usb2_callout_init_mtx(&sc->sc_watchdog, &sc->sc_mtx, 0); + mtx_init(&sc->sc_mtx, device_get_nameunit(self), + MTX_NETWORK_LOCK, MTX_DEF); iface_index = RT2573_IFACE_INDEX; error = usb2_transfer_setup(uaa->device, &iface_index, sc->sc_xfer, rum_config, RUM_N_TRANSFER, sc, &sc->sc_mtx); if (error) { - device_printf(dev, "could not allocate USB transfers, " + device_printf(self, "could not allocate USB transfers, " "err=%s\n", usb2_errstr(error)); goto detach; } - error = usb2_config_td_setup(&sc->sc_config_td, sc, &sc->sc_mtx, - &rum_end_of_commands, - sizeof(struct usb2_config_td_cc), 24); + error = usb2_proc_create(&sc->sc_tq, &sc->sc_mtx, + device_get_nameunit(self), USB_PRI_MED); if (error) { - device_printf(dev, "could not setup config " - "thread!\n"); + device_printf(self, "could not setup config thread!\n"); goto detach; } - mtx_lock(&sc->sc_mtx); - - /* start setup */ - - usb2_config_td_queue_command - (&sc->sc_config_td, NULL, &rum_cfg_first_time_setup, 0, 0); - rum_watchdog(sc); - mtx_unlock(&sc->sc_mtx); - return (0); /* success */ + /* fork rest of the attach code */ + RUM_LOCK(sc); + rum_queue_command(sc, rum_attach_post, + &sc->sc_synctask[0].hdr, + &sc->sc_synctask[1].hdr); + RUM_UNLOCK(sc); + return (0); detach: - rum_detach(dev); + rum_detach(self); return (ENXIO); /* failure */ } -static int -rum_detach(device_t dev) +static void +rum_attach_post(struct usb2_proc_msg *pm) { - struct rum_softc *sc = device_get_softc(dev); - struct ieee80211com *ic; + struct rum_task *task = (struct rum_task *)pm; + struct rum_softc *sc = task->sc; struct ifnet *ifp; + struct ieee80211com *ic; + unsigned int ntries; + int error; + uint32_t tmp; + uint8_t bands; - usb2_config_td_drain(&sc->sc_config_td); + /* retrieve RT2573 rev. no */ + for (ntries = 0; ntries != 1000; ntries++) { + if ((tmp = rum_read(sc, RT2573_MAC_CSR0)) != 0) + break; + usb2_pause_mtx(&sc->sc_mtx, hz / 1000); + } + if (ntries == 1000) { + device_printf(sc->sc_dev, "timeout waiting for chip to settle\n"); + return; + } - mtx_lock(&sc->sc_mtx); + /* retrieve MAC address and various other things from EEPROM */ + rum_read_eeprom(sc); - usb2_callout_stop(&sc->sc_watchdog); + device_printf(sc->sc_dev, "MAC/BBP RT2573 (rev 0x%05x), RF %s\n", + tmp, rum_get_rf(sc->rf_rev)); - rum_cfg_pre_stop(sc, NULL, 0); + error = rum_load_microcode(sc, rt2573_ucode, sizeof(rt2573_ucode)); + if (error != 0) { + RUM_UNLOCK(sc); + device_printf(sc->sc_dev, "could not load 8051 microcode\n"); + return; + } + RUM_UNLOCK(sc); - ifp = sc->sc_ifp; + ifp = sc->sc_ifp = if_alloc(IFT_IEEE80211); + if (ifp == NULL) { + device_printf(sc->sc_dev, "can not if_alloc()\n"); + RUM_LOCK(sc); + return; + } ic = ifp->if_l2com; - mtx_unlock(&sc->sc_mtx); - - /* stop all USB transfers first */ - usb2_transfer_unsetup(sc->sc_xfer, RUM_N_TRANSFER); - - /* get rid of any late children */ - bus_generic_detach(dev); - - if (ifp) { - bpfdetach(ifp); - ieee80211_ifdetach(ic); - if_free(ifp); - } - usb2_config_td_unsetup(&sc->sc_config_td); + ifp->if_softc = sc; + if_initname(ifp, "rum", device_get_unit(sc->sc_dev)); + ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; + ifp->if_init = rum_init; + ifp->if_ioctl = rum_ioctl; + ifp->if_start = rum_start; + IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); + ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN; + IFQ_SET_READY(&ifp->if_snd); - usb2_callout_drain(&sc->sc_watchdog); + ic->ic_ifp = ifp; + ic->ic_phytype = IEEE80211_T_OFDM; /* not only, but not used */ + IEEE80211_ADDR_COPY(ic->ic_myaddr, sc->sc_bssid); - mtx_destroy(&sc->sc_mtx); + /* set device capabilities */ + ic->ic_caps = + IEEE80211_C_STA /* station mode supported */ + | IEEE80211_C_IBSS /* IBSS mode supported */ + | IEEE80211_C_MONITOR /* monitor mode supported */ + | IEEE80211_C_HOSTAP /* HostAp mode supported */ + | IEEE80211_C_TXPMGT /* tx power management */ + | IEEE80211_C_SHPREAMBLE /* short preamble supported */ + | IEEE80211_C_SHSLOT /* short slot time supported */ + | IEEE80211_C_BGSCAN /* bg scanning supported */ + | IEEE80211_C_WPA /* 802.11i */ + ; - return (0); -} + bands = 0; + setbit(&bands, IEEE80211_MODE_11B); + setbit(&bands, IEEE80211_MODE_11G); + if (sc->rf_rev == RT2573_RF_5225 || sc->rf_rev == RT2573_RF_5226) + setbit(&bands, IEEE80211_MODE_11A); + ieee80211_init_channels(ic, NULL, &bands); -static void -rum_cfg_do_request(struct rum_softc *sc, struct usb2_device_request *req, - void *data) -{ - uint16_t length; - usb2_error_t err; + ieee80211_ifattach(ic); + ic->ic_newassoc = rum_newassoc; + ic->ic_raw_xmit = rum_raw_xmit; + ic->ic_node_alloc = rum_node_alloc; + ic->ic_scan_start = rum_scan_start; + ic->ic_scan_end = rum_scan_end; + ic->ic_set_channel = rum_set_channel; -repeat: + ic->ic_vap_create = rum_vap_create; + ic->ic_vap_delete = rum_vap_delete; - if (usb2_config_td_is_gone(&sc->sc_config_td)) { - goto error; - } - err = usb2_do_request_flags - (sc->sc_udev, &sc->sc_mtx, req, data, 0, NULL, 1000); + sc->sc_rates = ieee80211_get_ratetable(ic->ic_curchan); - if (err) { + bpfattach(ifp, DLT_IEEE802_11_RADIO, + sizeof (struct ieee80211_frame) + sizeof(sc->sc_txtap)); - DPRINTF("device request failed, err=%s " - "(ignored)\n", usb2_errstr(err)); + sc->sc_rxtap_len = sizeof sc->sc_rxtap; + sc->sc_rxtap.wr_ihdr.it_len = htole16(sc->sc_rxtap_len); + sc->sc_rxtap.wr_ihdr.it_present = htole32(RT2573_RX_RADIOTAP_PRESENT); - /* wait a little before next try */ - if (usb2_config_td_sleep(&sc->sc_config_td, hz / 4)) { - goto error; - } - /* try until we are detached */ - goto repeat; + sc->sc_txtap_len = sizeof sc->sc_txtap; + sc->sc_txtap.wt_ihdr.it_len = htole16(sc->sc_txtap_len); + sc->sc_txtap.wt_ihdr.it_present = htole32(RT2573_TX_RADIOTAP_PRESENT); -error: - /* the device has been detached */ - length = UGETW(req->wLength); + if (bootverbose) + ieee80211_announce(ic); - if ((req->bmRequestType & UT_READ) && length) { - bzero(data, length); - } - } + RUM_LOCK(sc); } -static void -rum_cfg_eeprom_read(struct rum_softc *sc, uint16_t addr, void *buf, uint16_t len) +static int +rum_detach(device_t self) { - struct usb2_device_request req; + struct rum_softc *sc = device_get_softc(self); + struct ifnet *ifp = sc->sc_ifp; + struct ieee80211com *ic = ifp->if_l2com; - req.bmRequestType = UT_READ_VENDOR_DEVICE; - req.bRequest = RT2573_READ_EEPROM; - USETW(req.wValue, 0); - USETW(req.wIndex, addr); - USETW(req.wLength, len); + /* wait for any post attach or other command to complete */ + usb2_proc_drain(&sc->sc_tq); - rum_cfg_do_request(sc, &req, buf); -} + /* stop all USB transfers */ + usb2_transfer_unsetup(sc->sc_xfer, RUM_N_TRANSFER); + usb2_proc_free(&sc->sc_tq); -static uint16_t -rum_cfg_eeprom_read_2(struct rum_softc *sc, uint16_t addr) -{ - uint16_t tmp; + /* free TX list, if any */ + RUM_LOCK(sc); + rum_unsetup_tx_list(sc); + RUM_UNLOCK(sc); - rum_cfg_eeprom_read(sc, addr, &tmp, sizeof(tmp)); - return (le16toh(tmp)); -} *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 22:14:39 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 259A310656CB; Mon, 9 Feb 2009 22:14:39 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1268E8FC29; Mon, 9 Feb 2009 22:14:39 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n19MEcVN072998; Mon, 9 Feb 2009 22:14:38 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n19MEcOf072994; Mon, 9 Feb 2009 22:14:38 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200902092214.n19MEcOf072994@svn.freebsd.org> From: Andrew Thompson Date: Mon, 9 Feb 2009 22:14:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188418 - head/sys/dev/usb2/wlan X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Feb 2009 22:14:39 -0000 Author: thompsa Date: Mon Feb 9 22:14:38 2009 New Revision: 188418 URL: http://svn.freebsd.org/changeset/base/188418 Log: Correct sources for r188417 MFp4 //depot/projects/usb; 157412 Sync from svn.freebsd.org/base/user/thompsa/usb which is a minimal changeset from oldUSB (no config_td). This excludes the taskqueue changes (for the moment) as requested. Modified: head/sys/dev/usb2/wlan/if_rum2.c head/sys/dev/usb2/wlan/if_rumvar.h head/sys/dev/usb2/wlan/if_ural2.c head/sys/dev/usb2/wlan/if_uralvar.h head/sys/dev/usb2/wlan/if_zyd2.c head/sys/dev/usb2/wlan/if_zydreg.h Modified: head/sys/dev/usb2/wlan/if_rum2.c ============================================================================== --- head/sys/dev/usb2/wlan/if_rum2.c Mon Feb 9 22:12:47 2009 (r188417) +++ head/sys/dev/usb2/wlan/if_rum2.c Mon Feb 9 22:14:38 2009 (r188418) @@ -54,9 +54,6 @@ SYSCTL_INT(_hw_usb2_rum, OID_AUTO, debug "Debug level"); #endif -#define rum_do_request(sc,req,data) \ - usb2_do_request_proc((sc)->sc_udev, &(sc)->sc_tq, req, data, 0, NULL, 5000) - static const struct usb2_device_id rum_devs[] = { { USB_VP(USB_VENDOR_ABOCOM, USB_PRODUCT_ABOCOM_HWU54DM) }, { USB_VP(USB_VENDOR_ABOCOM, USB_PRODUCT_ABOCOM_RT2573_2) }, @@ -119,13 +116,10 @@ static device_detach_t rum_detach; static usb2_callback_t rum_bulk_read_callback; static usb2_callback_t rum_bulk_write_callback; -static usb2_proc_callback_t rum_attach_post; static usb2_proc_callback_t rum_task; static usb2_proc_callback_t rum_scantask; static usb2_proc_callback_t rum_promisctask; static usb2_proc_callback_t rum_amrr_task; -static usb2_proc_callback_t rum_init_task; -static usb2_proc_callback_t rum_stop_task; static struct ieee80211vap *rum_vap_create(struct ieee80211com *, const char name[IFNAMSIZ], int unit, int opmode, @@ -133,8 +127,8 @@ static struct ieee80211vap *rum_vap_crea const uint8_t mac[IEEE80211_ADDR_LEN]); static void rum_vap_delete(struct ieee80211vap *); static void rum_tx_free(struct rum_tx_data *, int); -static void rum_setup_tx_list(struct rum_softc *); -static void rum_unsetup_tx_list(struct rum_softc *); +static int rum_alloc_tx_list(struct rum_softc *); +static void rum_free_tx_list(struct rum_softc *); static int rum_newstate(struct ieee80211vap *, enum ieee80211_state, int); static void rum_setup_tx_desc(struct rum_softc *, @@ -175,7 +169,9 @@ static void rum_set_macaddr(struct rum_ static const char *rum_get_rf(int); static void rum_read_eeprom(struct rum_softc *); static int rum_bbp_init(struct rum_softc *); +static void rum_init_locked(struct rum_softc *); static void rum_init(void *); +static void rum_stop(void *); static int rum_load_microcode(struct rum_softc *, const u_char *, size_t); static int rum_prepare_beacon(struct rum_softc *, @@ -395,8 +391,12 @@ rum_attach(device_t self) { struct usb2_attach_arg *uaa = device_get_ivars(self); struct rum_softc *sc = device_get_softc(self); - uint8_t iface_index; - int error; + struct ieee80211com *ic; + struct ifnet *ifp; + const uint8_t *ucode = NULL; + uint8_t bands, iface_index; + uint32_t tmp; + int error, ntries, size; device_set_usb2_desc(self); sc->sc_udev = uaa->device; @@ -420,64 +420,42 @@ rum_attach(device_t self) goto detach; } - /* fork rest of the attach code */ - RUM_LOCK(sc); - rum_queue_command(sc, rum_attach_post, - &sc->sc_synctask[0].hdr, - &sc->sc_synctask[1].hdr); - RUM_UNLOCK(sc); - return (0); - -detach: - rum_detach(self); - return (ENXIO); /* failure */ -} - -static void -rum_attach_post(struct usb2_proc_msg *pm) -{ - struct rum_task *task = (struct rum_task *)pm; - struct rum_softc *sc = task->sc; - struct ifnet *ifp; - struct ieee80211com *ic; - unsigned int ntries; - int error; - uint32_t tmp; - uint8_t bands; + ifp = sc->sc_ifp = if_alloc(IFT_IEEE80211); + if (ifp == NULL) { + device_printf(sc->sc_dev, "can not if_alloc()\n"); + goto detach; + } + ic = ifp->if_l2com; + RUM_LOCK(sc); /* retrieve RT2573 rev. no */ - for (ntries = 0; ntries != 1000; ntries++) { + for (ntries = 0; ntries < 1000; ntries++) { if ((tmp = rum_read(sc, RT2573_MAC_CSR0)) != 0) break; - usb2_pause_mtx(&sc->sc_mtx, hz / 1000); + DELAY(1000); } if (ntries == 1000) { - device_printf(sc->sc_dev, "timeout waiting for chip to settle\n"); - return; + device_printf(self, "timeout waiting for chip to settle\n"); + RUM_UNLOCK(sc); + goto detach; } /* retrieve MAC address and various other things from EEPROM */ rum_read_eeprom(sc); - device_printf(sc->sc_dev, "MAC/BBP RT2573 (rev 0x%05x), RF %s\n", + device_printf(self, "MAC/BBP RT2573 (rev 0x%05x), RF %s\n", tmp, rum_get_rf(sc->rf_rev)); - error = rum_load_microcode(sc, rt2573_ucode, sizeof(rt2573_ucode)); + ucode = rt2573_ucode; + size = sizeof rt2573_ucode; + error = rum_load_microcode(sc, ucode, size); if (error != 0) { + device_printf(self, "could not load 8051 microcode\n"); RUM_UNLOCK(sc); - device_printf(sc->sc_dev, "could not load 8051 microcode\n"); - return; + goto detach; } RUM_UNLOCK(sc); - ifp = sc->sc_ifp = if_alloc(IFT_IEEE80211); - if (ifp == NULL) { - device_printf(sc->sc_dev, "can not if_alloc()\n"); - RUM_LOCK(sc); - return; - } - ic = ifp->if_l2com; - ifp->if_softc = sc; if_initname(ifp, "rum", device_get_unit(sc->sc_dev)); ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; @@ -490,7 +468,6 @@ rum_attach_post(struct usb2_proc_msg *pm ic->ic_ifp = ifp; ic->ic_phytype = IEEE80211_T_OFDM; /* not only, but not used */ - IEEE80211_ADDR_COPY(ic->ic_myaddr, sc->sc_bssid); /* set device capabilities */ ic->ic_caps = @@ -539,7 +516,10 @@ rum_attach_post(struct usb2_proc_msg *pm if (bootverbose) ieee80211_announce(ic); - RUM_LOCK(sc); + return 0; +detach: + rum_detach(self); + return (ENXIO); /* failure */ } static int @@ -549,24 +529,20 @@ rum_detach(device_t self) struct ifnet *ifp = sc->sc_ifp; struct ieee80211com *ic = ifp->if_l2com; - /* wait for any post attach or other command to complete */ - usb2_proc_drain(&sc->sc_tq); + RUM_LOCK(sc); + sc->sc_flags |= RUM_FLAG_DETACH; + rum_stop(sc); + RUM_UNLOCK(sc); - /* stop all USB transfers */ + /* stop all USB transfers first */ usb2_transfer_unsetup(sc->sc_xfer, RUM_N_TRANSFER); usb2_proc_free(&sc->sc_tq); - /* free TX list, if any */ - RUM_LOCK(sc); - rum_unsetup_tx_list(sc); - RUM_UNLOCK(sc); - if (ifp) { bpfdetach(ifp); ieee80211_ifdetach(ic); if_free(ifp); } - mtx_destroy(&sc->sc_mtx); return (0); @@ -614,8 +590,11 @@ static void rum_vap_delete(struct ieee80211vap *vap) { struct rum_vap *rvp = RUM_VAP(vap); + struct rum_softc *sc = rvp->sc; - usb2_callout_drain(&rvp->amrr_ch); + RUM_LOCK(sc); + usb2_callout_stop(&rvp->amrr_ch); + RUM_UNLOCK(sc); ieee80211_amrr_cleanup(&rvp->amrr); ieee80211_vap_detach(vap); free(rvp, M_80211_VAP); @@ -640,12 +619,17 @@ rum_tx_free(struct rum_tx_data *data, in sc->tx_nfree++; } -static void -rum_setup_tx_list(struct rum_softc *sc) +static int +rum_alloc_tx_list(struct rum_softc *sc) { struct rum_tx_data *data; int i; + sc->tx_data = malloc(sizeof(struct rum_tx_data) * RUM_TX_LIST_COUNT, + M_USB, M_NOWAIT|M_ZERO); + if (sc->tx_data == NULL) + return (ENOMEM); + sc->tx_nfree = 0; STAILQ_INIT(&sc->tx_q); STAILQ_INIT(&sc->tx_free); @@ -657,20 +641,18 @@ rum_setup_tx_list(struct rum_softc *sc) STAILQ_INSERT_TAIL(&sc->tx_free, data, next); sc->tx_nfree++; } + return 0; } static void -rum_unsetup_tx_list(struct rum_softc *sc) +rum_free_tx_list(struct rum_softc *sc) { struct rum_tx_data *data; int i; - /* make sure any subsequent use of the queues will fail */ - sc->tx_nfree = 0; - STAILQ_INIT(&sc->tx_q); - STAILQ_INIT(&sc->tx_free); + if (sc->tx_data == NULL) + return; - /* free up all node references and mbufs */ for (i = 0; i < RUM_TX_LIST_COUNT; i++) { data = &sc->tx_data[i]; @@ -683,6 +665,8 @@ rum_unsetup_tx_list(struct rum_softc *sc data->ni = NULL; } } + free(sc->tx_data, M_USB); + sc->tx_data = NULL; } static void @@ -699,6 +683,9 @@ rum_task(struct usb2_proc_msg *pm) struct ieee80211_node *ni; uint32_t tmp; + if (sc->sc_flags & RUM_FLAG_DETACH) + return; + ostate = vap->iv_state; switch (sc->sc_state) { @@ -718,8 +705,7 @@ rum_task(struct usb2_proc_msg *pm) rum_enable_mrr(sc); rum_set_txpreamble(sc); rum_set_basicrates(sc); - IEEE80211_ADDR_COPY(sc->sc_bssid, ni->ni_bssid); - rum_set_bssid(sc, sc->sc_bssid); + rum_set_bssid(sc, ni->ni_bssid); } if (vap->iv_opmode == IEEE80211_M_HOSTAP || @@ -787,7 +773,7 @@ rum_bulk_write_callback(struct usb2_xfer struct ieee80211_channel *c = ic->ic_curchan; struct rum_tx_data *data; struct mbuf *m; - unsigned int len; + int len; switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: @@ -804,6 +790,15 @@ rum_bulk_write_callback(struct usb2_xfer /* FALLTHROUGH */ case USB_ST_SETUP: tr_setup: +#if 0 + if (sc->sc_flags & RUM_FLAG_WAIT_COMMAND) { + /* + * don't send anything while a command is pending ! + */ + break; + } +#endif + data = STAILQ_FIRST(&sc->tx_q); if (data) { STAILQ_REMOVE_HEAD(&sc->tx_q, next); @@ -850,13 +845,6 @@ tr_setup: DPRINTFN(11, "transfer error, %s\n", usb2_errstr(xfer->error)); - ifp->if_oerrors++; - data = xfer->priv_fifo; - if (data != NULL) { - rum_tx_free(data, xfer->error); - xfer->priv_fifo = NULL; - } - if (xfer->error == USB_ERR_STALLED) { /* try to clear stall first */ xfer->flags.stall_pipe = 1; @@ -864,6 +852,13 @@ tr_setup: } if (xfer->error == USB_ERR_TIMEOUT) device_printf(sc->sc_dev, "device timeout\n"); + + ifp->if_oerrors++; + data = xfer->priv_fifo; + if (data != NULL) { + rum_tx_free(data, xfer->error); + xfer->priv_fifo = NULL; + } break; } } @@ -878,7 +873,7 @@ rum_bulk_read_callback(struct usb2_xfer struct mbuf *m = NULL; uint32_t flags; uint8_t rssi = 0; - unsigned int len; + int len; switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: @@ -970,6 +965,7 @@ tr_setup: goto tr_setup; } return; + } } @@ -1337,20 +1333,15 @@ rum_ioctl(struct ifnet *ifp, u_long cmd, RUM_LOCK(sc); if (ifp->if_flags & IFF_UP) { if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { - rum_queue_command(sc, rum_init_task, - &sc->sc_synctask[0].hdr, - &sc->sc_synctask[1].hdr); + rum_init_locked(sc); startall = 1; } else rum_queue_command(sc, rum_promisctask, &sc->sc_promisctask[0].hdr, &sc->sc_promisctask[1].hdr); } else { - if (ifp->if_drv_flags & IFF_DRV_RUNNING) { - rum_queue_command(sc, rum_stop_task, - &sc->sc_synctask[0].hdr, - &sc->sc_synctask[1].hdr); - } + if (ifp->if_drv_flags & IFF_DRV_RUNNING) + rum_stop(sc); } RUM_UNLOCK(sc); if (startall) @@ -1381,7 +1372,7 @@ rum_eeprom_read(struct rum_softc *sc, ui USETW(req.wIndex, addr); USETW(req.wLength, len); - error = rum_do_request(sc, &req, buf); + error = usb2_do_request(sc->sc_udev, &sc->sc_mtx, &req, buf); if (error != 0) { device_printf(sc->sc_dev, "could not read EEPROM: %s\n", usb2_errstr(error)); @@ -1410,7 +1401,7 @@ rum_read_multi(struct rum_softc *sc, uin USETW(req.wIndex, reg); USETW(req.wLength, len); - error = rum_do_request(sc, &req, buf); + error = usb2_do_request(sc->sc_udev, &sc->sc_mtx, &req, buf); if (error != 0) { device_printf(sc->sc_dev, "could not multi read MAC register: %s\n", @@ -1438,7 +1429,7 @@ rum_write_multi(struct rum_softc *sc, ui USETW(req.wIndex, reg); USETW(req.wLength, len); - error = rum_do_request(sc, &req, buf); + error = usb2_do_request(sc->sc_udev, &sc->sc_mtx, &req, buf); if (error != 0) { device_printf(sc->sc_dev, "could not multi write MAC register: %s\n", @@ -1796,6 +1787,9 @@ rum_promisctask(struct usb2_proc_msg *pm struct ifnet *ifp = sc->sc_ifp; uint32_t tmp; + if (sc->sc_flags & RUM_FLAG_DETACH) + return; + tmp = rum_read(sc, RT2573_TXRX_CSR0); tmp &= ~RT2573_DROP_NOT_TO_ME; @@ -1823,13 +1817,15 @@ rum_get_rf(int rev) static void rum_read_eeprom(struct rum_softc *sc) { + struct ifnet *ifp = sc->sc_ifp; + struct ieee80211com *ic = ifp->if_l2com; uint16_t val; #ifdef RUM_DEBUG int i; #endif /* read MAC address */ - rum_eeprom_read(sc, RT2573_EEPROM_ADDRESS, sc->sc_bssid, 6); + rum_eeprom_read(sc, RT2573_EEPROM_ADDRESS, ic->ic_myaddr, 6); rum_eeprom_read(sc, RT2573_EEPROM_ANTENNA, &val, 2); val = le16toh(val); @@ -1937,11 +1933,9 @@ rum_bbp_init(struct rum_softc *sc) } static void -rum_init_task(struct usb2_proc_msg *pm) +rum_init_locked(struct rum_softc *sc) { #define N(a) (sizeof (a) / sizeof ((a)[0])) - struct rum_task *task = (struct rum_task *)pm; - struct rum_softc *sc = task->sc; struct ifnet *ifp = sc->sc_ifp; struct ieee80211com *ic = ifp->if_l2com; uint32_t tmp; @@ -1950,7 +1944,10 @@ rum_init_task(struct usb2_proc_msg *pm) RUM_LOCK_ASSERT(sc, MA_OWNED); - rum_stop_task(pm); + if (sc->sc_flags & RUM_FLAG_DETACH) + return; + + rum_stop(sc); /* initialize MAC registers to default values */ for (i = 0; i < N(rum_def_mac); i++) @@ -1993,7 +1990,11 @@ rum_init_task(struct usb2_proc_msg *pm) /* * Allocate Tx and Rx xfer queues. */ - rum_setup_tx_list(sc); + error = rum_alloc_tx_list(sc); + if (error != 0) { + device_printf(sc->sc_dev, "could not allocate Tx list\n"); + goto fail; + } /* update Rx filter */ tmp = rum_read(sc, RT2573_TXRX_CSR0) & 0xffff; @@ -2014,7 +2015,7 @@ rum_init_task(struct usb2_proc_msg *pm) usb2_transfer_start(sc->sc_xfer[RUM_BULK_RD]); return; -fail: rum_stop_task(pm); +fail: rum_stop(sc); #undef N } @@ -2026,9 +2027,7 @@ rum_init(void *priv) struct ieee80211com *ic = ifp->if_l2com; RUM_LOCK(sc); - rum_queue_command(sc, rum_init_task, - &sc->sc_synctask[0].hdr, - &sc->sc_synctask[1].hdr); + rum_init_locked(sc); RUM_UNLOCK(sc); if (ifp->if_drv_flags & IFF_DRV_RUNNING) @@ -2036,10 +2035,9 @@ rum_init(void *priv) } static void -rum_stop_task(struct usb2_proc_msg *pm) +rum_stop(void *priv) { - struct rum_task *task = (struct rum_task *)pm; - struct rum_softc *sc = task->sc; + struct rum_softc *sc = priv; struct ifnet *ifp = sc->sc_ifp; uint32_t tmp; @@ -2047,17 +2045,17 @@ rum_stop_task(struct usb2_proc_msg *pm) ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); - RUM_UNLOCK(sc); - /* - * Drain the USB transfers, if not already drained: + * stop all the transfers, if not already stopped: */ - usb2_transfer_drain(sc->sc_xfer[RUM_BULK_WR]); - usb2_transfer_drain(sc->sc_xfer[RUM_BULK_RD]); + usb2_transfer_stop(sc->sc_xfer[RUM_BULK_WR]); + usb2_transfer_stop(sc->sc_xfer[RUM_BULK_RD]); - RUM_LOCK(sc); + rum_free_tx_list(sc); - rum_unsetup_tx_list(sc); + /* Stop now if the device has vanished */ + if (sc->sc_flags & RUM_FLAG_DETACH) + return; /* disable Rx */ tmp = rum_read(sc, RT2573_TXRX_CSR0); @@ -2085,7 +2083,7 @@ rum_load_microcode(struct rum_softc *sc, USETW(req.wIndex, 0); USETW(req.wLength, 0); - error = rum_do_request(sc, &req, NULL); + error = usb2_do_request(sc->sc_udev, &sc->sc_mtx, &req, NULL); if (error != 0) { device_printf(sc->sc_dev, "could not run firmware: %s\n", usb2_errstr(error)); @@ -2293,10 +2291,14 @@ rum_scantask(struct usb2_proc_msg *pm) struct rum_softc *sc = task->sc; struct ifnet *ifp = sc->sc_ifp; struct ieee80211com *ic = ifp->if_l2com; + struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); uint32_t tmp; RUM_LOCK_ASSERT(sc, MA_OWNED); + if (sc->sc_flags & RUM_FLAG_DETACH) + return; + switch (sc->sc_scan_action) { case RUM_SCAN_START: /* abort TSF synchronization */ @@ -2305,13 +2307,19 @@ rum_scantask(struct usb2_proc_msg *pm) rum_set_bssid(sc, ifp->if_broadcastaddr); break; + case RUM_SCAN_END: + rum_enable_tsf_sync(sc); + /* XXX keep local copy */ + rum_set_bssid(sc, vap->iv_bss->ni_bssid); + break; + case RUM_SET_CHANNEL: rum_set_chan(sc, ic->ic_curchan); break; - default: /* RUM_SCAN_END */ - rum_enable_tsf_sync(sc); - rum_set_bssid(sc, sc->sc_bssid); + default: + panic("unknown scan action %d\n", sc->sc_scan_action); + /* NEVER REACHED */ break; } } @@ -2387,11 +2395,6 @@ rum_queue_command(struct rum_softc *sc, task->hdr.pm_callback = fn; task->sc = sc; - /* - * Init and stop must be synchronous! - */ - if ((fn == rum_init_task) || (fn == rum_stop_task)) - usb2_proc_mwait(&sc->sc_tq, t0, t1); } static device_method_t rum_methods[] = { Modified: head/sys/dev/usb2/wlan/if_rumvar.h ============================================================================== --- head/sys/dev/usb2/wlan/if_rumvar.h Mon Feb 9 22:12:47 2009 (r188417) +++ head/sys/dev/usb2/wlan/if_rumvar.h Mon Feb 9 22:14:38 2009 (r188418) @@ -100,14 +100,14 @@ struct rum_softc { struct usb2_process sc_tq; const struct ieee80211_rate_table *sc_rates; - struct usb2_xfer *sc_xfer[RUM_N_TRANSFER]; uint8_t rf_rev; uint8_t rffreq; + struct usb2_xfer *sc_xfer[RUM_N_TRANSFER]; + enum ieee80211_state sc_state; int sc_arg; - struct rum_task sc_synctask[2]; struct rum_task sc_task[2]; struct rum_task sc_promisctask[2]; struct rum_task sc_scantask[2]; @@ -116,7 +116,7 @@ struct rum_softc { #define RUM_SCAN_END 1 #define RUM_SET_CHANNEL 2 - struct rum_tx_data tx_data[RUM_TX_LIST_COUNT]; + struct rum_tx_data *tx_data; rum_txdhead tx_q; rum_txdhead tx_free; int tx_nfree; @@ -124,10 +124,12 @@ struct rum_softc { struct mtx sc_mtx; + int sc_flags; +#define RUM_FLAG_DETACH 0x0001 + uint32_t sta[6]; uint32_t rf_regs[4]; uint8_t txpow[44]; - uint8_t sc_bssid[6]; struct { uint8_t val; Modified: head/sys/dev/usb2/wlan/if_ural2.c ============================================================================== --- head/sys/dev/usb2/wlan/if_ural2.c Mon Feb 9 22:12:47 2009 (r188417) +++ head/sys/dev/usb2/wlan/if_ural2.c Mon Feb 9 22:14:38 2009 (r188418) @@ -55,9 +55,6 @@ SYSCTL_INT(_hw_usb2_ural, OID_AUTO, debu "Debug level"); #endif -#define ural_do_request(sc,req,data) \ - usb2_do_request_proc((sc)->sc_udev, &(sc)->sc_tq, req, data, 0, NULL, 5000) - #define URAL_RSSI(rssi) \ ((rssi) > (RAL_NOISE_FLOOR + RAL_RSSI_CORR) ? \ ((rssi) - (RAL_NOISE_FLOOR + RAL_RSSI_CORR)) : 0) @@ -98,13 +95,10 @@ static const struct usb2_device_id ural_ static usb2_callback_t ural_bulk_read_callback; static usb2_callback_t ural_bulk_write_callback; -static usb2_proc_callback_t ural_attach_post; static usb2_proc_callback_t ural_task; static usb2_proc_callback_t ural_scantask; static usb2_proc_callback_t ural_promisctask; static usb2_proc_callback_t ural_amrr_task; -static usb2_proc_callback_t ural_init_task; -static usb2_proc_callback_t ural_stop_task; static struct ieee80211vap *ural_vap_create(struct ieee80211com *, const char name[IFNAMSIZ], int unit, int opmode, @@ -112,8 +106,8 @@ static struct ieee80211vap *ural_vap_cre const uint8_t mac[IEEE80211_ADDR_LEN]); static void ural_vap_delete(struct ieee80211vap *); static void ural_tx_free(struct ural_tx_data *, int); -static void ural_setup_tx_list(struct ural_softc *); -static void ural_unsetup_tx_list(struct ural_softc *); +static int ural_alloc_tx_list(struct ural_softc *); +static void ural_free_tx_list(struct ural_softc *); static int ural_newstate(struct ieee80211vap *, enum ieee80211_state, int); static void ural_setup_tx_desc(struct ural_softc *, @@ -159,7 +153,9 @@ static void ural_read_eeprom(struct ura static int ural_bbp_init(struct ural_softc *); static void ural_set_txantenna(struct ural_softc *, int); static void ural_set_rxantenna(struct ural_softc *, int); +static void ural_init_locked(struct ural_softc *); static void ural_init(void *); +static void ural_stop(void *); static int ural_raw_xmit(struct ieee80211_node *, struct mbuf *, const struct ieee80211_bpf_params *); static void ural_amrr_start(struct ural_softc *, @@ -398,8 +394,10 @@ ural_attach(device_t self) { struct usb2_attach_arg *uaa = device_get_ivars(self); struct ural_softc *sc = device_get_softc(self); + struct ifnet *ifp; + struct ieee80211com *ic; int error; - uint8_t iface_index; + uint8_t bands, iface_index; device_set_usb2_desc(self); sc->sc_udev = uaa->device; @@ -424,28 +422,14 @@ ural_attach(device_t self) goto detach; } - /* fork rest of the attach code */ - RAL_LOCK(sc); - ural_queue_command(sc, ural_attach_post, - &sc->sc_synctask[0].hdr, - &sc->sc_synctask[1].hdr); - RAL_UNLOCK(sc); - return (0); - -detach: - ural_detach(self); - return (ENXIO); /* failure */ -} - -static void -ural_attach_post(struct usb2_proc_msg *pm) -{ - struct ural_task *task = (struct ural_task *)pm; - struct ural_softc *sc = task->sc; - struct ifnet *ifp; - struct ieee80211com *ic; - uint8_t bands; + ifp = sc->sc_ifp = if_alloc(IFT_IEEE80211); + if (ifp == NULL) { + device_printf(sc->sc_dev, "can not if_alloc()\n"); + goto detach; + } + ic = ifp->if_l2com; + RAL_LOCK(sc); /* retrieve RT2570 rev. no */ sc->asic_rev = ural_read(sc, RAL_MAC_CSR0); @@ -456,14 +440,6 @@ ural_attach_post(struct usb2_proc_msg *p device_printf(sc->sc_dev, "MAC/BBP RT2570 (rev 0x%02x), RF %s\n", sc->asic_rev, ural_get_rf(sc->rf_rev)); - ifp = sc->sc_ifp = if_alloc(IFT_IEEE80211); - if (ifp == NULL) { - device_printf(sc->sc_dev, "can not if_alloc()\n"); - RAL_LOCK(sc); - return; - } - ic = ifp->if_l2com; - ifp->if_softc = sc; if_initname(ifp, "ural", device_get_unit(sc->sc_dev)); ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; @@ -476,7 +452,6 @@ ural_attach_post(struct usb2_proc_msg *p ic->ic_ifp = ifp; ic->ic_phytype = IEEE80211_T_OFDM; /* not only, but not used */ - IEEE80211_ADDR_COPY(ic->ic_myaddr, sc->sc_bssid); /* set device capabilities */ ic->ic_caps = @@ -525,7 +500,11 @@ ural_attach_post(struct usb2_proc_msg *p if (bootverbose) ieee80211_announce(ic); - RAL_LOCK(sc); + return (0); /* success */ + +detach: + ural_detach(self); + return (ENXIO); /* failure */ } static int @@ -535,24 +514,20 @@ ural_detach(device_t self) struct ifnet *ifp = sc->sc_ifp; struct ieee80211com *ic = ifp->if_l2com; - /* wait for any post attach or other command to complete */ - usb2_proc_drain(&sc->sc_tq); + RAL_LOCK(sc); + sc->sc_flags |= URAL_FLAG_DETACH; + ural_stop(sc); + RAL_UNLOCK(sc); - /* stop all USB transfers */ + /* stop all USB transfers first */ usb2_transfer_unsetup(sc->sc_xfer, URAL_N_TRANSFER); usb2_proc_free(&sc->sc_tq); - /* free TX list, if any */ - RAL_LOCK(sc); - ural_unsetup_tx_list(sc); - RAL_UNLOCK(sc); - if (ifp) { bpfdetach(ifp); ieee80211_ifdetach(ic); if_free(ifp); } - mtx_destroy(&sc->sc_mtx); return (0); @@ -600,8 +575,11 @@ static void ural_vap_delete(struct ieee80211vap *vap) { struct ural_vap *uvp = URAL_VAP(vap); + struct ural_softc *sc = uvp->sc; - usb2_callout_drain(&uvp->amrr_ch); + RAL_LOCK(sc); + usb2_callout_stop(&uvp->amrr_ch); + RAL_UNLOCK(sc); ieee80211_amrr_cleanup(&uvp->amrr); ieee80211_vap_detach(vap); free(uvp, M_80211_VAP); @@ -626,12 +604,17 @@ ural_tx_free(struct ural_tx_data *data, sc->tx_nfree++; } -static void -ural_setup_tx_list(struct ural_softc *sc) +static int +ural_alloc_tx_list(struct ural_softc *sc) { struct ural_tx_data *data; int i; + sc->tx_data = malloc(sizeof(struct ural_tx_data) * RAL_TX_LIST_COUNT, + M_USB, M_NOWAIT|M_ZERO); + if (sc->tx_data == NULL) + return (ENOMEM); + sc->tx_nfree = 0; STAILQ_INIT(&sc->tx_q); STAILQ_INIT(&sc->tx_free); @@ -643,20 +626,18 @@ ural_setup_tx_list(struct ural_softc *sc STAILQ_INSERT_TAIL(&sc->tx_free, data, next); sc->tx_nfree++; } + return 0; } static void -ural_unsetup_tx_list(struct ural_softc *sc) +ural_free_tx_list(struct ural_softc *sc) { struct ural_tx_data *data; int i; - /* make sure any subsequent use of the queues will fail */ - sc->tx_nfree = 0; - STAILQ_INIT(&sc->tx_q); - STAILQ_INIT(&sc->tx_free); + if (sc->tx_data == NULL) + return; - /* free up all node references and mbufs */ for (i = 0; i < RAL_TX_LIST_COUNT; i++) { data = &sc->tx_data[i]; @@ -669,6 +650,8 @@ ural_unsetup_tx_list(struct ural_softc * data->ni = NULL; } } + free(sc->tx_data, M_USB); + sc->tx_data = NULL; } static void @@ -685,6 +668,9 @@ ural_task(struct usb2_proc_msg *pm) struct ieee80211_node *ni; struct mbuf *m; + if (sc->sc_flags & URAL_FLAG_DETACH) + return; + ostate = vap->iv_state; switch (sc->sc_state) { @@ -705,8 +691,7 @@ ural_task(struct usb2_proc_msg *pm) ural_update_slot(ic->ic_ifp); ural_set_txpreamble(sc); ural_set_basicrates(sc, ic->ic_bsschan); - IEEE80211_ADDR_COPY(sc->sc_bssid, ni->ni_bssid); - ural_set_bssid(sc, sc->sc_bssid); + ural_set_bssid(sc, ni->ni_bssid); } if (vap->iv_opmode == IEEE80211_M_HOSTAP || @@ -758,27 +743,26 @@ ural_scantask(struct usb2_proc_msg *pm) struct ural_softc *sc = task->sc; struct ifnet *ifp = sc->sc_ifp; struct ieee80211com *ic = ifp->if_l2com; + struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); RAL_LOCK_ASSERT(sc, MA_OWNED); - switch (sc->sc_scan_action) { - case URAL_SCAN_START: + if (sc->sc_flags & URAL_FLAG_DETACH) + return; + + if (sc->sc_scan_action == URAL_SCAN_START) { /* abort TSF synchronization */ DPRINTF("starting scan\n"); ural_write(sc, RAL_TXRX_CSR19, 0); ural_set_bssid(sc, ifp->if_broadcastaddr); - break; - - case URAL_SET_CHANNEL: + } else if (sc->sc_scan_action == URAL_SET_CHANNEL) { ural_set_chan(sc, ic->ic_curchan); - break; - - default: /* URAL_SCAN_END */ + } else { DPRINTF("stopping scan\n"); ural_enable_tsf_sync(sc); - ural_set_bssid(sc, sc->sc_bssid); - break; - } + /* XXX keep local copy */ + ural_set_bssid(sc, vap->iv_bss->ni_bssid); + } } static int @@ -822,7 +806,7 @@ ural_bulk_write_callback(struct usb2_xfe struct ieee80211_channel *c = ic->ic_curchan; struct ural_tx_data *data; struct mbuf *m; - unsigned int len; + int len; switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: @@ -839,6 +823,15 @@ ural_bulk_write_callback(struct usb2_xfe /* FALLTHROUGH */ case USB_ST_SETUP: tr_setup: +#if 0 + if (sc->sc_flags & URAL_FLAG_WAIT_COMMAND) { + /* + * don't send anything while a command is pending ! + */ + break; + } +#endif + data = STAILQ_FIRST(&sc->tx_q); if (data) { STAILQ_REMOVE_HEAD(&sc->tx_q, next); @@ -885,13 +878,6 @@ tr_setup: DPRINTFN(11, "transfer error, %s\n", usb2_errstr(xfer->error)); - ifp->if_oerrors++; - data = xfer->priv_fifo; - if (data != NULL) { - ural_tx_free(data, xfer->error); - xfer->priv_fifo = NULL; - } - if (xfer->error == USB_ERR_STALLED) { /* try to clear stall first */ xfer->flags.stall_pipe = 1; @@ -899,6 +885,13 @@ tr_setup: } if (xfer->error == USB_ERR_TIMEOUT) device_printf(sc->sc_dev, "device timeout\n"); + + ifp->if_oerrors++; + data = xfer->priv_fifo; + if (data != NULL) { + ural_tx_free(data, xfer->error); + xfer->priv_fifo = NULL; + } break; } } @@ -913,7 +906,7 @@ ural_bulk_read_callback(struct usb2_xfer struct mbuf *m = NULL; uint32_t flags; uint8_t rssi = 0; - unsigned int len; + int len; switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: @@ -1008,6 +1001,7 @@ tr_setup: goto tr_setup; } return; + } } @@ -1412,20 +1406,15 @@ ural_ioctl(struct ifnet *ifp, u_long cmd RAL_LOCK(sc); if (ifp->if_flags & IFF_UP) { if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { - ural_queue_command(sc, ural_init_task, - &sc->sc_synctask[0].hdr, - &sc->sc_synctask[1].hdr); + ural_init_locked(sc); startall = 1; } else ural_queue_command(sc, ural_promisctask, &sc->sc_promisctask[0].hdr, &sc->sc_promisctask[1].hdr); } else { - if (ifp->if_drv_flags & IFF_DRV_RUNNING) { - ural_queue_command(sc, ural_stop_task, - &sc->sc_synctask[0].hdr, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 22:18:11 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 90A3F106566C; Mon, 9 Feb 2009 22:18: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 7D30C8FC13; Mon, 9 Feb 2009 22:18:11 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n19MIBe7073135; Mon, 9 Feb 2009 22:18:11 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n19MIBbL073131; Mon, 9 Feb 2009 22:18:11 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200902092218.n19MIBbL073131@svn.freebsd.org> From: Andrew Thompson Date: Mon, 9 Feb 2009 22:18:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188419 - head/sys/dev/usb2/wlan X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Feb 2009 22:18:12 -0000 Author: thompsa Date: Mon Feb 9 22:18:11 2009 New Revision: 188419 URL: http://svn.freebsd.org/changeset/base/188419 Log: MFp4 //depot/projects/usb; 157429, 157433, 157443 Various changes wrt. usb procs and tasks. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb2/wlan/if_rum2.c head/sys/dev/usb2/wlan/if_rumvar.h head/sys/dev/usb2/wlan/if_ural2.c head/sys/dev/usb2/wlan/if_uralvar.h head/sys/dev/usb2/wlan/if_zyd2.c head/sys/dev/usb2/wlan/if_zydreg.h Modified: head/sys/dev/usb2/wlan/if_rum2.c ============================================================================== --- head/sys/dev/usb2/wlan/if_rum2.c Mon Feb 9 22:14:38 2009 (r188418) +++ head/sys/dev/usb2/wlan/if_rum2.c Mon Feb 9 22:18:11 2009 (r188419) @@ -54,6 +54,9 @@ SYSCTL_INT(_hw_usb2_rum, OID_AUTO, debug "Debug level"); #endif +#define rum_do_request(sc,req,data) \ + usb2_do_request_proc((sc)->sc_udev, &(sc)->sc_tq, req, data, 0, NULL, 5000) + static const struct usb2_device_id rum_devs[] = { { USB_VP(USB_VENDOR_ABOCOM, USB_PRODUCT_ABOCOM_HWU54DM) }, { USB_VP(USB_VENDOR_ABOCOM, USB_PRODUCT_ABOCOM_RT2573_2) }, @@ -116,10 +119,13 @@ static device_detach_t rum_detach; static usb2_callback_t rum_bulk_read_callback; static usb2_callback_t rum_bulk_write_callback; +static usb2_proc_callback_t rum_attach_post; static usb2_proc_callback_t rum_task; static usb2_proc_callback_t rum_scantask; static usb2_proc_callback_t rum_promisctask; static usb2_proc_callback_t rum_amrr_task; +static usb2_proc_callback_t rum_init_task; +static usb2_proc_callback_t rum_stop_task; static struct ieee80211vap *rum_vap_create(struct ieee80211com *, const char name[IFNAMSIZ], int unit, int opmode, @@ -127,8 +133,8 @@ static struct ieee80211vap *rum_vap_crea const uint8_t mac[IEEE80211_ADDR_LEN]); static void rum_vap_delete(struct ieee80211vap *); static void rum_tx_free(struct rum_tx_data *, int); -static int rum_alloc_tx_list(struct rum_softc *); -static void rum_free_tx_list(struct rum_softc *); +static void rum_setup_tx_list(struct rum_softc *); +static void rum_unsetup_tx_list(struct rum_softc *); static int rum_newstate(struct ieee80211vap *, enum ieee80211_state, int); static void rum_setup_tx_desc(struct rum_softc *, @@ -169,9 +175,7 @@ static void rum_set_macaddr(struct rum_ static const char *rum_get_rf(int); static void rum_read_eeprom(struct rum_softc *); static int rum_bbp_init(struct rum_softc *); -static void rum_init_locked(struct rum_softc *); static void rum_init(void *); -static void rum_stop(void *); static int rum_load_microcode(struct rum_softc *, const u_char *, size_t); static int rum_prepare_beacon(struct rum_softc *, @@ -391,12 +395,8 @@ rum_attach(device_t self) { struct usb2_attach_arg *uaa = device_get_ivars(self); struct rum_softc *sc = device_get_softc(self); - struct ieee80211com *ic; - struct ifnet *ifp; - const uint8_t *ucode = NULL; - uint8_t bands, iface_index; - uint32_t tmp; - int error, ntries, size; + uint8_t iface_index; + int error; device_set_usb2_desc(self); sc->sc_udev = uaa->device; @@ -420,42 +420,64 @@ rum_attach(device_t self) goto detach; } - ifp = sc->sc_ifp = if_alloc(IFT_IEEE80211); - if (ifp == NULL) { - device_printf(sc->sc_dev, "can not if_alloc()\n"); - goto detach; - } - ic = ifp->if_l2com; - + /* fork rest of the attach code */ RUM_LOCK(sc); + rum_queue_command(sc, rum_attach_post, + &sc->sc_synctask[0].hdr, + &sc->sc_synctask[1].hdr); + RUM_UNLOCK(sc); + return (0); + +detach: + rum_detach(self); + return (ENXIO); /* failure */ +} + +static void +rum_attach_post(struct usb2_proc_msg *pm) +{ + struct rum_task *task = (struct rum_task *)pm; + struct rum_softc *sc = task->sc; + struct ifnet *ifp; + struct ieee80211com *ic; + unsigned int ntries; + int error; + uint32_t tmp; + uint8_t bands; + /* retrieve RT2573 rev. no */ - for (ntries = 0; ntries < 1000; ntries++) { + for (ntries = 0; ntries != 1000; ntries++) { if ((tmp = rum_read(sc, RT2573_MAC_CSR0)) != 0) break; - DELAY(1000); + usb2_pause_mtx(&sc->sc_mtx, hz / 1000); } if (ntries == 1000) { - device_printf(self, "timeout waiting for chip to settle\n"); - RUM_UNLOCK(sc); - goto detach; + device_printf(sc->sc_dev, "timeout waiting for chip to settle\n"); + return; } /* retrieve MAC address and various other things from EEPROM */ rum_read_eeprom(sc); - device_printf(self, "MAC/BBP RT2573 (rev 0x%05x), RF %s\n", + device_printf(sc->sc_dev, "MAC/BBP RT2573 (rev 0x%05x), RF %s\n", tmp, rum_get_rf(sc->rf_rev)); - ucode = rt2573_ucode; - size = sizeof rt2573_ucode; - error = rum_load_microcode(sc, ucode, size); + error = rum_load_microcode(sc, rt2573_ucode, sizeof(rt2573_ucode)); if (error != 0) { - device_printf(self, "could not load 8051 microcode\n"); RUM_UNLOCK(sc); - goto detach; + device_printf(sc->sc_dev, "could not load 8051 microcode\n"); + return; } RUM_UNLOCK(sc); + ifp = sc->sc_ifp = if_alloc(IFT_IEEE80211); + if (ifp == NULL) { + device_printf(sc->sc_dev, "can not if_alloc()\n"); + RUM_LOCK(sc); + return; + } + ic = ifp->if_l2com; + ifp->if_softc = sc; if_initname(ifp, "rum", device_get_unit(sc->sc_dev)); ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; @@ -468,6 +490,7 @@ rum_attach(device_t self) ic->ic_ifp = ifp; ic->ic_phytype = IEEE80211_T_OFDM; /* not only, but not used */ + IEEE80211_ADDR_COPY(ic->ic_myaddr, sc->sc_bssid); /* set device capabilities */ ic->ic_caps = @@ -516,10 +539,7 @@ rum_attach(device_t self) if (bootverbose) ieee80211_announce(ic); - return 0; -detach: - rum_detach(self); - return (ENXIO); /* failure */ + RUM_LOCK(sc); } static int @@ -529,20 +549,24 @@ rum_detach(device_t self) struct ifnet *ifp = sc->sc_ifp; struct ieee80211com *ic = ifp->if_l2com; - RUM_LOCK(sc); - sc->sc_flags |= RUM_FLAG_DETACH; - rum_stop(sc); - RUM_UNLOCK(sc); + /* wait for any post attach or other command to complete */ + usb2_proc_drain(&sc->sc_tq); - /* stop all USB transfers first */ + /* stop all USB transfers */ usb2_transfer_unsetup(sc->sc_xfer, RUM_N_TRANSFER); usb2_proc_free(&sc->sc_tq); + /* free TX list, if any */ + RUM_LOCK(sc); + rum_unsetup_tx_list(sc); + RUM_UNLOCK(sc); + if (ifp) { bpfdetach(ifp); ieee80211_ifdetach(ic); if_free(ifp); } + mtx_destroy(&sc->sc_mtx); return (0); @@ -590,11 +614,8 @@ static void rum_vap_delete(struct ieee80211vap *vap) { struct rum_vap *rvp = RUM_VAP(vap); - struct rum_softc *sc = rvp->sc; - RUM_LOCK(sc); - usb2_callout_stop(&rvp->amrr_ch); - RUM_UNLOCK(sc); + usb2_callout_drain(&rvp->amrr_ch); ieee80211_amrr_cleanup(&rvp->amrr); ieee80211_vap_detach(vap); free(rvp, M_80211_VAP); @@ -619,17 +640,12 @@ rum_tx_free(struct rum_tx_data *data, in sc->tx_nfree++; } -static int -rum_alloc_tx_list(struct rum_softc *sc) +static void +rum_setup_tx_list(struct rum_softc *sc) { struct rum_tx_data *data; int i; - sc->tx_data = malloc(sizeof(struct rum_tx_data) * RUM_TX_LIST_COUNT, - M_USB, M_NOWAIT|M_ZERO); - if (sc->tx_data == NULL) - return (ENOMEM); - sc->tx_nfree = 0; STAILQ_INIT(&sc->tx_q); STAILQ_INIT(&sc->tx_free); @@ -641,18 +657,20 @@ rum_alloc_tx_list(struct rum_softc *sc) STAILQ_INSERT_TAIL(&sc->tx_free, data, next); sc->tx_nfree++; } - return 0; } static void -rum_free_tx_list(struct rum_softc *sc) +rum_unsetup_tx_list(struct rum_softc *sc) { struct rum_tx_data *data; int i; - if (sc->tx_data == NULL) - return; + /* make sure any subsequent use of the queues will fail */ + sc->tx_nfree = 0; + STAILQ_INIT(&sc->tx_q); + STAILQ_INIT(&sc->tx_free); + /* free up all node references and mbufs */ for (i = 0; i < RUM_TX_LIST_COUNT; i++) { data = &sc->tx_data[i]; @@ -665,8 +683,6 @@ rum_free_tx_list(struct rum_softc *sc) data->ni = NULL; } } - free(sc->tx_data, M_USB); - sc->tx_data = NULL; } static void @@ -683,9 +699,6 @@ rum_task(struct usb2_proc_msg *pm) struct ieee80211_node *ni; uint32_t tmp; - if (sc->sc_flags & RUM_FLAG_DETACH) - return; - ostate = vap->iv_state; switch (sc->sc_state) { @@ -705,7 +718,8 @@ rum_task(struct usb2_proc_msg *pm) rum_enable_mrr(sc); rum_set_txpreamble(sc); rum_set_basicrates(sc); - rum_set_bssid(sc, ni->ni_bssid); + IEEE80211_ADDR_COPY(sc->sc_bssid, ni->ni_bssid); + rum_set_bssid(sc, sc->sc_bssid); } if (vap->iv_opmode == IEEE80211_M_HOSTAP || @@ -773,7 +787,7 @@ rum_bulk_write_callback(struct usb2_xfer struct ieee80211_channel *c = ic->ic_curchan; struct rum_tx_data *data; struct mbuf *m; - int len; + unsigned int len; switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: @@ -790,15 +804,6 @@ rum_bulk_write_callback(struct usb2_xfer /* FALLTHROUGH */ case USB_ST_SETUP: tr_setup: -#if 0 - if (sc->sc_flags & RUM_FLAG_WAIT_COMMAND) { - /* - * don't send anything while a command is pending ! - */ - break; - } -#endif - data = STAILQ_FIRST(&sc->tx_q); if (data) { STAILQ_REMOVE_HEAD(&sc->tx_q, next); @@ -845,6 +850,13 @@ tr_setup: DPRINTFN(11, "transfer error, %s\n", usb2_errstr(xfer->error)); + ifp->if_oerrors++; + data = xfer->priv_fifo; + if (data != NULL) { + rum_tx_free(data, xfer->error); + xfer->priv_fifo = NULL; + } + if (xfer->error == USB_ERR_STALLED) { /* try to clear stall first */ xfer->flags.stall_pipe = 1; @@ -852,13 +864,6 @@ tr_setup: } if (xfer->error == USB_ERR_TIMEOUT) device_printf(sc->sc_dev, "device timeout\n"); - - ifp->if_oerrors++; - data = xfer->priv_fifo; - if (data != NULL) { - rum_tx_free(data, xfer->error); - xfer->priv_fifo = NULL; - } break; } } @@ -873,7 +878,7 @@ rum_bulk_read_callback(struct usb2_xfer struct mbuf *m = NULL; uint32_t flags; uint8_t rssi = 0; - int len; + unsigned int len; switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: @@ -965,7 +970,6 @@ tr_setup: goto tr_setup; } return; - } } @@ -1333,15 +1337,20 @@ rum_ioctl(struct ifnet *ifp, u_long cmd, RUM_LOCK(sc); if (ifp->if_flags & IFF_UP) { if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { - rum_init_locked(sc); + rum_queue_command(sc, rum_init_task, + &sc->sc_synctask[0].hdr, + &sc->sc_synctask[1].hdr); startall = 1; } else rum_queue_command(sc, rum_promisctask, &sc->sc_promisctask[0].hdr, &sc->sc_promisctask[1].hdr); } else { - if (ifp->if_drv_flags & IFF_DRV_RUNNING) - rum_stop(sc); + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { + rum_queue_command(sc, rum_stop_task, + &sc->sc_synctask[0].hdr, + &sc->sc_synctask[1].hdr); + } } RUM_UNLOCK(sc); if (startall) @@ -1372,7 +1381,7 @@ rum_eeprom_read(struct rum_softc *sc, ui USETW(req.wIndex, addr); USETW(req.wLength, len); - error = usb2_do_request(sc->sc_udev, &sc->sc_mtx, &req, buf); + error = rum_do_request(sc, &req, buf); if (error != 0) { device_printf(sc->sc_dev, "could not read EEPROM: %s\n", usb2_errstr(error)); @@ -1401,7 +1410,7 @@ rum_read_multi(struct rum_softc *sc, uin USETW(req.wIndex, reg); USETW(req.wLength, len); - error = usb2_do_request(sc->sc_udev, &sc->sc_mtx, &req, buf); + error = rum_do_request(sc, &req, buf); if (error != 0) { device_printf(sc->sc_dev, "could not multi read MAC register: %s\n", @@ -1429,7 +1438,7 @@ rum_write_multi(struct rum_softc *sc, ui USETW(req.wIndex, reg); USETW(req.wLength, len); - error = usb2_do_request(sc->sc_udev, &sc->sc_mtx, &req, buf); + error = rum_do_request(sc, &req, buf); if (error != 0) { device_printf(sc->sc_dev, "could not multi write MAC register: %s\n", @@ -1787,9 +1796,6 @@ rum_promisctask(struct usb2_proc_msg *pm struct ifnet *ifp = sc->sc_ifp; uint32_t tmp; - if (sc->sc_flags & RUM_FLAG_DETACH) - return; - tmp = rum_read(sc, RT2573_TXRX_CSR0); tmp &= ~RT2573_DROP_NOT_TO_ME; @@ -1817,15 +1823,13 @@ rum_get_rf(int rev) static void rum_read_eeprom(struct rum_softc *sc) { - struct ifnet *ifp = sc->sc_ifp; - struct ieee80211com *ic = ifp->if_l2com; uint16_t val; #ifdef RUM_DEBUG int i; #endif /* read MAC address */ - rum_eeprom_read(sc, RT2573_EEPROM_ADDRESS, ic->ic_myaddr, 6); + rum_eeprom_read(sc, RT2573_EEPROM_ADDRESS, sc->sc_bssid, 6); rum_eeprom_read(sc, RT2573_EEPROM_ANTENNA, &val, 2); val = le16toh(val); @@ -1933,9 +1937,11 @@ rum_bbp_init(struct rum_softc *sc) } static void -rum_init_locked(struct rum_softc *sc) +rum_init_task(struct usb2_proc_msg *pm) { #define N(a) (sizeof (a) / sizeof ((a)[0])) + struct rum_task *task = (struct rum_task *)pm; + struct rum_softc *sc = task->sc; struct ifnet *ifp = sc->sc_ifp; struct ieee80211com *ic = ifp->if_l2com; uint32_t tmp; @@ -1944,10 +1950,7 @@ rum_init_locked(struct rum_softc *sc) RUM_LOCK_ASSERT(sc, MA_OWNED); - if (sc->sc_flags & RUM_FLAG_DETACH) - return; - - rum_stop(sc); + rum_stop_task(pm); /* initialize MAC registers to default values */ for (i = 0; i < N(rum_def_mac); i++) @@ -1990,11 +1993,7 @@ rum_init_locked(struct rum_softc *sc) /* * Allocate Tx and Rx xfer queues. */ - error = rum_alloc_tx_list(sc); - if (error != 0) { - device_printf(sc->sc_dev, "could not allocate Tx list\n"); - goto fail; - } + rum_setup_tx_list(sc); /* update Rx filter */ tmp = rum_read(sc, RT2573_TXRX_CSR0) & 0xffff; @@ -2015,7 +2014,7 @@ rum_init_locked(struct rum_softc *sc) usb2_transfer_start(sc->sc_xfer[RUM_BULK_RD]); return; -fail: rum_stop(sc); +fail: rum_stop_task(pm); #undef N } @@ -2027,7 +2026,9 @@ rum_init(void *priv) struct ieee80211com *ic = ifp->if_l2com; RUM_LOCK(sc); - rum_init_locked(sc); + rum_queue_command(sc, rum_init_task, + &sc->sc_synctask[0].hdr, + &sc->sc_synctask[1].hdr); RUM_UNLOCK(sc); if (ifp->if_drv_flags & IFF_DRV_RUNNING) @@ -2035,9 +2036,10 @@ rum_init(void *priv) } static void -rum_stop(void *priv) +rum_stop_task(struct usb2_proc_msg *pm) { - struct rum_softc *sc = priv; + struct rum_task *task = (struct rum_task *)pm; + struct rum_softc *sc = task->sc; struct ifnet *ifp = sc->sc_ifp; uint32_t tmp; @@ -2045,17 +2047,17 @@ rum_stop(void *priv) ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); + RUM_UNLOCK(sc); + /* - * stop all the transfers, if not already stopped: + * Drain the USB transfers, if not already drained: */ - usb2_transfer_stop(sc->sc_xfer[RUM_BULK_WR]); - usb2_transfer_stop(sc->sc_xfer[RUM_BULK_RD]); + usb2_transfer_drain(sc->sc_xfer[RUM_BULK_WR]); + usb2_transfer_drain(sc->sc_xfer[RUM_BULK_RD]); - rum_free_tx_list(sc); + RUM_LOCK(sc); - /* Stop now if the device has vanished */ - if (sc->sc_flags & RUM_FLAG_DETACH) - return; + rum_unsetup_tx_list(sc); /* disable Rx */ tmp = rum_read(sc, RT2573_TXRX_CSR0); @@ -2083,7 +2085,7 @@ rum_load_microcode(struct rum_softc *sc, USETW(req.wIndex, 0); USETW(req.wLength, 0); - error = usb2_do_request(sc->sc_udev, &sc->sc_mtx, &req, NULL); + error = rum_do_request(sc, &req, NULL); if (error != 0) { device_printf(sc->sc_dev, "could not run firmware: %s\n", usb2_errstr(error)); @@ -2291,14 +2293,10 @@ rum_scantask(struct usb2_proc_msg *pm) struct rum_softc *sc = task->sc; struct ifnet *ifp = sc->sc_ifp; struct ieee80211com *ic = ifp->if_l2com; - struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); uint32_t tmp; RUM_LOCK_ASSERT(sc, MA_OWNED); - if (sc->sc_flags & RUM_FLAG_DETACH) - return; - switch (sc->sc_scan_action) { case RUM_SCAN_START: /* abort TSF synchronization */ @@ -2307,19 +2305,13 @@ rum_scantask(struct usb2_proc_msg *pm) rum_set_bssid(sc, ifp->if_broadcastaddr); break; - case RUM_SCAN_END: - rum_enable_tsf_sync(sc); - /* XXX keep local copy */ - rum_set_bssid(sc, vap->iv_bss->ni_bssid); - break; - case RUM_SET_CHANNEL: rum_set_chan(sc, ic->ic_curchan); break; - default: - panic("unknown scan action %d\n", sc->sc_scan_action); - /* NEVER REACHED */ + default: /* RUM_SCAN_END */ + rum_enable_tsf_sync(sc); + rum_set_bssid(sc, sc->sc_bssid); break; } } @@ -2395,6 +2387,11 @@ rum_queue_command(struct rum_softc *sc, task->hdr.pm_callback = fn; task->sc = sc; + /* + * Init and stop must be synchronous! + */ + if ((fn == rum_init_task) || (fn == rum_stop_task)) + usb2_proc_mwait(&sc->sc_tq, t0, t1); } static device_method_t rum_methods[] = { Modified: head/sys/dev/usb2/wlan/if_rumvar.h ============================================================================== --- head/sys/dev/usb2/wlan/if_rumvar.h Mon Feb 9 22:14:38 2009 (r188418) +++ head/sys/dev/usb2/wlan/if_rumvar.h Mon Feb 9 22:18:11 2009 (r188419) @@ -100,14 +100,14 @@ struct rum_softc { struct usb2_process sc_tq; const struct ieee80211_rate_table *sc_rates; + struct usb2_xfer *sc_xfer[RUM_N_TRANSFER]; uint8_t rf_rev; uint8_t rffreq; - struct usb2_xfer *sc_xfer[RUM_N_TRANSFER]; - enum ieee80211_state sc_state; int sc_arg; + struct rum_task sc_synctask[2]; struct rum_task sc_task[2]; struct rum_task sc_promisctask[2]; struct rum_task sc_scantask[2]; @@ -116,7 +116,7 @@ struct rum_softc { #define RUM_SCAN_END 1 #define RUM_SET_CHANNEL 2 - struct rum_tx_data *tx_data; + struct rum_tx_data tx_data[RUM_TX_LIST_COUNT]; rum_txdhead tx_q; rum_txdhead tx_free; int tx_nfree; @@ -124,12 +124,10 @@ struct rum_softc { struct mtx sc_mtx; - int sc_flags; -#define RUM_FLAG_DETACH 0x0001 - uint32_t sta[6]; uint32_t rf_regs[4]; uint8_t txpow[44]; + uint8_t sc_bssid[6]; struct { uint8_t val; Modified: head/sys/dev/usb2/wlan/if_ural2.c ============================================================================== --- head/sys/dev/usb2/wlan/if_ural2.c Mon Feb 9 22:14:38 2009 (r188418) +++ head/sys/dev/usb2/wlan/if_ural2.c Mon Feb 9 22:18:11 2009 (r188419) @@ -55,6 +55,9 @@ SYSCTL_INT(_hw_usb2_ural, OID_AUTO, debu "Debug level"); #endif +#define ural_do_request(sc,req,data) \ + usb2_do_request_proc((sc)->sc_udev, &(sc)->sc_tq, req, data, 0, NULL, 5000) + #define URAL_RSSI(rssi) \ ((rssi) > (RAL_NOISE_FLOOR + RAL_RSSI_CORR) ? \ ((rssi) - (RAL_NOISE_FLOOR + RAL_RSSI_CORR)) : 0) @@ -95,10 +98,13 @@ static const struct usb2_device_id ural_ static usb2_callback_t ural_bulk_read_callback; static usb2_callback_t ural_bulk_write_callback; +static usb2_proc_callback_t ural_attach_post; static usb2_proc_callback_t ural_task; static usb2_proc_callback_t ural_scantask; static usb2_proc_callback_t ural_promisctask; static usb2_proc_callback_t ural_amrr_task; +static usb2_proc_callback_t ural_init_task; +static usb2_proc_callback_t ural_stop_task; static struct ieee80211vap *ural_vap_create(struct ieee80211com *, const char name[IFNAMSIZ], int unit, int opmode, @@ -106,8 +112,8 @@ static struct ieee80211vap *ural_vap_cre const uint8_t mac[IEEE80211_ADDR_LEN]); static void ural_vap_delete(struct ieee80211vap *); static void ural_tx_free(struct ural_tx_data *, int); -static int ural_alloc_tx_list(struct ural_softc *); -static void ural_free_tx_list(struct ural_softc *); +static void ural_setup_tx_list(struct ural_softc *); +static void ural_unsetup_tx_list(struct ural_softc *); static int ural_newstate(struct ieee80211vap *, enum ieee80211_state, int); static void ural_setup_tx_desc(struct ural_softc *, @@ -153,9 +159,7 @@ static void ural_read_eeprom(struct ura static int ural_bbp_init(struct ural_softc *); static void ural_set_txantenna(struct ural_softc *, int); static void ural_set_rxantenna(struct ural_softc *, int); -static void ural_init_locked(struct ural_softc *); static void ural_init(void *); -static void ural_stop(void *); static int ural_raw_xmit(struct ieee80211_node *, struct mbuf *, const struct ieee80211_bpf_params *); static void ural_amrr_start(struct ural_softc *, @@ -394,10 +398,8 @@ ural_attach(device_t self) { struct usb2_attach_arg *uaa = device_get_ivars(self); struct ural_softc *sc = device_get_softc(self); - struct ifnet *ifp; - struct ieee80211com *ic; int error; - uint8_t bands, iface_index; + uint8_t iface_index; device_set_usb2_desc(self); sc->sc_udev = uaa->device; @@ -422,14 +424,28 @@ ural_attach(device_t self) goto detach; } - ifp = sc->sc_ifp = if_alloc(IFT_IEEE80211); - if (ifp == NULL) { - device_printf(sc->sc_dev, "can not if_alloc()\n"); - goto detach; - } - ic = ifp->if_l2com; - + /* fork rest of the attach code */ RAL_LOCK(sc); + ural_queue_command(sc, ural_attach_post, + &sc->sc_synctask[0].hdr, + &sc->sc_synctask[1].hdr); + RAL_UNLOCK(sc); + return (0); + +detach: + ural_detach(self); + return (ENXIO); /* failure */ +} + +static void +ural_attach_post(struct usb2_proc_msg *pm) +{ + struct ural_task *task = (struct ural_task *)pm; + struct ural_softc *sc = task->sc; + struct ifnet *ifp; + struct ieee80211com *ic; + uint8_t bands; + /* retrieve RT2570 rev. no */ sc->asic_rev = ural_read(sc, RAL_MAC_CSR0); @@ -440,6 +456,14 @@ ural_attach(device_t self) device_printf(sc->sc_dev, "MAC/BBP RT2570 (rev 0x%02x), RF %s\n", sc->asic_rev, ural_get_rf(sc->rf_rev)); + ifp = sc->sc_ifp = if_alloc(IFT_IEEE80211); + if (ifp == NULL) { + device_printf(sc->sc_dev, "can not if_alloc()\n"); + RAL_LOCK(sc); + return; + } + ic = ifp->if_l2com; + ifp->if_softc = sc; if_initname(ifp, "ural", device_get_unit(sc->sc_dev)); ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; @@ -452,6 +476,7 @@ ural_attach(device_t self) ic->ic_ifp = ifp; ic->ic_phytype = IEEE80211_T_OFDM; /* not only, but not used */ + IEEE80211_ADDR_COPY(ic->ic_myaddr, sc->sc_bssid); /* set device capabilities */ ic->ic_caps = @@ -500,11 +525,7 @@ ural_attach(device_t self) if (bootverbose) ieee80211_announce(ic); - return (0); /* success */ - -detach: - ural_detach(self); - return (ENXIO); /* failure */ + RAL_LOCK(sc); } static int @@ -514,20 +535,24 @@ ural_detach(device_t self) struct ifnet *ifp = sc->sc_ifp; struct ieee80211com *ic = ifp->if_l2com; - RAL_LOCK(sc); - sc->sc_flags |= URAL_FLAG_DETACH; - ural_stop(sc); - RAL_UNLOCK(sc); + /* wait for any post attach or other command to complete */ + usb2_proc_drain(&sc->sc_tq); - /* stop all USB transfers first */ + /* stop all USB transfers */ usb2_transfer_unsetup(sc->sc_xfer, URAL_N_TRANSFER); usb2_proc_free(&sc->sc_tq); + /* free TX list, if any */ + RAL_LOCK(sc); + ural_unsetup_tx_list(sc); + RAL_UNLOCK(sc); + if (ifp) { bpfdetach(ifp); ieee80211_ifdetach(ic); if_free(ifp); } + mtx_destroy(&sc->sc_mtx); return (0); @@ -575,11 +600,8 @@ static void ural_vap_delete(struct ieee80211vap *vap) { struct ural_vap *uvp = URAL_VAP(vap); - struct ural_softc *sc = uvp->sc; - RAL_LOCK(sc); - usb2_callout_stop(&uvp->amrr_ch); - RAL_UNLOCK(sc); + usb2_callout_drain(&uvp->amrr_ch); ieee80211_amrr_cleanup(&uvp->amrr); ieee80211_vap_detach(vap); free(uvp, M_80211_VAP); @@ -604,17 +626,12 @@ ural_tx_free(struct ural_tx_data *data, sc->tx_nfree++; } -static int -ural_alloc_tx_list(struct ural_softc *sc) +static void +ural_setup_tx_list(struct ural_softc *sc) { struct ural_tx_data *data; int i; - sc->tx_data = malloc(sizeof(struct ural_tx_data) * RAL_TX_LIST_COUNT, - M_USB, M_NOWAIT|M_ZERO); - if (sc->tx_data == NULL) - return (ENOMEM); - sc->tx_nfree = 0; STAILQ_INIT(&sc->tx_q); STAILQ_INIT(&sc->tx_free); @@ -626,18 +643,20 @@ ural_alloc_tx_list(struct ural_softc *sc STAILQ_INSERT_TAIL(&sc->tx_free, data, next); sc->tx_nfree++; } - return 0; } static void -ural_free_tx_list(struct ural_softc *sc) +ural_unsetup_tx_list(struct ural_softc *sc) { struct ural_tx_data *data; int i; - if (sc->tx_data == NULL) - return; + /* make sure any subsequent use of the queues will fail */ + sc->tx_nfree = 0; + STAILQ_INIT(&sc->tx_q); + STAILQ_INIT(&sc->tx_free); + /* free up all node references and mbufs */ for (i = 0; i < RAL_TX_LIST_COUNT; i++) { data = &sc->tx_data[i]; @@ -650,8 +669,6 @@ ural_free_tx_list(struct ural_softc *sc) data->ni = NULL; } } - free(sc->tx_data, M_USB); - sc->tx_data = NULL; } static void @@ -668,9 +685,6 @@ ural_task(struct usb2_proc_msg *pm) struct ieee80211_node *ni; struct mbuf *m; - if (sc->sc_flags & URAL_FLAG_DETACH) - return; - ostate = vap->iv_state; switch (sc->sc_state) { @@ -691,7 +705,8 @@ ural_task(struct usb2_proc_msg *pm) ural_update_slot(ic->ic_ifp); ural_set_txpreamble(sc); ural_set_basicrates(sc, ic->ic_bsschan); - ural_set_bssid(sc, ni->ni_bssid); + IEEE80211_ADDR_COPY(sc->sc_bssid, ni->ni_bssid); + ural_set_bssid(sc, sc->sc_bssid); } if (vap->iv_opmode == IEEE80211_M_HOSTAP || @@ -743,26 +758,27 @@ ural_scantask(struct usb2_proc_msg *pm) struct ural_softc *sc = task->sc; struct ifnet *ifp = sc->sc_ifp; struct ieee80211com *ic = ifp->if_l2com; - struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); RAL_LOCK_ASSERT(sc, MA_OWNED); - if (sc->sc_flags & URAL_FLAG_DETACH) - return; - - if (sc->sc_scan_action == URAL_SCAN_START) { + switch (sc->sc_scan_action) { + case URAL_SCAN_START: /* abort TSF synchronization */ DPRINTF("starting scan\n"); ural_write(sc, RAL_TXRX_CSR19, 0); ural_set_bssid(sc, ifp->if_broadcastaddr); - } else if (sc->sc_scan_action == URAL_SET_CHANNEL) { + break; + + case URAL_SET_CHANNEL: ural_set_chan(sc, ic->ic_curchan); - } else { + break; + + default: /* URAL_SCAN_END */ DPRINTF("stopping scan\n"); ural_enable_tsf_sync(sc); - /* XXX keep local copy */ - ural_set_bssid(sc, vap->iv_bss->ni_bssid); - } + ural_set_bssid(sc, sc->sc_bssid); + break; + } } static int @@ -806,7 +822,7 @@ ural_bulk_write_callback(struct usb2_xfe struct ieee80211_channel *c = ic->ic_curchan; struct ural_tx_data *data; struct mbuf *m; - int len; + unsigned int len; switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: @@ -823,15 +839,6 @@ ural_bulk_write_callback(struct usb2_xfe /* FALLTHROUGH */ case USB_ST_SETUP: tr_setup: -#if 0 - if (sc->sc_flags & URAL_FLAG_WAIT_COMMAND) { - /* - * don't send anything while a command is pending ! - */ - break; - } -#endif - data = STAILQ_FIRST(&sc->tx_q); if (data) { STAILQ_REMOVE_HEAD(&sc->tx_q, next); @@ -878,6 +885,13 @@ tr_setup: DPRINTFN(11, "transfer error, %s\n", usb2_errstr(xfer->error)); + ifp->if_oerrors++; + data = xfer->priv_fifo; + if (data != NULL) { + ural_tx_free(data, xfer->error); + xfer->priv_fifo = NULL; + } + if (xfer->error == USB_ERR_STALLED) { /* try to clear stall first */ xfer->flags.stall_pipe = 1; @@ -885,13 +899,6 @@ tr_setup: } if (xfer->error == USB_ERR_TIMEOUT) device_printf(sc->sc_dev, "device timeout\n"); - - ifp->if_oerrors++; - data = xfer->priv_fifo; - if (data != NULL) { - ural_tx_free(data, xfer->error); - xfer->priv_fifo = NULL; - } break; } } @@ -906,7 +913,7 @@ ural_bulk_read_callback(struct usb2_xfer struct mbuf *m = NULL; uint32_t flags; uint8_t rssi = 0; - int len; + unsigned int len; switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: @@ -1001,7 +1008,6 @@ tr_setup: goto tr_setup; } return; - } } @@ -1406,15 +1412,20 @@ ural_ioctl(struct ifnet *ifp, u_long cmd RAL_LOCK(sc); if (ifp->if_flags & IFF_UP) { if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { - ural_init_locked(sc); + ural_queue_command(sc, ural_init_task, + &sc->sc_synctask[0].hdr, + &sc->sc_synctask[1].hdr); startall = 1; } else ural_queue_command(sc, ural_promisctask, &sc->sc_promisctask[0].hdr, &sc->sc_promisctask[1].hdr); } else { - if (ifp->if_drv_flags & IFF_DRV_RUNNING) - ural_stop(sc); + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 22:23:02 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 62BAC10656EF; Mon, 9 Feb 2009 22:23:02 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4F9878FC18; Mon, 9 Feb 2009 22:23:02 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n19MN2Ou073371; Mon, 9 Feb 2009 22:23:02 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n19MN2TU073369; Mon, 9 Feb 2009 22:23:02 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200902092223.n19MN2TU073369@svn.freebsd.org> From: Andrew Thompson Date: Mon, 9 Feb 2009 22:23:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188422 - in head/sys: conf dev/usb2/core modules/usb2/core X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Feb 2009 22:23:03 -0000 Author: thompsa Date: Mon Feb 9 22:23:01 2009 New Revision: 188422 URL: http://svn.freebsd.org/changeset/base/188422 Log: Remove usb2_config_td.[ch], they are no longer used. Deleted: head/sys/dev/usb2/core/usb2_config_td.c head/sys/dev/usb2/core/usb2_config_td.h Modified: head/sys/conf/files head/sys/modules/usb2/core/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Feb 9 22:22:09 2009 (r188421) +++ head/sys/conf/files Mon Feb 9 22:23:01 2009 (r188422) @@ -1567,7 +1567,6 @@ dev/usb2/ndis/usb2_ndis.c optional usb2 # dev/usb2/core/usb2_busdma.c optional usb2_core dev/usb2/core/usb2_compat_linux.c optional usb2_core -dev/usb2/core/usb2_config_td.c optional usb2_core dev/usb2/core/usb2_core.c optional usb2_core dev/usb2/core/usb2_debug.c optional usb2_core dev/usb2/core/usb2_dev.c optional usb2_core Modified: head/sys/modules/usb2/core/Makefile ============================================================================== --- head/sys/modules/usb2/core/Makefile Mon Feb 9 22:22:09 2009 (r188421) +++ head/sys/modules/usb2/core/Makefile Mon Feb 9 22:23:01 2009 (r188422) @@ -35,7 +35,6 @@ SRCS+= bus_if.h usb2_if.h device_if.h vn SRCS+= usb2_if.c SRCS+= usb2_busdma.c SRCS+= usb2_compat_linux.c -SRCS+= usb2_config_td.c SRCS+= usb2_core.c SRCS+= usb2_debug.c SRCS+= usb2_dev.c From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 22:38:55 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C5EE8106566B; Mon, 9 Feb 2009 22:38:55 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B31DE8FC1C; Mon, 9 Feb 2009 22:38:55 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n19MctJ9073703; Mon, 9 Feb 2009 22:38:55 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n19MctNr073700; Mon, 9 Feb 2009 22:38:55 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200902092238.n19MctNr073700@svn.freebsd.org> From: Andrew Thompson Date: Mon, 9 Feb 2009 22:38:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188423 - in head/sys: conf modules/usb2 modules/usb2/serial_slcom X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Feb 2009 22:38:56 -0000 Author: thompsa Date: Mon Feb 9 22:38:55 2009 New Revision: 188423 URL: http://svn.freebsd.org/changeset/base/188423 Log: Hook uslcom2 up to the build. Added: head/sys/modules/usb2/serial_slcom/ head/sys/modules/usb2/serial_slcom/Makefile (contents, props changed) Modified: head/sys/conf/files head/sys/modules/usb2/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Feb 9 22:23:01 2009 (r188422) +++ head/sys/conf/files Mon Feb 9 22:38:55 2009 (r188423) @@ -1623,6 +1623,7 @@ dev/usb2/serial/umct2.c optional usb2_c dev/usb2/serial/umodem2.c optional usb2_core usb2_serial usb2_serial_modem dev/usb2/serial/umoscom2.c optional usb2_core usb2_serial usb2_serial_moscom dev/usb2/serial/uplcom2.c optional usb2_core usb2_serial usb2_serial_plcom +dev/usb2/serial/uslcom2.c optional usb2_core usb2_serial usb2_serial_slcom dev/usb2/serial/usb2_serial.c optional usb2_core usb2_serial dev/usb2/serial/uvisor2.c optional usb2_core usb2_serial usb2_serial_visor dev/usb2/serial/uvscom2.c optional usb2_core usb2_serial usb2_serial_vscom Modified: head/sys/modules/usb2/Makefile ============================================================================== --- head/sys/modules/usb2/Makefile Mon Feb 9 22:23:01 2009 (r188422) +++ head/sys/modules/usb2/Makefile Mon Feb 9 22:38:55 2009 (r188423) @@ -74,6 +74,7 @@ SUBDIR += serial_mct SUBDIR += serial_modem SUBDIR += serial_moscom SUBDIR += serial_plcom +SUBDIR += serial_slcom SUBDIR += serial_visor SUBDIR += serial_vscom SUBDIR += sound Added: head/sys/modules/usb2/serial_slcom/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/usb2/serial_slcom/Makefile Mon Feb 9 22:38:55 2009 (r188423) @@ -0,0 +1,38 @@ +# +# $FreeBSD$ +# +# Copyright (c) 2009 Hans Petter Selasky. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# + +S=${.CURDIR}/../../.. + +.PATH: $S/dev/usb2/serial + +KMOD=usb2_serial_slcom +SRCS= +SRCS+= bus_if.h usb2_if.h device_if.h vnode_if.h +SRCS+= opt_usb.h opt_bus.h opt_compat.h +SRCS+= uslcom2.c + +.include From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 22:59:22 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D266C1065679; Mon, 9 Feb 2009 22:59:22 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BF2CF8FC14; Mon, 9 Feb 2009 22:59:22 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n19MxMq5074189; Mon, 9 Feb 2009 22:59:22 GMT (envelope-from cognet@svn.freebsd.org) Received: (from cognet@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n19MxMfs074188; Mon, 9 Feb 2009 22:59:22 GMT (envelope-from cognet@svn.freebsd.org) Message-Id: <200902092259.n19MxMfs074188@svn.freebsd.org> From: Olivier Houchard Date: Mon, 9 Feb 2009 22:59:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188424 - head/sys/dev/sound/pci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Feb 2009 22:59:24 -0000 Author: cognet Date: Mon Feb 9 22:59:22 2009 New Revision: 188424 URL: http://svn.freebsd.org/changeset/base/188424 Log: Hmm... "base? base : 0" and "base" should be equivalent. Pointy hat to: cognet MFC after: 3 days Modified: head/sys/dev/sound/pci/ds1.c Modified: head/sys/dev/sound/pci/ds1.c ============================================================================== --- head/sys/dev/sound/pci/ds1.c Mon Feb 9 22:38:55 2009 (r188423) +++ head/sys/dev/sound/pci/ds1.c Mon Feb 9 22:59:22 2009 (r188424) @@ -396,7 +396,7 @@ ds_initpbank(volatile struct pbank *pb, pb->Format |= b16? 0 : 0x80000000; pb->Format |= (stereo && (ch == 2 || ch == 4))? 0x00000001 : 0; pb->LoopDefault = 0; - pb->PgBase = base? base : 0; + pb->PgBase = base; pb->PgLoop = 0; pb->PgLoopEnd = len >> ss; pb->PgLoopFrac = 0; From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 00:08:39 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 94C9C1065670; Tue, 10 Feb 2009 00:08:39 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 682458FC1F; Tue, 10 Feb 2009 00:08:39 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1A08dZI075436; Tue, 10 Feb 2009 00:08:39 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1A08dh4075432; Tue, 10 Feb 2009 00:08:39 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200902100008.n1A08dh4075432@svn.freebsd.org> From: Marcel Moolenaar Date: Tue, 10 Feb 2009 00:08:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188426 - in head/sys: amd64/conf conf i386/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Feb 2009 00:08:40 -0000 Author: marcel Date: Tue Feb 10 00:08:39 2009 New Revision: 188426 URL: http://svn.freebsd.org/changeset/base/188426 Log: Add option GEOM_PART_EBR by default on amd64 and i386. Modified: head/sys/amd64/conf/DEFAULTS head/sys/conf/NOTES head/sys/conf/options head/sys/i386/conf/DEFAULTS Modified: head/sys/amd64/conf/DEFAULTS ============================================================================== --- head/sys/amd64/conf/DEFAULTS Mon Feb 9 23:23:00 2009 (r188425) +++ head/sys/amd64/conf/DEFAULTS Tue Feb 10 00:08:39 2009 (r188426) @@ -17,4 +17,5 @@ device uart_ns8250 # Default partitioning schemes options GEOM_PART_BSD +options GEOM_PART_EBR options GEOM_PART_MBR Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Mon Feb 9 23:23:00 2009 (r188425) +++ head/sys/conf/NOTES Tue Feb 10 00:08:39 2009 (r188426) @@ -147,6 +147,7 @@ options GEOM_MULTIPATH # Disk multipat options GEOM_NOP # Test class. options GEOM_PART_APM # Apple partitioning options GEOM_PART_BSD # BSD disklabel +options GEOM_PART_EBR # Extended Boot Records options GEOM_PART_GPT # GPT partitioning options GEOM_PART_MBR # MBR partitioning options GEOM_PART_PC98 # PC-9800 disk partitioning Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Mon Feb 9 23:23:00 2009 (r188425) +++ head/sys/conf/options Tue Feb 10 00:08:39 2009 (r188426) @@ -92,6 +92,7 @@ GEOM_MULTIPATH opt_geom.h GEOM_NOP opt_geom.h GEOM_PART_APM opt_geom.h GEOM_PART_BSD opt_geom.h +GEOM_PART_EBR opt_geom.h GEOM_PART_GPT opt_geom.h GEOM_PART_MBR opt_geom.h GEOM_PART_PC98 opt_geom.h Modified: head/sys/i386/conf/DEFAULTS ============================================================================== --- head/sys/i386/conf/DEFAULTS Mon Feb 9 23:23:00 2009 (r188425) +++ head/sys/i386/conf/DEFAULTS Tue Feb 10 00:08:39 2009 (r188426) @@ -21,6 +21,7 @@ device uart_ns8250 # Default partitioning schemes options GEOM_PART_BSD +options GEOM_PART_EBR options GEOM_PART_MBR # enable support for native hardware From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 00:47:56 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7CA2C106564A; Tue, 10 Feb 2009 00:47:56 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.227]) by mx1.freebsd.org (Postfix) with ESMTP id 1CD258FC1B; Tue, 10 Feb 2009 00:47:55 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: by rv-out-0506.google.com with SMTP id b25so2226570rvf.43 for ; Mon, 09 Feb 2009 16:47:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:from:date:to:cc :subject:message-id:reply-to:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=rhVRxI8j9eA/5cvFP1SCyqS4ZXVVNVL8OQZPsYnkt9A=; b=tPUq+jGXaGfOYw9UWkWLwtc59ZA1vBoqN/hoRF8VpaWqP6RcI/l0GSASzX5HgVVt2Y hf8O+mO+RxjTi/Zugtq6mf6+2nFn8FzI3TeXrfj1xUK072byEPXleog8iO8L/nPHeQF9 Fj34MkNaeth7UEDwiAeOO1/0WAzEVhEW0P2hg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=G+CR1WXfrRc9Voy0Fj9YjkrkkCULmshptdvyv9UUVROQjvj5uI14XWrYko3HCe+4Np 5a3hdJDsed6BZN0Bkd8UkjNAvR73X6IKWK5U+Tj78f9x42/UB5N4XtuOOCzLywbEMXCl JREF3a1HvolGltiawlnzJnyCK9jhGl0axUOlE= Received: by 10.141.114.19 with SMTP id r19mr4304789rvm.24.1234226875630; Mon, 09 Feb 2009 16:47:55 -0800 (PST) Received: from michelle.cdnetworks.co.kr ([114.111.62.249]) by mx.google.com with ESMTPS id c20sm9850323rvf.8.2009.02.09.16.47.52 (version=SSLv3 cipher=RC4-MD5); Mon, 09 Feb 2009 16:47:54 -0800 (PST) Received: by michelle.cdnetworks.co.kr (sSMTP sendmail emulation); Tue, 10 Feb 2009 09:50:02 +0900 From: Pyun YongHyeon Date: Tue, 10 Feb 2009 09:50:02 +0900 To: Gary Jennejohn Message-ID: <20090210005002.GD98095@michelle.cdnetworks.co.kr> References: <200902090459.n194xDa3045928@svn.freebsd.org> <20090209181056.40db0ba2@ernst.jennejohn.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="tEFtbjk+mNEviIIX" Content-Disposition: inline In-Reply-To: <20090209181056.40db0ba2@ernst.jennejohn.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Pyun YongHyeon Subject: Re: svn commit: r188381 - head/sys/dev/re X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Feb 2009 00:47:57 -0000 --tEFtbjk+mNEviIIX Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Feb 09, 2009 at 06:10:56PM +0100, Gary Jennejohn wrote: > On Mon, 9 Feb 2009 04:59:13 +0000 (UTC) > Pyun YongHyeon wrote: > > > Author: yongari > > Date: Mon Feb 9 04:59:13 2009 > > New Revision: 188381 > > URL: http://svn.freebsd.org/changeset/base/188381 > > > > Log: > > Reclaim transmitted frames in re_tick(). This is for PCIe > > controllers that lose Tx completion interrupts under certain > > conditions. With this change it's safe to use MSI on PCIe > > controllers so enable MSI on these controllers. > > > > Modified: > > head/sys/dev/re/if_re.c > > > > This does not work with my re(4). When I allow MSI it never transmits. > I noticed this while booting when the sendmail startup hung. A test > with ping(8) showed that there was no output (or maybe no input, hard > to tell with ping). > > Here dmesg output when it fails: > re0: port 0xde00-0xdeff mem 0xfdaff000-0xfdafffff,0xfdae0000-0xfdaeffff irq 18 at device 0.0 on pci2 > re0: Using 2 MSI messages > re0: Chip rev. 0x3c000000 > re0: MAC rev. 0x00400000 > re0: Ethernet address: 00:1f:d0:8f:5a:43 > re0: [FILTER] > re0: [FILTER] > re0: link state changed to UP > > Here dmesg output when it succeeds: > re0: port 0xde00-0xdeff mem 0xfdaff000-0xfdafffff,0xfdae0000-0xfdaeffff irq 18 at device 0.0 on pci2 > re0: turning off MSI enable bit. > re0: Chip rev. 0x3c000000 > re0: MAC rev. 0x00400000 > re0: Ethernet address: 00:1f:d0:8f:5a:43 > re0: [FILTER] > re0: link state changed to UP > > And here pciconf output: > re0@pci0:2:0:0: class=0x020000 card=0xe0001458 chip=0x816810ec rev=0x02 hdr=0x00 > vendor = 'Realtek Semiconductor' > device = 'RTL8168/8111 PCI-E Gigabit Ethernet NIC' > class = network > subclass = ethernet > It seems that broken controllers have two MSI messages. Instead of reverting the change, how about attached patch? --tEFtbjk+mNEviIIX Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="re.msi.diff" Index: sys/pci/if_rlreg.h =================================================================== --- sys/pci/if_rlreg.h (revision 188426) +++ sys/pci/if_rlreg.h (working copy) @@ -779,7 +779,7 @@ #define RE_RX_DESC_BUFLEN MCLBYTES #endif -#define RL_MSI_MESSAGES 2 +#define RL_MSI_MESSAGES 1 #define RL_ADDR_LO(y) ((uint64_t) (y) & 0xFFFFFFFF) #define RL_ADDR_HI(y) ((uint64_t) (y) >> 32) Index: sys/dev/re/if_re.c =================================================================== --- sys/dev/re/if_re.c (revision 188426) +++ sys/dev/re/if_re.c (working copy) @@ -1149,7 +1149,8 @@ if (bootverbose) device_printf(dev, "MSI count : %d\n", msic); } - if (msic == RL_MSI_MESSAGES && msi_disable == 0) { + if (msic > 0 && msi_disable == 0) { + msic = 1; if (pci_alloc_msi(dev, &msic) == 0) { if (msic == RL_MSI_MESSAGES) { device_printf(dev, "Using %d MSI messages\n", --tEFtbjk+mNEviIIX-- From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 01:37:55 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B1EE11065670; Tue, 10 Feb 2009 01:37:55 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9EFFD8FC14; Tue, 10 Feb 2009 01:37:55 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1A1btMA077052; Tue, 10 Feb 2009 01:37:55 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1A1btUZ077051; Tue, 10 Feb 2009 01:37:55 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902100137.n1A1btUZ077051@svn.freebsd.org> From: Sam Leffler Date: Tue, 10 Feb 2009 01:37:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188427 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Feb 2009 01:37:56 -0000 Author: sam Date: Tue Feb 10 01:37:55 2009 New Revision: 188427 URL: http://svn.freebsd.org/changeset/base/188427 Log: correctly fixup iv_des_chan after installing a new channel table; if the previous channel is now invalid we must set it to IEEE80211_CHAN_ANYC Modified: head/sys/net80211/ieee80211_regdomain.c Modified: head/sys/net80211/ieee80211_regdomain.c ============================================================================== --- head/sys/net80211/ieee80211_regdomain.c Tue Feb 10 00:08:39 2009 (r188426) +++ head/sys/net80211/ieee80211_regdomain.c Tue Feb 10 01:37:55 2009 (r188427) @@ -428,8 +428,9 @@ ieee80211_setregdomain(struct ieee80211v ieee80211_scan_flush(vap); ieee80211_dfs_reset(ic); if (vap->iv_des_chan != IEEE80211_CHAN_ANYC) { + c = ieee80211_find_channel(ic, desfreq, desflags); /* NB: may be NULL if not present in new channel list */ - vap->iv_des_chan = ieee80211_find_channel(ic, desfreq, desflags); + vap->iv_des_chan = (c != NULL) ? c : IEEE80211_CHAN_ANYC; } IEEE80211_UNLOCK(ic); From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 02:30:25 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B571A1065675; Tue, 10 Feb 2009 02:30:25 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 736068FC12; Tue, 10 Feb 2009 02:30:25 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id n1A2TwXJ033205; Mon, 9 Feb 2009 19:29:58 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Mon, 09 Feb 2009 19:30:04 -0700 (MST) Message-Id: <20090209.193004.-148135765.imp@bsdimp.com> To: sam@FreeBSD.org From: "M. Warner Losh" In-Reply-To: <498F0BC2.2050302@freebsd.org> References: <200902081233.n18CX5n5023301@svn.freebsd.org> <498F0BC2.2050302@freebsd.org> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, wkoszek@FreeBSD.org Subject: Re: svn commit: r188309 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Feb 2009 02:30:26 -0000 In message: <498F0BC2.2050302@freebsd.org> Sam Leffler writes: : Wojciech A. Koszek wrote: : > Author: wkoszek : > Date: Sun Feb 8 12:33:05 2009 : > New Revision: 188309 : > URL: http://svn.freebsd.org/changeset/base/188309 : > : > Log: : > Further NOTES cleanup -- following drivers didn't survive TTY-ng : > and aren't included in NOTES anyway: cy(4), rc(4), rp(4). : > : > si(4) doesn't belong to global NOTES. : > : > : I'm not sure I agree w/ yanking drivers entirely because they don't : work. If they are commented out w/ a note why this will help people : find them and possibly resuscitate them. If they are well and truly : gone from then tree then sure--but as of today they are still in svn. I'd leave them commented out for how. We usually give folks about a year to make the jump for some major rework like this, then kill it from the tree. Is there any reason not to follow that this time? Warner From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 02:33:24 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8402A106566B; Tue, 10 Feb 2009 02:33:24 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 2AC518FC1B; Tue, 10 Feb 2009 02:33:24 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id n1A2Wtml033226; Mon, 9 Feb 2009 19:32:56 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Mon, 09 Feb 2009 19:33:01 -0700 (MST) Message-Id: <20090209.193301.1749820890.imp@bsdimp.com> To: gonzo@FreeBSD.org From: "M. Warner Losh" In-Reply-To: <200902082343.n18Nha37038365@svn.freebsd.org> References: <200902082343.n18Nha37038365@svn.freebsd.org> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r188353 - head/sys/mips/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Feb 2009 02:33:25 -0000 In message: <200902082343.n18Nha37038365@svn.freebsd.org> Oleksandr Tymoshenko writes: : Author: gonzo : Date: Sun Feb 8 23:43:36 2009 : New Revision: 188353 : URL: http://svn.freebsd.org/changeset/base/188353 : : Log: : - Fix in_cksum for big-endian MIPS: use correct compile-time check. : : -#ifndef _MISEB : +#if _BYTE_ORDER == _LITTLE_ENDIAN This could also have been fixed with _MIPSEB Warner From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 02:43:07 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B395D106566B; Tue, 10 Feb 2009 02:43:07 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A08248FC18; Tue, 10 Feb 2009 02:43:07 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1A2h7Pi078702; Tue, 10 Feb 2009 02:43:07 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1A2h7Ou078698; Tue, 10 Feb 2009 02:43:07 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200902100243.n1A2h7Ou078698@svn.freebsd.org> From: Warner Losh Date: Tue, 10 Feb 2009 02:43:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188429 - head/sys/geom/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Feb 2009 02:43:08 -0000 Author: imp Date: Tue Feb 10 02:43:07 2009 New Revision: 188429 URL: http://svn.freebsd.org/changeset/base/188429 Log: Fix g_part_dumpconf and g_part_name prototpyes. Submitted by: marcel@ Modified: head/sys/geom/part/g_part_apm.c head/sys/geom/part/g_part_gpt.c head/sys/geom/part/g_part_pc98.c head/sys/geom/part/g_part_vtoc8.c Modified: head/sys/geom/part/g_part_apm.c ============================================================================== --- head/sys/geom/part/g_part_apm.c Tue Feb 10 01:39:55 2009 (r188428) +++ head/sys/geom/part/g_part_apm.c Tue Feb 10 02:43:07 2009 (r188429) @@ -62,12 +62,12 @@ static int g_part_apm_add(struct g_part_ struct g_part_parms *); static int g_part_apm_create(struct g_part_table *, struct g_part_parms *); static int g_part_apm_destroy(struct g_part_table *, struct g_part_parms *); -static int g_part_apm_dumpconf(struct g_part_table *, struct g_part_entry *, +static void g_part_apm_dumpconf(struct g_part_table *, struct g_part_entry *, struct sbuf *, const char *); static int g_part_apm_dumpto(struct g_part_table *, struct g_part_entry *); static int g_part_apm_modify(struct g_part_table *, struct g_part_entry *, struct g_part_parms *); -static char *g_part_apm_name(struct g_part_table *, struct g_part_entry *, +static const char *g_part_apm_name(struct g_part_table *, struct g_part_entry *, char *, size_t); static int g_part_apm_probe(struct g_part_table *, struct g_consumer *); static int g_part_apm_read(struct g_part_table *, struct g_consumer *); @@ -248,7 +248,7 @@ g_part_apm_destroy(struct g_part_table * return (0); } -static int +static void g_part_apm_dumpconf(struct g_part_table *table, struct g_part_entry *baseentry, struct sbuf *sb, const char *indent) { @@ -273,7 +273,6 @@ g_part_apm_dumpconf(struct g_part_table } else { /* confxml: scheme information */ } - return (0); } static int @@ -311,7 +310,7 @@ g_part_apm_modify(struct g_part_table *b return (0); } -static char * +static const char * g_part_apm_name(struct g_part_table *table, struct g_part_entry *baseentry, char *buf, size_t bufsz) { Modified: head/sys/geom/part/g_part_gpt.c ============================================================================== --- head/sys/geom/part/g_part_gpt.c Tue Feb 10 01:39:55 2009 (r188428) +++ head/sys/geom/part/g_part_gpt.c Tue Feb 10 02:43:07 2009 (r188429) @@ -91,12 +91,12 @@ static int g_part_gpt_add(struct g_part_ static int g_part_gpt_bootcode(struct g_part_table *, struct g_part_parms *); static int g_part_gpt_create(struct g_part_table *, struct g_part_parms *); static int g_part_gpt_destroy(struct g_part_table *, struct g_part_parms *); -static int g_part_gpt_dumpconf(struct g_part_table *, struct g_part_entry *, +static void g_part_gpt_dumpconf(struct g_part_table *, struct g_part_entry *, struct sbuf *, const char *); static int g_part_gpt_dumpto(struct g_part_table *, struct g_part_entry *); static int g_part_gpt_modify(struct g_part_table *, struct g_part_entry *, struct g_part_parms *); -static char *g_part_gpt_name(struct g_part_table *, struct g_part_entry *, +static const char *g_part_gpt_name(struct g_part_table *, struct g_part_entry *, char *, size_t); static int g_part_gpt_probe(struct g_part_table *, struct g_consumer *); static int g_part_gpt_read(struct g_part_table *, struct g_consumer *); @@ -447,7 +447,7 @@ g_part_gpt_destroy(struct g_part_table * return (0); } -static int +static void g_part_gpt_dumpconf(struct g_part_table *table, struct g_part_entry *baseentry, struct sbuf *sb, const char *indent) { @@ -470,7 +470,6 @@ g_part_gpt_dumpconf(struct g_part_table } else { /* confxml: scheme information */ } - return (0); } static int @@ -502,7 +501,7 @@ g_part_gpt_modify(struct g_part_table *b return (0); } -static char * +static const char * g_part_gpt_name(struct g_part_table *table, struct g_part_entry *baseentry, char *buf, size_t bufsz) { Modified: head/sys/geom/part/g_part_pc98.c ============================================================================== --- head/sys/geom/part/g_part_pc98.c Tue Feb 10 01:39:55 2009 (r188428) +++ head/sys/geom/part/g_part_pc98.c Tue Feb 10 02:43:07 2009 (r188429) @@ -71,12 +71,12 @@ static int g_part_pc98_add(struct g_part static int g_part_pc98_bootcode(struct g_part_table *, struct g_part_parms *); static int g_part_pc98_create(struct g_part_table *, struct g_part_parms *); static int g_part_pc98_destroy(struct g_part_table *, struct g_part_parms *); -static int g_part_pc98_dumpconf(struct g_part_table *, struct g_part_entry *, +static void g_part_pc98_dumpconf(struct g_part_table *, struct g_part_entry *, struct sbuf *, const char *); static int g_part_pc98_dumpto(struct g_part_table *, struct g_part_entry *); static int g_part_pc98_modify(struct g_part_table *, struct g_part_entry *, struct g_part_parms *); -static char *g_part_pc98_name(struct g_part_table *, struct g_part_entry *, +static const char *g_part_pc98_name(struct g_part_table *, struct g_part_entry *, char *, size_t); static int g_part_pc98_probe(struct g_part_table *, struct g_consumer *); static int g_part_pc98_read(struct g_part_table *, struct g_consumer *); @@ -257,7 +257,7 @@ g_part_pc98_destroy(struct g_part_table return (0); } -static int +static void g_part_pc98_dumpconf(struct g_part_table *table, struct g_part_entry *baseentry, struct sbuf *sb, const char *indent) { @@ -268,7 +268,6 @@ g_part_pc98_dumpconf(struct g_part_table entry = (struct g_part_pc98_entry *)baseentry; if (entry == NULL) { /* confxml: scheme information */ - return (0); } type = entry->ent.dp_mid + (entry->ent.dp_sid << 8); @@ -288,7 +287,6 @@ g_part_pc98_dumpconf(struct g_part_table sbuf_printf(sb, "%s%u\n", indent, type & 0x7f7f); } - return (0); } static int @@ -318,7 +316,7 @@ g_part_pc98_modify(struct g_part_table * return (0); } -static char * +static const char * g_part_pc98_name(struct g_part_table *table, struct g_part_entry *baseentry, char *buf, size_t bufsz) { Modified: head/sys/geom/part/g_part_vtoc8.c ============================================================================== --- head/sys/geom/part/g_part_vtoc8.c Tue Feb 10 01:39:55 2009 (r188428) +++ head/sys/geom/part/g_part_vtoc8.c Tue Feb 10 02:43:07 2009 (r188429) @@ -55,12 +55,12 @@ static int g_part_vtoc8_add(struct g_par struct g_part_parms *); static int g_part_vtoc8_create(struct g_part_table *, struct g_part_parms *); static int g_part_vtoc8_destroy(struct g_part_table *, struct g_part_parms *); -static int g_part_vtoc8_dumpconf(struct g_part_table *, struct g_part_entry *, +static void g_part_vtoc8_dumpconf(struct g_part_table *, struct g_part_entry *, struct sbuf *, const char *); static int g_part_vtoc8_dumpto(struct g_part_table *, struct g_part_entry *); static int g_part_vtoc8_modify(struct g_part_table *, struct g_part_entry *, struct g_part_parms *); -static char *g_part_vtoc8_name(struct g_part_table *, struct g_part_entry *, +static const char *g_part_vtoc8_name(struct g_part_table *, struct g_part_entry *, char *, size_t); static int g_part_vtoc8_probe(struct g_part_table *, struct g_consumer *); static int g_part_vtoc8_read(struct g_part_table *, struct g_consumer *); @@ -238,7 +238,7 @@ g_part_vtoc8_destroy(struct g_part_table return (0); } -static int +static void g_part_vtoc8_dumpconf(struct g_part_table *basetable, struct g_part_entry *entry, struct sbuf *sb, const char *indent) { @@ -257,7 +257,6 @@ g_part_vtoc8_dumpconf(struct g_part_tabl } else { /* confxml: scheme information */ } - return (0); } static int @@ -297,7 +296,7 @@ g_part_vtoc8_modify(struct g_part_table return (0); } -static char * +static const char * g_part_vtoc8_name(struct g_part_table *table, struct g_part_entry *baseentry, char *buf, size_t bufsz) { From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 03:12:09 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E24DB106566B; Tue, 10 Feb 2009 03:12:09 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout021.mac.com (asmtpout021.mac.com [17.148.16.96]) by mx1.freebsd.org (Postfix) with ESMTP id CB36D8FC16; Tue, 10 Feb 2009 03:12:09 +0000 (UTC) (envelope-from xcllnt@mac.com) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=US-ASCII; format=flowed Received: from skongara-t61.jnpr.net (natint3.juniper.net [66.129.224.36]) by asmtp021.mac.com (Sun Java(tm) System Messaging Server 6.3-7.03 (built Aug 7 2008; 32bit)) with ESMTPSA id <0KET008NQY7UJ310@asmtp021.mac.com>; Mon, 09 Feb 2009 19:11:55 -0800 (PST) Message-id: From: Marcel Moolenaar To: Warner Losh In-reply-to: <200902100243.n1A2h7Ou078698@svn.freebsd.org> Date: Mon, 09 Feb 2009 19:11:54 -0800 References: <200902100243.n1A2h7Ou078698@svn.freebsd.org> X-Mailer: Apple Mail (2.930.3) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r188429 - head/sys/geom/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Feb 2009 03:12:10 -0000 On Feb 9, 2009, at 6:43 PM, Warner Losh wrote: > Author: imp > Date: Tue Feb 10 02:43:07 2009 > New Revision: 188429 > URL: http://svn.freebsd.org/changeset/base/188429 > > Log: > Fix g_part_dumpconf and g_part_name prototpyes. Thanks! -- Marcel Moolenaar xcllnt@mac.com From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 04:06:08 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A7CBC106566B; Tue, 10 Feb 2009 04:06:08 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 4CE3B8FC13; Tue, 10 Feb 2009 04:06:08 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id n1A46194035270; Mon, 9 Feb 2009 21:06:01 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Mon, 09 Feb 2009 21:06:00 -0700 (MST) Message-Id: <20090209.210600.1656127741.imp@bsdimp.com> To: xcllnt@mac.com From: "M. Warner Losh" In-Reply-To: References: <200902100243.n1A2h7Ou078698@svn.freebsd.org> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r188429 - head/sys/geom/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Feb 2009 04:06:09 -0000 In message: Marcel Moolenaar writes: : : On Feb 9, 2009, at 6:43 PM, Warner Losh wrote: : : > Author: imp : > Date: Tue Feb 10 02:43:07 2009 : > New Revision: 188429 : > URL: http://svn.freebsd.org/changeset/base/188429 : > : > Log: : > Fix g_part_dumpconf and g_part_name prototpyes. : : Thanks! de nada. Warner From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 06:08:29 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 003D01065674; Tue, 10 Feb 2009 06:08:28 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E2ED18FC13; Tue, 10 Feb 2009 06:08:28 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1A68SQL083178; Tue, 10 Feb 2009 06:08:28 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1A68SYW083177; Tue, 10 Feb 2009 06:08:28 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <200902100608.n1A68SYW083177@svn.freebsd.org> From: Alan Cox Date: Tue, 10 Feb 2009 06:08:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188431 - head/sys/mips/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Feb 2009 06:08:29 -0000 Author: alc Date: Tue Feb 10 06:08:28 2009 New Revision: 188431 URL: http://svn.freebsd.org/changeset/base/188431 Log: Eliminate an unused definition. Modified: head/sys/mips/include/pmap.h Modified: head/sys/mips/include/pmap.h ============================================================================== --- head/sys/mips/include/pmap.h Tue Feb 10 04:56:08 2009 (r188430) +++ head/sys/mips/include/pmap.h Tue Feb 10 06:08:28 2009 (r188431) @@ -156,7 +156,6 @@ extern vm_paddr_t mips_wired_tlb_physmem extern u_int need_wired_tlb_page_pool; #define pmap_page_is_mapped(m) (!TAILQ_EMPTY(&(m)->md.pv_list)) -#define pmap_kernel() kernel_pmap void pmap_bootstrap(void); void *pmap_mapdev(vm_offset_t, vm_size_t); From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 08:21:59 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E62711065676; Tue, 10 Feb 2009 08:21:59 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BA4D58FC1B; Tue, 10 Feb 2009 08:21:59 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1A8Lx19085947; Tue, 10 Feb 2009 08:21:59 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1A8Lxj2085946; Tue, 10 Feb 2009 08:21:59 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <200902100821.n1A8Lxj2085946@svn.freebsd.org> From: Edwin Groothuis Date: Tue, 10 Feb 2009 08:21:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188436 - head/share/zoneinfo X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Feb 2009 08:22:01 -0000 Author: edwin Date: Tue Feb 10 08:21:59 2009 New Revision: 188436 URL: http://svn.freebsd.org/changeset/base/188436 Log: MFV of tzdata2009b. - Updated leapseconds (but that one was already commited earlier phk@ without it going through the proper path) MFC after: 1 week Modified: head/share/zoneinfo/ (props changed) From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 12:19:34 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B4F610659D7; Tue, 10 Feb 2009 12:19:34 +0000 (UTC) (envelope-from gary.jennejohn@freenet.de) Received: from mout0.freenet.de (mout0.freenet.de [IPv6:2001:748:100:40::2:2]) by mx1.freebsd.org (Postfix) with ESMTP id 1906F8FC19; Tue, 10 Feb 2009 12:19:32 +0000 (UTC) (envelope-from gary.jennejohn@freenet.de) Received: from [195.4.92.22] (helo=12.mx.freenet.de) by mout0.freenet.de with esmtpa (ID gary.jennejohn@freenet.de) (port 25) (Exim 4.69 #76) id 1LWraM-0001xZ-Vg; Tue, 10 Feb 2009 13:19:30 +0100 Received: from tc24c.t.pppool.de ([89.55.194.76]:64959 helo=ernst.jennejohn.org) by 12.mx.freenet.de with esmtpa (ID gary.jennejohn@freenet.de) (port 25) (Exim 4.69 #76) id 1LWraM-0000jL-Nq; Tue, 10 Feb 2009 13:19:30 +0100 Date: Tue, 10 Feb 2009 13:19:30 +0100 From: Gary Jennejohn To: Pyun YongHyeon Message-ID: <20090210131930.16d0882c@ernst.jennejohn.org> In-Reply-To: <20090210005002.GD98095@michelle.cdnetworks.co.kr> References: <200902090459.n194xDa3045928@svn.freebsd.org> <20090209181056.40db0ba2@ernst.jennejohn.org> <20090210005002.GD98095@michelle.cdnetworks.co.kr> X-Mailer: Claws Mail 3.7.0 (GTK+ 2.14.7; amd64-portbld-freebsd8.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r188381 - head/sys/dev/re X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: gary.jennejohn@freenet.de List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Feb 2009 12:19:52 -0000 On Tue, 10 Feb 2009 09:50:02 +0900 Pyun YongHyeon wrote: [re0 fails to work with MSI] > It seems that broken controllers have two MSI messages. Instead of > reverting the change, how about attached patch? This patch fixes the problem. Thanks! --- Gary Jennejohn From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 14:04:37 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76B37106567A; Tue, 10 Feb 2009 14:04:37 +0000 (UTC) (envelope-from p.pisati@oltrelinux.com) Received: from joe.mail.tiscali.it (joe.mail.tiscali.it [213.205.33.54]) by mx1.freebsd.org (Postfix) with ESMTP id F22D88FC1F; Tue, 10 Feb 2009 14:04:36 +0000 (UTC) (envelope-from p.pisati@oltrelinux.com) Received: from newluxor.wired.org (94.36.96.185) by joe.mail.tiscali.it (8.0.022) id 496E020E017F6E68; Tue, 10 Feb 2009 14:52:54 +0100 Message-ID: <499186B0.6030109@oltrelinux.com> Date: Tue, 10 Feb 2009 14:52:48 +0100 From: Paolo Pisati User-Agent: Thunderbird 2.0.0.18 (X11/20081214) MIME-Version: 1.0 To: Randall Stewart References: <200902091142.n19BgNnb059032@svn.freebsd.org> <20090209124141.GA2071@dchagin.static.corbina.ru> <32F47187-B1D5-4EE3-A1ED-0FE4CD5998AC@lakerest.net> In-Reply-To: <32F47187-B1D5-4EE3-A1ED-0FE4CD5998AC@lakerest.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Chagin Dmitry Subject: Re: svn commit: r188388 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Feb 2009 14:04:38 -0000 Randall Stewart wrote: > Hmm.. > > My guess is it has to do with the NAT stuff that > Paolo is working on. Basically the ipfw/nat is becoming > SCTP aware and I believe we made the sctp_crc32c routines > public so that he could access them. > > Paolo: maybe you need to include and then do > some sort of > > #ifdef SCTP > > #endif > > Around the csum calls int crc32?? the problem with opt_scpt is that it's not available during module compilation. my other solution: -we define 2 functions ptrs: update_crc32_ptr and sctp_finalize_crc32_ptr, and initialize them with NULL -during the SCPT initialization path, we set those 2 ptrs to point to the actual SCTP functions -in alias_sctp.c, we check the value: -in case it's NULL, SCTP wasn't compiled in and thus we return 0 -else we call the pointed functions the only remaining open problem is where to put these 2 ptrs: it has to be a place that is always compiled in, but on the other hand we should limit pollution. From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 15:03:08 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 681171065692; Tue, 10 Feb 2009 15:03:08 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 568478FC29; Tue, 10 Feb 2009 15:03:08 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1AF382M096688; Tue, 10 Feb 2009 15:03:08 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1AF38Ac096687; Tue, 10 Feb 2009 15:03:08 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <200902101503.n1AF38Ac096687@svn.freebsd.org> From: Ken Smith Date: Tue, 10 Feb 2009 15:03:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188437 - head/release X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Feb 2009 15:03:09 -0000 Author: kensmith Date: Tue Feb 10 15:03:08 2009 New Revision: 188437 URL: http://svn.freebsd.org/changeset/base/188437 Log: Turn off the building of boot floppies for amd64/i386. Modified: head/release/Makefile Modified: head/release/Makefile ============================================================================== --- head/release/Makefile Tue Feb 10 08:21:59 2009 (r188436) +++ head/release/Makefile Tue Feb 10 15:03:08 2009 (r188437) @@ -67,8 +67,8 @@ PORTSRELEASETAG?= ${AUXRELEASETAG} # If you want to pass flags to the world build such as -j X, use # WORLD_FLAGS. Similarly, you can specify make flags for kernel # builds via KERNEL_FLAGS. -#WORLD_FLAGS=-j4 -#KERNEL_FLAGS=-j4 +WORLD_FLAGS=-j4 +KERNEL_FLAGS=-j4 TARGET_ARCH?= ${MACHINE_ARCH} .if ${TARGET_ARCH} == ${MACHINE_ARCH} @@ -191,7 +191,6 @@ MNT= /mnt .undef MAKE_FLOPPIES .if ${TARGET_ARCH} == "i386" -MAKE_FLOPPIES= true MAKE_DVD= SEPARATE_LIVEFS= SPLIT_MFSROOT= @@ -223,7 +222,6 @@ MFSINODE= 8192 MFSLABEL= auto SEPARATE_LIVEFS= .elif ${TARGET_ARCH} == "amd64" -MAKE_FLOPPIES= true MAKE_DVD= FLOPPYSIZE= 1440 FLOPPYSPLITSIZE= 1392 From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 15:05:30 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AB0341065670; Tue, 10 Feb 2009 15:05:30 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (77-93-215-190.static.masterinter.net [77.93.215.190]) by mx1.freebsd.org (Postfix) with ESMTP id 4D9C38FC19; Tue, 10 Feb 2009 15:05:29 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from localhost (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id C97F09CB04E; Tue, 10 Feb 2009 16:02:40 +0100 (CET) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by localhost (lev.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VUUqcTm38lbM; Tue, 10 Feb 2009 16:02:38 +0100 (CET) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 07B4D9CB141; Tue, 10 Feb 2009 16:02:38 +0100 (CET) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.14.3/8.14.3/Submit) id n1AF2bfh015927; Tue, 10 Feb 2009 16:02:37 +0100 (CET) (envelope-from rdivacky) Date: Tue, 10 Feb 2009 16:02:37 +0100 From: Roman Divacky To: Ken Smith Message-ID: <20090210150237.GA15859@freebsd.org> References: <200902101503.n1AF38Ac096687@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200902101503.n1AF38Ac096687@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r188437 - head/release X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Feb 2009 15:05:31 -0000 On Tue, Feb 10, 2009 at 03:03:08PM +0000, Ken Smith wrote: > Author: kensmith > Date: Tue Feb 10 15:03:08 2009 > New Revision: 188437 > URL: http://svn.freebsd.org/changeset/base/188437 > > Log: > Turn off the building of boot floppies for amd64/i386. > > Modified: > head/release/Makefile > > Modified: head/release/Makefile > ============================================================================== > --- head/release/Makefile Tue Feb 10 08:21:59 2009 (r188436) > +++ head/release/Makefile Tue Feb 10 15:03:08 2009 (r188437) > @@ -67,8 +67,8 @@ PORTSRELEASETAG?= ${AUXRELEASETAG} > # If you want to pass flags to the world build such as -j X, use > # WORLD_FLAGS. Similarly, you can specify make flags for kernel > # builds via KERNEL_FLAGS. > -#WORLD_FLAGS=-j4 > -#KERNEL_FLAGS=-j4 > +WORLD_FLAGS=-j4 > +KERNEL_FLAGS=-j4 was this intentional? From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 15:07:57 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5ECBB1065672; Tue, 10 Feb 2009 15:07:57 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4D0138FC1F; Tue, 10 Feb 2009 15:07:57 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1AF7vwo096809; Tue, 10 Feb 2009 15:07:57 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1AF7v9p096808; Tue, 10 Feb 2009 15:07:57 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <200902101507.n1AF7v9p096808@svn.freebsd.org> From: Ken Smith Date: Tue, 10 Feb 2009 15:07:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188438 - head/release/scripts X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Feb 2009 15:07:57 -0000 Author: kensmith Date: Tue Feb 10 15:07:57 2009 New Revision: 188438 URL: http://svn.freebsd.org/changeset/base/188438 Log: Due to some recent-ish work on GEOM/G_PART the c partition (by tradition the whole disk) isn't available any more since it was redundant. Just use /dev/md0 instead of /dev/md0c to build the filesystem on. Consulted-with: marcel Modified: head/release/scripts/doFS.sh Modified: head/release/scripts/doFS.sh ============================================================================== --- head/release/scripts/doFS.sh Tue Feb 10 15:03:08 2009 (r188437) +++ head/release/scripts/doFS.sh Tue Feb 10 15:07:57 2009 (r188438) @@ -73,8 +73,8 @@ dofs_md () { if [ "x${DISKLABEL}" != "x" ] ; then ${DISKLABEL} ${MACHINE} -w ${BOOT} ${MDDEVICE} ${FSLABEL} - newfs -O1 -i ${FSINODE} -o space -m 0 /dev/${MDDEVICE}c - mount /dev/${MDDEVICE}c ${MNT} + newfs -O1 -i ${FSINODE} -o space -m 0 /dev/${MDDEVICE} + mount /dev/${MDDEVICE} ${MNT} else newfs -O1 -i ${FSINODE} -o space -m 0 /dev/${MDDEVICE} mount /dev/${MDDEVICE} ${MNT} From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 15:11:26 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 83F77106566B; Tue, 10 Feb 2009 15:11:26 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 723438FC08; Tue, 10 Feb 2009 15:11:26 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1AFBQmT096923; Tue, 10 Feb 2009 15:11:26 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1AFBQXx096922; Tue, 10 Feb 2009 15:11:26 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <200902101511.n1AFBQXx096922@svn.freebsd.org> From: Ken Smith Date: Tue, 10 Feb 2009 15:11:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188439 - head/release X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Feb 2009 15:11:27 -0000 Author: kensmith Date: Tue Feb 10 15:11:26 2009 New Revision: 188439 URL: http://svn.freebsd.org/changeset/base/188439 Log: Turn off the parallel make options accidentally turned on by the previous commit. Sigh. Noticed by: rdivacky Modified: head/release/Makefile Modified: head/release/Makefile ============================================================================== --- head/release/Makefile Tue Feb 10 15:07:57 2009 (r188438) +++ head/release/Makefile Tue Feb 10 15:11:26 2009 (r188439) @@ -67,8 +67,8 @@ PORTSRELEASETAG?= ${AUXRELEASETAG} # If you want to pass flags to the world build such as -j X, use # WORLD_FLAGS. Similarly, you can specify make flags for kernel # builds via KERNEL_FLAGS. -WORLD_FLAGS=-j4 -KERNEL_FLAGS=-j4 +#WORLD_FLAGS=-j4 +#KERNEL_FLAGS=-j4 TARGET_ARCH?= ${MACHINE_ARCH} .if ${TARGET_ARCH} == ${MACHINE_ARCH} From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 15:17:10 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 22262106564A; Tue, 10 Feb 2009 15:17:10 +0000 (UTC) (envelope-from ivoras@gmail.com) Received: from mail-bw0-f163.google.com (mail-bw0-f163.google.com [209.85.218.163]) by mx1.freebsd.org (Postfix) with ESMTP id 1B2308FC08; Tue, 10 Feb 2009 15:17:08 +0000 (UTC) (envelope-from ivoras@gmail.com) Received: by bwz7 with SMTP id 7so3134291bwz.19 for ; Tue, 10 Feb 2009 07:17:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type:content-transfer-encoding; bh=pq94ArDy/C+Pohp6WjPN43Es3JaaRcnY6yAR5p0jtks=; b=g+xoZOw66bszLlbOsIcu+Wb/TJDOQoCfMxjT5sO5FixM5AGvcaN7M+GLi3kING8LtT B/1lAD4b2G7uhETMQxD0ghJRLoI9GLGxz7LLh1r4XKOU9kY40DoemgSucG61mvcDqHgy H+7xfgScvGo0mQwT7QnLVgWtZaDpHam1Tu8uA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=dZ1qF4dPDr/s1w9+a/yGvCTh2lxT/aebpU+PPLOaI8dGM8jQxJ1w32xNEJfUmcxdVO F4OvvS7J4DGzQgyj+FQZGWFvGrUECNG+RptF5Ni8fV0yGmHiNGkr2c0wja81rh1SAbqa /cbBrbb6mX2aMXeP/MPlo40xCI+h0YW+goDvw= MIME-Version: 1.0 Sender: ivoras@gmail.com Received: by 10.180.235.10 with SMTP id i10mr204823bkh.58.1234279028102; Tue, 10 Feb 2009 07:17:08 -0800 (PST) In-Reply-To: <200902101511.n1AFBQXx096922@svn.freebsd.org> References: <200902101511.n1AFBQXx096922@svn.freebsd.org> Date: Tue, 10 Feb 2009 16:17:08 +0100 X-Google-Sender-Auth: 1a195cb03cbf6fd1 Message-ID: <9bbcef730902100717x1cd1118bg1d2683a42a25232@mail.gmail.com> From: Ivan Voras To: Ken Smith Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r188439 - head/release X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Feb 2009 15:17:10 -0000 2009/2/10 Ken Smith : > Author: kensmith > Date: Tue Feb 10 15:11:26 2009 > New Revision: 188439 > URL: http://svn.freebsd.org/changeset/base/188439 > > Log: > Turn off the parallel make options accidentally turned on by the previous > commit. Sigh. > -WORLD_FLAGS=-j4 > -KERNEL_FLAGS=-j4 > +#WORLD_FLAGS=-j4 > +#KERNEL_FLAGS=-j4 And here I was happy that it finally happened (e.g. became practically official that It Works) :( What's keeping it still in the realm of "not recommended"? I haven't had problems building with -jX in the past years, even with high values of X (>=8). Also, what about kernel modules? AFAIK they are always built serialized? From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 15:42:15 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 607CF106566B; Tue, 10 Feb 2009 15:42:15 +0000 (UTC) (envelope-from kensmith@cse.Buffalo.EDU) Received: from phoebe.cse.buffalo.edu (phoebe.cse.buffalo.edu [128.205.32.89]) by mx1.freebsd.org (Postfix) with ESMTP id 02AA68FC18; Tue, 10 Feb 2009 15:42:14 +0000 (UTC) (envelope-from kensmith@cse.Buffalo.EDU) Received: from [128.205.32.76] (bauer.cse.buffalo.edu [128.205.32.76]) (authenticated bits=0) by phoebe.cse.buffalo.edu (8.14.1/8.13.7) with ESMTP id n1AFQOdm028158 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 10 Feb 2009 10:26:26 -0500 (EST) (envelope-from kensmith@cse.buffalo.edu) From: Ken Smith To: Ivan Voras In-Reply-To: <9bbcef730902100717x1cd1118bg1d2683a42a25232@mail.gmail.com> References: <200902101511.n1AFBQXx096922@svn.freebsd.org> <9bbcef730902100717x1cd1118bg1d2683a42a25232@mail.gmail.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-wM8mCPaBI20tD+eM0Qa1" Organization: U. Buffalo CSE Department Date: Tue, 10 Feb 2009 10:26:24 -0500 Message-Id: <1234279584.65150.13.camel@bauer.cse.buffalo.edu> Mime-Version: 1.0 X-Mailer: Evolution 2.22.3.1 FreeBSD GNOME Team Port X-DCC-Buffalo.EDU-Metrics: phoebe.cse.buffalo.edu 1336; Body=0 Fuz1=0 Fuz2=0 X-Spam-Status: No, score=-4.0 required=5.0 tests=RCVD_IN_DNSWL_MED autolearn=failed version=3.2.3 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on phoebe.cse.buffalo.edu Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Ken Smith Subject: Re: svn commit: r188439 - head/release X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Feb 2009 15:42:15 -0000 --=-wM8mCPaBI20tD+eM0Qa1 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Tue, 2009-02-10 at 16:17 +0100, Ivan Voras wrote: > 2009/2/10 Ken Smith : > > Author: kensmith > > Date: Tue Feb 10 15:11:26 2009 > > New Revision: 188439 > > URL: http://svn.freebsd.org/changeset/base/188439 > > > > Log: > > Turn off the parallel make options accidentally turned on by the previ= ous > > commit. Sigh. >=20 > > -WORLD_FLAGS=3D-j4 > > -KERNEL_FLAGS=3D-j4 > > +#WORLD_FLAGS=3D-j4 > > +#KERNEL_FLAGS=3D-j4 >=20 > And here I was happy that it finally happened (e.g. became practically > official that It Works) :( >=20 > What's keeping it still in the realm of "not recommended"? I haven't > had problems building with -jX in the past years, even with high > values of X (>=3D8). >=20 I wasn't interested in getting into that discussion at this point but I don't mind if it happens. As shown by my accident I do tend to turn it on in my trees where I'm doing release builds, testing or otherwise (e.g. it's turned on in the trees I do the monthly snapshots in). I wouldn't mind if it got turned on but that's just the first of two questions. The second question is what to set it to. What's best for that depends on how many CPUs you've got and/or how much of your machine you want the build to consume (you might want to be doing other stuff on the machine while the build is running...). IMHO it might be best to just leave it as-is and let anyone interested in getting better performance set it to what's appropriate for their machine but if others feel differently I won't object. --=20 Ken Smith - From there to here, from here to | kensmith@cse.buffalo.edu there, funny things are everywhere. | - Theodore Geisel | --=-wM8mCPaBI20tD+eM0Qa1 Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEABECAAYFAkmRnKAACgkQ/G14VSmup/ZKuwCdGc5rnBFA82wHdW30ZeOGVPs8 jvgAnRxaMS6/dPzfVDChpTlls0oWWX/E =/cuC -----END PGP SIGNATURE----- --=-wM8mCPaBI20tD+eM0Qa1-- From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 15:50:19 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EAB841065677; Tue, 10 Feb 2009 15:50:19 +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 BEBA48FC25; Tue, 10 Feb 2009 15:50:19 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1AFoJjJ097640; Tue, 10 Feb 2009 15:50:19 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1AFoJoj097637; Tue, 10 Feb 2009 15:50:19 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <200902101550.n1AFoJoj097637@svn.freebsd.org> From: Attilio Rao Date: Tue, 10 Feb 2009 15:50:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188440 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Feb 2009 15:50:20 -0000 Author: attilio Date: Tue Feb 10 15:50:19 2009 New Revision: 188440 URL: http://svn.freebsd.org/changeset/base/188440 Log: Scanning all the formats for binary translation of modules loading can result in errors for a format loading but subsequent correct recognizing for another format. File format loading functions should avoid printing any additional informations but just returning appropriate (and different between each other) error condition, characterizing different informations. Additively, the linker should handle appropriately different format loading errors. While a general mechanism is desired, fix a simple and common case on amd64: file type is not recognized for link elf and confuses the linker. Printout an error if all the registered linker classes can't recognize and load the module. Reviewed by: jhb Sponsored by: Sandvine Incorporated Modified: head/sys/kern/kern_linker.c head/sys/kern/link_elf.c head/sys/kern/link_elf_obj.c Modified: head/sys/kern/kern_linker.c ============================================================================== --- head/sys/kern/kern_linker.c Tue Feb 10 15:11:26 2009 (r188439) +++ head/sys/kern/kern_linker.c Tue Feb 10 15:50:19 2009 (r188440) @@ -425,6 +425,14 @@ linker_load_file(const char *filename, l * the module was not found. */ if (foundfile) { + + /* + * If the file type has not been recognized by the last try + * printout a message before to fail. + */ + if (error == ENOSYS) + printf("linker_load_file: Unsupported file type\n"); + /* * Format not recognized or otherwise unloadable. * When loading a module that is statically built into Modified: head/sys/kern/link_elf.c ============================================================================== --- head/sys/kern/link_elf.c Tue Feb 10 15:11:26 2009 (r188439) +++ head/sys/kern/link_elf.c Tue Feb 10 15:50:19 2009 (r188440) @@ -638,8 +638,7 @@ link_elf_load_file(linker_class_t cls, c goto out; } if (hdr->e_type != ET_EXEC && hdr->e_type != ET_DYN) { - link_elf_error(filename, "Unsupported file type"); - error = ENOEXEC; + error = ENOSYS; goto out; } if (hdr->e_machine != ELF_TARG_MACH) { @@ -694,8 +693,7 @@ link_elf_load_file(linker_class_t cls, c break; case PT_INTERP: - link_elf_error(filename, "Unsupported file type"); - error = ENOEXEC; + error = ENOSYS; goto out; } Modified: head/sys/kern/link_elf_obj.c ============================================================================== --- head/sys/kern/link_elf_obj.c Tue Feb 10 15:11:26 2009 (r188439) +++ head/sys/kern/link_elf_obj.c Tue Feb 10 15:50:19 2009 (r188440) @@ -474,8 +474,7 @@ link_elf_load_file(linker_class_t cls, c goto out; } if (hdr->e_type != ET_REL) { - link_elf_error(filename, "Unsupported file type"); - error = ENOEXEC; + error = ENOSYS; goto out; } if (hdr->e_machine != ELF_TARG_MACH) { From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 15:53:55 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A3AC10656E6; Tue, 10 Feb 2009 15:53:55 +0000 (UTC) (envelope-from ivoras@gmail.com) Received: from mail-bw0-f163.google.com (mail-bw0-f163.google.com [209.85.218.163]) by mx1.freebsd.org (Postfix) with ESMTP id 62CF18FC18; Tue, 10 Feb 2009 15:53:54 +0000 (UTC) (envelope-from ivoras@gmail.com) Received: by bwz7 with SMTP id 7so3188033bwz.19 for ; Tue, 10 Feb 2009 07:53:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type:content-transfer-encoding; bh=FyPLHT+VDvle/RJQsC9L4/WTT4m+FXwp07vRJXe4Wpc=; b=QPs+CRVyKS3AcsOY9pMqzXoicrF9SIVgJ9j5kXoR4WwkDrYrk1MN+C2+zZUnYID42P BBrm5smHXxOJY61llBCtdgbxAaN6yc6naqkWQ19wn+kZiCHg7c7mrA6DgWS/8lgDn8tz LhdcP+1ed6NrGuPwvBI0qFaNY8jukHMTySmuA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=kPCPZyoOS0LPPwagrmEq2ZIS1+Z7VGooJxiJvSRiDYS2ow9SO4QUTss1tQUlxAb3hy p4uDDE4o+lrcCknsmimnTxqcQa9edmSBqGlCuxJqost6bTfQPT3cAGRflXrDC9lukY+z INIKpCP2ZKvkDgRnNR6qIDSdhVIGmZZPHcszo= MIME-Version: 1.0 Sender: ivoras@gmail.com Received: by 10.181.5.1 with SMTP id h1mr1612612bki.56.1234281232943; Tue, 10 Feb 2009 07:53:52 -0800 (PST) In-Reply-To: <1234279584.65150.13.camel@bauer.cse.buffalo.edu> References: <200902101511.n1AFBQXx096922@svn.freebsd.org> <9bbcef730902100717x1cd1118bg1d2683a42a25232@mail.gmail.com> <1234279584.65150.13.camel@bauer.cse.buffalo.edu> Date: Tue, 10 Feb 2009 16:53:52 +0100 X-Google-Sender-Auth: 645230cf8c8edd3a Message-ID: <9bbcef730902100753p484d633j29829019064e71bf@mail.gmail.com> From: Ivan Voras To: Ken Smith Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r188439 - head/release X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Feb 2009 15:53:56 -0000 2009/2/10 Ken Smith : > I wouldn't mind if it got turned on but that's just the first of two > questions. The second question is what to set it to. What's best for > that depends on how many CPUs you've got and/or how much of your machine > you want the build to consume (you might want to be doing other stuff on > the machine while the build is running...). IMHO it might be best to > just leave it as-is and let anyone interested in getting better > performance set it to what's appropriate for their machine but if others > feel differently I won't object. I was think more about the semi-supported state that the -jX traditionally has - it's usually something like "yes, it's there and probably everyone uses it but we won't even suggest it actually works". Having it on in the official release process will signal official support to users and encourage them to use it. From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 16:30:13 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DAFE41065674 for ; Tue, 10 Feb 2009 16:30:13 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-bw0-f163.google.com (mail-bw0-f163.google.com [209.85.218.163]) by mx1.freebsd.org (Postfix) with ESMTP id 5D1D28FC17 for ; Tue, 10 Feb 2009 16:30:13 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: by bwz7 with SMTP id 7so3242586bwz.19 for ; Tue, 10 Feb 2009 08:30:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type:content-transfer-encoding; bh=I9dOmw0jsJ5CtzU56lJ/hX1MoEBre+GABL/s3aRe1Nk=; b=kpFxgZfUZsJz9yScd5T4OmOULP/ie9TJUny4KSgVjsB+t9LLTsyX81sI6CQwy8vBnZ 03T9b8K57IoQkfAaSLmsdqwzYNYvVDn2OsSuR+WE/+LJqAmlzJOm8GbbYAneKh9q9zEh slY6CVPhuTKkFaJB7fC4VMi5tz91vG9OyxgMQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=p6JcdnUyeMoQ+bElyStgQxULUPwG9ZNtwzl/krhmK3j3nZgKAS28yV8pteXTkcoL8x kkGi05ttJs9N9dJbDsgmFv4HkQfdoRJ+Biu/fcKPO+lEmSfxSqjndkgO4L0vMYhxZJl7 UTnFed7VTq3bcF45eoHXN3jgGJGa5/S30cM2M= MIME-Version: 1.0 Sender: asmrookie@gmail.com Received: by 10.223.107.76 with SMTP id a12mr52766fap.29.1234281937283; Tue, 10 Feb 2009 08:05:37 -0800 (PST) In-Reply-To: <200902101550.n1AFoJoj097637@svn.freebsd.org> References: <200902101550.n1AFoJoj097637@svn.freebsd.org> Date: Tue, 10 Feb 2009 17:05:37 +0100 X-Google-Sender-Auth: a3e8bc9f26cf4fc5 Message-ID: <3bbf2fe10902100805l3362c59rda140f07fc43347f@mail.gmail.com> From: Attilio Rao To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: Subject: Re: svn commit: r188440 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Feb 2009 16:30:14 -0000 2009/2/10, Attilio Rao : > Author: attilio > Date: Tue Feb 10 15:50:19 2009 > New Revision: 188440 > URL: http://svn.freebsd.org/changeset/base/188440 > > Log: > Scanning all the formats for binary translation of modules loading can > result in errors for a format loading but subsequent correct recognizing > for another format. > > File format loading functions should avoid printing any additional > informations but just returning appropriate (and different between each > other) error condition, characterizing different informations. > Additively, the linker should handle appropriately different format > loading errors. > > While a general mechanism is desired, fix a simple and common case on > amd64: file type is not recognized for link elf and confuses the linker. > Printout an error if all the registered linker classes can't recognize > and load the module. > > Reviewed by: jhb > Sponsored by: Sandvine Incorporated I should have specify it refers to PR: amd64/117186. Sorry. Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 17:32:16 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 361EF106564A; Tue, 10 Feb 2009 17:32:16 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from out1.smtp.messagingengine.com (out1.smtp.messagingengine.com [66.111.4.25]) by mx1.freebsd.org (Postfix) with ESMTP id F23598FC0C; Tue, 10 Feb 2009 17:32:15 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from compute1.internal (compute1.internal [10.202.2.41]) by out1.messagingengine.com (Postfix) with ESMTP id 59580290498; Tue, 10 Feb 2009 12:32:15 -0500 (EST) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute1.internal (MEProxy); Tue, 10 Feb 2009 12:32:15 -0500 X-Sasl-enc: dC1lz88pDgy7e966gzTr2K06+iShbubYwMWXoLb34id/ 1234287135 Received: from empiric.lon.incunabulum.net (82-35-112-254.cable.ubr07.dals.blueyonder.co.uk [82.35.112.254]) by mail.messagingengine.com (Postfix) with ESMTPSA id 028DD38DA5; Tue, 10 Feb 2009 12:32:13 -0500 (EST) Message-ID: <4991BA1C.4020209@FreeBSD.org> Date: Tue, 10 Feb 2009 17:32:12 +0000 From: "Bruce M. Simpson" User-Agent: Thunderbird 2.0.0.19 (X11/20090126) MIME-Version: 1.0 To: Ken Smith References: <200902101511.n1AFBQXx096922@svn.freebsd.org> <9bbcef730902100717x1cd1118bg1d2683a42a25232@mail.gmail.com> <1234279584.65150.13.camel@bauer.cse.buffalo.edu> In-Reply-To: <1234279584.65150.13.camel@bauer.cse.buffalo.edu> X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Ivan Voras , Ken Smith Subject: Re: svn commit: r188439 - head/release X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Feb 2009 17:32:16 -0000 I'd argue -j2 is appropriate, given that it is reasonable to assume most of the user base still have uniprocessor systems. I have only one dual-core box, and -j2 will still cause at least one make(1) child process to run at any given time on each core -- it seems like the right compromise. From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 19:23:25 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 808C11065676; Tue, 10 Feb 2009 19:23:25 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6D8248FC17; Tue, 10 Feb 2009 19:23:25 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1AJNP37001981; Tue, 10 Feb 2009 19:23:25 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1AJNPtn001980; Tue, 10 Feb 2009 19:23:25 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902101923.n1AJNPtn001980@svn.freebsd.org> From: Sam Leffler Date: Tue, 10 Feb 2009 19:23:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188444 - head/sys/dev/ath/ath_hal/ar5212 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Feb 2009 19:23:26 -0000 Author: sam Date: Tue Feb 10 19:23:25 2009 New Revision: 188444 URL: http://svn.freebsd.org/changeset/base/188444 Log: consolidate conditional code Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_ani.c Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_ani.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_ani.c Tue Feb 10 17:50:03 2009 (r188443) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_ani.c Tue Feb 10 19:23:25 2009 (r188444) @@ -278,14 +278,12 @@ ar5212AniControl(struct ath_hal *ah, HAL if (on) { OS_REG_SET_BIT(ah, AR_PHY_SFCORR_LOW, AR_PHY_SFCORR_LOW_USE_SELF_CORR_LOW); + ahp->ah_stats.ast_ani_ofdmon++; } else { OS_REG_CLR_BIT(ah, AR_PHY_SFCORR_LOW, AR_PHY_SFCORR_LOW_USE_SELF_CORR_LOW); - } - if (on) - ahp->ah_stats.ast_ani_ofdmon++; - else ahp->ah_stats.ast_ani_ofdmoff++; + } aniState->ofdmWeakSigDetectOff = !on; break; } From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 19:25:12 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 24F19106566B; Tue, 10 Feb 2009 19:25:12 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 136688FC1E; Tue, 10 Feb 2009 19:25:12 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1AJPBdF002053; Tue, 10 Feb 2009 19:25:11 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1AJPBYd002051; Tue, 10 Feb 2009 19:25:11 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902101925.n1AJPBYd002051@svn.freebsd.org> From: Sam Leffler Date: Tue, 10 Feb 2009 19:25:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188445 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Feb 2009 19:25:12 -0000 Author: sam Date: Tue Feb 10 19:25:11 2009 New Revision: 188445 URL: http://svn.freebsd.org/changeset/base/188445 Log: on resume ah_curchan may be NULL if no channel change has been done; workaround this by passing net80211's channel as we know it'll never be null Submitted by: trasz Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Tue Feb 10 19:23:25 2009 (r188444) +++ head/sys/dev/ath/if_ath.c Tue Feb 10 19:25:11 2009 (r188445) @@ -1201,7 +1201,9 @@ ath_resume(struct ath_softc *sc) * Must reset the chip before we reload the * keycache as we were powered down on suspend. */ - ath_hal_reset(ah, sc->sc_opmode, sc->sc_curchan, AH_FALSE, &status); + ath_hal_reset(ah, sc->sc_opmode, + sc->sc_curchan != NULL ? sc->sc_curchan : ic->ic_curchan, + AH_FALSE, &status); ath_reset_keycache(sc); if (sc->sc_resume_up) { if (ic->ic_opmode == IEEE80211_M_STA) { From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 19:26:42 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B358C1065672; Tue, 10 Feb 2009 19:26:42 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A0C7F8FC29; Tue, 10 Feb 2009 19:26:42 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1AJQgCj002111; Tue, 10 Feb 2009 19:26:42 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1AJQgcD002109; Tue, 10 Feb 2009 19:26:42 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902101926.n1AJQgcD002109@svn.freebsd.org> From: Sam Leffler Date: Tue, 10 Feb 2009 19:26:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188446 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Feb 2009 19:26:43 -0000 Author: sam Date: Tue Feb 10 19:26:42 2009 New Revision: 188446 URL: http://svn.freebsd.org/changeset/base/188446 Log: add hw.ath.bstuck to control the stuck beacon threshold Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Tue Feb 10 19:25:11 2009 (r188445) +++ head/sys/dev/ath/if_ath.c Tue Feb 10 19:26:42 2009 (r188446) @@ -283,6 +283,10 @@ SYSCTL_INT(_hw_ath, OID_AUTO, txbuf, CTL 0, "tx buffers allocated"); TUNABLE_INT("hw.ath.txbuf", &ath_txbuf); +static int ath_bstuck_threshold = 4; /* max missed beacons */ +SYSCTL_INT(_hw_ath, OID_AUTO, bstuck, CTLFLAG_RW, &ath_bstuck_threshold, + 0, "max missed beacon xmits before chip reset"); + #ifdef ATH_DEBUG enum { ATH_DEBUG_XMIT = 0x00000001, /* basic xmit operation */ @@ -3118,7 +3122,7 @@ ath_beacon_proc(void *arg, int pending) DPRINTF(sc, ATH_DEBUG_BEACON, "%s: missed %u consecutive beacons\n", __func__, sc->sc_bmisscount); - if (sc->sc_bmisscount > 3) /* NB: 3 is a guess */ + if (sc->sc_bmisscount >= ath_bstuck_threshold) taskqueue_enqueue(sc->sc_tq, &sc->sc_bstucktask); return; } @@ -7612,7 +7616,7 @@ ath_tdma_beacon_send(struct ath_softc *s DPRINTF(sc, ATH_DEBUG_BEACON, "%s: missed %u consecutive beacons\n", __func__, sc->sc_bmisscount); - if (sc->sc_bmisscount > 3) /* NB: 3 is a guess */ + if (sc->sc_bmisscount >= ath_bstuck_threshold) taskqueue_enqueue(sc->sc_tq, &sc->sc_bstucktask); return; } From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 19:27:50 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 720B110656D5; Tue, 10 Feb 2009 19:27:50 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5F6B68FC15; Tue, 10 Feb 2009 19:27:50 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1AJRohF002166; Tue, 10 Feb 2009 19:27:50 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1AJRow1002164; Tue, 10 Feb 2009 19:27:50 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902101927.n1AJRow1002164@svn.freebsd.org> From: Sam Leffler Date: Tue, 10 Feb 2009 19:27:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188447 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Feb 2009 19:27:52 -0000 Author: sam Date: Tue Feb 10 19:27:50 2009 New Revision: 188447 URL: http://svn.freebsd.org/changeset/base/188447 Log: mark the CLR key installed for open auth stations such that it is reclaimed when net80211 tears down station state; without this we leak keycache slots Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Tue Feb 10 19:26:42 2009 (r188446) +++ head/sys/dev/ath/if_ath.c Tue Feb 10 19:27:50 2009 (r188447) @@ -6093,6 +6093,8 @@ ath_setup_stationkey(struct ieee80211_no /* XXX locking? */ ni->ni_ucastkey.wk_keyix = keyix; ni->ni_ucastkey.wk_rxkeyix = rxkeyix; + /* NB: must mark device key to get called back on delete */ + ni->ni_ucastkey.wk_flags |= IEEE80211_KEY_DEVKEY; IEEE80211_ADDR_COPY(ni->ni_ucastkey.wk_macaddr, ni->ni_macaddr); /* NB: this will create a pass-thru key entry */ ath_keyset(sc, &ni->ni_ucastkey, vap->iv_bss); From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 20:27:06 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0D3341065670; Tue, 10 Feb 2009 20:27:06 +0000 (UTC) (envelope-from emax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D472A8FC0C; Tue, 10 Feb 2009 20:27:05 +0000 (UTC) (envelope-from emax@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1AKR5No003529; Tue, 10 Feb 2009 20:27:05 GMT (envelope-from emax@svn.freebsd.org) Received: (from emax@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1AKR5V7003528; Tue, 10 Feb 2009 20:27:05 GMT (envelope-from emax@svn.freebsd.org) Message-Id: <200902102027.n1AKR5V7003528@svn.freebsd.org> From: Maksim Yevmenkin Date: Tue, 10 Feb 2009 20:27:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188452 - head/sys/netgraph/bluetooth/socket X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Feb 2009 20:27:07 -0000 Author: emax Date: Tue Feb 10 20:27:05 2009 New Revision: 188452 URL: http://svn.freebsd.org/changeset/base/188452 Log: Update comment. soalloc() is no longer performing M_WAITOK memory allocations. Submitted by: ru MFC after: 3 days Modified: head/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c Modified: head/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c ============================================================================== --- head/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c Tue Feb 10 20:08:03 2009 (r188451) +++ head/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c Tue Feb 10 20:27:05 2009 (r188452) @@ -518,13 +518,9 @@ ng_btsocket_rfcomm_connect(struct socket return (EDESTADDRREQ); /* - * XXX FIXME - This is FUBAR. socreate() will call soalloc(1), i.e. - * soalloc() is allowed to sleep in MALLOC. This creates "could sleep" - * WITNESS warnings. To work around this problem we will create L2CAP - * socket first and then check if we actually need it. Note that we - * will not check for errors in socreate() because if we failed to - * create L2CAP socket at this point we still might have already open - * session. + * Note that we will not check for errors in socreate() because + * if we failed to create L2CAP socket at this point we still + * might have already open session. */ error = socreate(PF_BLUETOOTH, &l2so, SOCK_SEQPACKET, @@ -857,13 +853,9 @@ ng_btsocket_rfcomm_listen(struct socket mtx_unlock(&pcb->pcb_mtx); /* - * XXX FIXME - This is FUBAR. socreate() will call soalloc(1), i.e. - * soalloc() is allowed to sleep in MALLOC. This creates "could sleep" - * WITNESS warnings. To work around this problem we will create L2CAP - * socket first and then check if we actually need it. Note that we - * will not check for errors in socreate() because if we failed to - * create L2CAP socket at this point we still might have already open - * session. + * Note that we will not check for errors in socreate() because + * if we failed to create L2CAP socket at this point we still + * might have already open session. */ socreate_error = socreate(PF_BLUETOOTH, &l2so, SOCK_SEQPACKET, From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 20:29:57 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4334106566B; Tue, 10 Feb 2009 20:29:57 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C1F2D8FC0A; Tue, 10 Feb 2009 20:29:57 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1AKTvIA003623; Tue, 10 Feb 2009 20:29:57 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1AKTvJg003622; Tue, 10 Feb 2009 20:29:57 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200902102029.n1AKTvJg003622@svn.freebsd.org> From: Marcel Moolenaar Date: Tue, 10 Feb 2009 20:29:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188453 - head/sys/ia64/ia64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Feb 2009 20:29:58 -0000 Author: marcel Date: Tue Feb 10 20:29:57 2009 New Revision: 188453 URL: http://svn.freebsd.org/changeset/base/188453 Log: Mark the BSP as being awake. This supresses the message that not all usable CPUs could be woken up... Modified: head/sys/ia64/ia64/mp_machdep.c Modified: head/sys/ia64/ia64/mp_machdep.c ============================================================================== --- head/sys/ia64/ia64/mp_machdep.c Tue Feb 10 20:27:05 2009 (r188452) +++ head/sys/ia64/ia64/mp_machdep.c Tue Feb 10 20:29:57 2009 (r188453) @@ -267,7 +267,8 @@ cpu_mp_start() if (!ap_awake) printf("SMP: WARNING: cpu%d did not wake up\n", pc->pc_cpuid); - } + } else + pc->pc_awake = 1; } } From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 21:48:43 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1CEDA1065673; Tue, 10 Feb 2009 21:48:43 +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 E2D078FC1D; Tue, 10 Feb 2009 21:48:42 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1ALmgk1005177; Tue, 10 Feb 2009 21:48:42 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1ALmgXM005175; Tue, 10 Feb 2009 21:48:42 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200902102148.n1ALmgXM005175@svn.freebsd.org> From: Marius Strobl Date: Tue, 10 Feb 2009 21:48:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188455 - in head/sys: boot/sparc64/loader sparc64/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Feb 2009 21:48:43 -0000 Author: marius Date: Tue Feb 10 21:48:42 2009 New Revision: 188455 URL: http://svn.freebsd.org/changeset/base/188455 Log: - Use the generally more appropriate PROM base rather than the kernel one as the non-faulting flush address in the loader so we can can change KERNBASE and VM_MIN_KERNEL_ADDRESS if we ever want to without needing to worry about using a compatible loader. - Correctly check for LOADER_DEBUG. - Add a missing const for page_sizes[]. Modified: head/sys/boot/sparc64/loader/main.c head/sys/sparc64/include/vmparam.h Modified: head/sys/boot/sparc64/loader/main.c ============================================================================== --- head/sys/boot/sparc64/loader/main.c Tue Feb 10 21:09:54 2009 (r188454) +++ head/sys/boot/sparc64/loader/main.c Tue Feb 10 21:48:42 2009 (r188455) @@ -383,7 +383,7 @@ __elfN(exec)(struct preloaded_file *fp) return (error); printf("jumping to kernel entry at %#lx.\n", e->e_entry); -#if LOADER_DEBUG +#ifdef LOADER_DEBUG pmap_print_tlb_sun4u(); #endif @@ -499,7 +499,7 @@ itlb_enter_sun4u(u_long vpn, u_long data stxa(AA_IMMU_TAR, ASI_IMMU, TLB_TAR_VA(vpn) | TLB_TAR_CTX(TLB_CTX_KERNEL)); stxa(TLB_DAR_SLOT(i), ASI_ITLB_DATA_ACCESS_REG, data); - flush(KERNBASE); + flush(PROMBASE); break; } wrpr(pstate, reg, 0); @@ -511,7 +511,7 @@ itlb_enter_sun4u(u_long vpn, u_long data stxa(AA_IMMU_TAR, ASI_IMMU, TLB_TAR_VA(vpn) | TLB_TAR_CTX(TLB_CTX_KERNEL)); stxa(0, ASI_ITLB_DATA_IN_REG, data); - flush(KERNBASE); + flush(PROMBASE); wrpr(pstate, reg, 0); } @@ -837,7 +837,7 @@ exit(int code) } #ifdef LOADER_DEBUG -static const char *page_sizes[] = { +static const char *const page_sizes[] = { " 8k", " 64k", "512k", " 4m" }; Modified: head/sys/sparc64/include/vmparam.h ============================================================================== --- head/sys/sparc64/include/vmparam.h Tue Feb 10 21:09:54 2009 (r188454) +++ head/sys/sparc64/include/vmparam.h Tue Feb 10 21:48:42 2009 (r188455) @@ -40,7 +40,6 @@ * $FreeBSD$ */ - #ifndef _MACHINE_VMPARAM_H_ #define _MACHINE_VMPARAM_H_ @@ -203,6 +202,7 @@ #define VM_MAXUSER_ADDRESS (VM_MAX_USER_ADDRESS) #define KERNBASE (VM_MIN_KERNEL_ADDRESS) +#define PROMBASE (VM_MIN_PROM_ADDRESS) #define USRSTACK (VM_MAX_USER_ADDRESS) /* From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 21:51:34 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 07DBC106566B; Tue, 10 Feb 2009 21:51:34 +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 E83BE8FC19; Tue, 10 Feb 2009 21:51:33 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1ALpXKL005269; Tue, 10 Feb 2009 21:51:33 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1ALpXgE005267; Tue, 10 Feb 2009 21:51:33 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200902102151.n1ALpXgE005267@svn.freebsd.org> From: Marius Strobl Date: Tue, 10 Feb 2009 21:51:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188456 - in head/sys/sparc64: include sparc64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Feb 2009 21:51:34 -0000 Author: marius Date: Tue Feb 10 21:51:33 2009 New Revision: 188456 URL: http://svn.freebsd.org/changeset/base/188456 Log: Improve r185008 so the streaming cache is only flushed when a mapping actually met the threshold. Modified: head/sys/sparc64/include/bus_private.h head/sys/sparc64/sparc64/iommu.c Modified: head/sys/sparc64/include/bus_private.h ============================================================================== --- head/sys/sparc64/include/bus_private.h Tue Feb 10 21:48:42 2009 (r188455) +++ head/sys/sparc64/include/bus_private.h Tue Feb 10 21:51:33 2009 (r188456) @@ -66,9 +66,10 @@ struct bus_dmamap { int dm_flags; /* (p) */ }; -/* Flag values. */ -#define DMF_LOADED 1 /* Map is loaded */ -#define DMF_COHERENT 2 /* Coherent mapping requested */ +/* Flag values */ +#define DMF_LOADED (1 << 0) /* Map is loaded. */ +#define DMF_COHERENT (1 << 1) /* Coherent mapping requested. */ +#define DMF_STREAMED (1 << 2) /* Streaming cache used. */ int sparc64_dma_alloc_map(bus_dma_tag_t dmat, bus_dmamap_t *mapp); void sparc64_dma_free_map(bus_dma_tag_t dmat, bus_dmamap_t map); Modified: head/sys/sparc64/sparc64/iommu.c ============================================================================== --- head/sys/sparc64/sparc64/iommu.c Tue Feb 10 21:48:42 2009 (r188455) +++ head/sys/sparc64/sparc64/iommu.c Tue Feb 10 21:51:33 2009 (r188456) @@ -822,7 +822,7 @@ iommu_dvmamap_destroy(bus_dma_tag_t dt, } /* - * IOMMU DVMA operations, common to PCI and SBus. + * IOMMU DVMA operations, common to PCI and SBus */ static int iommu_dvmamap_load_buffer(bus_dma_tag_t dt, struct iommu_state *is, @@ -833,8 +833,8 @@ iommu_dvmamap_load_buffer(bus_dma_tag_t bus_size_t sgsize, esize; vm_offset_t vaddr, voffs; vm_paddr_t curaddr; - int error, sgcnt, firstpg, stream; pmap_t pmap = NULL; + int error, firstpg, sgcnt; KASSERT(buflen != 0, ("%s: buflen == 0!", __func__)); if (buflen > dt->dt_maxsize) @@ -855,7 +855,9 @@ iommu_dvmamap_load_buffer(bus_dma_tag_t sgcnt = *segp; firstpg = 1; - stream = iommu_use_streaming(is, map, buflen); + map->dm_flags &= ~DMF_STREAMED; + map->dm_flags |= iommu_use_streaming(is, map, buflen) != 0 ? + DMF_STREAMED : 0; for (; buflen > 0; ) { /* * Get the physical address for this page. @@ -876,7 +878,7 @@ iommu_dvmamap_load_buffer(bus_dma_tag_t vaddr += sgsize; iommu_enter(is, trunc_io_page(dvmaddr), trunc_io_page(curaddr), - stream, flags); + (map->dm_flags & DMF_STREAMED) != 0, flags); /* * Chop the chunk up into segments of at most maxsegsz, but try @@ -1141,7 +1143,7 @@ iommu_dvmamap_sync(bus_dma_tag_t dt, bus /* XXX This is probably bogus. */ if ((op & BUS_DMASYNC_PREREAD) != 0) membar(Sync); - if ((map->dm_flags & DMF_COHERENT) == 0 && IOMMU_HAS_SB(is) && + if ((map->dm_flags & DMF_STREAMED) != 0 && ((op & BUS_DMASYNC_POSTREAD) != 0 || (op & BUS_DMASYNC_PREWRITE) != 0)) { IS_LOCK(is); From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 21:54:23 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 68ECF10656D7; Tue, 10 Feb 2009 21:54: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 555E48FC08; Tue, 10 Feb 2009 21:54:23 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1ALsNGP005357; Tue, 10 Feb 2009 21:54:23 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1ALsNCh005356; Tue, 10 Feb 2009 21:54:23 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200902102154.n1ALsNCh005356@svn.freebsd.org> From: Marius Strobl Date: Tue, 10 Feb 2009 21:54:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188457 - head/sys/dev/bge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Feb 2009 21:54:24 -0000 Author: marius Date: Tue Feb 10 21:54:23 2009 New Revision: 188457 URL: http://svn.freebsd.org/changeset/base/188457 Log: Don't reset the PHY probe retry counter within the loop so it will eventually terminate as intended. Submitted by: Helen Zhang Modified: head/sys/dev/bge/if_bge.c Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Tue Feb 10 21:51:33 2009 (r188456) +++ head/sys/dev/bge/if_bge.c Tue Feb 10 21:54:23 2009 (r188457) @@ -2674,11 +2674,11 @@ bge_attach(device_t dev) * if we get a conflict with the ASF firmware accessing * the PHY. */ + trys = 0; BGE_CLRBIT(sc, BGE_MODE_CTL, BGE_MODECTL_STACKUP); again: bge_asf_driver_up(sc); - trys = 0; if (mii_phy_probe(dev, &sc->bge_miibus, bge_ifmedia_upd, bge_ifmedia_sts)) { if (trys++ < 4) { From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 22:10:48 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B1BA1065726 for ; Tue, 10 Feb 2009 22:10:48 +0000 (UTC) (envelope-from cokane@FreeBSD.org) Received: from mail-out1.fuse.net (mail-out1.fuse.net [216.68.8.175]) by mx1.freebsd.org (Postfix) with ESMTP id B8B918FC2C for ; Tue, 10 Feb 2009 22:10:47 +0000 (UTC) (envelope-from cokane@FreeBSD.org) X-CNFS-Analysis: v=1.0 c=1 a=gIS8vQCsamoA:10 a=w5tnKKSlJdEA:10 a=6I5d2MoRAAAA:8 a=LxPFicOcEEruJsllyeYA:9 a=PSuUN_CzHMxOVDkMoMAA:7 a=Sf4FbcmdLxMw3eMSe8VB4cqutgkA:4 a=LY0hPdMaydYA:10 a=6Xy3pLuTsEIY1HBv69QA:9 a=6bUljeqalFlxX5WB9PtN1eUG6tUA:4 a=rPt6xJ-oxjAA:10 X-CM-Score: 0 X-Scanned-by: Cloudmark Authority Engine Authentication-Results: gwout1 smtp.mail=cokane@FreeBSD.org; spf=softfail Received-SPF: softfail (gwout1: transitional domain FreeBSD.org does not designate 74.215.227.9 as permitted sender) Received: from [74.215.227.9] ([74.215.227.9:50388] helo=discordia) by gwout1 (envelope-from ) (ecelerity 2.2.2.37 r(28805/28810M)) with ESMTP id DE/9B-04546-66BF1994; Tue, 10 Feb 2009 17:10:46 -0500 Received: by discordia (Postfix, from userid 103) id B332635A7D6; Tue, 10 Feb 2009 17:10:45 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.1.8-gr1 (2007-02-13) on discordia X-Spam-Level: X-Spam-Status: No, score=-4.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.8-gr1 Received: from [172.31.1.6] (unknown [172.31.1.6]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by discordia (Postfix) with ESMTP id 4DE7135A7D5; Tue, 10 Feb 2009 17:10:37 -0500 (EST) From: Coleman Kane To: Marius Strobl In-Reply-To: <200902102154.n1ALsNCh005356@svn.freebsd.org> References: <200902102154.n1ALsNCh005356@svn.freebsd.org> Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-bCSF3ePBY/bxd10a1Vyf" Organization: FreeBSD Project Date: Tue, 10 Feb 2009 17:09:47 -0500 Message-Id: <1234303787.10699.4.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.24.3 FreeBSD GNOME Team Port Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r188457 - head/sys/dev/bge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Feb 2009 22:10:48 -0000 --=-bCSF3ePBY/bxd10a1Vyf Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Tue, 2009-02-10 at 21:54 +0000, Marius Strobl wrote: > Author: marius > Date: Tue Feb 10 21:54:23 2009 > New Revision: 188457 > URL: http://svn.freebsd.org/changeset/base/188457 >=20 > Log: > Don't reset the PHY probe retry counter within the loop so > it will eventually terminate as intended. > =20 > Submitted by: Helen Zhang >=20 > Modified: > head/sys/dev/bge/if_bge.c >=20 > Modified: head/sys/dev/bge/if_bge.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/bge/if_bge.c Tue Feb 10 21:51:33 2009 (r188456) > +++ head/sys/dev/bge/if_bge.c Tue Feb 10 21:54:23 2009 (r188457) > @@ -2674,11 +2674,11 @@ bge_attach(device_t dev) > * if we get a conflict with the ASF firmware accessing > * the PHY. > */ > + trys =3D 0; > BGE_CLRBIT(sc, BGE_MODE_CTL, BGE_MODECTL_STACKUP); > again: > bge_asf_driver_up(sc); > =20 > - trys =3D 0; > if (mii_phy_probe(dev, &sc->bge_miibus, > bge_ifmedia_upd, bge_ifmedia_sts)) { > if (trys++ < 4) { >=20 I'm curious... I recent ran into a problem where this driver was not properly recovering from an ACPI resume event (under amd64 with some patches). I am curious if this patch might fix that problem... as the death happened somewhere around here. What example case did you use to discover this bug? --=20 Coleman Kane --=-bCSF3ePBY/bxd10a1Vyf Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEABECAAYFAkmR+ycACgkQcMSxQcXat5cCJgCfcSG2qSKkgnxWLwe3oC/Mnkxp JngAn0uyMSsaDiMUwhpEKtNM/xFr4jo9 =6CH1 -----END PGP SIGNATURE----- --=-bCSF3ePBY/bxd10a1Vyf-- From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 22:39:45 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7987D106566B; Tue, 10 Feb 2009 22:39:45 +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 4C8738FC08; Tue, 10 Feb 2009 22:39:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1AMdji8006354; Tue, 10 Feb 2009 22:39:45 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1AMdjYo006351; Tue, 10 Feb 2009 22:39:45 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200902102239.n1AMdjYo006351@svn.freebsd.org> From: John Baldwin Date: Tue, 10 Feb 2009 22:39:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188458 - head/sys/cam/scsi X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Feb 2009 22:39:46 -0000 Author: jhb Date: Tue Feb 10 22:39:44 2009 New Revision: 188458 URL: http://svn.freebsd.org/changeset/base/188458 Log: Adding dynamic sysctls no longer requires Giant. Submitted by: rdivacky Modified: head/sys/cam/scsi/scsi_cd.c head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/scsi/scsi_cd.c ============================================================================== --- head/sys/cam/scsi/scsi_cd.c Tue Feb 10 21:54:23 2009 (r188457) +++ head/sys/cam/scsi/scsi_cd.c Tue Feb 10 22:39:44 2009 (r188458) @@ -555,8 +555,6 @@ cdsysctlinit(void *context, int pending) snprintf(tmpstr, sizeof(tmpstr), "CAM CD unit %d", periph->unit_number); snprintf(tmpstr2, sizeof(tmpstr2), "%d", periph->unit_number); - mtx_lock(&Giant); - sysctl_ctx_init(&softc->sysctl_ctx); softc->flags |= CD_FLAG_SCTX_INIT; softc->sysctl_tree = SYSCTL_ADD_NODE(&softc->sysctl_ctx, @@ -565,7 +563,6 @@ cdsysctlinit(void *context, int pending) if (softc->sysctl_tree == NULL) { printf("cdsysctlinit: unable to allocate sysctl tree\n"); - mtx_unlock(&Giant); cam_periph_release(periph); return; } @@ -579,7 +576,6 @@ cdsysctlinit(void *context, int pending) &softc->minimum_command_size, 0, cdcmdsizesysctl, "I", "Minimum CDB size"); - mtx_unlock(&Giant); cam_periph_release(periph); } Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Tue Feb 10 21:54:23 2009 (r188457) +++ head/sys/cam/scsi/scsi_da.c Tue Feb 10 22:39:44 2009 (r188458) @@ -1086,7 +1086,6 @@ dasysctlinit(void *context, int pending) snprintf(tmpstr, sizeof(tmpstr), "CAM DA unit %d", periph->unit_number); snprintf(tmpstr2, sizeof(tmpstr2), "%d", periph->unit_number); - mtx_lock(&Giant); sysctl_ctx_init(&softc->sysctl_ctx); softc->flags |= DA_FLAG_SCTX_INIT; softc->sysctl_tree = SYSCTL_ADD_NODE(&softc->sysctl_ctx, @@ -1094,7 +1093,6 @@ dasysctlinit(void *context, int pending) CTLFLAG_RD, 0, tmpstr); if (softc->sysctl_tree == NULL) { printf("dasysctlinit: unable to allocate sysctl tree\n"); - mtx_unlock(&Giant); cam_periph_release(periph); return; } @@ -1108,7 +1106,6 @@ dasysctlinit(void *context, int pending) &softc->minimum_cmd_size, 0, dacmdsizesysctl, "I", "Minimum CDB size"); - mtx_unlock(&Giant); cam_periph_release(periph); } From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 22:46:37 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5957C106566C; Tue, 10 Feb 2009 22:46:37 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4706D8FC0A; Tue, 10 Feb 2009 22:46:37 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1AMkbVT006563; Tue, 10 Feb 2009 22:46:37 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1AMkb0w006562; Tue, 10 Feb 2009 22:46:37 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200902102246.n1AMkb0w006562@svn.freebsd.org> From: Warner Losh Date: Tue, 10 Feb 2009 22:46:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188460 - head/sys/dev/arcmsr X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Feb 2009 22:46:38 -0000 Author: imp Date: Tue Feb 10 22:46:36 2009 New Revision: 188460 URL: http://svn.freebsd.org/changeset/base/188460 Log: fix arcmsr_attach, probe, detach, and shutdown prototypes to match newbus. Modified: head/sys/dev/arcmsr/arcmsr.c Modified: head/sys/dev/arcmsr/arcmsr.c ============================================================================== --- head/sys/dev/arcmsr/arcmsr.c Tue Feb 10 22:46:33 2009 (r188459) +++ head/sys/dev/arcmsr/arcmsr.c Tue Feb 10 22:46:36 2009 (r188460) @@ -140,12 +140,12 @@ */ static struct CommandControlBlock * arcmsr_get_freesrb(struct AdapterControlBlock *acb); static u_int8_t arcmsr_seek_cmd2abort(union ccb * abortccb); -static u_int32_t arcmsr_probe(device_t dev); -static u_int32_t arcmsr_attach(device_t dev); -static u_int32_t arcmsr_detach(device_t dev); +static int arcmsr_probe(device_t dev); +static int arcmsr_attach(device_t dev); +static int arcmsr_detach(device_t dev); static u_int32_t arcmsr_iop_ioctlcmd(struct AdapterControlBlock *acb, u_int32_t ioctl_cmd, caddr_t arg); static void arcmsr_iop_parking(struct AdapterControlBlock *acb); -static void arcmsr_shutdown(device_t dev); +static int arcmsr_shutdown(device_t dev); static void arcmsr_interrupt(struct AdapterControlBlock *acb); static void arcmsr_polling_srbdone(struct AdapterControlBlock *acb, struct CommandControlBlock *poll_srb); static void arcmsr_free_resource(struct AdapterControlBlock *acb); @@ -3029,7 +3029,7 @@ static u_int32_t arcmsr_initialize(devic ************************************************************************ ************************************************************************ */ -static u_int32_t arcmsr_attach(device_t dev) +static int arcmsr_attach(device_t dev) { struct AdapterControlBlock *acb=(struct AdapterControlBlock *)device_get_softc(dev); u_int32_t unit=device_get_unit(dev); @@ -3152,7 +3152,7 @@ static u_int32_t arcmsr_attach(device_t ************************************************************************ ************************************************************************ */ -static u_int32_t arcmsr_probe(device_t dev) +static int arcmsr_probe(device_t dev) { u_int32_t id; static char buf[256]; @@ -3197,7 +3197,7 @@ static u_int32_t arcmsr_probe(device_t d ************************************************************************ ************************************************************************ */ -static void arcmsr_shutdown(device_t dev) +static int arcmsr_shutdown(device_t dev) { u_int32_t i; u_int32_t intmask_org; @@ -3231,13 +3231,13 @@ static void arcmsr_shutdown(device_t dev acb->workingsrb_doneindex=0; acb->workingsrb_startindex=0; ARCMSR_LOCK_RELEASE(&acb->qbuffer_lock); - return; + return (0); } /* ************************************************************************ ************************************************************************ */ -static u_int32_t arcmsr_detach(device_t dev) +static int arcmsr_detach(device_t dev) { struct AdapterControlBlock *acb=(struct AdapterControlBlock *)device_get_softc(dev); int i; From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 22:50:23 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 80E13106566C; Tue, 10 Feb 2009 22:50:23 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6E0368FC1A; Tue, 10 Feb 2009 22:50:23 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1AMoNAT006682; Tue, 10 Feb 2009 22:50:23 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1AMoN4P006678; Tue, 10 Feb 2009 22:50:23 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200902102250.n1AMoN4P006678@svn.freebsd.org> From: Warner Losh Date: Tue, 10 Feb 2009 22:50:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188461 - head/sys/dev/iicbus X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Feb 2009 22:50:23 -0000 Author: imp Date: Tue Feb 10 22:50:23 2009 New Revision: 188461 URL: http://svn.freebsd.org/changeset/base/188461 Log: Fix iicbus_intr, iicbus_write and device_read_ivar prototypes... Modified: head/sys/dev/iicbus/if_ic.c head/sys/dev/iicbus/iicbb.c head/sys/dev/iicbus/iicbus.c head/sys/dev/iicbus/iicsmb.c Modified: head/sys/dev/iicbus/if_ic.c ============================================================================== --- head/sys/dev/iicbus/if_ic.c Tue Feb 10 22:46:36 2009 (r188460) +++ head/sys/dev/iicbus/if_ic.c Tue Feb 10 22:50:23 2009 (r188461) @@ -105,7 +105,7 @@ static int icioctl(struct ifnet *, u_lon static int icoutput(struct ifnet *, struct mbuf *, struct sockaddr *, struct rtentry *); -static void icintr(device_t, int, char *); +static int icintr(device_t, int, char *); static device_method_t ic_methods[] = { /* device interface */ @@ -272,7 +272,7 @@ icioctl(struct ifnet *ifp, u_long cmd, c /* * icintr() */ -static void +static int icintr(device_t dev, int event, char *ptr) { struct ic_softc *sc = (struct ic_softc *)device_get_softc(dev); @@ -346,7 +346,7 @@ icintr(device_t dev, int event, char *pt } mtx_unlock(&sc->ic_lock); - return; + return (0); } /* Modified: head/sys/dev/iicbus/iicbb.c ============================================================================== --- head/sys/dev/iicbus/iicbb.c Tue Feb 10 22:46:36 2009 (r188460) +++ head/sys/dev/iicbus/iicbb.c Tue Feb 10 22:50:23 2009 (r188461) @@ -72,7 +72,7 @@ static int iicbb_probe(device_t); static int iicbb_callback(device_t, int, caddr_t); static int iicbb_start(device_t, u_char, int); static int iicbb_stop(device_t); -static int iicbb_write(device_t, char *, int, int *, int); +static int iicbb_write(device_t, const char *, int, int *, int); static int iicbb_read(device_t, char *, int, int *, int, int); static int iicbb_reset(device_t, u_char, u_char, u_char *); @@ -372,7 +372,7 @@ iicbb_stop(device_t dev) } static int -iicbb_write(device_t dev, char * buf, int len, int *sent, int timeout) +iicbb_write(device_t dev, const char *buf, int len, int *sent, int timeout) { int bytes, error = 0; Modified: head/sys/dev/iicbus/iicbus.c ============================================================================== --- head/sys/dev/iicbus/iicbus.c Tue Feb 10 22:46:36 2009 (r188460) +++ head/sys/dev/iicbus/iicbus.c Tue Feb 10 22:50:23 2009 (r188461) @@ -173,7 +173,7 @@ iicbus_child_pnpinfo_str(device_t bus, d } static int -iicbus_read_ivar(device_t bus, device_t child, int which, u_char *result) +iicbus_read_ivar(device_t bus, device_t child, int which, uintptr_t *result) { struct iicbus_ivar *devi = IICBUS_IVAR(child); Modified: head/sys/dev/iicbus/iicsmb.c ============================================================================== --- head/sys/dev/iicbus/iicsmb.c Tue Feb 10 22:46:36 2009 (r188460) +++ head/sys/dev/iicbus/iicsmb.c Tue Feb 10 22:50:23 2009 (r188461) @@ -84,7 +84,7 @@ static int iicsmb_attach(device_t); static int iicsmb_detach(device_t); static void iicsmb_identify(driver_t *driver, device_t parent); -static void iicsmb_intr(device_t dev, int event, char *buf); +static int iicsmb_intr(device_t dev, int event, char *buf); static int iicsmb_callback(device_t dev, int index, void *data); static int iicsmb_quick(device_t dev, u_char slave, int how); static int iicsmb_sendb(device_t dev, u_char slave, char byte); @@ -186,7 +186,7 @@ iicsmb_detach(device_t dev) * * iicbus interrupt handler */ -static void +static int iicsmb_intr(device_t dev, int event, char *buf) { struct iicsmb_softc *sc = (struct iicsmb_softc *)device_get_softc(dev); @@ -252,7 +252,7 @@ end: } mtx_unlock(&sc->lock); - return; + return (0); } static int From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 23:07:35 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A529E106564A; Tue, 10 Feb 2009 23:07:35 +0000 (UTC) (envelope-from ivoras@gmail.com) Received: from mail-bw0-f170.google.com (mail-bw0-f170.google.com [209.85.218.170]) by mx1.freebsd.org (Postfix) with ESMTP id 3ADC28FC19; Tue, 10 Feb 2009 23:07:33 +0000 (UTC) (envelope-from ivoras@gmail.com) Received: by bwz18 with SMTP id 18so193262bwz.19 for ; Tue, 10 Feb 2009 15:07:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type:content-transfer-encoding; bh=aCKd1TUSjdSQ8H+tvtZ8LVbGkBhMvHwr97tscBJD3TY=; b=ZxvGh9FZi598MBRSpaJHHE851JU0uprFKPzlITH0Ip3BSkXa62mphGvCe5DiSFmIFx x3V1jeGvPFA3w3ZSHTkqDKlK1cNM6xYspFw0WD8DntGD9A1gbFvi86b7KI3xxGRmrO+f eIbd8mpkMKJMFDM667sl+dqZALgNvYzS9G/uU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=NfIQTNeeh2eLYKn386HHNF8GkKXG/HolVzaaUgo1PEZdtXQpUnSHPP/QxIlTddF5DG J9oxdYxZlz29p/KmlMC1TSu+tRh2WqRrSadvaZuYAcfv2qaCssPmyhg7jKWQGpn7CYcl rmaE/4T2e2Nw0xUzUfuytfH34L2gJl8lgKr2o= MIME-Version: 1.0 Sender: ivoras@gmail.com Received: by 10.180.252.8 with SMTP id z8mr1809821bkh.158.1234307253085; Tue, 10 Feb 2009 15:07:33 -0800 (PST) In-Reply-To: <4991BA1C.4020209@FreeBSD.org> References: <200902101511.n1AFBQXx096922@svn.freebsd.org> <9bbcef730902100717x1cd1118bg1d2683a42a25232@mail.gmail.com> <1234279584.65150.13.camel@bauer.cse.buffalo.edu> <4991BA1C.4020209@FreeBSD.org> Date: Wed, 11 Feb 2009 00:07:33 +0100 X-Google-Sender-Auth: 506a38f17ab9677a Message-ID: <9bbcef730902101507k4d1f4001r50f6b96504c7156@mail.gmail.com> From: Ivan Voras To: "Bruce M. Simpson" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Ken Smith , src-committers@freebsd.org, Ken Smith Subject: Re: svn commit: r188439 - head/release X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Feb 2009 23:07:36 -0000 2009/2/10 Bruce M. Simpson : > I'd argue -j2 is appropriate, given that it is reasonable to assume most of > the user base still have uniprocessor systems. > > I have only one dual-core box, and -j2 will still cause at least one make(1) > child process to run at any given time on each core -- it seems like the > right compromise. I don't want to argue this into a bikeshed (I use -jX as appropriate to the NCPU of my systems so I'll tweak it appropriately whatever the consensus happens to be) but I haven't deployed a 32-bit *or* UP server *at all* in about a year and a half. In this time, only one of about 20 servers (yes, I don't have big installations :) ) was single dual-core, one was dual dual-core, and the rest quad and dual quad core. I don't consider myself to be a big admin, but I do consider these trends indicative of newly deployed servers at large. (also, I respect the embedded crowd, all this may not apply to them :) ). From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 23:13:48 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 643431065729; Tue, 10 Feb 2009 23:13:48 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 51CD08FC08; Tue, 10 Feb 2009 23:13:48 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1ANDmYc007157; Tue, 10 Feb 2009 23:13:48 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1ANDm7S007156; Tue, 10 Feb 2009 23:13:48 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200902102313.n1ANDm7S007156@svn.freebsd.org> From: Warner Losh Date: Tue, 10 Feb 2009 23:13:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188462 - head/sys/dev/sdhci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Feb 2009 23:13:49 -0000 Author: imp Date: Tue Feb 10 23:13:48 2009 New Revision: 188462 URL: http://svn.freebsd.org/changeset/base/188462 Log: Fix read_ivar prototype. Modified: head/sys/dev/sdhci/sdhci.c Modified: head/sys/dev/sdhci/sdhci.c ============================================================================== --- head/sys/dev/sdhci/sdhci.c Tue Feb 10 22:50:23 2009 (r188461) +++ head/sys/dev/sdhci/sdhci.c Tue Feb 10 23:13:48 2009 (r188462) @@ -1427,7 +1427,7 @@ sdhci_intr(void *arg) } static int -sdhci_read_ivar(device_t bus, device_t child, int which, u_char *result) +sdhci_read_ivar(device_t bus, device_t child, int which, uintptr_t *result) { struct sdhci_slot *slot = device_get_ivars(child); From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 23:17:20 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D88BC106566B; Tue, 10 Feb 2009 23:17:20 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C5D678FC0C; Tue, 10 Feb 2009 23:17:20 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1ANHKQr007259; Tue, 10 Feb 2009 23:17:20 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1ANHKqd007256; Tue, 10 Feb 2009 23:17:20 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200902102317.n1ANHKqd007256@svn.freebsd.org> From: Warner Losh Date: Tue, 10 Feb 2009 23:17:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188463 - in head/sys/dev: sis tl tx X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Feb 2009 23:17:21 -0000 Author: imp Date: Tue Feb 10 23:17:20 2009 New Revision: 188463 URL: http://svn.freebsd.org/changeset/base/188463 Log: Fix shutdown prototypes. Modified: head/sys/dev/sis/if_sis.c head/sys/dev/tl/if_tl.c head/sys/dev/tx/if_tx.c Modified: head/sys/dev/sis/if_sis.c ============================================================================== --- head/sys/dev/sis/if_sis.c Tue Feb 10 23:13:48 2009 (r188462) +++ head/sys/dev/sis/if_sis.c Tue Feb 10 23:17:20 2009 (r188463) @@ -2257,7 +2257,7 @@ sis_stop(struct sis_softc *sc) * Stop all chip I/O so that the kernel's probe routines don't * get confused by errant DMAs when rebooting. */ -static void +static int sis_shutdown(device_t dev) { struct sis_softc *sc; @@ -2267,6 +2267,7 @@ sis_shutdown(device_t dev) sis_reset(sc); sis_stop(sc); SIS_UNLOCK(sc); + return (0); } static device_method_t sis_methods[] = { Modified: head/sys/dev/tl/if_tl.c ============================================================================== --- head/sys/dev/tl/if_tl.c Tue Feb 10 23:13:48 2009 (r188462) +++ head/sys/dev/tl/if_tl.c Tue Feb 10 23:17:20 2009 (r188463) @@ -282,7 +282,7 @@ static void tl_init(void *); static void tl_init_locked(struct tl_softc *); static void tl_stop(struct tl_softc *); static void tl_watchdog(struct ifnet *); -static void tl_shutdown(device_t); +static int tl_shutdown(device_t); static int tl_ifmedia_upd(struct ifnet *); static void tl_ifmedia_sts(struct ifnet *, struct ifmediareq *); @@ -2347,7 +2347,7 @@ tl_stop(sc) * Stop all chip I/O so that the kernel's probe routines don't * get confused by errant DMAs when rebooting. */ -static void +static int tl_shutdown(dev) device_t dev; { @@ -2359,5 +2359,5 @@ tl_shutdown(dev) tl_stop(sc); TL_UNLOCK(sc); - return; + return (0); } Modified: head/sys/dev/tx/if_tx.c ============================================================================== --- head/sys/dev/tx/if_tx.c Tue Feb 10 23:13:48 2009 (r188462) +++ head/sys/dev/tx/if_tx.c Tue Feb 10 23:17:20 2009 (r188463) @@ -122,7 +122,7 @@ static void epic_ifmedia_sts(struct ifne static int epic_probe(device_t); static int epic_attach(device_t); -static void epic_shutdown(device_t); +static int epic_shutdown(device_t); static int epic_detach(device_t); static void epic_release(epic_softc_t *); static struct epic_type *epic_devtype(device_t); @@ -502,7 +502,7 @@ epic_detach(device_t dev) * Stop all chip I/O so that the kernel's probe routines don't * get confused by errant DMAs when rebooting. */ -static void +static int epic_shutdown(device_t dev) { epic_softc_t *sc; @@ -512,6 +512,7 @@ epic_shutdown(device_t dev) EPIC_LOCK(sc); epic_stop(sc); EPIC_UNLOCK(sc); + return (0); } /* From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 23:22:29 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 77A5B106564A; Tue, 10 Feb 2009 23:22:29 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 658038FC13; Tue, 10 Feb 2009 23:22:29 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1ANMT9D007394; Tue, 10 Feb 2009 23:22:29 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1ANMTgW007393; Tue, 10 Feb 2009 23:22:29 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200902102322.n1ANMTgW007393@svn.freebsd.org> From: Alexander Motin Date: Tue, 10 Feb 2009 23:22:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188464 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Feb 2009 23:22:30 -0000 Author: mav Date: Tue Feb 10 23:22:29 2009 New Revision: 188464 URL: http://svn.freebsd.org/changeset/base/188464 Log: Check for device_set_devclass() errors and skip driver probe/attach if any. Attach call without devclass set crashes the system. On resume AHCI driver sometimes tries to create duplicate adX device. It is surely his own problem, but IMHO it is not a reason to crash here. Other reasons are also possible. Modified: head/sys/kern/subr_bus.c Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Tue Feb 10 23:17:20 2009 (r188463) +++ head/sys/kern/subr_bus.c Tue Feb 10 23:22:29 2009 (r188464) @@ -1756,8 +1756,13 @@ device_probe_child(device_t dev, device_ dl = next_matching_driver(dc, child, dl)) { PDEBUG(("Trying %s", DRIVERNAME(dl->driver))); device_set_driver(child, dl->driver); - if (!hasclass) - device_set_devclass(child, dl->driver->name); + if (!hasclass) { + if (device_set_devclass(child, dl->driver->name)) { + PDEBUG(("Unable to set device class")); + device_set_driver(child, NULL); + continue; + } + } /* Fetch any flags for the device before probing. */ resource_int_value(dl->driver->name, child->unit, @@ -1843,8 +1848,11 @@ device_probe_child(device_t dev, device_ return (result); /* Set the winning driver, devclass, and flags. */ - if (!child->devclass) - device_set_devclass(child, best->driver->name); + if (!child->devclass) { + result = device_set_devclass(child, best->driver->name); + if (result != 0) + return (result); + } device_set_driver(child, best->driver); resource_int_value(best->driver->name, child->unit, "flags", &child->devflags); From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 23:31:52 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 750C7106567B; Tue, 10 Feb 2009 23:31:52 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from ebb.errno.com (ebb.errno.com [69.12.149.25]) by mx1.freebsd.org (Postfix) with ESMTP id 4B1F68FC08; Tue, 10 Feb 2009 23:31:52 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from trouble.errno.com (trouble.errno.com [10.0.0.248]) (authenticated bits=0) by ebb.errno.com (8.13.6/8.12.6) with ESMTP id n1ANVplM030098 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 10 Feb 2009 15:31:51 -0800 (PST) (envelope-from sam@freebsd.org) Message-ID: <49920E67.60805@freebsd.org> Date: Tue, 10 Feb 2009 15:31:51 -0800 From: Sam Leffler Organization: FreeBSD Project User-Agent: Thunderbird 2.0.0.18 (X11/20081209) MIME-Version: 1.0 To: Alexander Motin References: <200902102322.n1ANMTgW007393@svn.freebsd.org> In-Reply-To: <200902102322.n1ANMTgW007393@svn.freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-DCC-sonic.net-Metrics: ebb.errno.com; whitelist Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r188464 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Feb 2009 23:31:53 -0000 Alexander Motin wrote: > Author: mav > Date: Tue Feb 10 23:22:29 2009 > New Revision: 188464 > URL: http://svn.freebsd.org/changeset/base/188464 > > Log: > Check for device_set_devclass() errors and skip driver probe/attach if any. > Attach call without devclass set crashes the system. > > On resume AHCI driver sometimes tries to create duplicate adX device. > It is surely his own problem, but IMHO it is not a reason to crash here. > Other reasons are also possible. > > Please leave a comment in the code that this is basically a WAR for buggy drivers. Sam From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 23:48:30 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 203C01065672; Tue, 10 Feb 2009 23:48:30 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0DF0D8FC08; Tue, 10 Feb 2009 23:48:30 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1ANmT11007866; Tue, 10 Feb 2009 23:48:29 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1ANmTqo007864; Tue, 10 Feb 2009 23:48:29 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902102348.n1ANmTqo007864@svn.freebsd.org> From: Sam Leffler Date: Tue, 10 Feb 2009 23:48:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188465 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Feb 2009 23:48:31 -0000 Author: sam Date: Tue Feb 10 23:48:29 2009 New Revision: 188465 URL: http://svn.freebsd.org/changeset/base/188465 Log: don't do phantom beacon miss checking for s/w beacon miss handling, this can mistakenly drop events that cause the s/w bmiss timer to never get re-armed Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Tue Feb 10 23:22:29 2009 (r188464) +++ head/sys/dev/ath/if_ath.c Tue Feb 10 23:48:29 2009 (r188465) @@ -1372,29 +1372,34 @@ ath_fatal_proc(void *arg, int pending) static void ath_bmiss_vap(struct ieee80211vap *vap) { - struct ifnet *ifp = vap->iv_ic->ic_ifp; - struct ath_softc *sc = ifp->if_softc; - u_int64_t lastrx = sc->sc_lastrx; - u_int64_t tsf = ath_hal_gettsf64(sc->sc_ah); - u_int bmisstimeout = - vap->iv_bmissthreshold * vap->iv_bss->ni_intval * 1024; - - DPRINTF(sc, ATH_DEBUG_BEACON, - "%s: tsf %llu lastrx %lld (%llu) bmiss %u\n", - __func__, (unsigned long long) tsf, - (unsigned long long)(tsf - lastrx), - (unsigned long long) lastrx, bmisstimeout); /* * Workaround phantom bmiss interrupts by sanity-checking * the time of our last rx'd frame. If it is within the * beacon miss interval then ignore the interrupt. If it's * truly a bmiss we'll get another interrupt soon and that'll - * be dispatched up for processing. + * be dispatched up for processing. Note this applies only + * for h/w beacon miss events. */ - if (tsf - lastrx > bmisstimeout) - ATH_VAP(vap)->av_bmiss(vap); - else - sc->sc_stats.ast_bmiss_phantom++; + if ((vap->iv_flags_ext & IEEE80211_FEXT_SWBMISS) == 0) { + struct ifnet *ifp = vap->iv_ic->ic_ifp; + struct ath_softc *sc = ifp->if_softc; + u_int64_t lastrx = sc->sc_lastrx; + u_int64_t tsf = ath_hal_gettsf64(sc->sc_ah); + u_int bmisstimeout = + vap->iv_bmissthreshold * vap->iv_bss->ni_intval * 1024; + + DPRINTF(sc, ATH_DEBUG_BEACON, + "%s: tsf %llu lastrx %lld (%llu) bmiss %u\n", + __func__, (unsigned long long) tsf, + (unsigned long long)(tsf - lastrx), + (unsigned long long) lastrx, bmisstimeout); + + if (tsf - lastrx <= bmisstimeout) { + sc->sc_stats.ast_bmiss_phantom++; + return; + } + } + ATH_VAP(vap)->av_bmiss(vap); } static int From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 23:51:19 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 403C01065691; Tue, 10 Feb 2009 23:51:19 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 28AB58FC1D; Tue, 10 Feb 2009 23:51:19 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1ANpJDs007951; Tue, 10 Feb 2009 23:51:19 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1ANpJeK007950; Tue, 10 Feb 2009 23:51:19 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902102351.n1ANpJeK007950@svn.freebsd.org> From: Sam Leffler Date: Tue, 10 Feb 2009 23:51:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188466 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Feb 2009 23:51:21 -0000 Author: sam Date: Tue Feb 10 23:51:18 2009 New Revision: 188466 URL: http://svn.freebsd.org/changeset/base/188466 Log: clean neighbor entries on beacon miss Modified: head/sys/net80211/ieee80211_adhoc.c Modified: head/sys/net80211/ieee80211_adhoc.c ============================================================================== --- head/sys/net80211/ieee80211_adhoc.c Tue Feb 10 23:48:29 2009 (r188465) +++ head/sys/net80211/ieee80211_adhoc.c Tue Feb 10 23:51:18 2009 (r188466) @@ -110,6 +110,15 @@ adhoc_vattach(struct ieee80211vap *vap) #endif } +static void +sta_leave(void *arg, struct ieee80211_node *ni) +{ + struct ieee80211vap *vap = arg; + + if (ni->ni_vap == vap && ni != vap->iv_bss) + ieee80211_node_leave(ni); +} + /* * IEEE80211_M_IBSS+IEEE80211_M_AHDEMO vap state machine handler. */ @@ -146,8 +155,11 @@ adhoc_newstate(struct ieee80211vap *vap, break; case IEEE80211_S_SCAN: switch (ostate) { - case IEEE80211_S_INIT: case IEEE80211_S_RUN: /* beacon miss */ + /* purge station table; entries are stale */ + ieee80211_iterate_nodes(&ic->ic_sta, sta_leave, vap); + /* fall thru... */ + case IEEE80211_S_INIT: if (vap->iv_des_chan != IEEE80211_CHAN_ANYC && !IEEE80211_IS_CHAN_RADAR(vap->iv_des_chan)) { /* From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 23:52:41 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CAC6A1065705; Tue, 10 Feb 2009 23:52:38 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E9F8A8FC3E; Tue, 10 Feb 2009 23:52:28 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1ANqSZl008007; Tue, 10 Feb 2009 23:52:28 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1ANqSBn008006; Tue, 10 Feb 2009 23:52:28 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902102352.n1ANqSBn008006@svn.freebsd.org> From: Sam Leffler Date: Tue, 10 Feb 2009 23:52:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188467 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Feb 2009 23:52:51 -0000 Author: sam Date: Tue Feb 10 23:52:28 2009 New Revision: 188467 URL: http://svn.freebsd.org/changeset/base/188467 Log: when operating as a slave, clear neighbor entries and the peer bss node on beacon miss while here, remove a stray pointless write of iv_bmiss_count Modified: head/sys/net80211/ieee80211_tdma.c Modified: head/sys/net80211/ieee80211_tdma.c ============================================================================== --- head/sys/net80211/ieee80211_tdma.c Tue Feb 10 23:51:18 2009 (r188466) +++ head/sys/net80211/ieee80211_tdma.c Tue Feb 10 23:52:28 2009 (r188467) @@ -173,6 +173,15 @@ tdma_vdetach(struct ieee80211vap *vap) setackpolicy(vap->iv_ic, 0); /* enable ACK's */ } +static void +sta_leave(void *arg, struct ieee80211_node *ni) +{ + struct ieee80211vap *vap = arg; + + if (ni->ni_vap == vap && ni != vap->iv_bss) + ieee80211_node_leave(ni); +} + /* * TDMA state machine handler. */ @@ -180,10 +189,11 @@ static int tdma_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) { struct ieee80211_tdma_state *ts = vap->iv_tdma; + struct ieee80211com *ic = vap->iv_ic; enum ieee80211_state ostate; int status; - IEEE80211_LOCK_ASSERT(vap->iv_ic); + IEEE80211_LOCK_ASSERT(ic); ostate = vap->iv_state; IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE, "%s: %s -> %s (%d)\n", @@ -201,6 +211,11 @@ tdma_newstate(struct ieee80211vap *vap, */ vap->iv_state = nstate; /* state transition */ ieee80211_cancel_scan(vap); /* background scan */ + if (ostate == IEEE80211_S_RUN) { + /* purge station table; entries are stale */ + ieee80211_iterate_nodes(&ic->ic_sta, sta_leave, vap); + ieee80211_free_node(vap->iv_bss); /* XXX */ + } if (vap->iv_flags_ext & IEEE80211_FEXT_SCANREQ) { ieee80211_check_scan(vap, vap->iv_scanreq_flags, @@ -326,7 +341,6 @@ tdma_recv_mgmt(struct ieee80211_node *ni * Count beacon frame for s/w bmiss handling. */ vap->iv_swbmiss_count++; - vap->iv_bmiss_count = 0; /* * Process tdma ie. The contents are used to sync * the slot timing, reconfigure the bss, etc. From owner-svn-src-head@FreeBSD.ORG Wed Feb 11 00:08:04 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C779106566B; Wed, 11 Feb 2009 00:08:04 +0000 (UTC) (envelope-from kaiw@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EEB018FC08; Wed, 11 Feb 2009 00:08:03 +0000 (UTC) (envelope-from kaiw@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1B083w5008605; Wed, 11 Feb 2009 00:08:03 GMT (envelope-from kaiw@svn.freebsd.org) Received: (from kaiw@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1B083dr008603; Wed, 11 Feb 2009 00:08:03 GMT (envelope-from kaiw@svn.freebsd.org) Message-Id: <200902110008.n1B083dr008603@svn.freebsd.org> From: Kai Wang Date: Wed, 11 Feb 2009 00:08:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188472 - in head/sys/dev: ppc uart X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Feb 2009 00:08:04 -0000 Author: kaiw Date: Wed Feb 11 00:08:03 2009 New Revision: 188472 URL: http://svn.freebsd.org/changeset/base/188472 Log: Added entries for Lava SP-PCI (1 serial + 1 parallel) PCI card. The card is a multifunction PCI and report itself as two logical devices. Modified: head/sys/dev/ppc/ppc_pci.c head/sys/dev/uart/uart_bus_pci.c Modified: head/sys/dev/ppc/ppc_pci.c ============================================================================== --- head/sys/dev/ppc/ppc_pci.c Wed Feb 11 00:01:02 2009 (r188471) +++ head/sys/dev/ppc/ppc_pci.c Wed Feb 11 00:08:03 2009 (r188472) @@ -84,6 +84,7 @@ struct pci_id { static struct pci_id pci_ids[] = { { 0x1020131f, "SIIG Cyber Parallel PCI (10x family)", 0x18 }, { 0x2020131f, "SIIG Cyber Parallel PCI (20x family)", 0x10 }, + { 0x05111407, "Lava SP BIDIR Parallel PCI", 0x10 }, { 0x80001407, "Lava Computers 2SP-PCI parallel port", 0x10 }, { 0x84031415, "Oxford Semiconductor OX12PCI840 Parallel port", 0x10 }, { 0x95131415, "Oxford Semiconductor OX16PCI954 Parallel port", 0x10 }, Modified: head/sys/dev/uart/uart_bus_pci.c ============================================================================== --- head/sys/dev/uart/uart_bus_pci.c Wed Feb 11 00:01:02 2009 (r188471) +++ head/sys/dev/uart/uart_bus_pci.c Wed Feb 11 00:08:03 2009 (r188472) @@ -96,6 +96,7 @@ static struct pci_id pci_ns8250_ids[] = 0x18 }, { 0x1407, 0x0110, 0xffff, 0, "Lava Computer mfg DSerial-PCI Port A", 0x10 }, { 0x1407, 0x0111, 0xffff, 0, "Lava Computer mfg DSerial-PCI Port B", 0x10 }, +{ 0x1407, 0x0510, 0xffff, 0, "Lava SP Serial 550 PCI", 0x10 }, { 0x1409, 0x7168, 0x1409, 0x4025, "Timedia Technology Serial Port", 0x10, 8 * DEFAULT_RCLK }, { 0x1409, 0x7168, 0x1409, 0x4027, "Timedia Technology Serial Port", 0x10, From owner-svn-src-head@FreeBSD.ORG Wed Feb 11 00:22:08 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1C269106566C; Wed, 11 Feb 2009 00:22:08 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.245]) by mx1.freebsd.org (Postfix) with ESMTP id 757208FC0A; Wed, 11 Feb 2009 00:22:07 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: by an-out-0708.google.com with SMTP id b38so93362ana.13 for ; Tue, 10 Feb 2009 16:22:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:from:date:to:cc :subject:message-id:reply-to:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=7pAKmpOb82radj/IN0qptVfdaE521g1r5CaMV1JwzFs=; b=XGOiFDYDXDuIctLzPvxHlozCsZ3MvtbzRTy1bGMDcF1YmUSQ4rt7wmdHzoWkoRj20I Ynv0cdG/Wz/FiVTT+canl4UH7xay3QmjSX61ksqY0ZogbU1fUDYx3GgZq/t8CimtCF45 Ep7FTBJ+DgGkcB0Ci5du+y5jmVJfDbR4L5SWU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=dG/PAcqq91pOgs44ekz8Rx+0BVmjv9BypCvDycglQWprIZ4zyUSz6nqpLOBmUFFOgz pQ5lVO4U2yo9rK/ienBkQJgF+bSTKBUV2L8SStWNt3I4/f3ZhILmV/IyPybN8giIFbfY YecvO7Xo6vF6SW1f2X2Xqo37stW/oPfwqDbfg= Received: by 10.100.126.15 with SMTP id y15mr5238361anc.38.1234311726750; Tue, 10 Feb 2009 16:22:06 -0800 (PST) Received: from michelle.cdnetworks.co.kr ([114.111.62.249]) by mx.google.com with ESMTPS id b29sm10247763ana.31.2009.02.10.16.22.03 (version=SSLv3 cipher=RC4-MD5); Tue, 10 Feb 2009 16:22:05 -0800 (PST) Received: by michelle.cdnetworks.co.kr (sSMTP sendmail emulation); Wed, 11 Feb 2009 09:24:26 +0900 From: Pyun YongHyeon Date: Wed, 11 Feb 2009 09:24:26 +0900 To: Gary Jennejohn Message-ID: <20090211002426.GJ98095@michelle.cdnetworks.co.kr> References: <200902090459.n194xDa3045928@svn.freebsd.org> <20090209181056.40db0ba2@ernst.jennejohn.org> <20090210005002.GD98095@michelle.cdnetworks.co.kr> <20090210131930.16d0882c@ernst.jennejohn.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090210131930.16d0882c@ernst.jennejohn.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Pyun YongHyeon Subject: Re: svn commit: r188381 - head/sys/dev/re X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Feb 2009 00:22:08 -0000 On Tue, Feb 10, 2009 at 01:19:30PM +0100, Gary Jennejohn wrote: > On Tue, 10 Feb 2009 09:50:02 +0900 > Pyun YongHyeon wrote: > > [re0 fails to work with MSI] > > It seems that broken controllers have two MSI messages. Instead of > > reverting the change, how about attached patch? > > This patch fixes the problem. Thanks! > Thanks for testing! From owner-svn-src-head@FreeBSD.ORG Wed Feb 11 00:23:57 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 180621065674; Wed, 11 Feb 2009 00:23:57 +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 05EFD8FC16; Wed, 11 Feb 2009 00:23:57 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1B0NuFw008985; Wed, 11 Feb 2009 00:23:56 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1B0NuFV008983; Wed, 11 Feb 2009 00:23:56 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200902110023.n1B0NuFV008983@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 11 Feb 2009 00:23:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188474 - in head/sys: dev/re pci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Feb 2009 00:23:57 -0000 Author: yongari Date: Wed Feb 11 00:23:56 2009 New Revision: 188474 URL: http://svn.freebsd.org/changeset/base/188474 Log: Allocating 2 MSI messages do not seem to work on certain controllers so use just 1 MSI message. This fixes regression introduced in r188381. Tested by: many Modified: head/sys/dev/re/if_re.c head/sys/pci/if_rlreg.h Modified: head/sys/dev/re/if_re.c ============================================================================== --- head/sys/dev/re/if_re.c Wed Feb 11 00:08:48 2009 (r188473) +++ head/sys/dev/re/if_re.c Wed Feb 11 00:23:56 2009 (r188474) @@ -1149,7 +1149,8 @@ re_attach(device_t dev) if (bootverbose) device_printf(dev, "MSI count : %d\n", msic); } - if (msic == RL_MSI_MESSAGES && msi_disable == 0) { + if (msic > 0 && msi_disable == 0) { + msic = 1; if (pci_alloc_msi(dev, &msic) == 0) { if (msic == RL_MSI_MESSAGES) { device_printf(dev, "Using %d MSI messages\n", Modified: head/sys/pci/if_rlreg.h ============================================================================== --- head/sys/pci/if_rlreg.h Wed Feb 11 00:08:48 2009 (r188473) +++ head/sys/pci/if_rlreg.h Wed Feb 11 00:23:56 2009 (r188474) @@ -779,7 +779,7 @@ struct rl_stats { #define RE_RX_DESC_BUFLEN MCLBYTES #endif -#define RL_MSI_MESSAGES 2 +#define RL_MSI_MESSAGES 1 #define RL_ADDR_LO(y) ((uint64_t) (y) & 0xFFFFFFFF) #define RL_ADDR_HI(y) ((uint64_t) (y) >> 32) From owner-svn-src-head@FreeBSD.ORG Wed Feb 11 04:48:43 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5363B106566C; Wed, 11 Feb 2009 04:48:43 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 0C8B08FC17; Wed, 11 Feb 2009 04:48:42 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id n1B4lqsC060251; Tue, 10 Feb 2009 21:47:52 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Tue, 10 Feb 2009 21:47:51 -0700 (MST) Message-Id: <20090210.214751.-135505687.imp@bsdimp.com> To: sam@FreeBSD.org From: "M. Warner Losh" In-Reply-To: <49920E67.60805@freebsd.org> References: <200902102322.n1ANMTgW007393@svn.freebsd.org> <49920E67.60805@freebsd.org> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, mav@FreeBSD.org, src-committers@FreeBSD.org, svn-src-all@FreeBSD.org Subject: Re: svn commit: r188464 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Feb 2009 04:48:43 -0000 In message: <49920E67.60805@freebsd.org> Sam Leffler writes: : Alexander Motin wrote: : > Author: mav : > Date: Tue Feb 10 23:22:29 2009 : > New Revision: 188464 : > URL: http://svn.freebsd.org/changeset/base/188464 : > : > Log: : > Check for device_set_devclass() errors and skip driver probe/attach if any. : > Attach call without devclass set crashes the system. : > : > On resume AHCI driver sometimes tries to create duplicate adX device. : > It is surely his own problem, but IMHO it is not a reason to crash here. : > Other reasons are also possible. : > : > : Please leave a comment in the code that this is basically a WAR for : buggy drivers. I'd personally make it a panic with a real message so that the problem gets fixed... However, I know that's a pita for people, so I'd do this only for INVARIANTS kernels. I'd whine *ALWAYS* and not just behind PDEBUG. This is a bug, and we shouldn't silently paper over it. Warner From owner-svn-src-head@FreeBSD.ORG Wed Feb 11 04:52:46 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B2994106564A; Wed, 11 Feb 2009 04:52:46 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A0B9E8FC12; Wed, 11 Feb 2009 04:52:46 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1B4qkSh014341; Wed, 11 Feb 2009 04:52:46 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1B4qkMS014340; Wed, 11 Feb 2009 04:52:46 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200902110452.n1B4qkMS014340@svn.freebsd.org> From: Warner Losh Date: Wed, 11 Feb 2009 04:52:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188475 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Feb 2009 04:52:47 -0000 Author: imp Date: Wed Feb 11 04:52:46 2009 New Revision: 188475 URL: http://svn.freebsd.org/changeset/base/188475 Log: o Introduce KOBJMETHOD_END for the end of the kobj list. o Fix a minor indentation problem. o Put in the extra-strict KOBJMETHOD define, but commented out since the tree isn't yet ready. Reviewed by: (1) was posted to arch@ without objection (and 1 go for it) Modified: head/sys/sys/kobj.h Modified: head/sys/sys/kobj.h ============================================================================== --- head/sys/sys/kobj.h Wed Feb 11 00:23:56 2009 (r188474) +++ head/sys/sys/kobj.h Wed Feb 11 04:52:46 2009 (r188475) @@ -92,7 +92,17 @@ struct kobjop_desc { /* * Shorthand for constructing method tables. */ +#if 1 #define KOBJMETHOD(NAME, FUNC) { &NAME##_desc, (kobjop_t) FUNC } +#else /* notyet */ +#define KOBJMETHOD(NAME, FUNC) \ +{ &NAME##_desc, (kobjop_t) (FUNC != (NAME##_t *)NULL ? FUNC : NULL) } +#endif + +/* + * + */ +#define KOBJMETHOD_END { NULL, NULL } /* * Declare a class (which should be defined in another file. @@ -127,7 +137,7 @@ struct kobj_class classvar = { \ base1) \ \ static kobj_class_t name ## _baseclasses[] = \ - { &base1, NULL }; \ + { &base1, NULL }; \ struct kobj_class classvar = { \ #name, methods, size, name ## _baseclasses \ } From owner-svn-src-head@FreeBSD.ORG Wed Feb 11 04:54:03 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 09649106564A; Wed, 11 Feb 2009 04:54:03 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D20708FC13; Wed, 11 Feb 2009 04:54:02 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1B4s2UK014401; Wed, 11 Feb 2009 04:54:02 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1B4s2P7014400; Wed, 11 Feb 2009 04:54:02 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200902110454.n1B4s2P7014400@svn.freebsd.org> From: Warner Losh Date: Wed, 11 Feb 2009 04:54:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188476 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Feb 2009 04:54:03 -0000 Author: imp Date: Wed Feb 11 04:54:02 2009 New Revision: 188476 URL: http://svn.freebsd.org/changeset/base/188476 Log: o Use NULL in pereference to 0 in pointer contexts. o Use newly minted KOBJMETHOD_END as appropriate o fix prototype for root_setup_intr. Modified: head/sys/kern/subr_bus.c Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Wed Feb 11 04:52:46 2009 (r188475) +++ head/sys/kern/subr_bus.c Wed Feb 11 04:54:02 2009 (r188476) @@ -220,7 +220,7 @@ devclass_sysctl_init(devclass_t dc) sysctl_ctx_init(&dc->sysctl_ctx); dc->sysctl_tree = SYSCTL_ADD_NODE(&dc->sysctl_ctx, SYSCTL_STATIC_CHILDREN(_dev), OID_AUTO, dc->name, - CTLFLAG_RD, 0, ""); + CTLFLAG_RD, NULL, ""); SYSCTL_ADD_PROC(&dc->sysctl_ctx, SYSCTL_CHILDREN(dc->sysctl_tree), OID_AUTO, "%parent", CTLFLAG_RD, dc, DEVCLASS_SYSCTL_PARENT, devclass_sysctl_handler, "A", @@ -283,7 +283,7 @@ device_sysctl_init(device_t dev) dev->sysctl_tree = SYSCTL_ADD_NODE(&dev->sysctl_ctx, SYSCTL_CHILDREN(dc->sysctl_tree), OID_AUTO, dev->nameunit + strlen(dc->name), - CTLFLAG_RD, 0, ""); + CTLFLAG_RD, NULL, ""); SYSCTL_ADD_PROC(&dev->sysctl_ctx, SYSCTL_CHILDREN(dev->sysctl_tree), OID_AUTO, "%desc", CTLFLAG_RD, dev, DEVICE_SYSCTL_DESC, device_sysctl_handler, "A", @@ -349,8 +349,8 @@ device_sysctl_fini(device_t dev) static int sysctl_devctl_disable(SYSCTL_HANDLER_ARGS); static int devctl_disable = 0; TUNABLE_INT("hw.bus.devctl_disable", &devctl_disable); -SYSCTL_PROC(_hw_bus, OID_AUTO, devctl_disable, CTLTYPE_INT | CTLFLAG_RW, 0, 0, - sysctl_devctl_disable, "I", "devctl disable"); +SYSCTL_PROC(_hw_bus, OID_AUTO, devctl_disable, CTLTYPE_INT | CTLFLAG_RW, NULL, + 0, sysctl_devctl_disable, "I", "devctl disable"); static d_open_t devopen; static d_close_t devclose; @@ -745,7 +745,7 @@ static TAILQ_HEAD(,device) bus_data_devi static int bus_data_generation = 1; static kobj_method_t null_methods[] = { - { 0, 0 } + KOBJMETHOD_END }; DEFINE_CLASS(null, null_methods, 0); @@ -3774,8 +3774,8 @@ root_print_child(device_t dev, device_t } static int -root_setup_intr(device_t dev, device_t child, driver_intr_t *intr, void *arg, - void **cookiep) +root_setup_intr(device_t dev, device_t child, struct resource *irq, int flags, + driver_filter_t *filter, driver_intr_t *intr, void *arg, void **cookiep) { /* * If an interrupt mapping gets to here something bad has happened. @@ -3809,7 +3809,7 @@ static kobj_method_t root_methods[] = { KOBJMETHOD(bus_setup_intr, root_setup_intr), KOBJMETHOD(bus_child_present, root_child_present), - { 0, 0 } + KOBJMETHOD_END }; static driver_t root_driver = { From owner-svn-src-head@FreeBSD.ORG Wed Feb 11 05:00:23 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 129601065674; Wed, 11 Feb 2009 05:00:23 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id A20868FC1B; Wed, 11 Feb 2009 05:00:22 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id n1B4xZ93060400; Tue, 10 Feb 2009 21:59:35 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Tue, 10 Feb 2009 21:59:34 -0700 (MST) Message-Id: <20090210.215934.1159135034.imp@bsdimp.com> To: mav@freebsd.org From: "M. Warner Losh" In-Reply-To: <200902102322.n1ANMTgW007393@svn.freebsd.org> References: <200902102322.n1ANMTgW007393@svn.freebsd.org> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r188464 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Feb 2009 05:00:23 -0000 In message: <200902102322.n1ANMTgW007393@svn.freebsd.org> Alexander Motin writes: : Author: mav : Date: Tue Feb 10 23:22:29 2009 : New Revision: 188464 : URL: http://svn.freebsd.org/changeset/base/188464 : : Log: : Check for device_set_devclass() errors and skip driver probe/attach if any. : Attach call without devclass set crashes the system. : : On resume AHCI driver sometimes tries to create duplicate adX device. : It is surely his own problem, but IMHO it is not a reason to crash here. : Other reasons are also possible. : : Modified: : head/sys/kern/subr_bus.c : : Modified: head/sys/kern/subr_bus.c : ============================================================================== : --- head/sys/kern/subr_bus.c Tue Feb 10 23:17:20 2009 (r188463) : +++ head/sys/kern/subr_bus.c Tue Feb 10 23:22:29 2009 (r188464) : @@ -1756,8 +1756,13 @@ device_probe_child(device_t dev, device_ : dl = next_matching_driver(dc, child, dl)) { : PDEBUG(("Trying %s", DRIVERNAME(dl->driver))); : device_set_driver(child, dl->driver); : - if (!hasclass) : - device_set_devclass(child, dl->driver->name); : + if (!hasclass) { : + if (device_set_devclass(child, dl->driver->name)) { : + PDEBUG(("Unable to set device class")); : + device_set_driver(child, NULL); : + continue; : + } : + } : : /* Fetch any flags for the device before probing. */ : resource_int_value(dl->driver->name, child->unit, I'd prefer applying this patch to make it whine louder so we don't forget about it: Index: subr_bus.c =================================================================== --- subr_bus.c (revision 188476) +++ subr_bus.c (working copy) @@ -1758,7 +1758,8 @@ device_set_driver(child, dl->driver); if (!hasclass) { if (device_set_devclass(child, dl->driver->name)) { - PDEBUG(("Unable to set device class")); + printf("driver bug: Unable to set devclass (devname: %s)\n", + DEVICENAME(child)); device_set_driver(child, NULL); continue; } Comments? Warner From owner-svn-src-head@FreeBSD.ORG Wed Feb 11 06:49:11 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18F771065670; Wed, 11 Feb 2009 06:49:11 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from cmail.optima.ua (cmail.optima.ua [195.248.191.121]) by mx1.freebsd.org (Postfix) with ESMTP id 2328E8FC19; Wed, 11 Feb 2009 06:49:09 +0000 (UTC) (envelope-from mav@FreeBSD.org) X-Spam-Flag: SKIP X-Spam-Yversion: Spamooborona-2.1.0 Received: from [212.86.226.226] (account mavbsd@alkar.net HELO localhost) by cmail.optima.ua (CommuniGate Pro SMTP 5.2.9) with ESMTPSA id 234234371; Wed, 11 Feb 2009 08:49:08 +0200 Sender: mav@FreeBSD.org From: "Alexander Motin" To: "M. Warner Losh" MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Message-ID: <200902110848450000@442211619> X-Mailer: FlexMail 4 Date: Wed, 11 Feb 2009 08:48:44 +0200 Content-Transfer-Encoding: 8bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r188464 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Feb 2009 06:49:11 -0000 > Alexander Motin writes: > : Author: mav > : Date: Tue Feb 10 23:22:29 2009 > : New Revision: 188464 > : URL: http://svn.freebsd.org/changeset/base/188464 > : > : Log: > : Check for device_set_devclass() errors and skip driver probe/attach if any. > : Attach call without devclass set crashes the system. > : > : On resume AHCI driver sometimes tries to create duplicate adX device. > : It is surely his own problem, but IMHO it is not a reason to crash here. > : Other reasons are also possible. > : > : Modified: > : head/sys/kern/subr_bus.c > : > : Modified: head/sys/kern/subr_bus.c > : ============================================================================== > : --- head/sys/kern/subr_bus.c Tue Feb 10 23:17:20 2009 (r188463) > : +++ head/sys/kern/subr_bus.c Tue Feb 10 23:22:29 2009 (r188464) > : @@ -1756,8 +1756,13 @@ device_probe_child(device_t dev, device_ > : dl = next_matching_driver(dc, child, dl)) { > : PDEBUG(("Trying %s", DRIVERNAME(dl->driver))); > : device_set_driver(child, dl->driver); > : - if (!hasclass) > : - device_set_devclass(child, dl->driver->name); > : + if (!hasclass) { > : + if (device_set_devclass(child, dl->driver->name)) { > : + PDEBUG(("Unable to set device class")); > : + device_set_driver(child, NULL); > : + continue; > : + } > : + } > : > : /* Fetch any flags for the device before probing. */ > : resource_int_value(dl->driver->name, child->unit, > > I'd prefer applying this patch to make it whine louder so we don't > forget about it: device_set_devclass() itself already complains about driver problem (but only with verbose messages). At this point the only thing we should do is not to crash. As I have said, there also can be other failure reasons except driver bugs, for example, low memory. -- Alexander Motin From owner-svn-src-head@FreeBSD.ORG Wed Feb 11 07:50:08 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B289F106564A; Wed, 11 Feb 2009 07:50:08 +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 A0D488FC37; Wed, 11 Feb 2009 07:50:08 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1B7o7VE017695; Wed, 11 Feb 2009 07:50:07 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1B7o7K3017694; Wed, 11 Feb 2009 07:50:07 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200902110750.n1B7o7K3017694@svn.freebsd.org> From: Marius Strobl Date: Wed, 11 Feb 2009 07:50:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188477 - head/sys/sun4v/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Feb 2009 07:50:09 -0000 Author: marius Date: Wed Feb 11 07:50:07 2009 New Revision: 188477 URL: http://svn.freebsd.org/changeset/base/188477 Log: - Use the generally more appropriate PROM base rather than the kernel one as the non-faulting flush address in the loader so we can can change KERNBASE and VM_MIN_KERNEL_ADDRESS if we ever want to without needing to worry about using a compatible loader. - Correctly check for LOADER_DEBUG. - Add a missing const for page_sizes[]. This file was missed in r188455. Modified: head/sys/sun4v/include/vmparam.h Modified: head/sys/sun4v/include/vmparam.h ============================================================================== --- head/sys/sun4v/include/vmparam.h Wed Feb 11 04:54:02 2009 (r188476) +++ head/sys/sun4v/include/vmparam.h Wed Feb 11 07:50:07 2009 (r188477) @@ -40,7 +40,6 @@ * $FreeBSD$ */ - #ifndef _MACHINE_VMPARAM_H_ #define _MACHINE_VMPARAM_H_ @@ -203,6 +202,7 @@ #define VM_MAXUSER_ADDRESS (VM_MAX_USER_ADDRESS) #define KERNBASE (VM_MIN_KERNEL_ADDRESS) +#define PROMBASE (VM_MIN_PROM_ADDRESS) #define USRSTACK (VM_MAX_USER_ADDRESS) /* From owner-svn-src-head@FreeBSD.ORG Wed Feb 11 07:57:27 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A00D1065678; Wed, 11 Feb 2009 07:57:27 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id C19E38FC22; Wed, 11 Feb 2009 07:57:26 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id n1B7tP8m062357; Wed, 11 Feb 2009 00:55:25 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Wed, 11 Feb 2009 00:55:24 -0700 (MST) Message-Id: <20090211.005524.-1889955595.imp@bsdimp.com> To: mav@FreeBSD.org From: "M. Warner Losh" In-Reply-To: <200902110848450000@442211619> References: <200902110848450000@442211619> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r188464 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Feb 2009 07:57:28 -0000 In message: <200902110848450000@442211619> "Alexander Motin" writes: : > Alexander Motin writes: : > : Author: mav : > : Date: Tue Feb 10 23:22:29 2009 : > : New Revision: 188464 : > : URL: http://svn.freebsd.org/changeset/base/188464 : > : : > : Log: : > : Check for device_set_devclass() errors and skip driver probe/attach if any. : > : Attach call without devclass set crashes the system. : > : : > : On resume AHCI driver sometimes tries to create duplicate adX device. : > : It is surely his own problem, but IMHO it is not a reason to crash here. : > : Other reasons are also possible. : > : : > : Modified: : > : head/sys/kern/subr_bus.c : > : : > : Modified: head/sys/kern/subr_bus.c : > : ============================================================================== : > : --- head/sys/kern/subr_bus.c Tue Feb 10 23:17:20 2009 (r188463) : > : +++ head/sys/kern/subr_bus.c Tue Feb 10 23:22:29 2009 (r188464) : > : @@ -1756,8 +1756,13 @@ device_probe_child(device_t dev, device_ : > : dl = next_matching_driver(dc, child, dl)) { : > : PDEBUG(("Trying %s", DRIVERNAME(dl->driver))); : > : device_set_driver(child, dl->driver); : > : - if (!hasclass) : > : - device_set_devclass(child, dl->driver->name); : > : + if (!hasclass) { : > : + if (device_set_devclass(child, dl->driver->name)) { : > : + PDEBUG(("Unable to set device class")); : > : + device_set_driver(child, NULL); : > : + continue; : > : + } : > : + } : > : : > : /* Fetch any flags for the device before probing. */ : > : resource_int_value(dl->driver->name, child->unit, : > : > I'd prefer applying this patch to make it whine louder so we don't : > forget about it: : : device_set_devclass() itself already complains about driver problem (but only with verbose messages). At this point the only thing we should do is not to crash. As I have said, there also can be other failure reasons except driver bugs, for example, low memory. Low memory in this path is extremely rare, but we should report the reason... The most likely cause is a driver bug, and one we should complain about... Warner From owner-svn-src-head@FreeBSD.ORG Wed Feb 11 08:27:33 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 36290106566C; Wed, 11 Feb 2009 08:27:33 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from cmail.optima.ua (cmail.optima.ua [195.248.191.121]) by mx1.freebsd.org (Postfix) with ESMTP id 1F0138FC14; Wed, 11 Feb 2009 08:27:31 +0000 (UTC) (envelope-from mav@FreeBSD.org) X-Spam-Flag: SKIP X-Spam-Yversion: Spamooborona-2.1.0 Received: from orphanage.alkar.net (account mav@alkar.net [212.86.226.11] verified) by cmail.optima.ua (CommuniGate Pro SMTP 5.2.9) with ESMTPA id 234242706; Wed, 11 Feb 2009 10:27:31 +0200 Message-ID: <49928BF2.1010009@FreeBSD.org> Date: Wed, 11 Feb 2009 10:27:30 +0200 From: Alexander Motin User-Agent: Thunderbird 2.0.0.14 (X11/20080612) MIME-Version: 1.0 To: "M. Warner Losh" References: <200902110848450000@442211619> <20090211.005524.-1889955595.imp@bsdimp.com> In-Reply-To: <20090211.005524.-1889955595.imp@bsdimp.com> X-Enigmail-Version: 0.95.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r188464 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Feb 2009 08:27:33 -0000 M. Warner Losh wrote: > In message: <200902110848450000@442211619> > "Alexander Motin" writes: > : > Alexander Motin writes: > : > : Author: mav > : > : Date: Tue Feb 10 23:22:29 2009 > : > : New Revision: 188464 > : > : URL: http://svn.freebsd.org/changeset/base/188464 > : > : > : > : Log: > : > : Check for device_set_devclass() errors and skip driver probe/attach if any. > : > : Attach call without devclass set crashes the system. > : > : > : > : On resume AHCI driver sometimes tries to create duplicate adX device. > : > : It is surely his own problem, but IMHO it is not a reason to crash here. > : > : Other reasons are also possible. > : > : > : > : Modified: > : > : head/sys/kern/subr_bus.c > : > : > : > : Modified: head/sys/kern/subr_bus.c > : > : ============================================================================== > : > : --- head/sys/kern/subr_bus.c Tue Feb 10 23:17:20 2009 (r188463) > : > : +++ head/sys/kern/subr_bus.c Tue Feb 10 23:22:29 2009 (r188464) > : > : @@ -1756,8 +1756,13 @@ device_probe_child(device_t dev, device_ > : > : dl = next_matching_driver(dc, child, dl)) { > : > : PDEBUG(("Trying %s", DRIVERNAME(dl->driver))); > : > : device_set_driver(child, dl->driver); > : > : - if (!hasclass) > : > : - device_set_devclass(child, dl->driver->name); > : > : + if (!hasclass) { > : > : + if (device_set_devclass(child, dl->driver->name)) { > : > : + PDEBUG(("Unable to set device class")); > : > : + device_set_driver(child, NULL); > : > : + continue; > : > : + } > : > : + } > : > : > : > : /* Fetch any flags for the device before probing. */ > : > : resource_int_value(dl->driver->name, child->unit, > : > > : > I'd prefer applying this patch to make it whine louder so we don't > : > forget about it: > : > : device_set_devclass() itself already complains about driver problem (but only with verbose messages). At this point the only thing we should do is not to crash. As I have said, there also can be other failure reasons except driver bugs, for example, low memory. > > Low memory in this path is extremely rare, but we should report the > reason... The most likely cause is a driver bug, and one we should > complain about... I will not argue, let it be if you wish. Just DEVICENAME(child) will probably give only something like "unknown" here without class set, and will be not very informative. Same time devclass_alloc_unit() called deeply inside device_set_driver() already prints "ad: ad4 already exists; skipping it" message. We can just remove 'if (bootverbose)' there. Actually there is some your "XXX". -- Alexander Motin From owner-svn-src-head@FreeBSD.ORG Wed Feb 11 09:18:10 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 63755106566B; Wed, 11 Feb 2009 09:18:10 +0000 (UTC) (envelope-from mtm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 522D98FC18; Wed, 11 Feb 2009 09:18:10 +0000 (UTC) (envelope-from mtm@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1B9IA0T019297; Wed, 11 Feb 2009 09:18:10 GMT (envelope-from mtm@svn.freebsd.org) Received: (from mtm@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1B9I9pk019296; Wed, 11 Feb 2009 09:18:09 GMT (envelope-from mtm@svn.freebsd.org) Message-Id: <200902110918.n1B9I9pk019296@svn.freebsd.org> From: Mike Makonnen Date: Wed, 11 Feb 2009 09:18:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188478 - head/etc/rc.d X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Feb 2009 09:18:10 -0000 Author: mtm Date: Wed Feb 11 09:18:09 2009 New Revision: 188478 URL: http://svn.freebsd.org/changeset/base/188478 Log: Reword informational message by rc.d/defaultroute. PR: conf/131458 Modified: head/etc/rc.d/defaultroute Modified: head/etc/rc.d/defaultroute ============================================================================== --- head/etc/rc.d/defaultroute Wed Feb 11 07:50:07 2009 (r188477) +++ head/etc/rc.d/defaultroute Wed Feb 11 09:18:09 2009 (r188478) @@ -45,7 +45,7 @@ defaultroute_start() break fi if [ ${delay} -eq ${if_up_delay} ]; then - echo -n "Waiting ${delay}s for an interface to come up: " + echo -n "Waiting ${delay}s for the default route interface: " else echo -n . fi From owner-svn-src-head@FreeBSD.ORG Wed Feb 11 10:29:45 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B2B57106566B; Wed, 11 Feb 2009 10:29:45 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 971948FC15; Wed, 11 Feb 2009 10:29:45 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1BATj0j020725; Wed, 11 Feb 2009 10:29:45 GMT (envelope-from netchild@svn.freebsd.org) Received: (from netchild@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1BATjcS020722; Wed, 11 Feb 2009 10:29:45 GMT (envelope-from netchild@svn.freebsd.org) Message-Id: <200902111029.n1BATjcS020722@svn.freebsd.org> From: Alexander Leidinger Date: Wed, 11 Feb 2009 10:29:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188480 - head/sys/dev/sound/pci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Feb 2009 10:29:46 -0000 Author: netchild Date: Wed Feb 11 10:29:45 2009 New Revision: 188480 URL: http://svn.freebsd.org/changeset/base/188480 Log: All open fixes and improvements from Konstantin for which users had to use patches so far: + Envy24: - fix: broken init data for M Audio Delta DiO 2496 - add: support for M Audio Delta 44 - add: support for M Audio Delta 1010LT Tested by: Dominique Goncalves, dominique.goncalves at gmail.com - add: support for Terratec EWX 2496 Tested by: Stefan Sperling, stsp at stsp.name - add: support for M Audio Delta 66 Tested by: Richard Bown, richard.bown at blueyonder.co.uk - add: support for M Audio Delta 1010 Tested by: Andrew Reilly, areilly at bigpond.net.au + Envy24HT: - add: support for Terrasoniq TS22PCI - fix: M-Audio Revolution 5.1 sound volume is very low Reported by: Oliver Hartmann, ohartman at zedat.fu-berlin.de Andrey Slusar, anrays at gmail.com Tested by: Andrey Slusar, anrays at gmail.com Rusu Silviu, arol.the at gmail.com - fix: M-Audio Revolution 7.1 sound is distorted and very quiet Reported by: Olev Hannula, hannula at gmail.com Tested by: Olev Hannula, hannula at gmail.com Stanislav Belansky, stanislav at icmail.ru - fix: Terratec PHASE 22 codec is power-off due to wrong init data Reported by: Philipp Ost, pj at smo.de Tested by: Philipp Ost, pj at smo.de + SpicDS: - fix: AK4381 produce hiss sound on 192kHz sample rate - fix: stupid bug with volume control for AK4396 Submitted by: Konstantin Dimitrov Modified: head/sys/dev/sound/pci/envy24.c head/sys/dev/sound/pci/envy24ht.c head/sys/dev/sound/pci/spicds.c Modified: head/sys/dev/sound/pci/envy24.c ============================================================================== --- head/sys/dev/sound/pci/envy24.c Wed Feb 11 10:28:55 2009 (r188479) +++ head/sys/dev/sound/pci/envy24.c Wed Feb 11 10:29:45 2009 (r188480) @@ -20,7 +20,7 @@ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHERIN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THEPOSSIBILITY OF + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * */ @@ -278,7 +278,7 @@ static struct cfg_info cfg_table[] = { "Envy24 audio (M Audio Delta Dio 2496)", 0x1412, 0xd631, 0x10, 0x80, 0xf0, 0x03, - 0xff, 0x00, 0x00, + 0x02, 0xc0, 0xfd, 0x10, 0x20, 0x40, 0x00, 0x00, 0x00, &delta_codec, @@ -301,6 +301,51 @@ static struct cfg_info cfg_table[] = { 0x00, &delta_codec, }, + { + "Envy24 audio (M Audio Delta 66)", + 0x1412, 0xd632, + 0x15, 0x80, 0xf0, 0x03, + 0x02, 0xc0, 0xfd, + 0x10, 0x20, 0x40, 0x00, 0x00, + 0x00, + &delta_codec, + }, + { + "Envy24 audio (M Audio Delta 44)", + 0x1412, 0xd633, + 0x15, 0x80, 0xf0, 0x00, + 0x02, 0xc0, 0xfd, + 0x10, 0x20, 0x40, 0x00, 0x00, + 0x00, + &delta_codec, + }, + { + "Envy24 audio (M Audio Delta 1010)", + 0x1412, 0xd630, + 0x1f, 0x80, 0xf0, 0x03, + 0x22, 0xd0, 0xdd, + 0x10, 0x20, 0x40, 0x00, 0x00, + 0x00, + &delta_codec, + }, + { + "Envy24 audio (M Audio Delta 1010LT)", + 0x1412, 0xd63b, + 0x1f, 0x80, 0x72, 0x03, + 0x04, 0x7e, 0xfb, + 0x08, 0x02, 0x70, 0x00, 0x00, + 0x00, + &delta_codec, + }, + { + "Envy24 audio (Terratec EWX 2496)", + 0x153b, 0x1130, + 0x10, 0x80, 0xf0, 0x03, + 0xc0, 0x3f, 0x3f, + 0x10, 0x20, 0x01, 0x01, 0x00, + 0x00, + &delta_codec, + }, { "Envy24 audio (Generic)", 0, 0, Modified: head/sys/dev/sound/pci/envy24ht.c ============================================================================== --- head/sys/dev/sound/pci/envy24ht.c Wed Feb 11 10:28:55 2009 (r188479) +++ head/sys/dev/sound/pci/envy24ht.c Wed Feb 11 10:29:45 2009 (r188480) @@ -323,7 +323,7 @@ static struct cfg_info cfg_table[] = { 0x153b, 0x1150, 0x10, 0x80, 0xf0, 0xc3, 0x7ffbc7, 0x7fffff, 0x438, - 0x20, 0x10, 0x400, 0x00, 0x00, + 0x10, 0x20, 0x400, 0x01, 0x00, 0, &spi_codec, }, @@ -349,7 +349,7 @@ static struct cfg_info cfg_table[] = { "Envy24HT audio (M-Audio Revolution 7.1)", 0x1412, 0x3630, 0x43, 0x80, 0xf8, 0xc1, - 0x3fff85, 0x72, 0x4000fa, + 0x3fff85, 0x400072, 0x4000fa, 0x08, 0x02, 0x20, 0x00, 0x04, 0, &spi_codec, @@ -358,7 +358,7 @@ static struct cfg_info cfg_table[] = { "Envy24GT audio (M-Audio Revolution 5.1)", 0x1412, 0x3631, 0x42, 0x80, 0xf8, 0xc1, - 0x3fff85, 0x72, 0x4000fa, + 0x3fff05, 0x4000f0, 0x4000fa, 0x08, 0x02, 0x10, 0x00, 0x03, 0, &spi_codec, @@ -391,6 +391,15 @@ static struct cfg_info cfg_table[] = { &spi_codec, }, { + "Envy24HT-S audio (Terrasoniq TS22PCI)", + 0x153b, 0x117b, + 0x10, 0x80, 0xf0, 0xc3, + 0x7ffbc7, 0x7fffff, 0x438, + 0x10, 0x20, 0x400, 0x01, 0x00, + 0, + &spi_codec, + }, + { "Envy24HT audio (Generic)", 0, 0, 0x0b, 0x80, 0xfc, 0xc3, Modified: head/sys/dev/sound/pci/spicds.c ============================================================================== --- head/sys/dev/sound/pci/spicds.c Wed Feb 11 10:28:55 2009 (r188479) +++ head/sys/dev/sound/pci/spicds.c Wed Feb 11 10:29:45 2009 (r188480) @@ -234,7 +234,7 @@ spicds_init(struct spicds_info *codec) if (codec->type == SPICDS_TYPE_AK4358) spicds_wrcd(codec, 0x00, 0x07); /* I2S, 24bit, power-up */ if (codec->type == SPICDS_TYPE_AK4381) - spicds_wrcd(codec, 0x00, 0x0f); /* I2S, 24bit, power-up */ + spicds_wrcd(codec, 0x00, 0x8f); /* I2S, 24bit, power-up */ if (codec->type == SPICDS_TYPE_AK4396) spicds_wrcd(codec, 0x00, 0x07); /* I2S, 24bit, power-up */ snd_mtxunlock(codec->lock); @@ -296,7 +296,8 @@ spicds_set(struct spicds_info *codec, in case SPICDS_TYPE_WM8770: right = right + 27; break; - case SPICDS_TYPE_AK4381 || SPICDS_TYPE_AK4396: + case SPICDS_TYPE_AK4381: + case SPICDS_TYPE_AK4396: right = right * 255 / 100; break; default: From owner-svn-src-head@FreeBSD.ORG Wed Feb 11 10:50:27 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 233FF1065672; Wed, 11 Feb 2009 10:50:27 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 117708FC24; Wed, 11 Feb 2009 10:50:27 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1BAoQOJ021125; Wed, 11 Feb 2009 10:50:26 GMT (envelope-from maxim@svn.freebsd.org) Received: (from maxim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1BAoQDN021124; Wed, 11 Feb 2009 10:50:26 GMT (envelope-from maxim@svn.freebsd.org) Message-Id: <200902111050.n1BAoQDN021124@svn.freebsd.org> From: Maxim Konovalov Date: Wed, 11 Feb 2009 10:50:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188481 - head/usr.bin/stat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Feb 2009 10:50:27 -0000 Author: maxim Date: Wed Feb 11 10:50:26 2009 New Revision: 188481 URL: http://svn.freebsd.org/changeset/base/188481 Log: o Print an octal representation of suid, sgid and sticky bits with -x flag. PR: bin/131569 Submitted by: Jaakko Heinonen Reported by: Yannick Cadin MFC after: 1 week Modified: head/usr.bin/stat/stat.c Modified: head/usr.bin/stat/stat.c ============================================================================== --- head/usr.bin/stat/stat.c Wed Feb 11 10:29:45 2009 (r188480) +++ head/usr.bin/stat/stat.c Wed Feb 11 10:50:26 2009 (r188481) @@ -108,7 +108,7 @@ __FBSDID("$FreeBSD$"); #define LINUX_FORMAT \ " File: \"%N\"%n" \ " Size: %-11z FileType: %HT%n" \ - " Mode: (%04OLp/%.10Sp) Uid: (%5u/%8Su) Gid: (%5g/%8Sg)%n" \ + " Mode: (%OMp%03OLp/%.10Sp) Uid: (%5u/%8Su) Gid: (%5g/%8Sg)%n" \ "Device: %Hd,%Ld Inode: %i Links: %l%n" \ "Access: %Sa%n" \ "Modify: %Sm%n" \ From owner-svn-src-head@FreeBSD.ORG Wed Feb 11 12:00:16 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4276D10656CB; Wed, 11 Feb 2009 12:00:16 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from websrv01.jr-hosting.nl (websrv01.jr-hosting.nl [78.47.69.233]) by mx1.freebsd.org (Postfix) with ESMTP id 512608FC15; Wed, 11 Feb 2009 12:00:04 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from pgw.vnode.se ([77.110.37.134] helo=hackbook.local) by websrv01.jr-hosting.nl with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69 (FreeBSD)) (envelope-from ) id 1LXDMd-0004OV-75; Wed, 11 Feb 2009 12:34:47 +0100 Message-ID: <4992B7CF.6000406@FreeBSD.org> Date: Wed, 11 Feb 2009 12:34:39 +0100 From: Joel Dahl User-Agent: Thunderbird 2.0.0.19 (Macintosh/20081209) MIME-Version: 1.0 To: Alexander Leidinger References: <200902111029.n1BATjcS020722@svn.freebsd.org> In-Reply-To: <200902111029.n1BATjcS020722@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r188480 - head/sys/dev/sound/pci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Feb 2009 12:00:22 -0000 Alexander Leidinger skrev: > Author: netchild > Date: Wed Feb 11 10:29:45 2009 > New Revision: 188480 > URL: http://svn.freebsd.org/changeset/base/188480 > > Log: > All open fixes and improvements from Konstantin for which users had to > use patches so far: Thank you. -- Joel From owner-svn-src-head@FreeBSD.ORG Wed Feb 11 12:15:57 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 481CE1065966; Wed, 11 Feb 2009 12:15:57 +0000 (UTC) (envelope-from mr@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9BCCA8FC85; Wed, 11 Feb 2009 12:15:35 +0000 (UTC) (envelope-from mr@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1BCFZbJ025396; Wed, 11 Feb 2009 12:15:35 GMT (envelope-from mr@svn.freebsd.org) Received: (from mr@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1BCFZUh025391; Wed, 11 Feb 2009 12:15:35 GMT (envelope-from mr@svn.freebsd.org) Message-Id: <200902111215.n1BCFZUh025391@svn.freebsd.org> From: Michael Reifenberger Date: Wed, 11 Feb 2009 12:15:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188482 - in head/tools/tools/nanobsd/rescue: . Files Files/conf Files/etc Files/etc/ssh Files/root Files/usr Files/usr/ports Pkg X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Feb 2009 12:16:28 -0000 Author: mr Date: Wed Feb 11 12:15:35 2009 New Revision: 188482 URL: http://svn.freebsd.org/changeset/base/188482 Log: Add files to build i386/amd64 bootable rescue ISO images using the nanobsd framework. Added: head/tools/tools/nanobsd/rescue/ head/tools/tools/nanobsd/rescue/AMD64 (contents, props changed) head/tools/tools/nanobsd/rescue/Files/ head/tools/tools/nanobsd/rescue/Files/conf/ head/tools/tools/nanobsd/rescue/Files/etc/ head/tools/tools/nanobsd/rescue/Files/etc/ssh/ head/tools/tools/nanobsd/rescue/Files/etc/ssh/ssh_config (contents, props changed) head/tools/tools/nanobsd/rescue/Files/etc/ssh/sshd_config (contents, props changed) head/tools/tools/nanobsd/rescue/Files/etc/ttys (contents, props changed) head/tools/tools/nanobsd/rescue/Files/root/ head/tools/tools/nanobsd/rescue/Files/root/.cshrc (contents, props changed) head/tools/tools/nanobsd/rescue/Files/root/change_password (contents, props changed) head/tools/tools/nanobsd/rescue/Files/root/save_cfg (contents, props changed) head/tools/tools/nanobsd/rescue/Files/root/save_sshkeys (contents, props changed) head/tools/tools/nanobsd/rescue/Files/root/updatep1 (contents, props changed) head/tools/tools/nanobsd/rescue/Files/root/updatep2 (contents, props changed) head/tools/tools/nanobsd/rescue/Files/usr/ head/tools/tools/nanobsd/rescue/Files/usr/ports/ head/tools/tools/nanobsd/rescue/Files/usr/ports/.keepme (contents, props changed) head/tools/tools/nanobsd/rescue/I386 (contents, props changed) head/tools/tools/nanobsd/rescue/Pkg/ head/tools/tools/nanobsd/rescue/common (contents, props changed) head/tools/tools/nanobsd/rescue/isoamd64.conf (contents, props changed) head/tools/tools/nanobsd/rescue/isoamd64.sh (contents, props changed) head/tools/tools/nanobsd/rescue/isoi386.conf (contents, props changed) head/tools/tools/nanobsd/rescue/isoi386.sh (contents, props changed) Added: head/tools/tools/nanobsd/rescue/AMD64 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/nanobsd/rescue/AMD64 Wed Feb 11 12:15:35 2009 (r188482) @@ -0,0 +1,325 @@ +# +# GENERIC -- Generic kernel configuration file for FreeBSD/amd64 +# +# For more information on this file, please read the config(5) manual page, +# and/or the handbook section on Kernel Configuration Files: +# +# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# +# The handbook is also available locally in /usr/share/doc/handbook +# if you've installed the doc distribution, otherwise always see the +# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the +# latest information. +# +# An exhaustive list of options and more detailed explanations of the +# device lines is also present in the ../../conf/NOTES and NOTES files. +# If you are in doubt as to the purpose or necessity of a line, check first +# in NOTES. +# +# $FreeBSD$ + +cpu HAMMER +ident AMD64 + +# To statically compile in device wiring instead of /boot/device.hints +#hints "GENERIC.hints" # Default places to look for devices. + +# Use the following to compile in values accessible to the kernel +# through getenv() (or kenv(1) in userland). The format of the file +# is 'variable=value', see kenv(1) +# +# env "GENERIC.env" + +makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols + +options SCHED_ULE # ULE scheduler +options PREEMPTION # Enable kernel thread preemption +options INET # InterNETworking +options INET6 # IPv6 communications protocols +options SCTP # Stream Control Transmission Protocol +options FFS # Berkeley Fast Filesystem +options SOFTUPDATES # Enable FFS soft updates support +options UFS_ACL # Support for access control lists +options UFS_DIRHASH # Improve performance on big directories +options UFS_GJOURNAL # Enable gjournal-based UFS journaling +options MD_ROOT # MD is a potential root device +options NFSCLIENT # Network Filesystem Client +options NFSSERVER # Network Filesystem Server +options NFSLOCKD # Network Lock Manager +options NFS_ROOT # NFS usable as /, requires NFSCLIENT +options MSDOSFS # MSDOS Filesystem +options CD9660 # ISO 9660 Filesystem +options PROCFS # Process filesystem (requires PSEUDOFS) +options PSEUDOFS # Pseudo-filesystem framework +options GEOM_PART_GPT # GUID Partition Tables. +options GEOM_LABEL # Provides labelization +options COMPAT_43TTY # BSD 4.3 TTY compat (sgtty) +options COMPAT_IA32 # Compatible with i386 binaries +options COMPAT_FREEBSD4 # Compatible with FreeBSD4 +options COMPAT_FREEBSD5 # Compatible with FreeBSD5 +options COMPAT_FREEBSD6 # Compatible with FreeBSD6 +options COMPAT_FREEBSD7 # Compatible with FreeBSD7 +options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI +options KTRACE # ktrace(1) support +options STACK # stack(9) support +options SYSVSHM # SYSV-style shared memory +options SYSVMSG # SYSV-style message queues +options SYSVSEM # SYSV-style semaphores +options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions +options KBD_INSTALL_CDEV # install a CDEV entry in /dev +options STOP_NMI # Stop CPUS using NMI instead of IPI +options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) +options AUDIT # Security event auditing +#options KDTRACE_FRAME # Ensure frames are compiled in +#options KDTRACE_HOOKS # Kernel DTrace hooks + +# Debugging for use in -current +options KDB # Enable kernel debugger support. +options DDB # Support DDB. +options GDB # Support remote GDB. +#options INVARIANTS # Enable calls of extra sanity checking +#options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS +#options WITNESS # Enable checks to detect deadlocks and cycles +#options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed + +# Make an SMP-capable kernel by default +options SMP # Symmetric MultiProcessor Kernel + +# CPU frequency control +device cpufreq + +# Bus support. +device acpi +device pci + +# Floppy drives +device fdc + +# ATA and ATAPI devices +device ata +device atadisk # ATA disk drives +device ataraid # ATA RAID drives +device atapicd # ATAPI CDROM drives +device atapifd # ATAPI floppy drives +device atapist # ATAPI tape drives +options ATA_STATIC_ID # Static device numbering + +# SCSI Controllers +device ahc # AHA2940 and onboard AIC7xxx devices +options AHC_REG_PRETTY_PRINT # Print register bitfields in debug + # output. Adds ~128k to driver. +device ahd # AHA39320/29320 and onboard AIC79xx devices +options AHD_REG_PRETTY_PRINT # Print register bitfields in debug + # output. Adds ~215k to driver. +device amd # AMD 53C974 (Tekram DC-390(T)) +device hptiop # Highpoint RocketRaid 3xxx series +device isp # Qlogic family +#device ispfw # Firmware for QLogic HBAs- normally a module +device mpt # LSI-Logic MPT-Fusion +#device ncr # NCR/Symbios Logic +device sym # NCR/Symbios Logic (newer chipsets + those of `ncr') +device trm # Tekram DC395U/UW/F DC315U adapters + +device adv # Advansys SCSI adapters +device adw # Advansys wide SCSI adapters +device aic # Adaptec 15[012]x SCSI adapters, AIC-6[23]60. +device bt # Buslogic/Mylex MultiMaster SCSI adapters + +# SCSI peripherals +device scbus # SCSI bus (required for SCSI) +device ch # SCSI media changers +device da # Direct Access (disks) +device sa # Sequential Access (tape etc) +device cd # CD +device pass # Passthrough device (direct SCSI access) +device ses # SCSI Environmental Services (and SAF-TE) + +# RAID controllers interfaced to the SCSI subsystem +device amr # AMI MegaRAID +device arcmsr # Areca SATA II RAID +#XXX it is not 64-bit clean, -scottl +#device asr # DPT SmartRAID V, VI and Adaptec SCSI RAID +device ciss # Compaq Smart RAID 5* +device dpt # DPT Smartcache III, IV - See NOTES for options +device hptmv # Highpoint RocketRAID 182x +device hptrr # Highpoint RocketRAID 17xx, 22xx, 23xx, 25xx +device iir # Intel Integrated RAID +device ips # IBM (Adaptec) ServeRAID +device mly # Mylex AcceleRAID/eXtremeRAID +device twa # 3ware 9000 series PATA/SATA RAID + +# RAID controllers +device aac # Adaptec FSA RAID +device aacp # SCSI passthrough for aac (requires CAM) +device ida # Compaq Smart RAID +device mfi # LSI MegaRAID SAS +device mlx # Mylex DAC960 family +#XXX pointer/int warnings +#device pst # Promise Supertrak SX6000 +device twe # 3ware ATA RAID + +# atkbdc0 controls both the keyboard and the PS/2 mouse +device atkbdc # AT keyboard controller +device atkbd # AT keyboard +device psm # PS/2 mouse + +device kbdmux # keyboard multiplexer + +device vga # VGA video card driver + +device splash # Splash screen and screen saver support + +# syscons is the default console driver, resembling an SCO console +device sc + +device agp # support several AGP chipsets + +# PCCARD (PCMCIA) support +# PCMCIA and cardbus bridge support +device cbb # cardbus (yenta) bridge +device pccard # PC Card (16-bit) bus +device cardbus # CardBus (32-bit) bus + +# Serial (COM) ports +device uart # Generic UART driver + +# Parallel port +device ppc +device ppbus # Parallel port bus (required) +device lpt # Printer +device plip # TCP/IP over parallel +device ppi # Parallel port interface device +#device vpo # Requires scbus and da + +# If you've got a "dumb" serial or parallel PCI card that is +# supported by the puc(4) glue driver, uncomment the following +# line to enable it (connects to sio, uart and/or ppc drivers): +#device puc + +# PCI Ethernet NICs. +device de # DEC/Intel DC21x4x (``Tulip'') +device em # Intel PRO/1000 Gigabit Ethernet Family +device igb # Intel PRO/1000 PCIE Server Gigabit Family +device ixgb # Intel PRO/10GbE Ethernet Card +device le # AMD Am7900 LANCE and Am79C9xx PCnet +device ti # Alteon Networks Tigon I/II gigabit Ethernet +device txp # 3Com 3cR990 (``Typhoon'') +device vx # 3Com 3c590, 3c595 (``Vortex'') + +# PCI Ethernet NICs that use the common MII bus controller code. +# NOTE: Be sure to keep the 'device miibus' line in order to use these NICs! +device miibus # MII bus support +device ae # Attansic/Atheros L2 FastEthernet +device age # Attansic/Atheros L1 Gigabit Ethernet +device ale # Atheros AR8121/AR8113/AR8114 Ethernet +device bce # Broadcom BCM5706/BCM5708 Gigabit Ethernet +device bfe # Broadcom BCM440x 10/100 Ethernet +device bge # Broadcom BCM570xx Gigabit Ethernet +device dc # DEC/Intel 21143 and various workalikes +device et # Agere ET1310 10/100/Gigabit Ethernet +device fxp # Intel EtherExpress PRO/100B (82557, 82558) +device jme # JMicron JMC250 Gigabit/JMC260 Fast Ethernet +device lge # Level 1 LXT1001 gigabit Ethernet +device msk # Marvell/SysKonnect Yukon II Gigabit Ethernet +device nfe # nVidia nForce MCP on-board Ethernet +device nge # NatSemi DP83820 gigabit Ethernet +#device nve # nVidia nForce MCP on-board Ethernet Networking +device pcn # AMD Am79C97x PCI 10/100 (precedence over 'le') +device re # RealTek 8139C+/8169/8169S/8110S +device rl # RealTek 8129/8139 +device sf # Adaptec AIC-6915 (``Starfire'') +device sis # Silicon Integrated Systems SiS 900/SiS 7016 +device sk # SysKonnect SK-984x & SK-982x gigabit Ethernet +device ste # Sundance ST201 (D-Link DFE-550TX) +device stge # Sundance/Tamarack TC9021 gigabit Ethernet +device tl # Texas Instruments ThunderLAN +device tx # SMC EtherPower II (83c170 ``EPIC'') +device vge # VIA VT612x gigabit Ethernet +device vr # VIA Rhine, Rhine II +device wb # Winbond W89C840F +device xl # 3Com 3c90x (``Boomerang'', ``Cyclone'') + +# ISA Ethernet NICs. pccard NICs included. +device cs # Crystal Semiconductor CS89x0 NIC +# 'device ed' requires 'device miibus' +device ed # NE[12]000, SMC Ultra, 3c503, DS8390 cards +device ex # Intel EtherExpress Pro/10 and Pro/10+ +device ep # Etherlink III based cards +device fe # Fujitsu MB8696x based cards +device sn # SMC's 9000 series of Ethernet chips +device xe # Xircom pccard Ethernet + +# Wireless NIC cards +device wlan # 802.11 support +options IEEE80211_DEBUG # enable debug msgs +options IEEE80211_AMPDU_AGE # age frames in AMPDU reorder q's +device wlan_wep # 802.11 WEP support +device wlan_ccmp # 802.11 CCMP support +device wlan_tkip # 802.11 TKIP support +device wlan_amrr # AMRR transmit rate control algorithm +device an # Aironet 4500/4800 802.11 wireless NICs. +device ath # Atheros pci/cardbus NIC's +device ath_hal # pci/cardbus chip support +options AH_SUPPORT_AR5416 # enable AR5416 tx/rx descriptors +device ath_rate_sample # SampleRate tx rate control for ath +device ral # Ralink Technology RT2500 wireless NICs. +device wi # WaveLAN/Intersil/Symbol 802.11 wireless NICs. + +# Pseudo devices. +device loop # Network loopback +device random # Entropy device +device ether # Ethernet support +device tun # Packet tunnel. +device pty # BSD-style compatibility pseudo ttys +device md # Memory "disks" +device gif # IPv6 and IPv4 tunneling +device faith # IPv6-to-IPv4 relaying (translation) +device firmware # firmware assist module + +# The `bpf' device enables the Berkeley Packet Filter. +# Be aware of the administrative consequences of enabling this! +# Note that 'bpf' is required for DHCP. +device bpf # Berkeley packet filter + +# USB support +device uhci # UHCI PCI->USB interface +device ohci # OHCI PCI->USB interface +device ehci # EHCI PCI->USB interface (USB 2.0) +device usb # USB Bus (required) +#device udbp # USB Double Bulk Pipe devices +device ugen # Generic +device uhid # "Human Interface Devices" +device ukbd # Keyboard +device ulpt # Printer +device umass # Disks/Mass storage - Requires scbus and da +device ums # Mouse +device ural # Ralink Technology RT2500USB wireless NICs +device rum # Ralink Technology RT2501USB wireless NICs +device urio # Diamond Rio 500 MP3 player +device uscanner # Scanners +# USB Serial devices +device ucom # Generic com ttys +device uark # Technologies ARK3116 based serial adapters +device ubsa # Belkin F5U103 and compatible serial adapters +device uftdi # For FTDI usb serial adapters +device uipaq # Some WinCE based devices +device uplcom # Prolific PL-2303 serial adapters +device uslcom # SI Labs CP2101/CP2102 serial adapters +device uvisor # Visor and Palm devices +device uvscom # USB serial support for DDI pocket's PHS +# USB Ethernet, requires miibus +device aue # ADMtek USB Ethernet +device axe # ASIX Electronics USB Ethernet +device cdce # Generic USB over Ethernet +device cue # CATC USB Ethernet +device kue # Kawasaki LSI USB Ethernet +device rue # RealTek RTL8150 USB Ethernet +device udav # Davicom DM9601E USB + +# FireWire support +device firewire # FireWire bus code +device sbp # SCSI over FireWire (Requires scbus and da) +device fwe # Ethernet over FireWire (non-standard!) +device fwip # IP over FireWire (RFC 2734,3146) +device dcons # Dumb console driver +device dcons_crom # Configuration ROM for dcons Added: head/tools/tools/nanobsd/rescue/Files/etc/ssh/ssh_config ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/nanobsd/rescue/Files/etc/ssh/ssh_config Wed Feb 11 12:15:35 2009 (r188482) @@ -0,0 +1,46 @@ +# $OpenBSD: ssh_config,v 1.22 2006/05/29 12:56:33 dtucker Exp $ +# $FreeBSD$ + +# This is the ssh client system-wide configuration file. See +# ssh_config(5) for more information. This file provides defaults for +# users, and the values can be changed in per-user configuration files +# or on the command line. + +# Configuration data is parsed as follows: +# 1. command line options +# 2. user-specific file +# 3. system-wide file +# Any configuration value is only changed the first time it is set. +# Thus, host-specific definitions should be at the beginning of the +# configuration file, and defaults at the end. + +# Site-wide defaults for some commonly used options. For a comprehensive +# list of available options, their meanings and defaults, please see the +# ssh_config(5) man page. + +# Host * +# ForwardAgent no +# ForwardX11 no +# RhostsRSAAuthentication no +# RSAAuthentication yes +# PasswordAuthentication yes +# HostbasedAuthentication no +# GSSAPIAuthentication no +# GSSAPIDelegateCredentials no +# BatchMode no +# CheckHostIP no +# AddressFamily any +# ConnectTimeout 0 +# StrictHostKeyChecking ask +# IdentityFile ~/.ssh/identity +# IdentityFile ~/.ssh/id_rsa +# IdentityFile ~/.ssh/id_dsa +# Port 22 +# Protocol 2,1 +# Cipher 3des +# Ciphers aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc +# EscapeChar ~ +# Tunnel no +# TunnelDevice any:any +# PermitLocalCommand no +# VersionAddendum FreeBSD-20061110 Added: head/tools/tools/nanobsd/rescue/Files/etc/ssh/sshd_config ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/nanobsd/rescue/Files/etc/ssh/sshd_config Wed Feb 11 12:15:35 2009 (r188482) @@ -0,0 +1,117 @@ +# $OpenBSD: sshd_config,v 1.74 2006/07/19 13:07:10 dtucker Exp $ +# $FreeBSD$ + +# This is the sshd server system-wide configuration file. See +# sshd_config(5) for more information. + +# This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin + +# The strategy used for options in the default sshd_config shipped with +# OpenSSH is to specify options with their default value where +# possible, but leave them commented. Uncommented options change a +# default value. + +# Note that some of FreeBSD's defaults differ from OpenBSD's, and +# FreeBSD has a few additional options. + +#VersionAddendum FreeBSD-20061110 + +#Port 22 +#Protocol 2 +#AddressFamily any +#ListenAddress 0.0.0.0 +#ListenAddress :: + +# HostKey for protocol version 1 +#HostKey /etc/ssh/ssh_host_key +# HostKeys for protocol version 2 +#HostKey /etc/ssh/ssh_host_dsa_key + +# Lifetime and size of ephemeral version 1 server key +#KeyRegenerationInterval 1h +#ServerKeyBits 768 + +# Logging +# obsoletes QuietMode and FascistLogging +#SyslogFacility AUTH +#LogLevel INFO + +# Authentication: + +#LoginGraceTime 2m +PermitRootLogin yes +#StrictModes yes +#MaxAuthTries 6 + +#RSAAuthentication yes +#PubkeyAuthentication yes +#AuthorizedKeysFile .ssh/authorized_keys + +# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts +#RhostsRSAAuthentication no +# similar for protocol version 2 +#HostbasedAuthentication no +# Change to yes if you don't trust ~/.ssh/known_hosts for +# RhostsRSAAuthentication and HostbasedAuthentication +#IgnoreUserKnownHosts no +# Don't read the user's ~/.rhosts and ~/.shosts files +#IgnoreRhosts yes + +# Change to yes to enable built-in password authentication. +#PasswordAuthentication no +#PermitEmptyPasswords no + +# Change to no to disable PAM authentication +#ChallengeResponseAuthentication yes + +# Kerberos options +#KerberosAuthentication no +#KerberosOrLocalPasswd yes +#KerberosTicketCleanup yes +#KerberosGetAFSToken no + +# GSSAPI options +#GSSAPIAuthentication no +#GSSAPICleanupCredentials yes + +# Set this to 'no' to disable PAM authentication, account processing, +# and session processing. If this is enabled, PAM authentication will +# be allowed through the ChallengeResponseAuthentication and +# PasswordAuthentication. Depending on your PAM configuration, +# PAM authentication via ChallengeResponseAuthentication may bypass +PermitRootLogin yes +# If you just want the PAM account and session checks to run without +# PAM authentication, then enable this but set PasswordAuthentication +# and ChallengeResponseAuthentication to 'no'. +#UsePAM yes + +#AllowTcpForwarding yes +#GatewayPorts no +#X11Forwarding yes +#X11DisplayOffset 10 +#X11UseLocalhost yes +#PrintMotd yes +#PrintLastLog yes +#TCPKeepAlive yes +#UseLogin no +#UsePrivilegeSeparation yes +#PermitUserEnvironment no +#Compression delayed +#ClientAliveInterval 0 +#ClientAliveCountMax 3 +#UseDNS yes +#PidFile /var/run/sshd.pid +#MaxStartups 10 +#PermitTunnel no + +# no default banner path +#Banner /some/path + +# override default of no subsystems +Subsystem sftp /usr/libexec/sftp-server + +# Example of overriding settings on a per-user basis +#Match User anoncvs +# X11Forwarding no +# AllowTcpForwarding no +# ForceCommand cvs server Added: head/tools/tools/nanobsd/rescue/Files/etc/ttys ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/nanobsd/rescue/Files/etc/ttys Wed Feb 11 12:15:35 2009 (r188482) @@ -0,0 +1,565 @@ +# +# $FreeBSD$ +# @(#)ttys 5.1 (Berkeley) 4/17/89 +# +# This file specifies various information about terminals on the system. +# It is used by several different programs. Common entries for the +# various columns include: +# +# name The name of the terminal device. +# +# getty The program to start running on the terminal. Typically a +# getty program, as the name implies. Other common entries +# include none, when no getty is needed, and xdm, to start the +# X Window System. +# +# type The initial terminal type for this port. For hardwired +# terminal lines, this will contain the type of terminal used. +# For virtual consoles, the correct type is typically cons25, but +# vt220 will work better if you need interoperability with other +# systems like Solaris or GNU/Linux. +# Other common values include network for network connections on +# pseudo-terminals, dialup for incoming modem ports, and unknown +# when the terminal type cannot be predetermined. +# +# status Must be on or off. If on, init will run the getty program on +# the specified port. If the word "secure" appears, this tty +# allows root login. +# +# name getty type status comments +# +# If console is marked "insecure", then init will ask for the root password +# when going to single-user mode. +console none unknown off secure +# +ttyv0 "/usr/libexec/getty Pc" cons25 on secure +# Virtual terminals +ttyv1 "/usr/libexec/getty Pc" cons25 on secure +ttyv2 "/usr/libexec/getty Pc" cons25 on secure +ttyv3 "/usr/libexec/getty Pc" cons25 off secure +ttyv4 "/usr/libexec/getty Pc" cons25 off secure +ttyv5 "/usr/libexec/getty Pc" cons25 off secure +ttyv6 "/usr/libexec/getty Pc" cons25 off secure +ttyv7 "/usr/libexec/getty Pc" cons25 off secure +ttyv8 "/usr/local/bin/xdm -nodaemon" xterm off secure +# Serial terminals +# The 'dialup' keyword identifies dialin lines to login, fingerd etc. +ttyu0 "/usr/libexec/getty std.115200" xterm-color on secure +ttyu1 "/usr/libexec/getty std.9600" dialup off secure +ttyu2 "/usr/libexec/getty std.9600" dialup off secure +ttyu3 "/usr/libexec/getty std.9600" dialup off secure +# Dumb console +dcons "/usr/libexec/getty std.9600" vt100 off secure +# Pseudo terminals +ttyp0 none network +ttyp1 none network +ttyp2 none network +ttyp3 none network +ttyp4 none network +ttyp5 none network +ttyp6 none network +ttyp7 none network +ttyp8 none network +ttyp9 none network +ttypa none network +ttypb none network +ttypc none network +ttypd none network +ttype none network +ttypf none network +ttypg none network +ttyph none network +ttypi none network +ttypj none network +ttypk none network +ttypl none network +ttypm none network +ttypn none network +ttypo none network +ttypp none network +ttypq none network +ttypr none network +ttyps none network +ttypt none network +ttypu none network +ttypv none network +ttyq0 none network +ttyq1 none network +ttyq2 none network +ttyq3 none network +ttyq4 none network +ttyq5 none network +ttyq6 none network +ttyq7 none network +ttyq8 none network +ttyq9 none network +ttyqa none network +ttyqb none network +ttyqc none network +ttyqd none network +ttyqe none network +ttyqf none network +ttyqg none network +ttyqh none network +ttyqi none network +ttyqj none network +ttyqk none network +ttyql none network +ttyqm none network +ttyqn none network +ttyqo none network +ttyqp none network +ttyqq none network +ttyqr none network +ttyqs none network +ttyqt none network +ttyqu none network +ttyqv none network +ttyr0 none network +ttyr1 none network +ttyr2 none network +ttyr3 none network +ttyr4 none network +ttyr5 none network +ttyr6 none network +ttyr7 none network +ttyr8 none network +ttyr9 none network +ttyra none network +ttyrb none network +ttyrc none network +ttyrd none network +ttyre none network +ttyrf none network +ttyrg none network +ttyrh none network +ttyri none network +ttyrj none network +ttyrk none network +ttyrl none network +ttyrm none network +ttyrn none network +ttyro none network +ttyrp none network +ttyrq none network +ttyrr none network +ttyrs none network +ttyrt none network +ttyru none network +ttyrv none network +ttys0 none network +ttys1 none network +ttys2 none network +ttys3 none network +ttys4 none network +ttys5 none network +ttys6 none network +ttys7 none network +ttys8 none network +ttys9 none network +ttysa none network +ttysb none network +ttysc none network +ttysd none network +ttyse none network +ttysf none network +ttysg none network +ttysh none network +ttysi none network +ttysj none network +ttysk none network +ttysl none network +ttysm none network +ttysn none network +ttyso none network +ttysp none network +ttysq none network +ttysr none network +ttyss none network +ttyst none network +ttysu none network +ttysv none network +ttyP0 none network +ttyP1 none network +ttyP2 none network +ttyP3 none network +ttyP4 none network +ttyP5 none network +ttyP6 none network +ttyP7 none network +ttyP8 none network +ttyP9 none network +ttyPa none network +ttyPb none network +ttyPc none network +ttyPd none network +ttyPe none network +ttyPf none network +ttyPg none network +ttyPh none network +ttyPi none network +ttyPj none network +ttyPk none network +ttyPl none network +ttyPm none network +ttyPn none network +ttyPo none network +ttyPp none network +ttyPq none network +ttyPr none network +ttyPs none network +ttyPt none network +ttyPu none network +ttyPv none network +ttyQ0 none network +ttyQ1 none network +ttyQ2 none network +ttyQ3 none network +ttyQ4 none network +ttyQ5 none network +ttyQ6 none network +ttyQ7 none network +ttyQ8 none network +ttyQ9 none network +ttyQa none network +ttyQb none network +ttyQc none network +ttyQd none network +ttyQe none network +ttyQf none network +ttyQg none network +ttyQh none network +ttyQi none network +ttyQj none network +ttyQk none network +ttyQl none network +ttyQm none network +ttyQn none network +ttyQo none network +ttyQp none network +ttyQq none network +ttyQr none network +ttyQs none network +ttyQt none network +ttyQu none network +ttyQv none network +ttyR0 none network +ttyR1 none network +ttyR2 none network +ttyR3 none network +ttyR4 none network +ttyR5 none network +ttyR6 none network +ttyR7 none network +ttyR8 none network +ttyR9 none network +ttyRa none network +ttyRb none network +ttyRc none network +ttyRd none network +ttyRe none network +ttyRf none network +ttyRg none network +ttyRh none network +ttyRi none network +ttyRj none network +ttyRk none network +ttyRl none network +ttyRm none network +ttyRn none network +ttyRo none network +ttyRp none network +ttyRq none network +ttyRr none network +ttyRs none network +ttyRt none network +ttyRu none network +ttyRv none network +ttyS0 none network +ttyS1 none network +ttyS2 none network +ttyS3 none network +ttyS4 none network +ttyS5 none network +ttyS6 none network +ttyS7 none network +ttyS8 none network +ttyS9 none network +ttySa none network +ttySb none network +ttySc none network +ttySd none network +ttySe none network +ttySf none network +ttySg none network +ttySh none network +ttySi none network +ttySj none network +ttySk none network +ttySl none network +ttySm none network +ttySn none network +ttySo none network +ttySp none network +ttySq none network +ttySr none network +ttySs none network +ttySt none network +ttySu none network +ttySv none network +ttyl0 none network +ttyl1 none network +ttyl2 none network +ttyl3 none network +ttyl4 none network +ttyl5 none network +ttyl6 none network +ttyl7 none network +ttyl8 none network +ttyl9 none network +ttyla none network +ttylb none network +ttylc none network +ttyld none network +ttyle none network +ttylf none network +ttylg none network +ttylh none network +ttyli none network +ttylj none network +ttylk none network +ttyll none network +ttylm none network +ttyln none network +ttylo none network +ttylp none network +ttylq none network +ttylr none network +ttyls none network +ttylt none network +ttylu none network +ttylv none network +ttym0 none network +ttym1 none network +ttym2 none network +ttym3 none network +ttym4 none network +ttym5 none network +ttym6 none network +ttym7 none network +ttym8 none network +ttym9 none network +ttyma none network +ttymb none network +ttymc none network +ttymd none network +ttyme none network +ttymf none network +ttymg none network +ttymh none network +ttymi none network +ttymj none network +ttymk none network +ttyml none network +ttymm none network +ttymn none network +ttymo none network +ttymp none network +ttymq none network +ttymr none network +ttyms none network +ttymt none network +ttymu none network +ttymv none network +ttyn0 none network +ttyn1 none network +ttyn2 none network +ttyn3 none network +ttyn4 none network +ttyn5 none network +ttyn6 none network +ttyn7 none network +ttyn8 none network +ttyn9 none network +ttyna none network +ttynb none network +ttync none network +ttynd none network +ttyne none network +ttynf none network +ttyng none network +ttynh none network +ttyni none network +ttynj none network +ttynk none network +ttynl none network +ttynm none network +ttynn none network +ttyno none network +ttynp none network +ttynq none network +ttynr none network +ttyns none network +ttynt none network +ttynu none network +ttynv none network +ttyo0 none network +ttyo1 none network +ttyo2 none network +ttyo3 none network +ttyo4 none network +ttyo5 none network +ttyo6 none network +ttyo7 none network +ttyo8 none network +ttyo9 none network +ttyoa none network +ttyob none network +ttyoc none network +ttyod none network +ttyoe none network +ttyof none network +ttyog none network +ttyoh none network +ttyoi none network +ttyoj none network +ttyok none network +ttyol none network +ttyom none network +ttyon none network +ttyoo none network +ttyop none network +ttyoq none network +ttyor none network +ttyos none network +ttyot none network +ttyou none network +ttyov none network +ttyL0 none network +ttyL1 none network +ttyL2 none network +ttyL3 none network +ttyL4 none network +ttyL5 none network +ttyL6 none network +ttyL7 none network +ttyL8 none network +ttyL9 none network +ttyLa none network +ttyLb none network +ttyLc none network +ttyLd none network +ttyLe none network +ttyLf none network +ttyLg none network +ttyLh none network +ttyLi none network +ttyLj none network +ttyLk none network +ttyLl none network +ttyLm none network +ttyLn none network +ttyLo none network +ttyLp none network +ttyLq none network +ttyLr none network +ttyLs none network +ttyLt none network +ttyLu none network +ttyLv none network +ttyM0 none network +ttyM1 none network +ttyM2 none network +ttyM3 none network +ttyM4 none network +ttyM5 none network +ttyM6 none network +ttyM7 none network +ttyM8 none network +ttyM9 none network +ttyMa none network +ttyMb none network +ttyMc none network +ttyMd none network +ttyMe none network +ttyMf none network +ttyMg none network +ttyMh none network +ttyMi none network +ttyMj none network +ttyMk none network +ttyMl none network +ttyMm none network +ttyMn none network +ttyMo none network +ttyMp none network +ttyMq none network +ttyMr none network +ttyMs none network +ttyMt none network +ttyMu none network *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Wed Feb 11 13:44:27 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0D54106566C; Wed, 11 Feb 2009 13:44:27 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BE66C8FC08; Wed, 11 Feb 2009 13:44:27 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1BDiRuC027050; Wed, 11 Feb 2009 13:44:27 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1BDiR6n027048; Wed, 11 Feb 2009 13:44:27 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200902111344.n1BDiR6n027048@svn.freebsd.org> From: Robert Watson Date: Wed, 11 Feb 2009 13:44:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188483 - head/tools/regression/file/newfileops_on_fork X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Feb 2009 13:44:28 -0000 Author: rwatson Date: Wed Feb 11 13:44:27 2009 New Revision: 188483 URL: http://svn.freebsd.org/changeset/base/188483 Log: Add a regresion test to determine whether or not a file descriptor is allocated in a fork(2)-inheritable way at the beginning or end of an accept(2) system call. This test creates a test thread and blocks it in accept(2), then forks a child process which tests to see if the next available file descriptor is defined or not (EBADF vs EINVAL for ftruncate(2)). This detects a regression introduced during the network stack locking work, in which a very narrow race during which fork(2) from one thread during accept(2) in a second thread lead to an extra inherited file descriptor turned into a very wide race ensuring that a descriptor was leaked into the child even though it hadn't been returned. PR: kern/130348 Added: head/tools/regression/file/newfileops_on_fork/ head/tools/regression/file/newfileops_on_fork/Makefile (contents, props changed) head/tools/regression/file/newfileops_on_fork/newfileops_on_fork.c (contents, props changed) Added: head/tools/regression/file/newfileops_on_fork/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/file/newfileops_on_fork/Makefile Wed Feb 11 13:44:27 2009 (r188483) @@ -0,0 +1,8 @@ +# $FreeBSD$ + +PROG= newfileops_on_fork +NO_MAN= +WARNS?= 6 +LDFLAGS= -lpthread + +.include Added: head/tools/regression/file/newfileops_on_fork/newfileops_on_fork.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/file/newfileops_on_fork/newfileops_on_fork.c Wed Feb 11 13:44:27 2009 (r188483) @@ -0,0 +1,121 @@ +/*- + * Copyright (c) 2009 Robert N. M. Watson + * All rights reserved. + * + * This software was developed at the University of Cambridge Computer + * Laboratory with support from a grant from Google, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +/* + * When a multi-threaded application calls fork(2) from one thread while + * another thread is blocked in accept(2), we prefer that the file descriptor + * to be returned by accept(2) not appear in the child process. Test this by + * creating a thread blocked in accept(2), then forking a child and seeing if + * the fd it would have returned is defined in the child or not. + */ + +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include + +#define PORT 9000 + +static int listen_fd; + +static void * +do_accept(__unused void *arg) +{ + int accept_fd; + + accept_fd = accept(listen_fd, NULL, NULL); + if (accept_fd < 0) + err(-1, "accept"); + + return (NULL); +} + +static void +do_fork(void) +{ + int pid; + + pid = fork(); + if (pid < 0) + err(-1, "fork"); + if (pid > 0) { + waitpid(pid, NULL, 0); + exit(0); + } + + /* + * We will call ftruncate(2) on the next available file descriptor, + * listen_fd+1, and get back EBADF if it's not a valid descriptor, + * and EINVAL if it is. This (currently) works fine in practice. + */ + if (ftruncate(listen_fd + 1, 0 < 0)) { + if (errno == EBADF) + exit(0); + else if (errno == EINVAL) + errx(-1, "file descriptor still open in child"); + else + err(-1, "unexpected error"); + } else + errx(-1, "ftruncate succeeded"); +} + +int +main(__unused int argc, __unused char *argv[]) +{ + struct sockaddr_in sin; + pthread_t accept_thread; + + listen_fd = socket(PF_INET, SOCK_STREAM, 0); + if (listen_fd < 0) + err(-1, "socket"); + bzero(&sin, sizeof(sin)); + sin.sin_family = AF_INET; + sin.sin_len = sizeof(sin); + sin.sin_addr.s_addr = htonl(INADDR_LOOPBACK); + sin.sin_port = htons(PORT); + if (bind(listen_fd, (struct sockaddr *)&sin, sizeof(sin)) < 0) + err(-1, "bind"); + if (listen(listen_fd, -1) <0) + err(-1, "listen"); + if (pthread_create(&accept_thread, NULL, do_accept, NULL) < 0) + err(-1, "pthread_create"); + sleep(1); /* Easier than using a CV. */; + do_fork(); + exit(0); +} From owner-svn-src-head@FreeBSD.ORG Wed Feb 11 14:25:09 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A53FF1065670; Wed, 11 Feb 2009 14:25:09 +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 791628FC19; Wed, 11 Feb 2009 14:25:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1BEP9ml027832; Wed, 11 Feb 2009 14:25:09 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1BEP9Ov027831; Wed, 11 Feb 2009 14:25:09 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200902111425.n1BEP9Ov027831@svn.freebsd.org> From: John Baldwin Date: Wed, 11 Feb 2009 14:25:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188484 - head/sys/dev/ppbus X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Feb 2009 14:25:10 -0000 Author: jhb Date: Wed Feb 11 14:25:09 2009 New Revision: 188484 URL: http://svn.freebsd.org/changeset/base/188484 Log: Fix lptopen() and lptclose() to not trash the state of the HAVEBUS flag in 'sc_state'. This allows the lpt_release_ppbus() calls in those two routines to actually release the ppbus and thus fixes the hangs noticed with the lpt(4) driver since the recent ppbus changes. The old lpt(4) driver didn't actually check the HAVEBUS flag in lpt_release_ppbus() which is why these bugs weren't noticed before. Modified: head/sys/dev/ppbus/lpt.c Modified: head/sys/dev/ppbus/lpt.c ============================================================================== --- head/sys/dev/ppbus/lpt.c Wed Feb 11 13:44:27 2009 (r188483) +++ head/sys/dev/ppbus/lpt.c Wed Feb 11 14:25:09 2009 (r188484) @@ -544,10 +544,10 @@ lptopen(struct cdev *dev, int flags, int do { /* ran out of waiting for the printer */ if (trys++ >= LPINITRDY*4) { - sc->sc_state = 0; lprintf(("status %x\n", ppb_rstr(ppbus))); lpt_release_ppbus(lptdev); + sc->sc_state = 0; ppb_unlock(ppbus); return (EBUSY); } @@ -555,9 +555,8 @@ lptopen(struct cdev *dev, int flags, int /* wait 1/4 second, give up if we get a signal */ if (ppb_sleep(ppbus, lptdev, LPPRI | PCATCH, "lptinit", hz / 4) != EWOULDBLOCK) { - sc->sc_state = 0; - lpt_release_ppbus(lptdev); + sc->sc_state = 0; ppb_unlock(ppbus); return (EBUSY); } @@ -577,7 +576,8 @@ lptopen(struct cdev *dev, int flags, int ppb_wctr(ppbus, sc->sc_control); - sc->sc_state = OPEN; + sc->sc_state &= ~LPTINIT; + sc->sc_state |= OPEN; sc->sc_xfercnt = 0; /* only use timeout if using interrupt */ @@ -611,11 +611,8 @@ lptclose(struct cdev *dev, int flags, in int err; ppb_lock(ppbus); - if (sc->sc_flags & LP_BYPASS) { - sc->sc_state = 0; - ppb_unlock(ppbus); + if (sc->sc_flags & LP_BYPASS) goto end_close; - } if ((err = lpt_request_ppbus(lptdev, PPB_WAIT|PPB_INTR)) != 0) { ppb_unlock(ppbus); @@ -635,16 +632,16 @@ lptclose(struct cdev *dev, int flags, in sc->sc_state &= ~OPEN; callout_stop(&sc->sc_timer); ppb_wctr(ppbus, LPC_NINIT); - sc->sc_state = 0; - sc->sc_xfercnt = 0; /* * unregistration of interrupt forced by release */ lpt_release_ppbus(lptdev); - ppb_unlock(ppbus); end_close: + sc->sc_state = 0; + sc->sc_xfercnt = 0; + ppb_unlock(ppbus); lprintf(("closed.\n")); return(0); } From owner-svn-src-head@FreeBSD.ORG Wed Feb 11 14:50:16 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A8681065670; Wed, 11 Feb 2009 14:50:16 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id EF28A8FC19; Wed, 11 Feb 2009 14:50:15 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (pool-98-109-39-197.nwrknj.fios.verizon.net [98.109.39.197]) by cyrus.watson.org (Postfix) with ESMTPSA id 9A05346B52; Wed, 11 Feb 2009 09:50:15 -0500 (EST) Received: from localhost (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.14.3/8.14.3) with ESMTP id n1BEo9F9025248; Wed, 11 Feb 2009 09:50:09 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: Alexander Motin Date: Wed, 11 Feb 2009 08:29:20 -0500 User-Agent: KMail/1.9.7 References: <200902102322.n1ANMTgW007393@svn.freebsd.org> In-Reply-To: <200902102322.n1ANMTgW007393@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200902110829.20859.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Wed, 11 Feb 2009 09:50:09 -0500 (EST) X-Virus-Scanned: ClamAV 0.94.2/8979/Wed Feb 11 07:23:15 2009 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r188464 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Feb 2009 14:50:16 -0000 On Tuesday 10 February 2009 6:22:29 pm Alexander Motin wrote: > Author: mav > Date: Tue Feb 10 23:22:29 2009 > New Revision: 188464 > URL: http://svn.freebsd.org/changeset/base/188464 > > Log: > Check for device_set_devclass() errors and skip driver probe/attach if any. > Attach call without devclass set crashes the system. > > On resume AHCI driver sometimes tries to create duplicate adX device. > It is surely his own problem, but IMHO it is not a reason to crash here. > Other reasons are also possible. Can you describe the problem a bit more fully? Is the ata driver adding a device with a fixed unit number but a wildcard class? (That is, it is doing something like 'device_add_child(dev, NULL, 4)'?) -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Wed Feb 11 15:00:11 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 543C310656C6; Wed, 11 Feb 2009 15:00:11 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from cmail.optima.ua (cmail.optima.ua [195.248.191.121]) by mx1.freebsd.org (Postfix) with ESMTP id 4DA8D8FC23; Wed, 11 Feb 2009 15:00:09 +0000 (UTC) (envelope-from mav@FreeBSD.org) X-Spam-Flag: SKIP X-Spam-Yversion: Spamooborona-2.1.0 Received: from orphanage.alkar.net (account mav@alkar.net [212.86.226.11] verified) by cmail.optima.ua (CommuniGate Pro SMTP 5.2.9) with ESMTPA id 234296925; Wed, 11 Feb 2009 17:00:09 +0200 Message-ID: <4992E7F8.9050509@FreeBSD.org> Date: Wed, 11 Feb 2009 17:00:08 +0200 From: Alexander Motin User-Agent: Thunderbird 2.0.0.14 (X11/20080612) MIME-Version: 1.0 To: John Baldwin References: <200902102322.n1ANMTgW007393@svn.freebsd.org> <200902110829.20859.jhb@freebsd.org> In-Reply-To: <200902110829.20859.jhb@freebsd.org> X-Enigmail-Version: 0.95.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r188464 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Feb 2009 15:00:12 -0000 John Baldwin wrote: > On Tuesday 10 February 2009 6:22:29 pm Alexander Motin wrote: >> Author: mav >> Date: Tue Feb 10 23:22:29 2009 >> New Revision: 188464 >> URL: http://svn.freebsd.org/changeset/base/188464 >> >> Log: >> Check for device_set_devclass() errors and skip driver probe/attach if > any. >> Attach call without devclass set crashes the system. >> >> On resume AHCI driver sometimes tries to create duplicate adX device. >> It is surely his own problem, but IMHO it is not a reason to crash here. >> Other reasons are also possible. > > Can you describe the problem a bit more fully? Is the ata driver adding a > device with a fixed unit number but a wildcard class? (That is, it is doing > something like 'device_add_child(dev, NULL, 4)'?) Exactly. Class detected later as "ad" or as "acd", or something else. So it does not get any error on that stage. But later, on driver_probe(), device_set_devclass() returns error which left unhandled and causes later crash inside following device_attach(). -- Alexander Motin From owner-svn-src-head@FreeBSD.ORG Wed Feb 11 15:22:01 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F17A10656C5; Wed, 11 Feb 2009 15:22:01 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6CCD08FC08; Wed, 11 Feb 2009 15:22:01 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1BFM1ri029227; Wed, 11 Feb 2009 15:22:01 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1BFM1H2029226; Wed, 11 Feb 2009 15:22:01 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200902111522.n1BFM1H2029226@svn.freebsd.org> From: Robert Watson Date: Wed, 11 Feb 2009 15:22:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188485 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Feb 2009 15:22:02 -0000 Author: rwatson Date: Wed Feb 11 15:22:01 2009 New Revision: 188485 URL: http://svn.freebsd.org/changeset/base/188485 Log: Modify fdcopy() so that, during fork(2), it won't copy file descriptors from the parent to the child process if they have an operation vector of &badfileops. This narrows a set of races involving system calls that allocate a new file descriptor, potentially block for some extended period, and then return the file descriptor, when invoked by a threaded program that concurrently invokes fork(2). Similar approches are used in both Solaris and Linux, and the wideness of this race was introduced in FreeBSD when we moved to a more optimistic implementation of accept(2) in order to simplify locking. A small race necessarily remains because the fork(2) might occur after the finit() in accept(2) but before the system call has returned, but that appears unavoidable using current APIs. However, this race is vastly narrower. The fix can be validated using the newfileops_on_fork regression test. PR: kern/130348 Reported by: Ivan Shcheklein Reviewed by: jhb, kib MFC after: 1 week Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Wed Feb 11 14:25:09 2009 (r188484) +++ head/sys/kern/kern_descrip.c Wed Feb 11 15:22:01 2009 (r188485) @@ -1583,7 +1583,8 @@ fdcopy(struct filedesc *fdp) newfdp->fd_freefile = -1; for (i = 0; i <= fdp->fd_lastfile; ++i) { if (fdisused(fdp, i) && - fdp->fd_ofiles[i]->f_type != DTYPE_KQUEUE) { + fdp->fd_ofiles[i]->f_type != DTYPE_KQUEUE && + fdp->fd_ofiles[i]->f_ops != &badfileops) { newfdp->fd_ofiles[i] = fdp->fd_ofiles[i]; newfdp->fd_ofileflags[i] = fdp->fd_ofileflags[i]; fhold(newfdp->fd_ofiles[i]); From owner-svn-src-head@FreeBSD.ORG Wed Feb 11 16:28:49 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B0DDF1065674; Wed, 11 Feb 2009 16:28:49 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9E8A98FC25; Wed, 11 Feb 2009 16:28:49 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1BGSnjE030502; Wed, 11 Feb 2009 16:28:49 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1BGSndA030498; Wed, 11 Feb 2009 16:28:49 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200902111628.n1BGSndA030498@svn.freebsd.org> From: Ed Schouten Date: Wed, 11 Feb 2009 16:28:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188487 - in head: sys/kern sys/sys usr.sbin/pstat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Feb 2009 16:28:50 -0000 Author: ed Date: Wed Feb 11 16:28:49 2009 New Revision: 188487 URL: http://svn.freebsd.org/changeset/base/188487 Log: Serialize write() calls on TTYs. Just like the old TTY layer, the current MPSAFE TTY layer does not make any attempt to serialize calls of write(). Data is copied into the kernel in 256 (TTY_STACKBUF) byte chunks. If a write() call occurs at the same time, the data may interleave. This is especially likely when the TTY starts blocking, because the output queue reaches the high watermark. I've implemented this by adding a new flag, TTY_BUSY_OUT, which is used to mark a TTY as having a thread stuck in write(). Because I don't want non-blocking processes to be possibly blocked by a sleeping thread, I'm still allowing it to bypass the protection. According to this message, the Linux kernel returns EAGAIN in such cases, but I think that's a little too restrictive: http://kerneltrap.org/index.php?q=mailarchive/linux-kernel/2007/5/2/85418/thread PR: kern/118287 Modified: head/sys/kern/tty.c head/sys/sys/tty.h head/usr.sbin/pstat/pstat.8 head/usr.sbin/pstat/pstat.c Modified: head/sys/kern/tty.c ============================================================================== --- head/sys/kern/tty.c Wed Feb 11 15:55:01 2009 (r188486) +++ head/sys/kern/tty.c Wed Feb 11 16:28:49 2009 (r188487) @@ -438,15 +438,28 @@ ttydev_write(struct cdev *dev, struct ui if (tp->t_termios.c_lflag & TOSTOP) { error = tty_wait_background(tp, curthread, SIGTTOU); - if (error) { - tty_unlock(tp); - return (error); - } + if (error) + goto done; } - error = ttydisc_write(tp, uio, ioflag); - tty_unlock(tp); + if (ioflag & IO_NDELAY && tp->t_flags & TF_BUSY_OUT) { + /* Allow non-blocking writes to bypass serialization. */ + error = ttydisc_write(tp, uio, ioflag); + } else { + /* Serialize write() calls. */ + while (tp->t_flags & TF_BUSY_OUT) { + error = tty_wait(tp, &tp->t_bgwait); + if (error) + goto done; + } + + tp->t_flags |= TF_BUSY_OUT; + error = ttydisc_write(tp, uio, ioflag); + tp->t_flags &= ~TF_BUSY_OUT; + cv_broadcast(&tp->t_bgwait); + } +done: tty_unlock(tp); return (error); } @@ -1880,6 +1893,11 @@ static struct { { TF_ZOMBIE, 'Z' }, { TF_HOOK, 's' }, + /* Keep these together -> 'bi' and 'bo'. */ + { TF_BUSY, 'b' }, + { TF_BUSY_IN, 'i' }, + { TF_BUSY_OUT, 'o' }, + { 0, '\0'}, }; Modified: head/sys/sys/tty.h ============================================================================== --- head/sys/sys/tty.h Wed Feb 11 15:55:01 2009 (r188486) +++ head/sys/sys/tty.h Wed Feb 11 16:28:49 2009 (r188487) @@ -83,6 +83,9 @@ struct tty { #define TF_BYPASS 0x04000 /* Optimized input path. */ #define TF_ZOMBIE 0x08000 /* Modem disconnect received. */ #define TF_HOOK 0x10000 /* TTY has hook attached. */ +#define TF_BUSY_IN 0x20000 /* Process busy in read() -- not supported. */ +#define TF_BUSY_OUT 0x40000 /* Process busy in write(). */ +#define TF_BUSY (TF_BUSY_IN|TF_BUSY_OUT) unsigned int t_revokecnt; /* (t) revoke() count. */ /* Buffering mechanisms. */ Modified: head/usr.sbin/pstat/pstat.8 ============================================================================== --- head/usr.sbin/pstat/pstat.8 Wed Feb 11 15:55:01 2009 (r188486) +++ head/usr.sbin/pstat/pstat.8 Wed Feb 11 16:28:49 2009 (r188487) @@ -206,6 +206,11 @@ block mode input routine in use connection lost .It s i/o being snooped +.It b +busy in +.Xr read 2 +or +.Xr write 2 .El .Pp The Modified: head/usr.sbin/pstat/pstat.c ============================================================================== --- head/usr.sbin/pstat/pstat.c Wed Feb 11 15:55:01 2009 (r188486) +++ head/usr.sbin/pstat/pstat.c Wed Feb 11 16:28:49 2009 (r188487) @@ -315,6 +315,11 @@ static struct { { TF_ZOMBIE, 'Z' }, { TF_HOOK, 's' }, + /* Keep these together -> 'bi' and 'bo'. */ + { TF_BUSY, 'b' }, + { TF_BUSY_IN, 'i' }, + { TF_BUSY_OUT, 'o' }, + { 0, '\0'}, }; From owner-svn-src-head@FreeBSD.ORG Wed Feb 11 17:26:47 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AE746106566B; Wed, 11 Feb 2009 17:26:47 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9CD588FC08; Wed, 11 Feb 2009 17:26:47 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1BHQlB6031518; Wed, 11 Feb 2009 17:26:47 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1BHQl0x031517; Wed, 11 Feb 2009 17:26:47 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902111726.n1BHQl0x031517@svn.freebsd.org> From: Sam Leffler Date: Wed, 11 Feb 2009 17:26:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188488 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Feb 2009 17:26:48 -0000 Author: sam Date: Wed Feb 11 17:26:47 2009 New Revision: 188488 URL: http://svn.freebsd.org/changeset/base/188488 Log: fix mis-numbering of IEEE80211_MSG_BITS Modified: head/sys/net80211/ieee80211_var.h Modified: head/sys/net80211/ieee80211_var.h ============================================================================== --- head/sys/net80211/ieee80211_var.h Wed Feb 11 16:28:49 2009 (r188487) +++ head/sys/net80211/ieee80211_var.h Wed Feb 11 17:26:47 2009 (r188488) @@ -720,10 +720,10 @@ ieee80211_htchanflags(const struct ieee8 #define IEEE80211_MSG_ANY 0xffffffff /* anything */ #define IEEE80211_MSG_BITS \ - "\20\3IOCTL\4WDS\5ACTION\6RATECTL\7ROAM\10INACT\11DOTH\12SUPERG" \ - "\13WME\14ACL\15WPA\16RADKEYS\17RADDUMP\20RADIUS\21DOT1X\22POWER" \ - "\23STATE\24OUTPUT\25SCAN\26AUTH\27ASSOC\30NODE\31ELEMID\32XRATE" \ - "\33INPUT\34CRYPTO\35DUPMPKTS\36DEBUG\3711N" + "\20\2TDMA\3IOCTL\4WDS\5ACTION\6RATECTL\7ROAM\10INACT\11DOTH\12SUPERG" \ + "\13WME\14ACL\15WPA\16RADKEYS\17RADDUMP\20RADIUS\21DOT1XSM\22DOT1X" \ + "\23POWER\24STATE\25OUTPUT\26SCAN\27AUTH\30ASSOC\31NODE\32ELEMID" \ + "\33XRATE\34INPUT\35CRYPTO\36DUPMPKTS\37DEBUG\4011N" #ifdef IEEE80211_DEBUG #define ieee80211_msg(_vap, _m) ((_vap)->iv_debug & (_m)) From owner-svn-src-head@FreeBSD.ORG Wed Feb 11 17:30:36 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6954F1065675; Wed, 11 Feb 2009 17:30:36 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 581E08FC20; Wed, 11 Feb 2009 17:30:36 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1BHUaag031619; Wed, 11 Feb 2009 17:30:36 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1BHUaen031618; Wed, 11 Feb 2009 17:30:36 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902111730.n1BHUaen031618@svn.freebsd.org> From: Sam Leffler Date: Wed, 11 Feb 2009 17:30:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188489 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Feb 2009 17:30:37 -0000 Author: sam Date: Wed Feb 11 17:30:36 2009 New Revision: 188489 URL: http://svn.freebsd.org/changeset/base/188489 Log: remove bogus reference reclaim on the slave-side bss node on beacon miss Modified: head/sys/net80211/ieee80211_tdma.c Modified: head/sys/net80211/ieee80211_tdma.c ============================================================================== --- head/sys/net80211/ieee80211_tdma.c Wed Feb 11 17:26:47 2009 (r188488) +++ head/sys/net80211/ieee80211_tdma.c Wed Feb 11 17:30:36 2009 (r188489) @@ -214,7 +214,6 @@ tdma_newstate(struct ieee80211vap *vap, if (ostate == IEEE80211_S_RUN) { /* purge station table; entries are stale */ ieee80211_iterate_nodes(&ic->ic_sta, sta_leave, vap); - ieee80211_free_node(vap->iv_bss); /* XXX */ } if (vap->iv_flags_ext & IEEE80211_FEXT_SCANREQ) { ieee80211_check_scan(vap, From owner-svn-src-head@FreeBSD.ORG Wed Feb 11 18:13:21 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C2D9106566C; Wed, 11 Feb 2009 18:13:21 +0000 (UTC) (envelope-from lulf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2AB0F8FC15; Wed, 11 Feb 2009 18:13:21 +0000 (UTC) (envelope-from lulf@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1BIDLVl032524; Wed, 11 Feb 2009 18:13:21 GMT (envelope-from lulf@svn.freebsd.org) Received: (from lulf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1BIDLvJ032523; Wed, 11 Feb 2009 18:13:21 GMT (envelope-from lulf@svn.freebsd.org) Message-Id: <200902111813.n1BIDLvJ032523@svn.freebsd.org> From: Ulf Lilleengen Date: Wed, 11 Feb 2009 18:13:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188492 - head/sys/geom/label X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Feb 2009 18:13:21 -0000 Author: lulf Date: Wed Feb 11 18:13:20 2009 New Revision: 188492 URL: http://svn.freebsd.org/changeset/base/188492 Log: - Use the correct argument when determining the buffer size. PR: kern/131575 MFC after: 2 days Modified: head/sys/geom/label/g_label_msdosfs.c Modified: head/sys/geom/label/g_label_msdosfs.c ============================================================================== --- head/sys/geom/label/g_label_msdosfs.c Wed Feb 11 17:33:36 2009 (r188491) +++ head/sys/geom/label/g_label_msdosfs.c Wed Feb 11 18:13:20 2009 (r188492) @@ -186,7 +186,7 @@ g_label_msdosfs_taste(struct g_consumer FAT_DES_ATTR_VOLUME_ID) { strlcpy(label, pfat_entry->DIR_Name, MIN(size, - sizeof(pfat_bsbpb->BS_VolLab) + 1)); + sizeof(pfat_entry->DIR_Name) + 1)); goto endofchecks; } } while((uint8_t *)(++pfat_entry) < From owner-svn-src-head@FreeBSD.ORG Wed Feb 11 18:39:20 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 818E61065738; Wed, 11 Feb 2009 18:39:20 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6FA148FC29; Wed, 11 Feb 2009 18:39:20 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1BIdKqb033137; Wed, 11 Feb 2009 18:39:20 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1BIdKZ7033136; Wed, 11 Feb 2009 18:39:20 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902111839.n1BIdKZ7033136@svn.freebsd.org> From: Sam Leffler Date: Wed, 11 Feb 2009 18:39:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188493 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Feb 2009 18:39:21 -0000 Author: sam Date: Wed Feb 11 18:39:20 2009 New Revision: 188493 URL: http://svn.freebsd.org/changeset/base/188493 Log: oops, fix octal escape sequence Modified: head/sys/net80211/ieee80211_var.h Modified: head/sys/net80211/ieee80211_var.h ============================================================================== --- head/sys/net80211/ieee80211_var.h Wed Feb 11 18:13:20 2009 (r188492) +++ head/sys/net80211/ieee80211_var.h Wed Feb 11 18:39:20 2009 (r188493) @@ -723,7 +723,7 @@ ieee80211_htchanflags(const struct ieee8 "\20\2TDMA\3IOCTL\4WDS\5ACTION\6RATECTL\7ROAM\10INACT\11DOTH\12SUPERG" \ "\13WME\14ACL\15WPA\16RADKEYS\17RADDUMP\20RADIUS\21DOT1XSM\22DOT1X" \ "\23POWER\24STATE\25OUTPUT\26SCAN\27AUTH\30ASSOC\31NODE\32ELEMID" \ - "\33XRATE\34INPUT\35CRYPTO\36DUPMPKTS\37DEBUG\4011N" + "\33XRATE\34INPUT\35CRYPTO\36DUPMPKTS\37DEBUG\04011N" #ifdef IEEE80211_DEBUG #define ieee80211_msg(_vap, _m) ((_vap)->iv_debug & (_m)) From owner-svn-src-head@FreeBSD.ORG Wed Feb 11 18:40:10 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 19BB9106568B; Wed, 11 Feb 2009 18:40:10 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 07FD28FC15; Wed, 11 Feb 2009 18:40:10 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1BIe9bj033194; Wed, 11 Feb 2009 18:40:09 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1BIe9Gs033193; Wed, 11 Feb 2009 18:40:09 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902111840.n1BIe9Gs033193@svn.freebsd.org> From: Sam Leffler Date: Wed, 11 Feb 2009 18:40:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188494 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Feb 2009 18:40:10 -0000 Author: sam Date: Wed Feb 11 18:40:09 2009 New Revision: 188494 URL: http://svn.freebsd.org/changeset/base/188494 Log: improve key index map reclaim debug msg Modified: head/sys/net80211/ieee80211_node.c Modified: head/sys/net80211/ieee80211_node.c ============================================================================== --- head/sys/net80211/ieee80211_node.c Wed Feb 11 18:39:20 2009 (r188493) +++ head/sys/net80211/ieee80211_node.c Wed Feb 11 18:40:09 2009 (r188494) @@ -1719,8 +1719,8 @@ node_reclaim(struct ieee80211_node_table if (nt->nt_keyixmap != NULL && keyix < nt->nt_keyixmax && nt->nt_keyixmap[keyix] == ni) { IEEE80211_DPRINTF(ni->ni_vap, IEEE80211_MSG_NODE, - "%s: %p<%s> clear key map entry\n", - __func__, ni, ether_sprintf(ni->ni_macaddr)); + "%s: %p<%s> clear key map entry %u\n", + __func__, ni, ether_sprintf(ni->ni_macaddr), keyix); nt->nt_keyixmap[keyix] = NULL; ieee80211_node_decref(ni); /* NB: don't need free */ } @@ -1763,8 +1763,7 @@ ieee80211_node_reclaim(struct ieee80211_ */ _ieee80211_free_node(ni); nt = NULL; - } else if (ieee80211_node_refcnt(ni) == 1 && - nt->nt_keyixmap != NULL) { + } else if (ieee80211_node_refcnt(ni) == 1 && nt->nt_keyixmap != NULL) { ieee80211_keyix keyix; /* * Check for a last reference in the key mapping table. @@ -1774,8 +1773,8 @@ ieee80211_node_reclaim(struct ieee80211_ nt->nt_keyixmap[keyix] == ni) { IEEE80211_DPRINTF(ni->ni_vap, IEEE80211_MSG_NODE, - "%s: %p<%s> clear key map entry", __func__, - ni, ether_sprintf(ni->ni_macaddr)); + "%s: %p<%s> clear key map entry %u", __func__, + ni, ether_sprintf(ni->ni_macaddr), keyix); nt->nt_keyixmap[keyix] = NULL; ieee80211_node_decref(ni); /* XXX needed? */ _ieee80211_free_node(ni); From owner-svn-src-head@FreeBSD.ORG Wed Feb 11 20:25:00 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3F39A10656C8; Wed, 11 Feb 2009 20:25:00 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 21B0E8FC1A; Wed, 11 Feb 2009 20:25:00 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1BKP0aL035272; Wed, 11 Feb 2009 20:25:00 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1BKOxcc035265; Wed, 11 Feb 2009 20:24:59 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200902112024.n1BKOxcc035265@svn.freebsd.org> From: Ed Schouten Date: Wed, 11 Feb 2009 20:24:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188497 - in head: include lib/libc/gen lib/libc/stdlib X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Feb 2009 20:25:01 -0000 Author: ed Date: Wed Feb 11 20:24:59 2009 New Revision: 188497 URL: http://svn.freebsd.org/changeset/base/188497 Log: Add two new routines: fdevname() and fdevname_r(). A more elegant way of obtaining a name of a character device by its file descriptor on FreeBSD, is to use the FIODGNAME ioctl. Because a valid file descriptor implies a file descriptor is visible in /dev, it will always resolve a valid device name. I'm adding a more friendly wrapper for this ioctl, called fdevname(). It is a lot easier to use than devname() and also has better error handling. When a device name cannot be resolved, it will just return NULL instead of a generated device name that makes no sense. Discussed with: kib Added: head/lib/libc/gen/fdevname.c (contents, props changed) Modified: head/include/stdlib.h head/lib/libc/gen/Makefile.inc head/lib/libc/gen/Symbol.map head/lib/libc/gen/devname.3 head/lib/libc/gen/ttyname.c head/lib/libc/stdlib/ptsname.c Modified: head/include/stdlib.h ============================================================================== --- head/include/stdlib.h Wed Feb 11 18:42:56 2009 (r188496) +++ head/include/stdlib.h Wed Feb 11 20:24:59 2009 (r188497) @@ -256,6 +256,8 @@ int cgetustr(char *, const char *, char int daemon(int, int); char *devname(__dev_t, __mode_t); char *devname_r(__dev_t, __mode_t, char *, int); +char *fdevname(int); +char *fdevname_r(int, char *, int); int getloadavg(double [], int); __const char * getprogname(void); Modified: head/lib/libc/gen/Makefile.inc ============================================================================== --- head/lib/libc/gen/Makefile.inc Wed Feb 11 18:42:56 2009 (r188496) +++ head/lib/libc/gen/Makefile.inc Wed Feb 11 20:24:59 2009 (r188497) @@ -10,7 +10,7 @@ SRCS+= __getosreldate.c __xuname.c \ clock.c closedir.c confstr.c \ crypt.c ctermid.c daemon.c devname.c dirname.c disklabel.c \ dlfcn.c dlfunc.c drand48.c erand48.c err.c errlst.c errno.c \ - exec.c feature_present.c fmtcheck.c fmtmsg.c fnmatch.c \ + exec.c fdevname.c feature_present.c fmtcheck.c fmtmsg.c fnmatch.c \ fpclassify.c frexp.c fstab.c ftok.c fts.c fts-compat.c ftw.c \ getbootfile.c getbsize.c \ getcap.c getcwd.c getdomainname.c getgrent.c getgrouplist.c \ @@ -78,6 +78,8 @@ MLINKS+=arc4random.3 arc4random_addrando arc4random.3 arc4random_buf.3 arc4random.3 arc4random_uniform.3 MLINKS+=ctermid.3 ctermid_r.3 MLINKS+=devname.3 devname_r.3 +MLINKS+=devname.3 fdevname.3 +MLINKS+=devname.3 fdevname_r.3 MLINKS+=directory.3 closedir.3 directory.3 dirfd.3 directory.3 opendir.3 \ directory.3 fdopendir.3 \ directory.3 readdir.3 directory.3 readdir_r.3 directory.3 rewinddir.3 \ Modified: head/lib/libc/gen/Symbol.map ============================================================================== --- head/lib/libc/gen/Symbol.map Wed Feb 11 18:42:56 2009 (r188496) +++ head/lib/libc/gen/Symbol.map Wed Feb 11 20:24:59 2009 (r188497) @@ -331,6 +331,8 @@ FBSD_1.0 { FBSD_1.1 { arc4random_buf; arc4random_uniform; + fdevname; + fdevname_r; fdopendir; feature_present; fts_open; Modified: head/lib/libc/gen/devname.3 ============================================================================== --- head/lib/libc/gen/devname.3 Wed Feb 11 18:42:56 2009 (r188496) +++ head/lib/libc/gen/devname.3 Wed Feb 11 20:24:59 2009 (r188497) @@ -43,6 +43,10 @@ .Fn devname "dev_t dev" "mode_t type" .Ft char * .Fn devname_r "dev_t dev" "mode_t type" "char *buf" "int len" +.Ft char * +.Fn fdevname "int fd" +.Ft char * +.Fn fdevname_r "int fd" "char *buf" "int len" .Sh DESCRIPTION The .Fn devname @@ -69,11 +73,24 @@ and .Fa type in a human-readable format. .Pp +The +.Fn fdevname +and +.Fn fdevname_r +function obtains the device name directly from a file descriptor +pointing to a character device. +If it is unable to come up with a suitable name, these functions will +return a NULL pointer. +.Pp .Fn devname -returns the name stored in a static buffer which will be overwritten +and +.Fn fdevname +return the name stored in a static buffer which will be overwritten on subsequent calls. .Fn devname_r -takes a buffer and length as argument to avoid this problem. +and +.Fn fdevname_r +take a buffer and length as argument to avoid this problem. .Sh EXAMPLES .Bd -literal -compact int fd; @@ -83,6 +100,7 @@ char *name; fd = open("/dev/tun"); fstat(fd, &buf); printf("devname is /dev/%s\en", devname(buf.st_rdev, S_IFCHR)); + printf("fdevname is /dev/%s\en", fdevname(fd)); .Ed .Sh SEE ALSO .Xr stat 2 @@ -91,3 +109,7 @@ The .Fn devname function appeared in .Bx 4.4 . +The +.Fn fdevname +function appeared in +.Fx 8.0 . Added: head/lib/libc/gen/fdevname.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/gen/fdevname.c Wed Feb 11 20:24:59 2009 (r188497) @@ -0,0 +1,54 @@ +/*- + * Copyright (c) 2009 Ed Schouten + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "namespace.h" +#include +#include +#include "un-namespace.h" + +char * +fdevname_r(int fd, char *buf, int len) +{ + struct fiodgname_arg fgn; + + fgn.buf = buf; + fgn.len = len; + + if (_ioctl(fd, FIODGNAME, &fgn) == -1) + return (NULL); + return (buf); +} + +char * +fdevname(int fd) +{ + static char buf[SPECNAMELEN + 1]; + + return (fdevname_r(fd, buf, sizeof(buf))); +} Modified: head/lib/libc/gen/ttyname.c ============================================================================== --- head/lib/libc/gen/ttyname.c Wed Feb 11 18:42:56 2009 (r188496) +++ head/lib/libc/gen/ttyname.c Wed Feb 11 20:24:59 2009 (r188497) @@ -35,7 +35,6 @@ __FBSDID("$FreeBSD$"); #include "namespace.h" #include -#include #include #include #include @@ -60,8 +59,6 @@ static int ttyname_keycreated = 0; int ttyname_r(int fd, char *buf, size_t len) { - struct stat sb; - struct fiodgname_arg fgn; size_t used; *buf = '\0'; @@ -69,21 +66,14 @@ ttyname_r(int fd, char *buf, size_t len) /* Must be a terminal. */ if (!isatty(fd)) return (ENOTTY); - /* Must be a character device. */ - if (_fstat(fd, &sb) || !S_ISCHR(sb.st_mode)) - return (ENOTTY); /* Must have enough room */ if (len <= sizeof(_PATH_DEV)) return (ERANGE); strcpy(buf, _PATH_DEV); used = strlen(buf); - fgn.len = len - used; - fgn.buf = buf + used; - if (!_ioctl(fd, FIODGNAME, &fgn)) - return (0); - used = strlen(buf); - devname_r(sb.st_rdev, S_IFCHR, buf + used, len - used); + if (fdevname_r(fd, buf + used, len - used) == NULL) + return (ENOTTY); return (0); } Modified: head/lib/libc/stdlib/ptsname.c ============================================================================== --- head/lib/libc/stdlib/ptsname.c Wed Feb 11 18:42:56 2009 (r188496) +++ head/lib/libc/stdlib/ptsname.c Wed Feb 11 20:24:59 2009 (r188497) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include "un-namespace.h" /* @@ -75,7 +76,6 @@ char * ptsname(int fildes) { static char pt_slave[sizeof _PATH_DEV + SPECNAMELEN] = _PATH_DEV; - struct fiodgname_arg fgn; char *ret = NULL; int sverrno = errno; @@ -83,10 +83,8 @@ ptsname(int fildes) if (__isptmaster(fildes) != 0) goto done; - /* Obtain the device name through FIODGNAME. */ - fgn.len = sizeof pt_slave - (sizeof _PATH_DEV - 1); - fgn.buf = pt_slave + (sizeof _PATH_DEV - 1); - if (_ioctl(fildes, FIODGNAME, &fgn) == 0) + if (fdevname_r(fildes, pt_slave + (sizeof _PATH_DEV - 1), + sizeof pt_slave - (sizeof _PATH_DEV - 1)) != NULL) ret = pt_slave; done: /* Make sure ptsname() does not overwrite errno. */ From owner-svn-src-head@FreeBSD.ORG Wed Feb 11 20:36:18 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 413F810656DF; Wed, 11 Feb 2009 20:36:18 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 15B228FC1B; Wed, 11 Feb 2009 20:36:18 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1BKaHVo035502; Wed, 11 Feb 2009 20:36:17 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1BKaH67035501; Wed, 11 Feb 2009 20:36:17 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200902112036.n1BKaH67035501@svn.freebsd.org> From: Ed Schouten Date: Wed, 11 Feb 2009 20:36:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188498 - head/usr.bin/stat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Feb 2009 20:36:18 -0000 Author: ed Date: Wed Feb 11 20:36:17 2009 New Revision: 188498 URL: http://svn.freebsd.org/changeset/base/188498 Log: Let stat(1) use fdevname(3). Because we now have a reliable library function that converts file descriptors to character device names, let stat(1) use this. This means it can now do the following: $ stat -f %N /dev/pts/0 I've changed main() to set file properly, so output() is never called with file set to NULL. Approved by: dougb (older version, still used devname) Modified: head/usr.bin/stat/stat.c Modified: head/usr.bin/stat/stat.c ============================================================================== --- head/usr.bin/stat/stat.c Wed Feb 11 20:24:59 2009 (r188497) +++ head/usr.bin/stat/stat.c Wed Feb 11 20:36:17 2009 (r188498) @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); #define HAVE_DEVNAME 1 #endif /* HAVE_CONFIG_H */ +#include #include #include @@ -60,6 +61,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -204,6 +206,8 @@ main(int argc, char *argv[]) int ch, rc, errs, am_readlink; int lsF, fmtchar, usestat, fn, nonl, quiet; char *statfmt, *options, *synopsis; + char dname[sizeof _PATH_DEV + SPECNAMELEN] = _PATH_DEV; + const char *file; am_readlink = 0; lsF = 0; @@ -304,22 +308,29 @@ main(int argc, char *argv[]) errs = 0; do { - if (argc == 0) + if (argc == 0) { + if (fdevname_r(STDIN_FILENO, dname + + sizeof _PATH_DEV - 1, SPECNAMELEN) != NULL) + file = dname; + else + file = "(stdin)"; rc = fstat(STDIN_FILENO, &st); - else if (usestat) - rc = stat(argv[0], &st); - else - rc = lstat(argv[0], &st); + } else { + file = argv[0]; + if (usestat) + rc = stat(file, &st); + else + rc = lstat(file, &st); + } if (rc == -1) { errs = 1; linkfail = 1; if (!quiet) - warn("%s: stat", - argc == 0 ? "(stdin)" : argv[0]); + warn("%s: stat", file); } else - output(&st, argv[0], statfmt, fn, nonl, quiet); + output(&st, file, statfmt, fn, nonl, quiet); argv++; argc--; @@ -810,10 +821,7 @@ format1(const struct stat *st, case SHOW_filename: small = 0; data = 0; - if (file == NULL) - (void)strncpy(path, "(stdin)", sizeof(path)); - else - (void)strncpy(path, file, sizeof(path)); + (void)strncpy(path, file, sizeof(path)); sdata = path; formats = FMTF_STRING; if (ofmt == 0) From owner-svn-src-head@FreeBSD.ORG Wed Feb 11 20:40:27 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 719EC1065674; Wed, 11 Feb 2009 20:40:27 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.terabit.net.ua (mail.terabit.net.ua [195.137.202.147]) by mx1.freebsd.org (Postfix) with ESMTP id 110A68FC1B; Wed, 11 Feb 2009 20:40:27 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from skuns.zoral.com.ua ([91.193.166.194] helo=mail.zoral.com.ua) by mail.terabit.net.ua with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63 (FreeBSD)) (envelope-from ) id 1LXLsf-0006GB-61; Wed, 11 Feb 2009 22:40:25 +0200 Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id n1BKeLrG045928 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 11 Feb 2009 22:40:21 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3) with ESMTP id n1BKeL9E083155; Wed, 11 Feb 2009 22:40:21 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id n1BKeLqj083154; Wed, 11 Feb 2009 22:40:21 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 11 Feb 2009 22:40:21 +0200 From: Kostik Belousov To: Ed Schouten Message-ID: <20090211204021.GA2723@deviant.kiev.zoral.com.ua> References: <200902112024.n1BKOxcc035265@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="J2SCkAp4GZ/dPZZf" Content-Disposition: inline In-Reply-To: <200902112024.n1BKOxcc035265@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua X-Virus-Scanned: mail.terabit.net.ua 1LXLsf-0006GB-61 5c486b2157c7d147050f5d69d1d2bbc5 X-Terabit: YES Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r188497 - in head: include lib/libc/gen lib/libc/stdlib X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Feb 2009 20:40:28 -0000 --J2SCkAp4GZ/dPZZf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Feb 11, 2009 at 08:24:59PM +0000, Ed Schouten wrote: > Author: ed > Date: Wed Feb 11 20:24:59 2009 > New Revision: 188497 > URL: http://svn.freebsd.org/changeset/base/188497 >=20 > Log: > descriptor on FreeBSD, is to use the FIODGNAME ioctl. Because a valid > file descriptor implies a file descriptor is visible in /dev, it will This is not true. > always resolve a valid device name. --J2SCkAp4GZ/dPZZf Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkmTN7QACgkQC3+MBN1Mb4gGugCdHsoM+9qnGPhNcXLtk061yAlN icoAn3LPY/ApgAZEZ7Lmv0WzBaYtSoiJ =1b5q -----END PGP SIGNATURE----- --J2SCkAp4GZ/dPZZf-- From owner-svn-src-head@FreeBSD.ORG Wed Feb 11 22:15:38 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 56CA51065706; Wed, 11 Feb 2009 22:15:38 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 449EC8FC0A; Wed, 11 Feb 2009 22:15:38 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1BMFcGT037453; Wed, 11 Feb 2009 22:15:38 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1BMFcFP037452; Wed, 11 Feb 2009 22:15:38 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902112215.n1BMFcFP037452@svn.freebsd.org> From: Sam Leffler Date: Wed, 11 Feb 2009 22:15:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188499 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Feb 2009 22:15:39 -0000 Author: sam Date: Wed Feb 11 22:15:37 2009 New Revision: 188499 URL: http://svn.freebsd.org/changeset/base/188499 Log: gcc 4.3.2 examines getLowerUpperIndex() and concludes that it's not guaranteed to initialize its two last arguments. Therefore, there is a warning in the subsequent caller ar5416FillVpdTable(), which doesn't initialize those arguments. Change getLowerUpperIndex() to assign values to indexL and indexR even in the case of assertion failure. Submitted by: Pavel Roskin Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Wed Feb 11 20:36:17 2009 (r188498) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Wed Feb 11 22:15:37 2009 (r188499) @@ -2710,6 +2710,7 @@ getLowerUpperIndex(uint8_t target, uint8 } } HALASSERT(0); + *indexL = *indexR = 0; return AH_FALSE; } From owner-svn-src-head@FreeBSD.ORG Wed Feb 11 22:17:26 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 429A01065765; Wed, 11 Feb 2009 22:17:26 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214]) by mx1.freebsd.org (Postfix) with ESMTP id C56F58FC12; Wed, 11 Feb 2009 22:17:25 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.14.3/8.14.3/ALCHEMY.FRANKEN.DE) with ESMTP id n1BMHKXh016428; Wed, 11 Feb 2009 23:17:20 +0100 (CET) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.14.3/8.14.3/Submit) id n1BMHK7G016427; Wed, 11 Feb 2009 23:17:20 +0100 (CET) (envelope-from marius) Date: Wed, 11 Feb 2009 23:17:20 +0100 From: Marius Strobl To: Coleman Kane Message-ID: <20090211221720.GD93010@alchemy.franken.de> References: <200902102154.n1ALsNCh005356@svn.freebsd.org> <1234303787.10699.4.camel@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1234303787.10699.4.camel@localhost> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, "Zhang, Helen" Subject: Re: svn commit: r188457 - head/sys/dev/bge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Feb 2009 22:17:27 -0000 On Tue, Feb 10, 2009 at 05:09:47PM -0500, Coleman Kane wrote: > On Tue, 2009-02-10 at 21:54 +0000, Marius Strobl wrote: > > Author: marius > > Date: Tue Feb 10 21:54:23 2009 > > New Revision: 188457 > > URL: http://svn.freebsd.org/changeset/base/188457 > > > > Log: > > Don't reset the PHY probe retry counter within the loop so > > it will eventually terminate as intended. > > > > Submitted by: Helen Zhang > > > > Modified: > > head/sys/dev/bge/if_bge.c > > > > Modified: head/sys/dev/bge/if_bge.c > > ============================================================================== > > --- head/sys/dev/bge/if_bge.c Tue Feb 10 21:51:33 2009 (r188456) > > +++ head/sys/dev/bge/if_bge.c Tue Feb 10 21:54:23 2009 (r188457) > > @@ -2674,11 +2674,11 @@ bge_attach(device_t dev) > > * if we get a conflict with the ASF firmware accessing > > * the PHY. > > */ > > + trys = 0; > > BGE_CLRBIT(sc, BGE_MODE_CTL, BGE_MODECTL_STACKUP); > > again: > > bge_asf_driver_up(sc); > > > > - trys = 0; > > if (mii_phy_probe(dev, &sc->bge_miibus, > > bge_ifmedia_upd, bge_ifmedia_sts)) { > > if (trys++ < 4) { > > > > I'm curious... I recent ran into a problem where this driver was not > properly recovering from an ACPI resume event (under amd64 with some > patches). I am curious if this patch might fix that problem... as the > death happened somewhere around here. I doubt that. > > What example case did you use to discover this bug? > You'd need to ask Helen (CC'ed) regarding this. Marius From owner-svn-src-head@FreeBSD.ORG Wed Feb 11 22:18:04 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 654AC10657F5; Wed, 11 Feb 2009 22:18:04 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 539548FC18; Wed, 11 Feb 2009 22:18:04 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1BMI4YQ037532; Wed, 11 Feb 2009 22:18:04 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1BMI4oH037531; Wed, 11 Feb 2009 22:18:04 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902112218.n1BMI4oH037531@svn.freebsd.org> From: Sam Leffler Date: Wed, 11 Feb 2009 22:18:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188500 - head/sys/dev/ath/ath_hal X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Feb 2009 22:18:05 -0000 Author: sam Date: Wed Feb 11 22:18:03 2009 New Revision: 188500 URL: http://svn.freebsd.org/changeset/base/188500 Log: fix typo in AH_CHIP definition Submitted by: Pavel Roskin Modified: head/sys/dev/ath/ath_hal/ah_internal.h Modified: head/sys/dev/ath/ath_hal/ah_internal.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_internal.h Wed Feb 11 22:15:37 2009 (r188499) +++ head/sys/dev/ath/ath_hal/ah_internal.h Wed Feb 11 22:18:03 2009 (r188500) @@ -84,7 +84,7 @@ static struct ath_hal_chip name##_chip = .probe = _probe, \ .attach = _attach \ }; \ -OS_DATA_SET(ah_chips, name##_chip) +OS_DATA_SET(ah_chips, _name##_chip) #endif /* From owner-svn-src-head@FreeBSD.ORG Wed Feb 11 22:19:54 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E13B5106568F; Wed, 11 Feb 2009 22:19: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 CD73A8FC22; Wed, 11 Feb 2009 22:19:54 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1BMJsRY037605; Wed, 11 Feb 2009 22:19:54 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1BMJsq6037604; Wed, 11 Feb 2009 22:19:54 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200902112219.n1BMJsq6037604@svn.freebsd.org> From: John Baldwin Date: Wed, 11 Feb 2009 22:19:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188501 - head/sys/ufs/ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Feb 2009 22:19:56 -0000 Author: jhb Date: Wed Feb 11 22:19:54 2009 New Revision: 188501 URL: http://svn.freebsd.org/changeset/base/188501 Log: - If the g_access() call for the initial root mount fails, then fully cleanup. Before the GEOM consumer would not have been closed. - Bump the reference on the character device being mounted while the associated devfs vnode is locked. Reviewed by: kib Modified: head/sys/ufs/ffs/ffs_vfsops.c Modified: head/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vfsops.c Wed Feb 11 22:18:03 2009 (r188500) +++ head/sys/ufs/ffs/ffs_vfsops.c Wed Feb 11 22:19:54 2009 (r188501) @@ -622,10 +622,13 @@ ffs_mountfs(devvp, mp, td) struct g_consumer *cp; struct mount *nmp; - dev = devvp->v_rdev; + bp = NULL; + ump = NULL; cred = td ? td->td_ucred : NOCRED; - ronly = (mp->mnt_flag & MNT_RDONLY) != 0; + + dev = devvp->v_rdev; + dev_ref(dev); DROP_GIANT(); g_topology_lock(); error = g_vfs_open(devvp, &cp, "ffs", ronly ? 0 : 1); @@ -640,8 +643,7 @@ ffs_mountfs(devvp, mp, td) PICKUP_GIANT(); VOP_UNLOCK(devvp, 0); if (error) - return (error); - dev_ref(dev); + goto out; if (devvp->v_rdev->si_iosize_max != 0) mp->mnt_iosize_max = devvp->v_rdev->si_iosize_max; if (mp->mnt_iosize_max > MAXPHYS) @@ -650,8 +652,6 @@ ffs_mountfs(devvp, mp, td) devvp->v_bufobj.bo_private = cp; devvp->v_bufobj.bo_ops = &ffs_ops; - bp = NULL; - ump = NULL; fs = NULL; sblockloc = 0; /* From owner-svn-src-head@FreeBSD.ORG Wed Feb 11 22:22:26 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7416A106566B; Wed, 11 Feb 2009 22:22:26 +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 6204D8FC2E; Wed, 11 Feb 2009 22:22:26 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1BMMQWR037704; Wed, 11 Feb 2009 22:22:26 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1BMMQXk037702; Wed, 11 Feb 2009 22:22:26 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200902112222.n1BMMQXk037702@svn.freebsd.org> From: John Baldwin Date: Wed, 11 Feb 2009 22:22:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188502 - in head/sys/fs: cd9660 udf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Feb 2009 22:22:27 -0000 Author: jhb Date: Wed Feb 11 22:22:26 2009 New Revision: 188502 URL: http://svn.freebsd.org/changeset/base/188502 Log: - Consolidate error handling in the cd9660 and udf mount routines. - Always read the character device pointer while the associated devfs vnode is locked. Also, use dev_ref() to obtain a new reference on the vnode for the mountpoint. This reference is released on unmount. This mirrors the earlier fix to FFS. Reviewed by: kib Modified: head/sys/fs/cd9660/cd9660_vfsops.c head/sys/fs/udf/udf_vfsops.c Modified: head/sys/fs/cd9660/cd9660_vfsops.c ============================================================================== --- head/sys/fs/cd9660/cd9660_vfsops.c Wed Feb 11 22:19:54 2009 (r188501) +++ head/sys/fs/cd9660/cd9660_vfsops.c Wed Feb 11 22:22:26 2009 (r188502) @@ -203,7 +203,7 @@ iso_mountfs(devvp, mp) struct iso_mnt *isomp = (struct iso_mnt *)0; struct buf *bp = NULL; struct buf *pribp = NULL, *supbp = NULL; - struct cdev *dev = devvp->v_rdev; + struct cdev *dev; int error = EINVAL; int high_sierra = 0; int iso_bsize; @@ -219,6 +219,8 @@ iso_mountfs(devvp, mp) struct bufobj *bo; char *cs_local, *cs_disk; + dev = devvp->v_rdev; + dev_ref(dev); DROP_GIANT(); g_topology_lock(); error = g_vfs_open(devvp, &cp, "cd9660", 0); @@ -226,27 +228,21 @@ iso_mountfs(devvp, mp) PICKUP_GIANT(); VOP_UNLOCK(devvp, 0); if (error) - return error; + goto out; if (devvp->v_rdev->si_iosize_max != 0) mp->mnt_iosize_max = devvp->v_rdev->si_iosize_max; if (mp->mnt_iosize_max > MAXPHYS) mp->mnt_iosize_max = MAXPHYS; bo = &devvp->v_bufobj; - bo->bo_private = cp; - bo->bo_ops = g_vfs_bufops; /* This is the "logical sector size". The standard says this * should be 2048 or the physical sector size on the device, * whichever is greater. */ if ((ISO_DEFAULT_BLOCK_SIZE % cp->provider->sectorsize) != 0) { - DROP_GIANT(); - g_topology_lock(); - g_vfs_close(cp); - g_topology_unlock(); - PICKUP_GIANT(); - return (EINVAL); + error = EINVAL; + goto out; } iso_bsize = cp->provider->sectorsize; @@ -485,6 +481,7 @@ out: free((caddr_t)isomp, M_ISOFSMNT); mp->mnt_data = NULL; } + dev_rel(dev); return error; } @@ -519,6 +516,7 @@ cd9660_unmount(mp, mntflags, td) g_topology_unlock(); PICKUP_GIANT(); vrele(isomp->im_devvp); + dev_rel(isomp->im_dev); free((caddr_t)isomp, M_ISOFSMNT); mp->mnt_data = NULL; MNT_ILOCK(mp); Modified: head/sys/fs/udf/udf_vfsops.c ============================================================================== --- head/sys/fs/udf/udf_vfsops.c Wed Feb 11 22:19:54 2009 (r188501) +++ head/sys/fs/udf/udf_vfsops.c Wed Feb 11 22:22:26 2009 (r188502) @@ -301,8 +301,10 @@ udf_checktag(struct desc_tag *tag, uint1 } static int -udf_mountfs(struct vnode *devvp, struct mount *mp) { +udf_mountfs(struct vnode *devvp, struct mount *mp) +{ struct buf *bp = NULL; + struct cdev *dev; struct anchor_vdp avdp; struct udf_mnt *udfmp = NULL; struct part_desc *pd; @@ -319,6 +321,8 @@ udf_mountfs(struct vnode *devvp, struct struct g_consumer *cp; struct bufobj *bo; + dev = devvp->v_rdev; + dev_ref(dev); DROP_GIANT(); g_topology_lock(); error = g_vfs_open(devvp, &cp, "udf", 0); @@ -326,7 +330,7 @@ udf_mountfs(struct vnode *devvp, struct PICKUP_GIANT(); VOP_UNLOCK(devvp, 0); if (error) - return error; + goto bail; bo = &devvp->v_bufobj; @@ -347,7 +351,7 @@ udf_mountfs(struct vnode *devvp, struct mp->mnt_kern_flag |= MNTK_MPSAFE | MNTK_LOOKUP_SHARED; MNT_IUNLOCK(mp); udfmp->im_mountp = mp; - udfmp->im_dev = devvp->v_rdev; + udfmp->im_dev = dev; udfmp->im_devvp = devvp; udfmp->im_d2l = NULL; udfmp->im_cp = cp; @@ -364,12 +368,8 @@ udf_mountfs(struct vnode *devvp, struct if (((logical_secsize % cp->provider->sectorsize) != 0) || (logical_secsize < cp->provider->sectorsize)) { - DROP_GIANT(); - g_topology_lock(); - g_vfs_close(cp); - g_topology_unlock(); - PICKUP_GIANT(); - return (EINVAL); + error = EINVAL; + goto bail; } bsize = cp->provider->sectorsize; @@ -492,11 +492,14 @@ bail: free(udfmp, M_UDFMOUNT); if (bp != NULL) brelse(bp); - DROP_GIANT(); - g_topology_lock(); - g_vfs_close(cp); - g_topology_unlock(); - PICKUP_GIANT(); + if (cp != NULL) { + DROP_GIANT(); + g_topology_lock(); + g_vfs_close(cp); + g_topology_unlock(); + PICKUP_GIANT(); + } + dev_rel(dev); return error; }; @@ -529,6 +532,7 @@ udf_unmount(struct mount *mp, int mntfla g_topology_unlock(); PICKUP_GIANT(); vrele(udfmp->im_devvp); + dev_rel(udfmp->im_dev); if (udfmp->s_table != NULL) free(udfmp->s_table, M_UDFMOUNT); From owner-svn-src-head@FreeBSD.ORG Wed Feb 11 22:29:10 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1E0F0106564A; Wed, 11 Feb 2009 22:29:10 +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 D58958FC0A; Wed, 11 Feb 2009 22:29:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1BMT9LV037923; Wed, 11 Feb 2009 22:29:09 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1BMT9IS037921; Wed, 11 Feb 2009 22:29:09 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200902112229.n1BMT9IS037921@svn.freebsd.org> From: John Baldwin Date: Wed, 11 Feb 2009 22:29:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188503 - head/sys/cam/scsi X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Feb 2009 22:29:10 -0000 Author: jhb Date: Wed Feb 11 22:29:09 2009 New Revision: 188503 URL: http://svn.freebsd.org/changeset/base/188503 Log: Reorder dacleanup() and cdcleanup() slightly so that the sysctl context is freed while the periph lock is not held. While here, wait until after freeing the softc before reacquiring the periph lock. Tested by: sbruno Modified: head/sys/cam/scsi/scsi_cd.c head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/scsi/scsi_cd.c ============================================================================== --- head/sys/cam/scsi/scsi_cd.c Wed Feb 11 22:22:26 2009 (r188502) +++ head/sys/cam/scsi/scsi_cd.c Wed Feb 11 22:29:09 2009 (r188503) @@ -401,11 +401,6 @@ cdcleanup(struct cam_periph *periph) xpt_print(periph->path, "removing device entry\n"); - if ((softc->flags & CD_FLAG_SCTX_INIT) != 0 - && sysctl_ctx_free(&softc->sysctl_ctx) != 0) { - xpt_print(periph->path, "can't remove sysctl context\n"); - } - /* * In the queued, non-active case, the device in question * has already been removed from the changer run queue. Since this @@ -474,9 +469,14 @@ cdcleanup(struct cam_periph *periph) free(softc->changer, M_DEVBUF); } cam_periph_unlock(periph); + if ((softc->flags & CD_FLAG_SCTX_INIT) != 0 + && sysctl_ctx_free(&softc->sysctl_ctx) != 0) { + xpt_print(periph->path, "can't remove sysctl context\n"); + } + disk_destroy(softc->disk); - cam_periph_lock(periph); free(softc, M_DEVBUF); + cam_periph_lock(periph); } static void Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Wed Feb 11 22:22:26 2009 (r188502) +++ head/sys/cam/scsi/scsi_da.c Wed Feb 11 22:29:09 2009 (r188503) @@ -995,6 +995,8 @@ dacleanup(struct cam_periph *periph) softc = (struct da_softc *)periph->softc; xpt_print(periph->path, "removing device entry\n"); + cam_periph_unlock(periph); + /* * If we can't free the sysctl tree, oh well... */ @@ -1003,11 +1005,10 @@ dacleanup(struct cam_periph *periph) xpt_print(periph->path, "can't remove sysctl context\n"); } - cam_periph_unlock(periph); disk_destroy(softc->disk); callout_drain(&softc->sendordered_c); - cam_periph_lock(periph); free(softc, M_DEVBUF); + cam_periph_lock(periph); } static void From owner-svn-src-head@FreeBSD.ORG Wed Feb 11 22:34:22 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8CDAA106566C; Wed, 11 Feb 2009 22:34:22 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7B5DD8FC1B; Wed, 11 Feb 2009 22:34:22 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1BMYMmQ038076; Wed, 11 Feb 2009 22:34:22 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1BMYMwJ038075; Wed, 11 Feb 2009 22:34:22 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902112234.n1BMYMwJ038075@svn.freebsd.org> From: Sam Leffler Date: Wed, 11 Feb 2009 22:34:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188504 - head/sys/dev/ath/ath_hal X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Feb 2009 22:34:23 -0000 Author: sam Date: Wed Feb 11 22:34:22 2009 New Revision: 188504 URL: http://svn.freebsd.org/changeset/base/188504 Log: fix both instances of name Pointy hat: sam Modified: head/sys/dev/ath/ath_hal/ah_internal.h Modified: head/sys/dev/ath/ath_hal/ah_internal.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_internal.h Wed Feb 11 22:29:09 2009 (r188503) +++ head/sys/dev/ath/ath_hal/ah_internal.h Wed Feb 11 22:34:22 2009 (r188504) @@ -79,7 +79,7 @@ struct ath_hal_chip { }; #ifndef AH_CHIP #define AH_CHIP(_name, _probe, _attach) \ -static struct ath_hal_chip name##_chip = { \ +static struct ath_hal_chip _name##_chip = { \ .name = #_name, \ .probe = _probe, \ .attach = _attach \ From owner-svn-src-head@FreeBSD.ORG Wed Feb 11 22:34:50 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 689B51065670; Wed, 11 Feb 2009 22:34:50 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 569DC8FC23; Wed, 11 Feb 2009 22:34:50 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1BMYo1A038119; Wed, 11 Feb 2009 22:34:50 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1BMYoT4038118; Wed, 11 Feb 2009 22:34:50 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902112234.n1BMYoT4038118@svn.freebsd.org> From: Sam Leffler Date: Wed, 11 Feb 2009 22:34:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188505 - head/sys/arm/xscale/ixp425 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Feb 2009 22:34:52 -0000 Author: sam Date: Wed Feb 11 22:34:50 2009 New Revision: 188505 URL: http://svn.freebsd.org/changeset/base/188505 Log: fix ARM_USE_SMALL_ALLOC after memory layout changes Submitted by: cognet Modified: head/sys/arm/xscale/ixp425/avila_machdep.c Modified: head/sys/arm/xscale/ixp425/avila_machdep.c ============================================================================== --- head/sys/arm/xscale/ixp425/avila_machdep.c Wed Feb 11 22:34:22 2009 (r188504) +++ head/sys/arm/xscale/ixp425/avila_machdep.c Wed Feb 11 22:34:50 2009 (r188505) @@ -334,17 +334,20 @@ initarm(void *arg, void *arg2) alloc_pages(minidataclean.pv_pa, 1); valloc_pages(msgbufpv, round_page(MSGBUF_SIZE) / PAGE_SIZE); #ifdef ARM_USE_SMALL_ALLOC -#error "I am broken" /* XXX save people grief */ freemempos -= PAGE_SIZE; freemem_pt = trunc_page(freemem_pt); - freemem_after = freemempos - ((freemem_pt - 0x10100000) / + freemem_after = freemempos - ((freemem_pt - (PHYSADDR + 0x100000)) / PAGE_SIZE) * sizeof(struct arm_small_page); - arm_add_smallalloc_pages((void *)(freemem_after + (KERNVIRTADDR - KERNPHYSADDR) - , (void *)0xc0100000, freemem_pt - 0x10100000, 1); - freemem_after -= ((freemem_after - 0x10001000) / PAGE_SIZE) * + arm_add_smallalloc_pages( + (void *)(freemem_after + (KERNVIRTADDR - KERNPHYSADDR)), + (void *)0xc0100000, + freemem_pt - (PHYSADDR + 0x100000), 1); + freemem_after -= ((freemem_after - (PHYSADDR + 0x1000)) / PAGE_SIZE) * sizeof(struct arm_small_page); - arm_add_smallalloc_pages((void *)(freemem_after + (KEYVIRTADDR - KERNPHYSADDR)) - , (void *)0xc0001000, trunc_page(freemem_after) - 0x10001000, 0); + arm_add_smallalloc_pages( + (void *)(freemem_after + (KERNVIRTADDR - KERNPHYSADDR)), + (void *)0xc0001000, + trunc_page(freemem_after) - (PHYSADDR + 0x1000), 0); freemempos = trunc_page(freemem_after); freemempos -= PAGE_SIZE; #endif From owner-svn-src-head@FreeBSD.ORG Wed Feb 11 22:53:21 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B04ED106564A; Wed, 11 Feb 2009 22:53:21 +0000 (UTC) (envelope-from helen.zhang@bluecoat.com) Received: from whisker.bluecoat.com (whisker.bluecoat.com [216.52.23.28]) by mx1.freebsd.org (Postfix) with ESMTP id 4588D8FC08; Wed, 11 Feb 2009 22:53:20 +0000 (UTC) (envelope-from helen.zhang@bluecoat.com) Received: from bcs-mail6.internal.cacheflow.com ([10.2.2.69]) by whisker.bluecoat.com (8.14.2/8.14.2) with ESMTP id n1BMceNp020473; Wed, 11 Feb 2009 14:38:41 -0800 (PST) Received: from bcs-mail04.internal.cacheflow.com ([10.2.2.56]) by bcs-mail6.internal.cacheflow.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 11 Feb 2009 14:38:35 -0800 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Date: Wed, 11 Feb 2009 14:37:36 -0800 Message-ID: <9CFA8139F7106843B28F9E6FB1FF4BBE0D035E@bcs-mail04.internal.cacheflow.com> In-Reply-To: <20090211221720.GD93010@alchemy.franken.de> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: svn commit: r188457 - head/sys/dev/bge Thread-Index: AcmMlpF1J3scEl0bSMmuzflKpgxI1AAAlQaA References: <200902102154.n1ALsNCh005356@svn.freebsd.org> <1234303787.10699.4.camel@localhost> <20090211221720.GD93010@alchemy.franken.de> From: "Zhang, Helen" To: "Marius Strobl" , "Coleman Kane" X-OriginalArrivalTime: 11 Feb 2009 22:38:35.0427 (UTC) FILETIME=[79920F30:01C98C99] Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: RE: svn commit: r188457 - head/sys/dev/bge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Feb 2009 22:53:22 -0000 Thank Marius for checking in the code. I ran into the problem mainly because mii driver was not hooked properly, so mii_phy_probe() function failed. -Helen -----Original Message----- From: Marius Strobl [mailto:marius@alchemy.franken.de]=20 Sent: Wednesday, February 11, 2009 2:17 PM To: Coleman Kane Cc: src-committers@FreeBSD.org; svn-src-all@FreeBSD.org; svn-src-head@FreeBSD.org; Zhang, Helen Subject: Re: svn commit: r188457 - head/sys/dev/bge On Tue, Feb 10, 2009 at 05:09:47PM -0500, Coleman Kane wrote: > On Tue, 2009-02-10 at 21:54 +0000, Marius Strobl wrote: > > Author: marius > > Date: Tue Feb 10 21:54:23 2009 > > New Revision: 188457 > > URL: http://svn.freebsd.org/changeset/base/188457 > >=20 > > Log: > > Don't reset the PHY probe retry counter within the loop so > > it will eventually terminate as intended. > > =20 > > Submitted by: Helen Zhang > >=20 > > Modified: > > head/sys/dev/bge/if_bge.c > >=20 > > Modified: head/sys/dev/bge/if_bge.c > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D > > --- head/sys/dev/bge/if_bge.c Tue Feb 10 21:51:33 2009 (r188456) > > +++ head/sys/dev/bge/if_bge.c Tue Feb 10 21:54:23 2009 (r188457) > > @@ -2674,11 +2674,11 @@ bge_attach(device_t dev) > > * if we get a conflict with the ASF firmware accessing > > * the PHY. > > */ > > + trys =3D 0; > > BGE_CLRBIT(sc, BGE_MODE_CTL, BGE_MODECTL_STACKUP); > > again: > > bge_asf_driver_up(sc); > > =20 > > - trys =3D 0; > > if (mii_phy_probe(dev, &sc->bge_miibus, > > bge_ifmedia_upd, bge_ifmedia_sts)) { > > if (trys++ < 4) { > >=20 >=20 > I'm curious... I recent ran into a problem where this driver was not > properly recovering from an ACPI resume event (under amd64 with some > patches). I am curious if this patch might fix that problem... as the > death happened somewhere around here. I doubt that. >=20 > What example case did you use to discover this bug? >=20 You'd need to ask Helen (CC'ed) regarding this. Marius From owner-svn-src-head@FreeBSD.ORG Thu Feb 12 01:10:53 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8DC8A1065672; Thu, 12 Feb 2009 01:10:53 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7C1B38FC15; Thu, 12 Feb 2009 01:10:53 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1C1Arbh040994; Thu, 12 Feb 2009 01:10:53 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1C1ArBK040993; Thu, 12 Feb 2009 01:10:53 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200902120110.n1C1ArBK040993@svn.freebsd.org> From: Warner Losh Date: Thu, 12 Feb 2009 01:10:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188506 - head/sys/mips/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Feb 2009 01:10:54 -0000 Author: imp Date: Thu Feb 12 01:10:53 2009 New Revision: 188506 URL: http://svn.freebsd.org/changeset/base/188506 Log: pmap_kenrel() was recently deleted from pmap.h. It was still used here, but inconsistently. Change all instances of it to kernel_pmap to match rest of code. Modified: head/sys/mips/mips/busdma_machdep.c Modified: head/sys/mips/mips/busdma_machdep.c ============================================================================== --- head/sys/mips/mips/busdma_machdep.c Wed Feb 11 22:34:50 2009 (r188505) +++ head/sys/mips/mips/busdma_machdep.c Thu Feb 12 01:10:53 2009 (r188506) @@ -647,7 +647,7 @@ bus_dmamap_load_mbuf(bus_dma_tag_t dmat, if (m->m_len > 0) { error = bus_dmamap_load_buffer(dmat, dm_segments, map, m->m_data, m->m_len, - pmap_kernel(), flags, &lastaddr, &nsegs); + kernel_pmap, flags, &lastaddr, &nsegs); map->len += m->m_len; } } @@ -694,7 +694,7 @@ bus_dmamap_load_mbuf_sg(bus_dma_tag_t dm if (m->m_len > 0) { error = bus_dmamap_load_buffer(dmat, segs, map, m->m_data, m->m_len, - pmap_kernel(), flags, &lastaddr, nsegs); + kernel_pmap, flags, &lastaddr, nsegs); map->len += m->m_len; } } From owner-svn-src-head@FreeBSD.ORG Thu Feb 12 01:14:49 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 713E3106566C; Thu, 12 Feb 2009 01:14:49 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5F2FD8FC0C; Thu, 12 Feb 2009 01:14:49 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1C1EnJe041105; Thu, 12 Feb 2009 01:14:49 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1C1EnAK041104; Thu, 12 Feb 2009 01:14:49 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200902120114.n1C1EnAK041104@svn.freebsd.org> From: Warner Losh Date: Thu, 12 Feb 2009 01:14:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188507 - head/sys/mips/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Feb 2009 01:14:49 -0000 Author: imp Date: Thu Feb 12 01:14:49 2009 New Revision: 188507 URL: http://svn.freebsd.org/changeset/base/188507 Log: Rewrite get_pv_entry() to match expectations of the rest of the kernel. Rather than just kick off the page daemon, we actively retire more mappings. The inner loop now looks a lot like the inner loop of pmap_remove_all. Also, get_pv_entry can't return NULL now, so remove panic if it did. Reviewed by: alc@ Modified: head/sys/mips/mips/pmap.c Modified: head/sys/mips/mips/pmap.c ============================================================================== --- head/sys/mips/mips/pmap.c Thu Feb 12 01:10:53 2009 (r188506) +++ head/sys/mips/mips/pmap.c Thu Feb 12 01:14:49 2009 (r188507) @@ -168,7 +168,7 @@ struct fpage fpages_shared[FPAGES_SHARED struct sysmaps sysmaps_pcpu[MAXCPU]; static PMAP_INLINE void free_pv_entry(pv_entry_t pv); -static pv_entry_t get_pv_entry(void); +static pv_entry_t get_pv_entry(pmap_t locked_pmap); static __inline void pmap_changebit(vm_page_t m, int bit, boolean_t setem); static int pmap_remove_pte(struct pmap *pmap, pt_entry_t *ptq, vm_offset_t va); @@ -1304,16 +1304,85 @@ free_pv_entry(pv_entry_t pv) * because of the possibility of allocations at interrupt time. */ static pv_entry_t -get_pv_entry(void) +get_pv_entry(pmap_t locked_pmap) { + static const struct timeval printinterval = { 60, 0 }; + static struct timeval lastprint; + struct vpgqueues *vpq; + pt_entry_t *pte, oldpte; + pmap_t pmap; + pv_entry_t allocated_pv, next_pv, pv; + vm_offset_t va; + vm_page_t m; - pv_entry_count++; - if ((pv_entry_count > pv_entry_high_water) && - (pmap_pagedaemon_waken == 0)) { - pmap_pagedaemon_waken = 1; - wakeup(&vm_pages_needed); + PMAP_LOCK_ASSERT(locked_pmap, MA_OWNED); + mtx_assert(&vm_page_queue_mtx, MA_OWNED); + allocated_pv = uma_zalloc(pvzone, M_NOWAIT); + if (allocated_pv != NULL) { + pv_entry_count++; + if (pv_entry_count > pv_entry_high_water) + pagedaemon_wakeup(); + else + return (allocated_pv); + } + /* + * Reclaim pv entries: At first, destroy mappings to inactive + * pages. After that, if a pv entry is still needed, destroy + * mappings to active pages. + */ + if (ratecheck(&lastprint, &printinterval)) + printf("Approaching the limit on PV entries, " + "increase the vm.pmap.shpgperproc tunable.\n"); + vpq = &vm_page_queues[PQ_INACTIVE]; +retry: + TAILQ_FOREACH(m, &vpq->pl, pageq) { + if (m->hold_count || m->busy) + continue; + TAILQ_FOREACH_SAFE(pv, &m->md.pv_list, pv_list, next_pv) { + va = pv->pv_va; + pmap = pv->pv_pmap; + /* Avoid deadlock and lock recursion. */ + if (pmap > locked_pmap) + PMAP_LOCK(pmap); + else if (pmap != locked_pmap && !PMAP_TRYLOCK(pmap)) + continue; + pmap->pm_stats.resident_count--; + pte = pmap_pte(pmap, va); + KASSERT(pte != NULL, ("pte")); + oldpte = loadandclear((u_int *)pte); + if (is_kernel_pmap(pmap)) + *pte = PTE_G; + KASSERT((oldpte & PTE_W) == 0, + ("wired pte for unwired page")); + if (m->md.pv_flags & PV_TABLE_REF) + vm_page_flag_set(m, PG_REFERENCED); + if (oldpte & PTE_M) + vm_page_dirty(m); + pmap_invalidate_page(pmap, va); + TAILQ_REMOVE(&pmap->pm_pvlist, pv, pv_plist); + m->md.pv_list_count--; + TAILQ_REMOVE(&m->md.pv_list, pv, pv_list); + if (TAILQ_EMPTY(&m->md.pv_list)) { + vm_page_flag_clear(m, PG_WRITEABLE); + m->md.pv_flags &= ~(PV_TABLE_REF | PV_TABLE_MOD); + } + pmap_unuse_pt(pmap, va, pv->pv_ptem); + if (pmap != locked_pmap) + PMAP_UNLOCK(pmap); + if (allocated_pv == NULL) + allocated_pv = pv; + else + free_pv_entry(pv); + } + } + if (allocated_pv == NULL) { + if (vpq == &vm_page_queues[PQ_INACTIVE]) { + vpq = &vm_page_queues[PQ_ACTIVE]; + goto retry; + } + panic("get_pv_entry: increase the vm.pmap.shpgperproc tunable"); } - return uma_zalloc(pvzone, M_NOWAIT); + return (allocated_pv); } /* @@ -1376,9 +1445,7 @@ pmap_insert_entry(pmap_t pmap, vm_offset pv_entry_t pv; - pv = get_pv_entry(); - if (pv == NULL) - panic("no pv entries: increase vm.pmap.shpgperproc"); + pv = get_pv_entry(pmap); pv->pv_va = va; pv->pv_pmap = pmap; pv->pv_ptem = mpte; From owner-svn-src-head@FreeBSD.ORG Thu Feb 12 03:05:43 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 113A6106564A; Thu, 12 Feb 2009 03:05:43 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E8D528FC1B; Thu, 12 Feb 2009 03:05:42 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1C35glV043258; Thu, 12 Feb 2009 03:05:42 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1C35ghl043255; Thu, 12 Feb 2009 03:05:42 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <200902120305.n1C35ghl043255@svn.freebsd.org> From: Sean Bruno Date: Thu, 12 Feb 2009 03:05:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188508 - head/sys/dev/firewire X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Feb 2009 03:05:43 -0000 Author: sbruno Date: Thu Feb 12 03:05:42 2009 New Revision: 188508 URL: http://svn.freebsd.org/changeset/base/188508 Log: Update comments around various structs. Add speeds S800, S1600 and S3200 Modified: head/sys/dev/firewire/firewire.h head/sys/dev/firewire/fwohcireg.h head/sys/dev/firewire/fwphyreg.h Modified: head/sys/dev/firewire/firewire.h ============================================================================== --- head/sys/dev/firewire/firewire.h Thu Feb 12 01:14:49 2009 (r188507) +++ head/sys/dev/firewire/firewire.h Thu Feb 12 03:05:42 2009 (r188508) @@ -99,9 +99,16 @@ struct fw_reg_req_t { #define FWRCODE_ER_TYPE 6 #define FWRCODE_ER_ADDR 7 +/* + * Defined 1394a-2000 + * Table 5B-1 + */ #define FWSPD_S100 0 #define FWSPD_S200 1 #define FWSPD_S400 2 +#define FWSPD_S800 3 +#define FWSPD_S1600 4 +#define FWSPD_S3200 5 #define FWP_TL_VALID (1 << 7) Modified: head/sys/dev/firewire/fwohcireg.h ============================================================================== --- head/sys/dev/firewire/fwohcireg.h Thu Feb 12 01:14:49 2009 (r188507) +++ head/sys/dev/firewire/fwohcireg.h Thu Feb 12 03:05:42 2009 (r188508) @@ -411,32 +411,31 @@ struct fwohci_trailer{ #define OHCI_CNTL_PHYPKT (0x1 << 10) #define OHCI_CNTL_SID (0x1 << 9) +/* + * defined in OHCI 1.1 + * chapter 6.1 + */ #define OHCI_INT_DMA_ATRQ (0x1 << 0) #define OHCI_INT_DMA_ATRS (0x1 << 1) #define OHCI_INT_DMA_ARRQ (0x1 << 2) #define OHCI_INT_DMA_ARRS (0x1 << 3) #define OHCI_INT_DMA_PRRQ (0x1 << 4) #define OHCI_INT_DMA_PRRS (0x1 << 5) -#define OHCI_INT_DMA_IT (0x1 << 6) -#define OHCI_INT_DMA_IR (0x1 << 7) -#define OHCI_INT_PW_ERR (0x1 << 8) -#define OHCI_INT_LR_ERR (0x1 << 9) - +#define OHCI_INT_DMA_IT (0x1 << 6) +#define OHCI_INT_DMA_IR (0x1 << 7) +#define OHCI_INT_PW_ERR (0x1 << 8) +#define OHCI_INT_LR_ERR (0x1 << 9) #define OHCI_INT_PHY_SID (0x1 << 16) #define OHCI_INT_PHY_BUS_R (0x1 << 17) - #define OHCI_INT_REG_FAIL (0x1 << 18) - #define OHCI_INT_PHY_INT (0x1 << 19) #define OHCI_INT_CYC_START (0x1 << 20) #define OHCI_INT_CYC_64SECOND (0x1 << 21) #define OHCI_INT_CYC_LOST (0x1 << 22) #define OHCI_INT_CYC_ERR (0x1 << 23) - #define OHCI_INT_ERR (0x1 << 24) #define OHCI_INT_CYC_LONG (0x1 << 25) #define OHCI_INT_PHY_REG (0x1 << 26) - #define OHCI_INT_EN (0x1 << 31) #define IP_CHANNELS 0x0234 Modified: head/sys/dev/firewire/fwphyreg.h ============================================================================== --- head/sys/dev/firewire/fwphyreg.h Thu Feb 12 01:14:49 2009 (r188507) +++ head/sys/dev/firewire/fwphyreg.h Thu Feb 12 03:05:42 2009 (r188508) @@ -34,6 +34,10 @@ * $FreeBSD$ */ +/* + * IEEE 1394a + * Figure 5B - 1 + */ struct phyreg_base { #if BYTE_ORDER == BIG_ENDIAN uint8_t phy_id:6, @@ -100,6 +104,10 @@ struct phyreg_base { #endif }; +/* + * IEEE 1394a + * Figure 5B - 2 + */ struct phyreg_page0 { #if BYTE_ORDER == BIG_ENDIAN uint8_t astat:2, @@ -160,6 +168,10 @@ struct phyreg_page0 { #endif }; +/* + * IEEE 1394a + * Figure 5B - 3 + */ struct phyreg_page1 { uint8_t compliance; uint8_t :8; From owner-svn-src-head@FreeBSD.ORG Thu Feb 12 03:26:05 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 881751065675; Thu, 12 Feb 2009 03:26:05 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5B5EC8FC12; Thu, 12 Feb 2009 03:26:05 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1C3Q5vh043780; Thu, 12 Feb 2009 03:26:05 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1C3Q539043779; Thu, 12 Feb 2009 03:26:05 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <200902120326.n1C3Q539043779@svn.freebsd.org> From: Sean Bruno Date: Thu, 12 Feb 2009 03:26:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188509 - head/sys/dev/firewire X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Feb 2009 03:26:06 -0000 Author: sbruno Date: Thu Feb 12 03:26:05 2009 New Revision: 188509 URL: http://svn.freebsd.org/changeset/base/188509 Log: Enhance debug messages and attempt to unify them into one format where possible. Reviewed by: scottl Modified: head/sys/dev/firewire/fwohci.c Modified: head/sys/dev/firewire/fwohci.c ============================================================================== --- head/sys/dev/firewire/fwohci.c Thu Feb 12 03:05:42 2009 (r188508) +++ head/sys/dev/firewire/fwohci.c Thu Feb 12 03:26:05 2009 (r188509) @@ -306,8 +306,8 @@ fwohci_set_bus_manager(struct firewire_c if((bm & 0x3f) == 0x3f) bm = node; if (firewire_debug) - device_printf(sc->fc.dev, - "fw_set_bus_manager: %d->%d (loop=%d)\n", bm, node, i); + device_printf(sc->fc.dev, "%s: %d->%d (loop=%d)\n", + __func__, bm, node, i); return(bm); } @@ -332,7 +332,7 @@ again: } if(i >= MAX_RETRY) { if (firewire_debug) - device_printf(sc->fc.dev, "phy read failed(1).\n"); + device_printf(sc->fc.dev, "%s: failed(1).\n", __func__); if (++retry < MAX_RETRY) { DELAY(100); goto again; @@ -343,15 +343,16 @@ again: if ((stat & OHCI_INT_REG_FAIL) != 0 || ((fun >> PHYDEV_REGADDR) & 0xf) != addr) { if (firewire_debug) - device_printf(sc->fc.dev, "phy read failed(2).\n"); + device_printf(sc->fc.dev, "%s: failed(2).\n", __func__); if (++retry < MAX_RETRY) { DELAY(100); goto again; } } - if (firewire_debug || retry >= MAX_RETRY) + if (firewire_debug > 1 || retry >= MAX_RETRY) device_printf(sc->fc.dev, - "fwphy_rddata: 0x%x loop=%d, retry=%d\n", addr, i, retry); + "%s:: 0x%x loop=%d, retry=%d\n", + __func__, addr, i, retry); #undef MAX_RETRY return((fun >> PHYDEV_RDDATA )& 0xff); } @@ -1848,7 +1849,7 @@ fwohci_intr_core(struct fwohci_softc *sc /* Disable bus reset interrupt until sid recv. */ OWRITE(sc, FWOHCI_INTMASKCLR, OHCI_INT_PHY_BUS_R); - device_printf(fc->dev, "BUS reset\n"); + device_printf(fc->dev, "%s: BUS reset\n", __func__); OWRITE(sc, FWOHCI_INTMASKCLR, OHCI_INT_CYC_LOST); OWRITE(sc, OHCI_LNKCTLCLR, OHCI_CNTL_CYCSRC); @@ -1885,10 +1886,11 @@ fwohci_intr_core(struct fwohci_softc *sc plen = OREAD(sc, OHCI_SID_CNT); fc->nodeid = node_id & 0x3f; - device_printf(fc->dev, "node_id=0x%08x, SelfID Count=%d, ", - fc->nodeid, (plen >> 16) & 0xff); + device_printf(fc->dev, "%s: node_id=0x%08x, SelfID Count=%d, ", + __func__, fc->nodeid, (plen >> 16) & 0xff); if (!(node_id & OHCI_NODE_VALID)) { - printf("Bus reset failure\n"); + device_printf(fc->dev, "%s: Bus reset failure\n", + __func__); goto sidout; } From owner-svn-src-head@FreeBSD.ORG Thu Feb 12 09:37:45 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DC0BA10656D7; Thu, 12 Feb 2009 09:37:45 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CA12D8FC15; Thu, 12 Feb 2009 09:37:45 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1C9bjGO050367; Thu, 12 Feb 2009 09:37:45 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1C9bjm1050366; Thu, 12 Feb 2009 09:37:45 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200902120937.n1C9bjm1050366@svn.freebsd.org> From: Alexander Motin Date: Thu, 12 Feb 2009 09:37:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188510 - head/sys/dev/sound/pci/hda X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Feb 2009 09:37:46 -0000 Author: mav Date: Thu Feb 12 09:37:45 2009 New Revision: 188510 URL: http://svn.freebsd.org/changeset/base/188510 Log: s/succeded/succeeded/ in comments. Modified: head/sys/dev/sound/pci/hda/hdac.c Modified: head/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.c Thu Feb 12 03:26:05 2009 (r188509) +++ head/sys/dev/sound/pci/hda/hdac.c Thu Feb 12 09:37:45 2009 (r188510) @@ -4981,7 +4981,7 @@ hdac_audio_trace_as_out(struct hdac_devi /* Find next pin */ for (i = seq; i < 16 && ases[as].pins[i] == 0; i++) ; - /* Check if there is no any left. If so - we succeded. */ + /* Check if there is no any left. If so - we succeeded. */ if (i == 16) return (1); @@ -5027,7 +5027,7 @@ hdac_audio_trace_as_out(struct hdac_devi hdac_audio_trace_dac(devinfo, as, i, ases[as].pins[i], hpredir, min, res, 0); ases[as].dacs[i] = res; - /* We succeded, so call next. */ + /* We succeeded, so call next. */ if (hdac_audio_trace_as_out(devinfo, as, i + 1)) return (1); /* If next failed, we should retry with next min */ @@ -6002,7 +6002,7 @@ retry: if (res) { HDA_BOOTVERBOSE( device_printf(devinfo->codec->sc->dev, - "Association %d (%d) trace succeded\n", + "Association %d (%d) trace succeeded\n", j, as[j].index); ); } else { From owner-svn-src-head@FreeBSD.ORG Thu Feb 12 10:39:20 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 27F90106566B; Thu, 12 Feb 2009 10:39:20 +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 162B18FC15; Thu, 12 Feb 2009 10:39:20 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1CAdJrt053491; Thu, 12 Feb 2009 10:39:19 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1CAdJBm053490; Thu, 12 Feb 2009 10:39:19 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <200902121039.n1CAdJBm053490@svn.freebsd.org> From: Kevin Lo Date: Thu, 12 Feb 2009 10:39:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188511 - head/sys/dev/puc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Feb 2009 10:39:20 -0000 Author: kevlo Date: Thu Feb 12 10:39:19 2009 New Revision: 188511 URL: http://svn.freebsd.org/changeset/base/188511 Log: Add support for the Sunix SUN1889-based dual parallel port card. PR: kern/128219 Submitted by: Thinker K.F. Li Modified: head/sys/dev/puc/pucdata.c Modified: head/sys/dev/puc/pucdata.c ============================================================================== --- head/sys/dev/puc/pucdata.c Thu Feb 12 09:37:45 2009 (r188510) +++ head/sys/dev/puc/pucdata.c Thu Feb 12 10:39:19 2009 (r188511) @@ -585,6 +585,12 @@ const struct puc_cfg puc_pci_devices[] = PUC_PORT_4S, 0x10, 4, 0, }, + { 0x1409, 0x7268, 0xffff, 0, + "Sunix SUN1888", + 0, + PUC_PORT_2P, 0x10, 0, 8, + }, + { 0x1409, 0x7168, 0xffff, 0, NULL, DEFAULT_RCLK * 8, From owner-svn-src-head@FreeBSD.ORG Thu Feb 12 13:04:14 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 59889106564A; Thu, 12 Feb 2009 13:04:14 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 138C88FC21; Thu, 12 Feb 2009 13:04:14 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1CD4Dp3056247; Thu, 12 Feb 2009 13:04:13 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1CD4DeZ056246; Thu, 12 Feb 2009 13:04:13 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200902121304.n1CD4DeZ056246@svn.freebsd.org> From: Alexander Motin Date: Thu, 12 Feb 2009 13:04:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188512 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Feb 2009 13:04:14 -0000 Author: mav Date: Thu Feb 12 13:04:13 2009 New Revision: 188512 URL: http://svn.freebsd.org/changeset/base/188512 Log: Fix spelling a bit. Modified: head/share/man/man4/snd_hda.4 Modified: head/share/man/man4/snd_hda.4 ============================================================================== --- head/share/man/man4/snd_hda.4 Thu Feb 12 10:39:19 2009 (r188511) +++ head/share/man/man4/snd_hda.4 Thu Feb 12 13:04:13 2009 (r188512) @@ -298,7 +298,7 @@ All codec pins are reversible (could be .Pp So high codec uniformity and flexibility allow driver to configure it in many different ways, depending on requested pins usage decribed by pins configuration. -Driver reports such default pin configuration when verbose messages enabled: +The driver reports such default pin configuration when verbose messages enabled: .Bd -literal hdac0: nid 20 0x01014020 as 2 seq 0 Line-out Jack jack 1 loc 1 color Green misc 0 hdac0: nid 21 0x99130110 as 1 seq 0 Speaker Fixed jack 3 loc 25 color Unknown misc 1 @@ -313,8 +313,8 @@ hdac0: nid 30 0x411111f0 as 15 seq 0 hdac0: nid 31 0x411111f0 as 15 seq 0 Speaker None jack 1 loc 1 color Black misc 1 .Ed .Pp -Here we can see, that the nodes with ID (nid) 25 and 27 are front pannel -connectors (Jack, loc 2), nids 20, 24 and 26 are rear pannel connectors +Here we can see, that the nodes with ID (nid) 25 and 27 are front panel +connectors (Jack, loc 2), nids 20, 24 and 26 are rear panel connectors (Jack, loc 1) and nid 21 is a built-in speaker (Fixed, loc 25). Pins with nids 22, 23, 28, 30 and 31 will be disabled by driver due to "None" connectivity. So the pin count and description matches to connectors that From owner-svn-src-head@FreeBSD.ORG Thu Feb 12 14:44:15 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D14C1106576D; Thu, 12 Feb 2009 14:44:15 +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 BAB718FC20; Thu, 12 Feb 2009 14:44:15 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1CEiFKB058567; Thu, 12 Feb 2009 14:44:15 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 n1CEiFT2058561; Thu, 12 Feb 2009 14:44:15 GMT (envelope-from n_hibma@svn.freebsd.org) Message-Id: <200902121444.n1CEiFT2058561@svn.freebsd.org> From: Nick Hibma Date: Thu, 12 Feb 2009 14:44:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188516 - in head/sys/modules: . acpi/acpi agp dtrace/dtrace linux svr4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Feb 2009 14:44:18 -0000 Author: n_hibma Date: Thu Feb 12 14:44:15 2009 New Revision: 188516 URL: http://svn.freebsd.org/changeset/base/188516 Log: Fix a few problems related to building modules in /sys/modules (not checked whether this applies to builds in /sys/*/compile/* as well): - Create empty opt_*.h files were missing - Hook up svr4 to the build. It compiles fine here, so no reason to disconnect it in the Makefile. were missing - Hook up svr4 to the build. It compiles fine here, so no reason to disconnect it in the Makefile. Modified: head/sys/modules/Makefile head/sys/modules/acpi/acpi/Makefile head/sys/modules/agp/Makefile head/sys/modules/dtrace/dtrace/Makefile head/sys/modules/linux/Makefile head/sys/modules/svr4/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Thu Feb 12 14:41:23 2009 (r188515) +++ head/sys/modules/Makefile Thu Feb 12 14:44:15 2009 (r188516) @@ -259,6 +259,7 @@ SUBDIR= ${_3dfx} \ ${_stg} \ stge \ ${_streams} \ + svr4 \ sym \ ${_syscons} \ sysvipc \ Modified: head/sys/modules/acpi/acpi/Makefile ============================================================================== --- head/sys/modules/acpi/acpi/Makefile Thu Feb 12 14:41:23 2009 (r188515) +++ head/sys/modules/acpi/acpi/Makefile Thu Feb 12 14:44:15 2009 (r188516) @@ -58,7 +58,7 @@ SRCS+= cpufreq_if.h device_if.h isa_if.h # XXX ACPI should not depend on the following headers but this is currently # needed for the build of assym.s. # This obviously needs a better and more structural fix. -SRCS+= opt_kstack_pages.h opt_nfs.h opt_apic.h opt_compat.h +SRCS+= opt_kstack_pages.h opt_nfs.h opt_apic.h opt_compat.h opt_hwpmc_hooks.h # Debugging support DBSRC= dbcmds.c dbdisply.c dbexec.c dbfileio.c dbhistry.c dbinput.c dbstats.c Modified: head/sys/modules/agp/Makefile ============================================================================== --- head/sys/modules/agp/Makefile Thu Feb 12 14:41:23 2009 (r188515) +++ head/sys/modules/agp/Makefile Thu Feb 12 14:44:15 2009 (r188516) @@ -15,7 +15,7 @@ SRCS+= agp_amd64.c SRCS+= agp_amd64.c agp_i810.c agp_via.c .endif SRCS+= device_if.h bus_if.h agp_if.h pci_if.h -SRCS+= opt_bus.h +SRCS+= opt_agp.h opt_bus.h MFILES= kern/device_if.m kern/bus_if.m dev/agp/agp_if.m dev/pci/pci_if.m WERROR= Modified: head/sys/modules/dtrace/dtrace/Makefile ============================================================================== --- head/sys/modules/dtrace/dtrace/Makefile Thu Feb 12 14:41:23 2009 (r188515) +++ head/sys/modules/dtrace/dtrace/Makefile Thu Feb 12 14:44:15 2009 (r188516) @@ -23,7 +23,7 @@ SRCS+= bus_if.h device_if.h vnode_if.h SRCS+= assym.s # These are needed for assym.s -SRCS+= opt_compat.h opt_kstack_pages.h opt_nfs.h +SRCS+= opt_compat.h opt_kstack_pages.h opt_nfs.h opt_hwpmc_hooks.h .if ${MACHINE_ARCH} == "i386" SRCS+= opt_apic.h Modified: head/sys/modules/linux/Makefile ============================================================================== --- head/sys/modules/linux/Makefile Thu Feb 12 14:41:23 2009 (r188515) +++ head/sys/modules/linux/Makefile Thu Feb 12 14:44:15 2009 (r188516) @@ -17,7 +17,7 @@ SRCS= linux${SFX}_dummy.c linux_emul.c l device_if.h bus_if.h assym.s # XXX: for assym.s -SRCS+= opt_kstack_pages.h opt_nfs.h opt_apic.h opt_compat.h +SRCS+= opt_kstack_pages.h opt_nfs.h opt_apic.h opt_compat.h opt_hwpmc_hooks.h OBJS= linux${SFX}_locore.o linux${SFX}_support.o Modified: head/sys/modules/svr4/Makefile ============================================================================== --- head/sys/modules/svr4/Makefile Thu Feb 12 14:41:23 2009 (r188515) +++ head/sys/modules/svr4/Makefile Thu Feb 12 14:44:15 2009 (r188516) @@ -9,6 +9,8 @@ SRCS= svr4_sysent.c svr4_sysvec.c opt_co svr4_machdep.c svr4_resource.c svr4_ipc.c OBJS= svr4_locore.o +SRCS+= opt_ktrace.h opt_sysvipc.h opt_route.h + CLEANFILES= svr4_assym.h svr4_genassym.o svr4_assym.h: svr4_genassym.o From owner-svn-src-head@FreeBSD.ORG Thu Feb 12 15:28:15 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D33121065672; Thu, 12 Feb 2009 15:28:15 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A74148FC0A; Thu, 12 Feb 2009 15:28:15 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1CFSFSc059564; Thu, 12 Feb 2009 15:28:15 GMT (envelope-from cognet@svn.freebsd.org) Received: (from cognet@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1CFSF9n059562; Thu, 12 Feb 2009 15:28:15 GMT (envelope-from cognet@svn.freebsd.org) Message-Id: <200902121528.n1CFSF9n059562@svn.freebsd.org> From: Olivier Houchard Date: Thu, 12 Feb 2009 15:28:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188520 - head/sbin/newfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Feb 2009 15:28:16 -0000 Author: cognet Date: Thu Feb 12 15:28:15 2009 New Revision: 188520 URL: http://svn.freebsd.org/changeset/base/188520 Log: Don't add a bwrite() symbol, it breaks the build when building newfs statically. Instead, bring in a stripped down version of sbwrite(), and add the offset to every bwrite() calls. Modified: head/sbin/newfs/mkfs.c head/sbin/newfs/newfs.c Modified: head/sbin/newfs/mkfs.c ============================================================================== --- head/sbin/newfs/mkfs.c Thu Feb 12 15:26:27 2009 (r188519) +++ head/sbin/newfs/mkfs.c Thu Feb 12 15:28:15 2009 (r188520) @@ -101,6 +101,15 @@ static void setblock(struct fs *, unsign static void wtfs(ufs2_daddr_t, int, char *); static u_int32_t newfs_random(void); +static int +do_sbwrite(struct uufsd *disk) +{ + if (!disk->d_sblock) + disk->d_sblock = disk->d_fs.fs_sblockloc / disk->d_bsize; + return (pwrite(disk->d_fd, &disk->d_fs, SBLOCKSIZE, (off_t)((part_ofs + + disk->d_sblock) * disk->d_bsize))); +} + void mkfs(struct partition *pp, char *fsys) { @@ -465,14 +474,15 @@ mkfs(struct partition *pp, char *fsys) if (fsdummy.fs_magic == FS_UFS1_MAGIC) { fsdummy.fs_magic = 0; - bwrite(&disk, SBLOCK_UFS1 / disk.d_bsize, chdummy, SBLOCKSIZE); + bwrite(&disk, part_ofs + SBLOCK_UFS1 / disk.d_bsize, + chdummy, SBLOCKSIZE); for (i = 0; i < fsdummy.fs_ncg; i++) - bwrite(&disk, fsbtodb(&fsdummy, cgsblock(&fsdummy, i)), - chdummy, SBLOCKSIZE); + bwrite(&disk, part_ofs + fsbtodb(&fsdummy, + cgsblock(&fsdummy, i)), chdummy, SBLOCKSIZE); } } if (!Nflag) - sbwrite(&disk, 0); + do_sbwrite(&disk); if (Xflag == 1) { printf("** Exiting on Xflag 1\n"); exit(0); @@ -540,7 +550,7 @@ mkfs(struct partition *pp, char *fsys) exit(0); } if (!Nflag) - sbwrite(&disk, 0); + do_sbwrite(&disk); for (i = 0; i < sblock.fs_cssize; i += sblock.fs_bsize) wtfs(fsbtodb(&sblock, sblock.fs_csaddr + numfrags(&sblock, i)), sblock.fs_cssize - i < sblock.fs_bsize ? @@ -960,7 +970,7 @@ wtfs(ufs2_daddr_t bno, int size, char *b { if (Nflag) return; - if (bwrite(&disk, bno, bf, size) < 0) + if (bwrite(&disk, part_ofs + bno, bf, size) < 0) err(36, "wtfs: %d bytes at sector %jd", size, (intmax_t)bno); } Modified: head/sbin/newfs/newfs.c ============================================================================== --- head/sbin/newfs/newfs.c Thu Feb 12 15:26:27 2009 (r188519) +++ head/sbin/newfs/newfs.c Thu Feb 12 15:28:15 2009 (r188520) @@ -152,16 +152,6 @@ static void usage(void); ufs2_daddr_t part_ofs; /* partition offset in blocks, used with files */ -/* - * need to replace the library's bwrite so that sbwrite uses this one - */ -ssize_t -bwrite(struct uufsd *disk, ufs2_daddr_t blockno, const void *data, size_t size) -{ - return pwrite(disk->d_fd, data, size, - (off_t)((part_ofs + blockno) * disk->d_bsize)); -} - int main(int argc, char *argv[]) { From owner-svn-src-head@FreeBSD.ORG Thu Feb 12 18:33:14 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 04B4210656FD; Thu, 12 Feb 2009 18:33:14 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E61608FC15; Thu, 12 Feb 2009 18:33:13 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1CIXD7M063937; Thu, 12 Feb 2009 18:33:13 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1CIXDnn063936; Thu, 12 Feb 2009 18:33:13 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902121833.n1CIXDnn063936@svn.freebsd.org> From: Sam Leffler Date: Thu, 12 Feb 2009 18:33:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188529 - head/etc/etc.arm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Feb 2009 18:33:15 -0000 Author: sam Date: Thu Feb 12 18:33:13 2009 New Revision: 188529 URL: http://svn.freebsd.org/changeset/base/188529 Log: turn off ttyv*; not aware of any arm-based systems with syscons Reviewed by: imp Modified: head/etc/etc.arm/ttys Modified: head/etc/etc.arm/ttys ============================================================================== --- head/etc/etc.arm/ttys Thu Feb 12 18:28:42 2009 (r188528) +++ head/etc/etc.arm/ttys Thu Feb 12 18:33:13 2009 (r188529) @@ -32,15 +32,15 @@ # when going to single-user mode. console none unknown off secure # -ttyv0 "/usr/libexec/getty Pc" cons25 on secure +ttyv0 "/usr/libexec/getty Pc" cons25 off secure # Virtual terminals -ttyv1 "/usr/libexec/getty Pc" cons25 on secure -ttyv2 "/usr/libexec/getty Pc" cons25 on secure -ttyv3 "/usr/libexec/getty Pc" cons25 on secure -ttyv4 "/usr/libexec/getty Pc" cons25 on secure -ttyv5 "/usr/libexec/getty Pc" cons25 on secure -ttyv6 "/usr/libexec/getty Pc" cons25 on secure -ttyv7 "/usr/libexec/getty Pc" cons25 on secure +ttyv1 "/usr/libexec/getty Pc" cons25 off secure +ttyv2 "/usr/libexec/getty Pc" cons25 off secure +ttyv3 "/usr/libexec/getty Pc" cons25 off secure +ttyv4 "/usr/libexec/getty Pc" cons25 off secure +ttyv5 "/usr/libexec/getty Pc" cons25 off secure +ttyv6 "/usr/libexec/getty Pc" cons25 off secure +ttyv7 "/usr/libexec/getty Pc" cons25 off secure #ttyv8 "/usr/local/bin/xdm -nodaemon" xterm off secure # Serial terminals # The 'dialup' keyword identifies dialin lines to login, fingerd etc. From owner-svn-src-head@FreeBSD.ORG Thu Feb 12 18:33:56 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C06A8106574B; Thu, 12 Feb 2009 18:33:56 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AE7CA8FC0A; Thu, 12 Feb 2009 18:33:56 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1CIXuBg064036; Thu, 12 Feb 2009 18:33:56 GMT (envelope-from rdivacky@svn.freebsd.org) Received: (from rdivacky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1CIXuSr064035; Thu, 12 Feb 2009 18:33:56 GMT (envelope-from rdivacky@svn.freebsd.org) Message-Id: <200902121833.n1CIXuSr064035@svn.freebsd.org> From: Roman Divacky Date: Thu, 12 Feb 2009 18:33:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188531 - head/sys/dev/mxge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Feb 2009 18:33:57 -0000 Author: rdivacky Date: Thu Feb 12 18:33:56 2009 New Revision: 188531 URL: http://svn.freebsd.org/changeset/base/188531 Log: Remove obsolete C preprocessor assertions. Approved by: kib (mentor) Modified: head/sys/dev/mxge/if_mxge.c Modified: head/sys/dev/mxge/if_mxge.c ============================================================================== --- head/sys/dev/mxge/if_mxge.c Thu Feb 12 18:33:26 2009 (r188530) +++ head/sys/dev/mxge/if_mxge.c Thu Feb 12 18:33:56 2009 (r188531) @@ -300,7 +300,7 @@ mxge_parse_strings(mxge_softc_t *sc) return ENXIO; } -#if #cpu(i386) || defined __i386 || defined i386 || defined __i386__ || #cpu(x86_64) || defined __x86_64__ +#if defined __i386 || defined i386 || defined __i386__ || defined __x86_64__ static void mxge_enable_nvidia_ecrc(mxge_softc_t *sc) { From owner-svn-src-head@FreeBSD.ORG Thu Feb 12 18:57:19 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7AD3E1065673; Thu, 12 Feb 2009 18:57:19 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5EA598FC2C; Thu, 12 Feb 2009 18:57:19 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1CIvJOE064585; Thu, 12 Feb 2009 18:57:19 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1CIvJFs064581; Thu, 12 Feb 2009 18:57:19 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200902121857.n1CIvJFs064581@svn.freebsd.org> From: Andrew Thompson Date: Thu, 12 Feb 2009 18:57:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188533 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Feb 2009 18:57:20 -0000 Author: thompsa Date: Thu Feb 12 18:57:18 2009 New Revision: 188533 URL: http://svn.freebsd.org/changeset/base/188533 Log: Add a ieee80211_waitfor_parent() function that will wait for all deferred parent interface tasks to complete. This had been added to the ioctl path but it is also need elsewhere like detach so its safe to teardown. Reported by: Hans Petter Selasky Submitted by: sam Modified: head/sys/net80211/ieee80211.c head/sys/net80211/ieee80211_ioctl.c head/sys/net80211/ieee80211_proto.c head/sys/net80211/ieee80211_proto.h Modified: head/sys/net80211/ieee80211.c ============================================================================== --- head/sys/net80211/ieee80211.c Thu Feb 12 18:50:27 2009 (r188532) +++ head/sys/net80211/ieee80211.c Thu Feb 12 18:57:18 2009 (r188533) @@ -289,9 +289,9 @@ ieee80211_ifdetach(struct ieee80211com * struct ifnet *ifp = ic->ic_ifp; struct ieee80211vap *vap; - /* XXX ieee80211_stop_all? */ while ((vap = TAILQ_FIRST(&ic->ic_vaps)) != NULL) ieee80211_vap_destroy(vap); + ieee80211_waitfor_parent(ic); ieee80211_sysctl_detach(ic); ieee80211_regdomain_detach(ic); Modified: head/sys/net80211/ieee80211_ioctl.c ============================================================================== --- head/sys/net80211/ieee80211_ioctl.c Thu Feb 12 18:50:27 2009 (r188532) +++ head/sys/net80211/ieee80211_ioctl.c Thu Feb 12 18:57:18 2009 (r188533) @@ -3265,7 +3265,7 @@ ieee80211_ioctl(struct ifnet *ifp, u_lon } IEEE80211_UNLOCK(ic); /* Wait for parent ioctl handler if it was queued */ - taskqueue_drain(taskqueue_thread, &ic->ic_parent_task); + ieee80211_waitfor_parent(ic); break; case SIOCADDMULTI: case SIOCDELMULTI: Modified: head/sys/net80211/ieee80211_proto.c ============================================================================== --- head/sys/net80211/ieee80211_proto.c Thu Feb 12 18:50:27 2009 (r188532) +++ head/sys/net80211/ieee80211_proto.c Thu Feb 12 18:57:18 2009 (r188533) @@ -1072,6 +1072,17 @@ parent_updown(void *arg, int npending) } /* + * Block until the parent is in a known state. This is + * used after any operations that dispatch a task (e.g. + * to auto-configure the parent device up/down). + */ +void +ieee80211_waitfor_parent(struct ieee80211com *ic) +{ + taskqueue_drain(taskqueue_thread, &ic->ic_parent_task); +} + +/* * Start a vap running. If this is the first vap to be * set running on the underlying device then we * automatically bring the device up. @@ -1258,6 +1269,8 @@ ieee80211_stop_all(struct ieee80211com * ieee80211_stop_locked(vap); } IEEE80211_UNLOCK(ic); + + ieee80211_waitfor_parent(ic); } /* @@ -1278,6 +1291,8 @@ ieee80211_suspend_all(struct ieee80211co } } IEEE80211_UNLOCK(ic); + + ieee80211_waitfor_parent(ic); } /* Modified: head/sys/net80211/ieee80211_proto.h ============================================================================== --- head/sys/net80211/ieee80211_proto.h Thu Feb 12 18:50:27 2009 (r188532) +++ head/sys/net80211/ieee80211_proto.h Thu Feb 12 18:57:18 2009 (r188533) @@ -260,6 +260,7 @@ ieee80211_gettid(const struct ieee80211_ return tid; } +void ieee80211_waitfor_parent(struct ieee80211com *); void ieee80211_start_locked(struct ieee80211vap *); void ieee80211_init(void *); void ieee80211_start_all(struct ieee80211com *); From owner-svn-src-head@FreeBSD.ORG Thu Feb 12 19:00:13 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8DC111065675; Thu, 12 Feb 2009 19:00:13 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7C3A08FC12; Thu, 12 Feb 2009 19:00:13 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1CJ0DnP064702; Thu, 12 Feb 2009 19:00:13 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1CJ0Dn8064701; Thu, 12 Feb 2009 19:00:13 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200902121900.n1CJ0Dn8064701@svn.freebsd.org> From: Ed Schouten Date: Thu, 12 Feb 2009 19:00:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188534 - head/lib/libc/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Feb 2009 19:00:14 -0000 Author: ed Date: Thu Feb 12 19:00:13 2009 New Revision: 188534 URL: http://svn.freebsd.org/changeset/base/188534 Log: Make ttyslot(3) work with pts(4) devices. It seems ttyslot() calls rindex(), to strip the device name to the last slash, but this is obviously invalid. /dev/pts/0 should be stripped until pts/0. Because /etc/ttys only supports TTY names in /dev/, just strip this piece of the pathname. Modified: head/lib/libc/gen/ttyslot.c Modified: head/lib/libc/gen/ttyslot.c ============================================================================== --- head/lib/libc/gen/ttyslot.c Thu Feb 12 18:57:18 2009 (r188533) +++ head/lib/libc/gen/ttyslot.c Thu Feb 12 19:00:13 2009 (r188534) @@ -33,6 +33,7 @@ static char sccsid[] = "@(#)ttyslot.c 8. #include __FBSDID("$FreeBSD$"); +#include #include #include #include @@ -43,19 +44,17 @@ ttyslot() { struct ttyent *ttyp; int slot; - char *p; int cnt; char *name; setttyent(); for (cnt = 0; cnt < 3; ++cnt) if ( (name = ttyname(cnt)) ) { - if ( (p = rindex(name, '/')) ) - ++p; - else - p = name; + if (strncmp(name, _PATH_DEV, sizeof _PATH_DEV - 1) != 0) + break; + name += sizeof _PATH_DEV - 1; for (slot = 1; (ttyp = getttyent()); ++slot) - if (!strcmp(ttyp->ty_name, p)) { + if (!strcmp(ttyp->ty_name, name)) { endttyent(); return(slot); } From owner-svn-src-head@FreeBSD.ORG Thu Feb 12 19:21:49 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2AAA110656D6; Thu, 12 Feb 2009 19:21:49 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1513F8FC08; Thu, 12 Feb 2009 19:21:49 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1CJLnlC065115; Thu, 12 Feb 2009 19:21:49 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1CJLnR7065112; Thu, 12 Feb 2009 19:21:49 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200902121921.n1CJLnR7065112@svn.freebsd.org> From: Ed Schouten Date: Thu, 12 Feb 2009 19:21:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188535 - in head/etc: etc.amd64 etc.arm etc.i386 etc.ia64 etc.mips etc.powerpc etc.sparc64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Feb 2009 19:21:51 -0000 Author: ed Date: Thu Feb 12 19:21:48 2009 New Revision: 188535 URL: http://svn.freebsd.org/changeset/base/188535 Log: Remove pts(4) entries from /etc/ttys. Even though I increased the amount of pts(4) entries in /etc/ttys some time ago, I didn't realize back then those entries shouldn't have been there in the first place. I just looked at the getttyent() source code and it turns out when you call setttyent(), it walks through /dev/pts and looks for the device with the highest number. After you receive EOF's from getttyent(), it makes up entries for pts(4) devices. This means that adding entries for pts(4) is somewhat harmful, because if you now traverse the list, you get redundant entries, so just remove them. Modified: head/etc/etc.amd64/ttys head/etc/etc.arm/ttys head/etc/etc.i386/ttys head/etc/etc.ia64/ttys head/etc/etc.mips/ttys head/etc/etc.powerpc/ttys head/etc/etc.sparc64/ttys Modified: head/etc/etc.amd64/ttys ============================================================================== --- head/etc/etc.amd64/ttys Thu Feb 12 19:00:13 2009 (r188534) +++ head/etc/etc.amd64/ttys Thu Feb 12 19:21:48 2009 (r188535) @@ -307,515 +307,3 @@ ttySs none network ttySt none network ttySu none network ttySv none network -pts/0 none network -pts/1 none network -pts/2 none network -pts/3 none network -pts/4 none network -pts/5 none network -pts/6 none network -pts/7 none network -pts/8 none network -pts/9 none network -pts/10 none network -pts/11 none network -pts/12 none network -pts/13 none network -pts/14 none network -pts/15 none network -pts/16 none network -pts/17 none network -pts/18 none network -pts/19 none network -pts/20 none network -pts/21 none network -pts/22 none network -pts/23 none network -pts/24 none network -pts/25 none network -pts/26 none network -pts/27 none network -pts/28 none network -pts/29 none network -pts/30 none network -pts/31 none network -pts/32 none network -pts/33 none network -pts/34 none network -pts/35 none network -pts/36 none network -pts/37 none network -pts/38 none network -pts/39 none network -pts/40 none network -pts/41 none network -pts/42 none network -pts/43 none network -pts/44 none network -pts/45 none network -pts/46 none network -pts/47 none network -pts/48 none network -pts/49 none network -pts/50 none network -pts/51 none network -pts/52 none network -pts/53 none network -pts/54 none network -pts/55 none network -pts/56 none network -pts/57 none network -pts/58 none network -pts/59 none network -pts/60 none network -pts/61 none network -pts/62 none network -pts/63 none network -pts/64 none network -pts/65 none network -pts/66 none network -pts/67 none network -pts/68 none network -pts/69 none network -pts/70 none network -pts/71 none network -pts/72 none network -pts/73 none network -pts/74 none network -pts/75 none network -pts/76 none network -pts/77 none network -pts/78 none network -pts/79 none network -pts/80 none network -pts/81 none network -pts/82 none network -pts/83 none network -pts/84 none network -pts/85 none network -pts/86 none network -pts/87 none network -pts/88 none network -pts/89 none network -pts/90 none network -pts/91 none network -pts/92 none network -pts/93 none network -pts/94 none network -pts/95 none network -pts/96 none network -pts/97 none network -pts/98 none network -pts/99 none network -pts/100 none network -pts/101 none network -pts/102 none network -pts/103 none network -pts/104 none network -pts/105 none network -pts/106 none network -pts/107 none network -pts/108 none network -pts/109 none network -pts/110 none network -pts/111 none network -pts/112 none network -pts/113 none network -pts/114 none network -pts/115 none network -pts/116 none network -pts/117 none network -pts/118 none network -pts/119 none network -pts/120 none network -pts/121 none network -pts/122 none network -pts/123 none network -pts/124 none network -pts/125 none network -pts/126 none network -pts/127 none network -pts/128 none network -pts/129 none network -pts/130 none network -pts/131 none network -pts/132 none network -pts/133 none network -pts/134 none network -pts/135 none network -pts/136 none network -pts/137 none network -pts/138 none network -pts/139 none network -pts/140 none network -pts/141 none network -pts/142 none network -pts/143 none network -pts/144 none network -pts/145 none network -pts/146 none network -pts/147 none network -pts/148 none network -pts/149 none network -pts/150 none network -pts/151 none network -pts/152 none network -pts/153 none network -pts/154 none network -pts/155 none network -pts/156 none network -pts/157 none network -pts/158 none network -pts/159 none network -pts/160 none network -pts/161 none network -pts/162 none network -pts/163 none network -pts/164 none network -pts/165 none network -pts/166 none network -pts/167 none network -pts/168 none network -pts/169 none network -pts/170 none network -pts/171 none network -pts/172 none network -pts/173 none network -pts/174 none network -pts/175 none network -pts/176 none network -pts/177 none network -pts/178 none network -pts/179 none network -pts/180 none network -pts/181 none network -pts/182 none network -pts/183 none network -pts/184 none network -pts/185 none network -pts/186 none network -pts/187 none network -pts/188 none network -pts/189 none network -pts/190 none network -pts/191 none network -pts/192 none network -pts/193 none network -pts/194 none network -pts/195 none network -pts/196 none network -pts/197 none network -pts/198 none network -pts/199 none network -pts/200 none network -pts/201 none network -pts/202 none network -pts/203 none network -pts/204 none network -pts/205 none network -pts/206 none network -pts/207 none network -pts/208 none network -pts/209 none network -pts/210 none network -pts/211 none network -pts/212 none network -pts/213 none network -pts/214 none network -pts/215 none network -pts/216 none network -pts/217 none network -pts/218 none network -pts/219 none network -pts/220 none network -pts/221 none network -pts/222 none network -pts/223 none network -pts/224 none network -pts/225 none network -pts/226 none network -pts/227 none network -pts/228 none network -pts/229 none network -pts/230 none network -pts/231 none network -pts/232 none network -pts/233 none network -pts/234 none network -pts/235 none network -pts/236 none network -pts/237 none network -pts/238 none network -pts/239 none network -pts/240 none network -pts/241 none network -pts/242 none network -pts/243 none network -pts/244 none network -pts/245 none network -pts/246 none network -pts/247 none network -pts/248 none network -pts/249 none network -pts/250 none network -pts/251 none network -pts/252 none network -pts/253 none network -pts/254 none network -pts/255 none network -pts/256 none network -pts/257 none network -pts/258 none network -pts/259 none network -pts/260 none network -pts/262 none network -pts/262 none network -pts/263 none network -pts/264 none network -pts/265 none network -pts/266 none network -pts/267 none network -pts/268 none network -pts/269 none network -pts/270 none network -pts/272 none network -pts/272 none network -pts/273 none network -pts/274 none network -pts/275 none network -pts/276 none network -pts/277 none network -pts/278 none network -pts/279 none network -pts/280 none network -pts/282 none network -pts/282 none network -pts/283 none network -pts/284 none network -pts/285 none network -pts/286 none network -pts/287 none network -pts/288 none network -pts/289 none network -pts/290 none network -pts/292 none network -pts/292 none network -pts/293 none network -pts/294 none network -pts/295 none network -pts/296 none network -pts/297 none network -pts/298 none network -pts/299 none network -pts/300 none network -pts/301 none network -pts/302 none network -pts/303 none network -pts/304 none network -pts/305 none network -pts/306 none network -pts/307 none network -pts/308 none network -pts/309 none network -pts/310 none network -pts/311 none network -pts/312 none network -pts/313 none network -pts/314 none network -pts/315 none network -pts/316 none network -pts/317 none network -pts/318 none network -pts/319 none network -pts/320 none network -pts/321 none network -pts/322 none network -pts/323 none network -pts/324 none network -pts/325 none network -pts/326 none network -pts/327 none network -pts/328 none network -pts/329 none network -pts/330 none network -pts/331 none network -pts/332 none network -pts/333 none network -pts/334 none network -pts/335 none network -pts/336 none network -pts/337 none network -pts/338 none network -pts/339 none network -pts/340 none network -pts/341 none network -pts/342 none network -pts/343 none network -pts/344 none network -pts/345 none network -pts/346 none network -pts/347 none network -pts/348 none network -pts/349 none network -pts/350 none network -pts/351 none network -pts/352 none network -pts/353 none network -pts/354 none network -pts/355 none network -pts/356 none network -pts/357 none network -pts/358 none network -pts/359 none network -pts/360 none network -pts/362 none network -pts/362 none network -pts/363 none network -pts/364 none network -pts/365 none network -pts/366 none network -pts/367 none network -pts/368 none network -pts/369 none network -pts/370 none network -pts/372 none network -pts/372 none network -pts/373 none network -pts/374 none network -pts/375 none network -pts/376 none network -pts/377 none network -pts/378 none network -pts/379 none network -pts/380 none network -pts/382 none network -pts/382 none network -pts/383 none network -pts/384 none network -pts/385 none network -pts/386 none network -pts/387 none network -pts/388 none network -pts/389 none network -pts/390 none network -pts/392 none network -pts/392 none network -pts/393 none network -pts/394 none network -pts/395 none network -pts/396 none network -pts/397 none network -pts/398 none network -pts/399 none network -pts/400 none network -pts/401 none network -pts/402 none network -pts/403 none network -pts/404 none network -pts/405 none network -pts/406 none network -pts/407 none network -pts/408 none network -pts/409 none network -pts/410 none network -pts/411 none network -pts/412 none network -pts/413 none network -pts/414 none network -pts/415 none network -pts/416 none network -pts/417 none network -pts/418 none network -pts/419 none network -pts/420 none network -pts/421 none network -pts/422 none network -pts/423 none network -pts/424 none network -pts/425 none network -pts/426 none network -pts/427 none network -pts/428 none network -pts/429 none network -pts/430 none network -pts/431 none network -pts/432 none network -pts/433 none network -pts/434 none network -pts/435 none network -pts/436 none network -pts/437 none network -pts/438 none network -pts/439 none network -pts/440 none network -pts/441 none network -pts/442 none network -pts/443 none network -pts/444 none network -pts/445 none network -pts/446 none network -pts/447 none network -pts/448 none network -pts/449 none network -pts/450 none network -pts/451 none network -pts/452 none network -pts/453 none network -pts/454 none network -pts/455 none network -pts/456 none network -pts/457 none network -pts/458 none network -pts/459 none network -pts/460 none network -pts/462 none network -pts/462 none network -pts/463 none network -pts/464 none network -pts/465 none network -pts/466 none network -pts/467 none network -pts/468 none network -pts/469 none network -pts/470 none network -pts/472 none network -pts/472 none network -pts/473 none network -pts/474 none network -pts/475 none network -pts/476 none network -pts/477 none network -pts/478 none network -pts/479 none network -pts/480 none network -pts/482 none network -pts/482 none network -pts/483 none network -pts/484 none network -pts/485 none network -pts/486 none network -pts/487 none network -pts/488 none network -pts/489 none network -pts/490 none network -pts/492 none network -pts/492 none network -pts/493 none network -pts/494 none network -pts/495 none network -pts/496 none network -pts/497 none network -pts/498 none network -pts/499 none network -pts/500 none network -pts/501 none network -pts/502 none network -pts/503 none network -pts/504 none network -pts/505 none network -pts/506 none network -pts/507 none network -pts/508 none network -pts/509 none network -pts/510 none network -pts/511 none network Modified: head/etc/etc.arm/ttys ============================================================================== --- head/etc/etc.arm/ttys Thu Feb 12 19:00:13 2009 (r188534) +++ head/etc/etc.arm/ttys Thu Feb 12 19:21:48 2009 (r188535) @@ -307,515 +307,3 @@ ttySs none network ttySt none network ttySu none network ttySv none network -pts/0 none network -pts/1 none network -pts/2 none network -pts/3 none network -pts/4 none network -pts/5 none network -pts/6 none network -pts/7 none network -pts/8 none network -pts/9 none network -pts/10 none network -pts/11 none network -pts/12 none network -pts/13 none network -pts/14 none network -pts/15 none network -pts/16 none network -pts/17 none network -pts/18 none network -pts/19 none network -pts/20 none network -pts/21 none network -pts/22 none network -pts/23 none network -pts/24 none network -pts/25 none network -pts/26 none network -pts/27 none network -pts/28 none network -pts/29 none network -pts/30 none network -pts/31 none network -pts/32 none network -pts/33 none network -pts/34 none network -pts/35 none network -pts/36 none network -pts/37 none network -pts/38 none network -pts/39 none network -pts/40 none network -pts/41 none network -pts/42 none network -pts/43 none network -pts/44 none network -pts/45 none network -pts/46 none network -pts/47 none network -pts/48 none network -pts/49 none network -pts/50 none network -pts/51 none network -pts/52 none network -pts/53 none network -pts/54 none network -pts/55 none network -pts/56 none network -pts/57 none network -pts/58 none network -pts/59 none network -pts/60 none network -pts/61 none network -pts/62 none network -pts/63 none network -pts/64 none network -pts/65 none network -pts/66 none network -pts/67 none network -pts/68 none network -pts/69 none network -pts/70 none network -pts/71 none network -pts/72 none network -pts/73 none network -pts/74 none network -pts/75 none network -pts/76 none network -pts/77 none network -pts/78 none network -pts/79 none network -pts/80 none network -pts/81 none network -pts/82 none network -pts/83 none network -pts/84 none network -pts/85 none network -pts/86 none network -pts/87 none network -pts/88 none network -pts/89 none network -pts/90 none network -pts/91 none network -pts/92 none network -pts/93 none network -pts/94 none network -pts/95 none network -pts/96 none network -pts/97 none network -pts/98 none network -pts/99 none network -pts/100 none network -pts/101 none network -pts/102 none network -pts/103 none network -pts/104 none network -pts/105 none network -pts/106 none network -pts/107 none network -pts/108 none network -pts/109 none network -pts/110 none network -pts/111 none network -pts/112 none network -pts/113 none network -pts/114 none network -pts/115 none network -pts/116 none network -pts/117 none network -pts/118 none network -pts/119 none network -pts/120 none network -pts/121 none network -pts/122 none network -pts/123 none network -pts/124 none network -pts/125 none network -pts/126 none network -pts/127 none network -pts/128 none network -pts/129 none network -pts/130 none network -pts/131 none network -pts/132 none network -pts/133 none network -pts/134 none network -pts/135 none network -pts/136 none network -pts/137 none network -pts/138 none network -pts/139 none network -pts/140 none network -pts/141 none network -pts/142 none network -pts/143 none network -pts/144 none network -pts/145 none network -pts/146 none network -pts/147 none network -pts/148 none network -pts/149 none network -pts/150 none network -pts/151 none network -pts/152 none network -pts/153 none network -pts/154 none network -pts/155 none network -pts/156 none network -pts/157 none network -pts/158 none network -pts/159 none network -pts/160 none network -pts/161 none network -pts/162 none network -pts/163 none network -pts/164 none network -pts/165 none network -pts/166 none network -pts/167 none network -pts/168 none network -pts/169 none network -pts/170 none network -pts/171 none network -pts/172 none network -pts/173 none network -pts/174 none network -pts/175 none network -pts/176 none network -pts/177 none network -pts/178 none network -pts/179 none network -pts/180 none network -pts/181 none network -pts/182 none network -pts/183 none network -pts/184 none network -pts/185 none network -pts/186 none network -pts/187 none network -pts/188 none network -pts/189 none network -pts/190 none network -pts/191 none network -pts/192 none network -pts/193 none network -pts/194 none network -pts/195 none network -pts/196 none network -pts/197 none network -pts/198 none network -pts/199 none network -pts/200 none network -pts/201 none network -pts/202 none network -pts/203 none network -pts/204 none network -pts/205 none network -pts/206 none network -pts/207 none network -pts/208 none network -pts/209 none network -pts/210 none network -pts/211 none network -pts/212 none network -pts/213 none network -pts/214 none network -pts/215 none network -pts/216 none network -pts/217 none network -pts/218 none network -pts/219 none network -pts/220 none network -pts/221 none network -pts/222 none network -pts/223 none network -pts/224 none network -pts/225 none network -pts/226 none network -pts/227 none network -pts/228 none network -pts/229 none network -pts/230 none network -pts/231 none network -pts/232 none network -pts/233 none network -pts/234 none network -pts/235 none network -pts/236 none network -pts/237 none network -pts/238 none network -pts/239 none network -pts/240 none network -pts/241 none network -pts/242 none network -pts/243 none network -pts/244 none network -pts/245 none network -pts/246 none network -pts/247 none network -pts/248 none network -pts/249 none network -pts/250 none network -pts/251 none network -pts/252 none network -pts/253 none network -pts/254 none network -pts/255 none network -pts/256 none network -pts/257 none network -pts/258 none network -pts/259 none network -pts/260 none network -pts/262 none network -pts/262 none network -pts/263 none network -pts/264 none network -pts/265 none network -pts/266 none network -pts/267 none network -pts/268 none network -pts/269 none network -pts/270 none network -pts/272 none network -pts/272 none network -pts/273 none network -pts/274 none network -pts/275 none network -pts/276 none network -pts/277 none network -pts/278 none network -pts/279 none network -pts/280 none network -pts/282 none network -pts/282 none network -pts/283 none network -pts/284 none network -pts/285 none network -pts/286 none network -pts/287 none network -pts/288 none network -pts/289 none network -pts/290 none network -pts/292 none network -pts/292 none network -pts/293 none network -pts/294 none network -pts/295 none network -pts/296 none network -pts/297 none network -pts/298 none network -pts/299 none network -pts/300 none network -pts/301 none network -pts/302 none network -pts/303 none network -pts/304 none network -pts/305 none network -pts/306 none network -pts/307 none network -pts/308 none network -pts/309 none network -pts/310 none network -pts/311 none network -pts/312 none network -pts/313 none network -pts/314 none network -pts/315 none network -pts/316 none network -pts/317 none network -pts/318 none network -pts/319 none network -pts/320 none network -pts/321 none network -pts/322 none network -pts/323 none network -pts/324 none network -pts/325 none network -pts/326 none network -pts/327 none network -pts/328 none network -pts/329 none network -pts/330 none network -pts/331 none network -pts/332 none network -pts/333 none network -pts/334 none network -pts/335 none network -pts/336 none network -pts/337 none network -pts/338 none network -pts/339 none network -pts/340 none network -pts/341 none network -pts/342 none network -pts/343 none network -pts/344 none network -pts/345 none network -pts/346 none network -pts/347 none network -pts/348 none network -pts/349 none network -pts/350 none network -pts/351 none network -pts/352 none network -pts/353 none network -pts/354 none network -pts/355 none network -pts/356 none network -pts/357 none network -pts/358 none network -pts/359 none network -pts/360 none network -pts/362 none network -pts/362 none network -pts/363 none network -pts/364 none network -pts/365 none network -pts/366 none network -pts/367 none network -pts/368 none network -pts/369 none network -pts/370 none network -pts/372 none network -pts/372 none network -pts/373 none network -pts/374 none network -pts/375 none network -pts/376 none network -pts/377 none network -pts/378 none network -pts/379 none network -pts/380 none network -pts/382 none network -pts/382 none network -pts/383 none network -pts/384 none network -pts/385 none network -pts/386 none network -pts/387 none network -pts/388 none network -pts/389 none network -pts/390 none network -pts/392 none network -pts/392 none network -pts/393 none network -pts/394 none network -pts/395 none network -pts/396 none network -pts/397 none network -pts/398 none network -pts/399 none network -pts/400 none network -pts/401 none network -pts/402 none network -pts/403 none network -pts/404 none network -pts/405 none network -pts/406 none network -pts/407 none network -pts/408 none network -pts/409 none network -pts/410 none network -pts/411 none network -pts/412 none network -pts/413 none network -pts/414 none network -pts/415 none network -pts/416 none network -pts/417 none network -pts/418 none network -pts/419 none network -pts/420 none network -pts/421 none network -pts/422 none network -pts/423 none network -pts/424 none network -pts/425 none network -pts/426 none network -pts/427 none network -pts/428 none network -pts/429 none network -pts/430 none network -pts/431 none network -pts/432 none network -pts/433 none network -pts/434 none network -pts/435 none network -pts/436 none network -pts/437 none network -pts/438 none network -pts/439 none network -pts/440 none network -pts/441 none network -pts/442 none network -pts/443 none network -pts/444 none network -pts/445 none network -pts/446 none network -pts/447 none network -pts/448 none network -pts/449 none network -pts/450 none network -pts/451 none network -pts/452 none network -pts/453 none network -pts/454 none network -pts/455 none network -pts/456 none network -pts/457 none network -pts/458 none network -pts/459 none network -pts/460 none network -pts/462 none network -pts/462 none network -pts/463 none network -pts/464 none network -pts/465 none network -pts/466 none network -pts/467 none network -pts/468 none network -pts/469 none network -pts/470 none network -pts/472 none network -pts/472 none network -pts/473 none network -pts/474 none network -pts/475 none network *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Thu Feb 12 19:32:53 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 24908106566C; Thu, 12 Feb 2009 19:32:53 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1327D8FC16; Thu, 12 Feb 2009 19:32:53 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1CJWqvc065370; Thu, 12 Feb 2009 19:32:52 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1CJWqAA065369; Thu, 12 Feb 2009 19:32:52 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200902121932.n1CJWqAA065369@svn.freebsd.org> From: Ed Schouten Date: Thu, 12 Feb 2009 19:32:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188536 - head/lib/libc/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Feb 2009 19:32:53 -0000 Author: ed Date: Thu Feb 12 19:32:52 2009 New Revision: 188536 URL: http://svn.freebsd.org/changeset/base/188536 Log: Properly invalidate highest pts number when calling setttyent(). When calling setttyent() after calling endttyent(), pts_valid will never be set to 1, because the readdir()-loop will likely never vind a pts that has a higher number than before. Simplify the code by removing pts_valid. We'll just set maxpts to -1 when we don't have a valid count yet. Modified: head/lib/libc/gen/getttyent.c Modified: head/lib/libc/gen/getttyent.c ============================================================================== --- head/lib/libc/gen/getttyent.c Thu Feb 12 19:21:48 2009 (r188535) +++ head/lib/libc/gen/getttyent.c Thu Feb 12 19:32:52 2009 (r188536) @@ -43,9 +43,8 @@ __FBSDID("$FreeBSD$"); static char zapchar; static FILE *tf; -static int maxpts = 0; +static int maxpts = -1; static int curpts = 0; -static int pts_valid = 0; static size_t lbsize; static char *line; @@ -84,7 +83,7 @@ getttyent() return (NULL); for (;;) { if (!fgets(p = line, lbsize, tf)) { - if (pts_valid == 1 && curpts <= maxpts) { + if (curpts <= maxpts) { sprintf(devpts_name, "pts/%d", curpts++); tty.ty_name = devpts_name; tty.ty_getty = tty.ty_type = NULL; @@ -234,12 +233,12 @@ setttyent() if (devpts_dir) { struct dirent *dp; + maxpts = -1; while ((dp = readdir(devpts_dir))) { if (strcmp(dp->d_name, ".") != 0 && strcmp(dp->d_name, "..") != 0) { if (atoi(dp->d_name) > maxpts) { maxpts = atoi(dp->d_name); - pts_valid = 1; curpts = 0; } } @@ -259,7 +258,7 @@ endttyent() { int rval; - pts_valid = 0; + maxpts = -1; /* * NB: Don't free `line' because getttynam() * may still be referencing it From owner-svn-src-head@FreeBSD.ORG Thu Feb 12 21:01:16 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BF0BB1065670; Thu, 12 Feb 2009 21:01:16 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AD2B78FC15; Thu, 12 Feb 2009 21:01:16 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1CL1GNG066951; Thu, 12 Feb 2009 21:01:16 GMT (envelope-from cognet@svn.freebsd.org) Received: (from cognet@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1CL1GFc066950; Thu, 12 Feb 2009 21:01:16 GMT (envelope-from cognet@svn.freebsd.org) Message-Id: <200902122101.n1CL1GFc066950@svn.freebsd.org> From: Olivier Houchard Date: Thu, 12 Feb 2009 21:01:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188537 - head/sys/modules X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Feb 2009 21:01:17 -0000 Author: cognet Date: Thu Feb 12 21:01:16 2009 New Revision: 188537 URL: http://svn.freebsd.org/changeset/base/188537 Log: Unbreak build by making svr4 conditional on i386. Modified: head/sys/modules/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Thu Feb 12 19:32:52 2009 (r188536) +++ head/sys/modules/Makefile Thu Feb 12 21:01:16 2009 (r188537) @@ -259,7 +259,7 @@ SUBDIR= ${_3dfx} \ ${_stg} \ stge \ ${_streams} \ - svr4 \ + ${_svr4} \ sym \ ${_syscons} \ sysvipc \ @@ -438,6 +438,7 @@ _sppp= sppp _sr= sr _stg= stg _streams= streams +_svr4= svr4 _tmpfs= tmpfs _upgt= upgt _urtw= urtw From owner-svn-src-head@FreeBSD.ORG Thu Feb 12 22:55:39 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D9E911065679; Thu, 12 Feb 2009 22:55:39 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C76698FC08; Thu, 12 Feb 2009 22:55:39 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1CMtdtL069189; Thu, 12 Feb 2009 22:55:39 GMT (envelope-from cognet@svn.freebsd.org) Received: (from cognet@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1CMtdJm069188; Thu, 12 Feb 2009 22:55:39 GMT (envelope-from cognet@svn.freebsd.org) Message-Id: <200902122255.n1CMtdJm069188@svn.freebsd.org> From: Olivier Houchard Date: Thu, 12 Feb 2009 22:55:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188539 - head/sys/arm/arm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Feb 2009 22:55:41 -0000 Author: cognet Date: Thu Feb 12 22:55:39 2009 New Revision: 188539 URL: http://svn.freebsd.org/changeset/base/188539 Log: Do not set thread0.td_frame to a bogus value, as it's going to overwrite the thread0 pcb, while the board-dependant code already set a good trapframe. Reported by: Mark Tinguely MFC after: 1 week Modified: head/sys/arm/arm/machdep.c Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Thu Feb 12 21:49:59 2009 (r188538) +++ head/sys/arm/arm/machdep.c Thu Feb 12 22:55:39 2009 (r188539) @@ -304,7 +304,6 @@ cpu_startup(void *dummy) USPACE_SVC_STACK_TOP; vector_page_setprot(VM_PROT_READ); pmap_set_pcb_pagedir(pmap_kernel(), pcb); - thread0.td_frame = (struct trapframe *)pcb->un_32.pcb32_sp - 1; pmap_postinit(); #ifdef ARM_CACHE_LOCK_ENABLE pmap_kenter_user(ARM_TP_ADDRESS, ARM_TP_ADDRESS); From owner-svn-src-head@FreeBSD.ORG Thu Feb 12 23:23:30 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F0B2F106564A; Thu, 12 Feb 2009 23:23:30 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DE5E38FC14; Thu, 12 Feb 2009 23:23:30 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1CNNUPW069705; Thu, 12 Feb 2009 23:23:30 GMT (envelope-from cognet@svn.freebsd.org) Received: (from cognet@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1CNNUGc069701; Thu, 12 Feb 2009 23:23:30 GMT (envelope-from cognet@svn.freebsd.org) Message-Id: <200902122323.n1CNNUGc069701@svn.freebsd.org> From: Olivier Houchard Date: Thu, 12 Feb 2009 23:23:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188540 - in head/sys/arm: arm include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Feb 2009 23:23:31 -0000 Author: cognet Date: Thu Feb 12 23:23:30 2009 New Revision: 188540 URL: http://svn.freebsd.org/changeset/base/188540 Log: To prevent various race conditions in the RAS code, store and restore the values in ARM_RAS_START and ARM_RAS_END at context switch time. MFC after: 1 week Modified: head/sys/arm/arm/genassym.c head/sys/arm/arm/swtch.S head/sys/arm/include/proc.h head/sys/arm/include/sysarch.h Modified: head/sys/arm/arm/genassym.c ============================================================================== --- head/sys/arm/arm/genassym.c Thu Feb 12 22:55:39 2009 (r188539) +++ head/sys/arm/arm/genassym.c Thu Feb 12 23:23:30 2009 (r188540) @@ -96,6 +96,8 @@ ASSYM(TD_FRAME, offsetof(struct thread, ASSYM(TD_MD, offsetof(struct thread, td_md)); ASSYM(TD_LOCK, offsetof(struct thread, td_lock)); ASSYM(MD_TP, offsetof(struct mdthread, md_tp)); +ASSYM(MD_RAS_START, offsetof(struct mdthread, md_ras_start)); +ASSYM(MD_RAS_END, offsetof(struct mdthread, md_ras_end)); ASSYM(TF_R0, offsetof(struct trapframe, tf_r0)); ASSYM(TF_R1, offsetof(struct trapframe, tf_r1)); Modified: head/sys/arm/arm/swtch.S ============================================================================== --- head/sys/arm/arm/swtch.S Thu Feb 12 22:55:39 2009 (r188539) +++ head/sys/arm/arm/swtch.S Thu Feb 12 23:23:30 2009 (r188540) @@ -205,8 +205,12 @@ ENTRY(cpu_throw) /* Set the new tp */ ldr r6, [r5, #(TD_MD + MD_TP)] - ldr r5, =ARM_TP_ADDRESS - strt r6, [r5] + ldr r4, =ARM_TP_ADDRESS + str r6, [r4] + ldr r6, [r5, #(TD_MD + MD_RAS_START)] + str r6, [r4, #4] /* ARM_RAS_START */ + ldr r6, [r5, #(TD_MD + MD_RAS_END)] + str r6, [r4, #4] /* ARM_RAS_END */ /* Hook in a new pcb */ ldr r6, .Lcurpcb @@ -265,12 +269,20 @@ ENTRY(cpu_switch) */ /* Store the old tp */ ldr r3, =ARM_TP_ADDRESS - ldrt r9, [r3] + ldr r9, [r3] str r9, [r0, #(TD_MD + MD_TP)] + ldr r9, [r3, #4] + str r9, [r0, #(TD_MD + MD_RAS_START)] + ldr r9, [r3, #8] + str r9, [r0, #(TD_MD + MD_RAS_END)] /* Set the new tp */ ldr r9, [r1, #(TD_MD + MD_TP)] - strt r9, [r3] + str r9, [r3] + ldr r9, [r1, #(TD_MD + MD_RAS_START)] + str r9, [r3, #4] + ldr r9, [r1, #(TD_MD + MD_RAS_END)] + str r9, [r3, #8] /* Get the user structure for the new process in r9 */ ldr r9, [r1, #(TD_PCB)] Modified: head/sys/arm/include/proc.h ============================================================================== --- head/sys/arm/include/proc.h Thu Feb 12 22:55:39 2009 (r188539) +++ head/sys/arm/include/proc.h Thu Feb 12 23:23:30 2009 (r188540) @@ -51,6 +51,8 @@ struct mdthread { int md_ptrace_instr; int md_ptrace_addr; void *md_tp; + void *md_ras_start; + void *md_ras_end; }; struct mdproc { Modified: head/sys/arm/include/sysarch.h ============================================================================== --- head/sys/arm/include/sysarch.h Thu Feb 12 22:55:39 2009 (r188539) +++ head/sys/arm/include/sysarch.h Thu Feb 12 23:23:30 2009 (r188540) @@ -42,6 +42,9 @@ * The ARM_TP_ADDRESS points to a special purpose page, which is used as local * store for the ARM per-thread data and Restartable Atomic Sequences support. * Put it just above the "high" vectors' page. + * the cpu_switch() code assumes ARM_RAS_START is ARM_TP_ADDRESS + 4, and + * ARM_RAS_END is ARM_TP_ADDRESS + 8, so if that ever changes, be sure to + * update the cpu_switch() (and cpu_throw()) code as well. */ #define ARM_TP_ADDRESS (ARM_VECTORS_HIGH + 0x1000) #define ARM_RAS_START (ARM_TP_ADDRESS + 4) From owner-svn-src-head@FreeBSD.ORG Thu Feb 12 23:34:58 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7898B106567C; Thu, 12 Feb 2009 23:34:58 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 66F278FC12; Thu, 12 Feb 2009 23:34:58 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1CNYwMw069934; Thu, 12 Feb 2009 23:34:58 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1CNYwBv069933; Thu, 12 Feb 2009 23:34:58 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902122334.n1CNYwBv069933@svn.freebsd.org> From: Sam Leffler Date: Thu, 12 Feb 2009 23:34:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188541 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Feb 2009 23:34:59 -0000 Author: sam Date: Thu Feb 12 23:34:58 2009 New Revision: 188541 URL: http://svn.freebsd.org/changeset/base/188541 Log: o replace ieee80211_node_reclaim by individual operations to release the references to iv_bss and the sta table; this is equivalent and causes direct reclaim of the old bss node when any references in packets inflight are reclaimed (previously the old node would sit in the bss table until the inactivity processing reclaimed it) o remove ieee80211_node_reclaim now that it's only use is gone Reviewed by: avatar, cbzimmer Modified: head/sys/net80211/ieee80211_node.c Modified: head/sys/net80211/ieee80211_node.c ============================================================================== --- head/sys/net80211/ieee80211_node.c Thu Feb 12 23:23:30 2009 (r188540) +++ head/sys/net80211/ieee80211_node.c Thu Feb 12 23:34:58 2009 (r188541) @@ -87,7 +87,6 @@ static void ieee80211_node_table_init(st int inact, int keymaxix); static void ieee80211_node_table_reset(struct ieee80211_node_table *, struct ieee80211vap *); -static void ieee80211_node_reclaim(struct ieee80211_node *); static void ieee80211_node_table_cleanup(struct ieee80211_node_table *nt); static void ieee80211_erp_timeout(struct ieee80211com *); @@ -674,7 +673,8 @@ ieee80211_sta_join1(struct ieee80211_nod vap->iv_bss = selbs; /* NB: caller assumed to bump refcnt */ if (obss != NULL) { copy_bss(selbs, obss); - ieee80211_node_reclaim(obss); + ieee80211_node_decref(obss); /* iv_bss reference */ + ieee80211_free_node(obss); /* station table reference */ obss = NULL; /* NB: guard against later use */ } @@ -1739,64 +1739,6 @@ node_reclaim(struct ieee80211_node_table } /* - * Reclaim a (bss) node. Decrement the refcnt and reclaim - * the node if the only other reference to it is in the sta - * table. This is effectively ieee80211_free_node followed - * by node_reclaim when the refcnt is 1 (after the free). - */ -static void -ieee80211_node_reclaim(struct ieee80211_node *ni) -{ - struct ieee80211_node_table *nt = ni->ni_table; - - KASSERT(nt != NULL, ("reclaim node not in table")); - -#ifdef IEEE80211_DEBUG_REFCNT - IEEE80211_DPRINTF(ni->ni_vap, IEEE80211_MSG_NODE, - "%s %p<%s> refcnt %d\n", __func__, ni, - ether_sprintf(ni->ni_macaddr), ieee80211_node_refcnt(ni)-1); -#endif - IEEE80211_NODE_LOCK(nt); - if (ieee80211_node_dectestref(ni)) { - /* - * Last reference, reclaim state. - */ - _ieee80211_free_node(ni); - nt = NULL; - } else if (ieee80211_node_refcnt(ni) == 1 && nt->nt_keyixmap != NULL) { - ieee80211_keyix keyix; - /* - * Check for a last reference in the key mapping table. - */ - keyix = ni->ni_ucastkey.wk_rxkeyix; - if (keyix < nt->nt_keyixmax && - nt->nt_keyixmap[keyix] == ni) { - IEEE80211_DPRINTF(ni->ni_vap, - IEEE80211_MSG_NODE, - "%s: %p<%s> clear key map entry %u", __func__, - ni, ether_sprintf(ni->ni_macaddr), keyix); - nt->nt_keyixmap[keyix] = NULL; - ieee80211_node_decref(ni); /* XXX needed? */ - _ieee80211_free_node(ni); - nt = NULL; - } - } - if (nt != NULL && ieee80211_node_refcnt(ni) == 1) { - /* - * Last reference is in the sta table; complete - * the reclaim. This handles bss nodes being - * recycled: the node has two references, one for - * iv_bss and one for the table. After dropping - * the iv_bss ref above we need to reclaim the sta - * table reference. - */ - ieee80211_node_decref(ni); /* NB: be pendantic */ - _ieee80211_free_node(ni); - } - IEEE80211_NODE_UNLOCK(nt); -} - -/* * Node table support. */ From owner-svn-src-head@FreeBSD.ORG Thu Feb 12 23:55:35 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 941A6106566B; Thu, 12 Feb 2009 23:55:35 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 82A918FC13; Thu, 12 Feb 2009 23:55:35 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1CNtZtH070507; Thu, 12 Feb 2009 23:55:35 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1CNtZXa070506; Thu, 12 Feb 2009 23:55:35 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200902122355.n1CNtZXa070506@svn.freebsd.org> From: Robert Watson Date: Thu, 12 Feb 2009 23:55:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188545 - head/sys/dev/cm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Feb 2009 23:55:36 -0000 Author: rwatson Date: Thu Feb 12 23:55:35 2009 New Revision: 188545 URL: http://svn.freebsd.org/changeset/base/188545 Log: Remove unused ifaddr and ifreq local variables. MFC after: 3 days Modified: head/sys/dev/cm/smc90cx6.c Modified: head/sys/dev/cm/smc90cx6.c ============================================================================== --- head/sys/dev/cm/smc90cx6.c Thu Feb 12 23:54:07 2009 (r188544) +++ head/sys/dev/cm/smc90cx6.c Thu Feb 12 23:55:35 2009 (r188545) @@ -861,14 +861,10 @@ cm_ioctl(ifp, command, data) caddr_t data; { struct cm_softc *sc; - struct ifaddr *ifa; - struct ifreq *ifr; int error; error = 0; sc = ifp->if_softc; - ifa = (struct ifaddr *)data; - ifr = (struct ifreq *)data; #if defined(CM_DEBUG) && (CM_DEBUG > 2) if_printf(ifp, "ioctl() called, cmd = 0x%lx\n", command); From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 00:01:11 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F2C31065673; Fri, 13 Feb 2009 00:01:11 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6D88A8FC12; Fri, 13 Feb 2009 00:01:11 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1D01BOa070675; Fri, 13 Feb 2009 00:01:11 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1D01BYb070674; Fri, 13 Feb 2009 00:01:11 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200902130001.n1D01BYb070674@svn.freebsd.org> From: Robert Watson Date: Fri, 13 Feb 2009 00:01:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188546 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Feb 2009 00:01:12 -0000 Author: rwatson Date: Fri Feb 13 00:01:11 2009 New Revision: 188546 URL: http://svn.freebsd.org/changeset/base/188546 Log: Remove unused ifaddr local variable in ioctl routine. MFC after: 3 days Modified: head/sys/net/if_vlan.c Modified: head/sys/net/if_vlan.c ============================================================================== --- head/sys/net/if_vlan.c Thu Feb 12 23:55:35 2009 (r188545) +++ head/sys/net/if_vlan.c Fri Feb 13 00:01:11 2009 (r188546) @@ -1301,7 +1301,6 @@ vlan_trunk_capabilities(struct ifnet *if static int vlan_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) { - struct ifaddr *ifa; struct ifnet *p; struct ifreq *ifr; struct ifvlan *ifv; @@ -1309,7 +1308,6 @@ vlan_ioctl(struct ifnet *ifp, u_long cmd int error = 0; ifr = (struct ifreq *)data; - ifa = (struct ifaddr *)data; ifv = ifp->if_softc; switch (cmd) { From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 01:16:51 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CBE11106567F; Fri, 13 Feb 2009 01:16:51 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BA7A68FC15; Fri, 13 Feb 2009 01:16:51 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1D1Gpq8072147; Fri, 13 Feb 2009 01:16:51 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1D1Gpwq072146; Fri, 13 Feb 2009 01:16:51 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200902130116.n1D1Gpwq072146@svn.freebsd.org> From: Andrew Thompson Date: Fri, 13 Feb 2009 01:16:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188548 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Feb 2009 01:16:52 -0000 Author: thompsa Date: Fri Feb 13 01:16:51 2009 New Revision: 188548 URL: http://svn.freebsd.org/changeset/base/188548 Log: Check the exit flag at the start of the taskqueue loop rather than the end. It is possible to tear down the taskqueue before the thread has run and the taskqueue loop would sleep forever. Reviewed by: sam MFC after: 1 week Modified: head/sys/kern/subr_taskqueue.c Modified: head/sys/kern/subr_taskqueue.c ============================================================================== --- head/sys/kern/subr_taskqueue.c Fri Feb 13 01:14:00 2009 (r188547) +++ head/sys/kern/subr_taskqueue.c Fri Feb 13 01:16:51 2009 (r188548) @@ -399,10 +399,10 @@ taskqueue_thread_loop(void *arg) tqp = arg; tq = *tqp; TQ_LOCK(tq); - do { + while ((tq->tq_flags & TQ_FLAGS_ACTIVE) != 0) { taskqueue_run(tq); TQ_SLEEP(tq, tq, &tq->tq_mutex, 0, "-", 0); - } while ((tq->tq_flags & TQ_FLAGS_ACTIVE) != 0); + }; /* rendezvous with thread that asked us to terminate */ tq->tq_tcount--; From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 01:50:05 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 46ADE106564A; Fri, 13 Feb 2009 01:50:05 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 355A18FC1D; Fri, 13 Feb 2009 01:50:05 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1D1o5cL072786; Fri, 13 Feb 2009 01:50:05 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1D1o57g072785; Fri, 13 Feb 2009 01:50:05 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902130150.n1D1o57g072785@svn.freebsd.org> From: Sam Leffler Date: Fri, 13 Feb 2009 01:50:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188549 - head/sys/dev/ath/ath_hal/ar5312 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Feb 2009 01:50:05 -0000 Author: sam Date: Fri Feb 13 01:50:04 2009 New Revision: 188549 URL: http://svn.freebsd.org/changeset/base/188549 Log: Recognize AR5212_AR2317_REV2 in ar5312Probe() Submitted by: Pavel Roskin Modified: head/sys/dev/ath/ath_hal/ar5312/ar5312_attach.c Modified: head/sys/dev/ath/ath_hal/ar5312/ar5312_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5312/ar5312_attach.c Fri Feb 13 01:16:51 2009 (r188548) +++ head/sys/dev/ath/ath_hal/ar5312/ar5312_attach.c Fri Feb 13 01:50:04 2009 (r188549) @@ -321,6 +321,7 @@ ar5312Probe(uint16_t vendorid, uint16_t case AR5212_AR2315_REV7: return "Atheros 2315 WiSoC"; case AR5212_AR2317_REV1: + case AR5212_AR2317_REV2: return "Atheros 2317 WiSoC"; case AR5212_AR2413: return "Atheros 2413"; From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 02:08:20 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D519106566B; Fri, 13 Feb 2009 02:08:20 +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 6BAF68FC1A; Fri, 13 Feb 2009 02:08:20 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1D28K80073146; Fri, 13 Feb 2009 02:08:20 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1D28K2b073145; Fri, 13 Feb 2009 02:08:20 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200902130208.n1D28K2b073145@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 13 Feb 2009 02:08:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188550 - head/sys/dev/sis X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Feb 2009 02:08:20 -0000 Author: yongari Date: Fri Feb 13 02:08:20 2009 New Revision: 188550 URL: http://svn.freebsd.org/changeset/base/188550 Log: Receving VLAN oversized frames raise SIS_ISR_RX_ERR interrupt, so make sis_rxeof() handle that too. Previously it used to receive the frame and reset controller. PR: kern/131414 Modified: head/sys/dev/sis/if_sis.c Modified: head/sys/dev/sis/if_sis.c ============================================================================== --- head/sys/dev/sis/if_sis.c Fri Feb 13 01:50:04 2009 (r188549) +++ head/sys/dev/sis/if_sis.c Fri Feb 13 02:08:20 2009 (r188550) @@ -1663,10 +1663,11 @@ sis_intr(void *arg) SIS_ISR_TX_OK | SIS_ISR_TX_IDLE) ) sis_txeof(sc); - if (status & (SIS_ISR_RX_DESC_OK|SIS_ISR_RX_OK|SIS_ISR_RX_IDLE)) + if (status & (SIS_ISR_RX_DESC_OK | SIS_ISR_RX_OK | + SIS_ISR_RX_ERR | SIS_ISR_RX_IDLE)) sis_rxeof(sc); - if (status & (SIS_ISR_RX_ERR | SIS_ISR_RX_OFLOW)) + if (status & SIS_ISR_RX_OFLOW) sis_rxeoc(sc); if (status & (SIS_ISR_RX_IDLE)) From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 02:48:32 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DB89E106566B; Fri, 13 Feb 2009 02:48:32 +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 C9CA68FC0A; Fri, 13 Feb 2009 02:48:32 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1D2mWih074028; Fri, 13 Feb 2009 02:48:32 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1D2mWes074027; Fri, 13 Feb 2009 02:48:32 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200902130248.n1D2mWes074027@svn.freebsd.org> From: Andrew Thompson Date: Fri, 13 Feb 2009 02:48:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188552 - head/sys/dev/usb2/ethernet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Feb 2009 02:48:33 -0000 Author: thompsa Date: Fri Feb 13 02:48:32 2009 New Revision: 188552 URL: http://svn.freebsd.org/changeset/base/188552 Log: Add module dependency on miibus. Submitted by: yongari Modified: head/sys/dev/usb2/ethernet/usb2_ethernet.c Modified: head/sys/dev/usb2/ethernet/usb2_ethernet.c ============================================================================== --- head/sys/dev/usb2/ethernet/usb2_ethernet.c Fri Feb 13 02:41:15 2009 (r188551) +++ head/sys/dev/usb2/ethernet/usb2_ethernet.c Fri Feb 13 02:48:32 2009 (r188552) @@ -43,6 +43,9 @@ SYSCTL_NODE(_net, OID_AUTO, ue, CTLFLAG_ #define UE_UNLOCK(_ue) mtx_unlock((_ue)->ue_mtx) #define UE_LOCK_ASSERT(_ue, t) mtx_assert((_ue)->ue_mtx, t) +MODULE_DEPEND(usb2_ethernet, usb2_core, 1, 1, 1); +MODULE_DEPEND(usb2_ethernet, miibus, 1, 1, 1); + static struct unrhdr *ueunit; static usb2_proc_callback_t ue_attach_post_task; @@ -582,4 +585,3 @@ usb2_ether_rxflush(struct usb2_ether *ue DECLARE_MODULE(usb2_ethernet, usb2_ether_mod, SI_SUB_PSEUDO, SI_ORDER_ANY); MODULE_VERSION(usb2_ethernet, 1); -MODULE_DEPEND(usb2_ethernet, usb2_core, 1, 1, 1); From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 03:38:09 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F223E1065670; Fri, 13 Feb 2009 03:38:08 +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 D4F408FC23; Fri, 13 Feb 2009 03:38:08 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1D3c8Wx075162; Fri, 13 Feb 2009 03:38:08 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1D3c8Wn075161; Fri, 13 Feb 2009 03:38:08 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200902130338.n1D3c8Wn075161@svn.freebsd.org> From: Andrew Thompson Date: Fri, 13 Feb 2009 03:38:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188553 - head/sys/dev/usb2/ethernet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Feb 2009 03:38:09 -0000 Author: thompsa Date: Fri Feb 13 03:38:08 2009 New Revision: 188553 URL: http://svn.freebsd.org/changeset/base/188553 Log: Restore some of the link handling code that was inadvertently removed in r188412, this broke the GU-1000T adapters. Submitted by: yongari Pointy hat: me Modified: head/sys/dev/usb2/ethernet/if_axe2.c Modified: head/sys/dev/usb2/ethernet/if_axe2.c ============================================================================== --- head/sys/dev/usb2/ethernet/if_axe2.c Fri Feb 13 02:48:32 2009 (r188552) +++ head/sys/dev/usb2/ethernet/if_axe2.c Fri Feb 13 03:38:08 2009 (r188553) @@ -341,6 +341,7 @@ axe_miibus_statchg(device_t dev) { struct axe_softc *sc = device_get_softc(dev); struct mii_data *mii = GET_MII(sc); + struct ifnet *ifp; uint16_t val; int err, locked; @@ -348,11 +349,40 @@ axe_miibus_statchg(device_t dev) if (!locked) AXE_LOCK(sc); - val = (mii->mii_media_active & IFM_GMASK) == IFM_FDX ? - AXE_MEDIA_FULL_DUPLEX : 0; + ifp = usb2_ether_getifp(&sc->sc_ue); + if (mii == NULL || ifp == NULL || + (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + goto done; + + sc->sc_flags &= ~AXE_FLAG_LINK; + if ((mii->mii_media_status & (IFM_ACTIVE | IFM_AVALID)) == + (IFM_ACTIVE | IFM_AVALID)) { + switch (IFM_SUBTYPE(mii->mii_media_active)) { + case IFM_10_T: + case IFM_100_TX: + sc->sc_flags |= AXE_FLAG_LINK; + break; + case IFM_1000_T: + if ((sc->sc_flags & AXE_FLAG_178) == 0) + break; + sc->sc_flags |= AXE_FLAG_LINK; + break; + default: + break; + } + } + + /* Lost link, do nothing. */ + if ((sc->sc_flags & AXE_FLAG_LINK) == 0) + goto done; + + val = 0; + if ((IFM_OPTIONS(mii->mii_media_active) & IFM_FDX) != 0) + val |= AXE_MEDIA_FULL_DUPLEX; if (sc->sc_flags & (AXE_FLAG_178 | AXE_FLAG_772)) { val |= AXE_178_MEDIA_RX_EN | AXE_178_MEDIA_MAGIC; - + if ((sc->sc_flags & AXE_FLAG_178) != 0) + val |= AXE_178_MEDIA_ENCK; switch (IFM_SUBTYPE(mii->mii_media_active)) { case IFM_1000_T: val |= AXE_178_MEDIA_GMII | AXE_178_MEDIA_ENCK; @@ -368,7 +398,7 @@ axe_miibus_statchg(device_t dev) err = axe_cmd(sc, AXE_CMD_WRITE_MEDIA, 0, val, NULL); if (err) device_printf(dev, "media change failed, error %d\n", err); - +done: if (!locked) AXE_UNLOCK(sc); } @@ -381,18 +411,18 @@ axe_ifmedia_upd(struct ifnet *ifp) { struct axe_softc *sc = ifp->if_softc; struct mii_data *mii = GET_MII(sc); + int error; AXE_LOCK_ASSERT(sc, MA_OWNED); - sc->sc_flags &= ~AXE_FLAG_LINK; if (mii->mii_instance) { struct mii_softc *miisc; LIST_FOREACH(miisc, &mii->mii_phys, mii_list) mii_phy_reset(miisc); } - mii_mediachg(mii); - return (0); + error = mii_mediachg(mii); + return (error); } /* @@ -915,11 +945,10 @@ axe_tick(struct usb2_ether *ue) AXE_LOCK_ASSERT(sc, MA_OWNED); mii_tick(mii); - if ((sc->sc_flags & AXE_FLAG_LINK) == 0 - && mii->mii_media_status & IFM_ACTIVE && - IFM_SUBTYPE(mii->mii_media_active) != IFM_NONE) { - sc->sc_flags |= AXE_FLAG_LINK; - axe_start(ue); + if ((sc->sc_flags & AXE_FLAG_LINK) == 0) { + axe_miibus_statchg(ue->ue_dev); + if ((sc->sc_flags & AXE_FLAG_LINK) != 0) + axe_start(ue); } } From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 05:26:05 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 968FA106564A; Fri, 13 Feb 2009 05:26:04 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 849578FC18; Fri, 13 Feb 2009 05:26:04 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1D5Q4jV077138; Fri, 13 Feb 2009 05:26:04 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1D5Q4Aq077137; Fri, 13 Feb 2009 05:26:04 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902130526.n1D5Q4Aq077137@svn.freebsd.org> From: Sam Leffler Date: Fri, 13 Feb 2009 05:26:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188554 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Feb 2009 05:26:06 -0000 Author: sam Date: Fri Feb 13 05:26:04 2009 New Revision: 188554 URL: http://svn.freebsd.org/changeset/base/188554 Log: strip M_FRAG & co mbufs coming down from ip_output, these flags are re-used within net80211 to mark 802.11 frags so allowing them to leak through to the driver caused packets to be dropped in ath Modified: head/sys/net80211/ieee80211_freebsd.h Modified: head/sys/net80211/ieee80211_freebsd.h ============================================================================== --- head/sys/net80211/ieee80211_freebsd.h Fri Feb 13 03:38:08 2009 (r188553) +++ head/sys/net80211/ieee80211_freebsd.h Fri Feb 13 05:26:04 2009 (r188554) @@ -221,7 +221,8 @@ struct mbuf *ieee80211_getmgtframe(uint8 #define M_TXCB M_PROTO7 /* do tx complete callback */ #define M_AMPDU_MPDU M_PROTO8 /* ok for A-MPDU aggregation */ #define M_80211_TX \ - (M_ENCAP|M_WDS|M_EAPOL|M_PWR_SAV|M_MORE_DATA|M_FF|M_TXCB|M_AMPDU_MPDU) + (M_FRAG|M_FIRSTFRAG|M_LASTFRAG|M_ENCAP|M_WDS|M_EAPOL|M_PWR_SAV|\ + M_MORE_DATA|M_FF|M_TXCB|M_AMPDU_MPDU) /* rx path usage */ #define M_AMPDU M_PROTO1 /* A-MPDU subframe */ From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 05:30:23 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2AA2C106564A; Fri, 13 Feb 2009 05:30:23 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1944E8FC14; Fri, 13 Feb 2009 05:30:23 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1D5UMMd077249; Fri, 13 Feb 2009 05:30:22 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1D5UM6U077246; Fri, 13 Feb 2009 05:30:22 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902130530.n1D5UM6U077246@svn.freebsd.org> From: Sam Leffler Date: Fri, 13 Feb 2009 05:30:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188555 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Feb 2009 05:30:23 -0000 Author: sam Date: Fri Feb 13 05:30:22 2009 New Revision: 188555 URL: http://svn.freebsd.org/changeset/base/188555 Log: add driver stat to count tx drops due to insufficient frag buffers Modified: head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_athioctl.h Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Fri Feb 13 05:26:04 2009 (r188554) +++ head/sys/dev/ath/if_ath.c Fri Feb 13 05:30:22 2009 (r188555) @@ -2071,7 +2071,6 @@ static void ath_start(struct ifnet *ifp) { struct ath_softc *sc = ifp->if_softc; - struct ieee80211com *ic = ifp->if_l2com; struct ieee80211_node *ni; struct ath_buf *bf; struct mbuf *m, *next; @@ -2141,7 +2140,7 @@ ath_start(struct ifnet *ifp) !ath_txfrag_setup(sc, &frags, m, ni)) { DPRINTF(sc, ATH_DEBUG_XMIT, "%s: out of txfrag buffers\n", __func__); - ic->ic_stats.is_tx_nobuf++; /* XXX */ + sc->sc_stats.ast_tx_nofrag++; ath_freetx(m); goto bad; } Modified: head/sys/dev/ath/if_athioctl.h ============================================================================== --- head/sys/dev/ath/if_athioctl.h Fri Feb 13 05:26:04 2009 (r188554) +++ head/sys/dev/ath/if_athioctl.h Fri Feb 13 05:30:22 2009 (r188555) @@ -117,7 +117,8 @@ struct ath_stats { u_int16_t ast_tdma_tsfadjm;/* TDMA slot adjust- (usec, smoothed)*/ u_int32_t ast_tdma_ack; /* TDMA tx failed 'cuz ACK required */ u_int32_t ast_tx_raw_fail;/* raw tx failed 'cuz h/w down */ - u_int32_t ast_pad[15]; + u_int32_t ast_tx_nofrag; /* tx dropped 'cuz no ath frag buffer */ + u_int32_t ast_pad[14]; }; #define SIOCGATHSTATS _IOWR('i', 137, struct ifreq) From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 05:31:19 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 68DCC1065670; Fri, 13 Feb 2009 05:31:19 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3D2438FC18; Fri, 13 Feb 2009 05:31:19 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1D5VJNa077309; Fri, 13 Feb 2009 05:31:19 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1D5VJa8077306; Fri, 13 Feb 2009 05:31:19 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902130531.n1D5VJa8077306@svn.freebsd.org> From: Sam Leffler Date: Fri, 13 Feb 2009 05:31:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188556 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Feb 2009 05:31:19 -0000 Author: sam Date: Fri Feb 13 05:31:18 2009 New Revision: 188556 URL: http://svn.freebsd.org/changeset/base/188556 Log: remove ic_stats; it was intended to accumulate stats from vaps as they were reaped but was never used and is inaccessible Modified: head/sys/net80211/ieee80211.c head/sys/net80211/ieee80211_ddb.c head/sys/net80211/ieee80211_var.h Modified: head/sys/net80211/ieee80211.c ============================================================================== --- head/sys/net80211/ieee80211.c Fri Feb 13 05:30:22 2009 (r188555) +++ head/sys/net80211/ieee80211.c Fri Feb 13 05:31:18 2009 (r188556) @@ -533,7 +533,6 @@ ieee80211_vap_detach(struct ieee80211vap */ ieee80211_stop_locked(vap); - /* XXX accumulate iv_stats in ic_stats? */ TAILQ_REMOVE(&ic->ic_vaps, vap, iv_next); ieee80211_syncflag_locked(ic, IEEE80211_F_WME); ieee80211_syncflag_locked(ic, IEEE80211_F_TURBOP); Modified: head/sys/net80211/ieee80211_ddb.c ============================================================================== --- head/sys/net80211/ieee80211_ddb.c Fri Feb 13 05:30:22 2009 (r188555) +++ head/sys/net80211/ieee80211_ddb.c Fri Feb 13 05:31:18 2009 (r188556) @@ -438,7 +438,6 @@ _db_show_com(const struct ieee80211com * db_printf("\tifp %p", ic->ic_ifp); db_printf(" comlock %p", &ic->ic_comlock); db_printf("\n"); - _db_show_stats(&ic->ic_stats); db_printf("\theadroom %d", ic->ic_headroom); db_printf(" phytype %d", ic->ic_phytype); db_printf(" opmode %s", ieee80211_opmode_name[ic->ic_opmode]); Modified: head/sys/net80211/ieee80211_var.h ============================================================================== --- head/sys/net80211/ieee80211_var.h Fri Feb 13 05:30:22 2009 (r188555) +++ head/sys/net80211/ieee80211_var.h Fri Feb 13 05:31:18 2009 (r188556) @@ -111,7 +111,6 @@ struct ieee80211com { struct ifnet *ic_ifp; /* associated device */ ieee80211_com_lock_t ic_comlock; /* state update lock */ TAILQ_HEAD(, ieee80211vap) ic_vaps; /* list of vap instances */ - struct ieee80211_stats ic_stats; /* statistics */ int ic_headroom; /* driver tx headroom needs */ enum ieee80211_phytype ic_phytype; /* XXX wrong for multi-mode */ enum ieee80211_opmode ic_opmode; /* operation mode */ From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 05:38:03 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B4FDA1065703; Fri, 13 Feb 2009 05:38:03 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A3C2F8FC24; Fri, 13 Feb 2009 05:38:03 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1D5c3Zf077468; Fri, 13 Feb 2009 05:38:03 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1D5c30d077465; Fri, 13 Feb 2009 05:38:03 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902130538.n1D5c30d077465@svn.freebsd.org> From: Sam Leffler Date: Fri, 13 Feb 2009 05:38:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188557 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Feb 2009 05:38:04 -0000 Author: sam Date: Fri Feb 13 05:38:03 2009 New Revision: 188557 URL: http://svn.freebsd.org/changeset/base/188557 Log: add SIOCZATHSTATS ioctl to zero driver statistics Modified: head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_athioctl.h Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Fri Feb 13 05:31:18 2009 (r188556) +++ head/sys/dev/ath/if_ath.c Fri Feb 13 05:38:03 2009 (r188557) @@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -6583,6 +6584,11 @@ ath_ioctl(struct ifnet *ifp, u_long cmd, rt->info[sc->sc_txrix].dot11Rate &~ IEEE80211_RATE_BASIC; return copyout(&sc->sc_stats, ifr->ifr_data, sizeof (sc->sc_stats)); + case SIOCZATHSTATS: + error = priv_check(curthread, PRIV_DRIVER); + if (error == 0) + memset(&sc->sc_stats, 0, sizeof(sc->sc_stats)); + break; #ifdef ATH_DIAGAPI case SIOCGATHDIAG: error = ath_ioctl_diag(sc, (struct ath_diag *) ifr); Modified: head/sys/dev/ath/if_athioctl.h ============================================================================== --- head/sys/dev/ath/if_athioctl.h Fri Feb 13 05:31:18 2009 (r188556) +++ head/sys/dev/ath/if_athioctl.h Fri Feb 13 05:38:03 2009 (r188557) @@ -122,6 +122,7 @@ struct ath_stats { }; #define SIOCGATHSTATS _IOWR('i', 137, struct ifreq) +#define SIOCZATHSTATS _IOWR('i', 139, struct ifreq) struct ath_diag { char ad_name[IFNAMSIZ]; /* if name, e.g. "ath0" */ From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 05:42:25 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E4DDF106566B; Fri, 13 Feb 2009 05:42:25 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D21BF8FC0A; Fri, 13 Feb 2009 05:42:25 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1D5gPU1077607; Fri, 13 Feb 2009 05:42:25 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1D5gPai077604; Fri, 13 Feb 2009 05:42:25 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902130542.n1D5gPai077604@svn.freebsd.org> From: Sam Leffler Date: Fri, 13 Feb 2009 05:42:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188558 - head/tools/tools/ath/athstats X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Feb 2009 05:42:26 -0000 Author: sam Date: Fri Feb 13 05:42:25 2009 New Revision: 188558 URL: http://svn.freebsd.org/changeset/base/188558 Log: backout r188327, it broke summary printing Modified: head/tools/tools/ath/athstats/Makefile head/tools/tools/ath/athstats/athstats.c head/tools/tools/ath/athstats/statfoo.c Modified: head/tools/tools/ath/athstats/Makefile ============================================================================== --- head/tools/tools/ath/athstats/Makefile Fri Feb 13 05:38:03 2009 (r188557) +++ head/tools/tools/ath/athstats/Makefile Fri Feb 13 05:42:25 2009 (r188558) @@ -4,9 +4,6 @@ PROG= athstats SRCS= main.c statfoo.c athstats.c -DPADD= ${LIBUTIL} -LDADD= -lutil - .include SRCDIR= ${.CURDIR}/../../../.. Modified: head/tools/tools/ath/athstats/athstats.c ============================================================================== --- head/tools/tools/ath/athstats/athstats.c Fri Feb 13 05:38:03 2009 (r188557) +++ head/tools/tools/ath/athstats/athstats.c Fri Feb 13 05:42:25 2009 (r188558) @@ -46,7 +46,6 @@ #include #include #include -#include #include "ah.h" #include "ah_desc.h" @@ -68,15 +67,15 @@ static const struct fmt athstats[] = { #define S_INPUT 0 - { 7, "input", "input", "data frames received" }, + { 8, "input", "input", "data frames received" }, #define S_OUTPUT AFTER(S_INPUT) - { 7, "output", "output", "data frames transmit" }, + { 8, "output", "output", "data frames transmit" }, #define S_TX_ALTRATE AFTER(S_OUTPUT) { 7, "altrate", "altrate", "tx frames with an alternate rate" }, #define S_TX_SHORTRETRY AFTER(S_TX_ALTRATE) - { 6, "short", "short", "short on-chip tx retries" }, + { 7, "short", "short", "short on-chip tx retries" }, #define S_TX_LONGRETRY AFTER(S_TX_SHORTRETRY) - { 6, "long", "long", "long on-chip tx retries" }, + { 7, "long", "long", "long on-chip tx retries" }, #define S_TX_XRETRIES AFTER(S_TX_LONGRETRY) { 6, "xretry", "xretry", "tx failed 'cuz too many retries" }, #define S_MIB AFTER(S_TX_XRETRIES) @@ -202,7 +201,7 @@ static const struct fmt athstats[] = { #define S_BE_NOMBUF AFTER(S_RX_PHY_CCK_RESTART) { 4, "benombuf", "benombuf", "beacon setup failed 'cuz no mbuf" }, #define S_BE_XMIT AFTER(S_BE_NOMBUF) - { 6, "bexmit", "bexmit", "beacons transmitted" }, + { 7, "bexmit", "bexmit", "beacons transmitted" }, #define S_PER_CAL AFTER(S_BE_XMIT) { 4, "pcal", "pcal", "periodic calibrations" }, #define S_PER_CALFAIL AFTER(S_PER_CAL) @@ -211,13 +210,13 @@ static const struct fmt athstats[] = { { 4, "prfga", "prfga", "rfgain value change" }, #if ATH_SUPPORT_TDMA #define S_TDMA_UPDATE AFTER(S_PER_RFGAIN) - { 6, "tdmau", "tdmau", "TDMA slot timing updates" }, + { 5, "tdmau", "tdmau", "TDMA slot timing updates" }, #define S_TDMA_TIMERS AFTER(S_TDMA_UPDATE) - { 6, "tdmab", "tdmab", "TDMA slot update set beacon timers" }, + { 5, "tdmab", "tdmab", "TDMA slot update set beacon timers" }, #define S_TDMA_TSF AFTER(S_TDMA_TIMERS) - { 6, "tdmat", "tdmat", "TDMA slot update set TSF" }, + { 5, "tdmat", "tdmat", "TDMA slot update set TSF" }, #define S_TDMA_TSFADJ AFTER(S_TDMA_TSF) - { 6, "tdmadj", "tdmadj", "TDMA slot adjust (usecs, smoothed)" }, + { 8, "tdmadj", "tdmadj", "TDMA slot adjust (usecs, smoothed)" }, #define S_TDMA_ACK AFTER(S_TDMA_TSFADJ) { 5, "tdmack", "tdmack", "TDMA tx failed 'cuz ACK required" }, #define S_RATE_CALLS AFTER(S_TDMA_ACK) @@ -307,9 +306,9 @@ static const struct fmt athstats[] = { #define S_ANI_STEPDOWN AFTER(S_ANI_STEPUP) { 5, "step-","STEP-", "ANI decreased first step level" }, #define S_ANI_OFDMERRS AFTER(S_ANI_STEPDOWN) - { 7, "ofdm", "OFDM", "cumulative OFDM phy error count" }, + { 8, "ofdm", "OFDM", "cumulative OFDM phy error count" }, #define S_ANI_CCKERRS AFTER(S_ANI_OFDMERRS) - { 7, "cck", "CCK", "cumulative CCK phy error count" }, + { 8, "cck", "CCK", "cumulative CCK phy error count" }, #define S_ANI_RESET AFTER(S_ANI_CCKERRS) { 5, "reset","RESET", "ANI parameters zero'd for non-STA operation" }, #define S_ANI_LZERO AFTER(S_ANI_RESET) @@ -317,15 +316,15 @@ static const struct fmt athstats[] = { #define S_ANI_LNEG AFTER(S_ANI_LZERO) { 5, "lneg", "LNEG", "ANI calculated listen time < 0" }, #define S_MIB_ACKBAD AFTER(S_ANI_LNEG) - { 7, "ackbad","ACKBAD", "missing ACK's" }, + { 5, "ackbad","ACKBAD", "missing ACK's" }, #define S_MIB_RTSBAD AFTER(S_MIB_ACKBAD) - { 7, "rtsbad","RTSBAD", "RTS without CTS" }, + { 5, "rtsbad","RTSBAD", "RTS without CTS" }, #define S_MIB_RTSGOOD AFTER(S_MIB_RTSBAD) - { 7, "rtsgood","RTSGOOD", "successful RTS" }, + { 5, "rtsgood","RTSGOOD", "successful RTS" }, #define S_MIB_FCSBAD AFTER(S_MIB_RTSGOOD) - { 7, "fcsbad","FCSBAD", "bad FCS" }, + { 5, "fcsbad","FCSBAD", "bad FCS" }, #define S_MIB_BEACONS AFTER(S_MIB_FCSBAD) - { 7, "beacons","beacons", "beacons received" }, + { 5, "beacons","beacons", "beacons received" }, #define S_NODE_AVGBRSSI AFTER(S_MIB_BEACONS) { 3, "avgbrssi","BSI", "average rssi (beacons only)" }, #define S_NODE_AVGRSSI AFTER(S_NODE_AVGBRSSI) @@ -336,37 +335,37 @@ static const struct fmt athstats[] = { #else #define S_ANT_TX0 AFTER(S_ANT_TXSWITCH) #endif /* ATH_SUPPORT_ANI */ - { 7, "tx0", "ant0(tx)", "frames tx on antenna 0" }, + { 8, "tx0", "ant0(tx)", "frames tx on antenna 0" }, #define S_ANT_TX1 AFTER(S_ANT_TX0) - { 7, "tx1", "ant1(tx)", "frames tx on antenna 1" }, + { 8, "tx1", "ant1(tx)", "frames tx on antenna 1" }, #define S_ANT_TX2 AFTER(S_ANT_TX1) - { 7, "tx2", "ant2(tx)", "frames tx on antenna 2" }, + { 8, "tx2", "ant2(tx)", "frames tx on antenna 2" }, #define S_ANT_TX3 AFTER(S_ANT_TX2) - { 7, "tx3", "ant3(tx)", "frames tx on antenna 3" }, + { 8, "tx3", "ant3(tx)", "frames tx on antenna 3" }, #define S_ANT_TX4 AFTER(S_ANT_TX3) - { 7, "tx4", "ant4(tx)", "frames tx on antenna 4" }, + { 8, "tx4", "ant4(tx)", "frames tx on antenna 4" }, #define S_ANT_TX5 AFTER(S_ANT_TX4) - { 7, "tx5", "ant5(tx)", "frames tx on antenna 5" }, + { 8, "tx5", "ant5(tx)", "frames tx on antenna 5" }, #define S_ANT_TX6 AFTER(S_ANT_TX5) - { 7, "tx6", "ant6(tx)", "frames tx on antenna 6" }, + { 8, "tx6", "ant6(tx)", "frames tx on antenna 6" }, #define S_ANT_TX7 AFTER(S_ANT_TX6) - { 7, "tx7", "ant7(tx)", "frames tx on antenna 7" }, + { 8, "tx7", "ant7(tx)", "frames tx on antenna 7" }, #define S_ANT_RX0 AFTER(S_ANT_TX7) - { 7, "rx0", "ant0(rx)", "frames rx on antenna 0" }, + { 8, "rx0", "ant0(rx)", "frames rx on antenna 0" }, #define S_ANT_RX1 AFTER(S_ANT_RX0) - { 7, "rx1", "ant1(rx)", "frames rx on antenna 1" }, + { 8, "rx1", "ant1(rx)", "frames rx on antenna 1" }, #define S_ANT_RX2 AFTER(S_ANT_RX1) - { 7, "rx2", "ant2(rx)", "frames rx on antenna 2" }, + { 8, "rx2", "ant2(rx)", "frames rx on antenna 2" }, #define S_ANT_RX3 AFTER(S_ANT_RX2) - { 7, "rx3", "ant3(rx)", "frames rx on antenna 3" }, + { 8, "rx3", "ant3(rx)", "frames rx on antenna 3" }, #define S_ANT_RX4 AFTER(S_ANT_RX3) - { 7, "rx4", "ant4(rx)", "frames rx on antenna 4" }, + { 8, "rx4", "ant4(rx)", "frames rx on antenna 4" }, #define S_ANT_RX5 AFTER(S_ANT_RX4) - { 7, "rx5", "ant5(rx)", "frames rx on antenna 5" }, + { 8, "rx5", "ant5(rx)", "frames rx on antenna 5" }, #define S_ANT_RX6 AFTER(S_ANT_RX5) - { 7, "rx6", "ant6(rx)", "frames rx on antenna 6" }, + { 8, "rx6", "ant6(rx)", "frames rx on antenna 6" }, #define S_ANT_RX7 AFTER(S_ANT_RX6) - { 7, "rx7", "ant7(rx)", "frames rx on antenna 7" }, + { 8, "rx7", "ant7(rx)", "frames rx on antenna 7" }, #define S_TX_SIGNAL AFTER(S_ANT_RX7) { 4, "asignal", "asig", "signal of last ack (dBm)" }, #define S_RX_SIGNAL AFTER(S_TX_SIGNAL) @@ -711,38 +710,32 @@ ath_get_curstat(struct statfoo *sf, int #undef STAT } -int -hnprintf(char *b, size_t bs, const char *fmt, int64_t v) -{ - humanize_number(b, bs, v, "", HN_AUTOSCALE, HN_NOSPACE); -} - static int ath_get_totstat(struct statfoo *sf, int s, char b[], size_t bs) { struct athstatfoo_p *wf = (struct athstatfoo_p *) sf; #define STAT(x) \ - hnprintf(b, bs, "%u", (int64_t) wf->total.ath.ast_##x); return 1 + snprintf(b, bs, "%u", wf->total.ath.ast_##x); return 1 #define PHY(x) \ - hnprintf(b, bs, "%u", (int64_t) wf->total.ath.ast_rx_phy[x]); return 1 + snprintf(b, bs, "%u", wf->total.ath.ast_rx_phy[x]); return 1 #define ANI(x) \ - hnprintf(b, bs, "%u", (int64_t) wf->total.ani_state.x); return 1 + snprintf(b, bs, "%u", wf->total.ani_state.x); return 1 #define ANISTAT(x) \ - hnprintf(b, bs, "%u", (int64_t) wf->total.ani_stats.ast_ani_##x); return 1 + snprintf(b, bs, "%u", wf->total.ani_stats.ast_ani_##x); return 1 #define MIBSTAT(x) \ - hnprintf(b, bs, "%u", (int64_t) wf->total.ani_stats.ast_mibstats.x); return 1 + snprintf(b, bs, "%u", wf->total.ani_stats.ast_mibstats.x); return 1 #define TXANT(x) \ - hnprintf(b, bs, "%u", (int64_t) wf->total.ath.ast_ant_tx[x]); return 1 + snprintf(b, bs, "%u", wf->total.ath.ast_ant_tx[x]); return 1 #define RXANT(x) \ - hnprintf(b, bs, "%u", (int64_t) wf->total.ath.ast_ant_rx[x]); return 1 + snprintf(b, bs, "%u", wf->total.ath.ast_ant_rx[x]); return 1 switch (s) { case S_INPUT: - hnprintf(b, bs, "%lu", + snprintf(b, bs, "%lu", wf->total.ath.ast_rx_packets - wf->total.ath.ast_rx_mgt); return 1; case S_OUTPUT: - hnprintf(b, bs, "%lu", wf->total.ath.ast_tx_packets); + snprintf(b, bs, "%lu", wf->total.ath.ast_tx_packets); return 1; case S_RATE: snprintrate(b, bs, wf->total.ath.ast_tx_rate); Modified: head/tools/tools/ath/athstats/statfoo.c ============================================================================== --- head/tools/tools/ath/athstats/statfoo.c Fri Feb 13 05:38:03 2009 (r188557) +++ head/tools/tools/ath/athstats/statfoo.c Fri Feb 13 05:42:25 2009 (r188558) @@ -109,7 +109,7 @@ statfoo_print_current(struct statfoo *sf for (cp = sf->fmts; *cp != '\0'; cp++) { if (*cp & 0x80) { const struct fmt *f = &sf->stats[*cp &~ 0x80]; - if (sf->get_curstat(sf, *cp &~ 0x80, buf, f->width)) + if (sf->get_curstat(sf, *cp &~ 0x80, buf, sizeof(buf))) fprintf(fd, "%*s", f->width, buf); } else putc(*cp, fd); @@ -126,7 +126,7 @@ statfoo_print_total(struct statfoo *sf, for (cp = sf->fmts; *cp != '\0'; cp++) { if (*cp & 0x80) { const struct fmt *f = &sf->stats[*cp &~ 0x80]; - if (sf->get_totstat(sf, *cp &~ 0x80, buf, f->width)) + if (sf->get_totstat(sf, *cp &~ 0x80, buf, sizeof(buf))) fprintf(fd, "%*s", f->width, buf); } else putc(*cp, fd); From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 05:44:19 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4F6DD106564A; Fri, 13 Feb 2009 05:44:19 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3DCEC8FC13; Fri, 13 Feb 2009 05:44:19 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1D5iJke077696; Fri, 13 Feb 2009 05:44:19 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1D5iJQ7077695; Fri, 13 Feb 2009 05:44:19 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902130544.n1D5iJQ7077695@svn.freebsd.org> From: Sam Leffler Date: Fri, 13 Feb 2009 05:44:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188559 - head/tools/tools/ath/athstats X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Feb 2009 05:44:19 -0000 Author: sam Date: Fri Feb 13 05:44:18 2009 New Revision: 188559 URL: http://svn.freebsd.org/changeset/base/188559 Log: add stats no frags and missing stat for no dma buffers Modified: head/tools/tools/ath/athstats/athstats.c Modified: head/tools/tools/ath/athstats/athstats.c ============================================================================== --- head/tools/tools/ath/athstats/athstats.c Fri Feb 13 05:42:25 2009 (r188558) +++ head/tools/tools/ath/athstats/athstats.c Fri Feb 13 05:44:18 2009 (r188559) @@ -116,7 +116,11 @@ static const struct fmt athstats[] = { { 5, "txencode", "txencode", "tx encapsulation failed" }, #define S_TX_NONODE AFTER(S_TX_ENCAP) { 5, "txnonode", "txnonode", "tx failed 'cuz no node" }, -#define S_TX_NOMBUF AFTER(S_TX_NONODE) +#define S_TX_NOBUF AFTER(S_TX_NONODE) + { 5, "txnobuf", "txnobuf", "tx failed 'cuz dma buffer allocation failed" }, +#define S_TX_NOFRAG AFTER(S_TX_NOBUF) + { 5, "txnofrag", "txnofrag", "tx failed 'cuz frag buffer allocation(s) failed" }, +#define S_TX_NOMBUF AFTER(S_TX_NOFRAG) { 5, "txnombuf", "txnombuf", "tx failed 'cuz mbuf allocation failed" }, #ifndef __linux__ #define S_TX_NOMCL AFTER(S_TX_NOMBUF) @@ -542,6 +546,8 @@ ath_get_curstat(struct statfoo *sf, int case S_TX_QSTOP: STAT(tx_qstop); case S_TX_ENCAP: STAT(tx_encap); case S_TX_NONODE: STAT(tx_nonode); + case S_TX_NOBUF: STAT(tx_nobuf); + case S_TX_NOFRAG: STAT(tx_nofrag); case S_TX_NOMBUF: STAT(tx_nombuf); #ifdef S_TX_NOMCL case S_TX_NOMCL: STAT(tx_nomcl); @@ -759,6 +765,8 @@ ath_get_totstat(struct statfoo *sf, int case S_TX_QSTOP: STAT(tx_qstop); case S_TX_ENCAP: STAT(tx_encap); case S_TX_NONODE: STAT(tx_nonode); + case S_TX_NOBUF: STAT(tx_nobuf); + case S_TX_NOFRAG: STAT(tx_nofrag); case S_TX_NOMBUF: STAT(tx_nombuf); #ifdef S_TX_NOMCL case S_TX_NOMCL: STAT(tx_nomcl); From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 05:45:24 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 50F4D106566B; Fri, 13 Feb 2009 05:45:24 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 35C348FC0C; Fri, 13 Feb 2009 05:45:24 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1D5jOlN077759; Fri, 13 Feb 2009 05:45:24 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1D5jOmj077756; Fri, 13 Feb 2009 05:45:24 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902130545.n1D5jOmj077756@svn.freebsd.org> From: Sam Leffler Date: Fri, 13 Feb 2009 05:45:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188560 - head/tools/tools/ath/athstats X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Feb 2009 05:45:24 -0000 Author: sam Date: Fri Feb 13 05:45:23 2009 New Revision: 188560 URL: http://svn.freebsd.org/changeset/base/188560 Log: add -z option to zero driver statistics (but note we don't yet zero stats obtained from the hal) Modified: head/tools/tools/ath/athstats/athstats.c head/tools/tools/ath/athstats/athstats.h head/tools/tools/ath/athstats/main.c Modified: head/tools/tools/ath/athstats/athstats.c ============================================================================== --- head/tools/tools/ath/athstats/athstats.c Fri Feb 13 05:44:18 2009 (r188559) +++ head/tools/tools/ath/athstats/athstats.c Fri Feb 13 05:45:23 2009 (r188560) @@ -436,6 +436,15 @@ ath_setifname(struct athstatfoo *wf0, co #endif } +static void +ath_zerostats(struct athstatfoo *wf0) +{ + struct athstatfoo_p *wf = (struct athstatfoo_p *) wf0; + + if (ioctl(wf->s, SIOCZATHSTATS, &wf->ifr) < 0) + err(-1, wf->ifr.ifr_name); +} + static void ath_collect(struct athstatfoo_p *wf, struct _athstats *stats) { @@ -997,6 +1006,7 @@ athstats_new(const char *ifname, const c #if 0 wf->base.setstamac = wlan_setstamac; #endif + wf->base.zerostats = ath_zerostats; wf->s = socket(AF_INET, SOCK_DGRAM, 0); if (wf->s < 0) err(1, "socket"); Modified: head/tools/tools/ath/athstats/athstats.h ============================================================================== --- head/tools/tools/ath/athstats/athstats.h Fri Feb 13 05:44:18 2009 (r188559) +++ head/tools/tools/ath/athstats/athstats.h Fri Feb 13 05:45:23 2009 (r188560) @@ -46,6 +46,8 @@ struct athstatfoo { void (*setifname)(struct athstatfoo *, const char *ifname); /* set the mac address of the associated station/ap */ void (*setstamac)(struct athstatfoo *, const uint8_t mac[]); + /* zero in-kernel statistics */ + void (*zerostats)(struct athstatfoo *); }; struct athstatfoo *athstats_new(const char *ifname, const char *fmtstring); Modified: head/tools/tools/ath/athstats/main.c ============================================================================== --- head/tools/tools/ath/athstats/main.c Fri Feb 13 05:44:18 2009 (r188559) +++ head/tools/tools/ath/athstats/main.c Fri Feb 13 05:45:23 2009 (r188560) @@ -33,7 +33,7 @@ * Simple Atheros-specific tool to inspect and monitor network traffic * statistics. * - * athstats [-i interface] [-l] [-o fmtstring] [interval] + * athstats [-i interface] [-z] [-l] [-o fmtstring] [interval] * * (default interface is ath0). If interval is specified a rolling output * a la netstat -i is displayed every interval seconds. The format of @@ -95,7 +95,7 @@ main(int argc, char *argv[]) if (ifname == NULL) ifname = "ath0"; wf = athstats_new(ifname, getfmt("default")); - while ((c = getopt(argc, argv, "i:lo:")) != -1) { + while ((c = getopt(argc, argv, "i:lo:z")) != -1) { switch (c) { case 'i': wf->setifname(wf, optarg); @@ -106,8 +106,11 @@ main(int argc, char *argv[]) case 'o': wf->setfmt(wf, getfmt(optarg)); break; + case 'z': + wf->zerostats(wf); + break; default: - errx(-1, "usage: %s [-a] [-i ifname] [-l] [-o fmt] [interval]\n", argv[0]); + errx(-1, "usage: %s [-a] [-i ifname] [-l] [-o fmt] [-z] [interval]\n", argv[0]); /*NOTREACHED*/ } } From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 10:04:59 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 640B71065670; Fri, 13 Feb 2009 10:04:59 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 517478FC1D; Fri, 13 Feb 2009 10:04:59 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1DA4x1C083000; Fri, 13 Feb 2009 10:04:59 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1DA4xol082999; Fri, 13 Feb 2009 10:04:59 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <200902131004.n1DA4xol082999@svn.freebsd.org> From: Scott Long Date: Fri, 13 Feb 2009 10:04:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188570 - head/sys/cam X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Feb 2009 10:04:59 -0000 Author: scottl Date: Fri Feb 13 10:04:59 2009 New Revision: 188570 URL: http://svn.freebsd.org/changeset/base/188570 Log: In the case that the probe has determined that it can't query the device for a serial number, fall through to the next case so that initial negotiation still happens. Without this, devices were showing up with only 1 available tag opening, leading to observations of very poor I/O performance. This should fix problems reported with VMWare Fusion and ESX. Early generation MPT-SAS controllers with SATA disks might also be affected. HP CISS controllers are also likely affected, as are many other pseudo-scsi disk subsystems. Modified: head/sys/cam/cam_xpt.c Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Fri Feb 13 06:17:53 2009 (r188569) +++ head/sys/cam/cam_xpt.c Fri Feb 13 10:04:59 2009 (r188570) @@ -6143,10 +6143,9 @@ probedone(struct cam_periph *periph, uni xpt_schedule(periph, priority); return; } - xpt_release_ccb(done_ccb); - softc->action = PROBE_TUR_FOR_NEGOTIATION; - xpt_schedule(periph, priority); - return; + + csio->data_ptr = NULL; + /* FALLTHROUGH */ } case PROBE_SERIAL_NUM_1: From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 11:36:32 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 75F781065670; Fri, 13 Feb 2009 11:36:32 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 60FEC8FC13; Fri, 13 Feb 2009 11:36:32 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1DBaWxm087555; Fri, 13 Feb 2009 11:36:32 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1DBaWGa087554; Fri, 13 Feb 2009 11:36:32 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200902131136.n1DBaWGa087554@svn.freebsd.org> From: Luigi Rizzo Date: Fri, 13 Feb 2009 11:36:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188571 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Feb 2009 11:36:34 -0000 Author: luigi Date: Fri Feb 13 11:36:32 2009 New Revision: 188571 URL: http://svn.freebsd.org/changeset/base/188571 Log: Clarify and reimplement the bioq API so that bioq_disksort() has the correct behaviour (sorting by distance from the current head position in the scan direction) and bioq_insert_head() and bioq_insert_tail() have a well defined (and useful) behaviour, especially when intermixed with calls to bioq_disksort(). In particular: - fix a bug in the existing bioq_disksort() that did not use the current head position correctly; - redefine semantics of bioq_insert_head() and bioq_insert_tail(). bioq_insert_tail() can now be used as a barrier between previous and subsequent calls to bioq_disksort(). The code is heavily documented in the source code so please refer to that for the details. Much of this code comes from Fabio Checconi. Also thanks to Kirk for feedback on the (re)definition of bioq_insert_tail(). NOTE: in the current tree there is only a handful of files which intermix calls to bioq_disksort() with bioq_insert_head() and bioq_insert_tail(). The ordering of the queue in these situation was not specified (nor easy to figure out) before, so I doubt any of that code could be affected by the specification of the API. Also note that the current implementation is significantly simpler than the previous one (also used in ata_sort_queue()). It would be useful to reimplement ata_sort_queue() using the same code used in bioq_disksort(). MFC after: 1 week Modified: head/sys/kern/subr_disk.c Modified: head/sys/kern/subr_disk.c ============================================================================== --- head/sys/kern/subr_disk.c Fri Feb 13 10:04:59 2009 (r188570) +++ head/sys/kern/subr_disk.c Fri Feb 13 11:36:32 2009 (r188571) @@ -5,6 +5,10 @@ * can do whatever you want with this stuff. If we meet some day, and you think * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp * ---------------------------------------------------------------------------- + * + * The bioq_disksort() (and the specification of the bioq API) + * have been written by Luigi Rizzo and Fabio Checconi under the same + * license as above. */ #include @@ -63,11 +67,86 @@ disk_err(struct bio *bp, const char *wha /* * BIO queue implementation + * + * Please read carefully the description below before making any change + * to the code, or you might change the behaviour of the data structure + * in undesirable ways. + * + * A bioq stores disk I/O request (bio), normally sorted according to + * the distance of the requested position (bio->bio_offset) from the + * current head position (bioq->last_offset) in the scan direction, i.e. + * + * (uoff_t)(bio_offset - last_offset) + * + * Note that the cast to unsigned (uoff_t) is fundamental to insure + * that the distance is computed in the scan direction. + * + * The main methods for manipulating the bioq are: + * + * bioq_disksort() performs an ordered insertion; + * + * bioq_first() return the head of the queue, without removing; + * + * bioq_takefirst() return and remove the head of the queue, + * updating the 'current head position' as + * bioq->last_offset = bio->bio_offset + bio->bio_length; + * + * When updating the 'current head position', we assume that the result of + * bioq_takefirst() is dispatched to the device, so bioq->last_offset + * represents the head position once the request is complete. + * + * If the bioq is manipulated using only the above calls, it starts + * with a sorted sequence of requests with bio_offset >= last_offset, + * possibly followed by another sorted sequence of requests with + * 0 <= bio_offset < bioq->last_offset + * + * NOTE: historical behaviour was to ignore bio->bio_length in the + * update, but its use tracks the head position in a better way. + * Historical behaviour was also to update the head position when + * the request under service is complete, rather than when the + * request is extracted from the queue. However, the current API + * has no method to update the head position; secondly, once + * a request has been submitted to the disk, we have no idea of + * the actual head position, so the final one is our best guess. + * + * --- Direct queue manipulation --- + * + * A bioq uses an underlying TAILQ to store requests, so we also + * export methods to manipulate the TAILQ, in particular: + * + * bioq_insert_tail() insert an entry at the end. + * It also creates a 'barrier' so all subsequent + * insertions through bioq_disksort() will end up + * after this entry; + * + * bioq_insert_head() insert an entry at the head, update + * bioq->last_offset = bio->bio_offset so that + * all subsequent insertions through bioq_disksort() + * will end up after this entry; + * + * bioq_remove() remove a generic element from the queue, act as + * bioq_takefirst() if invoked on the head of the queue. + * + * The semantic of these methods is the same of the operations + * on the underlying TAILQ, but with additional guarantees on + * subsequent bioq_disksort() calls. E.g. bioq_insert_tail() + * can be useful for making sure that all previous ops are flushed + * to disk before continuing. + * + * Updating bioq->last_offset on a bioq_insert_head() guarantees + * that the bio inserted with the last bioq_insert_head() will stay + * at the head of the queue even after subsequent bioq_disksort(). + * + * Note that when the direct queue manipulation functions are used, + * the queue may contain multiple inversion points (i.e. more than + * two sorted sequences of requests). + * */ void bioq_init(struct bio_queue_head *head) { + TAILQ_INIT(&head->queue); head->last_offset = 0; head->insert_point = NULL; @@ -76,14 +155,13 @@ bioq_init(struct bio_queue_head *head) void bioq_remove(struct bio_queue_head *head, struct bio *bp) { - if (bp == head->insert_point) { - head->last_offset = bp->bio_offset; - head->insert_point = TAILQ_NEXT(bp, bio_queue); - if (head->insert_point == NULL) { - head->last_offset = 0; - head->insert_point = TAILQ_FIRST(&head->queue); - } - } + + if (bp == TAILQ_FIRST(&head->queue)) + head->last_offset = bp->bio_offset + bp->bio_length; + + if (bp == head->insert_point) + head->insert_point = NULL; + TAILQ_REMOVE(&head->queue, bp, bio_queue); } @@ -100,8 +178,7 @@ void bioq_insert_head(struct bio_queue_head *head, struct bio *bp) { - if (TAILQ_EMPTY(&head->queue)) - head->insert_point = bp; + head->last_offset = bp->bio_offset; TAILQ_INSERT_HEAD(&head->queue, bp, bio_queue); } @@ -109,9 +186,8 @@ void bioq_insert_tail(struct bio_queue_head *head, struct bio *bp) { - if (TAILQ_EMPTY(&head->queue)) - head->insert_point = bp; TAILQ_INSERT_TAIL(&head->queue, bp, bio_queue); + head->insert_point = bp; } struct bio * @@ -133,63 +209,42 @@ bioq_takefirst(struct bio_queue_head *he } /* + * Compute the sorting key. The cast to unsigned is + * fundamental for correctness, see the description + * near the beginning of the file. + */ +static inline uoff_t +bioq_bio_key(struct bio_queue_head *head, struct bio *bp) +{ + + return ((uoff_t)(bp->bio_offset - head->last_offset)); +} + +/* * Seek sort for disks. * - * The disksort algorithm sorts all requests in a single queue while keeping - * track of the current position of the disk with insert_point and - * last_offset. last_offset is the offset of the last block sent to disk, or - * 0 once we reach the end. insert_point points to the first buf after - * last_offset, and is used to slightly speed up insertions. Blocks are - * always sorted in ascending order and the queue always restarts at 0. - * This implements the one-way scan which optimizes disk seek times. + * Sort all requests in a single queue while keeping + * track of the current position of the disk with last_offset. + * See above for details. */ void -bioq_disksort(struct bio_queue_head *bioq, struct bio *bp) +bioq_disksort(struct bio_queue_head *head, struct bio *bp) { - struct bio *bq; - struct bio *bn; + struct bio *cur, *prev = NULL; + uoff_t key = bioq_bio_key(head, bp); - /* - * If the queue is empty then it's easy. - */ - if (bioq_first(bioq) == NULL) { - bioq_insert_tail(bioq, bp); - return; - } - /* - * Optimize for sequential I/O by seeing if we go at the tail. - */ - bq = TAILQ_LAST(&bioq->queue, bio_queue); - if (bp->bio_offset > bq->bio_offset) { - TAILQ_INSERT_AFTER(&bioq->queue, bq, bp, bio_queue); - return; - } - /* - * Pick our scan start based on the last request. A poor man's - * binary search. - */ - if (bp->bio_offset >= bioq->last_offset) { - bq = bioq->insert_point; - /* - * If we're before the next bio and after the last offset, - * update insert_point; - */ - if (bp->bio_offset < bq->bio_offset) { - bioq->insert_point = bp; - TAILQ_INSERT_BEFORE(bq, bp, bio_queue); - return; - } - } else - bq = TAILQ_FIRST(&bioq->queue); - if (bp->bio_offset < bq->bio_offset) { - TAILQ_INSERT_BEFORE(bq, bp, bio_queue); - return; - } - /* Insertion sort */ - while ((bn = TAILQ_NEXT(bq, bio_queue)) != NULL) { - if (bp->bio_offset < bn->bio_offset) - break; - bq = bn; + cur = TAILQ_FIRST(&head->queue); + + if (head->insert_point) + cur = head->insert_point; + + while (cur != NULL && key >= bioq_bio_key(head, cur)) { + prev = cur; + cur = TAILQ_NEXT(cur, bio_queue); } - TAILQ_INSERT_AFTER(&bioq->queue, bq, bp, bio_queue); + + if (prev == NULL) + TAILQ_INSERT_HEAD(&head->queue, bp, bio_queue); + else + TAILQ_INSERT_AFTER(&head->queue, prev, bp, bio_queue); } From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 11:55:20 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 03E651065674; Fri, 13 Feb 2009 11:55:20 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E627E8FC1C; Fri, 13 Feb 2009 11:55:19 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1DBtJJ7087918; Fri, 13 Feb 2009 11:55:19 GMT (envelope-from netchild@svn.freebsd.org) Received: (from netchild@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1DBtJJm087917; Fri, 13 Feb 2009 11:55:19 GMT (envelope-from netchild@svn.freebsd.org) Message-Id: <200902131155.n1DBtJJm087917@svn.freebsd.org> From: Alexander Leidinger Date: Fri, 13 Feb 2009 11:55:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188572 - head/sys/compat/linux X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Feb 2009 11:55:20 -0000 Author: netchild Date: Fri Feb 13 11:55:19 2009 New Revision: 188572 URL: http://svn.freebsd.org/changeset/base/188572 Log: Fix an edge-case of the linux readdir: We need the size of a linux dirent structure, not the size of a pointer to it. PR: 131099 Submitted by: Andreas Kies MFC after: 2 weeks Modified: head/sys/compat/linux/linux_file.c Modified: head/sys/compat/linux/linux_file.c ============================================================================== --- head/sys/compat/linux/linux_file.c Fri Feb 13 11:36:32 2009 (r188571) +++ head/sys/compat/linux/linux_file.c Fri Feb 13 11:55:19 2009 (r188572) @@ -345,7 +345,7 @@ getdents_common(struct thread *td, struc /* readdir(2) case. Always struct dirent. */ if (is64bit) return (EINVAL); - nbytes = sizeof(linux_dirent); + nbytes = sizeof(*linux_dirent); justone = 1; } else justone = 0; From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 12:59:54 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AC01C1065674; Fri, 13 Feb 2009 12:59:54 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9AA678FC1C; Fri, 13 Feb 2009 12:59:54 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1DCxsvD089231; Fri, 13 Feb 2009 12:59:54 GMT (envelope-from maxim@svn.freebsd.org) Received: (from maxim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1DCxsfC089230; Fri, 13 Feb 2009 12:59:54 GMT (envelope-from maxim@svn.freebsd.org) Message-Id: <200902131259.n1DCxsfC089230@svn.freebsd.org> From: Maxim Konovalov Date: Fri, 13 Feb 2009 12:59:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188575 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Feb 2009 12:59:55 -0000 Author: maxim Date: Fri Feb 13 12:59:54 2009 New Revision: 188575 URL: http://svn.freebsd.org/changeset/base/188575 Log: o In case of the error do not forget to deallocate a cloned device unit. PR: kern/131642 Submitted by: Dmitrij Tejblum MFC after: 1 week Modified: head/sys/net/if_vlan.c Modified: head/sys/net/if_vlan.c ============================================================================== --- head/sys/net/if_vlan.c Fri Feb 13 12:15:45 2009 (r188574) +++ head/sys/net/if_vlan.c Fri Feb 13 12:59:54 2009 (r188575) @@ -746,6 +746,7 @@ vlan_clone_create(struct if_clone *ifc, ether_ifdetach(ifp); vlan_unconfig(ifp); if_free_type(ifp, IFT_ETHER); + ifc_free_unit(ifc, unit); free(ifv, M_VLAN); return (error); From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 14:43:46 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E1494106566B; Fri, 13 Feb 2009 14:43:46 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B5BE48FC21; Fri, 13 Feb 2009 14:43:46 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1DEhk2j091250; Fri, 13 Feb 2009 14:43:46 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1DEhkxq091248; Fri, 13 Feb 2009 14:43:46 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <200902131443.n1DEhkxq091248@svn.freebsd.org> From: Randall Stewart Date: Fri, 13 Feb 2009 14:43:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188577 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Feb 2009 14:43:48 -0000 Author: rrs Date: Fri Feb 13 14:43:46 2009 New Revision: 188577 URL: http://svn.freebsd.org/changeset/base/188577 Log: Move the new rwnd field down to the very end of the xsctp structure. This is where all new fields belong (not that we will be ABI compatiable with 7.x anyway.. sigh). Modified: head/sys/netinet/sctp_sysctl.c head/sys/netinet/sctp_uio.h Modified: head/sys/netinet/sctp_sysctl.c ============================================================================== --- head/sys/netinet/sctp_sysctl.c Fri Feb 13 13:35:41 2009 (r188576) +++ head/sys/netinet/sctp_sysctl.c Fri Feb 13 14:43:46 2009 (r188577) @@ -409,8 +409,9 @@ sctp_assoclist(SYSCTL_HANDLER_ARGS) xstcb.primary_addr = stcb->asoc.primary_destination->ro._l_addr; xstcb.heartbeat_interval = stcb->asoc.heart_beat_delay; xstcb.state = SCTP_GET_STATE(&stcb->asoc); /* FIXME */ - /* 7.0 does not support this */ + /* 7.0 does not support these */ xstcb.assoc_id = sctp_get_associd(stcb); + xstcb.peers_rwnd = stcb->asoc.peers_rwnd; xstcb.in_streams = stcb->asoc.streamincnt; xstcb.out_streams = stcb->asoc.streamoutcnt; xstcb.max_nr_retrans = stcb->asoc.overall_error_count; @@ -432,7 +433,6 @@ sctp_assoclist(SYSCTL_HANDLER_ARGS) xstcb.cumulative_tsn = stcb->asoc.last_acked_seq; xstcb.cumulative_tsn_ack = stcb->asoc.cumulative_tsn; xstcb.mtu = stcb->asoc.smallest_mtu; - xstcb.peers_rwnd = stcb->asoc.peers_rwnd; xstcb.refcnt = stcb->asoc.refcnt; SCTP_INP_RUNLOCK(inp); SCTP_INP_INFO_RUNLOCK(); Modified: head/sys/netinet/sctp_uio.h ============================================================================== --- head/sys/netinet/sctp_uio.h Fri Feb 13 13:35:41 2009 (r188576) +++ head/sys/netinet/sctp_uio.h Fri Feb 13 14:43:46 2009 (r188577) @@ -1011,12 +1011,12 @@ struct xsctp_tcb { uint32_t cumulative_tsn; uint32_t cumulative_tsn_ack; uint32_t mtu; - uint32_t peers_rwnd; uint32_t refcnt; uint16_t local_port; /* sctpAssocEntry 3 */ uint16_t remote_port; /* sctpAssocEntry 4 */ struct sctp_timeval start_time; /* sctpAssocEntry 16 */ struct sctp_timeval discontinuity_time; /* sctpAssocEntry 17 */ + uint32_t peers_rwnd; sctp_assoc_t assoc_id; /* sctpAssocEntry 1 */ uint32_t extra_padding[8]; /* future */ }; From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 15:06:37 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 841EA106566C; Fri, 13 Feb 2009 15:06:37 +0000 (UTC) (envelope-from bra@fsn.hu) Received: from people.fsn.hu (people.fsn.hu [195.228.252.137]) by mx1.freebsd.org (Postfix) with ESMTP id 09DBD8FC14; Fri, 13 Feb 2009 15:06:35 +0000 (UTC) (envelope-from bra@fsn.hu) Message-ID: <49958C73.2050406@fsn.hu> Date: Fri, 13 Feb 2009 16:06:27 +0100 From: Attila Nagy User-Agent: Thunderbird 2.0.0.19 (X11/20090105) MIME-Version: 1.0 To: Scott Long References: <200902131004.n1DA4xol082999@svn.freebsd.org> In-Reply-To: <200902131004.n1DA4xol082999@svn.freebsd.org> X-Stationery: 0.4.8.12 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (people.fsn.hu [0.0.0.0]); Fri, 13 Feb 2009 16:06:31 +0100 (CET) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r188570 - head/sys/cam X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Feb 2009 15:06:37 -0000 Hello, Scott Long wrote: > Author: scottl > Date: Fri Feb 13 10:04:59 2009 > New Revision: 188570 > URL: http://svn.freebsd.org/changeset/base/188570 > > Log: > In the case that the probe has determined that it can't query the device for > a serial number, fall through to the next case so that initial negotiation > still happens. Without this, devices were showing up with only 1 available > tag opening, leading to observations of very poor I/O performance. > > This should fix problems reported with VMWare Fusion and ESX. Early > generation MPT-SAS controllers with SATA disks might also be affected. > HP CISS controllers are also likely affected, as are many other > pseudo-scsi disk subsystems. > Is it possible that these two are related? http://marc.info/?l=freebsd-scsi&m=122900270413265&w=2 From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 15:14:43 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA3D21065674; Fri, 13 Feb 2009 15:14:43 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A85208FC19; Fri, 13 Feb 2009 15:14:43 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1DFEh5D091844; Fri, 13 Feb 2009 15:14:43 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1DFEhft091837; Fri, 13 Feb 2009 15:14:43 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200902131514.n1DFEhft091837@svn.freebsd.org> From: Luigi Rizzo Date: Fri, 13 Feb 2009 15:14:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188578 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Feb 2009 15:14:44 -0000 Author: luigi Date: Fri Feb 13 15:14:43 2009 New Revision: 188578 URL: http://svn.freebsd.org/changeset/base/188578 Log: Use uint32_t instead of n_long and n_time, and uint16_t instead of n_short. Add a note next to fields in network format. The n_* types are not enough for compiler checks on endianness, and their use often requires an otherwise unnecessary #include The typedef in in_systm.h are still there. Modified: head/sys/netinet/in_systm.h head/sys/netinet/ip.h head/sys/netinet/ip_icmp.c head/sys/netinet/ip_icmp.h head/sys/netinet/ip_options.c head/sys/netinet/tcp_debug.h head/sys/netinet/tcp_subr.c Modified: head/sys/netinet/in_systm.h ============================================================================== --- head/sys/netinet/in_systm.h Fri Feb 13 14:43:46 2009 (r188577) +++ head/sys/netinet/in_systm.h Fri Feb 13 15:14:43 2009 (r188578) @@ -52,7 +52,7 @@ typedef u_int32_t n_long; /* long as re typedef u_int32_t n_time; /* ms since 00:00 GMT, byte rev */ #ifdef _KERNEL -n_time iptime(void); +uint32_t iptime(void); #endif #endif Modified: head/sys/netinet/ip.h ============================================================================== --- head/sys/netinet/ip.h Fri Feb 13 14:43:46 2009 (r188577) +++ head/sys/netinet/ip.h Fri Feb 13 15:14:43 2009 (r188578) @@ -150,10 +150,10 @@ struct ip_timestamp { ipt_flg:4; /* flags, see below */ #endif union ipt_timestamp { - n_long ipt_time[1]; + uint32_t ipt_time[1]; /* network format */ struct ipt_ta { struct in_addr ipt_addr; - n_long ipt_time; + uint32_t ipt_time; /* network format */ } ipt_ta[1]; } ipt_timestamp; }; Modified: head/sys/netinet/ip_icmp.c ============================================================================== --- head/sys/netinet/ip_icmp.c Fri Feb 13 14:43:46 2009 (r188577) +++ head/sys/netinet/ip_icmp.c Fri Feb 13 15:14:43 2009 (r188578) @@ -165,7 +165,7 @@ icmp_init(void) * in response to bad packet ip. */ void -icmp_error(struct mbuf *n, int type, int code, n_long dest, int mtu) +icmp_error(struct mbuf *n, int type, int code, uint32_t dest, int mtu) { INIT_VNET_INET(curvnet); register struct ip *oip = mtod(n, struct ip *), *nip; @@ -852,7 +852,10 @@ icmp_send(struct mbuf *m, struct mbuf *o (void) ip_output(m, opts, NULL, 0, NULL, NULL); } -n_time +/* + * Return milliseconds since 00:00 GMT in network format. + */ +uint32_t iptime(void) { struct timeval atv; Modified: head/sys/netinet/ip_icmp.h ============================================================================== --- head/sys/netinet/ip_icmp.h Fri Feb 13 14:43:46 2009 (r188577) +++ head/sys/netinet/ip_icmp.h Fri Feb 13 15:14:43 2009 (r188578) @@ -68,15 +68,15 @@ struct icmp { u_char ih_pptr; /* ICMP_PARAMPROB */ struct in_addr ih_gwaddr; /* ICMP_REDIRECT */ struct ih_idseq { - n_short icd_id; - n_short icd_seq; + uint16_t icd_id; /* network format */ + uint16_t icd_seq; /* network format */ } ih_idseq; int ih_void; /* ICMP_UNREACH_NEEDFRAG -- Path MTU Discovery (RFC1191) */ struct ih_pmtu { - n_short ipm_void; - n_short ipm_nextmtu; + uint16_t ipm_void; /* network format */ + uint16_t ipm_nextmtu; /* network format */ } ih_pmtu; struct ih_rtradv { @@ -97,9 +97,13 @@ struct icmp { #define icmp_lifetime icmp_hun.ih_rtradv.irt_lifetime union { struct id_ts { /* ICMP Timestamp */ - n_time its_otime; /* Originate */ - n_time its_rtime; /* Receive */ - n_time its_ttime; /* Transmit */ + /* + * The next 3 fields are in network format, + * milliseconds since 00:00 GMT + */ + uint32_t its_otime; /* Originate */ + uint32_t its_rtime; /* Receive */ + uint32_t its_ttime; /* Transmit */ } id_ts; struct id_ip { struct ip idi_ip; @@ -127,7 +131,7 @@ struct icmp { * ip header length. */ #define ICMP_MINLEN 8 /* abs minimum */ -#define ICMP_TSLEN (8 + 3 * sizeof (n_time)) /* timestamp */ +#define ICMP_TSLEN (8 + 3 * sizeof (uint32_t)) /* timestamp */ #define ICMP_MASKLEN 12 /* address mask */ #define ICMP_ADVLENMIN (8 + sizeof (struct ip) + 8) /* min */ #define ICMP_ADVLEN(p) (8 + ((p)->icmp_ip.ip_hl << 2) + 8) @@ -202,7 +206,7 @@ struct icmp { (type) == ICMP_MASKREQ || (type) == ICMP_MASKREPLY) #ifdef _KERNEL -void icmp_error(struct mbuf *, int, int, n_long, int); +void icmp_error(struct mbuf *, int, int, uint32_t, int); void icmp_input(struct mbuf *, int); void icmp_init(void); int ip_next_mtu(int, int); Modified: head/sys/netinet/ip_options.c ============================================================================== --- head/sys/netinet/ip_options.c Fri Feb 13 14:43:46 2009 (r188577) +++ head/sys/netinet/ip_options.c Fri Feb 13 15:14:43 2009 (r188578) @@ -105,7 +105,7 @@ ip_dooptions(struct mbuf *m, int pass) struct in_ifaddr *ia; int opt, optlen, cnt, off, code, type = ICMP_PARAMPROB, forward = 0; struct in_addr *sin, dst; - n_time ntime; + uint32_t ntime; struct sockaddr_in ipaddr = { sizeof(ipaddr), AF_INET }; /* Ignore or reject packets with IP options. */ @@ -320,7 +320,7 @@ dropit: break; case IPOPT_TS_TSANDADDR: - if (off + sizeof(n_time) + + if (off + sizeof(uint32_t) + sizeof(struct in_addr) > optlen) { code = &cp[IPOPT_OFFSET] - (u_char *)ip; goto bad; @@ -337,7 +337,7 @@ dropit: break; case IPOPT_TS_PRESPEC: - if (off + sizeof(n_time) + + if (off + sizeof(uint32_t) + sizeof(struct in_addr) > optlen) { code = &cp[IPOPT_OFFSET] - (u_char *)ip; goto bad; @@ -355,8 +355,8 @@ dropit: goto bad; } ntime = iptime(); - (void)memcpy(cp + off, &ntime, sizeof(n_time)); - cp[IPOPT_OFFSET] += sizeof(n_time); + (void)memcpy(cp + off, &ntime, sizeof(uint32_t)); + cp[IPOPT_OFFSET] += sizeof(uint32_t); } } if (forward && V_ipforwarding) { Modified: head/sys/netinet/tcp_debug.h ============================================================================== --- head/sys/netinet/tcp_debug.h Fri Feb 13 14:43:46 2009 (r188577) +++ head/sys/netinet/tcp_debug.h Fri Feb 13 15:14:43 2009 (r188578) @@ -34,7 +34,7 @@ #define _NETINET_TCP_DEBUG_H_ struct tcp_debug { - n_time td_time; + uint32_t td_time; /* network format */ short td_act; short td_ostate; caddr_t td_tcb; Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Fri Feb 13 14:43:46 2009 (r188577) +++ head/sys/netinet/tcp_subr.c Fri Feb 13 15:14:43 2009 (r188578) @@ -581,7 +581,7 @@ tcp_respond(struct tcpcb *tp, void *ipge } else #endif /* INET6 */ { - xchg(ip->ip_dst.s_addr, ip->ip_src.s_addr, n_long); + xchg(ip->ip_dst.s_addr, ip->ip_src.s_addr, uint32_t); nth = (struct tcphdr *)(ip + 1); } if (th != nth) { @@ -593,7 +593,7 @@ tcp_respond(struct tcpcb *tp, void *ipge nth->th_sport = th->th_sport; nth->th_dport = th->th_dport; } - xchg(nth->th_dport, nth->th_sport, n_short); + xchg(nth->th_dport, nth->th_sport, uint16_t); #undef xchg } #ifdef INET6 From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 15:32:03 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9FC98106566B; Fri, 13 Feb 2009 15:32:03 +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 8E6698FC08; Fri, 13 Feb 2009 15:32:03 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1DFW34o092211; Fri, 13 Feb 2009 15:32:03 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1DFW3tw092210; Fri, 13 Feb 2009 15:32:03 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200902131532.n1DFW3tw092210@svn.freebsd.org> From: John Baldwin Date: Fri, 13 Feb 2009 15:32:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188579 - head/sys/compat/linprocfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Feb 2009 15:32:04 -0000 Author: jhb Date: Fri Feb 13 15:32:03 2009 New Revision: 188579 URL: http://svn.freebsd.org/changeset/base/188579 Log: Fix a bug in the previous change to the mtab handler: use the path returned by vn_fullpath() when vn_fullpath() succeeds instead of when it fails. Submitted by: Artem Belevich fbsdlist of src.cx MFC after: 3 days Modified: head/sys/compat/linprocfs/linprocfs.c Modified: head/sys/compat/linprocfs/linprocfs.c ============================================================================== --- head/sys/compat/linprocfs/linprocfs.c Fri Feb 13 15:14:43 2009 (r188578) +++ head/sys/compat/linprocfs/linprocfs.c Fri Feb 13 15:32:03 2009 (r188579) @@ -327,7 +327,7 @@ linprocfs_domtab(PFS_FILL_ARGS) error = namei(&nd); lep = linux_emul_path; if (error == 0) { - if (vn_fullpath(td, nd.ni_vp, &dlep, &flep) != 0) + if (vn_fullpath(td, nd.ni_vp, &dlep, &flep) == 0) lep = dlep; vrele(nd.ni_vp); VFS_UNLOCK_GIANT(NDHASGIANT(&nd)); From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 15:37:15 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6C1CE1065670; Fri, 13 Feb 2009 15:37:15 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 509698FC1A; Fri, 13 Feb 2009 15:37:15 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1DFbFXK092343; Fri, 13 Feb 2009 15:37:15 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1DFbFAC092341; Fri, 13 Feb 2009 15:37:15 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200902131537.n1DFbFAC092341@svn.freebsd.org> From: Luigi Rizzo Date: Fri, 13 Feb 2009 15:37:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188580 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Feb 2009 15:37:16 -0000 Author: luigi Date: Fri Feb 13 15:37:14 2009 New Revision: 188580 URL: http://svn.freebsd.org/changeset/base/188580 Log: remove unnecessary #include, and document some of the others Modified: head/sys/netinet/ip_dummynet.c head/sys/netinet/ip_fw2.c Modified: head/sys/netinet/ip_dummynet.c ============================================================================== --- head/sys/netinet/ip_dummynet.c Fri Feb 13 15:32:03 2009 (r188579) +++ head/sys/netinet/ip_dummynet.c Fri Feb 13 15:37:14 2009 (r188580) @@ -72,18 +72,15 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include /* IFNAMSIZ, struct ifaddr, ifq head, lock.h mutex.h */ #include -#include #include -#include -#include -#include +#include /* ip_len, ip_off */ #include #include -#include +#include /* ip_output(), IP_FORWARDING */ -#include /* for struct arpcom */ +#include /* various ether_* routines */ #include /* for ip6_input, ip6_output prototypes */ #include @@ -157,6 +154,9 @@ static struct callout dn_timeout; extern void (*bridge_dn_p)(struct mbuf *, struct ifnet *); #ifdef SYSCTL_NODE +SYSCTL_DECL(_net_inet); +SYSCTL_DECL(_net_inet_ip); + SYSCTL_NODE(_net_inet_ip, OID_AUTO, dummynet, CTLFLAG_RW, 0, "Dummynet"); SYSCTL_INT(_net_inet_ip_dummynet, OID_AUTO, hash_size, CTLFLAG_RW, &dn_hash_size, 0, "Default hash table size"); @@ -892,7 +892,7 @@ dummynet_send(struct mbuf *m) case DN_TO_IP_OUT: ip_output(m, NULL, NULL, IP_FORWARDING, NULL, NULL); break ; - case DN_TO_IP_IN : + case DN_TO_IP_IN : ip = mtod(m, struct ip *); ip->ip_len = htons(ip->ip_len); ip->ip_off = htons(ip->ip_off); Modified: head/sys/netinet/ip_fw2.c ============================================================================== --- head/sys/netinet/ip_fw2.c Fri Feb 13 15:32:03 2009 (r188579) +++ head/sys/netinet/ip_fw2.c Fri Feb 13 15:37:14 2009 (r188580) @@ -74,7 +74,6 @@ __FBSDID("$FreeBSD$"); #define IPFW_INTERNAL /* Access to protected data structures in ip_fw.h. */ #include -#include #include #include #include @@ -85,10 +84,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include #include -#include #include #include #include @@ -96,8 +92,6 @@ __FBSDID("$FreeBSD$"); #include -#include - #include #include #ifdef INET6 @@ -108,7 +102,9 @@ __FBSDID("$FreeBSD$"); #include /* XXX for in_cksum */ +#ifdef MAC #include +#endif #ifndef VIMAGE #ifndef VIMAGE_GLOBALS From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 16:00:19 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9DCDB1065670; Fri, 13 Feb 2009 16:00:19 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8CEB58FC16; Fri, 13 Feb 2009 16:00:19 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1DG0J6i092803; Fri, 13 Feb 2009 16:00:19 GMT (envelope-from cognet@svn.freebsd.org) Received: (from cognet@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1DG0J0f092802; Fri, 13 Feb 2009 16:00:19 GMT (envelope-from cognet@svn.freebsd.org) Message-Id: <200902131600.n1DG0J0f092802@svn.freebsd.org> From: Olivier Houchard Date: Fri, 13 Feb 2009 16:00:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188581 - head/sys/arm/arm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Feb 2009 16:00:20 -0000 Author: cognet Date: Fri Feb 13 16:00:19 2009 New Revision: 188581 URL: http://svn.freebsd.org/changeset/base/188581 Log: Oops. ARM_RAS_END is ARM_TP_ADDRESS + 8, not 4. Spotted out by: Mark Tinguely Modified: head/sys/arm/arm/swtch.S Modified: head/sys/arm/arm/swtch.S ============================================================================== --- head/sys/arm/arm/swtch.S Fri Feb 13 15:37:14 2009 (r188580) +++ head/sys/arm/arm/swtch.S Fri Feb 13 16:00:19 2009 (r188581) @@ -210,7 +210,7 @@ ENTRY(cpu_throw) ldr r6, [r5, #(TD_MD + MD_RAS_START)] str r6, [r4, #4] /* ARM_RAS_START */ ldr r6, [r5, #(TD_MD + MD_RAS_END)] - str r6, [r4, #4] /* ARM_RAS_END */ + str r6, [r4, #8] /* ARM_RAS_END */ /* Hook in a new pcb */ ldr r6, .Lcurpcb From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 16:17:06 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2C0371065670; Fri, 13 Feb 2009 16:17:06 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F3B118FC1B; Fri, 13 Feb 2009 16:17:05 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1DGH5XX093153; Fri, 13 Feb 2009 16:17:05 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1DGH5nk093151; Fri, 13 Feb 2009 16:17:05 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902131617.n1DGH5nk093151@svn.freebsd.org> From: Sam Leffler Date: Fri, 13 Feb 2009 16:17:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188582 - in head/sys/dev: iwn wpi X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Feb 2009 16:17:07 -0000 Author: sam Date: Fri Feb 13 16:17:05 2009 New Revision: 188582 URL: http://svn.freebsd.org/changeset/base/188582 Log: remove references to ic_stats Spotted by: Lucius Windschuh Modified: head/sys/dev/iwn/if_iwn.c head/sys/dev/wpi/if_wpi.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Fri Feb 13 16:00:19 2009 (r188581) +++ head/sys/dev/iwn/if_iwn.c Fri Feb 13 16:17:05 2009 (r188582) @@ -1442,7 +1442,6 @@ iwn_rx_intr(struct iwn_softc *sc, struct if (len < sizeof (struct ieee80211_frame)) { DPRINTF(sc, IWN_DEBUG_RECV, "%s: frame too short: %d\n", __func__, len); - ic->ic_stats.is_rx_tooshort++; ifp->if_ierrors++; return; } @@ -1452,7 +1451,6 @@ iwn_rx_intr(struct iwn_softc *sc, struct if (mnew == NULL) { DPRINTF(sc, IWN_DEBUG_ANY, "%s: no mbuf to restock ring\n", __func__); - ic->ic_stats.is_rx_nobuf++; ifp->if_ierrors++; return; } @@ -1463,7 +1461,6 @@ iwn_rx_intr(struct iwn_softc *sc, struct device_printf(sc->sc_dev, "%s: bus_dmamap_load failed, error %d\n", __func__, error); m_freem(mnew); - ic->ic_stats.is_rx_nobuf++; /* XXX need stat */ ifp->if_ierrors++; return; } Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Fri Feb 13 16:00:19 2009 (r188581) +++ head/sys/dev/wpi/if_wpi.c Fri Feb 13 16:17:05 2009 (r188582) @@ -1478,7 +1478,6 @@ wpi_rx_intr(struct wpi_softc *sc, struct if (mnew == NULL) { DPRINTFN(WPI_DEBUG_RX, ("%s: no mbuf to restock ring\n", __func__)); - ic->ic_stats.is_rx_nobuf++; ifp->if_ierrors++; return; } @@ -1489,7 +1488,6 @@ wpi_rx_intr(struct wpi_softc *sc, struct device_printf(sc->sc_dev, "%s: bus_dmamap_load failed, error %d\n", __func__, error); m_freem(mnew); - ic->ic_stats.is_rx_nobuf++; /* XXX need stat */ ifp->if_ierrors++; return; } From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 16:51:36 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E844D106564A; Fri, 13 Feb 2009 16:51:36 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BBBC38FC13; Fri, 13 Feb 2009 16:51:36 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1DGpaqC093819; Fri, 13 Feb 2009 16:51:36 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1DGpa2H093815; Fri, 13 Feb 2009 16:51:36 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200902131651.n1DGpa2H093815@svn.freebsd.org> From: Jung-uk Kim Date: Fri, 13 Feb 2009 16:51:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188583 - in head: gnu/lib/libgcc lib/libc_r lib/libkse lib/libthr X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Feb 2009 16:51:37 -0000 Author: jkim Date: Fri Feb 13 16:51:36 2009 New Revision: 188583 URL: http://svn.freebsd.org/changeset/base/188583 Log: Honor WITHOUT_INSTALLLIB in some places. Modified: head/gnu/lib/libgcc/Makefile head/lib/libc_r/Makefile head/lib/libkse/Makefile head/lib/libthr/Makefile Modified: head/gnu/lib/libgcc/Makefile ============================================================================== --- head/gnu/lib/libgcc/Makefile Fri Feb 13 16:17:05 2009 (r188582) +++ head/gnu/lib/libgcc/Makefile Fri Feb 13 16:51:36 2009 (r188583) @@ -332,8 +332,10 @@ all: lib${LIB}_eh_p.a _libinstall: _lib-eh-install _lib-eh-install: +.if ${MK_INSTALLLIB} != "no" ${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ ${_INSTALLFLAGS} lib${LIB}_eh.a ${DESTDIR}${LIBDIR} +.endif .if ${MK_PROFILE} != "no" ${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ ${_INSTALLFLAGS} lib${LIB}_eh_p.a ${DESTDIR}${LIBDIR} Modified: head/lib/libc_r/Makefile ============================================================================== --- head/lib/libc_r/Makefile Fri Feb 13 16:17:05 2009 (r188582) +++ head/lib/libc_r/Makefile Fri Feb 13 16:51:36 2009 (r188583) @@ -33,7 +33,9 @@ PRECIOUSLIB= .include "${.CURDIR}/sys/Makefile.inc" .if ${DEFAULT_THREAD_LIB} == "libc_r" +.if ${MK_INSTALLLIB} != "no" SYMLINKS+=lib${LIB}.a ${LIBDIR}/libpthread.a +.endif .if !defined(NO_PIC) SYMLINKS+=lib${LIB}.so ${LIBDIR}/libpthread.so .endif Modified: head/lib/libkse/Makefile ============================================================================== --- head/lib/libkse/Makefile Fri Feb 13 16:17:05 2009 (r188582) +++ head/lib/libkse/Makefile Fri Feb 13 16:51:36 2009 (r188583) @@ -52,7 +52,9 @@ PRECIOUSLIB= .include "${.CURDIR}/thread/Makefile.inc" .if ${DEFAULT_THREAD_LIB} == "libkse" || ${MK_LIBTHR} == "no" +.if ${MK_INSTALLLIB} != "no" SYMLINKS+=lib${LIB}.a ${LIBDIR}/libpthread.a +.endif .if !defined(NO_PIC) SYMLINKS+=lib${LIB}.so ${LIBDIR}/libpthread.so .endif Modified: head/lib/libthr/Makefile ============================================================================== --- head/lib/libthr/Makefile Fri Feb 13 16:17:05 2009 (r188582) +++ head/lib/libthr/Makefile Fri Feb 13 16:51:36 2009 (r188583) @@ -44,7 +44,9 @@ PRECIOUSLIB= .include "${.CURDIR}/sys/Makefile.inc" .include "${.CURDIR}/thread/Makefile.inc" +.if ${MK_INSTALLLIB} != "no" SYMLINKS+=lib${LIB}.a ${LIBDIR}/libpthread.a +.endif .if !defined(NO_PIC) SYMLINKS+=lib${LIB}.so ${LIBDIR}/libpthread.so .endif From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 17:44:07 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B2CE01065676; Fri, 13 Feb 2009 17:44:07 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A1BA58FC13; Fri, 13 Feb 2009 17:44:07 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1DHi7c7094864; Fri, 13 Feb 2009 17:44:07 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1DHi7ov094863; Fri, 13 Feb 2009 17:44:07 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <200902131744.n1DHi7ov094863@svn.freebsd.org> From: Sean Bruno Date: Fri, 13 Feb 2009 17:44:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188584 - head/sys/dev/firewire X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Feb 2009 17:44:08 -0000 Author: sbruno Date: Fri Feb 13 17:44:07 2009 New Revision: 188584 URL: http://svn.freebsd.org/changeset/base/188584 Log: Remove redundant while () from loop. Submitted by: Ganbold Reviewed by: scottl Modified: head/sys/dev/firewire/fwohci.c Modified: head/sys/dev/firewire/fwohci.c ============================================================================== --- head/sys/dev/firewire/fwohci.c Fri Feb 13 16:51:36 2009 (r188583) +++ head/sys/dev/firewire/fwohci.c Fri Feb 13 17:44:07 2009 (r188584) @@ -2979,7 +2979,7 @@ err: db_tr = STAILQ_NEXT(db_tr, link); resCount = FWOHCI_DMA_READ(db_tr->db[0].db.desc.res) & OHCI_COUNT_MASK; - } while (resCount == 0) + } printf(" done\n"); dbch->top = db_tr; dbch->buf_offset = dbch->xferq.psize - resCount; From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 17:45:10 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3EB681065676; Fri, 13 Feb 2009 17:45:10 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 10D6C8FC0A; Fri, 13 Feb 2009 17:45:10 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1DHj9uC094925; Fri, 13 Feb 2009 17:45:09 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1DHj9uP094924; Fri, 13 Feb 2009 17:45:09 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <200902131745.n1DHj9uP094924@svn.freebsd.org> From: Sean Bruno Date: Fri, 13 Feb 2009 17:45:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188585 - head/sys/dev/firewire X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Feb 2009 17:45:12 -0000 Author: sbruno Date: Fri Feb 13 17:45:09 2009 New Revision: 188585 URL: http://svn.freebsd.org/changeset/base/188585 Log: Update the Self ID structure to conform to 1394a-2000. Delete the unused defines. Reviewed by: scottl Modified: head/sys/dev/firewire/firewire.h Modified: head/sys/dev/firewire/firewire.h ============================================================================== --- head/sys/dev/firewire/firewire.h Fri Feb 13 17:44:07 2009 (r188584) +++ head/sys/dev/firewire/firewire.h Fri Feb 13 17:45:09 2009 (r188585) @@ -284,6 +284,10 @@ struct fw_devlstreq { struct fw_devinfo dev[FW_MAX_DEVLST]; }; +/* + * Defined in IEEE 1394a-2000 + * 4.3.4.1 + */ #define FW_SELF_ID_PORT_CONNECTED_TO_CHILD 3 #define FW_SELF_ID_PORT_CONNECTED_TO_PARENT 2 #define FW_SELF_ID_PORT_NOT_CONNECTED 1 @@ -312,18 +316,32 @@ union fw_self_id { phy_id:6, sequel:1, sequence_num:3, - :2, - porta:2, - portb:2, - portc:2, - portd:2, - porte:2, - portf:2, - portg:2, - porth:2, - :1, + reserved2:2, + port3:2, + port4:2, + port5:2, + port6:2, + port7:2, + port8:2, + port9:2, + port10:2, + reserved1:1, more_packets:1; } p1; + struct { + uint32_t + id:2, + phy_id:6, + sequel:1, + sequence_num:3, + :2, + port11:2, + port12:2, + port13:2, + port14:2, + port15:2, + :8; + } p2; }; #else union fw_self_id { @@ -346,20 +364,34 @@ union fw_self_id { struct { uint32_t more_packets:1, reserved1:1, - porth:2, - portg:2, - portf:2, - porte:2, - portd:2, - portc:2, - portb:2, - porta:2, + port10:2, + port9:2, + port8:2, + port7:2, + port6:2, + port5:2, + port4:2, + port3:2, reserved2:2, sequence_num:3, sequel:1, phy_id:6, id:2; } p1; + struct { + uint32_t + reserved3:8, + port15:2, + port14:2, + port13:2, + port12:2, + port11:2, + reserved4:2, + sequence_num:3, + sequel:1, + phy_id:6, + id:2; + } p2; }; #endif From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 18:18:14 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B89AD106566C; Fri, 13 Feb 2009 18:18:14 +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 A49B48FC17; Fri, 13 Feb 2009 18:18:14 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1DIIEC5095661; Fri, 13 Feb 2009 18:18:14 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1DIIEll095652; Fri, 13 Feb 2009 18:18:14 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200902131818.n1DIIEll095652@svn.freebsd.org> From: John Baldwin Date: Fri, 13 Feb 2009 18:18:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188588 - in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs compat/linux compat/svr4 fs/coda i386/ibcs2 kern nfsserver X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Feb 2009 18:18:15 -0000 Author: jhb Date: Fri Feb 13 18:18:14 2009 New Revision: 188588 URL: http://svn.freebsd.org/changeset/base/188588 Log: Use shared vnode locks when invoking VOP_READDIR(). MFC after: 1 month Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c head/sys/compat/linux/linux_file.c head/sys/compat/linux/linux_getcwd.c head/sys/compat/svr4/svr4_misc.c head/sys/fs/coda/coda_vnops.c head/sys/i386/ibcs2/ibcs2_misc.c head/sys/kern/vfs_syscalls.c head/sys/nfsserver/nfs_serv.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Fri Feb 13 18:09:38 2009 (r188587) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Fri Feb 13 18:18:14 2009 (r188588) @@ -4697,8 +4697,8 @@ vop_listextattr { return (error); } - NDINIT_ATVP(&nd, LOOKUP, NOFOLLOW | LOCKLEAF | MPSAFE, UIO_SYSSPACE, - ".", xvp, td); + NDINIT_ATVP(&nd, LOOKUP, NOFOLLOW | LOCKLEAF | LOCKSHARED | MPSAFE, + UIO_SYSSPACE, ".", xvp, td); error = namei(&nd); vp = nd.ni_vp; NDFREE(&nd, NDF_ONLY_PNBUF); Modified: head/sys/compat/linux/linux_file.c ============================================================================== --- head/sys/compat/linux/linux_file.c Fri Feb 13 18:09:38 2009 (r188587) +++ head/sys/compat/linux/linux_file.c Fri Feb 13 18:18:14 2009 (r188588) @@ -372,7 +372,7 @@ getdents_common(struct thread *td, struc buflen = min(buflen, MAXBSIZE); buf = malloc(buflen, M_TEMP, M_WAITOK); lbuf = malloc(LINUX_MAXRECLEN, M_TEMP, M_WAITOK | M_ZERO); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + vn_lock(vp, LK_SHARED | LK_RETRY); again: aiov.iov_base = buf; Modified: head/sys/compat/linux/linux_getcwd.c ============================================================================== --- head/sys/compat/linux/linux_getcwd.c Fri Feb 13 18:09:38 2009 (r188587) +++ head/sys/compat/linux/linux_getcwd.c Fri Feb 13 18:18:14 2009 (r188588) @@ -163,7 +163,7 @@ linux_getcwd_scandir(lvpp, uvpp, bpp, bu cn.cn_nameptr = ".."; cn.cn_namelen = 2; cn.cn_consume = 0; - cn.cn_lkflags = LK_EXCLUSIVE; + cn.cn_lkflags = LK_SHARED; /* * At this point, lvp is locked and will be unlocked by the lookup. Modified: head/sys/compat/svr4/svr4_misc.c ============================================================================== --- head/sys/compat/svr4/svr4_misc.c Fri Feb 13 18:09:38 2009 (r188587) +++ head/sys/compat/svr4/svr4_misc.c Fri Feb 13 18:18:14 2009 (r188588) @@ -278,7 +278,7 @@ svr4_sys_getdents64(td, uap) buflen = max(DIRBLKSIZ, nbytes); buflen = min(buflen, MAXBSIZE); buf = malloc(buflen, M_TEMP, M_WAITOK); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + vn_lock(vp, LK_SHARED | LK_RETRY); again: aiov.iov_base = buf; aiov.iov_len = buflen; @@ -447,7 +447,7 @@ svr4_sys_getdents(td, uap) buflen = min(MAXBSIZE, uap->nbytes); buf = malloc(buflen, M_TEMP, M_WAITOK); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + vn_lock(vp, LK_SHARED | LK_RETRY); off = fp->f_offset; again: aiov.iov_base = buf; Modified: head/sys/fs/coda/coda_vnops.c ============================================================================== --- head/sys/fs/coda/coda_vnops.c Fri Feb 13 18:09:38 2009 (r188587) +++ head/sys/fs/coda/coda_vnops.c Fri Feb 13 18:18:14 2009 (r188588) @@ -1506,7 +1506,7 @@ coda_readdir(struct vop_readdir_args *ap */ CODADEBUG(CODA_READDIR, myprintf(("indirect readdir: fid = %s, " "refcnt = %d\n", coda_f2s(&cp->c_fid), vp->v_usecount));); - vn_lock(cp->c_ovp, LK_EXCLUSIVE | LK_RETRY); + vn_lock(cp->c_ovp, LK_SHARED | LK_RETRY); error = VOP_READDIR(cp->c_ovp, uiop, cred, eofflag, ncookies, cookies); VOP_UNLOCK(cp->c_ovp, 0); Modified: head/sys/i386/ibcs2/ibcs2_misc.c ============================================================================== --- head/sys/i386/ibcs2/ibcs2_misc.c Fri Feb 13 18:09:38 2009 (r188587) +++ head/sys/i386/ibcs2/ibcs2_misc.c Fri Feb 13 18:18:14 2009 (r188588) @@ -356,7 +356,7 @@ ibcs2_getdents(td, uap) buflen = max(DIRBLKSIZ, uap->nbytes); buflen = min(buflen, MAXBSIZE); buf = malloc(buflen, M_TEMP, M_WAITOK); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + vn_lock(vp, LK_SHARED | LK_RETRY); again: aiov.iov_base = buf; aiov.iov_len = buflen; @@ -518,7 +518,7 @@ ibcs2_read(td, uap) buflen = max(DIRBLKSIZ, uap->nbytes); buflen = min(buflen, MAXBSIZE); buf = malloc(buflen, M_TEMP, M_WAITOK); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + vn_lock(vp, LK_SHARED | LK_RETRY); again: aiov.iov_base = buf; aiov.iov_len = buflen; Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Fri Feb 13 18:09:38 2009 (r188587) +++ head/sys/kern/vfs_syscalls.c Fri Feb 13 18:18:14 2009 (r188588) @@ -3936,7 +3936,7 @@ unionread: auio.uio_segflg = UIO_USERSPACE; auio.uio_td = td; auio.uio_resid = uap->count; - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + vn_lock(vp, LK_SHARED | LK_RETRY); loff = auio.uio_offset = fp->f_offset; #ifdef MAC error = mac_vnode_check_readdir(td->td_ucred, vp); @@ -4095,8 +4095,7 @@ unionread: auio.uio_segflg = UIO_USERSPACE; auio.uio_td = td; auio.uio_resid = count; - /* vn_lock(vp, LK_SHARED | LK_RETRY); */ - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + vn_lock(vp, LK_SHARED | LK_RETRY); AUDIT_ARG(vnode, vp, ARG_VNODE1); loff = auio.uio_offset = fp->f_offset; #ifdef MAC Modified: head/sys/nfsserver/nfs_serv.c ============================================================================== --- head/sys/nfsserver/nfs_serv.c Fri Feb 13 18:09:38 2009 (r188587) +++ head/sys/nfsserver/nfs_serv.c Fri Feb 13 18:18:14 2009 (r188588) @@ -3251,7 +3251,7 @@ again: io.uio_rw = UIO_READ; io.uio_td = NULL; eofflag = 0; - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + vn_lock(vp, LK_SHARED | LK_RETRY); if (cookies) { free((caddr_t)cookies, M_TEMP); cookies = NULL; @@ -3533,7 +3533,7 @@ again: io.uio_rw = UIO_READ; io.uio_td = NULL; eofflag = 0; - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + vn_lock(vp, LK_SHARED | LK_RETRY); if (cookies) { free((caddr_t)cookies, M_TEMP); cookies = NULL; From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 18:44:30 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B01BB106566B; Fri, 13 Feb 2009 18:44:30 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9350D8FC0A; Fri, 13 Feb 2009 18:44:30 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1DIiUl4096226; Fri, 13 Feb 2009 18:44:30 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1DIiUNg096224; Fri, 13 Feb 2009 18:44:30 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <200902131844.n1DIiUNg096224@svn.freebsd.org> From: Randall Stewart Date: Fri, 13 Feb 2009 18:44:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188590 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Feb 2009 18:44:31 -0000 Author: rrs Date: Fri Feb 13 18:44:30 2009 New Revision: 188590 URL: http://svn.freebsd.org/changeset/base/188590 Log: Have the jail code use the error returned to pass not constant errors. Obtained from: jamie@freebsd.org Modified: head/sys/netinet/sctp_pcb.c head/sys/netinet/sctp_usrreq.c Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Fri Feb 13 18:31:35 2009 (r188589) +++ head/sys/netinet/sctp_pcb.c Fri Feb 13 18:44:30 2009 (r188590) @@ -2649,9 +2649,9 @@ sctp_inpcb_bind(struct socket *so, struc * will transmute the ip address to the * proper value. */ - if (p && prison_local_ip4(p->td_ucred, &sin->sin_addr) != 0) { - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_PCB, EINVAL); - return (EINVAL); + if (p && (error = prison_local_ip4(p->td_ucred, &sin->sin_addr)) != 0) { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_PCB, error); + return (error); } if (sin->sin_addr.s_addr != INADDR_ANY) { bindall = 0; @@ -2680,10 +2680,10 @@ sctp_inpcb_bind(struct socket *so, struc * will transmute the ipv6 address to the * proper value. */ - if (p && prison_local_ip6(p->td_ucred, &sin6->sin6_addr, - (SCTP_IPV6_V6ONLY(inp) != 0)) != 0) { - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_PCB, EINVAL); - return (EINVAL); + if (p && (error = prison_local_ip6(p->td_ucred, &sin6->sin6_addr, + (SCTP_IPV6_V6ONLY(inp) != 0))) != 0) { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_PCB, error); + return (error); } if (!IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) { bindall = 0; Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Fri Feb 13 18:31:35 2009 (r188589) +++ head/sys/netinet/sctp_usrreq.c Fri Feb 13 18:44:30 2009 (r188590) @@ -4088,9 +4088,8 @@ sctp_setopt(struct socket *so, int optna error = EINVAL; break; } - if (td != NULL && prison_local_ip4(td->td_ucred, &(((struct sockaddr_in *)(addrs->addr))->sin_addr))) { - SCTP_LTRACE_ERR_RET(inp, stcb, NULL, SCTP_FROM_SCTP_USRREQ, EADDRNOTAVAIL); - error = EADDRNOTAVAIL; + if (td != NULL && (error = prison_local_ip4(td->td_ucred, &(((struct sockaddr_in *)(addrs->addr))->sin_addr)))) { + SCTP_LTRACE_ERR_RET(inp, stcb, NULL, SCTP_FROM_SCTP_USRREQ, error); break; } #ifdef INET6 @@ -4101,10 +4100,9 @@ sctp_setopt(struct socket *so, int optna error = EINVAL; break; } - if (td != NULL && prison_local_ip6(td->td_ucred, &(((struct sockaddr_in6 *)(addrs->addr))->sin6_addr), - (SCTP_IPV6_V6ONLY(inp) != 0)) != 0) { - SCTP_LTRACE_ERR_RET(inp, stcb, NULL, SCTP_FROM_SCTP_USRREQ, EADDRNOTAVAIL); - error = EADDRNOTAVAIL; + if (td != NULL && (error = prison_local_ip6(td->td_ucred, &(((struct sockaddr_in6 *)(addrs->addr))->sin6_addr), + (SCTP_IPV6_V6ONLY(inp) != 0))) != 0) { + SCTP_LTRACE_ERR_RET(inp, stcb, NULL, SCTP_FROM_SCTP_USRREQ, error); break; } #endif @@ -4133,9 +4131,8 @@ sctp_setopt(struct socket *so, int optna error = EINVAL; break; } - if (td != NULL && prison_local_ip4(td->td_ucred, &(((struct sockaddr_in *)(addrs->addr))->sin_addr))) { - SCTP_LTRACE_ERR_RET(inp, stcb, NULL, SCTP_FROM_SCTP_USRREQ, EADDRNOTAVAIL); - error = EADDRNOTAVAIL; + if (td != NULL && (error = prison_local_ip4(td->td_ucred, &(((struct sockaddr_in *)(addrs->addr))->sin_addr)))) { + SCTP_LTRACE_ERR_RET(inp, stcb, NULL, SCTP_FROM_SCTP_USRREQ, error); break; } #ifdef INET6 @@ -4146,10 +4143,9 @@ sctp_setopt(struct socket *so, int optna error = EINVAL; break; } - if (td != NULL && prison_local_ip6(td->td_ucred, &(((struct sockaddr_in6 *)(addrs->addr))->sin6_addr), - (SCTP_IPV6_V6ONLY(inp) != 0)) != 0) { - SCTP_LTRACE_ERR_RET(inp, stcb, NULL, SCTP_FROM_SCTP_USRREQ, EADDRNOTAVAIL); - error = EADDRNOTAVAIL; + if (td != NULL && (error = prison_local_ip6(td->td_ucred, &(((struct sockaddr_in6 *)(addrs->addr))->sin6_addr), + (SCTP_IPV6_V6ONLY(inp) != 0))) != 0) { + SCTP_LTRACE_ERR_RET(inp, stcb, NULL, SCTP_FROM_SCTP_USRREQ, error); break; } #endif @@ -4256,9 +4252,9 @@ sctp_connect(struct socket *so, struct s return (EINVAL); } sin6p = (struct sockaddr_in6 *)addr; - if (p != NULL && prison_remote_ip6(p->td_ucred, &sin6p->sin6_addr) != 0) { - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); - return (EINVAL); + if (p != NULL && (error = prison_remote_ip6(p->td_ucred, &sin6p->sin6_addr)) != 0) { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, error); + return (error); } } else #endif @@ -4270,9 +4266,9 @@ sctp_connect(struct socket *so, struct s return (EINVAL); } sinp = (struct sockaddr_in *)addr; - if (p != NULL && prison_remote_ip4(p->td_ucred, &sinp->sin_addr) != 0) { - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); - return (EINVAL); + if (p != NULL && (error = prison_remote_ip4(p->td_ucred, &sinp->sin_addr)) != 0) { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, error); + return (error); } } else { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EAFNOSUPPORT); From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 18:45:37 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 442D510656C5; Fri, 13 Feb 2009 18:45:37 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 326668FC0C; Fri, 13 Feb 2009 18:45:37 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1DIjbNk096286; Fri, 13 Feb 2009 18:45:37 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1DIjb4i096285; Fri, 13 Feb 2009 18:45:37 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200902131845.n1DIjb4i096285@svn.freebsd.org> From: Andrew Thompson Date: Fri, 13 Feb 2009 18:45:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188591 - head/sys/dev/usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Feb 2009 18:45:37 -0000 Author: thompsa Date: Fri Feb 13 18:45:36 2009 New Revision: 188591 URL: http://svn.freebsd.org/changeset/base/188591 Log: Add the Novatel U760. Modified: head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Fri Feb 13 18:44:30 2009 (r188590) +++ head/sys/dev/usb/usbdevs Fri Feb 13 18:45:36 2009 (r188591) @@ -1866,6 +1866,8 @@ product NOVATEL U720 0x2110 Merlin U720 product NOVATEL U727 0x4100 Merlin U727 CDMA product NOVATEL MC950D 0x4400 Novatel MC950D HSUPA product NOVATEL ZEROCD 0x5010 Novatel ZeroCD +product NOVATEL ZEROCD2 0x5030 Novatel ZeroCD +product NOVATEL U760 0x6000 Novatel U760 product NOVATEL2 FLEXPACKGPS 0x0100 NovAtel FlexPack GPS receiver /* Merlin products */ From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 18:51:40 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D74B1065705; Fri, 13 Feb 2009 18:51:40 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0B3678FC19; Fri, 13 Feb 2009 18:51:40 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1DIpdV0096419; Fri, 13 Feb 2009 18:51:39 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1DIpdC9096418; Fri, 13 Feb 2009 18:51:39 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200902131851.n1DIpdC9096418@svn.freebsd.org> From: Andrew Thompson Date: Fri, 13 Feb 2009 18:51:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188592 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Feb 2009 18:51:41 -0000 Author: thompsa Date: Fri Feb 13 18:51:39 2009 New Revision: 188592 URL: http://svn.freebsd.org/changeset/base/188592 Log: Remove semicolon left in the last commit Spotted by: csjp Modified: head/sys/kern/subr_taskqueue.c Modified: head/sys/kern/subr_taskqueue.c ============================================================================== --- head/sys/kern/subr_taskqueue.c Fri Feb 13 18:45:36 2009 (r188591) +++ head/sys/kern/subr_taskqueue.c Fri Feb 13 18:51:39 2009 (r188592) @@ -402,7 +402,7 @@ taskqueue_thread_loop(void *arg) while ((tq->tq_flags & TQ_FLAGS_ACTIVE) != 0) { taskqueue_run(tq); TQ_SLEEP(tq, tq, &tq->tq_mutex, 0, "-", 0); - }; + } /* rendezvous with thread that asked us to terminate */ tq->tq_tcount--; From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 19:20:25 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 920931065670; Fri, 13 Feb 2009 19:20:25 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 806BA8FC21; Fri, 13 Feb 2009 19:20:25 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1DJKPMd097105; Fri, 13 Feb 2009 19:20:25 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1DJKPIg097104; Fri, 13 Feb 2009 19:20:25 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200902131920.n1DJKPIg097104@svn.freebsd.org> From: Andrew Thompson Date: Fri, 13 Feb 2009 19:20:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188594 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Feb 2009 19:20:26 -0000 Author: thompsa Date: Fri Feb 13 19:20:25 2009 New Revision: 188594 URL: http://svn.freebsd.org/changeset/base/188594 Log: bridge_delete_member is called via the event handler from if_detach after the LLADDR is reclaimed which causes a null pointer deref with inherit_mac enabled. Record the ifnet pointer of the interface and then compare that to find when to re-assign the bridge address. Submitted by: sam Modified: head/sys/net/if_bridge.c Modified: head/sys/net/if_bridge.c ============================================================================== --- head/sys/net/if_bridge.c Fri Feb 13 19:16:15 2009 (r188593) +++ head/sys/net/if_bridge.c Fri Feb 13 19:20:25 2009 (r188594) @@ -220,6 +220,7 @@ struct bridge_softc { LIST_HEAD(, bridge_iflist) sc_spanlist; /* span ports list */ struct bstp_state sc_stp; /* STP state */ uint32_t sc_brtexceeded; /* # of cache drops */ + struct ifnet *sc_ifaddr; /* member mac copied from */ u_char sc_defaddr[6]; /* Default MAC address */ }; @@ -930,15 +931,16 @@ bridge_delete_member(struct bridge_softc * the mac address of the bridge to the address of the next member, or * to its default address if no members are left. */ - if (bridge_inherit_mac && - !memcmp(IF_LLADDR(sc->sc_ifp), IF_LLADDR(ifs), ETHER_ADDR_LEN)) { - if (LIST_EMPTY(&sc->sc_iflist)) + if (bridge_inherit_mac && sc->sc_ifaddr == ifs) { + if (LIST_EMPTY(&sc->sc_iflist)) { bcopy(sc->sc_defaddr, IF_LLADDR(sc->sc_ifp), ETHER_ADDR_LEN); - else { + sc->sc_ifaddr = NULL; + } else { fif = LIST_FIRST(&sc->sc_iflist)->bif_ifp; bcopy(IF_LLADDR(fif), IF_LLADDR(sc->sc_ifp), ETHER_ADDR_LEN); + sc->sc_ifaddr = fif; } } @@ -1039,8 +1041,10 @@ bridge_ioctl_add(struct bridge_softc *sc * the default randomly generated one. */ if (bridge_inherit_mac && LIST_EMPTY(&sc->sc_iflist) && - !memcmp(IF_LLADDR(sc->sc_ifp), sc->sc_defaddr, ETHER_ADDR_LEN)) + !memcmp(IF_LLADDR(sc->sc_ifp), sc->sc_defaddr, ETHER_ADDR_LEN)) { bcopy(IF_LLADDR(ifs), IF_LLADDR(sc->sc_ifp), ETHER_ADDR_LEN); + sc->sc_ifaddr = ifs; + } ifs->if_bridge = sc; bstp_create(&sc->sc_stp, &bif->bif_stp, bif->bif_ifp); From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 19:49:51 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DA1F0106567B; Fri, 13 Feb 2009 19:49:51 +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 C07BF8FC22; Fri, 13 Feb 2009 19:49:51 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1DJnpkk097746; Fri, 13 Feb 2009 19:49:51 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 n1DJnprm097744; Fri, 13 Feb 2009 19:49:51 GMT (envelope-from n_hibma@svn.freebsd.org) Message-Id: <200902131949.n1DJnprm097744@svn.freebsd.org> From: Nick Hibma Date: Fri, 13 Feb 2009 19:49:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188597 - head/sys/dev/usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Feb 2009 19:49:53 -0000 Author: n_hibma Date: Fri Feb 13 19:49:51 2009 New Revision: 188597 URL: http://svn.freebsd.org/changeset/base/188597 Log: Add support for CMOTECH devices (not sure whether this is the correct name) (not sure whether this works correctly, but should be close). Fix the stub attach phase for some Novatel cards. They expect the CSW (repsonse to CBW, SCSI eject command) to be fetched before switching to modem mode. MFC after: 2 weeks Modified: head/sys/dev/usb/u3g.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/u3g.c ============================================================================== --- head/sys/dev/usb/u3g.c Fri Feb 13 19:49:35 2009 (r188596) +++ head/sys/dev/usb/u3g.c Fri Feb 13 19:49:51 2009 (r188597) @@ -87,25 +87,25 @@ struct ucom_callback u3g_callback = { struct u3g_speeds_s { - u_int32_t ispeed; // Speed in bits per second - u_int32_t ospeed; // Speed in bits per second + u_int32_t ispeed; + u_int32_t ospeed; }; static const struct u3g_speeds_s u3g_speeds[] = { -#define U3GSP_GPRS 0 - {64000, 64000}, -#define U3GSP_EDGE 1 - {384000, 64000}, -#define U3GSP_CDMA 2 - {384000, 64000}, -#define U3GSP_UMTS 3 - {384000, 64000}, -#define U3GSP_HSDPA 4 - {1200000, 384000}, -#define U3GSP_HSUPA 5 - {1200000, 384000}, -#define U3GSP_HSPA 6 - {7200000, 384000}, +#define U3GSP_GPRS 0 + {64000, 64000}, +#define U3GSP_EDGE 1 + {384000, 64000}, +#define U3GSP_CDMA 2 + {384000, 64000}, +#define U3GSP_UMTS 3 + {384000, 64000}, +#define U3GSP_HSDPA 4 + {1200000, 384000}, +#define U3GSP_HSUPA 5 + {1200000, 384000}, +#define U3GSP_HSPA 6 + {7200000, 384000}, }; #define U3GIBUFSIZE 1024 @@ -122,7 +122,8 @@ struct u3g_dev_type_s { #define U3GFL_HUAWEI_INIT 0x01 // Requires init command (Huawei cards) #define U3GFL_SCSI_EJECT 0x02 // Requires SCSI eject command (Novatel) #define U3GFL_SIERRA_INIT 0x04 // Requires init command (Sierra cards) -#define U3GFL_STUB_WAIT 0x08 // Device reappears after a short delay +#define U3GFL_CMOTECH_INIT 0x08 // Requires init command (CMOTECH cards) +#define U3GFL_STUB_WAIT 0x80 // Device reappears after a short delay }; // Note: The entries marked with XXX should be checked for the correct speed @@ -184,10 +185,13 @@ static const struct u3g_dev_type_s u3g_d {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_MC8765 }, U3GSP_UMTS, U3GFL_NONE }, // XXX {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_AC875U }, U3GSP_UMTS, U3GFL_NONE }, // XXX {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_MC8775_2 }, U3GSP_HSDPA, U3GFL_NONE }, // XXX - {{ USB_VENDOR_HP, USB_PRODUCT_HP_HS2300 }, U3GSP_HSDPA, U3GFL_NONE }, // XXX {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_MC8780 }, U3GSP_UMTS, U3GFL_NONE }, // XXX {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_MC8781 }, U3GSP_UMTS, U3GFL_NONE }, // XXX - {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_TRUINSTALL }, U3GSP_UMTS, U3GFL_SIERRA_INIT }, // Sierra TruInstaller device ID + {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_TRUINSTALL }, U3GSP_UMTS, U3GFL_SIERRA_INIT }, + {{ USB_VENDOR_HP, USB_PRODUCT_HP_HS2300 }, U3GSP_HSDPA, U3GFL_NONE }, + /* OEM: CMOTECH */ + {{ USB_VENDOR_CMOTECH, USB_PRODUCT_CMOTECH_CGU628 }, U3GSP_HSDPA, U3GFL_CMOTECH_INIT }, + {{ USB_VENDOR_CMOTECH, USB_PRODUCT_CMOTECH_DISK }, U3GSP_HSDPA, U3GFL_NONE }, }; #define u3g_lookup(v, p) ((const struct u3g_dev_type_s *)usb_lookup(u3g_devs, v, p)) @@ -437,7 +441,7 @@ MODULE_VERSION(u3g, 1); struct u3gstub_softc { device_t sc_dev; usbd_device_handle sc_udev; - usbd_pipe_handle sc_pipe; + usbd_pipe_handle sc_pipe_out, sc_pipe_in; usbd_xfer_handle sc_xfer; }; @@ -457,6 +461,25 @@ u3gstub_huawei_init(struct u3gstub_softc return 1; } +static void +u3gstub_BBB_cb(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status err) +{ + struct u3gstub_softc *sc = (struct u3gstub_softc *) priv; + unsigned char cmd[13]; + + if (err) { + device_printf(sc->sc_dev, + "Failed to send CD eject command to " + "change to modem mode\n"); + } else { + usbd_setup_xfer(sc->sc_xfer, sc->sc_pipe_in, NULL, cmd, sizeof(cmd), + 0, USBD_DEFAULT_TIMEOUT, NULL); + int err = usbd_transfer(sc->sc_xfer) != USBD_NORMAL_COMPLETION; + if (err != USBD_NORMAL_COMPLETION && err != USBD_IN_PROGRESS) + DPRINTF("failed to start transfer (CSW)\n"); + } +} + static int u3gstub_scsi_eject(struct u3gstub_softc *sc, struct usb_attach_arg *uaa) { @@ -467,7 +490,7 @@ u3gstub_scsi_eject(struct u3gstub_softc 0x55, 0x53, 0x42, 0x43, /* 0..3: Command Block Wrapper (CBW) signature */ 0x01, 0x00, 0x00, 0x00, /* 4..7: CBW Tag, unique 32-bit number */ 0x00, 0x00, 0x00, 0x00, /* 8..11: CBW Transfer Length, no data here */ - 0x00, /* 12: CBW Flag: output, so 0 */ + 0x00, /* 12: CBW Flag: output */ 0x00, /* 13: CBW Lun */ 0x06, /* 14: CBW Length */ @@ -488,11 +511,33 @@ u3gstub_scsi_eject(struct u3gstub_softc /* Find the bulk-out endpoints */ id = usbd_get_interface_descriptor(uaa->iface); - for (i = 0 ; i < id->bNumEndpoints ; i++) { + for (i = 0 ; i < id->bNumEndpoints; i++) { ed = usbd_interface2endpoint_descriptor(uaa->iface, i); if (ed != NULL - && UE_GET_DIR(ed->bEndpointAddress) == UE_DIR_OUT - && (ed->bmAttributes & UE_XFERTYPE) == UE_BULK) + && (ed->bmAttributes & UE_XFERTYPE) == UE_BULK) { + if (UE_GET_DIR(ed->bEndpointAddress) == UE_DIR_OUT) { + if (usbd_open_pipe(uaa->iface, + ed->bEndpointAddress, + USBD_EXCLUSIVE_USE, + &sc->sc_pipe_out) + != USBD_NORMAL_COMPLETION) { + DPRINTF("failed to open bulk-out pipe on endpoint %d\n", + ed->bEndpointAddress); + return 0; + } + } else { + if (usbd_open_pipe(uaa->iface, + ed->bEndpointAddress, + USBD_EXCLUSIVE_USE, + &sc->sc_pipe_in) + != USBD_NORMAL_COMPLETION) { + DPRINTF("failed to open bulk-in pipe on endpoint %d\n", + ed->bEndpointAddress); + return 0; + } + } + } + if (sc->sc_pipe_out && sc->sc_pipe_in) break; } @@ -501,10 +546,88 @@ u3gstub_scsi_eject(struct u3gstub_softc return 0; } - if (usbd_open_pipe(uaa->iface, ed->bEndpointAddress, - USBD_EXCLUSIVE_USE, &sc->sc_pipe) != USBD_NORMAL_COMPLETION) { - DPRINTF("failed to open bulk-out pipe on endpoint %d\n", - ed->bEndpointAddress); + sc->sc_xfer = usbd_alloc_xfer(uaa->device); + if (sc->sc_xfer == NULL) { + DPRINTF("failed to allocate xfer\n"); + return 0; + } + + usbd_setup_xfer(sc->sc_xfer, sc->sc_pipe_out, NULL, cmd, sizeof(cmd), + 0, USBD_DEFAULT_TIMEOUT, u3gstub_BBB_cb); + int err = usbd_transfer(sc->sc_xfer) != USBD_NORMAL_COMPLETION; + if (err != USBD_NORMAL_COMPLETION && err != USBD_IN_PROGRESS) { + DPRINTF("failed to start transfer (CBW)\n"); + return 0; + } + + return 1; +} + +static int +u3gstub_cmotech_init(struct u3gstub_softc *sc, struct usb_attach_arg *uaa) +{ + /* See definition of umass_bbb_cbw_t in sys/dev/usb/umass.c + * in sys/cam/scsi/scsi_all.h . + */ + unsigned char cmd[31] = { + 0x55, 0x53, 0x42, 0x43, /* 0..3: Command Block Wrapper (CBW) signature */ + 0x01, 0x00, 0x00, 0x00, /* 4..7: CBW Tag, unique 32-bit number */ + 0x00, 0x00, 0x00, 0x00, /* 8..11: CBW Transfer Length, no data here */ + 0x80, /* 12: CBW Flag: output, so 0 */ + 0x00, /* 13: CBW Lun */ + 0x08, /* 14: CBW Length */ + + 0xff, /* 15+0 */ + 0x52, /* 15+1 */ + 0x44, /* 15+2 */ + 0x45, /* 15+2 */ + 0x56, /* 15+4 */ + 0x43, /* 15+5 */ + 0x48, /* 15+5 */ + 0x47, /* 15+5 */ + 0x00, 0x00, 0x00, 0x00, /* 15+8..15: unused */ + 0x00, 0x00, 0x00, 0x00 + }; + + usb_interface_descriptor_t *id; + usb_endpoint_descriptor_t *ed = NULL; + int i; + + + /* Find the bulk-out endpoints */ + id = usbd_get_interface_descriptor(uaa->iface); + for (i = 0 ; i < id->bNumEndpoints ; i++) { + ed = usbd_interface2endpoint_descriptor(uaa->iface, i); + if (ed != NULL + && (ed->bmAttributes & UE_XFERTYPE) == UE_BULK) { + if (UE_GET_DIR(ed->bEndpointAddress) == UE_DIR_OUT) { + if (usbd_open_pipe(uaa->iface, + ed->bEndpointAddress, + USBD_EXCLUSIVE_USE, + &sc->sc_pipe_out) + != USBD_NORMAL_COMPLETION) { + DPRINTF("failed to open bulk-out pipe on endpoint %d\n", + ed->bEndpointAddress); + return 0; + } + } else { + if (usbd_open_pipe(uaa->iface, + ed->bEndpointAddress, + USBD_EXCLUSIVE_USE, + &sc->sc_pipe_in) + != USBD_NORMAL_COMPLETION) { + DPRINTF("failed to open bulk-in pipe on endpoint %d\n", + ed->bEndpointAddress); + return 0; + } + } + } + if (sc->sc_pipe_out && sc->sc_pipe_in) + break; + } + + if (i == id->bNumEndpoints) { + DPRINTF("failed to find bulk-out pipe\n"); return 0; } @@ -514,11 +637,11 @@ u3gstub_scsi_eject(struct u3gstub_softc return 0; } - usbd_setup_xfer(sc->sc_xfer, sc->sc_pipe, NULL, cmd, sizeof(cmd), - 0, USBD_DEFAULT_TIMEOUT, NULL); + usbd_setup_xfer(sc->sc_xfer, sc->sc_pipe_out, NULL, cmd, sizeof(cmd), + 0, USBD_DEFAULT_TIMEOUT, u3gstub_BBB_cb); int err = usbd_transfer(sc->sc_xfer) != USBD_NORMAL_COMPLETION; if (err != USBD_NORMAL_COMPLETION && err != USBD_IN_PROGRESS) { - DPRINTF("failed to start transfer\n"); + DPRINTF("failed to start transfer (CBW)\n"); return 0; } @@ -563,6 +686,7 @@ u3gstub_match(device_t self) if (u3g_dev_type->flags&U3GFL_HUAWEI_INIT || u3g_dev_type->flags&U3GFL_SCSI_EJECT || u3g_dev_type->flags&U3GFL_SIERRA_INIT + || u3g_dev_type->flags&U3GFL_CMOTECH_INIT || u3g_dev_type->flags&U3GFL_STUB_WAIT) { /* We assume that if the first interface is still a mass * storage device the device has not yet changed appearance. @@ -620,6 +744,12 @@ u3gstub_attach(device_t self) "changing Sierra modem to modem mode\n"); if (!u3gstub_sierra_init(sc, uaa)) return ENXIO; + } else if (u3g_dev_type->flags&U3GFL_CMOTECH_INIT) { + if (bootverbose) + device_printf(sc->sc_dev, + "changing CMOTECH modem to modem mode\n"); + if (!u3gstub_cmotech_init(sc, uaa)) + return ENXIO; } else if (u3g_dev_type->flags&U3GFL_STUB_WAIT) { if (bootverbose) device_printf(sc->sc_dev, "waiting for modem to change " @@ -638,9 +768,13 @@ u3gstub_detach(device_t self) if (sc->sc_xfer) usbd_free_xfer(sc->sc_xfer); - if (sc->sc_pipe) { - usbd_abort_pipe(sc->sc_pipe); - usbd_close_pipe(sc->sc_pipe); + if (sc->sc_pipe_in) { + usbd_abort_pipe(sc->sc_pipe_in); + usbd_close_pipe(sc->sc_pipe_in); + } + if (sc->sc_pipe_out) { + usbd_abort_pipe(sc->sc_pipe_out); + usbd_close_pipe(sc->sc_pipe_out); } return 0; Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Fri Feb 13 19:49:35 2009 (r188596) +++ head/sys/dev/usb/usbdevs Fri Feb 13 19:49:51 2009 (r188597) @@ -613,7 +613,7 @@ vendor GIGASET 0x1690 Gigaset vendor GLOBALSUN 0x16ab Global Sun Technology vendor ANYDATA 0x16d5 AnyDATA Corporation vendor JABLOTRON 0x16d6 Jablotron -vendor CMOTECH 0x16d8 CMOTECH Co., Ltd. +vendor CMOTECH 0x16d8 C-motech vendor AXESSTEL 0x1726 Axesstel Co., Ltd. vendor LINKSYS4 0x1737 Linksys vendor SENAO 0x1740 Senao @@ -1030,9 +1030,11 @@ product CISCOLINKSYS WUSB54GR 0x0023 WUS product CISCOLINKSYS WUSBF54G 0x0024 WUSBF54G /* CMOTECH products */ -product CMOTECH CNU510 0x5141 CMOTECH CDMA Technologies USB modem +product CMOTECH CNU510 0x5141 CDMA Technologies USB modem product CMOTECH CNU550 0x5543 CDMA 2000 1xRTT/1xEVDO USB modem -product CMOTECH CDMA_MODEM1 0x6280 CMOTECH CDMA Technologies USB modem +product CMOTECH CGU628 0x6006 CGU-628 +product CMOTECH CDMA_MODEM1 0x6280 CDMA Technologies USB modem +product CMOTECH DISK 0xf000 disk mode /* Compaq products */ product COMPAQ IPAQPOCKETPC 0x0003 iPAQ PocketPC From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 20:09:12 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 41D7C106566C; Fri, 13 Feb 2009 20:09:12 +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 0006C8FC2A; Fri, 13 Feb 2009 20:09:11 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1DK9BOl098182; Fri, 13 Feb 2009 20:09:11 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 n1DK9BgE098181; Fri, 13 Feb 2009 20:09:11 GMT (envelope-from n_hibma@svn.freebsd.org) Message-Id: <200902132009.n1DK9BgE098181@svn.freebsd.org> From: Nick Hibma Date: Fri, 13 Feb 2009 20:09:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188599 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Feb 2009 20:09:13 -0000 Author: n_hibma Date: Fri Feb 13 20:09:11 2009 New Revision: 188599 URL: http://svn.freebsd.org/changeset/base/188599 Log: Elaborate some on the workings of the stub. Collapse up the list of supported devices. Modified: head/share/man/man4/u3g.4 Modified: head/share/man/man4/u3g.4 ============================================================================== --- head/share/man/man4/u3g.4 Fri Feb 13 19:56:59 2009 (r188598) +++ head/share/man/man4/u3g.4 Fri Feb 13 20:09:11 2009 (r188599) @@ -56,50 +56,51 @@ driver supports the following adapters: .Pp .Bl -bullet -compact .It -Option Globetrotter 3G Fusion (only 3G part, not WLAN) +Option GT 3G Fusion, GT Fusion Quad, etc. (only 3G part, not WLAN) .It -Option Globetrotter 3G Fusion Quad (only 3G part, not WLAN) -.It -Option Globetrotter 3G Quad -.It -Option Globetrotter 3G +Option GT 3G, GT 3G Quad, etc. .It Vodafone Mobile Connect Card 3G .It Qualcomm Inc. CDMA MSM .It -Huawei E220 (E270?) +Huawei B190, E220 ('') .It -Huawei Mobile +Novatal U740, MC950D, X950D, etc. .It -Novatal MC950D -.It -Sierra cards +Sierra MC875U, MC8775U, etc. .El .Pp -See +(See .Pa /sys/dev/u3g.c for the complete list of supported cards for each vendor -mentioned above. +mentioned above.) .Pp -The supported 3G cards provide the necessary modem port for ppp, -pppd, or mpd connections as well as extra ports (depending on the specific -device) to provide other functions (diagnostic port, SIM toolkit port). +The supported 3G cards provide the necessary modem port for ppp, pppd, or mpd +connections as well as extra ports (depending on the specific device) to +provide other functions (additional command port, diagnostic port, SIM toolkit +port). .Pp In some of these devices a mass storage device supported by the .Xr umass 4 driver is present which contains Windows and Mac OS X drivers. -This device is -hidden, unless the machine was booted in verbose mode (see +The device starts up in disk mode (TruInstall, ZeroCD, etc.) and requires +additional commands to switch it to modem mode. +.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 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. -The -.Xr u3gstub 4 -device will attach temporarily and detach within seconds. .Sh SEE ALSO .Xr tty 4 , .Xr ucom 4 , From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 20:48:39 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D284106564A; Fri, 13 Feb 2009 20:48:39 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.freebsd.org (Postfix) with ESMTP id F16538FC13; Fri, 13 Feb 2009 20:48:38 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from phobos.local (71-218-27-233.hlrn.qwest.net [71.218.27.233]) (authenticated bits=0) by pooker.samsco.org (8.14.2/8.14.2) with ESMTP id n1DKmS2P074530; Fri, 13 Feb 2009 13:48:34 -0700 (MST) (envelope-from scottl@samsco.org) Message-ID: <4995DC9B.1030708@samsco.org> Date: Fri, 13 Feb 2009 13:48:27 -0700 From: Scott Long User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.13) Gecko/20080313 SeaMonkey/1.1.9 MIME-Version: 1.0 To: Attila Nagy References: <200902131004.n1DA4xol082999@svn.freebsd.org> <49958C73.2050406@fsn.hu> In-Reply-To: <49958C73.2050406@fsn.hu> X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.8 required=3.8 tests=AWL,BAYES_00,RCVD_IN_PBL autolearn=ham version=3.1.8 X-Spam-Checker-Version: SpamAssassin 3.1.8 (2007-02-13) on pooker.samsco.org Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Scott Long Subject: Re: svn commit: r188570 - head/sys/cam X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Feb 2009 20:48:40 -0000 Attila Nagy wrote: > Hello, > > Scott Long wrote: >> Author: scottl >> Date: Fri Feb 13 10:04:59 2009 >> New Revision: 188570 >> URL: http://svn.freebsd.org/changeset/base/188570 >> >> Log: >> In the case that the probe has determined that it can't query the >> device for >> a serial number, fall through to the next case so that initial >> negotiation >> still happens. Without this, devices were showing up with only 1 >> available >> tag opening, leading to observations of very poor I/O performance. >> This should fix problems reported with VMWare Fusion and ESX. Early >> generation MPT-SAS controllers with SATA disks might also be affected. >> HP CISS controllers are also likely affected, as are many other >> pseudo-scsi disk subsystems. >> > Is it possible that these two are related? > http://marc.info/?l=freebsd-scsi&m=122900270413265&w=2 > This is a bug in Domain Validation, introduced a couple of years ago, that I still haven't sorted out. Scott From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 20:57:43 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B447C106566C; Fri, 13 Feb 2009 20:57:43 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A17988FC0A; Fri, 13 Feb 2009 20:57:43 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1DKvhXo099140; Fri, 13 Feb 2009 20:57:43 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1DKvhdl099135; Fri, 13 Feb 2009 20:57:43 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200902132057.n1DKvhdl099135@svn.freebsd.org> From: Andrew Thompson Date: Fri, 13 Feb 2009 20:57:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188600 - head/sys/dev/usb2/core X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Feb 2009 20:57:45 -0000 Author: thompsa Date: Fri Feb 13 20:57:43 2009 New Revision: 188600 URL: http://svn.freebsd.org/changeset/base/188600 Log: MFp4 //depot/projects/usb; 157501, 157608, 157609 - Make usb2_transfer_pending() part of the USB core header file. - Make usb2_transfer_pending() NULL safe. - Make sure that USB process functions return if the process has been drained. - Remove two unused functions. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb2/core/usb2_core.h head/sys/dev/usb2/core/usb2_process.c head/sys/dev/usb2/core/usb2_process.h head/sys/dev/usb2/core/usb2_transfer.c head/sys/dev/usb2/core/usb2_transfer.h Modified: head/sys/dev/usb2/core/usb2_core.h ============================================================================== --- head/sys/dev/usb2/core/usb2_core.h Fri Feb 13 20:09:11 2009 (r188599) +++ head/sys/dev/usb2/core/usb2_core.h Fri Feb 13 20:57:43 2009 (r188600) @@ -449,6 +449,7 @@ void usb2_start_hardware(struct usb2_xfe void usb2_transfer_clear_stall(struct usb2_xfer *xfer); void usb2_transfer_drain(struct usb2_xfer *xfer); void usb2_transfer_set_stall(struct usb2_xfer *xfer); +uint8_t usb2_transfer_pending(struct usb2_xfer *xfer); void usb2_transfer_start(struct usb2_xfer *xfer); void usb2_transfer_stop(struct usb2_xfer *xfer); void usb2_transfer_unsetup(struct usb2_xfer **pxfer, uint16_t n_setup); Modified: head/sys/dev/usb2/core/usb2_process.c ============================================================================== --- head/sys/dev/usb2/core/usb2_process.c Fri Feb 13 20:09:11 2009 (r188599) +++ head/sys/dev/usb2/core/usb2_process.c Fri Feb 13 20:57:43 2009 (r188600) @@ -84,9 +84,9 @@ usb2_process(void *arg) while (1) { - if (up->up_gone) { + if (up->up_gone) break; - } + /* * NOTE to reimplementors: dequeueing a command from the * "used" queue and executing it must be atomic, with regard @@ -213,10 +213,10 @@ error: void usb2_proc_free(struct usb2_process *up) { - if (!(up->up_mtx)) { - /* not initialised */ + /* check if not initialised */ + if (up->up_mtx == NULL) return; - } + usb2_proc_drain(up); usb2_cv_destroy(&up->up_cv); @@ -246,6 +246,10 @@ usb2_proc_msignal(struct usb2_process *u uint32_t d; uint8_t t; + /* check if gone, return dummy value */ + if (up->up_gone) + return (_pm0); + mtx_assert(up->up_mtx, MA_OWNED); t = 0; @@ -319,9 +323,11 @@ usb2_proc_msignal(struct usb2_process *u uint8_t usb2_proc_is_gone(struct usb2_process *up) { - mtx_assert(up->up_mtx, MA_OWNED); + if (up->up_gone) + return (1); - return (up->up_gone ? 1 : 0); + mtx_assert(up->up_mtx, MA_OWNED); + return (0); } /*------------------------------------------------------------------------* @@ -337,6 +343,10 @@ usb2_proc_mwait(struct usb2_process *up, struct usb2_proc_msg *pm0 = _pm0; struct usb2_proc_msg *pm1 = _pm1; + /* check if gone */ + if (up->up_gone) + return; + mtx_assert(up->up_mtx, MA_OWNED); if (up->up_curtd == curthread) { @@ -372,13 +382,13 @@ usb2_proc_mwait(struct usb2_process *up, void usb2_proc_drain(struct usb2_process *up) { - if (!(up->up_mtx)) { - /* not initialised */ + /* check if not initialised */ + if (up->up_mtx == NULL) return; - } - if (up->up_mtx != &Giant) { + /* handle special case with Giant */ + if (up->up_mtx != &Giant) mtx_assert(up->up_mtx, MA_NOTOWNED); - } + mtx_lock(up->up_mtx); /* Set the gone flag */ @@ -398,7 +408,8 @@ usb2_proc_drain(struct usb2_process *up) if (cold) { USB_THREAD_SUSPEND(up->up_ptr); - printf("WARNING: A USB process has been left suspended!\n"); + printf("WARNING: A USB process has " + "been left suspended!\n"); break; } usb2_cv_wait(&up->up_cv, up->up_mtx); @@ -413,64 +424,3 @@ usb2_proc_drain(struct usb2_process *up) } mtx_unlock(up->up_mtx); } - -/*------------------------------------------------------------------------* - * usb2_proc_cwait - * - * This function will suspend the current process until - * "usb2_proc_signal()" or "usb2_proc_drain()" is called. The - * "timeout" parameter defines the maximum wait time in system - * ticks. If "timeout" is zero that means no timeout. - * - * NOTE: This function can only be called from within an USB process. - * - * Return values: - * USB_PROC_WAIT_TIMEOUT: Timeout - * USB_PROC_WAIT_NORMAL: Success - * Else: USB process is tearing down - *------------------------------------------------------------------------*/ -uint8_t -usb2_proc_cwait(struct usb2_process *up, int timeout) -{ - int error; - - mtx_assert(up->up_mtx, MA_OWNED); - - if (up->up_gone) { - return (USB_PROC_WAIT_DRAIN); - } - up->up_csleep = 1; - - if (timeout == 0) { - usb2_cv_wait(&up->up_cv, up->up_mtx); - error = 0; - } else { - error = usb2_cv_timedwait(&up->up_cv, up->up_mtx, timeout); - } - - up->up_csleep = 0; - - if (up->up_gone) { - return (USB_PROC_WAIT_DRAIN); - } - if (error == EWOULDBLOCK) { - return (USB_PROC_WAIT_TIMEOUT); - } - return (0); -} - -/*------------------------------------------------------------------------* - * usb2_proc_csignal - * - * This function will wakeup the given USB process. - *------------------------------------------------------------------------*/ -void -usb2_proc_csignal(struct usb2_process *up) -{ - mtx_assert(up->up_mtx, MA_OWNED); - - if (up->up_csleep) { - up->up_csleep = 0; - usb2_cv_signal(&up->up_cv); - } -} Modified: head/sys/dev/usb2/core/usb2_process.h ============================================================================== --- head/sys/dev/usb2/core/usb2_process.h Fri Feb 13 20:09:11 2009 (r188599) +++ head/sys/dev/usb2/core/usb2_process.h Fri Feb 13 20:57:43 2009 (r188600) @@ -77,11 +77,9 @@ struct usb2_process { /* prototypes */ -uint8_t usb2_proc_cwait(struct usb2_process *up, int timeout); uint8_t usb2_proc_is_gone(struct usb2_process *up); int usb2_proc_create(struct usb2_process *up, struct mtx *p_mtx, const char *pmesg, uint8_t prio); -void usb2_proc_csignal(struct usb2_process *up); void usb2_proc_drain(struct usb2_process *up); void usb2_proc_mwait(struct usb2_process *up, void *pm0, void *pm1); void usb2_proc_free(struct usb2_process *up); Modified: head/sys/dev/usb2/core/usb2_transfer.c ============================================================================== --- head/sys/dev/usb2/core/usb2_transfer.c Fri Feb 13 20:09:11 2009 (r188599) +++ head/sys/dev/usb2/core/usb2_transfer.c Fri Feb 13 20:57:43 2009 (r188600) @@ -1690,6 +1690,10 @@ usb2_transfer_pending(struct usb2_xfer * struct usb2_xfer_root *info; struct usb2_xfer_queue *pq; + if (xfer == NULL) { + /* transfer is gone */ + return (0); + } USB_XFER_LOCK_ASSERT(xfer, MA_OWNED); if (xfer->flags_int.transferring) { Modified: head/sys/dev/usb2/core/usb2_transfer.h ============================================================================== --- head/sys/dev/usb2/core/usb2_transfer.h Fri Feb 13 20:09:11 2009 (r188599) +++ head/sys/dev/usb2/core/usb2_transfer.h Fri Feb 13 20:57:43 2009 (r188600) @@ -102,7 +102,6 @@ struct usb2_setup_params { /* function prototypes */ -uint8_t usb2_transfer_pending(struct usb2_xfer *xfer); uint8_t usb2_transfer_setup_sub_malloc(struct usb2_setup_params *parm, struct usb2_page_cache **ppc, uint32_t size, uint32_t align, uint32_t count); From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 21:45:20 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 59815106566B; Fri, 13 Feb 2009 21:45:20 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2D0598FC14; Fri, 13 Feb 2009 21:45:20 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1DLjKvf000104; Fri, 13 Feb 2009 21:45:20 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1DLjK2i000103; Fri, 13 Feb 2009 21:45:20 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200902132145.n1DLjK2i000103@svn.freebsd.org> From: Andrew Thompson Date: Fri, 13 Feb 2009 21:45:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188601 - head/sys/dev/usb2/wlan X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Feb 2009 21:45:20 -0000 Author: thompsa Date: Fri Feb 13 21:45:19 2009 New Revision: 188601 URL: http://svn.freebsd.org/changeset/base/188601 Log: - ieee80211_chan2ieee returns an int - set ic_update_promisc to the same callback as mcast - avoid null deref in zyd_detach Obtained from: //depot/projects/usb Modified: head/sys/dev/usb2/wlan/if_zyd2.c Modified: head/sys/dev/usb2/wlan/if_zyd2.c ============================================================================== --- head/sys/dev/usb2/wlan/if_zyd2.c Fri Feb 13 20:57:43 2009 (r188600) +++ head/sys/dev/usb2/wlan/if_zyd2.c Fri Feb 13 21:45:19 2009 (r188601) @@ -104,7 +104,7 @@ static struct ieee80211_node *zyd_node_a const uint8_t mac[IEEE80211_ADDR_LEN]); static int zyd_newstate(struct ieee80211vap *, enum ieee80211_state, int); static int zyd_cmd(struct zyd_softc *, uint16_t, const void *, int, - void *, int, u_int); + void *, int, int); static int zyd_read16(struct zyd_softc *, uint16_t, uint16_t *); static int zyd_read32(struct zyd_softc *, uint16_t, uint32_t *); static int zyd_write16(struct zyd_softc *, uint16_t, uint16_t); @@ -419,6 +419,7 @@ zyd_attach_post(struct usb2_proc_msg *pm ic->ic_vap_create = zyd_vap_create; ic->ic_vap_delete = zyd_vap_delete; ic->ic_update_mcast = zyd_update_mcast; + ic->ic_update_promisc = zyd_update_mcast; bpfattach(ifp, DLT_IEEE802_11_RADIO, sizeof(struct ieee80211_frame) + sizeof(sc->sc_txtap)); @@ -440,7 +441,7 @@ zyd_detach(device_t dev) { struct zyd_softc *sc = device_get_softc(dev); struct ifnet *ifp = sc->sc_ifp; - struct ieee80211com *ic = ifp->if_l2com; + struct ieee80211com *ic; /* wait for any post attach or other command to complete */ usb2_proc_drain(&sc->sc_tq); @@ -453,6 +454,7 @@ zyd_detach(device_t dev) zyd_unsetup_tx_list(sc); if (ifp) { + ic = ifp->if_l2com; bpfdetach(ifp); ieee80211_ifdetach(ic); if_free(ifp); @@ -810,7 +812,7 @@ tr_setup: static int zyd_cmd(struct zyd_softc *sc, uint16_t code, const void *idata, int ilen, - void *odata, int olen, u_int flags) + void *odata, int olen, int flags) { struct zyd_cmd cmd; struct zyd_rq rq; @@ -1260,7 +1262,7 @@ zyd_al2230_bandedge6(struct zyd_rf *rf, struct ifnet *ifp = sc->sc_ifp; struct ieee80211com *ic = ifp->if_l2com; struct zyd_phy_pair r[] = ZYD_AL2230_PHY_BANDEDGE6; - u_int chan = ieee80211_chan2ieee(ic, c); + int chan = ieee80211_chan2ieee(ic, c); if (chan == 1 || chan == 11) r[0].val = 0x12; @@ -2085,7 +2087,7 @@ zyd_set_chan(struct zyd_softc *sc, struc struct ieee80211com *ic = ifp->if_l2com; struct zyd_rf *rf = &sc->sc_rf; uint32_t tmp; - u_int chan; + int chan; chan = ieee80211_chan2ieee(ic, c); if (chan == 0 || chan == IEEE80211_CHAN_ANY) { From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 22:48:06 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C93A106566C; Fri, 13 Feb 2009 22:48:06 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EE90D8FC12; Fri, 13 Feb 2009 22:48:05 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1DMm5AR001349; Fri, 13 Feb 2009 22:48:05 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1DMm5XA001348; Fri, 13 Feb 2009 22:48:05 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200902132248.n1DMm5XA001348@svn.freebsd.org> From: Xin LI Date: Fri, 13 Feb 2009 22:48:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188602 - head/usr.sbin/inetd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Feb 2009 22:48:06 -0000 Author: delphij Date: Fri Feb 13 22:48:05 2009 New Revision: 188602 URL: http://svn.freebsd.org/changeset/base/188602 Log: Sync comment with actual configuration format. Modified: head/usr.sbin/inetd/inetd.c Modified: head/usr.sbin/inetd/inetd.c ============================================================================== --- head/usr.sbin/inetd/inetd.c Fri Feb 13 21:45:19 2009 (r188601) +++ head/usr.sbin/inetd/inetd.c Fri Feb 13 22:48:05 2009 (r188602) @@ -71,7 +71,7 @@ __FBSDID("$FreeBSD$"); * socket type stream/dgram/raw/rdm/seqpacket * protocol tcp[4][6][/faith], udp[4][6], unix * wait/nowait single-threaded/multi-threaded - * user user to run daemon as + * user[:group][/login-class] user/group/login-class to run daemon as * server program full path name * server program arguments maximum of MAXARGS (20) * @@ -95,7 +95,7 @@ __FBSDID("$FreeBSD$"); * socket type stream/dgram/raw/rdm/seqpacket * protocol rpc/tcp[4][6], rpc/udp[4][6] * wait/nowait single-threaded/multi-threaded - * user user to run daemon as + * user[:group][/login-class] user/group/login-class to run daemon as * server program full path name * server program arguments maximum of MAXARGS * From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 23:36:09 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 23609106564A; Fri, 13 Feb 2009 23:36:09 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 110068FC12; Fri, 13 Feb 2009 23:36:09 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1DNa8qw002206; Fri, 13 Feb 2009 23:36:08 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1DNa8s5002205; Fri, 13 Feb 2009 23:36:08 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200902132336.n1DNa8s5002205@svn.freebsd.org> From: Andrew Thompson Date: Fri, 13 Feb 2009 23:36:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188603 - head/sys/dev/kbdmux X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Feb 2009 23:36:09 -0000 Author: thompsa Date: Fri Feb 13 23:36:08 2009 New Revision: 188603 URL: http://svn.freebsd.org/changeset/base/188603 Log: Since r188030 the error value for attach is returned, this means if kbdmux fails to attach (possibly due to disable hints) then we get called back for unload. Correctly handle the case where the keyboard isnt found rather than calling panic. Modified: head/sys/dev/kbdmux/kbdmux.c Modified: head/sys/dev/kbdmux/kbdmux.c ============================================================================== --- head/sys/dev/kbdmux/kbdmux.c Fri Feb 13 22:48:05 2009 (r188602) +++ head/sys/dev/kbdmux/kbdmux.c Fri Feb 13 23:36:08 2009 (r188603) @@ -1346,15 +1346,14 @@ kbdmux_modevent(module_t mod, int type, panic("kbd_get_switch(" KEYBOARD_NAME ") == NULL"); kbd = kbd_get_keyboard(kbd_find_keyboard(KEYBOARD_NAME, 0)); - if (kbd == NULL) - panic("kbd_get_keyboard(kbd_find_keyboard(" KEYBOARD_NAME ", 0)) == NULL"); - - (*sw->disable)(kbd); + if (kbd != NULL) { + (*sw->disable)(kbd); #ifdef KBD_INSTALL_CDEV - kbd_detach(kbd); + kbd_detach(kbd); #endif - (*sw->term)(kbd); - kbd_delete_driver(&kbdmux_kbd_driver); + (*sw->term)(kbd); + kbd_delete_driver(&kbdmux_kbd_driver); + } error = 0; break; From owner-svn-src-head@FreeBSD.ORG Sat Feb 14 00:16:17 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D8975106564A; Sat, 14 Feb 2009 00:16:17 +0000 (UTC) (envelope-from maksim.yevmenkin@gmail.com) Received: from yw-out-2324.google.com (yw-out-2324.google.com [74.125.46.31]) by mx1.freebsd.org (Postfix) with ESMTP id 471C08FC1A; Sat, 14 Feb 2009 00:16:16 +0000 (UTC) (envelope-from maksim.yevmenkin@gmail.com) Received: by yw-out-2324.google.com with SMTP id 2so825241ywt.13 for ; Fri, 13 Feb 2009 16:16:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type:content-transfer-encoding; bh=EjISpsorA3OhIJV2l6UPMtBcvHz9uid3E3AyGF6weKQ=; b=GmpVRhrx2gE976jKXj5Plq31x9H3l3JJFrXzQwT0vhNXRwdXjO7rjQg4+2ynCmte4Y Pje/vKSuTSSOzhPm8QGJoGvCz6bL8uxHk3p6HSMy5PErPrHtWa8b5b09l0INGVM3eQdd B621FBLAXBzHQdPC3cRPUIRJHi4jcTpgPtVfw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=fZJq63RdA/u0bWDMFSafea7dW0/L70t8EzizlOanzsCWafFq0oSpuGlegp0dCVuhN+ aj5kc+VwfSmriobRqORBOvJfUrHTiciOg55KYGNaBX8PknWwv+2s3iknIYXD9xVgB2Nr glpYo4OJkYhCI8LAeNfzTY5OJRm/ISBuf2XQU= MIME-Version: 1.0 Sender: maksim.yevmenkin@gmail.com Received: by 10.150.91.4 with SMTP id o4mr690598ybb.37.1234570576424; Fri, 13 Feb 2009 16:16:16 -0800 (PST) In-Reply-To: <200902132336.n1DNa8s5002205@svn.freebsd.org> References: <200902132336.n1DNa8s5002205@svn.freebsd.org> Date: Fri, 13 Feb 2009 16:16:16 -0800 X-Google-Sender-Auth: 46f0ead6a9664784 Message-ID: From: Maksim Yevmenkin To: Andrew Thompson Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r188603 - head/sys/dev/kbdmux X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Feb 2009 00:16:18 -0000 On Fri, Feb 13, 2009 at 3:36 PM, Andrew Thompson wrote: > Author: thompsa > Date: Fri Feb 13 23:36:08 2009 > New Revision: 188603 > URL: http://svn.freebsd.org/changeset/base/188603 > > Log: > Since r188030 the error value for attach is returned, this means if kbdmux > fails to attach (possibly due to disable hints) then we get called back for > unload. Correctly handle the case where the keyboard isnt found rather than > calling panic. thanks for taking care of this! thanks, max > > Modified: > head/sys/dev/kbdmux/kbdmux.c > > Modified: head/sys/dev/kbdmux/kbdmux.c > ============================================================================== > --- head/sys/dev/kbdmux/kbdmux.c Fri Feb 13 22:48:05 2009 (r188602) > +++ head/sys/dev/kbdmux/kbdmux.c Fri Feb 13 23:36:08 2009 (r188603) > @@ -1346,15 +1346,14 @@ kbdmux_modevent(module_t mod, int type, > panic("kbd_get_switch(" KEYBOARD_NAME ") == NULL"); > > kbd = kbd_get_keyboard(kbd_find_keyboard(KEYBOARD_NAME, 0)); > - if (kbd == NULL) > - panic("kbd_get_keyboard(kbd_find_keyboard(" KEYBOARD_NAME ", 0)) == NULL"); > - > - (*sw->disable)(kbd); > + if (kbd != NULL) { > + (*sw->disable)(kbd); > #ifdef KBD_INSTALL_CDEV > - kbd_detach(kbd); > + kbd_detach(kbd); > #endif > - (*sw->term)(kbd); > - kbd_delete_driver(&kbdmux_kbd_driver); > + (*sw->term)(kbd); > + kbd_delete_driver(&kbdmux_kbd_driver); > + } > error = 0; > break; > > From owner-svn-src-head@FreeBSD.ORG Sat Feb 14 08:00:02 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E971F1065674; Sat, 14 Feb 2009 08:00:02 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail07.syd.optusnet.com.au (mail07.syd.optusnet.com.au [211.29.132.188]) by mx1.freebsd.org (Postfix) with ESMTP id 781F38FC18; Sat, 14 Feb 2009 08:00:02 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c122-107-120-227.carlnfd1.nsw.optusnet.com.au [122.107.120.227]) by mail07.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id n1E7xvTu017317 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 14 Feb 2009 18:59:59 +1100 Date: Sat, 14 Feb 2009 18:59:57 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Luigi Rizzo In-Reply-To: <200902131514.n1DFEhft091837@svn.freebsd.org> Message-ID: <20090214183758.I847@besplex.bde.org> References: <200902131514.n1DFEhft091837@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r188578 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Feb 2009 08:00:03 -0000 On Fri, 13 Feb 2009, Luigi Rizzo wrote: > Log: > Use uint32_t instead of n_long and n_time, and uint16_t instead of n_short. > Add a note next to fields in network format. > > The n_* types are not enough for compiler checks on endianness, and their > use often requires an otherwise unnecessary #include This is too much like globally substituting uid_t with uint16_t. At least the n_time typedef provides some correct opaqueness (while n_long is just bogus since the network size is 4 octets and not 1 long on 64-bit machines). > Modified: head/sys/netinet/ip.h > ============================================================================== > --- head/sys/netinet/ip.h Fri Feb 13 14:43:46 2009 (r188577) > +++ head/sys/netinet/ip.h Fri Feb 13 15:14:43 2009 (r188578) > @@ -150,10 +150,10 @@ struct ip_timestamp { > ipt_flg:4; /* flags, see below */ > #endif > union ipt_timestamp { > - n_long ipt_time[1]; > + uint32_t ipt_time[1]; /* network format */ The old typedef-names also allow better formatting (since they are shorter than 8 characters). This declaration is now indented an extra 8 characters... > struct ipt_ta { > struct in_addr ipt_addr; > - n_long ipt_time; > + uint32_t ipt_time; /* network format */ ... while this one is indented inconsistently by 1 space before and after. Similarly elsewhere. The new comments are bogus. Surely everything here is in network format, not just the now-annotated fields. Similarly elsewhere. > Modified: head/sys/netinet/ip_icmp.h > ============================================================================== > --- head/sys/netinet/ip_icmp.h Fri Feb 13 14:43:46 2009 (r188577) > +++ head/sys/netinet/ip_icmp.h Fri Feb 13 15:14:43 2009 (r188578) > @@ -127,7 +131,7 @@ struct icmp { > * ip header length. > */ > #define ICMP_MINLEN 8 /* abs minimum */ > -#define ICMP_TSLEN (8 + 3 * sizeof (n_time)) /* timestamp */ > +#define ICMP_TSLEN (8 + 3 * sizeof (uint32_t)) /* timestamp */ The changes lose the most where they involve sizeof's. Now it is unclear that the sizeof is of 1 timestamp. sizeof(uint32_t) is an obfuscated spelling of 4. This change preserves the style bug. sizeof's are not followed by a space. > Modified: head/sys/netinet/ip_options.c > ============================================================================== > --- head/sys/netinet/ip_options.c Fri Feb 13 14:43:46 2009 (r188577) > +++ head/sys/netinet/ip_options.c Fri Feb 13 15:14:43 2009 (r188578) > @@ -105,7 +105,7 @@ ip_dooptions(struct mbuf *m, int pass) > struct in_ifaddr *ia; > int opt, optlen, cnt, off, code, type = ICMP_PARAMPROB, forward = 0; > struct in_addr *sin, dst; > - n_time ntime; > + uint32_t ntime; > struct sockaddr_in ipaddr = { sizeof(ipaddr), AF_INET }; > > /* Ignore or reject packets with IP options. */ > @@ -320,7 +320,7 @@ dropit: > break; > > case IPOPT_TS_TSANDADDR: > - if (off + sizeof(n_time) + > + if (off + sizeof(uint32_t) + > sizeof(struct in_addr) > optlen) { > code = &cp[IPOPT_OFFSET] - (u_char *)ip; > goto bad; > @@ -337,7 +337,7 @@ dropit: > break; > > case IPOPT_TS_PRESPEC: > - if (off + sizeof(n_time) + > + if (off + sizeof(uint32_t) + > sizeof(struct in_addr) > optlen) { > code = &cp[IPOPT_OFFSET] - (u_char *)ip; > goto bad; sizeof(type) is probably the best spelling of the magic number in the above... > @@ -355,8 +355,8 @@ dropit: > goto bad; > } > ntime = iptime(); > - (void)memcpy(cp + off, &ntime, sizeof(n_time)); > - cp[IPOPT_OFFSET] += sizeof(n_time); > + (void)memcpy(cp + off, &ntime, sizeof(uint32_t)); > + cp[IPOPT_OFFSET] += sizeof(uint32_t); ... but here we are copying the object `ntime'; sizeof(n_time) was an obfuscated spelling of the size of that object, and sizeof(uint32_t) is an even more obfuscated spelling. Similarly elsewhere. Bruce From owner-svn-src-head@FreeBSD.ORG Sat Feb 14 11:34:57 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7CAB5106566B; Sat, 14 Feb 2009 11:34:57 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 681198FC13; Sat, 14 Feb 2009 11:34:57 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1EBYvR9019536; Sat, 14 Feb 2009 11:34:57 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1EBYvaU019531; Sat, 14 Feb 2009 11:34:57 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <200902141134.n1EBYvaU019531@svn.freebsd.org> From: Randall Stewart Date: Sat, 14 Feb 2009 11:34:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188605 - in head/sys: dev/iscsi/initiator libkern netinet netinet/libalias sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Feb 2009 11:34:57 -0000 Author: rrs Date: Sat Feb 14 11:34:57 2009 New Revision: 188605 URL: http://svn.freebsd.org/changeset/base/188605 Log: This commit fixes the issue with alias_sctp.c. No longer do we require SCTP to be in the kernel for the lib to be able to handle SCTP. We do this by moving the CRC32c checksum into libkern/crc32.c and then adjusting all routines to use the common methods. Note that this will improve the performance of iSCSI since they were using the old single 256 bit table lookup versus the slicing 8 algorithm (which gives a 4x speed up in CRC32c calculation :-D) Reviewed by:rwatson, gnn, scottl, paolo MFC after: 4 week? (assuming we MFC the alias_sctp changes) Modified: head/sys/dev/iscsi/initiator/isc_subr.c head/sys/libkern/crc32.c head/sys/netinet/libalias/alias_sctp.c head/sys/netinet/sctp_crc32.c head/sys/netinet/sctp_crc32.h head/sys/sys/libkern.h Modified: head/sys/dev/iscsi/initiator/isc_subr.c ============================================================================== --- head/sys/dev/iscsi/initiator/isc_subr.c Sat Feb 14 08:08:08 2009 (r188604) +++ head/sys/dev/iscsi/initiator/isc_subr.c Sat Feb 14 11:34:57 2009 (r188605) @@ -76,101 +76,11 @@ i_strdupin(char *s, size_t maxlen) return q; } -/*****************************************************************/ -/* */ -/* CRC LOOKUP TABLE */ -/* ================ */ -/* The following CRC lookup table was generated automagically */ -/* by the Rocksoft^tm Model CRC Algorithm Table Generation */ -/* Program V1.0 using the following model parameters: */ -/* */ -/* Width : 4 bytes. */ -/* Poly : 0x1EDC6F41L */ -/* Reverse : TRUE. */ -/* */ -/* For more information on the Rocksoft^tm Model CRC Algorithm, */ -/* see the document titled "A Painless Guide to CRC Error */ -/* Detection Algorithms" by Ross Williams */ -/* (ross@guest.adelaide.edu.au.). This document is likely to be */ -/* in the FTP archive "ftp.adelaide.edu.au/pub/rocksoft". */ -/* */ -/*****************************************************************/ - -static uint32_t crc32Table[256] = { - 0x00000000L, 0xF26B8303L, 0xE13B70F7L, 0x1350F3F4L, - 0xC79A971FL, 0x35F1141CL, 0x26A1E7E8L, 0xD4CA64EBL, - 0x8AD958CFL, 0x78B2DBCCL, 0x6BE22838L, 0x9989AB3BL, - 0x4D43CFD0L, 0xBF284CD3L, 0xAC78BF27L, 0x5E133C24L, - 0x105EC76FL, 0xE235446CL, 0xF165B798L, 0x030E349BL, - 0xD7C45070L, 0x25AFD373L, 0x36FF2087L, 0xC494A384L, - 0x9A879FA0L, 0x68EC1CA3L, 0x7BBCEF57L, 0x89D76C54L, - 0x5D1D08BFL, 0xAF768BBCL, 0xBC267848L, 0x4E4DFB4BL, - 0x20BD8EDEL, 0xD2D60DDDL, 0xC186FE29L, 0x33ED7D2AL, - 0xE72719C1L, 0x154C9AC2L, 0x061C6936L, 0xF477EA35L, - 0xAA64D611L, 0x580F5512L, 0x4B5FA6E6L, 0xB93425E5L, - 0x6DFE410EL, 0x9F95C20DL, 0x8CC531F9L, 0x7EAEB2FAL, - 0x30E349B1L, 0xC288CAB2L, 0xD1D83946L, 0x23B3BA45L, - 0xF779DEAEL, 0x05125DADL, 0x1642AE59L, 0xE4292D5AL, - 0xBA3A117EL, 0x4851927DL, 0x5B016189L, 0xA96AE28AL, - 0x7DA08661L, 0x8FCB0562L, 0x9C9BF696L, 0x6EF07595L, - 0x417B1DBCL, 0xB3109EBFL, 0xA0406D4BL, 0x522BEE48L, - 0x86E18AA3L, 0x748A09A0L, 0x67DAFA54L, 0x95B17957L, - 0xCBA24573L, 0x39C9C670L, 0x2A993584L, 0xD8F2B687L, - 0x0C38D26CL, 0xFE53516FL, 0xED03A29BL, 0x1F682198L, - 0x5125DAD3L, 0xA34E59D0L, 0xB01EAA24L, 0x42752927L, - 0x96BF4DCCL, 0x64D4CECFL, 0x77843D3BL, 0x85EFBE38L, - 0xDBFC821CL, 0x2997011FL, 0x3AC7F2EBL, 0xC8AC71E8L, - 0x1C661503L, 0xEE0D9600L, 0xFD5D65F4L, 0x0F36E6F7L, - 0x61C69362L, 0x93AD1061L, 0x80FDE395L, 0x72966096L, - 0xA65C047DL, 0x5437877EL, 0x4767748AL, 0xB50CF789L, - 0xEB1FCBADL, 0x197448AEL, 0x0A24BB5AL, 0xF84F3859L, - 0x2C855CB2L, 0xDEEEDFB1L, 0xCDBE2C45L, 0x3FD5AF46L, - 0x7198540DL, 0x83F3D70EL, 0x90A324FAL, 0x62C8A7F9L, - 0xB602C312L, 0x44694011L, 0x5739B3E5L, 0xA55230E6L, - 0xFB410CC2L, 0x092A8FC1L, 0x1A7A7C35L, 0xE811FF36L, - 0x3CDB9BDDL, 0xCEB018DEL, 0xDDE0EB2AL, 0x2F8B6829L, - 0x82F63B78L, 0x709DB87BL, 0x63CD4B8FL, 0x91A6C88CL, - 0x456CAC67L, 0xB7072F64L, 0xA457DC90L, 0x563C5F93L, - 0x082F63B7L, 0xFA44E0B4L, 0xE9141340L, 0x1B7F9043L, - 0xCFB5F4A8L, 0x3DDE77ABL, 0x2E8E845FL, 0xDCE5075CL, - 0x92A8FC17L, 0x60C37F14L, 0x73938CE0L, 0x81F80FE3L, - 0x55326B08L, 0xA759E80BL, 0xB4091BFFL, 0x466298FCL, - 0x1871A4D8L, 0xEA1A27DBL, 0xF94AD42FL, 0x0B21572CL, - 0xDFEB33C7L, 0x2D80B0C4L, 0x3ED04330L, 0xCCBBC033L, - 0xA24BB5A6L, 0x502036A5L, 0x4370C551L, 0xB11B4652L, - 0x65D122B9L, 0x97BAA1BAL, 0x84EA524EL, 0x7681D14DL, - 0x2892ED69L, 0xDAF96E6AL, 0xC9A99D9EL, 0x3BC21E9DL, - 0xEF087A76L, 0x1D63F975L, 0x0E330A81L, 0xFC588982L, - 0xB21572C9L, 0x407EF1CAL, 0x532E023EL, 0xA145813DL, - 0x758FE5D6L, 0x87E466D5L, 0x94B49521L, 0x66DF1622L, - 0x38CC2A06L, 0xCAA7A905L, 0xD9F75AF1L, 0x2B9CD9F2L, - 0xFF56BD19L, 0x0D3D3E1AL, 0x1E6DCDEEL, 0xEC064EEDL, - 0xC38D26C4L, 0x31E6A5C7L, 0x22B65633L, 0xD0DDD530L, - 0x0417B1DBL, 0xF67C32D8L, 0xE52CC12CL, 0x1747422FL, - 0x49547E0BL, 0xBB3FFD08L, 0xA86F0EFCL, 0x5A048DFFL, - 0x8ECEE914L, 0x7CA56A17L, 0x6FF599E3L, 0x9D9E1AE0L, - 0xD3D3E1ABL, 0x21B862A8L, 0x32E8915CL, 0xC083125FL, - 0x144976B4L, 0xE622F5B7L, 0xF5720643L, 0x07198540L, - 0x590AB964L, 0xAB613A67L, 0xB831C993L, 0x4A5A4A90L, - 0x9E902E7BL, 0x6CFBAD78L, 0x7FAB5E8CL, 0x8DC0DD8FL, - 0xE330A81AL, 0x115B2B19L, 0x020BD8EDL, 0xF0605BEEL, - 0x24AA3F05L, 0xD6C1BC06L, 0xC5914FF2L, 0x37FACCF1L, - 0x69E9F0D5L, 0x9B8273D6L, 0x88D28022L, 0x7AB90321L, - 0xAE7367CAL, 0x5C18E4C9L, 0x4F48173DL, 0xBD23943EL, - 0xF36E6F75L, 0x0105EC76L, 0x12551F82L, 0xE03E9C81L, - 0x34F4F86AL, 0xC69F7B69L, 0xD5CF889DL, 0x27A40B9EL, - 0x79B737BAL, 0x8BDCB4B9L, 0x988C474DL, 0x6AE7C44EL, - 0xBE2DA0A5L, 0x4C4623A6L, 0x5F16D052L, 0xAD7D5351L -}; - static uint32_t i_crc32c(const void *buf, size_t size, uint32_t crc) { - const uint8_t *p = buf; - crc = crc ^ 0xffffffff; - while (size--) - crc = crc32Table[(crc ^ *p++) & 0xff] ^ (crc >> 8); + crc = calculate_crc32c(crc, buf, size); crc = crc ^ 0xffffffff; return crc; } Modified: head/sys/libkern/crc32.c ============================================================================== --- head/sys/libkern/crc32.c Sat Feb 14 08:08:08 2009 (r188604) +++ head/sys/libkern/crc32.c Sat Feb 14 11:34:57 2009 (r188605) @@ -112,3 +112,646 @@ uint32_t crc32_tab[] = { * return crc ^ ~0U; * } */ + +/* CRC32C routines, these use a different polynomial */ +/*****************************************************************/ +/* */ +/* CRC LOOKUP TABLE */ +/* ================ */ +/* The following CRC lookup table was generated automagically */ +/* by the Rocksoft^tm Model CRC Algorithm Table Generation */ +/* Program V1.0 using the following model parameters: */ +/* */ +/* Width : 4 bytes. */ +/* Poly : 0x1EDC6F41L */ +/* Reverse : TRUE. */ +/* */ +/* For more information on the Rocksoft^tm Model CRC Algorithm, */ +/* see the document titled "A Painless Guide to CRC Error */ +/* Detection Algorithms" by Ross Williams */ +/* (ross@guest.adelaide.edu.au.). This document is likely to be */ +/* in the FTP archive "ftp.adelaide.edu.au/pub/rocksoft". */ +/* */ +/*****************************************************************/ + +static uint32_t crc32Table[256] = { + 0x00000000L, 0xF26B8303L, 0xE13B70F7L, 0x1350F3F4L, + 0xC79A971FL, 0x35F1141CL, 0x26A1E7E8L, 0xD4CA64EBL, + 0x8AD958CFL, 0x78B2DBCCL, 0x6BE22838L, 0x9989AB3BL, + 0x4D43CFD0L, 0xBF284CD3L, 0xAC78BF27L, 0x5E133C24L, + 0x105EC76FL, 0xE235446CL, 0xF165B798L, 0x030E349BL, + 0xD7C45070L, 0x25AFD373L, 0x36FF2087L, 0xC494A384L, + 0x9A879FA0L, 0x68EC1CA3L, 0x7BBCEF57L, 0x89D76C54L, + 0x5D1D08BFL, 0xAF768BBCL, 0xBC267848L, 0x4E4DFB4BL, + 0x20BD8EDEL, 0xD2D60DDDL, 0xC186FE29L, 0x33ED7D2AL, + 0xE72719C1L, 0x154C9AC2L, 0x061C6936L, 0xF477EA35L, + 0xAA64D611L, 0x580F5512L, 0x4B5FA6E6L, 0xB93425E5L, + 0x6DFE410EL, 0x9F95C20DL, 0x8CC531F9L, 0x7EAEB2FAL, + 0x30E349B1L, 0xC288CAB2L, 0xD1D83946L, 0x23B3BA45L, + 0xF779DEAEL, 0x05125DADL, 0x1642AE59L, 0xE4292D5AL, + 0xBA3A117EL, 0x4851927DL, 0x5B016189L, 0xA96AE28AL, + 0x7DA08661L, 0x8FCB0562L, 0x9C9BF696L, 0x6EF07595L, + 0x417B1DBCL, 0xB3109EBFL, 0xA0406D4BL, 0x522BEE48L, + 0x86E18AA3L, 0x748A09A0L, 0x67DAFA54L, 0x95B17957L, + 0xCBA24573L, 0x39C9C670L, 0x2A993584L, 0xD8F2B687L, + 0x0C38D26CL, 0xFE53516FL, 0xED03A29BL, 0x1F682198L, + 0x5125DAD3L, 0xA34E59D0L, 0xB01EAA24L, 0x42752927L, + 0x96BF4DCCL, 0x64D4CECFL, 0x77843D3BL, 0x85EFBE38L, + 0xDBFC821CL, 0x2997011FL, 0x3AC7F2EBL, 0xC8AC71E8L, + 0x1C661503L, 0xEE0D9600L, 0xFD5D65F4L, 0x0F36E6F7L, + 0x61C69362L, 0x93AD1061L, 0x80FDE395L, 0x72966096L, + 0xA65C047DL, 0x5437877EL, 0x4767748AL, 0xB50CF789L, + 0xEB1FCBADL, 0x197448AEL, 0x0A24BB5AL, 0xF84F3859L, + 0x2C855CB2L, 0xDEEEDFB1L, 0xCDBE2C45L, 0x3FD5AF46L, + 0x7198540DL, 0x83F3D70EL, 0x90A324FAL, 0x62C8A7F9L, + 0xB602C312L, 0x44694011L, 0x5739B3E5L, 0xA55230E6L, + 0xFB410CC2L, 0x092A8FC1L, 0x1A7A7C35L, 0xE811FF36L, + 0x3CDB9BDDL, 0xCEB018DEL, 0xDDE0EB2AL, 0x2F8B6829L, + 0x82F63B78L, 0x709DB87BL, 0x63CD4B8FL, 0x91A6C88CL, + 0x456CAC67L, 0xB7072F64L, 0xA457DC90L, 0x563C5F93L, + 0x082F63B7L, 0xFA44E0B4L, 0xE9141340L, 0x1B7F9043L, + 0xCFB5F4A8L, 0x3DDE77ABL, 0x2E8E845FL, 0xDCE5075CL, + 0x92A8FC17L, 0x60C37F14L, 0x73938CE0L, 0x81F80FE3L, + 0x55326B08L, 0xA759E80BL, 0xB4091BFFL, 0x466298FCL, + 0x1871A4D8L, 0xEA1A27DBL, 0xF94AD42FL, 0x0B21572CL, + 0xDFEB33C7L, 0x2D80B0C4L, 0x3ED04330L, 0xCCBBC033L, + 0xA24BB5A6L, 0x502036A5L, 0x4370C551L, 0xB11B4652L, + 0x65D122B9L, 0x97BAA1BAL, 0x84EA524EL, 0x7681D14DL, + 0x2892ED69L, 0xDAF96E6AL, 0xC9A99D9EL, 0x3BC21E9DL, + 0xEF087A76L, 0x1D63F975L, 0x0E330A81L, 0xFC588982L, + 0xB21572C9L, 0x407EF1CAL, 0x532E023EL, 0xA145813DL, + 0x758FE5D6L, 0x87E466D5L, 0x94B49521L, 0x66DF1622L, + 0x38CC2A06L, 0xCAA7A905L, 0xD9F75AF1L, 0x2B9CD9F2L, + 0xFF56BD19L, 0x0D3D3E1AL, 0x1E6DCDEEL, 0xEC064EEDL, + 0xC38D26C4L, 0x31E6A5C7L, 0x22B65633L, 0xD0DDD530L, + 0x0417B1DBL, 0xF67C32D8L, 0xE52CC12CL, 0x1747422FL, + 0x49547E0BL, 0xBB3FFD08L, 0xA86F0EFCL, 0x5A048DFFL, + 0x8ECEE914L, 0x7CA56A17L, 0x6FF599E3L, 0x9D9E1AE0L, + 0xD3D3E1ABL, 0x21B862A8L, 0x32E8915CL, 0xC083125FL, + 0x144976B4L, 0xE622F5B7L, 0xF5720643L, 0x07198540L, + 0x590AB964L, 0xAB613A67L, 0xB831C993L, 0x4A5A4A90L, + 0x9E902E7BL, 0x6CFBAD78L, 0x7FAB5E8CL, 0x8DC0DD8FL, + 0xE330A81AL, 0x115B2B19L, 0x020BD8EDL, 0xF0605BEEL, + 0x24AA3F05L, 0xD6C1BC06L, 0xC5914FF2L, 0x37FACCF1L, + 0x69E9F0D5L, 0x9B8273D6L, 0x88D28022L, 0x7AB90321L, + 0xAE7367CAL, 0x5C18E4C9L, 0x4F48173DL, 0xBD23943EL, + 0xF36E6F75L, 0x0105EC76L, 0x12551F82L, 0xE03E9C81L, + 0x34F4F86AL, 0xC69F7B69L, 0xD5CF889DL, 0x27A40B9EL, + 0x79B737BAL, 0x8BDCB4B9L, 0x988C474DL, 0x6AE7C44EL, + 0xBE2DA0A5L, 0x4C4623A6L, 0x5F16D052L, 0xAD7D5351L +}; + +static uint32_t +singletable_crc32c(uint32_t crc, const void *buf, size_t size) +{ + const uint8_t *p = buf; + + + while (size--) + crc = crc32Table[(crc ^ *p++) & 0xff] ^ (crc >> 8); + + return crc; +} + + +/* + * Copyright (c) 2004-2006 Intel Corporation - All Rights Reserved + * + * + * This software program is licensed subject to the BSD License, available at + * http://www.opensource.org/licenses/bsd-license.html. + * + * Abstract: + * + * Tables for software CRC generation + */ + +/* + * The following CRC lookup table was generated automagically using the + * following model parameters: + * + * Generator Polynomial = ................. 0x1EDC6F41 + * Generator Polynomial Length = .......... 32 bits + * Reflected Bits = ....................... TRUE + * Table Generation Offset = .............. 32 bits + * Number of Slices = ..................... 8 slices + * Slice Lengths = ........................ 8 8 8 8 8 8 8 8 + * Directory Name = ....................... .\ + * File Name = ............................ 8x256_tables.c + */ + +static uint32_t sctp_crc_tableil8_o32[256] = +{ + 0x00000000, 0xF26B8303, 0xE13B70F7, 0x1350F3F4, 0xC79A971F, 0x35F1141C, 0x26A1E7E8, 0xD4CA64EB, + 0x8AD958CF, 0x78B2DBCC, 0x6BE22838, 0x9989AB3B, 0x4D43CFD0, 0xBF284CD3, 0xAC78BF27, 0x5E133C24, + 0x105EC76F, 0xE235446C, 0xF165B798, 0x030E349B, 0xD7C45070, 0x25AFD373, 0x36FF2087, 0xC494A384, + 0x9A879FA0, 0x68EC1CA3, 0x7BBCEF57, 0x89D76C54, 0x5D1D08BF, 0xAF768BBC, 0xBC267848, 0x4E4DFB4B, + 0x20BD8EDE, 0xD2D60DDD, 0xC186FE29, 0x33ED7D2A, 0xE72719C1, 0x154C9AC2, 0x061C6936, 0xF477EA35, + 0xAA64D611, 0x580F5512, 0x4B5FA6E6, 0xB93425E5, 0x6DFE410E, 0x9F95C20D, 0x8CC531F9, 0x7EAEB2FA, + 0x30E349B1, 0xC288CAB2, 0xD1D83946, 0x23B3BA45, 0xF779DEAE, 0x05125DAD, 0x1642AE59, 0xE4292D5A, + 0xBA3A117E, 0x4851927D, 0x5B016189, 0xA96AE28A, 0x7DA08661, 0x8FCB0562, 0x9C9BF696, 0x6EF07595, + 0x417B1DBC, 0xB3109EBF, 0xA0406D4B, 0x522BEE48, 0x86E18AA3, 0x748A09A0, 0x67DAFA54, 0x95B17957, + 0xCBA24573, 0x39C9C670, 0x2A993584, 0xD8F2B687, 0x0C38D26C, 0xFE53516F, 0xED03A29B, 0x1F682198, + 0x5125DAD3, 0xA34E59D0, 0xB01EAA24, 0x42752927, 0x96BF4DCC, 0x64D4CECF, 0x77843D3B, 0x85EFBE38, + 0xDBFC821C, 0x2997011F, 0x3AC7F2EB, 0xC8AC71E8, 0x1C661503, 0xEE0D9600, 0xFD5D65F4, 0x0F36E6F7, + 0x61C69362, 0x93AD1061, 0x80FDE395, 0x72966096, 0xA65C047D, 0x5437877E, 0x4767748A, 0xB50CF789, + 0xEB1FCBAD, 0x197448AE, 0x0A24BB5A, 0xF84F3859, 0x2C855CB2, 0xDEEEDFB1, 0xCDBE2C45, 0x3FD5AF46, + 0x7198540D, 0x83F3D70E, 0x90A324FA, 0x62C8A7F9, 0xB602C312, 0x44694011, 0x5739B3E5, 0xA55230E6, + 0xFB410CC2, 0x092A8FC1, 0x1A7A7C35, 0xE811FF36, 0x3CDB9BDD, 0xCEB018DE, 0xDDE0EB2A, 0x2F8B6829, + 0x82F63B78, 0x709DB87B, 0x63CD4B8F, 0x91A6C88C, 0x456CAC67, 0xB7072F64, 0xA457DC90, 0x563C5F93, + 0x082F63B7, 0xFA44E0B4, 0xE9141340, 0x1B7F9043, 0xCFB5F4A8, 0x3DDE77AB, 0x2E8E845F, 0xDCE5075C, + 0x92A8FC17, 0x60C37F14, 0x73938CE0, 0x81F80FE3, 0x55326B08, 0xA759E80B, 0xB4091BFF, 0x466298FC, + 0x1871A4D8, 0xEA1A27DB, 0xF94AD42F, 0x0B21572C, 0xDFEB33C7, 0x2D80B0C4, 0x3ED04330, 0xCCBBC033, + 0xA24BB5A6, 0x502036A5, 0x4370C551, 0xB11B4652, 0x65D122B9, 0x97BAA1BA, 0x84EA524E, 0x7681D14D, + 0x2892ED69, 0xDAF96E6A, 0xC9A99D9E, 0x3BC21E9D, 0xEF087A76, 0x1D63F975, 0x0E330A81, 0xFC588982, + 0xB21572C9, 0x407EF1CA, 0x532E023E, 0xA145813D, 0x758FE5D6, 0x87E466D5, 0x94B49521, 0x66DF1622, + 0x38CC2A06, 0xCAA7A905, 0xD9F75AF1, 0x2B9CD9F2, 0xFF56BD19, 0x0D3D3E1A, 0x1E6DCDEE, 0xEC064EED, + 0xC38D26C4, 0x31E6A5C7, 0x22B65633, 0xD0DDD530, 0x0417B1DB, 0xF67C32D8, 0xE52CC12C, 0x1747422F, + 0x49547E0B, 0xBB3FFD08, 0xA86F0EFC, 0x5A048DFF, 0x8ECEE914, 0x7CA56A17, 0x6FF599E3, 0x9D9E1AE0, + 0xD3D3E1AB, 0x21B862A8, 0x32E8915C, 0xC083125F, 0x144976B4, 0xE622F5B7, 0xF5720643, 0x07198540, + 0x590AB964, 0xAB613A67, 0xB831C993, 0x4A5A4A90, 0x9E902E7B, 0x6CFBAD78, 0x7FAB5E8C, 0x8DC0DD8F, + 0xE330A81A, 0x115B2B19, 0x020BD8ED, 0xF0605BEE, 0x24AA3F05, 0xD6C1BC06, 0xC5914FF2, 0x37FACCF1, + 0x69E9F0D5, 0x9B8273D6, 0x88D28022, 0x7AB90321, 0xAE7367CA, 0x5C18E4C9, 0x4F48173D, 0xBD23943E, + 0xF36E6F75, 0x0105EC76, 0x12551F82, 0xE03E9C81, 0x34F4F86A, 0xC69F7B69, 0xD5CF889D, 0x27A40B9E, + 0x79B737BA, 0x8BDCB4B9, 0x988C474D, 0x6AE7C44E, 0xBE2DA0A5, 0x4C4623A6, 0x5F16D052, 0xAD7D5351 +}; + +/* + * end of the CRC lookup table crc_tableil8_o32 + */ + + + +/* + * The following CRC lookup table was generated automagically using the + * following model parameters: + * + * Generator Polynomial = ................. 0x1EDC6F41 + * Generator Polynomial Length = .......... 32 bits + * Reflected Bits = ....................... TRUE + * Table Generation Offset = .............. 32 bits + * Number of Slices = ..................... 8 slices + * Slice Lengths = ........................ 8 8 8 8 8 8 8 8 + * Directory Name = ....................... .\ + * File Name = ............................ 8x256_tables.c + */ + +static uint32_t sctp_crc_tableil8_o40[256] = +{ + 0x00000000, 0x13A29877, 0x274530EE, 0x34E7A899, 0x4E8A61DC, 0x5D28F9AB, 0x69CF5132, 0x7A6DC945, + 0x9D14C3B8, 0x8EB65BCF, 0xBA51F356, 0xA9F36B21, 0xD39EA264, 0xC03C3A13, 0xF4DB928A, 0xE7790AFD, + 0x3FC5F181, 0x2C6769F6, 0x1880C16F, 0x0B225918, 0x714F905D, 0x62ED082A, 0x560AA0B3, 0x45A838C4, + 0xA2D13239, 0xB173AA4E, 0x859402D7, 0x96369AA0, 0xEC5B53E5, 0xFFF9CB92, 0xCB1E630B, 0xD8BCFB7C, + 0x7F8BE302, 0x6C297B75, 0x58CED3EC, 0x4B6C4B9B, 0x310182DE, 0x22A31AA9, 0x1644B230, 0x05E62A47, + 0xE29F20BA, 0xF13DB8CD, 0xC5DA1054, 0xD6788823, 0xAC154166, 0xBFB7D911, 0x8B507188, 0x98F2E9FF, + 0x404E1283, 0x53EC8AF4, 0x670B226D, 0x74A9BA1A, 0x0EC4735F, 0x1D66EB28, 0x298143B1, 0x3A23DBC6, + 0xDD5AD13B, 0xCEF8494C, 0xFA1FE1D5, 0xE9BD79A2, 0x93D0B0E7, 0x80722890, 0xB4958009, 0xA737187E, + 0xFF17C604, 0xECB55E73, 0xD852F6EA, 0xCBF06E9D, 0xB19DA7D8, 0xA23F3FAF, 0x96D89736, 0x857A0F41, + 0x620305BC, 0x71A19DCB, 0x45463552, 0x56E4AD25, 0x2C896460, 0x3F2BFC17, 0x0BCC548E, 0x186ECCF9, + 0xC0D23785, 0xD370AFF2, 0xE797076B, 0xF4359F1C, 0x8E585659, 0x9DFACE2E, 0xA91D66B7, 0xBABFFEC0, + 0x5DC6F43D, 0x4E646C4A, 0x7A83C4D3, 0x69215CA4, 0x134C95E1, 0x00EE0D96, 0x3409A50F, 0x27AB3D78, + 0x809C2506, 0x933EBD71, 0xA7D915E8, 0xB47B8D9F, 0xCE1644DA, 0xDDB4DCAD, 0xE9537434, 0xFAF1EC43, + 0x1D88E6BE, 0x0E2A7EC9, 0x3ACDD650, 0x296F4E27, 0x53028762, 0x40A01F15, 0x7447B78C, 0x67E52FFB, + 0xBF59D487, 0xACFB4CF0, 0x981CE469, 0x8BBE7C1E, 0xF1D3B55B, 0xE2712D2C, 0xD69685B5, 0xC5341DC2, + 0x224D173F, 0x31EF8F48, 0x050827D1, 0x16AABFA6, 0x6CC776E3, 0x7F65EE94, 0x4B82460D, 0x5820DE7A, + 0xFBC3FAF9, 0xE861628E, 0xDC86CA17, 0xCF245260, 0xB5499B25, 0xA6EB0352, 0x920CABCB, 0x81AE33BC, + 0x66D73941, 0x7575A136, 0x419209AF, 0x523091D8, 0x285D589D, 0x3BFFC0EA, 0x0F186873, 0x1CBAF004, + 0xC4060B78, 0xD7A4930F, 0xE3433B96, 0xF0E1A3E1, 0x8A8C6AA4, 0x992EF2D3, 0xADC95A4A, 0xBE6BC23D, + 0x5912C8C0, 0x4AB050B7, 0x7E57F82E, 0x6DF56059, 0x1798A91C, 0x043A316B, 0x30DD99F2, 0x237F0185, + 0x844819FB, 0x97EA818C, 0xA30D2915, 0xB0AFB162, 0xCAC27827, 0xD960E050, 0xED8748C9, 0xFE25D0BE, + 0x195CDA43, 0x0AFE4234, 0x3E19EAAD, 0x2DBB72DA, 0x57D6BB9F, 0x447423E8, 0x70938B71, 0x63311306, + 0xBB8DE87A, 0xA82F700D, 0x9CC8D894, 0x8F6A40E3, 0xF50789A6, 0xE6A511D1, 0xD242B948, 0xC1E0213F, + 0x26992BC2, 0x353BB3B5, 0x01DC1B2C, 0x127E835B, 0x68134A1E, 0x7BB1D269, 0x4F567AF0, 0x5CF4E287, + 0x04D43CFD, 0x1776A48A, 0x23910C13, 0x30339464, 0x4A5E5D21, 0x59FCC556, 0x6D1B6DCF, 0x7EB9F5B8, + 0x99C0FF45, 0x8A626732, 0xBE85CFAB, 0xAD2757DC, 0xD74A9E99, 0xC4E806EE, 0xF00FAE77, 0xE3AD3600, + 0x3B11CD7C, 0x28B3550B, 0x1C54FD92, 0x0FF665E5, 0x759BACA0, 0x663934D7, 0x52DE9C4E, 0x417C0439, + 0xA6050EC4, 0xB5A796B3, 0x81403E2A, 0x92E2A65D, 0xE88F6F18, 0xFB2DF76F, 0xCFCA5FF6, 0xDC68C781, + 0x7B5FDFFF, 0x68FD4788, 0x5C1AEF11, 0x4FB87766, 0x35D5BE23, 0x26772654, 0x12908ECD, 0x013216BA, + 0xE64B1C47, 0xF5E98430, 0xC10E2CA9, 0xD2ACB4DE, 0xA8C17D9B, 0xBB63E5EC, 0x8F844D75, 0x9C26D502, + 0x449A2E7E, 0x5738B609, 0x63DF1E90, 0x707D86E7, 0x0A104FA2, 0x19B2D7D5, 0x2D557F4C, 0x3EF7E73B, + 0xD98EEDC6, 0xCA2C75B1, 0xFECBDD28, 0xED69455F, 0x97048C1A, 0x84A6146D, 0xB041BCF4, 0xA3E32483 +}; + +/* + * end of the CRC lookup table crc_tableil8_o40 + */ + + + +/* + * The following CRC lookup table was generated automagically using the + * following model parameters: + * + * Generator Polynomial = ................. 0x1EDC6F41 + * Generator Polynomial Length = .......... 32 bits + * Reflected Bits = ....................... TRUE + * Table Generation Offset = .............. 32 bits + * Number of Slices = ..................... 8 slices + * Slice Lengths = ........................ 8 8 8 8 8 8 8 8 + * Directory Name = ....................... .\ + * File Name = ............................ 8x256_tables.c + */ + +static uint32_t sctp_crc_tableil8_o48[256] = +{ + 0x00000000, 0xA541927E, 0x4F6F520D, 0xEA2EC073, 0x9EDEA41A, 0x3B9F3664, 0xD1B1F617, 0x74F06469, + 0x38513EC5, 0x9D10ACBB, 0x773E6CC8, 0xD27FFEB6, 0xA68F9ADF, 0x03CE08A1, 0xE9E0C8D2, 0x4CA15AAC, + 0x70A27D8A, 0xD5E3EFF4, 0x3FCD2F87, 0x9A8CBDF9, 0xEE7CD990, 0x4B3D4BEE, 0xA1138B9D, 0x045219E3, + 0x48F3434F, 0xEDB2D131, 0x079C1142, 0xA2DD833C, 0xD62DE755, 0x736C752B, 0x9942B558, 0x3C032726, + 0xE144FB14, 0x4405696A, 0xAE2BA919, 0x0B6A3B67, 0x7F9A5F0E, 0xDADBCD70, 0x30F50D03, 0x95B49F7D, + 0xD915C5D1, 0x7C5457AF, 0x967A97DC, 0x333B05A2, 0x47CB61CB, 0xE28AF3B5, 0x08A433C6, 0xADE5A1B8, + 0x91E6869E, 0x34A714E0, 0xDE89D493, 0x7BC846ED, 0x0F382284, 0xAA79B0FA, 0x40577089, 0xE516E2F7, + 0xA9B7B85B, 0x0CF62A25, 0xE6D8EA56, 0x43997828, 0x37691C41, 0x92288E3F, 0x78064E4C, 0xDD47DC32, + 0xC76580D9, 0x622412A7, 0x880AD2D4, 0x2D4B40AA, 0x59BB24C3, 0xFCFAB6BD, 0x16D476CE, 0xB395E4B0, + 0xFF34BE1C, 0x5A752C62, 0xB05BEC11, 0x151A7E6F, 0x61EA1A06, 0xC4AB8878, 0x2E85480B, 0x8BC4DA75, + 0xB7C7FD53, 0x12866F2D, 0xF8A8AF5E, 0x5DE93D20, 0x29195949, 0x8C58CB37, 0x66760B44, 0xC337993A, + 0x8F96C396, 0x2AD751E8, 0xC0F9919B, 0x65B803E5, 0x1148678C, 0xB409F5F2, 0x5E273581, 0xFB66A7FF, + 0x26217BCD, 0x8360E9B3, 0x694E29C0, 0xCC0FBBBE, 0xB8FFDFD7, 0x1DBE4DA9, 0xF7908DDA, 0x52D11FA4, + 0x1E704508, 0xBB31D776, 0x511F1705, 0xF45E857B, 0x80AEE112, 0x25EF736C, 0xCFC1B31F, 0x6A802161, + 0x56830647, 0xF3C29439, 0x19EC544A, 0xBCADC634, 0xC85DA25D, 0x6D1C3023, 0x8732F050, 0x2273622E, + 0x6ED23882, 0xCB93AAFC, 0x21BD6A8F, 0x84FCF8F1, 0xF00C9C98, 0x554D0EE6, 0xBF63CE95, 0x1A225CEB, + 0x8B277743, 0x2E66E53D, 0xC448254E, 0x6109B730, 0x15F9D359, 0xB0B84127, 0x5A968154, 0xFFD7132A, + 0xB3764986, 0x1637DBF8, 0xFC191B8B, 0x595889F5, 0x2DA8ED9C, 0x88E97FE2, 0x62C7BF91, 0xC7862DEF, + 0xFB850AC9, 0x5EC498B7, 0xB4EA58C4, 0x11ABCABA, 0x655BAED3, 0xC01A3CAD, 0x2A34FCDE, 0x8F756EA0, + 0xC3D4340C, 0x6695A672, 0x8CBB6601, 0x29FAF47F, 0x5D0A9016, 0xF84B0268, 0x1265C21B, 0xB7245065, + 0x6A638C57, 0xCF221E29, 0x250CDE5A, 0x804D4C24, 0xF4BD284D, 0x51FCBA33, 0xBBD27A40, 0x1E93E83E, + 0x5232B292, 0xF77320EC, 0x1D5DE09F, 0xB81C72E1, 0xCCEC1688, 0x69AD84F6, 0x83834485, 0x26C2D6FB, + 0x1AC1F1DD, 0xBF8063A3, 0x55AEA3D0, 0xF0EF31AE, 0x841F55C7, 0x215EC7B9, 0xCB7007CA, 0x6E3195B4, + 0x2290CF18, 0x87D15D66, 0x6DFF9D15, 0xC8BE0F6B, 0xBC4E6B02, 0x190FF97C, 0xF321390F, 0x5660AB71, + 0x4C42F79A, 0xE90365E4, 0x032DA597, 0xA66C37E9, 0xD29C5380, 0x77DDC1FE, 0x9DF3018D, 0x38B293F3, + 0x7413C95F, 0xD1525B21, 0x3B7C9B52, 0x9E3D092C, 0xEACD6D45, 0x4F8CFF3B, 0xA5A23F48, 0x00E3AD36, + 0x3CE08A10, 0x99A1186E, 0x738FD81D, 0xD6CE4A63, 0xA23E2E0A, 0x077FBC74, 0xED517C07, 0x4810EE79, + 0x04B1B4D5, 0xA1F026AB, 0x4BDEE6D8, 0xEE9F74A6, 0x9A6F10CF, 0x3F2E82B1, 0xD50042C2, 0x7041D0BC, + 0xAD060C8E, 0x08479EF0, 0xE2695E83, 0x4728CCFD, 0x33D8A894, 0x96993AEA, 0x7CB7FA99, 0xD9F668E7, + 0x9557324B, 0x3016A035, 0xDA386046, 0x7F79F238, 0x0B899651, 0xAEC8042F, 0x44E6C45C, 0xE1A75622, + 0xDDA47104, 0x78E5E37A, 0x92CB2309, 0x378AB177, 0x437AD51E, 0xE63B4760, 0x0C158713, 0xA954156D, + 0xE5F54FC1, 0x40B4DDBF, 0xAA9A1DCC, 0x0FDB8FB2, 0x7B2BEBDB, 0xDE6A79A5, 0x3444B9D6, 0x91052BA8 +}; + +/* + * end of the CRC lookup table crc_tableil8_o48 + */ + + + +/* + * The following CRC lookup table was generated automagically using the + * following model parameters: + * + * Generator Polynomial = ................. 0x1EDC6F41 + * Generator Polynomial Length = .......... 32 bits + * Reflected Bits = ....................... TRUE + * Table Generation Offset = .............. 32 bits + * Number of Slices = ..................... 8 slices + * Slice Lengths = ........................ 8 8 8 8 8 8 8 8 + * Directory Name = ....................... .\ + * File Name = ............................ 8x256_tables.c + */ + +static uint32_t sctp_crc_tableil8_o56[256] = +{ + 0x00000000, 0xDD45AAB8, 0xBF672381, 0x62228939, 0x7B2231F3, 0xA6679B4B, 0xC4451272, 0x1900B8CA, + 0xF64463E6, 0x2B01C95E, 0x49234067, 0x9466EADF, 0x8D665215, 0x5023F8AD, 0x32017194, 0xEF44DB2C, + 0xE964B13D, 0x34211B85, 0x560392BC, 0x8B463804, 0x924680CE, 0x4F032A76, 0x2D21A34F, 0xF06409F7, + 0x1F20D2DB, 0xC2657863, 0xA047F15A, 0x7D025BE2, 0x6402E328, 0xB9474990, 0xDB65C0A9, 0x06206A11, + 0xD725148B, 0x0A60BE33, 0x6842370A, 0xB5079DB2, 0xAC072578, 0x71428FC0, 0x136006F9, 0xCE25AC41, + 0x2161776D, 0xFC24DDD5, 0x9E0654EC, 0x4343FE54, 0x5A43469E, 0x8706EC26, 0xE524651F, 0x3861CFA7, + 0x3E41A5B6, 0xE3040F0E, 0x81268637, 0x5C632C8F, 0x45639445, 0x98263EFD, 0xFA04B7C4, 0x27411D7C, + 0xC805C650, 0x15406CE8, 0x7762E5D1, 0xAA274F69, 0xB327F7A3, 0x6E625D1B, 0x0C40D422, 0xD1057E9A, + 0xABA65FE7, 0x76E3F55F, 0x14C17C66, 0xC984D6DE, 0xD0846E14, 0x0DC1C4AC, 0x6FE34D95, 0xB2A6E72D, + 0x5DE23C01, 0x80A796B9, 0xE2851F80, 0x3FC0B538, 0x26C00DF2, 0xFB85A74A, 0x99A72E73, 0x44E284CB, + 0x42C2EEDA, 0x9F874462, 0xFDA5CD5B, 0x20E067E3, 0x39E0DF29, 0xE4A57591, 0x8687FCA8, 0x5BC25610, + 0xB4868D3C, 0x69C32784, 0x0BE1AEBD, 0xD6A40405, 0xCFA4BCCF, 0x12E11677, 0x70C39F4E, 0xAD8635F6, + 0x7C834B6C, 0xA1C6E1D4, 0xC3E468ED, 0x1EA1C255, 0x07A17A9F, 0xDAE4D027, 0xB8C6591E, 0x6583F3A6, + 0x8AC7288A, 0x57828232, 0x35A00B0B, 0xE8E5A1B3, 0xF1E51979, 0x2CA0B3C1, 0x4E823AF8, 0x93C79040, + 0x95E7FA51, 0x48A250E9, 0x2A80D9D0, 0xF7C57368, 0xEEC5CBA2, 0x3380611A, 0x51A2E823, 0x8CE7429B, + 0x63A399B7, 0xBEE6330F, 0xDCC4BA36, 0x0181108E, 0x1881A844, 0xC5C402FC, 0xA7E68BC5, 0x7AA3217D, + 0x52A0C93F, 0x8FE56387, 0xEDC7EABE, 0x30824006, 0x2982F8CC, 0xF4C75274, 0x96E5DB4D, 0x4BA071F5, + 0xA4E4AAD9, 0x79A10061, 0x1B838958, 0xC6C623E0, 0xDFC69B2A, 0x02833192, 0x60A1B8AB, 0xBDE41213, + 0xBBC47802, 0x6681D2BA, 0x04A35B83, 0xD9E6F13B, 0xC0E649F1, 0x1DA3E349, 0x7F816A70, 0xA2C4C0C8, + 0x4D801BE4, 0x90C5B15C, 0xF2E73865, 0x2FA292DD, 0x36A22A17, 0xEBE780AF, 0x89C50996, 0x5480A32E, + 0x8585DDB4, 0x58C0770C, 0x3AE2FE35, 0xE7A7548D, 0xFEA7EC47, 0x23E246FF, 0x41C0CFC6, 0x9C85657E, + 0x73C1BE52, 0xAE8414EA, 0xCCA69DD3, 0x11E3376B, 0x08E38FA1, 0xD5A62519, 0xB784AC20, 0x6AC10698, + 0x6CE16C89, 0xB1A4C631, 0xD3864F08, 0x0EC3E5B0, 0x17C35D7A, 0xCA86F7C2, 0xA8A47EFB, 0x75E1D443, + 0x9AA50F6F, 0x47E0A5D7, 0x25C22CEE, 0xF8878656, 0xE1873E9C, 0x3CC29424, 0x5EE01D1D, 0x83A5B7A5, + 0xF90696D8, 0x24433C60, 0x4661B559, 0x9B241FE1, 0x8224A72B, 0x5F610D93, 0x3D4384AA, 0xE0062E12, + 0x0F42F53E, 0xD2075F86, 0xB025D6BF, 0x6D607C07, 0x7460C4CD, 0xA9256E75, 0xCB07E74C, 0x16424DF4, + 0x106227E5, 0xCD278D5D, 0xAF050464, 0x7240AEDC, 0x6B401616, 0xB605BCAE, 0xD4273597, 0x09629F2F, + 0xE6264403, 0x3B63EEBB, 0x59416782, 0x8404CD3A, 0x9D0475F0, 0x4041DF48, 0x22635671, 0xFF26FCC9, + 0x2E238253, 0xF36628EB, 0x9144A1D2, 0x4C010B6A, 0x5501B3A0, 0x88441918, 0xEA669021, 0x37233A99, + 0xD867E1B5, 0x05224B0D, 0x6700C234, 0xBA45688C, 0xA345D046, 0x7E007AFE, 0x1C22F3C7, 0xC167597F, + 0xC747336E, 0x1A0299D6, 0x782010EF, 0xA565BA57, 0xBC65029D, 0x6120A825, 0x0302211C, 0xDE478BA4, + 0x31035088, 0xEC46FA30, 0x8E647309, 0x5321D9B1, 0x4A21617B, 0x9764CBC3, 0xF54642FA, 0x2803E842 +}; + +/* + * end of the CRC lookup table crc_tableil8_o56 + */ + + + +/* + * The following CRC lookup table was generated automagically using the + * following model parameters: + * + * Generator Polynomial = ................. 0x1EDC6F41 + * Generator Polynomial Length = .......... 32 bits + * Reflected Bits = ....................... TRUE + * Table Generation Offset = .............. 32 bits + * Number of Slices = ..................... 8 slices + * Slice Lengths = ........................ 8 8 8 8 8 8 8 8 + * Directory Name = ....................... .\ + * File Name = ............................ 8x256_tables.c + */ + +static uint32_t sctp_crc_tableil8_o64[256] = +{ + 0x00000000, 0x38116FAC, 0x7022DF58, 0x4833B0F4, 0xE045BEB0, 0xD854D11C, 0x906761E8, 0xA8760E44, + 0xC5670B91, 0xFD76643D, 0xB545D4C9, 0x8D54BB65, 0x2522B521, 0x1D33DA8D, 0x55006A79, 0x6D1105D5, + 0x8F2261D3, 0xB7330E7F, 0xFF00BE8B, 0xC711D127, 0x6F67DF63, 0x5776B0CF, 0x1F45003B, 0x27546F97, + 0x4A456A42, 0x725405EE, 0x3A67B51A, 0x0276DAB6, 0xAA00D4F2, 0x9211BB5E, 0xDA220BAA, 0xE2336406, + 0x1BA8B557, 0x23B9DAFB, 0x6B8A6A0F, 0x539B05A3, 0xFBED0BE7, 0xC3FC644B, 0x8BCFD4BF, 0xB3DEBB13, + 0xDECFBEC6, 0xE6DED16A, 0xAEED619E, 0x96FC0E32, 0x3E8A0076, 0x069B6FDA, 0x4EA8DF2E, 0x76B9B082, + 0x948AD484, 0xAC9BBB28, 0xE4A80BDC, 0xDCB96470, 0x74CF6A34, 0x4CDE0598, 0x04EDB56C, 0x3CFCDAC0, + 0x51EDDF15, 0x69FCB0B9, 0x21CF004D, 0x19DE6FE1, 0xB1A861A5, 0x89B90E09, 0xC18ABEFD, 0xF99BD151, + 0x37516AAE, 0x0F400502, 0x4773B5F6, 0x7F62DA5A, 0xD714D41E, 0xEF05BBB2, 0xA7360B46, 0x9F2764EA, + 0xF236613F, 0xCA270E93, 0x8214BE67, 0xBA05D1CB, 0x1273DF8F, 0x2A62B023, 0x625100D7, 0x5A406F7B, + 0xB8730B7D, 0x806264D1, 0xC851D425, 0xF040BB89, 0x5836B5CD, 0x6027DA61, 0x28146A95, 0x10050539, + 0x7D1400EC, 0x45056F40, 0x0D36DFB4, 0x3527B018, 0x9D51BE5C, 0xA540D1F0, 0xED736104, 0xD5620EA8, + 0x2CF9DFF9, 0x14E8B055, 0x5CDB00A1, 0x64CA6F0D, 0xCCBC6149, 0xF4AD0EE5, 0xBC9EBE11, 0x848FD1BD, + 0xE99ED468, 0xD18FBBC4, 0x99BC0B30, 0xA1AD649C, 0x09DB6AD8, 0x31CA0574, 0x79F9B580, 0x41E8DA2C, + 0xA3DBBE2A, 0x9BCAD186, 0xD3F96172, 0xEBE80EDE, 0x439E009A, 0x7B8F6F36, 0x33BCDFC2, 0x0BADB06E, + 0x66BCB5BB, 0x5EADDA17, 0x169E6AE3, 0x2E8F054F, 0x86F90B0B, 0xBEE864A7, 0xF6DBD453, 0xCECABBFF, + 0x6EA2D55C, 0x56B3BAF0, 0x1E800A04, 0x269165A8, 0x8EE76BEC, 0xB6F60440, 0xFEC5B4B4, 0xC6D4DB18, + 0xABC5DECD, 0x93D4B161, 0xDBE70195, 0xE3F66E39, 0x4B80607D, 0x73910FD1, 0x3BA2BF25, 0x03B3D089, + 0xE180B48F, 0xD991DB23, 0x91A26BD7, 0xA9B3047B, 0x01C50A3F, 0x39D46593, 0x71E7D567, 0x49F6BACB, + 0x24E7BF1E, 0x1CF6D0B2, 0x54C56046, 0x6CD40FEA, 0xC4A201AE, 0xFCB36E02, 0xB480DEF6, 0x8C91B15A, + 0x750A600B, 0x4D1B0FA7, 0x0528BF53, 0x3D39D0FF, 0x954FDEBB, 0xAD5EB117, 0xE56D01E3, 0xDD7C6E4F, + 0xB06D6B9A, 0x887C0436, 0xC04FB4C2, 0xF85EDB6E, 0x5028D52A, 0x6839BA86, 0x200A0A72, 0x181B65DE, + 0xFA2801D8, 0xC2396E74, 0x8A0ADE80, 0xB21BB12C, 0x1A6DBF68, 0x227CD0C4, 0x6A4F6030, 0x525E0F9C, + 0x3F4F0A49, 0x075E65E5, 0x4F6DD511, 0x777CBABD, 0xDF0AB4F9, 0xE71BDB55, 0xAF286BA1, 0x9739040D, + 0x59F3BFF2, 0x61E2D05E, 0x29D160AA, 0x11C00F06, 0xB9B60142, 0x81A76EEE, 0xC994DE1A, 0xF185B1B6, + 0x9C94B463, 0xA485DBCF, 0xECB66B3B, 0xD4A70497, 0x7CD10AD3, 0x44C0657F, 0x0CF3D58B, 0x34E2BA27, + 0xD6D1DE21, 0xEEC0B18D, 0xA6F30179, 0x9EE26ED5, 0x36946091, 0x0E850F3D, 0x46B6BFC9, 0x7EA7D065, + 0x13B6D5B0, 0x2BA7BA1C, 0x63940AE8, 0x5B856544, 0xF3F36B00, 0xCBE204AC, 0x83D1B458, 0xBBC0DBF4, + 0x425B0AA5, 0x7A4A6509, 0x3279D5FD, 0x0A68BA51, 0xA21EB415, 0x9A0FDBB9, 0xD23C6B4D, 0xEA2D04E1, + 0x873C0134, 0xBF2D6E98, 0xF71EDE6C, 0xCF0FB1C0, 0x6779BF84, 0x5F68D028, 0x175B60DC, 0x2F4A0F70, + 0xCD796B76, 0xF56804DA, 0xBD5BB42E, 0x854ADB82, 0x2D3CD5C6, 0x152DBA6A, 0x5D1E0A9E, 0x650F6532, + 0x081E60E7, 0x300F0F4B, 0x783CBFBF, 0x402DD013, 0xE85BDE57, 0xD04AB1FB, 0x9879010F, 0xA0686EA3 +}; + +/* + * end of the CRC lookup table crc_tableil8_o64 + */ + + + +/* + * The following CRC lookup table was generated automagically using the + * following model parameters: + * + * Generator Polynomial = ................. 0x1EDC6F41 + * Generator Polynomial Length = .......... 32 bits + * Reflected Bits = ....................... TRUE + * Table Generation Offset = .............. 32 bits + * Number of Slices = ..................... 8 slices + * Slice Lengths = ........................ 8 8 8 8 8 8 8 8 + * Directory Name = ....................... .\ + * File Name = ............................ 8x256_tables.c + */ + +static uint32_t sctp_crc_tableil8_o72[256] = +{ + 0x00000000, 0xEF306B19, 0xDB8CA0C3, 0x34BCCBDA, 0xB2F53777, 0x5DC55C6E, 0x697997B4, 0x8649FCAD, + 0x6006181F, 0x8F367306, 0xBB8AB8DC, 0x54BAD3C5, 0xD2F32F68, 0x3DC34471, 0x097F8FAB, 0xE64FE4B2, + 0xC00C303E, 0x2F3C5B27, 0x1B8090FD, 0xF4B0FBE4, 0x72F90749, 0x9DC96C50, 0xA975A78A, 0x4645CC93, + 0xA00A2821, 0x4F3A4338, 0x7B8688E2, 0x94B6E3FB, 0x12FF1F56, 0xFDCF744F, 0xC973BF95, 0x2643D48C, + 0x85F4168D, 0x6AC47D94, 0x5E78B64E, 0xB148DD57, 0x370121FA, 0xD8314AE3, 0xEC8D8139, 0x03BDEA20, + 0xE5F20E92, 0x0AC2658B, 0x3E7EAE51, 0xD14EC548, 0x570739E5, 0xB83752FC, 0x8C8B9926, 0x63BBF23F, + 0x45F826B3, 0xAAC84DAA, 0x9E748670, 0x7144ED69, 0xF70D11C4, 0x183D7ADD, 0x2C81B107, 0xC3B1DA1E, + 0x25FE3EAC, 0xCACE55B5, 0xFE729E6F, 0x1142F576, 0x970B09DB, 0x783B62C2, 0x4C87A918, 0xA3B7C201, + 0x0E045BEB, 0xE13430F2, 0xD588FB28, 0x3AB89031, 0xBCF16C9C, 0x53C10785, 0x677DCC5F, 0x884DA746, + 0x6E0243F4, 0x813228ED, 0xB58EE337, 0x5ABE882E, 0xDCF77483, 0x33C71F9A, 0x077BD440, 0xE84BBF59, + 0xCE086BD5, 0x213800CC, 0x1584CB16, 0xFAB4A00F, 0x7CFD5CA2, 0x93CD37BB, 0xA771FC61, 0x48419778, + 0xAE0E73CA, 0x413E18D3, 0x7582D309, 0x9AB2B810, 0x1CFB44BD, 0xF3CB2FA4, 0xC777E47E, 0x28478F67, + 0x8BF04D66, 0x64C0267F, 0x507CEDA5, 0xBF4C86BC, 0x39057A11, 0xD6351108, 0xE289DAD2, 0x0DB9B1CB, + 0xEBF65579, 0x04C63E60, 0x307AF5BA, 0xDF4A9EA3, 0x5903620E, 0xB6330917, 0x828FC2CD, 0x6DBFA9D4, + 0x4BFC7D58, 0xA4CC1641, 0x9070DD9B, 0x7F40B682, 0xF9094A2F, 0x16392136, 0x2285EAEC, 0xCDB581F5, + 0x2BFA6547, 0xC4CA0E5E, 0xF076C584, 0x1F46AE9D, 0x990F5230, 0x763F3929, 0x4283F2F3, 0xADB399EA, + 0x1C08B7D6, 0xF338DCCF, 0xC7841715, 0x28B47C0C, 0xAEFD80A1, 0x41CDEBB8, 0x75712062, 0x9A414B7B, + 0x7C0EAFC9, 0x933EC4D0, 0xA7820F0A, 0x48B26413, 0xCEFB98BE, 0x21CBF3A7, 0x1577387D, 0xFA475364, + 0xDC0487E8, 0x3334ECF1, 0x0788272B, 0xE8B84C32, 0x6EF1B09F, 0x81C1DB86, 0xB57D105C, 0x5A4D7B45, + 0xBC029FF7, 0x5332F4EE, 0x678E3F34, 0x88BE542D, 0x0EF7A880, 0xE1C7C399, 0xD57B0843, 0x3A4B635A, + 0x99FCA15B, 0x76CCCA42, 0x42700198, 0xAD406A81, 0x2B09962C, 0xC439FD35, 0xF08536EF, 0x1FB55DF6, + 0xF9FAB944, 0x16CAD25D, 0x22761987, 0xCD46729E, 0x4B0F8E33, 0xA43FE52A, 0x90832EF0, 0x7FB345E9, + 0x59F09165, 0xB6C0FA7C, 0x827C31A6, 0x6D4C5ABF, 0xEB05A612, 0x0435CD0B, 0x308906D1, 0xDFB96DC8, + 0x39F6897A, 0xD6C6E263, 0xE27A29B9, 0x0D4A42A0, 0x8B03BE0D, 0x6433D514, 0x508F1ECE, 0xBFBF75D7, + 0x120CEC3D, 0xFD3C8724, 0xC9804CFE, 0x26B027E7, 0xA0F9DB4A, 0x4FC9B053, 0x7B757B89, 0x94451090, + 0x720AF422, 0x9D3A9F3B, 0xA98654E1, 0x46B63FF8, 0xC0FFC355, 0x2FCFA84C, 0x1B736396, 0xF443088F, + 0xD200DC03, 0x3D30B71A, 0x098C7CC0, 0xE6BC17D9, 0x60F5EB74, 0x8FC5806D, 0xBB794BB7, 0x544920AE, + 0xB206C41C, 0x5D36AF05, 0x698A64DF, 0x86BA0FC6, 0x00F3F36B, 0xEFC39872, 0xDB7F53A8, 0x344F38B1, + 0x97F8FAB0, 0x78C891A9, 0x4C745A73, 0xA344316A, 0x250DCDC7, 0xCA3DA6DE, 0xFE816D04, 0x11B1061D, + 0xF7FEE2AF, 0x18CE89B6, 0x2C72426C, 0xC3422975, 0x450BD5D8, 0xAA3BBEC1, 0x9E87751B, 0x71B71E02, + 0x57F4CA8E, 0xB8C4A197, 0x8C786A4D, 0x63480154, 0xE501FDF9, 0x0A3196E0, 0x3E8D5D3A, 0xD1BD3623, + 0x37F2D291, 0xD8C2B988, 0xEC7E7252, 0x034E194B, 0x8507E5E6, 0x6A378EFF, 0x5E8B4525, 0xB1BB2E3C +}; + +/* + * end of the CRC lookup table crc_tableil8_o72 + */ + + + +/* + * The following CRC lookup table was generated automagically using the + * following model parameters: + * + * Generator Polynomial = ................. 0x1EDC6F41 + * Generator Polynomial Length = .......... 32 bits + * Reflected Bits = ....................... TRUE + * Table Generation Offset = .............. 32 bits + * Number of Slices = ..................... 8 slices + * Slice Lengths = ........................ 8 8 8 8 8 8 8 8 + * Directory Name = ....................... .\ + * File Name = ............................ 8x256_tables.c + */ + +static uint32_t sctp_crc_tableil8_o80[256] = +{ + 0x00000000, 0x68032CC8, 0xD0065990, 0xB8057558, 0xA5E0C5D1, 0xCDE3E919, 0x75E69C41, 0x1DE5B089, + 0x4E2DFD53, 0x262ED19B, 0x9E2BA4C3, 0xF628880B, 0xEBCD3882, 0x83CE144A, 0x3BCB6112, 0x53C84DDA, + 0x9C5BFAA6, 0xF458D66E, 0x4C5DA336, 0x245E8FFE, 0x39BB3F77, 0x51B813BF, 0xE9BD66E7, 0x81BE4A2F, + 0xD27607F5, 0xBA752B3D, 0x02705E65, 0x6A7372AD, 0x7796C224, 0x1F95EEEC, 0xA7909BB4, 0xCF93B77C, + 0x3D5B83BD, 0x5558AF75, 0xED5DDA2D, 0x855EF6E5, 0x98BB466C, 0xF0B86AA4, 0x48BD1FFC, 0x20BE3334, + 0x73767EEE, 0x1B755226, 0xA370277E, 0xCB730BB6, 0xD696BB3F, 0xBE9597F7, 0x0690E2AF, 0x6E93CE67, + 0xA100791B, 0xC90355D3, 0x7106208B, 0x19050C43, 0x04E0BCCA, 0x6CE39002, 0xD4E6E55A, 0xBCE5C992, + 0xEF2D8448, 0x872EA880, 0x3F2BDDD8, 0x5728F110, 0x4ACD4199, 0x22CE6D51, 0x9ACB1809, 0xF2C834C1, + 0x7AB7077A, 0x12B42BB2, 0xAAB15EEA, 0xC2B27222, 0xDF57C2AB, 0xB754EE63, 0x0F519B3B, 0x6752B7F3, + 0x349AFA29, 0x5C99D6E1, 0xE49CA3B9, 0x8C9F8F71, 0x917A3FF8, 0xF9791330, 0x417C6668, 0x297F4AA0, + 0xE6ECFDDC, 0x8EEFD114, 0x36EAA44C, 0x5EE98884, 0x430C380D, 0x2B0F14C5, 0x930A619D, 0xFB094D55, + 0xA8C1008F, 0xC0C22C47, 0x78C7591F, 0x10C475D7, 0x0D21C55E, 0x6522E996, 0xDD279CCE, 0xB524B006, + 0x47EC84C7, 0x2FEFA80F, 0x97EADD57, 0xFFE9F19F, 0xE20C4116, 0x8A0F6DDE, 0x320A1886, 0x5A09344E, + 0x09C17994, 0x61C2555C, 0xD9C72004, 0xB1C40CCC, 0xAC21BC45, 0xC422908D, 0x7C27E5D5, 0x1424C91D, + 0xDBB77E61, 0xB3B452A9, 0x0BB127F1, 0x63B20B39, 0x7E57BBB0, 0x16549778, 0xAE51E220, 0xC652CEE8, + 0x959A8332, 0xFD99AFFA, 0x459CDAA2, 0x2D9FF66A, 0x307A46E3, 0x58796A2B, 0xE07C1F73, 0x887F33BB, + 0xF56E0EF4, 0x9D6D223C, 0x25685764, 0x4D6B7BAC, 0x508ECB25, 0x388DE7ED, 0x808892B5, 0xE88BBE7D, + 0xBB43F3A7, 0xD340DF6F, 0x6B45AA37, 0x034686FF, 0x1EA33676, 0x76A01ABE, 0xCEA56FE6, 0xA6A6432E, + 0x6935F452, 0x0136D89A, 0xB933ADC2, 0xD130810A, 0xCCD53183, 0xA4D61D4B, 0x1CD36813, 0x74D044DB, + 0x27180901, 0x4F1B25C9, 0xF71E5091, 0x9F1D7C59, 0x82F8CCD0, 0xEAFBE018, 0x52FE9540, 0x3AFDB988, + 0xC8358D49, 0xA036A181, 0x1833D4D9, 0x7030F811, 0x6DD54898, 0x05D66450, 0xBDD31108, 0xD5D03DC0, + 0x8618701A, 0xEE1B5CD2, 0x561E298A, 0x3E1D0542, 0x23F8B5CB, 0x4BFB9903, 0xF3FEEC5B, 0x9BFDC093, + 0x546E77EF, 0x3C6D5B27, 0x84682E7F, 0xEC6B02B7, 0xF18EB23E, 0x998D9EF6, 0x2188EBAE, 0x498BC766, + 0x1A438ABC, 0x7240A674, 0xCA45D32C, 0xA246FFE4, 0xBFA34F6D, 0xD7A063A5, 0x6FA516FD, 0x07A63A35, + 0x8FD9098E, 0xE7DA2546, 0x5FDF501E, 0x37DC7CD6, 0x2A39CC5F, 0x423AE097, 0xFA3F95CF, 0x923CB907, + 0xC1F4F4DD, 0xA9F7D815, 0x11F2AD4D, 0x79F18185, 0x6414310C, 0x0C171DC4, 0xB412689C, 0xDC114454, + 0x1382F328, 0x7B81DFE0, 0xC384AAB8, 0xAB878670, 0xB66236F9, 0xDE611A31, 0x66646F69, 0x0E6743A1, + 0x5DAF0E7B, 0x35AC22B3, 0x8DA957EB, 0xE5AA7B23, 0xF84FCBAA, 0x904CE762, 0x2849923A, 0x404ABEF2, + 0xB2828A33, 0xDA81A6FB, 0x6284D3A3, 0x0A87FF6B, 0x17624FE2, 0x7F61632A, 0xC7641672, 0xAF673ABA, + 0xFCAF7760, 0x94AC5BA8, 0x2CA92EF0, 0x44AA0238, 0x594FB2B1, 0x314C9E79, 0x8949EB21, 0xE14AC7E9, + 0x2ED97095, 0x46DA5C5D, 0xFEDF2905, 0x96DC05CD, 0x8B39B544, 0xE33A998C, 0x5B3FECD4, 0x333CC01C, + 0x60F48DC6, 0x08F7A10E, 0xB0F2D456, 0xD8F1F89E, 0xC5144817, 0xAD1764DF, 0x15121187, 0x7D113D4F +}; + +/* + * end of the CRC lookup table crc_tableil8_o80 + */ + + + +/* + * The following CRC lookup table was generated automagically using the + * following model parameters: + * + * Generator Polynomial = ................. 0x1EDC6F41 + * Generator Polynomial Length = .......... 32 bits + * Reflected Bits = ....................... TRUE + * Table Generation Offset = .............. 32 bits + * Number of Slices = ..................... 8 slices + * Slice Lengths = ........................ 8 8 8 8 8 8 8 8 + * Directory Name = ....................... .\ + * File Name = ............................ 8x256_tables.c + */ + +static uint32_t sctp_crc_tableil8_o88[256] = +{ + 0x00000000, 0x493C7D27, 0x9278FA4E, 0xDB448769, 0x211D826D, 0x6821FF4A, 0xB3657823, 0xFA590504, + 0x423B04DA, 0x0B0779FD, 0xD043FE94, 0x997F83B3, 0x632686B7, 0x2A1AFB90, 0xF15E7CF9, 0xB86201DE, + 0x847609B4, 0xCD4A7493, 0x160EF3FA, 0x5F328EDD, 0xA56B8BD9, 0xEC57F6FE, 0x37137197, 0x7E2F0CB0, + 0xC64D0D6E, 0x8F717049, 0x5435F720, 0x1D098A07, 0xE7508F03, 0xAE6CF224, 0x7528754D, 0x3C14086A, + 0x0D006599, 0x443C18BE, 0x9F789FD7, 0xD644E2F0, 0x2C1DE7F4, 0x65219AD3, 0xBE651DBA, 0xF759609D, + 0x4F3B6143, 0x06071C64, 0xDD439B0D, 0x947FE62A, 0x6E26E32E, 0x271A9E09, 0xFC5E1960, 0xB5626447, + 0x89766C2D, 0xC04A110A, 0x1B0E9663, 0x5232EB44, 0xA86BEE40, 0xE1579367, 0x3A13140E, 0x732F6929, + 0xCB4D68F7, 0x827115D0, 0x593592B9, 0x1009EF9E, 0xEA50EA9A, 0xA36C97BD, 0x782810D4, 0x31146DF3, + 0x1A00CB32, 0x533CB615, 0x8878317C, 0xC1444C5B, 0x3B1D495F, 0x72213478, 0xA965B311, 0xE059CE36, + 0x583BCFE8, 0x1107B2CF, 0xCA4335A6, 0x837F4881, 0x79264D85, 0x301A30A2, 0xEB5EB7CB, 0xA262CAEC, + 0x9E76C286, 0xD74ABFA1, 0x0C0E38C8, 0x453245EF, 0xBF6B40EB, 0xF6573DCC, 0x2D13BAA5, 0x642FC782, + 0xDC4DC65C, 0x9571BB7B, 0x4E353C12, 0x07094135, 0xFD504431, 0xB46C3916, 0x6F28BE7F, 0x2614C358, + 0x1700AEAB, 0x5E3CD38C, 0x857854E5, 0xCC4429C2, 0x361D2CC6, 0x7F2151E1, 0xA465D688, 0xED59ABAF, + 0x553BAA71, 0x1C07D756, 0xC743503F, 0x8E7F2D18, 0x7426281C, 0x3D1A553B, 0xE65ED252, 0xAF62AF75, + 0x9376A71F, 0xDA4ADA38, 0x010E5D51, 0x48322076, 0xB26B2572, 0xFB575855, 0x2013DF3C, 0x692FA21B, + 0xD14DA3C5, 0x9871DEE2, 0x4335598B, 0x0A0924AC, 0xF05021A8, 0xB96C5C8F, 0x6228DBE6, 0x2B14A6C1, + 0x34019664, 0x7D3DEB43, 0xA6796C2A, 0xEF45110D, 0x151C1409, 0x5C20692E, 0x8764EE47, 0xCE589360, + 0x763A92BE, 0x3F06EF99, 0xE44268F0, 0xAD7E15D7, 0x572710D3, 0x1E1B6DF4, 0xC55FEA9D, 0x8C6397BA, + 0xB0779FD0, 0xF94BE2F7, 0x220F659E, 0x6B3318B9, 0x916A1DBD, 0xD856609A, 0x0312E7F3, 0x4A2E9AD4, + 0xF24C9B0A, 0xBB70E62D, 0x60346144, 0x29081C63, 0xD3511967, 0x9A6D6440, 0x4129E329, 0x08159E0E, + 0x3901F3FD, 0x703D8EDA, 0xAB7909B3, 0xE2457494, 0x181C7190, 0x51200CB7, 0x8A648BDE, 0xC358F6F9, + 0x7B3AF727, 0x32068A00, 0xE9420D69, 0xA07E704E, 0x5A27754A, 0x131B086D, 0xC85F8F04, 0x8163F223, + 0xBD77FA49, 0xF44B876E, 0x2F0F0007, 0x66337D20, 0x9C6A7824, 0xD5560503, 0x0E12826A, 0x472EFF4D, + 0xFF4CFE93, 0xB67083B4, 0x6D3404DD, 0x240879FA, 0xDE517CFE, 0x976D01D9, 0x4C2986B0, 0x0515FB97, + 0x2E015D56, 0x673D2071, 0xBC79A718, 0xF545DA3F, 0x0F1CDF3B, 0x4620A21C, 0x9D642575, 0xD4585852, + 0x6C3A598C, 0x250624AB, 0xFE42A3C2, 0xB77EDEE5, 0x4D27DBE1, 0x041BA6C6, 0xDF5F21AF, 0x96635C88, + 0xAA7754E2, 0xE34B29C5, 0x380FAEAC, 0x7133D38B, 0x8B6AD68F, 0xC256ABA8, 0x19122CC1, 0x502E51E6, + 0xE84C5038, 0xA1702D1F, 0x7A34AA76, 0x3308D751, 0xC951D255, 0x806DAF72, 0x5B29281B, 0x1215553C, + 0x230138CF, 0x6A3D45E8, 0xB179C281, 0xF845BFA6, 0x021CBAA2, 0x4B20C785, 0x906440EC, 0xD9583DCB, + 0x613A3C15, 0x28064132, 0xF342C65B, 0xBA7EBB7C, 0x4027BE78, 0x091BC35F, 0xD25F4436, 0x9B633911, + 0xA777317B, 0xEE4B4C5C, 0x350FCB35, 0x7C33B612, 0x866AB316, 0xCF56CE31, 0x14124958, 0x5D2E347F, + 0xE54C35A1, 0xAC704886, 0x7734CFEF, 0x3E08B2C8, 0xC451B7CC, 0x8D6DCAEB, 0x56294D82, 0x1F1530A5 +}; + +/* + * end of the CRC lookup table crc_tableil8_o88 + */ + + +static uint32_t +crc32c_sb8_64_bit(uint32_t crc, + const unsigned char *p_buf, + uint32_t length, + uint32_t init_bytes) +{ + uint32_t li; + uint32_t term1, term2; + uint32_t running_length; + uint32_t end_bytes; + + running_length = ((length - init_bytes) / 8) * 8; + end_bytes = length - init_bytes - running_length; + + for (li = 0; li < init_bytes; li++) + crc = sctp_crc_tableil8_o32[(crc ^ *p_buf++) & 0x000000FF] ^ + (crc >> 8); + for (li = 0; li < running_length / 8; li++) { +#if BYTE_ORDER == BIG_ENDIAN + crc ^= *p_buf++; + crc ^= (*p_buf++) << 8; + crc ^= (*p_buf++) << 16; + crc ^= (*p_buf++) << 24; +#else + crc ^= *(const uint32_t *) p_buf; + p_buf += 4; +#endif + term1 = sctp_crc_tableil8_o88[crc & 0x000000FF] ^ + sctp_crc_tableil8_o80[(crc >> 8) & 0x000000FF]; + term2 = crc >> 16; + crc = term1 ^ + sctp_crc_tableil8_o72[term2 & 0x000000FF] ^ + sctp_crc_tableil8_o64[(term2 >> 8) & 0x000000FF]; + +#if BYTE_ORDER == BIG_ENDIAN + crc ^= sctp_crc_tableil8_o56[*p_buf++]; + crc ^= sctp_crc_tableil8_o48[*p_buf++]; + crc ^= sctp_crc_tableil8_o40[*p_buf++]; + crc ^= sctp_crc_tableil8_o32[*p_buf++]; +#else + term1 = sctp_crc_tableil8_o56[(*(const uint32_t *) p_buf) & 0x000000FF] ^ + sctp_crc_tableil8_o48[((*(const uint32_t *) p_buf) >> 8) & 0x000000FF]; + + term2 = (*(const uint32_t *) p_buf) >> 16; + crc = crc ^ + term1 ^ + sctp_crc_tableil8_o40[term2 & 0x000000FF] ^ + sctp_crc_tableil8_o32[(term2 >> 8) & 0x000000FF]; + p_buf += 4; +#endif + } + for (li = 0; li < end_bytes; li++) + crc = sctp_crc_tableil8_o32[(crc ^ *p_buf++) & 0x000000FF] ^ + (crc >> 8); + return crc; +} + +static uint32_t +multitable_crc32c(uint32_t crc32c, + const unsigned char *buffer, + unsigned int length) +{ + uint32_t to_even_word; + + if (length == 0) { + return (crc32c); + } + to_even_word = (4 - (((uintptr_t) buffer) & 0x3)); + return (crc32c_sb8_64_bit(crc32c, buffer, length, to_even_word)); +} + +uint32_t +calculate_crc32c(uint32_t crc32c, + const unsigned char *buffer, + unsigned int length) +{ + if (length < 4) { + return (singletable_crc32c(crc32c, buffer, length)); + } else { + return (multitable_crc32c(crc32c, buffer, length)); + } +} Modified: head/sys/netinet/libalias/alias_sctp.c ============================================================================== --- head/sys/netinet/libalias/alias_sctp.c Sat Feb 14 08:08:08 2009 (r188604) +++ head/sys/netinet/libalias/alias_sctp.c Sat Feb 14 11:34:57 2009 (r188605) @@ -91,8 +91,8 @@ #include #include "alias.h" #include "alias_local.h" -#include #include +#include #endif //#ifdef _KERNEL /* ---------------------------------------------------------------------- @@ -864,6 +864,43 @@ SctpAlias(struct libalias *la, struct ip * @param sndrply SN_SEND_ABORT | SN_REPLY_ABORT | SN_REPLY_ERROR * @param direction SN_TO_LOCAL | SN_TO_GLOBAL */ +static uint32_t +local_sctp_finalize_crc32(uint32_t crc32c) +{ + /* This routine is duplicated from SCTP + * we need to do that since it MAY be that SCTP + * is NOT compiled into the kernel. The CRC32C routines + * however are always available in libkern. + */ + uint32_t result; +#if BYTE_ORDER == BIG_ENDIAN + uint8_t byte0, byte1, byte2, byte3; + +#endif + /* Complement the result */ + result = ~crc32c; +#if BYTE_ORDER == BIG_ENDIAN + /* + * For BIG-ENDIAN.. aka Motorola byte order the result is in + * little-endian form. So we must manually swap the bytes. Then we + * can call htonl() which does nothing... + */ + byte0 = result & 0x000000ff; + byte1 = (result >> 8) & 0x000000ff; + byte2 = (result >> 16) & 0x000000ff; + byte3 = (result >> 24) & 0x000000ff; + crc32c = ((byte0 << 24) | (byte1 << 16) | (byte2 << 8) | byte3); +#else + /* + * For INTEL platforms the result comes out in network order. No + * htonl is required or the swap above. So we optimize out both the + * htonl and the manual swap above. + */ + crc32c = result; +#endif + return (crc32c); +} + static void TxAbortErrorM(struct libalias *la, struct sctp_nat_msg *sm, struct sctp_nat_assoc *assoc, int sndrply, int direction) { @@ -943,7 +980,7 @@ TxAbortErrorM(struct libalias *la, struc /* calculate SCTP header CRC32 */ sctp_hdr->checksum = 0; - sctp_hdr->checksum = sctp_finalize_crc32(update_crc32(0xffffffff, (unsigned char *) sctp_hdr, sctp_size)); + sctp_hdr->checksum = local_sctp_finalize_crc32(calculate_crc32c(0xffffffff, (unsigned char *) sctp_hdr, sctp_size)); memcpy(sm->ip_hdr, ip, ip_size); Modified: head/sys/netinet/sctp_crc32.c ============================================================================== --- head/sys/netinet/sctp_crc32.c Sat Feb 14 08:08:08 2009 (r188604) +++ head/sys/netinet/sctp_crc32.c Sat Feb 14 11:34:57 2009 (r188605) @@ -38,667 +38,17 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include #include -#if !defined(SCTP_WITH_NO_CSUM) -/** - * - * Routine Description: - * - * Computes the CRC32c checksum for the specified buffer using the slicing by 8 - * algorithm over 64 bit quantities. - * - * Arguments: - * - * p_running_crc - pointer to the initial or final remainder value - * used in CRC computations. It should be set to - * non-NULL if the mode argument is equal to CONT or END - * p_buf - the packet buffer where crc computations are being performed - * length - the length of p_buf in bytes - * init_bytes - the number of initial bytes that need to be procesed before - * aligning p_buf to multiples of 4 bytes - * mode - can be any of the following: BEGIN, CONT, END, BODY, ALIGN - * - * Return value: - * - * The computed CRC32c value - */ - - -/* - * Copyright (c) 2004-2006 Intel Corporation - All Rights Reserved - * - * - * This software program is licensed subject to the BSD License, available at - * http://www.opensource.org/licenses/bsd-license.html. - * - * Abstract: - * - * Tables for software CRC generation - */ - -/* - * The following CRC lookup table was generated automagically using the - * following model parameters: - * - * Generator Polynomial = ................. 0x1EDC6F41 - * Generator Polynomial Length = .......... 32 bits - * Reflected Bits = ....................... TRUE - * Table Generation Offset = .............. 32 bits - * Number of Slices = ..................... 8 slices - * Slice Lengths = ........................ 8 8 8 8 8 8 8 8 - * Directory Name = ....................... .\ - * File Name = ............................ 8x256_tables.c - */ - -uint32_t sctp_crc_tableil8_o32[256] = -{ - 0x00000000, 0xF26B8303, 0xE13B70F7, 0x1350F3F4, 0xC79A971F, 0x35F1141C, 0x26A1E7E8, 0xD4CA64EB, - 0x8AD958CF, 0x78B2DBCC, 0x6BE22838, 0x9989AB3B, 0x4D43CFD0, 0xBF284CD3, 0xAC78BF27, 0x5E133C24, - 0x105EC76F, 0xE235446C, 0xF165B798, 0x030E349B, 0xD7C45070, 0x25AFD373, 0x36FF2087, 0xC494A384, - 0x9A879FA0, 0x68EC1CA3, 0x7BBCEF57, 0x89D76C54, 0x5D1D08BF, 0xAF768BBC, 0xBC267848, 0x4E4DFB4B, - 0x20BD8EDE, 0xD2D60DDD, 0xC186FE29, 0x33ED7D2A, 0xE72719C1, 0x154C9AC2, 0x061C6936, 0xF477EA35, - 0xAA64D611, 0x580F5512, 0x4B5FA6E6, 0xB93425E5, 0x6DFE410E, 0x9F95C20D, 0x8CC531F9, 0x7EAEB2FA, - 0x30E349B1, 0xC288CAB2, 0xD1D83946, 0x23B3BA45, 0xF779DEAE, 0x05125DAD, 0x1642AE59, 0xE4292D5A, - 0xBA3A117E, 0x4851927D, 0x5B016189, 0xA96AE28A, 0x7DA08661, 0x8FCB0562, 0x9C9BF696, 0x6EF07595, - 0x417B1DBC, 0xB3109EBF, 0xA0406D4B, 0x522BEE48, 0x86E18AA3, 0x748A09A0, 0x67DAFA54, 0x95B17957, - 0xCBA24573, 0x39C9C670, 0x2A993584, 0xD8F2B687, 0x0C38D26C, 0xFE53516F, 0xED03A29B, 0x1F682198, - 0x5125DAD3, 0xA34E59D0, 0xB01EAA24, 0x42752927, 0x96BF4DCC, 0x64D4CECF, 0x77843D3B, 0x85EFBE38, - 0xDBFC821C, 0x2997011F, 0x3AC7F2EB, 0xC8AC71E8, 0x1C661503, 0xEE0D9600, 0xFD5D65F4, 0x0F36E6F7, - 0x61C69362, 0x93AD1061, 0x80FDE395, 0x72966096, 0xA65C047D, 0x5437877E, 0x4767748A, 0xB50CF789, - 0xEB1FCBAD, 0x197448AE, 0x0A24BB5A, 0xF84F3859, 0x2C855CB2, 0xDEEEDFB1, 0xCDBE2C45, 0x3FD5AF46, - 0x7198540D, 0x83F3D70E, 0x90A324FA, 0x62C8A7F9, 0xB602C312, 0x44694011, 0x5739B3E5, 0xA55230E6, - 0xFB410CC2, 0x092A8FC1, 0x1A7A7C35, 0xE811FF36, 0x3CDB9BDD, 0xCEB018DE, 0xDDE0EB2A, 0x2F8B6829, - 0x82F63B78, 0x709DB87B, 0x63CD4B8F, 0x91A6C88C, 0x456CAC67, 0xB7072F64, 0xA457DC90, 0x563C5F93, - 0x082F63B7, 0xFA44E0B4, 0xE9141340, 0x1B7F9043, 0xCFB5F4A8, 0x3DDE77AB, 0x2E8E845F, 0xDCE5075C, - 0x92A8FC17, 0x60C37F14, 0x73938CE0, 0x81F80FE3, 0x55326B08, 0xA759E80B, 0xB4091BFF, 0x466298FC, - 0x1871A4D8, 0xEA1A27DB, 0xF94AD42F, 0x0B21572C, 0xDFEB33C7, 0x2D80B0C4, 0x3ED04330, 0xCCBBC033, - 0xA24BB5A6, 0x502036A5, 0x4370C551, 0xB11B4652, 0x65D122B9, 0x97BAA1BA, 0x84EA524E, 0x7681D14D, - 0x2892ED69, 0xDAF96E6A, 0xC9A99D9E, 0x3BC21E9D, 0xEF087A76, 0x1D63F975, 0x0E330A81, 0xFC588982, - 0xB21572C9, 0x407EF1CA, 0x532E023E, 0xA145813D, 0x758FE5D6, 0x87E466D5, 0x94B49521, 0x66DF1622, - 0x38CC2A06, 0xCAA7A905, 0xD9F75AF1, 0x2B9CD9F2, 0xFF56BD19, 0x0D3D3E1A, 0x1E6DCDEE, 0xEC064EED, - 0xC38D26C4, 0x31E6A5C7, 0x22B65633, 0xD0DDD530, 0x0417B1DB, 0xF67C32D8, 0xE52CC12C, 0x1747422F, - 0x49547E0B, 0xBB3FFD08, 0xA86F0EFC, 0x5A048DFF, 0x8ECEE914, 0x7CA56A17, 0x6FF599E3, 0x9D9E1AE0, - 0xD3D3E1AB, 0x21B862A8, 0x32E8915C, 0xC083125F, 0x144976B4, 0xE622F5B7, 0xF5720643, 0x07198540, - 0x590AB964, 0xAB613A67, 0xB831C993, 0x4A5A4A90, 0x9E902E7B, 0x6CFBAD78, 0x7FAB5E8C, 0x8DC0DD8F, - 0xE330A81A, 0x115B2B19, 0x020BD8ED, 0xF0605BEE, 0x24AA3F05, 0xD6C1BC06, 0xC5914FF2, 0x37FACCF1, - 0x69E9F0D5, 0x9B8273D6, 0x88D28022, 0x7AB90321, 0xAE7367CA, 0x5C18E4C9, 0x4F48173D, 0xBD23943E, - 0xF36E6F75, 0x0105EC76, 0x12551F82, 0xE03E9C81, 0x34F4F86A, 0xC69F7B69, 0xD5CF889D, 0x27A40B9E, - 0x79B737BA, 0x8BDCB4B9, 0x988C474D, 0x6AE7C44E, 0xBE2DA0A5, 0x4C4623A6, 0x5F16D052, 0xAD7D5351 -}; - -/* - * end of the CRC lookup table crc_tableil8_o32 - */ - - - -/* - * The following CRC lookup table was generated automagically using the - * following model parameters: - * - * Generator Polynomial = ................. 0x1EDC6F41 - * Generator Polynomial Length = .......... 32 bits - * Reflected Bits = ....................... TRUE - * Table Generation Offset = .............. 32 bits - * Number of Slices = ..................... 8 slices - * Slice Lengths = ........................ 8 8 8 8 8 8 8 8 - * Directory Name = ....................... .\ - * File Name = ............................ 8x256_tables.c - */ - -uint32_t sctp_crc_tableil8_o40[256] = -{ - 0x00000000, 0x13A29877, 0x274530EE, 0x34E7A899, 0x4E8A61DC, 0x5D28F9AB, 0x69CF5132, 0x7A6DC945, - 0x9D14C3B8, 0x8EB65BCF, 0xBA51F356, 0xA9F36B21, 0xD39EA264, 0xC03C3A13, 0xF4DB928A, 0xE7790AFD, - 0x3FC5F181, 0x2C6769F6, 0x1880C16F, 0x0B225918, 0x714F905D, 0x62ED082A, 0x560AA0B3, 0x45A838C4, - 0xA2D13239, 0xB173AA4E, 0x859402D7, 0x96369AA0, 0xEC5B53E5, 0xFFF9CB92, 0xCB1E630B, 0xD8BCFB7C, - 0x7F8BE302, 0x6C297B75, 0x58CED3EC, 0x4B6C4B9B, 0x310182DE, 0x22A31AA9, 0x1644B230, 0x05E62A47, - 0xE29F20BA, 0xF13DB8CD, 0xC5DA1054, 0xD6788823, 0xAC154166, 0xBFB7D911, 0x8B507188, 0x98F2E9FF, - 0x404E1283, 0x53EC8AF4, 0x670B226D, 0x74A9BA1A, 0x0EC4735F, 0x1D66EB28, 0x298143B1, 0x3A23DBC6, - 0xDD5AD13B, 0xCEF8494C, 0xFA1FE1D5, 0xE9BD79A2, 0x93D0B0E7, 0x80722890, 0xB4958009, 0xA737187E, - 0xFF17C604, 0xECB55E73, 0xD852F6EA, 0xCBF06E9D, 0xB19DA7D8, 0xA23F3FAF, 0x96D89736, 0x857A0F41, - 0x620305BC, 0x71A19DCB, 0x45463552, 0x56E4AD25, 0x2C896460, 0x3F2BFC17, 0x0BCC548E, 0x186ECCF9, - 0xC0D23785, 0xD370AFF2, 0xE797076B, 0xF4359F1C, 0x8E585659, 0x9DFACE2E, 0xA91D66B7, 0xBABFFEC0, - 0x5DC6F43D, 0x4E646C4A, 0x7A83C4D3, 0x69215CA4, 0x134C95E1, 0x00EE0D96, 0x3409A50F, 0x27AB3D78, - 0x809C2506, 0x933EBD71, 0xA7D915E8, 0xB47B8D9F, 0xCE1644DA, 0xDDB4DCAD, 0xE9537434, 0xFAF1EC43, - 0x1D88E6BE, 0x0E2A7EC9, 0x3ACDD650, 0x296F4E27, 0x53028762, 0x40A01F15, 0x7447B78C, 0x67E52FFB, - 0xBF59D487, 0xACFB4CF0, 0x981CE469, 0x8BBE7C1E, 0xF1D3B55B, 0xE2712D2C, 0xD69685B5, 0xC5341DC2, - 0x224D173F, 0x31EF8F48, 0x050827D1, 0x16AABFA6, 0x6CC776E3, 0x7F65EE94, 0x4B82460D, 0x5820DE7A, - 0xFBC3FAF9, 0xE861628E, 0xDC86CA17, 0xCF245260, 0xB5499B25, 0xA6EB0352, 0x920CABCB, 0x81AE33BC, - 0x66D73941, 0x7575A136, 0x419209AF, 0x523091D8, 0x285D589D, 0x3BFFC0EA, 0x0F186873, 0x1CBAF004, - 0xC4060B78, 0xD7A4930F, 0xE3433B96, 0xF0E1A3E1, 0x8A8C6AA4, 0x992EF2D3, 0xADC95A4A, 0xBE6BC23D, - 0x5912C8C0, 0x4AB050B7, 0x7E57F82E, 0x6DF56059, 0x1798A91C, 0x043A316B, 0x30DD99F2, 0x237F0185, - 0x844819FB, 0x97EA818C, 0xA30D2915, 0xB0AFB162, 0xCAC27827, 0xD960E050, 0xED8748C9, 0xFE25D0BE, - 0x195CDA43, 0x0AFE4234, 0x3E19EAAD, 0x2DBB72DA, 0x57D6BB9F, 0x447423E8, 0x70938B71, 0x63311306, - 0xBB8DE87A, 0xA82F700D, 0x9CC8D894, 0x8F6A40E3, 0xF50789A6, 0xE6A511D1, 0xD242B948, 0xC1E0213F, - 0x26992BC2, 0x353BB3B5, 0x01DC1B2C, 0x127E835B, 0x68134A1E, 0x7BB1D269, 0x4F567AF0, 0x5CF4E287, - 0x04D43CFD, 0x1776A48A, 0x23910C13, 0x30339464, 0x4A5E5D21, 0x59FCC556, 0x6D1B6DCF, 0x7EB9F5B8, - 0x99C0FF45, 0x8A626732, 0xBE85CFAB, 0xAD2757DC, 0xD74A9E99, 0xC4E806EE, 0xF00FAE77, 0xE3AD3600, - 0x3B11CD7C, 0x28B3550B, 0x1C54FD92, 0x0FF665E5, 0x759BACA0, 0x663934D7, 0x52DE9C4E, 0x417C0439, - 0xA6050EC4, 0xB5A796B3, 0x81403E2A, 0x92E2A65D, 0xE88F6F18, 0xFB2DF76F, 0xCFCA5FF6, 0xDC68C781, - 0x7B5FDFFF, 0x68FD4788, 0x5C1AEF11, 0x4FB87766, 0x35D5BE23, 0x26772654, 0x12908ECD, 0x013216BA, - 0xE64B1C47, 0xF5E98430, 0xC10E2CA9, 0xD2ACB4DE, 0xA8C17D9B, 0xBB63E5EC, 0x8F844D75, 0x9C26D502, - 0x449A2E7E, 0x5738B609, 0x63DF1E90, 0x707D86E7, 0x0A104FA2, 0x19B2D7D5, 0x2D557F4C, 0x3EF7E73B, - 0xD98EEDC6, 0xCA2C75B1, 0xFECBDD28, 0xED69455F, 0x97048C1A, 0x84A6146D, 0xB041BCF4, 0xA3E32483 -}; - -/* - * end of the CRC lookup table crc_tableil8_o40 - */ - - - -/* - * The following CRC lookup table was generated automagically using the - * following model parameters: - * - * Generator Polynomial = ................. 0x1EDC6F41 - * Generator Polynomial Length = .......... 32 bits - * Reflected Bits = ....................... TRUE - * Table Generation Offset = .............. 32 bits - * Number of Slices = ..................... 8 slices - * Slice Lengths = ........................ 8 8 8 8 8 8 8 8 - * Directory Name = ....................... .\ - * File Name = ............................ 8x256_tables.c - */ - -uint32_t sctp_crc_tableil8_o48[256] = -{ - 0x00000000, 0xA541927E, 0x4F6F520D, 0xEA2EC073, 0x9EDEA41A, 0x3B9F3664, 0xD1B1F617, 0x74F06469, - 0x38513EC5, 0x9D10ACBB, 0x773E6CC8, 0xD27FFEB6, 0xA68F9ADF, 0x03CE08A1, 0xE9E0C8D2, 0x4CA15AAC, - 0x70A27D8A, 0xD5E3EFF4, 0x3FCD2F87, 0x9A8CBDF9, 0xEE7CD990, 0x4B3D4BEE, 0xA1138B9D, 0x045219E3, - 0x48F3434F, 0xEDB2D131, 0x079C1142, 0xA2DD833C, 0xD62DE755, 0x736C752B, 0x9942B558, 0x3C032726, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sat Feb 14 14:50:27 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A36151065672; Sat, 14 Feb 2009 14:50:27 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9121F8FC0A; Sat, 14 Feb 2009 14:50:27 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1EEoRcU023080; Sat, 14 Feb 2009 14:50:27 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1EEoRgL023079; Sat, 14 Feb 2009 14:50:27 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <200902141450.n1EEoRgL023079@svn.freebsd.org> From: Takahashi Yoshihiro Date: Sat, 14 Feb 2009 14:50:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188606 - head/release/scripts X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Feb 2009 14:50:28 -0000 Author: nyan Date: Sat Feb 14 14:50:27 2009 New Revision: 188606 URL: http://svn.freebsd.org/changeset/base/188606 Log: Specify 4096 block-size and 512 fragment-size. This fixes no space error. Modified: head/release/scripts/doFS.sh Modified: head/release/scripts/doFS.sh ============================================================================== --- head/release/scripts/doFS.sh Sat Feb 14 11:34:57 2009 (r188605) +++ head/release/scripts/doFS.sh Sat Feb 14 14:50:27 2009 (r188606) @@ -73,12 +73,9 @@ dofs_md () { if [ "x${DISKLABEL}" != "x" ] ; then ${DISKLABEL} ${MACHINE} -w ${BOOT} ${MDDEVICE} ${FSLABEL} - newfs -O1 -i ${FSINODE} -o space -m 0 /dev/${MDDEVICE} - mount /dev/${MDDEVICE} ${MNT} - else - newfs -O1 -i ${FSINODE} -o space -m 0 /dev/${MDDEVICE} - mount /dev/${MDDEVICE} ${MNT} fi + newfs -O1 -b 4096 -f 512 -i ${FSINODE} -o space -m 0 /dev/${MDDEVICE} + mount /dev/${MDDEVICE} ${MNT} } rm -f ${FSIMG} From owner-svn-src-head@FreeBSD.ORG Sat Feb 14 14:53:51 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 92FD81065676; Sat, 14 Feb 2009 14:53:51 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 67E9A8FC12; Sat, 14 Feb 2009 14:53:51 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1EErpgf023170; Sat, 14 Feb 2009 14:53:51 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1EErpKd023169; Sat, 14 Feb 2009 14:53:51 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <200902141453.n1EErpKd023169@svn.freebsd.org> From: Takahashi Yoshihiro Date: Sat, 14 Feb 2009 14:53:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188607 - head/release X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Feb 2009 14:53:52 -0000 Author: nyan Date: Sat Feb 14 14:53:51 2009 New Revision: 188607 URL: http://svn.freebsd.org/changeset/base/188607 Log: Restore MAKE_FLOPPIES for pc98. Modified: head/release/Makefile Modified: head/release/Makefile ============================================================================== --- head/release/Makefile Sat Feb 14 14:50:27 2009 (r188606) +++ head/release/Makefile Sat Feb 14 14:53:51 2009 (r188607) @@ -195,6 +195,7 @@ MAKE_DVD= SEPARATE_LIVEFS= SPLIT_MFSROOT= .if ${TARGET} == "pc98" +MAKE_FLOPPIES= true SMALLFLOPPYSIZE= 1200 SMALLFLOPPYSPLITSIZE= 1152 SMALLFLOPPYLABEL= fd1200 From owner-svn-src-head@FreeBSD.ORG Sat Feb 14 17:45:36 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DB82C1065670; Sat, 14 Feb 2009 17:45:36 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.9.129]) by mx1.freebsd.org (Postfix) with ESMTP id 9BCE58FC12; Sat, 14 Feb 2009 17:45:36 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id 0CBAB7309E; Sat, 14 Feb 2009 18:51:36 +0100 (CET) Date: Sat, 14 Feb 2009 18:51:36 +0100 From: Luigi Rizzo To: Bruce Evans Message-ID: <20090214175136.GB89369@onelab2.iet.unipi.it> References: <200902131514.n1DFEhft091837@svn.freebsd.org> <20090214183758.I847@besplex.bde.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090214183758.I847@besplex.bde.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, Luigi Rizzo , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r188578 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Feb 2009 17:45:37 -0000 On Sat, Feb 14, 2009 at 06:59:57PM +1100, Bruce Evans wrote: > On Fri, 13 Feb 2009, Luigi Rizzo wrote: > > >Log: > > Use uint32_t instead of n_long and n_time, and uint16_t instead of > > n_short. > > Add a note next to fields in network format. > > > > The n_* types are not enough for compiler checks on endianness, and their > > use often requires an otherwise unnecessary #include > > This is too much like globally substituting uid_t with uint16_t. At actually uid_t are uint32_t :) But there are several differences: - uid_t, dev_t and other widelyused_t are in so you don't need to add one extra header just for the n_long typedef; - n_{long|short|time} are so rarely used that after 20 years one can safely declare they were an unsuccessful experiment; > >+#define ICMP_TSLEN (8 + 3 * sizeof (uint32_t)) /* timestamp > >*/ > > The changes lose the most where they involve sizeof's. Now it is > unclear that the sizeof is of 1 timestamp. sizeof(uint32_t) is an > obfuscated spelling of 4. True. And this is another macro used exactly one time, which probably could be retired or replaced with just the right number. > >- (void)memcpy(cp + off, &ntime, sizeof(n_time)); > >- cp[IPOPT_OFFSET] += sizeof(n_time); > >+ (void)memcpy(cp + off, &ntime, sizeof(uint32_t)); > >+ cp[IPOPT_OFFSET] += sizeof(uint32_t); > > ... but here we are copying the object `ntime'; sizeof(n_time) was an > obfuscated spelling of the size of that object, and sizeof(uint32_t) is > an even more obfuscated spelling. Similarly elsewhere. in fact, I prefer sizeof(variable) instead of sizeof(type) in these circumstances, but both forms have pros and cons and i just followed the existing form. cheers luigi From owner-svn-src-head@FreeBSD.ORG Sat Feb 14 18:23:52 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D9828106564A; Sat, 14 Feb 2009 18:23:52 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C7DDF8FC08; Sat, 14 Feb 2009 18:23:52 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1EINqXr027034; Sat, 14 Feb 2009 18:23:52 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1EINqA0027032; Sat, 14 Feb 2009 18:23:52 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <200902141823.n1EINqA0027032@svn.freebsd.org> From: Alan Cox Date: Sat, 14 Feb 2009 18:23:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188608 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Feb 2009 18:23:53 -0000 Author: alc Date: Sat Feb 14 18:23:52 2009 New Revision: 188608 URL: http://svn.freebsd.org/changeset/base/188608 Log: Remove unnecessary page queues locking around vm_page_busy() and vm_page_wakeup(). (This change is applicable to RELENG_7 but not RELENG_6.) MFC after: 1 week Modified: head/sys/amd64/amd64/pmap.c head/sys/i386/i386/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Sat Feb 14 14:53:51 2009 (r188607) +++ head/sys/amd64/amd64/pmap.c Sat Feb 14 18:23:52 2009 (r188608) @@ -3400,9 +3400,7 @@ retry: } p = vm_page_lookup(object, pindex); - vm_page_lock_queues(); vm_page_wakeup(p); - vm_page_unlock_queues(); } ptepa = VM_PAGE_TO_PHYS(p); @@ -3416,15 +3414,11 @@ retry: while ((pdpg = pmap_allocpde(pmap, va, M_NOWAIT)) == NULL) { PMAP_UNLOCK(pmap); - vm_page_lock_queues(); vm_page_busy(p); - vm_page_unlock_queues(); VM_OBJECT_UNLOCK(object); VM_WAIT; VM_OBJECT_LOCK(object); - vm_page_lock_queues(); vm_page_wakeup(p); - vm_page_unlock_queues(); PMAP_LOCK(pmap); } pde = (pd_entry_t *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(pdpg)); Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Sat Feb 14 14:53:51 2009 (r188607) +++ head/sys/i386/i386/pmap.c Sat Feb 14 18:23:52 2009 (r188608) @@ -3469,9 +3469,7 @@ retry: } p = vm_page_lookup(object, pindex); - vm_page_lock_queues(); vm_page_wakeup(p); - vm_page_unlock_queues(); } ptepa = VM_PAGE_TO_PHYS(p); From owner-svn-src-head@FreeBSD.ORG Sat Feb 14 19:40:06 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 410B6106566B; Sat, 14 Feb 2009 19:40:06 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail05.syd.optusnet.com.au (mail05.syd.optusnet.com.au [211.29.132.186]) by mx1.freebsd.org (Postfix) with ESMTP id 1A6ED8FC08; Sat, 14 Feb 2009 19:40:04 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-107-120-227.carlnfd1.nsw.optusnet.com.au (c122-107-120-227.carlnfd1.nsw.optusnet.com.au [122.107.120.227]) by mail05.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id n1EJduNQ007439 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 15 Feb 2009 06:39:59 +1100 Date: Sun, 15 Feb 2009 06:39:56 +1100 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Luigi Rizzo In-Reply-To: <20090214175136.GB89369@onelab2.iet.unipi.it> Message-ID: <20090215052941.E2522@delplex.bde.org> References: <200902131514.n1DFEhft091837@svn.freebsd.org> <20090214183758.I847@besplex.bde.org> <20090214175136.GB89369@onelab2.iet.unipi.it> MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-37656405-1234640396=:2522" Cc: svn-src-head@FreeBSD.org, Luigi Rizzo , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, Bruce Evans Subject: Re: svn commit: r188578 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Feb 2009 19:40:06 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --0-37656405-1234640396=:2522 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE On Sat, 14 Feb 2009, Luigi Rizzo wrote: > On Sat, Feb 14, 2009 at 06:59:57PM +1100, Bruce Evans wrote: >> On Fri, 13 Feb 2009, Luigi Rizzo wrote: >> >>> Log: >>> Use uint32_t instead of n_long and n_time, and uint16_t instead of >>> n_short. >>> Add a note next to fields in network format. >>> >>> The n_* types are not enough for compiler checks on endianness, and the= ir >>> use often requires an otherwise unnecessary #include >> >> This is too much like globally substituting uid_t with uint16_t. At > > actually uid_t are uint32_t :) > But there are several differences: > - uid_t, dev_t and other widelyused_t are in so you don't > need to add one extra header just for the n_long typedef; Actually, they would cause the same problem if their declarations were not correctly engineered. Without any engineering, it would be necessary to include in applications that don't otherwise need applications. This corresponds to including . With bad engineering, would be included nested in almost all headers. This corresponds to including in almost all netinet headers. > - n_{long|short|time} are so rarely used that after 20 years one can > safely declare they were an unsuccessful experiment; Only 20? They are in Net/2 and Stevens. I couldn't find any details of them in Stevens. Of course there are better ways of declaring them -- basically a foo_t for every logically distinct type, as was already done for n_time and is still done for in_addr_t... I found 2 Linux versions of in_systm.h on my disks. One dated 1994 is almost a copy of the Net/2 one (it still uses short and long). One dated 2001 uses uint* where FreeBSD now uses u_int*. I didn't notice before that in_systm.h declares nothing except these 3 types. Being so small to negative advantage is another engineering error. The FreeBSD one now has a single prototype, for in_time(). This was apparently done so that there aren't even more dependencies on in_systm.h due to the the (different) header that declares in_time() depending on in_systm.h. Now that in_time() doesn't depend on n_time, the placement of its declaration in in_systm.h is just bogus. The correct place is probably . FYI, here is an old script (last edit Jan 15 2000) for checking that header dependencies haven't rotted. The old dependencies can be read off the echo lists in it. I gave up maintaining this in 1999 because errors grew faster than I could fix them. In 1999, the error output was 2K; in 200 it was 11K; now it is 1327K and the test coverages is probably more incomplete. Due to bloat, it takes about the same time to run in 1999 on a K6/233MHz as in 2009 on a Core2/1.86GHz (about 1 minute). It only checks userland and doesn't try to give lists that don't depend on namespace pollution in other headers. It does try to give minimal lists. Many of the header engineering errors involving have been fixed so many of the includes of that in the lists are now bogus. BTW, I also disagree with you adding comments to include lines to say what the includes are for. There is no chance that such comments are complete or can be maintained. For completeness, every include line would need a paragraph or two like some of the ones in this mail to explain all the reasons why a header is included, and the details will change when code is added. The reasons why a header is needed are most easily seen by trying to compile without it. A generic header like will be needed for a myriad reasons and listing them all is not useful. A small header will be needed for only a small number of reasons and listing them all is even less useful, since it is easy to find and understand the reasons if only a couple of declarations are used. %%% #!/bin/sh # only depends on being previously # included with _KERNEL being defined, but depends on # generated headers if _KERNEL is defined. # , and refer to the # i386 hierarchy. # depends on _KERNEL being defined. # depends on _KERNEL being defined before including # , and then includes "opt_nfs.h". # depends on a type in which is only # declared if _KERNEL is defined. # depends on _KERNEL being defined before # is included. # uses an unifdefed gcc attribute so it and # everything that includes it break for for non-gcc. # depends on generated headers. # uses undefined macros. # conflicts with user lseek() etc. # CRUD=3D"(sys/bus_private|machine/ipl|machine/mpapic|netgraph/netgraph|nfs/n= fsrvcache|pccard/pccard_nbk|machine/sigframe|pccard/slot|netatm/spans/spans= _cls|sys/syscall-hide|sys/sysproto)\.h" # uses ANSI string concatenation. # uses #error. # isn't careful about #elif. # NEEDS_ANSI=3D"(sys/copyright|sys/devfsext|netatm/ipatm/ipatm_serv|netatm/ke= rn_include|netatm/port|netatm/uni/sscf_uni_var|netatm/uni/sscop_pdu|netatm/= uni/sscop_var|netatm/uni/unisig_decode|netatm/uni/unisig_mbuf)\.h" # Comment out the next line for non-ANSI. # NEEDS_ANSI=3D"^/nonesuch$" # Some files use use gcc features such as __inline and pragma pack (ugh!) # unconditionally. # NEEDS_GCC=3D"(machine/atomic|machine/cdk|machine/cpu|machine/globaldata|mac= hine/md_var|netncp/ncp|netncp/ncp_conn|netncp/ncp_file|netncp/ncp_lib|netnc= p/ncp_ncp|ncp_nls|netncp/ncp_rcfile|netncp/ncp_sock|netncp/ncp_rq|netncp/nc= p_subr|netncp/ncp_user|machine/pcb_ext|machine/segments|sys/signalvar|machi= ne/specialreg|sys/timepps|sys/user|machine/pc/vesa|vm/vm_map)\.h" # Comment out the next line for non-gcc. # NEEDS_GCC=3D"^/nonesuch$" # These files use prototypes and perhaps other ANSI features unconditionall= y. # Major breakage in acl.h pollutes vnode.h and thus nfs/nfsnode.h, # ufs/ffs/ffs_extern.h, ufs/ufs/ufs_extern.h, and others. # Major breakage in com_err (?) broke ss/ss.h and ss/ss_err.h. # NEEDS_PROTO=3D"(sys/acl|\./aio|sys/aio|\./alias|machine/pc/bios|sys/blist|n= et/bridge|sys/bus|machine/bus|\./calendar|cam/cam|cam/cam_ccb|cam/scsi/scsi= _all|cam/scsi/scsi_cd|cam/scsi/scsi_ch|cam/scsi/scsi_pass|cam/scsi/scsi_sa|= cam/scsi/scsi_targetio|\./camlib|\./curses|\./devstat|\./dialog|sys/extattr= |\./fetch|\./fetch_err|ufs/ffs/ffs_extern|\./form|\./ftpio|\./g2c|sys/inter= rupt|sys/kernel|\./libdisk|sys/linker|\./md2|\./md4|\./md5|sys/md5|\./menu|= sys/module|\./ncurses|\./netgraph|netgraph/ng_parse|netgraph/ng_pppoe|nfs/n= fsnode|ntfs/ntfs|ntfs/ntfs_compr|ntfs/ntfs_inode|ntfs/ntfs_subr|ntfs_vfsops= |nwfs/nwfs|nwfs/nwfs_mount|nwfs/nwfs_node|nwfs/nwfs_subr|\./objformat|panel= |security/_pam_types|security/pam_appl|security/pam_malloc|security/pam_mod= _misc|security/pam_modules|\./pcap-int|\./pcap-namedb|\./pcap|\./posix4|pos= ix4/posix4|\./radlib|sys/rman|\./ripemd|\./sha|machine/spigot|machine/sound= card|ss/ss|ss/ss_err|\./stand|\./strhash|\./taclib|\./term|\./termcap|\./ti= mepps|ufs/ufs/ufs_extern|\./unctrl|\./vgl|sys/vnode)\.h" # Comment out the next line for pure K&R (not for gcc -tradtional). # NEEDS_PROTO=3D"^/nonesuch$" # , and # use a combination of __CONCAT macros that doesn't work in traditional # mode. # and use token pasting. # , and # inherit breakage from . # uses ANSI cpp features. # isn't careful enough about spaces in # macro definitions to work in traditional mode. # inherits this problem. # NEEDS_NONTRAD=3D"(\./elf|machine/atomic|machine/elf|sys/elf_generic|sys/eve= nthandler|sys/imgact_elf|machine/in_cksum|netatm/kern_include|security/_pam= _macros|security/pam_misc|sys/systm|vm/vm_object|vm/vm_page)\.h" # Comment out the next line for pure K&R or gcc -traditional. # NEEDS_NONTRAD=3D"^/nonesuch$" gccw() { cc \ =09-Wall -ansi -pedantic \ =09-Wbad-function-cast \ =09-Wcast-align \ =09-Wcast-qual \ =09-Wchar-subscripts \ =09-Wconversion \ =09-Winline \ =09-Wmissing-prototypes \ =09-Wnested-externs \ =09-Wpointer-arith \ =09-Wredundant-decls \ =09-Wshadow \ =09-Wstrict-prototypes \ =09-Wwrite-strings \ =09"$@" } for i in `(cd /usr/include; find . -name '*.h' -follow | sort | =09 egrep -v "\./(g\+\+|netns|objc)/" | egrep -v "$CRUD" | =09 egrep -v "$NEEDS_ANSI" | egrep -v "$NEEDS_GCC" | =09 egrep -v "$NEEDS_PROTO" | egrep -v "$NEEDS_NONTRAD")` do =09echo -n >z.c =09test $i !=3D ./alias.h || =09 echo "#include =09=09 #include " >>z.c =09test $i !=3D ./arpa/inet.h || =09 echo "#include =09=09 #include " >>z.c =09test $i !=3D ./cam/cam.h || echo "#include " >>z.c =09test $i !=3D ./cam/cam_ccb.h || =09 echo "#include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./cam/scsi/scsi_all.h || =09 echo "#include =09=09 #include " >>z.c =09test $i !=3D ./cam/scsi/scsi_cd.h || =09 echo "#include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./cam/scsi/scsi_ch.h || =09 echo "#include =09=09 #include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./cam/scsi/scsi_da.h || echo "#include " >>z.= c =09test $i !=3D ./cam/scsi/scsi_pass.h || =09 echo "#include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./cam/scsi/scsi_pt.h || echo "#include " >>z.= c =09test $i !=3D ./cam/scsi/scsi_sa.h || =09 echo "#include =09=09 #include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./cam/scsi/scsi_targetio.h || =09 echo "#include " >>z.c =09test $i !=3D ./camlib.h || =09 echo "#include " >>z.c =09test $i !=3D ./devstat.h || =09 echo "#include " >>z.c =09test $i !=3D ./fetch.h || =09 echo "#include =09=09 #include " >>z.c =09test $i !=3D ./fts.h || =09 echo "#include " >>z.c =09test $i !=3D ./gnuregex.h || =09 echo "#include " >>z.c =09test $i !=3D ./grp.h || =09 echo "#include " >>z.c =09test $i !=3D ./isofs/cd9660/cd9660_mount.h || =09 echo "#include =09=09 #include " >>z.c =09test $i !=3D ./isofs/cd9660/cd9660_node.h || =09 echo "#include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./isofs/cd9660/cd9660_rrip.h || =09 echo "#include =09=09 #include " >>z.c =09test $i !=3D ./isofs/cd9660/iso.h || echo "#include " >>z.= c =09test $i !=3D ./isofs/cd9660/iso_rrip.h || =09 echo "#include " >>z.c =09test $i !=3D ./libatm.h || =09 echo "#include =09=09 #include =09=09 #include =09=09 #include =09=09 #include =09=09 #include =09=09 #include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./libdisk.h || =09 echo "#include " >>z.c =09# XXX link.h has no prerequisites in the elf case. It has namespace =09# pollution () and undocmentation (link.5 is aout-only). =09test $i !=3D ./link.h || =09 echo "#include =09 #include " >>z.c =09test $i !=3D ./login_cap.h || =09 echo "#include " >>z.c =09test $i !=3D ./md4.h || =09 echo "#include " >>z.c =09test $i !=3D ./md5.h || =09 echo "#include " >>z.c =09test $i !=3D ./mpool.h || echo "#include " >>z.c =09test $i !=3D ./machine/atomic.h || echo "#include " >>z.c =09test $i !=3D ./machine/bootinfo.h || echo "#include " >>z.= c =09test $i !=3D ./machine/bus.h || echo "#include " >>z.c =09test $i !=3D ./machine/cpu.h || echo "#include " >>z.c =09test $i !=3D ./machine/cpufunc.h || echo "#include " >>z.c =09test $i !=3D ./machine/db_machdep.h || echo "#include " >>= z.c =09test $i !=3D ./machine/dvcfg.h || echo "#include " >>z.c =09test $i !=3D ./machine/elf.h || echo "#include " >>z.c =09test $i !=3D ./machine/frame.h || echo "#include " >>z.c =09test $i !=3D ./machine/globaldata.h || =09 echo "#include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./machine/i4b_debug.h || echo "#include " >>z= =2Ec =09test $i !=3D ./machine/i4b_ioctl.h || echo "#include " >>z= =2Ec =09test $i !=3D ./machine/i4b_rbch_ioctl.h || =09 echo "#include =09=09 #include " >>z.c =09test $i !=3D ./machine/i4b_trace.h || echo "#include " >>z.= c =09test $i !=3D ./machine/if_wavelan_ieee.h || =09 echo "#include " >>z.c =09test $i !=3D ./machine/iic.h || echo "#include " >>z.c =09test $i !=3D ./machine/in_cksum.h || =09 echo "#include =09=09 #include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./machine/ioctl_bt848.h || =09 echo "#include " >>z.c =09test $i !=3D ./machine/md_var.h || echo "#include " >>z.c =09test $i !=3D ./machine/npx.h || echo "#include " >>z.c =09test $i !=3D ./machine/pc/bios.h || echo "#include " >>z.c =09test $i !=3D ./machine/pc/vesa.h || echo "#include " >>z.c =09test $i !=3D ./machine/pcb.h || echo "#include " >>z.c =09test $i !=3D ./machine/pcb_ext.h || echo "#include " >>z.c =09test $i !=3D ./machine/pmap.h || =09 echo "#include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./machine/profile.h || echo "#include " >>z.c =09test $i !=3D ./machine/si.h || =09 echo "#include =09=09 #include " >>z.c =09test $i !=3D ./machine/signal.h || =09 echo "#include =09=09 #include " >>z.c =09test $i !=3D ./machine/smb.h || echo "#include " >>z.c =09test $i !=3D ./machine/specialreg.h || =09 echo "#include =09=09 #include " >>z.c =09test $i !=3D ./machine/types.h || echo "#include " >>z.c =09test $i !=3D ./machine/vm86.h || echo "#include " >>z.c =09test $i !=3D ./mqueue.h || =09 echo "#include " >>z.c =09test $i !=3D ./msdosfs/bootsect.h || echo "#include " >>z.= c =09test $i !=3D ./msdosfs/bpb.h || echo "#include " >>z.c =09test $i !=3D ./msdosfs/direntry.h || echo "#include " >>z.= c =09test $i !=3D ./msdosfs/denode.h || =09 echo "#include =09=09 #include " >>z.c =09test $i !=3D ./msdosfs/msdosfsmount.h || =09 echo "#include =09=09 #include " >>z.c =09test $i !=3D ./net/bridge.h || =09=09echo "#include =09=09 #include " >>z.c =09test $i !=3D ./net/bpf.h || echo "#include " >>z.c =09test $i !=3D ./net/bpfdesc.h || echo "#include " >>z.c =09test $i !=3D ./net/ethernet.h || echo "#include " >>z.c =09test $i !=3D ./net/hostcache.h || echo "#include " >>z.c =09test $i !=3D ./net/if.h || =09 echo "#include =09=09 #include " >>z.c =09test $i !=3D ./net/if_arp.h || =09 echo "#include =09=09 #include " >>z.c =09test $i !=3D ./net/if_atm.h || echo "#include " >>z.c =09test $i !=3D ./net/if_dl.h || echo "#include " >>z.c =09test $i !=3D ./net/if_gif.h || =09 echo "#include =09=09 #include =09=09 #include =09=09 #include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./net/if_llc.h || echo "#include " >>z.c =09test $i !=3D ./net/if_mib.h || =09 echo "#include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./net/if_ppp.h || =09 echo "#include =09=09 #include " >>z.c =09test $i !=3D ./net/if_pppvar.h || =09 echo "#define NPPP 1 =09=09 #include =09=09 #include =09=09 #include =09=09 #include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./net/if_slvar.h || =09 echo "#include =09=09 #include =09=09 #include =09=09 #include =09=09 #include =09=09 #include =09=09 #include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./net/if_sppp.h || =09 echo "#include =09=09 #include =09=09 #include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./net/if_tun.h || echo "#include " >>z.c =09test $i !=3D ./net/if_tunvar.h || =09 echo "#include =09=09 #include =09=09 #include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./net/if_var.h || =09 echo "#include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./net/if_vlan_var.h || =09 echo "#include =09=09 #include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./net/iso88025.h || =09 echo "#include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./net/pfkeyv2.h || echo "#include " >>z.c =09test $i !=3D ./net/ppp_defs.h || echo "#include " >>z.c =09test $i !=3D ./net/radix.h || echo "#include " >>z.c =09test $i !=3D ./net/raw_cb.h || =09 echo "#include =09=09 #include " >>z.c =09test $i !=3D ./net/route.h || =09 echo "#include =09=09 #include " >>z.c =09test $i !=3D ./net/slcompress.h || =09 echo "#include =09=09 #include =09=09 #include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./netatalk/aarp.h || =09 echo "#include =09=09 #include =09=09 #include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./netatalk/at.h || echo "#include " >>z.c =09test $i !=3D ./netatalk/at_extern.h || echo "#include " >>= z.c =09test $i !=3D ./netatalk/at_var.h || =09 echo "#include =09=09 #include =09=09 #include =09=09 #include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./netatalk/ddp.h || echo "#include " >>z.c =09test $i !=3D ./netatalk/ddp_var.h || =09 echo "#include =09=09 #include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./netatalk/phase2.h || echo "#include " >>z.c =09test $i !=3D ./netatm/atm.h || =09 echo "#include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./netatm/atm_cm.h || =09 echo "#include =09=09 #include =09=09 #include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./netatm/atm_if.h || =09 echo "#include " >>z.c =09test $i !=3D ./netatm/atm_ioctl.h || =09 echo "#include =09=09 #include =09=09 #include =09=09 #include =09=09 #include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./netatm/ipatm/ipatm_serv.h || =09 echo "#include =09=09 #include =09=09 #include =09=09 #include =09=09 #define ATM_KERNEL =09=09 #include =09=09 #include =09=09 #include =09=09 #include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./netatm/kern_include.h || =09 echo "#include =09=09 #include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./netatm/port.h || =09 echo "#include =09=09 #define ATM_KERNEL" >>z.c =09test $i !=3D ./netatm/atm_sap.h || =09 echo "#include " >>z.c =09test $i !=3D ./netatm/atm_sys.h || =09 echo "#include " >>z.c =09test $i !=3D ./netatm/queue.h || =09 echo "#include " >>z.c =09test $i !=3D ./netatm/uni/sscf_uni_var.h || =09 echo "#include =09=09 #include =09=09 #include =09=09 #include =09=09 #define ATM_KERNEL =09=09 #include =09=09 #include =09=09 #include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./netatm/uni/sscop.h || =09 echo "#include " >>z.c =09test $i !=3D ./netatm/uni/sscop_misc.h || =09 echo "#include " >>z.c =09test $i !=3D ./netatm/uni/sscop_pdu.h || =09 echo "#include =09=09 #define ATM_KERNEL =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./netatm/uni/sscop_var.h || =09 echo "#include =09=09 #include =09=09 #include =09=09 #include =09=09 #define ATM_KERNEL =09=09 #include =09=09 #include =09=09 #include =09=09 #include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./netatm/uni/unisig_decode.h || =09 echo "#include =09=09 #include =09=09 #include =09=09 #include =09=09 #define ATM_KERNEL =09=09 #include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./netatm/uni/unisig_mbuf.h || =09 echo "#include =09=09 #define ATM_KERNEL =09=09 #include " >>z.c =09test $i !=3D ./netatm/uni/unisig_msg.h || =09 echo "#include =09=09 #include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./netatm/unisig_var.h || =09 echo "#include " >>z.c =09test $i !=3D ./netatm/uni/uniip_var.h || =09 echo "#include " >>z.c =09test $i !=3D ./netgraph/ng_async.h || echo "#include " >>z= =2Ec =09test $i !=3D ./netgraph/ng_bpf.h || =09 echo "#include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./netgraph/ng_cisco.h || =09 echo "#include =09=09 #include " >>z.c =09test $i !=3D ./netgraph/ng_ksocket.h || =09 echo "#include " >>z.c =09test $i !=3D ./netgraph/ng_lmi.h || echo "#include " >>z.c =09test $i !=3D ./netgraph/ng_message.h || =09 echo "#include " >>z.c =09test $i !=3D ./netgraph/ng_parse.h || echo "#include " >>z= =2Ec =09test $i !=3D ./netgraph/ng_ppp.h || echo "#include " >>z.c =09test $i !=3D ./netgraph/ng_pppoe.h || =09 echo "#include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./netgraph/ng_pptpgre.h || =09 echo "#include " >>z.c =09test $i !=3D ./netgraph/ng_sample.h || echo "#include " >>= z.c =09test $i !=3D ./netgraph/ng_socket.h || echo "#include " >>= z.c =09test $i !=3D ./netgraph/ng_socketvar.h || =09 echo "#include " >>z.c =09test $i !=3D ./netgraph/ng_tee.h || echo "#include " >>z.c =09test $i !=3D ./netgraph/ng_vjc.h || echo "#include " >>z.c =09test $i !=3D ./netinet/icmp_var.h || =09 echo "#include =09=09 #include =09=09 #include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./netinet/icmp6.h || =09 echo "#include =09=09 #include " >>z.c =09test $i !=3D ./netinet/if_atm.h || echo "#include " >>z.c =09test $i !=3D ./netinet/if_ether.h || =09 echo "#include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./netinet/if_fddi.h || echo "#include " >>z.c =09test $i !=3D ./netinet/if_gif.h || echo "#include " >>z.c =09test $i !=3D ./netinet/igmp.h || =09 echo "#include =09=09 #include " >>z.c =09test $i !=3D ./netinet/igmp_var.h || echo "#include " >>z.= c =09test $i !=3D ./netinet/in.h || echo "#include " >>z.c =09test $i !=3D ./netinet/in_gif.h || echo "#include " >>z.c =09test $i !=3D ./netinet/in_hostcache.h || =09 echo "#include =09=09 #include " >>z.c =09test $i !=3D ./netinet/in_pcb.h || =09 echo "#include =09=09 #include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./netinet/in_systm.h || echo "#include " >>z.= c =09test $i !=3D ./netinet/in_var.h || =09 echo "#include =09=09 #include =09=09 #include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./netinet/ip.h || =09 echo "#include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./netinet/ip_auth.h || =09 echo "#include =09=09 #include =09=09 #include =09=09 #include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./netinet/ip_compat.h || echo "#include " >>z= =2Ec =09test $i !=3D ./netinet/ip_dummynet.h || =09 echo "#include =09=09 #include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./netinet/ip_fil.h || =09 echo "#include =09=09 #include =09=09 #include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./netinet/ip_flow.h || =09 echo "#include =09=09 #include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./netinet/ip_frag.h || =09 echo "#include =09=09 #include =09=09 #include =09=09 #include =09=09 #include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./netinet/ip_fw.h || =09 echo "#include =09=09 #include " >>z.c =09test $i !=3D ./netinet/ip_icmp.h || =09 echo "#include =09=09 #include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./netinet/ip_mroute.h || =09 echo "#include =09=09 #include =09=09 #include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./netinet/ip_nat.h || =09 echo "#include =09=09 #include =09=09 #include =09=09 #include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./netinet/ip_proxy.h || =09 echo "#include =09=09 #include =09=09 #include =09=09 #include =09=09 #include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./netinet/ip_state.h || =09 echo "#include =09=09 #include =09=09 #include =09=09 #include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./netinet/ip_var.h || =09 echo "#include =09=09 #include " >>z.c =09test $i !=3D ./netinet/ip6.h || =09 echo "#include =09=09 #include " >>z.c =09test $i !=3D ./netinet/ipprotosw.h || echo "#include " >>z= =2Ec =09test $i !=3D ./netinet/tcp.h || echo "#include " >>z.c =09test $i !=3D ./netinet/tcp_debug.h || =09 echo "#include =09=09 #include =09=09 #include =09=09 #include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./netinet/tcp_var.h || =09 echo "#include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./netinet/tcpip.h || =09 echo "#include =09=09 #include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./netinet/udp.h || echo "#include " >>z.c =09test $i !=3D ./netinet/udp_var.h || =09 echo "#include =09=09 #include =09=09 #include =09=09 #include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./netinet6/ah.h || echo "#include " >>z.c =09test $i !=3D ./netinet6/esp.h || =09 echo "#include =09=09 #include " >>z.c =09test $i !=3D ./netinet6/icmp6.h || =09 echo "#include =09=09 #include " >>z.c =09test $i !=3D ./netinet6/in6.h || echo "#include " >>z.c =09test $i !=3D ./netinet6/in6_gif.h || echo "#include " >>z.= c =09test $i !=3D ./netinet6/in6_prefix.h || =09 echo "#include =09=09 #include =09=09 #include =09=09 #include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./netinet6/in6_var.h || =09 echo "#include =09=09 #include =09=09 #include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./netinet6/ip.h || echo "#include " >>z.c =09test $i !=3D ./netinet6/ip6.h || =09 echo "#include =09=09 #include " >>z.c =09test $i !=3D ./netinet6/ip6_var.h || =09 echo "#include =09=09 #include " >>z.c =09test $i !=3D ./netinet6/ipsec.h || echo "#include " >>z.c =09test $i !=3D ./netinet6/nd6.h || =09 echo "#include =09=09 #include =09=09 #include =09=09 #include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./netinet6/pim6.h || echo "#include " >>z.c =09test $i !=3D ./netinet6/pim6_var.h || echo "#include " >>z= =2Ec =09test $i !=3D ./netinet6/ip6protosw.h || =09 echo "#include " >>z.c =09test $i !=3D ./netipx/ipx.h || echo "#include " >>z.c =09test $i !=3D ./netipx/ipx_if.h || =09 echo "#include =09=09 #include =09=09 #include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./netipx/ipx_ip.h || =09 echo "#include =09=09 #include =09=09 #include =09=09 #include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./netipx/ipx_pcb.h || =09 echo "#include =09=09 #include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./netipx/ipx_var.h || echo "#include " >>z.c =09test $i !=3D ./netipx/spx.h || =09 echo "#include =09=09 #include " >>z.c =09test $i !=3D ./netipx/spx_debug.h || =09 echo "#include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./netkey/key_debug.h || echo "#include " >>z.= c =09test $i !=3D ./netncp/ncp.h || echo "#include " >>z.c =09test $i !=3D ./netncp/ncp_conn.h || =09 echo "#include =09=09 #include " >>z.c =09test $i !=3D ./netncp/ncp_file.h || =09 echo "#include =09=09 #include " >>z.c =09test $i !=3D ./netncp/ncp_lib.h || echo "#include " >>z.c =09test $i !=3D ./netncp/ncp_ncp.h || echo "#include " >>z.c =09test $i !=3D ./netncp/ncp_nls.h || echo "#include " >>z.c =09test $i !=3D ./netncp/ncp_rcfile.h || echo "#include " >>z.c =09test $i !=3D ./netncp/ncp_rq.h || =09 echo "#include =09=09 #include " >>z.c =09test $i !=3D ./netncp/ncp_subr.h || =09 echo "#include =09=09 #include " >>z.c =09test $i !=3D ./netncp/ncp_user.h || =09 echo "#include =09=09 #include " >>z.c =09test $i !=3D ./nfs/nfs.h || =09 echo "#include =09=09 #include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./nfs/krpc.h || echo "#include " >>z.c =09test $i !=3D ./nfs/nfsdiskless.h || =09 echo "#include =09=09 #include =09=09 #include =09=09 #include =09=09 #include =09=09 #include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./nfs/nfsm_subs.h || echo "#include " >>z.c =09test $i !=3D ./nfs/nfsmount.h || =09 echo "#include =09=09 #include =09=09 #include =09=09 #include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./nfs/nfsnode.h || =09 echo "#include =09=09 #include =09=09 #include =09=09 #include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./nfs/nfsproto.h || =09 echo "#include =09=09 #include " >>z.c =09test $i !=3D ./nfs/nfsrtt.h || =09 echo "#include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./nfs/nfsrvcache.h || =09 echo "#include =09=09 #include =09=09 #include =09=09 #include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./nfs/nfsv2.h || =09 echo "#include =09=09 #include " >>z.c =09test $i !=3D ./nfs/rpcv2.h || echo "#include " >>z.c =09test $i !=3D ./ntfs/ntfs.h || =09 echo "#include =09=09 #define _KERNEL =09=09 #include =09=09 #undef _KERNEL =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./ntfs/ntfs_compr.h || =09 echo "#include =09=09 #define _KERNEL =09=09 #include =09=09 #undef _KERNEL =09=09 #include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./ntfs/ntfs_ihash.h || echo "#include " >>z.c =09test $i !=3D ./ntfs/ntfs_inode.h || =09 echo "#include =09=09 #define _KERNEL =09=09 #include =09=09 #undef _KERNEL =09=09 #include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./ntfs/ntfsmount.h || =09 echo "#include =09=09 #include " >>z.c =09test $i !=3D ./ntfs/ntfs_subr.h || =09 echo "#include =09=09 #define _KERNEL =09=09 #include =09=09 #undef _KERNEL =09=09 #include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./ntfs/ntfs_vfsops.h || =09 echo "#include =09=09 #define _KERNEL =09=09 #include =09=09 #undef _KERNEL =09=09 #include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./nwfs/nwfs.h || echo "#include " >>z.c =09test $i !=3D ./nwfs/nwfs_mount.h || echo "#include " >>z.c =09test $i !=3D ./nwfs/nwfs_node.h || =09 echo "#include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./nwfs/nwfs_subr.h || =09 echo "#include =09=09 #include " >>z.c =09test $i !=3D ./pcap-namedb.h || echo "#include " >>z.c =09test $i !=3D ./pccard/driver.h || echo "#include " >>z.c =09test $i !=3D ./posix4/mqueue.h || echo "#include " >>z.c =09test $i !=3D ./protocols/dumprestore.h || =09 echo "#include =09=09 #include " >>z.c =09test $i !=3D ./protocols/routed.h || =09 echo "#include =09=09 #include " >>z.c =09test $i !=3D ./protocols/rwhod.h || =09 echo "#include " >>z.c =09test $i !=3D ./protocols/talkd.h || =09 echo "#include =09=09 #include " >>z.c =09test $i !=3D ./protocols/timed.h || =09 echo "#include =09=09 #include " >>z.c =09test $i !=3D ./pthread_np.h || =09 echo "#include " >>z.c =09test $i !=3D ./readline/readline.h || echo "#include " >>z.c =09test $i !=3D ./regex.h || echo "#include " >>z.c =09test $i !=3D ./resolv.h || =09 echo "#include =09=09 #include " >>z.c =09test $i !=3D ./rpc/auth.h || =09 echo "#include =09=09 #include " >>z.c =09test $i !=3D ./rpc/auth_des.h || =09 echo "#include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./rpc/auth_unix.h || =09 echo "#include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./rpc/clnt.h || =09 echo "#include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./rpc/des.h || echo "#include " >>z.c =09test $i !=3D ./rpc/pmap_clnt.h || =09 echo "#include =09=09 #include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./rpc/pmap_prot.h || =09 echo "#include =09=09 #include " >>z.c =09test $i !=3D ./rpc/pmap_rmt.h || =09 echo "#include =09=09 #include " >>z.c =09test $i !=3D ./rpc/rpc_com.h || echo "#include " >>z.c =09test $i !=3D ./rpc/rpc_msg.h || =09 echo "#include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./rpc/svc.h || =09 echo "#include =09=09 #include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./rpc/svc_auth.h || =09 echo "#include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./rpc/xdr.h || echo "#include " >>z.c =09test $i !=3D ./rpcsvc/nislib.h || echo "#include " >>z.c =09test $i !=3D ./rpcsvc/yp_prot.h || =09 echo "#include =09=09 #include =09=09 #include =09=09 #include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./security/pam_mod_misc.h || =09 echo "#include " >>z.c =09test $i !=3D ./skey.h || echo "#include " >>z.c =09test $i !=3D ./sys/acct.h || echo "#include " >>z.c =09test $i !=3D ./sys/acl.h || echo "#include " >>z.c =09test $i !=3D ./sys/blist.h || echo "#include " >>z.c =09test $i !=3D ./sys/buf.h || echo "#include " >>z.c =09test $i !=3D ./sys/callout.h || echo "#include " >>z.c =09test $i !=3D ./sys/ccdvar.h || =09 echo "#include =09=09 #include " >>z.c =09test $i !=3D ./sys/clist.h || echo "#include " >>z.c =09test $i !=3D ./sys/conf.h || echo "#include " >>z.c =09test $i !=3D ./sys/cons.h || echo "#include " >>z.c =09test $i !=3D ./sys/devfsext.h || echo "#include " >>z.c =09test $i !=3D ./sys/dkbad.h || echo "#include " >>z.c =09test $i !=3D ./sys/dmap.h || echo "#include " >>z.c =09test $i !=3D ./sys/domain.h || echo "#include " >>z.c =09test $i !=3D ./sys/dvdio.h || echo "#include " >>z.c =09test $i !=3D ./sys/elf_common.h || echo "#include " >>z.c =09test $i !=3D ./sys/elf32.h || echo "#include " >>z.c =09test $i !=3D ./sys/elf64.h || echo "#include " >>z.c =09test $i !=3D ./sys/elf_generic.h || =09 echo "#include =09=09 #include " >>z.c =09test $i !=3D ./sys/eventhandler.h || echo "#include " >>z.= c =09test $i !=3D ./sys/exec.h || echo "#include " >>z.c =09test $i !=3D ./sys/extattr.h || echo "#include " >>z.c =09test $i !=3D ./sys/filedesc.h || echo "#include " >>z.c =09test $i !=3D ./sys/gmon.h || echo "#include " >>z.c =09test $i !=3D ./sys/imgact_elf.h || echo "#include " >>z.c =09test $i !=3D ./sys/interrupt.h || echo "#include " >>z.c =09test $i !=3D ./sys/ipc.h || echo "#include " >>z.c =09test $i !=3D ./sys/jail.h || echo "#include " >>z.c =09test $i !=3D ./sys/kernel.h || echo "#include " >>z.c =09test $i !=3D ./sys/kthread.h || echo "#include " >>z.c =09test $i !=3D ./sys/ktrace.h || =09 echo "#include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./sys/linker.h || echo "#include " >>z.c =09test $i !=3D ./sys/lkm.h || echo "#include " >>z.c =09test $i !=3D ./sys/lock.h || echo "#include " >>z.c =09test $i !=3D ./sys/lockf.h || echo "#include " >>z.c =09test $i !=3D ./sys/malloc.h || echo "#include " >>z.c =09test $i !=3D ./sys/mbuf.h || echo "#include " >>z.c =09test $i !=3D ./sys/md5.h || echo "#include " >>z.c =09test $i !=3D ./sys/memrange.h || echo "#include " >>z.c =09test $i !=3D ./sys/mman.h || echo "#include " >>z.c =09test $i !=3D ./sys/module.h || echo "#include " >>z.c =09test $i !=3D ./sys/mount.h || echo "#include " >>z.c =09test $i !=3D ./sys/msg.h || echo "#include " >>z.c =09test $i !=3D ./sys/namei.h || echo "#include " >>z.c =09test $i !=3D ./sys/pciio.h || echo "#include " >>z.c =09test $i !=3D ./sys/proc.h || echo "#include " >>z.c =09test $i !=3D ./sys/protosw.h || echo "#include " >>z.c =09test $i !=3D ./sys/ptrace.h || echo "#include " >>z.c =09test $i !=3D ./sys/resource.h || echo "#include " >>z.c =09test $i !=3D ./sys/resourcevar.h || echo "#include " >>z.c =09test $i !=3D ./sys/rlist.h || echo "#include " >>z.c =09test $i !=3D ./sys/rman.h || =09 echo "#include =09=09 #include " >>z.c =09test $i !=3D ./sys/rtprio.h || echo "#include " >>z.c =09test $i !=3D ./sys/select.h || echo "#include " >>z.c =09test $i !=3D ./sys/sem.h || echo "#include " >>z.c =09test $i !=3D ./sys/shm.h || echo "#include " >>z.c =09test $i !=3D ./sys/signal.h || echo "#include " >>z.c =09test $i !=3D ./sys/signalvar.h || echo "#include " >>z.c =09test $i !=3D ./sys/socket.h || echo "#include " >>z.c =09test $i !=3D ./sys/socketvar.h || echo "#include " >>z.c =09test $i !=3D ./sys/sysctl.h || echo "#include " >>z.c =09test $i !=3D ./sys/sysent.h || echo "#include " >>z.c =09test $i !=3D ./sys/systm.h || echo "#include " >>z.c =09test $i !=3D ./sys/timeb.h || echo "#include " >>z.c =09test $i !=3D ./sys/timex.h || echo "#include " >>z.c =09test $i !=3D ./sys/tprintf.h || echo "#include " >>z.c =09test $i !=3D ./sys/tty.h || echo "#include " >>z.c =09test $i !=3D ./sys/ucontext.h || =09 echo "#include =09=09 #include " >>z.c =09test $i !=3D ./sys/ucred.h || echo "#include " >>z.c =09test $i !=3D ./sys/uio.h || echo "#include " >>z.c =09test $i !=3D ./sys/un.h || echo "#include " >>z.c =09test $i !=3D ./sys/unpcb.h || echo "#include " >>z.c =09test $i !=3D ./sys/user.h || echo "#include " >>z.c =09test $i !=3D ./sys/vmmeter.h || echo "#include " >>z.c =09test $i !=3D ./sys/vnode.h || echo "#include " >>z.c =09test $i !=3D ./sys/vsio.h || echo "#include " >>z.c =09test $i !=3D ./sys/wormio.h || echo "#include " >>z.c =09test $i !=3D ./sys/xrpuio.h || echo "#include " >>z.c =09test $i !=3D ./ucontext.h || =09 echo "#include =09=09 #include " >>z.c =09test $i !=3D ./ufs/ffs/ffs_extern.h || =09 echo "#include =09=09 #include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./ufs/ffs/fs.h || =09 echo "#include " >>z.c =09test $i !=3D ./ufs/ffs/softdep.h || =09 echo "#include =09=09 #include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./ufs/mfs/mfs_extern.h || echo "#include " >>= z.c =09test $i !=3D ./ufs/mfs/mfsnode.h || =09 echo "#include =09=09 #include " >>z.c =09test $i !=3D ./ufs/ufs/dinode.h || echo "#include " >>z.c =09test $i !=3D ./ufs/ufs/dir.h || echo "#include " >>z.c =09test $i !=3D ./ufs/ufs/inode.h || =09 echo "#include =09=09 #include " >>z.c =09test $i !=3D ./ufs/ufs/quota.h || echo "#include " >>z.c =09test $i !=3D ./ufs/ufs/ufs_extern.h || =09 echo "#include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./ufs/ufs/ufsmount.h || =09 echo "#include =09=09 #include " >>z.c =09test $i !=3D ./utime.h || echo "#include " >>z.c =09test $i !=3D ./utmp.h || echo "#include " >>z.c =09test $i !=3D ./vgl.h || echo "#include " >>z.c =09test $i !=3D ./vm/default_pager.h || =09 echo "#include =09=09 #include " >>z.c =09test $i !=3D ./vm/pmap.h || =09 echo "#include =09=09 #include " >>z.c =09test $i !=3D ./vm/swap_pager.h || =09 echo "#include =09=09 #include " >>z.c =09test $i !=3D ./vm/vm.h || echo "#include " >>z.c =09test $i !=3D ./vm/vm_kern.h || =09 echo "#include =09=09 #include " >>z.c =09test $i !=3D ./vm/vm_map.h || =09 echo "#include =09=09 #include =09=09 #include =09=09 #include " >>z.c =09test $i !=3D ./vm/vm_object.h || echo "#include " >>z.c =09test $i !=3D ./vm/vm_page.h || =09 echo "#include =09=09 #include " >>z.c =09test $i !=3D ./vm/vm_pageout.h || echo "#include " >>z.c =09test $i !=3D ./vm/vm_pager.h || =09 echo "#include =09=09 #include " >>z.c =09test $i !=3D ./vm/vm_zone.h || echo "#include " >>z.c =09sed 's/^[ =09]*//' z1.c =09echo "#include <$i>" >>z1.c =09echo "int dummy;" >>z1.c =09gccw -S z1.c #=09echo "--- <$i> ---"; CFLAGS=3D-O unusedinc z1.o #if ! #=09cc -Dconst=3D -Dvolatile=3D -traditional -S z1.c #then echo $i; bash; fi #=09bcc -Dconst=3D -Dvolatile=3D -D__inline=3D -D__i386__ -S z1.c done %%% Bruce --0-37656405-1234640396=:2522-- From owner-svn-src-head@FreeBSD.ORG Sat Feb 14 19:46:29 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D51A1065672; Sat, 14 Feb 2009 19:46:29 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0C0218FC0C; Sat, 14 Feb 2009 19:46:29 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1EJkSC4028691; Sat, 14 Feb 2009 19:46:28 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1EJkS34028690; Sat, 14 Feb 2009 19:46:28 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200902141946.n1EJkS34028690@svn.freebsd.org> From: Ed Schouten Date: Sat, 14 Feb 2009 19:46:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188609 - head/sys/dev/usb2/core X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Feb 2009 19:46:29 -0000 Author: ed Date: Sat Feb 14 19:46:28 2009 New Revision: 188609 URL: http://svn.freebsd.org/changeset/base/188609 Log: Remove unneeded execute-permissions from the USB2 device node. Giving a charactere device execute permissions doesn't have any use. Right now there isn't a single device node in /dev that has it, except the USB2 device node, so remove it. Approved by: hps, thompsa Modified: head/sys/dev/usb2/core/usb2_dev.c Modified: head/sys/dev/usb2/core/usb2_dev.c ============================================================================== --- head/sys/dev/usb2/core/usb2_dev.c Sat Feb 14 18:23:52 2009 (r188608) +++ head/sys/dev/usb2/core/usb2_dev.c Sat Feb 14 19:46:28 2009 (r188609) @@ -1466,13 +1466,13 @@ usb2_dev_init_post(void *arg) * should never be opened. Therefore a space character is * appended after the USB device name. * - * NOTE: The permissions of this device is 0777, because we + * NOTE: The permissions of this device is 0666, because we * check the permissions again in the open routine against the - * real USB permissions which are not 0777. Else USB access + * real USB permissions which are not 0666. Else USB access * will be limited to one user and one group. */ usb2_dev = make_dev(&usb2_devsw, 0, UID_ROOT, GID_OPERATOR, - 0777, USB_DEVICE_NAME " "); + 0666, USB_DEVICE_NAME " "); if (usb2_dev == NULL) { DPRINTFN(0, "Could not create usb bus device!\n"); } From owner-svn-src-head@FreeBSD.ORG Sat Feb 14 21:12:24 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A4991106564A; Sat, 14 Feb 2009 21:12:24 +0000 (UTC) (envelope-from marcus@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9323B8FC1E; Sat, 14 Feb 2009 21:12:24 +0000 (UTC) (envelope-from marcus@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1ELCOaX030475; Sat, 14 Feb 2009 21:12:24 GMT (envelope-from marcus@svn.freebsd.org) Received: (from marcus@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1ELCOJg030474; Sat, 14 Feb 2009 21:12:24 GMT (envelope-from marcus@svn.freebsd.org) Message-Id: <200902142112.n1ELCOJg030474@svn.freebsd.org> From: Joe Marcus Clarke Date: Sat, 14 Feb 2009 21:12:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188613 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Feb 2009 21:12:25 -0000 Author: marcus (doc,ports committer) Date: Sat Feb 14 21:12:24 2009 New Revision: 188613 URL: http://svn.freebsd.org/changeset/base/188613 Log: Change two KASSERTS to printfs and simple returns. Stress testing has revealed that a process' current working directory can be VBAD if the directory is removed. This can trigger a panic when procstat -f PID is run. Tested by: pho Discovered by: phobot Reviewed by: kib Approved by: kib Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Sat Feb 14 21:08:40 2009 (r188612) +++ head/sys/kern/kern_descrip.c Sat Feb 14 21:12:24 2009 (r188613) @@ -2532,7 +2532,12 @@ export_vnode_for_osysctl(struct vnode *v kif->kf_fd = type; kif->kf_type = KF_TYPE_VNODE; /* This function only handles directories. */ - KASSERT(vp->v_type == VDIR, ("export_vnode_for_osysctl: vnode not directory")); + if (vp->v_type != VDIR) { + printf("export_vnode_for_osysctl: vnode not directory: %d\n", + vp->v_type); + vrele(vp); + return (ENOTDIR); + } kif->kf_vnode_type = KF_VTYPE_VDIR; /* @@ -2779,7 +2784,12 @@ export_vnode_for_sysctl(struct vnode *vp kif->kf_fd = type; kif->kf_type = KF_TYPE_VNODE; /* This function only handles directories. */ - KASSERT(vp->v_type == VDIR, ("export_vnode_for_sysctl: vnode not directory")); + if (vp->v_type != VDIR) { + printf("export_vnode_for_sysctl: vnode not directory: %d\n", + vp->v_type); + vrele(vp); + return (ENOTDIR); + } kif->kf_vnode_type = KF_VTYPE_VDIR; /* From owner-svn-src-head@FreeBSD.ORG Sat Feb 14 21:16:29 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 99B611065687; Sat, 14 Feb 2009 21:16:29 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.terabit.net.ua (mail.terabit.net.ua [195.137.202.147]) by mx1.freebsd.org (Postfix) with ESMTP id 3957C8FC0A; Sat, 14 Feb 2009 21:16:29 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from skuns.zoral.com.ua ([91.193.166.194] helo=mail.zoral.com.ua) by mail.terabit.net.ua with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63 (FreeBSD)) (envelope-from ) id 1LYRsB-00088D-PV; Sat, 14 Feb 2009 23:16:27 +0200 Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id n1ELGPs9061615 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 14 Feb 2009 23:16:25 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3) with ESMTP id n1ELGOqe064789; Sat, 14 Feb 2009 23:16:24 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id n1ELGO6Q064785; Sat, 14 Feb 2009 23:16:24 +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: Sat, 14 Feb 2009 23:16:24 +0200 From: Kostik Belousov To: Joe Marcus Clarke Message-ID: <20090214211624.GS2723@deviant.kiev.zoral.com.ua> References: <200902142112.n1ELCOJg030474@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="TMgB3/Ch1aWgZB1L" Content-Disposition: inline In-Reply-To: <200902142112.n1ELCOJg030474@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua X-Virus-Scanned: mail.terabit.net.ua 1LYRsB-00088D-PV 22c373e5dfbd4e894c91533a492065e7 X-Terabit: YES Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r188613 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Feb 2009 21:16:30 -0000 --TMgB3/Ch1aWgZB1L Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Feb 14, 2009 at 09:12:24PM +0000, Joe Marcus Clarke wrote: > Author: marcus (doc,ports committer) > Date: Sat Feb 14 21:12:24 2009 > New Revision: 188613 > URL: http://svn.freebsd.org/changeset/base/188613 >=20 > Log: > Change two KASSERTS to printfs and simple returns. Stress testing has > revealed that a process' current working directory can be VBAD if the > directory is removed. This can trigger a panic when procstat -f PID is > run. > =20 > Tested by: pho > Discovered by: phobot > Reviewed by: kib > Approved by: kib >=20 > Modified: > head/sys/kern/kern_descrip.c >=20 > Modified: head/sys/kern/kern_descrip.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/kern/kern_descrip.c Sat Feb 14 21:08:40 2009 (r188612) > +++ head/sys/kern/kern_descrip.c Sat Feb 14 21:12:24 2009 (r188613) > @@ -2532,7 +2532,12 @@ export_vnode_for_osysctl(struct vnode *v > kif->kf_fd =3D type; > kif->kf_type =3D KF_TYPE_VNODE; > /* This function only handles directories. */ > - KASSERT(vp->v_type =3D=3D VDIR, ("export_vnode_for_osysctl: vnode not d= irectory")); > + if (vp->v_type !=3D VDIR) { > + printf("export_vnode_for_osysctl: vnode not directory: %d\n", > + vp->v_type); > + vrele(vp); > + return (ENOTDIR); > + } > kif->kf_vnode_type =3D KF_VTYPE_VDIR; > =20 > /* > @@ -2779,7 +2784,12 @@ export_vnode_for_sysctl(struct vnode *vp > kif->kf_fd =3D type; > kif->kf_type =3D KF_TYPE_VNODE; > /* This function only handles directories. */ > - KASSERT(vp->v_type =3D=3D VDIR, ("export_vnode_for_sysctl: vnode not di= rectory")); > + if (vp->v_type !=3D VDIR) { > + printf("export_vnode_for_sysctl: vnode not directory: %d\n", > + vp->v_type); > + vrele(vp); > + return (ENOTDIR); > + } > kif->kf_vnode_type =3D KF_VTYPE_VDIR; > =20 > /* You are fast. Do we need these printf ? --TMgB3/Ch1aWgZB1L Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkmXNKgACgkQC3+MBN1Mb4i26QCeMFBrJYiZ69U6AiTKorGu/bXE u44AoOjEldye7BA1IB01q1BoPS0Yb689 =87vL -----END PGP SIGNATURE----- --TMgB3/Ch1aWgZB1L-- From owner-svn-src-head@FreeBSD.ORG Sat Feb 14 21:18:59 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3146F1065670; Sat, 14 Feb 2009 21:18:59 +0000 (UTC) (envelope-from marcus@FreeBSD.org) Received: from creme-brulee.marcuscom.com (marcuscom-pt.tunnel.tserv1.fmt.ipv6.he.net [IPv6:2001:470:1f00:ffff::1279]) by mx1.freebsd.org (Postfix) with ESMTP id CF2AD8FC18; Sat, 14 Feb 2009 21:18:58 +0000 (UTC) (envelope-from marcus@FreeBSD.org) Received: from [IPv6:2001:470:1f00:2464::4] (shumai.marcuscom.com [IPv6:2001:470:1f00:2464::4]) by creme-brulee.marcuscom.com (8.14.3/8.14.3) with ESMTP id n1ELK0cT077141; Sat, 14 Feb 2009 16:20:00 -0500 (EST) (envelope-from marcus@FreeBSD.org) From: Joe Marcus Clarke To: Kostik Belousov In-Reply-To: <20090214211624.GS2723@deviant.kiev.zoral.com.ua> References: <200902142112.n1ELCOJg030474@svn.freebsd.org> <20090214211624.GS2723@deviant.kiev.zoral.com.ua> Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-jLw1QV6hEssTVeSFVuUz" Organization: FreeBSD, Inc. Date: Sat, 14 Feb 2009 16:19:02 -0500 Message-Id: <1234646342.42927.100.camel@shumai.marcuscom.com> Mime-Version: 1.0 X-Mailer: Evolution 2.24.4 FreeBSD GNOME Team Port X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,NO_RELAYS autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on creme-brulee.marcuscom.com Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r188613 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Feb 2009 21:18:59 -0000 --=-jLw1QV6hEssTVeSFVuUz Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Sat, 2009-02-14 at 23:16 +0200, Kostik Belousov wrote: > On Sat, Feb 14, 2009 at 09:12:24PM +0000, Joe Marcus Clarke wrote: > > Author: marcus (doc,ports committer) > > Date: Sat Feb 14 21:12:24 2009 > > New Revision: 188613 > > URL: http://svn.freebsd.org/changeset/base/188613 > >=20 > > Log: > > Change two KASSERTS to printfs and simple returns. Stress testing ha= s > > revealed that a process' current working directory can be VBAD if the > > directory is removed. This can trigger a panic when procstat -f PID = is > > run. > > =20 > > Tested by: pho > > Discovered by: phobot > > Reviewed by: kib > > Approved by: kib > >=20 > > Modified: > > head/sys/kern/kern_descrip.c > >=20 > > Modified: head/sys/kern/kern_descrip.c > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- head/sys/kern/kern_descrip.c Sat Feb 14 21:08:40 2009 (r188612) > > +++ head/sys/kern/kern_descrip.c Sat Feb 14 21:12:24 2009 (r188613) > > @@ -2532,7 +2532,12 @@ export_vnode_for_osysctl(struct vnode *v > > kif->kf_fd =3D type; > > kif->kf_type =3D KF_TYPE_VNODE; > > /* This function only handles directories. */ > > - KASSERT(vp->v_type =3D=3D VDIR, ("export_vnode_for_osysctl: vnode not= directory")); > > + if (vp->v_type !=3D VDIR) { > > + printf("export_vnode_for_osysctl: vnode not directory: %d\n", > > + vp->v_type); > > + vrele(vp); > > + return (ENOTDIR); > > + } > > kif->kf_vnode_type =3D KF_VTYPE_VDIR; > > =20 > > /* > > @@ -2779,7 +2784,12 @@ export_vnode_for_sysctl(struct vnode *vp > > kif->kf_fd =3D type; > > kif->kf_type =3D KF_TYPE_VNODE; > > /* This function only handles directories. */ > > - KASSERT(vp->v_type =3D=3D VDIR, ("export_vnode_for_sysctl: vnode not = directory")); > > + if (vp->v_type !=3D VDIR) { > > + printf("export_vnode_for_sysctl: vnode not directory: %d\n", > > + vp->v_type); > > + vrele(vp); > > + return (ENOTDIR); > > + } > > kif->kf_vnode_type =3D KF_VTYPE_VDIR; > > =20 > > /* > You are fast. Do we need these printf ? I thought about it. My first patch actually didn't have them. But I thought I'd leave them in to see how common this occurrence was in the wild. I'm not in love with them. If you think they should go, I'll pull them. Joe --=20 Joe Marcus Clarke FreeBSD GNOME Team :: gnome@FreeBSD.org FreeNode / #freebsd-gnome http://www.FreeBSD.org/gnome --=-jLw1QV6hEssTVeSFVuUz Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEABECAAYFAkmXNUQACgkQb2iPiv4Uz4fX2ACgp3cCMXa7jTPhCsCEQKAAiI0G dqQAn3rHSXEOYDs4+ZODPY991hoe03sR =Wf79 -----END PGP SIGNATURE----- --=-jLw1QV6hEssTVeSFVuUz-- From owner-svn-src-head@FreeBSD.ORG Sat Feb 14 21:54:45 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3FA011065670; Sat, 14 Feb 2009 21:54:45 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2D1D18FC18; Sat, 14 Feb 2009 21:54:45 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1ELsjq6031278; Sat, 14 Feb 2009 21:54:45 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1ELsi2o031275; Sat, 14 Feb 2009 21:54:44 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200902142154.n1ELsi2o031275@svn.freebsd.org> From: Alexander Motin Date: Sat, 14 Feb 2009 21:54:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188615 - head/sys/dev/ata X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Feb 2009 21:54:45 -0000 Author: mav Date: Sat Feb 14 21:54:44 2009 New Revision: 188615 URL: http://svn.freebsd.org/changeset/base/188615 Log: DEVICE_PROBE(9) claims that we must not initialize softc on probe stage. Move channel softc initialization from ata_XXX_probe() to ata_XXX_attach(). Instead of calculating ata channel number as position in child device list, pass it's real number directly from controller probe routine using ivars. It is simpler and IMHO more correct. Modified: head/sys/dev/ata/ata-cbus.c head/sys/dev/ata/ata-pci.c head/sys/dev/ata/ata-usb.c Modified: head/sys/dev/ata/ata-cbus.c ============================================================================== --- head/sys/dev/ata/ata-cbus.c Sat Feb 14 21:12:58 2009 (r188614) +++ head/sys/dev/ata/ata-cbus.c Sat Feb 14 21:54:44 2009 (r188615) @@ -106,7 +106,8 @@ static int ata_cbus_attach(device_t dev) { struct ata_cbus_controller *ctlr = device_get_softc(dev); - int rid; + device_t child; + int rid, unit; /* allocate resources */ rid = ATA_IOADDR_RID; @@ -159,12 +160,16 @@ ata_cbus_attach(device_t dev) ctlr->locked_bank = -1; ctlr->restart_bank = -1; - if (!device_add_child(dev, "ata", 0)) - return ENOMEM; - if (!device_add_child(dev, "ata", 1)) - return ENOMEM; + for (unit = 0; unit < 2; unit++) { + child = device_add_child(dev, "ata", unit); + if (child == NULL) + device_printf(dev, "failed to add ata child device\n"); + else + device_set_ivars(child, (void *)(intptr_t)unit); + } - return bus_generic_attach(dev); + bus_generic_attach(dev); + return (0); } static struct resource * @@ -259,19 +264,22 @@ DRIVER_MODULE(atacbus, isa, ata_cbus_dri static int ata_cbuschannel_probe(device_t dev) { + char buffer[32]; + + sprintf(buffer, "ATA channel %d", (int)(intptr_t)device_get_ivars(dev)); + device_set_desc_copy(dev, buffer); + + return ata_probe(dev); +} + +static int +ata_cbuschannel_attach(device_t dev) +{ struct ata_cbus_controller *ctlr = device_get_softc(device_get_parent(dev)); struct ata_channel *ch = device_get_softc(dev); - device_t *children; - int count, i; - - /* find channel number on this controller */ - device_get_children(device_get_parent(dev), &children, &count); - for (i = 0; i < count; i++) { - if (children[i] == dev) - ch->unit = i; - } - free(children, M_TEMP); + int i; + ch->unit = (intptr_t)device_get_ivars(dev); /* setup the resource vectors */ for (i = ATA_DATA; i <= ATA_COMMAND; i ++) { ch->r_io[i].res = ctlr->io; @@ -285,7 +293,8 @@ ata_cbuschannel_probe(device_t dev) /* initialize softc for this channel */ ch->flags |= ATA_USE_16BIT; ata_generic_hw(dev); - return ata_probe(dev); + + return ata_attach(dev); } static int @@ -333,7 +342,7 @@ ata_cbuschannel_banking(device_t dev, in static device_method_t ata_cbuschannel_methods[] = { /* device interface */ DEVMETHOD(device_probe, ata_cbuschannel_probe), - DEVMETHOD(device_attach, ata_attach), + DEVMETHOD(device_attach, ata_cbuschannel_attach), DEVMETHOD(device_detach, ata_detach), DEVMETHOD(device_suspend, ata_suspend), DEVMETHOD(device_resume, ata_resume), Modified: head/sys/dev/ata/ata-pci.c ============================================================================== --- head/sys/dev/ata/ata-pci.c Sat Feb 14 21:12:58 2009 (r188614) +++ head/sys/dev/ata/ata-pci.c Sat Feb 14 21:54:44 2009 (r188615) @@ -88,6 +88,7 @@ int ata_pci_attach(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); + device_t child; u_int32_t cmd; int unit; @@ -121,11 +122,13 @@ ata_pci_attach(device_t dev) /* attach all channels on this controller */ for (unit = 0; unit < ctlr->channels; unit++) { - if ((unit == 0 || unit == 1) && ctlr->legacy) { - device_add_child(dev, "ata", unit); - continue; - } - device_add_child(dev, "ata", devclass_find_free_unit(ata_devclass, 2)); + child = device_add_child(dev, "ata", + ((unit == 0 || unit == 1) && ctlr->legacy) ? + unit : devclass_find_free_unit(ata_devclass, 2)); + if (child == NULL) + device_printf(dev, "failed to add ata child device\n"); + else + device_set_ivars(child, (void *)(intptr_t)unit); } bus_generic_attach(dev); return 0; @@ -504,23 +507,9 @@ MODULE_DEPEND(atapci, ata, 1, 1, 1); static int ata_pcichannel_probe(device_t dev) { - struct ata_channel *ch = device_get_softc(dev); - device_t *children; - int count, i; char buffer[32]; - /* take care of green memory */ - bzero(ch, sizeof(struct ata_channel)); - - /* find channel number on this controller */ - device_get_children(device_get_parent(dev), &children, &count); - for (i = 0; i < count; i++) { - if (children[i] == dev) - ch->unit = i; - } - free(children, M_TEMP); - - sprintf(buffer, "ATA channel %d", ch->unit); + sprintf(buffer, "ATA channel %d", (int)(intptr_t)device_get_ivars(dev)); device_set_desc_copy(dev, buffer); return ata_probe(dev); @@ -530,8 +519,14 @@ static int ata_pcichannel_attach(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); + struct ata_channel *ch = device_get_softc(dev); int error; + /* take care of green memory */ + bzero(ch, sizeof(struct ata_channel)); + + ch->unit = (intptr_t)device_get_ivars(dev); + if (ctlr->dmainit) ctlr->dmainit(dev); Modified: head/sys/dev/ata/ata-usb.c ============================================================================== --- head/sys/dev/ata/ata-usb.c Sat Feb 14 21:12:58 2009 (r188614) +++ head/sys/dev/ata/ata-usb.c Sat Feb 14 21:54:44 2009 (r188615) @@ -196,6 +196,7 @@ atausb_attach(device_t dev) usb_endpoint_descriptor_t *ed; usbd_device_handle udev; usb_device_request_t request; + device_t child; char devinfo[1024], *proto, *subclass; u_int8_t maxlun; int err, i; @@ -337,12 +338,11 @@ atausb_attach(device_t dev) /* ata channels are children to this USB control device */ for (i = 0; i <= sc->maxlun; i++) { - if (!device_add_child(sc->dev, "ata", - devclass_find_free_unit(ata_devclass, 2))) { - device_printf(sc->dev, "failed to attach ata child device\n"); - atausb_detach(dev); - return ENXIO; - } + if ((child = device_add_child(sc->dev, "ata", + devclass_find_free_unit(ata_devclass, 2))) == NULL) { + device_printf(sc->dev, "failed to add ata child device\n"); + } else + device_set_ivars(child, (void *)(intptr_t)i); } bus_generic_attach(sc->dev); return 0; @@ -829,23 +829,9 @@ ata_usbchannel_end_transaction(struct at static int ata_usbchannel_probe(device_t dev) { - struct ata_channel *ch = device_get_softc(dev); - device_t *children; - int count, i; char buffer[32]; - /* take care of green memory */ - bzero(ch, sizeof(struct ata_channel)); - - /* find channel number on this controller */ - device_get_children(device_get_parent(dev), &children, &count); - for (i = 0; i < count; i++) { - if (children[i] == dev) - ch->unit = i; - } - free(children, M_TEMP); - - sprintf(buffer, "USB lun %d", ch->unit); + sprintf(buffer, "USB lun %d", (int)(intptr_t)device_get_ivars(dev)); device_set_desc_copy(dev, buffer); return 0; @@ -856,8 +842,12 @@ ata_usbchannel_attach(device_t dev) { struct ata_channel *ch = device_get_softc(dev); + /* take care of green memory */ + bzero(ch, sizeof(struct ata_channel)); + /* initialize the softc basics */ ch->dev = dev; + ch->unit = (intptr_t)device_get_ivars(dev); ch->state = ATA_IDLE; ch->hw.begin_transaction = ata_usbchannel_begin_transaction; ch->hw.end_transaction = ata_usbchannel_end_transaction; From owner-svn-src-head@FreeBSD.ORG Sat Feb 14 21:55:09 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D1E741065670; Sat, 14 Feb 2009 21:55:09 +0000 (UTC) (envelope-from marcus@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 848488FC22; Sat, 14 Feb 2009 21:55:09 +0000 (UTC) (envelope-from marcus@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1ELt9Ak031341; Sat, 14 Feb 2009 21:55:09 GMT (envelope-from marcus@svn.freebsd.org) Received: (from marcus@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1ELt9W3031340; Sat, 14 Feb 2009 21:55:09 GMT (envelope-from marcus@svn.freebsd.org) Message-Id: <200902142155.n1ELt9W3031340@svn.freebsd.org> From: Joe Marcus Clarke Date: Sat, 14 Feb 2009 21:55:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188616 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Feb 2009 21:55:10 -0000 Author: marcus (doc,ports committer) Date: Sat Feb 14 21:55:09 2009 New Revision: 188616 URL: http://svn.freebsd.org/changeset/base/188616 Log: Remove the printf's when the vnode to be exported for procstat is not a VDIR. If the file system backing a process' cwd is removed, and procstat -f PID is called, then these messages would have been printed. The extra verbosity is not required in this situation. Requested by: kib Approved by: kib Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Sat Feb 14 21:54:44 2009 (r188615) +++ head/sys/kern/kern_descrip.c Sat Feb 14 21:55:09 2009 (r188616) @@ -2533,8 +2533,6 @@ export_vnode_for_osysctl(struct vnode *v kif->kf_type = KF_TYPE_VNODE; /* This function only handles directories. */ if (vp->v_type != VDIR) { - printf("export_vnode_for_osysctl: vnode not directory: %d\n", - vp->v_type); vrele(vp); return (ENOTDIR); } @@ -2785,8 +2783,6 @@ export_vnode_for_sysctl(struct vnode *vp kif->kf_type = KF_TYPE_VNODE; /* This function only handles directories. */ if (vp->v_type != VDIR) { - printf("export_vnode_for_sysctl: vnode not directory: %d\n", - vp->v_type); vrele(vp); return (ENOTDIR); } From owner-svn-src-head@FreeBSD.ORG Sat Feb 14 22:07:22 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BF9E71065677; Sat, 14 Feb 2009 22:07:22 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ADC0B8FC19; Sat, 14 Feb 2009 22:07:22 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1EM7Mic031606; Sat, 14 Feb 2009 22:07:22 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1EM7MVJ031605; Sat, 14 Feb 2009 22:07:22 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <200902142207.n1EM7MVJ031605@svn.freebsd.org> From: Alan Cox Date: Sat, 14 Feb 2009 22:07:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188617 - head/sys/i386/xen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Feb 2009 22:07:23 -0000 Author: alc Date: Sat Feb 14 22:07:22 2009 New Revision: 188617 URL: http://svn.freebsd.org/changeset/base/188617 Log: Remove unnecessary page queues locking around vm_page_wakeup(). Approved by: kmacy Modified: head/sys/i386/xen/pmap.c Modified: head/sys/i386/xen/pmap.c ============================================================================== --- head/sys/i386/xen/pmap.c Sat Feb 14 21:55:09 2009 (r188616) +++ head/sys/i386/xen/pmap.c Sat Feb 14 22:07:22 2009 (r188617) @@ -3126,9 +3126,7 @@ retry: } p = vm_page_lookup(object, pindex); - vm_page_lock_queues(); vm_page_wakeup(p); - vm_page_unlock_queues(); } ptepa = VM_PAGE_TO_PHYS(p); From owner-svn-src-head@FreeBSD.ORG Sat Feb 14 22:29:55 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4751E1065674; Sat, 14 Feb 2009 22:29:55 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3459E8FC1C; Sat, 14 Feb 2009 22:29:55 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1EMTtfk032110; Sat, 14 Feb 2009 22:29:55 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1EMTtew032108; Sat, 14 Feb 2009 22:29:55 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200902142229.n1EMTtew032108@svn.freebsd.org> From: Andrew Thompson Date: Sat, 14 Feb 2009 22:29:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188619 - head/sys/dev/usb2/wlan X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Feb 2009 22:29:55 -0000 Author: thompsa Date: Sat Feb 14 22:29:54 2009 New Revision: 188619 URL: http://svn.freebsd.org/changeset/base/188619 Log: - ieee80211_chan2ieee returns an int - avoid null deref in detach - update pause timings Obtained from: //depot/projects/usb Modified: head/sys/dev/usb2/wlan/if_rum2.c head/sys/dev/usb2/wlan/if_ural2.c Modified: head/sys/dev/usb2/wlan/if_rum2.c ============================================================================== --- head/sys/dev/usb2/wlan/if_rum2.c Sat Feb 14 22:24:04 2009 (r188618) +++ head/sys/dev/usb2/wlan/if_rum2.c Sat Feb 14 22:29:54 2009 (r188619) @@ -192,6 +192,7 @@ static int rum_get_rssi(struct rum_soft static void rum_amrr_start(struct rum_softc *, struct ieee80211_node *); static void rum_amrr_timeout(void *); +static int rum_pause(struct rum_softc *, int); static void rum_queue_command(struct rum_softc *, usb2_proc_callback_t *, struct usb2_proc_msg *, struct usb2_proc_msg *); @@ -446,12 +447,13 @@ rum_attach_post(struct usb2_proc_msg *pm uint8_t bands; /* retrieve RT2573 rev. no */ - for (ntries = 0; ntries != 1000; ntries++) { + for (ntries = 0; ntries < 100; ntries++) { if ((tmp = rum_read(sc, RT2573_MAC_CSR0)) != 0) break; - usb2_pause_mtx(&sc->sc_mtx, hz / 1000); + if (rum_pause(sc, hz / 100)) + break; } - if (ntries == 1000) { + if (ntries == 100) { device_printf(sc->sc_dev, "timeout waiting for chip to settle\n"); return; } @@ -547,7 +549,7 @@ rum_detach(device_t self) { struct rum_softc *sc = device_get_softc(self); struct ifnet *ifp = sc->sc_ifp; - struct ieee80211com *ic = ifp->if_l2com; + struct ieee80211com *ic; /* wait for any post attach or other command to complete */ usb2_proc_drain(&sc->sc_tq); @@ -562,6 +564,7 @@ rum_detach(device_t self) RUM_UNLOCK(sc); if (ifp) { + ic = ifp->if_l2com; bpfdetach(ifp); ieee80211_ifdetach(ic); if_free(ifp); @@ -1452,11 +1455,13 @@ rum_bbp_write(struct rum_softc *sc, uint uint32_t tmp; int ntries; - for (ntries = 0; ntries < 5; ntries++) { + for (ntries = 0; ntries < 100; ntries++) { if (!(rum_read(sc, RT2573_PHY_CSR3) & RT2573_BBP_BUSY)) break; + if (rum_pause(sc, hz / 100)) + break; } - if (ntries == 5) { + if (ntries == 100) { device_printf(sc->sc_dev, "could not write to BBP\n"); return; } @@ -1471,11 +1476,13 @@ rum_bbp_read(struct rum_softc *sc, uint8 uint32_t val; int ntries; - for (ntries = 0; ntries < 5; ntries++) { + for (ntries = 0; ntries < 100; ntries++) { if (!(rum_read(sc, RT2573_PHY_CSR3) & RT2573_BBP_BUSY)) break; + if (rum_pause(sc, hz / 100)) + break; } - if (ntries == 5) { + if (ntries == 100) { device_printf(sc->sc_dev, "could not read BBP\n"); return 0; } @@ -1487,7 +1494,8 @@ rum_bbp_read(struct rum_softc *sc, uint8 val = rum_read(sc, RT2573_PHY_CSR3); if (!(val & RT2573_BBP_BUSY)) return val & 0xff; - DELAY(1); + if (rum_pause(sc, hz / 100)) + break; } device_printf(sc->sc_dev, "could not read BBP\n"); @@ -1500,11 +1508,13 @@ rum_rf_write(struct rum_softc *sc, uint8 uint32_t tmp; int ntries; - for (ntries = 0; ntries < 5; ntries++) { + for (ntries = 0; ntries < 100; ntries++) { if (!(rum_read(sc, RT2573_PHY_CSR4) & RT2573_RF_BUSY)) break; + if (rum_pause(sc, hz / 100)) + break; } - if (ntries == 5) { + if (ntries == 100) { device_printf(sc->sc_dev, "could not write to RF\n"); return; } @@ -1651,7 +1661,7 @@ rum_set_chan(struct rum_softc *sc, struc const struct rfprog *rfprog; uint8_t bbp3, bbp94 = RT2573_BBPR94_DEFAULT; int8_t power; - u_int i, chan; + int i, chan; chan = ieee80211_chan2ieee(ic, c); if (chan == 0 || chan == IEEE80211_CHAN_ANY) @@ -1698,7 +1708,7 @@ rum_set_chan(struct rum_softc *sc, struc rum_rf_write(sc, RT2573_RF3, rfprog[i].r3 | power << 7); rum_rf_write(sc, RT2573_RF4, rfprog[i].r4 | sc->rffreq << 10); - DELAY(10); + rum_pause(sc, hz / 100); /* enable smart mode for MIMO-capable RFs */ bbp3 = rum_bbp_read(sc, 3); @@ -1914,7 +1924,8 @@ rum_bbp_init(struct rum_softc *sc) const uint8_t val = rum_bbp_read(sc, 0); if (val != 0 && val != 0xff) break; - DELAY(1000); + if (rum_pause(sc, hz / 100)) + break; } if (ntries == 100) { device_printf(sc->sc_dev, "timeout waiting for BBP\n"); @@ -1961,13 +1972,14 @@ rum_init_task(struct usb2_proc_msg *pm) rum_write(sc, RT2573_MAC_CSR1, 0); /* wait for BBP/RF to wakeup */ - for (ntries = 0; ntries < 1000; ntries++) { + for (ntries = 0; ntries < 100; ntries++) { if (rum_read(sc, RT2573_MAC_CSR12) & 8) break; rum_write(sc, RT2573_MAC_CSR12, 4); /* force wakeup */ - DELAY(1000); + if (rum_pause(sc, hz / 100)) + break; } - if (ntries == 1000) { + if (ntries == 100) { device_printf(sc->sc_dev, "timeout waiting for BBP/RF to wakeup\n"); goto fail; @@ -2011,6 +2023,7 @@ rum_init_task(struct usb2_proc_msg *pm) ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; ifp->if_drv_flags |= IFF_DRV_RUNNING; + usb2_transfer_set_stall(sc->sc_xfer[RUM_BULK_WR]); usb2_transfer_start(sc->sc_xfer[RUM_BULK_RD]); return; @@ -2279,10 +2292,9 @@ rum_set_channel(struct ieee80211com *ic) RUM_LOCK(sc); /* do it in a process context */ sc->sc_scan_action = RUM_SET_CHANNEL; + sc->sc_rates = ieee80211_get_ratetable(ic->ic_curchan); rum_queue_command(sc, rum_scantask, &sc->sc_scantask[0].hdr, &sc->sc_scantask[1].hdr); - - sc->sc_rates = ieee80211_get_ratetable(ic->ic_curchan); RUM_UNLOCK(sc); } @@ -2363,6 +2375,16 @@ rum_get_rssi(struct rum_softc *sc, uint8 return rssi; } +static int +rum_pause(struct rum_softc *sc, int timeout) +{ + if (usb2_proc_is_gone(&sc->sc_tq)) + return (1); + + usb2_pause_mtx(&sc->sc_mtx, timeout); + return (0); +} + static void rum_queue_command(struct rum_softc *sc, usb2_proc_callback_t *fn, struct usb2_proc_msg *t0, struct usb2_proc_msg *t1) Modified: head/sys/dev/usb2/wlan/if_ural2.c ============================================================================== --- head/sys/dev/usb2/wlan/if_ural2.c Sat Feb 14 22:24:04 2009 (r188618) +++ head/sys/dev/usb2/wlan/if_ural2.c Sat Feb 14 22:29:54 2009 (r188619) @@ -165,6 +165,7 @@ static int ural_raw_xmit(struct ieee802 static void ural_amrr_start(struct ural_softc *, struct ieee80211_node *); static void ural_amrr_timeout(void *); +static int ural_pause(struct ural_softc *sc, int timeout); static void ural_queue_command(struct ural_softc *, usb2_proc_callback_t *, struct usb2_proc_msg *, struct usb2_proc_msg *); @@ -533,7 +534,7 @@ ural_detach(device_t self) { struct ural_softc *sc = device_get_softc(self); struct ifnet *ifp = sc->sc_ifp; - struct ieee80211com *ic = ifp->if_l2com; + struct ieee80211com *ic; /* wait for any post attach or other command to complete */ usb2_proc_drain(&sc->sc_tq); @@ -548,6 +549,7 @@ ural_detach(device_t self) RAL_UNLOCK(sc); if (ifp) { + ic = ifp->if_l2com; bpfdetach(ifp); ieee80211_ifdetach(ic); if_free(ifp); @@ -1566,11 +1568,13 @@ ural_bbp_write(struct ural_softc *sc, ui uint16_t tmp; int ntries; - for (ntries = 0; ntries < 5; ntries++) { + for (ntries = 0; ntries < 100; ntries++) { if (!(ural_read(sc, RAL_PHY_CSR8) & RAL_BBP_BUSY)) break; + if (ural_pause(sc, hz / 100)) + break; } - if (ntries == 5) { + if (ntries == 100) { device_printf(sc->sc_dev, "could not write to BBP\n"); return; } @@ -1588,11 +1592,13 @@ ural_bbp_read(struct ural_softc *sc, uin val = RAL_BBP_WRITE | reg << 8; ural_write(sc, RAL_PHY_CSR7, val); - for (ntries = 0; ntries < 5; ntries++) { + for (ntries = 0; ntries < 100; ntries++) { if (!(ural_read(sc, RAL_PHY_CSR8) & RAL_BBP_BUSY)) break; + if (ural_pause(sc, hz / 100)) + break; } - if (ntries == 5) { + if (ntries == 100) { device_printf(sc->sc_dev, "could not read BBP\n"); return 0; } @@ -1606,11 +1612,13 @@ ural_rf_write(struct ural_softc *sc, uin uint32_t tmp; int ntries; - for (ntries = 0; ntries < 5; ntries++) { + for (ntries = 0; ntries < 100; ntries++) { if (!(ural_read(sc, RAL_PHY_CSR10) & RAL_RF_LOBUSY)) break; + if (ural_pause(sc, hz / 100)) + break; } - if (ntries == 5) { + if (ntries == 100) { device_printf(sc->sc_dev, "could not write to RF\n"); return; } @@ -1693,7 +1701,7 @@ ural_set_chan(struct ural_softc *sc, str struct ifnet *ifp = sc->sc_ifp; struct ieee80211com *ic = ifp->if_l2com; uint8_t power, tmp; - u_int i, chan; + int i, chan; chan = ieee80211_chan2ieee(ic, c); if (chan == 0 || chan == IEEE80211_CHAN_ANY) @@ -1784,7 +1792,7 @@ ural_set_chan(struct ural_softc *sc, str /* clear CRC errors */ ural_read(sc, RAL_STA_CSR0); - DELAY(10000); + ural_pause(sc, hz / 100); ural_disable_rf_tune(sc); } @@ -2009,7 +2017,8 @@ ural_bbp_init(struct ural_softc *sc) for (ntries = 0; ntries < 100; ntries++) { if (ural_bbp_read(sc, RAL_BBP_VERSION) != 0) break; - DELAY(1000); + if (ural_pause(sc, hz / 100)) + break; } if (ntries == 100) { device_printf(sc->sc_dev, "timeout waiting for BBP\n"); @@ -2110,7 +2119,8 @@ ural_init_task(struct usb2_proc_msg *pm) if ((tmp & (RAL_BBP_AWAKE | RAL_RF_AWAKE)) == (RAL_BBP_AWAKE | RAL_RF_AWAKE)) break; - DELAY(1000); + if (ural_pause(sc, hz / 100)) + break; } if (ntries == 100) { device_printf(sc->sc_dev, @@ -2205,6 +2215,8 @@ ural_stop_task(struct usb2_proc_msg *pm) ural_write(sc, RAL_TXRX_CSR2, RAL_DISABLE_RX); /* reset ASIC and BBP (but won't reset MAC registers!) */ ural_write(sc, RAL_MAC_CSR1, RAL_RESET_ASIC | RAL_RESET_BBP); + /* wait a little */ + ural_pause(sc, hz / 10); ural_write(sc, RAL_MAC_CSR1, 0); } @@ -2310,6 +2322,16 @@ ural_amrr_task(struct usb2_proc_msg *pm) usb2_callout_reset(&uvp->amrr_ch, hz, ural_amrr_timeout, uvp); } +static int +ural_pause(struct ural_softc *sc, int timeout) +{ + if (usb2_proc_is_gone(&sc->sc_tq)) + return (1); + + usb2_pause_mtx(&sc->sc_mtx, timeout); + return (0); +} + static void ural_queue_command(struct ural_softc *sc, usb2_proc_callback_t *fn, struct usb2_proc_msg *t0, struct usb2_proc_msg *t1) From owner-svn-src-head@FreeBSD.ORG Sat Feb 14 23:03:00 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 194F91065674; Sat, 14 Feb 2009 23:03:00 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 06BB48FC1C; Sat, 14 Feb 2009 23:03:00 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1EN2xOO032838; Sat, 14 Feb 2009 23:02:59 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1EN2xp0032837; Sat, 14 Feb 2009 23:02:59 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200902142302.n1EN2xp0032837@svn.freebsd.org> From: Alexander Motin Date: Sat, 14 Feb 2009 23:02:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188621 - head/sys/dev/ata/chipsets X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Feb 2009 23:03:01 -0000 Author: mav Date: Sat Feb 14 23:02:59 2009 New Revision: 188621 URL: http://svn.freebsd.org/changeset/base/188621 Log: Tunes to AHCI reset sequences: - specification claims that 1 second is just a maximum controller reset time; implement controller reset properly to save almost 1 second of boot, and about half second of resume time; - enable channel interrupts only after channel status reset to fix duplicate device creation on resume due to unwanted device connection event; - as described in specification, wait for disk ready status after channel power-up; it is not so important when disk already touched by BIOS, but solves device not ready problems on resume and probably some other cases. - uncomment channel stop/start on soft-reset as it is declared mandatory by specification; it was commented due to some random drive detection problems on VIA and JMicron controllers, but I hope it is fixed by previous point. Modified: head/sys/dev/ata/chipsets/ata-ahci.c Modified: head/sys/dev/ata/chipsets/ata-ahci.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-ahci.c Sat Feb 14 23:02:21 2009 (r188620) +++ head/sys/dev/ata/chipsets/ata-ahci.c Sat Feb 14 23:02:59 2009 (r188621) @@ -153,14 +153,19 @@ static int ata_ahci_ctlr_reset(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); + int timeout; /* enable AHCI mode */ ATA_OUTL(ctlr->r_res2, ATA_AHCI_GHC, ATA_AHCI_GHC_AE); /* reset AHCI controller */ - ATA_OUTL(ctlr->r_res2, ATA_AHCI_GHC, ATA_AHCI_GHC_HR); - DELAY(1000000); - if (ATA_INL(ctlr->r_res2, ATA_AHCI_GHC) & ATA_AHCI_GHC_HR) { + ATA_OUTL(ctlr->r_res2, ATA_AHCI_GHC, ATA_AHCI_GHC_AE|ATA_AHCI_GHC_HR); + for (timeout = 1000; timeout > 0; timeout--) { + DELAY(1000); + if ((ATA_INL(ctlr->r_res2, ATA_AHCI_GHC) & ATA_AHCI_GHC_HR) == 0) + break; + } + if (timeout == 0) { device_printf(dev, "AHCI controller reset failure\n"); return ENXIO; } @@ -517,7 +522,7 @@ ata_ahci_pm_write(device_t dev, int port } static void -ata_ahci_restart(device_t dev) +ata_ahci_stop(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); struct ata_channel *ch = device_get_softc(dev); @@ -540,6 +545,16 @@ ata_ahci_restart(device_t dev) } } while (ATA_INL(ctlr->r_res2, ATA_AHCI_P_CMD + offset) & ATA_AHCI_P_CMD_CR); +} + +static void +ata_ahci_clo(device_t dev) +{ + struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); + struct ata_channel *ch = device_get_softc(dev); + u_int32_t cmd; + int offset = ch->unit << 7; + int timeout; /* issue Command List Override if supported */ if (ATA_INL(ctlr->r_res2, ATA_AHCI_CAP) & ATA_AHCI_CAP_CLO) { @@ -556,6 +571,15 @@ ata_ahci_restart(device_t dev) } while (ATA_INL(ctlr->r_res2, ATA_AHCI_P_CMD+offset)&ATA_AHCI_P_CMD_CLO); } +} + +static void +ata_ahci_start(device_t dev) +{ + struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); + struct ata_channel *ch = device_get_softc(dev); + u_int32_t cmd; + int offset = ch->unit << 7; /* clear SATA error register */ ATA_IDX_OUTL(ch, ATA_SERROR, ATA_IDX_INL(ch, ATA_SERROR)); @@ -571,19 +595,39 @@ ata_ahci_restart(device_t dev) (ch->devices & ATA_PORTMULTIPLIER ? ATA_AHCI_P_CMD_PMA : 0)); } +static void +ata_ahci_wait_ready(device_t dev) +{ + struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); + struct ata_channel *ch = device_get_softc(dev); + int offset = ch->unit << 7; + int timeout = 0; + + while (ATA_INL(ctlr->r_res2, ATA_AHCI_P_TFD + offset) & + (ATA_S_BUSY | ATA_S_DRQ)) { + DELAY(1000); + if (timeout++ > 1000) { + device_printf(dev, "port is not ready\n"); + break; + } + } + if (bootverbose) + device_printf(dev, "ready wait time=%dms\n", timeout); +} + static u_int32_t ata_ahci_softreset(device_t dev, int port) { struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); struct ata_channel *ch = device_get_softc(dev); int offset = ch->unit << 7; - int timeout = 0; -#ifdef AHCI_PM struct ata_ahci_cmd_tab *ctp = (struct ata_ahci_cmd_tab *)(ch->dma.work + ATA_AHCI_CT_OFFSET); - /* kick controller into sane state if needed */ - ata_ahci_restart(dev); + /* kick controller into sane state */ + ata_ahci_stop(dev); + ata_ahci_clo(dev); + ata_ahci_start(dev); /* pull reset active */ bzero(ctp->cfis, 64); @@ -607,18 +651,7 @@ ata_ahci_softreset(device_t dev, int por if (ata_ahci_issue_cmd(dev, 0, 0)) return -1; - ata_udelay(150000); - -#endif - do { - DELAY(1000); - if (timeout++ > 1000) { - device_printf(dev, "still BUSY after softreset\n"); - break; - } - } while (ATA_INL(ctlr->r_res2, ATA_AHCI_P_TFD + offset) & ATA_S_BUSY); - if (bootverbose) - device_printf(dev, "BUSY wait time=%dms\n", timeout); + ata_ahci_wait_ready(dev); return ATA_INL(ctlr->r_res2, ATA_AHCI_P_SIG + offset); } @@ -629,7 +662,7 @@ ata_ahci_reset(device_t dev) struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); struct ata_channel *ch = device_get_softc(dev); u_int64_t work; - u_int32_t cmd, signature; + u_int32_t signature; int offset = ch->unit << 7; if (!(ATA_INL(ctlr->r_res2, ATA_AHCI_PI) & (1 << ch->unit))) { @@ -646,19 +679,11 @@ ata_ahci_reset(device_t dev) ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_FB + offset, work & 0xffffffff); ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_FBU + offset, work >> 32); - /* enable wanted port interrupts */ - ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_IE + offset, - (ATA_AHCI_P_IX_CPD | ATA_AHCI_P_IX_TFE | ATA_AHCI_P_IX_HBF | - ATA_AHCI_P_IX_HBD | ATA_AHCI_P_IX_IF | ATA_AHCI_P_IX_OF | - ATA_AHCI_P_IX_PRC | ATA_AHCI_P_IX_PC | ATA_AHCI_P_IX_DP | - ATA_AHCI_P_IX_UF | ATA_AHCI_P_IX_SDB | ATA_AHCI_P_IX_DS | - ATA_AHCI_P_IX_PS | ATA_AHCI_P_IX_DHR)); - /* activate the channel and power/spin up device */ ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_CMD + offset, (ATA_AHCI_P_CMD_ACTIVE | ATA_AHCI_P_CMD_POD | ATA_AHCI_P_CMD_SUD)); - ata_ahci_restart(dev); + ata_ahci_stop(dev); /* enable FIS based switching */ //ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_FBS + offset, 0x00000003); @@ -668,13 +693,25 @@ ata_ahci_reset(device_t dev) device_printf(dev, "phy reset found no device\n"); ch->devices = 0; - /* kill off all activity on this channel */ - cmd = ATA_INL(ctlr->r_res2, ATA_AHCI_P_CMD + offset); - ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_CMD + offset, - cmd & ~(ATA_AHCI_P_CMD_FRE | ATA_AHCI_P_CMD_ST)); + /* enable wanted port interrupts */ + ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_IE + offset, + (ATA_AHCI_P_IX_CPD | ATA_AHCI_P_IX_PRC | ATA_AHCI_P_IX_PC)); return; } + ata_ahci_start(dev); + + /* enable wanted port interrupts */ + ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_IE + offset, + (ATA_AHCI_P_IX_CPD | ATA_AHCI_P_IX_TFE | ATA_AHCI_P_IX_HBF | + ATA_AHCI_P_IX_HBD | ATA_AHCI_P_IX_IF | ATA_AHCI_P_IX_OF | + ATA_AHCI_P_IX_PRC | ATA_AHCI_P_IX_PC | ATA_AHCI_P_IX_DP | + ATA_AHCI_P_IX_UF | ATA_AHCI_P_IX_SDB | ATA_AHCI_P_IX_DS | + ATA_AHCI_P_IX_PS | ATA_AHCI_P_IX_DHR)); + + /* Wait for initial TFD from device. */ + ata_ahci_wait_ready(dev); + /* only probe for PortMultiplier if HW has support */ if (ATA_INL(ctlr->r_res2, ATA_AHCI_CAP) & ATA_AHCI_CAP_SPM) signature = ata_ahci_softreset(dev, ATA_PM); From owner-svn-src-head@FreeBSD.ORG Sat Feb 14 23:17:28 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B5DC1065673; Sat, 14 Feb 2009 23:17:28 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from ebb.errno.com (ebb.errno.com [69.12.149.25]) by mx1.freebsd.org (Postfix) with ESMTP id 0F6038FC0C; Sat, 14 Feb 2009 23:17:27 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from trouble.errno.com (trouble.errno.com [10.0.0.248]) (authenticated bits=0) by ebb.errno.com (8.13.6/8.12.6) with ESMTP id n1ENHR03059433 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 14 Feb 2009 15:17:27 -0800 (PST) (envelope-from sam@freebsd.org) Message-ID: <49975107.1070803@freebsd.org> Date: Sat, 14 Feb 2009 15:17:27 -0800 From: Sam Leffler Organization: FreeBSD Project User-Agent: Thunderbird 2.0.0.18 (X11/20081209) MIME-Version: 1.0 To: Alexander Motin References: <200902142302.n1EN2xp0032837@svn.freebsd.org> In-Reply-To: <200902142302.n1EN2xp0032837@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-DCC--Metrics: ebb.errno.com; whitelist Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r188621 - head/sys/dev/ata/chipsets X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Feb 2009 23:17:28 -0000 Alexander Motin wrote: > Author: mav > Date: Sat Feb 14 23:02:59 2009 > New Revision: 188621 > URL: http://svn.freebsd.org/changeset/base/188621 > > Log: > Tunes to AHCI reset sequences: > - specification claims that 1 second is just a maximum controller reset time; > implement controller reset properly to save almost 1 second of boot, and > about half second of resume time; > - enable channel interrupts only after channel status reset to fix duplicate > device creation on resume due to unwanted device connection event; > - as described in specification, wait for disk ready status after channel > power-up; it is not so important when disk already touched by BIOS, but > solves device not ready problems on resume and probably some other cases. > - uncomment channel stop/start on soft-reset as it is declared mandatory by > specification; it was commented due to some random drive detection problems > on VIA and JMicron controllers, but I hope it is fixed by previous point. > > These sounds like unrelated changes. Given the fragility of ata interop you should do these as separate commits in case folks need to bisect changes on breakage. Sam From owner-svn-src-head@FreeBSD.ORG Sat Feb 14 23:20:01 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4468E106564A; Sat, 14 Feb 2009 23:20:01 +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 301BA8FC1C; Sat, 14 Feb 2009 23:20:01 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1ENK0ct033178; Sat, 14 Feb 2009 23:20:00 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1ENK0DL033165; Sat, 14 Feb 2009 23:20:00 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200902142320.n1ENK0DL033165@svn.freebsd.org> From: Andrew Thompson Date: Sat, 14 Feb 2009 23:20:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188622 - in head: lib/libusb20 sys/dev/usb2/core sys/dev/usb2/include usr.sbin/usbconfig X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Feb 2009 23:20:01 -0000 Author: thompsa Date: Sat Feb 14 23:20:00 2009 New Revision: 188622 URL: http://svn.freebsd.org/changeset/base/188622 Log: MFp4 //depot/projects/usb@157699 Add two new functions to the libusb20 API and required kernel ioctls. - libusb20_dev_get_iface_desc - libusb20_dev_get_info New command to usbconfig, "show_ifdrv", which will print out the kernel driver attached to the given USB device aswell. See "man libusb20" for a detailed description. Some minor style corrections long-line wrapping. Submitted by: Hans Petter Selasky Modified: head/lib/libusb20/libusb20.3 head/lib/libusb20/libusb20.c head/lib/libusb20/libusb20.h head/lib/libusb20/libusb20_int.h head/lib/libusb20/libusb20_ugen20.c head/sys/dev/usb2/core/usb2_generic.c head/sys/dev/usb2/include/usb2_ioctl.h head/usr.sbin/usbconfig/dump.c head/usr.sbin/usbconfig/dump.h head/usr.sbin/usbconfig/usbconfig.c Modified: head/lib/libusb20/libusb20.3 ============================================================================== --- head/lib/libusb20/libusb20.3 Sat Feb 14 23:02:59 2009 (r188621) +++ head/lib/libusb20/libusb20.3 Sat Feb 14 23:20:00 2009 (r188622) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd Oct 23, 2008 +.Dd Feb 14, 2009 .Dt LIBUSB20 3 .Os .Sh NAME @@ -308,8 +308,32 @@ This function returns a zero terminated . .Pp . +.Fn libusb20_dev_get_info pdev pinfo +This function retrives the BSD specific usb2_device_info structure into the memory location given by +.Fa pinfo . +The USB device given by +.Fa pdev +must be opened before this function will succeed. +This function returns zero on success else a LIBUSB20_ERROR value is returned. +. +.Pp +. +.Fn libusb20_dev_get_iface_desc pdev iface_index pbuf len +This function retrieves the kernel interface description for the given USB +.Fa iface_index . +The format of the USB interface description is: "drivername: " +The description string is always zero terminated. +A zero length string is written in case no driver is attached to the given interface. +The USB device given by +.Fa pdev +must be opened before this function will succeed. +This function returns zero on success else a LIBUSB20_ERROR value is returned. +. +.Pp +. .Fn libusb20_dev_get_desc pdev This function returns a zero terminated string describing the given USB device. +The format of the string is: "drivername: " . .Pp . Modified: head/lib/libusb20/libusb20.c ============================================================================== --- head/lib/libusb20/libusb20.c Sat Feb 14 23:02:59 2009 (r188621) +++ head/lib/libusb20/libusb20.c Sat Feb 14 23:20:00 2009 (r188622) @@ -78,6 +78,8 @@ dummy_callback(struct libusb20_transfer #define dummy_tr_close (void *)dummy_int #define dummy_tr_clear_stall_sync (void *)dummy_int #define dummy_process (void *)dummy_int +#define dummy_dev_info (void *)dummy_int +#define dummy_dev_get_iface_driver (void *)dummy_int #define dummy_tr_submit (void *)dummy_void #define dummy_tr_cancel_async (void *)dummy_void @@ -99,7 +101,7 @@ repeat: xfer->is_pending = 0; } - (xfer->callback) (xfer); + xfer->callback(xfer); if (xfer->is_restart) { xfer->is_restart = 0; @@ -109,7 +111,7 @@ repeat: (!xfer->is_pending)) { xfer->is_draining = 0; xfer->status = LIBUSB20_TRANSFER_DRAINED; - (xfer->callback) (xfer); + xfer->callback(xfer); } return; } @@ -122,7 +124,7 @@ libusb20_tr_close(struct libusb20_transf if (!xfer->is_opened) { return (LIBUSB20_ERROR_OTHER); } - error = (xfer->pdev->methods->tr_close) (xfer); + error = xfer->pdev->methods->tr_close(xfer); if (xfer->pLength) { free(xfer->pLength); @@ -168,7 +170,7 @@ libusb20_tr_open(struct libusb20_transfe } memset(xfer->ppBuffer, 0, size); - error = (xfer->pdev->methods->tr_open) (xfer, MaxBufSize, + error = xfer->pdev->methods->tr_open(xfer, MaxBufSize, MaxFrameCount, ep_no); if (error) { @@ -273,7 +275,7 @@ libusb20_tr_stop(struct libusb20_transfe } xfer->is_cancel = 1; /* we are cancelling */ - (xfer->pdev->methods->tr_cancel_async) (xfer); + xfer->pdev->methods->tr_cancel_async(xfer); return; } @@ -292,7 +294,7 @@ libusb20_tr_drain(struct libusb20_transf void libusb20_tr_clear_stall_sync(struct libusb20_transfer *xfer) { - (xfer->pdev->methods->tr_clear_stall_sync) (xfer); + xfer->pdev->methods->tr_clear_stall_sync(xfer); return; } @@ -420,7 +422,7 @@ libusb20_tr_submit(struct libusb20_trans xfer->is_cancel = 0; /* not cancelling */ xfer->is_restart = 0; /* not restarting */ - (xfer->pdev->methods->tr_submit) (xfer); + xfer->pdev->methods->tr_submit(xfer); return; } @@ -452,7 +454,7 @@ libusb20_dev_claim_interface(struct libu } else if (pdev->claimed_interfaces & (1 << ifaceIndex)) { error = LIBUSB20_ERROR_NOT_FOUND; } else { - error = (pdev->methods->claim_interface) (pdev, ifaceIndex); + error = pdev->methods->claim_interface(pdev, ifaceIndex); } if (!error) { pdev->claimed_interfaces |= (1 << ifaceIndex); @@ -480,7 +482,7 @@ libusb20_dev_close(struct libusb20_devic free(pdev->pTransfer); pdev->pTransfer = NULL; } - error = (pdev->beMethods->close_device) (pdev); + error = pdev->beMethods->close_device(pdev); pdev->methods = &libusb20_dummy_methods; @@ -496,7 +498,7 @@ libusb20_dev_detach_kernel_driver(struct { int error; - error = (pdev->methods->detach_kernel_driver) (pdev, ifaceIndex); + error = pdev->methods->detach_kernel_driver(pdev, ifaceIndex); return (error); } @@ -517,7 +519,7 @@ libusb20_dev_kernel_driver_active(struct { int error; - error = (pdev->methods->kernel_driver_active) (pdev, ifaceIndex); + error = pdev->methods->kernel_driver_active(pdev, ifaceIndex); return (error); } @@ -555,7 +557,7 @@ libusb20_dev_open(struct libusb20_device /* set "nTransfer" early */ pdev->nTransfer = nTransferMax; - error = (pdev->beMethods->open_device) (pdev, nTransferMax); + error = pdev->beMethods->open_device(pdev, nTransferMax); if (error) { if (pdev->pTransfer != NULL) { @@ -581,7 +583,7 @@ libusb20_dev_release_interface(struct li } else if (!(pdev->claimed_interfaces & (1 << ifaceIndex))) { error = LIBUSB20_ERROR_NOT_FOUND; } else { - error = (pdev->methods->release_interface) (pdev, ifaceIndex); + error = pdev->methods->release_interface(pdev, ifaceIndex); } if (!error) { pdev->claimed_interfaces &= ~(1 << ifaceIndex); @@ -594,7 +596,7 @@ libusb20_dev_reset(struct libusb20_devic { int error; - error = (pdev->methods->reset_device) (pdev); + error = pdev->methods->reset_device(pdev); return (error); } @@ -603,7 +605,7 @@ libusb20_dev_set_power_mode(struct libus { int error; - error = (pdev->methods->set_power_mode) (pdev, power_mode); + error = pdev->methods->set_power_mode(pdev, power_mode); return (error); } @@ -613,7 +615,7 @@ libusb20_dev_get_power_mode(struct libus int error; uint8_t power_mode; - error = (pdev->methods->get_power_mode) (pdev, &power_mode); + error = pdev->methods->get_power_mode(pdev, &power_mode); if (error) power_mode = LIBUSB20_POWER_ON; /* fake power mode */ return (power_mode); @@ -624,7 +626,7 @@ libusb20_dev_set_alt_index(struct libusb { int error; - error = (pdev->methods->set_alt_index) (pdev, ifaceIndex, altIndex); + error = pdev->methods->set_alt_index(pdev, ifaceIndex, altIndex); return (error); } @@ -633,7 +635,7 @@ libusb20_dev_set_config_index(struct lib { int error; - error = (pdev->methods->set_config_index) (pdev, configIndex); + error = pdev->methods->set_config_index(pdev, configIndex); return (error); } @@ -644,7 +646,7 @@ libusb20_dev_request_sync(struct libusb2 { int error; - error = (pdev->methods->do_request_sync) (pdev, + error = pdev->methods->do_request_sync(pdev, setup, data, pactlen, timeout, flags); return (error); } @@ -799,7 +801,7 @@ libusb20_dev_alloc_config(struct libusb2 } else { do_close = 0; } - error = (pdev->methods->get_config_desc_full) (pdev, + error = pdev->methods->get_config_desc_full(pdev, &ptr, &len, configIndex); if (error) { @@ -853,7 +855,7 @@ libusb20_dev_get_config_index(struct lib do_close = 0; } - error = (pdev->methods->get_config_index) (pdev, &cfg_index); + error = pdev->methods->get_config_index(pdev, &cfg_index); if (error) { cfg_index = 0 - 1; /* current config index */ } @@ -883,7 +885,7 @@ libusb20_dev_process(struct libusb20_dev { int error; - error = (pdev->methods->process) (pdev); + error = pdev->methods->process(pdev); return (error); } @@ -921,10 +923,20 @@ libusb20_dev_free(struct libusb20_device return; } +int +libusb20_dev_get_info(struct libusb20_device *pdev, + struct usb2_device_info *pinfo) +{ + if (pinfo == NULL) + return (LIBUSB20_ERROR_INVALID_PARAM); + + return (pdev->beMethods->dev_get_info(pdev, pinfo)); +} + const char * libusb20_dev_get_backend_name(struct libusb20_device *pdev) { - return ((pdev->beMethods->get_backend_name) ()); + return (pdev->beMethods->get_backend_name()); } const char * @@ -961,25 +973,29 @@ libusb20_dev_get_bus_number(struct libus int libusb20_dev_set_owner(struct libusb20_device *pdev, uid_t user, gid_t group) { - return ((pdev->beMethods->dev_set_owner) (pdev, user, group)); + return (pdev->beMethods->dev_set_owner(pdev, user, group)); } int libusb20_dev_set_perm(struct libusb20_device *pdev, mode_t mode) { - return ((pdev->beMethods->dev_set_perm) (pdev, mode)); + return (pdev->beMethods->dev_set_perm(pdev, mode)); } int -libusb20_dev_set_iface_owner(struct libusb20_device *pdev, uint8_t iface_index, uid_t user, gid_t group) +libusb20_dev_set_iface_owner(struct libusb20_device *pdev, + uint8_t iface_index, uid_t user, gid_t group) { - return ((pdev->beMethods->dev_set_iface_owner) (pdev, iface_index, user, group)); + return (pdev->beMethods->dev_set_iface_owner( + pdev, iface_index, user, group)); } int -libusb20_dev_set_iface_perm(struct libusb20_device *pdev, uint8_t iface_index, mode_t mode) +libusb20_dev_set_iface_perm(struct libusb20_device *pdev, + uint8_t iface_index, mode_t mode) { - return ((pdev->beMethods->dev_set_iface_perm) (pdev, iface_index, mode)); + return (pdev->beMethods->dev_set_iface_perm( + pdev, iface_index, mode)); } int @@ -993,7 +1009,7 @@ libusb20_dev_get_owner(struct libusb20_d if (group == NULL) group = &b; - return ((pdev->beMethods->dev_get_owner) (pdev, user, group)); + return (pdev->beMethods->dev_get_owner(pdev, user, group)); } int @@ -1003,11 +1019,12 @@ libusb20_dev_get_perm(struct libusb20_de if (mode == NULL) mode = &a; - return ((pdev->beMethods->dev_get_perm) (pdev, mode)); + return (pdev->beMethods->dev_get_perm(pdev, mode)); } int -libusb20_dev_get_iface_owner(struct libusb20_device *pdev, uint8_t iface_index, uid_t *user, gid_t *group) +libusb20_dev_get_iface_owner(struct libusb20_device *pdev, + uint8_t iface_index, uid_t *user, gid_t *group) { uid_t a; gid_t b; @@ -1017,35 +1034,51 @@ libusb20_dev_get_iface_owner(struct libu if (group == NULL) group = &b; - return ((pdev->beMethods->dev_get_iface_owner) (pdev, iface_index, user, group)); + return (pdev->beMethods->dev_get_iface_owner( + pdev, iface_index, user, group)); } int -libusb20_dev_get_iface_perm(struct libusb20_device *pdev, uint8_t iface_index, mode_t *mode) +libusb20_dev_get_iface_perm(struct libusb20_device *pdev, + uint8_t iface_index, mode_t *mode) { mode_t a; if (mode == NULL) mode = &a; - return ((pdev->beMethods->dev_get_iface_perm) (pdev, iface_index, mode)); + return (pdev->beMethods->dev_get_iface_perm( + pdev, iface_index, mode)); +} + +int +libusb20_dev_get_iface_desc(struct libusb20_device *pdev, + uint8_t iface_index, char *buf, uint8_t len) +{ + if ((buf == NULL) || (len == 0)) + return (LIBUSB20_ERROR_INVALID_PARAM); + + return (pdev->beMethods->dev_get_iface_desc( + pdev, iface_index, buf, len)); } /* USB bus operations */ int -libusb20_bus_set_owner(struct libusb20_backend *pbe, uint8_t bus, uid_t user, gid_t group) +libusb20_bus_set_owner(struct libusb20_backend *pbe, + uint8_t bus, uid_t user, gid_t group) { - return ((pbe->methods->bus_set_owner) (pbe, bus, user, group)); + return (pbe->methods->bus_set_owner(pbe, bus, user, group)); } int libusb20_bus_set_perm(struct libusb20_backend *pbe, uint8_t bus, mode_t mode) { - return ((pbe->methods->bus_set_perm) (pbe, bus, mode)); + return (pbe->methods->bus_set_perm(pbe, bus, mode)); } int -libusb20_bus_get_owner(struct libusb20_backend *pbe, uint8_t bus, uid_t *user, gid_t *group) +libusb20_bus_get_owner(struct libusb20_backend *pbe, + uint8_t bus, uid_t *user, gid_t *group) { uid_t a; gid_t b; @@ -1054,7 +1087,7 @@ libusb20_bus_get_owner(struct libusb20_b user = &a; if (group == NULL) group = &b; - return ((pbe->methods->bus_get_owner) (pbe, bus, user, group)); + return (pbe->methods->bus_get_owner(pbe, bus, user, group)); } int @@ -1064,7 +1097,7 @@ libusb20_bus_get_perm(struct libusb20_ba if (mode == NULL) mode = &a; - return ((pbe->methods->bus_get_perm) (pbe, bus, mode)); + return (pbe->methods->bus_get_perm(pbe, bus, mode)); } /* USB backend operations */ @@ -1073,40 +1106,40 @@ int libusb20_be_get_dev_quirk(struct libusb20_backend *pbe, uint16_t quirk_index, struct libusb20_quirk *pq) { - return ((pbe->methods->root_get_dev_quirk) (pbe, quirk_index, pq)); + return (pbe->methods->root_get_dev_quirk(pbe, quirk_index, pq)); } int libusb20_be_get_quirk_name(struct libusb20_backend *pbe, uint16_t quirk_index, struct libusb20_quirk *pq) { - return ((pbe->methods->root_get_quirk_name) (pbe, quirk_index, pq)); + return (pbe->methods->root_get_quirk_name(pbe, quirk_index, pq)); } int libusb20_be_add_dev_quirk(struct libusb20_backend *pbe, struct libusb20_quirk *pq) { - return ((pbe->methods->root_add_dev_quirk) (pbe, pq)); + return (pbe->methods->root_add_dev_quirk(pbe, pq)); } int libusb20_be_remove_dev_quirk(struct libusb20_backend *pbe, struct libusb20_quirk *pq) { - return ((pbe->methods->root_remove_dev_quirk) (pbe, pq)); + return (pbe->methods->root_remove_dev_quirk(pbe, pq)); } int libusb20_be_set_owner(struct libusb20_backend *pbe, uid_t user, gid_t group) { - return ((pbe->methods->root_set_owner) (pbe, user, group)); + return (pbe->methods->root_set_owner(pbe, user, group)); } int libusb20_be_set_perm(struct libusb20_backend *pbe, mode_t mode) { - return ((pbe->methods->root_set_perm) (pbe, mode)); + return (pbe->methods->root_set_perm(pbe, mode)); } int @@ -1119,7 +1152,7 @@ libusb20_be_get_owner(struct libusb20_ba user = &a; if (group == NULL) group = &b; - return ((pbe->methods->root_get_owner) (pbe, user, group)); + return (pbe->methods->root_get_owner(pbe, user, group)); } int @@ -1129,7 +1162,7 @@ libusb20_be_get_perm(struct libusb20_bac if (mode == NULL) mode = &a; - return ((pbe->methods->root_get_perm) (pbe, mode)); + return (pbe->methods->root_get_perm(pbe, mode)); } struct libusb20_device * @@ -1162,7 +1195,7 @@ libusb20_be_alloc(const struct libusb20_ /* do the initial device scan */ if (pbe->methods->init_backend) { - (pbe->methods->init_backend) (pbe); + pbe->methods->init_backend(pbe); } return (pbe); } @@ -1223,7 +1256,7 @@ libusb20_be_free(struct libusb20_backend libusb20_dev_free(pdev); } if (pbe->methods->exit_backend) { - (pbe->methods->exit_backend) (pbe); + pbe->methods->exit_backend(pbe); } return; } Modified: head/lib/libusb20/libusb20.h ============================================================================== --- head/lib/libusb20/libusb20.h Sat Feb 14 23:02:59 2009 (r188621) +++ head/lib/libusb20/libusb20.h Sat Feb 14 23:20:00 2009 (r188622) @@ -175,6 +175,7 @@ enum { LIBUSB20_POWER_RESUME, }; +struct usb2_device_info; struct libusb20_transfer; struct libusb20_backend; struct libusb20_backend_methods; @@ -260,6 +261,8 @@ int libusb20_dev_get_owner(struct libusb int libusb20_dev_get_perm(struct libusb20_device *pdev, mode_t *mode); int libusb20_dev_get_iface_owner(struct libusb20_device *pdev, uint8_t iface_index, uid_t *user, gid_t *group); int libusb20_dev_get_iface_perm(struct libusb20_device *pdev, uint8_t iface_index, mode_t *mode); +int libusb20_dev_get_info(struct libusb20_device *pdev, struct usb2_device_info *pinfo); +int libusb20_dev_get_iface_desc(struct libusb20_device *pdev, uint8_t iface_index, char *buf, uint8_t len); struct LIBUSB20_DEVICE_DESC_DECODED *libusb20_dev_get_device_desc(struct libusb20_device *pdev); struct libusb20_config *libusb20_dev_alloc_config(struct libusb20_device *pdev, uint8_t config_index); Modified: head/lib/libusb20/libusb20_int.h ============================================================================== --- head/lib/libusb20/libusb20_int.h Sat Feb 14 23:02:59 2009 (r188621) +++ head/lib/libusb20/libusb20_int.h Sat Feb 14 23:20:00 2009 (r188622) @@ -57,6 +57,8 @@ typedef int (libusb20_dev_get_iface_owne typedef int (libusb20_dev_get_iface_perm_t)(struct libusb20_device *pdev, uint8_t iface_index, mode_t *mode); typedef int (libusb20_dev_get_owner_t)(struct libusb20_device *pdev, uid_t *user, gid_t *group); typedef int (libusb20_dev_get_perm_t)(struct libusb20_device *pdev, mode_t *mode); +typedef int (libusb20_dev_get_info_t)(struct libusb20_device *pdev, struct usb2_device_info *pinfo); +typedef int (libusb20_dev_get_iface_desc_t)(struct libusb20_device *pdev, uint8_t iface_index, char *buf, uint8_t len); typedef int (libusb20_dev_set_iface_owner_t)(struct libusb20_device *pdev, uint8_t iface_index, uid_t user, gid_t group); typedef int (libusb20_dev_set_iface_perm_t)(struct libusb20_device *pdev, uint8_t iface_index, mode_t mode); typedef int (libusb20_dev_set_owner_t)(struct libusb20_device *pdev, uid_t user, gid_t group); @@ -85,8 +87,10 @@ typedef void (libusb20_exit_backend_t)(s m(n, bus_get_owner) \ m(n, bus_set_perm) \ m(n, bus_get_perm) \ + m(n, dev_get_info) \ m(n, dev_get_iface_owner) \ m(n, dev_get_iface_perm) \ + m(n, dev_get_iface_desc) \ m(n, dev_get_owner) \ m(n, dev_get_perm) \ m(n, dev_set_iface_owner) \ Modified: head/lib/libusb20/libusb20_ugen20.c ============================================================================== --- head/lib/libusb20/libusb20_ugen20.c Sat Feb 14 23:02:59 2009 (r188621) +++ head/lib/libusb20/libusb20_ugen20.c Sat Feb 14 23:20:00 2009 (r188622) @@ -58,6 +58,8 @@ static libusb20_dev_get_iface_owner_t ug static libusb20_dev_get_iface_perm_t ugen20_dev_get_iface_perm; static libusb20_dev_get_owner_t ugen20_dev_get_owner; static libusb20_dev_get_perm_t ugen20_dev_get_perm; +static libusb20_dev_get_iface_desc_t ugen20_dev_get_iface_desc; +static libusb20_dev_get_info_t ugen20_dev_get_info; static libusb20_dev_set_iface_owner_t ugen20_dev_set_iface_owner; static libusb20_dev_set_iface_perm_t ugen20_dev_set_iface_perm; static libusb20_dev_set_owner_t ugen20_dev_set_owner; @@ -954,6 +956,34 @@ ugen20_bus_get_perm(struct libusb20_back } static int +ugen20_dev_get_iface_desc(struct libusb20_device *pdev, + uint8_t iface_index, char *buf, uint8_t len) +{ + struct usb2_gen_descriptor ugd; + + memset(&ugd, 0, sizeof(ugd)); + + ugd.ugd_data = buf; + ugd.ugd_maxlen = len; + ugd.ugd_iface_index = iface_index; + + if (ioctl(pdev->file, USB_GET_IFACE_DRIVER, &ugd)) { + return (LIBUSB20_ERROR_INVALID_PARAM); + } + return (0); +} + +static int +ugen20_dev_get_info(struct libusb20_device *pdev, + struct usb2_device_info *pinfo) +{ + if (ioctl(pdev->file, USB_GET_DEVICEINFO, pinfo)) { + return (LIBUSB20_ERROR_INVALID_PARAM); + } + return (0); +} + +static int ugen20_dev_get_iface_owner(struct libusb20_device *pdev, uint8_t iface_index, uid_t *user, gid_t *group) { Modified: head/sys/dev/usb2/core/usb2_generic.c ============================================================================== --- head/sys/dev/usb2/core/usb2_generic.c Sat Feb 14 23:02:59 2009 (r188621) +++ head/sys/dev/usb2/core/usb2_generic.c Sat Feb 14 23:20:00 2009 (r188622) @@ -80,6 +80,7 @@ static int ugen_set_config(struct usb2_f static int ugen_set_interface(struct usb2_fifo *, uint8_t, uint8_t); static int ugen_get_cdesc(struct usb2_fifo *, struct usb2_gen_descriptor *); static int ugen_get_sdesc(struct usb2_fifo *, struct usb2_gen_descriptor *); +static int ugen_get_iface_driver(struct usb2_fifo *f, struct usb2_gen_descriptor *ugd); static int usb2_gen_fill_deviceinfo(struct usb2_fifo *, struct usb2_device_info *); static int ugen_re_enumerate(struct usb2_fifo *); @@ -714,68 +715,64 @@ ugen_get_sdesc(struct usb2_fifo *f, stru } /*------------------------------------------------------------------------* - * usb2_gen_fill_devicenames + * ugen_get_iface_driver * - * This function dumps information about an USB device names to - * userland. + * This function generates an USB interface description for userland. * * Returns: * 0: Success * Else: Failure *------------------------------------------------------------------------*/ static int -usb2_gen_fill_devicenames(struct usb2_fifo *f, struct usb2_device_names *dn) +ugen_get_iface_driver(struct usb2_fifo *f, struct usb2_gen_descriptor *ugd) { + struct usb2_device *udev = f->udev; struct usb2_interface *iface; const char *ptr; - char *dst; - char buf[32]; - int error = 0; - int len; - int max_len; - uint8_t i; - uint8_t first = 1; + const char *desc; + unsigned int len; + unsigned int maxlen; + char buf[128]; + int error; - max_len = dn->udn_devnames_len; - dst = dn->udn_devnames_ptr; + DPRINTFN(6, "\n"); - if (max_len == 0) { + if ((ugd->ugd_data == NULL) || (ugd->ugd_maxlen == 0)) { + /* userland pointer should not be zero */ return (EINVAL); } - /* put a zero there */ - error = copyout("", dst, 1); - if (error) { - return (error); + + iface = usb2_get_iface(udev, ugd->ugd_iface_index); + if ((iface == NULL) || (iface->idesc == NULL)) { + /* invalid interface index */ + return (EINVAL); } - for (i = 0;; i++) { - iface = usb2_get_iface(f->udev, i); - if (iface == NULL) { - break; - } - if ((iface->subdev != NULL) && - device_is_attached(iface->subdev)) { - ptr = device_get_nameunit(iface->subdev); - if (!first) { - strlcpy(buf, ", ", sizeof(buf)); - } else { - buf[0] = 0; - } - strlcat(buf, ptr, sizeof(buf)); - len = strlen(buf) + 1; - if (len > max_len) { - break; - } - error = copyout(buf, dst, len); - if (error) { - return (error); - } - len--; - dst += len; - max_len -= len; - first = 0; - } + + /* read out device nameunit string, if any */ + if ((iface->subdev != NULL) && + device_is_attached(iface->subdev) && + (ptr = device_get_nameunit(iface->subdev)) && + (desc = device_get_desc(iface->subdev))) { + + /* print description */ + snprintf(buf, sizeof(buf), "%s: <%s>", ptr, desc); + + /* range checks */ + maxlen = ugd->ugd_maxlen - 1; + len = strlen(buf); + if (len > maxlen) + len = maxlen; + + /* update actual length, including terminating zero */ + ugd->ugd_actlen = len + 1; + + /* copy out interface description */ + error = copyout(buf, ugd->ugd_data, ugd->ugd_actlen); + } else { + /* zero length string is default */ + error = copyout("", ugd->ugd_data, 1); } - return (0); + return (error); } /*------------------------------------------------------------------------* @@ -2046,6 +2043,10 @@ ugen_ioctl_post(struct usb2_fifo *f, u_l error = ugen_get_sdesc(f, addr); break; + case USB_GET_IFACE_DRIVER: + error = ugen_get_iface_driver(f, addr); + break; + case USB_REQUEST: case USB_DO_REQUEST: if (!(fflags & FWRITE)) { @@ -2060,10 +2061,6 @@ ugen_ioctl_post(struct usb2_fifo *f, u_l error = usb2_gen_fill_deviceinfo(f, addr); break; - case USB_GET_DEVICENAMES: - error = usb2_gen_fill_devicenames(f, addr); - break; - case USB_DEVICESTATS: for (n = 0; n != 4; n++) { Modified: head/sys/dev/usb2/include/usb2_ioctl.h ============================================================================== --- head/sys/dev/usb2/include/usb2_ioctl.h Sat Feb 14 23:02:59 2009 (r188621) +++ head/sys/dev/usb2/include/usb2_ioctl.h Sat Feb 14 23:20:00 2009 (r188622) @@ -77,13 +77,6 @@ struct usb2_gen_descriptor { uint8_t reserved[8]; }; -struct usb2_device_names { - char *udn_devnames_ptr; /* userland pointer to comma separated - * list of device names */ - uint16_t udn_devnames_len; /* maximum string length including - * terminating zero */ -}; - struct usb2_device_info { uint16_t udi_productNo; uint16_t udi_vendorNo; @@ -249,7 +242,7 @@ struct usb2_gen_quirk { #define USB_SET_RX_BUFFER_SIZE _IOW ('U', 118, int) #define USB_SET_RX_STALL_FLAG _IOW ('U', 119, int) #define USB_SET_TX_STALL_FLAG _IOW ('U', 120, int) -#define USB_GET_DEVICENAMES _IOW ('U', 121, struct usb2_device_names) +#define USB_GET_IFACE_DRIVER _IOWR('U', 121, struct usb2_gen_descriptor) #define USB_CLAIM_INTERFACE _IOW ('U', 122, int) #define USB_RELEASE_INTERFACE _IOW ('U', 123, int) #define USB_IFACE_DRIVER_ACTIVE _IOW ('U', 124, int) Modified: head/usr.sbin/usbconfig/dump.c ============================================================================== --- head/usr.sbin/usbconfig/dump.c Sat Feb 14 23:02:59 2009 (r188621) +++ head/usr.sbin/usbconfig/dump.c Sat Feb 14 23:20:00 2009 (r188622) @@ -176,15 +176,30 @@ dump_iface(struct libusb20_device *pdev, } void -dump_device_info(struct libusb20_device *pdev) +dump_device_info(struct libusb20_device *pdev, uint8_t show_ifdrv) { + char buf[128]; + uint8_t n; + printf("%s, cfg=%u md=%s spd=%s pwr=%s\n", libusb20_dev_get_desc(pdev), libusb20_dev_get_config_index(pdev), dump_mode(libusb20_dev_get_mode(pdev)), dump_speed(libusb20_dev_get_speed(pdev)), dump_power_mode(libusb20_dev_get_power_mode(pdev))); - return; + + if (!show_ifdrv) + return; + + for (n = 0; n != 255; n++) { + if (libusb20_dev_get_iface_desc(pdev, n, buf, sizeof(buf))) + break; + if (buf[0] == 0) + continue; + printf("ugen%u.%u.%u: %s\n", + libusb20_dev_get_bus_number(pdev), + libusb20_dev_get_address(pdev), n, buf); + } } void @@ -339,7 +354,8 @@ dump_device_iface_access(struct libusb20 owner = (pw = getpwuid(uid)) ? pw->pw_name : "UNKNOWN"; group = (gr = getgrgid(gid)) ? gr->gr_name : "UNKNOWN"; - printf(" " "Interface %u Access: %s:%s 0%o\n", iface, owner, group, mode); + printf(" " "Interface %u Access: %s:%s 0%o\n", + iface, owner, group, mode); } else { printf(" " "Interface %u Access: \n", iface); } Modified: head/usr.sbin/usbconfig/dump.h ============================================================================== --- head/usr.sbin/usbconfig/dump.h Sat Feb 14 23:02:59 2009 (r188621) +++ head/usr.sbin/usbconfig/dump.h Sat Feb 14 23:20:00 2009 (r188622) @@ -27,7 +27,7 @@ const char *dump_mode(uint8_t value); const char *dump_speed(uint8_t value); const char *dump_power_mode(uint8_t value); -void dump_device_info(struct libusb20_device *pdev); +void dump_device_info(struct libusb20_device *pdev, uint8_t show_drv); void dump_be_access(struct libusb20_backend *pbe); void dump_be_quirk_names(struct libusb20_backend *pbe); void dump_be_dev_quirks(struct libusb20_backend *pbe); Modified: head/usr.sbin/usbconfig/usbconfig.c ============================================================================== --- head/usr.sbin/usbconfig/usbconfig.c Sat Feb 14 23:02:59 2009 (r188621) +++ head/usr.sbin/usbconfig/usbconfig.c Sat Feb 14 23:20:00 2009 (r188622) @@ -78,6 +78,7 @@ struct options { uint8_t got_dump_all_config:1; uint8_t got_dump_info:1; uint8_t got_dump_access:1; + uint8_t got_show_iface_driver:1; uint8_t got_remove_device_quirk:1; uint8_t got_add_device_quirk:1; uint8_t got_dump_string:1; @@ -100,6 +101,7 @@ enum { T_SET_PERM, T_ADD_DEVICE_QUIRK, T_REMOVE_DEVICE_QUIRK, + T_SHOW_IFACE_DRIVER, T_DUMP_QUIRK_NAMES, T_DUMP_DEVICE_QUIRKS, T_DUMP_DEVICE_DESC, @@ -138,6 +140,7 @@ static const struct token token[] = { {"dump_string", T_DUMP_STRING, 1}, {"dump_access", T_DUMP_ACCESS, 0}, {"dump_info", T_DUMP_INFO, 0}, + {"show_ifdrv", T_SHOW_IFACE_DRIVER, 0}, {"suspend", T_SUSPEND, 0}, {"resume", T_RESUME, 0}, {"power_off", T_POWER_OFF, 0}, @@ -290,6 +293,7 @@ usage(void) " dump_string " "\n" " dump_access" "\n" " dump_info" "\n" + " show_ifdrv" "\n" " suspend" "\n" " resume" "\n" " power_off" "\n" @@ -535,7 +539,8 @@ flush_command(struct libusb20_backend *p opt->got_dump_access); if (opt->got_list || dump_any) { - dump_device_info(pdev); + dump_device_info(pdev, + opt->got_show_iface_driver); } if (opt->got_dump_access) { printf("\n"); @@ -632,6 +637,10 @@ main(int argc, char **argv) opt->got_any++; break; + case T_SHOW_IFACE_DRIVER: + opt->got_show_iface_driver = 1; + break; + case T_UNIT: if (opt->got_any) { /* allow multiple commands on the same line */ From owner-svn-src-head@FreeBSD.ORG Sat Feb 14 23:40:45 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 309C91065675 for ; Sat, 14 Feb 2009 23:40:45 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outQ.internet-mail-service.net (outq.internet-mail-service.net [216.240.47.240]) by mx1.freebsd.org (Postfix) with ESMTP id C8F1C8FC16 for ; Sat, 14 Feb 2009 23:40:44 +0000 (UTC) (envelope-from julian@elischer.org) Received: from idiom.com (mx0.idiom.com [216.240.32.160]) by out.internet-mail-service.net (Postfix) with ESMTP id 1B9B0243B; Sat, 14 Feb 2009 15:26:11 -0800 (PST) X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e Received: from julian-mac.elischer.org (home.elischer.org [216.240.48.38]) by idiom.com (Postfix) with ESMTP id 4CF112D600D; Sat, 14 Feb 2009 15:26:10 -0800 (PST) Message-ID: <4997531E.3000900@elischer.org> Date: Sat, 14 Feb 2009 15:26:22 -0800 From: Julian Elischer User-Agent: Thunderbird 2.0.0.19 (Macintosh/20081209) MIME-Version: 1.0 To: Luigi Rizzo References: <200902131514.n1DFEhft091837@svn.freebsd.org> In-Reply-To: <200902131514.n1DFEhft091837@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r188578 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Feb 2009 23:40:45 -0000 Luigi Rizzo wrote: > Author: luigi > Date: Fri Feb 13 15:14:43 2009 > New Revision: 188578 > URL: http://svn.freebsd.org/changeset/base/188578 > > Log: > Use uint32_t instead of n_long and n_time, and uint16_t instead of n_short. > Add a note next to fields in network format. > > The n_* types are not enough for compiler checks on endianness, and their > use often requires an otherwise unnecessary #include > > The typedef in in_systm.h are still there. There is a project out there (intel was involved frommemory) to make a compiler that knows the endianness of stuff. I know it exists because it was reported that one well known piece of big endian embedded software was compiled successfully to actually run on little endian machines. You can of course see why intel was interested.. > > Modified: > head/sys/netinet/in_systm.h > head/sys/netinet/ip.h > head/sys/netinet/ip_icmp.c > head/sys/netinet/ip_icmp.h > head/sys/netinet/ip_options.c > head/sys/netinet/tcp_debug.h > head/sys/netinet/tcp_subr.c > > Modified: head/sys/netinet/in_systm.h > ============================================================================== > --- head/sys/netinet/in_systm.h Fri Feb 13 14:43:46 2009 (r188577) > +++ head/sys/netinet/in_systm.h Fri Feb 13 15:14:43 2009 (r188578) > @@ -52,7 +52,7 @@ typedef u_int32_t n_long; /* long as re > typedef u_int32_t n_time; /* ms since 00:00 GMT, byte rev */ > > #ifdef _KERNEL > -n_time iptime(void); > +uint32_t iptime(void); > #endif > > #endif > > Modified: head/sys/netinet/ip.h > ============================================================================== > --- head/sys/netinet/ip.h Fri Feb 13 14:43:46 2009 (r188577) > +++ head/sys/netinet/ip.h Fri Feb 13 15:14:43 2009 (r188578) > @@ -150,10 +150,10 @@ struct ip_timestamp { > ipt_flg:4; /* flags, see below */ > #endif > union ipt_timestamp { > - n_long ipt_time[1]; > + uint32_t ipt_time[1]; /* network format */ > struct ipt_ta { > struct in_addr ipt_addr; > - n_long ipt_time; > + uint32_t ipt_time; /* network format */ > } ipt_ta[1]; > } ipt_timestamp; > }; > > Modified: head/sys/netinet/ip_icmp.c > ============================================================================== > --- head/sys/netinet/ip_icmp.c Fri Feb 13 14:43:46 2009 (r188577) > +++ head/sys/netinet/ip_icmp.c Fri Feb 13 15:14:43 2009 (r188578) > @@ -165,7 +165,7 @@ icmp_init(void) > * in response to bad packet ip. > */ > void > -icmp_error(struct mbuf *n, int type, int code, n_long dest, int mtu) > +icmp_error(struct mbuf *n, int type, int code, uint32_t dest, int mtu) > { > INIT_VNET_INET(curvnet); > register struct ip *oip = mtod(n, struct ip *), *nip; > @@ -852,7 +852,10 @@ icmp_send(struct mbuf *m, struct mbuf *o > (void) ip_output(m, opts, NULL, 0, NULL, NULL); > } > > -n_time > +/* > + * Return milliseconds since 00:00 GMT in network format. > + */ > +uint32_t > iptime(void) > { > struct timeval atv; > > Modified: head/sys/netinet/ip_icmp.h > ============================================================================== > --- head/sys/netinet/ip_icmp.h Fri Feb 13 14:43:46 2009 (r188577) > +++ head/sys/netinet/ip_icmp.h Fri Feb 13 15:14:43 2009 (r188578) > @@ -68,15 +68,15 @@ struct icmp { > u_char ih_pptr; /* ICMP_PARAMPROB */ > struct in_addr ih_gwaddr; /* ICMP_REDIRECT */ > struct ih_idseq { > - n_short icd_id; > - n_short icd_seq; > + uint16_t icd_id; /* network format */ > + uint16_t icd_seq; /* network format */ > } ih_idseq; > int ih_void; > > /* ICMP_UNREACH_NEEDFRAG -- Path MTU Discovery (RFC1191) */ > struct ih_pmtu { > - n_short ipm_void; > - n_short ipm_nextmtu; > + uint16_t ipm_void; /* network format */ > + uint16_t ipm_nextmtu; /* network format */ > } ih_pmtu; > > struct ih_rtradv { > @@ -97,9 +97,13 @@ struct icmp { > #define icmp_lifetime icmp_hun.ih_rtradv.irt_lifetime > union { > struct id_ts { /* ICMP Timestamp */ > - n_time its_otime; /* Originate */ > - n_time its_rtime; /* Receive */ > - n_time its_ttime; /* Transmit */ > + /* > + * The next 3 fields are in network format, > + * milliseconds since 00:00 GMT > + */ > + uint32_t its_otime; /* Originate */ > + uint32_t its_rtime; /* Receive */ > + uint32_t its_ttime; /* Transmit */ > } id_ts; > struct id_ip { > struct ip idi_ip; > @@ -127,7 +131,7 @@ struct icmp { > * ip header length. > */ > #define ICMP_MINLEN 8 /* abs minimum */ > -#define ICMP_TSLEN (8 + 3 * sizeof (n_time)) /* timestamp */ > +#define ICMP_TSLEN (8 + 3 * sizeof (uint32_t)) /* timestamp */ > #define ICMP_MASKLEN 12 /* address mask */ > #define ICMP_ADVLENMIN (8 + sizeof (struct ip) + 8) /* min */ > #define ICMP_ADVLEN(p) (8 + ((p)->icmp_ip.ip_hl << 2) + 8) > @@ -202,7 +206,7 @@ struct icmp { > (type) == ICMP_MASKREQ || (type) == ICMP_MASKREPLY) > > #ifdef _KERNEL > -void icmp_error(struct mbuf *, int, int, n_long, int); > +void icmp_error(struct mbuf *, int, int, uint32_t, int); > void icmp_input(struct mbuf *, int); > void icmp_init(void); > int ip_next_mtu(int, int); > > Modified: head/sys/netinet/ip_options.c > ============================================================================== > --- head/sys/netinet/ip_options.c Fri Feb 13 14:43:46 2009 (r188577) > +++ head/sys/netinet/ip_options.c Fri Feb 13 15:14:43 2009 (r188578) > @@ -105,7 +105,7 @@ ip_dooptions(struct mbuf *m, int pass) > struct in_ifaddr *ia; > int opt, optlen, cnt, off, code, type = ICMP_PARAMPROB, forward = 0; > struct in_addr *sin, dst; > - n_time ntime; > + uint32_t ntime; > struct sockaddr_in ipaddr = { sizeof(ipaddr), AF_INET }; > > /* Ignore or reject packets with IP options. */ > @@ -320,7 +320,7 @@ dropit: > break; > > case IPOPT_TS_TSANDADDR: > - if (off + sizeof(n_time) + > + if (off + sizeof(uint32_t) + > sizeof(struct in_addr) > optlen) { > code = &cp[IPOPT_OFFSET] - (u_char *)ip; > goto bad; > @@ -337,7 +337,7 @@ dropit: > break; > > case IPOPT_TS_PRESPEC: > - if (off + sizeof(n_time) + > + if (off + sizeof(uint32_t) + > sizeof(struct in_addr) > optlen) { > code = &cp[IPOPT_OFFSET] - (u_char *)ip; > goto bad; > @@ -355,8 +355,8 @@ dropit: > goto bad; > } > ntime = iptime(); > - (void)memcpy(cp + off, &ntime, sizeof(n_time)); > - cp[IPOPT_OFFSET] += sizeof(n_time); > + (void)memcpy(cp + off, &ntime, sizeof(uint32_t)); > + cp[IPOPT_OFFSET] += sizeof(uint32_t); > } > } > if (forward && V_ipforwarding) { > > Modified: head/sys/netinet/tcp_debug.h > ============================================================================== > --- head/sys/netinet/tcp_debug.h Fri Feb 13 14:43:46 2009 (r188577) > +++ head/sys/netinet/tcp_debug.h Fri Feb 13 15:14:43 2009 (r188578) > @@ -34,7 +34,7 @@ > #define _NETINET_TCP_DEBUG_H_ > > struct tcp_debug { > - n_time td_time; > + uint32_t td_time; /* network format */ > short td_act; > short td_ostate; > caddr_t td_tcb; > > Modified: head/sys/netinet/tcp_subr.c > ============================================================================== > --- head/sys/netinet/tcp_subr.c Fri Feb 13 14:43:46 2009 (r188577) > +++ head/sys/netinet/tcp_subr.c Fri Feb 13 15:14:43 2009 (r188578) > @@ -581,7 +581,7 @@ tcp_respond(struct tcpcb *tp, void *ipge > } else > #endif /* INET6 */ > { > - xchg(ip->ip_dst.s_addr, ip->ip_src.s_addr, n_long); > + xchg(ip->ip_dst.s_addr, ip->ip_src.s_addr, uint32_t); > nth = (struct tcphdr *)(ip + 1); > } > if (th != nth) { > @@ -593,7 +593,7 @@ tcp_respond(struct tcpcb *tp, void *ipge > nth->th_sport = th->th_sport; > nth->th_dport = th->th_dport; > } > - xchg(nth->th_dport, nth->th_sport, n_short); > + xchg(nth->th_dport, nth->th_sport, uint16_t); > #undef xchg > } > #ifdef INET6 From owner-svn-src-head@FreeBSD.ORG Sat Feb 14 23:55:49 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C2FD106566B; Sat, 14 Feb 2009 23:55:49 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.9.129]) by mx1.freebsd.org (Postfix) with ESMTP id 0BE408FC13; Sat, 14 Feb 2009 23:55:48 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id 1751773098; Sun, 15 Feb 2009 01:01:49 +0100 (CET) Date: Sun, 15 Feb 2009 01:01:49 +0100 From: Luigi Rizzo To: Bruce Evans Message-ID: <20090215000149.GB95636@onelab2.iet.unipi.it> References: <200902131514.n1DFEhft091837@svn.freebsd.org> <20090214183758.I847@besplex.bde.org> <20090214175136.GB89369@onelab2.iet.unipi.it> <20090215052941.E2522@delplex.bde.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090215052941.E2522@delplex.bde.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@FreeBSD.org, Luigi Rizzo , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org Subject: Re: svn commit: r188578 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Feb 2009 23:55:49 -0000 On Sun, Feb 15, 2009 at 06:39:56AM +1100, Bruce Evans wrote: ... > BTW, I also disagree with you adding comments to include lines to say > what the includes are for. There is no chance that such comments are > complete or can be maintained. For completeness, every include line > would need a paragraph or two like some of the ones in this mail to > explain all the reasons why a header is included, and the details will > change when code is added. The reasons why a header is needed are > most easily seen by trying to compile without it. A generic header > like will be needed for a myriad reasons and listing > them all is not useful. A small header will be needed for only a small > number of reasons and listing them all is even less useful, since it > is easy to find and understand the reasons if only a couple of > declarations are used. All true. But I am only annotating "non-obvious" or questionable #include, and only for the details relevant in the context of that source file. E.g. if I am including just to know what IFNAMSIZ is, or just to get a forward declaration for 'struct route', that's worth mentioning in my opinion, because those #includes are possible candidates for removal once the required information is obtained elsewhere (or it is not needed anymore). cheers luigi