From owner-svn-src-all@FreeBSD.ORG Sun Jan 16 03:06:19 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 424B7106564A; Sun, 16 Jan 2011 03:06:19 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail07.syd.optusnet.com.au (mail07.syd.optusnet.com.au [211.29.132.188]) by mx1.freebsd.org (Postfix) with ESMTP id BDEAA8FC14; Sun, 16 Jan 2011 03:06:18 +0000 (UTC) Received: from c122-106-165-206.carlnfd1.nsw.optusnet.com.au (c122-106-165-206.carlnfd1.nsw.optusnet.com.au [122.106.165.206]) by mail07.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p0G36FTe016036 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 16 Jan 2011 14:06:16 +1100 Date: Sun, 16 Jan 2011 14:06:15 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: mdf@freebsd.org In-Reply-To: Message-ID: <20110116132842.W10642@besplex.bde.org> References: <201101131820.p0DIKXip059402@svn.freebsd.org> <20110114174719.D28159@besplex.bde.org> <20110115133929.D16210@besplex.bde.org> <20110115170529.T16715@besplex.bde.org> <20110116013102.E21684@besplex.bde.org> MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-546112963-1295147175=:10642" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce Evans , Garrett Cooper Subject: Re: svn commit: r217369 - in head/sys: cam/scsi sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Jan 2011 03:06:19 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --0-546112963-1295147175=:10642 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE On Sat, 15 Jan 2011 mdf@freebsd.org wrote: > On Sat, Jan 15, 2011 at 6:55 AM, Bruce Evans wrote= : >> SYSCTL_I() works even better that I first thought. =A0It automatically >> gives support for all typedefed integral types. =A0No SYSCTL_FOO_T()s >> ... Grrr, my sentence breaks of 2 spaces are being echoed as 1 space and 1 hard \xa0. > The printing is done entirely in user-space, so it's not too bad. I > had figured to upcast everything to [u]intmax_t anyways, and what to > cast from would just be [u]int32_t and [u]int64_t depending on > reported size. Anything smaller should be copyout(9)'d as a 4 bit > quantity. I think it shouldn't be converted in the kernel. Applications using sysctl already have to deal with fields shorter than int in structs returned by sysctl(). They don't need to deal with integers shorter than int only since sysctl() doesn't support such integers yet. Short integers could still be returned as essentially themselves by packing them into a struct with nothing else. > But, there's two factors at play here. The first is sysctl(8) which > asks for the size when reading and manages it. The second is > sysctl(2) where we have code like SCTL_MASK32 so a long on a 64-bit > kernel looks like a long to a 32-bit app. It would be simpler to > expose this as an 8-byte quantity on 64-bit kernel, and sysctl(8) will > deal with this just fine, but that would break some uses of sysctl(2). What are the uses? I guess they are not-so-hard-coding data types as int and long, etc., and hard-coding them as int32_t and int64_t. Then you get an error when the kernel returns an unexpected length, but unexpected lengths are expected for 32-bit apps on 64-bit kernels. BTW, short writes are still horribly broken. Suppose there is a size mismatch causing an application tries to write 32 bits to a 64-bit kernel variable. Then no error is detected, and the kernel variable ois left with garbage in its top bits. The error detection last worked with 4.4BSD sysctl, and is still documented to work: % [EINVAL] A non-null newp is given and its specified length= in % newlen is too large or too small. I think the case where newlen is too large still works. I guess the bug is potentially larger for 32 bit compat applications, but it is rarely seen for those too since only system management applications should be writing to kernel variables and there is no reason to run such applications in 32 bit mode. The bug affects mainly cases where there is a kernel type mismatch, like using sysctl_handle_int() on a 64-bit variable. I forget how short reads were not detected as errors. It still takes the size in the sysctl data to be for 64 bits for this error to be detectable for either read or write. But your recent changes should fix all such type mismatches. > However, I *think* it is safe to check the sysctl_req's oldidx/oldlen > to see what size the user-space expects and cast a kernel long to int > before SYSCTL_OUT. Maybe if the value fits. The application might be probing for a size that works. Then it shouldn't care what size the value is returned in, provided the value fits. Writing is only slightly more delicate. The application must use a size in which the value fits. Then the kernel can expand the size if necessary. It just has to be careful to fill the top bits and not have sign extension bugs. sysctl_handle_i() can probably handle both directions. Lower-level sysctl code should still return an error if there is a size mismatch. If a value doesn't fit, then the application will just have to detect the error and try a larger size (or fail if it doesn't support larger size). An example might be a 32-bit app reading 64-bit kernel pointers. These probably have the high bits set, so they won't fit in 32-bit sizes. But the application can easily read them using 64-bit sizes. Integers and pointers larger than 64 bits would be more interesting, since a compat application might not have any integer data type larger enough to represent them. So I changed my mind about converting in the kernel. Just try to convert to whatever size the application is trying to use. Don't even force >=3D 3= 2 bit sizes on applications. > $WORK has gotten busy so I haven't had a chance to work on this much > but I'm hopeful that the missus will watch the kids this weekend and > allow me to hack. You seem to have found time :-). Bruce --0-546112963-1295147175=:10642-- From owner-svn-src-all@FreeBSD.ORG Sun Jan 16 04:14:56 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 81BBF106566B; Sun, 16 Jan 2011 04:14:56 +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 704A28FC0C; Sun, 16 Jan 2011 04:14:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0G4EuVD048414; Sun, 16 Jan 2011 04:14:56 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0G4EuRD048410; Sun, 16 Jan 2011 04:14:56 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201101160414.p0G4EuRD048410@svn.freebsd.org> From: Marius Strobl Date: Sun, 16 Jan 2011 04:14: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: r217468 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Jan 2011 04:14:56 -0000 Author: marius Date: Sun Jan 16 04:14:56 2011 New Revision: 217468 URL: http://svn.freebsd.org/changeset/base/217468 Log: Reference rgephy.4 in man pages of additional MAC drivers also known to come in combination with these PHYs. Submitted by: yongari MFC after: 3 days Modified: head/share/man/man4/axe.4 head/share/man/man4/nve.4 head/share/man/man4/sge.4 Modified: head/share/man/man4/axe.4 ============================================================================== --- head/share/man/man4/axe.4 Sun Jan 16 00:45:06 2011 (r217467) +++ head/share/man/man4/axe.4 Sun Jan 16 04:14:56 2011 (r217468) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 20, 2008 +.Dd January 16, 2011 .Dt AXE 4 .Os .Sh NAME @@ -206,6 +206,7 @@ The driver failed to allocate an mbuf fo .Xr miibus 4 , .Xr netintro 4 , .Xr ng_ether 4 , +.Xr rgephy 4 , .Xr ifconfig 8 .Rs .%T "ASIX AX88172 AX88178 and AX88772 data sheets" Modified: head/share/man/man4/nve.4 ============================================================================== --- head/share/man/man4/nve.4 Sun Jan 16 00:45:06 2011 (r217467) +++ head/share/man/man4/nve.4 Sun Jan 16 04:14:56 2011 (r217468) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 8, 2007 +.Dd January 16, 2011 .Dt NVE 4 .Os .Sh NAME @@ -120,6 +120,7 @@ the network connection (cable). .Xr miibus 4 , .Xr netintro 4 , .Xr ng_ether 4 , +.Xr rgephy 4 , .Xr ifconfig 8 .Sh HISTORY The Modified: head/share/man/man4/sge.4 ============================================================================== --- head/share/man/man4/sge.4 Sun Jan 16 00:45:06 2011 (r217467) +++ head/share/man/man4/sge.4 Sun Jan 16 04:14:56 2011 (r217468) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 10, 2010 +.Dd January 16, 2011 .Dt SGE 4 .Os .Sh NAME @@ -105,6 +105,7 @@ SiS191 Fast/Gigabit Ethernet controller .Xr miibus 4 , .Xr netintro 4 , .Xr ng_ether 4 , +.Xr rgephy 4 , .Xr vlan 4 , .Xr ifconfig 8 .Sh HISTORY From owner-svn-src-all@FreeBSD.ORG Sun Jan 16 05:34:03 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F0E82106566B; Sun, 16 Jan 2011 05:34:03 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id 848E38FC12; Sun, 16 Jan 2011 05:34:03 +0000 (UTC) Received: by iyb26 with SMTP id 26so3806490iyb.13 for ; Sat, 15 Jan 2011 21:34:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=ilktLi3nUP4i77h4pctCkZiZqxCA90zG8fOk1NHzf0k=; b=htYJRD0ytv/0xoh6X6kckjoRxaiqPwfartwIkv1K90AsRHPNzzFkgrm5iiFsPZV2+J Vn/EFKfx5PLyQ+o4RVs8YpFsamb6h3zeJzZqs6s3m7cS89SxcKudh9ZyURczRT1MdloA EwKcw6xYFeC5fItumz+YwJ3jZ8KjTlhhkEJsw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=UK6XEBF4bI/WQB+0t6Uhg+BCiIXCjLaJe/mw/GdUlv2TjrhnZOkyhXu0g9aRgwWUAh oTrFTripS60ACarxrQPCMhmTHeCY3qiFVBV9Jr9HvUDfD4xWpFtGI2iTy3pZiImHl2EK 5buDD15VddK1Il1xEoNWMNx9P9ERBDiAC8SdM= MIME-Version: 1.0 Received: by 10.231.171.197 with SMTP id i5mr2651662ibz.54.1295156042774; Sat, 15 Jan 2011 21:34:02 -0800 (PST) Sender: mdf356@gmail.com Received: by 10.231.160.147 with HTTP; Sat, 15 Jan 2011 21:34:02 -0800 (PST) In-Reply-To: <20110116132842.W10642@besplex.bde.org> References: <201101131820.p0DIKXip059402@svn.freebsd.org> <20110114174719.D28159@besplex.bde.org> <20110115133929.D16210@besplex.bde.org> <20110115170529.T16715@besplex.bde.org> <20110116013102.E21684@besplex.bde.org> <20110116132842.W10642@besplex.bde.org> Date: Sat, 15 Jan 2011 21:34:02 -0800 X-Google-Sender-Auth: aT8_YsBo6Qa6RNyiJ9AjZiAvgAo Message-ID: From: mdf@FreeBSD.org To: Bruce Evans Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Garrett Cooper Subject: Re: svn commit: r217369 - in head/sys: cam/scsi sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Jan 2011 05:34:04 -0000 On Sat, Jan 15, 2011 at 7:06 PM, Bruce Evans wrote: > On Sat, 15 Jan 2011 mdf@freebsd.org wrote: >> On Sat, Jan 15, 2011 at 6:55 AM, Bruce Evans wrot= e: > >> The printing is done entirely in user-space, so it's not too bad. =A0I >> had figured to upcast everything to [u]intmax_t anyways, and what to >> cast from would just be [u]int32_t and [u]int64_t depending on >> reported size. =A0Anything smaller should be copyout(9)'d as a 4 bit >> quantity. > > I think it shouldn't be converted in the kernel. =A0Applications using > sysctl already have to deal with fields shorter than int in structs > returned by sysctl(). =A0They don't need to deal with integers shorter > than int only since sysctl() doesn't support such integers yet. =A0Short > integers could still be returned as essentially themselves by packing > them into a struct with nothing else. > >> But, there's two factors at play here. =A0The first is sysctl(8) which >> asks for the size when reading and manages it. =A0The second is >> sysctl(2) where we have code like SCTL_MASK32 so a long on a 64-bit >> kernel looks like a long to a 32-bit app. =A0It would be simpler to >> expose this as an 8-byte quantity on 64-bit kernel, and sysctl(8) will >> deal with this just fine, but that would break some uses of sysctl(2). > > What are the uses? =A0I guess they are not-so-hard-coding data types as > int and long, etc., and hard-coding them as int32_t and int64_t. =A0Then > you get an error when the kernel returns an unexpected length, but > unexpected lengths are expected for 32-bit apps on 64-bit kernels. > > BTW, short writes are still horribly broken. =A0Suppose there is a size > mismatch causing an application tries to write 32 bits to a 64-bit > kernel variable. =A0Then no error is detected, and the kernel variable > ois left with garbage in its top bits. =A0The error detection last worked > with 4.4BSD sysctl, and is still documented to work: > > % =A0 =A0 =A0[EINVAL] =A0 =A0 =A0 =A0 =A0 A non-null newp is given and it= s specified length > in > % =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 newlen is too large or = too small. > > I think the case where newlen is too large still works. > > I guess the bug is potentially larger for 32 bit compat applications, > but it is rarely seen for those too since only system management > applications should be writing to kernel variables and there is no > reason to run such applications in 32 bit mode. At Isilon all of userland is still 32-bit only. The reason is that for a while we supported 32-bit and 64-bit kernels in the field, and in fact for various reasons on install the 32-bit kernel always came up first and a reboot after install was forced for 64-bit capable hardware. But we needed the same userspace to work on both kernels. >> However, I *think* it is safe to check the sysctl_req's oldidx/oldlen >> to see what size the user-space expects and cast a kernel long to int >> before SYSCTL_OUT. > > Maybe if the value fits. =A0The application might be probing for a size > that works. =A0Then it shouldn't care what size the value is returned in, > provided the value fits. =A0Writing is only slightly more delicate. =A0Th= e > application must use a size in which the value fits. =A0Then the kernel > can expand the size if necessary. =A0It just has to be careful to fill > the top bits and not have sign extension bugs. =A0sysctl_handle_i() can > probably handle both directions. =A0Lower-level sysctl code should still > return an error if there is a size mismatch. Probing for a size that works should be passing in NULL for the old ptr to get a hint, and for scalars the sie doesn't change. It would be a somewhat malformed app that probes for the size anywhere below e.g. 512 bytes or 1 page. > If a value doesn't fit, then the application will just have to detect > the error and try a larger size (or fail if it doesn't support larger > size). =A0An example might be a 32-bit app reading 64-bit kernel pointers= . > These probably have the high bits set, so they won't fit in 32-bit sizes. > But the application can easily read them using 64-bit sizes. =A0Integers > and pointers larger than 64 bits would be more interesting, since a > compat application might not have any integer data type larger enough > to represent them. > > So I changed my mind about converting in the kernel. =A0Just try to conve= rt > to whatever size the application is trying to use. =A0Don't even force >= =3D 32 > bit sizes on applications. The proposed code does attempt to convert to whatever the app uses, but it assumes the app is using at least a 32-bit quantity. :-) More on the other thread. Thanks, matthew From owner-svn-src-all@FreeBSD.ORG Sun Jan 16 10:02:47 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2E3EA106566B; Sun, 16 Jan 2011 10:02:47 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1CCBF8FC1C; Sun, 16 Jan 2011 10:02:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0GA2l58057243; Sun, 16 Jan 2011 10:02:47 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0GA2k3g057241; Sun, 16 Jan 2011 10:02:46 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201101161002.p0GA2k3g057241@svn.freebsd.org> From: Michael Tuexen Date: Sun, 16 Jan 2011 10:02:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217469 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Jan 2011 10:02:47 -0000 Author: tuexen Date: Sun Jan 16 10:02:46 2011 New Revision: 217469 URL: http://svn.freebsd.org/changeset/base/217469 Log: Add support for resource pooling to CMT. An original version of the patch was developed by Martin Becke and Thomas Dreibholz. MFC after: 3 months Modified: head/sys/netinet/sctp_cc_functions.c Modified: head/sys/netinet/sctp_cc_functions.c ============================================================================== --- head/sys/netinet/sctp_cc_functions.c Sun Jan 16 04:14:56 2011 (r217468) +++ head/sys/netinet/sctp_cc_functions.c Sun Jan 16 10:02:46 2011 (r217469) @@ -66,6 +66,13 @@ sctp_set_initial_cc_param(struct sctp_tc cwnd_in_mtu = assoc->max_burst; net->cwnd = (net->mtu - sizeof(struct sctphdr)) * cwnd_in_mtu; } + if (stcb->asoc.sctp_cmt_on_off == 2) { + /* In case of resource pooling initialize appropriately */ + net->cwnd /= assoc->numnets; + if (net->cwnd < (net->mtu - sizeof(struct sctphdr))) { + net->cwnd = net->mtu - sizeof(struct sctphdr); + } + } net->ssthresh = assoc->peers_rwnd; SDT_PROBE(sctp, cwnd, net, init, @@ -82,7 +89,17 @@ sctp_cwnd_update_after_fr(struct sctp_tc struct sctp_association *asoc) { struct sctp_nets *net; + uint32_t t_ssthresh, t_cwnd; + /* MT FIXME: Don't compute this over and over again */ + t_ssthresh = 0; + t_cwnd = 0; + if (asoc->sctp_cmt_on_off == 2) { + TAILQ_FOREACH(net, &asoc->nets, sctp_next) { + t_ssthresh += net->ssthresh; + t_cwnd += net->cwnd; + } + } /*- * CMT fast recovery code. Need to debug. ((sctp_cmt_on_off > 0) && * (net->fast_retran_loss_recovery == 0))) @@ -101,9 +118,23 @@ sctp_cwnd_update_after_fr(struct sctp_tc struct sctp_tmit_chunk *lchk; int old_cwnd = net->cwnd; - net->ssthresh = net->cwnd / 2; - if (net->ssthresh < (net->mtu * 2)) { - net->ssthresh = 2 * net->mtu; + if (asoc->sctp_cmt_on_off == 2) { + net->ssthresh = (uint32_t) (((uint64_t) 4 * + (uint64_t) net->mtu * + (uint64_t) net->ssthresh) / + (uint64_t) t_ssthresh); + if ((net->cwnd > t_cwnd / 2) && + (net->ssthresh < net->cwnd - t_cwnd / 2)) { + net->ssthresh = net->cwnd - t_cwnd / 2; + } + if (net->ssthresh < net->mtu) { + net->ssthresh = net->mtu; + } + } else { + net->ssthresh = net->cwnd / 2; + if (net->ssthresh < (net->mtu * 2)) { + net->ssthresh = 2 * net->mtu; + } } net->cwnd = net->ssthresh; SDT_PROBE(sctp, cwnd, net, fr, @@ -167,7 +198,17 @@ sctp_cwnd_update_after_sack(struct sctp_ { struct sctp_nets *net; int old_cwnd; + uint32_t t_ssthresh, t_cwnd, incr; + /* MT FIXME: Don't compute this over and over again */ + t_ssthresh = 0; + t_cwnd = 0; + if (stcb->asoc.sctp_cmt_on_off == 2) { + TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { + t_ssthresh += net->ssthresh; + t_cwnd += net->cwnd; + } + } /******************************/ /* update cwnd and Early FR */ /******************************/ @@ -178,11 +219,8 @@ sctp_cwnd_update_after_sack(struct sctp_ * CMT fast recovery code. Need to debug. */ if (net->fast_retran_loss_recovery && net->new_pseudo_cumack) { - if (compare_with_wrap(asoc->last_acked_seq, - net->fast_recovery_tsn, MAX_TSN) || - (asoc->last_acked_seq == net->fast_recovery_tsn) || - compare_with_wrap(net->pseudo_cumack, net->fast_recovery_tsn, MAX_TSN) || - (net->pseudo_cumack == net->fast_recovery_tsn)) { + if (SCTP_TSN_GE(asoc->last_acked_seq, net->fast_recovery_tsn) || + SCTP_TSN_GE(net->pseudo_cumack, net->fast_recovery_tsn)) { net->will_exit_fast_recovery = 1; } } @@ -304,32 +342,39 @@ sctp_cwnd_update_after_sack(struct sctp_ if (net->cwnd <= net->ssthresh) { /* We are in slow start */ if (net->flight_size + net->net_ack >= net->cwnd) { - if (net->net_ack > (net->mtu * SCTP_BASE_SYSCTL(sctp_L2_abc_variable))) { - old_cwnd = net->cwnd; - net->cwnd += (net->mtu * SCTP_BASE_SYSCTL(sctp_L2_abc_variable)); - SDT_PROBE(sctp, cwnd, net, ack, - stcb->asoc.my_vtag, - ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), - net, - old_cwnd, net->cwnd); - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { - sctp_log_cwnd(stcb, net, net->mtu, - SCTP_CWND_LOG_FROM_SS); + old_cwnd = net->cwnd; + if (stcb->asoc.sctp_cmt_on_off == 2) { + uint32_t limit; + + limit = (uint32_t) (((uint64_t) net->mtu * + (uint64_t) SCTP_BASE_SYSCTL(sctp_L2_abc_variable) * + (uint64_t) net->ssthresh) / + (uint64_t) t_ssthresh); + incr = (uint32_t) (((uint64_t) net->net_ack * + (uint64_t) net->ssthresh) / + (uint64_t) t_ssthresh); + if (incr > limit) { + incr = limit; + } + if (incr == 0) { + incr = 1; } } else { - old_cwnd = net->cwnd; - net->cwnd += net->net_ack; - SDT_PROBE(sctp, cwnd, net, ack, - stcb->asoc.my_vtag, - ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), - net, - old_cwnd, net->cwnd); - - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { - sctp_log_cwnd(stcb, net, net->net_ack, - SCTP_CWND_LOG_FROM_SS); + incr = net->net_ack; + if (incr > net->mtu * SCTP_BASE_SYSCTL(sctp_L2_abc_variable)) { + incr = net->mtu * SCTP_BASE_SYSCTL(sctp_L2_abc_variable); } } + net->cwnd += incr; + if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { + sctp_log_cwnd(stcb, net, incr, + SCTP_CWND_LOG_FROM_SS); + } + SDT_PROBE(sctp, cwnd, net, ack, + stcb->asoc.my_vtag, + ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), + net, + old_cwnd, net->cwnd); } else { if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_LOGGING_ENABLE) { sctp_log_cwnd(stcb, net, net->net_ack, @@ -338,6 +383,8 @@ sctp_cwnd_update_after_sack(struct sctp_ } } else { /* We are in congestion avoidance */ + uint32_t incr; + /* * Add to pba */ @@ -347,7 +394,17 @@ sctp_cwnd_update_after_sack(struct sctp_ (net->partial_bytes_acked >= net->cwnd)) { net->partial_bytes_acked -= net->cwnd; old_cwnd = net->cwnd; - net->cwnd += net->mtu; + if (asoc->sctp_cmt_on_off == 2) { + incr = (uint32_t) (((uint64_t) net->mtu * + (uint64_t) net->ssthresh) / + (uint64_t) t_ssthresh); + if (incr == 0) { + incr = 1; + } + } else { + incr = net->mtu; + } + net->cwnd += incr; SDT_PROBE(sctp, cwnd, net, ack, stcb->asoc.my_vtag, ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), @@ -394,8 +451,32 @@ void sctp_cwnd_update_after_timeout(struct sctp_tcb *stcb, struct sctp_nets *net) { int old_cwnd = net->cwnd; + uint32_t t_ssthresh, t_cwnd; - net->ssthresh = max(net->cwnd / 2, 4 * net->mtu); + /* MT FIXME: Don't compute this over and over again */ + t_ssthresh = 0; + t_cwnd = 0; + if (stcb->asoc.sctp_cmt_on_off == 2) { + struct sctp_nets *lnet; + + TAILQ_FOREACH(lnet, &stcb->asoc.nets, sctp_next) { + t_ssthresh += lnet->ssthresh; + t_cwnd += lnet->cwnd; + } + net->ssthresh = (uint32_t) (((uint64_t) 4 * + (uint64_t) net->mtu * + (uint64_t) net->ssthresh) / + (uint64_t) t_ssthresh); + if ((net->cwnd > t_cwnd / 2) && + (net->ssthresh < net->cwnd - t_cwnd / 2)) { + net->ssthresh = net->cwnd - t_cwnd / 2; + } + if (net->ssthresh < net->mtu) { + net->ssthresh = net->mtu; + } + } else { + net->ssthresh = max(net->cwnd / 2, 4 * net->mtu); + } net->cwnd = net->mtu; net->partial_bytes_acked = 0; SDT_PROBE(sctp, cwnd, net, to, @@ -844,11 +925,8 @@ sctp_hs_cwnd_update_after_sack(struct sc * CMT fast recovery code. Need to debug. */ if (net->fast_retran_loss_recovery && net->new_pseudo_cumack) { - if (compare_with_wrap(asoc->last_acked_seq, - net->fast_recovery_tsn, MAX_TSN) || - (asoc->last_acked_seq == net->fast_recovery_tsn) || - compare_with_wrap(net->pseudo_cumack, net->fast_recovery_tsn, MAX_TSN) || - (net->pseudo_cumack == net->fast_recovery_tsn)) { + if (SCTP_TSN_GE(asoc->last_acked_seq, net->fast_recovery_tsn) || + SCTP_TSN_GE(net->pseudo_cumack, net->fast_recovery_tsn)) { net->will_exit_fast_recovery = 1; } } @@ -1329,11 +1407,8 @@ sctp_htcp_cwnd_update_after_sack(struct * CMT fast recovery code. Need to debug. */ if (net->fast_retran_loss_recovery && net->new_pseudo_cumack) { - if (compare_with_wrap(asoc->last_acked_seq, - net->fast_recovery_tsn, MAX_TSN) || - (asoc->last_acked_seq == net->fast_recovery_tsn) || - compare_with_wrap(net->pseudo_cumack, net->fast_recovery_tsn, MAX_TSN) || - (net->pseudo_cumack == net->fast_recovery_tsn)) { + if (SCTP_TSN_GE(asoc->last_acked_seq, net->fast_recovery_tsn) || + SCTP_TSN_GE(net->pseudo_cumack, net->fast_recovery_tsn)) { net->will_exit_fast_recovery = 1; } } From owner-svn-src-all@FreeBSD.ORG Sun Jan 16 10:41:47 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C3B7106564A; Sun, 16 Jan 2011 10:41:47 +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 7ACFC8FC14; Sun, 16 Jan 2011 10:41:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0GAflLD060618; Sun, 16 Jan 2011 10:41:47 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0GAfl60060616; Sun, 16 Jan 2011 10:41:47 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201101161041.p0GAfl60060616@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 16 Jan 2011 10:41:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217470 - stable/8/lib/csu/i386-elf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Jan 2011 10:41:47 -0000 Author: kib Date: Sun Jan 16 10:41:47 2011 New Revision: 217470 URL: http://svn.freebsd.org/changeset/base/217470 Log: MFC r217383: The (%esp & 0xf) == 0 should be true before the call instruction is executed, for the properly aligned stack. Modified: stable/8/lib/csu/i386-elf/crt1_s.S Directory Properties: stable/8/lib/csu/ (props changed) Modified: stable/8/lib/csu/i386-elf/crt1_s.S ============================================================================== --- stable/8/lib/csu/i386-elf/crt1_s.S Sun Jan 16 10:02:46 2011 (r217469) +++ stable/8/lib/csu/i386-elf/crt1_s.S Sun Jan 16 10:41:47 2011 (r217470) @@ -40,6 +40,7 @@ _start: .cfi_def_cfa_register %ebp andl $0xfffffff0,%esp # align stack leal 8(%ebp),%eax + subl $4,%esp pushl %eax # argv pushl 4(%ebp) # argc pushl %edx # rtld cleanup From owner-svn-src-all@FreeBSD.ORG Sun Jan 16 10:47:36 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C3C11065672; Sun, 16 Jan 2011 10:47:36 +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 2AD2B8FC15; Sun, 16 Jan 2011 10:47:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0GAlaId060823; Sun, 16 Jan 2011 10:47:36 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0GAlatu060821; Sun, 16 Jan 2011 10:47:36 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201101161047.p0GAlatu060821@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 16 Jan 2011 10:47:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217471 - stable/7/lib/csu/i386-elf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Jan 2011 10:47:36 -0000 Author: kib Date: Sun Jan 16 10:47:35 2011 New Revision: 217471 URL: http://svn.freebsd.org/changeset/base/217471 Log: MFC r217383: The (%esp & 0xf) == 0 should be true before the call instruction is executed, for the properly aligned stack. Modified: stable/7/lib/csu/i386-elf/crt1_s.S Directory Properties: stable/7/lib/csu/ (props changed) Modified: stable/7/lib/csu/i386-elf/crt1_s.S ============================================================================== --- stable/7/lib/csu/i386-elf/crt1_s.S Sun Jan 16 10:41:47 2011 (r217470) +++ stable/7/lib/csu/i386-elf/crt1_s.S Sun Jan 16 10:47:35 2011 (r217471) @@ -35,6 +35,7 @@ _start: xorl %ebp,%ebp movl %esp,%ebp andl $0xfffffff0,%esp # align stack leal 8(%ebp),%eax + subl $4,%esp pushl %eax # argv pushl 4(%ebp) # argc pushl %edx # rtld cleanup From owner-svn-src-all@FreeBSD.ORG Sun Jan 16 13:56:41 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C3038106564A; Sun, 16 Jan 2011 13:56:41 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A7EA48FC0A; Sun, 16 Jan 2011 13:56:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0GDufDg065548; Sun, 16 Jan 2011 13:56:41 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0GDuf9O065545; Sun, 16 Jan 2011 13:56:41 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201101161356.p0GDuf9O065545@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 16 Jan 2011 13:56: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: r217472 - in head: bin/sh tools/regression/bin/sh/builtins X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Jan 2011 13:56:42 -0000 Author: jilles Date: Sun Jan 16 13:56:41 2011 New Revision: 217472 URL: http://svn.freebsd.org/changeset/base/217472 Log: sh: If exit is used without args from a trap action, exit on the signal. This is useful so that it is easier to exit on a signal than to reset the trap to default and resend the signal. It matches ksh93. POSIX says that 'exit' without args from a trap action uses the exit status from the last command before the trap, which is different from 'exit $?' and matches this if the previous command is assumed to have exited on the signal. If the signal is SIGSTOP, SIGTSTP, SIGTTIN or SIGTTOU, or if the default action for the signal is to ignore it, a normal _exit(2) is done with exit status 128+signal_number. Added: head/tools/regression/bin/sh/builtins/trap6.0 (contents, props changed) Modified: head/bin/sh/trap.c Modified: head/bin/sh/trap.c ============================================================================== --- head/bin/sh/trap.c Sun Jan 16 10:47:35 2011 (r217471) +++ head/bin/sh/trap.c Sun Jan 16 13:56:41 2011 (r217472) @@ -79,6 +79,7 @@ static volatile sig_atomic_t gotsig[NSIG /* indicates specified signal received */ static int ignore_sigchld; /* Used while handling SIGCHLD traps. */ volatile sig_atomic_t gotwinch; +static int last_trapsig; static int exiting; /* exitshell() has been called */ static int exiting_exitstatus; /* value passed to exitshell() */ @@ -441,6 +442,7 @@ dotrap(void) */ if (i == SIGCHLD) ignore_sigchld++; + last_trapsig = i; savestatus = exitstatus; evalstring(trap[i], 0); exitstatus = savestatus; @@ -495,9 +497,16 @@ exitshell_savedstatus(void) { struct jmploc loc1, loc2; char *p; + int sig = 0; + sigset_t sigs; - if (!exiting) - exiting_exitstatus = oexitstatus; + if (!exiting) { + if (in_dotrap && last_trapsig) { + sig = last_trapsig; + exiting_exitstatus = sig + 128; + } else + exiting_exitstatus = oexitstatus; + } exitstatus = oexitstatus = exiting_exitstatus; if (setjmp(loc1.loc)) { goto l1; @@ -515,5 +524,15 @@ l1: handler = &loc2; /* probably unn #if JOBS setjobctl(0); #endif -l2: _exit(exiting_exitstatus); +l2: + if (sig != 0 && sig != SIGSTOP && sig != SIGTSTP && sig != SIGTTIN && + sig != SIGTTOU) { + signal(sig, SIG_DFL); + sigemptyset(&sigs); + sigaddset(&sigs, sig); + sigprocmask(SIG_UNBLOCK, &sigs, NULL); + kill(getpid(), sig); + /* If the default action is to ignore, fall back to _exit(). */ + } + _exit(exiting_exitstatus); } Added: head/tools/regression/bin/sh/builtins/trap6.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/builtins/trap6.0 Sun Jan 16 13:56:41 2011 (r217472) @@ -0,0 +1,9 @@ +# $FreeBSD$ + +v=$( + ${SH} -c 'trap "echo ok; exit" USR1; kill -USR1 $$' & + # Suppress possible message about exit on signal + wait $! >/dev/null 2>&1 +) +r=$(kill -l $?) +[ "$v" = "ok" ] && { [ "$r" = "USR1" ] || [ "$r" = "usr1" ]; } From owner-svn-src-all@FreeBSD.ORG Sun Jan 16 14:11:50 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A93B4106564A; Sun, 16 Jan 2011 14:11:50 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9891C8FC1D; Sun, 16 Jan 2011 14:11:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0GEBo0b066006; Sun, 16 Jan 2011 14:11:50 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0GEBoPs066004; Sun, 16 Jan 2011 14:11:50 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201101161411.p0GEBoPs066004@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 16 Jan 2011 14:11:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217473 - head/bin/sh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Jan 2011 14:11:50 -0000 Author: jilles Date: Sun Jan 16 14:11:50 2011 New Revision: 217473 URL: http://svn.freebsd.org/changeset/base/217473 Log: sh(1): Document changes to 'exit' from traps. Modified: head/bin/sh/sh.1 Modified: head/bin/sh/sh.1 ============================================================================== --- head/bin/sh/sh.1 Sun Jan 16 13:56:41 2011 (r217472) +++ head/bin/sh/sh.1 Sun Jan 16 14:11:50 2011 (r217473) @@ -32,7 +32,7 @@ .\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95 .\" $FreeBSD$ .\" -.Dd December 21, 2010 +.Dd January 16, 2011 .Dt SH 1 .Os .Sh NAME @@ -1848,7 +1848,12 @@ If .Ar exitstatus is given it is used as the exit status of the shell; -otherwise the exit status of the preceding command is used. +otherwise, if the shell is executing an +.Cm EXIT +trap, the exit status of the last command before the trap is used; +if the shell is executing a trap for a signal, +the shell exits by resending the signal to itself; +otherwise, the exit status of the preceding command is used. The exit status should be an integer between 0 and 255. .It Ic export Ar name ... .It Ic export Op Fl p From owner-svn-src-all@FreeBSD.ORG Sun Jan 16 14:15:46 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CC691106564A; Sun, 16 Jan 2011 14:15:46 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B9BF58FC15; Sun, 16 Jan 2011 14:15:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0GEFkiA066149; Sun, 16 Jan 2011 14:15:46 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0GEFkOs066144; Sun, 16 Jan 2011 14:15:46 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201101161415.p0GEFkOs066144@svn.freebsd.org> From: Rick Macklem Date: Sun, 16 Jan 2011 14:15:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217474 - stable/8/sys/fs/nfsserver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Jan 2011 14:15:47 -0000 Author: rmacklem Date: Sun Jan 16 14:15:46 2011 New Revision: 217474 URL: http://svn.freebsd.org/changeset/base/217474 Log: MFC: r216893 Add checks for VI_DOOMED and vn_lock() failures to the experimental NFS server, to handle the case where an exported file system is forced dismounted while an RPC is in progress. Further commits will fix the cases where a mount point is used when the associated vnode isn't locked. Modified: stable/8/sys/fs/nfsserver/nfs_nfsdport.c stable/8/sys/fs/nfsserver/nfs_nfsdserv.c stable/8/sys/fs/nfsserver/nfs_nfsdsocket.c stable/8/sys/fs/nfsserver/nfs_nfsdstate.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdport.c Sun Jan 16 14:11:50 2011 (r217473) +++ stable/8/sys/fs/nfsserver/nfs_nfsdport.c Sun Jan 16 14:15:46 2011 (r217474) @@ -153,6 +153,10 @@ nfsvno_accchk(struct vnode *vp, accmode_ struct vattr vattr; int error = 0, getret = 0; + if (vpislocked == 0) { + if (vn_lock(vp, LK_SHARED) != 0) + return (EPERM); + } if (accmode & VWRITE) { /* Just vn_writechk() changed to check rdonly */ /* @@ -166,7 +170,7 @@ nfsvno_accchk(struct vnode *vp, accmode_ case VREG: case VDIR: case VLNK: - return (EROFS); + error = EROFS; default: break; } @@ -176,11 +180,14 @@ nfsvno_accchk(struct vnode *vp, accmode_ * the inode, try to free it up once. If * we fail, we can't allow writing. */ - if (vp->v_vflag & VV_TEXT) - return (ETXTBSY); + if ((vp->v_vflag & VV_TEXT) != 0 && error == 0) + error = ETXTBSY; + } + if (error != 0) { + if (vpislocked == 0) + VOP_UNLOCK(vp, 0); + return (error); } - if (vpislocked == 0) - vn_lock(vp, LK_SHARED | LK_RETRY); /* * Should the override still be applied when ACLs are enabled? @@ -1097,9 +1104,11 @@ nfsvno_rename(struct nameidata *fromndp, goto out; } if (ndflag & ND_NFSV4) { - NFSVOPLOCK(fvp, LK_EXCLUSIVE | LK_RETRY, p); - error = nfsrv_checkremove(fvp, 0, p); - NFSVOPUNLOCK(fvp, 0, p); + if (vn_lock(fvp, LK_EXCLUSIVE) == 0) { + error = nfsrv_checkremove(fvp, 0, p); + VOP_UNLOCK(fvp, 0); + } else + error = EPERM; if (tvp && !error) error = nfsrv_checkremove(tvp, 1, p); } else { @@ -1156,13 +1165,16 @@ nfsvno_link(struct nameidata *ndp, struc error = EXDEV; } if (!error) { - NFSVOPLOCK(vp, LK_EXCLUSIVE | LK_RETRY, p); - error = VOP_LINK(ndp->ni_dvp, vp, &ndp->ni_cnd); + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + if ((vp->v_iflag & VI_DOOMED) == 0) + error = VOP_LINK(ndp->ni_dvp, vp, &ndp->ni_cnd); + else + error = EPERM; if (ndp->ni_dvp == vp) vrele(ndp->ni_dvp); else vput(ndp->ni_dvp); - NFSVOPUNLOCK(vp, 0, p); + VOP_UNLOCK(vp, 0); } else { if (ndp->ni_dvp == ndp->ni_vp) vrele(ndp->ni_dvp); @@ -2793,6 +2805,11 @@ nfsvno_advlock(struct vnode *vp, int fty if (nfsrv_dolocallocks == 0) return (0); + + /* Check for VI_DOOMED here, so that VOP_ADVLOCK() isn't performed. */ + if ((vp->v_iflag & VI_DOOMED) != 0) + return (EPERM); + fl.l_whence = SEEK_SET; fl.l_type = ftype; fl.l_start = (off_t)first; Modified: stable/8/sys/fs/nfsserver/nfs_nfsdserv.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdserv.c Sun Jan 16 14:11:50 2011 (r217473) +++ stable/8/sys/fs/nfsserver/nfs_nfsdserv.c Sun Jan 16 14:15:46 2011 (r217474) @@ -2676,9 +2676,12 @@ nfsrvd_open(struct nfsrv_descript *nd, _ }; stp->ls_flags |= NFSLCK_RECLAIM; vp = dp; - NFSVOPLOCK(vp, LK_EXCLUSIVE | LK_RETRY, p); - nd->nd_repstat = nfsrv_opencheck(clientid, &stateid, stp, vp, - nd, p, nd->nd_repstat); + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + if ((vp->v_iflag & VI_DOOMED) == 0) + nd->nd_repstat = nfsrv_opencheck(clientid, &stateid, + stp, vp, nd, p, nd->nd_repstat); + else + nd->nd_repstat = NFSERR_PERM; } else { nd->nd_repstat = NFSERR_BADXDR; vrele(dp); Modified: stable/8/sys/fs/nfsserver/nfs_nfsdsocket.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdsocket.c Sun Jan 16 14:11:50 2011 (r217473) +++ stable/8/sys/fs/nfsserver/nfs_nfsdsocket.c Sun Jan 16 14:15:46 2011 (r217474) @@ -902,13 +902,15 @@ nfsrvd_compound(struct nfsrv_descript *n nd->nd_repstat = NFSERR_XDEV; break; } - VREF(vp); - VREF(savevp); if (nfsv4_opflag[op].modifyfs) NFS_STARTWRITE(NULL, &mp); - NFSVOPLOCK(savevp, LK_EXCLUSIVE | LK_RETRY, p); - error = (*(nfsrv4_ops2[op]))(nd, isdgram, savevp, - vp, p, &savevpnes, &vpnes); + if (vn_lock(savevp, LK_EXCLUSIVE) == 0) { + VREF(vp); + VREF(savevp); + error = (*(nfsrv4_ops2[op]))(nd, isdgram, + savevp, vp, p, &savevpnes, &vpnes); + } else + nd->nd_repstat = NFSERR_PERM; if (nfsv4_opflag[op].modifyfs) NFS_ENDWRITE(mp); } else { @@ -916,12 +918,15 @@ nfsrvd_compound(struct nfsrv_descript *n panic("nfsrvd_compound"); if (nfsv4_opflag[op].needscfh) { if (vp != NULL) { + if (nfsv4_opflag[op].modifyfs) + NFS_STARTWRITE(NULL, &mp); if (vn_lock(vp, nfsv4_opflag[op].lktype) - != 0) + == 0) + VREF(vp); + else nd->nd_repstat = NFSERR_PERM; - } else + } else { nd->nd_repstat = NFSERR_NOFILEHANDLE; - if (nd->nd_repstat != 0) { if (op == NFSV4OP_SETATTR) { /* * Setattr reply requires a @@ -934,11 +939,9 @@ nfsrvd_compound(struct nfsrv_descript *n } break; } - VREF(vp); - if (nfsv4_opflag[op].modifyfs) - NFS_STARTWRITE(NULL, &mp); - error = (*(nfsrv4_ops0[op]))(nd, isdgram, vp, - p, &vpnes); + if (nd->nd_repstat == 0) + error = (*(nfsrv4_ops0[op]))(nd, + isdgram, vp, p, &vpnes); if (nfsv4_opflag[op].modifyfs) NFS_ENDWRITE(mp); } else { Modified: stable/8/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdstate.c Sun Jan 16 14:11:50 2011 (r217473) +++ stable/8/sys/fs/nfsserver/nfs_nfsdstate.c Sun Jan 16 14:15:46 2011 (r217474) @@ -1659,7 +1659,7 @@ tryagain: if (new_stp->ls_flags & bits & NFSLCK_ACCESSBITS) { ret = nfsrv_clientconflict(tstp->ls_clp, &haslock, vp, p); - if (ret) { + if (ret == 1) { /* * nfsrv_clientconflict unlocks state * when it returns non-zero. @@ -1667,13 +1667,17 @@ tryagain: lckstp = NULL; goto tryagain; } - NFSUNLOCKSTATE(); + if (ret == 0) + NFSUNLOCKSTATE(); if (haslock) { NFSLOCKV4ROOTMUTEX(); nfsv4_unlock(&nfsv4rootfs_lock, 1); NFSUNLOCKV4ROOTMUTEX(); } - return (NFSERR_OPENMODE); + if (ret == 2) + return (NFSERR_PERM); + else + return (NFSERR_OPENMODE); } } } @@ -1826,7 +1830,7 @@ tryagain: other_lop = NULL; } ret = nfsrv_clientconflict(lop->lo_stp->ls_clp,&haslock,vp,p); - if (ret) { + if (ret == 1) { if (filestruct_locked != 0) { /* Roll back local locks. */ nfsrv_locallock_rollback(vp, lfp, p); @@ -1845,7 +1849,7 @@ tryagain: * Found a conflicting lock, so record the conflict and * return the error. */ - if (cfp) { + if (cfp != NULL && ret == 0) { cfp->cl_clientid.lval[0]=lop->lo_stp->ls_stateid.other[0]; cfp->cl_clientid.lval[1]=lop->lo_stp->ls_stateid.other[1]; cfp->cl_first = lop->lo_first; @@ -1855,20 +1859,23 @@ tryagain: NFSBCOPY(lop->lo_stp->ls_owner, cfp->cl_owner, cfp->cl_ownerlen); } - if (new_stp->ls_flags & NFSLCK_RECLAIM) + if (ret == 2) + error = NFSERR_PERM; + else if (new_stp->ls_flags & NFSLCK_RECLAIM) error = NFSERR_RECLAIMCONFLICT; else if (new_stp->ls_flags & NFSLCK_CHECK) error = NFSERR_LOCKED; else error = NFSERR_DENIED; - if (filestruct_locked != 0) { + if (filestruct_locked != 0 && ret == 0) { /* Roll back local locks. */ NFSUNLOCKSTATE(); nfsrv_locallock_rollback(vp, lfp, p); NFSLOCKSTATE(); nfsrv_unlocklf(lfp); } - NFSUNLOCKSTATE(); + if (ret == 0) + NFSUNLOCKSTATE(); if (haslock) { NFSLOCKV4ROOTMUTEX(); nfsv4_unlock(&nfsv4rootfs_lock, 1); @@ -2120,18 +2127,21 @@ tryagain: ((stp->ls_flags & NFSLCK_ACCESSBITS) & ((new_stp->ls_flags>>NFSLCK_SHIFT)&NFSLCK_ACCESSBITS)))){ ret = nfsrv_clientconflict(stp->ls_clp,&haslock,vp,p); - if (ret) { + if (ret == 1) { /* * nfsrv_clientconflict() unlocks * state when it returns non-zero. */ goto tryagain; } - if (new_stp->ls_flags & NFSLCK_RECLAIM) + if (ret == 2) + error = NFSERR_PERM; + else if (new_stp->ls_flags & NFSLCK_RECLAIM) error = NFSERR_RECLAIMCONFLICT; else error = NFSERR_SHAREDENIED; - NFSUNLOCKSTATE(); + if (ret == 0) + NFSUNLOCKSTATE(); if (haslock) { NFSLOCKV4ROOTMUTEX(); nfsv4_unlock(&nfsv4rootfs_lock, 1); @@ -2394,7 +2404,7 @@ tryagain: ((stp->ls_flags & NFSLCK_ACCESSBITS) & ((new_stp->ls_flags>>NFSLCK_SHIFT)&NFSLCK_ACCESSBITS))){ ret = nfsrv_clientconflict(stp->ls_clp,&haslock,vp,p); - if (ret) { + if (ret == 1) { /* * nfsrv_clientconflict() unlocks state * when it returns non-zero. @@ -2404,11 +2414,14 @@ tryagain: openstp = NULL; goto tryagain; } - if (new_stp->ls_flags & NFSLCK_RECLAIM) + if (ret == 2) + error = NFSERR_PERM; + else if (new_stp->ls_flags & NFSLCK_RECLAIM) error = NFSERR_RECLAIMCONFLICT; else error = NFSERR_SHAREDENIED; - NFSUNLOCKSTATE(); + if (ret == 0) + NFSUNLOCKSTATE(); if (haslock) { NFSLOCKV4ROOTMUTEX(); nfsv4_unlock(&nfsv4rootfs_lock, 1); @@ -4080,10 +4093,13 @@ nfsrv_updatestable(NFSPROC_T *p) NFSVNO_SETATTRVAL(&nva, size, 0); vp = NFSFPVNODE(sf->nsf_fp); NFS_STARTWRITE(vp, &mp); - NFSVOPLOCK(vp, LK_EXCLUSIVE | LK_RETRY, p); - error = nfsvno_setattr(vp, &nva, NFSFPCRED(sf->nsf_fp), p, NULL); + if (vn_lock(vp, LK_EXCLUSIVE) == 0) { + error = nfsvno_setattr(vp, &nva, NFSFPCRED(sf->nsf_fp), p, + NULL); + VOP_UNLOCK(vp, 0); + } else + error = EPERM; NFS_ENDWRITE(mp); - NFSVOPUNLOCK(vp, 0, p); if (!error) error = NFSD_RDWR(UIO_WRITE, vp, (caddr_t)&sf->nsf_rec, sizeof (struct nfsf_rec), (off_t)0, @@ -4211,10 +4227,11 @@ nfsrv_checkstable(struct nfsclient *clp) * Return 0 to indicate the conflict can't be revoked and 1 to indicate * the revocation worked and the conflicting client is "bye, bye", so it * can be tried again. + * Return 2 to indicate that the vnode is VI_DOOMED after vn_lock(). * Unlocks State before a non-zero value is returned. */ static int -nfsrv_clientconflict(struct nfsclient *clp, int *haslockp, __unused vnode_t vp, +nfsrv_clientconflict(struct nfsclient *clp, int *haslockp, vnode_t vp, NFSPROC_T *p) { int gotlock, lktype; @@ -4238,7 +4255,10 @@ nfsrv_clientconflict(struct nfsclient *c NFSUNLOCKV4ROOTMUTEX(); *haslockp = 1; vn_lock(vp, lktype | LK_RETRY); - return (1); + if ((vp->v_iflag & VI_DOOMED) != 0) + return (2); + else + return (1); } NFSUNLOCKSTATE(); @@ -4254,7 +4274,6 @@ nfsrv_clientconflict(struct nfsclient *c return (1); } - /* * Resolve a delegation conflict. * Returns 0 to indicate the conflict was resolved without sleeping. @@ -4403,6 +4422,13 @@ nfsrv_delegconflict(struct nfsstate *stp NFSUNLOCKV4ROOTMUTEX(); *haslockp = 1; vn_lock(vp, lktype | LK_RETRY); + if ((vp->v_iflag & VI_DOOMED) != 0) { + *haslockp = 0; + NFSLOCKV4ROOTMUTEX(); + nfsv4_unlock(&nfsv4rootfs_lock, 1); + NFSUNLOCKV4ROOTMUTEX(); + return (NFSERR_PERM); + } return (-1); } @@ -4594,12 +4620,11 @@ nfsd_recalldelegation(vnode_t vp, NFSPRO NFSGETNANOTIME(&mytime); starttime = (u_int32_t)mytime.tv_sec; do { - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); - if ((vp->v_iflag & VI_DOOMED) == 0) + if (vn_lock(vp, LK_EXCLUSIVE) == 0) { error = nfsrv_checkremove(vp, 0, p); - else + VOP_UNLOCK(vp, 0); + } else error = EPERM; - VOP_UNLOCK(vp, 0); if (error == NFSERR_DELAY) { NFSGETNANOTIME(&mytime); if (((u_int32_t)mytime.tv_sec - starttime) > From owner-svn-src-all@FreeBSD.ORG Sun Jan 16 14:21:26 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B3944106564A; Sun, 16 Jan 2011 14:21:26 +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 A2F208FC0C; Sun, 16 Jan 2011 14:21:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0GELQYb066322; Sun, 16 Jan 2011 14:21:26 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0GELQO8066320; Sun, 16 Jan 2011 14:21:26 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201101161421.p0GELQO8066320@svn.freebsd.org> From: Marius Strobl Date: Sun, 16 Jan 2011 14:21:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217475 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Jan 2011 14:21:26 -0000 Author: marius Date: Sun Jan 16 14:21:26 2011 New Revision: 217475 URL: http://svn.freebsd.org/changeset/base/217475 Log: Add a missing word. Submitted by: gj Modified: head/share/man/man4/rgephy.4 Modified: head/share/man/man4/rgephy.4 ============================================================================== --- head/share/man/man4/rgephy.4 Sun Jan 16 14:15:46 2011 (r217474) +++ head/share/man/man4/rgephy.4 Sun Jan 16 14:21:26 2011 (r217475) @@ -69,7 +69,7 @@ the .Nm driver by default also triggers an autonegotiation advertising the selected media. -This is done in order work around hardware issues in certain scenarios. +This is done in order to work around hardware issues in certain scenarios. It is believed that this behavior does not cause harm in general but in fact can have an adverse effect in edge cases. In order to manually set the media type and options without also triggering From owner-svn-src-all@FreeBSD.ORG Sun Jan 16 14:37:48 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AF30F1065675; Sun, 16 Jan 2011 14:37:48 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9D38A8FC16; Sun, 16 Jan 2011 14:37:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0GEbmDw066811; Sun, 16 Jan 2011 14:37:48 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0GEbmBt066807; Sun, 16 Jan 2011 14:37:48 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201101161437.p0GEbmBt066807@svn.freebsd.org> From: Rick Macklem Date: Sun, 16 Jan 2011 14:37:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217476 - stable/8/sys/fs/nfsserver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Jan 2011 14:37:48 -0000 Author: rmacklem Date: Sun Jan 16 14:37:48 2011 New Revision: 217476 URL: http://svn.freebsd.org/changeset/base/217476 Log: MFC: r216894 Delete some cruft from the experimental NFS server that was only used by the OpenBSD port for its pseudo-fs. Modified: stable/8/sys/fs/nfsserver/nfs_nfsdport.c stable/8/sys/fs/nfsserver/nfs_nfsdserv.c stable/8/sys/fs/nfsserver/nfs_nfsdsocket.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdport.c Sun Jan 16 14:21:26 2011 (r217475) +++ stable/8/sys/fs/nfsserver/nfs_nfsdport.c Sun Jan 16 14:37:48 2011 (r217476) @@ -47,7 +47,6 @@ __FBSDID("$FreeBSD$"); #include extern u_int32_t newnfs_true, newnfs_false, newnfs_xdrneg1; -extern int nfsv4root_set; extern int nfsrv_useacl; extern int newnfs_numnfsd; extern struct mount nfsv4root_mnt; @@ -2677,10 +2676,9 @@ nfsrv_v4rootexport(void *argp, struct uc fhandle_t fh; error = vfs_export(&nfsv4root_mnt, &nfsexargp->export); - if ((nfsexargp->export.ex_flags & MNT_DELEXPORT)) { + if ((nfsexargp->export.ex_flags & MNT_DELEXPORT) != 0) nfs_rootfhset = 0; - nfsv4root_set = 0; - } else if (error == 0) { + else if (error == 0) { if (nfsexargp->fspec == NULL) return (EPERM); /* Modified: stable/8/sys/fs/nfsserver/nfs_nfsdserv.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdserv.c Sun Jan 16 14:21:26 2011 (r217475) +++ stable/8/sys/fs/nfsserver/nfs_nfsdserv.c Sun Jan 16 14:37:48 2011 (r217476) @@ -51,7 +51,7 @@ __FBSDID("$FreeBSD$"); extern u_int32_t newnfs_false, newnfs_true; extern enum vtype nv34tov_type[8]; extern struct timeval nfsboottime; -extern int nfs_rootfhset, nfsv4root_set; +extern int nfs_rootfhset; #endif /* !APPLEKEXT */ /* @@ -2874,8 +2874,7 @@ nfsrvd_delegpurge(struct nfsrv_descript int error = 0; nfsquad_t clientid; - if ((!nfs_rootfhset && !nfsv4root_set) || - nfsd_checkrootexp(nd)) { + if (nfs_rootfhset == 0 || nfsd_checkrootexp(nd) != 0) { nd->nd_repstat = NFSERR_WRONGSEC; return (0); } @@ -3073,8 +3072,7 @@ nfsrvd_renew(struct nfsrv_descript *nd, int error = 0; nfsquad_t clientid; - if ((!nfs_rootfhset && !nfsv4root_set) || - nfsd_checkrootexp(nd)) { + if (nfs_rootfhset == 0 || nfsd_checkrootexp(nd) != 0) { nd->nd_repstat = NFSERR_WRONGSEC; return (0); } @@ -3212,8 +3210,7 @@ nfsrvd_setclientid(struct nfsrv_descript u_char *verf, *ucp, *ucp2, addrbuf[24]; nfsquad_t clientid, confirm; - if ((!nfs_rootfhset && !nfsv4root_set) || - nfsd_checkrootexp(nd)) { + if (nfs_rootfhset == 0 || nfsd_checkrootexp(nd) != 0) { nd->nd_repstat = NFSERR_WRONGSEC; return (0); } @@ -3321,8 +3318,7 @@ nfsrvd_setclientidcfrm(struct nfsrv_desc int error = 0; nfsquad_t clientid, confirm; - if ((!nfs_rootfhset && !nfsv4root_set) || - nfsd_checkrootexp(nd)) { + if (nfs_rootfhset == 0 || nfsd_checkrootexp(nd) != 0) { nd->nd_repstat = NFSERR_WRONGSEC; return (0); } @@ -3409,8 +3405,7 @@ nfsrvd_releaselckown(struct nfsrv_descri int error = 0, len; nfsquad_t clientid; - if ((!nfs_rootfhset && !nfsv4root_set) || - nfsd_checkrootexp(nd)) { + if (nfs_rootfhset == 0 || nfsd_checkrootexp(nd) != 0) { nd->nd_repstat = NFSERR_WRONGSEC; return (0); } Modified: stable/8/sys/fs/nfsserver/nfs_nfsdsocket.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdsocket.c Sun Jan 16 14:21:26 2011 (r217475) +++ stable/8/sys/fs/nfsserver/nfs_nfsdsocket.c Sun Jan 16 14:37:48 2011 (r217476) @@ -50,8 +50,6 @@ extern struct nfsclienthashhead nfsclien extern int nfsrc_floodlevel, nfsrc_tcpsavedreplies; NFSV4ROOTLOCKMUTEX; NFSSTATESPINLOCK; -vnode_t nfsv4root_vp = NULL; -int nfsv4root_set = 0; int (*nfsrv3_procs0[NFS_V3NPROCS])(struct nfsrv_descript *, int, vnode_t , NFSPROC_T *, struct nfsexstuff *) = { @@ -748,20 +746,8 @@ nfsrvd_compound(struct nfsrv_descript *n NFSVOPUNLOCK(vp, 0, p); vpnes = nes; } - } else if (nfsv4root_vp && nfsv4root_set) { - if (vp) { - if (vpnes.nes_vfslocked) - nfsvno_unlockvfs(mp); - vrele(vp); - } - vp = nfsv4root_vp; - VREF(vp); - NFSVNO_SETEXRDONLY(&vpnes); - vpnes.nes_vfslocked = 0; - mp = vnode_mount(vp); - } else { + } else nd->nd_repstat = NFSERR_NOFILEHANDLE; - } break; case NFSV4OP_SAVEFH: if (vp && NFSVNO_EXPORTED(&vpnes)) { @@ -859,17 +845,6 @@ nfsrvd_compound(struct nfsrv_descript *n vfs_statfs(vnode_mount(nvp))->f_fsid.val[0] || vfs_statfs(mp)->f_fsid.val[1] != vfs_statfs(vnode_mount(nvp))->f_fsid.val[1]) { - if (vfs_statfs(vnode_mount(nvp))->f_fsid.val[0] == - NFSV4ROOT_FSID0 && - vfs_statfs(vnode_mount(nvp))->f_fsid.val[1] == - NFSV4ROOT_FSID1) { - if (vpnes.nes_vfslocked) { - nfsvno_unlockvfs(mp); - vpnes.nes_vfslocked = 0; - } - NFSVNO_SETEXRDONLY(&vpnes); - mp = vnode_mount(nvp); - } else { nd->nd_repstat = nfsvno_checkexp(vnode_mount(nvp), nd->nd_nam, &nes, &credanon); if (!nd->nd_repstat) @@ -885,7 +860,6 @@ nfsrvd_compound(struct nfsrv_descript *n vpnes.nes_vfslocked = nfsvno_lockvfs(mp); } - } } if (!nd->nd_repstat) { vrele(vp); From owner-svn-src-all@FreeBSD.ORG Sun Jan 16 17:33:34 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D3E9B106566C; Sun, 16 Jan 2011 17:33:34 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C366C8FC12; Sun, 16 Jan 2011 17:33:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0GHXY50071362; Sun, 16 Jan 2011 17:33:34 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0GHXY3X071360; Sun, 16 Jan 2011 17:33:34 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201101161733.p0GHXY3X071360@svn.freebsd.org> From: Alan Cox Date: Sun, 16 Jan 2011 17:33:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217477 - head/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Jan 2011 17:33:34 -0000 Author: alc Date: Sun Jan 16 17:33:34 2011 New Revision: 217477 URL: http://svn.freebsd.org/changeset/base/217477 Log: Clean up the start of vm_page_alloc(). In particular, eliminate an assertion that is no longer required. Long ago, calls to vm_page_alloc() from an interrupt handler had to specify VM_ALLOC_INTERRUPT so that vm_page_alloc() would not attempt to reclaim a PQ_CACHE page from another vm object. Today, with the synchronization on a vm object's collection of PQ_CACHE pages, this is no longer an issue. In fact, VM_ALLOC_INTERRUPT now reclaims PQ_CACHE pages just like VM_ALLOC_{NORMAL,SYSTEM}. MFC after: 3 weeks Modified: head/sys/vm/vm_page.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Sun Jan 16 14:37:48 2011 (r217476) +++ head/sys/vm/vm_page.c Sun Jan 16 17:33:34 2011 (r217477) @@ -1214,23 +1214,19 @@ vm_page_alloc(vm_object_t object, vm_pin vm_page_t m; int flags, page_req; - page_req = req & VM_ALLOC_CLASS_MASK; - KASSERT(curthread->td_intr_nesting_level == 0 || - page_req == VM_ALLOC_INTERRUPT, - ("vm_page_alloc(NORMAL|SYSTEM) in interrupt context")); - if ((req & VM_ALLOC_NOOBJ) == 0) { KASSERT(object != NULL, ("vm_page_alloc: NULL object.")); VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); } + page_req = req & VM_ALLOC_CLASS_MASK; + /* * The pager is allowed to eat deeper into the free page list. */ - if ((curproc == pageproc) && (page_req != VM_ALLOC_INTERRUPT)) { + if ((curproc == pageproc) && (page_req != VM_ALLOC_INTERRUPT)) page_req = VM_ALLOC_SYSTEM; - }; mtx_lock(&vm_page_queue_free_mtx); if (cnt.v_free_count + cnt.v_cache_count > cnt.v_free_reserved || From owner-svn-src-all@FreeBSD.ORG Sun Jan 16 18:01:40 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7320B106566B; Sun, 16 Jan 2011 18:01:40 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 489248FC12; Sun, 16 Jan 2011 18:01:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0GI1exO072068; Sun, 16 Jan 2011 18:01:40 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0GI1eId072064; Sun, 16 Jan 2011 18:01:40 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201101161801.p0GI1eId072064@svn.freebsd.org> From: Alan Cox Date: Sun, 16 Jan 2011 18:01:40 +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: r217478 - head/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Jan 2011 18:01:40 -0000 Author: alc Date: Sun Jan 16 18:01:39 2011 New Revision: 217478 URL: http://svn.freebsd.org/changeset/base/217478 Log: Shift responsibility for synchronizing access to the page's act_count field to the object's lock. Reviewed by: kib@ Modified: head/sys/vm/vm_page.c head/sys/vm/vm_page.h head/sys/vm/vm_pageout.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Sun Jan 16 17:33:34 2011 (r217477) +++ head/sys/vm/vm_page.c Sun Jan 16 18:01:39 2011 (r217478) @@ -1338,8 +1338,8 @@ vm_page_alloc(vm_object_t object, vm_pin atomic_add_int(&cnt.v_wire_count, 1); m->wire_count = 1; } - m->act_count = 0; mtx_unlock(&vm_page_queue_free_mtx); + m->act_count = 0; if (object != NULL) { /* Ignore device objects; the pager sets "memattr" for them. */ @@ -1603,6 +1603,7 @@ vm_page_activate(vm_page_t m) int queue; vm_page_lock_assert(m, MA_OWNED); + VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED); if ((queue = m->queue) != PQ_ACTIVE) { if (m->wire_count == 0 && (m->flags & PG_UNMANAGED) == 0) { if (m->act_count < ACT_INIT) Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Sun Jan 16 17:33:34 2011 (r217477) +++ head/sys/vm/vm_page.h Sun Jan 16 18:01:39 2011 (r217478) @@ -116,7 +116,7 @@ struct vm_page { u_int wire_count; /* wired down maps refs (P) */ short hold_count; /* page hold count (P) */ u_short oflags; /* page flags (O) */ - u_char act_count; /* page usage count (P) */ + u_char act_count; /* page usage count (O) */ u_char busy; /* page busy count (O) */ /* NOTE that these must support one bit per DEV_BSIZE in a page!!! */ /* so, on normal X86 kernels, they must be at least 8 bits wide */ Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Sun Jan 16 17:33:34 2011 (r217477) +++ head/sys/vm/vm_pageout.c Sun Jan 16 18:01:39 2011 (r217478) @@ -855,9 +855,9 @@ rescan0: } else if (((m->flags & PG_REFERENCED) == 0) && (actcount = pmap_ts_referenced(m))) { vm_page_activate(m); - VM_OBJECT_UNLOCK(object); - m->act_count += (actcount + ACT_ADVANCE); vm_page_unlock(m); + m->act_count += actcount + ACT_ADVANCE; + VM_OBJECT_UNLOCK(object); continue; } @@ -871,9 +871,9 @@ rescan0: vm_page_flag_clear(m, PG_REFERENCED); actcount = pmap_ts_referenced(m); vm_page_activate(m); - VM_OBJECT_UNLOCK(object); - m->act_count += (actcount + ACT_ADVANCE + 1); vm_page_unlock(m); + m->act_count += actcount + ACT_ADVANCE + 1; + VM_OBJECT_UNLOCK(object); continue; } From owner-svn-src-all@FreeBSD.ORG Sun Jan 16 18:04:01 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 630281065670; Sun, 16 Jan 2011 18:04:01 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 52D948FC12; Sun, 16 Jan 2011 18:04:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0GI41fk072217; Sun, 16 Jan 2011 18:04:01 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0GI41dt072215; Sun, 16 Jan 2011 18:04:01 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201101161804.p0GI41dt072215@svn.freebsd.org> From: Alan Cox Date: Sun, 16 Jan 2011 18:04: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: r217479 - head/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Jan 2011 18:04:01 -0000 Author: alc Date: Sun Jan 16 18:04:01 2011 New Revision: 217479 URL: http://svn.freebsd.org/changeset/base/217479 Log: Update a lock annotation on the page structure. Modified: head/sys/vm/vm_page.h Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Sun Jan 16 18:01:39 2011 (r217478) +++ head/sys/vm/vm_page.h Sun Jan 16 18:04:01 2011 (r217479) @@ -104,7 +104,7 @@ struct vm_page { struct vm_page *right; /* splay tree link (O) */ vm_object_t object; /* which object am I in (O,P)*/ - vm_pindex_t pindex; /* offset into object (O,Q) */ + vm_pindex_t pindex; /* offset into object (O,P) */ vm_paddr_t phys_addr; /* physical address of page */ struct md_page md; /* machine dependant stuff */ uint8_t queue; /* page queue index (P,Q) */ From owner-svn-src-all@FreeBSD.ORG Sun Jan 16 20:10:55 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F0091106564A; Sun, 16 Jan 2011 20:10:55 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DF4B88FC15; Sun, 16 Jan 2011 20:10:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0GKAtVv075449; Sun, 16 Jan 2011 20:10:55 GMT (envelope-from keramida@svn.freebsd.org) Received: (from keramida@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0GKAtXn075447; Sun, 16 Jan 2011 20:10:55 GMT (envelope-from keramida@svn.freebsd.org) Message-Id: <201101162010.p0GKAtXn075447@svn.freebsd.org> From: Giorgos Keramidas Date: Sun, 16 Jan 2011 20: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: r217481 - head/share/man/man5 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Jan 2011 20:10:56 -0000 Author: keramida (doc committer) Date: Sun Jan 16 20:10:55 2011 New Revision: 217481 URL: http://svn.freebsd.org/changeset/base/217481 Log: Fix the mount example of xfDmitry Marakasov s(5) filesystems by including the read-only option. We only support ro mounts for xfs, so it's nice if the examples we show in the manpage are easy to copy/paste. PR: docs/149106 Submitted by: amdmi3 MFC after: 3 days Modified: head/share/man/man5/xfs.5 Modified: head/share/man/man5/xfs.5 ============================================================================== --- head/share/man/man5/xfs.5 Sun Jan 16 18:46:17 2011 (r217480) +++ head/share/man/man5/xfs.5 Sun Jan 16 20:10:55 2011 (r217481) @@ -53,7 +53,7 @@ To mount a volume located on .Pa /dev/ad1s1 : .Pp -.Dl "mount -t xfs /dev/ad1s1 /mnt" +.Dl "mount -t xfs -o ro /dev/ad1s1 /mnt" .Sh SEE ALSO .Xr nmount 2 , .Xr unmount 2 , From owner-svn-src-all@FreeBSD.ORG Sun Jan 16 20:40:51 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5A37D1065675; Sun, 16 Jan 2011 20:40:51 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2FAEA8FC1E; Sun, 16 Jan 2011 20:40:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0GKepZI076318; Sun, 16 Jan 2011 20:40:51 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0GKepYV076316; Sun, 16 Jan 2011 20:40:51 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201101162040.p0GKepYV076316@svn.freebsd.org> From: Alan Cox Date: Sun, 16 Jan 2011 20:40: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: r217482 - head/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Jan 2011 20:40:51 -0000 Author: alc Date: Sun Jan 16 20:40:50 2011 New Revision: 217482 URL: http://svn.freebsd.org/changeset/base/217482 Log: Sort function prototypes. Modified: head/sys/vm/pmap.h Modified: head/sys/vm/pmap.h ============================================================================== --- head/sys/vm/pmap.h Sun Jan 16 20:10:55 2011 (r217481) +++ head/sys/vm/pmap.h Sun Jan 16 20:40:50 2011 (r217482) @@ -96,6 +96,7 @@ struct thread; */ extern vm_offset_t kernel_vm_end; +void pmap_activate(struct thread *td); void pmap_align_superpage(vm_object_t, vm_ooffset_t, vm_offset_t *, vm_size_t); #if defined(__mips__) @@ -108,10 +109,10 @@ void pmap_copy(pmap_t, pmap_t, vm_offs void pmap_copy_page(vm_page_t, vm_page_t); void pmap_enter(pmap_t, vm_offset_t, vm_prot_t, vm_page_t, vm_prot_t, boolean_t); -void pmap_enter_quick(pmap_t pmap, vm_offset_t va, vm_page_t m, - vm_prot_t prot); void pmap_enter_object(pmap_t pmap, vm_offset_t start, vm_offset_t end, vm_page_t m_start, vm_prot_t prot); +void pmap_enter_quick(pmap_t pmap, vm_offset_t va, vm_page_t m, + vm_prot_t prot); vm_paddr_t pmap_extract(pmap_t pmap, vm_offset_t va); vm_page_t pmap_extract_and_hold(pmap_t pmap, vm_offset_t va, vm_prot_t prot); @@ -120,7 +121,6 @@ void pmap_init(void); boolean_t pmap_is_modified(vm_page_t m); boolean_t pmap_is_prefaultable(pmap_t pmap, vm_offset_t va); boolean_t pmap_is_referenced(vm_page_t m); -boolean_t pmap_ts_referenced(vm_page_t m); vm_offset_t pmap_map(vm_offset_t *, vm_paddr_t, vm_paddr_t, int); int pmap_mincore(pmap_t pmap, vm_offset_t addr, vm_paddr_t *locked_pa); @@ -140,10 +140,10 @@ void pmap_remove_all(vm_page_t m); void pmap_remove_pages(pmap_t); void pmap_remove_write(vm_page_t m); void pmap_sync_icache(pmap_t, vm_offset_t, vm_size_t); +boolean_t pmap_ts_referenced(vm_page_t m); void pmap_zero_page(vm_page_t); void pmap_zero_page_area(vm_page_t, int off, int size); void pmap_zero_page_idle(vm_page_t); -void pmap_activate(struct thread *td); #define pmap_resident_count(pm) ((pm)->pm_stats.resident_count) #define pmap_wired_count(pm) ((pm)->pm_stats.wired_count) From owner-svn-src-all@FreeBSD.ORG Sun Jan 16 21:59:50 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B0D91065673; Sun, 16 Jan 2011 21:59:50 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4A54F8FC0A; Sun, 16 Jan 2011 21:59:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0GLxo8f078444; Sun, 16 Jan 2011 21:59:50 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0GLxoAU078442; Sun, 16 Jan 2011 21:59:50 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201101162159.p0GLxoAU078442@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 16 Jan 2011 21:59:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217484 - head/lib/libc/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Jan 2011 21:59:50 -0000 Author: jilles Date: Sun Jan 16 21:59:50 2011 New Revision: 217484 URL: http://svn.freebsd.org/changeset/base/217484 Log: mknod(2): The required include is , not . This is what SUSv4 requires, and also the only thing that works if strict standards compliance is requested or mknodat() is needed. PR: standards/123688 Submitted by: gcooper MFC after: 1 week Modified: head/lib/libc/sys/mknod.2 Modified: head/lib/libc/sys/mknod.2 ============================================================================== --- head/lib/libc/sys/mknod.2 Sun Jan 16 21:56:14 2011 (r217483) +++ head/lib/libc/sys/mknod.2 Sun Jan 16 21:59:50 2011 (r217484) @@ -28,7 +28,7 @@ .\" @(#)mknod.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd April 10, 2008 +.Dd January 16, 2011 .Dt MKNOD 2 .Os .Sh NAME @@ -38,7 +38,7 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.In unistd.h +.In sys/stat.h .Ft int .Fn mknod "const char *path" "mode_t mode" "dev_t dev" .Ft int From owner-svn-src-all@FreeBSD.ORG Sun Jan 16 22:10:19 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 08147106566B; Sun, 16 Jan 2011 22:10:19 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EABC08FC15; Sun, 16 Jan 2011 22:10:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0GMAIUl078773; Sun, 16 Jan 2011 22:10:18 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0GMAIs5078771; Sun, 16 Jan 2011 22:10:18 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201101162210.p0GMAIs5078771@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 16 Jan 2011 22:10:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217485 - stable/8/bin/sh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Jan 2011 22:10:19 -0000 Author: jilles Date: Sun Jan 16 22:10:18 2011 New Revision: 217485 URL: http://svn.freebsd.org/changeset/base/217485 Log: MFC r216806: sh: Properly restore exception handler in fc. If SIGINT arrived at exactly the right moment (unlikely), an exception handler in a no longer active stack frame would be called. Because the old handler was not used in the normal path, clang thought it was a dead value and if an exception happened it would longjmp() to garbage. This caused builtins/fc1.0 to fail if histedit.c was compiled with clang. (Note: not tested on stable/8 with clang.) Modified: stable/8/bin/sh/histedit.c Directory Properties: stable/8/bin/sh/ (props changed) Modified: stable/8/bin/sh/histedit.c ============================================================================== --- stable/8/bin/sh/histedit.c Sun Jan 16 21:59:50 2011 (r217484) +++ stable/8/bin/sh/histedit.c Sun Jan 16 22:10:18 2011 (r217485) @@ -214,6 +214,7 @@ histcmd(int argc, char **argv) } argc -= optind, argv += optind; + savehandler = handler; /* * If executing... */ @@ -224,7 +225,6 @@ histcmd(int argc, char **argv) * Catch interrupts to reset active counter and * cleanup temp files. */ - savehandler = handler; if (setjmp(jmploc.loc)) { active = 0; if (editfile) @@ -380,6 +380,7 @@ histcmd(int argc, char **argv) --active; if (displayhist) displayhist = 0; + handler = savehandler; return 0; } From owner-svn-src-all@FreeBSD.ORG Sun Jan 16 23:41:41 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4EEB4106566C; Sun, 16 Jan 2011 23:41:41 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3C3128FC1D; Sun, 16 Jan 2011 23:41:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0GNffAq081133; Sun, 16 Jan 2011 23:41:41 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0GNffIi081127; Sun, 16 Jan 2011 23:41:41 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201101162341.p0GNffIi081127@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 16 Jan 2011 23:41:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217489 - in stable/8/tools/regression/bin/sh: builtins expansion X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Jan 2011 23:41:41 -0000 Author: jilles Date: Sun Jan 16 23:41:40 2011 New Revision: 217489 URL: http://svn.freebsd.org/changeset/base/217489 Log: MFC r215547,r216763,r216819,r216871,r217172: sh testcases. Added: stable/8/tools/regression/bin/sh/builtins/exit1.0 - copied unchanged from r216871, head/tools/regression/bin/sh/builtins/exit1.0 stable/8/tools/regression/bin/sh/builtins/exit2.8 - copied unchanged from r217172, head/tools/regression/bin/sh/builtins/exit2.8 stable/8/tools/regression/bin/sh/builtins/wait3.0 - copied unchanged from r215547, head/tools/regression/bin/sh/builtins/wait3.0 stable/8/tools/regression/bin/sh/expansion/cmdsubst6.0 - copied unchanged from r216763, head/tools/regression/bin/sh/expansion/cmdsubst6.0 stable/8/tools/regression/bin/sh/expansion/cmdsubst8.0 - copied unchanged from r216819, head/tools/regression/bin/sh/expansion/cmdsubst8.0 stable/8/tools/regression/bin/sh/expansion/cmdsubst9.0 - copied unchanged from r216819, head/tools/regression/bin/sh/expansion/cmdsubst9.0 Modified: Directory Properties: stable/8/tools/regression/bin/sh/ (props changed) Copied: stable/8/tools/regression/bin/sh/builtins/exit1.0 (from r216871, head/tools/regression/bin/sh/builtins/exit1.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/tools/regression/bin/sh/builtins/exit1.0 Sun Jan 16 23:41:40 2011 (r217489, copy of r216871, head/tools/regression/bin/sh/builtins/exit1.0) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +# exit with an argument should overwrite the exit status in an EXIT trap. + +trap 'true; exit $?' 0 +false Copied: stable/8/tools/regression/bin/sh/builtins/exit2.8 (from r217172, head/tools/regression/bin/sh/builtins/exit2.8) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/tools/regression/bin/sh/builtins/exit2.8 Sun Jan 16 23:41:40 2011 (r217489, copy of r217172, head/tools/regression/bin/sh/builtins/exit2.8) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +# exit without arguments is the same as exit $? outside a trap. + +trap 'true; true' 0 +(exit 8) +exit Copied: stable/8/tools/regression/bin/sh/builtins/wait3.0 (from r215547, head/tools/regression/bin/sh/builtins/wait3.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/tools/regression/bin/sh/builtins/wait3.0 Sun Jan 16 23:41:40 2011 (r217489, copy of r215547, head/tools/regression/bin/sh/builtins/wait3.0) @@ -0,0 +1,21 @@ +# $FreeBSD$ + +failures= +failure() { + echo "Error at line $1" >&2 + failures=x$failures +} + +T=$(mktemp -d ${TMPDIR:-/tmp}/sh-test.XXXXXX) +trap 'rm -rf $T' 0 +cd $T || exit 3 +mkfifo fifo1 +for i in 1 2 3 4 5 6 7 8 9 10; do + exit $i 4fifo1 +wait || failure $LINENO +(echo >&3) 2>/dev/null && failure $LINENO +wait || failure $LINENO + +test -z "$failures" Copied: stable/8/tools/regression/bin/sh/expansion/cmdsubst6.0 (from r216763, head/tools/regression/bin/sh/expansion/cmdsubst6.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/tools/regression/bin/sh/expansion/cmdsubst6.0 Sun Jan 16 23:41:40 2011 (r217489, copy of r216763, head/tools/regression/bin/sh/expansion/cmdsubst6.0) @@ -0,0 +1,53 @@ +# $FreeBSD$ +# This tests if the cmdsubst optimization is still used if possible. + +failures='' +ok='' + +testcase() { + code="$1" + + unset v + eval "pid=\$(dummy=$code echo \$(\$SH -c echo\ \\\$PPID))" + + if [ "$pid" = "$$" ]; then + ok=x$ok + else + failures=x$failures + echo "Failure for $code" + fi +} + +unset v +w=1 +testcase '$w' +testcase '1${w+1}' +testcase '1${w-1}' +testcase '1${v+1}' +testcase '1${v-1}' +testcase '1${w:+1}' +testcase '1${w:-1}' +testcase '1${v:+1}' +testcase '1${v:-1}' +testcase '${w?}' +testcase '${w:?}' +testcase '${w#x}' +testcase '${w##x}' +testcase '${w%x}' +testcase '${w%%x}' + +testcase '$((w))' +testcase '$(((w+4)*2/3))' +testcase '$((w==1))' +testcase '$((w>=0 && w<=5 && w!=2))' +testcase '$((${#w}))' +testcase '$((${#IFS}))' +testcase '$((${#w}>=1))' +testcase '$(($$))' +testcase '$(($#))' +testcase '$(($?))' + +testcase '$(: $((w=4)))' +testcase '$(: ${v=2})' + +test "x$failures" = x Copied: stable/8/tools/regression/bin/sh/expansion/cmdsubst8.0 (from r216819, head/tools/regression/bin/sh/expansion/cmdsubst8.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/tools/regression/bin/sh/expansion/cmdsubst8.0 Sun Jan 16 23:41:40 2011 (r217489, copy of r216819, head/tools/regression/bin/sh/expansion/cmdsubst8.0) @@ -0,0 +1,17 @@ +# $FreeBSD$ +# Not required by POSIX (although referenced in a non-normative section), +# but possibly useful. + +: hi there & +p=$! +q=$(jobs -l $p) + +# Change tabs to spaces. +set -f +set -- $q +r="$*" + +case $r in +*" $p "*) ;; +*) echo Pid missing; exit 3 ;; +esac Copied: stable/8/tools/regression/bin/sh/expansion/cmdsubst9.0 (from r216819, head/tools/regression/bin/sh/expansion/cmdsubst9.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/tools/regression/bin/sh/expansion/cmdsubst9.0 Sun Jan 16 23:41:40 2011 (r217489, copy of r216819, head/tools/regression/bin/sh/expansion/cmdsubst9.0) @@ -0,0 +1,11 @@ +# $FreeBSD$ + +set -e + +cd / +dummy=$(cd /bin) +[ "$(pwd)" = / ] + +v=1 +dummy=$(eval v=2) +[ "$v" = 1 ] From owner-svn-src-all@FreeBSD.ORG Mon Jan 17 00:08:28 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5CED6106564A; Mon, 17 Jan 2011 00:08:28 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4B5878FC12; Mon, 17 Jan 2011 00:08:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0H08SV1081835; Mon, 17 Jan 2011 00:08:28 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0H08SrX081832; Mon, 17 Jan 2011 00:08:28 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201101170008.p0H08SrX081832@svn.freebsd.org> From: Bruce Cran Date: Mon, 17 Jan 2011 00:08:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217491 - head/usr.sbin/sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jan 2011 00:08:28 -0000 Author: brucec Date: Mon Jan 17 00:08:28 2011 New Revision: 217491 URL: http://svn.freebsd.org/changeset/base/217491 Log: Reduce the amount of text users need to read on each screen. Also try and make it more relevant to modern systems: for example users will be familiar with the MBR but possibly less so with MS-DOS. After installation has finished don't return to the main menu but exit. Modified: head/usr.sbin/sysinstall/install.c head/usr.sbin/sysinstall/menus.c Modified: head/usr.sbin/sysinstall/install.c ============================================================================== --- head/usr.sbin/sysinstall/install.c Sun Jan 16 23:49:19 2011 (r217490) +++ head/usr.sbin/sysinstall/install.c Mon Jan 17 00:08:28 2011 (r217491) @@ -637,10 +637,10 @@ installStandard(dialogMenuItem *self) variable_set2(SYSTEM_STATE, "standard", 0); dialog_clear_norefresh(); #ifdef WITH_SLICES - msgConfirm("In the next menu, you will need to set up a DOS-style (\"fdisk\") partitioning\n" + msgConfirm("In the next menu, you will need to set up an MBR partitioning\n" "scheme for your hard disk. If you simply wish to devote all disk space\n" - "to FreeBSD (overwriting anything else that might be on the disk(s) selected)\n" - "then use the (A)ll command to select the default partitioning scheme followed\n" + "to FreeBSD (overwriting anything else that might be on the disk selected)\n" + "then use the (A)ll command to create a single partition followed\n" "by a (Q)uit. If you wish to allocate only free space to FreeBSD, move to a\n" "partition marked \"unused\" and use the (C)reate command."); @@ -655,7 +655,7 @@ nodisks: goto nodisks; } - msgConfirm("Now you need to create BSD partitions inside of the fdisk partition(s)\n" + msgConfirm("Now you need to create BSD partitions inside of the MBR partition(s)\n" "just created. If you have a reasonable amount of disk space (1GB or more)\n" "and don't have any special requirements, simply use the (A)uto command to\n" "allocate space automatically. If you have more specific needs or just don't\n" @@ -872,6 +872,9 @@ installConfigure(void) if (!msgNoYes("Visit the general configuration menu for a chance to set\n" "any last options?")) dmenuOpenSimple(&MenuConfigure, FALSE); + else + dmenuExit(NULL); + configRC_conf(); sync(); } Modified: head/usr.sbin/sysinstall/menus.c ============================================================================== --- head/usr.sbin/sysinstall/menus.c Sun Jan 16 23:49:19 2011 (r217490) +++ head/usr.sbin/sysinstall/menus.c Mon Jan 17 00:08:28 2011 (r217491) @@ -174,7 +174,7 @@ DMenu MenuIndex = { #ifdef WITH_MICE { " Device, Mouse", "The mouse configuration menu.", NULL, dmenuSubmenu, NULL, &MenuMouse }, #endif - { " Disklabel", "The disk Label editor", NULL, diskLabelEditor }, + { " Disklabel", "The disk label editor", NULL, diskLabelEditor }, { " Dists, All", "Root of the distribution tree.", NULL, dmenuSubmenu, NULL, &MenuDistributions }, { " Dists, Basic", "Basic FreeBSD distribution menu.", NULL, dmenuSubmenu, NULL, &MenuSubDistributions }, { " Dists, Developer", "Select developer's distribution.", checkDistDeveloper, distSetDeveloper }, @@ -213,7 +213,7 @@ DMenu MenuIndex = { { " Media, UFS", "Select UFS installation media.", NULL, mediaSetUFS }, { " Media, FTP", "Select FTP installation media.", NULL, mediaSetFTP }, { " Media, FTP Passive", "Select passive FTP installation media.", NULL, mediaSetFTPPassive }, - { " Media, HTTP", "Select FTP via HTTP proxy installation media.", NULL, mediaSetHTTP }, + { " Media, HTTP", "Select FTP via HTTP proxy install media.", NULL, mediaSetHTTP }, { " Network Interfaces", "Configure network interfaces", NULL, tcpMenuSelect }, { " Networking Services", "The network services menu.", NULL, dmenuSubmenu, NULL, &MenuNetworking }, { " NFS, client", "Set NFS client flag.", dmenuVarCheck, dmenuToggleVariable, NULL, "nfs_client_enable=YES" }, @@ -222,7 +222,7 @@ DMenu MenuIndex = { { " Options", "The options editor.", NULL, optionsEditor }, { " Packages", "The packages collection", NULL, configPackages }, #ifdef WITH_SLICES - { " Partition", "The disk Slice (PC-style partition) Editor", NULL, diskPartitionEditor }, + { " Partition", "The disk slice (PC-style partition) editor", NULL, diskPartitionEditor }, #endif { " PCNFSD", "Run authentication server for PC-NFS.", dmenuVarCheck, configPCNFSD, NULL, "pcnfsd" }, { " Root Password", "Set the system manager's password.", NULL, dmenuSystemCommand, NULL, "passwd root" }, @@ -1209,10 +1209,10 @@ DMenu MenuConfigure = { { " Root Password", "Set the system manager's password", NULL, dmenuSystemCommand, NULL, "passwd root" }, #ifdef WITH_SLICES - { " Fdisk", "The disk Slice (PC-style partition) Editor", + { " Fdisk", "The disk slice (PC-style partition) editor", NULL, diskPartitionEditor }, #endif - { " Label", "The disk Label editor", + { " Label", "The disk label editor", NULL, diskLabelEditor }, { " User Management", "Add user and group information", NULL, dmenuSubmenu, NULL, &MenuUsermgmt }, @@ -1861,9 +1861,6 @@ DMenu MenuSysconsKeymap = { "The system console driver for FreeBSD defaults to a standard\n" "\"PC-98x1\" keyboard map. Users may wish to choose one of the\n" "other keymaps below.\n" - "Note that sysinstall itself only uses the part of the keyboard map\n" - "which is required to generate the ANSI character subset, but your\n" - "choice of keymap will also be saved for later (fuller) use.", "Choose a keyboard map", NULL, { { "Japanese PC-98x1", "Japanese PC-98x1 keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=jp.pc98" }, @@ -1875,12 +1872,8 @@ DMenu MenuSysconsKeymap = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "System Console Keymap", "The system console driver for FreeBSD defaults to a standard\n" - "\"American\" keyboard map. Users in other countries (or with\n" - "different keyboard preferences) may wish to choose one of the\n" - "other keymaps below.\n" - "Note that sysinstall itself only uses the part of the keyboard map\n" - "which is required to generate the ANSI character subset, but your\n" - "choice of keymap will also be saved for later (fuller) use.", + "\"US\" keyboard map. Users may wish to choose one of the\n" + "other keymaps below.", "Choose a keyboard map", NULL, { { "Belgian", "Belgian ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=be.iso" }, From owner-svn-src-all@FreeBSD.ORG Mon Jan 17 00:15:01 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C1471065670; Mon, 17 Jan 2011 00:15:01 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 68CA18FC0A; Mon, 17 Jan 2011 00:15:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0H0F1Q2082036; Mon, 17 Jan 2011 00:15:01 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0H0F1Aj082034; Mon, 17 Jan 2011 00:15:01 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201101170015.p0H0F1Aj082034@svn.freebsd.org> From: Bruce Cran Date: Mon, 17 Jan 2011 00:15: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: r217492 - head/usr.sbin/sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jan 2011 00:15:01 -0000 Author: brucec Date: Mon Jan 17 00:15:01 2011 New Revision: 217492 URL: http://svn.freebsd.org/changeset/base/217492 Log: Add missing comma to unbreak the PC98 build. Modified: head/usr.sbin/sysinstall/menus.c Modified: head/usr.sbin/sysinstall/menus.c ============================================================================== --- head/usr.sbin/sysinstall/menus.c Mon Jan 17 00:08:28 2011 (r217491) +++ head/usr.sbin/sysinstall/menus.c Mon Jan 17 00:15:01 2011 (r217492) @@ -1860,7 +1860,7 @@ DMenu MenuSysconsKeymap = { "System Console Keymap", "The system console driver for FreeBSD defaults to a standard\n" "\"PC-98x1\" keyboard map. Users may wish to choose one of the\n" - "other keymaps below.\n" + "other keymaps below.", "Choose a keyboard map", NULL, { { "Japanese PC-98x1", "Japanese PC-98x1 keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=jp.pc98" }, From owner-svn-src-all@FreeBSD.ORG Mon Jan 17 00:59:05 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0156F106566C; Mon, 17 Jan 2011 00:59:05 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D98DC8FC15; Mon, 17 Jan 2011 00:59:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0H0x4TR083044; Mon, 17 Jan 2011 00:59:04 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0H0x4LP083041; Mon, 17 Jan 2011 00:59:04 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201101170059.p0H0x4LP083041@svn.freebsd.org> From: Rick Macklem Date: Mon, 17 Jan 2011 00:59:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217493 - stable/8/sys/fs/nfsserver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jan 2011 00:59:05 -0000 Author: rmacklem Date: Mon Jan 17 00:59:04 2011 New Revision: 217493 URL: http://svn.freebsd.org/changeset/base/217493 Log: MFC: r216897 Modify the experimental NFSv4 server so that the lookup ops return a locked vnode. This ensures that the associated mount point will always be valid for the code that follows the operation. Also add a couple of additional checks for non-error to the other functions that create file objects. Modified: stable/8/sys/fs/nfsserver/nfs_nfsdserv.c stable/8/sys/fs/nfsserver/nfs_nfsdsocket.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/fs/nfsserver/nfs_nfsdserv.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdserv.c Mon Jan 17 00:15:01 2011 (r217492) +++ stable/8/sys/fs/nfsserver/nfs_nfsdserv.c Mon Jan 17 00:59:04 2011 (r217493) @@ -470,12 +470,10 @@ nfsrvd_lookup(struct nfsrv_descript *nd, nd->nd_repstat = nfsvno_getfh(vp, fhp, p); if (!(nd->nd_flag & ND_NFSV4) && !nd->nd_repstat) nd->nd_repstat = nfsvno_getattr(vp, &nva, nd->nd_cred, p, 1); - if (vpp) { - NFSVOPUNLOCK(vp, 0, p); + if (vpp != NULL && nd->nd_repstat == 0) *vpp = vp; - } else { + else vput(vp); - } if (dirp) { if (nd->nd_flag & ND_NFSV3) dattr_ret = nfsvno_getattr(dirp, &dattr, nd->nd_cred, @@ -1218,12 +1216,11 @@ nfsrvd_mknod(struct nfsrv_descript *nd, if ((nd->nd_flag & ND_NFSV3) && !nd->nd_repstat) nd->nd_repstat = nfsvno_getattr(vp, &nva, nd->nd_cred, p, 1); - if (vpp) { - NFSVOPUNLOCK(vp, 0, p); + if (vpp != NULL && nd->nd_repstat == 0) { + VOP_UNLOCK(vp, 0); *vpp = vp; - } else { + } else vput(vp); - } } diraft_ret = nfsvno_getattr(dirp, &diraft, nd->nd_cred, p, 0); @@ -1706,12 +1703,11 @@ nfsrvd_symlinksub(struct nfsrv_descript nd->nd_repstat = nfsvno_getattr(ndp->ni_vp, nvap, nd->nd_cred, p, 1); } - if (vpp) { - NFSVOPUNLOCK(ndp->ni_vp, 0, p); + if (vpp != NULL && nd->nd_repstat == 0) { + VOP_UNLOCK(ndp->ni_vp, 0); *vpp = ndp->ni_vp; - } else { + } else vput(ndp->ni_vp); - } } if (dirp) { *diraft_retp = nfsvno_getattr(dirp, diraftp, nd->nd_cred, p, 0); Modified: stable/8/sys/fs/nfsserver/nfs_nfsdsocket.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdsocket.c Mon Jan 17 00:15:01 2011 (r217492) +++ stable/8/sys/fs/nfsserver/nfs_nfsdsocket.c Mon Jan 17 00:59:04 2011 (r217493) @@ -861,10 +861,14 @@ nfsrvd_compound(struct nfsrv_descript *n nfsvno_lockvfs(mp); } } + if (op == NFSV4OP_LOOKUP || op == NFSV4OP_LOOKUPP) + /* Lookup ops return a locked vnode */ + VOP_UNLOCK(nvp, 0); if (!nd->nd_repstat) { vrele(vp); vp = nvp; - } + } else + vrele(nvp); } if (nfsv4_opflag[op].modifyfs) NFS_ENDWRITE(mp); From owner-svn-src-all@FreeBSD.ORG Mon Jan 17 01:11:07 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 21A751065670; Mon, 17 Jan 2011 01:11:07 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 106CD8FC13; Mon, 17 Jan 2011 01:11:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0H1B6Ct083377; Mon, 17 Jan 2011 01:11:06 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0H1B6wM083375; Mon, 17 Jan 2011 01:11:06 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201101170111.p0H1B6wM083375@svn.freebsd.org> From: Rick Macklem Date: Mon, 17 Jan 2011 01:11:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217494 - stable/8/sys/fs/nfsserver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jan 2011 01:11:07 -0000 Author: rmacklem Date: Mon Jan 17 01:11:06 2011 New Revision: 217494 URL: http://svn.freebsd.org/changeset/base/217494 Log: MFC: r216898 Fix the experimental NFS server so that it doesn't leak a reference count on the directory when creating device special files. Modified: stable/8/sys/fs/nfsserver/nfs_nfsdport.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdport.c Mon Jan 17 00:59:04 2011 (r217493) +++ stable/8/sys/fs/nfsserver/nfs_nfsdport.c Mon Jan 17 01:11:06 2011 (r217494) @@ -857,8 +857,7 @@ nfsvno_mknod(struct nameidata *ndp, stru &ndp->ni_cnd, &nvap->na_vattr); vput(ndp->ni_dvp); nfsvno_relpathbuf(ndp); - if (error) - vrele(ndp->ni_startdir); + vrele(ndp->ni_startdir); /* * Since VOP_MKNOD returns the ni_vp, I can't * see any reason to do the lookup. From owner-svn-src-all@FreeBSD.ORG Mon Jan 17 01:26:13 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 85278106564A; Mon, 17 Jan 2011 01:26:13 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 71DD68FC15; Mon, 17 Jan 2011 01:26:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0H1QDKm083728; Mon, 17 Jan 2011 01:26:13 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0H1QDZa083717; Mon, 17 Jan 2011 01:26:13 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201101170126.p0H1QDZa083717@svn.freebsd.org> From: Rick Macklem Date: Mon, 17 Jan 2011 01:26:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217495 - in stable/8/sys: conf fs/nfsclient fs/nfsserver nfs nfsclient nlm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jan 2011 01:26:13 -0000 Author: rmacklem Date: Mon Jan 17 01:26:13 2011 New Revision: 217495 URL: http://svn.freebsd.org/changeset/base/217495 Log: MFC: r216931 Fix the nlm so that it no longer depends on the regular nfs client and, as such, can be loaded for the experimental nfs client without the regular client. Modified: stable/8/sys/conf/files stable/8/sys/fs/nfsclient/nfs_clvfsops.c stable/8/sys/fs/nfsclient/nfsmount.h stable/8/sys/fs/nfsserver/nfs_nfsdport.c stable/8/sys/nfs/nfs_lock.c stable/8/sys/nfs/nfs_mountcommon.h stable/8/sys/nfsclient/nfs_vfsops.c stable/8/sys/nfsclient/nfsmount.h stable/8/sys/nlm/nlm_advlock.c stable/8/sys/nlm/nlm_prot_impl.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/conf/files ============================================================================== --- stable/8/sys/conf/files Mon Jan 17 01:11:06 2011 (r217494) +++ stable/8/sys/conf/files Mon Jan 17 01:26:13 2011 (r217495) @@ -2659,7 +2659,7 @@ netsmb/smb_subr.c optional netsmb netsmb/smb_trantcp.c optional netsmb netsmb/smb_usr.c optional netsmb nfs/nfs_common.c optional nfsclient | nfsserver -nfs/nfs_lock.c optional nfsclient | nfscl +nfs/nfs_lock.c optional nfsclient | nfscl | nfslockd | nfsd nfsclient/bootp_subr.c optional bootp nfsclient nfsclient/krpc_subr.c optional bootp nfsclient nfsclient/nfs_bio.c optional nfsclient @@ -2675,7 +2675,7 @@ nfsserver/nfs_serv.c optional nfsserver nfsserver/nfs_srvkrpc.c optional nfsserver nfsserver/nfs_srvsubs.c optional nfsserver nfs/nfs_nfssvc.c optional nfsserver | nfscl | nfsd -nlm/nlm_advlock.c optional nfslockd nfsclient | nfsd nfsclient +nlm/nlm_advlock.c optional nfslockd | nfsd nlm/nlm_prot_clnt.c optional nfslockd | nfsd nlm/nlm_prot_impl.c optional nfslockd | nfsd nlm/nlm_prot_server.c optional nfslockd | nfsd Modified: stable/8/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clvfsops.c Mon Jan 17 01:11:06 2011 (r217494) +++ stable/8/sys/fs/nfsclient/nfs_clvfsops.c Mon Jan 17 01:26:13 2011 (r217495) @@ -102,7 +102,8 @@ static int mountnfs(struct nfs_args *, s struct sockaddr *, char *, u_char *, u_char *, u_char *, struct vnode **, struct ucred *, struct thread *, int); static void nfs_getnlminfo(struct vnode *, uint8_t *, size_t *, - struct sockaddr_storage *, int *, off_t *); + struct sockaddr_storage *, int *, off_t *, + struct timeval *); static vfs_mount_t nfs_mount; static vfs_cmount_t nfs_cmount; static vfs_unmount_t nfs_unmount; @@ -1123,6 +1124,7 @@ mountnfs(struct nfs_args *argp, struct m mtx_init(&nmp->nm_sockreq.nr_mtx, "nfssock", NULL, MTX_DEF); mp->mnt_data = nmp; nmp->nm_getinfo = nfs_getnlminfo; + nmp->nm_vinvalbuf = ncl_vinvalbuf; } vfs_getnewfsid(mp); nmp->nm_mountp = mp; @@ -1465,7 +1467,8 @@ nfs_sysctl(struct mount *mp, fsctlop_t o */ static void nfs_getnlminfo(struct vnode *vp, uint8_t *fhp, size_t *fhlenp, - struct sockaddr_storage *sp, int *is_v3p, off_t *sizep) + struct sockaddr_storage *sp, int *is_v3p, off_t *sizep, + struct timeval *timeop) { struct nfsmount *nmp; struct nfsnode *np = VTONFS(vp); @@ -1481,5 +1484,9 @@ nfs_getnlminfo(struct vnode *vp, uint8_t *is_v3p = NFS_ISV3(vp); if (sizep != NULL) *sizep = np->n_size; + if (timeop != NULL) { + timeop->tv_sec = nmp->nm_timeo / NFS_HZ; + timeop->tv_usec = (nmp->nm_timeo % NFS_HZ) * (1000000 / NFS_HZ); + } } Modified: stable/8/sys/fs/nfsclient/nfsmount.h ============================================================================== --- stable/8/sys/fs/nfsclient/nfsmount.h Mon Jan 17 01:11:06 2011 (r217494) +++ stable/8/sys/fs/nfsclient/nfsmount.h Mon Jan 17 01:26:13 2011 (r217495) @@ -94,6 +94,7 @@ struct nfsmount { #define nm_retry nm_com.nmcom_retry #define nm_hostname nm_com.nmcom_hostname #define nm_getinfo nm_com.nmcom_getinfo +#define nm_vinvalbuf nm_com.nmcom_vinvalbuf #define NFSMNT_DIRPATH(m) (&((m)->nm_name[(m)->nm_krbnamelen + 1])) #define NFSMNT_SRVKRBNAME(m) \ Modified: stable/8/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdport.c Mon Jan 17 01:11:06 2011 (r217494) +++ stable/8/sys/fs/nfsserver/nfs_nfsdport.c Mon Jan 17 01:26:13 2011 (r217495) @@ -3142,6 +3142,7 @@ DECLARE_MODULE(nfsd, nfsd_mod, SI_SUB_VF /* So that loader and kldload(2) can find us, wherever we are.. */ MODULE_VERSION(nfsd, 1); MODULE_DEPEND(nfsd, nfscommon, 1, 1, 1); +MODULE_DEPEND(nfsd, nfslock, 1, 1, 1); MODULE_DEPEND(nfsd, nfslockd, 1, 1, 1); MODULE_DEPEND(nfsd, krpc, 1, 1, 1); MODULE_DEPEND(nfsd, nfssvc, 1, 1, 1); Modified: stable/8/sys/nfs/nfs_lock.c ============================================================================== --- stable/8/sys/nfs/nfs_lock.c Mon Jan 17 01:11:06 2011 (r217494) +++ stable/8/sys/nfs/nfs_lock.c Mon Jan 17 01:26:13 2011 (r217495) @@ -251,7 +251,7 @@ nfs_dolock(struct vop_advlock_args *ap) ASSERT_VOP_LOCKED(vp, "nfs_dolock"); nmp->nm_getinfo(vp, msg.lm_fh, &msg.lm_fh_len, &msg.lm_addr, - &msg.lm_nfsv3, NULL); + &msg.lm_nfsv3, NULL, NULL); VOP_UNLOCK(vp, 0); /* Modified: stable/8/sys/nfs/nfs_mountcommon.h ============================================================================== --- stable/8/sys/nfs/nfs_mountcommon.h Mon Jan 17 01:11:06 2011 (r217494) +++ stable/8/sys/nfs/nfs_mountcommon.h Mon Jan 17 01:26:13 2011 (r217495) @@ -35,7 +35,9 @@ * a mechanism for getting the client specific info for an nfs vnode. */ typedef void nfs_getinfofromvp_ftype(struct vnode *, uint8_t *, size_t *, - struct sockaddr_storage *, int *, off_t *); + struct sockaddr_storage *, int *, off_t *, + struct timeval *); +typedef int nfs_vinvalbuf_ftype(struct vnode *, int, struct thread *, int); struct nfsmount_common { struct mtx nmcom_mtx; @@ -46,6 +48,7 @@ struct nfsmount_common { int nmcom_retry; /* Max retries */ char nmcom_hostname[MNAMELEN]; /* server's name */ nfs_getinfofromvp_ftype *nmcom_getinfo; /* Get info from nfsnode */ + nfs_vinvalbuf_ftype *nmcom_vinvalbuf; /* Invalidate buffers */ }; #endif /* _NFS_MOUNTCOMMON_H_ */ Modified: stable/8/sys/nfsclient/nfs_vfsops.c ============================================================================== --- stable/8/sys/nfsclient/nfs_vfsops.c Mon Jan 17 01:11:06 2011 (r217494) +++ stable/8/sys/nfsclient/nfs_vfsops.c Mon Jan 17 01:26:13 2011 (r217495) @@ -116,7 +116,8 @@ static int mountnfs(struct nfs_args *, s struct sockaddr *, char *, struct vnode **, struct ucred *cred, int); static void nfs_getnlminfo(struct vnode *, uint8_t *, size_t *, - struct sockaddr_storage *, int *, off_t *); + struct sockaddr_storage *, int *, off_t *, + struct timeval *); static vfs_mount_t nfs_mount; static vfs_cmount_t nfs_cmount; static vfs_unmount_t nfs_unmount; @@ -1205,6 +1206,7 @@ mountnfs(struct nfs_args *argp, struct m TAILQ_INIT(&nmp->nm_bufq); mp->mnt_data = nmp; nmp->nm_getinfo = nfs_getnlminfo; + nmp->nm_vinvalbuf = nfs_vinvalbuf; } vfs_getnewfsid(mp); nmp->nm_mountp = mp; @@ -1499,7 +1501,8 @@ nfs_sysctl(struct mount *mp, fsctlop_t o */ static void nfs_getnlminfo(struct vnode *vp, uint8_t *fhp, size_t *fhlenp, - struct sockaddr_storage *sp, int *is_v3p, off_t *sizep) + struct sockaddr_storage *sp, int *is_v3p, off_t *sizep, + struct timeval *timeop) { struct nfsmount *nmp; struct nfsnode *np = VTONFS(vp); @@ -1515,5 +1518,9 @@ nfs_getnlminfo(struct vnode *vp, uint8_t *is_v3p = NFS_ISV3(vp); if (sizep != NULL) *sizep = np->n_size; + if (timeop != NULL) { + timeop->tv_sec = nmp->nm_timeo / NFS_HZ; + timeop->tv_usec = (nmp->nm_timeo % NFS_HZ) * (1000000 / NFS_HZ); + } } Modified: stable/8/sys/nfsclient/nfsmount.h ============================================================================== --- stable/8/sys/nfsclient/nfsmount.h Mon Jan 17 01:11:06 2011 (r217494) +++ stable/8/sys/nfsclient/nfsmount.h Mon Jan 17 01:26:13 2011 (r217495) @@ -100,6 +100,7 @@ struct nfsmount { #define nm_retry nm_com.nmcom_retry #define nm_hostname nm_com.nmcom_hostname #define nm_getinfo nm_com.nmcom_getinfo +#define nm_vinvalbuf nm_com.nmcom_vinvalbuf #if defined(_KERNEL) /* Modified: stable/8/sys/nlm/nlm_advlock.c ============================================================================== --- stable/8/sys/nlm/nlm_advlock.c Mon Jan 17 01:11:06 2011 (r217494) +++ stable/8/sys/nlm/nlm_advlock.c Mon Jan 17 01:26:13 2011 (r217495) @@ -217,20 +217,18 @@ nlm_advlock_internal(struct vnode *vp, v ASSERT_VOP_LOCKED(vp, "nlm_advlock_1"); + nmp = VFSTONFS(vp->v_mount); /* * Push any pending writes to the server and flush our cache * so that if we are contending with another machine for a * file, we get whatever they wrote and vice-versa. */ if (op == F_SETLK || op == F_UNLCK) - nfs_vinvalbuf(vp, V_SAVE, td, 1); + nmp->nm_vinvalbuf(vp, V_SAVE, td, 1); - nmp = VFSTONFS(vp->v_mount); strcpy(servername, nmp->nm_hostname); - nmp->nm_getinfo(vp, fh.fh_bytes, &fhlen, &ss, &is_v3, &size); + nmp->nm_getinfo(vp, fh.fh_bytes, &fhlen, &ss, &is_v3, &size, &timo); sa = (struct sockaddr *) &ss; - timo.tv_sec = nmp->nm_timeo / NFS_HZ; - timo.tv_usec = (nmp->nm_timeo % NFS_HZ) * (1000000 / NFS_HZ); if (is_v3 != 0) vers = NLM_VERS4; else Modified: stable/8/sys/nlm/nlm_prot_impl.c ============================================================================== --- stable/8/sys/nlm/nlm_prot_impl.c Mon Jan 17 01:11:06 2011 (r217494) +++ stable/8/sys/nlm/nlm_prot_impl.c Mon Jan 17 01:26:13 2011 (r217495) @@ -2309,6 +2309,5 @@ DECLARE_MODULE(nfslockd, nfslockd_mod, S /* So that loader and kldload(2) can find us, wherever we are.. */ MODULE_DEPEND(nfslockd, krpc, 1, 1, 1); -MODULE_DEPEND(nfslockd, nfs, 1, 1, 1); MODULE_DEPEND(nfslockd, nfslock, 1, 1, 1); MODULE_VERSION(nfslockd, 1); From owner-svn-src-all@FreeBSD.ORG Mon Jan 17 01:37:39 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D21591065670; Mon, 17 Jan 2011 01:37:39 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 77D3A8FC13; Mon, 17 Jan 2011 01:37:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0H1bd9X083995; Mon, 17 Jan 2011 01:37:39 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0H1bdvY083993; Mon, 17 Jan 2011 01:37:39 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201101170137.p0H1bdvY083993@svn.freebsd.org> From: Rick Macklem Date: Mon, 17 Jan 2011 01:37:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217496 - stable/8/sys/fs/nfsserver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jan 2011 01:37:39 -0000 Author: rmacklem Date: Mon Jan 17 01:37:39 2011 New Revision: 217496 URL: http://svn.freebsd.org/changeset/base/217496 Log: MFC: r217017 Fix the experimental NFS server to use vfs_busyfs() instead of vfs_getvfs() so that the mount point is busied for the VFS_FHTOVP() call. This is analagous to r185432 for the regular NFS server. Modified: stable/8/sys/fs/nfsserver/nfs_nfsdport.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdport.c Mon Jan 17 01:26:13 2011 (r217495) +++ stable/8/sys/fs/nfsserver/nfs_nfsdport.c Mon Jan 17 01:37:39 2011 (r217496) @@ -2548,8 +2548,8 @@ nfsd_fhtovp(struct nfsrv_descript *nd, s /* * Check for the special case of the nfsv4root_fh. */ - mp = vfs_getvfs(&fhp->fh_fsid); - if (!mp) { + mp = vfs_busyfs(&fhp->fh_fsid); + if (mp == NULL) { *vpp = NULL; nd->nd_repstat = ESTALE; if (*mpp && exp->nes_vfslocked) @@ -2575,6 +2575,7 @@ nfsd_fhtovp(struct nfsrv_descript *nd, s nd->nd_repstat = nfsvno_fhtovp(mp, fhp, nd->nd_nam, lktype, vpp, exp, &credanon); + vfs_unbusy(mp); /* * For NFSv4 without a pseudo root fs, unexported file handles @@ -2636,11 +2637,8 @@ nfsd_fhtovp(struct nfsrv_descript *nd, s VFS_UNLOCK_GIANT(mp); exp->nes_vfslocked = 0; } - vfs_rel(mp); *vpp = NULL; *mpp = NULL; - } else { - vfs_rel(mp); } } @@ -2780,10 +2778,11 @@ nfsvno_getvp(fhandle_t *fhp) struct vnode *vp; int error; - mp = vfs_getvfs(&fhp->fh_fsid); + mp = vfs_busyfs(&fhp->fh_fsid); if (mp == NULL) return (NULL); error = VFS_FHTOVP(mp, &fhp->fh_fid, &vp); + vfs_unbusy(mp); if (error) return (NULL); return (vp); From owner-svn-src-all@FreeBSD.ORG Mon Jan 17 01:49:48 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00A84106566C; Mon, 17 Jan 2011 01:49:48 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D8CF08FC17; Mon, 17 Jan 2011 01:49:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0H1nlU1084284; Mon, 17 Jan 2011 01:49:47 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0H1nlV0084282; Mon, 17 Jan 2011 01:49:47 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201101170149.p0H1nlV0084282@svn.freebsd.org> From: Rick Macklem Date: Mon, 17 Jan 2011 01:49:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217497 - stable/8/sys/fs/nfsserver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jan 2011 01:49:48 -0000 Author: rmacklem Date: Mon Jan 17 01:49:47 2011 New Revision: 217497 URL: http://svn.freebsd.org/changeset/base/217497 Log: MFC: r217023 Modify the experimental NFS server so that it calls vn_start_write() with a non-NULL vp. That way it will find the correct mount point mp and use that mp for the subsequent vn_finished_write() call. Also, it should fail without crashing if the mount point is being forced dismounted because vn_start_write() will set the mp NULL via VOP_GETWRITEMOUNT(). Modified: stable/8/sys/fs/nfsserver/nfs_nfsdsocket.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/fs/nfsserver/nfs_nfsdsocket.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdsocket.c Mon Jan 17 01:37:39 2011 (r217496) +++ stable/8/sys/fs/nfsserver/nfs_nfsdsocket.c Mon Jan 17 01:49:47 2011 (r217497) @@ -498,7 +498,7 @@ nfsrvd_compound(struct nfsrv_descript *n u_char tag[NFSV4_SMALLSTR + 1], *tagstr; vnode_t vp, nvp, savevp; struct nfsrvfh fh; - mount_t mp, savemp; + mount_t mp, savemp, temp_mp = NULL; struct ucred *credanon; struct nfsexstuff nes, vpnes, savevpnes; static u_int64_t compref = 0; @@ -837,7 +837,7 @@ nfsrvd_compound(struct nfsrv_descript *n } VREF(vp); if (nfsv4_opflag[op].modifyfs) - NFS_STARTWRITE(NULL, &mp); + vn_start_write(vp, &temp_mp, V_WAIT); error = (*(nfsrv4_ops1[op]))(nd, isdgram, vp, &nvp, (fhandle_t *)fh.nfsrvfh_data, p, &vpnes); if (!error && !nd->nd_repstat) { @@ -871,7 +871,7 @@ nfsrvd_compound(struct nfsrv_descript *n vrele(nvp); } if (nfsv4_opflag[op].modifyfs) - NFS_ENDWRITE(mp); + vn_finished_write(temp_mp); } else if (nfsv4_opflag[op].retfh == 2) { if (vp == NULL || savevp == NULL) { nd->nd_repstat = NFSERR_NOFILEHANDLE; @@ -881,7 +881,7 @@ nfsrvd_compound(struct nfsrv_descript *n break; } if (nfsv4_opflag[op].modifyfs) - NFS_STARTWRITE(NULL, &mp); + vn_start_write(savevp, &temp_mp, V_WAIT); if (vn_lock(savevp, LK_EXCLUSIVE) == 0) { VREF(vp); VREF(savevp); @@ -890,14 +890,15 @@ nfsrvd_compound(struct nfsrv_descript *n } else nd->nd_repstat = NFSERR_PERM; if (nfsv4_opflag[op].modifyfs) - NFS_ENDWRITE(mp); + vn_finished_write(temp_mp); } else { if (nfsv4_opflag[op].retfh != 0) panic("nfsrvd_compound"); if (nfsv4_opflag[op].needscfh) { if (vp != NULL) { if (nfsv4_opflag[op].modifyfs) - NFS_STARTWRITE(NULL, &mp); + vn_start_write(vp, &temp_mp, + V_WAIT); if (vn_lock(vp, nfsv4_opflag[op].lktype) == 0) VREF(vp); @@ -921,7 +922,7 @@ nfsrvd_compound(struct nfsrv_descript *n error = (*(nfsrv4_ops0[op]))(nd, isdgram, vp, p, &vpnes); if (nfsv4_opflag[op].modifyfs) - NFS_ENDWRITE(mp); + vn_finished_write(temp_mp); } else { error = (*(nfsrv4_ops0[op]))(nd, isdgram, NULL, p, &vpnes); From owner-svn-src-all@FreeBSD.ORG Mon Jan 17 02:23:51 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 17C9F106564A; Mon, 17 Jan 2011 02:23:51 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 071158FC0A; Mon, 17 Jan 2011 02:23:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0H2NoPu085137; Mon, 17 Jan 2011 02:23:50 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0H2NobN085134; Mon, 17 Jan 2011 02:23:50 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201101170223.p0H2NobN085134@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 17 Jan 2011 02:23:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217498 - in head/sys: dev/re pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jan 2011 02:23:51 -0000 Author: yongari Date: Mon Jan 17 02:23:50 2011 New Revision: 217498 URL: http://svn.freebsd.org/changeset/base/217498 Log: Add initial support for RTL8168E/8111E-VL PCIe GbE. H/W donated by: Realtek Semiconductor Corp. Modified: head/sys/dev/re/if_re.c head/sys/pci/if_rlreg.h Modified: head/sys/dev/re/if_re.c ============================================================================== --- head/sys/dev/re/if_re.c Mon Jan 17 01:49:47 2011 (r217497) +++ head/sys/dev/re/if_re.c Mon Jan 17 02:23:50 2011 (r217498) @@ -221,6 +221,7 @@ static struct rl_hwrev re_hwrevs[] = { { RL_HWREV_8168D, RL_8169, "8168D/8111D"}, { RL_HWREV_8168DP, RL_8169, "8168DP/8111DP"}, { RL_HWREV_8168E, RL_8169, "8168E/8111E"}, + { RL_HWREV_8168E_VL, RL_8169, "8168E/8111E-VL"}, { 0, 0, NULL } }; @@ -1346,6 +1347,11 @@ re_attach(device_t dev) RL_FLAG_PAR | RL_FLAG_DESCV2 | RL_FLAG_MACSTAT | RL_FLAG_CMDSTOP | RL_FLAG_AUTOPAD | RL_FLAG_NOJUMBO; break; + case RL_HWREV_8168E_VL: + sc->rl_flags |= RL_FLAG_PHYWAKE | RL_FLAG_PAR | + RL_FLAG_DESCV2 | RL_FLAG_MACSTAT | RL_FLAG_CMDSTOP | + RL_FLAG_AUTOPAD | RL_FLAG_NOJUMBO; + break; case RL_HWREV_8169_8110SB: case RL_HWREV_8169_8110SBL: case RL_HWREV_8169_8110SC: Modified: head/sys/pci/if_rlreg.h ============================================================================== --- head/sys/pci/if_rlreg.h Mon Jan 17 01:49:47 2011 (r217497) +++ head/sys/pci/if_rlreg.h Mon Jan 17 02:23:50 2011 (r217498) @@ -165,6 +165,7 @@ #define RL_HWREV_8168D 0x28000000 #define RL_HWREV_8168DP 0x28800000 #define RL_HWREV_8168E 0x2C000000 +#define RL_HWREV_8168E_VL 0x2C800000 #define RL_HWREV_8168_SPIN1 0x30000000 #define RL_HWREV_8100E 0x30800000 #define RL_HWREV_8101E 0x34000000 From owner-svn-src-all@FreeBSD.ORG Mon Jan 17 03:24:34 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 25763106564A; Mon, 17 Jan 2011 03:24:34 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1337A8FC17; Mon, 17 Jan 2011 03:24:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0H3OYia086691; Mon, 17 Jan 2011 03:24:34 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0H3OY5U086688; Mon, 17 Jan 2011 03:24:34 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201101170324.p0H3OY5U086688@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 17 Jan 2011 03:24:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217499 - in head/sys: dev/re pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jan 2011 03:24:34 -0000 Author: yongari Date: Mon Jan 17 03:24:33 2011 New Revision: 217499 URL: http://svn.freebsd.org/changeset/base/217499 Log: Implement initial jumbo frame support for RTL8168/8111 C/D/E PCIe GbE controllers. It seems these controllers no longer support multi-fragmented RX buffers such that driver have to allocate physically contiguous buffers. o Retire RL_FLAG_NOJUMBO flag and introduce RL_FLAG_JUMBOV2 to mark controllers that use new jumbo frame scheme. o Configure PCIe max read request size to 4096 for standard frames and reduce it to 512 for jumbo frames. o TSO/checksum offloading is not supported for jumbo frames on these controllers. Reflect it to ioctl handler and driver initialization. o Remove unused rl_stats_no_timeout in softc. o Embed a pointer to structure rl_hwrev into softc to keep track of controller MTU limitation and remove rl_hwrev in softc since that information is available through a pointer to structure rl_hwrev. Special thanks to Realtek for donating sample hardwares which made this possible. H/W donated by: Realtek Semiconductor Corp. Modified: head/sys/dev/re/if_re.c head/sys/pci/if_rlreg.h Modified: head/sys/dev/re/if_re.c ============================================================================== --- head/sys/dev/re/if_re.c Mon Jan 17 02:23:50 2011 (r217498) +++ head/sys/dev/re/if_re.c Mon Jan 17 03:24:33 2011 (r217499) @@ -189,40 +189,40 @@ static struct rl_type re_devs[] = { }; static struct rl_hwrev re_hwrevs[] = { - { RL_HWREV_8139, RL_8139, "" }, - { RL_HWREV_8139A, RL_8139, "A" }, - { RL_HWREV_8139AG, RL_8139, "A-G" }, - { RL_HWREV_8139B, RL_8139, "B" }, - { RL_HWREV_8130, RL_8139, "8130" }, - { RL_HWREV_8139C, RL_8139, "C" }, - { RL_HWREV_8139D, RL_8139, "8139D/8100B/8100C" }, - { RL_HWREV_8139CPLUS, RL_8139CPLUS, "C+"}, - { RL_HWREV_8168_SPIN1, RL_8169, "8168"}, - { RL_HWREV_8169, RL_8169, "8169"}, - { RL_HWREV_8169S, RL_8169, "8169S"}, - { RL_HWREV_8110S, RL_8169, "8110S"}, - { RL_HWREV_8169_8110SB, RL_8169, "8169SB/8110SB"}, - { RL_HWREV_8169_8110SC, RL_8169, "8169SC/8110SC"}, - { RL_HWREV_8169_8110SBL, RL_8169, "8169SBL/8110SBL"}, - { RL_HWREV_8169_8110SCE, RL_8169, "8169SC/8110SC"}, - { RL_HWREV_8100, RL_8139, "8100"}, - { RL_HWREV_8101, RL_8139, "8101"}, - { RL_HWREV_8100E, RL_8169, "8100E"}, - { RL_HWREV_8101E, RL_8169, "8101E"}, - { RL_HWREV_8102E, RL_8169, "8102E"}, - { RL_HWREV_8102EL, RL_8169, "8102EL"}, - { RL_HWREV_8102EL_SPIN1, RL_8169, "8102EL"}, - { RL_HWREV_8103E, RL_8169, "8103E"}, - { RL_HWREV_8168_SPIN2, RL_8169, "8168"}, - { RL_HWREV_8168_SPIN3, RL_8169, "8168"}, - { RL_HWREV_8168C, RL_8169, "8168C/8111C"}, - { RL_HWREV_8168C_SPIN2, RL_8169, "8168C/8111C"}, - { RL_HWREV_8168CP, RL_8169, "8168CP/8111CP"}, - { RL_HWREV_8168D, RL_8169, "8168D/8111D"}, - { RL_HWREV_8168DP, RL_8169, "8168DP/8111DP"}, - { RL_HWREV_8168E, RL_8169, "8168E/8111E"}, - { RL_HWREV_8168E_VL, RL_8169, "8168E/8111E-VL"}, - { 0, 0, NULL } + { RL_HWREV_8139, RL_8139, "", RL_MTU }, + { RL_HWREV_8139A, RL_8139, "A", RL_MTU }, + { RL_HWREV_8139AG, RL_8139, "A-G", RL_MTU }, + { RL_HWREV_8139B, RL_8139, "B", RL_MTU }, + { RL_HWREV_8130, RL_8139, "8130", RL_MTU }, + { RL_HWREV_8139C, RL_8139, "C", RL_MTU }, + { RL_HWREV_8139D, RL_8139, "8139D/8100B/8100C", RL_MTU }, + { RL_HWREV_8139CPLUS, RL_8139CPLUS, "C+", RL_MTU }, + { RL_HWREV_8168_SPIN1, RL_8169, "8168", RL_JUMBO_MTU }, + { RL_HWREV_8169, RL_8169, "8169", RL_JUMBO_MTU }, + { RL_HWREV_8169S, RL_8169, "8169S", RL_JUMBO_MTU }, + { RL_HWREV_8110S, RL_8169, "8110S", RL_JUMBO_MTU }, + { RL_HWREV_8169_8110SB, RL_8169, "8169SB/8110SB", RL_JUMBO_MTU }, + { RL_HWREV_8169_8110SC, RL_8169, "8169SC/8110SC", RL_JUMBO_MTU }, + { RL_HWREV_8169_8110SBL, RL_8169, "8169SBL/8110SBL", RL_JUMBO_MTU }, + { RL_HWREV_8169_8110SCE, RL_8169, "8169SC/8110SC", RL_JUMBO_MTU }, + { RL_HWREV_8100, RL_8139, "8100", RL_MTU }, + { RL_HWREV_8101, RL_8139, "8101", RL_MTU }, + { RL_HWREV_8100E, RL_8169, "8100E", RL_MTU }, + { RL_HWREV_8101E, RL_8169, "8101E", RL_MTU }, + { RL_HWREV_8102E, RL_8169, "8102E", RL_MTU }, + { RL_HWREV_8102EL, RL_8169, "8102EL", RL_MTU }, + { RL_HWREV_8102EL_SPIN1, RL_8169, "8102EL", RL_MTU }, + { RL_HWREV_8103E, RL_8169, "8103E", RL_MTU }, + { RL_HWREV_8168_SPIN2, RL_8169, "8168", RL_JUMBO_MTU }, + { RL_HWREV_8168_SPIN3, RL_8169, "8168", RL_JUMBO_MTU }, + { RL_HWREV_8168C, RL_8169, "8168C/8111C", RL_JUMBO_MTU_6K }, + { RL_HWREV_8168C_SPIN2, RL_8169, "8168C/8111C", RL_JUMBO_MTU_6K }, + { RL_HWREV_8168CP, RL_8169, "8168CP/8111CP", RL_JUMBO_MTU_6K }, + { RL_HWREV_8168D, RL_8169, "8168D/8111D", RL_JUMBO_MTU_9K }, + { RL_HWREV_8168DP, RL_8169, "8168DP/8111DP", RL_JUMBO_MTU_9K }, + { RL_HWREV_8168E, RL_8169, "8168E/8111E", RL_JUMBO_MTU_9K}, + { RL_HWREV_8168E_VL, RL_8169, "8168E/8111E-VL", RL_JUMBO_MTU_6K}, + { 0, 0, NULL, 0 } }; static int re_probe (device_t); @@ -236,7 +236,9 @@ static int re_allocmem (device_t, struc static __inline void re_discard_rxbuf (struct rl_softc *, int); static int re_newbuf (struct rl_softc *, int); +static int re_jumbo_newbuf (struct rl_softc *, int); static int re_rx_list_init (struct rl_softc *); +static int re_jrx_list_init (struct rl_softc *); static int re_tx_list_init (struct rl_softc *); #ifdef RE_FIXUP_RX static __inline void re_fixup_rx @@ -274,6 +276,7 @@ static int re_miibus_readreg (device_t, static int re_miibus_writereg (device_t, int, int, int); static void re_miibus_statchg (device_t); +static void re_set_jumbo (struct rl_softc *, int); static void re_set_rxmode (struct rl_softc *); static void re_reset (struct rl_softc *); static void re_setwol (struct rl_softc *); @@ -699,7 +702,7 @@ re_reset(struct rl_softc *sc) if ((sc->rl_flags & RL_FLAG_MACRESET) != 0) CSR_WRITE_1(sc, 0x82, 1); - if (sc->rl_hwrev == RL_HWREV_8169S) + if (sc->rl_hwrev->rl_rev == RL_HWREV_8169S) re_gmii_writereg(sc->rl_dev, 1, 0x0b, 0); } @@ -991,6 +994,17 @@ re_allocmem(device_t dev, struct rl_soft * Allocate map for RX mbufs. */ + if ((sc->rl_flags & RL_FLAG_JUMBOV2) != 0) { + error = bus_dma_tag_create(sc->rl_parent_tag, sizeof(uint64_t), + 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, + MJUM9BYTES, 1, MJUM9BYTES, 0, NULL, NULL, + &sc->rl_ldata.rl_jrx_mtag); + if (error) { + device_printf(dev, + "could not allocate jumbo RX DMA tag\n"); + return (error); + } + } error = bus_dma_tag_create(sc->rl_parent_tag, sizeof(uint64_t), 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, MCLBYTES, 1, MCLBYTES, 0, NULL, NULL, &sc->rl_ldata.rl_rx_mtag); @@ -1082,6 +1096,24 @@ re_allocmem(device_t dev, struct rl_soft /* Create DMA maps for RX buffers */ + if ((sc->rl_flags & RL_FLAG_JUMBOV2) != 0) { + error = bus_dmamap_create(sc->rl_ldata.rl_jrx_mtag, 0, + &sc->rl_ldata.rl_jrx_sparemap); + if (error) { + device_printf(dev, + "could not create spare DMA map for jumbo RX\n"); + return (error); + } + for (i = 0; i < sc->rl_ldata.rl_rx_desc_cnt; i++) { + error = bus_dmamap_create(sc->rl_ldata.rl_jrx_mtag, 0, + &sc->rl_ldata.rl_jrx_desc[i].rx_dmamap); + if (error) { + device_printf(dev, + "could not create DMA map for jumbo RX\n"); + return (error); + } + } + } error = bus_dmamap_create(sc->rl_ldata.rl_rx_mtag, 0, &sc->rl_ldata.rl_rx_sparemap); if (error) { @@ -1197,11 +1229,6 @@ re_attach(device_t dev) msic = 0; if (pci_find_extcap(dev, PCIY_EXPRESS, ®) == 0) { sc->rl_flags |= RL_FLAG_PCIE; - if (devid != RT_DEVICEID_8101E) { - /* Set PCIe maximum read request size to 2048. */ - if (pci_get_max_read_req(dev) < 2048) - pci_set_max_read_req(dev, 2048); - } msic = pci_msi_count(dev); if (bootverbose) device_printf(dev, "MSI count : %d\n", msic); @@ -1276,7 +1303,7 @@ re_attach(device_t dev) while (hw_rev->rl_desc != NULL) { if (hw_rev->rl_rev == hwrev) { sc->rl_type = hw_rev->rl_type; - sc->rl_hwrev = hw_rev->rl_rev; + sc->rl_hwrev = hw_rev; break; } hw_rev++; @@ -1289,26 +1316,23 @@ re_attach(device_t dev) switch (hw_rev->rl_rev) { case RL_HWREV_8139CPLUS: - sc->rl_flags |= RL_FLAG_NOJUMBO | RL_FLAG_FASTETHER | - RL_FLAG_AUTOPAD; + sc->rl_flags |= RL_FLAG_FASTETHER | RL_FLAG_AUTOPAD; break; case RL_HWREV_8100E: case RL_HWREV_8101E: - sc->rl_flags |= RL_FLAG_NOJUMBO | RL_FLAG_PHYWAKE | - RL_FLAG_FASTETHER; + sc->rl_flags |= RL_FLAG_PHYWAKE | RL_FLAG_FASTETHER; break; case RL_HWREV_8102E: case RL_HWREV_8102EL: case RL_HWREV_8102EL_SPIN1: - sc->rl_flags |= RL_FLAG_NOJUMBO | RL_FLAG_PHYWAKE | - RL_FLAG_PAR | RL_FLAG_DESCV2 | RL_FLAG_MACSTAT | - RL_FLAG_FASTETHER | RL_FLAG_CMDSTOP | RL_FLAG_AUTOPAD; + sc->rl_flags |= RL_FLAG_PHYWAKE | RL_FLAG_PAR | RL_FLAG_DESCV2 | + RL_FLAG_MACSTAT | RL_FLAG_FASTETHER | RL_FLAG_CMDSTOP | + RL_FLAG_AUTOPAD; break; case RL_HWREV_8103E: - sc->rl_flags |= RL_FLAG_NOJUMBO | RL_FLAG_PHYWAKE | - RL_FLAG_PAR | RL_FLAG_DESCV2 | RL_FLAG_MACSTAT | - RL_FLAG_FASTETHER | RL_FLAG_CMDSTOP | RL_FLAG_AUTOPAD | - RL_FLAG_MACSLEEP; + sc->rl_flags |= RL_FLAG_PHYWAKE | RL_FLAG_PAR | RL_FLAG_DESCV2 | + RL_FLAG_MACSTAT | RL_FLAG_FASTETHER | RL_FLAG_CMDSTOP | + RL_FLAG_AUTOPAD | RL_FLAG_MACSLEEP; break; case RL_HWREV_8168_SPIN1: case RL_HWREV_8168_SPIN2: @@ -1329,28 +1353,17 @@ re_attach(device_t dev) case RL_HWREV_8168DP: sc->rl_flags |= RL_FLAG_PHYWAKE | RL_FLAG_PAR | RL_FLAG_DESCV2 | RL_FLAG_MACSTAT | RL_FLAG_CMDSTOP | - RL_FLAG_AUTOPAD; - /* - * These controllers support jumbo frame but it seems - * that enabling it requires touching additional magic - * registers. Depending on MAC revisions some - * controllers need to disable checksum offload. So - * disable jumbo frame until I have better idea what - * it really requires to make it support. - * RTL8168C/CP : supports up to 6KB jumbo frame. - * RTL8111C/CP : supports up to 9KB jumbo frame. - */ - sc->rl_flags |= RL_FLAG_NOJUMBO; + RL_FLAG_AUTOPAD | RL_FLAG_JUMBOV2; break; case RL_HWREV_8168E: sc->rl_flags |= RL_FLAG_PHYWAKE | RL_FLAG_PHYWAKE_PM | RL_FLAG_PAR | RL_FLAG_DESCV2 | RL_FLAG_MACSTAT | - RL_FLAG_CMDSTOP | RL_FLAG_AUTOPAD | RL_FLAG_NOJUMBO; + RL_FLAG_CMDSTOP | RL_FLAG_AUTOPAD | RL_FLAG_JUMBOV2; break; case RL_HWREV_8168E_VL: sc->rl_flags |= RL_FLAG_PHYWAKE | RL_FLAG_PAR | RL_FLAG_DESCV2 | RL_FLAG_MACSTAT | RL_FLAG_CMDSTOP | - RL_FLAG_AUTOPAD | RL_FLAG_NOJUMBO; + RL_FLAG_AUTOPAD | RL_FLAG_JUMBOV2; break; case RL_HWREV_8169_8110SB: case RL_HWREV_8169_8110SBL: @@ -1687,7 +1700,17 @@ re_detach(device_t dev) sc->rl_ldata.rl_rx_sparemap); bus_dma_tag_destroy(sc->rl_ldata.rl_rx_mtag); } - + if (sc->rl_ldata.rl_jrx_mtag) { + for (i = 0; i < sc->rl_ldata.rl_rx_desc_cnt; i++) { + if (sc->rl_ldata.rl_jrx_desc[i].rx_dmamap) + bus_dmamap_destroy(sc->rl_ldata.rl_jrx_mtag, + sc->rl_ldata.rl_jrx_desc[i].rx_dmamap); + } + if (sc->rl_ldata.rl_jrx_sparemap) + bus_dmamap_destroy(sc->rl_ldata.rl_jrx_mtag, + sc->rl_ldata.rl_jrx_sparemap); + bus_dma_tag_destroy(sc->rl_ldata.rl_jrx_mtag); + } /* Unload and free the stats buffer and map */ if (sc->rl_ldata.rl_stag) { @@ -1715,7 +1738,11 @@ re_discard_rxbuf(struct rl_softc *sc, in struct rl_rxdesc *rxd; uint32_t cmdstat; - rxd = &sc->rl_ldata.rl_rx_desc[idx]; + if (sc->rl_ifp->if_mtu > RL_MTU && + (sc->rl_flags & RL_FLAG_JUMBOV2) != 0) + rxd = &sc->rl_ldata.rl_jrx_desc[idx]; + else + rxd = &sc->rl_ldata.rl_rx_desc[idx]; desc = &sc->rl_ldata.rl_rx_list[idx]; desc->rl_vlanctl = 0; cmdstat = rxd->rx_size; @@ -1788,6 +1815,59 @@ re_newbuf(struct rl_softc *sc, int idx) return (0); } +static int +re_jumbo_newbuf(struct rl_softc *sc, int idx) +{ + struct mbuf *m; + struct rl_rxdesc *rxd; + bus_dma_segment_t segs[1]; + bus_dmamap_t map; + struct rl_desc *desc; + uint32_t cmdstat; + int error, nsegs; + + m = m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, MJUM9BYTES); + if (m == NULL) + return (ENOBUFS); + m->m_len = m->m_pkthdr.len = MJUM9BYTES; +#ifdef RE_FIXUP_RX + m_adj(m, RE_ETHER_ALIGN); +#endif + error = bus_dmamap_load_mbuf_sg(sc->rl_ldata.rl_jrx_mtag, + sc->rl_ldata.rl_jrx_sparemap, m, segs, &nsegs, BUS_DMA_NOWAIT); + if (error != 0) { + m_freem(m); + return (ENOBUFS); + } + KASSERT(nsegs == 1, ("%s: %d segment returned!", __func__, nsegs)); + + rxd = &sc->rl_ldata.rl_jrx_desc[idx]; + if (rxd->rx_m != NULL) { + bus_dmamap_sync(sc->rl_ldata.rl_jrx_mtag, rxd->rx_dmamap, + BUS_DMASYNC_POSTREAD); + bus_dmamap_unload(sc->rl_ldata.rl_jrx_mtag, rxd->rx_dmamap); + } + + rxd->rx_m = m; + map = rxd->rx_dmamap; + rxd->rx_dmamap = sc->rl_ldata.rl_jrx_sparemap; + rxd->rx_size = segs[0].ds_len; + sc->rl_ldata.rl_jrx_sparemap = map; + bus_dmamap_sync(sc->rl_ldata.rl_jrx_mtag, rxd->rx_dmamap, + BUS_DMASYNC_PREREAD); + + desc = &sc->rl_ldata.rl_rx_list[idx]; + desc->rl_vlanctl = 0; + desc->rl_bufaddr_lo = htole32(RL_ADDR_LO(segs[0].ds_addr)); + desc->rl_bufaddr_hi = htole32(RL_ADDR_HI(segs[0].ds_addr)); + cmdstat = segs[0].ds_len; + if (idx == sc->rl_ldata.rl_rx_desc_cnt - 1) + cmdstat |= RL_RDESC_CMD_EOR; + desc->rl_cmdstat = htole32(cmdstat | RL_RDESC_CMD_OWN); + + return (0); +} + #ifdef RE_FIXUP_RX static __inline void re_fixup_rx(struct mbuf *m) @@ -1857,6 +1937,29 @@ re_rx_list_init(struct rl_softc *sc) return (0); } +static int +re_jrx_list_init(struct rl_softc *sc) +{ + int error, i; + + bzero(sc->rl_ldata.rl_rx_list, + sc->rl_ldata.rl_rx_desc_cnt * sizeof(struct rl_desc)); + for (i = 0; i < sc->rl_ldata.rl_rx_desc_cnt; i++) { + sc->rl_ldata.rl_jrx_desc[i].rx_m = NULL; + if ((error = re_jumbo_newbuf(sc, i)) != 0) + return (error); + } + + bus_dmamap_sync(sc->rl_ldata.rl_rx_list_tag, + sc->rl_ldata.rl_rx_list_map, + BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD); + + sc->rl_ldata.rl_rx_prodidx = 0; + sc->rl_head = sc->rl_tail = NULL; + + return (0); +} + /* * RX handler for C+ and 8169. For the gigE chips, we support * the reception of jumbo frames that have been fragmented @@ -1867,14 +1970,18 @@ re_rxeof(struct rl_softc *sc, int *rx_np { struct mbuf *m; struct ifnet *ifp; - int i, total_len; + int i, rxerr, total_len; struct rl_desc *cur_rx; u_int32_t rxstat, rxvlan; - int maxpkt = 16, rx_npkts = 0; + int jumbo, maxpkt = 16, rx_npkts = 0; RL_LOCK_ASSERT(sc); ifp = sc->rl_ifp; + if (ifp->if_mtu > RL_MTU && (sc->rl_flags & RL_FLAG_JUMBOV2) != 0) + jumbo = 1; + else + jumbo = 0; /* Invalidate the descriptor memory */ @@ -1892,9 +1999,21 @@ re_rxeof(struct rl_softc *sc, int *rx_np break; total_len = rxstat & sc->rl_rxlenmask; rxvlan = le32toh(cur_rx->rl_vlanctl); - m = sc->rl_ldata.rl_rx_desc[i].rx_m; + if (jumbo != 0) + m = sc->rl_ldata.rl_jrx_desc[i].rx_m; + else + m = sc->rl_ldata.rl_rx_desc[i].rx_m; - if (!(rxstat & RL_RDESC_STAT_EOF)) { + if ((sc->rl_flags & RL_FLAG_JUMBOV2) != 0 && + (rxstat & (RL_RDESC_STAT_SOF | RL_RDESC_STAT_EOF)) != + (RL_RDESC_STAT_SOF | RL_RDESC_STAT_EOF)) { + /* + * RTL8168C or later controllers do not + * support multi-fragment packet. + */ + re_discard_rxbuf(sc, i); + continue; + } else if ((rxstat & RL_RDESC_STAT_EOF) == 0) { if (re_newbuf(sc, i) != 0) { /* * If this is part of a multi-fragment packet, @@ -1941,27 +2060,36 @@ re_rxeof(struct rl_softc *sc, int *rx_np * if total_len > 2^13-1, both _RXERRSUM and _GIANT will be * set, but if CRC is clear, it will still be a valid frame. */ - if (rxstat & RL_RDESC_STAT_RXERRSUM && !(total_len > 8191 && - (rxstat & RL_RDESC_STAT_ERRS) == RL_RDESC_STAT_GIANT)) { - ifp->if_ierrors++; - /* - * If this is part of a multi-fragment packet, - * discard all the pieces. - */ - if (sc->rl_head != NULL) { - m_freem(sc->rl_head); - sc->rl_head = sc->rl_tail = NULL; + if ((rxstat & RL_RDESC_STAT_RXERRSUM) != 0) { + rxerr = 1; + if ((sc->rl_flags & RL_FLAG_JUMBOV2) == 0 && + total_len > 8191 && + (rxstat & RL_RDESC_STAT_ERRS) == RL_RDESC_STAT_GIANT) + rxerr = 0; + if (rxerr != 0) { + ifp->if_ierrors++; + /* + * If this is part of a multi-fragment packet, + * discard all the pieces. + */ + if (sc->rl_head != NULL) { + m_freem(sc->rl_head); + sc->rl_head = sc->rl_tail = NULL; + } + re_discard_rxbuf(sc, i); + continue; } - re_discard_rxbuf(sc, i); - continue; } /* * If allocating a replacement mbuf fails, * reload the current one. */ - - if (re_newbuf(sc, i) != 0) { + if (jumbo != 0) + rxerr = re_jumbo_newbuf(sc, i); + else + rxerr = re_newbuf(sc, i); + if (rxerr != 0) { ifp->if_iqdrops++; if (sc->rl_head != NULL) { m_freem(sc->rl_head); @@ -1972,9 +2100,13 @@ re_rxeof(struct rl_softc *sc, int *rx_np } if (sc->rl_head != NULL) { - m->m_len = total_len % RE_RX_DESC_BUFLEN; - if (m->m_len == 0) - m->m_len = RE_RX_DESC_BUFLEN; + if (jumbo != 0) + m->m_len = total_len; + else { + m->m_len = total_len % RE_RX_DESC_BUFLEN; + if (m->m_len == 0) + m->m_len = RE_RX_DESC_BUFLEN; + } /* * Special case: if there's 4 bytes or less * in this buffer, the mbuf can be discarded: @@ -2591,6 +2723,59 @@ re_start(struct ifnet *ifp) } static void +re_set_jumbo(struct rl_softc *sc, int jumbo) +{ + + if (sc->rl_hwrev->rl_rev == RL_HWREV_8168E_VL) { + pci_set_max_read_req(sc->rl_dev, 4096); + return; + } + + CSR_WRITE_1(sc, RL_EECMD, RL_EEMODE_WRITECFG); + if (jumbo != 0) { + CSR_WRITE_1(sc, RL_CFG3, CSR_READ_1(sc, RL_CFG3) | + RL_CFG3_JUMBO_EN0); + switch (sc->rl_hwrev->rl_rev) { + case RL_HWREV_8168DP: + break; + case RL_HWREV_8168E: + CSR_WRITE_1(sc, RL_CFG4, CSR_READ_1(sc, RL_CFG4) | + 0x01); + break; + default: + CSR_WRITE_1(sc, RL_CFG4, CSR_READ_1(sc, RL_CFG4) | + RL_CFG4_JUMBO_EN1); + } + } else { + CSR_WRITE_1(sc, RL_CFG3, CSR_READ_1(sc, RL_CFG3) & + ~RL_CFG3_JUMBO_EN0); + switch (sc->rl_hwrev->rl_rev) { + case RL_HWREV_8168DP: + break; + case RL_HWREV_8168E: + CSR_WRITE_1(sc, RL_CFG4, CSR_READ_1(sc, RL_CFG4) & + ~0x01); + break; + default: + CSR_WRITE_1(sc, RL_CFG4, CSR_READ_1(sc, RL_CFG4) & + ~RL_CFG4_JUMBO_EN1); + } + } + CSR_WRITE_1(sc, RL_EECMD, RL_EEMODE_OFF); + + switch (sc->rl_hwrev->rl_rev) { + case RL_HWREV_8168DP: + pci_set_max_read_req(sc->rl_dev, 4096); + break; + default: + if (jumbo != 0) + pci_set_max_read_req(sc->rl_dev, 512); + else + pci_set_max_read_req(sc->rl_dev, 4096); + } +} + +static void re_init(void *xsc) { struct rl_softc *sc = xsc; @@ -2630,10 +2815,39 @@ re_init_locked(struct rl_softc *sc) /* * For C+ mode, initialize the RX descriptors and mbufs. */ - if (re_rx_list_init(sc) != 0) { - device_printf(sc->rl_dev, "no memory for RX buffers\n"); - re_stop(sc); - return; + if ((sc->rl_flags & RL_FLAG_JUMBOV2) != 0) { + if (ifp->if_mtu > RL_MTU) { + if (re_jrx_list_init(sc) != 0) { + device_printf(sc->rl_dev, + "no memory for jumbo RX buffers\n"); + re_stop(sc); + return; + } + /* Disable checksum offloading for jumbo frames. */ + ifp->if_capenable &= ~(IFCAP_HWCSUM | IFCAP_TSO4); + ifp->if_hwassist &= ~(RE_CSUM_FEATURES | CSUM_TSO); + } else { + if (re_rx_list_init(sc) != 0) { + device_printf(sc->rl_dev, + "no memory for RX buffers\n"); + re_stop(sc); + return; + } + } + re_set_jumbo(sc, ifp->if_mtu > RL_MTU); + } else { + if (re_rx_list_init(sc) != 0) { + device_printf(sc->rl_dev, "no memory for RX buffers\n"); + re_stop(sc); + return; + } + if ((sc->rl_flags & RL_FLAG_PCIE) != 0 && + pci_get_device(sc->rl_dev) != RT_DEVICEID_8101E) { + if (ifp->if_mtu > RL_MTU) + pci_set_max_read_req(sc->rl_dev, 512); + else + pci_set_max_read_req(sc->rl_dev, 4096); + } } re_tx_list_init(sc); @@ -2654,12 +2868,12 @@ re_init_locked(struct rl_softc *sc) } else cfg |= RL_CPLUSCMD_RXENB | RL_CPLUSCMD_TXENB; CSR_WRITE_2(sc, RL_CPLUS_CMD, cfg); - if (sc->rl_hwrev == RL_HWREV_8169_8110SC || - sc->rl_hwrev == RL_HWREV_8169_8110SCE) { + if (sc->rl_hwrev->rl_rev == RL_HWREV_8169_8110SC || + sc->rl_hwrev->rl_rev == RL_HWREV_8169_8110SCE) { reg = 0x000fff00; if ((CSR_READ_1(sc, RL_CFG2) & RL_CFG2_PCI66MHZ) != 0) reg |= 0x000000ff; - if (sc->rl_hwrev == RL_HWREV_8169_8110SCE) + if (sc->rl_hwrev->rl_rev == RL_HWREV_8169_8110SCE) reg |= 0x00f00000; CSR_WRITE_4(sc, 0x7c, reg); /* Disable interrupt mitigation. */ @@ -2729,7 +2943,7 @@ re_init_locked(struct rl_softc *sc) /* Configure interrupt moderation. */ if (sc->rl_type == RL_8169) { - switch (sc->rl_hwrev) { + switch (sc->rl_hwrev->rl_rev) { case RL_HWREV_8100E: case RL_HWREV_8101E: case RL_HWREV_8102E: @@ -2792,10 +3006,25 @@ re_init_locked(struct rl_softc *sc) * size so we can receive jumbo frames. */ if (sc->rl_type == RL_8169) { - if ((sc->rl_flags & (RL_FLAG_PCIE | RL_FLAG_NOJUMBO)) == - (RL_FLAG_PCIE | RL_FLAG_NOJUMBO)) + if ((sc->rl_flags & RL_FLAG_JUMBOV2) != 0) { + /* + * For controllers that use new jumbo frame scheme, + * set maximum size of jumbo frame depedning on + * controller revisions. + */ + if (ifp->if_mtu > RL_MTU) + CSR_WRITE_2(sc, RL_MAXRXPKTLEN, + sc->rl_hwrev->rl_max_mtu + + ETHER_VLAN_ENCAP_LEN + ETHER_HDR_LEN + + ETHER_CRC_LEN); + else + CSR_WRITE_2(sc, RL_MAXRXPKTLEN, + RE_RX_DESC_BUFLEN); + } else if ((sc->rl_flags & RL_FLAG_PCIE) != 0 && + sc->rl_hwrev->rl_max_mtu == RL_MTU) { + /* RTL810x has no jumbo frame support. */ CSR_WRITE_2(sc, RL_MAXRXPKTLEN, RE_RX_DESC_BUFLEN); - else + } else CSR_WRITE_2(sc, RL_MAXRXPKTLEN, 16383); } @@ -2862,22 +3091,25 @@ re_ioctl(struct ifnet *ifp, u_long comma switch (command) { case SIOCSIFMTU: - if (ifr->ifr_mtu < ETHERMIN || ifr->ifr_mtu > RL_JUMBO_MTU) { - error = EINVAL; - break; - } - if ((sc->rl_flags & RL_FLAG_NOJUMBO) != 0 && - ifr->ifr_mtu > RL_MAX_FRAMELEN) { + if (ifr->ifr_mtu < ETHERMIN || + ifr->ifr_mtu > sc->rl_hwrev->rl_max_mtu) { error = EINVAL; break; } RL_LOCK(sc); - if (ifp->if_mtu != ifr->ifr_mtu) + if (ifp->if_mtu != ifr->ifr_mtu) { ifp->if_mtu = ifr->ifr_mtu; - if (ifp->if_mtu > RL_TSO_MTU && - (ifp->if_capenable & IFCAP_TSO4) != 0) { - ifp->if_capenable &= ~IFCAP_TSO4; - ifp->if_hwassist &= ~CSUM_TSO; + if ((sc->rl_flags & RL_FLAG_JUMBOV2) != 0 && + (ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + re_init_locked(sc); + } + if (ifp->if_mtu > RL_TSO_MTU && + (ifp->if_capenable & IFCAP_TSO4) != 0) { + ifp->if_capenable &= ~(IFCAP_TSO4 | + IFCAP_VLAN_HWTSO); + ifp->if_hwassist &= ~CSUM_TSO; + } VLAN_CAPABILITIES(ifp); } RL_UNLOCK(sc); @@ -2975,6 +3207,10 @@ re_ioctl(struct ifnet *ifp, u_long comma ifp->if_capenable &= ~IFCAP_VLAN_HWTSO; reinit = 1; } + if ((sc->rl_flags & RL_FLAG_JUMBOV2) != 0 && + (mask & (IFCAP_HWCSUM | IFCAP_TSO4 | + IFCAP_VLAN_HWTSO)) != 0) + reinit = 1; if ((mask & IFCAP_WOL) != 0 && (ifp->if_capabilities & IFCAP_WOL) != 0) { if ((mask & IFCAP_WOL_UCAST) != 0) Modified: head/sys/pci/if_rlreg.h ============================================================================== --- head/sys/pci/if_rlreg.h Mon Jan 17 02:23:50 2011 (r217498) +++ head/sys/pci/if_rlreg.h Mon Jan 17 03:24:33 2011 (r217499) @@ -429,6 +429,7 @@ #define RL_CFG3_GRANTSEL 0x80 #define RL_CFG3_WOL_MAGIC 0x20 #define RL_CFG3_WOL_LINK 0x10 +#define RL_CFG3_JUMBO_EN0 0x04 /* RTL8168C or later. */ #define RL_CFG3_FAST_B2B 0x01 /* @@ -436,6 +437,7 @@ */ #define RL_CFG4_LWPTN 0x04 #define RL_CFG4_LWPME 0x10 +#define RL_CFG4_JUMBO_EN1 0x02 /* RTL8168C or later. */ /* * Config 5 register @@ -592,6 +594,7 @@ struct rl_hwrev { uint32_t rl_rev; int rl_type; char *rl_desc; + int rl_max_mtu; }; struct rl_mii_frame { @@ -767,6 +770,7 @@ struct rl_stats { #define RL_8139_RX_DESC_CNT 64 #define RL_TX_DESC_CNT RL_8169_TX_DESC_CNT #define RL_RX_DESC_CNT RL_8169_RX_DESC_CNT +#define RL_RX_JUMBO_DESC_CNT RL_RX_DESC_CNT #define RL_NTXSEGS 32 #define RL_RING_ALIGN 256 @@ -801,8 +805,13 @@ struct rl_stats { /* see comment in dev/re/if_re.c */ #define RL_JUMBO_FRAMELEN 7440 -#define RL_JUMBO_MTU (RL_JUMBO_FRAMELEN-ETHER_HDR_LEN-ETHER_CRC_LEN) -#define RL_MAX_FRAMELEN \ +#define RL_JUMBO_MTU \ + (RL_JUMBO_FRAMELEN-ETHER_VLAN_ENCAP_LEN-ETHER_HDR_LEN-ETHER_CRC_LEN) +#define RL_JUMBO_MTU_6K \ + ((6 * 1024) - ETHER_VLAN_ENCAP_LEN - ETHER_HDR_LEN - ETHER_CRC_LEN) +#define RL_JUMBO_MTU_9K \ + ((9 * 1024) - ETHER_VLAN_ENCAP_LEN - ETHER_HDR_LEN - ETHER_CRC_LEN) +#define RL_MTU \ (ETHER_MAX_LEN + ETHER_VLAN_ENCAP_LEN - ETHER_HDR_LEN - ETHER_CRC_LEN) struct rl_txdesc { @@ -819,6 +828,7 @@ struct rl_rxdesc { struct rl_list_data { struct rl_txdesc rl_tx_desc[RL_TX_DESC_CNT]; struct rl_rxdesc rl_rx_desc[RL_RX_DESC_CNT]; + struct rl_rxdesc rl_jrx_desc[RL_RX_JUMBO_DESC_CNT]; int rl_tx_desc_cnt; int rl_rx_desc_cnt; int rl_tx_prodidx; @@ -827,7 +837,9 @@ struct rl_list_data { int rl_tx_free; bus_dma_tag_t rl_tx_mtag; /* mbuf TX mapping tag */ bus_dma_tag_t rl_rx_mtag; /* mbuf RX mapping tag */ + bus_dma_tag_t rl_jrx_mtag; /* mbuf RX mapping tag */ bus_dmamap_t rl_rx_sparemap; + bus_dmamap_t rl_jrx_sparemap; bus_dma_tag_t rl_stag; /* stats mapping tag */ bus_dmamap_t rl_smap; /* stats map */ struct rl_stats *rl_stats; @@ -857,9 +869,9 @@ struct rl_softc { device_t rl_miibus; bus_dma_tag_t rl_parent_tag; uint8_t rl_type; + struct rl_hwrev *rl_hwrev; int rl_eecmd_read; int rl_eewidth; - uint8_t rl_stats_no_timeout; int rl_txthresh; struct rl_chain_data rl_cdata; struct rl_list_data rl_ldata; @@ -868,7 +880,6 @@ struct rl_softc { struct mtx rl_mtx; struct mbuf *rl_head; struct mbuf *rl_tail; - uint32_t rl_hwrev; uint32_t rl_rxlenmask; int rl_testmode; int rl_if_flags; @@ -890,7 +901,7 @@ struct rl_softc { #define RL_FLAG_AUTOPAD 0x0002 #define RL_FLAG_PHYWAKE_PM 0x0004 #define RL_FLAG_PHYWAKE 0x0008 -#define RL_FLAG_NOJUMBO 0x0010 +#define RL_FLAG_JUMBOV2 0x0010 #define RL_FLAG_PAR 0x0020 #define RL_FLAG_DESCV2 0x0040 #define RL_FLAG_MACSTAT 0x0080 From owner-svn-src-all@FreeBSD.ORG Mon Jan 17 05:45:56 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 320B9106566C; Mon, 17 Jan 2011 05:45:56 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1CBE08FC12; Mon, 17 Jan 2011 05:45:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0H5jurv089712; Mon, 17 Jan 2011 05:45:56 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0H5jtOE089685; Mon, 17 Jan 2011 05:45:55 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201101170545.p0H5jtOE089685@svn.freebsd.org> From: Lawrence Stewart Date: Mon, 17 Jan 2011 05:45:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217500 - in stable/8/sys: amd64/acpica amd64/amd64 cddl/contrib/opensolaris/uts/common/dtrace cddl/dev/cyclic cddl/dev/dtrace cddl/dev/dtrace/amd64 cddl/dev/dtrace/i386 compat/linprocf... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jan 2011 05:45:56 -0000 Author: lstewart Date: Mon Jan 17 05:45:55 2011 New Revision: 217500 URL: http://svn.freebsd.org/changeset/base/217500 Log: MFC r209059 (originally committed by jhb): Update several places that iterate over CPUs to use CPU_FOREACH(). Modified: stable/8/sys/amd64/acpica/madt.c stable/8/sys/amd64/amd64/legacy.c stable/8/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c stable/8/sys/cddl/dev/cyclic/cyclic.c stable/8/sys/cddl/dev/dtrace/amd64/dtrace_subr.c stable/8/sys/cddl/dev/dtrace/dtrace_debug.c stable/8/sys/cddl/dev/dtrace/dtrace_load.c stable/8/sys/cddl/dev/dtrace/i386/dtrace_subr.c stable/8/sys/compat/linprocfs/linprocfs.c stable/8/sys/dev/acpica/acpi_cpu.c stable/8/sys/i386/acpica/madt.c stable/8/sys/i386/i386/legacy.c stable/8/sys/i386/i386/mp_machdep.c stable/8/sys/kern/kern_clock.c stable/8/sys/kern/kern_switch.c stable/8/sys/kern/kern_timeout.c stable/8/sys/kern/sched_4bsd.c stable/8/sys/kern/sched_ule.c stable/8/sys/kern/subr_lock.c stable/8/sys/kern/subr_pcpu.c stable/8/sys/kern/subr_smp.c stable/8/sys/net/flowtable.c stable/8/sys/net/if_epair.c stable/8/sys/net/netisr.c stable/8/sys/vm/uma_core.c stable/8/sys/x86/x86/mca.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/amd64/acpica/madt.c ============================================================================== --- stable/8/sys/amd64/acpica/madt.c Mon Jan 17 03:24:33 2011 (r217499) +++ stable/8/sys/amd64/acpica/madt.c Mon Jan 17 05:45:55 2011 (r217500) @@ -557,9 +557,7 @@ madt_set_ids(void *dummy) if (madt == NULL) return; - for (i = 0; i < MAXCPU; i++) { - if (CPU_ABSENT(i)) - continue; + CPU_FOREACH(i) { pc = pcpu_find(i); KASSERT(pc != NULL, ("no pcpu data for CPU %u", i)); la = &lapics[pc->pc_apic_id]; Modified: stable/8/sys/amd64/amd64/legacy.c ============================================================================== --- stable/8/sys/amd64/amd64/legacy.c Mon Jan 17 03:24:33 2011 (r217499) +++ stable/8/sys/amd64/amd64/legacy.c Mon Jan 17 05:45:55 2011 (r217500) @@ -269,12 +269,11 @@ cpu_identify(driver_t *driver, device_t * so that these devices are attached after the Host-PCI * bridges (which are added at order 100). */ - for (i = 0; i <= mp_maxid; i++) - if (!CPU_ABSENT(i)) { - child = BUS_ADD_CHILD(parent, 150, "cpu", i); - if (child == NULL) - panic("legacy_attach cpu"); - } + CPU_FOREACH(i) { + child = BUS_ADD_CHILD(parent, 150, "cpu", i); + if (child == NULL) + panic("legacy_attach cpu"); + } } static device_t Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Mon Jan 17 03:24:33 2011 (r217499) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Mon Jan 17 05:45:55 2011 (r217500) @@ -10583,8 +10583,6 @@ dtrace_buffer_alloc(dtrace_buffer_t *buf { #if defined(sun) cpu_t *cp; -#else - struct pcpu *cp; #endif dtrace_buffer_t *buf; @@ -10672,10 +10670,7 @@ err: #endif ASSERT(MUTEX_HELD(&dtrace_lock)); - for (i = 0; i <= mp_maxid; i++) { - if ((cp = pcpu_find(i)) == NULL) - continue; - + CPU_FOREACH(i) { if (cpu != DTRACE_CPUALL && cpu != i) continue; @@ -10715,10 +10710,7 @@ err: * Error allocating memory, so free the buffers that were * allocated before the failed allocation. */ - for (i = 0; i <= mp_maxid; i++) { - if ((cp = pcpu_find(i)) == NULL) - continue; - + CPU_FOREACH(i) { if (cpu != DTRACE_CPUALL && cpu != i) continue; @@ -12621,10 +12613,10 @@ dtrace_dstate_init(dtrace_dstate_t *dsta maxper = (limit - (uintptr_t)start) / NCPU; maxper = (maxper / dstate->dtds_chunksize) * dstate->dtds_chunksize; - for (i = 0; i < NCPU; i++) { #if !defined(sun) - if (CPU_ABSENT(i)) - continue; + CPU_FOREACH(i) { +#else + for (i = 0; i < NCPU; i++) { #endif dstate->dtds_percpu[i].dtdsc_free = dvar = start; Modified: stable/8/sys/cddl/dev/cyclic/cyclic.c ============================================================================== --- stable/8/sys/cddl/dev/cyclic/cyclic.c Mon Jan 17 03:24:33 2011 (r217499) +++ stable/8/sys/cddl/dev/cyclic/cyclic.c Mon Jan 17 05:45:55 2011 (r217500) @@ -1344,10 +1344,7 @@ cyclic_uninit(void) cpu_t *c; int id; - for (id = 0; id <= mp_maxid; id++) { - if (pcpu_find(id) == NULL) - continue; - + CPU_FOREACH(id) { c = &solaris_cpu[id]; if (c->cpu_cyclic == NULL) Modified: stable/8/sys/cddl/dev/dtrace/amd64/dtrace_subr.c ============================================================================== --- stable/8/sys/cddl/dev/dtrace/amd64/dtrace_subr.c Mon Jan 17 03:24:33 2011 (r217499) +++ stable/8/sys/cddl/dev/dtrace/amd64/dtrace_subr.c Mon Jan 17 05:45:55 2011 (r217500) @@ -439,13 +439,10 @@ dtrace_gethrtime_init(void *arg) /* The current CPU is the reference one. */ tsc_skew[curcpu] = 0; - for (i = 0; i <= mp_maxid; i++) { + CPU_FOREACH(i) { if (i == curcpu) continue; - if (pcpu_find(i) == NULL) - continue; - map = 0; map |= (1 << curcpu); map |= (1 << i); Modified: stable/8/sys/cddl/dev/dtrace/dtrace_debug.c ============================================================================== --- stable/8/sys/cddl/dev/dtrace/dtrace_debug.c Mon Jan 17 03:24:33 2011 (r217499) +++ stable/8/sys/cddl/dev/dtrace/dtrace_debug.c Mon Jan 17 05:45:55 2011 (r217500) @@ -108,10 +108,7 @@ dtrace_debug_init(void *dummy) int i; struct dtrace_debug_data *d; - for (i = 0; i <= mp_maxid; i++) { - if (pcpu_find(i) == NULL) - continue; - + CPU_FOREACH(i) { d = &dtrace_debug_data[i]; if (d->first == NULL) { @@ -134,10 +131,7 @@ dtrace_debug_output(void) struct dtrace_debug_data *d; uintptr_t count; - for (i = 0; i <= mp_maxid; i++) { - if (pcpu_find(i) == NULL) - continue; - + CPU_FOREACH(i) { dtrace_debug_lock(i); d = &dtrace_debug_data[i]; Modified: stable/8/sys/cddl/dev/dtrace/dtrace_load.c ============================================================================== --- stable/8/sys/cddl/dev/dtrace/dtrace_load.c Mon Jan 17 03:24:33 2011 (r217499) +++ stable/8/sys/cddl/dev/dtrace/dtrace_load.c Mon Jan 17 05:45:55 2011 (r217500) @@ -30,8 +30,8 @@ dtrace_ap_start(void *dummy) mutex_enter(&cpu_lock); /* Setup the rest of the CPUs. */ - for (i = 1; i <= mp_maxid; i++) { - if (pcpu_find(i) == NULL) + CPU_FOREACH(i) { + if (i == 0) continue; (void) dtrace_cpu_setup(CPU_CONFIG, i); Modified: stable/8/sys/cddl/dev/dtrace/i386/dtrace_subr.c ============================================================================== --- stable/8/sys/cddl/dev/dtrace/i386/dtrace_subr.c Mon Jan 17 03:24:33 2011 (r217499) +++ stable/8/sys/cddl/dev/dtrace/i386/dtrace_subr.c Mon Jan 17 05:45:55 2011 (r217500) @@ -439,13 +439,10 @@ dtrace_gethrtime_init(void *arg) /* The current CPU is the reference one. */ tsc_skew[curcpu] = 0; - for (i = 0; i <= mp_maxid; i++) { + CPU_FOREACH(i) { if (i == curcpu) continue; - if (pcpu_find(i) == NULL) - continue; - map = 0; map |= (1 << curcpu); map |= (1 << i); Modified: stable/8/sys/compat/linprocfs/linprocfs.c ============================================================================== --- stable/8/sys/compat/linprocfs/linprocfs.c Mon Jan 17 03:24:33 2011 (r217499) +++ stable/8/sys/compat/linprocfs/linprocfs.c Mon Jan 17 05:45:55 2011 (r217500) @@ -473,9 +473,7 @@ linprocfs_dostat(PFS_FILL_ARGS) T2J(cp_time[CP_NICE]), T2J(cp_time[CP_SYS] /*+ cp_time[CP_INTR]*/), T2J(cp_time[CP_IDLE])); - for (i = 0; i <= mp_maxid; ++i) { - if (CPU_ABSENT(i)) - continue; + CPU_FOREACH(i) { pcpu = pcpu_find(i); cp = pcpu->pc_cp_time; sbuf_printf(sb, "cpu%d %ld %ld %ld %ld\n", i, Modified: stable/8/sys/dev/acpica/acpi_cpu.c ============================================================================== --- stable/8/sys/dev/acpica/acpi_cpu.c Mon Jan 17 03:24:33 2011 (r217499) +++ stable/8/sys/dev/acpica/acpi_cpu.c Mon Jan 17 05:45:55 2011 (r217500) @@ -445,9 +445,7 @@ acpi_pcpu_get_id(uint32_t idx, uint32_t KASSERT(acpi_id != NULL, ("Null acpi_id")); KASSERT(cpu_id != NULL, ("Null cpu_id")); - for (i = 0; i <= mp_maxid; i++) { - if (CPU_ABSENT(i)) - continue; + CPU_FOREACH(i) { pcpu_data = pcpu_find(i); KASSERT(pcpu_data != NULL, ("no pcpu data for %d", i)); if (idx-- == 0) { Modified: stable/8/sys/i386/acpica/madt.c ============================================================================== --- stable/8/sys/i386/acpica/madt.c Mon Jan 17 03:24:33 2011 (r217499) +++ stable/8/sys/i386/acpica/madt.c Mon Jan 17 05:45:55 2011 (r217500) @@ -557,9 +557,7 @@ madt_set_ids(void *dummy) if (madt == NULL) return; - for (i = 0; i <= mp_maxid; i++) { - if (CPU_ABSENT(i)) - continue; + CPU_FOREACH(i) { pc = pcpu_find(i); KASSERT(pc != NULL, ("no pcpu data for CPU %u", i)); la = &lapics[pc->pc_apic_id]; Modified: stable/8/sys/i386/i386/legacy.c ============================================================================== --- stable/8/sys/i386/i386/legacy.c Mon Jan 17 03:24:33 2011 (r217499) +++ stable/8/sys/i386/i386/legacy.c Mon Jan 17 05:45:55 2011 (r217500) @@ -290,12 +290,11 @@ cpu_identify(driver_t *driver, device_t * so that these devices are attached after the Host-PCI * bridges (which are added at order 100). */ - for (i = 0; i <= mp_maxid; i++) - if (!CPU_ABSENT(i)) { - child = BUS_ADD_CHILD(parent, 150, "cpu", i); - if (child == NULL) - panic("legacy_attach cpu"); - } + CPU_FOREACH(i) { + child = BUS_ADD_CHILD(parent, 150, "cpu", i); + if (child == NULL) + panic("legacy_attach cpu"); + } } static device_t Modified: stable/8/sys/i386/i386/mp_machdep.c ============================================================================== --- stable/8/sys/i386/i386/mp_machdep.c Mon Jan 17 03:24:33 2011 (r217499) +++ stable/8/sys/i386/i386/mp_machdep.c Mon Jan 17 05:45:55 2011 (r217500) @@ -1645,9 +1645,7 @@ mp_ipi_intrcnt(void *dummy) char buf[64]; int i; - for (i = 0; i < mp_maxid; i++) { - if (CPU_ABSENT(i)) - continue; + CPU_FOREACH(i) { snprintf(buf, sizeof(buf), "cpu%d: invltlb", i); intrcnt_add(buf, &ipi_invltlb_counts[i]); snprintf(buf, sizeof(buf), "cpu%d: invlrng", i); Modified: stable/8/sys/kern/kern_clock.c ============================================================================== --- stable/8/sys/kern/kern_clock.c Mon Jan 17 03:24:33 2011 (r217499) +++ stable/8/sys/kern/kern_clock.c Mon Jan 17 05:45:55 2011 (r217500) @@ -319,9 +319,7 @@ read_cpu_time(long *cp_time) /* Sum up global cp_time[]. */ bzero(cp_time, sizeof(long) * CPUSTATES); - for (i = 0; i <= mp_maxid; i++) { - if (CPU_ABSENT(i)) - continue; + CPU_FOREACH(i) { pc = pcpu_find(i); for (j = 0; j < CPUSTATES; j++) cp_time[j] += pc->pc_cp_time[j]; Modified: stable/8/sys/kern/kern_switch.c ============================================================================== --- stable/8/sys/kern/kern_switch.c Mon Jan 17 03:24:33 2011 (r217499) +++ stable/8/sys/kern/kern_switch.c Mon Jan 17 05:45:55 2011 (r217500) @@ -133,9 +133,7 @@ sysctl_stats_reset(SYSCTL_HANDLER_ARGS) if (p == oidp || p->oid_arg1 == NULL) continue; counter = (uintptr_t)p->oid_arg1; - for (i = 0; i <= mp_maxid; i++) { - if (CPU_ABSENT(i)) - continue; + CPU_FOREACH(i) { *(long *)(dpcpu_off[i] + counter) = 0; } } Modified: stable/8/sys/kern/kern_timeout.c ============================================================================== --- stable/8/sys/kern/kern_timeout.c Mon Jan 17 03:24:33 2011 (r217499) +++ stable/8/sys/kern/kern_timeout.c Mon Jan 17 05:45:55 2011 (r217500) @@ -228,11 +228,9 @@ start_softclock(void *dummy) panic("died while creating standard software ithreads"); cc->cc_cookie = softclock_ih; #ifdef SMP - for (cpu = 0; cpu <= mp_maxid; cpu++) { + CPU_FOREACH(cpu) { if (cpu == timeout_cpu) continue; - if (CPU_ABSENT(cpu)) - continue; cc = CC_CPU(cpu); if (swi_add(NULL, "clock", softclock, cc, SWI_CLOCK, INTR_MPSAFE, &cc->cc_cookie)) Modified: stable/8/sys/kern/sched_4bsd.c ============================================================================== --- stable/8/sys/kern/sched_4bsd.c Mon Jan 17 03:24:33 2011 (r217499) +++ stable/8/sys/kern/sched_4bsd.c Mon Jan 17 05:45:55 2011 (r217500) @@ -1190,9 +1190,7 @@ sched_pickcpu(struct thread *td) best = td->td_lastcpu; else best = NOCPU; - for (cpu = 0; cpu <= mp_maxid; cpu++) { - if (CPU_ABSENT(cpu)) - continue; + CPU_FOREACH(cpu) { if (!THREAD_CAN_SCHED(td, cpu)) continue; @@ -1627,9 +1625,7 @@ sched_affinity(struct thread *td) */ ts = td->td_sched; ts->ts_flags &= ~TSF_AFFINITY; - for (cpu = 0; cpu <= mp_maxid; cpu++) { - if (CPU_ABSENT(cpu)) - continue; + CPU_FOREACH(cpu) { if (!THREAD_CAN_SCHED(td, cpu)) { ts->ts_flags |= TSF_AFFINITY; break; Modified: stable/8/sys/kern/sched_ule.c ============================================================================== --- stable/8/sys/kern/sched_ule.c Mon Jan 17 03:24:33 2011 (r217499) +++ stable/8/sys/kern/sched_ule.c Mon Jan 17 05:45:55 2011 (r217500) @@ -1254,9 +1254,7 @@ sched_setup_smp(void) int i; cpu_top = smp_topo(); - for (i = 0; i < MAXCPU; i++) { - if (CPU_ABSENT(i)) - continue; + CPU_FOREACH(i) { tdq = TDQ_CPU(i); tdq_setup(tdq); tdq->tdq_cg = smp_topo_find(cpu_top, i); @@ -2489,7 +2487,7 @@ sched_load(void) int i; total = 0; - for (i = 0; i <= mp_maxid; i++) + CPU_FOREACH(i) total += TDQ_CPU(i)->tdq_sysload; return (total); #else Modified: stable/8/sys/kern/subr_lock.c ============================================================================== --- stable/8/sys/kern/subr_lock.c Mon Jan 17 03:24:33 2011 (r217499) +++ stable/8/sys/kern/subr_lock.c Mon Jan 17 05:45:55 2011 (r217500) @@ -256,9 +256,7 @@ lock_prof_idle(void) td = curthread; thread_lock(td); - for (cpu = 0; cpu <= mp_maxid; cpu++) { - if (CPU_ABSENT(cpu)) - continue; + CPU_FOREACH(cpu) { sched_bind(td, cpu); } sched_unbind(td); Modified: stable/8/sys/kern/subr_pcpu.c ============================================================================== --- stable/8/sys/kern/subr_pcpu.c Mon Jan 17 03:24:33 2011 (r217499) +++ stable/8/sys/kern/subr_pcpu.c Mon Jan 17 05:45:55 2011 (r217500) @@ -317,9 +317,7 @@ DB_SHOW_COMMAND(dpcpu_off, db_show_dpcpu { int id; - for (id = 0; id <= mp_maxid; id++) { - if (CPU_ABSENT(id)) - continue; + CPU_FOREACH(id) { db_printf("dpcpu_off[%2d] = 0x%jx (+ DPCPU_START = %p)\n", id, (uintmax_t)dpcpu_off[id], (void *)(uintptr_t)(dpcpu_off[id] + DPCPU_START)); Modified: stable/8/sys/kern/subr_smp.c ============================================================================== --- stable/8/sys/kern/subr_smp.c Mon Jan 17 03:24:33 2011 (r217499) +++ stable/8/sys/kern/subr_smp.c Mon Jan 17 05:45:55 2011 (r217500) @@ -395,9 +395,10 @@ smp_rendezvous_cpus(cpumask_t map, return; } - for (i = 0; i <= mp_maxid; i++) - if (((1 << i) & map) != 0 && !CPU_ABSENT(i)) + CPU_FOREACH(i) { + if (((1 << i) & map) != 0) ncpus++; + } if (ncpus == 0) panic("ncpus is 0 with map=0x%x", map); Modified: stable/8/sys/net/flowtable.c ============================================================================== --- stable/8/sys/net/flowtable.c Mon Jan 17 03:24:33 2011 (r217499) +++ stable/8/sys/net/flowtable.c Mon Jan 17 05:45:55 2011 (r217500) @@ -329,9 +329,7 @@ flowtable_show_stats(struct sbuf *sb, st if (ft->ft_flags & FL_PCPU) { bzero(&fs, sizeof(fs)); pfs = &fs; - for (i = 0; i <= mp_maxid; i++) { - if (CPU_ABSENT(i)) - continue; + CPU_FOREACH(i) { pfs->ft_collisions += ft->ft_stats[i].ft_collisions; pfs->ft_allocated += ft->ft_stats[i].ft_allocated; pfs->ft_misses += ft->ft_stats[i].ft_misses; @@ -1495,10 +1493,7 @@ flowtable_route_flush(struct flowtable * int i; if (ft->ft_flags & FL_PCPU) { - for (i = 0; i <= mp_maxid; i++) { - if (CPU_ABSENT(i)) - continue; - + CPU_FOREACH(i) { if (smp_started == 1) { thread_lock(curthread); sched_bind(curthread, i); @@ -1527,10 +1522,7 @@ flowtable_clean_vnet(void) ft = V_flow_list_head; while (ft != NULL) { if (ft->ft_flags & FL_PCPU) { - for (i = 0; i <= mp_maxid; i++) { - if (CPU_ABSENT(i)) - continue; - + CPU_FOREACH(i) { if (smp_started == 1) { thread_lock(curthread); sched_bind(curthread, i); @@ -1800,9 +1792,7 @@ flowtable_show_vnet(void) while (ft != NULL) { printf("name: %s\n", ft->ft_name); if (ft->ft_flags & FL_PCPU) { - for (i = 0; i <= mp_maxid; i++) { - if (CPU_ABSENT(i)) - continue; + CPU_FOREACH(i) { flowtable_show(ft, i); } } else { Modified: stable/8/sys/net/if_epair.c ============================================================================== --- stable/8/sys/net/if_epair.c Mon Jan 17 03:24:33 2011 (r217499) +++ stable/8/sys/net/if_epair.c Mon Jan 17 05:45:55 2011 (r217500) @@ -189,10 +189,7 @@ epair_dpcpu_init(void) struct eid_list *s; u_int cpuid; - for (cpuid = 0; cpuid <= mp_maxid; cpuid++) { - if (CPU_ABSENT(cpuid)) - continue; - + CPU_FOREACH(cpuid) { epair_dpcpu = DPCPU_ID_PTR(cpuid, epair_dpcpu); /* Initialize per-cpu lock. */ @@ -217,10 +214,7 @@ epair_dpcpu_detach(void) struct epair_dpcpu *epair_dpcpu; u_int cpuid; - for (cpuid = 0; cpuid <= mp_maxid; cpuid++) { - if (CPU_ABSENT(cpuid)) - continue; - + CPU_FOREACH(cpuid) { epair_dpcpu = DPCPU_ID_PTR(cpuid, epair_dpcpu); /* Destroy per-cpu lock. */ @@ -330,10 +324,7 @@ epair_remove_ifp_from_draining(struct if struct epair_ifp_drain *elm, *tvar; u_int cpuid; - for (cpuid = 0; cpuid <= mp_maxid; cpuid++) { - if (CPU_ABSENT(cpuid)) - continue; - + CPU_FOREACH(cpuid) { epair_dpcpu = DPCPU_ID_PTR(cpuid, epair_dpcpu); EPAIR_LOCK(epair_dpcpu); STAILQ_FOREACH_SAFE(elm, &epair_dpcpu->epair_ifp_drain_list, Modified: stable/8/sys/net/netisr.c ============================================================================== --- stable/8/sys/net/netisr.c Mon Jan 17 03:24:33 2011 (r217499) +++ stable/8/sys/net/netisr.c Mon Jan 17 05:45:55 2011 (r217500) @@ -339,9 +339,7 @@ netisr_register(const struct netisr_hand } else netisr_proto[proto].np_qlimit = nhp->nh_qlimit; netisr_proto[proto].np_policy = nhp->nh_policy; - for (i = 0; i <= mp_maxid; i++) { - if (CPU_ABSENT(i)) - continue; + CPU_FOREACH(i) { npwp = &(DPCPU_ID_PTR(i, nws))->nws_work[proto]; bzero(npwp, sizeof(*npwp)); npwp->nw_qlimit = netisr_proto[proto].np_qlimit; @@ -373,9 +371,7 @@ netisr_clearqdrops(const struct netisr_h ("%s(%u): protocol not registered for %s", __func__, proto, name)); - for (i = 0; i <= mp_maxid; i++) { - if (CPU_ABSENT(i)) - continue; + CPU_FOREACH(i) { npwp = &(DPCPU_ID_PTR(i, nws))->nws_work[proto]; npwp->nw_qdrops = 0; } @@ -408,9 +404,7 @@ netisr_getqdrops(const struct netisr_han ("%s(%u): protocol not registered for %s", __func__, proto, name)); - for (i = 0; i <= mp_maxid; i++) { - if (CPU_ABSENT(i)) - continue; + CPU_FOREACH(i) { npwp = &(DPCPU_ID_PTR(i, nws))->nws_work[proto]; *qdropp += npwp->nw_qdrops; } @@ -474,9 +468,7 @@ netisr_setqlimit(const struct netisr_han name)); netisr_proto[proto].np_qlimit = qlimit; - for (i = 0; i <= mp_maxid; i++) { - if (CPU_ABSENT(i)) - continue; + CPU_FOREACH(i) { npwp = &(DPCPU_ID_PTR(i, nws))->nws_work[proto]; npwp->nw_qlimit = qlimit; } @@ -540,9 +532,7 @@ netisr_unregister(const struct netisr_ha netisr_proto[proto].np_m2cpuid = NULL; netisr_proto[proto].np_qlimit = 0; netisr_proto[proto].np_policy = 0; - for (i = 0; i <= mp_maxid; i++) { - if (CPU_ABSENT(i)) - continue; + CPU_FOREACH(i) { npwp = &(DPCPU_ID_PTR(i, nws))->nws_work[proto]; netisr_drain_proto(npwp); bzero(npwp, sizeof(*npwp)); @@ -1136,9 +1126,7 @@ sysctl_netisr_workstream(SYSCTL_HANDLER_ M_ZERO | M_WAITOK); counter = 0; NETISR_RLOCK(&tracker); - for (cpuid = 0; cpuid < MAXCPU; cpuid++) { - if (CPU_ABSENT(cpuid)) - continue; + CPU_FOREACH(cpuid) { nwsp = DPCPU_ID_PTR(cpuid, nws); if (nwsp->nws_intr_event == NULL) continue; @@ -1192,9 +1180,7 @@ sysctl_netisr_work(SYSCTL_HANDLER_ARGS) M_TEMP, M_ZERO | M_WAITOK); counter = 0; NETISR_RLOCK(&tracker); - for (cpuid = 0; cpuid < MAXCPU; cpuid++) { - if (CPU_ABSENT(cpuid)) - continue; + CPU_FOREACH(cpuid) { nwsp = DPCPU_ID_PTR(cpuid, nws); if (nwsp->nws_intr_event == NULL) continue; @@ -1243,9 +1229,7 @@ DB_SHOW_COMMAND(netisr, db_show_netisr) db_printf("%3s %6s %5s %5s %5s %8s %8s %8s %8s\n", "CPU", "Proto", "Len", "WMark", "Max", "Disp", "HDisp", "Drop", "Queue"); - for (cpuid = 0; cpuid <= mp_maxid; cpuid++) { - if (CPU_ABSENT(cpuid)) - continue; + CPU_FOREACH(cpuid) { nwsp = DPCPU_ID_PTR(cpuid, nws); if (nwsp->nws_intr_event == NULL) continue; Modified: stable/8/sys/vm/uma_core.c ============================================================================== --- stable/8/sys/vm/uma_core.c Mon Jan 17 03:24:33 2011 (r217499) +++ stable/8/sys/vm/uma_core.c Mon Jan 17 05:45:55 2011 (r217500) @@ -620,9 +620,7 @@ cache_drain(uma_zone_t zone) * it is used elsewhere. Should the tear-down path be made special * there in some form? */ - for (cpu = 0; cpu <= mp_maxid; cpu++) { - if (CPU_ABSENT(cpu)) - continue; + CPU_FOREACH(cpu) { cache = &zone->uz_cpu[cpu]; bucket_drain(zone, cache->uc_allocbucket); bucket_drain(zone, cache->uc_freebucket); @@ -3142,9 +3140,7 @@ uma_print_zone(uma_zone_t zone) zone->uz_name, zone, zone->uz_size, zone->uz_flags); LIST_FOREACH(kl, &zone->uz_kegs, kl_link) uma_print_keg(kl->kl_keg); - for (i = 0; i <= mp_maxid; i++) { - if (CPU_ABSENT(i)) - continue; + CPU_FOREACH(i) { cache = &zone->uz_cpu[i]; printf("CPU %d Cache:\n", i); cache_print(cache); @@ -3173,9 +3169,7 @@ uma_zone_sumstat(uma_zone_t z, int *cach allocs = frees = 0; cachefree = 0; - for (cpu = 0; cpu <= mp_maxid; cpu++) { - if (CPU_ABSENT(cpu)) - continue; + CPU_FOREACH(cpu) { cache = &z->uz_cpu[cpu]; if (cache->uc_allocbucket != NULL) cachefree += cache->uc_allocbucket->ub_cnt; Modified: stable/8/sys/x86/x86/mca.c ============================================================================== --- stable/8/sys/x86/x86/mca.c Mon Jan 17 03:24:33 2011 (r217499) +++ stable/8/sys/x86/x86/mca.c Mon Jan 17 05:45:55 2011 (r217500) @@ -558,7 +558,7 @@ mca_scan(enum scan_mode mode) * If this is a bank this CPU monitors via CMCI, * update the threshold. */ - if (PCPU_GET(cmci_mask) & (1 << i)) + if (PCPU_GET(cmci_mask) & 1 << i) cmci_update(mode, i, valid, &rec); #endif } @@ -580,9 +580,7 @@ mca_scan_cpus(void *context, int pending td = curthread; count = 0; thread_lock(td); - for (cpu = 0; cpu <= mp_maxid; cpu++) { - if (CPU_ABSENT(cpu)) - continue; + CPU_FOREACH(cpu) { sched_bind(td, cpu); thread_unlock(td); count += mca_scan(POLLED); From owner-svn-src-all@FreeBSD.ORG Mon Jan 17 15:12:29 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CADFA106564A; Mon, 17 Jan 2011 15:12:29 +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 B89868FC0A; Mon, 17 Jan 2011 15:12:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0HFCTEQ004018; Mon, 17 Jan 2011 15:12:29 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0HFCTEJ004016; Mon, 17 Jan 2011 15:12:29 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201101171512.p0HFCTEJ004016@svn.freebsd.org> From: Marius Strobl Date: Mon, 17 Jan 2011 15:12:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217502 - stable/8/sys/dev/mii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jan 2011 15:12:30 -0000 Author: marius Date: Mon Jan 17 15:12:29 2011 New Revision: 217502 URL: http://svn.freebsd.org/changeset/base/217502 Log: MFC: r217415 - Allow IFM_FLAG0 to be set indicating that auto-negotiation with manual configuration, which is used to work around issues with certain setups (see r161237) by default, should not be triggered as it may in turn cause harm in some edge cases. - Even after masking the media with IFM_GMASK the result may have bits besides the duplex ones set so just comparing it with IFM_FDX may lead to false negatives. - Announce PAUSE support also for manually selected 1000BASE-T, but for all manually selected media types only in full-duplex mode. Announce asymmetric PAUSE support only for manually selected 1000BASE-T. - Simplify setting the manual configuration bits to only once after we have figured them all out. This also means we no longer unnecessarily update the hardware along the road. - Remove a stale comment. Reviewed by: yongari (plus additional testing) Modified: stable/8/sys/dev/mii/rgephy.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/mii/rgephy.c ============================================================================== --- stable/8/sys/dev/mii/rgephy.c Mon Jan 17 14:44:16 2011 (r217501) +++ stable/8/sys/dev/mii/rgephy.c Mon Jan 17 15:12:29 2011 (r217502) @@ -146,6 +146,13 @@ rgephy_attach(device_t dev) mii_phy_add_media(sc); printf("\n"); #undef ADD + /* + * Allow IFM_FLAG0 to be set indicating that auto-negotiation with + * manual configuration, which is used to work around issues with + * certain setups by default, should not be triggered as it may in + * turn cause harm in some edge cases. + */ + mii->mii_media.ifm_mask |= IFM_FLAG0; rgephy_reset(sc); MIIBUS_MEDIAINIT(sc->mii_dev); @@ -201,37 +208,38 @@ rgephy_service(struct mii_softc *sc, str speed = RGEPHY_S10; anar |= RGEPHY_ANAR_10_FD | RGEPHY_ANAR_10; setit: - rgephy_loop(sc); - if ((ife->ifm_media & IFM_GMASK) == IFM_FDX) { + if ((ife->ifm_media & IFM_FLOW) != 0 && + (mii->mii_media.ifm_media & IFM_FLAG0) != 0) + return (EINVAL); + + if ((ife->ifm_media & IFM_FDX) != 0) { speed |= RGEPHY_BMCR_FDX; gig = RGEPHY_1000CTL_AFD; anar &= ~(RGEPHY_ANAR_TX | RGEPHY_ANAR_10); + if ((ife->ifm_media & IFM_FLOW) != 0 || + (sc->mii_flags & MIIF_FORCEPAUSE) != 0) + anar |= + RGEPHY_ANAR_PC | RGEPHY_ANAR_ASP; } else { gig = RGEPHY_1000CTL_AHD; anar &= ~(RGEPHY_ANAR_TX_FD | RGEPHY_ANAR_10_FD); } - - if (IFM_SUBTYPE(ife->ifm_media) != IFM_1000_T) { - PHY_WRITE(sc, RGEPHY_MII_1000CTL, 0); - PHY_WRITE(sc, RGEPHY_MII_ANAR, anar); - PHY_WRITE(sc, RGEPHY_MII_BMCR, speed | - RGEPHY_BMCR_AUTOEN | - RGEPHY_BMCR_STARTNEG); - break; + if (IFM_SUBTYPE(ife->ifm_media) == IFM_1000_T) { + gig |= RGEPHY_1000CTL_MSE; + if ((ife->ifm_media & IFM_ETH_MASTER) != 0) + gig |= RGEPHY_1000CTL_MSC; + } else { + gig = 0; + anar &= ~RGEPHY_ANAR_ASP; } - - if ((ife->ifm_media & IFM_FLOW) != 0 || - (sc->mii_flags & MIIF_FORCEPAUSE) != 0) - anar |= RGEPHY_ANAR_PC | RGEPHY_ANAR_ASP; - - gig |= RGEPHY_1000CTL_MSE; - if ((ife->ifm_media & IFM_ETH_MASTER) != 0) - gig |= RGEPHY_1000CTL_MSC; + if ((mii->mii_media.ifm_media & IFM_FLAG0) == 0) + speed |= + RGEPHY_BMCR_AUTOEN | RGEPHY_BMCR_STARTNEG; + rgephy_loop(sc); PHY_WRITE(sc, RGEPHY_MII_1000CTL, gig); PHY_WRITE(sc, RGEPHY_MII_ANAR, anar); - PHY_WRITE(sc, RGEPHY_MII_BMCR, speed | - RGEPHY_BMCR_AUTOEN | RGEPHY_BMCR_STARTNEG); + PHY_WRITE(sc, RGEPHY_MII_BMCR, speed); break; case IFM_NONE: PHY_WRITE(sc, MII_BMCR, BMCR_ISO | BMCR_PDOWN); @@ -258,8 +266,7 @@ setit: /* * Check to see if we have link. If we do, we don't - * need to restart the autonegotiation process. Read - * the BMSR twice in case it's latched. + * need to restart the autonegotiation process. */ if (rsc->mii_revision >= 2) { /* RTL8211B(L) */ From owner-svn-src-all@FreeBSD.ORG Mon Jan 17 15:12:38 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 04E3F1065675; Mon, 17 Jan 2011 15:12:38 +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 E6E9C8FC14; Mon, 17 Jan 2011 15:12:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0HFCbNP004056; Mon, 17 Jan 2011 15:12:37 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0HFCbCE004054; Mon, 17 Jan 2011 15:12:37 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201101171512.p0HFCbCE004054@svn.freebsd.org> From: Marius Strobl Date: Mon, 17 Jan 2011 15:12:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217503 - stable/7/sys/dev/mii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jan 2011 15:12:38 -0000 Author: marius Date: Mon Jan 17 15:12:37 2011 New Revision: 217503 URL: http://svn.freebsd.org/changeset/base/217503 Log: MFC: r217415 - Allow IFM_FLAG0 to be set indicating that auto-negotiation with manual configuration, which is used to work around issues with certain setups (see r161237) by default, should not be triggered as it may in turn cause harm in some edge cases. - Even after masking the media with IFM_GMASK the result may have bits besides the duplex ones set so just comparing it with IFM_FDX may lead to false negatives. - Announce PAUSE support also for manually selected 1000BASE-T, but for all manually selected media types only in full-duplex mode. Announce asymmetric PAUSE support only for manually selected 1000BASE-T. - Simplify setting the manual configuration bits to only once after we have figured them all out. This also means we no longer unnecessarily update the hardware along the road. - Remove a stale comment. Reviewed by: yongari (plus additional testing) Modified: stable/7/sys/dev/mii/rgephy.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/mii/rgephy.c ============================================================================== --- stable/7/sys/dev/mii/rgephy.c Mon Jan 17 15:12:29 2011 (r217502) +++ stable/7/sys/dev/mii/rgephy.c Mon Jan 17 15:12:37 2011 (r217503) @@ -146,6 +146,13 @@ rgephy_attach(device_t dev) mii_phy_add_media(sc); printf("\n"); #undef ADD + /* + * Allow IFM_FLAG0 to be set indicating that auto-negotiation with + * manual configuration, which is used to work around issues with + * certain setups by default, should not be triggered as it may in + * turn cause harm in some edge cases. + */ + mii->mii_media.ifm_mask |= IFM_FLAG0; rgephy_reset(sc); MIIBUS_MEDIAINIT(sc->mii_dev); @@ -201,37 +208,38 @@ rgephy_service(struct mii_softc *sc, str speed = RGEPHY_S10; anar |= RGEPHY_ANAR_10_FD | RGEPHY_ANAR_10; setit: - rgephy_loop(sc); - if ((ife->ifm_media & IFM_GMASK) == IFM_FDX) { + if ((ife->ifm_media & IFM_FLOW) != 0 && + (mii->mii_media.ifm_media & IFM_FLAG0) != 0) + return (EINVAL); + + if ((ife->ifm_media & IFM_FDX) != 0) { speed |= RGEPHY_BMCR_FDX; gig = RGEPHY_1000CTL_AFD; anar &= ~(RGEPHY_ANAR_TX | RGEPHY_ANAR_10); + if ((ife->ifm_media & IFM_FLOW) != 0 || + (sc->mii_flags & MIIF_FORCEPAUSE) != 0) + anar |= + RGEPHY_ANAR_PC | RGEPHY_ANAR_ASP; } else { gig = RGEPHY_1000CTL_AHD; anar &= ~(RGEPHY_ANAR_TX_FD | RGEPHY_ANAR_10_FD); } - - if (IFM_SUBTYPE(ife->ifm_media) != IFM_1000_T) { - PHY_WRITE(sc, RGEPHY_MII_1000CTL, 0); - PHY_WRITE(sc, RGEPHY_MII_ANAR, anar); - PHY_WRITE(sc, RGEPHY_MII_BMCR, speed | - RGEPHY_BMCR_AUTOEN | - RGEPHY_BMCR_STARTNEG); - break; + if (IFM_SUBTYPE(ife->ifm_media) == IFM_1000_T) { + gig |= RGEPHY_1000CTL_MSE; + if ((ife->ifm_media & IFM_ETH_MASTER) != 0) + gig |= RGEPHY_1000CTL_MSC; + } else { + gig = 0; + anar &= ~RGEPHY_ANAR_ASP; } - - if ((ife->ifm_media & IFM_FLOW) != 0 || - (sc->mii_flags & MIIF_FORCEPAUSE) != 0) - anar |= RGEPHY_ANAR_PC | RGEPHY_ANAR_ASP; - - gig |= RGEPHY_1000CTL_MSE; - if ((ife->ifm_media & IFM_ETH_MASTER) != 0) - gig |= RGEPHY_1000CTL_MSC; + if ((mii->mii_media.ifm_media & IFM_FLAG0) == 0) + speed |= + RGEPHY_BMCR_AUTOEN | RGEPHY_BMCR_STARTNEG; + rgephy_loop(sc); PHY_WRITE(sc, RGEPHY_MII_1000CTL, gig); PHY_WRITE(sc, RGEPHY_MII_ANAR, anar); - PHY_WRITE(sc, RGEPHY_MII_BMCR, speed | - RGEPHY_BMCR_AUTOEN | RGEPHY_BMCR_STARTNEG); + PHY_WRITE(sc, RGEPHY_MII_BMCR, speed); break; case IFM_NONE: PHY_WRITE(sc, MII_BMCR, BMCR_ISO | BMCR_PDOWN); @@ -258,8 +266,7 @@ setit: /* * Check to see if we have link. If we do, we don't - * need to restart the autonegotiation process. Read - * the BMSR twice in case it's latched. + * need to restart the autonegotiation process. */ if (rsc->mii_revision >= 2) { /* RTL8211B(L) */ From owner-svn-src-all@FreeBSD.ORG Mon Jan 17 17:24:00 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2EFA6106564A; Mon, 17 Jan 2011 17:24:00 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1D6F28FC13; Mon, 17 Jan 2011 17:24:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0HHO0Br007469; Mon, 17 Jan 2011 17:24:00 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0HHO0hE007467; Mon, 17 Jan 2011 17:24:00 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201101171724.p0HHO0hE007467@svn.freebsd.org> From: Alexander Motin Date: Mon, 17 Jan 2011 17:23:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217504 - stable/8/sys/dev/ahci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jan 2011 17:24:00 -0000 Author: mav Date: Mon Jan 17 17:23:59 2011 New Revision: 217504 URL: http://svn.freebsd.org/changeset/base/217504 Log: MFC r217245: Add IDs for HighPoint RocketRAID 64x controllers. These controllers consist of two Marvell 88SE9128 6Gbps SATA chips and PLX PCIe bridge. As result, they seem to be agree to work with ahci(4) as usual HBAs. The only noticed issue is that RAID BIOS disables all drive caches during boot, though `camcontrol cmd ...` is able to fix that. Those who wants RAID functionality can still use closed proprietary driver from HighPoint site. Modified: stable/8/sys/dev/ahci/ahci.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/ahci/ahci.c ============================================================================== --- stable/8/sys/dev/ahci/ahci.c Mon Jan 17 15:12:37 2011 (r217503) +++ stable/8/sys/dev/ahci/ahci.c Mon Jan 17 17:23:59 2011 (r217504) @@ -176,6 +176,8 @@ static struct { {0x06201b4b, 0x00, "HighPoint RocketRAID 620", AHCI_Q_NOBSYRES}, {0x06221103, 0x00, "HighPoint RocketRAID 622", AHCI_Q_NOBSYRES}, {0x06221b4b, 0x00, "HighPoint RocketRAID 622", AHCI_Q_NOBSYRES}, + {0x06401103, 0x00, "HighPoint RocketRAID 640", AHCI_Q_NOBSYRES}, + {0x06441103, 0x00, "HighPoint RocketRAID 644", AHCI_Q_NOBSYRES}, {0x044c10de, 0x00, "NVIDIA MCP65", AHCI_Q_NOAA}, {0x044d10de, 0x00, "NVIDIA MCP65", AHCI_Q_NOAA}, {0x044e10de, 0x00, "NVIDIA MCP65", AHCI_Q_NOAA}, From owner-svn-src-all@FreeBSD.ORG Mon Jan 17 17:25:47 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4AF19106564A; Mon, 17 Jan 2011 17:25:47 +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 3A1E58FC12; Mon, 17 Jan 2011 17:25:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0HHPlJR007547; Mon, 17 Jan 2011 17:25:47 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0HHPlLw007545; Mon, 17 Jan 2011 17:25:47 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201101171725.p0HHPlLw007545@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Mon, 17 Jan 2011 17:25: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: r217505 - head/lib/libfetch X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jan 2011 17:25:47 -0000 Author: des Date: Mon Jan 17 17:25:46 2011 New Revision: 217505 URL: http://svn.freebsd.org/changeset/base/217505 Log: Fix a bug related to connection caching which could cause a crash after a STAT command. PR: kern/153748 (different patch) Submitted by: Mark Johnston MFC after: 2 weeks Modified: head/lib/libfetch/ftp.c Modified: head/lib/libfetch/ftp.c ============================================================================== --- head/lib/libfetch/ftp.c Mon Jan 17 17:23:59 2011 (r217504) +++ head/lib/libfetch/ftp.c Mon Jan 17 17:25:46 2011 (r217505) @@ -1132,6 +1132,7 @@ ftp_request(struct url *url, const char /* just a stat */ if (strcmp(op, "STAT") == 0) { + --conn->ref; ftp_disconnect(conn); return (FILE *)1; /* bogus return value */ } From owner-svn-src-all@FreeBSD.ORG Mon Jan 17 17:30:35 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 658D21065672; Mon, 17 Jan 2011 17:30:35 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 54B1E8FC0A; Mon, 17 Jan 2011 17:30:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0HHUZ8f007706; Mon, 17 Jan 2011 17:30:35 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0HHUZG5007703; Mon, 17 Jan 2011 17:30:35 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201101171730.p0HHUZG5007703@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 17 Jan 2011 17:30:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217506 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jan 2011 17:30:35 -0000 Author: jkim Date: Mon Jan 17 17:30:35 2011 New Revision: 217506 URL: http://svn.freebsd.org/changeset/base/217506 Log: Avoid preemption while manipulating CRs and MTRRs. Tested by: ariff Modified: head/sys/amd64/amd64/amd64_mem.c head/sys/i386/i386/i686_mem.c Modified: head/sys/amd64/amd64/amd64_mem.c ============================================================================== --- head/sys/amd64/amd64/amd64_mem.c Mon Jan 17 17:25:46 2011 (r217505) +++ head/sys/amd64/amd64/amd64_mem.c Mon Jan 17 17:30:35 2011 (r217506) @@ -311,6 +311,8 @@ amd64_mrstoreone(void *arg) mrd = sc->mr_desc; + critical_enter(); + /* Disable PGE. */ cr4 = rcr4(); load_cr4(cr4 & ~CR4_PGE); @@ -399,6 +401,8 @@ amd64_mrstoreone(void *arg) /* Restore caches and PGE. */ load_cr0(cr0); load_cr4(cr4); + + critical_exit(); } /* Modified: head/sys/i386/i386/i686_mem.c ============================================================================== --- head/sys/i386/i386/i686_mem.c Mon Jan 17 17:25:46 2011 (r217505) +++ head/sys/i386/i386/i686_mem.c Mon Jan 17 17:30:35 2011 (r217506) @@ -305,6 +305,8 @@ i686_mrstoreone(void *arg) mrd = sc->mr_desc; + critical_enter(); + /* Disable PGE. */ cr4 = rcr4(); load_cr4(cr4 & ~CR4_PGE); @@ -393,6 +395,8 @@ i686_mrstoreone(void *arg) /* Restore caches and PGE. */ load_cr0(cr0); load_cr4(cr4); + + critical_exit(); } /* From owner-svn-src-all@FreeBSD.ORG Mon Jan 17 19:17:26 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 937F01065672; Mon, 17 Jan 2011 19:17:26 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 691018FC12; Mon, 17 Jan 2011 19:17:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0HJHQpk010251; Mon, 17 Jan 2011 19:17:26 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0HJHQqW010246; Mon, 17 Jan 2011 19:17:26 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201101171917.p0HJHQqW010246@svn.freebsd.org> From: Alan Cox Date: Mon, 17 Jan 2011 19:17:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217508 - head/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jan 2011 19:17:26 -0000 Author: alc Date: Mon Jan 17 19:17:26 2011 New Revision: 217508 URL: http://svn.freebsd.org/changeset/base/217508 Log: Explicitly initialize the page's queue field to PQ_NONE instead of relying on PQ_NONE being zero. Redefine PQ_NONE and PQ_COUNT so that a page queue isn't allocated for PQ_NONE. Reviewed by: kib@ Modified: head/sys/vm/device_pager.c head/sys/vm/sg_pager.c head/sys/vm/vm_page.h head/sys/vm/vm_phys.c Modified: head/sys/vm/device_pager.c ============================================================================== --- head/sys/vm/device_pager.c Mon Jan 17 18:58:28 2011 (r217507) +++ head/sys/vm/device_pager.c Mon Jan 17 19:17:26 2011 (r217508) @@ -318,6 +318,7 @@ dev_pager_getfake(vm_paddr_t paddr, vm_m m = uma_zalloc(fakepg_zone, M_WAITOK | M_ZERO); m->phys_addr = paddr; + m->queue = PQ_NONE; /* Fictitious pages don't use "segind". */ m->flags = PG_FICTITIOUS; /* Fictitious pages don't use "order" or "pool". */ Modified: head/sys/vm/sg_pager.c ============================================================================== --- head/sys/vm/sg_pager.c Mon Jan 17 18:58:28 2011 (r217507) +++ head/sys/vm/sg_pager.c Mon Jan 17 19:17:26 2011 (r217508) @@ -242,6 +242,7 @@ sg_pager_getfake(vm_paddr_t paddr, vm_me m = uma_zalloc(fakepg_zone, M_WAITOK | M_ZERO); m->phys_addr = paddr; + m->queue = PQ_NONE; /* Fictitious pages don't use "segind". */ m->flags = PG_FICTITIOUS; /* Fictitious pages don't use "order" or "pool". */ Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Mon Jan 17 18:58:28 2011 (r217507) +++ head/sys/vm/vm_page.h Mon Jan 17 19:17:26 2011 (r217508) @@ -146,11 +146,11 @@ struct vm_page { #define VPO_SWAPINPROG 0x0200 /* swap I/O in progress on page */ #define VPO_NOSYNC 0x0400 /* do not collect for syncer */ -#define PQ_NONE 0 -#define PQ_INACTIVE 1 -#define PQ_ACTIVE 2 -#define PQ_HOLD 3 -#define PQ_COUNT 4 +#define PQ_NONE 255 +#define PQ_INACTIVE 0 +#define PQ_ACTIVE 1 +#define PQ_HOLD 2 +#define PQ_COUNT 3 struct vpgqueues { struct pglist pl; Modified: head/sys/vm/vm_phys.c ============================================================================== --- head/sys/vm/vm_phys.c Mon Jan 17 18:58:28 2011 (r217507) +++ head/sys/vm/vm_phys.c Mon Jan 17 19:17:26 2011 (r217508) @@ -385,6 +385,7 @@ vm_phys_add_page(vm_paddr_t pa) cnt.v_page_count++; m = vm_phys_paddr_to_vm_page(pa); m->phys_addr = pa; + m->queue = PQ_NONE; m->segind = vm_phys_paddr_to_segind(pa); m->flags = PG_FREE; KASSERT(m->order == VM_NFREEORDER, From owner-svn-src-all@FreeBSD.ORG Mon Jan 17 19:31:35 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 235F51065670; Mon, 17 Jan 2011 19:31:35 +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 135018FC0C; Mon, 17 Jan 2011 19:31:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0HJVYec010570; Mon, 17 Jan 2011 19:31:34 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0HJVYKv010568; Mon, 17 Jan 2011 19:31:34 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201101171931.p0HJVYKv010568@svn.freebsd.org> From: Alexander Motin Date: Mon, 17 Jan 2011 19:31:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217509 - head/sys/dev/mmc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jan 2011 19:31:35 -0000 Author: mav Date: Mon Jan 17 19:31:34 2011 New Revision: 217509 URL: http://svn.freebsd.org/changeset/base/217509 Log: Fix 32bit bit fields handling. This fixes card serial number fetching. It was just a cosmetic issue, because that number is only reported in logs. Reported by: Michael Butler on current@ Modified: head/sys/dev/mmc/mmc.c Modified: head/sys/dev/mmc/mmc.c ============================================================================== --- head/sys/dev/mmc/mmc.c Mon Jan 17 19:17:26 2011 (r217508) +++ head/sys/dev/mmc/mmc.c Mon Jan 17 19:31:34 2011 (r217509) @@ -749,7 +749,7 @@ mmc_get_bits(uint32_t *bits, int bit_len uint32_t retval = bits[i] >> shift; if (size + shift > 32) retval |= bits[i - 1] << (32 - shift); - return (retval & ((1 << size) - 1)); + return (retval & ((1llu << size) - 1)); } static void From owner-svn-src-all@FreeBSD.ORG Mon Jan 17 20:15:16 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 19BA1106566B; Mon, 17 Jan 2011 20:15:16 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 077088FC1B; Mon, 17 Jan 2011 20:15:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0HKFFPx011642; Mon, 17 Jan 2011 20:15:15 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0HKFFKO011631; Mon, 17 Jan 2011 20:15:15 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201101172015.p0HKFFKO011631@svn.freebsd.org> From: Bernhard Schmidt Date: Mon, 17 Jan 2011 20:15:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217511 - in head/sys: dev/bwi dev/bwn dev/iwn dev/ral dev/usb/wlan dev/wpi net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jan 2011 20:15:16 -0000 Author: bschmidt Date: Mon Jan 17 20:15:15 2011 New Revision: 217511 URL: http://svn.freebsd.org/changeset/base/217511 Log: Pull ieee80211_ratectl_node_init() calls from drivers into net80211. This fixes hostap mode for at least ral(4) and run(4), because there is no sufficient call into drivers which could be used initialize the node related ratectl variables. MFC after: 3 days Modified: head/sys/dev/bwi/if_bwi.c head/sys/dev/bwn/if_bwn.c head/sys/dev/iwn/if_iwn.c head/sys/dev/ral/rt2560.c head/sys/dev/ral/rt2661.c head/sys/dev/usb/wlan/if_rum.c head/sys/dev/usb/wlan/if_run.c head/sys/dev/usb/wlan/if_ural.c head/sys/dev/wpi/if_wpi.c head/sys/net80211/ieee80211_node.c Modified: head/sys/dev/bwi/if_bwi.c ============================================================================== --- head/sys/dev/bwi/if_bwi.c Mon Jan 17 19:53:23 2011 (r217510) +++ head/sys/dev/bwi/if_bwi.c Mon Jan 17 20:15:15 2011 (r217511) @@ -1769,7 +1769,6 @@ static int bwi_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) { struct bwi_vap *bvp = BWI_VAP(vap); - const struct ieee80211_txparam *tp; struct ieee80211com *ic= vap->iv_ic; struct ifnet *ifp = ic->ic_ifp; enum ieee80211_state ostate = vap->iv_state; @@ -1823,11 +1822,6 @@ bwi_newstate(struct ieee80211vap *vap, e sc->sc_txpwrcb_type = BWI_TXPWR_CALIB; #endif - /* Initializes ratectl for a node. */ - tp = &vap->iv_txparms[ieee80211_chan2mode(ic->ic_curchan)]; - if (tp->ucastrate == IEEE80211_FIXED_RATE_NONE) - ieee80211_ratectl_node_init(vap->iv_bss); - callout_reset(&sc->sc_calib_ch, hz, bwi_calibrate, sc); } back: Modified: head/sys/dev/bwn/if_bwn.c ============================================================================== --- head/sys/dev/bwn/if_bwn.c Mon Jan 17 19:53:23 2011 (r217510) +++ head/sys/dev/bwn/if_bwn.c Mon Jan 17 20:15:15 2011 (r217511) @@ -8329,7 +8329,6 @@ bwn_phy_reset(struct bwn_mac *mac) static int bwn_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) { - const struct ieee80211_txparam *tp; struct bwn_vap *bvp = BWN_VAP(vap); struct ieee80211com *ic= vap->iv_ic; struct ifnet *ifp = ic->ic_ifp; @@ -8378,11 +8377,6 @@ bwn_newstate(struct ieee80211vap *vap, e bwn_set_pretbtt(mac); bwn_spu_setdelay(mac, 0); bwn_set_macaddr(mac); - - /* Initializes ratectl for a node. */ - tp = &vap->iv_txparms[ieee80211_chan2mode(ic->ic_curchan)]; - if (tp->ucastrate == IEEE80211_FIXED_RATE_NONE) - ieee80211_ratectl_node_init(vap->iv_bss); } BWN_UNLOCK(sc); Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Mon Jan 17 19:53:23 2011 (r217510) +++ head/sys/dev/iwn/if_iwn.c Mon Jan 17 20:15:15 2011 (r217511) @@ -122,7 +122,6 @@ static void iwn_read_eeprom_channels(str static void iwn_read_eeprom_enhinfo(struct iwn_softc *); static struct ieee80211_node *iwn_node_alloc(struct ieee80211vap *, const uint8_t mac[IEEE80211_ADDR_LEN]); -static void iwn_newassoc(struct ieee80211_node *, int); static int iwn_media_change(struct ifnet *); static int iwn_newstate(struct ieee80211vap *, enum ieee80211_state, int); static void iwn_rx_phy(struct iwn_softc *, struct iwn_rx_desc *, @@ -652,7 +651,6 @@ iwn_attach(device_t dev) ic->ic_vap_delete = iwn_vap_delete; ic->ic_raw_xmit = iwn_raw_xmit; ic->ic_node_alloc = iwn_node_alloc; - ic->ic_newassoc = iwn_newassoc; ic->ic_wme.wme_update = iwn_wme_update; ic->ic_update_mcast = iwn_update_mcast; ic->ic_scan_start = iwn_scan_start; @@ -1929,13 +1927,6 @@ iwn_node_alloc(struct ieee80211vap *vap, return malloc(sizeof (struct iwn_node), M_80211_NODE,M_NOWAIT | M_ZERO); } -static void -iwn_newassoc(struct ieee80211_node *ni, int isnew) -{ - /* XXX move */ - ieee80211_ratectl_node_init(ni); -} - static int iwn_media_change(struct ifnet *ifp) { Modified: head/sys/dev/ral/rt2560.c ============================================================================== --- head/sys/dev/ral/rt2560.c Mon Jan 17 19:53:23 2011 (r217510) +++ head/sys/dev/ral/rt2560.c Mon Jan 17 20:15:15 2011 (r217511) @@ -103,7 +103,6 @@ static void rt2560_reset_rx_ring(struct struct rt2560_rx_ring *); static void rt2560_free_rx_ring(struct rt2560_softc *, struct rt2560_rx_ring *); -static void rt2560_newassoc(struct ieee80211_node *, int); static int rt2560_newstate(struct ieee80211vap *, enum ieee80211_state, int); static uint16_t rt2560_eeprom_read(struct rt2560_softc *, uint8_t); @@ -301,7 +300,6 @@ rt2560_attach(device_t dev, int id) ieee80211_init_channels(ic, NULL, &bands); ieee80211_ifattach(ic, macaddr); - ic->ic_newassoc = rt2560_newassoc; ic->ic_raw_xmit = rt2560_raw_xmit; ic->ic_updateslot = rt2560_update_slot; ic->ic_update_promisc = rt2560_update_promisc; @@ -757,13 +755,6 @@ rt2560_free_rx_ring(struct rt2560_softc bus_dma_tag_destroy(ring->data_dmat); } -static void -rt2560_newassoc(struct ieee80211_node *ni, int isnew) -{ - /* XXX move */ - ieee80211_ratectl_node_init(ni); -} - static int rt2560_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) { Modified: head/sys/dev/ral/rt2661.c ============================================================================== --- head/sys/dev/ral/rt2661.c Mon Jan 17 19:53:23 2011 (r217510) +++ head/sys/dev/ral/rt2661.c Mon Jan 17 20:15:15 2011 (r217511) @@ -100,7 +100,6 @@ static void rt2661_reset_rx_ring(struct struct rt2661_rx_ring *); static void rt2661_free_rx_ring(struct rt2661_softc *, struct rt2661_rx_ring *); -static void rt2661_newassoc(struct ieee80211_node *, int); static int rt2661_newstate(struct ieee80211vap *, enum ieee80211_state, int); static uint16_t rt2661_eeprom_read(struct rt2661_softc *, uint8_t); @@ -304,7 +303,6 @@ rt2661_attach(device_t dev, int id) ieee80211_init_channels(ic, NULL, &bands); ieee80211_ifattach(ic, macaddr); - ic->ic_newassoc = rt2661_newassoc; #if 0 ic->ic_wme.wme_update = rt2661_wme_update; #endif @@ -764,13 +762,6 @@ rt2661_free_rx_ring(struct rt2661_softc bus_dma_tag_destroy(ring->data_dmat); } -static void -rt2661_newassoc(struct ieee80211_node *ni, int isnew) -{ - /* XXX move */ - ieee80211_ratectl_node_init(ni); -} - static int rt2661_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) { Modified: head/sys/dev/usb/wlan/if_rum.c ============================================================================== --- head/sys/dev/usb/wlan/if_rum.c Mon Jan 17 19:53:23 2011 (r217510) +++ head/sys/dev/usb/wlan/if_rum.c Mon Jan 17 20:15:15 2011 (r217511) @@ -2207,8 +2207,6 @@ rum_ratectl_start(struct rum_softc *sc, /* clear statistic registers (STA_CSR0 to STA_CSR5) */ rum_read_multi(sc, RT2573_STA_CSR0, sc->sta, sizeof sc->sta); - ieee80211_ratectl_node_init(ni); - usb_callout_reset(&rvp->ratectl_ch, hz, rum_ratectl_timeout, rvp); } Modified: head/sys/dev/usb/wlan/if_run.c ============================================================================== --- head/sys/dev/usb/wlan/if_run.c Mon Jan 17 19:53:23 2011 (r217510) +++ head/sys/dev/usb/wlan/if_run.c Mon Jan 17 20:15:15 2011 (r217511) @@ -2376,7 +2376,6 @@ run_newassoc(struct ieee80211_node *ni, DPRINTF("new assoc isnew=%d associd=%x addr=%s\n", isnew, ni->ni_associd, ether_sprintf(ni->ni_macaddr)); - ieee80211_ratectl_node_init(ni); sc->sc_ni[wcid] = ni; for (i = 0; i < rs->rs_nrates; i++) { Modified: head/sys/dev/usb/wlan/if_ural.c ============================================================================== --- head/sys/dev/usb/wlan/if_ural.c Mon Jan 17 19:53:23 2011 (r217510) +++ head/sys/dev/usb/wlan/if_ural.c Mon Jan 17 20:15:15 2011 (r217511) @@ -2215,8 +2215,6 @@ ural_ratectl_start(struct ural_softc *sc /* clear statistic registers (STA_CSR0 to STA_CSR10) */ ural_read_multi(sc, RAL_STA_CSR0, sc->sta, sizeof sc->sta); - ieee80211_ratectl_node_init(ni); - usb_callout_reset(&uvp->ratectl_ch, hz, ural_ratectl_timeout, uvp); } Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Mon Jan 17 19:53:23 2011 (r217510) +++ head/sys/dev/wpi/if_wpi.c Mon Jan 17 20:15:15 2011 (r217511) @@ -174,7 +174,6 @@ static int wpi_alloc_tx_ring(struct wpi_ int, int); static void wpi_reset_tx_ring(struct wpi_softc *, struct wpi_tx_ring *); static void wpi_free_tx_ring(struct wpi_softc *, struct wpi_tx_ring *); -static void wpi_newassoc(struct ieee80211_node *, int); static int wpi_newstate(struct ieee80211vap *, enum ieee80211_state, int); static void wpi_mem_lock(struct wpi_softc *); static void wpi_mem_unlock(struct wpi_softc *); @@ -668,7 +667,6 @@ wpi_attach(device_t dev) ieee80211_ifattach(ic, macaddr); /* override default methods */ ic->ic_raw_xmit = wpi_raw_xmit; - ic->ic_newassoc = wpi_newassoc; ic->ic_wme.wme_update = wpi_wme_update; ic->ic_scan_start = wpi_scan_start; ic->ic_scan_end = wpi_scan_end; @@ -3233,14 +3231,6 @@ wpi_stop(struct wpi_softc *sc) } static void -wpi_newassoc(struct ieee80211_node *ni, int isnew) -{ - - /* XXX move */ - ieee80211_ratectl_node_init(ni); -} - -static void wpi_calib_timeout(void *arg) { struct wpi_softc *sc = arg; Modified: head/sys/net80211/ieee80211_node.c ============================================================================== --- head/sys/net80211/ieee80211_node.c Mon Jan 17 19:53:23 2011 (r217510) +++ head/sys/net80211/ieee80211_node.c Mon Jan 17 20:15:15 2011 (r217511) @@ -1137,6 +1137,8 @@ ieee80211_alloc_node(struct ieee80211_no IEEE80211_NOTE(vap, IEEE80211_MSG_INACT, ni, "%s: inact_reload %u", __func__, ni->ni_inact_reload); + ieee80211_ratectl_node_init(ni); + return ni; } @@ -1174,6 +1176,8 @@ ieee80211_tmp_node(struct ieee80211vap * ni->ni_txpower = bss->ni_txpower; /* XXX optimize away */ ieee80211_psq_init(&ni->ni_psq, "unknown"); + + ieee80211_ratectl_node_init(ni); } else { /* XXX msg */ vap->iv_stats.is_rx_nodealloc++; From owner-svn-src-all@FreeBSD.ORG Mon Jan 17 20:19:36 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4CF9010656B0; Mon, 17 Jan 2011 20:19:36 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3C1C88FC28; Mon, 17 Jan 2011 20:19:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0HKJaZB011788; Mon, 17 Jan 2011 20:19:36 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0HKJata011786; Mon, 17 Jan 2011 20:19:36 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201101172019.p0HKJata011786@svn.freebsd.org> From: Bernhard Schmidt Date: Mon, 17 Jan 2011 20:19:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217512 - stable/8/sys/dev/if_ndis X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jan 2011 20:19:36 -0000 Author: bschmidt Date: Mon Jan 17 20:19:35 2011 New Revision: 217512 URL: http://svn.freebsd.org/changeset/base/217512 Log: MFC r217118: Don't try to free an unassigned pointer. Submitted by: Paul B Mahol Modified: stable/8/sys/dev/if_ndis/if_ndis.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/if_ndis/if_ndis.c ============================================================================== --- stable/8/sys/dev/if_ndis/if_ndis.c Mon Jan 17 20:15:15 2011 (r217511) +++ stable/8/sys/dev/if_ndis/if_ndis.c Mon Jan 17 20:19:35 2011 (r217512) @@ -1176,11 +1176,8 @@ ndis_rxeof_eth(adapter, ctx, addr, hdr, block = adapter; m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); - - if (m == NULL) { - NdisFreePacket(p); + if (m == NULL) return; - } /* Save the data provided to us so far. */ From owner-svn-src-all@FreeBSD.ORG Mon Jan 17 20:22:03 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 80CDA106566B; Mon, 17 Jan 2011 20:22:03 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6B2F88FC0A; Mon, 17 Jan 2011 20:22:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0HKM3VT011892; Mon, 17 Jan 2011 20:22:03 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0HKM30o011890; Mon, 17 Jan 2011 20:22:03 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201101172022.p0HKM30o011890@svn.freebsd.org> From: Bernhard Schmidt Date: Mon, 17 Jan 2011 20:22:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217513 - stable/8/sys/dev/mwl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jan 2011 20:22:03 -0000 Author: bschmidt Date: Mon Jan 17 20:22:03 2011 New Revision: 217513 URL: http://svn.freebsd.org/changeset/base/217513 Log: MFC r216835: The mwl's HAL manages an array of MWL_MBSS_MAX VAPs where the first 8 are supposed to be APs and the later 24 are pre-configured as STAs. A wrong condition during initialization is responsible for not configuring the last 8 array members. This is results in being able to create more than 8, possible uninitialized, AP-VAPs. Submitted by: Erik Fonnesbeck Modified: stable/8/sys/dev/mwl/mwlhal.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/mwl/mwlhal.c ============================================================================== --- stable/8/sys/dev/mwl/mwlhal.c Mon Jan 17 20:19:35 2011 (r217512) +++ stable/8/sys/dev/mwl/mwlhal.c Mon Jan 17 20:22:03 2011 (r217513) @@ -279,7 +279,7 @@ mwl_hal_attach(device_t dev, uint16_t de hvap->vap_type = MWL_HAL_STA; hvap->bss_type = htole16(WL_MAC_TYPE_PRIMARY_CLIENT); hvap->macid = i; - for (i++; i < MWL_MBSS_STA_MAX; i++) { + for (i++; i < MWL_MBSS_MAX; i++) { hvap = &mh->mh_vaps[i]; hvap->vap_type = MWL_HAL_STA; hvap->bss_type = htole16(WL_MAC_TYPE_SECONDARY_CLIENT); From owner-svn-src-all@FreeBSD.ORG Mon Jan 17 20:32:17 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 60E531065673; Mon, 17 Jan 2011 20:32:17 +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 4FB4D8FC0A; Mon, 17 Jan 2011 20:32:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0HKWHuJ012164; Mon, 17 Jan 2011 20:32:17 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0HKWHUk012161; Mon, 17 Jan 2011 20:32:17 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201101172032.p0HKWHUk012161@svn.freebsd.org> From: Marius Strobl Date: Mon, 17 Jan 2011 20:32: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: r217514 - head/sys/sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jan 2011 20:32:17 -0000 Author: marius Date: Mon Jan 17 20:32:17 2011 New Revision: 217514 URL: http://svn.freebsd.org/changeset/base/217514 Log: In order to save instructions the MMU trap handlers assumed that the kernel TSB is located within the 32-bit address space, which held true as long as we were using virtual addresses magic-mapped before the location of the kernel for addressing it. However, with r216803 in place when possible we address it via its physical address instead, which on machines like Sun Fire V880 have no physical memory in the 32-bit address space at all requires to use 64-bit addressing. When using physical addressing it still should be safe to assume that we can just ignore the lowest 10 bits of the address as a minor optimization as we did before r216803. Modified: head/sys/sparc64/sparc64/exception.S head/sys/sparc64/sparc64/pmap.c Modified: head/sys/sparc64/sparc64/exception.S ============================================================================== --- head/sys/sparc64/sparc64/exception.S Mon Jan 17 20:22:03 2011 (r217513) +++ head/sys/sparc64/sparc64/exception.S Mon Jan 17 20:32:17 2011 (r217514) @@ -1331,14 +1331,17 @@ END(tl1_sfsr_trap) * Compute the address of the TTE. The TSB mask and address of the * TSB are patched at startup. */ + .globl tl1_immu_miss_patch_tsb_1 +tl1_immu_miss_patch_tsb_1: + sethi %uhi(TSB_KERNEL), %g6 + or %g6, %ulo(TSB_KERNEL), %g6 + sllx %g6, 32, %g6 + sethi %hi(TSB_KERNEL), %g7 + or %g7, %g6, %g7 .globl tl1_immu_miss_patch_tsb_mask_1 tl1_immu_miss_patch_tsb_mask_1: sethi %hi(TSB_KERNEL_MASK), %g6 or %g6, %lo(TSB_KERNEL_MASK), %g6 - .globl tl1_immu_miss_patch_tsb_1 -tl1_immu_miss_patch_tsb_1: - sethi %hi(TSB_KERNEL), %g7 - or %g7, %lo(TSB_KERNEL), %g7 srlx %g5, TAR_VPN_SHIFT, %g5 and %g5, %g6, %g6 @@ -1384,14 +1387,17 @@ ENTRY(tl1_immu_miss_set_ref) * Recompute the TTE address, which we clobbered loading the TTE. * The TSB mask and address of the TSB are patched at startup. */ + .globl tl1_immu_miss_patch_tsb_2 +tl1_immu_miss_patch_tsb_2: + sethi %uhi(TSB_KERNEL), %g6 + or %g6, %ulo(TSB_KERNEL), %g6 + sllx %g6, 32, %g6 + sethi %hi(TSB_KERNEL), %g7 + or %g7, %g6, %g7 .globl tl1_immu_miss_patch_tsb_mask_2 tl1_immu_miss_patch_tsb_mask_2: sethi %hi(TSB_KERNEL_MASK), %g6 or %g6, %lo(TSB_KERNEL_MASK), %g6 - .globl tl1_immu_miss_patch_tsb_2 -tl1_immu_miss_patch_tsb_2: - sethi %hi(TSB_KERNEL), %g7 - or %g7, %lo(TSB_KERNEL), %g7 and %g5, %g6, %g5 sllx %g5, TTE_SHIFT, %g5 @@ -1462,14 +1468,17 @@ END(tl1_immu_miss_trap) * Compute the address of the TTE. The TSB mask and address of the * TSB are patched at startup. */ + .globl tl1_dmmu_miss_patch_tsb_1 +tl1_dmmu_miss_patch_tsb_1: + sethi %uhi(TSB_KERNEL), %g6 + or %g6, %ulo(TSB_KERNEL), %g6 + sllx %g6, 32, %g6 + sethi %hi(TSB_KERNEL), %g7 + or %g7, %g6, %g7 .globl tl1_dmmu_miss_patch_tsb_mask_1 tl1_dmmu_miss_patch_tsb_mask_1: sethi %hi(TSB_KERNEL_MASK), %g6 or %g6, %lo(TSB_KERNEL_MASK), %g6 - .globl tl1_dmmu_miss_patch_tsb_1 -tl1_dmmu_miss_patch_tsb_1: - sethi %hi(TSB_KERNEL), %g7 - or %g7, %lo(TSB_KERNEL), %g7 srlx %g5, TAR_VPN_SHIFT, %g5 and %g5, %g6, %g6 @@ -1513,13 +1522,16 @@ ENTRY(tl1_dmmu_miss_set_ref) * The TSB mask and address of the TSB are patched at startup. */ .globl tl1_dmmu_miss_patch_tsb_mask_2 +tl1_dmmu_miss_patch_tsb_2: + sethi %uhi(TSB_KERNEL), %g6 + or %g6, %ulo(TSB_KERNEL), %g6 + sllx %g6, 32, %g6 + sethi %hi(TSB_KERNEL), %g7 + or %g7, %g6, %g7 + .globl tl1_dmmu_miss_patch_tsb_2 tl1_dmmu_miss_patch_tsb_mask_2: sethi %hi(TSB_KERNEL_MASK), %g6 or %g6, %lo(TSB_KERNEL_MASK), %g6 - .globl tl1_dmmu_miss_patch_tsb_2 -tl1_dmmu_miss_patch_tsb_2: - sethi %hi(TSB_KERNEL), %g7 - or %g7, %lo(TSB_KERNEL), %g7 and %g5, %g6, %g5 sllx %g5, TTE_SHIFT, %g5 @@ -1581,15 +1593,21 @@ ENTRY(tl1_dmmu_miss_direct) and %g5, %g6, %g5 .globl tl1_dmmu_miss_direct_patch_tsb_phys_1 tl1_dmmu_miss_direct_patch_tsb_phys_1: - sethi %hi(TSB_KERNEL_PHYS), %g7 - or %g7, %lo(TSB_KERNEL_PHYS), %g7 + sethi %uhi(TSB_KERNEL_PHYS), %g3 + or %g3, %ulo(TSB_KERNEL_PHYS), %g3 + sllx %g3, 32, %g3 + sethi %hi(TSB_KERNEL_PHYS), %g3 + or %g7, %g3, %g7 cmp %g4, %g7 bl,pt %xcc, 1f or %g5, TD_CP | TD_W, %g5 .globl tl1_dmmu_miss_direct_patch_tsb_phys_end_1 tl1_dmmu_miss_direct_patch_tsb_phys_end_1: + sethi %uhi(TSB_KERNEL_PHYS_END), %g3 + or %g3, %ulo(TSB_KERNEL_PHYS_END), %g3 + sllx %g3, 32, %g3 sethi %hi(TSB_KERNEL_PHYS_END), %g7 - or %g7, %lo(TSB_KERNEL_PHYS_END), %g7 + or %g7, %g3, %g7 cmp %g4, %g7 bg,a,pt %xcc, 1f nop @@ -1631,14 +1649,17 @@ ENTRY(tl1_dmmu_prot_1) * Compute the address of the TTE. The TSB mask and address of the * TSB are patched at startup. */ + .globl tl1_dmmu_prot_patch_tsb_1 +tl1_dmmu_prot_patch_tsb_1: + sethi %uhi(TSB_KERNEL), %g6 + or %g6, %ulo(TSB_KERNEL), %g6 + sllx %g6, 32, %g6 + sethi %hi(TSB_KERNEL), %g7 + or %g7, %g6, %g7 .globl tl1_dmmu_prot_patch_tsb_mask_1 tl1_dmmu_prot_patch_tsb_mask_1: sethi %hi(TSB_KERNEL_MASK), %g6 or %g6, %lo(TSB_KERNEL_MASK), %g6 - .globl tl1_dmmu_prot_patch_tsb_1 -tl1_dmmu_prot_patch_tsb_1: - sethi %hi(TSB_KERNEL), %g7 - or %g7, %lo(TSB_KERNEL), %g7 srlx %g5, TAR_VPN_SHIFT, %g5 and %g5, %g6, %g6 @@ -1677,15 +1698,17 @@ tl1_dmmu_prot_patch_quad_ldd_1: * Recompute the TTE address, which we clobbered loading the TTE. * The TSB mask and address of the TSB are patched at startup. */ + .globl tl1_dmmu_prot_patch_tsb_2 +tl1_dmmu_prot_patch_tsb_2: + sethi %uhi(TSB_KERNEL), %g6 + or %g6, %ulo(TSB_KERNEL), %g6 + sllx %g6, 32, %g6 + sethi %hi(TSB_KERNEL), %g7 + or %g7, %g6, %g7 .globl tl1_dmmu_prot_patch_tsb_mask_2 tl1_dmmu_prot_patch_tsb_mask_2: sethi %hi(TSB_KERNEL_MASK), %g6 or %g6, %lo(TSB_KERNEL_MASK), %g6 - .globl tl1_dmmu_prot_patch_tsb_2 -tl1_dmmu_prot_patch_tsb_2: - sethi %hi(TSB_KERNEL), %g7 - or %g7, %lo(TSB_KERNEL), %g7 - and %g5, %g6, %g5 sllx %g5, TTE_SHIFT, %g5 add %g5, %g7, %g5 Modified: head/sys/sparc64/sparc64/pmap.c ============================================================================== --- head/sys/sparc64/sparc64/pmap.c Mon Jan 17 20:22:03 2011 (r217513) +++ head/sys/sparc64/sparc64/pmap.c Mon Jan 17 20:32:17 2011 (r217514) @@ -482,6 +482,21 @@ pmap_bootstrap(u_int cpu_impl) #define PATCH_TSB(addr, val) do { \ if (addr[0] != SETHI(IF_F2_RD(addr[0]), 0x0) || \ addr[1] != OR_R_I_R(IF_F3_RD(addr[1]), 0x0, \ + IF_F3_RS1(addr[1])) || \ + addr[3] != SETHI(IF_F2_RD(addr[3]), 0x0)) \ + panic("%s: patched instructions have changed", \ + __func__); \ + addr[0] |= EIF_IMM((val) >> 42, 22); \ + addr[1] |= EIF_IMM((val) >> 32, 10); \ + addr[3] |= EIF_IMM((val) >> 10, 22); \ + flush(addr); \ + flush(addr + 1); \ + flush(addr + 3); \ +} while (0) + +#define PATCH_TSB_MASK(addr, val) do { \ + if (addr[0] != SETHI(IF_F2_RD(addr[0]), 0x0) || \ + addr[1] != OR_R_I_R(IF_F3_RD(addr[1]), 0x0, \ IF_F3_RS1(addr[1]))) \ panic("%s: patched instructions have changed", \ __func__); \ @@ -507,20 +522,20 @@ pmap_bootstrap(u_int cpu_impl) PATCH_LDD(tl1_dmmu_miss_patch_quad_ldd_1, ldd); PATCH_TSB(tl1_dmmu_miss_patch_tsb_1, off); PATCH_TSB(tl1_dmmu_miss_patch_tsb_2, off); - PATCH_TSB(tl1_dmmu_miss_patch_tsb_mask_1, tsb_kernel_mask); - PATCH_TSB(tl1_dmmu_miss_patch_tsb_mask_2, tsb_kernel_mask); + PATCH_TSB_MASK(tl1_dmmu_miss_patch_tsb_mask_1, tsb_kernel_mask); + PATCH_TSB_MASK(tl1_dmmu_miss_patch_tsb_mask_2, tsb_kernel_mask); PATCH_ASI(tl1_dmmu_prot_patch_asi_1, asi); PATCH_LDD(tl1_dmmu_prot_patch_quad_ldd_1, ldd); PATCH_TSB(tl1_dmmu_prot_patch_tsb_1, off); PATCH_TSB(tl1_dmmu_prot_patch_tsb_2, off); - PATCH_TSB(tl1_dmmu_prot_patch_tsb_mask_1, tsb_kernel_mask); - PATCH_TSB(tl1_dmmu_prot_patch_tsb_mask_2, tsb_kernel_mask); + PATCH_TSB_MASK(tl1_dmmu_prot_patch_tsb_mask_1, tsb_kernel_mask); + PATCH_TSB_MASK(tl1_dmmu_prot_patch_tsb_mask_2, tsb_kernel_mask); PATCH_ASI(tl1_immu_miss_patch_asi_1, asi); PATCH_LDD(tl1_immu_miss_patch_quad_ldd_1, ldd); PATCH_TSB(tl1_immu_miss_patch_tsb_1, off); PATCH_TSB(tl1_immu_miss_patch_tsb_2, off); - PATCH_TSB(tl1_immu_miss_patch_tsb_mask_1, tsb_kernel_mask); - PATCH_TSB(tl1_immu_miss_patch_tsb_mask_2, tsb_kernel_mask); + PATCH_TSB_MASK(tl1_immu_miss_patch_tsb_mask_1, tsb_kernel_mask); + PATCH_TSB_MASK(tl1_immu_miss_patch_tsb_mask_2, tsb_kernel_mask); /* * Enter fake 8k pages for the 4MB kernel pages, so that From owner-svn-src-all@FreeBSD.ORG Mon Jan 17 22:58:29 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F344F106564A; Mon, 17 Jan 2011 22:58:28 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DEE628FC16; Mon, 17 Jan 2011 22:58:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0HMwSTq015576; Mon, 17 Jan 2011 22:58:28 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0HMwSCM015552; Mon, 17 Jan 2011 22:58:28 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201101172258.p0HMwSCM015552@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 17 Jan 2011 22:58: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: r217515 - in head/sys: amd64/amd64 amd64/include arm/arm arm/include conf dev/mem i386/i386 i386/include ia64/include mips/include modules/mem powerpc/include powerpc/powerpc sparc64/in... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jan 2011 22:58:29 -0000 Author: jkim Date: Mon Jan 17 22:58:28 2011 New Revision: 217515 URL: http://svn.freebsd.org/changeset/base/217515 Log: Add reader/writer lock around mem_range_attr_get() and mem_range_attr_set(). Compile sys/dev/mem/memutil.c for all supported platforms and remove now unnecessary dev_mem_md_init(). Consistently define mem_range_softc from mem.c for all platforms. Add missing #include guards for machine/memdev.h and sys/memrange.h. Clean up some nearby style(9) nits. MFC after: 1 month Modified: head/sys/amd64/amd64/machdep.c head/sys/amd64/amd64/mem.c head/sys/amd64/include/memdev.h head/sys/arm/arm/mem.c head/sys/arm/include/memdev.h head/sys/conf/files head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/conf/files.pc98 head/sys/conf/files.powerpc head/sys/dev/mem/memdev.c head/sys/dev/mem/memutil.c head/sys/i386/i386/machdep.c head/sys/i386/i386/mem.c head/sys/i386/include/memdev.h head/sys/ia64/include/memdev.h head/sys/mips/include/memdev.h head/sys/modules/mem/Makefile head/sys/powerpc/include/memdev.h head/sys/powerpc/powerpc/mem.c head/sys/sparc64/include/memdev.h head/sys/sun4v/include/memdev.h head/sys/sys/memrange.h Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Mon Jan 17 20:32:17 2011 (r217514) +++ head/sys/amd64/amd64/machdep.c Mon Jan 17 22:58:28 2011 (r217515) @@ -74,7 +74,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -196,8 +195,6 @@ struct pcpu __pcpu[MAXCPU]; struct mtx icu_lock; -struct mem_range_softc mem_range_softc; - struct mtx dt_lock; /* lock for GDT and LDT */ static void Modified: head/sys/amd64/amd64/mem.c ============================================================================== --- head/sys/amd64/amd64/mem.c Mon Jan 17 20:32:17 2011 (r217514) +++ head/sys/amd64/amd64/mem.c Mon Jan 17 22:58:28 2011 (r217515) @@ -72,6 +72,8 @@ __FBSDID("$FreeBSD$"); */ MALLOC_DEFINE(M_MEMDESC, "memdesc", "memory range descriptors"); +struct mem_range_softc mem_range_softc; + /* ARGSUSED */ int memrw(struct cdev *dev, struct uio *uio, int flags) @@ -214,10 +216,3 @@ memioctl(struct cdev *dev __unused, u_lo } return (error); } - -void -dev_mem_md_init(void) -{ - if (mem_range_softc.mr_op != NULL) - mem_range_softc.mr_op->init(&mem_range_softc); -} Modified: head/sys/amd64/include/memdev.h ============================================================================== --- head/sys/amd64/include/memdev.h Mon Jan 17 20:32:17 2011 (r217514) +++ head/sys/amd64/include/memdev.h Mon Jan 17 22:58:28 2011 (r217515) @@ -26,6 +26,9 @@ * $FreeBSD$ */ +#ifndef _MACHINE_MEMDEV_H_ +#define _MACHINE_MEMDEV_H_ + #define CDEV_MINOR_MEM 0 #define CDEV_MINOR_KMEM 1 @@ -34,4 +37,4 @@ d_read_t memrw; d_ioctl_t memioctl; d_mmap_t memmmap; -void dev_mem_md_init(void); +#endif /* _MACHINE_MEMDEV_H_ */ Modified: head/sys/arm/arm/mem.c ============================================================================== --- head/sys/arm/arm/mem.c Mon Jan 17 20:32:17 2011 (r217514) +++ head/sys/arm/arm/mem.c Mon Jan 17 22:58:28 2011 (r217515) @@ -70,6 +70,8 @@ __FBSDID("$FreeBSD$"); */ MALLOC_DEFINE(M_MEMDESC, "memdesc", "memory range descriptors"); +struct mem_range_softc mem_range_softc; + /* ARGSUSED */ int memrw(struct cdev *dev, struct uio *uio, int flags) Modified: head/sys/arm/include/memdev.h ============================================================================== --- head/sys/arm/include/memdev.h Mon Jan 17 20:32:17 2011 (r217514) +++ head/sys/arm/include/memdev.h Mon Jan 17 22:58:28 2011 (r217515) @@ -26,6 +26,9 @@ * $FreeBSD$ */ +#ifndef _MACHINE_MEMDEV_H_ +#define _MACHINE_MEMDEV_H_ + #define CDEV_MINOR_MEM 0 #define CDEV_MINOR_KMEM 1 @@ -34,4 +37,4 @@ d_read_t memrw; d_mmap_t memmmap; #define memioctl (d_ioctl_t *)NULL -void dev_mem_md_init(void); +#endif /* _MACHINE_MEMDEV_H_ */ Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Jan 17 20:32:17 2011 (r217514) +++ head/sys/conf/files Mon Jan 17 22:58:28 2011 (r217515) @@ -1292,6 +1292,7 @@ dev/mcd/mcd.c optional mcd isa nowerro dev/mcd/mcd_isa.c optional mcd isa nowerror dev/md/md.c optional md dev/mem/memdev.c optional mem +dev/mem/memutil.c optional mem dev/mfi/mfi.c optional mfi dev/mfi/mfi_debug.c optional mfi dev/mfi/mfi_pci.c optional mfi pci Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Mon Jan 17 20:32:17 2011 (r217514) +++ head/sys/conf/files.amd64 Mon Jan 17 22:58:28 2011 (r217515) @@ -206,7 +206,6 @@ dev/hwpmc/hwpmc_x86.c optional hwpmc dev/kbd/kbd.c optional atkbd | sc | ukbd dev/lindev/full.c optional lindev dev/lindev/lindev.c optional lindev -dev/mem/memutil.c optional mem dev/nfe/if_nfe.c optional nfe pci dev/nve/if_nve.c optional nve pci dev/nvram/nvram.c optional nvram isa Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Mon Jan 17 20:32:17 2011 (r217514) +++ head/sys/conf/files.i386 Mon Jan 17 22:58:28 2011 (r217515) @@ -209,7 +209,6 @@ dev/kbd/kbd.c optional atkbd | sc | uk dev/le/if_le_isa.c optional le isa dev/lindev/full.c optional lindev dev/lindev/lindev.c optional lindev -dev/mem/memutil.c optional mem dev/mse/mse.c optional mse dev/mse/mse_isa.c optional mse isa dev/nfe/if_nfe.c optional nfe pci Modified: head/sys/conf/files.pc98 ============================================================================== --- head/sys/conf/files.pc98 Mon Jan 17 20:32:17 2011 (r217514) +++ head/sys/conf/files.pc98 Mon Jan 17 22:58:28 2011 (r217515) @@ -110,7 +110,6 @@ dev/kbd/kbd.c optional pckbd | sc | uk dev/le/if_le_cbus.c optional le isa dev/lindev/full.c optional lindev dev/lindev/lindev.c optional lindev -dev/mem/memutil.c optional mem dev/mse/mse.c optional mse dev/mse/mse_cbus.c optional mse isa dev/sbni/if_sbni.c optional sbni Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Mon Jan 17 20:32:17 2011 (r217514) +++ head/sys/conf/files.powerpc Mon Jan 17 22:58:28 2011 (r217515) @@ -30,7 +30,6 @@ dev/hwpmc/hwpmc_powerpc.c optional hwpmc dev/iicbus/ds1775.c optional ds1775 powermac dev/iicbus/max6690.c optional max6690 powermac dev/kbd/kbd.c optional sc -dev/mem/memutil.c optional mem dev/ofw/openfirm.c optional aim | fdt dev/ofw/openfirmio.c optional aim | fdt dev/ofw/ofw_bus_if.m optional aim | fdt Modified: head/sys/dev/mem/memdev.c ============================================================================== --- head/sys/dev/mem/memdev.c Mon Jan 17 20:32:17 2011 (r217514) +++ head/sys/dev/mem/memdev.c Mon Jan 17 22:58:28 2011 (r217515) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -80,7 +81,7 @@ mem_modevent(module_t mod __unused, int case MOD_LOAD: if (bootverbose) printf("mem: \n"); - dev_mem_md_init(); /* Machine dependant bit */ + mem_range_init(); memdev = make_dev(&mem_cdevsw, CDEV_MINOR_MEM, UID_ROOT, GID_KMEM, 0640, "mem"); kmemdev = make_dev(&mem_cdevsw, CDEV_MINOR_KMEM, @@ -88,6 +89,7 @@ mem_modevent(module_t mod __unused, int break; case MOD_UNLOAD: + mem_range_destroy(); destroy_dev(memdev); destroy_dev(kmemdev); break; Modified: head/sys/dev/mem/memutil.c ============================================================================== --- head/sys/dev/mem/memutil.c Mon Jan 17 20:32:17 2011 (r217514) +++ head/sys/dev/mem/memutil.c Mon Jan 17 22:58:28 2011 (r217515) @@ -28,35 +28,64 @@ __FBSDID("$FreeBSD$"); #include +#include +#include #include #include +#include #include +static struct rwlock mr_lock; + /* * Implementation-neutral, kernel-callable functions for manipulating * memory range attributes. */ +void +mem_range_init(void) +{ + + if (mem_range_softc.mr_op == NULL) + return; + rw_init(&mr_lock, "memrange"); + mem_range_softc.mr_op->init(&mem_range_softc); +} + +void +mem_range_destroy(void) +{ + + if (mem_range_softc.mr_op == NULL) + return; + rw_destroy(&mr_lock); +} + int mem_range_attr_get(struct mem_range_desc *mrd, int *arg) { - /* can we handle this? */ + int nd; + if (mem_range_softc.mr_op == NULL) return (EOPNOTSUPP); - - if (*arg == 0) + nd = *arg; + rw_rlock(&mr_lock); + if (nd == 0) *arg = mem_range_softc.mr_ndesc; else - bcopy(mem_range_softc.mr_desc, mrd, - (*arg) * sizeof(struct mem_range_desc)); + bcopy(mem_range_softc.mr_desc, mrd, nd * sizeof(*mrd)); + rw_runlock(&mr_lock); return (0); } int mem_range_attr_set(struct mem_range_desc *mrd, int *arg) { - /* can we handle this? */ + int ret; + if (mem_range_softc.mr_op == NULL) return (EOPNOTSUPP); - - return (mem_range_softc.mr_op->set(&mem_range_softc, mrd, arg)); + rw_wlock(&mr_lock); + ret = mem_range_softc.mr_op->set(&mem_range_softc, mrd, arg); + rw_wunlock(&mr_lock); + return (ret); } Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Mon Jan 17 20:32:17 2011 (r217514) +++ head/sys/i386/i386/machdep.c Mon Jan 17 22:58:28 2011 (r217515) @@ -73,7 +73,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -239,8 +238,6 @@ struct pcpu __pcpu[MAXCPU]; struct mtx icu_lock; -struct mem_range_softc mem_range_softc; - static void cpu_startup(dummy) void *dummy; Modified: head/sys/i386/i386/mem.c ============================================================================== --- head/sys/i386/i386/mem.c Mon Jan 17 20:32:17 2011 (r217514) +++ head/sys/i386/i386/mem.c Mon Jan 17 22:58:28 2011 (r217515) @@ -72,10 +72,11 @@ __FBSDID("$FreeBSD$"); */ MALLOC_DEFINE(M_MEMDESC, "memdesc", "memory range descriptors"); +struct mem_range_softc mem_range_softc; + static struct sx memsxlock; SX_SYSINIT(memsxlockinit, &memsxlock, "/dev/mem lock"); - /* ARGSUSED */ int memrw(struct cdev *dev, struct uio *uio, int flags) @@ -233,10 +234,3 @@ memioctl(struct cdev *dev __unused, u_lo } return (error); } - -void -dev_mem_md_init(void) -{ - if (mem_range_softc.mr_op != NULL) - mem_range_softc.mr_op->init(&mem_range_softc); -} Modified: head/sys/i386/include/memdev.h ============================================================================== --- head/sys/i386/include/memdev.h Mon Jan 17 20:32:17 2011 (r217514) +++ head/sys/i386/include/memdev.h Mon Jan 17 22:58:28 2011 (r217515) @@ -26,6 +26,9 @@ * $FreeBSD$ */ +#ifndef _MACHINE_MEMDEV_H_ +#define _MACHINE_MEMDEV_H_ + #define CDEV_MINOR_MEM 0 #define CDEV_MINOR_KMEM 1 @@ -34,4 +37,4 @@ d_read_t memrw; d_ioctl_t memioctl; d_mmap_t memmmap; -void dev_mem_md_init(void); +#endif /* _MACHINE_MEMDEV_H_ */ Modified: head/sys/ia64/include/memdev.h ============================================================================== --- head/sys/ia64/include/memdev.h Mon Jan 17 20:32:17 2011 (r217514) +++ head/sys/ia64/include/memdev.h Mon Jan 17 22:58:28 2011 (r217515) @@ -26,6 +26,9 @@ * $FreeBSD$ */ +#ifndef _MACHINE_MEMDEV_H_ +#define _MACHINE_MEMDEV_H_ + #define CDEV_MINOR_MEM 0 #define CDEV_MINOR_KMEM 1 @@ -34,4 +37,4 @@ d_read_t memrw; #define memioctl (d_ioctl_t *)NULL d_mmap_t memmmap; -void dev_mem_md_init(void); +#endif /* _MACHINE_MEMDEV_H_ */ Modified: head/sys/mips/include/memdev.h ============================================================================== --- head/sys/mips/include/memdev.h Mon Jan 17 20:32:17 2011 (r217514) +++ head/sys/mips/include/memdev.h Mon Jan 17 22:58:28 2011 (r217515) @@ -27,6 +27,9 @@ * $FreeBSD$ */ +#ifndef _MACHINE_MEMDEV_H_ +#define _MACHINE_MEMDEV_H_ + #define CDEV_MINOR_MEM 0 #define CDEV_MINOR_KMEM 1 @@ -35,4 +38,4 @@ d_read_t memrw; #define memioctl (d_ioctl_t *)NULL d_mmap_t memmmap; -void dev_mem_md_init(void); +#endif /* _MACHINE_MEMDEV_H_ */ Modified: head/sys/modules/mem/Makefile ============================================================================== --- head/sys/modules/mem/Makefile Mon Jan 17 20:32:17 2011 (r217514) +++ head/sys/modules/mem/Makefile Mon Jan 17 22:58:28 2011 (r217515) @@ -5,10 +5,7 @@ .PATH: ${.CURDIR}/../../${MACHINE_CPUARCH}/${MACHINE_CPUARCH} KMOD= mem -SRCS= memdev.c mem.c -.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "powerpc" -SRCS+= memutil.c -.endif +SRCS= mem.c memdev.c memutil.c .if ${MACHINE_CPUARCH} == "i386" SRCS+= i686_mem.c k6_mem.c .endif Modified: head/sys/powerpc/include/memdev.h ============================================================================== --- head/sys/powerpc/include/memdev.h Mon Jan 17 20:32:17 2011 (r217514) +++ head/sys/powerpc/include/memdev.h Mon Jan 17 22:58:28 2011 (r217515) @@ -26,6 +26,9 @@ * $FreeBSD$ */ +#ifndef _MACHINE_MEMDEV_H_ +#define _MACHINE_MEMDEV_H_ + #define CDEV_MINOR_MEM 0 #define CDEV_MINOR_KMEM 1 @@ -34,4 +37,4 @@ d_read_t memrw; d_ioctl_t memioctl; d_mmap_t memmmap; -void dev_mem_md_init(void); +#endif /* _MACHINE_MEMDEV_H_ */ Modified: head/sys/powerpc/powerpc/mem.c ============================================================================== --- head/sys/powerpc/powerpc/mem.c Mon Jan 17 20:32:17 2011 (r217514) +++ head/sys/powerpc/powerpc/mem.c Mon Jan 17 22:58:28 2011 (r217515) @@ -82,7 +82,7 @@ static struct mem_range_ops ppc_mem_rang }; struct mem_range_softc mem_range_softc = { &ppc_mem_range_ops, - 0, 0, 0 + 0, 0, NULL }; /* ARGSUSED */ @@ -225,12 +225,6 @@ memmmap(struct cdev *dev, vm_ooffset_t o return (0); } -void -dev_mem_md_init(void) -{ - mem_range_softc.mr_op->init(&mem_range_softc); -} - static void ppc_mrinit(struct mem_range_softc *sc) { @@ -334,4 +328,3 @@ memioctl(struct cdev *dev __unused, u_lo } return (error); } - Modified: head/sys/sparc64/include/memdev.h ============================================================================== --- head/sys/sparc64/include/memdev.h Mon Jan 17 20:32:17 2011 (r217514) +++ head/sys/sparc64/include/memdev.h Mon Jan 17 22:58:28 2011 (r217515) @@ -26,6 +26,9 @@ * $FreeBSD$ */ +#ifndef _MACHINE_MEMDEV_H_ +#define _MACHINE_MEMDEV_H_ + #define CDEV_MINOR_MEM 0 #define CDEV_MINOR_KMEM 1 @@ -34,4 +37,4 @@ d_read_t memrw; #define memioctl (d_ioctl_t *)NULL #define memmmap (d_mmap_t *)NULL -void dev_mem_md_init(void); +#endif /* _MACHINE_MEMDEV_H_ */ Modified: head/sys/sun4v/include/memdev.h ============================================================================== --- head/sys/sun4v/include/memdev.h Mon Jan 17 20:32:17 2011 (r217514) +++ head/sys/sun4v/include/memdev.h Mon Jan 17 22:58:28 2011 (r217515) @@ -26,6 +26,9 @@ * $FreeBSD$ */ +#ifndef _MACHINE_MEMDEV_H_ +#define _MACHINE_MEMDEV_H_ + #define CDEV_MINOR_MEM 0 #define CDEV_MINOR_KMEM 1 @@ -34,4 +37,4 @@ d_read_t memrw; #define memioctl (d_ioctl_t *)NULL #define memmmap (d_mmap_t *)NULL -void dev_mem_md_init(void); +#endif /* _MACHINE_MEMDEV_H_ */ Modified: head/sys/sys/memrange.h ============================================================================== --- head/sys/sys/memrange.h Mon Jan 17 20:32:17 2011 (r217514) +++ head/sys/sys/memrange.h Mon Jan 17 22:58:28 2011 (r217515) @@ -4,6 +4,9 @@ * $FreeBSD$ */ +#ifndef _SYS_MEMRANGE_H_ +#define _SYS_MEMRANGE_H_ + /* Memory range attributes */ #define MDF_UNCACHEABLE (1<<0) /* region not cached */ #define MDF_WRITECOMBINE (1<<1) /* region supports "write combine" action */ @@ -65,7 +68,12 @@ struct mem_range_softc extern struct mem_range_softc mem_range_softc; -extern int mem_range_attr_get(struct mem_range_desc *mrd, int *arg); -extern int mem_range_attr_set(struct mem_range_desc *mrd, int *arg); +extern void mem_range_init(void); +extern void mem_range_destroy(void); + +extern int mem_range_attr_get(struct mem_range_desc *mrd, int *arg); +extern int mem_range_attr_set(struct mem_range_desc *mrd, int *arg); + +#endif /* _KERNEL */ -#endif +#endif /* _SYS_MEMRANGE_H_ */ From owner-svn-src-all@FreeBSD.ORG Mon Jan 17 22:58:42 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0ED6D106564A; Mon, 17 Jan 2011 22:58:42 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F2D088FC12; Mon, 17 Jan 2011 22:58:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0HMwfuL015619; Mon, 17 Jan 2011 22:58:41 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0HMwfmW015617; Mon, 17 Jan 2011 22:58:41 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201101172258.p0HMwfmW015617@svn.freebsd.org> From: Warner Losh Date: Mon, 17 Jan 2011 22:58: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: r217516 - head/sys/mips/mips X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jan 2011 22:58:42 -0000 Author: imp Date: Mon Jan 17 22:58:41 2011 New Revision: 217516 URL: http://svn.freebsd.org/changeset/base/217516 Log: Make cpu_model public (otherwise there's no way to set it) and bump it to 80 characters. Add hw.board to export board information, if known, from the mips kernel. Modified: head/sys/mips/mips/machdep.c Modified: head/sys/mips/mips/machdep.c ============================================================================== --- head/sys/mips/mips/machdep.c Mon Jan 17 22:58:28 2011 (r217515) +++ head/sys/mips/mips/machdep.c Mon Jan 17 22:58:41 2011 (r217516) @@ -103,9 +103,12 @@ __FBSDID("$FreeBSD$"); char machine[] = "mips"; SYSCTL_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD, machine, 0, "Machine class"); -static char cpu_model[30]; +char cpu_model[80]; SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD, cpu_model, 0, "Machine model"); +char cpu_board[80]; +SYSCTL_STRING(_hw, OID_AUTO, board, CTLFLAG_RD, cpu_board, 0, "Machine board"); + int cold = 1; long realmem = 0; long Maxmem = 0; From owner-svn-src-all@FreeBSD.ORG Mon Jan 17 23:00:24 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 25DA21065674; Mon, 17 Jan 2011 23:00:24 +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 EF89B8FC1C; Mon, 17 Jan 2011 23:00:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0HN0N7B015746; Mon, 17 Jan 2011 23:00:23 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0HN0NBR015744; Mon, 17 Jan 2011 23:00:23 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201101172300.p0HN0NBR015744@svn.freebsd.org> From: Warner Losh Date: Mon, 17 Jan 2011 23:00: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: r217517 - head/sys/mips/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jan 2011 23:00:24 -0000 Author: imp Date: Mon Jan 17 23:00:23 2011 New Revision: 217517 URL: http://svn.freebsd.org/changeset/base/217517 Log: Kill redundant cpu line Modified: head/sys/mips/conf/OCTEON1 Modified: head/sys/mips/conf/OCTEON1 ============================================================================== --- head/sys/mips/conf/OCTEON1 Mon Jan 17 22:58:41 2011 (r217516) +++ head/sys/mips/conf/OCTEON1 Mon Jan 17 23:00:23 2011 (r217517) @@ -18,7 +18,6 @@ # # $FreeBSD$ -cpu CPU_CNMIPS ident OCTEON1 makeoptions ARCH_FLAGS="-march=octeon -mabi=64" From owner-svn-src-all@FreeBSD.ORG Mon Jan 17 23:03:09 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B5889106566B; Mon, 17 Jan 2011 23:03:09 +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 8AE768FC0C; Mon, 17 Jan 2011 23:03:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0HN39AV015865; Mon, 17 Jan 2011 23:03:09 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0HN395k015863; Mon, 17 Jan 2011 23:03:09 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201101172303.p0HN395k015863@svn.freebsd.org> From: Warner Losh Date: Mon, 17 Jan 2011 23:03:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217518 - head/sys/mips/cavium X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jan 2011 23:03:09 -0000 Author: imp Date: Mon Jan 17 23:03:09 2011 New Revision: 217518 URL: http://svn.freebsd.org/changeset/base/217518 Log: Save the CPU model, the board and the CPU clock rate so they are reported by the approrpiate sysctl. Modified: head/sys/mips/cavium/octeon_machdep.c Modified: head/sys/mips/cavium/octeon_machdep.c ============================================================================== --- head/sys/mips/cavium/octeon_machdep.c Mon Jan 17 23:00:23 2011 (r217517) +++ head/sys/mips/cavium/octeon_machdep.c Mon Jan 17 23:03:09 2011 (r217518) @@ -92,6 +92,8 @@ struct octeon_feature_description { extern int *edata; extern int *end; +extern char cpu_model[]; +extern char cpu_board[]; static const struct octeon_feature_description octeon_feature_descriptions[] = { { OCTEON_FEATURE_SAAD, "SAAD" }, @@ -384,14 +386,12 @@ platform_start(__register_t a0, __regist if (boothowto & RB_KDB) kdb_enter(KDB_WHY_BOOTFLAGS, "Boot flags requested debugger"); #endif - platform_counter_freq = cvmx_sysinfo_get()->cpu_clock_hz; - - octeon_timecounter.tc_frequency = cvmx_sysinfo_get()->cpu_clock_hz; + cpu_clock = cvmx_sysinfo_get()->cpu_clock_hz; + platform_counter_freq = cpu_clock; + octeon_timecounter.tc_frequency = cpu_clock; platform_timecounter = &octeon_timecounter; - mips_timer_init_params(platform_counter_freq, 0); - - set_cputicker(octeon_get_ticks, cvmx_sysinfo_get()->cpu_clock_hz, 0); + set_cputicker(octeon_get_ticks, cpu_clock, 0); #ifdef SMP /* @@ -610,13 +610,20 @@ octeon_boot_params_init(register_t ptr) octeon_bootinfo->mac_addr_count); #if defined(OCTEON_BOARD_CAPK_0100ND) - if (cvmx_sysinfo_get()->board_type != CVMX_BOARD_TYPE_CN3010_EVB_HS5) + strcpy(cpu_board, "CAPK-0100ND"); + if (cvmx_sysinfo_get()->board_type != CVMX_BOARD_TYPE_CN3010_EVB_HS5) { printf("Compiled for CAPK-0100ND, but board type is %s\n", cvmx_board_type_to_string(cvmx_sysinfo_get()->board_type)); + strcat(cpu_board, " hardwired, but type is "); + strcat(cpu_board, + cvmx_board_type_to_string(cvmx_sysinfo_get()->board_type)); + } #else - printf("Board: %s\n", + strcpy(cpu_board, cvmx_board_type_to_string(cvmx_sysinfo_get()->board_type)); + printf("Board: %s\n", cpu_board); #endif - printf("Model: %s\n", octeon_model_get_string(cvmx_get_proc_id())); + strcpy(cpu_model, octeon_model_get_string(cvmx_get_proc_id())); + printf("Model: %s\n", cpu_model); } /* impEND: This stuff should move back into the Cavium SDK */ From owner-svn-src-all@FreeBSD.ORG Mon Jan 17 23:06:47 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EB68E1065672; Mon, 17 Jan 2011 23:06:47 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DA82E8FC19; Mon, 17 Jan 2011 23:06:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0HN6lRM015993; Mon, 17 Jan 2011 23:06:47 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0HN6l7b015988; Mon, 17 Jan 2011 23:06:47 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201101172306.p0HN6l7b015988@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 17 Jan 2011 23:06: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: r217519 - in head/sys: arm/arm ia64/ia64 mips/mips sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jan 2011 23:06:48 -0000 Author: jkim Date: Mon Jan 17 23:06:47 2011 New Revision: 217519 URL: http://svn.freebsd.org/changeset/base/217519 Log: Remove empty dev_mem_md_init() stubs. Modified: head/sys/arm/arm/mem.c head/sys/ia64/ia64/mem.c head/sys/mips/mips/mem.c head/sys/sparc64/sparc64/mem.c Modified: head/sys/arm/arm/mem.c ============================================================================== --- head/sys/arm/arm/mem.c Mon Jan 17 23:03:09 2011 (r217518) +++ head/sys/arm/arm/mem.c Mon Jan 17 23:06:47 2011 (r217519) @@ -165,8 +165,3 @@ memmmap(struct cdev *dev, vm_ooffset_t o /* else panic! */ return (0); } - -void -dev_mem_md_init(void) -{ -} Modified: head/sys/ia64/ia64/mem.c ============================================================================== --- head/sys/ia64/ia64/mem.c Mon Jan 17 23:03:09 2011 (r217518) +++ head/sys/ia64/ia64/mem.c Mon Jan 17 23:06:47 2011 (r217519) @@ -168,8 +168,3 @@ memmmap(struct cdev *dev, vm_ooffset_t o *paddr = IA64_PHYS_TO_RR7(offset); return (0); } - -void -dev_mem_md_init(void) -{ -} Modified: head/sys/mips/mips/mem.c ============================================================================== --- head/sys/mips/mips/mem.c Mon Jan 17 23:03:09 2011 (r217518) +++ head/sys/mips/mips/mem.c Mon Jan 17 23:06:47 2011 (r217519) @@ -165,8 +165,3 @@ memmmap(struct cdev *dev, vm_ooffset_t o return (0); } - -void -dev_mem_md_init(void) -{ -} Modified: head/sys/sparc64/sparc64/mem.c ============================================================================== --- head/sys/sparc64/sparc64/mem.c Mon Jan 17 23:03:09 2011 (r217518) +++ head/sys/sparc64/sparc64/mem.c Mon Jan 17 23:06:47 2011 (r217519) @@ -188,9 +188,3 @@ memrw(struct cdev *dev, struct uio *uio, kmem_free_wakeup(kernel_map, ova, PAGE_SIZE * colors); return (error); } - -void -dev_mem_md_init(void) -{ - -} From owner-svn-src-all@FreeBSD.ORG Mon Jan 17 23:34:36 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EF7AA106564A; Mon, 17 Jan 2011 23:34:36 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DED738FC0A; Mon, 17 Jan 2011 23:34:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0HNYaJ6016611; Mon, 17 Jan 2011 23:34:36 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0HNYa4Y016609; Mon, 17 Jan 2011 23:34:36 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201101172334.p0HNYa4Y016609@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 17 Jan 2011 23:34: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: r217520 - head/sys/dev/uart X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jan 2011 23:34:37 -0000 Author: marcel Date: Mon Jan 17 23:34:36 2011 New Revision: 217520 URL: http://svn.freebsd.org/changeset/base/217520 Log: Check the environment for system devices before using the FDT. This allows overriding the FDT, and allows specifying a debug port. Modified: head/sys/dev/uart/uart_bus_fdt.c Modified: head/sys/dev/uart/uart_bus_fdt.c ============================================================================== --- head/sys/dev/uart/uart_bus_fdt.c Mon Jan 17 23:06:47 2011 (r217519) +++ head/sys/dev/uart/uart_bus_fdt.c Mon Jan 17 23:34:36 2011 (r217520) @@ -140,6 +140,15 @@ uart_cpu_getdev(int devtype, struct uart u_long start, size; int err; + uart_bus_space_mem = fdtbus_bs_tag; + uart_bus_space_io = NULL; + + /* Allow overriding the FDT uning the environment. */ + class = &uart_ns8250_class; + err = uart_getenv(devtype, di, class); + if (!err) + return (0); + if (devtype != UART_DEV_CONSOLE) return (ENXIO); @@ -183,18 +192,12 @@ uart_cpu_getdev(int devtype, struct uart di->databits = 8; di->stopbits = 1; di->parity = UART_PARITY_NONE; - di->bas.bst = fdtbus_bs_tag; + di->bas.bst = uart_bus_space_mem; err = fdt_regsize(node, &start, &size); if (err) return (ENXIO); start += fdt_immr_va; - uart_bus_space_mem = fdtbus_bs_tag; - uart_bus_space_io = NULL; - - if (bus_space_map(di->bas.bst, start, size, 0, &di->bas.bsh) != 0) - return (ENXIO); - - return (0); + return (bus_space_map(di->bas.bst, start, size, 0, &di->bas.bsh)); } From owner-svn-src-all@FreeBSD.ORG Mon Jan 17 23:36:54 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A0B5106566C; Mon, 17 Jan 2011 23:36:54 +0000 (UTC) (envelope-from mdf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1910D8FC15; Mon, 17 Jan 2011 23:36:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0HNarPo016715; Mon, 17 Jan 2011 23:36:53 GMT (envelope-from mdf@svn.freebsd.org) Received: (from mdf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0HNarV0016712; Mon, 17 Jan 2011 23:36:53 GMT (envelope-from mdf@svn.freebsd.org) Message-Id: <201101172336.p0HNarV0016712@svn.freebsd.org> From: Matthew D Fleming Date: Mon, 17 Jan 2011 23:36:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217521 - head/sbin/sysctl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jan 2011 23:36:54 -0000 Author: mdf Date: Mon Jan 17 23:36:53 2011 New Revision: 217521 URL: http://svn.freebsd.org/changeset/base/217521 Log: The kernel is not exporting any "T,dev_t" sysctl nodes anymore, so remove the capability and mention from sysctl(8). Modified: head/sbin/sysctl/sysctl.8 head/sbin/sysctl/sysctl.c Modified: head/sbin/sysctl/sysctl.8 ============================================================================== --- head/sbin/sysctl/sysctl.8 Mon Jan 17 23:34:36 2011 (r217520) +++ head/sbin/sysctl/sysctl.8 Mon Jan 17 23:36:53 2011 (r217521) @@ -134,9 +134,7 @@ few bytes. .Pp The information available from .Nm -consists of integers, strings, devices -.Pq Vt dev_t , -and opaque types. +consists of integers, strings, and opaque types. The .Nm utility @@ -165,17 +163,8 @@ For a detailed description of these vari .Pp The changeable column indicates whether a process with appropriate privilege can change the value. -String, integer, and devices values can be set using +String, and integer values can be set using .Nm . -For device values, -.Ar value -can be specified as a character device special file name. -Special values -.Cm off -and -.Cm none -denote -.Dq no device . .Bl -column security.bsd.unprivileged_read_msgbuf integerxxx .It Sy "Name Type Changeable .It "kern.ostype string no @@ -220,7 +209,6 @@ denote .It "hw.floatingpoint integer no .It "hw.machine_arch string no .It "hw.realmem integer no -.It "machdep.console_device dev_t no .It "machdep.adjkerntz integer yes .It "machdep.disable_rtc_set integer yes .It "machdep.guessed_bootdev string no Modified: head/sbin/sysctl/sysctl.c ============================================================================== --- head/sbin/sysctl/sysctl.c Mon Jan 17 23:34:36 2011 (r217520) +++ head/sbin/sysctl/sysctl.c Mon Jan 17 23:36:53 2011 (r217521) @@ -67,7 +67,6 @@ static int show_var(int *, int); static int sysctl_all(int *oid, int len); static int name2oid(char *, int *); -static void set_T_dev_t(char *, void **, size_t *); static int set_IK(const char *, int *); static void @@ -287,10 +286,6 @@ parse(char *string) newsize = sizeof(quadval); break; case CTLTYPE_OPAQUE: - if (strcmp(fmt, "T,dev_t") == 0) { - set_T_dev_t (newval, &newval, &newsize); - break; - } /* FALLTHROUGH */ default: errx(1, "oid '%s' is type %d," @@ -420,40 +415,6 @@ S_vmtotal(int l2, void *p) } static int -T_dev_t(int l2, void *p) -{ - dev_t *d = (dev_t *)p; - - if (l2 != sizeof(*d)) { - warnx("T_dev_T %d != %zu", l2, sizeof(*d)); - return (1); - } - printf("%s", devname(*d, S_IFCHR)); - return (0); -} - -static void -set_T_dev_t(char *path, void **val, size_t *size) -{ - static struct stat statb; - - if (strcmp(path, "none") && strcmp(path, "off")) { - int rc = stat (path, &statb); - if (rc) { - err(1, "cannot stat %s", path); - } - - if (!S_ISCHR(statb.st_mode)) { - errx(1, "must specify a device special file."); - } - } else { - statb.st_rdev = NODEV; - } - *val = (void *) &statb.st_rdev; - *size = sizeof(statb.st_rdev); -} - -static int set_IK(const char *str, int *val) { float temp; @@ -675,7 +636,6 @@ show_var(int *oid, int nlen) free(oval); return (0); - case 'T': case 'S': i = 0; if (strcmp(fmt, "S,clockinfo") == 0) @@ -686,8 +646,6 @@ show_var(int *oid, int nlen) func = S_loadavg; else if (strcmp(fmt, "S,vmtotal") == 0) func = S_vmtotal; - else if (strcmp(fmt, "T,dev_t") == 0) - func = T_dev_t; else func = NULL; if (func) { From owner-svn-src-all@FreeBSD.ORG Mon Jan 17 23:43:03 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 790A61065675; Mon, 17 Jan 2011 23:43:03 +0000 (UTC) (envelope-from mdf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 68BDC8FC22; Mon, 17 Jan 2011 23:43:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0HNh3Q9016905; Mon, 17 Jan 2011 23:43:03 GMT (envelope-from mdf@svn.freebsd.org) Received: (from mdf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0HNh3wR016903; Mon, 17 Jan 2011 23:43:03 GMT (envelope-from mdf@svn.freebsd.org) Message-Id: <201101172343.p0HNh3wR016903@svn.freebsd.org> From: Matthew D Fleming Date: Mon, 17 Jan 2011 23:43: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: r217522 - head/sbin/sysctl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jan 2011 23:43:03 -0000 Author: mdf Date: Mon Jan 17 23:43:03 2011 New Revision: 217522 URL: http://svn.freebsd.org/changeset/base/217522 Log: Fix typo and bump date. Modified: head/sbin/sysctl/sysctl.8 Modified: head/sbin/sysctl/sysctl.8 ============================================================================== --- head/sbin/sysctl/sysctl.8 Mon Jan 17 23:36:53 2011 (r217521) +++ head/sbin/sysctl/sysctl.8 Mon Jan 17 23:43:03 2011 (r217522) @@ -28,7 +28,7 @@ .\" From: @(#)sysctl.8 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd February 6, 2010 +.Dd January 17, 2011 .Dt SYSCTL 8 .Os .Sh NAME @@ -163,7 +163,7 @@ For a detailed description of these vari .Pp The changeable column indicates whether a process with appropriate privilege can change the value. -String, and integer values can be set using +String and integer values can be set using .Nm . .Bl -column security.bsd.unprivileged_read_msgbuf integerxxx .It Sy "Name Type Changeable From owner-svn-src-all@FreeBSD.ORG Mon Jan 17 23:54:50 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 65095106566B; Mon, 17 Jan 2011 23:54:50 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 540158FC14; Mon, 17 Jan 2011 23:54:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0HNsods017238; Mon, 17 Jan 2011 23:54:50 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0HNsoxo017235; Mon, 17 Jan 2011 23:54:50 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201101172354.p0HNsoxo017235@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 17 Jan 2011 23:54:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217523 - head/sys/powerpc/booke X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jan 2011 23:54:50 -0000 Author: marcel Date: Mon Jan 17 23:54:50 2011 New Revision: 217523 URL: http://svn.freebsd.org/changeset/base/217523 Log: Support booting non FDT-capable loaders: 1. Allow embedding the FDT into the kernel, just like PowerPC/book-E. 2. If the loader passes us a pointer to the bootinfo structure, save it and use it to fill in the gaps (e.g. bus frequencies, etc). Modified: head/sys/powerpc/booke/machdep.c head/sys/powerpc/booke/platform_bare.c Modified: head/sys/powerpc/booke/machdep.c ============================================================================== --- head/sys/powerpc/booke/machdep.c Mon Jan 17 23:43:03 2011 (r217522) +++ head/sys/powerpc/booke/machdep.c Mon Jan 17 23:54:50 2011 (r217523) @@ -85,6 +85,7 @@ __FBSDID("$FreeBSD$"); #include "opt_ddb.h" #include "opt_kstack_pages.h" #include "opt_msgbuf.h" +#include "opt_platform.h" #include #include @@ -163,13 +164,18 @@ extern void dcache_inval(void); extern void icache_enable(void); extern void icache_inval(void); +/* + * Bootinfo is passed to us by legacy loaders. Save the address of the + * structure to handle backward compatibility. + */ +uint32_t *bootinfo; + struct kva_md_info kmi; struct pcpu __pcpu[MAXCPU]; struct trapframe frame0; int cold = 1; long realmem = 0; long Maxmem = 0; - char machine[] = "powerpc"; SYSCTL_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD, machine, 0, ""); @@ -294,6 +300,10 @@ e500_init(u_int32_t startkernel, u_int32 kern_envp = MD_FETCH(kmdp, MODINFOMD_ENVP, char *); dtbp = MD_FETCH(kmdp, MODINFOMD_DTBP, vm_offset_t); end = MD_FETCH(kmdp, MODINFOMD_KERNEND, vm_offset_t); + + bootinfo = (uint32_t *)preload_search_info(kmdp, + MODINFO_METADATA | MODINFOMD_BOOTINFO); + #ifdef DDB ksym_start = MD_FETCH(kmdp, MODINFOMD_SSYM, uintptr_t); ksym_end = MD_FETCH(kmdp, MODINFOMD_ESYM, uintptr_t); @@ -313,6 +323,15 @@ e500_init(u_int32_t startkernel, u_int32 while (1); } +#if defined(FDT_DTB_STATIC) + /* + * In case the device tree blob was not retrieved (from metadata) try + * to use the statically embedded one. + */ + if (dtbp == (vm_offset_t)NULL) + dtbp = (vm_offset_t)&fdt_static_dtb; +#endif + if (OF_install(OFW_FDT, 0) == FALSE) while (1); Modified: head/sys/powerpc/booke/platform_bare.c ============================================================================== --- head/sys/powerpc/booke/platform_bare.c Mon Jan 17 23:43:03 2011 (r217522) +++ head/sys/powerpc/booke/platform_bare.c Mon Jan 17 23:54:50 2011 (r217523) @@ -59,6 +59,8 @@ extern uint8_t __boot_page[]; /* Boot p extern uint32_t kernload; /* Kernel physical load address */ #endif +extern uint32_t *bootinfo; + static int cpu, maxcpu; static int bare_probe(platform_t); @@ -160,24 +162,31 @@ bare_mem_regions(platform_t plat, struct static u_long bare_timebase_freq(platform_t plat, struct cpuref *cpuref) { - u_long ticks = -1; + u_long ticks; phandle_t cpus, child; pcell_t freq; + /* Backward compatibility. See 8-STABLE. */ + ticks = bootinfo[3] >> 3; + if ((cpus = OF_finddevice("/cpus")) == 0) goto out; if ((child = OF_child(cpus)) == 0) goto out; + freq = 0; if (OF_getprop(child, "bus-frequency", (void *)&freq, sizeof(freq)) <= 0) goto out; + /* * Time Base and Decrementer are updated every 8 CCB bus clocks. * HID0[SEL_TBCLK] = 0 */ - ticks = freq / 8; + if (freq != 0) + ticks = freq / 8; + out: if (ticks <= 0) panic("Unable to determine timebase frequency!"); From owner-svn-src-all@FreeBSD.ORG Tue Jan 18 00:46:11 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A14F106564A; Tue, 18 Jan 2011 00:46:11 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2D8938FC12; Tue, 18 Jan 2011 00:46:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0I0kBZN018598; Tue, 18 Jan 2011 00:46:11 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0I0kBr9018595; Tue, 18 Jan 2011 00:46:11 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201101180046.p0I0kBr9018595@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 18 Jan 2011 00:46:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217524 - in head/sys: dev/re pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jan 2011 00:46:11 -0000 Author: yongari Date: Tue Jan 18 00:46:10 2011 New Revision: 217524 URL: http://svn.freebsd.org/changeset/base/217524 Log: Change model names of controller RTL_HWREV_8168_SPIN[123] to real ones. s/RL_HWREV_8168_SPIN1/RL_HWREV_8168B_SPIN1/g s/RL_HWREV_8168_SPIN2/RL_HWREV_8168B_SPIN2/g s/RL_HWREV_8168_SPIN3/RL_HWREV_8168B_SPIN3/g No functional changes. Modified: head/sys/dev/re/if_re.c head/sys/pci/if_rlreg.h Modified: head/sys/dev/re/if_re.c ============================================================================== --- head/sys/dev/re/if_re.c Mon Jan 17 23:54:50 2011 (r217523) +++ head/sys/dev/re/if_re.c Tue Jan 18 00:46:10 2011 (r217524) @@ -197,7 +197,7 @@ static struct rl_hwrev re_hwrevs[] = { { RL_HWREV_8139C, RL_8139, "C", RL_MTU }, { RL_HWREV_8139D, RL_8139, "8139D/8100B/8100C", RL_MTU }, { RL_HWREV_8139CPLUS, RL_8139CPLUS, "C+", RL_MTU }, - { RL_HWREV_8168_SPIN1, RL_8169, "8168", RL_JUMBO_MTU }, + { RL_HWREV_8168B_SPIN1, RL_8169, "8168", RL_JUMBO_MTU }, { RL_HWREV_8169, RL_8169, "8169", RL_JUMBO_MTU }, { RL_HWREV_8169S, RL_8169, "8169S", RL_JUMBO_MTU }, { RL_HWREV_8110S, RL_8169, "8110S", RL_JUMBO_MTU }, @@ -213,8 +213,8 @@ static struct rl_hwrev re_hwrevs[] = { { RL_HWREV_8102EL, RL_8169, "8102EL", RL_MTU }, { RL_HWREV_8102EL_SPIN1, RL_8169, "8102EL", RL_MTU }, { RL_HWREV_8103E, RL_8169, "8103E", RL_MTU }, - { RL_HWREV_8168_SPIN2, RL_8169, "8168", RL_JUMBO_MTU }, - { RL_HWREV_8168_SPIN3, RL_8169, "8168", RL_JUMBO_MTU }, + { RL_HWREV_8168B_SPIN2, RL_8169, "8168", RL_JUMBO_MTU }, + { RL_HWREV_8168B_SPIN3, RL_8169, "8168", RL_JUMBO_MTU }, { RL_HWREV_8168C, RL_8169, "8168C/8111C", RL_JUMBO_MTU_6K }, { RL_HWREV_8168C_SPIN2, RL_8169, "8168C/8111C", RL_JUMBO_MTU_6K }, { RL_HWREV_8168CP, RL_8169, "8168CP/8111CP", RL_JUMBO_MTU_6K }, @@ -1334,11 +1334,11 @@ re_attach(device_t dev) RL_FLAG_MACSTAT | RL_FLAG_FASTETHER | RL_FLAG_CMDSTOP | RL_FLAG_AUTOPAD | RL_FLAG_MACSLEEP; break; - case RL_HWREV_8168_SPIN1: - case RL_HWREV_8168_SPIN2: + case RL_HWREV_8168B_SPIN1: + case RL_HWREV_8168B_SPIN2: sc->rl_flags |= RL_FLAG_WOLRXENB; /* FALLTHROUGH */ - case RL_HWREV_8168_SPIN3: + case RL_HWREV_8168B_SPIN3: sc->rl_flags |= RL_FLAG_PHYWAKE | RL_FLAG_MACSTAT; break; case RL_HWREV_8168C_SPIN2: Modified: head/sys/pci/if_rlreg.h ============================================================================== --- head/sys/pci/if_rlreg.h Mon Jan 17 23:54:50 2011 (r217523) +++ head/sys/pci/if_rlreg.h Tue Jan 18 00:46:10 2011 (r217524) @@ -166,13 +166,13 @@ #define RL_HWREV_8168DP 0x28800000 #define RL_HWREV_8168E 0x2C000000 #define RL_HWREV_8168E_VL 0x2C800000 -#define RL_HWREV_8168_SPIN1 0x30000000 +#define RL_HWREV_8168B_SPIN1 0x30000000 #define RL_HWREV_8100E 0x30800000 #define RL_HWREV_8101E 0x34000000 #define RL_HWREV_8102E 0x34800000 #define RL_HWREV_8103E 0x34C00000 -#define RL_HWREV_8168_SPIN2 0x38000000 -#define RL_HWREV_8168_SPIN3 0x38400000 +#define RL_HWREV_8168B_SPIN2 0x38000000 +#define RL_HWREV_8168B_SPIN3 0x38400000 #define RL_HWREV_8168C 0x3C000000 #define RL_HWREV_8168C_SPIN2 0x3C400000 #define RL_HWREV_8168CP 0x3C800000 From owner-svn-src-all@FreeBSD.ORG Tue Jan 18 00:53:56 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0023C106566C; Tue, 18 Jan 2011 00:53:55 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E14338FC08; Tue, 18 Jan 2011 00:53:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0I0rtuA018784; Tue, 18 Jan 2011 00:53:55 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0I0rtRA018778; Tue, 18 Jan 2011 00:53:55 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201101180053.p0I0rtRA018778@svn.freebsd.org> From: Rick Macklem Date: Tue, 18 Jan 2011 00:53:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217525 - in stable/8/sys/fs: nfs nfsserver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jan 2011 00:53:56 -0000 Author: rmacklem Date: Tue Jan 18 00:53:55 2011 New Revision: 217525 URL: http://svn.freebsd.org/changeset/base/217525 Log: MFC: r217063 Since the VFS_LOCK_GIANT() code in the experimental NFS server is broken and the major file systems are now all mpsafe, modify the server so that it will only export mpsafe file systems. This was discussed on freebsd-fs@ and removes a fair bit of crufty code. Modified: stable/8/sys/fs/nfs/nfs_var.h stable/8/sys/fs/nfs/nfsdport.h stable/8/sys/fs/nfsserver/nfs_nfsdport.c stable/8/sys/fs/nfsserver/nfs_nfsdserv.c stable/8/sys/fs/nfsserver/nfs_nfsdsocket.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/fs/nfs/nfs_var.h ============================================================================== --- stable/8/sys/fs/nfs/nfs_var.h Tue Jan 18 00:46:10 2011 (r217524) +++ stable/8/sys/fs/nfs/nfs_var.h Tue Jan 18 00:53:55 2011 (r217525) @@ -572,8 +572,6 @@ int nfsvno_pathconf(vnode_t, int, regist NFSPROC_T *); vnode_t nfsvno_getvp(fhandle_t *); int nfsvno_advlock(vnode_t, int, u_int64_t, u_int64_t, NFSPROC_T *); -void nfsvno_unlockvfs(mount_t); -int nfsvno_lockvfs(mount_t); int nfsrv_v4rootexport(void *, struct ucred *, NFSPROC_T *); int nfsvno_testexp(struct nfsrv_descript *, struct nfsexstuff *); uint32_t nfsrv_hashfh(fhandle_t *); Modified: stable/8/sys/fs/nfs/nfsdport.h ============================================================================== --- stable/8/sys/fs/nfs/nfsdport.h Tue Jan 18 00:46:10 2011 (r217524) +++ stable/8/sys/fs/nfs/nfsdport.h Tue Jan 18 00:53:55 2011 (r217525) @@ -52,7 +52,6 @@ * needs to be returned by nfsd_fhtovp(). */ struct nfsexstuff { - int nes_vfslocked; /* required for all ports */ int nes_exflag; /* export flags */ int nes_numsecflavor; /* # of security flavors */ int nes_secflavors[MAXSECFLAVORS]; /* and the flavors */ Modified: stable/8/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdport.c Tue Jan 18 00:46:10 2011 (r217524) +++ stable/8/sys/fs/nfsserver/nfs_nfsdport.c Tue Jan 18 00:53:55 2011 (r217525) @@ -332,18 +332,7 @@ nfsvno_namei(struct nfsrv_descript *nd, * In either case ni_startdir will be dereferenced and NULLed * out. */ - if (exp->nes_vfslocked) - ndp->ni_cnd.cn_flags |= GIANTHELD; error = lookup(ndp); - /* - * The Giant lock should only change when - * crossing mount points. - */ - if (crossmnt) { - exp->nes_vfslocked = - (ndp->ni_cnd.cn_flags & GIANTHELD) != 0; - ndp->ni_cnd.cn_flags &= ~GIANTHELD; - } if (error) break; @@ -2471,7 +2460,10 @@ nfsvno_fhtovp(struct mount *mp, fhandle_ *credp = NULL; exp->nes_numsecflavor = 0; - error = VFS_FHTOVP(mp, &fhp->fh_fid, vpp); + if (VFS_NEEDSGIANT(mp)) + error = ESTALE; + else + error = VFS_FHTOVP(mp, &fhp->fh_fid, vpp); if (error != 0) /* Make sure the server replies ESTALE to the client. */ error = ESTALE; @@ -2521,19 +2513,8 @@ nfsvno_pathconf(struct vnode *vp, int fl * - get vp and export rights by calling nfsvno_fhtovp() * - if cred->cr_uid == 0 or MNT_EXPORTANON set it to credanon * for AUTH_SYS - * Also handle getting the Giant lock for the file system, - * as required: - * - if same mount point as *mpp - * do nothing - * else if *mpp == NULL - * if already locked - * leave it locked - * else - * call VFS_LOCK_GIANT() - * else - * if already locked - * unlock Giant - * call VFS_LOCK_GIANT() + * - if mpp != NULL, return the mount point so that it can + * be used for vn_finished_write() by the caller */ void nfsd_fhtovp(struct nfsrv_descript *nd, struct nfsrvfh *nfp, int lktype, @@ -2549,27 +2530,14 @@ nfsd_fhtovp(struct nfsrv_descript *nd, s * Check for the special case of the nfsv4root_fh. */ mp = vfs_busyfs(&fhp->fh_fsid); + if (mpp != NULL) + *mpp = mp; if (mp == NULL) { *vpp = NULL; nd->nd_repstat = ESTALE; - if (*mpp && exp->nes_vfslocked) - VFS_UNLOCK_GIANT(*mpp); - *mpp = NULL; - exp->nes_vfslocked = 0; return; } - /* - * Now, handle Giant for the file system. - */ - if (*mpp != NULL && *mpp != mp && exp->nes_vfslocked) { - VFS_UNLOCK_GIANT(*mpp); - exp->nes_vfslocked = 0; - } - if (!exp->nes_vfslocked && *mpp != mp) - exp->nes_vfslocked = VFS_LOCK_GIANT(mp); - - *mpp = mp; if (startwrite) vn_start_write(NULL, mpp, V_WAIT); @@ -2633,12 +2601,9 @@ nfsd_fhtovp(struct nfsrv_descript *nd, s if (nd->nd_repstat) { if (startwrite) vn_finished_write(mp); - if (exp->nes_vfslocked) { - VFS_UNLOCK_GIANT(mp); - exp->nes_vfslocked = 0; - } *vpp = NULL; - *mpp = NULL; + if (mpp != NULL) + *mpp = NULL; } } @@ -2840,29 +2805,6 @@ nfsvno_advlock(struct vnode *vp, int fty } /* - * Unlock an underlying local file system. - */ -void -nfsvno_unlockvfs(struct mount *mp) -{ - - VFS_UNLOCK_GIANT(mp); -} - -/* - * Lock an underlying file system, as required, and return - * whether or not it is locked. - */ -int -nfsvno_lockvfs(struct mount *mp) -{ - int ret; - - ret = VFS_LOCK_GIANT(mp); - return (ret); -} - -/* * Check the nfsv4 root exports. */ int Modified: stable/8/sys/fs/nfsserver/nfs_nfsdserv.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdserv.c Tue Jan 18 00:46:10 2011 (r217524) +++ stable/8/sys/fs/nfsserver/nfs_nfsdserv.c Tue Jan 18 00:53:55 2011 (r217525) @@ -1351,7 +1351,6 @@ nfsrvd_rename(struct nfsrv_descript *nd, struct nfsvattr fdirfor, fdiraft, tdirfor, tdiraft; struct nfsexstuff tnes; struct nfsrvfh tfh; - mount_t mp = NULL; char *bufp, *tbufp = NULL; u_long *hashp; @@ -1387,9 +1386,7 @@ nfsrvd_rename(struct nfsrv_descript *nd, return (error); } nd->nd_cred->cr_uid = nd->nd_saveduid; - /* Won't lock vfs if already locked, mp == NULL */ - tnes.nes_vfslocked = exp->nes_vfslocked; - nfsd_fhtovp(nd, &tfh, LK_EXCLUSIVE, &tdp, &tnes, &mp, 0, p); + nfsd_fhtovp(nd, &tfh, LK_EXCLUSIVE, &tdp, &tnes, NULL, 0, p); if (tdp) { tdirfor_ret = nfsvno_getattr(tdp, &tdirfor, nd->nd_cred, p, 1); @@ -1401,12 +1398,8 @@ nfsrvd_rename(struct nfsrv_descript *nd, if (!nd->nd_repstat) { error = nfsrv_parsename(nd, tbufp, hashp, &tond.ni_pathlen); if (error) { - if (tdp) { - if (tnes.nes_vfslocked && !exp->nes_vfslocked && - !(nd->nd_flag & ND_NFSV4)) - nfsvno_unlockvfs(mp); + if (tdp) vrele(tdp); - } vput(dp); nfsvno_relpathbuf(&fromnd); nfsvno_relpathbuf(&tond); @@ -1420,12 +1413,8 @@ nfsrvd_rename(struct nfsrv_descript *nd, nfsrv_wcc(nd, tdirfor_ret, &tdirfor, tdiraft_ret, &tdiraft); } - if (tdp) { - if (tnes.nes_vfslocked && !exp->nes_vfslocked && - !(nd->nd_flag & ND_NFSV4)) - nfsvno_unlockvfs(mp); + if (tdp) vrele(tdp); - } vput(dp); nfsvno_relpathbuf(&fromnd); nfsvno_relpathbuf(&tond); @@ -1445,12 +1434,8 @@ nfsrvd_rename(struct nfsrv_descript *nd, } if (fdirp) vrele(fdirp); - if (tdp) { - if (tnes.nes_vfslocked && !exp->nes_vfslocked && - !(nd->nd_flag & ND_NFSV4)) - nfsvno_unlockvfs(mp); + if (tdp) vrele(tdp); - } nfsvno_relpathbuf(&tond); return (0); } @@ -1465,9 +1450,6 @@ nfsrvd_rename(struct nfsrv_descript *nd, if (tdirp) tdiraft_ret = nfsvno_getattr(tdirp, &tdiraft, nd->nd_cred, p, 0); - if (tnes.nes_vfslocked && !exp->nes_vfslocked && - !(nd->nd_flag & ND_NFSV4)) - nfsvno_unlockvfs(mp); if (fdirp) vrele(fdirp); if (tdirp) @@ -1505,7 +1487,6 @@ nfsrvd_link(struct nfsrv_descript *nd, i struct nfsvattr dirfor, diraft, at; struct nfsexstuff tnes; struct nfsrvfh dfh; - mount_t mp = NULL; char *bufp; u_long *hashp; @@ -1541,9 +1522,7 @@ nfsrvd_link(struct nfsrv_descript *nd, i /* tovp is always NULL unless NFSv4 */ return (error); } - /* Won't lock vfs if already locked, mp == NULL */ - tnes.nes_vfslocked = exp->nes_vfslocked; - nfsd_fhtovp(nd, &dfh, LK_EXCLUSIVE, &dp, &tnes, &mp, 0, + nfsd_fhtovp(nd, &dfh, LK_EXCLUSIVE, &dp, &tnes, NULL, 0, p); if (dp) NFSVOPUNLOCK(dp, 0, p); @@ -1556,12 +1535,8 @@ nfsrvd_link(struct nfsrv_descript *nd, i error = nfsrv_parsename(nd, bufp, hashp, &named.ni_pathlen); if (error) { vrele(vp); - if (dp) { - if (tnes.nes_vfslocked && !exp->nes_vfslocked && - !(nd->nd_flag & ND_NFSV4)) - nfsvno_unlockvfs(mp); + if (dp) vrele(dp); - } nfsvno_relpathbuf(&named); return (error); } @@ -1591,9 +1566,6 @@ nfsrvd_link(struct nfsrv_descript *nd, i diraft_ret = nfsvno_getattr(dirp, &diraft, nd->nd_cred, p, 0); vrele(dirp); } - if (tnes.nes_vfslocked && !exp->nes_vfslocked && - !(nd->nd_flag & ND_NFSV4)) - nfsvno_unlockvfs(mp); vrele(vp); if (nd->nd_flag & ND_NFSV3) { nfsrv_postopattr(nd, getret, &at); @@ -3101,7 +3073,6 @@ nfsrvd_secinfo(struct nfsrv_descript *nd vnode_t dirp = NULL, vp; struct nfsrvfh fh; struct nfsexstuff retnes; - mount_t mp; u_int32_t *sizp; int error, savflag, i; char *bufp; @@ -3134,12 +3105,10 @@ nfsrvd_secinfo(struct nfsrv_descript *nd fh.nfsrvfh_len = NFSX_MYFH; vp = named.ni_vp; nd->nd_repstat = nfsvno_getfh(vp, (fhandle_t *)fh.nfsrvfh_data, p); - mp = vnode_mount(vp); /* so it won't try to re-lock filesys */ - retnes.nes_vfslocked = exp->nes_vfslocked; vput(vp); savflag = nd->nd_flag; if (!nd->nd_repstat) { - nfsd_fhtovp(nd, &fh, LK_SHARED, &vp, &retnes, &mp, 0, p); + nfsd_fhtovp(nd, &fh, LK_SHARED, &vp, &retnes, NULL, 0, p); if (vp) vput(vp); } Modified: stable/8/sys/fs/nfsserver/nfs_nfsdsocket.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdsocket.c Tue Jan 18 00:46:10 2011 (r217524) +++ stable/8/sys/fs/nfsserver/nfs_nfsdsocket.c Tue Jan 18 00:53:55 2011 (r217525) @@ -386,7 +386,6 @@ nfsrvd_dorpc(struct nfsrv_descript *nd, lktype = LK_SHARED; else lktype = LK_EXCLUSIVE; - nes.nes_vfslocked = 0; if (nd->nd_flag & ND_PUBLOOKUP) nfsd_fhtovp(nd, &nfs_pubfh, lktype, &vp, &nes, &mp, nfs_writerpc[nd->nd_procnum], p); @@ -415,12 +414,8 @@ nfsrvd_dorpc(struct nfsrv_descript *nd, if (nd->nd_repstat && (nd->nd_flag & ND_NFSV2)) { *nd->nd_errp = nfsd_errmap(nd); NFSINCRGLOBAL(newnfsstats.srvrpccnt[nfsv3to4op[nd->nd_procnum]]); - if (mp != NULL) { - if (nfs_writerpc[nd->nd_procnum]) - NFS_ENDWRITE(mp); - if (nes.nes_vfslocked) - nfsvno_unlockvfs(mp); - } + if (mp != NULL && nfs_writerpc[nd->nd_procnum] != 0) + vn_finished_write(mp); return; } @@ -445,12 +440,8 @@ nfsrvd_dorpc(struct nfsrv_descript *nd, error = (*(nfsrv3_procs0[nd->nd_procnum]))(nd, isdgram, vp, p, &nes); } - if (mp) { - if (nfs_writerpc[nd->nd_procnum]) - NFS_ENDWRITE(mp); - if (nes.nes_vfslocked) - nfsvno_unlockvfs(mp); - } + if (mp != NULL && nfs_writerpc[nd->nd_procnum] != 0) + vn_finished_write(mp); NFSINCRGLOBAL(newnfsstats.srvrpccnt[nfsv3to4op[nd->nd_procnum]]); } if (error) { @@ -498,9 +489,10 @@ nfsrvd_compound(struct nfsrv_descript *n u_char tag[NFSV4_SMALLSTR + 1], *tagstr; vnode_t vp, nvp, savevp; struct nfsrvfh fh; - mount_t mp, savemp, temp_mp = NULL; + mount_t new_mp, temp_mp = NULL; struct ucred *credanon; struct nfsexstuff nes, vpnes, savevpnes; + fsid_t cur_fsid, save_fsid; static u_int64_t compref = 0; NFSVNO_EXINIT(&vpnes); @@ -597,8 +589,8 @@ nfsrvd_compound(struct nfsrv_descript *n } savevp = vp = NULL; - savevpnes.nes_vfslocked = vpnes.nes_vfslocked = 0; - savemp = mp = NULL; + save_fsid.val[0] = save_fsid.val[1] = 0; + cur_fsid.val[0] = cur_fsid.val[1] = 0; NFSM_DISSECT(tl, u_int32_t *, NFSX_UNSIGNED); taglen = fxdr_unsigned(int, *tl); if (taglen < 0) { @@ -704,46 +696,44 @@ nfsrvd_compound(struct nfsrv_descript *n error = nfsrv_mtofh(nd, &fh); if (error) goto nfsmout; - if (!nd->nd_repstat) { - nes.nes_vfslocked = vpnes.nes_vfslocked; - nfsd_fhtovp(nd, &fh, LK_SHARED, &nvp, &nes, &mp, - 0, p); - } + if (!nd->nd_repstat) + nfsd_fhtovp(nd, &fh, LK_SHARED, &nvp, &nes, + NULL, 0, p); /* For now, allow this for non-export FHs */ if (!nd->nd_repstat) { if (vp) vrele(vp); vp = nvp; - NFSVOPUNLOCK(vp, 0, p); + cur_fsid = vp->v_mount->mnt_stat.f_fsid; + VOP_UNLOCK(vp, 0); vpnes = nes; } break; case NFSV4OP_PUTPUBFH: - if (nfs_pubfhset) { - nes.nes_vfslocked = vpnes.nes_vfslocked; + if (nfs_pubfhset) nfsd_fhtovp(nd, &nfs_pubfh, LK_SHARED, &nvp, - &nes, &mp, 0, p); - } else { + &nes, NULL, 0, p); + else nd->nd_repstat = NFSERR_NOFILEHANDLE; - } if (!nd->nd_repstat) { if (vp) vrele(vp); vp = nvp; - NFSVOPUNLOCK(vp, 0, p); + cur_fsid = vp->v_mount->mnt_stat.f_fsid; + VOP_UNLOCK(vp, 0); vpnes = nes; } break; case NFSV4OP_PUTROOTFH: if (nfs_rootfhset) { - nes.nes_vfslocked = vpnes.nes_vfslocked; nfsd_fhtovp(nd, &nfs_rootfh, LK_SHARED, &nvp, - &nes, &mp, 0, p); + &nes, NULL, 0, p); if (!nd->nd_repstat) { if (vp) vrele(vp); vp = nvp; - NFSVOPUNLOCK(vp, 0, p); + cur_fsid = vp->v_mount->mnt_stat.f_fsid; + VOP_UNLOCK(vp, 0); vpnes = nes; } } else @@ -759,7 +749,7 @@ nfsrvd_compound(struct nfsrv_descript *n VREF(vp); savevp = vp; savevpnes = vpnes; - savemp = mp; + save_fsid = cur_fsid; } } else { nd->nd_repstat = NFSERR_NOFILEHANDLE; @@ -771,23 +761,10 @@ nfsrvd_compound(struct nfsrv_descript *n /* If vp == savevp, a no-op */ if (vp != savevp) { VREF(savevp); - if (mp == NULL || savemp == NULL) - panic("nfscmpmp"); - if (!savevpnes.nes_vfslocked && - vpnes.nes_vfslocked) { - if (mp == savemp) - panic("nfscmp2"); - nfsvno_unlockvfs(mp); - } else if (savevpnes.nes_vfslocked && - !vpnes.nes_vfslocked) { - if (mp == savemp) - panic("nfscmp3"); - savevpnes.nes_vfslocked = nfsvno_lockvfs(savemp); - } vrele(vp); vp = savevp; vpnes = savevpnes; - mp = savemp; + cur_fsid = save_fsid; } } else { nd->nd_repstat = NFSERR_RESTOREFH; @@ -841,11 +818,14 @@ nfsrvd_compound(struct nfsrv_descript *n error = (*(nfsrv4_ops1[op]))(nd, isdgram, vp, &nvp, (fhandle_t *)fh.nfsrvfh_data, p, &vpnes); if (!error && !nd->nd_repstat) { - if (vfs_statfs(mp)->f_fsid.val[0] != - vfs_statfs(vnode_mount(nvp))->f_fsid.val[0] || - vfs_statfs(mp)->f_fsid.val[1] != - vfs_statfs(vnode_mount(nvp))->f_fsid.val[1]) { - nd->nd_repstat = nfsvno_checkexp(vnode_mount(nvp), + if (op == NFSV4OP_LOOKUP || op == NFSV4OP_LOOKUPP) { + new_mp = nvp->v_mount; + if (cur_fsid.val[0] != + new_mp->mnt_stat.f_fsid.val[0] || + cur_fsid.val[1] != + new_mp->mnt_stat.f_fsid.val[1]) { + /* crossed a server mount point */ + nd->nd_repstat = nfsvno_checkexp(new_mp, nd->nd_nam, &nes, &credanon); if (!nd->nd_repstat) nd->nd_repstat = nfsd_excred(nd, @@ -853,17 +833,13 @@ nfsrvd_compound(struct nfsrv_descript *n if (credanon != NULL) crfree(credanon); if (!nd->nd_repstat) { - if (vpnes.nes_vfslocked) - nfsvno_unlockvfs(mp); - mp = vnode_mount(nvp); vpnes = nes; - vpnes.nes_vfslocked = - nfsvno_lockvfs(mp); + cur_fsid = new_mp->mnt_stat.f_fsid; } + } + /* Lookup ops return a locked vnode */ + VOP_UNLOCK(nvp, 0); } - if (op == NFSV4OP_LOOKUP || op == NFSV4OP_LOOKUPP) - /* Lookup ops return a locked vnode */ - VOP_UNLOCK(nvp, 0); if (!nd->nd_repstat) { vrele(vp); vp = nvp; @@ -876,7 +852,8 @@ nfsrvd_compound(struct nfsrv_descript *n if (vp == NULL || savevp == NULL) { nd->nd_repstat = NFSERR_NOFILEHANDLE; break; - } else if (mp != savemp) { + } else if (cur_fsid.val[0] != save_fsid.val[0] || + cur_fsid.val[1] != save_fsid.val[1]) { nd->nd_repstat = NFSERR_XDEV; break; } @@ -960,8 +937,6 @@ nfsmout: } else { *retopsp = txdr_unsigned(retops); } - if (mp && vpnes.nes_vfslocked) - nfsvno_unlockvfs(mp); if (vp) vrele(vp); if (savevp) From owner-svn-src-all@FreeBSD.ORG Tue Jan 18 01:07:09 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84AA6106566B; Tue, 18 Jan 2011 01:07:09 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5877D8FC08; Tue, 18 Jan 2011 01:07:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0I1795o019161; Tue, 18 Jan 2011 01:07:09 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0I17963019158; Tue, 18 Jan 2011 01:07:09 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201101180107.p0I17963019158@svn.freebsd.org> From: Rick Macklem Date: Tue, 18 Jan 2011 01:07:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217526 - in stable/8/sys/fs: nfs nfsserver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jan 2011 01:07:09 -0000 Author: rmacklem Date: Tue Jan 18 01:07:09 2011 New Revision: 217526 URL: http://svn.freebsd.org/changeset/base/217526 Log: MFC: r217066 Delete the NFS_STARTWRITE() and NFS_ENDWRITE() macros that obscured vn_start_write() and vn_finished_write() for the old OpenBSD port, since most uses have been replaced by the correct calls. Modified: stable/8/sys/fs/nfs/nfsport.h stable/8/sys/fs/nfsserver/nfs_nfsdstate.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/fs/nfs/nfsport.h ============================================================================== --- stable/8/sys/fs/nfs/nfsport.h Tue Jan 18 00:53:55 2011 (r217525) +++ stable/8/sys/fs/nfs/nfsport.h Tue Jan 18 01:07:09 2011 (r217526) @@ -600,13 +600,6 @@ int nfsmsleep(void *, void *, int, const #define MAX_COMMIT_COUNT (1024 * 1024) /* - * These macros are called at the start and end of operations that - * might modify the underlying file system. - */ -#define NFS_STARTWRITE(v, m) vn_start_write((v), (m), V_WAIT) -#define NFS_ENDWRITE(m) vn_finished_write(m) - -/* * Define these to handle the type of va_rdev. */ #define NFSMAKEDEV(m, n) makedev((m), (n)) Modified: stable/8/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdstate.c Tue Jan 18 00:53:55 2011 (r217525) +++ stable/8/sys/fs/nfsserver/nfs_nfsdstate.c Tue Jan 18 01:07:09 2011 (r217526) @@ -4092,14 +4092,14 @@ nfsrv_updatestable(NFSPROC_T *p) NFSVNO_ATTRINIT(&nva); NFSVNO_SETATTRVAL(&nva, size, 0); vp = NFSFPVNODE(sf->nsf_fp); - NFS_STARTWRITE(vp, &mp); + vn_start_write(vp, &mp, V_WAIT); if (vn_lock(vp, LK_EXCLUSIVE) == 0) { error = nfsvno_setattr(vp, &nva, NFSFPCRED(sf->nsf_fp), p, NULL); VOP_UNLOCK(vp, 0); } else error = EPERM; - NFS_ENDWRITE(mp); + vn_finished_write(mp); if (!error) error = NFSD_RDWR(UIO_WRITE, vp, (caddr_t)&sf->nsf_rec, sizeof (struct nfsf_rec), (off_t)0, From owner-svn-src-all@FreeBSD.ORG Tue Jan 18 01:20:16 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B6EE106564A; Tue, 18 Jan 2011 01:20:16 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 494268FC17; Tue, 18 Jan 2011 01:20:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0I1KGFc019545; Tue, 18 Jan 2011 01:20:16 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0I1KGfa019541; Tue, 18 Jan 2011 01:20:16 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201101180120.p0I1KGfa019541@svn.freebsd.org> From: Rick Macklem Date: Tue, 18 Jan 2011 01:20:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217527 - stable/8/sys/rpc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jan 2011 01:20:16 -0000 Author: rmacklem Date: Tue Jan 18 01:20:15 2011 New Revision: 217527 URL: http://svn.freebsd.org/changeset/base/217527 Log: MFC: r217242 Fix a bug in the client side krpc where it was, sometimes erroneously, assumed that 4 bytes of data were in the first mbuf of a list by replacing the bcopy() with m_copydata(). Also, replace the uses of m_pullup(), which can fail for reasons other than not enough data, with m_copydata(). For the cases where it isn't known that there is enough data in the mbuf list, check first via m_len and m_length(). This is believed to fix a problem reported by dpd at dpdtech.com and george+freebsd at m5p.com. Modified: stable/8/sys/rpc/clnt_dg.c stable/8/sys/rpc/clnt_vc.c stable/8/sys/rpc/svc_vc.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/rpc/clnt_dg.c ============================================================================== --- stable/8/sys/rpc/clnt_dg.c Tue Jan 18 01:07:09 2011 (r217526) +++ stable/8/sys/rpc/clnt_dg.c Tue Jan 18 01:20:15 2011 (r217527) @@ -1089,15 +1089,14 @@ clnt_dg_soupcall(struct socket *so, void /* * The XID is in the first uint32_t of the reply. */ - if (m->m_len < sizeof(xid)) - m = m_pullup(m, sizeof(xid)); - if (!m) + if (m->m_len < sizeof(xid) && m_length(m, NULL) < sizeof(xid)) /* * Should never happen. */ continue; - xid = ntohl(*mtod(m, uint32_t *)); + m_copydata(m, 0, sizeof(xid), (char *)&xid); + xid = ntohl(xid); /* * Attempt to match this reply with a pending request. Modified: stable/8/sys/rpc/clnt_vc.c ============================================================================== --- stable/8/sys/rpc/clnt_vc.c Tue Jan 18 01:07:09 2011 (r217526) +++ stable/8/sys/rpc/clnt_vc.c Tue Jan 18 01:20:15 2011 (r217527) @@ -916,7 +916,7 @@ clnt_vc_soupcall(struct socket *so, void mtx_unlock(&ct->ct_lock); break; } - bcopy(mtod(m, uint32_t *), &header, sizeof(uint32_t)); + m_copydata(m, 0, sizeof(uint32_t), (char *)&header); header = ntohl(header); ct->ct_record = NULL; ct->ct_record_resid = header & 0x7fffffff; @@ -975,14 +975,11 @@ clnt_vc_soupcall(struct socket *so, void * The XID is in the first uint32_t of * the reply. */ - if (ct->ct_record->m_len < sizeof(xid)) - ct->ct_record = - m_pullup(ct->ct_record, - sizeof(xid)); - if (!ct->ct_record) + if (ct->ct_record->m_len < sizeof(xid) && + m_length(ct->ct_record, NULL) < sizeof(xid)) break; - bcopy(mtod(ct->ct_record, uint32_t *), - &xid, sizeof(uint32_t)); + m_copydata(ct->ct_record, 0, sizeof(xid), + (char *)&xid); xid = ntohl(xid); mtx_lock(&ct->ct_lock); Modified: stable/8/sys/rpc/svc_vc.c ============================================================================== --- stable/8/sys/rpc/svc_vc.c Tue Jan 18 01:07:09 2011 (r217526) +++ stable/8/sys/rpc/svc_vc.c Tue Jan 18 01:20:15 2011 (r217527) @@ -559,11 +559,8 @@ svc_vc_recv(SVCXPRT *xprt, struct rpc_ms } if (n < sizeof(uint32_t)) goto readmore; - if (cd->mpending->m_len < sizeof(uint32_t)) - cd->mpending = m_pullup(cd->mpending, - sizeof(uint32_t)); - memcpy(&header, mtod(cd->mpending, uint32_t *), - sizeof(header)); + m_copydata(cd->mpending, 0, sizeof(header), + (char *)&header); header = ntohl(header); cd->eor = (header & 0x80000000) != 0; cd->resid = header & 0x7fffffff; From owner-svn-src-all@FreeBSD.ORG Tue Jan 18 04:54:44 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 14FB7106566B; Tue, 18 Jan 2011 04:54:44 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 043408FC1E; Tue, 18 Jan 2011 04:54:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0I4shSZ024689; Tue, 18 Jan 2011 04:54:43 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0I4sh6m024685; Tue, 18 Jan 2011 04:54:43 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201101180454.p0I4sh6m024685@svn.freebsd.org> From: Alan Cox Date: Tue, 18 Jan 2011 04:54:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217529 - head/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jan 2011 04:54:44 -0000 Author: alc Date: Tue Jan 18 04:54:43 2011 New Revision: 217529 URL: http://svn.freebsd.org/changeset/base/217529 Log: Move the definition of M_VMPGDATA to the swap pager, where the only remaining uses are. Modified: head/sys/vm/swap_pager.c head/sys/vm/vm_pager.c head/sys/vm/vm_pager.h Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Tue Jan 18 04:13:46 2011 (r217528) +++ head/sys/vm/swap_pager.c Tue Jan 18 04:54:43 2011 (r217529) @@ -147,6 +147,7 @@ struct swblock { daddr_t swb_pages[SWAP_META_PAGES]; }; +static MALLOC_DEFINE(M_VMPGDATA, "vm_pgdata", "swap pager private data"); static struct mtx sw_dev_mtx; static TAILQ_HEAD(, swdevt) swtailq = TAILQ_HEAD_INITIALIZER(swtailq); static struct swdevt *swdevhd; /* Allocate from here next */ Modified: head/sys/vm/vm_pager.c ============================================================================== --- head/sys/vm/vm_pager.c Tue Jan 18 04:13:46 2011 (r217528) +++ head/sys/vm/vm_pager.c Tue Jan 18 04:54:43 2011 (r217529) @@ -82,8 +82,6 @@ __FBSDID("$FreeBSD$"); #include #include -MALLOC_DEFINE(M_VMPGDATA, "vm_pgdata", "XXX: VM pager private data"); - int cluster_pbuf_freecnt = -1; /* unlimited to begin with */ static int dead_pager_getpages(vm_object_t, vm_page_t *, int, int); Modified: head/sys/vm/vm_pager.h ============================================================================== --- head/sys/vm/vm_pager.h Tue Jan 18 04:13:46 2011 (r217528) +++ head/sys/vm/vm_pager.h Tue Jan 18 04:54:43 2011 (r217529) @@ -93,9 +93,6 @@ extern struct pagerops sgpagerops; #define VM_PAGER_CLUSTER_OK 0x0008 #ifdef _KERNEL -#ifdef MALLOC_DECLARE -MALLOC_DECLARE(M_VMPGDATA); -#endif extern vm_map_t pager_map; extern struct pagerops *pagertab[]; From owner-svn-src-all@FreeBSD.ORG Tue Jan 18 06:24:53 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 358D5106566B; Tue, 18 Jan 2011 06:24:53 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 242BA8FC12; Tue, 18 Jan 2011 06:24:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0I6Orov027841; Tue, 18 Jan 2011 06:24:53 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0I6Or1o027839; Tue, 18 Jan 2011 06:24:53 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201101180624.p0I6Or1o027839@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Tue, 18 Jan 2011 06:24:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217530 - stable/8/sys/geom/nop X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jan 2011 06:24:53 -0000 Author: ae Date: Tue Jan 18 06:24:52 2011 New Revision: 217530 URL: http://svn.freebsd.org/changeset/base/217530 Log: MFC r217262: Round GNOP provider's mediasize to its sectorsize. This prevents KASSERT in g_io_request when geom classes doing tasting. PR: kern/147852 MFC r217263: Remove redundant check. Modified: stable/8/sys/geom/nop/g_nop.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/geom/nop/g_nop.c ============================================================================== --- stable/8/sys/geom/nop/g_nop.c Tue Jan 18 04:54:43 2011 (r217529) +++ stable/8/sys/geom/nop/g_nop.c Tue Jan 18 06:24:52 2011 (r217530) @@ -176,6 +176,7 @@ g_nop_create(struct gctl_req *req, struc gctl_error(req, "Invalid secsize for provider %s.", pp->name); return (EINVAL); } + size -= size % secsize; snprintf(name, sizeof(name), "%s%s", pp->name, G_NOP_SUFFIX); LIST_FOREACH(gp, &mp->geom, geom) { if (strcmp(gp->name, name) == 0) { From owner-svn-src-all@FreeBSD.ORG Tue Jan 18 09:52:53 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D78FB1065694; Tue, 18 Jan 2011 09:52:53 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C75AE8FC14; Tue, 18 Jan 2011 09:52:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0I9qrtk032936; Tue, 18 Jan 2011 09:52:53 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0I9qrVN032934; Tue, 18 Jan 2011 09:52:53 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201101180952.p0I9qrVN032934@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Tue, 18 Jan 2011 09:52:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217531 - head/sys/geom/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jan 2011 09:52:54 -0000 Author: ae Date: Tue Jan 18 09:52:53 2011 New Revision: 217531 URL: http://svn.freebsd.org/changeset/base/217531 Log: Limit maximum number of GPT entries to 4k. It is most realistic value and can prevent kernel memory exhausting when big value is specified from command line. Split reading and writing operation to several iteration to do not trigger KASSERT when data length is greater than MAXPHYS. PR: kern/144962, kern/147851 MFC after: 2 weeks Modified: head/sys/geom/part/g_part_gpt.c Modified: head/sys/geom/part/g_part_gpt.c ============================================================================== --- head/sys/geom/part/g_part_gpt.c Tue Jan 18 06:24:52 2011 (r217530) +++ head/sys/geom/part/g_part_gpt.c Tue Jan 18 09:52:53 2011 (r217531) @@ -134,7 +134,7 @@ static struct g_part_scheme g_part_gpt_s sizeof(struct g_part_gpt_table), .gps_entrysz = sizeof(struct g_part_gpt_entry), .gps_minent = 128, - .gps_maxent = INT_MAX, + .gps_maxent = 4096, .gps_bootcodesz = MBRSIZE, }; G_PART_SCHEME_DECLARE(g_part_gpt); @@ -317,7 +317,7 @@ gpt_read_tbl(struct g_part_gpt_table *ta struct g_provider *pp; struct gpt_ent *ent, *tbl; char *buf, *p; - unsigned int idx, sectors, tblsz; + unsigned int idx, sectors, tblsz, size; int error; if (hdr == NULL) @@ -329,11 +329,19 @@ gpt_read_tbl(struct g_part_gpt_table *ta table->state[elt] = GPT_STATE_MISSING; tblsz = hdr->hdr_entries * hdr->hdr_entsz; sectors = (tblsz + pp->sectorsize - 1) / pp->sectorsize; - buf = g_read_data(cp, table->lba[elt] * pp->sectorsize, - sectors * pp->sectorsize, &error); - if (buf == NULL) - return (NULL); - + buf = g_malloc(sectors * pp->sectorsize, M_WAITOK | M_ZERO); + for (idx = 0; idx < sectors; idx += MAXPHYS / pp->sectorsize) { + size = (sectors - idx > MAXPHYS / pp->sectorsize) ? MAXPHYS: + (sectors - idx) * pp->sectorsize; + p = g_read_data(cp, (table->lba[elt] + idx) * pp->sectorsize, + size, &error); + if (p == NULL) { + g_free(buf); + return (NULL); + } + bcopy(p, buf + idx * pp->sectorsize, size); + g_free(p); + } table->state[elt] = GPT_STATE_CORRUPT; if (crc32(buf, tblsz) != hdr->hdr_crc_table) { g_free(buf); @@ -986,10 +994,15 @@ g_part_gpt_write(struct g_part_table *ba crc = crc32(buf, table->hdr->hdr_size); le32enc(buf + 16, crc); - error = g_write_data(cp, table->lba[GPT_ELT_PRITBL] * pp->sectorsize, - buf + pp->sectorsize, tblsz * pp->sectorsize); - if (error) - goto out; + for (index = 0; index < tblsz; index += MAXPHYS / pp->sectorsize) { + error = g_write_data(cp, + (table->lba[GPT_ELT_PRITBL] + index) * pp->sectorsize, + buf + (index + 1) * pp->sectorsize, + (tblsz - index > MAXPHYS / pp->sectorsize) ? MAXPHYS: + (tblsz - index) * pp->sectorsize); + if (error) + goto out; + } error = g_write_data(cp, table->lba[GPT_ELT_PRIHDR] * pp->sectorsize, buf, pp->sectorsize); if (error) @@ -1003,10 +1016,15 @@ g_part_gpt_write(struct g_part_table *ba crc = crc32(buf, table->hdr->hdr_size); le32enc(buf + 16, crc); - error = g_write_data(cp, table->lba[GPT_ELT_SECTBL] * pp->sectorsize, - buf + pp->sectorsize, tblsz * pp->sectorsize); - if (error) - goto out; + for (index = 0; index < tblsz; index += MAXPHYS / pp->sectorsize) { + error = g_write_data(cp, + (table->lba[GPT_ELT_SECTBL] + index) * pp->sectorsize, + buf + (index + 1) * pp->sectorsize, + (tblsz - index > MAXPHYS / pp->sectorsize) ? MAXPHYS: + (tblsz - index) * pp->sectorsize); + if (error) + goto out; + } error = g_write_data(cp, table->lba[GPT_ELT_SECHDR] * pp->sectorsize, buf, pp->sectorsize); From owner-svn-src-all@FreeBSD.ORG Tue Jan 18 10:42:14 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 433D7106564A; Tue, 18 Jan 2011 10:42:14 +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 3159A8FC17; Tue, 18 Jan 2011 10:42:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0IAgEq0034194; Tue, 18 Jan 2011 10:42:14 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0IAgDsL034185; Tue, 18 Jan 2011 10:42:13 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201101181042.p0IAgDsL034185@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 18 Jan 2011 10:42:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217532 - in stable/8/sys: dev/random geom kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jan 2011 10:42:14 -0000 Author: kib Date: Tue Jan 18 10:42:13 2011 New Revision: 217532 URL: http://svn.freebsd.org/changeset/base/217532 Log: MFC r216952: Mark some devices as eternal. Modified: stable/8/sys/dev/random/randomdev.c stable/8/sys/geom/geom_ctl.c stable/8/sys/kern/kern_descrip.c stable/8/sys/kern/subr_bus.c stable/8/sys/kern/subr_devstat.c stable/8/sys/kern/subr_log.c stable/8/sys/kern/tty.c stable/8/sys/kern/tty_tty.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/random/randomdev.c ============================================================================== --- stable/8/sys/dev/random/randomdev.c Tue Jan 18 09:52:53 2011 (r217531) +++ stable/8/sys/dev/random/randomdev.c Tue Jan 18 10:42:13 2011 (r217532) @@ -195,8 +195,8 @@ random_modevent(module_t mod __unused, i printf("random: \n", random_systat.ident); - random_dev = make_dev(&random_cdevsw, RANDOM_MINOR, - UID_ROOT, GID_WHEEL, 0666, "random"); + random_dev = make_dev_credf(MAKEDEV_ETERNAL_KLD, &random_cdevsw, + RANDOM_MINOR, NULL, UID_ROOT, GID_WHEEL, 0666, "random"); make_dev_alias(random_dev, "urandom"); /* XXX Deprecated */ break; Modified: stable/8/sys/geom/geom_ctl.c ============================================================================== --- stable/8/sys/geom/geom_ctl.c Tue Jan 18 09:52:53 2011 (r217531) +++ stable/8/sys/geom/geom_ctl.c Tue Jan 18 10:42:13 2011 (r217532) @@ -75,7 +75,7 @@ void g_ctl_init(void) { - make_dev(&g_ctl_cdevsw, 0, + make_dev_credf(MAKEDEV_ETERNAL, &g_ctl_cdevsw, 0, NULL, UID_ROOT, GID_OPERATOR, 0640, PATH_GEOM_CTL); KASSERT(GCTL_PARAM_RD == VM_PROT_READ, ("GCTL_PARAM_RD != VM_PROT_READ")); Modified: stable/8/sys/kern/kern_descrip.c ============================================================================== --- stable/8/sys/kern/kern_descrip.c Tue Jan 18 09:52:53 2011 (r217531) +++ stable/8/sys/kern/kern_descrip.c Tue Jan 18 10:42:13 2011 (r217532) @@ -3430,11 +3430,14 @@ fildesc_drvinit(void *unused) { struct cdev *dev; - dev = make_dev(&fildesc_cdevsw, 0, UID_ROOT, GID_WHEEL, 0666, "fd/0"); + dev = make_dev_credf(MAKEDEV_ETERNAL, &fildesc_cdevsw, 0, NULL, + UID_ROOT, GID_WHEEL, 0666, "fd/0"); make_dev_alias(dev, "stdin"); - dev = make_dev(&fildesc_cdevsw, 1, UID_ROOT, GID_WHEEL, 0666, "fd/1"); + dev = make_dev_credf(MAKEDEV_ETERNAL, &fildesc_cdevsw, 1, NULL, + UID_ROOT, GID_WHEEL, 0666, "fd/1"); make_dev_alias(dev, "stdout"); - dev = make_dev(&fildesc_cdevsw, 2, UID_ROOT, GID_WHEEL, 0666, "fd/2"); + dev = make_dev_credf(MAKEDEV_ETERNAL, &fildesc_cdevsw, 2, NULL, + UID_ROOT, GID_WHEEL, 0666, "fd/2"); make_dev_alias(dev, "stderr"); } Modified: stable/8/sys/kern/subr_bus.c ============================================================================== --- stable/8/sys/kern/subr_bus.c Tue Jan 18 09:52:53 2011 (r217531) +++ stable/8/sys/kern/subr_bus.c Tue Jan 18 10:42:13 2011 (r217532) @@ -405,8 +405,8 @@ static struct cdev *devctl_dev; static void devinit(void) { - devctl_dev = make_dev(&dev_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, - "devctl"); + devctl_dev = make_dev_credf(MAKEDEV_ETERNAL, &dev_cdevsw, 0, NULL, + UID_ROOT, GID_WHEEL, 0600, "devctl"); mtx_init(&devsoftc.mtx, "dev mtx", "devd", MTX_DEF); cv_init(&devsoftc.cv, "dev cv"); TAILQ_INIT(&devsoftc.devq); Modified: stable/8/sys/kern/subr_devstat.c ============================================================================== --- stable/8/sys/kern/subr_devstat.c Tue Jan 18 09:52:53 2011 (r217531) +++ stable/8/sys/kern/subr_devstat.c Tue Jan 18 10:42:13 2011 (r217532) @@ -475,7 +475,7 @@ devstat_alloc(void) mtx_assert(&devstat_mutex, MA_NOTOWNED); if (!once) { - make_dev(&devstat_cdevsw, 0, + make_dev_credf(MAKEDEV_ETERNAL, &devstat_cdevsw, 0, NULL, UID_ROOT, GID_WHEEL, 0400, DEVSTAT_DEVICE_NAME); once = 1; } Modified: stable/8/sys/kern/subr_log.c ============================================================================== --- stable/8/sys/kern/subr_log.c Tue Jan 18 09:52:53 2011 (r217531) +++ stable/8/sys/kern/subr_log.c Tue Jan 18 10:42:13 2011 (r217532) @@ -247,7 +247,8 @@ static void log_drvinit(void *unused) { - make_dev(&log_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, "klog"); + make_dev_credf(MAKEDEV_ETERNAL, &log_cdevsw, 0, NULL, UID_ROOT, + GID_WHEEL, 0600, "klog"); } SYSINIT(logdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE,log_drvinit,NULL); Modified: stable/8/sys/kern/tty.c ============================================================================== --- stable/8/sys/kern/tty.c Tue Jan 18 09:52:53 2011 (r217531) +++ stable/8/sys/kern/tty.c Tue Jan 18 10:42:13 2011 (r217532) @@ -1924,8 +1924,8 @@ static void ttyconsdev_init(void *unused) { - dev_console = make_dev(&ttyconsdev_cdevsw, 0, UID_ROOT, GID_WHEEL, - 0600, "console"); + dev_console = make_dev_credf(MAKEDEV_ETERNAL, &ttyconsdev_cdevsw, 0, + NULL, UID_ROOT, GID_WHEEL, 0600, "console"); } SYSINIT(tty, SI_SUB_DRIVERS, SI_ORDER_FIRST, ttyconsdev_init, NULL); Modified: stable/8/sys/kern/tty_tty.c ============================================================================== --- stable/8/sys/kern/tty_tty.c Tue Jan 18 09:52:53 2011 (r217531) +++ stable/8/sys/kern/tty_tty.c Tue Jan 18 10:42:13 2011 (r217532) @@ -87,7 +87,8 @@ ctty_drvinit(void *unused) { EVENTHANDLER_REGISTER(dev_clone, ctty_clone, 0, 1000); - ctty = make_dev(&ctty_cdevsw, 0, 0, 0, 0666, "ctty"); + ctty = make_dev_credf(MAKEDEV_ETERNAL, &ctty_cdevsw, 0, NULL, UID_ROOT, + GID_WHEEL, 0666, "ctty"); } SYSINIT(cttydev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE,ctty_drvinit,NULL); From owner-svn-src-all@FreeBSD.ORG Tue Jan 18 11:51:48 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 746031065673; Tue, 18 Jan 2011 11:51:48 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6280A8FC17; Tue, 18 Jan 2011 11:51:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0IBpmFD037080; Tue, 18 Jan 2011 11:51:48 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0IBpmVG037071; Tue, 18 Jan 2011 11:51:48 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201101181151.p0IBpmVG037071@svn.freebsd.org> From: Marius Strobl Date: Tue, 18 Jan 2011 11:51:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217533 - stable/8/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jan 2011 11:51:48 -0000 Author: marius Date: Tue Jan 18 11:51:48 2011 New Revision: 217533 URL: http://svn.freebsd.org/changeset/base/217533 Log: MFC: r217464, r217468, r217475 Add a manual page for rgephy(4) and reference it as appropriate. The motivation for having rgephy.4 is to document the special media option added in r217415 (MFC'ed to stable/8 in r217502). Added: stable/8/share/man/man4/rgephy.4 - copied, changed from r217464, head/share/man/man4/rgephy.4 Modified: stable/8/share/man/man4/Makefile stable/8/share/man/man4/axe.4 stable/8/share/man/man4/miibus.4 stable/8/share/man/man4/nfe.4 stable/8/share/man/man4/nve.4 stable/8/share/man/man4/re.4 stable/8/share/man/man4/sge.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/Makefile ============================================================================== --- stable/8/share/man/man4/Makefile Tue Jan 18 10:42:13 2011 (r217532) +++ stable/8/share/man/man4/Makefile Tue Jan 18 11:51:48 2011 (r217533) @@ -331,6 +331,7 @@ MAN= aac.4 \ random.4 \ rc.4 \ re.4 \ + rgephy.4 \ rl.4 \ rndtest.4 \ route.4 \ Modified: stable/8/share/man/man4/axe.4 ============================================================================== --- stable/8/share/man/man4/axe.4 Tue Jan 18 10:42:13 2011 (r217532) +++ stable/8/share/man/man4/axe.4 Tue Jan 18 11:51:48 2011 (r217533) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 20, 2008 +.Dd January 16, 2011 .Dt AXE 4 .Os .Sh NAME @@ -206,6 +206,7 @@ The driver failed to allocate an mbuf fo .Xr miibus 4 , .Xr netintro 4 , .Xr ng_ether 4 , +.Xr rgephy 4 , .Xr ifconfig 8 .Rs .%T "ASIX AX88172 AX88178 and AX88772 data sheets" Modified: stable/8/share/man/man4/miibus.4 ============================================================================== --- stable/8/share/man/man4/miibus.4 Tue Jan 18 10:42:13 2011 (r217532) +++ stable/8/share/man/man4/miibus.4 Tue Jan 18 11:51:48 2011 (r217533) @@ -8,7 +8,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 14, 2010 +.Dd January 15, 2011 .Dt MIIBUS 4 .Os .Sh NAME @@ -157,6 +157,7 @@ but as a result are not well behaved new .Xr nve 4 , .Xr pcn 4 , .Xr re 4 , +.Xr rgephy 4 , .Xr rl 4 , .Xr rue 4 , .Xr sf 4 , Modified: stable/8/share/man/man4/nfe.4 ============================================================================== --- stable/8/share/man/man4/nfe.4 Tue Jan 18 10:42:13 2011 (r217532) +++ stable/8/share/man/man4/nfe.4 Tue Jan 18 11:51:48 2011 (r217533) @@ -16,7 +16,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 2, 2008 +.Dd January, 2011 .Dt NFE 4 .Os .Sh NAME @@ -174,6 +174,7 @@ before a change takes effect. .Xr netintro 4 , .Xr pci 4 , .Xr polling 4 , +.Xr rgephy 4 , .Xr sysctl 8 , .Xr ifconfig 8 .Sh HISTORY Modified: stable/8/share/man/man4/nve.4 ============================================================================== --- stable/8/share/man/man4/nve.4 Tue Jan 18 10:42:13 2011 (r217532) +++ stable/8/share/man/man4/nve.4 Tue Jan 18 11:51:48 2011 (r217533) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 8, 2007 +.Dd January 16, 2011 .Dt NVE 4 .Os .Sh NAME @@ -124,6 +124,7 @@ bandwidth show that the card is actually .Xr miibus 4 , .Xr netintro 4 , .Xr ng_ether 4 , +.Xr rgephy 4 , .Xr ifconfig 8 .Sh HISTORY The Modified: stable/8/share/man/man4/re.4 ============================================================================== --- stable/8/share/man/man4/re.4 Tue Jan 18 10:42:13 2011 (r217532) +++ stable/8/share/man/man4/re.4 Tue Jan 18 11:51:48 2011 (r217533) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 2, 2010 +.Dd January, 2011 .Dt RE 4 .Os .Sh NAME @@ -213,6 +213,7 @@ the network connection (cable). .Xr netintro 4 , .Xr ng_ether 4 , .Xr polling 4 , +.Xr rgephy 4 , .Xr vlan 4 , .Xr ifconfig 8 .Rs Copied and modified: stable/8/share/man/man4/rgephy.4 (from r217464, head/share/man/man4/rgephy.4) ============================================================================== --- head/share/man/man4/rgephy.4 Sat Jan 15 22:07:08 2011 (r217464, copy source) +++ stable/8/share/man/man4/rgephy.4 Tue Jan 18 11:51:48 2011 (r217533) @@ -69,7 +69,7 @@ the .Nm driver by default also triggers an autonegotiation advertising the selected media. -This is done in order work around hardware issues in certain scenarios. +This is done in order to work around hardware issues in certain scenarios. It is believed that this behavior does not cause harm in general but in fact can have an adverse effect in edge cases. In order to manually set the media type and options without also triggering Modified: stable/8/share/man/man4/sge.4 ============================================================================== --- stable/8/share/man/man4/sge.4 Tue Jan 18 10:42:13 2011 (r217532) +++ stable/8/share/man/man4/sge.4 Tue Jan 18 11:51:48 2011 (r217533) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 10, 2010 +.Dd January 16, 2011 .Dt SGE 4 .Os .Sh NAME @@ -105,6 +105,7 @@ SiS191 Fast/Gigabit Ethernet controller .Xr miibus 4 , .Xr netintro 4 , .Xr ng_ether 4 , +.Xr rgephy 4 , .Xr vlan 4 , .Xr ifconfig 8 .Sh HISTORY From owner-svn-src-all@FreeBSD.ORG Tue Jan 18 11:51:52 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 21956106578F; Tue, 18 Jan 2011 11:51:52 +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 084C68FC0C; Tue, 18 Jan 2011 11:51:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0IBpp0g037123; Tue, 18 Jan 2011 11:51:51 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0IBppjZ037114; Tue, 18 Jan 2011 11:51:51 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201101181151.p0IBppjZ037114@svn.freebsd.org> From: Marius Strobl Date: Tue, 18 Jan 2011 11:51:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217534 - stable/7/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jan 2011 11:51:52 -0000 Author: marius Date: Tue Jan 18 11:51:51 2011 New Revision: 217534 URL: http://svn.freebsd.org/changeset/base/217534 Log: MFC: r217464, r217468, r217475 Add a manual page for rgephy(4) and reference it as appropriate. The motivation for having rgephy.4 is to document the special media option added in r217415 (MFC'ed to stable/7 in r217503). Added: stable/7/share/man/man4/rgephy.4 - copied, changed from r217464, head/share/man/man4/rgephy.4 Modified: stable/7/share/man/man4/Makefile stable/7/share/man/man4/axe.4 stable/7/share/man/man4/miibus.4 stable/7/share/man/man4/nfe.4 stable/7/share/man/man4/nve.4 stable/7/share/man/man4/re.4 stable/7/share/man/man4/sge.4 Directory Properties: stable/7/share/man/man4/ (props changed) Modified: stable/7/share/man/man4/Makefile ============================================================================== --- stable/7/share/man/man4/Makefile Tue Jan 18 11:51:48 2011 (r217533) +++ stable/7/share/man/man4/Makefile Tue Jan 18 11:51:51 2011 (r217534) @@ -291,6 +291,7 @@ MAN= aac.4 \ random.4 \ rc.4 \ re.4 \ + rgephy.4 \ rl.4 \ rndtest.4 \ route.4 \ Modified: stable/7/share/man/man4/axe.4 ============================================================================== --- stable/7/share/man/man4/axe.4 Tue Jan 18 11:51:48 2011 (r217533) +++ stable/7/share/man/man4/axe.4 Tue Jan 18 11:51:51 2011 (r217534) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 20, 2008 +.Dd January 16, 2011 .Dt AXE 4 .Os .Sh NAME @@ -196,6 +196,7 @@ The driver failed to allocate an mbuf fo .Xr miibus 4 , .Xr netintro 4 , .Xr ng_ether 4 , +.Xr rgephy 4 , .Xr ifconfig 8 .Rs .%T "ASIX AX88172 AX88178 and AX88772 data sheets" Modified: stable/7/share/man/man4/miibus.4 ============================================================================== --- stable/7/share/man/man4/miibus.4 Tue Jan 18 11:51:48 2011 (r217533) +++ stable/7/share/man/man4/miibus.4 Tue Jan 18 11:51:51 2011 (r217534) @@ -8,7 +8,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 14, 2010 +.Dd January 15, 2011 .Dt MIIBUS 4 .Os .Sh NAME @@ -157,6 +157,7 @@ but as a result are not well behaved new .Xr nve 4 , .Xr pcn 4 , .Xr re 4 , +.Xr rgephy 4 , .Xr rl 4 , .Xr rue 4 , .Xr sf 4 , Modified: stable/7/share/man/man4/nfe.4 ============================================================================== --- stable/7/share/man/man4/nfe.4 Tue Jan 18 11:51:48 2011 (r217533) +++ stable/7/share/man/man4/nfe.4 Tue Jan 18 11:51:51 2011 (r217534) @@ -16,7 +16,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 2, 2008 +.Dd January, 2011 .Dt NFE 4 .Os .Sh NAME @@ -174,6 +174,7 @@ before a change takes effect. .Xr netintro 4 , .Xr pci 4 , .Xr polling 4 , +.Xr rgephy 4 , .Xr sysctl 8 , .Xr ifconfig 8 .Sh HISTORY Modified: stable/7/share/man/man4/nve.4 ============================================================================== --- stable/7/share/man/man4/nve.4 Tue Jan 18 11:51:48 2011 (r217533) +++ stable/7/share/man/man4/nve.4 Tue Jan 18 11:51:51 2011 (r217534) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 8, 2007 +.Dd January 16, 2011 .Dt NVE 4 .Os .Sh NAME @@ -124,6 +124,7 @@ bandwidth show that the card is actually .Xr miibus 4 , .Xr netintro 4 , .Xr ng_ether 4 , +.Xr rgephy 4 , .Xr ifconfig 8 .Sh HISTORY The Modified: stable/7/share/man/man4/re.4 ============================================================================== --- stable/7/share/man/man4/re.4 Tue Jan 18 11:51:48 2011 (r217533) +++ stable/7/share/man/man4/re.4 Tue Jan 18 11:51:51 2011 (r217534) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 2, 2010 +.Dd January, 2011 .Dt RE 4 .Os .Sh NAME @@ -213,6 +213,7 @@ the network connection (cable). .Xr netintro 4 , .Xr ng_ether 4 , .Xr polling 4 , +.Xr rgephy 4 , .Xr vlan 4 , .Xr ifconfig 8 .Rs Copied and modified: stable/7/share/man/man4/rgephy.4 (from r217464, head/share/man/man4/rgephy.4) ============================================================================== --- head/share/man/man4/rgephy.4 Sat Jan 15 22:07:08 2011 (r217464, copy source) +++ stable/7/share/man/man4/rgephy.4 Tue Jan 18 11:51:51 2011 (r217534) @@ -69,7 +69,7 @@ the .Nm driver by default also triggers an autonegotiation advertising the selected media. -This is done in order work around hardware issues in certain scenarios. +This is done in order to work around hardware issues in certain scenarios. It is believed that this behavior does not cause harm in general but in fact can have an adverse effect in edge cases. In order to manually set the media type and options without also triggering Modified: stable/7/share/man/man4/sge.4 ============================================================================== --- stable/7/share/man/man4/sge.4 Tue Jan 18 11:51:48 2011 (r217533) +++ stable/7/share/man/man4/sge.4 Tue Jan 18 11:51:51 2011 (r217534) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 10, 2010 +.Dd January 16, 2011 .Dt SGE 4 .Os .Sh NAME @@ -105,6 +105,7 @@ SiS191 Fast/Gigabit Ethernet controller .Xr miibus 4 , .Xr netintro 4 , .Xr ng_ether 4 , +.Xr rgephy 4 , .Xr vlan 4 , .Xr ifconfig 8 .Sh HISTORY From owner-svn-src-all@FreeBSD.ORG Tue Jan 18 14:34:45 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5940E106566B; Tue, 18 Jan 2011 14:34:45 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 487198FC14; Tue, 18 Jan 2011 14:34:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0IEYjSE040864; Tue, 18 Jan 2011 14:34:45 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0IEYjcU040862; Tue, 18 Jan 2011 14:34:45 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201101181434.p0IEYjcU040862@svn.freebsd.org> From: Rick Macklem Date: Tue, 18 Jan 2011 14:34: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: r217535 - head/sys/fs/nfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jan 2011 14:34:45 -0000 Author: rmacklem Date: Tue Jan 18 14:34:45 2011 New Revision: 217535 URL: http://svn.freebsd.org/changeset/base/217535 Log: Fix the experimental NFSv4 server so that it uses VOP_ACCESSX() to check for VREAD_ACL instead of VOP_ACCESS(). MFC after: 3 days Modified: head/sys/fs/nfs/nfs_commonsubs.c Modified: head/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- head/sys/fs/nfs/nfs_commonsubs.c Tue Jan 18 11:51:51 2011 (r217534) +++ head/sys/fs/nfs/nfs_commonsubs.c Tue Jan 18 14:34:45 2011 (r217535) @@ -1983,7 +1983,7 @@ nfsv4_fillattr(struct nfsrv_descript *nd NFSCLRBIT_ATTRBIT(retbitp, NFSATTRBIT_ACL); } else if (naclp != NULL) { if (vn_lock(vp, LK_SHARED) == 0) { - error = VOP_ACCESS(vp, VREAD_ACL, cred, p); + error = VOP_ACCESSX(vp, VREAD_ACL, cred, p); if (error == 0) error = VOP_GETACL(vp, ACL_TYPE_NFS4, naclp, cred, p); From owner-svn-src-all@FreeBSD.ORG Tue Jan 18 14:58:12 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C33931065673; Tue, 18 Jan 2011 14:58:12 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B24268FC19; Tue, 18 Jan 2011 14:58:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0IEwCqp041453; Tue, 18 Jan 2011 14:58:12 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0IEwCYT041451; Tue, 18 Jan 2011 14:58:12 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201101181458.p0IEwCYT041451@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 18 Jan 2011 14:58:12 +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: r217536 - head/gnu/usr.bin/dialog X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jan 2011 14:58:12 -0000 Author: nwhitehorn Date: Tue Jan 18 14:58:12 2011 New Revision: 217536 URL: http://svn.freebsd.org/changeset/base/217536 Log: Add libm to the dependencies section. Submitted by: Garrett Cooper Modified: head/gnu/usr.bin/dialog/Makefile Modified: head/gnu/usr.bin/dialog/Makefile ============================================================================== --- head/gnu/usr.bin/dialog/Makefile Tue Jan 18 14:34:45 2011 (r217535) +++ head/gnu/usr.bin/dialog/Makefile Tue Jan 18 14:58:12 2011 (r217536) @@ -3,7 +3,7 @@ DIALOG= ${.CURDIR}/../../../contrib/dialog PROG= dialog -DPADD= $(LIBDIALOG) $(LIBNCURSES) +DPADD= $(LIBDIALOG) $(LIBNCURSES) $(LIBM) LDADD= -ldialog -lncursesw -lm CFLAGS+= -I${.CURDIR} -I${DIALOG} .PATH: ${DIALOG} From owner-svn-src-all@FreeBSD.ORG Tue Jan 18 14:58:44 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA829106564A; Tue, 18 Jan 2011 14:58:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DA04B8FC0C; Tue, 18 Jan 2011 14:58:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0IEwifK041500; Tue, 18 Jan 2011 14:58:44 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0IEwiXq041498; Tue, 18 Jan 2011 14:58:44 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201101181458.p0IEwiXq041498@svn.freebsd.org> From: John Baldwin Date: Tue, 18 Jan 2011 14:58: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: r217537 - head/sys/dev/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jan 2011 14:58:45 -0000 Author: jhb Date: Tue Jan 18 14:58:44 2011 New Revision: 217537 URL: http://svn.freebsd.org/changeset/base/217537 Log: Remove bogus check. pcib_get_bus() (like other BUS_ACCESSOR() methods) doesn't "fail", it may merely return garbage if it is not a valid ivar for a given device. Our parent device must be a 'pcib' device, so we can just assume it implements pcib IVARs, and all pcib devices have a bus number. Submitted by: clang via rdivacky Modified: head/sys/dev/acpica/acpi_pci.c Modified: head/sys/dev/acpica/acpi_pci.c ============================================================================== --- head/sys/dev/acpica/acpi_pci.c Tue Jan 18 14:58:12 2011 (r217536) +++ head/sys/dev/acpica/acpi_pci.c Tue Jan 18 14:58:44 2011 (r217537) @@ -281,8 +281,6 @@ static int acpi_pci_probe(device_t dev) { - if (pcib_get_bus(dev) < 0) - return (ENXIO); if (acpi_get_handle(dev) == NULL) return (ENXIO); device_set_desc(dev, "ACPI PCI bus"); From owner-svn-src-all@FreeBSD.ORG Tue Jan 18 15:23:16 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E81CA10656A4; Tue, 18 Jan 2011 15:23:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D76B88FC26; Tue, 18 Jan 2011 15:23:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0IFNGSt042082; Tue, 18 Jan 2011 15:23:16 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0IFNGeB042079; Tue, 18 Jan 2011 15:23:16 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201101181523.p0IFNGeB042079@svn.freebsd.org> From: John Baldwin Date: Tue, 18 Jan 2011 15:23: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: r217538 - in head/sys/dev: buslogic cs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jan 2011 15:23:17 -0000 Author: jhb Date: Tue Jan 18 15:23:16 2011 New Revision: 217538 URL: http://svn.freebsd.org/changeset/base/217538 Log: Remove some always-true comparisons. Submitted by: clang via rdivacky Modified: head/sys/dev/buslogic/bt.c head/sys/dev/cs/if_cs.c Modified: head/sys/dev/buslogic/bt.c ============================================================================== --- head/sys/dev/buslogic/bt.c Tue Jan 18 14:58:44 2011 (r217537) +++ head/sys/dev/buslogic/bt.c Tue Jan 18 15:23:16 2011 (r217538) @@ -975,7 +975,7 @@ bt_find_probe_range(int ioport, int *por int bt_iop_from_bio(isa_compat_io_t bio_index) { - if (bio_index >= 0 && bio_index < BT_NUM_ISAPORTS) + if (bio_index < BT_NUM_ISAPORTS) return (bt_board_ports[bio_index]); return (-1); } Modified: head/sys/dev/cs/if_cs.c ============================================================================== --- head/sys/dev/cs/if_cs.c Tue Jan 18 14:58:44 2011 (r217537) +++ head/sys/dev/cs/if_cs.c Tue Jan 18 15:23:16 2011 (r217538) @@ -364,7 +364,7 @@ cs_cs89x0_probe(device_t dev) if (!error && !(sc->flags & CS_NO_IRQ)) { if (chip_type == CS8900) { - if (irq >= 0 || irq < 16) + if (irq < 16) irq = cs8900_irq2eeint[irq]; else irq = 255; From owner-svn-src-all@FreeBSD.ORG Tue Jan 18 15:35:13 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 90CBA1065670; Tue, 18 Jan 2011 15:35:13 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8016E8FC20; Tue, 18 Jan 2011 15:35:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0IFZD4h042362; Tue, 18 Jan 2011 15:35:13 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0IFZDTT042360; Tue, 18 Jan 2011 15:35:13 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201101181535.p0IFZDTT042360@svn.freebsd.org> From: Takahashi Yoshihiro Date: Tue, 18 Jan 2011 15:35: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: r217539 - head/sys/pc98/pc98 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jan 2011 15:35:13 -0000 Author: nyan Date: Tue Jan 18 15:35:13 2011 New Revision: 217539 URL: http://svn.freebsd.org/changeset/base/217539 Log: MFi386: revision 217515 The mem_range_softc is defined in mem.c. Modified: head/sys/pc98/pc98/machdep.c Modified: head/sys/pc98/pc98/machdep.c ============================================================================== --- head/sys/pc98/pc98/machdep.c Tue Jan 18 15:23:16 2011 (r217538) +++ head/sys/pc98/pc98/machdep.c Tue Jan 18 15:35:13 2011 (r217539) @@ -71,7 +71,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -208,8 +207,6 @@ struct pcpu __pcpu[MAXCPU]; struct mtx icu_lock; -struct mem_range_softc mem_range_softc; - static void cpu_startup(dummy) void *dummy; From owner-svn-src-all@FreeBSD.ORG Tue Jan 18 15:46:04 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 658501065695; Tue, 18 Jan 2011 15:46:04 +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 542DF8FC18; Tue, 18 Jan 2011 15:46:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0IFk42O042650; Tue, 18 Jan 2011 15:46:04 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0IFk4Fl042648; Tue, 18 Jan 2011 15:46:04 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201101181546.p0IFk4Fl042648@svn.freebsd.org> From: Hiroki Sato Date: Tue, 18 Jan 2011 15:46:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217540 - releng/8.2/release/doc/en_US.ISO8859-1/errata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jan 2011 15:46:04 -0000 Author: hrs Date: Tue Jan 18 15:46:04 2011 New Revision: 217540 URL: http://svn.freebsd.org/changeset/base/217540 Log: Clean up old items. Approved by: re (implicit) Modified: releng/8.2/release/doc/en_US.ISO8859-1/errata/article.sgml Modified: releng/8.2/release/doc/en_US.ISO8859-1/errata/article.sgml ============================================================================== --- releng/8.2/release/doc/en_US.ISO8859-1/errata/article.sgml Tue Jan 18 15:35:13 2011 (r217539) +++ releng/8.2/release/doc/en_US.ISO8859-1/errata/article.sgml Tue Jan 18 15:46:04 2011 (r217540) @@ -16,7 +16,7 @@ %release; - + ]>
@@ -166,17 +166,6 @@ Late-Breaking News and Corrections - A deadlock can occur in UFS with the QUOTA enabled due to a - lock order reversal. This problem has been fixed in r209367 - (HEAD). An Errata Notice for &release.bugfix; is - planned. - - A legacy device detection in the &man.ata.4; can fail in - some cases. Specifically, Marvell 88SX6141 controllers can - cause attach failure or panic. This problem has been fixed in - r210168 - (HEAD). An Errata Notice for &release.bugfix; is - planned. + No news.
From owner-svn-src-all@FreeBSD.ORG Tue Jan 18 16:27:40 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7639B106566C; Tue, 18 Jan 2011 16:27:40 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 651BC8FC0A; Tue, 18 Jan 2011 16:27:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0IGRe12043786; Tue, 18 Jan 2011 16:27:40 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0IGRe4d043783; Tue, 18 Jan 2011 16:27:40 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201101181627.p0IGRe4d043783@svn.freebsd.org> From: John Baldwin Date: Tue, 18 Jan 2011 16:27:40 +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: r217542 - head/sys/dev/ale X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jan 2011 16:27:40 -0000 Author: jhb Date: Tue Jan 18 16:27:40 2011 New Revision: 217542 URL: http://svn.freebsd.org/changeset/base/217542 Log: Fix some bugs in my last set of changes to ale(4): - Remove extra unlock from end of ale_start_locked(). - Expand scope of locking in interrupt handler. - Move ether_ifdetach() earlier and retire now-unneeded DETACH flag. Tested by: Aryeh Friedman Reviewed by: yongari (earlier version) Modified: head/sys/dev/ale/if_ale.c head/sys/dev/ale/if_alevar.h Modified: head/sys/dev/ale/if_ale.c ============================================================================== --- head/sys/dev/ale/if_ale.c Tue Jan 18 15:49:01 2011 (r217541) +++ head/sys/dev/ale/if_ale.c Tue Jan 18 16:27:40 2011 (r217542) @@ -675,14 +675,13 @@ ale_detach(device_t dev) ifp = sc->ale_ifp; if (device_is_attached(dev)) { + ether_ifdetach(ifp); ALE_LOCK(sc); - sc->ale_flags |= ALE_FLAG_DETACH; ale_stop(sc); ALE_UNLOCK(sc); callout_drain(&sc->ale_tick_ch); taskqueue_drain(sc->ale_tq, &sc->ale_int_task); taskqueue_drain(taskqueue_swi, &sc->ale_link_task); - ether_ifdetach(ifp); } if (sc->ale_tq != NULL) { @@ -1907,8 +1906,6 @@ ale_start_locked(struct ifnet *ifp) /* Set a timeout in case the chip goes out to lunch. */ sc->ale_watchdog_timer = ALE_TX_TIMEOUT; } - - ALE_UNLOCK(sc); } static void @@ -1972,8 +1969,7 @@ ale_ioctl(struct ifnet *ifp, u_long cmd, & (IFF_PROMISC | IFF_ALLMULTI)) != 0) ale_rxfilter(sc); } else { - if ((sc->ale_flags & ALE_FLAG_DETACH) == 0) - ale_init_locked(sc); + ale_init_locked(sc); } } else { if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) @@ -2284,6 +2280,7 @@ ale_int_task(void *arg, int pending) sc = (struct ale_softc *)arg; status = CSR_READ_4(sc, ALE_INTR_STATUS); + ALE_LOCK(sc); if (sc->ale_morework != 0) status |= INTR_RX_PKT; if ((status & ALE_INTRS) == 0) @@ -2299,7 +2296,6 @@ ale_int_task(void *arg, int pending) if (more == EAGAIN) sc->ale_morework = 1; else if (more == EIO) { - ALE_LOCK(sc); sc->ale_stats.reset_brk_seq++; ifp->if_drv_flags &= ~IFF_DRV_RUNNING; ale_init_locked(sc); @@ -2314,7 +2310,6 @@ ale_int_task(void *arg, int pending) if ((status & INTR_DMA_WR_TO_RST) != 0) device_printf(sc->ale_dev, "DMA write error! -- resetting\n"); - ALE_LOCK(sc); ifp->if_drv_flags &= ~IFF_DRV_RUNNING; ale_init_locked(sc); ALE_UNLOCK(sc); @@ -2326,11 +2321,14 @@ ale_int_task(void *arg, int pending) if (more == EAGAIN || (CSR_READ_4(sc, ALE_INTR_STATUS) & ALE_INTRS) != 0) { + ALE_UNLOCK(sc); taskqueue_enqueue(sc->ale_tq, &sc->ale_int_task); return; } done: + ALE_UNLOCK(sc); + /* Re-enable interrupts. */ CSR_WRITE_4(sc, ALE_INTR_STATUS, 0x7FFFFFFF); } @@ -2587,7 +2585,9 @@ ale_rxeof(struct ale_softc *sc, int coun } /* Pass it to upper layer. */ + ALE_UNLOCK(sc); (*ifp->if_input)(ifp, m); + ALE_LOCK(sc); ale_rx_update_page(sc, &rx_page, length, &prod); } Modified: head/sys/dev/ale/if_alevar.h ============================================================================== --- head/sys/dev/ale/if_alevar.h Tue Jan 18 15:49:01 2011 (r217541) +++ head/sys/dev/ale/if_alevar.h Tue Jan 18 16:27:40 2011 (r217542) @@ -206,7 +206,6 @@ struct ale_softc { #define ALE_FLAG_RXCSUM_BUG 0x0080 #define ALE_FLAG_TXCSUM_BUG 0x0100 #define ALE_FLAG_TXCMB_BUG 0x0200 -#define ALE_FLAG_DETACH 0x4000 #define ALE_FLAG_LINK 0x8000 struct callout ale_tick_ch; From owner-svn-src-all@FreeBSD.ORG Tue Jan 18 16:43:02 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 057D4106566B; Tue, 18 Jan 2011 16:43:02 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CE3648FC16; Tue, 18 Jan 2011 16:43:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0IGh1WG044185; Tue, 18 Jan 2011 16:43:01 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0IGh19F044182; Tue, 18 Jan 2011 16:43:01 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201101181643.p0IGh19F044182@svn.freebsd.org> From: John Baldwin Date: Tue, 18 Jan 2011 16:43: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: r217543 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jan 2011 16:43:02 -0000 Author: jhb Date: Tue Jan 18 16:43:01 2011 New Revision: 217543 URL: http://svn.freebsd.org/changeset/base/217543 Log: - Remove some always-true checks (checking for unsigned < 0). - Only check largs->num against max_ldt_segment on amd64 for I386_SET_LDT when descriptors are provided. Specifically, allow the 'start == 0' and 'num == 0' special case used to free all LDT entries that previously failed with EINVAL. Submitted by: clang via rdivacky (some of 1) Reviewed by: kib Modified: head/sys/amd64/amd64/sys_machdep.c head/sys/i386/i386/sys_machdep.c Modified: head/sys/amd64/amd64/sys_machdep.c ============================================================================== --- head/sys/amd64/amd64/sys_machdep.c Tue Jan 18 16:27:40 2011 (r217542) +++ head/sys/amd64/amd64/sys_machdep.c Tue Jan 18 16:43:01 2011 (r217543) @@ -95,14 +95,14 @@ sysarch_ldt(struct thread *td, struct sy largs = &la; } else largs = (struct i386_ldt_args *)uap->parms; - if (largs->num > max_ldt_segment || largs->num <= 0) - return (EINVAL); switch (uap->op) { case I386_GET_LDT: error = amd64_get_ldt(td, largs); break; case I386_SET_LDT: + if (largs->descs != NULL && largs->num > max_ldt_segment) + return (EINVAL); set_pcb_flags(td->td_pcb, PCB_FULL_IRET); if (largs->descs != NULL) { lp = (struct user_segment_descriptor *) @@ -539,7 +539,7 @@ amd64_set_ldt(td, uap, descs) /* Free descriptors */ if (uap->start == 0 && uap->num == 0) uap->num = max_ldt_segment; - if (uap->num <= 0) + if (uap->num == 0) return (EINVAL); if ((pldt = mdp->md_ldt) == NULL || uap->start >= max_ldt_segment) @@ -559,7 +559,7 @@ amd64_set_ldt(td, uap, descs) /* verify range of descriptors to modify */ largest_ld = uap->start + uap->num; if (uap->start >= max_ldt_segment || - uap->num < 0 || largest_ld > max_ldt_segment) + largest_ld > max_ldt_segment) return (EINVAL); } Modified: head/sys/i386/i386/sys_machdep.c ============================================================================== --- head/sys/i386/i386/sys_machdep.c Tue Jan 18 16:27:40 2011 (r217542) +++ head/sys/i386/i386/sys_machdep.c Tue Jan 18 16:43:01 2011 (r217543) @@ -623,7 +623,7 @@ i386_set_ldt(td, uap, descs) uap->start = NLDT; uap->num = MAX_LD - NLDT; } - if (uap->num <= 0) + if (uap->num == 0) return (EINVAL); mtx_lock_spin(&dt_lock); if ((pldt = mdp->md_ldt) == NULL || @@ -644,8 +644,7 @@ i386_set_ldt(td, uap, descs) if (!(uap->start == LDT_AUTO_ALLOC && uap->num == 1)) { /* verify range of descriptors to modify */ largest_ld = uap->start + uap->num; - if (uap->start >= MAX_LD || - uap->num < 0 || largest_ld > MAX_LD) { + if (uap->start >= MAX_LD || largest_ld > MAX_LD) { return (EINVAL); } } From owner-svn-src-all@FreeBSD.ORG Tue Jan 18 16:49:52 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C2C2106564A; Tue, 18 Jan 2011 16:49:52 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EECEB8FC16; Tue, 18 Jan 2011 16:49:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0IGnpgb044367; Tue, 18 Jan 2011 16:49:51 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0IGnpor044365; Tue, 18 Jan 2011 16:49:51 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201101181649.p0IGnpor044365@svn.freebsd.org> From: Jaakko Heinonen Date: Tue, 18 Jan 2011 16:49:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217544 - stable/8/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jan 2011 16:49:52 -0000 Author: jh Date: Tue Jan 18 16:49:51 2011 New Revision: 217544 URL: http://svn.freebsd.org/changeset/base/217544 Log: MFC r205682: Support only LOOKUP operation for "/" in relookup() because lookup() can't succeed for CREATE, DELETE and RENAME. Modified: stable/8/sys/kern/vfs_lookup.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/kern/vfs_lookup.c ============================================================================== --- stable/8/sys/kern/vfs_lookup.c Tue Jan 18 16:43:01 2011 (r217543) +++ stable/8/sys/kern/vfs_lookup.c Tue Jan 18 16:49:51 2011 (r217544) @@ -948,19 +948,17 @@ relookup(struct vnode *dvp, struct vnode #endif /* - * Check for degenerate name (e.g. / or "") - * which is a way of talking about a directory, - * e.g. like "/." or ".". + * Check for "" which represents the root directory after slash + * removal. */ if (cnp->cn_nameptr[0] == '\0') { - if (cnp->cn_nameiop != LOOKUP || wantparent) { - error = EISDIR; - goto bad; - } - if (dp->v_type != VDIR) { - error = ENOTDIR; - goto bad; - } + /* + * Support only LOOKUP for "/" because lookup() + * can't succeed for CREATE, DELETE and RENAME. + */ + KASSERT(cnp->cn_nameiop == LOOKUP, ("nameiop must be LOOKUP")); + KASSERT(dp->v_type == VDIR, ("dp is not a directory")); + if (!(cnp->cn_flags & LOCKLEAF)) VOP_UNLOCK(dp, 0); *vpp = dp; From owner-svn-src-all@FreeBSD.ORG Tue Jan 18 17:00:47 2011 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E8E8A106566B; Tue, 18 Jan 2011 17:00:47 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail09.syd.optusnet.com.au (mail09.syd.optusnet.com.au [211.29.132.190]) by mx1.freebsd.org (Postfix) with ESMTP id 859058FC1A; Tue, 18 Jan 2011 17:00:47 +0000 (UTC) Received: from c122-106-165-206.carlnfd1.nsw.optusnet.com.au (c122-106-165-206.carlnfd1.nsw.optusnet.com.au [122.106.165.206]) by mail09.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p0IH0ibu023684 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 19 Jan 2011 04:00:45 +1100 Date: Wed, 19 Jan 2011 04:00:44 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: John Baldwin In-Reply-To: <201101181523.p0IFNGeB042079@svn.freebsd.org> Message-ID: <20110119035030.W2099@besplex.bde.org> References: <201101181523.p0IFNGeB042079@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r217538 - in head/sys/dev: buslogic cs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jan 2011 17:00:48 -0000 On Tue, 18 Jan 2011, John Baldwin wrote: > Log: > Remove some always-true comparisons. > > Submitted by: clang via rdivacky > > Modified: head/sys/dev/buslogic/bt.c > ============================================================================== > --- head/sys/dev/buslogic/bt.c Tue Jan 18 14:58:44 2011 (r217537) > +++ head/sys/dev/buslogic/bt.c Tue Jan 18 15:23:16 2011 (r217538) > @@ -975,7 +975,7 @@ bt_find_probe_range(int ioport, int *por > int > bt_iop_from_bio(isa_compat_io_t bio_index) > { > - if (bio_index >= 0 && bio_index < BT_NUM_ISAPORTS) > + if (bio_index < BT_NUM_ISAPORTS) > return (bt_board_ports[bio_index]); > return (-1); > } So, what guarantees that isa_compat_io_t is unsigned and will remain so? Indexes should be ints, unless you want a sign morass. > Modified: head/sys/dev/cs/if_cs.c > ============================================================================== > --- head/sys/dev/cs/if_cs.c Tue Jan 18 14:58:44 2011 (r217537) > +++ head/sys/dev/cs/if_cs.c Tue Jan 18 15:23:16 2011 (r217538) > @@ -364,7 +364,7 @@ cs_cs89x0_probe(device_t dev) > > if (!error && !(sc->flags & CS_NO_IRQ)) { > if (chip_type == CS8900) { > - if (irq >= 0 || irq < 16) > + if (irq < 16) > irq = cs8900_irq2eeint[irq]; > else > irq = 255; > Here `irq' is declared locally as u_long, so it can easily seen to be unsigned. u_long is bogus, but is unfortunately required by bus_get_resource()' API to fetch the initial value of `irq'. The irq is only checked to be in range and even bus_get_resource()'s return value are not checked until long after the call. Bruce From owner-svn-src-all@FreeBSD.ORG Tue Jan 18 17:16:13 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AC41D10656C7; Tue, 18 Jan 2011 17:16:13 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 7EF0D8FC22; Tue, 18 Jan 2011 17:16:13 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 3A93946B0C; Tue, 18 Jan 2011 12:16:13 -0500 (EST) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 4E6218A009; Tue, 18 Jan 2011 12:16:03 -0500 (EST) From: John Baldwin To: Bruce Evans Date: Tue, 18 Jan 2011 12:15:46 -0500 User-Agent: KMail/1.13.5 (FreeBSD/7.4-CBSD-20110107; KDE/4.4.5; amd64; ; ) References: <201101181523.p0IFNGeB042079@svn.freebsd.org> <20110119035030.W2099@besplex.bde.org> In-Reply-To: <20110119035030.W2099@besplex.bde.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201101181215.46266.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Tue, 18 Jan 2011 12:16:03 -0500 (EST) X-Virus-Scanned: clamav-milter 0.96.3 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.9 required=4.2 tests=BAYES_00 autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Roman Divacky Subject: Re: svn commit: r217538 - in head/sys/dev: buslogic cs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jan 2011 17:16:13 -0000 On Tuesday, January 18, 2011 12:00:44 pm Bruce Evans wrote: > On Tue, 18 Jan 2011, John Baldwin wrote: > > > Log: > > Remove some always-true comparisons. > > > > Submitted by: clang via rdivacky > > > > Modified: head/sys/dev/buslogic/bt.c > > ============================================================================== > > --- head/sys/dev/buslogic/bt.c Tue Jan 18 14:58:44 2011 (r217537) > > +++ head/sys/dev/buslogic/bt.c Tue Jan 18 15:23:16 2011 (r217538) > > @@ -975,7 +975,7 @@ bt_find_probe_range(int ioport, int *por > > int > > bt_iop_from_bio(isa_compat_io_t bio_index) > > { > > - if (bio_index >= 0 && bio_index < BT_NUM_ISAPORTS) > > + if (bio_index < BT_NUM_ISAPORTS) > > return (bt_board_ports[bio_index]); > > return (-1); > > } > > So, what guarantees that isa_compat_io_t is unsigned and will remain so? > Indexes should be ints, unless you want a sign morass. Gah, I trusted the clang warning too much. enum's are ints in C yes? So clang has a bug if it thinks an enum value cannot be negative. In practice all the callers of this routine do not pass in negative values, but the compiler shouldn't warn about enum's bogusly. Is clang assuming that only defined values for an enum are ever passed in? If so we probably don't want to turn that checking on for the kernel as we violate that in lots of places. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Tue Jan 18 17:50:15 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 502451065694; Tue, 18 Jan 2011 17:50:15 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3E24E8FC1B; Tue, 18 Jan 2011 17:50:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0IHoFDC046114; Tue, 18 Jan 2011 17:50:15 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0IHoFZd046112; Tue, 18 Jan 2011 17:50:15 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201101181750.p0IHoFZd046112@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 18 Jan 2011 17:50:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217548 - head/sys/dev/sis X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jan 2011 17:50:15 -0000 Author: yongari Date: Tue Jan 18 17:50:14 2011 New Revision: 217548 URL: http://svn.freebsd.org/changeset/base/217548 Log: Rework RX filter programming by providing separate handler for DP8381[56] and SiS 900/7016 controllers. After r212119, sis(4) no longer reinitializes controller if ALLMULTI/PROMISC was changed. However, RX filter handling code assumed some bits of the RX filter is programmed by driver initialization. This caused ALLMULTI/PROMISC configuration is ignored under certain conditions. Fix that issue by reprogramming all bits of RX filter register. While I'm here follow recommended RX filter programming steps recommended by National DP8381[56] data sheet(RX filter should be is disabled before programming). Reported by: Paul Schenkeveld < freebsd () psconsult dot nl > Tested by: Paul Schenkeveld < freebsd () psconsult dot nl > MFC after: 3 days Modified: head/sys/dev/sis/if_sis.c Modified: head/sys/dev/sis/if_sis.c ============================================================================== --- head/sys/dev/sis/if_sis.c Tue Jan 18 17:48:21 2011 (r217547) +++ head/sys/dev/sis/if_sis.c Tue Jan 18 17:50:14 2011 (r217548) @@ -149,6 +149,9 @@ static int sis_ioctl(struct ifnet *, u_l static int sis_newbuf(struct sis_softc *, struct sis_rxdesc *); static int sis_resume(device_t); static int sis_rxeof(struct sis_softc *); +static void sis_rxfilter(struct sis_softc *); +static void sis_rxfilter_ns(struct sis_softc *); +static void sis_rxfilter_sis(struct sis_softc *); static void sis_start(struct ifnet *); static void sis_startl(struct ifnet *); static void sis_stop(struct sis_softc *); @@ -806,80 +809,117 @@ sis_mchash(struct sis_softc *sc, const u } static void -sis_setmulti_ns(struct sis_softc *sc) +sis_rxfilter(struct sis_softc *sc) +{ + + SIS_LOCK_ASSERT(sc); + + if (sc->sis_type == SIS_TYPE_83815) + sis_rxfilter_ns(sc); + else + sis_rxfilter_sis(sc); +} + +static void +sis_rxfilter_ns(struct sis_softc *sc) { struct ifnet *ifp; struct ifmultiaddr *ifma; - uint32_t h = 0, i, filtsave; + uint32_t h, i, filter; int bit, index; ifp = sc->sis_ifp; - - if (ifp->if_flags & IFF_ALLMULTI || ifp->if_flags & IFF_PROMISC) { - SIS_CLRBIT(sc, SIS_RXFILT_CTL, NS_RXFILTCTL_MCHASH); - SIS_SETBIT(sc, SIS_RXFILT_CTL, SIS_RXFILTCTL_ALLMULTI); - return; + filter = CSR_READ_4(sc, SIS_RXFILT_CTL); + if (filter & SIS_RXFILTCTL_ENABLE) { + /* + * Filter should be disabled to program other bits. + */ + CSR_WRITE_4(sc, SIS_RXFILT_CTL, filter & ~SIS_RXFILTCTL_ENABLE); + CSR_READ_4(sc, SIS_RXFILT_CTL); } + filter &= ~(NS_RXFILTCTL_ARP | NS_RXFILTCTL_PERFECT | + NS_RXFILTCTL_MCHASH | SIS_RXFILTCTL_ALLPHYS | SIS_RXFILTCTL_BROAD | + SIS_RXFILTCTL_ALLMULTI); + if (ifp->if_flags & IFF_BROADCAST) + filter |= SIS_RXFILTCTL_BROAD; /* - * We have to explicitly enable the multicast hash table - * on the NatSemi chip if we want to use it, which we do. + * For the NatSemi chip, we have to explicitly enable the + * reception of ARP frames, as well as turn on the 'perfect + * match' filter where we store the station address, otherwise + * we won't receive unicasts meant for this host. */ - SIS_SETBIT(sc, SIS_RXFILT_CTL, NS_RXFILTCTL_MCHASH); - SIS_CLRBIT(sc, SIS_RXFILT_CTL, SIS_RXFILTCTL_ALLMULTI); + filter |= NS_RXFILTCTL_ARP | NS_RXFILTCTL_PERFECT; - filtsave = CSR_READ_4(sc, SIS_RXFILT_CTL); + if (ifp->if_flags & (IFF_ALLMULTI | IFF_PROMISC)) { + filter |= SIS_RXFILTCTL_ALLMULTI; + if (ifp->if_flags & IFF_PROMISC) + filter |= SIS_RXFILTCTL_ALLPHYS; + } else { + /* + * We have to explicitly enable the multicast hash table + * on the NatSemi chip if we want to use it, which we do. + */ + filter |= NS_RXFILTCTL_MCHASH; - /* first, zot all the existing hash bits */ - for (i = 0; i < 32; i++) { - CSR_WRITE_4(sc, SIS_RXFILT_CTL, NS_FILTADDR_FMEM_LO + (i*2)); - CSR_WRITE_4(sc, SIS_RXFILT_DATA, 0); - } + /* first, zot all the existing hash bits */ + for (i = 0; i < 32; i++) { + CSR_WRITE_4(sc, SIS_RXFILT_CTL, NS_FILTADDR_FMEM_LO + + (i * 2)); + CSR_WRITE_4(sc, SIS_RXFILT_DATA, 0); + } - if_maddr_rlock(ifp); - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { - if (ifma->ifma_addr->sa_family != AF_LINK) - continue; - h = sis_mchash(sc, - LLADDR((struct sockaddr_dl *)ifma->ifma_addr)); - index = h >> 3; - bit = h & 0x1F; - CSR_WRITE_4(sc, SIS_RXFILT_CTL, NS_FILTADDR_FMEM_LO + index); - if (bit > 0xF) - bit -= 0x10; - SIS_SETBIT(sc, SIS_RXFILT_DATA, (1 << bit)); + if_maddr_rlock(ifp); + TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + if (ifma->ifma_addr->sa_family != AF_LINK) + continue; + h = sis_mchash(sc, + LLADDR((struct sockaddr_dl *)ifma->ifma_addr)); + index = h >> 3; + bit = h & 0x1F; + CSR_WRITE_4(sc, SIS_RXFILT_CTL, NS_FILTADDR_FMEM_LO + + index); + if (bit > 0xF) + bit -= 0x10; + SIS_SETBIT(sc, SIS_RXFILT_DATA, (1 << bit)); + } + if_maddr_runlock(ifp); } - if_maddr_runlock(ifp); - CSR_WRITE_4(sc, SIS_RXFILT_CTL, filtsave); + CSR_WRITE_4(sc, SIS_RXFILT_CTL, filter); + CSR_READ_4(sc, SIS_RXFILT_CTL); } static void -sis_setmulti_sis(struct sis_softc *sc) +sis_rxfilter_sis(struct sis_softc *sc) { struct ifnet *ifp; struct ifmultiaddr *ifma; - uint32_t h, i, n, ctl; + uint32_t filter, h, i, n; uint16_t hashes[16]; ifp = sc->sis_ifp; /* hash table size */ - if (sc->sis_rev >= SIS_REV_635 || - sc->sis_rev == SIS_REV_900B) + if (sc->sis_rev >= SIS_REV_635 || sc->sis_rev == SIS_REV_900B) n = 16; else n = 8; - ctl = CSR_READ_4(sc, SIS_RXFILT_CTL) & SIS_RXFILTCTL_ENABLE; - + filter = CSR_READ_4(sc, SIS_RXFILT_CTL); + if (filter & SIS_RXFILTCTL_ENABLE) { + CSR_WRITE_4(sc, SIS_RXFILT_CTL, filter & ~SIS_RXFILT_CTL); + CSR_READ_4(sc, SIS_RXFILT_CTL); + } + filter &= ~(SIS_RXFILTCTL_ALLPHYS | SIS_RXFILTCTL_BROAD | + SIS_RXFILTCTL_ALLMULTI); if (ifp->if_flags & IFF_BROADCAST) - ctl |= SIS_RXFILTCTL_BROAD; + filter |= SIS_RXFILTCTL_BROAD; - if (ifp->if_flags & IFF_ALLMULTI || ifp->if_flags & IFF_PROMISC) { - ctl |= SIS_RXFILTCTL_ALLMULTI; + if (ifp->if_flags & (IFF_ALLMULTI | IFF_PROMISC)) { + filter |= SIS_RXFILTCTL_ALLMULTI; if (ifp->if_flags & IFF_PROMISC) - ctl |= SIS_RXFILTCTL_BROAD|SIS_RXFILTCTL_ALLPHYS; + filter |= SIS_RXFILTCTL_ALLPHYS; for (i = 0; i < n; i++) hashes[i] = ~0; } else { @@ -897,7 +937,7 @@ sis_setmulti_sis(struct sis_softc *sc) } if_maddr_runlock(ifp); if (i > n) { - ctl |= SIS_RXFILTCTL_ALLMULTI; + filter |= SIS_RXFILTCTL_ALLMULTI; for (i = 0; i < n; i++) hashes[i] = ~0; } @@ -908,7 +948,8 @@ sis_setmulti_sis(struct sis_softc *sc) CSR_WRITE_4(sc, SIS_RXFILT_DATA, hashes[i]); } - CSR_WRITE_4(sc, SIS_RXFILT_CTL, ctl); + CSR_WRITE_4(sc, SIS_RXFILT_CTL, filter); + CSR_READ_4(sc, SIS_RXFILT_CTL); } static void @@ -2104,41 +2145,7 @@ sis_initl(struct sis_softc *sc) CSR_WRITE_4(sc, NS_PHY_PAGE, 0); } - /* - * For the NatSemi chip, we have to explicitly enable the - * reception of ARP frames, as well as turn on the 'perfect - * match' filter where we store the station address, otherwise - * we won't receive unicasts meant for this host. - */ - if (sc->sis_type == SIS_TYPE_83815) { - SIS_SETBIT(sc, SIS_RXFILT_CTL, NS_RXFILTCTL_ARP); - SIS_SETBIT(sc, SIS_RXFILT_CTL, NS_RXFILTCTL_PERFECT); - } - - /* If we want promiscuous mode, set the allframes bit. */ - if (ifp->if_flags & IFF_PROMISC) { - SIS_SETBIT(sc, SIS_RXFILT_CTL, SIS_RXFILTCTL_ALLPHYS); - } else { - SIS_CLRBIT(sc, SIS_RXFILT_CTL, SIS_RXFILTCTL_ALLPHYS); - } - - /* - * Set the capture broadcast bit to capture broadcast frames. - */ - if (ifp->if_flags & IFF_BROADCAST) { - SIS_SETBIT(sc, SIS_RXFILT_CTL, SIS_RXFILTCTL_BROAD); - } else { - SIS_CLRBIT(sc, SIS_RXFILT_CTL, SIS_RXFILTCTL_BROAD); - } - - /* - * Load the multicast filter. - */ - if (sc->sis_type == SIS_TYPE_83815) - sis_setmulti_ns(sc); - else - sis_setmulti_sis(sc); - + sis_rxfilter(sc); /* Turn the receive filter on */ SIS_SETBIT(sc, SIS_RXFILT_CTL, SIS_RXFILTCTL_ENABLE); @@ -2252,27 +2259,19 @@ sis_ioctl(struct ifnet *ifp, u_long comm if (ifp->if_flags & IFF_UP) { if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0 && ((ifp->if_flags ^ sc->sis_if_flags) & - (IFF_PROMISC | IFF_ALLMULTI)) != 0) { - if (sc->sis_type == SIS_TYPE_83815) - sis_setmulti_ns(sc); - else - sis_setmulti_sis(sc); - } else + (IFF_PROMISC | IFF_ALLMULTI)) != 0) + sis_rxfilter(sc); + else sis_initl(sc); - } else if (ifp->if_drv_flags & IFF_DRV_RUNNING) { + } else if (ifp->if_drv_flags & IFF_DRV_RUNNING) sis_stop(sc); - } sc->sis_if_flags = ifp->if_flags; SIS_UNLOCK(sc); - error = 0; break; case SIOCADDMULTI: case SIOCDELMULTI: SIS_LOCK(sc); - if (sc->sis_type == SIS_TYPE_83815) - sis_setmulti_ns(sc); - else - sis_setmulti_sis(sc); + sis_rxfilter(sc); SIS_UNLOCK(sc); break; case SIOCGIFMEDIA: From owner-svn-src-all@FreeBSD.ORG Tue Jan 18 17:54:38 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 71D28106566C; Tue, 18 Jan 2011 17:54:38 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail04.syd.optusnet.com.au (mail04.syd.optusnet.com.au [211.29.132.185]) by mx1.freebsd.org (Postfix) with ESMTP id 0B5A18FC0C; Tue, 18 Jan 2011 17:54:37 +0000 (UTC) Received: from c122-106-165-206.carlnfd1.nsw.optusnet.com.au (c122-106-165-206.carlnfd1.nsw.optusnet.com.au [122.106.165.206]) by mail04.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p0IHsYPv010284 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 19 Jan 2011 04:54:35 +1100 Date: Wed, 19 Jan 2011 04:54:34 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: John Baldwin In-Reply-To: <201101181215.46266.jhb@freebsd.org> Message-ID: <20110119044805.Y2631@besplex.bde.org> References: <201101181523.p0IFNGeB042079@svn.freebsd.org> <20110119035030.W2099@besplex.bde.org> <201101181215.46266.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Roman Divacky , Bruce Evans Subject: Re: svn commit: r217538 - in head/sys/dev: buslogic cs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jan 2011 17:54:38 -0000 On Tue, 18 Jan 2011, John Baldwin wrote: > On Tuesday, January 18, 2011 12:00:44 pm Bruce Evans wrote: >> On Tue, 18 Jan 2011, John Baldwin wrote: >> >>> Log: >>> Remove some always-true comparisons. >>> >>> Submitted by: clang via rdivacky >>> >>> Modified: head/sys/dev/buslogic/bt.c >>> > ============================================================================== >>> --- head/sys/dev/buslogic/bt.c Tue Jan 18 14:58:44 2011 (r217537) >>> +++ head/sys/dev/buslogic/bt.c Tue Jan 18 15:23:16 2011 (r217538) >>> @@ -975,7 +975,7 @@ bt_find_probe_range(int ioport, int *por >>> int >>> bt_iop_from_bio(isa_compat_io_t bio_index) >>> { >>> - if (bio_index >= 0 && bio_index < BT_NUM_ISAPORTS) >>> + if (bio_index < BT_NUM_ISAPORTS) >>> return (bt_board_ports[bio_index]); >>> return (-1); >>> } >> >> So, what guarantees that isa_compat_io_t is unsigned and will remain so? >> Indexes should be ints, unless you want a sign morass. > > Gah, I trusted the clang warning too much. enum's are ints in C yes? So > clang has a bug if it thinks an enum value cannot be negative. In practice > all the callers of this routine do not pass in negative values, but the > compiler shouldn't warn about enum's bogusly. I didn't know it was a problem already when I asked. I thought isa_compat_io_t was global, but it is private to bt. > Is clang assuming that only defined values for an enum are ever passed in? If > so we probably don't want to turn that checking on for the kernel as we > violate that in lots of places. enum values are int, but an enum type may be implemented as unsigned if that makes no difference for conforming code. I think conforming code can only used declared enum values. Thus if all declared values are >= 0, as is the case here, then the enum type may be implemented as unsigned. Apparently, this happens for clang here, and it checks what it would do itself. Other compilers might do it differently. Bruce From owner-svn-src-all@FreeBSD.ORG Tue Jan 18 17:59:40 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 1DD3D1065672; Tue, 18 Jan 2011 17:59:40 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: src-committers@FreeBSD.org Date: Tue, 18 Jan 2011 12:59:05 -0500 User-Agent: KMail/1.6.2 References: <201101181535.p0IFZDTT042360@svn.freebsd.org> In-Reply-To: <201101181535.p0IFZDTT042360@svn.freebsd.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201101181259.31101.jkim@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Takahashi Yoshihiro Subject: Re: svn commit: r217539 - head/sys/pc98/pc98 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jan 2011 17:59:40 -0000 On Tuesday 18 January 2011 10:35 am, Takahashi Yoshihiro wrote: > Author: nyan > Date: Tue Jan 18 15:35:13 2011 > New Revision: 217539 > URL: http://svn.freebsd.org/changeset/base/217539 > > Log: > MFi386: revision 217515 > > The mem_range_softc is defined in mem.c. Sorry, I forgot pc98. :-( Thanks for the fix! Jung-uk Kim From owner-svn-src-all@FreeBSD.ORG Tue Jan 18 18:42:41 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 31CC7106564A; Tue, 18 Jan 2011 18:42:41 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (lev.vlakno.cz [77.93.215.190]) by mx1.freebsd.org (Postfix) with ESMTP id B1CD68FC13; Tue, 18 Jan 2011 18:42:40 +0000 (UTC) Received: from lev.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id D729F9CB0F4; Tue, 18 Jan 2011 19:26:56 +0100 (CET) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by lev.vlakno.cz (lev.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pIRWgWUTMe6Q; Tue, 18 Jan 2011 19:26:56 +0100 (CET) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 2CA189CB158; Tue, 18 Jan 2011 19:26:56 +0100 (CET) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.14.4/8.14.4/Submit) id p0IIQtXO079930; Tue, 18 Jan 2011 19:26:55 +0100 (CET) (envelope-from rdivacky) Date: Tue, 18 Jan 2011 19:26:55 +0100 From: Roman Divacky To: Bruce Evans Message-ID: <20110118182655.GA77102@freebsd.org> References: <201101181523.p0IFNGeB042079@svn.freebsd.org> <20110119035030.W2099@besplex.bde.org> <201101181215.46266.jhb@freebsd.org> <20110119044805.Y2631@besplex.bde.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110119044805.Y2631@besplex.bde.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin Subject: Re: svn commit: r217538 - in head/sys/dev: buslogic cs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jan 2011 18:42:41 -0000 On Wed, Jan 19, 2011 at 04:54:34AM +1100, Bruce Evans wrote: > On Tue, 18 Jan 2011, John Baldwin wrote: > > >On Tuesday, January 18, 2011 12:00:44 pm Bruce Evans wrote: > >>On Tue, 18 Jan 2011, John Baldwin wrote: > >> > >>>Log: > >>> Remove some always-true comparisons. > >>> > >>> Submitted by: clang via rdivacky > >>> > >>>Modified: head/sys/dev/buslogic/bt.c > >>> > >============================================================================== > >>>--- head/sys/dev/buslogic/bt.c Tue Jan 18 14:58:44 2011 (r217537) > >>>+++ head/sys/dev/buslogic/bt.c Tue Jan 18 15:23:16 2011 (r217538) > >>>@@ -975,7 +975,7 @@ bt_find_probe_range(int ioport, int *por > >>>int > >>>bt_iop_from_bio(isa_compat_io_t bio_index) > >>>{ > >>>- if (bio_index >= 0 && bio_index < BT_NUM_ISAPORTS) > >>>+ if (bio_index < BT_NUM_ISAPORTS) > >>> return (bt_board_ports[bio_index]); > >>> return (-1); > >>>} > >> > >>So, what guarantees that isa_compat_io_t is unsigned and will remain so? > >>Indexes should be ints, unless you want a sign morass. > > > >Gah, I trusted the clang warning too much. enum's are ints in C yes? So > >clang has a bug if it thinks an enum value cannot be negative. In practice > >all the callers of this routine do not pass in negative values, but the > >compiler shouldn't warn about enum's bogusly. > > I didn't know it was a problem already when I asked. I thought > isa_compat_io_t was global, but it is private to bt. > > >Is clang assuming that only defined values for an enum are ever passed in? > >If > >so we probably don't want to turn that checking on for the kernel as we > >violate that in lots of places. > > enum values are int, but an enum type may be implemented as unsigned if > that makes no difference for conforming code. I think conforming code can > only used declared enum values. Thus if all declared values are >= 0, as > is the case here, then the enum type may be implemented as unsigned. > Apparently, this happens for clang here, and it checks what it would do > itself. Other compilers might do it differently. No, it's a real bug - C99 says that: If an int can represent all values of the original type, the value is converted to an int; otherwise, it is converted to an unsigned int. " (C99 6.3.1.1p2). Thus in this case the enum must be (signed) int. The problem is that this bug is in gcc too, compare: witten ~# cat enum1.c #include static enum { foo, bar = 1U } z; int main (void) { int r = 0; if (z - 1 < 0) r++; printf("r = %i\n", r); } witten ~# gcc enum1.c && ./a.out r = 0 witten ~# g++ enum1.c && ./a.out r = 1 So clang is just emulating gcc bug which results in this unfortunate bogus warning. From owner-svn-src-all@FreeBSD.ORG Tue Jan 18 19:13:04 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 187B61065670; Tue, 18 Jan 2011 19:13:04 +0000 (UTC) (envelope-from fanf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E192E8FC08; Tue, 18 Jan 2011 19:13:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0IJD3a9048620; Tue, 18 Jan 2011 19:13:03 GMT (envelope-from fanf@svn.freebsd.org) Received: (from fanf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0IJD3dK048618; Tue, 18 Jan 2011 19:13:03 GMT (envelope-from fanf@svn.freebsd.org) Message-Id: <201101181913.p0IJD3dK048618@svn.freebsd.org> From: Tony Finch Date: Tue, 18 Jan 2011 19:13: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: r217550 - head/usr.bin/unifdef X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jan 2011 19:13:04 -0000 Author: fanf Date: Tue Jan 18 19:13:03 2011 New Revision: 217550 URL: http://svn.freebsd.org/changeset/base/217550 Log: Update to upstream version 2.3 Only significant change is to fix a bu when the output file overwrites the input when the input is redirected. Obtained from: http://dotat.at/prog/unifdef Modified: head/usr.bin/unifdef/unifdef.c Modified: head/usr.bin/unifdef/unifdef.c ============================================================================== --- head/usr.bin/unifdef/unifdef.c Tue Jan 18 17:55:24 2011 (r217549) +++ head/usr.bin/unifdef/unifdef.c Tue Jan 18 19:13:03 2011 (r217550) @@ -57,7 +57,7 @@ #include const char copyright[] = - "@(#) $Version: unifdef-2.3 $\n" + "@(#) $Version: unifdef-2.5 $\n" "@(#) $FreeBSD$\n" "@(#) $Author: Tony Finch (dot@dotat.at) $\n" "@(#) $URL: http://dotat.at/prog/unifdef $\n" @@ -329,16 +329,10 @@ main(int argc, char *argv[]) output = stdout; } else { struct stat ist, ost; - memset(&ist, 0, sizeof(ist)); - memset(&ost, 0, sizeof(ost)); - - if (fstat(fileno(input), &ist) != 0) - err(2, "can't fstat %s", filename); - if (stat(ofilename, &ost) != 0 && errno != ENOENT) - warn("can't stat %s", ofilename); - - overwriting = (ist.st_dev == ost.st_dev - && ist.st_ino == ost.st_ino); + if (stat(ofilename, &ost) == 0 && + fstat(fileno(input), &ist) == 0) + overwriting = (ist.st_dev == ost.st_dev + && ist.st_ino == ost.st_ino); if (overwriting) { const char *dirsep; int ofd; @@ -402,7 +396,8 @@ usage(void) * When we have processed a group that starts off with a known-false * #if/#elif sequence (which has therefore been deleted) followed by a * #elif that we don't understand and therefore must keep, we edit the - * latter into a #if to keep the nesting correct. + * latter into a #if to keep the nesting correct. We use strncpy() to + * overwrite the 4 byte token "elif" with "if " without a '\0' byte. * * When we find a true #elif in a group, the following block will * always be kept and the rest of the sequence after the next #elif or @@ -455,7 +450,7 @@ static void Oelif (void) { if (!iocccok) static void Idrop (void) { Fdrop(); ignoreon(); } static void Itrue (void) { Ftrue(); ignoreon(); } static void Ifalse(void) { Ffalse(); ignoreon(); } -/* edit this line */ +/* modify this line */ static void Mpass (void) { strncpy(keyword, "if ", 4); Pelif(); } static void Mtrue (void) { keywordedit("else"); state(IS_TRUE_MIDDLE); } static void Melif (void) { keywordedit("endif"); state(IS_FALSE_TRAILER); } @@ -629,10 +624,10 @@ done(void) if (incomment) error("EOF in comment"); closeout(); - if (overwriting && rename(tempname, filename) == -1) { + if (overwriting && rename(tempname, ofilename) == -1) { warn("couldn't rename temporary file"); unlink(tempname); - errx(2, "%s unchanged", filename); + errx(2, "%s unchanged", ofilename); } exit(exitstat); } From owner-svn-src-all@FreeBSD.ORG Tue Jan 18 19:30:57 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1BF94106566B; Tue, 18 Jan 2011 19:30:57 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail01.syd.optusnet.com.au (mail01.syd.optusnet.com.au [211.29.132.182]) by mx1.freebsd.org (Postfix) with ESMTP id A6E8E8FC17; Tue, 18 Jan 2011 19:30:55 +0000 (UTC) Received: from c122-106-165-206.carlnfd1.nsw.optusnet.com.au (c122-106-165-206.carlnfd1.nsw.optusnet.com.au [122.106.165.206]) by mail01.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p0IJUqVB029691 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 19 Jan 2011 06:30:53 +1100 Date: Wed, 19 Jan 2011 06:30:52 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Roman Divacky In-Reply-To: <20110118182655.GA77102@freebsd.org> Message-ID: <20110119060513.P2927@besplex.bde.org> References: <201101181523.p0IFNGeB042079@svn.freebsd.org> <20110119035030.W2099@besplex.bde.org> <201101181215.46266.jhb@freebsd.org> <20110119044805.Y2631@besplex.bde.org> <20110118182655.GA77102@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin , Bruce Evans Subject: Re: svn commit: r217538 - in head/sys/dev: buslogic cs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jan 2011 19:30:57 -0000 On Tue, 18 Jan 2011, Roman Divacky wrote: > On Wed, Jan 19, 2011 at 04:54:34AM +1100, Bruce Evans wrote: >> On Tue, 18 Jan 2011, John Baldwin wrote: >>> ... >>> Gah, I trusted the clang warning too much. enum's are ints in C yes? So >>> clang has a bug if it thinks an enum value cannot be negative. In practice >>> all the callers of this routine do not pass in negative values, but the >>> compiler shouldn't warn about enum's bogusly. >> >> I didn't know it was a problem already when I asked. I thought >> isa_compat_io_t was global, but it is private to bt. >> >>> Is clang assuming that only defined values for an enum are ever passed in? >>> If >>> so we probably don't want to turn that checking on for the kernel as we >>> violate that in lots of places. >> >> enum values are int, but an enum type may be implemented as unsigned if >> that makes no difference for conforming code. I think conforming code can >> only used declared enum values. Thus if all declared values are >= 0, as >> is the case here, then the enum type may be implemented as unsigned. >> Apparently, this happens for clang here, and it checks what it would do >> itself. Other compilers might do it differently. > > No, it's a real bug - C99 says that: > > If an int can represent all values of the original type, the value is converted > to an int; otherwise, it is converted to an unsigned int. " (C99 6.3.1.1p2). Er, 6.3.1.1p2 just describes the binary promotions in a expression, and this clause describes the unary promotion part of that. It has little to do with enums. It says for example than u_char promotes to int provided UCHAR_MAX <= INT_MAX. enum types start as signed, so they stay signed in promotions Here are more details for enums: - 6.4.4.3p2 paraphrased: enum constants have type int. gcc with certain warnings warns about ones which are outside the range of int. - 6.7.2.1p4 paraphrased: an enum type is any integer type that can represent all the enum constants for the enum. The choice is otherwise implementation- defined. > Thus in this case the enum must be (signed) int. > > The problem is that this bug is in gcc too, compare: > > witten ~# cat enum1.c > #include > > static enum { foo, bar = 1U } z; No, this only has to hold values 0 and 1, so it can be any standard type and perhaps even an implementation-defined 1-bit unsigned type (not 1 bit signed signed since that can only hold 0 and -1). The U on 1U has no effect. > > int main (void) > { > int r = 0; > > if (z - 1 < 0) > r++; > > printf("r = %i\n", r); > } > > witten ~# gcc enum1.c && ./a.out > r = 0 > witten ~# g++ enum1.c && ./a.out > r = 1 > > So clang is just emulating gcc bug which results in this unfortunate bogus warning. This tells us that gcc chose to use an unsigned type for the enum. z - 1 is an integer expression (after promoting z), so it is valid. The result also tells us that gcc wasted space for the enum type, since if it were 1-bit unsigned, uint8_t or uint16_t then it would promote to int and z - 1 would be (int)-1. The bug is that since the choice is implementation-defined, you can't base portable error checking on the choice made. Bruce From owner-svn-src-all@FreeBSD.ORG Tue Jan 18 19:31:40 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C87281065672; Tue, 18 Jan 2011 19:31:40 +0000 (UTC) (envelope-from fanf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7FED08FC15; Tue, 18 Jan 2011 19:31:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0IJVcr6049233; Tue, 18 Jan 2011 19:31:38 GMT (envelope-from fanf@svn.freebsd.org) Received: (from fanf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0IJVc20049228; Tue, 18 Jan 2011 19:31:38 GMT (envelope-from fanf@svn.freebsd.org) Message-Id: <201101181931.p0IJVc20049228@svn.freebsd.org> From: Tony Finch Date: Tue, 18 Jan 2011 19:31:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217551 - stable/8/usr.bin/unifdef X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jan 2011 19:31:40 -0000 Author: fanf Date: Tue Jan 18 19:31:38 2011 New Revision: 217551 URL: http://svn.freebsd.org/changeset/base/217551 Log: MFC unifdef-2.5 Modified: stable/8/usr.bin/unifdef/Makefile stable/8/usr.bin/unifdef/unifdef.1 stable/8/usr.bin/unifdef/unifdef.c stable/8/usr.bin/unifdef/unifdefall.sh Directory Properties: stable/8/usr.bin/unifdef/ (props changed) Modified: stable/8/usr.bin/unifdef/Makefile ============================================================================== --- stable/8/usr.bin/unifdef/Makefile Tue Jan 18 19:13:03 2011 (r217550) +++ stable/8/usr.bin/unifdef/Makefile Tue Jan 18 19:31:38 2011 (r217551) @@ -4,6 +4,5 @@ PROG= unifdef SCRIPTS=unifdefall.sh MLINKS= unifdef.1 unifdefall.1 -WARNS?= 5 .include Modified: stable/8/usr.bin/unifdef/unifdef.1 ============================================================================== --- stable/8/usr.bin/unifdef/unifdef.1 Tue Jan 18 19:13:03 2011 (r217550) +++ stable/8/usr.bin/unifdef/unifdef.1 Tue Jan 18 19:31:38 2011 (r217551) @@ -1,6 +1,6 @@ .\" Copyright (c) 1985, 1991, 1993 .\" The Regents of the University of California. All rights reserved. -.\" Copyright (c) 2002 - 2009 Tony Finch . All rights reserved. +.\" Copyright (c) 2002 - 2010 Tony Finch . All rights reserved. .\" .\" This code is derived from software contributed to Berkeley by .\" Dave Yost. It was rewritten to support ANSI C by Tony Finch. @@ -29,11 +29,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" @(#)unifdef.1 8.2 (Berkeley) 4/1/94 -.\" $dotat: unifdef/unifdef.1,v 1.60 2009/11/25 00:11:02 fanf2 Exp $ .\" $FreeBSD$ .\" -.Dd September 24, 2002 +.Dd March 11, 2010 .Dt UNIFDEF 1 .Os .Sh NAME @@ -41,14 +39,15 @@ .Nd remove preprocessor conditionals from code .Sh SYNOPSIS .Nm -.Op Fl BbcdeKknst +.Op Fl bBcdeKknsStV .Op Fl I Ns Ar path .Op Fl D Ns Ar sym Ns Op = Ns Ar val .Op Fl U Ns Ar sym .Op Fl iD Ns Ar sym Ns Op = Ns Ar val .Op Fl iU Ns Ar sym .Ar ... -.Op Ar file +.Op Fl o Ar outfile +.Op Ar infile .Nm unifdefall .Op Fl I Ns Ar path .Ar ... @@ -167,26 +166,22 @@ with appropriate arguments to process th .Sh OPTIONS .Pp .Bl -tag -width indent -compact -.It Fl D Ns Ar sym Ns Op = Ns Ar val -Specify that a symbol is defined, -and optionally specify what value to give it -for the purpose of handling +.It Fl D Ns Ar sym Ns = Ns Ar val +Specify that a symbol is defined to a given value +which is used when evaluating .Ic #if and .Ic #elif -directives. +control expressions. +.Pp +.It Fl D Ns Ar sym +Specify that a symbol is defined to the value 1. .Pp .It Fl U Ns Ar sym Specify that a symbol is undefined. If the same symbol appears in more than one argument, the last occurrence dominates. .Pp -.It Fl B -Compress blank lines around a deleted section. -Mutually exclusive with the -.Fl b -option. -.Pp .It Fl b Replace removed lines with blank lines instead of deleting them. @@ -194,6 +189,12 @@ Mutually exclusive with the .Fl B option. .Pp +.It Fl B +Compress blank lines around a deleted section. +Mutually exclusive with the +.Fl b +option. +.Pp .It Fl c If the .Fl c @@ -205,7 +206,7 @@ i.e., the lines that would have been rem are retained and vice versa. .Pp .It Fl d -Turn on printing of degugging messages. +Turn on printing of debugging messages. .Pp .It Fl e Because @@ -254,6 +255,18 @@ directives to the output following any d so that errors produced when compiling the output file correspond to line numbers in the input file. .Pp +.It Fl o Ar outfile +Write output to the file +.Ar outfile +instead of the standard output. +If +.Ar outfile +is the same as the input file, +the output is written to a temporary file +which is renamed into place when +.Nm +completes successfully. +.Pp .It Fl s Instead of processing the input file as usual, this option causes @@ -270,6 +283,13 @@ for creating .Nm command lines. .Pp +.It Fl S +Like the +.Fl s +option, but the nesting depth of each symbol is also printed. +This is useful for working out the number of possible combinations +of interdependent defined/undefined symbols. +.Pp .It Fl t Disables parsing for C comments and line continuations, @@ -314,6 +334,9 @@ for compatibility with .Xr cpp 1 and to simplify the implementation of .Nm unifdefall . +.Pp +.It Fl V +Print version details. .El .Pp The Modified: stable/8/usr.bin/unifdef/unifdef.c ============================================================================== --- stable/8/usr.bin/unifdef/unifdef.c Tue Jan 18 19:13:03 2011 (r217550) +++ stable/8/usr.bin/unifdef/unifdef.c Tue Jan 18 19:31:38 2011 (r217551) @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002 - 2009 Tony Finch + * Copyright (c) 2002 - 2010 Tony Finch * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -24,27 +24,14 @@ */ /* + * unifdef - remove ifdef'ed lines + * * This code was derived from software contributed to Berkeley by Dave Yost. * It was rewritten to support ANSI C by Tony Finch. The original version * of unifdef carried the 4-clause BSD copyright licence. None of its code * remains in this version (though some of the names remain) so it now * carries a more liberal licence. * - * The latest version is available from http://dotat.at/prog/unifdef - */ - -#include - -#ifdef __IDSTRING -__IDSTRING(dotat, "$dotat: unifdef/unifdef.c,v 1.190 2009/11/27 17:21:26 fanf2 Exp $"); -#endif -#ifdef __FBSDID -__FBSDID("$FreeBSD$"); -#endif - -/* - * unifdef - remove ifdef'ed lines - * * Wishlist: * provide an option which will append the name of the * appropriate symbol after #else's and #endif's @@ -52,12 +39,16 @@ __FBSDID("$FreeBSD$"); * #else's and #endif's to see that they match their * corresponding #ifdef or #ifndef * - * The first two items above require better buffer handling, which would - * also make it possible to handle all "dodgy" directives correctly. + * These require better buffer handling, which would also make + * it possible to handle all "dodgy" directives correctly. */ +#include +#include + #include #include +#include #include #include #include @@ -65,6 +56,13 @@ __FBSDID("$FreeBSD$"); #include #include +const char copyright[] = + "@(#) $Version: unifdef-2.5 $\n" + "@(#) $FreeBSD$\n" + "@(#) $Author: Tony Finch (dot@dotat.at) $\n" + "@(#) $URL: http://dotat.at/prog/unifdef $\n" +; + /* types of input lines: */ typedef enum { LT_TRUEI, /* a true #if with ignore flag */ @@ -157,6 +155,11 @@ static char const * const linestate_name #define EDITSLOP 10 /* + * For temporary filenames + */ +#define TEMPLATE "unifdef.XXXXXX" + +/* * Globals. */ @@ -169,6 +172,7 @@ static bool strictlogic; /* static bool killconsts; /* -k: eval constant #ifs */ static bool lnnum; /* -n: add #line directives */ static bool symlist; /* -s: output symbol list */ +static bool symdepth; /* -S: output symbol depth */ static bool text; /* -t: this is a text file */ static const char *symname[MAXSYMS]; /* symbol name */ @@ -179,10 +183,18 @@ static int nsyms; /* numb static FILE *input; /* input file pointer */ static const char *filename; /* input file name */ static int linenum; /* current line number */ +static FILE *output; /* output file pointer */ +static const char *ofilename; /* output file name */ +static bool overwriting; /* output overwrites input */ +static char tempname[FILENAME_MAX]; /* used when overwriting */ static char tline[MAXLINE+EDITSLOP];/* input buffer plus space */ static char *keyword; /* used for editing #elif's */ +static const char *newline; /* input file format */ +static const char newline_unix[] = "\n"; +static const char newline_crlf[] = "\r\n"; + static Comment_state incomment; /* comment parser state */ static Line_state linestate; /* #if line parser state */ static Ifstate ifstate[MAXDEPTH]; /* #if processor state */ @@ -193,10 +205,13 @@ static int delcount; /* co static unsigned blankcount; /* count of blank lines */ static unsigned blankmax; /* maximum recent blankcount */ static bool constexpr; /* constant #if expression */ +static bool zerosyms = true; /* to format symdepth output */ +static bool firstsym; /* ditto */ static int exitstat; /* program exit status */ static void addsym(bool, bool, char *); +static void closeout(void); static void debug(const char *, ...); static void done(void); static void error(const char *); @@ -216,6 +231,7 @@ static void state(Ifstate); static int strlcmp(const char *, const char *, size_t); static void unnest(void); static void usage(void); +static void version(void); #define endsym(c) (!isalnum((unsigned char)c) && c != '_') @@ -227,7 +243,7 @@ main(int argc, char *argv[]) { int opt; - while ((opt = getopt(argc, argv, "i:D:U:I:BbcdeKklnst")) != -1) + while ((opt = getopt(argc, argv, "i:D:U:I:o:bBcdeKklnsStV")) != -1) switch (opt) { case 'i': /* treat stuff controlled by these symbols as text */ /* @@ -249,16 +265,15 @@ main(int argc, char *argv[]) case 'U': /* undef a symbol */ addsym(false, false, optarg); break; - case 'I': - /* no-op for compatibility with cpp */ - break; - case 'B': /* compress blank lines around removed section */ - compblank = true; + case 'I': /* no-op for compatibility with cpp */ break; case 'b': /* blank deleted lines instead of omitting them */ case 'l': /* backwards compatibility */ lnblank = true; break; + case 'B': /* compress blank lines around removed section */ + compblank = true; + break; case 'c': /* treat -D as -U and vice versa */ complement = true; break; @@ -277,12 +292,20 @@ main(int argc, char *argv[]) case 'n': /* add #line directive after deleted lines */ lnnum = true; break; + case 'o': /* output to a file */ + ofilename = optarg; + break; case 's': /* only output list of symbols that control #ifs */ symlist = true; break; + case 'S': /* list symbols with their nesting depth */ + symlist = symdepth = true; + break; case 't': /* don't parse C comments */ text = true; break; + case 'V': /* print version */ + version(); default: usage(); } @@ -294,21 +317,68 @@ main(int argc, char *argv[]) errx(2, "can only do one file"); } else if (argc == 1 && strcmp(*argv, "-") != 0) { filename = *argv; - input = fopen(filename, "r"); + input = fopen(filename, "rb"); if (input == NULL) err(2, "can't open %s", filename); } else { filename = "[stdin]"; input = stdin; } + if (ofilename == NULL) { + ofilename = "[stdout]"; + output = stdout; + } else { + struct stat ist, ost; + if (stat(ofilename, &ost) == 0 && + fstat(fileno(input), &ist) == 0) + overwriting = (ist.st_dev == ost.st_dev + && ist.st_ino == ost.st_ino); + if (overwriting) { + const char *dirsep; + int ofd; + + dirsep = strrchr(ofilename, '/'); + if (dirsep != NULL) + snprintf(tempname, sizeof(tempname), + "%.*s/" TEMPLATE, + (int)(dirsep - ofilename), ofilename); + else + snprintf(tempname, sizeof(tempname), + TEMPLATE); + ofd = mkstemp(tempname); + if (ofd != -1) + output = fdopen(ofd, "wb+"); + if (output == NULL) + err(2, "can't create temporary file"); + fchmod(ofd, ist.st_mode & (S_IRWXU|S_IRWXG|S_IRWXO)); + } else { + output = fopen(ofilename, "wb"); + if (output == NULL) + err(2, "can't open %s", ofilename); + } + } process(); abort(); /* bug */ } static void +version(void) +{ + const char *c = copyright; + for (;;) { + while (*++c != '$') + if (*c == '\0') + exit(0); + while (*++c != '$') + putc(*c, stderr); + putc('\n', stderr); + } +} + +static void usage(void) { - fprintf(stderr, "usage: unifdef [-BbcdeKknst] [-Ipath]" + fprintf(stderr, "usage: unifdef [-bBcdeKknsStV] [-Ipath]" " [-Dsym[=val]] [-Usym] [-iDsym[=val]] [-iUsym] ... [file]\n"); exit(2); } @@ -326,7 +396,8 @@ usage(void) * When we have processed a group that starts off with a known-false * #if/#elif sequence (which has therefore been deleted) followed by a * #elif that we don't understand and therefore must keep, we edit the - * latter into a #if to keep the nesting correct. + * latter into a #if to keep the nesting correct. We use strncpy() to + * overwrite the 4 byte token "elif" with "if " without a '\0' byte. * * When we find a true #elif in a group, the following block will * always be kept and the rest of the sequence after the next #elif or @@ -379,11 +450,11 @@ static void Oelif (void) { if (!iocccok) static void Idrop (void) { Fdrop(); ignoreon(); } static void Itrue (void) { Ftrue(); ignoreon(); } static void Ifalse(void) { Ffalse(); ignoreon(); } -/* edit this line */ +/* modify this line */ static void Mpass (void) { strncpy(keyword, "if ", 4); Pelif(); } -static void Mtrue (void) { keywordedit("else\n"); state(IS_TRUE_MIDDLE); } -static void Melif (void) { keywordedit("endif\n"); state(IS_FALSE_TRAILER); } -static void Melse (void) { keywordedit("endif\n"); state(IS_FALSE_ELSE); } +static void Mtrue (void) { keywordedit("else"); state(IS_TRUE_MIDDLE); } +static void Melif (void) { keywordedit("endif"); state(IS_FALSE_TRAILER); } +static void Melse (void) { keywordedit("endif"); state(IS_FALSE_ELSE); } static state_fn * const trans_table[IS_COUNT][LT_COUNT] = { /* IS_OUTSIDE */ @@ -435,13 +506,6 @@ static state_fn * const trans_table[IS_C * State machine utility functions */ static void -done(void) -{ - if (incomment) - error("EOF in comment"); - exit(exitstat); -} -static void ignoreoff(void) { if (depth == 0) @@ -456,7 +520,8 @@ ignoreon(void) static void keywordedit(const char *replacement) { - strlcpy(keyword, replacement, tline + sizeof(tline) - keyword); + snprintf(keyword, tline + sizeof(tline) - keyword, + "%s%s", replacement, newline); print(); } static void @@ -491,24 +556,26 @@ flushline(bool keep) if (symlist) return; if (keep ^ complement) { - bool blankline = tline[strspn(tline, " \t\n")] == '\0'; + bool blankline = tline[strspn(tline, " \t\r\n")] == '\0'; if (blankline && compblank && blankcount != blankmax) { delcount += 1; blankcount += 1; } else { if (lnnum && delcount > 0) - printf("#line %d\n", linenum); - fputs(tline, stdout); + printf("#line %d%s", linenum, newline); + fputs(tline, output); delcount = 0; blankmax = blankcount = blankline ? blankcount + 1 : 0; } } else { if (lnblank) - putc('\n', stdout); + fputs(newline, output); exitstat = 1; delcount += 1; blankcount = 0; } + if (debugging) + fflush(output); } /* @@ -517,22 +584,55 @@ flushline(bool keep) static void process(void) { - Linetype lineval; - /* When compressing blank lines, act as if the file is preceded by a large number of blank lines. */ blankmax = blankcount = 1000; for (;;) { - linenum++; - lineval = parseline(); + Linetype lineval = parseline(); trans_table[ifstate[depth]][lineval](); - debug("process %s -> %s depth %d", - linetype_name[lineval], + debug("process line %d %s -> %s depth %d", + linenum, linetype_name[lineval], ifstate_name[ifstate[depth]], depth); } } /* + * Flush the output and handle errors. + */ +static void +closeout(void) +{ + if (symdepth && !zerosyms) + printf("\n"); + if (fclose(output) == EOF) { + warn("couldn't write to %s", ofilename); + if (overwriting) { + unlink(tempname); + errx(2, "%s unchanged", filename); + } else { + exit(2); + } + } +} + +/* + * Clean up and exit. + */ +static void +done(void) +{ + if (incomment) + error("EOF in comment"); + closeout(); + if (overwriting && rename(tempname, ofilename) == -1) { + warn("couldn't rename temporary file"); + unlink(tempname); + errx(2, "%s unchanged", ofilename); + } + exit(exitstat); +} + +/* * Parse a line and determine its type. We keep the preprocessor line * parser state between calls in the global variable linestate, with * help from skipcomment(). @@ -546,14 +646,22 @@ parseline(void) Linetype retval; Comment_state wascomment; + linenum++; if (fgets(tline, MAXLINE, input) == NULL) return (LT_EOF); + if (newline == NULL) { + if (strrchr(tline, '\n') == strrchr(tline, '\r') + 1) + newline = newline_crlf; + else + newline = newline_unix; + } retval = LT_PLAIN; wascomment = incomment; cp = skipcomment(tline); if (linestate == LS_START) { if (*cp == '#') { linestate = LS_HASH; + firstsym = true; cp = skipcomment(cp + 1); } else if (*cp != '\0') linestate = LS_DIRTY; @@ -563,7 +671,8 @@ parseline(void) cp = skipsym(cp); kwlen = cp - keyword; /* no way can we deal with a continuation inside a keyword */ - if (strncmp(cp, "\\\n", 2) == 0) + if (strncmp(cp, "\\\r\n", 3) == 0 || + strncmp(cp, "\\\n", 2) == 0) Eioccc(); if (strlcmp("ifdef", keyword, kwlen) == 0 || strlcmp("ifndef", keyword, kwlen) == 0) { @@ -614,9 +723,8 @@ parseline(void) size_t len = cp - tline; if (fgets(tline + len, MAXLINE - len, input) == NULL) { /* append the missing newline */ - tline[len+0] = '\n'; - tline[len+1] = '\0'; - cp++; + strcpy(tline + len, newline); + cp += strlen(newline); linestate = LS_START; } else { linestate = LS_DIRTY; @@ -627,7 +735,7 @@ parseline(void) while (*cp != '\0') cp = skipcomment(cp + 1); } - debug("parser %s comment %s line", + debug("parser line %d state %s comment %s line", linenum, comment_name[incomment], linestate_name[linestate]); return (retval); } @@ -872,11 +980,16 @@ skipcomment(const char *cp) } while (*cp != '\0') /* don't reset to LS_START after a line continuation */ - if (strncmp(cp, "\\\n", 2) == 0) + if (strncmp(cp, "\\\r\n", 3) == 0) + cp += 3; + else if (strncmp(cp, "\\\n", 2) == 0) cp += 2; else switch (incomment) { case NO_COMMENT: - if (strncmp(cp, "/\\\n", 3) == 0) { + if (strncmp(cp, "/\\\r\n", 4) == 0) { + incomment = STARTING_COMMENT; + cp += 4; + } else if (strncmp(cp, "/\\\n", 3) == 0) { incomment = STARTING_COMMENT; cp += 3; } else if (strncmp(cp, "/*", 2) == 0) { @@ -896,7 +1009,7 @@ skipcomment(const char *cp) } else if (strncmp(cp, "\n", 1) == 0) { linestate = LS_START; cp += 1; - } else if (strchr(" \t", *cp) != NULL) { + } else if (strchr(" \r\t", *cp) != NULL) { cp += 1; } else return (cp); @@ -928,7 +1041,10 @@ skipcomment(const char *cp) cp += 1; continue; case C_COMMENT: - if (strncmp(cp, "*\\\n", 3) == 0) { + if (strncmp(cp, "*\\\r\n", 4) == 0) { + incomment = FINISHING_COMMENT; + cp += 4; + } else if (strncmp(cp, "*\\\n", 3) == 0) { incomment = FINISHING_COMMENT; cp += 3; } else if (strncmp(cp, "*/", 2) == 0) { @@ -1012,7 +1128,13 @@ findsym(const char *str) if (cp == str) return (-1); if (symlist) { - printf("%.*s\n", (int)(cp-str), str); + if (symdepth && firstsym) + printf("%s%3d", zerosyms ? "" : "\n", depth); + firstsym = zerosyms = false; + printf("%s%.*s%s", + symdepth ? " " : "", + (int)(cp-str), str, + symdepth ? "" : "\n"); /* we don't care about the value of the symbol */ return (0); } @@ -1049,7 +1171,7 @@ addsym(bool ignorethis, bool definethis, value[symind] = val+1; *val = '\0'; } else if (*val == '\0') - value[symind] = ""; + value[symind] = "1"; else usage(); } else { @@ -1057,6 +1179,8 @@ addsym(bool ignorethis, bool definethis, usage(); value[symind] = NULL; } + debug("addsym %s=%s", symname[symind], + value[symind] ? value[symind] : "undef"); } /* @@ -1097,5 +1221,6 @@ error(const char *msg) else warnx("%s: %d: %s (#if line %d depth %d)", filename, linenum, msg, stifline[depth], depth); + closeout(); errx(2, "output may be truncated"); } Modified: stable/8/usr.bin/unifdef/unifdefall.sh ============================================================================== --- stable/8/usr.bin/unifdef/unifdefall.sh Tue Jan 18 19:13:03 2011 (r217550) +++ stable/8/usr.bin/unifdef/unifdefall.sh Tue Jan 18 19:31:38 2011 (r217551) @@ -2,7 +2,8 @@ # # unifdefall: remove all the #if's from a source file # -# Copyright (c) 2002 - 2009 Tony Finch . All rights reserved. +# Copyright (c) 2002 - 2010 Tony Finch +# Copyright (c) 2009 - 2010 Jonathan Nieder # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -25,19 +26,30 @@ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # -# $dotat: unifdef/unifdefall.sh,v 1.24 2009/11/26 12:54:39 fanf2 Exp $ # $FreeBSD$ set -e -basename=$(basename $0) +unifdef="$(dirname "$0")/unifdef" +if [ ! -e "$unifdef" ] +then + unifdef=unifdef +fi + +case "$@" in +"-d "*) echo DEBUGGING 1>&2 + debug=-d + shift +esac + +basename=$(basename "$0") tmp=$(mktemp -d "${TMPDIR:-/tmp}/$basename.XXXXXXXXXX") || exit 2 -trap 'rm -r "$tmp" || exit 1' EXIT +trap 'rm -r "$tmp" || exit 2' EXIT export LC_ALL=C # list of all controlling macros -unifdef -s "$@" | sort | uniq >"$tmp/ctrl" +"$unifdef" $debug -s "$@" | sort | uniq >"$tmp/ctrl" # list of all macro definitions cpp -dM "$@" | sort | sed 's/^#define //' >"$tmp/hashdefs" # list of defined macro names @@ -49,7 +61,7 @@ comm -12 "$tmp/ctrl" "$tmp/alldef" >"$tm # and converts them to unifdef command-line arguments sed 's|.*|s/^&\\(([^)]*)\\)\\{0,1\\} /-D&=/p|' <"$tmp/def" >"$tmp/script" # create the final unifdef command -{ echo unifdef -k \\ +{ echo "$unifdef" $debug -k '\' # convert the controlling undefined macros to -U arguments sed 's/.*/-U& \\/' <"$tmp/undef" # convert the controlling defined macros to quoted -D arguments @@ -57,5 +69,11 @@ sed 's|.*|s/^&\\(([^)]*)\\)\\{0,1\\} /-D sed "s/'/'\\\\''/g;s/.*/'&' \\\\/" echo '"$@"' } >"$tmp/cmd" +case $debug in +-d) for i in ctrl hashdefs alldef undef def script cmd + do echo ==== $i + cat "$tmp/$i" + done 1>&2 +esac # run the command we just created sh "$tmp/cmd" "$@" From owner-svn-src-all@FreeBSD.ORG Tue Jan 18 20:04:59 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C5F7106564A; Tue, 18 Jan 2011 20:04:59 +0000 (UTC) (envelope-from fanf2@hermes.cam.ac.uk) Received: from ppsw-50.csi.cam.ac.uk (ppsw-50.csi.cam.ac.uk [131.111.8.150]) by mx1.freebsd.org (Postfix) with ESMTP id C05BF8FC08; Tue, 18 Jan 2011 20:04:58 +0000 (UTC) X-Cam-AntiVirus: no malware found X-Cam-SpamDetails: not scanned X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from hermes-1.csi.cam.ac.uk ([131.111.8.51]:40656) by ppsw-50.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.157]:25) with esmtpa (EXTERNAL:fanf2) id 1PfHWA-0001WD-qg (Exim 4.72) (return-path ); Tue, 18 Jan 2011 19:47:02 +0000 Received: from fanf2 (helo=localhost) by hermes-1.csi.cam.ac.uk (hermes.cam.ac.uk) with local-esmtp id 1PfHWA-0008Dq-AX (Exim 4.67) (return-path ); Tue, 18 Jan 2011 19:47:02 +0000 Date: Tue, 18 Jan 2011 19:47:02 +0000 From: Tony Finch X-X-Sender: fanf2@hermes-1.csi.cam.ac.uk To: svn-src-all@freebsd.org, svn-src-head@freebsd.org In-Reply-To: <201101181913.p0IJD3dK048618@svn.freebsd.org> Message-ID: References: <201101181913.p0IJD3dK048618@svn.freebsd.org> User-Agent: Alpine 2.00 (LSU 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: Tony Finch Cc: Subject: Re: svn commit: r217550 - head/usr.bin/unifdef X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jan 2011 20:04:59 -0000 On Tue, 18 Jan 2011, Tony Finch wrote: > Log: > Update to upstream version 2.3 Er, that should have read version 2.5 Tony. -- f.anthony.n.finch http://dotat.at/ HUMBER THAMES DOVER WIGHT PORTLAND: NORTH BACKING WEST OR NORTHWEST, 5 TO 7, DECREASING 4 OR 5, OCCASIONALLY 6 LATER IN HUMBER AND THAMES. MODERATE OR ROUGH. RAIN THEN FAIR. GOOD. From owner-svn-src-all@FreeBSD.ORG Tue Jan 18 20:26:41 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F1A41065672; Tue, 18 Jan 2011 20:26:41 +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 0DF908FC08; Tue, 18 Jan 2011 20:26:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0IKQeIB050946; Tue, 18 Jan 2011 20:26:40 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0IKQeMY050944; Tue, 18 Jan 2011 20:26:40 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201101182026.p0IKQeMY050944@svn.freebsd.org> From: Warner Losh Date: Tue, 18 Jan 2011 20:26:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217553 - stable/8/sys/modules X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jan 2011 20:26:41 -0000 Author: imp Date: Tue Jan 18 20:26:40 2011 New Revision: 217553 URL: http://svn.freebsd.org/changeset/base/217553 Log: Fix mismerge. The missing _cxgb=cxgb assignment was causing cxgb to not be built at all, rather than causing it to not be built on just arm and mips. # The merge info looks correct, so this looks like a direct commit. Modified: stable/8/sys/modules/Makefile Modified: stable/8/sys/modules/Makefile ============================================================================== --- stable/8/sys/modules/Makefile Tue Jan 18 19:36:04 2011 (r217552) +++ stable/8/sys/modules/Makefile Tue Jan 18 20:26:40 2011 (r217553) @@ -339,6 +339,8 @@ _siba_bwn= siba_bwn _sym= sym # no uart_cpu_$MACHINE_ARCH _uart= uart +# disable_intr() interferes +_cxgb= cxgb .endif .if ${MK_CRYPT} != "no" || defined(ALL_MODULES) From owner-svn-src-all@FreeBSD.ORG Tue Jan 18 21:14:13 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 746BE106566B; Tue, 18 Jan 2011 21:14:13 +0000 (UTC) (envelope-from mdf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 61B018FC16; Tue, 18 Jan 2011 21:14:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0ILEDwu052106; Tue, 18 Jan 2011 21:14:13 GMT (envelope-from mdf@svn.freebsd.org) Received: (from mdf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0ILEDV9052098; Tue, 18 Jan 2011 21:14:13 GMT (envelope-from mdf@svn.freebsd.org) Message-Id: <201101182114.p0ILEDV9052098@svn.freebsd.org> From: Matthew D Fleming Date: Tue, 18 Jan 2011 21:14: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: r217554 - in head/sys: net80211 netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jan 2011 21:14:13 -0000 Author: mdf Date: Tue Jan 18 21:14:13 2011 New Revision: 217554 URL: http://svn.freebsd.org/changeset/base/217554 Log: Specify a CTLTYPE_FOO so that a future sysctl(8) change does not need to rely on the format string. For SYSCTL_PROC instances that I noticed a discrepancy between the CTLTYPE and the format specifier, fix the CTLTYPE. Modified: head/sys/net80211/ieee80211_freebsd.c head/sys/netinet/ip_divert.c head/sys/netinet/raw_ip.c head/sys/netinet/sctp_sysctl.c head/sys/netinet/tcp_reass.c head/sys/netinet/tcp_subr.c head/sys/netinet/udp_usrreq.c Modified: head/sys/net80211/ieee80211_freebsd.c ============================================================================== --- head/sys/net80211/ieee80211_freebsd.c Tue Jan 18 20:26:40 2011 (r217553) +++ head/sys/net80211/ieee80211_freebsd.c Tue Jan 18 21:14:13 2011 (r217554) @@ -233,7 +233,7 @@ ieee80211_sysctl_vattach(struct ieee8021 oid = SYSCTL_ADD_NODE(ctx, &SYSCTL_NODE_CHILDREN(_net, wlan), OID_AUTO, num, CTLFLAG_RD, NULL, ""); SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, - "%parent", CTLFLAG_RD, vap->iv_ic, 0, + "%parent", CTLTYPE_STRING | CTLFLAG_RD, vap->iv_ic, 0, ieee80211_sysctl_parent, "A", "parent device"); SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, "driver_caps", CTLFLAG_RW, &vap->iv_caps, 0, Modified: head/sys/netinet/ip_divert.c ============================================================================== --- head/sys/netinet/ip_divert.c Tue Jan 18 20:26:40 2011 (r217553) +++ head/sys/netinet/ip_divert.c Tue Jan 18 21:14:13 2011 (r217554) @@ -686,8 +686,8 @@ div_pcblist(SYSCTL_HANDLER_ARGS) #ifdef SYSCTL_NODE SYSCTL_NODE(_net_inet, IPPROTO_DIVERT, divert, CTLFLAG_RW, 0, "IPDIVERT"); -SYSCTL_PROC(_net_inet_divert, OID_AUTO, pcblist, CTLFLAG_RD, 0, 0, - div_pcblist, "S,xinpcb", "List of active divert sockets"); +SYSCTL_PROC(_net_inet_divert, OID_AUTO, pcblist, CTLTYPE_OPAQUE | CTLFLAG_RD, + NULL, 0, div_pcblist, "S,xinpcb", "List of active divert sockets"); #endif struct pr_usrreqs div_usrreqs = { Modified: head/sys/netinet/raw_ip.c ============================================================================== --- head/sys/netinet/raw_ip.c Tue Jan 18 20:26:40 2011 (r217553) +++ head/sys/netinet/raw_ip.c Tue Jan 18 21:14:13 2011 (r217554) @@ -1082,7 +1082,8 @@ rip_pcblist(SYSCTL_HANDLER_ARGS) return (error); } -SYSCTL_PROC(_net_inet_raw, OID_AUTO/*XXX*/, pcblist, CTLFLAG_RD, 0, 0, +SYSCTL_PROC(_net_inet_raw, OID_AUTO/*XXX*/, pcblist, + CTLTYPE_OPAQUE | CTLFLAG_RD, NULL, 0, rip_pcblist, "S,xinpcb", "List of active raw IP sockets"); struct pr_usrreqs rip_usrreqs = { Modified: head/sys/netinet/sctp_sysctl.c ============================================================================== --- head/sys/netinet/sctp_sysctl.c Tue Jan 18 20:26:40 2011 (r217553) +++ head/sys/netinet/sctp_sysctl.c Tue Jan 18 21:14:13 2011 (r217554) @@ -810,230 +810,230 @@ sysctl_sctp_cleartrace(SYSCTL_HANDLER_AR * sysctl definitions */ -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, sendspace, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, sendspace, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_sendspace), 0, sysctl_sctp_check, "IU", SCTPCTL_MAXDGRAM_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, recvspace, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, recvspace, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_recvspace), 0, sysctl_sctp_check, "IU", SCTPCTL_RECVSPACE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, auto_asconf, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, auto_asconf, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_auto_asconf), 0, sysctl_sctp_check, "IU", SCTPCTL_AUTOASCONF_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, ecn_enable, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, ecn_enable, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_ecn_enable), 0, sysctl_sctp_check, "IU", SCTPCTL_ECN_ENABLE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, ecn_nonce, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, ecn_nonce, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_ecn_nonce), 0, sysctl_sctp_check, "IU", SCTPCTL_ECN_NONCE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, strict_sacks, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, strict_sacks, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_strict_sacks), 0, sysctl_sctp_check, "IU", SCTPCTL_STRICT_SACKS_DESC); #if !defined(SCTP_WITH_NO_CSUM) -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, loopback_nocsum, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, loopback_nocsum, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_no_csum_on_loopback), 0, sysctl_sctp_check, "IU", SCTPCTL_LOOPBACK_NOCSUM_DESC); #endif -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, strict_init, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, strict_init, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_strict_init), 0, sysctl_sctp_check, "IU", SCTPCTL_STRICT_INIT_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, peer_chkoh, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, peer_chkoh, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_peer_chunk_oh), 0, sysctl_sctp_check, "IU", SCTPCTL_PEER_CHKOH_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, maxburst, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, maxburst, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_max_burst_default), 0, sysctl_sctp_check, "IU", SCTPCTL_MAXBURST_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, maxchunks, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, maxchunks, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_max_chunks_on_queue), 0, sysctl_sctp_check, "IU", SCTPCTL_MAXCHUNKS_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, tcbhashsize, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, tcbhashsize, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_hashtblsize), 0, sysctl_sctp_check, "IU", SCTPCTL_TCBHASHSIZE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, pcbhashsize, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, pcbhashsize, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_pcbtblsize), 0, sysctl_sctp_check, "IU", SCTPCTL_PCBHASHSIZE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, min_split_point, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, min_split_point, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_min_split_point), 0, sysctl_sctp_check, "IU", SCTPCTL_MIN_SPLIT_POINT_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, chunkscale, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, chunkscale, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_chunkscale), 0, sysctl_sctp_check, "IU", SCTPCTL_CHUNKSCALE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, delayed_sack_time, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, delayed_sack_time, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_delayed_sack_time_default), 0, sysctl_sctp_check, "IU", SCTPCTL_DELAYED_SACK_TIME_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, sack_freq, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, sack_freq, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_sack_freq_default), 0, sysctl_sctp_check, "IU", SCTPCTL_SACK_FREQ_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, sys_resource, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, sys_resource, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_system_free_resc_limit), 0, sysctl_sctp_check, "IU", SCTPCTL_SYS_RESOURCE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, asoc_resource, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, asoc_resource, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_asoc_free_resc_limit), 0, sysctl_sctp_check, "IU", SCTPCTL_ASOC_RESOURCE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, heartbeat_interval, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, heartbeat_interval, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_heartbeat_interval_default), 0, sysctl_sctp_check, "IU", SCTPCTL_HEARTBEAT_INTERVAL_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, pmtu_raise_time, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, pmtu_raise_time, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_pmtu_raise_time_default), 0, sysctl_sctp_check, "IU", SCTPCTL_PMTU_RAISE_TIME_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, shutdown_guard_time, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, shutdown_guard_time, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_shutdown_guard_time_default), 0, sysctl_sctp_check, "IU", SCTPCTL_SHUTDOWN_GUARD_TIME_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, secret_lifetime, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, secret_lifetime, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_secret_lifetime_default), 0, sysctl_sctp_check, "IU", SCTPCTL_SECRET_LIFETIME_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, rto_max, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, rto_max, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_rto_max_default), 0, sysctl_sctp_check, "IU", SCTPCTL_RTO_MAX_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, rto_min, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, rto_min, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_rto_min_default), 0, sysctl_sctp_check, "IU", SCTPCTL_RTO_MIN_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, rto_initial, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, rto_initial, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_rto_initial_default), 0, sysctl_sctp_check, "IU", SCTPCTL_RTO_INITIAL_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, init_rto_max, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, init_rto_max, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_init_rto_max_default), 0, sysctl_sctp_check, "IU", SCTPCTL_INIT_RTO_MAX_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, valid_cookie_life, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, valid_cookie_life, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_valid_cookie_life_default), 0, sysctl_sctp_check, "IU", SCTPCTL_VALID_COOKIE_LIFE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, init_rtx_max, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, init_rtx_max, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_init_rtx_max_default), 0, sysctl_sctp_check, "IU", SCTPCTL_INIT_RTX_MAX_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, assoc_rtx_max, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, assoc_rtx_max, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_assoc_rtx_max_default), 0, sysctl_sctp_check, "IU", SCTPCTL_ASSOC_RTX_MAX_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, path_rtx_max, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, path_rtx_max, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_path_rtx_max_default), 0, sysctl_sctp_check, "IU", SCTPCTL_PATH_RTX_MAX_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, add_more_on_output, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, add_more_on_output, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_add_more_threshold), 0, sysctl_sctp_check, "IU", SCTPCTL_ADD_MORE_ON_OUTPUT_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, outgoing_streams, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, outgoing_streams, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_nr_outgoing_streams_default), 0, sysctl_sctp_check, "IU", SCTPCTL_OUTGOING_STREAMS_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, cmt_on_off, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, cmt_on_off, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_cmt_on_off), 0, sysctl_sctp_check, "IU", SCTPCTL_CMT_ON_OFF_DESC); /* EY */ -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, nr_sack_on_off, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, nr_sack_on_off, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_nr_sack_on_off), 0, sysctl_sctp_check, "IU", SCTPCTL_NR_SACK_ON_OFF_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, cmt_use_dac, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, cmt_use_dac, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_cmt_use_dac), 0, sysctl_sctp_check, "IU", SCTPCTL_CMT_USE_DAC_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, cmt_pf, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, cmt_pf, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_cmt_pf), 0, sysctl_sctp_check, "IU", SCTPCTL_CMT_PF_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, cwnd_maxburst, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, cwnd_maxburst, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_use_cwnd_based_maxburst), 0, sysctl_sctp_check, "IU", SCTPCTL_CWND_MAXBURST_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, early_fast_retran, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, early_fast_retran, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_early_fr), 0, sysctl_sctp_check, "IU", SCTPCTL_EARLY_FAST_RETRAN_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, early_fast_retran_msec, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, early_fast_retran_msec, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_early_fr_msec), 0, sysctl_sctp_check, "IU", SCTPCTL_EARLY_FAST_RETRAN_MSEC_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, asconf_auth_nochk, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, asconf_auth_nochk, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_asconf_auth_nochk), 0, sysctl_sctp_check, "IU", SCTPCTL_ASCONF_AUTH_NOCHK_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, auth_disable, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, auth_disable, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_auth_disable), 0, sysctl_sctp_check, "IU", SCTPCTL_AUTH_DISABLE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, nat_friendly, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, nat_friendly, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_nat_friendly), 0, sysctl_sctp_check, "IU", SCTPCTL_NAT_FRIENDLY_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, abc_l_var, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, abc_l_var, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_L2_abc_variable), 0, sysctl_sctp_check, "IU", SCTPCTL_ABC_L_VAR_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, max_chained_mbufs, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, max_chained_mbufs, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_mbuf_threshold_count), 0, sysctl_sctp_check, "IU", SCTPCTL_MAX_CHAINED_MBUFS_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, do_sctp_drain, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, do_sctp_drain, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_do_drain), 0, sysctl_sctp_check, "IU", SCTPCTL_DO_SCTP_DRAIN_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, hb_max_burst, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, hb_max_burst, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_hb_maxburst), 0, sysctl_sctp_check, "IU", SCTPCTL_HB_MAX_BURST_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, abort_at_limit, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, abort_at_limit, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_abort_if_one_2_one_hits_limit), 0, sysctl_sctp_check, "IU", SCTPCTL_ABORT_AT_LIMIT_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, strict_data_order, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, strict_data_order, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_strict_data_order), 0, sysctl_sctp_check, "IU", SCTPCTL_STRICT_DATA_ORDER_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, min_residual, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, min_residual, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_min_residual), 0, sysctl_sctp_check, "IU", SCTPCTL_MIN_RESIDUAL_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, max_retran_chunk, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, max_retran_chunk, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_max_retran_chunk), 0, sysctl_sctp_check, "IU", SCTPCTL_MAX_RETRAN_CHUNK_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, log_level, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, log_level, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_logging_level), 0, sysctl_sctp_check, "IU", SCTPCTL_LOGGING_LEVEL_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, default_cc_module, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, default_cc_module, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_default_cc_module), 0, sysctl_sctp_check, "IU", SCTPCTL_DEFAULT_CC_MODULE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, default_frag_interleave, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, default_frag_interleave, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_default_frag_interleave), 0, sysctl_sctp_check, "IU", SCTPCTL_DEFAULT_FRAG_INTERLEAVE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, mobility_base, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, mobility_base, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_mobility_base), 0, sysctl_sctp_check, "IU", SCTPCTL_MOBILITY_BASE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, mobility_fasthandoff, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, mobility_fasthandoff, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_mobility_fasthandoff), 0, sysctl_sctp_check, "IU", SCTPCTL_MOBILITY_FASTHANDOFF_DESC); @@ -1042,7 +1042,7 @@ SYSCTL_STRUCT(_net_inet_sctp, OID_AUTO, &SCTP_BASE_SYSCTL(sctp_log), sctp_log, "SCTP logging (struct sctp_log)"); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, clear_trace, CTLTYPE_OPAQUE | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, clear_trace, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_log), 0, sysctl_sctp_cleartrace, "IU", "Clear SCTP Logging buffer"); @@ -1050,43 +1050,43 @@ SYSCTL_PROC(_net_inet_sctp, OID_AUTO, cl #endif -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, udp_tunneling_for_client_enable, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, udp_tunneling_for_client_enable, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_udp_tunneling_for_client_enable), 0, sysctl_sctp_check, "IU", SCTPCTL_UDP_TUNNELING_FOR_CLIENT_ENABLE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, udp_tunneling_port, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, udp_tunneling_port, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_udp_tunneling_port), 0, sysctl_sctp_udp_tunneling_check, "IU", SCTPCTL_UDP_TUNNELING_PORT_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, enable_sack_immediately, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, enable_sack_immediately, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_enable_sack_immediately), 0, sysctl_sctp_check, "IU", SCTPCTL_SACK_IMMEDIATELY_ENABLE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, nat_friendly_init, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, nat_friendly_init, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_inits_include_nat_friendly), 0, sysctl_sctp_check, "IU", SCTPCTL_NAT_FRIENDLY_INITS_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, vtag_time_wait, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, vtag_time_wait, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_vtag_time_wait), 0, sysctl_sctp_check, "IU", SCTPCTL_TIME_WAIT_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, buffer_splitting, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, buffer_splitting, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_buffer_splitting), 0, sysctl_sctp_check, "IU", SCTPCTL_BUFFER_SPLITTING_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, initial_cwnd, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, initial_cwnd, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_initial_cwnd), 0, sysctl_sctp_check, "IU", SCTPCTL_INITIAL_CWND_DESC); #ifdef SCTP_DEBUG -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, debug, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, debug, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_debug_on), 0, sysctl_sctp_check, "IU", SCTPCTL_DEBUG_DESC); #endif /* SCTP_DEBUG */ #if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, output_unlocked, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, output_unlocked, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_output_unlocked), 0, sysctl_sctp_check, "IU", SCTPCTL_OUTPUT_UNLOCKED_DESC); #endif @@ -1101,6 +1101,6 @@ SYSCTL_STRUCT(_net_inet_sctp, OID_AUTO, "SCTP statistics (struct sctp_stat)"); #endif -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, assoclist, CTLFLAG_RD, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, assoclist, CTLTYPE_OPAQUE | CTLFLAG_RD, 0, 0, sctp_assoclist, "S,xassoc", "List of active SCTP associations"); Modified: head/sys/netinet/tcp_reass.c ============================================================================== --- head/sys/netinet/tcp_reass.c Tue Jan 18 20:26:40 2011 (r217553) +++ head/sys/netinet/tcp_reass.c Tue Jan 18 21:14:13 2011 (r217554) @@ -82,19 +82,22 @@ SYSCTL_NODE(_net_inet_tcp, OID_AUTO, rea static VNET_DEFINE(int, tcp_reass_maxseg) = 0; #define V_tcp_reass_maxseg VNET(tcp_reass_maxseg) -SYSCTL_VNET_PROC(_net_inet_tcp_reass, OID_AUTO, maxsegments, CTLFLAG_RDTUN, +SYSCTL_VNET_PROC(_net_inet_tcp_reass, OID_AUTO, maxsegments, + CTLTYPE_INT | CTLFLAG_RDTUN, &VNET_NAME(tcp_reass_maxseg), 0, &tcp_reass_sysctl_maxseg, "I", "Global maximum number of TCP Segments in Reassembly Queue"); static VNET_DEFINE(int, tcp_reass_qsize) = 0; #define V_tcp_reass_qsize VNET(tcp_reass_qsize) -SYSCTL_VNET_PROC(_net_inet_tcp_reass, OID_AUTO, cursegments, CTLFLAG_RD, +SYSCTL_VNET_PROC(_net_inet_tcp_reass, OID_AUTO, cursegments, + CTLTYPE_INT | CTLFLAG_RD, &VNET_NAME(tcp_reass_qsize), 0, &tcp_reass_sysctl_qsize, "I", "Global number of TCP Segments currently in Reassembly Queue"); static VNET_DEFINE(int, tcp_reass_overflows) = 0; #define V_tcp_reass_overflows VNET(tcp_reass_overflows) -SYSCTL_VNET_INT(_net_inet_tcp_reass, OID_AUTO, overflows, CTLFLAG_RD, +SYSCTL_VNET_INT(_net_inet_tcp_reass, OID_AUTO, overflows, + CTLTYPE_INT | CTLFLAG_RD, &VNET_NAME(tcp_reass_overflows), 0, "Global number of TCP Segment Reassembly Queue Overflows"); Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Tue Jan 18 20:26:40 2011 (r217553) +++ head/sys/netinet/tcp_subr.c Tue Jan 18 21:14:13 2011 (r217554) @@ -1190,7 +1190,8 @@ tcp_pcblist(SYSCTL_HANDLER_ARGS) return (error); } -SYSCTL_PROC(_net_inet_tcp, TCPCTL_PCBLIST, pcblist, CTLFLAG_RD, 0, 0, +SYSCTL_PROC(_net_inet_tcp, TCPCTL_PCBLIST, pcblist, + CTLTYPE_OPAQUE | CTLFLAG_RD, NULL, 0, tcp_pcblist, "S,xtcpcb", "List of active TCP connections"); static int Modified: head/sys/netinet/udp_usrreq.c ============================================================================== --- head/sys/netinet/udp_usrreq.c Tue Jan 18 20:26:40 2011 (r217553) +++ head/sys/netinet/udp_usrreq.c Tue Jan 18 21:14:13 2011 (r217554) @@ -800,7 +800,8 @@ udp_pcblist(SYSCTL_HANDLER_ARGS) return (error); } -SYSCTL_PROC(_net_inet_udp, UDPCTL_PCBLIST, pcblist, CTLFLAG_RD, 0, 0, +SYSCTL_PROC(_net_inet_udp, UDPCTL_PCBLIST, pcblist, + CTLTYPE_OPAQUE | CTLFLAG_RD, NULL, 0, udp_pcblist, "S,xinpcb", "List of active UDP sockets"); static int From owner-svn-src-all@FreeBSD.ORG Tue Jan 18 21:14:19 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 302031065784; Tue, 18 Jan 2011 21:14:19 +0000 (UTC) (envelope-from mdf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1E5E78FC13; Tue, 18 Jan 2011 21:14:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0ILEJHF052155; Tue, 18 Jan 2011 21:14:19 GMT (envelope-from mdf@svn.freebsd.org) Received: (from mdf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0ILEIEV052146; Tue, 18 Jan 2011 21:14:18 GMT (envelope-from mdf@svn.freebsd.org) Message-Id: <201101182114.p0ILEIEV052146@svn.freebsd.org> From: Matthew D Fleming Date: Tue, 18 Jan 2011 21:14: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: r217555 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jan 2011 21:14:19 -0000 Author: mdf Date: Tue Jan 18 21:14:18 2011 New Revision: 217555 URL: http://svn.freebsd.org/changeset/base/217555 Log: Specify a CTLTYPE_FOO so that a future sysctl(8) change does not need to rely on the format string. Modified: head/sys/kern/kern_linker.c head/sys/kern/kern_sysctl.c head/sys/kern/subr_bus.c head/sys/kern/sysv_msg.c head/sys/kern/sysv_sem.c head/sys/kern/sysv_shm.c head/sys/kern/uipc_usrreq.c head/sys/kern/vfs_subr.c Modified: head/sys/kern/kern_linker.c ============================================================================== --- head/sys/kern/kern_linker.c Tue Jan 18 21:14:13 2011 (r217554) +++ head/sys/kern/kern_linker.c Tue Jan 18 21:14:18 2011 (r217555) @@ -2145,5 +2145,5 @@ sysctl_kern_function_list(SYSCTL_HANDLER return (SYSCTL_OUT(req, "", 1)); } -SYSCTL_PROC(_kern, OID_AUTO, function_list, CTLFLAG_RD, +SYSCTL_PROC(_kern, OID_AUTO, function_list, CTLTYPE_OPAQUE | CTLFLAG_RD, NULL, 0, sysctl_kern_function_list, "", "kernel function list"); Modified: head/sys/kern/kern_sysctl.c ============================================================================== --- head/sys/kern/kern_sysctl.c Tue Jan 18 21:14:13 2011 (r217554) +++ head/sys/kern/kern_sysctl.c Tue Jan 18 21:14:18 2011 (r217555) @@ -876,7 +876,8 @@ sysctl_sysctl_name2oid(SYSCTL_HANDLER_AR return (error); } -SYSCTL_PROC(_sysctl, 3, name2oid, CTLFLAG_RW|CTLFLAG_ANYBODY|CTLFLAG_MPSAFE, +SYSCTL_PROC(_sysctl, 3, name2oid, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_ANYBODY | CTLFLAG_MPSAFE, 0, 0, sysctl_sysctl_name2oid, "I", ""); static int Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Tue Jan 18 21:14:13 2011 (r217554) +++ head/sys/kern/subr_bus.c Tue Jan 18 21:14:18 2011 (r217555) @@ -226,7 +226,7 @@ devclass_sysctl_init(devclass_t dc) SYSCTL_STATIC_CHILDREN(_dev), OID_AUTO, dc->name, CTLFLAG_RD, NULL, ""); SYSCTL_ADD_PROC(&dc->sysctl_ctx, SYSCTL_CHILDREN(dc->sysctl_tree), - OID_AUTO, "%parent", CTLFLAG_RD, + OID_AUTO, "%parent", CTLTYPE_STRING | CTLFLAG_RD, dc, DEVCLASS_SYSCTL_PARENT, devclass_sysctl_handler, "A", "parent class"); } @@ -289,23 +289,23 @@ device_sysctl_init(device_t dev) dev->nameunit + strlen(dc->name), CTLFLAG_RD, NULL, ""); SYSCTL_ADD_PROC(&dev->sysctl_ctx, SYSCTL_CHILDREN(dev->sysctl_tree), - OID_AUTO, "%desc", CTLFLAG_RD, + OID_AUTO, "%desc", CTLTYPE_STRING | CTLFLAG_RD, dev, DEVICE_SYSCTL_DESC, device_sysctl_handler, "A", "device description"); SYSCTL_ADD_PROC(&dev->sysctl_ctx, SYSCTL_CHILDREN(dev->sysctl_tree), - OID_AUTO, "%driver", CTLFLAG_RD, + OID_AUTO, "%driver", CTLTYPE_STRING | CTLFLAG_RD, dev, DEVICE_SYSCTL_DRIVER, device_sysctl_handler, "A", "device driver name"); SYSCTL_ADD_PROC(&dev->sysctl_ctx, SYSCTL_CHILDREN(dev->sysctl_tree), - OID_AUTO, "%location", CTLFLAG_RD, + OID_AUTO, "%location", CTLTYPE_STRING | CTLFLAG_RD, dev, DEVICE_SYSCTL_LOCATION, device_sysctl_handler, "A", "device location relative to parent"); SYSCTL_ADD_PROC(&dev->sysctl_ctx, SYSCTL_CHILDREN(dev->sysctl_tree), - OID_AUTO, "%pnpinfo", CTLFLAG_RD, + OID_AUTO, "%pnpinfo", CTLTYPE_STRING | CTLFLAG_RD, dev, DEVICE_SYSCTL_PNPINFO, device_sysctl_handler, "A", "device identification"); SYSCTL_ADD_PROC(&dev->sysctl_ctx, SYSCTL_CHILDREN(dev->sysctl_tree), - OID_AUTO, "%parent", CTLFLAG_RD, + OID_AUTO, "%parent", CTLTYPE_STRING | CTLFLAG_RD, dev, DEVICE_SYSCTL_PARENT, device_sysctl_handler, "A", "parent device"); } Modified: head/sys/kern/sysv_msg.c ============================================================================== --- head/sys/kern/sysv_msg.c Tue Jan 18 21:14:13 2011 (r217554) +++ head/sys/kern/sysv_msg.c Tue Jan 18 21:14:18 2011 (r217555) @@ -1284,7 +1284,7 @@ SYSCTL_INT(_kern_ipc, OID_AUTO, msgssz, "Size of a message segment"); SYSCTL_INT(_kern_ipc, OID_AUTO, msgseg, CTLFLAG_RDTUN, &msginfo.msgseg, 0, "Number of message segments"); -SYSCTL_PROC(_kern_ipc, OID_AUTO, msqids, CTLFLAG_RD, +SYSCTL_PROC(_kern_ipc, OID_AUTO, msqids, CTLTYPE_OPAQUE | CTLFLAG_RD, NULL, 0, sysctl_msqids, "", "Message queue IDs"); #ifdef COMPAT_FREEBSD32 Modified: head/sys/kern/sysv_sem.c ============================================================================== --- head/sys/kern/sysv_sem.c Tue Jan 18 21:14:13 2011 (r217554) +++ head/sys/kern/sysv_sem.c Tue Jan 18 21:14:18 2011 (r217555) @@ -211,7 +211,7 @@ SYSCTL_INT(_kern_ipc, OID_AUTO, semvmx, "Semaphore maximum value"); SYSCTL_INT(_kern_ipc, OID_AUTO, semaem, CTLFLAG_RW, &seminfo.semaem, 0, "Adjust on exit max value"); -SYSCTL_PROC(_kern_ipc, OID_AUTO, sema, CTLFLAG_RD, +SYSCTL_PROC(_kern_ipc, OID_AUTO, sema, CTLTYPE_OPAQUE | CTLFLAG_RD, NULL, 0, sysctl_sema, "", "Semaphore id pool"); static struct syscall_helper_data sem_syscalls[] = { Modified: head/sys/kern/sysv_shm.c ============================================================================== --- head/sys/kern/sysv_shm.c Tue Jan 18 21:14:13 2011 (r217554) +++ head/sys/kern/sysv_shm.c Tue Jan 18 21:14:18 2011 (r217555) @@ -177,7 +177,7 @@ SYSCTL_INT(_kern_ipc, OID_AUTO, shm_use_ SYSCTL_INT(_kern_ipc, OID_AUTO, shm_allow_removed, CTLFLAG_RW, &shm_allow_removed, 0, "Enable/Disable attachment to attached segments marked for removal"); -SYSCTL_PROC(_kern_ipc, OID_AUTO, shmsegs, CTLFLAG_RD, +SYSCTL_PROC(_kern_ipc, OID_AUTO, shmsegs, CTLTYPE_OPAQUE | CTLFLAG_RD, NULL, 0, sysctl_shmsegs, "", "Current number of shared memory segments allocated"); Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Tue Jan 18 21:14:13 2011 (r217554) +++ head/sys/kern/uipc_usrreq.c Tue Jan 18 21:14:18 2011 (r217555) @@ -1601,15 +1601,16 @@ unp_pcblist(SYSCTL_HANDLER_ARGS) return (error); } -SYSCTL_PROC(_net_local_dgram, OID_AUTO, pcblist, CTLFLAG_RD, - (caddr_t)(long)SOCK_DGRAM, 0, unp_pcblist, "S,xunpcb", - "List of active local datagram sockets"); -SYSCTL_PROC(_net_local_stream, OID_AUTO, pcblist, CTLFLAG_RD, - (caddr_t)(long)SOCK_STREAM, 0, unp_pcblist, "S,xunpcb", - "List of active local stream sockets"); -SYSCTL_PROC(_net_local_seqpacket, OID_AUTO, pcblist, CTLFLAG_RD, - (caddr_t)(long)SOCK_SEQPACKET, 0, unp_pcblist, "S,xunpcb", - "List of active local seqpacket sockets"); +SYSCTL_PROC(_net_local_dgram, OID_AUTO, pcblist, CTLTYPE_OPAQUE | CTLFLAG_RD, + (void *)(intptr_t)SOCK_DGRAM, 0, unp_pcblist, "S,xunpcb", + "List of active local datagram sockets"); +SYSCTL_PROC(_net_local_stream, OID_AUTO, pcblist, CTLTYPE_OPAQUE | CTLFLAG_RD, + (void *)(intptr_t)SOCK_STREAM, 0, unp_pcblist, "S,xunpcb", + "List of active local stream sockets"); +SYSCTL_PROC(_net_local_seqpacket, OID_AUTO, pcblist, + CTLTYPE_OPAQUE | CTLFLAG_RD, + (void *)(intptr_t)SOCK_SEQPACKET, 0, unp_pcblist, "S,xunpcb", + "List of active local seqpacket sockets"); static void unp_shutdown(struct unpcb *unp) Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Tue Jan 18 21:14:13 2011 (r217554) +++ head/sys/kern/vfs_subr.c Tue Jan 18 21:14:18 2011 (r217555) @@ -2998,7 +2998,8 @@ sysctl_vfs_conflist(SYSCTL_HANDLER_ARGS) return (error); } -SYSCTL_PROC(_vfs, OID_AUTO, conflist, CTLFLAG_RD, NULL, 0, sysctl_vfs_conflist, +SYSCTL_PROC(_vfs, OID_AUTO, conflist, CTLTYPE_OPAQUE | CTLFLAG_RD, + NULL, 0, sysctl_vfs_conflist, "S,xvfsconf", "List of all configured filesystems"); #ifndef BURN_BRIDGES @@ -4160,7 +4161,8 @@ sysctl_vfs_ctl(SYSCTL_HANDLER_ARGS) return (error); } -SYSCTL_PROC(_vfs, OID_AUTO, ctl, CTLFLAG_WR, NULL, 0, sysctl_vfs_ctl, "", +SYSCTL_PROC(_vfs, OID_AUTO, ctl, CTLTYPE_OPAQUE | CTLFLAG_WR, + NULL, 0, sysctl_vfs_ctl, "", "Sysctl by fsid"); /* From owner-svn-src-all@FreeBSD.ORG Tue Jan 18 21:14:24 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 71178106590B; Tue, 18 Jan 2011 21:14:24 +0000 (UTC) (envelope-from mdf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5E1D18FC12; Tue, 18 Jan 2011 21:14:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0ILEONC052205; Tue, 18 Jan 2011 21:14:24 GMT (envelope-from mdf@svn.freebsd.org) Received: (from mdf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0ILENQZ052195; Tue, 18 Jan 2011 21:14:23 GMT (envelope-from mdf@svn.freebsd.org) Message-Id: <201101182114.p0ILENQZ052195@svn.freebsd.org> From: Matthew D Fleming Date: Tue, 18 Jan 2011 21:14: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: r217556 - in head/sys/dev: e1000 en fatm iscsi/initiator ixgbe patm usb/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jan 2011 21:14:24 -0000 Author: mdf Date: Tue Jan 18 21:14:23 2011 New Revision: 217556 URL: http://svn.freebsd.org/changeset/base/217556 Log: Specify a CTLTYPE_FOO so that a future sysctl(8) change does not need to rely on the format string. Modified: head/sys/dev/e1000/if_em.c head/sys/dev/e1000/if_igb.c head/sys/dev/e1000/if_lem.c head/sys/dev/en/midway.c head/sys/dev/fatm/if_fatm.c head/sys/dev/iscsi/initiator/isc_sm.c head/sys/dev/ixgbe/ixgbe.c head/sys/dev/patm/if_patm_attach.c head/sys/dev/usb/net/usb_ethernet.c Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Tue Jan 18 21:14:18 2011 (r217555) +++ head/sys/dev/e1000/if_em.c Tue Jan 18 21:14:23 2011 (r217556) @@ -5082,11 +5082,11 @@ em_add_hw_stats(struct adapter *adapter) "Watchdog timeouts"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "device_control", - CTLFLAG_RD, adapter, E1000_CTRL, + CTLTYPE_UINT | CTLFLAG_RD, adapter, E1000_CTRL, em_sysctl_reg_handler, "IU", "Device Control Register"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "rx_control", - CTLFLAG_RD, adapter, E1000_RCTL, + CTLTYPE_UINT | CTLFLAG_RD, adapter, E1000_RCTL, em_sysctl_reg_handler, "IU", "Receiver Control Register"); SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "fc_high_water", @@ -5103,11 +5103,13 @@ em_add_hw_stats(struct adapter *adapter) queue_list = SYSCTL_CHILDREN(queue_node); SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "txd_head", - CTLFLAG_RD, adapter, E1000_TDH(txr->me), + CTLTYPE_UINT | CTLFLAG_RD, adapter, + E1000_TDH(txr->me), em_sysctl_reg_handler, "IU", "Transmit Descriptor Head"); SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "txd_tail", - CTLFLAG_RD, adapter, E1000_TDT(txr->me), + CTLTYPE_UINT | CTLFLAG_RD, adapter, + E1000_TDT(txr->me), em_sysctl_reg_handler, "IU", "Transmit Descriptor Tail"); SYSCTL_ADD_ULONG(ctx, queue_list, OID_AUTO, "tx_irq", @@ -5118,11 +5120,13 @@ em_add_hw_stats(struct adapter *adapter) "Queue No Descriptor Available"); SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "rxd_head", - CTLFLAG_RD, adapter, E1000_RDH(rxr->me), + CTLTYPE_UINT | CTLFLAG_RD, adapter, + E1000_RDH(rxr->me), em_sysctl_reg_handler, "IU", "Receive Descriptor Head"); SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "rxd_tail", - CTLFLAG_RD, adapter, E1000_RDT(rxr->me), + CTLTYPE_UINT | CTLFLAG_RD, adapter, + E1000_RDT(rxr->me), em_sysctl_reg_handler, "IU", "Receive Descriptor Tail"); SYSCTL_ADD_ULONG(ctx, queue_list, OID_AUTO, "rx_irq", Modified: head/sys/dev/e1000/if_igb.c ============================================================================== --- head/sys/dev/e1000/if_igb.c Tue Jan 18 21:14:18 2011 (r217555) +++ head/sys/dev/e1000/if_igb.c Tue Jan 18 21:14:23 2011 (r217556) @@ -5120,17 +5120,19 @@ igb_add_hw_stats(struct adapter *adapter queue_list = SYSCTL_CHILDREN(queue_node); SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "interrupt_rate", - CTLFLAG_RD, &adapter->queues[i], + CTLTYPE_UINT | CTLFLAG_RD, &adapter->queues[i], sizeof(&adapter->queues[i]), igb_sysctl_interrupt_rate_handler, "IU", "Interrupt Rate"); SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "txd_head", - CTLFLAG_RD, adapter, E1000_TDH(txr->me), + CTLTYPE_UINT | CTLFLAG_RD, adapter, + E1000_TDH(txr->me), igb_sysctl_reg_handler, "IU", "Transmit Descriptor Head"); SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "txd_tail", - CTLFLAG_RD, adapter, E1000_TDT(txr->me), + CTLTYPE_UINT | CTLFLAG_RD, adapter, + E1000_TDT(txr->me), igb_sysctl_reg_handler, "IU", "Transmit Descriptor Tail"); SYSCTL_ADD_UQUAD(ctx, queue_list, OID_AUTO, "no_desc_avail", @@ -5141,11 +5143,13 @@ igb_add_hw_stats(struct adapter *adapter "Queue Packets Transmitted"); SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "rxd_head", - CTLFLAG_RD, adapter, E1000_RDH(rxr->me), + CTLTYPE_UINT | CTLFLAG_RD, adapter, + E1000_RDH(rxr->me), igb_sysctl_reg_handler, "IU", "Receive Descriptor Head"); SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "rxd_tail", - CTLFLAG_RD, adapter, E1000_RDT(rxr->me), + CTLTYPE_UINT | CTLFLAG_RD, adapter, + E1000_RDT(rxr->me), igb_sysctl_reg_handler, "IU", "Receive Descriptor Tail"); SYSCTL_ADD_UQUAD(ctx, queue_list, OID_AUTO, "rx_packets", Modified: head/sys/dev/e1000/if_lem.c ============================================================================== --- head/sys/dev/e1000/if_lem.c Tue Jan 18 21:14:18 2011 (r217555) +++ head/sys/dev/e1000/if_lem.c Tue Jan 18 21:14:23 2011 (r217556) @@ -4297,11 +4297,11 @@ lem_add_hw_stats(struct adapter *adapter "Watchdog timeouts"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "device_control", - CTLFLAG_RD, adapter, E1000_CTRL, + CTLTYPE_UINT | CTLFLAG_RD, adapter, E1000_CTRL, lem_sysctl_reg_handler, "IU", "Device Control Register"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "rx_control", - CTLFLAG_RD, adapter, E1000_RCTL, + CTLTYPE_UINT | CTLFLAG_RD, adapter, E1000_RCTL, lem_sysctl_reg_handler, "IU", "Receiver Control Register"); SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "fc_high_water", @@ -4318,19 +4318,19 @@ lem_add_hw_stats(struct adapter *adapter "TX FIFO resets"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "txd_head", - CTLFLAG_RD, adapter, E1000_TDH(0), + CTLTYPE_UINT | CTLFLAG_RD, adapter, E1000_TDH(0), lem_sysctl_reg_handler, "IU", "Transmit Descriptor Head"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "txd_tail", - CTLFLAG_RD, adapter, E1000_TDT(0), + CTLTYPE_UINT | CTLFLAG_RD, adapter, E1000_TDT(0), lem_sysctl_reg_handler, "IU", "Transmit Descriptor Tail"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "rxd_head", - CTLFLAG_RD, adapter, E1000_RDH(0), + CTLTYPE_UINT | CTLFLAG_RD, adapter, E1000_RDH(0), lem_sysctl_reg_handler, "IU", "Receive Descriptor Head"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "rxd_tail", - CTLFLAG_RD, adapter, E1000_RDT(0), + CTLTYPE_UINT | CTLFLAG_RD, adapter, E1000_RDT(0), lem_sysctl_reg_handler, "IU", "Receive Descriptor Tail"); Modified: head/sys/dev/en/midway.c ============================================================================== --- head/sys/dev/en/midway.c Tue Jan 18 21:14:18 2011 (r217555) +++ head/sys/dev/en/midway.c Tue Jan 18 21:14:23 2011 (r217556) @@ -2908,8 +2908,8 @@ en_attach(struct en_softc *sc) goto fail; if (SYSCTL_ADD_PROC(&sc->sysctl_ctx, SYSCTL_CHILDREN(sc->sysctl_tree), - OID_AUTO, "istats", CTLFLAG_RD, sc, 0, en_sysctl_istats, - "S", "internal statistics") == NULL) + OID_AUTO, "istats", CTLTYPE_OPAQUE | CTLFLAG_RD, sc, 0, + en_sysctl_istats, "S", "internal statistics") == NULL) goto fail; #ifdef EN_DEBUG Modified: head/sys/dev/fatm/if_fatm.c ============================================================================== --- head/sys/dev/fatm/if_fatm.c Tue Jan 18 21:14:18 2011 (r217555) +++ head/sys/dev/fatm/if_fatm.c Tue Jan 18 21:14:23 2011 (r217556) @@ -2794,13 +2794,13 @@ fatm_attach(device_t dev) goto fail; if (SYSCTL_ADD_PROC(&sc->sysctl_ctx, SYSCTL_CHILDREN(sc->sysctl_tree), - OID_AUTO, "istats", CTLFLAG_RD, sc, 0, fatm_sysctl_istats, - "LU", "internal statistics") == NULL) + OID_AUTO, "istats", CTLTYPE_ULONG | CTLFLAG_RD, sc, 0, + fatm_sysctl_istats, "LU", "internal statistics") == NULL) goto fail; if (SYSCTL_ADD_PROC(&sc->sysctl_ctx, SYSCTL_CHILDREN(sc->sysctl_tree), - OID_AUTO, "stats", CTLFLAG_RD, sc, 0, fatm_sysctl_stats, - "LU", "card statistics") == NULL) + OID_AUTO, "stats", CTLTYPE_ULONG | CTLFLAG_RD, sc, 0, + fatm_sysctl_stats, "LU", "card statistics") == NULL) goto fail; if (SYSCTL_ADD_INT(&sc->sysctl_ctx, SYSCTL_CHILDREN(sc->sysctl_tree), Modified: head/sys/dev/iscsi/initiator/isc_sm.c ============================================================================== --- head/sys/dev/iscsi/initiator/isc_sm.c Tue Jan 18 21:14:18 2011 (r217555) +++ head/sys/dev/iscsi/initiator/isc_sm.c Tue Jan 18 21:14:23 2011 (r217556) @@ -666,7 +666,7 @@ isc_add_sysctls(isc_session_t *sp) SYSCTL_CHILDREN(sp->oid), OID_AUTO, "targetname", - CTLFLAG_RD, + CTLTYPE_STRING | CTLFLAG_RD, (void *)&sp->opt.targetName, 0, isc_sysctl_targetName, "A", "target name"); @@ -674,7 +674,7 @@ isc_add_sysctls(isc_session_t *sp) SYSCTL_CHILDREN(sp->oid), OID_AUTO, "targeaddress", - CTLFLAG_RD, + CTLTYPE_STRING | CTLFLAG_RD, (void *)&sp->opt.targetAddress, 0, isc_sysctl_targetAddress, "A", "target address"); @@ -682,7 +682,7 @@ isc_add_sysctls(isc_session_t *sp) SYSCTL_CHILDREN(sp->oid), OID_AUTO, "stats", - CTLFLAG_RD, + CTLTYPE_STRING | CTLFLAG_RD, (void *)sp, 0, isc_dump_stats, "A", "statistics"); Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Tue Jan 18 21:14:18 2011 (r217555) +++ head/sys/dev/ixgbe/ixgbe.c Tue Jan 18 21:14:23 2011 (r217556) @@ -5044,15 +5044,16 @@ ixgbe_add_hw_stats(struct adapter *adapt queue_list = SYSCTL_CHILDREN(queue_node); SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "interrupt_rate", - CTLFLAG_RD, &adapter->queues[i], sizeof(&adapter->queues[i]), + CTLTYPE_UINT | CTLFLAG_RD, &adapter->queues[i], + sizeof(&adapter->queues[i]), ixgbe_sysctl_interrupt_rate_handler, "IU", "Interrupt Rate"); SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "txd_head", - CTLFLAG_RD, txr, sizeof(txr), + CTLTYPE_UINT | CTLFLAG_RD, txr, sizeof(txr), ixgbe_sysctl_tdh_handler, "IU", "Transmit Descriptor Head"); SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "txd_tail", - CTLFLAG_RD, txr, sizeof(txr), + CTLTYPE_UINT | CTLFLAG_RD, txr, sizeof(txr), ixgbe_sysctl_tdt_handler, "IU", "Transmit Descriptor Tail"); SYSCTL_ADD_UQUAD(ctx, queue_list, OID_AUTO, "no_desc_avail", @@ -5077,11 +5078,11 @@ ixgbe_add_hw_stats(struct adapter *adapt queue_list = SYSCTL_CHILDREN(queue_node); SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "rxd_head", - CTLFLAG_RD, rxr, sizeof(rxr), + CTLTYPE_UINT | CTLFLAG_RD, rxr, sizeof(rxr), ixgbe_sysctl_rdh_handler, "IU", "Receive Descriptor Head"); SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "rxd_tail", - CTLFLAG_RD, rxr, sizeof(rxr), + CTLTYPE_UINT | CTLFLAG_RD, rxr, sizeof(rxr), ixgbe_sysctl_rdt_handler, "IU", "Receive Descriptor Tail"); SYSCTL_ADD_UQUAD(ctx, queue_list, OID_AUTO, "rx_packets", Modified: head/sys/dev/patm/if_patm_attach.c ============================================================================== --- head/sys/dev/patm/if_patm_attach.c Tue Jan 18 21:14:18 2011 (r217555) +++ head/sys/dev/patm/if_patm_attach.c Tue Jan 18 21:14:23 2011 (r217556) @@ -254,13 +254,13 @@ patm_attach(device_t dev) goto fail; if (SYSCTL_ADD_PROC(&sc->sysctl_ctx, SYSCTL_CHILDREN(sc->sysctl_tree), - OID_AUTO, "istats", CTLFLAG_RD, sc, 0, patm_sysctl_istats, - "S", "internal statistics") == NULL) + OID_AUTO, "istats", CTLTYPE_OPAQUE | CTLFLAG_RD, sc, 0, + patm_sysctl_istats, "S", "internal statistics") == NULL) goto fail; if (SYSCTL_ADD_PROC(&sc->sysctl_ctx, SYSCTL_CHILDREN(sc->sysctl_tree), - OID_AUTO, "eeprom", CTLFLAG_RD, sc, 0, patm_sysctl_eeprom, - "S", "EEPROM contents") == NULL) + OID_AUTO, "eeprom", CTLTYPE_OPAQUE | CTLFLAG_RD, sc, 0, + patm_sysctl_eeprom, "S", "EEPROM contents") == NULL) goto fail; if (SYSCTL_ADD_UINT(&sc->sysctl_ctx, SYSCTL_CHILDREN(sc->sysctl_tree), Modified: head/sys/dev/usb/net/usb_ethernet.c ============================================================================== --- head/sys/dev/usb/net/usb_ethernet.c Tue Jan 18 21:14:18 2011 (r217555) +++ head/sys/dev/usb/net/usb_ethernet.c Tue Jan 18 21:14:23 2011 (r217556) @@ -240,7 +240,7 @@ ue_attach_post_task(struct usb_proc_msg OID_AUTO, num, CTLFLAG_RD, NULL, ""); SYSCTL_ADD_PROC(&ue->ue_sysctl_ctx, SYSCTL_CHILDREN(ue->ue_sysctl_oid), OID_AUTO, - "%parent", CTLFLAG_RD, ue, 0, + "%parent", CTLTYPE_STRING | CTLFLAG_RD, ue, 0, ue_sysctl_parent, "A", "parent device"); UE_LOCK(ue); From owner-svn-src-all@FreeBSD.ORG Tue Jan 18 21:18:32 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 48123106566C; Tue, 18 Jan 2011 21:18:32 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 36ED68FC08; Tue, 18 Jan 2011 21:18:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0ILIWL7052346; Tue, 18 Jan 2011 21:18:32 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0ILIWA4052343; Tue, 18 Jan 2011 21:18:32 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201101182118.p0ILIWA4052343@svn.freebsd.org> From: Jilles Tjoelker Date: Tue, 18 Jan 2011 21:18: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: r217557 - in head: bin/sh tools/regression/bin/sh/execution X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jan 2011 21:18:32 -0000 Author: jilles Date: Tue Jan 18 21:18:31 2011 New Revision: 217557 URL: http://svn.freebsd.org/changeset/base/217557 Log: sh: Fix signal messages being sent to the wrong file sometimes. When a foreground job exits on a signal, a message is printed to stdout about this. The buffer was not flushed after this which could result in the message being written to the wrong file if the next command was a builtin and had stdout redirected. Example: sh -c 'kill -9 $$'; : > foo; echo FOO:; cat foo Reported by: gcooper MFC after: 1 week Added: head/tools/regression/bin/sh/execution/killed1.0 (contents, props changed) Modified: head/bin/sh/jobs.c Modified: head/bin/sh/jobs.c ============================================================================== --- head/bin/sh/jobs.c Tue Jan 18 21:14:23 2011 (r217556) +++ head/bin/sh/jobs.c Tue Jan 18 21:18:31 2011 (r217557) @@ -1062,6 +1062,7 @@ dowait(int block, struct job *job) if (coredump) out1str(" (core dumped)"); out1c('\n'); + flushout(out1); } } else { TRACE(("Not printing status, rootshell=%d, job=%p\n", rootshell, job)); Added: head/tools/regression/bin/sh/execution/killed1.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/execution/killed1.0 Tue Jan 18 21:18:31 2011 (r217557) @@ -0,0 +1,8 @@ +# $FreeBSD$ +# Sometimes the "Killed" message is not flushed soon enough and it +# is redirected along with the output of a builtin. +# Do not change the semicolon to a newline as it would hide the bug. + +exec 3>&1 +exec >/dev/null 2>&1 +${SH} -c 'kill -9 $$'; : >&3 2>&3 From owner-svn-src-all@FreeBSD.ORG Tue Jan 18 21:18:52 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 43695106578B; Tue, 18 Jan 2011 21:18:52 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 182278FC17; Tue, 18 Jan 2011 21:18:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0ILIpwZ052389; Tue, 18 Jan 2011 21:18:51 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0ILIpKQ052385; Tue, 18 Jan 2011 21:18:51 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201101182118.p0ILIpKQ052385@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 18 Jan 2011 21:18: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: r217558 - in head/sys/dev/usb: . controller X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jan 2011 21:18:52 -0000 Author: hselasky Date: Tue Jan 18 21:18:51 2011 New Revision: 217558 URL: http://svn.freebsd.org/changeset/base/217558 Log: Make USB packet filtering code optional. Approved by: thompsa (mentor) Modified: head/sys/dev/usb/controller/usb_controller.c head/sys/dev/usb/usb_freebsd.h head/sys/dev/usb/usb_transfer.c Modified: head/sys/dev/usb/controller/usb_controller.c ============================================================================== --- head/sys/dev/usb/controller/usb_controller.c Tue Jan 18 21:18:31 2011 (r217557) +++ head/sys/dev/usb/controller/usb_controller.c Tue Jan 18 21:18:51 2011 (r217558) @@ -206,8 +206,9 @@ usb_detach(device_t dev) usb_proc_free(&bus->control_xfer_proc); +#if USB_HAVE_PF usbpf_detach(bus); - +#endif return (0); } @@ -436,8 +437,9 @@ usb_attach_sub(device_t dev, struct usb_ usb_devclass_ptr = devclass_find("usbus"); mtx_unlock(&Giant); +#if USB_HAVE_PF usbpf_attach(bus); - +#endif /* Initialise USB process messages */ bus->explore_msg[0].hdr.pm_callback = &usb_bus_explore; bus->explore_msg[0].bus = bus; Modified: head/sys/dev/usb/usb_freebsd.h ============================================================================== --- head/sys/dev/usb/usb_freebsd.h Tue Jan 18 21:18:31 2011 (r217557) +++ head/sys/dev/usb/usb_freebsd.h Tue Jan 18 21:18:51 2011 (r217558) @@ -41,6 +41,7 @@ #define USB_HAVE_TT_SUPPORT 1 #define USB_HAVE_POWERD 1 #define USB_HAVE_MSCTEST 1 +#define USB_HAVE_PF 1 #define USB_TD_GET_PROC(td) (td)->td_proc #define USB_PROC_GET_GID(td) (td)->p_pgid Modified: head/sys/dev/usb/usb_transfer.c ============================================================================== --- head/sys/dev/usb/usb_transfer.c Tue Jan 18 21:18:31 2011 (r217557) +++ head/sys/dev/usb/usb_transfer.c Tue Jan 18 21:18:51 2011 (r217558) @@ -2196,9 +2196,10 @@ usbd_callback_wrapper(struct usb_xfer_qu } } +#if USB_HAVE_PF if (xfer->usb_state != USB_ST_SETUP) usbpf_xfertap(xfer, USBPF_XFERTAP_DONE); - +#endif /* call processing routine */ (xfer->callback) (xfer, xfer->error); @@ -2386,8 +2387,9 @@ usbd_transfer_start_cb(void *arg) DPRINTF("start\n"); +#if USB_HAVE_PF usbpf_xfertap(xfer, USBPF_XFERTAP_SUBMIT); - +#endif /* start the transfer */ (ep->methods->start) (xfer); @@ -2565,8 +2567,9 @@ usbd_pipe_start(struct usb_xfer_queue *p } DPRINTF("start\n"); +#if USB_HAVE_PF usbpf_xfertap(xfer, USBPF_XFERTAP_SUBMIT); - +#endif /* start USB transfer */ (ep->methods->start) (xfer); From owner-svn-src-all@FreeBSD.ORG Tue Jan 18 21:36:52 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 39C271065673; Tue, 18 Jan 2011 21:36:52 +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 293AA8FC18; Tue, 18 Jan 2011 21:36:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0ILaqpl052841; Tue, 18 Jan 2011 21:36:52 GMT (envelope-from phk@svn.freebsd.org) Received: (from phk@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0ILaqsp052839; Tue, 18 Jan 2011 21:36:52 GMT (envelope-from phk@svn.freebsd.org) Message-Id: <201101182136.p0ILaqsp052839@svn.freebsd.org> From: Poul-Henning Kamp Date: Tue, 18 Jan 2011 21:36: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: r217559 - head/tools/tools/sysbuild X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jan 2011 21:36:52 -0000 Author: phk Date: Tue Jan 18 21:36:51 2011 New Revision: 217559 URL: http://svn.freebsd.org/changeset/base/217559 Log: Make sure the PKGDIR exists before we move stuff into it. Modified: head/tools/tools/sysbuild/sysbuild.sh Modified: head/tools/tools/sysbuild/sysbuild.sh ============================================================================== --- head/tools/tools/sysbuild/sysbuild.sh Tue Jan 18 21:18:51 2011 (r217558) +++ head/tools/tools/sysbuild/sysbuild.sh Tue Jan 18 21:36:51 2011 (r217559) @@ -229,6 +229,7 @@ ports_build() ( if make install ${PORTS_OPTS} ; then if [ "x${PKG_DIR}" != "x" ] ; then make package ${PORTS_OPTS} + mkdir -p ${PKG_DIR} mv *.tbz ${PKG_DIR} fi else From owner-svn-src-all@FreeBSD.ORG Tue Jan 18 21:47:30 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EB72D1065698; Tue, 18 Jan 2011 21:47:30 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DAA078FC1D; Tue, 18 Jan 2011 21:47:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0ILlUC4053094; Tue, 18 Jan 2011 21:47:30 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0ILlUcU053092; Tue, 18 Jan 2011 21:47:30 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201101182147.p0ILlUcU053092@svn.freebsd.org> From: Andreas Tobler Date: Tue, 18 Jan 2011 21:47:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217560 - head/sys/dev/iicbus X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jan 2011 21:47:31 -0000 Author: andreast Date: Tue Jan 18 21:47:30 2011 New Revision: 217560 URL: http://svn.freebsd.org/changeset/base/217560 Log: There are PowerMacs which do not have a hwsensor-location property for this sensor. Instead of leaving this location empty we use here the default name 'sensor'. Submitted by: Justin Hibbits Approved by: nwhitehorn (mentor) Modified: head/sys/dev/iicbus/ds1775.c Modified: head/sys/dev/iicbus/ds1775.c ============================================================================== --- head/sys/dev/iicbus/ds1775.c Tue Jan 18 21:36:51 2011 (r217559) +++ head/sys/dev/iicbus/ds1775.c Tue Jan 18 21:47:30 2011 (r217560) @@ -172,6 +172,7 @@ ds1775_start(void *xdev) struct ds1775_sensor *sens; struct sysctl_oid *sensroot_oid; struct sysctl_ctx_list *ctx; + ssize_t plen; int i; char sysctl_name[40], sysctl_desc[40]; const char *units; @@ -190,16 +191,20 @@ ds1775_start(void *xdev) ctx = device_get_sysctl_ctx(dev); sensroot_oid = device_get_sysctl_tree(dev); - OF_getprop(child, "hwsensor-location", sens->location, - sizeof(sens->location)); + plen = OF_getprop(child, "hwsensor-location", sens->location, + sizeof(sens->location)); units = "C"; - for (i = 0; i < strlen(sens->location); i++) { - sysctl_name[i] = tolower(sens->location[i]); - if (isspace(sysctl_name[i])) - sysctl_name[i] = '_'; + if (plen == -1) { + strcpy(sysctl_name, "sensor"); + } else { + for (i = 0; i < strlen(sens->location); i++) { + sysctl_name[i] = tolower(sens->location[i]); + if (isspace(sysctl_name[i])) + sysctl_name[i] = '_'; + } + sysctl_name[i] = 0; } - sysctl_name[i] = 0; sprintf(sysctl_desc,"%s (%s)", sens->location, units); SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(sensroot_oid), OID_AUTO, From owner-svn-src-all@FreeBSD.ORG Tue Jan 18 21:57:02 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C0885106566B; Tue, 18 Jan 2011 21:57:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AE89B8FC12; Tue, 18 Jan 2011 21:57:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0ILv2sL053350; Tue, 18 Jan 2011 21:57:02 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0ILv2o1053343; Tue, 18 Jan 2011 21:57:02 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201101182157.p0ILv2o1053343@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 18 Jan 2011 21:57: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: r217561 - in head/sys: arm/arm i386/i386 mips/mips powerpc/aim powerpc/booke sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jan 2011 21:57:02 -0000 Author: kib Date: Tue Jan 18 21:57:02 2011 New Revision: 217561 URL: http://svn.freebsd.org/changeset/base/217561 Log: For architectures not using direct map , and requiring real KVA page for sf buf allocation, use wakeup() instead of wakeup_one() to notify sf buffer waiters about free buffer. sf_buf_alloc() calls msleep(PCATCH) when SFB_CATCH flag was given, and for simultaneous wakeup and signal delivery, msleep() returns EINTR/ERESTART despite the thread was selected for wakeup_one(). As result, we loose a wakeup, and some other waiter will not be woken up. Reported and tested by: az Reviewed by: alc, jhb MFC after: 1 week Modified: head/sys/arm/arm/vm_machdep.c head/sys/i386/i386/vm_machdep.c head/sys/mips/mips/vm_machdep.c head/sys/powerpc/aim/vm_machdep.c head/sys/powerpc/booke/vm_machdep.c head/sys/sparc64/sparc64/vm_machdep.c Modified: head/sys/arm/arm/vm_machdep.c ============================================================================== --- head/sys/arm/arm/vm_machdep.c Tue Jan 18 21:47:30 2011 (r217560) +++ head/sys/arm/arm/vm_machdep.c Tue Jan 18 21:57:02 2011 (r217561) @@ -175,7 +175,7 @@ sf_buf_free(struct sf_buf *sf) sf->m = NULL; LIST_REMOVE(sf, list_entry); if (sf_buf_alloc_want > 0) - wakeup_one(&sf_buf_freelist); + wakeup(&sf_buf_freelist); } mtx_unlock(&sf_buf_lock); #endif Modified: head/sys/i386/i386/vm_machdep.c ============================================================================== --- head/sys/i386/i386/vm_machdep.c Tue Jan 18 21:47:30 2011 (r217560) +++ head/sys/i386/i386/vm_machdep.c Tue Jan 18 21:57:02 2011 (r217561) @@ -916,7 +916,7 @@ sf_buf_free(struct sf_buf *sf) LIST_REMOVE(sf, list_entry); #endif if (sf_buf_alloc_want > 0) - wakeup_one(&sf_buf_freelist); + wakeup(&sf_buf_freelist); } mtx_unlock(&sf_buf_lock); } Modified: head/sys/mips/mips/vm_machdep.c ============================================================================== --- head/sys/mips/mips/vm_machdep.c Tue Jan 18 21:47:30 2011 (r217560) +++ head/sys/mips/mips/vm_machdep.c Tue Jan 18 21:57:02 2011 (r217561) @@ -528,7 +528,7 @@ sf_buf_free(struct sf_buf *sf) SLIST_INSERT_HEAD(&sf_freelist.sf_head, sf, free_list); nsfbufsused--; if (sf_buf_alloc_want > 0) - wakeup_one(&sf_freelist); + wakeup(&sf_freelist); mtx_unlock(&sf_freelist.sf_lock); } Modified: head/sys/powerpc/aim/vm_machdep.c ============================================================================== --- head/sys/powerpc/aim/vm_machdep.c Tue Jan 18 21:47:30 2011 (r217560) +++ head/sys/powerpc/aim/vm_machdep.c Tue Jan 18 21:57:02 2011 (r217561) @@ -347,7 +347,7 @@ sf_buf_free(struct sf_buf *sf) nsfbufsused--; if (sf_buf_alloc_want > 0) - wakeup_one(&sf_buf_freelist); + wakeup(&sf_buf_freelist); } mtx_unlock(&sf_buf_lock); } Modified: head/sys/powerpc/booke/vm_machdep.c ============================================================================== --- head/sys/powerpc/booke/vm_machdep.c Tue Jan 18 21:47:30 2011 (r217560) +++ head/sys/powerpc/booke/vm_machdep.c Tue Jan 18 21:57:02 2011 (r217561) @@ -346,7 +346,7 @@ sf_buf_free(struct sf_buf *sf) nsfbufsused--; if (sf_buf_alloc_want > 0) - wakeup_one(&sf_buf_freelist); + wakeup(&sf_buf_freelist); } mtx_unlock(&sf_buf_lock); } Modified: head/sys/sparc64/sparc64/vm_machdep.c ============================================================================== --- head/sys/sparc64/sparc64/vm_machdep.c Tue Jan 18 21:47:30 2011 (r217560) +++ head/sys/sparc64/sparc64/vm_machdep.c Tue Jan 18 21:57:02 2011 (r217561) @@ -483,7 +483,7 @@ sf_buf_free(struct sf_buf *sf) SLIST_INSERT_HEAD(&sf_freelist.sf_head, sf, free_list); nsfbufsused--; if (sf_buf_alloc_want > 0) - wakeup_one(&sf_freelist); + wakeup(&sf_freelist); mtx_unlock(&sf_freelist.sf_lock); } From owner-svn-src-all@FreeBSD.ORG Tue Jan 18 22:19:55 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B6F64106566C; Tue, 18 Jan 2011 22:19:55 +0000 (UTC) (envelope-from simon@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A53A08FC0A; Tue, 18 Jan 2011 22:19:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0IMJthm054000; Tue, 18 Jan 2011 22:19:55 GMT (envelope-from simon@svn.freebsd.org) Received: (from simon@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0IMJt9D053996; Tue, 18 Jan 2011 22:19:55 GMT (envelope-from simon@svn.freebsd.org) Message-Id: <201101182219.p0IMJt9D053996@svn.freebsd.org> From: "Simon L. Nielsen" Date: Tue, 18 Jan 2011 22:19:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217562 - in stable/7/secure/lib: libcrypto libssl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jan 2011 22:19:55 -0000 Author: simon Date: Tue Jan 18 22:19:55 2011 New Revision: 217562 URL: http://svn.freebsd.org/changeset/base/217562 Log: Decrease the libcrypto and libssl shared object version numbers from 6 to 5. They were accidentally bumped in r215997 (on 2010-11-28) with the merge of OpenSSL 0.9.8p, but unfortunately this was not caught until now. Also add compat links for libcrypto.so.6 / libssl.so.6 (pointing to their .5 counterparts) in case any users have compiled any third party during the time stable/7 (and releng/7.4) were broken. This is deemed the last poor of bad options. Had the number bump not been reverted binary packages for stable/7 would not have worked on the still supported 7.3 and 7.1 releases. Discussed with: re, portmgr Approved by: re (kensmith - in principle) Pointyhat to: simon Modified: stable/7/secure/lib/libcrypto/Makefile stable/7/secure/lib/libssl/Makefile Modified: stable/7/secure/lib/libcrypto/Makefile ============================================================================== --- stable/7/secure/lib/libcrypto/Makefile Tue Jan 18 21:57:02 2011 (r217561) +++ stable/7/secure/lib/libcrypto/Makefile Tue Jan 18 22:19:55 2011 (r217562) @@ -6,7 +6,9 @@ SUBDIR= engines .include LIB= crypto -SHLIB_MAJOR= 6 +SHLIB_MAJOR= 5 + +SYMLINKS= lib${LIB}.so.5 ${SHLIBDIR}/lib${LIB}.so.6 NO_LINT= Modified: stable/7/secure/lib/libssl/Makefile ============================================================================== --- stable/7/secure/lib/libssl/Makefile Tue Jan 18 21:57:02 2011 (r217561) +++ stable/7/secure/lib/libssl/Makefile Tue Jan 18 22:19:55 2011 (r217562) @@ -1,7 +1,9 @@ # $FreeBSD$ LIB= ssl -SHLIB_MAJOR= 6 +SHLIB_MAJOR= 5 + +SYMLINKS= lib${LIB}.so.5 ${SHLIBDIR}/lib${LIB}.so.6 NO_LINT= From owner-svn-src-all@FreeBSD.ORG Tue Jan 18 22:33:25 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C5206106566C; Tue, 18 Jan 2011 22:33:25 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id 053C08FC18; Tue, 18 Jan 2011 22:33:24 +0000 (UTC) Received: by wwf26 with SMTP id 26so133361wwf.31 for ; Tue, 18 Jan 2011 14:33:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=+49C1uZGFKlFsdOcn9UUwAhumEF2jb9f8UpTq+794tA=; b=u7xIT0b7iG4tWDNZ3jVa8S/aJ/iApTErwEMWQCZKyqKYglZflgUKVrIki57exLPOCy 3OpA4JN+nluDkYsOY2uSsSWpQdAGXQGg0n97g84MzQIg/tA9TKuCfsi4YgLrztdtFQAO 9XqUhhd0c9Z4wxqwUmdhC9ixSHptiQGl+JsAk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=wZmKQnP3Glbww90kC8KQ6bU0EaxLA9HxGYN8Rqpq4r0b1+j1hnFDaKNLCHnusu1ulX NmFF/mTA5kACfX4fRZ19FdN1UJ0Cs6HGpuHyMAgt6grSFvGmp7QaaO/CWT4zQic0uVsu pNK7T8fBYNJad/KwEZJXhLNgmGlgA/YOfFIuE= MIME-Version: 1.0 Received: by 10.216.49.15 with SMTP id w15mr1771313web.1.1295390003837; Tue, 18 Jan 2011 14:33:23 -0800 (PST) Sender: yanegomi@gmail.com Received: by 10.216.254.226 with HTTP; Tue, 18 Jan 2011 14:33:23 -0800 (PST) In-Reply-To: <201101182118.p0ILIWA4052343@svn.freebsd.org> References: <201101182118.p0ILIWA4052343@svn.freebsd.org> Date: Tue, 18 Jan 2011 14:33:23 -0800 X-Google-Sender-Auth: Q_TpmZakF4GxcRQ_waT_Y3Qb9zc Message-ID: From: Garrett Cooper To: Jilles Tjoelker Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r217557 - in head: bin/sh tools/regression/bin/sh/execution X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jan 2011 22:33:25 -0000 On Tue, Jan 18, 2011 at 1:18 PM, Jilles Tjoelker wrote= : > Author: jilles > Date: Tue Jan 18 21:18:31 2011 > New Revision: 217557 > URL: http://svn.freebsd.org/changeset/base/217557 > > Log: > =A0sh: Fix signal messages being sent to the wrong file sometimes. > > =A0When a foreground job exits on a signal, a message is printed to stdou= t > =A0about this. The buffer was not flushed after this which could result i= n the > =A0message being written to the wrong file if the next command was a buil= tin > =A0and had stdout redirected. Thanks!! -Garrett From owner-svn-src-all@FreeBSD.ORG Tue Jan 18 22:56:11 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6539D10656DD; Tue, 18 Jan 2011 22:56:11 +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 124E38FC08; Tue, 18 Jan 2011 22:56:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0IMuA0k054945; Tue, 18 Jan 2011 22:56:10 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0IMuAuE054943; Tue, 18 Jan 2011 22:56:10 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201101182256.p0IMuAuE054943@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 18 Jan 2011 22:56: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: r217563 - head/sys/amd64/amd64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jan 2011 22:56:11 -0000 Author: kib Date: Tue Jan 18 22:56:10 2011 New Revision: 217563 URL: http://svn.freebsd.org/changeset/base/217563 Log: Use malloc(9) instead of kmem_alloc(9) for temporal copy of the user-supplied descriptor array. Noted and reviewed by: jhb (previous version) MFC after: 1 week Modified: head/sys/amd64/amd64/sys_machdep.c Modified: head/sys/amd64/amd64/sys_machdep.c ============================================================================== --- head/sys/amd64/amd64/sys_machdep.c Tue Jan 18 22:19:55 2011 (r217562) +++ head/sys/amd64/amd64/sys_machdep.c Tue Jan 18 22:56:10 2011 (r217563) @@ -105,19 +105,13 @@ sysarch_ldt(struct thread *td, struct sy return (EINVAL); set_pcb_flags(td->td_pcb, PCB_FULL_IRET); if (largs->descs != NULL) { - lp = (struct user_segment_descriptor *) - kmem_alloc(kernel_map, largs->num * - sizeof(struct user_segment_descriptor)); - if (lp == NULL) { - error = ENOMEM; - break; - } + lp = malloc(largs->num * sizeof(struct + user_segment_descriptor), M_TEMP, M_WAITOK); error = copyin(largs->descs, lp, largs->num * sizeof(struct user_segment_descriptor)); if (error == 0) error = amd64_set_ldt(td, largs, lp); - kmem_free(kernel_map, (vm_offset_t)lp, largs->num * - sizeof(struct user_segment_descriptor)); + free(lp, M_TEMP); } else { error = amd64_set_ldt(td, largs, NULL); } From owner-svn-src-all@FreeBSD.ORG Tue Jan 18 23:00:22 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ABE231065670; Tue, 18 Jan 2011 23:00:22 +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 9B4BA8FC12; Tue, 18 Jan 2011 23:00:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0IN0MtQ055090; Tue, 18 Jan 2011 23:00:22 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0IN0MJ4055088; Tue, 18 Jan 2011 23:00:22 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201101182300.p0IN0MJ4055088@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 18 Jan 2011 23:00: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: r217564 - head/sys/amd64/amd64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jan 2011 23:00:22 -0000 Author: kib Date: Tue Jan 18 23:00:22 2011 New Revision: 217564 URL: http://svn.freebsd.org/changeset/base/217564 Log: Make the length of the LDT a loader tunable, machdep.max_ldt_segment, and export it with read-only sysctl. Remove unused defines. Reviewed by: jhb (previous version) MFC after: 1 week Modified: head/sys/amd64/amd64/sys_machdep.c Modified: head/sys/amd64/amd64/sys_machdep.c ============================================================================== --- head/sys/amd64/amd64/sys_machdep.c Tue Jan 18 22:56:10 2011 (r217563) +++ head/sys/amd64/amd64/sys_machdep.c Tue Jan 18 23:00:22 2011 (r217564) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -58,9 +59,24 @@ __FBSDID("$FreeBSD$"); #include +#define MAX_LD 8192 + int max_ldt_segment = 1024; -#define LD_PER_PAGE 512 -#define NULL_LDT_BASE ((caddr_t)NULL) +SYSCTL_INT(_machdep, OID_AUTO, max_ldt_segment, CTLFLAG_RD, &max_ldt_segment, + 0, + "Maximum number of allowed LDT segments in the single address space"); + +static void +max_ldt_segment_init(void *arg __unused) +{ + + TUNABLE_INT_FETCH("machdep.max_ldt_segment", &max_ldt_segment); + if (max_ldt_segment <= 0) + max_ldt_segment = 1; + if (max_ldt_segment > MAX_LD) + max_ldt_segment = MAX_LD; +} +SYSINIT(maxldt, SI_SUB_VM_CONF, SI_ORDER_ANY, max_ldt_segment_init, NULL); #ifdef notyet #ifdef SMP From owner-svn-src-all@FreeBSD.ORG Tue Jan 18 23:26:47 2011 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8EA5E1065674; Tue, 18 Jan 2011 23:26:47 +0000 (UTC) (envelope-from jmg@h2.funkthat.com) Received: from h2.funkthat.com (gate.funkthat.com [70.36.235.232]) by mx1.freebsd.org (Postfix) with ESMTP id 675618FC1B; Tue, 18 Jan 2011 23:26:47 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id p0IMpXVA007345 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 18 Jan 2011 14:51:33 -0800 (PST) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id p0IMpXVd007344; Tue, 18 Jan 2011 14:51:33 -0800 (PST) (envelope-from jmg) Date: Tue, 18 Jan 2011 14:51:32 -0800 From: John-Mark Gurney To: Konstantin Belousov Message-ID: <20110118225132.GD66284@funkthat.com> References: <201101182157.p0ILv2o1053343@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201101182157.p0ILv2o1053343@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Tue, 18 Jan 2011 14:51:33 -0800 (PST) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r217561 - in head/sys: arm/arm i386/i386 mips/mips powerpc/aim powerpc/booke sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jan 2011 23:26:47 -0000 Konstantin Belousov wrote this message on Tue, Jan 18, 2011 at 21:57 +0000: > sf_buf_alloc() calls msleep(PCATCH) when SFB_CATCH flag was given, > and for simultaneous wakeup and signal delivery, msleep() returns > EINTR/ERESTART despite the thread was selected for wakeup_one(). As > result, we loose a wakeup, and some other waiter will not be woken up. Shouldn't this behavior be documented in the man page? That even though msleep may return a non-zero value that it could have been really woken up? -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-all@FreeBSD.ORG Wed Jan 19 00:35:45 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 22D0B10656A3 for ; Wed, 19 Jan 2011 00:35:45 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx22.fluidhosting.com [204.14.89.5]) by mx1.freebsd.org (Postfix) with ESMTP id A574D8FC0A for ; Wed, 19 Jan 2011 00:35:44 +0000 (UTC) Received: (qmail 32161 invoked by uid 399); 19 Jan 2011 00:35:44 -0000 Received: from localhost (HELO doug-optiplex.ka9q.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 19 Jan 2011 00:35:44 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4D3631DE.8040408@FreeBSD.org> Date: Tue, 18 Jan 2011 16:35:42 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.13) Gecko/20101210 Thunderbird/3.1.7 MIME-Version: 1.0 To: Garrett Cooper References: <201101182118.p0ILIWA4052343@svn.freebsd.org> In-Reply-To: X-Enigmail-Version: 1.1.2 OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Jilles Tjoelker , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r217557 - in head: bin/sh tools/regression/bin/sh/execution X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 00:35:45 -0000 On 01/18/2011 14:33, Garrett Cooper wrote: > On Tue, Jan 18, 2011 at 1:18 PM, Jilles Tjoelker wrote: >> Author: jilles >> Date: Tue Jan 18 21:18:31 2011 >> New Revision: 217557 >> URL: http://svn.freebsd.org/changeset/base/217557 >> >> Log: >> sh: Fix signal messages being sent to the wrong file sometimes. >> >> When a foreground job exits on a signal, a message is printed to stdout >> about this. The buffer was not flushed after this which could result in the >> message being written to the wrong file if the next command was a builtin >> and had stdout redirected. Does this mean that portmaster is going to stop printing those !*@%$@(# "Terminated" messages that I have never been able to figure out how to get rid of, or am I just a loser? :) Doug -- Nothin' ever doesn't change, but nothin' changes much. -- OK Go Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ From owner-svn-src-all@FreeBSD.ORG Wed Jan 19 00:43:43 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD008106564A; Wed, 19 Jan 2011 00:43:43 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id AA0558FC17; Wed, 19 Jan 2011 00:43:42 +0000 (UTC) Received: by wyf19 with SMTP id 19so292668wyf.13 for ; Tue, 18 Jan 2011 16:43:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=XUR4dVAxCJOP7VPUbsqy9DJ7Xt5F7DL7vgR1OM8CGbU=; b=u/EyFFJ+Y8Dze5PZtQt+rNGT5skXjQlYQA29XJxVjAv2FcPceC9PzJY/9d7weJgsiD p8O0/8Sz3GU7rnJX8BqkxGvoTNgaTNrx3MCrufXxWVJV7GcdvnskLwX6I5R1iR3X8eed H5wCvAf9ULkfNobZeRsPw4lRcNd58Ojc4krEQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=mDGzjfBljBVzuCL81swZjwCSWMBNK8FG+jXDYyGT1w6d8fZ1XgYwlQ9VJ26wZjIzjA jY0S/3ROEaGF/6u6ozZu/Ar9kS3HoZZ/CemzxCbd6E4gxtWpcSnqrd4byRdPYlUxg1jO 23hnpJ+RKKob7ze1ILNSN8ZlzOUoNdDksNRao= MIME-Version: 1.0 Received: by 10.216.78.146 with SMTP id g18mr33347wee.1.1295397821606; Tue, 18 Jan 2011 16:43:41 -0800 (PST) Sender: yanegomi@gmail.com Received: by 10.216.254.226 with HTTP; Tue, 18 Jan 2011 16:43:41 -0800 (PST) In-Reply-To: <4D3631DE.8040408@FreeBSD.org> References: <201101182118.p0ILIWA4052343@svn.freebsd.org> <4D3631DE.8040408@FreeBSD.org> Date: Tue, 18 Jan 2011 16:43:41 -0800 X-Google-Sender-Auth: S8SDYgNwABLCaxS5FQBOESawmkw Message-ID: From: Garrett Cooper To: Doug Barton Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Jilles Tjoelker , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r217557 - in head: bin/sh tools/regression/bin/sh/execution X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 00:43:43 -0000 On Tue, Jan 18, 2011 at 4:35 PM, Doug Barton wrote: > On 01/18/2011 14:33, Garrett Cooper wrote: >> >> On Tue, Jan 18, 2011 at 1:18 PM, Jilles Tjoelker >> =A0wrote: >>> >>> Author: jilles >>> Date: Tue Jan 18 21:18:31 2011 >>> New Revision: 217557 >>> URL: http://svn.freebsd.org/changeset/base/217557 >>> >>> Log: >>> =A0sh: Fix signal messages being sent to the wrong file sometimes. >>> >>> =A0When a foreground job exits on a signal, a message is printed to std= out >>> =A0about this. The buffer was not flushed after this which could result= in >>> the >>> =A0message being written to the wrong file if the next command was a >>> builtin >>> =A0and had stdout redirected. > > Does this mean that portmaster is going to stop printing those !*@%$@(# > "Terminated" messages that I have never been able to figure out how to ge= t > rid of, or am I just a loser? :) Don't know. I noticed it because the posix testsuite has a program that traps SIGALRM (system/OS dependent signal number) for the purpose of watchdog'ing testcases so they don't hang. So it was doing something like this: $ sh $ python -c 'import os, signal; os.kill(0, signal.SIGALRM)' >/dev/null 2>&1; echo $? > foo; echo "FOO:"; cat foo FOO: Alarm clock 142 $ I would expect FOO: to follow Alarm clock, not precede it. Whether or not this fixes portmaster, I dunno... try running bash or dash instead of /bin/sh to see whether or not the `problem' still occurs. HTH, -Garrett PS Shells printing out Terminated, Alarm clock, etc is in the POSIX spec II= RC. From owner-svn-src-all@FreeBSD.ORG Wed Jan 19 00:45:49 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F47B106566B; Wed, 19 Jan 2011 00:45:49 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id 16DDA8FC08; Wed, 19 Jan 2011 00:45:47 +0000 (UTC) Received: by wwf26 with SMTP id 26so243945wwf.31 for ; Tue, 18 Jan 2011 16:45:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=z1xlx1to1Ko/o5reP9YWHSL3skhql2SaSl5u82E6CEw=; b=ROf2ok7lkFMiCHIhLodDgjaooex79oaUB18nnBVL4yTO0T5NjXf68c4baENr2fSYzP 3u0rhs/jnMsnSdDKwz58Px4qCPDKoC/2bnh2CoSS/duJ/rvjV4ASwVZvZ/R1Z4/zX9WY R2d7GJC+is62EnreDjD6JILk40ZWlkV/fSk+Y= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=A69sujThupSUFAwp+B6cp9wc1q9ka5o1zOYF4YNYH+wbrtszG8zDid2DgDqUe8q9iC iZz+gZNYqd0vT4bj33IJ/xYRTFxugddpwi1Kiz9S+aPtrgcG9/Yj6r7KVVetoj5Nc8lk dYGqdiy0Cc+eACbAZJONUwjty17jETHV9QH8M= MIME-Version: 1.0 Received: by 10.216.78.146 with SMTP id g18mr34859wee.1.1295397946943; Tue, 18 Jan 2011 16:45:46 -0800 (PST) Sender: yanegomi@gmail.com Received: by 10.216.254.226 with HTTP; Tue, 18 Jan 2011 16:45:46 -0800 (PST) In-Reply-To: References: <201101182118.p0ILIWA4052343@svn.freebsd.org> <4D3631DE.8040408@FreeBSD.org> Date: Tue, 18 Jan 2011 16:45:46 -0800 X-Google-Sender-Auth: IEuucY-dUo5NI02h-xZCens3UjI Message-ID: From: Garrett Cooper To: Doug Barton Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Jilles Tjoelker , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r217557 - in head: bin/sh tools/regression/bin/sh/execution X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 00:45:49 -0000 On Tue, Jan 18, 2011 at 4:43 PM, Garrett Cooper wrote= : > On Tue, Jan 18, 2011 at 4:35 PM, Doug Barton wrote: >> On 01/18/2011 14:33, Garrett Cooper wrote: >>> >>> On Tue, Jan 18, 2011 at 1:18 PM, Jilles Tjoelker >>> =A0wrote: >>>> >>>> Author: jilles >>>> Date: Tue Jan 18 21:18:31 2011 >>>> New Revision: 217557 >>>> URL: http://svn.freebsd.org/changeset/base/217557 >>>> >>>> Log: >>>> =A0sh: Fix signal messages being sent to the wrong file sometimes. >>>> >>>> =A0When a foreground job exits on a signal, a message is printed to st= dout >>>> =A0about this. The buffer was not flushed after this which could resul= t in >>>> the >>>> =A0message being written to the wrong file if the next command was a >>>> builtin >>>> =A0and had stdout redirected. >> >> Does this mean that portmaster is going to stop printing those !*@%$@(# >> "Terminated" messages that I have never been able to figure out how to g= et >> rid of, or am I just a loser? :) > > =A0 =A0Don't know. I noticed it because the posix testsuite has a program > that traps SIGALRM (system/OS dependent signal number) for the purpose > of watchdog'ing testcases so they don't hang. So it was doing > something like this: > > $ sh > $ python -c 'import os, signal; os.kill(0, signal.SIGALRM)' >/dev/null > 2>&1; echo $? > foo; echo "FOO:"; cat foo > FOO: > Alarm clock > 142 > $ > > =A0 =A0I would expect FOO: to follow Alarm clock, not precede it. > =A0 =A0Whether or not this fixes portmaster, I dunno... try running bash > or dash instead of /bin/sh to see whether or not the `problem' still > occurs. > HTH, > -Garrett > > PS Shells printing out Terminated, Alarm clock, etc is in the POSIX spec = IIRC. One other note -- the workaround for the above issue I discovered was to capture $? in a local variable and then echo it out the value of the local variable to a file. You may or may not be able to implement the same workaround *shrugs*. Thanks, -Garrett From owner-svn-src-all@FreeBSD.ORG Wed Jan 19 00:57:59 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 16A2C106566B; Wed, 19 Jan 2011 00:57:59 +0000 (UTC) (envelope-from mdf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 02FEE8FC14; Wed, 19 Jan 2011 00:57:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0J0vwT0057718; Wed, 19 Jan 2011 00:57:58 GMT (envelope-from mdf@svn.freebsd.org) Received: (from mdf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0J0vwLm057708; Wed, 19 Jan 2011 00:57:58 GMT (envelope-from mdf@svn.freebsd.org) Message-Id: <201101190057.p0J0vwLm057708@svn.freebsd.org> From: Matthew D Fleming Date: Wed, 19 Jan 2011 00:57:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217566 - in head: share/examples/kld/dyn_sysctl sys/compat/ndis sys/dev/acpi_support sys/dev/acpica sys/dev/msk sys/dev/patm sys/dev/xen/netback sys/xen/xenbus X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 00:57:59 -0000 Author: mdf Date: Wed Jan 19 00:57:58 2011 New Revision: 217566 URL: http://svn.freebsd.org/changeset/base/217566 Log: Fix a few more SYSCTL_PROC() that were missing a CTLFLAG type specifier. Modified: head/share/examples/kld/dyn_sysctl/dyn_sysctl.c head/sys/compat/ndis/subr_ntoskrnl.c head/sys/dev/acpi_support/acpi_ibm.c head/sys/dev/acpi_support/atk0110.c head/sys/dev/acpica/acpi_video.c head/sys/dev/msk/if_msk.c head/sys/dev/patm/if_patm_attach.c head/sys/dev/xen/netback/netback.c head/sys/xen/xenbus/xenbusb.c Modified: head/share/examples/kld/dyn_sysctl/dyn_sysctl.c ============================================================================== --- head/share/examples/kld/dyn_sysctl/dyn_sysctl.c Tue Jan 18 23:35:08 2011 (r217565) +++ head/share/examples/kld/dyn_sysctl/dyn_sysctl.c Wed Jan 19 00:57:58 2011 (r217566) @@ -100,8 +100,9 @@ load(module_t mod, int cmd, void *arg) return (EINVAL); } SYSCTL_ADD_PROC(&clist, SYSCTL_CHILDREN(a_root1), - OID_AUTO, "procedure", CTLFLAG_RD, 0, 0, - sysctl_dyn_sysctl_test, "A", "I can be here, too"); + OID_AUTO, "procedure", CTLTYPE_STRING | CTLFLAG_RD, + NULL, 0, sysctl_dyn_sysctl_test, "A", + "I can be here, too"); printf(" (%p) /kern dyn_sysctl\n", &clist); /* Overlap second tree with the first. */ Modified: head/sys/compat/ndis/subr_ntoskrnl.c ============================================================================== --- head/sys/compat/ndis/subr_ntoskrnl.c Tue Jan 18 23:35:08 2011 (r217565) +++ head/sys/compat/ndis/subr_ntoskrnl.c Wed Jan 19 00:57:58 2011 (r217566) @@ -80,8 +80,9 @@ __FBSDID("$FreeBSD$"); #ifdef NTOSKRNL_DEBUG_TIMERS static int sysctl_show_timers(SYSCTL_HANDLER_ARGS); -SYSCTL_PROC(_debug, OID_AUTO, ntoskrnl_timers, CTLFLAG_RW, 0, 0, - sysctl_show_timers, "I", "Show ntoskrnl timer stats"); +SYSCTL_PROC(_debug, OID_AUTO, ntoskrnl_timers, CTLTYPE_INT | CTLFLAG_RW, + NULL, 0, sysctl_show_timers, "I", + "Show ntoskrnl timer stats"); #endif struct kdpc_queue { Modified: head/sys/dev/acpi_support/acpi_ibm.c ============================================================================== --- head/sys/dev/acpi_support/acpi_ibm.c Tue Jan 18 23:35:08 2011 (r217565) +++ head/sys/dev/acpi_support/acpi_ibm.c Wed Jan 19 00:57:58 2011 (r217566) @@ -399,7 +399,7 @@ acpi_ibm_attach(device_t dev) if (acpi_ibm_sysctl_init(sc, ACPI_IBM_METHOD_THERMAL)) { SYSCTL_ADD_PROC(sc->sysctl_ctx, SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO, - "thermal", CTLTYPE_STRING | CTLFLAG_RD, + "thermal", CTLTYPE_INT | CTLFLAG_RD, sc, 0, acpi_ibm_thermal_sysctl, "I", "Thermal zones"); } Modified: head/sys/dev/acpi_support/atk0110.c ============================================================================== --- head/sys/dev/acpi_support/atk0110.c Tue Jan 18 23:35:08 2011 (r217565) +++ head/sys/dev/acpi_support/atk0110.c Wed Jan 19 00:57:58 2011 (r217566) @@ -258,7 +258,7 @@ aibs_attach_sif(struct aibs_softc *sc, e #endif snprintf(si, sizeof(si), "%i", i); SYSCTL_ADD_PROC(device_get_sysctl_ctx(sc->sc_dev), - SYSCTL_CHILDREN(so), i, si, CTLTYPE_OPAQUE | CTLFLAG_RD, + SYSCTL_CHILDREN(so), i, si, CTLTYPE_INT | CTLFLAG_RD, sc, st, aibs_sysctl, st == AIBS_TEMP ? "IK" : "I", desc); } Modified: head/sys/dev/acpica/acpi_video.c ============================================================================== --- head/sys/dev/acpica/acpi_video.c Tue Jan 18 23:35:08 2011 (r217565) +++ head/sys/dev/acpica/acpi_video.c Wed Jan 19 00:57:58 2011 (r217566) @@ -537,7 +537,7 @@ acpi_video_vo_init(UINT32 adr) SYSCTL_ADD_PROC(&vo->vo_sysctl_ctx, SYSCTL_CHILDREN(vo->vo_sysctl_tree), OID_AUTO, "levels", - CTLTYPE_OPAQUE|CTLFLAG_RD, vo, 0, + CTLTYPE_INT | CTLFLAG_RD, vo, 0, acpi_video_vo_levels_sysctl, "I", "supported brightness levels"); } else Modified: head/sys/dev/msk/if_msk.c ============================================================================== --- head/sys/dev/msk/if_msk.c Tue Jan 18 23:35:08 2011 (r217565) +++ head/sys/dev/msk/if_msk.c Wed Jan 19 00:57:58 2011 (r217566) @@ -4389,7 +4389,7 @@ msk_sysctl_stat64(SYSCTL_HANDLER_ARGS) sc, offsetof(struct msk_hw_stats, n), msk_sysctl_stat32, \ "IU", d) #define MSK_SYSCTL_STAT64(sc, c, o, p, n, d) \ - SYSCTL_ADD_PROC(c, p, OID_AUTO, o, CTLTYPE_UINT | CTLFLAG_RD, \ + SYSCTL_ADD_PROC(c, p, OID_AUTO, o, CTLTYPE_QUAD | CTLFLAG_RD, \ sc, offsetof(struct msk_hw_stats, n), msk_sysctl_stat64, \ "Q", d) Modified: head/sys/dev/patm/if_patm_attach.c ============================================================================== --- head/sys/dev/patm/if_patm_attach.c Tue Jan 18 23:35:08 2011 (r217565) +++ head/sys/dev/patm/if_patm_attach.c Wed Jan 19 00:57:58 2011 (r217566) @@ -284,13 +284,13 @@ patm_attach(device_t dev) patm_env_getuint(sc, &sc->debug, "debug"); if (SYSCTL_ADD_PROC(&sc->sysctl_ctx, SYSCTL_CHILDREN(sc->sysctl_tree), - OID_AUTO, "regs", CTLFLAG_RD, sc, 0, patm_sysctl_regs, - "S", "registers") == NULL) + OID_AUTO, "regs", CTLTYPE_OPAQUE | CTLFLAG_RD, sc, 0, + patm_sysctl_regs, "S", "registers") == NULL) goto fail; if (SYSCTL_ADD_PROC(&sc->sysctl_ctx, SYSCTL_CHILDREN(sc->sysctl_tree), - OID_AUTO, "tsq", CTLFLAG_RD, sc, 0, patm_sysctl_tsq, - "S", "TSQ") == NULL) + OID_AUTO, "tsq", CTLTYPE_OPAQUE | CTLFLAG_RD, sc, 0, + patm_sysctl_tsq, "S", "TSQ") == NULL) goto fail; #endif Modified: head/sys/dev/xen/netback/netback.c ============================================================================== --- head/sys/dev/xen/netback/netback.c Tue Jan 18 23:35:08 2011 (r217565) +++ head/sys/dev/xen/netback/netback.c Wed Jan 19 00:57:58 2011 (r217566) @@ -1511,11 +1511,11 @@ vif_attach(device_t dev) "handle of frontend"); #ifdef XEN_NETBACK_DEBUG SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "txring", CTLFLAG_RD, + OID_AUTO, "txring", CTLTYPE_STRING | CTLFLAG_RD, dev, VIF_SYSCTL_TXRING, vif_sysctl_handler, "A", "tx ring info"); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "rxring", CTLFLAG_RD, + OID_AUTO, "rxring", CTLTYPE_STRING | CTLFLAG_RD, dev, VIF_SYSCTL_RXRING, vif_sysctl_handler, "A", "rx ring info"); #endif Modified: head/sys/xen/xenbus/xenbusb.c ============================================================================== --- head/sys/xen/xenbus/xenbusb.c Tue Jan 18 23:35:08 2011 (r217565) +++ head/sys/xen/xenbus/xenbusb.c Wed Jan 19 00:57:58 2011 (r217566) @@ -308,7 +308,7 @@ xenbusb_device_sysctl_init(device_t dev) SYSCTL_CHILDREN(tree), OID_AUTO, "xenstore_path", - CTLFLAG_RD, + CTLTYPE_STRING | CTLFLAG_RD, dev, XENBUS_IVAR_NODE, xenbusb_device_sysctl_handler, @@ -319,7 +319,7 @@ xenbusb_device_sysctl_init(device_t dev) SYSCTL_CHILDREN(tree), OID_AUTO, "xenbus_dev_type", - CTLFLAG_RD, + CTLTYPE_STRING | CTLFLAG_RD, dev, XENBUS_IVAR_TYPE, xenbusb_device_sysctl_handler, @@ -330,7 +330,7 @@ xenbusb_device_sysctl_init(device_t dev) SYSCTL_CHILDREN(tree), OID_AUTO, "xenbus_connection_state", - CTLFLAG_RD, + CTLTYPE_STRING | CTLFLAG_RD, dev, XENBUS_IVAR_STATE, xenbusb_device_sysctl_handler, @@ -341,7 +341,7 @@ xenbusb_device_sysctl_init(device_t dev) SYSCTL_CHILDREN(tree), OID_AUTO, "xenbus_peer_domid", - CTLFLAG_RD, + CTLTYPE_INT | CTLFLAG_RD, dev, XENBUS_IVAR_OTHEREND_ID, xenbusb_device_sysctl_handler, @@ -352,7 +352,7 @@ xenbusb_device_sysctl_init(device_t dev) SYSCTL_CHILDREN(tree), OID_AUTO, "xenstore_peer_path", - CTLFLAG_RD, + CTLTYPE_STRING | CTLFLAG_RD, dev, XENBUS_IVAR_OTHEREND_PATH, xenbusb_device_sysctl_handler, From owner-svn-src-all@FreeBSD.ORG Wed Jan 19 01:26:49 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A5B6D106566B; Wed, 19 Jan 2011 01:26:49 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 79FE08FC24; Wed, 19 Jan 2011 01:26:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0J1QnY9058353; Wed, 19 Jan 2011 01:26:49 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0J1Qnam058351; Wed, 19 Jan 2011 01:26:49 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201101190126.p0J1Qnam058351@svn.freebsd.org> From: Rick Macklem Date: Wed, 19 Jan 2011 01:26:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217567 - stable/8/sys/fs/nfsserver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 01:26:49 -0000 Author: rmacklem Date: Wed Jan 19 01:26:49 2011 New Revision: 217567 URL: http://svn.freebsd.org/changeset/base/217567 Log: MFC: r217176 Modify readdirplus in the experimental NFS server in a manner analogous to r216633 for the regular server. This change busies the file system so that VFS_VGET() is guaranteed to be using the correct mount point even during a forced dismount attempt. Since nfsd_fhtovp() is not called immediately before readdirplus, the patch is actually a clone of pjd@'s nfs_serv.c.4.patch instead of the one committed in r216633. Modified: stable/8/sys/fs/nfsserver/nfs_nfsdport.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdport.c Wed Jan 19 00:57:58 2011 (r217566) +++ stable/8/sys/fs/nfsserver/nfs_nfsdport.c Wed Jan 19 01:26:49 2011 (r217567) @@ -1685,6 +1685,7 @@ nfsrvd_readdirplus(struct nfsrv_descript struct iovec iv; struct componentname cn; int not_zfs; + struct mount *mp; if (nd->nd_repstat) { nfsrv_postopattr(nd, getret, &at); @@ -1854,7 +1855,24 @@ again: toff = off; goto again; } + + /* + * Busy the file system so that the mount point won't go away + * and, as such, VFS_VGET() can be used safely. + */ + mp = vp->v_mount; + vfs_ref(mp); VOP_UNLOCK(vp, 0); + nd->nd_repstat = vfs_busy(mp, 0); + vfs_rel(mp); + if (nd->nd_repstat != 0) { + vrele(vp); + free(cookies, M_TEMP); + free(rbuf, M_TEMP); + if (nd->nd_flag & ND_NFSV3) + nfsrv_postopattr(nd, getret, &at); + return (0); + } /* * Save this position, in case there is an error before one entry @@ -1914,9 +1932,8 @@ again: vp, dp->d_fileno); if (refp == NULL) { if (usevget) - r = VFS_VGET(vp->v_mount, - dp->d_fileno, LK_SHARED, - &nvp); + r = VFS_VGET(mp, dp->d_fileno, + LK_SHARED, &nvp); else r = EOPNOTSUPP; if (r == EOPNOTSUPP) { @@ -2035,6 +2052,7 @@ again: ncookies--; } vrele(vp); + vfs_unbusy(mp); /* * If dirlen > cnt, we must strip off the last entry. If that From owner-svn-src-all@FreeBSD.ORG Wed Jan 19 03:59:31 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A496106564A; Wed, 19 Jan 2011 03:59:31 +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 298848FC13; Wed, 19 Jan 2011 03:59:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0J3xVxw062473; Wed, 19 Jan 2011 03:59:31 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0J3xVAf062471; Wed, 19 Jan 2011 03:59:31 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201101190359.p0J3xVAf062471@svn.freebsd.org> From: Warner Losh Date: Wed, 19 Jan 2011 03:59:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217569 - stable/8/usr.bin/chpass X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 03:59:31 -0000 Author: imp Date: Wed Jan 19 03:59:30 2011 New Revision: 217569 URL: http://svn.freebsd.org/changeset/base/217569 Log: MFC r204707 by scottl Ignore the result of the chflags operation to allow it to continue when doing an installation over NFS. Modified: stable/8/usr.bin/chpass/Makefile (contents, props changed) Modified: stable/8/usr.bin/chpass/Makefile ============================================================================== --- stable/8/usr.bin/chpass/Makefile Wed Jan 19 03:10:24 2011 (r217568) +++ stable/8/usr.bin/chpass/Makefile Wed Jan 19 03:59:30 2011 (r217569) @@ -44,7 +44,7 @@ beforeinstall: .if !defined(NO_FSCHG) afterinstall: - chflags schg ${DESTDIR}${BINDIR}/chpass + -chflags schg ${DESTDIR}${BINDIR}/chpass .endif .include From owner-svn-src-all@FreeBSD.ORG Wed Jan 19 05:08:33 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A383106564A; Wed, 19 Jan 2011 05:08:33 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 192E88FC0A; Wed, 19 Jan 2011 05:08:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0J58Wdt064098; Wed, 19 Jan 2011 05:08:32 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0J58WLo064096; Wed, 19 Jan 2011 05:08:32 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201101190508.p0J58WLo064096@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Wed, 19 Jan 2011 05:08:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217571 - stable/8/sys/geom/nop X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 05:08:33 -0000 Author: ae Date: Wed Jan 19 05:08:32 2011 New Revision: 217571 URL: http://svn.freebsd.org/changeset/base/217571 Log: MFC r217303: Sector size can not be greater than MAXPHYS. Modified: stable/8/sys/geom/nop/g_nop.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/geom/nop/g_nop.c ============================================================================== --- stable/8/sys/geom/nop/g_nop.c Wed Jan 19 04:28:51 2011 (r217570) +++ stable/8/sys/geom/nop/g_nop.c Wed Jan 19 05:08:32 2011 (r217571) @@ -176,6 +176,10 @@ g_nop_create(struct gctl_req *req, struc gctl_error(req, "Invalid secsize for provider %s.", pp->name); return (EINVAL); } + if (secsize > MAXPHYS) { + gctl_error(req, "secsize is too big."); + return (EINVAL); + } size -= size % secsize; snprintf(name, sizeof(name), "%s%s", pp->name, G_NOP_SUFFIX); LIST_FOREACH(gp, &mp->geom, geom) { From owner-svn-src-all@FreeBSD.ORG Wed Jan 19 05:13:40 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9323710656A4; Wed, 19 Jan 2011 05:13:40 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6706E8FC15; Wed, 19 Jan 2011 05:13:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0J5DeI6064264; Wed, 19 Jan 2011 05:13:40 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0J5De2D064261; Wed, 19 Jan 2011 05:13:40 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201101190513.p0J5De2D064261@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Wed, 19 Jan 2011 05:13:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217572 - in stable/8: sbin/geom/class/raid3 sbin/geom/class/sched sys/geom/raid3 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 05:13:40 -0000 Author: ae Date: Wed Jan 19 05:13:40 2011 New Revision: 217572 URL: http://svn.freebsd.org/changeset/base/217572 Log: MFC r217305: Sector size can not be greater than MAXPHYS. Since GRAID3 calculates sector size from user-specified block size, report to user about big blocksize. PR: kern/147851 Modified: stable/8/sbin/geom/class/raid3/geom_raid3.c stable/8/sys/geom/raid3/g_raid3.c Directory Properties: stable/8/sbin/geom/ (props changed) stable/8/sbin/geom/class/multipath/ (props changed) stable/8/sbin/geom/class/part/ (props changed) stable/8/sbin/geom/class/sched/gsched.8 (props changed) stable/8/sbin/geom/class/stripe/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sbin/geom/class/raid3/geom_raid3.c ============================================================================== --- stable/8/sbin/geom/class/raid3/geom_raid3.c Wed Jan 19 05:08:32 2011 (r217571) +++ stable/8/sbin/geom/class/raid3/geom_raid3.c Wed Jan 19 05:13:40 2011 (r217572) @@ -212,6 +212,11 @@ raid3_label(struct gctl_req *req) md.md_sectorsize = sectorsize * (nargs - 2); md.md_mediasize -= (md.md_mediasize % md.md_sectorsize); + if (md.md_sectorsize > MAXPHYS) { + gctl_error(req, "The blocksize is too big."); + return; + } + /* * Clear last sector first, to spoil all components if device exists. */ Modified: stable/8/sys/geom/raid3/g_raid3.c ============================================================================== --- stable/8/sys/geom/raid3/g_raid3.c Wed Jan 19 05:08:32 2011 (r217571) +++ stable/8/sys/geom/raid3/g_raid3.c Wed Jan 19 05:13:40 2011 (r217572) @@ -2913,6 +2913,10 @@ g_raid3_read_metadata(struct g_consumer cp->provider->name); return (error); } + if (md->md_sectorsize > MAXPHYS) { + G_RAID3_DEBUG(0, "The blocksize is too big."); + return (EINVAL); + } return (0); } From owner-svn-src-all@FreeBSD.ORG Wed Jan 19 07:06:29 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 20A601065670; Wed, 19 Jan 2011 07:06:29 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0FE908FC18; Wed, 19 Jan 2011 07:06:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0J76SQo066666; Wed, 19 Jan 2011 07:06:28 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0J76SlN066664; Wed, 19 Jan 2011 07:06:28 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201101190706.p0J76SlN066664@svn.freebsd.org> From: Juli Mallett Date: Wed, 19 Jan 2011 07: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: r217573 - head/sys/mips/cavium X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 07:06:29 -0000 Author: jmallett Date: Wed Jan 19 07:06:28 2011 New Revision: 217573 URL: http://svn.freebsd.org/changeset/base/217573 Log: Don't do a device_identify to add uart0, it's already hinted. Reported by: imp Modified: head/sys/mips/cavium/uart_bus_octeonusart.c Modified: head/sys/mips/cavium/uart_bus_octeonusart.c ============================================================================== --- head/sys/mips/cavium/uart_bus_octeonusart.c Wed Jan 19 05:13:40 2011 (r217572) +++ head/sys/mips/cavium/uart_bus_octeonusart.c Wed Jan 19 07:06:28 2011 (r217573) @@ -63,7 +63,6 @@ extern struct uart_class uart_oct16550_c static int uart_octeon_probe(device_t dev); -static void octeon_uart_identify(driver_t * drv, device_t parent); extern struct uart_class octeon_uart_class; @@ -72,7 +71,6 @@ static device_method_t uart_octeon_metho DEVMETHOD(device_probe, uart_octeon_probe), DEVMETHOD(device_attach, uart_bus_attach), DEVMETHOD(device_detach, uart_bus_detach), - DEVMETHOD(device_identify, octeon_uart_identify), {0, 0} }; @@ -113,10 +111,4 @@ uart_octeon_probe(device_t dev) return (uart_bus_probe(dev, sc->sc_bas.regshft, 0, 0, unit)); } -static void -octeon_uart_identify(driver_t * drv, device_t parent) -{ - BUS_ADD_CHILD(parent, 0, "uart", 0); -} - DRIVER_MODULE(uart, obio, uart_octeon_driver, uart_devclass, 0, 0); From owner-svn-src-all@FreeBSD.ORG Wed Jan 19 07:44:47 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B1701065675; Wed, 19 Jan 2011 07:44:47 +0000 (UTC) (envelope-from simon@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 69DD48FC14; Wed, 19 Jan 2011 07:44:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0J7ilY1067521; Wed, 19 Jan 2011 07:44:47 GMT (envelope-from simon@svn.freebsd.org) Received: (from simon@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0J7il5g067518; Wed, 19 Jan 2011 07:44:47 GMT (envelope-from simon@svn.freebsd.org) Message-Id: <201101190744.p0J7il5g067518@svn.freebsd.org> From: "Simon L. Nielsen" Date: Wed, 19 Jan 2011 07:44:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217574 - in releng/7.4/secure/lib: libcrypto libssl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 07:44:47 -0000 Author: simon Date: Wed Jan 19 07:44:47 2011 New Revision: 217574 URL: http://svn.freebsd.org/changeset/base/217574 Log: MFS7 r217562: Decrease the libcrypto and libssl shared object version numbers from 6 to 5. They were accidentally bumped in r215997 (on 2010-11-28) with the merge of OpenSSL 0.9.8p, but unfortunately this was not caught until now. Also add compat links for libcrypto.so.6 / libssl.so.6 (pointing to their .5 counterparts) in case any users have compiled any third party during the time stable/7 (and releng/7.4) were broken. This is deemed the last poor of bad options. Had the number bump not been reverted binary packages for stable/7 would not have worked on the still supported 7.3 and 7.1 releases. Approved by: re (kensmith) Modified: releng/7.4/secure/lib/libcrypto/Makefile releng/7.4/secure/lib/libssl/Makefile Directory Properties: releng/7.4/secure/lib/libcrypto/ (props changed) releng/7.4/secure/lib/libssl/ (props changed) Modified: releng/7.4/secure/lib/libcrypto/Makefile ============================================================================== --- releng/7.4/secure/lib/libcrypto/Makefile Wed Jan 19 07:06:28 2011 (r217573) +++ releng/7.4/secure/lib/libcrypto/Makefile Wed Jan 19 07:44:47 2011 (r217574) @@ -6,7 +6,9 @@ SUBDIR= engines .include LIB= crypto -SHLIB_MAJOR= 6 +SHLIB_MAJOR= 5 + +SYMLINKS= lib${LIB}.so.5 ${SHLIBDIR}/lib${LIB}.so.6 NO_LINT= Modified: releng/7.4/secure/lib/libssl/Makefile ============================================================================== --- releng/7.4/secure/lib/libssl/Makefile Wed Jan 19 07:06:28 2011 (r217573) +++ releng/7.4/secure/lib/libssl/Makefile Wed Jan 19 07:44:47 2011 (r217574) @@ -1,7 +1,9 @@ # $FreeBSD$ LIB= ssl -SHLIB_MAJOR= 6 +SHLIB_MAJOR= 5 + +SYMLINKS= lib${LIB}.so.5 ${SHLIBDIR}/lib${LIB}.so.6 NO_LINT= From owner-svn-src-all@FreeBSD.ORG Wed Jan 19 08:00:27 2011 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0601106566B; Wed, 19 Jan 2011 08:00:27 +0000 (UTC) (envelope-from peterjeremy@acm.org) Received: from fallbackmx08.syd.optusnet.com.au (fallbackmx08.syd.optusnet.com.au [211.29.132.10]) by mx1.freebsd.org (Postfix) with ESMTP id 4A4558FC16; Wed, 19 Jan 2011 08:00:26 +0000 (UTC) Received: from mail34.syd.optusnet.com.au (mail34.syd.optusnet.com.au [211.29.133.218]) by fallbackmx08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p0J5udlT007393; Wed, 19 Jan 2011 16:56:39 +1100 Received: from server.vk2pj.dyndns.org (c220-239-116-103.belrs4.nsw.optusnet.com.au [220.239.116.103]) by mail34.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p0J5uZaX021605 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 19 Jan 2011 16:56:36 +1100 X-Bogosity: Ham, spamicity=0.000000 Received: from server.vk2pj.dyndns.org (localhost.vk2pj.dyndns.org [127.0.0.1]) by server.vk2pj.dyndns.org (8.14.4/8.14.4) with ESMTP id p0J5uZdi091041; Wed, 19 Jan 2011 16:56:35 +1100 (EST) (envelope-from peter@server.vk2pj.dyndns.org) Received: (from peter@localhost) by server.vk2pj.dyndns.org (8.14.4/8.14.4/Submit) id p0J5uZb5091040; Wed, 19 Jan 2011 16:56:35 +1100 (EST) (envelope-from peter) Date: Wed, 19 Jan 2011 16:56:35 +1100 From: Peter Jeremy To: John Baldwin Message-ID: <20110119055635.GA90983@server.vk2pj.dyndns.org> References: <201101181523.p0IFNGeB042079@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="rwEMma7ioTxnRzrJ" Content-Disposition: inline In-Reply-To: <201101181523.p0IFNGeB042079@svn.freebsd.org> X-PGP-Key: http://members.optusnet.com.au/peterjeremy/pubkey.asc User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r217538 - in head/sys/dev: buslogic cs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 08:00:27 -0000 --rwEMma7ioTxnRzrJ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2011-Jan-18 15:23:16 +0000, John Baldwin wrote: >Log: > Remove some always-true comparisons. =2E.. >--- head/sys/dev/cs/if_cs.c Tue Jan 18 14:58:44 2011 (r217537) >+++ head/sys/dev/cs/if_cs.c Tue Jan 18 15:23:16 2011 (r217538) >@@ -364,7 +364,7 @@ cs_cs89x0_probe(device_t dev) >=20 > if (!error && !(sc->flags & CS_NO_IRQ)) { > if (chip_type =3D=3D CS8900) { >- if (irq >=3D 0 || irq < 16) >+ if (irq < 16) > irq =3D cs8900_irq2eeint[irq]; > else > irq =3D 255; Irrespective of the signedness or otherwise of "irq", I'm fairly certain that '||' should have been '&&' before. --=20 Peter Jeremy --rwEMma7ioTxnRzrJ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.15 (FreeBSD) iEYEARECAAYFAk02fRMACgkQ/opHv/APuIcsmQCggV/6tmuYKpkcgsSM9/XGvRwh HfEAnA1Zxh0rptCg9lEITD24IJDSnrFx =HmtV -----END PGP SIGNATURE----- --rwEMma7ioTxnRzrJ-- From owner-svn-src-all@FreeBSD.ORG Wed Jan 19 09:59:54 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6840A106564A; Wed, 19 Jan 2011 09:59:54 +0000 (UTC) (envelope-from fjoe@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 575438FC15; Wed, 19 Jan 2011 09:59:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0J9xsMf070953; Wed, 19 Jan 2011 09:59:54 GMT (envelope-from fjoe@svn.freebsd.org) Received: (from fjoe@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0J9xs2U070951; Wed, 19 Jan 2011 09:59:54 GMT (envelope-from fjoe@svn.freebsd.org) Message-Id: <201101190959.p0J9xs2U070951@svn.freebsd.org> From: Max Khon Date: Wed, 19 Jan 2011 09:59:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217576 - stable/8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 09:59:54 -0000 Author: fjoe Date: Wed Jan 19 09:59:54 2011 New Revision: 217576 URL: http://svn.freebsd.org/changeset/base/217576 Log: Fix buildworld on pre-8.2. PR: 153947 Modified: stable/8/Makefile.inc1 Modified: stable/8/Makefile.inc1 ============================================================================== --- stable/8/Makefile.inc1 Wed Jan 19 09:47:20 2011 (r217575) +++ stable/8/Makefile.inc1 Wed Jan 19 09:59:54 2011 (r217576) @@ -926,6 +926,10 @@ _groff= gnu/usr.bin/groff/tmac _ar= usr.bin/ar .endif +.if ${BOOTSTRAPPING} < 802000 +_lex= usr.bin/lex +.endif + .if ${BOOTSTRAPPING} < 800013 _mklocale= usr.bin/mklocale .endif @@ -951,6 +955,7 @@ bootstrap-tools: ${_gperf} \ ${_groff} \ ${_ar} \ + ${_lex} \ usr.bin/lorder \ usr.bin/makewhatis \ ${_mklocale} \ From owner-svn-src-all@FreeBSD.ORG Wed Jan 19 10:30:49 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B3080106566C; Wed, 19 Jan 2011 10:30:49 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A285F8FC16; Wed, 19 Jan 2011 10:30:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0JAUnR7073215; Wed, 19 Jan 2011 10:30:49 GMT (envelope-from maxim@svn.freebsd.org) Received: (from maxim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0JAUnIb073213; Wed, 19 Jan 2011 10:30:49 GMT (envelope-from maxim@svn.freebsd.org) Message-Id: <201101191030.p0JAUnIb073213@svn.freebsd.org> From: Maxim Konovalov Date: Wed, 19 Jan 2011 10:30: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: r217577 - head/share/misc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 10:30:49 -0000 Author: maxim Date: Wed Jan 19 10:30:49 2011 New Revision: 217577 URL: http://svn.freebsd.org/changeset/base/217577 Log: o Correct version of DragonFly: it was 2.8.2 released, not 2.8.0. Submitted by: Sascha Wildner Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree ============================================================================== --- head/share/misc/bsd-family-tree Wed Jan 19 09:59:54 2011 (r217576) +++ head/share/misc/bsd-family-tree Wed Jan 19 10:30:49 2011 (r217577) @@ -239,7 +239,7 @@ FreeBSD 5.2 | | | | | | | OpenBSD 4.7 | | FreeBSD | | | | | | 8.1 | | | | | - | | | | | | DragonFly 2.8.0 + | | | | | | DragonFly 2.8.2 | | | | | OpenBSD 4.8 | | V | | NetBSD 5.1 | | | | | | | @@ -521,7 +521,7 @@ FreeBSD 7.3 2010-03-23 [FBD] DragonFly 2.6.0 2010-03-28 [DFB] OpenBSD 4.7 2010-05-19 [OBD] FreeBSD 8.1 2010-07-24 [FBD] -DragonFly 2.8.0 2010-10-30 [DFB] +DragonFly 2.8.2 2010-10-30 [DFB] OpenBSD 4.8 2010-11-01 [OBD] NetBSD 5.1 2010-11-19 [NBD] From owner-svn-src-all@FreeBSD.ORG Wed Jan 19 12:19:26 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 70FA9106566C; Wed, 19 Jan 2011 12:19:26 +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 608598FC13; Wed, 19 Jan 2011 12:19:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0JCJQwo075717; Wed, 19 Jan 2011 12:19:26 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0JCJQq3075715; Wed, 19 Jan 2011 12:19:26 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201101191219.p0JCJQq3075715@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 19 Jan 2011 12:19:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217578 - head/sys/compat/linux X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 12:19:26 -0000 Author: kib Date: Wed Jan 19 12:19:25 2011 New Revision: 217578 URL: http://svn.freebsd.org/changeset/base/217578 Log: In linuxolator getdents_common(), it seems there is no reason to loop if no records where returned by VOP_READDIR(). Readdir implementations allowed to return 0 records when first record is larger then supplied buffer. In this case trying to execute VOP_READDIR() again causes the syscall looping forewer. The goto was there from the day 1, which goes back to 1995 year. Reported and tested by: Beat G?tzi MFC after: 2 weeks Modified: head/sys/compat/linux/linux_file.c Modified: head/sys/compat/linux/linux_file.c ============================================================================== --- head/sys/compat/linux/linux_file.c Wed Jan 19 10:30:49 2011 (r217577) +++ head/sys/compat/linux/linux_file.c Wed Jan 19 12:19:25 2011 (r217578) @@ -369,7 +369,6 @@ getdents_common(struct thread *td, struc lbuf = malloc(LINUX_MAXRECLEN, M_TEMP, M_WAITOK | M_ZERO); vn_lock(vp, LK_SHARED | LK_RETRY); -again: aiov.iov_base = buf; aiov.iov_len = buflen; auio.uio_iov = &aiov; @@ -506,8 +505,10 @@ again: break; } - if (outp == (caddr_t)args->dirent) - goto again; + if (outp == (caddr_t)args->dirent) { + nbytes = resid; + goto eof; + } fp->f_offset = off; if (justone) From owner-svn-src-all@FreeBSD.ORG Wed Jan 19 12:24:54 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D5AA1065702; Wed, 19 Jan 2011 12:24:54 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 032D38FC23; Wed, 19 Jan 2011 12:24:53 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id p0JCOogk084073 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 19 Jan 2011 14:24:50 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id p0JCOoL4017507; Wed, 19 Jan 2011 14:24:50 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id p0JCOn6S017506; Wed, 19 Jan 2011 14:24:49 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 19 Jan 2011 14:24:49 +0200 From: Kostik Belousov To: John-Mark Gurney Message-ID: <20110119122449.GX2518@deviant.kiev.zoral.com.ua> References: <201101182157.p0ILv2o1053343@svn.freebsd.org> <20110118225132.GD66284@funkthat.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="XauJzKcUIZVdj07X" Content-Disposition: inline In-Reply-To: <20110118225132.GD66284@funkthat.com> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r217561 - in head/sys: arm/arm i386/i386 mips/mips powerpc/aim powerpc/booke sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 12:24:54 -0000 --XauJzKcUIZVdj07X Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jan 18, 2011 at 02:51:32PM -0800, John-Mark Gurney wrote: > Konstantin Belousov wrote this message on Tue, Jan 18, 2011 at 21:57 +000= 0: > > sf_buf_alloc() calls msleep(PCATCH) when SFB_CATCH flag was given, > > and for simultaneous wakeup and signal delivery, msleep() returns > > EINTR/ERESTART despite the thread was selected for wakeup_one(). As > > result, we loose a wakeup, and some other waiter will not be woken up. >=20 > Shouldn't this behavior be documented in the man page? That even > though msleep may return a non-zero value that it could have been > really woken up? Can you provide the good wording ? And commit it then ? --XauJzKcUIZVdj07X Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk022BEACgkQC3+MBN1Mb4gk4QCeKyulo5osV+oeZ482/9Y7XCxi lHgAoPKyZW5dFyuLf/EQId+c7Iz8bZE5 =ylCo -----END PGP SIGNATURE----- --XauJzKcUIZVdj07X-- From owner-svn-src-all@FreeBSD.ORG Wed Jan 19 13:23:51 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 735531065670; Wed, 19 Jan 2011 13:23:51 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 427088FC16; Wed, 19 Jan 2011 13:23:51 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id C982846B7F; Wed, 19 Jan 2011 08:23:50 -0500 (EST) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 05F2E8A01D; Wed, 19 Jan 2011 08:23:50 -0500 (EST) From: John Baldwin To: "Simon L. Nielsen" Date: Wed, 19 Jan 2011 08:07:46 -0500 User-Agent: KMail/1.13.5 (FreeBSD/7.4-CBSD-20110107; KDE/4.4.5; amd64; ; ) References: <201101182219.p0IMJt9D053996@svn.freebsd.org> In-Reply-To: <201101182219.p0IMJt9D053996@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201101190807.46537.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Wed, 19 Jan 2011 08:23:50 -0500 (EST) X-Virus-Scanned: clamav-milter 0.96.3 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.9 required=4.2 tests=BAYES_00 autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bigwig.baldwin.cx Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-7@freebsd.org Subject: Re: svn commit: r217562 - in stable/7/secure/lib: libcrypto libssl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 13:23:51 -0000 On Tuesday, January 18, 2011 5:19:55 pm Simon L. Nielsen wrote: > Author: simon > Date: Tue Jan 18 22:19:55 2011 > New Revision: 217562 > URL: http://svn.freebsd.org/changeset/base/217562 > > Log: > Decrease the libcrypto and libssl shared object version numbers from 6 > to 5. They were accidentally bumped in r215997 (on 2010-11-28) with the > merge of OpenSSL 0.9.8p, but unfortunately this was not caught until > now. > > Also add compat links for libcrypto.so.6 / libssl.so.6 (pointing to > their .5 counterparts) in case any users have compiled any third party > during the time stable/7 (and releng/7.4) were broken. > > This is deemed the last poor of bad options. Had the number bump not > been reverted binary packages for stable/7 would not have worked on the > still supported 7.3 and 7.1 releases. Erm, shouldn't the packages for 7-stable be built against the 7.0 ABI instead (and I thought this change was already made)? We've only supported backwards compat, not forwards compat. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Wed Jan 19 13:23:53 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76D58106566B; Wed, 19 Jan 2011 13:23:53 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 4674A8FC1B; Wed, 19 Jan 2011 13:23:53 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id E423046B66; Wed, 19 Jan 2011 08:23:52 -0500 (EST) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 1A9778A009; Wed, 19 Jan 2011 08:23:52 -0500 (EST) From: John Baldwin To: Peter Jeremy Date: Wed, 19 Jan 2011 08:15:40 -0500 User-Agent: KMail/1.13.5 (FreeBSD/7.4-CBSD-20110107; KDE/4.4.5; amd64; ; ) References: <201101181523.p0IFNGeB042079@svn.freebsd.org> <20110119055635.GA90983@server.vk2pj.dyndns.org> In-Reply-To: <20110119055635.GA90983@server.vk2pj.dyndns.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201101190815.40908.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Wed, 19 Jan 2011 08:23:52 -0500 (EST) X-Virus-Scanned: clamav-milter 0.96.3 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.9 required=4.2 tests=BAYES_00 autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r217538 - in head/sys/dev: buslogic cs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 13:23:53 -0000 On Wednesday, January 19, 2011 12:56:35 am Peter Jeremy wrote: > On 2011-Jan-18 15:23:16 +0000, John Baldwin wrote: > >Log: > > Remove some always-true comparisons. > ... > >--- head/sys/dev/cs/if_cs.c Tue Jan 18 14:58:44 2011 (r217537) > >+++ head/sys/dev/cs/if_cs.c Tue Jan 18 15:23:16 2011 (r217538) > >@@ -364,7 +364,7 @@ cs_cs89x0_probe(device_t dev) > > > > if (!error && !(sc->flags & CS_NO_IRQ)) { > > if (chip_type == CS8900) { > >- if (irq >= 0 || irq < 16) > >+ if (irq < 16) > > irq = cs8900_irq2eeint[irq]; > > else > > irq = 255; > > Irrespective of the signedness or otherwise of "irq", I'm fairly > certain that '||' should have been '&&' before. Agreed. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Wed Jan 19 13:30:17 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E7DCA10656AE; Wed, 19 Jan 2011 13:30:17 +0000 (UTC) (envelope-from erwin@mail.droso.net) Received: from mail.droso.net (grizzly.droso.net [IPv6:2a01:4f8:130:7021::5]) by mx1.freebsd.org (Postfix) with ESMTP id A6CEC8FC1C; Wed, 19 Jan 2011 13:30:17 +0000 (UTC) Received: by mail.droso.net (Postfix, from userid 1001) id 7FD363C663; Wed, 19 Jan 2011 14:30:16 +0100 (CET) Date: Wed, 19 Jan 2011 14:30:16 +0100 From: Erwin Lansing To: John Baldwin Message-ID: <20110119133016.GP67325@droso.net> References: <201101182219.p0IMJt9D053996@svn.freebsd.org> <201101190807.46537.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="RTi+10T5cI4L/4/E" Content-Disposition: inline In-Reply-To: <201101190807.46537.jhb@freebsd.org> X-Operating-System: FreeBSD/amd64 8.1-RELEASE User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-7@freebsd.org, "Simon L. Nielsen" Subject: Re: svn commit: r217562 - in stable/7/secure/lib: libcrypto libssl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 13:30:18 -0000 --RTi+10T5cI4L/4/E Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jan 19, 2011 at 08:07:46AM -0500, John Baldwin wrote: > On Tuesday, January 18, 2011 5:19:55 pm Simon L. Nielsen wrote: > > Author: simon > > Date: Tue Jan 18 22:19:55 2011 > > New Revision: 217562 > > URL: http://svn.freebsd.org/changeset/base/217562 > >=20 > > Log: > > Decrease the libcrypto and libssl shared object version numbers from 6 > > to 5. They were accidentally bumped in r215997 (on 2010-11-28) with t= he > > merge of OpenSSL 0.9.8p, but unfortunately this was not caught until > > now. > > =20 > > Also add compat links for libcrypto.so.6 / libssl.so.6 (pointing to > > their .5 counterparts) in case any users have compiled any third party > > during the time stable/7 (and releng/7.4) were broken. > > =20 > > This is deemed the last poor of bad options. Had the number bump not > > been reverted binary packages for stable/7 would not have worked on t= he > > still supported 7.3 and 7.1 releases. >=20 > Erm, shouldn't the packages for 7-stable be built against the 7.0 ABI ins= tead=20 > (and I thought this change was already made)? We've only supported backw= ards=20 > compat, not forwards compat. >=20 Oldest supported by the security officer, currently 7.1-RELEASE-p16 to be exact, but yes. Those are built against libcrypto.so.5, which of course won't work on 7.4 with libcrypto.so.6, hence the above rollback with an added symlink for those people that already built binaries themselves against libcrypto.so.6. -erwin --=20 Erwin Lansing http://droso.org Prediction is very difficult especially about the future erwin@FreeBSD.org --RTi+10T5cI4L/4/E Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iD8DBQFNNudoqy9aWxUlaZARAo5jAKD+AltMRDOdGqw0zrR0mxLO1DTsNQCdGjyv B50t/jvDIQWO4VL/uOVYAlg= =rGhE -----END PGP SIGNATURE----- --RTi+10T5cI4L/4/E-- From owner-svn-src-all@FreeBSD.ORG Wed Jan 19 14:47:52 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B83D9106566C; Wed, 19 Jan 2011 14:47:52 +0000 (UTC) (envelope-from kensmith@buffalo.edu) Received: from localmailC.acsu.buffalo.edu (localmailC.acsu.buffalo.edu [128.205.5.204]) by mx1.freebsd.org (Postfix) with ESMTP id 47A088FC19; Wed, 19 Jan 2011 14:47:52 +0000 (UTC) Received: from localmailC.acsu.buffalo.edu (localhost [127.0.0.1]) by localhost (Postfix) with SMTP id 415E221CF3; Wed, 19 Jan 2011 09:19:03 -0500 (EST) Received: from localmailC.acsu.buffalo.edu (localhost [127.0.0.1]) by localmailC.acsu.buffalo.edu (Postfix) with ESMTP id 665FE218C3; Wed, 19 Jan 2011 09:19:02 -0500 (EST) Received: from mweb1.acsu.buffalo.edu (mweb1.acsu.buffalo.edu [128.205.5.238]) by localmailC.acsu.buffalo.edu (Prefixe) with ESMTP id 584D921928; Wed, 19 Jan 2011 09:19:02 -0500 (EST) Received: from [128.205.32.76] (bauer.cse.buffalo.edu [128.205.32.76]) by mweb1.acsu.buffalo.edu (Postfix) with ESMTP id 375CD5B003B; Wed, 19 Jan 2011 09:19:02 -0500 (EST) From: Ken Smith To: Erwin Lansing In-Reply-To: <20110119133016.GP67325@droso.net> References: <201101182219.p0IMJt9D053996@svn.freebsd.org> <201101190807.46537.jhb@freebsd.org> <20110119133016.GP67325@droso.net> Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-wMFTjbLQ5I5M3hVenQWQ" Date: Wed, 19 Jan 2011 09:18:52 -0500 Message-ID: <1295446732.93258.5.camel@bauer.cse.buffalo.edu> Mime-Version: 1.0 X-Mailer: Evolution 2.28.2 FreeBSD GNOME Team Port X-PM-EL-Spam-Prob: : 8% Cc: src-committers@freebsd.org, John Baldwin , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, "Simon L. Nielsen" , svn-src-stable-7@freebsd.org Subject: Re: svn commit: r217562 - in stable/7/secure/lib: libcrypto libssl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 14:47:52 -0000 --=-wMFTjbLQ5I5M3hVenQWQ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable On Wed, 2011-01-19 at 14:30 +0100, Erwin Lansing wrote: > ... hence the above rollback > with an added symlink for those people that already built binaries > themselves against libcrypto.so.6. We have had mistakes show up briefly on stable/* branches in the past. I stand by the view that stable/* branches are development branches where this sort of thing can periodically happen so people running production systems on stable/* branches may need to live with doing a little cleanup if/when this sort of thing happens. But in this case it had been in stable/7 for a while *and* it appeared in a releng/* branch that we've been asking people to test for us as part of the 7.4-RELEASE process. So in this case I asked we try the symlink thing to see if that can lessen the impact on people who have been helping with the tests (given up to now I haven't been providing packages on the ISOs that increases the odds testers have been compiling stuff...). --=20 Ken Smith - From there to here, from here to | kensmith@buffalo.edu there, funny things are everywhere. | - Theodor Geisel | --=-wMFTjbLQ5I5M3hVenQWQ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEABECAAYFAk028sIACgkQ/G14VSmup/bmVQCfVgHLQCRq59Gb7mK86lrHja6S H4kAniiIfyisxCXlON3mydztiQSoTISg =6aQG -----END PGP SIGNATURE----- --=-wMFTjbLQ5I5M3hVenQWQ-- From owner-svn-src-all@FreeBSD.ORG Wed Jan 19 15:12:39 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0517D1065693; Wed, 19 Jan 2011 15:12:39 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CD8AC8FC08; Wed, 19 Jan 2011 15:12:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0JFCcQB079966; Wed, 19 Jan 2011 15:12:38 GMT (envelope-from keramida@svn.freebsd.org) Received: (from keramida@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0JFCc5W079964; Wed, 19 Jan 2011 15:12:38 GMT (envelope-from keramida@svn.freebsd.org) Message-Id: <201101191512.p0JFCc5W079964@svn.freebsd.org> From: Giorgos Keramidas Date: Wed, 19 Jan 2011 15:12:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217579 - stable/7/share/man/man7 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 15:12:39 -0000 Author: keramida (doc committer) Date: Wed Jan 19 15:12:38 2011 New Revision: 217579 URL: http://svn.freebsd.org/changeset/base/217579 Log: MFC -r 186783 from /head Document the NO_XXX options supported by our Makefile.inc1. Noticed by: simon Reviewed by: imp Modified: stable/7/share/man/man7/build.7 Directory Properties: stable/7/share/man/man7/ (props changed) Modified: stable/7/share/man/man7/build.7 ============================================================================== --- stable/7/share/man/man7/build.7 Wed Jan 19 12:19:25 2011 (r217578) +++ stable/7/share/man/man7/build.7 Wed Jan 19 15:12:38 2011 (r217579) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 1, 2006 +.Dd January 5, 2009 .Dt BUILD 7 .Os .Sh NAME @@ -370,6 +370,69 @@ defaults to the current machine architec .El .Pp Builds under directory +.Pa /usr/src +are also influenced by defining one or more the following symbols, +using the +.Fl D +option of +.Xr make 1 : +.Bl -tag -width ".Va -DNO_KERNELDEPEND" +.It Va NO_CLEANDIR +If set, the build targets that clean parts of the object tree use the +equivalent of +.Dq make clean +instead of +.Dq make cleandir . +.It Va NO_CLEAN +If set, no object tree files are cleaned at all. +Setting +.Va NO_CLEAN +implies +.Va NO_KERNELCLEAN , +so when +.Va NO_CLEAN +is set no kernel objects are cleaned either. +.It Va NO_CTF +If set, the build process does not run the DTrace CTF conversion tools +on built objects. +.It Va NO_SHARE +If set, the build does not descend into the +.Pa /usr/src/share +subdirectory (i.e. manpages, locale data files, timezone data files and +other +.Pa /usr/src/share +files will not be rebuild from their sources). +.It Va NO_KERNELCLEAN +If set, the build process does not run +.Dq make clean +as part of the +.Cm buildkernel +target. +.It Va NO_KERNELCONFIG +If set, the build process does not run +.Xr config 8 +as part of the +.Cm buildkernel +target. +.It Va NO_KERNELDEPEND +If set, the build process does not run +.Dq make depend +as part of the +.Cm buildkernel +target. +.It Va NO_DOCUPDATE +If set, the update process does not update the source of the +.Fx +documentation as part of the +.Dq make update +target. +.It Va NO_PORTSUPDATE +If set, the update process does not update the Ports tree as part of the +.Dq make update +target. +.El +.Pp +Builds under directory .Pa /usr/doc are influenced by the following .Xr make 1 From owner-svn-src-all@FreeBSD.ORG Wed Jan 19 15:26:05 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 817531065679; Wed, 19 Jan 2011 15:26:05 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 51B318FC17; Wed, 19 Jan 2011 15:26:05 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 085CE46B89; Wed, 19 Jan 2011 10:26:05 -0500 (EST) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 22C368A009; Wed, 19 Jan 2011 10:26:04 -0500 (EST) From: John Baldwin To: Erwin Lansing Date: Wed, 19 Jan 2011 10:19:17 -0500 User-Agent: KMail/1.13.5 (FreeBSD/7.4-CBSD-20110107; KDE/4.4.5; amd64; ; ) References: <201101182219.p0IMJt9D053996@svn.freebsd.org> <201101190807.46537.jhb@freebsd.org> <20110119133016.GP67325@droso.net> In-Reply-To: <20110119133016.GP67325@droso.net> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201101191019.17335.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Wed, 19 Jan 2011 10:26:04 -0500 (EST) X-Virus-Scanned: clamav-milter 0.96.3 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.9 required=4.2 tests=BAYES_00 autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bigwig.baldwin.cx Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-7@freebsd.org, "Simon L. Nielsen" Subject: Re: svn commit: r217562 - in stable/7/secure/lib: libcrypto libssl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 15:26:05 -0000 On Wednesday, January 19, 2011 8:30:16 am Erwin Lansing wrote: > On Wed, Jan 19, 2011 at 08:07:46AM -0500, John Baldwin wrote: > > On Tuesday, January 18, 2011 5:19:55 pm Simon L. Nielsen wrote: > > > Author: simon > > > Date: Tue Jan 18 22:19:55 2011 > > > New Revision: 217562 > > > URL: http://svn.freebsd.org/changeset/base/217562 > > > > > > Log: > > > Decrease the libcrypto and libssl shared object version numbers from 6 > > > to 5. They were accidentally bumped in r215997 (on 2010-11-28) with the > > > merge of OpenSSL 0.9.8p, but unfortunately this was not caught until > > > now. > > > > > > Also add compat links for libcrypto.so.6 / libssl.so.6 (pointing to > > > their .5 counterparts) in case any users have compiled any third party > > > during the time stable/7 (and releng/7.4) were broken. > > > > > > This is deemed the last poor of bad options. Had the number bump not > > > been reverted binary packages for stable/7 would not have worked on the > > > still supported 7.3 and 7.1 releases. > > > > Erm, shouldn't the packages for 7-stable be built against the 7.0 ABI instead > > (and I thought this change was already made)? We've only supported backwards > > compat, not forwards compat. > > > Oldest supported by the security officer, currently 7.1-RELEASE-p16 to > be exact, but yes. Those are built against libcrypto.so.5, which of > course won't work on 7.4 with libcrypto.so.6, hence the above rollback > with an added symlink for those people that already built binaries > themselves against libcrypto.so.6. Ah, as there is no so.5 on a clean 7.4 system. Nevermind me then. The symlinks are certainly fine regardless, my only question was about the base the packages were being built against. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Wed Jan 19 15:43:23 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8381B106564A; Wed, 19 Jan 2011 15:43:23 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 721DF8FC19; Wed, 19 Jan 2011 15:43:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0JFhNSi080704; Wed, 19 Jan 2011 15:43:23 GMT (envelope-from keramida@svn.freebsd.org) Received: (from keramida@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0JFhNeC080702; Wed, 19 Jan 2011 15:43:23 GMT (envelope-from keramida@svn.freebsd.org) Message-Id: <201101191543.p0JFhNeC080702@svn.freebsd.org> From: Giorgos Keramidas Date: Wed, 19 Jan 2011 15:43:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217580 - stable/7/lib/libc/stdlib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 15:43:23 -0000 Author: keramida (doc committer) Date: Wed Jan 19 15:43:23 2011 New Revision: 217580 URL: http://svn.freebsd.org/changeset/base/217580 Log: MFC -r188305 and r189207 from /head : r188305 --> : Fix language on atol(3) manpage. Add a COMPATIBILITY section : stating that in FreeBSD the atol() and atoll() functions affect : errno in the same way as strtol() and stroll(). : : PR: docs/126487 : Submitted by: edwin : Reviewed by: trhodes, gabor : MFC after: 1 week : r189207 --> : "-isoC-99" should be spelled without 'c'. Modified: stable/7/lib/libc/stdlib/atol.3 Directory Properties: stable/7/lib/libc/ (props changed) stable/7/lib/libc/stdtime/ (props changed) Modified: stable/7/lib/libc/stdlib/atol.3 ============================================================================== --- stable/7/lib/libc/stdlib/atol.3 Wed Jan 19 15:12:38 2011 (r217579) +++ stable/7/lib/libc/stdlib/atol.3 Wed Jan 19 15:43:23 2011 (r217580) @@ -32,7 +32,7 @@ .\" @(#)atol.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd November 28, 2001 +.Dd February 1, 2009 .Dt ATOL 3 .Os .Sh NAME @@ -78,13 +78,42 @@ representation. It is equivalent to: .Pp .Dl "strtoll(nptr, (char **)NULL, 10);" +.Sh COMPATIBILITY +The +.Fx +implementations of the +.Fn atol +and +.Fn atoll +functions are thin wrappers around +.Fn strtol +and +.Fn stroll +respectively, so these functions will affect the value of +.Va errno +in the same way that the +.Fn strtol +and +.Fn stroll +functions are able to. +This behavior of +.Fn atol +and +.Fn atoll +is not required by +.St -isoC +or +.St -isoC-99 , +but it is allowed by all of +.St -isoC , St -isoC-99 +and +.St -p1003.1-2001 . .Sh ERRORS The functions .Fn atol and .Fn atoll -need not -affect the value of +may affect the value of .Va errno on an error. .Sh SEE ALSO From owner-svn-src-all@FreeBSD.ORG Wed Jan 19 15:43:54 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D8D8E1065670; Wed, 19 Jan 2011 15:43:54 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C927E8FC17; Wed, 19 Jan 2011 15:43:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0JFhs2s080755; Wed, 19 Jan 2011 15:43:54 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0JFhsNg080753; Wed, 19 Jan 2011 15:43:54 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201101191543.p0JFhsNg080753@svn.freebsd.org> From: Alan Cox Date: Wed, 19 Jan 2011 15:43: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: r217581 - head/sys/dev/md X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 15:43:55 -0000 Author: alc Date: Wed Jan 19 15:43:54 2011 New Revision: 217581 URL: http://svn.freebsd.org/changeset/base/217581 Log: There is no point in calling vm_object_set_writeable_dirty() on an object that is definitively known to be swap backed since its only effects are on vnode-backed objects. Reviewed by: kib Modified: head/sys/dev/md/md.c Modified: head/sys/dev/md/md.c ============================================================================== --- head/sys/dev/md/md.c Wed Jan 19 15:43:23 2011 (r217580) +++ head/sys/dev/md/md.c Wed Jan 19 15:43:54 2011 (r217581) @@ -684,7 +684,6 @@ printf("wire_count %d busy %d flags %x h #endif } vm_object_pip_subtract(sc->object, 1); - vm_object_set_writeable_dirty(sc->object); VM_OBJECT_UNLOCK(sc->object); return (rv != VM_PAGER_ERROR ? 0 : ENOSPC); } From owner-svn-src-all@FreeBSD.ORG Wed Jan 19 16:46:13 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ABDAB106564A; Wed, 19 Jan 2011 16:46:13 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 810F58FC19; Wed, 19 Jan 2011 16:46:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0JGkDAx082395; Wed, 19 Jan 2011 16:46:13 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0JGkDcm082391; Wed, 19 Jan 2011 16:46:13 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201101191646.p0JGkDcm082391@svn.freebsd.org> From: John Baldwin Date: Wed, 19 Jan 2011 16:46: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: r217582 - head/sys/fs/ext2fs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 16:46:13 -0000 Author: jhb Date: Wed Jan 19 16:46:13 2011 New Revision: 217582 URL: http://svn.freebsd.org/changeset/base/217582 Log: Merge 118969 from UFS: Eliminate the i_devvp field from the incore inodes, we can get the same value from ip->i_ump->um_devvp. Submitted by: Pedro F. Giffuni giffunip at yahoo MFC after: 1 week Modified: head/sys/fs/ext2fs/ext2_subr.c head/sys/fs/ext2fs/ext2_vfsops.c head/sys/fs/ext2fs/inode.h Modified: head/sys/fs/ext2fs/ext2_subr.c ============================================================================== --- head/sys/fs/ext2fs/ext2_subr.c Wed Jan 19 15:43:54 2011 (r217581) +++ head/sys/fs/ext2fs/ext2_subr.c Wed Jan 19 16:46:13 2011 (r217582) @@ -105,7 +105,7 @@ ext2_checkoverlap(bp, ip) for (ep = buf; ep < ebp; ep++) { if (ep == bp || (ep->b_flags & B_INVAL)) continue; - vp = ip->i_devvp; + vp = ip->i_ump->um_devvp; /* look for overlap */ if (ep->b_bcount == 0 || ep->b_blkno > last || ep->b_blkno + btodb(ep->b_bcount) <= start) Modified: head/sys/fs/ext2fs/ext2_vfsops.c ============================================================================== --- head/sys/fs/ext2fs/ext2_vfsops.c Wed Jan 19 15:43:54 2011 (r217581) +++ head/sys/fs/ext2fs/ext2_vfsops.c Wed Jan 19 16:46:13 2011 (r217582) @@ -945,9 +945,8 @@ ext2_vget(struct mount *mp, ino_t ino, i } /* - * Finish inode initialization now that aliasing has been resolved. + * Finish inode initialization. */ - ip->i_devvp = ump->um_devvp; /* * Set up a generation number for this inode if it does not Modified: head/sys/fs/ext2fs/inode.h ============================================================================== --- head/sys/fs/ext2fs/inode.h Wed Jan 19 15:43:54 2011 (r217581) +++ head/sys/fs/ext2fs/inode.h Wed Jan 19 16:46:13 2011 (r217582) @@ -62,7 +62,6 @@ */ struct inode { struct vnode *i_vnode;/* Vnode associated with this inode. */ - struct vnode *i_devvp;/* Vnode for block I/O. */ struct ext2mount *i_ump; u_int32_t i_flag; /* flags, see below */ ino_t i_number; /* The identity of the inode. */ @@ -143,6 +142,9 @@ struct inode { #define IN_SPACECOUNTED 0x0080 /* Blocks to be freed in free count. */ #define IN_LAZYACCESS 0x0100 /* Process IN_ACCESS after the suspension finished */ + +#define i_devvp i_ump->um_devvp + #ifdef _KERNEL /* * Structure used to pass around logical block paths generated by From owner-svn-src-all@FreeBSD.ORG Wed Jan 19 16:48:07 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B32AC1065673; Wed, 19 Jan 2011 16:48:07 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A2F028FC08; Wed, 19 Jan 2011 16:48:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0JGm7Vp082475; Wed, 19 Jan 2011 16:48:07 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0JGm7D3082473; Wed, 19 Jan 2011 16:48:07 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201101191648.p0JGm7D3082473@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 19 Jan 2011 16:48: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: r217583 - head/sys/dev/md X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 16:48:07 -0000 Author: kib Date: Wed Jan 19 16:48:07 2011 New Revision: 217583 URL: http://svn.freebsd.org/changeset/base/217583 Log: Add missed (). Noted by: alc MFC after: 3 days Modified: head/sys/dev/md/md.c Modified: head/sys/dev/md/md.c ============================================================================== --- head/sys/dev/md/md.c Wed Jan 19 16:46:13 2011 (r217582) +++ head/sys/dev/md/md.c Wed Jan 19 16:48:07 2011 (r217583) @@ -854,8 +854,8 @@ mdcreate_malloc(struct md_s *sc, struct nsectors = sc->mediasize / sc->sectorsize; for (u = 0; u < nsectors; u++) { - sp = (uintptr_t)uma_zalloc(sc->uma, md_malloc_wait ? - M_WAITOK : M_NOWAIT | M_ZERO); + sp = (uintptr_t)uma_zalloc(sc->uma, (md_malloc_wait ? + M_WAITOK : M_NOWAIT) | M_ZERO); if (sp != 0) error = s_write(sc->indir, u, sp); else From owner-svn-src-all@FreeBSD.ORG Wed Jan 19 16:52:22 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9497C106566B; Wed, 19 Jan 2011 16:52:22 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 847E18FC17; Wed, 19 Jan 2011 16:52:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0JGqMQ6082607; Wed, 19 Jan 2011 16:52:22 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0JGqMnO082605; Wed, 19 Jan 2011 16:52:22 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201101191652.p0JGqMnO082605@svn.freebsd.org> From: John Baldwin Date: Wed, 19 Jan 2011 16:52: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: r217584 - head/sys/fs/ext2fs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 16:52:22 -0000 Author: jhb Date: Wed Jan 19 16:52:22 2011 New Revision: 217584 URL: http://svn.freebsd.org/changeset/base/217584 Log: Move calculation of 'bmask' earlier to match it's current location in ufs_lookup(). Modified: head/sys/fs/ext2fs/ext2_lookup.c Modified: head/sys/fs/ext2fs/ext2_lookup.c ============================================================================== --- head/sys/fs/ext2fs/ext2_lookup.c Wed Jan 19 16:48:07 2011 (r217583) +++ head/sys/fs/ext2fs/ext2_lookup.c Wed Jan 19 16:52:22 2011 (r217584) @@ -325,6 +325,8 @@ ext2_lookup(ap) *vpp = NULL; vdp = ap->a_dvp; dp = VTOI(vdp); + bmask = VFSTOEXT2(vdp->v_mount)->um_mountp->mnt_stat.f_iosize - 1; + /* * We now have a segment name to search for, and a directory to search. */ @@ -359,7 +361,6 @@ ext2_lookup(ap) * profiling time and hence has been removed in the interest * of simplicity. */ - bmask = VFSTOEXT2(vdp->v_mount)->um_mountp->mnt_stat.f_iosize - 1; if (nameiop != LOOKUP || i_diroff == 0 || i_diroff > dp->i_size) { entryoffsetinblock = 0; From owner-svn-src-all@FreeBSD.ORG Wed Jan 19 16:55:33 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F3041065695; Wed, 19 Jan 2011 16:55:33 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 44C508FC23; Wed, 19 Jan 2011 16:55:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0JGtXW6082725; Wed, 19 Jan 2011 16:55:33 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0JGtX72082721; Wed, 19 Jan 2011 16:55:33 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201101191655.p0JGtX72082721@svn.freebsd.org> From: John Baldwin Date: Wed, 19 Jan 2011 16:55:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217585 - head/sys/fs/ext2fs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 16:55:33 -0000 Author: jhb Date: Wed Jan 19 16:55:32 2011 New Revision: 217585 URL: http://svn.freebsd.org/changeset/base/217585 Log: Whitespace and style fixes. Modified: head/sys/fs/ext2fs/ext2_alloc.c head/sys/fs/ext2fs/ext2_dinode.h head/sys/fs/ext2fs/ext2fs.h Modified: head/sys/fs/ext2fs/ext2_alloc.c ============================================================================== --- head/sys/fs/ext2fs/ext2_alloc.c Wed Jan 19 16:52:22 2011 (r217584) +++ head/sys/fs/ext2fs/ext2_alloc.c Wed Jan 19 16:55:32 2011 (r217585) @@ -76,7 +76,6 @@ static daddr_t ext2_mapsearch(struct m_ * 2) quadradically rehash into other cylinder groups, until an * available block is located. */ - int ext2_alloc(ip, lbn, bpref, size, cred, bnp) struct inode *ip; @@ -222,7 +221,7 @@ return ENOSPC; /* * Find the preferred location for the cluster. */ - EXT2_LOCK(ump); + EXT2_LOCK(ump); pref = ext2_blkpref(ip, start_lbn, soff, sbap, blkno); /* * If the block range spans two block maps, get the second map. Modified: head/sys/fs/ext2fs/ext2_dinode.h ============================================================================== --- head/sys/fs/ext2fs/ext2_dinode.h Wed Jan 19 16:52:22 2011 (r217584) +++ head/sys/fs/ext2fs/ext2_dinode.h Wed Jan 19 16:55:32 2011 (r217585) @@ -74,5 +74,5 @@ struct ext2fs_dinode { u_int32_t e2di_linux_reserved3; /* 124 */ }; -#endif /* _FS_EXT2FS_EXT2_DINODE_H_ */ +#endif /* !_FS_EXT2FS_EXT2_DINODE_H_ */ Modified: head/sys/fs/ext2fs/ext2fs.h ============================================================================== --- head/sys/fs/ext2fs/ext2fs.h Wed Jan 19 16:52:22 2011 (r217584) +++ head/sys/fs/ext2fs/ext2fs.h Wed Jan 19 16:55:32 2011 (r217585) @@ -153,8 +153,8 @@ struct m_ext2fs { uint32_t e2fs_bshift; /* calc of logical block no */ int32_t e2fs_bmask; /* calc of block offset */ int32_t e2fs_bpg; /* Number of blocks per group */ - int64_t e2fs_qbmask; /* = s_blocksize -1 */ - uint32_t e2fs_fsbtodb; /* Shift to get disk block */ + int64_t e2fs_qbmask; /* = s_blocksize -1 */ + uint32_t e2fs_fsbtodb; /* Shift to get disk block */ uint32_t e2fs_ipg; /* Number of inodes per group */ uint32_t e2fs_ipb; /* Number of inodes per block */ uint32_t e2fs_itpg; /* Number of inode table per group */ @@ -326,4 +326,4 @@ struct ext2_gd { #endif -#endif /* _LINUX_EXT2_FS_H */ +#endif /* !_FS_EXT2FS_EXT2FS_H */ From owner-svn-src-all@FreeBSD.ORG Wed Jan 19 17:04:07 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C83D2106564A; Wed, 19 Jan 2011 17:04:07 +0000 (UTC) (envelope-from mdf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B52EF8FC14; Wed, 19 Jan 2011 17:04:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0JH47UQ082987; Wed, 19 Jan 2011 17:04:07 GMT (envelope-from mdf@svn.freebsd.org) Received: (from mdf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0JH47ZS082977; Wed, 19 Jan 2011 17:04:07 GMT (envelope-from mdf@svn.freebsd.org) Message-Id: <201101191704.p0JH47ZS082977@svn.freebsd.org> From: Matthew D Fleming Date: Wed, 19 Jan 2011 17:04: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: r217586 - in head: sbin/sysctl share/man/man9 sys/cam/scsi sys/dev/cxgb sys/dev/wi sys/net sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 17:04:07 -0000 Author: mdf Date: Wed Jan 19 17:04:07 2011 New Revision: 217586 URL: http://svn.freebsd.org/changeset/base/217586 Log: sysctl(8) should use the CTLTYPE to determine the type of data when reading. (This was already done for writing to a sysctl). This requires all SYSCTL setups to specify a type. Most of them are now checked at compile-time. Remove SYSCTL_*X* sysctl additions as the print being in hex should be controlled by the -x flag to sysctl(8). Succested by: bde Modified: head/sbin/sysctl/sysctl.c head/share/man/man9/Makefile head/share/man/man9/sysctl.9 head/sys/cam/scsi/scsi_da.c head/sys/dev/cxgb/cxgb_sge.c head/sys/dev/wi/if_wi.c head/sys/net/if_enc.c head/sys/net/vnet.h head/sys/sys/sysctl.h Modified: head/sbin/sysctl/sysctl.c ============================================================================== --- head/sbin/sysctl/sysctl.c Wed Jan 19 16:55:32 2011 (r217585) +++ head/sbin/sysctl/sysctl.c Wed Jan 19 17:04:07 2011 (r217586) @@ -510,7 +510,7 @@ show_var(int *oid, int nlen) int qoid[CTL_MAXNAME+2]; uintmax_t umv; intmax_t mv; - int i, hexlen; + int i, hexlen, sign, ctltype; size_t intlen; size_t j, len; u_int kind; @@ -575,46 +575,57 @@ show_var(int *oid, int nlen) fmt = buf; oidfmt(oid, nlen, fmt, &kind); p = val; - switch (*fmt) { - case 'A': + ctltype = (kind & CTLTYPE); + sign = (ctltype == CTLTYPE_INT || ctltype == CTLTYPE_LONG) ? 1 : 0; + switch (ctltype) { + case CTLTYPE_STRING: if (!nflag) printf("%s%s", name, sep); printf("%.*s", (int)len, p); free(oval); return (0); - case 'I': - case 'L': - case 'Q': + case CTLTYPE_INT: + case CTLTYPE_UINT: + case CTLTYPE_LONG: + case CTLTYPE_ULONG: + case CTLTYPE_QUAD: if (!nflag) printf("%s%s", name, sep); - switch (*fmt) { - case 'I': intlen = sizeof(int); break; - case 'L': intlen = sizeof(long); break; - case 'Q': intlen = sizeof(quad_t); break; + switch (kind & CTLTYPE) { + case CTLTYPE_INT: + case CTLTYPE_UINT: + intlen = sizeof(int); break; + case CTLTYPE_LONG: + case CTLTYPE_ULONG: + intlen = sizeof(long); break; + case CTLTYPE_QUAD: + intlen = sizeof(quad_t); break; } hexlen = 2 + (intlen * CHAR_BIT + 3) / 4; sep1 = ""; while (len >= intlen) { - switch (*fmt) { - case 'I': + switch (kind & CTLTYPE) { + case CTLTYPE_INT: + case CTLTYPE_UINT: umv = *(u_int *)p; mv = *(int *)p; break; - case 'L': + case CTLTYPE_LONG: + case CTLTYPE_ULONG: umv = *(u_long *)p; mv = *(long *)p; break; - case 'Q': + case CTLTYPE_QUAD: umv = *(u_quad_t *)p; mv = *(quad_t *)p; break; } fputs(sep1, stdout); - if (fmt[1] == 'U') - printf(hflag ? "%'ju" : "%ju", umv); - else if (fmt[1] == 'X') + if (xflag) printf("%#0*jx", hexlen, umv); + else if (!sign) + printf(hflag ? "%'ju" : "%ju", umv); else if (fmt[1] == 'K') { if (mv < 0) printf("%jd", mv); @@ -629,14 +640,7 @@ show_var(int *oid, int nlen) free(oval); return (0); - case 'P': - if (!nflag) - printf("%s%s", name, sep); - printf("%p", *(void **)p); - free(oval); - return (0); - - case 'S': + case CTLTYPE_OPAQUE: i = 0; if (strcmp(fmt, "S,clockinfo") == 0) func = S_clockinfo; Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Wed Jan 19 16:55:32 2011 (r217585) +++ head/share/man/man9/Makefile Wed Jan 19 17:04:07 2011 (r217586) @@ -1193,8 +1193,7 @@ MLINKS+=sysctl.9 SYSCTL_DECL.9 \ sysctl.9 SYSCTL_STRUCT.9 \ sysctl.9 SYSCTL_UINT.9 \ sysctl.9 SYSCTL_ULONG.9 \ - sysctl.9 SYSCTL_XINT.9 \ - sysctl.9 SYSCTL_XLONG.9 + sysctl.9 SYSCTL_QUAD.9 MLINKS+=sysctl_add_oid.9 SYSCTL_ADD_INT.9 \ sysctl_add_oid.9 SYSCTL_ADD_LONG.9 \ sysctl_add_oid.9 SYSCTL_ADD_NODE.9 \ @@ -1205,6 +1204,7 @@ MLINKS+=sysctl_add_oid.9 SYSCTL_ADD_INT. sysctl_add_oid.9 SYSCTL_ADD_STRUCT.9 \ sysctl_add_oid.9 SYSCTL_ADD_UINT.9 \ sysctl_add_oid.9 SYSCTL_ADD_ULONG.9 \ + sysctl_add_oid.9 SYSCTL_ADD_QUAD.9 \ sysctl_add_oid.9 SYSCTL_CHILDREN.9 \ sysctl_add_oid.9 sysctl_move_oid.9 \ sysctl_add_oid.9 sysctl_remove_oid.9 \ Modified: head/share/man/man9/sysctl.9 ============================================================================== --- head/share/man/man9/sysctl.9 Wed Jan 19 16:55:32 2011 (r217585) +++ head/share/man/man9/sysctl.9 Wed Jan 19 17:04:07 2011 (r217586) @@ -39,8 +39,6 @@ .Nm SYSCTL_STRUCT , .Nm SYSCTL_UINT , .Nm SYSCTL_ULONG , -.Nm SYSCTL_XINT , -.Nm SYSCTL_XLONG , .Nm SYSCTL_QUAD .Nd Static sysctl declaration functions .Sh SYNOPSIS @@ -56,8 +54,6 @@ .Fn SYSCTL_STRUCT parent nbr name access ptr type descr .Fn SYSCTL_UINT parent nbr name access ptr val descr .Fn SYSCTL_ULONG parent nbr name access ptr val descr -.Fn SYSCTL_XINT parent nbr name access ptr val descr -.Fn SYSCTL_XLONG parent nbr name access ptr val descr .Fn SYSCTL_QUAD parent nbr name access ptr val descr .Sh DESCRIPTION The @@ -84,8 +80,6 @@ New nodes are declared using one of .Fn SYSCTL_STRUCT , .Fn SYSCTL_UINT , .Fn SYSCTL_ULONG , -.Fn SYSCTL_XINT , -.Fn SYSCTL_XLONG , and .Fn SYSCTL_QUAD . Each macro accepts a parent name, as declared using @@ -206,7 +200,6 @@ Examples of integer, opaque, string, and * Example of a constant integer value. Notice that the control * flags are CTLFLAG_RD, the variable pointer is NULL, and the * value is declared. - * If sysctl(8) should print this value in hex, use 'SYSCTL_XINT'. */ SYSCTL_INT(_debug_sizeof, OID_AUTO, bio, CTLFLAG_RD, NULL, sizeof(struct bio), "sizeof(struct bio)"); Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Wed Jan 19 16:55:32 2011 (r217585) +++ head/sys/cam/scsi/scsi_da.c Wed Jan 19 17:04:07 2011 (r217586) @@ -1127,7 +1127,7 @@ dasysctlinit(void *context, int pending) struct ccb_trans_settings_fc *fc = &cts.xport_specific.fc; if (fc->valid & CTS_FC_VALID_WWPN) { softc->wwpn = fc->wwpn; - SYSCTL_ADD_X64(&softc->sysctl_ctx, + SYSCTL_ADD_UQUAD(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), OID_AUTO, "wwpn", CTLFLAG_RD, &softc->wwpn, "World Wide Port Name"); Modified: head/sys/dev/cxgb/cxgb_sge.c ============================================================================== --- head/sys/dev/cxgb/cxgb_sge.c Wed Jan 19 16:55:32 2011 (r217585) +++ head/sys/dev/cxgb/cxgb_sge.c Wed Jan 19 17:04:07 2011 (r217586) @@ -3630,7 +3630,7 @@ t3_add_configured_sysctls(adapter_t *sc) SYSCTL_ADD_UINT(ctx, rspqpoidlist, OID_AUTO, "starved", CTLFLAG_RD, &qs->rspq.starved, 0, "#times starved"); - SYSCTL_ADD_XLONG(ctx, rspqpoidlist, OID_AUTO, "phys_addr", + SYSCTL_ADD_ULONG(ctx, rspqpoidlist, OID_AUTO, "phys_addr", CTLFLAG_RD, &qs->rspq.phys_addr, "physical_address_of the queue"); SYSCTL_ADD_UINT(ctx, rspqpoidlist, OID_AUTO, "dump_start", @@ -3681,7 +3681,7 @@ t3_add_configured_sysctls(adapter_t *sc) SYSCTL_ADD_UINT(ctx, txqpoidlist, OID_AUTO, "stopped_flags", CTLFLAG_RD, &qs->txq_stopped, 0, "tx queues stopped"); - SYSCTL_ADD_XLONG(ctx, txqpoidlist, OID_AUTO, "phys_addr", + SYSCTL_ADD_ULONG(ctx, txqpoidlist, OID_AUTO, "phys_addr", CTLFLAG_RD, &txq->phys_addr, "physical_address_of the queue"); SYSCTL_ADD_UINT(ctx, txqpoidlist, OID_AUTO, "qgen", Modified: head/sys/dev/wi/if_wi.c ============================================================================== --- head/sys/dev/wi/if_wi.c Wed Jan 19 16:55:32 2011 (r217585) +++ head/sys/dev/wi/if_wi.c Wed Jan 19 17:04:07 2011 (r217586) @@ -295,7 +295,7 @@ wi_attach(device_t dev) SYSCTL_ADD_INT(sctx, SYSCTL_CHILDREN(soid), OID_AUTO, "pri_version", CTLFLAG_RD, &sc->sc_pri_firmware_ver, 0, "Primary Firmware version"); - SYSCTL_ADD_XINT(sctx, SYSCTL_CHILDREN(soid), OID_AUTO, "nic_id", + SYSCTL_ADD_UINT(sctx, SYSCTL_CHILDREN(soid), OID_AUTO, "nic_id", CTLFLAG_RD, &sc->sc_nic_id, 0, "NIC id"); SYSCTL_ADD_STRING(sctx, SYSCTL_CHILDREN(soid), OID_AUTO, "nic_name", CTLFLAG_RD, sc->sc_nic_name, 0, "NIC name"); Modified: head/sys/net/if_enc.c ============================================================================== --- head/sys/net/if_enc.c Wed Jan 19 16:55:32 2011 (r217585) +++ head/sys/net/if_enc.c Wed Jan 19 17:04:07 2011 (r217586) @@ -104,18 +104,18 @@ SYSCTL_NODE(_net, OID_AUTO, enc, CTLFLAG SYSCTL_NODE(_net_enc, OID_AUTO, in, CTLFLAG_RW, 0, "enc input sysctl"); static int ipsec_filter_mask_in = ENC_BEFORE; -SYSCTL_XINT(_net_enc_in, OID_AUTO, ipsec_filter_mask, CTLFLAG_RW, +SYSCTL_INT(_net_enc_in, OID_AUTO, ipsec_filter_mask, CTLFLAG_RW, &ipsec_filter_mask_in, 0, "IPsec input firewall filter mask"); static int ipsec_bpf_mask_in = ENC_BEFORE; -SYSCTL_XINT(_net_enc_in, OID_AUTO, ipsec_bpf_mask, CTLFLAG_RW, +SYSCTL_INT(_net_enc_in, OID_AUTO, ipsec_bpf_mask, CTLFLAG_RW, &ipsec_bpf_mask_in, 0, "IPsec input bpf mask"); SYSCTL_NODE(_net_enc, OID_AUTO, out, CTLFLAG_RW, 0, "enc output sysctl"); static int ipsec_filter_mask_out = ENC_BEFORE; -SYSCTL_XINT(_net_enc_out, OID_AUTO, ipsec_filter_mask, CTLFLAG_RW, +SYSCTL_INT(_net_enc_out, OID_AUTO, ipsec_filter_mask, CTLFLAG_RW, &ipsec_filter_mask_out, 0, "IPsec output firewall filter mask"); static int ipsec_bpf_mask_out = ENC_BEFORE|ENC_AFTER; -SYSCTL_XINT(_net_enc_out, OID_AUTO, ipsec_bpf_mask, CTLFLAG_RW, +SYSCTL_INT(_net_enc_out, OID_AUTO, ipsec_bpf_mask, CTLFLAG_RW, &ipsec_bpf_mask_out, 0, "IPsec output bpf mask"); static void Modified: head/sys/net/vnet.h ============================================================================== --- head/sys/net/vnet.h Wed Jan 19 16:55:32 2011 (r217585) +++ head/sys/net/vnet.h Wed Jan 19 17:04:07 2011 (r217586) @@ -236,6 +236,7 @@ int vnet_sysctl_handle_uint(SYSCTL_HANDL ptr, val, vnet_sysctl_handle_int, "I", descr) #define SYSCTL_VNET_PROC(parent, nbr, name, access, ptr, arg, handler, \ fmt, descr) \ + CTASSERT(((access) & CTLTYPE) != 0); \ SYSCTL_OID(parent, nbr, name, CTLFLAG_VNET|(access), ptr, arg, \ handler, fmt, descr) #define SYSCTL_VNET_OPAQUE(parent, nbr, name, access, ptr, len, fmt, \ Modified: head/sys/sys/sysctl.h ============================================================================== --- head/sys/sys/sysctl.h Wed Jan 19 16:55:32 2011 (r217585) +++ head/sys/sys/sysctl.h Wed Jan 19 17:04:07 2011 (r217586) @@ -239,14 +239,10 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_e SYSCTL_ALLOWED_TYPES(INT, int *a; ); SYSCTL_ALLOWED_TYPES(UINT, unsigned int *a; ); -SYSCTL_ALLOWED_TYPES(XINT, unsigned int *a; int *b; ); SYSCTL_ALLOWED_TYPES(LONG, long *a; ); SYSCTL_ALLOWED_TYPES(ULONG, unsigned long *a; ); -SYSCTL_ALLOWED_TYPES(XLONG, unsigned long *a; long *b; ); SYSCTL_ALLOWED_TYPES(INT64, int64_t *a; long long *b; ); SYSCTL_ALLOWED_TYPES(UINT64, uint64_t *a; unsigned long long *b; ); -SYSCTL_ALLOWED_TYPES(XINT64, uint64_t *a; int64_t *b; - unsigned long long *c; long long *d; ); #ifdef notyet #define SYSCTL_ADD_ASSERT_TYPE(type, ptr) \ @@ -328,18 +324,6 @@ SYSCTL_ALLOWED_TYPES(XINT64, uint64_t *a SYSCTL_ADD_ASSERT_TYPE(UINT, ptr), val, \ sysctl_handle_int, "IU", __DESCR(descr)) -#define SYSCTL_XINT(parent, nbr, name, access, ptr, val, descr) \ - SYSCTL_ASSERT_TYPE(XINT, ptr, parent, name); \ - SYSCTL_OID(parent, nbr, name, \ - CTLTYPE_UINT | CTLFLAG_MPSAFE | (access), \ - ptr, val, sysctl_handle_int, "IX", descr) - -#define SYSCTL_ADD_XINT(ctx, parent, nbr, name, access, ptr, val, descr) \ - sysctl_add_oid(ctx, parent, nbr, name, \ - CTLTYPE_UINT | CTLFLAG_MPSAFE | (access), \ - SYSCTL_ADD_ASSERT_TYPE(XINT, ptr), val, \ - sysctl_handle_int, "IX", __DESCR(descr)) - /* Oid for a long. The pointer must be non NULL. */ #define SYSCTL_LONG(parent, nbr, name, access, ptr, val, descr) \ SYSCTL_ASSERT_TYPE(LONG, ptr, parent, name); \ @@ -366,18 +350,6 @@ SYSCTL_ALLOWED_TYPES(XINT64, uint64_t *a SYSCTL_ADD_ASSERT_TYPE(ULONG, ptr), 0, \ sysctl_handle_long, "LU", __DESCR(descr)) -#define SYSCTL_XLONG(parent, nbr, name, access, ptr, val, descr) \ - SYSCTL_ASSERT_TYPE(XLONG, ptr, parent, name); \ - SYSCTL_OID(parent, nbr, name, \ - CTLTYPE_ULONG | CTLFLAG_MPSAFE | (access), \ - ptr, val, sysctl_handle_long, "LX", descr) - -#define SYSCTL_ADD_XLONG(ctx, parent, nbr, name, access, ptr, descr) \ - sysctl_add_oid(ctx, parent, nbr, name, \ - CTLTYPE_ULONG | CTLFLAG_MPSAFE | (access), \ - SYSCTL_ADD_ASSERT_TYPE(XLONG, ptr), 0, \ - sysctl_handle_long, "LX", __DESCR(descr)) - /* Oid for a quad. The pointer must be non NULL. */ #define SYSCTL_QUAD(parent, nbr, name, access, ptr, val, descr) \ SYSCTL_ASSERT_TYPE(INT64, ptr, parent, name); \ @@ -403,18 +375,6 @@ SYSCTL_ALLOWED_TYPES(XINT64, uint64_t *a SYSCTL_ADD_ASSERT_TYPE(UINT64, ptr), 0, \ sysctl_handle_quad, "QU", __DESCR(descr)) -#define SYSCTL_X64(parent, nbr, name, access, ptr, val, descr) \ - SYSCTL_ASSERT_TYPE(XINT64, ptr, parent, name); \ - SYSCTL_OID(parent, nbr, name, \ - CTLTYPE_QUAD | CTLFLAG_MPSAFE | (access), \ - ptr, val, sysctl_handle_quad, "QX", descr) - -#define SYSCTL_ADD_X64(ctx, parent, nbr, name, access, ptr, descr) \ - sysctl_add_oid(ctx, parent, nbr, name, \ - CTLTYPE_QUAD | CTLFLAG_MPSAFE | (access), \ - SYSCTL_ADD_ASSERT_TYPE(XINT64, ptr), 0, \ - sysctl_handle_quad, "QX", __DESCR(descr)) - /* Oid for an opaque object. Specified by a pointer and a length. */ #define SYSCTL_OPAQUE(parent, nbr, name, access, ptr, len, fmt, descr) \ SYSCTL_OID(parent, nbr, name, CTLTYPE_OPAQUE|(access), \ @@ -436,6 +396,7 @@ SYSCTL_ALLOWED_TYPES(XINT64, uint64_t *a /* Oid for a procedure. Specified by a pointer and an arg. */ #define SYSCTL_PROC(parent, nbr, name, access, ptr, arg, handler, fmt, descr) \ + CTASSERT(((access) & CTLTYPE) != 0); \ SYSCTL_OID(parent, nbr, name, (access), \ ptr, arg, handler, fmt, descr) From owner-svn-src-all@FreeBSD.ORG Wed Jan 19 17:09:07 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 96C9C106566C; Wed, 19 Jan 2011 17:09:07 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 86CF98FC1D; Wed, 19 Jan 2011 17:09:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0JH973j083134; Wed, 19 Jan 2011 17:09:07 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0JH97ZD083132; Wed, 19 Jan 2011 17:09:07 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201101191709.p0JH97ZD083132@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 19 Jan 2011 17:09: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: r217587 - head/sys/i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 17:09:07 -0000 Author: jkim Date: Wed Jan 19 17:09:07 2011 New Revision: 217587 URL: http://svn.freebsd.org/changeset/base/217587 Log: Fix yet another fallout from r208833. VM86 BIOS call may cause page fault when FPU is in use. Reported by: Marc UBM Bocklet (ubm dot freebsd at googlemail dot com) Tested by: b. f. (bf1783 at googlemail dot com) MFC after: 3 days Modified: head/sys/i386/i386/vm86bios.s Modified: head/sys/i386/i386/vm86bios.s ============================================================================== --- head/sys/i386/i386/vm86bios.s Wed Jan 19 17:04:07 2011 (r217586) +++ head/sys/i386/i386/vm86bios.s Wed Jan 19 17:09:07 2011 (r217587) @@ -73,10 +73,9 @@ ENTRY(vm86_bioscall) je 1f /* no curproc/npxproc */ pushl %edx movl TD_PCB(%ecx),%ecx - addl $PCB_SAVEFPU,%ecx - pushl %ecx + pushl PCB_SAVEFPU(%ecx) call npxsave - popl %ecx + addl $4,%esp popl %edx /* recover our pcb */ 1: popfl From owner-svn-src-all@FreeBSD.ORG Wed Jan 19 17:11:52 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C374F106564A; Wed, 19 Jan 2011 17:11:52 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B28038FC22; Wed, 19 Jan 2011 17:11:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0JHBqU2083255; Wed, 19 Jan 2011 17:11:52 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0JHBqCS083253; Wed, 19 Jan 2011 17:11:52 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201101191711.p0JHBqCS083253@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 19 Jan 2011 17:11: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: r217588 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 17:11:52 -0000 Author: trasz Date: Wed Jan 19 17:11:52 2011 New Revision: 217588 URL: http://svn.freebsd.org/changeset/base/217588 Log: Add MNT_NFS4ACLS to ZFS mount flags. It's not conditional, since there is no way to disable NFSv4 ACLs in ZFS. This should make it easier for the NFS server to figure out whether the exported filesystem supports ACLs or not. Reviewed by: pjd MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Wed Jan 19 17:09:07 2011 (r217587) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Wed Jan 19 17:11:52 2011 (r217588) @@ -1021,7 +1021,7 @@ zfs_domount(vfs_t *vfsp, char *osname) zfsvfs->z_vfs->mnt_stat.f_iosize = recordsize; vfsp->vfs_data = zfsvfs; - vfsp->mnt_flag |= MNT_LOCAL; + vfsp->mnt_flag |= MNT_LOCAL | MNT_NFS4ACLS; vfsp->mnt_kern_flag |= MNTK_MPSAFE; vfsp->mnt_kern_flag |= MNTK_LOOKUP_SHARED; vfsp->mnt_kern_flag |= MNTK_SHARED_WRITES; From owner-svn-src-all@FreeBSD.ORG Wed Jan 19 17:17:37 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9067F1065674; Wed, 19 Jan 2011 17:17:37 +0000 (UTC) (envelope-from dwmalone@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7FB9B8FC08; Wed, 19 Jan 2011 17:17:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0JHHbOl083436; Wed, 19 Jan 2011 17:17:37 GMT (envelope-from dwmalone@svn.freebsd.org) Received: (from dwmalone@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0JHHbOh083434; Wed, 19 Jan 2011 17:17:37 GMT (envelope-from dwmalone@svn.freebsd.org) Message-Id: <201101191717.p0JHHbOh083434@svn.freebsd.org> From: David Malone Date: Wed, 19 Jan 2011 17:17: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: r217589 - head/usr.sbin/syslogd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 17:17:37 -0000 Author: dwmalone Date: Wed Jan 19 17:17:37 2011 New Revision: 217589 URL: http://svn.freebsd.org/changeset/base/217589 Log: Here v->iov_len has been assigned the return value from snprintf. Checking if it is > 0 doesn't make sense, because snprintf returns how much space is needed if the buffer is too small. Instead, check if the return value was greater than the buffer size, and truncate the message if it was too long. It isn't clear if snprintf can return a negative value in the case of an error - I don't believe it can. If it can, then testing v->iov_len won't help 'cos it is a size_t, not an ssize_t. Also, as clang points out, we must always increment v here, because later code depends on the message being in iov[5]. Modified: head/usr.sbin/syslogd/syslogd.c Modified: head/usr.sbin/syslogd/syslogd.c ============================================================================== --- head/usr.sbin/syslogd/syslogd.c Wed Jan 19 17:11:52 2011 (r217588) +++ head/usr.sbin/syslogd/syslogd.c Wed Jan 19 17:17:37 2011 (r217589) @@ -1093,8 +1093,9 @@ fprintlog(struct filed *f, int flags, co v->iov_len = snprintf(greetings, sizeof greetings, "\r\n\7Message from syslogd@%s at %.24s ...\r\n", f->f_prevhost, f->f_lasttime); - if (v->iov_len > 0) - v++; + if (v->iov_len >= sizeof greetings) + v->iov_len = sizeof greetings - 1; + v++; v->iov_base = nul; v->iov_len = 0; v++; From owner-svn-src-all@FreeBSD.ORG Wed Jan 19 17:18:22 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F2F311065673; Wed, 19 Jan 2011 17:18:21 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 4A7838FC0A; Wed, 19 Jan 2011 17:18:20 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id p0JHI729006337 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 19 Jan 2011 19:18:07 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id p0JHI7wI019294; Wed, 19 Jan 2011 19:18:07 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id p0JHI7w2019293; Wed, 19 Jan 2011 19:18:07 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 19 Jan 2011 19:18:07 +0200 From: Kostik Belousov To: Jung-uk Kim Message-ID: <20110119171807.GA2518@deviant.kiev.zoral.com.ua> References: <201101191709.p0JH97ZD083132@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="cr8px54RfQr1fJtZ" Content-Disposition: inline In-Reply-To: <201101191709.p0JH97ZD083132@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r217587 - head/sys/i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 17:18:22 -0000 --cr8px54RfQr1fJtZ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jan 19, 2011 at 05:09:07PM +0000, Jung-uk Kim wrote: > Author: jkim > Date: Wed Jan 19 17:09:07 2011 > New Revision: 217587 > URL: http://svn.freebsd.org/changeset/base/217587 >=20 > Log: > Fix yet another fallout from r208833. VM86 BIOS call may cause page fa= ult > when FPU is in use. > =20 > Reported by: Marc UBM Bocklet (ubm dot freebsd at googlemail dot com) > Tested by: b. f. (bf1783 at googlemail dot com) > MFC after: 3 days >=20 > Modified: > head/sys/i386/i386/vm86bios.s >=20 > Modified: head/sys/i386/i386/vm86bios.s > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/i386/i386/vm86bios.s Wed Jan 19 17:04:07 2011 (r217586) > +++ head/sys/i386/i386/vm86bios.s Wed Jan 19 17:09:07 2011 (r217587) > @@ -73,10 +73,9 @@ ENTRY(vm86_bioscall) > je 1f /* no curproc/npxproc */ > pushl %edx > movl TD_PCB(%ecx),%ecx > - addl $PCB_SAVEFPU,%ecx > - pushl %ecx > + pushl PCB_SAVEFPU(%ecx) > call npxsave > - popl %ecx > + addl $4,%esp > popl %edx /* recover our pcb */ > 1: > popfl vm86_bioscall() in fact inlines the old version of npxexit(). Shouldn't the npxexit() be called from C code before call to vm86_bioscall ? Also, if bioscall can be used from the syscall context, I think whatever npxsave()/npxexit() is used, and BIOS modifies FPU state, we are corrupting usermode FPU context. Probably, fpu_kern_enter()/fpu_kern_leave() braces around vm86_bioscall is proper solution. --cr8px54RfQr1fJtZ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk03HM4ACgkQC3+MBN1Mb4gPWQCfTYpj25dyrceaOrmyYExO+Bpm uUMAoIUUH5eMvveKA7peZujUuRfBSJCE =WeQF -----END PGP SIGNATURE----- --cr8px54RfQr1fJtZ-- From owner-svn-src-all@FreeBSD.ORG Wed Jan 19 17:40:59 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 67477106566C; Wed, 19 Jan 2011 17:40:59 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 56BAB8FC16; Wed, 19 Jan 2011 17:40:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0JHexXP083989; Wed, 19 Jan 2011 17:40:59 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0JHewfh083987; Wed, 19 Jan 2011 17:40:59 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201101191740.p0JHewfh083987@svn.freebsd.org> From: Bernhard Schmidt Date: Wed, 19 Jan 2011 17:40:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217590 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 17:40:59 -0000 Author: bschmidt Date: Wed Jan 19 17:40:58 2011 New Revision: 217590 URL: http://svn.freebsd.org/changeset/base/217590 Log: Jump to the next element and not to an arbitrary point. frm[1] contains the element's data length, frm[2] is the first byte of the element's data. Submitted by: Monthadar Al Jaberi MFC after: 1 week Modified: head/sys/net80211/ieee80211_mesh.c Modified: head/sys/net80211/ieee80211_mesh.c ============================================================================== --- head/sys/net80211/ieee80211_mesh.c Wed Jan 19 17:17:37 2011 (r217589) +++ head/sys/net80211/ieee80211_mesh.c Wed Jan 19 17:40:58 2011 (r217590) @@ -1463,7 +1463,7 @@ mesh_recv_mgmt(struct ieee80211_node *ni meshid = frm; break; } - frm += frm[2] + 2; + frm += frm[1] + 2; } IEEE80211_VERIFY_ELEMENT(ssid, IEEE80211_NWID_LEN, return); IEEE80211_VERIFY_ELEMENT(rates, IEEE80211_RATE_MAXSIZE, return); From owner-svn-src-all@FreeBSD.ORG Wed Jan 19 18:11:10 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 3B65E10656A5; Wed, 19 Jan 2011 18:11:09 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: Kostik Belousov Date: Wed, 19 Jan 2011 13:11:01 -0500 User-Agent: KMail/1.6.2 References: <201101191709.p0JH97ZD083132@svn.freebsd.org> <20110119171807.GA2518@deviant.kiev.zoral.com.ua> In-Reply-To: <20110119171807.GA2518@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201101191311.03440.jkim@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r217587 - head/sys/i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 18:11:10 -0000 On Wednesday 19 January 2011 12:18 pm, Kostik Belousov wrote: > On Wed, Jan 19, 2011 at 05:09:07PM +0000, Jung-uk Kim wrote: > > Author: jkim > > Date: Wed Jan 19 17:09:07 2011 > > New Revision: 217587 > > URL: http://svn.freebsd.org/changeset/base/217587 > > > > Log: > > Fix yet another fallout from r208833. VM86 BIOS call may cause > > page fault when FPU is in use. > > > > Reported by: Marc UBM Bocklet (ubm dot freebsd at googlemail > > dot com) Tested by: b. f. (bf1783 at googlemail dot com) > > MFC after: 3 days > > > > Modified: > > head/sys/i386/i386/vm86bios.s > > > > Modified: head/sys/i386/i386/vm86bios.s > > ================================================================= > >============= --- head/sys/i386/i386/vm86bios.s Wed Jan 19 > > 17:04:07 2011 (r217586) +++ head/sys/i386/i386/vm86bios.s Wed Jan > > 19 17:09:07 2011 (r217587) @@ -73,10 +73,9 @@ > > ENTRY(vm86_bioscall) > > je 1f /* no curproc/npxproc */ > > pushl %edx > > movl TD_PCB(%ecx),%ecx > > - addl $PCB_SAVEFPU,%ecx > > - pushl %ecx > > + pushl PCB_SAVEFPU(%ecx) > > call npxsave > > - popl %ecx > > + addl $4,%esp > > popl %edx /* recover our pcb */ > > 1: > > popfl > > vm86_bioscall() in fact inlines the old version of npxexit(). > Shouldn't the npxexit() be called from C code before call to > vm86_bioscall ? I think we can but I don't like redundant or nested uses of critical_enter()/critical_exit() from vm86_intcall()/vm86_datacall(). And I don't think that's worth the code churn. > Also, if bioscall can be used from the syscall context, I think > whatever npxsave()/npxexit() is used, and BIOS modifies FPU > state, we are corrupting usermode FPU context. > > Probably, fpu_kern_enter()/fpu_kern_leave() braces around > vm86_bioscall is proper solution. BIOS should never modify FPU state, AFAIK. Jung-uk Kim From owner-svn-src-all@FreeBSD.ORG Wed Jan 19 18:20:11 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C5E0D106564A; Wed, 19 Jan 2011 18:20:11 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B56018FC1C; Wed, 19 Jan 2011 18:20:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0JIKBUn084885; Wed, 19 Jan 2011 18:20:11 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0JIKBXq084883; Wed, 19 Jan 2011 18:20:11 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201101191820.p0JIKBXq084883@svn.freebsd.org> From: Jack F Vogel Date: Wed, 19 Jan 2011 18:20:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217591 - head/sys/dev/e1000 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 18:20:11 -0000 Author: jfv Date: Wed Jan 19 18:20:11 2011 New Revision: 217591 URL: http://svn.freebsd.org/changeset/base/217591 Log: Fix for kern/152853, pullup at the wrong point is breaking UDP. Thanks to Petr Lampa for the patch. Modified: head/sys/dev/e1000/if_em.c Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Wed Jan 19 17:40:58 2011 (r217590) +++ head/sys/dev/e1000/if_em.c Wed Jan 19 18:20:11 2011 (r217591) @@ -1820,12 +1820,12 @@ em_xmit(struct tx_ring *txr, struct mbuf } ip = (struct ip *)(mtod(m_head, char *) + ip_off); poff = ip_off + (ip->ip_hl << 2); - m_head = m_pullup(m_head, poff + sizeof(struct tcphdr)); - if (m_head == NULL) { - *m_headp = NULL; - return (ENOBUFS); - } if (do_tso) { + m_head = m_pullup(m_head, poff + sizeof(struct tcphdr)); + if (m_head == NULL) { + *m_headp = NULL; + return (ENOBUFS); + } tp = (struct tcphdr *)(mtod(m_head, char *) + poff); /* * TSO workaround: @@ -1849,6 +1849,11 @@ em_xmit(struct tx_ring *txr, struct mbuf tp->th_sum = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr, htons(IPPROTO_TCP)); } else if (m_head->m_pkthdr.csum_flags & CSUM_TCP) { + m_head = m_pullup(m_head, poff + sizeof(struct tcphdr)); + if (m_head == NULL) { + *m_headp = NULL; + return (ENOBUFS); + } tp = (struct tcphdr *)(mtod(m_head, char *) + poff); m_head = m_pullup(m_head, poff + (tp->th_off << 2)); if (m_head == NULL) { From owner-svn-src-all@FreeBSD.ORG Wed Jan 19 18:51:14 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 31A90106566C; Wed, 19 Jan 2011 18:51:14 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id CCD188FC0A; Wed, 19 Jan 2011 18:51:12 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 1093845F66; Wed, 19 Jan 2011 19:51:11 +0100 (CET) Received: from localhost (89-73-192-49.dynamic.chello.pl [89.73.192.49]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id E6BDE45F28; Wed, 19 Jan 2011 19:51:05 +0100 (CET) Date: Wed, 19 Jan 2011 19:50:56 +0100 From: Pawel Jakub Dawidek To: Konstantin Belousov Message-ID: <20110119185056.GA2178@garage.freebsd.pl> References: <201101182300.p0IN0MJ4055088@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="a8Wt8u1KmwUX3Y2C" Content-Disposition: inline In-Reply-To: <201101182300.p0IN0MJ4055088@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 9.0-CURRENT amd64 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-0.6 required=4.5 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.4 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r217564 - head/sys/amd64/amd64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 18:51:14 -0000 --a8Wt8u1KmwUX3Y2C Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jan 18, 2011 at 11:00:22PM +0000, Konstantin Belousov wrote: > Author: kib > Date: Tue Jan 18 23:00:22 2011 > New Revision: 217564 > URL: http://svn.freebsd.org/changeset/base/217564 >=20 > Log: > Make the length of the LDT a loader tunable, machdep.max_ldt_segment, > and export it with read-only sysctl. Remove unused defines. > =20 > Reviewed by: jhb (previous version) > MFC after: 1 week >=20 > Modified: > head/sys/amd64/amd64/sys_machdep.c >=20 > Modified: head/sys/amd64/amd64/sys_machdep.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/amd64/amd64/sys_machdep.c Tue Jan 18 22:56:10 2011 (r217563) > +++ head/sys/amd64/amd64/sys_machdep.c Tue Jan 18 23:00:22 2011 (r217564) > @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); > =20 > #include > #include > +#include > #include > #include > #include > @@ -58,9 +59,24 @@ __FBSDID("$FreeBSD$"); > =20 > #include > =20 > +#define MAX_LD 8192 > + > int max_ldt_segment =3D 1024; > -#define LD_PER_PAGE 512 > -#define NULL_LDT_BASE ((caddr_t)NULL) > +SYSCTL_INT(_machdep, OID_AUTO, max_ldt_segment, CTLFLAG_RD, &max_ldt_seg= ment, Please, use CTLFLAG_RDTUN if tunable also exist. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --a8Wt8u1KmwUX3Y2C Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAk03Mo8ACgkQForvXbEpPzQeaACgipel8IRG4oTIMh3p3k0n8HzF U9oAnR/6WUyeM7LL5N3aIKryUc5t3ECk =lOk5 -----END PGP SIGNATURE----- --a8Wt8u1KmwUX3Y2C-- From owner-svn-src-all@FreeBSD.ORG Wed Jan 19 19:07:16 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6786C1065672; Wed, 19 Jan 2011 19:07:16 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 571E98FC14; Wed, 19 Jan 2011 19:07:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0JJ7GKD086062; Wed, 19 Jan 2011 19:07:16 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0JJ7GMp086060; Wed, 19 Jan 2011 19:07:16 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <201101191907.p0JJ7GMp086060@svn.freebsd.org> From: Randall Stewart Date: Wed, 19 Jan 2011 19:07: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: r217592 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 19:07:16 -0000 Author: rrs Date: Wed Jan 19 19:07:16 2011 New Revision: 217592 URL: http://svn.freebsd.org/changeset/base/217592 Log: Fix a bug where Multicast packets sent from a udp endpoint may end up echoing back to the sender even with OUT joining the multi-cast group. Reviewed by: gnn, bms, bz? Obtained from: deischen (with help from) Modified: head/sys/netinet/udp_usrreq.c Modified: head/sys/netinet/udp_usrreq.c ============================================================================== --- head/sys/netinet/udp_usrreq.c Wed Jan 19 18:20:11 2011 (r217591) +++ head/sys/netinet/udp_usrreq.c Wed Jan 19 19:07:16 2011 (r217592) @@ -479,11 +479,13 @@ udp_input(struct mbuf *m, int off) * and source-specific multicast. [RFC3678] */ imo = inp->inp_moptions; - if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr)) && - imo != NULL) { + if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr))) { struct sockaddr_in group; int blocked; - + if(imo == NULL) { + INP_RUNLOCK(inp); + continue; + } bzero(&group, sizeof(struct sockaddr_in)); group.sin_len = sizeof(struct sockaddr_in); group.sin_family = AF_INET; From owner-svn-src-all@FreeBSD.ORG Wed Jan 19 19:23:26 2011 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A849106564A; Wed, 19 Jan 2011 19:23:26 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id ED9868FC0C; Wed, 19 Jan 2011 19:23:25 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id p0JJK9AA023229; Wed, 19 Jan 2011 12:20:10 -0700 (MST) (envelope-from imp@bsdimp.com) Message-ID: <4D373969.1040301@bsdimp.com> Date: Wed, 19 Jan 2011 12:20:09 -0700 From: Warner Losh User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.13) Gecko/20101211 Thunderbird/3.1.7 MIME-Version: 1.0 To: Peter Jeremy References: <201101181523.p0IFNGeB042079@svn.freebsd.org> <20110119055635.GA90983@server.vk2pj.dyndns.org> In-Reply-To: <20110119055635.GA90983@server.vk2pj.dyndns.org> 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, John Baldwin Subject: Re: svn commit: r217538 - in head/sys/dev: buslogic cs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 19:23:26 -0000 On 01/18/2011 22:56, Peter Jeremy wrote: > On 2011-Jan-18 15:23:16 +0000, John Baldwin wrote: >> Log: >> Remove some always-true comparisons. > ... >> --- head/sys/dev/cs/if_cs.c Tue Jan 18 14:58:44 2011 (r217537) >> +++ head/sys/dev/cs/if_cs.c Tue Jan 18 15:23:16 2011 (r217538) >> @@ -364,7 +364,7 @@ cs_cs89x0_probe(device_t dev) >> >> if (!error&& !(sc->flags& CS_NO_IRQ)) { >> if (chip_type == CS8900) { >> - if (irq>= 0 || irq< 16) >> + if (irq< 16) >> irq = cs8900_irq2eeint[irq]; >> else >> irq = 255; > Irrespective of the signedness or otherwise of "irq", I'm fairly > certain that '||' should have been '&&' before. Yes. The old code was clearly wrong when a bogus IRQ was set. Thankfully this was kinda hard to do and only affected ISA cards that didn't have the IRQ setup with the DOS utility. Most of the ones I've seen have this setup, so it isn't surprising this bug lurked here for that long. The new code is correct. Warner From owner-svn-src-all@FreeBSD.ORG Wed Jan 19 19:36:27 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9A30A1065670; Wed, 19 Jan 2011 19:36:27 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 88B218FC1A; Wed, 19 Jan 2011 19:36:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0JJaR3l086687; Wed, 19 Jan 2011 19:36:27 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0JJaRLJ086682; Wed, 19 Jan 2011 19:36:27 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201101191936.p0JJaRLJ086682@svn.freebsd.org> From: Jack F Vogel Date: Wed, 19 Jan 2011 19:36: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: r217593 - head/sys/dev/ixgbe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 19:36:27 -0000 Author: jfv Date: Wed Jan 19 19:36:27 2011 New Revision: 217593 URL: http://svn.freebsd.org/changeset/base/217593 Log: Update driver to version 2.3.8: CRITICAL FIX - with stats changes the older 82598 will panic and trash the stack on driver load, FCOE registers ONLY exist in 82599 and must not be read otherwise. kern/153951 - to correct incorrect media type on adapters with pluggable modules I have eliminated the old static table in favor of a new dynamic shared code routine. This also has the benefit of detecting changes when a different module is inserted. Performance/enhancement to the Flow Director code from my linux coworker (the developer of the code). Fixes from Michael Tuexen - a data corruption problem on the 82599 (CRITICAL), fix so the buf size correctly adjusts as the cluster changes, and max descriptors are set properly. Also added 16K clusters for those REALLY big jumbos :) In the RX path, the RX LOCK was not being released, and this causes LOR problems. Add the code that igb already has. Sync with in house shared code, this was necessary for the Flow Director fix. MFC in 2 days Modified: head/sys/dev/ixgbe/ixgbe.c head/sys/dev/ixgbe/ixgbe.h head/sys/dev/ixgbe/ixgbe_82599.c head/sys/dev/ixgbe/ixgbe_api.h head/sys/dev/ixgbe/ixgbe_common.c head/sys/dev/ixgbe/ixgbe_common.h head/sys/dev/ixgbe/ixgbe_mbx.c head/sys/dev/ixgbe/ixgbe_type.h Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Wed Jan 19 19:07:16 2011 (r217592) +++ head/sys/dev/ixgbe/ixgbe.c Wed Jan 19 19:36:27 2011 (r217593) @@ -46,7 +46,7 @@ int ixgbe_display_debug_stat /********************************************************************* * Driver version *********************************************************************/ -char ixgbe_driver_version[] = "2.3.7"; +char ixgbe_driver_version[] = "2.3.8"; /********************************************************************* * PCI Device ID Table @@ -175,6 +175,7 @@ static __inline void ixgbe_rx_input(stru /* Support for pluggable optic modules */ static bool ixgbe_sfp_probe(struct adapter *); +static void ixgbe_setup_optics(struct adapter *); /* Legacy (single vector interrupt handler */ static void ixgbe_legacy_irq(void *); @@ -290,13 +291,6 @@ TUNABLE_INT("hw.ixgbe.rxd", &ixgbe_rxd); /* Keep running tab on them for sanity check */ static int ixgbe_total_ports; -/* -** The number of scatter-gather segments -** differs for 82598 and 82599, default to -** the former. -*/ -static int ixgbe_num_segs = IXGBE_82598_SCATTER; - #ifdef IXGBE_FDIR /* ** For Flow Director: this is the @@ -386,7 +380,7 @@ ixgbe_attach(device_t dev) struct adapter *adapter; struct ixgbe_hw *hw; int error = 0; - u16 pci_device_id, csum; + u16 csum; u32 ctrl_ext; INIT_DEBUGOUT("ixgbe_attach: begin"); @@ -399,52 +393,6 @@ ixgbe_attach(device_t dev) /* Core Lock Init*/ IXGBE_CORE_LOCK_INIT(adapter, device_get_nameunit(dev)); - /* Keep track of optics */ - pci_device_id = pci_get_device(dev); - switch (pci_device_id) { - case IXGBE_DEV_ID_82598_CX4_DUAL_PORT: - case IXGBE_DEV_ID_82598EB_CX4: - adapter->optics = IFM_10G_CX4; - break; - case IXGBE_DEV_ID_82598: - case IXGBE_DEV_ID_82598AF_DUAL_PORT: - case IXGBE_DEV_ID_82598AF_SINGLE_PORT: - case IXGBE_DEV_ID_82598_SR_DUAL_PORT_EM: - case IXGBE_DEV_ID_82598EB_SFP_LOM: - case IXGBE_DEV_ID_82598AT: - adapter->optics = IFM_10G_SR; - break; - case IXGBE_DEV_ID_82598AT2: - adapter->optics = IFM_10G_T; - break; - case IXGBE_DEV_ID_82598EB_XF_LR: - adapter->optics = IFM_10G_LR; - break; - case IXGBE_DEV_ID_82599_SFP: - adapter->optics = IFM_10G_SR; - ixgbe_num_segs = IXGBE_82599_SCATTER; - break; - case IXGBE_DEV_ID_82598_DA_DUAL_PORT : - adapter->optics = IFM_10G_TWINAX; - break; - case IXGBE_DEV_ID_82599_KX4: - case IXGBE_DEV_ID_82599_KX4_MEZZ: - case IXGBE_DEV_ID_82599_CX4: - adapter->optics = IFM_10G_CX4; - ixgbe_num_segs = IXGBE_82599_SCATTER; - break; - case IXGBE_DEV_ID_82599_XAUI_LOM: - case IXGBE_DEV_ID_82599_COMBO_BACKPLANE: - ixgbe_num_segs = IXGBE_82599_SCATTER; - break; - case IXGBE_DEV_ID_82599_T3_LOM: - ixgbe_num_segs = IXGBE_82599_SCATTER; - adapter->optics = IFM_10G_T; - default: - ixgbe_num_segs = IXGBE_82599_SCATTER; - break; - } - /* SYSCTL APIs */ SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), @@ -547,10 +495,6 @@ ixgbe_attach(device_t dev) goto err_late; } - /* Pick up the smart speed setting */ - if (hw->mac.type == ixgbe_mac_82599EB) - hw->phy.smart_speed = ixgbe_smart_speed; - /* Get Hardware Flow Control setting */ hw->fc.requested_mode = ixgbe_fc_full; hw->fc.pause_time = IXGBE_FC_PAUSE; @@ -574,6 +518,9 @@ ixgbe_attach(device_t dev) goto err_late; } + /* Detect and set physical type */ + ixgbe_setup_optics(adapter); + if ((adapter->msix > 1) && (ixgbe_enable_msix)) error = ixgbe_allocate_msix(adapter); else @@ -1054,7 +1001,7 @@ ixgbe_init_locked(struct adapter *adapte return; } - ixgbe_reset_hw(hw); + ixgbe_init_hw(hw); ixgbe_initialize_transmit_units(adapter); /* Setup Multicast table */ @@ -1068,8 +1015,10 @@ ixgbe_init_locked(struct adapter *adapte adapter->rx_mbuf_sz = MCLBYTES; else if (adapter->max_frame_size <= 4096) adapter->rx_mbuf_sz = MJUMPAGESIZE; - else + else if (adapter->max_frame_size <= 9216) adapter->rx_mbuf_sz = MJUM9BYTES; + else + adapter->rx_mbuf_sz = MJUM16BYTES; /* Prepare receive descriptors and buffers */ if (ixgbe_setup_receive_structures(adapter)) { @@ -1600,7 +1549,7 @@ ixgbe_xmit(struct tx_ring *txr, struct m int i, j, error, nsegs; int first, last = 0; struct mbuf *m_head; - bus_dma_segment_t segs[ixgbe_num_segs]; + bus_dma_segment_t segs[adapter->num_segs]; bus_dmamap_t map; struct ixgbe_tx_buf *txbuf, *txbuf_mapped; union ixgbe_adv_tx_desc *txd = NULL; @@ -2010,16 +1959,68 @@ static void ixgbe_identify_hardware(struct adapter *adapter) { device_t dev = adapter->dev; + struct ixgbe_hw *hw = &adapter->hw; /* Save off the information about this board */ - adapter->hw.vendor_id = pci_get_vendor(dev); - adapter->hw.device_id = pci_get_device(dev); - adapter->hw.revision_id = pci_read_config(dev, PCIR_REVID, 1); - adapter->hw.subsystem_vendor_id = + hw->vendor_id = pci_get_vendor(dev); + hw->device_id = pci_get_device(dev); + hw->revision_id = pci_read_config(dev, PCIR_REVID, 1); + hw->subsystem_vendor_id = pci_read_config(dev, PCIR_SUBVEND_0, 2); - adapter->hw.subsystem_device_id = + hw->subsystem_device_id = pci_read_config(dev, PCIR_SUBDEV_0, 2); + /* We need this here to set the num_segs below */ + ixgbe_set_mac_type(hw); + + /* Pick up the 82599 and VF settings */ + if (hw->mac.type != ixgbe_mac_82598EB) { + hw->phy.smart_speed = ixgbe_smart_speed; + adapter->num_segs = IXGBE_82599_SCATTER; + } else + adapter->num_segs = IXGBE_82598_SCATTER; + + return; +} + +/********************************************************************* + * + * Determine optic type + * + **********************************************************************/ +static void +ixgbe_setup_optics(struct adapter *adapter) +{ + struct ixgbe_hw *hw = &adapter->hw; + int layer; + + layer = ixgbe_get_supported_physical_layer(hw); + switch (layer) { + case IXGBE_PHYSICAL_LAYER_10GBASE_T: + adapter->optics = IFM_10G_T; + break; + case IXGBE_PHYSICAL_LAYER_1000BASE_T: + adapter->optics = IFM_1000_T; + break; + case IXGBE_PHYSICAL_LAYER_10GBASE_LR: + case IXGBE_PHYSICAL_LAYER_10GBASE_LRM: + adapter->optics = IFM_10G_LR; + break; + case IXGBE_PHYSICAL_LAYER_10GBASE_SR: + adapter->optics = IFM_10G_SR; + break; + case IXGBE_PHYSICAL_LAYER_10GBASE_KX4: + case IXGBE_PHYSICAL_LAYER_10GBASE_CX4: + adapter->optics = IFM_10G_CX4; + break; + case IXGBE_PHYSICAL_LAYER_1000BASE_KX: + case IXGBE_PHYSICAL_LAYER_10GBASE_KR: + case IXGBE_PHYSICAL_LAYER_10GBASE_XAUI: + case IXGBE_PHYSICAL_LAYER_UNKNOWN: + default: + adapter->optics = IFM_ETHER | IFM_AUTO; + break; + } return; } @@ -2216,8 +2217,8 @@ ixgbe_setup_msix(struct adapter *adapter if (ixgbe_num_queues != 0) queues = ixgbe_num_queues; - /* Set max queues to 8 */ - else if (queues > 8) + /* Set max queues to 8 when autoconfiguring */ + else if ((ixgbe_num_queues == 0) && (queues > 8)) queues = 8; /* @@ -2413,8 +2414,8 @@ ixgbe_setup_interface(device_t dev, stru */ ifmedia_init(&adapter->media, IFM_IMASK, ixgbe_media_change, ixgbe_media_status); - ifmedia_add(&adapter->media, IFM_ETHER | adapter->optics | - IFM_FDX, 0, NULL); + ifmedia_add(&adapter->media, IFM_ETHER | adapter->optics, 0, NULL); + ifmedia_set(&adapter->media, IFM_ETHER | adapter->optics); if (hw->device_id == IXGBE_DEV_ID_82598AT) { ifmedia_add(&adapter->media, IFM_ETHER | IFM_1000_T | IFM_FDX, 0, NULL); @@ -2718,7 +2719,7 @@ ixgbe_allocate_transmit_buffers(struct t BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ IXGBE_TSO_SIZE, /* maxsize */ - ixgbe_num_segs, /* nsegments */ + adapter->num_segs, /* nsegments */ PAGE_SIZE, /* maxsegsize */ 0, /* flags */ NULL, /* lockfunc */ @@ -3181,72 +3182,67 @@ ixgbe_atr(struct tx_ring *txr, struct mb { struct adapter *adapter = txr->adapter; struct ix_queue *que; - union ixgbe_atr_input atr_input; struct ip *ip; struct tcphdr *th; struct udphdr *uh; struct ether_vlan_header *eh; + union ixgbe_atr_hash_dword input = {.dword = 0}; + union ixgbe_atr_hash_dword common = {.dword = 0}; int ehdrlen, ip_hlen; - u16 etype, vlan_id, src_port, dst_port, flex_bytes; - u32 src_ipv4_addr, dst_ipv4_addr; - u8 l4type = 0, ipproto = 0; + u16 etype; eh = mtod(mp, struct ether_vlan_header *); - if (eh->evl_encap_proto == htons(ETHERTYPE_VLAN)) + if (eh->evl_encap_proto == htons(ETHERTYPE_VLAN)) { ehdrlen = ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN; - else + etype = eh->evl_proto; + } else { ehdrlen = ETHER_HDR_LEN; - etype = ntohs(eh->evl_proto); + etype = eh->evl_encap_proto; + } /* Only handling IPv4 */ - if (etype != ETHERTYPE_IP) + if (etype != htons(ETHERTYPE_IP)) return; ip = (struct ip *)(mp->m_data + ehdrlen); - ipproto = ip->ip_p; ip_hlen = ip->ip_hl << 2; - src_port = dst_port = 0; /* check if we're UDP or TCP */ - switch (ipproto) { + switch (ip->ip_p) { case IPPROTO_TCP: th = (struct tcphdr *)((caddr_t)ip + ip_hlen); - src_port = th->th_sport; - dst_port = th->th_dport; - l4type |= IXGBE_ATR_L4TYPE_TCP; + /* src and dst are inverted */ + common.port.dst ^= th->th_sport; + common.port.src ^= th->th_dport; + input.formatted.flow_type ^= IXGBE_ATR_FLOW_TYPE_TCPV4; break; case IPPROTO_UDP: uh = (struct udphdr *)((caddr_t)ip + ip_hlen); - src_port = uh->uh_sport; - dst_port = uh->uh_dport; - l4type |= IXGBE_ATR_L4TYPE_UDP; + /* src and dst are inverted */ + common.port.dst ^= uh->uh_sport; + common.port.src ^= uh->uh_dport; + input.formatted.flow_type ^= IXGBE_ATR_FLOW_TYPE_UDPV4; break; default: return; } - memset(&atr_input, 0, sizeof(union ixgbe_atr_input)); + input.formatted.vlan_id = htobe16(mp->m_pkthdr.ether_vtag); + if (mp->m_pkthdr.ether_vtag) + common.flex_bytes ^= htons(ETHERTYPE_VLAN); + else + common.flex_bytes ^= etype; + common.ip ^= ip->ip_src.s_addr ^ ip->ip_dst.s_addr; - vlan_id = htole16(mp->m_pkthdr.ether_vtag); - src_ipv4_addr = ip->ip_src.s_addr; - dst_ipv4_addr = ip->ip_dst.s_addr; - flex_bytes = etype; que = &adapter->queues[txr->me]; - - ixgbe_atr_set_vlan_id_82599(&atr_input, vlan_id); - ixgbe_atr_set_src_port_82599(&atr_input, dst_port); - ixgbe_atr_set_dst_port_82599(&atr_input, src_port); - ixgbe_atr_set_flex_byte_82599(&atr_input, flex_bytes); - ixgbe_atr_set_l4type_82599(&atr_input, l4type); - /* src and dst are inverted, think how the receiver sees them */ - ixgbe_atr_set_src_ipv4_82599(&atr_input, dst_ipv4_addr); - ixgbe_atr_set_dst_ipv4_82599(&atr_input, src_ipv4_addr); - - /* This assumes the Rx queue and Tx queue are bound to the same CPU */ + /* + ** This assumes the Rx queue and Tx + ** queue are bound to the same CPU + */ ixgbe_fdir_add_signature_filter_82599(&adapter->hw, - &atr_input, que->msix); + input, common, que->msix); } -#endif +#endif /* IXGBE_FDIR */ /********************************************************************** * @@ -3508,9 +3504,9 @@ ixgbe_allocate_receive_buffers(struct rx BUS_SPACE_MAXADDR, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ - MJUM9BYTES, /* maxsize */ + MJUM16BYTES, /* maxsize */ 1, /* nsegments */ - MJUM9BYTES, /* maxsegsize */ + MJUM16BYTES, /* maxsegsize */ 0, /* flags */ NULL, /* lockfunc */ NULL, /* lockfuncarg */ @@ -3582,8 +3578,13 @@ ixgbe_setup_hw_rsc(struct rx_ring *rxr) */ if (adapter->rx_mbuf_sz == MCLBYTES) rscctrl |= IXGBE_RSCCTL_MAXDESC_16; - else /* using 4K clusters */ + else if (adapter->rx_mbuf_sz == MJUMPAGESIZE) rscctrl |= IXGBE_RSCCTL_MAXDESC_8; + else if (adapter->rx_mbuf_sz == MJUM9BYTES) + rscctrl |= IXGBE_RSCCTL_MAXDESC_4; + else /* Using 16K cluster */ + rscctrl |= IXGBE_RSCCTL_MAXDESC_1; + IXGBE_WRITE_REG(hw, IXGBE_RSCCTL(rxr->me), rscctrl); /* Enable TCP header recognition */ @@ -3821,15 +3822,14 @@ ixgbe_initialize_receive_units(struct ad /* Set for Jumbo Frames? */ hlreg = IXGBE_READ_REG(hw, IXGBE_HLREG0); - if (ifp->if_mtu > ETHERMTU) { + if (ifp->if_mtu > ETHERMTU) hlreg |= IXGBE_HLREG0_JUMBOEN; - bufsz = 4096 >> IXGBE_SRRCTL_BSIZEPKT_SHIFT; - } else { + else hlreg &= ~IXGBE_HLREG0_JUMBOEN; - bufsz = 2048 >> IXGBE_SRRCTL_BSIZEPKT_SHIFT; - } IXGBE_WRITE_REG(hw, IXGBE_HLREG0, hlreg); + bufsz = adapter->rx_mbuf_sz >> IXGBE_SRRCTL_BSIZEPKT_SHIFT; + for (int i = 0; i < adapter->num_queues; i++, rxr++) { u64 rdba = rxr->rxdma.dma_paddr; @@ -4028,7 +4028,9 @@ ixgbe_rx_input(struct rx_ring *rxr, stru if (tcp_lro_rx(&rxr->lro, m, 0) == 0) return; } + IXGBE_RX_UNLOCK(rxr); (*ifp->if_input)(ifp, m); + IXGBE_RX_LOCK(rxr); } static __inline void @@ -4289,8 +4291,11 @@ next_desc: i = 0; /* Now send to the stack or do LRO */ - if (sendmp != NULL) + if (sendmp != NULL) { + rxr->next_to_check = i; ixgbe_rx_input(rxr, ifp, sendmp, ptype); + i = rxr->next_to_check; + } /* Every 8 descriptors we go to refresh mbufs */ if (processed == 8) { @@ -4654,6 +4659,8 @@ static bool ixgbe_sfp_probe(struct adapt device_printf(dev,"SFP+ module detected!\n"); /* We now have supported optics */ adapter->sfp_probe = FALSE; + /* Set the optics type so system reports correctly */ + ixgbe_setup_optics(adapter); result = TRUE; } out: @@ -4718,10 +4725,6 @@ ixgbe_handle_msf(void *context, int pend hw->mac.ops.get_link_capabilities(hw, &autoneg, &negotiate); if (hw->mac.ops.setup_link) hw->mac.ops.setup_link(hw, autoneg, negotiate, TRUE); -#if 0 - ixgbe_check_link(&adapter->hw, &speed, &adapter->link_up, 0); - ixgbe_update_link_status(adapter); -#endif return; } @@ -4830,7 +4833,8 @@ ixgbe_update_stats_counters(struct adapt bprc = IXGBE_READ_REG(hw, IXGBE_BPRC); adapter->stats.bprc += bprc; adapter->stats.mprc += IXGBE_READ_REG(hw, IXGBE_MPRC); - adapter->stats.mprc -= bprc; + if (hw->mac.type == ixgbe_mac_82598EB) + adapter->stats.mprc -= bprc; adapter->stats.prc64 += IXGBE_READ_REG(hw, IXGBE_PRC64); adapter->stats.prc127 += IXGBE_READ_REG(hw, IXGBE_PRC127); @@ -4871,12 +4875,14 @@ ixgbe_update_stats_counters(struct adapt adapter->stats.xec += IXGBE_READ_REG(hw, IXGBE_XEC); adapter->stats.fccrc += IXGBE_READ_REG(hw, IXGBE_FCCRC); adapter->stats.fclast += IXGBE_READ_REG(hw, IXGBE_FCLAST); - adapter->stats.fcoerpdc += IXGBE_READ_REG(hw, IXGBE_FCOERPDC); - adapter->stats.fcoeprc += IXGBE_READ_REG(hw, IXGBE_FCOEPRC); - adapter->stats.fcoeptc += IXGBE_READ_REG(hw, IXGBE_FCOEPTC); - adapter->stats.fcoedwrc += IXGBE_READ_REG(hw, IXGBE_FCOEDWRC); - adapter->stats.fcoedwtc += IXGBE_READ_REG(hw, IXGBE_FCOEDWTC); - + /* Only read FCOE on 82599 */ + if (hw->mac.type == ixgbe_mac_82599EB) { + adapter->stats.fcoerpdc += IXGBE_READ_REG(hw, IXGBE_FCOERPDC); + adapter->stats.fcoeprc += IXGBE_READ_REG(hw, IXGBE_FCOEPRC); + adapter->stats.fcoeptc += IXGBE_READ_REG(hw, IXGBE_FCOEPTC); + adapter->stats.fcoedwrc += IXGBE_READ_REG(hw, IXGBE_FCOEDWRC); + adapter->stats.fcoedwtc += IXGBE_READ_REG(hw, IXGBE_FCOEDWTC); + } /* Fill out the OS statistics structure */ ifp->if_ipackets = adapter->stats.gprc; @@ -5012,18 +5018,6 @@ ixgbe_add_hw_stats(struct adapter *adapt SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "mbuf_defrag_failed", CTLFLAG_RD, &adapter->mbuf_defrag_failed, "m_defrag() failed"); -#if 0 - /* These counters are not updated by the software */ - SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "mbuf_header_failed", - CTLFLAG_RD, &adapter->mbuf_header_failed, - "???"); - SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "mbuf_packet_failed", - CTLFLAG_RD, &adapter->mbuf_packet_failed, - "???"); - SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "no_tx_map_avail", - CTLFLAG_RD, &adapter->no_tx_map_avail, - "???"); -#endif SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "no_tx_dma_setup", CTLFLAG_RD, &adapter->no_tx_dma_setup, "Driver tx dma failure in xmit"); Modified: head/sys/dev/ixgbe/ixgbe.h ============================================================================== --- head/sys/dev/ixgbe/ixgbe.h Wed Jan 19 19:07:16 2011 (r217592) +++ head/sys/dev/ixgbe/ixgbe.h Wed Jan 19 19:36:27 2011 (r217593) @@ -385,6 +385,7 @@ struct adapter { int advertise; /* link speeds */ bool link_active; u16 max_frame_size; + u16 num_segs; u32 link_speed; bool link_up; u32 linkvec; Modified: head/sys/dev/ixgbe/ixgbe_82599.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe_82599.c Wed Jan 19 19:07:16 2011 (r217592) +++ head/sys/dev/ixgbe/ixgbe_82599.c Wed Jan 19 19:36:27 2011 (r217593) @@ -67,13 +67,13 @@ s32 ixgbe_reset_hw_82599(struct ixgbe_hw s32 ixgbe_read_analog_reg8_82599(struct ixgbe_hw *hw, u32 reg, u8 *val); s32 ixgbe_write_analog_reg8_82599(struct ixgbe_hw *hw, u32 reg, u8 val); s32 ixgbe_start_hw_rev_1_82599(struct ixgbe_hw *hw); -void ixgbe_enable_relaxed_ordering_82599(struct ixgbe_hw *hw); s32 ixgbe_identify_phy_82599(struct ixgbe_hw *hw); s32 ixgbe_init_phy_ops_82599(struct ixgbe_hw *hw); u32 ixgbe_get_supported_physical_layer_82599(struct ixgbe_hw *hw); s32 ixgbe_enable_rx_dma_82599(struct ixgbe_hw *hw, u32 regval); -s32 ixgbe_get_device_caps_82599(struct ixgbe_hw *hw, u16 *device_caps); static s32 ixgbe_verify_fw_version_82599(struct ixgbe_hw *hw); +bool ixgbe_verify_lesm_fw_enabled_82599(struct ixgbe_hw *hw); + void ixgbe_init_mac_link_ops_82599(struct ixgbe_hw *hw) { @@ -101,7 +101,8 @@ void ixgbe_init_mac_link_ops_82599(struc } else { if ((ixgbe_get_media_type(hw) == ixgbe_media_type_backplane) && (hw->phy.smart_speed == ixgbe_smart_speed_auto || - hw->phy.smart_speed == ixgbe_smart_speed_on)) { + hw->phy.smart_speed == ixgbe_smart_speed_on) && + !ixgbe_verify_lesm_fw_enabled_82599(hw)) { mac->ops.setup_link = &ixgbe_setup_mac_link_smartspeed; } else { mac->ops.setup_link = &ixgbe_setup_mac_link_82599; @@ -253,7 +254,7 @@ s32 ixgbe_init_ops_82599(struct ixgbe_hw /* MAC */ mac->ops.reset_hw = &ixgbe_reset_hw_82599; - mac->ops.enable_relaxed_ordering = &ixgbe_enable_relaxed_ordering_82599; + mac->ops.enable_relaxed_ordering = &ixgbe_enable_relaxed_ordering_gen2; mac->ops.get_media_type = &ixgbe_get_media_type_82599; mac->ops.get_supported_physical_layer = &ixgbe_get_supported_physical_layer_82599; @@ -263,7 +264,7 @@ s32 ixgbe_init_ops_82599(struct ixgbe_hw mac->ops.start_hw = &ixgbe_start_hw_rev_1_82599; mac->ops.get_san_mac_addr = &ixgbe_get_san_mac_addr_generic; mac->ops.set_san_mac_addr = &ixgbe_set_san_mac_addr_generic; - mac->ops.get_device_caps = &ixgbe_get_device_caps_82599; + mac->ops.get_device_caps = &ixgbe_get_device_caps_generic; mac->ops.get_wwn_prefix = &ixgbe_get_wwn_prefix_generic; mac->ops.get_fcoe_boot_status = &ixgbe_get_fcoe_boot_status_generic; @@ -1375,7 +1376,7 @@ s32 ixgbe_init_fdir_perfect_82599(struct * @stream: input bitstream to compute the hash on * @key: 32-bit hash key **/ -u16 ixgbe_atr_compute_hash_82599(union ixgbe_atr_input *atr_input, +u32 ixgbe_atr_compute_hash_82599(union ixgbe_atr_input *atr_input, u32 key) { /* @@ -1419,54 +1420,45 @@ u16 ixgbe_atr_compute_hash_82599(union i * */ __be32 common_hash_dword = 0; - u32 hi_hash_dword, lo_hash_dword; - u16 hash_result = 0; - u8 i; + u32 hi_hash_dword, lo_hash_dword, flow_vm_vlan; + u32 hash_result = 0; + u8 i; - /* - * the hi_hash_dword starts with vlan_id, the lo_hash_dword starts - * and ends with it, the vlan at the end is added via the word swapped - * xor with the hi_hash_dword a few lines down. - */ - hi_hash_dword = IXGBE_NTOHL(atr_input->dword_stream[0]) & 0x0000FFFF; - lo_hash_dword = hi_hash_dword; + /* record the flow_vm_vlan bits as they are a key part to the hash */ + flow_vm_vlan = IXGBE_NTOHL(atr_input->dword_stream[0]); /* generate common hash dword */ - for (i = 1; i < 11; i++) - common_hash_dword ^= (u32)atr_input->dword_stream[i]; - hi_hash_dword ^= IXGBE_NTOHL(common_hash_dword); + for (i = 10; i; i -= 2) + common_hash_dword ^= atr_input->dword_stream[i] ^ + atr_input->dword_stream[i - 1]; - /* low dword is word swapped version of common with vlan added */ - lo_hash_dword ^= (hi_hash_dword >> 16) | (hi_hash_dword << 16); + hi_hash_dword = IXGBE_NTOHL(common_hash_dword); - /* hi dword is common dword with l4type and vm_pool shifted */ - hi_hash_dword ^= IXGBE_NTOHL(atr_input->dword_stream[10]) << 16; + /* low dword is word swapped version of common */ + lo_hash_dword = (hi_hash_dword >> 16) | (hi_hash_dword << 16); + + /* apply flow ID/VM pool/VLAN ID bits to hash words */ + hi_hash_dword ^= flow_vm_vlan ^ (flow_vm_vlan >> 16); + + /* Process bits 0 and 16 */ + if (key & 0x0001) hash_result ^= lo_hash_dword; + if (key & 0x00010000) hash_result ^= hi_hash_dword; /* - * Process all 32 bits of the 2 keys 2 bits at a time - * - * Bit flip vlan from hash result if hash key has bit 0 set, the - * reason for doing this is because the hash generation shouldn't - * start until bit 1 in the stream so we need to cancel out a vlan - * if it was added starting at bit 0. - */ - if (key & 0x0001) { - hash_result ^= IXGBE_NTOHL(atr_input->dword_stream[0]) & - 0x0FFFF; - hash_result ^= lo_hash_dword; - } - if (key & 0x00010000) - hash_result ^= hi_hash_dword; - - /* process the remaining bits in the key */ - for (i = 1; i < 16; i++) { - if (key & (0x0001 << i)) - hash_result ^= lo_hash_dword >> i; - if (key & (0x00010000 << i)) - hash_result ^= hi_hash_dword >> i; + * apply flow ID/VM pool/VLAN ID bits to lo hash dword, we had to + * delay this because bit 0 of the stream should not be processed + * so we do not add the vlan until after bit 0 was processed + */ + lo_hash_dword ^= flow_vm_vlan ^ (flow_vm_vlan << 16); + + + /* process the remaining 30 bits in the key 2 bits at a time */ + for (i = 15; i; i-- ) { + if (key & (0x0001 << i)) hash_result ^= lo_hash_dword >> i; + if (key & (0x00010000 << i)) hash_result ^= hi_hash_dword >> i; } - return hash_result; + return hash_result & IXGBE_ATR_HASH_MASK; } /* @@ -1479,30 +1471,18 @@ u16 ixgbe_atr_compute_hash_82599(union i #define IXGBE_COMPUTE_SIG_HASH_ITERATION(_n) \ do { \ u32 n = (_n); \ - if (IXGBE_ATR_COMMON_HASH_KEY & (0x01 << n)) { \ - if (n == 0) \ - common_hash ^= \ - IXGBE_NTOHL(atr_input->dword_stream[0]) & \ - 0x0000FFFF; \ + if (IXGBE_ATR_COMMON_HASH_KEY & (0x01 << n)) \ common_hash ^= lo_hash_dword >> n; \ - } else if (IXGBE_ATR_BUCKET_HASH_KEY & (0x01 << n)) { \ - if (n == 0) \ - bucket_hash ^= \ - IXGBE_NTOHL(atr_input->dword_stream[0]) & \ - 0x0000FFFF; \ + else if (IXGBE_ATR_BUCKET_HASH_KEY & (0x01 << n)) \ bucket_hash ^= lo_hash_dword >> n; \ - } else if (IXGBE_ATR_SIGNATURE_HASH_KEY & (0x01 << n)) { \ - if (n == 0) \ - sig_hash ^= IXGBE_NTOHL(atr_input->dword_stream[0]) & \ - 0x0000FFFF; \ - sig_hash ^= lo_hash_dword >> n; \ - } \ - if (IXGBE_ATR_COMMON_HASH_KEY & (0x010000 << n)) \ + else if (IXGBE_ATR_SIGNATURE_HASH_KEY & (0x01 << n)) \ + sig_hash ^= lo_hash_dword << (16 - n); \ + if (IXGBE_ATR_COMMON_HASH_KEY & (0x01 << (n + 16))) \ common_hash ^= hi_hash_dword >> n; \ - else if (IXGBE_ATR_BUCKET_HASH_KEY & (0x010000 << n)) \ + else if (IXGBE_ATR_BUCKET_HASH_KEY & (0x01 << (n + 16))) \ bucket_hash ^= hi_hash_dword >> n; \ - else if (IXGBE_ATR_SIGNATURE_HASH_KEY & (0x010000 << n)) \ - sig_hash ^= hi_hash_dword >> n; \ + else if (IXGBE_ATR_SIGNATURE_HASH_KEY & (0x01 << (n + 16))) \ + sig_hash ^= hi_hash_dword << (16 - n); \ } while (0); /** @@ -1515,47 +1495,35 @@ do { \ * defines, and computing two keys at once since the hashed dword stream * will be the same for both keys. **/ -static u32 ixgbe_atr_compute_sig_hash_82599(union ixgbe_atr_input *atr_input) +static u32 ixgbe_atr_compute_sig_hash_82599(union ixgbe_atr_hash_dword input, + union ixgbe_atr_hash_dword common) { - u32 hi_hash_dword, lo_hash_dword; - u16 sig_hash = 0, bucket_hash = 0, common_hash = 0; + u32 hi_hash_dword, lo_hash_dword, flow_vm_vlan; + u32 sig_hash = 0, bucket_hash = 0, common_hash = 0; - /* - * the hi_hash_dword starts with vlan_id, the lo_hash_dword starts - * and ends with it, the vlan at the end is added via the word swapped - * xor with the hi_hash_dword a few lines down. The part masked off - * is the part of the hash reserved to 0. - */ - hi_hash_dword = IXGBE_NTOHL(atr_input->dword_stream[0]) & 0x0000FFFF; - lo_hash_dword = hi_hash_dword; + /* record the flow_vm_vlan bits as they are a key part to the hash */ + flow_vm_vlan = IXGBE_NTOHL(input.dword); /* generate common hash dword */ - hi_hash_dword ^= IXGBE_NTOHL(atr_input->dword_stream[1] ^ - atr_input->dword_stream[2] ^ - atr_input->dword_stream[3] ^ - atr_input->dword_stream[4] ^ - atr_input->dword_stream[5] ^ - atr_input->dword_stream[6] ^ - atr_input->dword_stream[7] ^ - atr_input->dword_stream[8] ^ - atr_input->dword_stream[9] ^ - atr_input->dword_stream[10]); + hi_hash_dword = IXGBE_NTOHL(common.dword); /* low dword is word swapped version of common */ - lo_hash_dword ^= (hi_hash_dword >> 16) | (hi_hash_dword << 16); + lo_hash_dword = (hi_hash_dword >> 16) | (hi_hash_dword << 16); + + /* apply flow ID/VM pool/VLAN ID bits to hash words */ + hi_hash_dword ^= flow_vm_vlan ^ (flow_vm_vlan >> 16); - /* hi dword is common dword with l4type and vm_pool added */ - hi_hash_dword ^= IXGBE_NTOHL(atr_input->dword_stream[10]) << 16; + /* Process bits 0 and 16 */ + IXGBE_COMPUTE_SIG_HASH_ITERATION(0); /* - * Process all 32 bits of the 2 keys 2 bits at a time - * - * Bit flip vlan from hash result if hash key has bit 0 set, the - * reason for doing this is because the hash generation shouldn't - * start until bit 1 in the stream so we need to cancel out a vlan - * if it was added starting at bit 0. + * apply flow ID/VM pool/VLAN ID bits to lo hash dword, we had to + * delay this because bit 0 of the stream should not be processed + * so we do not add the vlan until after bit 0 was processed */ - IXGBE_COMPUTE_SIG_HASH_ITERATION(0); + lo_hash_dword ^= flow_vm_vlan ^ (flow_vm_vlan << 16); + + /* Process remaining 30 bit of the key */ IXGBE_COMPUTE_SIG_HASH_ITERATION(1); IXGBE_COMPUTE_SIG_HASH_ITERATION(2); IXGBE_COMPUTE_SIG_HASH_ITERATION(3); @@ -1573,339 +1541,14 @@ static u32 ixgbe_atr_compute_sig_hash_82 IXGBE_COMPUTE_SIG_HASH_ITERATION(15); /* combine common_hash result with signature and bucket hashes */ - sig_hash ^= common_hash; bucket_hash ^= common_hash; + bucket_hash &= IXGBE_ATR_HASH_MASK; - /* return completed signature hash */ - return ((u32)sig_hash << 16) | (bucket_hash & IXGBE_ATR_HASH_MASK); -} - -/** - * ixgbe_atr_set_vlan_id_82599 - Sets the VLAN id in the ATR input stream - * @input: input stream to modify - * @vlan: the VLAN id to load - **/ -s32 ixgbe_atr_set_vlan_id_82599(union ixgbe_atr_input *input, __be16 vlan) -{ - DEBUGFUNC("ixgbe_atr_set_vlan_id_82599"); - - input->formatted.vlan_id = vlan; - - return IXGBE_SUCCESS; -} - -/** - * ixgbe_atr_set_src_ipv4_82599 - Sets the source IPv4 address - * @input: input stream to modify - * @src_addr: the IP address to load - **/ -s32 ixgbe_atr_set_src_ipv4_82599(union ixgbe_atr_input *input, __be32 src_addr) -{ - DEBUGFUNC("ixgbe_atr_set_src_ipv4_82599"); - - input->formatted.src_ip[0] = src_addr; - - return IXGBE_SUCCESS; -} - -/** - * ixgbe_atr_set_dst_ipv4_82599 - Sets the destination IPv4 address - * @input: input stream to modify - * @dst_addr: the IP address to load - **/ -s32 ixgbe_atr_set_dst_ipv4_82599(union ixgbe_atr_input *input, __be32 dst_addr) -{ - DEBUGFUNC("ixgbe_atr_set_dst_ipv4_82599"); - - input->formatted.dst_ip[0] = dst_addr; - - return IXGBE_SUCCESS; -} - -/** - * ixgbe_atr_set_src_ipv6_82599 - Sets the source IPv6 address - * @input: input stream to modify - * @src_addr_0: the first 4 bytes of the IP address to load - * @src_addr_1: the second 4 bytes of the IP address to load - * @src_addr_2: the third 4 bytes of the IP address to load - * @src_addr_3: the fourth 4 bytes of the IP address to load - **/ -s32 ixgbe_atr_set_src_ipv6_82599(union ixgbe_atr_input *input, - __be32 src_addr_0, __be32 src_addr_1, - __be32 src_addr_2, __be32 src_addr_3) -{ - DEBUGFUNC("ixgbe_atr_set_src_ipv6_82599"); - - input->formatted.src_ip[0] = src_addr_0; - input->formatted.src_ip[1] = src_addr_1; - input->formatted.src_ip[2] = src_addr_2; - input->formatted.src_ip[3] = src_addr_3; - - return IXGBE_SUCCESS; -} - -/** - * ixgbe_atr_set_dst_ipv6_82599 - Sets the destination IPv6 address - * @input: input stream to modify - * @dst_addr_0: the first 4 bytes of the IP address to load - * @dst_addr_1: the second 4 bytes of the IP address to load - * @dst_addr_2: the third 4 bytes of the IP address to load - * @dst_addr_3: the fourth 4 bytes of the IP address to load - **/ -s32 ixgbe_atr_set_dst_ipv6_82599(union ixgbe_atr_input *input, - __be32 dst_addr_0, __be32 dst_addr_1, - __be32 dst_addr_2, __be32 dst_addr_3) -{ - DEBUGFUNC("ixgbe_atr_set_dst_ipv6_82599"); - - input->formatted.dst_ip[0] = dst_addr_0; - input->formatted.dst_ip[1] = dst_addr_1; - input->formatted.dst_ip[2] = dst_addr_2; - input->formatted.dst_ip[3] = dst_addr_3; - - return IXGBE_SUCCESS; -} - -/** - * ixgbe_atr_set_src_port_82599 - Sets the source port - * @input: input stream to modify - * @src_port: the source port to load - **/ -s32 ixgbe_atr_set_src_port_82599(union ixgbe_atr_input *input, __be16 src_port) -{ - DEBUGFUNC("ixgbe_atr_set_src_port_82599"); - - input->formatted.src_port = src_port; - - return IXGBE_SUCCESS; -} - -/** - * ixgbe_atr_set_dst_port_82599 - Sets the destination port - * @input: input stream to modify - * @dst_port: the destination port to load - **/ -s32 ixgbe_atr_set_dst_port_82599(union ixgbe_atr_input *input, __be16 dst_port) -{ - DEBUGFUNC("ixgbe_atr_set_dst_port_82599"); - - input->formatted.dst_port = dst_port; - - return IXGBE_SUCCESS; -} - -/** - * ixgbe_atr_set_flex_byte_82599 - Sets the flexible bytes - * @input: input stream to modify - * @flex_bytes: the flexible bytes to load - **/ -s32 ixgbe_atr_set_flex_byte_82599(union ixgbe_atr_input *input, __be16 flex_bytes) -{ - DEBUGFUNC("ixgbe_atr_set_flex_byte_82599"); - - input->formatted.flex_bytes = flex_bytes; - - return IXGBE_SUCCESS; -} - -/** - * ixgbe_atr_set_vm_pool_82599 - Sets the Virtual Machine pool - * @input: input stream to modify - * @vm_pool: the Virtual Machine pool to load - **/ -s32 ixgbe_atr_set_vm_pool_82599(union ixgbe_atr_input *input, u8 vm_pool) -{ - DEBUGFUNC("ixgbe_atr_set_vm_pool_82599"); - - input->formatted.vm_pool = vm_pool; - - return IXGBE_SUCCESS; -} - -/** - * ixgbe_atr_set_l4type_82599 - Sets the layer 4 packet type - * @input: input stream to modify - * @l4type: the layer 4 type value to load - * - * This call is deprecated and should be replaced with a direct access to - * input->formatted.flow_type. - **/ -s32 ixgbe_atr_set_l4type_82599(union ixgbe_atr_input *input, u8 l4type) -{ - DEBUGFUNC("ixgbe_atr_set_l4type_82599"); - - input->formatted.flow_type = l4type; - - return IXGBE_SUCCESS; -} - -/** - * ixgbe_atr_get_vlan_id_82599 - Gets the VLAN id from the ATR input stream - * @input: input stream to search - * @vlan: the VLAN id to load - **/ -s32 ixgbe_atr_get_vlan_id_82599(union ixgbe_atr_input *input, __be16 *vlan) -{ - DEBUGFUNC("ixgbe_atr_get_vlan_id_82599"); - - *vlan = input->formatted.vlan_id; - - return IXGBE_SUCCESS; -} + sig_hash ^= common_hash << 16; + sig_hash &= IXGBE_ATR_HASH_MASK << 16; -/** - * ixgbe_atr_get_src_ipv4_82599 - Gets the source IPv4 address - * @input: input stream to search - * @src_addr: the IP address to load - **/ -s32 ixgbe_atr_get_src_ipv4_82599(union ixgbe_atr_input *input, __be32 *src_addr) -{ - DEBUGFUNC("ixgbe_atr_get_src_ipv4_82599"); - - *src_addr = input->formatted.src_ip[0]; - - return IXGBE_SUCCESS; -} - -/** - * ixgbe_atr_get_dst_ipv4_82599 - Gets the destination IPv4 address - * @input: input stream to search - * @dst_addr: the IP address to load - **/ -s32 ixgbe_atr_get_dst_ipv4_82599(union ixgbe_atr_input *input, __be32 *dst_addr) -{ - DEBUGFUNC("ixgbe_atr_get_dst_ipv4_82599"); - - *dst_addr = input->formatted.dst_ip[0]; - - return IXGBE_SUCCESS; -} - -/** - * ixgbe_atr_get_src_ipv6_82599 - Gets the source IPv6 address - * @input: input stream to search - * @src_addr_0: the first 4 bytes of the IP address to load - * @src_addr_1: the second 4 bytes of the IP address to load - * @src_addr_2: the third 4 bytes of the IP address to load - * @src_addr_3: the fourth 4 bytes of the IP address to load - **/ -s32 ixgbe_atr_get_src_ipv6_82599(union ixgbe_atr_input *input, - __be32 *src_addr_0, __be32 *src_addr_1, - __be32 *src_addr_2, __be32 *src_addr_3) -{ - DEBUGFUNC("ixgbe_atr_get_src_ipv6_82599"); - - *src_addr_0 = input->formatted.src_ip[0]; - *src_addr_1 = input->formatted.src_ip[1]; - *src_addr_2 = input->formatted.src_ip[2]; - *src_addr_3 = input->formatted.src_ip[3]; - - return IXGBE_SUCCESS; -} - -/** - * ixgbe_atr_get_dst_ipv6_82599 - Gets the destination IPv6 address - * @input: input stream to search - * @dst_addr_0: the first 4 bytes of the IP address to load - * @dst_addr_1: the second 4 bytes of the IP address to load - * @dst_addr_2: the third 4 bytes of the IP address to load - * @dst_addr_3: the fourth 4 bytes of the IP address to load - **/ -s32 ixgbe_atr_get_dst_ipv6_82599(union ixgbe_atr_input *input, - __be32 *dst_addr_0, __be32 *dst_addr_1, - __be32 *dst_addr_2, __be32 *dst_addr_3) -{ - DEBUGFUNC("ixgbe_atr_get_dst_ipv6_82599"); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Jan 19 19:49:48 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E8352106566C; Wed, 19 Jan 2011 19:49:48 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D7A258FC14; Wed, 19 Jan 2011 19:49:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0JJnmxn086996; Wed, 19 Jan 2011 19:49:48 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0JJnmAn086994; Wed, 19 Jan 2011 19:49:48 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201101191949.p0JJnmAn086994@svn.freebsd.org> From: John Baldwin Date: Wed, 19 Jan 2011 19:49:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217594 - head/sys/fs/ext2fs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 19:49:49 -0000 Author: jhb Date: Wed Jan 19 19:49:48 2011 New Revision: 217594 URL: http://svn.freebsd.org/changeset/base/217594 Log: Fix build with KDB defined. Pointy hat to: jhb Submitted by: jkim Modified: head/sys/fs/ext2fs/ext2_subr.c Modified: head/sys/fs/ext2fs/ext2_subr.c ============================================================================== --- head/sys/fs/ext2fs/ext2_subr.c Wed Jan 19 19:36:27 2011 (r217593) +++ head/sys/fs/ext2fs/ext2_subr.c Wed Jan 19 19:49:48 2011 (r217594) @@ -52,6 +52,8 @@ #include #ifdef KDB +#include + void ext2_checkoverlap(struct buf *, struct inode *); #endif From owner-svn-src-all@FreeBSD.ORG Wed Jan 19 20:16:39 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 49A52106566B; Wed, 19 Jan 2011 20:16:39 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 36E7B8FC16; Wed, 19 Jan 2011 20:16:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0JKGdsN087638; Wed, 19 Jan 2011 20:16:39 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0JKGdmr087633; Wed, 19 Jan 2011 20:16:39 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201101192016.p0JKGdmr087633@svn.freebsd.org> From: Ulrich Spoerlein Date: Wed, 19 Jan 2011 20:16:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217595 - in head: contrib/groff/tmac gnu/usr.bin/groff/tmac X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 20:16:39 -0000 Author: uqs Date: Wed Jan 19 20:16:38 2011 New Revision: 217595 URL: http://svn.freebsd.org/changeset/base/217595 Log: Update groff manpage and symbols with what has been submitted upstream. Also remove local overrides that are now in the contrib tree. This is a direct commit to contrib/ as we will no longer import any newer groff snapshots, due to licensing issues. MFC after: 3 weeks Modified: head/contrib/groff/tmac/doc-common head/contrib/groff/tmac/doc-syms head/contrib/groff/tmac/groff_mdoc.man head/gnu/usr.bin/groff/tmac/mdoc.local Modified: head/contrib/groff/tmac/doc-common ============================================================================== --- head/contrib/groff/tmac/doc-common Wed Jan 19 19:49:48 2011 (r217594) +++ head/contrib/groff/tmac/doc-common Wed Jan 19 20:16:38 2011 (r217595) @@ -454,6 +454,39 @@ .ds doc-operating-system-NetBSD-3.1 3.1 .ds doc-operating-system-NetBSD-4.0 4.0 .ds doc-operating-system-NetBSD-4.0.1 4.0.1 +.ds doc-operating-system-NetBSD-5.0 5.0 +.ds doc-operating-system-NetBSD-5.0.1 5.0.1 +.ds doc-operating-system-NetBSD-5.0.2 5.0.2 +. +.ds doc-operating-system-OpenBSD-2.0 2.0 +.ds doc-operating-system-OpenBSD-2.1 2.1 +.ds doc-operating-system-OpenBSD-2.2 2.2 +.ds doc-operating-system-OpenBSD-2.3 2.3 +.ds doc-operating-system-OpenBSD-2.4 2.4 +.ds doc-operating-system-OpenBSD-2.5 2.5 +.ds doc-operating-system-OpenBSD-2.6 2.6 +.ds doc-operating-system-OpenBSD-2.7 2.7 +.ds doc-operating-system-OpenBSD-2.8 2.8 +.ds doc-operating-system-OpenBSD-2.9 2.9 +.ds doc-operating-system-OpenBSD-3.0 3.0 +.ds doc-operating-system-OpenBSD-3.1 3.1 +.ds doc-operating-system-OpenBSD-3.2 3.2 +.ds doc-operating-system-OpenBSD-3.3 3.3 +.ds doc-operating-system-OpenBSD-3.4 3.4 +.ds doc-operating-system-OpenBSD-3.5 3.5 +.ds doc-operating-system-OpenBSD-3.6 3.6 +.ds doc-operating-system-OpenBSD-3.7 3.7 +.ds doc-operating-system-OpenBSD-3.8 3.8 +.ds doc-operating-system-OpenBSD-3.9 3.9 +.ds doc-operating-system-OpenBSD-4.0 4.0 +.ds doc-operating-system-OpenBSD-4.1 4.1 +.ds doc-operating-system-OpenBSD-4.2 4.2 +.ds doc-operating-system-OpenBSD-4.3 4.3 +.ds doc-operating-system-OpenBSD-4.4 4.4 +.ds doc-operating-system-OpenBSD-4.5 4.5 +.ds doc-operating-system-OpenBSD-4.6 4.6 +.ds doc-operating-system-OpenBSD-4.7 4.7 +.ds doc-operating-system-OpenBSD-4.8 4.8 . .ds doc-operating-system-FreeBSD-1.0 1.0 .ds doc-operating-system-FreeBSD-1.1 1.1 @@ -506,6 +539,10 @@ .ds doc-operating-system-FreeBSD-6.4 6.4 .ds doc-operating-system-FreeBSD-7.0 7.0 .ds doc-operating-system-FreeBSD-7.1 7.1 +.ds doc-operating-system-FreeBSD-7.2 7.2 +.ds doc-operating-system-FreeBSD-7.3 7.3 +.ds doc-operating-system-FreeBSD-8.0 8.0 +.ds doc-operating-system-FreeBSD-8.1 8.1 . .ds doc-operating-system-Darwin-8.0.0 8.0.0 .ds doc-operating-system-Darwin-8.1.0 8.1.0 @@ -540,6 +577,10 @@ .ds doc-operating-system-DragonFly-1.12 1.12 .ds doc-operating-system-DragonFly-1.12.2 1.12.2 .ds doc-operating-system-DragonFly-2.0 2.0 +.ds doc-operating-system-DragonFly-2.2 2.2 +.ds doc-operating-system-DragonFly-2.4 2.4 +.ds doc-operating-system-DragonFly-2.6 2.6 +.ds doc-operating-system-DragonFly-2.8 2.8 . .de Os . ds doc-command-name @@ -569,6 +610,14 @@ . el \ . tm mdoc warning: .Os: Unknown FreeBSD version `\$2' (#\n[.c]) . \}\} +. el \{ .ie "\$1"DragonFly" \{\ +. ds doc-operating-system DragonFly +. if \A\$2 \{\ +. ie d doc-operating-system-DragonFly-\$2 \ +. as doc-operating-system \~\*[doc-operating-system-DragonFly-\$2] +. el \ +. tm mdoc warning: .Os: Unknown DragonFly version `\$2' (#\n[.c]) +. \}\} . el \{ .ie "\$1"NetBSD" \{\ . ds doc-operating-system NetBSD . if \A\$2 \{\ @@ -577,6 +626,14 @@ . el \ . tm mdoc warning: .Os: Unknown NetBSD version `\$2' (#\n[.c]) . \}\} +. el \{ .ie "\$1"OpenBSD" \{\ +. ds doc-operating-system OpenBSD +. if \A\$2 \{\ +. ie d doc-operating-system-OpenBSD-\$2 \ +. as doc-operating-system \~\*[doc-operating-system-OpenBSD-\$2] +. el \ +. tm mdoc warning: .Os: Unknown OpenBSD version `\$2' (#\n[.c]) +. \}\} . el \{ .ie "\$1"Darwin" \{\ . ds doc-operating-system Darwin . if \A\$2 \{\ @@ -589,7 +646,7 @@ . ds doc-operating-system \$1 . if !"\$2"" \ . as doc-operating-system " \$2 -. \}\}\}\}\}\} +. \}\}\}\}\}\}\}\} .. . . Modified: head/contrib/groff/tmac/doc-syms ============================================================================== --- head/contrib/groff/tmac/doc-syms Wed Jan 19 19:49:48 2011 (r217594) +++ head/contrib/groff/tmac/doc-syms Wed Jan 19 20:16:38 2011 (r217595) @@ -637,6 +637,8 @@ .as doc-str-St--p1003.1-2001 " (\*[Lq]\)\*[Px]\*[doc-str-St].1\*[Rq]) .ds doc-str-St--p1003.1-2004 \*[doc-Tn-font-size]\%IEEE\*[doc-str-St] Std 1003.1-2004 .as doc-str-St--p1003.1-2004 " (\*[Lq]\)\*[Px]\*[doc-str-St].1\*[Rq]) +.ds doc-str-St--p1003.1-2008 \*[doc-Tn-font-size]\%IEEE\*[doc-str-St] Std 1003.1-2008 +.as doc-str-St--p1003.1-2008 " (\*[Lq]\)\*[Px]\*[doc-str-St].1\*[Rq]) . .\" POSIX Part 2: Shell and Utilities .ds doc-str-St--p1003.2 \*[doc-Tn-font-size]\%IEEE\*[doc-str-St] Std 1003.2 Modified: head/contrib/groff/tmac/groff_mdoc.man ============================================================================== --- head/contrib/groff/tmac/groff_mdoc.man Wed Jan 19 19:49:48 2011 (r217594) +++ head/contrib/groff/tmac/groff_mdoc.man Wed Jan 19 20:16:38 2011 (r217595) @@ -44,9 +44,9 @@ .\" for an already extremely slow package. .\" . -.Dd January 5, 2006 -.Os +.Dd November 2, 2010 .Dt GROFF_MDOC 7 +.Os . . .Sh NAME @@ -563,8 +563,8 @@ The body of a man page is easily constru .Bd -literal -offset indent \&.\e" The following commands are required for all man pages. \&.Dd Month day, year -\&.Os [OPERATING_SYSTEM] [version/release] \&.Dt DOCUMENT_TITLE [section number] [architecture/volume] +\&.Os [OPERATING_SYSTEM] [version/release] \&.Sh NAME \&.Nm name \&.Nd one line description of name @@ -600,9 +600,9 @@ The body of a man page is easily constru . The first items in the template are the commands .Ql .Dd , -.Ql .Os , +.Ql .Dt , and -.Ql .Dt ; +.Ql .Os ; the document date, the operating system the man page or subject source is developed or modified for, and the man page title (in .Em upper case ) @@ -856,7 +856,7 @@ is the acronym for the operating system the release ID. . .Bd -ragged -compact -.Bl -tag -width ".No FreeBSD" -offset indent +.Bl -tag -width ".No DragonFly" -offset indent .It ATT 7th, 7, III, 3, V, V.2, V.3, V.4 .It BSD @@ -865,14 +865,19 @@ the release ID. 0.8, 0.8a, 0.9, 0.9a, 1.0, 1.0a, 1.1, 1.2, 1.2a, 1.2b, 1.2c, 1.2d, 1.2e, 1.3, 1.3a, 1.4, 1.4.1, 1.4.2, 1.4.3, 1.5, 1.5.1, 1.5.2, 1.5.3, 1.6, 1.6.1, 1.6.2, 1.6.3, 2.0, 2.0.1, 2.0.2, 2.0.3, 2.1, 3.0, 3.0.1, 3.0.2, 3.1, 4.0, -4.0.1 +4.0.1, 5.0, 5.0.1, 5.0.2 .It FreeBSD 1.0, 1.1, 1.1.5, 1.1.5.1, 2.0, 2.0.5, 2.1, 2.1.5, 2.1.6, 2.1.7, 2.2, 2.2.1, 2.2.2, 2.2.5, 2.2.6, 2.2.7, 2.2.8, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 4.0, 4.1, 4.1.1, 4.2, 4.3, 4.4, 4.5, 4.6, 4.6.2, 4.7, 4.8, 4.9, 4.10, 4.11, 5.0, 5.1, -5.2, 5.2.1, 5.3, 5.4, 5.5, 6.0, 6.1, 6.2, 6.3, 6.4, 7.0, 7.1 +5.2, 5.2.1, 5.3, 5.4, 5.5, 6.0, 6.1, 6.2, 6.3, 6.4, 7.0, 7.1, 7.2, 7.3, 8.0, +8.1 +.It OpenBSD +2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0, 3.1, 3.2, 3.3, 3.4, +3.5, 3.6, 3.7, 3.8, 3.9, 4.0, 4.1, 4.2, 4.3, 4.4, 4.5, 4.6, 4.7, 4.8 .It DragonFly -1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.8, 1.8.1, 1.10, 1.12, 1.12.2, 2.0 +1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.8, 1.8.1, 1.10, 1.12, 1.12.2, 2.0, 2.2, +2.4, 2.6, 2.8 .It Darwin 8.0.0, 8.1.0, 8.2.0, 8.3.0, 8.4.0, 8.5.0, 8.6.0, 8.7.0, 8.8.0, 8.9.0, 8.10.0, 8.11.0, 9.0.0, 9.1.0, 9.2.0, 9.3.0, 9.4.0, 9.5.0, 9.6.0 @@ -1588,7 +1593,7 @@ For example, .Ql ".Rv \-std atexit" produces: . -.Bd -ragged -offset -indent +.Bd -ragged -offset indent \# a small hack to suppress a warning message .ds section-old "\*[section] .ds section 3 @@ -1618,7 +1623,7 @@ For example, .Ql ".Ex \-std cat" produces: . -.Bd -ragged -offset -indent +.Bd -ragged -offset indent \# a small hack to suppress a warning message .ds section-old "\*[section] .ds section 1 @@ -1786,6 +1791,11 @@ When called without arguments, .Ql .Nm regurgitates this initial name for the sole purpose of making less work for the author. +.Ql .Nm +causes a line break within the +.Sx SYNOPSIS +section. +.Pp Note: A section two or three document function name is addressed with the .Ql .Nm in the @@ -1974,6 +1984,8 @@ Part 1: System API .St -p1003.1-2001 .It Li \-p1003.1\-2004 .St -p1003.1-2004 +.It Li \-p1003.1\-2008 +.St -p1003.1-2008 .El .Pp . @@ -1993,8 +2005,8 @@ Part 2: Shell and Utilities .Pp . X/Open -.Bl -tag -width ".Li \-p1003.1g\-2000" -compact -offset indent .Pp +.Bl -tag -width ".Li \-p1003.1g\-2000" -compact -offset indent .It Li \-susv2 .St -susv2 .It Li \-susv3 Modified: head/gnu/usr.bin/groff/tmac/mdoc.local ============================================================================== --- head/gnu/usr.bin/groff/tmac/mdoc.local Wed Jan 19 19:49:48 2011 (r217594) +++ head/gnu/usr.bin/groff/tmac/mdoc.local Wed Jan 19 20:16:38 2011 (r217595) @@ -74,17 +74,10 @@ .ds doc-default-operating-system FreeBSD\~9.0 . .\" FreeBSD releases not found in doc-common -.ds doc-operating-system-FreeBSD-7.2 7.2 -.ds doc-operating-system-FreeBSD-7.3 7.3 -.ds doc-operating-system-FreeBSD-7.4 7.4 -.ds doc-operating-system-FreeBSD-8.0 8.0 -.ds doc-operating-system-FreeBSD-8.1 8.1 .ds doc-operating-system-FreeBSD-8.2 8.2 .ds doc-operating-system-FreeBSD-9.0 9.0 . .\" Definitions not (yet) in doc-syms -.ds doc-str-St--p1003.1-2008 \*[doc-Tn-font-size]\%IEEE\*[doc-str-St] Std 1003.1-2008 -.as doc-str-St--p1003.1-2008 " (\*[Lq]\)\*[Px]\*[doc-str-St].1\*[Rq]) . .ec . From owner-svn-src-all@FreeBSD.ORG Wed Jan 19 20:16:47 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9E3DD1065670; Wed, 19 Jan 2011 20:16:47 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8DE998FC12; Wed, 19 Jan 2011 20:16:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0JKGllE087677; Wed, 19 Jan 2011 20:16:47 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0JKGlXZ087675; Wed, 19 Jan 2011 20:16:47 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201101192016.p0JKGlXZ087675@svn.freebsd.org> From: Ulrich Spoerlein Date: Wed, 19 Jan 2011 20:16: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: r217596 - head/etc/mtree X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 20:16:47 -0000 Author: uqs Date: Wed Jan 19 20:16:47 2011 New Revision: 217596 URL: http://svn.freebsd.org/changeset/base/217596 Log: Fix a small typo nit Modified: head/etc/mtree/README Modified: head/etc/mtree/README ============================================================================== --- head/etc/mtree/README Wed Jan 19 20:16:38 2011 (r217595) +++ head/etc/mtree/README Wed Jan 19 20:16:47 2011 (r217596) @@ -36,10 +36,10 @@ and keep them in good working order. mechanism for making better selections for these as it traverses the hierarchy. - The BSD.X.new file should NOT be commited, will be missing the - correct header, and important keywords like ``nochange''. Simply - use the diff for a sanity check to make sure things are in the - correct order and correctly indented. + The BSD.X.new file should NOT be committed, as it will be missing + the correct header, and important keywords like ``nochange''. + Simply use the diff for a sanity check to make sure things are in + the correct order and correctly indented. e) Further sanity checking of the system builds with DESTDIR=/someplace are more complicated, but can often catch missing entries in these From owner-svn-src-all@FreeBSD.ORG Wed Jan 19 20:55:07 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 72633106566C; Wed, 19 Jan 2011 20:55:07 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.cksoft.de (mail.cksoft.de [IPv6:2001:4068:10::3]) by mx1.freebsd.org (Postfix) with ESMTP id 210168FC18; Wed, 19 Jan 2011 20:55:07 +0000 (UTC) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id 73EA241C650; Wed, 19 Jan 2011 21:55:06 +0100 (CET) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([192.168.74.103]) by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id usaY83JDP61k; Wed, 19 Jan 2011 21:55:05 +0100 (CET) Received: by mail.cksoft.de (Postfix, from userid 66) id C23AE41C679; Wed, 19 Jan 2011 21:55:05 +0100 (CET) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id 2C6314448F3; Wed, 19 Jan 2011 20:50:25 +0000 (UTC) Date: Wed, 19 Jan 2011 20:50:25 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: Randall Stewart In-Reply-To: <201101191907.p0JJ7GMp086060@svn.freebsd.org> Message-ID: <20110119204903.K3489@maildrop.int.zabbadoz.net> References: <201101191907.p0JJ7GMp086060@svn.freebsd.org> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r217592 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 20:55:07 -0000 On Wed, 19 Jan 2011, Randall Stewart wrote: > Author: rrs > Date: Wed Jan 19 19:07:16 2011 > New Revision: 217592 > URL: http://svn.freebsd.org/changeset/base/217592 > > Log: > Fix a bug where Multicast packets sent from a > udp endpoint may end up echoing back to the sender > even with OUT joining the multi-cast group. > > Reviewed by: gnn, bms, bz? Nah, I guess not; I wasn't Cc:ed on the remainder of the communication it seems. > Obtained from: deischen (with help from) > > Modified: > head/sys/netinet/udp_usrreq.c > > Modified: head/sys/netinet/udp_usrreq.c > ============================================================================== > --- head/sys/netinet/udp_usrreq.c Wed Jan 19 18:20:11 2011 (r217591) > +++ head/sys/netinet/udp_usrreq.c Wed Jan 19 19:07:16 2011 (r217592) > @@ -479,11 +479,13 @@ udp_input(struct mbuf *m, int off) > * and source-specific multicast. [RFC3678] > */ > imo = inp->inp_moptions; > - if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr)) && > - imo != NULL) { > + if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr))) { > struct sockaddr_in group; > int blocked; > - > + if(imo == NULL) { ^^^^ usually I'd prefer a blank here. > + INP_RUNLOCK(inp); > + continue; > + } > bzero(&group, sizeof(struct sockaddr_in)); > group.sin_len = sizeof(struct sockaddr_in); > group.sin_family = AF_INET; > -- Bjoern A. Zeeb You have to have visions! Going to jail sucks -- All my daemons like it! http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/jails.html From owner-svn-src-all@FreeBSD.ORG Wed Jan 19 20:55:18 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 51D3A10657CE; Wed, 19 Jan 2011 20:55:18 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 7F6B68FC27; Wed, 19 Jan 2011 20:55:17 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id p0JKtDNm020716 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 19 Jan 2011 22:55:13 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id p0JKtDsX020115; Wed, 19 Jan 2011 22:55:13 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id p0JKtDJk020114; Wed, 19 Jan 2011 22:55:13 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 19 Jan 2011 22:55:13 +0200 From: Kostik Belousov To: Jung-uk Kim Message-ID: <20110119205513.GC2518@deviant.kiev.zoral.com.ua> References: <201101191709.p0JH97ZD083132@svn.freebsd.org> <20110119171807.GA2518@deviant.kiev.zoral.com.ua> <201101191311.03440.jkim@FreeBSD.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="bCKTTGDksHH4MFjj" Content-Disposition: inline In-Reply-To: <201101191311.03440.jkim@FreeBSD.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r217587 - head/sys/i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 20:55:18 -0000 --bCKTTGDksHH4MFjj Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jan 19, 2011 at 01:11:01PM -0500, Jung-uk Kim wrote: > On Wednesday 19 January 2011 12:18 pm, Kostik Belousov wrote: > > On Wed, Jan 19, 2011 at 05:09:07PM +0000, Jung-uk Kim wrote: > > > Author: jkim > > > Date: Wed Jan 19 17:09:07 2011 > > > New Revision: 217587 > > > URL: http://svn.freebsd.org/changeset/base/217587 > > > > > > Log: > > > Fix yet another fallout from r208833. VM86 BIOS call may cause > > > page fault when FPU is in use. > > > > > > Reported by: Marc UBM Bocklet (ubm dot freebsd at googlemail > > > dot com) Tested by: b. f. (bf1783 at googlemail dot com) > > > MFC after: 3 days > > > > > > Modified: > > > head/sys/i386/i386/vm86bios.s > > > > > > Modified: head/sys/i386/i386/vm86bios.s > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- head/sys/i386/i386/vm86bio= s.s Wed Jan 19 > > > 17:04:07 2011 (r217586) +++ head/sys/i386/i386/vm86bios.s Wed Jan > > > 19 17:09:07 2011 (r217587) @@ -73,10 +73,9 @@ > > > ENTRY(vm86_bioscall) > > > je 1f /* no curproc/npxproc */ > > > pushl %edx > > > movl TD_PCB(%ecx),%ecx > > > - addl $PCB_SAVEFPU,%ecx > > > - pushl %ecx > > > + pushl PCB_SAVEFPU(%ecx) > > > call npxsave > > > - popl %ecx > > > + addl $4,%esp > > > popl %edx /* recover our pcb */ > > > 1: > > > popfl > > > > vm86_bioscall() in fact inlines the old version of npxexit(). > > Shouldn't the npxexit() be called from C code before call to > > vm86_bioscall ? >=20 > I think we can but I don't like redundant or nested uses of=20 > critical_enter()/critical_exit() from vm86_intcall()/vm86_datacall(). =20 Well, direct use of cli is worse, IMO. > And I don't think that's worth the code churn. 'Code churn' would remove hand-translated assembly code by calling equivalent C version. But due to issue below, I think this fragment should be removed at all. >=20 > > Also, if bioscall can be used from the syscall context, I think > > whatever npxsave()/npxexit() is used, and BIOS modifies FPU > > state, we are corrupting usermode FPU context. > > > > Probably, fpu_kern_enter()/fpu_kern_leave() braces around > > vm86_bioscall is proper solution. >=20 > BIOS should never modify FPU state, AFAIK. I believe Peter Holm still possesses the machine with quite amuzing habit to panic sometimes during early boot, since int 12 (?) BIOS handler tries to execute some FPU instruction and kernel has to panic since device not present fault handler is not yet established. Simply put, we cannot trust BIOS. --bCKTTGDksHH4MFjj Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk03T7EACgkQC3+MBN1Mb4i0XACghOyZN7VsNHUmRzrRMSIGBEha t+oAmgNulwxXwNFAPhO8rP4U1fzDdUVf =FqMb -----END PGP SIGNATURE----- --bCKTTGDksHH4MFjj-- From owner-svn-src-all@FreeBSD.ORG Wed Jan 19 20:57:08 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 912011065670; Wed, 19 Jan 2011 20:57:08 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 811158FC13; Wed, 19 Jan 2011 20:57:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0JKv8hb088766; Wed, 19 Jan 2011 20:57:08 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0JKv82E088764; Wed, 19 Jan 2011 20:57:08 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <201101192057.p0JKv82E088764@svn.freebsd.org> From: Randall Stewart Date: Wed, 19 Jan 2011 20:57:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217597 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 20:57:08 -0000 Author: rrs Date: Wed Jan 19 20:57:08 2011 New Revision: 217597 URL: http://svn.freebsd.org/changeset/base/217597 Log: Fix style 9 nit that snuck in when I grabbed the wrong patch ;-0 (thanks Daniel) MFC after: 1 week Modified: head/sys/netinet/udp_usrreq.c Modified: head/sys/netinet/udp_usrreq.c ============================================================================== --- head/sys/netinet/udp_usrreq.c Wed Jan 19 20:16:47 2011 (r217596) +++ head/sys/netinet/udp_usrreq.c Wed Jan 19 20:57:08 2011 (r217597) @@ -482,7 +482,7 @@ udp_input(struct mbuf *m, int off) if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr))) { struct sockaddr_in group; int blocked; - if(imo == NULL) { + if (imo == NULL) { INP_RUNLOCK(inp); continue; } From owner-svn-src-all@FreeBSD.ORG Wed Jan 19 21:03:23 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 02B9E106566C; Wed, 19 Jan 2011 21:03:23 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E603E8FC15; Wed, 19 Jan 2011 21:03:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0JL3MJ7088971; Wed, 19 Jan 2011 21:03:22 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0JL3MRt088969; Wed, 19 Jan 2011 21:03:22 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201101192103.p0JL3MRt088969@svn.freebsd.org> From: Colin Percival Date: Wed, 19 Jan 2011 21:03:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217598 - releng/8.2/sys/i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 21:03:23 -0000 Author: cperciva Date: Wed Jan 19 21:03:22 2011 New Revision: 217598 URL: http://svn.freebsd.org/changeset/base/217598 Log: MFS r217408: Don't use amdc1e on XEN && !XEN_PRIVILEGED. This fixes a panic when booting FreeBSD/XEN on recent AMD CPUs. Approved by: re (bz) Modified: releng/8.2/sys/i386/i386/machdep.c Directory Properties: releng/8.2/sys/ (props changed) releng/8.2/sys/amd64/include/xen/ (props changed) releng/8.2/sys/cddl/contrib/opensolaris/ (props changed) releng/8.2/sys/contrib/dev/acpica/ (props changed) releng/8.2/sys/contrib/pf/ (props changed) Modified: releng/8.2/sys/i386/i386/machdep.c ============================================================================== --- releng/8.2/sys/i386/i386/machdep.c Wed Jan 19 20:57:08 2011 (r217597) +++ releng/8.2/sys/i386/i386/machdep.c Wed Jan 19 21:03:22 2011 (r217598) @@ -1228,6 +1228,7 @@ cpu_idle_acpi(int busy) static int cpu_ident_amdc1e = 0; +#if !defined(XEN) || defined(XEN_PRIVILEGED) static int cpu_probe_amdc1e(void) { @@ -1254,6 +1255,7 @@ cpu_probe_amdc1e(void) #endif return (0); } +#endif /* * C1E renders the local APIC timer dead, so we disable it by @@ -2690,8 +2692,10 @@ init386(first) thread0.td_pcb->pcb_fsd = PCPU_GET(fsgs_gdt)[0]; thread0.td_pcb->pcb_gsd = PCPU_GET(fsgs_gdt)[1]; +#if defined(XEN_PRIVILEGED) if (cpu_probe_amdc1e()) cpu_idle_fn = cpu_idle_amdc1e; +#endif } #else From owner-svn-src-all@FreeBSD.ORG Wed Jan 19 21:09:39 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8125F1065672; Wed, 19 Jan 2011 21:09:39 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 664E28FC0C; Wed, 19 Jan 2011 21:09:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0JL9dX4089145; Wed, 19 Jan 2011 21:09:39 GMT (envelope-from keramida@svn.freebsd.org) Received: (from keramida@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0JL9duf089141; Wed, 19 Jan 2011 21:09:39 GMT (envelope-from keramida@svn.freebsd.org) Message-Id: <201101192109.p0JL9duf089141@svn.freebsd.org> From: Giorgos Keramidas Date: Wed, 19 Jan 2011 21:09:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217599 - stable/8/tools/regression/acct X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 21:09:39 -0000 Author: keramida (doc committer) Date: Wed Jan 19 21:09:39 2011 New Revision: 217599 URL: http://svn.freebsd.org/changeset/base/217599 Log: MFC r217064 - sort & fix includes, remove -include from CFLAGS of acct tests - Sort the includes of pack.c, moving sys/*.h files near the top. - Add a couple of missing #include lines, and remove the need for custom -include options in the CFLAGS of the test Makefile. - Remove the ad-hoc ’all’ target, but keep its ’regress’ bits for testing. - Convert the ad-hoc ’clean’ target to proper CLEANFILES stuff, so that the normal bsd.prog.mk machinery can clean up. - Use ‘make -V .OBJDIR’ to detect the place where ’pack’ lives, so that regress.t works both with and without ’make obj’. Modified: stable/8/tools/regression/acct/Makefile stable/8/tools/regression/acct/pack.c stable/8/tools/regression/acct/regress.t Directory Properties: stable/8/tools/regression/acct/ (props changed) Modified: stable/8/tools/regression/acct/Makefile ============================================================================== --- stable/8/tools/regression/acct/Makefile Wed Jan 19 21:03:22 2011 (r217598) +++ stable/8/tools/regression/acct/Makefile Wed Jan 19 21:09:39 2011 (r217599) @@ -1,22 +1,22 @@ # # $FreeBSD$ # -# "make" will compile what is needed and run the regression tests. +# "make" will compile the acct test programs # + PROG= pack +SRCS= pack.c NO_MAN= +CFLAGS+= -I${.OBJDIR} -all: regress - -pack: pack.c convert.c +pack.o: convert.c +CLEANFILES+= convert.c convert.c: ../../../sys/kern/kern_acct.c - sed -n '/FLOAT_CONVERSION_START/,/FLOAT_CONVERSION_END/p' $? >$@ + sed -n '/FLOAT_CONVERSION_START/,/FLOAT_CONVERSION_END/p' $? | \ + sed -e 's/log(/syslog(/' >$@ regress: pack regress.t - ./regress.t - -clean: - rm -f $(PROG) convert.c + sh ${.CURDIR}/regress.t .include Modified: stable/8/tools/regression/acct/pack.c ============================================================================== --- stable/8/tools/regression/acct/pack.c Wed Jan 19 21:03:22 2011 (r217598) +++ stable/8/tools/regression/acct/pack.c Wed Jan 19 21:09:39 2011 (r217599) @@ -25,15 +25,18 @@ #include __FBSDID("$FreeBSD$"); +#include + #include #include +#include #include #include +#include #include #include - -#include -#include +#include +#include #define KASSERT(val, msg) assert(val) Modified: stable/8/tools/regression/acct/regress.t ============================================================================== --- stable/8/tools/regression/acct/regress.t Wed Jan 19 21:03:22 2011 (r217598) +++ stable/8/tools/regression/acct/regress.t Wed Jan 19 21:09:39 2011 (r217599) @@ -3,7 +3,12 @@ # $FreeBSD$ # -DIR=`dirname $0` +if test -z "${DIR}" ; then + DIR=$( make -V .OBJDIR ) +fi +if test -z "${DIR}" ; then + DIR=$( dirname $0 ) +fi check() { From owner-svn-src-all@FreeBSD.ORG Wed Jan 19 21:19:15 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 575361065670; Wed, 19 Jan 2011 21:19:15 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: Kostik Belousov Date: Wed, 19 Jan 2011 16:19:06 -0500 User-Agent: KMail/1.6.2 References: <201101191709.p0JH97ZD083132@svn.freebsd.org> <201101191311.03440.jkim@FreeBSD.org> <20110119205513.GC2518@deviant.kiev.zoral.com.ua> In-Reply-To: <20110119205513.GC2518@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201101191619.08220.jkim@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r217587 - head/sys/i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 21:19:16 -0000 On Wednesday 19 January 2011 03:55 pm, Kostik Belousov wrote: > On Wed, Jan 19, 2011 at 01:11:01PM -0500, Jung-uk Kim wrote: > > On Wednesday 19 January 2011 12:18 pm, Kostik Belousov wrote: > > > On Wed, Jan 19, 2011 at 05:09:07PM +0000, Jung-uk Kim wrote: > > > > Author: jkim > > > > Date: Wed Jan 19 17:09:07 2011 > > > > New Revision: 217587 > > > > URL: http://svn.freebsd.org/changeset/base/217587 > > > > > > > > Log: > > > > Fix yet another fallout from r208833. VM86 BIOS call may > > > > cause page fault when FPU is in use. > > > > > > > > Reported by: Marc UBM Bocklet (ubm dot freebsd at > > > > googlemail dot com) Tested by: b. f. (bf1783 at googlemail > > > > dot com) MFC after: 3 days > > > > > > > > Modified: > > > > head/sys/i386/i386/vm86bios.s > > > > > > > > Modified: head/sys/i386/i386/vm86bios.s > > > > ============================================================= > > > >==== ============= --- head/sys/i386/i386/vm86bios.s Wed Jan > > > > 19 17:04:07 2011 (r217586) +++ > > > > head/sys/i386/i386/vm86bios.s Wed Jan 19 17:09:07 > > > > 2011 (r217587) @@ -73,10 +73,9 @@ > > > > ENTRY(vm86_bioscall) > > > > je 1f /* no curproc/npxproc */ > > > > pushl %edx > > > > movl TD_PCB(%ecx),%ecx > > > > - addl $PCB_SAVEFPU,%ecx > > > > - pushl %ecx > > > > + pushl PCB_SAVEFPU(%ecx) > > > > call npxsave > > > > - popl %ecx > > > > + addl $4,%esp > > > > popl %edx /* recover our pcb */ > > > > 1: > > > > popfl > > > > > > vm86_bioscall() in fact inlines the old version of npxexit(). > > > Shouldn't the npxexit() be called from C code before call to > > > vm86_bioscall ? > > > > I think we can but I don't like redundant or nested uses of > > critical_enter()/critical_exit() from > > vm86_intcall()/vm86_datacall(). > > Well, direct use of cli is worse, IMO. > > > And I don't think that's worth the code churn. > > 'Code churn' would remove hand-translated assembly code by calling > equivalent C version. But due to issue below, I think this fragment > should be removed at all. I just fixed it from "completely broken" to "working" state. Please feel free to commit what's best for us. You are the author of r208833 anyway. Shrug... > > > Also, if bioscall can be used from the syscall context, I think > > > whatever npxsave()/npxexit() is used, and BIOS modifies FPU > > > state, we are corrupting usermode FPU context. > > > > > > Probably, fpu_kern_enter()/fpu_kern_leave() braces around > > > vm86_bioscall is proper solution. > > > > BIOS should never modify FPU state, AFAIK. > > I believe Peter Holm still possesses the machine with quite amuzing > habit to panic sometimes during early boot, since int 12 (?) BIOS > handler tries to execute some FPU instruction and kernel has to > panic since device not present fault handler is not yet > established. Then, it won't hit vm86_bioscall() in the first place, will it? :-P > Simply put, we cannot trust BIOS. Amen! Jung-uk Kim From owner-svn-src-all@FreeBSD.ORG Wed Jan 19 21:19:23 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BDE95106566B; Wed, 19 Jan 2011 21:19:23 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A1B328FC15; Wed, 19 Jan 2011 21:19:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0JLJNDg089415; Wed, 19 Jan 2011 21:19:23 GMT (envelope-from keramida@svn.freebsd.org) Received: (from keramida@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0JLJN99089411; Wed, 19 Jan 2011 21:19:23 GMT (envelope-from keramida@svn.freebsd.org) Message-Id: <201101192119.p0JLJN99089411@svn.freebsd.org> From: Giorgos Keramidas Date: Wed, 19 Jan 2011 21:19:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217600 - stable/7/tools/regression/acct X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 21:19:23 -0000 Author: keramida (doc committer) Date: Wed Jan 19 21:19:23 2011 New Revision: 217600 URL: http://svn.freebsd.org/changeset/base/217600 Log: MFC r217064 - sort & fix includes, remove -include from CFLAGS of acct tests - Sort the includes of pack.c, moving sys/*.h files near the top. - Add a couple of missing #include lines, and remove the need for custom -include options in the CFLAGS of the test Makefile. - Remove the ad-hoc ’all’ target, but keep its ’regress’ bits for testing. - Convert the ad-hoc ’clean’ target to proper CLEANFILES stuff, so that the normal bsd.prog.mk machinery can clean up. - Use ‘make -V .OBJDIR’ to detect the place where ’pack’ lives, so that regress.t works both with and without ’make obj’. Modified: stable/7/tools/regression/acct/Makefile stable/7/tools/regression/acct/pack.c stable/7/tools/regression/acct/regress.t Directory Properties: stable/7/tools/regression/acct/ (props changed) Modified: stable/7/tools/regression/acct/Makefile ============================================================================== --- stable/7/tools/regression/acct/Makefile Wed Jan 19 21:09:39 2011 (r217599) +++ stable/7/tools/regression/acct/Makefile Wed Jan 19 21:19:23 2011 (r217600) @@ -1,22 +1,22 @@ # # $FreeBSD$ # -# "make" will compile what is needed and run the regression tests. +# "make" will compile the acct test programs # + PROG= pack +SRCS= pack.c NO_MAN= +CFLAGS+= -I${.OBJDIR} -all: regress - -pack: pack.c convert.c +pack.o: convert.c +CLEANFILES+= convert.c convert.c: ../../../sys/kern/kern_acct.c - sed -n '/FLOAT_CONVERSION_START/,/FLOAT_CONVERSION_END/p' $? >$@ + sed -n '/FLOAT_CONVERSION_START/,/FLOAT_CONVERSION_END/p' $? | \ + sed -e 's/log(/syslog(/' >$@ regress: pack regress.t - ./regress.t - -clean: - rm -f $(PROG) convert.c + sh ${.CURDIR}/regress.t .include Modified: stable/7/tools/regression/acct/pack.c ============================================================================== --- stable/7/tools/regression/acct/pack.c Wed Jan 19 21:09:39 2011 (r217599) +++ stable/7/tools/regression/acct/pack.c Wed Jan 19 21:19:23 2011 (r217600) @@ -25,15 +25,18 @@ #include __FBSDID("$FreeBSD$"); +#include + #include #include +#include #include #include +#include #include #include - -#include -#include +#include +#include #define KASSERT(val, msg) assert(val) Modified: stable/7/tools/regression/acct/regress.t ============================================================================== --- stable/7/tools/regression/acct/regress.t Wed Jan 19 21:09:39 2011 (r217599) +++ stable/7/tools/regression/acct/regress.t Wed Jan 19 21:19:23 2011 (r217600) @@ -3,7 +3,12 @@ # $FreeBSD$ # -DIR=`dirname $0` +if test -z "${DIR}" ; then + DIR=$( make -V .OBJDIR ) +fi +if test -z "${DIR}" ; then + DIR=$( dirname $0 ) +fi check() { From owner-svn-src-all@FreeBSD.ORG Wed Jan 19 21:28:01 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 12618106564A; Wed, 19 Jan 2011 21:28:01 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 00FAC8FC15; Wed, 19 Jan 2011 21:28:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0JLS0x2089662; Wed, 19 Jan 2011 21:28:00 GMT (envelope-from keramida@svn.freebsd.org) Received: (from keramida@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0JLS0Dx089660; Wed, 19 Jan 2011 21:28:00 GMT (envelope-from keramida@svn.freebsd.org) Message-Id: <201101192128.p0JLS0Dx089660@svn.freebsd.org> From: Giorgos Keramidas Date: Wed, 19 Jan 2011 21:28:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217601 - stable/8/share/man/man7 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 21:28:01 -0000 Author: keramida (doc committer) Date: Wed Jan 19 21:28:00 2011 New Revision: 217601 URL: http://svn.freebsd.org/changeset/base/217601 Log: MFC r205978 from /head Document DEBUG_FLAGS in a more visible place, in the build(7) manpage Noticed by: Alexander Best Reviewed by: jhb Modified: stable/8/share/man/man7/build.7 Directory Properties: stable/8/share/man/man7/ (props changed) Modified: stable/8/share/man/man7/build.7 ============================================================================== --- stable/8/share/man/man7/build.7 Wed Jan 19 21:19:23 2011 (r217600) +++ stable/8/share/man/man7/build.7 Wed Jan 19 21:28:00 2011 (r217601) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 23, 2009 +.Dd March 31, 2010 .Dt BUILD 7 .Os .Sh NAME @@ -311,6 +311,20 @@ should be set as with .Sh ENVIRONMENT Variables that influence all builds include: .Bl -tag -width ".Va MAKEOBJDIRPREFIX" +.It Va DEBUG_FLAGS +Defines a set of debugging flags that will be used to build all userland +binaries under +.Pa /usr/src . +When +.Va DEBUG_FLAGS +is defined, the +.Cm install +and +.Cm installworld +targets install binaries from the current +.Va MAKEOBJDIRPREFIX +without stripping, +so that debugging information is retained in the installed binaries. .It Va DESTDIR The directory hierarchy prefix where built objects will be installed. If not set, From owner-svn-src-all@FreeBSD.ORG Wed Jan 19 21:28:21 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A01791065670; Wed, 19 Jan 2011 21:28:21 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8EB178FC14; Wed, 19 Jan 2011 21:28:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0JLSLpB089706; Wed, 19 Jan 2011 21:28:21 GMT (envelope-from keramida@svn.freebsd.org) Received: (from keramida@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0JLSLhr089704; Wed, 19 Jan 2011 21:28:21 GMT (envelope-from keramida@svn.freebsd.org) Message-Id: <201101192128.p0JLSLhr089704@svn.freebsd.org> From: Giorgos Keramidas Date: Wed, 19 Jan 2011 21:28:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217602 - stable/7/share/man/man7 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 21:28:21 -0000 Author: keramida (doc committer) Date: Wed Jan 19 21:28:21 2011 New Revision: 217602 URL: http://svn.freebsd.org/changeset/base/217602 Log: MFC r205978 from /head Document DEBUG_FLAGS in a more visible place, in the build(7) manpage Noticed by: Alexander Best Reviewed by: jhb Modified: stable/7/share/man/man7/build.7 Directory Properties: stable/7/share/man/man7/ (props changed) Modified: stable/7/share/man/man7/build.7 ============================================================================== --- stable/7/share/man/man7/build.7 Wed Jan 19 21:28:00 2011 (r217601) +++ stable/7/share/man/man7/build.7 Wed Jan 19 21:28:21 2011 (r217602) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 5, 2009 +.Dd March 31, 2010 .Dt BUILD 7 .Os .Sh NAME @@ -311,6 +311,20 @@ should be set as with .Sh ENVIRONMENT Variables that influence all builds include: .Bl -tag -width ".Va MAKEOBJDIRPREFIX" +.It Va DEBUG_FLAGS +Defines a set of debugging flags that will be used to build all userland +binaries under +.Pa /usr/src . +When +.Va DEBUG_FLAGS +is defined, the +.Cm install +and +.Cm installworld +targets install binaries from the current +.Va MAKEOBJDIRPREFIX +without stripping, +so that debugging information is retained in the installed binaries. .It Va DESTDIR The directory hierarchy prefix where built objects will be installed. If not set, From owner-svn-src-all@FreeBSD.ORG Wed Jan 19 21:34:42 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B3AD106566C; Wed, 19 Jan 2011 21:34:42 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 59F698FC08; Wed, 19 Jan 2011 21:34:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0JLYgQO089900; Wed, 19 Jan 2011 21:34:42 GMT (envelope-from keramida@svn.freebsd.org) Received: (from keramida@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0JLYgAh089898; Wed, 19 Jan 2011 21:34:42 GMT (envelope-from keramida@svn.freebsd.org) Message-Id: <201101192134.p0JLYgAh089898@svn.freebsd.org> From: Giorgos Keramidas Date: Wed, 19 Jan 2011 21:34:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217603 - stable/8/lib/libc/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 21:34:42 -0000 Author: keramida (doc committer) Date: Wed Jan 19 21:34:42 2011 New Revision: 217603 URL: http://svn.freebsd.org/changeset/base/217603 Log: MFC r199985 from /head Describe what setpgid(2) does when pgid=0. The text has been copied from NetBSD’s manpage, and it also matches the behavior described by the Open Group’s online copy of setpgid.2 at http://www.opengroup.org/onlinepubs/009695399/functions/setpgid.html Obtained from: NetBSD Submitted by: Petros Barbayiannis Modified: stable/8/lib/libc/sys/setpgid.2 Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/locale/ (props changed) stable/8/lib/libc/stdtime/ (props changed) stable/8/lib/libc/sys/ (props changed) Modified: stable/8/lib/libc/sys/setpgid.2 ============================================================================== --- stable/8/lib/libc/sys/setpgid.2 Wed Jan 19 21:28:21 2011 (r217602) +++ stable/8/lib/libc/sys/setpgid.2 Wed Jan 19 21:34:42 2011 (r217603) @@ -54,6 +54,11 @@ to the specified If .Fa pid is zero, then the call applies to the current process. +If +.Fa pgrp +is zero, then the process id of the process specified by +.Fa pid +is used instead. .Pp If the affected process is not the invoking process, then it must be a child of the invoking process, it must not have performed an From owner-svn-src-all@FreeBSD.ORG Wed Jan 19 21:35:48 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D48E31065672; Wed, 19 Jan 2011 21:35:48 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C44B28FC1C; Wed, 19 Jan 2011 21:35:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0JLZmIt090003; Wed, 19 Jan 2011 21:35:48 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0JLZmVr089995; Wed, 19 Jan 2011 21:35:48 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201101192135.p0JLZmVr089995@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 19 Jan 2011 21:35:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217604 - head/sys/amd64/amd64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 21:35:48 -0000 Author: kib Date: Wed Jan 19 21:35:48 2011 New Revision: 217604 URL: http://svn.freebsd.org/changeset/base/217604 Log: Use CTLFLAG_RDTUN for read-only sysctl that exports tunable. Reminded by: pjd MFC after: 6 days Modified: head/sys/amd64/amd64/sys_machdep.c Modified: head/sys/amd64/amd64/sys_machdep.c ============================================================================== --- head/sys/amd64/amd64/sys_machdep.c Wed Jan 19 21:34:42 2011 (r217603) +++ head/sys/amd64/amd64/sys_machdep.c Wed Jan 19 21:35:48 2011 (r217604) @@ -62,8 +62,8 @@ __FBSDID("$FreeBSD$"); #define MAX_LD 8192 int max_ldt_segment = 1024; -SYSCTL_INT(_machdep, OID_AUTO, max_ldt_segment, CTLFLAG_RD, &max_ldt_segment, - 0, +SYSCTL_INT(_machdep, OID_AUTO, max_ldt_segment, CTLFLAG_RDTUN, + &max_ldt_segment, 0, "Maximum number of allowed LDT segments in the single address space"); static void From owner-svn-src-all@FreeBSD.ORG Wed Jan 19 21:35:49 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3F5C61065673; Wed, 19 Jan 2011 21:35:49 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2DED98FC1D; Wed, 19 Jan 2011 21:35:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0JLZnNm090019; Wed, 19 Jan 2011 21:35:49 GMT (envelope-from keramida@svn.freebsd.org) Received: (from keramida@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0JLZncd090017; Wed, 19 Jan 2011 21:35:49 GMT (envelope-from keramida@svn.freebsd.org) Message-Id: <201101192135.p0JLZncd090017@svn.freebsd.org> From: Giorgos Keramidas Date: Wed, 19 Jan 2011 21:35:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217605 - stable/7/lib/libc/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 21:35:49 -0000 Author: keramida (doc committer) Date: Wed Jan 19 21:35:48 2011 New Revision: 217605 URL: http://svn.freebsd.org/changeset/base/217605 Log: MFC r199985 from /head Describe what setpgid(2) does when pgid=0. The text has been copied from NetBSD’s manpage, and it also matches the behavior described by the Open Group’s online copy of setpgid.2 at http://www.opengroup.org/onlinepubs/009695399/functions/setpgid.html Obtained from: NetBSD Submitted by: Petros Barbayiannis Modified: stable/7/lib/libc/sys/setpgid.2 Directory Properties: stable/7/lib/libc/ (props changed) stable/7/lib/libc/stdtime/ (props changed) Modified: stable/7/lib/libc/sys/setpgid.2 ============================================================================== --- stable/7/lib/libc/sys/setpgid.2 Wed Jan 19 21:35:48 2011 (r217604) +++ stable/7/lib/libc/sys/setpgid.2 Wed Jan 19 21:35:48 2011 (r217605) @@ -54,6 +54,11 @@ to the specified If .Fa pid is zero, then the call applies to the current process. +If +.Fa pgrp +is zero, then the process id of the process specified by +.Fa pid +is used instead. .Pp If the affected process is not the invoking process, then it must be a child of the invoking process, it must not have performed an From owner-svn-src-all@FreeBSD.ORG Wed Jan 19 21:39:21 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E7928106566C; Wed, 19 Jan 2011 21:39:21 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 754C38FC08; Wed, 19 Jan 2011 21:39:21 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id p0JLXvCe024895; Wed, 19 Jan 2011 14:33:57 -0700 (MST) (envelope-from imp@bsdimp.com) Message-ID: <4D3758C5.4060102@bsdimp.com> Date: Wed, 19 Jan 2011 14:33:57 -0700 From: Warner Losh User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.13) Gecko/20101211 Thunderbird/3.1.7 MIME-Version: 1.0 To: Kostik Belousov References: <201101191709.p0JH97ZD083132@svn.freebsd.org> <20110119171807.GA2518@deviant.kiev.zoral.com.ua> <201101191311.03440.jkim@FreeBSD.org> <20110119205513.GC2518@deviant.kiev.zoral.com.ua> In-Reply-To: <20110119205513.GC2518@deviant.kiev.zoral.com.ua> 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, Jung-uk Kim Subject: Re: svn commit: r217587 - head/sys/i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 21:39:22 -0000 On 01/19/2011 13:55, Kostik Belousov wrote: > Simply put, we cannot trust BIOS. Given all the issues we've had with BIOS over the years, I think it is better to be proactively paranoid where possible, unless there is a significant performance improvement for the overall system.. Warner From owner-svn-src-all@FreeBSD.ORG Wed Jan 19 21:43:08 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C2D401065672; Wed, 19 Jan 2011 21:43:08 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 97E078FC12; Wed, 19 Jan 2011 21:43:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0JLh8n5090263; Wed, 19 Jan 2011 21:43:08 GMT (envelope-from keramida@svn.freebsd.org) Received: (from keramida@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0JLh8Ie090261; Wed, 19 Jan 2011 21:43:08 GMT (envelope-from keramida@svn.freebsd.org) Message-Id: <201101192143.p0JLh8Ie090261@svn.freebsd.org> From: Giorgos Keramidas Date: Wed, 19 Jan 2011 21:43:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217606 - head/share/man/man5 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 21:43:08 -0000 Author: keramida (doc committer) Date: Wed Jan 19 21:43:08 2011 New Revision: 217606 URL: http://svn.freebsd.org/changeset/base/217606 Log: Bump .Dd date of manpage for r217481 Modified: head/share/man/man5/xfs.5 Modified: head/share/man/man5/xfs.5 ============================================================================== --- head/share/man/man5/xfs.5 Wed Jan 19 21:35:48 2011 (r217605) +++ head/share/man/man5/xfs.5 Wed Jan 19 21:43:08 2011 (r217606) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 16, 2007 +.Dd January 16, 2011 .Dt XFS 5 .Os .Sh NAME From owner-svn-src-all@FreeBSD.ORG Wed Jan 19 21:45:40 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 950C6106566B; Wed, 19 Jan 2011 21:45:40 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8490C8FC16; Wed, 19 Jan 2011 21:45:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0JLjeq0090404; Wed, 19 Jan 2011 21:45:40 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0JLjeTk090402; Wed, 19 Jan 2011 21:45:40 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201101192145.p0JLjeTk090402@svn.freebsd.org> From: Juli Mallett Date: Wed, 19 Jan 2011 21:45:40 +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: r217607 - head/sys/mips/rmi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 21:45:40 -0000 Author: jmallett Date: Wed Jan 19 21:45:40 2011 New Revision: 217607 URL: http://svn.freebsd.org/changeset/base/217607 Log: Fix format of physical addresses; this fixes the n32 build. Modified: head/sys/mips/rmi/xlr_machdep.c Modified: head/sys/mips/rmi/xlr_machdep.c ============================================================================== --- head/sys/mips/rmi/xlr_machdep.c Wed Jan 19 21:43:08 2011 (r217606) +++ head/sys/mips/rmi/xlr_machdep.c Wed Jan 19 21:45:40 2011 (r217607) @@ -358,9 +358,9 @@ xlr_mem_init(void) } phys_avail[1] = boot_map->physmem_map[0].addr + boot_map->physmem_map[0].size; - printf("First segment: addr:%p -> %p \n", - (void *)phys_avail[0], - (void *)phys_avail[1]); + printf("First segment: addr:%#jx -> %#jx \n", + (uintmax_t)phys_avail[0], + (uintmax_t)phys_avail[1]); dump_avail[0] = phys_avail[0]; dump_avail[1] = phys_avail[1]; From owner-svn-src-all@FreeBSD.ORG Wed Jan 19 21:49:21 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C1CC81065674; Wed, 19 Jan 2011 21:49:21 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B063D8FC14; Wed, 19 Jan 2011 21:49:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0JLnLal090515; Wed, 19 Jan 2011 21:49:21 GMT (envelope-from keramida@svn.freebsd.org) Received: (from keramida@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0JLnLW1090513; Wed, 19 Jan 2011 21:49:21 GMT (envelope-from keramida@svn.freebsd.org) Message-Id: <201101192149.p0JLnLW1090513@svn.freebsd.org> From: Giorgos Keramidas Date: Wed, 19 Jan 2011 21:49:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217608 - stable/8/share/man/man5 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 21:49:21 -0000 Author: keramida (doc committer) Date: Wed Jan 19 21:49:21 2011 New Revision: 217608 URL: http://svn.freebsd.org/changeset/base/217608 Log: MFC r217481 and r217606 from /head r217481... Fix the mount example of xfs(5) filesystems by including the read-only option. We only support ro mounts for xfs, so it’s nice if the examples we show in the manpage are easy to copy/paste. PR: docs/149106 Submitted by: amdmi3 r217606... Bump .Dd date of manpage for r217481 Modified: stable/8/share/man/man5/xfs.5 Directory Properties: stable/8/share/man/man5/ (props changed) Modified: stable/8/share/man/man5/xfs.5 ============================================================================== --- stable/8/share/man/man5/xfs.5 Wed Jan 19 21:45:40 2011 (r217607) +++ stable/8/share/man/man5/xfs.5 Wed Jan 19 21:49:21 2011 (r217608) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 16, 2007 +.Dd January 16, 2011 .Dt XFS 5 .Os .Sh NAME @@ -53,7 +53,7 @@ To mount a volume located on .Pa /dev/ad1s1 : .Pp -.Dl "mount -t xfs /dev/ad1s1 /mnt" +.Dl "mount -t xfs -o ro /dev/ad1s1 /mnt" .Sh SEE ALSO .Xr nmount 2 , .Xr unmount 2 , From owner-svn-src-all@FreeBSD.ORG Wed Jan 19 21:49:42 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CFE5D1065694; Wed, 19 Jan 2011 21:49:42 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BE8EC8FC15; Wed, 19 Jan 2011 21:49:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0JLnglu090559; Wed, 19 Jan 2011 21:49:42 GMT (envelope-from keramida@svn.freebsd.org) Received: (from keramida@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0JLngJF090557; Wed, 19 Jan 2011 21:49:42 GMT (envelope-from keramida@svn.freebsd.org) Message-Id: <201101192149.p0JLngJF090557@svn.freebsd.org> From: Giorgos Keramidas Date: Wed, 19 Jan 2011 21:49:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217609 - stable/7/share/man/man5 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 21:49:42 -0000 Author: keramida (doc committer) Date: Wed Jan 19 21:49:42 2011 New Revision: 217609 URL: http://svn.freebsd.org/changeset/base/217609 Log: MFC r217481 and r217606 from /head r217481... Fix the mount example of xfs(5) filesystems by including the read-only option. We only support ro mounts for xfs, so it’s nice if the examples we show in the manpage are easy to copy/paste. PR: docs/149106 Submitted by: amdmi3 r217606... Bump .Dd date of manpage for r217481 Modified: stable/7/share/man/man5/xfs.5 Directory Properties: stable/7/share/man/man5/ (props changed) Modified: stable/7/share/man/man5/xfs.5 ============================================================================== --- stable/7/share/man/man5/xfs.5 Wed Jan 19 21:49:21 2011 (r217608) +++ stable/7/share/man/man5/xfs.5 Wed Jan 19 21:49:42 2011 (r217609) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 16, 2007 +.Dd January 16, 2011 .Dt XFS 5 .Os .Sh NAME @@ -53,7 +53,7 @@ To mount a volume located on .Pa /dev/ad1s1 : .Pp -.Dl "mount -t xfs /dev/ad1s1 /mnt" +.Dl "mount -t xfs -o ro /dev/ad1s1 /mnt" .Sh SEE ALSO .Xr nmount 2 , .Xr unmount 2 , From owner-svn-src-all@FreeBSD.ORG Wed Jan 19 22:10:36 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D185106567A; Wed, 19 Jan 2011 22:10:36 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1B44D8FC18; Wed, 19 Jan 2011 22:10:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0JMAapN091252; Wed, 19 Jan 2011 22:10:36 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0JMAamg091247; Wed, 19 Jan 2011 22:10:36 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201101192210.p0JMAamg091247@svn.freebsd.org> From: Michael Tuexen Date: Wed, 19 Jan 2011 22:10: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: r217611 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 22:10:36 -0000 Author: tuexen Date: Wed Jan 19 22:10:35 2011 New Revision: 217611 URL: http://svn.freebsd.org/changeset/base/217611 Log: Cleanup the management of CC functions. MFC after: 3 months. Deleted: head/sys/netinet/sctp_cc_functions.h Modified: head/sys/netinet/sctp_cc_functions.c head/sys/netinet/sctp_pcb.c head/sys/netinet/sctp_usrreq.c head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctp_cc_functions.c ============================================================================== --- head/sys/netinet/sctp_cc_functions.c Wed Jan 19 21:57:30 2011 (r217610) +++ head/sys/netinet/sctp_cc_functions.c Wed Jan 19 22:10:35 2011 (r217611) @@ -41,12 +41,11 @@ #include #include #include -#include #include #include __FBSDID("$FreeBSD$"); -void +static void sctp_set_initial_cc_param(struct sctp_tcb *stcb, struct sctp_nets *net) { struct sctp_association *assoc; @@ -84,7 +83,7 @@ sctp_set_initial_cc_param(struct sctp_tc } } -void +static void sctp_cwnd_update_after_fr(struct sctp_tcb *stcb, struct sctp_association *asoc) { @@ -191,7 +190,7 @@ sctp_cwnd_update_after_fr(struct sctp_tc } } -void +static void sctp_cwnd_update_after_sack(struct sctp_tcb *stcb, struct sctp_association *asoc, int accum_moved, int reneged_all, int will_exit) @@ -447,7 +446,7 @@ skip_cwnd_update: } } -void +static void sctp_cwnd_update_after_timeout(struct sctp_tcb *stcb, struct sctp_nets *net) { int old_cwnd = net->cwnd; @@ -489,7 +488,7 @@ sctp_cwnd_update_after_timeout(struct sc } } -void +static void sctp_cwnd_update_after_ecn_echo(struct sctp_tcb *stcb, struct sctp_nets *net) { int old_cwnd = net->cwnd; @@ -512,7 +511,7 @@ sctp_cwnd_update_after_ecn_echo(struct s } } -void +static void sctp_cwnd_update_after_packet_dropped(struct sctp_tcb *stcb, struct sctp_nets *net, struct sctp_pktdrop_chunk *cp, uint32_t * bottle_bw, uint32_t * on_queue) @@ -628,7 +627,7 @@ sctp_cwnd_update_after_packet_dropped(st } } -void +static void sctp_cwnd_update_after_output(struct sctp_tcb *stcb, struct sctp_nets *net, int burst_limit) { @@ -647,7 +646,7 @@ sctp_cwnd_update_after_output(struct sct } } -void +static void sctp_cwnd_update_after_fr_timer(struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sctp_nets *net) { @@ -836,7 +835,7 @@ sctp_hs_cwnd_decrease(struct sctp_tcb *s } } -void +static void sctp_hs_cwnd_update_after_fr(struct sctp_tcb *stcb, struct sctp_association *asoc) { @@ -908,7 +907,7 @@ sctp_hs_cwnd_update_after_fr(struct sctp } } -void +static void sctp_hs_cwnd_update_after_sack(struct sctp_tcb *stcb, struct sctp_association *asoc, int accum_moved, int reneged_all, int will_exit) @@ -1374,7 +1373,7 @@ htcp_init(struct sctp_tcb *stcb, struct net->htcp_ca.last_cong = sctp_get_tick_count(); } -void +static void sctp_htcp_set_initial_cc_param(struct sctp_tcb *stcb, struct sctp_nets *net) { /* @@ -1390,7 +1389,7 @@ sctp_htcp_set_initial_cc_param(struct sc } } -void +static void sctp_htcp_cwnd_update_after_sack(struct sctp_tcb *stcb, struct sctp_association *asoc, int accum_moved, int reneged_all, int will_exit) @@ -1550,7 +1549,7 @@ skip_cwnd_update: } } -void +static void sctp_htcp_cwnd_update_after_fr(struct sctp_tcb *stcb, struct sctp_association *asoc) { @@ -1629,7 +1628,7 @@ sctp_htcp_cwnd_update_after_fr(struct sc } } -void +static void sctp_htcp_cwnd_update_after_timeout(struct sctp_tcb *stcb, struct sctp_nets *net) { @@ -1645,7 +1644,7 @@ sctp_htcp_cwnd_update_after_timeout(stru } } -void +static void sctp_htcp_cwnd_update_after_fr_timer(struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sctp_nets *net) { @@ -1669,7 +1668,7 @@ sctp_htcp_cwnd_update_after_fr_timer(str } } -void +static void sctp_htcp_cwnd_update_after_ecn_echo(struct sctp_tcb *stcb, struct sctp_nets *net) { @@ -1691,3 +1690,36 @@ sctp_htcp_cwnd_update_after_ecn_echo(str sctp_log_cwnd(stcb, net, (net->cwnd - old_cwnd), SCTP_CWND_LOG_FROM_SAT); } } + +struct sctp_cc_functions sctp_cc_functions[] = { + { + .sctp_set_initial_cc_param = sctp_set_initial_cc_param, + .sctp_cwnd_update_after_sack = sctp_cwnd_update_after_sack, + .sctp_cwnd_update_after_fr = sctp_cwnd_update_after_fr, + .sctp_cwnd_update_after_timeout = sctp_cwnd_update_after_timeout, + .sctp_cwnd_update_after_ecn_echo = sctp_cwnd_update_after_ecn_echo, + .sctp_cwnd_update_after_packet_dropped = sctp_cwnd_update_after_packet_dropped, + .sctp_cwnd_update_after_output = sctp_cwnd_update_after_output, + .sctp_cwnd_update_after_fr_timer = sctp_cwnd_update_after_fr_timer + }, + { + .sctp_set_initial_cc_param = sctp_set_initial_cc_param, + .sctp_cwnd_update_after_sack = sctp_hs_cwnd_update_after_sack, + .sctp_cwnd_update_after_fr = sctp_hs_cwnd_update_after_fr, + .sctp_cwnd_update_after_timeout = sctp_cwnd_update_after_timeout, + .sctp_cwnd_update_after_ecn_echo = sctp_cwnd_update_after_ecn_echo, + .sctp_cwnd_update_after_packet_dropped = sctp_cwnd_update_after_packet_dropped, + .sctp_cwnd_update_after_output = sctp_cwnd_update_after_output, + .sctp_cwnd_update_after_fr_timer = sctp_cwnd_update_after_fr_timer + }, + { + .sctp_set_initial_cc_param = sctp_htcp_set_initial_cc_param, + .sctp_cwnd_update_after_sack = sctp_htcp_cwnd_update_after_sack, + .sctp_cwnd_update_after_fr = sctp_htcp_cwnd_update_after_fr, + .sctp_cwnd_update_after_timeout = sctp_htcp_cwnd_update_after_timeout, + .sctp_cwnd_update_after_ecn_echo = sctp_htcp_cwnd_update_after_ecn_echo, + .sctp_cwnd_update_after_packet_dropped = sctp_cwnd_update_after_packet_dropped, + .sctp_cwnd_update_after_output = sctp_cwnd_update_after_output, + .sctp_cwnd_update_after_fr_timer = sctp_htcp_cwnd_update_after_fr_timer + } +}; Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Wed Jan 19 21:57:30 2011 (r217610) +++ head/sys/netinet/sctp_pcb.c Wed Jan 19 22:10:35 2011 (r217611) @@ -2516,13 +2516,7 @@ sctp_inpcb_alloc(struct socket *so, uint m->sctp_sws_sender = SCTP_SWS_SENDER_DEF; m->sctp_sws_receiver = SCTP_SWS_RECEIVER_DEF; m->max_burst = SCTP_BASE_SYSCTL(sctp_max_burst_default); - if ((SCTP_BASE_SYSCTL(sctp_default_cc_module) >= SCTP_CC_RFC2581) && - (SCTP_BASE_SYSCTL(sctp_default_cc_module) <= SCTP_CC_HTCP)) { - m->sctp_default_cc_module = SCTP_BASE_SYSCTL(sctp_default_cc_module); - } else { - /* sysctl done with invalid value, set to 2581 */ - m->sctp_default_cc_module = SCTP_CC_RFC2581; - } + m->sctp_default_cc_module = SCTP_BASE_SYSCTL(sctp_default_cc_module); /* number of streams to pre-open on a association */ m->pre_open_stream_count = SCTP_BASE_SYSCTL(sctp_nr_outgoing_streams_default); Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Wed Jan 19 21:57:30 2011 (r217610) +++ head/sys/netinet/sctp_usrreq.c Wed Jan 19 22:10:35 2011 (r217611) @@ -48,11 +48,11 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include +extern struct sctp_cc_functions sctp_cc_functions[]; void sctp_init(void) @@ -2867,75 +2867,26 @@ sctp_setopt(struct socket *so, int optna SCTP_FIND_STCB(inp, stcb, av->assoc_id); if (stcb) { switch (av->assoc_value) { - /* - * JRS - Standard TCP congestion - * control - */ case SCTP_CC_RFC2581: - { - stcb->asoc.congestion_control_module = SCTP_CC_RFC2581; - stcb->asoc.cc_functions.sctp_set_initial_cc_param = &sctp_set_initial_cc_param; - stcb->asoc.cc_functions.sctp_cwnd_update_after_sack = &sctp_cwnd_update_after_sack; - stcb->asoc.cc_functions.sctp_cwnd_update_after_fr = &sctp_cwnd_update_after_fr; - stcb->asoc.cc_functions.sctp_cwnd_update_after_timeout = &sctp_cwnd_update_after_timeout; - stcb->asoc.cc_functions.sctp_cwnd_update_after_ecn_echo = &sctp_cwnd_update_after_ecn_echo; - stcb->asoc.cc_functions.sctp_cwnd_update_after_packet_dropped = &sctp_cwnd_update_after_packet_dropped; - stcb->asoc.cc_functions.sctp_cwnd_update_after_output = &sctp_cwnd_update_after_output; - stcb->asoc.cc_functions.sctp_cwnd_update_after_fr_timer = &sctp_cwnd_update_after_fr_timer; - SCTP_TCB_UNLOCK(stcb); - break; - } - /* - * JRS - High Speed TCP congestion - * control (Floyd) - */ case SCTP_CC_HSTCP: - { - stcb->asoc.congestion_control_module = SCTP_CC_HSTCP; - stcb->asoc.cc_functions.sctp_set_initial_cc_param = &sctp_set_initial_cc_param; - stcb->asoc.cc_functions.sctp_cwnd_update_after_sack = &sctp_hs_cwnd_update_after_sack; - stcb->asoc.cc_functions.sctp_cwnd_update_after_fr = &sctp_hs_cwnd_update_after_fr; - stcb->asoc.cc_functions.sctp_cwnd_update_after_timeout = &sctp_cwnd_update_after_timeout; - stcb->asoc.cc_functions.sctp_cwnd_update_after_ecn_echo = &sctp_cwnd_update_after_ecn_echo; - stcb->asoc.cc_functions.sctp_cwnd_update_after_packet_dropped = &sctp_cwnd_update_after_packet_dropped; - stcb->asoc.cc_functions.sctp_cwnd_update_after_output = &sctp_cwnd_update_after_output; - stcb->asoc.cc_functions.sctp_cwnd_update_after_fr_timer = &sctp_cwnd_update_after_fr_timer; - SCTP_TCB_UNLOCK(stcb); - break; - } - /* JRS - HTCP congestion control */ case SCTP_CC_HTCP: - { - stcb->asoc.congestion_control_module = SCTP_CC_HTCP; - stcb->asoc.cc_functions.sctp_set_initial_cc_param = &sctp_htcp_set_initial_cc_param; - stcb->asoc.cc_functions.sctp_cwnd_update_after_sack = &sctp_htcp_cwnd_update_after_sack; - stcb->asoc.cc_functions.sctp_cwnd_update_after_fr = &sctp_htcp_cwnd_update_after_fr; - stcb->asoc.cc_functions.sctp_cwnd_update_after_timeout = &sctp_htcp_cwnd_update_after_timeout; - stcb->asoc.cc_functions.sctp_cwnd_update_after_ecn_echo = &sctp_htcp_cwnd_update_after_ecn_echo; - stcb->asoc.cc_functions.sctp_cwnd_update_after_packet_dropped = &sctp_cwnd_update_after_packet_dropped; - stcb->asoc.cc_functions.sctp_cwnd_update_after_output = &sctp_cwnd_update_after_output; - stcb->asoc.cc_functions.sctp_cwnd_update_after_fr_timer = &sctp_htcp_cwnd_update_after_fr_timer; - SCTP_TCB_UNLOCK(stcb); - break; - } - /* - * JRS - All other values are - * invalid - */ + stcb->asoc.cc_functions = sctp_cc_functions[av->assoc_value]; + stcb->asoc.congestion_control_module = av->assoc_value; + break; default: - { - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); - error = EINVAL; - SCTP_TCB_UNLOCK(stcb); - break; - } + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); + error = EINVAL; + break; } + SCTP_TCB_UNLOCK(stcb); } else { switch (av->assoc_value) { case SCTP_CC_RFC2581: case SCTP_CC_HSTCP: case SCTP_CC_HTCP: + SCTP_INP_WLOCK(inp); inp->sctp_ep.sctp_default_cc_module = av->assoc_value; + SCTP_INP_WUNLOCK(inp); break; default: SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Wed Jan 19 21:57:30 2011 (r217610) +++ head/sys/netinet/sctputil.c Wed Jan 19 22:10:35 2011 (r217611) @@ -47,7 +47,6 @@ __FBSDID("$FreeBSD$"); #include /* for sctp_deliver_data() */ #include #include -#include #include @@ -55,6 +54,8 @@ __FBSDID("$FreeBSD$"); #define KTR_SCTP KTR_SUBSYS #endif +extern struct sctp_cc_functions sctp_cc_functions[]; + void sctp_sblog(struct sockbuf *sb, struct sctp_tcb *stcb, int from, int incr) @@ -1044,67 +1045,17 @@ sctp_init_asoc(struct sctp_inpcb *m, str asoc->sctp_autoclose_ticks = m->sctp_ep.auto_close_time; - /* - * JRS - Pick the default congestion control module based on the - * sysctl. - */ switch (m->sctp_ep.sctp_default_cc_module) { - /* JRS - Standard TCP congestion control */ case SCTP_CC_RFC2581: - { - stcb->asoc.congestion_control_module = SCTP_CC_RFC2581; - stcb->asoc.cc_functions.sctp_set_initial_cc_param = &sctp_set_initial_cc_param; - stcb->asoc.cc_functions.sctp_cwnd_update_after_sack = &sctp_cwnd_update_after_sack; - stcb->asoc.cc_functions.sctp_cwnd_update_after_fr = &sctp_cwnd_update_after_fr; - stcb->asoc.cc_functions.sctp_cwnd_update_after_timeout = &sctp_cwnd_update_after_timeout; - stcb->asoc.cc_functions.sctp_cwnd_update_after_ecn_echo = &sctp_cwnd_update_after_ecn_echo; - stcb->asoc.cc_functions.sctp_cwnd_update_after_packet_dropped = &sctp_cwnd_update_after_packet_dropped; - stcb->asoc.cc_functions.sctp_cwnd_update_after_output = &sctp_cwnd_update_after_output; - stcb->asoc.cc_functions.sctp_cwnd_update_after_fr_timer = &sctp_cwnd_update_after_fr_timer; - break; - } - /* JRS - High Speed TCP congestion control (Floyd) */ case SCTP_CC_HSTCP: - { - stcb->asoc.congestion_control_module = SCTP_CC_HSTCP; - stcb->asoc.cc_functions.sctp_set_initial_cc_param = &sctp_set_initial_cc_param; - stcb->asoc.cc_functions.sctp_cwnd_update_after_sack = &sctp_hs_cwnd_update_after_sack; - stcb->asoc.cc_functions.sctp_cwnd_update_after_fr = &sctp_hs_cwnd_update_after_fr; - stcb->asoc.cc_functions.sctp_cwnd_update_after_timeout = &sctp_cwnd_update_after_timeout; - stcb->asoc.cc_functions.sctp_cwnd_update_after_ecn_echo = &sctp_cwnd_update_after_ecn_echo; - stcb->asoc.cc_functions.sctp_cwnd_update_after_packet_dropped = &sctp_cwnd_update_after_packet_dropped; - stcb->asoc.cc_functions.sctp_cwnd_update_after_output = &sctp_cwnd_update_after_output; - stcb->asoc.cc_functions.sctp_cwnd_update_after_fr_timer = &sctp_cwnd_update_after_fr_timer; - break; - } - /* JRS - HTCP congestion control */ case SCTP_CC_HTCP: - { - stcb->asoc.congestion_control_module = SCTP_CC_HTCP; - stcb->asoc.cc_functions.sctp_set_initial_cc_param = &sctp_htcp_set_initial_cc_param; - stcb->asoc.cc_functions.sctp_cwnd_update_after_sack = &sctp_htcp_cwnd_update_after_sack; - stcb->asoc.cc_functions.sctp_cwnd_update_after_fr = &sctp_htcp_cwnd_update_after_fr; - stcb->asoc.cc_functions.sctp_cwnd_update_after_timeout = &sctp_htcp_cwnd_update_after_timeout; - stcb->asoc.cc_functions.sctp_cwnd_update_after_ecn_echo = &sctp_htcp_cwnd_update_after_ecn_echo; - stcb->asoc.cc_functions.sctp_cwnd_update_after_packet_dropped = &sctp_cwnd_update_after_packet_dropped; - stcb->asoc.cc_functions.sctp_cwnd_update_after_output = &sctp_cwnd_update_after_output; - stcb->asoc.cc_functions.sctp_cwnd_update_after_fr_timer = &sctp_htcp_cwnd_update_after_fr_timer; - break; - } - /* JRS - By default, use RFC2581 */ + stcb->asoc.congestion_control_module = m->sctp_ep.sctp_default_cc_module; + stcb->asoc.cc_functions = sctp_cc_functions[m->sctp_ep.sctp_default_cc_module]; + break; default: - { - stcb->asoc.congestion_control_module = SCTP_CC_RFC2581; - stcb->asoc.cc_functions.sctp_set_initial_cc_param = &sctp_set_initial_cc_param; - stcb->asoc.cc_functions.sctp_cwnd_update_after_sack = &sctp_cwnd_update_after_sack; - stcb->asoc.cc_functions.sctp_cwnd_update_after_fr = &sctp_cwnd_update_after_fr; - stcb->asoc.cc_functions.sctp_cwnd_update_after_timeout = &sctp_cwnd_update_after_timeout; - stcb->asoc.cc_functions.sctp_cwnd_update_after_ecn_echo = &sctp_cwnd_update_after_ecn_echo; - stcb->asoc.cc_functions.sctp_cwnd_update_after_packet_dropped = &sctp_cwnd_update_after_packet_dropped; - stcb->asoc.cc_functions.sctp_cwnd_update_after_output = &sctp_cwnd_update_after_output; - stcb->asoc.cc_functions.sctp_cwnd_update_after_fr_timer = &sctp_cwnd_update_after_fr_timer; - break; - } + stcb->asoc.congestion_control_module = SCTP_CC_RFC2581; + stcb->asoc.cc_functions = sctp_cc_functions[SCTP_CC_RFC2581]; + break; } /* From owner-svn-src-all@FreeBSD.ORG Wed Jan 19 22:15:13 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 36A5C106564A; Wed, 19 Jan 2011 22:15:13 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 261688FC0C; Wed, 19 Jan 2011 22:15:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0JMFDag091478; Wed, 19 Jan 2011 22:15:13 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0JMFDvC091476; Wed, 19 Jan 2011 22:15:13 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201101192215.p0JMFDvC091476@svn.freebsd.org> From: Juli Mallett Date: Wed, 19 Jan 2011 22:15: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: r217612 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 22:15:13 -0000 Author: jmallett Date: Wed Jan 19 22:15:12 2011 New Revision: 217612 URL: http://svn.freebsd.org/changeset/base/217612 Log: The output format should be determined by the ABI flags, not the ldscript. This ldscript is used with both little-endian and big-endian targets. This hopefully fixes MIPS universe. NB: We really should get rid of almost all of the MIPS ldscripts. There's only gratuitous differences between them, mostly because they're too specific or they do things like specify the output format rather than taking it from flags given in the kernel config file or the default output format of the compiler. Also add svn:keywords property. Modified: head/sys/conf/ldscript.mips.mips64 (contents, props changed) Modified: head/sys/conf/ldscript.mips.mips64 ============================================================================== --- head/sys/conf/ldscript.mips.mips64 Wed Jan 19 22:10:35 2011 (r217611) +++ head/sys/conf/ldscript.mips.mips64 Wed Jan 19 22:15:12 2011 (r217612) @@ -27,12 +27,9 @@ * SUCH DAMAGE. * * JNPR: ldscript.mips,v 1.3 2006/10/11 06:12:04 - * $FreeBSD: projects/mips/sys/conf/ldscript.mips 191079 2009-04-14 22:53:22Z gonzo $ + * $FreeBSD$ */ -OUTPUT_FORMAT("elf64-tradbigmips", "elf64-tradbigmips", - "elf64-tradlittlemips") - OUTPUT_ARCH(mips) ENTRY(_start) SEARCH_DIR(/usr/lib); From owner-svn-src-all@FreeBSD.ORG Wed Jan 19 22:16:42 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6C991106566C; Wed, 19 Jan 2011 22:16:42 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5C6DF8FC13; Wed, 19 Jan 2011 22:16:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0JMGg0t091554; Wed, 19 Jan 2011 22:16:42 GMT (envelope-from jmg@svn.freebsd.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0JMGgmF091552; Wed, 19 Jan 2011 22:16:42 GMT (envelope-from jmg@svn.freebsd.org) Message-Id: <201101192216.p0JMGgmF091552@svn.freebsd.org> From: John-Mark Gurney Date: Wed, 19 Jan 2011 22:16: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: r217613 - head/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 22:16:42 -0000 Author: jmg Date: Wed Jan 19 22:16:42 2011 New Revision: 217613 URL: http://svn.freebsd.org/changeset/base/217613 Log: document that even when wakeup_one is used to wakeup, msleep and friends may still return a non-zero value... You are not guaranteed to get a one to one mapping between wakeup_one and zero return values... Reviewed by: kib MFC after: 3 days Modified: head/share/man/man9/sleep.9 Modified: head/share/man/man9/sleep.9 ============================================================================== --- head/share/man/man9/sleep.9 Wed Jan 19 22:15:12 2011 (r217612) +++ head/share/man/man9/sleep.9 Wed Jan 19 22:16:42 2011 (r217613) @@ -255,6 +255,14 @@ pay particular attention to ensure that same .Fa chan . .Sh RETURN VALUES +When awakened by a call to +.Fn wakeup +or +.Fn wakeup_one , +if a signal is pending and +.Dv PCATCH +is specified, +a non-zero error code is returned. If the thread is awakened by a call to .Fn wakeup or From owner-svn-src-all@FreeBSD.ORG Wed Jan 19 22:25:08 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 19A131065672; Wed, 19 Jan 2011 22:25:08 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0783A8FC14; Wed, 19 Jan 2011 22:25:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0JMP7NF091860; Wed, 19 Jan 2011 22:25:07 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0JMP7in091856; Wed, 19 Jan 2011 22:25:07 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201101192225.p0JMP7in091856@svn.freebsd.org> From: Andrew Thompson Date: Wed, 19 Jan 2011 22:25:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217614 - stable/8/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 22:25:08 -0000 Author: thompsa Date: Wed Jan 19 22:25:07 2011 New Revision: 217614 URL: http://svn.freebsd.org/changeset/base/217614 Log: MFC r203134,r207990,r217289 Add manpages for run(4) and runfw(4). Added: stable/8/share/man/man4/run.4 - copied, changed from r203134, head/share/man/man4/run.4 stable/8/share/man/man4/runfw.4 - copied unchanged from r217289, head/share/man/man4/runfw.4 Modified: stable/8/share/man/man4/Makefile Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/Makefile ============================================================================== --- stable/8/share/man/man4/Makefile Wed Jan 19 22:16:42 2011 (r217613) +++ stable/8/share/man/man4/Makefile Wed Jan 19 22:25:07 2011 (r217614) @@ -338,6 +338,7 @@ MAN= aac.4 \ rp.4 \ rue.4 \ rum.4 \ + runfw.4 \ sa.4 \ safe.4 \ sbp.4 \ Copied and modified: stable/8/share/man/man4/run.4 (from r203134, head/share/man/man4/run.4) ============================================================================== --- head/share/man/man4/run.4 Thu Jan 28 22:24:54 2010 (r203134, copy source) +++ stable/8/share/man/man4/run.4 Wed Jan 19 22:25:07 2011 (r217614) @@ -16,7 +16,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 29, 2010 +.Dd January 12, 2011 .Os .Dt RUN 4 .Sh NAME @@ -36,11 +36,17 @@ kernel configuration file: .Cd "device wlan_amrr" .Ed .Pp +Firmware is also needed, and provided by: +.Bd -ragged -offset indent +.Cd "device runfw" +.Ed +.Pp Alternatively, to load the driver as a -module at boot time, place the following line in +module at boot time, place the following lines in .Xr loader.conf 5 : .Bd -literal -offset indent if_run_load="YES" +runfw_load="YES" .Ed .Sh DESCRIPTION The @@ -68,6 +74,9 @@ Also known as mode, this is used when associating with an access point, through which all traffic passes. This mode is the default. +.It Host AP mode +In this mode the driver acts as an access point (base station) +for other cards. .It monitor mode In this mode the driver is able to receive packets without associating with an access point. @@ -94,11 +103,11 @@ hardware for the WEP40, WEP104, TKIP(+MI The .Nm driver can be configured at runtime with -.Xr ifconfig 8 -or on boot with -.Xr hostname.if 5 . +.Xr ifconfig 8 . .Sh HARDWARE -The following adapters should work: +The +.Nm +driver supports the following wireless adapters: .Pp .Bl -tag -width Ds -offset indent -compact .It Airlink101 AWLL6090 @@ -174,7 +183,7 @@ ifconfig wlan create wlandev run0 wlanmo .Ed .Sh DIAGNOSTICS .Bl -diag -.It "run%d: error %d, could not read firmware %s" +.It "run%d: faild load firmware of file runfw" For some reason, the driver was unable to read the microcode file from the filesystem. The file might be missing or corrupted. @@ -187,6 +196,7 @@ The driver will reset the hardware. This should not happen. .El .Sh SEE ALSO +.Xr runfw 4 , .Xr intro 4 , .Xr netintro 4 , .Xr usb 4 , Copied: stable/8/share/man/man4/runfw.4 (from r217289, head/share/man/man4/runfw.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/share/man/man4/runfw.4 Wed Jan 19 22:25:07 2011 (r217614, copy of r217289, head/share/man/man4/runfw.4) @@ -0,0 +1,50 @@ +.\" Copyright (c) 2010 Akinori Furukoshi +.\" Copyright (c) 2010 Warren Block +.\" +.\" 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. +.\" +.\" 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. +.\" +.\" $FreeBSD$ +.\" +.Dd January 12, 2011 +.Dt RUNFW 4 +.Os +.Sh NAME +.Nm runfw +.Nd "Firmware Module for Ralink driver" +.Sh SYNOPSIS +To compile this module into the kernel, place the following line in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device runfw" +.Ed +.Pp +This will include two firmware images, RT2870 and RT3071, inside the kernel. +.Xr run 4 +will load the appropriate image into the chip. +.Pp +Alternatively, to load the firmware images as a module at boot time, place +the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +runfw_load="YES" +.Ed +.Sh DESCRIPTION +This module provides firmware sets for the Ralink RT2700U, +RT2800U and RT3000U chip based USB WiFi adapters. +Please read Ralink's license, src/sys/contrib/dev/run/LICENSE. +.Sh SEE ALSO +.Xr run 4 , +.Xr firmware 9 From owner-svn-src-all@FreeBSD.ORG Wed Jan 19 22:29:19 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E63061065697; Wed, 19 Jan 2011 22:29:19 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D4CF58FC0A; Wed, 19 Jan 2011 22:29:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0JMTJme091996; Wed, 19 Jan 2011 22:29:19 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0JMTJqi091994; Wed, 19 Jan 2011 22:29:19 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201101192229.p0JMTJqi091994@svn.freebsd.org> From: Andrew Thompson Date: Wed, 19 Jan 2011 22:29:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217615 - stable/8/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 22:29:20 -0000 Author: thompsa Date: Wed Jan 19 22:29:19 2011 New Revision: 217615 URL: http://svn.freebsd.org/changeset/base/217615 Log: MFC r203135 Hook run(4) to the build. Modified: stable/8/share/man/man4/Makefile Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/Makefile ============================================================================== --- stable/8/share/man/man4/Makefile Wed Jan 19 22:25:07 2011 (r217614) +++ stable/8/share/man/man4/Makefile Wed Jan 19 22:29:19 2011 (r217615) @@ -338,6 +338,7 @@ MAN= aac.4 \ rp.4 \ rue.4 \ rum.4 \ + run.4 \ runfw.4 \ sa.4 \ safe.4 \ From owner-svn-src-all@FreeBSD.ORG Wed Jan 19 22:30:12 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6515510656AA; Wed, 19 Jan 2011 22:30:12 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.cksoft.de (mail.cksoft.de [IPv6:2001:4068:10::3]) by mx1.freebsd.org (Postfix) with ESMTP id 0E1518FC1B; Wed, 19 Jan 2011 22:30:07 +0000 (UTC) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id 66C6841C7A9; Wed, 19 Jan 2011 23:30:06 +0100 (CET) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([192.168.74.103]) by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id 29Z7FJcjE31B; Wed, 19 Jan 2011 23:30:05 +0100 (CET) Received: by mail.cksoft.de (Postfix, from userid 66) id E2A1D41C7B8; Wed, 19 Jan 2011 23:30:05 +0100 (CET) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id 2D9064448F3; Wed, 19 Jan 2011 22:26:42 +0000 (UTC) Date: Wed, 19 Jan 2011 22:26:42 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: Juli Mallett In-Reply-To: <201101192145.p0JLjeTk090402@svn.freebsd.org> Message-ID: <20110119222630.F3489@maildrop.int.zabbadoz.net> References: <201101192145.p0JLjeTk090402@svn.freebsd.org> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r217607 - head/sys/mips/rmi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 22:30:12 -0000 On Wed, 19 Jan 2011, Juli Mallett wrote: > Author: jmallett > Date: Wed Jan 19 21:45:40 2011 > New Revision: 217607 > URL: http://svn.freebsd.org/changeset/base/217607 > > Log: > Fix format of physical addresses; this fixes the n32 build. Thanks! > Modified: > head/sys/mips/rmi/xlr_machdep.c > > Modified: head/sys/mips/rmi/xlr_machdep.c > ============================================================================== > --- head/sys/mips/rmi/xlr_machdep.c Wed Jan 19 21:43:08 2011 (r217606) > +++ head/sys/mips/rmi/xlr_machdep.c Wed Jan 19 21:45:40 2011 (r217607) > @@ -358,9 +358,9 @@ xlr_mem_init(void) > } > phys_avail[1] = boot_map->physmem_map[0].addr + > boot_map->physmem_map[0].size; > - printf("First segment: addr:%p -> %p \n", > - (void *)phys_avail[0], > - (void *)phys_avail[1]); > + printf("First segment: addr:%#jx -> %#jx \n", > + (uintmax_t)phys_avail[0], > + (uintmax_t)phys_avail[1]); > > dump_avail[0] = phys_avail[0]; > dump_avail[1] = phys_avail[1]; > -- Bjoern A. Zeeb You have to have visions! Going to jail sucks -- All my daemons like it! http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/jails.html From owner-svn-src-all@FreeBSD.ORG Wed Jan 19 22:30:12 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D0F710656AB; Wed, 19 Jan 2011 22:30:12 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.cksoft.de (mail.cksoft.de [IPv6:2001:4068:10::3]) by mx1.freebsd.org (Postfix) with ESMTP id 926178FC27; Wed, 19 Jan 2011 22:30:08 +0000 (UTC) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id EC43F41C7A8; Wed, 19 Jan 2011 23:30:07 +0100 (CET) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([192.168.74.103]) by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id 545+JdYsBp0p; Wed, 19 Jan 2011 23:30:06 +0100 (CET) Received: by mail.cksoft.de (Postfix, from userid 66) id EACEC41C7BF; Wed, 19 Jan 2011 23:30:05 +0100 (CET) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id C213D4448F3; Wed, 19 Jan 2011 22:27:53 +0000 (UTC) Date: Wed, 19 Jan 2011 22:27:53 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: Juli Mallett In-Reply-To: <201101192215.p0JMFDvC091476@svn.freebsd.org> Message-ID: <20110119222655.Y3489@maildrop.int.zabbadoz.net> References: <201101192215.p0JMFDvC091476@svn.freebsd.org> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r217612 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 22:30:12 -0000 On Wed, 19 Jan 2011, Juli Mallett wrote: > Author: jmallett > Date: Wed Jan 19 22:15:12 2011 > New Revision: 217612 > URL: http://svn.freebsd.org/changeset/base/217612 > > Log: > The output format should be determined by the ABI flags, not the ldscript. > This ldscript is used with both little-endian and big-endian targets. > > This hopefully fixes MIPS universe. And with that the entire universe for the first time in >> half a year :-)) Thanks a lot! > NB: We really should get rid of almost all of the MIPS ldscripts. There's > only gratuitous differences between them, mostly because they're too > specific or they do things like specify the output format rather than > taking it from flags given in the kernel config file or the default > output format of the compiler. > > Also add svn:keywords property. > > Modified: > head/sys/conf/ldscript.mips.mips64 (contents, props changed) > > Modified: head/sys/conf/ldscript.mips.mips64 > ============================================================================== > --- head/sys/conf/ldscript.mips.mips64 Wed Jan 19 22:10:35 2011 (r217611) > +++ head/sys/conf/ldscript.mips.mips64 Wed Jan 19 22:15:12 2011 (r217612) > @@ -27,12 +27,9 @@ > * SUCH DAMAGE. > * > * JNPR: ldscript.mips,v 1.3 2006/10/11 06:12:04 > - * $FreeBSD: projects/mips/sys/conf/ldscript.mips 191079 2009-04-14 22:53:22Z gonzo $ > + * $FreeBSD$ This doesn't look right though, does it? > */ > > -OUTPUT_FORMAT("elf64-tradbigmips", "elf64-tradbigmips", > - "elf64-tradlittlemips") > - > OUTPUT_ARCH(mips) > ENTRY(_start) > SEARCH_DIR(/usr/lib); > -- Bjoern A. Zeeb You have to have visions! Going to jail sucks -- All my daemons like it! http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/jails.html From owner-svn-src-all@FreeBSD.ORG Wed Jan 19 23:00:25 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ADDBA106564A; Wed, 19 Jan 2011 23:00:25 +0000 (UTC) (envelope-from mdf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 99FC38FC19; Wed, 19 Jan 2011 23:00:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0JN0PX1092751; Wed, 19 Jan 2011 23:00:25 GMT (envelope-from mdf@svn.freebsd.org) Received: (from mdf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0JN0P3t092737; Wed, 19 Jan 2011 23:00:25 GMT (envelope-from mdf@svn.freebsd.org) Message-Id: <201101192300.p0JN0P3t092737@svn.freebsd.org> From: Matthew D Fleming Date: Wed, 19 Jan 2011 23:00: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: r217616 - in head: lib/libjail sbin/sysctl share/man/man9 sys/cddl/compat/opensolaris/kern sys/dev/cxgb sys/dev/msk sys/kern sys/mips/mips sys/mips/rmi sys/sys sys/x86/x86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 23:00:25 -0000 Author: mdf Date: Wed Jan 19 23:00:25 2011 New Revision: 217616 URL: http://svn.freebsd.org/changeset/base/217616 Log: Introduce signed and unsigned version of CTLTYPE_QUAD, renaming existing uses. Rename sysctl_handle_quad() to sysctl_handle_64(). Modified: head/lib/libjail/jail.c head/sbin/sysctl/sysctl.c head/share/man/man9/sysctl.9 head/sys/cddl/compat/opensolaris/kern/opensolaris_kstat.c head/sys/dev/cxgb/cxgb_sge.c head/sys/dev/msk/if_msk.c head/sys/kern/kern_sysctl.c head/sys/kern/kern_tc.c head/sys/mips/mips/tick.c head/sys/mips/rmi/tick.c head/sys/sys/sysctl.h head/sys/x86/x86/tsc.c Modified: head/lib/libjail/jail.c ============================================================================== --- head/lib/libjail/jail.c Wed Jan 19 22:29:19 2011 (r217615) +++ head/lib/libjail/jail.c Wed Jan 19 23:00:25 2011 (r217616) @@ -381,10 +381,14 @@ jailparam_import(struct jailparam *jp, c ((unsigned long *)jp->jp_value)[i] = strtoul(avalue, &ep, 10); goto integer_test; - case CTLTYPE_QUAD: + case CTLTYPE_S64: ((int64_t *)jp->jp_value)[i] = strtoimax(avalue, &ep, 10); goto integer_test; + case CTLTYPE_U64: + ((uint64_t *)jp->jp_value)[i] = + strtoumax(avalue, &ep, 10); + goto integer_test; case CTLTYPE_STRUCT: tvalue = alloca(fw + 1); strlcpy(tvalue, avalue, fw + 1); @@ -768,10 +772,14 @@ jailparam_export(struct jailparam *jp) snprintf(valbuf, sizeof(valbuf), "%lu", ((unsigned long *)jp->jp_value)[i]); break; - case CTLTYPE_QUAD: + case CTLTYPE_S64: snprintf(valbuf, sizeof(valbuf), "%jd", (intmax_t)((int64_t *)jp->jp_value)[i]); break; + case CTLTYPE_U64: + snprintf(valbuf, sizeof(valbuf), "%ju", + (uintmax_t)((uint64_t *)jp->jp_value)[i]); + break; case CTLTYPE_STRUCT: switch (jp->jp_structtype) { case JPS_IN_ADDR: @@ -941,7 +949,8 @@ jailparam_type(struct jailparam *jp) case CTLTYPE_ULONG: jp->jp_valuelen = sizeof(long); break; - case CTLTYPE_QUAD: + case CTLTYPE_S64: + case CTLTYPE_U64: jp->jp_valuelen = sizeof(int64_t); break; case CTLTYPE_STRING: Modified: head/sbin/sysctl/sysctl.c ============================================================================== --- head/sbin/sysctl/sysctl.c Wed Jan 19 22:29:19 2011 (r217615) +++ head/sbin/sysctl/sysctl.c Wed Jan 19 23:00:25 2011 (r217616) @@ -170,7 +170,8 @@ parse(char *string) long longval; unsigned long ulongval; size_t newsize = 0; - quad_t quadval; + int64_t i64val; + uint64_t u64val; int mib[CTL_MAXNAME]; char *cp, *bufp, buf[BUFSIZ], *endptr, fmt[BUFSIZ]; u_int kind; @@ -230,7 +231,8 @@ parse(char *string) (kind & CTLTYPE) == CTLTYPE_UINT || (kind & CTLTYPE) == CTLTYPE_LONG || (kind & CTLTYPE) == CTLTYPE_ULONG || - (kind & CTLTYPE) == CTLTYPE_QUAD) { + (kind & CTLTYPE) == CTLTYPE_S64 || + (kind & CTLTYPE) == CTLTYPE_U64) { if (strlen(newval) == 0) errx(1, "empty numeric value"); } @@ -277,13 +279,21 @@ parse(char *string) break; case CTLTYPE_STRING: break; - case CTLTYPE_QUAD: - quadval = strtoq(newval, &endptr, 0); + case CTLTYPE_S64: + i64val = strtoimax(newval, &endptr, 0); if (endptr == newval || *endptr != '\0') - errx(1, "invalid quad integer" - " '%s'", (char *)newval); - newval = &quadval; - newsize = sizeof(quadval); + errx(1, "invalid int64_t '%s'", + (char *)newval); + newval = &i64val; + newsize = sizeof(i64val); + break; + case CTLTYPE_U64: + u64val = strtoumax(newval, &endptr, 0); + if (endptr == newval || *endptr != '\0') + errx(1, "invalid uint64_t '%s'", + (char *)newval); + newval = &u64val; + newsize = sizeof(u64val); break; case CTLTYPE_OPAQUE: /* FALLTHROUGH */ @@ -493,6 +503,21 @@ oidfmt(int *oid, int len, char *fmt, u_i return (0); } +static int ctl_sign[CTLTYPE+1] = { + [CTLTYPE_INT] = 1, + [CTLTYPE_LONG] = 1, + [CTLTYPE_S64] = 1, +}; + +static int ctl_size[CTLTYPE+1] = { + [CTLTYPE_INT] = sizeof(int), + [CTLTYPE_UINT] = sizeof(u_int), + [CTLTYPE_LONG] = sizeof(long), + [CTLTYPE_ULONG] = sizeof(u_long), + [CTLTYPE_S64] = sizeof(int64_t), + [CTLTYPE_U64] = sizeof(int64_t), +}; + /* * This formats and outputs the value of one variable * @@ -500,7 +525,6 @@ oidfmt(int *oid, int len, char *fmt, u_i * Returns one if didn't know what to do with this. * Return minus one if we had errors. */ - static int show_var(int *oid, int nlen) { @@ -576,7 +600,9 @@ show_var(int *oid, int nlen) oidfmt(oid, nlen, fmt, &kind); p = val; ctltype = (kind & CTLTYPE); - sign = (ctltype == CTLTYPE_INT || ctltype == CTLTYPE_LONG) ? 1 : 0; + sign = ctl_sign[ctltype]; + intlen = ctl_size[ctltype]; + switch (ctltype) { case CTLTYPE_STRING: if (!nflag) @@ -589,19 +615,10 @@ show_var(int *oid, int nlen) case CTLTYPE_UINT: case CTLTYPE_LONG: case CTLTYPE_ULONG: - case CTLTYPE_QUAD: + case CTLTYPE_S64: + case CTLTYPE_U64: if (!nflag) printf("%s%s", name, sep); - switch (kind & CTLTYPE) { - case CTLTYPE_INT: - case CTLTYPE_UINT: - intlen = sizeof(int); break; - case CTLTYPE_LONG: - case CTLTYPE_ULONG: - intlen = sizeof(long); break; - case CTLTYPE_QUAD: - intlen = sizeof(quad_t); break; - } hexlen = 2 + (intlen * CHAR_BIT + 3) / 4; sep1 = ""; while (len >= intlen) { @@ -616,9 +633,10 @@ show_var(int *oid, int nlen) umv = *(u_long *)p; mv = *(long *)p; break; - case CTLTYPE_QUAD: - umv = *(u_quad_t *)p; - mv = *(quad_t *)p; + case CTLTYPE_S64: + case CTLTYPE_U64: + umv = *(uint64_t *)p; + mv = *(int64_t *)p; break; } fputs(sep1, stdout); Modified: head/share/man/man9/sysctl.9 ============================================================================== --- head/share/man/man9/sysctl.9 Wed Jan 19 22:29:19 2011 (r217615) +++ head/share/man/man9/sysctl.9 Wed Jan 19 23:00:25 2011 (r217616) @@ -101,7 +101,7 @@ This is a node intended to be a parent f This is a signed integer. .It Dv CTLTYPE_STRING This is a nul-terminated string stored in a character array. -.It Dv CTLTYPE_QUAD +.It Dv CTLTYPE_S64 This is a 64-bit signed integer. .It Dv CTLTYPE_OPAQUE This is an opaque data structure. @@ -114,6 +114,8 @@ This is an unsigned integer. This is a signed long. .It Dv CTLTYPE_ULONG This is an unsigned long. +.It Dv CTLTYPE_U64 +This is a 64-bit unsigned integer. .El .Pp All sysctl types except for new node declarations require one or more flags Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_kstat.c ============================================================================== --- head/sys/cddl/compat/opensolaris/kern/opensolaris_kstat.c Wed Jan 19 22:29:19 2011 (r217615) +++ head/sys/cddl/compat/opensolaris/kern/opensolaris_kstat.c Wed Jan 19 23:00:25 2011 (r217616) @@ -102,7 +102,7 @@ kstat_sysctl(SYSCTL_HANDLER_ARGS) uint64_t val; val = ksent->value.ui64; - return sysctl_handle_quad(oidp, &val, 0, req); + return sysctl_handle_64(oidp, &val, 0, req); } void @@ -117,7 +117,7 @@ kstat_install(kstat_t *ksp) ("data_type=%d", ksent->data_type)); SYSCTL_ADD_PROC(&ksp->ks_sysctl_ctx, SYSCTL_CHILDREN(ksp->ks_sysctl_root), OID_AUTO, ksent->name, - CTLTYPE_QUAD | CTLFLAG_RD, ksent, sizeof(*ksent), + CTLTYPE_U64 | CTLFLAG_RD, ksent, sizeof(*ksent), kstat_sysctl, "QU", ""); } } Modified: head/sys/dev/cxgb/cxgb_sge.c ============================================================================== --- head/sys/dev/cxgb/cxgb_sge.c Wed Jan 19 22:29:19 2011 (r217615) +++ head/sys/dev/cxgb/cxgb_sge.c Wed Jan 19 23:00:25 2011 (r217616) @@ -3541,7 +3541,7 @@ sysctl_handle_macstat(SYSCTL_HANDLER_ARG t3_mac_update_stats(&p->mac); PORT_UNLOCK(p); - return (sysctl_handle_quad(oidp, parg, 0, req)); + return (sysctl_handle_64(oidp, parg, 0, req)); } void @@ -3741,7 +3741,7 @@ t3_add_configured_sysctls(adapter_t *sc) * all that here. */ #define CXGB_SYSCTL_ADD_QUAD(a) SYSCTL_ADD_OID(ctx, poidlist, OID_AUTO, #a, \ - (CTLTYPE_QUAD | CTLFLAG_RD), pi, offsetof(struct mac_stats, a), \ + (CTLTYPE_U64 | CTLFLAG_RD), pi, offsetof(struct mac_stats, a), \ sysctl_handle_macstat, "QU", 0) CXGB_SYSCTL_ADD_QUAD(tx_octets); CXGB_SYSCTL_ADD_QUAD(tx_octets_bad); Modified: head/sys/dev/msk/if_msk.c ============================================================================== --- head/sys/dev/msk/if_msk.c Wed Jan 19 22:29:19 2011 (r217615) +++ head/sys/dev/msk/if_msk.c Wed Jan 19 23:00:25 2011 (r217616) @@ -4378,7 +4378,7 @@ msk_sysctl_stat64(SYSCTL_HANDLER_ARGS) result += *stat; MSK_IF_UNLOCK(sc_if); - return (sysctl_handle_quad(oidp, &result, 0, req)); + return (sysctl_handle_64(oidp, &result, 0, req)); } #undef MSK_READ_MIB32 @@ -4389,9 +4389,9 @@ msk_sysctl_stat64(SYSCTL_HANDLER_ARGS) sc, offsetof(struct msk_hw_stats, n), msk_sysctl_stat32, \ "IU", d) #define MSK_SYSCTL_STAT64(sc, c, o, p, n, d) \ - SYSCTL_ADD_PROC(c, p, OID_AUTO, o, CTLTYPE_QUAD | CTLFLAG_RD, \ + SYSCTL_ADD_PROC(c, p, OID_AUTO, o, CTLTYPE_U64 | CTLFLAG_RD, \ sc, offsetof(struct msk_hw_stats, n), msk_sysctl_stat64, \ - "Q", d) + "QU", d) static void msk_sysctl_node(struct msk_if_softc *sc_if) Modified: head/sys/kern/kern_sysctl.c ============================================================================== --- head/sys/kern/kern_sysctl.c Wed Jan 19 22:29:19 2011 (r217615) +++ head/sys/kern/kern_sysctl.c Wed Jan 19 23:00:25 2011 (r217616) @@ -615,8 +615,12 @@ sysctl_sysctl_debug_dump_node(struct sys } break; case CTLTYPE_INT: printf(" Int\n"); break; + case CTLTYPE_UINT: printf(" u_int\n"); break; + case CTLTYPE_LONG: printf(" Long\n"); break; + case CTLTYPE_ULONG: printf(" u_long\n"); break; case CTLTYPE_STRING: printf(" String\n"); break; - case CTLTYPE_QUAD: printf(" Quad\n"); break; + case CTLTYPE_U64: printf(" uint64_t\n"); break; + case CTLTYPE_S64: printf(" int64_t\n"); break; case CTLTYPE_OPAQUE: printf(" Opaque/struct\n"); break; default: printf("\n"); } @@ -1035,9 +1039,8 @@ sysctl_handle_long(SYSCTL_HANDLER_ARGS) /* * Handle a 64 bit int, signed or unsigned. arg1 points to it. */ - int -sysctl_handle_quad(SYSCTL_HANDLER_ARGS) +sysctl_handle_64(SYSCTL_HANDLER_ARGS) { int error = 0; uint64_t tmpout; Modified: head/sys/kern/kern_tc.c ============================================================================== --- head/sys/kern/kern_tc.c Wed Jan 19 22:29:19 2011 (r217615) +++ head/sys/kern/kern_tc.c Wed Jan 19 23:00:25 2011 (r217616) @@ -140,7 +140,7 @@ sysctl_kern_timecounter_freq(SYSCTL_HAND struct timecounter *tc = arg1; freq = tc->tc_frequency; - return sysctl_handle_quad(oidp, &freq, 0, req); + return sysctl_handle_64(oidp, &freq, 0, req); } /* @@ -341,7 +341,7 @@ tc_init(struct timecounter *tc) "counter", CTLTYPE_UINT | CTLFLAG_RD, tc, sizeof(*tc), sysctl_kern_timecounter_get, "IU", "current timecounter value"); SYSCTL_ADD_PROC(NULL, SYSCTL_CHILDREN(tc_root), OID_AUTO, - "frequency", CTLTYPE_QUAD | CTLFLAG_RD, tc, sizeof(*tc), + "frequency", CTLTYPE_U64 | CTLFLAG_RD, tc, sizeof(*tc), sysctl_kern_timecounter_freq, "QU", "timecounter frequency"); SYSCTL_ADD_INT(NULL, SYSCTL_CHILDREN(tc_root), OID_AUTO, "quality", CTLFLAG_RD, &(tc->tc_quality), 0, Modified: head/sys/mips/mips/tick.c ============================================================================== --- head/sys/mips/mips/tick.c Wed Jan 19 22:29:19 2011 (r217615) +++ head/sys/mips/mips/tick.c Wed Jan 19 23:00:25 2011 (r217616) @@ -165,7 +165,7 @@ sysctl_machdep_counter_freq(SYSCTL_HANDL if (softc == NULL) return (EOPNOTSUPP); freq = counter_freq; - error = sysctl_handle_int(oidp, &freq, sizeof(freq), req); + error = sysctl_handle_64(oidp, &freq, sizeof(freq), req); if (error == 0 && req->newptr != NULL) { counter_freq = freq; softc->et.et_frequency = counter_freq; @@ -174,8 +174,8 @@ sysctl_machdep_counter_freq(SYSCTL_HANDL return (error); } -SYSCTL_PROC(_machdep, OID_AUTO, counter_freq, CTLTYPE_QUAD | CTLFLAG_RW, - 0, sizeof(u_int), sysctl_machdep_counter_freq, "IU", +SYSCTL_PROC(_machdep, OID_AUTO, counter_freq, CTLTYPE_U64 | CTLFLAG_RW, + NULL, 0, sysctl_machdep_counter_freq, "QU", "Timecounter frequency in Hz"); static unsigned Modified: head/sys/mips/rmi/tick.c ============================================================================== --- head/sys/mips/rmi/tick.c Wed Jan 19 22:29:19 2011 (r217615) +++ head/sys/mips/rmi/tick.c Wed Jan 19 23:00:25 2011 (r217616) @@ -167,7 +167,7 @@ sysctl_machdep_counter_freq(SYSCTL_HANDL if (softc == NULL) return (EOPNOTSUPP); freq = counter_freq; - error = sysctl_handle_int(oidp, &freq, sizeof(freq), req); + error = sysctl_handle_64(oidp, &freq, sizeof(freq), req); if (error == 0 && req->newptr != NULL) { counter_freq = freq; softc->et.et_frequency = counter_freq; @@ -176,8 +176,8 @@ sysctl_machdep_counter_freq(SYSCTL_HANDL return (error); } -SYSCTL_PROC(_machdep, OID_AUTO, counter_freq, CTLTYPE_QUAD | CTLFLAG_RW, - 0, sizeof(u_int), sysctl_machdep_counter_freq, "IU", +SYSCTL_PROC(_machdep, OID_AUTO, counter_freq, CTLTYPE_U64 | CTLFLAG_RW, + NULL, 0, sysctl_machdep_counter_freq, "QU", "Timecounter frequency in Hz"); static unsigned Modified: head/sys/sys/sysctl.h ============================================================================== --- head/sys/sys/sysctl.h Wed Jan 19 22:29:19 2011 (r217615) +++ head/sys/sys/sysctl.h Wed Jan 19 23:00:25 2011 (r217616) @@ -66,12 +66,13 @@ struct ctlname { #define CTLTYPE_NODE 1 /* name is a node */ #define CTLTYPE_INT 2 /* name describes an integer */ #define CTLTYPE_STRING 3 /* name describes a string */ -#define CTLTYPE_QUAD 4 /* name describes a 64-bit number */ +#define CTLTYPE_S64 4 /* name describes a signed 64-bit number */ #define CTLTYPE_OPAQUE 5 /* name describes a structure */ #define CTLTYPE_STRUCT CTLTYPE_OPAQUE /* name describes a structure */ #define CTLTYPE_UINT 6 /* name describes an unsigned integer */ #define CTLTYPE_LONG 7 /* name describes a long */ #define CTLTYPE_ULONG 8 /* name describes an unsigned long */ +#define CTLTYPE_U64 9 /* name describes an unsigned 64-bit number */ #define CTLFLAG_RD 0x80000000 /* Allow reads of variable */ #define CTLFLAG_WR 0x40000000 /* Allow writes to the variable */ @@ -176,8 +177,7 @@ struct sysctl_oid { int sysctl_handle_int(SYSCTL_HANDLER_ARGS); int sysctl_msec_to_ticks(SYSCTL_HANDLER_ARGS); int sysctl_handle_long(SYSCTL_HANDLER_ARGS); -int sysctl_handle_quad(SYSCTL_HANDLER_ARGS); -int sysctl_handle_intptr(SYSCTL_HANDLER_ARGS); +int sysctl_handle_64(SYSCTL_HANDLER_ARGS); int sysctl_handle_string(SYSCTL_HANDLER_ARGS); int sysctl_handle_opaque(SYSCTL_HANDLER_ARGS); @@ -354,26 +354,26 @@ SYSCTL_ALLOWED_TYPES(UINT64, uint64_t *a #define SYSCTL_QUAD(parent, nbr, name, access, ptr, val, descr) \ SYSCTL_ASSERT_TYPE(INT64, ptr, parent, name); \ SYSCTL_OID(parent, nbr, name, \ - CTLTYPE_QUAD | CTLFLAG_MPSAFE | (access), \ - ptr, val, sysctl_handle_quad, "Q", descr) + CTLTYPE_S64 | CTLFLAG_MPSAFE | (access), \ + ptr, val, sysctl_handle_64, "Q", descr) #define SYSCTL_ADD_QUAD(ctx, parent, nbr, name, access, ptr, descr) \ sysctl_add_oid(ctx, parent, nbr, name, \ - CTLTYPE_QUAD | CTLFLAG_MPSAFE | (access), \ + CTLTYPE_S64 | CTLFLAG_MPSAFE | (access), \ SYSCTL_ADD_ASSERT_TYPE(INT64, ptr), 0, \ - sysctl_handle_quad, "Q", __DESCR(descr)) + sysctl_handle_64, "Q", __DESCR(descr)) #define SYSCTL_UQUAD(parent, nbr, name, access, ptr, val, descr) \ SYSCTL_ASSERT_TYPE(UINT64, ptr, parent, name); \ SYSCTL_OID(parent, nbr, name, \ - CTLTYPE_QUAD | CTLFLAG_MPSAFE | (access), \ - ptr, val, sysctl_handle_quad, "QU", descr) + CTLTYPE_U64 | CTLFLAG_MPSAFE | (access), \ + ptr, val, sysctl_handle_64, "QU", descr) #define SYSCTL_ADD_UQUAD(ctx, parent, nbr, name, access, ptr, descr) \ sysctl_add_oid(ctx, parent, nbr, name, \ - CTLTYPE_QUAD | CTLFLAG_MPSAFE | (access), \ + CTLTYPE_U64 | CTLFLAG_MPSAFE | (access), \ SYSCTL_ADD_ASSERT_TYPE(UINT64, ptr), 0, \ - sysctl_handle_quad, "QU", __DESCR(descr)) + sysctl_handle_64, "QU", __DESCR(descr)) /* Oid for an opaque object. Specified by a pointer and a length. */ #define SYSCTL_OPAQUE(parent, nbr, name, access, ptr, len, fmt, descr) \ Modified: head/sys/x86/x86/tsc.c ============================================================================== --- head/sys/x86/x86/tsc.c Wed Jan 19 22:29:19 2011 (r217615) +++ head/sys/x86/x86/tsc.c Wed Jan 19 23:00:25 2011 (r217616) @@ -263,7 +263,7 @@ sysctl_machdep_tsc_freq(SYSCTL_HANDLER_A if (tsc_timecounter.tc_frequency == 0) return (EOPNOTSUPP); freq = tsc_freq; - error = sysctl_handle_quad(oidp, &freq, 0, req); + error = sysctl_handle_64(oidp, &freq, 0, req); if (error == 0 && req->newptr != NULL) { tsc_freq = freq; tsc_timecounter.tc_frequency = tsc_freq; @@ -271,7 +271,7 @@ sysctl_machdep_tsc_freq(SYSCTL_HANDLER_A return (error); } -SYSCTL_PROC(_machdep, OID_AUTO, tsc_freq, CTLTYPE_QUAD | CTLFLAG_RW, +SYSCTL_PROC(_machdep, OID_AUTO, tsc_freq, CTLTYPE_U64 | CTLFLAG_RW, 0, 0, sysctl_machdep_tsc_freq, "QU", ""); static unsigned From owner-svn-src-all@FreeBSD.ORG Thu Jan 20 00:54:12 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CE2DA1065670; Thu, 20 Jan 2011 00:54:12 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BD86C8FC1E; Thu, 20 Jan 2011 00:54:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0K0sCrf095366; Thu, 20 Jan 2011 00:54:12 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0K0sCHj095362; Thu, 20 Jan 2011 00:54:12 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201101200054.p0K0sCHj095362@svn.freebsd.org> From: Rick Macklem Date: Thu, 20 Jan 2011 00:54:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217617 - releng/8.2/sys/rpc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jan 2011 00:54:13 -0000 Author: rmacklem Date: Thu Jan 20 00:54:12 2011 New Revision: 217617 URL: http://svn.freebsd.org/changeset/base/217617 Log: MFC: r217242 Fix a bug in the client side krpc where it was, sometimes erroneously, assumed that 4 bytes of data were in the first mbuf of a list by replacing the bcopy() with m_copydata(). Also, replace the uses of m_pullup(), which can fail for reasons other than not enough data, with m_copydata(). For the cases where it isn't known that there is enough data in the mbuf list, check first via m_len and m_length(). This is believed to fix a problem reported by dpd at dpdtech.com and george+freebsd at m5p.com. Reviewed by: jhb (for head) Approved by: re (kib) Modified: releng/8.2/sys/rpc/clnt_dg.c releng/8.2/sys/rpc/clnt_vc.c releng/8.2/sys/rpc/svc_vc.c Directory Properties: releng/8.2/sys/ (props changed) releng/8.2/sys/amd64/include/xen/ (props changed) releng/8.2/sys/cddl/contrib/opensolaris/ (props changed) releng/8.2/sys/contrib/dev/acpica/ (props changed) releng/8.2/sys/contrib/pf/ (props changed) Modified: releng/8.2/sys/rpc/clnt_dg.c ============================================================================== --- releng/8.2/sys/rpc/clnt_dg.c Wed Jan 19 23:00:25 2011 (r217616) +++ releng/8.2/sys/rpc/clnt_dg.c Thu Jan 20 00:54:12 2011 (r217617) @@ -1089,15 +1089,14 @@ clnt_dg_soupcall(struct socket *so, void /* * The XID is in the first uint32_t of the reply. */ - if (m->m_len < sizeof(xid)) - m = m_pullup(m, sizeof(xid)); - if (!m) + if (m->m_len < sizeof(xid) && m_length(m, NULL) < sizeof(xid)) /* * Should never happen. */ continue; - xid = ntohl(*mtod(m, uint32_t *)); + m_copydata(m, 0, sizeof(xid), (char *)&xid); + xid = ntohl(xid); /* * Attempt to match this reply with a pending request. Modified: releng/8.2/sys/rpc/clnt_vc.c ============================================================================== --- releng/8.2/sys/rpc/clnt_vc.c Wed Jan 19 23:00:25 2011 (r217616) +++ releng/8.2/sys/rpc/clnt_vc.c Thu Jan 20 00:54:12 2011 (r217617) @@ -916,7 +916,7 @@ clnt_vc_soupcall(struct socket *so, void mtx_unlock(&ct->ct_lock); break; } - bcopy(mtod(m, uint32_t *), &header, sizeof(uint32_t)); + m_copydata(m, 0, sizeof(uint32_t), (char *)&header); header = ntohl(header); ct->ct_record = NULL; ct->ct_record_resid = header & 0x7fffffff; @@ -975,14 +975,11 @@ clnt_vc_soupcall(struct socket *so, void * The XID is in the first uint32_t of * the reply. */ - if (ct->ct_record->m_len < sizeof(xid)) - ct->ct_record = - m_pullup(ct->ct_record, - sizeof(xid)); - if (!ct->ct_record) + if (ct->ct_record->m_len < sizeof(xid) && + m_length(ct->ct_record, NULL) < sizeof(xid)) break; - bcopy(mtod(ct->ct_record, uint32_t *), - &xid, sizeof(uint32_t)); + m_copydata(ct->ct_record, 0, sizeof(xid), + (char *)&xid); xid = ntohl(xid); mtx_lock(&ct->ct_lock); Modified: releng/8.2/sys/rpc/svc_vc.c ============================================================================== --- releng/8.2/sys/rpc/svc_vc.c Wed Jan 19 23:00:25 2011 (r217616) +++ releng/8.2/sys/rpc/svc_vc.c Thu Jan 20 00:54:12 2011 (r217617) @@ -559,11 +559,8 @@ svc_vc_recv(SVCXPRT *xprt, struct rpc_ms } if (n < sizeof(uint32_t)) goto readmore; - if (cd->mpending->m_len < sizeof(uint32_t)) - cd->mpending = m_pullup(cd->mpending, - sizeof(uint32_t)); - memcpy(&header, mtod(cd->mpending, uint32_t *), - sizeof(header)); + m_copydata(cd->mpending, 0, sizeof(header), + (char *)&header); header = ntohl(header); cd->eor = (header & 0x80000000) != 0; cd->resid = header & 0x7fffffff; From owner-svn-src-all@FreeBSD.ORG Thu Jan 20 04:57:27 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F206106566B; Thu, 20 Jan 2011 04:57:27 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5D3278FC2E; Thu, 20 Jan 2011 04:57:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0K4vRIT001186; Thu, 20 Jan 2011 04:57:27 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0K4vRRq001182; Thu, 20 Jan 2011 04:57:27 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201101200457.p0K4vRRq001182@svn.freebsd.org> From: Adrian Chadd Date: Thu, 20 Jan 2011 04:57: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: r217618 - in head/sys/dev/ath: . ath_hal X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jan 2011 04:57:27 -0000 Author: adrian Date: Thu Jan 20 04:57:26 2011 New Revision: 217618 URL: http://svn.freebsd.org/changeset/base/217618 Log: Break out the diagnostic codes from ah_internal.h and place them in ah_diagcodes.h. Since we now have the source code, there's no reason to hide the diag codes from other areas. They live in the HAL as they form part of the HAL API and should still be treate as "potentially flexible; don't publish as a public API." But since they're already used as a public API (see follow-up commit), we may as well use them in place of magic constants. Added: head/sys/dev/ath/ath_hal/ah_diagcodes.h (contents, props changed) Modified: head/sys/dev/ath/ath_hal/ah_internal.h head/sys/dev/ath/if_ath.c Added: head/sys/dev/ath/ath_hal/ah_diagcodes.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/ath/ath_hal/ah_diagcodes.h Thu Jan 20 04:57:26 2011 (r217618) @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2002-2009 Sam Leffler, Errno Consulting + * Copyright (c) 2002-2008 Atheros Communications, Inc. + * + * Permission to use, copy, modify, and/or 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$ + */ +#ifndef _ATH_AH_DIAGCODES_H_ +#define _ATH_AH_DIAGCODES_H_ +/* + * Atheros Device Hardware Access Layer (HAL). + * + * Internal diagnostic API definitions. + */ + +/* + * Diagnostic interface. This is an open-ended interface that + * is opaque to applications. Diagnostic programs use this to + * retrieve internal data structures, etc. There is no guarantee + * that calling conventions for calls other than HAL_DIAG_REVS + * are stable between HAL releases; a diagnostic application must + * use the HAL revision information to deal with ABI/API differences. + * + * NB: do not renumber these, certain codes are publicly used. + */ +enum { + HAL_DIAG_REVS = 0, /* MAC/PHY/Radio revs */ + HAL_DIAG_EEPROM = 1, /* EEPROM contents */ + HAL_DIAG_EEPROM_EXP_11A = 2, /* EEPROM 5112 power exp for 11a */ + HAL_DIAG_EEPROM_EXP_11B = 3, /* EEPROM 5112 power exp for 11b */ + HAL_DIAG_EEPROM_EXP_11G = 4, /* EEPROM 5112 power exp for 11g */ + HAL_DIAG_ANI_CURRENT = 5, /* ANI current channel state */ + HAL_DIAG_ANI_OFDM = 6, /* ANI OFDM timing error stats */ + HAL_DIAG_ANI_CCK = 7, /* ANI CCK timing error stats */ + HAL_DIAG_ANI_STATS = 8, /* ANI statistics */ + HAL_DIAG_RFGAIN = 9, /* RfGain GAIN_VALUES */ + HAL_DIAG_RFGAIN_CURSTEP = 10, /* RfGain GAIN_OPTIMIZATION_STEP */ + HAL_DIAG_PCDAC = 11, /* PCDAC table */ + HAL_DIAG_TXRATES = 12, /* Transmit rate table */ + HAL_DIAG_REGS = 13, /* Registers */ + HAL_DIAG_ANI_CMD = 14, /* ANI issue command (XXX do not change!) */ + HAL_DIAG_SETKEY = 15, /* Set keycache backdoor */ + HAL_DIAG_RESETKEY = 16, /* Reset keycache backdoor */ + HAL_DIAG_EEREAD = 17, /* Read EEPROM word */ + HAL_DIAG_EEWRITE = 18, /* Write EEPROM word */ + /* 19-26 removed, do not reuse */ + HAL_DIAG_RDWRITE = 27, /* Write regulatory domain */ + HAL_DIAG_RDREAD = 28, /* Get regulatory domain */ + HAL_DIAG_FATALERR = 29, /* Read cached interrupt state */ + HAL_DIAG_11NCOMPAT = 30, /* 11n compatibility tweaks */ + HAL_DIAG_ANI_PARAMS = 31, /* ANI noise immunity parameters */ + HAL_DIAG_CHECK_HANGS = 32, /* check h/w hangs */ + HAL_DIAG_SETREGS = 33, /* write registers */ +}; + +#endif /* _ATH_AH_DIAGCODES_H_ */ Modified: head/sys/dev/ath/ath_hal/ah_internal.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_internal.h Thu Jan 20 00:54:12 2011 (r217617) +++ head/sys/dev/ath/ath_hal/ah_internal.h Thu Jan 20 04:57:26 2011 (r217618) @@ -589,45 +589,8 @@ extern HAL_BOOL ath_hal_setcapability(st HAL_CAPABILITY_TYPE type, uint32_t capability, uint32_t setting, HAL_STATUS *status); -/* - * Diagnostic interface. This is an open-ended interface that - * is opaque to applications. Diagnostic programs use this to - * retrieve internal data structures, etc. There is no guarantee - * that calling conventions for calls other than HAL_DIAG_REVS - * are stable between HAL releases; a diagnostic application must - * use the HAL revision information to deal with ABI/API differences. - * - * NB: do not renumber these, certain codes are publicly used. - */ -enum { - HAL_DIAG_REVS = 0, /* MAC/PHY/Radio revs */ - HAL_DIAG_EEPROM = 1, /* EEPROM contents */ - HAL_DIAG_EEPROM_EXP_11A = 2, /* EEPROM 5112 power exp for 11a */ - HAL_DIAG_EEPROM_EXP_11B = 3, /* EEPROM 5112 power exp for 11b */ - HAL_DIAG_EEPROM_EXP_11G = 4, /* EEPROM 5112 power exp for 11g */ - HAL_DIAG_ANI_CURRENT = 5, /* ANI current channel state */ - HAL_DIAG_ANI_OFDM = 6, /* ANI OFDM timing error stats */ - HAL_DIAG_ANI_CCK = 7, /* ANI CCK timing error stats */ - HAL_DIAG_ANI_STATS = 8, /* ANI statistics */ - HAL_DIAG_RFGAIN = 9, /* RfGain GAIN_VALUES */ - HAL_DIAG_RFGAIN_CURSTEP = 10, /* RfGain GAIN_OPTIMIZATION_STEP */ - HAL_DIAG_PCDAC = 11, /* PCDAC table */ - HAL_DIAG_TXRATES = 12, /* Transmit rate table */ - HAL_DIAG_REGS = 13, /* Registers */ - HAL_DIAG_ANI_CMD = 14, /* ANI issue command (XXX do not change!) */ - HAL_DIAG_SETKEY = 15, /* Set keycache backdoor */ - HAL_DIAG_RESETKEY = 16, /* Reset keycache backdoor */ - HAL_DIAG_EEREAD = 17, /* Read EEPROM word */ - HAL_DIAG_EEWRITE = 18, /* Write EEPROM word */ - /* 19-26 removed, do not reuse */ - HAL_DIAG_RDWRITE = 27, /* Write regulatory domain */ - HAL_DIAG_RDREAD = 28, /* Get regulatory domain */ - HAL_DIAG_FATALERR = 29, /* Read cached interrupt state */ - HAL_DIAG_11NCOMPAT = 30, /* 11n compatibility tweaks */ - HAL_DIAG_ANI_PARAMS = 31, /* ANI noise immunity parameters */ - HAL_DIAG_CHECK_HANGS = 32, /* check h/w hangs */ - HAL_DIAG_SETREGS = 33, /* write registers */ -}; +/* The diagnostic codes used to be internally defined here -adrian */ +#include "ah_diagcodes.h" enum { HAL_BB_HANG_DFS = 0x0001, Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Thu Jan 20 00:54:12 2011 (r217617) +++ head/sys/dev/ath/if_ath.c Thu Jan 20 04:57:26 2011 (r217618) @@ -87,6 +87,7 @@ __FBSDID("$FreeBSD$"); #include #include /* XXX for softled */ +#include #ifdef ATH_TX99_DIAG #include From owner-svn-src-all@FreeBSD.ORG Thu Jan 20 04:59:11 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 711C4106566C; Thu, 20 Jan 2011 04:59:11 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6029A8FC1C; Thu, 20 Jan 2011 04:59:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0K4xBPp001257; Thu, 20 Jan 2011 04:59:11 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0K4xBuh001255; Thu, 20 Jan 2011 04:59:11 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201101200459.p0K4xBuh001255@svn.freebsd.org> From: Adrian Chadd Date: Thu, 20 Jan 2011 04:59:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217619 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jan 2011 04:59:11 -0000 Author: adrian Date: Thu Jan 20 04:59:11 2011 New Revision: 217619 URL: http://svn.freebsd.org/changeset/base/217619 Log: Use the now-exposed diag code, rather than a hard-coded magic number. Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Thu Jan 20 04:57:26 2011 (r217618) +++ head/sys/dev/ath/if_ath.c Thu Jan 20 04:59:11 2011 (r217619) @@ -1461,7 +1461,7 @@ ath_hal_gethangstate(struct ath_hal *ah, uint32_t rsize; void *sp; - if (!ath_hal_getdiagstate(ah, 32, &mask, sizeof(mask), &sp, &rsize)) + if (!ath_hal_getdiagstate(ah, HAL_DIAG_CHECK_HANGS, &mask, sizeof(mask), &sp, &rsize)) return 0; KASSERT(rsize == sizeof(uint32_t), ("resultsize %u", rsize)); *hangs = *(uint32_t *)sp; From owner-svn-src-all@FreeBSD.ORG Thu Jan 20 05:44:37 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2C81D106566C; Thu, 20 Jan 2011 05:44:37 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 19DB28FC16; Thu, 20 Jan 2011 05:44:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0K5iaJj002190; Thu, 20 Jan 2011 05:44:36 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0K5ia2G002188; Thu, 20 Jan 2011 05:44:36 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201101200544.p0K5ia2G002188@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Thu, 20 Jan 2011 05:44: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: r217620 - head/sys/mips/cavium/cryptocteon X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jan 2011 05:44:37 -0000 Author: gonzo Date: Thu Jan 20 05:44:36 2011 New Revision: 217620 URL: http://svn.freebsd.org/changeset/base/217620 Log: Fix build by changing format for size_t to %jd Modified: head/sys/mips/cavium/cryptocteon/cavium_crypto.c Modified: head/sys/mips/cavium/cryptocteon/cavium_crypto.c ============================================================================== --- head/sys/mips/cavium/cryptocteon/cavium_crypto.c Thu Jan 20 04:59:11 2011 (r217619) +++ head/sys/mips/cavium/cryptocteon/cavium_crypto.c Thu Jan 20 05:44:36 2011 (r217620) @@ -355,7 +355,7 @@ octo_des_cbc_encrypt( if (__predict_false(od == NULL || iov==NULL || iovlen==0 || ivp==NULL || (crypt_off & 0x7) || (crypt_off + crypt_len > iovlen))) { - dprintf("%s: Bad parameters od=%p iov=%p iovlen=%d " + dprintf("%s: Bad parameters od=%p iov=%p iovlen=%jd " "auth_off=%d auth_len=%d crypt_off=%d crypt_len=%d " "icv_off=%d ivp=%p\n", __func__, od, iov, iovlen, auth_off, auth_len, crypt_off, crypt_len, icv_off, ivp); @@ -418,7 +418,7 @@ octo_des_cbc_decrypt( if (__predict_false(od == NULL || iov==NULL || iovlen==0 || ivp==NULL || (crypt_off & 0x7) || (crypt_off + crypt_len > iovlen))) { - dprintf("%s: Bad parameters od=%p iov=%p iovlen=%d " + dprintf("%s: Bad parameters od=%p iov=%p iovlen=%jd " "auth_off=%d auth_len=%d crypt_off=%d crypt_len=%d " "icv_off=%d ivp=%p\n", __func__, od, iov, iovlen, auth_off, auth_len, crypt_off, crypt_len, icv_off, ivp); @@ -483,7 +483,7 @@ octo_aes_cbc_encrypt( if (__predict_false(od == NULL || iov==NULL || iovlen==0 || ivp==NULL || (crypt_off & 0x7) || (crypt_off + crypt_len > iovlen))) { - dprintf("%s: Bad parameters od=%p iov=%p iovlen=%d " + dprintf("%s: Bad parameters od=%p iov=%p iovlen=%jd " "auth_off=%d auth_len=%d crypt_off=%d crypt_len=%d " "icv_off=%d ivp=%p\n", __func__, od, iov, iovlen, auth_off, auth_len, crypt_off, crypt_len, icv_off, ivp); @@ -557,7 +557,7 @@ octo_aes_cbc_decrypt( if (__predict_false(od == NULL || iov==NULL || iovlen==0 || ivp==NULL || (crypt_off & 0x7) || (crypt_off + crypt_len > iovlen))) { - dprintf("%s: Bad parameters od=%p iov=%p iovlen=%d " + dprintf("%s: Bad parameters od=%p iov=%p iovlen=%jd " "auth_off=%d auth_len=%d crypt_off=%d crypt_len=%d " "icv_off=%d ivp=%p\n", __func__, od, iov, iovlen, auth_off, auth_len, crypt_off, crypt_len, icv_off, ivp); @@ -635,7 +635,7 @@ octo_null_md5_encrypt( if (__predict_false(od == NULL || iov==NULL || iovlen==0 || (auth_off & 0x7) || (auth_off + auth_len > iovlen))) { - dprintf("%s: Bad parameters od=%p iov=%p iovlen=%d " + dprintf("%s: Bad parameters od=%p iov=%p iovlen=%jd " "auth_off=%d auth_len=%d crypt_off=%d crypt_len=%d " "icv_off=%d ivp=%p\n", __func__, od, iov, iovlen, auth_off, auth_len, crypt_off, crypt_len, icv_off, ivp); @@ -741,7 +741,7 @@ octo_null_sha1_encrypt( if (__predict_false(od == NULL || iov==NULL || iovlen==0 || (auth_off & 0x7) || (auth_off + auth_len > iovlen))) { - dprintf("%s: Bad parameters od=%p iov=%p iovlen=%d " + dprintf("%s: Bad parameters od=%p iov=%p iovlen=%jd " "auth_off=%d auth_len=%d crypt_off=%d crypt_len=%d " "icv_off=%d ivp=%p\n", __func__, od, iov, iovlen, auth_off, auth_len, crypt_off, crypt_len, icv_off, ivp); @@ -858,7 +858,7 @@ octo_des_cbc_md5_encrypt( (crypt_len & 0x7) || (auth_len & 0x7) || (auth_off & 0x3) || (auth_off + auth_len > iovlen))) { - dprintf("%s: Bad parameters od=%p iov=%p iovlen=%d " + dprintf("%s: Bad parameters od=%p iov=%p iovlen=%jd " "auth_off=%d auth_len=%d crypt_off=%d crypt_len=%d " "icv_off=%d ivp=%p\n", __func__, od, iov, iovlen, auth_off, auth_len, crypt_off, crypt_len, icv_off, ivp); @@ -1011,7 +1011,7 @@ octo_des_cbc_md5_decrypt( (crypt_len & 0x7) || (auth_len & 0x7) || (auth_off & 0x3) || (auth_off + auth_len > iovlen))) { - dprintf("%s: Bad parameters od=%p iov=%p iovlen=%d " + dprintf("%s: Bad parameters od=%p iov=%p iovlen=%jd " "auth_off=%d auth_len=%d crypt_off=%d crypt_len=%d " "icv_off=%d ivp=%p\n", __func__, od, iov, iovlen, auth_off, auth_len, crypt_off, crypt_len, icv_off, ivp); @@ -1167,7 +1167,7 @@ octo_des_cbc_sha1_encrypt( (crypt_len & 0x7) || (auth_len & 0x7) || (auth_off & 0x3) || (auth_off + auth_len > iovlen))) { - dprintf("%s: Bad parameters od=%p iov=%p iovlen=%d " + dprintf("%s: Bad parameters od=%p iov=%p iovlen=%jd " "auth_off=%d auth_len=%d crypt_off=%d crypt_len=%d " "icv_off=%d ivp=%p\n", __func__, od, iov, iovlen, auth_off, auth_len, crypt_off, crypt_len, icv_off, ivp); @@ -1323,7 +1323,7 @@ octo_des_cbc_sha1_decrypt( (crypt_len & 0x7) || (auth_len & 0x7) || (auth_off & 0x3) || (auth_off + auth_len > iovlen))) { - dprintf("%s: Bad parameters od=%p iov=%p iovlen=%d " + dprintf("%s: Bad parameters od=%p iov=%p iovlen=%jd " "auth_off=%d auth_len=%d crypt_off=%d crypt_len=%d " "icv_off=%d ivp=%p\n", __func__, od, iov, iovlen, auth_off, auth_len, crypt_off, crypt_len, icv_off, ivp); @@ -1482,7 +1482,7 @@ octo_aes_cbc_md5_encrypt( (crypt_len & 0x7) || (auth_len & 0x7) || (auth_off & 0x3) || (auth_off + auth_len > iovlen))) { - dprintf("%s: Bad parameters od=%p iov=%p iovlen=%d " + dprintf("%s: Bad parameters od=%p iov=%p iovlen=%jd " "auth_off=%d auth_len=%d crypt_off=%d crypt_len=%d " "icv_off=%d ivp=%p\n", __func__, od, iov, iovlen, auth_off, auth_len, crypt_off, crypt_len, icv_off, ivp); @@ -1664,7 +1664,7 @@ octo_aes_cbc_md5_decrypt( (crypt_len & 0x7) || (auth_len & 0x7) || (auth_off & 0x3) || (auth_off + auth_len > iovlen))) { - dprintf("%s: Bad parameters od=%p iov=%p iovlen=%d " + dprintf("%s: Bad parameters od=%p iov=%p iovlen=%jd " "auth_off=%d auth_len=%d crypt_off=%d crypt_len=%d " "icv_off=%d ivp=%p\n", __func__, od, iov, iovlen, auth_off, auth_len, crypt_off, crypt_len, icv_off, ivp); @@ -1845,7 +1845,7 @@ octo_aes_cbc_sha1_encrypt( (crypt_len & 0x7) || (auth_len & 0x7) || (auth_off & 0x3) || (auth_off + auth_len > iovlen))) { - dprintf("%s: Bad parameters od=%p iov=%p iovlen=%d " + dprintf("%s: Bad parameters od=%p iov=%p iovlen=%jd " "auth_off=%d auth_len=%d crypt_off=%d crypt_len=%d " "icv_off=%d ivp=%p\n", __func__, od, iov, iovlen, auth_off, auth_len, crypt_off, crypt_len, icv_off, ivp); @@ -2046,7 +2046,7 @@ octo_aes_cbc_sha1_decrypt( (crypt_len & 0x7) || (auth_len & 0x7) || (auth_off & 0x3) || (auth_off + auth_len > iovlen))) { - dprintf("%s: Bad parameters od=%p iov=%p iovlen=%d " + dprintf("%s: Bad parameters od=%p iov=%p iovlen=%jd " "auth_off=%d auth_len=%d crypt_off=%d crypt_len=%d " "icv_off=%d ivp=%p\n", __func__, od, iov, iovlen, auth_off, auth_len, crypt_off, crypt_len, icv_off, ivp); From owner-svn-src-all@FreeBSD.ORG Thu Jan 20 05:49:16 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A0DA106564A; Thu, 20 Jan 2011 05:49:16 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 36BE08FC1A; Thu, 20 Jan 2011 05:49:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0K5nGOY002342; Thu, 20 Jan 2011 05:49:16 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0K5nFt8002328; Thu, 20 Jan 2011 05:49:15 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201101200549.p0K5nFt8002328@svn.freebsd.org> From: Adrian Chadd Date: Thu, 20 Jan 2011 05:49:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217621 - in head/sys/dev/ath/ath_hal: . ar5210 ar5211 ar5212 ar5416 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jan 2011 05:49:16 -0000 Author: adrian Date: Thu Jan 20 05:49:15 2011 New Revision: 217621 URL: http://svn.freebsd.org/changeset/base/217621 Log: Add a new HAL method to retrieve the completion schedule. It sets the completion schedule from the hardware and returns AH_TRUE if the hardware supports multi-rate retries (AR5212 and above); and returns AH_FALSE if the hardware doesn't support multi-rate retries. The sample rate module directly reads the TX completion descriptor and extracts the TX schedule information from that. It will be updated in a future commit to instead use this method to determine the completion schedule. Modified: head/sys/dev/ath/ath_hal/ah.h head/sys/dev/ath/ath_hal/ar5210/ar5210.h head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c head/sys/dev/ath/ath_hal/ar5210/ar5210_xmit.c head/sys/dev/ath/ath_hal/ar5211/ar5211.h head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c head/sys/dev/ath/ath_hal/ar5211/ar5211_xmit.c head/sys/dev/ath/ath_hal/ar5212/ar5212.h head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c head/sys/dev/ath/ath_hal/ar5212/ar5212_xmit.c head/sys/dev/ath/ath_hal/ar5416/ar5416.h head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c Modified: head/sys/dev/ath/ath_hal/ah.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah.h Thu Jan 20 05:44:36 2011 (r217620) +++ head/sys/dev/ath/ath_hal/ah.h Thu Jan 20 05:49:15 2011 (r217621) @@ -680,6 +680,8 @@ struct ath_hal { struct ath_desc *, struct ath_tx_status *); void __ahdecl(*ah_getTxIntrQueue)(struct ath_hal *, uint32_t *); void __ahdecl(*ah_reqTxIntrDesc)(struct ath_hal *, struct ath_desc*); + HAL_BOOL __ahdecl(*ah_getTxCompletionRates)(struct ath_hal *, + const struct ath_desc *ds, int *rates, int *tries); /* Receive Functions */ uint32_t __ahdecl(*ah_getRxDP)(struct ath_hal*); Modified: head/sys/dev/ath/ath_hal/ar5210/ar5210.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5210/ar5210.h Thu Jan 20 05:44:36 2011 (r217620) +++ head/sys/dev/ath/ath_hal/ar5210/ar5210.h Thu Jan 20 05:49:15 2011 (r217621) @@ -177,6 +177,8 @@ extern HAL_STATUS ar5210ProcTxDesc(struc struct ath_desc *, struct ath_tx_status *); extern void ar5210GetTxIntrQueue(struct ath_hal *ah, uint32_t *); extern void ar5210IntrReqTxDesc(struct ath_hal *ah, struct ath_desc *); +extern HAL_BOOL ar5210GetTxCompletionRates(struct ath_hal *ah, + const struct ath_desc *, int *rates, int *tries); extern uint32_t ar5210GetRxDP(struct ath_hal *); extern void ar5210SetRxDP(struct ath_hal *, uint32_t rxdp); Modified: head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c Thu Jan 20 05:44:36 2011 (r217620) +++ head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c Thu Jan 20 05:49:15 2011 (r217621) @@ -73,6 +73,7 @@ static const struct ath_hal_private ar52 .ah_procTxDesc = ar5210ProcTxDesc, .ah_getTxIntrQueue = ar5210GetTxIntrQueue, .ah_reqTxIntrDesc = ar5210IntrReqTxDesc, + .ah_getTxCompletionRates = ar5210GetTxCompletionRates, /* RX Functions */ .ah_getRxDP = ar5210GetRxDP, Modified: head/sys/dev/ath/ath_hal/ar5210/ar5210_xmit.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5210/ar5210_xmit.c Thu Jan 20 05:44:36 2011 (r217620) +++ head/sys/dev/ath/ath_hal/ar5210/ar5210_xmit.c Thu Jan 20 05:49:15 2011 (r217621) @@ -621,3 +621,12 @@ ar5210GetTxIntrQueue(struct ath_hal *ah, { return; } + +/* + * Retrieve the rate table from the given TX completion descriptor + */ +HAL_BOOL +ar5210GetTxCompletionRates(struct ath_hal *ah, const struct ath_desc *ds0, int *rates, int *tries) +{ + return AH_FALSE; +} Modified: head/sys/dev/ath/ath_hal/ar5211/ar5211.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5211/ar5211.h Thu Jan 20 05:44:36 2011 (r217620) +++ head/sys/dev/ath/ath_hal/ar5211/ar5211.h Thu Jan 20 05:49:15 2011 (r217621) @@ -202,6 +202,8 @@ extern HAL_STATUS ar5211ProcTxDesc(struc struct ath_desc *, struct ath_tx_status *); extern void ar5211GetTxIntrQueue(struct ath_hal *ah, uint32_t *); extern void ar5211IntrReqTxDesc(struct ath_hal *ah, struct ath_desc *); +extern HAL_BOOL ar5211GetTxCompletionRates(struct ath_hal *ah, + const struct ath_desc *ds0, int *rates, int *tries); extern uint32_t ar5211GetRxDP(struct ath_hal *); extern void ar5211SetRxDP(struct ath_hal *, uint32_t rxdp); Modified: head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c Thu Jan 20 05:44:36 2011 (r217620) +++ head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c Thu Jan 20 05:49:15 2011 (r217621) @@ -73,6 +73,7 @@ static const struct ath_hal_private ar52 .ah_procTxDesc = ar5211ProcTxDesc, .ah_getTxIntrQueue = ar5211GetTxIntrQueue, .ah_reqTxIntrDesc = ar5211IntrReqTxDesc, + .ah_getTxCompletionRates = ar5211GetTxCompletionRates, /* RX Functions */ .ah_getRxDP = ar5211GetRxDP, Modified: head/sys/dev/ath/ath_hal/ar5211/ar5211_xmit.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5211/ar5211_xmit.c Thu Jan 20 05:44:36 2011 (r217620) +++ head/sys/dev/ath/ath_hal/ar5211/ar5211_xmit.c Thu Jan 20 05:49:15 2011 (r217621) @@ -660,3 +660,13 @@ ar5211GetTxIntrQueue(struct ath_hal *ah, { return; } + +/* + * Retrieve the rate table from the given TX completion descriptor + */ +HAL_BOOL +ar5211GetTxCompletionRates(struct ath_hal *ah, const struct ath_desc *ds0, int *rates, int *tries) +{ + return AH_FALSE; +} + Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212.h Thu Jan 20 05:44:36 2011 (r217620) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212.h Thu Jan 20 05:49:15 2011 (r217621) @@ -589,6 +589,8 @@ extern HAL_STATUS ar5212ProcTxDesc(struc struct ath_desc *, struct ath_tx_status *); extern void ar5212GetTxIntrQueue(struct ath_hal *ah, uint32_t *); extern void ar5212IntrReqTxDesc(struct ath_hal *ah, struct ath_desc *); +extern HAL_BOOL ar5212GetTxCompletionRates(struct ath_hal *ah, + const struct ath_desc *ds0, int *rates, int *tries); extern const HAL_RATE_TABLE *ar5212GetRateTable(struct ath_hal *, u_int mode); Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c Thu Jan 20 05:44:36 2011 (r217620) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c Thu Jan 20 05:49:15 2011 (r217621) @@ -69,6 +69,7 @@ static const struct ath_hal_private ar52 .ah_procTxDesc = ar5212ProcTxDesc, .ah_getTxIntrQueue = ar5212GetTxIntrQueue, .ah_reqTxIntrDesc = ar5212IntrReqTxDesc, + .ah_getTxCompletionRates = ar5212GetTxCompletionRates, /* RX Functions */ .ah_getRxDP = ar5212GetRxDP, Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_xmit.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_xmit.c Thu Jan 20 05:44:36 2011 (r217620) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_xmit.c Thu Jan 20 05:49:15 2011 (r217621) @@ -918,3 +918,24 @@ ar5212GetTxIntrQueue(struct ath_hal *ah, *txqs &= ahp->ah_intrTxqs; ahp->ah_intrTxqs &= ~(*txqs); } + +/* + * Retrieve the rate table from the given TX completion descriptor + */ +HAL_BOOL +ar5212GetTxCompletionRates(struct ath_hal *ah, const struct ath_desc *ds0, int *rates, int *tries) +{ + const struct ar5212_desc *ads = AR5212DESC_CONST(ds0); + + rates[0] = MS(ads->ds_ctl3, AR_XmitRate0); + rates[1] = MS(ads->ds_ctl3, AR_XmitRate1); + rates[2] = MS(ads->ds_ctl3, AR_XmitRate2); + rates[3] = MS(ads->ds_ctl3, AR_XmitRate3); + + tries[0] = MS(ads->ds_ctl2, AR_XmitDataTries0); + tries[1] = MS(ads->ds_ctl2, AR_XmitDataTries1); + tries[2] = MS(ads->ds_ctl2, AR_XmitDataTries2); + tries[3] = MS(ads->ds_ctl2, AR_XmitDataTries3); + + return AH_TRUE; +} Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416.h Thu Jan 20 05:44:36 2011 (r217620) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416.h Thu Jan 20 05:49:15 2011 (r217621) @@ -218,6 +218,8 @@ extern HAL_BOOL ar5416FillTxDesc(struct const struct ath_desc *ds0); extern HAL_STATUS ar5416ProcTxDesc(struct ath_hal *ah, struct ath_desc *, struct ath_tx_status *); +extern HAL_BOOL ar5416GetTxCompletionRates(struct ath_hal *ah, + const struct ath_desc *ds0, int *rates, int *tries); extern const HAL_RATE_TABLE *ar5416GetRateTable(struct ath_hal *, u_int mode); #endif /* _ATH_AR5416_H_ */ Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Thu Jan 20 05:44:36 2011 (r217620) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Thu Jan 20 05:49:15 2011 (r217621) @@ -98,6 +98,7 @@ ar5416InitState(struct ath_hal_5416 *ahp ah->ah_setupXTxDesc = ar5416SetupXTxDesc; ah->ah_fillTxDesc = ar5416FillTxDesc; ah->ah_procTxDesc = ar5416ProcTxDesc; + ah->ah_getTxCompletionRates = ar5416GetTxCompletionRates; /* Receive Functions */ ah->ah_startPcuReceive = ar5416StartPcuReceive; Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c Thu Jan 20 05:44:36 2011 (r217620) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c Thu Jan 20 05:49:15 2011 (r217621) @@ -693,3 +693,25 @@ ar5416Set11nBurstDuration(struct ath_hal ads->ds_ctl2 |= SM(burstDuration, AR_BurstDur); } #endif + +/* + * Retrieve the rate table from the given TX completion descriptor + */ +HAL_BOOL +ar5416GetTxCompletionRates(struct ath_hal *ah, const struct ath_desc *ds0, int *rates, int *tries) +{ + const struct ar5416_desc *ads = AR5416DESC_CONST(ds0); + + rates[0] = MS(ads->ds_ctl3, AR_XmitRate0); + rates[1] = MS(ads->ds_ctl3, AR_XmitRate1); + rates[2] = MS(ads->ds_ctl3, AR_XmitRate2); + rates[3] = MS(ads->ds_ctl3, AR_XmitRate3); + + tries[0] = MS(ads->ds_ctl2, AR_XmitDataTries0); + tries[1] = MS(ads->ds_ctl2, AR_XmitDataTries1); + tries[2] = MS(ads->ds_ctl2, AR_XmitDataTries2); + tries[3] = MS(ads->ds_ctl2, AR_XmitDataTries3); + + return AH_TRUE; +} + From owner-svn-src-all@FreeBSD.ORG Thu Jan 20 07:03:21 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0EA221065670; Thu, 20 Jan 2011 07:03:21 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D6F118FC0A; Thu, 20 Jan 2011 07:03:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0K73KFU004036; Thu, 20 Jan 2011 07:03:20 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0K73KXx004033; Thu, 20 Jan 2011 07:03:20 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201101200703.p0K73KXx004033@svn.freebsd.org> From: Adrian Chadd Date: Thu, 20 Jan 2011 07:03: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: r217622 - head/sys/dev/ath/ath_hal X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jan 2011 07:03:21 -0000 Author: adrian Date: Thu Jan 20 07:03:20 2011 New Revision: 217622 URL: http://svn.freebsd.org/changeset/base/217622 Log: Add another HAL function which waits for a register for a configurable amount. This will be used by some future code. Modified: head/sys/dev/ath/ath_hal/ah.c head/sys/dev/ath/ath_hal/ah_internal.h Modified: head/sys/dev/ath/ath_hal/ah.c ============================================================================== --- head/sys/dev/ath/ath_hal/ah.c Thu Jan 20 05:49:15 2011 (r217621) +++ head/sys/dev/ath/ath_hal/ah.c Thu Jan 20 07:03:20 2011 (r217622) @@ -197,9 +197,16 @@ HAL_BOOL ath_hal_wait(struct ath_hal *ah, u_int reg, uint32_t mask, uint32_t val) { #define AH_TIMEOUT 1000 + return ath_hal_waitfor(ah, reg, mask, val, AH_TIMEOUT); +#undef AH_TIMEOUT +} + +HAL_BOOL +ath_hal_waitfor(struct ath_hal *ah, u_int reg, uint32_t mask, uint32_t val, uint32_t timeout) +{ int i; - for (i = 0; i < AH_TIMEOUT; i++) { + for (i = 0; i < timeout; i++) { if ((OS_REG_READ(ah, reg) & mask) == val) return AH_TRUE; OS_DELAY(10); @@ -208,7 +215,6 @@ ath_hal_wait(struct ath_hal *ah, u_int r "%s: timeout on reg 0x%x: 0x%08x & 0x%08x != 0x%08x\n", __func__, reg, OS_REG_READ(ah, reg), mask, val); return AH_FALSE; -#undef AH_TIMEOUT } /* Modified: head/sys/dev/ath/ath_hal/ah_internal.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_internal.h Thu Jan 20 05:49:15 2011 (r217621) +++ head/sys/dev/ath/ath_hal/ah_internal.h Thu Jan 20 07:03:20 2011 (r217622) @@ -471,6 +471,8 @@ extern int ath_hal_additional_swba_backo /* wait for the register contents to have the specified value */ extern HAL_BOOL ath_hal_wait(struct ath_hal *, u_int reg, uint32_t mask, uint32_t val); +extern HAL_BOOL ath_hal_waitfor(struct ath_hal *, u_int reg, + uint32_t mask, uint32_t val, uint32_t timeout); /* return the first n bits in val reversed */ extern uint32_t ath_hal_reverseBits(uint32_t val, uint32_t n); From owner-svn-src-all@FreeBSD.ORG Thu Jan 20 07:42:40 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 033CC1065679; Thu, 20 Jan 2011 07:42:40 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 834468FC1E; Thu, 20 Jan 2011 07:42:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0K7gd5Q004887; Thu, 20 Jan 2011 07:42:39 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0K7gdQK004883; Thu, 20 Jan 2011 07:42:39 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201101200742.p0K7gdQK004883@svn.freebsd.org> From: Adrian Chadd Date: Thu, 20 Jan 2011 07:42:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217623 - head/sys/dev/ath/ath_hal X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jan 2011 07:42:40 -0000 Author: adrian Date: Thu Jan 20 07:42:39 2011 New Revision: 217623 URL: http://svn.freebsd.org/changeset/base/217623 Log: Port over another EEPROM option from ath9k - AR_EEP_DAC_HPWR_5G This will be used by the temperature compensation calibration code which will shortly make an appearance. Modified: head/sys/dev/ath/ath_hal/ah_eeprom.h head/sys/dev/ath/ath_hal/ah_eeprom_v14.c head/sys/dev/ath/ath_hal/ah_eeprom_v14.h Modified: head/sys/dev/ath/ath_hal/ah_eeprom.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_eeprom.h Thu Jan 20 07:03:20 2011 (r217622) +++ head/sys/dev/ath/ath_hal/ah_eeprom.h Thu Jan 20 07:42:39 2011 (r217623) @@ -94,6 +94,7 @@ enum { AR_EEP_RXMASK, /* uint8_t* */ AR_EEP_RXGAIN_TYPE, /* uint8_t* */ AR_EEP_TXGAIN_TYPE, /* uint8_t* */ + AR_EEP_DAC_HPWR_5G, /* uint8_t* */ AR_EEP_OL_PWRCTRL, /* use ath_hal_eepromGetFlag */ AR_EEP_FSTCLK_5G, /* use ath_hal_eepromGetFlag */ AR_EEP_ANTGAINMAX_5, /* int8_t* */ Modified: head/sys/dev/ath/ath_hal/ah_eeprom_v14.c ============================================================================== --- head/sys/dev/ath/ath_hal/ah_eeprom_v14.c Thu Jan 20 07:03:20 2011 (r217622) +++ head/sys/dev/ath/ath_hal/ah_eeprom_v14.c Thu Jan 20 07:42:39 2011 (r217623) @@ -89,6 +89,12 @@ v14EepromGet(struct ath_hal *ah, int par case AR_EEP_OL_PWRCTRL: HALASSERT(val == AH_NULL); return pBase->openLoopPwrCntl ? HAL_OK : HAL_EIO; + case AR_EEP_DAC_HPWR_5G: + if (IS_VERS(>=, AR5416_EEP_MINOR_VER_20)) { + *(uint8_t *) val = pBase->dacHiPwrMode; + return HAL_OK; + } else + return HAL_EIO; case AR_EEP_AMODE: HALASSERT(val == AH_NULL); return pBase->opCapFlags & AR5416_OPFLAGS_11A ? Modified: head/sys/dev/ath/ath_hal/ah_eeprom_v14.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_eeprom_v14.h Thu Jan 20 07:03:20 2011 (r217622) +++ head/sys/dev/ath/ath_hal/ah_eeprom_v14.h Thu Jan 20 07:42:39 2011 (r217623) @@ -52,6 +52,9 @@ #define AR5416_EEP_MINOR_VER_16 0x10 #define AR5416_EEP_MINOR_VER_17 0x11 #define AR5416_EEP_MINOR_VER_19 0x13 +#define AR5416_EEP_MINOR_VER_20 0x14 +#define AR5416_EEP_MINOR_VER_21 0x15 +#define AR5416_EEP_MINOR_VER_22 0x16 // 16-bit offset location start of calibration struct #define AR5416_EEP_START_LOC 256 From owner-svn-src-all@FreeBSD.ORG Thu Jan 20 07:56:09 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 92DC7106566C; Thu, 20 Jan 2011 07:56:09 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7F1CD8FC16; Thu, 20 Jan 2011 07:56:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0K7u94n005231; Thu, 20 Jan 2011 07:56:09 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0K7u9I3005217; Thu, 20 Jan 2011 07:56:09 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201101200756.p0K7u9I3005217@svn.freebsd.org> From: Adrian Chadd Date: Thu, 20 Jan 2011 07:56:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217624 - in head/sys/dev/ath: . ath_hal ath_hal/ar5210 ath_hal/ar5211 ath_hal/ar5212 ath_hal/ar5312 ath_hal/ar5416 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jan 2011 07:56:09 -0000 Author: adrian Date: Thu Jan 20 07:56:09 2011 New Revision: 217624 URL: http://svn.freebsd.org/changeset/base/217624 Log: Include the initial support for external EEPROMs. The AR9100 at least doesn't have an external serial EEPROM attached to the MAC; it instead stores the calibration data in the normal system flash. I believe earlier parts can do something similar but I haven't experienced it first-hand. This commit introduces an eepromdata pointer into the API but doesn't at all commit to using it. A future commit will include the glue needed to allow the AR9100 support code to use this data pointer as the EEPROM. Modified: head/sys/dev/ath/ath_hal/ah.c head/sys/dev/ath/ath_hal/ah.h head/sys/dev/ath/ath_hal/ah_internal.h head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c head/sys/dev/ath/ath_hal/ar5312/ar5312_attach.c head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c head/sys/dev/ath/ath_hal/ar5416/ar9160_attach.c head/sys/dev/ath/ath_hal/ar5416/ar9280_attach.c head/sys/dev/ath/ath_hal/ar5416/ar9285_attach.c head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/ath_hal/ah.c ============================================================================== --- head/sys/dev/ath/ath_hal/ah.c Thu Jan 20 07:42:39 2011 (r217623) +++ head/sys/dev/ath/ath_hal/ah.c Thu Jan 20 07:56:09 2011 (r217624) @@ -53,7 +53,7 @@ ath_hal_probe(uint16_t vendorid, uint16_ */ struct ath_hal* ath_hal_attach(uint16_t devid, HAL_SOFTC sc, - HAL_BUS_TAG st, HAL_BUS_HANDLE sh, HAL_STATUS *error) + HAL_BUS_TAG st, HAL_BUS_HANDLE sh, uint16_t *eepromdata, HAL_STATUS *error) { struct ath_hal_chip * const *pchip; @@ -64,7 +64,7 @@ ath_hal_attach(uint16_t devid, HAL_SOFTC /* XXX don't have vendorid, assume atheros one works */ if (chip->probe(ATHEROS_VENDOR_ID, devid) == AH_NULL) continue; - ah = chip->attach(devid, sc, st, sh, error); + ah = chip->attach(devid, sc, st, sh, eepromdata, error); if (ah != AH_NULL) { /* copy back private state to public area */ ah->ah_devid = AH_PRIVATE(ah)->ah_devid; Modified: head/sys/dev/ath/ath_hal/ah.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah.h Thu Jan 20 07:42:39 2011 (r217623) +++ head/sys/dev/ath/ath_hal/ah.h Thu Jan 20 07:56:09 2011 (r217624) @@ -619,6 +619,8 @@ struct ath_hal { uint16_t ah_analog5GhzRev;/* 5GHz radio revision */ uint16_t ah_analog2GhzRev;/* 2GHz radio revision */ + uint16_t *ah_eepromdata; /* eeprom buffer, if needed */ + const HAL_RATE_TABLE *__ahdecl(*ah_getRateTable)(struct ath_hal *, u_int mode); void __ahdecl(*ah_detach)(struct ath_hal*); @@ -817,7 +819,7 @@ extern const char *__ahdecl ath_hal_prob * be returned if the status parameter is non-zero. */ extern struct ath_hal * __ahdecl ath_hal_attach(uint16_t devid, HAL_SOFTC, - HAL_BUS_TAG, HAL_BUS_HANDLE, HAL_STATUS* status); + HAL_BUS_TAG, HAL_BUS_HANDLE, uint16_t *eepromdata, HAL_STATUS* status); extern const char *ath_hal_mac_name(struct ath_hal *); extern const char *ath_hal_rf_name(struct ath_hal *); Modified: head/sys/dev/ath/ath_hal/ah_internal.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_internal.h Thu Jan 20 07:42:39 2011 (r217623) +++ head/sys/dev/ath/ath_hal/ah_internal.h Thu Jan 20 07:56:09 2011 (r217624) @@ -80,7 +80,8 @@ struct ath_hal_chip { const char *name; const char *(*probe)(uint16_t vendorid, uint16_t devid); struct ath_hal *(*attach)(uint16_t devid, HAL_SOFTC, - HAL_BUS_TAG, HAL_BUS_HANDLE, HAL_STATUS *error); + HAL_BUS_TAG, HAL_BUS_HANDLE, uint16_t *eepromdata, + HAL_STATUS *error); }; #ifndef AH_CHIP #define AH_CHIP(_name, _probe, _attach) \ Modified: head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c Thu Jan 20 07:42:39 2011 (r217623) +++ head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c Thu Jan 20 07:56:09 2011 (r217624) @@ -170,7 +170,7 @@ static HAL_BOOL ar5210FillCapabilityInfo */ static struct ath_hal * ar5210Attach(uint16_t devid, HAL_SOFTC sc, HAL_BUS_TAG st, HAL_BUS_HANDLE sh, - HAL_STATUS *status) + uint16_t *eepromdata, HAL_STATUS *status) { #define N(a) (sizeof(a)/sizeof(a[0])) struct ath_hal_5210 *ahp; Modified: head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c Thu Jan 20 07:42:39 2011 (r217623) +++ head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c Thu Jan 20 07:56:09 2011 (r217624) @@ -189,7 +189,8 @@ ar5211GetRadioRev(struct ath_hal *ah) */ static struct ath_hal * ar5211Attach(uint16_t devid, HAL_SOFTC sc, - HAL_BUS_TAG st, HAL_BUS_HANDLE sh, HAL_STATUS *status) + HAL_BUS_TAG st, HAL_BUS_HANDLE sh, uint16_t *eepromdata, + HAL_STATUS *status) { #define N(a) (sizeof(a)/sizeof(a[0])) struct ath_hal_5211 *ahp; Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c Thu Jan 20 07:42:39 2011 (r217623) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c Thu Jan 20 07:56:09 2011 (r217624) @@ -295,7 +295,8 @@ ar5212IsMacSupported(uint8_t macVersion, */ static struct ath_hal * ar5212Attach(uint16_t devid, HAL_SOFTC sc, - HAL_BUS_TAG st, HAL_BUS_HANDLE sh, HAL_STATUS *status) + HAL_BUS_TAG st, HAL_BUS_HANDLE sh, uint16_t *eepromdata, + HAL_STATUS *status) { #define AH_EEPROM_PROTECT(ah) \ (AH_PRIVATE(ah)->ah_ispcie)? AR_EEPROM_PROTECT_PCIE : AR_EEPROM_PROTECT) Modified: head/sys/dev/ath/ath_hal/ar5312/ar5312_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5312/ar5312_attach.c Thu Jan 20 07:42:39 2011 (r217623) +++ head/sys/dev/ath/ath_hal/ar5312/ar5312_attach.c Thu Jan 20 07:56:09 2011 (r217624) @@ -61,7 +61,8 @@ ar5312AniSetup(struct ath_hal *ah) */ static struct ath_hal * ar5312Attach(uint16_t devid, HAL_SOFTC sc, - HAL_BUS_TAG st, HAL_BUS_HANDLE sh, HAL_STATUS *status) + HAL_BUS_TAG st, HAL_BUS_HANDLE sh, uint16_t *eepromdata, + HAL_STATUS *status) { struct ath_hal_5212 *ahp = AH_NULL; struct ath_hal *ah; Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Thu Jan 20 07:42:39 2011 (r217623) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Thu Jan 20 07:56:09 2011 (r217624) @@ -190,7 +190,8 @@ ar5416GetRadioRev(struct ath_hal *ah) */ static struct ath_hal * ar5416Attach(uint16_t devid, HAL_SOFTC sc, - HAL_BUS_TAG st, HAL_BUS_HANDLE sh, HAL_STATUS *status) + HAL_BUS_TAG st, HAL_BUS_HANDLE sh, uint16_t *eepromdata, + HAL_STATUS *status) { struct ath_hal_5416 *ahp5416; struct ath_hal_5212 *ahp; Modified: head/sys/dev/ath/ath_hal/ar5416/ar9160_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar9160_attach.c Thu Jan 20 07:42:39 2011 (r217623) +++ head/sys/dev/ath/ath_hal/ar5416/ar9160_attach.c Thu Jan 20 07:56:09 2011 (r217624) @@ -89,7 +89,8 @@ ar9160AniSetup(struct ath_hal *ah) */ static struct ath_hal * ar9160Attach(uint16_t devid, HAL_SOFTC sc, - HAL_BUS_TAG st, HAL_BUS_HANDLE sh, HAL_STATUS *status) + HAL_BUS_TAG st, HAL_BUS_HANDLE sh, uint16_t *eepromdata, + HAL_STATUS *status) { struct ath_hal_5416 *ahp5416; struct ath_hal_5212 *ahp; Modified: head/sys/dev/ath/ath_hal/ar5416/ar9280_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar9280_attach.c Thu Jan 20 07:42:39 2011 (r217623) +++ head/sys/dev/ath/ath_hal/ar5416/ar9280_attach.c Thu Jan 20 07:56:09 2011 (r217624) @@ -77,7 +77,8 @@ ar9280AniSetup(struct ath_hal *ah) */ static struct ath_hal * ar9280Attach(uint16_t devid, HAL_SOFTC sc, - HAL_BUS_TAG st, HAL_BUS_HANDLE sh, HAL_STATUS *status) + HAL_BUS_TAG st, HAL_BUS_HANDLE sh, uint16_t *eepromdata, + HAL_STATUS *status) { struct ath_hal_9280 *ahp9280; struct ath_hal_5212 *ahp; Modified: head/sys/dev/ath/ath_hal/ar5416/ar9285_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar9285_attach.c Thu Jan 20 07:42:39 2011 (r217623) +++ head/sys/dev/ath/ath_hal/ar5416/ar9285_attach.c Thu Jan 20 07:56:09 2011 (r217624) @@ -79,7 +79,8 @@ ar9285AniSetup(struct ath_hal *ah) */ static struct ath_hal * ar9285Attach(uint16_t devid, HAL_SOFTC sc, - HAL_BUS_TAG st, HAL_BUS_HANDLE sh, HAL_STATUS *status) + HAL_BUS_TAG st, HAL_BUS_HANDLE sh, uint16_t *eepromdata, + HAL_STATUS *status) { struct ath_hal_9285 *ahp9285; struct ath_hal_5212 *ahp; Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Thu Jan 20 07:42:39 2011 (r217623) +++ head/sys/dev/ath/if_ath.c Thu Jan 20 07:56:09 2011 (r217624) @@ -374,7 +374,7 @@ ath_attach(u_int16_t devid, struct ath_s if_initname(ifp, device_get_name(sc->sc_dev), device_get_unit(sc->sc_dev)); - ah = ath_hal_attach(devid, sc, sc->sc_st, sc->sc_sh, &status); + ah = ath_hal_attach(devid, sc, sc->sc_st, sc->sc_sh, sc->sc_eepromdata, &status); if (ah == NULL) { if_printf(ifp, "unable to attach hardware; HAL status %u\n", status); Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Thu Jan 20 07:42:39 2011 (r217623) +++ head/sys/dev/ath/if_athvar.h Thu Jan 20 07:56:09 2011 (r217624) @@ -342,6 +342,7 @@ struct ath_softc { u_int sc_tdmaslotlen; /* TDMA slot length (usec) */ u_int32_t sc_avgtsfdeltap;/* TDMA slot adjust (+) */ u_int32_t sc_avgtsfdeltam;/* TDMA slot adjust (-) */ + uint16_t *sc_eepromdata; /* Local eeprom data, if AR9100 */ }; #define ATH_LOCK_INIT(_sc) \ From owner-svn-src-all@FreeBSD.ORG Thu Jan 20 08:03:13 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E12C9106566B; Thu, 20 Jan 2011 08:03:12 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail07.syd.optusnet.com.au (mail07.syd.optusnet.com.au [211.29.132.188]) by mx1.freebsd.org (Postfix) with ESMTP id 6D1858FC13; Thu, 20 Jan 2011 08:03:11 +0000 (UTC) Received: from c122-106-165-206.carlnfd1.nsw.optusnet.com.au (c122-106-165-206.carlnfd1.nsw.optusnet.com.au [122.106.165.206]) by mail07.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p0K837Ms018636 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 20 Jan 2011 19:03:09 +1100 Date: Thu, 20 Jan 2011 19:03:07 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: David Malone In-Reply-To: <201101191717.p0JHHbOh083434@svn.freebsd.org> Message-ID: <20110120183431.E11559@besplex.bde.org> References: <201101191717.p0JHHbOh083434@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r217589 - head/usr.sbin/syslogd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jan 2011 08:03:13 -0000 On Wed, 19 Jan 2011, David Malone wrote: > Log: > Here v->iov_len has been assigned the return value from snprintf. > Checking if it is > 0 doesn't make sense, because snprintf returns > how much space is needed if the buffer is too small. Instead, check > if the return value was greater than the buffer size, and truncate > the message if it was too long. > > It isn't clear if snprintf can return a negative value in the case > of an error - I don't believe it can. If it can, then testing > v->iov_len won't help 'cos it is a size_t, not an ssize_t. snprintf(buf, 2, "%*s%*s%*s", INT_MAX, "223", INT_MAX, "", 3, "bar"); must return a negative value, since the value that would be written if all the output fitted in the buffer is not representable in snprintf()'s return type. C99 and POSIX have too little to say about this. In C99, a negative return value for sprintf() is only mentioned in connection with an encoding error, and not even that is mentioned for snprintf(). The above examples shows that errors or undefined behaviour must occur for some parameters, so we can't trust the standard. Of course, this reason for an error can only happen for exotic formats that won't be used in practice. I only use the above to test that snprintf() handles this error. As a side effect, this demonstrates the slowness of snprintf(). It takes about 2 seconds on a 2GHz machine to do add 1 for each of the ~INT_MAX ~= 0x7FFFFFFF characters that don't fit in the buffer. > Modified: head/usr.sbin/syslogd/syslogd.c > ============================================================================== > --- head/usr.sbin/syslogd/syslogd.c Wed Jan 19 17:11:52 2011 (r217588) > +++ head/usr.sbin/syslogd/syslogd.c Wed Jan 19 17:17:37 2011 (r217589) > @@ -1093,8 +1093,9 @@ fprintlog(struct filed *f, int flags, co > v->iov_len = snprintf(greetings, sizeof greetings, > "\r\n\7Message from syslogd@%s at %.24s ...\r\n", > f->f_prevhost, f->f_lasttime); If snprintf() returns a negative value, then overflow on asignment occurs here. Since iov_len is an unsigned type, the behaviour is defined. It gives the value of (SIZE_MAX + 1) added to the negative value in infinite precision and then converted to a size_t. If the negative value is not too unreasonable, the result is useful. E.g., if the negative value is -1, then the result is (SIZE_MAX - 1)... > - if (v->iov_len > 0) > - v++; > + if (v->iov_len >= sizeof greetings) ... (SIZE_MAX - 1) exceeds any reasonable object size, so tests like this normally work... > + v->iov_len = sizeof greetings - 1; > + v++; ... but in recalcantrix, size_t is smaller than int, and snprintf is carefuly to return a value that is small when downcast to size_t. E.g., size_t might be uint64_t and int int128_t. snprintf() then returns INT_MIN = 0x8000....000 in 2's complement so that the result is 0 when downcast. So although the above works, it is unportable and hard to understand. Careful code avoids all overflow and sign extension bug possibilities by only assigning return values to variables of the same type as the function. > v->iov_base = nul; > v->iov_len = 0; > v++; > Bruce From owner-svn-src-all@FreeBSD.ORG Thu Jan 20 08:08:19 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C913106566C; Thu, 20 Jan 2011 08:08:19 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6B03B8FC17; Thu, 20 Jan 2011 08:08:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0K88J2i005565; Thu, 20 Jan 2011 08:08:19 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0K88JUd005562; Thu, 20 Jan 2011 08:08:19 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201101200808.p0K88JUd005562@svn.freebsd.org> From: "Jayachandran C." Date: Thu, 20 Jan 2011 08:08: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: r217625 - head/sys/mips/rmi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jan 2011 08:08:19 -0000 Author: jchandra Date: Thu Jan 20 08:08:19 2011 New Revision: 217625 URL: http://svn.freebsd.org/changeset/base/217625 Log: Fixes in the XLR platform code - Fix bug in pic.h, assign reg variable, before return. - In xlr_pci.c, need to ignore the result of mmio read. Modified: head/sys/mips/rmi/pic.h head/sys/mips/rmi/xlr_pci.c Modified: head/sys/mips/rmi/pic.h ============================================================================== --- head/sys/mips/rmi/pic.h Thu Jan 20 07:56:09 2011 (r217624) +++ head/sys/mips/rmi/pic.h Thu Jan 20 08:08:19 2011 (r217625) @@ -163,7 +163,7 @@ pic_read_control(void) uint32_t reg; mtx_lock_spin(&xlr_pic_lock); - xlr_read_reg(mmio, PIC_CTRL); + reg = xlr_read_reg(mmio, PIC_CTRL); mtx_unlock_spin(&xlr_pic_lock); return (reg); } @@ -179,7 +179,7 @@ pic_write_control(uint32_t control) } static __inline void -pic_update_control(__uint32_t control) +pic_update_control(uint32_t control) { xlr_reg_t *mmio = xlr_io_mmio(XLR_IO_PIC_OFFSET); Modified: head/sys/mips/rmi/xlr_pci.c ============================================================================== --- head/sys/mips/rmi/xlr_pci.c Thu Jan 20 07:56:09 2011 (r217624) +++ head/sys/mips/rmi/xlr_pci.c Thu Jan 20 08:08:19 2011 (r217625) @@ -426,7 +426,7 @@ static void bridge_pcix_ack(int irq) { - xlr_read_reg(xlr_io_mmio(XLR_IO_PCIX_OFFSET), 0x140 >> 2); + (void)xlr_read_reg(xlr_io_mmio(XLR_IO_PCIX_OFFSET), 0x140 >> 2); } static void From owner-svn-src-all@FreeBSD.ORG Thu Jan 20 08:15:12 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4FE501065672; Thu, 20 Jan 2011 08:15:12 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3E4598FC13; Thu, 20 Jan 2011 08:15:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0K8FCYu005785; Thu, 20 Jan 2011 08:15:12 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0K8FCBu005780; Thu, 20 Jan 2011 08:15:12 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201101200815.p0K8FCBu005780@svn.freebsd.org> From: "Jayachandran C." Date: Thu, 20 Jan 2011 08:15:12 +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: r217626 - in head/sys: conf mips/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jan 2011 08:15:12 -0000 Author: jchandra Date: Thu Jan 20 08:15:11 2011 New Revision: 217626 URL: http://svn.freebsd.org/changeset/base/217626 Log: ldscript and conf cleanup for MIPS - Remove sys/conf/ldscript.mips.64 and sys/conf/ldscript.mips.n32 and use ldscript.mips for all ABIs. The default OUTPUT_FORMAT of the toolchain is correct. - Remove LDSCRIPT_NAME entires from XLR n32 and n64 conf files. - Remove TARGET_BIG_ENDIAN from XLR conf files. - Fix machine entry in XLRN32 Deleted: head/sys/conf/ldscript.mips.64 head/sys/conf/ldscript.mips.n32 Modified: head/sys/mips/conf/MALTA64 head/sys/mips/conf/XLR head/sys/mips/conf/XLR64 head/sys/mips/conf/XLRN32 Modified: head/sys/mips/conf/MALTA64 ============================================================================== --- head/sys/mips/conf/MALTA64 Thu Jan 20 08:08:19 2011 (r217625) +++ head/sys/mips/conf/MALTA64 Thu Jan 20 08:15:11 2011 (r217626) @@ -22,7 +22,6 @@ ident MALTA machine mips mips64el # Malta supports both, so it isn't in std.malta makeoptions ARCH_FLAGS="-march=mips64 -mabi=64" -makeoptions LDSCRIPT_NAME= ldscript.mips.mips64 options YAMON Modified: head/sys/mips/conf/XLR ============================================================================== --- head/sys/mips/conf/XLR Thu Jan 20 08:08:19 2011 (r217625) +++ head/sys/mips/conf/XLR Thu Jan 20 08:15:11 2011 (r217626) @@ -50,7 +50,6 @@ cpu CPU_RMI ident XLR makeoptions MODULES_OVERRIDE="" -makeoptions TARGET_BIG_ENDIAN # include "../rmi/std.xlr" @@ -58,6 +57,8 @@ include "../rmi/std.xlr" makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols #profile 2 +makeoptions KERNLOADADDR=0x80100000 +options ISA_MIPS32 options SCHED_ULE # ULE scheduler #options VERBOSE_SYSINIT @@ -156,5 +157,3 @@ device at24co2n # EEPROM on XLR boa #device cryptodev #device crypto #device rmisec -options ISA_MIPS32 -makeoptions KERNLOADADDR=0x80100000 Modified: head/sys/mips/conf/XLR64 ============================================================================== --- head/sys/mips/conf/XLR64 Thu Jan 20 08:08:19 2011 (r217625) +++ head/sys/mips/conf/XLR64 Thu Jan 20 08:15:11 2011 (r217626) @@ -22,13 +22,12 @@ cpu CPU_RMI ident XLR64 makeoptions MODULES_OVERRIDE="" -makeoptions TARGET_BIG_ENDIAN - include "../rmi/std.xlr" makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols makeoptions ARCH_FLAGS="-march=mips64 -mabi=64" -makeoptions LDSCRIPT_NAME=ldscript.mips.64 +makeoptions KERNLOADADDR=0xffffffff80100000 +options ISA_MIPS64 #profile 2 @@ -129,5 +128,3 @@ device umass # Disks/ #device cryptodev #device crypto #device rmisec -options ISA_MIPS64 -makeoptions KERNLOADADDR=0xffffffff80100000 Modified: head/sys/mips/conf/XLRN32 ============================================================================== --- head/sys/mips/conf/XLRN32 Thu Jan 20 08:08:19 2011 (r217625) +++ head/sys/mips/conf/XLRN32 Thu Jan 20 08:15:11 2011 (r217626) @@ -17,18 +17,17 @@ # # $FreeBSD$ -machine mips mipseb +machine mips mipsn32eb cpu CPU_RMI ident XLRN32 makeoptions MODULES_OVERRIDE="" -makeoptions TARGET_BIG_ENDIAN - include "../rmi/std.xlr" makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols makeoptions ARCH_FLAGS="-march=mips64 -mabi=n32" -makeoptions LDSCRIPT_NAME=ldscript.mips.n32 +makeoptions KERNLOADADDR=0x80100000 +options ISA_MIPS64 #profile 2 @@ -129,5 +128,3 @@ device umass # Disks/ #device cryptodev #device crypto #device rmisec -options ISA_MIPS64 -makeoptions KERNLOADADDR=0x80100000 From owner-svn-src-all@FreeBSD.ORG Thu Jan 20 08:15:46 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E5B361065673; Thu, 20 Jan 2011 08:15:46 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D497B8FC21; Thu, 20 Jan 2011 08:15:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0K8Fk9n005834; Thu, 20 Jan 2011 08:15:46 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0K8FkmC005832; Thu, 20 Jan 2011 08:15:46 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201101200815.p0K8FkmC005832@svn.freebsd.org> From: Adrian Chadd Date: Thu, 20 Jan 2011 08:15:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217627 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jan 2011 08:15:47 -0000 Author: adrian Date: Thu Jan 20 08:15:46 2011 New Revision: 217627 URL: http://svn.freebsd.org/changeset/base/217627 Log: Add in the public method to access the tx completion rates. Modified: head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Thu Jan 20 08:15:11 2011 (r217626) +++ head/sys/dev/ath/if_athvar.h Thu Jan 20 08:15:46 2011 (r217627) @@ -646,6 +646,8 @@ void ath_intr(void *); ((*(_ah)->ah_procTxDesc)((_ah), (_ds), (_ts))) #define ath_hal_gettxintrtxqs(_ah, _txqs) \ ((*(_ah)->ah_getTxIntrQueue)((_ah), (_txqs))) +#define ath_hal_gettxcompletionrates(_ah, _ds, _rates, _tries) \ + ((*(_ah)->ah_getTxCompletionRates)((_ah), (_ds), (_rates), (_tries))) #define ath_hal_gpioCfgOutput(_ah, _gpio, _type) \ ((*(_ah)->ah_gpioCfgOutput)((_ah), (_gpio), (_type))) From owner-svn-src-all@FreeBSD.ORG Thu Jan 20 08:19:23 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 847C4106564A; Thu, 20 Jan 2011 08:19:23 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 71CFD8FC08; Thu, 20 Jan 2011 08:19:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0K8JNZn006005; Thu, 20 Jan 2011 08:19:23 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0K8JNWM006002; Thu, 20 Jan 2011 08:19:23 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201101200819.p0K8JNWM006002@svn.freebsd.org> From: Adrian Chadd Date: Thu, 20 Jan 2011 08:19: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: r217628 - head/sys/dev/ath/ath_rate/sample X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jan 2011 08:19:23 -0000 Author: adrian Date: Thu Jan 20 08:19:23 2011 New Revision: 217628 URL: http://svn.freebsd.org/changeset/base/217628 Log: Migrate the sample rate module to the new ath_hal_gettxcompletionrates() API. This removes the chipset-dependent TX DMA completion descriptor groveling. It should now be (more) portable to other, later atheros chipsets when the time comes. Modified: head/sys/dev/ath/ath_rate/sample/sample.c head/sys/dev/ath/ath_rate/sample/sample.h Modified: head/sys/dev/ath/ath_rate/sample/sample.c ============================================================================== --- head/sys/dev/ath/ath_rate/sample/sample.c Thu Jan 20 08:15:46 2011 (r217627) +++ head/sys/dev/ath/ath_rate/sample/sample.c Thu Jan 20 08:19:23 2011 (r217628) @@ -600,38 +600,16 @@ ath_rate_tx_complete(struct ath_softc *s 0, 0, short_tries, long_tries, ts->ts_status); } else { - int hwrate0, rix0, tries0; - int hwrate1, rix1, tries1; - int hwrate2, rix2, tries2; - int hwrate3, rix3, tries3; + int hwrates[4], tries[4], rix[4]; int finalTSIdx = ts->ts_finaltsi; + int i; /* * Process intermediate rates that failed. */ - if (sc->sc_ah->ah_magic != 0x20065416) { - hwrate0 = MS(ds0->ds_ctl3, AR_XmitRate0); - hwrate1 = MS(ds0->ds_ctl3, AR_XmitRate1); - hwrate2 = MS(ds0->ds_ctl3, AR_XmitRate2); - hwrate3 = MS(ds0->ds_ctl3, AR_XmitRate3); - } else { - hwrate0 = MS(ds0->ds_ctl3, AR5416_XmitRate0); - hwrate1 = MS(ds0->ds_ctl3, AR5416_XmitRate1); - hwrate2 = MS(ds0->ds_ctl3, AR5416_XmitRate2); - hwrate3 = MS(ds0->ds_ctl3, AR5416_XmitRate3); - } - - rix0 = rt->rateCodeToIndex[hwrate0]; - tries0 = MS(ds0->ds_ctl2, AR_XmitDataTries0); - - rix1 = rt->rateCodeToIndex[hwrate1]; - tries1 = MS(ds0->ds_ctl2, AR_XmitDataTries1); - - rix2 = rt->rateCodeToIndex[hwrate2]; - tries2 = MS(ds0->ds_ctl2, AR_XmitDataTries2); - - rix3 = rt->rateCodeToIndex[hwrate3]; - tries3 = MS(ds0->ds_ctl2, AR_XmitDataTries3); + ath_hal_gettxcompletionrates(sc->sc_ah, ds0, hwrates, tries); + for (i = 0; i < 4; i++) + rix[i] = rt->rateCodeToIndex[hwrates[i]]; IEEE80211_NOTE(an->an_node.ni_vap, IEEE80211_MSG_RATECTL, &an->an_node, @@ -641,19 +619,19 @@ ath_rate_tx_complete(struct ath_softc *s finalTSIdx, long_tries, ts->ts_status ? "FAIL" : "OK", - rix0, tries0, - rix1, tries1, - rix2, tries2, - rix3, tries3); - - if (tries0 && !IS_RATE_DEFINED(sn, rix0)) - badrate(ifp, 0, hwrate0, tries0, ts->ts_status); - if (tries1 && !IS_RATE_DEFINED(sn, rix1)) - badrate(ifp, 1, hwrate1, tries1, ts->ts_status); - if (tries2 && !IS_RATE_DEFINED(sn, rix2)) - badrate(ifp, 2, hwrate2, tries2, ts->ts_status); - if (tries3 && !IS_RATE_DEFINED(sn, rix3)) - badrate(ifp, 3, hwrate3, tries3, ts->ts_status); + rix[0], tries[0], + rix[1], tries[1], + rix[2], tries[2], + rix[3], tries[3]); + + if (tries[0] && !IS_RATE_DEFINED(sn, rix[0])) + badrate(ifp, 0, hwrates[0], tries[0], ts->ts_status); + if (tries[1] && !IS_RATE_DEFINED(sn, rix[1])) + badrate(ifp, 1, hwrates[1], tries[1], ts->ts_status); + if (tries[2] && !IS_RATE_DEFINED(sn, rix[2])) + badrate(ifp, 2, hwrates[2], tries[2], ts->ts_status); + if (tries[3] && !IS_RATE_DEFINED(sn, rix[3])) + badrate(ifp, 3, hwrates[3], tries[3], ts->ts_status); /* * NB: series > 0 are not penalized for failure @@ -662,42 +640,42 @@ ath_rate_tx_complete(struct ath_softc *s * sample higher rates 1 try at a time doing so * may unfairly penalize them. */ - if (tries0) { + if (tries[0]) { update_stats(sc, an, frame_size, - rix0, tries0, - rix1, tries1, - rix2, tries2, - rix3, tries3, + rix[0], tries[0], + rix[1], tries[1], + rix[2], tries[2], + rix[3], tries[3], short_tries, long_tries, - long_tries > tries0); - long_tries -= tries0; + long_tries > tries[0]); + long_tries -= tries[0]; } - if (tries1 && finalTSIdx > 0) { + if (tries[1] && finalTSIdx > 0) { update_stats(sc, an, frame_size, - rix1, tries1, - rix2, tries2, - rix3, tries3, + rix[1], tries[1], + rix[2], tries[2], + rix[3], tries[3], 0, 0, short_tries, long_tries, ts->ts_status); - long_tries -= tries1; + long_tries -= tries[1]; } - if (tries2 && finalTSIdx > 1) { + if (tries[2] && finalTSIdx > 1) { update_stats(sc, an, frame_size, - rix2, tries2, - rix3, tries3, + rix[2], tries[2], + rix[3], tries[3], 0, 0, 0, 0, short_tries, long_tries, ts->ts_status); - long_tries -= tries2; + long_tries -= tries[2]; } - if (tries3 && finalTSIdx > 2) { + if (tries[3] && finalTSIdx > 2) { update_stats(sc, an, frame_size, - rix3, tries3, + rix[3], tries[3], 0, 0, 0, 0, 0, 0, Modified: head/sys/dev/ath/ath_rate/sample/sample.h ============================================================================== --- head/sys/dev/ath/ath_rate/sample/sample.h Thu Jan 20 08:15:46 2011 (r217627) +++ head/sys/dev/ath/ath_rate/sample/sample.h Thu Jan 20 08:19:23 2011 (r217628) @@ -111,47 +111,6 @@ struct sample_node { #define WIFI_CW_MAX 1023 /* - * Definitions for pulling the rate and trie counts from - * a 5212 h/w descriptor. These Don't belong here; the - * driver should record this information so the rate control - * code doesn't go groveling around in the descriptor bits. - */ -#define ds_ctl2 ds_hw[0] -#define ds_ctl3 ds_hw[1] - -/* TX ds_ctl2 */ -#define AR_XmitDataTries0 0x000f0000 /* series 0 max attempts */ -#define AR_XmitDataTries0_S 16 -#define AR_XmitDataTries1 0x00f00000 /* series 1 max attempts */ -#define AR_XmitDataTries1_S 20 -#define AR_XmitDataTries2 0x0f000000 /* series 2 max attempts */ -#define AR_XmitDataTries2_S 24 -#define AR_XmitDataTries3 0xf0000000 /* series 3 max attempts */ -#define AR_XmitDataTries3_S 28 - -/* TX ds_ctl3 */ -#define AR_XmitRate0 0x0000001f /* series 0 tx rate */ -#define AR_XmitRate0_S 0 -#define AR_XmitRate1 0x000003e0 /* series 1 tx rate */ -#define AR_XmitRate1_S 5 -#define AR_XmitRate2 0x00007c00 /* series 2 tx rate */ -#define AR_XmitRate2_S 10 -#define AR_XmitRate3 0x000f8000 /* series 3 tx rate */ -#define AR_XmitRate3_S 15 - -/* TX ds_ctl3 for 5416 */ -#define AR5416_XmitRate0 0x000000ff /* series 0 tx rate */ -#define AR5416_XmitRate0_S 0 -#define AR5416_XmitRate1 0x0000ff00 /* series 1 tx rate */ -#define AR5416_XmitRate1_S 8 -#define AR5416_XmitRate2 0x00ff0000 /* series 2 tx rate */ -#define AR5416_XmitRate2_S 16 -#define AR5416_XmitRate3 0xff000000 /* series 3 tx rate */ -#define AR5416_XmitRate3_S 24 - -#define MS(_v, _f) (((_v) & (_f)) >> _f##_S) - -/* * Calculate the transmit duration of a frame. */ static unsigned calc_usecs_unicast_packet(struct ath_softc *sc, From owner-svn-src-all@FreeBSD.ORG Thu Jan 20 08:40:23 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 037ED106566B; Thu, 20 Jan 2011 08:40:23 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E60C28FC12; Thu, 20 Jan 2011 08:40:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0K8eMmc006483; Thu, 20 Jan 2011 08:40:22 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0K8eMuu006481; Thu, 20 Jan 2011 08:40:22 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201101200840.p0K8eMuu006481@svn.freebsd.org> From: Adrian Chadd Date: Thu, 20 Jan 2011 08:40: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: r217629 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jan 2011 08:40:23 -0000 Author: adrian Date: Thu Jan 20 08:40:22 2011 New Revision: 217629 URL: http://svn.freebsd.org/changeset/base/217629 Log: Add a comment from my local HAL about what is actually going on here with these ADC DC Gain/Offset calibrations. The whole idea is to calibrate a pair of ADCs to compensate for any differences between them. The AR5416 returns lots of garbage, so there's no need to do the calibration there. The AR9160 returns 0 for secondary ADCs when calibrating 2.4ghz 20mhz modes. It returns valid data for the secondary ADCs when calibrating 2.4ghz HT/40 and any 5ghz mode. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Thu Jan 20 08:19:23 2011 (r217628) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Thu Jan 20 08:40:22 2011 (r217629) @@ -40,6 +40,23 @@ static int16_t ar5416GetNf(struct ath_ha /* * Determine if calibration is supported by device and channel flags */ + +/* + * ADC GAIN/DC offset calibration is for calibrating two ADCs that + * are acting as one by interleaving incoming symbols. This isn't + * relevant for 2.4GHz 20MHz wide modes because, as far as I can tell, + * the secondary ADC is never enabled. It is enabled however for + * 5GHz modes. + * + * It hasn't been confirmed whether doing this calibration is needed + * at all in the above modes and/or whether it's actually harmful. + * So for now, let's leave it enabled and just remember to get + * confirmation that it needs to be clarified. + * + * See US Patent No: US 7,541,952 B1: + * " Method and Apparatus for Offset and Gain Compensation for + * Analog-to-Digital Converters." + */ static OS_INLINE HAL_BOOL ar5416IsCalSupp(struct ath_hal *ah, const struct ieee80211_channel *chan, HAL_CAL_TYPE calType) From owner-svn-src-all@FreeBSD.ORG Thu Jan 20 09:01:14 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A316B1065672; Thu, 20 Jan 2011 09:01:14 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 913178FC16; Thu, 20 Jan 2011 09:01:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0K91Esh007125; Thu, 20 Jan 2011 09:01:14 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0K91EtQ007121; Thu, 20 Jan 2011 09:01:14 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201101200901.p0K91EtQ007121@svn.freebsd.org> From: "Jayachandran C." Date: Thu, 20 Jan 2011 09:01: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: r217630 - head/sys/mips/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jan 2011 09:01:14 -0000 Author: jchandra Date: Thu Jan 20 09:01:14 2011 New Revision: 217630 URL: http://svn.freebsd.org/changeset/base/217630 Log: Re-format XLR configuartion files and remove obsolete options. Modified: head/sys/mips/conf/XLR head/sys/mips/conf/XLR64 head/sys/mips/conf/XLRN32 Modified: head/sys/mips/conf/XLR ============================================================================== --- head/sys/mips/conf/XLR Thu Jan 20 08:40:22 2011 (r217629) +++ head/sys/mips/conf/XLR Thu Jan 20 09:01:14 2011 (r217630) @@ -50,20 +50,18 @@ cpu CPU_RMI ident XLR makeoptions MODULES_OVERRIDE="" -# include "../rmi/std.xlr" - makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols -#profile 2 makeoptions KERNLOADADDR=0x80100000 -options ISA_MIPS32 +#profile 2 +options ISA_MIPS32 options SCHED_ULE # ULE scheduler -#options VERBOSE_SYSINIT +#options VERBOSE_SYSINIT #options SCHED_4BSD # 4BSD scheduler -options SMP +options SMP options PREEMPTION # Enable kernel thread preemption #options FULL_PREEMPTION # Enable kernel thread preemption options INET # InterNETworking @@ -72,20 +70,20 @@ options FFS # Berkeley Fast Filesyste #options SOFTUPDATES # Enable FFS soft updates support options UFS_ACL # Support for access control lists options UFS_DIRHASH # Improve performance on big directories -options NFSCLIENT -options NFS_ROOT +options NFSCLIENT +options NFS_ROOT # -options BOOTP -options BOOTP_NFSROOT -options BOOTP_NFSV3 -options BOOTP_WIRED_TO=nlge0 -options BOOTP_COMPAT -options ROOTDEVNAME=\"nfs:10.1.1.8:/usr/extra/nfsroot\" +options BOOTP +options BOOTP_NFSROOT +options BOOTP_NFSV3 +options BOOTP_WIRED_TO=nlge0 +options BOOTP_COMPAT +options ROOTDEVNAME=\"nfs:10.1.1.8:/usr/extra/nfsroot\" # #options MD_ROOT # MD is a potential root device -#options MD_ROOT_SIZE=27000 -#options MD_ROOT_SIZE=5120 -#options ROOTDEVNAME=\"ufs:md0\" +#options MD_ROOT_SIZE=27000 +#options MD_ROOT_SIZE=5120 +#options ROOTDEVNAME=\"ufs:md0\" options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions options HZ=1000 options NO_SWAPPING @@ -96,29 +94,28 @@ options DDB options KDB options GDB options ALT_BREAK_TO_DEBUGGER +options BREAK_TO_DEBUGGER #options DEADLKRES #Enable the deadlock resolver options INVARIANTS #Enable calls of extra sanity checking options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS #options WITNESS #Enable checks to detect deadlocks and cycles #options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed #options KTR # ktr(4) and ktrdump(8) support -#options KTR_COMPILE=(KTR_LOCK|KTR_PROC|KTR_INTR|KTR_CALLOUT|KTR_UMA|KTR_SYSC|KTR_CRITICAL) +#options KTR_COMPILE=(KTR_LOCK|KTR_PROC|KTR_INTR|KTR_CALLOUT|KTR_UMA|KTR_SYSC) #options KTR_ENTRIES=131072 -#options MUTEX_DEBUG -#options MUTEX_PROFILING + +#options LOCK_PROFILING +#options SLEEPQUEUE_PROFILING +#options TURNSTILE_PROFILING device pci #device ata #device atadisk -#options XLR_PERFMON # Enable XLR processor activity monitoring -options BREAK_TO_DEBUGGER -#device genclock device uart # Pseudo device loop device random device md -device mem device pty device bpf @@ -129,31 +126,27 @@ device ether device re device msk -device da -device scbus -#device ohci # OHCI PCI->USB interface -device ehci # EHCI PCI->USB interface (USB 2.0) -device usb # USB Bus (required) -options USB_DEBUG # enable debug msgs -#device udbp # USB Double Bulk Pipe devices -#device ugen # Generic -#device uhid # "Human Interface Devices" -device umass # Disks/Mass storage - Requires scbus and da +device da +device scbus +device ehci # EHCI PCI->USB interface (USB 2.0) +device usb # USB Bus (required) +#options USB_DEBUG # enable debug msgs +#device uhid # "Human Interface Devices" +device umass # Disks/Mass storage - Requires scbus and da #device cfi #i2c -# Not yet -device ic -device iic -device iicbb -device iicbus -device ds1374u # RTC on XLR boards -device max6657 # Temparature sensor on XLR boards -device at24co2n # EEPROM on XLR boards +device ic +device iic +device iicbb +device iicbus +device ds1374u # RTC on XLR boards +device max6657 # Temparature sensor on XLR boards +device at24co2n # EEPROM on XLR boards #crypto # Not yet -#device cryptodev -#device crypto -#device rmisec +#device cryptodev +#device crypto +#device rmisec Modified: head/sys/mips/conf/XLR64 ============================================================================== --- head/sys/mips/conf/XLR64 Thu Jan 20 08:40:22 2011 (r217629) +++ head/sys/mips/conf/XLR64 Thu Jan 20 09:01:14 2011 (r217630) @@ -22,19 +22,21 @@ cpu CPU_RMI ident XLR64 makeoptions MODULES_OVERRIDE="" + include "../rmi/std.xlr" makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols makeoptions ARCH_FLAGS="-march=mips64 -mabi=64" makeoptions KERNLOADADDR=0xffffffff80100000 + options ISA_MIPS64 #profile 2 options SCHED_ULE # ULE scheduler -#options VERBOSE_SYSINIT +#options VERBOSE_SYSINIT #options SCHED_4BSD # 4BSD scheduler -#options SMP +options SMP #options PREEMPTION # Enable kernel thread preemption #options FULL_PREEMPTION # Enable kernel thread preemption options INET # InterNETworking @@ -43,20 +45,20 @@ options FFS # Berkeley Fast Filesyste #options SOFTUPDATES # Enable FFS soft updates support options UFS_ACL # Support for access control lists options UFS_DIRHASH # Improve performance on big directories -options NFSCLIENT -options NFS_ROOT +options NFSCLIENT +options NFS_ROOT # -options BOOTP -options BOOTP_NFSROOT -options BOOTP_NFSV3 -options BOOTP_WIRED_TO=nlge0 -options BOOTP_COMPAT -options ROOTDEVNAME=\"nfs:10.1.1.8:/usr/extra/nfsroot\" +options BOOTP +options BOOTP_NFSROOT +options BOOTP_NFSV3 +options BOOTP_WIRED_TO=nlge0 +options BOOTP_COMPAT +options ROOTDEVNAME=\"nfs:10.1.1.8:/usr/extra/nfsroot\" # #options MD_ROOT # MD is a potential root device -#options MD_ROOT_SIZE=27000 -#options MD_ROOT_SIZE=5120 -#options ROOTDEVNAME=\"ufs:md0\" +#options MD_ROOT_SIZE=27000 +#options MD_ROOT_SIZE=5120 +#options ROOTDEVNAME=\"ufs:md0\" options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions options HZ=1000 options NO_SWAPPING @@ -67,29 +69,28 @@ options DDB options KDB options GDB options ALT_BREAK_TO_DEBUGGER +options BREAK_TO_DEBUGGER #options DEADLKRES #Enable the deadlock resolver options INVARIANTS #Enable calls of extra sanity checking options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS #options WITNESS #Enable checks to detect deadlocks and cycles #options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed #options KTR # ktr(4) and ktrdump(8) support -#options KTR_COMPILE=(KTR_LOCK|KTR_PROC|KTR_INTR|KTR_CALLOUT|KTR_UMA|KTR_SYSC|KTR_CRITICAL) +#options KTR_COMPILE=(KTR_LOCK|KTR_PROC|KTR_INTR|KTR_CALLOUT|KTR_UMA|KTR_SYSC) #options KTR_ENTRIES=131072 -#options MUTEX_DEBUG -#options MUTEX_PROFILING + +#options LOCK_PROFILING +#options SLEEPQUEUE_PROFILING +#options TURNSTILE_PROFILING device pci #device ata #device atadisk -#options XLR_PERFMON # Enable XLR processor activity monitoring -options BREAK_TO_DEBUGGER -#device genclock device uart # Pseudo device loop device random device md -device mem device pty device bpf @@ -100,31 +101,27 @@ device ether device re device msk -device da -device scbus -#device ohci # OHCI PCI->USB interface -device ehci # EHCI PCI->USB interface (USB 2.0) -device usb # USB Bus (required) -options USB_DEBUG # enable debug msgs -#device udbp # USB Double Bulk Pipe devices -#device ugen # Generic -#device uhid # "Human Interface Devices" -device umass # Disks/Mass storage - Requires scbus and da +device da +device scbus +device ehci # EHCI PCI->USB interface (USB 2.0) +device usb # USB Bus (required) +options USB_DEBUG # enable debug msgs +#device uhid # "Human Interface Devices" +device umass # Disks/Mass storage - Requires scbus and da #device cfi #i2c -# Not yet -#device ic -#device iic -#device iicbb -#device iicbus -#device xlr_rtc -#device xlr_temperature -#device xlr_eeprom +device ic +device iic +device iicbb +device iicbus +device ds1374u # RTC on XLR boards +device max6657 # Temparature sensor on XLR boards +device at24co2n # EEPROM on XLR boards #crypto # Not yet -#device cryptodev -#device crypto -#device rmisec +#device cryptodev +#device crypto +#device rmisec Modified: head/sys/mips/conf/XLRN32 ============================================================================== --- head/sys/mips/conf/XLRN32 Thu Jan 20 08:40:22 2011 (r217629) +++ head/sys/mips/conf/XLRN32 Thu Jan 20 09:01:14 2011 (r217630) @@ -27,12 +27,12 @@ include "../rmi/std.xlr" makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols makeoptions ARCH_FLAGS="-march=mips64 -mabi=n32" makeoptions KERNLOADADDR=0x80100000 -options ISA_MIPS64 +options ISA_MIPS64 #profile 2 options SCHED_ULE # ULE scheduler -#options VERBOSE_SYSINIT +#options VERBOSE_SYSINIT #options SCHED_4BSD # 4BSD scheduler options SMP options PREEMPTION # Enable kernel thread preemption @@ -54,9 +54,9 @@ options BOOTP_COMPAT options ROOTDEVNAME=\"nfs:10.1.1.8:/usr/extra/nfsroot\" # #options MD_ROOT # MD is a potential root device -#options MD_ROOT_SIZE=27000 -#options MD_ROOT_SIZE=5120 -#options ROOTDEVNAME=\"ufs:md0\" +#options MD_ROOT_SIZE=27000 +#options MD_ROOT_SIZE=5120 +#options ROOTDEVNAME=\"ufs:md0\" options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions options HZ=1000 options NO_SWAPPING @@ -73,23 +73,23 @@ options INVARIANT_SUPPORT #Extra sanity #options WITNESS #Enable checks to detect deadlocks and cycles #options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed #options KTR # ktr(4) and ktrdump(8) support -#options KTR_COMPILE=(KTR_LOCK|KTR_PROC|KTR_INTR|KTR_CALLOUT|KTR_UMA|KTR_SYSC|KTR_CRITICAL) +#options KTR_COMPILE=(KTR_LOCK|KTR_PROC|KTR_INTR|KTR_CALLOUT|KTR_UMA|KTR_SYSC) #options KTR_ENTRIES=131072 -#options MUTEX_DEBUG -#options MUTEX_PROFILING + +#options LOCK_PROFILING +#options SLEEPQUEUE_PROFILING +#options TURNSTILE_PROFILING device pci #device ata #device atadisk #options XLR_PERFMON # Enable XLR processor activity monitoring options BREAK_TO_DEBUGGER -#device genclock device uart # Pseudo device loop device random device md -device mem device pty device bpf @@ -114,14 +114,13 @@ device umass # Disks/ #device cfi #i2c -# Not yet -#device ic -#device iic -#device iicbb -#device iicbus -#device xlr_rtc -#device xlr_temperature -#device xlr_eeprom +device ic +device iic +device iicbb +device iicbus +device ds1374u # RTC on XLR boards +device max6657 # Temparature sensor on XLR boards +device at24co2n # EEPROM on XLR boards #crypto # Not yet From owner-svn-src-all@FreeBSD.ORG Thu Jan 20 09:03:41 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 12311106566B; Thu, 20 Jan 2011 09:03:41 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F12EA8FC13; Thu, 20 Jan 2011 09:03:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0K93eCq007238; Thu, 20 Jan 2011 09:03:40 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0K93e1G007228; Thu, 20 Jan 2011 09:03:40 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201101200903.p0K93e1G007228@svn.freebsd.org> From: Adrian Chadd Date: Thu, 20 Jan 2011 09:03:40 +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: r217631 - in head/sys: conf dev/ath/ath_hal/ar5416 dev/ath/ath_hal/ar9001 dev/ath/ath_hal/ar9002 dev/ath/ath_hal/ar9003 modules/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jan 2011 09:03:41 -0000 Author: adrian Date: Thu Jan 20 09:03:40 2011 New Revision: 217631 URL: http://svn.freebsd.org/changeset/base/217631 Log: Push the non-AR5416 related stuff into chipset specific directories. sys/dev/ath/ath_hal/ar5416/ is getting very crowded and further commits will make it even more crowded. Now is a good time to shuffle these files out before any more extensive work is done on them. Create an ar9003 directory whilst I'm here; ar9003 specific chipset code will eventually live there. Added: head/sys/dev/ath/ath_hal/ar9001/ head/sys/dev/ath/ath_hal/ar9001/ar9160.ini - copied unchanged from r217617, head/sys/dev/ath/ath_hal/ar5416/ar9160.ini head/sys/dev/ath/ath_hal/ar9001/ar9160_attach.c - copied, changed from r217624, head/sys/dev/ath/ath_hal/ar5416/ar9160_attach.c head/sys/dev/ath/ath_hal/ar9002/ head/sys/dev/ath/ath_hal/ar9002/ar9280.c - copied, changed from r217617, head/sys/dev/ath/ath_hal/ar5416/ar9280.c head/sys/dev/ath/ath_hal/ar9002/ar9280.h - copied unchanged from r217617, head/sys/dev/ath/ath_hal/ar5416/ar9280.h head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c - copied, changed from r217624, head/sys/dev/ath/ath_hal/ar5416/ar9280_attach.c head/sys/dev/ath/ath_hal/ar9002/ar9280v1.ini - copied unchanged from r217617, head/sys/dev/ath/ath_hal/ar5416/ar9280v1.ini head/sys/dev/ath/ath_hal/ar9002/ar9280v2.ini - copied unchanged from r217617, head/sys/dev/ath/ath_hal/ar5416/ar9280v2.ini head/sys/dev/ath/ath_hal/ar9002/ar9285.c - copied, changed from r217617, head/sys/dev/ath/ath_hal/ar5416/ar9285.c head/sys/dev/ath/ath_hal/ar9002/ar9285.h - copied unchanged from r217617, head/sys/dev/ath/ath_hal/ar5416/ar9285.h head/sys/dev/ath/ath_hal/ar9002/ar9285.ini - copied unchanged from r217617, head/sys/dev/ath/ath_hal/ar5416/ar9285.ini head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c - copied, changed from r217624, head/sys/dev/ath/ath_hal/ar5416/ar9285_attach.c head/sys/dev/ath/ath_hal/ar9002/ar9285_reset.c - copied, changed from r217617, head/sys/dev/ath/ath_hal/ar5416/ar9285_reset.c head/sys/dev/ath/ath_hal/ar9002/ar9285v2.ini - copied unchanged from r217617, head/sys/dev/ath/ath_hal/ar5416/ar9285v2.ini head/sys/dev/ath/ath_hal/ar9003/ Deleted: head/sys/dev/ath/ath_hal/ar5416/ar9160.ini head/sys/dev/ath/ath_hal/ar5416/ar9160_attach.c head/sys/dev/ath/ath_hal/ar5416/ar9280.c head/sys/dev/ath/ath_hal/ar5416/ar9280.h head/sys/dev/ath/ath_hal/ar5416/ar9280_attach.c head/sys/dev/ath/ath_hal/ar5416/ar9280v1.ini head/sys/dev/ath/ath_hal/ar5416/ar9280v2.ini head/sys/dev/ath/ath_hal/ar5416/ar9285.c head/sys/dev/ath/ath_hal/ar5416/ar9285.h head/sys/dev/ath/ath_hal/ar5416/ar9285.ini head/sys/dev/ath/ath_hal/ar5416/ar9285_attach.c head/sys/dev/ath/ath_hal/ar5416/ar9285_reset.c head/sys/dev/ath/ath_hal/ar5416/ar9285v2.ini Modified: head/sys/conf/files head/sys/conf/options head/sys/modules/ath/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Jan 20 09:01:14 2011 (r217630) +++ head/sys/conf/files Thu Jan 20 09:03:40 2011 (r217631) @@ -737,16 +737,16 @@ dev/ath/ath_hal/ar5416/ar5416_xmit.c \ optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" # ar9160 (depends on ar5416) -dev/ath/ath_hal/ar5416/ar9160_attach.c optional ath_hal | ath_ar9160 \ +dev/ath/ath_hal/ar9001/ar9160_attach.c optional ath_hal | ath_ar9160 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" # ar9280 (depends on ar5416) -dev/ath/ath_hal/ar5416/ar9280_attach.c optional ath_hal | ath_ar9280 | \ +dev/ath/ath_hal/ar9002/ar9280_attach.c optional ath_hal | ath_ar9280 | \ ath_ar9285 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" # ar9285 (depends on ar5416 and ar9280) -dev/ath/ath_hal/ar5416/ar9285_attach.c optional ath_hal | ath_ar9285 \ +dev/ath/ath_hal/ar9002/ar9285_attach.c optional ath_hal | ath_ar9285 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" -dev/ath/ath_hal/ar5416/ar9285_reset.c optional ath_hal | ath_ar9285 \ +dev/ath/ath_hal/ar9002/ar9285_reset.c optional ath_hal | ath_ar9285 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" # rf backends dev/ath/ath_hal/ar5212/ar2316.c optional ath_rf2316 \ @@ -765,9 +765,9 @@ dev/ath/ath_hal/ar5212/ar5413.c optional compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5416/ar2133.c optional ath_hal | ath_ar5416 | ath_ar9160 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" -dev/ath/ath_hal/ar5416/ar9280.c optional ath_hal | ath_ar9280 | ath_ar9285 \ +dev/ath/ath_hal/ar9002/ar9280.c optional ath_hal | ath_ar9280 | ath_ar9285 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" -dev/ath/ath_hal/ar5416/ar9285.c optional ath_hal | ath_ar9285 \ +dev/ath/ath_hal/ar9002/ar9285.c optional ath_hal | ath_ar9285 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" # ath rate control algorithms dev/ath/ath_rate/amrr/amrr.c optional ath_rate_amrr \ Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Thu Jan 20 09:01:14 2011 (r217630) +++ head/sys/conf/options Thu Jan 20 09:03:40 2011 (r217631) @@ -650,6 +650,7 @@ UKBD_DFLT_KEYMAP opt_ukbd.h UPLCOM_INTR_INTERVAL opt_uplcom.h UVSCOM_DEFAULT_OPKTSIZE opt_uvscom.h UVSCOM_INTR_INTERVAL opt_uvscom.h +USB_HOST_ALIGN opt_usb.h # Embedded system options INIT_PATH Copied: head/sys/dev/ath/ath_hal/ar9001/ar9160.ini (from r217617, head/sys/dev/ath/ath_hal/ar5416/ar9160.ini) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/ath/ath_hal/ar9001/ar9160.ini Thu Jan 20 09:03:40 2011 (r217631, copy of r217617, head/sys/dev/ath/ath_hal/ar5416/ar9160.ini) @@ -0,0 +1,716 @@ +/* + * Copyright (c) 2002-2008 Sam Leffler, Errno Consulting + * Copyright (c) 2002-2009 Atheros Communications, Inc. + * + * Permission to use, copy, modify, and/or 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$ + */ +/* Auto Generated PCI Register Writes. Created: 05/22/08 */ + +static const uint32_t ar9160Modes[][6] = { + { 0x00001030, 0x00000230, 0x00000460, 0x000002c0, 0x00000160, 0x000001e0 }, + { 0x00001070, 0x00000168, 0x000002d0, 0x00000318, 0x0000018c, 0x000001e0 }, + { 0x000010b0, 0x00000e60, 0x00001cc0, 0x00007c70, 0x00003e38, 0x00001180 }, + { 0x000010f0, 0x0000a000, 0x00014000, 0x00016000, 0x0000b000, 0x00014008 }, + { 0x00008014, 0x03e803e8, 0x07d007d0, 0x10801600, 0x08400b00, 0x06e006e0 }, + { 0x0000801c, 0x128d93a7, 0x128d93cf, 0x12e013d7, 0x12e013ab, 0x098813cf }, + { 0x00009804, 0x00000300, 0x000003c4, 0x000003c4, 0x00000300, 0x00000303 }, + { 0x00009820, 0x02020200, 0x02020200, 0x02020200, 0x02020200, 0x02020200 }, + { 0x00009824, 0x00000e0e, 0x00000e0e, 0x00000e0e, 0x00000e0e, 0x00000e0e }, + { 0x00009828, 0x0a020001, 0x0a020001, 0x0a020001, 0x0a020001, 0x0a020001 }, + { 0x00009834, 0x00000e0e, 0x00000e0e, 0x00000e0e, 0x00000e0e, 0x00000e0e }, + { 0x00009838, 0x00000007, 0x00000007, 0x00000007, 0x00000007, 0x00000007 }, + { 0x00009844, 0x0372161e, 0x0372161e, 0x037216a0, 0x037216a0, 0x037216a0 }, + { 0x00009848, 0x001a6a65, 0x001a6a65, 0x00197a68, 0x00197a68, 0x00197a68 }, + { 0x0000a848, 0x001a6a65, 0x001a6a65, 0x00197a68, 0x00197a68, 0x00197a68 }, + { 0x0000b848, 0x001a6a65, 0x001a6a65, 0x00197a68, 0x00197a68, 0x00197a68 }, + { 0x00009850, 0x6c48b4e2, 0x6c48b4e2, 0x6c48b0e2, 0x6c48b0e2, 0x6c48b0e2 }, + { 0x00009858, 0x7ec82d2e, 0x7ec82d2e, 0x7ec82d2e, 0x7ec82d2e, 0x7ec82d2e }, + { 0x0000985c, 0x31395d5e, 0x31395d5e, 0x31395d5e, 0x31395d5e, 0x31395d5e }, + { 0x00009860, 0x00048d18, 0x00048d18, 0x00048d20, 0x00048d20, 0x00048d18 }, + { 0x00009864, 0x0001ce00, 0x0001ce00, 0x0001ce00, 0x0001ce00, 0x0001ce00 }, + { 0x0000c864, 0x0001ce00, 0x0001ce00, 0x0001ce00, 0x0001ce00, 0x0001ce00 }, + { 0x00009868, 0x409a40d0, 0x409a40d0, 0x409a40d0, 0x409a40d0, 0x409a40d0 }, + { 0x0000986c, 0x050cb081, 0x050cb081, 0x050cb081, 0x050cb081, 0x050cb081 }, + { 0x00009914, 0x000007d0, 0x00000fa0, 0x00001130, 0x00000898, 0x000007d0 }, + { 0x00009918, 0x0000000a, 0x00000014, 0x00000016, 0x0000000b, 0x00000016 }, + { 0x00009924, 0xd00a8a07, 0xd00a8a07, 0xd00a8a0d, 0xd00a8a0d, 0xd00a8a0d }, + { 0x00009944, 0xffb81020, 0xffb81020, 0xffb81020, 0xffb81020, 0xffb81020 }, + { 0x00009960, 0x00009b40, 0x00009b40, 0x00009b40, 0x00009b40, 0x00009b40 }, + { 0x0000a960, 0x00009b40, 0x00009b40, 0x00009b40, 0x00009b40, 0x00009b40 }, + { 0x0000b960, 0x00009b40, 0x00009b40, 0x00009b40, 0x00009b40, 0x00009b40 }, + { 0x00009964, 0x00001120, 0x00001120, 0x00001120, 0x00001120, 0x00001120 }, + { 0x0000c968, 0x000003b5, 0x000003b5, 0x000003ce, 0x000003ce, 0x000003ce }, + { 0x000099bc, 0x001a0600, 0x001a0600, 0x001a0c00, 0x001a0c00, 0x001a0c00 }, + { 0x0000c9bc, 0x001a0600, 0x001a0600, 0x001a0c00, 0x001a0c00, 0x001a0c00 }, + { 0x000099c0, 0x038919be, 0x038919be, 0x038919be, 0x038919be, 0x038919be }, + { 0x000099c4, 0x06336f77, 0x06336f77, 0x06336f77, 0x06336f77, 0x06336f77 }, + { 0x000099c8, 0x60f65329, 0x60f65329, 0x60f65329, 0x60f65329, 0x60f65329 }, + { 0x000099cc, 0x08f186c8, 0x08f186c8, 0x08f186c8, 0x08f186c8, 0x08f186c8 }, + { 0x000099d0, 0x00046384, 0x00046384, 0x00046384, 0x00046384, 0x00046384 }, + { 0x000099d4, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, + { 0x000099d8, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, + { 0x0000a204, 0x00000880, 0x00000880, 0x00000880, 0x00000880, 0x00000880 }, + { 0x0000a208, 0xd6be4788, 0xd6be4788, 0xd03e4788, 0xd03e4788, 0xd03e4788 }, + { 0x0000a20c, 0x002fc160, 0x002fc160, 0x002ac120, 0x002ac120, 0x002ac120 }, + { 0x0000b20c, 0x002fc160, 0x002fc160, 0x002ac120, 0x002ac120, 0x002ac120 }, + { 0x0000c20c, 0x002fc160, 0x002fc160, 0x002ac120, 0x002ac120, 0x002ac120 }, + { 0x0000a21c, 0x1883800a, 0x1883800a, 0x1883800a, 0x1883800a, 0x1883800a }, + { 0x0000a230, 0x00000000, 0x00000000, 0x00000210, 0x00000108, 0x00000000 }, + { 0x0000a274, 0x0a1a9caa, 0x0a1a9caa, 0x0a1a7caa, 0x0a1a7caa, 0x0a1a7caa }, + { 0x0000a300, 0x18010000, 0x18010000, 0x18010000, 0x18010000, 0x18010000 }, + { 0x0000a304, 0x30032602, 0x30032602, 0x2e032402, 0x2e032402, 0x2e032402 }, + { 0x0000a308, 0x48073e06, 0x48073e06, 0x4a0a3c06, 0x4a0a3c06, 0x4a0a3c06 }, + { 0x0000a30c, 0x560b4c0a, 0x560b4c0a, 0x621a540b, 0x621a540b, 0x621a540b }, + { 0x0000a310, 0x641a600f, 0x641a600f, 0x764f6c1b, 0x764f6c1b, 0x764f6c1b }, + { 0x0000a314, 0x7a4f6e1b, 0x7a4f6e1b, 0x845b7a5a, 0x845b7a5a, 0x845b7a5a }, + { 0x0000a318, 0x8c5b7e5a, 0x8c5b7e5a, 0x950f8ccf, 0x950f8ccf, 0x950f8ccf }, + { 0x0000a31c, 0x9d0f96cf, 0x9d0f96cf, 0xa5cf9b4f, 0xa5cf9b4f, 0xa5cf9b4f }, + { 0x0000a320, 0xb51fa69f, 0xb51fa69f, 0xbddfaf1f, 0xbddfaf1f, 0xbddfaf1f }, + { 0x0000a324, 0xcb3fbd07, 0xcb3fbcbf, 0xd1ffc93f, 0xd1ffc93f, 0xd1ffc93f }, + { 0x0000a328, 0x0000d7bf, 0x0000d7bf, 0x00000000, 0x00000000, 0x00000000 }, + { 0x0000a32c, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, + { 0x0000a330, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, + { 0x0000a334, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, +}; + +static const uint32_t ar9160Common[][2] = { + { 0x0000000c, 0x00000000 }, + { 0x00000030, 0x00020015 }, + { 0x00000034, 0x00000005 }, + { 0x00000040, 0x00000000 }, + { 0x00000044, 0x00000008 }, + { 0x00000048, 0x00000008 }, + { 0x0000004c, 0x00000010 }, + { 0x00000050, 0x00000000 }, + { 0x00000054, 0x0000001f }, + { 0x00000800, 0x00000000 }, + { 0x00000804, 0x00000000 }, + { 0x00000808, 0x00000000 }, + { 0x0000080c, 0x00000000 }, + { 0x00000810, 0x00000000 }, + { 0x00000814, 0x00000000 }, + { 0x00000818, 0x00000000 }, + { 0x0000081c, 0x00000000 }, + { 0x00000820, 0x00000000 }, + { 0x00000824, 0x00000000 }, + { 0x00001040, 0x002ffc0f }, + { 0x00001044, 0x002ffc0f }, + { 0x00001048, 0x002ffc0f }, + { 0x0000104c, 0x002ffc0f }, + { 0x00001050, 0x002ffc0f }, + { 0x00001054, 0x002ffc0f }, + { 0x00001058, 0x002ffc0f }, + { 0x0000105c, 0x002ffc0f }, + { 0x00001060, 0x002ffc0f }, + { 0x00001064, 0x002ffc0f }, + { 0x00001230, 0x00000000 }, + { 0x00001270, 0x00000000 }, + { 0x00001038, 0x00000000 }, + { 0x00001078, 0x00000000 }, + { 0x000010b8, 0x00000000 }, + { 0x000010f8, 0x00000000 }, + { 0x00001138, 0x00000000 }, + { 0x00001178, 0x00000000 }, + { 0x000011b8, 0x00000000 }, + { 0x000011f8, 0x00000000 }, + { 0x00001238, 0x00000000 }, + { 0x00001278, 0x00000000 }, + { 0x000012b8, 0x00000000 }, + { 0x000012f8, 0x00000000 }, + { 0x00001338, 0x00000000 }, + { 0x00001378, 0x00000000 }, + { 0x000013b8, 0x00000000 }, + { 0x000013f8, 0x00000000 }, + { 0x00001438, 0x00000000 }, + { 0x00001478, 0x00000000 }, + { 0x000014b8, 0x00000000 }, + { 0x000014f8, 0x00000000 }, + { 0x00001538, 0x00000000 }, + { 0x00001578, 0x00000000 }, + { 0x000015b8, 0x00000000 }, + { 0x000015f8, 0x00000000 }, + { 0x00001638, 0x00000000 }, + { 0x00001678, 0x00000000 }, + { 0x000016b8, 0x00000000 }, + { 0x000016f8, 0x00000000 }, + { 0x00001738, 0x00000000 }, + { 0x00001778, 0x00000000 }, + { 0x000017b8, 0x00000000 }, + { 0x000017f8, 0x00000000 }, + { 0x0000103c, 0x00000000 }, + { 0x0000107c, 0x00000000 }, + { 0x000010bc, 0x00000000 }, + { 0x000010fc, 0x00000000 }, + { 0x0000113c, 0x00000000 }, + { 0x0000117c, 0x00000000 }, + { 0x000011bc, 0x00000000 }, + { 0x000011fc, 0x00000000 }, + { 0x0000123c, 0x00000000 }, + { 0x0000127c, 0x00000000 }, + { 0x000012bc, 0x00000000 }, + { 0x000012fc, 0x00000000 }, + { 0x0000133c, 0x00000000 }, + { 0x0000137c, 0x00000000 }, + { 0x000013bc, 0x00000000 }, + { 0x000013fc, 0x00000000 }, + { 0x0000143c, 0x00000000 }, + { 0x0000147c, 0x00000000 }, + { 0x00004030, 0x00000002 }, + { 0x0000403c, 0x00000002 }, + { 0x00007010, 0x00000020 }, + { 0x00007038, 0x000004c2 }, + { 0x00008004, 0x00000000 }, + { 0x00008008, 0x00000000 }, + { 0x0000800c, 0x00000000 }, + { 0x00008018, 0x00000700 }, + { 0x00008020, 0x00000000 }, + { 0x00008038, 0x00000000 }, + { 0x0000803c, 0x00000000 }, + { 0x00008048, 0x40000000 }, + { 0x00008054, 0x00000000 }, + { 0x00008058, 0x00000000 }, + { 0x0000805c, 0x000fc78f }, + { 0x00008060, 0x0000000f }, + { 0x00008064, 0x00000000 }, + { 0x000080c0, 0x2a82301a }, + { 0x000080c4, 0x05dc01e0 }, + { 0x000080c8, 0x1f402710 }, + { 0x000080cc, 0x01f40000 }, + { 0x000080d0, 0x00001e00 }, + { 0x000080d4, 0x00000000 }, + { 0x000080d8, 0x00400000 }, + { 0x000080e0, 0xffffffff }, + { 0x000080e4, 0x0000ffff }, + { 0x000080e8, 0x003f3f3f }, + { 0x000080ec, 0x00000000 }, + { 0x000080f0, 0x00000000 }, + { 0x000080f4, 0x00000000 }, + { 0x000080f8, 0x00000000 }, + { 0x000080fc, 0x00020000 }, + { 0x00008100, 0x00020000 }, + { 0x00008104, 0x00000001 }, + { 0x00008108, 0x00000052 }, + { 0x0000810c, 0x00000000 }, + { 0x00008110, 0x00000168 }, + { 0x00008118, 0x000100aa }, + { 0x0000811c, 0x00003210 }, + { 0x00008120, 0x08f04800 }, + { 0x00008124, 0x00000000 }, + { 0x00008128, 0x00000000 }, + { 0x0000812c, 0x00000000 }, + { 0x00008130, 0x00000000 }, + { 0x00008134, 0x00000000 }, + { 0x00008138, 0x00000000 }, + { 0x0000813c, 0x00000000 }, + { 0x00008144, 0xffffffff }, + { 0x00008168, 0x00000000 }, + { 0x0000816c, 0x00000000 }, + { 0x00008170, 0x32143320 }, + { 0x00008174, 0xfaa4fa50 }, + { 0x00008178, 0x00000100 }, + { 0x0000817c, 0x00000000 }, + { 0x000081c4, 0x00000000 }, + { 0x000081d0, 0x00003210 }, + { 0x000081ec, 0x00000000 }, + { 0x000081f0, 0x00000000 }, + { 0x000081f4, 0x00000000 }, + { 0x000081f8, 0x00000000 }, + { 0x000081fc, 0x00000000 }, + { 0x00008200, 0x00000000 }, + { 0x00008204, 0x00000000 }, + { 0x00008208, 0x00000000 }, + { 0x0000820c, 0x00000000 }, + { 0x00008210, 0x00000000 }, + { 0x00008214, 0x00000000 }, + { 0x00008218, 0x00000000 }, + { 0x0000821c, 0x00000000 }, + { 0x00008220, 0x00000000 }, + { 0x00008224, 0x00000000 }, + { 0x00008228, 0x00000000 }, + { 0x0000822c, 0x00000000 }, + { 0x00008230, 0x00000000 }, + { 0x00008234, 0x00000000 }, + { 0x00008238, 0x00000000 }, + { 0x0000823c, 0x00000000 }, + { 0x00008240, 0x00100000 }, + { 0x00008244, 0x0010f400 }, + { 0x00008248, 0x00000100 }, + { 0x0000824c, 0x0001e800 }, + { 0x00008250, 0x00000000 }, + { 0x00008254, 0x00000000 }, + { 0x00008258, 0x00000000 }, + { 0x0000825c, 0x400000ff }, + { 0x00008260, 0x00080922 }, + { 0x00008270, 0x00000000 }, + { 0x00008274, 0x40000000 }, + { 0x00008278, 0x003e4180 }, + { 0x0000827c, 0x00000000 }, + { 0x00008284, 0x0000002c }, + { 0x00008288, 0x0000002c }, + { 0x0000828c, 0x00000000 }, + { 0x00008294, 0x00000000 }, + { 0x00008298, 0x00000000 }, + { 0x00008300, 0x00000000 }, + { 0x00008304, 0x00000000 }, + { 0x00008308, 0x00000000 }, + { 0x0000830c, 0x00000000 }, + { 0x00008310, 0x00000000 }, + { 0x00008314, 0x00000000 }, + { 0x00008318, 0x00000000 }, + { 0x00008328, 0x00000000 }, + { 0x0000832c, 0x00000007 }, + { 0x00008330, 0x00000302 }, + { 0x00008334, 0x00000e00 }, + { 0x00008338, 0x00ff0000 }, + { 0x0000833c, 0x00000000 }, + { 0x00008340, 0x000107ff }, + { 0x00009808, 0x00000000 }, + { 0x0000980c, 0xad848e19 }, + { 0x00009810, 0x7d14e000 }, + { 0x00009814, 0x9c0a9f6b }, + { 0x0000981c, 0x00000000 }, + { 0x0000982c, 0x0000a000 }, + { 0x00009830, 0x00000000 }, + { 0x0000983c, 0x00200400 }, + { 0x00009840, 0x206a01ae }, + { 0x0000984c, 0x1284233c }, + { 0x00009854, 0x00000859 }, + { 0x00009900, 0x00000000 }, + { 0x00009904, 0x00000000 }, + { 0x00009908, 0x00000000 }, + { 0x0000990c, 0x00000000 }, + { 0x0000991c, 0x10000fff }, + { 0x00009920, 0x05100000 }, + { 0x0000a920, 0x05100000 }, + { 0x0000b920, 0x05100000 }, + { 0x00009928, 0x00000001 }, + { 0x0000992c, 0x00000004 }, + { 0x00009934, 0x1e1f2022 }, + { 0x00009938, 0x0a0b0c0d }, + { 0x0000993c, 0x00000000 }, + { 0x00009948, 0x9280b212 }, + { 0x0000994c, 0x00020028 }, + { 0x00009954, 0x5f3ca3de }, + { 0x00009958, 0x2108ecff }, + { 0x00009940, 0x00750604 }, + { 0x0000c95c, 0x004b6a8e }, + { 0x00009970, 0x190fb515 }, + { 0x00009974, 0x00000000 }, + { 0x00009978, 0x00000001 }, + { 0x0000997c, 0x00000000 }, + { 0x00009980, 0x00000000 }, + { 0x00009984, 0x00000000 }, + { 0x00009988, 0x00000000 }, + { 0x0000998c, 0x00000000 }, + { 0x00009990, 0x00000000 }, + { 0x00009994, 0x00000000 }, + { 0x00009998, 0x00000000 }, + { 0x0000999c, 0x00000000 }, + { 0x000099a0, 0x00000000 }, + { 0x000099a4, 0x00000001 }, + { 0x000099a8, 0x201fff00 }, + { 0x000099ac, 0x006f0000 }, + { 0x000099b0, 0x03051000 }, + { 0x000099dc, 0x00000000 }, + { 0x000099e0, 0x00000200 }, + { 0x000099e4, 0xaaaaaaaa }, + { 0x000099e8, 0x3c466478 }, + { 0x000099ec, 0x0cc80caa }, + { 0x000099f0, 0x00000000 }, /* XXX adrian's addition: AR_PHY_CALMODE == 0 */ + { 0x000099fc, 0x00001042 }, + { 0x00009b00, 0x00000000 }, + { 0x00009b04, 0x00000001 }, + { 0x00009b08, 0x00000002 }, + { 0x00009b0c, 0x00000003 }, + { 0x00009b10, 0x00000004 }, + { 0x00009b14, 0x00000005 }, + { 0x00009b18, 0x00000008 }, + { 0x00009b1c, 0x00000009 }, + { 0x00009b20, 0x0000000a }, + { 0x00009b24, 0x0000000b }, + { 0x00009b28, 0x0000000c }, + { 0x00009b2c, 0x0000000d }, + { 0x00009b30, 0x00000010 }, + { 0x00009b34, 0x00000011 }, + { 0x00009b38, 0x00000012 }, + { 0x00009b3c, 0x00000013 }, + { 0x00009b40, 0x00000014 }, + { 0x00009b44, 0x00000015 }, + { 0x00009b48, 0x00000018 }, + { 0x00009b4c, 0x00000019 }, + { 0x00009b50, 0x0000001a }, + { 0x00009b54, 0x0000001b }, + { 0x00009b58, 0x0000001c }, + { 0x00009b5c, 0x0000001d }, + { 0x00009b60, 0x00000020 }, + { 0x00009b64, 0x00000021 }, + { 0x00009b68, 0x00000022 }, + { 0x00009b6c, 0x00000023 }, + { 0x00009b70, 0x00000024 }, + { 0x00009b74, 0x00000025 }, + { 0x00009b78, 0x00000028 }, + { 0x00009b7c, 0x00000029 }, + { 0x00009b80, 0x0000002a }, + { 0x00009b84, 0x0000002b }, + { 0x00009b88, 0x0000002c }, + { 0x00009b8c, 0x0000002d }, + { 0x00009b90, 0x00000030 }, + { 0x00009b94, 0x00000031 }, + { 0x00009b98, 0x00000032 }, + { 0x00009b9c, 0x00000033 }, + { 0x00009ba0, 0x00000034 }, + { 0x00009ba4, 0x00000035 }, + { 0x00009ba8, 0x00000035 }, + { 0x00009bac, 0x00000035 }, + { 0x00009bb0, 0x00000035 }, + { 0x00009bb4, 0x00000035 }, + { 0x00009bb8, 0x00000035 }, + { 0x00009bbc, 0x00000035 }, + { 0x00009bc0, 0x00000035 }, + { 0x00009bc4, 0x00000035 }, + { 0x00009bc8, 0x00000035 }, + { 0x00009bcc, 0x00000035 }, + { 0x00009bd0, 0x00000035 }, + { 0x00009bd4, 0x00000035 }, + { 0x00009bd8, 0x00000035 }, + { 0x00009bdc, 0x00000035 }, + { 0x00009be0, 0x00000035 }, + { 0x00009be4, 0x00000035 }, + { 0x00009be8, 0x00000035 }, + { 0x00009bec, 0x00000035 }, + { 0x00009bf0, 0x00000035 }, + { 0x00009bf4, 0x00000035 }, + { 0x00009bf8, 0x00000010 }, + { 0x00009bfc, 0x0000001a }, + { 0x0000a210, 0x40806333 }, + { 0x0000a214, 0x00106c10 }, + { 0x0000a218, 0x009c4060 }, + { 0x0000a220, 0x018830c6 }, + { 0x0000a224, 0x00000400 }, + { 0x0000a228, 0x001a0bb5 }, + { 0x0000a22c, 0x00000000 }, + { 0x0000a234, 0x20202020 }, + { 0x0000a238, 0x20202020 }, + { 0x0000a23c, 0x13c889af }, + { 0x0000a240, 0x38490a20 }, + { 0x0000a244, 0x00007bb6 }, + { 0x0000a248, 0x0fff3ffc }, + { 0x0000a24c, 0x00000001 }, + { 0x0000a250, 0x0000e000 }, + { 0x0000a254, 0x00000000 }, + { 0x0000a258, 0x0cc75380 }, + { 0x0000a25c, 0x0f0f0f01 }, + { 0x0000a260, 0xdfa91f01 }, + { 0x0000a268, 0x00000001 }, + { 0x0000a26c, 0x0ebae9c6 }, + { 0x0000b26c, 0x0ebae9c6 }, + { 0x0000c26c, 0x0ebae9c6 }, + { 0x0000d270, 0x00820820 }, + { 0x0000a278, 0x1ce739ce }, + { 0x0000a27c, 0x050701ce }, + { 0x0000a338, 0x00000000 }, + { 0x0000a33c, 0x00000000 }, + { 0x0000a340, 0x00000000 }, + { 0x0000a344, 0x00000000 }, + { 0x0000a348, 0x3fffffff }, + { 0x0000a34c, 0x3fffffff }, + { 0x0000a350, 0x3fffffff }, + { 0x0000a354, 0x0003ffff }, + { 0x0000a358, 0x79bfaa03 }, + { 0x0000d35c, 0x07ffffef }, + { 0x0000d360, 0x0fffffe7 }, + { 0x0000d364, 0x17ffffe5 }, + { 0x0000d368, 0x1fffffe4 }, + { 0x0000d36c, 0x37ffffe3 }, + { 0x0000d370, 0x3fffffe3 }, + { 0x0000d374, 0x57ffffe3 }, + { 0x0000d378, 0x5fffffe2 }, + { 0x0000d37c, 0x7fffffe2 }, + { 0x0000d380, 0x7f3c7bba }, + { 0x0000d384, 0xf3307ff0 }, + { 0x0000a388, 0x0c000000 }, + { 0x0000a38c, 0x20202020 }, + { 0x0000a390, 0x20202020 }, + { 0x0000a394, 0x1ce739ce }, + { 0x0000a398, 0x000001ce }, + { 0x0000a39c, 0x00000001 }, + { 0x0000a3a0, 0x00000000 }, + { 0x0000a3a4, 0x00000000 }, + { 0x0000a3a8, 0x00000000 }, + { 0x0000a3ac, 0x00000000 }, + { 0x0000a3b0, 0x00000000 }, + { 0x0000a3b4, 0x00000000 }, + { 0x0000a3b8, 0x00000000 }, + { 0x0000a3bc, 0x00000000 }, + { 0x0000a3c0, 0x00000000 }, + { 0x0000a3c4, 0x00000000 }, + { 0x0000a3c8, 0x00000246 }, + { 0x0000a3cc, 0x20202020 }, + { 0x0000a3d0, 0x20202020 }, + { 0x0000a3d4, 0x20202020 }, + { 0x0000a3dc, 0x1ce739ce }, + { 0x0000a3e0, 0x000001ce }, +}; + +static const uint32_t ar9160Bank0[][2] = { + { 0x000098b0, 0x1e5795e5 }, + { 0x000098e0, 0x02008020 }, +}; + +static const uint32_t ar9160BB_RfGain[][3] = { + { 0x00009a00, 0x00000000, 0x00000000 }, + { 0x00009a04, 0x00000040, 0x00000040 }, + { 0x00009a08, 0x00000080, 0x00000080 }, + { 0x00009a0c, 0x000001a1, 0x00000141 }, + { 0x00009a10, 0x000001e1, 0x00000181 }, + { 0x00009a14, 0x00000021, 0x000001c1 }, + { 0x00009a18, 0x00000061, 0x00000001 }, + { 0x00009a1c, 0x00000168, 0x00000041 }, + { 0x00009a20, 0x000001a8, 0x000001a8 }, + { 0x00009a24, 0x000001e8, 0x000001e8 }, + { 0x00009a28, 0x00000028, 0x00000028 }, + { 0x00009a2c, 0x00000068, 0x00000068 }, + { 0x00009a30, 0x00000189, 0x000000a8 }, + { 0x00009a34, 0x000001c9, 0x00000169 }, + { 0x00009a38, 0x00000009, 0x000001a9 }, + { 0x00009a3c, 0x00000049, 0x000001e9 }, + { 0x00009a40, 0x00000089, 0x00000029 }, + { 0x00009a44, 0x00000170, 0x00000069 }, + { 0x00009a48, 0x000001b0, 0x00000190 }, + { 0x00009a4c, 0x000001f0, 0x000001d0 }, + { 0x00009a50, 0x00000030, 0x00000010 }, + { 0x00009a54, 0x00000070, 0x00000050 }, + { 0x00009a58, 0x00000191, 0x00000090 }, + { 0x00009a5c, 0x000001d1, 0x00000151 }, + { 0x00009a60, 0x00000011, 0x00000191 }, + { 0x00009a64, 0x00000051, 0x000001d1 }, + { 0x00009a68, 0x00000091, 0x00000011 }, + { 0x00009a6c, 0x000001b8, 0x00000051 }, + { 0x00009a70, 0x000001f8, 0x00000198 }, + { 0x00009a74, 0x00000038, 0x000001d8 }, + { 0x00009a78, 0x00000078, 0x00000018 }, + { 0x00009a7c, 0x00000199, 0x00000058 }, + { 0x00009a80, 0x000001d9, 0x00000098 }, + { 0x00009a84, 0x00000019, 0x00000159 }, + { 0x00009a88, 0x00000059, 0x00000199 }, + { 0x00009a8c, 0x00000099, 0x000001d9 }, + { 0x00009a90, 0x000000d9, 0x00000019 }, + { 0x00009a94, 0x000000f9, 0x00000059 }, + { 0x00009a98, 0x000000f9, 0x00000099 }, + { 0x00009a9c, 0x000000f9, 0x000000d9 }, + { 0x00009aa0, 0x000000f9, 0x000000f9 }, + { 0x00009aa4, 0x000000f9, 0x000000f9 }, + { 0x00009aa8, 0x000000f9, 0x000000f9 }, + { 0x00009aac, 0x000000f9, 0x000000f9 }, + { 0x00009ab0, 0x000000f9, 0x000000f9 }, + { 0x00009ab4, 0x000000f9, 0x000000f9 }, + { 0x00009ab8, 0x000000f9, 0x000000f9 }, + { 0x00009abc, 0x000000f9, 0x000000f9 }, + { 0x00009ac0, 0x000000f9, 0x000000f9 }, + { 0x00009ac4, 0x000000f9, 0x000000f9 }, + { 0x00009ac8, 0x000000f9, 0x000000f9 }, + { 0x00009acc, 0x000000f9, 0x000000f9 }, + { 0x00009ad0, 0x000000f9, 0x000000f9 }, + { 0x00009ad4, 0x000000f9, 0x000000f9 }, + { 0x00009ad8, 0x000000f9, 0x000000f9 }, + { 0x00009adc, 0x000000f9, 0x000000f9 }, + { 0x00009ae0, 0x000000f9, 0x000000f9 }, + { 0x00009ae4, 0x000000f9, 0x000000f9 }, + { 0x00009ae8, 0x000000f9, 0x000000f9 }, + { 0x00009aec, 0x000000f9, 0x000000f9 }, + { 0x00009af0, 0x000000f9, 0x000000f9 }, + { 0x00009af4, 0x000000f9, 0x000000f9 }, + { 0x00009af8, 0x000000f9, 0x000000f9 }, + { 0x00009afc, 0x000000f9, 0x000000f9 }, +}; + +static const uint32_t ar9160Bank1[][2] = { + { 0x000098b0, 0x02108421 }, + { 0x000098ec, 0x00000008 }, +}; + +static const uint32_t ar9160Bank2[][2] = { + { 0x000098b0, 0x0e73ff17 }, + { 0x000098e0, 0x00000420 }, +}; + +static const uint32_t ar9160Bank3[][3] = { + { 0x000098f0, 0x01400018, 0x01c00018 }, +}; + +static const uint32_t ar9160Bank6[][3] = { +/* Reg A G */ + { 0x0000989c, 0x00000000, 0x00000000 }, + { 0x0000989c, 0x00000000, 0x00000000 }, + { 0x0000989c, 0x00000000, 0x00000000 }, + { 0x0000989c, 0x00e00000, 0x00e00000 }, + { 0x0000989c, 0x005e0000, 0x005e0000 }, + { 0x0000989c, 0x00120000, 0x00120000 }, + { 0x0000989c, 0x00620000, 0x00620000 }, + { 0x0000989c, 0x00020000, 0x00020000 }, + { 0x0000989c, 0x00ff0000, 0x00ff0000 }, + { 0x0000989c, 0x00ff0000, 0x00ff0000 }, + { 0x0000989c, 0x00ff0000, 0x00ff0000 }, + { 0x0000989c, 0x40ff0000, 0x40ff0000 }, + { 0x0000989c, 0x005f0000, 0x005f0000 }, + { 0x0000989c, 0x00870000, 0x00870000 }, + { 0x0000989c, 0x00f90000, 0x00f90000 }, + { 0x0000989c, 0x007b0000, 0x007b0000 }, + { 0x0000989c, 0x00ff0000, 0x00ff0000 }, + { 0x0000989c, 0x00f50000, 0x00f50000 }, + { 0x0000989c, 0x00dc0000, 0x00dc0000 }, + { 0x0000989c, 0x00110000, 0x00110000 }, + { 0x0000989c, 0x006100a8, 0x006100a8 }, + { 0x0000989c, 0x004210a2, 0x004210a2 }, + { 0x0000989c, 0x0014008f, 0x0014008f }, + { 0x0000989c, 0x00c40003, 0x00c40003 }, + { 0x0000989c, 0x003000f2, 0x003000f2 }, + { 0x0000989c, 0x00440016, 0x00440016 }, + { 0x0000989c, 0x00410040, 0x00410040 }, + { 0x0000989c, 0x0001805e, 0x0001805e }, + { 0x0000989c, 0x0000c0ab, 0x0000c0ab }, + { 0x0000989c, 0x000000f1, 0x000000f1 }, + { 0x0000989c, 0x00002081, 0x00002081 }, + { 0x0000989c, 0x000000d4, 0x000000d4 }, + { 0x000098d0, 0x0000000f, 0x0010000f }, +}; + +static const uint32_t ar9160Bank6TPC[][3] = { + { 0x0000989c, 0x00000000, 0x00000000 }, + { 0x0000989c, 0x00000000, 0x00000000 }, + { 0x0000989c, 0x00000000, 0x00000000 }, + { 0x0000989c, 0x00e00000, 0x00e00000 }, + { 0x0000989c, 0x005e0000, 0x005e0000 }, + { 0x0000989c, 0x00120000, 0x00120000 }, + { 0x0000989c, 0x00620000, 0x00620000 }, + { 0x0000989c, 0x00020000, 0x00020000 }, + { 0x0000989c, 0x00ff0000, 0x00ff0000 }, + { 0x0000989c, 0x00ff0000, 0x00ff0000 }, + { 0x0000989c, 0x00ff0000, 0x00ff0000 }, + { 0x0000989c, 0x40ff0000, 0x40ff0000 }, + { 0x0000989c, 0x005f0000, 0x005f0000 }, + { 0x0000989c, 0x00870000, 0x00870000 }, + { 0x0000989c, 0x00f90000, 0x00f90000 }, + { 0x0000989c, 0x007b0000, 0x007b0000 }, + { 0x0000989c, 0x00ff0000, 0x00ff0000 }, + { 0x0000989c, 0x00f50000, 0x00f50000 }, + { 0x0000989c, 0x00dc0000, 0x00dc0000 }, + { 0x0000989c, 0x00110000, 0x00110000 }, + { 0x0000989c, 0x006100a8, 0x006100a8 }, + { 0x0000989c, 0x00423022, 0x00423022 }, + { 0x0000989c, 0x2014008f, 0x2014008f }, + { 0x0000989c, 0x00c40002, 0x00c40002 }, + { 0x0000989c, 0x003000f2, 0x003000f2 }, + { 0x0000989c, 0x00440016, 0x00440016 }, + { 0x0000989c, 0x00410040, 0x00410040 }, + { 0x0000989c, 0x0001805e, 0x0001805e }, + { 0x0000989c, 0x0000c0ab, 0x0000c0ab }, + { 0x0000989c, 0x000000e1, 0x000000e1 }, + { 0x0000989c, 0x00007080, 0x00007080 }, + { 0x0000989c, 0x000000d4, 0x000000d4 }, + { 0x000098d0, 0x0000000f, 0x0010000f }, +}; + +static const uint32_t ar9160Bank7[][2] = { + { 0x0000989c, 0x00000500 }, + { 0x0000989c, 0x00000800 }, + { 0x000098cc, 0x0000000e }, +}; + +/* Auto generated PCI Register Writes for SOWL1.0 ADDAC Shift Chain */ +static const uint32_t ar9160Addac[][2] = { + {0x0000989c, 0x00000000 }, + {0x0000989c, 0x00000000 }, + {0x0000989c, 0x00000000 }, + {0x0000989c, 0x00000000 }, + {0x0000989c, 0x00000000 }, + {0x0000989c, 0x00000000 }, + {0x0000989c, 0x000000c0 }, + {0x0000989c, 0x00000018 }, + {0x0000989c, 0x00000004 }, + {0x0000989c, 0x00000000 }, + {0x0000989c, 0x00000000 }, + {0x0000989c, 0x00000000 }, + {0x0000989c, 0x00000000 }, + {0x0000989c, 0x00000000 }, + {0x0000989c, 0x00000000 }, + {0x0000989c, 0x00000000 }, + {0x0000989c, 0x00000000 }, + {0x0000989c, 0x00000000 }, + {0x0000989c, 0x00000000 }, + {0x0000989c, 0x00000000 }, + {0x0000989c, 0x00000000 }, + {0x0000989c, 0x000000c0 }, + {0x0000989c, 0x00000019 }, + {0x0000989c, 0x00000004 }, + {0x0000989c, 0x00000000 }, + {0x0000989c, 0x00000000 }, + {0x0000989c, 0x00000000 }, + {0x0000989c, 0x00000004 }, + {0x0000989c, 0x00000003 }, + {0x0000989c, 0x00000008 }, + {0x0000989c, 0x00000000 }, + {0x000098cc, 0x00000000 }, +}; + +/* Auto generated PCI Register Writes for SOWL1.1 ADDAC Shift Chain */ +static const uint32_t ar9160Addac_1_1[][2] = { + {0x0000989c, 0x00000000 }, + {0x0000989c, 0x00000000 }, + {0x0000989c, 0x00000000 }, + {0x0000989c, 0x00000000 }, + {0x0000989c, 0x00000000 }, + {0x0000989c, 0x00000000 }, + {0x0000989c, 0x000000c0 }, + {0x0000989c, 0x00000018 }, + {0x0000989c, 0x00000004 }, + {0x0000989c, 0x00000000 }, + {0x0000989c, 0x00000000 }, + {0x0000989c, 0x00000000 }, + {0x0000989c, 0x00000000 }, + {0x0000989c, 0x00000000 }, + {0x0000989c, 0x00000000 }, + {0x0000989c, 0x00000000 }, + {0x0000989c, 0x00000000 }, + {0x0000989c, 0x00000000 }, + {0x0000989c, 0x00000000 }, + {0x0000989c, 0x00000000 }, + {0x0000989c, 0x00000000 }, + {0x0000989c, 0x000000c0 }, + {0x0000989c, 0x00000019 }, + {0x0000989c, 0x00000004 }, + {0x0000989c, 0x00000000 }, + {0x0000989c, 0x00000000 }, + {0x0000989c, 0x00000000 }, + {0x0000989c, 0x00000000 }, + {0x0000989c, 0x00000000 }, + {0x0000989c, 0x00000000 }, + {0x0000989c, 0x00000000 }, + {0x000098cc, 0x00000000 }, +}; + +/* hand-crafted from code that does explicit register writes */ +static const uint32_t ar9160PciePhy[][2] = { + { AR_PCIE_SERDES, 0x9248fc00 }, + { AR_PCIE_SERDES, 0x24924924 }, + { AR_PCIE_SERDES, 0x28000039 }, + { AR_PCIE_SERDES, 0x53160824 }, + { AR_PCIE_SERDES, 0xe5980579 }, + { AR_PCIE_SERDES, 0x001defff }, + { AR_PCIE_SERDES, 0x1aaabe40 }, + { AR_PCIE_SERDES, 0xbe105554 }, + { AR_PCIE_SERDES, 0x000e3007 }, + { AR_PCIE_SERDES2, 0x00000000 }, +}; Copied and modified: head/sys/dev/ath/ath_hal/ar9001/ar9160_attach.c (from r217624, head/sys/dev/ath/ath_hal/ar5416/ar9160_attach.c) ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar9160_attach.c Thu Jan 20 07:56:09 2011 (r217624, copy source) +++ head/sys/dev/ath/ath_hal/ar9001/ar9160_attach.c Thu Jan 20 09:03:40 2011 (r217631) @@ -26,7 +26,7 @@ #include "ar5416/ar5416reg.h" #include "ar5416/ar5416phy.h" -#include "ar5416/ar9160.ini" +#include "ar9001/ar9160.ini" static const HAL_PERCAL_DATA ar9160_iq_cal = { /* multi sample */ .calName = "IQ", .calType = IQ_MISMATCH_CAL, Copied and modified: head/sys/dev/ath/ath_hal/ar9002/ar9280.c (from r217617, head/sys/dev/ath/ath_hal/ar5416/ar9280.c) ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar9280.c Thu Jan 20 00:54:12 2011 (r217617, copy source) +++ head/sys/dev/ath/ath_hal/ar9002/ar9280.c Thu Jan 20 09:03:40 2011 (r217631) @@ -26,7 +26,7 @@ #include "ah_eeprom_v14.h" -#include "ar5416/ar9280.h" +#include "ar9002/ar9280.h" #include "ar5416/ar5416reg.h" #include "ar5416/ar5416phy.h" Copied: head/sys/dev/ath/ath_hal/ar9002/ar9280.h (from r217617, head/sys/dev/ath/ath_hal/ar5416/ar9280.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/ath/ath_hal/ar9002/ar9280.h Thu Jan 20 09:03:40 2011 (r217631, copy of r217617, head/sys/dev/ath/ath_hal/ar5416/ar9280.h) @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2008-2009 Sam Leffler, Errno Consulting + * + * Permission to use, copy, modify, and/or 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$ + */ +#ifndef _ATH_AR9280_H_ +#define _ATH_AR9280_H_ + +#include "ar5416/ar5416.h" + +struct ath_hal_9280 { + struct ath_hal_5416 ah_5416; + + HAL_INI_ARRAY ah_ini_xmodes; + HAL_INI_ARRAY ah_ini_rxgain; + HAL_INI_ARRAY ah_ini_txgain; +}; +#define AH9280(_ah) ((struct ath_hal_9280 *)(_ah)) + +#define AR9280_DEFAULT_RXCHAINMASK 3 +#define AR9285_DEFAULT_RXCHAINMASK 1 +#define AR9280_DEFAULT_TXCHAINMASK 1 +#define AR9285_DEFAULT_TXCHAINMASK 1 + +HAL_BOOL ar9280RfAttach(struct ath_hal *, HAL_STATUS *); + +struct ath_hal; + +HAL_BOOL ar9280SetAntennaSwitch(struct ath_hal *, HAL_ANT_SETTING); +void ar9280SpurMitigate(struct ath_hal *, + const struct ieee80211_channel *); + +#endif /* _ATH_AR9280_H_ */ Copied and modified: head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c (from r217624, head/sys/dev/ath/ath_hal/ar5416/ar9280_attach.c) ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar9280_attach.c Thu Jan 20 07:56:09 2011 (r217624, copy source) +++ head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Thu Jan 20 09:03:40 2011 (r217631) @@ -24,12 +24,12 @@ #include "ah_eeprom_v14.h" /* XXX for tx/rx gain */ -#include "ar5416/ar9280.h" +#include "ar9002/ar9280.h" #include "ar5416/ar5416reg.h" #include "ar5416/ar5416phy.h" -#include "ar5416/ar9280v1.ini" -#include "ar5416/ar9280v2.ini" +#include "ar9002/ar9280v1.ini" +#include "ar9002/ar9280v2.ini" static const HAL_PERCAL_DATA ar9280_iq_cal = { /* single sample */ .calName = "IQ", .calType = IQ_MISMATCH_CAL, Copied: head/sys/dev/ath/ath_hal/ar9002/ar9280v1.ini (from r217617, head/sys/dev/ath/ath_hal/ar5416/ar9280v1.ini) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/ath/ath_hal/ar9002/ar9280v1.ini Thu Jan 20 09:03:40 2011 (r217631, copy of r217617, head/sys/dev/ath/ath_hal/ar5416/ar9280v1.ini) @@ -0,0 +1,582 @@ +/* + * Copyright (c) 2002-2009 Sam Leffler, Errno Consulting + * Copyright (c) 2002-2008 Atheros Communications, Inc. + * + * Permission to use, copy, modify, and/or 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$ + */ +/* Auto Generated PCI Register Writes. Created: 10/12/07 */ + +static const uint32_t ar9280Modes_v1[][6] = { + { 0x00001030, 0x00000230, 0x00000460, 0x000002c0, 0x00000160, 0x000001e0 }, + { 0x00001070, 0x00000168, 0x000002d0, 0x00000318, 0x0000018c, 0x000001e0 }, + { 0x000010b0, 0x00000e60, 0x00001cc0, 0x00007c70, 0x00003e38, 0x00001180 }, + { 0x000010f0, 0x0000a000, 0x00014000, 0x00016000, 0x0000b000, 0x00014008 }, + { 0x00008014, 0x03e803e8, 0x07d007d0, 0x10801080, 0x08400840, 0x06e006e0 }, + { 0x0000801c, 0x128d8027, 0x128d804f, 0x12e00057, 0x12e0002b, 0x0988004f }, + { 0x00009804, 0x00000300, 0x000003c4, 0x000003c4, 0x00000300, 0x00000303 }, + { 0x00009820, 0x02020200, 0x02020200, 0x02020200, 0x02020200, 0x02020200 }, + { 0x00009824, 0x00000e0e, 0x00000e0e, 0x00000e0e, 0x00000e0e, 0x00000e0e }, + { 0x00009828, 0x0a020001, 0x0a020001, 0x0a020001, 0x0a020001, 0x0a020001 }, + { 0x00009834, 0x00000e0e, 0x00000e0e, 0x00000e0e, 0x00000e0e, 0x00000e0e }, + { 0x00009838, 0x00000007, 0x00000007, 0x00000007, 0x00000007, 0x00000007 }, + { 0x00009844, 0x1372161e, 0x1372161e, 0x137216a0, 0x137216a0, 0x137216a0 }, + { 0x00009848, 0x00028566, 0x00028566, 0x00028563, 0x00028563, 0x00028563 }, + { 0x0000a848, 0x00028566, 0x00028566, 0x00028563, 0x00028563, 0x00028563 }, + { 0x00009850, 0x6d4000e2, 0x6d4000e2, 0x6d4000e2, 0x6d4000e2, 0x6d4000e2 }, + { 0x00009858, 0x7ec82d2e, 0x7ec82d2e, 0x7ec82d2e, 0x7ec82d2e, 0x7ec82d2e }, + { 0x0000985c, 0x3139605e, 0x3139605e, 0x3139605e, 0x3139605e, 0x3139605e }, + { 0x00009860, 0x00049d18, 0x00049d18, 0x00049d20, 0x00049d20, 0x00049d18 }, + { 0x0000c864, 0x0001ce00, 0x0001ce00, 0x0001ce00, 0x0001ce00, 0x0001ce00 }, + { 0x00009868, 0x5ac64190, 0x5ac64190, 0x5ac64190, 0x5ac64190, 0x5ac64190 }, + { 0x0000986c, 0x06903081, 0x06903081, 0x06903881, 0x06903881, 0x06903881 }, + { 0x00009914, 0x000007d0, 0x000007d0, 0x00000898, 0x00000898, 0x000007d0 }, + { 0x00009918, 0x0000000a, 0x00000014, 0x00000016, 0x0000000b, 0x00000016 }, + { 0x00009924, 0xd00a8a07, 0xd00a8a07, 0xd00a8a0d, 0xd00a8a0d, 0xd00a8a0d }, + { 0x00009944, 0xdfbc1010, 0xdfbc1010, 0xdfbc1010, 0xdfbc1010, 0xdfbc1010 }, + { 0x00009960, 0x00000010, 0x00000010, 0x00000010, 0x00000010, 0x00000010 }, + { 0x0000a960, 0x00000010, 0x00000010, 0x00000010, 0x00000010, 0x00000010 }, + { 0x00009964, 0x00000210, 0x00000210, 0x00000210, 0x00000210, 0x00000210 }, + { 0x0000c9b8, 0x0000001a, 0x0000001a, 0x0000001a, 0x0000001a, 0x0000001a }, + { 0x0000c9bc, 0x00000600, 0x00000600, 0x00000c00, 0x00000c00, 0x00000c00 }, + { 0x000099c0, 0x05eea6d4, 0x05eea6d4, 0x05eea6d4, 0x05eea6d4, 0x05eea6d4 }, + { 0x000099c4, 0x06336f77, 0x06336f77, 0x06336f77, 0x06336f77, 0x06336f77 }, + { 0x000099c8, 0x60f6532c, 0x60f6532c, 0x60f6532c, 0x60f6532c, 0x60f6532c }, + { 0x000099cc, 0x08f186c8, 0x08f186c8, 0x08f186c8, 0x08f186c8, 0x08f186c8 }, + { 0x000099d0, 0x00046384, 0x00046384, 0x00046384, 0x00046384, 0x00046384 }, + { 0x000099d4, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, + { 0x000099d8, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, + { 0x00009a00, 0x00008184, 0x00008184, 0x00000214, 0x00000214, 0x00000214 }, + { 0x00009a04, 0x00008188, 0x00008188, 0x00000218, 0x00000218, 0x00000218 }, + { 0x00009a08, 0x0000818c, 0x0000818c, 0x00000224, 0x00000224, 0x00000224 }, + { 0x00009a0c, 0x00008190, 0x00008190, 0x00000228, 0x00000228, 0x00000228 }, + { 0x00009a10, 0x00008194, 0x00008194, 0x0000022c, 0x0000022c, 0x0000022c }, + { 0x00009a14, 0x00008200, 0x00008200, 0x00000230, 0x00000230, 0x00000230 }, + { 0x00009a18, 0x00008204, 0x00008204, 0x000002a4, 0x000002a4, 0x000002a4 }, + { 0x00009a1c, 0x00008208, 0x00008208, 0x000002a8, 0x000002a8, 0x000002a8 }, + { 0x00009a20, 0x0000820c, 0x0000820c, 0x000002ac, 0x000002ac, 0x000002ac }, + { 0x00009a24, 0x00008210, 0x00008210, 0x000002b0, 0x000002b0, 0x000002b0 }, + { 0x00009a28, 0x00008214, 0x00008214, 0x000002b4, 0x000002b4, 0x000002b4 }, + { 0x00009a2c, 0x00008280, 0x00008280, 0x000002b8, 0x000002b8, 0x000002b8 }, + { 0x00009a30, 0x00008284, 0x00008284, 0x00000390, 0x00000390, 0x00000390 }, + { 0x00009a34, 0x00008288, 0x00008288, 0x00000394, 0x00000394, 0x00000394 }, + { 0x00009a38, 0x0000828c, 0x0000828c, 0x00000398, 0x00000398, 0x00000398 }, + { 0x00009a3c, 0x00008290, 0x00008290, 0x00000334, 0x00000334, 0x00000334 }, + { 0x00009a40, 0x00008300, 0x00008300, 0x00000338, 0x00000338, 0x00000338 }, + { 0x00009a44, 0x00008304, 0x00008304, 0x000003ac, 0x000003ac, 0x000003ac }, + { 0x00009a48, 0x00008308, 0x00008308, 0x000003b0, 0x000003b0, 0x000003b0 }, + { 0x00009a4c, 0x0000830c, 0x0000830c, 0x000003b4, 0x000003b4, 0x000003b4 }, + { 0x00009a50, 0x00008310, 0x00008310, 0x000003b8, 0x000003b8, 0x000003b8 }, + { 0x00009a54, 0x00008314, 0x00008314, 0x000003a5, 0x000003a5, 0x000003a5 }, + { 0x00009a58, 0x00008380, 0x00008380, 0x000003a9, 0x000003a9, 0x000003a9 }, + { 0x00009a5c, 0x00008384, 0x00008384, 0x000003ad, 0x000003ad, 0x000003ad }, + { 0x00009a60, 0x00008388, 0x00008388, 0x00008194, 0x00008194, 0x00008194 }, + { 0x00009a64, 0x0000838c, 0x0000838c, 0x000081a0, 0x000081a0, 0x000081a0 }, + { 0x00009a68, 0x00008390, 0x00008390, 0x0000820c, 0x0000820c, 0x0000820c }, + { 0x00009a6c, 0x00008394, 0x00008394, 0x000081a8, 0x000081a8, 0x000081a8 }, + { 0x00009a70, 0x0000a380, 0x0000a380, 0x00008284, 0x00008284, 0x00008284 }, + { 0x00009a74, 0x0000a384, 0x0000a384, 0x00008288, 0x00008288, 0x00008288 }, + { 0x00009a78, 0x0000a388, 0x0000a388, 0x00008224, 0x00008224, 0x00008224 }, + { 0x00009a7c, 0x0000a38c, 0x0000a38c, 0x00008290, 0x00008290, 0x00008290 }, + { 0x00009a80, 0x0000a390, 0x0000a390, 0x00008300, 0x00008300, 0x00008300 }, + { 0x00009a84, 0x0000a394, 0x0000a394, 0x00008304, 0x00008304, 0x00008304 }, + { 0x00009a88, 0x0000a780, 0x0000a780, 0x00008308, 0x00008308, 0x00008308 }, + { 0x00009a8c, 0x0000a784, 0x0000a784, 0x0000830c, 0x0000830c, 0x0000830c }, + { 0x00009a90, 0x0000a788, 0x0000a788, 0x00008380, 0x00008380, 0x00008380 }, + { 0x00009a94, 0x0000a78c, 0x0000a78c, 0x00008384, 0x00008384, 0x00008384 }, + { 0x00009a98, 0x0000a790, 0x0000a790, 0x00008700, 0x00008700, 0x00008700 }, + { 0x00009a9c, 0x0000a794, 0x0000a794, 0x00008704, 0x00008704, 0x00008704 }, + { 0x00009aa0, 0x0000ab84, 0x0000ab84, 0x00008708, 0x00008708, 0x00008708 }, + { 0x00009aa4, 0x0000ab88, 0x0000ab88, 0x0000870c, 0x0000870c, 0x0000870c }, + { 0x00009aa8, 0x0000ab8c, 0x0000ab8c, 0x00008780, 0x00008780, 0x00008780 }, + { 0x00009aac, 0x0000ab90, 0x0000ab90, 0x00008784, 0x00008784, 0x00008784 }, + { 0x00009ab0, 0x0000ab94, 0x0000ab94, 0x00008b00, 0x00008b00, 0x00008b00 }, + { 0x00009ab4, 0x0000af80, 0x0000af80, 0x00008b04, 0x00008b04, 0x00008b04 }, + { 0x00009ab8, 0x0000af84, 0x0000af84, 0x00008b08, 0x00008b08, 0x00008b08 }, + { 0x00009abc, 0x0000af88, 0x0000af88, 0x00008b0c, 0x00008b0c, 0x00008b0c }, + { 0x00009ac0, 0x0000af8c, 0x0000af8c, 0x00008b80, 0x00008b80, 0x00008b80 }, + { 0x00009ac4, 0x0000af90, 0x0000af90, 0x00008b84, 0x00008b84, 0x00008b84 }, + { 0x00009ac8, 0x0000af94, 0x0000af94, 0x00008b88, 0x00008b88, 0x00008b88 }, + { 0x00009acc, 0x0000b380, 0x0000b380, 0x00008b8c, 0x00008b8c, 0x00008b8c }, + { 0x00009ad0, 0x0000b384, 0x0000b384, 0x00008b90, 0x00008b90, 0x00008b90 }, + { 0x00009ad4, 0x0000b388, 0x0000b388, 0x00008f80, 0x00008f80, 0x00008f80 }, + { 0x00009ad8, 0x0000b38c, 0x0000b38c, 0x00008f84, 0x00008f84, 0x00008f84 }, + { 0x00009adc, 0x0000b390, 0x0000b390, 0x00008f88, 0x00008f88, 0x00008f88 }, + { 0x00009ae0, 0x0000b394, 0x0000b394, 0x00008f8c, 0x00008f8c, 0x00008f8c }, + { 0x00009ae4, 0x0000b398, 0x0000b398, 0x00008f90, 0x00008f90, 0x00008f90 }, + { 0x00009ae8, 0x0000b780, 0x0000b780, 0x0000930c, 0x0000930c, 0x0000930c }, + { 0x00009aec, 0x0000b784, 0x0000b784, 0x00009310, 0x00009310, 0x00009310 }, + { 0x00009af0, 0x0000b788, 0x0000b788, 0x00009384, 0x00009384, 0x00009384 }, + { 0x00009af4, 0x0000b78c, 0x0000b78c, 0x00009388, 0x00009388, 0x00009388 }, + { 0x00009af8, 0x0000b790, 0x0000b790, 0x00009324, 0x00009324, 0x00009324 }, + { 0x00009afc, 0x0000b794, 0x0000b794, 0x00009704, 0x00009704, 0x00009704 }, + { 0x00009b00, 0x0000b798, 0x0000b798, 0x000096a4, 0x000096a4, 0x000096a4 }, + { 0x00009b04, 0x0000d784, 0x0000d784, 0x000096a8, 0x000096a8, 0x000096a8 }, + { 0x00009b08, 0x0000d788, 0x0000d788, 0x00009710, 0x00009710, 0x00009710 }, + { 0x00009b0c, 0x0000d78c, 0x0000d78c, 0x00009714, 0x00009714, 0x00009714 }, + { 0x00009b10, 0x0000d790, 0x0000d790, 0x00009720, 0x00009720, 0x00009720 }, + { 0x00009b14, 0x0000f780, 0x0000f780, 0x00009724, 0x00009724, 0x00009724 }, + { 0x00009b18, 0x0000f784, 0x0000f784, 0x00009728, 0x00009728, 0x00009728 }, + { 0x00009b1c, 0x0000f788, 0x0000f788, 0x0000972c, 0x0000972c, 0x0000972c }, + { 0x00009b20, 0x0000f78c, 0x0000f78c, 0x000097a0, 0x000097a0, 0x000097a0 }, + { 0x00009b24, 0x0000f790, 0x0000f790, 0x000097a4, 0x000097a4, 0x000097a4 }, + { 0x00009b28, 0x0000f794, 0x0000f794, 0x000097a8, 0x000097a8, 0x000097a8 }, + { 0x00009b2c, 0x0000f7a4, 0x0000f7a4, 0x000097b0, 0x000097b0, 0x000097b0 }, + { 0x00009b30, 0x0000f7a8, 0x0000f7a8, 0x000097b4, 0x000097b4, 0x000097b4 }, + { 0x00009b34, 0x0000f7ac, 0x0000f7ac, 0x000097b8, 0x000097b8, 0x000097b8 }, + { 0x00009b38, 0x0000f7b0, 0x0000f7b0, 0x000097a5, 0x000097a5, 0x000097a5 }, + { 0x00009b3c, 0x0000f7b4, 0x0000f7b4, 0x000097a9, 0x000097a9, 0x000097a9 }, + { 0x00009b40, 0x0000f7a1, 0x0000f7a1, 0x000097ad, 0x000097ad, 0x000097ad }, + { 0x00009b44, 0x0000f7a5, 0x0000f7a5, 0x000097b1, 0x000097b1, 0x000097b1 }, + { 0x00009b48, 0x0000f7a9, 0x0000f7a9, 0x000097b5, 0x000097b5, 0x000097b5 }, + { 0x00009b4c, 0x0000f7ad, 0x0000f7ad, 0x000097b9, 0x000097b9, 0x000097b9 }, + { 0x00009b50, 0x0000f7b1, 0x0000f7b1, 0x000097c5, 0x000097c5, 0x000097c5 }, + { 0x00009b54, 0x0000f7b5, 0x0000f7b5, 0x000097c9, 0x000097c9, 0x000097c9 }, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Jan 20 09:28:54 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4908B106566C; Thu, 20 Jan 2011 09:28:54 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id 0748B8FC0A; Thu, 20 Jan 2011 09:28:54 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:e9c2:5fa3:4b71:d50a] (unknown [IPv6:2001:7b8:3a7:0:e9c2:5fa3:4b71:d50a]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 2465B5C43; Thu, 20 Jan 2011 10:28:53 +0100 (CET) Message-ID: <4D380057.8050809@FreeBSD.org> Date: Thu, 20 Jan 2011 10:28:55 +0100 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.14pre) Gecko/20110115 Lanikai/3.1.8pre MIME-Version: 1.0 To: "Bjoern A. Zeeb" References: <201101192215.p0JMFDvC091476@svn.freebsd.org> <20110119222655.Y3489@maildrop.int.zabbadoz.net> In-Reply-To: <20110119222655.Y3489@maildrop.int.zabbadoz.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Juli Mallett , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r217612 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jan 2011 09:28:54 -0000 On 2011-01-19 23:27, Bjoern A. Zeeb wrote: >> - * $FreeBSD: projects/mips/sys/conf/ldscript.mips 191079 2009-04-14 22:53:22Z gonzo $ >> + * $FreeBSD$ > > This doesn't look right though, does it? It's an svn artifact. If you enable the svn:keywords property, the keywords are "collapsed" when they are stored in the repository, and only expanded on the client side. This is a major pain with producing easy-to-apply diffs... :( From owner-svn-src-all@FreeBSD.ORG Thu Jan 20 09:37:53 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C3D7B106566B; Thu, 20 Jan 2011 09:37:53 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 986FD8FC13; Thu, 20 Jan 2011 09:37:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0K9brF2008040; Thu, 20 Jan 2011 09:37:53 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0K9brvW008037; Thu, 20 Jan 2011 09:37:53 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201101200937.p0K9brvW008037@svn.freebsd.org> From: Adrian Chadd Date: Thu, 20 Jan 2011 09:37:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217632 - in head/sys/dev/ath/ath_hal: . ar9002 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jan 2011 09:37:53 -0000 Author: adrian Date: Thu Jan 20 09:37:53 2011 New Revision: 217632 URL: http://svn.freebsd.org/changeset/base/217632 Log: Include the device ids for the AR2427. This is apparently an AR9285 with the 802.11n specific bits disabled. This code is completely untested; I'm doing this in response to users who wish to test the functionality out. It's likely as buggy as the AR9285 support is in FreeBSD at the moment. Modified: head/sys/dev/ath/ath_hal/ah_devid.h head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c Modified: head/sys/dev/ath/ath_hal/ah_devid.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_devid.h Thu Jan 20 09:03:40 2011 (r217631) +++ head/sys/dev/ath/ath_hal/ah_devid.h Thu Jan 20 09:37:53 2011 (r217632) @@ -78,6 +78,7 @@ #define AR9280_DEVID_PCI 0x0029 /* AR9280 PCI Merlin */ #define AR9280_DEVID_PCIE 0x002a /* AR9280 PCI-E Merlin */ #define AR9285_DEVID_PCIE 0x002b /* AR9285 PCI-E Kite */ +#define AR2427_DEVID_PCIE 0x002c /* AR2427 PCI-E w/ 802.11n bonded out */ #define AR_SUBVENDOR_ID_NOG 0x0e11 /* No 11G subvendor ID */ #define AR_SUBVENDOR_ID_NEW_A 0x7065 /* Update device to new RD */ Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c Thu Jan 20 09:03:40 2011 (r217631) +++ head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c Thu Jan 20 09:37:53 2011 (r217632) @@ -244,6 +244,10 @@ ar9285Attach(uint16_t devid, HAL_SOFTC s goto bad; } + /* Disable 11n for the AR2427 */ + if (devid == AR2427_DEVID_PCIE) + AH_PRIVATE(ah)->ah_caps.halHTSupport = AH_FALSE; + ecode = ath_hal_eepromGet(ah, AR_EEP_MACADDR, ahp->ah_macaddr); if (ecode != HAL_OK) { HALDEBUG(ah, HAL_DEBUG_ANY, @@ -403,6 +407,9 @@ ar9285Probe(uint16_t vendorid, uint16_t { if (vendorid == ATHEROS_VENDOR_ID && devid == AR9285_DEVID_PCIE) return "Atheros 9285"; + if (vendorid == ATHEROS_VENDOR_ID && (devid == AR2427_DEVID_PCIE)) + return "Atheros 2427"; + return AH_NULL; } AH_CHIP(AR9285, ar9285Probe, ar9285Attach); From owner-svn-src-all@FreeBSD.ORG Thu Jan 20 09:39:17 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 309451065679; Thu, 20 Jan 2011 09:39:17 +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 1D91D8FC17; Thu, 20 Jan 2011 09:39:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0K9dHDd008101; Thu, 20 Jan 2011 09:39:17 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0K9dGXm008098; Thu, 20 Jan 2011 09:39:16 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201101200939.p0K9dGXm008098@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 20 Jan 2011 09:39:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217633 - head/sys/fs/tmpfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jan 2011 09:39:17 -0000 Author: kib Date: Thu Jan 20 09:39:16 2011 New Revision: 217633 URL: http://svn.freebsd.org/changeset/base/217633 Log: In tmpfs_readdir(), normalize handling of the directory entries that either overflow the supplied buffer, or cause uiomove fail. Do not advance cached de when directory entry was not copied out. Do not return EOF when no entries could be copied due to first entry too large for supplied buffer, signal EINVAL instead. Reported by: Beat G?tzi MFC after: 1 week Modified: head/sys/fs/tmpfs/tmpfs_subr.c head/sys/fs/tmpfs/tmpfs_vnops.c Modified: head/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_subr.c Thu Jan 20 09:37:53 2011 (r217632) +++ head/sys/fs/tmpfs/tmpfs_subr.c Thu Jan 20 09:39:16 2011 (r217633) @@ -827,9 +827,10 @@ tmpfs_dir_getdents(struct tmpfs_node *no /* Copy the new dirent structure into the output buffer and * advance pointers. */ error = uiomove(&d, d.d_reclen, uio); - - (*cntp)++; - de = TAILQ_NEXT(de, td_entries); + if (error == 0) { + (*cntp)++; + de = TAILQ_NEXT(de, td_entries); + } } while (error == 0 && uio->uio_resid > 0 && de != NULL); /* Update the offset and cache. */ Modified: head/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vnops.c Thu Jan 20 09:37:53 2011 (r217632) +++ head/sys/fs/tmpfs/tmpfs_vnops.c Thu Jan 20 09:39:16 2011 (r217633) @@ -1349,7 +1349,7 @@ outok: MPASS(error >= -1); if (error == -1) - error = 0; + error = (cnt != 0) ? 0 : EINVAL; if (eofflag != NULL) *eofflag = From owner-svn-src-all@FreeBSD.ORG Thu Jan 20 09:46:18 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EC1E21065673; Thu, 20 Jan 2011 09:46:18 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DAD978FC14; Thu, 20 Jan 2011 09:46:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0K9kIMW008301; Thu, 20 Jan 2011 09:46:18 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0K9kIZg008299; Thu, 20 Jan 2011 09:46:18 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201101200946.p0K9kIZg008299@svn.freebsd.org> From: Adrian Chadd Date: Thu, 20 Jan 2011 09:46: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: r217634 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jan 2011 09:46:19 -0000 Author: adrian Date: Thu Jan 20 09:46:18 2011 New Revision: 217634 URL: http://svn.freebsd.org/changeset/base/217634 Log: Only enable 11n modes if the chipset suports 11n. Since the AR2427 doesn't allow 802.11n, it shouldn't have them configured. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Thu Jan 20 09:39:16 2011 (r217633) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Thu Jan 20 09:46:18 2011 (r217634) @@ -40,14 +40,18 @@ u_int ar5416GetWirelessModes(struct ath_hal *ah) { u_int mode; + struct ath_hal_private *ahpriv = AH_PRIVATE(ah); + HAL_CAPABILITIES *pCap = &ahpriv->ah_caps; mode = ar5212GetWirelessModes(ah); - if (mode & HAL_MODE_11A) + + /* Only enable HT modes if the NIC supports HT */ + if (pCap->halHTSupport == AH_TRUE && (mode & HAL_MODE_11A)) mode |= HAL_MODE_11NA_HT20 | HAL_MODE_11NA_HT40PLUS | HAL_MODE_11NA_HT40MINUS ; - if (mode & HAL_MODE_11G) + if (pCap->halHTSupport == AH_TRUE && (mode & HAL_MODE_11G)) mode |= HAL_MODE_11NG_HT20 | HAL_MODE_11NG_HT40PLUS | HAL_MODE_11NG_HT40MINUS From owner-svn-src-all@FreeBSD.ORG Thu Jan 20 11:27:38 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F007A1065672; Thu, 20 Jan 2011 11:27:38 +0000 (UTC) (envelope-from dwmalone@maths.tcd.ie) Received: from salmon.maths.tcd.ie (salmon.maths.tcd.ie [IPv6:2001:770:10:300::86e2:510b]) by mx1.freebsd.org (Postfix) with SMTP id C05508FC1D; Thu, 20 Jan 2011 11:27:36 +0000 (UTC) Received: from walton.maths.tcd.ie ([134.226.81.10] helo=walton.maths.tcd.ie) by salmon.maths.tcd.ie with SMTP id ; 20 Jan 2011 11:27:35 +0000 (GMT) Received: from localhost ([127.0.0.1] helo=maths.tcd.ie) by walton.maths.tcd.ie with SMTP id ; 20 Jan 2011 11:27:34 +0000 (GMT) To: Bruce Evans In-reply-to: Your message of "Thu, 20 Jan 2011 19:03:07 +1100." <20110120183431.E11559@besplex.bde.org> Date: Thu, 20 Jan 2011 11:27:34 +0000 From: David Malone Message-ID: <201101201127.aa23364@walton.maths.tcd.ie> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r217589 - head/usr.sbin/syslogd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jan 2011 11:27:39 -0000 > snprintf(buf, 2, "%*s%*s%*s", INT_MAX, "223", INT_MAX, "", 3, "bar"); Ah - good example. Would it be worth adding some clarification to our man page? The paragraphs discussing return values suggest that *printf() functions can only fail because of output or malloc errors. I guess two other cases are invalid wide characters and the return value not being representable as an int? David. From owner-svn-src-all@FreeBSD.ORG Thu Jan 20 12:40:10 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 390DD106564A; Thu, 20 Jan 2011 12:40:10 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 28A4E8FC18; Thu, 20 Jan 2011 12:40:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0KCeApV013541; Thu, 20 Jan 2011 12:40:10 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0KCeA73013537; Thu, 20 Jan 2011 12:40:10 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <201101201240.p0KCeA73013537@svn.freebsd.org> From: Randall Stewart Date: Thu, 20 Jan 2011 12:40: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: r217635 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jan 2011 12:40:10 -0000 Author: rrs Date: Thu Jan 20 12:40:09 2011 New Revision: 217635 URL: http://svn.freebsd.org/changeset/base/217635 Log: Fix it so we align with new socket API draft for state's in destination (i.e. ACTIVE/INACTIVE/UNCONFIRMED) MFC after: 1 week Modified: head/sys/netinet/sctp_constants.h head/sys/netinet/sctp_uio.h head/sys/netinet/sctp_usrreq.c Modified: head/sys/netinet/sctp_constants.h ============================================================================== --- head/sys/netinet/sctp_constants.h Thu Jan 20 09:46:18 2011 (r217634) +++ head/sys/netinet/sctp_constants.h Thu Jan 20 12:40:09 2011 (r217635) @@ -506,8 +506,7 @@ __FBSDID("$FreeBSD$"); #define SCTP_ADDR_UNCONFIRMED 0x200 #define SCTP_ADDR_REQ_PRIMARY 0x400 /* JRS 5/13/07 - Added potentially failed state for CMT PF */ -#define SCTP_ADDR_PF 0x800 -#define SCTP_REACHABLE_MASK 0x203 +#define SCTP_ADDR_PF 0x800 /* bound address types (e.g. valid address types to allow) */ #define SCTP_BOUND_V6 0x01 Modified: head/sys/netinet/sctp_uio.h ============================================================================== --- head/sys/netinet/sctp_uio.h Thu Jan 20 09:46:18 2011 (r217634) +++ head/sys/netinet/sctp_uio.h Thu Jan 20 12:40:09 2011 (r217635) @@ -233,31 +233,10 @@ struct sctp_paddr_change { #define SCTP_ADDR_MADE_PRIM 0x0005 #define SCTP_ADDR_CONFIRMED 0x0006 -/* - * CAUTION: these are user exposed SCTP addr reachability states must be - * compatible with SCTP_ADDR states in sctp_constants.h - */ -#ifdef SCTP_ACTIVE -#undef SCTP_ACTIVE -#endif #define SCTP_ACTIVE 0x0001 /* SCTP_ADDR_REACHABLE */ - -#ifdef SCTP_INACTIVE -#undef SCTP_INACTIVE -#endif #define SCTP_INACTIVE 0x0002 /* SCTP_ADDR_NOT_REACHABLE */ - -#ifdef SCTP_UNCONFIRMED -#undef SCTP_UNCONFIRMED -#endif #define SCTP_UNCONFIRMED 0x0200 /* SCTP_ADDR_UNCONFIRMED */ -#ifdef SCTP_NOHEARTBEAT -#undef SCTP_NOHEARTBEAT -#endif -#define SCTP_NOHEARTBEAT 0x0040 /* SCTP_ADDR_NOHB */ - - /* remote error events */ struct sctp_remote_error { uint16_t sre_type; Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Thu Jan 20 09:46:18 2011 (r217634) +++ head/sys/netinet/sctp_usrreq.c Thu Jan 20 12:40:09 2011 (r217635) @@ -2341,7 +2341,16 @@ flags_out: } if ((stcb) && (net)) { - paddri->spinfo_state = net->dest_state & (SCTP_REACHABLE_MASK | SCTP_ADDR_NOHB); + if (net->dest_state & SCTP_ADDR_UNCONFIRMED) { + /* Its unconfirmed */ + paddri->spinfo_state = SCTP_UNCONFIRMED; + } else if (net->dest_state & SCTP_ADDR_REACHABLE) { + /* The Active */ + paddri->spinfo_state = SCTP_ACTIVE; + } else { + /* It's Inactive */ + paddri->spinfo_state = SCTP_INACTIVE; + } paddri->spinfo_cwnd = net->cwnd; paddri->spinfo_srtt = ((net->lastsa >> 2) + net->lastsv) >> 1; paddri->spinfo_rto = net->RTO; @@ -2409,7 +2418,16 @@ flags_out: * Again the user can get info from sctp_constants.h * for what the state of the network is. */ - sstat->sstat_primary.spinfo_state = net->dest_state & SCTP_REACHABLE_MASK; + if (net->dest_state & SCTP_ADDR_UNCONFIRMED) { + /* It's unconfirmed */ + sstat->sstat_primary.spinfo_state = SCTP_UNCONFIRMED; + } else if (net->dest_state & SCTP_ADDR_REACHABLE) { + /* Its active */ + sstat->sstat_primary.spinfo_state = SCTP_ACTIVE; + } else { + /* It's Inactive */ + sstat->sstat_primary.spinfo_state = SCTP_INACTIVE; + } sstat->sstat_primary.spinfo_cwnd = net->cwnd; sstat->sstat_primary.spinfo_srtt = net->lastsa; sstat->sstat_primary.spinfo_rto = net->RTO; From owner-svn-src-all@FreeBSD.ORG Thu Jan 20 12:45:30 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2938410656A7; Thu, 20 Jan 2011 12:45:30 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F24AF8FC14; Thu, 20 Jan 2011 12:45:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0KCjTjC013773; Thu, 20 Jan 2011 12:45:29 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0KCjTBd013768; Thu, 20 Jan 2011 12:45:29 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201101201245.p0KCjTBd013768@svn.freebsd.org> From: "Jayachandran C." Date: Thu, 20 Jan 2011 12:45: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: r217636 - in head/sys/mips: conf rmi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jan 2011 12:45:30 -0000 Author: jchandra Date: Thu Jan 20 12:45:29 2011 New Revision: 217636 URL: http://svn.freebsd.org/changeset/base/217636 Log: Move 'cpu CPU_RMI' to std.xlr, this is common for all XLR cpus. Modified: head/sys/mips/conf/XLR head/sys/mips/conf/XLR64 head/sys/mips/conf/XLRN32 head/sys/mips/rmi/std.xlr Modified: head/sys/mips/conf/XLR ============================================================================== --- head/sys/mips/conf/XLR Thu Jan 20 12:40:09 2011 (r217635) +++ head/sys/mips/conf/XLR Thu Jan 20 12:45:29 2011 (r217636) @@ -46,13 +46,10 @@ # $FreeBSD$ machine mips mipseb -cpu CPU_RMI ident XLR - -makeoptions MODULES_OVERRIDE="" - include "../rmi/std.xlr" +makeoptions MODULES_OVERRIDE="" makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols makeoptions KERNLOADADDR=0x80100000 #profile 2 Modified: head/sys/mips/conf/XLR64 ============================================================================== --- head/sys/mips/conf/XLR64 Thu Jan 20 12:40:09 2011 (r217635) +++ head/sys/mips/conf/XLR64 Thu Jan 20 12:45:29 2011 (r217636) @@ -18,13 +18,10 @@ # $FreeBSD$ machine mips mips64eb -cpu CPU_RMI ident XLR64 - -makeoptions MODULES_OVERRIDE="" - include "../rmi/std.xlr" +makeoptions MODULES_OVERRIDE="" makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols makeoptions ARCH_FLAGS="-march=mips64 -mabi=64" makeoptions KERNLOADADDR=0xffffffff80100000 Modified: head/sys/mips/conf/XLRN32 ============================================================================== --- head/sys/mips/conf/XLRN32 Thu Jan 20 12:40:09 2011 (r217635) +++ head/sys/mips/conf/XLRN32 Thu Jan 20 12:45:29 2011 (r217636) @@ -18,12 +18,10 @@ # $FreeBSD$ machine mips mipsn32eb -cpu CPU_RMI ident XLRN32 - -makeoptions MODULES_OVERRIDE="" include "../rmi/std.xlr" +makeoptions MODULES_OVERRIDE="" makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols makeoptions ARCH_FLAGS="-march=mips64 -mabi=n32" makeoptions KERNLOADADDR=0x80100000 Modified: head/sys/mips/rmi/std.xlr ============================================================================== --- head/sys/mips/rmi/std.xlr Thu Jan 20 12:40:09 2011 (r217635) +++ head/sys/mips/rmi/std.xlr Thu Jan 20 12:45:29 2011 (r217636) @@ -1,7 +1,5 @@ # $FreeBSD$ files "../rmi/files.xlr" -# -# XXXMIPS: It's a stub, isn't it? -# +cpu CPU_RMI option NOFPU From owner-svn-src-all@FreeBSD.ORG Thu Jan 20 13:02:54 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D5342106566C; Thu, 20 Jan 2011 13:02:54 +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 C4A5D8FC1A; Thu, 20 Jan 2011 13:02:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0KD2sbt014246; Thu, 20 Jan 2011 13:02:54 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 p0KD2slW014243; Thu, 20 Jan 2011 13:02:54 GMT (envelope-from n_hibma@svn.freebsd.org) Message-Id: <201101201302.p0KD2slW014243@svn.freebsd.org> From: Nick Hibma Date: Thu, 20 Jan 2011 13:02:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217637 - in head/sys/dev/usb: . serial X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jan 2011 13:02:54 -0000 Author: n_hibma Date: Thu Jan 20 13:02:54 2011 New Revision: 217637 URL: http://svn.freebsd.org/changeset/base/217637 Log: Add another ID for the ZTE MF190 Surf Stick Submitted by: nagilum MFC after: 1 day Modified: head/sys/dev/usb/serial/u3g.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/serial/u3g.c ============================================================================== --- head/sys/dev/usb/serial/u3g.c Thu Jan 20 12:45:29 2011 (r217636) +++ head/sys/dev/usb/serial/u3g.c Thu Jan 20 13:02:54 2011 (r217637) @@ -415,6 +415,7 @@ static const struct usb_device_id u3g_de U3G_DEV(QUALCOMMINC, E0078, 0), U3G_DEV(QUALCOMMINC, E0082, 0), U3G_DEV(QUALCOMMINC, E0086, 0), + U3G_DEV(QUALCOMMINC, SURFSTICK, 0), U3G_DEV(QUALCOMMINC, E2002, 0), U3G_DEV(QUALCOMMINC, E2003, 0), U3G_DEV(QUALCOMMINC, MF626, 0), Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Thu Jan 20 12:45:29 2011 (r217636) +++ head/sys/dev/usb/usbdevs Thu Jan 20 13:02:54 2011 (r217637) @@ -2695,6 +2695,7 @@ product QUALCOMMINC E0076 0x0076 3G mode product QUALCOMMINC E0078 0x0078 3G modem product QUALCOMMINC E0082 0x0082 3G modem product QUALCOMMINC E0086 0x0086 3G modem +product QUALCOMMINC SURFSTICK 0x0117 1&1 Surf Stick product QUALCOMMINC ZTE_STOR 0x2000 USB ZTE Storage product QUALCOMMINC E2002 0x2002 3G modem product QUALCOMMINC E2003 0x2003 3G modem From owner-svn-src-all@FreeBSD.ORG Thu Jan 20 13:12:48 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C1FA8106567A; Thu, 20 Jan 2011 13:12:48 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail03.syd.optusnet.com.au (mail03.syd.optusnet.com.au [211.29.132.184]) by mx1.freebsd.org (Postfix) with ESMTP id 5EFA78FC16; Thu, 20 Jan 2011 13:12:48 +0000 (UTC) Received: from c122-106-165-206.carlnfd1.nsw.optusnet.com.au (c122-106-165-206.carlnfd1.nsw.optusnet.com.au [122.106.165.206]) by mail03.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p0KDChMJ028380 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 21 Jan 2011 00:12:45 +1100 Date: Fri, 21 Jan 2011 00:12:43 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: David Malone In-Reply-To: <201101201127.aa23364@walton.maths.tcd.ie> Message-ID: <20110120234452.Y12697@besplex.bde.org> References: <201101201127.aa23364@walton.maths.tcd.ie> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce Evans Subject: Re: svn commit: r217589 - head/usr.sbin/syslogd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jan 2011 13:12:48 -0000 On Thu, 20 Jan 2011, David Malone wrote: >> snprintf(buf, 2, "%*s%*s%*s", INT_MAX, "223", INT_MAX, "", 3, "bar"); > > Ah - good example. Would it be worth adding some clarification to > our man page? The paragraphs discussing return values suggest that > *printf() functions can only fail because of output or malloc errors. > I guess two other cases are invalid wide characters and the return > value not being representable as an int? I don't really understand wide characters. C99 doesn't seem to mention EILSEQ for the printf() family. POSIX seems to mention it for the printf() family only as an XSI extension, at least in an old draft. FreeBSD's printf(3) mentions it, but in FreeBSD stdio only fgetwc.c and vswprintf.c set it, and vswprintf() is documented in wprintf(3) which doesn't mention EILSEQ. EILSEQ is mentioned for vfswprintf() in POSIX via a long chain of cross references which eventually reach fwprintf(), where EILSEQ is again an XSI extension. Peharps the meta- sections associate this error with *all* wide character functions in both C and POSIX, but that is even harder to find than the chain. wprintf(3) doesn't have an ERRORS or RETURN VALUES section, but describes the return values (without mentioning errno) in the DESCRIPTION section. printf(3) doesn't have a RETURN VALUES section. But yes, any clarification would be worth it :-). The above format can be used with fprintf() and printf() too. These must fail at the INT_MAX limit, and I think they do in FreeBSD. Files of size >= 2GB have been small enough to create since about the same time as FreeBSD-2 release. Trying to printf() more than 2GB to a terminal has been possible for longer. Even at 300 bps, it only takes 2.26 years to write 2GB. Bruce From owner-svn-src-all@FreeBSD.ORG Thu Jan 20 13:53:34 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 773B71065672; Thu, 20 Jan 2011 13:53:34 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 670488FC1A; Thu, 20 Jan 2011 13:53:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0KDrYfR015324; Thu, 20 Jan 2011 13:53:34 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0KDrYDC015322; Thu, 20 Jan 2011 13:53:34 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201101201353.p0KDrYDC015322@svn.freebsd.org> From: Michael Tuexen Date: Thu, 20 Jan 2011 13:53:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217638 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jan 2011 13:53:34 -0000 Author: tuexen Date: Thu Jan 20 13:53:34 2011 New Revision: 217638 URL: http://svn.freebsd.org/changeset/base/217638 Log: Improve comments. MFC after: 1 week. Modified: head/sys/netinet/sctp_usrreq.c Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Thu Jan 20 13:02:54 2011 (r217637) +++ head/sys/netinet/sctp_usrreq.c Thu Jan 20 13:53:34 2011 (r217638) @@ -2342,13 +2342,13 @@ flags_out: if ((stcb) && (net)) { if (net->dest_state & SCTP_ADDR_UNCONFIRMED) { - /* Its unconfirmed */ + /* It's unconfirmed */ paddri->spinfo_state = SCTP_UNCONFIRMED; } else if (net->dest_state & SCTP_ADDR_REACHABLE) { - /* The Active */ + /* It's active */ paddri->spinfo_state = SCTP_ACTIVE; } else { - /* It's Inactive */ + /* It's inactive */ paddri->spinfo_state = SCTP_INACTIVE; } paddri->spinfo_cwnd = net->cwnd; @@ -2422,10 +2422,10 @@ flags_out: /* It's unconfirmed */ sstat->sstat_primary.spinfo_state = SCTP_UNCONFIRMED; } else if (net->dest_state & SCTP_ADDR_REACHABLE) { - /* Its active */ + /* It's active */ sstat->sstat_primary.spinfo_state = SCTP_ACTIVE; } else { - /* It's Inactive */ + /* It's inactive */ sstat->sstat_primary.spinfo_state = SCTP_INACTIVE; } sstat->sstat_primary.spinfo_cwnd = net->cwnd; From owner-svn-src-all@FreeBSD.ORG Thu Jan 20 15:02:51 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F1AA1065670; Thu, 20 Jan 2011 15:02:51 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5E4BD8FC14; Thu, 20 Jan 2011 15:02:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0KF2paZ017674; Thu, 20 Jan 2011 15:02:51 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0KF2pr9017672; Thu, 20 Jan 2011 15:02:51 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201101201502.p0KF2pr9017672@svn.freebsd.org> From: Nathan Whitehorn Date: Thu, 20 Jan 2011 15:02: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: r217639 - head/sys/powerpc/powermac X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jan 2011 15:02:51 -0000 Author: nwhitehorn Date: Thu Jan 20 15:02:51 2011 New Revision: 217639 URL: http://svn.freebsd.org/changeset/base/217639 Log: Correct parsing of the cpcht ranges property. Submitted by: andreast MFC after: 2 weeks Modified: head/sys/powerpc/powermac/cpcht.c Modified: head/sys/powerpc/powermac/cpcht.c ============================================================================== --- head/sys/powerpc/powermac/cpcht.c Thu Jan 20 13:53:34 2011 (r217638) +++ head/sys/powerpc/powermac/cpcht.c Thu Jan 20 15:02:51 2011 (r217639) @@ -282,7 +282,7 @@ cpcht_configure_htbridge(device_t dev, p { struct cpcht_softc *sc; struct ofw_pci_register pcir; - struct cpcht_range ranges[6], *rp; + struct cpcht_range ranges[7], *rp; int nranges, ptr, nextptr; uint32_t vend, val; int i, nirq, irq; @@ -306,9 +306,10 @@ cpcht_configure_htbridge(device_t dev, p */ bzero(ranges, sizeof(ranges)); nranges = OF_getprop(child, "ranges", ranges, sizeof(ranges)); + nranges /= sizeof(ranges[0]); ranges[6].pci_hi = 0; - for (rp = ranges; rp->pci_hi != 0; rp++) { + for (rp = ranges; rp < ranges + nranges && rp->pci_hi != 0; rp++) { switch (rp->pci_hi & OFW_PCI_PHYS_HI_SPACEMASK) { case OFW_PCI_PHYS_HI_SPACE_CONFIG: break; From owner-svn-src-all@FreeBSD.ORG Thu Jan 20 15:06:42 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DA22F106564A; Thu, 20 Jan 2011 15:06:42 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C8A598FC15; Thu, 20 Jan 2011 15:06:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0KF6g0T017828; Thu, 20 Jan 2011 15:06:42 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0KF6grs017826; Thu, 20 Jan 2011 15:06:42 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201101201506.p0KF6grs017826@svn.freebsd.org> From: Nathan Whitehorn Date: Thu, 20 Jan 2011 15:06:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217640 - stable/8/sys/geom/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jan 2011 15:06:43 -0000 Author: nwhitehorn Date: Thu Jan 20 15:06:42 2011 New Revision: 217640 URL: http://svn.freebsd.org/changeset/base/217640 Log: MFC r217040: Add an entry to the gpart XML to determine if the geom has pending changes that need to be committed (or undone). Modified: stable/8/sys/geom/part/g_part.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/geom/part/g_part.c ============================================================================== --- stable/8/sys/geom/part/g_part.c Thu Jan 20 15:02:51 2011 (r217639) +++ stable/8/sys/geom/part/g_part.c Thu Jan 20 15:06:42 2011 (r217640) @@ -1796,6 +1796,8 @@ g_part_dumpconf(struct sbuf *sb, const c table->gpt_heads); sbuf_printf(sb, "%s%s\n", indent, table->gpt_corrupt ? "CORRUPT": "OK"); + sbuf_printf(sb, "%s%s\n", indent, + table->gpt_opened ? "true": "false"); G_PART_DUMPCONF(table, NULL, sb, indent); } } From owner-svn-src-all@FreeBSD.ORG Thu Jan 20 15:09:11 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC2A1106566C; Thu, 20 Jan 2011 15:09:11 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9EC658FC0C; Thu, 20 Jan 2011 15:09:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0KF9BgM017921; Thu, 20 Jan 2011 15:09:11 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0KF9BvJ017919; Thu, 20 Jan 2011 15:09:11 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201101201509.p0KF9BvJ017919@svn.freebsd.org> From: Adrian Chadd Date: Thu, 20 Jan 2011 15:09:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217641 - head/sys/dev/ath/ath_hal/ar9002 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jan 2011 15:09:11 -0000 Author: adrian Date: Thu Jan 20 15:09:11 2011 New Revision: 217641 URL: http://svn.freebsd.org/changeset/base/217641 Log: ar9280SetAntennaSwitch() was using the AR5416 chainmasks (3 chains) rather than the AR9280 chainmasks (2 chains) Modified: head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Modified: head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Thu Jan 20 15:06:42 2011 (r217640) +++ head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Thu Jan 20 15:09:11 2011 (r217641) @@ -717,8 +717,8 @@ ar9280SetAntennaSwitch(struct ath_hal *a case HAL_ANT_VARIABLE: /* Restore original chainmask settings */ /* XXX */ - ahp->ah_tx_chainmask = AR5416_DEFAULT_TXCHAINMASK; - ahp->ah_rx_chainmask = AR5416_DEFAULT_RXCHAINMASK; + ahp->ah_tx_chainmask = AR9280_DEFAULT_TXCHAINMASK; + ahp->ah_rx_chainmask = AR9280_DEFAULT_RXCHAINMASK; break; } return AH_TRUE; From owner-svn-src-all@FreeBSD.ORG Thu Jan 20 15:22:02 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 564A7106566B; Thu, 20 Jan 2011 15:22:02 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 459528FC17; Thu, 20 Jan 2011 15:22:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0KFM2xo018302; Thu, 20 Jan 2011 15:22:02 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0KFM20K018298; Thu, 20 Jan 2011 15:22:02 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <201101201522.p0KFM20K018298@svn.freebsd.org> From: Hajimu UMEMOTO Date: Thu, 20 Jan 2011 15:22: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: r217642 - head/usr.bin/netstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jan 2011 15:22:02 -0000 Author: ume Date: Thu Jan 20 15:22:01 2011 New Revision: 217642 URL: http://svn.freebsd.org/changeset/base/217642 Log: - Hide the internal scope address representation of the KAME IPv6 stack from the output of `netstat -ani'. - The node-local multicast address in the output of `netstat -rn' should be handled as well. Spotted by: Bernd Walter Modified: head/usr.bin/netstat/if.c head/usr.bin/netstat/netstat.h head/usr.bin/netstat/route.c Modified: head/usr.bin/netstat/if.c ============================================================================== --- head/usr.bin/netstat/if.c Thu Jan 20 15:09:11 2011 (r217641) +++ head/usr.bin/netstat/if.c Thu Jan 20 15:22:01 2011 (r217642) @@ -59,6 +59,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef INET6 +#include +#endif #include #include #include @@ -75,7 +78,7 @@ static void sidewaysintpr(int, u_long); static void catchalarm(int); #ifdef INET6 -static char ntop_buf[INET6_ADDRSTRLEN]; /* for inet_ntop() */ +static char addr_buf[NI_MAXHOST]; /* for getnameinfo() */ #endif /* @@ -339,13 +342,14 @@ intpr(int interval1, u_long ifnetaddr, v #ifdef INET6 case AF_INET6: sockin6 = (struct sockaddr_in6 *)sa; + in6_fillscopeid(&ifaddr.in6.ia_addr); printf("%-13.13s ", netname6(&ifaddr.in6.ia_addr, &ifaddr.in6.ia_prefixmask.sin6_addr)); - printf("%-17.17s ", - inet_ntop(AF_INET6, - &sockin6->sin6_addr, - ntop_buf, sizeof(ntop_buf))); + in6_fillscopeid(sockin6); + getnameinfo(sa, sa->sa_len, addr_buf, + sizeof(addr_buf), 0, 0, NI_NUMERICHOST); + printf("%-17.17s ", addr_buf); network_layer = 1; break; @@ -465,13 +469,13 @@ intpr(int interval1, u_long ifnetaddr, v break; #ifdef INET6 case AF_INET6: + in6_fillscopeid(&msa.in6); + getnameinfo(&msa.sa, msa.sa.sa_len, + addr_buf, sizeof(addr_buf), 0, 0, + NI_NUMERICHOST); printf("%*s %-19.19s(refs: %d)\n", Wflag ? 27 : 25, "", - inet_ntop(AF_INET6, - &msa.in6.sin6_addr, - ntop_buf, - sizeof(ntop_buf)), - ifma.ifma_refcount); + addr_buf, ifma.ifma_refcount); break; #endif /* INET6 */ case AF_LINK: Modified: head/usr.bin/netstat/netstat.h ============================================================================== --- head/usr.bin/netstat/netstat.h Thu Jan 20 15:09:11 2011 (r217641) +++ head/usr.bin/netstat/netstat.h Thu Jan 20 15:22:01 2011 (r217642) @@ -101,6 +101,7 @@ void mrt6_stats(u_long); struct sockaddr_in6; struct in6_addr; +void in6_fillscopeid(struct sockaddr_in6 *); char *routename6(struct sockaddr_in6 *); const char *netname6(struct sockaddr_in6 *, struct in6_addr *); void inet6print(struct in6_addr *, int, const char *, int); Modified: head/usr.bin/netstat/route.c ============================================================================== --- head/usr.bin/netstat/route.c Thu Jan 20 15:09:11 2011 (r217641) +++ head/usr.bin/netstat/route.c Thu Jan 20 15:22:01 2011 (r217642) @@ -633,18 +633,8 @@ fmt_sockaddr(struct sockaddr *sa, struct case AF_INET6: { struct sockaddr_in6 *sa6 = (struct sockaddr_in6 *)sa; - struct in6_addr *in6 = &sa6->sin6_addr; - /* - * XXX: This is a special workaround for KAME kernels. - * sin6_scope_id field of SA should be set in the future. - */ - if (IN6_IS_ADDR_LINKLOCAL(in6) || - IN6_IS_ADDR_MC_LINKLOCAL(in6)) { - /* XXX: override is ok? */ - sa6->sin6_scope_id = (u_int32_t)ntohs(*(u_short *)&in6->s6_addr[2]); - *(u_short *)&in6->s6_addr[2] = 0; - } + in6_fillscopeid(sa6); if (flags & RTF_HOST) cp = routename6(sa6); @@ -895,6 +885,25 @@ netname(in_addr_t in, u_long mask) #undef NSHIFT #ifdef INET6 +void +in6_fillscopeid(struct sockaddr_in6 *sa6) +{ +#if defined(__KAME__) + /* + * XXX: This is a special workaround for KAME kernels. + * sin6_scope_id field of SA should be set in the future. + */ + if (IN6_IS_ADDR_LINKLOCAL(&sa6->sin6_addr) || + IN6_IS_ADDR_MC_NODELOCAL(&sa6->sin6_addr) || + IN6_IS_ADDR_MC_LINKLOCAL(&sa6->sin6_addr)) { + /* XXX: override is ok? */ + sa6->sin6_scope_id = + ntohs(*(u_int16_t *)&sa6->sin6_addr.s6_addr[2]); + sa6->sin6_addr.s6_addr[2] = sa6->sin6_addr.s6_addr[3] = 0; + } +#endif +} + const char * netname6(struct sockaddr_in6 *sa6, struct in6_addr *mask) { From owner-svn-src-all@FreeBSD.ORG Thu Jan 20 15:56:04 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 09B131065674; Thu, 20 Jan 2011 15:56:04 +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 ED7258FC18; Thu, 20 Jan 2011 15:56:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0KFu3n9019110; Thu, 20 Jan 2011 15:56:03 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0KFu3dn019108; Thu, 20 Jan 2011 15:56:03 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201101201556.p0KFu3dn019108@svn.freebsd.org> From: Warner Losh Date: Thu, 20 Jan 2011 15:56:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217643 - releng/8.2/sys/modules X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jan 2011 15:56:04 -0000 Author: imp Date: Thu Jan 20 15:56:03 2011 New Revision: 217643 URL: http://svn.freebsd.org/changeset/base/217643 Log: MF8 r217553: The cxgb module wasn't being built. Now it is built on all !arm and !mips builds. It always built in a kernel config file. Approved by: re (bz) Modified: releng/8.2/sys/modules/Makefile Directory Properties: releng/8.2/sys/ (props changed) releng/8.2/sys/amd64/include/xen/ (props changed) releng/8.2/sys/cddl/contrib/opensolaris/ (props changed) releng/8.2/sys/contrib/dev/acpica/ (props changed) releng/8.2/sys/contrib/pf/ (props changed) Modified: releng/8.2/sys/modules/Makefile ============================================================================== --- releng/8.2/sys/modules/Makefile Thu Jan 20 15:22:01 2011 (r217642) +++ releng/8.2/sys/modules/Makefile Thu Jan 20 15:56:03 2011 (r217643) @@ -339,6 +339,8 @@ _siba_bwn= siba_bwn _sym= sym # no uart_cpu_$MACHINE_ARCH _uart= uart +# disable_intr() interferes +_cxgb= cxgb .endif .if ${MK_CRYPT} != "no" || defined(ALL_MODULES) From owner-svn-src-all@FreeBSD.ORG Thu Jan 20 16:03:29 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2AEFC106566C; Thu, 20 Jan 2011 16:03:29 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1AAD78FC1C; Thu, 20 Jan 2011 16:03:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0KG3S1F019305; Thu, 20 Jan 2011 16:03:29 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0KG3SOW019303; Thu, 20 Jan 2011 16:03:28 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201101201603.p0KG3SOW019303@svn.freebsd.org> From: John Baldwin Date: Thu, 20 Jan 2011 16:03: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: r217644 - head/sys/boot/forth X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jan 2011 16:03:29 -0000 Author: jhb Date: Thu Jan 20 16:03:28 2011 New Revision: 217644 URL: http://svn.freebsd.org/changeset/base/217644 Log: Fix a stack leak in r215345 when skipping over the ACPI menu item for machines that do not support ACPI. Submitted by: olli Modified: head/sys/boot/forth/beastie.4th Modified: head/sys/boot/forth/beastie.4th ============================================================================== --- head/sys/boot/forth/beastie.4th Thu Jan 20 15:56:03 2011 (r217643) +++ head/sys/boot/forth/beastie.4th Thu Jan 20 16:03:28 2011 (r217644) @@ -193,7 +193,7 @@ at-xy ." `--{__________) " then else menuidx @ - 1+ dup + 1+ menuidx ! -2 bootacpikey ! then From owner-svn-src-all@FreeBSD.ORG Thu Jan 20 17:03:10 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 53D991065674; Thu, 20 Jan 2011 17:03:10 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 436578FC0C; Thu, 20 Jan 2011 17:03:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0KH3AdO021406; Thu, 20 Jan 2011 17:03:10 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0KH3AmH021404; Thu, 20 Jan 2011 17:03:10 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201101201703.p0KH3AmH021404@svn.freebsd.org> From: Gavin Atkinson Date: Thu, 20 Jan 2011 17:03:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217645 - svnadmin/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jan 2011 17:03:10 -0000 Author: gavin Date: Thu Jan 20 17:03:09 2011 New Revision: 217645 URL: http://svn.freebsd.org/changeset/base/217645 Log: Konrad Jankowski (versus@) will now be mentored by myself and Max Kohn (fjoe@) as Diomidis Spinellis (dds@) has handed his commit bit in for safekeeping. Approved by: core Modified: svnadmin/conf/mentors Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Thu Jan 20 16:03:28 2011 (r217644) +++ svnadmin/conf/mentors Thu Jan 20 17:03:09 2011 (r217645) @@ -28,6 +28,6 @@ sbruno scottl snb dwmalone sson gnn tijl kib -versus dds +versus gavin Co-mentor: fjoe will ken zack zml From owner-svn-src-all@FreeBSD.ORG Thu Jan 20 17:28:57 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5DDDF106564A; Thu, 20 Jan 2011 17:28:57 +0000 (UTC) (envelope-from ryusuke@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4D21E8FC14; Thu, 20 Jan 2011 17:28:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0KHSvfZ021973; Thu, 20 Jan 2011 17:28:57 GMT (envelope-from ryusuke@svn.freebsd.org) Received: (from ryusuke@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0KHSvAF021971; Thu, 20 Jan 2011 17:28:57 GMT (envelope-from ryusuke@svn.freebsd.org) Message-Id: <201101201728.p0KHSvAF021971@svn.freebsd.org> From: Ryusuke SUZUKI Date: Thu, 20 Jan 2011 17:28: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: r217646 - head/share/misc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jan 2011 17:28:57 -0000 Author: ryusuke (doc committer) Date: Thu Jan 20 17:28:57 2011 New Revision: 217646 URL: http://svn.freebsd.org/changeset/base/217646 Log: Add myself to the list of doc commiters. Modified: head/share/misc/committers-doc.dot Modified: head/share/misc/committers-doc.dot ============================================================================== --- head/share/misc/committers-doc.dot Thu Jan 20 17:03:09 2011 (r217645) +++ head/share/misc/committers-doc.dot Thu Jan 20 17:28:57 2011 (r217646) @@ -74,6 +74,7 @@ pav [label="Pav Lucistnik\npav@FreeBSD.o remko [label="Remko Lodder\nremko@FreeBSD.org\n2004/10/16"] rene [label="Rene Ladan\nrene@FreeBSD.org\n2008/11/03"] roam [label="Peter Pentchev\nroam@FreeBSD.org\n2003/02/14"] +ryusuke [label="Ryusuke Suzuki\nryusuke@FreeBSD.org\n2009/12/21"] simon [label="Simon L. Nielsen\nsimon@FreeBSD.org\n2003/07/20"] taras [label="Taras Korenko\ntaras@FreeBSD.org\n2010/06/25"] trhodes [label="Tom Rhodes\ntrhodes@FreeBSD.org\n2002/03/25"] From owner-svn-src-all@FreeBSD.ORG Thu Jan 20 17:41:25 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 41822106566B; Thu, 20 Jan 2011 17:41:25 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 15E708FC12; Thu, 20 Jan 2011 17:41:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0KHfOoB022271; Thu, 20 Jan 2011 17:41:24 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0KHfOel022269; Thu, 20 Jan 2011 17:41:24 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201101201741.p0KHfOel022269@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 20 Jan 2011 17:41:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217647 - releng/8.2/sys/dev/re X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jan 2011 17:41:25 -0000 Author: yongari Date: Thu Jan 20 17:41:24 2011 New Revision: 217647 URL: http://svn.freebsd.org/changeset/base/217647 Log: MFC r217296: For re(4) controllers that uses new jumbo frame scheme(RTL8168C/D/E), limit maximum RX buffer size to RE_RX_DESC_BUFLEN instead of blindly configuring it to 16KB. Due to lack of documentation, re(4) didn't allow jumbo frame on these controllers. However it seems controller is confused with jumbo frame such that it can DMA the received frame to wrong address instead of splitting it into multiple RX buffers. Of course, this caused panic. Since re(4) does not support jumbo frames on these controllers, make controller drop frame that is longer than RE_RX_DESC_BUFLEN sized frame. Fortunately RTL810x controllers, which do not support jumbo frame, have no such issues but this change also limited maximum RX buffer size allowed to RTL810x controllers. Allowing 16KB RX buffer for controllers that have no such capability is meaningless. Approved by: re (bz) Modified: releng/8.2/sys/dev/re/if_re.c Directory Properties: releng/8.2/sys/ (props changed) releng/8.2/sys/amd64/include/xen/ (props changed) releng/8.2/sys/cddl/contrib/opensolaris/ (props changed) releng/8.2/sys/contrib/dev/acpica/ (props changed) releng/8.2/sys/contrib/pf/ (props changed) Modified: releng/8.2/sys/dev/re/if_re.c ============================================================================== --- releng/8.2/sys/dev/re/if_re.c Thu Jan 20 17:28:57 2011 (r217646) +++ releng/8.2/sys/dev/re/if_re.c Thu Jan 20 17:41:24 2011 (r217647) @@ -2779,8 +2779,13 @@ re_init_locked(struct rl_softc *sc) * For 8169 gigE NICs, set the max allowed RX packet * size so we can receive jumbo frames. */ - if (sc->rl_type == RL_8169) - CSR_WRITE_2(sc, RL_MAXRXPKTLEN, 16383); + if (sc->rl_type == RL_8169) { + if ((sc->rl_flags & (RL_FLAG_PCIE | RL_FLAG_NOJUMBO)) == + (RL_FLAG_PCIE | RL_FLAG_NOJUMBO)) + CSR_WRITE_2(sc, RL_MAXRXPKTLEN, RE_RX_DESC_BUFLEN); + else + CSR_WRITE_2(sc, RL_MAXRXPKTLEN, 16383); + } if (sc->rl_testmode) return; From owner-svn-src-all@FreeBSD.ORG Thu Jan 20 17:42:43 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 17C3E1065673; Thu, 20 Jan 2011 17:42:43 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E28208FC1C; Thu, 20 Jan 2011 17:42:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0KHgghj022347; Thu, 20 Jan 2011 17:42:42 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0KHggnj022345; Thu, 20 Jan 2011 17:42:42 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201101201742.p0KHggnj022345@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 20 Jan 2011 17:42:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217648 - releng/7.4/sys/dev/re X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jan 2011 17:42:43 -0000 Author: yongari Date: Thu Jan 20 17:42:42 2011 New Revision: 217648 URL: http://svn.freebsd.org/changeset/base/217648 Log: MFC r217296: For re(4) controllers that uses new jumbo frame scheme(RTL8168C/D/E), limit maximum RX buffer size to RE_RX_DESC_BUFLEN instead of blindly configuring it to 16KB. Due to lack of documentation, re(4) didn't allow jumbo frame on these controllers. However it seems controller is confused with jumbo frame such that it can DMA the received frame to wrong address instead of splitting it into multiple RX buffers. Of course, this caused panic. Since re(4) does not support jumbo frames on these controllers, make controller drop frame that is longer than RE_RX_DESC_BUFLEN sized frame. Fortunately RTL810x controllers, which do not support jumbo frame, have no such issues but this change also limited maximum RX buffer size allowed to RTL810x controllers. Allowing 16KB RX buffer for controllers that have no such capability is meaningless. Approved by: re (bz) Modified: releng/7.4/sys/dev/re/if_re.c Directory Properties: releng/7.4/sys/ (props changed) releng/7.4/sys/cddl/contrib/opensolaris/ (props changed) releng/7.4/sys/contrib/dev/acpica/ (props changed) releng/7.4/sys/contrib/pf/ (props changed) Modified: releng/7.4/sys/dev/re/if_re.c ============================================================================== --- releng/7.4/sys/dev/re/if_re.c Thu Jan 20 17:41:24 2011 (r217647) +++ releng/7.4/sys/dev/re/if_re.c Thu Jan 20 17:42:42 2011 (r217648) @@ -2773,8 +2773,13 @@ re_init_locked(struct rl_softc *sc) * For 8169 gigE NICs, set the max allowed RX packet * size so we can receive jumbo frames. */ - if (sc->rl_type == RL_8169) - CSR_WRITE_2(sc, RL_MAXRXPKTLEN, 16383); + if (sc->rl_type == RL_8169) { + if ((sc->rl_flags & (RL_FLAG_PCIE | RL_FLAG_NOJUMBO)) == + (RL_FLAG_PCIE | RL_FLAG_NOJUMBO)) + CSR_WRITE_2(sc, RL_MAXRXPKTLEN, RE_RX_DESC_BUFLEN); + else + CSR_WRITE_2(sc, RL_MAXRXPKTLEN, 16383); + } if (sc->rl_testmode) return; From owner-svn-src-all@FreeBSD.ORG Thu Jan 20 18:26:35 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E94901065672; Thu, 20 Jan 2011 18:26:33 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C2D7D8FC13; Thu, 20 Jan 2011 18:26:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0KIQXrI023509; Thu, 20 Jan 2011 18:26:33 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0KIQXbQ023506; Thu, 20 Jan 2011 18:26:33 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201101201826.p0KIQXbQ023506@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 20 Jan 2011 18:26:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217649 - head/sys/dev/alc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jan 2011 18:26:35 -0000 Author: yongari Date: Thu Jan 20 18:26:33 2011 New Revision: 217649 URL: http://svn.freebsd.org/changeset/base/217649 Log: Correct wrong definition of PM timer mask and adjust L1/PM timer value. While I'm here enable all clocks before initializing controller. This change should fix lockup issue seen on AR8152 v1.1 PCIe Fast Ethernet controller. PR: kern/154076 MFC after: 3 days Modified: head/sys/dev/alc/if_alc.c head/sys/dev/alc/if_alcreg.h Modified: head/sys/dev/alc/if_alc.c ============================================================================== --- head/sys/dev/alc/if_alc.c Thu Jan 20 17:42:42 2011 (r217648) +++ head/sys/dev/alc/if_alc.c Thu Jan 20 18:26:33 2011 (r217649) @@ -677,7 +677,7 @@ alc_aspm(struct alc_softc *sc, int media pmcfg &= ~PM_CFG_SERDES_PD_EX_L1; pmcfg &= ~(PM_CFG_L1_ENTRY_TIMER_MASK | PM_CFG_LCKDET_TIMER_MASK); pmcfg |= PM_CFG_MAC_ASPM_CHK; - pmcfg |= PM_CFG_SERDES_ENB | PM_CFG_RBER_ENB; + pmcfg |= (PM_CFG_LCKDET_TIMER_DEFAULT << PM_CFG_LCKDET_TIMER_SHIFT); pmcfg &= ~(PM_CFG_ASPM_L1_ENB | PM_CFG_ASPM_L0S_ENB); if ((sc->alc_flags & ALC_FLAG_APS) != 0) { @@ -3148,6 +3148,9 @@ alc_init_locked(struct alc_softc *sc) alc_init_cmb(sc); alc_init_smb(sc); + /* Enable all clocks. */ + CSR_WRITE_4(sc, ALC_CLK_GATING_CFG, 0); + /* Reprogram the station address. */ bcopy(IF_LLADDR(ifp), eaddr, ETHER_ADDR_LEN); CSR_WRITE_4(sc, ALC_PAR0, Modified: head/sys/dev/alc/if_alcreg.h ============================================================================== --- head/sys/dev/alc/if_alcreg.h Thu Jan 20 17:42:42 2011 (r217648) +++ head/sys/dev/alc/if_alcreg.h Thu Jan 20 18:26:33 2011 (r217649) @@ -109,7 +109,7 @@ #define PM_CFG_PCIE_RECV 0x00008000 #define PM_CFG_L1_ENTRY_TIMER_MASK 0x000F0000 #define PM_CFG_PM_REQ_TIMER_MASK 0x00F00000 -#define PM_CFG_LCKDET_TIMER_MASK 0x3F000000 +#define PM_CFG_LCKDET_TIMER_MASK 0x0F000000 #define PM_CFG_EN_BUFS_RX_L0S 0x10000000 #define PM_CFG_SA_DLY_ENB 0x20000000 #define PM_CFG_MAC_ASPM_CHK 0x40000000 @@ -120,8 +120,9 @@ #define PM_CFG_LCKDET_TIMER_SHIFT 24 #define PM_CFG_L0S_ENTRY_TIMER_DEFAULT 6 -#define PM_CFG_L1_ENTRY_TIMER_DEFAULT 12 -#define PM_CFG_PM_REQ_TIMER_DEFAULT 1 +#define PM_CFG_L1_ENTRY_TIMER_DEFAULT 1 +#define PM_CFG_LCKDET_TIMER_DEFAULT 12 +#define PM_CFG_PM_REQ_TIMER_DEFAULT 12 #define ALC_LTSSM_ID_CFG 0x12FC #define LTSSM_ID_WRO_ENB 0x00001000 @@ -724,6 +725,14 @@ #define ALC_TX_MIB_BASE 0x1760 +#define ALC_CLK_GATING_CFG 0x1814 +#define CLK_GATING_DMAW_ENB 0x0001 +#define CLK_GATING_DMAR_ENB 0x0002 +#define CLK_GATING_TXQ_ENB 0x0004 +#define CLK_GATING_RXQ_ENB 0x0008 +#define CLK_GATING_TXMAC_ENB 0x0010 +#define CLK_GATING_RXMAC_ENB 0x0020 + #define ALC_DEBUG_DATA0 0x1900 #define ALC_DEBUG_DATA1 0x1904 From owner-svn-src-all@FreeBSD.ORG Thu Jan 20 18:41:47 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 33419106566B; Thu, 20 Jan 2011 18:41:47 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1F5F58FC08; Thu, 20 Jan 2011 18:41:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0KIfltm023970; Thu, 20 Jan 2011 18:41:47 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0KIfk5q023959; Thu, 20 Jan 2011 18:41:46 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201101201841.p0KIfk5q023959@svn.freebsd.org> From: Bernhard Schmidt Date: Thu, 20 Jan 2011 18:41:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217650 - in stable/8/sys: dev/bwi dev/bwn dev/iwn dev/ral dev/usb/wlan dev/wpi net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jan 2011 18:41:47 -0000 Author: bschmidt Date: Thu Jan 20 18:41:46 2011 New Revision: 217650 URL: http://svn.freebsd.org/changeset/base/217650 Log: MFC r217511: Pull ieee80211_ratectl_node_init() calls from drivers into net80211. This fixes hostap mode for at least ral(4) and run(4), because there is no sufficient call into drivers which could be used initialize the node related ratectl variables. Modified: stable/8/sys/dev/bwi/if_bwi.c stable/8/sys/dev/bwn/if_bwn.c stable/8/sys/dev/iwn/if_iwn.c stable/8/sys/dev/ral/rt2560.c stable/8/sys/dev/ral/rt2661.c stable/8/sys/dev/usb/wlan/if_rum.c stable/8/sys/dev/usb/wlan/if_run.c stable/8/sys/dev/usb/wlan/if_ural.c stable/8/sys/dev/wpi/if_wpi.c stable/8/sys/net80211/ieee80211_node.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/bwi/if_bwi.c ============================================================================== --- stable/8/sys/dev/bwi/if_bwi.c Thu Jan 20 18:26:33 2011 (r217649) +++ stable/8/sys/dev/bwi/if_bwi.c Thu Jan 20 18:41:46 2011 (r217650) @@ -1764,7 +1764,6 @@ static int bwi_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) { struct bwi_vap *bvp = BWI_VAP(vap); - const struct ieee80211_txparam *tp; struct ieee80211com *ic= vap->iv_ic; struct ifnet *ifp = ic->ic_ifp; enum ieee80211_state ostate = vap->iv_state; @@ -1818,11 +1817,6 @@ bwi_newstate(struct ieee80211vap *vap, e sc->sc_txpwrcb_type = BWI_TXPWR_CALIB; #endif - /* Initializes ratectl for a node. */ - tp = &vap->iv_txparms[ieee80211_chan2mode(ic->ic_curchan)]; - if (tp->ucastrate == IEEE80211_FIXED_RATE_NONE) - ieee80211_ratectl_node_init(vap->iv_bss); - callout_reset(&sc->sc_calib_ch, hz, bwi_calibrate, sc); } back: Modified: stable/8/sys/dev/bwn/if_bwn.c ============================================================================== --- stable/8/sys/dev/bwn/if_bwn.c Thu Jan 20 18:26:33 2011 (r217649) +++ stable/8/sys/dev/bwn/if_bwn.c Thu Jan 20 18:41:46 2011 (r217650) @@ -8329,7 +8329,6 @@ bwn_phy_reset(struct bwn_mac *mac) static int bwn_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) { - const struct ieee80211_txparam *tp; struct bwn_vap *bvp = BWN_VAP(vap); struct ieee80211com *ic= vap->iv_ic; struct ifnet *ifp = ic->ic_ifp; @@ -8378,11 +8377,6 @@ bwn_newstate(struct ieee80211vap *vap, e bwn_set_pretbtt(mac); bwn_spu_setdelay(mac, 0); bwn_set_macaddr(mac); - - /* Initializes ratectl for a node. */ - tp = &vap->iv_txparms[ieee80211_chan2mode(ic->ic_curchan)]; - if (tp->ucastrate == IEEE80211_FIXED_RATE_NONE) - ieee80211_ratectl_node_init(vap->iv_bss); } BWN_UNLOCK(sc); Modified: stable/8/sys/dev/iwn/if_iwn.c ============================================================================== --- stable/8/sys/dev/iwn/if_iwn.c Thu Jan 20 18:26:33 2011 (r217649) +++ stable/8/sys/dev/iwn/if_iwn.c Thu Jan 20 18:41:46 2011 (r217650) @@ -122,7 +122,6 @@ static void iwn_read_eeprom_channels(str static void iwn_read_eeprom_enhinfo(struct iwn_softc *); static struct ieee80211_node *iwn_node_alloc(struct ieee80211vap *, const uint8_t mac[IEEE80211_ADDR_LEN]); -static void iwn_newassoc(struct ieee80211_node *, int); static int iwn_media_change(struct ifnet *); static int iwn_newstate(struct ieee80211vap *, enum ieee80211_state, int); static void iwn_rx_phy(struct iwn_softc *, struct iwn_rx_desc *, @@ -652,7 +651,6 @@ iwn_attach(device_t dev) ic->ic_vap_delete = iwn_vap_delete; ic->ic_raw_xmit = iwn_raw_xmit; ic->ic_node_alloc = iwn_node_alloc; - ic->ic_newassoc = iwn_newassoc; ic->ic_wme.wme_update = iwn_wme_update; ic->ic_update_mcast = iwn_update_mcast; ic->ic_scan_start = iwn_scan_start; @@ -1929,13 +1927,6 @@ iwn_node_alloc(struct ieee80211vap *vap, return malloc(sizeof (struct iwn_node), M_80211_NODE,M_NOWAIT | M_ZERO); } -static void -iwn_newassoc(struct ieee80211_node *ni, int isnew) -{ - /* XXX move */ - ieee80211_ratectl_node_init(ni); -} - static int iwn_media_change(struct ifnet *ifp) { Modified: stable/8/sys/dev/ral/rt2560.c ============================================================================== --- stable/8/sys/dev/ral/rt2560.c Thu Jan 20 18:26:33 2011 (r217649) +++ stable/8/sys/dev/ral/rt2560.c Thu Jan 20 18:41:46 2011 (r217650) @@ -103,7 +103,6 @@ static void rt2560_reset_rx_ring(struct struct rt2560_rx_ring *); static void rt2560_free_rx_ring(struct rt2560_softc *, struct rt2560_rx_ring *); -static void rt2560_newassoc(struct ieee80211_node *, int); static int rt2560_newstate(struct ieee80211vap *, enum ieee80211_state, int); static uint16_t rt2560_eeprom_read(struct rt2560_softc *, uint8_t); @@ -301,7 +300,6 @@ rt2560_attach(device_t dev, int id) ieee80211_init_channels(ic, NULL, &bands); ieee80211_ifattach(ic, macaddr); - ic->ic_newassoc = rt2560_newassoc; ic->ic_raw_xmit = rt2560_raw_xmit; ic->ic_updateslot = rt2560_update_slot; ic->ic_update_promisc = rt2560_update_promisc; @@ -757,13 +755,6 @@ rt2560_free_rx_ring(struct rt2560_softc bus_dma_tag_destroy(ring->data_dmat); } -static void -rt2560_newassoc(struct ieee80211_node *ni, int isnew) -{ - /* XXX move */ - ieee80211_ratectl_node_init(ni); -} - static int rt2560_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) { Modified: stable/8/sys/dev/ral/rt2661.c ============================================================================== --- stable/8/sys/dev/ral/rt2661.c Thu Jan 20 18:26:33 2011 (r217649) +++ stable/8/sys/dev/ral/rt2661.c Thu Jan 20 18:41:46 2011 (r217650) @@ -100,7 +100,6 @@ static void rt2661_reset_rx_ring(struct struct rt2661_rx_ring *); static void rt2661_free_rx_ring(struct rt2661_softc *, struct rt2661_rx_ring *); -static void rt2661_newassoc(struct ieee80211_node *, int); static int rt2661_newstate(struct ieee80211vap *, enum ieee80211_state, int); static uint16_t rt2661_eeprom_read(struct rt2661_softc *, uint8_t); @@ -304,7 +303,6 @@ rt2661_attach(device_t dev, int id) ieee80211_init_channels(ic, NULL, &bands); ieee80211_ifattach(ic, macaddr); - ic->ic_newassoc = rt2661_newassoc; #if 0 ic->ic_wme.wme_update = rt2661_wme_update; #endif @@ -764,13 +762,6 @@ rt2661_free_rx_ring(struct rt2661_softc bus_dma_tag_destroy(ring->data_dmat); } -static void -rt2661_newassoc(struct ieee80211_node *ni, int isnew) -{ - /* XXX move */ - ieee80211_ratectl_node_init(ni); -} - static int rt2661_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) { Modified: stable/8/sys/dev/usb/wlan/if_rum.c ============================================================================== --- stable/8/sys/dev/usb/wlan/if_rum.c Thu Jan 20 18:26:33 2011 (r217649) +++ stable/8/sys/dev/usb/wlan/if_rum.c Thu Jan 20 18:41:46 2011 (r217650) @@ -2206,8 +2206,6 @@ rum_ratectl_start(struct rum_softc *sc, /* clear statistic registers (STA_CSR0 to STA_CSR5) */ rum_read_multi(sc, RT2573_STA_CSR0, sc->sta, sizeof sc->sta); - ieee80211_ratectl_node_init(ni); - usb_callout_reset(&rvp->ratectl_ch, hz, rum_ratectl_timeout, rvp); } Modified: stable/8/sys/dev/usb/wlan/if_run.c ============================================================================== --- stable/8/sys/dev/usb/wlan/if_run.c Thu Jan 20 18:26:33 2011 (r217649) +++ stable/8/sys/dev/usb/wlan/if_run.c Thu Jan 20 18:41:46 2011 (r217650) @@ -2376,7 +2376,6 @@ run_newassoc(struct ieee80211_node *ni, DPRINTF("new assoc isnew=%d associd=%x addr=%s\n", isnew, ni->ni_associd, ether_sprintf(ni->ni_macaddr)); - ieee80211_ratectl_node_init(ni); sc->sc_ni[wcid] = ni; for (i = 0; i < rs->rs_nrates; i++) { Modified: stable/8/sys/dev/usb/wlan/if_ural.c ============================================================================== --- stable/8/sys/dev/usb/wlan/if_ural.c Thu Jan 20 18:26:33 2011 (r217649) +++ stable/8/sys/dev/usb/wlan/if_ural.c Thu Jan 20 18:41:46 2011 (r217650) @@ -2215,8 +2215,6 @@ ural_ratectl_start(struct ural_softc *sc /* clear statistic registers (STA_CSR0 to STA_CSR10) */ ural_read_multi(sc, RAL_STA_CSR0, sc->sta, sizeof sc->sta); - ieee80211_ratectl_node_init(ni); - usb_callout_reset(&uvp->ratectl_ch, hz, ural_ratectl_timeout, uvp); } Modified: stable/8/sys/dev/wpi/if_wpi.c ============================================================================== --- stable/8/sys/dev/wpi/if_wpi.c Thu Jan 20 18:26:33 2011 (r217649) +++ stable/8/sys/dev/wpi/if_wpi.c Thu Jan 20 18:41:46 2011 (r217650) @@ -174,7 +174,6 @@ static int wpi_alloc_tx_ring(struct wpi_ int, int); static void wpi_reset_tx_ring(struct wpi_softc *, struct wpi_tx_ring *); static void wpi_free_tx_ring(struct wpi_softc *, struct wpi_tx_ring *); -static void wpi_newassoc(struct ieee80211_node *, int); static int wpi_newstate(struct ieee80211vap *, enum ieee80211_state, int); static void wpi_mem_lock(struct wpi_softc *); static void wpi_mem_unlock(struct wpi_softc *); @@ -668,7 +667,6 @@ wpi_attach(device_t dev) ieee80211_ifattach(ic, macaddr); /* override default methods */ ic->ic_raw_xmit = wpi_raw_xmit; - ic->ic_newassoc = wpi_newassoc; ic->ic_wme.wme_update = wpi_wme_update; ic->ic_scan_start = wpi_scan_start; ic->ic_scan_end = wpi_scan_end; @@ -3233,14 +3231,6 @@ wpi_stop(struct wpi_softc *sc) } static void -wpi_newassoc(struct ieee80211_node *ni, int isnew) -{ - - /* XXX move */ - ieee80211_ratectl_node_init(ni); -} - -static void wpi_calib_timeout(void *arg) { struct wpi_softc *sc = arg; Modified: stable/8/sys/net80211/ieee80211_node.c ============================================================================== --- stable/8/sys/net80211/ieee80211_node.c Thu Jan 20 18:26:33 2011 (r217649) +++ stable/8/sys/net80211/ieee80211_node.c Thu Jan 20 18:41:46 2011 (r217650) @@ -1137,6 +1137,8 @@ ieee80211_alloc_node(struct ieee80211_no IEEE80211_NOTE(vap, IEEE80211_MSG_INACT, ni, "%s: inact_reload %u", __func__, ni->ni_inact_reload); + ieee80211_ratectl_node_init(ni); + return ni; } @@ -1174,6 +1176,8 @@ ieee80211_tmp_node(struct ieee80211vap * ni->ni_txpower = bss->ni_txpower; /* XXX optimize away */ ieee80211_psq_init(&ni->ni_psq, "unknown"); + + ieee80211_ratectl_node_init(ni); } else { /* XXX msg */ vap->iv_stats.is_rx_nodealloc++; From owner-svn-src-all@FreeBSD.ORG Thu Jan 20 19:09:02 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F60D106564A; Thu, 20 Jan 2011 19:09:02 +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 7E7608FC13; Thu, 20 Jan 2011 19:09:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0KJ92sB024789; Thu, 20 Jan 2011 19:09:02 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0KJ92UP024787; Thu, 20 Jan 2011 19:09:02 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201101201909.p0KJ92UP024787@svn.freebsd.org> From: Warner Losh Date: Thu, 20 Jan 2011 19:09: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: r217651 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jan 2011 19:09:02 -0000 Author: imp Date: Thu Jan 20 19:09:02 2011 New Revision: 217651 URL: http://svn.freebsd.org/changeset/base/217651 Log: Collapse all the octeon ldscripts down into one now that we don't need one each for all the wacky ABIs Added: head/sys/conf/ldscript.mips.octeon1 - copied, changed from r217648, head/sys/conf/ldscript.mips.octeon1.64 Deleted: head/sys/conf/ldscript.mips.octeon1.32 head/sys/conf/ldscript.mips.octeon1.64 head/sys/conf/ldscript.mips.octeon1.n32 Copied and modified: head/sys/conf/ldscript.mips.octeon1 (from r217648, head/sys/conf/ldscript.mips.octeon1.64) ============================================================================== --- head/sys/conf/ldscript.mips.octeon1.64 Thu Jan 20 17:42:42 2011 (r217648, copy source) +++ head/sys/conf/ldscript.mips.octeon1 Thu Jan 20 19:09:02 2011 (r217651) @@ -1,8 +1,5 @@ /* $FreeBSD$ */ -TARGET(elf64-tradbigmips) -OUTPUT_FORMAT("elf64-tradbigmips", "elf64-tradbigmips", "elf64-tradlittlemips") -OUTPUT_ARCH(mips) ENTRY(_start) __DYNAMIC = 0; PROVIDE (_DYNAMIC = 0); From owner-svn-src-all@FreeBSD.ORG Thu Jan 20 19:16:30 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0ECD4106564A; Thu, 20 Jan 2011 19:16:30 +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 F22EA8FC12; Thu, 20 Jan 2011 19:16:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0KJGT8m025006; Thu, 20 Jan 2011 19:16:29 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0KJGTiW025004; Thu, 20 Jan 2011 19:16:29 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201101201916.p0KJGTiW025004@svn.freebsd.org> From: Warner Losh Date: Thu, 20 Jan 2011 19:16: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: r217652 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jan 2011 19:16:30 -0000 Author: imp Date: Thu Jan 20 19:16:29 2011 New Revision: 217652 URL: http://svn.freebsd.org/changeset/base/217652 Log: We don't need 2 versions here. One will do since binutils outputs the right stuff now. Deleted: head/sys/conf/ldscript.mips.64.cfe Modified: head/sys/conf/ldscript.mips.cfe Modified: head/sys/conf/ldscript.mips.cfe ============================================================================== --- head/sys/conf/ldscript.mips.cfe Thu Jan 20 19:09:02 2011 (r217651) +++ head/sys/conf/ldscript.mips.cfe Thu Jan 20 19:16:29 2011 (r217652) @@ -38,10 +38,6 @@ * sections must be placed in their own segment. */ -OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips", - "elf32-tradlittlemips") - -OUTPUT_ARCH(mips) ENTRY(_start) SEARCH_DIR(/usr/lib); /* Do we need any of these for elf? From owner-svn-src-all@FreeBSD.ORG Thu Jan 20 19:17:05 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D0B51065679; Thu, 20 Jan 2011 19:17:05 +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 4C61B8FC1C; Thu, 20 Jan 2011 19:17:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0KJH51F025063; Thu, 20 Jan 2011 19:17:05 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0KJH51i025059; Thu, 20 Jan 2011 19:17:05 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201101201917.p0KJH51i025059@svn.freebsd.org> From: Warner Losh Date: Thu, 20 Jan 2011 19:17:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217653 - head/sys/mips/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jan 2011 19:17:05 -0000 Author: imp Date: Thu Jan 20 19:17:05 2011 New Revision: 217653 URL: http://svn.freebsd.org/changeset/base/217653 Log: Use simplified ldscripts rather than specific ones Modified: head/sys/mips/conf/OCTEON1 head/sys/mips/conf/SWARM64 head/sys/mips/conf/SWARM64_SMP Modified: head/sys/mips/conf/OCTEON1 ============================================================================== --- head/sys/mips/conf/OCTEON1 Thu Jan 20 19:16:29 2011 (r217652) +++ head/sys/mips/conf/OCTEON1 Thu Jan 20 19:17:05 2011 (r217653) @@ -21,7 +21,7 @@ ident OCTEON1 makeoptions ARCH_FLAGS="-march=octeon -mabi=64" -makeoptions LDSCRIPT_NAME=ldscript.mips.octeon1.64 +makeoptions LDSCRIPT_NAME=ldscript.mips.octeon1 # Don't build any modules yet. makeoptions MODULES_OVERRIDE="" Modified: head/sys/mips/conf/SWARM64 ============================================================================== --- head/sys/mips/conf/SWARM64 Thu Jan 20 19:16:29 2011 (r217652) +++ head/sys/mips/conf/SWARM64 Thu Jan 20 19:17:05 2011 (r217653) @@ -8,7 +8,7 @@ ident SWARM64 machine mips mips64eb makeoptions ARCH_FLAGS="-mabi=64 -march=mips64" -makeoptions LDSCRIPT_NAME=ldscript.mips.64.cfe +makeoptions LDSCRIPT_NAME=ldscript.mips.cfe makeoptions KERNLOADADDR=0xffffffff80001000 # Modified: head/sys/mips/conf/SWARM64_SMP ============================================================================== --- head/sys/mips/conf/SWARM64_SMP Thu Jan 20 19:16:29 2011 (r217652) +++ head/sys/mips/conf/SWARM64_SMP Thu Jan 20 19:17:05 2011 (r217653) @@ -11,7 +11,7 @@ options PRINTF_BUFR_SIZE=128 machine mips mips64eb makeoptions ARCH_FLAGS="-mabi=64 -march=mips64" -makeoptions LDSCRIPT_NAME=ldscript.mips.64.cfe +makeoptions LDSCRIPT_NAME=ldscript.mips.cfe makeoptions KERNLOADADDR=0xffffffff80001000 # From owner-svn-src-all@FreeBSD.ORG Thu Jan 20 19:20:24 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 15D591065674; Thu, 20 Jan 2011 19:20:24 +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 054EB8FC14; Thu, 20 Jan 2011 19:20:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0KJKNvP025226; Thu, 20 Jan 2011 19:20:23 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0KJKNiv025223; Thu, 20 Jan 2011 19:20:23 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201101201920.p0KJKNiv025223@svn.freebsd.org> From: Warner Losh Date: Thu, 20 Jan 2011 19:20: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: r217655 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jan 2011 19:20:24 -0000 Author: imp Date: Thu Jan 20 19:20:23 2011 New Revision: 217655 URL: http://svn.freebsd.org/changeset/base/217655 Log: Remove commented out _DYNAMIC sections. Modified: head/sys/conf/ldscript.mips.cfe head/sys/conf/ldscript.mips.mips64 Modified: head/sys/conf/ldscript.mips.cfe ============================================================================== --- head/sys/conf/ldscript.mips.cfe Thu Jan 20 19:20:10 2011 (r217654) +++ head/sys/conf/ldscript.mips.cfe Thu Jan 20 19:20:23 2011 (r217655) @@ -40,10 +40,6 @@ ENTRY(_start) SEARCH_DIR(/usr/lib); -/* Do we need any of these for elf? - __DYNAMIC = 0; -PROVIDE (_DYNAMIC = 0); -*/ PHDRS { Modified: head/sys/conf/ldscript.mips.mips64 ============================================================================== --- head/sys/conf/ldscript.mips.mips64 Thu Jan 20 19:20:10 2011 (r217654) +++ head/sys/conf/ldscript.mips.mips64 Thu Jan 20 19:20:23 2011 (r217655) @@ -33,10 +33,7 @@ OUTPUT_ARCH(mips) ENTRY(_start) SEARCH_DIR(/usr/lib); -/* Do we need any of these for elf? - __DYNAMIC = 0; -PROVIDE (_DYNAMIC = 0); -*/ + SECTIONS { /* Read-only sections, merged into text segment: */ From owner-svn-src-all@FreeBSD.ORG Thu Jan 20 19:24:51 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E90F106566B; Thu, 20 Jan 2011 19:24:51 +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 D7C708FC14; Thu, 20 Jan 2011 19:24:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0KJOoaB025358; Thu, 20 Jan 2011 19:24:50 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0KJOou7025353; Thu, 20 Jan 2011 19:24:50 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201101201924.p0KJOou7025353@svn.freebsd.org> From: Warner Losh Date: Thu, 20 Jan 2011 19:24:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217656 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jan 2011 19:24:51 -0000 Author: imp Date: Thu Jan 20 19:24:50 2011 New Revision: 217656 URL: http://svn.freebsd.org/changeset/base/217656 Log: In fact, we don't need any of these __DYNAMIC. it is a.out leftover and commented out. Modified: head/sys/conf/ldscript.mips.octeon1 head/sys/conf/ldscript.powerpc head/sys/conf/ldscript.powerpc64 head/sys/conf/ldscript.sparc64 Modified: head/sys/conf/ldscript.mips.octeon1 ============================================================================== --- head/sys/conf/ldscript.mips.octeon1 Thu Jan 20 19:20:23 2011 (r217655) +++ head/sys/conf/ldscript.mips.octeon1 Thu Jan 20 19:24:50 2011 (r217656) @@ -1,8 +1,6 @@ /* $FreeBSD$ */ ENTRY(_start) - __DYNAMIC = 0; -PROVIDE (_DYNAMIC = 0); PHDRS { text PT_LOAD FLAGS(0x7); Modified: head/sys/conf/ldscript.powerpc ============================================================================== --- head/sys/conf/ldscript.powerpc Thu Jan 20 19:20:23 2011 (r217655) +++ head/sys/conf/ldscript.powerpc Thu Jan 20 19:24:50 2011 (r217656) @@ -4,8 +4,6 @@ OUTPUT_FORMAT("elf32-powerpc", "elf32-po OUTPUT_ARCH(powerpc) ENTRY(__start) SEARCH_DIR(/usr/lib); -/* Do we need any of these for elf? - __DYNAMIC = 0; */ PROVIDE (__stack = 0); SECTIONS { Modified: head/sys/conf/ldscript.powerpc64 ============================================================================== --- head/sys/conf/ldscript.powerpc64 Thu Jan 20 19:20:23 2011 (r217655) +++ head/sys/conf/ldscript.powerpc64 Thu Jan 20 19:24:50 2011 (r217656) @@ -4,8 +4,6 @@ OUTPUT_FORMAT("elf64-powerpc", "elf64-po OUTPUT_ARCH(powerpc) ENTRY(__start) SEARCH_DIR(/usr/lib); -/* Do we need any of these for elf? - __DYNAMIC = 0; */ PROVIDE (__stack = 0); SECTIONS { Modified: head/sys/conf/ldscript.sparc64 ============================================================================== --- head/sys/conf/ldscript.sparc64 Thu Jan 20 19:20:23 2011 (r217655) +++ head/sys/conf/ldscript.sparc64 Thu Jan 20 19:24:50 2011 (r217656) @@ -4,8 +4,6 @@ OUTPUT_FORMAT("elf64-sparc", "elf64-spar OUTPUT_ARCH(sparc:v9) ENTRY(_start) SEARCH_DIR(/usr/lib); -/* Do we need any of these for elf? - __DYNAMIC = 0; */ SECTIONS { /* Read-only sections, merged into text segment: */ From owner-svn-src-all@FreeBSD.ORG Thu Jan 20 19:26:28 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 73CC21065670; Thu, 20 Jan 2011 19:26:28 +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 628628FC18; Thu, 20 Jan 2011 19:26:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0KJQSsg025442; Thu, 20 Jan 2011 19:26:28 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0KJQSU4025438; Thu, 20 Jan 2011 19:26:28 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201101201926.p0KJQSU4025438@svn.freebsd.org> From: Warner Losh Date: Thu, 20 Jan 2011 19:26: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: r217657 - in head/sys/boot: arm/at91 powerpc/ofw powerpc/ps3 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jan 2011 19:26:28 -0000 Author: imp Date: Thu Jan 20 19:26:28 2011 New Revision: 217657 URL: http://svn.freebsd.org/changeset/base/217657 Log: Don't need __DYNAMIC here. it is commented out and a.out only -- these are all ELF. Modified: head/sys/boot/arm/at91/linker.cfg head/sys/boot/powerpc/ofw/ldscript.powerpc head/sys/boot/powerpc/ps3/ldscript.powerpc Modified: head/sys/boot/arm/at91/linker.cfg ============================================================================== --- head/sys/boot/arm/at91/linker.cfg Thu Jan 20 19:24:50 2011 (r217656) +++ head/sys/boot/arm/at91/linker.cfg Thu Jan 20 19:26:28 2011 (r217657) @@ -25,8 +25,6 @@ OUTPUT_FORMAT("elf32-littlearm", "elf32- OUTPUT_ARCH(arm) ENTRY(start) SEARCH_DIR(/usr/local/arm/2.95.3/arm-linux/lib); -/* Do we need any of these for elf? - __DYNAMIC = 0; */ SECTIONS { /* Read-only sections, merged into text segment: */ Modified: head/sys/boot/powerpc/ofw/ldscript.powerpc ============================================================================== --- head/sys/boot/powerpc/ofw/ldscript.powerpc Thu Jan 20 19:24:50 2011 (r217656) +++ head/sys/boot/powerpc/ofw/ldscript.powerpc Thu Jan 20 19:26:28 2011 (r217657) @@ -4,8 +4,6 @@ OUTPUT_FORMAT("elf32-powerpc", "elf32-po OUTPUT_ARCH(powerpc:common) ENTRY(_start) SEARCH_DIR(/usr/lib); -/* Do we need any of these for elf? - __DYNAMIC = 0; */ PROVIDE (__stack = 0); SECTIONS { Modified: head/sys/boot/powerpc/ps3/ldscript.powerpc ============================================================================== --- head/sys/boot/powerpc/ps3/ldscript.powerpc Thu Jan 20 19:24:50 2011 (r217656) +++ head/sys/boot/powerpc/ps3/ldscript.powerpc Thu Jan 20 19:26:28 2011 (r217657) @@ -4,8 +4,6 @@ OUTPUT_FORMAT("elf32-powerpc", "elf32-po OUTPUT_ARCH(powerpc:common) ENTRY(_start) SEARCH_DIR(/usr/lib); -/* Do we need any of these for elf? - __DYNAMIC = 0; */ PROVIDE (__stack = 0); SECTIONS { From owner-svn-src-all@FreeBSD.ORG Thu Jan 20 20:22:20 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 618A61065672; Thu, 20 Jan 2011 20:22:20 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 35FCA8FC1D; Thu, 20 Jan 2011 20:22:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0KKMKJ6026936; Thu, 20 Jan 2011 20:22:20 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0KKMKDZ026931; Thu, 20 Jan 2011 20:22:20 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201101202022.p0KKMKDZ026931@svn.freebsd.org> From: Andreas Tobler Date: Thu, 20 Jan 2011 20:22: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: r217658 - head/sys/powerpc/powermac X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jan 2011 20:22:20 -0000 Author: andreast Date: Thu Jan 20 20:22:19 2011 New Revision: 217658 URL: http://svn.freebsd.org/changeset/base/217658 Log: Correct parsing of the grackle and uninorthpci ranges property. Approved by: nwhitehorn (mentor) Modified: head/sys/powerpc/powermac/grackle.c head/sys/powerpc/powermac/gracklevar.h head/sys/powerpc/powermac/uninorthpci.c head/sys/powerpc/powermac/uninorthvar.h Modified: head/sys/powerpc/powermac/grackle.c ============================================================================== --- head/sys/powerpc/powermac/grackle.c Thu Jan 20 19:26:28 2011 (r217657) +++ head/sys/powerpc/powermac/grackle.c Thu Jan 20 20:22:19 2011 (r217658) @@ -199,11 +199,14 @@ grackle_attach(device_t dev) return (ENXIO); } + sc->sc_nrange /= sizeof(sc->sc_range[0]); + sc->sc_range[6].pci_hi = 0; io = NULL; nmem = 0; - for (rp = sc->sc_range; rp->pci_hi != 0; rp++) { + for (rp = sc->sc_range; rp < sc->sc_range + sc->sc_nrange && + rp->pci_hi != 0; rp++) { switch (rp->pci_hi & OFW_PCI_PHYS_HI_SPACEMASK) { case OFW_PCI_PHYS_HI_SPACE_CONFIG: break; Modified: head/sys/powerpc/powermac/gracklevar.h ============================================================================== --- head/sys/powerpc/powermac/gracklevar.h Thu Jan 20 19:26:28 2011 (r217657) +++ head/sys/powerpc/powermac/gracklevar.h Thu Jan 20 20:22:19 2011 (r217658) @@ -45,7 +45,7 @@ struct grackle_softc { vm_offset_t sc_addr; vm_offset_t sc_data; int sc_bus; - struct grackle_range sc_range[6]; + struct grackle_range sc_range[7]; int sc_nrange; int sc_iostart; struct rman sc_io_rman; Modified: head/sys/powerpc/powermac/uninorthpci.c ============================================================================== --- head/sys/powerpc/powermac/uninorthpci.c Thu Jan 20 19:26:28 2011 (r217657) +++ head/sys/powerpc/powermac/uninorthpci.c Thu Jan 20 20:22:19 2011 (r217658) @@ -231,11 +231,14 @@ uninorth_attach(device_t dev) return (ENXIO); } + sc->sc_nrange /= sizeof(sc->sc_range[0]); + sc->sc_range[6].pci_hi = 0; io = NULL; nmem = 0; - for (rp = sc->sc_range; rp->pci_hi != 0; rp++) { + for (rp = sc->sc_range; rp < sc->sc_range + sc->sc_nrange && + rp->pci_hi != 0; rp++) { switch (rp->pci_hi & OFW_PCI_PHYS_HI_SPACEMASK) { case OFW_PCI_PHYS_HI_SPACE_CONFIG: break; Modified: head/sys/powerpc/powermac/uninorthvar.h ============================================================================== --- head/sys/powerpc/powermac/uninorthvar.h Thu Jan 20 19:26:28 2011 (r217657) +++ head/sys/powerpc/powermac/uninorthvar.h Thu Jan 20 20:22:19 2011 (r217658) @@ -53,7 +53,7 @@ struct uninorth_softc { vm_offset_t sc_addr; vm_offset_t sc_data; int sc_bus; - struct uninorth_range sc_range[6]; + struct uninorth_range sc_range[7]; int sc_nrange; int sc_iostart; struct rman sc_io_rman; From owner-svn-src-all@FreeBSD.ORG Thu Jan 20 20:23:03 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EBD5E1065670; Thu, 20 Jan 2011 20:23:03 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DAE218FC0C; Thu, 20 Jan 2011 20:23:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0KKN3Af026986; Thu, 20 Jan 2011 20:23:03 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0KKN3k5026984; Thu, 20 Jan 2011 20:23:03 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201101202023.p0KKN3k5026984@svn.freebsd.org> From: Andreas Tobler Date: Thu, 20 Jan 2011 20:23: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: r217659 - head/sys/powerpc/powermac X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jan 2011 20:23:04 -0000 Author: andreast Date: Thu Jan 20 20:23:03 2011 New Revision: 217659 URL: http://svn.freebsd.org/changeset/base/217659 Log: Remove unused variables. Spotted by a cppcheck (devel/cppcheck, http://sourceforge.net/projects/cppcheck) run. Approved by: nwhitehorn (mentor) Modified: head/sys/powerpc/powermac/cpcht.c Modified: head/sys/powerpc/powermac/cpcht.c ============================================================================== --- head/sys/powerpc/powermac/cpcht.c Thu Jan 20 20:22:19 2011 (r217658) +++ head/sys/powerpc/powermac/cpcht.c Thu Jan 20 20:23:03 2011 (r217659) @@ -475,10 +475,6 @@ cpcht_write_config(device_t dev, u_int b static int cpcht_read_ivar(device_t dev, device_t child, int which, uintptr_t *result) { - struct cpcht_softc *sc; - - sc = device_get_softc(dev); - switch (which) { case PCIB_IVAR_DOMAIN: *result = device_get_unit(dev); @@ -514,13 +510,12 @@ cpcht_alloc_resource(device_t bus, devic struct cpcht_softc *sc; struct resource *rv; struct rman *rm; - int needactivate, err; + int needactivate; needactivate = flags & RF_ACTIVE; flags &= ~RF_ACTIVE; sc = device_get_softc(bus); - err = 0; switch (type) { case SYS_RES_IOPORT: @@ -569,9 +564,6 @@ cpcht_activate_resource(device_t bus, de struct resource *res) { void *p; - struct cpcht_softc *sc; - - sc = device_get_softc(bus); if (type == SYS_RES_IRQ) return (bus_activate_resource(bus, type, rid, res)); From owner-svn-src-all@FreeBSD.ORG Thu Jan 20 21:25:17 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B9151065697; Thu, 20 Jan 2011 21:25:17 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0A3748FC20; Thu, 20 Jan 2011 21:25:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0KLPGHo028521; Thu, 20 Jan 2011 21:25:16 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0KLPGfh028519; Thu, 20 Jan 2011 21:25:16 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201101202125.p0KLPGfh028519@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 20 Jan 2011 21:25:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217661 - stable/7/sys/dev/bktr X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jan 2011 21:25:17 -0000 Author: yongari Date: Thu Jan 20 21:25:16 2011 New Revision: 217661 URL: http://svn.freebsd.org/changeset/base/217661 Log: MFC r192784,192805: Free the memory correctly in the error case PR: misc/154152 Modified: stable/7/sys/dev/bktr/bktr_os.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/bktr/bktr_os.c ============================================================================== --- stable/7/sys/dev/bktr/bktr_os.c Thu Jan 20 21:11:45 2011 (r217660) +++ stable/7/sys/dev/bktr/bktr_os.c Thu Jan 20 21:25:16 2011 (r217661) @@ -470,7 +470,7 @@ fail: if (bktr->res_irq) bus_release_resource(dev, SYS_RES_IRQ, bktr->irq_rid, bktr->res_irq); if (bktr->res_mem) - bus_release_resource(dev, SYS_RES_IRQ, bktr->mem_rid, bktr->res_mem); + bus_release_resource(dev, SYS_RES_MEMORY, bktr->mem_rid, bktr->res_mem); return error; } From owner-svn-src-all@FreeBSD.ORG Thu Jan 20 22:58:10 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DCDB91065670; Thu, 20 Jan 2011 22:58:10 +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 CBE5B8FC14; Thu, 20 Jan 2011 22:58:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0KMwAmu030724; Thu, 20 Jan 2011 22:58:10 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0KMwAap030721; Thu, 20 Jan 2011 22:58:10 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201101202258.p0KMwAap030721@svn.freebsd.org> From: Warner Losh Date: Thu, 20 Jan 2011 22:58: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: r217663 - in head/sys/boot/arm/at91: . boot0 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jan 2011 22:58:11 -0000 Author: imp Date: Thu Jan 20 22:58:10 2011 New Revision: 217663 URL: http://svn.freebsd.org/changeset/base/217663 Log: No need to list an obsolete arm compiler here. Modified: head/sys/boot/arm/at91/boot0/linker.cfg head/sys/boot/arm/at91/linker.cfg Modified: head/sys/boot/arm/at91/boot0/linker.cfg ============================================================================== --- head/sys/boot/arm/at91/boot0/linker.cfg Thu Jan 20 22:54:10 2011 (r217662) +++ head/sys/boot/arm/at91/boot0/linker.cfg Thu Jan 20 22:58:10 2011 (r217663) @@ -24,7 +24,6 @@ OUTPUT_FORMAT("elf32-littlearm", "elf32- "elf32-littlearm") OUTPUT_ARCH(arm) ENTRY(start) - SEARCH_DIR(/usr/local/arm/2.95.3/arm-linux/lib); SECTIONS { /* Read-only sections, merged into text segment: */ Modified: head/sys/boot/arm/at91/linker.cfg ============================================================================== --- head/sys/boot/arm/at91/linker.cfg Thu Jan 20 22:54:10 2011 (r217662) +++ head/sys/boot/arm/at91/linker.cfg Thu Jan 20 22:58:10 2011 (r217663) @@ -24,7 +24,6 @@ OUTPUT_FORMAT("elf32-littlearm", "elf32- "elf32-littlearm") OUTPUT_ARCH(arm) ENTRY(start) - SEARCH_DIR(/usr/local/arm/2.95.3/arm-linux/lib); SECTIONS { /* Read-only sections, merged into text segment: */ From owner-svn-src-all@FreeBSD.ORG Thu Jan 20 23:35:00 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1FBBD106566C; Thu, 20 Jan 2011 23:35:00 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0E0158FC1D; Thu, 20 Jan 2011 23:35:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0KNYxeM031523; Thu, 20 Jan 2011 23:34:59 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0KNYxSc031518; Thu, 20 Jan 2011 23:34:59 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201101202334.p0KNYxSc031518@svn.freebsd.org> From: Juli Mallett Date: Thu, 20 Jan 2011 23:34:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217664 - head/sys/mips/cavium/octe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jan 2011 23:35:00 -0000 Author: jmallett Date: Thu Jan 20 23:34:59 2011 New Revision: 217664 URL: http://svn.freebsd.org/changeset/base/217664 Log: Remove some compile-time options from the driver, particularly async IOBDMA support which is unused on FreeBSD and which complicates working on the code now, can easily be added back later by someone determined to use it. Modified: head/sys/mips/cavium/octe/ethernet-defines.h head/sys/mips/cavium/octe/ethernet-rx.c head/sys/mips/cavium/octe/ethernet-tx.c head/sys/mips/cavium/octe/ethernet.c Modified: head/sys/mips/cavium/octe/ethernet-defines.h ============================================================================== --- head/sys/mips/cavium/octe/ethernet-defines.h Thu Jan 20 22:58:10 2011 (r217663) +++ head/sys/mips/cavium/octe/ethernet-defines.h Thu Jan 20 23:34:59 2011 (r217664) @@ -30,43 +30,15 @@ AND WITH ALL FAULTS AND CAVIUM NETWORKS /* * A few defines are used to control the operation of this driver: - * CONFIG_CAVIUM_RESERVE32 - * This kernel config options controls the amount of memory configured - * in a wired TLB entry for all processes to share. If this is set, the - * driver will use this memory instead of kernel memory for pools. This - * allows 32bit userspace application to access the buffers, but also - * requires all received packets to be copied. * CONFIG_CAVIUM_OCTEON_NUM_PACKET_BUFFERS * This kernel config option allows the user to control the number of * packet and work queue buffers allocated by the driver. If this is zero, * the driver uses the default from below. - * USE_HW_TCPUDP_CHECKSUM - * Controls if the Octeon TCP/UDP checksum engine is used for packet - * output. If this is zero, the kernel will perform the checksum in - * software. - * USE_MULTICORE_RECEIVE - * Process receive interrupts on multiple cores. This spreads the network - * load across the first 8 processors. If ths is zero, only one core - * processes incomming packets. - * USE_ASYNC_IOBDMA - * Use asynchronous IO access to hardware. This uses Octeon's asynchronous - * IOBDMAs to issue IO accesses without stalling. Set this to zero - * to disable this. Note that IOBDMAs require CVMSEG. */ -#ifndef CONFIG_CAVIUM_RESERVE32 -#define CONFIG_CAVIUM_RESERVE32 0 -#endif #define INTERRUPT_LIMIT 10000 /* Max interrupts per second per core */ /*#define INTERRUPT_LIMIT 0 *//* Don't limit the number of interrupts */ -#define USE_HW_TCPUDP_CHECKSUM 1 -#define USE_MULTICORE_RECEIVE 1 #define USE_RED 1 /* Enable Random Early Dropping under load */ -#if 0 -#define USE_ASYNC_IOBDMA (CONFIG_CAVIUM_OCTEON_CVMSEG_SIZE > 0) -#else -#define USE_ASYNC_IOBDMA 0 -#endif #define USE_10MBPS_PREAMBLE_WORKAROUND 1 /* Allow SW based preamble removal at 10Mbps to workaround PHYs giving us bad preambles */ #define DONT_WRITEBACK(x) (x) /* Use this to have all FPA frees also tell the L2 not to write data to memory */ /*#define DONT_WRITEBACK(x) 0 *//* Use this to not have FPA frees control L2 */ @@ -74,11 +46,6 @@ AND WITH ALL FAULTS AND CAVIUM NETWORKS #define MAX_RX_PACKETS 120 /* Maximum number of packets to process per interrupt. */ #define MAX_OUT_QUEUE_DEPTH 1000 -#ifndef SMP -#undef USE_MULTICORE_RECEIVE -#define USE_MULTICORE_RECEIVE 0 -#endif - #define FAU_NUM_PACKET_BUFFERS_TO_FREE (CVMX_FAU_REG_END - sizeof(uint32_t)) #define TOTAL_NUMBER_OF_PORTS (CVMX_PIP_NUM_INPUT_PORTS+1) Modified: head/sys/mips/cavium/octe/ethernet-rx.c ============================================================================== --- head/sys/mips/cavium/octe/ethernet-rx.c Thu Jan 20 22:58:10 2011 (r217663) +++ head/sys/mips/cavium/octe/ethernet-rx.c Thu Jan 20 23:34:59 2011 (r217664) @@ -164,7 +164,6 @@ void cvm_oct_tasklet_rx(void *context, i { int coreid; uint64_t old_group_mask; - uint64_t old_scratch; int rx_count = 0; int number_to_free; int num_freed; @@ -176,49 +175,24 @@ void cvm_oct_tasklet_rx(void *context, i /* Prefetch cvm_oct_device since we know we need it soon */ CVMX_PREFETCH(cvm_oct_device, 0); - if (USE_ASYNC_IOBDMA) { - /* Save scratch in case userspace is using it */ - CVMX_SYNCIOBDMA; - old_scratch = cvmx_scratch_read64(CVMX_SCR_SCRATCH); - } - /* Only allow work for our group (and preserve priorities) */ old_group_mask = cvmx_read_csr(CVMX_POW_PP_GRP_MSKX(coreid)); cvmx_write_csr(CVMX_POW_PP_GRP_MSKX(coreid), (old_group_mask & ~0xFFFFull) | 1<word2.s.bufs == 1; if ((mbuf_in_hw)) { m = *(struct mbuf **)(cvm_oct_get_buffer_ptr(work->packet_ptr) - sizeof(void *)); @@ -376,10 +350,6 @@ void cvm_oct_tasklet_rx(void *context, i /* Restore the original POW group mask */ cvmx_write_csr(CVMX_POW_PP_GRP_MSKX(coreid), old_group_mask); - if (USE_ASYNC_IOBDMA) { - /* Restore the scratch area */ - cvmx_scratch_write64(CVMX_SCR_SCRATCH, old_scratch); - } /* Refill the packet buffer pool */ number_to_free = Modified: head/sys/mips/cavium/octe/ethernet-tx.c ============================================================================== --- head/sys/mips/cavium/octe/ethernet-tx.c Thu Jan 20 22:58:10 2011 (r217663) +++ head/sys/mips/cavium/octe/ethernet-tx.c Thu Jan 20 23:34:59 2011 (r217664) @@ -66,8 +66,6 @@ int cvm_oct_xmit(struct mbuf *m, struct { cvmx_pko_command_word0_t pko_command; cvmx_buf_ptr_t hw_buffer; - uint64_t old_scratch; - uint64_t old_scratch2; int dropped; int qos; cvm_oct_private_t *priv = (cvm_oct_private_t *)ifp->if_softc; @@ -95,18 +93,6 @@ int cvm_oct_xmit(struct mbuf *m, struct } else qos = 0; - if (USE_ASYNC_IOBDMA) { - /* Save scratch in case userspace is using it */ - CVMX_SYNCIOBDMA; - old_scratch = cvmx_scratch_read64(CVMX_SCR_SCRATCH); - old_scratch2 = cvmx_scratch_read64(CVMX_SCR_SCRATCH+8); - - /* Assume we're going to be able t osend this packet. Fetch and increment - the number of pending packets for output */ - cvmx_fau_async_fetch_and_add32(CVMX_SCR_SCRATCH+8, FAU_NUM_PACKET_BUFFERS_TO_FREE, 0); - cvmx_fau_async_fetch_and_add32(CVMX_SCR_SCRATCH, priv->fau+qos*4, 1); - } - /* The CN3XXX series of parts has an errata (GMX-401) which causes the GMX block to hang if a collision occurs towards the end of a <68 byte packet. As a workaround for this, we pad packets to be @@ -195,8 +181,7 @@ int cvm_oct_xmit(struct mbuf *m, struct pko_command.s.subone0 = 1; /* Check if we can use the hardware checksumming */ - if (USE_HW_TCPUDP_CHECKSUM && - (m->m_pkthdr.csum_flags & (CSUM_TCP | CSUM_UDP)) != 0) { + if ((m->m_pkthdr.csum_flags & (CSUM_TCP | CSUM_UDP)) != 0) { /* Use hardware checksum calc */ pko_command.s.ipoffp1 = ETHER_HDR_LEN + 1; } @@ -207,16 +192,9 @@ int cvm_oct_xmit(struct mbuf *m, struct * core instead of per QoS, to reduce contention here. */ IF_LOCK(&priv->tx_free_queue[qos]); - if (USE_ASYNC_IOBDMA) { - /* Get the number of mbufs in use by the hardware */ - CVMX_SYNCIOBDMA; - in_use = cvmx_scratch_read64(CVMX_SCR_SCRATCH); - buffers_to_free = cvmx_scratch_read64(CVMX_SCR_SCRATCH+8); - } else { - /* Get the number of mbufs in use by the hardware */ - in_use = cvmx_fau_fetch_and_add32(priv->fau+qos*4, 1); - buffers_to_free = cvmx_fau_fetch_and_add32(FAU_NUM_PACKET_BUFFERS_TO_FREE, 0); - } + /* Get the number of mbufs in use by the hardware */ + in_use = cvmx_fau_fetch_and_add32(priv->fau+qos*4, 1); + buffers_to_free = cvmx_fau_fetch_and_add32(FAU_NUM_PACKET_BUFFERS_TO_FREE, 0); cvmx_pko_send_packet_prepare(priv->port, priv->queue + qos, CVMX_PKO_LOCK_CMD_QUEUE); @@ -231,12 +209,6 @@ int cvm_oct_xmit(struct mbuf *m, struct dropped = 1; } - if (USE_ASYNC_IOBDMA) { - /* Restore the scratch area */ - cvmx_scratch_write64(CVMX_SCR_SCRATCH, old_scratch); - cvmx_scratch_write64(CVMX_SCR_SCRATCH+8, old_scratch2); - } - if (__predict_false(dropped)) { m_freem(m); cvmx_fau_atomic_add32(priv->fau+qos*4, -1); Modified: head/sys/mips/cavium/octe/ethernet.c ============================================================================== --- head/sys/mips/cavium/octe/ethernet.c Thu Jan 20 22:58:10 2011 (r217663) +++ head/sys/mips/cavium/octe/ethernet.c Thu Jan 20 23:34:59 2011 (r217664) @@ -232,22 +232,18 @@ static void cvm_oct_configure_common_hw( #ifdef SMP - if (USE_MULTICORE_RECEIVE) { - critical_enter(); - { - cvmx_ciu_intx0_t en; - int core; - - CPU_FOREACH(core) { - if (core == PCPU_GET(cpuid)) - continue; - - en.u64 = cvmx_read_csr(CVMX_CIU_INTX_EN0(core*2)); - en.s.workq |= (1< Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A8D721065670; Thu, 20 Jan 2011 23:51:03 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9804A8FC12; Thu, 20 Jan 2011 23:51:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0KNp3Fg031873; Thu, 20 Jan 2011 23:51:03 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0KNp3Pr031871; Thu, 20 Jan 2011 23:51:03 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201101202351.p0KNp3Pr031871@svn.freebsd.org> From: Juli Mallett Date: Thu, 20 Jan 2011 23:51: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: r217665 - head/sys/mips/cavium/octe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jan 2011 23:51:03 -0000 Author: jmallett Date: Thu Jan 20 23:51:03 2011 New Revision: 217665 URL: http://svn.freebsd.org/changeset/base/217665 Log: If there is no WQE available for a packet that needs segmentation, drop it and return. Modified: head/sys/mips/cavium/octe/ethernet-tx.c Modified: head/sys/mips/cavium/octe/ethernet-tx.c ============================================================================== --- head/sys/mips/cavium/octe/ethernet-tx.c Thu Jan 20 23:34:59 2011 (r217664) +++ head/sys/mips/cavium/octe/ethernet-tx.c Thu Jan 20 23:51:03 2011 (r217665) @@ -142,9 +142,14 @@ int cvm_oct_xmit(struct mbuf *m, struct * in memory we borrow from the WQE pool. */ work = cvmx_fpa_alloc(CVMX_FPA_WQE_POOL); - gp = (uint64_t *)work; + if (work == NULL) { + m_freem(m); + ifp->if_oerrors++; + return 1; + } segs = 0; + gp = (uint64_t *)work; for (n = m; n != NULL; n = n->m_next) { if (segs == CVMX_FPA_WQE_POOL_SIZE / sizeof (uint64_t)) panic("%s: too many segments in packet; call m_collapse().", __func__); From owner-svn-src-all@FreeBSD.ORG Fri Jan 21 00:02:25 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F8F1106566B; Fri, 21 Jan 2011 00:02:25 +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 5E6158FC0A; Fri, 21 Jan 2011 00:02:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0L02PQK032166; Fri, 21 Jan 2011 00:02:25 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0L02PjG032164; Fri, 21 Jan 2011 00:02:25 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201101210002.p0L02PjG032164@svn.freebsd.org> From: Marius Strobl Date: Fri, 21 Jan 2011 00:02:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217666 - releng/8.2/sys/dev/mii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jan 2011 00:02:25 -0000 Author: marius Date: Fri Jan 21 00:02:25 2011 New Revision: 217666 URL: http://svn.freebsd.org/changeset/base/217666 Log: MFC: r217415 - Allow IFM_FLAG0 to be set indicating that auto-negotiation with manual configuration, which is used to work around issues with certain setups (see r161237) by default, should not be triggered as it may in turn cause harm in some edge cases. - Even after masking the media with IFM_GMASK the result may have bits besides the duplex ones set so just comparing it with IFM_FDX may lead to false negatives. - Announce PAUSE support also for manually selected 1000BASE-T, but for all manually selected media types only in full-duplex mode. Announce asymmetric PAUSE support only for manually selected 1000BASE-T. - Simplify setting the manual configuration bits to only once after we have figured them all out. This also means we no longer unnecessarily update the hardware along the road. - Remove a stale comment. Reviewed by: yongari (plus additional testing) Approved by: re (bz) Modified: releng/8.2/sys/dev/mii/rgephy.c Directory Properties: releng/8.2/sys/ (props changed) releng/8.2/sys/amd64/include/xen/ (props changed) releng/8.2/sys/cddl/contrib/opensolaris/ (props changed) releng/8.2/sys/contrib/dev/acpica/ (props changed) releng/8.2/sys/contrib/pf/ (props changed) Modified: releng/8.2/sys/dev/mii/rgephy.c ============================================================================== --- releng/8.2/sys/dev/mii/rgephy.c Thu Jan 20 23:51:03 2011 (r217665) +++ releng/8.2/sys/dev/mii/rgephy.c Fri Jan 21 00:02:25 2011 (r217666) @@ -146,6 +146,13 @@ rgephy_attach(device_t dev) mii_phy_add_media(sc); printf("\n"); #undef ADD + /* + * Allow IFM_FLAG0 to be set indicating that auto-negotiation with + * manual configuration, which is used to work around issues with + * certain setups by default, should not be triggered as it may in + * turn cause harm in some edge cases. + */ + mii->mii_media.ifm_mask |= IFM_FLAG0; rgephy_reset(sc); MIIBUS_MEDIAINIT(sc->mii_dev); @@ -201,37 +208,38 @@ rgephy_service(struct mii_softc *sc, str speed = RGEPHY_S10; anar |= RGEPHY_ANAR_10_FD | RGEPHY_ANAR_10; setit: - rgephy_loop(sc); - if ((ife->ifm_media & IFM_GMASK) == IFM_FDX) { + if ((ife->ifm_media & IFM_FLOW) != 0 && + (mii->mii_media.ifm_media & IFM_FLAG0) != 0) + return (EINVAL); + + if ((ife->ifm_media & IFM_FDX) != 0) { speed |= RGEPHY_BMCR_FDX; gig = RGEPHY_1000CTL_AFD; anar &= ~(RGEPHY_ANAR_TX | RGEPHY_ANAR_10); + if ((ife->ifm_media & IFM_FLOW) != 0 || + (sc->mii_flags & MIIF_FORCEPAUSE) != 0) + anar |= + RGEPHY_ANAR_PC | RGEPHY_ANAR_ASP; } else { gig = RGEPHY_1000CTL_AHD; anar &= ~(RGEPHY_ANAR_TX_FD | RGEPHY_ANAR_10_FD); } - - if (IFM_SUBTYPE(ife->ifm_media) != IFM_1000_T) { - PHY_WRITE(sc, RGEPHY_MII_1000CTL, 0); - PHY_WRITE(sc, RGEPHY_MII_ANAR, anar); - PHY_WRITE(sc, RGEPHY_MII_BMCR, speed | - RGEPHY_BMCR_AUTOEN | - RGEPHY_BMCR_STARTNEG); - break; + if (IFM_SUBTYPE(ife->ifm_media) == IFM_1000_T) { + gig |= RGEPHY_1000CTL_MSE; + if ((ife->ifm_media & IFM_ETH_MASTER) != 0) + gig |= RGEPHY_1000CTL_MSC; + } else { + gig = 0; + anar &= ~RGEPHY_ANAR_ASP; } - - if ((ife->ifm_media & IFM_FLOW) != 0 || - (sc->mii_flags & MIIF_FORCEPAUSE) != 0) - anar |= RGEPHY_ANAR_PC | RGEPHY_ANAR_ASP; - - gig |= RGEPHY_1000CTL_MSE; - if ((ife->ifm_media & IFM_ETH_MASTER) != 0) - gig |= RGEPHY_1000CTL_MSC; + if ((mii->mii_media.ifm_media & IFM_FLAG0) == 0) + speed |= + RGEPHY_BMCR_AUTOEN | RGEPHY_BMCR_STARTNEG; + rgephy_loop(sc); PHY_WRITE(sc, RGEPHY_MII_1000CTL, gig); PHY_WRITE(sc, RGEPHY_MII_ANAR, anar); - PHY_WRITE(sc, RGEPHY_MII_BMCR, speed | - RGEPHY_BMCR_AUTOEN | RGEPHY_BMCR_STARTNEG); + PHY_WRITE(sc, RGEPHY_MII_BMCR, speed); break; case IFM_NONE: PHY_WRITE(sc, MII_BMCR, BMCR_ISO | BMCR_PDOWN); @@ -258,8 +266,7 @@ setit: /* * Check to see if we have link. If we do, we don't - * need to restart the autonegotiation process. Read - * the BMSR twice in case it's latched. + * need to restart the autonegotiation process. */ if (rsc->mii_revision >= 2) { /* RTL8211B(L) */ From owner-svn-src-all@FreeBSD.ORG Fri Jan 21 00:02:28 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 61515106576F; Fri, 21 Jan 2011 00:02:28 +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 074958FC08; Fri, 21 Jan 2011 00:02:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0L02RPY032201; Fri, 21 Jan 2011 00:02:27 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0L02RE1032199; Fri, 21 Jan 2011 00:02:27 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201101210002.p0L02RE1032199@svn.freebsd.org> From: Marius Strobl Date: Fri, 21 Jan 2011 00:02:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217667 - releng/7.4/sys/dev/mii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jan 2011 00:02:28 -0000 Author: marius Date: Fri Jan 21 00:02:27 2011 New Revision: 217667 URL: http://svn.freebsd.org/changeset/base/217667 Log: MFC: r217415 - Allow IFM_FLAG0 to be set indicating that auto-negotiation with manual configuration, which is used to work around issues with certain setups (see r161237) by default, should not be triggered as it may in turn cause harm in some edge cases. - Even after masking the media with IFM_GMASK the result may have bits besides the duplex ones set so just comparing it with IFM_FDX may lead to false negatives. - Announce PAUSE support also for manually selected 1000BASE-T, but for all manually selected media types only in full-duplex mode. Announce asymmetric PAUSE support only for manually selected 1000BASE-T. - Simplify setting the manual configuration bits to only once after we have figured them all out. This also means we no longer unnecessarily update the hardware along the road. - Remove a stale comment. Reviewed by: yongari (plus additional testing) Approved by: re (bz) Modified: releng/7.4/sys/dev/mii/rgephy.c Directory Properties: releng/7.4/sys/ (props changed) releng/7.4/sys/cddl/contrib/opensolaris/ (props changed) releng/7.4/sys/contrib/dev/acpica/ (props changed) releng/7.4/sys/contrib/pf/ (props changed) Modified: releng/7.4/sys/dev/mii/rgephy.c ============================================================================== --- releng/7.4/sys/dev/mii/rgephy.c Fri Jan 21 00:02:25 2011 (r217666) +++ releng/7.4/sys/dev/mii/rgephy.c Fri Jan 21 00:02:27 2011 (r217667) @@ -146,6 +146,13 @@ rgephy_attach(device_t dev) mii_phy_add_media(sc); printf("\n"); #undef ADD + /* + * Allow IFM_FLAG0 to be set indicating that auto-negotiation with + * manual configuration, which is used to work around issues with + * certain setups by default, should not be triggered as it may in + * turn cause harm in some edge cases. + */ + mii->mii_media.ifm_mask |= IFM_FLAG0; rgephy_reset(sc); MIIBUS_MEDIAINIT(sc->mii_dev); @@ -201,37 +208,38 @@ rgephy_service(struct mii_softc *sc, str speed = RGEPHY_S10; anar |= RGEPHY_ANAR_10_FD | RGEPHY_ANAR_10; setit: - rgephy_loop(sc); - if ((ife->ifm_media & IFM_GMASK) == IFM_FDX) { + if ((ife->ifm_media & IFM_FLOW) != 0 && + (mii->mii_media.ifm_media & IFM_FLAG0) != 0) + return (EINVAL); + + if ((ife->ifm_media & IFM_FDX) != 0) { speed |= RGEPHY_BMCR_FDX; gig = RGEPHY_1000CTL_AFD; anar &= ~(RGEPHY_ANAR_TX | RGEPHY_ANAR_10); + if ((ife->ifm_media & IFM_FLOW) != 0 || + (sc->mii_flags & MIIF_FORCEPAUSE) != 0) + anar |= + RGEPHY_ANAR_PC | RGEPHY_ANAR_ASP; } else { gig = RGEPHY_1000CTL_AHD; anar &= ~(RGEPHY_ANAR_TX_FD | RGEPHY_ANAR_10_FD); } - - if (IFM_SUBTYPE(ife->ifm_media) != IFM_1000_T) { - PHY_WRITE(sc, RGEPHY_MII_1000CTL, 0); - PHY_WRITE(sc, RGEPHY_MII_ANAR, anar); - PHY_WRITE(sc, RGEPHY_MII_BMCR, speed | - RGEPHY_BMCR_AUTOEN | - RGEPHY_BMCR_STARTNEG); - break; + if (IFM_SUBTYPE(ife->ifm_media) == IFM_1000_T) { + gig |= RGEPHY_1000CTL_MSE; + if ((ife->ifm_media & IFM_ETH_MASTER) != 0) + gig |= RGEPHY_1000CTL_MSC; + } else { + gig = 0; + anar &= ~RGEPHY_ANAR_ASP; } - - if ((ife->ifm_media & IFM_FLOW) != 0 || - (sc->mii_flags & MIIF_FORCEPAUSE) != 0) - anar |= RGEPHY_ANAR_PC | RGEPHY_ANAR_ASP; - - gig |= RGEPHY_1000CTL_MSE; - if ((ife->ifm_media & IFM_ETH_MASTER) != 0) - gig |= RGEPHY_1000CTL_MSC; + if ((mii->mii_media.ifm_media & IFM_FLAG0) == 0) + speed |= + RGEPHY_BMCR_AUTOEN | RGEPHY_BMCR_STARTNEG; + rgephy_loop(sc); PHY_WRITE(sc, RGEPHY_MII_1000CTL, gig); PHY_WRITE(sc, RGEPHY_MII_ANAR, anar); - PHY_WRITE(sc, RGEPHY_MII_BMCR, speed | - RGEPHY_BMCR_AUTOEN | RGEPHY_BMCR_STARTNEG); + PHY_WRITE(sc, RGEPHY_MII_BMCR, speed); break; case IFM_NONE: PHY_WRITE(sc, MII_BMCR, BMCR_ISO | BMCR_PDOWN); @@ -258,8 +266,7 @@ setit: /* * Check to see if we have link. If we do, we don't - * need to restart the autonegotiation process. Read - * the BMSR twice in case it's latched. + * need to restart the autonegotiation process. */ if (rsc->mii_revision >= 2) { /* RTL8211B(L) */ From owner-svn-src-all@FreeBSD.ORG Fri Jan 21 00:33:10 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9F625106566B; Fri, 21 Jan 2011 00:33:10 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8CB4E8FC18; Fri, 21 Jan 2011 00:33:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0L0XAdU033037; Fri, 21 Jan 2011 00:33:10 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0L0XAkg033035; Fri, 21 Jan 2011 00:33:10 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201101210033.p0L0XAkg033035@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 21 Jan 2011 00:33:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217668 - stable/8/sys/dev/sis X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jan 2011 00:33:10 -0000 Author: yongari Date: Fri Jan 21 00:33:10 2011 New Revision: 217668 URL: http://svn.freebsd.org/changeset/base/217668 Log: MFC r217548: Rework RX filter programming by providing separate handler for DP8381[56] and SiS 900/7016 controllers. After r212119, sis(4) no longer reinitializes controller if ALLMULTI/PROMISC was changed. However, RX filter handling code assumed some bits of the RX filter is programmed by driver initialization. This caused ALLMULTI/PROMISC configuration is ignored under certain conditions. Fix that issue by reprogramming all bits of RX filter register. While I'm here follow recommended RX filter programming steps recommended by National DP8381[56] data sheet(RX filter should be is disabled before programming). Reported by: Paul Schenkeveld < freebsd () psconsult dot nl > Tested by: Paul Schenkeveld < freebsd () psconsult dot nl > Modified: stable/8/sys/dev/sis/if_sis.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/sis/if_sis.c ============================================================================== --- stable/8/sys/dev/sis/if_sis.c Fri Jan 21 00:02:27 2011 (r217667) +++ stable/8/sys/dev/sis/if_sis.c Fri Jan 21 00:33:10 2011 (r217668) @@ -149,6 +149,9 @@ static int sis_ioctl(struct ifnet *, u_l static int sis_newbuf(struct sis_softc *, struct sis_rxdesc *); static int sis_resume(device_t); static int sis_rxeof(struct sis_softc *); +static void sis_rxfilter(struct sis_softc *); +static void sis_rxfilter_ns(struct sis_softc *); +static void sis_rxfilter_sis(struct sis_softc *); static void sis_start(struct ifnet *); static void sis_startl(struct ifnet *); static void sis_stop(struct sis_softc *); @@ -808,80 +811,117 @@ sis_mchash(struct sis_softc *sc, const u } static void -sis_setmulti_ns(struct sis_softc *sc) +sis_rxfilter(struct sis_softc *sc) +{ + + SIS_LOCK_ASSERT(sc); + + if (sc->sis_type == SIS_TYPE_83815) + sis_rxfilter_ns(sc); + else + sis_rxfilter_sis(sc); +} + +static void +sis_rxfilter_ns(struct sis_softc *sc) { struct ifnet *ifp; struct ifmultiaddr *ifma; - uint32_t h = 0, i, filtsave; + uint32_t h, i, filter; int bit, index; ifp = sc->sis_ifp; - - if (ifp->if_flags & IFF_ALLMULTI || ifp->if_flags & IFF_PROMISC) { - SIS_CLRBIT(sc, SIS_RXFILT_CTL, NS_RXFILTCTL_MCHASH); - SIS_SETBIT(sc, SIS_RXFILT_CTL, SIS_RXFILTCTL_ALLMULTI); - return; + filter = CSR_READ_4(sc, SIS_RXFILT_CTL); + if (filter & SIS_RXFILTCTL_ENABLE) { + /* + * Filter should be disabled to program other bits. + */ + CSR_WRITE_4(sc, SIS_RXFILT_CTL, filter & ~SIS_RXFILTCTL_ENABLE); + CSR_READ_4(sc, SIS_RXFILT_CTL); } + filter &= ~(NS_RXFILTCTL_ARP | NS_RXFILTCTL_PERFECT | + NS_RXFILTCTL_MCHASH | SIS_RXFILTCTL_ALLPHYS | SIS_RXFILTCTL_BROAD | + SIS_RXFILTCTL_ALLMULTI); + if (ifp->if_flags & IFF_BROADCAST) + filter |= SIS_RXFILTCTL_BROAD; /* - * We have to explicitly enable the multicast hash table - * on the NatSemi chip if we want to use it, which we do. + * For the NatSemi chip, we have to explicitly enable the + * reception of ARP frames, as well as turn on the 'perfect + * match' filter where we store the station address, otherwise + * we won't receive unicasts meant for this host. */ - SIS_SETBIT(sc, SIS_RXFILT_CTL, NS_RXFILTCTL_MCHASH); - SIS_CLRBIT(sc, SIS_RXFILT_CTL, SIS_RXFILTCTL_ALLMULTI); + filter |= NS_RXFILTCTL_ARP | NS_RXFILTCTL_PERFECT; - filtsave = CSR_READ_4(sc, SIS_RXFILT_CTL); + if (ifp->if_flags & (IFF_ALLMULTI | IFF_PROMISC)) { + filter |= SIS_RXFILTCTL_ALLMULTI; + if (ifp->if_flags & IFF_PROMISC) + filter |= SIS_RXFILTCTL_ALLPHYS; + } else { + /* + * We have to explicitly enable the multicast hash table + * on the NatSemi chip if we want to use it, which we do. + */ + filter |= NS_RXFILTCTL_MCHASH; - /* first, zot all the existing hash bits */ - for (i = 0; i < 32; i++) { - CSR_WRITE_4(sc, SIS_RXFILT_CTL, NS_FILTADDR_FMEM_LO + (i*2)); - CSR_WRITE_4(sc, SIS_RXFILT_DATA, 0); - } + /* first, zot all the existing hash bits */ + for (i = 0; i < 32; i++) { + CSR_WRITE_4(sc, SIS_RXFILT_CTL, NS_FILTADDR_FMEM_LO + + (i * 2)); + CSR_WRITE_4(sc, SIS_RXFILT_DATA, 0); + } - if_maddr_rlock(ifp); - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { - if (ifma->ifma_addr->sa_family != AF_LINK) - continue; - h = sis_mchash(sc, - LLADDR((struct sockaddr_dl *)ifma->ifma_addr)); - index = h >> 3; - bit = h & 0x1F; - CSR_WRITE_4(sc, SIS_RXFILT_CTL, NS_FILTADDR_FMEM_LO + index); - if (bit > 0xF) - bit -= 0x10; - SIS_SETBIT(sc, SIS_RXFILT_DATA, (1 << bit)); + if_maddr_rlock(ifp); + TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + if (ifma->ifma_addr->sa_family != AF_LINK) + continue; + h = sis_mchash(sc, + LLADDR((struct sockaddr_dl *)ifma->ifma_addr)); + index = h >> 3; + bit = h & 0x1F; + CSR_WRITE_4(sc, SIS_RXFILT_CTL, NS_FILTADDR_FMEM_LO + + index); + if (bit > 0xF) + bit -= 0x10; + SIS_SETBIT(sc, SIS_RXFILT_DATA, (1 << bit)); + } + if_maddr_runlock(ifp); } - if_maddr_runlock(ifp); - CSR_WRITE_4(sc, SIS_RXFILT_CTL, filtsave); + CSR_WRITE_4(sc, SIS_RXFILT_CTL, filter); + CSR_READ_4(sc, SIS_RXFILT_CTL); } static void -sis_setmulti_sis(struct sis_softc *sc) +sis_rxfilter_sis(struct sis_softc *sc) { struct ifnet *ifp; struct ifmultiaddr *ifma; - uint32_t h, i, n, ctl; + uint32_t filter, h, i, n; uint16_t hashes[16]; ifp = sc->sis_ifp; /* hash table size */ - if (sc->sis_rev >= SIS_REV_635 || - sc->sis_rev == SIS_REV_900B) + if (sc->sis_rev >= SIS_REV_635 || sc->sis_rev == SIS_REV_900B) n = 16; else n = 8; - ctl = CSR_READ_4(sc, SIS_RXFILT_CTL) & SIS_RXFILTCTL_ENABLE; - + filter = CSR_READ_4(sc, SIS_RXFILT_CTL); + if (filter & SIS_RXFILTCTL_ENABLE) { + CSR_WRITE_4(sc, SIS_RXFILT_CTL, filter & ~SIS_RXFILT_CTL); + CSR_READ_4(sc, SIS_RXFILT_CTL); + } + filter &= ~(SIS_RXFILTCTL_ALLPHYS | SIS_RXFILTCTL_BROAD | + SIS_RXFILTCTL_ALLMULTI); if (ifp->if_flags & IFF_BROADCAST) - ctl |= SIS_RXFILTCTL_BROAD; + filter |= SIS_RXFILTCTL_BROAD; - if (ifp->if_flags & IFF_ALLMULTI || ifp->if_flags & IFF_PROMISC) { - ctl |= SIS_RXFILTCTL_ALLMULTI; + if (ifp->if_flags & (IFF_ALLMULTI | IFF_PROMISC)) { + filter |= SIS_RXFILTCTL_ALLMULTI; if (ifp->if_flags & IFF_PROMISC) - ctl |= SIS_RXFILTCTL_BROAD|SIS_RXFILTCTL_ALLPHYS; + filter |= SIS_RXFILTCTL_ALLPHYS; for (i = 0; i < n; i++) hashes[i] = ~0; } else { @@ -899,7 +939,7 @@ sis_setmulti_sis(struct sis_softc *sc) } if_maddr_runlock(ifp); if (i > n) { - ctl |= SIS_RXFILTCTL_ALLMULTI; + filter |= SIS_RXFILTCTL_ALLMULTI; for (i = 0; i < n; i++) hashes[i] = ~0; } @@ -910,7 +950,8 @@ sis_setmulti_sis(struct sis_softc *sc) CSR_WRITE_4(sc, SIS_RXFILT_DATA, hashes[i]); } - CSR_WRITE_4(sc, SIS_RXFILT_CTL, ctl); + CSR_WRITE_4(sc, SIS_RXFILT_CTL, filter); + CSR_READ_4(sc, SIS_RXFILT_CTL); } static void @@ -2106,41 +2147,7 @@ sis_initl(struct sis_softc *sc) CSR_WRITE_4(sc, NS_PHY_PAGE, 0); } - /* - * For the NatSemi chip, we have to explicitly enable the - * reception of ARP frames, as well as turn on the 'perfect - * match' filter where we store the station address, otherwise - * we won't receive unicasts meant for this host. - */ - if (sc->sis_type == SIS_TYPE_83815) { - SIS_SETBIT(sc, SIS_RXFILT_CTL, NS_RXFILTCTL_ARP); - SIS_SETBIT(sc, SIS_RXFILT_CTL, NS_RXFILTCTL_PERFECT); - } - - /* If we want promiscuous mode, set the allframes bit. */ - if (ifp->if_flags & IFF_PROMISC) { - SIS_SETBIT(sc, SIS_RXFILT_CTL, SIS_RXFILTCTL_ALLPHYS); - } else { - SIS_CLRBIT(sc, SIS_RXFILT_CTL, SIS_RXFILTCTL_ALLPHYS); - } - - /* - * Set the capture broadcast bit to capture broadcast frames. - */ - if (ifp->if_flags & IFF_BROADCAST) { - SIS_SETBIT(sc, SIS_RXFILT_CTL, SIS_RXFILTCTL_BROAD); - } else { - SIS_CLRBIT(sc, SIS_RXFILT_CTL, SIS_RXFILTCTL_BROAD); - } - - /* - * Load the multicast filter. - */ - if (sc->sis_type == SIS_TYPE_83815) - sis_setmulti_ns(sc); - else - sis_setmulti_sis(sc); - + sis_rxfilter(sc); /* Turn the receive filter on */ SIS_SETBIT(sc, SIS_RXFILT_CTL, SIS_RXFILTCTL_ENABLE); @@ -2254,27 +2261,19 @@ sis_ioctl(struct ifnet *ifp, u_long comm if (ifp->if_flags & IFF_UP) { if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0 && ((ifp->if_flags ^ sc->sis_if_flags) & - (IFF_PROMISC | IFF_ALLMULTI)) != 0) { - if (sc->sis_type == SIS_TYPE_83815) - sis_setmulti_ns(sc); - else - sis_setmulti_sis(sc); - } else + (IFF_PROMISC | IFF_ALLMULTI)) != 0) + sis_rxfilter(sc); + else sis_initl(sc); - } else if (ifp->if_drv_flags & IFF_DRV_RUNNING) { + } else if (ifp->if_drv_flags & IFF_DRV_RUNNING) sis_stop(sc); - } sc->sis_if_flags = ifp->if_flags; SIS_UNLOCK(sc); - error = 0; break; case SIOCADDMULTI: case SIOCDELMULTI: SIS_LOCK(sc); - if (sc->sis_type == SIS_TYPE_83815) - sis_setmulti_ns(sc); - else - sis_setmulti_sis(sc); + sis_rxfilter(sc); SIS_UNLOCK(sc); break; case SIOCGIFMEDIA: From owner-svn-src-all@FreeBSD.ORG Fri Jan 21 00:35:34 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 59793106566B; Fri, 21 Jan 2011 00:35:34 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 46EB38FC0A; Fri, 21 Jan 2011 00:35:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0L0ZY7l033121; Fri, 21 Jan 2011 00:35:34 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0L0ZYIT033119; Fri, 21 Jan 2011 00:35:34 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201101210035.p0L0ZYIT033119@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 21 Jan 2011 00:35:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217669 - stable/7/sys/dev/sis X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jan 2011 00:35:34 -0000 Author: yongari Date: Fri Jan 21 00:35:34 2011 New Revision: 217669 URL: http://svn.freebsd.org/changeset/base/217669 Log: MFC r217548: Rework RX filter programming by providing separate handler for DP8381[56] and SiS 900/7016 controllers. After r212119, sis(4) no longer reinitializes controller if ALLMULTI/PROMISC was changed. However, RX filter handling code assumed some bits of the RX filter is programmed by driver initialization. This caused ALLMULTI/PROMISC configuration is ignored under certain conditions. Fix that issue by reprogramming all bits of RX filter register. While I'm here follow recommended RX filter programming steps recommended by National DP8381[56] data sheet(RX filter should be is disabled before programming). Reported by: Paul Schenkeveld < freebsd () psconsult dot nl > Tested by: Paul Schenkeveld < freebsd () psconsult dot nl > Modified: stable/7/sys/dev/sis/if_sis.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/sis/if_sis.c ============================================================================== --- stable/7/sys/dev/sis/if_sis.c Fri Jan 21 00:33:10 2011 (r217668) +++ stable/7/sys/dev/sis/if_sis.c Fri Jan 21 00:35:34 2011 (r217669) @@ -149,6 +149,9 @@ static int sis_ioctl(struct ifnet *, u_l static int sis_newbuf(struct sis_softc *, struct sis_rxdesc *); static int sis_resume(device_t); static void sis_rxeof(struct sis_softc *); +static void sis_rxfilter(struct sis_softc *); +static void sis_rxfilter_ns(struct sis_softc *); +static void sis_rxfilter_sis(struct sis_softc *); static void sis_start(struct ifnet *); static void sis_startl(struct ifnet *); static void sis_stop(struct sis_softc *); @@ -808,80 +811,117 @@ sis_mchash(struct sis_softc *sc, const u } static void -sis_setmulti_ns(struct sis_softc *sc) +sis_rxfilter(struct sis_softc *sc) +{ + + SIS_LOCK_ASSERT(sc); + + if (sc->sis_type == SIS_TYPE_83815) + sis_rxfilter_ns(sc); + else + sis_rxfilter_sis(sc); +} + +static void +sis_rxfilter_ns(struct sis_softc *sc) { struct ifnet *ifp; struct ifmultiaddr *ifma; - uint32_t h = 0, i, filtsave; + uint32_t h, i, filter; int bit, index; ifp = sc->sis_ifp; - - if (ifp->if_flags & IFF_ALLMULTI || ifp->if_flags & IFF_PROMISC) { - SIS_CLRBIT(sc, SIS_RXFILT_CTL, NS_RXFILTCTL_MCHASH); - SIS_SETBIT(sc, SIS_RXFILT_CTL, SIS_RXFILTCTL_ALLMULTI); - return; + filter = CSR_READ_4(sc, SIS_RXFILT_CTL); + if (filter & SIS_RXFILTCTL_ENABLE) { + /* + * Filter should be disabled to program other bits. + */ + CSR_WRITE_4(sc, SIS_RXFILT_CTL, filter & ~SIS_RXFILTCTL_ENABLE); + CSR_READ_4(sc, SIS_RXFILT_CTL); } + filter &= ~(NS_RXFILTCTL_ARP | NS_RXFILTCTL_PERFECT | + NS_RXFILTCTL_MCHASH | SIS_RXFILTCTL_ALLPHYS | SIS_RXFILTCTL_BROAD | + SIS_RXFILTCTL_ALLMULTI); + if (ifp->if_flags & IFF_BROADCAST) + filter |= SIS_RXFILTCTL_BROAD; /* - * We have to explicitly enable the multicast hash table - * on the NatSemi chip if we want to use it, which we do. + * For the NatSemi chip, we have to explicitly enable the + * reception of ARP frames, as well as turn on the 'perfect + * match' filter where we store the station address, otherwise + * we won't receive unicasts meant for this host. */ - SIS_SETBIT(sc, SIS_RXFILT_CTL, NS_RXFILTCTL_MCHASH); - SIS_CLRBIT(sc, SIS_RXFILT_CTL, SIS_RXFILTCTL_ALLMULTI); + filter |= NS_RXFILTCTL_ARP | NS_RXFILTCTL_PERFECT; - filtsave = CSR_READ_4(sc, SIS_RXFILT_CTL); + if (ifp->if_flags & (IFF_ALLMULTI | IFF_PROMISC)) { + filter |= SIS_RXFILTCTL_ALLMULTI; + if (ifp->if_flags & IFF_PROMISC) + filter |= SIS_RXFILTCTL_ALLPHYS; + } else { + /* + * We have to explicitly enable the multicast hash table + * on the NatSemi chip if we want to use it, which we do. + */ + filter |= NS_RXFILTCTL_MCHASH; - /* first, zot all the existing hash bits */ - for (i = 0; i < 32; i++) { - CSR_WRITE_4(sc, SIS_RXFILT_CTL, NS_FILTADDR_FMEM_LO + (i*2)); - CSR_WRITE_4(sc, SIS_RXFILT_DATA, 0); - } + /* first, zot all the existing hash bits */ + for (i = 0; i < 32; i++) { + CSR_WRITE_4(sc, SIS_RXFILT_CTL, NS_FILTADDR_FMEM_LO + + (i * 2)); + CSR_WRITE_4(sc, SIS_RXFILT_DATA, 0); + } - IF_ADDR_LOCK(ifp); - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { - if (ifma->ifma_addr->sa_family != AF_LINK) - continue; - h = sis_mchash(sc, - LLADDR((struct sockaddr_dl *)ifma->ifma_addr)); - index = h >> 3; - bit = h & 0x1F; - CSR_WRITE_4(sc, SIS_RXFILT_CTL, NS_FILTADDR_FMEM_LO + index); - if (bit > 0xF) - bit -= 0x10; - SIS_SETBIT(sc, SIS_RXFILT_DATA, (1 << bit)); + IF_ADDR_LOCK(ifp); + TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + if (ifma->ifma_addr->sa_family != AF_LINK) + continue; + h = sis_mchash(sc, + LLADDR((struct sockaddr_dl *)ifma->ifma_addr)); + index = h >> 3; + bit = h & 0x1F; + CSR_WRITE_4(sc, SIS_RXFILT_CTL, NS_FILTADDR_FMEM_LO + + index); + if (bit > 0xF) + bit -= 0x10; + SIS_SETBIT(sc, SIS_RXFILT_DATA, (1 << bit)); + } + IF_ADDR_UNLOCK(ifp); } - IF_ADDR_UNLOCK(ifp); - CSR_WRITE_4(sc, SIS_RXFILT_CTL, filtsave); + CSR_WRITE_4(sc, SIS_RXFILT_CTL, filter); + CSR_READ_4(sc, SIS_RXFILT_CTL); } static void -sis_setmulti_sis(struct sis_softc *sc) +sis_rxfilter_sis(struct sis_softc *sc) { struct ifnet *ifp; struct ifmultiaddr *ifma; - uint32_t h, i, n, ctl; + uint32_t filter, h, i, n; uint16_t hashes[16]; ifp = sc->sis_ifp; /* hash table size */ - if (sc->sis_rev >= SIS_REV_635 || - sc->sis_rev == SIS_REV_900B) + if (sc->sis_rev >= SIS_REV_635 || sc->sis_rev == SIS_REV_900B) n = 16; else n = 8; - ctl = CSR_READ_4(sc, SIS_RXFILT_CTL) & SIS_RXFILTCTL_ENABLE; - + filter = CSR_READ_4(sc, SIS_RXFILT_CTL); + if (filter & SIS_RXFILTCTL_ENABLE) { + CSR_WRITE_4(sc, SIS_RXFILT_CTL, filter & ~SIS_RXFILT_CTL); + CSR_READ_4(sc, SIS_RXFILT_CTL); + } + filter &= ~(SIS_RXFILTCTL_ALLPHYS | SIS_RXFILTCTL_BROAD | + SIS_RXFILTCTL_ALLMULTI); if (ifp->if_flags & IFF_BROADCAST) - ctl |= SIS_RXFILTCTL_BROAD; + filter |= SIS_RXFILTCTL_BROAD; - if (ifp->if_flags & IFF_ALLMULTI || ifp->if_flags & IFF_PROMISC) { - ctl |= SIS_RXFILTCTL_ALLMULTI; + if (ifp->if_flags & (IFF_ALLMULTI | IFF_PROMISC)) { + filter |= SIS_RXFILTCTL_ALLMULTI; if (ifp->if_flags & IFF_PROMISC) - ctl |= SIS_RXFILTCTL_BROAD|SIS_RXFILTCTL_ALLPHYS; + filter |= SIS_RXFILTCTL_ALLPHYS; for (i = 0; i < n; i++) hashes[i] = ~0; } else { @@ -899,7 +939,7 @@ sis_setmulti_sis(struct sis_softc *sc) } IF_ADDR_UNLOCK(ifp); if (i > n) { - ctl |= SIS_RXFILTCTL_ALLMULTI; + filter |= SIS_RXFILTCTL_ALLMULTI; for (i = 0; i < n; i++) hashes[i] = ~0; } @@ -910,7 +950,8 @@ sis_setmulti_sis(struct sis_softc *sc) CSR_WRITE_4(sc, SIS_RXFILT_DATA, hashes[i]); } - CSR_WRITE_4(sc, SIS_RXFILT_CTL, ctl); + CSR_WRITE_4(sc, SIS_RXFILT_CTL, filter); + CSR_READ_4(sc, SIS_RXFILT_CTL); } static void @@ -2102,41 +2143,7 @@ sis_initl(struct sis_softc *sc) CSR_WRITE_4(sc, NS_PHY_PAGE, 0); } - /* - * For the NatSemi chip, we have to explicitly enable the - * reception of ARP frames, as well as turn on the 'perfect - * match' filter where we store the station address, otherwise - * we won't receive unicasts meant for this host. - */ - if (sc->sis_type == SIS_TYPE_83815) { - SIS_SETBIT(sc, SIS_RXFILT_CTL, NS_RXFILTCTL_ARP); - SIS_SETBIT(sc, SIS_RXFILT_CTL, NS_RXFILTCTL_PERFECT); - } - - /* If we want promiscuous mode, set the allframes bit. */ - if (ifp->if_flags & IFF_PROMISC) { - SIS_SETBIT(sc, SIS_RXFILT_CTL, SIS_RXFILTCTL_ALLPHYS); - } else { - SIS_CLRBIT(sc, SIS_RXFILT_CTL, SIS_RXFILTCTL_ALLPHYS); - } - - /* - * Set the capture broadcast bit to capture broadcast frames. - */ - if (ifp->if_flags & IFF_BROADCAST) { - SIS_SETBIT(sc, SIS_RXFILT_CTL, SIS_RXFILTCTL_BROAD); - } else { - SIS_CLRBIT(sc, SIS_RXFILT_CTL, SIS_RXFILTCTL_BROAD); - } - - /* - * Load the multicast filter. - */ - if (sc->sis_type == SIS_TYPE_83815) - sis_setmulti_ns(sc); - else - sis_setmulti_sis(sc); - + sis_rxfilter(sc); /* Turn the receive filter on */ SIS_SETBIT(sc, SIS_RXFILT_CTL, SIS_RXFILTCTL_ENABLE); @@ -2250,27 +2257,19 @@ sis_ioctl(struct ifnet *ifp, u_long comm if (ifp->if_flags & IFF_UP) { if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0 && ((ifp->if_flags ^ sc->sis_if_flags) & - (IFF_PROMISC | IFF_ALLMULTI)) != 0) { - if (sc->sis_type == SIS_TYPE_83815) - sis_setmulti_ns(sc); - else - sis_setmulti_sis(sc); - } else + (IFF_PROMISC | IFF_ALLMULTI)) != 0) + sis_rxfilter(sc); + else sis_initl(sc); - } else if (ifp->if_drv_flags & IFF_DRV_RUNNING) { + } else if (ifp->if_drv_flags & IFF_DRV_RUNNING) sis_stop(sc); - } sc->sis_if_flags = ifp->if_flags; SIS_UNLOCK(sc); - error = 0; break; case SIOCADDMULTI: case SIOCDELMULTI: SIS_LOCK(sc); - if (sc->sis_type == SIS_TYPE_83815) - sis_setmulti_ns(sc); - else - sis_setmulti_sis(sc); + sis_rxfilter(sc); SIS_UNLOCK(sc); break; case SIOCGIFMEDIA: From owner-svn-src-all@FreeBSD.ORG Fri Jan 21 00:40:25 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B1E91065672; Fri, 21 Jan 2011 00:40:25 +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 597DD8FC1D; Fri, 21 Jan 2011 00:40:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0L0eP2A033280; Fri, 21 Jan 2011 00:40:25 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0L0ePCm033276; Fri, 21 Jan 2011 00:40:25 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201101210040.p0L0ePCm033276@svn.freebsd.org> From: Marius Strobl Date: Fri, 21 Jan 2011 00:40:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217670 - stable/8/sys/dev/mii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jan 2011 00:40:25 -0000 Author: marius Date: Fri Jan 21 00:40:25 2011 New Revision: 217670 URL: http://svn.freebsd.org/changeset/base/217670 Log: MFC: r217412 - Masking IFM_GMASK when also masking IFM_FDX is redundant and just complicates the code. - Don't let atphy_setmedia() announce PAUSE support for half-duplex when MIIF_FORCEPAUSE is set. - Simplify e1000phy_service() and ip1000phy_service() to only set the manual configuration bits once after we have figured them all out. For ip1000phy_service() this also means we no longer unnecessarily update the hardware along the road. Modified: stable/8/sys/dev/mii/atphy.c stable/8/sys/dev/mii/e1000phy.c stable/8/sys/dev/mii/ip1000phy.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/mii/atphy.c ============================================================================== --- stable/8/sys/dev/mii/atphy.c Fri Jan 21 00:35:34 2011 (r217669) +++ stable/8/sys/dev/mii/atphy.c Fri Jan 21 00:40:25 2011 (r217670) @@ -187,9 +187,9 @@ atphy_service(struct mii_softc *sc, stru } anar = atphy_anar(ife); - if (((ife->ifm_media & IFM_GMASK) & IFM_FDX) != 0) { + if ((ife->ifm_media & IFM_FDX) != 0) { bmcr |= BMCR_FDX; - if (((ife->ifm_media & IFM_GMASK) & IFM_FLOW) != 0 || + if ((ife->ifm_media & IFM_FLOW) != 0 || (sc->mii_flags & MIIF_FORCEPAUSE) != 0) anar |= ANAR_PAUSE_TOWARDS; } @@ -371,7 +371,7 @@ atphy_anar(struct ifmedia_entry *ife) return (0); } - if (((ife->ifm_media & IFM_GMASK) & IFM_FDX) != 0) { + if ((ife->ifm_media & IFM_FDX) != 0) { if (IFM_SUBTYPE(ife->ifm_media) == IFM_100_TX) anar |= ANAR_TX_FD; else @@ -387,13 +387,13 @@ atphy_setmedia(struct mii_softc *sc, int uint16_t anar; anar = BMSR_MEDIA_TO_ANAR(sc->mii_capabilities) | ANAR_CSMA; - if (((IFM_SUBTYPE(media) == IFM_AUTO || - ((media & IFM_GMASK) & IFM_FDX) != 0) && - ((media & IFM_GMASK) & IFM_FLOW) != 0) || - (sc->mii_flags & MIIF_FORCEPAUSE) != 0) + if ((IFM_SUBTYPE(media) == IFM_AUTO || (media & IFM_FDX) != 0) && + ((media & IFM_FLOW) != 0 || + (sc->mii_flags & MIIF_FORCEPAUSE) != 0)) anar |= ANAR_PAUSE_TOWARDS; PHY_WRITE(sc, MII_ANAR, anar); - if ((sc->mii_extcapabilities & (EXTSR_1000TFDX | EXTSR_1000THDX)) != 0) + if ((sc->mii_extcapabilities & + (EXTSR_1000TFDX | EXTSR_1000THDX)) != 0) PHY_WRITE(sc, MII_100T2CR, GTCR_ADV_1000TFDX | GTCR_ADV_1000THDX); PHY_WRITE(sc, MII_BMCR, BMCR_RESET | BMCR_AUTOEN | BMCR_STARTNEG); Modified: stable/8/sys/dev/mii/e1000phy.c ============================================================================== --- stable/8/sys/dev/mii/e1000phy.c Fri Jan 21 00:35:34 2011 (r217669) +++ stable/8/sys/dev/mii/e1000phy.c Fri Jan 21 00:40:25 2011 (r217670) @@ -358,7 +358,7 @@ e1000phy_service(struct mii_softc *sc, s return (EINVAL); } - if (((ife->ifm_media & IFM_GMASK) & IFM_FDX) != 0) { + if ((ife->ifm_media & IFM_FDX) != 0) { speed |= E1000_CR_FULL_DUPLEX; gig = E1000_1GCR_1000T_FD; } else @@ -373,10 +373,10 @@ e1000phy_service(struct mii_softc *sc, s if ((ife->ifm_media & IFM_ETH_MASTER) != 0 || (mii->mii_ifp->if_flags & IFF_LINK0) != 0) gig |= E1000_1GCR_MS_VALUE; - PHY_WRITE(sc, E1000_1GCR, gig); } else if ((sc->mii_extcapabilities & (EXTSR_1000TFDX | EXTSR_1000THDX)) != 0) - PHY_WRITE(sc, E1000_1GCR, 0); + gig = 0; + PHY_WRITE(sc, E1000_1GCR, gig); PHY_WRITE(sc, E1000_AR, E1000_AR_SELECTOR_FIELD); PHY_WRITE(sc, E1000_CR, speed | E1000_CR_RESET); done: Modified: stable/8/sys/dev/mii/ip1000phy.c ============================================================================== --- stable/8/sys/dev/mii/ip1000phy.c Fri Jan 21 00:35:34 2011 (r217669) +++ stable/8/sys/dev/mii/ip1000phy.c Fri Jan 21 00:40:25 2011 (r217670) @@ -186,23 +186,22 @@ ip1000phy_service(struct mii_softc *sc, return (EINVAL); } - if (((ife->ifm_media & IFM_GMASK) & IFM_FDX) != 0) { + if ((ife->ifm_media & IFM_FDX) != 0) { speed |= IP1000PHY_BMCR_FDX; gig = IP1000PHY_1000CR_1000T_FDX; } else gig = IP1000PHY_1000CR_1000T; - PHY_WRITE(sc, IP1000PHY_MII_1000CR, 0); - PHY_WRITE(sc, IP1000PHY_MII_BMCR, speed); - - if (IFM_SUBTYPE(ife->ifm_media) != IFM_1000_T) - break; - - gig |= IP1000PHY_1000CR_MASTER | IP1000PHY_1000CR_MANUAL; - if ((ife->ifm_media & IFM_ETH_MASTER) != 0 || - (mii->mii_ifp->if_flags & IFF_LINK0) != 0) - gig |= IP1000PHY_1000CR_MMASTER; + if (IFM_SUBTYPE(ife->ifm_media) == IFM_1000_T) { + gig |= + IP1000PHY_1000CR_MASTER | IP1000PHY_1000CR_MANUAL; + if ((ife->ifm_media & IFM_ETH_MASTER) != 0 || + (mii->mii_ifp->if_flags & IFF_LINK0) != 0) + gig |= IP1000PHY_1000CR_MMASTER; + } else + gig = 0; PHY_WRITE(sc, IP1000PHY_MII_1000CR, gig); + PHY_WRITE(sc, IP1000PHY_MII_BMCR, speed); done: break; From owner-svn-src-all@FreeBSD.ORG Fri Jan 21 00:40:51 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C7A81065697; Fri, 21 Jan 2011 00:40:51 +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 7A9CD8FC12; Fri, 21 Jan 2011 00:40:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0L0epdx033324; Fri, 21 Jan 2011 00:40:51 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0L0epFZ033320; Fri, 21 Jan 2011 00:40:51 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201101210040.p0L0epFZ033320@svn.freebsd.org> From: Marius Strobl Date: Fri, 21 Jan 2011 00:40:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217671 - stable/7/sys/dev/mii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jan 2011 00:40:51 -0000 Author: marius Date: Fri Jan 21 00:40:51 2011 New Revision: 217671 URL: http://svn.freebsd.org/changeset/base/217671 Log: MFC: r217412 - Masking IFM_GMASK when also masking IFM_FDX is redundant and just complicates the code. - Don't let atphy_setmedia() announce PAUSE support for half-duplex when MIIF_FORCEPAUSE is set. - Simplify e1000phy_service() and ip1000phy_service() to only set the manual configuration bits once after we have figured them all out. For ip1000phy_service() this also means we no longer unnecessarily update the hardware along the road. Modified: stable/7/sys/dev/mii/atphy.c stable/7/sys/dev/mii/e1000phy.c stable/7/sys/dev/mii/ip1000phy.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/mii/atphy.c ============================================================================== --- stable/7/sys/dev/mii/atphy.c Fri Jan 21 00:40:25 2011 (r217670) +++ stable/7/sys/dev/mii/atphy.c Fri Jan 21 00:40:51 2011 (r217671) @@ -187,9 +187,9 @@ atphy_service(struct mii_softc *sc, stru } anar = atphy_anar(ife); - if (((ife->ifm_media & IFM_GMASK) & IFM_FDX) != 0) { + if ((ife->ifm_media & IFM_FDX) != 0) { bmcr |= BMCR_FDX; - if (((ife->ifm_media & IFM_GMASK) & IFM_FLOW) != 0 || + if ((ife->ifm_media & IFM_FLOW) != 0 || (sc->mii_flags & MIIF_FORCEPAUSE) != 0) anar |= ANAR_PAUSE_TOWARDS; } @@ -371,7 +371,7 @@ atphy_anar(struct ifmedia_entry *ife) return (0); } - if (((ife->ifm_media & IFM_GMASK) & IFM_FDX) != 0) { + if ((ife->ifm_media & IFM_FDX) != 0) { if (IFM_SUBTYPE(ife->ifm_media) == IFM_100_TX) anar |= ANAR_TX_FD; else @@ -387,13 +387,13 @@ atphy_setmedia(struct mii_softc *sc, int uint16_t anar; anar = BMSR_MEDIA_TO_ANAR(sc->mii_capabilities) | ANAR_CSMA; - if (((IFM_SUBTYPE(media) == IFM_AUTO || - ((media & IFM_GMASK) & IFM_FDX) != 0) && - ((media & IFM_GMASK) & IFM_FLOW) != 0) || - (sc->mii_flags & MIIF_FORCEPAUSE) != 0) + if ((IFM_SUBTYPE(media) == IFM_AUTO || (media & IFM_FDX) != 0) && + ((media & IFM_FLOW) != 0 || + (sc->mii_flags & MIIF_FORCEPAUSE) != 0)) anar |= ANAR_PAUSE_TOWARDS; PHY_WRITE(sc, MII_ANAR, anar); - if ((sc->mii_extcapabilities & (EXTSR_1000TFDX | EXTSR_1000THDX)) != 0) + if ((sc->mii_extcapabilities & + (EXTSR_1000TFDX | EXTSR_1000THDX)) != 0) PHY_WRITE(sc, MII_100T2CR, GTCR_ADV_1000TFDX | GTCR_ADV_1000THDX); PHY_WRITE(sc, MII_BMCR, BMCR_RESET | BMCR_AUTOEN | BMCR_STARTNEG); Modified: stable/7/sys/dev/mii/e1000phy.c ============================================================================== --- stable/7/sys/dev/mii/e1000phy.c Fri Jan 21 00:40:25 2011 (r217670) +++ stable/7/sys/dev/mii/e1000phy.c Fri Jan 21 00:40:51 2011 (r217671) @@ -358,7 +358,7 @@ e1000phy_service(struct mii_softc *sc, s return (EINVAL); } - if (((ife->ifm_media & IFM_GMASK) & IFM_FDX) != 0) { + if ((ife->ifm_media & IFM_FDX) != 0) { speed |= E1000_CR_FULL_DUPLEX; gig = E1000_1GCR_1000T_FD; } else @@ -373,10 +373,10 @@ e1000phy_service(struct mii_softc *sc, s if ((ife->ifm_media & IFM_ETH_MASTER) != 0 || (mii->mii_ifp->if_flags & IFF_LINK0) != 0) gig |= E1000_1GCR_MS_VALUE; - PHY_WRITE(sc, E1000_1GCR, gig); } else if ((sc->mii_extcapabilities & (EXTSR_1000TFDX | EXTSR_1000THDX)) != 0) - PHY_WRITE(sc, E1000_1GCR, 0); + gig = 0; + PHY_WRITE(sc, E1000_1GCR, gig); PHY_WRITE(sc, E1000_AR, E1000_AR_SELECTOR_FIELD); PHY_WRITE(sc, E1000_CR, speed | E1000_CR_RESET); done: Modified: stable/7/sys/dev/mii/ip1000phy.c ============================================================================== --- stable/7/sys/dev/mii/ip1000phy.c Fri Jan 21 00:40:25 2011 (r217670) +++ stable/7/sys/dev/mii/ip1000phy.c Fri Jan 21 00:40:51 2011 (r217671) @@ -186,23 +186,22 @@ ip1000phy_service(struct mii_softc *sc, return (EINVAL); } - if (((ife->ifm_media & IFM_GMASK) & IFM_FDX) != 0) { + if ((ife->ifm_media & IFM_FDX) != 0) { speed |= IP1000PHY_BMCR_FDX; gig = IP1000PHY_1000CR_1000T_FDX; } else gig = IP1000PHY_1000CR_1000T; - PHY_WRITE(sc, IP1000PHY_MII_1000CR, 0); - PHY_WRITE(sc, IP1000PHY_MII_BMCR, speed); - - if (IFM_SUBTYPE(ife->ifm_media) != IFM_1000_T) - break; - - gig |= IP1000PHY_1000CR_MASTER | IP1000PHY_1000CR_MANUAL; - if ((ife->ifm_media & IFM_ETH_MASTER) != 0 || - (mii->mii_ifp->if_flags & IFF_LINK0) != 0) - gig |= IP1000PHY_1000CR_MMASTER; + if (IFM_SUBTYPE(ife->ifm_media) == IFM_1000_T) { + gig |= + IP1000PHY_1000CR_MASTER | IP1000PHY_1000CR_MANUAL; + if ((ife->ifm_media & IFM_ETH_MASTER) != 0 || + (mii->mii_ifp->if_flags & IFF_LINK0) != 0) + gig |= IP1000PHY_1000CR_MMASTER; + } else + gig = 0; PHY_WRITE(sc, IP1000PHY_MII_1000CR, gig); + PHY_WRITE(sc, IP1000PHY_MII_BMCR, speed); done: break; From owner-svn-src-all@FreeBSD.ORG Fri Jan 21 00:48:05 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 16C3A1065672; Fri, 21 Jan 2011 00:48:05 +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 054058FC15; Fri, 21 Jan 2011 00:48:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0L0m4a1033547; Fri, 21 Jan 2011 00:48:04 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0L0m4wZ033543; Fri, 21 Jan 2011 00:48:04 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201101210048.p0L0m4wZ033543@svn.freebsd.org> From: Marius Strobl Date: Fri, 21 Jan 2011 00:48:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217672 - stable/8/sys/dev/mii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jan 2011 00:48:05 -0000 Author: marius Date: Fri Jan 21 00:48:04 2011 New Revision: 217672 URL: http://svn.freebsd.org/changeset/base/217672 Log: MFC: r217413 - Even after masking the media with IFM_GMASK the result may have bits besides the duplex ones set so just comparing it with IFM_FDX may lead to false negatives. - Simplify ciphy_service() to only set the manual configuration bits once after we have figured them all out. This also means we no longer unnecessarily update the hardware along the road. Modified: stable/8/sys/dev/mii/brgphy.c stable/8/sys/dev/mii/ciphy.c stable/8/sys/dev/mii/xmphy.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/mii/brgphy.c ============================================================================== --- stable/8/sys/dev/mii/brgphy.c Fri Jan 21 00:40:51 2011 (r217671) +++ stable/8/sys/dev/mii/brgphy.c Fri Jan 21 00:48:04 2011 (r217672) @@ -452,7 +452,7 @@ brgphy_setmedia(struct mii_softc *sc, in break; } - if ((media & IFM_GMASK) == IFM_FDX) { + if ((media & IFM_FDX) != 0) { bmcr |= BRGPHY_BMCR_FDX; gig = BRGPHY_1000CTL_AFD; } else { Modified: stable/8/sys/dev/mii/ciphy.c ============================================================================== --- stable/8/sys/dev/mii/ciphy.c Fri Jan 21 00:40:51 2011 (r217671) +++ stable/8/sys/dev/mii/ciphy.c Fri Jan 21 00:48:04 2011 (r217672) @@ -176,27 +176,24 @@ ciphy_service(struct mii_softc *sc, stru case IFM_10_T: speed = CIPHY_S10; setit: - if ((ife->ifm_media & IFM_GMASK) == IFM_FDX) { + if ((ife->ifm_media & IFM_FDX) != 0) { speed |= CIPHY_BMCR_FDX; gig = CIPHY_1000CTL_AFD; - } else { + } else gig = CIPHY_1000CTL_AHD; - } - PHY_WRITE(sc, CIPHY_MII_1000CTL, 0); + if (IFM_SUBTYPE(ife->ifm_media) == IFM_1000_T) { + gig |= CIPHY_1000CTL_MSE; + if ((ife->ifm_media & IFM_ETH_MASTER) != 0 || + (mii->mii_ifp->if_flags & IFF_LINK0) != 0) + gig |= CIPHY_1000CTL_MSC; + speed |= + CIPHY_BMCR_AUTOEN | CIPHY_BMCR_STARTNEG; + } else + gig = 0; + PHY_WRITE(sc, CIPHY_MII_1000CTL, gig); PHY_WRITE(sc, CIPHY_MII_BMCR, speed); PHY_WRITE(sc, CIPHY_MII_ANAR, CIPHY_SEL_TYPE); - - if (IFM_SUBTYPE(ife->ifm_media) != IFM_1000_T) - break; - - gig |= CIPHY_1000CTL_MSE; - if ((ife->ifm_media & IFM_ETH_MASTER) != 0 || - (mii->mii_ifp->if_flags & IFF_LINK0) != 0) - gig |= CIPHY_1000CTL_MSC; - PHY_WRITE(sc, CIPHY_MII_1000CTL, gig); - PHY_WRITE(sc, CIPHY_MII_BMCR, - speed | CIPHY_BMCR_AUTOEN | CIPHY_BMCR_STARTNEG); break; case IFM_NONE: PHY_WRITE(sc, MII_BMCR, BMCR_ISO | BMCR_PDOWN); Modified: stable/8/sys/dev/mii/xmphy.c ============================================================================== --- stable/8/sys/dev/mii/xmphy.c Fri Jan 21 00:40:51 2011 (r217671) +++ stable/8/sys/dev/mii/xmphy.c Fri Jan 21 00:48:04 2011 (r217672) @@ -171,7 +171,7 @@ xmphy_service(struct mii_softc *sc, stru break; case IFM_1000_SX: mii_phy_reset(sc); - if ((ife->ifm_media & IFM_GMASK) == IFM_FDX) { + if ((ife->ifm_media & IFM_FDX) != 0) { PHY_WRITE(sc, XMPHY_MII_ANAR, XMPHY_ANAR_FDX); PHY_WRITE(sc, XMPHY_MII_BMCR, XMPHY_BMCR_FDX); } else { From owner-svn-src-all@FreeBSD.ORG Fri Jan 21 00:48:09 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2E2A31065791; Fri, 21 Jan 2011 00:48:09 +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 1C9178FC18; Fri, 21 Jan 2011 00:48:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0L0m9lq033585; Fri, 21 Jan 2011 00:48:09 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0L0m8bL033581; Fri, 21 Jan 2011 00:48:08 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201101210048.p0L0m8bL033581@svn.freebsd.org> From: Marius Strobl Date: Fri, 21 Jan 2011 00:48:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217673 - stable/7/sys/dev/mii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jan 2011 00:48:09 -0000 Author: marius Date: Fri Jan 21 00:48:08 2011 New Revision: 217673 URL: http://svn.freebsd.org/changeset/base/217673 Log: MFC: r217413 - Even after masking the media with IFM_GMASK the result may have bits besides the duplex ones set so just comparing it with IFM_FDX may lead to false negatives. - Simplify ciphy_service() to only set the manual configuration bits once after we have figured them all out. This also means we no longer unnecessarily update the hardware along the road. Modified: stable/7/sys/dev/mii/brgphy.c stable/7/sys/dev/mii/ciphy.c stable/7/sys/dev/mii/xmphy.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/mii/brgphy.c ============================================================================== --- stable/7/sys/dev/mii/brgphy.c Fri Jan 21 00:48:04 2011 (r217672) +++ stable/7/sys/dev/mii/brgphy.c Fri Jan 21 00:48:08 2011 (r217673) @@ -452,7 +452,7 @@ brgphy_setmedia(struct mii_softc *sc, in break; } - if ((media & IFM_GMASK) == IFM_FDX) { + if ((media & IFM_FDX) != 0) { bmcr |= BRGPHY_BMCR_FDX; gig = BRGPHY_1000CTL_AFD; } else { Modified: stable/7/sys/dev/mii/ciphy.c ============================================================================== --- stable/7/sys/dev/mii/ciphy.c Fri Jan 21 00:48:04 2011 (r217672) +++ stable/7/sys/dev/mii/ciphy.c Fri Jan 21 00:48:08 2011 (r217673) @@ -89,8 +89,8 @@ static const struct mii_phydesc ciphys[] MII_PHY_DESC(CICADA, CS8201), MII_PHY_DESC(CICADA, CS8201A), MII_PHY_DESC(CICADA, CS8201B), - MII_PHY_DESC(CICADA, VSC8211), MII_PHY_DESC(CICADA, CS8204), + MII_PHY_DESC(CICADA, VSC8211), MII_PHY_DESC(CICADA, CS8244), MII_PHY_DESC(VITESSE, VSC8601), MII_PHY_END @@ -176,27 +176,24 @@ ciphy_service(struct mii_softc *sc, stru case IFM_10_T: speed = CIPHY_S10; setit: - if ((ife->ifm_media & IFM_GMASK) == IFM_FDX) { + if ((ife->ifm_media & IFM_FDX) != 0) { speed |= CIPHY_BMCR_FDX; gig = CIPHY_1000CTL_AFD; - } else { + } else gig = CIPHY_1000CTL_AHD; - } - PHY_WRITE(sc, CIPHY_MII_1000CTL, 0); + if (IFM_SUBTYPE(ife->ifm_media) == IFM_1000_T) { + gig |= CIPHY_1000CTL_MSE; + if ((ife->ifm_media & IFM_ETH_MASTER) != 0 || + (mii->mii_ifp->if_flags & IFF_LINK0) != 0) + gig |= CIPHY_1000CTL_MSC; + speed |= + CIPHY_BMCR_AUTOEN | CIPHY_BMCR_STARTNEG; + } else + gig = 0; + PHY_WRITE(sc, CIPHY_MII_1000CTL, gig); PHY_WRITE(sc, CIPHY_MII_BMCR, speed); PHY_WRITE(sc, CIPHY_MII_ANAR, CIPHY_SEL_TYPE); - - if (IFM_SUBTYPE(ife->ifm_media) != IFM_1000_T) - break; - - gig |= CIPHY_1000CTL_MSE; - if ((ife->ifm_media & IFM_ETH_MASTER) != 0 || - (mii->mii_ifp->if_flags & IFF_LINK0) != 0) - gig |= CIPHY_1000CTL_MSC; - PHY_WRITE(sc, CIPHY_MII_1000CTL, gig); - PHY_WRITE(sc, CIPHY_MII_BMCR, - speed | CIPHY_BMCR_AUTOEN | CIPHY_BMCR_STARTNEG); break; case IFM_NONE: PHY_WRITE(sc, MII_BMCR, BMCR_ISO | BMCR_PDOWN); Modified: stable/7/sys/dev/mii/xmphy.c ============================================================================== --- stable/7/sys/dev/mii/xmphy.c Fri Jan 21 00:48:04 2011 (r217672) +++ stable/7/sys/dev/mii/xmphy.c Fri Jan 21 00:48:08 2011 (r217673) @@ -171,7 +171,7 @@ xmphy_service(struct mii_softc *sc, stru break; case IFM_1000_SX: mii_phy_reset(sc); - if ((ife->ifm_media & IFM_GMASK) == IFM_FDX) { + if ((ife->ifm_media & IFM_FDX) != 0) { PHY_WRITE(sc, XMPHY_MII_ANAR, XMPHY_ANAR_FDX); PHY_WRITE(sc, XMPHY_MII_BMCR, XMPHY_BMCR_FDX); } else { From owner-svn-src-all@FreeBSD.ORG Fri Jan 21 00:50:34 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA088106564A; Fri, 21 Jan 2011 00:50:34 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7E48F8FC0A; Fri, 21 Jan 2011 00:50:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0L0oYT9033720; Fri, 21 Jan 2011 00:50:34 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0L0oYGO033711; Fri, 21 Jan 2011 00:50:34 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201101210050.p0L0oYGO033711@svn.freebsd.org> From: Marius Strobl Date: Fri, 21 Jan 2011 00:50:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217674 - stable/8/sys/dev/mii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jan 2011 00:50:34 -0000 Author: marius Date: Fri Jan 21 00:50:34 2011 New Revision: 217674 URL: http://svn.freebsd.org/changeset/base/217674 Log: MFC: r217414 - Don't announce PAUSE support for half-duplex when MIIF_FORCEPAUSE is set. - Let mii_phy_auto() also announce PAUSE support for 10baseT-FDX. Modified: stable/8/sys/dev/mii/jmphy.c stable/8/sys/dev/mii/mii_physubr.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/mii/jmphy.c ============================================================================== --- stable/8/sys/dev/mii/jmphy.c Fri Jan 21 00:48:08 2011 (r217673) +++ stable/8/sys/dev/mii/jmphy.c Fri Jan 21 00:50:34 2011 (r217674) @@ -334,10 +334,10 @@ jmphy_setmedia(struct mii_softc *sc, str bmcr |= BMCR_LOOP; anar = jmphy_anar(ife); - if (((IFM_SUBTYPE(ife->ifm_media) == IFM_AUTO || + if ((IFM_SUBTYPE(ife->ifm_media) == IFM_AUTO || (ife->ifm_media & IFM_FDX) != 0) && - (ife->ifm_media & IFM_FLOW) != 0) || - (sc->mii_flags & MIIF_FORCEPAUSE) != 0) + ((ife->ifm_media & IFM_FLOW) != 0 || + (sc->mii_flags & MIIF_FORCEPAUSE) != 0)) anar |= ANAR_PAUSE_TOWARDS; if ((sc->mii_flags & MIIF_HAVE_GTCR) != 0) { Modified: stable/8/sys/dev/mii/mii_physubr.c ============================================================================== --- stable/8/sys/dev/mii/mii_physubr.c Fri Jan 21 00:48:08 2011 (r217673) +++ stable/8/sys/dev/mii/mii_physubr.c Fri Jan 21 00:50:34 2011 (r217674) @@ -135,8 +135,9 @@ mii_phy_setmedia(struct mii_softc *sc) gtcr |= GTCR_ADV_MS; } - if ((ife->ifm_media & IFM_GMASK) == (IFM_FDX | IFM_FLOW) || - (sc->mii_flags & MIIF_FORCEPAUSE) != 0) { + if ((ife->ifm_media & IFM_FDX) != 0 && + ((ife->ifm_media & IFM_FLOW) != 0 || + (sc->mii_flags & MIIF_FORCEPAUSE) != 0)) { if ((sc->mii_flags & MIIF_IS_1000X) != 0) anar |= ANAR_X_PAUSE_TOWARDS; else { @@ -184,7 +185,8 @@ mii_phy_auto(struct mii_softc *sc) ANAR_CSMA; if ((ife->ifm_media & IFM_FLOW) != 0 || (sc->mii_flags & MIIF_FORCEPAUSE) != 0) { - if ((sc->mii_capabilities & BMSR_100TXFDX) != 0) + if ((sc->mii_capabilities & + (BMSR_10TFDX | BMSR_100TXFDX)) != 0) anar |= ANAR_FC; /* XXX Only 1000BASE-T has PAUSE_ASYM? */ if (((sc->mii_flags & MIIF_HAVE_GTCR) != 0) && From owner-svn-src-all@FreeBSD.ORG Fri Jan 21 00:50:35 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1E7C7106566B; Fri, 21 Jan 2011 00:50:35 +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 E6E218FC13; Fri, 21 Jan 2011 00:50:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0L0oYbG033737; Fri, 21 Jan 2011 00:50:34 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0L0oY7O033734; Fri, 21 Jan 2011 00:50:34 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201101210050.p0L0oY7O033734@svn.freebsd.org> From: Marius Strobl Date: Fri, 21 Jan 2011 00:50:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217675 - stable/7/sys/dev/mii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jan 2011 00:50:35 -0000 Author: marius Date: Fri Jan 21 00:50:34 2011 New Revision: 217675 URL: http://svn.freebsd.org/changeset/base/217675 Log: MFC: r217414 - Don't announce PAUSE support for half-duplex when MIIF_FORCEPAUSE is set. - Let mii_phy_auto() also announce PAUSE support for 10baseT-FDX. Modified: stable/7/sys/dev/mii/jmphy.c stable/7/sys/dev/mii/mii_physubr.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/mii/jmphy.c ============================================================================== --- stable/7/sys/dev/mii/jmphy.c Fri Jan 21 00:50:34 2011 (r217674) +++ stable/7/sys/dev/mii/jmphy.c Fri Jan 21 00:50:34 2011 (r217675) @@ -334,10 +334,10 @@ jmphy_setmedia(struct mii_softc *sc, str bmcr |= BMCR_LOOP; anar = jmphy_anar(ife); - if (((IFM_SUBTYPE(ife->ifm_media) == IFM_AUTO || + if ((IFM_SUBTYPE(ife->ifm_media) == IFM_AUTO || (ife->ifm_media & IFM_FDX) != 0) && - (ife->ifm_media & IFM_FLOW) != 0) || - (sc->mii_flags & MIIF_FORCEPAUSE) != 0) + ((ife->ifm_media & IFM_FLOW) != 0 || + (sc->mii_flags & MIIF_FORCEPAUSE) != 0)) anar |= ANAR_PAUSE_TOWARDS; if ((sc->mii_flags & MIIF_HAVE_GTCR) != 0) { Modified: stable/7/sys/dev/mii/mii_physubr.c ============================================================================== --- stable/7/sys/dev/mii/mii_physubr.c Fri Jan 21 00:50:34 2011 (r217674) +++ stable/7/sys/dev/mii/mii_physubr.c Fri Jan 21 00:50:34 2011 (r217675) @@ -135,8 +135,9 @@ mii_phy_setmedia(struct mii_softc *sc) gtcr |= GTCR_ADV_MS; } - if ((ife->ifm_media & IFM_GMASK) == (IFM_FDX | IFM_FLOW) || - (sc->mii_flags & MIIF_FORCEPAUSE) != 0) { + if ((ife->ifm_media & IFM_FDX) != 0 && + ((ife->ifm_media & IFM_FLOW) != 0 || + (sc->mii_flags & MIIF_FORCEPAUSE) != 0)) { if ((sc->mii_flags & MIIF_IS_1000X) != 0) anar |= ANAR_X_PAUSE_TOWARDS; else { @@ -184,7 +185,8 @@ mii_phy_auto(struct mii_softc *sc) ANAR_CSMA; if ((ife->ifm_media & IFM_FLOW) != 0 || (sc->mii_flags & MIIF_FORCEPAUSE) != 0) { - if ((sc->mii_capabilities & BMSR_100TXFDX) != 0) + if ((sc->mii_capabilities & + (BMSR_10TFDX | BMSR_100TXFDX)) != 0) anar |= ANAR_FC; /* XXX Only 1000BASE-T has PAUSE_ASYM? */ if (((sc->mii_flags & MIIF_HAVE_GTCR) != 0) && From owner-svn-src-all@FreeBSD.ORG Fri Jan 21 00:53:32 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5A3611065670; Fri, 21 Jan 2011 00:53:32 +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 488828FC14; Fri, 21 Jan 2011 00:53:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0L0rWD8033861; Fri, 21 Jan 2011 00:53:32 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0L0rWVD033858; Fri, 21 Jan 2011 00:53:32 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201101210053.p0L0rWVD033858@svn.freebsd.org> From: Marius Strobl Date: Fri, 21 Jan 2011 00:53:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217676 - stable/8/sys/dev/dc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jan 2011 00:53:32 -0000 Author: marius Date: Fri Jan 21 00:53:32 2011 New Revision: 217676 URL: http://svn.freebsd.org/changeset/base/217676 Log: MFC: r217417 - Even after masking the media with IFM_GMASK the result may have bits besides the duplex ones set so just comparing it with IFM_FDX may lead to false negatives. - Just let the default case handle all unsupported media types. - In pnphy_status() don't unnecessarily read a register twice. - Remove unnused macros. Modified: stable/8/sys/dev/dc/dcphy.c stable/8/sys/dev/dc/pnphy.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/dc/dcphy.c ============================================================================== --- stable/8/sys/dev/dc/dcphy.c Fri Jan 21 00:50:34 2011 (r217675) +++ stable/8/sys/dev/dc/dcphy.c Fri Jan 21 00:53:32 2011 (r217676) @@ -222,17 +222,12 @@ dcphy_service(struct mii_softc *sc, stru /*dcphy_reset(sc);*/ (void) dcphy_auto(sc); break; - case IFM_100_T4: - /* - * XXX Not supported as a manual setting right now. - */ - return (EINVAL); case IFM_100_TX: dcphy_reset(sc); DC_CLRBIT(dc_sc, DC_10BTCTRL, DC_TCTL_AUTONEGENBL); mode |= DC_NETCFG_PORTSEL | DC_NETCFG_PCS | DC_NETCFG_SCRAMBLER; - if ((ife->ifm_media & IFM_GMASK) == IFM_FDX) + if ((ife->ifm_media & IFM_FDX) != 0) mode |= DC_NETCFG_FULLDUPLEX; else mode &= ~DC_NETCFG_FULLDUPLEX; @@ -241,7 +236,7 @@ dcphy_service(struct mii_softc *sc, stru case IFM_10_T: DC_CLRBIT(dc_sc, DC_SIARESET, DC_SIA_RESET); DC_CLRBIT(dc_sc, DC_10BTCTRL, 0xFFFF); - if ((ife->ifm_media & IFM_GMASK) == IFM_FDX) + if ((ife->ifm_media & IFM_FDX) != 0) DC_SETBIT(dc_sc, DC_10BTCTRL, 0x7F3D); else DC_SETBIT(dc_sc, DC_10BTCTRL, 0x7F3F); @@ -249,7 +244,7 @@ dcphy_service(struct mii_softc *sc, stru DC_CLRBIT(dc_sc, DC_10BTCTRL, DC_TCTL_AUTONEGENBL); mode &= ~DC_NETCFG_PORTSEL; mode |= DC_NETCFG_SPEEDSEL; - if ((ife->ifm_media & IFM_GMASK) == IFM_FDX) + if ((ife->ifm_media & IFM_FDX) != 0) mode |= DC_NETCFG_FULLDUPLEX; else mode &= ~DC_NETCFG_FULLDUPLEX; Modified: stable/8/sys/dev/dc/pnphy.c ============================================================================== --- stable/8/sys/dev/dc/pnphy.c Fri Jan 21 00:50:34 2011 (r217675) +++ stable/8/sys/dev/dc/pnphy.c Fri Jan 21 00:53:32 2011 (r217676) @@ -66,14 +66,6 @@ __FBSDID("$FreeBSD$"); #include "miibus_if.h" -#define DC_SETBIT(sc, reg, x) \ - CSR_WRITE_4(sc, reg, \ - CSR_READ_4(sc, reg) | x) - -#define DC_CLRBIT(sc, reg, x) \ - CSR_WRITE_4(sc, reg, \ - CSR_READ_4(sc, reg) & ~x) - static int pnphy_probe(device_t); static int pnphy_attach(device_t); @@ -170,23 +162,19 @@ pnphy_service(struct mii_softc *sc, stru if ((mii->mii_ifp->if_flags & IFF_UP) == 0) break; + /* + * Note that auto-negotiation is broken on this chip. + */ switch (IFM_SUBTYPE(ife->ifm_media)) { - case IFM_AUTO: - /* NWAY is busted on this chip */ - case IFM_100_T4: - /* - * XXX Not supported as a manual setting right now. - */ - return (EINVAL); case IFM_100_TX: mii->mii_media_active = IFM_ETHER | IFM_100_TX; - if ((ife->ifm_media & IFM_GMASK) == IFM_FDX) + if ((ife->ifm_media & IFM_FDX) != 0) mii->mii_media_active |= IFM_FDX; MIIBUS_STATCHG(sc->mii_dev); return (0); case IFM_10_T: mii->mii_media_active = IFM_ETHER | IFM_10_T; - if ((ife->ifm_media & IFM_GMASK) == IFM_FDX) + if ((ife->ifm_media & IFM_FDX) != 0) mii->mii_media_active |= IFM_FDX; MIIBUS_STATCHG(sc->mii_dev); return (0); @@ -226,15 +214,14 @@ pnphy_status(struct mii_softc *sc) mii->mii_media_active = IFM_ETHER; reg = CSR_READ_4(dc_sc, DC_ISR); - if (!(reg & DC_ISR_LINKFAIL)) mii->mii_media_status |= IFM_ACTIVE; - - if (CSR_READ_4(dc_sc, DC_NETCFG) & DC_NETCFG_SPEEDSEL) + reg = CSR_READ_4(dc_sc, DC_NETCFG); + if (reg & DC_NETCFG_SPEEDSEL) mii->mii_media_active |= IFM_10_T; else mii->mii_media_active |= IFM_100_TX; - if (CSR_READ_4(dc_sc, DC_NETCFG) & DC_NETCFG_FULLDUPLEX) + if (reg & DC_NETCFG_FULLDUPLEX) mii->mii_media_active |= IFM_FDX; else mii->mii_media_active |= IFM_HDX; From owner-svn-src-all@FreeBSD.ORG Fri Jan 21 00:53:37 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D8F2210657C3; Fri, 21 Jan 2011 00:53:37 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C73178FC1C; Fri, 21 Jan 2011 00:53:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0L0rbua033901; Fri, 21 Jan 2011 00:53:37 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0L0rbs9033898; Fri, 21 Jan 2011 00:53:37 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201101210053.p0L0rbs9033898@svn.freebsd.org> From: Marius Strobl Date: Fri, 21 Jan 2011 00:53:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217677 - stable/7/sys/dev/dc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jan 2011 00:53:38 -0000 Author: marius Date: Fri Jan 21 00:53:37 2011 New Revision: 217677 URL: http://svn.freebsd.org/changeset/base/217677 Log: MFC: r217417 - Even after masking the media with IFM_GMASK the result may have bits besides the duplex ones set so just comparing it with IFM_FDX may lead to false negatives. - Just let the default case handle all unsupported media types. - In pnphy_status() don't unnecessarily read a register twice. - Remove unnused macros. Modified: stable/7/sys/dev/dc/dcphy.c stable/7/sys/dev/dc/pnphy.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/dc/dcphy.c ============================================================================== --- stable/7/sys/dev/dc/dcphy.c Fri Jan 21 00:53:32 2011 (r217676) +++ stable/7/sys/dev/dc/dcphy.c Fri Jan 21 00:53:37 2011 (r217677) @@ -222,17 +222,12 @@ dcphy_service(struct mii_softc *sc, stru /*dcphy_reset(sc);*/ (void) dcphy_auto(sc); break; - case IFM_100_T4: - /* - * XXX Not supported as a manual setting right now. - */ - return (EINVAL); case IFM_100_TX: dcphy_reset(sc); DC_CLRBIT(dc_sc, DC_10BTCTRL, DC_TCTL_AUTONEGENBL); mode |= DC_NETCFG_PORTSEL | DC_NETCFG_PCS | DC_NETCFG_SCRAMBLER; - if ((ife->ifm_media & IFM_GMASK) == IFM_FDX) + if ((ife->ifm_media & IFM_FDX) != 0) mode |= DC_NETCFG_FULLDUPLEX; else mode &= ~DC_NETCFG_FULLDUPLEX; @@ -241,7 +236,7 @@ dcphy_service(struct mii_softc *sc, stru case IFM_10_T: DC_CLRBIT(dc_sc, DC_SIARESET, DC_SIA_RESET); DC_CLRBIT(dc_sc, DC_10BTCTRL, 0xFFFF); - if ((ife->ifm_media & IFM_GMASK) == IFM_FDX) + if ((ife->ifm_media & IFM_FDX) != 0) DC_SETBIT(dc_sc, DC_10BTCTRL, 0x7F3D); else DC_SETBIT(dc_sc, DC_10BTCTRL, 0x7F3F); @@ -249,7 +244,7 @@ dcphy_service(struct mii_softc *sc, stru DC_CLRBIT(dc_sc, DC_10BTCTRL, DC_TCTL_AUTONEGENBL); mode &= ~DC_NETCFG_PORTSEL; mode |= DC_NETCFG_SPEEDSEL; - if ((ife->ifm_media & IFM_GMASK) == IFM_FDX) + if ((ife->ifm_media & IFM_FDX) != 0) mode |= DC_NETCFG_FULLDUPLEX; else mode &= ~DC_NETCFG_FULLDUPLEX; Modified: stable/7/sys/dev/dc/pnphy.c ============================================================================== --- stable/7/sys/dev/dc/pnphy.c Fri Jan 21 00:53:32 2011 (r217676) +++ stable/7/sys/dev/dc/pnphy.c Fri Jan 21 00:53:37 2011 (r217677) @@ -66,14 +66,6 @@ __FBSDID("$FreeBSD$"); #include "miibus_if.h" -#define DC_SETBIT(sc, reg, x) \ - CSR_WRITE_4(sc, reg, \ - CSR_READ_4(sc, reg) | x) - -#define DC_CLRBIT(sc, reg, x) \ - CSR_WRITE_4(sc, reg, \ - CSR_READ_4(sc, reg) & ~x) - static int pnphy_probe(device_t); static int pnphy_attach(device_t); @@ -170,23 +162,19 @@ pnphy_service(struct mii_softc *sc, stru if ((mii->mii_ifp->if_flags & IFF_UP) == 0) break; + /* + * Note that auto-negotiation is broken on this chip. + */ switch (IFM_SUBTYPE(ife->ifm_media)) { - case IFM_AUTO: - /* NWAY is busted on this chip */ - case IFM_100_T4: - /* - * XXX Not supported as a manual setting right now. - */ - return (EINVAL); case IFM_100_TX: mii->mii_media_active = IFM_ETHER | IFM_100_TX; - if ((ife->ifm_media & IFM_GMASK) == IFM_FDX) + if ((ife->ifm_media & IFM_FDX) != 0) mii->mii_media_active |= IFM_FDX; MIIBUS_STATCHG(sc->mii_dev); return (0); case IFM_10_T: mii->mii_media_active = IFM_ETHER | IFM_10_T; - if ((ife->ifm_media & IFM_GMASK) == IFM_FDX) + if ((ife->ifm_media & IFM_FDX) != 0) mii->mii_media_active |= IFM_FDX; MIIBUS_STATCHG(sc->mii_dev); return (0); @@ -226,15 +214,14 @@ pnphy_status(struct mii_softc *sc) mii->mii_media_active = IFM_ETHER; reg = CSR_READ_4(dc_sc, DC_ISR); - if (!(reg & DC_ISR_LINKFAIL)) mii->mii_media_status |= IFM_ACTIVE; - - if (CSR_READ_4(dc_sc, DC_NETCFG) & DC_NETCFG_SPEEDSEL) + reg = CSR_READ_4(dc_sc, DC_NETCFG); + if (reg & DC_NETCFG_SPEEDSEL) mii->mii_media_active |= IFM_10_T; else mii->mii_media_active |= IFM_100_TX; - if (CSR_READ_4(dc_sc, DC_NETCFG) & DC_NETCFG_FULLDUPLEX) + if (reg & DC_NETCFG_FULLDUPLEX) mii->mii_media_active |= IFM_FDX; else mii->mii_media_active |= IFM_HDX; From owner-svn-src-all@FreeBSD.ORG Fri Jan 21 01:12:22 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C963B1065670; Fri, 21 Jan 2011 01:12:22 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B6B438FC1B; Fri, 21 Jan 2011 01:12:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0L1CMRS034358; Fri, 21 Jan 2011 01:12:22 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0L1CMea034351; Fri, 21 Jan 2011 01:12:22 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201101210112.p0L1CMea034351@svn.freebsd.org> From: Rick Macklem Date: Fri, 21 Jan 2011 01:12:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217678 - in stable/8/sys: fs/nfs fs/nfsserver nfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jan 2011 01:12:23 -0000 Author: rmacklem Date: Fri Jan 21 01:12:22 2011 New Revision: 217678 URL: http://svn.freebsd.org/changeset/base/217678 Log: MFC: r217432 Modify the experimental NFSv4 server so that it posts a SIGUSR2 signal to the master nfsd daemon whenever the stable restart file has been modified. This will allow the master nfsd daemon to maintain an up to date backup copy of the file. This is enabled via the nfssvc() syscall, so that older nfsd daemons will not be signaled. Modified: stable/8/sys/fs/nfs/nfs_var.h stable/8/sys/fs/nfsserver/nfs_nfsdkrpc.c stable/8/sys/fs/nfsserver/nfs_nfsdport.c stable/8/sys/fs/nfsserver/nfs_nfsdstate.c stable/8/sys/nfs/nfs_nfssvc.c stable/8/sys/nfs/nfssvc.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/fs/nfs/nfs_var.h ============================================================================== --- stable/8/sys/fs/nfs/nfs_var.h Fri Jan 21 00:53:37 2011 (r217677) +++ stable/8/sys/fs/nfs/nfs_var.h Fri Jan 21 01:12:22 2011 (r217678) @@ -575,6 +575,7 @@ int nfsvno_advlock(vnode_t, int, u_int64 int nfsrv_v4rootexport(void *, struct ucred *, NFSPROC_T *); int nfsvno_testexp(struct nfsrv_descript *, struct nfsexstuff *); uint32_t nfsrv_hashfh(fhandle_t *); +void nfsrv_backupstable(void); /* nfs_commonkrpc.c */ int newnfs_nmcancelreqs(struct nfsmount *); Modified: stable/8/sys/fs/nfsserver/nfs_nfsdkrpc.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdkrpc.c Fri Jan 21 00:53:37 2011 (r217677) +++ stable/8/sys/fs/nfsserver/nfs_nfsdkrpc.c Fri Jan 21 01:12:22 2011 (r217678) @@ -97,6 +97,7 @@ static int nfs_proc(struct nfsrv_descrip extern u_long sb_max_adj; extern int newnfs_numnfsd; +extern struct proc *nfsd_master_proc; /* * NFS server system calls @@ -465,6 +466,7 @@ nfsrvd_init(int terminating) NFSD_LOCK_ASSERT(); if (terminating) { + nfsd_master_proc = NULL; NFSD_UNLOCK(); svcpool_destroy(nfsrvd_pool); nfsrvd_pool = NULL; Modified: stable/8/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdport.c Fri Jan 21 00:53:37 2011 (r217677) +++ stable/8/sys/fs/nfsserver/nfs_nfsdport.c Fri Jan 21 01:12:22 2011 (r217678) @@ -58,6 +58,10 @@ struct mtx nfs_cache_mutex; struct mtx nfs_v4root_mutex; struct nfsrvfh nfs_rootfh, nfs_pubfh; int nfs_pubfhset = 0, nfs_rootfhset = 0; +struct proc *nfsd_master_proc = NULL; +static pid_t nfsd_master_pid = (pid_t)-1; +static char nfsd_master_comm[MAXCOMLEN + 1]; +static struct timeval nfsd_master_start; static uint32_t nfsv4_sysid = 0; static int nfssvc_srvcall(struct thread *, struct nfssvc_args *, @@ -2905,6 +2909,7 @@ nfssvc_srvcall(struct thread *p, struct struct nameidata nd; vnode_t vp; int error = EINVAL; + struct proc *procp; if (uap->flag & NFSSVC_PUBLICFH) { NFSBZERO((caddr_t)&nfs_pubfh.nfsrvfh_data, @@ -2975,6 +2980,14 @@ nfssvc_srvcall(struct thread *p, struct CAST_USER_ADDR_T(dumplocklist.ndllck_list), len); free((caddr_t)dumplocks, M_TEMP); } + } else if (uap->flag & NFSSVC_BACKUPSTABLE) { + procp = p->td_proc; + PROC_LOCK(procp); + nfsd_master_pid = procp->p_pid; + bcopy(procp->p_comm, nfsd_master_comm, MAXCOMLEN + 1); + nfsd_master_start = procp->p_stats->p_start; + nfsd_master_proc = procp; + PROC_UNLOCK(procp); } return (error); } @@ -3030,6 +3043,32 @@ nfsrv_hashfh(fhandle_t *fhp) return (hashval); } +/* + * Signal the userland master nfsd to backup the stable restart file. + */ +void +nfsrv_backupstable(void) +{ + struct proc *procp; + + if (nfsd_master_proc != NULL) { + procp = pfind(nfsd_master_pid); + /* Try to make sure it is the correct process. */ + if (procp == nfsd_master_proc && + procp->p_stats->p_start.tv_sec == + nfsd_master_start.tv_sec && + procp->p_stats->p_start.tv_usec == + nfsd_master_start.tv_usec && + strcmp(procp->p_comm, nfsd_master_comm) == 0) + psignal(procp, SIGUSR2); + else + nfsd_master_proc = NULL; + + if (procp != NULL) + PROC_UNLOCK(procp); + } +} + extern int (*nfsd_call_nfsd)(struct thread *, struct nfssvc_args *); /* Modified: stable/8/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdstate.c Fri Jan 21 00:53:37 2011 (r217677) +++ stable/8/sys/fs/nfsserver/nfs_nfsdstate.c Fri Jan 21 01:12:22 2011 (r217678) @@ -577,6 +577,7 @@ nfsrv_adminrevoke(struct nfsd_clid *revo * Now, write out the revocation record */ nfsrv_writestable(clp->lc_id, clp->lc_idlen, NFSNST_REVOKE, p); + nfsrv_backupstable(); /* * and clear out the state, marking the clientid revoked. @@ -2988,8 +2989,10 @@ nfsrv_openupdate(vnode_t vp, struct nfss * If the client just confirmed its first open, write a timestamp * to the stable storage file. */ - if (gotstate) + if (gotstate != 0) { nfsrv_writestable(client, len, NFSNST_NEWSTATE, p); + nfsrv_backupstable(); + } return (error); } @@ -4132,6 +4135,7 @@ nfsrv_updatestable(NFSPROC_T *p) LIST_REMOVE(sp, nst_list); free((caddr_t)sp, M_TEMP); } + nfsrv_backupstable(); } /* @@ -4266,6 +4270,7 @@ nfsrv_clientconflict(struct nfsclient *c * Ok, we can expire the conflicting client. */ nfsrv_writestable(clp->lc_id, clp->lc_idlen, NFSNST_REVOKE, p); + nfsrv_backupstable(); nfsrv_cleanclient(clp, p); nfsrv_freedeleglist(&clp->lc_deleg); nfsrv_freedeleglist(&clp->lc_olddeleg); @@ -4441,6 +4446,7 @@ nfsrv_delegconflict(struct nfsstate *stp * sleep without the state changing. */ nfsrv_writestable(clp->lc_id, clp->lc_idlen, NFSNST_REVOKE, p); + nfsrv_backupstable(); if (clp->lc_expiry < NFSD_MONOSEC) { nfsrv_cleanclient(clp, p); nfsrv_freedeleglist(&clp->lc_deleg); Modified: stable/8/sys/nfs/nfs_nfssvc.c ============================================================================== --- stable/8/sys/nfs/nfs_nfssvc.c Fri Jan 21 00:53:37 2011 (r217677) +++ stable/8/sys/nfs/nfs_nfssvc.c Fri Jan 21 01:12:22 2011 (r217678) @@ -99,7 +99,7 @@ nfssvc(struct thread *td, struct nfssvc_ else if ((uap->flag & (NFSSVC_NFSDNFSD | NFSSVC_NFSDADDSOCK | NFSSVC_PUBLICFH | NFSSVC_V4ROOTEXPORT | NFSSVC_NOPUBLICFH | NFSSVC_STABLERESTART | NFSSVC_ADMINREVOKE | - NFSSVC_DUMPCLIENTS | NFSSVC_DUMPLOCKS)) && + NFSSVC_DUMPCLIENTS | NFSSVC_DUMPLOCKS | NFSSVC_BACKUPSTABLE)) && nfsd_call_nfsd != NULL) error = (*nfsd_call_nfsd)(td, uap); if (error == EINTR || error == ERESTART) Modified: stable/8/sys/nfs/nfssvc.h ============================================================================== --- stable/8/sys/nfs/nfssvc.h Fri Jan 21 00:53:37 2011 (r217677) +++ stable/8/sys/nfs/nfssvc.h Fri Jan 21 01:12:22 2011 (r217678) @@ -63,5 +63,6 @@ #define NFSSVC_NFSCBD 0x00100000 #define NFSSVC_CBADDSOCK 0x00200000 #define NFSSVC_GETSTATS 0x00400000 +#define NFSSVC_BACKUPSTABLE 0x00800000 #endif /* _NFS_NFSSVC_H */ From owner-svn-src-all@FreeBSD.ORG Fri Jan 21 01:24:00 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 94B4E1065672; Fri, 21 Jan 2011 01:24:00 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 835C58FC14; Fri, 21 Jan 2011 01:24:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0L1O0ur034648; Fri, 21 Jan 2011 01:24:00 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0L1O0ZP034646; Fri, 21 Jan 2011 01:24:00 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201101210124.p0L1O0ZP034646@svn.freebsd.org> From: Rick Macklem Date: Fri, 21 Jan 2011 01:24:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217679 - stable/8/sys/fs/nfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jan 2011 01:24:00 -0000 Author: rmacklem Date: Fri Jan 21 01:24:00 2011 New Revision: 217679 URL: http://svn.freebsd.org/changeset/base/217679 Log: MFC: r217535 Fix the experimental NFSv4 server so that it uses VOP_ACCESSX() to check for VREAD_ACL instead of VOP_ACCESS(). Modified: stable/8/sys/fs/nfs/nfs_commonsubs.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- stable/8/sys/fs/nfs/nfs_commonsubs.c Fri Jan 21 01:12:22 2011 (r217678) +++ stable/8/sys/fs/nfs/nfs_commonsubs.c Fri Jan 21 01:24:00 2011 (r217679) @@ -2002,7 +2002,7 @@ nfsv4_fillattr(struct nfsrv_descript *nd #ifdef NFS4_ACL_EXTATTR_NAME } else if (naclp != NULL) { if (vn_lock(vp, LK_SHARED) == 0) { - error = VOP_ACCESS(vp, VREAD_ACL, cred, p); + error = VOP_ACCESSX(vp, VREAD_ACL, cred, p); if (error == 0) error = VOP_GETACL(vp, ACL_TYPE_NFS4, naclp, cred, p); From owner-svn-src-all@FreeBSD.ORG Fri Jan 21 02:53:32 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AF78F106566C; Fri, 21 Jan 2011 02:53:32 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9D0D38FC18; Fri, 21 Jan 2011 02:53:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0L2rWZk036646; Fri, 21 Jan 2011 02:53:32 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0L2rWIO036637; Fri, 21 Jan 2011 02:53:32 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201101210253.p0L2rWIO036637@svn.freebsd.org> From: Adrian Chadd Date: Fri, 21 Jan 2011 02:53: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: r217680 - in head/tools/tools/ath: . athdebug athdecode athprom athrd athregs athstats X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jan 2011 02:53:32 -0000 Author: adrian Date: Fri Jan 21 02:53:32 2011 New Revision: 217680 URL: http://svn.freebsd.org/changeset/base/217680 Log: Make the existing ath tools build again. * add missing includes to quieten warnings * fix an inline function decl to have a return type * since .h files are created during the build (opt_ah.h, ah_osdep.h) which modify the behaviour of the HAL include/source files, include OBJDIR in the path so the #include's work. The tools should now build when the directory is added to LOCAL_DIRS during a make buildworld. Modified: head/tools/tools/ath/Makefile.inc head/tools/tools/ath/athdebug/athdebug.c head/tools/tools/ath/athdecode/main.c head/tools/tools/ath/athprom/athprom.c head/tools/tools/ath/athrd/athrd.c head/tools/tools/ath/athregs/dumpregs.c head/tools/tools/ath/athstats/athstats.c head/tools/tools/ath/athstats/main.c Modified: head/tools/tools/ath/Makefile.inc ============================================================================== --- head/tools/tools/ath/Makefile.inc Fri Jan 21 01:24:00 2011 (r217679) +++ head/tools/tools/ath/Makefile.inc Fri Jan 21 02:53:32 2011 (r217680) @@ -11,3 +11,4 @@ CFLAGS+=-I${.CURDIR}/../common CFLAGS+=-I${.CURDIR}/../../../../sys CFLAGS+=-I${.CURDIR}/../../../../sys/dev/ath CFLAGS+=-I${.CURDIR}/../../../../sys/dev/ath/ath_hal +CFLAGS+=-I${.OBJDIR}/ Modified: head/tools/tools/ath/athdebug/athdebug.c ============================================================================== --- head/tools/tools/ath/athdebug/athdebug.c Fri Jan 21 01:24:00 2011 (r217679) +++ head/tools/tools/ath/athdebug/athdebug.c Fri Jan 21 02:53:32 2011 (r217680) @@ -37,11 +37,15 @@ #include #include #include +#include #include #include #include #include +#include +#include +#include #define N(a) (sizeof(a)/sizeof(a[0])) Modified: head/tools/tools/ath/athdecode/main.c ============================================================================== --- head/tools/tools/ath/athdecode/main.c Fri Jan 21 01:24:00 2011 (r217679) +++ head/tools/tools/ath/athdecode/main.c Fri Jan 21 02:53:32 2011 (r217680) @@ -37,6 +37,8 @@ #include "dumpregs.h" #include +#include +#include #include #include #include Modified: head/tools/tools/ath/athprom/athprom.c ============================================================================== --- head/tools/tools/ath/athprom/athprom.c Fri Jan 21 01:24:00 2011 (r217679) +++ head/tools/tools/ath/athprom/athprom.c Fri Jan 21 02:53:32 2011 (r217680) @@ -43,6 +43,7 @@ #include #include #include +#include #ifndef DIR_TEMPLATE #define DIR_TEMPLATE "/usr/local/libdata/athprom" Modified: head/tools/tools/ath/athrd/athrd.c ============================================================================== --- head/tools/tools/ath/athrd/athrd.c Fri Jan 21 01:24:00 2011 (r217679) +++ head/tools/tools/ath/athrd/athrd.c Fri Jan 21 02:53:32 2011 (r217680) @@ -43,6 +43,7 @@ #include #include #include +#include int ath_hal_debug = 0; HAL_CTRY_CODE cc = CTRY_DEFAULT; Modified: head/tools/tools/ath/athregs/dumpregs.c ============================================================================== --- head/tools/tools/ath/athregs/dumpregs.c Fri Jan 21 01:24:00 2011 (r217679) +++ head/tools/tools/ath/athregs/dumpregs.c Fri Jan 21 02:53:32 2011 (r217680) @@ -41,6 +41,7 @@ #include #include #include +#include typedef struct { HAL_REVS revs; @@ -353,7 +354,7 @@ register_range(u_int brange, u_int erang def_srev_min, def_srev_max, def_phy_min, def_phy_max); } -static __inline +static __inline int match(const struct dumpreg *dr, const HAL_REVS *revs) { if (!MAC_MATCH(dr, revs->ah_macVersion, revs->ah_macRev)) Modified: head/tools/tools/ath/athstats/athstats.c ============================================================================== --- head/tools/tools/ath/athstats/athstats.c Fri Jan 21 01:24:00 2011 (r217679) +++ head/tools/tools/ath/athstats/athstats.c Fri Jan 21 02:53:32 2011 (r217680) @@ -47,10 +47,18 @@ #include #include +/* Use the system net80211 headers, rather than the kernel tree */ +/* + * XXX this means that if you build a separate net80211 stack + * XXX with your kernel and don't install the new/changed headers, + * XXX this tool may break. + * XXX -adrian + */ +#include +#include + #include "ah.h" #include "ah_desc.h" -#include "ieee80211_ioctl.h" -#include "ieee80211_radiotap.h" #include "if_athioctl.h" #include "athstats.h" Modified: head/tools/tools/ath/athstats/main.c ============================================================================== --- head/tools/tools/ath/athstats/main.c Fri Jan 21 01:24:00 2011 (r217679) +++ head/tools/tools/ath/athstats/main.c Fri Jan 21 02:53:32 2011 (r217680) @@ -45,6 +45,7 @@ #include #include #include +#include #include #include "athstats.h" From owner-svn-src-all@FreeBSD.ORG Fri Jan 21 02:57:00 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 27D241065672; Fri, 21 Jan 2011 02:57:00 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 172648FC0A; Fri, 21 Jan 2011 02:57:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0L2uxNG036765; Fri, 21 Jan 2011 02:56:59 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0L2ux60036763; Fri, 21 Jan 2011 02:56:59 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201101210256.p0L2ux60036763@svn.freebsd.org> From: Adrian Chadd Date: Fri, 21 Jan 2011 02:56:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217681 - head/tools/tools/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jan 2011 02:57:00 -0000 Author: adrian Date: Fri Jan 21 02:56:59 2011 New Revision: 217681 URL: http://svn.freebsd.org/changeset/base/217681 Log: Remove an un-needed trailing / after OBJDIR. Nitpicked by: juli Modified: head/tools/tools/ath/Makefile.inc Modified: head/tools/tools/ath/Makefile.inc ============================================================================== --- head/tools/tools/ath/Makefile.inc Fri Jan 21 02:53:32 2011 (r217680) +++ head/tools/tools/ath/Makefile.inc Fri Jan 21 02:56:59 2011 (r217681) @@ -11,4 +11,4 @@ CFLAGS+=-I${.CURDIR}/../common CFLAGS+=-I${.CURDIR}/../../../../sys CFLAGS+=-I${.CURDIR}/../../../../sys/dev/ath CFLAGS+=-I${.CURDIR}/../../../../sys/dev/ath/ath_hal -CFLAGS+=-I${.OBJDIR}/ +CFLAGS+=-I${.OBJDIR} From owner-svn-src-all@FreeBSD.ORG Fri Jan 21 03:14:09 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 142A6106566C; Fri, 21 Jan 2011 03:14:09 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 012978FC12; Fri, 21 Jan 2011 03:14:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0L3E8AN037447; Fri, 21 Jan 2011 03:14:08 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0L3E8jn037443; Fri, 21 Jan 2011 03:14:08 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201101210314.p0L3E8jn037443@svn.freebsd.org> From: Adrian Chadd Date: Fri, 21 Jan 2011 03:14:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217682 - in head/tools/tools/ath: . ath_ee_v14_print X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jan 2011 03:14:09 -0000 Author: adrian Date: Fri Jan 21 03:14:08 2011 New Revision: 217682 URL: http://svn.freebsd.org/changeset/base/217682 Log: Add in a new tool which prints a formatted v14 eeprom from an eeprom hexdump. This is a part replacement of the old athprom code, which tries to both fetch and print the contents of an eeprom dump. A tool to generate hexdumps from a running system will follow shortly. Added: head/tools/tools/ath/ath_ee_v14_print/ head/tools/tools/ath/ath_ee_v14_print/Makefile (contents, props changed) head/tools/tools/ath/ath_ee_v14_print/ath_ee_v14_print.c (contents, props changed) Modified: head/tools/tools/ath/Makefile Modified: head/tools/tools/ath/Makefile ============================================================================== --- head/tools/tools/ath/Makefile Fri Jan 21 02:56:59 2011 (r217681) +++ head/tools/tools/ath/Makefile Fri Jan 21 03:14:08 2011 (r217682) @@ -1,5 +1,5 @@ # $FreeBSD$ -SUBDIR= athdebug athdecode athkey athpoke athprom athrd athregs athstats +SUBDIR= athdebug athdecode athkey athpoke athprom athrd athregs athstats ath_ee_v14_print .include Added: head/tools/tools/ath/ath_ee_v14_print/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/ath/ath_ee_v14_print/Makefile Fri Jan 21 03:14:08 2011 (r217682) @@ -0,0 +1,11 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../../../sys/dev/ath/ath_hal + +PROG= ath_ee_v14_print +NOMAN= yes +NO_MAN= yes + +.include <../Makefile.inc> + +.include Added: head/tools/tools/ath/ath_ee_v14_print/ath_ee_v14_print.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/ath/ath_ee_v14_print/ath_ee_v14_print.c Fri Jan 21 03:14:08 2011 (r217682) @@ -0,0 +1,442 @@ + +/* + * Copyright (c) 2010-2011 Adrian Chadd, Xenion Pty Ltd. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include +#include +#include +#include +#include + +typedef enum { + AH_FALSE = 0, /* NB: lots of code assumes false is zero */ + AH_TRUE = 1, +} HAL_BOOL; + +typedef enum { + HAL_OK = 0, /* No error */ +} HAL_STATUS; + +struct ath_hal; + +#include "ah_eeprom_v14.h" + +void +load_eeprom_dump(const char *file, uint16_t *buf) +{ + unsigned int r[8]; + FILE *fp; + char b[1024]; + int i; + + fp = fopen(file, "r"); + if (!fp) + err(1, "fopen"); + + while (!feof(fp)) { + if (fgets(b, 1024, fp) == NULL) + break; + if (feof(fp)) + break; + if (strlen(b) > 0) + b[strlen(b)-1] = '\0'; + if (strlen(b) == 0) + break; + sscanf(b, "%x: %x %x %x %x %x %x %x %x\n", + &i, &r[0], &r[1], &r[2], &r[3], &r[4], + &r[5], &r[6], &r[7]); + buf[i++] = r[0]; + buf[i++] = r[1]; + buf[i++] = r[2]; + buf[i++] = r[3]; + buf[i++] = r[4]; + buf[i++] = r[5]; + buf[i++] = r[6]; + buf[i++] = r[7]; + } + fclose(fp); +} + +static void +eeprom_v14_base_print(uint16_t *buf) +{ + HAL_EEPROM_v14 *eep = (HAL_EEPROM_v14 *) buf; + BASE_EEP_HEADER *eh = &eep->ee_base.baseEepHeader; + + printf("| Version: 0x%.4x | Length: 0x%.4x | Checksum: 0x%.4x ", + eh->version, eh->length, eh->checksum); + printf("| CapFlags: 0x%.2x | eepMisc: 0x%.2x | RegDomain: 0x%.2x 0x%.2x | \n", + eh->opCapFlags, eh->eepMisc, eh->regDmn[0], eh->regDmn[1]); + printf("| MAC: %.2x:%.2x:%.2x:%.2x:%.2x:%.2x ", + eh->macAddr[0], eh->macAddr[1], eh->macAddr[2], + eh->macAddr[3], eh->macAddr[4], eh->macAddr[5]); + printf("| RxMask: 0x%.2x | TxMask: 0x%.2x | RfSilent: 0x%.4x | btOptions: 0x%.4x |\n", + eh->rxMask, eh->txMask, eh->rfSilent, eh->blueToothOptions); + printf("| DeviceCap: 0x%.4x | binBuildNumber: %.8x | deviceType: 0x%.2x |\n", + eh->deviceCap, eh->binBuildNumber, eh->deviceType); + + printf("| pwdclkind: 0x%.2x | fastClk5g: 0x%.2x | divChain: 0x%.2x | rxGainType: 0x%.2x |\n", + (int) eh->pwdclkind, (int) eh->fastClk5g, (int) eh->divChain, + (int) eh->rxGainType); + + printf("| dacHiPwrMode: 0x%.2x | openLoopPwrCntl: 0x%.2x | dacLpMode: 0x%.2x ", + (int) eh->dacHiPwrMode, (int) eh->openLoopPwrCntl, (int) eh->dacLpMode); + printf("| txGainType: 0x%.2x | rcChainMask: 0x%.2x |\n", + (int) eh->txGainType, (int) eh->rcChainMask); + + /* because it's convienent */ + printf("| antennaGainMax[0]: 0x%.2x antennaGainMax[1]: 0x%.2x |\n", + eep->ee_antennaGainMax[0], eep->ee_antennaGainMax[1]); +} + +static void +eeprom_v14_custdata_print(uint16_t *buf) +{ + HAL_EEPROM_v14 *eep = (HAL_EEPROM_v14 *) buf; + uint8_t *custdata = (uint8_t *) &eep->ee_base.custData; + int i; + + printf("\n| Custdata: |\n"); + for (i = 0; i < 64; i++) { + printf("%s0x%.2x %s", + i % 16 == 0 ? "| " : "", + custdata[i], + i % 16 == 15 ? "|\n" : ""); + } +} + +static void +eeprom_v14_modal_print(uint16_t *buf, int m) +{ + HAL_EEPROM_v14 *eep = (HAL_EEPROM_v14 *) buf; + MODAL_EEP_HEADER *mh = &eep->ee_base.modalHeader[m]; + int i; + + printf("| antCtrlCommon: 0x%.4x |\n", mh->antCtrlCommon); + printf("| switchSettling: 0x%.2x |\n", mh->switchSettling); + printf("| adcDesiredSize: %d |\n| pgaDesiredSize: %.2f dBm |\n", + mh->adcDesiredSize, (float) mh->pgaDesiredSize / 2.0); + + printf("| antCtrlChain: 0:0x%.4x 1:0x%.4x 2:0x%.4x |\n", + mh->antCtrlChain[0], mh->antCtrlChain[1], mh->antCtrlChain[2]); + printf("| antennaGainCh: 0:0x%.2x 1:0x%.2x 2:0x%.2x |\n", + mh->antennaGainCh[0], mh->antennaGainCh[1], mh->antennaGainCh[2]); + printf("| txRxAttenCh: 0:0x%.2x 1:0x%.2x 2:0x%.2x |\n", + mh->txRxAttenCh[0], mh->txRxAttenCh[1], mh->txRxAttenCh[2]); + printf("| rxTxMarginCh: 0:0x%.2x 1:0x%.2x 2:0x%.2x |\n", + mh->rxTxMarginCh[0], mh->rxTxMarginCh[1], mh->rxTxMarginCh[2]); + printf("| noiseFloorThresCh: 0:0x%.2x 1:0x%.2x 2:0x%.2x |\n", + mh->noiseFloorThreshCh[0], mh->noiseFloorThreshCh[1], mh->noiseFloorThreshCh[2]); + printf("| xlnaGainCh: 0:0x%.2x 1:0x%.2x 2:0x%.2x |\n", + mh->xlnaGainCh[0], mh->xlnaGainCh[1], mh->xlnaGainCh[2]); + printf("| iqCalICh: 0:0x%.2x 1:0x%.2x 2:0x%.2x |\n| iqCalQCh: 0:0x%.2x 1:0x%.2x 2:0x%.2x |\n", + mh->iqCalICh[0], mh->iqCalICh[1], mh->iqCalICh[2], + mh->iqCalQCh[0], mh->iqCalQCh[1], mh->iqCalQCh[2]); + printf("| bswAtten: 0:0x%.2x 1:0x%.2x 2:0x%.2x |\n", + mh->bswAtten[0], mh->bswAtten[1], mh->bswAtten[2]); + printf("| bswMargin: 0:0x%.2x 1:0x%.2x 2:0x%.2x |\n", + mh->bswMargin[0], mh->bswMargin[1], mh->bswMargin[2]); + printf("| xatten2Db: 0:0x%.2x 1:0x%.2x 2:0x%.2x |\n", + mh->xatten2Db[0], mh->xatten2Db[1], mh->xatten2Db[2]); + printf("| xatten2Margin: 0:0x%.2x 1:0x%.2x 2:0x%.2x |\n", + mh->xatten2Margin[0], mh->xatten2Margin[1], mh->xatten2Margin[2]); + + printf("| txEndToXpaOff: 0x%.2x | txEndToRxOn: 0x%.2x | txFrameToXpaOn: 0x%.2x |\n", + mh->txEndToXpaOff, mh->txEndToRxOn, mh->txFrameToXpaOn); + + printf("| thres62: 0x%.2x\n", mh->thresh62); + + printf("| xpdGain: 0x%.2x | xpd: 0x%.2x |\n", mh->xpdGain, mh->xpd); + printf("| xpaBiasLvlFreq: 0:0x%.4x 1:0x%.4x 2:0x%.4x |\n", + mh->xpaBiasLvlFreq[0], mh->xpaBiasLvlFreq[1], mh->xpaBiasLvlFreq[2]); + + printf("| pdGainOverlap: 0x%.2x | ob: 0x%.2x | db: 0x%.2x | xpaBiasLvl: 0x%.2x |\n", + mh->pdGainOverlap, mh->ob, mh->db, mh->xpaBiasLvl); + + printf("| pwrDecreaseFor2Chain: 0x%.2x | pwrDecreaseFor3Chain: 0x%.2x | txFrameToDataStart: 0x%.2x | txFrameToPaOn: 0x%.2x |\n", + mh->pwrDecreaseFor2Chain, mh->pwrDecreaseFor3Chain, mh->txFrameToDataStart, + mh->txFrameToPaOn); + + printf("| ht40PowerIncForPdadc: 0x%.2x |\n", mh->ht40PowerIncForPdadc); + + printf("| swSettleHt40: 0x%.2x |\n", mh->swSettleHt40); + + printf("| ob_ch1: 0x%.2x | db_ch1: 0x%.2x |\n", mh->ob_ch1, mh->db_ch1); + + printf("| flagBits: 0x%.2x | miscBits: 0x%.2x |\n", mh->flagBits, mh->miscBits); + + + printf("| futureModal: 0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x |\n", + mh->futureModal[0], + mh->futureModal[1], + mh->futureModal[2], + mh->futureModal[3], + mh->futureModal[4], + mh->futureModal[5]); + + /* and now, spur channels */ + for (i = 0; i < AR5416_EEPROM_MODAL_SPURS; i++) { + printf("| Spur %d: spurChan: 0x%.4x spurRangeLow: 0x%.2x spurRangeHigh: 0x%.2x |\n", + i, mh->spurChans[i].spurChan, + (int) mh->spurChans[i].spurRangeLow, + (int) mh->spurChans[i].spurRangeHigh); + } +} + +static void +eeprom_v14_print_caldata_perfreq(CAL_DATA_PER_FREQ *f) +{ + int i, j; + + for (i = 0; i < AR5416_NUM_PD_GAINS; i++) { + printf(" Gain %d: pwr dBm/vpd: ", i); + for (j = 0; j < AR5416_PD_GAIN_ICEPTS; j++) { + /* These are stored in 0.25dBm increments */ + printf("%d:(%.2f/%d) ", j, (float) f->pwrPdg[i][j] / 4.00, + f->vpdPdg[i][j]); + } + printf("\n"); + } +} + +static void +eeprom_v14_calfreqpiers_print(uint16_t *buf) +{ + HAL_EEPROM_v14 *eep = (HAL_EEPROM_v14 *) buf; + int i, n; + + /* 2ghz cal piers */ + printf("calFreqPier2G: "); + for (i = 0; i < AR5416_NUM_2G_CAL_PIERS; i++) { + printf(" 0x%.2x ", eep->ee_base.calFreqPier2G[i]); + } + printf("|\n"); + + for (i = 0; i < AR5416_NUM_2G_CAL_PIERS; i++) { + if (eep->ee_base.calFreqPier2G[i] == 0xff) + continue; + printf("2Ghz Cal Pier %d\n", i); + for (n = 0; n < AR5416_MAX_CHAINS; n++) { + printf(" Chain %d:\n", n); + eeprom_v14_print_caldata_perfreq(&eep->ee_base.calPierData2G[n][i]); + } + } + + printf("\n"); + + /* 5ghz cal piers */ + printf("calFreqPier5G: "); + for (i = 0; i < AR5416_NUM_5G_CAL_PIERS; i++) { + printf(" 0x%.2x ", eep->ee_base.calFreqPier5G[i]); + } + printf("|\n"); + for (i = 0; i < AR5416_NUM_5G_CAL_PIERS; i++) { + if (eep->ee_base.calFreqPier5G[i] == 0xff) + continue; + printf("5Ghz Cal Pier %d\n", i); + for (n = 0; n < AR5416_MAX_CHAINS; n++) { + printf(" Chain %d:\n", n); + eeprom_v14_print_caldata_perfreq(&eep->ee_base.calPierData5G[n][i]); + } + } +} + +static void +eeprom_v14_target_legacy_print(CAL_TARGET_POWER_LEG *l) +{ + int i; + if (l->bChannel == 0xff) + return; + printf(" bChannel: %d;", l->bChannel); + for (i = 0; i < 4; i++) { + printf(" %.2f", (float) l->tPow2x[i] / 2.0); + } + printf(" (dBm)\n"); +} + +static void +eeprom_v14_target_ht_print(CAL_TARGET_POWER_HT *l) +{ + int i; + if (l->bChannel == 0xff) + return; + printf(" bChannel: %d;", l->bChannel); + for (i = 0; i < 8; i++) { + printf(" %.2f", (float) l->tPow2x[i] / 2.0); + } + printf(" (dBm)\n"); +} + +static void +eeprom_v14_print_targets(uint16_t *buf) +{ + HAL_EEPROM_v14 *eep = (HAL_EEPROM_v14 *) buf; + int i; + + /* 2ghz rates */ + printf("2Ghz CCK:\n"); + for (i = 0; i < AR5416_NUM_2G_CCK_TARGET_POWERS; i++) { + eeprom_v14_target_legacy_print(&eep->ee_base.calTargetPowerCck[i]); + } + printf("2Ghz 11g:\n"); + for (i = 0; i < AR5416_NUM_2G_20_TARGET_POWERS; i++) { + eeprom_v14_target_legacy_print(&eep->ee_base.calTargetPower2G[i]); + } + printf("2Ghz HT20:\n"); + for (i = 0; i < AR5416_NUM_2G_20_TARGET_POWERS; i++) { + eeprom_v14_target_ht_print(&eep->ee_base.calTargetPower2GHT20[i]); + } + printf("2Ghz HT40:\n"); + for (i = 0; i < AR5416_NUM_2G_40_TARGET_POWERS; i++) { + eeprom_v14_target_ht_print(&eep->ee_base.calTargetPower2GHT40[i]); + } + + /* 5ghz rates */ + printf("5Ghz 11a:\n"); + for (i = 0; i < AR5416_NUM_5G_20_TARGET_POWERS; i++) { + eeprom_v14_target_legacy_print(&eep->ee_base.calTargetPower5G[i]); + } + printf("5Ghz HT20:\n"); + for (i = 0; i < AR5416_NUM_5G_20_TARGET_POWERS; i++) { + eeprom_v14_target_ht_print(&eep->ee_base.calTargetPower5GHT20[i]); + } + printf("5Ghz HT40:\n"); + for (i = 0; i < AR5416_NUM_5G_40_TARGET_POWERS; i++) { + eeprom_v14_target_ht_print(&eep->ee_base.calTargetPower5GHT40[i]); + } + +} + +static void +eeprom_v14_ctl_edge_print(CAL_CTL_DATA *ctl) +{ + int i, j; + uint8_t pow, flag; + + for (i = 0; i < AR5416_MAX_CHAINS; i++) { + printf(" chain %d: ", i); + for (j = 0; j < AR5416_NUM_BAND_EDGES; j++) { + pow = ctl->ctlEdges[i][j].tPowerFlag & 0x3f; + flag = (ctl->ctlEdges[i][j].tPowerFlag & 0xc0) >> 6; + printf(" %d:pow=%d,flag=%.2x", j, pow, flag); + } + printf("\n"); + } +} + +static void +eeprom_v14_ctl_print(uint16_t *buf) +{ + HAL_EEPROM_v14 *eep = (HAL_EEPROM_v14 *) buf; + int i; + + for (i = 0; i < AR5416_NUM_CTLS; i++) { + if (eep->ee_base.ctlIndex[i] == 0) + continue; + printf("| ctlIndex: offset %d, value %d\n", i, eep->ee_base.ctlIndex[i]); + eeprom_v14_ctl_edge_print(&eep->ee_base.ctlData[i]); + } +} + +static void +eeprom_v14_print_edges(uint16_t *buf) +{ + HAL_EEPROM_v14 *eep = (HAL_EEPROM_v14 *) buf; + int i; + + printf("| eeNumCtls: %d\n", eep->ee_numCtls); + for (i = 0; i < NUM_EDGES*eep->ee_numCtls; i++) { + /* XXX is flag 8 or 32 bits? */ + printf("| edge %2d/%2d: rdEdge: %5d EdgePower: %.2f dBm Flag: 0x%.8x\n", + i / NUM_EDGES, i % NUM_EDGES, + eep->ee_rdEdgesPower[i].rdEdge, + (float) eep->ee_rdEdgesPower[i].twice_rdEdgePower / 2.0, + eep->ee_rdEdgesPower[i].flag); + + if (i % NUM_EDGES == (NUM_EDGES -1)) + printf("|\n"); + } +#if 0 +typedef struct { + uint16_t rdEdge; + uint16_t twice_rdEdgePower; + HAL_BOOL flag; + } RD_EDGES_POWER; + +#endif +} + +void +usage(char *argv[]) +{ + printf("Usage: %s \n", argv[0]); + printf("\n"); + printf(" The eeprom dump file is a text hexdump of an EEPROM.\n"); + printf(" The lines must be formatted as follows:\n"); + printf(" 0xAAAA: 0xDD 0xDD 0xDD 0xDD 0xDD 0xDD 0xDD 0xDD\n"); + printf(" where each line must have exactly eight data bytes.\n"); + exit(127); +} + +int +main(int argc, char *argv[]) +{ + uint16_t *eep = NULL; + eep = calloc(4096, sizeof(int16_t)); + + if (argc < 2) + usage(argv); + + load_eeprom_dump(argv[1], eep); + + eeprom_v14_base_print(eep); + eeprom_v14_custdata_print(eep); + + /* 2.4ghz */ + printf("\n2.4ghz:\n"); + eeprom_v14_modal_print(eep, 1); + /* 5ghz */ + printf("\n5ghz:\n"); + eeprom_v14_modal_print(eep, 0); + printf("\n"); + + eeprom_v14_calfreqpiers_print(eep); + printf("\n"); + + eeprom_v14_print_targets(eep); + printf("\n"); + + eeprom_v14_ctl_print(eep); + printf("\n"); + + eeprom_v14_print_edges(eep); + printf("\n"); + + free(eep); + exit(0); +} From owner-svn-src-all@FreeBSD.ORG Fri Jan 21 05:19:47 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7AC5F106566B; Fri, 21 Jan 2011 05:19:47 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 69B448FC0C; Fri, 21 Jan 2011 05:19:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0L5JlZw040095; Fri, 21 Jan 2011 05:19:47 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0L5JlhO040093; Fri, 21 Jan 2011 05:19:47 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201101210519.p0L5JlhO040093@svn.freebsd.org> From: Lawrence Stewart Date: Fri, 21 Jan 2011 05:19: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: r217683 - head/sys/netinet/cc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jan 2011 05:19:47 -0000 Author: lstewart Date: Fri Jan 21 05:19:47 2011 New Revision: 217683 URL: http://svn.freebsd.org/changeset/base/217683 Log: Some correctness and robustness fixes related to CUBIC's mean RTT estimate: - The mean RTT is updated at the end of each congestion epoch, but if we switch to congestion avoidance within the first epoch (e.g. if ssthresh was primed from the hostcache), we'll trigger a divide by zero panic in cubic_ack_received(). Set the mean to the min in cubic_record_rtt() if the mean is less than the min to ensure we have a sane mean for use in this situation. This fixes the panic reported by Nick Hibma. - Adjust conditions under which we update the mean RTT in cubic_post_recovery() to ensure a low latency path won't yield an RTT of less than 1. This avoids another potential divide by zero panic when running CUBIC in networks with sub-millisecond latencies. - Remove the "safety" assignment of min into mean when we don't update the mean because of failed conditions. The above change to the conditions for updating the mean ensures the safety issue is addressed and I feel it is better to keep our previous mean estimate around if we can't update than to revert to the min. - Initialise the mean RTT to 1 on connection startup to act as a safety belt if a situation we haven't considered and addressed with the above changes were to crop up in the wild. Sponsored by: FreeBSD Foundation Reported and tested by: Nick Hibma Discussed with: David Hayes MFC after: 5 weeks X-MFC with: r216114 Modified: head/sys/netinet/cc/cc_cubic.c Modified: head/sys/netinet/cc/cc_cubic.c ============================================================================== --- head/sys/netinet/cc/cc_cubic.c Fri Jan 21 03:14:08 2011 (r217682) +++ head/sys/netinet/cc/cc_cubic.c Fri Jan 21 05:19:47 2011 (r217683) @@ -212,7 +212,7 @@ cubic_cb_init(struct cc_var *ccv) /* Init some key variables with sensible defaults. */ cubic_data->t_last_cong = ticks; cubic_data->min_rtt_ticks = TCPTV_SRTTBASE; - cubic_data->mean_rtt_ticks = TCPTV_SRTTBASE; + cubic_data->mean_rtt_ticks = 1; ccv->cc_data = cubic_data; @@ -328,12 +328,11 @@ cubic_post_recovery(struct cc_var *ccv) cubic_data->t_last_cong = ticks; /* Calculate the average RTT between congestion epochs. */ - if (cubic_data->epoch_ack_count > 0 && cubic_data->sum_rtt_ticks > 0) + if (cubic_data->epoch_ack_count > 0 && + cubic_data->sum_rtt_ticks >= cubic_data->epoch_ack_count) { cubic_data->mean_rtt_ticks = (int)(cubic_data->sum_rtt_ticks / cubic_data->epoch_ack_count); - else - /* For safety. */ - cubic_data->mean_rtt_ticks = cubic_data->min_rtt_ticks; + } cubic_data->epoch_ack_count = 0; cubic_data->sum_rtt_ticks = 0; @@ -362,9 +361,21 @@ cubic_record_rtt(struct cc_var *ccv) * XXXLAS: Should there be some hysteresis for minrtt? */ if ((t_srtt_ticks < cubic_data->min_rtt_ticks || - cubic_data->min_rtt_ticks == TCPTV_SRTTBASE)) + cubic_data->min_rtt_ticks == TCPTV_SRTTBASE)) { cubic_data->min_rtt_ticks = max(1, t_srtt_ticks); + /* + * If the connection is within its first congestion + * epoch, ensure we prime mean_rtt_ticks with a + * reasonable value until the epoch average RTT is + * calculated in cubic_post_recovery(). + */ + if (cubic_data->min_rtt_ticks > + cubic_data->mean_rtt_ticks) + cubic_data->mean_rtt_ticks = + cubic_data->min_rtt_ticks; + } + /* Sum samples for epoch average RTT calculation. */ cubic_data->sum_rtt_ticks += t_srtt_ticks; cubic_data->epoch_ack_count++; From owner-svn-src-all@FreeBSD.ORG Fri Jan 21 05:21:00 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DBDD71065670; Fri, 21 Jan 2011 05:21:00 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C8BA88FC17; Fri, 21 Jan 2011 05:21:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0L5L0Rp040174; Fri, 21 Jan 2011 05:21:00 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0L5L0YI040156; Fri, 21 Jan 2011 05:21:00 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201101210521.p0L5L0YI040156@svn.freebsd.org> From: Adrian Chadd Date: Fri, 21 Jan 2011 05:21: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: r217684 - in head/sys/dev/ath: . ath_hal ath_hal/ar5210 ath_hal/ar5211 ath_hal/ar5212 ath_hal/ar5416 ath_hal/ar9002 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jan 2011 05:21:01 -0000 Author: adrian Date: Fri Jan 21 05:21:00 2011 New Revision: 217684 URL: http://svn.freebsd.org/changeset/base/217684 Log: ANI changes #1 - split out the ANI polling from the RxMonitor hook. The rxmonitor hook is called on each received packet. This can get very, very busy as the tx/rx/chanbusy registers are thus read each time a packet is received. Instead, shuffle out the true per-packet processing which is needed and move the rest of the ANI processing into a periodic event which runs every 100ms by default. Modified: head/sys/dev/ath/ath_hal/ah.h head/sys/dev/ath/ath_hal/ar5210/ar5210.h head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c head/sys/dev/ath/ath_hal/ar5210/ar5210_misc.c head/sys/dev/ath/ath_hal/ar5211/ar5211.h head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c head/sys/dev/ath/ath_hal/ar5211/ar5211_misc.c head/sys/dev/ath/ath_hal/ar5212/ar5212.h head/sys/dev/ath/ath_hal/ar5212/ar5212_ani.c head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c head/sys/dev/ath/ath_hal/ar5416/ar5416.h head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_athioctl.h head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/ath_hal/ah.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah.h Fri Jan 21 05:19:47 2011 (r217683) +++ head/sys/dev/ath/ath_hal/ah.h Fri Jan 21 05:21:00 2011 (r217684) @@ -709,6 +709,8 @@ struct ath_hal { void __ahdecl(*ah_rxMonitor)(struct ath_hal *, const HAL_NODE_STATS *, const struct ieee80211_channel *); + void __ahdecl(*ah_aniPoll)(struct ath_hal *, + const struct ieee80211_channel *); void __ahdecl(*ah_procMibEvent)(struct ath_hal *, const HAL_NODE_STATS *); Modified: head/sys/dev/ath/ath_hal/ar5210/ar5210.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5210/ar5210.h Fri Jan 21 05:19:47 2011 (r217683) +++ head/sys/dev/ath/ath_hal/ar5210/ar5210.h Fri Jan 21 05:21:00 2011 (r217684) @@ -277,7 +277,8 @@ extern HAL_INT ar5210SetInterrupts(struc extern const HAL_RATE_TABLE *ar5210GetRateTable(struct ath_hal *, u_int mode); extern HAL_BOOL ar5210AniControl(struct ath_hal *, HAL_ANI_CMD, int ); -extern void ar5210AniPoll(struct ath_hal *, const HAL_NODE_STATS *, +extern void ar5210AniPoll(struct ath_hal *, const struct ieee80211_channel *); +extern void ar5210RxMonitor(struct ath_hal *, const HAL_NODE_STATS *, const struct ieee80211_channel *); extern void ar5210MibEvent(struct ath_hal *, const HAL_NODE_STATS *); #endif /* _ATH_AR5210_H_ */ Modified: head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c Fri Jan 21 05:19:47 2011 (r217683) +++ head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c Fri Jan 21 05:21:00 2011 (r217684) @@ -89,7 +89,8 @@ static const struct ath_hal_private ar52 .ah_setRxFilter = ar5210SetRxFilter, .ah_setupRxDesc = ar5210SetupRxDesc, .ah_procRxDesc = ar5210ProcRxDesc, - .ah_rxMonitor = ar5210AniPoll, + .ah_rxMonitor = ar5210RxMonitor, + .ah_aniPoll = ar5210AniPoll, .ah_procMibEvent = ar5210MibEvent, /* Misc Functions */ Modified: head/sys/dev/ath/ath_hal/ar5210/ar5210_misc.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5210/ar5210_misc.c Fri Jan 21 05:19:47 2011 (r217683) +++ head/sys/dev/ath/ath_hal/ar5210/ar5210_misc.c Fri Jan 21 05:21:00 2011 (r217684) @@ -561,12 +561,17 @@ ar5210AniControl(struct ath_hal *ah, HAL } void -ar5210AniPoll(struct ath_hal *ah, const HAL_NODE_STATS *stats, +ar5210RxMonitor(struct ath_hal *ah, const HAL_NODE_STATS *stats, const struct ieee80211_channel *chan) { } void +ar5210AniPoll(struct ath_hal *ah, const struct ieee80211_channel *chan) +{ +} + +void ar5210MibEvent(struct ath_hal *ah, const HAL_NODE_STATS *stats) { } Modified: head/sys/dev/ath/ath_hal/ar5211/ar5211.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5211/ar5211.h Fri Jan 21 05:19:47 2011 (r217683) +++ head/sys/dev/ath/ath_hal/ar5211/ar5211.h Fri Jan 21 05:21:00 2011 (r217684) @@ -305,7 +305,8 @@ extern HAL_INT ar5211SetInterrupts(struc extern const HAL_RATE_TABLE *ar5211GetRateTable(struct ath_hal *, u_int mode); extern HAL_BOOL ar5211AniControl(struct ath_hal *, HAL_ANI_CMD, int ); -extern void ar5211AniPoll(struct ath_hal *, const HAL_NODE_STATS *, +extern void ar5211RxMonitor(struct ath_hal *, const HAL_NODE_STATS *, const struct ieee80211_channel *); +extern void ar5211AniPoll(struct ath_hal *, const struct ieee80211_channel *); extern void ar5211MibEvent(struct ath_hal *, const HAL_NODE_STATS *); #endif /* _ATH_AR5211_H_ */ Modified: head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c Fri Jan 21 05:19:47 2011 (r217683) +++ head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c Fri Jan 21 05:21:00 2011 (r217684) @@ -89,7 +89,8 @@ static const struct ath_hal_private ar52 .ah_setRxFilter = ar5211SetRxFilter, .ah_setupRxDesc = ar5211SetupRxDesc, .ah_procRxDesc = ar5211ProcRxDesc, - .ah_rxMonitor = ar5211AniPoll, + .ah_rxMonitor = ar5211RxMonitor, + .ah_aniPoll = ar5211AniPoll, .ah_procMibEvent = ar5211MibEvent, /* Misc Functions */ Modified: head/sys/dev/ath/ath_hal/ar5211/ar5211_misc.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5211/ar5211_misc.c Fri Jan 21 05:19:47 2011 (r217683) +++ head/sys/dev/ath/ath_hal/ar5211/ar5211_misc.c Fri Jan 21 05:21:00 2011 (r217684) @@ -564,7 +564,12 @@ ar5211AniControl(struct ath_hal *ah, HAL } void -ar5211AniPoll(struct ath_hal *ah, const HAL_NODE_STATS *stats, +ar5211AniPoll(struct ath_hal *ah, const struct ieee80211_channel *chan) +{ +} + +void +ar5211RxMonitor(struct ath_hal *ah, const HAL_NODE_STATS *stats, const struct ieee80211_channel *chan) { } Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212.h Fri Jan 21 05:19:47 2011 (r217683) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212.h Fri Jan 21 05:21:00 2011 (r217684) @@ -606,8 +606,9 @@ struct ath_rx_status; extern void ar5212AniPhyErrReport(struct ath_hal *ah, const struct ath_rx_status *rs); extern void ar5212ProcessMibIntr(struct ath_hal *, const HAL_NODE_STATS *); -extern void ar5212AniPoll(struct ath_hal *, const HAL_NODE_STATS *, +extern void ar5212RxMonitor(struct ath_hal *, const HAL_NODE_STATS *, const struct ieee80211_channel *); +extern void ar5212AniPoll(struct ath_hal *, const struct ieee80211_channel *); extern void ar5212AniReset(struct ath_hal *, const struct ieee80211_channel *, HAL_OPMODE, int); Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_ani.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_ani.c Fri Jan 21 05:19:47 2011 (r217683) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_ani.c Fri Jan 21 05:21:00 2011 (r217684) @@ -912,21 +912,26 @@ updateMIBStats(struct ath_hal *ah, struc aniState->cckPhyErrCount = cckPhyErrCnt; } +void +ar5212RxMonitor(struct ath_hal *ah, const HAL_NODE_STATS *stats, + const struct ieee80211_channel *chan) +{ + struct ath_hal_5212 *ahp = AH5212(ah); + ahp->ah_stats.ast_nodestats.ns_avgbrssi = stats->ns_avgbrssi; +} + /* * Do periodic processing. This routine is called from the * driver's rx interrupt handler after processing frames. */ void -ar5212AniPoll(struct ath_hal *ah, const HAL_NODE_STATS *stats, - const struct ieee80211_channel *chan) +ar5212AniPoll(struct ath_hal *ah, const struct ieee80211_channel *chan) { struct ath_hal_5212 *ahp = AH5212(ah); struct ar5212AniState *aniState = ahp->ah_curani; const struct ar5212AniParams *params; int32_t listenTime; - ahp->ah_stats.ast_nodestats.ns_avgbrssi = stats->ns_avgbrssi; - /* XXX can aniState be null? */ if (aniState == AH_NULL) return; Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c Fri Jan 21 05:19:47 2011 (r217683) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c Fri Jan 21 05:21:00 2011 (r217684) @@ -85,7 +85,8 @@ static const struct ath_hal_private ar52 .ah_setRxFilter = ar5212SetRxFilter, .ah_setupRxDesc = ar5212SetupRxDesc, .ah_procRxDesc = ar5212ProcRxDesc, - .ah_rxMonitor = ar5212AniPoll, + .ah_rxMonitor = ar5212RxMonitor, + .ah_aniPoll = ar5212AniPoll, .ah_procMibEvent = ar5212ProcessMibIntr, /* Misc Functions */ Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416.h Fri Jan 21 05:19:47 2011 (r217683) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416.h Fri Jan 21 05:21:00 2011 (r217684) @@ -113,8 +113,9 @@ extern HAL_BOOL ar5416AniControl(struct extern HAL_BOOL ar5416AniSetParams(struct ath_hal *, const struct ar5212AniParams *, const struct ar5212AniParams *); extern void ar5416ProcessMibIntr(struct ath_hal *, const HAL_NODE_STATS *); -extern void ar5416AniPoll(struct ath_hal *, const HAL_NODE_STATS *, +extern void ar5416RxMonitor(struct ath_hal *, const HAL_NODE_STATS *, const struct ieee80211_channel *); +extern void ar5416AniPoll(struct ath_hal *, const struct ieee80211_channel *); extern void ar5416AniReset(struct ath_hal *, const struct ieee80211_channel *, HAL_OPMODE, int); Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c Fri Jan 21 05:19:47 2011 (r217683) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c Fri Jan 21 05:21:00 2011 (r217684) @@ -181,6 +181,7 @@ ar5416AniControl(struct ath_hal *ah, HAL case HAL_ANI_NOISE_IMMUNITY_LEVEL: { u_int level = param; + HALDEBUG(ah, HAL_DEBUG_ANI, "%s: HAL_ANI_NOISE_IMMUNITY_LEVEL: set level = %d\n", __func__, level); if (level >= params->maxNoiseImmunityLevel) { HALDEBUG(ah, HAL_DEBUG_ANY, "%s: immunity level out of range (%u > %u)\n", @@ -213,6 +214,7 @@ ar5416AniControl(struct ath_hal *ah, HAL static const TABLE m2CountThrLow = { 63, 48 }; u_int on = param ? 1 : 0; + HALDEBUG(ah, HAL_DEBUG_ANI, "%s: HAL_ANI_OFDM_WEAK_SIGNAL_DETECTION: %s\n", __func__, on ? "enabled" : "disabled"); OS_REG_RMW_FIELD(ah, AR_PHY_SFCORR_LOW, AR_PHY_SFCORR_LOW_M1_THRESH_LOW, m1ThreshLow[on]); OS_REG_RMW_FIELD(ah, AR_PHY_SFCORR_LOW, @@ -253,6 +255,7 @@ ar5416AniControl(struct ath_hal *ah, HAL static const TABLE weakSigThrCck = { 8, 6 }; u_int high = param ? 1 : 0; + HALDEBUG(ah, HAL_DEBUG_ANI, "%s: HAL_ANI_CCK_WEAK_SIGNAL_THR: %s\n", __func__, high ? "high" : "low"); OS_REG_RMW_FIELD(ah, AR_PHY_CCK_DETECT, AR_PHY_CCK_DETECT_WEAK_SIG_THR_CCK, weakSigThrCck[high]); if (high) @@ -265,6 +268,7 @@ ar5416AniControl(struct ath_hal *ah, HAL case HAL_ANI_FIRSTEP_LEVEL: { u_int level = param; + HALDEBUG(ah, HAL_DEBUG_ANI, "%s: HAL_ANI_FIRSTEP_LEVEL: level = %d\n", __func__, level); if (level >= params->maxFirstepLevel) { HALDEBUG(ah, HAL_DEBUG_ANY, "%s: firstep level out of range (%u > %u)\n", @@ -283,6 +287,7 @@ ar5416AniControl(struct ath_hal *ah, HAL case HAL_ANI_SPUR_IMMUNITY_LEVEL: { u_int level = param; + HALDEBUG(ah, HAL_DEBUG_ANI, "%s: HAL_ANI_SPUR_IMMUNITY_LEVEL: level = %d\n", __func__, level); if (level >= params->maxSpurImmunityLevel) { HALDEBUG(ah, HAL_DEBUG_ANY, "%s: spur immunity level out of range (%u > %u)\n", @@ -793,21 +798,26 @@ updateMIBStats(struct ath_hal *ah, struc aniState->cckPhyErrCount = cckPhyErrCnt; } +void +ar5416RxMonitor(struct ath_hal *ah, const HAL_NODE_STATS *stats, + const struct ieee80211_channel *chan) +{ + struct ath_hal_5212 *ahp = AH5212(ah); + ahp->ah_stats.ast_nodestats.ns_avgbrssi = stats->ns_avgbrssi; +} + /* * Do periodic processing. This routine is called from the * driver's rx interrupt handler after processing frames. */ void -ar5416AniPoll(struct ath_hal *ah, const HAL_NODE_STATS *stats, - const struct ieee80211_channel *chan) +ar5416AniPoll(struct ath_hal *ah, const struct ieee80211_channel *chan) { struct ath_hal_5212 *ahp = AH5212(ah); struct ar5212AniState *aniState = ahp->ah_curani; const struct ar5212AniParams *params; int32_t listenTime; - ahp->ah_stats.ast_nodestats.ns_avgbrssi = stats->ns_avgbrssi; - /* XXX can aniState be null? */ if (aniState == AH_NULL) return; Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Fri Jan 21 05:19:47 2011 (r217683) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Fri Jan 21 05:21:00 2011 (r217684) @@ -105,7 +105,8 @@ ar5416InitState(struct ath_hal_5416 *ahp ah->ah_stopPcuReceive = ar5416StopPcuReceive; ah->ah_setupRxDesc = ar5416SetupRxDesc; ah->ah_procRxDesc = ar5416ProcRxDesc; - ah->ah_rxMonitor = ar5416AniPoll, + ah->ah_rxMonitor = ar5416RxMonitor, + ah->ah_aniPoll = ar5416AniPoll, ah->ah_procMibEvent = ar5416ProcessMibIntr, /* Misc Functions */ Modified: head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Fri Jan 21 05:19:47 2011 (r217683) +++ head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Fri Jan 21 05:21:00 2011 (r217684) @@ -721,6 +721,10 @@ ar9280SetAntennaSwitch(struct ath_hal *a ahp->ah_rx_chainmask = AR9280_DEFAULT_RXCHAINMASK; break; } + + HALDEBUG(ah, HAL_DEBUG_ANY, "%s: settings=%d, tx/rx chainmask=%d/%d\n", + __func__, settings, ahp->ah_tx_chainmask, ahp->ah_rx_chainmask); + return AH_TRUE; #undef ANTENNA0_CHAINMASK #undef ANTENNA1_CHAINMASK Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Fri Jan 21 05:19:47 2011 (r217683) +++ head/sys/dev/ath/if_ath.c Fri Jan 21 05:21:00 2011 (r217684) @@ -274,6 +274,9 @@ SYSCTL_INT(_hw_ath, OID_AUTO, shortcal, static int ath_resetcalinterval = 20*60; /* reset cal state 20 mins */ SYSCTL_INT(_hw_ath, OID_AUTO, resetcal, CTLFLAG_RW, &ath_resetcalinterval, 0, "reset chip calibration results (secs)"); +static int ath_anicalinterval = 100; /* ANI calibration - 100 msec */ +SYSCTL_INT(_hw_ath, OID_AUTO, anical, CTLFLAG_RW, &ath_anicalinterval, + 0, "ANI calibration (msecs)"); static int ath_rxbuf = ATH_RXBUF; /* # rx buffers to allocate */ SYSCTL_INT(_hw_ath, OID_AUTO, rxbuf, CTLFLAG_RW, &ath_rxbuf, @@ -1550,6 +1553,9 @@ ath_init(void *arg) sc->sc_lastlongcal = 0; sc->sc_resetcal = 1; sc->sc_lastcalreset = 0; + sc->sc_lastani = 0; + sc->sc_lastshortcal = 0; + sc->sc_doresetcal = AH_FALSE; /* * Setup the hardware after reset: the key cache @@ -5415,11 +5421,23 @@ ath_calibrate(void *arg) struct ifnet *ifp = sc->sc_ifp; struct ieee80211com *ic = ifp->if_l2com; HAL_BOOL longCal, isCalDone; + HAL_BOOL aniCal, shortCal = AH_FALSE; int nextcal; if (ic->ic_flags & IEEE80211_F_SCAN) /* defer, off channel */ goto restart; longCal = (ticks - sc->sc_lastlongcal >= ath_longcalinterval*hz); + aniCal = (ticks - sc->sc_lastani >= ath_anicalinterval*hz/1000); + if (sc->sc_doresetcal) + shortCal = (ticks - sc->sc_lastshortcal >= ath_shortcalinterval*hz/1000); + + DPRINTF(sc, ATH_DEBUG_CALIBRATE, "%s: shortCal=%d; longCal=%d; aniCal=%d\n", __func__, shortCal, longCal, aniCal); + if (aniCal) { + sc->sc_stats.ast_ani_cal++; + sc->sc_lastani = ticks; + ath_hal_ani_poll(ah, sc->sc_curchan); + } + if (longCal) { sc->sc_stats.ast_per_cal++; sc->sc_lastlongcal = ticks; @@ -5440,21 +5458,29 @@ ath_calibrate(void *arg) if (sc->sc_resetcal) { (void) ath_hal_calreset(ah, sc->sc_curchan); sc->sc_lastcalreset = ticks; + sc->sc_lastshortcal = ticks; sc->sc_resetcal = 0; + sc->sc_doresetcal = AH_TRUE; } } - if (ath_hal_calibrateN(ah, sc->sc_curchan, longCal, &isCalDone)) { - if (longCal) { - /* - * Calibrate noise floor data again in case of change. - */ - ath_hal_process_noisefloor(ah); + + /* Only call if we're doing a short/long cal, not for ANI calibration */ + if (shortCal || longCal) { + if (ath_hal_calibrateN(ah, sc->sc_curchan, longCal, &isCalDone)) { + if (longCal) { + /* + * Calibrate noise floor data again in case of change. + */ + ath_hal_process_noisefloor(ah); + } + } else { + DPRINTF(sc, ATH_DEBUG_ANY, + "%s: calibration of channel %u failed\n", + __func__, sc->sc_curchan->ic_freq); + sc->sc_stats.ast_per_calfail++; } - } else { - DPRINTF(sc, ATH_DEBUG_ANY, - "%s: calibration of channel %u failed\n", - __func__, sc->sc_curchan->ic_freq); - sc->sc_stats.ast_per_calfail++; + if (shortCal) + sc->sc_lastshortcal = ticks; } if (!isCalDone) { restart: @@ -5466,16 +5492,23 @@ restart: * work when operating as an AP to improve operation right * after startup. */ - nextcal = (1000*ath_shortcalinterval)/hz; + sc->sc_lastshortcal = ticks; + nextcal = ath_shortcalinterval*hz/1000; if (sc->sc_opmode != HAL_M_HOSTAP) nextcal *= 10; + sc->sc_doresetcal = AH_TRUE; } else { + /* nextcal should be the shortest time for next event */ nextcal = ath_longcalinterval*hz; if (sc->sc_lastcalreset == 0) sc->sc_lastcalreset = sc->sc_lastlongcal; else if (ticks - sc->sc_lastcalreset >= ath_resetcalinterval*hz) sc->sc_resetcal = 1; /* setup reset next trip */ + sc->sc_doresetcal = AH_FALSE; } + /* ANI calibration may occur more often than short/long/resetcal */ + if (ath_anicalinterval > 0) + nextcal = MIN(nextcal, ath_anicalinterval*hz/1000); if (nextcal != 0) { DPRINTF(sc, ATH_DEBUG_CALIBRATE, "%s: next +%u (%sisCalDone)\n", @@ -7516,4 +7549,6 @@ ath_sysctl_stats_attach(struct ath_softc &sc->sc_stats.ast_tx_nofrag, 0, "tx dropped 'cuz no ath frag buffer"); SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_be_missed", CTLFLAG_RD, &sc->sc_stats.ast_be_missed, 0, "number of -missed- beacons"); + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_ani_cal", CTLFLAG_RD, + &sc->sc_stats.ast_ani_cal, 0, "number of ANI polls"); } Modified: head/sys/dev/ath/if_athioctl.h ============================================================================== --- head/sys/dev/ath/if_athioctl.h Fri Jan 21 05:19:47 2011 (r217683) +++ head/sys/dev/ath/if_athioctl.h Fri Jan 21 05:21:00 2011 (r217684) @@ -119,7 +119,8 @@ struct ath_stats { u_int32_t ast_tx_raw_fail;/* raw tx failed 'cuz h/w down */ u_int32_t ast_tx_nofrag; /* tx dropped 'cuz no ath frag buffer */ u_int32_t ast_be_missed; /* missed beacons */ - u_int32_t ast_pad[13]; + u_int32_t ast_ani_cal; /* ANI calibrations performed */ + u_int32_t ast_pad[12]; }; #define SIOCGATHSTATS _IOWR('i', 137, struct ifreq) Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Fri Jan 21 05:19:47 2011 (r217683) +++ head/sys/dev/ath/if_athvar.h Fri Jan 21 05:21:00 2011 (r217684) @@ -333,6 +333,9 @@ struct ath_softc { struct callout sc_cal_ch; /* callout handle for cals */ int sc_lastlongcal; /* last long cal completed */ int sc_lastcalreset;/* last cal reset done */ + int sc_lastani; /* last ANI poll */ + int sc_lastshortcal; /* last short calibration */ + HAL_BOOL sc_doresetcal; /* Yes, we're doing a reset cal atm */ HAL_NODE_STATS sc_halstats; /* station-mode rssi stats */ u_int sc_tdmadbaprep; /* TDMA DBA prep time */ u_int sc_tdmaswbaprep;/* TDMA SWBA prep time */ @@ -503,6 +506,8 @@ void ath_intr(void *); ((*(_ah)->ah_setDefAntenna)((_ah), (_ant))) #define ath_hal_rxmonitor(_ah, _arg, _chan) \ ((*(_ah)->ah_rxMonitor)((_ah), (_arg), (_chan))) +#define ath_hal_ani_poll(_ah, _chan) \ + ((*(_ah)->ah_aniPoll)((_ah), (_chan))) #define ath_hal_mibevent(_ah, _stats) \ ((*(_ah)->ah_procMibEvent)((_ah), (_stats))) #define ath_hal_setslottime(_ah, _us) \ From owner-svn-src-all@FreeBSD.ORG Fri Jan 21 06:42:25 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 950F9106566B; Fri, 21 Jan 2011 06:42:25 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8428E8FC15; Fri, 21 Jan 2011 06:42:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0L6gPWQ041986; Fri, 21 Jan 2011 06:42:25 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0L6gPej041983; Fri, 21 Jan 2011 06:42:25 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201101210642.p0L6gPej041983@svn.freebsd.org> From: Adrian Chadd Date: Fri, 21 Jan 2011 06:42:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217685 - head/sys/dev/ath/ath_hal X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jan 2011 06:42:25 -0000 Author: adrian Date: Fri Jan 21 06:42:25 2011 New Revision: 217685 URL: http://svn.freebsd.org/changeset/base/217685 Log: Modify the v14/v4k eeprom diag interface to return the whole eeprom. The v1 and v3 interfaces returned the whole EEPROM but the v14/v4k interfaces just returned the base header. There's extra information outside of that which would also be nice to get access to. Modified: head/sys/dev/ath/ath_hal/ah_eeprom_v14.c head/sys/dev/ath/ath_hal/ah_eeprom_v4k.c Modified: head/sys/dev/ath/ath_hal/ah_eeprom_v14.c ============================================================================== --- head/sys/dev/ath/ath_hal/ah_eeprom_v14.c Fri Jan 21 05:21:00 2011 (r217684) +++ head/sys/dev/ath/ath_hal/ah_eeprom_v14.c Fri Jan 21 06:42:25 2011 (r217685) @@ -159,8 +159,8 @@ v14EepromDiag(struct ath_hal *ah, int re switch (request) { case HAL_DIAG_EEPROM: - *result = &ee->ee_base; - *resultsize = sizeof(ee->ee_base); + *result = ee; + *resultsize = sizeof(HAL_EEPROM_v14); return AH_TRUE; } return AH_FALSE; Modified: head/sys/dev/ath/ath_hal/ah_eeprom_v4k.c ============================================================================== --- head/sys/dev/ath/ath_hal/ah_eeprom_v4k.c Fri Jan 21 05:21:00 2011 (r217684) +++ head/sys/dev/ath/ath_hal/ah_eeprom_v4k.c Fri Jan 21 06:42:25 2011 (r217685) @@ -137,8 +137,8 @@ v4kEepromDiag(struct ath_hal *ah, int re switch (request) { case HAL_DIAG_EEPROM: - *result = &ee->ee_base; - *resultsize = sizeof(ee->ee_base); + *result = ee; + *resultsize = sizeof(HAL_EEPROM_v4k); return AH_TRUE; } return AH_FALSE; From owner-svn-src-all@FreeBSD.ORG Fri Jan 21 07:26:54 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 232ED106566B; Fri, 21 Jan 2011 07:26:54 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1272D8FC1C; Fri, 21 Jan 2011 07:26:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0L7QrUe043002; Fri, 21 Jan 2011 07:26:53 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0L7QrfF043000; Fri, 21 Jan 2011 07:26:53 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201101210726.p0L7QrfF043000@svn.freebsd.org> From: Adrian Chadd Date: Fri, 21 Jan 2011 07:26:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217686 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jan 2011 07:26:54 -0000 Author: adrian Date: Fri Jan 21 07:26:53 2011 New Revision: 217686 URL: http://svn.freebsd.org/changeset/base/217686 Log: Add missing getCapability call for AR5416. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Fri Jan 21 06:42:25 2011 (r217685) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Fri Jan 21 07:26:53 2011 (r217686) @@ -110,6 +110,7 @@ ar5416InitState(struct ath_hal_5416 *ahp ah->ah_procMibEvent = ar5416ProcessMibIntr, /* Misc Functions */ + ah->ah_getCapability = ar5416GetCapability; ah->ah_getDiagState = ar5416GetDiagState; ah->ah_setLedState = ar5416SetLedState; ah->ah_gpioCfgOutput = ar5416GpioCfgOutput; From owner-svn-src-all@FreeBSD.ORG Fri Jan 21 07:28:48 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CF821106566C; Fri, 21 Jan 2011 07:28:48 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BE8308FC13; Fri, 21 Jan 2011 07:28:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0L7SmWn043072; Fri, 21 Jan 2011 07:28:48 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0L7SmTE043070; Fri, 21 Jan 2011 07:28:48 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201101210728.p0L7SmTE043070@svn.freebsd.org> From: Adrian Chadd Date: Fri, 21 Jan 2011 07:28:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217687 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jan 2011 07:28:48 -0000 Author: adrian Date: Fri Jan 21 07:28:48 2011 New Revision: 217687 URL: http://svn.freebsd.org/changeset/base/217687 Log: Fix some typos. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Fri Jan 21 07:26:53 2011 (r217686) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Fri Jan 21 07:28:48 2011 (r217687) @@ -105,9 +105,9 @@ ar5416InitState(struct ath_hal_5416 *ahp ah->ah_stopPcuReceive = ar5416StopPcuReceive; ah->ah_setupRxDesc = ar5416SetupRxDesc; ah->ah_procRxDesc = ar5416ProcRxDesc; - ah->ah_rxMonitor = ar5416RxMonitor, - ah->ah_aniPoll = ar5416AniPoll, - ah->ah_procMibEvent = ar5416ProcessMibIntr, + ah->ah_rxMonitor = ar5416RxMonitor; + ah->ah_aniPoll = ar5416AniPoll; + ah->ah_procMibEvent = ar5416ProcessMibIntr; /* Misc Functions */ ah->ah_getCapability = ar5416GetCapability; From owner-svn-src-all@FreeBSD.ORG Fri Jan 21 10:26:26 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BFC5C1065670; Fri, 21 Jan 2011 10:26:26 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AA5968FC1A; Fri, 21 Jan 2011 10:26:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0LAQQh7047252; Fri, 21 Jan 2011 10:26:26 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0LAQQRo047220; Fri, 21 Jan 2011 10:26:26 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201101211026.p0LAQQRo047220@svn.freebsd.org> From: Sergey Kandaurov Date: Fri, 21 Jan 2011 10:26:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217688 - in head/sys: amd64/amd64 arm/at91 arm/econa arm/mv arm/s3c2xx0 arm/xscale/i80321 arm/xscale/i8134x arm/xscale/ixp425 arm/xscale/pxa boot/common boot/forth i386/i386 i386/xen i... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jan 2011 10:26:26 -0000 Author: pluknet Date: Fri Jan 21 10:26:26 2011 New Revision: 217688 URL: http://svn.freebsd.org/changeset/base/217688 Log: Make MSGBUF_SIZE kernel option a loader tunable kern.msgbufsize. Submitted by: perryh pluto.rain.com (previous version) Reviewed by: jhb Approved by: kib (mentor) Tested by: universe Modified: head/sys/amd64/amd64/machdep.c head/sys/arm/at91/at91_machdep.c head/sys/arm/econa/econa_machdep.c head/sys/arm/mv/mv_machdep.c head/sys/arm/s3c2xx0/s3c24x0_machdep.c head/sys/arm/xscale/i80321/ep80219_machdep.c head/sys/arm/xscale/i80321/iq31244_machdep.c head/sys/arm/xscale/i8134x/crb_machdep.c head/sys/arm/xscale/ixp425/avila_machdep.c head/sys/arm/xscale/pxa/pxa_machdep.c head/sys/boot/common/loader.8 head/sys/boot/forth/loader.conf head/sys/i386/i386/machdep.c head/sys/i386/i386/pmap.c head/sys/i386/xen/pmap.c head/sys/ia64/ia64/machdep.c head/sys/kern/subr_param.c head/sys/mips/mips/machdep.c head/sys/mips/mips/pmap.c head/sys/pc98/pc98/machdep.c head/sys/powerpc/aim/machdep.c head/sys/powerpc/aim/mmu_oea.c head/sys/powerpc/aim/mmu_oea64.c head/sys/powerpc/booke/machdep.c head/sys/powerpc/booke/pmap.c head/sys/sparc64/sparc64/machdep.c head/sys/sparc64/sparc64/pmap.c head/sys/sun4v/sun4v/machdep.c head/sys/sun4v/sun4v/pmap.c head/sys/sys/msgbuf.h head/sys/vm/vm_page.c Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Fri Jan 21 07:28:48 2011 (r217687) +++ head/sys/amd64/amd64/machdep.c Fri Jan 21 10:26:26 2011 (r217688) @@ -51,7 +51,6 @@ __FBSDID("$FreeBSD$"); #include "opt_isa.h" #include "opt_kstack_pages.h" #include "opt_maxmem.h" -#include "opt_msgbuf.h" #include "opt_perfmon.h" #include "opt_sched.h" #include "opt_kdtrace.h" @@ -1504,7 +1503,7 @@ do_next: * calculation, etc.). */ while (phys_avail[pa_indx - 1] + PAGE_SIZE + - round_page(MSGBUF_SIZE) >= phys_avail[pa_indx]) { + round_page(msgbufsize) >= phys_avail[pa_indx]) { physmem -= atop(phys_avail[pa_indx] - phys_avail[pa_indx - 1]); phys_avail[pa_indx--] = 0; phys_avail[pa_indx--] = 0; @@ -1513,7 +1512,7 @@ do_next: Maxmem = atop(phys_avail[pa_indx]); /* Trim off space for the message buffer. */ - phys_avail[pa_indx] -= round_page(MSGBUF_SIZE); + phys_avail[pa_indx] -= round_page(msgbufsize); /* Map the message buffer. */ msgbufp = (struct msgbuf *)PHYS_TO_DMAP(phys_avail[pa_indx]); @@ -1714,7 +1713,7 @@ hammer_time(u_int64_t modulep, u_int64_t /* now running on new page tables, configured,and u/iom is accessible */ - msgbufinit(msgbufp, MSGBUF_SIZE); + msgbufinit(msgbufp, msgbufsize); fpuinit(); /* transfer to user mode */ Modified: head/sys/arm/at91/at91_machdep.c ============================================================================== --- head/sys/arm/at91/at91_machdep.c Fri Jan 21 07:28:48 2011 (r217687) +++ head/sys/arm/at91/at91_machdep.c Fri Jan 21 10:26:26 2011 (r217688) @@ -43,8 +43,6 @@ * Created : 17/09/94 */ -#include "opt_msgbuf.h" - #include __FBSDID("$FreeBSD$"); @@ -302,7 +300,7 @@ initarm(void *arg, void *arg2) valloc_pages(abtstack, ABT_STACK_SIZE); valloc_pages(undstack, UND_STACK_SIZE); valloc_pages(kernelstack, KSTACK_PAGES); - valloc_pages(msgbufpv, round_page(MSGBUF_SIZE) / PAGE_SIZE); + valloc_pages(msgbufpv, round_page(msgbufsize) / PAGE_SIZE); /* * Now we start construction of the L1 page table @@ -347,7 +345,7 @@ initarm(void *arg, void *arg2) pmap_map_chunk(l1pagetable, kernel_l1pt.pv_va, kernel_l1pt.pv_pa, L1_TABLE_SIZE, VM_PROT_READ|VM_PROT_WRITE, PTE_PAGETABLE); pmap_map_chunk(l1pagetable, msgbufpv.pv_va, msgbufpv.pv_pa, - MSGBUF_SIZE, VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); + msgbufsize, VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); for (loop = 0; loop < NUM_KERNEL_PTS; ++loop) { pmap_map_chunk(l1pagetable, kernel_pt_table[loop].pv_va, @@ -430,7 +428,7 @@ initarm(void *arg, void *arg2) KERNVIRTADDR + 3 * memsize, &kernel_l1pt); msgbufp = (void*)msgbufpv.pv_va; - msgbufinit(msgbufp, MSGBUF_SIZE); + msgbufinit(msgbufp, msgbufsize); mutex_init(); i = 0; Modified: head/sys/arm/econa/econa_machdep.c ============================================================================== --- head/sys/arm/econa/econa_machdep.c Fri Jan 21 07:28:48 2011 (r217687) +++ head/sys/arm/econa/econa_machdep.c Fri Jan 21 10:26:26 2011 (r217688) @@ -35,8 +35,6 @@ * */ -#include "opt_msgbuf.h" - #include __FBSDID("$FreeBSD$"); @@ -251,7 +249,7 @@ initarm(void *arg, void *arg2) valloc_pages(abtstack, ABT_STACK_SIZE); valloc_pages(undstack, UND_STACK_SIZE); valloc_pages(kernelstack, KSTACK_PAGES); - valloc_pages(msgbufpv, round_page(MSGBUF_SIZE) / PAGE_SIZE); + valloc_pages(msgbufpv, round_page(msgbufsize) / PAGE_SIZE); /* * Now we start construction of the L1 page table @@ -293,7 +291,7 @@ initarm(void *arg, void *arg2) pmap_map_chunk(l1pagetable, kernel_l1pt.pv_va, kernel_l1pt.pv_pa, L1_TABLE_SIZE, VM_PROT_READ|VM_PROT_WRITE, PTE_PAGETABLE); pmap_map_chunk(l1pagetable, msgbufpv.pv_va, msgbufpv.pv_pa, - MSGBUF_SIZE, VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); + msgbufsize, VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); for (loop = 0; loop < NUM_KERNEL_PTS; ++loop) { pmap_map_chunk(l1pagetable, kernel_pt_table[loop].pv_va, @@ -372,7 +370,7 @@ initarm(void *arg, void *arg2) &kernel_l1pt); msgbufp = (void*)msgbufpv.pv_va; - msgbufinit(msgbufp, MSGBUF_SIZE); + msgbufinit(msgbufp, msgbufsize); mutex_init(); Modified: head/sys/arm/mv/mv_machdep.c ============================================================================== --- head/sys/arm/mv/mv_machdep.c Fri Jan 21 07:28:48 2011 (r217687) +++ head/sys/arm/mv/mv_machdep.c Fri Jan 21 10:26:26 2011 (r217688) @@ -35,7 +35,6 @@ * from: FreeBSD: //depot/projects/arm/src/sys/arm/at91/kb920x_machdep.c, rev 45 */ -#include "opt_msgbuf.h" #include "opt_ddb.h" #include "opt_platform.h" @@ -427,7 +426,7 @@ initarm(void *mdp, void *unused __unused valloc_pages(abtstack, ABT_STACK_SIZE); valloc_pages(undstack, UND_STACK_SIZE); valloc_pages(kernelstack, KSTACK_PAGES); - valloc_pages(msgbufpv, round_page(MSGBUF_SIZE) / PAGE_SIZE); + valloc_pages(msgbufpv, round_page(msgbufsize) / PAGE_SIZE); /* * Now we start construction of the L1 page table @@ -575,7 +574,7 @@ initarm(void *mdp, void *unused __unused pmap_bootstrap(freemempos, pmap_bootstrap_lastaddr, &kernel_l1pt); msgbufp = (void *)msgbufpv.pv_va; - msgbufinit(msgbufp, MSGBUF_SIZE); + msgbufinit(msgbufp, msgbufsize); mutex_init(); /* Modified: head/sys/arm/s3c2xx0/s3c24x0_machdep.c ============================================================================== --- head/sys/arm/s3c2xx0/s3c24x0_machdep.c Fri Jan 21 07:28:48 2011 (r217687) +++ head/sys/arm/s3c2xx0/s3c24x0_machdep.c Fri Jan 21 10:26:26 2011 (r217688) @@ -43,7 +43,6 @@ * Created : 17/09/94 */ -#include "opt_msgbuf.h" #include "opt_ddb.h" #include @@ -298,7 +297,7 @@ initarm(void *arg, void *arg2) valloc_pages(abtstack, ABT_STACK_SIZE); valloc_pages(undstack, UND_STACK_SIZE); valloc_pages(kernelstack, KSTACK_PAGES); - valloc_pages(msgbufpv, round_page(MSGBUF_SIZE) / PAGE_SIZE); + valloc_pages(msgbufpv, round_page(msgbufsize) / PAGE_SIZE); /* * Now we start construction of the L1 page table * We start by mapping the L2 page tables into the L1. @@ -338,7 +337,7 @@ initarm(void *arg, void *arg2) pmap_map_chunk(l1pagetable, kernel_l1pt.pv_va, kernel_l1pt.pv_pa, L1_TABLE_SIZE, VM_PROT_READ|VM_PROT_WRITE, PTE_PAGETABLE); pmap_map_chunk(l1pagetable, msgbufpv.pv_va, msgbufpv.pv_pa, - MSGBUF_SIZE, VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); + msgbufsize, VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); for (loop = 0; loop < NUM_KERNEL_PTS; ++loop) { @@ -429,7 +428,7 @@ initarm(void *arg, void *arg2) KERNVIRTADDR + 3 * memsize, &kernel_l1pt); msgbufp = (void*)msgbufpv.pv_va; - msgbufinit(msgbufp, MSGBUF_SIZE); + msgbufinit(msgbufp, msgbufsize); mutex_init(); physmem = memsize / PAGE_SIZE; Modified: head/sys/arm/xscale/i80321/ep80219_machdep.c ============================================================================== --- head/sys/arm/xscale/i80321/ep80219_machdep.c Fri Jan 21 07:28:48 2011 (r217687) +++ head/sys/arm/xscale/i80321/ep80219_machdep.c Fri Jan 21 10:26:26 2011 (r217688) @@ -45,8 +45,6 @@ * Created : 17/09/94 */ -#include "opt_msgbuf.h" - #include __FBSDID("$FreeBSD$"); @@ -247,7 +245,7 @@ initarm(void *arg, void *arg2) valloc_pages(undstack, UND_STACK_SIZE); valloc_pages(kernelstack, KSTACK_PAGES); alloc_pages(minidataclean.pv_pa, 1); - valloc_pages(msgbufpv, round_page(MSGBUF_SIZE) / PAGE_SIZE); + valloc_pages(msgbufpv, round_page(msgbufsize) / PAGE_SIZE); #ifdef ARM_USE_SMALL_ALLOC freemempos -= PAGE_SIZE; freemem_pt = trunc_page(freemem_pt); @@ -397,7 +395,7 @@ initarm(void *arg, void *arg2) pmap_bootstrap(pmap_curmaxkvaddr, 0xd0000000, &kernel_l1pt); msgbufp = (void*)msgbufpv.pv_va; - msgbufinit(msgbufp, MSGBUF_SIZE); + msgbufinit(msgbufp, msgbufsize); mutex_init(); i = 0; Modified: head/sys/arm/xscale/i80321/iq31244_machdep.c ============================================================================== --- head/sys/arm/xscale/i80321/iq31244_machdep.c Fri Jan 21 07:28:48 2011 (r217687) +++ head/sys/arm/xscale/i80321/iq31244_machdep.c Fri Jan 21 10:26:26 2011 (r217688) @@ -45,8 +45,6 @@ * Created : 17/09/94 */ -#include "opt_msgbuf.h" - #include __FBSDID("$FreeBSD$"); @@ -247,7 +245,7 @@ initarm(void *arg, void *arg2) valloc_pages(undstack, UND_STACK_SIZE); valloc_pages(kernelstack, KSTACK_PAGES); alloc_pages(minidataclean.pv_pa, 1); - valloc_pages(msgbufpv, round_page(MSGBUF_SIZE) / PAGE_SIZE); + valloc_pages(msgbufpv, round_page(msgbufsize) / PAGE_SIZE); #ifdef ARM_USE_SMALL_ALLOC freemempos -= PAGE_SIZE; freemem_pt = trunc_page(freemem_pt); @@ -403,7 +401,7 @@ initarm(void *arg, void *arg2) pmap_bootstrap(pmap_curmaxkvaddr, 0xd0000000, &kernel_l1pt); msgbufp = (void*)msgbufpv.pv_va; - msgbufinit(msgbufp, MSGBUF_SIZE); + msgbufinit(msgbufp, msgbufsize); mutex_init(); i = 0; Modified: head/sys/arm/xscale/i8134x/crb_machdep.c ============================================================================== --- head/sys/arm/xscale/i8134x/crb_machdep.c Fri Jan 21 07:28:48 2011 (r217687) +++ head/sys/arm/xscale/i8134x/crb_machdep.c Fri Jan 21 10:26:26 2011 (r217688) @@ -45,8 +45,6 @@ * Created : 17/09/94 */ -#include "opt_msgbuf.h" - #include __FBSDID("$FreeBSD$"); @@ -242,7 +240,7 @@ initarm(void *arg, void *arg2) valloc_pages(abtstack, ABT_STACK_SIZE); valloc_pages(undstack, UND_STACK_SIZE); valloc_pages(kernelstack, KSTACK_PAGES); - valloc_pages(msgbufpv, round_page(MSGBUF_SIZE) / PAGE_SIZE); + valloc_pages(msgbufpv, round_page(msgbufsize) / PAGE_SIZE); #ifdef ARM_USE_SMALL_ALLOC freemempos -= PAGE_SIZE; freemem_pt = trunc_page(freemem_pt); @@ -375,7 +373,7 @@ initarm(void *arg, void *arg2) pmap_bootstrap(pmap_curmaxkvaddr, 0xd0000000, &kernel_l1pt); msgbufp = (void*)msgbufpv.pv_va; - msgbufinit(msgbufp, MSGBUF_SIZE); + msgbufinit(msgbufp, msgbufsize); mutex_init(); i = 0; Modified: head/sys/arm/xscale/ixp425/avila_machdep.c ============================================================================== --- head/sys/arm/xscale/ixp425/avila_machdep.c Fri Jan 21 07:28:48 2011 (r217687) +++ head/sys/arm/xscale/ixp425/avila_machdep.c Fri Jan 21 10:26:26 2011 (r217688) @@ -45,8 +45,6 @@ * Created : 17/09/94 */ -#include "opt_msgbuf.h" - #include __FBSDID("$FreeBSD$"); @@ -314,7 +312,7 @@ initarm(void *arg, void *arg2) valloc_pages(undstack, UND_STACK_SIZE); valloc_pages(kernelstack, KSTACK_PAGES); alloc_pages(minidataclean.pv_pa, 1); - valloc_pages(msgbufpv, round_page(MSGBUF_SIZE) / PAGE_SIZE); + valloc_pages(msgbufpv, round_page(msgbufsize) / PAGE_SIZE); #ifdef ARM_USE_SMALL_ALLOC freemempos -= PAGE_SIZE; freemem_pt = trunc_page(freemem_pt); @@ -460,7 +458,7 @@ initarm(void *arg, void *arg2) pmap_bootstrap(pmap_curmaxkvaddr, 0xd0000000, &kernel_l1pt); msgbufp = (void*)msgbufpv.pv_va; - msgbufinit(msgbufp, MSGBUF_SIZE); + msgbufinit(msgbufp, msgbufsize); mutex_init(); i = 0; Modified: head/sys/arm/xscale/pxa/pxa_machdep.c ============================================================================== --- head/sys/arm/xscale/pxa/pxa_machdep.c Fri Jan 21 07:28:48 2011 (r217687) +++ head/sys/arm/xscale/pxa/pxa_machdep.c Fri Jan 21 10:26:26 2011 (r217688) @@ -45,7 +45,6 @@ * Created : 17/09/94 */ -#include "opt_msgbuf.h" #include "opt_ddb.h" #include @@ -229,7 +228,7 @@ initarm(void *arg, void *arg2) valloc_pages(undstack, UND_STACK_SIZE); valloc_pages(kernelstack, KSTACK_PAGES); alloc_pages(minidataclean.pv_pa, 1); - valloc_pages(msgbufpv, round_page(MSGBUF_SIZE) / PAGE_SIZE); + valloc_pages(msgbufpv, round_page(msgbufsize) / PAGE_SIZE); #ifdef ARM_USE_SMALL_ALLOC freemempos -= PAGE_SIZE; freemem_pt = trunc_page(freemem_pt); @@ -393,7 +392,7 @@ initarm(void *arg, void *arg2) dump_avail[i] = 0; pmap_bootstrap(pmap_curmaxkvaddr, 0xd0000000, &kernel_l1pt); msgbufp = (void*)msgbufpv.pv_va; - msgbufinit(msgbufp, MSGBUF_SIZE); + msgbufinit(msgbufp, msgbufsize); mutex_init(); i = 0; Modified: head/sys/boot/common/loader.8 ============================================================================== --- head/sys/boot/common/loader.8 Fri Jan 21 07:28:48 2011 (r217687) +++ head/sys/boot/common/loader.8 Fri Jan 21 10:26:26 2011 (r217688) @@ -609,6 +609,14 @@ Note that the NBUF parameter will override this limit. Modifies .Dv VM_BCACHE_SIZE_MAX . +.It Va kern.msgbufsize +Sets the size of the kernel message buffer. +The default limit of 64KB is usually sufficient unless +large amounts of trace data need to be collected +between opportunities to examine the buffer or +dump it to a file. +Overrides kernel option +.Dv MSGBUF_SIZE . .It Va machdep.disable_mtrrs Disable the use of i686 MTRRs (x86 only). .It Va net.inet.tcp.tcbhashsize Modified: head/sys/boot/forth/loader.conf ============================================================================== --- head/sys/boot/forth/loader.conf Fri Jan 21 07:28:48 2011 (r217687) +++ head/sys/boot/forth/loader.conf Fri Jan 21 10:26:26 2011 (r217688) @@ -99,6 +99,7 @@ module_path="/boot/modules" # Set the mo #kern.maxswzone="" # Set the max swmeta KVA storage #kern.maxtsiz="" # Set the max text size #kern.maxusers="32" # Set size of various static tables +#kern.msgbufsize="" # Set size of kernel message buffer #kern.nbuf="" # Set the number of buffer headers #kern.ncallout="" # Set the maximum # of timer events #kern.ngroups="1023" # Set the maximum # of supplemental groups Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Fri Jan 21 07:28:48 2011 (r217687) +++ head/sys/i386/i386/machdep.c Fri Jan 21 10:26:26 2011 (r217688) @@ -49,7 +49,6 @@ __FBSDID("$FreeBSD$"); #include "opt_isa.h" #include "opt_kstack_pages.h" #include "opt_maxmem.h" -#include "opt_msgbuf.h" #include "opt_npx.h" #include "opt_perfmon.h" #include "opt_xbox.h" @@ -2115,7 +2114,7 @@ getmemsize(int first) physmem = Maxmem; basemem = 0; physmap[0] = init_first << PAGE_SHIFT; - physmap[1] = ptoa(Maxmem) - round_page(MSGBUF_SIZE); + physmap[1] = ptoa(Maxmem) - round_page(msgbufsize); physmap_idx = 0; #else #ifdef XBOX @@ -2466,7 +2465,7 @@ do_next: * calculation, etc.). */ while (phys_avail[pa_indx - 1] + PAGE_SIZE + - round_page(MSGBUF_SIZE) >= phys_avail[pa_indx]) { + round_page(msgbufsize) >= phys_avail[pa_indx]) { physmem -= atop(phys_avail[pa_indx] - phys_avail[pa_indx - 1]); phys_avail[pa_indx--] = 0; phys_avail[pa_indx--] = 0; @@ -2475,10 +2474,10 @@ do_next: Maxmem = atop(phys_avail[pa_indx]); /* Trim off space for the message buffer. */ - phys_avail[pa_indx] -= round_page(MSGBUF_SIZE); + phys_avail[pa_indx] -= round_page(msgbufsize); /* Map the message buffer. */ - for (off = 0; off < round_page(MSGBUF_SIZE); off += PAGE_SIZE) + for (off = 0; off < round_page(msgbufsize); off += PAGE_SIZE) pmap_kenter((vm_offset_t)msgbufp + off, phys_avail[pa_indx] + off); @@ -2689,7 +2688,7 @@ init386(first) /* now running on new page tables, configured,and u/iom is accessible */ - msgbufinit(msgbufp, MSGBUF_SIZE); + msgbufinit(msgbufp, msgbufsize); /* transfer to user mode */ _ucodesel = GSEL(GUCODE_SEL, SEL_UPL); @@ -2947,7 +2946,7 @@ init386(first) /* now running on new page tables, configured,and u/iom is accessible */ - msgbufinit(msgbufp, MSGBUF_SIZE); + msgbufinit(msgbufp, msgbufsize); /* make a call gate to reenter kernel with */ gdp = &ldt[LSYS5CALLS_SEL].gd; Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Fri Jan 21 07:28:48 2011 (r217687) +++ head/sys/i386/i386/pmap.c Fri Jan 21 10:26:26 2011 (r217688) @@ -105,7 +105,6 @@ __FBSDID("$FreeBSD$"); #include "opt_cpu.h" #include "opt_pmap.h" -#include "opt_msgbuf.h" #include "opt_smp.h" #include "opt_xbox.h" @@ -437,7 +436,7 @@ pmap_bootstrap(vm_paddr_t firstaddr) /* * msgbufp is used to map the system message buffer. */ - SYSMAP(struct msgbuf *, unused, msgbufp, atop(round_page(MSGBUF_SIZE))) + SYSMAP(struct msgbuf *, unused, msgbufp, atop(round_page(msgbufsize))) /* * KPTmap is used by pmap_kextract(). Modified: head/sys/i386/xen/pmap.c ============================================================================== --- head/sys/i386/xen/pmap.c Fri Jan 21 07:28:48 2011 (r217687) +++ head/sys/i386/xen/pmap.c Fri Jan 21 10:26:26 2011 (r217688) @@ -105,7 +105,6 @@ __FBSDID("$FreeBSD$"); #include "opt_cpu.h" #include "opt_pmap.h" -#include "opt_msgbuf.h" #include "opt_smp.h" #include "opt_xbox.h" @@ -471,7 +470,7 @@ pmap_bootstrap(vm_paddr_t firstaddr) /* * msgbufp is used to map the system message buffer. */ - SYSMAP(struct msgbuf *, unused, msgbufp, atop(round_page(MSGBUF_SIZE))) + SYSMAP(struct msgbuf *, unused, msgbufp, atop(round_page(msgbufsize))) /* * ptemap is used for pmap_pte_quick Modified: head/sys/ia64/ia64/machdep.c ============================================================================== --- head/sys/ia64/ia64/machdep.c Fri Jan 21 07:28:48 2011 (r217687) +++ head/sys/ia64/ia64/machdep.c Fri Jan 21 10:26:26 2011 (r217688) @@ -31,7 +31,6 @@ __FBSDID("$FreeBSD$"); #include "opt_compat.h" #include "opt_ddb.h" #include "opt_kstack_pages.h" -#include "opt_msgbuf.h" #include "opt_sched.h" #include @@ -888,8 +887,8 @@ ia64_init(void) /* * Initialize error message buffer (at end of core). */ - msgbufp = (struct msgbuf *)pmap_steal_memory(MSGBUF_SIZE); - msgbufinit(msgbufp, MSGBUF_SIZE); + msgbufp = (struct msgbuf *)pmap_steal_memory(msgbufsize); + msgbufinit(msgbufp, msgbufsize); proc_linkup0(&proc0, &thread0); /* Modified: head/sys/kern/subr_param.c ============================================================================== --- head/sys/kern/subr_param.c Fri Jan 21 07:28:48 2011 (r217687) +++ head/sys/kern/subr_param.c Fri Jan 21 10:26:26 2011 (r217688) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include "opt_param.h" +#include "opt_msgbuf.h" #include "opt_maxusers.h" #include @@ -45,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -83,6 +85,7 @@ int maxproc; /* maximum # of processes int maxprocperuid; /* max # of procs per user */ int maxfiles; /* sys. wide open files limit */ int maxfilesperproc; /* per-proc open files limit */ +int msgbufsize; /* size of kernel message buffer */ int ncallout; /* maximum # of timer events */ int nbuf; int ngroups_max; /* max # groups per process */ @@ -106,6 +109,8 @@ SYSCTL_INT(_kern, OID_AUTO, nbuf, CTLFLA "Number of buffers in the buffer cache"); SYSCTL_INT(_kern, OID_AUTO, nswbuf, CTLFLAG_RDTUN, &nswbuf, 0, "Number of swap buffers"); +SYSCTL_INT(_kern, OID_AUTO, msgbufsize, CTLFLAG_RDTUN, &msgbufsize, 0, + "Size of the kernel message buffer"); SYSCTL_LONG(_kern, OID_AUTO, maxswzone, CTLFLAG_RDTUN, &maxswzone, 0, "Maximum memory for swap metadata"); SYSCTL_LONG(_kern, OID_AUTO, maxbcache, CTLFLAG_RDTUN, &maxbcache, 0, @@ -218,6 +223,8 @@ init_param1(void) maxbcache = VM_BCACHE_SIZE_MAX; #endif TUNABLE_LONG_FETCH("kern.maxbcache", &maxbcache); + msgbufsize = MSGBUF_SIZE; + TUNABLE_INT_FETCH("kern.msgbufsize", &msgbufsize); maxtsiz = MAXTSIZ; TUNABLE_ULONG_FETCH("kern.maxtsiz", &maxtsiz); Modified: head/sys/mips/mips/machdep.c ============================================================================== --- head/sys/mips/mips/machdep.c Fri Jan 21 07:28:48 2011 (r217687) +++ head/sys/mips/mips/machdep.c Fri Jan 21 10:26:26 2011 (r217688) @@ -45,7 +45,6 @@ __FBSDID("$FreeBSD$"); #include "opt_cputype.h" #include "opt_ddb.h" #include "opt_md.h" -#include "opt_msgbuf.h" #include #include Modified: head/sys/mips/mips/pmap.c ============================================================================== --- head/sys/mips/mips/pmap.c Fri Jan 21 07:28:48 2011 (r217687) +++ head/sys/mips/mips/pmap.c Fri Jan 21 10:26:26 2011 (r217688) @@ -68,7 +68,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_msgbuf.h" #include "opt_ddb.h" #include @@ -546,8 +545,8 @@ again: /* * Steal the message buffer from the beginning of memory. */ - msgbufp = (struct msgbuf *)pmap_steal_memory(MSGBUF_SIZE); - msgbufinit(msgbufp, MSGBUF_SIZE); + msgbufp = (struct msgbuf *)pmap_steal_memory(msgbufsize); + msgbufinit(msgbufp, msgbufsize); /* * Steal thread0 kstack. Modified: head/sys/pc98/pc98/machdep.c ============================================================================== --- head/sys/pc98/pc98/machdep.c Fri Jan 21 07:28:48 2011 (r217687) +++ head/sys/pc98/pc98/machdep.c Fri Jan 21 10:26:26 2011 (r217688) @@ -49,7 +49,6 @@ __FBSDID("$FreeBSD$"); #include "opt_isa.h" #include "opt_kstack_pages.h" #include "opt_maxmem.h" -#include "opt_msgbuf.h" #include "opt_npx.h" #include "opt_perfmon.h" @@ -2066,7 +2065,7 @@ do_next: * calculation, etc.). */ while (phys_avail[pa_indx - 1] + PAGE_SIZE + - round_page(MSGBUF_SIZE) >= phys_avail[pa_indx]) { + round_page(msgbufsize) >= phys_avail[pa_indx]) { physmem -= atop(phys_avail[pa_indx] - phys_avail[pa_indx - 1]); phys_avail[pa_indx--] = 0; phys_avail[pa_indx--] = 0; @@ -2075,10 +2074,10 @@ do_next: Maxmem = atop(phys_avail[pa_indx]); /* Trim off space for the message buffer. */ - phys_avail[pa_indx] -= round_page(MSGBUF_SIZE); + phys_avail[pa_indx] -= round_page(msgbufsize); /* Map the message buffer. */ - for (off = 0; off < round_page(MSGBUF_SIZE); off += PAGE_SIZE) + for (off = 0; off < round_page(msgbufsize); off += PAGE_SIZE) pmap_kenter((vm_offset_t)msgbufp + off, phys_avail[pa_indx] + off); } @@ -2293,7 +2292,7 @@ init386(first) /* now running on new page tables, configured,and u/iom is accessible */ - msgbufinit(msgbufp, MSGBUF_SIZE); + msgbufinit(msgbufp, msgbufsize); /* make a call gate to reenter kernel with */ gdp = &ldt[LSYS5CALLS_SEL].gd; Modified: head/sys/powerpc/aim/machdep.c ============================================================================== --- head/sys/powerpc/aim/machdep.c Fri Jan 21 07:28:48 2011 (r217687) +++ head/sys/powerpc/aim/machdep.c Fri Jan 21 10:26:26 2011 (r217688) @@ -60,7 +60,6 @@ __FBSDID("$FreeBSD$"); #include "opt_compat.h" #include "opt_ddb.h" #include "opt_kstack_pages.h" -#include "opt_msgbuf.h" #include #include @@ -555,7 +554,7 @@ powerpc_init(vm_offset_t startkernel, vm pc->pc_curpcb = thread0.td_pcb; /* Initialise the message buffer. */ - msgbufinit(msgbufp, MSGBUF_SIZE); + msgbufinit(msgbufp, msgbufsize); #ifdef KDB if (boothowto & RB_KDB) Modified: head/sys/powerpc/aim/mmu_oea.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea.c Fri Jan 21 07:28:48 2011 (r217687) +++ head/sys/powerpc/aim/mmu_oea.c Fri Jan 21 10:26:26 2011 (r217688) @@ -921,10 +921,10 @@ moea_bootstrap(mmu_t mmup, vm_offset_t k /* * Allocate virtual address space for the message buffer. */ - pa = msgbuf_phys = moea_bootstrap_alloc(MSGBUF_SIZE, PAGE_SIZE); + pa = msgbuf_phys = moea_bootstrap_alloc(msgbufsize, PAGE_SIZE); msgbufp = (struct msgbuf *)virtual_avail; va = virtual_avail; - virtual_avail += round_page(MSGBUF_SIZE); + virtual_avail += round_page(msgbufsize); while (va < virtual_avail) { moea_kenter(mmup, va, pa); pa += PAGE_SIZE; Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Fri Jan 21 07:28:48 2011 (r217687) +++ head/sys/powerpc/aim/mmu_oea64.c Fri Jan 21 10:26:26 2011 (r217688) @@ -950,10 +950,10 @@ moea64_late_bootstrap(mmu_t mmup, vm_off /* * Allocate virtual address space for the message buffer. */ - pa = msgbuf_phys = moea64_bootstrap_alloc(MSGBUF_SIZE, PAGE_SIZE); + pa = msgbuf_phys = moea64_bootstrap_alloc(msgbufsize, PAGE_SIZE); msgbufp = (struct msgbuf *)virtual_avail; va = virtual_avail; - virtual_avail += round_page(MSGBUF_SIZE); + virtual_avail += round_page(msgbufsize); while (va < virtual_avail) { moea64_kenter(mmup, va, pa); pa += PAGE_SIZE; Modified: head/sys/powerpc/booke/machdep.c ============================================================================== --- head/sys/powerpc/booke/machdep.c Fri Jan 21 07:28:48 2011 (r217687) +++ head/sys/powerpc/booke/machdep.c Fri Jan 21 10:26:26 2011 (r217688) @@ -84,7 +84,6 @@ __FBSDID("$FreeBSD$"); #include "opt_compat.h" #include "opt_ddb.h" #include "opt_kstack_pages.h" -#include "opt_msgbuf.h" #include "opt_platform.h" #include @@ -420,7 +419,7 @@ e500_init(u_int32_t startkernel, u_int32 pc->pc_curpcb = thread0.td_pcb; /* Initialise the message buffer. */ - msgbufinit(msgbufp, MSGBUF_SIZE); + msgbufinit(msgbufp, msgbufsize); /* Enable Machine Check interrupt. */ mtmsr(mfmsr() | PSL_ME); Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Fri Jan 21 07:28:48 2011 (r217687) +++ head/sys/powerpc/booke/pmap.c Fri Jan 21 10:26:26 2011 (r217688) @@ -979,7 +979,7 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset /* Allocate space for the message buffer. */ msgbufp = (struct msgbuf *)data_end; - data_end += MSGBUF_SIZE; + data_end += msgbufsize; debugf(" msgbufp at 0x%08x end = 0x%08x\n", (uint32_t)msgbufp, data_end); Modified: head/sys/sparc64/sparc64/machdep.c ============================================================================== --- head/sys/sparc64/sparc64/machdep.c Fri Jan 21 07:28:48 2011 (r217687) +++ head/sys/sparc64/sparc64/machdep.c Fri Jan 21 10:26:26 2011 (r217688) @@ -41,7 +41,6 @@ __FBSDID("$FreeBSD$"); #include "opt_compat.h" #include "opt_ddb.h" #include "opt_kstack_pages.h" -#include "opt_msgbuf.h" #include #include @@ -581,7 +580,7 @@ sparc64_init(caddr_t mdp, u_long o1, u_l * buffer (after setting the trap table). */ dpcpu_init(dpcpu0, 0); - msgbufinit(msgbufp, MSGBUF_SIZE); + msgbufinit(msgbufp, msgbufsize); /* * Initialize mutexes. Modified: head/sys/sparc64/sparc64/pmap.c ============================================================================== --- head/sys/sparc64/sparc64/pmap.c Fri Jan 21 07:28:48 2011 (r217687) +++ head/sys/sparc64/sparc64/pmap.c Fri Jan 21 10:26:26 2011 (r217688) @@ -66,7 +66,6 @@ __FBSDID("$FreeBSD$"); */ #include "opt_kstack_pages.h" -#include "opt_msgbuf.h" #include "opt_pmap.h" #include @@ -439,7 +438,7 @@ pmap_bootstrap(u_int cpu_impl) /* * Allocate and map the message buffer. */ - pa = pmap_bootstrap_alloc(MSGBUF_SIZE, colors); + pa = pmap_bootstrap_alloc(msgbufsize, colors); msgbufp = (struct msgbuf *)TLB_PHYS_TO_DIRECT(pa); /* Modified: head/sys/sun4v/sun4v/machdep.c ============================================================================== --- head/sys/sun4v/sun4v/machdep.c Fri Jan 21 07:28:48 2011 (r217687) +++ head/sys/sun4v/sun4v/machdep.c Fri Jan 21 10:26:26 2011 (r217688) @@ -41,7 +41,6 @@ __FBSDID("$FreeBSD$"); #include "opt_compat.h" #include "opt_ddb.h" #include "opt_kstack_pages.h" -#include "opt_msgbuf.h" #include #include @@ -504,7 +503,7 @@ sparc64_init(caddr_t mdp, u_long o1, u_l */ BVPRINTF("initialize msgbuf\n"); dpcpu_init(dpcpu0, 0); - msgbufinit(msgbufp, MSGBUF_SIZE); + msgbufinit(msgbufp, msgbufsize); BVPRINTF("initialize mutexes\n"); mutex_init(); Modified: head/sys/sun4v/sun4v/pmap.c ============================================================================== --- head/sys/sun4v/sun4v/pmap.c Fri Jan 21 07:28:48 2011 (r217687) +++ head/sys/sun4v/sun4v/pmap.c Fri Jan 21 10:26:26 2011 (r217688) @@ -29,7 +29,6 @@ __FBSDID("$FreeBSD$"); #include "opt_kstack_pages.h" -#include "opt_msgbuf.h" #include "opt_pmap.h" #include "opt_trap_trace.h" @@ -782,7 +781,7 @@ skipshuffle: /* * Allocate and map the message buffer. */ - msgbuf_phys = pmap_bootstrap_alloc(MSGBUF_SIZE); + msgbuf_phys = pmap_bootstrap_alloc(msgbufsize); msgbufp = (struct msgbuf *)TLB_PHYS_TO_DIRECT(msgbuf_phys); /* Modified: head/sys/sys/msgbuf.h ============================================================================== --- head/sys/sys/msgbuf.h Fri Jan 21 07:28:48 2011 (r217687) +++ head/sys/sys/msgbuf.h Fri Jan 21 10:26:26 2011 (r217688) @@ -52,6 +52,7 @@ struct msgbuf { #define MSGBUF_SEQSUB(mbp, seq1, seq2) (MSGBUF_SEQNORM((mbp), (seq1) - (seq2))) #ifdef _KERNEL +extern int msgbufsize; extern int msgbuftrigger; extern struct msgbuf *msgbufp; extern struct mtx msgbuf_lock; Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Fri Jan 21 07:28:48 2011 (r217687) +++ head/sys/vm/vm_page.c Fri Jan 21 10:26:26 2011 (r217688) @@ -100,7 +100,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_msgbuf.h" #include "opt_vm.h" #include @@ -375,7 +374,7 @@ vm_page_startup(vm_offset_t vaddr) * through the direct map, they are not automatically included. */ pa = DMAP_TO_PHYS((vm_offset_t)msgbufp->msg_ptr); - last_pa = pa + round_page(MSGBUF_SIZE); + last_pa = pa + round_page(msgbufsize); while (pa < last_pa) { dump_add_page(pa); pa += PAGE_SIZE; From owner-svn-src-all@FreeBSD.ORG Fri Jan 21 12:15:22 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 055F11065670; Fri, 21 Jan 2011 12:15:22 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E8C858FC14; Fri, 21 Jan 2011 12:15:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0LCFLod051846; Fri, 21 Jan 2011 12:15:21 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0LCFLdl051844; Fri, 21 Jan 2011 12:15:21 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201101211215.p0LCFLdl051844@svn.freebsd.org> From: Sergey Kandaurov Date: Fri, 21 Jan 2011 12:15:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217689 - head/sys/boot/forth X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jan 2011 12:15:22 -0000 Author: pluknet Date: Fri Jan 21 12:15:21 2011 New Revision: 217689 URL: http://svn.freebsd.org/changeset/base/217689 Log: Add kern.msgbufsize default setting to /boot/defaults/loader.conf. Suggested by: Alex Kozlov (via private mail) Approved by: kib (mentor) Modified: head/sys/boot/forth/loader.conf Modified: head/sys/boot/forth/loader.conf ============================================================================== --- head/sys/boot/forth/loader.conf Fri Jan 21 10:26:26 2011 (r217688) +++ head/sys/boot/forth/loader.conf Fri Jan 21 12:15:21 2011 (r217689) @@ -99,7 +99,7 @@ module_path="/boot/modules" # Set the mo #kern.maxswzone="" # Set the max swmeta KVA storage #kern.maxtsiz="" # Set the max text size #kern.maxusers="32" # Set size of various static tables -#kern.msgbufsize="" # Set size of kernel message buffer +#kern.msgbufsize="65536" # Set size of kernel message buffer #kern.nbuf="" # Set the number of buffer headers #kern.ncallout="" # Set the maximum # of timer events #kern.ngroups="1023" # Set the maximum # of supplemental groups From owner-svn-src-all@FreeBSD.ORG Fri Jan 21 12:32:45 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 88230106566C; Fri, 21 Jan 2011 12:32:45 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) by mx1.freebsd.org (Postfix) with ESMTP id 215F68FC14; Fri, 21 Jan 2011 12:32:45 +0000 (UTC) Received: from turtle.stack.nl (turtle.stack.nl [IPv6:2001:610:1108:5010::132]) by mx1.stack.nl (Postfix) with ESMTP id D6FB235A86D; Fri, 21 Jan 2011 13:32:43 +0100 (CET) Received: by turtle.stack.nl (Postfix, from userid 1677) id C3558175D3; Fri, 21 Jan 2011 13:32:43 +0100 (CET) Date: Fri, 21 Jan 2011 13:32:43 +0100 From: Jilles Tjoelker To: Garrett Cooper Message-ID: <20110121123243.GA58884@stack.nl> References: <201101182118.p0ILIWA4052343@svn.freebsd.org> <4D3631DE.8040408@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Doug Barton , src-committers@freebsd.org Subject: Re: svn commit: r217557 - in head: bin/sh tools/regression/bin/sh/execution X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jan 2011 12:32:45 -0000 On Tue, Jan 18, 2011 at 04:43:41PM -0800, Garrett Cooper wrote: > On Tue, Jan 18, 2011 at 4:35 PM, Doug Barton wrote: > > On 01/18/2011 14:33, Garrett Cooper wrote: > >> On Tue, Jan 18, 2011 at 1:18 PM, Jilles Tjoelker > >>  wrote: > >>> Author: jilles > >>> Date: Tue Jan 18 21:18:31 2011 > >>> New Revision: 217557 > >>> URL: http://svn.freebsd.org/changeset/base/217557 > >>> Log: > >>>  sh: Fix signal messages being sent to the wrong file sometimes. > >>>  When a foreground job exits on a signal, a message is printed to > >>> stdout  about this. The buffer was not flushed after this which > >>> could result in the  message being written to the wrong file if > >>> the next command was a builtin  and had stdout redirected. > > Does this mean that portmaster is going to stop printing those !*@%$@(# > > "Terminated" messages that I have never been able to figure out how to get > > rid of, or am I just a loser? :) > Don't know. I noticed it because the posix testsuite has a program > that traps SIGALRM (system/OS dependent signal number) for the purpose > of watchdog'ing testcases so they don't hang. So it was doing > something like this: > $ sh > $ python -c 'import os, signal; os.kill(0, signal.SIGALRM)' >/dev/null > 2>&1; echo $? > foo; echo "FOO:"; cat foo > FOO: > Alarm clock > 142 > $ > I would expect FOO: to follow Alarm clock, not precede it. > Whether or not this fixes portmaster, I dunno... try running bash > or dash instead of /bin/sh to see whether or not the `problem' still > occurs. > HTH, > -Garrett > PS Shells printing out Terminated, Alarm clock, etc is in the POSIX spec IIRC. I cannot find this, except if exiting on a signal other than SIGINT and SIGPIPE is implicitly considered an error that deserves a diagnostic message on stderr. I think that is another bug: as noted in the commit message this message is currently sent to stdout. It should be sent to stderr. In any case, a redirection directly on the command does not redirect the message but a redirection on an outer { ...; } compound command does (for pre-r217557 sh there should be a builtin or lone assignment without redirections within the compound command to make sure this works consistently). Another way to avoid the message is not exit on the signal, for example trap 'exit 1' TERM With subshells, there are additional complications. Normally, if the last thing a subshell needs to do is to fork a process and wait for it, it will not fork but instead perform the operation (typically execve()) directly. This is more efficient and makes $! more useful. However, it also means any message about a signal is not written by the subshell but by its parent. The exact details about this have changed between 7.x and 8.0, and may change again for 9.0. Some shells such as sh before r217557 also generate messages about signals from the wait builtin if it is used with parameters. I may put this back, sending them to stderr. These messages can be suppressed easily by redirecting wait's stdout and stderr. A somewhat related message is one that shows the job id and process ids of background jobs started in interactive mode. I cannot find a requirement for this in POSIX but most shells other than ash variants print it and it seems useful. -- Jilles Tjoelker From owner-svn-src-all@FreeBSD.ORG Fri Jan 21 12:58:14 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 542141065673; Fri, 21 Jan 2011 12:58:14 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com [209.85.216.54]) by mx1.freebsd.org (Postfix) with ESMTP id D50D88FC0A; Fri, 21 Jan 2011 12:58:13 +0000 (UTC) Received: by qwj9 with SMTP id 9so1712087qwj.13 for ; Fri, 21 Jan 2011 04:58:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; bh=YvqH8s4SgJ101r+Biy4htG/pzWCmUbxIr3Afp3E38Ho=; b=P6Ee/gEe5vLokSQjv8XJzJvd4nPgu7Ujui5tbv+Mj0E31ZwTkDOfaqC+FYGwDsDJUK DnBseYoC7E2kDQzBK+xkpADKilaJTjQcDNBn3v09RNhrTjxMs4dHkh+Vdsafh7hxejcY 3vYNFm9MIp4MgyhivmI4KybCEsAqlkFHkmIrQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=Uenxanyt9pNvIuRHYMeZgUFGhjhELkOkmiPzM3IJUvnmhaWP+huiLvHeKtbpDO7ZoL 7wrLXgF99axd5Bzf2lFxmh3v9dE8r97hvF+NPn6RCKz1U/yWL077kfpTfNdSb3G6grrv jqhyTWIlmrKw1vh+IFaQogIPz0hoS6YVxDyF8= MIME-Version: 1.0 Received: by 10.229.240.66 with SMTP id kz2mr509388qcb.233.1295612915382; Fri, 21 Jan 2011 04:28:35 -0800 (PST) Sender: pluknet@gmail.com Received: by 10.229.102.87 with HTTP; Fri, 21 Jan 2011 04:28:35 -0800 (PST) In-Reply-To: <201101211026.p0LAQQRo047220@svn.freebsd.org> References: <201101211026.p0LAQQRo047220@svn.freebsd.org> Date: Fri, 21 Jan 2011 15:28:35 +0300 X-Google-Sender-Auth: -pP7pTOpXTB5tGRwbenEK33ihTU Message-ID: From: Sergey Kandaurov To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Subject: Re: svn commit: r217688 - in head/sys: amd64/amd64 arm/at91 arm/econa arm/mv arm/s3c2xx0 arm/xscale/i80321 arm/xscale/i8134x arm/xscale/ixp425 arm/xscale/pxa boot/common boot/forth i386/i386 i386/xen i... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jan 2011 12:58:14 -0000 On 21 January 2011 13:26, Sergey Kandaurov wrote: > Author: pluknet > Date: Fri Jan 21 10:26:26 2011 > New Revision: 217688 > URL: http://svn.freebsd.org/changeset/base/217688 > > Log: > =A0Make MSGBUF_SIZE kernel option a loader tunable kern.msgbufsize. > > =A0Submitted by: perryh pluto.rain.com (previous version) > =A0Reviewed by: =A0jhb > =A0Approved by: =A0kib (mentor) > =A0Tested by: =A0 =A0universe If no one objects, I will try to merge this to stable/8 after some time. --=20 wbr, pluknet From owner-svn-src-all@FreeBSD.ORG Fri Jan 21 14:05:11 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F2A0C1065673; Fri, 21 Jan 2011 14:05:11 +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 E10998FC18; Fri, 21 Jan 2011 14:05:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0LE5BLE054827; Fri, 21 Jan 2011 14:05:11 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0LE5B9v054818; Fri, 21 Jan 2011 14:05:11 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201101211405.p0LE5B9v054818@svn.freebsd.org> From: Marius Strobl Date: Fri, 21 Jan 2011 14:05:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217694 - releng/8.2/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jan 2011 14:05:12 -0000 Author: marius Date: Fri Jan 21 14:05:11 2011 New Revision: 217694 URL: http://svn.freebsd.org/changeset/base/217694 Log: MFC: r217464, r217468, r217475 Add a manual page for rgephy(4) and reference it as appropriate. The motivation for having rgephy.4 is to document the special media option added in r217415 (MFC'ed to releng/8.2 in r217666). Approved by: re (kib) Added: releng/8.2/share/man/man4/rgephy.4 - copied, changed from r217464, head/share/man/man4/rgephy.4 Modified: releng/8.2/share/man/man4/Makefile releng/8.2/share/man/man4/axe.4 releng/8.2/share/man/man4/miibus.4 releng/8.2/share/man/man4/nfe.4 releng/8.2/share/man/man4/nve.4 releng/8.2/share/man/man4/re.4 releng/8.2/share/man/man4/sge.4 Directory Properties: releng/8.2/share/man/man4/ (props changed) Modified: releng/8.2/share/man/man4/Makefile ============================================================================== --- releng/8.2/share/man/man4/Makefile Fri Jan 21 13:46:34 2011 (r217693) +++ releng/8.2/share/man/man4/Makefile Fri Jan 21 14:05:11 2011 (r217694) @@ -331,6 +331,7 @@ MAN= aac.4 \ random.4 \ rc.4 \ re.4 \ + rgephy.4 \ rl.4 \ rndtest.4 \ route.4 \ Modified: releng/8.2/share/man/man4/axe.4 ============================================================================== --- releng/8.2/share/man/man4/axe.4 Fri Jan 21 13:46:34 2011 (r217693) +++ releng/8.2/share/man/man4/axe.4 Fri Jan 21 14:05:11 2011 (r217694) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 20, 2008 +.Dd January 16, 2011 .Dt AXE 4 .Os .Sh NAME @@ -206,6 +206,7 @@ The driver failed to allocate an mbuf fo .Xr miibus 4 , .Xr netintro 4 , .Xr ng_ether 4 , +.Xr rgephy 4 , .Xr ifconfig 8 .Rs .%T "ASIX AX88172 AX88178 and AX88772 data sheets" Modified: releng/8.2/share/man/man4/miibus.4 ============================================================================== --- releng/8.2/share/man/man4/miibus.4 Fri Jan 21 13:46:34 2011 (r217693) +++ releng/8.2/share/man/man4/miibus.4 Fri Jan 21 14:05:11 2011 (r217694) @@ -8,7 +8,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 14, 2010 +.Dd January 15, 2011 .Dt MIIBUS 4 .Os .Sh NAME @@ -157,6 +157,7 @@ but as a result are not well behaved new .Xr nve 4 , .Xr pcn 4 , .Xr re 4 , +.Xr rgephy 4 , .Xr rl 4 , .Xr rue 4 , .Xr sf 4 , Modified: releng/8.2/share/man/man4/nfe.4 ============================================================================== --- releng/8.2/share/man/man4/nfe.4 Fri Jan 21 13:46:34 2011 (r217693) +++ releng/8.2/share/man/man4/nfe.4 Fri Jan 21 14:05:11 2011 (r217694) @@ -16,7 +16,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 2, 2008 +.Dd January, 2011 .Dt NFE 4 .Os .Sh NAME @@ -174,6 +174,7 @@ before a change takes effect. .Xr netintro 4 , .Xr pci 4 , .Xr polling 4 , +.Xr rgephy 4 , .Xr sysctl 8 , .Xr ifconfig 8 .Sh HISTORY Modified: releng/8.2/share/man/man4/nve.4 ============================================================================== --- releng/8.2/share/man/man4/nve.4 Fri Jan 21 13:46:34 2011 (r217693) +++ releng/8.2/share/man/man4/nve.4 Fri Jan 21 14:05:11 2011 (r217694) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 8, 2007 +.Dd January 16, 2011 .Dt NVE 4 .Os .Sh NAME @@ -124,6 +124,7 @@ bandwidth show that the card is actually .Xr miibus 4 , .Xr netintro 4 , .Xr ng_ether 4 , +.Xr rgephy 4 , .Xr ifconfig 8 .Sh HISTORY The Modified: releng/8.2/share/man/man4/re.4 ============================================================================== --- releng/8.2/share/man/man4/re.4 Fri Jan 21 13:46:34 2011 (r217693) +++ releng/8.2/share/man/man4/re.4 Fri Jan 21 14:05:11 2011 (r217694) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 27, 2010 +.Dd January, 2011 .Dt RE 4 .Os .Sh NAME @@ -208,6 +208,7 @@ the network connection (cable). .Xr netintro 4 , .Xr ng_ether 4 , .Xr polling 4 , +.Xr rgephy 4 , .Xr vlan 4 , .Xr ifconfig 8 .Rs Copied and modified: releng/8.2/share/man/man4/rgephy.4 (from r217464, head/share/man/man4/rgephy.4) ============================================================================== --- head/share/man/man4/rgephy.4 Sat Jan 15 22:07:08 2011 (r217464, copy source) +++ releng/8.2/share/man/man4/rgephy.4 Fri Jan 21 14:05:11 2011 (r217694) @@ -69,7 +69,7 @@ the .Nm driver by default also triggers an autonegotiation advertising the selected media. -This is done in order work around hardware issues in certain scenarios. +This is done in order to work around hardware issues in certain scenarios. It is believed that this behavior does not cause harm in general but in fact can have an adverse effect in edge cases. In order to manually set the media type and options without also triggering Modified: releng/8.2/share/man/man4/sge.4 ============================================================================== --- releng/8.2/share/man/man4/sge.4 Fri Jan 21 13:46:34 2011 (r217693) +++ releng/8.2/share/man/man4/sge.4 Fri Jan 21 14:05:11 2011 (r217694) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 10, 2010 +.Dd January 16, 2011 .Dt SGE 4 .Os .Sh NAME @@ -105,6 +105,7 @@ SiS191 Fast/Gigabit Ethernet controller .Xr miibus 4 , .Xr netintro 4 , .Xr ng_ether 4 , +.Xr rgephy 4 , .Xr vlan 4 , .Xr ifconfig 8 .Sh HISTORY From owner-svn-src-all@FreeBSD.ORG Fri Jan 21 14:07:39 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 540FF1065673; Fri, 21 Jan 2011 14:07:39 +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 42BD88FC18; Fri, 21 Jan 2011 14:07:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0LE7dgS054950; Fri, 21 Jan 2011 14:07:39 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0LE7dmS054941; Fri, 21 Jan 2011 14:07:39 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201101211407.p0LE7dmS054941@svn.freebsd.org> From: Marius Strobl Date: Fri, 21 Jan 2011 14:07:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217695 - releng/7.4/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jan 2011 14:07:39 -0000 Author: marius Date: Fri Jan 21 14:07:38 2011 New Revision: 217695 URL: http://svn.freebsd.org/changeset/base/217695 Log: MFC: r217464, r217468, r217475 Add a manual page for rgephy(4) and reference it as appropriate. The motivation for having rgephy.4 is to document the special media option added in r217415 (MFC'ed to releng/7.4 in r217667). Approved by: re (kib) Added: releng/7.4/share/man/man4/rgephy.4 - copied, changed from r217464, head/share/man/man4/rgephy.4 Modified: releng/7.4/share/man/man4/Makefile releng/7.4/share/man/man4/axe.4 releng/7.4/share/man/man4/miibus.4 releng/7.4/share/man/man4/nfe.4 releng/7.4/share/man/man4/nve.4 releng/7.4/share/man/man4/re.4 releng/7.4/share/man/man4/sge.4 Directory Properties: releng/7.4/share/man/man4/ (props changed) Modified: releng/7.4/share/man/man4/Makefile ============================================================================== --- releng/7.4/share/man/man4/Makefile Fri Jan 21 14:05:11 2011 (r217694) +++ releng/7.4/share/man/man4/Makefile Fri Jan 21 14:07:38 2011 (r217695) @@ -291,6 +291,7 @@ MAN= aac.4 \ random.4 \ rc.4 \ re.4 \ + rgephy.4 \ rl.4 \ rndtest.4 \ route.4 \ Modified: releng/7.4/share/man/man4/axe.4 ============================================================================== --- releng/7.4/share/man/man4/axe.4 Fri Jan 21 14:05:11 2011 (r217694) +++ releng/7.4/share/man/man4/axe.4 Fri Jan 21 14:07:38 2011 (r217695) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 20, 2008 +.Dd January 16, 2011 .Dt AXE 4 .Os .Sh NAME @@ -196,6 +196,7 @@ The driver failed to allocate an mbuf fo .Xr miibus 4 , .Xr netintro 4 , .Xr ng_ether 4 , +.Xr rgephy 4 , .Xr ifconfig 8 .Rs .%T "ASIX AX88172 AX88178 and AX88772 data sheets" Modified: releng/7.4/share/man/man4/miibus.4 ============================================================================== --- releng/7.4/share/man/man4/miibus.4 Fri Jan 21 14:05:11 2011 (r217694) +++ releng/7.4/share/man/man4/miibus.4 Fri Jan 21 14:07:38 2011 (r217695) @@ -8,7 +8,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 14, 2010 +.Dd January 15, 2011 .Dt MIIBUS 4 .Os .Sh NAME @@ -157,6 +157,7 @@ but as a result are not well behaved new .Xr nve 4 , .Xr pcn 4 , .Xr re 4 , +.Xr rgephy 4 , .Xr rl 4 , .Xr rue 4 , .Xr sf 4 , Modified: releng/7.4/share/man/man4/nfe.4 ============================================================================== --- releng/7.4/share/man/man4/nfe.4 Fri Jan 21 14:05:11 2011 (r217694) +++ releng/7.4/share/man/man4/nfe.4 Fri Jan 21 14:07:38 2011 (r217695) @@ -16,7 +16,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 2, 2008 +.Dd January, 2011 .Dt NFE 4 .Os .Sh NAME @@ -174,6 +174,7 @@ before a change takes effect. .Xr netintro 4 , .Xr pci 4 , .Xr polling 4 , +.Xr rgephy 4 , .Xr sysctl 8 , .Xr ifconfig 8 .Sh HISTORY Modified: releng/7.4/share/man/man4/nve.4 ============================================================================== --- releng/7.4/share/man/man4/nve.4 Fri Jan 21 14:05:11 2011 (r217694) +++ releng/7.4/share/man/man4/nve.4 Fri Jan 21 14:07:38 2011 (r217695) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 8, 2007 +.Dd January 16, 2011 .Dt NVE 4 .Os .Sh NAME @@ -124,6 +124,7 @@ bandwidth show that the card is actually .Xr miibus 4 , .Xr netintro 4 , .Xr ng_ether 4 , +.Xr rgephy 4 , .Xr ifconfig 8 .Sh HISTORY The Modified: releng/7.4/share/man/man4/re.4 ============================================================================== --- releng/7.4/share/man/man4/re.4 Fri Jan 21 14:05:11 2011 (r217694) +++ releng/7.4/share/man/man4/re.4 Fri Jan 21 14:07:38 2011 (r217695) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 27, 2010 +.Dd January, 2011 .Dt RE 4 .Os .Sh NAME @@ -208,6 +208,7 @@ the network connection (cable). .Xr netintro 4 , .Xr ng_ether 4 , .Xr polling 4 , +.Xr rgephy 4 , .Xr vlan 4 , .Xr ifconfig 8 .Rs Copied and modified: releng/7.4/share/man/man4/rgephy.4 (from r217464, head/share/man/man4/rgephy.4) ============================================================================== --- head/share/man/man4/rgephy.4 Sat Jan 15 22:07:08 2011 (r217464, copy source) +++ releng/7.4/share/man/man4/rgephy.4 Fri Jan 21 14:07:38 2011 (r217695) @@ -69,7 +69,7 @@ the .Nm driver by default also triggers an autonegotiation advertising the selected media. -This is done in order work around hardware issues in certain scenarios. +This is done in order to work around hardware issues in certain scenarios. It is believed that this behavior does not cause harm in general but in fact can have an adverse effect in edge cases. In order to manually set the media type and options without also triggering Modified: releng/7.4/share/man/man4/sge.4 ============================================================================== --- releng/7.4/share/man/man4/sge.4 Fri Jan 21 14:05:11 2011 (r217694) +++ releng/7.4/share/man/man4/sge.4 Fri Jan 21 14:07:38 2011 (r217695) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 10, 2010 +.Dd January 16, 2011 .Dt SGE 4 .Os .Sh NAME @@ -105,6 +105,7 @@ SiS191 Fast/Gigabit Ethernet controller .Xr miibus 4 , .Xr netintro 4 , .Xr ng_ether 4 , +.Xr rgephy 4 , .Xr vlan 4 , .Xr ifconfig 8 .Sh HISTORY From owner-svn-src-all@FreeBSD.ORG Fri Jan 21 16:22:12 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 55B28106566B; Fri, 21 Jan 2011 16:22:12 +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 453B58FC20; Fri, 21 Jan 2011 16:22:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0LGMCZl059495; Fri, 21 Jan 2011 16:22:12 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0LGMCNV059492; Fri, 21 Jan 2011 16:22:12 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201101211622.p0LGMCNV059492@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 21 Jan 2011 16:22:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217696 - svnadmin/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jan 2011 16:22:12 -0000 Author: kib Date: Fri Jan 21 16:22:11 2011 New Revision: 217696 URL: http://svn.freebsd.org/changeset/base/217696 Log: Josh Paetzel has src commit bit now. Approved by: core Modified: svnadmin/conf/access svnadmin/conf/mentors Modified: svnadmin/conf/access ============================================================================== --- svnadmin/conf/access Fri Jan 21 14:07:38 2011 (r217695) +++ svnadmin/conf/access Fri Jan 21 16:22:11 2011 (r217696) @@ -121,6 +121,7 @@ jmg joerg freebsd-devel@uriah.heep.sax.de jon jonathan +jpaetzel julian kaiw kan Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Fri Jan 21 14:07:38 2011 (r217695) +++ svnadmin/conf/mentors Fri Jan 21 16:22:11 2011 (r217696) @@ -19,6 +19,7 @@ gabor delphij hselasky thompsa jinmei gnn jonathan rwatson +jpaetzel kib nork imp pluknet avg Co-mentor: kib randi cperciva From owner-svn-src-all@FreeBSD.ORG Fri Jan 21 17:53:40 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A0738106566C; Fri, 21 Jan 2011 17:53:40 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8EE548FC16; Fri, 21 Jan 2011 17:53:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0LHreT1062107; Fri, 21 Jan 2011 17:53:40 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0LHrekZ062105; Fri, 21 Jan 2011 17:53:40 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201101211753.p0LHrekZ062105@svn.freebsd.org> From: Edward Tomasz Napierala Date: Fri, 21 Jan 2011 17:53:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217697 - stable/8/share/man/man5 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jan 2011 17:53:40 -0000 Author: trasz Date: Fri Jan 21 17:53:40 2011 New Revision: 217697 URL: http://svn.freebsd.org/changeset/base/217697 Log: MFC r216667: The 'kern.corefile="whatever"' syntax won't work with sysctl.conf; remove the quotes to not mislead people. MFC r216668: Fix date, broken in r216667. Modified: stable/8/share/man/man5/core.5 Directory Properties: stable/8/share/man/man5/ (props changed) Modified: stable/8/share/man/man5/core.5 ============================================================================== --- stable/8/share/man/man5/core.5 Fri Jan 21 16:22:11 2011 (r217696) +++ stable/8/share/man/man5/core.5 Fri Jan 21 17:53:40 2011 (r217697) @@ -32,7 +32,7 @@ .\" @(#)core.5 8.3 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd January 9, 2002 +.Dd December 22, 2010 .Dt CORE 5 .Os .Sh NAME @@ -96,7 +96,7 @@ the following .Xr sysctl 8 command can be used: .Pp -.Dl sysctl kern.corefile="/var/coredumps/\&%U/\&%N.core" +.Dl sysctl kern.corefile=/var/coredumps/\&%U/\&%N.core .Sh SEE ALSO .Xr gdb 1 , .Xr kgdb 1 , From owner-svn-src-all@FreeBSD.ORG Fri Jan 21 18:10:11 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B84B4106566B; Fri, 21 Jan 2011 18:10:11 +0000 (UTC) (envelope-from fanf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A6FF08FC18; Fri, 21 Jan 2011 18:10:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0LIABic062697; Fri, 21 Jan 2011 18:10:11 GMT (envelope-from fanf@svn.freebsd.org) Received: (from fanf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0LIABph062695; Fri, 21 Jan 2011 18:10:11 GMT (envelope-from fanf@svn.freebsd.org) Message-Id: <201101211810.p0LIABph062695@svn.freebsd.org> From: Tony Finch Date: Fri, 21 Jan 2011 18:10:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217698 - head/usr.bin/unifdef X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jan 2011 18:10:11 -0000 Author: fanf Date: Fri Jan 21 18:10:11 2011 New Revision: 217698 URL: http://svn.freebsd.org/changeset/base/217698 Log: Update to upstrea version 2.5.6. Detect IO errors properly. Write #line directives to the correct output stream. Obtained from: http://dotat.at/prog/unifdef Modified: head/usr.bin/unifdef/unifdef.c Modified: head/usr.bin/unifdef/unifdef.c ============================================================================== --- head/usr.bin/unifdef/unifdef.c Fri Jan 21 17:53:40 2011 (r217697) +++ head/usr.bin/unifdef/unifdef.c Fri Jan 21 18:10:11 2011 (r217698) @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002 - 2010 Tony Finch + * Copyright (c) 2002 - 2011 Tony Finch * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -57,7 +57,7 @@ #include const char copyright[] = - "@(#) $Version: unifdef-2.5 $\n" + "@(#) $Version: unifdef-2.5.6.21f1388 $\n" "@(#) $FreeBSD$\n" "@(#) $Author: Tony Finch (dot@dotat.at) $\n" "@(#) $URL: http://dotat.at/prog/unifdef $\n" @@ -549,6 +549,7 @@ state(Ifstate is) /* * Write a line to the output or not, according to command line options. + * If writing fails, closeout() will print the error and exit. */ static void flushline(bool keep) @@ -561,21 +562,23 @@ flushline(bool keep) delcount += 1; blankcount += 1; } else { - if (lnnum && delcount > 0) - printf("#line %d%s", linenum, newline); - fputs(tline, output); + if (lnnum && delcount > 0 && + fprintf(output, "#line %d%s", linenum, newline) < 0) + closeout(); + if (fputs(tline, output) == EOF) + closeout(); delcount = 0; blankmax = blankcount = blankline ? blankcount + 1 : 0; } } else { - if (lnblank) - fputs(newline, output); + if (lnblank && fputs(newline, output) == EOF) + closeout(); exitstat = 1; delcount += 1; blankcount = 0; } - if (debugging) - fflush(output); + if (debugging && fflush(output) == EOF) + closeout(); } /* @@ -604,13 +607,13 @@ closeout(void) { if (symdepth && !zerosyms) printf("\n"); - if (fclose(output) == EOF) { - warn("couldn't write to %s", ofilename); + if (ferror(output) || fclose(output) == EOF) { if (overwriting) { + warn("couldn't write to temporary file"); unlink(tempname); - errx(2, "%s unchanged", filename); + errx(2, "%s unchanged", ofilename); } else { - exit(2); + err(2, "couldn't write to %s", ofilename); } } } @@ -647,8 +650,12 @@ parseline(void) Comment_state wascomment; linenum++; - if (fgets(tline, MAXLINE, input) == NULL) - return (LT_EOF); + if (fgets(tline, MAXLINE, input) == NULL) { + if (ferror(input)) + error(strerror(errno)); + else + return (LT_EOF); + } if (newline == NULL) { if (strrchr(tline, '\n') == strrchr(tline, '\r') + 1) newline = newline_crlf; @@ -722,7 +729,9 @@ parseline(void) if (linestate == LS_HASH) { size_t len = cp - tline; if (fgets(tline + len, MAXLINE - len, input) == NULL) { - /* append the missing newline */ + if (ferror(input)) + error(strerror(errno)); + /* append the missing newline at eof */ strcpy(tline + len, newline); cp += strlen(newline); linestate = LS_START; From owner-svn-src-all@FreeBSD.ORG Fri Jan 21 18:18:55 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 981531065672; Fri, 21 Jan 2011 18:18:55 +0000 (UTC) (envelope-from fanf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7B9B18FC1F; Fri, 21 Jan 2011 18:18:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0LIItFk062979; Fri, 21 Jan 2011 18:18:55 GMT (envelope-from fanf@svn.freebsd.org) Received: (from fanf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0LIItCi062977; Fri, 21 Jan 2011 18:18:55 GMT (envelope-from fanf@svn.freebsd.org) Message-Id: <201101211818.p0LIItCi062977@svn.freebsd.org> From: Tony Finch Date: Fri, 21 Jan 2011 18:18:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217699 - stable/8/usr.bin/unifdef X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jan 2011 18:18:55 -0000 Author: fanf Date: Fri Jan 21 18:18:55 2011 New Revision: 217699 URL: http://svn.freebsd.org/changeset/base/217699 Log: MFC r217698: unifdef-2.5.6 Modified: stable/8/usr.bin/unifdef/unifdef.c Directory Properties: stable/8/usr.bin/unifdef/ (props changed) Modified: stable/8/usr.bin/unifdef/unifdef.c ============================================================================== --- stable/8/usr.bin/unifdef/unifdef.c Fri Jan 21 18:10:11 2011 (r217698) +++ stable/8/usr.bin/unifdef/unifdef.c Fri Jan 21 18:18:55 2011 (r217699) @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002 - 2010 Tony Finch + * Copyright (c) 2002 - 2011 Tony Finch * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -57,7 +57,7 @@ #include const char copyright[] = - "@(#) $Version: unifdef-2.5 $\n" + "@(#) $Version: unifdef-2.5.6.21f1388 $\n" "@(#) $FreeBSD$\n" "@(#) $Author: Tony Finch (dot@dotat.at) $\n" "@(#) $URL: http://dotat.at/prog/unifdef $\n" @@ -549,6 +549,7 @@ state(Ifstate is) /* * Write a line to the output or not, according to command line options. + * If writing fails, closeout() will print the error and exit. */ static void flushline(bool keep) @@ -561,21 +562,23 @@ flushline(bool keep) delcount += 1; blankcount += 1; } else { - if (lnnum && delcount > 0) - printf("#line %d%s", linenum, newline); - fputs(tline, output); + if (lnnum && delcount > 0 && + fprintf(output, "#line %d%s", linenum, newline) < 0) + closeout(); + if (fputs(tline, output) == EOF) + closeout(); delcount = 0; blankmax = blankcount = blankline ? blankcount + 1 : 0; } } else { - if (lnblank) - fputs(newline, output); + if (lnblank && fputs(newline, output) == EOF) + closeout(); exitstat = 1; delcount += 1; blankcount = 0; } - if (debugging) - fflush(output); + if (debugging && fflush(output) == EOF) + closeout(); } /* @@ -604,13 +607,13 @@ closeout(void) { if (symdepth && !zerosyms) printf("\n"); - if (fclose(output) == EOF) { - warn("couldn't write to %s", ofilename); + if (ferror(output) || fclose(output) == EOF) { if (overwriting) { + warn("couldn't write to temporary file"); unlink(tempname); - errx(2, "%s unchanged", filename); + errx(2, "%s unchanged", ofilename); } else { - exit(2); + err(2, "couldn't write to %s", ofilename); } } } @@ -647,8 +650,12 @@ parseline(void) Comment_state wascomment; linenum++; - if (fgets(tline, MAXLINE, input) == NULL) - return (LT_EOF); + if (fgets(tline, MAXLINE, input) == NULL) { + if (ferror(input)) + error(strerror(errno)); + else + return (LT_EOF); + } if (newline == NULL) { if (strrchr(tline, '\n') == strrchr(tline, '\r') + 1) newline = newline_crlf; @@ -722,7 +729,9 @@ parseline(void) if (linestate == LS_HASH) { size_t len = cp - tline; if (fgets(tline + len, MAXLINE - len, input) == NULL) { - /* append the missing newline */ + if (ferror(input)) + error(strerror(errno)); + /* append the missing newline at eof */ strcpy(tline + len, newline); cp += strlen(newline); linestate = LS_START; From owner-svn-src-all@FreeBSD.ORG Fri Jan 21 18:31:57 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AC0B3106564A; Fri, 21 Jan 2011 18:31:57 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9A3FF8FC19; Fri, 21 Jan 2011 18:31:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0LIVv52063452; Fri, 21 Jan 2011 18:31:57 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0LIVvYQ063449; Fri, 21 Jan 2011 18:31:57 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201101211831.p0LIVvYQ063449@svn.freebsd.org> From: Jung-uk Kim Date: Fri, 21 Jan 2011 18:31:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217700 - in stable/8/sys/amd64: ia32 linux32 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jan 2011 18:31:57 -0000 Author: jkim Date: Fri Jan 21 18:31:57 2011 New Revision: 217700 URL: http://svn.freebsd.org/changeset/base/217700 Log: MFC: r217424 Remove redundant, bogus, and even harmful uses of setting TS bit in CR0. It is done from fpstate_drop() when it is really necessary. Modified: stable/8/sys/amd64/ia32/ia32_signal.c stable/8/sys/amd64/linux32/linux32_sysvec.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/amd64/ia32/ia32_signal.c ============================================================================== --- stable/8/sys/amd64/ia32/ia32_signal.c Fri Jan 21 18:18:55 2011 (r217699) +++ stable/8/sys/amd64/ia32/ia32_signal.c Fri Jan 21 18:31:57 2011 (r217700) @@ -741,7 +741,6 @@ ia32_setregs(td, entry, stack, ps_string regs->tf_gs = _ugssel; regs->tf_flags = TF_HASSEGS; - load_cr0(rcr0() | CR0_MP | CR0_TS); fpstate_drop(td); /* Return via doreti so that we can change to a different %cs */ Modified: stable/8/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- stable/8/sys/amd64/linux32/linux32_sysvec.c Fri Jan 21 18:18:55 2011 (r217699) +++ stable/8/sys/amd64/linux32/linux32_sysvec.c Fri Jan 21 18:31:57 2011 (r217700) @@ -875,7 +875,7 @@ exec_linux_setregs(td, entry, stack, ps_ regs->tf_flags = TF_HASSEGS; regs->tf_cs = _ucode32sel; regs->tf_rbx = ps_strings; - load_cr0(rcr0() | CR0_MP | CR0_TS); + fpstate_drop(td); /* Do full restore on return so that we can change to a different %cs */ From owner-svn-src-all@FreeBSD.ORG Fri Jan 21 18:32:30 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B1C4106564A; Fri, 21 Jan 2011 18:32:30 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 498F38FC21; Fri, 21 Jan 2011 18:32:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0LIWUIN063504; Fri, 21 Jan 2011 18:32:30 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0LIWUOj063501; Fri, 21 Jan 2011 18:32:30 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201101211832.p0LIWUOj063501@svn.freebsd.org> From: Jung-uk Kim Date: Fri, 21 Jan 2011 18:32:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217701 - in stable/7/sys/amd64: ia32 linux32 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jan 2011 18:32:30 -0000 Author: jkim Date: Fri Jan 21 18:32:29 2011 New Revision: 217701 URL: http://svn.freebsd.org/changeset/base/217701 Log: MFC: r217424 Remove redundant, bogus, and even harmful uses of setting TS bit in CR0. It is done from fpstate_drop() when it is really necessary. Modified: stable/7/sys/amd64/ia32/ia32_signal.c stable/7/sys/amd64/linux32/linux32_sysvec.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/amd64/ia32/ia32_signal.c ============================================================================== --- stable/7/sys/amd64/ia32/ia32_signal.c Fri Jan 21 18:31:57 2011 (r217700) +++ stable/7/sys/amd64/ia32/ia32_signal.c Fri Jan 21 18:32:29 2011 (r217701) @@ -736,7 +736,6 @@ ia32_setregs(td, entry, stack, ps_string regs->tf_ss = _udatasel; regs->tf_cs = _ucode32sel; regs->tf_rbx = ps_strings; - load_cr0(rcr0() | CR0_MP | CR0_TS); fpstate_drop(td); /* Return via doreti so that we can change to a different %cs */ Modified: stable/7/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- stable/7/sys/amd64/linux32/linux32_sysvec.c Fri Jan 21 18:31:57 2011 (r217700) +++ stable/7/sys/amd64/linux32/linux32_sysvec.c Fri Jan 21 18:32:29 2011 (r217701) @@ -860,7 +860,7 @@ exec_linux_setregs(td, entry, stack, ps_ regs->tf_ss = _udatasel; regs->tf_cs = _ucode32sel; regs->tf_rbx = ps_strings; - load_cr0(rcr0() | CR0_MP | CR0_TS); + fpstate_drop(td); /* Return via doreti so that we can change to a different %cs */ From owner-svn-src-all@FreeBSD.ORG Fri Jan 21 21:33:46 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ECD351065695; Fri, 21 Jan 2011 21:33:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DC1948FC08; Fri, 21 Jan 2011 21:33:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0LLXkUl068404; Fri, 21 Jan 2011 21:33:46 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0LLXkIk068402; Fri, 21 Jan 2011 21:33:46 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201101212133.p0LLXkIk068402@svn.freebsd.org> From: John Baldwin Date: Fri, 21 Jan 2011 21:33:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217702 - head/sys/fs/ext2fs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jan 2011 21:33:47 -0000 Author: jhb Date: Fri Jan 21 21:33:46 2011 New Revision: 217702 URL: http://svn.freebsd.org/changeset/base/217702 Log: Restore support for the 'async' and 'sync' mount options lost when switching to nmount(2). While here, sort the options. PR: kern/153584 Submitted by: Pedro F. Giffuni giffunip at yahoo MFC after: 1 week Modified: head/sys/fs/ext2fs/ext2_vfsops.c Modified: head/sys/fs/ext2fs/ext2_vfsops.c ============================================================================== --- head/sys/fs/ext2fs/ext2_vfsops.c Fri Jan 21 18:32:29 2011 (r217701) +++ head/sys/fs/ext2fs/ext2_vfsops.c Fri Jan 21 21:33:46 2011 (r217702) @@ -95,9 +95,9 @@ static int ext2_check_sb_compat(struct e static int compute_sb_data(struct vnode * devvp, struct ext2fs * es, struct m_ext2fs * fs); -static const char *ext2_opts[] = { "from", "export", "acls", "noexec", - "noatime", "union", "suiddir", "multilabel", "nosymfollow", - "noclusterr", "noclusterw", "force", NULL }; +static const char *ext2_opts[] = { "acls", "async", "noatime", "noclusterr", + "noclusterw", "noexec", "export", "force", "from", "multilabel", + "suiddir", "nosymfollow", "sync", "union", NULL }; /* * VFS Operations. From owner-svn-src-all@FreeBSD.ORG Fri Jan 21 22:00:41 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 68183106564A; Fri, 21 Jan 2011 22:00:41 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4B24D8FC08; Fri, 21 Jan 2011 22:00:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0LM0fSA069164; Fri, 21 Jan 2011 22:00:41 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0LM0fKj069162; Fri, 21 Jan 2011 22:00:41 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201101212200.p0LM0fKj069162@svn.freebsd.org> From: John Baldwin Date: Fri, 21 Jan 2011 22:00: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: r217703 - head/sys/fs/ext2fs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jan 2011 22:00:41 -0000 Author: jhb Date: Fri Jan 21 22:00:40 2011 New Revision: 217703 URL: http://svn.freebsd.org/changeset/base/217703 Log: - Move special inode constants to ext2_dinode.h and rename them to match NetBSD. - Add a constant for the HASJOURNAL compat flag. PR: kern/153584 Submitted by: Pedro F. Giffuni giffunip at yahoo Modified: head/sys/fs/ext2fs/ext2_dinode.h head/sys/fs/ext2fs/ext2fs.h Modified: head/sys/fs/ext2fs/ext2_dinode.h ============================================================================== --- head/sys/fs/ext2fs/ext2_dinode.h Fri Jan 21 21:33:46 2011 (r217702) +++ head/sys/fs/ext2fs/ext2_dinode.h Fri Jan 21 22:00:40 2011 (r217703) @@ -32,6 +32,23 @@ #define e2di_size_high e2di_dacl /* + * Special inode numbers + * The root inode is the root of the file system. Inode 0 can't be used for + * normal purposes and bad blocks are normally linked to inode 1, thus + * the root inode is 2. + * Inode 3 to 10 are reserved in ext2fs. + */ +#define EXT2_BADBLKINO ((ino_t)1) +#define EXT2_ROOTINO ((ino_t)2) +#define EXT2_ACLIDXINO ((ino_t)3) +#define EXT2_ACLDATAINO ((ino_t)4) +#define EXT2_BOOTLOADERINO ((ino_t)5) +#define EXT2_UNDELDIRINO ((ino_t)6) +#define EXT2_RESIZEINO ((ino_t)7) +#define EXT2_JOURNALINO ((ino_t)8) +#define EXT2_FIRSTINO ((ino_t)11) + +/* * Inode flags * The current implementation uses only EXT2_IMMUTABLE and EXT2_APPEND flags */ Modified: head/sys/fs/ext2fs/ext2fs.h ============================================================================== --- head/sys/fs/ext2fs/ext2fs.h Fri Jan 21 21:33:46 2011 (r217702) +++ head/sys/fs/ext2fs/ext2fs.h Fri Jan 21 22:00:40 2011 (r217703) @@ -39,22 +39,6 @@ #include -/* - * Special inode numbers - */ -#define EXT2_BAD_INO 1 /* Bad blocks inode */ -#define EXT2_ROOT_INO 2 /* Root inode */ -#define EXT2_BOOT_LOADER_INO 5 /* Boot loader inode */ -#define EXT2_UNDEL_DIR_INO 6 /* Undelete directory inode */ - -/* First non-reserved inode for old ext2 filesystems */ -#define E2FS_REV0_FIRST_INO 11 - -/* - * The second extended file system magic number - */ -#define E2FS_MAGIC 0xEF53 - #if defined(_KERNEL) /* * FreeBSD passes the pointer to the in-core struct with relevant @@ -170,7 +154,7 @@ struct m_ext2fs { uint32_t e2fs_mount_opt; uint32_t e2fs_blocksize_bits; uint32_t e2fs_total_dir; /* Total number of directories */ - uint8_t *e2fs_contigdirs; + uint8_t *e2fs_contigdirs; /* (u) # of contig. allocated dirs */ char e2fs_wasvalid; /* valid at mount time */ off_t e2fs_maxfilesize; struct ext2_gd *e2fs_gd; /* Group Descriptors */ @@ -182,6 +166,14 @@ struct m_ext2fs { #define E2FS_DATE "95/08/09" #define E2FS_VERSION "0.5b" +/* First non-reserved inode for old ext2 filesystems */ +#define E2FS_REV0_FIRST_INO 11 + +/* + * The second extended file system magic number + */ +#define E2FS_MAGIC 0xEF53 + /* * Revision levels */ @@ -197,6 +189,7 @@ struct m_ext2fs { * compatible/incompatible features */ #define EXT2F_COMPAT_PREALLOC 0x0001 +#define EXT2F_COMPAT_HASJOURNAL 0x0004 #define EXT2F_COMPAT_RESIZE 0x0010 #define EXT2F_ROCOMPAT_SPARSESUPER 0x0001 From owner-svn-src-all@FreeBSD.ORG Fri Jan 21 22:15:17 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BACEA106566C; Fri, 21 Jan 2011 22:15:17 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A9A298FC14; Fri, 21 Jan 2011 22:15:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0LMFHVV069577; Fri, 21 Jan 2011 22:15:17 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0LMFHY0069575; Fri, 21 Jan 2011 22:15:17 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201101212215.p0LMFHY0069575@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 21 Jan 2011 22:15: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: r217704 - head/lib/libc/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jan 2011 22:15:17 -0000 Author: jilles Date: Fri Jan 21 22:15:17 2011 New Revision: 217704 URL: http://svn.freebsd.org/changeset/base/217704 Log: getgroups(2): Remove mention of and refer to sysconf(3). Because {NGROUPS_MAX} may become variable, its value should be obtained using sysconf(3). If a #define is used anyway, it should be obtained by including as that is in POSIX like getgroups(2) itself is. is not in POSIX. MFC after: 1 week Modified: head/lib/libc/sys/getgroups.2 Modified: head/lib/libc/sys/getgroups.2 ============================================================================== --- head/lib/libc/sys/getgroups.2 Fri Jan 21 22:00:40 2011 (r217703) +++ head/lib/libc/sys/getgroups.2 Fri Jan 21 22:15:17 2011 (r217704) @@ -28,7 +28,7 @@ .\" @(#)getgroups.2 8.2 (Berkeley) 4/16/94 .\" $FreeBSD$ .\" -.Dd March 5, 1999 +.Dd January 21, 2011 .Dt GETGROUPS 2 .Os .Sh NAME @@ -37,7 +37,6 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.In sys/param.h .In unistd.h .Ft int .Fn getgroups "int gidsetlen" "gid_t *gidset" @@ -66,6 +65,12 @@ is zero, returns the number of supplementary group IDs associated with the calling process without modifying the array pointed to by .Fa gidset . +.Pp +The value of +.Dv {NGROUPS_MAX} +should be obtained using +.Xr sysconf 3 +to avoid hard-coding it into the executable. .Sh RETURN VALUES A successful call returns the number of groups in the group set. A value of -1 indicates that an error occurred, and the error @@ -88,7 +93,8 @@ an invalid address. .El .Sh SEE ALSO .Xr setgroups 2 , -.Xr initgroups 3 +.Xr initgroups 3 , +.Xr sysconf 3 .Sh STANDARDS The .Fn getgroups From owner-svn-src-all@FreeBSD.ORG Fri Jan 21 23:55:28 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EF442106564A; Fri, 21 Jan 2011 23:55:28 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DEA888FC0C; Fri, 21 Jan 2011 23:55:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0LNtSDF071919; Fri, 21 Jan 2011 23:55:28 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0LNtSaZ071917; Fri, 21 Jan 2011 23:55:28 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201101212355.p0LNtSaZ071917@svn.freebsd.org> From: Jack F Vogel Date: Fri, 21 Jan 2011 23:55: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: r217705 - head/sys/dev/ixgbe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jan 2011 23:55:29 -0000 Author: jfv Date: Fri Jan 21 23:55:28 2011 New Revision: 217705 URL: http://svn.freebsd.org/changeset/base/217705 Log: Leftover bogus TX UNLOCK removed. Thanks to Andrew Boyer. Modified: head/sys/dev/ixgbe/ixgbe.c Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Fri Jan 21 22:15:17 2011 (r217704) +++ head/sys/dev/ixgbe/ixgbe.c Fri Jan 21 23:55:28 2011 (r217705) @@ -1870,7 +1870,6 @@ hung: txr->me, txr->tx_avail, txr->next_to_clean); adapter->ifp->if_drv_flags &= ~IFF_DRV_RUNNING; adapter->watchdog_events++; - IXGBE_TX_UNLOCK(txr); ixgbe_init_locked(adapter); } From owner-svn-src-all@FreeBSD.ORG Sat Jan 22 00:08:06 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C58C21065697; Sat, 22 Jan 2011 00:08:06 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B4C578FC18; Sat, 22 Jan 2011 00:08:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0M086fU072243; Sat, 22 Jan 2011 00:08:06 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0M086TQ072241; Sat, 22 Jan 2011 00:08:06 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201101220008.p0M086TQ072241@svn.freebsd.org> From: Jack F Vogel Date: Sat, 22 Jan 2011 00:08:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217706 - head/sys/dev/ixgbe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jan 2011 00:08:06 -0000 Author: jfv Date: Sat Jan 22 00:08:06 2011 New Revision: 217706 URL: http://svn.freebsd.org/changeset/base/217706 Log: Missing case for 82598DA type adapter, thanks Andrew. Modified: head/sys/dev/ixgbe/ixgbe.c Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Fri Jan 21 23:55:28 2011 (r217705) +++ head/sys/dev/ixgbe/ixgbe.c Sat Jan 22 00:08:06 2011 (r217706) @@ -2012,6 +2012,9 @@ ixgbe_setup_optics(struct adapter *adapt case IXGBE_PHYSICAL_LAYER_10GBASE_CX4: adapter->optics = IFM_10G_CX4; break; + case IXGBE_PHYSICAL_LAYER_SFP_PLUS_CU: + adapter->optics = IFM_10G_TWINAX; + break; case IXGBE_PHYSICAL_LAYER_1000BASE_KX: case IXGBE_PHYSICAL_LAYER_10GBASE_KR: case IXGBE_PHYSICAL_LAYER_10GBASE_XAUI: From owner-svn-src-all@FreeBSD.ORG Sat Jan 22 00:19:15 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C73D4106564A; Sat, 22 Jan 2011 00:19:15 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B67C28FC1A; Sat, 22 Jan 2011 00:19:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0M0JFEH072540; Sat, 22 Jan 2011 00:19:15 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0M0JFUO072538; Sat, 22 Jan 2011 00:19:15 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201101220019.p0M0JFUO072538@svn.freebsd.org> From: Jack F Vogel Date: Sat, 22 Jan 2011 00:19:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217707 - head/sys/dev/ixgbe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jan 2011 00:19:15 -0000 Author: jfv Date: Sat Jan 22 00:19:15 2011 New Revision: 217707 URL: http://svn.freebsd.org/changeset/base/217707 Log: Don't bother to run the flowcontrol code if there is no change. Thanks to Andrew for the tweak. Modified: head/sys/dev/ixgbe/ixgbe.c Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Sat Jan 22 00:08:06 2011 (r217706) +++ head/sys/dev/ixgbe/ixgbe.c Sat Jan 22 00:19:15 2011 (r217707) @@ -5268,13 +5268,17 @@ static int ixgbe_set_flowcntl(SYSCTL_HANDLER_ARGS) { int error; + int last = ixgbe_flow_control; struct adapter *adapter; error = sysctl_handle_int(oidp, &ixgbe_flow_control, 0, req); - if (error) return (error); + /* Don't bother if it's not changed */ + if (ixgbe_flow_control == last) + return (0); + adapter = (struct adapter *) arg1; switch (ixgbe_flow_control) { case ixgbe_fc_rx_pause: From owner-svn-src-all@FreeBSD.ORG Sat Jan 22 00:32:12 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 60BC5106564A; Sat, 22 Jan 2011 00:32:12 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4FC1F8FC13; Sat, 22 Jan 2011 00:32:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0M0WCn1072885; Sat, 22 Jan 2011 00:32:12 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0M0WCrS072883; Sat, 22 Jan 2011 00:32:12 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201101220032.p0M0WCrS072883@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 22 Jan 2011 00:32:12 +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: r217708 - head/sys/arm/mv X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jan 2011 00:32:12 -0000 Author: marcel Date: Sat Jan 22 00:32:12 2011 New Revision: 217708 URL: http://svn.freebsd.org/changeset/base/217708 Log: Fix backtraces by defining ksym_start & ksym_end if DDB is defined. The kernel linker doesn't deal with symbols of type NOTYPE and typically gives the wrong symbol ($a) for local symbols. Obtained from: Juniper Networks, Inc. Modified: head/sys/arm/mv/mv_machdep.c Modified: head/sys/arm/mv/mv_machdep.c ============================================================================== --- head/sys/arm/mv/mv_machdep.c Sat Jan 22 00:19:15 2011 (r217707) +++ head/sys/arm/mv/mv_machdep.c Sat Jan 22 00:32:12 2011 (r217708) @@ -118,6 +118,10 @@ extern unsigned char _edata[]; extern unsigned char __bss_start[]; extern unsigned char _end[]; +#ifdef DDB +extern vm_offset_t ksym_start, ksym_end; +#endif + extern u_int data_abort_handler_address; extern u_int prefetch_abort_handler_address; extern u_int undefined_handler_address; @@ -330,6 +334,10 @@ initarm(void *mdp, void *unused __unused dtbp = MD_FETCH(kmdp, MODINFOMD_DTBP, vm_offset_t); lastaddr = MD_FETCH(kmdp, MODINFOMD_KERNEND, vm_offset_t); +#ifdef DDB + ksym_start = MD_FETCH(kmdp, MODINFOMD_SSYM, uintptr_t); + ksym_end = MD_FETCH(kmdp, MODINFOMD_ESYM, uintptr_t); +#endif } } else { From owner-svn-src-all@FreeBSD.ORG Sat Jan 22 01:32:00 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B8B3106564A; Sat, 22 Jan 2011 01:32:00 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1A7728FC08; Sat, 22 Jan 2011 01:32:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0M1Vxod075518; Sat, 22 Jan 2011 01:31:59 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0M1VxWV075516; Sat, 22 Jan 2011 01:31:59 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201101220131.p0M1VxWV075516@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 22 Jan 2011 01:31:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217709 - head/sys/arm/mv X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jan 2011 01:32:00 -0000 Author: marcel Date: Sat Jan 22 01:31:59 2011 New Revision: 217709 URL: http://svn.freebsd.org/changeset/base/217709 Log: Fix r217688. We need to call init_param1() before we use msgbufsize, now that the size of the message buffer is a tunable. Modified: head/sys/arm/mv/mv_machdep.c Modified: head/sys/arm/mv/mv_machdep.c ============================================================================== --- head/sys/arm/mv/mv_machdep.c Sat Jan 22 00:32:12 2011 (r217708) +++ head/sys/arm/mv/mv_machdep.c Sat Jan 22 01:31:59 2011 (r217709) @@ -434,6 +434,9 @@ initarm(void *mdp, void *unused __unused valloc_pages(abtstack, ABT_STACK_SIZE); valloc_pages(undstack, UND_STACK_SIZE); valloc_pages(kernelstack, KSTACK_PAGES); + + init_param1(); + valloc_pages(msgbufpv, round_page(msgbufsize) / PAGE_SIZE); /* @@ -591,7 +594,6 @@ initarm(void *mdp, void *unused __unused physmap_init(); /* Do basic tuning, hz etc */ - init_param1(); init_param2(physmem); kdb_init(); return ((void *)(kernelstack.pv_va + USPACE_SVC_STACK_TOP - From owner-svn-src-all@FreeBSD.ORG Sat Jan 22 01:34:08 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 96CEC106566C; Sat, 22 Jan 2011 01:34:08 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 851148FC12; Sat, 22 Jan 2011 01:34:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0M1Y8pE075614; Sat, 22 Jan 2011 01:34:08 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0M1Y8Nt075612; Sat, 22 Jan 2011 01:34:08 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201101220134.p0M1Y8Nt075612@svn.freebsd.org> From: Jack F Vogel Date: Sat, 22 Jan 2011 01:34:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217710 - stable/8/sys/dev/e1000 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jan 2011 01:34:08 -0000 Author: jfv Date: Sat Jan 22 01:34:08 2011 New Revision: 217710 URL: http://svn.freebsd.org/changeset/base/217710 Log: MFC rev 217295 Modified: stable/8/sys/dev/e1000/if_em.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/e1000/if_em.c ============================================================================== --- stable/8/sys/dev/e1000/if_em.c Sat Jan 22 01:31:59 2011 (r217709) +++ stable/8/sys/dev/e1000/if_em.c Sat Jan 22 01:34:08 2011 (r217710) @@ -93,7 +93,7 @@ int em_display_debug_stats = 0; /********************************************************************* * Driver version: *********************************************************************/ -char em_driver_version[] = "7.1.8"; +char em_driver_version[] = "7.1.9"; /********************************************************************* * PCI Device ID Table @@ -1909,14 +1909,23 @@ em_xmit(struct tx_ring *txr, struct mbuf error = bus_dmamap_load_mbuf_sg(txr->txtag, map, *m_headp, segs, &nsegs, BUS_DMA_NOWAIT); - if (error) { + if (error == ENOMEM) { + adapter->no_tx_dma_setup++; + return (error); + } else if (error != 0) { adapter->no_tx_dma_setup++; m_freem(*m_headp); *m_headp = NULL; return (error); } + + } else if (error == ENOMEM) { + adapter->no_tx_dma_setup++; + return (error); } else if (error != 0) { adapter->no_tx_dma_setup++; + m_freem(*m_headp); + *m_headp = NULL; return (error); } @@ -2206,7 +2215,6 @@ hung: txr->me, txr->tx_avail, txr->next_to_clean); ifp->if_drv_flags &= ~IFF_DRV_RUNNING; adapter->watchdog_events++; - EM_TX_UNLOCK(txr); em_init_locked(adapter); } From owner-svn-src-all@FreeBSD.ORG Sat Jan 22 01:37:53 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CE718106566B; Sat, 22 Jan 2011 01:37:53 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BCD5E8FC0A; Sat, 22 Jan 2011 01:37:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0M1brJS075767; Sat, 22 Jan 2011 01:37:53 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0M1briF075765; Sat, 22 Jan 2011 01:37:53 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201101220137.p0M1briF075765@svn.freebsd.org> From: Jack F Vogel Date: Sat, 22 Jan 2011 01:37:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217711 - stable/8/sys/dev/e1000 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jan 2011 01:37:53 -0000 Author: jfv Date: Sat Jan 22 01:37:53 2011 New Revision: 217711 URL: http://svn.freebsd.org/changeset/base/217711 Log: MFC rev 217591 Modified: stable/8/sys/dev/e1000/if_em.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/e1000/if_em.c ============================================================================== --- stable/8/sys/dev/e1000/if_em.c Sat Jan 22 01:34:08 2011 (r217710) +++ stable/8/sys/dev/e1000/if_em.c Sat Jan 22 01:37:53 2011 (r217711) @@ -1820,12 +1820,12 @@ em_xmit(struct tx_ring *txr, struct mbuf } ip = (struct ip *)(mtod(m_head, char *) + ip_off); poff = ip_off + (ip->ip_hl << 2); - m_head = m_pullup(m_head, poff + sizeof(struct tcphdr)); - if (m_head == NULL) { - *m_headp = NULL; - return (ENOBUFS); - } if (do_tso) { + m_head = m_pullup(m_head, poff + sizeof(struct tcphdr)); + if (m_head == NULL) { + *m_headp = NULL; + return (ENOBUFS); + } tp = (struct tcphdr *)(mtod(m_head, char *) + poff); /* * TSO workaround: @@ -1849,6 +1849,11 @@ em_xmit(struct tx_ring *txr, struct mbuf tp->th_sum = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr, htons(IPPROTO_TCP)); } else if (m_head->m_pkthdr.csum_flags & CSUM_TCP) { + m_head = m_pullup(m_head, poff + sizeof(struct tcphdr)); + if (m_head == NULL) { + *m_headp = NULL; + return (ENOBUFS); + } tp = (struct tcphdr *)(mtod(m_head, char *) + poff); m_head = m_pullup(m_head, poff + (tp->th_off << 2)); if (m_head == NULL) { From owner-svn-src-all@FreeBSD.ORG Sat Jan 22 01:43:08 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 306AA106564A; Sat, 22 Jan 2011 01:43:08 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1ED808FC16; Sat, 22 Jan 2011 01:43:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0M1h812075932; Sat, 22 Jan 2011 01:43:08 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0M1h8Kv075930; Sat, 22 Jan 2011 01:43:08 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201101220143.p0M1h8Kv075930@svn.freebsd.org> From: Jack F Vogel Date: Sat, 22 Jan 2011 01:43:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217712 - stable/8/sys/dev/ixgbe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jan 2011 01:43:08 -0000 Author: jfv Date: Sat Jan 22 01:43:07 2011 New Revision: 217712 URL: http://svn.freebsd.org/changeset/base/217712 Log: MFC rev 217127 - correct a couple SYSCTL variables Modified: stable/8/sys/dev/ixgbe/ixgbe.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/ixgbe/ixgbe.c ============================================================================== --- stable/8/sys/dev/ixgbe/ixgbe.c Sat Jan 22 01:37:53 2011 (r217711) +++ stable/8/sys/dev/ixgbe/ixgbe.c Sat Jan 22 01:43:07 2011 (r217712) @@ -5129,13 +5129,13 @@ ixgbe_add_hw_stats(struct adapter *adapt CTLFLAG_RD, &stats->lxontxc, "Link XON Transmitted"); SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "link_xon_rcvd", - CTLFLAG_RD, &stats->lxontxc, + CTLFLAG_RD, &stats->lxonrxc, "Link XON Received"); SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "link_xoff_txd", CTLFLAG_RD, &stats->lxofftxc, "Link XOFF Transmitted"); SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "link_xoff_rcvd", - CTLFLAG_RD, &stats->lxofftxc, + CTLFLAG_RD, &stats->lxoffrxc, "Link XOFF Received"); /* Packet Reception Stats */ From owner-svn-src-all@FreeBSD.ORG Sat Jan 22 01:48:12 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 620C41065670; Sat, 22 Jan 2011 01:48:12 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4F8D88FC20; Sat, 22 Jan 2011 01:48:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0M1mCRC076127; Sat, 22 Jan 2011 01:48:12 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0M1mC66076122; Sat, 22 Jan 2011 01:48:12 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201101220148.p0M1mC66076122@svn.freebsd.org> From: Jack F Vogel Date: Sat, 22 Jan 2011 01:48:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217713 - stable/8/sys/dev/ixgbe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jan 2011 01:48:12 -0000 Author: jfv Date: Sat Jan 22 01:48:12 2011 New Revision: 217713 URL: http://svn.freebsd.org/changeset/base/217713 Log: MFC rev 217593: Critical fix for panic on 82598 Phy detection now dynamic Flow Director improvement Critical fix for buf sz (jumbos) Release RX lock to fix LOR Modified: stable/8/sys/dev/ixgbe/ixgbe.c stable/8/sys/dev/ixgbe/ixgbe.h stable/8/sys/dev/ixgbe/ixgbe_82599.c stable/8/sys/dev/ixgbe/ixgbe_api.h stable/8/sys/dev/ixgbe/ixgbe_common.c stable/8/sys/dev/ixgbe/ixgbe_common.h stable/8/sys/dev/ixgbe/ixgbe_mbx.c stable/8/sys/dev/ixgbe/ixgbe_type.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/ixgbe/ixgbe.c ============================================================================== --- stable/8/sys/dev/ixgbe/ixgbe.c Sat Jan 22 01:43:07 2011 (r217712) +++ stable/8/sys/dev/ixgbe/ixgbe.c Sat Jan 22 01:48:12 2011 (r217713) @@ -46,7 +46,7 @@ int ixgbe_display_debug_stat /********************************************************************* * Driver version *********************************************************************/ -char ixgbe_driver_version[] = "2.3.7"; +char ixgbe_driver_version[] = "2.3.8"; /********************************************************************* * PCI Device ID Table @@ -175,6 +175,7 @@ static __inline void ixgbe_rx_input(stru /* Support for pluggable optic modules */ static bool ixgbe_sfp_probe(struct adapter *); +static void ixgbe_setup_optics(struct adapter *); /* Legacy (single vector interrupt handler */ static void ixgbe_legacy_irq(void *); @@ -290,13 +291,6 @@ TUNABLE_INT("hw.ixgbe.rxd", &ixgbe_rxd); /* Keep running tab on them for sanity check */ static int ixgbe_total_ports; -/* -** The number of scatter-gather segments -** differs for 82598 and 82599, default to -** the former. -*/ -static int ixgbe_num_segs = IXGBE_82598_SCATTER; - #ifdef IXGBE_FDIR /* ** For Flow Director: this is the @@ -386,7 +380,7 @@ ixgbe_attach(device_t dev) struct adapter *adapter; struct ixgbe_hw *hw; int error = 0; - u16 pci_device_id, csum; + u16 csum; u32 ctrl_ext; INIT_DEBUGOUT("ixgbe_attach: begin"); @@ -399,52 +393,6 @@ ixgbe_attach(device_t dev) /* Core Lock Init*/ IXGBE_CORE_LOCK_INIT(adapter, device_get_nameunit(dev)); - /* Keep track of optics */ - pci_device_id = pci_get_device(dev); - switch (pci_device_id) { - case IXGBE_DEV_ID_82598_CX4_DUAL_PORT: - case IXGBE_DEV_ID_82598EB_CX4: - adapter->optics = IFM_10G_CX4; - break; - case IXGBE_DEV_ID_82598: - case IXGBE_DEV_ID_82598AF_DUAL_PORT: - case IXGBE_DEV_ID_82598AF_SINGLE_PORT: - case IXGBE_DEV_ID_82598_SR_DUAL_PORT_EM: - case IXGBE_DEV_ID_82598EB_SFP_LOM: - case IXGBE_DEV_ID_82598AT: - adapter->optics = IFM_10G_SR; - break; - case IXGBE_DEV_ID_82598AT2: - adapter->optics = IFM_10G_T; - break; - case IXGBE_DEV_ID_82598EB_XF_LR: - adapter->optics = IFM_10G_LR; - break; - case IXGBE_DEV_ID_82599_SFP: - adapter->optics = IFM_10G_SR; - ixgbe_num_segs = IXGBE_82599_SCATTER; - break; - case IXGBE_DEV_ID_82598_DA_DUAL_PORT : - adapter->optics = IFM_10G_TWINAX; - break; - case IXGBE_DEV_ID_82599_KX4: - case IXGBE_DEV_ID_82599_KX4_MEZZ: - case IXGBE_DEV_ID_82599_CX4: - adapter->optics = IFM_10G_CX4; - ixgbe_num_segs = IXGBE_82599_SCATTER; - break; - case IXGBE_DEV_ID_82599_XAUI_LOM: - case IXGBE_DEV_ID_82599_COMBO_BACKPLANE: - ixgbe_num_segs = IXGBE_82599_SCATTER; - break; - case IXGBE_DEV_ID_82599_T3_LOM: - ixgbe_num_segs = IXGBE_82599_SCATTER; - adapter->optics = IFM_10G_T; - default: - ixgbe_num_segs = IXGBE_82599_SCATTER; - break; - } - /* SYSCTL APIs */ SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), @@ -547,10 +495,6 @@ ixgbe_attach(device_t dev) goto err_late; } - /* Pick up the smart speed setting */ - if (hw->mac.type == ixgbe_mac_82599EB) - hw->phy.smart_speed = ixgbe_smart_speed; - /* Get Hardware Flow Control setting */ hw->fc.requested_mode = ixgbe_fc_full; hw->fc.pause_time = IXGBE_FC_PAUSE; @@ -574,6 +518,9 @@ ixgbe_attach(device_t dev) goto err_late; } + /* Detect and set physical type */ + ixgbe_setup_optics(adapter); + if ((adapter->msix > 1) && (ixgbe_enable_msix)) error = ixgbe_allocate_msix(adapter); else @@ -1054,7 +1001,7 @@ ixgbe_init_locked(struct adapter *adapte return; } - ixgbe_reset_hw(hw); + ixgbe_init_hw(hw); ixgbe_initialize_transmit_units(adapter); /* Setup Multicast table */ @@ -1068,8 +1015,10 @@ ixgbe_init_locked(struct adapter *adapte adapter->rx_mbuf_sz = MCLBYTES; else if (adapter->max_frame_size <= 4096) adapter->rx_mbuf_sz = MJUMPAGESIZE; - else + else if (adapter->max_frame_size <= 9216) adapter->rx_mbuf_sz = MJUM9BYTES; + else + adapter->rx_mbuf_sz = MJUM16BYTES; /* Prepare receive descriptors and buffers */ if (ixgbe_setup_receive_structures(adapter)) { @@ -1600,7 +1549,7 @@ ixgbe_xmit(struct tx_ring *txr, struct m int i, j, error, nsegs; int first, last = 0; struct mbuf *m_head; - bus_dma_segment_t segs[ixgbe_num_segs]; + bus_dma_segment_t segs[adapter->num_segs]; bus_dmamap_t map; struct ixgbe_tx_buf *txbuf, *txbuf_mapped; union ixgbe_adv_tx_desc *txd = NULL; @@ -2010,16 +1959,68 @@ static void ixgbe_identify_hardware(struct adapter *adapter) { device_t dev = adapter->dev; + struct ixgbe_hw *hw = &adapter->hw; /* Save off the information about this board */ - adapter->hw.vendor_id = pci_get_vendor(dev); - adapter->hw.device_id = pci_get_device(dev); - adapter->hw.revision_id = pci_read_config(dev, PCIR_REVID, 1); - adapter->hw.subsystem_vendor_id = + hw->vendor_id = pci_get_vendor(dev); + hw->device_id = pci_get_device(dev); + hw->revision_id = pci_read_config(dev, PCIR_REVID, 1); + hw->subsystem_vendor_id = pci_read_config(dev, PCIR_SUBVEND_0, 2); - adapter->hw.subsystem_device_id = + hw->subsystem_device_id = pci_read_config(dev, PCIR_SUBDEV_0, 2); + /* We need this here to set the num_segs below */ + ixgbe_set_mac_type(hw); + + /* Pick up the 82599 and VF settings */ + if (hw->mac.type != ixgbe_mac_82598EB) { + hw->phy.smart_speed = ixgbe_smart_speed; + adapter->num_segs = IXGBE_82599_SCATTER; + } else + adapter->num_segs = IXGBE_82598_SCATTER; + + return; +} + +/********************************************************************* + * + * Determine optic type + * + **********************************************************************/ +static void +ixgbe_setup_optics(struct adapter *adapter) +{ + struct ixgbe_hw *hw = &adapter->hw; + int layer; + + layer = ixgbe_get_supported_physical_layer(hw); + switch (layer) { + case IXGBE_PHYSICAL_LAYER_10GBASE_T: + adapter->optics = IFM_10G_T; + break; + case IXGBE_PHYSICAL_LAYER_1000BASE_T: + adapter->optics = IFM_1000_T; + break; + case IXGBE_PHYSICAL_LAYER_10GBASE_LR: + case IXGBE_PHYSICAL_LAYER_10GBASE_LRM: + adapter->optics = IFM_10G_LR; + break; + case IXGBE_PHYSICAL_LAYER_10GBASE_SR: + adapter->optics = IFM_10G_SR; + break; + case IXGBE_PHYSICAL_LAYER_10GBASE_KX4: + case IXGBE_PHYSICAL_LAYER_10GBASE_CX4: + adapter->optics = IFM_10G_CX4; + break; + case IXGBE_PHYSICAL_LAYER_1000BASE_KX: + case IXGBE_PHYSICAL_LAYER_10GBASE_KR: + case IXGBE_PHYSICAL_LAYER_10GBASE_XAUI: + case IXGBE_PHYSICAL_LAYER_UNKNOWN: + default: + adapter->optics = IFM_ETHER | IFM_AUTO; + break; + } return; } @@ -2216,8 +2217,8 @@ ixgbe_setup_msix(struct adapter *adapter if (ixgbe_num_queues != 0) queues = ixgbe_num_queues; - /* Set max queues to 8 */ - else if (queues > 8) + /* Set max queues to 8 when autoconfiguring */ + else if ((ixgbe_num_queues == 0) && (queues > 8)) queues = 8; /* @@ -2413,8 +2414,8 @@ ixgbe_setup_interface(device_t dev, stru */ ifmedia_init(&adapter->media, IFM_IMASK, ixgbe_media_change, ixgbe_media_status); - ifmedia_add(&adapter->media, IFM_ETHER | adapter->optics | - IFM_FDX, 0, NULL); + ifmedia_add(&adapter->media, IFM_ETHER | adapter->optics, 0, NULL); + ifmedia_set(&adapter->media, IFM_ETHER | adapter->optics); if (hw->device_id == IXGBE_DEV_ID_82598AT) { ifmedia_add(&adapter->media, IFM_ETHER | IFM_1000_T | IFM_FDX, 0, NULL); @@ -2718,7 +2719,7 @@ ixgbe_allocate_transmit_buffers(struct t BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ IXGBE_TSO_SIZE, /* maxsize */ - ixgbe_num_segs, /* nsegments */ + adapter->num_segs, /* nsegments */ PAGE_SIZE, /* maxsegsize */ 0, /* flags */ NULL, /* lockfunc */ @@ -3181,72 +3182,67 @@ ixgbe_atr(struct tx_ring *txr, struct mb { struct adapter *adapter = txr->adapter; struct ix_queue *que; - union ixgbe_atr_input atr_input; struct ip *ip; struct tcphdr *th; struct udphdr *uh; struct ether_vlan_header *eh; + union ixgbe_atr_hash_dword input = {.dword = 0}; + union ixgbe_atr_hash_dword common = {.dword = 0}; int ehdrlen, ip_hlen; - u16 etype, vlan_id, src_port, dst_port, flex_bytes; - u32 src_ipv4_addr, dst_ipv4_addr; - u8 l4type = 0, ipproto = 0; + u16 etype; eh = mtod(mp, struct ether_vlan_header *); - if (eh->evl_encap_proto == htons(ETHERTYPE_VLAN)) + if (eh->evl_encap_proto == htons(ETHERTYPE_VLAN)) { ehdrlen = ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN; - else + etype = eh->evl_proto; + } else { ehdrlen = ETHER_HDR_LEN; - etype = ntohs(eh->evl_proto); + etype = eh->evl_encap_proto; + } /* Only handling IPv4 */ - if (etype != ETHERTYPE_IP) + if (etype != htons(ETHERTYPE_IP)) return; ip = (struct ip *)(mp->m_data + ehdrlen); - ipproto = ip->ip_p; ip_hlen = ip->ip_hl << 2; - src_port = dst_port = 0; /* check if we're UDP or TCP */ - switch (ipproto) { + switch (ip->ip_p) { case IPPROTO_TCP: th = (struct tcphdr *)((caddr_t)ip + ip_hlen); - src_port = th->th_sport; - dst_port = th->th_dport; - l4type |= IXGBE_ATR_L4TYPE_TCP; + /* src and dst are inverted */ + common.port.dst ^= th->th_sport; + common.port.src ^= th->th_dport; + input.formatted.flow_type ^= IXGBE_ATR_FLOW_TYPE_TCPV4; break; case IPPROTO_UDP: uh = (struct udphdr *)((caddr_t)ip + ip_hlen); - src_port = uh->uh_sport; - dst_port = uh->uh_dport; - l4type |= IXGBE_ATR_L4TYPE_UDP; + /* src and dst are inverted */ + common.port.dst ^= uh->uh_sport; + common.port.src ^= uh->uh_dport; + input.formatted.flow_type ^= IXGBE_ATR_FLOW_TYPE_UDPV4; break; default: return; } - memset(&atr_input, 0, sizeof(union ixgbe_atr_input)); + input.formatted.vlan_id = htobe16(mp->m_pkthdr.ether_vtag); + if (mp->m_pkthdr.ether_vtag) + common.flex_bytes ^= htons(ETHERTYPE_VLAN); + else + common.flex_bytes ^= etype; + common.ip ^= ip->ip_src.s_addr ^ ip->ip_dst.s_addr; - vlan_id = htole16(mp->m_pkthdr.ether_vtag); - src_ipv4_addr = ip->ip_src.s_addr; - dst_ipv4_addr = ip->ip_dst.s_addr; - flex_bytes = etype; que = &adapter->queues[txr->me]; - - ixgbe_atr_set_vlan_id_82599(&atr_input, vlan_id); - ixgbe_atr_set_src_port_82599(&atr_input, dst_port); - ixgbe_atr_set_dst_port_82599(&atr_input, src_port); - ixgbe_atr_set_flex_byte_82599(&atr_input, flex_bytes); - ixgbe_atr_set_l4type_82599(&atr_input, l4type); - /* src and dst are inverted, think how the receiver sees them */ - ixgbe_atr_set_src_ipv4_82599(&atr_input, dst_ipv4_addr); - ixgbe_atr_set_dst_ipv4_82599(&atr_input, src_ipv4_addr); - - /* This assumes the Rx queue and Tx queue are bound to the same CPU */ + /* + ** This assumes the Rx queue and Tx + ** queue are bound to the same CPU + */ ixgbe_fdir_add_signature_filter_82599(&adapter->hw, - &atr_input, que->msix); + input, common, que->msix); } -#endif +#endif /* IXGBE_FDIR */ /********************************************************************** * @@ -3508,9 +3504,9 @@ ixgbe_allocate_receive_buffers(struct rx BUS_SPACE_MAXADDR, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ - MJUM9BYTES, /* maxsize */ + MJUM16BYTES, /* maxsize */ 1, /* nsegments */ - MJUM9BYTES, /* maxsegsize */ + MJUM16BYTES, /* maxsegsize */ 0, /* flags */ NULL, /* lockfunc */ NULL, /* lockfuncarg */ @@ -3582,8 +3578,13 @@ ixgbe_setup_hw_rsc(struct rx_ring *rxr) */ if (adapter->rx_mbuf_sz == MCLBYTES) rscctrl |= IXGBE_RSCCTL_MAXDESC_16; - else /* using 4K clusters */ + else if (adapter->rx_mbuf_sz == MJUMPAGESIZE) rscctrl |= IXGBE_RSCCTL_MAXDESC_8; + else if (adapter->rx_mbuf_sz == MJUM9BYTES) + rscctrl |= IXGBE_RSCCTL_MAXDESC_4; + else /* Using 16K cluster */ + rscctrl |= IXGBE_RSCCTL_MAXDESC_1; + IXGBE_WRITE_REG(hw, IXGBE_RSCCTL(rxr->me), rscctrl); /* Enable TCP header recognition */ @@ -3821,15 +3822,14 @@ ixgbe_initialize_receive_units(struct ad /* Set for Jumbo Frames? */ hlreg = IXGBE_READ_REG(hw, IXGBE_HLREG0); - if (ifp->if_mtu > ETHERMTU) { + if (ifp->if_mtu > ETHERMTU) hlreg |= IXGBE_HLREG0_JUMBOEN; - bufsz = 4096 >> IXGBE_SRRCTL_BSIZEPKT_SHIFT; - } else { + else hlreg &= ~IXGBE_HLREG0_JUMBOEN; - bufsz = 2048 >> IXGBE_SRRCTL_BSIZEPKT_SHIFT; - } IXGBE_WRITE_REG(hw, IXGBE_HLREG0, hlreg); + bufsz = adapter->rx_mbuf_sz >> IXGBE_SRRCTL_BSIZEPKT_SHIFT; + for (int i = 0; i < adapter->num_queues; i++, rxr++) { u64 rdba = rxr->rxdma.dma_paddr; @@ -4028,7 +4028,9 @@ ixgbe_rx_input(struct rx_ring *rxr, stru if (tcp_lro_rx(&rxr->lro, m, 0) == 0) return; } + IXGBE_RX_UNLOCK(rxr); (*ifp->if_input)(ifp, m); + IXGBE_RX_LOCK(rxr); } static __inline void @@ -4289,8 +4291,11 @@ next_desc: i = 0; /* Now send to the stack or do LRO */ - if (sendmp != NULL) + if (sendmp != NULL) { + rxr->next_to_check = i; ixgbe_rx_input(rxr, ifp, sendmp, ptype); + i = rxr->next_to_check; + } /* Every 8 descriptors we go to refresh mbufs */ if (processed == 8) { @@ -4654,6 +4659,8 @@ static bool ixgbe_sfp_probe(struct adapt device_printf(dev,"SFP+ module detected!\n"); /* We now have supported optics */ adapter->sfp_probe = FALSE; + /* Set the optics type so system reports correctly */ + ixgbe_setup_optics(adapter); result = TRUE; } out: @@ -4718,10 +4725,6 @@ ixgbe_handle_msf(void *context, int pend hw->mac.ops.get_link_capabilities(hw, &autoneg, &negotiate); if (hw->mac.ops.setup_link) hw->mac.ops.setup_link(hw, autoneg, negotiate, TRUE); -#if 0 - ixgbe_check_link(&adapter->hw, &speed, &adapter->link_up, 0); - ixgbe_update_link_status(adapter); -#endif return; } @@ -4830,7 +4833,8 @@ ixgbe_update_stats_counters(struct adapt bprc = IXGBE_READ_REG(hw, IXGBE_BPRC); adapter->stats.bprc += bprc; adapter->stats.mprc += IXGBE_READ_REG(hw, IXGBE_MPRC); - adapter->stats.mprc -= bprc; + if (hw->mac.type == ixgbe_mac_82598EB) + adapter->stats.mprc -= bprc; adapter->stats.prc64 += IXGBE_READ_REG(hw, IXGBE_PRC64); adapter->stats.prc127 += IXGBE_READ_REG(hw, IXGBE_PRC127); @@ -4871,12 +4875,14 @@ ixgbe_update_stats_counters(struct adapt adapter->stats.xec += IXGBE_READ_REG(hw, IXGBE_XEC); adapter->stats.fccrc += IXGBE_READ_REG(hw, IXGBE_FCCRC); adapter->stats.fclast += IXGBE_READ_REG(hw, IXGBE_FCLAST); - adapter->stats.fcoerpdc += IXGBE_READ_REG(hw, IXGBE_FCOERPDC); - adapter->stats.fcoeprc += IXGBE_READ_REG(hw, IXGBE_FCOEPRC); - adapter->stats.fcoeptc += IXGBE_READ_REG(hw, IXGBE_FCOEPTC); - adapter->stats.fcoedwrc += IXGBE_READ_REG(hw, IXGBE_FCOEDWRC); - adapter->stats.fcoedwtc += IXGBE_READ_REG(hw, IXGBE_FCOEDWTC); - + /* Only read FCOE on 82599 */ + if (hw->mac.type == ixgbe_mac_82599EB) { + adapter->stats.fcoerpdc += IXGBE_READ_REG(hw, IXGBE_FCOERPDC); + adapter->stats.fcoeprc += IXGBE_READ_REG(hw, IXGBE_FCOEPRC); + adapter->stats.fcoeptc += IXGBE_READ_REG(hw, IXGBE_FCOEPTC); + adapter->stats.fcoedwrc += IXGBE_READ_REG(hw, IXGBE_FCOEDWRC); + adapter->stats.fcoedwtc += IXGBE_READ_REG(hw, IXGBE_FCOEDWTC); + } /* Fill out the OS statistics structure */ ifp->if_ipackets = adapter->stats.gprc; @@ -5012,18 +5018,6 @@ ixgbe_add_hw_stats(struct adapter *adapt SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "mbuf_defrag_failed", CTLFLAG_RD, &adapter->mbuf_defrag_failed, "m_defrag() failed"); -#if 0 - /* These counters are not updated by the software */ - SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "mbuf_header_failed", - CTLFLAG_RD, &adapter->mbuf_header_failed, - "???"); - SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "mbuf_packet_failed", - CTLFLAG_RD, &adapter->mbuf_packet_failed, - "???"); - SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "no_tx_map_avail", - CTLFLAG_RD, &adapter->no_tx_map_avail, - "???"); -#endif SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "no_tx_dma_setup", CTLFLAG_RD, &adapter->no_tx_dma_setup, "Driver tx dma failure in xmit"); Modified: stable/8/sys/dev/ixgbe/ixgbe.h ============================================================================== --- stable/8/sys/dev/ixgbe/ixgbe.h Sat Jan 22 01:43:07 2011 (r217712) +++ stable/8/sys/dev/ixgbe/ixgbe.h Sat Jan 22 01:48:12 2011 (r217713) @@ -385,6 +385,7 @@ struct adapter { int advertise; /* link speeds */ bool link_active; u16 max_frame_size; + u16 num_segs; u32 link_speed; bool link_up; u32 linkvec; Modified: stable/8/sys/dev/ixgbe/ixgbe_82599.c ============================================================================== --- stable/8/sys/dev/ixgbe/ixgbe_82599.c Sat Jan 22 01:43:07 2011 (r217712) +++ stable/8/sys/dev/ixgbe/ixgbe_82599.c Sat Jan 22 01:48:12 2011 (r217713) @@ -67,13 +67,13 @@ s32 ixgbe_reset_hw_82599(struct ixgbe_hw s32 ixgbe_read_analog_reg8_82599(struct ixgbe_hw *hw, u32 reg, u8 *val); s32 ixgbe_write_analog_reg8_82599(struct ixgbe_hw *hw, u32 reg, u8 val); s32 ixgbe_start_hw_rev_1_82599(struct ixgbe_hw *hw); -void ixgbe_enable_relaxed_ordering_82599(struct ixgbe_hw *hw); s32 ixgbe_identify_phy_82599(struct ixgbe_hw *hw); s32 ixgbe_init_phy_ops_82599(struct ixgbe_hw *hw); u32 ixgbe_get_supported_physical_layer_82599(struct ixgbe_hw *hw); s32 ixgbe_enable_rx_dma_82599(struct ixgbe_hw *hw, u32 regval); -s32 ixgbe_get_device_caps_82599(struct ixgbe_hw *hw, u16 *device_caps); static s32 ixgbe_verify_fw_version_82599(struct ixgbe_hw *hw); +bool ixgbe_verify_lesm_fw_enabled_82599(struct ixgbe_hw *hw); + void ixgbe_init_mac_link_ops_82599(struct ixgbe_hw *hw) { @@ -101,7 +101,8 @@ void ixgbe_init_mac_link_ops_82599(struc } else { if ((ixgbe_get_media_type(hw) == ixgbe_media_type_backplane) && (hw->phy.smart_speed == ixgbe_smart_speed_auto || - hw->phy.smart_speed == ixgbe_smart_speed_on)) { + hw->phy.smart_speed == ixgbe_smart_speed_on) && + !ixgbe_verify_lesm_fw_enabled_82599(hw)) { mac->ops.setup_link = &ixgbe_setup_mac_link_smartspeed; } else { mac->ops.setup_link = &ixgbe_setup_mac_link_82599; @@ -253,7 +254,7 @@ s32 ixgbe_init_ops_82599(struct ixgbe_hw /* MAC */ mac->ops.reset_hw = &ixgbe_reset_hw_82599; - mac->ops.enable_relaxed_ordering = &ixgbe_enable_relaxed_ordering_82599; + mac->ops.enable_relaxed_ordering = &ixgbe_enable_relaxed_ordering_gen2; mac->ops.get_media_type = &ixgbe_get_media_type_82599; mac->ops.get_supported_physical_layer = &ixgbe_get_supported_physical_layer_82599; @@ -263,7 +264,7 @@ s32 ixgbe_init_ops_82599(struct ixgbe_hw mac->ops.start_hw = &ixgbe_start_hw_rev_1_82599; mac->ops.get_san_mac_addr = &ixgbe_get_san_mac_addr_generic; mac->ops.set_san_mac_addr = &ixgbe_set_san_mac_addr_generic; - mac->ops.get_device_caps = &ixgbe_get_device_caps_82599; + mac->ops.get_device_caps = &ixgbe_get_device_caps_generic; mac->ops.get_wwn_prefix = &ixgbe_get_wwn_prefix_generic; mac->ops.get_fcoe_boot_status = &ixgbe_get_fcoe_boot_status_generic; @@ -1375,7 +1376,7 @@ s32 ixgbe_init_fdir_perfect_82599(struct * @stream: input bitstream to compute the hash on * @key: 32-bit hash key **/ -u16 ixgbe_atr_compute_hash_82599(union ixgbe_atr_input *atr_input, +u32 ixgbe_atr_compute_hash_82599(union ixgbe_atr_input *atr_input, u32 key) { /* @@ -1419,54 +1420,45 @@ u16 ixgbe_atr_compute_hash_82599(union i * */ __be32 common_hash_dword = 0; - u32 hi_hash_dword, lo_hash_dword; - u16 hash_result = 0; - u8 i; + u32 hi_hash_dword, lo_hash_dword, flow_vm_vlan; + u32 hash_result = 0; + u8 i; - /* - * the hi_hash_dword starts with vlan_id, the lo_hash_dword starts - * and ends with it, the vlan at the end is added via the word swapped - * xor with the hi_hash_dword a few lines down. - */ - hi_hash_dword = IXGBE_NTOHL(atr_input->dword_stream[0]) & 0x0000FFFF; - lo_hash_dword = hi_hash_dword; + /* record the flow_vm_vlan bits as they are a key part to the hash */ + flow_vm_vlan = IXGBE_NTOHL(atr_input->dword_stream[0]); /* generate common hash dword */ - for (i = 1; i < 11; i++) - common_hash_dword ^= (u32)atr_input->dword_stream[i]; - hi_hash_dword ^= IXGBE_NTOHL(common_hash_dword); + for (i = 10; i; i -= 2) + common_hash_dword ^= atr_input->dword_stream[i] ^ + atr_input->dword_stream[i - 1]; - /* low dword is word swapped version of common with vlan added */ - lo_hash_dword ^= (hi_hash_dword >> 16) | (hi_hash_dword << 16); + hi_hash_dword = IXGBE_NTOHL(common_hash_dword); - /* hi dword is common dword with l4type and vm_pool shifted */ - hi_hash_dword ^= IXGBE_NTOHL(atr_input->dword_stream[10]) << 16; + /* low dword is word swapped version of common */ + lo_hash_dword = (hi_hash_dword >> 16) | (hi_hash_dword << 16); + + /* apply flow ID/VM pool/VLAN ID bits to hash words */ + hi_hash_dword ^= flow_vm_vlan ^ (flow_vm_vlan >> 16); + + /* Process bits 0 and 16 */ + if (key & 0x0001) hash_result ^= lo_hash_dword; + if (key & 0x00010000) hash_result ^= hi_hash_dword; /* - * Process all 32 bits of the 2 keys 2 bits at a time - * - * Bit flip vlan from hash result if hash key has bit 0 set, the - * reason for doing this is because the hash generation shouldn't - * start until bit 1 in the stream so we need to cancel out a vlan - * if it was added starting at bit 0. - */ - if (key & 0x0001) { - hash_result ^= IXGBE_NTOHL(atr_input->dword_stream[0]) & - 0x0FFFF; - hash_result ^= lo_hash_dword; - } - if (key & 0x00010000) - hash_result ^= hi_hash_dword; - - /* process the remaining bits in the key */ - for (i = 1; i < 16; i++) { - if (key & (0x0001 << i)) - hash_result ^= lo_hash_dword >> i; - if (key & (0x00010000 << i)) - hash_result ^= hi_hash_dword >> i; + * apply flow ID/VM pool/VLAN ID bits to lo hash dword, we had to + * delay this because bit 0 of the stream should not be processed + * so we do not add the vlan until after bit 0 was processed + */ + lo_hash_dword ^= flow_vm_vlan ^ (flow_vm_vlan << 16); + + + /* process the remaining 30 bits in the key 2 bits at a time */ + for (i = 15; i; i-- ) { + if (key & (0x0001 << i)) hash_result ^= lo_hash_dword >> i; + if (key & (0x00010000 << i)) hash_result ^= hi_hash_dword >> i; } - return hash_result; + return hash_result & IXGBE_ATR_HASH_MASK; } /* @@ -1479,30 +1471,18 @@ u16 ixgbe_atr_compute_hash_82599(union i #define IXGBE_COMPUTE_SIG_HASH_ITERATION(_n) \ do { \ u32 n = (_n); \ - if (IXGBE_ATR_COMMON_HASH_KEY & (0x01 << n)) { \ - if (n == 0) \ - common_hash ^= \ - IXGBE_NTOHL(atr_input->dword_stream[0]) & \ - 0x0000FFFF; \ + if (IXGBE_ATR_COMMON_HASH_KEY & (0x01 << n)) \ common_hash ^= lo_hash_dword >> n; \ - } else if (IXGBE_ATR_BUCKET_HASH_KEY & (0x01 << n)) { \ - if (n == 0) \ - bucket_hash ^= \ - IXGBE_NTOHL(atr_input->dword_stream[0]) & \ - 0x0000FFFF; \ + else if (IXGBE_ATR_BUCKET_HASH_KEY & (0x01 << n)) \ bucket_hash ^= lo_hash_dword >> n; \ - } else if (IXGBE_ATR_SIGNATURE_HASH_KEY & (0x01 << n)) { \ - if (n == 0) \ - sig_hash ^= IXGBE_NTOHL(atr_input->dword_stream[0]) & \ - 0x0000FFFF; \ - sig_hash ^= lo_hash_dword >> n; \ - } \ - if (IXGBE_ATR_COMMON_HASH_KEY & (0x010000 << n)) \ + else if (IXGBE_ATR_SIGNATURE_HASH_KEY & (0x01 << n)) \ + sig_hash ^= lo_hash_dword << (16 - n); \ + if (IXGBE_ATR_COMMON_HASH_KEY & (0x01 << (n + 16))) \ common_hash ^= hi_hash_dword >> n; \ - else if (IXGBE_ATR_BUCKET_HASH_KEY & (0x010000 << n)) \ + else if (IXGBE_ATR_BUCKET_HASH_KEY & (0x01 << (n + 16))) \ bucket_hash ^= hi_hash_dword >> n; \ - else if (IXGBE_ATR_SIGNATURE_HASH_KEY & (0x010000 << n)) \ - sig_hash ^= hi_hash_dword >> n; \ + else if (IXGBE_ATR_SIGNATURE_HASH_KEY & (0x01 << (n + 16))) \ + sig_hash ^= hi_hash_dword << (16 - n); \ } while (0); /** @@ -1515,47 +1495,35 @@ do { \ * defines, and computing two keys at once since the hashed dword stream * will be the same for both keys. **/ -static u32 ixgbe_atr_compute_sig_hash_82599(union ixgbe_atr_input *atr_input) +static u32 ixgbe_atr_compute_sig_hash_82599(union ixgbe_atr_hash_dword input, + union ixgbe_atr_hash_dword common) { - u32 hi_hash_dword, lo_hash_dword; - u16 sig_hash = 0, bucket_hash = 0, common_hash = 0; + u32 hi_hash_dword, lo_hash_dword, flow_vm_vlan; + u32 sig_hash = 0, bucket_hash = 0, common_hash = 0; - /* - * the hi_hash_dword starts with vlan_id, the lo_hash_dword starts - * and ends with it, the vlan at the end is added via the word swapped - * xor with the hi_hash_dword a few lines down. The part masked off - * is the part of the hash reserved to 0. - */ - hi_hash_dword = IXGBE_NTOHL(atr_input->dword_stream[0]) & 0x0000FFFF; - lo_hash_dword = hi_hash_dword; + /* record the flow_vm_vlan bits as they are a key part to the hash */ + flow_vm_vlan = IXGBE_NTOHL(input.dword); /* generate common hash dword */ - hi_hash_dword ^= IXGBE_NTOHL(atr_input->dword_stream[1] ^ - atr_input->dword_stream[2] ^ - atr_input->dword_stream[3] ^ - atr_input->dword_stream[4] ^ - atr_input->dword_stream[5] ^ - atr_input->dword_stream[6] ^ - atr_input->dword_stream[7] ^ - atr_input->dword_stream[8] ^ - atr_input->dword_stream[9] ^ - atr_input->dword_stream[10]); + hi_hash_dword = IXGBE_NTOHL(common.dword); /* low dword is word swapped version of common */ - lo_hash_dword ^= (hi_hash_dword >> 16) | (hi_hash_dword << 16); + lo_hash_dword = (hi_hash_dword >> 16) | (hi_hash_dword << 16); + + /* apply flow ID/VM pool/VLAN ID bits to hash words */ + hi_hash_dword ^= flow_vm_vlan ^ (flow_vm_vlan >> 16); - /* hi dword is common dword with l4type and vm_pool added */ - hi_hash_dword ^= IXGBE_NTOHL(atr_input->dword_stream[10]) << 16; + /* Process bits 0 and 16 */ + IXGBE_COMPUTE_SIG_HASH_ITERATION(0); /* - * Process all 32 bits of the 2 keys 2 bits at a time - * - * Bit flip vlan from hash result if hash key has bit 0 set, the - * reason for doing this is because the hash generation shouldn't - * start until bit 1 in the stream so we need to cancel out a vlan - * if it was added starting at bit 0. + * apply flow ID/VM pool/VLAN ID bits to lo hash dword, we had to + * delay this because bit 0 of the stream should not be processed + * so we do not add the vlan until after bit 0 was processed */ - IXGBE_COMPUTE_SIG_HASH_ITERATION(0); + lo_hash_dword ^= flow_vm_vlan ^ (flow_vm_vlan << 16); + + /* Process remaining 30 bit of the key */ IXGBE_COMPUTE_SIG_HASH_ITERATION(1); IXGBE_COMPUTE_SIG_HASH_ITERATION(2); IXGBE_COMPUTE_SIG_HASH_ITERATION(3); @@ -1573,339 +1541,14 @@ static u32 ixgbe_atr_compute_sig_hash_82 IXGBE_COMPUTE_SIG_HASH_ITERATION(15); /* combine common_hash result with signature and bucket hashes */ - sig_hash ^= common_hash; bucket_hash ^= common_hash; + bucket_hash &= IXGBE_ATR_HASH_MASK; - /* return completed signature hash */ - return ((u32)sig_hash << 16) | (bucket_hash & IXGBE_ATR_HASH_MASK); -} - -/** - * ixgbe_atr_set_vlan_id_82599 - Sets the VLAN id in the ATR input stream - * @input: input stream to modify - * @vlan: the VLAN id to load - **/ -s32 ixgbe_atr_set_vlan_id_82599(union ixgbe_atr_input *input, __be16 vlan) -{ - DEBUGFUNC("ixgbe_atr_set_vlan_id_82599"); - - input->formatted.vlan_id = vlan; - - return IXGBE_SUCCESS; -} - -/** - * ixgbe_atr_set_src_ipv4_82599 - Sets the source IPv4 address - * @input: input stream to modify - * @src_addr: the IP address to load - **/ -s32 ixgbe_atr_set_src_ipv4_82599(union ixgbe_atr_input *input, __be32 src_addr) -{ - DEBUGFUNC("ixgbe_atr_set_src_ipv4_82599"); - - input->formatted.src_ip[0] = src_addr; - - return IXGBE_SUCCESS; -} - -/** - * ixgbe_atr_set_dst_ipv4_82599 - Sets the destination IPv4 address - * @input: input stream to modify - * @dst_addr: the IP address to load - **/ -s32 ixgbe_atr_set_dst_ipv4_82599(union ixgbe_atr_input *input, __be32 dst_addr) -{ - DEBUGFUNC("ixgbe_atr_set_dst_ipv4_82599"); - - input->formatted.dst_ip[0] = dst_addr; - - return IXGBE_SUCCESS; -} - -/** - * ixgbe_atr_set_src_ipv6_82599 - Sets the source IPv6 address - * @input: input stream to modify - * @src_addr_0: the first 4 bytes of the IP address to load - * @src_addr_1: the second 4 bytes of the IP address to load - * @src_addr_2: the third 4 bytes of the IP address to load - * @src_addr_3: the fourth 4 bytes of the IP address to load - **/ -s32 ixgbe_atr_set_src_ipv6_82599(union ixgbe_atr_input *input, - __be32 src_addr_0, __be32 src_addr_1, - __be32 src_addr_2, __be32 src_addr_3) -{ - DEBUGFUNC("ixgbe_atr_set_src_ipv6_82599"); - - input->formatted.src_ip[0] = src_addr_0; - input->formatted.src_ip[1] = src_addr_1; - input->formatted.src_ip[2] = src_addr_2; - input->formatted.src_ip[3] = src_addr_3; - - return IXGBE_SUCCESS; -} - -/** - * ixgbe_atr_set_dst_ipv6_82599 - Sets the destination IPv6 address - * @input: input stream to modify - * @dst_addr_0: the first 4 bytes of the IP address to load - * @dst_addr_1: the second 4 bytes of the IP address to load - * @dst_addr_2: the third 4 bytes of the IP address to load - * @dst_addr_3: the fourth 4 bytes of the IP address to load - **/ -s32 ixgbe_atr_set_dst_ipv6_82599(union ixgbe_atr_input *input, - __be32 dst_addr_0, __be32 dst_addr_1, - __be32 dst_addr_2, __be32 dst_addr_3) -{ - DEBUGFUNC("ixgbe_atr_set_dst_ipv6_82599"); - - input->formatted.dst_ip[0] = dst_addr_0; - input->formatted.dst_ip[1] = dst_addr_1; - input->formatted.dst_ip[2] = dst_addr_2; - input->formatted.dst_ip[3] = dst_addr_3; - - return IXGBE_SUCCESS; -} - -/** - * ixgbe_atr_set_src_port_82599 - Sets the source port - * @input: input stream to modify - * @src_port: the source port to load - **/ -s32 ixgbe_atr_set_src_port_82599(union ixgbe_atr_input *input, __be16 src_port) -{ - DEBUGFUNC("ixgbe_atr_set_src_port_82599"); - - input->formatted.src_port = src_port; - - return IXGBE_SUCCESS; -} - -/** - * ixgbe_atr_set_dst_port_82599 - Sets the destination port - * @input: input stream to modify - * @dst_port: the destination port to load - **/ -s32 ixgbe_atr_set_dst_port_82599(union ixgbe_atr_input *input, __be16 dst_port) -{ - DEBUGFUNC("ixgbe_atr_set_dst_port_82599"); - - input->formatted.dst_port = dst_port; - - return IXGBE_SUCCESS; -} - -/** - * ixgbe_atr_set_flex_byte_82599 - Sets the flexible bytes - * @input: input stream to modify - * @flex_bytes: the flexible bytes to load - **/ -s32 ixgbe_atr_set_flex_byte_82599(union ixgbe_atr_input *input, __be16 flex_bytes) -{ - DEBUGFUNC("ixgbe_atr_set_flex_byte_82599"); - - input->formatted.flex_bytes = flex_bytes; - - return IXGBE_SUCCESS; -} - -/** - * ixgbe_atr_set_vm_pool_82599 - Sets the Virtual Machine pool - * @input: input stream to modify - * @vm_pool: the Virtual Machine pool to load - **/ -s32 ixgbe_atr_set_vm_pool_82599(union ixgbe_atr_input *input, u8 vm_pool) -{ - DEBUGFUNC("ixgbe_atr_set_vm_pool_82599"); - - input->formatted.vm_pool = vm_pool; - - return IXGBE_SUCCESS; -} - -/** - * ixgbe_atr_set_l4type_82599 - Sets the layer 4 packet type - * @input: input stream to modify - * @l4type: the layer 4 type value to load - * - * This call is deprecated and should be replaced with a direct access to - * input->formatted.flow_type. - **/ -s32 ixgbe_atr_set_l4type_82599(union ixgbe_atr_input *input, u8 l4type) -{ - DEBUGFUNC("ixgbe_atr_set_l4type_82599"); - - input->formatted.flow_type = l4type; - - return IXGBE_SUCCESS; -} - -/** - * ixgbe_atr_get_vlan_id_82599 - Gets the VLAN id from the ATR input stream - * @input: input stream to search - * @vlan: the VLAN id to load - **/ -s32 ixgbe_atr_get_vlan_id_82599(union ixgbe_atr_input *input, __be16 *vlan) -{ - DEBUGFUNC("ixgbe_atr_get_vlan_id_82599"); - - *vlan = input->formatted.vlan_id; - - return IXGBE_SUCCESS; -} + sig_hash ^= common_hash << 16; + sig_hash &= IXGBE_ATR_HASH_MASK << 16; -/** - * ixgbe_atr_get_src_ipv4_82599 - Gets the source IPv4 address - * @input: input stream to search - * @src_addr: the IP address to load - **/ -s32 ixgbe_atr_get_src_ipv4_82599(union ixgbe_atr_input *input, __be32 *src_addr) -{ - DEBUGFUNC("ixgbe_atr_get_src_ipv4_82599"); - - *src_addr = input->formatted.src_ip[0]; - - return IXGBE_SUCCESS; -} - -/** - * ixgbe_atr_get_dst_ipv4_82599 - Gets the destination IPv4 address - * @input: input stream to search - * @dst_addr: the IP address to load - **/ -s32 ixgbe_atr_get_dst_ipv4_82599(union ixgbe_atr_input *input, __be32 *dst_addr) -{ - DEBUGFUNC("ixgbe_atr_get_dst_ipv4_82599"); - - *dst_addr = input->formatted.dst_ip[0]; - - return IXGBE_SUCCESS; -} - -/** - * ixgbe_atr_get_src_ipv6_82599 - Gets the source IPv6 address - * @input: input stream to search - * @src_addr_0: the first 4 bytes of the IP address to load - * @src_addr_1: the second 4 bytes of the IP address to load - * @src_addr_2: the third 4 bytes of the IP address to load - * @src_addr_3: the fourth 4 bytes of the IP address to load - **/ -s32 ixgbe_atr_get_src_ipv6_82599(union ixgbe_atr_input *input, - __be32 *src_addr_0, __be32 *src_addr_1, - __be32 *src_addr_2, __be32 *src_addr_3) -{ - DEBUGFUNC("ixgbe_atr_get_src_ipv6_82599"); - - *src_addr_0 = input->formatted.src_ip[0]; - *src_addr_1 = input->formatted.src_ip[1]; - *src_addr_2 = input->formatted.src_ip[2]; - *src_addr_3 = input->formatted.src_ip[3]; - - return IXGBE_SUCCESS; -} - -/** - * ixgbe_atr_get_dst_ipv6_82599 - Gets the destination IPv6 address - * @input: input stream to search - * @dst_addr_0: the first 4 bytes of the IP address to load - * @dst_addr_1: the second 4 bytes of the IP address to load - * @dst_addr_2: the third 4 bytes of the IP address to load - * @dst_addr_3: the fourth 4 bytes of the IP address to load - **/ -s32 ixgbe_atr_get_dst_ipv6_82599(union ixgbe_atr_input *input, - __be32 *dst_addr_0, __be32 *dst_addr_1, - __be32 *dst_addr_2, __be32 *dst_addr_3) -{ - DEBUGFUNC("ixgbe_atr_get_dst_ipv6_82599"); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Jan 22 05:21:21 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 402FB1065672; Sat, 22 Jan 2011 05:21:21 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2EC3B8FC0A; Sat, 22 Jan 2011 05:21:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0M5LL61081186; Sat, 22 Jan 2011 05:21:21 GMT (envelope-from sobomax@svn.freebsd.org) Received: (from sobomax@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0M5LLc7081184; Sat, 22 Jan 2011 05:21:21 GMT (envelope-from sobomax@svn.freebsd.org) Message-Id: <201101220521.p0M5LLc7081184@svn.freebsd.org> From: Maxim Sobolev Date: Sat, 22 Jan 2011 05:21:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217714 - head/sbin/fdisk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jan 2011 05:21:21 -0000 Author: sobomax Date: Sat Jan 22 05:21:20 2011 New Revision: 217714 URL: http://svn.freebsd.org/changeset/base/217714 Log: Warn user when value entered is greated than the amount supported by the MBR for the given parameter and set that parameter to the maximum value instead of just truncating the most significant part silently. Could happen for example if the capacity of the device is more than 2TB, so that the number of sectors is greater than 2Mib. MFC after: 1 month Modified: head/sbin/fdisk/fdisk.c Modified: head/sbin/fdisk/fdisk.c ============================================================================== --- head/sbin/fdisk/fdisk.c Sat Jan 22 01:48:12 2011 (r217713) +++ head/sbin/fdisk/fdisk.c Sat Jan 22 05:21:20 2011 (r217714) @@ -62,7 +62,7 @@ static char lbuf[LBUF]; * Created. */ -#define Decimal(str, ans, tmp) if (decimal(str, &tmp, ans)) ans = tmp +#define Decimal(str, ans, tmp, size) if (decimal(str, &tmp, ans, size)) ans = tmp #define RoundCyl(x) ((((x) + cylsecs - 1) / cylsecs) * cylsecs) @@ -247,7 +247,7 @@ static int get_params(void); static int read_s0(void); static int write_s0(void); static int ok(const char *str); -static int decimal(const char *str, int *num, int deflt); +static int decimal(const char *str, int *num, int deflt, int size); static int read_config(char *config_file); static void reset_boot(void); static int sanitize_partition(struct dos_partition *); @@ -572,9 +572,9 @@ change_part(int i) } do { - Decimal("sysid (165=FreeBSD)", partp->dp_typ, tmp); - Decimal("start", partp->dp_start, tmp); - Decimal("size", partp->dp_size, tmp); + Decimal("sysid (165=FreeBSD)", partp->dp_typ, tmp, sizeof(partp->dp_typ)); + Decimal("start", partp->dp_start, tmp, sizeof(partp->dp_start)); + Decimal("size", partp->dp_size, tmp, sizeof(partp->dp_size)); if (!sanitize_partition(partp)) { warnx("ERROR: failed to adjust; setting sysid to 0"); partp->dp_typ = 0; @@ -586,9 +586,9 @@ change_part(int i) tcyl = DPCYL(partp->dp_scyl,partp->dp_ssect); thd = partp->dp_shd; tsec = DPSECT(partp->dp_ssect); - Decimal("beginning cylinder", tcyl, tmp); - Decimal("beginning head", thd, tmp); - Decimal("beginning sector", tsec, tmp); + Decimal("beginning cylinder", tcyl, tmp, sizeof(partp->dp_scyl)); + Decimal("beginning head", thd, tmp, sizeof(partp->dp_shd)); + Decimal("beginning sector", tsec, tmp, sizeof(partp->dp_ssect)); partp->dp_scyl = DOSCYL(tcyl); partp->dp_ssect = DOSSECT(tsec,tcyl); partp->dp_shd = thd; @@ -596,9 +596,9 @@ change_part(int i) tcyl = DPCYL(partp->dp_ecyl,partp->dp_esect); thd = partp->dp_ehd; tsec = DPSECT(partp->dp_esect); - Decimal("ending cylinder", tcyl, tmp); - Decimal("ending head", thd, tmp); - Decimal("ending sector", tsec, tmp); + Decimal("ending cylinder", tcyl, tmp, sizeof(partp->dp_ecyl)); + Decimal("ending head", thd, tmp, sizeof(partp->dp_ehd)); + Decimal("ending sector", tsec, tmp, sizeof(partp->dp_esect)); partp->dp_ecyl = DOSCYL(tcyl); partp->dp_esect = DOSSECT(tsec,tcyl); partp->dp_ehd = thd; @@ -647,7 +647,7 @@ change_active(int which) setactive: do { new = active; - Decimal("active partition", new, tmp); + Decimal("active partition", new, tmp, 0); if (new < 1 || new > 4) { printf("Active partition number must be in range 1-4." " Try again.\n"); @@ -677,9 +677,9 @@ get_params_to_use() { do { - Decimal("BIOS's idea of #cylinders", dos_cyls, tmp); - Decimal("BIOS's idea of #heads", dos_heads, tmp); - Decimal("BIOS's idea of #sectors", dos_sectors, tmp); + Decimal("BIOS's idea of #cylinders", dos_cyls, tmp, 0); + Decimal("BIOS's idea of #heads", dos_heads, tmp, 0); + Decimal("BIOS's idea of #sectors", dos_sectors, tmp, 0); dos_cylsecs = dos_heads * dos_sectors; print_params(); } @@ -915,11 +915,16 @@ ok(const char *str) } static int -decimal(const char *str, int *num, int deflt) +decimal(const char *str, int *num, int deflt, int size) { - int acc = 0, c; + long long acc = 0, maxval; + int c; char *cp; + if (size == 0) { + size = sizeof(*num); + } + maxval = (long long)1 << (size * 8); while (1) { printf("Supply a decimal value for \"%s\" [%d] ", str, deflt); fflush(stdout); @@ -935,14 +940,20 @@ decimal(const char *str, int *num, int d if (!c) return 0; while ((c = *cp++)) { - if (c <= '9' && c >= '0') - acc = acc * 10 + c - '0'; - else + if (c <= '9' && c >= '0') { + if (acc < maxval) + acc = acc * 10 + c - '0'; + } else break; } if (c == ' ' || c == '\t') while ((c = *cp) && (c == ' ' || c == '\t')) cp++; if (!c) { + if (acc >= maxval) { + acc = maxval - 1; + printf("%s is too big, it will be truncated to %lld\n", + lbuf, acc); + } *num = acc; return 1; } else From owner-svn-src-all@FreeBSD.ORG Sat Jan 22 07:47:48 2011 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B055106564A; Sat, 22 Jan 2011 07:47:48 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail04.syd.optusnet.com.au (mail04.syd.optusnet.com.au [211.29.132.185]) by mx1.freebsd.org (Postfix) with ESMTP id B967F8FC16; Sat, 22 Jan 2011 07:47:47 +0000 (UTC) Received: from c122-106-165-206.carlnfd1.nsw.optusnet.com.au (c122-106-165-206.carlnfd1.nsw.optusnet.com.au [122.106.165.206]) by mail04.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p0M7liWx017034 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 22 Jan 2011 18:47:45 +1100 Date: Sat, 22 Jan 2011 18:47:44 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Maxim Sobolev In-Reply-To: <201101220521.p0M5LLc7081184@svn.freebsd.org> Message-ID: <20110122172226.R13556@besplex.bde.org> References: <201101220521.p0M5LLc7081184@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r217714 - head/sbin/fdisk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jan 2011 07:47:48 -0000 On Sat, 22 Jan 2011, Maxim Sobolev wrote: > Log: > Warn user when value entered is greated than the amount supported > by the MBR for the given parameter and set that parameter to the > maximum value instead of just truncating the most significant part > silently. > > Could happen for example if the capacity of the device is more > than 2TB, so that the number of sectors is greater than 2Mib. > > MFC after: 1 month This improves some things, but has a high density of style bugs (many lines expanded beyond 80 columns...), and 2 errors in the limits. What's this 2Mib limit? ibits are strange units for sector counts. The limit should be 4G, but there is probably lots of brokenness starting at 2G. fdisk is quite broken at 2G, since it uses ints too much. > Modified: head/sbin/fdisk/fdisk.c > ============================================================================== > --- head/sbin/fdisk/fdisk.c Sat Jan 22 01:48:12 2011 (r217713) > +++ head/sbin/fdisk/fdisk.c Sat Jan 22 05:21:20 2011 (r217714) > @@ -586,9 +586,9 @@ change_part(int i) > tcyl = DPCYL(partp->dp_scyl,partp->dp_ssect); > thd = partp->dp_shd; > tsec = DPSECT(partp->dp_ssect); > - Decimal("beginning cylinder", tcyl, tmp); > - Decimal("beginning head", thd, tmp); > - Decimal("beginning sector", tsec, tmp); > + Decimal("beginning cylinder", tcyl, tmp, sizeof(partp->dp_scyl)); Cylinder numbers are 10 bits in the MBR. They don't fit in the starting and ending cylinder fields, so 2 bits of them are put in the corresponding sector fields. The sizeof here is always 1, giving only 8 bits and thus a wrong limit of 256. > + Decimal("beginning head", thd, tmp, sizeof(partp->dp_shd)); > + Decimal("beginning sector", tsec, tmp, sizeof(partp->dp_ssect)); Sector numbers are only 6 bits in the MBR. The sizeof here is always 1, giving 8 bits and thus a wrong limit of 256. > partp->dp_scyl = DOSCYL(tcyl); > partp->dp_ssect = DOSSECT(tsec,tcyl); > partp->dp_shd = thd; The DOSSECT() macro handles the details of merging cylinder bits into sector field.s Since these are the values to be written directly into the MBR, it is correct to limit them and not blindly truncate them. Non-blindly changing them is little better. They should just be rejected. There is also a lower limit on sector numbers. Sector 0 is invalid. Similarly for ending C/H/S numbers, except the breakage is larger in practice. Starting cylinder numbers are usually 0, but ending cylinder numbers are usually 1023 and now you can't edit them to anything above 255, including null changes from 1023 and changes from invalid values to the least invalid value of 1023. Older disks/devices/software may actually have between 256 and 1023 cylinders and need an MBR which matches. > @@ -647,7 +647,7 @@ change_active(int which) > setactive: > do { > new = active; > - Decimal("active partition", new, tmp); > + Decimal("active partition", new, tmp, 0); > if (new < 1 || new > 4) { > printf("Active partition number must be in range 1-4." > " Try again.\n"); This has a lower limit too, and does the necessary and correct range checking for itself. It now has to pass a bogus upper limit of 0 to Decimal() to stop checking there. Decimal() should probably handle both limits like this does. > @@ -677,9 +677,9 @@ get_params_to_use() > { > do > { > - Decimal("BIOS's idea of #cylinders", dos_cyls, tmp); > - Decimal("BIOS's idea of #heads", dos_heads, tmp); > - Decimal("BIOS's idea of #sectors", dos_sectors, tmp); > + Decimal("BIOS's idea of #cylinders", dos_cyls, tmp, 0); > + Decimal("BIOS's idea of #heads", dos_heads, tmp, 0); > + Decimal("BIOS's idea of #sectors", dos_sectors, tmp, 0); > dos_cylsecs = dos_heads * dos_sectors; > print_params(); > } I originally thought that the user values had to be accepted fairly blindly since they are multiplied out in places like here. Now I see that nothing has changed for these, but it probably should be changed to at least warn about them. There seems to be mo multiplication out involving dos_cyls. There are warnings about it being out of range all over the place. The size of the disk in sectors is mostly given not by these "dos" variables, but by the "undosed" variables cyls, heads and sectors. get_params() initializes all the "dos" variables badly by setting them to the same as to "undosed" variables in all cases. This is guranteed to give dos_cyls > 1023 on any hard disk less than about 12 years old. Note that the limits for the above are 1 more than the limits for starting and ending C/H/S, except for dos_sectors, since these values are counts while the the others are offsets from 0 (except starting/ending sectors are offset froms 1). > @@ -915,11 +915,16 @@ ok(const char *str) > } > > static int > -decimal(const char *str, int *num, int deflt) > +decimal(const char *str, int *num, int deflt, int size) > { > - int acc = 0, c; > + long long acc = 0, maxval; Long long is an abomination, and there is no reason to use any type larger than uint32_t here. > + int c; > char *cp; > > + if (size == 0) { > + size = sizeof(*num); > + } > + maxval = (long long)1 << (size * 8); This is not the maximum value, but a limit value which is 1 greater than the maximum. OK, you need a type larger than uint32_t to go 1 greater than its maximum, and you get that when `size' is 4. A better interface passing the maximum (_not_ 1 greater) wouldn't have that problem. And decimal() still returns int, so overflow occurs long before that UNIT32_MAX+1LL. Sector numbers are 32 bits unsigned, so int is inadequate to describe them, but this program uses int for them in many other places, e.g., 'disksecs = cyls * heads * sectors' first has an overflowing multiplication and then assigns the overflowed value to "int disksecs" where it won't fit :-(. > while (1) { > printf("Supply a decimal value for \"%s\" [%d] ", str, deflt); > fflush(stdout); > @@ -935,14 +940,20 @@ decimal(const char *str, int *num, int d > if (!c) > return 0; > while ((c = *cp++)) { > - if (c <= '9' && c >= '0') > - acc = acc * 10 + c - '0'; > - else > + if (c <= '9' && c >= '0') { > + if (acc < maxval) > + acc = acc * 10 + c - '0'; > + } else > break; > } Ugh, didn't people learn to use strtol() instead of home made parsing of numbers with overflow errors in 1985? Now it has enough range checking to prevent overflow of (acc * 10) provided maxval is limited to LONG_LONG_MAX / 10. Might need a slightly lower limit for adding c. decimal() doesn't seem to support negative numbers, so nothing needs to check for them. Bruce From owner-svn-src-all@FreeBSD.ORG Sat Jan 22 11:27:11 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 173A01065673; Sat, 22 Jan 2011 11:27:11 +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 04F658FC1C; Sat, 22 Jan 2011 11:27:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0MBRAnf089976; Sat, 22 Jan 2011 11:27:10 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0MBRAkc089974; Sat, 22 Jan 2011 11:27:10 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201101221127.p0MBRAkc089974@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 22 Jan 2011 11:27:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217715 - stable/8/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jan 2011 11:27:11 -0000 Author: kib Date: Sat Jan 22 11:27:10 2011 New Revision: 217715 URL: http://svn.freebsd.org/changeset/base/217715 Log: MFC r217463: For consistency, use kernel_object instead of &kernel_object_store when initializing the object mutex. Do the same for kmem_object. Modified: stable/8/sys/vm/vm_object.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/vm/vm_object.c ============================================================================== --- stable/8/sys/vm/vm_object.c Sat Jan 22 05:21:20 2011 (r217714) +++ stable/8/sys/vm/vm_object.c Sat Jan 22 11:27:10 2011 (r217715) @@ -248,7 +248,7 @@ vm_object_init(void) TAILQ_INIT(&vm_object_list); mtx_init(&vm_object_list_mtx, "vm object_list", NULL, MTX_DEF); - VM_OBJECT_LOCK_INIT(&kernel_object_store, "kernel object"); + VM_OBJECT_LOCK_INIT(kernel_object, "kernel object"); _vm_object_allocate(OBJT_PHYS, OFF_TO_IDX(VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS), kernel_object); #if VM_NRESERVLEVEL > 0 @@ -256,7 +256,7 @@ vm_object_init(void) kernel_object->pg_color = (u_short)atop(VM_MIN_KERNEL_ADDRESS); #endif - VM_OBJECT_LOCK_INIT(&kmem_object_store, "kmem object"); + VM_OBJECT_LOCK_INIT(kmem_object, "kmem object"); _vm_object_allocate(OBJT_PHYS, OFF_TO_IDX(VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS), kmem_object); #if VM_NRESERVLEVEL > 0 From owner-svn-src-all@FreeBSD.ORG Sat Jan 22 11:29:13 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A397F1065670; Sat, 22 Jan 2011 11:29:13 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 91E468FC0A; Sat, 22 Jan 2011 11:29:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0MBTDgW090061; Sat, 22 Jan 2011 11:29:13 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0MBTDH3090059; Sat, 22 Jan 2011 11:29:13 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201101221129.p0MBTDH3090059@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 22 Jan 2011 11:29:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217716 - stable/8/sys/dev/md X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jan 2011 11:29:13 -0000 Author: kib Date: Sat Jan 22 11:29:13 2011 New Revision: 217716 URL: http://svn.freebsd.org/changeset/base/217716 Log: MFC r217583: Add missed (). Modified: stable/8/sys/dev/md/md.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/md/md.c ============================================================================== --- stable/8/sys/dev/md/md.c Sat Jan 22 11:27:10 2011 (r217715) +++ stable/8/sys/dev/md/md.c Sat Jan 22 11:29:13 2011 (r217716) @@ -854,8 +854,8 @@ mdcreate_malloc(struct md_s *sc, struct nsectors = sc->mediasize / sc->sectorsize; for (u = 0; u < nsectors; u++) { - sp = (uintptr_t)uma_zalloc(sc->uma, md_malloc_wait ? - M_WAITOK : M_NOWAIT | M_ZERO); + sp = (uintptr_t)uma_zalloc(sc->uma, (md_malloc_wait ? + M_WAITOK : M_NOWAIT) | M_ZERO); if (sp != 0) error = s_write(sc->indir, u, sp); else From owner-svn-src-all@FreeBSD.ORG Sat Jan 22 13:18:28 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D3DA106566C; Sat, 22 Jan 2011 13:18:28 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5C45E8FC0C; Sat, 22 Jan 2011 13:18:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0MDISh3092787; Sat, 22 Jan 2011 13:18:28 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0MDISC5092785; Sat, 22 Jan 2011 13:18:28 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201101221318.p0MDISC5092785@svn.freebsd.org> From: Glen Barber Date: Sat, 22 Jan 2011 13:18: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: r217717 - head/share/man/man5 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jan 2011 13:18:28 -0000 Author: gjb (doc committer) Date: Sat Jan 22 13:18:28 2011 New Revision: 217717 URL: http://svn.freebsd.org/changeset/base/217717 Log: Fix '.Xr' ordering in SEE ALSO section. Approved by: keramida (mentor) MFC after: 3 days Modified: head/share/man/man5/devfs.5 Modified: head/share/man/man5/devfs.5 ============================================================================== --- head/share/man/man5/devfs.5 Sat Jan 22 11:29:13 2011 (r217716) +++ head/share/man/man5/devfs.5 Sat Jan 22 13:18:28 2011 (r217717) @@ -105,8 +105,8 @@ volume located on .Pp .Dl "mount -t devfs devfs /mychroot/dev" .Sh SEE ALSO -.Xr devfs 8 , .Xr fdescfs 5 , +.Xr devfs 8 , .Xr mount 8 .Sh HISTORY The From owner-svn-src-all@FreeBSD.ORG Sat Jan 22 13:52:24 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 01D2D106564A; Sat, 22 Jan 2011 13:52:24 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E47BA8FC08; Sat, 22 Jan 2011 13:52:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0MDqNDY093633; Sat, 22 Jan 2011 13:52:23 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0MDqNt3093630; Sat, 22 Jan 2011 13:52:23 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201101221352.p0MDqNt3093630@svn.freebsd.org> From: Hans Petter Selasky Date: Sat, 22 Jan 2011 13:52: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: r217718 - in head/sys: conf dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jan 2011 13:52:24 -0000 Author: hselasky Date: Sat Jan 22 13:52:23 2011 New Revision: 217718 URL: http://svn.freebsd.org/changeset/base/217718 Log: Allow USB_HOST_ALIGN to be configured at compile time. This patch is necessary for MIPS based RouterStation Pro board and maybe other MIPS based boards as well. Submitted by: Milan Obuch Approved by: thompsa (mentor) Modified: head/sys/conf/options head/sys/dev/usb/usb_freebsd.h Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Sat Jan 22 13:18:28 2011 (r217717) +++ head/sys/conf/options Sat Jan 22 13:52:23 2011 (r217718) @@ -642,6 +642,7 @@ BUS_DEBUG opt_bus.h # options for USB support USB_DEBUG opt_usb.h +USB_HOST_ALIGN opt_usb.h USB_REQ_DEBUG opt_usb.h USB_VERBOSE opt_usb.h USB_EHCI_BIG_ENDIAN_DESC opt_usb.h Modified: head/sys/dev/usb/usb_freebsd.h ============================================================================== --- head/sys/dev/usb/usb_freebsd.h Sat Jan 22 13:18:28 2011 (r217717) +++ head/sys/dev/usb/usb_freebsd.h Sat Jan 22 13:52:23 2011 (r217718) @@ -46,7 +46,12 @@ #define USB_TD_GET_PROC(td) (td)->td_proc #define USB_PROC_GET_GID(td) (td)->p_pgid +#if defined(USB_HOST_ALIGN) && (USB_HOST_ALIGN != 0) +/* USB_HOST_ALIGN is already defined and valid */ +#else +#undef USB_HOST_ALIGN #define USB_HOST_ALIGN 8 /* bytes, must be power of two */ +#endif #define USB_FS_ISOC_UFRAME_MAX 4 /* exclusive unit */ #define USB_BUS_MAX 256 /* units */ #define USB_MAX_DEVICES 128 /* units */ From owner-svn-src-all@FreeBSD.ORG Sat Jan 22 15:09:23 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 74C53106566B; Sat, 22 Jan 2011 15:09:23 +0000 (UTC) (envelope-from gljennjohn@googlemail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id A686F8FC15; Sat, 22 Jan 2011 15:09:22 +0000 (UTC) Received: by fxm16 with SMTP id 16so2897583fxm.13 for ; Sat, 22 Jan 2011 07:09:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:date:from:to:cc:subject:message-id:in-reply-to :references:reply-to:x-mailer:mime-version:content-type :content-transfer-encoding; bh=+YMpy+Pj4xSOHw7x127H8vorgdyQ2EFcubuK85lgZF8=; b=j96wiDM/mOi7JmuHkxcm4A4oWH0iJCXbKVnJkm/n0dIkl06qE+rdj7Ba9xW5RBn8JO 2zb8NI+2QyhFjNKZN20n1ALRivtheVp9OSUQJDzIypsojid0dRR8/4bPIVZvJYTe3tFf ExCddsbB4jeI/ASwqqvhIY5OpyrlqANT9bjnQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=date:from:to:cc:subject:message-id:in-reply-to:references:reply-to :x-mailer:mime-version:content-type:content-transfer-encoding; b=QepKrZveyr3so79i4BIO0Pt2QXBkGNEat7xItJuZ+GNwMtBfWYmImtq80j2RWLZUbv ywBVG4m/AVFpfACGDLkLowBWSgHqI079Mjuau366Lm+c58ofG2sXBghHsA62UkayzARQ 24bCorgGNbvEVqY8M2lBPKxUAsqKTZFwhu/eU= Received: by 10.223.93.140 with SMTP id v12mr2011667fam.96.1295708961456; Sat, 22 Jan 2011 07:09:21 -0800 (PST) Received: from ernst.jennejohn.org (p578E3BC5.dip.t-dialin.net [87.142.59.197]) by mx.google.com with ESMTPS id n7sm3991602fam.35.2011.01.22.07.09.20 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 22 Jan 2011 07:09:21 -0800 (PST) Date: Sat, 22 Jan 2011 16:09:18 +0100 From: Gary Jennejohn To: Hans Petter Selasky Message-ID: <20110122160918.373f8670@ernst.jennejohn.org> In-Reply-To: <201101221352.p0MDqNt3093630@svn.freebsd.org> References: <201101221352.p0MDqNt3093630@svn.freebsd.org> X-Mailer: Claws Mail 3.7.8 (GTK+ 2.18.7; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r217718 - in head/sys: conf dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: gljennjohn@googlemail.com List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jan 2011 15:09:23 -0000 On Sat, 22 Jan 2011 13:52:23 +0000 (UTC) Hans Petter Selasky wrote: > Author: hselasky > Date: Sat Jan 22 13:52:23 2011 > New Revision: 217718 > URL: http://svn.freebsd.org/changeset/base/217718 > > Log: > Allow USB_HOST_ALIGN to be configured at compile time. This patch is > necessary for MIPS based RouterStation Pro board and maybe other MIPS > based boards as well. > > Submitted by: Milan Obuch > Approved by: thompsa (mentor) > > Modified: > head/sys/conf/options > head/sys/dev/usb/usb_freebsd.h > > Modified: head/sys/conf/options > ============================================================================== > --- head/sys/conf/options Sat Jan 22 13:18:28 2011 (r217717) > +++ head/sys/conf/options Sat Jan 22 13:52:23 2011 (r217718) > @@ -642,6 +642,7 @@ BUS_DEBUG opt_bus.h > > # options for USB support > USB_DEBUG opt_usb.h > +USB_HOST_ALIGN opt_usb.h > USB_REQ_DEBUG opt_usb.h > USB_VERBOSE opt_usb.h > USB_EHCI_BIG_ENDIAN_DESC opt_usb.h > > Modified: head/sys/dev/usb/usb_freebsd.h > ============================================================================== > --- head/sys/dev/usb/usb_freebsd.h Sat Jan 22 13:18:28 2011 (r217717) > +++ head/sys/dev/usb/usb_freebsd.h Sat Jan 22 13:52:23 2011 (r217718) > @@ -46,7 +46,12 @@ > #define USB_TD_GET_PROC(td) (td)->td_proc > #define USB_PROC_GET_GID(td) (td)->p_pgid > > +#if defined(USB_HOST_ALIGN) && (USB_HOST_ALIGN != 0) > +/* USB_HOST_ALIGN is already defined and valid */ > Not necessarily valid. What if the user sets it to -24? The compiler will happily accept that with the above #if-statement. IMO you should test for USB_HOST_ALIGN > 0, which should always work. Defensive programming is always a good idea. > +#else > +#undef USB_HOST_ALIGN > #define USB_HOST_ALIGN 8 /* bytes, must be power of two */ > +#endif > #define USB_FS_ISOC_UFRAME_MAX 4 /* exclusive unit */ > #define USB_BUS_MAX 256 /* units */ > #define USB_MAX_DEVICES 128 /* units */ > _______________________________________________ > svn-src-all@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" -- Gary Jennejohn From owner-svn-src-all@FreeBSD.ORG Sat Jan 22 15:19:26 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4FF0C1065675; Sat, 22 Jan 2011 15:19:26 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3F4BC8FC13; Sat, 22 Jan 2011 15:19:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0MFJQdK096112; Sat, 22 Jan 2011 15:19:26 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0MFJQKv096110; Sat, 22 Jan 2011 15:19:26 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201101221519.p0MFJQKv096110@svn.freebsd.org> From: Jaakko Heinonen Date: Sat, 22 Jan 2011 15:19:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217719 - head/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jan 2011 15:19:26 -0000 Author: jh Date: Sat Jan 22 15:19:25 2011 New Revision: 217719 URL: http://svn.freebsd.org/changeset/base/217719 Log: Fix typos. Modified: head/share/man/man9/make_dev.9 Modified: head/share/man/man9/make_dev.9 ============================================================================== --- head/share/man/man9/make_dev.9 Sat Jan 22 13:52:23 2011 (r217718) +++ head/share/man/man9/make_dev.9 Sat Jan 22 15:19:25 2011 (r217719) @@ -326,16 +326,16 @@ call will fail and the device will be no .It Bq Er ENOMEM The .Dv MAKEDEV_NOWAIT -flags was specified and a memory allocation request could not be satisfied. +flag was specified and a memory allocation request could not be satisfied. .It Bq Er ENAMETOOLONG The .Dv MAKEDEV_CHECKNAME -flags was specified and the provided device name is longer than +flag was specified and the provided device name is longer than .Dv SPECNAMELEN . .It Bq Er EINVAL The .Dv MAKEDEV_CHECKNAME -flags was specified and the provided device name is empty, contains a +flag was specified and the provided device name is empty, contains a .Qq \&. or .Qq .. @@ -344,7 +344,7 @@ path component or ends with .It Bq Er EEXIST The .Dv MAKEDEV_CHECKNAME -flags was specified and the provided device name already exists. +flag was specified and the provided device name already exists. .El .Pp .Sh SEE ALSO From owner-svn-src-all@FreeBSD.ORG Sat Jan 22 17:49:37 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE150106564A; Sat, 22 Jan 2011 17:49: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 AD4C48FC08; Sat, 22 Jan 2011 17:49:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0MHnb5n099571; Sat, 22 Jan 2011 17:49:37 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0MHnbip099569; Sat, 22 Jan 2011 17:49:37 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201101221749.p0MHnbip099569@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 22 Jan 2011 17:49:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217720 - releng/8.2/lib/csu/i386-elf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jan 2011 17:49:37 -0000 Author: kib Date: Sat Jan 22 17:49:37 2011 New Revision: 217720 URL: http://svn.freebsd.org/changeset/base/217720 Log: MFC r217383: The (%esp & 0xf) == 0 should be true before the call instruction is executed, for the properly aligned stack. Approved by: re (bz) Modified: releng/8.2/lib/csu/i386-elf/crt1_s.S Directory Properties: releng/8.2/lib/csu/ (props changed) Modified: releng/8.2/lib/csu/i386-elf/crt1_s.S ============================================================================== --- releng/8.2/lib/csu/i386-elf/crt1_s.S Sat Jan 22 15:19:25 2011 (r217719) +++ releng/8.2/lib/csu/i386-elf/crt1_s.S Sat Jan 22 17:49:37 2011 (r217720) @@ -40,6 +40,7 @@ _start: .cfi_def_cfa_register %ebp andl $0xfffffff0,%esp # align stack leal 8(%ebp),%eax + subl $4,%esp pushl %eax # argv pushl 4(%ebp) # argc pushl %edx # rtld cleanup From owner-svn-src-all@FreeBSD.ORG Sat Jan 22 19:15:40 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4E3BB1065694; Sat, 22 Jan 2011 19:15:40 +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 3D8348FC1B; Sat, 22 Jan 2011 19:15:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0MJFeft001735; Sat, 22 Jan 2011 19:15:40 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0MJFeUH001733; Sat, 22 Jan 2011 19:15:40 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201101221915.p0MJFeUH001733@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 22 Jan 2011 19:15:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217721 - releng/7.4/lib/csu/i386-elf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jan 2011 19:15:40 -0000 Author: kib Date: Sat Jan 22 19:15:39 2011 New Revision: 217721 URL: http://svn.freebsd.org/changeset/base/217721 Log: MFC r217383: The (%esp & 0xf) == 0 should be true before the call instruction is executed, for the properly aligned stack. Approved by: re (bz) Modified: releng/7.4/lib/csu/i386-elf/crt1_s.S Directory Properties: releng/7.4/lib/csu/ (props changed) Modified: releng/7.4/lib/csu/i386-elf/crt1_s.S ============================================================================== --- releng/7.4/lib/csu/i386-elf/crt1_s.S Sat Jan 22 17:49:37 2011 (r217720) +++ releng/7.4/lib/csu/i386-elf/crt1_s.S Sat Jan 22 19:15:39 2011 (r217721) @@ -35,6 +35,7 @@ _start: xorl %ebp,%ebp movl %esp,%ebp andl $0xfffffff0,%esp # align stack leal 8(%ebp),%eax + subl $4,%esp pushl %eax # argv pushl 4(%ebp) # argc pushl %edx # rtld cleanup From owner-svn-src-all@FreeBSD.ORG Sat Jan 22 19:25:49 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8AEC3106566C; Sat, 22 Jan 2011 19:25:49 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7A6758FC12; Sat, 22 Jan 2011 19:25:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0MJPnF7002020; Sat, 22 Jan 2011 19:25:49 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0MJPnvW002018; Sat, 22 Jan 2011 19:25:49 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201101221925.p0MJPnvW002018@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 22 Jan 2011 19:25: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: r217722 - head/libexec/rtld-elf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jan 2011 19:25:49 -0000 Author: kib Date: Sat Jan 22 19:25:49 2011 New Revision: 217722 URL: http://svn.freebsd.org/changeset/base/217722 Log: Add my copyright. Discussed with: kan Modified: head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Sat Jan 22 19:15:39 2011 (r217721) +++ head/libexec/rtld-elf/rtld.c Sat Jan 22 19:25:49 2011 (r217722) @@ -1,6 +1,7 @@ /*- * Copyright 1996, 1997, 1998, 1999, 2000 John D. Polstra. * Copyright 2003 Alexander Kabaev . + * Copyright 2009, 2010, 2011 Konstantin Belousov . * All rights reserved. * * Redistribution and use in source and binary forms, with or without From owner-svn-src-all@FreeBSD.ORG Sat Jan 22 20:00:25 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1AB92106566B; Sat, 22 Jan 2011 20:00:25 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0953F8FC08; Sat, 22 Jan 2011 20:00:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0MK0OKg002827; Sat, 22 Jan 2011 20:00:24 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0MK0OOC002825; Sat, 22 Jan 2011 20:00:24 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201101222000.p0MK0OOC002825@svn.freebsd.org> From: Jack F Vogel Date: Sat, 22 Jan 2011 20:00:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217723 - stable/7/sys/dev/e1000 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jan 2011 20:00:25 -0000 Author: jfv Date: Sat Jan 22 20:00:24 2011 New Revision: 217723 URL: http://svn.freebsd.org/changeset/base/217723 Log: MFC rev 217295 Modified: stable/7/sys/dev/e1000/if_em.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/e1000/if_em.c ============================================================================== --- stable/7/sys/dev/e1000/if_em.c Sat Jan 22 19:25:49 2011 (r217722) +++ stable/7/sys/dev/e1000/if_em.c Sat Jan 22 20:00:24 2011 (r217723) @@ -90,7 +90,7 @@ int em_display_debug_stats = 0; /********************************************************************* * Driver version: *********************************************************************/ -char em_driver_version[] = "7.1.8"; +char em_driver_version[] = "7.1.9"; /********************************************************************* * PCI Device ID Table @@ -1788,14 +1788,23 @@ em_xmit(struct tx_ring *txr, struct mbuf error = bus_dmamap_load_mbuf_sg(txr->txtag, map, *m_headp, segs, &nsegs, BUS_DMA_NOWAIT); - if (error) { + if (error == ENOMEM) { + adapter->no_tx_dma_setup++; + return (error); + } else if (error != 0) { adapter->no_tx_dma_setup++; m_freem(*m_headp); *m_headp = NULL; return (error); } + + } else if (error == ENOMEM) { + adapter->no_tx_dma_setup++; + return (error); } else if (error != 0) { adapter->no_tx_dma_setup++; + m_freem(*m_headp); + *m_headp = NULL; return (error); } @@ -2077,7 +2086,6 @@ hung: txr->me, txr->tx_avail, txr->next_to_clean); ifp->if_drv_flags &= ~IFF_DRV_RUNNING; adapter->watchdog_events++; - EM_TX_UNLOCK(txr); em_init_locked(adapter); } From owner-svn-src-all@FreeBSD.ORG Sat Jan 22 20:01:46 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B7DC106566B; Sat, 22 Jan 2011 20:01:46 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7A3038FC1E; Sat, 22 Jan 2011 20:01:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0MK1kCP002909; Sat, 22 Jan 2011 20:01:46 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0MK1kTg002907; Sat, 22 Jan 2011 20:01:46 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201101222001.p0MK1kTg002907@svn.freebsd.org> From: Jack F Vogel Date: Sat, 22 Jan 2011 20:01:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217724 - stable/7/sys/dev/e1000 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jan 2011 20:01:46 -0000 Author: jfv Date: Sat Jan 22 20:01:46 2011 New Revision: 217724 URL: http://svn.freebsd.org/changeset/base/217724 Log: MFC rev 217591 Modified: stable/7/sys/dev/e1000/if_em.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/e1000/if_em.c ============================================================================== --- stable/7/sys/dev/e1000/if_em.c Sat Jan 22 20:00:24 2011 (r217723) +++ stable/7/sys/dev/e1000/if_em.c Sat Jan 22 20:01:46 2011 (r217724) @@ -1699,12 +1699,12 @@ em_xmit(struct tx_ring *txr, struct mbuf } ip = (struct ip *)(mtod(m_head, char *) + ip_off); poff = ip_off + (ip->ip_hl << 2); - m_head = m_pullup(m_head, poff + sizeof(struct tcphdr)); - if (m_head == NULL) { - *m_headp = NULL; - return (ENOBUFS); - } if (do_tso) { + m_head = m_pullup(m_head, poff + sizeof(struct tcphdr)); + if (m_head == NULL) { + *m_headp = NULL; + return (ENOBUFS); + } tp = (struct tcphdr *)(mtod(m_head, char *) + poff); /* * TSO workaround: @@ -1728,6 +1728,11 @@ em_xmit(struct tx_ring *txr, struct mbuf tp->th_sum = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr, htons(IPPROTO_TCP)); } else if (m_head->m_pkthdr.csum_flags & CSUM_TCP) { + m_head = m_pullup(m_head, poff + sizeof(struct tcphdr)); + if (m_head == NULL) { + *m_headp = NULL; + return (ENOBUFS); + } tp = (struct tcphdr *)(mtod(m_head, char *) + poff); m_head = m_pullup(m_head, poff + (tp->th_off << 2)); if (m_head == NULL) { From owner-svn-src-all@FreeBSD.ORG Sat Jan 22 20:53:27 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 87A2F106566B; Sat, 22 Jan 2011 20:53:27 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 76E818FC18; Sat, 22 Jan 2011 20:53:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0MKrRGj004129; Sat, 22 Jan 2011 20:53:27 GMT (envelope-from dchagin@svn.freebsd.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0MKrR8K004127; Sat, 22 Jan 2011 20:53:27 GMT (envelope-from dchagin@svn.freebsd.org) Message-Id: <201101222053.p0MKrR8K004127@svn.freebsd.org> From: Dmitry Chagin Date: Sat, 22 Jan 2011 20:53: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: r217725 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jan 2011 20:53:27 -0000 Author: dchagin Date: Sat Jan 22 20:53:27 2011 New Revision: 217725 URL: http://svn.freebsd.org/changeset/base/217725 Log: Option USB_HOST_ALIGN declared twice. Approved by: kib(mentor) Modified: head/sys/conf/options Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Sat Jan 22 20:01:46 2011 (r217724) +++ head/sys/conf/options Sat Jan 22 20:53:27 2011 (r217725) @@ -642,7 +642,6 @@ BUS_DEBUG opt_bus.h # options for USB support USB_DEBUG opt_usb.h -USB_HOST_ALIGN opt_usb.h USB_REQ_DEBUG opt_usb.h USB_VERBOSE opt_usb.h USB_EHCI_BIG_ENDIAN_DESC opt_usb.h From owner-svn-src-all@FreeBSD.ORG Sat Jan 22 21:27:17 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8CE68106564A; Sat, 22 Jan 2011 21:27:17 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7B82F8FC20; Sat, 22 Jan 2011 21:27:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0MLRHBa004975; Sat, 22 Jan 2011 21:27:17 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0MLRHS2004973; Sat, 22 Jan 2011 21:27:17 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201101222127.p0MLRHS2004973@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 22 Jan 2011 21:27: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: r217726 - head/sbin/growfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jan 2011 21:27:17 -0000 Author: marcel Date: Sat Jan 22 21:27:17 2011 New Revision: 217726 URL: http://svn.freebsd.org/changeset/base/217726 Log: s/utime/modtime/g -- utime shadows utime(3). Submitted by: Garrett Cooper Modified: head/sbin/growfs/growfs.c Modified: head/sbin/growfs/growfs.c ============================================================================== --- head/sbin/growfs/growfs.c Sat Jan 22 20:53:27 2011 (r217725) +++ head/sbin/growfs/growfs.c Sat Jan 22 21:27:17 2011 (r217726) @@ -174,7 +174,7 @@ static void growfs(int fsi, int fso, unsigned int Nflag) { DBG_FUNC("growfs") - time_t utime; + time_t modtime; uint cylno; int i, j, width; char tmpbuf[100]; @@ -192,7 +192,7 @@ growfs(int fsi, int fso, unsigned int Nf DBG_ENTER; #endif /* FSIRAND */ - time(&utime); + time(&modtime); /* * Get the cylinder summary into the memory. @@ -228,7 +228,7 @@ growfs(int fsi, int fso, unsigned int Nf /* * Do all needed changes in the former last cylinder group. */ - updjcg(osblock.fs_ncg-1, utime, fsi, fso, Nflag); + updjcg(osblock.fs_ncg-1, modtime, fsi, fso, Nflag); /* * Dump out summary information about file system. @@ -257,7 +257,7 @@ growfs(int fsi, int fso, unsigned int Nf * Iterate for only the new cylinder groups. */ for (cylno = osblock.fs_ncg; cylno < sblock.fs_ncg; cylno++) { - initcg(cylno, utime, fso, Nflag); + initcg(cylno, modtime, fso, Nflag); j = sprintf(tmpbuf, " %jd%s", (intmax_t)fsbtodb(&sblock, cgsblock(&sblock, cylno)), cylno < (sblock.fs_ncg-1) ? "," : "" ); @@ -275,7 +275,7 @@ growfs(int fsi, int fso, unsigned int Nf * Do all needed changes in the first cylinder group. * allocate blocks in new location */ - updcsloc(utime, fsi, fso, Nflag); + updcsloc(modtime, fsi, fso, Nflag); /* * Now write the cylinder summary back to disk. @@ -307,7 +307,7 @@ growfs(int fsi, int fso, unsigned int Nf /* * Now write the new superblock back to disk. */ - sblock.fs_time = utime; + sblock.fs_time = modtime; wtfs(sblockloc, (size_t)SBLOCKSIZE, (void *)&sblock, fso, Nflag); DBG_PRINT0("sblock written\n"); DBG_DUMP_FS(&sblock, @@ -368,7 +368,7 @@ growfs(int fsi, int fso, unsigned int Nf * provisions for that case are removed here. */ static void -initcg(int cylno, time_t utime, int fso, unsigned int Nflag) +initcg(int cylno, time_t modtime, int fso, unsigned int Nflag) { DBG_FUNC("initcg") static caddr_t iobuf; @@ -396,7 +396,7 @@ initcg(int cylno, time_t utime, int fso, dupper += howmany(sblock.fs_cssize, sblock.fs_fsize); cs = &fscs[cylno]; memset(&acg, 0, sblock.fs_cgsize); - acg.cg_time = utime; + acg.cg_time = modtime; acg.cg_magic = CG_MAGIC; acg.cg_cgx = cylno; acg.cg_niblk = sblock.fs_ipg; @@ -680,7 +680,7 @@ cond_bl_upd(ufs2_daddr_t *block, struct * tables and cluster summary during all those operations. */ static void -updjcg(int cylno, time_t utime, int fsi, int fso, unsigned int Nflag) +updjcg(int cylno, time_t modtime, int fsi, int fso, unsigned int Nflag) { DBG_FUNC("updjcg") ufs2_daddr_t cbase, dmax, dupper; @@ -747,7 +747,7 @@ updjcg(int cylno, time_t utime, int fsi, * Touch the cylinder group, update all fields in the cylinder group as * needed, update the free space in the superblock. */ - acg.cg_time = utime; + acg.cg_time = modtime; if ((unsigned)cylno == sblock.fs_ncg - 1) { /* * This is still the last cylinder group. @@ -935,7 +935,7 @@ updjcg(int cylno, time_t utime, int fsi, * completely avoid implementing copy on write if we stick to method (2) only. */ static void -updcsloc(time_t utime, int fsi, int fso, unsigned int Nflag) +updcsloc(time_t modtime, int fsi, int fso, unsigned int Nflag) { DBG_FUNC("updcsloc") struct csum *cs; @@ -983,7 +983,7 @@ updcsloc(time_t utime, int fsi, int fso, * Touch the cylinder group, set up local variables needed later * and update the superblock. */ - acg.cg_time = utime; + acg.cg_time = modtime; /* * XXX In the case of having active snapshots we may need much more From owner-svn-src-all@FreeBSD.ORG Sat Jan 22 21:33:18 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0B1710656C0; Sat, 22 Jan 2011 21:33:18 +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 BFCCA8FC19; Sat, 22 Jan 2011 21:33:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0MLXIUm005142; Sat, 22 Jan 2011 21:33:18 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0MLXI4f005140; Sat, 22 Jan 2011 21:33:18 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201101222133.p0MLXI4f005140@svn.freebsd.org> From: Andrew Thompson Date: Sat, 22 Jan 2011 21:33: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: r217727 - head/sys/dev/if_ndis X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jan 2011 21:33:18 -0000 Author: thompsa Date: Sat Jan 22 21:33:18 2011 New Revision: 217727 URL: http://svn.freebsd.org/changeset/base/217727 Log: Revert the ndis part of r212122, windrv_stub.c already adds a MODULE_VERSION and this breaks loading miniport drivers from loader.conf Reported by: Yuri Submitted by: Paul B Mahol MFC after: 3 days Modified: head/sys/dev/if_ndis/if_ndis_usb.c Modified: head/sys/dev/if_ndis/if_ndis_usb.c ============================================================================== --- head/sys/dev/if_ndis/if_ndis_usb.c Sat Jan 22 21:27:17 2011 (r217726) +++ head/sys/dev/if_ndis/if_ndis_usb.c Sat Jan 22 21:33:18 2011 (r217727) @@ -107,7 +107,6 @@ static driver_t ndis_driver = { static devclass_t ndis_devclass; DRIVER_MODULE(ndis, uhub, ndis_driver, ndis_devclass, ndisdrv_modevent, 0); -MODULE_VERSION(ndis, 1); static int ndisusb_devcompare(interface_type bustype, struct ndis_usb_type *t, device_t dev) From owner-svn-src-all@FreeBSD.ORG Sat Jan 22 22:31:55 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DAA61106566B; Sat, 22 Jan 2011 22:31:55 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C99518FC14; Sat, 22 Jan 2011 22:31:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0MMVtdl006580; Sat, 22 Jan 2011 22:31:55 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0MMVthK006578; Sat, 22 Jan 2011 22:31:55 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201101222231.p0MMVthK006578@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 22 Jan 2011 22:31: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: r217729 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jan 2011 22:31:55 -0000 Author: pjd Date: Sat Jan 22 22:31:55 2011 New Revision: 217729 URL: http://svn.freebsd.org/changeset/base/217729 Log: - On primary worker reload, update hr_exec field. - Update comment. MFC after: 1 week Modified: head/sbin/hastd/hastd.c Modified: head/sbin/hastd/hastd.c ============================================================================== --- head/sbin/hastd/hastd.c Sat Jan 22 22:18:47 2011 (r217728) +++ head/sbin/hastd/hastd.c Sat Jan 22 22:31:55 2011 (r217729) @@ -306,8 +306,9 @@ hastd_reload(void) * recreating it. * * We do just reload (send SIGHUP to worker process) if we act as - * PRIMARY, but only remote address, replication mode and timeout - * has changed. For those, there is no need to restart worker process. + * PRIMARY, but only if remote address, replication mode, timeout or + * execution path has changed. For those, there is no need to restart + * worker process. * If PRIMARY receives SIGHUP, it will reconnect if remote address or * replication mode has changed or simply set new timeout if only * timeout has changed. @@ -335,6 +336,8 @@ hastd_reload(void) sizeof(cres->hr_remoteaddr)); cres->hr_replication = nres->hr_replication; cres->hr_timeout = nres->hr_timeout; + strlcpy(cres->hr_exec, nres->hr_exec, + sizeof(cres->hr_exec)); if (cres->hr_workerpid != 0) { if (kill(cres->hr_workerpid, SIGHUP) < 0) { pjdlog_errno(LOG_WARNING, From owner-svn-src-all@FreeBSD.ORG Sat Jan 22 22:33:27 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D117F106566B; Sat, 22 Jan 2011 22:33:27 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C018B8FC0A; Sat, 22 Jan 2011 22:33:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0MMXRmC006659; Sat, 22 Jan 2011 22:33:27 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0MMXRk0006657; Sat, 22 Jan 2011 22:33:27 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201101222233.p0MMXRk0006657@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 22 Jan 2011 22:33: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: r217730 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jan 2011 22:33:27 -0000 Author: pjd Date: Sat Jan 22 22:33:27 2011 New Revision: 217730 URL: http://svn.freebsd.org/changeset/base/217730 Log: Use int16 for error. MFC after: 1 week Modified: head/sbin/hastd/control.c Modified: head/sbin/hastd/control.c ============================================================================== --- head/sbin/hastd/control.c Sat Jan 22 22:31:55 2011 (r217729) +++ head/sbin/hastd/control.c Sat Jan 22 22:33:27 2011 (r217730) @@ -177,7 +177,7 @@ control_status_worker(struct hast_resour goto end; } - error = nv_get_int64(cnvin, "error"); + error = nv_get_int16(cnvin, "error"); if (error != 0) goto end; From owner-svn-src-all@FreeBSD.ORG Sat Jan 22 22:35:09 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 014001065698; Sat, 22 Jan 2011 22:35:09 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E43658FC13; Sat, 22 Jan 2011 22:35:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0MMZ8WW006743; Sat, 22 Jan 2011 22:35:08 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0MMZ8ir006740; Sat, 22 Jan 2011 22:35:08 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201101222235.p0MMZ8ir006740@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 22 Jan 2011 22:35:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217731 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jan 2011 22:35:09 -0000 Author: pjd Date: Sat Jan 22 22:35:08 2011 New Revision: 217731 URL: http://svn.freebsd.org/changeset/base/217731 Log: Use more consistent function name with the others (pjdlogv_prefix_set() instead of pjdlog_prefix_setv()). MFC after: 1 week Modified: head/sbin/hastd/pjdlog.c head/sbin/hastd/pjdlog.h Modified: head/sbin/hastd/pjdlog.c ============================================================================== --- head/sbin/hastd/pjdlog.c Sat Jan 22 22:33:27 2011 (r217730) +++ head/sbin/hastd/pjdlog.c Sat Jan 22 22:35:08 2011 (r217731) @@ -105,7 +105,7 @@ pjdlog_prefix_set(const char *fmt, ...) va_list ap; va_start(ap, fmt); - pjdlog_prefix_setv(fmt, ap); + pjdlogv_prefix_set(fmt, ap); va_end(ap); } @@ -114,7 +114,7 @@ pjdlog_prefix_set(const char *fmt, ...) * Setting prefix to NULL will remove it. */ void -pjdlog_prefix_setv(const char *fmt, va_list ap) +pjdlogv_prefix_set(const char *fmt, va_list ap) { assert(fmt != NULL); Modified: head/sbin/hastd/pjdlog.h ============================================================================== --- head/sbin/hastd/pjdlog.h Sat Jan 22 22:33:27 2011 (r217730) +++ head/sbin/hastd/pjdlog.h Sat Jan 22 22:35:08 2011 (r217731) @@ -48,7 +48,7 @@ void pjdlog_debug_set(int level); int pjdlog_debug_get(void); void pjdlog_prefix_set(const char *fmt, ...) __printflike(1, 2); -void pjdlog_prefix_setv(const char *fmt, va_list ap) __printflike(1, 0); +void pjdlogv_prefix_set(const char *fmt, va_list ap) __printflike(1, 0); void pjdlog_common(int loglevel, int debuglevel, int error, const char *fmt, ...) __printflike(4, 5); From owner-svn-src-all@FreeBSD.ORG Sat Jan 22 22:38:19 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 48CF3106566C; Sat, 22 Jan 2011 22:38:19 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1D2AB8FC0C; Sat, 22 Jan 2011 22:38:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0MMcJ79006850; Sat, 22 Jan 2011 22:38:19 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0MMcITu006847; Sat, 22 Jan 2011 22:38:18 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201101222238.p0MMcITu006847@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 22 Jan 2011 22:38: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: r217732 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jan 2011 22:38:19 -0000 Author: pjd Date: Sat Jan 22 22:38:18 2011 New Revision: 217732 URL: http://svn.freebsd.org/changeset/base/217732 Log: Add nv_assert() which allows to assert that the given name exists. MFC after: 1 week Modified: head/sbin/hastd/nv.c head/sbin/hastd/nv.h Modified: head/sbin/hastd/nv.c ============================================================================== --- head/sbin/hastd/nv.c Sat Jan 22 22:35:08 2011 (r217731) +++ head/sbin/hastd/nv.c Sat Jan 22 22:38:18 2011 (r217732) @@ -563,11 +563,10 @@ nv_get_string(struct nv *nv, const char return (str); } -bool -nv_exists(struct nv *nv, const char *namefmt, ...) +static bool +nv_vexists(struct nv *nv, const char *namefmt, va_list nameap) { struct nvhdr *nvh; - va_list nameap; int snverror, serrno; if (nv == NULL) @@ -576,9 +575,7 @@ nv_exists(struct nv *nv, const char *nam serrno = errno; snverror = nv->nv_error; - va_start(nameap, namefmt); nvh = nv_find(nv, NV_TYPE_NONE, namefmt, nameap); - va_end(nameap); errno = serrno; nv->nv_error = snverror; @@ -586,6 +583,29 @@ nv_exists(struct nv *nv, const char *nam return (nvh != NULL); } +bool +nv_exists(struct nv *nv, const char *namefmt, ...) +{ + va_list nameap; + bool ret; + + va_start(nameap, namefmt); + ret = nv_vexists(nv, namefmt, nameap); + va_end(nameap); + + return (ret); +} + +void +nv_assert(struct nv *nv, const char *namefmt, ...) +{ + va_list nameap; + + va_start(nameap, namefmt); + assert(nv_vexists(nv, namefmt, nameap)); + va_end(nameap); +} + /* * Dump content of the nv structure. */ Modified: head/sbin/hastd/nv.h ============================================================================== --- head/sbin/hastd/nv.h Sat Jan 22 22:35:08 2011 (r217731) +++ head/sbin/hastd/nv.h Sat Jan 22 22:38:18 2011 (r217732) @@ -127,6 +127,7 @@ const char *nv_get_string(struct nv *nv, __printflike(2, 3); bool nv_exists(struct nv *nv, const char *namefmt, ...) __printflike(2, 3); +void nv_assert(struct nv *nv, const char *namefmt, ...) __printflike(2, 3); void nv_dump(struct nv *nv); #endif /* !_NV_H_ */ From owner-svn-src-all@FreeBSD.ORG Sat Jan 22 22:57:29 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0BCF3106564A; Sat, 22 Jan 2011 22:57:29 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EE6B78FC0A; Sat, 22 Jan 2011 22:57:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0MMvSmL007313; Sat, 22 Jan 2011 22:57:28 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0MMvSZY007310; Sat, 22 Jan 2011 22:57:28 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201101222257.p0MMvSZY007310@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 22 Jan 2011 22:57: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: r217733 - in head: . share/man/man7 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jan 2011 22:57:29 -0000 Author: bz Date: Sat Jan 22 22:57:28 2011 New Revision: 217733 URL: http://svn.freebsd.org/changeset/base/217733 Log: Properly document what the top-level `make tinderbox` does. Reviewed by: jmallett MFC After: 3 days X-MFC: build.7 only Modified: head/Makefile head/share/man/man7/build.7 Modified: head/Makefile ============================================================================== --- head/Makefile Sat Jan 22 22:38:18 2011 (r217732) +++ head/Makefile Sat Jan 22 22:57:28 2011 (r217733) @@ -5,7 +5,8 @@ # # universe - *Really* build *everything* (buildworld and # all kernels on all architectures). -# tinderbox - Same as universe, but stop on first failure. +# tinderbox - Same as universe, but presents a list of failed build +# targets and exits with an error if there were any. # buildworld - Rebuild *everything*, including glue to help do # upgrades. # installworld - Install everything built by "buildworld". Modified: head/share/man/man7/build.7 ============================================================================== --- head/share/man/man7/build.7 Sat Jan 22 22:38:18 2011 (r217732) +++ head/share/man/man7/build.7 Sat Jan 22 22:57:28 2011 (r217733) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 02, 2010 +.Dd January 22, 2011 .Dt BUILD 7 .Os .Sh NAME @@ -229,6 +229,11 @@ This command takes a long time. .It Cm update Get updated sources as configured in .Xr make.conf 5 . +.It Cm tinderbox +Execute the same targets as +.Cm universe . +In addition print a summary of all failed targets at the end and +exit with an error if there were any. .El .Pp Kernel specific build targets in From owner-svn-src-all@FreeBSD.ORG Sat Jan 22 23:10:59 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1555C106564A; Sat, 22 Jan 2011 23:10:59 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 041F38FC14; Sat, 22 Jan 2011 23:10:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0MNAw7Q007639; Sat, 22 Jan 2011 23:10:58 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0MNAwIY007637; Sat, 22 Jan 2011 23:10:58 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201101222310.p0MNAwIY007637@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 22 Jan 2011 23:10:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217734 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jan 2011 23:10:59 -0000 Author: bz Date: Sat Jan 22 23:10:58 2011 New Revision: 217734 URL: http://svn.freebsd.org/changeset/base/217734 Log: In `make targets` print the make variable TARGETS as we expect it rather than the grammatically better sounding variant without the 'S'. This allows copy and paste and is less confusing. Modified: head/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Sat Jan 22 22:57:28 2011 (r217733) +++ head/Makefile Sat Jan 22 23:10:58 2011 (r217734) @@ -297,7 +297,7 @@ TARGET_ARCHES_${target}?= ${target} .endfor targets: - @echo "Supported TARGET/TARGET_ARCH pairs" + @echo "Supported TARGETS/TARGET_ARCH pairs" .for target in ${TARGETS} .for target_arch in ${TARGET_ARCHES_${target}} @echo " ${target}/${target_arch}" From owner-svn-src-all@FreeBSD.ORG Sat Jan 22 23:16:44 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA14D106566B; Sat, 22 Jan 2011 23:16:44 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D93718FC08; Sat, 22 Jan 2011 23:16:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0MNGivm007803; Sat, 22 Jan 2011 23:16:44 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0MNGi91007801; Sat, 22 Jan 2011 23:16:44 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201101222316.p0MNGi91007801@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 22 Jan 2011 23: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: r217735 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jan 2011 23:16:45 -0000 Author: bz Date: Sat Jan 22 23:16:44 2011 New Revision: 217735 URL: http://svn.freebsd.org/changeset/base/217735 Log: Make `make tinderbox` work with MAKEOBJDIRPREFIX set (or in possibly other combinations) by forcing FAILFILE into .CURDIR as we do for all other universe output files. [1] Similarly make FAILFILE start with "_." as well. Reviewed by: silence-on-src [1] MFC after: 6 days Modified: head/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Sat Jan 22 23:10:58 2011 (r217734) +++ head/Makefile Sat Jan 22 23:16:44 2011 (r217735) @@ -305,7 +305,7 @@ targets: .endfor .if defined(DOING_TINDERBOX) -FAILFILE=tinderbox.failed +FAILFILE=${.CURDIR}/_.tinderbox.failed MAKEFAIL=tee -a ${FAILFILE} .else MAKEFAIL=cat From owner-svn-src-all@FreeBSD.ORG Sat Jan 22 23:26:06 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 049B71065742; Sat, 22 Jan 2011 23:26:06 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CDA618FC13; Sat, 22 Jan 2011 23:26:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0MNQ5dZ008073; Sat, 22 Jan 2011 23:26:05 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0MNQ5fm008072; Sat, 22 Jan 2011 23:26:05 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201101222326.p0MNQ5fm008072@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 22 Jan 2011 23:26:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217736 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jan 2011 23:26:06 -0000 Author: bz Date: Sat Jan 22 23:26:05 2011 New Revision: 217736 URL: http://svn.freebsd.org/changeset/base/217736 Log: Add an svn:ignore property for _.{TARGETS,tinderbox}.* in the toplevel directory to ignore those file patters in svn status, add and import. MFC after: 6 days Modified: Directory Properties: head/ (props changed) From owner-svn-src-all@FreeBSD.ORG Sat Jan 22 23:30:01 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0E6010656C4; Sat, 22 Jan 2011 23:30:01 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B9E658FC17; Sat, 22 Jan 2011 23:30:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0MNU1Qs008198; Sat, 22 Jan 2011 23:30:01 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0MNU14g008197; Sat, 22 Jan 2011 23:30:01 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201101222330.p0MNU14g008197@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 22 Jan 2011 23:30: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: r217737 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jan 2011 23:30:02 -0000 Author: pjd Date: Sat Jan 22 23:30:01 2011 New Revision: 217737 URL: http://svn.freebsd.org/changeset/base/217737 Log: Add missing logs. MFC after: 1 week Modified: head/sbin/hastd/control.c Modified: head/sbin/hastd/control.c ============================================================================== --- head/sbin/hastd/control.c Sat Jan 22 23:26:05 2011 (r217736) +++ head/sbin/hastd/control.c Sat Jan 22 23:30:01 2011 (r217737) @@ -159,12 +159,13 @@ control_status_worker(struct hast_resour nv_add_uint8(cnvout, HASTCTL_STATUS, "cmd"); error = nv_error(cnvout); if (error != 0) { - /* LOG */ + pjdlog_common(LOG_ERR, 0, error, + "Unable to prepare control header"); goto end; } if (hast_proto_send(res, res->hr_ctrl, cnvout, NULL, 0) < 0) { error = errno; - /* LOG */ + pjdlog_errno(LOG_ERR, "Unable to send control header"); goto end; } @@ -173,7 +174,7 @@ control_status_worker(struct hast_resour */ if (hast_proto_recv_hdr(res->hr_ctrl, &cnvin) < 0) { error = errno; - /* LOG */ + pjdlog_errno(LOG_ERR, "Unable to receive control header"); goto end; } @@ -183,7 +184,7 @@ control_status_worker(struct hast_resour if ((str = nv_get_string(cnvin, "status")) == NULL) { error = ENOENT; - /* LOG */ + pjdlog_errno(LOG_ERR, "Field 'status' is missing."); goto end; } nv_add_string(nvout, str, "status%u", no); From owner-svn-src-all@FreeBSD.ORG Sat Jan 22 23:37:42 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D7AE2106564A; Sat, 22 Jan 2011 23:37:42 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C63488FC0A; Sat, 22 Jan 2011 23:37:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0MNbgih008391; Sat, 22 Jan 2011 23:37:42 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0MNbg8c008388; Sat, 22 Jan 2011 23:37:42 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201101222337.p0MNbg8c008388@svn.freebsd.org> From: Adrian Chadd Date: Sat, 22 Jan 2011 23:37: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: r217738 - head/tools/tools/ath/athstats X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jan 2011 23:37:42 -0000 Author: adrian Date: Sat Jan 22 23:37:42 2011 New Revision: 217738 URL: http://svn.freebsd.org/changeset/base/217738 Log: Patch the athstats code/Makefile to cross-compile correctly. Modified: head/tools/tools/ath/athstats/Makefile head/tools/tools/ath/athstats/athstats.c Modified: head/tools/tools/ath/athstats/Makefile ============================================================================== --- head/tools/tools/ath/athstats/Makefile Sat Jan 22 23:30:01 2011 (r217737) +++ head/tools/tools/ath/athstats/Makefile Sat Jan 22 23:37:42 2011 (r217738) @@ -1,28 +1,26 @@ # $FreeBSD$ -PROG= athstats +.PATH: ${.CURDIR}/../../../../sys/dev/ath/ath_hal -SRCS= main.c statfoo.c athstats.c +PROG= athstats -.include +SRCS= main.c statfoo.c athstats.c opt_ah.h ah_osdep.h -SRCDIR= ${.CURDIR}/../../../.. +CLEANFILES+= opt_ah.h -CLEANFILES+= opt_ah.h ah_osdep.h +.include <../Makefile.inc> CFLAGS+=-DATH_SUPPORT_ANI CFLAGS+=-DATH_SUPPORT_TDMA -CFLAGS+=-I${.CURDIR} -CFLAGS+=-I${SRCDIR}/sys/net80211 - -.include <../Makefile.inc> - -athstats.o: opt_ah.h ah_osdep.h - opt_ah.h: - touch opt_ah.h + echo "#define AH_DEBUG 1" > opt_ah.h + echo "#define AH_DEBUG_COUNTRY 1" >> opt_ah.h + echo "#define AH_SUPPORT_AR5416 1" >> opt_ah.h + ah_osdep.h: echo 'typedef void *HAL_SOFTC;' >ah_osdep.h echo 'typedef int HAL_BUS_TAG;' >>ah_osdep.h echo 'typedef void *HAL_BUS_HANDLE;' >>ah_osdep.h + +.include Modified: head/tools/tools/ath/athstats/athstats.c ============================================================================== --- head/tools/tools/ath/athstats/athstats.c Sat Jan 22 23:30:01 2011 (r217737) +++ head/tools/tools/ath/athstats/athstats.c Sat Jan 22 23:37:42 2011 (r217738) @@ -29,6 +29,8 @@ * $FreeBSD$ */ +#include "opt_ah.h" + /* * ath statistics class. */ From owner-svn-src-all@FreeBSD.ORG Sat Jan 22 23:44:56 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C0F00106566B; Sat, 22 Jan 2011 23:44:56 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AEAFA8FC08; Sat, 22 Jan 2011 23:44:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0MNiu6l008600; Sat, 22 Jan 2011 23:44:56 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0MNiu22008596; Sat, 22 Jan 2011 23:44:56 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201101222344.p0MNiu22008596@svn.freebsd.org> From: Adrian Chadd Date: Sat, 22 Jan 2011 23:44: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: r217739 - in head/tools/tools/ath: . ath_prom_read X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jan 2011 23:44:56 -0000 Author: adrian Date: Sat Jan 22 23:44:56 2011 New Revision: 217739 URL: http://svn.freebsd.org/changeset/base/217739 Log: Add a new tool which takes a text hexdump of the current EEPROM contents. Added: head/tools/tools/ath/ath_prom_read/ head/tools/tools/ath/ath_prom_read/Makefile (contents, props changed) head/tools/tools/ath/ath_prom_read/ath_prom_read.c (contents, props changed) Modified: head/tools/tools/ath/Makefile Modified: head/tools/tools/ath/Makefile ============================================================================== --- head/tools/tools/ath/Makefile Sat Jan 22 23:37:42 2011 (r217738) +++ head/tools/tools/ath/Makefile Sat Jan 22 23:44:56 2011 (r217739) @@ -1,5 +1,5 @@ # $FreeBSD$ -SUBDIR= athdebug athdecode athkey athpoke athprom athrd athregs athstats ath_ee_v14_print +SUBDIR= athdebug athdecode athkey athpoke athprom athrd athregs athstats ath_ee_v14_print ath_prom_read .include Added: head/tools/tools/ath/ath_prom_read/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/ath/ath_prom_read/Makefile Sat Jan 22 23:44:56 2011 (r217739) @@ -0,0 +1,22 @@ +# $FreeBSD$ + +PROG= ath_prom_read + +.include + +.include <../Makefile.inc> + +CLEANFILES+= opt_ah.h ah_osdep.h + +CFLAGS+=-DATH_SUPPORT_ANI +CFLAGS+=-DATH_SUPPORT_TDMA + +CFLAGS+=-I${.CURDIR} +CFLAGS+=-I${SRCDIR}/sys/net80211 + +opt_ah.h: + touch opt_ah.h +ah_osdep.h: + echo 'typedef void *HAL_SOFTC;' >ah_osdep.h + echo 'typedef int HAL_BUS_TAG;' >>ah_osdep.h + echo 'typedef void *HAL_BUS_HANDLE;' >>ah_osdep.h Added: head/tools/tools/ath/ath_prom_read/ath_prom_read.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/ath/ath_prom_read/ath_prom_read.c Sat Jan 22 23:44:56 2011 (r217739) @@ -0,0 +1,134 @@ +/*- + * Copyright (c) 2008 Sam Leffler, Errno Consulting + * 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. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any + * redistribution must be conditioned upon including a substantially + * similar Disclaimer requirement for further binary redistribution. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES. + * + * $FreeBSD$ + */ +#include "diag.h" + +#include "ah.h" +#include "ah_diagcodes.h" + +#include +#include +#include +#include +#include +#include + +struct ath_diag atd; +int s; +const char *progname; + +/* XXX this should likely be defined somewhere in the HAL */ +/* XXX This is a lot larger than the v14 ROM */ +#define MAX_EEPROM_SIZE 16384 + +uint16_t eep[MAX_EEPROM_SIZE]; + +static void +usage() +{ + fprintf(stderr, " %s [-i ifname] -d \n", progname); + exit(-1); +} + +#define NUM_PER_LINE 8 + +static void +do_eeprom_dump(const char *dumpfile, uint16_t *eebuf, int eelen) +{ + FILE *fp; + int i; + + fp = fopen(dumpfile, "w"); + if (!fp) { + err(1, "fopen"); + } + + /* eelen is in bytes; eebuf is in 2 byte words */ + for (i = 0; i < eelen / 2; i++) { + if (i % NUM_PER_LINE == 0) + fprintf(fp, "%.4x: ", i); + fprintf(fp, "%.4x%s", (int32_t)(eebuf[i]), i % NUM_PER_LINE == (NUM_PER_LINE - 1) ? "\n" : " "); + } + fprintf(fp, "\n"); + fclose(fp); +} + +int +main(int argc, char *argv[]) +{ + FILE *fd = NULL; + const char *ifname; + int c; + const char *dumpname = NULL; + + s = socket(AF_INET, SOCK_DGRAM, 0); + if (s < 0) + err(1, "socket"); + ifname = getenv("ATH"); + if (!ifname) + ifname = ATH_DEFAULT; + + progname = argv[0]; + while ((c = getopt(argc, argv, "d:i:t:")) != -1) + switch (c) { + case 'd': + dumpname = optarg; + break; + case 'i': + ifname = optarg; + break; + case 't': + fd = fopen(optarg, "r"); + if (fd == NULL) + err(-1, "Cannot open %s", optarg); + break; + default: + usage(); + /*NOTREACHED*/ + } + argc -= optind; + argv += optind; + + strncpy(atd.ad_name, ifname, sizeof (atd.ad_name)); + + /* Read in the entire EEPROM */ + atd.ad_id = HAL_DIAG_EEPROM; + atd.ad_out_data = (caddr_t) eep; + atd.ad_out_size = sizeof(eep); + if (ioctl(s, SIOCGATHDIAG, &atd) < 0) + err(1, atd.ad_name); + + /* Dump file? Then just write to it */ + if (dumpname != NULL) { + do_eeprom_dump(dumpname, (uint16_t *) &eep, sizeof(eep)); + } + return 0; +} +