From owner-svn-src-head@FreeBSD.ORG Wed Oct 8 06:19:49 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE712106569B; Wed, 8 Oct 2008 06:19:49 +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 AC77D8FC2A; Wed, 8 Oct 2008 06:19:49 +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 m986Jnt9024073; Wed, 8 Oct 2008 06:19:49 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m986JnpQ024072; Wed, 8 Oct 2008 06:19:49 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200810080619.m986JnpQ024072@svn.freebsd.org> From: Robert Watson Date: Wed, 8 Oct 2008 06:19: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: r183689 - 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, 08 Oct 2008 06:19:49 -0000 Author: rwatson Date: Wed Oct 8 06:19:49 2008 New Revision: 183689 URL: http://svn.freebsd.org/changeset/base/183689 Log: Differentiate pr_usrreqs for stream and datagram UNIX domain sockets, and employ soreceive_dgram for the datagram case. MFC after: 3 months Modified: head/sys/kern/uipc_usrreq.c Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Wed Oct 8 05:30:30 2008 (r183688) +++ head/sys/kern/uipc_usrreq.c Wed Oct 8 06:19:49 2008 (r183689) @@ -249,20 +249,20 @@ static struct mbuf *unp_addsockcred(stru * Definitions of protocols supported in the LOCAL domain. */ static struct domain localdomain; -static struct pr_usrreqs uipc_usrreqs; +static struct pr_usrreqs uipc_usrreqs_dgram, uipc_usrreqs_stream; static struct protosw localsw[] = { { .pr_type = SOCK_STREAM, .pr_domain = &localdomain, .pr_flags = PR_CONNREQUIRED|PR_WANTRCVD|PR_RIGHTS, .pr_ctloutput = &uipc_ctloutput, - .pr_usrreqs = &uipc_usrreqs + .pr_usrreqs = &uipc_usrreqs_stream }, { .pr_type = SOCK_DGRAM, .pr_domain = &localdomain, .pr_flags = PR_ATOMIC|PR_ADDR|PR_RIGHTS, - .pr_usrreqs = &uipc_usrreqs + .pr_usrreqs = &uipc_usrreqs_dgram }, }; @@ -996,7 +996,7 @@ uipc_sockaddr(struct socket *so, struct return (0); } -static struct pr_usrreqs uipc_usrreqs = { +static struct pr_usrreqs uipc_usrreqs_dgram = { .pru_abort = uipc_abort, .pru_accept = uipc_accept, .pru_attach = uipc_attach, @@ -1012,6 +1012,27 @@ static struct pr_usrreqs uipc_usrreqs = .pru_sense = uipc_sense, .pru_shutdown = uipc_shutdown, .pru_sockaddr = uipc_sockaddr, + .pru_soreceive = soreceive_dgram, + .pru_close = uipc_close, +}; + +static struct pr_usrreqs uipc_usrreqs_stream = { + .pru_abort = uipc_abort, + .pru_accept = uipc_accept, + .pru_attach = uipc_attach, + .pru_bind = uipc_bind, + .pru_connect = uipc_connect, + .pru_connect2 = uipc_connect2, + .pru_detach = uipc_detach, + .pru_disconnect = uipc_disconnect, + .pru_listen = uipc_listen, + .pru_peeraddr = uipc_peeraddr, + .pru_rcvd = uipc_rcvd, + .pru_send = uipc_send, + .pru_sense = uipc_sense, + .pru_shutdown = uipc_shutdown, + .pru_sockaddr = uipc_sockaddr, + .pru_soreceive = soreceive_generic, .pru_close = uipc_close, }; From owner-svn-src-head@FreeBSD.ORG Wed Oct 8 06:26:52 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0CC921065689; Wed, 8 Oct 2008 06:26:52 +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 EF0C68FC0C; Wed, 8 Oct 2008 06:26:51 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m986QpgT024486; Wed, 8 Oct 2008 06:26:51 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m986Qp4U024485; Wed, 8 Oct 2008 06:26:51 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200810080626.m986Qp4U024485@svn.freebsd.org> From: Robert Watson Date: Wed, 8 Oct 2008 06:26: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: r183690 - 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, 08 Oct 2008 06:26:52 -0000 Author: rwatson Date: Wed Oct 8 06:26:51 2008 New Revision: 183690 URL: http://svn.freebsd.org/changeset/base/183690 Log: Remove stale comment (and XXX saying so) about why we zero the file descriptor pointer in unp_freerights: we can no longer recurse into unp_gc due to unp_gc being invoked in a deferred way, but it's still a good idea. MFC after: 3 days Modified: head/sys/kern/uipc_usrreq.c Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Wed Oct 8 06:19:49 2008 (r183689) +++ head/sys/kern/uipc_usrreq.c Wed Oct 8 06:26:51 2008 (r183690) @@ -1538,12 +1538,6 @@ unp_freerights(struct file **rp, int fdc struct file *fp; for (i = 0; i < fdcount; i++) { - /* - * Zero the pointer before calling unp_discard since it may - * end up in unp_gc().. - * - * XXXRW: This is less true than it used to be. - */ fp = *rp; *rp++ = NULL; unp_discard(fp); From owner-svn-src-head@FreeBSD.ORG Wed Oct 8 06:39:07 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1E5431065689; Wed, 8 Oct 2008 06:39:07 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0CA948FC16; Wed, 8 Oct 2008 06:39:07 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m986d6B9025197; Wed, 8 Oct 2008 06:39:06 GMT (envelope-from phk@svn.freebsd.org) Received: (from phk@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m986d54N025194; Wed, 8 Oct 2008 06:39:05 GMT (envelope-from phk@svn.freebsd.org) Message-Id: <200810080639.m986d54N025194@svn.freebsd.org> From: Poul-Henning Kamp Date: Wed, 8 Oct 2008 06:39: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: r183691 - head/games/fortune/datfiles X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 08 Oct 2008 06:39:07 -0000 Author: phk Date: Wed Oct 8 06:39:05 2008 New Revision: 183691 URL: http://svn.freebsd.org/changeset/base/183691 Log: A Wittgenstein quote according to David Ignatius http://voices.washingtonpost.com/postpartisan/2008/10/the_town_hall_debate_in_praise.html Modified: head/games/fortune/datfiles/fortunes Modified: head/games/fortune/datfiles/fortunes ============================================================================== --- head/games/fortune/datfiles/fortunes Wed Oct 8 06:26:51 2008 (r183690) +++ head/games/fortune/datfiles/fortunes Wed Oct 8 06:39:05 2008 (r183691) @@ -26583,6 +26583,9 @@ theirs, then you clearly don't understan % If you can lead it to water and force it to drink, it isn't a horse. % +If you can not say it, you can not whistle it, either. + -- Wittgenstein +% If you can read this, you're too close. % If you can survive death, you can probably survive anything. From owner-svn-src-head@FreeBSD.ORG Wed Oct 8 07:48:53 2008 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 85D2F106569C; Wed, 8 Oct 2008 07:48:53 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from tarsier.delphij.net (delphij-pt.tunnel.tserv2.fmt.ipv6.he.net [IPv6:2001:470:1f03:2c9::2]) by mx1.freebsd.org (Postfix) with ESMTP id 2B78D8FC12; Wed, 8 Oct 2008 07:48:53 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from tarsier.geekcn.org (tarsier.geekcn.org [211.166.10.233]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tarsier.delphij.net (Postfix) with ESMTPS id 2F4A728454; Wed, 8 Oct 2008 15:48:52 +0800 (CST) Received: from localhost (tarsier.geekcn.org [211.166.10.233]) by tarsier.geekcn.org (Postfix) with ESMTP id F19CE101C91E; Wed, 8 Oct 2008 15:48:51 +0800 (CST) X-Virus-Scanned: amavisd-new at geekcn.org Received: from tarsier.geekcn.org ([211.166.10.233]) by localhost (mail.geekcn.org [211.166.10.233]) (amavisd-new, port 10024) with ESMTP id 6LB2+778HrCk; Wed, 8 Oct 2008 15:48:47 +0800 (CST) Received: from charlie.delphij.net (71.5.7.139.ptr.us.xo.net [71.5.7.139]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tarsier.geekcn.org (Postfix) with ESMTPSA id 3CD80101C645; Wed, 8 Oct 2008 15:48:45 +0800 (CST) DomainKey-Signature: a=rsa-sha1; s=default; d=delphij.net; c=nofws; q=dns; h=message-id:date:from:reply-to:organization:user-agent: mime-version:to:cc:subject:references:in-reply-to: x-enigmail-version:openpgp:content-type:content-transfer-encoding; b=tqp55p8E2GmCZ6zw8G2OZR36I09Qhxj5Ur5F7LQGk0Zb2w3kF51RzGI1ViePQJ++S mXaCj4o8qZF8HyQ4scv9w== Message-ID: <48EC65DA.9070300@delphij.net> Date: Wed, 08 Oct 2008 00:48:42 -0700 From: Xin LI Organization: The FreeBSD Project User-Agent: Thunderbird 2.0.0.17 (X11/20080928) MIME-Version: 1.0 To: Xin LI References: <200810080131.m981V0HR016984@svn.freebsd.org> In-Reply-To: <200810080131.m981V0HR016984@svn.freebsd.org> X-Enigmail-Version: 0.95.7 OpenPGP: id=18EDEBA0; url=http://www.delphij.net/delphij.asc 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: r183679 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: d@delphij.net List-Id: 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, 08 Oct 2008 07:48:53 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Xin LI wrote: > Author: delphij > Date: Wed Oct 8 01:31:00 2008 > New Revision: 183679 > URL: http://svn.freebsd.org/changeset/base/183679 > > Log: > Don't mention lib/compat, it has gone long ago. Use ports/misc/compat* > instead. Oh my... I should have committed this in two parts, the first part of this ommit is to add a note regarding the recent sequence change of OpenSSH client side. > Modified: > head/UPDATING > > Modified: head/UPDATING > ============================================================================== > --- head/UPDATING Tue Oct 7 23:55:32 2008 (r183678) > +++ head/UPDATING Wed Oct 8 01:31:00 2008 (r183679) > @@ -59,6 +59,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. > option to "ssh-dss,ssh-rsa" in ~/.ssh/config or on the ssh > command line. > > + Please note that the sequence of keys offered for > + authentication has been changed as well. You may want to > + specify IdentityFile in a different order to revert this > + behavior. > + > 20080713: > The sio(4) driver has been removed from the i386 and amd64 > kernel configuration files. This means uart(4) is now the > @@ -1018,7 +1023,7 @@ COMMON ITEMS: > > > > - > + > > > > - -- Xin LI http://www.delphij.net/ FreeBSD - The Power to Serve! -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (FreeBSD) iEYEARECAAYFAkjsZdoACgkQi+vbBBjt66BmGwCgjeDdTcn6OGO/ArJfPhjZ7kQg b20An2uKa7u+TZGVDkEafxktAEpaF8O+ =jqiz -----END PGP SIGNATURE----- From owner-svn-src-head@FreeBSD.ORG Wed Oct 8 08:08:03 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 722A210656A2; Wed, 8 Oct 2008 08:08: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 60A158FC18; Wed, 8 Oct 2008 08:08:03 +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 m98883S2028096; Wed, 8 Oct 2008 08:08:03 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m98883NQ028095; Wed, 8 Oct 2008 08:08:03 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200810080808.m98883NQ028095@svn.freebsd.org> From: Warner Losh Date: Wed, 8 Oct 2008 08: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: r183692 - head/sys/dev/sio X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 08 Oct 2008 08:08:03 -0000 Author: imp Date: Wed Oct 8 08:08:03 2008 New Revision: 183692 URL: http://svn.freebsd.org/changeset/base/183692 Log: Add a note about a bug in how sio manages its softc. This was discovered by Dorr H. Clark. I'm not at all sure how to fix it, but wanted to document it at the very least... Modified: head/sys/dev/sio/sio.c Modified: head/sys/dev/sio/sio.c ============================================================================== --- head/sys/dev/sio/sio.c Wed Oct 8 06:39:05 2008 (r183691) +++ head/sys/dev/sio/sio.c Wed Oct 8 08:08:03 2008 (r183692) @@ -696,6 +696,14 @@ sioprobe(dev, xrid, rclk, noprobe) bus_release_resource(dev, SYS_RES_IOPORT, rid, port); if (iobase == siocniobase) result = 0; + /* + * XXX: Since we don't return 0, we shouldn't be relying on + * the softc that we set to persist to the call to attach + * since other probe routines may be called, and the malloc + * here causes subr_bus to not allocate anything for the + * other probes. Instead, this softc is preserved and other + * probe routines can corrupt it. + */ if (result != 0) { device_set_softc(dev, NULL); free(com, M_DEVBUF); @@ -773,6 +781,13 @@ sioprobe(dev, xrid, rclk, noprobe) bus_release_resource(dev, SYS_RES_IOPORT, rid, port); if (iobase == siocniobase) result = 0; + /* + * XXX: Since we don't return 0, we shouldn't be relying on the softc + * that we set to persist to the call to attach since other probe + * routines may be called, and the malloc here causes subr_bus to not + * allocate anything for the other probes. Instead, this softc is + * preserved and other probe routines can corrupt it. + */ if (result != 0) { device_set_softc(dev, NULL); free(com, M_DEVBUF); From owner-svn-src-head@FreeBSD.ORG Wed Oct 8 10:37:08 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DDCC51065686; Wed, 8 Oct 2008 10:37:07 +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 CBD598FC1C; Wed, 8 Oct 2008 10:37:07 +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 m98Ab7T3031692; Wed, 8 Oct 2008 10:37:07 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m98Ab7ep031689; Wed, 8 Oct 2008 10:37:07 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200810081037.m98Ab7ep031689@svn.freebsd.org> From: Alexander Motin Date: Wed, 8 Oct 2008 10:37: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: r183693 - head/sys/netgraph/netflow X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 08 Oct 2008 10:37:08 -0000 Author: mav Date: Wed Oct 8 10:37:07 2008 New Revision: 183693 URL: http://svn.freebsd.org/changeset/base/183693 Log: Add ability to generate egress netflow instead or in addition to ingress. Use mbuf tagging for accounted packets to not account packets twice when both ingress and egress netflow enabled. To keep compatibility new "setconfig" message added to control new functionality. By default node works as before, doing only ingress accounting without using mbuf tags. Reviewed by: glebius Modified: head/sys/netgraph/netflow/netflow.c head/sys/netgraph/netflow/ng_netflow.c head/sys/netgraph/netflow/ng_netflow.h Modified: head/sys/netgraph/netflow/netflow.c ============================================================================== --- head/sys/netgraph/netflow/netflow.c Wed Oct 8 08:08:03 2008 (r183692) +++ head/sys/netgraph/netflow/netflow.c Wed Oct 8 10:37:07 2008 (r183693) @@ -389,8 +389,7 @@ ng_netflow_cache_flush(priv_p priv) /* Insert packet from into flow cache. */ int -ng_netflow_flow_add(priv_p priv, struct ip *ip, iface_p iface, - struct ifnet *ifp) +ng_netflow_flow_add(priv_p priv, struct ip *ip, unsigned int src_if_index) { register struct flow_entry *fle, *fle1; struct flow_hash_entry *hsh; @@ -421,12 +420,7 @@ ng_netflow_flow_add(priv_p priv, struct r.r_ip_p = ip->ip_p; r.r_tos = ip->ip_tos; - /* Configured in_ifx overrides mbuf's */ - if (iface->info.ifinfo_index == 0) { - if (ifp != NULL) - r.r_i_ifx = ifp->if_index; - } else - r.r_i_ifx = iface->info.ifinfo_index; + r.r_i_ifx = src_if_index; /* * XXX NOTE: only first fragment of fragmented TCP, UDP and Modified: head/sys/netgraph/netflow/ng_netflow.c ============================================================================== --- head/sys/netgraph/netflow/ng_netflow.c Wed Oct 8 08:08:03 2008 (r183692) +++ head/sys/netgraph/netflow/ng_netflow.c Wed Oct 8 10:37:07 2008 (r183693) @@ -106,6 +106,14 @@ static const struct ng_parse_type ng_net &ng_netflow_settimeouts_type_fields }; +/* Parse type for ng_netflow_setconfig */ +static const struct ng_parse_struct_field ng_netflow_setconfig_type_fields[] + = NG_NETFLOW_SETCONFIG_TYPE; +static const struct ng_parse_type ng_netflow_setconfig_type = { + &ng_parse_struct_type, + &ng_netflow_setconfig_type_fields +}; + /* List of commands and how to convert arguments to/from ASCII */ static const struct ng_cmdlist ng_netflow_cmds[] = { { @@ -143,6 +151,13 @@ static const struct ng_cmdlist ng_netflo &ng_netflow_settimeouts_type, NULL }, + { + NGM_NETFLOW_COOKIE, + NGM_NETFLOW_SETCONFIG, + "setconfig", + &ng_netflow_setconfig_type, + NULL + }, { 0 } }; @@ -167,7 +182,7 @@ static int ng_netflow_constructor(node_p node) { priv_p priv; - int error = 0; + int error = 0, i; /* Initialize private data */ MALLOC(priv, priv_p, sizeof(*priv), M_NETGRAPH, M_NOWAIT); @@ -183,6 +198,10 @@ ng_netflow_constructor(node_p node) priv->info.nfinfo_inact_t = INACTIVE_TIMEOUT; priv->info.nfinfo_act_t = ACTIVE_TIMEOUT; + /* Set default config */ + for (i = 0; i < NG_NETFLOW_MAXIFACES; i++) + priv->ifaces[i].info.conf = NG_NETFLOW_CONF_INGRESS; + /* Initialize callout handle */ callout_init(&priv->exp_callout, CALLOUT_MPSAFE); @@ -399,6 +418,22 @@ ng_netflow_rcvmsg (node_p node, item_p i break; } + case NGM_NETFLOW_SETCONFIG: + { + struct ng_netflow_setconfig *set; + + if (msg->header.arglen != sizeof(struct ng_netflow_settimeouts)) + ERROUT(EINVAL); + + set = (struct ng_netflow_setconfig *)msg->data; + + if (set->iface >= NG_NETFLOW_MAXIFACES) + ERROUT(EINVAL); + + priv->ifaces[set->iface].info.conf = set->conf; + + break; + } case NGM_NETFLOW_SHOW: { uint32_t *last; @@ -445,10 +480,13 @@ ng_netflow_rcvdata (hook_p hook, item_p const node_p node = NG_HOOK_NODE(hook); const priv_p priv = NG_NODE_PRIVATE(node); const iface_p iface = NG_HOOK_PRIVATE(hook); + hook_p out; struct mbuf *m = NULL; struct ip *ip; + struct m_tag *mtag; int pullup_len = 0; - int error = 0; + int error = 0, bypass = 0; + unsigned int src_if_index; if (hook == priv->export) { /* @@ -459,16 +497,48 @@ ng_netflow_rcvdata (hook_p hook, item_p ERROUT(EINVAL); }; - if (hook == iface->out) { - /* - * Data arrived on out hook. Bypass it. - */ - if (iface->hook == NULL) + if (hook == iface->hook) { + if ((iface->info.conf & NG_NETFLOW_CONF_INGRESS) == 0) + bypass = 1; + out = iface->out; + } else if (hook == iface->out) { + if ((iface->info.conf & NG_NETFLOW_CONF_EGRESS) == 0) + bypass = 1; + out = iface->hook; + } else + ERROUT(EINVAL); + + if ((!bypass) && + (iface->info.conf & (NG_NETFLOW_CONF_ONCE | NG_NETFLOW_CONF_THISONCE))) { + mtag = m_tag_locate(NGI_M(item), MTAG_NETFLOW, + MTAG_NETFLOW_CALLED, NULL); + while (mtag != NULL) { + if ((iface->info.conf & NG_NETFLOW_CONF_ONCE) || + ((ng_ID_t *)(mtag + 1))[0] == NG_NODE_ID(node)) { + bypass = 1; + break; + } + mtag = m_tag_locate(NGI_M(item), MTAG_NETFLOW, + MTAG_NETFLOW_CALLED, mtag); + } + } + + if (bypass) { + if (out == NULL) ERROUT(ENOTCONN); - NG_FWD_ITEM_HOOK(error, item, iface->hook); + NG_FWD_ITEM_HOOK(error, item, out); return (error); } + + if (iface->info.conf & (NG_NETFLOW_CONF_ONCE | NG_NETFLOW_CONF_THISONCE)) { + mtag = m_tag_alloc(MTAG_NETFLOW, MTAG_NETFLOW_CALLED, + sizeof(ng_ID_t), M_NOWAIT); + if (mtag) { + ((ng_ID_t *)(mtag + 1))[0] = NG_NODE_ID(node); + m_tag_prepend(NGI_M(item), mtag); + } + } NGI_GET_M(item, m); @@ -592,12 +662,20 @@ ng_netflow_rcvdata (hook_p hook, item_p #undef M_CHECK - error = ng_netflow_flow_add(priv, ip, iface, m->m_pkthdr.rcvif); + /* Determine packet input interface. Prefer configured. */ + src_if_index = 0; + if (hook == iface->out || iface->info.ifinfo_index == 0) { + if (m->m_pkthdr.rcvif != NULL) + src_if_index = m->m_pkthdr.rcvif->if_index; + } else + src_if_index = iface->info.ifinfo_index; + + error = ng_netflow_flow_add(priv, ip, src_if_index); bypass: - if (iface->out != NULL) { + if (out != NULL) { /* XXX: error gets overwritten here */ - NG_FWD_NEW_DATA(error, item, iface->out, m); + NG_FWD_NEW_DATA(error, item, out, m); return (error); } done: Modified: head/sys/netgraph/netflow/ng_netflow.h ============================================================================== --- head/sys/netgraph/netflow/ng_netflow.h Wed Oct 8 08:08:03 2008 (r183692) +++ head/sys/netgraph/netflow/ng_netflow.h Wed Oct 8 10:37:07 2008 (r183693) @@ -50,6 +50,7 @@ enum { NGM_NETFLOW_SETDLT = 4, /* set data-link type */ NGM_NETFLOW_SETIFINDEX = 5, /* set interface index */ NGM_NETFLOW_SETTIMEOUTS = 6, /* set active/inactive flow timeouts */ + NGM_NETFLOW_SETCONFIG = 7, /* set flow generation options */ }; /* This structure is returned by the NGM_NETFLOW_INFO message */ @@ -71,6 +72,7 @@ struct ng_netflow_ifinfo { uint8_t ifinfo_dlt; /* Data Link Type, DLT_XXX */ #define MAXDLTNAMELEN 20 u_int16_t ifinfo_index; /* connected iface index */ + uint32_t conf; }; @@ -92,6 +94,17 @@ struct ng_netflow_settimeouts { uint32_t active_timeout; /* flow active timeout */ }; +#define NG_NETFLOW_CONF_INGRESS 1 +#define NG_NETFLOW_CONF_EGRESS 2 +#define NG_NETFLOW_CONF_ONCE 4 +#define NG_NETFLOW_CONF_THISONCE 8 + +/* This structure is passed to NGM_NETFLOW_SETCONFIG */ +struct ng_netflow_setconfig { + u_int16_t iface; /* which iface config change */ + u_int32_t conf; /* new config */ +}; + /* This is unique data, which identifies flow */ struct flow_rec { struct in_addr r_src; @@ -182,6 +195,7 @@ struct flow_entry { { "packets", &ng_parse_uint32_type }, \ { "data link type", &ng_parse_uint8_type }, \ { "index", &ng_parse_uint16_type }, \ + { "conf", &ng_parse_uint32_type }, \ { NULL } \ } @@ -206,6 +220,13 @@ struct flow_entry { { NULL } \ } +/* Parse the setifindex structure */ +#define NG_NETFLOW_SETCONFIG_TYPE { \ + { "iface", &ng_parse_uint16_type }, \ + { "conf", &ng_parse_uint32_type }, \ + { NULL } \ +} + /* Private hook data */ struct ng_netflow_iface { hook_p hook; /* NULL when disconnected */ @@ -263,12 +284,15 @@ struct flow_hash_entry { #define ERROUT(x) { error = (x); goto done; } +#define MTAG_NETFLOW 1221656444 +#define MTAG_NETFLOW_CALLED 0 + /* Prototypes for netflow.c */ int ng_netflow_cache_init(priv_p); void ng_netflow_cache_flush(priv_p); void ng_netflow_copyinfo(priv_p, struct ng_netflow_info *); timeout_t ng_netflow_expire; -int ng_netflow_flow_add(priv_p, struct ip *, iface_p, struct ifnet *); +int ng_netflow_flow_add(priv_p, struct ip *, unsigned int src_if_index); int ng_netflow_flow_show(priv_p, uint32_t last, struct ng_mesg *); #endif /* _KERNEL */ From owner-svn-src-head@FreeBSD.ORG Wed Oct 8 11:11:37 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 14D2B1065689; Wed, 8 Oct 2008 11:11:37 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0414D8FC0C; Wed, 8 Oct 2008 11:11:37 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m98BBaBi032332; Wed, 8 Oct 2008 11:11:36 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m98BBaJe032331; Wed, 8 Oct 2008 11:11:36 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200810081111.m98BBaJe032331@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 8 Oct 2008 11:11: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: r183694 - 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, 08 Oct 2008 11:11:37 -0000 Author: kib Date: Wed Oct 8 11:11:36 2008 New Revision: 183694 URL: http://svn.freebsd.org/changeset/base/183694 Log: If the ABI-overriden interpreter was not loaded, do not set have_interp to TRUE. This allows the code in image activator to try /libexec/ld-elf.so.1 as interpreter when newinterp is not found to execute. Reviewed by: peter MFC after: 2 weeks (together with r175105) Modified: head/sys/kern/imgact_elf.c Modified: head/sys/kern/imgact_elf.c ============================================================================== --- head/sys/kern/imgact_elf.c Wed Oct 8 10:37:07 2008 (r183693) +++ head/sys/kern/imgact_elf.c Wed Oct 8 11:11:36 2008 (r183694) @@ -813,7 +813,8 @@ __CONCAT(exec_, __elfN(imgact))(struct i if (!have_interp && newinterp != NULL) { error = __elfN(load_file)(imgp->proc, newinterp, &addr, &imgp->entry_addr, sv->sv_pagesize); - have_interp = TRUE; + if (error == 0) + have_interp = TRUE; } if (!have_interp) { error = __elfN(load_file)(imgp->proc, interp, &addr, From owner-svn-src-head@FreeBSD.ORG Wed Oct 8 11:19:16 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7BBC8106568B; Wed, 8 Oct 2008 11:19:16 +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 6AFCB8FC30; Wed, 8 Oct 2008 11:19:16 +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 m98BJGRh032484; Wed, 8 Oct 2008 11:19:16 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m98BJGZZ032483; Wed, 8 Oct 2008 11:19:16 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200810081119.m98BJGZZ032483@svn.freebsd.org> From: Alexander Motin Date: Wed, 8 Oct 2008 11:19: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: r183695 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Oct 2008 11:19:16 -0000 Author: mav Date: Wed Oct 8 11:19:16 2008 New Revision: 183695 URL: http://svn.freebsd.org/changeset/base/183695 Log: Document new NGM_NETFLOW_SETCONFIG control message. Modified: head/share/man/man4/ng_netflow.4 Modified: head/share/man/man4/ng_netflow.4 ============================================================================== --- head/share/man/man4/ng_netflow.4 Wed Oct 8 11:11:36 2008 (r183694) +++ head/share/man/man4/ng_netflow.4 Wed Oct 8 11:19:16 2008 (r183695) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 2, 2006 +.Dd October 8, 2008 .Os .Dt NG_NETFLOW 4 .Sh NAME @@ -71,7 +71,8 @@ and the same number of hooks named etc., plus a single hook named .Va export . -The node does NetFlow accounting of data received on +By default (ingress NetFlow enabled) node does NetFlow accounting of data +received on .Va iface* hooks. If corresponding @@ -81,7 +82,7 @@ If data is received on .Va out hook, it is bypassed to corresponding .Va iface -hook without any processing. +hook without any processing (egress NetFlow disabled by default). When full export datagram is built it is sent to the .Va export hook. @@ -162,6 +163,31 @@ struct ng_netflow_settimeouts { uint32_t active_timeout; }; .Ed +.It Dv NGM_NETFLOW_SETCONFIG +Sets configuration for the specified interface. +This message requires +.Vt "struct ng_netflow_setconfig" +as an argument: +.Bd -literal -offset 4n +struct ng_netflow_setconfig { + u_int16_t iface; + u_int32_t conf; +#define NG_NETFLOW_CONF_INGRESS 1 +#define NG_NETFLOW_CONF_EGRESS 2 +#define NG_NETFLOW_CONF_ONCE 4 +#define NG_NETFLOW_CONF_THISONCE 8 +}; +.Ed +.Pp +Configuration is a bitmask of several options. Option NG_NETFLOW_CONF_INGRESS +enabled by default enables ingress NetFlow generation (for data coming from +ifaceX hook). Option NG_NETFLOW_CONF_EGRESS enables egress NetFlow (for data +coming from outX hook). Option NG_NETFLOW_CONF_ONCE defines that packet should +be accounted only once if it several times passes via netflow node. Option +NG_NETFLOW_CONF_THISONCE defines that packet should be accounted only once +if it several times passes via exactly this netflow node. Last two options are +important to avoid duplicate accounting when both ingress and egress NetFlow +are enabled. .It Dv NGM_NETFLOW_SHOW This control message asks a node to dump the entire contents of the flow cache. It is called from @@ -191,6 +217,8 @@ commands are: .Qq Li "setifindex { iface = %u index = %u }" .It Dv NGM_NETFLOW_SETTIMEOUTS .Qq Li "settimeouts { inactive = %u active = %u }" +.It Dv NGM_NETFLOW_SETCONFIG +.Qq Li "setconfig { iface = %u conf = %u }" .El .Sh SHUTDOWN This node shuts down upon receipt of a From owner-svn-src-head@FreeBSD.ORG Wed Oct 8 13:16:20 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EC22F106568C; Wed, 8 Oct 2008 13:16:20 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DB4A78FC22; Wed, 8 Oct 2008 13:16:20 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m98DGKAL034461; Wed, 8 Oct 2008 13:16:20 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m98DGKqT034460; Wed, 8 Oct 2008 13:16:20 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200810081316.m98DGKqT034460@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Wed, 8 Oct 2008 13:16: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: r183696 - head/gnu/usr.bin/man/man X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 08 Oct 2008 13:16:21 -0000 Author: des Date: Wed Oct 8 13:16:20 2008 New Revision: 183696 URL: http://svn.freebsd.org/changeset/base/183696 Log: Enable UTF-8. MFC after: 1 week Modified: head/gnu/usr.bin/man/man/man.c Modified: head/gnu/usr.bin/man/man/man.c ============================================================================== --- head/gnu/usr.bin/man/man/man.c Wed Oct 8 11:19:16 2008 (r183695) +++ head/gnu/usr.bin/man/man/man.c Wed Oct 8 13:16:20 2008 (r183696) @@ -105,6 +105,7 @@ static struct ltable ltable[] = { {"KOI8-R", "koi8-r"}, {"ISO8859-1", "latin1"}, {"ISO8859-15", "latin1"}, + {"UTF-8", "utf8"}, {NULL} }; #endif From owner-svn-src-head@FreeBSD.ORG Wed Oct 8 13:19:57 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 91C0A106568E; Wed, 8 Oct 2008 13:19:57 +0000 (UTC) (envelope-from sem@FreeBSD.org) Received: from mail.ciam.ru (mail.ciam.ru [213.247.195.75]) by mx1.freebsd.org (Postfix) with ESMTP id 4F73F8FC29; Wed, 8 Oct 2008 13:19:57 +0000 (UTC) (envelope-from sem@FreeBSD.org) Received: from dhcp250-210.yandex.ru ([87.250.250.210]) by mail.ciam.ru with esmtpa (Exim 4.x) id 1KnYgq-0005dT-HN; Wed, 08 Oct 2008 17:02:56 +0400 Message-ID: <48ECAF7E.5040607@FreeBSD.org> Date: Wed, 08 Oct 2008 17:02:54 +0400 From: Sergey Matveychuk User-Agent: Thunderbird 2.0.0.17 (Windows/20080914) MIME-Version: 1.0 To: Alexander Motin References: <200810081037.m98Ab7ep031689@svn.freebsd.org> In-Reply-To: <200810081037.m98Ab7ep031689@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: r183693 - head/sys/netgraph/netflow X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 08 Oct 2008 13:19:57 -0000 Alexander Motin wrote: > Author: mav > Date: Wed Oct 8 10:37:07 2008 > New Revision: 183693 > URL: http://svn.freebsd.org/changeset/base/183693 > > Log: > Add ability to generate egress netflow instead or in addition to ingress. > Use mbuf tagging for accounted packets to not account packets twice when > both ingress and egress netflow enabled. > To keep compatibility new "setconfig" message added to control new > functionality. By default node works as before, doing only ingress > accounting without using mbuf tags. > Thanks, Alexander! I dreamed to get rid a complex construction for egress accounting. -- Dixi. Sem. From owner-svn-src-head@FreeBSD.ORG Wed Oct 8 13:20:07 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 09A7F1065711; Wed, 8 Oct 2008 13:20:03 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F14808FC0A; Wed, 8 Oct 2008 13:20:02 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m98DK2wi034556; Wed, 8 Oct 2008 13:20:02 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m98DK2uY034555; Wed, 8 Oct 2008 13:20:02 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200810081320.m98DK2uY034555@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Wed, 8 Oct 2008 13:20: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: r183697 - head/share X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 08 Oct 2008 13:20:07 -0000 Author: des Date: Wed Oct 8 13:20:02 2008 New Revision: 183697 URL: http://svn.freebsd.org/changeset/base/183697 Log: Whitespace nit MFC after: 1 week Modified: head/share/Makefile Modified: head/share/Makefile ============================================================================== --- head/share/Makefile Wed Oct 8 13:16:20 2008 (r183696) +++ head/share/Makefile Wed Oct 8 13:20:02 2008 (r183697) @@ -33,7 +33,7 @@ _snmp= snmp .endif .if ${MK_DICT} != "no" -_dict= dict +_dict= dict .endif .if ${MK_EXAMPLES} != "no" From owner-svn-src-head@FreeBSD.ORG Wed Oct 8 13:28:02 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA6EC1065689; Wed, 8 Oct 2008 13:28:02 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 991CA8FC25; Wed, 8 Oct 2008 13:28:02 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m98DS2an034726; Wed, 8 Oct 2008 13:28:02 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m98DS2u0034724; Wed, 8 Oct 2008 13:28:02 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200810081328.m98DS2u0034724@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Wed, 8 Oct 2008 13:28: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: r183698 - in head/etc: . mtree X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 08 Oct 2008 13:28:02 -0000 Author: des Date: Wed Oct 8 13:28:02 2008 New Revision: 183698 URL: http://svn.freebsd.org/changeset/base/183698 Log: Create separate cat directories for en.UTF-8. This, together with r183697, allows users in en.UTF-8 locales to see non-ascii characters in man pages. MFC after: 1 week Modified: head/etc/Makefile head/etc/mtree/BSD.usr.dist Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Wed Oct 8 13:20:02 2008 (r183697) +++ head/etc/Makefile Wed Oct 8 13:28:02 2008 (r183698) @@ -251,6 +251,7 @@ distrib-dirs: .endif cd ${DESTDIR}/; rm -f ${DESTDIR}/sys; ln -s usr/src/sys sys cd ${DESTDIR}/usr/share/man/en.ISO8859-1; ln -sf ../man* . + cd ${DESTDIR}/usr/share/man/en.UTF-8; ln -sf ../man* . cd ${DESTDIR}/usr/share/man; \ set - `grep "^[a-zA-Z]" ${.CURDIR}/man.alias`; \ while [ $$# -gt 0 ] ; \ Modified: head/etc/mtree/BSD.usr.dist ============================================================================== --- head/etc/mtree/BSD.usr.dist Wed Oct 8 13:20:02 2008 (r183697) +++ head/etc/mtree/BSD.usr.dist Wed Oct 8 13:28:02 2008 (r183698) @@ -740,6 +740,46 @@ cat9 .. .. + en.UTF-8 uname=root + cat1 + .. + cat1aout + .. + cat2 + .. + cat3 + .. + cat4 + amd64 + .. + arm + .. + i386 + .. + powerpc + .. + sparc64 + .. + .. + cat5 + .. + cat6 + .. + cat7 + .. + cat8 + amd64 + .. + i386 + .. + powerpc + .. + sparc64 + .. + .. + cat9 + .. + .. ja uname=root cat1 .. From owner-svn-src-head@FreeBSD.ORG Wed Oct 8 13:53:47 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 87614106568F; Wed, 8 Oct 2008 13:53:47 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 766148FC18; Wed, 8 Oct 2008 13:53:47 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m98DrlXT035178; Wed, 8 Oct 2008 13:53:47 GMT (envelope-from phk@svn.freebsd.org) Received: (from phk@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m98DrlR6035176; Wed, 8 Oct 2008 13:53:47 GMT (envelope-from phk@svn.freebsd.org) Message-Id: <200810081353.m98DrlR6035176@svn.freebsd.org> From: Poul-Henning Kamp Date: Wed, 8 Oct 2008 13:53: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: r183699 - 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: Wed, 08 Oct 2008 13:53:47 -0000 Author: phk Date: Wed Oct 8 13:53:47 2008 New Revision: 183699 URL: http://svn.freebsd.org/changeset/base/183699 Log: Quirks for SDS-infrared.com "Hotfind-D" camera. PR: 127943 Modified: head/sys/dev/usb/umass.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/umass.c ============================================================================== --- head/sys/dev/usb/umass.c Wed Oct 8 13:28:02 2008 (r183698) +++ head/sys/dev/usb/umass.c Wed Oct 8 13:53:47 2008 (r183699) @@ -610,6 +610,10 @@ static struct umass_devdescr_t umass_dev UMASS_PROTO_SCSI, NO_QUIRKS }, + { USB_VENDOR_ONSPEC, USB_PRODUCT_ONSPEC_SDS_HOTFIND_D, RID_WILDCARD, + UMASS_PROTO_SCSI | UMASS_PROTO_BBB, + NO_GETMAXLUN | NO_SYNCHRONIZE_CACHE + }, { USB_VENDOR_ONSPEC, USB_PRODUCT_ONSPEC_MDCFE_B_CF_READER, RID_WILDCARD, UMASS_PROTO_SCSI, NO_QUIRKS Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Wed Oct 8 13:28:02 2008 (r183698) +++ head/sys/dev/usb/usbdevs Wed Oct 8 13:53:47 2008 (r183699) @@ -1855,6 +1855,7 @@ product OMNIVISION OV511 0x0511 OV511 Ca product OMNIVISION OV511PLUS 0xa511 OV511+ Camera /* OnSpec Electronic, Inc. */ +product ONSPEC SDS_HOTFIND_D 0x0400 SDS-infrared.com Hotfind-D Infrared Camera product ONSPEC MDCFE_B_CF_READER 0xa000 MDCFE-B USB CF Reader product ONSPEC CFMS_RW 0xa001 SIIG/Datafab Memory Stick+CF Reader/Writer product ONSPEC READER 0xa003 Datafab-based Reader From owner-svn-src-head@FreeBSD.ORG Wed Oct 8 13:59:23 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3F13C1065692; Wed, 8 Oct 2008 13:59:23 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 14F4E8FC21; Wed, 8 Oct 2008 13:59:23 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m98DxMMv035325; Wed, 8 Oct 2008 13:59:22 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m98DxMvQ035324; Wed, 8 Oct 2008 13:59:22 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200810081359.m98DxMvQ035324@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Wed, 8 Oct 2008 13: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: r183700 - head/share/tmac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 08 Oct 2008 13:59:23 -0000 Author: des Date: Wed Oct 8 13:59:22 2008 New Revision: 183700 URL: http://svn.freebsd.org/changeset/base/183700 Log: This directory has been empty since 1997. MFC after: 1 week Deleted: head/share/tmac/ From owner-svn-src-head@FreeBSD.ORG Wed Oct 8 14:45:07 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AF976106569A; Wed, 8 Oct 2008 14:45:07 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9D1568FC1D; Wed, 8 Oct 2008 14:45:07 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m98Ej7hx036305; Wed, 8 Oct 2008 14:45:07 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m98Ej7X5036304; Wed, 8 Oct 2008 14:45:07 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200810081445.m98Ej7X5036304@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Wed, 8 Oct 2008 14:45: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: r183701 - in head/contrib/groff: devX100 devX100-12 devX75 devX75-12 devascii devcp1047 devdvi devhtml devlatin1 devlbp devlj4 devps devutf8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 08 Oct 2008 14:45:07 -0000 Author: des Date: Wed Oct 8 14:45:07 2008 New Revision: 183701 URL: http://svn.freebsd.org/changeset/base/183701 Log: These directories have been empty since 2001, and are not present in the vendor tree. MFC after: 1 week Deleted: head/contrib/groff/devX100/ head/contrib/groff/devX100-12/ head/contrib/groff/devX75/ head/contrib/groff/devX75-12/ head/contrib/groff/devascii/ head/contrib/groff/devcp1047/ head/contrib/groff/devdvi/ head/contrib/groff/devhtml/ head/contrib/groff/devlatin1/ head/contrib/groff/devlbp/ head/contrib/groff/devlj4/ head/contrib/groff/devps/ head/contrib/groff/devutf8/ From owner-svn-src-head@FreeBSD.ORG Wed Oct 8 16:46:36 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 99757106568F; Wed, 8 Oct 2008 16:46:36 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 883C78FC0A; Wed, 8 Oct 2008 16:46:36 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m98GkaAh038683; Wed, 8 Oct 2008 16:46:36 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m98GkaUK038682; Wed, 8 Oct 2008 16:46:36 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <200810081646.m98GkaUK038682@svn.freebsd.org> From: Hiroki Sato Date: Wed, 8 Oct 2008 16:46: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: r183703 - head/release/doc/en_US.ISO8859-1/relnotes X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 08 Oct 2008 16:46:36 -0000 Author: hrs Date: Wed Oct 8 16:46:36 2008 New Revision: 183703 URL: http://svn.freebsd.org/changeset/base/183703 Log: OpenSSH has been upgraded to 5.1p1. Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.sgml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.sgml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.sgml Wed Oct 8 16:44:35 2008 (r183702) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.sgml Wed Oct 8 16:46:36 2008 (r183703) @@ -445,6 +445,9 @@ ncurses has been updated from 5.6-20061217 to 5.6-20080503. + OpenSSH has been updated + from 4.5p1 to 5.1p1. + OpenPAM has been updated from the Figwort release to the Hydrangea release. From owner-svn-src-head@FreeBSD.ORG Wed Oct 8 17:17:50 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 72D04106568A; Wed, 8 Oct 2008 17:17:50 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id 2F7DA8FC15; Wed, 8 Oct 2008 17:17:50 +0000 (UTC) (envelope-from des@des.no) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 7C5452049; Wed, 8 Oct 2008 19:00:44 +0200 (CEST) Received: by ds4.des.no (Postfix, from userid 1001) id 67475844E6; Wed, 8 Oct 2008 19:00:44 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Hiroki Sato References: <200810081646.m98GkaUK038682@svn.freebsd.org> Date: Wed, 08 Oct 2008 19:00:44 +0200 In-Reply-To: <200810081646.m98GkaUK038682@svn.freebsd.org> (Hiroki Sato's message of "Wed, 8 Oct 2008 16:46:36 +0000 (UTC)") Message-ID: <86hc7nqawz.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r183703 - head/release/doc/en_US.ISO8859-1/relnotes X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 08 Oct 2008 17:17:50 -0000 Hiroki Sato writes: > + OpenSSH has been up= dated > + from 4.5p1 to 5.1p1. Actually, there's quite a bit more to say about this - see UPDATING. BTW, shouldn't the HEAD relnotes only document changes relative to the latest release? DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@FreeBSD.ORG Wed Oct 8 17:35:42 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2ADB610656B1; Wed, 8 Oct 2008 17:35:42 +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 D26518FC1F; Wed, 8 Oct 2008 17:35:41 +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 m98HZf6P039559; Wed, 8 Oct 2008 17:35:41 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m98HZfoI039553; Wed, 8 Oct 2008 17:35:41 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200810081735.m98HZfoI039553@svn.freebsd.org> From: Alexander Motin Date: Wed, 8 Oct 2008 17:35:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r183704 - head/sys/dev/mmc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 08 Oct 2008 17:35:42 -0000 Author: mav Date: Wed Oct 8 17:35:41 2008 New Revision: 183704 URL: http://svn.freebsd.org/changeset/base/183704 Log: Set of mmc layer improvements: - add MMC support. - add SDHC support. - add 4 and 8 bit bus width support. - add High Speed bus timing support. Modified: head/sys/dev/mmc/bridge.h head/sys/dev/mmc/mmc.c head/sys/dev/mmc/mmcbrvar.h head/sys/dev/mmc/mmcreg.h head/sys/dev/mmc/mmcsd.c head/sys/dev/mmc/mmcvar.h Modified: head/sys/dev/mmc/bridge.h ============================================================================== --- head/sys/dev/mmc/bridge.h Wed Oct 8 16:46:36 2008 (r183703) +++ head/sys/dev/mmc/bridge.h Wed Oct 8 17:35:41 2008 (r183704) @@ -104,6 +104,10 @@ enum mmc_bus_width { bus_width_1 = 0, bus_width_4 = 2, bus_width_8 = 3 }; +enum mmc_bus_timing { + bus_timing_normal = 0, bus_timing_hs +}; + struct mmc_ios { uint32_t clock; /* Speed of the clock in Hz to move data */ enum mmc_vdd vdd; /* Voltage to apply to the power pins/ */ @@ -111,6 +115,7 @@ struct mmc_ios { enum mmc_chip_select chip_select; enum mmc_bus_width bus_width; enum mmc_power_mode power_mode; + enum mmc_bus_timing timing; }; enum mmc_card_mode { @@ -125,6 +130,7 @@ struct mmc_host { uint32_t caps; #define MMC_CAP_4_BIT_DATA (1 << 0) /* Can do 4-bit data transfers */ #define MMC_CAP_8_BIT_DATA (1 << 1) /* Can do 8-bit data transfers */ +#define MMC_CAP_HSPEED (1 << 2) /* Can do High Speed transfers */ enum mmc_card_mode mode; struct mmc_ios ios; /* Current state of the host */ }; Modified: head/sys/dev/mmc/mmc.c ============================================================================== --- head/sys/dev/mmc/mmc.c Wed Oct 8 16:46:36 2008 (r183703) +++ head/sys/dev/mmc/mmc.c Wed Oct 8 17:35:41 2008 (r183704) @@ -61,6 +61,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -82,11 +83,19 @@ struct mmc_softc { struct mmc_ivars { uint32_t raw_cid[4]; /* Raw bits of the CID */ uint32_t raw_csd[4]; /* Raw bits of the CSD */ + uint32_t raw_scr[2]; /* Raw bits of the SCR */ + uint8_t raw_ext_csd[512]; /* Raw bits of the EXT_CSD */ uint16_t rca; enum mmc_card_mode mode; struct mmc_cid cid; /* cid decoded */ struct mmc_csd csd; /* csd decoded */ + struct mmc_scr scr; /* scr decoded */ u_char read_only; /* True when the device is read-only */ + u_char bus_width; /* Bus width to use */ + u_char timing; /* Bus timing support */ + u_char high_cap; /* High Capacity card */ + uint32_t tran_speed; /* Max speed in normal mode */ + uint32_t hs_tran_speed; /* Max speed in high speed mode */ }; #define CMD_RETRIES 3 @@ -111,6 +120,11 @@ static int mmc_wait_for_cmd(struct mmc_s int retries); static int mmc_wait_for_command(struct mmc_softc *sc, uint32_t opcode, uint32_t arg, uint32_t flags, uint32_t *resp, int retries); +static int mmc_select_card(struct mmc_softc *sc, uint16_t rca); +static int mmc_set_bus_width(struct mmc_softc *sc, uint16_t rca, int width); +static int mmc_app_send_scr(struct mmc_softc *sc, uint16_t rca, uint32_t *rawscr); +static void mmc_app_decode_scr(uint32_t *raw_scr, struct mmc_scr *scr); +static int mmc_send_ext_csd(struct mmc_softc *sc, uint8_t *rawextcsd); static void mmc_ms_delay(int ms) @@ -173,6 +187,7 @@ static int mmc_acquire_bus(device_t busdev, device_t dev) { struct mmc_softc *sc; + struct mmc_ivars *ivar; int err; int rca; @@ -195,21 +210,26 @@ mmc_acquire_bus(device_t busdev, device_ */ rca = mmc_get_rca(dev); if (sc->last_rca != rca) { - mmc_wait_for_command(sc, MMC_SELECT_CARD, rca << 16, - MMC_RSP_R1 | MMC_CMD_AC, NULL, CMD_RETRIES); + mmc_select_card(sc, rca); sc->last_rca = rca; + /* Prepare bus width for the new card. */ + ivar = device_get_ivars(dev); + device_printf(busdev, + "setting bus width to %d bits\n", + (ivar->bus_width == bus_width_4)?4: + (ivar->bus_width == bus_width_8)?8:1); + mmc_set_bus_width(sc, rca, ivar->bus_width); + mmcbr_set_bus_width(busdev, ivar->bus_width); + mmcbr_update_ios(busdev); } - /* XXX should set bus width here? */ } else { /* * If there's a card selected, stand down. */ if (sc->last_rca != 0) { - mmc_wait_for_command(sc, MMC_SELECT_CARD, 0, - MMC_RSP_R1 | MMC_CMD_AC, NULL, CMD_RETRIES); + mmc_select_card(sc, 0); sc->last_rca = 0; } - /* XXX should set bus width here? */ } return (0); @@ -444,6 +464,22 @@ mmc_send_op_cond(struct mmc_softc *sc, u return (err); } +static int +mmc_send_if_cond(struct mmc_softc *sc, uint8_t vhs) +{ + struct mmc_command cmd; + int err; + + memset(&cmd, 0, sizeof(cmd)); + cmd.opcode = SD_SEND_IF_COND; + cmd.arg = (vhs << 8) + 0xAA; + cmd.flags = MMC_RSP_R7 | MMC_CMD_BCR; + cmd.data = NULL; + + err = mmc_wait_for_cmd(sc, &cmd, CMD_RETRIES); + return (err); +} + static void mmc_power_up(struct mmc_softc *sc) { @@ -460,6 +496,7 @@ mmc_power_up(struct mmc_softc *sc) mmc_ms_delay(1); mmcbr_set_clock(dev, mmcbr_get_f_min(sc->dev)); + mmcbr_set_timing(dev, bus_timing_normal); mmcbr_set_power_mode(dev, power_on); mmcbr_update_ios(dev); mmc_ms_delay(2); @@ -475,9 +512,207 @@ mmc_power_down(struct mmc_softc *sc) mmcbr_set_bus_width(dev, bus_width_1); mmcbr_set_power_mode(dev, power_off); mmcbr_set_clock(dev, 0); + mmcbr_set_timing(dev, bus_timing_normal); mmcbr_update_ios(dev); } +static int +mmc_select_card(struct mmc_softc *sc, uint16_t rca) +{ + return (mmc_wait_for_command(sc, MMC_SELECT_CARD, ((uint32_t)rca) << 16, + MMC_RSP_R1B | MMC_CMD_AC, NULL, CMD_RETRIES)); +} + +static int +mmc_switch(struct mmc_softc *sc, uint8_t set, uint8_t index, uint8_t value) +{ + struct mmc_command cmd; + int err; + + cmd.opcode = MMC_SWITCH_FUNC; + cmd.arg = (MMC_SWITCH_FUNC_WR << 24) | + (index << 16) | + (value << 8) | + set; + cmd.flags = MMC_RSP_R1B | MMC_CMD_AC; + cmd.data = NULL; + err = mmc_wait_for_cmd(sc, &cmd, 0); + return (err); +} + +static int +mmc_sd_switch(struct mmc_softc *sc, uint8_t mode, uint8_t grp, uint8_t value, uint8_t *res) +{ + int err; + struct mmc_command cmd; + struct mmc_data data; + + memset(&cmd, 0, sizeof(struct mmc_command)); + memset(&data, 0, sizeof(struct mmc_data)); + + memset(res, 0, 64); + cmd.opcode = SD_SWITCH_FUNC; + cmd.flags = MMC_RSP_R1 | MMC_CMD_ADTC; + cmd.arg = mode << 31; + cmd.arg |= 0x00FFFFFF; + cmd.arg &= ~(0xF << grp); + cmd.arg |= value << grp; + cmd.data = &data; + + data.data = res; + data.len = 64; + data.flags = MMC_DATA_READ; + + err = mmc_wait_for_cmd(sc, &cmd, CMD_RETRIES); + return (err); +} + +static int +mmc_set_bus_width(struct mmc_softc *sc, uint16_t rca, int width) +{ + int err; + + if (mmcbr_get_mode(sc->dev) == mode_sd) { + struct mmc_command cmd; + + memset(&cmd, 0, sizeof(struct mmc_command)); + cmd.opcode = ACMD_SET_BUS_WIDTH; + cmd.flags = MMC_RSP_R1 | MMC_CMD_AC; + switch (width) { + case bus_width_1: + cmd.arg = SD_BUS_WIDTH_1; + break; + case bus_width_4: + cmd.arg = SD_BUS_WIDTH_4; + break; + default: + return (MMC_ERR_INVALID); + } + err = mmc_wait_for_app_cmd(sc, rca, &cmd, CMD_RETRIES); + } else { + uint8_t value; + + switch (width) { + case bus_width_1: + value = EXT_CSD_BUS_WIDTH_1; + break; + case bus_width_4: + value = EXT_CSD_BUS_WIDTH_4; + break; + case bus_width_8: + value = EXT_CSD_BUS_WIDTH_8; + break; + default: + return (MMC_ERR_INVALID); + } + err = mmc_switch(sc, EXT_CSD_CMD_SET_NORMAL, EXT_CSD_BUS_WIDTH, value); + } + return (err); +} + +static int +mmc_set_timing(struct mmc_softc *sc, int timing) +{ + int err; + uint8_t value; + + switch (timing) { + case bus_timing_normal: + value = 0; + break; + case bus_timing_hs: + value = 1; + break; + default: + return (MMC_ERR_INVALID); + } + if (mmcbr_get_mode(sc->dev) == mode_sd) { + u_char switch_res[64]; + + err = mmc_sd_switch(sc, 1, 0, value, switch_res); + } else { + err = mmc_switch(sc, EXT_CSD_CMD_SET_NORMAL, + EXT_CSD_HS_TIMING, value); + } + return (err); +} + +static int +mmc_test_bus_width(struct mmc_softc *sc) +{ + struct mmc_command cmd; + struct mmc_data data; + int err; + uint8_t buf[8]; + uint8_t p8[8] = { 0x55, 0xAA, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + uint8_t p8ok[8] = { 0xAA, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + uint8_t p4[4] = { 0x5A, 0x00, 0x00, 0x00, }; + uint8_t p4ok[4] = { 0xA5, 0x00, 0x00, 0x00, }; + + if (mmcbr_get_caps(sc->dev) & MMC_CAP_8_BIT_DATA) { + mmcbr_set_bus_width(sc->dev, bus_width_8); + mmcbr_update_ios(sc->dev); + + cmd.opcode = MMC_BUSTEST_W; + cmd.arg = 0; + cmd.flags = MMC_RSP_R1 | MMC_CMD_ADTC; + cmd.data = &data; + + data.data = p8; + data.len = 8; + data.flags = MMC_DATA_WRITE; + mmc_wait_for_cmd(sc, &cmd, 0); + + cmd.opcode = MMC_BUSTEST_R; + cmd.arg = 0; + cmd.flags = MMC_RSP_R1 | MMC_CMD_ADTC; + cmd.data = &data; + + data.data = buf; + data.len = 8; + data.flags = MMC_DATA_READ; + err = mmc_wait_for_cmd(sc, &cmd, 0); + + mmcbr_set_bus_width(sc->dev, bus_width_1); + mmcbr_update_ios(sc->dev); + + if (err == MMC_ERR_NONE && memcmp(buf, p8ok, 8) == 0) + return (bus_width_8); + } + + if (mmcbr_get_caps(sc->dev) & MMC_CAP_4_BIT_DATA) { + mmcbr_set_bus_width(sc->dev, bus_width_4); + mmcbr_update_ios(sc->dev); + + cmd.opcode = MMC_BUSTEST_W; + cmd.arg = 0; + cmd.flags = MMC_RSP_R1 | MMC_CMD_ADTC; + cmd.data = &data; + + data.data = p4; + data.len = 4; + data.flags = MMC_DATA_WRITE; + mmc_wait_for_cmd(sc, &cmd, 0); + + cmd.opcode = MMC_BUSTEST_R; + cmd.arg = 0; + cmd.flags = MMC_RSP_R1 | MMC_CMD_ADTC; + cmd.data = &data; + + data.data = buf; + data.len = 4; + data.flags = MMC_DATA_READ; + err = mmc_wait_for_cmd(sc, &cmd, 0); + + mmcbr_set_bus_width(sc->dev, bus_width_1); + mmcbr_update_ios(sc->dev); + + if (err == MMC_ERR_NONE && memcmp(buf, p4ok, 4) == 0) + return (bus_width_4); + } + return (bus_width_1); +} + static uint32_t mmc_get_bits(uint32_t *bits, int start, int size) { @@ -506,8 +741,14 @@ mmc_decode_cid(int is_sd, uint32_t *raw_ cid->mdt_year = mmc_get_bits(raw_cid, 12, 8) + 2001; cid->mdt_month = mmc_get_bits(raw_cid, 8, 4); } else { - /* XXX write me */ - panic("write mmc cid decoder"); + cid->mid = mmc_get_bits(raw_cid, 120, 8); + cid->oid = mmc_get_bits(raw_cid, 104, 8); + for (i = 0; i < 6; i++) + cid->pnm[i] = mmc_get_bits(raw_cid, 96 - i * 8, 8); + cid->prv = mmc_get_bits(raw_cid, 48, 8); + cid->psn = mmc_get_bits(raw_cid, 16, 32); + cid->mdt_month = mmc_get_bits(raw_cid, 12, 4); + cid->mdt_year = mmc_get_bits(raw_cid, 8, 4) + 1997; } } @@ -563,12 +804,82 @@ mmc_decode_csd(int is_sd, uint32_t *raw_ csd->write_bl_len = 1 << mmc_get_bits(raw_csd, 22, 4); csd->write_bl_partial = mmc_get_bits(raw_csd, 21, 1); } else if (v == 1) { - panic("Write SDHC CSD parser"); + m = mmc_get_bits(raw_csd, 115, 4); + e = mmc_get_bits(raw_csd, 112, 3); + csd->tacc = exp[e] * mant[m] + 9 / 10; + csd->nsac = mmc_get_bits(raw_csd, 104, 8) * 100; + m = mmc_get_bits(raw_csd, 99, 4); + e = mmc_get_bits(raw_csd, 96, 3); + csd->tran_speed = exp[e] * 10000 * mant[m]; + csd->ccc = mmc_get_bits(raw_csd, 84, 12); + csd->read_bl_len = 1 << mmc_get_bits(raw_csd, 80, 4); + csd->read_bl_partial = mmc_get_bits(raw_csd, 79, 1); + csd->write_blk_misalign = mmc_get_bits(raw_csd, 78, 1); + csd->read_blk_misalign = mmc_get_bits(raw_csd, 77, 1); + csd->dsr_imp = mmc_get_bits(raw_csd, 76, 1); + csd->capacity = ((uint64_t)mmc_get_bits(raw_csd, 48, 22) + 1) * + 512 * 1024; + csd->erase_blk_en = mmc_get_bits(raw_csd, 46, 1); + csd->sector_size = mmc_get_bits(raw_csd, 39, 7); + csd->wp_grp_size = mmc_get_bits(raw_csd, 32, 7); + csd->wp_grp_enable = mmc_get_bits(raw_csd, 31, 1); + csd->r2w_factor = 1 << mmc_get_bits(raw_csd, 26, 3); + csd->write_bl_len = 1 << mmc_get_bits(raw_csd, 22, 4); + csd->write_bl_partial = mmc_get_bits(raw_csd, 21, 1); } else panic("unknown SD CSD version"); } else { - panic("Write a MMC CSD parser"); + csd->csd_structure = mmc_get_bits(raw_csd, 126, 2); + csd->spec_vers = mmc_get_bits(raw_csd, 122, 4); + m = mmc_get_bits(raw_csd, 115, 4); + e = mmc_get_bits(raw_csd, 112, 3); + csd->tacc = exp[e] * mant[m] + 9 / 10; + csd->nsac = mmc_get_bits(raw_csd, 104, 8) * 100; + m = mmc_get_bits(raw_csd, 99, 4); + e = mmc_get_bits(raw_csd, 96, 3); + csd->tran_speed = exp[e] * 10000 * mant[m]; + csd->ccc = mmc_get_bits(raw_csd, 84, 12); + csd->read_bl_len = 1 << mmc_get_bits(raw_csd, 80, 4); + csd->read_bl_partial = mmc_get_bits(raw_csd, 79, 1); + csd->write_blk_misalign = mmc_get_bits(raw_csd, 78, 1); + csd->read_blk_misalign = mmc_get_bits(raw_csd, 77, 1); + csd->dsr_imp = mmc_get_bits(raw_csd, 76, 1); + csd->vdd_r_curr_min = cur_min[mmc_get_bits(raw_csd, 59, 3)]; + csd->vdd_r_curr_max = cur_max[mmc_get_bits(raw_csd, 56, 3)]; + csd->vdd_w_curr_min = cur_min[mmc_get_bits(raw_csd, 53, 3)]; + csd->vdd_w_curr_max = cur_max[mmc_get_bits(raw_csd, 50, 3)]; + m = mmc_get_bits(raw_csd, 62, 12); + e = mmc_get_bits(raw_csd, 47, 3); + csd->capacity = ((1 + m) << (e + 2)) * csd->read_bl_len; +// csd->erase_blk_en = mmc_get_bits(raw_csd, 46, 1); +// csd->sector_size = mmc_get_bits(raw_csd, 39, 7); + csd->wp_grp_size = mmc_get_bits(raw_csd, 32, 5); + csd->wp_grp_enable = mmc_get_bits(raw_csd, 31, 1); + csd->r2w_factor = 1 << mmc_get_bits(raw_csd, 26, 3); + csd->write_bl_len = 1 << mmc_get_bits(raw_csd, 22, 4); + csd->write_bl_partial = mmc_get_bits(raw_csd, 21, 1); + } +} + +static void +mmc_app_decode_scr(uint32_t *raw_scr, struct mmc_scr *scr) +{ + unsigned int scr_struct; + uint32_t tmp[4]; + + tmp[3] = raw_scr[1]; + tmp[2] = raw_scr[0]; + + memset(scr, 0, sizeof(*scr)); + + scr_struct = mmc_get_bits(tmp, 60, 4); + if (scr_struct != 0) { + printf("Unrecognised SCR structure version %d\n", + scr_struct); + return; } + scr->sda_vsn = mmc_get_bits(tmp, 56, 4); + scr->bus_widths = mmc_get_bits(tmp, 48, 4); } static int @@ -602,6 +913,70 @@ mmc_send_csd(struct mmc_softc *sc, uint1 } static int +mmc_app_send_scr(struct mmc_softc *sc, uint16_t rca, uint32_t *rawscr) +{ + int err; + struct mmc_command cmd; + struct mmc_data data; + + memset(&cmd, 0, sizeof(struct mmc_command)); + memset(&data, 0, sizeof(struct mmc_data)); + + memset(rawscr, 0, 8); + cmd.opcode = ACMD_SEND_SCR; + cmd.flags = MMC_RSP_R1 | MMC_CMD_ADTC; + cmd.arg = 0; + cmd.data = &data; + + data.data = rawscr; + data.len = 8; + data.flags = MMC_DATA_READ; + + err = mmc_wait_for_app_cmd(sc, rca, &cmd, CMD_RETRIES); + rawscr[0] = be32toh(rawscr[0]); + rawscr[1] = be32toh(rawscr[1]); + return (err); +} + +static int +mmc_send_ext_csd(struct mmc_softc *sc, uint8_t *rawextcsd) +{ + int err; + struct mmc_command cmd; + struct mmc_data data; + + memset(&cmd, 0, sizeof(struct mmc_command)); + memset(&data, 0, sizeof(struct mmc_data)); + + memset(rawextcsd, 0, 512); + cmd.opcode = MMC_SEND_EXT_CSD; + cmd.flags = MMC_RSP_R1 | MMC_CMD_ADTC; + cmd.arg = 0; + cmd.data = &data; + + data.data = rawextcsd; + data.len = 512; + data.flags = MMC_DATA_READ; + + err = mmc_wait_for_cmd(sc, &cmd, CMD_RETRIES); + return (err); +} + +static int +mmc_set_relative_addr(struct mmc_softc *sc, uint16_t resp) +{ + struct mmc_command cmd; + int err; + + cmd.opcode = MMC_SET_RELATIVE_ADDR; + cmd.arg = resp << 16; + cmd.flags = MMC_RSP_R6 | MMC_CMD_BCR; + cmd.data = NULL; + err = mmc_wait_for_cmd(sc, &cmd, 0); + return (err); +} + +static int mmc_send_relative_addr(struct mmc_softc *sc, uint32_t *resp) { struct mmc_command cmd; @@ -623,6 +998,8 @@ mmc_discover_cards(struct mmc_softc *sc) int err; uint32_t resp; device_t child; + uint16_t rca = 2; + u_char switch_res[64]; while (1) { ivar = malloc(sizeof(struct mmc_ivars), M_DEVBUF, @@ -636,22 +1013,75 @@ mmc_discover_cards(struct mmc_softc *sc) device_printf(sc->dev, "Error reading CID %d\n", err); break; } - if (mmcbr_get_mode(sc->dev) == mode_sd) { - ivar->mode = mode_sd; + if (mmcbr_get_ro(sc->dev)) + ivar->read_only = 1; + ivar->bus_width = bus_width_1; + ivar->mode = mmcbr_get_mode(sc->dev); + if (ivar->mode == mode_sd) { mmc_decode_cid(1, ivar->raw_cid, &ivar->cid); mmc_send_relative_addr(sc, &resp); ivar->rca = resp >> 16; - if (mmcbr_get_ro(sc->dev)) - ivar->read_only = 1; + /* Get card CSD. */ mmc_send_csd(sc, ivar->rca, ivar->raw_csd); mmc_decode_csd(1, ivar->raw_csd, &ivar->csd); - printf("SD CARD: %lld bytes\n", (long long) - ivar->csd.capacity); + if (ivar->csd.csd_structure > 0) + ivar->high_cap = 1; + ivar->tran_speed = ivar->csd.tran_speed; + /* Get card SCR. Card must be selected to fetch it. */ + mmc_select_card(sc, ivar->rca); + mmc_app_send_scr(sc, ivar->rca, ivar->raw_scr); + mmc_app_decode_scr(ivar->raw_scr, &ivar->scr); + /* Get card switch capabilities. */ + if ((ivar->scr.sda_vsn >= 1) && + (ivar->csd.ccc & (1<<10))) { + mmc_sd_switch(sc, 0, 0, 0xF, switch_res); + if (switch_res[13] & 2) { + ivar->timing = bus_timing_hs; + ivar->hs_tran_speed = 50000000; + } + } + mmc_select_card(sc, 0); + /* Find max supported bus width. */ + if ((mmcbr_get_caps(sc->dev) & MMC_CAP_4_BIT_DATA) && + (ivar->scr.bus_widths & SD_SCR_BUS_WIDTH_4)) + ivar->bus_width = bus_width_4; + /* Add device. */ child = device_add_child(sc->dev, NULL, -1); device_set_ivars(child, ivar); return; } - panic("Write MMC card code here"); + mmc_decode_cid(0, ivar->raw_cid, &ivar->cid); + ivar->rca = rca++; + mmc_set_relative_addr(sc, ivar->rca); + /* Get card CSD. */ + mmc_send_csd(sc, ivar->rca, ivar->raw_csd); + mmc_decode_csd(0, ivar->raw_csd, &ivar->csd); + ivar->tran_speed = ivar->csd.tran_speed; + /* Only MMC >= 4.x cards support EXT_CSD. */ + if (ivar->csd.spec_vers >= 4) { + /* Card must be selected to fetch EXT_CSD. */ + mmc_select_card(sc, ivar->rca); + mmc_send_ext_csd(sc, ivar->raw_ext_csd); + /* Get card speed in high speed mode. */ + ivar->timing = bus_timing_hs; + if (((uint8_t *)(ivar->raw_ext_csd))[EXT_CSD_CARD_TYPE] + & EXT_CSD_CARD_TYPE_52) + ivar->hs_tran_speed = 52000000; + else if (((uint8_t *)(ivar->raw_ext_csd))[EXT_CSD_CARD_TYPE] + & EXT_CSD_CARD_TYPE_26) + ivar->hs_tran_speed = 26000000; + else + ivar->hs_tran_speed = ivar->tran_speed; + /* Find max supported bus width. */ + ivar->bus_width = mmc_test_bus_width(sc); + mmc_select_card(sc, 0); + } else { + ivar->bus_width = bus_width_1; + ivar->timing = bus_timing_normal; + } + /* Add device. */ + child = device_add_child(sc->dev, NULL, -1); + device_set_ivars(child, ivar); } free(ivar, M_DEVBUF); } @@ -661,6 +1091,7 @@ mmc_go_discovery(struct mmc_softc *sc) { uint32_t ocr; device_t dev; + int err; dev = sc->dev; if (mmcbr_get_power_mode(dev) != power_on) { @@ -671,7 +1102,9 @@ mmc_go_discovery(struct mmc_softc *sc) mmc_power_up(sc); mmcbr_set_bus_mode(dev, pushpull); mmc_idle_cards(sc); - if (mmc_send_app_op_cond(sc, 0, &ocr) != MMC_ERR_NONE) { + err = mmc_send_if_cond(sc, 1); + if (mmc_send_app_op_cond(sc, err?0:MMC_OCR_CCS, &ocr) != + MMC_ERR_NONE) { /* * Failed, try MMC */ @@ -697,9 +1130,11 @@ mmc_go_discovery(struct mmc_softc *sc) /* * Reselect the cards after we've idled them above. */ - if (mmcbr_get_mode(dev) == mode_sd) - mmc_send_app_op_cond(sc, mmcbr_get_ocr(dev), NULL); - else + if (mmcbr_get_mode(dev) == mode_sd) { + err = mmc_send_if_cond(sc, 1); + mmc_send_app_op_cond(sc, + (err?0:MMC_OCR_CCS)|mmcbr_get_ocr(dev), NULL); + } else mmc_send_op_cond(sc, mmcbr_get_ocr(dev), NULL); mmc_discover_cards(sc); @@ -712,22 +1147,47 @@ mmc_go_discovery(struct mmc_softc *sc) static int mmc_calculate_clock(struct mmc_softc *sc) { - int max_dtr = 0; + int max_dtr, max_hs_dtr, max_timing; int nkid, i, f_min, f_max; device_t *kids; + struct mmc_ivars *ivar; f_min = mmcbr_get_f_min(sc->dev); f_max = mmcbr_get_f_max(sc->dev); - max_dtr = f_max; + max_dtr = max_hs_dtr = f_max; + if ((mmcbr_get_caps(sc->dev) & MMC_CAP_HSPEED)) + max_timing = bus_timing_hs; + else + max_timing = bus_timing_normal; if (device_get_children(sc->dev, &kids, &nkid) != 0) panic("can't get children"); - for (i = 0; i < nkid; i++) - if (mmc_get_tran_speed(kids[i]) < max_dtr) - max_dtr = mmc_get_tran_speed(kids[i]); + for (i = 0; i < nkid; i++) { + ivar = device_get_ivars(kids[i]); + if (ivar->timing < max_timing) + max_timing = ivar->timing; + if (ivar->tran_speed < max_dtr) + max_dtr = ivar->tran_speed; + if (ivar->hs_tran_speed < max_dtr) + max_hs_dtr = ivar->hs_tran_speed; + } + for (i = 0; i < nkid; i++) { + ivar = device_get_ivars(kids[i]); + if (ivar->timing == bus_timing_normal) + continue; + mmc_select_card(sc, ivar->rca); + mmc_set_timing(sc, max_timing); + } + mmc_select_card(sc, 0); free(kids, M_TEMP); - device_printf(sc->dev, "setting transfer rate to %d.%03dMHz\n", - max_dtr / 1000000, (max_dtr / 1000) % 1000); - return (max_dtr); + if (max_timing == bus_timing_hs) + max_dtr = max_hs_dtr; + device_printf(sc->dev, "setting transfer rate to %d.%03dMHz%s\n", + max_dtr / 1000000, (max_dtr / 1000) % 1000, + (max_timing == bus_timing_hs)?" with high speed timing":""); + mmcbr_set_timing(sc->dev, max_timing); + mmcbr_set_clock(sc->dev, max_dtr); + mmcbr_update_ios(sc->dev); + return max_dtr; } static void @@ -741,8 +1201,7 @@ mmc_scan(struct mmc_softc *sc) if (mmcbr_get_power_mode(dev) == power_on) mmc_rescan_cards(sc); mmc_go_discovery(sc); - mmcbr_set_clock(dev, mmc_calculate_clock(sc)); - mmcbr_update_ios(dev); + mmc_calculate_clock(sc); mmc_release_bus(dev, dev); /* XXX probe/attach/detach children? */ @@ -774,6 +1233,9 @@ mmc_read_ivar(device_t bus, device_t chi case MMC_IVAR_READ_ONLY: *(int *)result = ivar->read_only; break; + case MMC_IVAR_HIGH_CAP: + *(int *)result = ivar->high_cap; + break; } return (0); } Modified: head/sys/dev/mmc/mmcbrvar.h ============================================================================== --- head/sys/dev/mmc/mmcbrvar.h Wed Oct 8 16:46:36 2008 (r183703) +++ head/sys/dev/mmc/mmcbrvar.h Wed Oct 8 17:35:41 2008 (r183704) @@ -71,6 +71,7 @@ enum mmcbr_device_ivars { MMCBR_IVAR_POWER_MODE, MMCBR_IVAR_VDD, MMCBR_IVAR_CAPS, + MMCBR_IVAR_TIMING, // MMCBR_IVAR_, }; @@ -92,6 +93,7 @@ MMCBR_ACCESSOR(ocr, OCR, int) MMCBR_ACCESSOR(power_mode, POWER_MODE, int) MMCBR_ACCESSOR(vdd, VDD, int) MMCBR_ACCESSOR(caps, CAPS, int) +MMCBR_ACCESSOR(timing, TIMING, int) static int __inline mmcbr_update_ios(device_t dev) Modified: head/sys/dev/mmc/mmcreg.h ============================================================================== --- head/sys/dev/mmc/mmcreg.h Wed Oct 8 16:46:36 2008 (r183703) +++ head/sys/dev/mmc/mmcreg.h Wed Oct 8 17:35:41 2008 (r183704) @@ -86,7 +86,7 @@ struct mmc_command { #define MMC_RSP_R2 (MMC_RSP_PRESENT | MMC_RSP_136 | MMC_RSP_CRC) #define MMC_RSP_R3 (MMC_RSP_PRESENT) #define MMC_RSP_R6 (MMC_RSP_PRESENT | MMC_RSP_CRC) -/* R7 -- new in sd 2.0 */ +#define MMC_RSP_R7 (MMC_RSP_PRESENT | MMC_RSP_CRC) #define MMC_RSP(x) ((x) & MMC_RSP_MASK) uint32_t retries; uint32_t error; @@ -181,16 +181,23 @@ struct mmc_request { #define SD_SEND_RELATIVE_ADDR 3 #define MMC_SET_DSR 4 /* reserved: 5 */ +#define MMC_SWITCH_FUNC 6 +#define MMC_SWITCH_FUNC_CMDS 0 +#define MMC_SWITCH_FUNC_SET 1 +#define MMC_SWITCH_FUNC_CLR 2 +#define MMC_SWITCH_FUNC_WR 3 #define MMC_SELECT_CARD 7 #define MMC_DESELECT_CARD 7 -#define MMC_SEND_IF_COND 8 +#define MMC_SEND_EXT_CSD 8 +#define SD_SEND_IF_COND 8 #define MMC_SEND_CSD 9 #define MMC_SEND_CID 10 #define MMC_READ_DAT_UNTIL_STOP 11 #define MMC_STOP_TRANSMISSION 12 #define MMC_SEND_STATUS 13 - /* reserved: 14 */ +#define MMC_BUSTEST_R 14 #define MMC_GO_INACTIVE_STATE 15 +#define MMC_BUSTEST_W 19 /* Class 2: Block oriented read commands */ #define MMC_SET_BLOCKLEN 16 @@ -277,6 +284,37 @@ struct mmc_request { #define ACMD_SET_CLR_CARD_DETECT 42 #define ACMD_SEND_SCR 51 +/* + * EXT_CSD fields + */ + +#define EXT_CSD_BUS_WIDTH 183 /* R/W */ +#define EXT_CSD_HS_TIMING 185 /* R/W */ +#define EXT_CSD_CARD_TYPE 196 /* RO */ +#define EXT_CSD_REV 192 /* RO */ +#define EXT_CSD_SEC_CNT 212 /* RO, 4 bytes */ + +/* + * EXT_CSD field definitions + */ + +#define EXT_CSD_CMD_SET_NORMAL 1 +#define EXT_CSD_CMD_SET_SECURE 2 +#define EXT_CSD_CMD_SET_CPSECURE 4 + +#define EXT_CSD_CARD_TYPE_26 1 +#define EXT_CSD_CARD_TYPE_52 2 + +#define EXT_CSD_BUS_WIDTH_1 0 +#define EXT_CSD_BUS_WIDTH_4 1 +#define EXT_CSD_BUS_WIDTH_8 2 + +/* + * SD bus widths + */ +#define SD_BUS_WIDTH_1 0 +#define SD_BUS_WIDTH_4 2 + /* OCR bits */ /* @@ -328,6 +366,7 @@ struct mmc_cid { struct mmc_csd { uint8_t csd_structure; + uint8_t spec_vers; uint16_t ccc; uint16_t tacc; uint32_t nsac; @@ -351,6 +390,14 @@ struct mmc_csd wp_grp_enable:1; }; +struct mmc_scr +{ + unsigned char sda_vsn; + unsigned char bus_widths; +#define SD_SCR_BUS_WIDTH_1 (1<<0) +#define SD_SCR_BUS_WIDTH_4 (1<<2) +}; + /* * Older versions of the MMC standard had a variable sector size. However, * I've been able to find no old MMC or SD cards that have a non 512 Modified: head/sys/dev/mmc/mmcsd.c ============================================================================== --- head/sys/dev/mmc/mmcsd.c Wed Oct 8 16:46:36 2008 (r183703) +++ head/sys/dev/mmc/mmcsd.c Wed Oct 8 17:35:41 2008 (r183704) @@ -106,6 +106,7 @@ static int mmcsd_probe(device_t dev) { + device_quiet(dev); device_set_desc(dev, "MMC/SD Memory Card"); return (0); } @@ -256,7 +257,9 @@ mmcsd_task(void *arg) else cmd.opcode = MMC_WRITE_BLOCK; } - cmd.arg = block << 9; + cmd.arg = block; + if (!mmc_get_high_cap(dev)) + cmd.arg <<= 9; cmd.flags = MMC_RSP_R1 | MMC_CMD_ADTC; data.data = vaddr; data.mrq = &req; Modified: head/sys/dev/mmc/mmcvar.h ============================================================================== --- head/sys/dev/mmc/mmcvar.h Wed Oct 8 16:46:36 2008 (r183703) +++ head/sys/dev/mmc/mmcvar.h Wed Oct 8 17:35:41 2008 (r183704) @@ -62,6 +62,7 @@ enum mmc_device_ivars { MMC_IVAR_SECTOR_SIZE, MMC_IVAR_TRAN_SPEED, MMC_IVAR_READ_ONLY, + MMC_IVAR_HIGH_CAP, // MMC_IVAR_, }; @@ -77,5 +78,6 @@ MMC_ACCESSOR(rca, RCA, int) MMC_ACCESSOR(sector_size, SECTOR_SIZE, int) MMC_ACCESSOR(tran_speed, TRAN_SPEED, int) MMC_ACCESSOR(read_only, READ_ONLY, int) +MMC_ACCESSOR(high_cap, HIGH_CAP, int) #endif /* DEV_MMC_MMCVAR_H */ From owner-svn-src-head@FreeBSD.ORG Wed Oct 8 18:13:14 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D9F6106568F; Wed, 8 Oct 2008 18:13: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 5B8738FC14; Wed, 8 Oct 2008 18:13: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 m98IDE4p040220; Wed, 8 Oct 2008 18:13:14 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m98IDECv040219; Wed, 8 Oct 2008 18:13:14 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200810081813.m98IDECv040219@svn.freebsd.org> From: Alexander Motin Date: Wed, 8 Oct 2008 18:13: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: r183705 - head/sys/dev/mmc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 08 Oct 2008 18:13:14 -0000 Author: mav Date: Wed Oct 8 18:13:14 2008 New Revision: 183705 URL: http://svn.freebsd.org/changeset/base/183705 Log: Fix bit offset in mmc_sd_switch(). Modified: head/sys/dev/mmc/mmc.c Modified: head/sys/dev/mmc/mmc.c ============================================================================== --- head/sys/dev/mmc/mmc.c Wed Oct 8 17:35:41 2008 (r183704) +++ head/sys/dev/mmc/mmc.c Wed Oct 8 18:13:14 2008 (r183705) @@ -555,8 +555,8 @@ mmc_sd_switch(struct mmc_softc *sc, uint cmd.flags = MMC_RSP_R1 | MMC_CMD_ADTC; cmd.arg = mode << 31; cmd.arg |= 0x00FFFFFF; - cmd.arg &= ~(0xF << grp); - cmd.arg |= value << grp; + cmd.arg &= ~(0xF << (grp * 4)); + cmd.arg |= value << (grp * 4); cmd.data = &data; data.data = res; From owner-svn-src-head@FreeBSD.ORG Wed Oct 8 18:27:54 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D08D106569C; Wed, 8 Oct 2008 18:27:54 +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 5ADF48FC0C; Wed, 8 Oct 2008 18:27:54 +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 m98IRsRW040493; Wed, 8 Oct 2008 18:27:54 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m98IRseU040492; Wed, 8 Oct 2008 18:27:54 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200810081827.m98IRseU040492@svn.freebsd.org> From: Alexander Motin Date: Wed, 8 Oct 2008 18:27: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: r183706 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Oct 2008 18:27:54 -0000 Author: mav Date: Wed Oct 8 18:27:54 2008 New Revision: 183706 URL: http://svn.freebsd.org/changeset/base/183706 Log: Remove stale BUGS. Modified: head/share/man/man4/mmc.4 Modified: head/share/man/man4/mmc.4 ============================================================================== --- head/share/man/man4/mmc.4 Wed Oct 8 18:13:14 2008 (r183705) +++ head/share/man/man4/mmc.4 Wed Oct 8 18:27:54 2008 (r183706) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 26, 2007 +.Dd October 8, 2008 .Dt MMC 4 .Os .Sh NAME @@ -56,6 +56,4 @@ SD Cards exist as memory, I/O, or combin .%T "The MultiMediaCard System Specification" .Re .Sh BUGS -Memory MultMediaCards do not currently work. SDIO cards currently do not work. -SDHC cards currently do not work. From owner-svn-src-head@FreeBSD.ORG Wed Oct 8 19:39:24 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0FA161065688; Wed, 8 Oct 2008 19:39:24 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F0F058FC17; Wed, 8 Oct 2008 19:39:23 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m98JdNDC041747; Wed, 8 Oct 2008 19:39:23 GMT (envelope-from phk@svn.freebsd.org) Received: (from phk@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m98JdMf4041744; Wed, 8 Oct 2008 19:39:22 GMT (envelope-from phk@svn.freebsd.org) Message-Id: <200810081939.m98JdMf4041744@svn.freebsd.org> From: Poul-Henning Kamp Date: Wed, 8 Oct 2008 19:39:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r183707 - head/games/fortune/datfiles X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 08 Oct 2008 19:39:24 -0000 Author: phk Date: Wed Oct 8 19:39:22 2008 New Revision: 183707 URL: http://svn.freebsd.org/changeset/base/183707 Log: Another good day for historical quotes, Oliver Wendell Holmes brought to you by Thomas L. Friedman. (http://www.nytimes.com/2008/10/08/opinion/08friedman.html?ref=opinion) Modified: head/games/fortune/datfiles/fortunes Modified: head/games/fortune/datfiles/fortunes ============================================================================== --- head/games/fortune/datfiles/fortunes Wed Oct 8 18:27:54 2008 (r183706) +++ head/games/fortune/datfiles/fortunes Wed Oct 8 19:39:22 2008 (r183707) @@ -23951,6 +23951,9 @@ I like myself, but I won't say I'm as ha that kidnaped Europa. -- Marcus Tullius Cicero % +I like paying taxes. With them I buy civilization. + -- Oliver Wendell Holmes +% I like to believe that people in the long run are going to do more to promote peace than our governments. Indeed, I think that people want peace so much that one of these days governments had better get out of From owner-svn-src-head@FreeBSD.ORG Wed Oct 8 20:00:52 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D55A1065694; Wed, 8 Oct 2008 20:00:52 +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 1048F8FC1F; Wed, 8 Oct 2008 20:00:52 +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 m98K0pJN042157; Wed, 8 Oct 2008 20:00:51 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m98K0pQi042156; Wed, 8 Oct 2008 20:00:51 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200810082000.m98K0pQi042156@svn.freebsd.org> From: Alexander Motin Date: Wed, 8 Oct 2008 20:00: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: r183708 - head/sys/dev/mmc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 08 Oct 2008 20:00:52 -0000 Author: mav Date: Wed Oct 8 20:00:51 2008 New Revision: 183708 URL: http://svn.freebsd.org/changeset/base/183708 Log: Generic SD Host Controller driver going to be named sdhci. Modified: head/sys/dev/mmc/mmc.c Modified: head/sys/dev/mmc/mmc.c ============================================================================== --- head/sys/dev/mmc/mmc.c Wed Oct 8 19:39:22 2008 (r183707) +++ head/sys/dev/mmc/mmc.c Wed Oct 8 20:00:51 2008 (r183708) @@ -1286,4 +1286,4 @@ static devclass_t mmc_devclass; DRIVER_MODULE(mmc, at91_mci, mmc_driver, mmc_devclass, 0, 0); -DRIVER_MODULE(mmc, sdh, mmc_driver, mmc_devclass, 0, 0); +DRIVER_MODULE(mmc, sdhci, mmc_driver, mmc_devclass, 0, 0); From owner-svn-src-head@FreeBSD.ORG Wed Oct 8 21:10:55 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C65B8106568A; Wed, 8 Oct 2008 21:10:55 +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 B33D28FC13; Wed, 8 Oct 2008 21:10:55 +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 m98LAt9e043369; Wed, 8 Oct 2008 21:10:55 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m98LAttm043368; Wed, 8 Oct 2008 21:10:55 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200810082110.m98LAttm043368@svn.freebsd.org> From: Alexander Motin Date: Wed, 8 Oct 2008 21:10: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: r183709 - head/sys/dev/mmc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 08 Oct 2008 21:10:55 -0000 Author: mav Date: Wed Oct 8 21:10:55 2008 New Revision: 183709 URL: http://svn.freebsd.org/changeset/base/183709 Log: Only voltage bits should be zero in send_op_cond argument to ignore busy. Modified: head/sys/dev/mmc/mmc.c Modified: head/sys/dev/mmc/mmc.c ============================================================================== --- head/sys/dev/mmc/mmc.c Wed Oct 8 20:00:51 2008 (r183708) +++ head/sys/dev/mmc/mmc.c Wed Oct 8 21:10:55 2008 (r183709) @@ -428,7 +428,8 @@ mmc_send_app_op_cond(struct mmc_softc *s err = mmc_wait_for_app_cmd(sc, 0, &cmd, CMD_RETRIES); if (err != MMC_ERR_NONE) break; - if ((cmd.resp[0] & MMC_OCR_CARD_BUSY) || ocr == 0) + if ((cmd.resp[0] & MMC_OCR_CARD_BUSY) || + (ocr & MMC_OCR_VOLTAGE) == 0) break; err = MMC_ERR_TIMEOUT; mmc_ms_delay(10); @@ -454,7 +455,8 @@ mmc_send_op_cond(struct mmc_softc *sc, u err = mmc_wait_for_cmd(sc, &cmd, CMD_RETRIES); if (err != MMC_ERR_NONE) break; - if ((cmd.resp[0] & MMC_OCR_CARD_BUSY) || ocr == 0) + if ((cmd.resp[0] & MMC_OCR_CARD_BUSY) || + (ocr & MMC_OCR_VOLTAGE) == 0) break; err = MMC_ERR_TIMEOUT; mmc_ms_delay(10); From owner-svn-src-head@FreeBSD.ORG Thu Oct 9 02:25:18 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AB72F106568E; Thu, 9 Oct 2008 02:25:18 +0000 (UTC) (envelope-from peter@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 984778FC21; Thu, 9 Oct 2008 02:25:18 +0000 (UTC) (envelope-from peter@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m992PIpp049356; Thu, 9 Oct 2008 02:25:18 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m992PIom049355; Thu, 9 Oct 2008 02:25:18 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <200810090225.m992PIom049355@svn.freebsd.org> From: Peter Wemm Date: Thu, 9 Oct 2008 02:25: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: r183714 - in head: etc/rc.d lib/libarchive lib/libc/stdlib lib/msun/src share/man/man4 sys/dev/e1000 sys/dev/iicbus sys/dev/pcn sys/dev/sis sys/dev/ste sys/dev/tl sys/dev/wb sys/dev/xl ... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 09 Oct 2008 02:25:18 -0000 Author: peter Date: Thu Oct 9 02:25:18 2008 New Revision: 183714 URL: http://svn.freebsd.org/changeset/base/183714 Log: Clean out some empty mergeinfo records, presumably by people doing local cp/mv operations. The full repo-relative URL should be specified for the source in these cases. Modified: head/etc/rc.d/defaultroute (props changed) head/lib/libarchive/archive.h (props changed) head/lib/libc/stdlib/ptsname.3 (props changed) head/lib/msun/src/s_cargl.c (props changed) head/share/man/man4/igb.4 (props changed) head/sys/dev/e1000/ (props changed) head/sys/dev/e1000/e1000_82575.c (props changed) head/sys/dev/e1000/e1000_82575.h (props changed) head/sys/dev/e1000/if_igb.c (props changed) head/sys/dev/e1000/if_igb.h (props changed) head/sys/dev/iicbus/ds133x.c (props changed) head/sys/dev/pcn/if_pcn.c (props changed) head/sys/dev/pcn/if_pcnreg.h (props changed) head/sys/dev/sis/if_sis.c (props changed) head/sys/dev/sis/if_sisreg.h (props changed) head/sys/dev/ste/if_ste.c (props changed) head/sys/dev/ste/if_stereg.h (props changed) head/sys/dev/tl/if_tl.c (props changed) head/sys/dev/tl/if_tlreg.h (props changed) head/sys/dev/wb/if_wb.c (props changed) head/sys/dev/wb/if_wbreg.h (props changed) head/sys/dev/xl/if_xl.c (props changed) head/sys/dev/xl/if_xlreg.h (props changed) head/sys/mips/adm5120/ (props changed) head/sys/mips/idt/ (props changed) head/sys/mips/malta/ (props changed) head/sys/mips/sentry5/ (props changed) From owner-svn-src-head@FreeBSD.ORG Thu Oct 9 06:19:43 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C1784106569B; Thu, 9 Oct 2008 06:19:43 +0000 (UTC) (envelope-from jkoshy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DC6228FC1B; Thu, 9 Oct 2008 06:19:42 +0000 (UTC) (envelope-from jkoshy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m996JgqY053814; Thu, 9 Oct 2008 06:19:42 GMT (envelope-from jkoshy@svn.freebsd.org) Received: (from jkoshy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m996JgOK053813; Thu, 9 Oct 2008 06:19:42 GMT (envelope-from jkoshy@svn.freebsd.org) Message-Id: <200810090619.m996JgOK053813@svn.freebsd.org> From: Joseph Koshy Date: Thu, 9 Oct 2008 06:19: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: r183717 - head/sys/dev/hwpmc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 09 Oct 2008 06:19:43 -0000 Author: jkoshy Date: Thu Oct 9 06:19:42 2008 New Revision: 183717 URL: http://svn.freebsd.org/changeset/base/183717 Log: Rework pmc-dependent flag handling. Modified: head/sys/dev/hwpmc/hwpmc_ppro.c Modified: head/sys/dev/hwpmc/hwpmc_ppro.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_ppro.c Thu Oct 9 05:11:27 2008 (r183716) +++ head/sys/dev/hwpmc/hwpmc_ppro.c Thu Oct 9 06:19:42 2008 (r183717) @@ -121,6 +121,11 @@ static enum pmc_cputype p6_cputype; /* * P6 Event descriptor + * + * The 'pm_flags' field has the following structure: + * - The upper 4 bits are used to track which counter an event is valid on. + * - The lower bits form a bitmask of flags indicating support for the event + * on a given CPU. */ struct p6_event_descr { @@ -130,6 +135,23 @@ struct p6_event_descr { uint32_t pm_unitmask; }; +#define P6F_CTR(C) (1 << (28 + (C))) +#define P6F_CTR0 P6F_CTR(0) +#define P6F_CTR1 P6F_CTR(1) +#define P6F(CPU) (1 << ((CPU) - PMC_CPU_INTEL_P6)) +#define _P6F(C) P6F(PMC_CPU_INTEL_##C) +#define P6F_P6 _P6F(P6) +#define P6F_CL _P6F(CL) +#define P6F_PII _P6F(PII) +#define P6F_PIII _P6F(PIII) +#define P6F_PM _P6F(PM) +#define P6F_ALL_CPUS (P6F_P6 | P6F_PII | P6F_CL | P6F_PIII | P6F_PM) +#define P6F_ALL_CTRS (P6F_CTR0 | P6F_CTR1) +#define P6F_ALL (P6F_ALL_CPUS | P6F_ALL_CTRS) + +#define P6_EVENT_VALID_FOR_CPU(P,CPU) ((P)->pm_flags & P6F(CPU)) +#define P6_EVENT_VALID_FOR_CTR(P,CTR) ((P)->pm_flags & P6F_CTR(CTR)) + static const struct p6_event_descr p6_events[] = { #define P6_EVDESCR(NAME, EVSEL, FLAGS, UMASK) \ @@ -140,20 +162,6 @@ static const struct p6_event_descr p6_ev .pm_unitmask = (UMASK) \ } -#define P6F_P6 (1 << PMC_CPU_INTEL_P6) -#define P6F_CL (1 << PMC_CPU_INTEL_CL) -#define P6F_PII (1 << PMC_CPU_INTEL_PII) -#define P6F_PIII (1 << PMC_CPU_INTEL_PIII) -#define P6F_PM (1 << PMC_CPU_INTEL_PM) -#define P6F_CTR0 0x0001 -#define P6F_CTR1 0x0002 -#define P6F_ALL_CPUS (P6F_P6 | P6F_PII | P6F_CL | P6F_PIII | P6F_PM) -#define P6F_ALL_CTRS (P6F_CTR0 | P6F_CTR1) -#define P6F_ALL (P6F_ALL_CPUS | P6F_ALL_CTRS) - -#define P6_EVENT_VALID_FOR_CPU(P,CPU) ((P)->pm_flags & (1 << (CPU))) -#define P6_EVENT_VALID_FOR_CTR(P,CTR) ((P)->pm_flags & (1 << (CTR))) - P6_EVDESCR(DATA_MEM_REFS, 0x43, P6F_ALL, 0x00), P6_EVDESCR(DCU_LINES_IN, 0x45, P6F_ALL, 0x00), P6_EVDESCR(DCU_M_LINES_IN, 0x46, P6F_ALL, 0x00), From owner-svn-src-head@FreeBSD.ORG Thu Oct 9 06:23:04 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA4191065690; Thu, 9 Oct 2008 06:23:04 +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 99F268FC1B; Thu, 9 Oct 2008 06:23:04 +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 m996N4ie053924; Thu, 9 Oct 2008 06:23:04 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m996N4XJ053923; Thu, 9 Oct 2008 06:23:04 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200810090623.m996N4XJ053923@svn.freebsd.org> From: Xin LI Date: Thu, 9 Oct 2008 06:23: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: r183718 - 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: Thu, 09 Oct 2008 06:23:04 -0000 Author: delphij Date: Thu Oct 9 06:23:04 2008 New Revision: 183718 URL: http://svn.freebsd.org/changeset/base/183718 Log: Add some examples to demostrate gpart(8). --此行åŠä»¥ä¸‹å†…容将会被忽略-- > Description of fields to fill in above: 76 columns --| > PR: If a GNATS PR is affected by the change. > Submitted by: If someone else sent in the change. > Reviewed by: If someone else reviewed your modification. > Approved by: If you needed approval for this commit. > Obtained from: If the change is from a third party. > MFC after: N [day[s]|week[s]|month[s]]. Request a reminder email. > Security: Vulnerability reference (one per line) or description. > Empty fields above will be automatically removed. M gpart.8 Modified: head/sbin/geom/class/part/gpart.8 Modified: head/sbin/geom/class/part/gpart.8 ============================================================================== --- head/sbin/geom/class/part/gpart.8 Thu Oct 9 06:19:42 2008 (r183717) +++ head/sbin/geom/class/part/gpart.8 Thu Oct 9 06:23:04 2008 (r183718) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd Jun 17, 2008 +.Dd Oct 9, 2008 .Dt GPART 8 .Os .Sh NAME @@ -404,6 +404,41 @@ action or reverted with the action. .Sh EXIT STATUS Exit status is 0 on success, and 1 if the command fails. +.Sh EXAMPLES +Create GPT scheme on +.Pa ad0 . +.Bd -literal -offset indent +/sbin/gpart create -s GPT ad0 +.Ed +.Pp +Embed GPT bootstrap code into protective MBR. +.Bd -literal -offset indent +/sbin/gpart bootcode -b /boot/pmbr ad0 +.Ed +.Pp +Create a dedicated +.Pa freebsd-boot +partition that can boot FreeBSD from a +.Pa freebsd-ufs +partition, and install bootstrap code into it. +This partition must be larger than +.Pa /boot/gptboot , +or the GPT boot you are willing to write, +a size of 15 blocks (7680 bytes) would be sufficient for +booting from UFS, but let's use 128 blocks (64 KB) here in +this example, in order to reserve some space for potential +future need (e.g. from a ZFS partition). +.Bd -literal -offset indent +/sbin/gpart add -b 34 -s 128 -t freebsd-boot ad0 +/sbin/gpart bootcode -p /boot/gptboot -i 1 ad0 +.Ed +.Pp +Create a 512MB-sized +.Pa freebsd-ufs +partition that would contain UFS where the system boot from. +.Bd -literal -offset indent +/sbin/gpart add -b 162 -s 1048576 -t freebsd-ufs ad0 +.Ed .Sh SEE ALSO .Xr geom 4 , .Xr geom 8 , From owner-svn-src-head@FreeBSD.ORG Thu Oct 9 06:38:50 2008 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3D5401065688; Thu, 9 Oct 2008 06:38:50 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from tarsier.delphij.net (delphij-pt.tunnel.tserv2.fmt.ipv6.he.net [IPv6:2001:470:1f03:2c9::2]) by mx1.freebsd.org (Postfix) with ESMTP id D51B48FC08; Thu, 9 Oct 2008 06:38:49 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from tarsier.geekcn.org (tarsier.geekcn.org [211.166.10.233]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tarsier.delphij.net (Postfix) with ESMTPS id 7E4AB28449; Thu, 9 Oct 2008 14:38:48 +0800 (CST) Received: from localhost (tarsier.geekcn.org [211.166.10.233]) by tarsier.geekcn.org (Postfix) with ESMTP id C0DD7101CCF0; Thu, 9 Oct 2008 14:38:47 +0800 (CST) X-Virus-Scanned: amavisd-new at geekcn.org Received: from tarsier.geekcn.org ([211.166.10.233]) by localhost (mail.geekcn.org [211.166.10.233]) (amavisd-new, port 10024) with ESMTP id GsXy7+YgCSwn; Thu, 9 Oct 2008 14:38:42 +0800 (CST) Received: from delta.delphij.net (c-76-103-40-85.hsd1.ca.comcast.net [76.103.40.85]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tarsier.geekcn.org (Postfix) with ESMTPSA id 5ECDD101CCEB; Thu, 9 Oct 2008 14:38:39 +0800 (CST) DomainKey-Signature: a=rsa-sha1; s=default; d=delphij.net; c=nofws; q=dns; h=message-id:date:from:reply-to:organization:user-agent: mime-version:to:cc:subject:references:in-reply-to: x-enigmail-version:openpgp:content-type:content-transfer-encoding; b=b3RefSd5bM96CdweDHEEaignfD7s4yHg4qZkfu3VmcAkUWMjzny281+O00hec1q/y lF+1wSuKNtDY02ddHNZmg== Message-ID: <48EDA6EC.6060205@delphij.net> Date: Wed, 08 Oct 2008 23:38:36 -0700 From: Xin LI Organization: The Geek China Organization User-Agent: Thunderbird 2.0.0.17 (X11/20080926) MIME-Version: 1.0 To: Peter Wemm References: <200810090623.m996N4XJ053923@svn.freebsd.org> In-Reply-To: X-Enigmail-Version: 0.95.7 OpenPGP: id=18EDEBA0; url=http://www.delphij.net/delphij.asc Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG, Xin LI Subject: Re: svn commit: r183718 - head/sbin/geom/class/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: d@delphij.net List-Id: 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, 09 Oct 2008 06:38:50 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Peter Wemm wrote: > On Wed, Oct 8, 2008 at 11:23 PM, Xin LI wrote: >> Author: delphij >> Date: Thu Oct 9 06:23:04 2008 >> New Revision: 183718 >> URL: http://svn.freebsd.org/changeset/base/183718 >> >> Log: >> Add some examples to demostrate gpart(8). >> --$B:!9T5Z0J2-2qHo9zN,(B-- >> > Description of fields to fill in above: 76 columns --| >> > PR: If a GNATS PR is affected by the change. >> > Submitted by: If someone else sent in the change. >> > Reviewed by: If someone else reviewed your modification. >> > Approved by: If you needed approval for this commit. >> > Obtained from: If the change is from a third party. >> > MFC after: N [day[s]|week[s]|month[s]]. Request a reminder email. >> > Security: Vulnerability reference (one per line) or description. >> > Empty fields above will be automatically removed. >> >> M gpart.8 > > Looks like the hack that removes the template doesn't work when svn > has its localizations enabled. Oops. I'll get this fixed for the > svn-1.5.3 update, which is in the process of being released. > > In the mean time, you'll have to delete them by hand before commit. Sorry. :( Oops, sorry for that. Is it still possible to trim it by editing svn:log property? Cheers, -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (FreeBSD) iEYEARECAAYFAkjtpusACgkQi+vbBBjt66A0DwCffOMlF0vC18s7KKyG18gr/7cl MMEAn2OqA8NhCK1DihCwpz+839BfW7B4 =YUxX -----END PGP SIGNATURE----- From owner-svn-src-head@FreeBSD.ORG Thu Oct 9 06:55:50 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D6631065698 for ; Thu, 9 Oct 2008 06:55:50 +0000 (UTC) (envelope-from peter@wemm.org) Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.231]) by mx1.freebsd.org (Postfix) with ESMTP id 0E5C18FC1B for ; Thu, 9 Oct 2008 06:55:49 +0000 (UTC) (envelope-from peter@wemm.org) Received: by rv-out-0506.google.com with SMTP id b25so4319965rvf.43 for ; Wed, 08 Oct 2008 23:55:49 -0700 (PDT) Received: by 10.142.162.9 with SMTP id k9mr4119306wfe.158.1223533711308; Wed, 08 Oct 2008 23:28:31 -0700 (PDT) Received: by 10.142.255.21 with HTTP; Wed, 8 Oct 2008 23:28:30 -0700 (PDT) Message-ID: Date: Wed, 8 Oct 2008 23:28:30 -0700 From: "Peter Wemm" To: "Xin LI" In-Reply-To: <200810090623.m996N4XJ053923@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200810090623.m996N4XJ053923@svn.freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r183718 - 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: Thu, 09 Oct 2008 06:55:50 -0000 On Wed, Oct 8, 2008 at 11:23 PM, Xin LI wrote: > Author: delphij > Date: Thu Oct 9 06:23:04 2008 > New Revision: 183718 > URL: http://svn.freebsd.org/changeset/base/183718 > > Log: > Add some examples to demostrate gpart(8). > --$B:!9T5Z0J2-2qHo9zN,(B-- > > Description of fields to fill in above: 76 columns --| > > PR: If a GNATS PR is affected by the change. > > Submitted by: If someone else sent in the change. > > Reviewed by: If someone else reviewed your modification. > > Approved by: If you needed approval for this commit. > > Obtained from: If the change is from a third party. > > MFC after: N [day[s]|week[s]|month[s]]. Request a reminder email. > > Security: Vulnerability reference (one per line) or description. > > Empty fields above will be automatically removed. > > M gpart.8 Looks like the hack that removes the template doesn't work when svn has its localizations enabled. Oops. I'll get this fixed for the svn-1.5.3 update, which is in the process of being released. In the mean time, you'll have to delete them by hand before commit. Sorry. :( -- Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI6FJV "All of this is for nothing if we don't go to the stars" - JMS/B5 "If Java had true garbage collection, most programs would delete themselves upon execution." -- Robert Sewell From owner-svn-src-head@FreeBSD.ORG Thu Oct 9 08:12:46 2008 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4765C1065688; Thu, 9 Oct 2008 08:12:46 +0000 (UTC) (envelope-from olli@fromme.com) Received: from haluter.fromme.com (haluter.fromme.com [212.17.241.231]) by mx1.freebsd.org (Postfix) with ESMTP id 642278FC1C; Thu, 9 Oct 2008 08:12:45 +0000 (UTC) (envelope-from olli@fromme.com) Received: from haluter.fromme.com (irc_sucks@localhost [127.0.0.1]) by haluter.fromme.com (8.14.3/8.14.3) with ESMTP id m997sEEX086414; Thu, 9 Oct 2008 09:54:15 +0200 (CEST) (envelope-from olli@fromme.com) Received: (from olli@localhost) by haluter.fromme.com (8.14.3/8.14.3/Submit) id m997sDwv086411; Thu, 9 Oct 2008 09:54:13 +0200 (CEST) (envelope-from olli) From: Oliver Fromme Message-Id: <200810090754.m997sDwv086411@haluter.fromme.com> To: delphij@FreeBSD.org (Xin LI) Date: Thu, 9 Oct 2008 09:54:13 +0200 (CEST) In-Reply-To: X-Mailer: ELM [version 2.5 PL8] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.1.2 (haluter.fromme.com [127.0.0.1]); Thu, 09 Oct 2008 09:54:15 +0200 (CEST) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Peter Wemm Subject: Re: svn commit: r183718 - 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: Thu, 09 Oct 2008 08:12:46 -0000 Peter Wemm wrote: > On Wed, Oct 8, 2008 at 11:23 PM, Xin LI wrote: > > Author: delphij > > Date: Thu Oct 9 06:23:04 2008 > > New Revision: 183718 > > URL: http://svn.freebsd.org/changeset/base/183718 > > > > Log: > > Add some examples to demostrate gpart(8). > > --$B:!9T5Z0J2-2qHo9zN,(B-- > > > Description of fields to fill in above: 76 columns --| > > > PR: If a GNATS PR is affected by the change. > > > Submitted by: If someone else sent in the change. > > > Reviewed by: If someone else reviewed your modification. > > > Approved by: If you needed approval for this commit. > > > Obtained from: If the change is from a third party. > > > MFC after: N [day[s]|week[s]|month[s]]. Request a reminder email. > > > Security: Vulnerability reference (one per line) or description. > > > Empty fields above will be automatically removed. > > > > M gpart.8 > > Looks like the hack that removes the template doesn't work when svn > has its localizations enabled. Oops. I'll get this fixed for the > svn-1.5.3 update, which is in the process of being released. This commit also revealed a bug in my "SVNews" tool; it didn't support UTF-8 charactes correctly that can't be mapped to ISO8859-*. Now it does. So I'm thankful for delphij's commit message because it gave me the opportunity to discover and fix the bug. :-) Best regards Oliver PS: Ivan: I decided to implement displaying diffs, as you suggested. Working on it right now. It only stores the most recent diffs (currently 10 days). -- Oliver Fromme, Bunsenstr. 13, 81735 Muenchen, Germany ``We are all but compressed light'' (Albert Einstein) From owner-svn-src-head@FreeBSD.ORG Thu Oct 9 10:04:43 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4D50106569F for ; Thu, 9 Oct 2008 10:04:43 +0000 (UTC) (envelope-from ivoras@gmail.com) Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.239]) by mx1.freebsd.org (Postfix) with ESMTP id A68808FC20 for ; Thu, 9 Oct 2008 10:04:43 +0000 (UTC) (envelope-from ivoras@gmail.com) Received: by rv-out-0506.google.com with SMTP id b25so4387097rvf.43 for ; Thu, 09 Oct 2008 03:04:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=EKgc5JYWxLjgGsp/1pbkKA8NR6sHCGe/QNRpF/5uR0A=; b=c9KfybgsMcOvp1Gn/DTxYuNFAHCztBNwwQUo2f5w00A2hGjyFiwovvtX57XtNX60eZ eT3gIy7TBoaxVvMQ05UWtzrs47jbJ4BgPZ8v4NS41nrjzIHjUHZhGt26M37JfkmSu5tv 5Y5xszUdxF7zQDt9AY2E7pWAybKmZrwsKbUQE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=ccZdZHDojAjeqiDJThwgcVNxsPEsOywWzFvpa2ikMUQqyfb4+YoZ9zgN6JXCHT/sUo Sa6W2bLHQGLUhCSMiAuJkNniopdBigIjfFyTMNvka/jOEt77/v+9QvKHBWHOn2Vdm93z 98Sp4LBdOX2BniEjy/V+ET97xvHCjT9qCgp1Y= Received: by 10.141.27.16 with SMTP id e16mr5954414rvj.136.1223545088192; Thu, 09 Oct 2008 02:38:08 -0700 (PDT) Received: by 10.141.153.13 with HTTP; Thu, 9 Oct 2008 02:38:08 -0700 (PDT) Message-ID: <9bbcef730810090238y8d8eb3fl200fd25371e4d69b@mail.gmail.com> Date: Thu, 9 Oct 2008 11:38:08 +0200 From: "Ivan Voras" To: "Oliver Fromme" In-Reply-To: <200810090754.m997sDwv086411@haluter.fromme.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200810090754.m997sDwv086411@haluter.fromme.com> Cc: svn-src-head@freebsd.org Subject: Re: svn commit: r183718 - 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: Thu, 09 Oct 2008 10:04:43 -0000 2008/10/9 Oliver Fromme : > PS: Ivan: I decided to implement displaying diffs, > as you suggested. Working on it right now. It only > stores the most recent diffs (currently 10 days). Thanks, this will be completely sufficient for RSS! From owner-svn-src-head@FreeBSD.ORG Thu Oct 9 12:56:57 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9FD5D106568E; Thu, 9 Oct 2008 12:56:57 +0000 (UTC) (envelope-from sos@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 894A08FC13; Thu, 9 Oct 2008 12:56:57 +0000 (UTC) (envelope-from sos@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m99Cuvaf062510; Thu, 9 Oct 2008 12:56:57 GMT (envelope-from sos@svn.freebsd.org) Received: (from sos@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m99Cuvex062502; Thu, 9 Oct 2008 12:56:57 GMT (envelope-from sos@svn.freebsd.org) Message-Id: <200810091256.m99Cuvex062502@svn.freebsd.org> From: Søren Schmidt Date: Thu, 9 Oct 2008 12:56: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: r183724 - in head/sys: conf dev/ata dev/ata/chipsets modules/ata modules/ata/ata modules/ata/atacore modules/ata/atadevel modules/ata/atapci modules/ata/atapci/chipsets modules/ata/atap... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 09 Oct 2008 12:56:57 -0000 Author: sos Date: Thu Oct 9 12:56:57 2008 New Revision: 183724 URL: http://svn.freebsd.org/changeset/base/183724 Log: This is the roumored ATA modulerisation works, and it needs a little explanation. If you just config KERNEL as usual there should be no apparent changes, you'll get all chipset support code compiled in. However there is now a way to only compile in code for chipsets needed on a pr vendor basis. ATA now has the following "device" entries: atacore: ATA core functionality, always needed for any ATA setup atacard: CARDBUS support atacbus: PC98 cbus support ataisa: ISA bus support atapci: PCI bus support only generic chipset support. ataahci: AHCI support, also pulled in by some vendor modules. ataacard, ataacerlabs, ataadaptec, ataamd, ataati, atacenatek, atacypress, atacyrix, atahighpoint, ataintel, ataite, atajmicron, atamarvell, atamicron, atanational, atanetcell, atanvidia, atapromise, ataserverworks, atasiliconimage, atasis, atavia; Vendor support, ie atavia for VIA chipsets atadisk: ATA disk driver ataraid: ATA softraid driver atapicd: ATAPI cd/dvd driver atapifd: ATAPI floppy/flashdisk driver atapist: ATAPI tape driver atausb: ATA<>USB bridge atapicam: ATA<>CAM bridge This makes it possible to config a kernel with just VIA chipset support by having the following ATA lines in the kernel config file: device atacore device atapci device atavia And then you need the atadisk, atapicd etc lines in there just as usual. If you use ATA as modules loaded at boot there is few changes except the rename of the "ata" module to "atacore", things looks just as usual. However under atapci you now have a whole bunch of vendor specific drivers, that you can kldload individually depending on you needs. Drivers have the same names as used in the kernel config explained above. Added: head/sys/dev/ata/ata-sata.c (contents, props changed) head/sys/dev/ata/chipsets/ head/sys/dev/ata/chipsets/ata-acard.c (contents, props changed) head/sys/dev/ata/chipsets/ata-acerlabs.c (contents, props changed) head/sys/dev/ata/chipsets/ata-adaptec.c (contents, props changed) head/sys/dev/ata/chipsets/ata-ahci.c (contents, props changed) head/sys/dev/ata/chipsets/ata-amd.c (contents, props changed) head/sys/dev/ata/chipsets/ata-ati.c (contents, props changed) head/sys/dev/ata/chipsets/ata-cenatek.c (contents, props changed) head/sys/dev/ata/chipsets/ata-cypress.c (contents, props changed) head/sys/dev/ata/chipsets/ata-cyrix.c (contents, props changed) head/sys/dev/ata/chipsets/ata-highpoint.c (contents, props changed) head/sys/dev/ata/chipsets/ata-intel.c (contents, props changed) head/sys/dev/ata/chipsets/ata-ite.c (contents, props changed) head/sys/dev/ata/chipsets/ata-jmicron.c (contents, props changed) head/sys/dev/ata/chipsets/ata-marvell.c (contents, props changed) head/sys/dev/ata/chipsets/ata-micron.c (contents, props changed) head/sys/dev/ata/chipsets/ata-national.c (contents, props changed) head/sys/dev/ata/chipsets/ata-netcell.c (contents, props changed) head/sys/dev/ata/chipsets/ata-nvidia.c (contents, props changed) head/sys/dev/ata/chipsets/ata-promise.c (contents, props changed) head/sys/dev/ata/chipsets/ata-serverworks.c (contents, props changed) head/sys/dev/ata/chipsets/ata-siliconimage.c (contents, props changed) head/sys/dev/ata/chipsets/ata-sis.c (contents, props changed) head/sys/dev/ata/chipsets/ata-via.c (contents, props changed) head/sys/modules/ata/atacore/ head/sys/modules/ata/atacore/Makefile (contents, props changed) head/sys/modules/ata/atadevel/ head/sys/modules/ata/atadevel/Makefile (contents, props changed) head/sys/modules/ata/atadevel/ata-devel.c (contents, props changed) head/sys/modules/ata/atapci/Makefile.inc (contents, props changed) head/sys/modules/ata/atapci/chipsets/ head/sys/modules/ata/atapci/chipsets/Makefile (contents, props changed) head/sys/modules/ata/atapci/chipsets/Makefile.inc (contents, props changed) head/sys/modules/ata/atapci/chipsets/ataacard/ head/sys/modules/ata/atapci/chipsets/ataacard/Makefile (contents, props changed) head/sys/modules/ata/atapci/chipsets/ataacerlabs/ head/sys/modules/ata/atapci/chipsets/ataacerlabs/Makefile (contents, props changed) head/sys/modules/ata/atapci/chipsets/ataadaptec/ head/sys/modules/ata/atapci/chipsets/ataadaptec/Makefile (contents, props changed) head/sys/modules/ata/atapci/chipsets/ataahci/ head/sys/modules/ata/atapci/chipsets/ataahci/Makefile (contents, props changed) head/sys/modules/ata/atapci/chipsets/ataamd/ head/sys/modules/ata/atapci/chipsets/ataamd/Makefile (contents, props changed) head/sys/modules/ata/atapci/chipsets/ataati/ head/sys/modules/ata/atapci/chipsets/ataati/Makefile (contents, props changed) head/sys/modules/ata/atapci/chipsets/atacenatek/ head/sys/modules/ata/atapci/chipsets/atacenatek/Makefile (contents, props changed) head/sys/modules/ata/atapci/chipsets/atacypress/ head/sys/modules/ata/atapci/chipsets/atacypress/Makefile (contents, props changed) head/sys/modules/ata/atapci/chipsets/atacyrix/ head/sys/modules/ata/atapci/chipsets/atacyrix/Makefile (contents, props changed) head/sys/modules/ata/atapci/chipsets/atahighpoint/ head/sys/modules/ata/atapci/chipsets/atahighpoint/Makefile (contents, props changed) head/sys/modules/ata/atapci/chipsets/ataintel/ head/sys/modules/ata/atapci/chipsets/ataintel/Makefile (contents, props changed) head/sys/modules/ata/atapci/chipsets/ataite/ head/sys/modules/ata/atapci/chipsets/ataite/Makefile (contents, props changed) head/sys/modules/ata/atapci/chipsets/atajmicron/ head/sys/modules/ata/atapci/chipsets/atajmicron/Makefile (contents, props changed) head/sys/modules/ata/atapci/chipsets/atamarvell/ head/sys/modules/ata/atapci/chipsets/atamarvell/Makefile (contents, props changed) head/sys/modules/ata/atapci/chipsets/atamicron/ head/sys/modules/ata/atapci/chipsets/atamicron/Makefile (contents, props changed) head/sys/modules/ata/atapci/chipsets/atanational/ head/sys/modules/ata/atapci/chipsets/atanational/Makefile (contents, props changed) head/sys/modules/ata/atapci/chipsets/atanetcell/ head/sys/modules/ata/atapci/chipsets/atanetcell/Makefile (contents, props changed) head/sys/modules/ata/atapci/chipsets/atanvidia/ head/sys/modules/ata/atapci/chipsets/atanvidia/Makefile (contents, props changed) head/sys/modules/ata/atapci/chipsets/atapromise/ head/sys/modules/ata/atapci/chipsets/atapromise/Makefile (contents, props changed) head/sys/modules/ata/atapci/chipsets/ataserverworks/ head/sys/modules/ata/atapci/chipsets/ataserverworks/Makefile (contents, props changed) head/sys/modules/ata/atapci/chipsets/atasiliconimage/ head/sys/modules/ata/atapci/chipsets/atasiliconimage/Makefile (contents, props changed) head/sys/modules/ata/atapci/chipsets/atasis/ head/sys/modules/ata/atapci/chipsets/atasis/Makefile (contents, props changed) head/sys/modules/ata/atapci/chipsets/atavia/ head/sys/modules/ata/atapci/chipsets/atavia/Makefile (contents, props changed) Deleted: head/sys/dev/ata/ata-chipset.c head/sys/modules/ata/ata/Makefile Modified: head/sys/conf/files head/sys/dev/ata/ata-all.c head/sys/dev/ata/ata-all.h head/sys/dev/ata/ata-dma.c head/sys/dev/ata/ata-pci.c head/sys/dev/ata/ata-pci.h head/sys/modules/ata/Makefile head/sys/modules/ata/atapci/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Oct 9 12:25:07 2008 (r183723) +++ head/sys/conf/files Thu Oct 9 12:56:57 2008 (r183724) @@ -459,23 +459,49 @@ dev/an/if_an_isa.c optional an isa dev/an/if_an_pccard.c optional an pccard dev/an/if_an_pci.c optional an pci dev/asr/asr.c optional asr pci -dev/ata/ata_if.m optional ata -dev/ata/ata-all.c optional ata -dev/ata/ata-card.c optional ata pccard -dev/ata/ata-cbus.c optional ata pc98 -dev/ata/ata-chipset.c optional ata pci +# +dev/ata/ata_if.m optional ata | atacore +dev/ata/ata-all.c optional ata | atacore +dev/ata/ata-lowlevel.c optional ata | atacore +dev/ata/ata-queue.c optional ata | atacore +dev/ata/ata-card.c optional ata pccard | atapccard +dev/ata/ata-cbus.c optional ata pc98 | atapc98 +dev/ata/ata-isa.c optional ata isa | ataisa +dev/ata/ata-pci.c optional ata pci | atapci +dev/ata/ata-dma.c optional ata pci | atapci +dev/ata/ata-sata.c optional ata pci | atapci +dev/ata/chipsets/ata-ahci.c optional ata pci | ataahci | ataacerlabs | \ + ataati | ataintel | atajmicron | atavia +dev/ata/chipsets/ata-acard.c optional ata pci | ataacard +dev/ata/chipsets/ata-acerlabs.c optional ata pci | ataacerlabs +dev/ata/chipsets/ata-adaptec.c optional ata pci | ataadaptec +dev/ata/chipsets/ata-amd.c optional ata pci | ataamd +dev/ata/chipsets/ata-ati.c optional ata pci | ataati +dev/ata/chipsets/ata-cenatek.c optional ata pci | atacenatek +dev/ata/chipsets/ata-cypress.c optional ata pci | atacypress +dev/ata/chipsets/ata-cyrix.c optional ata pci | atacyrix +dev/ata/chipsets/ata-highpoint.c optional ata pci | atahighpoint +dev/ata/chipsets/ata-intel.c optional ata pci | ataintel +dev/ata/chipsets/ata-ite.c optional ata pci | ataite +dev/ata/chipsets/ata-jmicron.c optional ata pci | atajmicron +dev/ata/chipsets/ata-marvell.c optional ata pci | atamarvell +dev/ata/chipsets/ata-micron.c optional ata pci | atamicron +dev/ata/chipsets/ata-national.c optional ata pci | atanational +dev/ata/chipsets/ata-netcell.c optional ata pci | atanetcell +dev/ata/chipsets/ata-nvidia.c optional ata pci | atanvidia +dev/ata/chipsets/ata-promise.c optional ata pci | atapromise +dev/ata/chipsets/ata-serverworks.c optional ata pci | ataserverworks +dev/ata/chipsets/ata-siliconimage.c optional ata pci | atasiliconimage +dev/ata/chipsets/ata-sis.c optional ata pci | atasis +dev/ata/chipsets/ata-via.c optional ata pci | atavia dev/ata/ata-disk.c optional atadisk -dev/ata/ata-dma.c optional ata pci -dev/ata/ata-isa.c optional ata isa -dev/ata/ata-lowlevel.c optional ata -dev/ata/ata-pci.c optional ata pci -dev/ata/ata-queue.c optional ata dev/ata/ata-raid.c optional ataraid dev/ata/ata-usb.c optional atausb -dev/ata/atapi-cam.c optional atapicam dev/ata/atapi-cd.c optional atapicd dev/ata/atapi-fd.c optional atapifd dev/ata/atapi-tape.c optional atapist +dev/ata/atapi-cam.c optional atapicam +# dev/ath/ah_osdep.c optional ath_hal \ compile-with "${NORMAL_C} -I$S/dev/ath" dev/ath/ath_rate/amrr/amrr.c optional ath_rate_amrr \ Modified: head/sys/dev/ata/ata-all.c ============================================================================== --- head/sys/dev/ata/ata-all.c Thu Oct 9 12:25:07 2008 (r183723) +++ head/sys/dev/ata/ata-all.c Thu Oct 9 12:56:57 2008 (r183724) @@ -616,7 +616,6 @@ ata_getparam(struct ata_device *atadev, if (!error && (isprint(atadev->param.model[0]) || isprint(atadev->param.model[1]))) { struct ata_params *atacap = &atadev->param; - char buffer[64]; int16_t *ptr; for (ptr = (int16_t *)atacap; @@ -648,6 +647,8 @@ ata_getparam(struct ata_device *atadev, (atacap->hwres & ATA_CABLE_ID) ? "80":"40"); if (init) { + char buffer[64]; + sprintf(buffer, "%.40s/%.8s", atacap->model, atacap->revision); device_set_desc_copy(atadev->dev, buffer); if ((atadev->param.config & ATA_PROTO_ATAPI) && @@ -677,8 +678,8 @@ int ata_identify(device_t dev) { struct ata_channel *ch = device_get_softc(dev); - struct ata_device *devices[ATA_PM]; - device_t childdevs[ATA_PM]; + struct ata_device *atadev; + device_t child; int i; if (bootverbose) @@ -688,33 +689,26 @@ ata_identify(device_t dev) if (ch->devices & (((ATA_ATA_MASTER | ATA_ATAPI_MASTER) << i))) { int unit = -1; - if (!(devices[i] = malloc(sizeof(struct ata_device), - M_ATA, M_NOWAIT | M_ZERO))) { + if (!(atadev = malloc(sizeof(struct ata_device), + M_ATA, M_NOWAIT | M_ZERO))) { device_printf(dev, "out of memory\n"); return ENOMEM; } - devices[i]->unit = i; + atadev->unit = i; #ifdef ATA_STATIC_ID if (ch->devices & ((ATA_ATA_MASTER << i))) unit = (device_get_unit(dev) << 1) + i; #endif - if (!(childdevs[i] = ata_add_child(dev, devices[i], unit))) { - free(devices[i], M_ATA); - devices[i]=NULL; - } - else { - if (ata_getparam(devices[i], 1)) { - device_delete_child(dev, childdevs[i]); - free(devices[i], M_ATA); - childdevs[i] = NULL; - devices[i] = NULL; + if ((child = ata_add_child(dev, atadev, unit))) { + if (ata_getparam(atadev, 1)) { + device_delete_child(dev, child); + free(atadev, M_ATA); } } + else + free(atadev, M_ATA); } - devices[i] = NULL; - childdevs[i] = NULL; } - bus_generic_probe(dev); bus_generic_attach(dev); return 0; @@ -895,6 +889,16 @@ ata_mode2str(int mode) } int +ata_atapi(device_t dev) +{ + struct ata_channel *ch = device_get_softc(device_get_parent(dev)); + struct ata_device *atadev = device_get_softc(dev); + + return ((atadev->unit == ATA_MASTER && ch->devices & ATA_ATAPI_MASTER) || + (atadev->unit == ATA_SLAVE && ch->devices & ATA_ATAPI_SLAVE)); +} + +int ata_pmode(struct ata_params *ap) { if (ap->atavalid & ATA_FLAG_64_70) { Modified: head/sys/dev/ata/ata-all.h ============================================================================== --- head/sys/dev/ata/ata-all.h Thu Oct 9 12:25:07 2008 (r183723) +++ head/sys/dev/ata/ata-all.h Thu Oct 9 12:56:57 2008 (r183724) @@ -563,6 +563,7 @@ void ata_modify_if_48bit(struct ata_requ void ata_udelay(int interval); char *ata_unit2str(struct ata_device *atadev); char *ata_mode2str(int mode); +int ata_atapi(device_t dev); int ata_pmode(struct ata_params *ap); int ata_wmode(struct ata_params *ap); int ata_umode(struct ata_params *ap); Modified: head/sys/dev/ata/ata-dma.c ============================================================================== --- head/sys/dev/ata/ata-dma.c Thu Oct 9 12:25:07 2008 (r183723) +++ head/sys/dev/ata/ata-dma.c Thu Oct 9 12:56:57 2008 (r183724) @@ -81,7 +81,7 @@ ata_dmainit(device_t dev) ch->dma.segsize = 63536; ch->dma.max_iosize = 128 * DEV_BSIZE; ch->dma.max_address = BUS_SPACE_MAXADDR_32BIT; - ch->dma.dma_slots = 2; + ch->dma.dma_slots = 6; if (bus_dma_tag_create(bus_get_dma_tag(dev), ch->dma.alignment, 0, ch->dma.max_address, BUS_SPACE_MAXADDR, Modified: head/sys/dev/ata/ata-pci.c ============================================================================== --- head/sys/dev/ata/ata-pci.c Thu Oct 9 12:25:07 2008 (r183723) +++ head/sys/dev/ata/ata-pci.c Thu Oct 9 12:56:57 2008 (r183724) @@ -54,140 +54,34 @@ static MALLOC_DEFINE(M_ATAPCI, "ata_pci" /* misc defines */ #define IOMASK 0xfffffffc -#define ATA_PROBE_OK -10 - -int -ata_legacy(device_t dev) -{ - return (((pci_read_config(dev, PCIR_PROGIF, 1)&PCIP_STORAGE_IDE_MASTERDEV)&& - ((pci_read_config(dev, PCIR_PROGIF, 1) & - (PCIP_STORAGE_IDE_MODEPRIM | PCIP_STORAGE_IDE_MODESEC)) != - (PCIP_STORAGE_IDE_MODEPRIM | PCIP_STORAGE_IDE_MODESEC))) || - (!pci_read_config(dev, PCIR_BAR(0), 4) && - !pci_read_config(dev, PCIR_BAR(1), 4) && - !pci_read_config(dev, PCIR_BAR(2), 4) && - !pci_read_config(dev, PCIR_BAR(3), 4) && - !pci_read_config(dev, PCIR_BAR(5), 4))); -} +/* local prototypes */ +static int ata_generic_chipinit(device_t dev); +static void ata_generic_setmode(device_t dev, int mode); + +/* + * generic PCI ATA device probe + */ int ata_pci_probe(device_t dev) { + struct ata_pci_controller *ctlr = device_get_softc(dev); + char buffer[64]; + + /* is this a storage class device ? */ if (pci_get_class(dev) != PCIC_STORAGE) return ENXIO; - /* if this is an AHCI chipset grab it */ - if (pci_get_subclass(dev) == PCIS_STORAGE_SATA) { - if (!ata_ahci_ident(dev)) - return ATA_PROBE_OK; - } - - /* run through the vendor specific drivers */ - switch (pci_get_vendor(dev)) { - case ATA_ACARD_ID: - if (!ata_acard_ident(dev)) - return ATA_PROBE_OK; - break; - case ATA_ACER_LABS_ID: - if (!ata_ali_ident(dev)) - return ATA_PROBE_OK; - break; - case ATA_AMD_ID: - if (!ata_amd_ident(dev)) - return ATA_PROBE_OK; - break; - case ATA_ADAPTEC_ID: - if (!ata_adaptec_ident(dev)) - return ATA_PROBE_OK; - break; - case ATA_ATI_ID: - if (!ata_ati_ident(dev)) - return ATA_PROBE_OK; - break; - case ATA_CYRIX_ID: - if (!ata_cyrix_ident(dev)) - return ATA_PROBE_OK; - break; - case ATA_CYPRESS_ID: - if (!ata_cypress_ident(dev)) - return ATA_PROBE_OK; - break; - case ATA_HIGHPOINT_ID: - if (!ata_highpoint_ident(dev)) - return ATA_PROBE_OK; - break; - case ATA_INTEL_ID: - if (!ata_intel_ident(dev)) - return ATA_PROBE_OK; - break; - case ATA_ITE_ID: - if (!ata_ite_ident(dev)) - return ATA_PROBE_OK; - break; - case ATA_JMICRON_ID: - if (!ata_jmicron_ident(dev)) - return ATA_PROBE_OK; - break; - case ATA_MARVELL_ID: - if (!ata_marvell_ident(dev)) - return ATA_PROBE_OK; - break; - case ATA_NATIONAL_ID: - if (!ata_national_ident(dev)) - return ATA_PROBE_OK; - break; - case ATA_NETCELL_ID: - if (!ata_netcell_ident(dev)) - return ATA_PROBE_OK; - break; - case ATA_NVIDIA_ID: - if (!ata_nvidia_ident(dev)) - return ATA_PROBE_OK; - break; - case ATA_PROMISE_ID: - if (!ata_promise_ident(dev)) - return ATA_PROBE_OK; - break; - case ATA_SERVERWORKS_ID: - if (!ata_serverworks_ident(dev)) - return ATA_PROBE_OK; - break; - case ATA_SILICON_IMAGE_ID: - if (!ata_sii_ident(dev)) - return ATA_PROBE_OK; - break; - case ATA_SIS_ID: - if (!ata_sis_ident(dev)) - return ATA_PROBE_OK; - break; - case ATA_VIA_ID: - if (!ata_via_ident(dev)) - return ATA_PROBE_OK; - break; - case ATA_CENATEK_ID: - if (pci_get_devid(dev) == ATA_CENATEK_ROCKET) { - ata_generic_ident(dev); - device_set_desc(dev, "Cenatek Rocket Drive controller"); - return ATA_PROBE_OK; - } - break; - case ATA_MICRON_ID: - if (pci_get_devid(dev) == ATA_MICRON_RZ1000 || - pci_get_devid(dev) == ATA_MICRON_RZ1001) { - ata_generic_ident(dev); - device_set_desc(dev, - "RZ 100? ATA controller !WARNING! data loss/corruption risk"); - return ATA_PROBE_OK; - } - break; - } + /* is this an IDE/ATA type device ? */ + if (pci_get_subclass(dev) != PCIS_STORAGE_IDE) + return ENXIO; + + sprintf(buffer, "%s ATA controller", ata_pcivendor2str(dev)); + device_set_desc_copy(dev, buffer); + ctlr->chipinit = ata_generic_chipinit; - /* unknown chipset, try generic DMA if it seems possible */ - if (pci_get_subclass(dev) == PCIS_STORAGE_IDE) { - if (!ata_generic_ident(dev)) - return ATA_PROBE_OK; - } - return ENXIO; + /* we are a low priority handler */ + return -100; } int @@ -286,7 +180,6 @@ ata_pci_resume(device_t dev) return error; } - struct resource * ata_pci_alloc_resource(device_t dev, device_t child, int type, int *rid, u_long start, u_long end, u_long count, u_int flags) @@ -414,6 +307,28 @@ ata_pci_teardown_intr(device_t dev, devi } } +static void +ata_generic_setmode(device_t dev, int mode) +{ + struct ata_device *atadev = device_get_softc(dev); + + mode = ata_limit_mode(dev, mode, ATA_UDMA2); + mode = ata_check_80pin(dev, mode); + if (!ata_controlcmd(dev, ATA_SETFEATURES, ATA_SF_SETXFER, 0, mode)) + atadev->mode = mode; +} + +static int +ata_generic_chipinit(device_t dev) +{ + struct ata_pci_controller *ctlr = device_get_softc(dev); + + if (ata_setup_interrupt(dev, ata_generic_intr)) + return ENXIO; + ctlr->setmode = ata_generic_setmode; + return 0; +} + int ata_pci_allocate(device_t dev) { @@ -545,35 +460,6 @@ ata_pci_dmainit(device_t dev) ch->dma.reset = ata_pci_dmareset; } -char * -ata_pcivendor2str(device_t dev) -{ - switch (pci_get_vendor(dev)) { - case ATA_ACARD_ID: return "Acard"; - case ATA_ACER_LABS_ID: return "AcerLabs"; - case ATA_AMD_ID: return "AMD"; - case ATA_ADAPTEC_ID: return "Adaptec"; - case ATA_ATI_ID: return "ATI"; - case ATA_CYRIX_ID: return "Cyrix"; - case ATA_CYPRESS_ID: return "Cypress"; - case ATA_HIGHPOINT_ID: return "HighPoint"; - case ATA_INTEL_ID: return "Intel"; - case ATA_ITE_ID: return "ITE"; - case ATA_JMICRON_ID: return "JMicron"; - case ATA_MARVELL_ID: return "Marvell"; - case ATA_NATIONAL_ID: return "National"; - case ATA_NETCELL_ID: return "Netcell"; - case ATA_NVIDIA_ID: return "nVidia"; - case ATA_PROMISE_ID: return "Promise"; - case ATA_SERVERWORKS_ID: return "ServerWorks"; - case ATA_SILICON_IMAGE_ID: return "SiI"; - case ATA_SIS_ID: return "SiS"; - case ATA_VIA_ID: return "VIA"; - case ATA_CENATEK_ID: return "Cenatek"; - case ATA_MICRON_ID: return "Micron"; - default: return "Generic"; - } -} static device_method_t ata_pci_methods[] = { /* device interface */ @@ -595,7 +481,7 @@ static device_method_t ata_pci_methods[] { 0, 0 } }; -devclass_t atapci_devclass; +devclass_t ata_pci_devclass; static driver_t ata_pci_driver = { "atapci", @@ -603,7 +489,7 @@ static driver_t ata_pci_driver = { sizeof(struct ata_pci_controller), }; -DRIVER_MODULE(atapci, pci, ata_pci_driver, atapci_devclass, 0, 0); +DRIVER_MODULE(atapci, pci, ata_pci_driver, ata_pci_devclass, 0, 0); MODULE_VERSION(atapci, 1); MODULE_DEPEND(atapci, ata, 1, 1, 1); @@ -728,3 +614,171 @@ driver_t ata_pcichannel_driver = { }; DRIVER_MODULE(ata, atapci, ata_pcichannel_driver, ata_devclass, 0, 0); + + +/* + * misc support fucntions + */ +int +ata_legacy(device_t dev) +{ + return (((pci_read_config(dev, PCIR_PROGIF, 1)&PCIP_STORAGE_IDE_MASTERDEV)&& + ((pci_read_config(dev, PCIR_PROGIF, 1) & + (PCIP_STORAGE_IDE_MODEPRIM | PCIP_STORAGE_IDE_MODESEC)) != + (PCIP_STORAGE_IDE_MODEPRIM | PCIP_STORAGE_IDE_MODESEC))) || + (!pci_read_config(dev, PCIR_BAR(0), 4) && + !pci_read_config(dev, PCIR_BAR(1), 4) && + !pci_read_config(dev, PCIR_BAR(2), 4) && + !pci_read_config(dev, PCIR_BAR(3), 4) && + !pci_read_config(dev, PCIR_BAR(5), 4))); +} + +void +ata_generic_intr(void *data) +{ + struct ata_pci_controller *ctlr = data; + struct ata_channel *ch; + int unit; + + for (unit = 0; unit < ctlr->channels; unit++) { + if ((ch = ctlr->interrupt[unit].argument)) + ctlr->interrupt[unit].function(ch); + } +} + +int +ata_setup_interrupt(device_t dev, void *intr_func) +{ + struct ata_pci_controller *ctlr = device_get_softc(dev); + int rid = ATA_IRQ_RID; + + if (!ata_legacy(dev)) { + if (!(ctlr->r_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_SHAREABLE | RF_ACTIVE))) { + device_printf(dev, "unable to map interrupt\n"); + return ENXIO; + } + if ((bus_setup_intr(dev, ctlr->r_irq, ATA_INTR_FLAGS, NULL, + intr_func, ctlr, &ctlr->handle))) { + /* SOS XXX release r_irq */ + device_printf(dev, "unable to setup interrupt\n"); + return ENXIO; + } + } + return 0; +} + +void +ata_set_desc(device_t dev) +{ + struct ata_pci_controller *ctlr = device_get_softc(dev); + char buffer[128]; + + sprintf(buffer, "%s %s %s controller", + ata_pcivendor2str(dev), ctlr->chip->text, + ata_mode2str(ctlr->chip->max_dma)); + device_set_desc_copy(dev, buffer); +} + +struct ata_chip_id * +ata_match_chip(device_t dev, struct ata_chip_id *index) +{ + while (index->chipid != 0) { + if (pci_get_devid(dev) == index->chipid && + pci_get_revid(dev) >= index->chiprev) + return index; + index++; + } + return NULL; +} + +struct ata_chip_id * +ata_find_chip(device_t dev, struct ata_chip_id *index, int slot) +{ + device_t *children; + int nchildren, i; + + if (device_get_children(device_get_parent(dev), &children, &nchildren)) + return 0; + + while (index->chipid != 0) { + for (i = 0; i < nchildren; i++) { + if (((slot >= 0 && pci_get_slot(children[i]) == slot) || + (slot < 0 && pci_get_slot(children[i]) <= -slot)) && + pci_get_devid(children[i]) == index->chipid && + pci_get_revid(children[i]) >= index->chiprev) { + free(children, M_TEMP); + return index; + } + } + index++; + } + free(children, M_TEMP); + return NULL; +} + +void +ata_print_cable(device_t dev, u_int8_t *who) +{ + device_printf(dev, + "DMA limited to UDMA33, %s found non-ATA66 cable\n", who); +} + +int +ata_check_80pin(device_t dev, int mode) +{ + struct ata_device *atadev = device_get_softc(dev); + + if (!ata_dma_check_80pin) { + if (bootverbose) + device_printf(dev, "Skipping 80pin cable check\n"); + return mode; + } + + if (mode > ATA_UDMA2 && !(atadev->param.hwres & ATA_CABLE_ID)) { + ata_print_cable(dev, "device"); + mode = ATA_UDMA2; + } + return mode; +} + +char * +ata_pcivendor2str(device_t dev) +{ + switch (pci_get_vendor(dev)) { + case ATA_ACARD_ID: return "Acard"; + case ATA_ACER_LABS_ID: return "AcerLabs"; + case ATA_AMD_ID: return "AMD"; + case ATA_ADAPTEC_ID: return "Adaptec"; + case ATA_ATI_ID: return "ATI"; + case ATA_CYRIX_ID: return "Cyrix"; + case ATA_CYPRESS_ID: return "Cypress"; + case ATA_HIGHPOINT_ID: return "HighPoint"; + case ATA_INTEL_ID: return "Intel"; + case ATA_ITE_ID: return "ITE"; + case ATA_JMICRON_ID: return "JMicron"; + case ATA_MARVELL_ID: return "Marvell"; + case ATA_NATIONAL_ID: return "National"; + case ATA_NETCELL_ID: return "Netcell"; + case ATA_NVIDIA_ID: return "nVidia"; + case ATA_PROMISE_ID: return "Promise"; + case ATA_SERVERWORKS_ID: return "ServerWorks"; + case ATA_SILICON_IMAGE_ID: return "SiI"; + case ATA_SIS_ID: return "SiS"; + case ATA_VIA_ID: return "VIA"; + case ATA_CENATEK_ID: return "Cenatek"; + case ATA_MICRON_ID: return "Micron"; + default: return "Generic"; + } +} + +int +ata_mode2idx(int mode) +{ + if ((mode & ATA_DMA_MASK) == ATA_UDMA0) + return (mode & ATA_MODE_MASK) + 8; + if ((mode & ATA_DMA_MASK) == ATA_WDMA0) + return (mode & ATA_MODE_MASK) + 5; + return (mode & ATA_MODE_MASK) - ATA_PIO0; +} + Modified: head/sys/dev/ata/ata-pci.h ============================================================================== --- head/sys/dev/ata/ata-pci.h Thu Oct 9 12:25:07 2008 (r183723) +++ head/sys/dev/ata/ata-pci.h Thu Oct 9 12:56:57 2008 (r183724) @@ -395,79 +395,6 @@ struct ata_connect_task { #define ATA_VIA6420 0x31491106 #define ATA_VIA6421 0x32491106 -/* chipset setup related defines */ -#define AHCI 1 -#define ATPOLD 1 - -#define ALIOLD 0x01 -#define ALINEW 0x02 -#define ALISATA 0x04 - -#define ATIPATA 0x01 -#define ATISATA 0x02 -#define ATIAHCI 0x04 - -#define HPT366 0 -#define HPT370 1 -#define HPT372 2 -#define HPT374 3 -#define HPTOLD 0x01 - -#define MV50XX 50 -#define MV60XX 60 -#define MV61XX 61 - -#define PROLD 0 -#define PRNEW 1 -#define PRTX 2 -#define PRMIO 3 -#define PRTX4 0x01 -#define PRSX4X 0x02 -#define PRSX6K 0x04 -#define PRPATA 0x08 -#define PRCMBO 0x10 -#define PRCMBO2 0x20 -#define PRSATA 0x40 -#define PRSATA2 0x80 - -#define SWKS33 0 -#define SWKS66 1 -#define SWKS100 2 -#define SWKSMIO 3 - -#define SIIMEMIO 1 -#define SIIPRBIO 2 -#define SIIINTR 0x01 -#define SIISETCLK 0x02 -#define SIIBUG 0x04 -#define SII4CH 0x08 - -#define SIS_SOUTH 1 -#define SISSATA 2 -#define SIS133NEW 3 -#define SIS133OLD 4 -#define SIS100NEW 5 -#define SIS100OLD 6 -#define SIS66 7 -#define SIS33 8 - -#define VIA33 0 -#define VIA66 1 -#define VIA100 2 -#define VIA133 3 -#define AMDNVIDIA 4 - -#define AMDCABLE 0x0001 -#define AMDBUG 0x0002 -#define NVIDIA 0x0004 -#define NV4 0x0010 -#define NVQ 0x0020 -#define VIACLK 0x0100 -#define VIABUG 0x0200 -#define VIABAR 0x0400 -#define VIAAHCI 0x0800 - - /* global prototypes ata-pci.c */ int ata_pci_probe(device_t dev); int ata_pci_attach(device_t dev); @@ -483,32 +410,62 @@ int ata_pci_status(device_t dev); void ata_pci_hw(device_t dev); void ata_pci_dmainit(device_t dev); char *ata_pcivendor2str(device_t dev); - - -/* global prototypes ata-chipset.c */ -int ata_generic_ident(device_t); -int ata_ahci_ident(device_t); -int ata_acard_ident(device_t); -int ata_ali_ident(device_t); -int ata_amd_ident(device_t); -int ata_adaptec_ident(device_t); -int ata_ati_ident(device_t); -int ata_cyrix_ident(device_t); -int ata_cypress_ident(device_t); -int ata_highpoint_ident(device_t); -int ata_intel_ident(device_t); -int ata_ite_ident(device_t); -int ata_jmicron_ident(device_t); -int ata_marvell_ident(device_t); -int ata_national_ident(device_t); -int ata_nvidia_ident(device_t); -int ata_netcell_ident(device_t); -int ata_promise_ident(device_t); -int ata_serverworks_ident(device_t); -int ata_sii_ident(device_t); -int ata_sis_ident(device_t); -int ata_via_ident(device_t); int ata_legacy(device_t); +void ata_generic_intr(void *data); +int ata_setup_interrupt(device_t dev, void *intr_func); +void ata_set_desc(device_t dev); +struct ata_chip_id *ata_match_chip(device_t dev, struct ata_chip_id *index); +struct ata_chip_id *ata_find_chip(device_t dev, struct ata_chip_id *index, int slot); +void ata_print_cable(device_t dev, u_int8_t *who); +int ata_check_80pin(device_t dev, int mode); +int ata_mode2idx(int mode); + +/* global prototypes ata-sata.c */ +void ata_sata_phy_event(void *context, int dummy); +void ata_sata_phy_check_events(device_t dev); +int ata_sata_phy_reset(device_t dev); +void ata_sata_setmode(device_t dev, int mode); +int ata_request2fis_h2d(struct ata_request *request, u_int8_t *fis); +void ata_pm_identify(device_t dev); + +/* global prototypes from chipsets/ata-*.c */ +int ata_ahci_chipinit(device_t); +int ata_ahci_allocate(device_t dev); +void ata_ahci_reset(device_t dev); +void ata_ahci_dmainit(device_t dev); +int ata_marvell_edma_chipinit(device_t); +int ata_sii_chipinit(device_t); /* global prototypes ata-dma.c */ void ata_dmainit(device_t); + +/* externs */ +extern devclass_t ata_pci_devclass; + +/* macro for easy definition of all driver module stuff */ +#define ATA_DECLARE_DRIVER(dname) \ +static device_method_t __CONCAT(dname,_methods)[] = { \ + DEVMETHOD(device_probe, __CONCAT(dname,_probe)), \ + DEVMETHOD(device_attach, ata_pci_attach), \ + DEVMETHOD(device_detach, ata_pci_detach), \ + DEVMETHOD(device_suspend, bus_generic_suspend), \ + DEVMETHOD(device_resume, bus_generic_resume), \ + DEVMETHOD(device_shutdown, bus_generic_shutdown), \ + DEVMETHOD(bus_alloc_resource, ata_pci_alloc_resource), \ + DEVMETHOD(bus_release_resource, ata_pci_release_resource), \ + DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), \ + DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), \ + DEVMETHOD(bus_setup_intr, ata_pci_setup_intr), \ + DEVMETHOD(bus_teardown_intr, ata_pci_teardown_intr), \ + { 0, 0 } \ +}; \ +static driver_t __CONCAT(dname,_driver) = { \ + "atapci", \ + __CONCAT(dname,_methods), \ + sizeof(struct ata_pci_controller) \ +}; \ +DRIVER_MODULE(dname, pci, __CONCAT(dname,_driver), ata_pci_devclass, 0, 0); \ +MODULE_VERSION(dname, 1); \ +MODULE_DEPEND(dname, ata, 1, 1, 1); \ +MODULE_DEPEND(dname, atapci, 1, 1, 1); + Added: head/sys/dev/ata/ata-sata.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/ata/ata-sata.c Thu Oct 9 12:56:57 2008 (r183724) @@ -0,0 +1,357 @@ +/*- + * Copyright (c) 1998 - 2008 Søren Schmidt + * 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, + * without modification, immediately at the beginning of the file. + * 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 "opt_ata.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* + * SATA support functions + */ +void +ata_sata_phy_event(void *context, int dummy) +{ + struct ata_connect_task *tp = (struct ata_connect_task *)context; + struct ata_channel *ch = device_get_softc(tp->dev); + device_t *children; + int nchildren, i; + + mtx_lock(&Giant); /* newbus suckage it needs Giant */ + if (tp->action == ATA_C_ATTACH) { + if (bootverbose) + device_printf(tp->dev, "CONNECTED\n"); + ATA_RESET(tp->dev); + ata_identify(tp->dev); + } + if (tp->action == ATA_C_DETACH) { + if (!device_get_children(tp->dev, &children, &nchildren)) { + for (i = 0; i < nchildren; i++) + if (children[i]) + device_delete_child(tp->dev, children[i]); + free(children, M_TEMP); + } + mtx_lock(&ch->state_mtx); + ch->state = ATA_IDLE; + mtx_unlock(&ch->state_mtx); + if (bootverbose) + device_printf(tp->dev, "DISCONNECTED\n"); + } + mtx_unlock(&Giant); /* suckage code dealt with, release Giant */ + free(tp, M_ATA); +} + +void +ata_sata_phy_check_events(device_t dev) +{ + struct ata_channel *ch = device_get_softc(dev); + u_int32_t error = ATA_IDX_INL(ch, ATA_SERROR); + + /* clear error bits/interrupt */ + ATA_IDX_OUTL(ch, ATA_SERROR, error); + + /* do we have any events flagged ? */ + if (error) { + struct ata_connect_task *tp; + u_int32_t status = ATA_IDX_INL(ch, ATA_SSTATUS); + + /* if we have a connection event deal with it */ + if ((error & ATA_SE_PHY_CHANGED) && + (tp = (struct ata_connect_task *) + malloc(sizeof(struct ata_connect_task), + M_ATA, M_NOWAIT | M_ZERO))) { + + if (((status & ATA_SS_CONWELL_MASK) == ATA_SS_CONWELL_GEN1) || + ((status & ATA_SS_CONWELL_MASK) == ATA_SS_CONWELL_GEN2)) { + if (bootverbose) + device_printf(dev, "CONNECT requested\n"); + tp->action = ATA_C_ATTACH; + } + else { + if (bootverbose) + device_printf(dev, "DISCONNECT requested\n"); + tp->action = ATA_C_DETACH; + } + tp->dev = dev; + TASK_INIT(&tp->task, 0, ata_sata_phy_event, tp); + taskqueue_enqueue(taskqueue_thread, &tp->task); + } + } +} + +static int +ata_sata_connect(struct ata_channel *ch) +{ + u_int32_t status; + int timeout; + + /* wait up to 1 second for "connect well" */ + for (timeout = 0; timeout < 100 ; timeout++) { + status = ATA_IDX_INL(ch, ATA_SSTATUS); + if ((status & ATA_SS_CONWELL_MASK) == ATA_SS_CONWELL_GEN1 || + (status & ATA_SS_CONWELL_MASK) == ATA_SS_CONWELL_GEN2) + break; + ata_udelay(10000); + } + if (timeout >= 100) { + if (bootverbose) + device_printf(ch->dev, "SATA connect status=%08x\n", status); + return 0; + } + if (bootverbose) + device_printf(ch->dev, "SATA connect time=%dms\n", timeout * 10); + + /* clear SATA error register */ + ATA_IDX_OUTL(ch, ATA_SERROR, ATA_IDX_INL(ch, ATA_SERROR)); + + return 1; +} + +int +ata_sata_phy_reset(device_t dev) +{ + struct ata_channel *ch = device_get_softc(dev); + int loop, retry; + + if ((ATA_IDX_INL(ch, ATA_SCONTROL) & ATA_SC_DET_MASK) == ATA_SC_DET_IDLE) + return ata_sata_connect(ch); + + for (retry = 0; retry < 10; retry++) { + for (loop = 0; loop < 10; loop++) { + ATA_IDX_OUTL(ch, ATA_SCONTROL, ATA_SC_DET_RESET); + ata_udelay(100); + if ((ATA_IDX_INL(ch, ATA_SCONTROL) & ATA_SC_DET_MASK) == + ATA_SC_DET_RESET) + break; + } + ata_udelay(5000); + for (loop = 0; loop < 10; loop++) { + ATA_IDX_OUTL(ch, ATA_SCONTROL, ATA_SC_DET_IDLE | + ATA_SC_IPM_DIS_PARTIAL | + ATA_SC_IPM_DIS_SLUMBER); + ata_udelay(100); + if ((ATA_IDX_INL(ch, ATA_SCONTROL) & ATA_SC_DET_MASK) == 0) + return ata_sata_connect(ch); + } + } + return 0; +} + +void +ata_sata_setmode(device_t dev, int mode) +{ + struct ata_device *atadev = device_get_softc(dev); + + /* + * if we detect that the device isn't a real SATA device we limit + * the transfer mode to UDMA5/ATA100. + * this works around the problems some devices has with the + * Marvell 88SX8030 SATA->PATA converters and UDMA6/ATA133. + */ + if (atadev->param.satacapabilities != 0x0000 && + atadev->param.satacapabilities != 0xffff) { + struct ata_channel *ch = device_get_softc(device_get_parent(dev)); + + /* on some drives we need to set the transfer mode */ + ata_controlcmd(dev, ATA_SETFEATURES, ATA_SF_SETXFER, 0, + ata_limit_mode(dev, mode, ATA_UDMA6)); + + /* query SATA STATUS for the speed */ + if (ch->r_io[ATA_SSTATUS].res && + ((ATA_IDX_INL(ch, ATA_SSTATUS) & ATA_SS_CONWELL_MASK) == + ATA_SS_CONWELL_GEN2)) + atadev->mode = ATA_SA300; + else + atadev->mode = ATA_SA150; + } + else { + mode = ata_limit_mode(dev, mode, ATA_UDMA5); + if (!ata_controlcmd(dev, ATA_SETFEATURES, ATA_SF_SETXFER, 0, mode)) + atadev->mode = mode; + } +} + +int +ata_request2fis_h2d(struct ata_request *request, u_int8_t *fis) +{ + struct ata_device *atadev = device_get_softc(request->dev); + + if (request->flags & ATA_R_ATAPI) { + fis[0] = 0x27; /* host to device */ + fis[1] = 0x80 | (atadev->unit & 0x0f); + fis[2] = ATA_PACKET_CMD; + if (request->flags & (ATA_R_READ | ATA_R_WRITE)) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Thu Oct 9 14:55:46 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2632A1065693; Thu, 9 Oct 2008 14:55:46 +0000 (UTC) (envelope-from jkoshy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 12D918FC0A; Thu, 9 Oct 2008 14:55:46 +0000 (UTC) (envelope-from jkoshy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m99EtkGv064641; Thu, 9 Oct 2008 14:55:46 GMT (envelope-from jkoshy@svn.freebsd.org) Received: (from jkoshy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m99EtkuB064638; Thu, 9 Oct 2008 14:55:46 GMT (envelope-from jkoshy@svn.freebsd.org) Message-Id: <200810091455.m99EtkuB064638@svn.freebsd.org> From: Joseph Koshy Date: Thu, 9 Oct 2008 14:55: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: r183725 - in head: lib/libpmc sys/dev/hwpmc 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: Thu, 09 Oct 2008 14:55:46 -0000 Author: jkoshy Date: Thu Oct 9 14:55:45 2008 New Revision: 183725 URL: http://svn.freebsd.org/changeset/base/183725 Log: - Sparsely number enumerations 'pmc_cputype' and 'pmc_event' in order to reduce ABI disruptions when new cpu types and new PMC events are added in the future. - Support alternate spellings for PMC events. Derive the canonical spelling of an event name from its enumeration name in 'enum pmc_event'. - Provide a way for users to disambiguate between identically named events supported by multiple classes of PMCs in a CPU. - Change libpmc's machine-dependent event specifier parsing code to better support CPUs containing two or more classes of PMC resources. Modified: head/lib/libpmc/libpmc.c head/sys/dev/hwpmc/pmc_events.h head/sys/sys/pmc.h Modified: head/lib/libpmc/libpmc.c ============================================================================== --- head/lib/libpmc/libpmc.c Thu Oct 9 12:56:57 2008 (r183724) +++ head/lib/libpmc/libpmc.c Thu Oct 9 14:55:45 2008 (r183725) @@ -59,6 +59,10 @@ static int p5_allocate_pmc(enum pmc_even static int p6_allocate_pmc(enum pmc_event _pe, char *_ctrspec, struct pmc_op_pmcallocate *_pmc_config); #endif +#if defined(__amd64__) || defined(__i386__) +static int tsc_allocate_pmc(enum pmc_event _pe, char *_ctrspec, + struct pmc_op_pmcallocate *_pmc_config); +#endif #define PMC_CALL(cmd, params) \ syscall(pmc_syscall, PMC_OP_##cmd, (params)) @@ -77,23 +81,96 @@ struct pmc_event_alias { static const struct pmc_event_alias *pmc_mdep_event_aliases; /* - * The pmc_event_descr table maps symbolic names known to the user + * The pmc_event_descr structure maps symbolic names known to the user * to integer codes used by the PMC KLD. */ struct pmc_event_descr { const char *pm_ev_name; enum pmc_event pm_ev_code; - enum pmc_class pm_ev_class; }; -static const struct pmc_event_descr -pmc_event_table[] = +/* + * The pmc_class_descr structure maps class name prefixes for + * event names to event tables and other PMC class data. + */ +struct pmc_class_descr { + const char *pm_evc_name; + size_t pm_evc_name_size; + enum pmc_class pm_evc_class; + const struct pmc_event_descr *pm_evc_event_table; + size_t pm_evc_event_table_size; + int (*pm_evc_allocate_pmc)(enum pmc_event _pe, + char *_ctrspec, struct pmc_op_pmcallocate *_pa); +}; + +#define PMC_TABLE_SIZE(N) (sizeof(N)/sizeof(N[0])) +#define PMC_EVENT_TABLE_SIZE(N) PMC_TABLE_SIZE(N##_event_table) + +#undef __PMC_EV +#define __PMC_EV(C,N) { #N, PMC_EV_ ## C ## _ ## N }, + +/* + * PMC_MDEP_TABLE(NAME, CLASS, ADDITIONAL_CLASSES...) + * + * Build an event descriptor table and a list of valid PMC classes. + */ +#define PMC_MDEP_TABLE(N,C,...) \ + static const struct pmc_event_descr N##_event_table[] = \ + { \ + __PMC_EV_##C() \ + }; \ + static const enum pmc_class N##_pmc_classes[] = { \ + PMC_CLASS_##C, __VA_ARGS__ \ + } + +PMC_MDEP_TABLE(k7, K7, PMC_CLASS_TSC); +PMC_MDEP_TABLE(k8, K8, PMC_CLASS_TSC); +PMC_MDEP_TABLE(p4, P4, PMC_CLASS_TSC); +PMC_MDEP_TABLE(p5, P5, PMC_CLASS_TSC); +PMC_MDEP_TABLE(p6, P6, PMC_CLASS_TSC); + +static const struct pmc_event_descr tsc_event_table[] = { -#undef __PMC_EV -#define __PMC_EV(C,N,EV) { #EV, PMC_EV_ ## C ## _ ## N, PMC_CLASS_ ## C }, - __PMC_EVENTS() + __PMC_EV_TSC() }; +#undef PMC_CLASS_TABLE_DESC +#define PMC_CLASS_TABLE_DESC(N, C) { \ + .pm_evc_name = #N "-", \ + .pm_evc_name_size = sizeof(#N "-") - 1, \ + .pm_evc_class = PMC_CLASS_##C , \ + .pm_evc_event_table = N##_event_table , \ + .pm_evc_event_table_size = \ + PMC_EVENT_TABLE_SIZE(N), \ + .pm_evc_allocate_pmc = N##_allocate_pmc \ + } + +static const struct pmc_class_descr pmc_class_table[] = +{ +#if defined(__i386__) + PMC_CLASS_TABLE_DESC(k7, K7), +#endif +#if defined(__i386__) || defined(__amd64__) + PMC_CLASS_TABLE_DESC(k8, K8), + PMC_CLASS_TABLE_DESC(p4, P4), +#endif +#if defined(__i386__) + PMC_CLASS_TABLE_DESC(p5, P5), + PMC_CLASS_TABLE_DESC(p6, P6), +#endif +#if defined(__i386__) || defined(__amd64__) + PMC_CLASS_TABLE_DESC(tsc, TSC) +#endif +}; + +static size_t pmc_event_class_table_size = + PMC_TABLE_SIZE(pmc_class_table); + +#undef PMC_CLASS_TABLE_DESC + +static const enum pmc_class *pmc_mdep_class_list; +static size_t pmc_mdep_class_list_size; + /* * Mapping tables, mapping enumeration values to human readable * strings. @@ -111,9 +188,14 @@ static const char * pmc_class_names[] = __PMC_CLASSES() }; -static const char * pmc_cputype_names[] = { +struct pmc_cputype_map { + enum pmc_class pm_cputype; + const char *pm_name; +}; + +static const struct pmc_cputype_map pmc_cputype_names[] = { #undef __PMC_CPU -#define __PMC_CPU(S, D) #S , +#define __PMC_CPU(S, V, D) { .pm_cputype = PMC_CPU_##S, .pm_name = #S } , __PMC_CPUS() }; @@ -139,11 +221,6 @@ static int pmc_syscall = -1; /* filled static struct pmc_cpuinfo cpu_info; /* filled in by pmc_init() */ - -/* Architecture dependent event parsing */ -static int (*pmc_mdep_allocate_pmc)(enum pmc_event _pe, char *_ctrspec, - struct pmc_op_pmcallocate *_pmc_config); - /* Event masks for events */ struct pmc_masks { const char *pm_name; @@ -167,7 +244,8 @@ pmc_parse_mask(const struct pmc_masks *p return (-1); c = 0; /* count of mask keywords seen */ while ((r = strsep(&q, "+")) != NULL) { - for (pm = pmask; pm->pm_name && strcmp(r, pm->pm_name); pm++) + for (pm = pmask; pm->pm_name && strcasecmp(r, pm->pm_name); + pm++) ; if (pm->pm_name == NULL) /* not found */ return (-1); @@ -215,14 +293,7 @@ k7_allocate_pmc(enum pmc_event pe, char uint32_t count, unitmask; pmc_config->pm_md.pm_amd.pm_amd_config = 0; - pmc_config->pm_caps |= PMC_CAP_READ; - - if (pe == PMC_EV_TSC_TSC) { - /* TSC events must be unqualified. */ - if (ctrspec && *ctrspec != '\0') - return (-1); - return (0); - } + pmc_config->pm_caps |= (PMC_CAP_READ | PMC_CAP_WRITE); if (pe == PMC_EV_K7_DC_REFILLS_FROM_L2 || pe == PMC_EV_K7_DC_REFILLS_FROM_SYSTEM || @@ -232,8 +303,6 @@ k7_allocate_pmc(enum pmc_event pe, char } else unitmask = has_unitmask = 0; - pmc_config->pm_caps |= PMC_CAP_WRITE; - while ((p = strsep(&ctrspec, ",")) != NULL) { if (KWPREFIXMATCH(p, K7_KW_COUNT "=")) { q = strchr(p, '='); @@ -514,16 +583,9 @@ k8_allocate_pmc(enum pmc_event pe, char uint32_t count, evmask; const struct pmc_masks *pm, *pmask; - pmc_config->pm_caps |= PMC_CAP_READ; + pmc_config->pm_caps |= (PMC_CAP_READ | PMC_CAP_WRITE); pmc_config->pm_md.pm_amd.pm_amd_config = 0; - if (pe == PMC_EV_TSC_TSC) { - /* TSC events must be unqualified. */ - if (ctrspec && *ctrspec != '\0') - return (-1); - return (0); - } - pmask = NULL; evmask = 0; @@ -597,8 +659,6 @@ k8_allocate_pmc(enum pmc_event pe, char break; /* no options defined */ } - pmc_config->pm_caps |= PMC_CAP_WRITE; - while ((p = strsep(&ctrspec, ",")) != NULL) { if (KWPREFIXMATCH(p, K8_KW_COUNT "=")) { q = strchr(p, '='); @@ -1005,22 +1065,14 @@ p4_allocate_pmc(enum pmc_event pe, char uint32_t evmask, cccractivemask; const struct pmc_masks *pm, *pmask; - pmc_config->pm_caps |= PMC_CAP_READ; + pmc_config->pm_caps |= (PMC_CAP_READ | PMC_CAP_WRITE); pmc_config->pm_md.pm_p4.pm_p4_cccrconfig = pmc_config->pm_md.pm_p4.pm_p4_escrconfig = 0; - if (pe == PMC_EV_TSC_TSC) { - /* TSC must not be further qualified */ - if (ctrspec && *ctrspec != '\0') - return (-1); - return (0); - } - pmask = NULL; evmask = 0; cccractivemask = 0x3; has_tag = has_busreqtype = 0; - pmc_config->pm_caps |= PMC_CAP_WRITE; #define __P4SETMASK(M) do { \ pmask = p4_mask_##M; \ @@ -1166,13 +1218,13 @@ p4_allocate_pmc(enum pmc_event pe, char if (*++q == '\0') /* skip '=' */ return (-1); - if (strcmp(q, P4_KW_ACTIVE_NONE) == 0) + if (strcasecmp(q, P4_KW_ACTIVE_NONE) == 0) cccractivemask = 0x0; - else if (strcmp(q, P4_KW_ACTIVE_SINGLE) == 0) + else if (strcasecmp(q, P4_KW_ACTIVE_SINGLE) == 0) cccractivemask = 0x1; - else if (strcmp(q, P4_KW_ACTIVE_BOTH) == 0) + else if (strcasecmp(q, P4_KW_ACTIVE_BOTH) == 0) cccractivemask = 0x2; - else if (strcmp(q, P4_KW_ACTIVE_ANY) == 0) + else if (strcasecmp(q, P4_KW_ACTIVE_ANY) == 0) cccractivemask = 0x3; else return (-1); @@ -1442,16 +1494,9 @@ p6_allocate_pmc(enum pmc_event pe, char int count, n; const struct pmc_masks *pm, *pmask; - pmc_config->pm_caps |= PMC_CAP_READ; + pmc_config->pm_caps |= (PMC_CAP_READ | PMC_CAP_WRITE); pmc_config->pm_md.pm_ppro.pm_ppro_config = 0; - if (pe == PMC_EV_TSC_TSC) { - if (ctrspec && *ctrspec != '\0') - return (-1); - return (0); - } - - pmc_config->pm_caps |= PMC_CAP_WRITE; evmask = 0; #define P6MASKSET(M) pmask = p6_mask_ ## M @@ -1638,6 +1683,93 @@ p6_allocate_pmc(enum pmc_event pe, char #endif +#if defined(__i386__) || defined(__amd64__) +static int +tsc_allocate_pmc(enum pmc_event pe, char *ctrspec, + struct pmc_op_pmcallocate *pmc_config) +{ + if (pe != PMC_EV_TSC_TSC) + return (-1); + + /* TSC events must be unqualified. */ + if (ctrspec && *ctrspec != '\0') + return (-1); + + pmc_config->pm_md.pm_amd.pm_amd_config = 0; + pmc_config->pm_caps |= PMC_CAP_READ; + + return (0); +} +#endif + +/* + * Match an event name `name' with its canonical form. + * + * Matches are case insensitive and spaces, underscores and hyphen + * characters are considered to match each other. + * + * Returns 1 for a match, 0 otherwise. + */ + +static int +pmc_match_event_name(const char *name, const char *canonicalname) +{ + int cc, nc; + const unsigned char *c, *n; + + c = (const unsigned char *) canonicalname; + n = (const unsigned char *) name; + + for (; (nc = *n) && (cc = *c); n++, c++) { + + if (toupper(nc) == cc) + continue; + + if ((nc == ' ' || nc == '_' || nc == '-') && + (cc == ' ' || cc == '_' || cc == '-')) + continue; + + return (0); + } + + if (*n == '\0' && *c == '\0') + return (1); + + return (0); +} + +/* + * Match an event name against all the event named supported by a + * PMC class. + * + * Returns an event descriptor pointer on match or NULL otherwise. + */ +static const struct pmc_event_descr * +pmc_match_event_class(const char *name, + const struct pmc_class_descr *pcd) +{ + size_t n; + const struct pmc_event_descr *ev; + + ev = pcd->pm_evc_event_table; + for (n = 0; n < pcd->pm_evc_event_table_size; n++, ev++) + if (pmc_match_event_name(name, ev->pm_ev_name)) + return (ev); + + return (NULL); +} + +static int +pmc_mdep_is_compatible_class(enum pmc_class pc) +{ + size_t n; + + for (n = 0; n < pmc_mdep_class_list_size; n++) + if (pmc_mdep_class_list[n] == pc) + return (1); + return (0); +} + /* * API entry points */ @@ -1646,12 +1778,14 @@ int pmc_allocate(const char *ctrspec, enum pmc_mode mode, uint32_t flags, int cpu, pmc_id_t *pmcid) { + size_t n; int retval; - enum pmc_event pe; char *r, *spec_copy; const char *ctrname; - const struct pmc_event_alias *p; + const struct pmc_event_descr *ev; + const struct pmc_event_alias *alias; struct pmc_op_pmcallocate pmc_config; + const struct pmc_class_descr *pcd; spec_copy = NULL; retval = -1; @@ -1664,9 +1798,9 @@ pmc_allocate(const char *ctrspec, enum p /* replace an event alias with the canonical event specifier */ if (pmc_mdep_event_aliases) - for (p = pmc_mdep_event_aliases; p->pm_alias; p++) - if (!strcmp(ctrspec, p->pm_alias)) { - spec_copy = strdup(p->pm_spec); + for (alias = pmc_mdep_event_aliases; alias->pm_alias; alias++) + if (!strcasecmp(ctrspec, alias->pm_alias)) { + spec_copy = strdup(alias->pm_spec); break; } @@ -1676,19 +1810,43 @@ pmc_allocate(const char *ctrspec, enum p r = spec_copy; ctrname = strsep(&r, ","); - /* look for the given counter name */ - for (pe = PMC_EVENT_FIRST; pe < (PMC_EVENT_LAST+1); pe++) - if (!strcmp(ctrname, pmc_event_table[pe].pm_ev_name)) + /* + * If a explicit class prefix was given by the user, restrict the + * search for the event to the specified PMC class. + */ + ev = NULL; + for (n = 0; n < pmc_event_class_table_size; n++) { + pcd = &pmc_class_table[n]; + if (pmc_mdep_is_compatible_class(pcd->pm_evc_class) && + strncasecmp(ctrname, pcd->pm_evc_name, + pcd->pm_evc_name_size) == 0) { + if ((ev = pmc_match_event_class(ctrname + + pcd->pm_evc_name_size, pcd)) == NULL) { + errno = EINVAL; + goto out; + } break; + } + } - if (pe > PMC_EVENT_LAST) { + /* + * Otherwise, search for this event in all compatible PMC + * classes. + */ + for (n = 0; ev == NULL && n < pmc_event_class_table_size; n++) { + pcd = &pmc_class_table[n]; + if (pmc_mdep_is_compatible_class(pcd->pm_evc_class)) + ev = pmc_match_event_class(ctrname, pcd); + } + + if (ev == NULL) { errno = EINVAL; goto out; } bzero(&pmc_config, sizeof(pmc_config)); - pmc_config.pm_ev = pmc_event_table[pe].pm_ev_code; - pmc_config.pm_class = pmc_event_table[pe].pm_ev_class; + pmc_config.pm_ev = ev->pm_ev_code; + pmc_config.pm_class = pcd->pm_evc_class; pmc_config.pm_cpu = cpu; pmc_config.pm_mode = mode; pmc_config.pm_flags = flags; @@ -1696,7 +1854,7 @@ pmc_allocate(const char *ctrspec, enum p if (PMC_IS_SAMPLING_MODE(mode)) pmc_config.pm_caps |= PMC_CAP_INTERRUPT; - if (pmc_mdep_allocate_pmc(pe, r, &pmc_config) < 0) { + if (pcd->pm_evc_allocate_pmc(ev->pm_ev_code, r, &pmc_config) < 0) { errno = EINVAL; goto out; } @@ -1817,28 +1975,28 @@ pmc_event_names_of_class(enum pmc_class switch (cl) { case PMC_CLASS_TSC: - ev = &pmc_event_table[PMC_EV_TSC_TSC]; - count = 1; + ev = tsc_event_table; + count = PMC_EVENT_TABLE_SIZE(tsc); break; case PMC_CLASS_K7: - ev = &pmc_event_table[PMC_EV_K7_FIRST]; - count = PMC_EV_K7_LAST - PMC_EV_K7_FIRST + 1; + ev = k7_event_table; + count = PMC_EVENT_TABLE_SIZE(k7); break; case PMC_CLASS_K8: - ev = &pmc_event_table[PMC_EV_K8_FIRST]; - count = PMC_EV_K8_LAST - PMC_EV_K8_FIRST + 1; + ev = k8_event_table; + count = PMC_EVENT_TABLE_SIZE(k8); + break; + case PMC_CLASS_P4: + ev = p4_event_table; + count = PMC_EVENT_TABLE_SIZE(p4); break; case PMC_CLASS_P5: - ev = &pmc_event_table[PMC_EV_P5_FIRST]; - count = PMC_EV_P5_LAST - PMC_EV_P5_FIRST + 1; + ev = p5_event_table; + count = PMC_EVENT_TABLE_SIZE(p5); break; case PMC_CLASS_P6: - ev = &pmc_event_table[PMC_EV_P6_FIRST]; - count = PMC_EV_P6_LAST - PMC_EV_P6_FIRST + 1; - break; - case PMC_CLASS_P4: - ev = &pmc_event_table[PMC_EV_P4_FIRST]; - count = PMC_EV_P4_LAST - PMC_EV_P4_FIRST + 1; + ev = p6_event_table; + count = PMC_EVENT_TABLE_SIZE(p6); break; default: errno = EINVAL; @@ -1937,33 +2095,35 @@ pmc_init(void) for (n = 0; n < cpu_info.pm_nclass; n++) cpu_info.pm_classes[n] = op_cpu_info.pm_classes[n]; - /* set parser pointer */ +#define PMC_MDEP_INIT(C) do { \ + pmc_mdep_event_aliases = C##_aliases; \ + pmc_mdep_class_list = C##_pmc_classes; \ + pmc_mdep_class_list_size = \ + PMC_TABLE_SIZE(C##_pmc_classes); \ + } while (0) + + /* Configure the event name parser. */ switch (cpu_info.pm_cputype) { #if defined(__i386__) case PMC_CPU_AMD_K7: - pmc_mdep_event_aliases = k7_aliases; - pmc_mdep_allocate_pmc = k7_allocate_pmc; + PMC_MDEP_INIT(k7); break; case PMC_CPU_INTEL_P5: - pmc_mdep_event_aliases = p5_aliases; - pmc_mdep_allocate_pmc = p5_allocate_pmc; + PMC_MDEP_INIT(p5); break; case PMC_CPU_INTEL_P6: /* P6 ... Pentium M CPUs have */ case PMC_CPU_INTEL_PII: /* similar PMCs. */ case PMC_CPU_INTEL_PIII: case PMC_CPU_INTEL_PM: - pmc_mdep_event_aliases = p6_aliases; - pmc_mdep_allocate_pmc = p6_allocate_pmc; + PMC_MDEP_INIT(p6); break; #endif #if defined(__amd64__) || defined(__i386__) - case PMC_CPU_INTEL_PIV: - pmc_mdep_event_aliases = p4_aliases; - pmc_mdep_allocate_pmc = p4_allocate_pmc; - break; case PMC_CPU_AMD_K8: - pmc_mdep_event_aliases = k8_aliases; - pmc_mdep_allocate_pmc = k8_allocate_pmc; + PMC_MDEP_INIT(k8); + break; + case PMC_CPU_INTEL_PIV: + PMC_MDEP_INIT(p4); break; #endif @@ -2013,9 +2173,12 @@ pmc_name_of_class(enum pmc_class pc) const char * pmc_name_of_cputype(enum pmc_cputype cp) { - if ((int) cp >= PMC_CPU_FIRST && - cp <= PMC_CPU_LAST) - return (pmc_cputype_names[cp]); + size_t n; + + for (n = 0; n < PMC_TABLE_SIZE(pmc_cputype_names); n++) + if (cp == pmc_cputype_names[n].pm_cputype) + return (pmc_cputype_names[n].pm_name); + errno = EINVAL; return (NULL); } @@ -2034,9 +2197,32 @@ pmc_name_of_disposition(enum pmc_disp pd const char * pmc_name_of_event(enum pmc_event pe) { - if ((int) pe >= PMC_EVENT_FIRST && - pe <= PMC_EVENT_LAST) - return (pmc_event_table[pe].pm_ev_name); + const struct pmc_event_descr *ev, *evfence; + + ev = evfence = NULL; + if (pe >= PMC_EV_K7_FIRST && pe <= PMC_EV_K7_LAST) { + ev = k7_event_table; + evfence = k7_event_table + PMC_EVENT_TABLE_SIZE(k7); + } else if (pe >= PMC_EV_K8_FIRST && pe <= PMC_EV_K8_LAST) { + ev = k8_event_table; + evfence = k8_event_table + PMC_EVENT_TABLE_SIZE(k8); + } else if (pe >= PMC_EV_P4_FIRST && pe <= PMC_EV_P4_LAST) { + ev = p4_event_table; + evfence = p4_event_table + PMC_EVENT_TABLE_SIZE(p4); + } else if (pe >= PMC_EV_P5_FIRST && pe <= PMC_EV_P5_LAST) { + ev = p5_event_table; + evfence = p5_event_table + PMC_EVENT_TABLE_SIZE(p5); + } else if (pe >= PMC_EV_P6_FIRST && pe <= PMC_EV_P6_LAST) { + ev = p6_event_table; + evfence = p6_event_table + PMC_EVENT_TABLE_SIZE(p6); + } else if (pe == PMC_EV_TSC_TSC) { + ev = tsc_event_table; + evfence = tsc_event_table + PMC_EVENT_TABLE_SIZE(tsc); + } + + for (; ev != evfence; ev++) + if (pe == ev->pm_ev_code) + return (ev->pm_ev_name); errno = EINVAL; return (NULL); Modified: head/sys/dev/hwpmc/pmc_events.h ============================================================================== --- head/sys/dev/hwpmc/pmc_events.h Thu Oct 9 12:56:57 2008 (r183724) +++ head/sys/dev/hwpmc/pmc_events.h Thu Oct 9 14:55:45 2008 (r183725) @@ -41,35 +41,30 @@ * Optimization Guide" [Doc#22007K, Feb 2002] */ -#define __PMC_EV_K7() \ -__PMC_EV(K7, DC_ACCESSES, k7-dc-accesses) \ -__PMC_EV(K7, DC_MISSES, k7-dc-misses) \ -__PMC_EV(K7, DC_REFILLS_FROM_L2, k7-dc-refills-from-l2) \ -__PMC_EV(K7, DC_REFILLS_FROM_SYSTEM, k7-dc-refills-from-system) \ -__PMC_EV(K7, DC_WRITEBACKS, k7-dc-writebacks) \ -__PMC_EV(K7, L1_DTLB_MISS_AND_L2_DTLB_HITS, \ - k7-l1-dtlb-miss-and-l2-dtlb-hits) \ -__PMC_EV(K7, L1_AND_L2_DTLB_MISSES, k7-l1-and-l2-dtlb-misses) \ -__PMC_EV(K7, MISALIGNED_REFERENCES, k7-misaligned-references) \ -__PMC_EV(K7, IC_FETCHES, k7-ic-fetches) \ -__PMC_EV(K7, IC_MISSES, k7-ic-misses) \ -__PMC_EV(K7, L1_ITLB_MISSES, k7-l1-itlb-misses) \ -__PMC_EV(K7, L1_L2_ITLB_MISSES, k7-l1-l2-itlb-misses) \ -__PMC_EV(K7, RETIRED_INSTRUCTIONS, k7-retired-instructions) \ -__PMC_EV(K7, RETIRED_OPS, k7-retired-ops) \ -__PMC_EV(K7, RETIRED_BRANCHES, k7-retired-branches) \ -__PMC_EV(K7, RETIRED_BRANCHES_MISPREDICTED, \ - k7-retired-branches-mispredicted) \ -__PMC_EV(K7, RETIRED_TAKEN_BRANCHES, k7-retired-taken-branches) \ -__PMC_EV(K7, RETIRED_TAKEN_BRANCHES_MISPREDICTED, \ - k7-retired-taken-branches-mispredicted) \ -__PMC_EV(K7, RETIRED_FAR_CONTROL_TRANSFERS, \ - k7-retired-far-control-transfers) \ -__PMC_EV(K7, RETIRED_RESYNC_BRANCHES, k7-retired-resync-branches) \ -__PMC_EV(K7, INTERRUPTS_MASKED_CYCLES, k7-interrupts-masked-cycles) \ -__PMC_EV(K7, INTERRUPTS_MASKED_WHILE_PENDING_CYCLES, \ - k7-interrupts-masked-while-pending-cycles) \ -__PMC_EV(K7, HARDWARE_INTERRUPTS, k7-hardware-interrupts) +#define __PMC_EV_K7() \ +__PMC_EV(K7, DC_ACCESSES) \ +__PMC_EV(K7, DC_MISSES) \ +__PMC_EV(K7, DC_REFILLS_FROM_L2) \ +__PMC_EV(K7, DC_REFILLS_FROM_SYSTEM) \ +__PMC_EV(K7, DC_WRITEBACKS) \ +__PMC_EV(K7, L1_DTLB_MISS_AND_L2_DTLB_HITS) \ +__PMC_EV(K7, L1_AND_L2_DTLB_MISSES) \ +__PMC_EV(K7, MISALIGNED_REFERENCES) \ +__PMC_EV(K7, IC_FETCHES) \ +__PMC_EV(K7, IC_MISSES) \ +__PMC_EV(K7, L1_ITLB_MISSES) \ +__PMC_EV(K7, L1_L2_ITLB_MISSES) \ +__PMC_EV(K7, RETIRED_INSTRUCTIONS) \ +__PMC_EV(K7, RETIRED_OPS) \ +__PMC_EV(K7, RETIRED_BRANCHES) \ +__PMC_EV(K7, RETIRED_BRANCHES_MISPREDICTED) \ +__PMC_EV(K7, RETIRED_TAKEN_BRANCHES) \ +__PMC_EV(K7, RETIRED_TAKEN_BRANCHES_MISPREDICTED) \ +__PMC_EV(K7, RETIRED_FAR_CONTROL_TRANSFERS) \ +__PMC_EV(K7, RETIRED_RESYNC_BRANCHES) \ +__PMC_EV(K7, INTERRUPTS_MASKED_CYCLES) \ +__PMC_EV(K7, INTERRUPTS_MASKED_WHILE_PENDING_CYCLES) \ +__PMC_EV(K7, HARDWARE_INTERRUPTS) #define PMC_EV_K7_FIRST PMC_EV_K7_DC_ACCESSES #define PMC_EV_K7_LAST PMC_EV_K7_HARDWARE_INTERRUPTS @@ -79,169 +74,165 @@ __PMC_EV(K7, HARDWARE_INTERRUPTS, k7-har * Developer's Manual, Volume 3: System Programming Guide" [245472-012] */ -#define __PMC_EV_P4() \ -__PMC_EV(P4, TC_DELIVER_MODE, p4-tc-deliver-mode) \ -__PMC_EV(P4, BPU_FETCH_REQUEST, p4-bpu-fetch-request) \ -__PMC_EV(P4, ITLB_REFERENCE, p4-itlb-reference) \ -__PMC_EV(P4, MEMORY_CANCEL, p4-memory-cancel) \ -__PMC_EV(P4, MEMORY_COMPLETE, p4-memory-complete) \ -__PMC_EV(P4, LOAD_PORT_REPLAY, p4-load-port-replay) \ -__PMC_EV(P4, STORE_PORT_REPLAY, p4-store-port-replay) \ -__PMC_EV(P4, MOB_LOAD_REPLAY, p4-mob-load-replay) \ -__PMC_EV(P4, PAGE_WALK_TYPE, p4-page-walk-type) \ -__PMC_EV(P4, BSQ_CACHE_REFERENCE, p4-bsq-cache-reference) \ -__PMC_EV(P4, IOQ_ALLOCATION, p4-ioq-allocation) \ -__PMC_EV(P4, IOQ_ACTIVE_ENTRIES, p4-ioq-active-entries) \ -__PMC_EV(P4, FSB_DATA_ACTIVITY, p4-fsb-data-activity) \ -__PMC_EV(P4, BSQ_ALLOCATION, p4-bsq-allocation) \ -__PMC_EV(P4, BSQ_ACTIVE_ENTRIES, p4-bsq-active-entries) \ -__PMC_EV(P4, SSE_INPUT_ASSIST, p4-sse-input-assist) \ -__PMC_EV(P4, PACKED_SP_UOP, p4-packed-sp-uop) \ -__PMC_EV(P4, PACKED_DP_UOP, p4-packed-dp-uop) \ -__PMC_EV(P4, SCALAR_SP_UOP, p4-scalar-sp-uop) \ -__PMC_EV(P4, SCALAR_DP_UOP, p4-scalar-dp-uop) \ -__PMC_EV(P4, 64BIT_MMX_UOP, p4-64bit-mmx-uop) \ -__PMC_EV(P4, 128BIT_MMX_UOP, p4-128bit-mmx-uop) \ -__PMC_EV(P4, X87_FP_UOP, p4-x87-fp-uop) \ -__PMC_EV(P4, X87_SIMD_MOVES_UOP, p4-x87-simd-moves-uop) \ -__PMC_EV(P4, GLOBAL_POWER_EVENTS, p4-global-power-events) \ -__PMC_EV(P4, TC_MS_XFER, p4-tc-ms-xfer) \ -__PMC_EV(P4, UOP_QUEUE_WRITES, p4-uop-queue-writes) \ -__PMC_EV(P4, RETIRED_MISPRED_BRANCH_TYPE, \ - p4-retired-mispred-branch-type) \ -__PMC_EV(P4, RETIRED_BRANCH_TYPE, p4-retired-branch-type) \ -__PMC_EV(P4, RESOURCE_STALL, p4-resource-stall) \ -__PMC_EV(P4, WC_BUFFER, p4-wc-buffer) \ -__PMC_EV(P4, B2B_CYCLES, p4-b2b-cycles) \ -__PMC_EV(P4, BNR, p4-bnr) \ -__PMC_EV(P4, SNOOP, p4-snoop) \ -__PMC_EV(P4, RESPONSE, p4-response) \ -__PMC_EV(P4, FRONT_END_EVENT, p4-front-end-event) \ -__PMC_EV(P4, EXECUTION_EVENT, p4-execution-event) \ -__PMC_EV(P4, REPLAY_EVENT, p4-replay-event) \ -__PMC_EV(P4, INSTR_RETIRED, p4-instr-retired) \ -__PMC_EV(P4, UOPS_RETIRED, p4-uops-retired) \ -__PMC_EV(P4, UOP_TYPE, p4-uop-type) \ -__PMC_EV(P4, BRANCH_RETIRED, p4-branch-retired) \ -__PMC_EV(P4, MISPRED_BRANCH_RETIRED, p4-mispred-branch-retired) \ -__PMC_EV(P4, X87_ASSIST, p4-x87-assist) \ -__PMC_EV(P4, MACHINE_CLEAR, p4-machine-clear) +#define __PMC_EV_P4() \ +__PMC_EV(P4, TC_DELIVER_MODE) \ +__PMC_EV(P4, BPU_FETCH_REQUEST) \ +__PMC_EV(P4, ITLB_REFERENCE) \ +__PMC_EV(P4, MEMORY_CANCEL) \ +__PMC_EV(P4, MEMORY_COMPLETE) \ +__PMC_EV(P4, LOAD_PORT_REPLAY) \ +__PMC_EV(P4, STORE_PORT_REPLAY) \ +__PMC_EV(P4, MOB_LOAD_REPLAY) \ +__PMC_EV(P4, PAGE_WALK_TYPE) \ +__PMC_EV(P4, BSQ_CACHE_REFERENCE) \ +__PMC_EV(P4, IOQ_ALLOCATION) \ +__PMC_EV(P4, IOQ_ACTIVE_ENTRIES) \ +__PMC_EV(P4, FSB_DATA_ACTIVITY) \ +__PMC_EV(P4, BSQ_ALLOCATION) \ +__PMC_EV(P4, BSQ_ACTIVE_ENTRIES) \ +__PMC_EV(P4, SSE_INPUT_ASSIST) \ +__PMC_EV(P4, PACKED_SP_UOP) \ +__PMC_EV(P4, PACKED_DP_UOP) \ +__PMC_EV(P4, SCALAR_SP_UOP) \ +__PMC_EV(P4, SCALAR_DP_UOP) \ +__PMC_EV(P4, 64BIT_MMX_UOP) \ +__PMC_EV(P4, 128BIT_MMX_UOP) \ +__PMC_EV(P4, X87_FP_UOP) \ +__PMC_EV(P4, X87_SIMD_MOVES_UOP) \ +__PMC_EV(P4, GLOBAL_POWER_EVENTS) \ +__PMC_EV(P4, TC_MS_XFER) \ +__PMC_EV(P4, UOP_QUEUE_WRITES) \ +__PMC_EV(P4, RETIRED_MISPRED_BRANCH_TYPE) \ +__PMC_EV(P4, RETIRED_BRANCH_TYPE) \ +__PMC_EV(P4, RESOURCE_STALL) \ +__PMC_EV(P4, WC_BUFFER) \ +__PMC_EV(P4, B2B_CYCLES) \ +__PMC_EV(P4, BNR) \ +__PMC_EV(P4, SNOOP) \ +__PMC_EV(P4, RESPONSE) \ +__PMC_EV(P4, FRONT_END_EVENT) \ +__PMC_EV(P4, EXECUTION_EVENT) \ +__PMC_EV(P4, REPLAY_EVENT) \ +__PMC_EV(P4, INSTR_RETIRED) \ +__PMC_EV(P4, UOPS_RETIRED) \ +__PMC_EV(P4, UOP_TYPE) \ +__PMC_EV(P4, BRANCH_RETIRED) \ +__PMC_EV(P4, MISPRED_BRANCH_RETIRED) \ +__PMC_EV(P4, X87_ASSIST) \ +__PMC_EV(P4, MACHINE_CLEAR) #define PMC_EV_P4_FIRST PMC_EV_P4_TC_DELIVER_MODE #define PMC_EV_P4_LAST PMC_EV_P4_MACHINE_CLEAR /* Intel Pentium Pro, P-II, P-III and Pentium-M style events */ -#define __PMC_EV_P6() \ -__PMC_EV(P6, DATA_MEM_REFS, p6-data-mem-refs) \ -__PMC_EV(P6, DCU_LINES_IN, p6-dcu-lines-in) \ -__PMC_EV(P6, DCU_M_LINES_IN, p6-dcu-m-lines-in) \ -__PMC_EV(P6, DCU_M_LINES_OUT, p6-dcu-m-lines-out) \ -__PMC_EV(P6, DCU_MISS_OUTSTANDING, p6-dcu-miss-outstanding) \ -__PMC_EV(P6, IFU_FETCH, p6-ifu-ifetch) \ -__PMC_EV(P6, IFU_FETCH_MISS, p6-ifu-ifetch-miss) \ -__PMC_EV(P6, ITLB_MISS, p6-itlb-miss) \ -__PMC_EV(P6, IFU_MEM_STALL, p6-ifu-mem-stall) \ -__PMC_EV(P6, ILD_STALL, p6-ild-stall) \ -__PMC_EV(P6, L2_IFETCH, p6-l2-ifetch) \ -__PMC_EV(P6, L2_LD, p6-l2-ld) \ -__PMC_EV(P6, L2_ST, p6-l2-st) \ -__PMC_EV(P6, L2_LINES_IN, p6-l2-lines-in) \ -__PMC_EV(P6, L2_LINES_OUT, p6-l2-lines-out) \ -__PMC_EV(P6, L2_M_LINES_INM, p6-l2-m-lines-inm) \ -__PMC_EV(P6, L2_M_LINES_OUTM, p6-l2-m-lines-outm) \ -__PMC_EV(P6, L2_RQSTS, p6-l2-rqsts) \ -__PMC_EV(P6, L2_ADS, p6-l2-ads) \ -__PMC_EV(P6, L2_DBUS_BUSY, p6-l2-dbus-busy) \ -__PMC_EV(P6, L2_DBUS_BUSY_RD, p6-l2-dbus-busy-rd) \ -__PMC_EV(P6, BUS_DRDY_CLOCKS, p6-bus-drdy-clocks) \ -__PMC_EV(P6, BUS_LOCK_CLOCKS, p6-bus-lock-clocks) \ -__PMC_EV(P6, BUS_REQ_OUTSTANDING, p6-bus-req-outstanding) \ -__PMC_EV(P6, BUS_TRAN_BRD, p6-bus-tran-brd) \ -__PMC_EV(P6, BUS_TRAN_RFO, p6-bus-tran-rfo) \ -__PMC_EV(P6, BUS_TRANS_WB, p6-bus-trans-wb) \ -__PMC_EV(P6, BUS_TRAN_IFETCH, p6-bus-tran-ifetch) \ -__PMC_EV(P6, BUS_TRAN_INVAL, p6-bus-tran-inval) \ -__PMC_EV(P6, BUS_TRAN_PWR, p6-bus-tran-pwr) \ -__PMC_EV(P6, BUS_TRANS_P, p6-bus-trans-p) \ -__PMC_EV(P6, BUS_TRANS_IO, p6-bus-trans-io) \ -__PMC_EV(P6, BUS_TRAN_DEF, p6-bus-tran-def) \ -__PMC_EV(P6, BUS_TRAN_BURST, p6-bus-tran-burst) \ -__PMC_EV(P6, BUS_TRAN_ANY, p6-bus-tran-any) \ -__PMC_EV(P6, BUS_TRAN_MEM, p6-bus-tran-mem) \ -__PMC_EV(P6, BUS_DATA_RCV, p6-bus-data-rcv) \ -__PMC_EV(P6, BUS_BNR_DRV, p6-bus-bnr-drv) \ -__PMC_EV(P6, BUS_HIT_DRV, p6-bus-hit-drv) \ -__PMC_EV(P6, BUS_HITM_DRV, p6-bus-hitm-drv) \ -__PMC_EV(P6, BUS_SNOOP_STALL, p6-bus-snoop-stall) \ -__PMC_EV(P6, FLOPS, p6-flops) \ -__PMC_EV(P6, FP_COMPS_OPS_EXE, p6-fp-comps-ops-exe) \ -__PMC_EV(P6, FP_ASSIST, p6-fp-assist) \ -__PMC_EV(P6, MUL, p6-mul) \ -__PMC_EV(P6, DIV, p6-div) \ -__PMC_EV(P6, CYCLES_DIV_BUSY, p6-cycles-div-busy) \ -__PMC_EV(P6, LD_BLOCKS, p6-ld-blocks) \ -__PMC_EV(P6, SB_DRAINS, p6-sb-drains) \ -__PMC_EV(P6, MISALIGN_MEM_REF, p6-misalign-mem-ref) \ -__PMC_EV(P6, EMON_KNI_PREF_DISPATCHED, p6-emon-kni-pref-dispatched) \ -__PMC_EV(P6, EMON_KNI_PREF_MISS, p6-emon-kni-pref-miss) \ -__PMC_EV(P6, INST_RETIRED, p6-inst-retired) \ -__PMC_EV(P6, UOPS_RETIRED, p6-uops-retired) \ -__PMC_EV(P6, INST_DECODED, p6-inst-decoded) \ -__PMC_EV(P6, EMON_KNI_INST_RETIRED, p6-emon-kni-inst-retired) \ -__PMC_EV(P6, EMON_KNI_COMP_INST_RET, p6-emon-kni-comp-inst-ret) \ -__PMC_EV(P6, HW_INT_RX, p6-hw-int-rx) \ -__PMC_EV(P6, CYCLES_INT_MASKED, p6-cycles-int-masked) \ -__PMC_EV(P6, CYCLES_INT_PENDING_AND_MASKED, \ - p6-cycles-int-pending-and-masked) \ -__PMC_EV(P6, BR_INST_RETIRED, p6-br-inst-retired) \ -__PMC_EV(P6, BR_MISS_PRED_RETIRED, p6-br-miss-pred-retired) \ -__PMC_EV(P6, BR_TAKEN_RETIRED, p6-br-taken-retired) \ -__PMC_EV(P6, BR_MISS_PRED_TAKEN_RET, p6-br-miss-pred-taken-ret) \ -__PMC_EV(P6, BR_INST_DECODED, p6-br-inst-decoded) \ -__PMC_EV(P6, BTB_MISSES, p6-btb-misses) \ -__PMC_EV(P6, BR_BOGUS, p6-br-bogus) \ -__PMC_EV(P6, BACLEARS, p6-baclears) \ -__PMC_EV(P6, RESOURCE_STALLS, p6-resource-stalls) \ -__PMC_EV(P6, PARTIAL_RAT_STALLS, p6-partial-rat-stalls) \ -__PMC_EV(P6, SEGMENT_REG_LOADS, p6-segment-reg-loads) \ -__PMC_EV(P6, CPU_CLK_UNHALTED, p6-cpu-clk-unhalted) \ -__PMC_EV(P6, MMX_INSTR_EXEC, p6-mmx-instr-exec) \ -__PMC_EV(P6, MMX_SAT_INSTR_EXEC, p6-mmx-sat-instr-exec) \ -__PMC_EV(P6, MMX_UOPS_EXEC, p6-mmx-uops-exec) \ -__PMC_EV(P6, MMX_INSTR_TYPE_EXEC, p6-mmx-instr-type-exec) \ -__PMC_EV(P6, FP_MMX_TRANS, p6-fp-mmx-trans) \ -__PMC_EV(P6, MMX_ASSIST, p6-mmx-assist) \ -__PMC_EV(P6, MMX_INSTR_RET, p6-mmx-instr-ret) \ -__PMC_EV(P6, SEG_RENAME_STALLS, p6-seg-rename-stalls) \ -__PMC_EV(P6, SEG_REG_RENAMES, p6-seg-reg-renames) \ -__PMC_EV(P6, RET_SEG_RENAMES, p6-ret-seg-renames) \ -__PMC_EV(P6, EMON_EST_TRANS, p6-emon-est-trans) \ -__PMC_EV(P6, EMON_THERMAL_TRIP, p6-emon-thermal-trip) \ -__PMC_EV(P6, BR_INST_EXEC, p6-br-inst-exec) \ -__PMC_EV(P6, BR_MISSP_EXEC, p6-br-missp-exec) \ -__PMC_EV(P6, BR_BAC_MISSP_EXEC, p6-br-bac-missp-exec) \ -__PMC_EV(P6, BR_CND_EXEC, p6-br-cnd-exec) \ -__PMC_EV(P6, BR_CND_MISSP_EXEC, p6-br-cnd-missp-exec) \ -__PMC_EV(P6, BR_IND_EXEC, p6-br-ind-exec) \ -__PMC_EV(P6, BR_IND_MISSP_EXEC, p6-br-ind-missp-exec) \ -__PMC_EV(P6, BR_RET_EXEC, p6-br-ret-exec) \ -__PMC_EV(P6, BR_RET_MISSP_EXEC, p6-br-ret-missp-exec) \ -__PMC_EV(P6, BR_RET_BAC_MISSP_EXEC, p6-br-ret-bac-missp-exec) \ -__PMC_EV(P6, BR_CALL_EXEC, p6-br-call-exec) \ -__PMC_EV(P6, BR_CALL_MISSP_EXEC, p6-br-call-missp-exec) \ -__PMC_EV(P6, BR_IND_CALL_EXEC, p6-br-ind-call-exec) \ -__PMC_EV(P6, EMON_SIMD_INSTR_RETIRED, p6-emon-simd-instr-retired) \ -__PMC_EV(P6, EMON_SYNCH_UOPS, p6-emon-synch-uops) \ -__PMC_EV(P6, EMON_ESP_UOPS, p6-emon-esp-uops) \ -__PMC_EV(P6, EMON_FUSED_UOPS_RET, p6-emon-fused-uops-ret) \ -__PMC_EV(P6, EMON_UNFUSION, p6-emon-unfusion) \ -__PMC_EV(P6, EMON_PREF_RQSTS_UP, p6-emon-pref-rqsts-up) \ -__PMC_EV(P6, EMON_PREF_RQSTS_DN, p6-emon-pref-rqsts-dn) \ -__PMC_EV(P6, EMON_SSE_SSE2_INST_RETIRED, \ - p6-emon-sse-sse2-inst-retired) \ -__PMC_EV(P6, EMON_SSE_SSE2_COMP_INST_RETIRED, \ - p6-emon-sse-sse2-comp-inst-retired) +#define __PMC_EV_P6() \ +__PMC_EV(P6, DATA_MEM_REFS) \ +__PMC_EV(P6, DCU_LINES_IN) \ +__PMC_EV(P6, DCU_M_LINES_IN) \ +__PMC_EV(P6, DCU_M_LINES_OUT) \ +__PMC_EV(P6, DCU_MISS_OUTSTANDING) \ +__PMC_EV(P6, IFU_FETCH) \ +__PMC_EV(P6, IFU_FETCH_MISS) \ +__PMC_EV(P6, ITLB_MISS) \ +__PMC_EV(P6, IFU_MEM_STALL) \ +__PMC_EV(P6, ILD_STALL) \ +__PMC_EV(P6, L2_IFETCH) \ +__PMC_EV(P6, L2_LD) \ +__PMC_EV(P6, L2_ST) \ +__PMC_EV(P6, L2_LINES_IN) \ +__PMC_EV(P6, L2_LINES_OUT) \ +__PMC_EV(P6, L2_M_LINES_INM) \ +__PMC_EV(P6, L2_M_LINES_OUTM) \ +__PMC_EV(P6, L2_RQSTS) \ +__PMC_EV(P6, L2_ADS) \ +__PMC_EV(P6, L2_DBUS_BUSY) \ +__PMC_EV(P6, L2_DBUS_BUSY_RD) \ +__PMC_EV(P6, BUS_DRDY_CLOCKS) \ +__PMC_EV(P6, BUS_LOCK_CLOCKS) \ +__PMC_EV(P6, BUS_REQ_OUTSTANDING) \ +__PMC_EV(P6, BUS_TRAN_BRD) \ +__PMC_EV(P6, BUS_TRAN_RFO) \ +__PMC_EV(P6, BUS_TRANS_WB) \ +__PMC_EV(P6, BUS_TRAN_IFETCH) \ +__PMC_EV(P6, BUS_TRAN_INVAL) \ +__PMC_EV(P6, BUS_TRAN_PWR) \ +__PMC_EV(P6, BUS_TRANS_P) \ +__PMC_EV(P6, BUS_TRANS_IO) \ +__PMC_EV(P6, BUS_TRAN_DEF) \ +__PMC_EV(P6, BUS_TRAN_BURST) \ +__PMC_EV(P6, BUS_TRAN_ANY) \ +__PMC_EV(P6, BUS_TRAN_MEM) \ +__PMC_EV(P6, BUS_DATA_RCV) \ +__PMC_EV(P6, BUS_BNR_DRV) \ +__PMC_EV(P6, BUS_HIT_DRV) \ +__PMC_EV(P6, BUS_HITM_DRV) \ +__PMC_EV(P6, BUS_SNOOP_STALL) \ +__PMC_EV(P6, FLOPS) \ +__PMC_EV(P6, FP_COMPS_OPS_EXE) \ +__PMC_EV(P6, FP_ASSIST) \ +__PMC_EV(P6, MUL) \ +__PMC_EV(P6, DIV) \ +__PMC_EV(P6, CYCLES_DIV_BUSY) \ +__PMC_EV(P6, LD_BLOCKS) \ +__PMC_EV(P6, SB_DRAINS) \ +__PMC_EV(P6, MISALIGN_MEM_REF) \ +__PMC_EV(P6, EMON_KNI_PREF_DISPATCHED) \ +__PMC_EV(P6, EMON_KNI_PREF_MISS) \ +__PMC_EV(P6, INST_RETIRED) \ +__PMC_EV(P6, UOPS_RETIRED) \ +__PMC_EV(P6, INST_DECODED) \ +__PMC_EV(P6, EMON_KNI_INST_RETIRED) \ +__PMC_EV(P6, EMON_KNI_COMP_INST_RET) \ +__PMC_EV(P6, HW_INT_RX) \ +__PMC_EV(P6, CYCLES_INT_MASKED) \ +__PMC_EV(P6, CYCLES_INT_PENDING_AND_MASKED) \ +__PMC_EV(P6, BR_INST_RETIRED) \ +__PMC_EV(P6, BR_MISS_PRED_RETIRED) \ +__PMC_EV(P6, BR_TAKEN_RETIRED) \ +__PMC_EV(P6, BR_MISS_PRED_TAKEN_RET) \ +__PMC_EV(P6, BR_INST_DECODED) \ +__PMC_EV(P6, BTB_MISSES) \ +__PMC_EV(P6, BR_BOGUS) \ +__PMC_EV(P6, BACLEARS) \ +__PMC_EV(P6, RESOURCE_STALLS) \ +__PMC_EV(P6, PARTIAL_RAT_STALLS) \ +__PMC_EV(P6, SEGMENT_REG_LOADS) \ +__PMC_EV(P6, CPU_CLK_UNHALTED) \ +__PMC_EV(P6, MMX_INSTR_EXEC) \ +__PMC_EV(P6, MMX_SAT_INSTR_EXEC) \ +__PMC_EV(P6, MMX_UOPS_EXEC) \ +__PMC_EV(P6, MMX_INSTR_TYPE_EXEC) \ +__PMC_EV(P6, FP_MMX_TRANS) \ +__PMC_EV(P6, MMX_ASSIST) \ +__PMC_EV(P6, MMX_INSTR_RET) \ +__PMC_EV(P6, SEG_RENAME_STALLS) \ +__PMC_EV(P6, SEG_REG_RENAMES) \ +__PMC_EV(P6, RET_SEG_RENAMES) \ +__PMC_EV(P6, EMON_EST_TRANS) \ +__PMC_EV(P6, EMON_THERMAL_TRIP) \ +__PMC_EV(P6, BR_INST_EXEC) \ +__PMC_EV(P6, BR_MISSP_EXEC) \ +__PMC_EV(P6, BR_BAC_MISSP_EXEC) \ +__PMC_EV(P6, BR_CND_EXEC) \ +__PMC_EV(P6, BR_CND_MISSP_EXEC) \ +__PMC_EV(P6, BR_IND_EXEC) \ +__PMC_EV(P6, BR_IND_MISSP_EXEC) \ +__PMC_EV(P6, BR_RET_EXEC) \ +__PMC_EV(P6, BR_RET_MISSP_EXEC) \ +__PMC_EV(P6, BR_RET_BAC_MISSP_EXEC) \ +__PMC_EV(P6, BR_CALL_EXEC) \ +__PMC_EV(P6, BR_CALL_MISSP_EXEC) \ +__PMC_EV(P6, BR_IND_CALL_EXEC) \ +__PMC_EV(P6, EMON_SIMD_INSTR_RETIRED) \ +__PMC_EV(P6, EMON_SYNCH_UOPS) \ +__PMC_EV(P6, EMON_ESP_UOPS) \ +__PMC_EV(P6, EMON_FUSED_UOPS_RET) \ +__PMC_EV(P6, EMON_UNFUSION) \ +__PMC_EV(P6, EMON_PREF_RQSTS_UP) \ +__PMC_EV(P6, EMON_PREF_RQSTS_DN) \ +__PMC_EV(P6, EMON_SSE_SSE2_INST_RETIRED) \ +__PMC_EV(P6, EMON_SSE_SSE2_COMP_INST_RETIRED) #define PMC_EV_P6_FIRST PMC_EV_P6_DATA_MEM_REFS @@ -250,137 +241,86 @@ __PMC_EV(P6, EMON_SSE_SSE2_COMP_INST_RET /* AMD K8 PMCs */ #define __PMC_EV_K8() \ -__PMC_EV(K8, FP_DISPATCHED_FPU_OPS, k8-fp-dispatched-fpu-ops) \ -__PMC_EV(K8, FP_CYCLES_WITH_NO_FPU_OPS_RETIRED, \ - k8-fp-cycles-with-no-fpu-ops-retired) \ -__PMC_EV(K8, FP_DISPATCHED_FPU_FAST_FLAG_OPS, \ - k8-fp-dispatched-fpu-fast-flag-ops) \ -__PMC_EV(K8, LS_SEGMENT_REGISTER_LOAD, k8-ls-segment-register-load) \ -__PMC_EV(K8, LS_MICROARCHITECTURAL_RESYNC_BY_SELF_MODIFYING_CODE, \ - k8-ls-microarchitectural-resync-by-self-modifying-code) \ -__PMC_EV(K8, LS_MICROARCHITECTURAL_RESYNC_BY_SNOOP, \ - k8-ls-microarchitectural-resync-by-snoop) \ -__PMC_EV(K8, LS_BUFFER2_FULL, k8-ls-buffer2-full) \ -__PMC_EV(K8, LS_LOCKED_OPERATION, k8-ls-locked-operation) \ -__PMC_EV(K8, LS_MICROARCHITECTURAL_LATE_CANCEL, \ - k8-ls-microarchitectural-late-cancel) \ -__PMC_EV(K8, LS_RETIRED_CFLUSH_INSTRUCTIONS, \ - k8-ls-retired-cflush-instructions) \ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Thu Oct 9 15:43:22 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A9023106569A; Thu, 9 Oct 2008 15:43:22 +0000 (UTC) (envelope-from simon@nitro.dk) Received: from mx.nitro.dk (zarniwoop.nitro.dk [83.92.207.38]) by mx1.freebsd.org (Postfix) with ESMTP id 63CE78FC28; Thu, 9 Oct 2008 15:43:22 +0000 (UTC) (envelope-from simon@nitro.dk) Received: from arthur.nitro.dk (arthur.bofh [192.168.2.3]) by mx.nitro.dk (Postfix) with ESMTP id 845891E8C20; Thu, 9 Oct 2008 15:43:21 +0000 (UTC) Received: by arthur.nitro.dk (Postfix, from userid 1000) id 71C515FA3; Thu, 9 Oct 2008 17:43:21 +0200 (CEST) Date: Thu, 9 Oct 2008 17:43:21 +0200 From: "Simon L. Nielsen" To: Peter Wemm Message-ID: <20081009154320.GA1210@arthur.nitro.dk> References: <200810090225.m992PIom049355@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200810090225.m992PIom049355@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: r183714 - in head: etc/rc.d lib/libarchive lib/libc/stdlib lib/msun/src share/man/man4 sys/dev/e1000 sys/dev/iicbus sys/dev/pcn sys/dev/sis sys/dev/ste sys/dev/tl sys/dev/wb sys/dev/xl ... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 09 Oct 2008 15:43:22 -0000 On 2008.10.09 02:25:18 +0000, Peter Wemm wrote: > Author: peter > Date: Thu Oct 9 02:25:18 2008 > New Revision: 183714 > URL: http://svn.freebsd.org/changeset/base/183714 > > Log: > Clean out some empty mergeinfo records, presumably by people doing local > cp/mv operations. The full repo-relative URL should be specified for the > source in these cases. Could you elaborate on this? -- Simon L. Nielsen From owner-svn-src-head@FreeBSD.ORG Thu Oct 9 17:33:11 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3FD8B106569C for ; Thu, 9 Oct 2008 17:33:11 +0000 (UTC) (envelope-from olli@fromme.com) Received: from haluter.fromme.com (haluter.fromme.com [212.17.241.231]) by mx1.freebsd.org (Postfix) with ESMTP id B50BC8FC23 for ; Thu, 9 Oct 2008 17:33:10 +0000 (UTC) (envelope-from olli@fromme.com) Received: from haluter.fromme.com (irc_sucks@localhost [127.0.0.1]) by haluter.fromme.com (8.14.3/8.14.3) with ESMTP id m99HX899091781; Thu, 9 Oct 2008 19:33:08 +0200 (CEST) (envelope-from olli@fromme.com) Received: (from olli@localhost) by haluter.fromme.com (8.14.3/8.14.3/Submit) id m99HX8G6091779; Thu, 9 Oct 2008 19:33:08 +0200 (CEST) (envelope-from olli) From: Oliver Fromme Message-Id: <200810091733.m99HX8G6091779@haluter.fromme.com> To: ivoras@gmail.com (Ivan Voras) Date: Thu, 9 Oct 2008 19:33:07 +0200 (CEST) In-Reply-To: <9bbcef730810090238y8d8eb3fl200fd25371e4d69b@mail.gmail.com> X-Mailer: ELM [version 2.5 PL8] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.1.2 (haluter.fromme.com [127.0.0.1]); Thu, 09 Oct 2008 19:33:08 +0200 (CEST) Cc: svn-src-head@freebsd.org Subject: Re: svn commit: r183718 - 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: Thu, 09 Oct 2008 17:33:11 -0000 Ivan Voras wrote: > 2008/10/9 Oliver Fromme : > > > PS: Ivan: I decided to implement displaying diffs, > > as you suggested. Working on it right now. It only > > stores the most recent diffs (currently 10 days). > > Thanks, this will be completely sufficient for RSS! I think it doesn't make sense to include the diffs in the RSS "feed". Currently I only plan to put the diffs on the web page. RSS/atom "feeds" are OK for little pieces of news, but not for things that can easily grow to a few megabytes. Keep in mind that feeds are polled by the client, i.e. downloaded completely each time. This is a serious design flaw. It would be much better if the client could ask for new information and only download what it doesn't already have (much like the NNTP protocol for news servers), but RSS/atom does not support this. (On a side note, another problem is that the RSS and atom standards don't provide a portable way to include
...
sections in the XML content, so it's not possible to format the diffs properly.) Best regards Oliver -- Oliver Fromme, Bunsenstr. 13, 81735 Muenchen, Germany ``We are all but compressed light'' (Albert Einstein) From owner-svn-src-head@FreeBSD.ORG Thu Oct 9 18:06:28 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A29BA1065691; Thu, 9 Oct 2008 18:06:28 +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 91F868FC1E; Thu, 9 Oct 2008 18:06:28 +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 m99I6Su3068065; Thu, 9 Oct 2008 18:06:28 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 m99I6S11068064; Thu, 9 Oct 2008 18:06:28 GMT (envelope-from n_hibma@svn.freebsd.org) Message-Id: <200810091806.m99I6S11068064@svn.freebsd.org> From: Nick Hibma Date: Thu, 9 Oct 2008 18:06: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: r183727 - head/tools/tools/nanobsd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 09 Oct 2008 18:06:28 -0000 Author: n_hibma Date: Thu Oct 9 18:06:28 2008 New Revision: 183727 URL: http://svn.freebsd.org/changeset/base/183727 Log: Avoid failing if the directory already exists (when restarting at customize). MFC after: 2 days Modified: head/tools/tools/nanobsd/nanobsd.sh Modified: head/tools/tools/nanobsd/nanobsd.sh ============================================================================== --- head/tools/tools/nanobsd/nanobsd.sh Thu Oct 9 17:52:47 2008 (r183726) +++ head/tools/tools/nanobsd/nanobsd.sh Thu Oct 9 18:06:28 2008 (r183727) @@ -281,7 +281,7 @@ setup_nanobsd ( ) ( # have hardcoded paths under ${prefix}/etc are not tweakable. if [ -d usr/local/etc ] ; then ( - mkdir etc/local + mkdir -p etc/local cd usr/local/etc find . -print | cpio -dumpl ../../../etc/local cd .. From owner-svn-src-head@FreeBSD.ORG Thu Oct 9 19:22:00 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DEFEE1065687; Thu, 9 Oct 2008 19:22:00 +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 CC5488FC1A; Thu, 9 Oct 2008 19:22:00 +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 m99JM0Pk069379; Thu, 9 Oct 2008 19:22:00 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 m99JM0F1069368; Thu, 9 Oct 2008 19:22:00 GMT (envelope-from n_hibma@svn.freebsd.org) Message-Id: <200810091922.m99JM0F1069368@svn.freebsd.org> From: Nick Hibma Date: Thu, 9 Oct 2008 19:22: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: r183728 - in head/sys: dev/usb modules modules/ehci modules/ohci modules/slhci modules/uhci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 09 Oct 2008 19:22:01 -0000 Author: n_hibma Date: Thu Oct 9 19:22:00 2008 New Revision: 183728 URL: http://svn.freebsd.org/changeset/base/183728 Log: Add modules for the HCI part of USB. This is convenient when having a UHCI controller in your laptop but inserting a (OHCI-based) Option Cardbus card. Added: head/sys/modules/ehci/ head/sys/modules/ehci/Makefile (contents, props changed) head/sys/modules/ohci/ head/sys/modules/ohci/Makefile (contents, props changed) head/sys/modules/uhci/ head/sys/modules/uhci/Makefile (contents, props changed) Modified: head/sys/dev/usb/ehci_pci.c head/sys/dev/usb/ohci_pci.c head/sys/dev/usb/slhci_pccard.c head/sys/dev/usb/uhci_pci.c head/sys/modules/Makefile head/sys/modules/slhci/Makefile Modified: head/sys/dev/usb/ehci_pci.c ============================================================================== --- head/sys/dev/usb/ehci_pci.c Thu Oct 9 18:06:28 2008 (r183727) +++ head/sys/dev/usb/ehci_pci.c Thu Oct 9 19:22:00 2008 (r183728) @@ -623,3 +623,4 @@ static devclass_t ehci_devclass; DRIVER_MODULE(ehci, pci, ehci_driver, ehci_devclass, 0, 0); DRIVER_MODULE(ehci, cardbus, ehci_driver, ehci_devclass, 0, 0); +MODULE_DEPEND(ehci, usb, 1, 1, 1); Modified: head/sys/dev/usb/ohci_pci.c ============================================================================== --- head/sys/dev/usb/ohci_pci.c Thu Oct 9 18:06:28 2008 (r183727) +++ head/sys/dev/usb/ohci_pci.c Thu Oct 9 19:22:00 2008 (r183728) @@ -408,3 +408,4 @@ static devclass_t ohci_devclass; DRIVER_MODULE(ohci, pci, ohci_driver, ohci_devclass, 0, 0); DRIVER_MODULE(ohci, cardbus, ohci_driver, ohci_devclass, 0, 0); +MODULE_DEPEND(ohci, usb, 1, 1, 1); Modified: head/sys/dev/usb/slhci_pccard.c ============================================================================== --- head/sys/dev/usb/slhci_pccard.c Thu Oct 9 18:06:28 2008 (r183727) +++ head/sys/dev/usb/slhci_pccard.c Thu Oct 9 19:22:00 2008 (r183728) @@ -199,6 +199,8 @@ static driver_t slhci_pccard_driver = { slhci_pccard_methods, sizeof(struct slhci_softc), }; + devclass_t slhci_devclass; -MODULE_DEPEND(slhci, usb, 1, 1, 1); + DRIVER_MODULE(slhci, pccard, slhci_pccard_driver, slhci_devclass, 0, 0); +MODULE_DEPEND(slhci, usb, 1, 1, 1); Modified: head/sys/dev/usb/uhci_pci.c ============================================================================== --- head/sys/dev/usb/uhci_pci.c Thu Oct 9 18:06:28 2008 (r183727) +++ head/sys/dev/usb/uhci_pci.c Thu Oct 9 19:22:00 2008 (r183728) @@ -515,3 +515,4 @@ static devclass_t uhci_devclass; DRIVER_MODULE(uhci, pci, uhci_driver, uhci_devclass, 0, 0); DRIVER_MODULE(uhci, cardbus, uhci_driver, uhci_devclass, 0, 0); +MODULE_DEPEND(uhci, usb, 1, 1, 1); Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Thu Oct 9 18:06:28 2008 (r183727) +++ head/sys/modules/Makefile Thu Oct 9 19:22:00 2008 (r183728) @@ -79,6 +79,7 @@ SUBDIR= ${_3dfx} \ ${_dtrace} \ dummynet \ ${_ed} \ + ehci \ ${_elink} \ ${_em} \ en \ @@ -205,6 +206,7 @@ SUBDIR= ${_3dfx} \ ${_nwfs} \ ${_nxge} \ ${_opensolaris} \ + ohci \ ${_padlock} \ patm \ ${_pccard} \ @@ -241,6 +243,7 @@ SUBDIR= ${_3dfx} \ ${_scsi_low} \ sem \ sf \ + slhci \ sis \ sk \ ${_smbfs} \ @@ -280,6 +283,7 @@ SUBDIR= ${_3dfx} \ ufoma \ uftdi \ ugen \ + uhci \ uhid \ uipaq \ ukbd \ Added: head/sys/modules/ehci/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/ehci/Makefile Thu Oct 9 19:22:00 2008 (r183728) @@ -0,0 +1,13 @@ +# $FreeBSD$ + +S= ${.CURDIR}/../.. + +.PATH: $S/dev/usb $S/pci + +KMOD= ehci +SRCS= bus_if.h device_if.h \ + opt_usb.h \ + ehci_pci.c ehci.c ehcireg.h ehcivar.h \ + pci_if.h + +.include Added: head/sys/modules/ohci/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/ohci/Makefile Thu Oct 9 19:22:00 2008 (r183728) @@ -0,0 +1,13 @@ +# $FreeBSD$ + +S= ${.CURDIR}/../.. + +.PATH: $S/dev/usb $S/pci + +KMOD= ohci +SRCS= bus_if.h device_if.h \ + opt_usb.h \ + ohci_pci.c ohci.c ohcireg.h ohcivar.h \ + pci_if.h + +.include Modified: head/sys/modules/slhci/Makefile ============================================================================== --- head/sys/modules/slhci/Makefile Thu Oct 9 18:06:28 2008 (r183727) +++ head/sys/modules/slhci/Makefile Thu Oct 9 19:22:00 2008 (r183728) @@ -5,6 +5,8 @@ KMOD= slhci SRCS= sl811hs.c slhci_pccard.c -SRCS+= opt_slhci.h opt_usb.h device_if.h bus_if.h usbdevs.h card_if.h power_if.h pccarddevs.h +SRCS+= bus_if.h device_if.h card_if.h power_if.h \ + usbdevs.h pccarddevs.h \ + opt_slhci.h opt_usb.h \ .include Added: head/sys/modules/uhci/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/uhci/Makefile Thu Oct 9 19:22:00 2008 (r183728) @@ -0,0 +1,13 @@ +# $FreeBSD$ + +S= ${.CURDIR}/../.. + +.PATH: $S/dev/usb $S/pci + +KMOD= uhci +SRCS= bus_if.h device_if.h \ + opt_usb.h \ + uhci_pci.c uhci.c uhcireg.h uhcivar.h \ + pci_if.h + +.include From owner-svn-src-head@FreeBSD.ORG Thu Oct 9 19:47:29 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 39E1B1065687; Thu, 9 Oct 2008 19:47:29 +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 2771D8FC2D; Thu, 9 Oct 2008 19:47:29 +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 m99JlTWx069920; Thu, 9 Oct 2008 19:47:29 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m99JlTPu069919; Thu, 9 Oct 2008 19:47:29 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200810091947.m99JlTPu069919@svn.freebsd.org> From: Warner Losh Date: Thu, 9 Oct 2008 19:47: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: r183729 - head/sys/dev/mmc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 09 Oct 2008 19:47:29 -0000 Author: imp Date: Thu Oct 9 19:47:28 2008 New Revision: 183729 URL: http://svn.freebsd.org/changeset/base/183729 Log: o Use seprate routines to decode cid and csd for sd and mmc cards. All they have in common right now is a memset. This saves a parameter to these routines, as well as a level of indentation. o Make mmc_get_bits a little clearer... It really only works on 128-bit registers right now. Modified: head/sys/dev/mmc/mmc.c Modified: head/sys/dev/mmc/mmc.c ============================================================================== --- head/sys/dev/mmc/mmc.c Thu Oct 9 19:22:00 2008 (r183728) +++ head/sys/dev/mmc/mmc.c Thu Oct 9 19:47:28 2008 (r183729) @@ -718,7 +718,8 @@ mmc_test_bus_width(struct mmc_softc *sc) static uint32_t mmc_get_bits(uint32_t *bits, int start, int size) { - const int i = 3 - (start / 32); + const int bit_len = 128; + const int i = (bit_len / 32) - (start / 32) - 1; const int shift = start & 31; uint32_t retval = bits[i] >> shift; if (size + shift > 32) @@ -727,31 +728,37 @@ mmc_get_bits(uint32_t *bits, int start, } static void -mmc_decode_cid(int is_sd, uint32_t *raw_cid, struct mmc_cid *cid) +mmc_decode_cid_sd(uint32_t *raw_cid, struct mmc_cid *cid) { int i; + /* There's no version info, so we take it on faith */ memset(cid, 0, sizeof(*cid)); - if (is_sd) { - /* There's no version info, so we take it on faith */ - cid->mid = mmc_get_bits(raw_cid, 120, 8); - cid->oid = mmc_get_bits(raw_cid, 104, 16); - for (i = 0; i < 5; i++) - cid->pnm[i] = mmc_get_bits(raw_cid, 96 - i * 8, 8); - cid->prv = mmc_get_bits(raw_cid, 56, 8); - cid->psn = mmc_get_bits(raw_cid, 24, 32); - cid->mdt_year = mmc_get_bits(raw_cid, 12, 8) + 2001; - cid->mdt_month = mmc_get_bits(raw_cid, 8, 4); - } else { - cid->mid = mmc_get_bits(raw_cid, 120, 8); - cid->oid = mmc_get_bits(raw_cid, 104, 8); - for (i = 0; i < 6; i++) - cid->pnm[i] = mmc_get_bits(raw_cid, 96 - i * 8, 8); - cid->prv = mmc_get_bits(raw_cid, 48, 8); - cid->psn = mmc_get_bits(raw_cid, 16, 32); - cid->mdt_month = mmc_get_bits(raw_cid, 12, 4); - cid->mdt_year = mmc_get_bits(raw_cid, 8, 4) + 1997; - } + cid->mid = mmc_get_bits(raw_cid, 120, 8); + cid->oid = mmc_get_bits(raw_cid, 104, 16); + for (i = 0; i < 5; i++) + cid->pnm[i] = mmc_get_bits(raw_cid, 96 - i * 8, 8); + cid->prv = mmc_get_bits(raw_cid, 56, 8); + cid->psn = mmc_get_bits(raw_cid, 24, 32); + cid->mdt_year = mmc_get_bits(raw_cid, 12, 8) + 2001; + cid->mdt_month = mmc_get_bits(raw_cid, 8, 4); +} + +static void +mmc_decode_cid_mmc(uint32_t *raw_cid, struct mmc_cid *cid) +{ + int i; + + /* There's no version info, so we take it on faith */ + memset(cid, 0, sizeof(*cid)); + cid->mid = mmc_get_bits(raw_cid, 120, 8); + cid->oid = mmc_get_bits(raw_cid, 104, 8); + for (i = 0; i < 6; i++) + cid->pnm[i] = mmc_get_bits(raw_cid, 96 - i * 8, 8); + cid->prv = mmc_get_bits(raw_cid, 48, 8); + cid->psn = mmc_get_bits(raw_cid, 16, 32); + cid->mdt_month = mmc_get_bits(raw_cid, 12, 4); + cid->mdt_year = mmc_get_bits(raw_cid, 8, 4) + 1997; } static const int exp[8] = { @@ -768,71 +775,15 @@ static const int cur_max[8] = { }; static void -mmc_decode_csd(int is_sd, uint32_t *raw_csd, struct mmc_csd *csd) +mmc_decode_csd_sd(uint32_t *raw_csd, struct mmc_csd *csd) { int v; int m; int e; memset(csd, 0, sizeof(*csd)); - if (is_sd) { - csd->csd_structure = v = mmc_get_bits(raw_csd, 126, 2); - if (v == 0) { - m = mmc_get_bits(raw_csd, 115, 4); - e = mmc_get_bits(raw_csd, 112, 3); - csd->tacc = exp[e] * mant[m] + 9 / 10; - csd->nsac = mmc_get_bits(raw_csd, 104, 8) * 100; - m = mmc_get_bits(raw_csd, 99, 4); - e = mmc_get_bits(raw_csd, 96, 3); - csd->tran_speed = exp[e] * 10000 * mant[m]; - csd->ccc = mmc_get_bits(raw_csd, 84, 12); - csd->read_bl_len = 1 << mmc_get_bits(raw_csd, 80, 4); - csd->read_bl_partial = mmc_get_bits(raw_csd, 79, 1); - csd->write_blk_misalign = mmc_get_bits(raw_csd, 78, 1); - csd->read_blk_misalign = mmc_get_bits(raw_csd, 77, 1); - csd->dsr_imp = mmc_get_bits(raw_csd, 76, 1); - csd->vdd_r_curr_min = cur_min[mmc_get_bits(raw_csd, 59, 3)]; - csd->vdd_r_curr_max = cur_max[mmc_get_bits(raw_csd, 56, 3)]; - csd->vdd_w_curr_min = cur_min[mmc_get_bits(raw_csd, 53, 3)]; - csd->vdd_w_curr_max = cur_max[mmc_get_bits(raw_csd, 50, 3)]; - m = mmc_get_bits(raw_csd, 62, 12); - e = mmc_get_bits(raw_csd, 47, 3); - csd->capacity = ((1 + m) << (e + 2)) * csd->read_bl_len; - csd->erase_blk_en = mmc_get_bits(raw_csd, 46, 1); - csd->sector_size = mmc_get_bits(raw_csd, 39, 7); - csd->wp_grp_size = mmc_get_bits(raw_csd, 32, 7); - csd->wp_grp_enable = mmc_get_bits(raw_csd, 31, 1); - csd->r2w_factor = 1 << mmc_get_bits(raw_csd, 26, 3); - csd->write_bl_len = 1 << mmc_get_bits(raw_csd, 22, 4); - csd->write_bl_partial = mmc_get_bits(raw_csd, 21, 1); - } else if (v == 1) { - m = mmc_get_bits(raw_csd, 115, 4); - e = mmc_get_bits(raw_csd, 112, 3); - csd->tacc = exp[e] * mant[m] + 9 / 10; - csd->nsac = mmc_get_bits(raw_csd, 104, 8) * 100; - m = mmc_get_bits(raw_csd, 99, 4); - e = mmc_get_bits(raw_csd, 96, 3); - csd->tran_speed = exp[e] * 10000 * mant[m]; - csd->ccc = mmc_get_bits(raw_csd, 84, 12); - csd->read_bl_len = 1 << mmc_get_bits(raw_csd, 80, 4); - csd->read_bl_partial = mmc_get_bits(raw_csd, 79, 1); - csd->write_blk_misalign = mmc_get_bits(raw_csd, 78, 1); - csd->read_blk_misalign = mmc_get_bits(raw_csd, 77, 1); - csd->dsr_imp = mmc_get_bits(raw_csd, 76, 1); - csd->capacity = ((uint64_t)mmc_get_bits(raw_csd, 48, 22) + 1) * - 512 * 1024; - csd->erase_blk_en = mmc_get_bits(raw_csd, 46, 1); - csd->sector_size = mmc_get_bits(raw_csd, 39, 7); - csd->wp_grp_size = mmc_get_bits(raw_csd, 32, 7); - csd->wp_grp_enable = mmc_get_bits(raw_csd, 31, 1); - csd->r2w_factor = 1 << mmc_get_bits(raw_csd, 26, 3); - csd->write_bl_len = 1 << mmc_get_bits(raw_csd, 22, 4); - csd->write_bl_partial = mmc_get_bits(raw_csd, 21, 1); - } else - panic("unknown SD CSD version"); - } else { - csd->csd_structure = mmc_get_bits(raw_csd, 126, 2); - csd->spec_vers = mmc_get_bits(raw_csd, 122, 4); + csd->csd_structure = v = mmc_get_bits(raw_csd, 126, 2); + if (v == 0) { m = mmc_get_bits(raw_csd, 115, 4); e = mmc_get_bits(raw_csd, 112, 3); csd->tacc = exp[e] * mant[m] + 9 / 10; @@ -853,14 +804,76 @@ mmc_decode_csd(int is_sd, uint32_t *raw_ m = mmc_get_bits(raw_csd, 62, 12); e = mmc_get_bits(raw_csd, 47, 3); csd->capacity = ((1 + m) << (e + 2)) * csd->read_bl_len; -// csd->erase_blk_en = mmc_get_bits(raw_csd, 46, 1); -// csd->sector_size = mmc_get_bits(raw_csd, 39, 7); - csd->wp_grp_size = mmc_get_bits(raw_csd, 32, 5); + csd->erase_blk_en = mmc_get_bits(raw_csd, 46, 1); + csd->sector_size = mmc_get_bits(raw_csd, 39, 7); + csd->wp_grp_size = mmc_get_bits(raw_csd, 32, 7); csd->wp_grp_enable = mmc_get_bits(raw_csd, 31, 1); csd->r2w_factor = 1 << mmc_get_bits(raw_csd, 26, 3); csd->write_bl_len = 1 << mmc_get_bits(raw_csd, 22, 4); csd->write_bl_partial = mmc_get_bits(raw_csd, 21, 1); - } + } else if (v == 1) { + m = mmc_get_bits(raw_csd, 115, 4); + e = mmc_get_bits(raw_csd, 112, 3); + csd->tacc = exp[e] * mant[m] + 9 / 10; + csd->nsac = mmc_get_bits(raw_csd, 104, 8) * 100; + m = mmc_get_bits(raw_csd, 99, 4); + e = mmc_get_bits(raw_csd, 96, 3); + csd->tran_speed = exp[e] * 10000 * mant[m]; + csd->ccc = mmc_get_bits(raw_csd, 84, 12); + csd->read_bl_len = 1 << mmc_get_bits(raw_csd, 80, 4); + csd->read_bl_partial = mmc_get_bits(raw_csd, 79, 1); + csd->write_blk_misalign = mmc_get_bits(raw_csd, 78, 1); + csd->read_blk_misalign = mmc_get_bits(raw_csd, 77, 1); + csd->dsr_imp = mmc_get_bits(raw_csd, 76, 1); + csd->capacity = ((uint64_t)mmc_get_bits(raw_csd, 48, 22) + 1) * + 512 * 1024; + csd->erase_blk_en = mmc_get_bits(raw_csd, 46, 1); + csd->sector_size = mmc_get_bits(raw_csd, 39, 7); + csd->wp_grp_size = mmc_get_bits(raw_csd, 32, 7); + csd->wp_grp_enable = mmc_get_bits(raw_csd, 31, 1); + csd->r2w_factor = 1 << mmc_get_bits(raw_csd, 26, 3); + csd->write_bl_len = 1 << mmc_get_bits(raw_csd, 22, 4); + csd->write_bl_partial = mmc_get_bits(raw_csd, 21, 1); + } else + panic("unknown SD CSD version"); +} + +static void +mmc_decode_csd_mmc(uint32_t *raw_csd, struct mmc_csd *csd) +{ + int m; + int e; + + memset(csd, 0, sizeof(*csd)); + csd->csd_structure = mmc_get_bits(raw_csd, 126, 2); + csd->spec_vers = mmc_get_bits(raw_csd, 122, 4); + m = mmc_get_bits(raw_csd, 115, 4); + e = mmc_get_bits(raw_csd, 112, 3); + csd->tacc = exp[e] * mant[m] + 9 / 10; + csd->nsac = mmc_get_bits(raw_csd, 104, 8) * 100; + m = mmc_get_bits(raw_csd, 99, 4); + e = mmc_get_bits(raw_csd, 96, 3); + csd->tran_speed = exp[e] * 10000 * mant[m]; + csd->ccc = mmc_get_bits(raw_csd, 84, 12); + csd->read_bl_len = 1 << mmc_get_bits(raw_csd, 80, 4); + csd->read_bl_partial = mmc_get_bits(raw_csd, 79, 1); + csd->write_blk_misalign = mmc_get_bits(raw_csd, 78, 1); + csd->read_blk_misalign = mmc_get_bits(raw_csd, 77, 1); + csd->dsr_imp = mmc_get_bits(raw_csd, 76, 1); + csd->vdd_r_curr_min = cur_min[mmc_get_bits(raw_csd, 59, 3)]; + csd->vdd_r_curr_max = cur_max[mmc_get_bits(raw_csd, 56, 3)]; + csd->vdd_w_curr_min = cur_min[mmc_get_bits(raw_csd, 53, 3)]; + csd->vdd_w_curr_max = cur_max[mmc_get_bits(raw_csd, 50, 3)]; + m = mmc_get_bits(raw_csd, 62, 12); + e = mmc_get_bits(raw_csd, 47, 3); + csd->capacity = ((1 + m) << (e + 2)) * csd->read_bl_len; +// csd->erase_blk_en = mmc_get_bits(raw_csd, 46, 1); +// csd->sector_size = mmc_get_bits(raw_csd, 39, 7); + csd->wp_grp_size = mmc_get_bits(raw_csd, 32, 5); + csd->wp_grp_enable = mmc_get_bits(raw_csd, 31, 1); + csd->r2w_factor = 1 << mmc_get_bits(raw_csd, 26, 3); + csd->write_bl_len = 1 << mmc_get_bits(raw_csd, 22, 4); + csd->write_bl_partial = mmc_get_bits(raw_csd, 21, 1); } static void @@ -873,7 +886,7 @@ mmc_app_decode_scr(uint32_t *raw_scr, st tmp[2] = raw_scr[0]; memset(scr, 0, sizeof(*scr)); - + scr_struct = mmc_get_bits(tmp, 60, 4); if (scr_struct != 0) { printf("Unrecognised SCR structure version %d\n", @@ -1020,12 +1033,12 @@ mmc_discover_cards(struct mmc_softc *sc) ivar->bus_width = bus_width_1; ivar->mode = mmcbr_get_mode(sc->dev); if (ivar->mode == mode_sd) { - mmc_decode_cid(1, ivar->raw_cid, &ivar->cid); + mmc_decode_cid_sd(ivar->raw_cid, &ivar->cid); mmc_send_relative_addr(sc, &resp); ivar->rca = resp >> 16; /* Get card CSD. */ mmc_send_csd(sc, ivar->rca, ivar->raw_csd); - mmc_decode_csd(1, ivar->raw_csd, &ivar->csd); + mmc_decode_csd_sd(ivar->raw_csd, &ivar->csd); if (ivar->csd.csd_structure > 0) ivar->high_cap = 1; ivar->tran_speed = ivar->csd.tran_speed; @@ -1052,12 +1065,12 @@ mmc_discover_cards(struct mmc_softc *sc) device_set_ivars(child, ivar); return; } - mmc_decode_cid(0, ivar->raw_cid, &ivar->cid); + mmc_decode_cid_mmc(ivar->raw_cid, &ivar->cid); ivar->rca = rca++; mmc_set_relative_addr(sc, ivar->rca); /* Get card CSD. */ mmc_send_csd(sc, ivar->rca, ivar->raw_csd); - mmc_decode_csd(0, ivar->raw_csd, &ivar->csd); + mmc_decode_csd_mmc(ivar->raw_csd, &ivar->csd); ivar->tran_speed = ivar->csd.tran_speed; /* Only MMC >= 4.x cards support EXT_CSD. */ if (ivar->csd.spec_vers >= 4) { From owner-svn-src-head@FreeBSD.ORG Thu Oct 9 20:00:17 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE207106569F; Thu, 9 Oct 2008 20:00:17 +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 DCD578FC18; Thu, 9 Oct 2008 20:00:17 +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 m99K0HV1070266; Thu, 9 Oct 2008 20:00:17 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 m99K0H3H070265; Thu, 9 Oct 2008 20:00:17 GMT (envelope-from n_hibma@svn.freebsd.org) Message-Id: <200810092000.m99K0H3H070265@svn.freebsd.org> From: Nick Hibma Date: Thu, 9 Oct 2008 20:00: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: r183730 - head/sys/modules/usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Oct 2008 20:00:18 -0000 Author: n_hibma Date: Thu Oct 9 20:00:17 2008 New Revision: 183730 URL: http://svn.freebsd.org/changeset/base/183730 Log: Obfuscated by other diffs while committing r183728: Remove the files for the HCI interfaces from the usb module. Modified: head/sys/modules/usb/Makefile Modified: head/sys/modules/usb/Makefile ============================================================================== --- head/sys/modules/usb/Makefile Thu Oct 9 19:47:28 2008 (r183729) +++ head/sys/modules/usb/Makefile Thu Oct 9 20:00:17 2008 (r183730) @@ -19,9 +19,4 @@ SRCS= bus_if.h device_if.h usb_if.h usb_ usbdi_util.c usbdi_util.h \ usb_ethersubr.c usbdevs.h -SRCS+= uhci_pci.c uhci.c uhcireg.h uhcivar.h -SRCS+= ohci_pci.c ohci.c ohcireg.h ohcivar.h -SRCS+= ehci_pci.c ehci.c ehcireg.h ehcivar.h -SRCS+= pci_if.h - .include From owner-svn-src-head@FreeBSD.ORG Thu Oct 9 20:09:57 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1A62C1065688; Thu, 9 Oct 2008 20:09:57 +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 094A58FC1E; Thu, 9 Oct 2008 20:09:57 +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 m99K9uML070473; Thu, 9 Oct 2008 20:09:56 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m99K9ueD070472; Thu, 9 Oct 2008 20:09:56 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200810092009.m99K9ueD070472@svn.freebsd.org> From: Alexander Motin Date: Thu, 9 Oct 2008 20:09: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: r183731 - head/sys/dev/mmc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 09 Oct 2008 20:09:57 -0000 Author: mav Date: Thu Oct 9 20:09:56 2008 New Revision: 183731 URL: http://svn.freebsd.org/changeset/base/183731 Log: Add high capacity MMC cards support. Modified: head/sys/dev/mmc/mmc.c Modified: head/sys/dev/mmc/mmc.c ============================================================================== --- head/sys/dev/mmc/mmc.c Thu Oct 9 20:00:17 2008 (r183730) +++ head/sys/dev/mmc/mmc.c Thu Oct 9 20:09:56 2008 (r183731) @@ -93,7 +93,8 @@ struct mmc_ivars { u_char read_only; /* True when the device is read-only */ u_char bus_width; /* Bus width to use */ u_char timing; /* Bus timing support */ - u_char high_cap; /* High Capacity card */ + u_char high_cap; /* High Capacity card (block addressed) */ + uint32_t sec_count; /* Card capacity in 512byte blocks */ uint32_t tran_speed; /* Max speed in normal mode */ uint32_t hs_tran_speed; /* Max speed in high speed mode */ }; @@ -1011,7 +1012,7 @@ mmc_discover_cards(struct mmc_softc *sc) { struct mmc_ivars *ivar; int err; - uint32_t resp; + uint32_t resp, sec_count; device_t child; uint16_t rca = 2; u_char switch_res[64]; @@ -1039,6 +1040,7 @@ mmc_discover_cards(struct mmc_softc *sc) /* Get card CSD. */ mmc_send_csd(sc, ivar->rca, ivar->raw_csd); mmc_decode_csd_sd(ivar->raw_csd, &ivar->csd); + ivar->sec_count = ivar->csd.capacity / MMC_SECTOR_SIZE; if (ivar->csd.csd_structure > 0) ivar->high_cap = 1; ivar->tran_speed = ivar->csd.tran_speed; @@ -1071,18 +1073,28 @@ mmc_discover_cards(struct mmc_softc *sc) /* Get card CSD. */ mmc_send_csd(sc, ivar->rca, ivar->raw_csd); mmc_decode_csd_mmc(ivar->raw_csd, &ivar->csd); + ivar->sec_count = ivar->csd.capacity / MMC_SECTOR_SIZE; ivar->tran_speed = ivar->csd.tran_speed; /* Only MMC >= 4.x cards support EXT_CSD. */ if (ivar->csd.spec_vers >= 4) { /* Card must be selected to fetch EXT_CSD. */ mmc_select_card(sc, ivar->rca); mmc_send_ext_csd(sc, ivar->raw_ext_csd); + /* Handle extended capacity from EXT_CSD */ + sec_count = ivar->raw_ext_csd[EXT_CSD_SEC_CNT] + + (ivar->raw_ext_csd[EXT_CSD_SEC_CNT + 1] << 8) + + (ivar->raw_ext_csd[EXT_CSD_SEC_CNT + 2] << 16) + + (ivar->raw_ext_csd[EXT_CSD_SEC_CNT + 3] << 24); + if (sec_count != 0) { + ivar->sec_count = sec_count; + ivar->high_cap = 1; + } /* Get card speed in high speed mode. */ ivar->timing = bus_timing_hs; - if (((uint8_t *)(ivar->raw_ext_csd))[EXT_CSD_CARD_TYPE] + if (ivar->raw_ext_csd[EXT_CSD_CARD_TYPE] & EXT_CSD_CARD_TYPE_52) ivar->hs_tran_speed = 52000000; - else if (((uint8_t *)(ivar->raw_ext_csd))[EXT_CSD_CARD_TYPE] + else if (ivar->raw_ext_csd[EXT_CSD_CARD_TYPE] & EXT_CSD_CARD_TYPE_26) ivar->hs_tran_speed = 26000000; else @@ -1234,7 +1246,7 @@ mmc_read_ivar(device_t bus, device_t chi *(int *)result = ivar->csd.dsr_imp; break; case MMC_IVAR_MEDIA_SIZE: - *(off_t *)result = ivar->csd.capacity / MMC_SECTOR_SIZE; + *(off_t *)result = ivar->sec_count; break; case MMC_IVAR_RCA: *(int *)result = ivar->rca; From owner-svn-src-head@FreeBSD.ORG Thu Oct 9 20:43:42 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6C6D11065695; Thu, 9 Oct 2008 20:43:42 +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 5ACC78FC26; Thu, 9 Oct 2008 20:43:42 +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 m99KhgZr071148; Thu, 9 Oct 2008 20:43:42 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m99KhgVB071147; Thu, 9 Oct 2008 20:43:42 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200810092043.m99KhgVB071147@svn.freebsd.org> From: Andrew Thompson Date: Thu, 9 Oct 2008 20:43: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: r183733 - head/sys/libkern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 09 Oct 2008 20:43:42 -0000 Author: thompsa Date: Thu Oct 9 20:43:42 2008 New Revision: 183733 URL: http://svn.freebsd.org/changeset/base/183733 Log: Prefix the static shl function with '__' like its parent function __qdivrem to avoid being picked up by the DTrace fbt provider. This is called by __udivdi3() for doing 64bit division on a 32bit arch and may be called from within the dtrace context causing a double fault. Modified: head/sys/libkern/qdivrem.c Modified: head/sys/libkern/qdivrem.c ============================================================================== --- head/sys/libkern/qdivrem.c Thu Oct 9 20:40:11 2008 (r183732) +++ head/sys/libkern/qdivrem.c Thu Oct 9 20:43:42 2008 (r183733) @@ -59,7 +59,7 @@ typedef u_long digit; * We may assume len >= 0. NOTE THAT THIS WRITES len+1 DIGITS. */ static void -shl(register digit *p, register int len, register int sh) +__shl(register digit *p, register int len, register int sh) { register int i; @@ -182,8 +182,8 @@ __qdivrem(uq, vq, arq) for (t = v[1]; t < B / 2; t <<= 1) d++; if (d > 0) { - shl(&u[0], m + n, d); /* u <<= d */ - shl(&v[1], n - 1, d); /* v <<= d */ + __shl(&u[0], m + n, d); /* u <<= d */ + __shl(&v[1], n - 1, d); /* v <<= d */ } /* * D2: j = 0. From owner-svn-src-head@FreeBSD.ORG Thu Oct 9 20:51:28 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0CA9510656A9; Thu, 9 Oct 2008 20:51:26 +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 DFF9D8FC12; Thu, 9 Oct 2008 20:51:25 +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 m99KpPns071324; Thu, 9 Oct 2008 20:51:25 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 m99KpP3W071320; Thu, 9 Oct 2008 20:51:25 GMT (envelope-from n_hibma@svn.freebsd.org) Message-Id: <200810092051.m99KpP3W071320@svn.freebsd.org> From: Nick Hibma Date: Thu, 9 Oct 2008 20:51: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: r183734 - head/sys/dev/usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Oct 2008 20:51:28 -0000 Author: n_hibma Date: Thu Oct 9 20:51:25 2008 New Revision: 183734 URL: http://svn.freebsd.org/changeset/base/183734 Log: uark/ucom: Minor code cleanup. umass; Remove duplicated code. ukbd: Fill in the arg parameter on the through call. Modified: head/sys/dev/usb/uark.c head/sys/dev/usb/ucom.c head/sys/dev/usb/ukbd.c head/sys/dev/usb/umass.c Modified: head/sys/dev/usb/uark.c ============================================================================== --- head/sys/dev/usb/uark.c Thu Oct 9 20:43:42 2008 (r183733) +++ head/sys/dev/usb/uark.c Thu Oct 9 20:51:25 2008 (r183734) @@ -185,7 +185,7 @@ uark_attach(device_t self) return 0; bad: - DPRINTF(("uftdi_attach: ATTACH ERROR\n")); + DPRINTF(("uark_attach: ATTACH ERROR\n")); ucom->sc_dying = 1; return ENXIO; } Modified: head/sys/dev/usb/ucom.c ============================================================================== --- head/sys/dev/usb/ucom.c Thu Oct 9 20:43:42 2008 (r183733) +++ head/sys/dev/usb/ucom.c Thu Oct 9 20:51:25 2008 (r183734) @@ -161,14 +161,11 @@ ucom_modevent(module_t mod, int type, vo { switch (type) { case MOD_LOAD: - break; case MOD_UNLOAD: - break; + return (0); default: return (EOPNOTSUPP); - break; } - return (0); } void Modified: head/sys/dev/usb/ukbd.c ============================================================================== --- head/sys/dev/usb/ukbd.c Thu Oct 9 20:43:42 2008 (r183733) +++ head/sys/dev/usb/ukbd.c Thu Oct 9 20:51:25 2008 (r183734) @@ -1534,5 +1534,5 @@ ukbd_driver_load(module_t mod, int what, kbd_delete_driver(&ukbd_kbd_driver); break; } - return usbd_driver_load(mod, what, 0); + return usbd_driver_load(mod, what, arg); } Modified: head/sys/dev/usb/umass.c ============================================================================== --- head/sys/dev/usb/umass.c Thu Oct 9 20:43:42 2008 (r183733) +++ head/sys/dev/usb/umass.c Thu Oct 9 20:51:25 2008 (r183734) @@ -3291,17 +3291,6 @@ umass_cam_quirk_cb(struct umass_softc *s xpt_done(ccb); } -static int -umass_driver_load(module_t mod, int what, void *arg) -{ - switch (what) { - case MOD_UNLOAD: - case MOD_LOAD: - default: - return(usbd_driver_load(mod, what, arg)); - } -} - /* * SCSI specific functions */ @@ -3541,7 +3530,7 @@ umass_atapi_transform(struct umass_softc /* (even the comment is missing) */ -DRIVER_MODULE(umass, uhub, umass_driver, umass_devclass, umass_driver_load, 0); +DRIVER_MODULE(umass, uhub, umass_driver, umass_devclass, usbd_driver_load, 0); From owner-svn-src-head@FreeBSD.ORG Thu Oct 9 21:25:02 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 77280106568C; Thu, 9 Oct 2008 21:25:02 +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 625388FC28; Thu, 9 Oct 2008 21:25:02 +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 m99LP2cT071983; Thu, 9 Oct 2008 21:25:02 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 m99LP1fJ071973; Thu, 9 Oct 2008 21:25:01 GMT (envelope-from n_hibma@svn.freebsd.org) Message-Id: <200810092125.m99LP1fJ071973@svn.freebsd.org> From: Nick Hibma Date: Thu, 9 Oct 2008 21:25: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: r183735 - in head: share/man/man4 sys/conf sys/dev/usb sys/i386/conf sys/modules sys/modules/u3g X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 09 Oct 2008 21:25:02 -0000 Author: n_hibma Date: Thu Oct 9 21:25:01 2008 New Revision: 183735 URL: http://svn.freebsd.org/changeset/base/183735 Log: Say hello to the u3g driver, implementing support for 3G modems. This was located in the ubsa driver, but should be moved into a separate driver: - 3G modems provide multiple serial ports to allow AT commands while the PPP connection is up. - 3G modems do not provide baud rate or other serial port settings. - Huawei cards need specific initialisation. - ubsa is for Belkin adapters, an Linuxy choice for another device like 3G. Speeds achieved here with a weak signal at best is ~40kb/s (UMTS). No spooky STALLED messages as well. Next: Move over all entries for Sierra and Novatel cards once I have found testers, and implemented serial port enumeration for Sierra (or rather have Andrea Guzzo do it). They list all endpoints in 1 iface instead of 4 ifaces. Submitted by: aguzzo@anywi.com MFC after: 3 weeks Added: head/share/man/man4/u3g.4 (contents, props changed) head/sys/dev/usb/u3g.c (contents, props changed) head/sys/modules/u3g/ head/sys/modules/u3g/Makefile (contents, props changed) Modified: head/share/man/man4/Makefile head/sys/conf/NOTES head/sys/conf/files head/sys/dev/usb/ubsa.c head/sys/dev/usb/usbdevs head/sys/i386/conf/GENERIC head/sys/modules/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Thu Oct 9 20:51:25 2008 (r183734) +++ head/share/man/man4/Makefile Thu Oct 9 21:25:01 2008 (r183735) @@ -384,6 +384,7 @@ MAN= aac.4 \ twe.4 \ tx.4 \ txp.4 \ + u3g.4 \ uark.4 \ uart.4 \ ubsa.4 \ Added: head/share/man/man4/u3g.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/u3g.4 Thu Oct 9 21:25:01 2008 (r183735) @@ -0,0 +1,100 @@ +.\" +.\" Copyright (c) 2008 AnyWi Technologies +.\" All rights reserved. +.\" +.\" This code is derived from uark.c +.\" +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +.\" +.\" $FreeBSD$ +.\" +.Dd October 7, 2008 +.Dt U3G 4 +.Os +.Sh NAME +.Nm u3g +.Nd USB support for 3G datacards +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device u3g" +.Cd "device ucom" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +u3g_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides support for the multiple USB-to-serial interfaces exposed by +many 3G usb/pccard modems. +.Pp +The device is accessed through the +.Xr ucom 4 +driver which makes it behave like a +.Xr tty 4 . +.Sh HARDWARE +The +.Nm +driver supports the following adapters: +.Pp +.Bl -bullet -compact +.It +Option Globetrotter 3G Fusion (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 +.It +Vodafone Mobile Connect Card 3G +.It +Huawei E220 (E270?) +.It +Huawei Mobile +.El +.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) +.Sh SEE ALSO +.Xr tty 4 , +.Xr ucom 4 , +.Xr usb 4 , +.Xr ubsa 4 +.Sh HISTORY +The +.Nm +driver +appeared in +.Fx 7.0 . +The +.Xr ubsa 4 +manual page was modified for +.Nm +by +.An Andrea Guzzo Aq aguzzo@anywi.com +in September 2008. +.Sh AUTHORS +The +.Nm +driver was written by +.An Andrea Guzzo Aq aguzzo@anywi.com . +Hardware for testing provided by AnyWi Technologies, Leiden, NL. Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Thu Oct 9 20:51:25 2008 (r183734) +++ head/sys/conf/NOTES Thu Oct 9 21:25:01 2008 (r183735) @@ -2416,6 +2416,8 @@ device uscanner # # USB serial support device ucom +# USB support for 3G modem cards by Option, Huawei and Sierra +device u3g # USB support for Technologies ARK3116 based serial adapters device uark # USB support for Belkin F5U103 and compatible serial adapters @@ -2441,7 +2443,6 @@ device aue # ASIX Electronics AX88172 USB 2.0 ethernet driver. Used in the # LinkSys USB200M and various other adapters. - device axe # Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Oct 9 20:51:25 2008 (r183734) +++ head/sys/conf/files Thu Oct 9 21:25:01 2008 (r183735) @@ -1327,6 +1327,7 @@ dev/usb/ohci_pci.c optional ohci pci dev/usb/sl811hs.c optional slhci dev/usb/slhci_pccard.c optional slhci pccard dev/usb/uark.c optional uark +dev/usb/u3g.c optional u3g dev/usb/ubsa.c optional ubsa dev/usb/ubser.c optional ubser dev/usb/ucom.c optional ucom Added: head/sys/dev/usb/u3g.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb/u3g.c Thu Oct 9 21:25:01 2008 (r183735) @@ -0,0 +1,330 @@ +/* + * Copyright (c) 2008 AnyWi Technologies + * Author: Andrea Guzzo + * * based on uark.c 1.1 2006/08/14 08:30:22 jsg * + * * parts from ubsa.c 183348 2008-09-25 12:00:56Z phk * + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * $FreeBSD$ + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +#include "usbdevs.h" + +#ifdef U3G_DEBUG +#define DPRINTFN(n, x) do { if (u3gdebug > (n)) printf x; } while (0) +int u3gtebug = 0; +#else +#define DPRINTFN(n, x) +#endif +#define DPRINTF(x) DPRINTFN(0, x) + +#define U3GBUFSZ 1024 +#define U3G_MAXPORTS 4 + +struct u3g_softc { + struct ucom_softc sc_ucom[U3G_MAXPORTS];; + device_t sc_dev; + usbd_device_handle sc_udev; + u_char sc_msr; + u_char sc_lsr; + u_char numports; + + usbd_interface_handle sc_intr_iface; /* interrupt interface */ +#ifdef U3G_DEBUG + int sc_intr_number; /* interrupt number */ + usbd_pipe_handle sc_intr_pipe; /* interrupt pipe */ + u_char *sc_intr_buf; /* interrupt buffer */ +#endif + int sc_isize; +}; + +struct ucom_callback u3g_callback = { + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, +}; + +static const struct usb_devno u3g_devs[] = { + /* OEM: Option */ + { USB_VENDOR_OPTION, USB_PRODUCT_OPTION_GT3G }, + { USB_VENDOR_OPTION, USB_PRODUCT_OPTION_GT3GQUAD }, + { USB_VENDOR_OPTION, USB_PRODUCT_OPTION_GT3GPLUS }, + { USB_VENDOR_OPTION, USB_PRODUCT_OPTION_GTMAX36 }, + { USB_VENDOR_OPTION, USB_PRODUCT_OPTION_VODAFONEMC3G }, + /* OEM: Huawei */ + { USB_VENDOR_HUAWEI, USB_PRODUCT_HUAWEI_MOBILE }, + { USB_VENDOR_HUAWEI, USB_PRODUCT_HUAWEI_E220 }, + + { 0, 0 } +}; + +#ifdef U3G_DEBUG +static void +u3g_intr(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status) +{ + struct u3g_softc *sc = (struct u3g_softc *)priv; + device_printf(sc->sc_dev, "INTERRUPT CALLBACK\n"); +} +#endif + +static int +u3g_huawei_reinit(usbd_device_handle dev) +{ + /* The Huawei device presents itself as a umass device with Windows + * drivers on it. After installation of the driver, it reinits into a + * 3G serial device. + */ + usb_device_request_t req; + usb_config_descriptor_t *cdesc; + + /* Get the config descriptor */ + cdesc = usbd_get_config_descriptor(dev); + if (cdesc == NULL) + return (UMATCH_NONE); + + /* One iface means umass mode, more than 1 (4 usually) means 3G mode */ + if (cdesc->bNumInterface > 1) + return (UMATCH_VENDOR_PRODUCT); + + req.bmRequestType = UT_WRITE_DEVICE; + req.bRequest = UR_SET_FEATURE; + USETW(req.wValue, UF_DEVICE_REMOTE_WAKEUP); + USETW(req.wIndex, UHF_PORT_SUSPEND); + USETW(req.wLength, 0); + + (void) usbd_do_request(dev, &req, 0); + + return UMATCH_NONE; /* mismatch; it will be gone and reappear */ +} + +static int +u3g_match(device_t self) +{ + struct usb_attach_arg *uaa = device_get_ivars(self); + + if (uaa->iface != NULL) + return (UMATCH_NONE); + + if (uaa->vendor == USB_VENDOR_HUAWEI) + return u3g_huawei_reinit(uaa->device); + + if (usb_lookup(u3g_devs, uaa->vendor, uaa->product)) + return UMATCH_VENDOR_PRODUCT; + + return UMATCH_NONE; +} + +static int +u3g_attach(device_t self) +{ + struct u3g_softc *sc = device_get_softc(self); + struct usb_attach_arg *uaa = device_get_ivars(self); + usbd_device_handle dev = uaa->device; + usbd_interface_handle iface; + usb_interface_descriptor_t *id; + usb_endpoint_descriptor_t *ed; + usbd_status error; + int i, n; + usb_config_descriptor_t *cdesc; + struct ucom_softc *ucom = NULL; + char devnamefmt[32]; + + sc->sc_dev = self; +#ifdef DEBUG + sc->sc_intr_number = -1; + sc->sc_intr_pipe = NULL; +#endif + /* Move the device into the configured state. */ + error = usbd_set_config_index(dev, 1, 1); + if (error) { + device_printf(self, "failed to set configuration: %s\n", + usbd_errstr(error)); + goto bad; + } + + /* get the config descriptor */ + cdesc = usbd_get_config_descriptor(dev); + + if (cdesc == NULL) { + device_printf(self, "failed to get configuration descriptor\n"); + goto bad; + } + + sc->sc_udev = dev; + sc->numports = (cdesc->bNumInterface <= U3G_MAXPORTS)?cdesc->bNumInterface:U3G_MAXPORTS; + for ( i = 0; i < sc->numports; i++ ) { + ucom = &sc->sc_ucom[i]; + + ucom->sc_dev = self; + ucom->sc_udev = dev; + error = usbd_device2interface_handle(dev, i, &iface); + if (error) { + device_printf(ucom->sc_dev, + "failed to get interface, err=%s\n", + usbd_errstr(error)); + ucom->sc_dying = 1; + goto bad; + } + id = usbd_get_interface_descriptor(iface); + ucom->sc_iface = iface; + + ucom->sc_bulkin_no = ucom->sc_bulkout_no = -1; + for (n = 0; n < id->bNumEndpoints; n++) { + ed = usbd_interface2endpoint_descriptor(iface, n); + if (ed == NULL) { + device_printf(ucom->sc_dev, + "could not read endpoint descriptor\n"); + goto bad; + } + if (UE_GET_DIR(ed->bEndpointAddress) == UE_DIR_IN && + UE_GET_XFERTYPE(ed->bmAttributes) == UE_BULK) + ucom->sc_bulkin_no = ed->bEndpointAddress; + else if (UE_GET_DIR(ed->bEndpointAddress) == UE_DIR_OUT && + UE_GET_XFERTYPE(ed->bmAttributes) == UE_BULK) + ucom->sc_bulkout_no = ed->bEndpointAddress; + } + if (ucom->sc_bulkin_no == -1 || ucom->sc_bulkout_no == -1) { + device_printf(ucom->sc_dev, "missing endpoint\n"); + goto bad; + } + ucom->sc_parent = sc; + ucom->sc_ibufsize = U3GBUFSZ; + ucom->sc_obufsize = U3GBUFSZ; + ucom->sc_ibufsizepad = U3GBUFSZ; + ucom->sc_opkthdrlen = 0; + + ucom->sc_callback = &u3g_callback; + + sprintf(devnamefmt,"U%d.%%d", device_get_unit(self)); + DPRINTF(("u3g: in=0x%x out=0x%x, devname=%s\n", + ucom->sc_bulkin_no, ucom->sc_bulkout_no, devnamefmt)); +#if __FreeBSD_version < 800000 + ucom_attach_tty(ucom, TS_CALLOUT, devnamefmt, i); +#else + ucom_attach_tty(ucom, devnamefmt, i); +#endif + } +#ifdef U3G_DEBUG + if (sc->sc_intr_number != -1 && sc->sc_intr_pipe == NULL) { + sc->sc_intr_buf = malloc(sc->sc_isize, M_USBDEV, M_WAITOK); + error = usbd_open_pipe_intr(sc->sc_intr_iface, + sc->sc_intr_number, + USBD_SHORT_XFER_OK, + &sc->sc_intr_pipe, + sc, + sc->sc_intr_buf, + sc->sc_isize, + u3g_intr, + 100); + if (error) { + device_printf(self, + "cannot open interrupt pipe (addr %d)\n", + sc->sc_intr_number); + goto bad; + } + } +#endif + device_printf(self, "configured %d serial ports (/dev/cuaU%d.X)", + sc->numports, device_get_unit(self)); + + return 0; + +bad: + DPRINTF(("u3g_attach: ATTACH ERROR\n")); + ucom->sc_dying = 1; + return ENXIO; +} + +static int +u3g_detach(device_t self) +{ + struct u3g_softc *sc = device_get_softc(self); + int rv = 0; + int i; + + DPRINTF(("u3g_detach: sc=%p\n", sc)); + + for (i = 0; i < sc->numports; i++) { + if(sc->sc_ucom[i].sc_udev) { + sc->sc_ucom[i].sc_dying = 1; + rv = ucom_detach(&sc->sc_ucom[i]); + if(rv != 0) { + device_printf(self, "Can't deallocat port %d", i); + return rv; + } + } + } + +#ifdef U3G_DEBUG + if (sc->sc_intr_pipe != NULL) { + int err = usbd_abort_pipe(sc->sc_intr_pipe); + if (err) + device_printf(self, + "abort interrupt pipe failed: %s\n", + usbd_errstr(err)); + err = usbd_close_pipe(sc->sc_intr_pipe); + if (err) + device_printf(self, + "close interrupt pipe failed: %s\n", + usbd_errstr(err)); + free(sc->sc_intr_buf, M_USBDEV); + sc->sc_intr_pipe = NULL; + } +#endif + + return 0; +} + +static device_method_t u3g_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, u3g_match), + DEVMETHOD(device_attach, u3g_attach), + DEVMETHOD(device_detach, u3g_detach), + + { 0, 0 } +}; + +static driver_t u3g_driver = { + "ucom", + u3g_methods, + sizeof (struct u3g_softc) +}; + +DRIVER_MODULE(u3g, uhub, u3g_driver, ucom_devclass, usbd_driver_load, 0); +MODULE_DEPEND(u3g, usb, 1, 1, 1); +MODULE_DEPEND(u3g, ucom, UCOM_MINVER, UCOM_PREFVER, UCOM_MAXVER); Modified: head/sys/dev/usb/ubsa.c ============================================================================== --- head/sys/dev/usb/ubsa.c Thu Oct 9 20:51:25 2008 (r183734) +++ head/sys/dev/usb/ubsa.c Thu Oct 9 21:25:01 2008 (r183735) @@ -161,8 +161,6 @@ SYSCTL_INT(_hw_usb_ubsa, OID_AUTO, debug struct ubsa_softc { struct ucom_softc sc_ucom; - int sc_huawei; - int sc_iface_number; /* interface number */ usbd_interface_handle sc_intr_iface; /* interrupt interface */ @@ -228,24 +226,11 @@ static const struct ubsa_product { { USB_VENDOR_GOHUBS, USB_PRODUCT_GOHUBS_GOCOM232 }, /* Peracom */ { USB_VENDOR_PERACOM, USB_PRODUCT_PERACOM_SERIAL1 }, - /* Dell version of the Novatel 740 */ - { USB_VENDOR_DELL, USB_PRODUCT_DELL_U740 }, - /* Option Vodafone MC3G */ - { USB_VENDOR_OPTION, USB_PRODUCT_OPTION_VODAFONEMC3G }, - /* Option GlobeTrotter 3G */ - { USB_VENDOR_OPTION, USB_PRODUCT_OPTION_GT3G }, - /* Option GlobeTrotter 3G QUAD */ - { USB_VENDOR_OPTION, USB_PRODUCT_OPTION_GT3GQUAD }, - /* Option GlobeTrotter 3G+ */ - { USB_VENDOR_OPTION, USB_PRODUCT_OPTION_GT3GPLUS }, - /* Option GlobeTrotter Max 3.6 */ - { USB_VENDOR_OPTION, USB_PRODUCT_OPTION_GTMAX36 }, - /* Huawei Mobile */ - { USB_VENDOR_HUAWEI, USB_PRODUCT_HUAWEI_MOBILE }, - { USB_VENDOR_HUAWEI, USB_PRODUCT_HUAWEI_E270 }, + /* Merlin */ { USB_VENDOR_MERLIN, USB_PRODUCT_MERLIN_V620 }, /* Qualcomm, Inc. ZTE CDMA */ { USB_VENDOR_QUALCOMMINC, USB_PRODUCT_QUALCOMMINC_CDMA_MSM }, + /* Novatel */ { USB_VENDOR_NOVATEL, USB_PRODUCT_NOVATEL_CDMA_MODEM }, /* Novatel Wireless Merlin ES620 */ { USB_VENDOR_NOVATEL, USB_PRODUCT_NOVATEL_ES620 }, @@ -256,6 +241,8 @@ static const struct ubsa_product { /* Novatel Wireless Merlin U740 */ { USB_VENDOR_NOVATEL, USB_PRODUCT_NOVATEL_U740 }, { USB_VENDOR_NOVATEL, USB_PRODUCT_NOVATEL_U740_2 }, + /* Dell version of the Novatel 740 */ + { USB_VENDOR_DELL, USB_PRODUCT_DELL_U740 }, /* Novatel Wireless Merlin U950D */ { USB_VENDOR_NOVATEL, USB_PRODUCT_NOVATEL_U950D }, /* Novatel Wireless Merlin V620 */ @@ -341,52 +328,6 @@ MODULE_DEPEND(ubsa, usb, 1, 1, 1); MODULE_DEPEND(ubsa, ucom, UCOM_MINVER, UCOM_PREFVER, UCOM_MAXVER); MODULE_VERSION(ubsa, UBSA_MODVER); -/* - * Huawei Exxx radio devices have a built in flash disk which is their - * default power up configuration. This allows the device to carry its - * own installation software. - * - * Instead of following the USB spec, and create multiple configuration - * descriptors for this, the devices expects the driver to send - * UF_DEVICE_REMOTE_WAKEUP to endpoint 2 to reset the device, so it - * reprobes, now with the radio exposed. - */ - -static usbd_status -ubsa_huawei(device_t self, struct usb_attach_arg *uaa) { - usb_device_request_t req; usbd_device_handle dev; - usb_config_descriptor_t *cdesc; - - if (self == NULL) - return (UMATCH_NONE); - if (uaa == NULL) - return (UMATCH_NONE); - dev = uaa->device; - if (dev == NULL) - return (UMATCH_NONE); - /* get the config descriptor */ - cdesc = usbd_get_config_descriptor(dev); - if (cdesc == NULL) - return (UMATCH_NONE); - - if (cdesc->bNumInterface > 1) - return (0); - - /* Bend it like Beckham */ - device_printf(self, "Kicking Huawei device into radio mode\n"); - memset(&req, 0, sizeof req); - req.bmRequestType = UT_WRITE_DEVICE; - req.bRequest = UR_SET_FEATURE; - USETW(req.wValue, UF_DEVICE_REMOTE_WAKEUP); - USETW(req.wIndex, 2); - USETW(req.wLength, 0); - - /* We get error return, but it works */ - (void)usbd_do_request(dev, &req, 0); - return (UMATCH_NONE); -} - - static int ubsa_match(device_t self) { @@ -399,9 +340,6 @@ ubsa_match(device_t self) for (i = 0; ubsa_products[i].vendor != 0; i++) { if (ubsa_products[i].vendor == uaa->vendor && ubsa_products[i].product == uaa->product) { - if (uaa->vendor == USB_VENDOR_HUAWEI && - ubsa_huawei(self, uaa)) - break; return (UMATCH_VENDOR_PRODUCT); } } @@ -424,9 +362,6 @@ ubsa_attach(device_t self) dev = uaa->device; ucom = &sc->sc_ucom; - if (uaa->vendor == USB_VENDOR_HUAWEI) - sc->sc_huawei = 1; - /* * initialize rts, dtr variables to something * different from boolean 0, 1 @@ -575,8 +510,6 @@ ubsa_request(struct ubsa_softc *sc, u_in usbd_status err; /* The huawei Exxx devices support none of these tricks */ - if (sc->sc_huawei) - return (0); req.bmRequestType = UT_WRITE_VENDOR_DEVICE; req.bRequest = request; USETW(req.wValue, value); Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Thu Oct 9 20:51:25 2008 (r183734) +++ head/sys/dev/usb/usbdevs Thu Oct 9 21:25:01 2008 (r183735) @@ -1434,7 +1434,7 @@ product HTC SMARTPHONE 0x0a51 SmartPhon /* HUAWEI products */ product HUAWEI MOBILE 0x1001 Huawei Mobile -product HUAWEI E270 0x1003 Huawei HSPA modem +product HUAWEI E220 0x1003 Huawei HSDPA modem /* HUAWEI 3com products */ product HUAWEI3COM WUB320G 0x0009 Aolynk WUB320g Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Thu Oct 9 20:51:25 2008 (r183734) +++ head/sys/i386/conf/GENERIC Thu Oct 9 21:25:01 2008 (r183735) @@ -304,6 +304,7 @@ device urio # Diamond Rio 500 MP3 play device uscanner # Scanners # USB Serial devices device ucom # Generic com ttys +device u3g # USB-based 3G modems (Option, Huawei, Sierra) device uark # Technologies ARK3116 based serial adapters device ubsa # Belkin F5U103 and compatible serial adapters device uftdi # For FTDI usb serial adapters Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Thu Oct 9 20:51:25 2008 (r183734) +++ head/sys/modules/Makefile Thu Oct 9 21:25:01 2008 (r183735) @@ -269,6 +269,7 @@ SUBDIR= ${_3dfx} \ twe \ tx \ txp \ + u3g \ uark \ uart \ ubsa \ Added: head/sys/modules/u3g/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/u3g/Makefile Thu Oct 9 21:25:01 2008 (r183735) @@ -0,0 +1,8 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../dev/usb + +KMOD= u3g +SRCS= u3g.c ucomvar.h opt_usb.h device_if.h bus_if.h usbdevs.h + +.include From owner-svn-src-head@FreeBSD.ORG Thu Oct 9 22:01:27 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BCD03106568A; Thu, 9 Oct 2008 22:01:27 +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 AAD678FC27; Thu, 9 Oct 2008 22:01:27 +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 m99M1Rf8072634; Thu, 9 Oct 2008 22:01:27 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m99M1RFV072633; Thu, 9 Oct 2008 22:01:27 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200810092201.m99M1RFV072633@svn.freebsd.org> From: Warner Losh Date: Thu, 9 Oct 2008 22:01: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: r183736 - head/share/mk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 09 Oct 2008 22:01:27 -0000 Author: imp Date: Thu Oct 9 22:01:27 2008 New Revision: 183736 URL: http://svn.freebsd.org/changeset/base/183736 Log: ata module additions now nest ata modules one deeper than any prior module. Increase heuristic used to find them by one. Modified: head/share/mk/bsd.kmod.mk Modified: head/share/mk/bsd.kmod.mk ============================================================================== --- head/share/mk/bsd.kmod.mk Thu Oct 9 21:25:01 2008 (r183735) +++ head/share/mk/bsd.kmod.mk Thu Oct 9 22:01:27 2008 (r183736) @@ -2,7 +2,7 @@ # Search for kernel source tree in standard places. .for _dir in ${.CURDIR}/../.. ${.CURDIR}/../../.. ${.CURDIR}/../../../.. \ - /sys /usr/src/sys + ${.CURDIR}/../../../../.. /sys /usr/src/sys .if !defined(SYSDIR) && exists(${_dir}/kern/) && exists(${_dir}/conf/kmod.mk) SYSDIR= ${_dir} .endif From owner-svn-src-head@FreeBSD.ORG Fri Oct 10 00:16:33 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 16B1D1065690; Fri, 10 Oct 2008 00:16:33 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 044B28FC22; Fri, 10 Oct 2008 00:16:33 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9A0GWjQ074922; Fri, 10 Oct 2008 00:16:32 GMT (envelope-from kan@svn.freebsd.org) Received: (from kan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9A0GWoo074921; Fri, 10 Oct 2008 00:16:32 GMT (envelope-from kan@svn.freebsd.org) Message-Id: <200810100016.m9A0GWoo074921@svn.freebsd.org> From: Alexander Kabaev Date: Fri, 10 Oct 2008 00:16: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: r183737 - head/libexec/rtld-elf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Oct 2008 00:16:33 -0000 Author: kan Date: Fri Oct 10 00:16:32 2008 New Revision: 183737 URL: http://svn.freebsd.org/changeset/base/183737 Log: Allow strong symbols to override weak ones for lookups done through dlsym with RTLD_NEXT/RTLD_SELF handles. Allow symbols from ld-elf.so to be located this way too. Based on report and original patch from sobomax@. Modified: head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Thu Oct 9 22:01:27 2008 (r183736) +++ head/libexec/rtld-elf/rtld.c Fri Oct 10 00:16:32 2008 (r183737) @@ -1925,7 +1925,7 @@ do_dlsym(void *handle, const char *name, { DoneList donelist; const Obj_Entry *obj, *defobj; - const Elf_Sym *def; + const Elf_Sym *def, *symp; unsigned long hash; int lockstate; @@ -1951,9 +1951,26 @@ do_dlsym(void *handle, const char *name, if (handle == RTLD_NEXT) obj = obj->next; for (; obj != NULL; obj = obj->next) { - if ((def = symlook_obj(name, hash, obj, ve, flags)) != NULL) { - defobj = obj; - break; + if ((symp = symlook_obj(name, hash, obj, ve, flags)) != NULL) { + if (def == NULL || ELF_ST_BIND(symp->st_info) != STB_WEAK) { + def = symp; + defobj = obj; + if (ELF_ST_BIND(def->st_info) != STB_WEAK) + break; + } + } + } + /* + * Search the dynamic linker itself, and possibly resolve the + * symbol from there. This is how the application links to + * dynamic linker services such as dlopen. Only the values listed + * in the "exports" array can be resolved from the dynamic linker. + */ + if (def == NULL || ELF_ST_BIND(def->st_info) == STB_WEAK) { + symp = symlook_obj(name, hash, &obj_rtld, ve, flags); + if (symp != NULL && is_exported(symp)) { + def = symp; + defobj = &obj_rtld; } } } else { From owner-svn-src-head@FreeBSD.ORG Fri Oct 10 04:23:41 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F1F61065688; Fri, 10 Oct 2008 04:23:41 +0000 (UTC) (envelope-from jkoshy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6FADF8FC26; Fri, 10 Oct 2008 04:23:41 +0000 (UTC) (envelope-from jkoshy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9A4NfnH082646; Fri, 10 Oct 2008 04:23:41 GMT (envelope-from jkoshy@svn.freebsd.org) Received: (from jkoshy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9A4NfED082645; Fri, 10 Oct 2008 04:23:41 GMT (envelope-from jkoshy@svn.freebsd.org) Message-Id: <200810100423.m9A4NfED082645@svn.freebsd.org> From: Joseph Koshy Date: Fri, 10 Oct 2008 04:23:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r183738 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Oct 2008 04:23:41 -0000 Author: jkoshy Date: Fri Oct 10 04:23:40 2008 New Revision: 183738 URL: http://svn.freebsd.org/changeset/base/183738 Log: Mention the libpmc/hwpmc ABI change introduced in SVN r183725. Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Fri Oct 10 00:16:32 2008 (r183737) +++ head/UPDATING Fri Oct 10 04:23:40 2008 (r183738) @@ -22,6 +22,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. to maximize performance. (To disable malloc debugging, run ln -s aj /etc/malloc.conf.) +20081009: + The ABI used by the PMC toolset has changed. Please keep + userland (libpmc(3)) and the kernel module (hwpmc(4)) in + sync. + 20080820: The TTY subsystem of the kernel has been replaced by a new implementation, which provides better scalability and an From owner-svn-src-head@FreeBSD.ORG Fri Oct 10 05:10:11 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B5B9106568C; Fri, 10 Oct 2008 05:10:11 +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 3BD0E8FC19; Fri, 10 Oct 2008 05:10:11 +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 m9A5AA3g083466; Fri, 10 Oct 2008 05:10:10 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9A5AAnM083465; Fri, 10 Oct 2008 05:10:10 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200810100510.m9A5AAnM083465@svn.freebsd.org> From: Warner Losh Date: Fri, 10 Oct 2008 05:10:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r183739 - head/libexec/rtld-elf/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: Fri, 10 Oct 2008 05:10:11 -0000 Author: imp Date: Fri Oct 10 05:10:10 2008 New Revision: 183739 URL: http://svn.freebsd.org/changeset/base/183739 Log: MFp4: Fix a bug in the mips relocation code that prevents shared images from working. From p4 filelog of the upstream file in p4 //depot/projects/mips2-jnpr/src/libexec/rtld-elf/mips/reloc.c ... #6 change 140737 edit on 2008/04/27 by gonzo@gonzo_jeeves (text+ko) o Looks like handler for R_MIPS_REL32 brought by CS 137942 is broken for tradmips. Code from NetBSD's libexec/ld.elf_so/arch/mips/mips_reloc.c works just fine. ... #3 change 137942 edit on 2008/03/17 by rrs@rrs-mips2-jnpr (text+ko) Any relocation symbol lookup if its 0. It looks like this is the way the compiler indicates you need to look in another shared library. When we hit these as we relocate a object we will do the symbol lookups and setup the relocation table with the right value. Submitted by: rrs@, gonzo@ Modified: head/libexec/rtld-elf/mips/reloc.c Modified: head/libexec/rtld-elf/mips/reloc.c ============================================================================== --- head/libexec/rtld-elf/mips/reloc.c Fri Oct 10 04:23:40 2008 (r183738) +++ head/libexec/rtld-elf/mips/reloc.c Fri Oct 10 05:10:10 2008 (r183739) @@ -258,31 +258,23 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry case R_TYPE(REL32): /* 32-bit PC-relative reference */ def = obj->symtab + symnum; - tmp = load_ptr(where); - if (tmp == 0) { - def = find_symdef(symnum, obj, &defobj, false, NULL); - if (def == NULL) { - dbg("Warning5, cant find symbole %d:%s", (int)symnum, - obj->strtab + obj->symtab[symnum].st_name); - } else { - tmp = def->st_value + (Elf_Addr)defobj->relocbase; - dbg("Correctiong symnum:%d:%s to addr:%x", (int)symnum, - obj->strtab + obj->symtab[symnum].st_name, - (u_int32_t)tmp - ); - } + if (symnum >= obj->gotsym) { + tmp = load_ptr(where); + tmp += got[obj->local_gotno + symnum - obj->gotsym]; + store_ptr(where, tmp); + break; } else { - tmp += (Elf_Addr)obj->relocbase; - } - store_ptr(where, tmp); - if (tmp == (Elf_Addr)obj->relocbase) { - dbg("rel sym %p falls on relocbase symidx:%x symbol:%s", rel, - (uint32_t)ELF_R_SYM(rel->r_info), - obj->strtab + obj->symtab[symnum].st_name - ); + tmp = load_ptr(where); + + if (def->st_info == + ELF_ST_INFO(STB_LOCAL, STT_SECTION) + ) + tmp += (Elf_Addr)def->st_value; + + tmp += (Elf_Addr)obj->relocbase; + store_ptr(where, tmp); } break; - default: dbg("sym = %lu, type = %lu, offset = %p, " "contents = %p, symbol = %s", From owner-svn-src-head@FreeBSD.ORG Fri Oct 10 06:26:37 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B977E1065689; Fri, 10 Oct 2008 06:26:37 +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 91AA88FC18; Fri, 10 Oct 2008 06:26:37 +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 m9A6Qb1J084777; Fri, 10 Oct 2008 06:26:37 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 m9A6QbZP084776; Fri, 10 Oct 2008 06:26:37 GMT (envelope-from n_hibma@svn.freebsd.org) Message-Id: <200810100626.m9A6QbZP084776@svn.freebsd.org> From: Nick Hibma Date: Fri, 10 Oct 2008 06:26: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: r183740 - 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, 10 Oct 2008 06:26:37 -0000 Author: n_hibma Date: Fri Oct 10 06:26:37 2008 New Revision: 183740 URL: http://svn.freebsd.org/changeset/base/183740 Log: Wrong FBSD version number in HISTORY section. Submitted by: pluknet Modified: head/share/man/man4/u3g.4 Modified: head/share/man/man4/u3g.4 ============================================================================== --- head/share/man/man4/u3g.4 Fri Oct 10 05:10:10 2008 (r183739) +++ head/share/man/man4/u3g.4 Fri Oct 10 06:26:37 2008 (r183740) @@ -84,7 +84,7 @@ The .Nm driver appeared in -.Fx 7.0 . +.Fx 8.0 . The .Xr ubsa 4 manual page was modified for From owner-svn-src-head@FreeBSD.ORG Fri Oct 10 06:37:52 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C3701065687; Fri, 10 Oct 2008 06:37:52 +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 3D8588FC08; Fri, 10 Oct 2008 06:37:52 +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 m9A6bqlV085014; Fri, 10 Oct 2008 06:37:52 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 m9A6bqoI085013; Fri, 10 Oct 2008 06:37:52 GMT (envelope-from n_hibma@svn.freebsd.org) Message-Id: <200810100637.m9A6bqoI085013@svn.freebsd.org> From: Nick Hibma Date: Fri, 10 Oct 2008 06:37: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: r183741 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Oct 2008 06:37:52 -0000 Author: n_hibma Date: Fri Oct 10 06:37:51 2008 New Revision: 183741 URL: http://svn.freebsd.org/changeset/base/183741 Log: Add an entry about the split up of usb into usb+*hci modules. Submitted by: Andrew Thompson Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Fri Oct 10 06:26:37 2008 (r183740) +++ head/UPDATING Fri Oct 10 06:37:51 2008 (r183741) @@ -23,6 +23,16 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. ln -s aj /etc/malloc.conf.) 20081009: + The uhci, ohci, ehci and slhci USB Host controller drivers have + been put into separate modules. If you load the usb module + separately through loader.conf you will need to load the + appropriate *hci module as well. E.g. for a UHCI-based USB 2.0 + controller add the following to loader.conf: + + uhci_load="YES" + ehci_load="YES" + +20081009: The ABI used by the PMC toolset has changed. Please keep userland (libpmc(3)) and the kernel module (hwpmc(4)) in sync. From owner-svn-src-head@FreeBSD.ORG Fri Oct 10 07:16:45 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C54D1065696; Fri, 10 Oct 2008 07:16:45 +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 4D5FB8FC1C; Fri, 10 Oct 2008 07:16:45 +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 m9A7GiFF085670; Fri, 10 Oct 2008 07:16:44 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 m9A7GiTs085669; Fri, 10 Oct 2008 07:16:44 GMT (envelope-from n_hibma@svn.freebsd.org) Message-Id: <200810100716.m9A7GiTs085669@svn.freebsd.org> From: Nick Hibma Date: Fri, 10 Oct 2008 07:16: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: r183742 - 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, 10 Oct 2008 07:16:45 -0000 Author: n_hibma Date: Fri Oct 10 07:16:44 2008 New Revision: 183742 URL: http://svn.freebsd.org/changeset/base/183742 Log: Typo in ifdef. Submitted by: Andrew Thompson Modified: head/sys/dev/usb/u3g.c Modified: head/sys/dev/usb/u3g.c ============================================================================== --- head/sys/dev/usb/u3g.c Fri Oct 10 06:37:51 2008 (r183741) +++ head/sys/dev/usb/u3g.c Fri Oct 10 07:16:44 2008 (r183742) @@ -165,7 +165,7 @@ u3g_attach(device_t self) char devnamefmt[32]; sc->sc_dev = self; -#ifdef DEBUG +#ifdef U3G_DEBUG sc->sc_intr_number = -1; sc->sc_intr_pipe = NULL; #endif From owner-svn-src-head@FreeBSD.ORG Fri Oct 10 14:33:48 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2E83C106568A; Fri, 10 Oct 2008 14:33:48 +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 19FFA8FC13; Fri, 10 Oct 2008 14:33:48 +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 m9AEXlrf093737; Fri, 10 Oct 2008 14:33:47 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9AEXlH5093736; Fri, 10 Oct 2008 14:33:47 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200810101433.m9AEXlH5093736@svn.freebsd.org> From: Robert Watson Date: Fri, 10 Oct 2008 14:33: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: r183744 - 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, 10 Oct 2008 14:33:48 -0000 Author: rwatson Date: Fri Oct 10 14:33:47 2008 New Revision: 183744 URL: http://svn.freebsd.org/changeset/base/183744 Log: Fix content and spelling of comment on _ipfw_insn.len -- a count of 32-bit words, not 32-byte words. MFC after: 3 days Modified: head/sys/netinet/ip_fw.h Modified: head/sys/netinet/ip_fw.h ============================================================================== --- head/sys/netinet/ip_fw.h Fri Oct 10 11:39:59 2008 (r183743) +++ head/sys/netinet/ip_fw.h Fri Oct 10 14:33:47 2008 (r183744) @@ -223,7 +223,7 @@ enum ipfw_opcodes { /* arguments (4 byt */ typedef struct _ipfw_insn { /* template for instructions */ enum ipfw_opcodes opcode:8; - u_int8_t len; /* numer of 32-byte words */ + u_int8_t len; /* number of 32-bit words */ #define F_NOT 0x80 #define F_OR 0x40 #define F_LEN_MASK 0x3f From owner-svn-src-head@FreeBSD.ORG Fri Oct 10 17:49:47 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 810171065687; Fri, 10 Oct 2008 17:49:47 +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 7411B8FC12; Fri, 10 Oct 2008 17:49:47 +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 m9AHnlIM097238; Fri, 10 Oct 2008 17:49:47 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9AHnlCh097237; Fri, 10 Oct 2008 17:49:47 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200810101749.m9AHnlCh097237@svn.freebsd.org> From: Warner Losh Date: Fri, 10 Oct 2008 17:49: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: r183750 - 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, 10 Oct 2008 17:49:47 -0000 Author: imp Date: Fri Oct 10 17:49:47 2008 New Revision: 183750 URL: http://svn.freebsd.org/changeset/base/183750 Log: Close, but not eliminate, a race condition. It is one that properly designed drivers would never hit, but was exposed in diving into another problem... When expanding the devclass array, free the old memory after updating the pointer to the new memory. For the following single race case, this helps: allocate new memory copy to new memory free old memory read pointer to freed memory update pointer to new memory Now we do allocate new memory copy to new memory update pointer to new memory free old memory Which closes this problem, but doesn't even begin to address the multicpu races, which all should be covered by Giant at the moment, but likely aren't completely. Note: reviewers were ok with this fix, but suggested the use case wasn't one we wanted to encourage. Reviewed by: jhb, scottl. Modified: head/sys/kern/subr_bus.c Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Fri Oct 10 17:48:39 2008 (r183749) +++ head/sys/kern/subr_bus.c Fri Oct 10 17:49:47 2008 (r183750) @@ -1344,20 +1344,22 @@ devclass_alloc_unit(devclass_t dc, int * * this one. */ if (unit >= dc->maxunit) { - device_t *newlist; + device_t *newlist, *oldlist; int newsize; + oldlist = dc->devices; newsize = roundup((unit + 1), MINALLOCSIZE / sizeof(device_t)); newlist = malloc(sizeof(device_t) * newsize, M_BUS, M_NOWAIT); if (!newlist) return (ENOMEM); - bcopy(dc->devices, newlist, sizeof(device_t) * dc->maxunit); + if (oldlist != NULL) + bcopy(oldlist, newlist, sizeof(device_t) * dc->maxunit); bzero(newlist + dc->maxunit, sizeof(device_t) * (newsize - dc->maxunit)); - if (dc->devices) - free(dc->devices, M_BUS); dc->devices = newlist; dc->maxunit = newsize; + if (oldlist != NULL) + free(oldlist, M_BUS); } PDEBUG(("now: unit %d in devclass %s", unit, DEVCLANAME(dc))); From owner-svn-src-head@FreeBSD.ORG Fri Oct 10 20:05:16 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 34E811065699; Fri, 10 Oct 2008 20:05:16 +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 2AF218FC15; Fri, 10 Oct 2008 20:05:16 +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 m9AK5GXu099619; Fri, 10 Oct 2008 20:05:16 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 m9AK5Gno099618; Fri, 10 Oct 2008 20:05:16 GMT (envelope-from n_hibma@svn.freebsd.org) Message-Id: <200810102005.m9AK5Gno099618@svn.freebsd.org> From: Nick Hibma Date: Fri, 10 Oct 2008 20:05: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: r183752 - 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, 10 Oct 2008 20:05:16 -0000 Author: n_hibma Date: Fri Oct 10 20:05:15 2008 New Revision: 183752 URL: http://svn.freebsd.org/changeset/base/183752 Log: Typo. Modified: head/sys/dev/usb/umct.c Modified: head/sys/dev/usb/umct.c ============================================================================== --- head/sys/dev/usb/umct.c Fri Oct 10 17:53:26 2008 (r183751) +++ head/sys/dev/usb/umct.c Fri Oct 10 20:05:15 2008 (r183752) @@ -314,7 +314,7 @@ umct_request(struct umct_softc *sc, uint err = usbd_do_request(sc->sc_ucom.sc_udev, &req, oval); if (err) - printf("%s: ubsa_request: %s\n", + printf("%s: umct_request: %s\n", device_get_nameunit(sc->sc_ucom.sc_dev), usbd_errstr(err)); return (err); } From owner-svn-src-head@FreeBSD.ORG Fri Oct 10 21:23:52 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B42C1065688; Fri, 10 Oct 2008 21:23:52 +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 0D1178FC08; Fri, 10 Oct 2008 21:23:52 +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 m9ALNq25001363; Fri, 10 Oct 2008 21:23:52 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9ALNpou001340; Fri, 10 Oct 2008 21:23:51 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <200810102123.m9ALNpou001340@svn.freebsd.org> From: Attilio Rao Date: Fri, 10 Oct 2008 21:23: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: r183754 - in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs fs/cd9660 fs/hpfs fs/msdosfs fs/ntfs fs/nwfs fs/smbfs fs/udf geom gnu/fs/ext2fs gnu/fs/xfs/FreeBSD kern nfsclient sys u... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 10 Oct 2008 21:23:52 -0000 Author: attilio Date: Fri Oct 10 21:23:50 2008 New Revision: 183754 URL: http://svn.freebsd.org/changeset/base/183754 Log: Remove the struct thread unuseful argument from bufobj interface. In particular following functions KPI results modified: - bufobj_invalbuf() - bufsync() and BO_SYNC() "virtual method" of the buffer objects set. Main consumers of bufobj functions are affected by this change too and, in particular, functions which changed their KPI are: - vinvalbuf() - g_vfs_close() Due to the KPI breakage, __FreeBSD_version will be bumped in a later commit. As a side note, please consider just temporary the 'curthread' argument passing to VOP_SYNC() (in bufsync()) as it will be axed out ASAP Reviewed by: kib Tested by: Giovanni Trematerra Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c head/sys/fs/cd9660/cd9660_vfsops.c head/sys/fs/hpfs/hpfs_vfsops.c head/sys/fs/msdosfs/msdosfs_vfsops.c head/sys/fs/ntfs/ntfs_vfsops.c head/sys/fs/nwfs/nwfs_io.c head/sys/fs/smbfs/smbfs_io.c head/sys/fs/udf/udf_vfsops.c head/sys/geom/geom_vfs.c head/sys/geom/geom_vfs.h head/sys/gnu/fs/ext2fs/ext2_vfsops.c head/sys/gnu/fs/xfs/FreeBSD/xfs_buf.c head/sys/gnu/fs/xfs/FreeBSD/xfs_mountops.c head/sys/gnu/fs/xfs/FreeBSD/xfs_super.c head/sys/kern/vfs_bio.c head/sys/kern/vfs_mount.c head/sys/kern/vfs_subr.c head/sys/nfsclient/nfs_bio.c head/sys/sys/bufobj.h head/sys/sys/vnode.h head/sys/ufs/ffs/ffs_inode.c head/sys/ufs/ffs/ffs_vfsops.c head/sys/vm/vm_object.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Fri Oct 10 21:18:12 2008 (r183753) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Fri Oct 10 21:23:50 2008 (r183754) @@ -916,7 +916,7 @@ zfs_freesp(znode_t *zp, uint64_t off, ui #if 0 error = vtruncbuf(vp, curthread->td_ucred, curthread, end, PAGE_SIZE); #else - error = vinvalbuf(vp, V_SAVE, curthread, 0, 0); + error = vinvalbuf(vp, V_SAVE, 0, 0); vnode_pager_setsize(vp, end); #endif } Modified: head/sys/fs/cd9660/cd9660_vfsops.c ============================================================================== --- head/sys/fs/cd9660/cd9660_vfsops.c Fri Oct 10 21:18:12 2008 (r183753) +++ head/sys/fs/cd9660/cd9660_vfsops.c Fri Oct 10 21:23:50 2008 (r183754) @@ -88,8 +88,7 @@ static struct vfsops cd9660_vfsops = { VFS_SET(cd9660_vfsops, cd9660, VFCF_READONLY); MODULE_VERSION(cd9660, 1); -static int iso_mountfs(struct vnode *devvp, struct mount *mp, - struct thread *td); +static int iso_mountfs(struct vnode *devvp, struct mount *mp); /* * VFS Operations. @@ -181,7 +180,7 @@ cd9660_mount(struct mount *mp, struct th VOP_UNLOCK(devvp, 0); if ((mp->mnt_flag & MNT_UPDATE) == 0) { - error = iso_mountfs(devvp, mp, td); + error = iso_mountfs(devvp, mp); } else { if (devvp != imp->im_devvp) error = EINVAL; /* needs translation */ @@ -200,10 +199,9 @@ cd9660_mount(struct mount *mp, struct th * Common code for mount and mountroot */ static int -iso_mountfs(devvp, mp, td) +iso_mountfs(devvp, mp) struct vnode *devvp; struct mount *mp; - struct thread *td; { struct iso_mnt *isomp = (struct iso_mnt *)0; struct buf *bp = NULL; @@ -249,7 +247,7 @@ iso_mountfs(devvp, mp, td) if ((ISO_DEFAULT_BLOCK_SIZE % cp->provider->sectorsize) != 0) { DROP_GIANT(); g_topology_lock(); - g_vfs_close(cp, td); + g_vfs_close(cp); g_topology_unlock(); PICKUP_GIANT(); return (EINVAL); @@ -482,7 +480,7 @@ out: if (cp != NULL) { DROP_GIANT(); g_topology_lock(); - g_vfs_close(cp, td); + g_vfs_close(cp); g_topology_unlock(); PICKUP_GIANT(); } @@ -525,7 +523,7 @@ cd9660_unmount(mp, mntflags, td) } DROP_GIANT(); g_topology_lock(); - g_vfs_close(isomp->im_cp, td); + g_vfs_close(isomp->im_cp); g_topology_unlock(); PICKUP_GIANT(); vrele(isomp->im_devvp); Modified: head/sys/fs/hpfs/hpfs_vfsops.c ============================================================================== --- head/sys/fs/hpfs/hpfs_vfsops.c Fri Oct 10 21:18:12 2008 (r183753) +++ head/sys/fs/hpfs/hpfs_vfsops.c Fri Oct 10 21:23:50 2008 (r183754) @@ -325,7 +325,7 @@ failed: mp->mnt_data = NULL; DROP_GIANT(); g_topology_lock(); - g_vfs_close(cp, td); + g_vfs_close(cp); g_topology_unlock(); PICKUP_GIANT(); return (error); @@ -356,10 +356,10 @@ hpfs_unmount( return (error); } - vinvalbuf(hpmp->hpm_devvp, V_SAVE, td, 0, 0); + vinvalbuf(hpmp->hpm_devvp, V_SAVE, 0, 0); DROP_GIANT(); g_topology_lock(); - g_vfs_close(hpmp->hpm_cp, td); + g_vfs_close(hpmp->hpm_cp); g_topology_unlock(); PICKUP_GIANT(); vrele(hpmp->hpm_devvp); Modified: head/sys/fs/msdosfs/msdosfs_vfsops.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_vfsops.c Fri Oct 10 21:18:12 2008 (r183753) +++ head/sys/fs/msdosfs/msdosfs_vfsops.c Fri Oct 10 21:23:50 2008 (r183754) @@ -103,8 +103,7 @@ static MALLOC_DEFINE(M_MSDOSFSFAT, "msdo struct iconv_functions *msdosfs_iconv; static int update_mp(struct mount *mp, struct thread *td); -static int mountmsdosfs(struct vnode *devvp, struct mount *mp, - struct thread *td); +static int mountmsdosfs(struct vnode *devvp, struct mount *mp); static vfs_fhtovp_t msdosfs_fhtovp; static vfs_mount_t msdosfs_mount; static vfs_root_t msdosfs_root; @@ -375,7 +374,7 @@ msdosfs_mount(struct mount *mp, struct t return (error); } if ((mp->mnt_flag & MNT_UPDATE) == 0) { - error = mountmsdosfs(devvp, mp, td); + error = mountmsdosfs(devvp, mp); #ifdef MSDOSFS_DEBUG /* only needed for the printf below */ pmp = VFSTOMSDOSFS(mp); #endif @@ -405,7 +404,7 @@ msdosfs_mount(struct mount *mp, struct t } static int -mountmsdosfs(struct vnode *devvp, struct mount *mp, struct thread *td) +mountmsdosfs(struct vnode *devvp, struct mount *mp) { struct msdosfsmount *pmp; struct buf *bp; @@ -754,7 +753,7 @@ error_exit: if (cp != NULL) { DROP_GIANT(); g_topology_lock(); - g_vfs_close(cp, td); + g_vfs_close(cp); g_topology_unlock(); PICKUP_GIANT(); } @@ -824,7 +823,7 @@ msdosfs_unmount(struct mount *mp, int mn #endif DROP_GIANT(); g_topology_lock(); - g_vfs_close(pmp->pm_cp, td); + g_vfs_close(pmp->pm_cp); g_topology_unlock(); PICKUP_GIANT(); vrele(pmp->pm_devvp); Modified: head/sys/fs/ntfs/ntfs_vfsops.c ============================================================================== --- head/sys/fs/ntfs/ntfs_vfsops.c Fri Oct 10 21:18:12 2008 (r183753) +++ head/sys/fs/ntfs/ntfs_vfsops.c Fri Oct 10 21:23:50 2008 (r183754) @@ -462,7 +462,7 @@ out: DROP_GIANT(); g_topology_lock(); - g_vfs_close(cp, td); + g_vfs_close(cp); g_topology_unlock(); PICKUP_GIANT(); @@ -506,11 +506,11 @@ ntfs_unmount( if (error) printf("ntfs_unmount: vflush failed(sysnodes): %d\n",error); - vinvalbuf(ntmp->ntm_devvp, V_SAVE, td, 0, 0); + vinvalbuf(ntmp->ntm_devvp, V_SAVE, 0, 0); DROP_GIANT(); g_topology_lock(); - g_vfs_close(ntmp->ntm_cp, td); + g_vfs_close(ntmp->ntm_cp); g_topology_unlock(); PICKUP_GIANT(); Modified: head/sys/fs/nwfs/nwfs_io.c ============================================================================== --- head/sys/fs/nwfs/nwfs_io.c Fri Oct 10 21:18:12 2008 (r183753) +++ head/sys/fs/nwfs/nwfs_io.c Fri Oct 10 21:23:50 2008 (r183754) @@ -618,7 +618,7 @@ nwfs_vinvalbuf(vp, td) VM_OBJECT_UNLOCK(vp->v_bufobj.bo_object); } - error = vinvalbuf(vp, V_SAVE, td, PCATCH, 0); + error = vinvalbuf(vp, V_SAVE, PCATCH, 0); while (error) { if (error == ERESTART || error == EINTR) { np->n_flag &= ~NFLUSHINPROG; @@ -628,7 +628,7 @@ nwfs_vinvalbuf(vp, td) } return EINTR; } - error = vinvalbuf(vp, V_SAVE, td, PCATCH, 0); + error = vinvalbuf(vp, V_SAVE, PCATCH, 0); } np->n_flag &= ~(NMODIFIED | NFLUSHINPROG); if (np->n_flag & NFLUSHWANT) { Modified: head/sys/fs/smbfs/smbfs_io.c ============================================================================== --- head/sys/fs/smbfs/smbfs_io.c Fri Oct 10 21:18:12 2008 (r183753) +++ head/sys/fs/smbfs/smbfs_io.c Fri Oct 10 21:23:50 2008 (r183754) @@ -690,7 +690,7 @@ smbfs_vinvalbuf(struct vnode *vp, struct VM_OBJECT_UNLOCK(vp->v_bufobj.bo_object); } - error = vinvalbuf(vp, V_SAVE, td, PCATCH, 0); + error = vinvalbuf(vp, V_SAVE, PCATCH, 0); while (error) { if (error == ERESTART || error == EINTR) { np->n_flag &= ~NFLUSHINPROG; @@ -700,7 +700,7 @@ smbfs_vinvalbuf(struct vnode *vp, struct } return EINTR; } - error = vinvalbuf(vp, V_SAVE, td, PCATCH, 0); + error = vinvalbuf(vp, V_SAVE, PCATCH, 0); } np->n_flag &= ~(NMODIFIED | NFLUSHINPROG); if (np->n_flag & NFLUSHWANT) { Modified: head/sys/fs/udf/udf_vfsops.c ============================================================================== --- head/sys/fs/udf/udf_vfsops.c Fri Oct 10 21:18:12 2008 (r183753) +++ head/sys/fs/udf/udf_vfsops.c Fri Oct 10 21:23:50 2008 (r183754) @@ -134,7 +134,7 @@ VFS_SET(udf_vfsops, udf, VFCF_READONLY); MODULE_VERSION(udf, 1); -static int udf_mountfs(struct vnode *, struct mount *, struct thread *); +static int udf_mountfs(struct vnode *, struct mount *); static int udf_init(struct vfsconf *foo) @@ -243,7 +243,7 @@ udf_mount(struct mount *mp, struct threa return (error); } - if ((error = udf_mountfs(devvp, mp, td))) { + if ((error = udf_mountfs(devvp, mp))) { vrele(devvp); return (error); } @@ -301,7 +301,7 @@ udf_checktag(struct desc_tag *tag, uint1 } static int -udf_mountfs(struct vnode *devvp, struct mount *mp, struct thread *td) { +udf_mountfs(struct vnode *devvp, struct mount *mp) { struct buf *bp = NULL; struct anchor_vdp avdp; struct udf_mnt *udfmp = NULL; @@ -365,7 +365,7 @@ udf_mountfs(struct vnode *devvp, struct (logical_secsize < cp->provider->sectorsize)) { DROP_GIANT(); g_topology_lock(); - g_vfs_close(cp, td); + g_vfs_close(cp); g_topology_unlock(); PICKUP_GIANT(); return (EINVAL); @@ -493,7 +493,7 @@ bail: brelse(bp); DROP_GIANT(); g_topology_lock(); - g_vfs_close(cp, td); + g_vfs_close(cp); g_topology_unlock(); PICKUP_GIANT(); return error; @@ -524,7 +524,7 @@ udf_unmount(struct mount *mp, int mntfla DROP_GIANT(); g_topology_lock(); - g_vfs_close(udfmp->im_cp, td); + g_vfs_close(udfmp->im_cp); g_topology_unlock(); PICKUP_GIANT(); vrele(udfmp->im_devvp); Modified: head/sys/geom/geom_vfs.c ============================================================================== --- head/sys/geom/geom_vfs.c Fri Oct 10 21:18:12 2008 (r183753) +++ head/sys/geom/geom_vfs.c Fri Oct 10 21:23:50 2008 (r183754) @@ -163,7 +163,7 @@ g_vfs_open(struct vnode *vp, struct g_co } void -g_vfs_close(struct g_consumer *cp, struct thread *td) +g_vfs_close(struct g_consumer *cp) { struct g_geom *gp; struct bufobj *bo; @@ -172,6 +172,6 @@ g_vfs_close(struct g_consumer *cp, struc gp = cp->geom; bo = gp->softc; - bufobj_invalbuf(bo, V_SAVE, td, 0, 0); + bufobj_invalbuf(bo, V_SAVE, 0, 0); g_wither_geom_close(gp, ENXIO); } Modified: head/sys/geom/geom_vfs.h ============================================================================== --- head/sys/geom/geom_vfs.h Fri Oct 10 21:18:12 2008 (r183753) +++ head/sys/geom/geom_vfs.h Fri Oct 10 21:23:50 2008 (r183754) @@ -37,6 +37,6 @@ extern struct buf_ops *g_vfs_bufops; void g_vfs_strategy(struct bufobj *bo, struct buf *bp); int g_vfs_open(struct vnode *vp, struct g_consumer **cpp, const char *fsname, int wr); -void g_vfs_close(struct g_consumer *cp, struct thread *td); +void g_vfs_close(struct g_consumer *cp); #endif /* _GEOM_GEOM_VFS_H_ */ Modified: head/sys/gnu/fs/ext2fs/ext2_vfsops.c ============================================================================== --- head/sys/gnu/fs/ext2fs/ext2_vfsops.c Fri Oct 10 21:18:12 2008 (r183753) +++ head/sys/gnu/fs/ext2fs/ext2_vfsops.c Fri Oct 10 21:23:50 2008 (r183754) @@ -82,7 +82,7 @@ #include static int ext2_flushfiles(struct mount *mp, int flags, struct thread *td); -static int ext2_mountfs(struct vnode *, struct mount *, struct thread *); +static int ext2_mountfs(struct vnode *, struct mount *); static int ext2_reload(struct mount *mp, struct thread *td); static int ext2_sbupdate(struct ext2mount *, int); @@ -277,7 +277,7 @@ ext2_mount(mp, td) } if ((mp->mnt_flag & MNT_UPDATE) == 0) { - error = ext2_mountfs(devvp, mp, td); + error = ext2_mountfs(devvp, mp); } else { if (devvp != ump->um_devvp) { vput(devvp); @@ -518,7 +518,7 @@ ext2_reload(struct mount *mp, struct thr */ devvp = VFSTOEXT2(mp)->um_devvp; vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY); - if (vinvalbuf(devvp, 0, td, 0, 0) != 0) + if (vinvalbuf(devvp, 0, 0, 0) != 0) panic("ext2_reload: dirty1"); VOP_UNLOCK(devvp, 0); @@ -562,7 +562,7 @@ loop: MNT_VNODE_FOREACH_ABORT(mp, mvp); goto loop; } - if (vinvalbuf(vp, 0, td, 0, 0)) + if (vinvalbuf(vp, 0, 0, 0)) panic("ext2_reload: dirty2"); /* * Step 5: re-read inode data for all active vnodes. @@ -592,10 +592,9 @@ loop: * Common code for mount and mountroot */ static int -ext2_mountfs(devvp, mp, td) +ext2_mountfs(devvp, mp) struct vnode *devvp; struct mount *mp; - struct thread *td; { struct ext2mount *ump; struct buf *bp; @@ -623,7 +622,7 @@ ext2_mountfs(devvp, mp, td) (SBSIZE < cp->provider->sectorsize)) { DROP_GIANT(); g_topology_lock(); - g_vfs_close(cp, td); + g_vfs_close(cp); g_topology_unlock(); PICKUP_GIANT(); return (EINVAL); @@ -714,7 +713,7 @@ out: if (cp != NULL) { DROP_GIANT(); g_topology_lock(); - g_vfs_close(cp, td); + g_vfs_close(cp); g_topology_unlock(); PICKUP_GIANT(); } @@ -773,7 +772,7 @@ ext2_unmount(mp, mntflags, td) DROP_GIANT(); g_topology_lock(); - g_vfs_close(ump->um_cp, td); + g_vfs_close(ump->um_cp); g_topology_unlock(); PICKUP_GIANT(); vrele(ump->um_devvp); Modified: head/sys/gnu/fs/xfs/FreeBSD/xfs_buf.c ============================================================================== --- head/sys/gnu/fs/xfs/FreeBSD/xfs_buf.c Fri Oct 10 21:18:12 2008 (r183753) +++ head/sys/gnu/fs/xfs/FreeBSD/xfs_buf.c Fri Oct 10 21:23:50 2008 (r183754) @@ -266,7 +266,7 @@ xfs_flush_buftarg( { int error = 0; - error = vinvalbuf(btp->specvp, V_SAVE|V_NORMAL, curthread, 0, 0); + error = vinvalbuf(btp->specvp, V_SAVE | V_NORMAL, 0, 0); return error; } Modified: head/sys/gnu/fs/xfs/FreeBSD/xfs_mountops.c ============================================================================== --- head/sys/gnu/fs/xfs/FreeBSD/xfs_mountops.c Fri Oct 10 21:18:12 2008 (r183753) +++ head/sys/gnu/fs/xfs/FreeBSD/xfs_mountops.c Fri Oct 10 21:23:50 2008 (r183754) @@ -246,7 +246,7 @@ _xfs_mount(struct mount *mp, if (cp != NULL) { DROP_GIANT(); g_topology_lock(); - g_vfs_close(cp, td); + g_vfs_close(cp); g_topology_unlock(); PICKUP_GIANT(); } @@ -283,7 +283,7 @@ _xfs_unmount(mp, mntflags, td) if (cp != NULL) { DROP_GIANT(); g_topology_lock(); - g_vfs_close(cp, td); + g_vfs_close(cp); g_topology_unlock(); PICKUP_GIANT(); } @@ -483,9 +483,10 @@ xfs_geom_bufwrite(struct buf *bp) } static int -xfs_geom_bufsync(struct bufobj *bo, int waitfor, struct thread *td) +xfs_geom_bufsync(struct bufobj *bo, int waitfor) { - return bufsync(bo,waitfor,td); + + return (bufsync(bo, waitfor)); } static void Modified: head/sys/gnu/fs/xfs/FreeBSD/xfs_super.c ============================================================================== --- head/sys/gnu/fs/xfs/FreeBSD/xfs_super.c Fri Oct 10 21:18:12 2008 (r183753) +++ head/sys/gnu/fs/xfs/FreeBSD/xfs_super.c Fri Oct 10 21:23:50 2008 (r183754) @@ -207,7 +207,7 @@ xfs_blkdev_put( if (devvp == NULL) return; - vinvalbuf(devvp, V_SAVE, curthread, 0, 0); + vinvalbuf(devvp, V_SAVE, 0, 0); cp = devvp->v_bufobj.bo_private; DROP_GIANT(); Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Fri Oct 10 21:18:12 2008 (r183753) +++ head/sys/kern/vfs_bio.c Fri Oct 10 21:23:50 2008 (r183754) @@ -3778,10 +3778,10 @@ bwait(struct buf *bp, u_char pri, const } int -bufsync(struct bufobj *bo, int waitfor, struct thread *td) +bufsync(struct bufobj *bo, int waitfor) { - return (VOP_FSYNC(bo->__bo_vnode, waitfor, td)); + return (VOP_FSYNC(bo->__bo_vnode, waitfor, curthread)); } void Modified: head/sys/kern/vfs_mount.c ============================================================================== --- head/sys/kern/vfs_mount.c Fri Oct 10 21:18:12 2008 (r183753) +++ head/sys/kern/vfs_mount.c Fri Oct 10 21:23:50 2008 (r183754) @@ -967,7 +967,7 @@ vfs_domount( return (error); } } - error = vinvalbuf(vp, V_SAVE, td, 0, 0); + error = vinvalbuf(vp, V_SAVE, 0, 0); if (error != 0) { vput(vp); return (error); @@ -1573,7 +1573,7 @@ devfs_fixup(struct thread *td) if (vp->v_type != VDIR) { vput(vp); } - error = vinvalbuf(vp, V_SAVE, td, 0, 0); + error = vinvalbuf(vp, V_SAVE, 0, 0); if (error) { vput(vp); } Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Fri Oct 10 21:18:12 2008 (r183753) +++ head/sys/kern/vfs_subr.c Fri Oct 10 21:23:50 2008 (r183754) @@ -1065,8 +1065,7 @@ insmntque(struct vnode *vp, struct mount * Called with the underlying object locked. */ int -bufobj_invalbuf(struct bufobj *bo, int flags, struct thread *td, int slpflag, - int slptimeo) +bufobj_invalbuf(struct bufobj *bo, int flags, int slpflag, int slptimeo) { int error; @@ -1079,7 +1078,7 @@ bufobj_invalbuf(struct bufobj *bo, int f } if (bo->bo_dirty.bv_cnt > 0) { BO_UNLOCK(bo); - if ((error = BO_SYNC(bo, MNT_WAIT, td)) != 0) + if ((error = BO_SYNC(bo, MNT_WAIT)) != 0) return (error); /* * XXX We could save a lock/unlock if this was only @@ -1149,13 +1148,12 @@ bufobj_invalbuf(struct bufobj *bo, int f * Called with the underlying object locked. */ int -vinvalbuf(struct vnode *vp, int flags, struct thread *td, int slpflag, - int slptimeo) +vinvalbuf(struct vnode *vp, int flags, int slpflag, int slptimeo) { CTR2(KTR_VFS, "vinvalbuf vp %p flags %d", vp, flags); ASSERT_VOP_LOCKED(vp, "vinvalbuf"); - return (bufobj_invalbuf(&vp->v_bufobj, flags, td, slpflag, slptimeo)); + return (bufobj_invalbuf(&vp->v_bufobj, flags, slpflag, slptimeo)); } /* @@ -2505,8 +2503,8 @@ vgonel(struct vnode *vp) mp = NULL; if (!TAILQ_EMPTY(&vp->v_bufobj.bo_dirty.bv_hd)) (void) vn_start_secondary_write(vp, &mp, V_WAIT); - if (vinvalbuf(vp, V_SAVE, td, 0, 0) != 0) - vinvalbuf(vp, 0, td, 0, 0); + if (vinvalbuf(vp, V_SAVE, 0, 0) != 0) + vinvalbuf(vp, 0, 0, 0); /* * If purging an active vnode, it must be closed and Modified: head/sys/nfsclient/nfs_bio.c ============================================================================== --- head/sys/nfsclient/nfs_bio.c Fri Oct 10 21:18:12 2008 (r183753) +++ head/sys/nfsclient/nfs_bio.c Fri Oct 10 21:23:50 2008 (r183754) @@ -1323,11 +1323,11 @@ nfs_vinvalbuf(struct vnode *vp, int flag goto out; } - error = vinvalbuf(vp, flags, td, slpflag, 0); + error = vinvalbuf(vp, flags, slpflag, 0); while (error) { if (intrflg && (error = nfs_sigintr(nmp, NULL, td))) goto out; - error = vinvalbuf(vp, flags, td, 0, slptimeo); + error = vinvalbuf(vp, flags, 0, slptimeo); } mtx_lock(&np->n_mtx); if (np->n_directio_asyncwr == 0) Modified: head/sys/sys/bufobj.h ============================================================================== --- head/sys/sys/bufobj.h Fri Oct 10 21:18:12 2008 (r183753) +++ head/sys/sys/bufobj.h Fri Oct 10 21:23:50 2008 (r183754) @@ -57,7 +57,6 @@ struct bufobj; struct buf_ops; -struct thread; extern struct buf_ops buf_ops_bio; @@ -72,7 +71,7 @@ struct bufv { typedef void b_strategy_t(struct bufobj *, struct buf *); typedef int b_write_t(struct buf *); -typedef int b_sync_t(struct bufobj *, int waitfor, struct thread *td); +typedef int b_sync_t(struct bufobj *, int waitfor); typedef void b_bdflush_t(struct bufobj *, struct buf *); struct buf_ops { @@ -84,7 +83,7 @@ struct buf_ops { }; #define BO_STRATEGY(bo, bp) ((bo)->bo_ops->bop_strategy((bo), (bp))) -#define BO_SYNC(bo, w, td) ((bo)->bo_ops->bop_sync((bo), (w), (td))) +#define BO_SYNC(bo, w) ((bo)->bo_ops->bop_sync((bo), (w))) #define BO_WRITE(bo, bp) ((bo)->bo_ops->bop_write((bp))) #define BO_BDFLUSH(bo, bp) ((bo)->bo_ops->bop_bdflush((bo), (bp))) @@ -123,9 +122,9 @@ struct bufobj { void bufobj_wdrop(struct bufobj *bo); void bufobj_wref(struct bufobj *bo); void bufobj_wrefl(struct bufobj *bo); -int bufobj_invalbuf(struct bufobj *bo, int flags, struct thread *td, int slpflag, int slptimeo); +int bufobj_invalbuf(struct bufobj *bo, int flags, int slpflag, int slptimeo); int bufobj_wwait(struct bufobj *bo, int slpflag, int timeo); -int bufsync(struct bufobj *bo, int waitfor, struct thread *td); +int bufsync(struct bufobj *bo, int waitfor); void bufbdflush(struct bufobj *bo, struct buf *bp); #endif /* defined(_KERNEL) || defined(_KVM_VNODE) */ Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Fri Oct 10 21:18:12 2008 (r183753) +++ head/sys/sys/vnode.h Fri Oct 10 21:23:50 2008 (r183754) @@ -598,8 +598,7 @@ int vget(struct vnode *vp, int lockflag, void vgone(struct vnode *vp); void vhold(struct vnode *); void vholdl(struct vnode *); -int vinvalbuf(struct vnode *vp, int save, - struct thread *td, int slpflag, int slptimeo); +int vinvalbuf(struct vnode *vp, int save, int slpflag, int slptimeo); int vtruncbuf(struct vnode *vp, struct ucred *cred, struct thread *td, off_t length, int blksize); void vn_printf(struct vnode *vp, const char *fmt, ...) __printflike(2,3); Modified: head/sys/ufs/ffs/ffs_inode.c ============================================================================== --- head/sys/ufs/ffs/ffs_inode.c Fri Oct 10 21:18:12 2008 (r183753) +++ head/sys/ufs/ffs/ffs_inode.c Fri Oct 10 21:23:50 2008 (r183754) @@ -204,7 +204,7 @@ ffs_truncate(vp, length, flags, cred, td #ifdef QUOTA (void) chkdq(ip, -extblocks, NOCRED, 0); #endif - vinvalbuf(vp, V_ALT, td, 0, 0); + vinvalbuf(vp, V_ALT, 0, 0); ip->i_din2->di_extsize = 0; for (i = 0; i < NXADDR; i++) { oldblks[i] = ip->i_din2->di_extb[i]; @@ -280,7 +280,7 @@ ffs_truncate(vp, length, flags, cred, td softdep_setup_freeblocks(ip, length, needextclean ? IO_EXT | IO_NORMAL : IO_NORMAL); ASSERT_VOP_LOCKED(vp, "ffs_truncate1"); - vinvalbuf(vp, needextclean ? 0 : V_NORMAL, td, 0, 0); + vinvalbuf(vp, needextclean ? 0 : V_NORMAL, 0, 0); vnode_pager_setsize(vp, 0); ip->i_flag |= IN_CHANGE | IN_UPDATE; return (ffs_update(vp, 0)); Modified: head/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vfsops.c Fri Oct 10 21:18:12 2008 (r183753) +++ head/sys/ufs/ffs/ffs_vfsops.c Fri Oct 10 21:23:50 2008 (r183754) @@ -483,7 +483,7 @@ ffs_reload(struct mount *mp, struct thre */ devvp = VFSTOUFS(mp)->um_devvp; vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY); - if (vinvalbuf(devvp, 0, td, 0, 0) != 0) + if (vinvalbuf(devvp, 0, 0, 0) != 0) panic("ffs_reload: dirty1"); VOP_UNLOCK(devvp, 0); @@ -570,7 +570,7 @@ loop: MNT_VNODE_FOREACH_ABORT(mp, mvp); goto loop; } - if (vinvalbuf(vp, 0, td, 0, 0)) + if (vinvalbuf(vp, 0, 0, 0)) panic("ffs_reload: dirty2"); /* * Step 5: re-read inode data for all active vnodes. @@ -907,7 +907,7 @@ out: if (cp != NULL) { DROP_GIANT(); g_topology_lock(); - g_vfs_close(cp, td); + g_vfs_close(cp); g_topology_unlock(); PICKUP_GIANT(); } @@ -1098,7 +1098,7 @@ ffs_unmount(mp, mntflags, td) } DROP_GIANT(); g_topology_lock(); - g_vfs_close(ump->um_cp, td); + g_vfs_close(ump->um_cp); g_topology_unlock(); PICKUP_GIANT(); vrele(ump->um_devvp); Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Fri Oct 10 21:18:12 2008 (r183753) +++ head/sys/vm/vm_object.c Fri Oct 10 21:23:50 2008 (r183754) @@ -654,7 +654,7 @@ vm_object_terminate(vm_object_t object) vm_object_page_clean(object, 0, 0, OBJPC_SYNC); VM_OBJECT_UNLOCK(object); - vinvalbuf(vp, V_SAVE, NULL, 0, 0); + vinvalbuf(vp, V_SAVE, 0, 0); VM_OBJECT_LOCK(object); } From owner-svn-src-head@FreeBSD.ORG Fri Oct 10 22:40:05 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD282106568F; Fri, 10 Oct 2008 22:40:05 +0000 (UTC) (envelope-from bushman@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CEA358FC12; Fri, 10 Oct 2008 22:40:05 +0000 (UTC) (envelope-from bushman@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9AMe5Tx002760; Fri, 10 Oct 2008 22:40:05 GMT (envelope-from bushman@svn.freebsd.org) Received: (from bushman@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9AMe5b1002759; Fri, 10 Oct 2008 22:40:05 GMT (envelope-from bushman@svn.freebsd.org) Message-Id: <200810102240.m9AMe5b1002759@svn.freebsd.org> From: Michael Bushkov Date: Fri, 10 Oct 2008 22:40: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: r183755 - head/usr.sbin/nscd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 10 Oct 2008 22:40:06 -0000 Author: bushman Date: Fri Oct 10 22:40:05 2008 New Revision: 183755 URL: http://svn.freebsd.org/changeset/base/183755 Log: Removing startup banner. Modified: head/usr.sbin/nscd/nscd.c Modified: head/usr.sbin/nscd/nscd.c ============================================================================== --- head/usr.sbin/nscd/nscd.c Fri Oct 10 21:23:50 2008 (r183754) +++ head/usr.sbin/nscd/nscd.c Fri Oct 10 22:40:05 2008 (r183755) @@ -77,7 +77,6 @@ static void destroy_cache_(cache); static void destroy_runtime_env(struct runtime_env *); static cache init_cache_(struct configuration *); static struct runtime_env *init_runtime_env(struct configuration *); -static void print_version_info(void); static void processing_loop(cache, struct runtime_env *, struct configuration *); static void process_socket_event(struct kevent *, struct runtime_env *, @@ -90,14 +89,6 @@ static void usage(void); void get_time_func(struct timeval *); static void -print_version_info(void) -{ - TRACE_IN(print_version_info); - printf("nscd v0.2 (20 Oct 2005)\nwas developed during SoC 2005\n"); - TRACE_OUT(print_version_info); -} - -static void usage(void) { fprintf(stderr, @@ -622,9 +613,6 @@ main(int argc, char *argv[]) /* by default all debug messages are omitted */ TRACE_OFF(); - /* startup output */ - print_version_info(); - /* parsing command line arguments */ trace_mode_enabled = 0; force_single_threaded = 0; From owner-svn-src-head@FreeBSD.ORG Sat Oct 11 02:26:05 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E796106568A; Sat, 11 Oct 2008 02:26:05 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from out3.smtp.messagingengine.com (out3.smtp.messagingengine.com [66.111.4.27]) by mx1.freebsd.org (Postfix) with ESMTP id 5EAFE8FC0A; Sat, 11 Oct 2008 02:26:05 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from compute2.internal (compute2.internal [10.202.2.42]) by out1.messagingengine.com (Postfix) with ESMTP id 4E2FA177E86; Fri, 10 Oct 2008 22:09:00 -0400 (EDT) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute2.internal (MEProxy); Fri, 10 Oct 2008 22:09:00 -0400 X-Sasl-enc: R//q+58LvKtzFVPDrlPFb6IFXSKzLGGEBViiRimLOxzI 1223690939 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 7DB8111DA1; Fri, 10 Oct 2008 22:08:59 -0400 (EDT) Message-ID: <48F00ABA.2020300@FreeBSD.org> Date: Sat, 11 Oct 2008 03:08:58 +0100 From: "Bruce M. Simpson" User-Agent: Thunderbird 2.0.0.14 (X11/20080514) MIME-Version: 1.0 To: Nick Hibma References: <200810092125.m99LP1fJ071973@svn.freebsd.org> In-Reply-To: <200810092125.m99LP1fJ071973@svn.freebsd.org> 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 Subject: Re: svn commit: r183735 - in head: share/man/man4 sys/conf sys/dev/usb sys/i386/conf sys/modules sys/modules/u3g X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 11 Oct 2008 02:26:05 -0000 Nick Hibma wrote: > Log: > Say hello to the u3g driver, implementing support for 3G modems. > Thank you very, very much for doing this! I had stuff like this (add the multiple ports) on my list of "things to do" for ubsa, as obviously it isn't possible to cleanly shut down a connection without detaching the driver, which can be unreliable and unstable. Is it going to be possible to MFC this driver to 7.x? cheers BMS From owner-svn-src-head@FreeBSD.ORG Sat Oct 11 10:47:21 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 653CB1065689; Sat, 11 Oct 2008 10:47:19 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 54D668FC17; Sat, 11 Oct 2008 10:47:19 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9BAlJGN016405; Sat, 11 Oct 2008 10:47:19 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9BAlJ8Q016403; Sat, 11 Oct 2008 10:47:19 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200810111047.m9BAlJ8Q016403@svn.freebsd.org> From: Rui Paulo Date: Sat, 11 Oct 2008 10:47: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: r183761 - 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: Sat, 11 Oct 2008 10:47:21 -0000 Author: rpaulo Date: Sat Oct 11 10:47:18 2008 New Revision: 183761 URL: http://svn.freebsd.org/changeset/base/183761 Log: Move Qualcomm ZTE CDMA from ubsa(4) to u3g(4). Reviewed by: n_hibma Modified: head/sys/dev/usb/u3g.c head/sys/dev/usb/ubsa.c Modified: head/sys/dev/usb/u3g.c ============================================================================== --- head/sys/dev/usb/u3g.c Sat Oct 11 02:01:51 2008 (r183760) +++ head/sys/dev/usb/u3g.c Sat Oct 11 10:47:18 2008 (r183761) @@ -89,6 +89,8 @@ static const struct usb_devno u3g_devs[] /* OEM: Huawei */ { USB_VENDOR_HUAWEI, USB_PRODUCT_HUAWEI_MOBILE }, { USB_VENDOR_HUAWEI, USB_PRODUCT_HUAWEI_E220 }, + /* OEM: Qualcomm */ + { USB_VENDOR_QUALCOMMINC, USB_PRODUCT_QUALCOMMINC_CDMA_MSM }, { 0, 0 } }; Modified: head/sys/dev/usb/ubsa.c ============================================================================== --- head/sys/dev/usb/ubsa.c Sat Oct 11 02:01:51 2008 (r183760) +++ head/sys/dev/usb/ubsa.c Sat Oct 11 10:47:18 2008 (r183761) @@ -228,8 +228,6 @@ static const struct ubsa_product { { USB_VENDOR_PERACOM, USB_PRODUCT_PERACOM_SERIAL1 }, /* Merlin */ { USB_VENDOR_MERLIN, USB_PRODUCT_MERLIN_V620 }, - /* Qualcomm, Inc. ZTE CDMA */ - { USB_VENDOR_QUALCOMMINC, USB_PRODUCT_QUALCOMMINC_CDMA_MSM }, /* Novatel */ { USB_VENDOR_NOVATEL, USB_PRODUCT_NOVATEL_CDMA_MODEM }, /* Novatel Wireless Merlin ES620 */ From owner-svn-src-head@FreeBSD.ORG Sat Oct 11 12:10:23 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E6A91106568C; Sat, 11 Oct 2008 12:10: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 D6A6C8FC14; Sat, 11 Oct 2008 12:10: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 m9BCANoB017812; Sat, 11 Oct 2008 12:10:23 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9BCANYP017811; Sat, 11 Oct 2008 12:10:23 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200810111210.m9BCANYP017811@svn.freebsd.org> From: Marius Strobl Date: Sat, 11 Oct 2008 12:10: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: r183762 - head/sys/sparc64/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: Sat, 11 Oct 2008 12:10:24 -0000 Author: marius Date: Sat Oct 11 12:10:23 2008 New Revision: 183762 URL: http://svn.freebsd.org/changeset/base/183762 Log: Enable mpt(4) as some later models have on-board Fusion-MPT controllers and it seems to work just fine with at least an add-on SAS3080X. While at it, remove the commented out ncr(4) as it doesn't even use bus_dma(9), which isn't worth fixing though as sym(4) already supports a superset of the controllers driven by ncr(4). Modified: head/sys/sparc64/conf/GENERIC Modified: head/sys/sparc64/conf/GENERIC ============================================================================== --- head/sys/sparc64/conf/GENERIC Sat Oct 11 10:47:18 2008 (r183761) +++ head/sys/sparc64/conf/GENERIC Sat Oct 11 12:10:23 2008 (r183762) @@ -106,9 +106,8 @@ options AHC_REG_PRETTY_PRINT # Print re # output. Adds ~128k to driver. device isp # Qlogic family device ispfw # Firmware module for Qlogic host adapters -#device mpt # LSI-Logic MPT-Fusion -#device ncr # NCR/Symbios Logic -device sym # NCR/Symbios Logic (newer chipsets + those of `ncr') +device mpt # LSI-Logic MPT-Fusion +device sym # NCR/Symbios/LSI Logic 53C8XX/53C1010/53C1510D device esp # NCR53c9x (FEPS/FAS366) # SCSI peripherals From owner-svn-src-head@FreeBSD.ORG Sat Oct 11 13:05:13 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F0FD8106569E; Sat, 11 Oct 2008 13:05:13 +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 E0FC18FC13; Sat, 11 Oct 2008 13:05:13 +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 m9BD5DxE018781; Sat, 11 Oct 2008 13:05:13 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9BD5DZs018778; Sat, 11 Oct 2008 13:05:13 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200810111305.m9BD5DZs018778@svn.freebsd.org> From: Alexander Motin Date: Sat, 11 Oct 2008 13:05: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: r183763 - head/sys/dev/mmc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 11 Oct 2008 13:05:14 -0000 Author: mav Date: Sat Oct 11 13:05:13 2008 New Revision: 183763 URL: http://svn.freebsd.org/changeset/base/183763 Log: Give mmcsd driver a bit more information about card. It allows to reorganize log message in a way a bit more common for disk devices. Also it will allow mmcsd driver to use MMC/SD specific commands when needed. Modified: head/sys/dev/mmc/mmc.c head/sys/dev/mmc/mmcsd.c head/sys/dev/mmc/mmcvar.h Modified: head/sys/dev/mmc/mmc.c ============================================================================== --- head/sys/dev/mmc/mmc.c Sat Oct 11 12:10:23 2008 (r183762) +++ head/sys/dev/mmc/mmc.c Sat Oct 11 13:05:13 2008 (r183763) @@ -115,6 +115,7 @@ static int mmc_detach(device_t dev); #define MMC_ASSERT_LOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_OWNED); #define MMC_ASSERT_UNLOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_NOTOWNED); +static int mmc_calculate_clock(struct mmc_softc *sc); static void mmc_delayed_attach(void *); static void mmc_power_down(struct mmc_softc *sc); static int mmc_wait_for_cmd(struct mmc_softc *sc, struct mmc_command *cmd, @@ -122,7 +123,7 @@ static int mmc_wait_for_cmd(struct mmc_s static int mmc_wait_for_command(struct mmc_softc *sc, uint32_t opcode, uint32_t arg, uint32_t flags, uint32_t *resp, int retries); static int mmc_select_card(struct mmc_softc *sc, uint16_t rca); -static int mmc_set_bus_width(struct mmc_softc *sc, uint16_t rca, int width); +static int mmc_set_card_bus_width(struct mmc_softc *sc, uint16_t rca, int width); static int mmc_app_send_scr(struct mmc_softc *sc, uint16_t rca, uint32_t *rawscr); static void mmc_app_decode_scr(uint32_t *raw_scr, struct mmc_scr *scr); static int mmc_send_ext_csd(struct mmc_softc *sc, uint8_t *rawextcsd); @@ -215,11 +216,13 @@ mmc_acquire_bus(device_t busdev, device_ sc->last_rca = rca; /* Prepare bus width for the new card. */ ivar = device_get_ivars(dev); - device_printf(busdev, - "setting bus width to %d bits\n", - (ivar->bus_width == bus_width_4)?4: - (ivar->bus_width == bus_width_8)?8:1); - mmc_set_bus_width(sc, rca, ivar->bus_width); + if (bootverbose) { + device_printf(busdev, + "setting bus width to %d bits\n", + (ivar->bus_width == bus_width_4)?4: + (ivar->bus_width == bus_width_8)?8:1); + } + mmc_set_card_bus_width(sc, rca, ivar->bus_width); mmcbr_set_bus_width(busdev, ivar->bus_width); mmcbr_update_ios(busdev); } @@ -571,7 +574,7 @@ mmc_sd_switch(struct mmc_softc *sc, uint } static int -mmc_set_bus_width(struct mmc_softc *sc, uint16_t rca, int width) +mmc_set_card_bus_width(struct mmc_softc *sc, uint16_t rca, int width) { int err; @@ -1167,6 +1170,7 @@ mmc_go_discovery(struct mmc_softc *sc) mmcbr_set_bus_mode(dev, pushpull); mmcbr_update_ios(dev); + mmc_calculate_clock(sc); bus_generic_attach(dev); /* mmc_update_children_sysctl(dev);*/ } @@ -1208,9 +1212,11 @@ mmc_calculate_clock(struct mmc_softc *sc free(kids, M_TEMP); if (max_timing == bus_timing_hs) max_dtr = max_hs_dtr; - device_printf(sc->dev, "setting transfer rate to %d.%03dMHz%s\n", - max_dtr / 1000000, (max_dtr / 1000) % 1000, - (max_timing == bus_timing_hs)?" with high speed timing":""); + if (bootverbose) { + device_printf(sc->dev, "setting transfer rate to %d.%03dMHz%s\n", + max_dtr / 1000000, (max_dtr / 1000) % 1000, + (max_timing == bus_timing_hs)?" with high speed timing":""); + } mmcbr_set_timing(sc->dev, max_timing); mmcbr_set_clock(sc->dev, max_dtr); mmcbr_update_ios(sc->dev); @@ -1228,7 +1234,6 @@ mmc_scan(struct mmc_softc *sc) if (mmcbr_get_power_mode(dev) == power_on) mmc_rescan_cards(sc); mmc_go_discovery(sc); - mmc_calculate_clock(sc); mmc_release_bus(dev, dev); /* XXX probe/attach/detach children? */ @@ -1255,7 +1260,7 @@ mmc_read_ivar(device_t bus, device_t chi *(int *)result = MMC_SECTOR_SIZE; break; case MMC_IVAR_TRAN_SPEED: - *(int *)result = ivar->csd.tran_speed; + *(int *)result = mmcbr_get_clock(bus); break; case MMC_IVAR_READ_ONLY: *(int *)result = ivar->read_only; @@ -1263,6 +1268,12 @@ mmc_read_ivar(device_t bus, device_t chi case MMC_IVAR_HIGH_CAP: *(int *)result = ivar->high_cap; break; + case MMC_IVAR_CARD_TYPE: + *(int *)result = ivar->mode; + break; + case MMC_IVAR_BUS_WIDTH: + *(int *)result = ivar->bus_width; + break; } return (0); } Modified: head/sys/dev/mmc/mmcsd.c ============================================================================== --- head/sys/dev/mmc/mmcsd.c Sat Oct 11 12:10:23 2008 (r183762) +++ head/sys/dev/mmc/mmcsd.c Sat Oct 11 13:05:13 2008 (r183763) @@ -133,10 +133,15 @@ mmcsd_attach(device_t dev) mmc_get_sector_size(dev); sc->disk->d_unit = device_get_unit(dev); - device_printf(dev, "%juMB %s at %s\n", + device_printf(dev, "%juMB <%s Memory Card>%s at %s %dMHz/%dbit\n", sc->disk->d_mediasize / 1048576, + (mmc_get_card_type(dev) == mode_mmc)?"MMC": + (mmc_get_high_cap(dev)?"SDHC":"SD"), mmc_get_read_only(dev)?" (read-only)":"", - device_get_nameunit(device_get_parent(sc->dev))); + device_get_nameunit(device_get_parent(sc->dev)), + mmc_get_tran_speed(dev)/1000000, + (mmc_get_bus_width(dev) == bus_width_1)?1: + ((mmc_get_bus_width(dev) == bus_width_4)?4:8)); disk_create(sc->disk, DISK_VERSION); bioq_init(&sc->bio_queue); Modified: head/sys/dev/mmc/mmcvar.h ============================================================================== --- head/sys/dev/mmc/mmcvar.h Sat Oct 11 12:10:23 2008 (r183762) +++ head/sys/dev/mmc/mmcvar.h Sat Oct 11 13:05:13 2008 (r183763) @@ -55,6 +55,8 @@ #ifndef DEV_MMC_MMCVAR_H #define DEV_MMC_MMCVAR_H +#include + enum mmc_device_ivars { MMC_IVAR_DSR_IMP, MMC_IVAR_MEDIA_SIZE, @@ -63,6 +65,8 @@ enum mmc_device_ivars { MMC_IVAR_TRAN_SPEED, MMC_IVAR_READ_ONLY, MMC_IVAR_HIGH_CAP, + MMC_IVAR_CARD_TYPE, + MMC_IVAR_BUS_WIDTH, // MMC_IVAR_, }; @@ -79,5 +83,7 @@ MMC_ACCESSOR(sector_size, SECTOR_SIZE, i MMC_ACCESSOR(tran_speed, TRAN_SPEED, int) MMC_ACCESSOR(read_only, READ_ONLY, int) MMC_ACCESSOR(high_cap, HIGH_CAP, int) +MMC_ACCESSOR(card_type, CARD_TYPE, int) +MMC_ACCESSOR(bus_width, BUS_WIDTH, int) #endif /* DEV_MMC_MMCVAR_H */ From owner-svn-src-head@FreeBSD.ORG Sat Oct 11 17:28:23 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 540D8106568C; Sat, 11 Oct 2008 17:28:23 +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 470FD8FC0A; Sat, 11 Oct 2008 17:28:23 +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 m9BHSN5f023107; Sat, 11 Oct 2008 17:28:23 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9BHSNCo023106; Sat, 11 Oct 2008 17:28:23 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200810111728.m9BHSNCo023106@svn.freebsd.org> From: Robert Watson Date: Sat, 11 Oct 2008 17:28: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: r183764 - 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, 11 Oct 2008 17:28:23 -0000 Author: rwatson Date: Sat Oct 11 17:28:22 2008 New Revision: 183764 URL: http://svn.freebsd.org/changeset/base/183764 Log: Remove stale comment: while uipc_connect2() was, until recently, not static so it could be used by fifofs (actually portalfs), it is now static. Submitted by: kensmith Modified: head/sys/kern/uipc_usrreq.c Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Sat Oct 11 13:05:13 2008 (r183763) +++ head/sys/kern/uipc_usrreq.c Sat Oct 11 17:28:22 2008 (r183764) @@ -529,9 +529,6 @@ uipc_close(struct socket *so) UNP_GLOBAL_WUNLOCK(); } -/* - * uipc_connect2() is not static as it is invoked directly by fifofs. - */ static int uipc_connect2(struct socket *so1, struct socket *so2) { From owner-svn-src-head@FreeBSD.ORG Sat Oct 11 17:30:02 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C7A0A1065698; Sat, 11 Oct 2008 17:30:02 +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 BAC2E8FC16; Sat, 11 Oct 2008 17:30:02 +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 m9BHU2rr023175; Sat, 11 Oct 2008 17:30:02 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9BHU2u1023174; Sat, 11 Oct 2008 17:30:02 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200810111730.m9BHU2u1023174@svn.freebsd.org> From: Alexander Motin Date: Sat, 11 Oct 2008 17:30: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: r183765 - head/sys/dev/mmc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 11 Oct 2008 17:30:02 -0000 Author: mav Date: Sat Oct 11 17:30:02 2008 New Revision: 183765 URL: http://svn.freebsd.org/changeset/base/183765 Log: SELECT_CARD command with zero RCA deselects all cards and so has no reply. Modified: head/sys/dev/mmc/mmc.c Modified: head/sys/dev/mmc/mmc.c ============================================================================== --- head/sys/dev/mmc/mmc.c Sat Oct 11 17:28:22 2008 (r183764) +++ head/sys/dev/mmc/mmc.c Sat Oct 11 17:30:02 2008 (r183765) @@ -526,7 +526,7 @@ static int mmc_select_card(struct mmc_softc *sc, uint16_t rca) { return (mmc_wait_for_command(sc, MMC_SELECT_CARD, ((uint32_t)rca) << 16, - MMC_RSP_R1B | MMC_CMD_AC, NULL, CMD_RETRIES)); + (rca?MMC_RSP_R1B:MMC_RSP_NONE) | MMC_CMD_AC, NULL, CMD_RETRIES)); } static int