From owner-svn-src-stable-8@FreeBSD.ORG Sun Apr 3 03:43:47 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 789DB106566B; Sun, 3 Apr 2011 03:43:47 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6835F8FC1A; Sun, 3 Apr 2011 03:43: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 p333hlFc001474; Sun, 3 Apr 2011 03:43:47 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p333hlGt001468; Sun, 3 Apr 2011 03:43:47 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201104030343.p333hlGt001468@svn.freebsd.org> From: Edwin Groothuis Date: Sun, 3 Apr 2011 03:43: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: r220287 - stable/8/share/zoneinfo X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Apr 2011 03:43:47 -0000 Author: edwin Date: Sun Apr 3 03:43:47 2011 New Revision: 220287 URL: http://svn.freebsd.org/changeset/base/220287 Log: MFC of 220286, tzdata2011e: Change for Africa/Casablanca: - The 3rd april 2011 at 00:00:00, [it] will be 3rd april 1:00:00 - The 31th july 2011 at 00:59:59, [it] will be 31th July 00:00:00 Update for SouthAmerica/Chili: - Chile's clocks will go back an hour this year on the 7th of May instead of this Saturday. They will go forward again the 3rd Saturday in August, not in October as they have since 1968. This is a pilot plan which will be reevaluated in 2012. Modified: stable/8/share/zoneinfo/africa stable/8/share/zoneinfo/asia stable/8/share/zoneinfo/europe stable/8/share/zoneinfo/southamerica stable/8/share/zoneinfo/zone.tab Directory Properties: stable/8/share/zoneinfo/ (props changed) Modified: stable/8/share/zoneinfo/africa ============================================================================== --- stable/8/share/zoneinfo/africa Sun Apr 3 03:42:42 2011 (r220286) +++ stable/8/share/zoneinfo/africa Sun Apr 3 03:43:47 2011 (r220287) @@ -1,5 +1,5 @@ #
-# @(#)africa	8.28
+# @(#)africa	8.30
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -712,6 +712,48 @@ Zone	Indian/Mayotte	3:00:56 -	LMT	1911 J
 # http://www.timeanddate.com/news/time/morocco-starts-dst-2010.html
 # 
 
+# From Dan Abitol (2011-03-30):
+# ...Rules for Africa/Casablanca are the following (24h format)
+# The 3rd april 2011 at 00:00:00, [it] will be 3rd april 1:00:00
+# The 31th july 2011 at 00:59:59,  [it] will be 31th July 00:00:00
+# ...Official links of change in morocco
+# The change was broadcast on the FM Radio
+# I ve called ANRT (telecom regulations in Morocco) at
+# +212.537.71.84.00
+# 
+# http://www.anrt.net.ma/fr/
+# 
+# They said that
+# 
+# http://www.map.ma/fr/sections/accueil/l_heure_legale_au_ma/view
+# 
+# is the official publication to look at.
+# They said that the decision was already taken.
+#
+# More articles in the press
+# 
+# http://www.yabiladi.com/articles/details/5058/secret-l-heure-d-ete-maroc-lev
+# 
+# e.html
+# 
+# http://www.lematin.ma/Actualite/Express/Article.asp?id=148923
+# 
+# 
+# http://www.lavieeco.com/actualite/Le-Maroc-passe-sur-GMT%2B1-a-partir-de-dim
+# anche-prochain-5538.html
+# 
+
+# From Petr Machata (2011-03-30):
+# They have it written in English here:
+# 
+# http://www.map.ma/eng/sections/home/morocco_to_spring_fo/view
+# 
+#
+# It says there that "Morocco will resume its standard time on July 31,
+# 2011 at midnight." Now they don't say whether they mean midnight of
+# wall clock time (i.e. 11pm UTC), but that's what I would assume. It has
+# also been like that in the past.
+
 # RULE	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 
 Rule	Morocco	1939	only	-	Sep	12	 0:00	1:00	S
@@ -735,6 +777,8 @@ Rule	Morocco	2009	only	-	Jun	 1	 0:00	1:
 Rule	Morocco	2009	only	-	Aug	 21	 0:00	0	-
 Rule	Morocco	2010	only	-	May	 2	 0:00	1:00	S
 Rule	Morocco	2010	only	-	Aug	 8	 0:00	0	-
+Rule	Morocco	2011	only	-	Apr	 3	 0:00	1:00	S
+Rule	Morocco	2011	only	-	Jul	 31	 0	0	-
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone Africa/Casablanca	-0:30:20 -	LMT	1913 Oct 26
 			 0:00	Morocco	WE%sT	1984 Mar 16

Modified: stable/8/share/zoneinfo/asia
==============================================================================
--- stable/8/share/zoneinfo/asia	Sun Apr  3 03:42:42 2011	(r220286)
+++ stable/8/share/zoneinfo/asia	Sun Apr  3 03:43:47 2011	(r220287)
@@ -1,4 +1,4 @@
-# @(#)asia	8.62
+# @(#)asia	8.64
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 

Modified: stable/8/share/zoneinfo/europe
==============================================================================
--- stable/8/share/zoneinfo/europe	Sun Apr  3 03:42:42 2011	(r220286)
+++ stable/8/share/zoneinfo/europe	Sun Apr  3 03:43:47 2011	(r220287)
@@ -1,5 +1,5 @@
 # 
-# @(#)europe	8.28
+# @(#)europe	8.31
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 

Modified: stable/8/share/zoneinfo/southamerica
==============================================================================
--- stable/8/share/zoneinfo/southamerica	Sun Apr  3 03:42:42 2011	(r220286)
+++ stable/8/share/zoneinfo/southamerica	Sun Apr  3 03:43:47 2011	(r220287)
@@ -1,5 +1,5 @@
 # 
-# @(#)southamerica	8.45
+# @(#)southamerica	8.47
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -1171,6 +1171,19 @@ Zone America/Rio_Branco	-4:31:12 -	LMT	1
 # From Arthur David Olson (2011-03-02):
 # The emol.com article mentions a water shortage as the cause of the
 # postponement, which may mean that it's not a permanent change.
+
+# From Glenn Eychaner (2011-03-28):
+# The article:
+# 
+# http://diario.elmercurio.com/2011/03/28/_portada/_portada/noticias/7565897A-CA86-49E6-9E03-660B21A4883E.htm?id=3D{7565897A-CA86-49E6-9E03-660B21A4883E}
+# 
+#
+# In English:
+# Chile's clocks will go back an hour this year on the 7th of May instead
+# of this Saturday. They will go forward again the 3rd Saturday in
+# August, not in October as they have since 1968. This is a pilot plan
+# which will be reevaluated in 2012.
+
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Chile	1927	1932	-	Sep	 1	0:00	1:00	S
 Rule	Chile	1928	1932	-	Apr	 1	0:00	0	-
@@ -1200,13 +1213,16 @@ Rule	Chile	1997	only	-	Mar	30	3:00u	0	-
 Rule	Chile	1998	only	-	Mar	Sun>=9	3:00u	0	-
 Rule	Chile	1998	only	-	Sep	27	4:00u	1:00	S
 Rule	Chile	1999	only	-	Apr	 4	3:00u	0	-
-Rule	Chile	1999	max	-	Oct	Sun>=9	4:00u	1:00	S
+Rule	Chile	1999	2010	-	Oct	Sun>=9	4:00u	1:00	S
+Rule	Chile	2011	only	-	Aug	Sun>=16	4:00u	1:00	S
+Rule	Chile	2012	max	-	Oct	Sun>=9	4:00u	1:00	S
 Rule	Chile	2000	2007	-	Mar	Sun>=9	3:00u	0	-
 # N.B.: the end of March 29 in Chile is March 30 in Universal time,
 # which is used below in specifying the transition.
 Rule	Chile	2008	only	-	Mar	30	3:00u	0	-
 Rule	Chile	2009	only	-	Mar	Sun>=9	3:00u	0	-
-Rule	Chile	2010	2011	-	Apr	Sun>=1	3:00u	0	-
+Rule	Chile	2010	only	-	Apr	Sun>=1	3:00u	0	-
+Rule	Chile	2011	only	-	May	Sun>=2	3:00u	0	-
 Rule	Chile	2012	max	-	Mar	Sun>=9	3:00u	0	-
 # IATA SSIM anomalies: (1992-02) says 1992-03-14;
 # (1996-09) says 1998-03-08.  Ignore these.

Modified: stable/8/share/zoneinfo/zone.tab
==============================================================================
--- stable/8/share/zoneinfo/zone.tab	Sun Apr  3 03:42:42 2011	(r220286)
+++ stable/8/share/zoneinfo/zone.tab	Sun Apr  3 03:43:47 2011	(r220287)
@@ -1,5 +1,5 @@
 # 
-# @(#)zone.tab	8.41
+# @(#)zone.tab	8.43
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 #

From owner-svn-src-stable-8@FreeBSD.ORG  Sun Apr  3 08:44:57 2011
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C6DD01065670;
	Sun,  3 Apr 2011 08:44:57 +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 B4E378FC14;
	Sun,  3 Apr 2011 08:44: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 p338iv9b007769;
	Sun, 3 Apr 2011 08:44:57 GMT (envelope-from jh@svn.freebsd.org)
Received: (from jh@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p338ivvr007767;
	Sun, 3 Apr 2011 08:44:57 GMT (envelope-from jh@svn.freebsd.org)
Message-Id: <201104030844.p338ivvr007767@svn.freebsd.org>
From: Jaakko Heinonen 
Date: Sun, 3 Apr 2011 08:44: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: r220291 - stable/8/usr.bin/truss
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Sun, 03 Apr 2011 08:44:57 -0000

Author: jh
Date: Sun Apr  3 08:44:57 2011
New Revision: 220291
URL: http://svn.freebsd.org/changeset/base/220291

Log:
  MFC r216224:
  
  Don't write the terminating NUL past end of buffer.
  
  PR:		bin/152345

Modified:
  stable/8/usr.bin/truss/syscalls.c
Directory Properties:
  stable/8/usr.bin/truss/   (props changed)

Modified: stable/8/usr.bin/truss/syscalls.c
==============================================================================
--- stable/8/usr.bin/truss/syscalls.c	Sun Apr  3 05:09:25 2011	(r220290)
+++ stable/8/usr.bin/truss/syscalls.c	Sun Apr  3 08:44:57 2011	(r220291)
@@ -516,7 +516,7 @@ get_string(pid_t pid, void *offset, int 
 			buf = realloc(buf, totalsize);
 			size = BLOCKSIZE;
 		} else {
-			buf[totalsize] = '\0';
+			buf[totalsize - 1] = '\0';
 			return (buf);
 		}
 	}

From owner-svn-src-stable-8@FreeBSD.ORG  Sun Apr  3 18:56:17 2011
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1D1A9106564A;
	Sun,  3 Apr 2011 18:56:17 +0000 (UTC)
	(envelope-from trociny@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 0AD578FC08;
	Sun,  3 Apr 2011 18:56: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 p33IuGCC049223;
	Sun, 3 Apr 2011 18:56:16 GMT (envelope-from trociny@svn.freebsd.org)
Received: (from trociny@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p33IuGld049220;
	Sun, 3 Apr 2011 18:56:16 GMT (envelope-from trociny@svn.freebsd.org)
Message-Id: <201104031856.p33IuGld049220@svn.freebsd.org>
From: Mikolaj Golub 
Date: Sun, 3 Apr 2011 18:56: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: r220300 - stable/8/sys/geom/gate
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Sun, 03 Apr 2011 18:56:17 -0000

Author: trociny
Date: Sun Apr  3 18:56:16 2011
New Revision: 220300
URL: http://svn.freebsd.org/changeset/base/220300

Log:
  MFC r220062, r220173:
  
  r220062:
  
  In g_gate_create() there is a window between when g_gate_softc is
  registered in g_gate_units array and when its sc_provider field is
  filled. If during this period g_gate_units is accessed by another
  thread that is checking for provider name collision the crash is
  possible.
  
  Fix this by adding sc_name field to struct g_gate_softc. In
  g_gate_create() when g_gate_softc is created but sc_provider is still
  not sc_name points to provider name stored in the local array.
  
  Reported by:    Freddie Cash 
  
  r220173:
  
  Increase debug level on g_gate device destruction and add message on
  device creation.
  
  Suggested by:   danger
  
  Approved by:	pjd (mentor)

Modified:
  stable/8/sys/geom/gate/g_gate.c
  stable/8/sys/geom/gate/g_gate.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/geom/gate/g_gate.c
==============================================================================
--- stable/8/sys/geom/gate/g_gate.c	Sun Apr  3 17:38:12 2011	(r220299)
+++ stable/8/sys/geom/gate/g_gate.c	Sun Apr  3 18:56:16 2011	(r220300)
@@ -134,7 +134,7 @@ g_gate_destroy(struct g_gate_softc *sc, 
 	mtx_unlock(&g_gate_units_lock);
 	mtx_destroy(&sc->sc_queue_mtx);
 	g_topology_lock();
-	G_GATE_DEBUG(0, "Device %s destroyed.", gp->name);
+	G_GATE_DEBUG(1, "Device %s destroyed.", gp->name);
 	gp->softc = NULL;
 	g_wither_geom(gp, ENXIO);
 	sc->sc_provider = NULL;
@@ -407,13 +407,14 @@ g_gate_create(struct g_gate_ctl_create *
 	for (unit = 0; unit < g_gate_maxunits; unit++) {
 		if (g_gate_units[unit] == NULL)
 			continue;
-		if (strcmp(name, g_gate_units[unit]->sc_provider->name) != 0)
+		if (strcmp(name, g_gate_units[unit]->sc_name) != 0)
 			continue;
 		mtx_unlock(&g_gate_units_lock);
 		mtx_destroy(&sc->sc_queue_mtx);
 		free(sc, M_GATE);
 		return (EEXIST);
 	}
+	sc->sc_name = name;
 	g_gate_units[sc->sc_unit] = sc;
 	g_gate_nunits++;
 	mtx_unlock(&g_gate_units_lock);
@@ -432,6 +433,10 @@ g_gate_create(struct g_gate_ctl_create *
 	sc->sc_provider = pp;
 	g_error_provider(pp, 0);
 	g_topology_unlock();
+	mtx_lock(&g_gate_units_lock);
+	sc->sc_name = sc->sc_provider->name;
+	mtx_unlock(&g_gate_units_lock);
+	G_GATE_DEBUG(1, "Device %s created.", gp->name);
 
 	if (sc->sc_timeout > 0) {
 		callout_reset(&sc->sc_callout, sc->sc_timeout * hz,

Modified: stable/8/sys/geom/gate/g_gate.h
==============================================================================
--- stable/8/sys/geom/gate/g_gate.h	Sun Apr  3 17:38:12 2011	(r220299)
+++ stable/8/sys/geom/gate/g_gate.h	Sun Apr  3 18:56:16 2011	(r220300)
@@ -76,6 +76,7 @@
  * 'P:' means 'Protected by'.
  */
 struct g_gate_softc {
+	char			*sc_name;		/* P: (read-only) */
 	int			 sc_unit;		/* P: (read-only) */
 	int			 sc_ref;		/* P: g_gate_list_mtx */
 	struct g_provider	*sc_provider;		/* P: (read-only) */
@@ -96,7 +97,6 @@ struct g_gate_softc {
 	LIST_ENTRY(g_gate_softc) sc_next;		/* P: g_gate_list_mtx */
 	char			 sc_info[G_GATE_INFOSIZE]; /* P: (read-only) */
 };
-#define	sc_name	sc_provider->geom->name
 
 #define	G_GATE_DEBUG(lvl, ...)	do {					\
 	if (g_gate_debug >= (lvl)) {					\

From owner-svn-src-stable-8@FreeBSD.ORG  Sun Apr  3 20:54:32 2011
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C921E106564A;
	Sun,  3 Apr 2011 20:54:32 +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 B9B8E8FC16;
	Sun,  3 Apr 2011 20:54: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 p33KsWSN055590;
	Sun, 3 Apr 2011 20:54:32 GMT (envelope-from hselasky@svn.freebsd.org)
Received: (from hselasky@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p33KsWQ8055588;
	Sun, 3 Apr 2011 20:54:32 GMT (envelope-from hselasky@svn.freebsd.org)
Message-Id: <201104032054.p33KsWQ8055588@svn.freebsd.org>
From: Hans Petter Selasky 
Date: Sun, 3 Apr 2011 20:54: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: r220305 - stable/8/sys/dev/usb
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Sun, 03 Apr 2011 20:54:32 -0000

Author: hselasky
Date: Sun Apr  3 20:54:32 2011
New Revision: 220305
URL: http://svn.freebsd.org/changeset/base/220305

Log:
  MFC r213433
  Tighten USB string filtering.
  
  Approved by:	thompsa (mentor)

Modified:
  stable/8/sys/dev/usb/usb_request.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/dev/usb/usb_request.c
==============================================================================
--- stable/8/sys/dev/usb/usb_request.c	Sun Apr  3 20:22:49 2011	(r220304)
+++ stable/8/sys/dev/usb/usb_request.c	Sun Apr  3 20:54:32 2011	(r220305)
@@ -1117,14 +1117,21 @@ usbd_req_get_string_any(struct usb_devic
 		}
 
 		/*
-		 * Filter by default - we don't allow greater and less than
-		 * signs because they might confuse the dmesg printouts!
+		 * Filter by default - We only allow alphanumerical
+		 * and a few more to avoid any problems with scripts
+		 * and daemons.
 		 */
-		if ((*s == '<') || (*s == '>') || (!isprint(*s))) {
-			/* silently skip bad character */
-			continue;
+		if (isalpha(*s) ||
+		    isdigit(*s) ||
+		    *s == '-' ||
+		    *s == '+' ||
+		    *s == ' ' ||
+		    *s == '.' ||
+		    *s == ',') {
+			/* allowed */
+			s++;
 		}
-		s++;
+		/* silently skip bad character */
 	}
 	*s = 0;				/* zero terminate resulting string */
 	return (USB_ERR_NORMAL_COMPLETION);

From owner-svn-src-stable-8@FreeBSD.ORG  Sun Apr  3 21:01:37 2011
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 86F62106566C;
	Sun,  3 Apr 2011 21:01:37 +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 3FD6C8FC0C;
	Sun,  3 Apr 2011 21:01: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 p33L1btQ055824;
	Sun, 3 Apr 2011 21:01:37 GMT (envelope-from hselasky@svn.freebsd.org)
Received: (from hselasky@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p33L1bgK055822;
	Sun, 3 Apr 2011 21:01:37 GMT (envelope-from hselasky@svn.freebsd.org)
Message-Id: <201104032101.p33L1bgK055822@svn.freebsd.org>
From: Hans Petter Selasky 
Date: Sun, 3 Apr 2011 21:01:37 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r220306 - stable/8/sys/dev/usb
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Sun, 03 Apr 2011 21:01:37 -0000

Author: hselasky
Date: Sun Apr  3 21:01:36 2011
New Revision: 220306
URL: http://svn.freebsd.org/changeset/base/220306

Log:
  MFC r213434
  Add missing #if's
  
  Approved by:	thompsa (mentor)

Modified:
  stable/8/sys/dev/usb/usb_handle_request.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/dev/usb/usb_handle_request.c
==============================================================================
--- stable/8/sys/dev/usb/usb_handle_request.c	Sun Apr  3 20:54:32 2011	(r220305)
+++ stable/8/sys/dev/usb/usb_handle_request.c	Sun Apr  3 21:01:36 2011	(r220306)
@@ -438,8 +438,10 @@ usb_handle_remote_wakeup(struct usb_xfer
 
 	USB_BUS_UNLOCK(bus);
 
+#if USB_HAVE_POWERD
 	/* In case we are out of sync, update the power state. */
 	usb_bus_power_update(udev->bus);
+#endif
 	return (0);			/* success */
 }
 

From owner-svn-src-stable-8@FreeBSD.ORG  Sun Apr  3 21:12:16 2011
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 701A71065670;
	Sun,  3 Apr 2011 21:12:16 +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 5F4548FC25;
	Sun,  3 Apr 2011 21:12: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 p33LCG1L056096;
	Sun, 3 Apr 2011 21:12:16 GMT (envelope-from hselasky@svn.freebsd.org)
Received: (from hselasky@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p33LCGEP056093;
	Sun, 3 Apr 2011 21:12:16 GMT (envelope-from hselasky@svn.freebsd.org)
Message-Id: <201104032112.p33LCGEP056093@svn.freebsd.org>
From: Hans Petter Selasky 
Date: Sun, 3 Apr 2011 21:12: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: r220307 - stable/8/sys/dev/usb/controller
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Sun, 03 Apr 2011 21:12:16 -0000

Author: hselasky
Date: Sun Apr  3 21:12:16 2011
New Revision: 220307
URL: http://svn.freebsd.org/changeset/base/220307

Log:
  MFC r217374
  Add support for 64-byte contexts to XHCI driver.
  
  Approved by:	thompsa (mentor)

Modified:
  stable/8/sys/dev/usb/controller/xhci.c
  stable/8/sys/dev/usb/controller/xhci.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/dev/usb/controller/xhci.c
==============================================================================
--- stable/8/sys/dev/usb/controller/xhci.c	Sun Apr  3 21:01:36 2011	(r220306)
+++ stable/8/sys/dev/usb/controller/xhci.c	Sun Apr  3 21:12:16 2011	(r220307)
@@ -134,6 +134,12 @@ static usb_error_t xhci_configure_mask(s
 static usb_error_t xhci_cmd_evaluate_ctx(struct xhci_softc *,
 		    uint64_t, uint8_t);
 static void xhci_endpoint_doorbell(struct usb_xfer *);
+static void xhci_ctx_set_le32(struct xhci_softc *sc, volatile uint32_t *ptr, uint32_t val);
+static uint32_t xhci_ctx_get_le32(struct xhci_softc *sc, volatile uint32_t *ptr);
+static void xhci_ctx_set_le64(struct xhci_softc *sc, volatile uint64_t *ptr, uint64_t val);
+#ifdef USB_DEBUG
+static uint64_t xhci_ctx_get_le64(struct xhci_softc *sc, volatile uint64_t *ptr);
+#endif
 
 extern struct usb_bus_methods xhci_bus_methods;
 
@@ -148,26 +154,26 @@ xhci_dump_trb(struct xhci_trb *trb)
 }
 
 static void
-xhci_dump_endpoint(struct xhci_endp_ctx *pep)
+xhci_dump_endpoint(struct xhci_softc *sc, struct xhci_endp_ctx *pep)
 {
 	DPRINTFN(5, "pep = %p\n", pep);
-	DPRINTFN(5, "dwEpCtx0=0x%08x\n", pep->dwEpCtx0);
-	DPRINTFN(5, "dwEpCtx1=0x%08x\n", pep->dwEpCtx1);
-	DPRINTFN(5, "qwEpCtx2=0x%016llx\n", (long long)pep->qwEpCtx2);
-	DPRINTFN(5, "dwEpCtx4=0x%08x\n", pep->dwEpCtx4);
-	DPRINTFN(5, "dwEpCtx5=0x%08x\n", pep->dwEpCtx5);
-	DPRINTFN(5, "dwEpCtx6=0x%08x\n", pep->dwEpCtx6);
-	DPRINTFN(5, "dwEpCtx7=0x%08x\n", pep->dwEpCtx7);
+	DPRINTFN(5, "dwEpCtx0=0x%08x\n", xhci_ctx_get_le32(sc, &pep->dwEpCtx0));
+	DPRINTFN(5, "dwEpCtx1=0x%08x\n", xhci_ctx_get_le32(sc, &pep->dwEpCtx1));
+	DPRINTFN(5, "qwEpCtx2=0x%016llx\n", (long long)xhci_ctx_get_le64(sc, &pep->qwEpCtx2));
+	DPRINTFN(5, "dwEpCtx4=0x%08x\n", xhci_ctx_get_le32(sc, &pep->dwEpCtx4));
+	DPRINTFN(5, "dwEpCtx5=0x%08x\n", xhci_ctx_get_le32(sc, &pep->dwEpCtx5));
+	DPRINTFN(5, "dwEpCtx6=0x%08x\n", xhci_ctx_get_le32(sc, &pep->dwEpCtx6));
+	DPRINTFN(5, "dwEpCtx7=0x%08x\n", xhci_ctx_get_le32(sc, &pep->dwEpCtx7));
 }
 
 static void
-xhci_dump_device(struct xhci_slot_ctx *psl)
+xhci_dump_device(struct xhci_softc *sc, struct xhci_slot_ctx *psl)
 {
 	DPRINTFN(5, "psl = %p\n", psl);
-	DPRINTFN(5, "dwSctx0=0x%08x\n", psl->dwSctx0);
-	DPRINTFN(5, "dwSctx1=0x%08x\n", psl->dwSctx1);
-	DPRINTFN(5, "dwSctx2=0x%08x\n", psl->dwSctx2);
-	DPRINTFN(5, "dwSctx3=0x%08x\n", psl->dwSctx3);
+	DPRINTFN(5, "dwSctx0=0x%08x\n", xhci_ctx_get_le32(sc, &psl->dwSctx0));
+	DPRINTFN(5, "dwSctx1=0x%08x\n", xhci_ctx_get_le32(sc, &psl->dwSctx1));
+	DPRINTFN(5, "dwSctx2=0x%08x\n", xhci_ctx_get_le32(sc, &psl->dwSctx2));
+	DPRINTFN(5, "dwSctx3=0x%08x\n", xhci_ctx_get_le32(sc, &psl->dwSctx3));
 }
 #endif
 
@@ -189,6 +195,60 @@ xhci_iterate_hw_softc(struct usb_bus *bu
 	}
 }
 
+static void
+xhci_ctx_set_le32(struct xhci_softc *sc, volatile uint32_t *ptr, uint32_t val)
+{
+	if (sc->sc_ctx_is_64_byte) {
+		uint32_t offset;
+		/* exploit the fact that our structures are XHCI_PAGE_SIZE aligned */
+		/* all contexts are initially 32-bytes */
+		offset = ((uintptr_t)ptr) & ((XHCI_PAGE_SIZE - 1) & ~(31U));
+		ptr = (volatile uint32_t *)(((volatile uint8_t *)ptr) + offset);
+	}
+	*ptr = htole32(val);
+}
+
+static uint32_t
+xhci_ctx_get_le32(struct xhci_softc *sc, volatile uint32_t *ptr)
+{
+	if (sc->sc_ctx_is_64_byte) {
+		uint32_t offset;
+		/* exploit the fact that our structures are XHCI_PAGE_SIZE aligned */
+		/* all contexts are initially 32-bytes */
+		offset = ((uintptr_t)ptr) & ((XHCI_PAGE_SIZE - 1) & ~(31U));
+		ptr = (volatile uint32_t *)(((volatile uint8_t *)ptr) + offset);
+	}
+	return (le32toh(*ptr));
+}
+
+static void
+xhci_ctx_set_le64(struct xhci_softc *sc, volatile uint64_t *ptr, uint64_t val)
+{
+	if (sc->sc_ctx_is_64_byte) {
+		uint32_t offset;
+		/* exploit the fact that our structures are XHCI_PAGE_SIZE aligned */
+		/* all contexts are initially 32-bytes */
+		offset = ((uintptr_t)ptr) & ((XHCI_PAGE_SIZE - 1) & ~(31U));
+		ptr = (volatile uint64_t *)(((volatile uint8_t *)ptr) + offset);
+	}
+	*ptr = htole64(val);
+}
+
+#ifdef USB_DEBUG
+static uint64_t
+xhci_ctx_get_le64(struct xhci_softc *sc, volatile uint64_t *ptr)
+{
+	if (sc->sc_ctx_is_64_byte) {
+		uint32_t offset;
+		/* exploit the fact that our structures are XHCI_PAGE_SIZE aligned */
+		/* all contexts are initially 32-bytes */
+		offset = ((uintptr_t)ptr) & ((XHCI_PAGE_SIZE - 1) & ~(31U));
+		ptr = (volatile uint64_t *)(((volatile uint8_t *)ptr) + offset);
+	}
+	return (le64toh(*ptr));
+}
+#endif
+
 usb_error_t
 xhci_start_controller(struct xhci_softc *sc)
 {
@@ -222,9 +282,11 @@ xhci_start_controller(struct xhci_softc 
 	DPRINTF("HCS0 = 0x%08x\n", temp);
 
 	if (XHCI_HCS0_CSZ(temp)) {
-		device_printf(sc->sc_bus.parent, "Driver does not "
-		    "support 64-byte contexts.");
-		return (USB_ERR_IOERROR);
+		sc->sc_ctx_is_64_byte = 1;
+		device_printf(sc->sc_bus.parent, "64 byte context size.\n");
+	} else {
+		sc->sc_ctx_is_64_byte = 0;
+		device_printf(sc->sc_bus.parent, "32 byte context size.\n");
 	}
 
 	/* Reset controller */
@@ -1127,6 +1189,7 @@ xhci_set_address(struct usb_device *udev
 	struct xhci_hw_dev *hdev;
 	struct xhci_dev_ctx *pdev;
 	struct xhci_endpoint_ext *pepext;
+	uint32_t temp;
 	uint16_t mps;
 	usb_error_t err;
 	uint8_t index;
@@ -1204,7 +1267,9 @@ xhci_set_address(struct usb_device *udev
 		usbd_get_page(&hdev->device_pc, 0, &buf_dev);
 		pdev = buf_dev.buffer;
 		usb_pc_cpu_invalidate(&hdev->device_pc);
-		udev->address = XHCI_SCTX_3_DEV_ADDR_GET(pdev->ctx_slot.dwSctx3);
+
+		temp = xhci_ctx_get_le32(sc, &pdev->ctx_slot.dwSctx3);
+		udev->address = XHCI_SCTX_3_DEV_ADDR_GET(temp);
 
 		/* update device state to new value */
 
@@ -1964,11 +2029,11 @@ xhci_configure_mask(struct usb_device *u
 
 	if (drop) {
 		mask &= XHCI_INCTX_NON_CTRL_MASK;
-		pinp->ctx_input.dwInCtx0 = htole32(mask);
-		pinp->ctx_input.dwInCtx1 = 0;
+		xhci_ctx_set_le32(sc, &pinp->ctx_input.dwInCtx0, mask);
+		xhci_ctx_set_le32(sc, &pinp->ctx_input.dwInCtx1, 0);
 	} else {
-		pinp->ctx_input.dwInCtx0 = 0;
-		pinp->ctx_input.dwInCtx1 = htole32(mask);
+		xhci_ctx_set_le32(sc, &pinp->ctx_input.dwInCtx0, 0);
+		xhci_ctx_set_le32(sc, &pinp->ctx_input.dwInCtx1, mask);
 	}
 	return (0);
 }
@@ -2050,7 +2115,7 @@ xhci_configure_endpoint(struct usb_devic
 		break;
 	}
 
-	pinp->ctx_ep[epno - 1].dwEpCtx0 = htole32(temp);
+	xhci_ctx_set_le32(sc, &pinp->ctx_ep[epno - 1].dwEpCtx0, temp);
 
 	temp =
 	    XHCI_EPCTX_1_HID_SET(0) |
@@ -2081,11 +2146,11 @@ xhci_configure_endpoint(struct usb_devic
 	if (epno & 1)
 		temp |= XHCI_EPCTX_1_EPTYPE_SET(4);
 
-	pinp->ctx_ep[epno - 1].dwEpCtx1 = htole32(temp);
+	xhci_ctx_set_le32(sc, &pinp->ctx_ep[epno - 1].dwEpCtx1, temp);
 
 	ring_addr |= XHCI_EPCTX_2_DCS_SET(1);
 
-	pinp->ctx_ep[epno - 1].qwEpCtx2 = htole64(ring_addr);
+	xhci_ctx_set_le64(sc, &pinp->ctx_ep[epno - 1].qwEpCtx2, ring_addr);
 
 	switch (edesc->bmAttributes & UE_XFERTYPE) {
 	case UE_INTERRUPT:
@@ -2102,10 +2167,10 @@ xhci_configure_endpoint(struct usb_devic
 		break;
 	}
 
-	pinp->ctx_ep[epno - 1].dwEpCtx4 = htole32(temp);
+	xhci_ctx_set_le32(sc, &pinp->ctx_ep[epno - 1].dwEpCtx4, temp);
 
 #ifdef USB_DEBUG
-	xhci_dump_endpoint(&pinp->ctx_ep[epno - 1]);
+	xhci_dump_endpoint(sc, &pinp->ctx_ep[epno - 1]);
 #endif
 	usb_pc_cpu_flush(&sc->sc_hw.devs[index].input_pc);
 
@@ -2138,12 +2203,9 @@ static usb_error_t
 xhci_configure_device(struct usb_device *udev)
 {
 	struct xhci_softc *sc = XHCI_BUS2SC(udev->bus);
-	struct usb_page_search buf_dev;
 	struct usb_page_search buf_inp;
-	struct usb_page_cache *pcdev;
 	struct usb_page_cache *pcinp;
 	struct xhci_input_dev_ctx *pinp;
-	struct xhci_dev_ctx *pdev;
 	struct usb_device *hubdev;
 	uint32_t temp;
 	uint32_t route;
@@ -2155,13 +2217,10 @@ xhci_configure_device(struct usb_device 
 
 	DPRINTF("index=%u\n", index);
 
-	pcdev = &sc->sc_hw.devs[index].device_pc;
 	pcinp = &sc->sc_hw.devs[index].input_pc;
 
-	usbd_get_page(pcdev, 0, &buf_dev);
 	usbd_get_page(pcinp, 0, &buf_inp);
 
-	pdev = buf_dev.buffer;
 	pinp = buf_inp.buffer;
 
 	rh_port = 0;
@@ -2232,7 +2291,7 @@ xhci_configure_device(struct usb_device 
 #endif
 	}
 
-	pinp->ctx_slot.dwSctx0 = htole32(temp);
+	xhci_ctx_set_le32(sc, &pinp->ctx_slot.dwSctx0, temp);
 
 	temp = XHCI_SCTX_1_RH_PORT_SET(rh_port);
 
@@ -2258,7 +2317,7 @@ xhci_configure_device(struct usb_device 
 		break;
 	}
 
-	pinp->ctx_slot.dwSctx1 = htole32(temp);
+	xhci_ctx_set_le32(sc, &pinp->ctx_slot.dwSctx1, temp);
 
 	temp = XHCI_SCTX_2_IRQ_TARGET_SET(0);
 
@@ -2282,15 +2341,15 @@ xhci_configure_device(struct usb_device 
 		break;
 	}
 
-	pinp->ctx_slot.dwSctx2 = htole32(temp);
+	xhci_ctx_set_le32(sc, &pinp->ctx_slot.dwSctx2, temp);
 
 	temp = XHCI_SCTX_3_DEV_ADDR_SET(udev->address) |
 	    XHCI_SCTX_3_SLOT_STATE_SET(0);
 
-	pinp->ctx_slot.dwSctx3 = htole32(temp);
+	xhci_ctx_set_le32(sc, &pinp->ctx_slot.dwSctx3, temp);
 
 #ifdef USB_DEBUG
-	xhci_dump_device(&pinp->ctx_slot);
+	xhci_dump_device(sc, &pinp->ctx_slot);
 #endif
 	usb_pc_cpu_flush(pcinp);
 
@@ -2318,7 +2377,9 @@ xhci_alloc_device_ext(struct usb_device 
 	/* need to initialize the page cache */
 	pc->tag_parent = sc->sc_bus.dma_parent_tag;
 
-	if (usb_pc_alloc_mem(pc, pg, sizeof(struct xhci_dev_ctx), XHCI_PAGE_SIZE))
+	if (usb_pc_alloc_mem(pc, pg, sc->sc_ctx_is_64_byte ?
+	    (2 * sizeof(struct xhci_dev_ctx)) :
+	    sizeof(struct xhci_dev_ctx), XHCI_PAGE_SIZE))
 		goto error;
 
 	usbd_get_page(pc, 0, &buf_dev);
@@ -2329,7 +2390,9 @@ xhci_alloc_device_ext(struct usb_device 
 	/* need to initialize the page cache */
 	pc->tag_parent = sc->sc_bus.dma_parent_tag;
 
-	if (usb_pc_alloc_mem(pc, pg, sizeof(struct xhci_input_dev_ctx), XHCI_PAGE_SIZE))
+	if (usb_pc_alloc_mem(pc, pg, sc->sc_ctx_is_64_byte ?
+	    (2 * sizeof(struct xhci_input_dev_ctx)) :
+	     sizeof(struct xhci_input_dev_ctx), XHCI_PAGE_SIZE))
 		goto error;
 
 	pc = &sc->sc_hw.devs[index].endpoint_pc;
@@ -3348,13 +3411,10 @@ static usb_error_t
 xhci_configure_reset_endpoint(struct usb_xfer *xfer)
 {
 	struct xhci_softc *sc = XHCI_BUS2SC(xfer->xroot->bus);
-	struct usb_page_search buf_dev;
 	struct usb_page_search buf_inp;
 	struct usb_device *udev;
 	struct xhci_endpoint_ext *pepext;
 	struct usb_endpoint_descriptor *edesc;
-	struct xhci_dev_ctx *pdctx;
-	struct usb_page_cache *pcdev;
 	struct usb_page_cache *pcinp;
 	usb_error_t err;
 	uint8_t index;
@@ -3366,14 +3426,10 @@ xhci_configure_reset_endpoint(struct usb
 	udev = xfer->xroot->udev;
 	index = udev->controller_slot_id;
 
-	pcdev = &sc->sc_hw.devs[index].device_pc;
 	pcinp = &sc->sc_hw.devs[index].input_pc;
 
-	usbd_get_page(pcdev, 0, &buf_dev);
 	usbd_get_page(pcinp, 0, &buf_inp);
 
-	pdctx = buf_dev.buffer;
-
 	edesc = xfer->endpoint->edesc;
 
 	epno = edesc->bEndpointAddress;

Modified: stable/8/sys/dev/usb/controller/xhci.h
==============================================================================
--- stable/8/sys/dev/usb/controller/xhci.h	Sun Apr  3 21:01:36 2011	(r220306)
+++ stable/8/sys/dev/usb/controller/xhci.h	Sun Apr  3 21:12:16 2011	(r220307)
@@ -477,6 +477,9 @@ struct xhci_softc {
 	uint8_t			sc_conf;
 	uint8_t			sc_hub_idata[2];
 
+	/* size of context */
+	uint8_t			sc_ctx_is_64_byte;
+
 	/* vendor string for root HUB */
 	char			sc_vendor[16];
 };

From owner-svn-src-stable-8@FreeBSD.ORG  Sun Apr  3 22:01:26 2011
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AE965106566B;
	Sun,  3 Apr 2011 22:01:26 +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 9B96F8FC1D;
	Sun,  3 Apr 2011 22:01: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 p33M1QjZ062333;
	Sun, 3 Apr 2011 22:01:26 GMT (envelope-from hselasky@svn.freebsd.org)
Received: (from hselasky@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p33M1QWg062302;
	Sun, 3 Apr 2011 22:01:26 GMT (envelope-from hselasky@svn.freebsd.org)
Message-Id: <201104032201.p33M1QWg062302@svn.freebsd.org>
From: Hans Petter Selasky 
Date: Sun, 3 Apr 2011 22:01:26 +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: r220308 - in stable/8: share/man/man4 sys/dev/usb
	sys/dev/usb/controller sys/dev/usb/input sys/dev/usb/serial
	sys/dev/usb/template usr.sbin/usbconfig
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Sun, 03 Apr 2011 22:01:26 -0000

Author: hselasky
Date: Sun Apr  3 22:01:26 2011
New Revision: 220308
URL: http://svn.freebsd.org/changeset/base/220308

Log:
  MFC r219048, r219004, r218475 and r204632.
  - The NetBSD Foundation has granted permission to remove clause 3 and 4 from
    their software.
  - use device_printf() instead of printf() to give more accurate warnings.
  - use memcpy() instead of bcopy().
  - add missing #if's for non-FreeBSD compilation.
  - Add missing xhci(4) manual page.
  - Minor update in some USB manual pages.
  - Correct USB 3.0 wire-speed to 5.0Gbps
  
  Approved by:	thompsa (mentor)

Added:
  stable/8/share/man/man4/xhci.4
     - copied, changed from r219004, head/share/man/man4/xhci.4
Modified:
  stable/8/share/man/man4/Makefile
  stable/8/share/man/man4/ehci.4
  stable/8/share/man/man4/ohci.4
  stable/8/share/man/man4/snd_uaudio.4
  stable/8/share/man/man4/uhci.4
  stable/8/share/man/man4/usb.4
  stable/8/sys/dev/usb/controller/ehci.h
  stable/8/sys/dev/usb/controller/ehci_pci.c
  stable/8/sys/dev/usb/controller/ohci.h
  stable/8/sys/dev/usb/controller/ohci_pci.c
  stable/8/sys/dev/usb/controller/ohcireg.h
  stable/8/sys/dev/usb/controller/uhci.h
  stable/8/sys/dev/usb/controller/uhci_pci.c
  stable/8/sys/dev/usb/controller/uhcireg.h
  stable/8/sys/dev/usb/controller/usb_controller.c
  stable/8/sys/dev/usb/input/uhid.c
  stable/8/sys/dev/usb/input/ukbd.c
  stable/8/sys/dev/usb/input/ums.c
  stable/8/sys/dev/usb/serial/uftdi.c
  stable/8/sys/dev/usb/serial/ugensa.c
  stable/8/sys/dev/usb/serial/uipaq.c
  stable/8/sys/dev/usb/serial/ulpt.c
  stable/8/sys/dev/usb/serial/uvisor.c
  stable/8/sys/dev/usb/template/usb_template.c
  stable/8/sys/dev/usb/usb_cdc.h
  stable/8/sys/dev/usb/usb_hid.c
  stable/8/sys/dev/usb/usb_transfer.c
  stable/8/sys/dev/usb/usbdevs
  stable/8/usr.sbin/usbconfig/dump.c
Directory Properties:
  stable/8/share/man/man4/   (props changed)
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/usr.sbin/usbconfig/   (props changed)

Modified: stable/8/share/man/man4/Makefile
==============================================================================
--- stable/8/share/man/man4/Makefile	Sun Apr  3 21:12:16 2011	(r220307)
+++ stable/8/share/man/man4/Makefile	Sun Apr  3 22:01:26 2011	(r220308)
@@ -492,6 +492,7 @@ MAN=	aac.4 \
 	${_wpi.4} \
 	xe.4 \
 	${_xen.4} \
+	xhci.4 \
 	xl.4 \
 	xpt.4 \
 	zero.4 \

Modified: stable/8/share/man/man4/ehci.4
==============================================================================
--- stable/8/share/man/man4/ehci.4	Sun Apr  3 21:12:16 2011	(r220307)
+++ stable/8/share/man/man4/ehci.4	Sun Apr  3 22:01:26 2011	(r220308)
@@ -36,7 +36,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd March 20, 2005
+.Dd February 24, 2011
 .Dt EHCI 4
 .Os
 .Sh NAME
@@ -77,6 +77,7 @@ but can be noticed since
 2.0 devices plugged in to the same
 connector appear to connect to different USB busses.
 .Sh SEE ALSO
+.Xr xhci 4 ,
 .Xr ohci 4 ,
 .Xr uhci 4 ,
 .Xr usb 4
@@ -85,7 +86,19 @@ The
 .Nm
 device driver first appeared in
 .Fx 5.1 .
-.Sh BUGS
-The driver is not finished and is quite buggy.
-.Pp
-There is currently no support for isochronous transfers.
+.Sh LOADER TUNABLES
+Tunables can be set at the
+.Xr loader 8
+prompt before booting the kernel or stored in
+.Xr loader.conf 5 .
+.Bl -tag -width "xxxxxx"
+.It Va hw.usb.ehci.lostintrbug
+This tunable enables the lost interrupt quirk.
+The default value is 0 (off).
+.It Va hw.usb.ehci.iaadbug
+This tunable enables the EHCI doorbell quirk.
+The default value is 0 (off).
+.It Va hw.usb.ehci.no_hs
+This tunable disables USB devices to attach like HIGH-speed ones and will force all attached devices to attach to the FULL- or LOW-speed companion controller.
+The default value is 0 (off).
+.El

Modified: stable/8/share/man/man4/ohci.4
==============================================================================
--- stable/8/share/man/man4/ohci.4	Sun Apr  3 21:12:16 2011	(r220307)
+++ stable/8/share/man/man4/ohci.4	Sun Apr  3 22:01:26 2011	(r220308)
@@ -63,6 +63,7 @@ NVIDIA nForce3
 Sun PCIO-2 (RIO USB)
 .El
 .Sh SEE ALSO
+.Xr xhci 4 ,
 .Xr ehci 4 ,
 .Xr uhci 4
 .Sh HISTORY

Modified: stable/8/share/man/man4/snd_uaudio.4
==============================================================================
--- stable/8/share/man/man4/snd_uaudio.4	Sun Apr  3 21:12:16 2011	(r220307)
+++ stable/8/share/man/man4/snd_uaudio.4	Sun Apr  3 22:01:26 2011	(r220308)
@@ -36,12 +36,12 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd December 15, 2005
+.Dd February 24, 2011
 .Dt SND_UAUDIO 4
 .Os
 .Sh NAME
 .Nm snd_uaudio
-.Nd USB audio device driver
+.Nd USB audio and MIDI device driver
 .Sh SYNOPSIS
 To compile this driver into the kernel, place the following lines in your
 kernel configuration file:
@@ -62,7 +62,9 @@ The
 .Nm
 driver provides support for
 .Tn USB
-audio class devices.
+audio class devices and
+.Tn USB
+MIDI class devices.
 .Pp
 A
 .Tn USB
@@ -101,8 +103,7 @@ as of this writing, does not handle devi
 abstracted manner, i.e., a detach request is refused by the
 .Tn PCM
 framework if the device is in use.
-For
-.Tn USB
-and supposedly other detach-able busses, it is necessary to allow the
-device un-registration to complete successfully, otherwise the driver
-leaves wild pointers to invalid data structures and thus leading to a panic.
+It is necessary to allow the device un-registration to complete
+successfully, otherwise the
+.Tn PCM
+layer will panic.

Modified: stable/8/share/man/man4/uhci.4
==============================================================================
--- stable/8/share/man/man4/uhci.4	Sun Apr  3 21:12:16 2011	(r220307)
+++ stable/8/share/man/man4/uhci.4	Sun Apr  3 22:01:26 2011	(r220308)
@@ -53,6 +53,7 @@ Intel 82371SB (PIIX3)
 VIA 83C572
 .El
 .Sh SEE ALSO
+.Xr xhci 4 ,
 .Xr ehci 4 ,
 .Xr ohci 4
 .Sh HISTORY

Modified: stable/8/share/man/man4/usb.4
==============================================================================
--- stable/8/share/man/man4/usb.4	Sun Apr  3 21:12:16 2011	(r220307)
+++ stable/8/share/man/man4/usb.4	Sun Apr  3 22:01:26 2011	(r220308)
@@ -190,7 +190,8 @@ specifications can be found at:
 .Xr uplcom 4 ,
 .Xr urio 4 ,
 .Xr uvscom 4 ,
-.Xr usbconfig 8
+.Xr usbconfig 8 ,
+.Xr xhci 4
 .Sh STANDARDS
 The
 .Nm

Copied and modified: stable/8/share/man/man4/xhci.4 (from r219004, head/share/man/man4/xhci.4)
==============================================================================
--- head/share/man/man4/xhci.4	Thu Feb 24 18:08:23 2011	(r219004, copy source)
+++ stable/8/share/man/man4/xhci.4	Sun Apr  3 22:01:26 2011	(r220308)
@@ -48,7 +48,7 @@ The
 .Tn XHCI
 controller supports
 .Tn USB
-connection speeds up to 4.8Gbps when using a USB 3.0 compliant device.
+connection speeds up to 5.0Gbps when using a USB 3.0 compliant device.
 .Sh SEE ALSO
 .Xr ehci 4 ,
 .Xr ohci 4 ,

Modified: stable/8/sys/dev/usb/controller/ehci.h
==============================================================================
--- stable/8/sys/dev/usb/controller/ehci.h	Sun Apr  3 21:12:16 2011	(r220307)
+++ stable/8/sys/dev/usb/controller/ehci.h	Sun Apr  3 22:01:26 2011	(r220308)
@@ -14,13 +14,6 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *        This product includes software developed by the NetBSD
- *        Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- *    contributors may be used to endorse or promote products derived
- *    from this software without specific prior written permission.
  *
  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED

Modified: stable/8/sys/dev/usb/controller/ehci_pci.c
==============================================================================
--- stable/8/sys/dev/usb/controller/ehci_pci.c	Sun Apr  3 21:12:16 2011	(r220307)
+++ stable/8/sys/dev/usb/controller/ehci_pci.c	Sun Apr  3 22:01:26 2011	(r220308)
@@ -14,13 +14,6 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *        This product includes software developed by the NetBSD
- *        Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- *    contributors may be used to endorse or promote products derived
- *    from this software without specific prior written permission.
  *
  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED

Modified: stable/8/sys/dev/usb/controller/ohci.h
==============================================================================
--- stable/8/sys/dev/usb/controller/ohci.h	Sun Apr  3 21:12:16 2011	(r220307)
+++ stable/8/sys/dev/usb/controller/ohci.h	Sun Apr  3 22:01:26 2011	(r220308)
@@ -15,13 +15,6 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *        This product includes software developed by the NetBSD
- *        Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- *    contributors may be used to endorse or promote products derived
- *    from this software without specific prior written permission.
  *
  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED

Modified: stable/8/sys/dev/usb/controller/ohci_pci.c
==============================================================================
--- stable/8/sys/dev/usb/controller/ohci_pci.c	Sun Apr  3 21:12:16 2011	(r220307)
+++ stable/8/sys/dev/usb/controller/ohci_pci.c	Sun Apr  3 22:01:26 2011	(r220308)
@@ -14,13 +14,6 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *        This product includes software developed by the NetBSD
- *        Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- *    contributors may be used to endorse or promote products derived
- *    from this software without specific prior written permission.
  *
  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED

Modified: stable/8/sys/dev/usb/controller/ohcireg.h
==============================================================================
--- stable/8/sys/dev/usb/controller/ohcireg.h	Sun Apr  3 21:12:16 2011	(r220307)
+++ stable/8/sys/dev/usb/controller/ohcireg.h	Sun Apr  3 22:01:26 2011	(r220308)
@@ -15,13 +15,6 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *        This product includes software developed by the NetBSD
- *        Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- *    contributors may be used to endorse or promote products derived
- *    from this software without specific prior written permission.
  *
  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED

Modified: stable/8/sys/dev/usb/controller/uhci.h
==============================================================================
--- stable/8/sys/dev/usb/controller/uhci.h	Sun Apr  3 21:12:16 2011	(r220307)
+++ stable/8/sys/dev/usb/controller/uhci.h	Sun Apr  3 22:01:26 2011	(r220308)
@@ -15,13 +15,6 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *        This product includes software developed by the NetBSD
- *        Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- *    contributors may be used to endorse or promote products derived
- *    from this software without specific prior written permission.
  *
  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED

Modified: stable/8/sys/dev/usb/controller/uhci_pci.c
==============================================================================
--- stable/8/sys/dev/usb/controller/uhci_pci.c	Sun Apr  3 21:12:16 2011	(r220307)
+++ stable/8/sys/dev/usb/controller/uhci_pci.c	Sun Apr  3 22:01:26 2011	(r220308)
@@ -14,13 +14,6 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *        This product includes software developed by the NetBSD
- *        Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- *    contributors may be used to endorse or promote products derived
- *    from this software without specific prior written permission.
  *
  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED

Modified: stable/8/sys/dev/usb/controller/uhcireg.h
==============================================================================
--- stable/8/sys/dev/usb/controller/uhcireg.h	Sun Apr  3 21:12:16 2011	(r220307)
+++ stable/8/sys/dev/usb/controller/uhcireg.h	Sun Apr  3 22:01:26 2011	(r220308)
@@ -15,13 +15,6 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *        This product includes software developed by the NetBSD
- *        Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- *    contributors may be used to endorse or promote products derived
- *    from this software without specific prior written permission.
  *
  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED

Modified: stable/8/sys/dev/usb/controller/usb_controller.c
==============================================================================
--- stable/8/sys/dev/usb/controller/usb_controller.c	Sun Apr  3 21:12:16 2011	(r220307)
+++ stable/8/sys/dev/usb/controller/usb_controller.c	Sun Apr  3 22:01:26 2011	(r220308)
@@ -362,7 +362,7 @@ usb_bus_attach(struct usb_proc_msg *pm)
 
 	case USB_REV_3_0:
 		speed = USB_SPEED_SUPER;
-		device_printf(bus->bdev, "4.8Gbps Super Speed USB v3.0\n");
+		device_printf(bus->bdev, "5.0Gbps Super Speed USB v3.0\n");
 		break;
 
 	default:
@@ -454,19 +454,19 @@ usb_attach_sub(device_t dev, struct usb_
 
 	if (usb_proc_create(&bus->giant_callback_proc,
 	    &bus->bus_mtx, pname, USB_PRI_MED)) {
-		printf("WARNING: Creation of USB Giant "
+		device_printf(dev, "WARNING: Creation of USB Giant "
 		    "callback process failed.\n");
 	} else if (usb_proc_create(&bus->non_giant_callback_proc,
 	    &bus->bus_mtx, pname, USB_PRI_HIGH)) {
-		printf("WARNING: Creation of USB non-Giant "
+		device_printf(dev, "WARNING: Creation of USB non-Giant "
 		    "callback process failed.\n");
 	} else if (usb_proc_create(&bus->explore_proc,
 	    &bus->bus_mtx, pname, USB_PRI_MED)) {
-		printf("WARNING: Creation of USB explore "
+		device_printf(dev, "WARNING: Creation of USB explore "
 		    "process failed.\n");
 	} else if (usb_proc_create(&bus->control_xfer_proc,
 	    &bus->bus_mtx, pname, USB_PRI_MED)) {
-		printf("WARNING: Creation of USB control transfer "
+		device_printf(dev, "WARNING: Creation of USB control transfer "
 		    "process failed.\n");
 	} else {
 		/* Get final attach going */

Modified: stable/8/sys/dev/usb/input/uhid.c
==============================================================================
--- stable/8/sys/dev/usb/input/uhid.c	Sun Apr  3 21:12:16 2011	(r220307)
+++ stable/8/sys/dev/usb/input/uhid.c	Sun Apr  3 22:01:26 2011	(r220308)
@@ -23,13 +23,6 @@ __FBSDID("$FreeBSD$");
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *        This product includes software developed by the NetBSD
- *        Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- *    contributors may be used to endorse or promote products derived
- *    from this software without specific prior written permission.
  *
  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED

Modified: stable/8/sys/dev/usb/input/ukbd.c
==============================================================================
--- stable/8/sys/dev/usb/input/ukbd.c	Sun Apr  3 21:12:16 2011	(r220307)
+++ stable/8/sys/dev/usb/input/ukbd.c	Sun Apr  3 22:01:26 2011	(r220308)
@@ -18,13 +18,6 @@ __FBSDID("$FreeBSD$");
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *        This product includes software developed by the NetBSD
- *        Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- *    contributors may be used to endorse or promote products derived
- *    from this software without specific prior written permission.
  *
  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED

Modified: stable/8/sys/dev/usb/input/ums.c
==============================================================================
--- stable/8/sys/dev/usb/input/ums.c	Sun Apr  3 21:12:16 2011	(r220307)
+++ stable/8/sys/dev/usb/input/ums.c	Sun Apr  3 22:01:26 2011	(r220308)
@@ -14,13 +14,6 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *        This product includes software developed by the NetBSD
- *        Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- *    contributors may be used to endorse or promote products derived
- *    from this software without specific prior written permission.
  *
  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED

Modified: stable/8/sys/dev/usb/serial/uftdi.c
==============================================================================
--- stable/8/sys/dev/usb/serial/uftdi.c	Sun Apr  3 21:12:16 2011	(r220307)
+++ stable/8/sys/dev/usb/serial/uftdi.c	Sun Apr  3 22:01:26 2011	(r220308)
@@ -15,13 +15,6 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *        This product includes software developed by the NetBSD
- *        Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- *    contributors may be used to endorse or promote products derived
- *    from this software without specific prior written permission.
  *
  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED

Modified: stable/8/sys/dev/usb/serial/ugensa.c
==============================================================================
--- stable/8/sys/dev/usb/serial/ugensa.c	Sun Apr  3 21:12:16 2011	(r220307)
+++ stable/8/sys/dev/usb/serial/ugensa.c	Sun Apr  3 22:01:26 2011	(r220308)
@@ -16,13 +16,6 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *        This product includes software developed by the NetBSD
- *        Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- *    contributors may be used to endorse or promote products derived
- *    from this software without specific prior written permission.
  *
  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED

Modified: stable/8/sys/dev/usb/serial/uipaq.c
==============================================================================
--- stable/8/sys/dev/usb/serial/uipaq.c	Sun Apr  3 21:12:16 2011	(r220307)
+++ stable/8/sys/dev/usb/serial/uipaq.c	Sun Apr  3 22:01:26 2011	(r220308)
@@ -17,13 +17,6 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *        This product includes software developed by the NetBSD
- *        Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- *    contributors may be used to endorse or promote products derived
- *    from this software without specific prior written permission.
  *
  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED

Modified: stable/8/sys/dev/usb/serial/ulpt.c
==============================================================================
--- stable/8/sys/dev/usb/serial/ulpt.c	Sun Apr  3 21:12:16 2011	(r220307)
+++ stable/8/sys/dev/usb/serial/ulpt.c	Sun Apr  3 22:01:26 2011	(r220308)
@@ -19,13 +19,6 @@ __FBSDID("$FreeBSD$");
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *        This product includes software developed by the NetBSD
- *        Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- *    contributors may be used to endorse or promote products derived
- *    from this software without specific prior written permission.
  *
  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED

Modified: stable/8/sys/dev/usb/serial/uvisor.c
==============================================================================
--- stable/8/sys/dev/usb/serial/uvisor.c	Sun Apr  3 21:12:16 2011	(r220307)
+++ stable/8/sys/dev/usb/serial/uvisor.c	Sun Apr  3 22:01:26 2011	(r220308)
@@ -29,13 +29,6 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *        This product includes software developed by the NetBSD
- *        Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- *    contributors may be used to endorse or promote products derived
- *    from this software without specific prior written permission.
  *
  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED

Modified: stable/8/sys/dev/usb/template/usb_template.c
==============================================================================
--- stable/8/sys/dev/usb/template/usb_template.c	Sun Apr  3 21:12:16 2011	(r220307)
+++ stable/8/sys/dev/usb/template/usb_template.c	Sun Apr  3 22:01:26 2011	(r220308)
@@ -126,7 +126,7 @@ usb_make_raw_desc(struct usb_temp_setup 
 		len = raw[0];
 		if (temp->buf) {
 			dst = USB_ADD_BYTES(temp->buf, temp->size);
-			bcopy(raw, dst, len);
+			memcpy(dst, raw, len);
 
 			/* check if we have got a CDC union descriptor */
 

Modified: stable/8/sys/dev/usb/usb_cdc.h
==============================================================================
--- stable/8/sys/dev/usb/usb_cdc.h	Sun Apr  3 21:12:16 2011	(r220307)
+++ stable/8/sys/dev/usb/usb_cdc.h	Sun Apr  3 22:01:26 2011	(r220308)
@@ -17,13 +17,6 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *        This product includes software developed by the NetBSD
- *        Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- *    contributors may be used to endorse or promote products derived
- *    from this software without specific prior written permission.
  *
  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED

Modified: stable/8/sys/dev/usb/usb_hid.c
==============================================================================
--- stable/8/sys/dev/usb/usb_hid.c	Sun Apr  3 21:12:16 2011	(r220307)
+++ stable/8/sys/dev/usb/usb_hid.c	Sun Apr  3 22:01:26 2011	(r220308)
@@ -19,13 +19,6 @@ __FBSDID("$FreeBSD$");
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *        This product includes software developed by the NetBSD
- *        Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- *    contributors may be used to endorse or promote products derived
- *    from this software without specific prior written permission.
  *
  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED

Modified: stable/8/sys/dev/usb/usb_transfer.c
==============================================================================
--- stable/8/sys/dev/usb/usb_transfer.c	Sun Apr  3 21:12:16 2011	(r220307)
+++ stable/8/sys/dev/usb/usb_transfer.c	Sun Apr  3 22:01:26 2011	(r220308)
@@ -1148,7 +1148,9 @@ done:
 static void
 usbd_transfer_unsetup_sub(struct usb_xfer_root *info, uint8_t needs_delay)
 {
+#if USB_HAVE_BUSDMA
 	struct usb_page_cache *pc;
+#endif
 
 	USB_BUS_LOCK_ASSERT(info->bus, MA_OWNED);
 

Modified: stable/8/sys/dev/usb/usbdevs
==============================================================================
--- stable/8/sys/dev/usb/usbdevs	Sun Apr  3 21:12:16 2011	(r220307)
+++ stable/8/sys/dev/usb/usbdevs	Sun Apr  3 22:01:26 2011	(r220308)
@@ -17,13 +17,6 @@ $FreeBSD$
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *        This product includes software developed by the NetBSD
- *        Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- *    contributors may be used to endorse or promote products derived
- *    from this software without specific prior written permission.
  *
  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED

Modified: stable/8/usr.sbin/usbconfig/dump.c
==============================================================================
--- stable/8/usr.sbin/usbconfig/dump.c	Sun Apr  3 21:12:16 2011	(r220307)
+++ stable/8/usr.sbin/usbconfig/dump.c	Sun Apr  3 22:01:26 2011	(r220308)
@@ -65,11 +65,11 @@ dump_speed(uint8_t value)
 	case LIBUSB20_SPEED_VARIABLE:
 		return ("VARIABLE (52-480Mbps)");
 	case LIBUSB20_SPEED_SUPER:
-		return ("SUPER (4.8Gbps)");
+		return ("SUPER (5.0Gbps)");
 	default:
 		break;
 	}
-	return ("unknown");
+	return ("UNKNOWN ()");
 }
 
 const char *

From owner-svn-src-stable-8@FreeBSD.ORG  Sun Apr  3 22:15:00 2011
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9A546106566C;
	Sun,  3 Apr 2011 22:15:00 +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 7FEA38FC14;
	Sun,  3 Apr 2011 22:15: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 p33MF0gb062760;
	Sun, 3 Apr 2011 22:15:00 GMT (envelope-from hselasky@svn.freebsd.org)
Received: (from hselasky@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p33MF0qP062758;
	Sun, 3 Apr 2011 22:15:00 GMT (envelope-from hselasky@svn.freebsd.org)
Message-Id: <201104032215.p33MF0qP062758@svn.freebsd.org>
From: Hans Petter Selasky 
Date: Sun, 3 Apr 2011 22:15: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: r220309 - stable/8/sys/dev/usb/controller
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Sun, 03 Apr 2011 22:15:00 -0000

Author: hselasky
Date: Sun Apr  3 22:15:00 2011
New Revision: 220309
URL: http://svn.freebsd.org/changeset/base/220309

Log:
  MFC r219845, r219930, r219949 and r219983.
  - Use software to compute EHCI data toggle instead of hardware.
  - Fix EHCI initialisation order with regard to debug prints.
  
  Approved by:	thompsa (mentor)

Modified:
  stable/8/sys/dev/usb/controller/ehci.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/dev/usb/controller/ehci.c
==============================================================================
--- stable/8/sys/dev/usb/controller/ehci.c	Sun Apr  3 22:01:26 2011	(r220308)
+++ stable/8/sys/dev/usb/controller/ehci.c	Sun Apr  3 22:15:00 2011	(r220309)
@@ -260,6 +260,8 @@ ehci_init(ehci_softc_t *sc)
 	usb_callout_init_mtx(&sc->sc_tmo_pcd, &sc->sc_bus.bus_mtx, 0);
 	usb_callout_init_mtx(&sc->sc_tmo_poll, &sc->sc_bus.bus_mtx, 0);
 
+	sc->sc_offs = EHCI_CAPLENGTH(EREAD4(sc, EHCI_CAPLEN_HCIVERSION));
+
 #ifdef USB_DEBUG
 	if (ehciiaadbug)
 		sc->sc_flags |= EHCI_SCFLG_IAADBUG;
@@ -270,8 +272,6 @@ ehci_init(ehci_softc_t *sc)
 	}
 #endif
 
-	sc->sc_offs = EHCI_CAPLENGTH(EREAD4(sc, EHCI_CAPLEN_HCIVERSION));
-
 	version = EHCI_HCIVERSION(EREAD4(sc, EHCI_CAPLEN_HCIVERSION));
 	device_printf(sc->sc_bus.bdev, "EHCI version %x.%x\n",
 	    version >> 8, version & 0xff);
@@ -1181,6 +1181,26 @@ _ehci_remove_qh(ehci_qh_t *sqh, ehci_qh_
 	return (last);
 }
 
+static void
+ehci_data_toggle_update(struct usb_xfer *xfer, uint16_t actlen, uint16_t xlen)
+{
+	uint16_t rem;
+	uint8_t dt;
+
+	/* count number of full packets */
+	dt = (actlen / xfer->max_packet_size) & 1;
+
+	/* compute remainder */
+	rem = actlen % xfer->max_packet_size;
+
+	if (rem > 0)
+		dt ^= 1;	/* short packet at the end */
+	else if (actlen != xlen)
+		dt ^= 1;	/* zero length packet at the end */
+
+	xfer->endpoint->toggle_next ^= dt;
+}
+
 static usb_error_t
 ehci_non_isoc_done_sub(struct usb_xfer *xfer)
 {
@@ -1214,7 +1234,10 @@ ehci_non_isoc_done_sub(struct usb_xfer *
 			status |= EHCI_QTD_HALTED;
 		} else if (xfer->aframes != xfer->nframes) {
 			xfer->frlengths[xfer->aframes] += td->len - len;
+			/* manually update data toggle */
+			ehci_data_toggle_update(xfer, td->len - len, td->len);
 		}
+
 		/* Check for last transfer */
 		if (((void *)td) == xfer->td_transfer_last) {
 			td = NULL;
@@ -1296,9 +1319,6 @@ ehci_non_isoc_done(struct usb_xfer *xfer
 
 	status = hc32toh(sc, qh->qh_qtd.qtd_status);
 
-	xfer->endpoint->toggle_next =
-	    (status & EHCI_QTD_TOGGLE_MASK) ? 1 : 0;
-
 	/* reset scanner */
 
 	xfer->td_transfer_cache = xfer->td_transfer_first;
@@ -1877,6 +1897,8 @@ ehci_setup_standard_chain(struct usb_xfe
 	if (xfer->flags_int.control_xfr) {
 		if (xfer->flags_int.control_hdr) {
 
+			xfer->endpoint->toggle_next = 0;
+
 			temp.qtd_status &=
 			    htohc32(temp.sc, EHCI_QTD_SET_CERR(3));
 			temp.qtd_status |= htohc32(temp.sc,

From owner-svn-src-stable-8@FreeBSD.ORG  Sun Apr  3 22:21:41 2011
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 372B4106566C;
	Sun,  3 Apr 2011 22:21:41 +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 0DF558FC14;
	Sun,  3 Apr 2011 22:21: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 p33MLeAG062934;
	Sun, 3 Apr 2011 22:21:40 GMT (envelope-from hselasky@svn.freebsd.org)
Received: (from hselasky@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p33MLeOL062932;
	Sun, 3 Apr 2011 22:21:40 GMT (envelope-from hselasky@svn.freebsd.org)
Message-Id: <201104032221.p33MLeOL062932@svn.freebsd.org>
From: Hans Petter Selasky 
Date: Sun, 3 Apr 2011 22:21: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: r220310 - stable/8/sys/dev/usb/input
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Sun, 03 Apr 2011 22:21:41 -0000

Author: hselasky
Date: Sun Apr  3 22:21:40 2011
New Revision: 220310
URL: http://svn.freebsd.org/changeset/base/220310

Log:
  MFC r219848.
  - Update format of sysctl node.
  
  Approved by:	thompsa (mentor)

Modified:
  stable/8/sys/dev/usb/input/ums.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/dev/usb/input/ums.c
==============================================================================
--- stable/8/sys/dev/usb/input/ums.c	Sun Apr  3 22:15:00 2011	(r220309)
+++ stable/8/sys/dev/usb/input/ums.c	Sun Apr  3 22:21:40 2011	(r220310)
@@ -669,7 +669,7 @@ ums_attach(device_t dev)
 	    SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
 	    OID_AUTO, "parseinfo", CTLTYPE_STRING|CTLFLAG_RD,
 	    sc, 0, ums_sysctl_handler_parseinfo,
-	    "", "Dump UMS report parsing information");
+	    "", "Dump of parsed HID report descriptor");
 
 	return (0);
 
@@ -950,10 +950,10 @@ ums_sysctl_handler_parseinfo(SYSCTL_HAND
 	struct ums_softc *sc = arg1;
 	struct ums_info *info;
 	struct sbuf *sb;
-	int i, j, err;
+	int i, j, err, had_output;
 
 	sb = sbuf_new_auto();
-	for (i = 0; i < UMS_INFO_MAX; i++) {
+	for (i = 0, had_output = 0; i < UMS_INFO_MAX; i++) {
 		info = &sc->sc_info[i];
 
 		/* Don't emit empty info */
@@ -963,6 +963,9 @@ ums_sysctl_handler_parseinfo(SYSCTL_HAND
 		    info->sc_buttons == 0)
 			continue;
 
+		if (had_output)
+			sbuf_printf(sb, "\n");
+		had_output = 1;
 		sbuf_printf(sb, "i%d:", i + 1);
 		if (info->sc_flags & UMS_FLAG_X_AXIS)
 			sbuf_printf(sb, " X:r%d, p%d, s%d;",
@@ -996,7 +999,6 @@ ums_sysctl_handler_parseinfo(SYSCTL_HAND
 			    (int)info->sc_loc_btn[j].pos,
 			    (int)info->sc_loc_btn[j].size);
 		}
-		sbuf_printf(sb, "\n");
 	}
 	sbuf_finish(sb);
 	err = SYSCTL_OUT(req, sbuf_data(sb), sbuf_len(sb) + 1);

From owner-svn-src-stable-8@FreeBSD.ORG  Mon Apr  4 08:04:32 2011
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7F4E7106566B;
	Mon,  4 Apr 2011 08:04:32 +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 6A6A68FC0C;
	Mon,  4 Apr 2011 08:04: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 p3484WLm075422;
	Mon, 4 Apr 2011 08:04:32 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p3484WxW075420;
	Mon, 4 Apr 2011 08:04:32 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201104040804.p3484WxW075420@svn.freebsd.org>
From: Konstantin Belousov 
Date: Mon, 4 Apr 2011 08:04: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: r220318 - stable/8/lib/libc/sys
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Mon, 04 Apr 2011 08:04:32 -0000

Author: kib
Date: Mon Apr  4 08:04:32 2011
New Revision: 220318
URL: http://svn.freebsd.org/changeset/base/220318

Log:
  MFC r220253:
  Fix mdoc errors.

Modified:
  stable/8/lib/libc/sys/open.2
Directory Properties:
  stable/8/lib/libc/   (props changed)
  stable/8/lib/libc/stdtime/   (props changed)

Modified: stable/8/lib/libc/sys/open.2
==============================================================================
--- stable/8/lib/libc/sys/open.2	Mon Apr  4 07:45:08 2011	(r220317)
+++ stable/8/lib/libc/sys/open.2	Mon Apr  4 08:04:32 2011	(r220318)
@@ -239,8 +239,7 @@ When a new file is created it is given t
 which contains it.
 .Pp
 Unless
-.Dv
-O_CLOEXEC
+.Dv O_CLOEXEC
 flag was specified,
 the new descriptor is set to remain open across
 .Xr execve 2
@@ -407,7 +406,7 @@ of
 .Dv O_WRONLY ,
 .Dv O_RDWR
 and
-.Dv O_EXEC.
+.Dv O_EXEC .
 .It Bq Eq EBADF
 The
 .Fa path

From owner-svn-src-stable-8@FreeBSD.ORG  Mon Apr  4 09:36:29 2011
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 77C4A106564A;
	Mon,  4 Apr 2011 09:36:29 +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 6376D8FC0C;
	Mon,  4 Apr 2011 09:36: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 p349aTUw077916;
	Mon, 4 Apr 2011 09:36:29 GMT (envelope-from pluknet@svn.freebsd.org)
Received: (from pluknet@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p349aT06077914;
	Mon, 4 Apr 2011 09:36:29 GMT (envelope-from pluknet@svn.freebsd.org)
Message-Id: <201104040936.p349aT06077914@svn.freebsd.org>
From: Sergey Kandaurov 
Date: Mon, 4 Apr 2011 09:36: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: r220320 - stable/8/lib/libc/gen
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Mon, 04 Apr 2011 09:36:29 -0000

Author: pluknet
Date: Mon Apr  4 09:36:29 2011
New Revision: 220320
URL: http://svn.freebsd.org/changeset/base/220320

Log:
  MFC r220157:
  
  Use FD_CLOEXEC explicitly.

Modified:
  stable/8/lib/libc/gen/syslog.c
Directory Properties:
  stable/8/lib/libc/   (props changed)
  stable/8/lib/libc/stdtime/   (props changed)

Modified: stable/8/lib/libc/gen/syslog.c
==============================================================================
--- stable/8/lib/libc/gen/syslog.c	Mon Apr  4 09:25:27 2011	(r220319)
+++ stable/8/lib/libc/gen/syslog.c	Mon Apr  4 09:36:29 2011	(r220320)
@@ -342,7 +342,7 @@ connectlog(void)
 	if (LogFile == -1) {
 		if ((LogFile = _socket(AF_UNIX, SOCK_DGRAM, 0)) == -1)
 			return;
-		(void)_fcntl(LogFile, F_SETFD, 1);
+		(void)_fcntl(LogFile, F_SETFD, FD_CLOEXEC);
 	}
 	if (LogFile != -1 && status == NOCONN) {
 		SyslogAddr.sun_len = sizeof(SyslogAddr);

From owner-svn-src-stable-8@FreeBSD.ORG  Mon Apr  4 09:56:10 2011
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C48A51065676;
	Mon,  4 Apr 2011 09:56:10 +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 B07958FC1F;
	Mon,  4 Apr 2011 09:56: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 p349uAwn078449;
	Mon, 4 Apr 2011 09:56:10 GMT (envelope-from pluknet@svn.freebsd.org)
Received: (from pluknet@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p349uAKe078447;
	Mon, 4 Apr 2011 09:56:10 GMT (envelope-from pluknet@svn.freebsd.org)
Message-Id: <201104040956.p349uAKe078447@svn.freebsd.org>
From: Sergey Kandaurov 
Date: Mon, 4 Apr 2011 09:56: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: r220322 - stable/8/sys/netinet
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Mon, 04 Apr 2011 09:56:10 -0000

Author: pluknet
Date: Mon Apr  4 09:56:10 2011
New Revision: 220322
URL: http://svn.freebsd.org/changeset/base/220322

Log:
  MFC r219828:
  
   Reference ifaddr object before unlocking as it can be freed
   from another context at the moment of later access.
  
  PR:		kern/155555
  Submitted by:	Andrew Boyer 

Modified:
  stable/8/sys/netinet/in.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/netinet/in.c
==============================================================================
--- stable/8/sys/netinet/in.c	Mon Apr  4 09:38:05 2011	(r220321)
+++ stable/8/sys/netinet/in.c	Mon Apr  4 09:56:10 2011	(r220322)
@@ -1174,8 +1174,8 @@ in_scrubprefix(struct in_ifaddr *target)
 		 *      doesn't support such action.
 		 */
 		if ((ia->ia_flags & IFA_ROUTE) == 0
-		    && (ia->ia_ifp->if_type != IFT_CARP)
-							) {
+		    && (ia->ia_ifp->if_type != IFT_CARP)) {
+			ifa_ref(&ia->ia_ifa);
 			IN_IFADDR_RUNLOCK();
 			rtinit(&(target->ia_ifa), (int)RTM_DELETE,
 			    rtinitflags(target));
@@ -1185,6 +1185,7 @@ in_scrubprefix(struct in_ifaddr *target)
 			    rtinitflags(ia) | RTF_UP);
 			if (error == 0)
 				ia->ia_flags |= IFA_ROUTE;
+			ifa_free(&ia->ia_ifa);
 			return (error);
 		}
 	}

From owner-svn-src-stable-8@FreeBSD.ORG  Mon Apr  4 14:54:52 2011
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CF55D1065670;
	Mon,  4 Apr 2011 14:54:52 +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 BE3728FC13;
	Mon,  4 Apr 2011 14:54: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 p34Esq1o086655;
	Mon, 4 Apr 2011 14:54:52 GMT (envelope-from ume@svn.freebsd.org)
Received: (from ume@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p34EsqtZ086653;
	Mon, 4 Apr 2011 14:54:52 GMT (envelope-from ume@svn.freebsd.org)
Message-Id: <201104041454.p34EsqtZ086653@svn.freebsd.org>
From: Hajimu UMEMOTO 
Date: Mon, 4 Apr 2011 14:54:52 +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: r220326 - stable/8/usr.bin/su
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Mon, 04 Apr 2011 14:54:52 -0000

Author: ume
Date: Mon Apr  4 14:54:52 2011
New Revision: 220326
URL: http://svn.freebsd.org/changeset/base/220326

Log:
  MFC r220055: getlogin() may return NULL.

Modified:
  stable/8/usr.bin/su/su.c
Directory Properties:
  stable/8/usr.bin/su/   (props changed)

Modified: stable/8/usr.bin/su/su.c
==============================================================================
--- stable/8/usr.bin/su/su.c	Mon Apr  4 14:53:36 2011	(r220325)
+++ stable/8/usr.bin/su/su.c	Mon Apr  4 14:54:52 2011	(r220326)
@@ -153,7 +153,7 @@ int
 main(int argc, char *argv[])
 {
 	static char	*cleanenv;
-	struct passwd	*pwd;
+	struct passwd	*pwd = NULL;
 	struct pam_conv	conv = { openpam_ttyconv, NULL };
 	enum tristate	iscsh;
 	login_cap_t	*lc;
@@ -259,8 +259,9 @@ main(int argc, char *argv[])
 	/* get current login name, real uid and shell */
 	ruid = getuid();
 	username = getlogin();
-	pwd = getpwnam(username);
-	if (username == NULL || pwd == NULL || pwd->pw_uid != ruid)
+	if (username != NULL)
+		pwd = getpwnam(username);
+	if (pwd == NULL || pwd->pw_uid != ruid)
 		pwd = getpwuid(ruid);
 	if (pwd == NULL) {
 #ifdef USE_BSM_AUDIT

From owner-svn-src-stable-8@FreeBSD.ORG  Mon Apr  4 18:47:18 2011
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 28E261065672;
	Mon,  4 Apr 2011 18:47:18 +0000 (UTC) (envelope-from np@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1773F8FC1B;
	Mon,  4 Apr 2011 18:47: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 p34IlHkT092381;
	Mon, 4 Apr 2011 18:47:17 GMT (envelope-from np@svn.freebsd.org)
Received: (from np@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p34IlHdP092376;
	Mon, 4 Apr 2011 18:47:17 GMT (envelope-from np@svn.freebsd.org)
Message-Id: <201104041847.p34IlHdP092376@svn.freebsd.org>
From: Navdeep Parhar 
Date: Mon, 4 Apr 2011 18:47:17 +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: r220339 - in stable/8/sys: dev/cxgbe dev/cxgbe/common
	modules/cxgbe modules/cxgbe/if_cxgbe
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Mon, 04 Apr 2011 18:47:18 -0000

Author: np
Date: Mon Apr  4 18:47:17 2011
New Revision: 220339
URL: http://svn.freebsd.org/changeset/base/220339

Log:
  MFC r220231, r220232
  
  r220231:
  Allow multiple modules within sys/modules/cxgbe.  The first one is if_cxgbe.
  
  r220232:
  Update header and related code for firmware 1.3.8

Added:
  stable/8/sys/modules/cxgbe/if_cxgbe/
     - copied from r220231, head/sys/modules/cxgbe/if_cxgbe/
Replaced:
  stable/8/sys/modules/cxgbe/Makefile
     - copied unchanged from r220231, head/sys/modules/cxgbe/Makefile
Modified:
  stable/8/sys/dev/cxgbe/common/common.h
  stable/8/sys/dev/cxgbe/common/t4fw_interface.h
  stable/8/sys/dev/cxgbe/t4_main.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/cxgbe/common/common.h
==============================================================================
--- stable/8/sys/dev/cxgbe/common/common.h	Mon Apr  4 18:39:04 2011	(r220338)
+++ stable/8/sys/dev/cxgbe/common/common.h	Mon Apr  4 18:47:17 2011	(r220339)
@@ -54,7 +54,7 @@ enum {
 
 #define FW_VERSION_MAJOR 1
 #define FW_VERSION_MINOR 3
-#define FW_VERSION_MICRO 0
+#define FW_VERSION_MICRO 8
 
 struct port_stats {
 	u64 tx_octets;            /* total # of octets in good frames */

Modified: stable/8/sys/dev/cxgbe/common/t4fw_interface.h
==============================================================================
--- stable/8/sys/dev/cxgbe/common/t4fw_interface.h	Mon Apr  4 18:39:04 2011	(r220338)
+++ stable/8/sys/dev/cxgbe/common/t4fw_interface.h	Mon Apr  4 18:47:17 2011	(r220339)
@@ -47,7 +47,7 @@ enum fw_retval {
 	FW_ENOSYS		= 38,	/* functionality not implemented */
 	FW_EPROTO		= 71,	/* protocol error */
 	FW_ETIMEDOUT		= 110,	/* timeout */
-	FW_TIMEDOUT		= 110,	/* timeout */
+	FW_EINPROGRESS		= 115,	/* fw internal */
 	FW_SCSI_ABORT_REQUESTED	= 128,	/* */
 	FW_SCSI_ABORT_TIMEDOUT	= 129,	/* */
 	FW_SCSI_ABORTED		= 130,	/* */
@@ -3934,13 +3934,11 @@ enum fw_port_cap {
 	FW_PORT_CAP_FC_RX		= 0x0040,
 	FW_PORT_CAP_FC_TX		= 0x0080,
 	FW_PORT_CAP_ANEG		= 0x0100,
-	FW_PORT_CAP_MDI_0		= 0x0200,
-	FW_PORT_CAP_MDI_1		= 0x0400,
-	FW_PORT_CAP_BEAN		= 0x0800,
-	FW_PORT_CAP_PMA_LPBK		= 0x1000,
-	FW_PORT_CAP_PCS_LPBK		= 0x2000,
-	FW_PORT_CAP_PHYXS_LPBK		= 0x4000,
-	FW_PORT_CAP_FAR_END_LPBK	= 0x8000,
+	FW_PORT_CAP_MDIX		= 0x0200,
+	FW_PORT_CAP_MDIAUTO		= 0x0400,
+	FW_PORT_CAP_FEC			= 0x0800,
+	FW_PORT_CAP_TECHKR		= 0x1000,
+	FW_PORT_CAP_TECHKX4		= 0x2000,
 };
 
 #define S_FW_PORT_CAP_SPEED	0
@@ -3955,6 +3953,12 @@ enum fw_port_cap {
 #define G_FW_PORT_CAP_FC(x) \
     (((x) >> S_FW_PORT_CAP_FC) & M_FW_PORT_CAP_FC)
 
+#define S_FW_PORT_CAP_ANEG	8
+#define M_FW_PORT_CAP_ANEG	0x1
+#define V_FW_PORT_CAP_ANEG(x)	((x) << S_FW_PORT_CAP_ANEG)
+#define G_FW_PORT_CAP_ANEG(x) \
+    (((x) >> S_FW_PORT_CAP_ANEG) & M_FW_PORT_CAP_ANEG)
+
 enum fw_port_mdi {
 	FW_PORT_CAP_MDI_UNCHANGED,
 	FW_PORT_CAP_MDI_AUTO,
@@ -4253,16 +4257,16 @@ enum fw_port_type {
 /* These are read from module's EEPROM and determined once the
    module is inserted. */
 enum fw_port_module_type {
-	FW_PORT_MOD_TYPE_NA,
-	FW_PORT_MOD_TYPE_LR = 0x1,
-	FW_PORT_MOD_TYPE_SR = 0x2,
-	FW_PORT_MOD_TYPE_ER = 0x3,
-	FW_PORT_MOD_TYPE_TWINAX_PASSIVE = 0x4,
-	FW_PORT_MOD_TYPE_TWINAX_ACTIVE = 0x5,
-
-	FW_PORT_MOD_TYPE_LRM = 0x6,
-
-	FW_PORT_MOD_TYPE_NONE = M_FW_PORT_CMD_MODTYPE
+	FW_PORT_MOD_TYPE_NA		= 0x0,
+	FW_PORT_MOD_TYPE_LR		= 0x1,
+	FW_PORT_MOD_TYPE_SR		= 0x2,
+	FW_PORT_MOD_TYPE_ER		= 0x3,
+	FW_PORT_MOD_TYPE_TWINAX_PASSIVE	= 0x4,
+	FW_PORT_MOD_TYPE_TWINAX_ACTIVE	= 0x5,
+	FW_PORT_MOD_TYPE_LRM		= 0x6,
+	FW_PORT_MOD_TYPE_UNKNOWN	= M_FW_PORT_CMD_MODTYPE - 2,
+	FW_PORT_MOD_TYPE_NOTSUPPORTED	= M_FW_PORT_CMD_MODTYPE - 1,
+	FW_PORT_MOD_TYPE_NONE		= M_FW_PORT_CMD_MODTYPE
 };
 
 /* used by FW and tools may use this to generate VPD */

Modified: stable/8/sys/dev/cxgbe/t4_main.c
==============================================================================
--- stable/8/sys/dev/cxgbe/t4_main.c	Mon Apr  4 18:39:04 2011	(r220338)
+++ stable/8/sys/dev/cxgbe/t4_main.c	Mon Apr  4 18:47:17 2011	(r220339)
@@ -2748,11 +2748,15 @@ t4_os_portmod_changed(const struct adapt
 {
 	struct port_info *pi = sc->port[idx];
 	static const char *mod_str[] = {
-		NULL, "LR", "SR", "ER", "TWINAX", "active TWINAX"
+		NULL, "LR", "SR", "ER", "TWINAX", "active TWINAX", "LRM"
 	};
 
 	if (pi->mod_type == FW_PORT_MOD_TYPE_NONE)
 		if_printf(pi->ifp, "transceiver unplugged.\n");
+	else if (pi->mod_type == FW_PORT_MOD_TYPE_UNKNOWN)
+		if_printf(pi->ifp, "unknown transceiver inserted.\n");
+	else if (pi->mod_type == FW_PORT_MOD_TYPE_NOTSUPPORTED)
+		if_printf(pi->ifp, "unsupported transceiver inserted.\n");
 	else if (pi->mod_type > 0 && pi->mod_type < ARRAY_SIZE(mod_str)) {
 		if_printf(pi->ifp, "%s transceiver inserted.\n",
 		    mod_str[pi->mod_type]);

Copied: stable/8/sys/modules/cxgbe/Makefile (from r220231, head/sys/modules/cxgbe/Makefile)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/8/sys/modules/cxgbe/Makefile	Mon Apr  4 18:47:17 2011	(r220339, copy of r220231, head/sys/modules/cxgbe/Makefile)
@@ -0,0 +1,7 @@
+#
+# $FreeBSD$
+#
+
+SUBDIR = if_cxgbe
+
+.include 

From owner-svn-src-stable-8@FreeBSD.ORG  Mon Apr  4 20:01:10 2011
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 014E5106566C;
	Mon,  4 Apr 2011 20:01:10 +0000 (UTC) (envelope-from np@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E23018FC14;
	Mon,  4 Apr 2011 20:01: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 p34K19Xg094085;
	Mon, 4 Apr 2011 20:01:09 GMT (envelope-from np@svn.freebsd.org)
Received: (from np@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p34K19wQ094078;
	Mon, 4 Apr 2011 20:01:09 GMT (envelope-from np@svn.freebsd.org)
Message-Id: <201104042001.p34K19wQ094078@svn.freebsd.org>
From: Navdeep Parhar 
Date: Mon, 4 Apr 2011 20:01: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: r220340 - in stable/8/sys/dev/cxgb: . common
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Mon, 04 Apr 2011 20:01:10 -0000

Author: np
Date: Mon Apr  4 20:01:09 2011
New Revision: 220340
URL: http://svn.freebsd.org/changeset/base/220340

Log:
  MFC r219945, r219946, r220009
  
  r219945:
  T3C initialization should setup the parity fence too.
  
  r219946:
  t3_free_sge_resources should be given the number of qsets it needs to free.
  
  r220009:
  Update T3 firmware to 7.11.0

Modified:
  stable/8/sys/dev/cxgb/common/cxgb_common.h
  stable/8/sys/dev/cxgb/common/cxgb_t3_hw.c
  stable/8/sys/dev/cxgb/cxgb_adapter.h
  stable/8/sys/dev/cxgb/cxgb_main.c
  stable/8/sys/dev/cxgb/cxgb_sge.c
  stable/8/sys/dev/cxgb/cxgb_t3fw.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/cxgb/common/cxgb_common.h
==============================================================================
--- stable/8/sys/dev/cxgb/common/cxgb_common.h	Mon Apr  4 18:47:17 2011	(r220339)
+++ stable/8/sys/dev/cxgb/common/cxgb_common.h	Mon Apr  4 20:01:09 2011	(r220340)
@@ -96,7 +96,7 @@ enum {
 
 enum {
 	FW_VERSION_MAJOR = 7,
-	FW_VERSION_MINOR = 8,
+	FW_VERSION_MINOR = 11,
 	FW_VERSION_MICRO = 0
 };
 

Modified: stable/8/sys/dev/cxgb/common/cxgb_t3_hw.c
==============================================================================
--- stable/8/sys/dev/cxgb/common/cxgb_t3_hw.c	Mon Apr  4 18:47:17 2011	(r220339)
+++ stable/8/sys/dev/cxgb/common/cxgb_t3_hw.c	Mon Apr  4 20:01:09 2011	(r220340)
@@ -1750,6 +1750,7 @@ static int t3_handle_intr_status(adapter
 			fatal++;
 			CH_ALERT(adapter, "%s (0x%x)\n",
 				 acts->msg, status & acts->mask);
+			status &= ~acts->mask;
 		} else if (acts->msg)
 			CH_WARN(adapter, "%s (0x%x)\n",
 				acts->msg, status & acts->mask);
@@ -2189,11 +2190,10 @@ static int mac_intr_handler(adapter_t *a
 		t3_os_link_intr(pi);
 	}
 
-	t3_write_reg(adap, A_XGM_INT_CAUSE + mac->offset, cause);
-
 	if (cause & XGM_INTR_FATAL)
 		t3_fatal_err(adap);
 
+	t3_write_reg(adap, A_XGM_INT_CAUSE + mac->offset, cause);
 	return cause != 0;
 }
 
@@ -4189,6 +4189,7 @@ int t3_init_hw(adapter_t *adapter, u32 f
 	t3_write_reg(adapter, A_PM1_TX_MODE, 0);
 	chan_init_hw(adapter, adapter->params.chan_map);
 	t3_sge_init(adapter, &adapter->params.sge);
+	t3_set_reg_field(adapter, A_PL_RST, 0, F_FATALPERREN);
 
 	t3_write_reg(adapter, A_T3DBG_GPIO_ACT_LOW, calc_gpio_intr(adapter));
 

Modified: stable/8/sys/dev/cxgb/cxgb_adapter.h
==============================================================================
--- stable/8/sys/dev/cxgb/cxgb_adapter.h	Mon Apr  4 18:47:17 2011	(r220339)
+++ stable/8/sys/dev/cxgb/cxgb_adapter.h	Mon Apr  4 20:01:09 2011	(r220340)
@@ -510,7 +510,7 @@ int t3_sge_alloc(struct adapter *);
 int t3_sge_free(struct adapter *);
 int t3_sge_alloc_qset(adapter_t *, uint32_t, int, int, const struct qset_params *,
     int, struct port_info *);
-void t3_free_sge_resources(adapter_t *);
+void t3_free_sge_resources(adapter_t *, int);
 void t3_sge_start(adapter_t *);
 void t3_sge_stop(adapter_t *);
 void t3b_intr(void *data);

Modified: stable/8/sys/dev/cxgb/cxgb_main.c
==============================================================================
--- stable/8/sys/dev/cxgb/cxgb_main.c	Mon Apr  4 18:47:17 2011	(r220339)
+++ stable/8/sys/dev/cxgb/cxgb_main.c	Mon Apr  4 20:01:09 2011	(r220340)
@@ -717,7 +717,7 @@ cxgb_controller_detach(device_t dev)
 static void
 cxgb_free(struct adapter *sc)
 {
-	int i;
+	int i, nqsets = 0;
 
 	ADAPTER_LOCK(sc);
 	sc->flags |= CXGB_SHUTDOWN;
@@ -731,6 +731,7 @@ cxgb_free(struct adapter *sc)
 		if (sc->portdev[i] &&
 		    device_delete_child(sc->dev, sc->portdev[i]) != 0)
 			device_printf(sc->dev, "failed to delete child port\n");
+		nqsets += sc->port[i].nqsets;
 	}
 
 	/*
@@ -756,7 +757,7 @@ cxgb_free(struct adapter *sc)
 	 * sysctls are cleaned up by the kernel linker.
 	 */
 	if (sc->flags & FULL_INIT_DONE) {
- 		t3_free_sge_resources(sc);
+ 		t3_free_sge_resources(sc, nqsets);
  		sc->flags &= ~FULL_INIT_DONE;
  	}
 
@@ -842,9 +843,9 @@ setup_sge_qsets(adapter_t *sc)
 			    (sc->flags & USING_MSIX) ? qset_idx + 1 : irq_idx,
 			    &sc->params.sge.qset[qset_idx], ntxq, pi);
 			if (err) {
-				t3_free_sge_resources(sc);
-				device_printf(sc->dev, "t3_sge_alloc_qset failed with %d\n",
-				    err);
+				t3_free_sge_resources(sc, qset_idx);
+				device_printf(sc->dev,
+				    "t3_sge_alloc_qset failed with %d\n", err);
 				return (err);
 			}
 		}

Modified: stable/8/sys/dev/cxgb/cxgb_sge.c
==============================================================================
--- stable/8/sys/dev/cxgb/cxgb_sge.c	Mon Apr  4 18:47:17 2011	(r220339)
+++ stable/8/sys/dev/cxgb/cxgb_sge.c	Mon Apr  4 20:01:09 2011	(r220340)
@@ -2092,18 +2092,14 @@ t3_free_qset(adapter_t *sc, struct sge_q
  *	Frees resources used by the SGE queue sets.
  */
 void
-t3_free_sge_resources(adapter_t *sc)
+t3_free_sge_resources(adapter_t *sc, int nqsets)
 {
-	int i, nqsets;
-	
-	for (nqsets = i = 0; i < (sc)->params.nports; i++) 
-		nqsets += sc->port[i].nqsets;
+	int i;
 
 	for (i = 0; i < nqsets; ++i) {
 		TXQ_LOCK(&sc->sge.qs[i]);
 		t3_free_qset(sc, &sc->sge.qs[i]);
 	}
-	
 }
 
 /**

Modified: stable/8/sys/dev/cxgb/cxgb_t3fw.h
==============================================================================
--- stable/8/sys/dev/cxgb/cxgb_t3fw.h	Mon Apr  4 18:47:17 2011	(r220339)
+++ stable/8/sys/dev/cxgb/cxgb_t3fw.h	Mon Apr  4 20:01:09 2011	(r220340)
@@ -32,8 +32,8 @@ $FreeBSD$
 
 #define U (unsigned char)
 
-static unsigned int t3fw_length = 30840;
-static unsigned char t3fw[30840] = {
+static unsigned int t3fw_length = 30976;
+static unsigned char t3fw[30976] = {
 	U 0x60, U 0x00, U 0x74, U 0x00, 
 	U 0x20, U 0x03, U 0x80, U 0x00, 
 	U 0x20, U 0x03, U 0x70, U 0x00, 
@@ -55,14 +55,14 @@ static unsigned char t3fw[30840] = {
 	U 0x1F, U 0xFF, U 0xC0, U 0x00, 
 	U 0xE3, U 0x00, U 0x04, U 0x3C, 
 	U 0x02, U 0x00, U 0x00, U 0x00, 
-	U 0x20, U 0x00, U 0x6C, U 0x34, 
-	U 0x1F, U 0xFF, U 0xC2, U 0x90, 
-	U 0x20, U 0x00, U 0x6C, U 0x7C, 
-	U 0x1F, U 0xFF, U 0xC2, U 0x94, 
-	U 0x20, U 0x00, U 0x6C, U 0xBC, 
-	U 0x1F, U 0xFF, U 0xC2, U 0x98, 
-	U 0x20, U 0x00, U 0x6D, U 0x30, 
-	U 0x1F, U 0xFF, U 0xC2, U 0x9C, 
+	U 0x20, U 0x00, U 0x6C, U 0xB4, 
+	U 0x1F, U 0xFF, U 0xC2, U 0xA0, 
+	U 0x20, U 0x00, U 0x6C, U 0xFC, 
+	U 0x1F, U 0xFF, U 0xC2, U 0xA4, 
+	U 0x20, U 0x00, U 0x6D, U 0x3C, 
+	U 0x1F, U 0xFF, U 0xC2, U 0xA8, 
+	U 0x20, U 0x00, U 0x6D, U 0xB0, 
+	U 0x1F, U 0xFF, U 0xC2, U 0xAC, 
 	U 0x20, U 0x00, U 0x03, U 0xC0, 
 	U 0xC0, U 0x00, U 0x00, U 0xE4, 
 	U 0x31, U 0x00, U 0xEA, U 0x31, 
@@ -324,105 +324,105 @@ static unsigned char t3fw[30840] = {
 	U 0x1F, U 0xFF, U 0xC0, U 0x18, 
 	U 0xE3, U 0x00, U 0x05, U 0xE0, 
 	U 0x1F, U 0xFF, U 0xC0, U 0x18, 
-	U 0x1F, U 0xFF, U 0xC2, U 0x90, 
+	U 0x1F, U 0xFF, U 0xC2, U 0x94, 
 	U 0xE3, U 0x00, U 0x05, U 0xE0, 
-	U 0x1F, U 0xFF, U 0xC2, U 0x90, 
-	U 0x1F, U 0xFF, U 0xC2, U 0x90, 
-	U 0xE3, U 0x00, U 0x08, U 0x58, 
-	U 0x1F, U 0xFF, U 0xC2, U 0x90, 
-	U 0x1F, U 0xFF, U 0xC5, U 0x8C, 
-	U 0xE3, U 0x00, U 0x08, U 0x58, 
+	U 0x1F, U 0xFF, U 0xC2, U 0x94, 
+	U 0x1F, U 0xFF, U 0xC2, U 0x94, 
+	U 0xE3, U 0x00, U 0x08, U 0x5C, 
+	U 0x1F, U 0xFF, U 0xC2, U 0xA0, 
+	U 0x1F, U 0xFF, U 0xC5, U 0x9C, 
+	U 0xE3, U 0x00, U 0x08, U 0x5C, 
 	U 0x20, U 0x00, U 0x00, U 0x00, 
 	U 0x20, U 0x00, U 0x01, U 0x6A, 
-	U 0xE3, U 0x00, U 0x0B, U 0x54, 
+	U 0xE3, U 0x00, U 0x0B, U 0x58, 
 	U 0x20, U 0x00, U 0x01, U 0x80, 
 	U 0x20, U 0x00, U 0x01, U 0x80, 
-	U 0xE3, U 0x00, U 0x0C, U 0xC0, 
+	U 0xE3, U 0x00, U 0x0C, U 0xC4, 
 	U 0x20, U 0x00, U 0x02, U 0x00, 
 	U 0x20, U 0x00, U 0x02, U 0x03, 
-	U 0xE3, U 0x00, U 0x0C, U 0xC0, 
+	U 0xE3, U 0x00, U 0x0C, U 0xC4, 
 	U 0x20, U 0x00, U 0x02, U 0x1C, 
 	U 0x20, U 0x00, U 0x02, U 0x20, 
-	U 0xE3, U 0x00, U 0x0C, U 0xC4, 
+	U 0xE3, U 0x00, U 0x0C, U 0xC8, 
 	U 0x20, U 0x00, U 0x02, U 0x20, 
 	U 0x20, U 0x00, U 0x02, U 0x26, 
-	U 0xE3, U 0x00, U 0x0C, U 0xC8, 
+	U 0xE3, U 0x00, U 0x0C, U 0xCC, 
 	U 0x20, U 0x00, U 0x02, U 0x3C, 
 	U 0x20, U 0x00, U 0x02, U 0x40, 
-	U 0xE3, U 0x00, U 0x0C, U 0xD0, 
+	U 0xE3, U 0x00, U 0x0C, U 0xD4, 
 	U 0x20, U 0x00, U 0x02, U 0x40, 
 	U 0x20, U 0x00, U 0x02, U 0x49, 
-	U 0xE3, U 0x00, U 0x0C, U 0xD4, 
+	U 0xE3, U 0x00, U 0x0C, U 0xD8, 
 	U 0x20, U 0x00, U 0x02, U 0x4C, 
 	U 0x20, U 0x00, U 0x02, U 0x50, 
-	U 0xE3, U 0x00, U 0x0C, U 0xE0, 
+	U 0xE3, U 0x00, U 0x0C, U 0xE4, 
 	U 0x20, U 0x00, U 0x02, U 0x50, 
 	U 0x20, U 0x00, U 0x02, U 0x59, 
-	U 0xE3, U 0x00, U 0x0C, U 0xE4, 
+	U 0xE3, U 0x00, U 0x0C, U 0xE8, 
 	U 0x20, U 0x00, U 0x02, U 0x5C, 
 	U 0x20, U 0x00, U 0x02, U 0x60, 
-	U 0xE3, U 0x00, U 0x0C, U 0xF0, 
+	U 0xE3, U 0x00, U 0x0C, U 0xF4, 
 	U 0x20, U 0x00, U 0x02, U 0x60, 
 	U 0x20, U 0x00, U 0x02, U 0x69, 
-	U 0xE3, U 0x00, U 0x0C, U 0xF4, 
+	U 0xE3, U 0x00, U 0x0C, U 0xF8, 
 	U 0x20, U 0x00, U 0x02, U 0x6C, 
 	U 0x20, U 0x00, U 0x02, U 0x70, 
-	U 0xE3, U 0x00, U 0x0D, U 0x00, 
+	U 0xE3, U 0x00, U 0x0D, U 0x04, 
 	U 0x20, U 0x00, U 0x02, U 0x70, 
 	U 0x20, U 0x00, U 0x02, U 0x79, 
-	U 0xE3, U 0x00, U 0x0D, U 0x04, 
+	U 0xE3, U 0x00, U 0x0D, U 0x08, 
 	U 0x20, U 0x00, U 0x02, U 0x8C, 
 	U 0x20, U 0x00, U 0x02, U 0x8C, 
-	U 0xE3, U 0x00, U 0x0D, U 0x10, 
+	U 0xE3, U 0x00, U 0x0D, U 0x14, 
 	U 0x20, U 0x00, U 0x02, U 0x90, 
 	U 0x20, U 0x00, U 0x02, U 0x93, 
-	U 0xE3, U 0x00, U 0x0D, U 0x10, 
+	U 0xE3, U 0x00, U 0x0D, U 0x14, 
 	U 0x20, U 0x00, U 0x02, U 0xAC, 
 	U 0x20, U 0x00, U 0x02, U 0xB0, 
-	U 0xE3, U 0x00, U 0x0D, U 0x14, 
+	U 0xE3, U 0x00, U 0x0D, U 0x18, 
 	U 0x20, U 0x00, U 0x02, U 0xD0, 
 	U 0x20, U 0x00, U 0x02, U 0xF2, 
-	U 0xE3, U 0x00, U 0x0D, U 0x18, 
+	U 0xE3, U 0x00, U 0x0D, U 0x1C, 
 	U 0x20, U 0x00, U 0x03, U 0xB0, 
 	U 0x20, U 0x00, U 0x03, U 0xB0, 
-	U 0xE3, U 0x00, U 0x0D, U 0x3C, 
+	U 0xE3, U 0x00, U 0x0D, U 0x40, 
 	U 0x20, U 0x00, U 0x03, U 0xB0, 
 	U 0x20, U 0x00, U 0x03, U 0xB0, 
-	U 0xE3, U 0x00, U 0x0D, U 0x3C, 
+	U 0xE3, U 0x00, U 0x0D, U 0x40, 
 	U 0x20, U 0x00, U 0x03, U 0xB0, 
 	U 0x20, U 0x00, U 0x03, U 0xB0, 
-	U 0xE3, U 0x00, U 0x0D, U 0x3C, 
+	U 0xE3, U 0x00, U 0x0D, U 0x40, 
 	U 0x20, U 0x00, U 0x03, U 0xB0, 
 	U 0x20, U 0x00, U 0x03, U 0xB0, 
-	U 0xE3, U 0x00, U 0x0D, U 0x3C, 
+	U 0xE3, U 0x00, U 0x0D, U 0x40, 
 	U 0x20, U 0x00, U 0x03, U 0xB0, 
-	U 0x20, U 0x00, U 0x6E, U 0x54, 
-	U 0xE3, U 0x00, U 0x0D, U 0x3C, 
-	U 0x20, U 0x00, U 0x6E, U 0x54, 
-	U 0x20, U 0x00, U 0x6E, U 0x54, 
-	U 0xE3, U 0x00, U 0x77, U 0xE0, 
+	U 0x20, U 0x00, U 0x6E, U 0xD4, 
+	U 0xE3, U 0x00, U 0x0D, U 0x40, 
+	U 0x20, U 0x00, U 0x6E, U 0xD4, 
+	U 0x20, U 0x00, U 0x6E, U 0xD4, 
+	U 0xE3, U 0x00, U 0x78, U 0x64, 
 	U 0x00, U 0x00, U 0x00, U 0x00, 
 	U 0x00, U 0x00, U 0x00, U 0x00, 
 	U 0x00, U 0x00, U 0x00, U 0x00, 
 	U 0x1F, U 0xFC, U 0x00, U 0x00, 
 	U 0x1F, U 0xFC, U 0x00, U 0x00, 
-	U 0x1F, U 0xFF, U 0xC5, U 0x90, 
-	U 0x1F, U 0xFF, U 0xC6, U 0x70, 
-	U 0x20, U 0x00, U 0x6E, U 0x58, 
-	U 0x20, U 0x00, U 0x6E, U 0x58, 
+	U 0x1F, U 0xFF, U 0xC5, U 0xA0, 
+	U 0x1F, U 0xFF, U 0xC6, U 0x90, 
+	U 0x20, U 0x00, U 0x6E, U 0xD8, 
+	U 0x20, U 0x00, U 0x6E, U 0xD8, 
 	U 0xDE, U 0xFF, U 0xFE, U 0x00, 
 	U 0x00, U 0x00, U 0x08, U 0x0C, 
 	U 0xDE, U 0xAD, U 0xBE, U 0xEF, 
-	U 0x1F, U 0xFF, U 0xC2, U 0xA0, 
+	U 0x1F, U 0xFF, U 0xC2, U 0xB0, 
 	U 0x1F, U 0xFC, U 0xFE, U 0x00, 
-	U 0x1F, U 0xFF, U 0xC0, U 0x94, 
-	U 0x1F, U 0xFF, U 0xC5, U 0xC0, 
+	U 0x1F, U 0xFF, U 0xC0, U 0xA4, 
+	U 0x1F, U 0xFF, U 0xC5, U 0xD0, 
 	U 0x30, U 0x00, U 0x00, U 0x00, 
 	U 0x00, U 0x3F, U 0xFF, U 0xFF, 
 	U 0x80, U 0x40, U 0x00, U 0x00, 
 	U 0x10, U 0x00, U 0x00, U 0x00, 
 	U 0x08, U 0x0F, U 0xFF, U 0xFF, 
-	U 0x1F, U 0xFF, U 0xC2, U 0x6D, 
+	U 0x1F, U 0xFF, U 0xC2, U 0x7D, 
 	U 0x00, U 0x0F, U 0xFF, U 0xFF, 
 	U 0x80, U 0x4F, U 0xFF, U 0xFF, 
 	U 0x80, U 0x00, U 0x00, U 0x00, 
@@ -431,6 +431,9 @@ static unsigned char t3fw[30840] = {
 	U 0x60, U 0x50, U 0x00, U 0x00, 
 	U 0x60, U 0x00, U 0x00, U 0x00, 
 	U 0x40, U 0x00, U 0x00, U 0x11, 
+	U 0x20, U 0x30, U 0x00, U 0x00, 
+	U 0x00, U 0x00, U 0xFF, U 0xFF, 
+	U 0x00, U 0x00, U 0x0B, U 0x20, 
 	U 0x35, U 0x00, U 0x00, U 0x00, 
 	U 0x41, U 0x00, U 0x00, U 0x00, 
 	U 0x10, U 0x00, U 0x00, U 0x01, 
@@ -441,6 +444,7 @@ static unsigned char t3fw[30840] = {
 	U 0x80, U 0x00, U 0x00, U 0x19, 
 	U 0x04, U 0x00, U 0x00, U 0x00, 
 	U 0x00, U 0x00, U 0x08, U 0x00, 
+	U 0xE1, U 0x00, U 0x02, U 0x00, 
 	U 0x10, U 0x00, U 0x00, U 0x05, 
 	U 0x80, U 0x60, U 0x00, U 0x00, 
 	U 0x70, U 0x00, U 0x00, U 0x00, 
@@ -454,8 +458,8 @@ static unsigned char t3fw[30840] = {
 	U 0x18, U 0x00, U 0x00, U 0x00, 
 	U 0x01, U 0x00, U 0x80, U 0x01, 
 	U 0x42, U 0x00, U 0x00, U 0x00, 
-	U 0x1F, U 0xFF, U 0xC2, U 0x1D, 
-	U 0x1F, U 0xFF, U 0xC0, U 0xDC, 
+	U 0x1F, U 0xFF, U 0xC2, U 0x2D, 
+	U 0x1F, U 0xFF, U 0xC0, U 0xEC, 
 	U 0x00, U 0x01, U 0x00, U 0x80, 
 	U 0x60, U 0x40, U 0x00, U 0x00, 
 	U 0x1A, U 0x00, U 0x00, U 0x00, 
@@ -472,49 +476,49 @@ static unsigned char t3fw[30840] = {
 	U 0x80, U 0x00, U 0x00, U 0x1A, 
 	U 0x03, U 0x00, U 0x00, U 0x00, 
 	U 0x80, U 0x00, U 0x04, U 0x00, 
+	U 0x04, U 0x03, U 0x04, U 0x03, 
 	U 0x50, U 0x00, U 0x00, U 0x03, 
 	U 0xFF, U 0xFF, U 0xBF, U 0xFF, 
-	U 0x1F, U 0xFF, U 0xC3, U 0xD4, 
+	U 0x1F, U 0xFF, U 0xC3, U 0xE4, 
 	U 0x00, U 0x00, U 0x0F, U 0xFF, 
 	U 0xFF, U 0xFF, U 0xF0, U 0x00, 
 	U 0x00, U 0x00, U 0x16, U 0xD0, 
 	U 0x00, U 0x00, U 0xFF, U 0xF7, 
 	U 0xA5, U 0x00, U 0x00, U 0x00, 
-	U 0x1F, U 0xFF, U 0xC4, U 0xB0, 
-	U 0x1F, U 0xFF, U 0xC4, U 0x61, 
+	U 0x1F, U 0xFF, U 0xC4, U 0xC0, 
+	U 0x1F, U 0xFF, U 0xC4, U 0x71, 
 	U 0x00, U 0x01, U 0x00, U 0x08, 
-	U 0x00, U 0x00, U 0x0B, U 0x20, 
 	U 0x20, U 0x2F, U 0xFF, U 0x80, 
-	U 0x1F, U 0xFF, U 0xC4, U 0x55, 
+	U 0x1F, U 0xFF, U 0xC4, U 0x65, 
 	U 0x00, U 0x00, U 0x2C, U 0x00, 
 	U 0xFF, U 0xFE, U 0xFF, U 0xF8, 
 	U 0x00, U 0xFF, U 0xFF, U 0xFF, 
-	U 0x1F, U 0xFF, U 0xC5, U 0x78, 
+	U 0x1F, U 0xFF, U 0xC5, U 0x88, 
 	U 0x00, U 0x00, U 0x20, U 0x00, 
 	U 0xFF, U 0xFF, U 0xDF, U 0xFF, 
 	U 0x00, U 0x00, U 0xFF, U 0xEF, 
 	U 0x01, U 0x00, U 0x11, U 0x00, 
-	U 0x1F, U 0xFF, U 0xC3, U 0xD2, 
-	U 0x1F, U 0xFF, U 0xC5, U 0x90, 
+	U 0x1F, U 0xFF, U 0xC3, U 0xE2, 
+	U 0x1F, U 0xFF, U 0xC5, U 0xA0, 
 	U 0xFF, U 0xFF, U 0xEF, U 0xFF, 
 	U 0x00, U 0x00, U 0xFF, U 0xFB, 
-	U 0x1F, U 0xFF, U 0xC6, U 0x30, 
-	U 0x1F, U 0xFF, U 0xBE, U 0xA0, 
+	U 0x1F, U 0xFF, U 0xC6, U 0x50, 
+	U 0x1F, U 0xFF, U 0xBE, U 0xB0, 
 	U 0xFF, U 0xFF, U 0xF7, U 0xFF, 
-	U 0x1F, U 0xFF, U 0xC0, U 0x64, 
+	U 0x1F, U 0xFF, U 0xC0, U 0x74, 
 	U 0x00, U 0x00, U 0xFF, U 0xFD, 
-	U 0x1F, U 0xFF, U 0xC6, U 0x20, 
+	U 0x1F, U 0xFF, U 0xC6, U 0x40, 
 	U 0x00, U 0x01, U 0xFB, U 0xD0, 
-	U 0x1F, U 0xFF, U 0xC5, U 0xB0, 
-	U 0x1F, U 0xFF, U 0xC6, U 0x60, 
-	U 0x1F, U 0xFF, U 0xC5, U 0x91, 
+	U 0x1F, U 0xFF, U 0xC5, U 0xC0, 
+	U 0x1F, U 0xFF, U 0xC6, U 0x80, 
+	U 0x1F, U 0xFF, U 0xC5, U 0xA1, 
 	U 0xE0, U 0xFF, U 0xFE, U 0x00, 
-	U 0x1F, U 0xFF, U 0xC5, U 0xA0, 
+	U 0x1F, U 0xFF, U 0xC5, U 0xB0, 
 	U 0x00, U 0x00, U 0x80, U 0x00, 
-	U 0x1F, U 0xFF, U 0xC5, U 0x3C, 
-	U 0x1F, U 0xFF, U 0xC5, U 0xB4, 
-	U 0x1F, U 0xFF, U 0xC0, U 0x68, 
-	U 0x1F, U 0xFF, U 0xC4, U 0xD0, 
+	U 0x1F, U 0xFF, U 0xC5, U 0x4C, 
+	U 0x1F, U 0xFF, U 0xC5, U 0xC4, 
+	U 0x1F, U 0xFF, U 0xC0, U 0x78, 
+	U 0x1F, U 0xFF, U 0xC4, U 0xE4, 
 	U 0x1F, U 0xFC, U 0xFF, U 0xD8, 
 	U 0x00, U 0x01, U 0x00, U 0x81, 
 	U 0x7F, U 0xFF, U 0xFF, U 0xFF, 
@@ -522,21 +526,19 @@ static unsigned char t3fw[30840] = {
 	U 0x00, U 0x00, U 0x27, U 0x10, 
 	U 0x1F, U 0xFC, U 0xFE, U 0x30, 
 	U 0x1F, U 0xFC, U 0xFE, U 0x70, 
-	U 0xE1, U 0x00, U 0x02, U 0x00, 
-	U 0x1F, U 0xFF, U 0xC5, U 0x38, 
-	U 0x1F, U 0xFF, U 0xC5, U 0x50, 
+	U 0x1F, U 0xFF, U 0xC5, U 0x48, 
+	U 0x1F, U 0xFF, U 0xC5, U 0x60, 
 	U 0x00, U 0x03, U 0xD0, U 0x90, 
-	U 0x1F, U 0xFF, U 0xC5, U 0x64, 
+	U 0x1F, U 0xFF, U 0xC5, U 0x74, 
 	U 0x2B, U 0x50, U 0x63, U 0x80, 
 	U 0x2B, U 0x50, U 0x79, U 0x80, 
 	U 0x2B, U 0x50, U 0x90, U 0x80, 
 	U 0x2B, U 0x50, U 0xA6, U 0x80, 
-	U 0x1F, U 0xFF, U 0xC4, U 0x69, 
+	U 0x1F, U 0xFF, U 0xC4, U 0x79, 
 	U 0x01, U 0x00, U 0x11, U 0x0F, 
 	U 0x20, U 0x2F, U 0xFE, U 0x00, 
 	U 0x20, U 0x30, U 0x00, U 0x80, 
 	U 0x20, U 0x2F, U 0xFF, U 0x00, 
-	U 0x00, U 0x00, U 0xFF, U 0xFF, 
 	U 0x00, U 0x01, U 0xFF, U 0xF8, 
 	U 0x2B, U 0x50, U 0xB2, U 0x00, 
 	U 0x2B, U 0x50, U 0xB2, U 0x08, 
@@ -548,24 +550,23 @@ static unsigned char t3fw[30840] = {
 	U 0x2B, U 0x50, U 0xBD, U 0x28, 
 	U 0x2B, U 0x50, U 0xBC, U 0x80, 
 	U 0x2B, U 0x50, U 0xBD, U 0xA0, 
-	U 0x20, U 0x30, U 0x00, U 0x00, 
 	U 0xDF, U 0xFF, U 0xFE, U 0x00, 
 	U 0x50, U 0x00, U 0x00, U 0x02, 
 	U 0x00, U 0xC0, U 0x00, U 0x00, 
 	U 0x02, U 0x00, U 0x00, U 0x00, 
 	U 0xFF, U 0xFF, U 0xF7, U 0xF4, 
-	U 0x1F, U 0xFF, U 0xC0, U 0x6C, 
+	U 0x1F, U 0xFF, U 0xC0, U 0x7C, 
 	U 0x00, U 0x0F, U 0xF8, U 0x00, 
 	U 0x04, U 0x40, U 0x00, U 0x00, 
 	U 0x00, U 0x10, U 0x00, U 0x00, 
 	U 0x0C, U 0x40, U 0x00, U 0x00, 
 	U 0x1C, U 0x40, U 0x00, U 0x00, 
 	U 0xE0, U 0x00, U 0x00, U 0xA0, 
-	U 0x1F, U 0xFF, U 0xC5, U 0x40, 
+	U 0x1F, U 0xFF, U 0xC5, U 0x50, 
 	U 0x1F, U 0xFD, U 0x00, U 0x08, 
-	U 0x1F, U 0xFF, U 0xC5, U 0x54, 
-	U 0x1F, U 0xFF, U 0xC5, U 0x68, 
-	U 0x1F, U 0xFF, U 0xC5, U 0x7C, 
+	U 0x1F, U 0xFF, U 0xC5, U 0x64, 
+	U 0x1F, U 0xFF, U 0xC5, U 0x78, 
+	U 0x1F, U 0xFF, U 0xC5, U 0x8C, 
 	U 0xE1, U 0x00, U 0x06, U 0x90, 
 	U 0xE1, U 0x00, U 0x06, U 0xEC, 
 	U 0x00, U 0x00, U 0x00, U 0x00, 
@@ -616,70 +617,70 @@ static unsigned char t3fw[30840] = {
 	U 0x00, U 0x00, U 0x00, U 0x00, 
 	U 0x00, U 0x00, U 0x00, U 0x00, 
 	U 0x00, U 0x00, U 0x00, U 0x00, 
-	U 0x20, U 0x00, U 0x55, U 0x54, 
-	U 0x20, U 0x00, U 0x54, U 0x24, 
-	U 0x20, U 0x00, U 0x55, U 0x54, 
-	U 0x20, U 0x00, U 0x55, U 0x54, 
-	U 0x20, U 0x00, U 0x53, U 0x60, 
-	U 0x20, U 0x00, U 0x53, U 0x60, 
-	U 0x20, U 0x00, U 0x53, U 0x60, 
-	U 0x20, U 0x00, U 0x51, U 0xA0, 
-	U 0x20, U 0x00, U 0x51, U 0xA0, 
-	U 0x20, U 0x00, U 0x51, U 0x98, 
-	U 0x20, U 0x00, U 0x51, U 0x04, 
-	U 0x20, U 0x00, U 0x4F, U 0xAC, 
-	U 0x20, U 0x00, U 0x4D, U 0x8C, 
-	U 0x20, U 0x00, U 0x4B, U 0x60, 
-	U 0x00, U 0x00, U 0x00, U 0x00, 
-	U 0x00, U 0x00, U 0x00, U 0x00, 
-	U 0x20, U 0x00, U 0x55, U 0x24, 
-	U 0x20, U 0x00, U 0x53, U 0xF0, 
-	U 0x20, U 0x00, U 0x54, U 0x94, 
-	U 0x20, U 0x00, U 0x54, U 0x94, 
-	U 0x20, U 0x00, U 0x52, U 0x48, 
-	U 0x20, U 0x00, U 0x52, U 0x48, 
-	U 0x20, U 0x00, U 0x52, U 0x48, 
-	U 0x20, U 0x00, U 0x52, U 0x48, 
-	U 0x20, U 0x00, U 0x52, U 0x48, 
-	U 0x20, U 0x00, U 0x51, U 0x90, 
-	U 0x20, U 0x00, U 0x52, U 0x48, 
-	U 0x20, U 0x00, U 0x4E, U 0xCC, 
-	U 0x20, U 0x00, U 0x4D, U 0x3C, 
-	U 0x20, U 0x00, U 0x4B, U 0x0C, 
+	U 0x20, U 0x00, U 0x56, U 0x20, 
+	U 0x20, U 0x00, U 0x54, U 0xF0, 
+	U 0x20, U 0x00, U 0x56, U 0x20, 
+	U 0x20, U 0x00, U 0x56, U 0x20, 
+	U 0x20, U 0x00, U 0x54, U 0x2C, 
+	U 0x20, U 0x00, U 0x54, U 0x2C, 
+	U 0x20, U 0x00, U 0x54, U 0x2C, 
+	U 0x20, U 0x00, U 0x52, U 0x6C, 
+	U 0x20, U 0x00, U 0x52, U 0x6C, 
+	U 0x20, U 0x00, U 0x52, U 0x64, 
+	U 0x20, U 0x00, U 0x51, U 0xD0, 
+	U 0x20, U 0x00, U 0x50, U 0x78, 
+	U 0x20, U 0x00, U 0x4E, U 0x58, 
+	U 0x20, U 0x00, U 0x4C, U 0x2C, 
+	U 0x00, U 0x00, U 0x00, U 0x00, 
+	U 0x00, U 0x00, U 0x00, U 0x00, 
+	U 0x20, U 0x00, U 0x55, U 0xF0, 
+	U 0x20, U 0x00, U 0x54, U 0xBC, 
+	U 0x20, U 0x00, U 0x55, U 0x60, 
+	U 0x20, U 0x00, U 0x55, U 0x60, 
+	U 0x20, U 0x00, U 0x53, U 0x14, 
+	U 0x20, U 0x00, U 0x53, U 0x14, 
+	U 0x20, U 0x00, U 0x53, U 0x14, 
+	U 0x20, U 0x00, U 0x53, U 0x14, 
+	U 0x20, U 0x00, U 0x53, U 0x14, 
+	U 0x20, U 0x00, U 0x52, U 0x5C, 
+	U 0x20, U 0x00, U 0x53, U 0x14, 
+	U 0x20, U 0x00, U 0x4F, U 0x98, 
+	U 0x20, U 0x00, U 0x4E, U 0x08, 
+	U 0x20, U 0x00, U 0x4B, U 0xD8, 
 	U 0x00, U 0x00, U 0x00, U 0x00, 
 	U 0x00, U 0x00, U 0x00, U 0x00, 
-	U 0x20, U 0x00, U 0x0B, U 0xE8, 
-	U 0x20, U 0x00, U 0x3A, U 0xA8, 
+	U 0x20, U 0x00, U 0x0B, U 0xF0, 
+	U 0x20, U 0x00, U 0x3B, U 0x74, 
 	U 0x20, U 0x00, U 0x04, U 0xC0, 
-	U 0x20, U 0x00, U 0x46, U 0xFC, 
-	U 0x20, U 0x00, U 0x0B, U 0xE0, 
-	U 0x20, U 0x00, U 0x41, U 0xC0, 
+	U 0x20, U 0x00, U 0x47, U 0xC8, 
+	U 0x20, U 0x00, U 0x0B, U 0xE8, 
+	U 0x20, U 0x00, U 0x42, U 0x8C, 
 	U 0x20, U 0x00, U 0x03, U 0xF0, 
-	U 0x20, U 0x00, U 0x46, U 0xBC, 
-	U 0x20, U 0x00, U 0x4A, U 0xE8, 
-	U 0x20, U 0x00, U 0x3E, U 0xCC, 
-	U 0x20, U 0x00, U 0x3D, U 0xE8, 
-	U 0x20, U 0x00, U 0x3A, U 0x24, 
-	U 0x20, U 0x00, U 0x38, U 0xB4, 
-	U 0x20, U 0x00, U 0x36, U 0x24, 
-	U 0x20, U 0x00, U 0x31, U 0x84, 
-	U 0x20, U 0x00, U 0x3C, U 0x44, 
-	U 0x20, U 0x00, U 0x2D, U 0xB0, 
-	U 0x20, U 0x00, U 0x28, U 0x44, 
-	U 0x20, U 0x00, U 0x67, U 0xD8, 
-	U 0x20, U 0x00, U 0x23, U 0xD0, 
-	U 0x20, U 0x00, U 0x20, U 0xB0, 
-	U 0x20, U 0x00, U 0x20, U 0x5C, 
-	U 0x20, U 0x00, U 0x1D, U 0x48, 
-	U 0x20, U 0x00, U 0x18, U 0x40, 
-	U 0x20, U 0x00, U 0x15, U 0x68, 
-	U 0x20, U 0x00, U 0x0E, U 0x4C, 
-	U 0x20, U 0x00, U 0x0C, U 0x2C, 
-	U 0x20, U 0x00, U 0x11, U 0x2C, 
-	U 0x20, U 0x00, U 0x13, U 0x18, 
-	U 0x20, U 0x00, U 0x43, U 0xB8, 
-	U 0x20, U 0x00, U 0x3E, U 0x80, 
-	U 0x20, U 0x00, U 0x0B, U 0xF0, 
+	U 0x20, U 0x00, U 0x47, U 0x88, 
+	U 0x20, U 0x00, U 0x4B, U 0xB4, 
+	U 0x20, U 0x00, U 0x3F, U 0x98, 
+	U 0x20, U 0x00, U 0x3E, U 0xB4, 
+	U 0x20, U 0x00, U 0x3A, U 0xF0, 
+	U 0x20, U 0x00, U 0x39, U 0x80, 
+	U 0x20, U 0x00, U 0x36, U 0xF0, 
+	U 0x20, U 0x00, U 0x32, U 0x50, 
+	U 0x20, U 0x00, U 0x3D, U 0x10, 
+	U 0x20, U 0x00, U 0x2E, U 0x68, 
+	U 0x20, U 0x00, U 0x28, U 0xFC, 
+	U 0x20, U 0x00, U 0x68, U 0x58, 
+	U 0x20, U 0x00, U 0x24, U 0x88, 
+	U 0x20, U 0x00, U 0x21, U 0x68, 
+	U 0x20, U 0x00, U 0x21, U 0x14, 
+	U 0x20, U 0x00, U 0x1E, U 0x00, 
+	U 0x20, U 0x00, U 0x18, U 0xF8, 
+	U 0x20, U 0x00, U 0x16, U 0x20, 
+	U 0x20, U 0x00, U 0x0E, U 0xD4, 
+	U 0x20, U 0x00, U 0x0C, U 0x34, 
+	U 0x20, U 0x00, U 0x11, U 0xCC, 
+	U 0x20, U 0x00, U 0x13, U 0xB8, 
+	U 0x20, U 0x00, U 0x44, U 0x84, 
+	U 0x20, U 0x00, U 0x3F, U 0x4C, 
+	U 0x20, U 0x00, U 0x0B, U 0xF8, 
 	U 0x20, U 0x00, U 0x04, U 0xC0, 
 	U 0x00, U 0x00, U 0x00, U 0x00, 
 	U 0x00, U 0x00, U 0x00, U 0x00, 
@@ -851,22 +852,22 @@ static unsigned char t3fw[30840] = {
 	U 0x0B, U 0xBB, U 0x90, U 0x00, 
 	U 0x53, U 0x00, U 0x00, U 0x00, 
 	U 0x63, U 0xFF, U 0xFC, U 0x00, 
-	U 0x20, U 0x00, U 0x6C, U 0x10, 
+	U 0x20, U 0x00, U 0x6C, U 0x90, 
 	U 0x10, U 0xFF, U 0xFF, U 0x0A, 
 	U 0x00, U 0x00, U 0x00, U 0x00, 
-	U 0x20, U 0x00, U 0x6C, U 0x34, 
+	U 0x20, U 0x00, U 0x6C, U 0xB4, 
 	U 0x00, U 0xD2, U 0x31, U 0x10, 
 	U 0xFF, U 0xFE, U 0x0A, U 0x00, 
 	U 0x00, U 0x00, U 0x00, U 0x00, 
-	U 0x20, U 0x00, U 0x6C, U 0x7C, 
+	U 0x20, U 0x00, U 0x6C, U 0xFC, 
 	U 0x00, U 0xD3, U 0x31, U 0x10, 
 	U 0xFF, U 0xFE, U 0x0A, U 0x00, 
 	U 0x00, U 0x00, U 0x00, U 0x00, 
-	U 0x20, U 0x00, U 0x6C, U 0xBC, 
+	U 0x20, U 0x00, U 0x6D, U 0x3C, 
 	U 0x00, U 0xD4, U 0x31, U 0x10, 
 	U 0xFF, U 0xFE, U 0x0A, U 0x00, 
 	U 0x00, U 0x00, U 0x00, U 0x00, 
-	U 0x20, U 0x00, U 0x6D, U 0x30, 
+	U 0x20, U 0x00, U 0x6D, U 0xB0, 
 	U 0x00, U 0xD5, U 0x31, U 0x10, 
 	U 0xFF, U 0xFE, U 0x0A, U 0x00, 
 	U 0x00, U 0x00, U 0x00, U 0x00, 
@@ -883,8 +884,8 @@ static unsigned char t3fw[30840] = {
 	U 0xFF, U 0xFC, U 0x00, U 0x00, 
 	U 0x1F, U 0xFF, U 0xD0, U 0x00, 
 	U 0x00, U 0x04, U 0x00, U 0x20, 
-	U 0x1F, U 0xFF, U 0xC5, U 0x90, 
-	U 0x1F, U 0xFF, U 0xC6, U 0x70, 
+	U 0x1F, U 0xFF, U 0xC5, U 0xA0, 
+	U 0x1F, U 0xFF, U 0xC6, U 0x90, 
 	U 0x20, U 0x0A, U 0x00, U 0x11, 
 	U 0xFF, U 0xFB, U 0x13, U 0xFF, 
 	U 0xFB, U 0x03, U 0xE6, U 0x31, 
@@ -893,8 +894,8 @@ static unsigned char t3fw[30840] = {
 	U 0xFA, U 0xD3, U 0x0F, U 0x77, 
 	U 0x6B, U 0x06, U 0x90, U 0x60, 
 	U 0xB4, U 0x66, U 0x77, U 0x63, 
-	U 0xF8, U 0x54, U 0x15, U 0xE6, 
-	U 0x54, U 0x1A, U 0x91, U 0x0F, 
+	U 0xF8, U 0x54, U 0x16, U 0x19, 
+	U 0x54, U 0x1A, U 0xB1, U 0x0F, 
 	U 0x14, U 0x00, U 0x63, U 0xFF, 
 	U 0xF9, U 0x00, U 0x00, U 0x00, 
 	U 0x6C, U 0x10, U 0x04, U 0xC0, 
@@ -954,43 +955,45 @@ static unsigned char t3fw[30840] = {
 	U 0xC1, U 0xE8, U 0xC1, U 0xC7, 
 	U 0x2B, U 0x22, U 0x1E, U 0x28, 
 	U 0x22, U 0x1D, U 0xC0, U 0xD0, 
-	U 0x7B, U 0x81, U 0x31, U 0x29, 
+	U 0x7B, U 0x81, U 0x35, U 0x29, 
 	U 0x20, U 0x06, U 0x0B, U 0xB7, 
 	U 0x02, U 0x29, U 0x9C, U 0xFA, 
 	U 0x65, U 0x50, U 0x08, U 0x28, 
 	U 0x20, U 0x72, U 0x28, U 0x8C, 
 	U 0xFF, U 0x28, U 0x24, U 0x72, 
-	U 0x64, U 0x91, U 0x5C, U 0x2A, 
+	U 0x64, U 0x91, U 0x64, U 0x2A, 
 	U 0xB0, U 0x00, U 0x0C, U 0xA8, 
-	U 0x0C, U 0x64, U 0x81, U 0x67, 
+	U 0x0C, U 0x64, U 0x81, U 0x6F, 
 	U 0x0E, U 0xA9, U 0x0C, U 0x64, 
-	U 0x92, U 0xB3, U 0x7F, U 0xA1, 
-	U 0x37, U 0x69, U 0xAC, U 0x2F, 
-	U 0x60, U 0x00, U 0x34, U 0x00, 
-	U 0x00, U 0x28, U 0x20, U 0x06, 
-	U 0xD7, U 0xD0, U 0x28, U 0x8C, 
-	U 0xFA, U 0xCC, U 0x57, U 0x2A, 
-	U 0x20, U 0x72, U 0x2A, U 0xAC, 
-	U 0xFF, U 0x2A, U 0x24, U 0x72, 
-	U 0x64, U 0x81, U 0x35, U 0x2A, 
-	U 0xD0, U 0x00, U 0x0C, U 0xA9, 
-	U 0x0C, U 0x64, U 0x91, U 0x64, 
-	U 0x0E, U 0xAC, U 0x0C, U 0x64, 
-	U 0xC3, U 0x1B, U 0x7F, U 0xA1, 
-	U 0x07, U 0x68, U 0xAC, U 0x07, 
-	U 0xC0, U 0x20, U 0xD1, U 0x0F, 
-	U 0x00, U 0x2D, U 0x25, U 0x02, 
+	U 0x92, U 0xBB, U 0x7F, U 0xA1, 
+	U 0x3F, U 0xC1, U 0xCE, U 0x7C, 
+	U 0xA1, U 0x36, U 0x69, U 0xAC, 
+	U 0x33, U 0x60, U 0x00, U 0x37, 
+	U 0x00, U 0x29, U 0x20, U 0x06, 
+	U 0xD7, U 0xD0, U 0x29, U 0x9C, 
+	U 0xFA, U 0xCC, U 0x57, U 0x28, 
+	U 0x20, U 0x72, U 0x28, U 0x8C, 
+	U 0xFF, U 0x28, U 0x24, U 0x72, 
+	U 0x64, U 0x91, U 0x39, U 0x2A, 
+	U 0xD0, U 0x00, U 0x0C, U 0xA8, 
+	U 0x0C, U 0x64, U 0x81, U 0x68, 
+	U 0x0E, U 0xA9, U 0x0C, U 0x64, 
+	U 0x93, U 0x1F, U 0x7F, U 0xA1, 
+	U 0x0B, U 0xC1, U 0xCE, U 0x7C, 
+	U 0xA1, U 0x02, U 0x68, U 0xAC, 
+	U 0x06, U 0xC0, U 0x20, U 0xD1, 
+	U 0x0F, U 0x2D, U 0x25, U 0x02, 
 	U 0x8A, U 0x32, U 0xC0, U 0x90, 
 	U 0x0A, U 0x6E, U 0x50, U 0x65, 
 	U 0xE5, U 0xB5, U 0x29, U 0x24, 
 	U 0x67, U 0x09, U 0x0F, U 0x47, 
 	U 0x65, U 0xF5, U 0xB1, U 0x2C, 
 	U 0x20, U 0x0C, U 0x1F, U 0xEE, 
-	U 0xB5, U 0x0C, U 0xCE, U 0x11, 
+	U 0xB3, U 0x0C, U 0xCE, U 0x11, 
 	U 0xAF, U 0xEE, U 0x29, U 0xE2, 
 	U 0x86, U 0xB4, U 0x48, U 0x79, 
 	U 0x83, U 0x02, U 0x60, U 0x05, 
-	U 0x82, U 0x19, U 0xEE, U 0xB1, 
+	U 0x82, U 0x19, U 0xEE, U 0xAF, 
 	U 0x09, U 0xC9, U 0x0A, U 0x29, 
 	U 0x92, U 0xA3, U 0x68, U 0x90, 
 	U 0x07, U 0x8F, U 0x20, U 0x09, 
@@ -1002,16 +1005,16 @@ static unsigned char t3fw[30840] = {
 	U 0xD9, U 0xB0, U 0x60, U 0x00, 
 	U 0x02, U 0x00, U 0xC0, U 0x90, 
 	U 0x8B, U 0x94, U 0x17, U 0xEE, 
-	U 0xA7, U 0x0B, U 0x88, U 0x14, 
+	U 0xA5, U 0x0B, U 0x88, U 0x14, 
 	U 0x87, U 0x74, U 0x0B, U 0x0B, 
 	U 0x47, U 0xA8, U 0x77, U 0x18, 
-	U 0xEE, U 0xA5, U 0x09, U 0xBB, 
+	U 0xEE, U 0xA3, U 0x09, U 0xBB, 
 	U 0x10, U 0x08, U 0x77, U 0x02, 
 	U 0x97, U 0xF0, U 0x18, U 0xEE, 
-	U 0xA3, U 0x17, U 0xEE, U 0xA4, 
+	U 0xA1, U 0x17, U 0xEE, U 0xA2, 
 	U 0x08, U 0xA8, U 0x01, U 0x0B, 
 	U 0x88, U 0x02, U 0x07, U 0x47, 
-	U 0x02, U 0x1B, U 0xEE, U 0xA0, 
+	U 0x02, U 0x1B, U 0xEE, U 0x9E, 
 	U 0x97, U 0xF1, U 0x0B, U 0x88, 
 	U 0x02, U 0x98, U 0xF2, U 0x27, 
 	U 0x90, U 0x23, U 0x2B, U 0x90, 
@@ -1022,7 +1025,7 @@ static unsigned char t3fw[30840] = {
 	U 0x07, U 0x77, U 0x10, U 0x0C, 
 	U 0x88, U 0x10, U 0x07, U 0x88, 
 	U 0x02, U 0x0B, U 0x88, U 0x02, 
-	U 0x17, U 0xEE, U 0x98, U 0x8B, 
+	U 0x17, U 0xEE, U 0x96, U 0x8B, 
 	U 0x33, U 0x07, U 0xBB, U 0x01, 
 	U 0x87, U 0x34, U 0x0B, U 0x88, 
 	U 0x02, U 0x98, U 0xF3, U 0x97, 
@@ -1030,9 +1033,9 @@ static unsigned char t3fw[30840] = {
 	U 0x95, U 0x87, U 0x39, U 0x9B, 
 	U 0xF5, U 0x88, U 0x96, U 0x8B, 
 	U 0x38, U 0x98, U 0xF6, U 0x88, 
-	U 0x97, U 0x97, U 0xF9, U 0x9B, 
-	U 0xF8, U 0x98, U 0xF7, U 0x17, 
-	U 0xEE, U 0x8F, U 0x28, U 0xE2, 
+	U 0x97, U 0x9B, U 0xF8, U 0x97, 
+	U 0xF9, U 0x98, U 0xF7, U 0x17, 
+	U 0xEE, U 0x8D, U 0x28, U 0xE2, 
 	U 0x85, U 0x07, U 0xC7, U 0x08, 
 	U 0x2D, U 0x74, U 0xCF, U 0x08, 
 	U 0x48, U 0x0B, U 0x28, U 0xE6, 
@@ -1040,18 +1043,18 @@ static unsigned char t3fw[30840] = {
 	U 0x2B, U 0x22, U 0x1E, U 0x28, 
 	U 0x22, U 0x1D, U 0x7B, U 0x89, 
 	U 0x02, U 0x2B, U 0x0A, U 0x00, 
-	U 0x64, U 0xBF, U 0x04, U 0x2C, 
+	U 0x64, U 0xBF, U 0x05, U 0x2C, 
 	U 0xB0, U 0x07, U 0x28, U 0xB0, 
 	U 0x00, U 0xDA, U 0x20, U 0x06, 
 	U 0x88, U 0x0A, U 0x28, U 0x82, 
 	U 0x4C, U 0xC0, U 0xD1, U 0x0B, 
 	U 0x80, U 0x00, U 0xDB, U 0xA0, 
 	U 0x65, U 0xAF, U 0xE7, U 0x63, 
-	U 0xFE, U 0xE9, U 0x00, U 0x00, 
+	U 0xFE, U 0xEA, U 0x00, U 0x00, 
 	U 0x29, U 0x20, U 0x72, U 0x65, 
-	U 0x9E, U 0x9C, U 0x60, U 0x04, 
+	U 0x9E, U 0x94, U 0x60, U 0x04, 
 	U 0xE7, U 0x2A, U 0x20, U 0x72, 
-	U 0x65, U 0xAE, U 0xC3, U 0x60, 
+	U 0x65, U 0xAE, U 0xBF, U 0x60, 
 	U 0x04, U 0xDE, U 0x00, U 0x00, 
 	U 0x2E, U 0xB0, U 0x03, U 0x2C, 
 	U 0x20, U 0x67, U 0xD4, U 0xE0, 
@@ -1060,7 +1063,7 @@ static unsigned char t3fw[30840] = {
 	U 0xFF, U 0x50, U 0x0C, U 0x45, 
 	U 0x54, U 0xBC, U 0x55, U 0x64, 
 	U 0xF4, U 0xEB, U 0x19, U 0xEE, 
-	U 0x74, U 0x88, U 0x2A, U 0x09, 
+	U 0x72, U 0x88, U 0x2A, U 0x09, 
 	U 0xA9, U 0x01, U 0x09, U 0x88, 
 	U 0x0C, U 0x64, U 0x82, U 0x1F, 
 	U 0xC0, U 0x92, U 0x60, U 0x00, 
@@ -1071,7 +1074,7 @@ static unsigned char t3fw[30840] = {
 	U 0x0A, U 0xFC, U 0x50, U 0x0B, 
 	U 0x45, U 0x54, U 0xBC, U 0x55, 
 	U 0x64, U 0xC4, U 0xBE, U 0x19, 
-	U 0xEE, U 0x69, U 0x88, U 0x2A, 
+	U 0xEE, U 0x67, U 0x88, U 0x2A, 
 	U 0x09, U 0xA9, U 0x01, U 0x79, 
 	U 0x89, U 0xD5, U 0x0B, U 0xEA, 
 	U 0x50, U 0x64, U 0xA4, U 0xE3, 
@@ -1107,7 +1110,7 @@ static unsigned char t3fw[30840] = {
 	U 0xFC, U 0x13, U 0x2C, U 0x16, 
 	U 0x18, U 0x2B, U 0x12, U 0x1A, 
 	U 0x2A, U 0x12, U 0x1B, U 0xDC, 
-	U 0x50, U 0x58, U 0x19, U 0xA4, 
+	U 0x50, U 0x58, U 0x19, U 0xC2, 
 	U 0xC0, U 0xD0, U 0xC0, U 0x90, 
 	U 0x2E, U 0x5C, U 0xF4, U 0x2C, 
 	U 0x12, U 0x17, U 0x28, U 0x12, 
@@ -1124,25 +1127,25 @@ static unsigned char t3fw[30840] = {
 	U 0x03, U 0x89, U 0x75, U 0xB1, 
 	U 0xEA, U 0x2A, U 0x74, U 0x03, 
 	U 0xB0, U 0x99, U 0x09, U 0x49, 
-	U 0x0C, U 0x65, U 0x9D, U 0xB3, 
+	U 0x0C, U 0x65, U 0x9D, U 0xB4, 
 	U 0x2B, U 0x20, U 0x67, U 0x2D, 
 	U 0x25, U 0x02, U 0x65, U 0xB3, 
 	U 0xFA, U 0x2B, U 0x22, U 0x1E, 
 	U 0x2C, U 0x22, U 0x1D, U 0x7B, 
 	U 0xC9, U 0x01, U 0xC0, U 0xB0, 
-	U 0x64, U 0xBD, U 0x9C, U 0x2C, 
+	U 0x64, U 0xBD, U 0x9D, U 0x2C, 
 	U 0xB0, U 0x07, U 0x28, U 0xB0, 
 	U 0x00, U 0xDA, U 0x20, U 0x06, 
 	U 0x88, U 0x0A, U 0x28, U 0x82, 
 	U 0x4C, U 0xC0, U 0xD1, U 0x0B, 
 	U 0x80, U 0x00, U 0xDB, U 0xA0, 
 	U 0x65, U 0xAF, U 0xE7, U 0x63, 
-	U 0xFD, U 0x81, U 0x89, U 0xBA, 
+	U 0xFD, U 0x82, U 0x89, U 0xBA, 
 	U 0xB1, U 0x99, U 0x65, U 0x90, 
 	U 0x97, U 0x88, U 0x34, U 0x1C, 
-	U 0xEE, U 0x25, U 0x98, U 0xBA, 
+	U 0xEE, U 0x23, U 0x98, U 0xBA, 
 	U 0x8F, U 0x33, U 0x1E, U 0xEE, 
-	U 0x1E, U 0x0F, U 0x4F, U 0x54, 
+	U 0x1C, U 0x0F, U 0x4F, U 0x54, 
 	U 0x2F, U 0xB4, U 0x2C, U 0x8D, 
 	U 0x2A, U 0x8A, U 0x32, U 0x0E, 
 	U 0xDD, U 0x02, U 0x0C, U 0xAC, 
@@ -1180,8 +1183,8 @@ static unsigned char t3fw[30840] = {
 	U 0xC0, U 0x2C, U 0x20, U 0x67, 
 	U 0x2D, U 0x25, U 0x02, U 0x65, 
 	U 0xC3, U 0x11, U 0x1D, U 0xED, 
-	U 0xF8, U 0x8A, U 0x32, U 0x1E, 
-	U 0xED, U 0xFD, U 0x0D, U 0xAD, 
+	U 0xF6, U 0x8A, U 0x32, U 0x1E, 
+	U 0xED, U 0xFB, U 0x0D, U 0xAD, 
 	U 0x01, U 0x0E, U 0xDD, U 0x0C, 
 	U 0x65, U 0xD2, U 0x8A, U 0x0A, 
 	U 0x4E, U 0x51, U 0x6F, U 0xE2, 
@@ -1191,14 +1194,14 @@ static unsigned char t3fw[30840] = {
 	U 0x65, U 0xF2, U 0xF8, U 0x28, 
 	U 0x22, U 0x1D, U 0x7B, U 0x89, 
 	U 0x02, U 0x2B, U 0x0A, U 0x00, 
-	U 0x64, U 0xBC, U 0xA8, U 0x2C, 
+	U 0x64, U 0xBC, U 0xA9, U 0x2C, 
 	U 0xB0, U 0x07, U 0x28, U 0xB0, 
 	U 0x00, U 0xDA, U 0x20, U 0x06, 
 	U 0x88, U 0x0A, U 0x28, U 0x82, 
 	U 0x4C, U 0xC0, U 0xD1, U 0x0B, 
 	U 0x80, U 0x00, U 0xDB, U 0xA0, 
 	U 0x65, U 0xAF, U 0xE7, U 0x63, 
-	U 0xFC, U 0x8D, U 0x00, U 0x00, 
+	U 0xFC, U 0x8E, U 0x00, U 0x00, 
 	U 0x0C, U 0xE9, U 0x50, U 0x64, 
 	U 0x92, U 0xED, U 0x0C, U 0xEF, 
 	U 0x11, U 0xC0, U 0x80, U 0x28, 
@@ -1226,9 +1229,9 @@ static unsigned char t3fw[30840] = {
 	U 0xCA, U 0x2C, U 0x0A, U 0x01, 
 	U 0x64, U 0xCE, U 0x0D, U 0x60, 
 	U 0x02, U 0x8E, U 0x88, U 0x34, 
-	U 0x1B, U 0xED, U 0xCF, U 0x98, 
+	U 0x1B, U 0xED, U 0xCD, U 0x98, 
 	U 0xDA, U 0x8F, U 0x33, U 0x1E, 
-	U 0xED, U 0xC8, U 0x0F, U 0x4F, 
+	U 0xED, U 0xC6, U 0x0F, U 0x4F, 
 	U 0x54, U 0x2F, U 0xD4, U 0x2C, 
 	U 0x8C, U 0x2A, U 0x8A, U 0x32, 
 	U 0x0E, U 0xCC, U 0x02, U 0x0B, 
@@ -1345,7 +1348,7 @@ static unsigned char t3fw[30840] = {
 	U 0xFC, U 0x2A, U 0x00, U 0x00, 
 	U 0x64, U 0x50, U 0xC0, U 0xDA, 
 	U 0x20, U 0xDB, U 0xC0, U 0x58, 
-	U 0x16, U 0x78, U 0xC0, U 0x20, 
+	U 0x16, U 0x96, U 0xC0, U 0x20, 
 	U 0xD1, U 0x0F, U 0xC0, U 0x91, 
 	U 0x63, U 0xFD, U 0x7A, U 0x00, 
 	U 0xC0, U 0x91, U 0x63, U 0xFA, 
@@ -1354,15 +1357,15 @@ static unsigned char t3fw[30840] = {
 	U 0x0A, U 0x80, U 0xC0, U 0x9A, 
 	U 0x29, U 0x24, U 0x68, U 0x2C, 
 	U 0x70, U 0x07, U 0x58, U 0x15, 
-	U 0x68, U 0xD2, U 0xA0, U 0xD1, 
+	U 0x82, U 0xD2, U 0xA0, U 0xD1, 
 	U 0x0F, U 0x03, U 0x47, U 0x0B, 
-	U 0x18, U 0xED, U 0x4F, U 0xDB, 
+	U 0x18, U 0xED, U 0x4D, U 0xDB, 
 	U 0x70, U 0xA8, U 0x28, U 0x78, 
 	U 0x73, U 0x02, U 0x2B, U 0x7D, 
 	U 0xF8, U 0xD9, U 0xB0, U 0x63, 
 	U 0xFA, U 0x61, U 0x00, U 0x00, 
 	U 0x2A, U 0x2C, U 0x74, U 0xDB, 
-	U 0x40, U 0x58, U 0x0E, U 0xE3, 
+	U 0x40, U 0x58, U 0x0F, U 0x14, 
 	U 0x63, U 0xFA, U 0xE4, U 0x00, 
 	U 0x00, U 0x29, U 0x22, U 0x1D, 
 	U 0x2D, U 0x25, U 0x02, U 0x7B, 
@@ -1377,16 +1380,16 @@ static unsigned char t3fw[30840] = {
 	U 0xD1, U 0x0F, U 0xC0, U 0x91, 
 	U 0x63, U 0xFB, U 0xFF, U 0x00, 
 	U 0x02, U 0x2A, U 0x02, U 0x58, 
-	U 0x02, U 0x4C, U 0x0A, U 0xA2, 
+	U 0x02, U 0x72, U 0x0A, U 0xA2, 
 	U 0x02, U 0x06, U 0x00, U 0x00, 
 	U 0x02, U 0x2A, U 0x02, U 0x58, 
-	U 0x02, U 0x49, U 0x0A, U 0xA2, 
+	U 0x02, U 0x6F, U 0x0A, U 0xA2, 
 	U 0x02, U 0x06, U 0x00, U 0x00, 
 	U 0xDB, U 0x70, U 0xDA, U 0x20, 
 	U 0xC0, U 0xD1, U 0x2E, U 0x0A, 
 	U 0x80, U 0xC0, U 0x9E, U 0x29, 
 	U 0x24, U 0x68, U 0x2C, U 0x70, 
-	U 0x07, U 0x58, U 0x15, U 0x47, 
+	U 0x07, U 0x58, U 0x15, U 0x61, 
 	U 0xC0, U 0x20, U 0xD1, U 0x0F, 
 	U 0xC0, U 0x94, U 0x63, U 0xFB, 
 	U 0xC9, U 0xC0, U 0x96, U 0x63, 
@@ -1394,7 +1397,7 @@ static unsigned char t3fw[30840] = {
 	U 0x63, U 0xFB, U 0xBF, U 0x00, 
 	U 0x2A, U 0x2C, U 0x74, U 0xDB, 
 	U 0x30, U 0xDC, U 0x40, U 0x5B, 
-	U 0xFE, U 0x11, U 0xDB, U 0xA0, 
+	U 0xFE, U 0x0F, U 0xDB, U 0xA0, 
 	U 0xC2, U 0xA0, U 0x2A, U 0xB4, 
 	U 0x00, U 0x2C, U 0x20, U 0x0C, 
 	U 0x63, U 0xFF, U 0x27, U 0x00, 
@@ -1416,7 +1419,7 @@ static unsigned char t3fw[30840] = {
 	U 0x2A, U 0x25, U 0x02, U 0x7B, 
 	U 0x89, U 0x01, U 0xDB, U 0xA0, 
 	U 0xC9, U 0xB9, U 0x13, U 0xED, 
-	U 0x06, U 0xDA, U 0x20, U 0x28, 
+	U 0x04, U 0xDA, U 0x20, U 0x28, 
 	U 0xB0, U 0x00, U 0x2C, U 0xB0, 
 	U 0x07, U 0x03, U 0x88, U 0x0A, 
 	U 0x28, U 0x82, U 0x4C, U 0xC0, 
@@ -1428,53 +1431,54 @@ static unsigned char t3fw[30840] = {
 	U 0x20, U 0x06, U 0x2A, U 0x21, 
 	U 0x02, U 0x68, U 0xC8, U 0x05, 
 	U 0x28, U 0xCC, U 0xF9, U 0x65, 
-	U 0x81, U 0x2E, U 0x0A, U 0x09, 
-	U 0x4C, U 0x65, U 0x91, U 0x04, 
+	U 0x81, U 0x32, U 0x0A, U 0x09, 
+	U 0x4C, U 0x65, U 0x91, U 0x08, 
 	U 0x8F, U 0x30, U 0xC1, U 0xB8, 
 	U 0x0F, U 0x8F, U 0x14, U 0x7F, 
 	U 0xB0, U 0x05, U 0x28, U 0x21, 
-	U 0x23, U 0x65, U 0x81, U 0x27, 
-	U 0x16, U 0xEC, U 0xF5, U 0x29, 
+	U 0x23, U 0x65, U 0x81, U 0x2B, 
+	U 0x16, U 0xEC, U 0xF3, U 0x29, 
 	U 0x62, U 0x9E, U 0x6F, U 0x98, 
-	U 0x02, U 0x60, U 0x00, U 0xF8, 
-	U 0x19, U 0xEC, U 0xF1, U 0x29, 
+	U 0x02, U 0x60, U 0x00, U 0xFC, 
+	U 0x19, U 0xEC, U 0xEF, U 0x29, 
 	U 0x92, U 0x26, U 0x68, U 0x90, 
 	U 0x07, U 0x8A, U 0x20, U 0x09, 
 	U 0xAA, U 0x0C, U 0x65, U 0xA0, 
-	U 0xE7, U 0x2A, U 0x62, U 0x9D, 
-	U 0x64, U 0xA0, U 0xE1, U 0x2B, 
+	U 0xEB, U 0x2A, U 0x62, U 0x9D, 
+	U 0x64, U 0xA0, U 0xE5, U 0x2B, 
 	U 0x20, U 0x0C, U 0x0C, U 0xB9, 
 	U 0x11, U 0xA6, U 0x99, U 0x2D, 
 	U 0x92, U 0x86, U 0x6F, U 0xD9, 
-	U 0x02, U 0x60, U 0x00, U 0xDB, 
-	U 0x1D, U 0xEC, U 0xE9, U 0x0D, 
+	U 0x02, U 0x60, U 0x00, U 0xDF, 
+	U 0x1D, U 0xEC, U 0xE7, U 0x0D, 
 	U 0xBD, U 0x0A, U 0x2D, U 0xD2, 
 	U 0xA3, U 0x68, U 0xD0, U 0x07, 
 	U 0x8E, U 0x20, U 0x0D, U 0xEE, 
-	U 0x0C, U 0x65, U 0xE0, U 0xC7, 
+	U 0x0C, U 0x65, U 0xE0, U 0xCB, 
 	U 0x27, U 0x92, U 0x85, U 0xC0, 
-	U 0xE0, U 0x64, U 0x70, U 0xBF, 
-	U 0x1D, U 0xEC, U 0xEE, U 0x68, 
-	U 0x43, U 0x4E, U 0x1C, U 0xEC, 
-	U 0xED, U 0x8A, U 0x2B, U 0x0C, 
+	U 0xE0, U 0x64, U 0x70, U 0xC3, 
+	U 0x1D, U 0xEC, U 0xEC, U 0x68, 
+	U 0x43, U 0x52, U 0x1C, U 0xEC, 
+	U 0xEB, U 0x8A, U 0x2B, U 0x0C, 
 	U 0xAA, U 0x02, U 0x9A, U 0x70, 
 	U 0x89, U 0x20, U 0x08, U 0x99, 
 	U 0x11, U 0x0D, U 0x99, U 0x02, 
 	U 0x99, U 0x71, U 0x88, U 0x2A, 
 	U 0x98, U 0x74, U 0x8F, U 0x32, 
 	U 0x9F, U 0x75, U 0x28, U 0x21, 
-	U 0x04, U 0x08, U 0x88, U 0x11, 
-	U 0x98, U 0x77, U 0x18, U 0xEC, 
-	U 0xDE, U 0x0C, U 0xBF, U 0x11, 
-	U 0xA6, U 0xFF, U 0x2D, U 0xF2, 
-	U 0x85, U 0xA8, U 0xB8, U 0x2E, 
-	U 0x84, U 0xCF, U 0x2D, U 0xDC, 
-	U 0x28, U 0x2D, U 0xF6, U 0x85, 
-	U 0xC8, U 0x5A, U 0x2A, U 0x2C, 
-	U 0x74, U 0xDB, U 0x40, U 0x58, 
-	U 0x0E, U 0x76, U 0xD2, U 0xA0, 
-	U 0xD1, U 0x0F, U 0xC0, U 0x20, 
-	U 0xD1, U 0x0F, U 0x00, U 0x00, 
+	U 0x04, U 0x9E, U 0x76, U 0x9E, 

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-stable-8@FreeBSD.ORG  Mon Apr  4 20:40:39 2011
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B35AB106566B;
	Mon,  4 Apr 2011 20:40:39 +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 A1BE38FC13;
	Mon,  4 Apr 2011 20:40: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 p34Ked8H095106;
	Mon, 4 Apr 2011 20:40:39 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p34Kedeu095104;
	Mon, 4 Apr 2011 20:40:39 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <201104042040.p34Kedeu095104@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Mon, 4 Apr 2011 20:40: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: r220342 - stable/8/sys/dev/fxp
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Mon, 04 Apr 2011 20:40:39 -0000

Author: yongari
Date: Mon Apr  4 20:40:39 2011
New Revision: 220342
URL: http://svn.freebsd.org/changeset/base/220342

Log:
  MFC r220103:
    Normally fxp(4) does not receive bad frames but promiscuous mode
    makes controller to receive bad frames and i82557 will also receive
    bad frames since fxp(4) have to receive VLAN oversized frames. If
    fxp(4) encounter DMA overrun error, the received frame size would
    be 0 so the actual frame size after checksum field extraction the
    length would be negative(-2). Due to signed/unsigned comparison
    used in driver, frame length check did not work for DMA overrun
    frames. Correct this by casting it to int.
    While I'm here explicitly check DMA overrun error and discard the
    frame regardless of result of received frame length check.
  
    Reported by:	n_hibma
    Tested by:	n_hibma

Modified:
  stable/8/sys/dev/fxp/if_fxp.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/fxp/if_fxp.c
==============================================================================
--- stable/8/sys/dev/fxp/if_fxp.c	Mon Apr  4 20:02:29 2011	(r220341)
+++ stable/8/sys/dev/fxp/if_fxp.c	Mon Apr  4 20:40:39 2011	(r220342)
@@ -1941,11 +1941,11 @@ fxp_intr_body(struct fxp_softc *sc, stru
 				/* Adjust for appended checksum bytes. */
 				total_len -= 2;
 			}
-			if (total_len < sizeof(struct ether_header) ||
+			if (total_len < (int)sizeof(struct ether_header) ||
 			    total_len > (MCLBYTES - RFA_ALIGNMENT_FUDGE -
 			    sc->rfa_size) ||
 			    status & (FXP_RFA_STATUS_CRC |
-			    FXP_RFA_STATUS_ALIGN)) {
+			    FXP_RFA_STATUS_ALIGN | FXP_RFA_STATUS_OVERRUN)) {
 				m_freem(m);
 				fxp_add_rfabuf(sc, rxp);
 				continue;

From owner-svn-src-stable-8@FreeBSD.ORG  Mon Apr  4 20:44:27 2011
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id F2CB81065670;
	Mon,  4 Apr 2011 20:44:26 +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 E15718FC1B;
	Mon,  4 Apr 2011 20:44: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 p34KiQil095303;
	Mon, 4 Apr 2011 20:44:26 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p34KiQ7t095301;
	Mon, 4 Apr 2011 20:44:26 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <201104042044.p34KiQ7t095301@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Mon, 4 Apr 2011 20:44:26 +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: r220344 - stable/8/sys/dev/vte
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Mon, 04 Apr 2011 20:44:27 -0000

Author: yongari
Date: Mon Apr  4 20:44:26 2011
New Revision: 220344
URL: http://svn.freebsd.org/changeset/base/220344

Log:
  MFC r219938:
    Remove unused DMA map/tag in softc.

Modified:
  stable/8/sys/dev/vte/if_vtevar.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/vte/if_vtevar.h
==============================================================================
--- stable/8/sys/dev/vte/if_vtevar.h	Mon Apr  4 20:41:35 2011	(r220343)
+++ stable/8/sys/dev/vte/if_vtevar.h	Mon Apr  4 20:44:26 2011	(r220344)
@@ -80,13 +80,7 @@ struct vte_chain_data {
 	bus_dmamap_t		vte_tx_ring_map;
 	bus_dma_tag_t		vte_rx_ring_tag;
 	bus_dmamap_t		vte_rx_ring_map;
-	bus_dma_tag_t		vte_rr_ring_tag;
-	bus_dmamap_t		vte_rr_ring_map;
 	bus_dmamap_t		vte_rx_sparemap;
-	bus_dma_tag_t		vte_cmb_tag;
-	bus_dmamap_t		vte_cmb_map;
-	bus_dma_tag_t		vte_smb_tag;
-	bus_dmamap_t		vte_smb_map;
 	struct vte_tx_desc	*vte_tx_ring;
 	bus_addr_t		vte_tx_ring_paddr;
 	struct vte_rx_desc	*vte_rx_ring;

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Apr  5 04:18:42 2011
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C514C106566B;
	Tue,  5 Apr 2011 04:18:42 +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 B37808FC15;
	Tue,  5 Apr 2011 04:18: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 p354IgBp005203;
	Tue, 5 Apr 2011 04:18:42 GMT (envelope-from ae@svn.freebsd.org)
Received: (from ae@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p354IgkD005201;
	Tue, 5 Apr 2011 04:18:42 GMT (envelope-from ae@svn.freebsd.org)
Message-Id: <201104050418.p354IgkD005201@svn.freebsd.org>
From: "Andrey V. Elsukov" 
Date: Tue, 5 Apr 2011 04:18: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: r220352 - stable/8/sys/modules/ipfw
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 05 Apr 2011 04:18:42 -0000

Author: ae
Date: Tue Apr  5 04:18:42 2011
New Revision: 220352
URL: http://svn.freebsd.org/changeset/base/220352

Log:
  MFC r220124:
    Do not build ip_fw_nat.c for ipfw.ko. It can be build as separate module.

Modified:
  stable/8/sys/modules/ipfw/Makefile
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/modules/ipfw/Makefile
==============================================================================
--- stable/8/sys/modules/ipfw/Makefile	Tue Apr  5 03:11:21 2011	(r220351)
+++ stable/8/sys/modules/ipfw/Makefile	Tue Apr  5 04:18:42 2011	(r220352)
@@ -6,7 +6,7 @@
 
 KMOD=	ipfw
 SRCS=	ip_fw2.c ip_fw_pfil.c
-SRCS+=	ip_fw_dynamic.c ip_fw_log.c ip_fw_nat.c
+SRCS+=	ip_fw_dynamic.c ip_fw_log.c
 SRCS+=	ip_fw_sockopt.c ip_fw_table.c
 SRCS+=	opt_inet6.h opt_ipsec.h
 

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Apr  5 04:23:09 2011
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 17E18106566C;
	Tue,  5 Apr 2011 04:23:09 +0000 (UTC)
	(envelope-from murray@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 054A98FC17;
	Tue,  5 Apr 2011 04:23: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 p354N8Ze005331;
	Tue, 5 Apr 2011 04:23:08 GMT (envelope-from murray@svn.freebsd.org)
Received: (from murray@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p354N8UI005328;
	Tue, 5 Apr 2011 04:23:08 GMT (envelope-from murray@svn.freebsd.org)
Message-Id: <201104050423.p354N8UI005328@svn.freebsd.org>
From: Murray Stokely 
Date: Tue, 5 Apr 2011 04:23: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: r220353 - in stable/8/lib/msun: . man
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 05 Apr 2011 04:23:09 -0000

Author: murray (doc committer)
Date: Tue Apr  5 04:23:08 2011
New Revision: 220353
URL: http://svn.freebsd.org/changeset/base/220353

Log:
  MFC r218877 from head:  Document our complex(3) support in libm.

Added:
  stable/8/lib/msun/man/complex.3
     - copied unchanged from r218877, head/lib/msun/man/complex.3
Modified:
  stable/8/lib/msun/Makefile
Directory Properties:
  stable/8/lib/msun/   (props changed)

Modified: stable/8/lib/msun/Makefile
==============================================================================
--- stable/8/lib/msun/Makefile	Tue Apr  5 04:18:42 2011	(r220352)
+++ stable/8/lib/msun/Makefile	Tue Apr  5 04:23:08 2011	(r220353)
@@ -126,7 +126,8 @@ MAN=	acos.3 acosh.3 asin.3 asinh.3 atan.
 	fma.3 fmax.3 fmod.3 hypot.3 ieee.3 ieee_test.3 ilogb.3 j0.3 \
 	lgamma.3 log.3 lrint.3 lround.3 math.3 nan.3 \
 	nextafter.3 remainder.3 rint.3 \
-	round.3 scalbn.3 signbit.3 sin.3 sinh.3 sqrt.3 tan.3 tanh.3 trunc.3
+	round.3 scalbn.3 signbit.3 sin.3 sinh.3 sqrt.3 tan.3 tanh.3 trunc.3 \
+	complex.3
 
 MLINKS+=acos.3 acosf.3 acos.3 acosl.3
 MLINKS+=acosh.3 acoshf.3

Copied: stable/8/lib/msun/man/complex.3 (from r218877, head/lib/msun/man/complex.3)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/8/lib/msun/man/complex.3	Tue Apr  5 04:23:08 2011	(r220353, copy of r218877, head/lib/msun/man/complex.3)
@@ -0,0 +1,128 @@
+.\" Copyright (c) 2011 Murray Stokely 
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd February 19, 2011
+.Dt COMPLEX 3
+.Os
+.Sh NAME
+.Nm complex
+.Nd "complex arithmetic"
+.Sh LIBRARY
+.Lb libm
+.Sh SYNOPSIS
+.In complex.h
+.Sh DESCRIPTION
+These functions support complex arithmetic in the C math library.
+.Sh "LIST OF FUNCTIONS"
+Each of the following
+.Vt "double complex"
+functions has a
+.Vt "float complex"
+counterpart with an
+.Ql f
+appended to the name and a
+.Vt "long double complex"
+counterpart with an
+.Ql l
+appended.
+As an example, the
+.Vt "float complex"
+and
+.Vt "long double complex"
+counterparts of
+.Ft double
+.Fn cabs "double complex z"
+are
+.Ft float
+.Fn cabsf "float complex z"
+and
+.Ft "long double"
+.Fn cabsl "long double complex z" ,
+respectively.
+.de Cl
+.Bl -column "csqrt" "complex absolute value (i.e. norm, modulus, magnitude)"
+.Em "Name	Description"
+..
+.\" Section 7.3.5 - 7.3.7 of ISO C99 standard unimplemented, see BUGS
+.\" Section 7.3.8 of ISO C99 standard
+.Ss Absolute-value Functions
+.Cl
+cabs	complex absolute value (i.e. norm, modulus, magnitude)
+csqrt	complex square root
+.El
+.\" Section 7.3.9 of ISO C99 standard
+.Ss Manipulation Functions
+.Cl
+carg	compute the argument (i.e. phase angle)
+cimag	compute the imaginary part
+conj	compute the complex conjugate
+cproj	compute projection onto Riemann sphere
+creal	compute the real part
+.El
+.Sh SEE ALSO
+.Xr math 3 ,
+.Xr fenv 3 ,
+.Xr ieee 3 ,
+.Xr tgmath 3
+.Rs
+.%T "ISO/IEC 9899:TC3"
+.%U http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf
+.Re
+.Sh STANDARDS
+The
+.In complex.h
+functions described here conform to
+.St -isoC-99 .
+.Sh BUGS
+The trigonmetric functions
+.Fn cacos ,
+.Fn casin ,
+.Fn catan ,
+.Fn ccos ,
+.Fn csin ,
+and
+.Fn ctan
+are not implemented.
+.Pp
+The hyperbolic functions
+.Fn cacosh ,
+.Fn casinh ,
+.Fn catanh ,
+.Fn ccosh ,
+.Fn csinh ,
+and
+.Fn ctanh
+are not implemented.
+.Pp
+The exponential and logarithmic functions
+.Fn cexp ,
+and
+.Fn clog
+are not implemented.
+.Pp
+The power functions
+.Fn cpow
+are not implemented.

From owner-svn-src-stable-8@FreeBSD.ORG  Wed Apr  6 11:12:06 2011
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 57347106564A;
	Wed,  6 Apr 2011 11:12:06 +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 46A088FC1B;
	Wed,  6 Apr 2011 11:12: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 p36BC6a1086309;
	Wed, 6 Apr 2011 11:12:06 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p36BC6sh086303;
	Wed, 6 Apr 2011 11:12:06 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201104061112.p36BC6sh086303@svn.freebsd.org>
From: Konstantin Belousov 
Date: Wed, 6 Apr 2011 11:12: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: r220378 - in stable/8/sys: compat/freebsd32 kern sys
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Wed, 06 Apr 2011 11:12:06 -0000

Author: kib
Date: Wed Apr  6 11:12:05 2011
New Revision: 220378
URL: http://svn.freebsd.org/changeset/base/220378

Log:
  MFC r220158:
  Provide compat32 shims for kldstat(2).

Modified:
  stable/8/sys/compat/freebsd32/freebsd32.h
  stable/8/sys/compat/freebsd32/freebsd32_misc.c
  stable/8/sys/compat/freebsd32/syscalls.master
  stable/8/sys/kern/kern_linker.c
  stable/8/sys/sys/syscallsubr.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/compat/freebsd32/freebsd32.h
==============================================================================
--- stable/8/sys/compat/freebsd32/freebsd32.h	Tue Apr  5 22:13:33 2011	(r220377)
+++ stable/8/sys/compat/freebsd32/freebsd32.h	Wed Apr  6 11:12:05 2011	(r220378)
@@ -335,4 +335,23 @@ struct kinfo_proc32 {
 	int	ki_tdflags;
 };
 
+struct kld32_file_stat_1 {
+	int	version;	/* set to sizeof(struct kld_file_stat_1) */
+	char	name[MAXPATHLEN];
+	int	refs;
+	int	id;
+	uint32_t address;	/* load address */
+	uint32_t size;		/* size in bytes */
+};
+
+struct kld32_file_stat {
+	int	version;	/* set to sizeof(struct kld_file_stat) */
+	char	name[MAXPATHLEN];
+	int	refs;
+	int	id;
+	uint32_t address;	/* load address */
+	uint32_t size;		/* size in bytes */
+	char	pathname[MAXPATHLEN];
+};
+
 #endif /* !_COMPAT_FREEBSD32_FREEBSD32_H_ */

Modified: stable/8/sys/compat/freebsd32/freebsd32_misc.c
==============================================================================
--- stable/8/sys/compat/freebsd32/freebsd32_misc.c	Tue Apr  5 22:13:33 2011	(r220377)
+++ stable/8/sys/compat/freebsd32/freebsd32_misc.c	Wed Apr  6 11:12:05 2011	(r220378)
@@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 		/* Must come after sys/malloc.h */
@@ -2645,3 +2646,29 @@ freebsd32_copyout_strings(struct image_p
 	return ((register_t *)stack_base);
 }
 
+int
+freebsd32_kldstat(struct thread *td, struct freebsd32_kldstat_args *uap)
+{
+	struct kld_file_stat stat;
+	struct kld32_file_stat stat32;
+	int error, version;
+
+	if ((error = copyin(&uap->stat->version, &version, sizeof(version)))
+	    != 0)
+		return (error);
+	if (version != sizeof(struct kld32_file_stat_1) &&
+	    version != sizeof(struct kld32_file_stat))
+		return (EINVAL);
+
+	error = kern_kldstat(td, uap->fileid, &stat);
+	if (error != 0)
+		return (error);
+
+	bcopy(&stat.name[0], &stat32.name[0], sizeof(stat.name));
+	CP(stat, stat32, refs);
+	CP(stat, stat32, id);
+	PTROUT_CP(stat, stat32, address);
+	CP(stat, stat32, size);
+	bcopy(&stat.pathname[0], &stat32.pathname[0], sizeof(stat.pathname));
+	return (copyout(&stat32, uap->stat, version));
+}

Modified: stable/8/sys/compat/freebsd32/syscalls.master
==============================================================================
--- stable/8/sys/compat/freebsd32/syscalls.master	Tue Apr  5 22:13:33 2011	(r220377)
+++ stable/8/sys/compat/freebsd32/syscalls.master	Wed Apr  6 11:12:05 2011	(r220378)
@@ -534,8 +534,8 @@
 305	AUE_MODUNLOAD	NOPROTO	{ int kldunload(int fileid); }
 306	AUE_NULL	NOPROTO	{ int kldfind(const char *file); }
 307	AUE_NULL	NOPROTO	{ int kldnext(int fileid); }
-308	AUE_NULL	NOPROTO	{ int kldstat(int fileid, \
-				    struct kld_file_stat* stat); }
+308	AUE_NULL	STD	{ int freebsd32_kldstat(int fileid, \
+				    struct kld32_file_stat* stat); }
 309	AUE_NULL	NOPROTO	{ int kldfirstmod(int fileid); }
 310	AUE_GETSID	NOPROTO	{ int getsid(pid_t pid); }
 311	AUE_SETRESUID	NOPROTO	{ int setresuid(uid_t ruid, uid_t euid, \

Modified: stable/8/sys/kern/kern_linker.c
==============================================================================
--- stable/8/sys/kern/kern_linker.c	Tue Apr  5 22:13:33 2011	(r220377)
+++ stable/8/sys/kern/kern_linker.c	Wed Apr  6 11:12:05 2011	(r220378)
@@ -1196,29 +1196,39 @@ int
 kldstat(struct thread *td, struct kldstat_args *uap)
 {
 	struct kld_file_stat stat;
-	linker_file_t lf;
-	int error, namelen, version, version_num;
+	int error, version;
 
 	/*
 	 * Check the version of the user's structure.
 	 */
-	if ((error = copyin(&uap->stat->version, &version, sizeof(version))) != 0)
+	if ((error = copyin(&uap->stat->version, &version, sizeof(version)))
+	    != 0)
 		return (error);
-	if (version == sizeof(struct kld_file_stat_1))
-		version_num = 1;
-	else if (version == sizeof(struct kld_file_stat))
-		version_num = 2;
-	else
+	if (version != sizeof(struct kld_file_stat_1) &&
+	    version != sizeof(struct kld_file_stat))
 		return (EINVAL);
 
+	error = kern_kldstat(td, uap->fileid, &stat);
+	if (error != 0)
+		return (error);
+	return (copyout(&stat, uap->stat, version));
+}
+
+int
+kern_kldstat(struct thread *td, int fileid, struct kld_file_stat *stat)
+{
+	linker_file_t lf;
+	int namelen;
 #ifdef MAC
+	int error;
+
 	error = mac_kld_check_stat(td->td_ucred);
 	if (error)
 		return (error);
 #endif
 
 	KLD_LOCK();
-	lf = linker_find_file_by_id(uap->fileid);
+	lf = linker_find_file_by_id(fileid);
 	if (lf == NULL) {
 		KLD_UNLOCK();
 		return (ENOENT);
@@ -1228,23 +1238,20 @@ kldstat(struct thread *td, struct kldsta
 	namelen = strlen(lf->filename) + 1;
 	if (namelen > MAXPATHLEN)
 		namelen = MAXPATHLEN;
-	bcopy(lf->filename, &stat.name[0], namelen);
-	stat.refs = lf->refs;
-	stat.id = lf->id;
-	stat.address = lf->address;
-	stat.size = lf->size;
-	if (version_num > 1) {
-		/* Version 2 fields: */
-		namelen = strlen(lf->pathname) + 1;
-		if (namelen > MAXPATHLEN)
-			namelen = MAXPATHLEN;
-		bcopy(lf->pathname, &stat.pathname[0], namelen);
-	}
+	bcopy(lf->filename, &stat->name[0], namelen);
+	stat->refs = lf->refs;
+	stat->id = lf->id;
+	stat->address = lf->address;
+	stat->size = lf->size;
+	/* Version 2 fields: */
+	namelen = strlen(lf->pathname) + 1;
+	if (namelen > MAXPATHLEN)
+		namelen = MAXPATHLEN;
+	bcopy(lf->pathname, &stat->pathname[0], namelen);
 	KLD_UNLOCK();
 
 	td->td_retval[0] = 0;
-
-	return (copyout(&stat, uap->stat, version));
+	return (0);
 }
 
 int

Modified: stable/8/sys/sys/syscallsubr.h
==============================================================================
--- stable/8/sys/sys/syscallsubr.h	Tue Apr  5 22:13:33 2011	(r220377)
+++ stable/8/sys/sys/syscallsubr.h	Wed Apr  6 11:12:05 2011	(r220378)
@@ -48,6 +48,7 @@ struct sockaddr;
 struct stat;
 struct kevent;
 struct kevent_copyops;
+struct kld_file_stat;
 struct sendfile_args;
 struct thr_param;
 
@@ -112,6 +113,7 @@ int	kern_jail_set(struct thread *td, str
 int	kern_kevent(struct thread *td, int fd, int nchanges, int nevents,
 	    struct kevent_copyops *k_ops, const struct timespec *timeout);
 int	kern_kldload(struct thread *td, const char *file, int *fileid);
+int	kern_kldstat(struct thread *td, int fileid, struct kld_file_stat *stat);
 int	kern_kldunload(struct thread *td, int fileid, int flags);
 int	kern_lchown(struct thread *td, char *path, enum uio_seg pathseg,
 	    int uid, int gid);

From owner-svn-src-stable-8@FreeBSD.ORG  Wed Apr  6 11:12:52 2011
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2DD891065679;
	Wed,  6 Apr 2011 11:12:52 +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 1E2B38FC15;
	Wed,  6 Apr 2011 11:12: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 p36BCq6S086368;
	Wed, 6 Apr 2011 11:12:52 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p36BCpBD086363;
	Wed, 6 Apr 2011 11:12:51 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201104061112.p36BCpBD086363@svn.freebsd.org>
From: Konstantin Belousov 
Date: Wed, 6 Apr 2011 11:12: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: r220379 - stable/8/sys/compat/freebsd32
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Wed, 06 Apr 2011 11:12:52 -0000

Author: kib
Date: Wed Apr  6 11:12:51 2011
New Revision: 220379
URL: http://svn.freebsd.org/changeset/base/220379

Log:
  Regen

Modified:
  stable/8/sys/compat/freebsd32/freebsd32_proto.h
  stable/8/sys/compat/freebsd32/freebsd32_syscall.h
  stable/8/sys/compat/freebsd32/freebsd32_syscalls.c
  stable/8/sys/compat/freebsd32/freebsd32_sysent.c

Modified: stable/8/sys/compat/freebsd32/freebsd32_proto.h
==============================================================================
--- stable/8/sys/compat/freebsd32/freebsd32_proto.h	Wed Apr  6 11:12:05 2011	(r220378)
+++ stable/8/sys/compat/freebsd32/freebsd32_proto.h	Wed Apr  6 11:12:51 2011	(r220379)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 206351 2010-04-07 14:49:35Z kib 
+ * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 220378 2011-04-06 11:12:05Z kib 
  */
 
 #ifndef _FREEBSD32_SYSPROTO_H_
@@ -240,6 +240,10 @@ struct freebsd32_modstat_args {
 	char modid_l_[PADL_(int)]; int modid; char modid_r_[PADR_(int)];
 	char stat_l_[PADL_(struct module_stat32 *)]; struct module_stat32 * stat; char stat_r_[PADR_(struct module_stat32 *)];
 };
+struct freebsd32_kldstat_args {
+	char fileid_l_[PADL_(int)]; int fileid; char fileid_r_[PADR_(int)];
+	char stat_l_[PADL_(struct kld32_file_stat *)]; struct kld32_file_stat * stat; char stat_r_[PADR_(struct kld32_file_stat *)];
+};
 struct freebsd32_aio_return_args {
 	char aiocbp_l_[PADL_(struct aiocb32 *)]; struct aiocb32 * aiocbp; char aiocbp_r_[PADR_(struct aiocb32 *)];
 };
@@ -607,6 +611,7 @@ int	freebsd32_lutimes(struct thread *, s
 int	freebsd32_preadv(struct thread *, struct freebsd32_preadv_args *);
 int	freebsd32_pwritev(struct thread *, struct freebsd32_pwritev_args *);
 int	freebsd32_modstat(struct thread *, struct freebsd32_modstat_args *);
+int	freebsd32_kldstat(struct thread *, struct freebsd32_kldstat_args *);
 int	freebsd32_aio_return(struct thread *, struct freebsd32_aio_return_args *);
 int	freebsd32_aio_suspend(struct thread *, struct freebsd32_aio_suspend_args *);
 int	freebsd32_aio_cancel(struct thread *, struct freebsd32_aio_cancel_args *);
@@ -939,6 +944,7 @@ int	freebsd7_freebsd32_shmctl(struct thr
 #define	FREEBSD32_SYS_AUE_freebsd32_pwritev	AUE_PWRITEV
 #define	FREEBSD32_SYS_AUE_freebsd4_freebsd32_fhstatfs	AUE_FHSTATFS
 #define	FREEBSD32_SYS_AUE_freebsd32_modstat	AUE_NULL
+#define	FREEBSD32_SYS_AUE_freebsd32_kldstat	AUE_NULL
 #define	FREEBSD32_SYS_AUE_freebsd32_aio_return	AUE_NULL
 #define	FREEBSD32_SYS_AUE_freebsd32_aio_suspend	AUE_NULL
 #define	FREEBSD32_SYS_AUE_freebsd32_aio_cancel	AUE_NULL

Modified: stable/8/sys/compat/freebsd32/freebsd32_syscall.h
==============================================================================
--- stable/8/sys/compat/freebsd32/freebsd32_syscall.h	Wed Apr  6 11:12:05 2011	(r220378)
+++ stable/8/sys/compat/freebsd32/freebsd32_syscall.h	Wed Apr  6 11:12:51 2011	(r220379)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 206351 2010-04-07 14:49:35Z kib 
+ * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 220378 2011-04-06 11:12:05Z kib 
  */
 
 #define	FREEBSD32_SYS_syscall	0
@@ -234,7 +234,7 @@
 #define	FREEBSD32_SYS_kldunload	305
 #define	FREEBSD32_SYS_kldfind	306
 #define	FREEBSD32_SYS_kldnext	307
-#define	FREEBSD32_SYS_kldstat	308
+#define	FREEBSD32_SYS_freebsd32_kldstat	308
 #define	FREEBSD32_SYS_kldfirstmod	309
 #define	FREEBSD32_SYS_getsid	310
 #define	FREEBSD32_SYS_setresuid	311

Modified: stable/8/sys/compat/freebsd32/freebsd32_syscalls.c
==============================================================================
--- stable/8/sys/compat/freebsd32/freebsd32_syscalls.c	Wed Apr  6 11:12:05 2011	(r220378)
+++ stable/8/sys/compat/freebsd32/freebsd32_syscalls.c	Wed Apr  6 11:12:51 2011	(r220379)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 206351 2010-04-07 14:49:35Z kib 
+ * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 220378 2011-04-06 11:12:05Z kib 
  */
 
 const char *freebsd32_syscallnames[] = {
@@ -318,7 +318,7 @@ const char *freebsd32_syscallnames[] = {
 	"kldunload",			/* 305 = kldunload */
 	"kldfind",			/* 306 = kldfind */
 	"kldnext",			/* 307 = kldnext */
-	"kldstat",			/* 308 = kldstat */
+	"freebsd32_kldstat",			/* 308 = freebsd32_kldstat */
 	"kldfirstmod",			/* 309 = kldfirstmod */
 	"getsid",			/* 310 = getsid */
 	"setresuid",			/* 311 = setresuid */

Modified: stable/8/sys/compat/freebsd32/freebsd32_sysent.c
==============================================================================
--- stable/8/sys/compat/freebsd32/freebsd32_sysent.c	Wed Apr  6 11:12:05 2011	(r220378)
+++ stable/8/sys/compat/freebsd32/freebsd32_sysent.c	Wed Apr  6 11:12:51 2011	(r220379)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 206351 2010-04-07 14:49:35Z kib 
+ * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 220378 2011-04-06 11:12:05Z kib 
  */
 
 #include "opt_compat.h"
@@ -355,7 +355,7 @@ struct sysent freebsd32_sysent[] = {
 	{ AS(kldunload_args), (sy_call_t *)kldunload, AUE_MODUNLOAD, NULL, 0, 0, 0 },	/* 305 = kldunload */
 	{ AS(kldfind_args), (sy_call_t *)kldfind, AUE_NULL, NULL, 0, 0, 0 },	/* 306 = kldfind */
 	{ AS(kldnext_args), (sy_call_t *)kldnext, AUE_NULL, NULL, 0, 0, 0 },	/* 307 = kldnext */
-	{ AS(kldstat_args), (sy_call_t *)kldstat, AUE_NULL, NULL, 0, 0, 0 },	/* 308 = kldstat */
+	{ AS(freebsd32_kldstat_args), (sy_call_t *)freebsd32_kldstat, AUE_NULL, NULL, 0, 0, 0 },	/* 308 = freebsd32_kldstat */
 	{ AS(kldfirstmod_args), (sy_call_t *)kldfirstmod, AUE_NULL, NULL, 0, 0, 0 },	/* 309 = kldfirstmod */
 	{ AS(getsid_args), (sy_call_t *)getsid, AUE_GETSID, NULL, 0, 0, 0 },	/* 310 = getsid */
 	{ AS(setresuid_args), (sy_call_t *)setresuid, AUE_SETRESUID, NULL, 0, 0, 0 },	/* 311 = setresuid */

From owner-svn-src-stable-8@FreeBSD.ORG  Wed Apr  6 11:13:56 2011
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 05CB11065676;
	Wed,  6 Apr 2011 11:13:56 +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 EB0E78FC08;
	Wed,  6 Apr 2011 11:13: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 p36BDtCZ086445;
	Wed, 6 Apr 2011 11:13:55 GMT (envelope-from gjb@svn.freebsd.org)
Received: (from gjb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p36BDtV8086443;
	Wed, 6 Apr 2011 11:13:55 GMT (envelope-from gjb@svn.freebsd.org)
Message-Id: <201104061113.p36BDtV8086443@svn.freebsd.org>
From: Glen Barber 
Date: Wed, 6 Apr 2011 11:13: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: r220380 - stable/8/lib/libutil
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Wed, 06 Apr 2011 11:13:56 -0000

Author: gjb (doc committer)
Date: Wed Apr  6 11:13:55 2011
New Revision: 220380
URL: http://svn.freebsd.org/changeset/base/220380

Log:
  MFC 219850:
  s/buffer/buf as is used in the code.

Modified:
  stable/8/lib/libutil/humanize_number.3
Directory Properties:
  stable/8/lib/libutil/   (props changed)

Modified: stable/8/lib/libutil/humanize_number.3
==============================================================================
--- stable/8/lib/libutil/humanize_number.3	Wed Apr  6 11:12:51 2011	(r220379)
+++ stable/8/lib/libutil/humanize_number.3	Wed Apr  6 11:13:55 2011	(r220380)
@@ -56,12 +56,12 @@ The
 function formats the signed 64-bit quantity given in
 .Fa number
 into
-.Fa buffer .
+.Fa buf .
 A space and then
 .Fa suffix
 is appended to the end.
 The buffer pointed to by
-.Fa buffer
+.Fa buf
 must be at least
 .Fa len
 bytes long.
@@ -69,7 +69,7 @@ bytes long.
 If the formatted number (including
 .Fa suffix )
 would be too long to fit into
-.Fa buffer ,
+.Fa buf ,
 then divide
 .Fa number
 by 1024 until it will.
@@ -98,7 +98,7 @@ The
 argument must be at least 4 plus the length of
 .Fa suffix ,
 in order to ensure a useful result is generated into
-.Fa buffer .
+.Fa buf .
 To use a specific prefix, specify this as
 .Fa scale
 (multiplier = 1024 ^ scale).
@@ -139,7 +139,7 @@ with 1000 instead of 1024.
 The
 .Fn humanize_number
 function returns the number of characters stored in
-.Fa buffer
+.Fa buf
 (excluding the terminating
 .Dv NUL )
 upon success, or \-1 upon failure.

From owner-svn-src-stable-8@FreeBSD.ORG  Wed Apr  6 17:54:10 2011
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C95B8106566B;
	Wed,  6 Apr 2011 17:54:10 +0000 (UTC)
	(envelope-from glebius@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id B6B498FC18;
	Wed,  6 Apr 2011 17:54: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 p36HsAOG007682;
	Wed, 6 Apr 2011 17:54:10 GMT (envelope-from glebius@svn.freebsd.org)
Received: (from glebius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p36HsAHs007678;
	Wed, 6 Apr 2011 17:54:10 GMT (envelope-from glebius@svn.freebsd.org)
Message-Id: <201104061754.p36HsAHs007678@svn.freebsd.org>
From: Gleb Smirnoff 
Date: Wed, 6 Apr 2011 17:54: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: r220391 - stable/8/sbin/route
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Wed, 06 Apr 2011 17:54:10 -0000

Author: glebius
Date: Wed Apr  6 17:54:10 2011
New Revision: 220391
URL: http://svn.freebsd.org/changeset/base/220391

Log:
  MFhead r196527,204406,216296-216297:
  
    ------------------------------------------------------------------------
    r196527 | charnier | 2009-08-25 08:09:09 +0400 (вт, 25 авг 2009) | 3 lines
  
    ANSIfy functions declarations, adjust prototypes. Rename local variable
    to not conflict with err().
  
    ------------------------------------------------------------------------
    r204406 | uqs | 2010-02-27 13:18:33 +0300 (сб, 27 фев 2010) | 12 lines
  
    route(8): make WARNS=3 clean
  
    - add static and const where appropriate
    - check pointers against NULL
    - minor styling nits
    - it is actually WARNS=6 clean for non-strict alignment platforms
  
    ------------------------------------------------------------------------
    r216296 | glebius | 2010-12-08 18:10:27 +0300 (ср, 08 дек 2010) | 5 lines
  
    Add RTM_IEEE80211 to array of route message descriptions.
  
    ------------------------------------------------------------------------
    r216297 | glebius | 2010-12-08 18:12:37 +0300 (ср, 08 дек 2010) | 7 lines
  
    - Fix array bounds checking. [1]
    - Add message length checking.

Modified:
  stable/8/sbin/route/Makefile
  stable/8/sbin/route/route.c
Directory Properties:
  stable/8/sbin/route/   (props changed)

Modified: stable/8/sbin/route/Makefile
==============================================================================
--- stable/8/sbin/route/Makefile	Wed Apr  6 17:47:22 2011	(r220390)
+++ stable/8/sbin/route/Makefile	Wed Apr  6 17:54:10 2011	(r220391)
@@ -6,7 +6,7 @@
 PROG=	route
 MAN=	route.8
 SRCS=	route.c keywords.h
-WARNS?=	0
+WARNS?=	3
 CLEANFILES+=keywords.h _keywords.tmp
 
 CFLAGS+= -DNS

Modified: stable/8/sbin/route/route.c
==============================================================================
--- stable/8/sbin/route/route.c	Wed Apr  6 17:47:22 2011	(r220390)
+++ stable/8/sbin/route/route.c	Wed Apr  6 17:54:10 2011	(r220391)
@@ -37,10 +37,11 @@ static const char copyright[] =
 #if 0
 static char sccsid[] = "@(#)route.c	8.6 (Berkeley) 4/28/95";
 #endif
-static const char rcsid[] =
-  "$FreeBSD$";
 #endif /* not lint */
 
+#include 
+__FBSDID("$FreeBSD$");
+
 #include 
 #include 
 #include 
@@ -69,7 +70,7 @@ static const char rcsid[] =
 #include 
 
 struct keytab {
-	char	*kt_cp;
+	const char	*kt_cp;
 	int	kt_i;
 } keywords[] = {
 #include "keywords.h"
@@ -92,31 +93,46 @@ union	sockunion {
 typedef union sockunion *sup;
 int	pid, rtm_addrs;
 int	s;
-int	forcehost, forcenet, doflush, nflag, af, qflag, tflag, keyword();
+int	forcehost, forcenet, doflush, nflag, af, qflag, tflag;
 int	iflag, verbose, aflen = sizeof (struct sockaddr_in);
 int	locking, lockrest, debugonly;
 struct	rt_metrics rt_metrics;
 u_long  rtm_inits;
 uid_t	uid;
-int	atalk_aton(const char *, struct at_addr *);
-char	*atalk_ntoa(struct at_addr);
-const char	*routename(), *netname();
-void	flushroutes(), newroute(), monitor(), sockaddr(), sodump(), bprintf();
-void	print_getmsg(), print_rtmsg(), pmsg_common(), pmsg_addrs(), mask_addr();
+
+static int	atalk_aton(const char *, struct at_addr *);
+static char	*atalk_ntoa(struct at_addr);
+static void	bprintf(FILE *, int, u_char *);
+static void	flushroutes(int argc, char *argv[]);
+static int	getaddr(int, char *, struct hostent **);
+static int	keyword(const char *);
+static void	inet_makenetandmask(u_long, struct sockaddr_in *, u_long);
 #ifdef INET6
-static int inet6_makenetandmask(struct sockaddr_in6 *, char *);
+static int inet6_makenetandmask(struct sockaddr_in6 *, const char *);
 #endif
-int	getaddr(), rtmsg(), x25_makemask();
-int	prefixlen();
-extern	char *iso_ntoa();
+static void	interfaces(void);
+static void	mask_addr(void);
+static void	monitor(void);
+static const char	*netname(struct sockaddr *);
+static void	newroute(int, char **);
+static void	pmsg_addrs(char *, int, size_t);
+static void	pmsg_common(struct rt_msghdr *, size_t);
+static int	prefixlen(const char *);
+static void	print_getmsg(struct rt_msghdr *, int);
+static void	print_rtmsg(struct rt_msghdr *, size_t);
+static const char	*routename(struct sockaddr *);
+static int	rtmsg(int, int);
+static void	set_metric(char *, int);
+static void	sockaddr(char *, struct sockaddr *);
+static void	sodump(sup, const char *);
+extern	char *iso_ntoa(void);
 
-void usage(const char *) __dead2;
+static void usage(const char *) __dead2;
 
 void
-usage(cp)
-	const char *cp;
+usage(const char *cp)
 {
-	if (cp)
+	if (cp != NULL)
 		warnx("bad keyword: %s", cp);
 	(void) fprintf(stderr,
 	    "usage: route [-dnqtv] command [[modifiers] args]\n");
@@ -125,14 +141,12 @@ usage(cp)
 }
 
 int
-main(argc, argv)
-	int argc;
-	char **argv;
+main(int argc, char **argv)
 {
 	int ch;
 
 	if (argc < 2)
-		usage((char *)NULL);
+		usage(NULL);
 
 	while ((ch = getopt(argc, argv, "nqdtv")) != -1)
 		switch(ch) {
@@ -153,7 +167,7 @@ main(argc, argv)
 			break;
 		case '?':
 		default:
-			usage((char *)NULL);
+			usage(NULL);
 		}
 	argc -= optind;
 	argv += optind;
@@ -166,7 +180,7 @@ main(argc, argv)
 		s = socket(PF_ROUTE, SOCK_RAW, 0);
 	if (s < 0)
 		err(EX_OSERR, "socket");
-	if (*argv)
+	if (*argv != NULL)
 		switch (keyword(*argv)) {
 		case K_GET:
 		case K_SHOW:
@@ -197,17 +211,15 @@ main(argc, argv)
  * Purge all entries in the routing tables not
  * associated with network interfaces.
  */
-void
-flushroutes(argc, argv)
-	int argc;
-	char *argv[];
+static void
+flushroutes(int argc, char *argv[])
 {
 	size_t needed;
 	int mib[6], rlen, seqno, count = 0;
 	char *buf, *next, *lim;
 	struct rt_msghdr *rtm;
 
-	if (uid && !debugonly) {
+	if (uid != 0 && !debugonly) {
 		errx(EX_NOPERM, "must be root to alter routing table");
 	}
 	shutdown(s, SHUT_RD); /* Don't want to read back our messages */
@@ -247,7 +259,7 @@ retry:
 		errx(EX_OSERR, "malloc failed");
 	if (sysctl(mib, 6, buf, &needed, NULL, 0) < 0) {
 		if (errno == ENOMEM && count++ < 10) {
-			warnx("Routing table grew, retrying");  
+			warnx("Routing table grew, retrying");
 			sleep(1);
 			free(buf);
 			goto retry;
@@ -264,7 +276,7 @@ retry:
 			print_rtmsg(rtm, rtm->rtm_msglen);
 		if ((rtm->rtm_flags & RTF_GATEWAY) == 0)
 			continue;
-		if (af) {
+		if (af != 0) {
 			struct sockaddr *sa = (struct sockaddr *)(rtm + 1);
 
 			if (sa->sa_family != af)
@@ -301,10 +313,9 @@ retry:
 }
 
 const char *
-routename(sa)
-	struct sockaddr *sa;
+routename(struct sockaddr *sa)
 {
-	char *cp;
+	const char *cp;
 	static char line[MAXHOSTNAMELEN + 1];
 	struct hostent *hp;
 	static char domain[MAXHOSTNAMELEN + 1];
@@ -328,20 +339,22 @@ routename(sa)
 	    {	struct in_addr in;
 		in = ((struct sockaddr_in *)sa)->sin_addr;
 
-		cp = 0;
+		cp = NULL;
 		if (in.s_addr == INADDR_ANY || sa->sa_len < 4)
 			cp = "default";
-		if (cp == 0 && !nflag) {
+		if (cp == NULL && !nflag) {
 			hp = gethostbyaddr((char *)&in, sizeof (struct in_addr),
 				AF_INET);
-			if (hp) {
-				if ((cp = strchr(hp->h_name, '.')) &&
-				    !strcmp(cp + 1, domain))
-					*cp = 0;
+			if (hp != NULL) {
+				char *cptr;
+				cptr = strchr(hp->h_name, '.');
+				if (cptr != NULL &&
+				    strcmp(cptr + 1, domain) == 0)
+					*cptr = '\0';
 				cp = hp->h_name;
 			}
 		}
-		if (cp) {
+		if (cp != NULL) {
 			strncpy(line, cp, sizeof(line) - 1);
 			line[sizeof(line) - 1] = '\0';
 		} else
@@ -389,16 +402,17 @@ routename(sa)
 		return (link_ntoa((struct sockaddr_dl *)sa));
 
 	default:
-	    {	u_short *s = (u_short *)sa;
-		u_short *slim = s + ((sa->sa_len + 1) >> 1);
-		char *cp = line + sprintf(line, "(%d)", sa->sa_family);
+	    {
+		u_short *sp = (u_short *)sa;
+		u_short *splim = sp + ((sa->sa_len + 1) >> 1);
+		char *cps = line + sprintf(line, "(%d)", sa->sa_family);
 		char *cpe = line + sizeof(line);
 
-		while (++s < slim && cp < cpe) /* start with sa->sa_data */
-			if ((n = snprintf(cp, cpe - cp, " %x", *s)) > 0)
-				cp += n;
+		while (++sp < splim && cps < cpe) /* start with sa->sa_data */
+			if ((n = snprintf(cps, cpe - cps, " %x", *sp)) > 0)
+				cps += n;
 			else
-				*cp = '\0';
+				*cps = '\0';
 		break;
 	    }
 	}
@@ -410,12 +424,11 @@ routename(sa)
  * The address is assumed to be that of a net or subnet, not a host.
  */
 const char *
-netname(sa)
-	struct sockaddr *sa;
+netname(struct sockaddr *sa)
 {
-	char *cp = 0;
+	const char *cp = NULL;
 	static char line[MAXHOSTNAMELEN + 1];
-	struct netent *np = 0;
+	struct netent *np = NULL;
 	u_long net, mask;
 	u_long i;
 	int n, subnetshift;
@@ -452,11 +465,11 @@ netname(sa)
 			while ((mask & 1) == 0)
 				mask >>= 1, net >>= 1;
 			np = getnetbyaddr(net, AF_INET);
-			if (np)
+			if (np != NULL)
 				cp = np->n_name;
 		}
 #define C(x)	(unsigned)((x) & 0xff)
-		if (cp)
+		if (cp != NULL)
 			strncpy(line, cp, sizeof(line));
 		else if ((in.s_addr & 0xffffff) == 0)
 			(void) sprintf(line, "%u", C(in.s_addr >> 24));
@@ -515,26 +528,25 @@ netname(sa)
 
 
 	default:
-	    {	u_short *s = (u_short *)sa->sa_data;
-		u_short *slim = s + ((sa->sa_len + 1)>>1);
-		char *cp = line + sprintf(line, "af %d:", sa->sa_family);
+	    {
+		u_short *sp = (u_short *)sa->sa_data;
+		u_short *splim = sp + ((sa->sa_len + 1)>>1);
+		char *cps = line + sprintf(line, "af %d:", sa->sa_family);
 		char *cpe = line + sizeof(line);
 
-		while (s < slim && cp < cpe)
-			if ((n = snprintf(cp, cpe - cp, " %x", *s++)) > 0)
-				cp += n;
+		while (sp < splim && cps < cpe)
+			if ((n = snprintf(cps, cpe - cps, " %x", *sp++)) > 0)
+				cps += n;
 			else
-				*cp = '\0';
+				*cps = '\0';
 		break;
 	    }
 	}
 	return (line);
 }
 
-void
-set_metric(value, key)
-	char *value;
-	int key;
+static void
+set_metric(char *value, int key)
 {
 	int flag = 0;
 	u_long noval, *valp = &noval;
@@ -559,17 +571,16 @@ set_metric(value, key)
 	*valp = atoi(value);
 }
 
-void
-newroute(argc, argv)
-	int argc;
-	char **argv;
+static void
+newroute(int argc, char **argv)
 {
-	char *cmd, *dest = "", *gateway = "", *err;
+	char *cmd;
+	const char *dest = "", *gateway = "", *errmsg;
 	int ishost = 0, proxy = 0, ret, attempts, oerrno, flags = RTF_STATIC;
 	int key;
 	struct hostent *hp = 0;
 
-	if (uid) {
+	if (uid != 0) {
 		errx(EX_NOPERM, "must be root to alter routing table");
 	}
 	cmd = argv[0];
@@ -646,33 +657,33 @@ newroute(argc, argv)
 				break;
 			case K_IFA:
 				if (!--argc)
-					usage((char *)NULL);
+					usage(NULL);
 				(void) getaddr(RTA_IFA, *++argv, 0);
 				break;
 			case K_IFP:
 				if (!--argc)
-					usage((char *)NULL);
+					usage(NULL);
 				(void) getaddr(RTA_IFP, *++argv, 0);
 				break;
 			case K_GENMASK:
 				if (!--argc)
-					usage((char *)NULL);
+					usage(NULL);
 				(void) getaddr(RTA_GENMASK, *++argv, 0);
 				break;
 			case K_GATEWAY:
 				if (!--argc)
-					usage((char *)NULL);
+					usage(NULL);
 				(void) getaddr(RTA_GATEWAY, *++argv, 0);
 				break;
 			case K_DST:
 				if (!--argc)
-					usage((char *)NULL);
+					usage(NULL);
 				ishost = getaddr(RTA_DST, *++argv, &hp);
 				dest = *argv;
 				break;
 			case K_NETMASK:
 				if (!--argc)
-					usage((char *)NULL);
+					usage(NULL);
 				(void) getaddr(RTA_NETMASK, *++argv, 0);
 				/* FALLTHROUGH */
 			case K_NET:
@@ -680,7 +691,7 @@ newroute(argc, argv)
 				break;
 			case K_PREFIXLEN:
 				if (!--argc)
-					usage((char *)NULL);
+					usage(NULL);
 				if (prefixlen(*++argv) == -1) {
 					forcenet = 0;
 					ishost = 1;
@@ -699,7 +710,7 @@ newroute(argc, argv)
 			case K_RTTVAR:
 			case K_WEIGHT:
 				if (!--argc)
-					usage((char *)NULL);
+					usage(NULL);
 				set_metric(*++argv, key);
 				break;
 			default:
@@ -723,9 +734,9 @@ newroute(argc, argv)
 #ifdef INET6
 		if (af == AF_INET6) {
 			rtm_addrs &= ~RTA_NETMASK;
-				memset((void *)&so_mask, 0, sizeof(so_mask));
+			memset((void *)&so_mask, 0, sizeof(so_mask));
 		}
-#endif 
+#endif
 	}
 	if (forcenet)
 		ishost = 0;
@@ -744,10 +755,12 @@ newroute(argc, argv)
 			break;
 		if (errno != ENETUNREACH && errno != ESRCH)
 			break;
-		if (af == AF_INET && *gateway && hp && hp->h_addr_list[1]) {
+		if (af == AF_INET && *gateway != '\0' &&
+		    hp != NULL && hp->h_addr_list[1] != NULL) {
 			hp->h_addr_list++;
 			memmove(&so_gate.sin.sin_addr, hp->h_addr_list[0],
-			    MIN(hp->h_length, sizeof(so_gate.sin.sin_addr)));
+			    MIN((size_t)hp->h_length,
+			    sizeof(so_gate.sin.sin_addr)));
 		} else
 			break;
 	}
@@ -767,41 +780,39 @@ newroute(argc, argv)
 		} else {
 			switch (oerrno) {
 			case ESRCH:
-				err = "not in table";
+				errmsg = "not in table";
 				break;
 			case EBUSY:
-				err = "entry in use";
+				errmsg = "entry in use";
 				break;
 			case ENOBUFS:
-				err = "not enough memory";
+				errmsg = "not enough memory";
 				break;
 			case EADDRINUSE:
 				/* handle recursion avoidance in rt_setgate() */
-				err = "gateway uses the same route";
+				errmsg = "gateway uses the same route";
 				break;
 			case EEXIST:
-				err = "route already in table";
+				errmsg = "route already in table";
 				break;
 			default:
-				err = strerror(oerrno);
+				errmsg = strerror(oerrno);
 				break;
 			}
-			(void) printf(": %s\n", err);
+			(void) printf(": %s\n", errmsg);
 		}
 	}
 	exit(ret != 0);
 }
 
-void
-inet_makenetandmask(net, sin, bits)
-	u_long net, bits;
-	struct sockaddr_in *sin;
+static void
+inet_makenetandmask(u_long net, struct sockaddr_in *sin, u_long bits)
 {
 	u_long addr, mask = 0;
 	char *cp;
 
 	rtm_addrs |= RTA_NETMASK;
-	/* 
+	/*
 	 * XXX: This approach unable to handle 0.0.0.1/32 correctly
 	 * as inet_network() converts 0.0.0.1 and 1 equally.
 	 */
@@ -814,7 +825,7 @@ inet_makenetandmask(net, sin, bits)
 	else
 		addr = net;
 	/*
-	 * If no /xx was specified we must cacluate the 
+	 * If no /xx was specified we must calculate the
 	 * CIDR address.
 	 */
 	if ((bits == 0)  && (addr != 0)) {
@@ -847,13 +858,11 @@ inet_makenetandmask(net, sin, bits)
  * XXX the function may need more improvement...
  */
 static int
-inet6_makenetandmask(sin6, plen)
-	struct sockaddr_in6 *sin6;
-	char *plen;
+inet6_makenetandmask(struct sockaddr_in6 *sin6, const char *plen)
 {
 	struct in6_addr in6;
 
-	if (!plen) {
+	if (plen == NULL) {
 		if (IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr) &&
 		    sin6->sin6_scope_id == 0) {
 			plen = "0";
@@ -866,11 +875,11 @@ inet6_makenetandmask(sin6, plen)
 		}
 	}
 
-	if (!plen || strcmp(plen, "128") == 0)
-		return 1;
+	if (plen == NULL || strcmp(plen, "128") == 0)
+		return (1);
 	rtm_addrs |= RTA_NETMASK;
-	(void)prefixlen(plen);
-	return 0;
+	prefixlen(plen);
+	return (0);
 }
 #endif
 
@@ -878,11 +887,8 @@ inet6_makenetandmask(sin6, plen)
  * Interpret an argument as a network address of some kind,
  * returning 1 if a host address, 0 if a network address.
  */
-int
-getaddr(which, s, hpp)
-	int which;
-	char *s;
-	struct hostent **hpp;
+static int
+getaddr(int which, char *str, struct hostent **hpp)
 {
 	sup su;
 	struct hostent *hp;
@@ -910,17 +916,17 @@ getaddr(which, s, hpp)
 			if (getifaddrs(&ifap))
 				err(1, "getifaddrs");
 
-			for (ifa = ifap; ifa; ifa = ifa->ifa_next) {
+			for (ifa = ifap; ifa != NULL; ifa = ifa->ifa_next) {
 				if (ifa->ifa_addr->sa_family != AF_LINK)
 					continue;
 
-				if (strcmp(s, ifa->ifa_name))
+				if (strcmp(str, ifa->ifa_name) != 0)
 					continue;
 
 				sdl = (struct sockaddr_dl *)ifa->ifa_addr;
 			}
 			/* If we found it, then use it */
-			if (sdl) {
+			if (sdl != NULL) {
 				/*
 				 * Copy is safe since we have a
 				 * sockaddr_storage member in sockunion{}.
@@ -930,7 +936,7 @@ getaddr(which, s, hpp)
 				memcpy(&su->sdl, sdl, sdl->sdl_len);
 			}
 			freeifaddrs(ifap);
-			if (sdl)
+			if (sdl != NULL)
 				return(1);
 		}
 		break;
@@ -953,9 +959,9 @@ getaddr(which, s, hpp)
 	}
 	su->sa.sa_len = aflen;
 	su->sa.sa_family = afamily; /* cases that don't want it have left already */
-	if (strcmp(s, "default") == 0) {
+	if (strcmp(str, "default") == 0) {
 		/*
-		 * Default is net 0.0.0.0/0 
+		 * Default is net 0.0.0.0/0
 		 */
 		switch (which) {
 		case RTA_DST:
@@ -963,7 +969,7 @@ getaddr(which, s, hpp)
 #if 0
 			bzero(su, sizeof(*su));	/* for readability */
 #endif
-			(void) getaddr(RTA_NETMASK, s, 0);
+			getaddr(RTA_NETMASK, str, 0);
 			break;
 #if 0
 		case RTA_NETMASK:
@@ -981,15 +987,15 @@ getaddr(which, s, hpp)
 		int ecode;
 
 		q = NULL;
-		if (which == RTA_DST && (q = strchr(s, '/')) != NULL)
+		if (which == RTA_DST && (q = strchr(str, '/')) != NULL)
 			*q = '\0';
 		memset(&hints, 0, sizeof(hints));
 		hints.ai_family = afamily;	/*AF_INET6*/
 		hints.ai_socktype = SOCK_DGRAM;		/*dummy*/
-		ecode = getaddrinfo(s, NULL, &hints, &res);
+		ecode = getaddrinfo(str, NULL, &hints, &res);
 		if (ecode != 0 || res->ai_family != AF_INET6 ||
 		    res->ai_addrlen != sizeof(su->sin6)) {
-			(void) fprintf(stderr, "%s: %s\n", s,
+			(void) fprintf(stderr, "%s: %s\n", str,
 			    gai_strerror(ecode));
 			exit(1);
 		}
@@ -1013,19 +1019,19 @@ getaddr(which, s, hpp)
 #endif /* INET6 */
 
 	case AF_APPLETALK:
-		if (!atalk_aton(s, &su->sat.sat_addr))
-			errx(EX_NOHOST, "bad address: %s", s);
+		if (!atalk_aton(str, &su->sat.sat_addr))
+			errx(EX_NOHOST, "bad address: %s", str);
 		rtm_addrs |= RTA_NETMASK;
 		return(forcehost || su->sat.sat_addr.s_node != 0);
 
 	case AF_LINK:
-		link_addr(s, &su->sdl);
+		link_addr(str, &su->sdl);
 		return (1);
 
 
 	case PF_ROUTE:
 		su->sa.sa_len = sizeof(*su);
-		sockaddr(s, &su->sa);
+		sockaddr(str, &su->sa);
 		return (1);
 
 	case AF_INET:
@@ -1037,10 +1043,10 @@ getaddr(which, s, hpp)
 		hpp = &hp;
 	*hpp = NULL;
 
-	q = strchr(s,'/');
-	if (q && which == RTA_DST) {
+	q = strchr(str,'/');
+	if (q != NULL && which == RTA_DST) {
 		*q = '\0';
-		if ((val = inet_network(s)) != INADDR_NONE) {
+		if ((val = inet_network(str)) != INADDR_NONE) {
 			inet_makenetandmask(
 				val, &su->sin, strtoul(q+1, 0, 0));
 			return (0);
@@ -1048,7 +1054,7 @@ getaddr(which, s, hpp)
 		*q = '/';
 	}
 	if ((which != RTA_DST || forcenet == 0) &&
-	    inet_aton(s, &su->sin.sin_addr)) {
+	    inet_aton(str, &su->sin.sin_addr)) {
 		val = su->sin.sin_addr.s_addr;
 		if (which != RTA_DST || forcehost ||
 		    inet_lnaof(su->sin.sin_addr) != INADDR_ANY)
@@ -1059,28 +1065,27 @@ getaddr(which, s, hpp)
 		}
 	}
 	if (which == RTA_DST && forcehost == 0 &&
-	    ((val = inet_network(s)) != INADDR_NONE ||
-	    ((np = getnetbyname(s)) != NULL && (val = np->n_net) != 0))) {
+	    ((val = inet_network(str)) != INADDR_NONE ||
+	    ((np = getnetbyname(str)) != NULL && (val = np->n_net) != 0))) {
 netdone:
 		inet_makenetandmask(val, &su->sin, 0);
 		return (0);
 	}
-	hp = gethostbyname(s);
-	if (hp) {
+	hp = gethostbyname(str);
+	if (hp != NULL) {
 		*hpp = hp;
 		su->sin.sin_family = hp->h_addrtype;
 		memmove((char *)&su->sin.sin_addr, hp->h_addr,
-		    MIN(hp->h_length, sizeof(su->sin.sin_addr)));
+		    MIN((size_t)hp->h_length, sizeof(su->sin.sin_addr)));
 		return (1);
 	}
-	errx(EX_NOHOST, "bad address: %s", s);
+	errx(EX_NOHOST, "bad address: %s", str);
 }
 
-int
-prefixlen(s)
-	char *s;
+static int
+prefixlen(const char *str)
 {
-	int len = atoi(s), q, r;
+	int len = atoi(str), q, r;
 	int max;
 	char *p;
 
@@ -1097,13 +1102,12 @@ prefixlen(s)
 		p = (char *)&so_mask.sin.sin_addr;
 		break;
 	default:
-		(void) fprintf(stderr, "prefixlen not supported in this af\n");
+		fprintf(stderr, "prefixlen not supported in this af\n");
 		exit(1);
-		/*NOTREACHED*/
 	}
 
 	if (len < 0 || max < len) {
-		(void) fprintf(stderr, "%s: bad value\n", s);
+		fprintf(stderr, "%s: bad value\n", str);
 		exit(1);
 	}
 	
@@ -1117,13 +1121,13 @@ prefixlen(s)
 	if (r > 0)
 		*((u_char *)p + q) = (0xff00 >> r) & 0xff;
 	if (len == max)
-		return -1;
+		return (-1);
 	else
-		return len;
+		return (len);
 }
 
-void
-interfaces()
+static void
+interfaces(void)
 {
 	size_t needed;
 	int mib[6];
@@ -1157,8 +1161,8 @@ retry2:
 	}
 }
 
-void
-monitor()
+static void
+monitor(void)
 {
 	int n;
 	char msg[2048];
@@ -1168,7 +1172,7 @@ monitor()
 		interfaces();
 		exit(0);
 	}
-	for(;;) {
+	for (;;) {
 		time_t now;
 		n = read(s, msg, 2048);
 		now = time(NULL);
@@ -1182,9 +1186,8 @@ struct {
 	char	m_space[512];
 } m_rtmsg;
 
-int
-rtmsg(cmd, flags)
-	int cmd, flags;
+static int
+rtmsg(int cmd, int flags)
 {
 	static int seq;
 	int rlen;
@@ -1253,8 +1256,8 @@ rtmsg(cmd, flags)
 	return (0);
 }
 
-void
-mask_addr()
+static void
+mask_addr(void)
 {
 	int olen = so_mask.sa.sa_len;
 	char *cp1 = olen + (char *)&so_mask, *cp2;
@@ -1284,7 +1287,7 @@ mask_addr()
 		*--cp1 &= *--cp2;
 }
 
-char *msgtypes[] = {
+const char *msgtypes[] = {
 	"",
 	"RTM_ADD: Add Route",
 	"RTM_DELETE: Delete Route",
@@ -1303,7 +1306,7 @@ char *msgtypes[] = {
 	"RTM_NEWMADDR: new multicast group membership on iface",
 	"RTM_DELMADDR: multicast group membership removed from iface",
 	"RTM_IFANNOUNCE: interface arrival/departure",
-	0,
+	"RTM_IEEE80211: IEEE 802.11 wireless event",
 };
 
 char metricnames[] =
@@ -1321,10 +1324,11 @@ char ifnetflags[] =
 char addrnames[] =
 "\1DST\2GATEWAY\3NETMASK\4GENMASK\5IFP\6IFA\7AUTHOR\010BRD";
 
-void
-print_rtmsg(rtm, msglen)
-	struct rt_msghdr *rtm;
-	int msglen;
+static const char errfmt[] =
+"\n%s: truncated route message, only %zu bytes left\n";
+
+static void
+print_rtmsg(struct rt_msghdr *rtm, size_t msglen)
 {
 	struct if_msghdr *ifm;
 	struct ifa_msghdr *ifam;
@@ -1332,7 +1336,7 @@ print_rtmsg(rtm, msglen)
 	struct ifma_msghdr *ifmam;
 #endif
 	struct if_announcemsghdr *ifan;
-	char *state;
+	const char *state;
 
 	if (verbose == 0)
 		return;
@@ -1341,13 +1345,22 @@ print_rtmsg(rtm, msglen)
 		    rtm->rtm_version);
 		return;
 	}
-	if (msgtypes[rtm->rtm_type] != NULL)
+	if (rtm->rtm_type < sizeof(msgtypes) / sizeof(msgtypes[0]))
 		(void)printf("%s: ", msgtypes[rtm->rtm_type]);
 	else
-		(void)printf("#%d: ", rtm->rtm_type);
+		(void)printf("unknown type %d: ", rtm->rtm_type);
 	(void)printf("len %d, ", rtm->rtm_msglen);
+
+#define	REQUIRE(x)	do {		\
+	if (msglen < sizeof(x))		\
+		goto badlen;		\
+	else				\
+		msglen -= sizeof(x);	\
+	} while (0)
+
 	switch (rtm->rtm_type) {
 	case RTM_IFINFO:
+		REQUIRE(struct if_msghdr);
 		ifm = (struct if_msghdr *)rtm;
 		(void) printf("if# %d, ", ifm->ifm_index);
 		switch (ifm->ifm_data.ifi_link_state) {
@@ -1363,23 +1376,26 @@ print_rtmsg(rtm, msglen)
 		}
 		(void) printf("link: %s, flags:", state);
 		bprintf(stdout, ifm->ifm_flags, ifnetflags);
-		pmsg_addrs((char *)(ifm + 1), ifm->ifm_addrs);
+		pmsg_addrs((char *)(ifm + 1), ifm->ifm_addrs, msglen);
 		break;
 	case RTM_NEWADDR:
 	case RTM_DELADDR:
+		REQUIRE(struct ifa_msghdr);
 		ifam = (struct ifa_msghdr *)rtm;
 		(void) printf("metric %d, flags:", ifam->ifam_metric);
 		bprintf(stdout, ifam->ifam_flags, routeflags);
-		pmsg_addrs((char *)(ifam + 1), ifam->ifam_addrs);
+		pmsg_addrs((char *)(ifam + 1), ifam->ifam_addrs, msglen);
 		break;
 #ifdef RTM_NEWMADDR
 	case RTM_NEWMADDR:
 	case RTM_DELMADDR:
+		REQUIRE(struct ifma_msghdr);
 		ifmam = (struct ifma_msghdr *)rtm;
-		pmsg_addrs((char *)(ifmam + 1), ifmam->ifmam_addrs);
+		pmsg_addrs((char *)(ifmam + 1), ifmam->ifmam_addrs, msglen);
 		break;
 #endif
 	case RTM_IFANNOUNCE:
+		REQUIRE(struct if_announcemsghdr);
 		ifan = (struct if_announcemsghdr *)rtm;
 		(void) printf("if# %d, what: ", ifan->ifan_index);
 		switch (ifan->ifan_what) {
@@ -1400,14 +1416,18 @@ print_rtmsg(rtm, msglen)
 		(void) printf("pid: %ld, seq %d, errno %d, flags:",
 			(long)rtm->rtm_pid, rtm->rtm_seq, rtm->rtm_errno);
 		bprintf(stdout, rtm->rtm_flags, routeflags);
-		pmsg_common(rtm);
+		pmsg_common(rtm, msglen);
 	}
+
+	return;
+
+badlen:
+	(void)printf(errfmt, __func__, msglen);
+#undef	REQUIRE
 }
 
-void
-print_getmsg(rtm, msglen)
-	struct rt_msghdr *rtm;
-	int msglen;
+static void
+print_getmsg(struct rt_msghdr *rtm, int msglen)
 {
 	struct sockaddr *dst = NULL, *gate = NULL, *mask = NULL;
 	struct sockaddr_dl *ifp = NULL;
@@ -1415,7 +1435,8 @@ print_getmsg(rtm, msglen)
 	char *cp;
 	int i;
 
-	(void) printf("   route to: %s\n", routename(&so_dst));
+	(void) printf("   route to: %s\n",
+	    routename((struct sockaddr *)&so_dst));
 	if (rtm->rtm_version != RTM_VERSION) {
 		warnx("routing message version %d not understood",
 		     rtm->rtm_version);
@@ -1490,7 +1511,7 @@ print_getmsg(rtm, msglen)
 #undef msec
 #define	RTA_IGN	(RTA_DST|RTA_GATEWAY|RTA_NETMASK|RTA_IFP|RTA_IFA|RTA_BRD)
 	if (verbose)
-		pmsg_common(rtm);
+		pmsg_common(rtm, msglen);
 	else if (rtm->rtm_addrs &~ RTA_IGN) {
 		(void) printf("sockaddrs: ");
 		bprintf(stdout, rtm->rtm_addrs, addrnames);
@@ -1499,21 +1520,22 @@ print_getmsg(rtm, msglen)
 #undef	RTA_IGN
 }
 
-void
-pmsg_common(rtm)
-	struct rt_msghdr *rtm;
+static void
+pmsg_common(struct rt_msghdr *rtm, size_t msglen)
 {
 	(void) printf("\nlocks: ");
 	bprintf(stdout, rtm->rtm_rmx.rmx_locks, metricnames);
 	(void) printf(" inits: ");
 	bprintf(stdout, rtm->rtm_inits, metricnames);
-	pmsg_addrs(((char *)(rtm + 1)), rtm->rtm_addrs);
+	if (msglen > sizeof(struct rt_msghdr))
+		pmsg_addrs(((char *)(rtm + 1)), rtm->rtm_addrs,
+		    msglen - sizeof(struct rt_msghdr));
+	else
+		(void) fflush(stdout);
 }
 
-void
-pmsg_addrs(cp, addrs)
-	char	*cp;
-	int	addrs;
+static void
+pmsg_addrs(char *cp, int addrs, size_t len)
 {
 	struct sockaddr *sa;
 	int i;
@@ -1525,28 +1547,30 @@ pmsg_addrs(cp, addrs)
 	(void) printf("\nsockaddrs: ");
 	bprintf(stdout, addrs, addrnames);
 	(void) putchar('\n');
-	for (i = 1; i; i <<= 1)
+	for (i = 1; i != 0; i <<= 1)
 		if (i & addrs) {
 			sa = (struct sockaddr *)cp;
+			if (len == 0 || len < SA_SIZE(sa)) {
+				(void) printf(errfmt, __func__, len);
+				break;
+			}
 			(void) printf(" %s", routename(sa));
+			len -= SA_SIZE(sa);
 			cp += SA_SIZE(sa);
 		}
 	(void) putchar('\n');
 	(void) fflush(stdout);
 }
 
-void
-bprintf(fp, b, s)
-	FILE *fp;
-	int b;
-	u_char *s;
+static void
+bprintf(FILE *fp, int b, u_char *str)
 {
 	int i;
 	int gotsome = 0;
 
 	if (b == 0)
 		return;
-	while ((i = *s++) != 0) {
+	while ((i = *str++) != 0) {
 		if (b & (1 << (i-1))) {
 			if (gotsome == 0)
 				i = '<';
@@ -1554,31 +1578,28 @@ bprintf(fp, b, s)
 				i = ',';
 			(void) putc(i, fp);
 			gotsome = 1;
-			for (; (i = *s) > 32; s++)
+			for (; (i = *str) > 32; str++)
 				(void) putc(i, fp);
 		} else
-			while (*s > 32)
-				s++;
+			while (*str > 32)
+				str++;
 	}
 	if (gotsome)
 		(void) putc('>', fp);
 }
 
 int
-keyword(cp)
-	char *cp;
+keyword(const char *cp)
 {
 	struct keytab *kt = keywords;
 
-	while (kt->kt_cp && strcmp(kt->kt_cp, cp))
+	while (kt->kt_cp != NULL && strcmp(kt->kt_cp, cp) != 0)
 		kt++;
-	return kt->kt_i;
+	return (kt->kt_i);
 }
 
-void
-sodump(su, which)
-	sup su;
-	char *which;
+static void
+sodump(sup su, const char *which)

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-stable-8@FreeBSD.ORG  Wed Apr  6 17:56:19 2011
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5CF94106564A;
	Wed,  6 Apr 2011 17:56:19 +0000 (UTC)
	(envelope-from glebius@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 4B5608FC0C;
	Wed,  6 Apr 2011 17:56: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 p36HuJVQ008073;
	Wed, 6 Apr 2011 17:56:19 GMT (envelope-from glebius@svn.freebsd.org)
Received: (from glebius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p36HuJVd008071;
	Wed, 6 Apr 2011 17:56:19 GMT (envelope-from glebius@svn.freebsd.org)
Message-Id: <201104061756.p36HuJVd008071@svn.freebsd.org>
From: Gleb Smirnoff 
Date: Wed, 6 Apr 2011 17:56: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: r220393 - stable/8/sys/netinet
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Wed, 06 Apr 2011 17:56:19 -0000

Author: glebius
Date: Wed Apr  6 17:56:18 2011
New Revision: 220393
URL: http://svn.freebsd.org/changeset/base/220393

Log:
  MFhead 215790:
  
    Redo r166423. It is important not only skip freeing multicast
    entires when underlying interface is detached, but also purge
    pointers to them, to avoid double-free in future.

Modified:
  stable/8/sys/netinet/ip_carp.c

Modified: stable/8/sys/netinet/ip_carp.c
==============================================================================
--- stable/8/sys/netinet/ip_carp.c	Wed Apr  6 17:54:12 2011	(r220392)
+++ stable/8/sys/netinet/ip_carp.c	Wed Apr  6 17:56:18 2011	(r220393)
@@ -218,7 +218,7 @@ static void	carp_set_state(struct carp_s
 static int	carp_addrcount(struct carp_if *, struct in_ifaddr *, int);
 enum	{ CARP_COUNT_MASTER, CARP_COUNT_RUNNING };
 
-static void	carp_multicast_cleanup(struct carp_softc *);
+static void	carp_multicast_cleanup(struct carp_softc *, int dofree);
 static int	carp_set_addr(struct carp_softc *, struct sockaddr_in *);
 static int	carp_del_addr(struct carp_softc *, struct sockaddr_in *);
 static void	carp_carpdev_state_locked(struct carp_if *);
@@ -227,7 +227,7 @@ static void	carp_sc_state_locked(struct 
 static void	carp_send_na(struct carp_softc *);
 static int	carp_set_addr6(struct carp_softc *, struct sockaddr_in6 *);
 static int	carp_del_addr6(struct carp_softc *, struct sockaddr_in6 *);
-static void	carp_multicast6_cleanup(struct carp_softc *);
+static void	carp_multicast6_cleanup(struct carp_softc *, int dofree);
 #endif
 
 static LIST_HEAD(, carp_softc) carpif_list;
@@ -466,9 +466,11 @@ carp_clone_destroy(struct ifnet *ifp)
 /*
  * This function can be called on CARP interface destroy path,
  * and in case of the removal of the underlying interface as
- * well. We differentiate these two cases. In the latter case
- * we do not cleanup our multicast memberships, since they
- * are already freed. Also, in the latter case we do not
+ * well. We differentiate these two cases: in case of destruction
+ * of the underlying interface, we do not cleanup our multicast
+ * memberships, since they are already freed. But we purge pointers
+ * to multicast structures, since they are no longer valid, to
+ * avoid panic in future calls to carpdetach(). Also, we do not
  * release the lock on return, because the function will be
  * called once more, for another CARP instance on the same
  * interface.
@@ -493,10 +495,9 @@ carpdetach(struct carp_softc *sc, int un
 	carp_set_state(sc, INIT);
 	SC2IFP(sc)->if_flags &= ~IFF_UP;
 	carp_setrun(sc, 0);
-	if (unlock)
-		carp_multicast_cleanup(sc);
+	carp_multicast_cleanup(sc, unlock);
 #ifdef INET6
-	carp_multicast6_cleanup(sc);
+	carp_multicast6_cleanup(sc, unlock);
 #endif
 
 	if (sc->sc_carpdev != NULL) {
@@ -1444,7 +1445,7 @@ carp_setrun(struct carp_softc *sc, sa_fa
 }
 
 static void
-carp_multicast_cleanup(struct carp_softc *sc)
+carp_multicast_cleanup(struct carp_softc *sc, int dofree)
 {
 	struct ip_moptions *imo = &sc->sc_imo;
 	u_int16_t n = imo->imo_num_memberships;
@@ -1452,7 +1453,8 @@ carp_multicast_cleanup(struct carp_softc
 	/* Clean up our own multicast memberships */
 	while (n-- > 0) {
 		if (imo->imo_membership[n] != NULL) {
-			in_delmulti(imo->imo_membership[n]);
+			if (dofree)
+				in_delmulti(imo->imo_membership[n]);
 			imo->imo_membership[n] = NULL;
 		}
 	}
@@ -1464,14 +1466,15 @@ carp_multicast_cleanup(struct carp_softc
 
 #ifdef INET6
 static void
-carp_multicast6_cleanup(struct carp_softc *sc)
+carp_multicast6_cleanup(struct carp_softc *sc, int dofree)
 {
 	struct ip6_moptions *im6o = &sc->sc_im6o;
 	u_int16_t n = im6o->im6o_num_memberships;
 
 	while (n-- > 0) {
 		if (im6o->im6o_membership[n] != NULL) {
-			in6_mc_leave(im6o->im6o_membership[n], NULL);
+			if (dofree)
+				in6_mc_leave(im6o->im6o_membership[n], NULL);
 			im6o->im6o_membership[n] = NULL;
 		}
 	}
@@ -1831,7 +1834,7 @@ carp_set_addr6(struct carp_softc *sc, st
 
 cleanup:
 	if (!sc->sc_naddrs6)
-		carp_multicast6_cleanup(sc);
+		carp_multicast6_cleanup(sc, 1);
 	ifa_free(&ia->ia_ifa);
 	return (error);
 }
@@ -1849,7 +1852,7 @@ carp_del_addr6(struct carp_softc *sc, st
 		SC2IFP(sc)->if_flags &= ~IFF_UP;
 		SC2IFP(sc)->if_drv_flags &= ~IFF_DRV_RUNNING;
 		sc->sc_vhid = -1;
-		carp_multicast6_cleanup(sc);
+		carp_multicast6_cleanup(sc, 1);
 		TAILQ_REMOVE(&cif->vhif_vrs, sc, sc_list);
 		if (!--cif->vhif_nvrs) {
 			CARP_LOCK_DESTROY(cif);

From owner-svn-src-stable-8@FreeBSD.ORG  Wed Apr  6 17:57:09 2011
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 56BD11065679;
	Wed,  6 Apr 2011 17:57:09 +0000 (UTC)
	(envelope-from glebius@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 454498FC0A;
	Wed,  6 Apr 2011 17:57: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 p36Hv9QE008181;
	Wed, 6 Apr 2011 17:57:09 GMT (envelope-from glebius@svn.freebsd.org)
Received: (from glebius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p36Hv9b7008179;
	Wed, 6 Apr 2011 17:57:09 GMT (envelope-from glebius@svn.freebsd.org)
Message-Id: <201104061757.p36Hv9b7008179@svn.freebsd.org>
From: Gleb Smirnoff 
Date: Wed, 6 Apr 2011 17:57: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: r220394 - stable/8/sys/netgraph
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Wed, 06 Apr 2011 17:57:09 -0000

Author: glebius
Date: Wed Apr  6 17:57:08 2011
New Revision: 220394
URL: http://svn.freebsd.org/changeset/base/220394

Log:
  MFhead 219827:
  
    Improve locking of creating and dropping links in the graph, acquiring
    the topology mutex in the following functions, that manipulate pointers
    to peer nodes:
  
    - ng_bypass()
    - ng_path2noderef() when switching to the next node in sequence.
      Rewrite the function a bit.
    - ng_address_hook()
    - ng_address_path()
  
    This patch improves stability of large mpd5 installations.

Modified:
  stable/8/sys/netgraph/ng_base.c

Modified: stable/8/sys/netgraph/ng_base.c
==============================================================================
--- stable/8/sys/netgraph/ng_base.c	Wed Apr  6 17:56:18 2011	(r220393)
+++ stable/8/sys/netgraph/ng_base.c	Wed Apr  6 17:57:08 2011	(r220394)
@@ -1162,11 +1162,13 @@ ng_bypass(hook_p hook1, hook_p hook2)
 		TRAP_ERROR();
 		return (EINVAL);
 	}
+	mtx_lock(&ng_topo_mtx);
 	hook1->hk_peer->hk_peer = hook2->hk_peer;
 	hook2->hk_peer->hk_peer = hook1->hk_peer;
 
 	hook1->hk_peer = &ng_deadhook;
 	hook2->hk_peer = &ng_deadhook;
+	mtx_unlock(&ng_topo_mtx);
 
 	NG_HOOK_UNREF(hook1);
 	NG_HOOK_UNREF(hook2);
@@ -1643,10 +1645,8 @@ ng_path2noderef(node_p here, const char 
 				node_p *destp, hook_p *lasthook)
 {
 	char    fullpath[NG_PATHSIZ];
-	char   *nodename, *path, pbuf[2];
+	char   *nodename, *path;
 	node_p  node, oldnode;
-	char   *cp;
-	hook_p hook = NULL;
 
 	/* Initialize */
 	if (destp == NULL) {
@@ -1664,11 +1664,6 @@ ng_path2noderef(node_p here, const char 
 		TRAP_ERROR();
 		return EINVAL;
 	}
-	if (path == NULL) {
-		pbuf[0] = '.';	/* Needs to be writable */
-		pbuf[1] = '\0';
-		path = pbuf;
-	}
 
 	/*
 	 * For an absolute address, jump to the starting node.
@@ -1690,41 +1685,41 @@ ng_path2noderef(node_p here, const char 
 		NG_NODE_REF(node);
 	}
 
+	if (path == NULL) {
+		if (lasthook != NULL)
+			*lasthook = NULL;
+		*destp = node;
+		return (0);
+	}
+
 	/*
 	 * Now follow the sequence of hooks
-	 * XXX
-	 * We actually cannot guarantee that the sequence
-	 * is not being demolished as we crawl along it
-	 * without extra-ordinary locking etc.
-	 * So this is a bit dodgy to say the least.
-	 * We can probably hold up some things by holding
-	 * the nodelist mutex for the time of this
-	 * crawl if we wanted.. At least that way we wouldn't have to
-	 * worry about the nodes disappearing, but the hooks would still
-	 * be a problem.
+	 *
+	 * XXXGL: The path may demolish as we go the sequence, but if
+	 * we hold the topology mutex at critical places, then, I hope,
+	 * we would always have valid pointers in hand, although the
+	 * path behind us may no longer exist.
 	 */
-	for (cp = path; node != NULL && *cp != '\0'; ) {
+	for (;;) {
+		hook_p hook;
 		char *segment;
 
 		/*
 		 * Break out the next path segment. Replace the dot we just
-		 * found with a NUL; "cp" points to the next segment (or the
+		 * found with a NUL; "path" points to the next segment (or the
 		 * NUL at the end).
 		 */
-		for (segment = cp; *cp != '\0'; cp++) {
-			if (*cp == '.') {
-				*cp++ = '\0';
+		for (segment = path; *path != '\0'; path++) {
+			if (*path == '.') {
+				*path++ = '\0';
 				break;
 			}
 		}
 
-		/* Empty segment */
-		if (*segment == '\0')
-			continue;
-
 		/* We have a segment, so look for a hook by that name */
 		hook = ng_findhook(node, segment);
 
+		mtx_lock(&ng_topo_mtx);
 		/* Can't get there from here... */
 		if (hook == NULL
 		    || NG_HOOK_PEER(hook) == NULL
@@ -1732,15 +1727,7 @@ ng_path2noderef(node_p here, const char 
 		    || NG_HOOK_NOT_VALID(NG_HOOK_PEER(hook))) {
 			TRAP_ERROR();
 			NG_NODE_UNREF(node);
-#if 0
-			printf("hooknotvalid %s %s %d %d %d %d ",
-					path,
-					segment,
-					hook == NULL,
-					NG_HOOK_PEER(hook) == NULL,
-					NG_HOOK_NOT_VALID(hook),
-					NG_HOOK_NOT_VALID(NG_HOOK_PEER(hook)));
-#endif
+			mtx_unlock(&ng_topo_mtx);
 			return (ENOENT);
 		}
 
@@ -1757,21 +1744,25 @@ ng_path2noderef(node_p here, const char 
 		NG_NODE_UNREF(oldnode);	/* XXX another race */
 		if (NG_NODE_NOT_VALID(node)) {
 			NG_NODE_UNREF(node);	/* XXX more races */
-			node = NULL;
+			mtx_unlock(&ng_topo_mtx);
+			TRAP_ERROR();
+			return (ENXIO);
 		}
-	}
 
-	/* If node somehow missing, fail here (probably this is not needed) */
-	if (node == NULL) {
-		TRAP_ERROR();
-		return (ENXIO);
+		if (*path == '\0') {
+			if (lasthook != NULL) {
+				if (hook != NULL) {
+					*lasthook = NG_HOOK_PEER(hook);
+					NG_HOOK_REF(*lasthook);
+				} else
+					*lasthook = NULL;
+			}
+			mtx_unlock(&ng_topo_mtx);
+			*destp = node;
+			return (0);
+		}
+		mtx_unlock(&ng_topo_mtx);
 	}
-
-	/* Done */
-	*destp = node;
-	if (lasthook != NULL)
-		*lasthook = (hook ? NG_HOOK_PEER(hook) : NULL);
-	return (0);
 }
 
 /***************************************************************\
@@ -3501,12 +3492,14 @@ ng_address_hook(node_p here, item_p item
 	 * that the peer is still connected (even if invalid,) we know
 	 * that the peer node is present, though maybe invalid.
 	 */
+	mtx_lock(&ng_topo_mtx);
 	if ((hook == NULL) ||
 	    NG_HOOK_NOT_VALID(hook) ||
 	    NG_HOOK_NOT_VALID(peer = NG_HOOK_PEER(hook)) ||
 	    NG_NODE_NOT_VALID(peernode = NG_PEER_NODE(hook))) {
 		NG_FREE_ITEM(item);
 		TRAP_ERROR();
+		mtx_unlock(&ng_topo_mtx);
 		return (ENETDOWN);
 	}
 
@@ -3518,6 +3511,9 @@ ng_address_hook(node_p here, item_p item
 	NGI_SET_HOOK(item, peer);
 	NGI_SET_NODE(item, peernode);
 	SET_RETADDR(item, here, retaddr);
+
+	mtx_unlock(&ng_topo_mtx);
+
 	return (0);
 }
 
@@ -3539,10 +3535,9 @@ ng_address_path(node_p here, item_p item
 		return (error);
 	}
 	NGI_SET_NODE(item, dest);
-	if ( hook) {
-		NG_HOOK_REF(hook);	/* don't let it go while on the queue */
+	if (hook)
 		NGI_SET_HOOK(item, hook);
-	}
+
 	SET_RETADDR(item, here, retaddr);
 	return (0);
 }

From owner-svn-src-stable-8@FreeBSD.ORG  Wed Apr  6 17:59:00 2011
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4BE14106564A;
	Wed,  6 Apr 2011 17:59:00 +0000 (UTC)
	(envelope-from glebius@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 392468FC15;
	Wed,  6 Apr 2011 17:59: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 p36Hx0OV008265;
	Wed, 6 Apr 2011 17:59:00 GMT (envelope-from glebius@svn.freebsd.org)
Received: (from glebius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p36Hx0Lw008257;
	Wed, 6 Apr 2011 17:59:00 GMT (envelope-from glebius@svn.freebsd.org)
Message-Id: <201104061759.p36Hx0Lw008257@svn.freebsd.org>
From: Gleb Smirnoff 
Date: Wed, 6 Apr 2011 17:59: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: r220395 - stable/8/share/examples/cvsup
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Wed, 06 Apr 2011 17:59:00 -0000

Author: glebius
Date: Wed Apr  6 17:58:59 2011
New Revision: 220395
URL: http://svn.freebsd.org/changeset/base/220395

Log:
  MFhead 219858:
    Give better URL to the list of available CVSup mirrors.

Modified:
  stable/8/share/examples/cvsup/cvs-supfile
  stable/8/share/examples/cvsup/doc-supfile
  stable/8/share/examples/cvsup/gnats-supfile
  stable/8/share/examples/cvsup/ports-supfile
  stable/8/share/examples/cvsup/stable-supfile
  stable/8/share/examples/cvsup/standard-supfile
  stable/8/share/examples/cvsup/www-supfile
Directory Properties:
  stable/8/share/examples/cvsup/   (props changed)

Modified: stable/8/share/examples/cvsup/cvs-supfile
==============================================================================
--- stable/8/share/examples/cvsup/cvs-supfile	Wed Apr  6 17:57:08 2011	(r220394)
+++ stable/8/share/examples/cvsup/cvs-supfile	Wed Apr  6 17:58:59 2011	(r220395)
@@ -24,7 +24,7 @@
 #		This specifies the server host which will supply the
 #		file updates.  You must change it to one of the CVSup
 #		mirror sites listed in the FreeBSD Handbook at
-#		http://www.freebsd.org/doc/handbook/mirrors.html.
+#		http://www.freebsd.org/doc/handbook/cvsup.html#CVSUP-MIRRORS.
 #		You can	override this setting on the command line
 #		with cvsup's "-h host" option.
 #
@@ -46,7 +46,7 @@
 # Defaults that apply to all the collections
 #
 # IMPORTANT: Change the next line to use one of the CVSup mirror sites
-# listed at http://www.freebsd.org/doc/handbook/mirrors.html.
+# listed at http://www.freebsd.org/doc/handbook/cvsup.html#CVSUP-MIRRORS.
 *default host=CHANGE_THIS.FreeBSD.org
 *default base=/var/db
 *default prefix=/home/ncvs

Modified: stable/8/share/examples/cvsup/doc-supfile
==============================================================================
--- stable/8/share/examples/cvsup/doc-supfile	Wed Apr  6 17:57:08 2011	(r220394)
+++ stable/8/share/examples/cvsup/doc-supfile	Wed Apr  6 17:58:59 2011	(r220395)
@@ -24,7 +24,7 @@
 #		This specifies the server host which will supply the
 #		file updates.  You must change it to one of the CVSup
 #		mirror sites listed in the FreeBSD Handbook at
-#		http://www.freebsd.org/doc/handbook/mirrors.html.
+#		http://www.freebsd.org/doc/handbook/cvsup.html#CVSUP-MIRRORS.
 #		You can	override this setting on the command line
 #		with cvsup's "-h host" option.
 #
@@ -45,7 +45,7 @@
 # Defaults that apply to all the collections
 #
 # IMPORTANT: Change the next line to use one of the CVSup mirror sites
-# listed at http://www.freebsd.org/doc/handbook/mirrors.html.
+# listed at http://www.freebsd.org/doc/handbook/cvsup.html#CVSUP-MIRRORS.
 *default host=CHANGE_THIS.FreeBSD.org
 *default base=/var/db
 *default prefix=/usr

Modified: stable/8/share/examples/cvsup/gnats-supfile
==============================================================================
--- stable/8/share/examples/cvsup/gnats-supfile	Wed Apr  6 17:57:08 2011	(r220394)
+++ stable/8/share/examples/cvsup/gnats-supfile	Wed Apr  6 17:58:59 2011	(r220395)
@@ -24,7 +24,7 @@
 #		This specifies the server host which will supply the
 #		file updates.  You must change it to one of the CVSup
 #		mirror sites listed in the FreeBSD Handbook at
-#		http://www.freebsd.org/doc/handbook/mirrors.html.
+#		http://www.freebsd.org/doc/handbook/cvsup.html#CVSUP-MIRRORS.
 #		You can	override this setting on the command line
 #		with cvsup's "-h host" option.
 #
@@ -45,7 +45,7 @@
 # Defaults that apply to all the collections
 #
 # IMPORTANT: Change the next line to use one of the CVSup mirror sites
-# listed at http://www.freebsd.org/doc/handbook/mirrors.html.
+# listed at http://www.freebsd.org/doc/handbook/cvsup.html#CVSUP-MIRRORS.
 *default host=CHANGE_THIS.FreeBSD.org
 *default base=/var/db
 *default prefix=/usr

Modified: stable/8/share/examples/cvsup/ports-supfile
==============================================================================
--- stable/8/share/examples/cvsup/ports-supfile	Wed Apr  6 17:57:08 2011	(r220394)
+++ stable/8/share/examples/cvsup/ports-supfile	Wed Apr  6 17:58:59 2011	(r220395)
@@ -24,7 +24,7 @@
 #		This specifies the server host which will supply the
 #		file updates.  You must change it to one of the CVSup
 #		mirror sites listed in the FreeBSD Handbook at
-#		http://www.freebsd.org/doc/handbook/mirrors.html.
+#		http://www.freebsd.org/doc/handbook/cvsup.html#CVSUP-MIRRORS.
 #		You can	override this setting on the command line
 #		with cvsup's "-h host" option.
 #
@@ -45,7 +45,7 @@
 # Defaults that apply to all the collections
 #
 # IMPORTANT: Change the next line to use one of the CVSup mirror sites
-# listed at http://www.freebsd.org/doc/handbook/mirrors.html.
+# listed at http://www.freebsd.org/doc/handbook/cvsup.html#CVSUP-MIRRORS.
 *default host=CHANGE_THIS.FreeBSD.org
 *default base=/var/db
 *default prefix=/usr

Modified: stable/8/share/examples/cvsup/stable-supfile
==============================================================================
--- stable/8/share/examples/cvsup/stable-supfile	Wed Apr  6 17:57:08 2011	(r220394)
+++ stable/8/share/examples/cvsup/stable-supfile	Wed Apr  6 17:58:59 2011	(r220395)
@@ -24,7 +24,7 @@
 #		This specifies the server host which will supply the
 #		file updates.  You must change it to one of the CVSup
 #		mirror sites listed in the FreeBSD Handbook at
-#		http://www.freebsd.org/doc/handbook/mirrors.html.
+#		http://www.freebsd.org/doc/handbook/cvsup.html#CVSUP-MIRRORS.
 #		You can	override this setting on the command line
 #		with cvsup's "-h host" option.
 #
@@ -62,7 +62,7 @@
 # Defaults that apply to all the collections
 #
 # IMPORTANT: Change the next line to use one of the CVSup mirror sites
-# listed at http://www.freebsd.org/doc/handbook/mirrors.html.
+# listed at http://www.freebsd.org/doc/handbook/cvsup.html#CVSUP-MIRRORS.
 *default host=CHANGE_THIS.FreeBSD.org
 *default base=/var/db
 *default prefix=/usr

Modified: stable/8/share/examples/cvsup/standard-supfile
==============================================================================
--- stable/8/share/examples/cvsup/standard-supfile	Wed Apr  6 17:57:08 2011	(r220394)
+++ stable/8/share/examples/cvsup/standard-supfile	Wed Apr  6 17:58:59 2011	(r220395)
@@ -24,7 +24,7 @@
 #		This specifies the server host which will supply the
 #		file updates.  You must change it to one of the CVSup
 #		mirror sites listed in the FreeBSD Handbook at
-#		http://www.freebsd.org/doc/handbook/mirrors.html.
+#		http://www.freebsd.org/doc/handbook/cvsup.html#CVSUP-MIRRORS.
 #		You can	override this setting on the command line
 #		with cvsup's "-h host" option.
 #
@@ -45,7 +45,7 @@
 # Defaults that apply to all the collections
 #
 # IMPORTANT: Change the next line to use one of the CVSup mirror sites
-# listed at http://www.freebsd.org/doc/handbook/mirrors.html.
+# listed at http://www.freebsd.org/doc/handbook/cvsup.html#CVSUP-MIRRORS.
 *default host=CHANGE_THIS.FreeBSD.org
 *default base=/var/db
 *default prefix=/usr

Modified: stable/8/share/examples/cvsup/www-supfile
==============================================================================
--- stable/8/share/examples/cvsup/www-supfile	Wed Apr  6 17:57:08 2011	(r220394)
+++ stable/8/share/examples/cvsup/www-supfile	Wed Apr  6 17:58:59 2011	(r220395)
@@ -24,7 +24,7 @@
 #		This specifies the server host which will supply the
 #		file updates.  You must change it to one of the CVSup
 #		mirror sites listed in the FreeBSD Handbook at
-#		http://www.freebsd.org/doc/handbook/mirrors.html.
+#		http://www.freebsd.org/doc/handbook/cvsup.html#CVSUP-MIRRORS.
 #		You can	override this setting on the command line
 #		with cvsup's "-h host" option.
 #
@@ -45,7 +45,7 @@
 # Defaults that apply to all the collections
 #
 # IMPORTANT: Change the next line to use one of the CVSup mirror sites
-# listed at http://www.freebsd.org/doc/handbook/mirrors.html.
+# listed at http://www.freebsd.org/doc/handbook/cvsup.html#CVSUP-MIRRORS.
 *default host=CHANGE_THIS.FreeBSD.org
 *default base=/var/db
 *default prefix=/usr

From owner-svn-src-stable-8@FreeBSD.ORG  Wed Apr  6 18:00:27 2011
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 36B9F1065672;
	Wed,  6 Apr 2011 18:00:27 +0000 (UTC)
	(envelope-from glebius@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 256968FC0C;
	Wed,  6 Apr 2011 18:00: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 p36I0RNf008373;
	Wed, 6 Apr 2011 18:00:27 GMT (envelope-from glebius@svn.freebsd.org)
Received: (from glebius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p36I0RNf008371;
	Wed, 6 Apr 2011 18:00:27 GMT (envelope-from glebius@svn.freebsd.org)
Message-Id: <201104061800.p36I0RNf008371@svn.freebsd.org>
From: Gleb Smirnoff 
Date: Wed, 6 Apr 2011 18:00:27 +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: r220396 - stable/8/sbin/mount_unionfs
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Wed, 06 Apr 2011 18:00:27 -0000

Author: glebius
Date: Wed Apr  6 18:00:26 2011
New Revision: 220396
URL: http://svn.freebsd.org/changeset/base/220396

Log:
  MFhead 219904:
    Fix SYNOPSIS.

Modified:
  stable/8/sbin/mount_unionfs/mount_unionfs.8
Directory Properties:
  stable/8/sbin/mount_unionfs/   (props changed)

Modified: stable/8/sbin/mount_unionfs/mount_unionfs.8
==============================================================================
--- stable/8/sbin/mount_unionfs/mount_unionfs.8	Wed Apr  6 17:58:59 2011	(r220395)
+++ stable/8/sbin/mount_unionfs/mount_unionfs.8	Wed Apr  6 18:00:26 2011	(r220396)
@@ -39,7 +39,7 @@
 .Nd mount union file systems
 .Sh SYNOPSIS
 .Nm
-.Op Fl br
+.Op Fl b
 .Op Fl o Ar options
 .Ar directory
 .Ar uniondir

From owner-svn-src-stable-8@FreeBSD.ORG  Wed Apr  6 18:03:49 2011
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id F13AA106566B;
	Wed,  6 Apr 2011 18:03:49 +0000 (UTC)
	(envelope-from glebius@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C5B228FC17;
	Wed,  6 Apr 2011 18:03: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 p36I3nQN008493;
	Wed, 6 Apr 2011 18:03:49 GMT (envelope-from glebius@svn.freebsd.org)
Received: (from glebius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p36I3n9k008491;
	Wed, 6 Apr 2011 18:03:49 GMT (envelope-from glebius@svn.freebsd.org)
Message-Id: <201104061803.p36I3n9k008491@svn.freebsd.org>
From: Gleb Smirnoff 
Date: Wed, 6 Apr 2011 18:03: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: r220397 - stable/8/sys/net
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Wed, 06 Apr 2011 18:03:50 -0000

Author: glebius
Date: Wed Apr  6 18:03:49 2011
New Revision: 220397
URL: http://svn.freebsd.org/changeset/base/220397

Log:
  MFhead 220317:
    When removing ifnets, we should first remove the reference to ifnet
    from the interface index, then decrease refcount, not vice versa.
  
    Otherwise there is a race (reproducible) when if_free_internal()
    contests on IFNET_WLOCK(), and we got a zero-refed ifnet in the
    index for a long time. It may be picked by some other thread,
    that runs ifnet_byindex_ref(), who takes the ifnet from index,
    and bumps refcount. When reader drops the lock, if_free_internal()
    proceeds with free. Then reader tries to free it a second time.

Modified:
  stable/8/sys/net/if.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/net/if.c
==============================================================================
--- stable/8/sys/net/if.c	Wed Apr  6 18:00:26 2011	(r220396)
+++ stable/8/sys/net/if.c	Wed Apr  6 18:03:49 2011	(r220397)
@@ -484,8 +484,8 @@ if_alloc(u_char type)
 }
 
 /*
- * Do the actual work of freeing a struct ifnet, associated index, and layer
- * 2 common structure.  This call is made when the last reference to an
+ * Do the actual work of freeing a struct ifnet, and layer 2 common
+ * structure.  This call is made when the last reference to an
  * interface is released.
  */
 static void
@@ -495,13 +495,6 @@ if_free_internal(struct ifnet *ifp)
 	KASSERT((ifp->if_flags & IFF_DYING),
 	    ("if_free_internal: interface not dying"));
 
-	IFNET_WLOCK();
-	KASSERT(ifp == ifnet_byindex_locked(ifp->if_index),
-	    ("%s: freeing unallocated ifnet", ifp->if_xname));
-
-	ifindex_free_locked(ifp->if_index);
-	IFNET_WUNLOCK();
-
 	if (if_com_free[ifp->if_alloctype] != NULL)
 		if_com_free[ifp->if_alloctype](ifp->if_l2com,
 		    ifp->if_alloctype);
@@ -532,6 +525,14 @@ if_free_type(struct ifnet *ifp, u_char t
 	    ifp->if_alloctype));
 
 	ifp->if_flags |= IFF_DYING;			/* XXX: Locking */
+
+	IFNET_WLOCK();
+	KASSERT(ifp == ifnet_byindex_locked(ifp->if_index),
+	    ("%s: freeing unallocated ifnet", ifp->if_xname));
+
+	ifindex_free_locked(ifp->if_index);
+	IFNET_WUNLOCK();
+
 	if (!refcount_release(&ifp->if_refcount))
 		return;
 	if_free_internal(ifp);

From owner-svn-src-stable-8@FreeBSD.ORG  Thu Apr  7 05:58:22 2011
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 18F3D106566B;
	Thu,  7 Apr 2011 05:58:22 +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 E24938FC18;
	Thu,  7 Apr 2011 05:58: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 p375wLfJ030246;
	Thu, 7 Apr 2011 05:58:21 GMT (envelope-from ae@svn.freebsd.org)
Received: (from ae@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p375wLVc030244;
	Thu, 7 Apr 2011 05:58:21 GMT (envelope-from ae@svn.freebsd.org)
Message-Id: <201104070558.p375wLVc030244@svn.freebsd.org>
From: "Andrey V. Elsukov" 
Date: Thu, 7 Apr 2011 05:58: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: r220407 - stable/8/sys/geom/nop
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Thu, 07 Apr 2011 05:58:22 -0000

Author: ae
Date: Thu Apr  7 05:58:21 2011
New Revision: 220407
URL: http://svn.freebsd.org/changeset/base/220407

Log:
  MFC r220184:
    Remove unneeded checks, g_new_xxx functions can not return NULL.

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	Thu Apr  7 03:19:10 2011	(r220406)
+++ stable/8/sys/geom/nop/g_nop.c	Thu Apr  7 05:58:21 2011	(r220407)
@@ -189,10 +189,6 @@ g_nop_create(struct gctl_req *req, struc
 		}
 	}
 	gp = g_new_geomf(mp, name);
-	if (gp == NULL) {
-		gctl_error(req, "Cannot create geom %s.", name);
-		return (ENOMEM);
-	}
 	sc = g_malloc(sizeof(*sc), M_WAITOK);
 	sc->sc_offset = offset;
 	sc->sc_error = ioerror;
@@ -209,20 +205,10 @@ g_nop_create(struct gctl_req *req, struc
 	gp->dumpconf = g_nop_dumpconf;
 
 	newpp = g_new_providerf(gp, gp->name);
-	if (newpp == NULL) {
-		gctl_error(req, "Cannot create provider %s.", name);
-		error = ENOMEM;
-		goto fail;
-	}
 	newpp->mediasize = size;
 	newpp->sectorsize = secsize;
 
 	cp = g_new_consumer(gp);
-	if (cp == NULL) {
-		gctl_error(req, "Cannot create consumer for %s.", gp->name);
-		error = ENOMEM;
-		goto fail;
-	}
 	error = g_attach(cp, pp);
 	if (error != 0) {
 		gctl_error(req, "Cannot attach to provider %s.", pp->name);
@@ -233,18 +219,12 @@ g_nop_create(struct gctl_req *req, struc
 	G_NOP_DEBUG(0, "Device %s created.", gp->name);
 	return (0);
 fail:
-	if (cp != NULL) {
-		if (cp->provider != NULL)
-			g_detach(cp);
-		g_destroy_consumer(cp);
-	}
-	if (newpp != NULL)
-		g_destroy_provider(newpp);
-	if (gp != NULL) {
-		if (gp->softc != NULL)
-			g_free(gp->softc);
-		g_destroy_geom(gp);
-	}
+	if (cp->provider != NULL)
+		g_detach(cp);
+	g_destroy_consumer(cp);
+	g_destroy_provider(newpp);
+	g_free(gp->softc);
+	g_destroy_geom(gp);
 	return (error);
 }
 

From owner-svn-src-stable-8@FreeBSD.ORG  Thu Apr  7 06:01:09 2011
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E281F106566B;
	Thu,  7 Apr 2011 06:01:09 +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 D271F8FC17;
	Thu,  7 Apr 2011 06:01: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 p37619cE030371;
	Thu, 7 Apr 2011 06:01:09 GMT (envelope-from ae@svn.freebsd.org)
Received: (from ae@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p37619W3030369;
	Thu, 7 Apr 2011 06:01:09 GMT (envelope-from ae@svn.freebsd.org)
Message-Id: <201104070601.p37619W3030369@svn.freebsd.org>
From: "Andrey V. Elsukov" 
Date: Thu, 7 Apr 2011 06:01: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: r220408 - stable/8/sys/netinet/ipfw
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Thu, 07 Apr 2011 06:01:10 -0000

Author: ae
Date: Thu Apr  7 06:01:09 2011
New Revision: 220408
URL: http://svn.freebsd.org/changeset/base/220408

Log:
  MFC r220203:
    Fix a memory leak. Memory that is allocated for schedulers hash table
    was not freed.
  
    PR:		kern/156083

Modified:
  stable/8/sys/netinet/ipfw/ip_dummynet.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/netinet/ipfw/ip_dummynet.c
==============================================================================
--- stable/8/sys/netinet/ipfw/ip_dummynet.c	Thu Apr  7 05:58:21 2011	(r220407)
+++ stable/8/sys/netinet/ipfw/ip_dummynet.c	Thu Apr  7 06:01:09 2011	(r220408)
@@ -747,9 +747,10 @@ schk_delete_cb(void *obj, void *arg)
 #endif
 	fsk_detach_list(&s->fsk_list, arg ? DN_DESTROY : 0);
 	/* no more flowset pointing to us now */
-	if (s->sch.flags & DN_HAVE_MASK)
+	if (s->sch.flags & DN_HAVE_MASK) {
 		dn_ht_scan(s->siht, si_destroy, NULL);
-	else if (s->siht)
+		dn_ht_free(s->siht, 0);
+	} else if (s->siht)
 		si_destroy(s->siht, NULL);
 	if (s->profile) {
 		free(s->profile, M_DUMMYNET);

From owner-svn-src-stable-8@FreeBSD.ORG  Thu Apr  7 06:02:21 2011
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E5A40106566C;
	Thu,  7 Apr 2011 06:02:21 +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 D5CDE8FC1B;
	Thu,  7 Apr 2011 06:02: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 p3762LdC030442;
	Thu, 7 Apr 2011 06:02:21 GMT (envelope-from ae@svn.freebsd.org)
Received: (from ae@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p3762LLH030440;
	Thu, 7 Apr 2011 06:02:21 GMT (envelope-from ae@svn.freebsd.org)
Message-Id: <201104070602.p3762LLH030440@svn.freebsd.org>
From: "Andrey V. Elsukov" 
Date: Thu, 7 Apr 2011 06:02: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: r220409 - stable/8/sys/netinet/ipfw
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Thu, 07 Apr 2011 06:02:22 -0000

Author: ae
Date: Thu Apr  7 06:02:21 2011
New Revision: 220409
URL: http://svn.freebsd.org/changeset/base/220409

Log:
  MFC r220204:
    Fix malloc types.

Modified:
  stable/8/sys/netinet/ipfw/ip_dn_glue.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/netinet/ipfw/ip_dn_glue.c
==============================================================================
--- stable/8/sys/netinet/ipfw/ip_dn_glue.c	Thu Apr  7 06:01:09 2011	(r220408)
+++ stable/8/sys/netinet/ipfw/ip_dn_glue.c	Thu Apr  7 06:02:21 2011	(r220409)
@@ -807,7 +807,7 @@ ip_dummynet_compat(struct sockopt *sopt)
 		if (error)
 			break;
 		error = dn_compat_del(v);
-		free(v, M_DUMMYNET);
+		free(v, M_TEMP);
 		break;
 
 	case IP_DUMMYNET_CONFIGURE:
@@ -816,7 +816,7 @@ ip_dummynet_compat(struct sockopt *sopt)
 		if (error)
 			break;
 		error = dn_compat_configure(v);
-		free(v, M_DUMMYNET);
+		free(v, M_TEMP);
 		break;
 
 	case IP_DUMMYNET_GET: {

From owner-svn-src-stable-8@FreeBSD.ORG  Thu Apr  7 07:34:01 2011
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6560B106566C;
	Thu,  7 Apr 2011 07:34:01 +0000 (UTC)
	(envelope-from edwin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 54D398FC15;
	Thu,  7 Apr 2011 07:34: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 p377Y100032572;
	Thu, 7 Apr 2011 07:34:01 GMT (envelope-from edwin@svn.freebsd.org)
Received: (from edwin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p377Y1VV032570;
	Thu, 7 Apr 2011 07:34:01 GMT (envelope-from edwin@svn.freebsd.org)
Message-Id: <201104070734.p377Y1VV032570@svn.freebsd.org>
From: Edwin Groothuis 
Date: Thu, 7 Apr 2011 07:34:01 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r220411 - stable/8/usr.sbin/tzsetup
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Thu, 07 Apr 2011 07:34:01 -0000

Author: edwin
Date: Thu Apr  7 07:34:01 2011
New Revision: 220411
URL: http://svn.freebsd.org/changeset/base/220411

Log:
  MFC of r220172
  
  Add a menu entry for UTC in the main menu.
  
  PR:             bin/156019
  Submitted by:   Daniel O'Conner

Modified:
  stable/8/usr.sbin/tzsetup/tzsetup.c
Directory Properties:
  stable/8/usr.sbin/tzsetup/   (props changed)

Modified: stable/8/usr.sbin/tzsetup/tzsetup.c
==============================================================================
--- stable/8/usr.sbin/tzsetup/tzsetup.c	Thu Apr  7 07:10:42 2011	(r220410)
+++ stable/8/usr.sbin/tzsetup/tzsetup.c	Thu Apr  7 07:34:01 2011	(r220411)
@@ -66,10 +66,13 @@ static int usedialog = 1;
 static char *chrootenv = NULL;
 
 static void	usage(void);
+static int	confirm_zone(const char *filename);
 static int	continent_country_menu(dialogMenuItem *);
+static int	install_zoneinfo_file(const char *zoneinfo_file);
 static int	set_zone_multi(dialogMenuItem *);
 static int	set_zone_whole_country(dialogMenuItem *);
 static int	set_zone_menu(dialogMenuItem *);
+static int	set_zone_utc(void);
 
 struct continent {
 	dialogMenuItem *menu;
@@ -79,7 +82,7 @@ struct continent {
 };
 
 static struct continent	africa, america, antarctica, arctic, asia, atlantic;
-static struct continent	australia, europe, indian, pacific;
+static struct continent	australia, europe, indian, pacific, utc;
 
 static struct continent_names {
 	const char	*name;
@@ -94,7 +97,8 @@ static struct continent_names {
 	{ "Australia",	&australia },
 	{ "Europe",	&europe },
 	{ "Indian",	&indian },
-	{ "Pacific",	&pacific }
+	{ "Pacific",	&pacific },
+	{ "UTC", 	&utc }
 };
 
 static struct continent_items {
@@ -110,7 +114,8 @@ static struct continent_items {
 	{ "7",	"Australia" },
 	{ "8",	"Europe" },
 	{ "9",	"Indian Ocean" },
-	{ "0",	"Pacific Ocean" }
+	{ "0",	"Pacific Ocean" },
+	{ "a",	"UTC" }
 };
 
 #define	NCONTINENTS	\
@@ -128,6 +133,9 @@ continent_country_menu(dialogMenuItem *c
 	int		menulen;
 	int		rv;
 
+	if (strcmp(continent->title, "UTC") == 0)
+	        return set_zone_utc();	
+
 	/* Short cut -- if there's only one country, don't post a menu. */
 	if (contp->nitems == 1)
 		return (contp->menu[0].fire(&contp->menu[0]));
@@ -502,6 +510,15 @@ set_zone_menu(dialogMenuItem *dmi)
 	return (DITEM_LEAVE_MENU);
 }
 
+int
+set_zone_utc(void)
+{
+	if (!confirm_zone(NULL))
+		return (DITEM_FAILURE | DITEM_RECREATE);
+		
+	return (install_zoneinfo_file(NULL));
+}
+
 static int
 install_zoneinfo_file(const char *zoneinfo_file)
 {
@@ -526,7 +543,8 @@ install_zoneinfo_file(const char *zonein
 	else
 		snprintf(prompt, sizeof(prompt),
 		    "Creating symbolic link %s to %s",
-		    path_localtime, zoneinfo_file);
+		    path_localtime,
+		    zoneinfo_file == NULL ? "(UTC)" : zoneinfo_file);
 	if (usedialog)
 		dialog_notify(prompt);
 	else
@@ -534,6 +552,22 @@ install_zoneinfo_file(const char *zonein
 #endif
 
 	if (reallydoit) {
+		if (zoneinfo_file == NULL) {
+			if (unlink(path_localtime) < 0 && errno != ENOENT) {
+				snprintf(title, sizeof(title), "Error");
+				snprintf(prompt, sizeof(prompt),
+				     "Could not delete %s: %s", path_localtime,
+				     strerror(errno));
+				if (usedialog)
+					dialog_mesgbox(title, prompt, 8, 72);
+				else
+					fprintf(stderr, "%s\n", prompt);
+
+				return (DITEM_FAILURE | DITEM_RECREATE);
+			}
+			return (DITEM_LEAVE_MENU);
+		}
+		
 		if (copymode) {
 			fd1 = open(zoneinfo_file, O_RDONLY, 0);
 			if (fd1 < 0) {
@@ -656,7 +690,7 @@ confirm_zone(const char *filename)
 	struct tm	*tm;
 	int		rv;
 	
-	setenv("TZ", filename, 1);
+	setenv("TZ", filename == NULL ? "" : filename, 1);
 	tzset();
 	tm = localtime(&t);
 

From owner-svn-src-stable-8@FreeBSD.ORG  Thu Apr  7 11:13:51 2011
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 08D3A106564A;
	Thu,  7 Apr 2011 11:13:51 +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 EDDF08FC1A;
	Thu,  7 Apr 2011 11:13: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 p37BDotL038574;
	Thu, 7 Apr 2011 11:13:50 GMT (envelope-from ae@svn.freebsd.org)
Received: (from ae@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p37BDoO9038572;
	Thu, 7 Apr 2011 11:13:50 GMT (envelope-from ae@svn.freebsd.org)
Message-Id: <201104071113.p37BDoO9038572@svn.freebsd.org>
From: "Andrey V. Elsukov" 
Date: Thu, 7 Apr 2011 11:13:50 +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: r220415 - stable/8/sys/netinet/ipfw
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Thu, 07 Apr 2011 11:13:51 -0000

Author: ae
Date: Thu Apr  7 11:13:50 2011
New Revision: 220415
URL: http://svn.freebsd.org/changeset/base/220415

Log:
  MFC r220211:
    Fill up src_port and dst_port variables for SCTP over IPv4.
  
    PR:		kern/153415

Modified:
  stable/8/sys/netinet/ipfw/ip_fw2.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/netinet/ipfw/ip_fw2.c
==============================================================================
--- stable/8/sys/netinet/ipfw/ip_fw2.c	Thu Apr  7 08:32:53 2011	(r220414)
+++ stable/8/sys/netinet/ipfw/ip_fw2.c	Thu Apr  7 11:13:50 2011	(r220415)
@@ -1123,6 +1123,12 @@ do {								\
 				args->f_id._flags = TCP(ulp)->th_flags;
 				break;
 
+			case IPPROTO_SCTP:
+				PULLUP_TO(hlen, ulp, struct sctphdr);
+				src_port = SCTP(ulp)->src_port;
+				dst_port = SCTP(ulp)->dest_port;
+				break;
+
 			case IPPROTO_UDP:
 				PULLUP_TO(hlen, ulp, struct udphdr);
 				dst_port = UDP(ulp)->uh_dport;

From owner-svn-src-stable-8@FreeBSD.ORG  Thu Apr  7 14:17:55 2011
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 81687106564A;
	Thu,  7 Apr 2011 14:17:55 +0000 (UTC)
	(envelope-from emaste@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 548F78FC08;
	Thu,  7 Apr 2011 14:17: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 p37EHtit043027;
	Thu, 7 Apr 2011 14:17:55 GMT (envelope-from emaste@svn.freebsd.org)
Received: (from emaste@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p37EHtD0043025;
	Thu, 7 Apr 2011 14:17:55 GMT (envelope-from emaste@svn.freebsd.org)
Message-Id: <201104071417.p37EHtD0043025@svn.freebsd.org>
From: Ed Maste 
Date: Thu, 7 Apr 2011 14:17: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: r220425 - stable/8/sys/tools
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Thu, 07 Apr 2011 14:17:55 -0000

Author: emaste
Date: Thu Apr  7 14:17:55 2011
New Revision: 220425
URL: http://svn.freebsd.org/changeset/base/220425

Log:
  MFC r198374:
    Rename default to default_function, for compatibility with GNU awk.
    (For cross-compiling out-of-tree kernel modules, for example.)

Modified:
  stable/8/sys/tools/makeobjops.awk
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/tools/makeobjops.awk
==============================================================================
--- stable/8/sys/tools/makeobjops.awk	Thu Apr  7 13:49:44 2011	(r220424)
+++ stable/8/sys/tools/makeobjops.awk	Thu Apr  7 14:17:55 2011	(r220425)
@@ -240,7 +240,7 @@ function handle_method (static, doc)
 		lineno++
 	}
 
-	default = "";
+	default_function = "";
 	if (!match(line, /\};?/)) {
 		warnsrc("Premature end of file");
 		error = 1;
@@ -248,9 +248,9 @@ function handle_method (static, doc)
 	}
 	extra = substr(line, RSTART + RLENGTH);
 	if (extra ~ /[	 ]*DEFAULT[ 	]*[a-zA-Z_][a-zA-Z_0-9]*[ 	]*;/) {
-		default = extra;
-		sub(/.*DEFAULT[	 ]*/, "", default);
-		sub(/[; 	]+.*$/, "", default);
+		default_function = extra;
+		sub(/.*DEFAULT[	 ]*/, "", default_function);
+		sub(/[; 	]+.*$/, "", default_function);
 	}
 	else if (extra && opt_d) {
 		#   Warn about garbage at end of line.
@@ -294,8 +294,8 @@ function handle_method (static, doc)
 
 	firstvar = varnames[1];
 
-	if (default == "")
-		default = "kobj_error_method";
+	if (default_function == "")
+		default_function = "kobj_error_method";
 
 	# the method description 
 	printh("/** @brief Unique descriptor for the " umname "() method */");
@@ -308,7 +308,7 @@ function handle_method (static, doc)
 
 	# Print out the method desc
 	printc("struct kobj_method " mname "_method_default = {");
-	printc("\t&" mname "_desc, (kobjop_t) " default);
+	printc("\t&" mname "_desc, (kobjop_t) " default_function);
 	printc("};\n");
 
 	printc("struct kobjop_desc " mname "_desc = {");

From owner-svn-src-stable-8@FreeBSD.ORG  Fri Apr  8 05:48:52 2011
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 45B07106566C;
	Fri,  8 Apr 2011 05:48: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 335F08FC19;
	Fri,  8 Apr 2011 05:48: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 p385mqNH065163;
	Fri, 8 Apr 2011 05:48:52 GMT (envelope-from hselasky@svn.freebsd.org)
Received: (from hselasky@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p385mpEV065151;
	Fri, 8 Apr 2011 05:48:51 GMT (envelope-from hselasky@svn.freebsd.org)
Message-Id: <201104080548.p385mpEV065151@svn.freebsd.org>
From: Hans Petter Selasky 
Date: Fri, 8 Apr 2011 05:48: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: r220434 - in stable/8: lib/libusb share/man/man9
	sys/dev/usb
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Fri, 08 Apr 2011 05:48:52 -0000

Author: hselasky
Date: Fri Apr  8 05:48:51 2011
New Revision: 220434
URL: http://svn.freebsd.org/changeset/base/220434

Log:
  MFC r219100
  - Add support for software pre-scaling of ISOCHRONOUS transfers.
  
  Approved by:	thompsa (mentor)

Modified:
  stable/8/lib/libusb/libusb10.c
  stable/8/lib/libusb/libusb20.3
  stable/8/lib/libusb/libusb20.c
  stable/8/lib/libusb/libusb20.h
  stable/8/lib/libusb/libusb20_int.h
  stable/8/lib/libusb/libusb20_ugen20.c
  stable/8/share/man/man9/usbdi.9
  stable/8/sys/dev/usb/usb_generic.c
  stable/8/sys/dev/usb/usb_ioctl.h
  stable/8/sys/dev/usb/usb_transfer.c
  stable/8/sys/dev/usb/usbdi.h
Directory Properties:
  stable/8/lib/libusb/   (props changed)
  stable/8/lib/libusb/usb.h   (props changed)
  stable/8/share/man/man9/   (props changed)

Modified: stable/8/lib/libusb/libusb10.c
==============================================================================
--- stable/8/lib/libusb/libusb10.c	Thu Apr  7 23:28:28 2011	(r220433)
+++ stable/8/lib/libusb/libusb10.c	Fri Apr  8 05:48:51 2011	(r220434)
@@ -51,7 +51,6 @@ struct libusb_context *usbi_default_cont
 /* Prototypes */
 
 static struct libusb20_transfer *libusb10_get_transfer(struct libusb20_device *, uint8_t, uint8_t);
-static int libusb10_get_maxframe(struct libusb20_device *, libusb_transfer *);
 static int libusb10_get_buffsize(struct libusb20_device *, libusb_transfer *);
 static int libusb10_convert_error(uint8_t status);
 static void libusb10_complete_transfer(struct libusb20_transfer *, struct libusb_super_transfer *, int);
@@ -810,25 +809,14 @@ libusb_free_transfer(struct libusb_trans
 	free(sxfer);
 }
 
-static int
+static uint32_t
 libusb10_get_maxframe(struct libusb20_device *pdev, libusb_transfer *xfer)
 {
-	int ret;
-	int usb_speed;
-
-	usb_speed = libusb20_dev_get_speed(pdev);
+	uint32_t ret;
 
 	switch (xfer->type) {
 	case LIBUSB_TRANSFER_TYPE_ISOCHRONOUS:
-		switch (usb_speed) {
-		case LIBUSB20_SPEED_LOW:
-		case LIBUSB20_SPEED_FULL:
-			ret = 60 * 1;
-			break;
-		default:
-			ret = 60 * 8;
-			break;
-		}
+		ret = 60 | LIBUSB20_MAX_FRAME_PRE_SCALE;	/* 60ms */
 		break;
 	case LIBUSB_TRANSFER_TYPE_CONTROL:
 		ret = 2;

Modified: stable/8/lib/libusb/libusb20.3
==============================================================================
--- stable/8/lib/libusb/libusb20.3	Thu Apr  7 23:28:28 2011	(r220433)
+++ stable/8/lib/libusb/libusb20.3	Fri Apr  8 05:48:51 2011	(r220434)
@@ -261,6 +261,16 @@ The actual buffer size can be greater th
 and is returned by
 .Fn libusb20_tr_get_max_total_length .
 .
+If
+.Fa max_frame_count
+is OR'ed with LIBUSB20_MAX_FRAME_PRE_SCALE the remaining part of the
+argument is converted from milliseconds into the actual number of
+frames rounded up, when this function returns.
+This flag is only valid for ISOCHRONOUS transfers and has no effect
+for other transfer types.
+The actual number of frames setup is found by calling
+.Fn libusb20_tr_get_max_frames .
+.
 This function returns zero upon success.
 .
 Non-zero return values indicate a LIBUSB20_ERROR value.

Modified: stable/8/lib/libusb/libusb20.c
==============================================================================
--- stable/8/lib/libusb/libusb20.c	Thu Apr  7 23:28:28 2011	(r220433)
+++ stable/8/lib/libusb/libusb20.c	Fri Apr  8 05:48:51 2011	(r220434)
@@ -156,14 +156,20 @@ libusb20_tr_open(struct libusb20_transfe
     uint32_t MaxFrameCount, uint8_t ep_no)
 {
 	uint32_t size;
+	uint8_t pre_scale;
 	int error;
 
-	if (xfer->is_opened) {
+	if (xfer->is_opened)
 		return (LIBUSB20_ERROR_BUSY);
+	if (MaxFrameCount & LIBUSB20_MAX_FRAME_PRE_SCALE) {
+		MaxFrameCount &= ~LIBUSB20_MAX_FRAME_PRE_SCALE;
+		pre_scale = 1;
+	} else {
+		pre_scale = 0;
 	}
-	if (MaxFrameCount == 0) {
+	if (MaxFrameCount == 0)
 		return (LIBUSB20_ERROR_INVALID_PARAM);
-	}
+
 	xfer->maxFrames = MaxFrameCount;
 
 	size = MaxFrameCount * sizeof(xfer->pLength[0]);
@@ -182,7 +188,7 @@ libusb20_tr_open(struct libusb20_transfe
 	memset(xfer->ppBuffer, 0, size);
 
 	error = xfer->pdev->methods->tr_open(xfer, MaxBufSize,
-	    MaxFrameCount, ep_no);
+	    MaxFrameCount, ep_no, pre_scale);
 
 	if (error) {
 		free(xfer->ppBuffer);

Modified: stable/8/lib/libusb/libusb20.h
==============================================================================
--- stable/8/lib/libusb/libusb20.h	Thu Apr  7 23:28:28 2011	(r220433)
+++ stable/8/lib/libusb/libusb20.h	Fri Apr  8 05:48:51 2011	(r220434)
@@ -197,8 +197,9 @@ struct libusb20_quirk {
 	char	quirkname[64 - 12];
 };
 
-/* USB transfer operations */
+#define	LIBUSB20_MAX_FRAME_PRE_SCALE	(1U << 31)
 
+/* USB transfer operations */
 int	libusb20_tr_close(struct libusb20_transfer *xfer);
 int	libusb20_tr_open(struct libusb20_transfer *xfer, uint32_t max_buf_size, uint32_t max_frame_count, uint8_t ep_no);
 struct libusb20_transfer *libusb20_tr_get_pointer(struct libusb20_device *pdev, uint16_t tr_index);

Modified: stable/8/lib/libusb/libusb20_int.h
==============================================================================
--- stable/8/lib/libusb/libusb20_int.h	Thu Apr  7 23:28:28 2011	(r220433)
+++ stable/8/lib/libusb/libusb20_int.h	Fri Apr  8 05:48:51 2011	(r220434)
@@ -104,7 +104,7 @@ typedef int (libusb20_set_config_index_t
 typedef int (libusb20_check_connected_t)(struct libusb20_device *pdev);
 
 /* USB transfer specific */
-typedef int (libusb20_tr_open_t)(struct libusb20_transfer *xfer, uint32_t MaxBufSize, uint32_t MaxFrameCount, uint8_t ep_no);
+typedef int (libusb20_tr_open_t)(struct libusb20_transfer *xfer, uint32_t MaxBufSize, uint32_t MaxFrameCount, uint8_t ep_no, uint8_t pre_scale);
 typedef int (libusb20_tr_close_t)(struct libusb20_transfer *xfer);
 typedef int (libusb20_tr_clear_stall_sync_t)(struct libusb20_transfer *xfer);
 typedef void (libusb20_tr_submit_t)(struct libusb20_transfer *xfer);

Modified: stable/8/lib/libusb/libusb20_ugen20.c
==============================================================================
--- stable/8/lib/libusb/libusb20_ugen20.c	Thu Apr  7 23:28:28 2011	(r220433)
+++ stable/8/lib/libusb/libusb20_ugen20.c	Fri Apr  8 05:48:51 2011	(r220434)
@@ -736,11 +736,14 @@ ugen20_process(struct libusb20_device *p
 
 static int
 ugen20_tr_open(struct libusb20_transfer *xfer, uint32_t MaxBufSize,
-    uint32_t MaxFrameCount, uint8_t ep_no)
+    uint32_t MaxFrameCount, uint8_t ep_no, uint8_t pre_scale)
 {
 	struct usb_fs_open temp;
 	struct usb_fs_endpoint *fsep;
 
+	if (pre_scale)
+		MaxFrameCount |= USB_FS_MAX_FRAMES_PRE_SCALE;
+
 	memset(&temp, 0, sizeof(temp));
 
 	fsep = xfer->pdev->privBeData;

Modified: stable/8/share/man/man9/usbdi.9
==============================================================================
--- stable/8/share/man/man9/usbdi.9	Thu Apr  7 23:28:28 2011	(r220433)
+++ stable/8/share/man/man9/usbdi.9	Fri Apr  8 05:48:51 2011	(r220434)
@@ -594,6 +594,10 @@ use the "usbd_xfer_set_stall()" and "usb
 functions! This flag is automatically cleared after that the stall or
 clear stall has been executed.
 .
+.It pre_scale_frames
+If this flag is set the number of frames specified is assumed to give the buffering time in milliseconds instead of frames.
+During transfer setup the frames field is pre scaled with the corresponding value for the endpoint and rounded to the nearest number of frames greater than zero.
+This option only has effect for ISOCHRONOUS transfers.
 .El
 .Pp
 .Fa bufsize

Modified: stable/8/sys/dev/usb/usb_generic.c
==============================================================================
--- stable/8/sys/dev/usb/usb_generic.c	Thu Apr  7 23:28:28 2011	(r220433)
+++ stable/8/sys/dev/usb/usb_generic.c	Fri Apr  8 05:48:51 2011	(r220434)
@@ -1398,6 +1398,7 @@ ugen_ioctl(struct usb_fifo *f, u_long cm
 	uint8_t iface_index;
 	uint8_t isread;
 	uint8_t ep_index;
+	uint8_t pre_scale;
 
 	u.addr = addr;
 
@@ -1449,6 +1450,12 @@ ugen_ioctl(struct usb_fifo *f, u_long cm
 		if (u.popen->max_bufsize > USB_FS_MAX_BUFSIZE) {
 			u.popen->max_bufsize = USB_FS_MAX_BUFSIZE;
 		}
+		if (u.popen->max_frames & USB_FS_MAX_FRAMES_PRE_SCALE) {
+			pre_scale = 1;
+			u.popen->max_frames &= ~USB_FS_MAX_FRAMES_PRE_SCALE;
+		} else {
+			pre_scale = 0;
+		}
 		if (u.popen->max_frames > USB_FS_MAX_FRAMES) {
 			u.popen->max_frames = USB_FS_MAX_FRAMES;
 			break;
@@ -1469,13 +1476,15 @@ ugen_ioctl(struct usb_fifo *f, u_long cm
 		}
 		iface_index = ep->iface_index;
 
-		bzero(usb_config, sizeof(usb_config));
+		memset(usb_config, 0, sizeof(usb_config));
 
 		usb_config[0].type = ed->bmAttributes & UE_XFERTYPE;
 		usb_config[0].endpoint = ed->bEndpointAddress & UE_ADDR;
 		usb_config[0].direction = ed->bEndpointAddress & (UE_DIR_OUT | UE_DIR_IN);
 		usb_config[0].interval = USB_DEFAULT_INTERVAL;
 		usb_config[0].flags.proxy_buffer = 1;
+		if (pre_scale != 0)
+			usb_config[0].flags.pre_scale_frames = 1;
 		usb_config[0].callback = &ugen_ctrl_fs_callback;
 		usb_config[0].timeout = 0;	/* no timeout */
 		usb_config[0].frames = u.popen->max_frames;
@@ -1517,6 +1526,10 @@ ugen_ioctl(struct usb_fifo *f, u_long cm
 			    f->fs_xfer[u.popen->ep_index]->max_frame_size;
 			u.popen->max_bufsize =
 			    f->fs_xfer[u.popen->ep_index]->max_data_length;
+			/* update number of frames */
+			u.popen->max_frames =
+			    f->fs_xfer[u.popen->ep_index]->nframes;
+			/* store index of endpoint */
 			f->fs_xfer[u.popen->ep_index]->priv_fifo =
 			    ((uint8_t *)0) + u.popen->ep_index;
 		} else {

Modified: stable/8/sys/dev/usb/usb_ioctl.h
==============================================================================
--- stable/8/sys/dev/usb/usb_ioctl.h	Thu Apr  7 23:28:28 2011	(r220433)
+++ stable/8/sys/dev/usb/usb_ioctl.h	Fri Apr  8 05:48:51 2011	(r220434)
@@ -162,8 +162,9 @@ struct usb_fs_uninit {
 struct usb_fs_open {
 #define	USB_FS_MAX_BUFSIZE (1 << 18)
 	uint32_t max_bufsize;
-#define	USB_FS_MAX_FRAMES (1 << 12)
-	uint32_t max_frames;
+#define	USB_FS_MAX_FRAMES		(1U << 12)
+#define	USB_FS_MAX_FRAMES_PRE_SCALE	(1U << 31)	/* for ISOCHRONOUS transfers */
+	uint32_t max_frames;		/* read and write */
 	uint16_t max_packet_length;	/* read only */
 	uint8_t	dev_index;		/* currently unused */
 	uint8_t	ep_index;

Modified: stable/8/sys/dev/usb/usb_transfer.c
==============================================================================
--- stable/8/sys/dev/usb/usb_transfer.c	Thu Apr  7 23:28:28 2011	(r220433)
+++ stable/8/sys/dev/usb/usb_transfer.c	Fri Apr  8 05:48:51 2011	(r220434)
@@ -471,6 +471,8 @@ usbd_transfer_setup_sub(struct usb_setup
 				xfer->fps_shift--;
 			if (xfer->fps_shift > 3)
 				xfer->fps_shift = 3;
+			if (xfer->flags.pre_scale_frames != 0)
+				xfer->nframes <<= (3 - xfer->fps_shift);
 			break;
 		}
 

Modified: stable/8/sys/dev/usb/usbdi.h
==============================================================================
--- stable/8/sys/dev/usb/usbdi.h	Thu Apr  7 23:28:28 2011	(r220433)
+++ stable/8/sys/dev/usb/usbdi.h	Fri Apr  8 05:48:51 2011	(r220434)
@@ -194,6 +194,16 @@ struct usb_xfer_flags {
 	uint8_t	stall_pipe:1;		/* set if the endpoint belonging to
 					 * this USB transfer should be stalled
 					 * before starting this transfer! */
+	uint8_t pre_scale_frames:1;	/* "usb_config->frames" is
+					 * assumed to give the
+					 * buffering time in
+					 * milliseconds and is
+					 * converted into the nearest
+					 * number of frames when the
+					 * USB transfer is setup. This
+					 * option only has effect for
+					 * ISOCHRONOUS transfers.
+					 */
 };
 
 /*

From owner-svn-src-stable-8@FreeBSD.ORG  Fri Apr  8 06:13:20 2011
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 48BEB106566C;
	Fri,  8 Apr 2011 06:13:20 +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 1CD138FC13;
	Fri,  8 Apr 2011 06:13: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 p386DKQA065783;
	Fri, 8 Apr 2011 06:13:20 GMT (envelope-from hselasky@svn.freebsd.org)
Received: (from hselasky@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p386DJjS065778;
	Fri, 8 Apr 2011 06:13:19 GMT (envelope-from hselasky@svn.freebsd.org)
Message-Id: <201104080613.p386DJjS065778@svn.freebsd.org>
From: Hans Petter Selasky 
Date: Fri, 8 Apr 2011 06:13: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: r220435 - in stable/8/sys: dev/usb/controller
	mips/atheros mips/rmi
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Fri, 08 Apr 2011 06:13:20 -0000

Author: hselasky
Date: Fri Apr  8 06:13:19 2011
New Revision: 220435
URL: http://svn.freebsd.org/changeset/base/220435

Log:
  MFC r220303
  - Correct EHCI interrupt disabling at detach.
  
  Approved by:	thompsa (mentor)

Modified:
  stable/8/sys/dev/usb/controller/ehci_ixp4xx.c
  stable/8/sys/dev/usb/controller/ehci_pci.c
  stable/8/sys/mips/atheros/ar71xx_ehci.c
  stable/8/sys/mips/rmi/xls_ehci.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/dev/usb/controller/ehci_ixp4xx.c
==============================================================================
--- stable/8/sys/dev/usb/controller/ehci_ixp4xx.c	Fri Apr  8 05:48:51 2011	(r220434)
+++ stable/8/sys/dev/usb/controller/ehci_ixp4xx.c	Fri Apr  8 06:13:19 2011	(r220435)
@@ -264,7 +264,7 @@ ehci_ixp_detach(device_t self)
 	 * disable interrupts that might have been switched on in ehci_init
 	 */
 	if (sc->sc_io_res) {
-		EWRITE4(sc, EHCI_USBINTR, 0);
+		EOWRITE4(sc, EHCI_USBINTR, 0);
 	}
 
  	if (sc->sc_irq_res && sc->sc_intr_hdl) {

Modified: stable/8/sys/dev/usb/controller/ehci_pci.c
==============================================================================
--- stable/8/sys/dev/usb/controller/ehci_pci.c	Fri Apr  8 05:48:51 2011	(r220434)
+++ stable/8/sys/dev/usb/controller/ehci_pci.c	Fri Apr  8 06:13:19 2011	(r220435)
@@ -507,7 +507,7 @@ ehci_pci_detach(device_t self)
 	 * disable interrupts that might have been switched on in ehci_init
 	 */
 	if (sc->sc_io_res) {
-		EWRITE4(sc, EHCI_USBINTR, 0);
+		EOWRITE4(sc, EHCI_USBINTR, 0);
 	}
 	if (sc->sc_irq_res && sc->sc_intr_hdl) {
 		/*

Modified: stable/8/sys/mips/atheros/ar71xx_ehci.c
==============================================================================
--- stable/8/sys/mips/atheros/ar71xx_ehci.c	Fri Apr  8 05:48:51 2011	(r220434)
+++ stable/8/sys/mips/atheros/ar71xx_ehci.c	Fri Apr  8 06:13:19 2011	(r220435)
@@ -229,7 +229,7 @@ ar71xx_ehci_detach(device_t self)
 	 * disable interrupts that might have been switched on in ehci_init
 	 */
 	if (sc->sc_io_res) {
-		EWRITE4(sc, EHCI_USBINTR, 0);
+		EOWRITE4(sc, EHCI_USBINTR, 0);
 	}
 
  	if (sc->sc_irq_res && sc->sc_intr_hdl) {

Modified: stable/8/sys/mips/rmi/xls_ehci.c
==============================================================================
--- stable/8/sys/mips/rmi/xls_ehci.c	Fri Apr  8 05:48:51 2011	(r220434)
+++ stable/8/sys/mips/rmi/xls_ehci.c	Fri Apr  8 06:13:19 2011	(r220435)
@@ -228,7 +228,7 @@ ehci_xls_detach(device_t self)
 	 * disable interrupts that might have been switched on in ehci_init
 	 */
 	if (sc->sc_io_res) {
-		EWRITE4(sc, EHCI_USBINTR, 0);
+		EOWRITE4(sc, EHCI_USBINTR, 0);
 	}
 
 	if (sc->sc_irq_res && sc->sc_intr_hdl) {

From owner-svn-src-stable-8@FreeBSD.ORG  Fri Apr  8 06:20:43 2011
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 58947106566B;
	Fri,  8 Apr 2011 06:20:43 +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 484D28FC0A;
	Fri,  8 Apr 2011 06:20:43 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p386KhZC066031;
	Fri, 8 Apr 2011 06:20:43 GMT (envelope-from hselasky@svn.freebsd.org)
Received: (from hselasky@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p386KhmB066029;
	Fri, 8 Apr 2011 06:20:43 GMT (envelope-from hselasky@svn.freebsd.org)
Message-Id: <201104080620.p386KhmB066029@svn.freebsd.org>
From: Hans Petter Selasky 
Date: Fri, 8 Apr 2011 06:20:43 +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: r220436 - stable/8/sys/dev/usb
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Fri, 08 Apr 2011 06:20:43 -0000

Author: hselasky
Date: Fri Apr  8 06:20:43 2011
New Revision: 220436
URL: http://svn.freebsd.org/changeset/base/220436

Log:
  MFC r219395.
  - Bugfix: Root HUBs do not support re-enumeration.
  
  Approved by:	thompsa (mentor)

Modified:
  stable/8/sys/dev/usb/usb_generic.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/dev/usb/usb_generic.c
==============================================================================
--- stable/8/sys/dev/usb/usb_generic.c	Fri Apr  8 06:13:19 2011	(r220435)
+++ stable/8/sys/dev/usb/usb_generic.c	Fri Apr  8 06:20:43 2011	(r220436)
@@ -953,8 +953,14 @@ ugen_re_enumerate(struct usb_fifo *f)
 	}
 	if (udev->flags.usb_mode != USB_MODE_HOST) {
 		/* not possible in device side mode */
+		DPRINTFN(6, "device mode\n");
 		return (ENOTTY);
 	}
+	if (udev->parent_hub == NULL) {
+		/* the root HUB cannot be re-enumerated */
+		DPRINTFN(6, "cannot reset root HUB\n");
+		return (EINVAL);
+	}
 	/* make sure all FIFO's are gone */
 	/* else there can be a deadlock */
 	if (ugen_fs_uninit(f)) {

From owner-svn-src-stable-8@FreeBSD.ORG  Fri Apr  8 06:37:22 2011
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A8EED1065676;
	Fri,  8 Apr 2011 06:37:22 +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 7E0FE8FC0C;
	Fri,  8 Apr 2011 06:37: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 p386bMZD066494;
	Fri, 8 Apr 2011 06:37:22 GMT (envelope-from hselasky@svn.freebsd.org)
Received: (from hselasky@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p386bMHN066492;
	Fri, 8 Apr 2011 06:37:22 GMT (envelope-from hselasky@svn.freebsd.org)
Message-Id: <201104080637.p386bMHN066492@svn.freebsd.org>
From: Hans Petter Selasky 
Date: Fri, 8 Apr 2011 06:37: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: r220439 - stable/8/sys/dev/usb
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Fri, 08 Apr 2011 06:37:22 -0000

Author: hselasky
Date: Fri Apr  8 06:37:22 2011
New Revision: 220439
URL: http://svn.freebsd.org/changeset/base/220439

Log:
  MFC r220304.
  - Fix for missing event if a libUSB USB transfer is started and
    stopped rapidly in succession.

Modified:
  stable/8/sys/dev/usb/usb_generic.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/dev/usb/usb_generic.c
==============================================================================
--- stable/8/sys/dev/usb/usb_generic.c	Fri Apr  8 06:29:41 2011	(r220438)
+++ stable/8/sys/dev/usb/usb_generic.c	Fri Apr  8 06:37:22 2011	(r220439)
@@ -1400,6 +1400,7 @@ ugen_ioctl(struct usb_fifo *f, u_long cm
 	}     u;
 	struct usb_endpoint *ep;
 	struct usb_endpoint_descriptor *ed;
+	struct usb_xfer *xfer;
 	int error = 0;
 	uint8_t iface_index;
 	uint8_t isread;
@@ -1426,11 +1427,11 @@ ugen_ioctl(struct usb_fifo *f, u_long cm
 
 	case USB_FS_START:
 		error = ugen_fs_copy_in(f, u.pstart->ep_index);
-		if (error) {
+		if (error)
 			break;
-		}
 		mtx_lock(f->priv_mtx);
-		usbd_transfer_start(f->fs_xfer[u.pstart->ep_index]);
+		xfer = f->fs_xfer[u.pstart->ep_index];
+		usbd_transfer_start(xfer);
 		mtx_unlock(f->priv_mtx);
 		break;
 
@@ -1440,7 +1441,19 @@ ugen_ioctl(struct usb_fifo *f, u_long cm
 			break;
 		}
 		mtx_lock(f->priv_mtx);
-		usbd_transfer_stop(f->fs_xfer[u.pstop->ep_index]);
+		xfer = f->fs_xfer[u.pstart->ep_index];
+		if (usbd_transfer_pending(xfer)) {
+			usbd_transfer_stop(xfer);
+			/*
+			 * Check if the USB transfer was stopped
+			 * before it was even started. Else a cancel
+			 * callback will be pending.
+			 */
+			if (!xfer->flags_int.transferring) {
+				ugen_fs_set_complete(xfer->priv_sc,
+				    USB_P2U(xfer->priv_fifo));
+			}
+		}
 		mtx_unlock(f->priv_mtx);
 		break;
 

From owner-svn-src-stable-8@FreeBSD.ORG  Fri Apr  8 06:50:19 2011
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 264F1106564A;
	Fri,  8 Apr 2011 06:50:19 +0000 (UTC)
	(envelope-from hselasky@c2i.net)
Received: from swip.net (mailfe03.c2i.net [212.247.154.66])
	by mx1.freebsd.org (Postfix) with ESMTP id 170078FC0C;
	Fri,  8 Apr 2011 06:50:17 +0000 (UTC)
X-Cloudmark-Score: 0.000000 []
X-Cloudmark-Analysis: v=1.1 cv=0KkIQGagYCvnrzE3Z2Lmid87OPdbX6VLcZYwAuLMZ50=
	c=1 sm=1 a=IU0TiZmyZPMA:10 a=wvRgOJpgG5UA:10 a=WQU8e4WWZSUA:10
	a=N659UExz7-8A:10 a=CL8lFSKtTFcA:10
	a=i9M/sDlu2rpZ9XS819oYzg==:17 a=6I5d2MoRAAAA:8
	a=HxE9YmCmk37x6gvMKRcA:9 a=pILNOxqGKmIA:10
	a=i9M/sDlu2rpZ9XS819oYzg==:117
Received: from [188.126.198.129] (account mc467741@c2i.net HELO
	laptop002.hselasky.homeunix.org)
	by mailfe03.swip.net (CommuniGate Pro SMTP 5.2.19)
	with ESMTPA id 111685500; Fri, 08 Apr 2011 08:40:13 +0200
From: Hans Petter Selasky 
To: "src-committers@freebsd.org" 
Date: Fri, 8 Apr 2011 08:39:17 +0200
User-Agent: KMail/1.13.5 (FreeBSD/8.2-PRERELEASE; KDE/4.4.5; amd64; ; )
References: <201104080637.p386bMHN066492@svn.freebsd.org>
In-Reply-To: <201104080637.p386bMHN066492@svn.freebsd.org>
X-Face: *nPdTl_}RuAI6^PVpA02T?$%Xa^>@hE0uyUIoiha$pC:9TVgl.Oq, NwSZ4V"|LR.+tj}g5
	%V,x^qOs~mnU3]Gn; cQLv&.N>TrxmSFf+p6(30a/{)KUU!s}w\IhQBj}[g}bj0I3^glmC(
	:AuzV9:.hESm-x4h240C`9=w
MIME-Version: 1.0
Content-Type: Text/Plain;
  charset="windows-1252"
Content-Transfer-Encoding: 7bit
Message-Id: <201104080839.17298.hselasky@c2i.net>
Cc: "svn-src-stable@freebsd.org" ,
	"svn-src-all@freebsd.org" ,
	"svn-src-stable-8@freebsd.org" 
Subject: Re: svn commit: r220439 - stable/8/sys/dev/usb
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Fri, 08 Apr 2011 06:50:19 -0000

On Friday 08 April 2011 08:37:22 Hans Petter Selasky wrote:
> Author: hselasky
> Date: Fri Apr  8 06:37:22 2011
> New Revision: 220439
> URL: http://svn.freebsd.org/changeset/base/220439
> 
> Log:
>   MFC r220304.
>   - Fix for missing event if a libUSB USB transfer is started and
>     stopped rapidly in succession.

Should also say:

Approved by:  thompsa (mentor)

--HPS

From owner-svn-src-stable-8@FreeBSD.ORG  Fri Apr  8 06:50:26 2011
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 686B81065781;
	Fri,  8 Apr 2011 06:50:26 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 4DEA78FC1A;
	Fri,  8 Apr 2011 06:50: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 p386oQW0066840;
	Fri, 8 Apr 2011 06:50:26 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p386oQW0066838;
	Fri, 8 Apr 2011 06:50:26 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201104080650.p386oQW0066838@svn.freebsd.org>
From: Andriy Gapon 
Date: Fri, 8 Apr 2011 06:50:26 +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: r220440 - stable/8/libexec/rtld-elf
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Fri, 08 Apr 2011 06:50:26 -0000

Author: avg
Date: Fri Apr  8 06:50:26 2011
New Revision: 220440
URL: http://svn.freebsd.org/changeset/base/220440

Log:
  MFC r220004: rtld: eliminate double call to close(2) that may occur in load_object

Modified:
  stable/8/libexec/rtld-elf/rtld.c
Directory Properties:
  stable/8/libexec/rtld-elf/   (props changed)

Modified: stable/8/libexec/rtld-elf/rtld.c
==============================================================================
--- stable/8/libexec/rtld-elf/rtld.c	Fri Apr  8 06:37:22 2011	(r220439)
+++ stable/8/libexec/rtld-elf/rtld.c	Fri Apr  8 06:50:26 2011	(r220440)
@@ -1520,12 +1520,9 @@ load_object(const char *name, const Obj_
 	free(path);
 	return NULL;
     }
-    for (obj = obj_list->next;  obj != NULL;  obj = obj->next) {
-	if (obj->ino == sb.st_ino && obj->dev == sb.st_dev) {
-	    close(fd);
+    for (obj = obj_list->next;  obj != NULL;  obj = obj->next)
+	if (obj->ino == sb.st_ino && obj->dev == sb.st_dev)
 	    break;
-	}
-    }
     if (obj != NULL) {
 	object_add_name(obj, name);
 	free(path);

From owner-svn-src-stable-8@FreeBSD.ORG  Fri Apr  8 07:29:45 2011
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7D662106566C;
	Fri,  8 Apr 2011 07:29:45 +0000 (UTC) (envelope-from andy@fud.org.nz)
Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50])
	by mx1.freebsd.org (Postfix) with ESMTP id 775808FC08;
	Fri,  8 Apr 2011 07:29:44 +0000 (UTC)
Received: by wwc33 with SMTP id 33so3755382wwc.31
	for ; Fri, 08 Apr 2011 00:29:43 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.227.150.101 with SMTP id x37mr1869228wbv.225.1302246214375;
	Fri, 08 Apr 2011 00:03:34 -0700 (PDT)
Sender: andy@fud.org.nz
Received: by 10.227.138.139 with HTTP; Fri, 8 Apr 2011 00:03:34 -0700 (PDT)
In-Reply-To: <201104080548.p385mpEV065151@svn.freebsd.org>
References: <201104080548.p385mpEV065151@svn.freebsd.org>
Date: Fri, 8 Apr 2011 19:03:34 +1200
X-Google-Sender-Auth: UmbpocS3yDG06EafHYLlSH9VwHs
Message-ID: 
From: Andrew Thompson 
To: Hans Petter Selasky 
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, svn-src-stable-8@freebsd.org
Subject: Re: svn commit: r220434 - in stable/8: lib/libusb share/man/man9
	sys/dev/usb
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Fri, 08 Apr 2011 07:29:45 -0000

On 8 April 2011 17:48, Hans Petter Selasky  wrote:
> Author: hselasky
> Date: Fri Apr =A08 05:48:51 2011
> New Revision: 220434
> URL: http://svn.freebsd.org/changeset/base/220434
>
> Log:
> =A0MFC r219100
> =A0- Add support for software pre-scaling of ISOCHRONOUS transfers.
>
> =A0Approved by: =A0thompsa (mentor)
>
> Modified:
> =A0stable/8/lib/libusb/libusb10.c
> =A0stable/8/lib/libusb/libusb20.3
> =A0stable/8/lib/libusb/libusb20.c
> =A0stable/8/lib/libusb/libusb20.h
> =A0stable/8/lib/libusb/libusb20_int.h
> =A0stable/8/lib/libusb/libusb20_ugen20.c
> =A0stable/8/share/man/man9/usbdi.9
> =A0stable/8/sys/dev/usb/usb_generic.c
> =A0stable/8/sys/dev/usb/usb_ioctl.h
> =A0stable/8/sys/dev/usb/usb_transfer.c
> =A0stable/8/sys/dev/usb/usbdi.h
> Directory Properties:
> =A0stable/8/lib/libusb/ =A0 (props changed)
> =A0stable/8/lib/libusb/usb.h =A0 (props changed)
> =A0stable/8/share/man/man9/ =A0 (props changed)

I expected to see mergeinfo changes on stable/8/sys, will work out
with you where things went wrong.


Andrew

From owner-svn-src-stable-8@FreeBSD.ORG  Fri Apr  8 14:47:27 2011
Return-Path: 
Delivered-To: svn-src-stable-8@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A02F0106564A;
	Fri,  8 Apr 2011 14:47:27 +0000 (UTC)
	(envelope-from doconnor@gsoft.com.au)
Received: from cain.gsoft.com.au (unknown
	[IPv6:2001:44b8:7c07:5581:266:e1ff:fe0c:8f16])
	by mx1.freebsd.org (Postfix) with ESMTP id 41A8E8FC16;
	Fri,  8 Apr 2011 14:47:25 +0000 (UTC)
Received: from [192.168.42.215] (maarsy.rocketrange.no [128.39.153.30])
	(authenticated bits=0)
	by cain.gsoft.com.au (8.14.4/8.14.3) with ESMTP id p38ElEeo044429
	(version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO);
	Sat, 9 Apr 2011 00:17:18 +0930 (CST)
	(envelope-from doconnor@gsoft.com.au)
Mime-Version: 1.0 (Apple Message framework v1084)
Content-Type: text/plain; charset=us-ascii
From: "Daniel O'Connor" 
In-Reply-To: <201104070734.p377Y1VV032570@svn.freebsd.org>
Date: Fri, 8 Apr 2011 22:47:14 +0800
Content-Transfer-Encoding: 7bit
Message-Id: <0992CC04-F86A-49ED-B3E8-7F6DDABFB186@gsoft.com.au>
References: <201104070734.p377Y1VV032570@svn.freebsd.org>
To: Edwin Groothuis 
X-Mailer: Apple Mail (2.1084)
X-Spam-Score: -1.5 () BAYES_00
X-Scanned-By: MIMEDefang 2.67 on 203.31.81.10
Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org, svn-src-stable-8@FreeBSD.org
Subject: Re: svn commit: r220411 - stable/8/usr.sbin/tzsetup
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Fri, 08 Apr 2011 14:47:27 -0000


On 07/04/2011, at 15:34, Edwin Groothuis wrote:
>  Add a menu entry for UTC in the main menu.
> 
>  PR:             bin/156019
>  Submitted by:   Daniel O'Conner

Thanks.

It's O'Connor though :)

--
Daniel O'Connor software and network engineer
for Genesis Software - http://www.gsoft.com.au
"The nice thing about standards is that there
are so many of them to choose from."
  -- Andrew Tanenbaum
GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C







From owner-svn-src-stable-8@FreeBSD.ORG  Fri Apr  8 18:31:02 2011
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 06CF9106566B;
	Fri,  8 Apr 2011 18:31:02 +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 E89128FC20;
	Fri,  8 Apr 2011 18:31: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 p38IV13R088488;
	Fri, 8 Apr 2011 18:31:01 GMT (envelope-from uqs@svn.freebsd.org)
Received: (from uqs@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p38IV10s088484;
	Fri, 8 Apr 2011 18:31:01 GMT (envelope-from uqs@svn.freebsd.org)
Message-Id: <201104081831.p38IV10s088484@svn.freebsd.org>
From: Ulrich Spoerlein 
Date: Fri, 8 Apr 2011 18:31:01 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r220455 - stable/8/sbin/bsdlabel
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Fri, 08 Apr 2011 18:31:02 -0000

Author: uqs
Date: Fri Apr  8 18:31:01 2011
New Revision: 220455
URL: http://svn.freebsd.org/changeset/base/220455

Log:
  MFH r219446-219449:
  
  - Remove bsdlabel.5
  - Remove bsdlabel test-script that was full of broken assumptions
  - Remove dead code depending on __alpha__
  - Widen fields that display partition offset/length.

Deleted:
  stable/8/sbin/bsdlabel/bsdlabel.5
  stable/8/sbin/bsdlabel/runtest.sh
Modified:
  stable/8/sbin/bsdlabel/Makefile
  stable/8/sbin/bsdlabel/bsdlabel.8
  stable/8/sbin/bsdlabel/bsdlabel.c
Directory Properties:
  stable/8/sbin/bsdlabel/   (props changed)

Modified: stable/8/sbin/bsdlabel/Makefile
==============================================================================
--- stable/8/sbin/bsdlabel/Makefile	Fri Apr  8 14:42:29 2011	(r220454)
+++ stable/8/sbin/bsdlabel/Makefile	Fri Apr  8 18:31:01 2011	(r220455)
@@ -5,7 +5,6 @@
 
 PROG=	bsdlabel
 SRCS=	bsdlabel.c geom_bsd_enc.c
-#MAN=	bsdlabel.5
 MAN+=	bsdlabel.8
 
 .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64"
@@ -17,9 +16,3 @@ DPADD=	${LIBGEOM} ${LIBBSDXML} ${LIBSBUF
 LDADD=	-lgeom -lbsdxml -lsbuf
 
 .include 
-
-test: ${PROG}
-	sh ${.CURDIR}/runtest.sh
-
-testx: ${PROG}
-	sh -x ${.CURDIR}/runtest.sh

Modified: stable/8/sbin/bsdlabel/bsdlabel.8
==============================================================================
--- stable/8/sbin/bsdlabel/bsdlabel.8	Fri Apr  8 14:42:29 2011	(r220454)
+++ stable/8/sbin/bsdlabel/bsdlabel.8	Fri Apr  8 18:31:01 2011	(r220455)
@@ -31,7 +31,7 @@
 .\"	@(#)disklabel.8	8.2 (Berkeley) 4/19/94
 .\" $FreeBSD$
 .\"
-.Dd December 8, 2007
+.Dd March 5, 2011
 .Dt BSDLABEL 8
 .Os
 .Sh NAME
@@ -109,9 +109,9 @@ argument forces
 .Nm
 to use a layout suitable for a different architecture.
 Current valid values are
-.Cm i386 , amd64 , ia64 , pc98 ,
+.Cm i386 , amd64 , ia64 ,
 and
-.Cm alpha .
+.Cm pc98 .
 If this option is omitted,
 .Nm
 will use a layout suitable for the current machine.
@@ -493,7 +493,6 @@ are not generally compatible.
 .Xr ccd 4 ,
 .Xr geom 4 ,
 .Xr md 4 ,
-.\" Xr bsdlabel 5 ,
 .Xr disktab 5 ,
 .Xr boot0cfg 8 ,
 .Xr fdisk 8 ,

Modified: stable/8/sbin/bsdlabel/bsdlabel.c
==============================================================================
--- stable/8/sbin/bsdlabel/bsdlabel.c	Fri Apr  8 14:42:29 2011	(r220454)
+++ stable/8/sbin/bsdlabel/bsdlabel.c	Fri Apr  8 18:31:01 2011	(r220455)
@@ -105,7 +105,7 @@ static char	tmpfil[] = PATH_TMPFILE;
 static struct	disklabel lab;
 static u_char	bootarea[BBSIZE];
 static off_t	mediasize;
-static u_int	secsize;
+static ssize_t	secsize;
 static char	blank[] = "";
 static char	unknown[] = "unknown";
 
@@ -129,12 +129,6 @@ static uint32_t lba_offset;
 static int labelsoffset = LABELSECTOR;
 static int labeloffset = LABELOFFSET;
 static int bbsize = BBSIZE;
-static int alphacksum =
-#if defined(__alpha__)
-	1;
-#else
-	0;
-#endif
 
 enum	{
 	UNSPEC, EDIT, READ, RESTORE, WRITE, WRITEBOOT
@@ -176,12 +170,6 @@ main(int argc, char *argv[])
 					labelsoffset = 1;
 					labeloffset = 0;
 					bbsize = 8192;
-					alphacksum = 0;
-				} else if (!strcmp(optarg, "alpha")) {
-					labelsoffset = 0;
-					labeloffset = 64;
-					bbsize = 8192;
-					alphacksum = 1;
 				} else {
 					errx(1, "Unsupported architecture");
 				}
@@ -350,7 +338,6 @@ readboot(void)
 {
 	int fd;
 	struct stat st;
-	uint64_t *p;
 
 	if (xxboot == NULL)
 		xxboot = "/boot/boot";
@@ -358,20 +345,7 @@ readboot(void)
 	if (fd < 0)
 		err(1, "cannot open %s", xxboot);
 	fstat(fd, &st);
-	if (alphacksum && st.st_size <= BBSIZE - 512) {
-		if (read(fd, bootarea + 512, st.st_size) != st.st_size)
-			err(1, "read error %s", xxboot);
-
-		/*
-		 * Set the location and length so SRM can find the
-		 * boot blocks.
-		 */
-		p = (uint64_t *)bootarea;
-		p[60] = (st.st_size + secsize - 1) / secsize;
-		p[61] = 1;
-		p[62] = 0;
-		return;
-	} else if ((!alphacksum) && st.st_size <= BBSIZE) {
+	if (st.st_size <= BBSIZE) {
 		if (read(fd, bootarea, st.st_size) != st.st_size)
 			err(1, "read error %s", xxboot);
 		return;
@@ -405,7 +379,6 @@ geom_bsd_available(void)
 static int
 writelabel(void)
 {
-	uint64_t *p, sum;
 	int i, fd, serrno;
 	struct gctl_req *grq;
 	char const *errstr;
@@ -428,12 +401,6 @@ writelabel(void)
 			lab.d_partitions[i].p_offset += lba_offset;
 	bsd_disklabel_le_enc(bootarea + labeloffset + labelsoffset * secsize,
 	    lp);
-	if (alphacksum) {
-		/* Generate the bootblock checksum for the SRM console.  */
-		for (p = (uint64_t *)bootarea, i = 0, sum = 0; i < 63; i++)
-			sum += p[i];
-		p[63] = sum;
-	}
 
 	fd = open(specname, O_RDWR);
 	if (fd < 0) {
@@ -621,11 +588,11 @@ display(FILE *f, const struct disklabel 
 	}
 	fprintf(f, "%u partitions:\n", lp->d_npartitions);
 	fprintf(f,
-	    "#        size   offset    fstype   [fsize bsize bps/cpg]\n");
+	    "#          size     offset    fstype   [fsize bsize bps/cpg]\n");
 	pp = lp->d_partitions;
 	for (i = 0; i < lp->d_npartitions; i++, pp++) {
 		if (pp->p_size) {
-			fprintf(f, "  %c: %8lu %8lu  ", 'a' + i,
+			fprintf(f, "  %c: %10lu %10lu  ", 'a' + i,
 			   (u_long)pp->p_size, (u_long)pp->p_offset);
 			if (pp->p_fstype < FSMAXTYPES)
 				fprintf(f, "%8.8s", fstypenames[pp->p_fstype]);
@@ -634,13 +601,13 @@ display(FILE *f, const struct disklabel 
 			switch (pp->p_fstype) {
 
 			case FS_UNUSED:				/* XXX */
-				fprintf(f, "    %5lu %5lu %5.5s ",
+				fprintf(f, "    %5lu %5lu %2s",
 				    (u_long)pp->p_fsize,
 				    (u_long)(pp->p_fsize * pp->p_frag), "");
 				break;
 
 			case FS_BSDFFS:
-				fprintf(f, "    %5lu %5lu %5u ",
+				fprintf(f, "    %5lu %5lu %5u",
 				    (u_long)pp->p_fsize,
 				    (u_long)(pp->p_fsize * pp->p_frag),
 				    pp->p_cpg);

From owner-svn-src-stable-8@FreeBSD.ORG  Fri Apr  8 19:06:02 2011
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 577BE1065672;
	Fri,  8 Apr 2011 19:06:02 +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 2B2108FC16;
	Fri,  8 Apr 2011 19:06: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 p38J62t9089264;
	Fri, 8 Apr 2011 19:06:02 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p38J62v6089262;
	Fri, 8 Apr 2011 19:06:02 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <201104081906.p38J62v6089262@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Fri, 8 Apr 2011 19:06:02 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r220457 - stable/8/sys/dev/age
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Fri, 08 Apr 2011 19:06:02 -0000

Author: yongari
Date: Fri Apr  8 19:06:01 2011
New Revision: 220457
URL: http://svn.freebsd.org/changeset/base/220457

Log:
  MFC r220249,220252:
  r220249:
    64bit DMA caused data corruption. Unfortunately there is no known
    workaround to use 64bit DMA.
    Disable 64bit DMA on Attansic L1 controller.
  
    Tested by:	Yamagi Burmeister (lists <> yamagi dot org)
  
  r220252:
    Partially revert r184106. RX buffer ring also needs bus_dmamap_sync().
  
    Tested by:	Yamagi Burmeister (lists <> yamagi dot org)

Modified:
  stable/8/sys/dev/age/if_age.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/age/if_age.c
==============================================================================
--- stable/8/sys/dev/age/if_age.c	Fri Apr  8 18:48:57 2011	(r220456)
+++ stable/8/sys/dev/age/if_age.c	Fri Apr  8 19:06:01 2011	(r220457)
@@ -1092,11 +1092,14 @@ again:
 	 * Create Tx/Rx buffer parent tag.
 	 * L1 supports full 64bit DMA addressing in Tx/Rx buffers
 	 * so it needs separate parent DMA tag.
+	 * XXX
+	 * It seems enabling 64bit DMA causes data corruption. Limit
+	 * DMA address space to 32bit.
 	 */
 	error = bus_dma_tag_create(
 	    bus_get_dma_tag(sc->age_dev), /* parent */
 	    1, 0,			/* alignment, boundary */
-	    BUS_SPACE_MAXADDR,		/* lowaddr */
+	    BUS_SPACE_MAXADDR_32BIT,	/* lowaddr */
 	    BUS_SPACE_MAXADDR,		/* highaddr */
 	    NULL, NULL,			/* filter, filterarg */
 	    BUS_SPACE_MAXSIZE_32BIT,	/* maxsize */
@@ -2421,6 +2424,8 @@ age_rxintr(struct age_softc *sc, int rr_
 	bus_dmamap_sync(sc->age_cdata.age_rr_ring_tag,
 	    sc->age_cdata.age_rr_ring_map,
 	    BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);
+	bus_dmamap_sync(sc->age_cdata.age_rx_ring_tag,
+	    sc->age_cdata.age_rx_ring_map, BUS_DMASYNC_POSTWRITE);
 
 	for (prog = 0; rr_cons != rr_prod; prog++) {
 		if (count <= 0)
@@ -2452,6 +2457,8 @@ age_rxintr(struct age_softc *sc, int rr_
 		/* Update the consumer index. */
 		sc->age_cdata.age_rr_cons = rr_cons;
 
+		bus_dmamap_sync(sc->age_cdata.age_rx_ring_tag,
+		    sc->age_cdata.age_rx_ring_map, BUS_DMASYNC_PREWRITE);
 		/* Sync descriptors. */
 		bus_dmamap_sync(sc->age_cdata.age_rr_ring_tag,
 		    sc->age_cdata.age_rr_ring_map,
@@ -2978,8 +2985,7 @@ age_init_rx_ring(struct age_softc *sc)
 	}
 
 	bus_dmamap_sync(sc->age_cdata.age_rx_ring_tag,
-	    sc->age_cdata.age_rx_ring_map,
-	    BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
+	    sc->age_cdata.age_rx_ring_map, BUS_DMASYNC_PREWRITE);
 
 	return (0);
 }

From owner-svn-src-stable-8@FreeBSD.ORG  Sat Apr  9 08:29:07 2011
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CD625106566B;
	Sat,  9 Apr 2011 08:29:07 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A1E038FC15;
	Sat,  9 Apr 2011 08:29: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 p398T7jK006085;
	Sat, 9 Apr 2011 08:29:07 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p398T74P006082;
	Sat, 9 Apr 2011 08:29:07 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201104090829.p398T74P006082@svn.freebsd.org>
From: Andriy Gapon 
Date: Sat, 9 Apr 2011 08:29: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: r220466 - in stable/8/sys: amd64/linux32 i386/linux
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Sat, 09 Apr 2011 08:29:07 -0000

Author: avg
Date: Sat Apr  9 08:29:07 2011
New Revision: 220466
URL: http://svn.freebsd.org/changeset/base/220466

Log:
  MFC r220028: linux compat: add non-dummy capget and capset system calls
  
  PR:		kern/149168

Modified:
  stable/8/sys/amd64/linux32/syscalls.master
  stable/8/sys/i386/linux/syscalls.master
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/linux32/syscalls.master
==============================================================================
--- stable/8/sys/amd64/linux32/syscalls.master	Sat Apr  9 07:42:25 2011	(r220465)
+++ stable/8/sys/amd64/linux32/syscalls.master	Sat Apr  9 08:29:07 2011	(r220466)
@@ -326,8 +326,10 @@
 				    l_uid16_t uid, l_gid16_t gid); }
 183	AUE_GETCWD	STD	{ int linux_getcwd(char *buf, \
 				    l_ulong bufsize); }
-184	AUE_CAPGET	STD	{ int linux_capget(void); }
-185	AUE_CAPSET	STD	{ int linux_capset(void); }
+184	AUE_CAPGET	STD	{ int linux_capget(struct l_user_cap_header *hdrp, \
+				    struct l_user_cap_data *datap); }
+185	AUE_CAPSET	STD	{ int linux_capset(struct l_user_cap_header *hdrp, \
+				    struct l_user_cap_data *datap); }
 186	AUE_NULL	STD	{ int linux_sigaltstack(l_stack_t *uss, \
 				    l_stack_t *uoss); }
 187	AUE_SENDFILE	STD	{ int linux_sendfile(void); }

Modified: stable/8/sys/i386/linux/syscalls.master
==============================================================================
--- stable/8/sys/i386/linux/syscalls.master	Sat Apr  9 07:42:25 2011	(r220465)
+++ stable/8/sys/i386/linux/syscalls.master	Sat Apr  9 08:29:07 2011	(r220466)
@@ -328,8 +328,10 @@
 				    l_uid16_t uid, l_gid16_t gid); }
 183	AUE_GETCWD	STD	{ int linux_getcwd(char *buf, \
 				    l_ulong bufsize); }
-184	AUE_CAPGET	STD	{ int linux_capget(void); }
-185	AUE_CAPSET	STD	{ int linux_capset(void); }
+184	AUE_CAPGET	STD	{ int linux_capget(struct l_user_cap_header *hdrp, \
+				    struct l_user_cap_data *datap); }
+185	AUE_CAPSET	STD	{ int linux_capset(struct l_user_cap_header *hdrp, \
+				    struct l_user_cap_data *datap); }
 186	AUE_NULL	STD	{ int linux_sigaltstack(l_stack_t *uss, \
 				    l_stack_t *uoss); }
 187	AUE_SENDFILE	STD	{ int linux_sendfile(void); }

From owner-svn-src-stable-8@FreeBSD.ORG  Sat Apr  9 08:31:51 2011
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 22755106564A;
	Sat,  9 Apr 2011 08:31:51 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 107238FC0A;
	Sat,  9 Apr 2011 08:31: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 p398VoMT006175;
	Sat, 9 Apr 2011 08:31:50 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p398VoYL006168;
	Sat, 9 Apr 2011 08:31:50 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201104090831.p398VoYL006168@svn.freebsd.org>
From: Andriy Gapon 
Date: Sat, 9 Apr 2011 08:31:50 +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: r220467 - in stable/8/sys: amd64/linux32 i386/linux
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Sat, 09 Apr 2011 08:31:51 -0000

Author: avg
Date: Sat Apr  9 08:31:50 2011
New Revision: 220467
URL: http://svn.freebsd.org/changeset/base/220467

Log:
  Regen for r220466
  
  PR:		kern/149168

Modified:
  stable/8/sys/amd64/linux32/linux32_proto.h
  stable/8/sys/amd64/linux32/linux32_syscall.h
  stable/8/sys/amd64/linux32/linux32_sysent.c
  stable/8/sys/i386/linux/linux_proto.h
  stable/8/sys/i386/linux/linux_syscall.h
  stable/8/sys/i386/linux/linux_sysent.c

Modified: stable/8/sys/amd64/linux32/linux32_proto.h
==============================================================================
--- stable/8/sys/amd64/linux32/linux32_proto.h	Sat Apr  9 08:29:07 2011	(r220466)
+++ stable/8/sys/amd64/linux32/linux32_proto.h	Sat Apr  9 08:31:50 2011	(r220467)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: stable/8/sys/amd64/linux32/syscalls.master 219171 2011-03-02 06:23:19Z dchagin 
+ * created from FreeBSD: stable/8/sys/amd64/linux32/syscalls.master 220466 2011-04-09 08:29:07Z avg 
  */
 
 #ifndef _LINUX_SYSPROTO_H_
@@ -589,10 +589,12 @@ struct linux_getcwd_args {
 	char bufsize_l_[PADL_(l_ulong)]; l_ulong bufsize; char bufsize_r_[PADR_(l_ulong)];
 };
 struct linux_capget_args {
-	register_t dummy;
+	char hdrp_l_[PADL_(struct l_user_cap_header *)]; struct l_user_cap_header * hdrp; char hdrp_r_[PADR_(struct l_user_cap_header *)];
+	char datap_l_[PADL_(struct l_user_cap_data *)]; struct l_user_cap_data * datap; char datap_r_[PADR_(struct l_user_cap_data *)];
 };
 struct linux_capset_args {
-	register_t dummy;
+	char hdrp_l_[PADL_(struct l_user_cap_header *)]; struct l_user_cap_header * hdrp; char hdrp_r_[PADR_(struct l_user_cap_header *)];
+	char datap_l_[PADL_(struct l_user_cap_data *)]; struct l_user_cap_data * datap; char datap_r_[PADR_(struct l_user_cap_data *)];
 };
 struct linux_sigaltstack_args {
 	char uss_l_[PADL_(l_stack_t *)]; l_stack_t * uss; char uss_r_[PADR_(l_stack_t *)];

Modified: stable/8/sys/amd64/linux32/linux32_syscall.h
==============================================================================
--- stable/8/sys/amd64/linux32/linux32_syscall.h	Sat Apr  9 08:29:07 2011	(r220466)
+++ stable/8/sys/amd64/linux32/linux32_syscall.h	Sat Apr  9 08:31:50 2011	(r220467)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: stable/8/sys/amd64/linux32/syscalls.master 219171 2011-03-02 06:23:19Z dchagin 
+ * created from FreeBSD: stable/8/sys/amd64/linux32/syscalls.master 220466 2011-04-09 08:29:07Z avg 
  */
 
 #define	LINUX_SYS_exit	1

Modified: stable/8/sys/amd64/linux32/linux32_sysent.c
==============================================================================
--- stable/8/sys/amd64/linux32/linux32_sysent.c	Sat Apr  9 08:29:07 2011	(r220466)
+++ stable/8/sys/amd64/linux32/linux32_sysent.c	Sat Apr  9 08:31:50 2011	(r220467)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: stable/8/sys/amd64/linux32/syscalls.master 219171 2011-03-02 06:23:19Z dchagin 
+ * created from FreeBSD: stable/8/sys/amd64/linux32/syscalls.master 220466 2011-04-09 08:29:07Z avg 
  */
 
 #include "opt_compat.h"
@@ -203,8 +203,8 @@ struct sysent linux_sysent[] = {
 	{ AS(linux_pwrite_args), (sy_call_t *)linux_pwrite, AUE_PWRITE, NULL, 0, 0, 0 },	/* 181 = linux_pwrite */
 	{ AS(linux_chown16_args), (sy_call_t *)linux_chown16, AUE_CHOWN, NULL, 0, 0, 0 },	/* 182 = linux_chown16 */
 	{ AS(linux_getcwd_args), (sy_call_t *)linux_getcwd, AUE_GETCWD, NULL, 0, 0, 0 },	/* 183 = linux_getcwd */
-	{ 0, (sy_call_t *)linux_capget, AUE_CAPGET, NULL, 0, 0, 0 },	/* 184 = linux_capget */
-	{ 0, (sy_call_t *)linux_capset, AUE_CAPSET, NULL, 0, 0, 0 },	/* 185 = linux_capset */
+	{ AS(linux_capget_args), (sy_call_t *)linux_capget, AUE_CAPGET, NULL, 0, 0, 0 },	/* 184 = linux_capget */
+	{ AS(linux_capset_args), (sy_call_t *)linux_capset, AUE_CAPSET, NULL, 0, 0, 0 },	/* 185 = linux_capset */
 	{ AS(linux_sigaltstack_args), (sy_call_t *)linux_sigaltstack, AUE_NULL, NULL, 0, 0, 0 },	/* 186 = linux_sigaltstack */
 	{ 0, (sy_call_t *)linux_sendfile, AUE_SENDFILE, NULL, 0, 0, 0 },	/* 187 = linux_sendfile */
 	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 },			/* 188 = getpmsg */

Modified: stable/8/sys/i386/linux/linux_proto.h
==============================================================================
--- stable/8/sys/i386/linux/linux_proto.h	Sat Apr  9 08:29:07 2011	(r220466)
+++ stable/8/sys/i386/linux/linux_proto.h	Sat Apr  9 08:31:50 2011	(r220467)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: stable/8/sys/i386/linux/syscalls.master 219171 2011-03-02 06:23:19Z dchagin 
+ * created from FreeBSD: stable/8/sys/i386/linux/syscalls.master 220466 2011-04-09 08:29:07Z avg 
  */
 
 #ifndef _LINUX_SYSPROTO_H_
@@ -586,10 +586,12 @@ struct linux_getcwd_args {
 	char bufsize_l_[PADL_(l_ulong)]; l_ulong bufsize; char bufsize_r_[PADR_(l_ulong)];
 };
 struct linux_capget_args {
-	register_t dummy;
+	char hdrp_l_[PADL_(struct l_user_cap_header *)]; struct l_user_cap_header * hdrp; char hdrp_r_[PADR_(struct l_user_cap_header *)];
+	char datap_l_[PADL_(struct l_user_cap_data *)]; struct l_user_cap_data * datap; char datap_r_[PADR_(struct l_user_cap_data *)];
 };
 struct linux_capset_args {
-	register_t dummy;
+	char hdrp_l_[PADL_(struct l_user_cap_header *)]; struct l_user_cap_header * hdrp; char hdrp_r_[PADR_(struct l_user_cap_header *)];
+	char datap_l_[PADL_(struct l_user_cap_data *)]; struct l_user_cap_data * datap; char datap_r_[PADR_(struct l_user_cap_data *)];
 };
 struct linux_sigaltstack_args {
 	char uss_l_[PADL_(l_stack_t *)]; l_stack_t * uss; char uss_r_[PADR_(l_stack_t *)];

Modified: stable/8/sys/i386/linux/linux_syscall.h
==============================================================================
--- stable/8/sys/i386/linux/linux_syscall.h	Sat Apr  9 08:29:07 2011	(r220466)
+++ stable/8/sys/i386/linux/linux_syscall.h	Sat Apr  9 08:31:50 2011	(r220467)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: stable/8/sys/i386/linux/syscalls.master 219171 2011-03-02 06:23:19Z dchagin 
+ * created from FreeBSD: stable/8/sys/i386/linux/syscalls.master 220466 2011-04-09 08:29:07Z avg 
  */
 
 #define	LINUX_SYS_exit	1

Modified: stable/8/sys/i386/linux/linux_sysent.c
==============================================================================
--- stable/8/sys/i386/linux/linux_sysent.c	Sat Apr  9 08:29:07 2011	(r220466)
+++ stable/8/sys/i386/linux/linux_sysent.c	Sat Apr  9 08:31:50 2011	(r220467)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: stable/8/sys/i386/linux/syscalls.master 219171 2011-03-02 06:23:19Z dchagin 
+ * created from FreeBSD: stable/8/sys/i386/linux/syscalls.master 220466 2011-04-09 08:29:07Z avg 
  */
 
 #include 
@@ -202,8 +202,8 @@ struct sysent linux_sysent[] = {
 	{ AS(linux_pwrite_args), (sy_call_t *)linux_pwrite, AUE_PWRITE, NULL, 0, 0, 0 },	/* 181 = linux_pwrite */
 	{ AS(linux_chown16_args), (sy_call_t *)linux_chown16, AUE_CHOWN, NULL, 0, 0, 0 },	/* 182 = linux_chown16 */
 	{ AS(linux_getcwd_args), (sy_call_t *)linux_getcwd, AUE_GETCWD, NULL, 0, 0, 0 },	/* 183 = linux_getcwd */
-	{ 0, (sy_call_t *)linux_capget, AUE_CAPGET, NULL, 0, 0, 0 },	/* 184 = linux_capget */
-	{ 0, (sy_call_t *)linux_capset, AUE_CAPSET, NULL, 0, 0, 0 },	/* 185 = linux_capset */
+	{ AS(linux_capget_args), (sy_call_t *)linux_capget, AUE_CAPGET, NULL, 0, 0, 0 },	/* 184 = linux_capget */
+	{ AS(linux_capset_args), (sy_call_t *)linux_capset, AUE_CAPSET, NULL, 0, 0, 0 },	/* 185 = linux_capset */
 	{ AS(linux_sigaltstack_args), (sy_call_t *)linux_sigaltstack, AUE_NULL, NULL, 0, 0, 0 },	/* 186 = linux_sigaltstack */
 	{ 0, (sy_call_t *)linux_sendfile, AUE_SENDFILE, NULL, 0, 0, 0 },	/* 187 = linux_sendfile */
 	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 },			/* 188 = getpmsg */

From owner-svn-src-stable-8@FreeBSD.ORG  Sat Apr  9 08:43:57 2011
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A930F106564A;
	Sat,  9 Apr 2011 08:43:57 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 97EC88FC08;
	Sat,  9 Apr 2011 08:43: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 p398hvUk006459;
	Sat, 9 Apr 2011 08:43:57 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p398hvjC006456;
	Sat, 9 Apr 2011 08:43:57 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201104090843.p398hvjC006456@svn.freebsd.org>
From: Andriy Gapon 
Date: Sat, 9 Apr 2011 08:43: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: r220468 - in stable/8/sys: amd64/linux32 i386/linux
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Sat, 09 Apr 2011 08:43:57 -0000

Author: avg
Date: Sat Apr  9 08:43:57 2011
New Revision: 220468
URL: http://svn.freebsd.org/changeset/base/220468

Log:
  MFC r220030: drop dummy definitions
  
  PR:		kern/149168

Modified:
  stable/8/sys/amd64/linux32/linux32_dummy.c
  stable/8/sys/i386/linux/linux_dummy.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/linux32/linux32_dummy.c
==============================================================================
--- stable/8/sys/amd64/linux32/linux32_dummy.c	Sat Apr  9 08:31:50 2011	(r220467)
+++ stable/8/sys/amd64/linux32/linux32_dummy.c	Sat Apr  9 08:43:57 2011	(r220468)
@@ -54,8 +54,6 @@ DUMMY(sysfs);
 DUMMY(query_module);
 DUMMY(nfsservctl);
 DUMMY(rt_sigqueueinfo);
-DUMMY(capget);
-DUMMY(capset);
 DUMMY(sendfile);
 DUMMY(setfsuid);
 DUMMY(setfsgid);

Modified: stable/8/sys/i386/linux/linux_dummy.c
==============================================================================
--- stable/8/sys/i386/linux/linux_dummy.c	Sat Apr  9 08:31:50 2011	(r220467)
+++ stable/8/sys/i386/linux/linux_dummy.c	Sat Apr  9 08:43:57 2011	(r220468)
@@ -57,8 +57,6 @@ DUMMY(vm86);
 DUMMY(query_module);
 DUMMY(nfsservctl);
 DUMMY(rt_sigqueueinfo);
-DUMMY(capget);
-DUMMY(capset);
 DUMMY(sendfile);		/* different semantics */
 DUMMY(setfsuid);
 DUMMY(setfsgid);

From owner-svn-src-stable-8@FreeBSD.ORG  Sat Apr  9 08:52:22 2011
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id ADAF11065672;
	Sat,  9 Apr 2011 08:52:22 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 9BB068FC08;
	Sat,  9 Apr 2011 08: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 p398qMb4006718;
	Sat, 9 Apr 2011 08:52:22 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p398qMjl006713;
	Sat, 9 Apr 2011 08:52:22 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201104090852.p398qMjl006713@svn.freebsd.org>
From: Andriy Gapon 
Date: Sat, 9 Apr 2011 08:52: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: r220469 - stable/8/sys/compat/linux
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Sat, 09 Apr 2011 08:52:22 -0000

Author: avg
Date: Sat Apr  9 08:52:22 2011
New Revision: 220469
URL: http://svn.freebsd.org/changeset/base/220469

Log:
  MFC r220031: linux compat: improve and fix sendmsg/recvmsg compatibility
  
  PR:		kern/149168

Modified:
  stable/8/sys/compat/linux/linux_misc.c
  stable/8/sys/compat/linux/linux_misc.h
  stable/8/sys/compat/linux/linux_socket.c
  stable/8/sys/compat/linux/linux_socket.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/compat/linux/linux_misc.c
==============================================================================
--- stable/8/sys/compat/linux/linux_misc.c	Sat Apr  9 08:43:57 2011	(r220468)
+++ stable/8/sys/compat/linux/linux_misc.c	Sat Apr  9 08:52:22 2011	(r220469)
@@ -1679,6 +1679,100 @@ linux_exit_group(struct thread *td, stru
 	return (0);
 }
 
+#define _LINUX_CAPABILITY_VERSION  0x19980330
+
+struct l_user_cap_header {
+	l_int	version;
+	l_int	pid;
+};
+
+struct l_user_cap_data {
+	l_int	effective;
+	l_int	permitted;
+	l_int	inheritable;
+};
+
+int
+linux_capget(struct thread *td, struct linux_capget_args *args)
+{
+	struct l_user_cap_header luch;
+	struct l_user_cap_data lucd;
+	int error;
+
+	if (args->hdrp == NULL)
+		return (EFAULT);
+
+	error = copyin(args->hdrp, &luch, sizeof(luch));
+	if (error != 0)
+		return (error);
+
+	if (luch.version != _LINUX_CAPABILITY_VERSION) {
+		luch.version = _LINUX_CAPABILITY_VERSION;
+		error = copyout(&luch, args->hdrp, sizeof(luch));
+		if (error)
+			return (error);
+		return (EINVAL);
+	}
+
+	if (luch.pid)
+		return (EPERM);
+
+	if (args->datap) {
+		/*
+		 * The current implementation doesn't support setting
+		 * a capability (it's essentially a stub) so indicate
+		 * that no capabilities are currently set or available
+		 * to request.
+		 */
+		bzero (&lucd, sizeof(lucd));
+		error = copyout(&lucd, args->datap, sizeof(lucd));
+	}
+
+	return (error);
+}
+
+int
+linux_capset(struct thread *td, struct linux_capset_args *args)
+{
+	struct l_user_cap_header luch;
+	struct l_user_cap_data lucd;
+	int error;
+
+	if (args->hdrp == NULL || args->datap == NULL)
+		return (EFAULT);
+
+	error = copyin(args->hdrp, &luch, sizeof(luch));
+	if (error != 0)
+		return (error);
+
+	if (luch.version != _LINUX_CAPABILITY_VERSION) {
+		luch.version = _LINUX_CAPABILITY_VERSION;
+		error = copyout(&luch, args->hdrp, sizeof(luch));
+		if (error)
+			return (error);
+		return (EINVAL);
+	}
+
+	if (luch.pid)
+		return (EPERM);
+
+	error = copyin(args->datap, &lucd, sizeof(lucd));
+	if (error != 0)
+		return (error);
+
+	/* We currently don't support setting any capabilities. */
+	if (lucd.effective || lucd.permitted || lucd.inheritable) {
+		linux_msg(td,
+			  "capset effective=0x%x, permitted=0x%x, "
+			  "inheritable=0x%x is not implemented",
+			  (int)lucd.effective, (int)lucd.permitted,
+			  (int)lucd.inheritable);
+		return (EPERM);
+	}
+
+	return (0);
+}
+
 int
 linux_prctl(struct thread *td, struct linux_prctl_args *args)
 {
@@ -1712,6 +1806,21 @@ linux_prctl(struct thread *td, struct li
 		    (void *)(register_t)args->arg2,
 		    sizeof(pdeath_signal));
 		break;
+	case LINUX_PR_GET_KEEPCAPS:
+		/*
+		 * Indicate that we always clear the effective and
+		 * permitted capability sets when the user id becomes
+		 * non-zero (actually the capability sets are simply
+		 * always zero in the current implementation).
+		 */
+		td->td_retval[0] = 0;
+		break;
+	case LINUX_PR_SET_KEEPCAPS:
+		/*
+		 * Ignore requests to keep the effective and permitted
+		 * capability sets when the user id becomes non-zero.
+		 */
+		break;
 	case LINUX_PR_SET_NAME:
 		/*
 		 * To be on the safe side we need to make sure to not

Modified: stable/8/sys/compat/linux/linux_misc.h
==============================================================================
--- stable/8/sys/compat/linux/linux_misc.h	Sat Apr  9 08:43:57 2011	(r220468)
+++ stable/8/sys/compat/linux/linux_misc.h	Sat Apr  9 08:52:22 2011	(r220469)
@@ -37,6 +37,8 @@
 					 * Second arg is a ptr to return the
 					 * signal.
 					 */
+#define	LINUX_PR_GET_KEEPCAPS	7	/* Get drop capabilities on setuid */
+#define	LINUX_PR_SET_KEEPCAPS	8	/* Set drop capabilities on setuid */
 #define	LINUX_PR_SET_NAME	15	/* Set process name. */
 #define	LINUX_PR_GET_NAME	16	/* Get process name. */
 

Modified: stable/8/sys/compat/linux/linux_socket.c
==============================================================================
--- stable/8/sys/compat/linux/linux_socket.c	Sat Apr  9 08:43:57 2011	(r220468)
+++ stable/8/sys/compat/linux/linux_socket.c	Sat Apr  9 08:52:22 2011	(r220469)
@@ -433,6 +433,8 @@ linux_to_bsd_cmsg_type(int cmsg_type)
 	switch (cmsg_type) {
 	case LINUX_SCM_RIGHTS:
 		return (SCM_RIGHTS);
+	case LINUX_SCM_CREDENTIALS:
+		return (SCM_CREDS);
 	}
 	return (-1);
 }
@@ -444,6 +446,8 @@ bsd_to_linux_cmsg_type(int cmsg_type)
 	switch (cmsg_type) {
 	case SCM_RIGHTS:
 		return (LINUX_SCM_RIGHTS);
+	case SCM_CREDS:
+		return (LINUX_SCM_CREDENTIALS);
 	}
 	return (-1);
 }
@@ -459,7 +463,16 @@ linux_to_bsd_msghdr(struct msghdr *bhdr,
 	bhdr->msg_iov		= PTRIN(lhdr->msg_iov);
 	bhdr->msg_iovlen	= lhdr->msg_iovlen;
 	bhdr->msg_control	= PTRIN(lhdr->msg_control);
-	bhdr->msg_controllen	= lhdr->msg_controllen;
+
+	/*
+	 * msg_controllen is skipped since BSD and LINUX control messages
+	 * are potentially different sizes (e.g. the cred structure used
+	 * by SCM_CREDS is different between the two operating system).
+	 *
+	 * The caller can set it (if necessary) after converting all the
+	 * control messages.
+	 */
+
 	bhdr->msg_flags		= linux_to_bsd_msg_flags(lhdr->msg_flags);
 	return (0);
 }
@@ -472,7 +485,16 @@ bsd_to_linux_msghdr(const struct msghdr 
 	lhdr->msg_iov		= PTROUT(bhdr->msg_iov);
 	lhdr->msg_iovlen	= bhdr->msg_iovlen;
 	lhdr->msg_control	= PTROUT(bhdr->msg_control);
-	lhdr->msg_controllen	= bhdr->msg_controllen;
+
+	/*
+	 * msg_controllen is skipped since BSD and LINUX control messages
+	 * are potentially different sizes (e.g. the cred structure used
+	 * by SCM_CREDS is different between the two operating system).
+	 *
+	 * The caller can set it (if necessary) after converting all the
+	 * control messages.
+	 */
+
 	/* msg_flags skipped */
 	return (0);
 }
@@ -1092,6 +1114,7 @@ static int
 linux_sendmsg(struct thread *td, struct linux_sendmsg_args *args)
 {
 	struct cmsghdr *cmsg;
+	struct cmsgcred cmcred;
 	struct mbuf *control;
 	struct msghdr msg;
 	struct l_cmsghdr linux_cmsg;
@@ -1099,15 +1122,14 @@ linux_sendmsg(struct thread *td, struct 
 	struct l_msghdr linux_msg;
 	struct iovec *iov;
 	socklen_t datalen;
+	struct sockaddr *sa;
+	sa_family_t sa_family;
 	void *data;
 	int error;
 
 	error = copyin(PTRIN(args->msg), &linux_msg, sizeof(linux_msg));
 	if (error)
 		return (error);
-	error = linux_to_bsd_msghdr(&msg, &linux_msg);
-	if (error)
-		return (error);
 
 	/*
 	 * Some Linux applications (ping) define a non-NULL control data
@@ -1116,8 +1138,12 @@ linux_sendmsg(struct thread *td, struct 
 	 * order to handle this case.  This should be checked, but allows the
 	 * Linux ping to work.
 	 */
-	if (msg.msg_control != NULL && msg.msg_controllen == 0)
-		msg.msg_control = NULL;
+	if (PTRIN(linux_msg.msg_control) != NULL && linux_msg.msg_controllen == 0)
+		linux_msg.msg_control = PTROUT(NULL);
+
+	error = linux_to_bsd_msghdr(&msg, &linux_msg);
+	if (error)
+		return (error);
 
 #ifdef COMPAT_LINUX32
 	error = linux32_copyiniov(PTRIN(msg.msg_iov), msg.msg_iovlen,
@@ -1128,13 +1154,21 @@ linux_sendmsg(struct thread *td, struct 
 	if (error)
 		return (error);
 
-	if (msg.msg_control != NULL) {
+	control = NULL;
+	cmsg = NULL;
+
+	if ((ptr_cmsg = LINUX_CMSG_FIRSTHDR(&linux_msg)) != NULL) {
+		error = kern_getsockname(td, args->s, &sa, &datalen);
+		if (error)
+			goto bad;
+		sa_family = sa->sa_family;
+		free(sa, M_SONAME);
+
 		error = ENOBUFS;
 		cmsg = malloc(CMSG_HDRSZ, M_TEMP, M_WAITOK | M_ZERO);
 		control = m_get(M_WAIT, MT_CONTROL);
 		if (control == NULL)
 			goto bad;
-		ptr_cmsg = LINUX_CMSG_FIRSTHDR(&msg);
 
 		do {
 			error = copyin(ptr_cmsg, &linux_cmsg,
@@ -1147,28 +1181,58 @@ linux_sendmsg(struct thread *td, struct 
 				goto bad;
 
 			/*
-			 * Now we support only SCM_RIGHTS, so return EINVAL
-			 * in any other cmsg_type
+			 * Now we support only SCM_RIGHTS and SCM_CRED,
+			 * so return EINVAL in any other cmsg_type
 			 */
-			if ((cmsg->cmsg_type =
-			    linux_to_bsd_cmsg_type(linux_cmsg.cmsg_type)) == -1)
-				goto bad;
+			cmsg->cmsg_type =
+			    linux_to_bsd_cmsg_type(linux_cmsg.cmsg_type);
 			cmsg->cmsg_level =
 			    linux_to_bsd_sockopt_level(linux_cmsg.cmsg_level);
+			if (cmsg->cmsg_type == -1
+			    || cmsg->cmsg_level != SOL_SOCKET)
+				goto bad;
 
+			/*
+			 * Some applications (e.g. pulseaudio) attempt to
+			 * send ancillary data even if the underlying protocol
+			 * doesn't support it which is not allowed in the
+			 * FreeBSD system call interface.
+			 */
+			if (sa_family != AF_UNIX)
+				continue;
+
+			data = LINUX_CMSG_DATA(ptr_cmsg);
 			datalen = linux_cmsg.cmsg_len - L_CMSG_HDRSZ;
+
+			switch (cmsg->cmsg_type)
+			{
+			case SCM_RIGHTS:
+				break;
+
+			case SCM_CREDS:
+				data = &cmcred;
+				datalen = sizeof(cmcred);
+
+				/*
+				 * The lower levels will fill in the structure
+				 */
+				bzero(data, datalen);
+				break;
+			}
+
 			cmsg->cmsg_len = CMSG_LEN(datalen);
-			data = LINUX_CMSG_DATA(ptr_cmsg);
 
 			error = ENOBUFS;
 			if (!m_append(control, CMSG_HDRSZ, (c_caddr_t) cmsg))
 				goto bad;
 			if (!m_append(control, datalen, (c_caddr_t) data))
 				goto bad;
-		} while ((ptr_cmsg = LINUX_CMSG_NXTHDR(&msg, ptr_cmsg)));
-	} else {
-		control = NULL;
-		cmsg = NULL;
+		} while ((ptr_cmsg = LINUX_CMSG_NXTHDR(&linux_msg, ptr_cmsg)));
+
+		if (m_length(control, NULL) == 0) {
+			m_freem(control);
+			control = NULL;
+		}
 	}
 
 	msg.msg_iov = iov;
@@ -1193,9 +1257,11 @@ static int
 linux_recvmsg(struct thread *td, struct linux_recvmsg_args *args)
 {
 	struct cmsghdr *cm;
+	struct cmsgcred *cmcred;
 	struct msghdr msg;
 	struct l_cmsghdr *linux_cmsg = NULL;
-	socklen_t datalen, outlen, clen;
+	struct l_ucred linux_ucred;
+	socklen_t datalen, outlen;
 	struct l_msghdr linux_msg;
 	struct iovec *iov, *uiov;
 	struct mbuf *control = NULL;
@@ -1252,39 +1318,35 @@ linux_recvmsg(struct thread *td, struct 
 			goto bad;
 	}
 
-	if (control) {
+	outbuf = PTRIN(linux_msg.msg_control);
+	outlen = 0;
 
+	if (control) {
 		linux_cmsg = malloc(L_CMSG_HDRSZ, M_TEMP, M_WAITOK | M_ZERO);
-		outbuf = PTRIN(linux_msg.msg_control);
-		cm = mtod(control, struct cmsghdr *);
-		outlen = 0;
-		clen = control->m_len;
 
-		while (cm != NULL) {
+		msg.msg_control = mtod(control, struct cmsghdr *);
+		msg.msg_controllen = control->m_len;
+
+		cm = CMSG_FIRSTHDR(&msg);
 
-			if ((linux_cmsg->cmsg_type =
-			    bsd_to_linux_cmsg_type(cm->cmsg_type)) == -1)
+		while (cm != NULL) {
+			linux_cmsg->cmsg_type =
+			    bsd_to_linux_cmsg_type(cm->cmsg_type);
+			linux_cmsg->cmsg_level =
+			    bsd_to_linux_sockopt_level(cm->cmsg_level);
+			if (linux_cmsg->cmsg_type == -1
+			    || cm->cmsg_level != SOL_SOCKET)
 			{
 				error = EINVAL;
 				goto bad;
 			}
+
 			data = CMSG_DATA(cm);
 			datalen = (caddr_t)cm + cm->cmsg_len - (caddr_t)data;
 
-			switch (linux_cmsg->cmsg_type)
+			switch (cm->cmsg_type)
 			{
-			case LINUX_SCM_RIGHTS:
-				if (outlen + LINUX_CMSG_LEN(datalen) >
-				    linux_msg.msg_controllen) {
-					if (outlen == 0) {
-						error = EMSGSIZE;
-						goto bad;
-					} else {
-						linux_msg.msg_flags |=
-						    LINUX_MSG_CTRUNC;
-						goto out;
-					}
-				}
+			case SCM_RIGHTS:
 				if (args->flags & LINUX_MSG_CMSG_CLOEXEC) {
 					fds = datalen / sizeof(int);
 					fdp = data;
@@ -1295,11 +1357,40 @@ linux_recvmsg(struct thread *td, struct 
 					}
 				}
 				break;
+
+			case SCM_CREDS:
+				/*
+				 * Currently LOCAL_CREDS is never in
+				 * effect for Linux so no need to worry
+				 * about sockcred
+				 */
+				if (datalen != sizeof (*cmcred)) {
+					error = EMSGSIZE;
+					goto bad;
+				}
+				cmcred = (struct cmsgcred *)data;
+				bzero(&linux_ucred, sizeof(linux_ucred));
+				linux_ucred.pid = cmcred->cmcred_pid;
+				linux_ucred.uid = cmcred->cmcred_uid;
+				linux_ucred.gid = cmcred->cmcred_gid;
+				data = &linux_ucred;
+				datalen = sizeof(linux_ucred);
+				break;
+			}
+
+			if (outlen + LINUX_CMSG_LEN(datalen) >
+			    linux_msg.msg_controllen) {
+				if (outlen == 0) {
+					error = EMSGSIZE;
+					goto bad;
+				} else {
+					linux_msg.msg_flags |=
+					    LINUX_MSG_CTRUNC;
+					goto out;
+				}
 			}
 
 			linux_cmsg->cmsg_len = LINUX_CMSG_LEN(datalen);
-			linux_cmsg->cmsg_level =
-			    bsd_to_linux_sockopt_level(cm->cmsg_level);
 
 			error = copyout(linux_cmsg, outbuf, L_CMSG_HDRSZ);
 			if (error)
@@ -1312,18 +1403,13 @@ linux_recvmsg(struct thread *td, struct 
 
 			outbuf += LINUX_CMSG_ALIGN(datalen);
 			outlen += LINUX_CMSG_LEN(datalen);
-			linux_msg.msg_controllen = outlen;
 
-			if (CMSG_SPACE(datalen) < clen) {
-				clen -= CMSG_SPACE(datalen);
-				cm = (struct cmsghdr *)
-				    ((caddr_t)cm + CMSG_SPACE(datalen));
-			} else
-				cm = NULL;
+			cm = CMSG_NXTHDR(&msg, cm);
 		}
 	}
 
 out:
+	linux_msg.msg_controllen = outlen;
 	error = copyout(&linux_msg, PTRIN(args->msg), sizeof(linux_msg));
 
 bad:

Modified: stable/8/sys/compat/linux/linux_socket.h
==============================================================================
--- stable/8/sys/compat/linux/linux_socket.h	Sat Apr  9 08:43:57 2011	(r220468)
+++ stable/8/sys/compat/linux/linux_socket.h	Sat Apr  9 08:52:22 2011	(r220469)
@@ -53,6 +53,7 @@
 /* Socket-level control message types */
 
 #define LINUX_SCM_RIGHTS	0x01
+#define LINUX_SCM_CREDENTIALS   0x02
 
 /* Ancilliary data object information macros */
 
@@ -66,13 +67,14 @@
 #define LINUX_CMSG_FIRSTHDR(msg) \
 				((msg)->msg_controllen >= \
 				    sizeof(struct l_cmsghdr) ? \
-				    (struct l_cmsghdr *)((msg)->msg_control) : \
+				    (struct l_cmsghdr *) \
+				        PTRIN((msg)->msg_control) : \
 				    (struct l_cmsghdr *)(NULL))
 #define LINUX_CMSG_NXTHDR(msg, cmsg) \
 				((((char *)(cmsg) + \
 				    LINUX_CMSG_ALIGN((cmsg)->cmsg_len) + \
 				    sizeof(*(cmsg))) > \
-				    (((char *)(msg)->msg_control) + \
+				    (((char *)PTRIN((msg)->msg_control)) + \
 				    (msg)->msg_controllen)) ? \
 				    (struct l_cmsghdr *) NULL : \
 				    (struct l_cmsghdr *)((char *)(cmsg) + \

From owner-svn-src-stable-8@FreeBSD.ORG  Sat Apr  9 10:19:26 2011
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 89862106566C;
	Sat,  9 Apr 2011 10:19:26 +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 765FC8FC17;
	Sat,  9 Apr 2011 10: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 p39AJQ95008819;
	Sat, 9 Apr 2011 10:19:26 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p39AJQ82008817;
	Sat, 9 Apr 2011 10:19:26 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <201104091019.p39AJQ82008817@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Sat, 9 Apr 2011 10:19:26 +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: r220476 - stable/8/usr.sbin/rtadvd
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Sat, 09 Apr 2011 10:19:26 -0000

Author: bz
Date: Sat Apr  9 10:19:25 2011
New Revision: 220476
URL: http://svn.freebsd.org/changeset/base/220476

Log:
  MFC r219184:
  
    Prevent crashes from a race when (cloned) interfaces go away.
  
  PR:             bin/152143
    Submitted by: Przemyslaw Frasunek (przemyslaw frasunek.com)
    Tested by:    Przemyslaw Frasunek (przemyslaw frasunek.com)

Modified:
  stable/8/usr.sbin/rtadvd/rtadvd.c
Directory Properties:
  stable/8/usr.sbin/rtadvd/   (props changed)

Modified: stable/8/usr.sbin/rtadvd/rtadvd.c
==============================================================================
--- stable/8/usr.sbin/rtadvd/rtadvd.c	Sat Apr  9 10:18:46 2011	(r220475)
+++ stable/8/usr.sbin/rtadvd/rtadvd.c	Sat Apr  9 10:19:25 2011	(r220476)
@@ -667,14 +667,16 @@ rtadvd_input()
 	}
 
 	/*
-	 * If we happen to receive data on an interface which is now down,
-	 * just discard the data.
+	 * If we happen to receive data on an interface which is now gone
+	 * or down, just discard the data.
 	 */
-	if ((iflist[pi->ipi6_ifindex]->ifm_flags & IFF_UP) == 0) {
+	if (iflist[pi->ipi6_ifindex] == NULL ||
+	    (iflist[pi->ipi6_ifindex]->ifm_flags & IFF_UP) == 0) {
 		syslog(LOG_INFO,
 		       "<%s> received data on a disabled interface (%s)",
 		       __func__,
-		       if_indextoname(pi->ipi6_ifindex, ifnamebuf));
+		       (iflist[pi->ipi6_ifindex] == NULL) ? "[gone]" :
+			    if_indextoname(pi->ipi6_ifindex, ifnamebuf));
 		return;
 	}
 

From owner-svn-src-stable-8@FreeBSD.ORG  Sat Apr  9 10:36:33 2011
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C39D2106566B;
	Sat,  9 Apr 2011 10:36:33 +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 B062B8FC12;
	Sat,  9 Apr 2011 10:36: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 p39AaX4G010830;
	Sat, 9 Apr 2011 10:36:33 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p39AaX8G010827;
	Sat, 9 Apr 2011 10:36:33 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <201104091036.p39AaX8G010827@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Sat, 9 Apr 2011 10:36:33 +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: r220478 - stable/8/sys/net
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Sat, 09 Apr 2011 10:36:34 -0000

Author: bz
Date: Sat Apr  9 10:36:33 2011
New Revision: 220478
URL: http://svn.freebsd.org/changeset/base/220478

Log:
  MFC r219206:
  
    Hide the outer IP addresses of a tunnel interfaces (gif(4), gre(4))
    from processes inside jails if the addresses do not belong to the jail.
  
    Originally reported by: Pieter de Boer via remko
    Tested by:	Piotr KUCHARSKI (nospam 42.pl) [gif]
  PR:		kern/151119

Modified:
  stable/8/sys/net/if_gif.c
  stable/8/sys/net/if_gre.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/net/if_gif.c
==============================================================================
--- stable/8/sys/net/if_gif.c	Sat Apr  9 10:22:18 2011	(r220477)
+++ stable/8/sys/net/if_gif.c	Sat Apr  9 10:36:33 2011	(r220478)
@@ -35,6 +35,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -817,6 +818,12 @@ gif_ioctl(ifp, cmd, data)
 		}
 		if (src->sa_len > size)
 			return EINVAL;
+		error = prison_if(curthread->td_ucred, src);
+		if (error != 0)
+			return (error);
+		error = prison_if(curthread->td_ucred, dst);
+		if (error != 0)
+			return (error);
 		bcopy((caddr_t)src, (caddr_t)dst, src->sa_len);
 #ifdef INET6
 		if (dst->sa_family == AF_INET6) {

Modified: stable/8/sys/net/if_gre.c
==============================================================================
--- stable/8/sys/net/if_gre.c	Sat Apr  9 10:22:18 2011	(r220477)
+++ stable/8/sys/net/if_gre.c	Sat Apr  9 10:36:33 2011	(r220478)
@@ -53,6 +53,7 @@
 #include "opt_inet6.h"
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -643,6 +644,9 @@ gre_ioctl(struct ifnet *ifp, u_long cmd,
 		si.sin_len = sizeof(struct sockaddr_in);
 		si.sin_addr.s_addr = sc->g_src.s_addr;
 		sa = sintosa(&si);
+		error = prison_if(curthread->td_ucred, sa);
+		if (error != 0)
+			break;
 		ifr->ifr_addr = *sa;
 		break;
 	case GREGADDRD:
@@ -651,6 +655,9 @@ gre_ioctl(struct ifnet *ifp, u_long cmd,
 		si.sin_len = sizeof(struct sockaddr_in);
 		si.sin_addr.s_addr = sc->g_dst.s_addr;
 		sa = sintosa(&si);
+		error = prison_if(curthread->td_ucred, sa);
+		if (error != 0)
+			break;
 		ifr->ifr_addr = *sa;
 		break;
 	case SIOCSIFPHYADDR:
@@ -714,8 +721,14 @@ gre_ioctl(struct ifnet *ifp, u_long cmd,
 		si.sin_family = AF_INET;
 		si.sin_len = sizeof(struct sockaddr_in);
 		si.sin_addr.s_addr = sc->g_src.s_addr;
+		error = prison_if(curthread->td_ucred, (struct sockaddr *)&si);
+		if (error != 0)
+			break;
 		memcpy(&lifr->addr, &si, sizeof(si));
 		si.sin_addr.s_addr = sc->g_dst.s_addr;
+		error = prison_if(curthread->td_ucred, (struct sockaddr *)&si);
+		if (error != 0)
+			break;
 		memcpy(&lifr->dstaddr, &si, sizeof(si));
 		break;
 	case SIOCGIFPSRCADDR:
@@ -730,6 +743,9 @@ gre_ioctl(struct ifnet *ifp, u_long cmd,
 		si.sin_family = AF_INET;
 		si.sin_len = sizeof(struct sockaddr_in);
 		si.sin_addr.s_addr = sc->g_src.s_addr;
+		error = prison_if(curthread->td_ucred, (struct sockaddr *)&si);
+		if (error != 0)
+			break;
 		bcopy(&si, &ifr->ifr_addr, sizeof(ifr->ifr_addr));
 		break;
 	case SIOCGIFPDSTADDR:
@@ -744,6 +760,9 @@ gre_ioctl(struct ifnet *ifp, u_long cmd,
 		si.sin_family = AF_INET;
 		si.sin_len = sizeof(struct sockaddr_in);
 		si.sin_addr.s_addr = sc->g_dst.s_addr;
+		error = prison_if(curthread->td_ucred, (struct sockaddr *)&si);
+		if (error != 0)
+			break;
 		bcopy(&si, &ifr->ifr_addr, sizeof(ifr->ifr_addr));
 		break;
 	case GRESKEY:

From owner-svn-src-stable-8@FreeBSD.ORG  Sat Apr  9 10:44:01 2011
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C3580106566B;
	Sat,  9 Apr 2011 10:44:01 +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 AD3818FC0C;
	Sat,  9 Apr 2011 10:44: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 p39Ai1lx011080;
	Sat, 9 Apr 2011 10:44:01 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p39Ai1g0011078;
	Sat, 9 Apr 2011 10:44:01 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <201104091044.p39Ai1g0011078@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Sat, 9 Apr 2011 10:44:01 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r220480 - stable/8/sys/conf
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Sat, 09 Apr 2011 10:44:01 -0000

Author: bz
Date: Sat Apr  9 10:44:01 2011
New Revision: 220480
URL: http://svn.freebsd.org/changeset/base/220480

Log:
  MFC r219580:
  
    INET6 for some time needed in_pcb.c so make sure we compile it in case of
    no inet.

Modified:
  stable/8/sys/conf/files
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	Sat Apr  9 10:40:17 2011	(r220479)
+++ stable/8/sys/conf/files	Sat Apr  9 10:44:01 2011	(r220480)
@@ -2535,7 +2535,7 @@ netinet/in_gif.c		optional gif inet | ne
 netinet/ip_gre.c		optional gre inet
 netinet/ip_id.c			optional inet
 netinet/in_mcast.c		optional inet
-netinet/in_pcb.c		optional inet
+netinet/in_pcb.c		optional inet | inet6
 netinet/in_proto.c		optional inet \
 	compile-with "${NORMAL_C} -I$S/contrib/pf"
 netinet/in_rmx.c		optional inet

From owner-svn-src-stable-8@FreeBSD.ORG  Sat Apr  9 10:45:22 2011
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AD4111065686;
	Sat,  9 Apr 2011 10:45:22 +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 9A72A8FC15;
	Sat,  9 Apr 2011 10:45: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 p39AjMAH011196;
	Sat, 9 Apr 2011 10:45:22 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p39AjMv1011194;
	Sat, 9 Apr 2011 10:45:22 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <201104091045.p39AjMv1011194@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Sat, 9 Apr 2011 10:45: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: r220482 - stable/8/share/man/man4
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Sat, 09 Apr 2011 10:45:22 -0000

Author: bz
Date: Sat Apr  9 10:45:22 2011
New Revision: 220482
URL: http://svn.freebsd.org/changeset/base/220482

Log:
  MFC r219597:
  
    Cross-reference ip(4) rather than sysctl(8) for the global, shared MIB
    values to control the various port ranges. ip(4) describes these in detail.

Modified:
  stable/8/share/man/man4/ip6.4
Directory Properties:
  stable/8/share/man/man4/   (props changed)

Modified: stable/8/share/man/man4/ip6.4
==============================================================================
--- stable/8/share/man/man4/ip6.4	Sat Apr  9 10:44:53 2011	(r220481)
+++ stable/8/share/man/man4/ip6.4	Sat Apr  9 10:45:22 2011	(r220482)
@@ -30,7 +30,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd February 21, 2008
+.Dd March 13, 2011
 .Dt IP6 4
 .Os
 .Sh NAME
@@ -232,12 +232,13 @@ The following values are available:
 .Bl -tag -width IPV6_PORTRANGE_DEFAULT -compact
 .It Dv IPV6_PORTRANGE_DEFAULT
 Use the regular range of non-reserved ports (varies, see
-.Xr sysctl 8 ) .
+.Xr ip 4 ) .
 .It Dv IPV6_PORTRANGE_HIGH
 Use a high range (varies, see
-.Xr sysctl 8 ) .
+.Xr ip 4 ) .
 .It Dv IPV6_PORTRANGE_LOW
-Use a low, reserved range (600\-1023).
+Use a low, reserved range (600\-1023, see
+.Xr ip 4 ) .
 .El
 .It Dv IPV6_PKTINFO Fa "int *"
 Get or set whether additional information about subsequent packets will
@@ -655,6 +656,7 @@ An ancillary data object was improperly 
 .Xr if_nametoindex 3 ,
 .Xr bpf 4 ,
 .Xr icmp6 4 ,
+.Xr ip 4 ,
 .Xr inet6 4 ,
 .Xr netintro 4 ,
 .Xr tcp 4 ,

From owner-svn-src-stable-8@FreeBSD.ORG  Sat Apr  9 10:53:36 2011
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6F47A106564A;
	Sat,  9 Apr 2011 10:53:36 +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 5C4CC8FC0C;
	Sat,  9 Apr 2011 10:53: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 p39AraDp011439;
	Sat, 9 Apr 2011 10:53:36 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p39AraT5011437;
	Sat, 9 Apr 2011 10:53:36 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <201104091053.p39AraT5011437@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Sat, 9 Apr 2011 10:53: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: r220483 - stable/8/sys/netipsec
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Sat, 09 Apr 2011 10:53:36 -0000

Author: bz
Date: Sat Apr  9 10:53:36 2011
New Revision: 220483
URL: http://svn.freebsd.org/changeset/base/220483

Log:
  MFC r220247:
  
    Do not allow directly recursive RFC3173 IPComp payload.
  
  Security:	CVE-2011-1547

Modified:
  stable/8/sys/netipsec/xform_ipcomp.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/netipsec/xform_ipcomp.c
==============================================================================
--- stable/8/sys/netipsec/xform_ipcomp.c	Sat Apr  9 10:45:22 2011	(r220482)
+++ stable/8/sys/netipsec/xform_ipcomp.c	Sat Apr  9 10:53:36 2011	(r220483)
@@ -141,8 +141,29 @@ ipcomp_input(struct mbuf *m, struct seca
 	struct tdb_crypto *tc;
 	struct cryptodesc *crdc;
 	struct cryptop *crp;
+	struct ipcomp *ipcomp;
+	caddr_t addr;
 	int hlen = IPCOMP_HLENGTH;
 
+	/*
+	 * Check that the next header of the IPComp is not IPComp again, before
+	 * doing any real work.  Given it is not possible to do double
+	 * compression it means someone is playing tricks on us.
+	 */
+	if (m->m_len < skip + hlen && (m = m_pullup(m, skip + hlen)) == NULL) {
+		V_ipcompstat.ipcomps_hdrops++;		/*XXX*/
+		DPRINTF(("%s: m_pullup failed\n", __func__));
+		return (ENOBUFS);
+	}
+	addr = (caddr_t) mtod(m, struct ip *) + skip;
+	ipcomp = (struct ipcomp *)addr;
+	if (ipcomp->comp_nxt == IPPROTO_IPCOMP) {
+		m_freem(m);
+		V_ipcompstat.ipcomps_pdrops++;	/* XXX have our own stats? */
+		DPRINTF(("%s: recursive compression detected\n", __func__));
+		return (EINVAL);
+	}
+
 	/* Get crypto descriptors */
 	crp = crypto_getreq(1);
 	if (crp == NULL) {

From owner-svn-src-stable-8@FreeBSD.ORG  Sat Apr  9 12:04:35 2011
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6B4DC106567C;
	Sat,  9 Apr 2011 12:04:35 +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 565378FC0C;
	Sat,  9 Apr 2011 12:04: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 p39C4Z58013156;
	Sat, 9 Apr 2011 12:04:35 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p39C4Z3k013151;
	Sat, 9 Apr 2011 12:04:35 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <201104091204.p39C4Z3k013151@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Sat, 9 Apr 2011 12:04:35 +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: r220486 - in stable/8/sys: amd64/conf i386/conf
	ia64/conf mips/conf
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Sat, 09 Apr 2011 12:04:35 -0000

Author: bz
Date: Sat Apr  9 12:04:35 2011
New Revision: 220486
URL: http://svn.freebsd.org/changeset/base/220486

Log:
  MFC r219775:
  
    For now remove options FLOWTABLE from the remaining GENERIC kernel
    configurations and make it opt-in for those who want it.  LINT will
    still build it.
  
    While it may be a perfect win in some scenarios, it still troubles users
    (see PRs) in general cases.  In addition we are still allocating resources
    even if disabled by sysctl and still leak arp/nd6 entries in case of
    interface destruction.
  
    Discussed with:	qingli (2010-11-24, just never executed)
    Discussed with:	juli (OCTEON1)
  PR:			kern/148018, kern/155604, kern/144917, kern/146792

Modified:
  stable/8/sys/amd64/conf/GENERIC
  stable/8/sys/i386/conf/GENERIC
  stable/8/sys/ia64/conf/GENERIC
  stable/8/sys/mips/conf/OCTEON1
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/conf/GENERIC
==============================================================================
--- stable/8/sys/amd64/conf/GENERIC	Sat Apr  9 11:03:04 2011	(r220485)
+++ stable/8/sys/amd64/conf/GENERIC	Sat Apr  9 12:04:35 2011	(r220486)
@@ -72,7 +72,6 @@ options 	KBD_INSTALL_CDEV	# install a CD
 options 	HWPMC_HOOKS		# Necessary kernel hooks for hwpmc(4)
 options 	AUDIT			# Security event auditing
 options 	MAC			# TrustedBSD MAC Framework
-options 	FLOWTABLE		# per-cpu routing cache
 #options 	KDTRACE_FRAME		# Ensure frames are compiled in
 #options 	KDTRACE_HOOKS		# Kernel DTrace hooks
 options 	INCLUDE_CONFIG_FILE     # Include this file in kernel

Modified: stable/8/sys/i386/conf/GENERIC
==============================================================================
--- stable/8/sys/i386/conf/GENERIC	Sat Apr  9 11:03:04 2011	(r220485)
+++ stable/8/sys/i386/conf/GENERIC	Sat Apr  9 12:04:35 2011	(r220486)
@@ -73,7 +73,6 @@ options 	KBD_INSTALL_CDEV	# install a CD
 options 	HWPMC_HOOKS		# Necessary kernel hooks for hwpmc(4)
 options 	AUDIT			# Security event auditing
 options 	MAC			# TrustedBSD MAC Framework
-options 	FLOWTABLE		# per-cpu routing cache
 #options 	KDTRACE_HOOKS		# Kernel DTrace hooks
 options 	INCLUDE_CONFIG_FILE     # Include this file in kernel
 

Modified: stable/8/sys/ia64/conf/GENERIC
==============================================================================
--- stable/8/sys/ia64/conf/GENERIC	Sat Apr  9 11:03:04 2011	(r220485)
+++ stable/8/sys/ia64/conf/GENERIC	Sat Apr  9 12:04:35 2011	(r220486)
@@ -31,7 +31,6 @@ options 	COMPAT_43TTY	# BSD 4.3 TTY comp
 options 	COMPAT_FREEBSD6	# Compatible with FreeBSD6
 options 	COMPAT_FREEBSD7	# Compatible with FreeBSD7
 options 	FFS		# Berkeley Fast Filesystem
-options 	FLOWTABLE	# per-cpu routing cache
 options 	GDB		# Support remote GDB
 options 	GEOM_LABEL	# Provides labelization
 options 	INCLUDE_CONFIG_FILE     # Include this file in kernel

Modified: stable/8/sys/mips/conf/OCTEON1
==============================================================================
--- stable/8/sys/mips/conf/OCTEON1	Sat Apr  9 11:03:04 2011	(r220485)
+++ stable/8/sys/mips/conf/OCTEON1	Sat Apr  9 12:04:35 2011	(r220486)
@@ -76,7 +76,6 @@ options 	PRINTF_BUFR_SIZE=128	# Prevent 
 options 	HWPMC_HOOKS		# Necessary kernel hooks for hwpmc(4)
 options 	AUDIT			# Security event auditing
 options 	MAC			# TrustedBSD MAC Framework
-options 	FLOWTABLE		# per-cpu routing cache
 #options 	KDTRACE_FRAME		# Ensure frames are compiled in
 #options 	KDTRACE_HOOKS		# Kernel DTrace hooks
 options 	INCLUDE_CONFIG_FILE     # Include this file in kernel

From owner-svn-src-stable-8@FreeBSD.ORG  Sat Apr  9 12:11:19 2011
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9F1D1106566B;
	Sat,  9 Apr 2011 12:11:19 +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 8118C8FC20;
	Sat,  9 Apr 2011 12:11: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 p39CBJQq013346;
	Sat, 9 Apr 2011 12:11:19 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p39CBJLB013344;
	Sat, 9 Apr 2011 12:11:19 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <201104091211.p39CBJLB013344@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Sat, 9 Apr 2011 12:11: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: r220487 - stable/8/sys/netinet6
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Sat, 09 Apr 2011 12:11:19 -0000

Author: bz
Date: Sat Apr  9 12:11:19 2011
New Revision: 220487
URL: http://svn.freebsd.org/changeset/base/220487

Log:
  MFC r219562:
  
    Make sure the locally cached value of rt->rt_gateway stays stable,
    even after dropping the reference and unlocking. Previously we
    have dereferenced a NULL pointer (after r121765).
    Simply unlocking after the block does not work either because of
    lock ordering (see r121765) and in addition we would still hold
    a pointer to something that might be gone by the time we access it.
    Thus take a copy of the value rather than just caching the pointer.
  
    Submitted by:	chenyl (netstar2008 126.com) (initial version)
  PR:		kern/151908

Modified:
  stable/8/sys/netinet6/nd6_nbr.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/netinet6/nd6_nbr.c
==============================================================================
--- stable/8/sys/netinet6/nd6_nbr.c	Sat Apr  9 12:04:35 2011	(r220486)
+++ stable/8/sys/netinet6/nd6_nbr.c	Sat Apr  9 12:11:19 2011	(r220487)
@@ -112,7 +112,7 @@ nd6_ns_input(struct mbuf *m, int off, in
 	int anycast = 0, proxy = 0, tentative = 0;
 	int tlladdr;
 	union nd_opts ndopts;
-	struct sockaddr_dl *proxydl = NULL;
+	struct sockaddr_dl proxydl;
 	char ip6bufs[INET6_ADDRSTRLEN], ip6bufd[INET6_ADDRSTRLEN];
 
 #ifndef PULLDOWN_TEST
@@ -247,18 +247,25 @@ nd6_ns_input(struct mbuf *m, int off, in
 #endif
 		need_proxy = (rt && (rt->rt_flags & RTF_ANNOUNCE) != 0 &&
 		    rt->rt_gateway->sa_family == AF_LINK);
-		if (rt)
+		if (rt != NULL) {
+			/*
+			 * Make a copy while we can be sure that rt_gateway
+			 * is still stable before unlocking to avoid lock
+			 * order problems.  proxydl will only be used if
+			 * proxy will be set in the next block.
+			 */
+			if (need_proxy)
+				proxydl = *SDL(rt->rt_gateway);
 			RTFREE_LOCKED(rt);
+		}
 		if (need_proxy) {
 			/*
 			 * proxy NDP for single entry
 			 */
 			ifa = (struct ifaddr *)in6ifa_ifpforlinklocal(ifp,
 				IN6_IFF_NOTREADY|IN6_IFF_ANYCAST);
-			if (ifa) {
+			if (ifa)
 				proxy = 1;
-				proxydl = SDL(rt->rt_gateway);
-			}
 		}
 	}
 	if (ifa == NULL) {
@@ -332,7 +339,7 @@ nd6_ns_input(struct mbuf *m, int off, in
 		nd6_na_output(ifp, &in6_all, &taddr6,
 		    ((anycast || proxy || !tlladdr) ? 0 : ND_NA_FLAG_OVERRIDE) |
 		    (V_ip6_forwarding ? ND_NA_FLAG_ROUTER : 0),
-		    tlladdr, (struct sockaddr *)proxydl);
+		    tlladdr, (struct sockaddr *)&proxydl);
 		goto freeit;
 	}
 
@@ -342,7 +349,7 @@ nd6_ns_input(struct mbuf *m, int off, in
 	nd6_na_output(ifp, &saddr6, &taddr6,
 	    ((anycast || proxy || !tlladdr) ? 0 : ND_NA_FLAG_OVERRIDE) |
 	    (V_ip6_forwarding ? ND_NA_FLAG_ROUTER : 0) | ND_NA_FLAG_SOLICITED,
-	    tlladdr, (struct sockaddr *)proxydl);
+	    tlladdr, (struct sockaddr *)&proxydl);
  freeit:
 	if (ifa != NULL)
 		ifa_free(ifa);

From owner-svn-src-stable-8@FreeBSD.ORG  Sat Apr  9 12:35:08 2011
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 95EBB106564A;
	Sat,  9 Apr 2011 12:35:08 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 6782E8FC16;
	Sat,  9 Apr 2011 12: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 p39CZ8tO013972;
	Sat, 9 Apr 2011 12:35:08 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p39CZ8qI013968;
	Sat, 9 Apr 2011 12:35:08 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <201104091235.p39CZ8qI013968@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Sat, 9 Apr 2011 12:35: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: r220489 - stable/8/sys/netinet6
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Sat, 09 Apr 2011 12:35:08 -0000

Author: bz
Date: Sat Apr  9 12:35:08 2011
New Revision: 220489
URL: http://svn.freebsd.org/changeset/base/220489

Log:
  MFC r219570:
  
    Push a possible "unbind" in some situation from in6_pcbsetport() to
    callers.  This also fixes a problem when the prison call could set
    the inp->in6p_laddr (laddr) and a following priv_check_cred() call
    would return an error and will allow us to merge the IPv4 and IPv6
    implementation.

Modified:
  stable/8/sys/netinet6/in6_pcb.c
  stable/8/sys/netinet6/in6_src.c
  stable/8/sys/netinet6/udp6_usrreq.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/netinet6/in6_pcb.c
==============================================================================
--- stable/8/sys/netinet6/in6_pcb.c	Sat Apr  9 12:15:40 2011	(r220488)
+++ stable/8/sys/netinet6/in6_pcb.c	Sat Apr  9 12:35:08 2011	(r220489)
@@ -258,8 +258,11 @@ in6_pcbbind(register struct inpcb *inp, 
 		inp->in6p_laddr = sin6->sin6_addr;
 	}
 	if (lport == 0) {
-		if ((error = in6_pcbsetport(&inp->in6p_laddr, inp, cred)) != 0)
+		if ((error = in6_pcbsetport(&inp->in6p_laddr, inp, cred)) != 0) {
+			/* Undo an address bind that may have occurred. */
+			inp->in6p_laddr = in6addr_any;
 			return (error);
+		}
 	} else {
 		inp->inp_lport = lport;
 		if (in_pcbinshash(inp) != 0) {

Modified: stable/8/sys/netinet6/in6_src.c
==============================================================================
--- stable/8/sys/netinet6/in6_src.c	Sat Apr  9 12:15:40 2011	(r220488)
+++ stable/8/sys/netinet6/in6_src.c	Sat Apr  9 12:35:08 2011	(r220489)
@@ -925,11 +925,8 @@ in6_pcbsetport(struct in6_addr *laddr, s
 	count = last - first;
 
 	do {
-		if (count-- < 0) {	/* completely used? */
-			/* Undo an address bind that may have occurred. */
-			inp->in6p_laddr = in6addr_any;
+		if (count-- < 0)	/* completely used? */
 			return (EADDRNOTAVAIL);
-		}
 		++*lastport;
 		if (*lastport < first || *lastport > last)
 			*lastport = first;

Modified: stable/8/sys/netinet6/udp6_usrreq.c
==============================================================================
--- stable/8/sys/netinet6/udp6_usrreq.c	Sat Apr  9 12:15:40 2011	(r220488)
+++ stable/8/sys/netinet6/udp6_usrreq.c	Sat Apr  9 12:35:08 2011	(r220489)
@@ -656,8 +656,11 @@ udp6_output(struct inpcb *inp, struct mb
 			goto release;
 		}
 		if (inp->inp_lport == 0 &&
-		    (error = in6_pcbsetport(laddr, inp, td->td_ucred)) != 0)
+		    (error = in6_pcbsetport(laddr, inp, td->td_ucred)) != 0) {
+			/* Undo an address bind that may have occurred. */
+			inp->in6p_laddr = in6addr_any;
 			goto release;
+		}
 	} else {
 		if (IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_faddr)) {
 			error = ENOTCONN;

From owner-svn-src-stable-8@FreeBSD.ORG  Sat Apr  9 12:42:40 2011
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 979AE1065673;
	Sat,  9 Apr 2011 12:42:40 +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 844998FC17;
	Sat,  9 Apr 2011 12:42: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 p39Cge1e014224;
	Sat, 9 Apr 2011 12:42:40 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p39Cgegh014222;
	Sat, 9 Apr 2011 12:42:40 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <201104091242.p39Cgegh014222@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Sat, 9 Apr 2011 12:42: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: r220491 - stable/8
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Sat, 09 Apr 2011 12:42:40 -0000

Author: bz
Date: Sat Apr  9 12:42:40 2011
New Revision: 220491
URL: http://svn.freebsd.org/changeset/base/220491

Log:
  MFC r217735:
  
    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]

Modified:
  stable/8/Makefile   (contents, props changed)

Modified: stable/8/Makefile
==============================================================================
--- stable/8/Makefile	Sat Apr  9 12:38:09 2011	(r220490)
+++ stable/8/Makefile	Sat Apr  9 12:42:40 2011	(r220491)
@@ -292,7 +292,7 @@ UNIVERSE_TARGET?=	buildworld
 KERNSRCDIR?=		${.CURDIR}/sys
 
 .if defined(DOING_TINDERBOX)
-FAILFILE=tinderbox.failed
+FAILFILE=${.CURDIR}/_.tinderbox.failed
 MAKEFAIL=tee -a ${FAILFILE}
 .else
 MAKEFAIL=cat

From owner-svn-src-stable-8@FreeBSD.ORG  Sat Apr  9 12:52:42 2011
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 023E7106564A;
	Sat,  9 Apr 2011 12:52:42 +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 C8F1E8FC0A;
	Sat,  9 Apr 2011 12:52: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 p39CqfhZ014494;
	Sat, 9 Apr 2011 12:52:41 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p39CqfF1014493;
	Sat, 9 Apr 2011 12:52:41 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <201104091252.p39CqfF1014493@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Sat, 9 Apr 2011 12:52: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: r220492 - stable/8
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Sat, 09 Apr 2011 12:52:42 -0000

Author: bz
Date: Sat Apr  9 12:52:41 2011
New Revision: 220492
URL: http://svn.freebsd.org/changeset/base/220492

Log:
  MFC r217736:
  
    Add an svn:ignore property for _.{TARGETS,tinderbox}.* in the toplevel
    directory to ignore those file patters in svn status, add and import.

Modified:
Directory Properties:
  stable/8/   (props changed)

From owner-svn-src-stable-8@FreeBSD.ORG  Sat Apr  9 13:19:44 2011
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CB4D8106564A;
	Sat,  9 Apr 2011 13:19: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 B841F8FC0A;
	Sat,  9 Apr 2011 13:19: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 p39DJiq9015133;
	Sat, 9 Apr 2011 13:19:44 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p39DJiFX015131;
	Sat, 9 Apr 2011 13:19:44 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <201104091319.p39DJiFX015131@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Sat, 9 Apr 2011 13:19:44 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r220494 - stable/8/sys/net
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Sat, 09 Apr 2011 13:19:44 -0000

Author: bz
Date: Sat Apr  9 13:19:44 2011
New Revision: 220494
URL: http://svn.freebsd.org/changeset/base/220494

Log:
  MFC r218555:
  
    Mfp4 CH=177255:
  
      Use __func__ rather than __FUNCTION__.

Modified:
  stable/8/sys/net/vnet.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/net/vnet.h
==============================================================================
--- stable/8/sys/net/vnet.h	Sat Apr  9 12:56:13 2011	(r220493)
+++ stable/8/sys/net/vnet.h	Sat Apr  9 13:19:44 2011	(r220494)
@@ -122,7 +122,7 @@ void vnet_log_recursion(struct vnet *, c
 #define	VNET_ASSERT(condition)						\
 	if (!(condition)) {						\
 		printf("VNET_ASSERT @ %s:%d %s():\n",			\
-			__FILE__, __LINE__, __FUNCTION__);		\
+			__FILE__, __LINE__, __func__);			\
 		panic(#condition);					\
 	}
 
@@ -131,7 +131,7 @@ void vnet_log_recursion(struct vnet *, c
 	struct vnet *saved_vnet = curvnet;				\
 	const char *saved_vnet_lpush = curthread->td_vnet_lpush;	\
 	curvnet = arg;							\
-	curthread->td_vnet_lpush = __FUNCTION__;
+	curthread->td_vnet_lpush = __func__;
  
 #define	CURVNET_SET_VERBOSE(arg)					\
 	CURVNET_SET_QUIET(arg)						\

From owner-svn-src-stable-8@FreeBSD.ORG  Sat Apr  9 13:45:13 2011
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D52AD1065673;
	Sat,  9 Apr 2011 13:45:13 +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 C22418FC16;
	Sat,  9 Apr 2011 13:45: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 p39DjD7F015681;
	Sat, 9 Apr 2011 13:45:13 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p39DjD9F015676;
	Sat, 9 Apr 2011 13:45:13 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <201104091345.p39DjD9F015676@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Sat, 9 Apr 2011 13:45: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: r220495 - in stable/8/sys: kern net
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Sat, 09 Apr 2011 13:45:13 -0000

Author: bz
Date: Sat Apr  9 13:45:13 2011
New Revision: 220495
URL: http://svn.freebsd.org/changeset/base/220495

Log:
  MFC r218559:
  
    Mfp4 CH=177255:
  
      Make VNET_ASSERT() available with either VNET_DEBUG or INVARIANTS.
  
      Change the syntax to match KASSERT() to allow more flexible panic
      messages rather than having a printf with hardcoded arguments
      before panic.
  
      Adjust the few assertions we have to the new format (and enhance
      the output).
  
      Sponsored by: The FreeBSD Foundation
      Sponsored by: CK Software GmbH
      Reviewed by:  jhb

Modified:
  stable/8/sys/kern/uipc_socket.c
  stable/8/sys/net/if.c
  stable/8/sys/net/netisr.c
  stable/8/sys/net/vnet.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/kern/uipc_socket.c
==============================================================================
--- stable/8/sys/kern/uipc_socket.c	Sat Apr  9 13:19:44 2011	(r220494)
+++ stable/8/sys/kern/uipc_socket.c	Sat Apr  9 13:45:13 2011	(r220495)
@@ -428,7 +428,8 @@ sonewconn(struct socket *head, int conns
 	if (over)
 #endif
 		return (NULL);
-	VNET_ASSERT(head->so_vnet);
+	VNET_ASSERT(head->so_vnet != NULL, ("%s:%d so_vnet is NULL, head=%p",
+	    __func__, __LINE__, head));
 	so = soalloc(head->so_vnet);
 	if (so == NULL)
 		return (NULL);

Modified: stable/8/sys/net/if.c
==============================================================================
--- stable/8/sys/net/if.c	Sat Apr  9 13:19:44 2011	(r220494)
+++ stable/8/sys/net/if.c	Sat Apr  9 13:45:13 2011	(r220495)
@@ -387,8 +387,10 @@ static void
 vnet_if_uninit(const void *unused __unused)
 {
 
-	VNET_ASSERT(TAILQ_EMPTY(&V_ifnet));
-	VNET_ASSERT(TAILQ_EMPTY(&V_ifg_head));
+	VNET_ASSERT(TAILQ_EMPTY(&V_ifnet), ("%s:%d tailq &V_ifnet=%p "
+	    "not empty", __func__, __LINE__, &V_ifnet));
+	VNET_ASSERT(TAILQ_EMPTY(&V_ifg_head), ("%s:%d tailq &V_ifg_head=%p "
+	    "not empty", __func__, __LINE__, &V_ifg_head));
 
 	free((caddr_t)V_ifindex_table, M_IFNET);
 }

Modified: stable/8/sys/net/netisr.c
==============================================================================
--- stable/8/sys/net/netisr.c	Sat Apr  9 13:19:44 2011	(r220494)
+++ stable/8/sys/net/netisr.c	Sat Apr  9 13:45:13 2011	(r220495)
@@ -647,7 +647,8 @@ netisr_process_workstream_proto(struct n
 		if (local_npw.nw_head == NULL)
 			local_npw.nw_tail = NULL;
 		local_npw.nw_len--;
-		VNET_ASSERT(m->m_pkthdr.rcvif != NULL);
+		VNET_ASSERT(m->m_pkthdr.rcvif != NULL,
+		    ("%s:%d rcvif == NULL: m=%p", __func__, __LINE__, m));
 		CURVNET_SET(m->m_pkthdr.rcvif->if_vnet);
 		netisr_proto[proto].np_handler(m);
 		CURVNET_RESTORE();

Modified: stable/8/sys/net/vnet.h
==============================================================================
--- stable/8/sys/net/vnet.h	Sat Apr  9 13:19:44 2011	(r220494)
+++ stable/8/sys/net/vnet.h	Sat Apr  9 13:45:13 2011	(r220495)
@@ -116,18 +116,23 @@ void	vnet_destroy(struct vnet *vnet);
  * Various macros -- get and set the current network stack, but also
  * assertions.
  */
+#if defined(INVARIANTS) || defined(VNET_DEBUG)
+#define	VNET_ASSERT(exp, msg)	do {					\
+	if (!(exp))							\
+		panic msg;						\
+} while (0)
+#else
+#define	VNET_ASSERT(exp, msg)	do {					\
+} while (0)
+#endif
+
 #ifdef VNET_DEBUG
 void vnet_log_recursion(struct vnet *, const char *, int);
 
-#define	VNET_ASSERT(condition)						\
-	if (!(condition)) {						\
-		printf("VNET_ASSERT @ %s:%d %s():\n",			\
-			__FILE__, __LINE__, __func__);			\
-		panic(#condition);					\
-	}
-
 #define	CURVNET_SET_QUIET(arg)						\
-	VNET_ASSERT((arg)->vnet_magic_n == VNET_MAGIC_N);		\
+	VNET_ASSERT((arg) != NULL && (arg)->vnet_magic_n == VNET_MAGIC_N, \
+	    ("CURVNET_SET at %s:%d %s() curvnet=%p vnet=%p",		\
+	    __FILE__, __LINE__, __func__, curvnet, (arg)));		\
 	struct vnet *saved_vnet = curvnet;				\
 	const char *saved_vnet_lpush = curthread->td_vnet_lpush;	\
 	curvnet = arg;							\
@@ -141,12 +146,13 @@ void vnet_log_recursion(struct vnet *, c
 #define	CURVNET_SET(arg)	CURVNET_SET_VERBOSE(arg)
  
 #define	CURVNET_RESTORE()						\
-	VNET_ASSERT(saved_vnet == NULL ||				\
-		    saved_vnet->vnet_magic_n == VNET_MAGIC_N);		\
+	VNET_ASSERT(curvnet != NULL && (saved_vnet == NULL ||		\
+	    saved_vnet->vnet_magic_n == VNET_MAGIC_N),			\
+	    ("CURVNET_RESTORE at %s:%d %s() curvnet=%p saved_vnet=%p",	\
+	    __FILE__, __LINE__, __func__, curvnet, saved_vnet));	\
 	curvnet = saved_vnet;						\
 	curthread->td_vnet_lpush = saved_vnet_lpush;
 #else /* !VNET_DEBUG */
-#define	VNET_ASSERT(condition)
 
 #define	CURVNET_SET(arg)						\
 	struct vnet *saved_vnet = curvnet;				\
@@ -348,7 +354,7 @@ do {									\
  */
 #define	curvnet			NULL
 
-#define	VNET_ASSERT(condition)
+#define	VNET_ASSERT(exp, msg)
 #define	CURVNET_SET(arg)
 #define	CURVNET_SET_QUIET(arg)
 #define	CURVNET_RESTORE()

From owner-svn-src-stable-8@FreeBSD.ORG  Sat Apr  9 14:27:27 2011
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A227C106566C;
	Sat,  9 Apr 2011 14:27:27 +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 7622B8FC17;
	Sat,  9 Apr 2011 14:27: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 p39ERRv7017102;
	Sat, 9 Apr 2011 14:27:27 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p39ERR9Q017100;
	Sat, 9 Apr 2011 14:27:27 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <201104091427.p39ERR9Q017100@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Sat, 9 Apr 2011 14:27:27 +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: r220501 - stable/8/sys/net
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Sat, 09 Apr 2011 14:27:27 -0000

Author: bz
Date: Sat Apr  9 14:27:27 2011
New Revision: 220501
URL: http://svn.freebsd.org/changeset/base/220501

Log:
  MFC r218567:
  
    Mfp4 CH=177255:
  
      Resort the CURVNET_SET* macros in the non-VNET_DEBUG case to match
      the call order of the VNET_DEBUG case.
  
      Add the VNET_ASSERT() to the non-VNET_DEBUG case as well so that
      INVARIANTS will still catch problems.
  
      Sponsored by: The FreeBSD Foundation
      Sponsored by: CK Software GmbH
      Reviewed by:  jhb

Modified:
  stable/8/sys/net/vnet.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/net/vnet.h
==============================================================================
--- stable/8/sys/net/vnet.h	Sat Apr  9 14:25:58 2011	(r220500)
+++ stable/8/sys/net/vnet.h	Sat Apr  9 14:27:27 2011	(r220501)
@@ -154,14 +154,23 @@ void vnet_log_recursion(struct vnet *, c
 	curthread->td_vnet_lpush = saved_vnet_lpush;
 #else /* !VNET_DEBUG */
 
-#define	CURVNET_SET(arg)						\
+#define	CURVNET_SET_QUIET(arg)						\
+	VNET_ASSERT((arg) != NULL && (arg)->vnet_magic_n == VNET_MAGIC_N, \
+	    ("CURVNET_SET at %s:%d %s() curvnet=%p vnet=%p",		\
+	    __FILE__, __LINE__, __func__, curvnet, (arg)));		\
 	struct vnet *saved_vnet = curvnet;				\
 	curvnet = arg;	
  
-#define	CURVNET_SET_VERBOSE(arg)	CURVNET_SET(arg)
-#define	CURVNET_SET_QUIET(arg)		CURVNET_SET(arg)
+#define	CURVNET_SET_VERBOSE(arg)					\
+	CURVNET_SET_QUIET(arg)
+
+#define	CURVNET_SET(arg)	CURVNET_SET_VERBOSE(arg)
  
 #define	CURVNET_RESTORE()						\
+	VNET_ASSERT(curvnet != NULL && (saved_vnet == NULL ||		\
+	    saved_vnet->vnet_magic_n == VNET_MAGIC_N),			\
+	    ("CURVNET_RESTORE at %s:%d %s() curvnet=%p saved_vnet=%p",	\
+	    __FILE__, __LINE__, __func__, curvnet, saved_vnet));	\
 	curvnet = saved_vnet;
 #endif /* VNET_DEBUG */
 

From owner-svn-src-stable-8@FreeBSD.ORG  Sat Apr  9 15:27:36 2011
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B0483106564A;
	Sat,  9 Apr 2011 15:27:36 +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 9F5198FC08;
	Sat,  9 Apr 2011 15:27: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 p39FRaDs018496;
	Sat, 9 Apr 2011 15:27:36 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p39FRas9018494;
	Sat, 9 Apr 2011 15:27:36 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <201104091527.p39FRas9018494@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Sat, 9 Apr 2011 15:27: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: r220503 - stable/8/sys/kern
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Sat, 09 Apr 2011 15:27:36 -0000

Author: bz
Date: Sat Apr  9 15:27:36 2011
New Revision: 220503
URL: http://svn.freebsd.org/changeset/base/220503

Log:
  MFC r218688:
  
    Mfp4 CH=177256:
  
      Catch a set vnet upon return to user space. This usually
      means return paths with CURVNET_RESTORE() missing.
  
      If VNET_DEBUG is turned on we can even tell the function
      that did the CURVNET_SET() which is really helpful; else
      we print "N/A".
  
      Sponsored by: The FreeBSD Foundation
      Sponsored by: CK Software GmbH
      Reviewed by:  jhb

Modified:
  stable/8/sys/kern/subr_trap.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/subr_trap.c
==============================================================================
--- stable/8/sys/kern/subr_trap.c	Sat Apr  9 14:45:50 2011	(r220502)
+++ stable/8/sys/kern/subr_trap.c	Sat Apr  9 15:27:36 2011	(r220503)
@@ -73,6 +73,10 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
+#ifdef VIMAGE
+#include 
+#endif
+
 #ifdef XEN
 #include 
 #include 
@@ -125,6 +129,13 @@ userret(struct thread *td, struct trapfr
 	sched_userret(td);
 	KASSERT(td->td_locks == 0,
 	    ("userret: Returning with %d locks held.", td->td_locks));
+#ifdef VIMAGE
+	/* Unfortunately td_vnet_lpush needs VNET_DEBUG. */
+	VNET_ASSERT(curvnet == NULL,
+	    ("%s: Returning on td %p (pid %d, %s) with vnet %p set in %s",
+	    __func__, td, p->p_pid, td->td_name, curvnet,
+	    (td->td_vnet_lpush != NULL) ? td->td_vnet_lpush : "N/A"));
+#endif
 #ifdef XEN
 	PT_UPDATES_FLUSH();
 #endif

From owner-svn-src-stable-8@FreeBSD.ORG  Sat Apr  9 19:07:13 2011
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 980121065689;
	Sat,  9 Apr 2011 19:07:13 +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 86E378FC20;
	Sat,  9 Apr 2011 19:07: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 p39J7DCl022809;
	Sat, 9 Apr 2011 19:07:13 GMT (envelope-from gjb@svn.freebsd.org)
Received: (from gjb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p39J7Dop022807;
	Sat, 9 Apr 2011 19:07:13 GMT (envelope-from gjb@svn.freebsd.org)
Message-Id: <201104091907.p39J7Dop022807@svn.freebsd.org>
From: Glen Barber 
Date: Sat, 9 Apr 2011 19:07: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: r220504 - stable/8/sbin/ifconfig
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Sat, 09 Apr 2011 19:07:13 -0000

Author: gjb (doc committer)
Date: Sat Apr  9 19:07:13 2011
New Revision: 220504
URL: http://svn.freebsd.org/changeset/base/220504

Log:
  MFC 220382:
  Correct 'list scan' description in the examples.  The previous description
  was incorrect - 'list scan' does not actually do a scan, but instead lists
  the results of the background 'scan' cache.

Modified:
  stable/8/sbin/ifconfig/ifconfig.8
Directory Properties:
  stable/8/sbin/ifconfig/   (props changed)

Modified: stable/8/sbin/ifconfig/ifconfig.8
==============================================================================
--- stable/8/sbin/ifconfig/ifconfig.8	Sat Apr  9 15:27:36 2011	(r220503)
+++ stable/8/sbin/ifconfig/ifconfig.8	Sat Apr  9 19:07:13 2011	(r220504)
@@ -2518,7 +2518,7 @@ Destroy the software network interface
 .Li gif1 :
 .Dl # ifconfig gif1 destroy
 .Pp
-Scan for wireless networks using
+Display available wireless networks using
 .Li wlan0 :
 .Dl # ifconfig wlan0 list scan
 .Sh DIAGNOSTICS