From owner-svn-src-stable-9@FreeBSD.ORG  Sun Oct  7 05:11:29 2012
Return-Path: <owner-svn-src-stable-9@FreeBSD.ORG>
Delivered-To: svn-src-stable-9@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id ECFD2106566C;
	Sun,  7 Oct 2012 05:11:29 +0000 (UTC) (envelope-from pfg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D52E08FC0A;
	Sun,  7 Oct 2012 05:11:29 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q975BT9c023809;
	Sun, 7 Oct 2012 05:11:29 GMT (envelope-from pfg@svn.freebsd.org)
Received: (from pfg@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id q975BTMo023801;
	Sun, 7 Oct 2012 05:11:29 GMT (envelope-from pfg@svn.freebsd.org)
Message-Id: <201210070511.q975BTMo023801@svn.freebsd.org>
From: "Pedro F. Giffuni" <pfg@FreeBSD.org>
Date: Sun, 7 Oct 2012 05:11:29 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r241309 - in stable/9: include/rpc lib/libc/rpc sys/rpc
X-BeenThere: svn-src-stable-9@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 9-stable src tree
	<svn-src-stable-9.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-stable-9>, 
	<mailto:svn-src-stable-9-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-stable-9>
List-Post: <mailto:svn-src-stable-9@freebsd.org>
List-Help: <mailto:svn-src-stable-9-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-stable-9>, 
	<mailto:svn-src-stable-9-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 07 Oct 2012 05:11:30 -0000

Author: pfg
Date: Sun Oct  7 05:11:29 2012
New Revision: 241309
URL: http://svn.freebsd.org/changeset/base/241309

Log:
  MFC	 r241141, r241165, r241165,  r241181;
  
  rpc: convert all uid and gid variables to u_int.
  
  Follow a similar change in Solaris and linux where the uid and
  gid variables were made more similar to what the system expects.
  In our case we use u_int which is what XDR can manage,
  
  Reviewed by:	bde

Modified:
  stable/9/include/rpc/auth.h
  stable/9/include/rpc/auth_unix.h
  stable/9/lib/libc/rpc/auth_unix.c
  stable/9/lib/libc/rpc/authunix_prot.c
  stable/9/lib/libc/rpc/rpc_soc.3
  stable/9/lib/libc/rpc/svc_auth_unix.c
  stable/9/sys/rpc/auth.h

Modified: stable/9/include/rpc/auth.h
==============================================================================
--- stable/9/include/rpc/auth.h	Sun Oct  7 02:08:19 2012	(r241308)
+++ stable/9/include/rpc/auth.h	Sun Oct  7 05:11:29 2012	(r241309)
@@ -243,14 +243,13 @@ __END_DECLS
  * System style authentication
  * AUTH *authunix_create(machname, uid, gid, len, aup_gids)
  *	char *machname;
- *	int uid;
- *	int gid;
+ *	u_int uid;
+ *	u_int gid;
  *	int len;
- *	int *aup_gids;
+ *	u_int *aup_gids;
  */
 __BEGIN_DECLS
-extern AUTH *authunix_create(char *, int, int, int,
-    int *);
+extern AUTH *authunix_create(char *, u_int, u_int, int, u_int *);
 extern AUTH *authunix_create_default(void);	/* takes no parameters */
 extern AUTH *authnone_create(void);		/* takes no parameters */
 __END_DECLS

Modified: stable/9/include/rpc/auth_unix.h
==============================================================================
--- stable/9/include/rpc/auth_unix.h	Sun Oct  7 02:08:19 2012	(r241308)
+++ stable/9/include/rpc/auth_unix.h	Sun Oct  7 05:11:29 2012	(r241309)
@@ -60,10 +60,10 @@
 struct authunix_parms {
 	u_long	 aup_time;
 	char	*aup_machname;
-	int	 aup_uid;
-	int	 aup_gid;
+	u_int	 aup_uid;
+	u_int	 aup_gid;
 	u_int	 aup_len;
-	int	*aup_gids;
+	u_int	*aup_gids;
 };
 
 #define authsys_parms authunix_parms

Modified: stable/9/lib/libc/rpc/auth_unix.c
==============================================================================
--- stable/9/lib/libc/rpc/auth_unix.c	Sun Oct  7 02:08:19 2012	(r241308)
+++ stable/9/lib/libc/rpc/auth_unix.c	Sun Oct  7 05:11:29 2012	(r241309)
@@ -94,10 +94,10 @@ struct audata {
 AUTH *
 authunix_create(machname, uid, gid, len, aup_gids)
 	char *machname;
-	int uid;
-	int gid;
+	u_int uid;
+	u_int gid;
 	int len;
-	int *aup_gids;
+	u_int *aup_gids;
 {
 	struct authunix_parms aup;
 	char mymem[MAX_AUTH_BYTES];
@@ -189,9 +189,9 @@ authunix_create_default()
 	int ngids;
 	long ngids_max;
 	char machname[MAXHOSTNAMELEN + 1];
-	uid_t uid;
-	gid_t gid;
-	gid_t *gids;
+	u_int uid;
+	u_int gid;
+	u_int *gids;
 
 	ngids_max = sysconf(_SC_NGROUPS_MAX) + 1;
 	gids = malloc(sizeof(gid_t) * ngids_max);
@@ -207,9 +207,8 @@ authunix_create_default()
 		abort();
 	if (ngids > NGRPS)
 		ngids = NGRPS;
-	/* XXX: interface problem; those should all have been unsigned */
-	auth = authunix_create(machname, (int)uid, (int)gid, ngids,
-	    (int *)gids);
+	/* XXX: interface problem; we should translate from uid_t and gid_t */
+	auth = authunix_create(machname, uid, gid, ngids, gids);
 	free(gids);
 	return (auth);
 }

Modified: stable/9/lib/libc/rpc/authunix_prot.c
==============================================================================
--- stable/9/lib/libc/rpc/authunix_prot.c	Sun Oct  7 02:08:19 2012	(r241308)
+++ stable/9/lib/libc/rpc/authunix_prot.c	Sun Oct  7 05:11:29 2012	(r241309)
@@ -60,19 +60,19 @@ xdr_authunix_parms(xdrs, p)
 	XDR *xdrs;
 	struct authunix_parms *p;
 {
-	int **paup_gids;
+	u_int **paup_gids;
 
 	assert(xdrs != NULL);
 	assert(p != NULL);
 
 	paup_gids = &p->aup_gids;
 
-	if (xdr_u_long(xdrs, &(p->aup_time))
-	    && xdr_string(xdrs, &(p->aup_machname), MAX_MACHINE_NAME)
-	    && xdr_int(xdrs, &(p->aup_uid))
-	    && xdr_int(xdrs, &(p->aup_gid))
-	    && xdr_array(xdrs, (char **) paup_gids,
-		    &(p->aup_len), NGRPS, sizeof(int), (xdrproc_t)xdr_int) ) {
+	if (xdr_u_long(xdrs, &(p->aup_time)) &&
+	    xdr_string(xdrs, &(p->aup_machname), MAX_MACHINE_NAME) &&
+	    xdr_u_int(xdrs, &(p->aup_uid)) &&
+	    xdr_u_int(xdrs, &(p->aup_gid)) &&
+	    xdr_array(xdrs, (char **) paup_gids,
+	    &(p->aup_len), NGRPS, sizeof(u_int), (xdrproc_t)xdr_u_int) ) {
 		return (TRUE);
 	}
 	return (FALSE);

Modified: stable/9/lib/libc/rpc/rpc_soc.3
==============================================================================
--- stable/9/lib/libc/rpc/rpc_soc.3	Sun Oct  7 02:08:19 2012	(r241308)
+++ stable/9/lib/libc/rpc/rpc_soc.3	Sun Oct  7 05:11:29 2012	(r241309)
@@ -148,7 +148,7 @@ default authentication used by
 .Ft "AUTH *"
 .Xc
 .It Xo
-.Fn authunix_create "char *host" "int uid" "int gid" "int len" "int *aup_gids"
+.Fn authunix_create "char *host" "u_int uid" "u_int gid" "int len" "u_int *aup_gids"
 .Xc
 .Pp
 Create and return an

Modified: stable/9/lib/libc/rpc/svc_auth_unix.c
==============================================================================
--- stable/9/lib/libc/rpc/svc_auth_unix.c	Sun Oct  7 02:08:19 2012	(r241308)
+++ stable/9/lib/libc/rpc/svc_auth_unix.c	Sun Oct  7 05:11:29 2012	(r241309)
@@ -68,7 +68,7 @@ _svcauth_unix(rqst, msg)
 	struct area {
 		struct authunix_parms area_aup;
 		char area_machname[MAX_MACHINE_NAME+1];
-		int area_gids[NGRPS];
+		u_int area_gids[NGRPS];
 	} *area;
 	u_int auth_len;
 	size_t str_len, gid_len;

Modified: stable/9/sys/rpc/auth.h
==============================================================================
--- stable/9/sys/rpc/auth.h	Sun Oct  7 02:08:19 2012	(r241308)
+++ stable/9/sys/rpc/auth.h	Sun Oct  7 05:11:29 2012	(r241309)
@@ -234,18 +234,17 @@ __END_DECLS
  * System style authentication
  * AUTH *authunix_create(machname, uid, gid, len, aup_gids)
  *	char *machname;
- *	int uid;
- *	int gid;
+ *	u_int uid;
+ *	u_int gid;
  *	int len;
- *	int *aup_gids;
+ *	u_int *aup_gids;
  */
 __BEGIN_DECLS
 #ifdef _KERNEL
 struct ucred;
 extern AUTH *authunix_create(struct ucred *);
 #else
-extern AUTH *authunix_create(char *, int, int, int,
-    int *);
+extern AUTH *authunix_create(char *, u_int, u_int, int, u_int *);
 extern AUTH *authunix_create_default(void);	/* takes no parameters */
 #endif
 extern AUTH *authnone_create(void);		/* takes no parameters */

From owner-svn-src-stable-9@FreeBSD.ORG  Sun Oct  7 18:18:59 2012
Return-Path: <owner-svn-src-stable-9@FreeBSD.ORG>
Delivered-To: svn-src-stable-9@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id D5120106564A;
	Sun,  7 Oct 2012 18:18:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id BF2BD8FC0A;
	Sun,  7 Oct 2012 18:18:59 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q97IIx30046381;
	Sun, 7 Oct 2012 18:18:59 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id q97IIxDd046379;
	Sun, 7 Oct 2012 18:18:59 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201210071818.q97IIxDd046379@svn.freebsd.org>
From: John Baldwin <jhb@FreeBSD.org>
Date: Sun, 7 Oct 2012 18:18:59 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r241314 - stable/9/sys/dev/cxgb
X-BeenThere: svn-src-stable-9@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 9-stable src tree
	<svn-src-stable-9.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-stable-9>, 
	<mailto:svn-src-stable-9-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-stable-9>
List-Post: <mailto:svn-src-stable-9@freebsd.org>
List-Help: <mailto:svn-src-stable-9-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-stable-9>, 
	<mailto:svn-src-stable-9-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 07 Oct 2012 18:19:00 -0000

Author: jhb
Date: Sun Oct  7 18:18:59 2012
New Revision: 241314
URL: http://svn.freebsd.org/changeset/base/241314

Log:
  MFC 239913:
  Attach interrupt handlers during attach instead of during the first time
  the interface is brought up.  Without this, the boot time interrupt
  round-robin assignment does not think the allocated interrupt resources
  are active and leaves them assigned to CPU 0.
  
  While here, add descriptive tags to each interrupt handler when MSI-X
  is used.

Modified:
  stable/9/sys/dev/cxgb/cxgb_main.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/cxgb/cxgb_main.c
==============================================================================
--- stable/9/sys/dev/cxgb/cxgb_main.c	Sun Oct  7 18:07:45 2012	(r241313)
+++ stable/9/sys/dev/cxgb/cxgb_main.c	Sun Oct  7 18:18:59 2012	(r241314)
@@ -675,6 +675,9 @@ cxgb_controller_attach(device_t dev)
 	for (i = 0; i < NUM_CPL_HANDLERS; i++)
 		sc->cpl_handler[i] = cpl_not_handled;
 #endif
+
+	t3_intr_clear(sc);
+	error = cxgb_setup_interrupts(sc);
 out:
 	if (error)
 		cxgb_free(sc);
@@ -922,6 +925,7 @@ cxgb_setup_interrupts(adapter_t *sc)
 	if (!(intr_flag & USING_MSIX) || err)
 		return (err);
 
+	bus_describe_intr(sc->dev, sc->irq_res, sc->intr_tag, "err");
 	for (i = 0; i < sc->msi_count - 1; i++) {
 		rid = i + 2;
 		res = bus_alloc_resource_any(sc->dev, SYS_RES_IRQ, &rid,
@@ -945,6 +949,7 @@ cxgb_setup_interrupts(adapter_t *sc)
 		sc->msix_irq_rid[i] = rid;
 		sc->msix_irq_res[i] = res;
 		sc->msix_intr_tag[i] = tag;
+		bus_describe_intr(sc->dev, res, tag, "qs%d", i);
 	}
 
 	if (err)
@@ -1611,11 +1616,6 @@ cxgb_up(struct adapter *sc)
 		alloc_filters(sc);
 		setup_rss(sc);
 
-		t3_intr_clear(sc);
-		err = cxgb_setup_interrupts(sc);
-		if (err)
-			goto out;
-
 		t3_add_configured_sysctls(sc);
 		sc->flags |= FULL_INIT_DONE;
 	}

From owner-svn-src-stable-9@FreeBSD.ORG  Sun Oct  7 18:23:00 2012
Return-Path: <owner-svn-src-stable-9@FreeBSD.ORG>
Delivered-To: svn-src-stable-9@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id F0BE1106564A;
	Sun,  7 Oct 2012 18:22:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id DA4B68FC0A;
	Sun,  7 Oct 2012 18:22:59 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q97IMxJ7047052;
	Sun, 7 Oct 2012 18:22:59 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id q97IMx7g047050;
	Sun, 7 Oct 2012 18:22:59 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201210071822.q97IMx7g047050@svn.freebsd.org>
From: John Baldwin <jhb@FreeBSD.org>
Date: Sun, 7 Oct 2012 18:22:59 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r241316 - stable/9/lib/libc/sys
X-BeenThere: svn-src-stable-9@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 9-stable src tree
	<svn-src-stable-9.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-stable-9>, 
	<mailto:svn-src-stable-9-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-stable-9>
List-Post: <mailto:svn-src-stable-9@freebsd.org>
List-Help: <mailto:svn-src-stable-9-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-stable-9>, 
	<mailto:svn-src-stable-9-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 07 Oct 2012 18:23:00 -0000

Author: jhb
Date: Sun Oct  7 18:22:59 2012
New Revision: 241316
URL: http://svn.freebsd.org/changeset/base/241316

Log:
  MFC 240132:
  When WIFCONTINUED was added, the number of "first" macros grew from
  three to four.

Modified:
  stable/9/lib/libc/sys/wait.2
Directory Properties:
  stable/9/lib/libc/   (props changed)
  stable/9/lib/libc/sys/   (props changed)

Modified: stable/9/lib/libc/sys/wait.2
==============================================================================
--- stable/9/lib/libc/sys/wait.2	Sun Oct  7 18:19:13 2012	(r241315)
+++ stable/9/lib/libc/sys/wait.2	Sun Oct  7 18:22:59 2012	(r241316)
@@ -177,7 +177,7 @@ with a
 value of -1.
 .Pp
 The following macros may be used to test the manner of exit of the process.
-One of the first three macros will evaluate to a non-zero (true) value:
+One of the first four macros will evaluate to a non-zero (true) value:
 .Bl -tag -width Ds
 .It Fn WIFCONTINUED status
 True if the process has not terminated, and

From owner-svn-src-stable-9@FreeBSD.ORG  Sun Oct  7 18:25:34 2012
Return-Path: <owner-svn-src-stable-9@FreeBSD.ORG>
Delivered-To: svn-src-stable-9@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 96606106566C;
	Sun,  7 Oct 2012 18:25:34 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 815D88FC08;
	Sun,  7 Oct 2012 18:25:34 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q97IPY34047461;
	Sun, 7 Oct 2012 18:25:34 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id q97IPYXn047458;
	Sun, 7 Oct 2012 18:25:34 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201210071825.q97IPYXn047458@svn.freebsd.org>
From: John Baldwin <jhb@FreeBSD.org>
Date: Sun, 7 Oct 2012 18:25:34 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r241318 - stable/9/share/man/man9
X-BeenThere: svn-src-stable-9@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 9-stable src tree
	<svn-src-stable-9.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-stable-9>, 
	<mailto:svn-src-stable-9-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-stable-9>
List-Post: <mailto:svn-src-stable-9@freebsd.org>
List-Help: <mailto:svn-src-stable-9-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-stable-9>, 
	<mailto:svn-src-stable-9-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 07 Oct 2012 18:25:34 -0000

Author: jhb
Date: Sun Oct  7 18:25:33 2012
New Revision: 241318
URL: http://svn.freebsd.org/changeset/base/241318

Log:
  MFC 239906:
  Clarify that bus_dma does not stall future load requests once a load is
  deferred.  The caller is required to enforce that if that is desired.

Modified:
  stable/9/share/man/man9/bus_dma.9
Directory Properties:
  stable/9/share/man/man9/   (props changed)

Modified: stable/9/share/man/man9/bus_dma.9
==============================================================================
--- stable/9/share/man/man9/bus_dma.9	Sun Oct  7 18:23:15 2012	(r241317)
+++ stable/9/share/man/man9/bus_dma.9	Sun Oct  7 18:25:33 2012	(r241318)
@@ -580,8 +580,13 @@ The status of the mapping has been deliv
 The mapping has been deferred for lack of resources.
 The callback will be called as soon as resources are available.
 Callbacks are serviced in FIFO order.
-To ensure that ordering is guaranteed, all subsequent load requests will also
-be deferred until all callbacks have been processed.
+.Pp
+Note that subsequent load operations for the same tag that do not require
+extra resources will still succeed.
+This may result in out-of-order processing of requests.
+If the caller requires the order of requests to be preserved,
+then the caller is required to stall subsequent requests until a pending
+request's callback is invoked.
 .It Er ENOMEM
 The load request has failed due to insufficient resources, and the caller
 specifically used the

From owner-svn-src-stable-9@FreeBSD.ORG  Sun Oct  7 18:31:01 2012
Return-Path: <owner-svn-src-stable-9@FreeBSD.ORG>
Delivered-To: svn-src-stable-9@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id B79001065672;
	Sun,  7 Oct 2012 18:31:01 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 96FC48FC0A;
	Sun,  7 Oct 2012 18:31:01 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q97IV1Db048285;
	Sun, 7 Oct 2012 18:31:01 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id q97IV1AA048281;
	Sun, 7 Oct 2012 18:31:01 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201210071831.q97IV1AA048281@svn.freebsd.org>
From: John Baldwin <jhb@FreeBSD.org>
Date: Sun, 7 Oct 2012 18:31:01 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r241320 - stable/9/bin/mv
X-BeenThere: svn-src-stable-9@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 9-stable src tree
	<svn-src-stable-9.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-stable-9>, 
	<mailto:svn-src-stable-9-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-stable-9>
List-Post: <mailto:svn-src-stable-9@freebsd.org>
List-Help: <mailto:svn-src-stable-9-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-stable-9>, 
	<mailto:svn-src-stable-9-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 07 Oct 2012 18:31:01 -0000

Author: jhb
Date: Sun Oct  7 18:31:01 2012
New Revision: 241320
URL: http://svn.freebsd.org/changeset/base/241320

Log:
  MFC 226961,239951:
  Add a -h flag similar to the -h flag for ln to force mv(1) to treat a
  symbolic link to a directory for the target as a symbolic link instead of
  a directory.  This makes it possible to atomically update a symbolic
  link using rename().

Modified:
  stable/9/bin/mv/mv.1
  stable/9/bin/mv/mv.c
Directory Properties:
  stable/9/bin/mv/   (props changed)

Modified: stable/9/bin/mv/mv.1
==============================================================================
--- stable/9/bin/mv/mv.1	Sun Oct  7 18:25:48 2012	(r241319)
+++ stable/9/bin/mv/mv.1	Sun Oct  7 18:31:01 2012	(r241320)
@@ -32,7 +32,7 @@
 .\"	@(#)mv.1	8.1 (Berkeley) 5/31/93
 .\" $FreeBSD$
 .\"
-.Dd May 12, 2007
+.Dd August 28, 2012
 .Dt MV 1
 .Os
 .Sh NAME
@@ -41,7 +41,7 @@
 .Sh SYNOPSIS
 .Nm
 .Op Fl f | i | n
-.Op Fl v
+.Op Fl hv
 .Ar source target
 .Nm
 .Op Fl f | i | n
@@ -81,6 +81,21 @@ option overrides any previous
 or
 .Fl n
 options.)
+.It Fl h
+If the
+.Ar target
+operand is a symbolic link to a directory,
+do not follow it.
+This causes the
+.Nm
+utility to rename the file
+.Ar source
+to the destination path
+.Ar target
+rather than moving
+.Ar source
+into the directory referenced by
+.Ar target .
 .It Fl i
 Cause
 .Nm
@@ -142,7 +157,8 @@ rm -rf source_file
 .Ex -std
 .Sh COMPATIBILITY
 The
-.Fl n
+.Fl h ,
+.Fl n ,
 and
 .Fl v
 options are non-standard and their use in scripts is not recommended.

Modified: stable/9/bin/mv/mv.c
==============================================================================
--- stable/9/bin/mv/mv.c	Sun Oct  7 18:25:48 2012	(r241319)
+++ stable/9/bin/mv/mv.c	Sun Oct  7 18:31:01 2012	(r241320)
@@ -68,7 +68,7 @@ __FBSDID("$FreeBSD$");
 /* Exit code for a failed exec. */
 #define EXEC_FAILED 127
 
-int fflg, iflg, nflg, vflg;
+static int	fflg, hflg, iflg, nflg, vflg;
 
 static int	copy(const char *, const char *);
 static int	do_move(const char *, const char *);
@@ -87,8 +87,11 @@ main(int argc, char *argv[])
 	int ch;
 	char path[PATH_MAX];
 
-	while ((ch = getopt(argc, argv, "finv")) != -1)
+	while ((ch = getopt(argc, argv, "fhinv")) != -1)
 		switch (ch) {
+		case 'h':
+			hflg = 1;
+			break;
 		case 'i':
 			iflg = 1;
 			fflg = nflg = 0;
@@ -123,6 +126,17 @@ main(int argc, char *argv[])
 		exit(do_move(argv[0], argv[1]));
 	}
 
+	/*
+	 * If -h was specified, treat the target as a symlink instead of
+	 * directory.
+	 */
+	if (hflg) {
+		if (argc > 2)
+			usage();
+		if (lstat(argv[1], &sb) == 0 && S_ISLNK(sb.st_mode))
+			exit(do_move(argv[0], argv[1]));
+	}
+
 	/* It's a directory, move each file into it. */
 	if (strlen(argv[argc - 1]) > sizeof(path) - 1)
 		errx(1, "%s: destination pathname too long", *argv);
@@ -489,7 +503,7 @@ usage(void)
 {
 
 	(void)fprintf(stderr, "%s\n%s\n",
-		      "usage: mv [-f | -i | -n] [-v] source target",
+		      "usage: mv [-f | -i | -n] [-hv] source target",
 		      "       mv [-f | -i | -n] [-v] source ... directory");
 	exit(EX_USAGE);
 }

From owner-svn-src-stable-9@FreeBSD.ORG  Sun Oct  7 18:37:48 2012
Return-Path: <owner-svn-src-stable-9@FreeBSD.ORG>
Delivered-To: svn-src-stable-9@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 2308E106566C;
	Sun,  7 Oct 2012 18:37:48 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 0E5308FC17;
	Sun,  7 Oct 2012 18:37:48 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q97IblsO049402;
	Sun, 7 Oct 2012 18:37:47 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id q97IblVq049400;
	Sun, 7 Oct 2012 18:37:47 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201210071837.q97IblVq049400@svn.freebsd.org>
From: John Baldwin <jhb@FreeBSD.org>
Date: Sun, 7 Oct 2012 18:37:47 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r241322 - stable/9/sys/kern
X-BeenThere: svn-src-stable-9@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 9-stable src tree
	<svn-src-stable-9.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-stable-9>, 
	<mailto:svn-src-stable-9-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-stable-9>
List-Post: <mailto:svn-src-stable-9@freebsd.org>
List-Help: <mailto:svn-src-stable-9-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-stable-9>, 
	<mailto:svn-src-stable-9-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 07 Oct 2012 18:37:48 -0000

Author: jhb
Date: Sun Oct  7 18:37:47 2012
New Revision: 241322
URL: http://svn.freebsd.org/changeset/base/241322

Log:
  MFC 239335:
  Remove D_NEEDGIANT from dead_devsw.  biofinish() (and thus dead_strategy)
  does not need Giant.

Modified:
  stable/9/sys/kern/kern_conf.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/kern/kern_conf.c
==============================================================================
--- stable/9/sys/kern/kern_conf.c	Sun Oct  7 18:31:17 2012	(r241321)
+++ stable/9/sys/kern/kern_conf.c	Sun Oct  7 18:37:47 2012	(r241322)
@@ -306,7 +306,6 @@ dead_strategy(struct bio *bp)
 
 static struct cdevsw dead_cdevsw = {
 	.d_version =	D_VERSION,
-	.d_flags =	D_NEEDGIANT, /* XXX: does dead_strategy need this ? */
 	.d_open =	dead_open,
 	.d_close =	dead_close,
 	.d_read =	dead_read,

From owner-svn-src-stable-9@FreeBSD.ORG  Sun Oct  7 18:41:49 2012
Return-Path: <owner-svn-src-stable-9@FreeBSD.ORG>
Delivered-To: svn-src-stable-9@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 1822A106566B;
	Sun,  7 Oct 2012 18:41:49 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 03A818FC08;
	Sun,  7 Oct 2012 18:41:49 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q97IfmiS050037;
	Sun, 7 Oct 2012 18:41:48 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id q97IfmJt050035;
	Sun, 7 Oct 2012 18:41:48 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201210071841.q97IfmJt050035@svn.freebsd.org>
From: John Baldwin <jhb@FreeBSD.org>
Date: Sun, 7 Oct 2012 18:41:48 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r241324 - stable/9/sys/dev/mfi
X-BeenThere: svn-src-stable-9@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 9-stable src tree
	<svn-src-stable-9.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-stable-9>, 
	<mailto:svn-src-stable-9-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-stable-9>
List-Post: <mailto:svn-src-stable-9@freebsd.org>
List-Help: <mailto:svn-src-stable-9-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-stable-9>, 
	<mailto:svn-src-stable-9-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 07 Oct 2012 18:41:49 -0000

Author: jhb
Date: Sun Oct  7 18:41:48 2012
New Revision: 241324
URL: http://svn.freebsd.org/changeset/base/241324

Log:
  MFC 240962:
  Grab the mfi_config_lock while performing a MFI_DCMD_CFG_FOREIGN_IMPORT
  request on behalf of a user utility.

Modified:
  stable/9/sys/dev/mfi/mfi.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/mfi/mfi.c
==============================================================================
--- stable/9/sys/dev/mfi/mfi.c	Sun Oct  7 18:37:59 2012	(r241323)
+++ stable/9/sys/dev/mfi/mfi.c	Sun Oct  7 18:41:48 2012	(r241324)
@@ -2550,6 +2550,7 @@ mfi_config_lock(struct mfi_softc *sc, ui
 	case MFI_DCMD_LD_DELETE:
 	case MFI_DCMD_CFG_ADD:
 	case MFI_DCMD_CFG_CLEAR:
+	case MFI_DCMD_CFG_FOREIGN_IMPORT:
 		sx_xlock(&sc->mfi_config_lock);
 		return (1);
 	default:

From owner-svn-src-stable-9@FreeBSD.ORG  Sun Oct  7 18:47:53 2012
Return-Path: <owner-svn-src-stable-9@FreeBSD.ORG>
Delivered-To: svn-src-stable-9@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id D72BD106575F;
	Sun,  7 Oct 2012 18:47:53 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C179E8FC08;
	Sun,  7 Oct 2012 18:47:53 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q97IlrOG051078;
	Sun, 7 Oct 2012 18:47:53 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id q97Ilrp5051076;
	Sun, 7 Oct 2012 18:47:53 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201210071847.q97Ilrp5051076@svn.freebsd.org>
From: John Baldwin <jhb@FreeBSD.org>
Date: Sun, 7 Oct 2012 18:47:53 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r241326 - stable/9/sys/x86/x86
X-BeenThere: svn-src-stable-9@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 9-stable src tree
	<svn-src-stable-9.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-stable-9>, 
	<mailto:svn-src-stable-9-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-stable-9>
List-Post: <mailto:svn-src-stable-9@freebsd.org>
List-Help: <mailto:svn-src-stable-9-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-stable-9>, 
	<mailto:svn-src-stable-9-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 07 Oct 2012 18:47:54 -0000

Author: jhb
Date: Sun Oct  7 18:47:53 2012
New Revision: 241326
URL: http://svn.freebsd.org/changeset/base/241326

Log:
  MFC 239354:
  Allow static DMA allocations that allow for enough segments to do page-sized
  segments for the entire allocation to use kmem_alloc_attr() to allocate
  KVM rather than using kmem_alloc_contig().  This avoids requiring
  a single physically contiguous chunk in this case.

Modified:
  stable/9/sys/x86/x86/busdma_machdep.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/x86/x86/busdma_machdep.c
==============================================================================
--- stable/9/sys/x86/x86/busdma_machdep.c	Sun Oct  7 18:42:02 2012	(r241325)
+++ stable/9/sys/x86/x86/busdma_machdep.c	Sun Oct  7 18:47:53 2012	(r241326)
@@ -541,13 +541,14 @@ bus_dmamem_alloc(bus_dma_tag_t dmat, voi
 	    dmat->lowaddr >= ptoa((vm_paddr_t)Maxmem) &&
 	    attr == VM_MEMATTR_DEFAULT) {
 		*vaddr = malloc(dmat->maxsize, M_DEVBUF, mflags);
+	} else if (dmat->nsegments >= btoc(dmat->maxsize) &&
+	    dmat->alignment <= PAGE_SIZE &&
+	    (dmat->boundary == 0 || dmat->boundary >= dmat->lowaddr)) {
+		/* Page-based multi-segment allocations allowed */
+		*vaddr = (void *)kmem_alloc_attr(kernel_map, dmat->maxsize,
+		    mflags, 0ul, dmat->lowaddr, attr);
+		*mapp = &contig_dmamap;
 	} else {
-		/*
-		 * XXX Use Contigmalloc until it is merged into this facility
-		 *     and handles multi-seg allocations.  Nobody is doing
-		 *     multi-seg allocations yet though.
-		 * XXX Certain AGP hardware does.
-		 */
 		*vaddr = (void *)kmem_alloc_contig(kernel_map, dmat->maxsize,
 		    mflags, 0ul, dmat->lowaddr, dmat->alignment ?
 		    dmat->alignment : 1ul, dmat->boundary, attr);

From owner-svn-src-stable-9@FreeBSD.ORG  Sun Oct  7 18:57:29 2012
Return-Path: <owner-svn-src-stable-9@FreeBSD.ORG>
Delivered-To: svn-src-stable-9@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id BCD111065670;
	Sun,  7 Oct 2012 18:57:29 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A641A8FC17;
	Sun,  7 Oct 2012 18:57:29 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q97IvTJd052578;
	Sun, 7 Oct 2012 18:57:29 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id q97IvTNO052576;
	Sun, 7 Oct 2012 18:57:29 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201210071857.q97IvTNO052576@svn.freebsd.org>
From: John Baldwin <jhb@FreeBSD.org>
Date: Sun, 7 Oct 2012 18:57:29 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r241327 - stable/9/sys/net
X-BeenThere: svn-src-stable-9@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 9-stable src tree
	<svn-src-stable-9.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-stable-9>, 
	<mailto:svn-src-stable-9-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-stable-9>
List-Post: <mailto:svn-src-stable-9@freebsd.org>
List-Help: <mailto:svn-src-stable-9-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-stable-9>, 
	<mailto:svn-src-stable-9-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 07 Oct 2012 18:57:30 -0000

Author: jhb
Date: Sun Oct  7 18:57:29 2012
New Revision: 241327
URL: http://svn.freebsd.org/changeset/base/241327

Log:
  MFC 239440,239519:
  Refine the changes made in r208212 to avoid bogus failures from
  if_delmulti() when clearing the configuration for a subinterface when
  the parent interface is being detached.  The current code was still
  triggering an assertion in if_delmulti() due to the parent interface being
  partially detached.  Fix this by not calling if_delmulti() at all if the
  parent interface is being detached.  Warn if if_delmulti() fails when the
  parent is not being detached (but similar to 208212, still proceed with
  tearing down the vlan state).

Modified:
  stable/9/sys/net/if_vlan.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/net/if_vlan.c
==============================================================================
--- stable/9/sys/net/if_vlan.c	Sun Oct  7 18:47:53 2012	(r241326)
+++ stable/9/sys/net/if_vlan.c	Sun Oct  7 18:57:29 2012	(r241327)
@@ -190,7 +190,7 @@ static	int vlan_setflags(struct ifnet *i
 static	int vlan_setmulti(struct ifnet *ifp);
 static	int vlan_transmit(struct ifnet *ifp, struct mbuf *m);
 static	void vlan_unconfig(struct ifnet *ifp);
-static	void vlan_unconfig_locked(struct ifnet *ifp);
+static	void vlan_unconfig_locked(struct ifnet *ifp, int departing);
 static	int vlan_config(struct ifvlan *ifv, struct ifnet *p, uint16_t tag);
 static	void vlan_link_state(struct ifnet *ifp);
 static	void vlan_capabilities(struct ifvlan *ifv);
@@ -575,7 +575,7 @@ vlan_ifdetach(void *arg __unused, struct
 #ifdef VLAN_ARRAY
 	for (i = 0; i < VLAN_ARRAY_SIZE; i++)
 		if ((ifv = ifp->if_vlantrunk->vlans[i])) {
-			vlan_unconfig_locked(ifv->ifv_ifp);
+			vlan_unconfig_locked(ifv->ifv_ifp, 1);
 			if (ifp->if_vlantrunk == NULL)
 				break;
 		}
@@ -583,7 +583,7 @@ vlan_ifdetach(void *arg __unused, struct
 restart:
 	for (i = 0; i < (1 << ifp->if_vlantrunk->hwidth); i++)
 		if ((ifv = LIST_FIRST(&ifp->if_vlantrunk->hash[i]))) {
-			vlan_unconfig_locked(ifv->ifv_ifp);
+			vlan_unconfig_locked(ifv->ifv_ifp, 1);
 			if (ifp->if_vlantrunk)
 				goto restart;	/* trunk->hwidth can change */
 			else
@@ -959,7 +959,7 @@ vlan_clone_create(struct if_clone *ifc, 
 		error = vlan_config(ifv, p, tag);
 		if (error != 0) {
 			/*
-			 * Since we've partialy failed, we need to back
+			 * Since we've partially failed, we need to back
 			 * out all the way, otherwise userland could get
 			 * confused.  Thus, we destroy the interface.
 			 */
@@ -1298,17 +1298,18 @@ vlan_unconfig(struct ifnet *ifp)
 {
 
 	VLAN_LOCK();
-	vlan_unconfig_locked(ifp);
+	vlan_unconfig_locked(ifp, 0);
 	VLAN_UNLOCK();
 }
 
 static void
-vlan_unconfig_locked(struct ifnet *ifp)
+vlan_unconfig_locked(struct ifnet *ifp, int departing)
 {
 	struct ifvlantrunk *trunk;
 	struct vlan_mc_entry *mc;
 	struct ifvlan *ifv;
 	struct ifnet  *parent;
+	int error;
 
 	VLAN_LOCK_ASSERT();
 
@@ -1328,14 +1329,21 @@ vlan_unconfig_locked(struct ifnet *ifp)
 		 */
 		while ((mc = SLIST_FIRST(&ifv->vlan_mc_listhead)) != NULL) {
 			/*
-			 * This may fail if the parent interface is
-			 * being detached.  Regardless, we should do a
-			 * best effort to free this interface as much
-			 * as possible as all callers expect vlan
-			 * destruction to succeed.
+			 * If the parent interface is being detached,
+			 * all its multicast addresses have already
+			 * been removed.  Warn about errors if
+			 * if_delmulti() does fail, but don't abort as
+			 * all callers expect vlan destruction to
+			 * succeed.
 			 */
-			(void)if_delmulti(parent,
-			    (struct sockaddr *)&mc->mc_addr);
+			if (!departing) {
+				error = if_delmulti(parent,
+				    (struct sockaddr *)&mc->mc_addr);
+				if (error)
+					if_printf(ifp,
+		    "Failed to delete multicast address from parent: %d\n",
+					    error);
+			}
 			SLIST_REMOVE_HEAD(&ifv->vlan_mc_listhead, mc_entries);
 			free(mc, M_VLAN);
 		}

From owner-svn-src-stable-9@FreeBSD.ORG  Sun Oct  7 21:32:42 2012
Return-Path: <owner-svn-src-stable-9@FreeBSD.ORG>
Delivered-To: svn-src-stable-9@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 8055A106566C;
	Sun,  7 Oct 2012 21:32:42 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 66DCF8FC08;
	Sun,  7 Oct 2012 21:32:42 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q97LWgmS074081;
	Sun, 7 Oct 2012 21:32:42 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id q97LWgDc074078;
	Sun, 7 Oct 2012 21:32:42 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201210072132.q97LWgDc074078@svn.freebsd.org>
From: John Baldwin <jhb@FreeBSD.org>
Date: Sun, 7 Oct 2012 21:32:42 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r241334 - stable/9/sys/conf
X-BeenThere: svn-src-stable-9@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 9-stable src tree
	<svn-src-stable-9.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-stable-9>, 
	<mailto:svn-src-stable-9-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-stable-9>
List-Post: <mailto:svn-src-stable-9@freebsd.org>
List-Help: <mailto:svn-src-stable-9-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-stable-9>, 
	<mailto:svn-src-stable-9-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 07 Oct 2012 21:32:42 -0000

Author: jhb
Date: Sun Oct  7 21:32:41 2012
New Revision: 241334
URL: http://svn.freebsd.org/changeset/base/241334

Log:
  MFC 239955-239957:
  Cleanups and fixes for building firmware modules into a kernel:
  - Add common rules for building firmware object files (NORMAL_FW to run
    uudecode, and NORMAL_FWO to use ld to build the .fwo file) and use those
    instead of explicit ld/uudecode invocations in sys/conf/files.  Apart from
    increasing readability, this makes it possible to adjust the flags used for
    firmware objects in one place.
  - Similar to how r171350 fixed linking of kernel modules containing
    firmware objects by adding --no-warn-mismatch to the linker flags,
    add --no-warn-mismatch when linking firmware objects (*.fwo) as
    well as to the link of the main kernel file.  This permits firmware
    modules to be statically linked into an ia64 kernel.

Modified:
  stable/9/sys/conf/files
  stable/9/sys/conf/kern.pre.mk
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/conf/   (props changed)

Modified: stable/9/sys/conf/files
==============================================================================
--- stable/9/sys/conf/files	Sun Oct  7 20:36:46 2012	(r241333)
+++ stable/9/sys/conf/files	Sun Oct  7 21:32:41 2012	(r241334)
@@ -1163,12 +1163,12 @@ ipwbssfw.c			optional ipwbssfw | ipwfw		
 	clean		"ipwbssfw.c"
 ipw_bss.fwo			optional ipwbssfw | ipwfw		\
 	dependency	"ipw_bss.fw"					\
-	compile-with	"${LD} -b binary -d -warn-common -r -d -o ${.TARGET} ipw_bss.fw" \
+	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"ipw_bss.fwo"
 ipw_bss.fw			optional ipwbssfw | ipwfw		\
 	dependency	"$S/contrib/dev/ipw/ipw2100-1.3.fw.uu"		\
-	compile-with	"uudecode -o ${.TARGET} $S/contrib/dev/ipw/ipw2100-1.3.fw.uu" \
+	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"ipw_bss.fw"
 ipwibssfw.c			optional ipwibssfw | ipwfw		\
@@ -1177,12 +1177,12 @@ ipwibssfw.c			optional ipwibssfw | ipwfw
 	clean		"ipwibssfw.c"
 ipw_ibss.fwo			optional ipwibssfw | ipwfw		\
 	dependency	"ipw_ibss.fw"					\
-	compile-with	"${LD} -b binary -d -warn-common -r -d -o ${.TARGET} ipw_ibss.fw" \
+	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"ipw_ibss.fwo"
 ipw_ibss.fw			optional ipwibssfw | ipwfw		\
 	dependency	"$S/contrib/dev/ipw/ipw2100-1.3-i.fw.uu"	\
-	compile-with	"uudecode -o ${.TARGET} $S/contrib/dev/ipw/ipw2100-1.3-i.fw.uu" \
+	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"ipw_ibss.fw"
 ipwmonitorfw.c			optional ipwmonitorfw | ipwfw		\
@@ -1191,12 +1191,12 @@ ipwmonitorfw.c			optional ipwmonitorfw |
 	clean		"ipwmonitorfw.c"
 ipw_monitor.fwo			optional ipwmonitorfw | ipwfw		\
 	dependency	"ipw_monitor.fw"				\
-	compile-with	"${LD} -b binary -d -warn-common -r -d -o ${.TARGET} ipw_monitor.fw" \
+	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"ipw_monitor.fwo"
 ipw_monitor.fw			optional ipwmonitorfw | ipwfw		\
 	dependency	"$S/contrib/dev/ipw/ipw2100-1.3-p.fw.uu"	\
-	compile-with	"uudecode -o ${.TARGET} $S/contrib/dev/ipw/ipw2100-1.3-p.fw.uu" \
+	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"ipw_monitor.fw"
 dev/iscsi/initiator/iscsi.c	optional iscsi_initiator scbus
@@ -1219,12 +1219,12 @@ iwibssfw.c			optional iwibssfw | iwifw		
 	clean		"iwibssfw.c"
 iwi_bss.fwo			optional iwibssfw | iwifw		\
 	dependency	"iwi_bss.fw"					\
-	compile-with	"${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwi_bss.fw" \
+	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"iwi_bss.fwo"
 iwi_bss.fw			optional iwibssfw | iwifw		\
 	dependency	"$S/contrib/dev/iwi/ipw2200-bss.fw.uu"		\
-	compile-with	"uudecode -o ${.TARGET} $S/contrib/dev/iwi/ipw2200-bss.fw.uu" \
+	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"iwi_bss.fw"
 iwiibssfw.c			optional iwiibssfw | iwifw		\
@@ -1233,12 +1233,12 @@ iwiibssfw.c			optional iwiibssfw | iwifw
 	clean		"iwiibssfw.c"
 iwi_ibss.fwo			optional iwiibssfw | iwifw		\
 	dependency	"iwi_ibss.fw"					\
-	compile-with	"${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwi_ibss.fw" \
+	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"iwi_ibss.fwo"
 iwi_ibss.fw			optional iwiibssfw | iwifw		\
 	dependency	"$S/contrib/dev/iwi/ipw2200-ibss.fw.uu"		\
-	compile-with	"uudecode -o ${.TARGET} $S/contrib/dev/iwi/ipw2200-ibss.fw.uu" \
+	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"iwi_ibss.fw"
 iwimonitorfw.c			optional iwimonitorfw | iwifw		\
@@ -1247,12 +1247,12 @@ iwimonitorfw.c			optional iwimonitorfw |
 	clean		"iwimonitorfw.c"
 iwi_monitor.fwo			optional iwimonitorfw | iwifw		\
 	dependency	"iwi_monitor.fw"				\
-	compile-with	"${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwi_monitor.fw" \
+	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"iwi_monitor.fwo"
 iwi_monitor.fw			optional iwimonitorfw | iwifw		\
 	dependency	"$S/contrib/dev/iwi/ipw2200-sniffer.fw.uu"	\
-	compile-with	"uudecode -o ${.TARGET} $S/contrib/dev/iwi/ipw2200-sniffer.fw.uu" \
+	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"iwi_monitor.fw"
 dev/iwn/if_iwn.c		optional iwn
@@ -1262,12 +1262,12 @@ iwn1000fw.c			optional iwn1000fw | iwnfw
 	clean		"iwn1000fw.c"
 iwn1000fw.fwo			optional iwn1000fw | iwnfw		\
 	dependency	"iwn1000.fw"					\
-	compile-with	"${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwn1000.fw" \
+	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"iwn1000fw.fwo"
 iwn1000.fw			optional iwn1000fw | iwnfw		\
 	dependency	"$S/contrib/dev/iwn/iwlwifi-1000-39.31.5.1.fw.uu" \
-	compile-with	"uudecode -o ${.TARGET} $S/contrib/dev/iwn/iwlwifi-1000-39.31.5.1.fw.uu" \
+	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"iwn1000.fw"
 iwn4965fw.c			optional iwn4965fw | iwnfw		\
@@ -1276,12 +1276,12 @@ iwn4965fw.c			optional iwn4965fw | iwnfw
 	clean		"iwn4965fw.c"
 iwn4965fw.fwo			optional iwn4965fw | iwnfw		\
 	dependency	"iwn4965.fw"					\
-	compile-with	"${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwn4965.fw" \
+	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"iwn4965fw.fwo"
 iwn4965.fw			optional iwn4965fw | iwnfw		\
 	dependency	"$S/contrib/dev/iwn/iwlwifi-4965-228.61.2.24.fw.uu" \
-	compile-with	"uudecode -o ${.TARGET} $S/contrib/dev/iwn/iwlwifi-4965-228.61.2.24.fw.uu" \
+	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"iwn4965.fw"
 iwn5000fw.c			optional iwn5000fw | iwnfw		\
@@ -1290,12 +1290,12 @@ iwn5000fw.c			optional iwn5000fw | iwnfw
 	clean		"iwn5000fw.c"
 iwn5000fw.fwo		optional iwn5000fw | iwnfw			\
 	dependency	"iwn5000.fw"					\
-	compile-with	"${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwn5000.fw" \
+	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"iwn5000fw.fwo"
 iwn5000.fw			optional iwn5000fw | iwnfw		\
 	dependency	"$S/contrib/dev/iwn/iwlwifi-5000-8.83.5.1.fw.uu" \
-	compile-with	"uudecode -o ${.TARGET} $S/contrib/dev/iwn/iwlwifi-5000-8.83.5.1.fw.uu"	\
+	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"iwn5000.fw"
 iwn5150fw.c			optional iwn5150fw | iwnfw		\
@@ -1304,12 +1304,12 @@ iwn5150fw.c			optional iwn5150fw | iwnfw
 	clean		"iwn5150fw.c"
 iwn5150fw.fwo			optional iwn5150fw | iwnfw		\
 	dependency	"iwn5150.fw"					\
-	compile-with	"${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwn5150.fw" \
+	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"iwn5150fw.fwo"
 iwn5150.fw			optional iwn5150fw | iwnfw		\
 	dependency	"$S/contrib/dev/iwn/iwlwifi-5150-8.24.2.2.fw.uu"\
-	compile-with	"uudecode -o ${.TARGET} $S/contrib/dev/iwn/iwlwifi-5150-8.24.2.2.fw.uu" \
+	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"iwn5150.fw"
 iwn6000fw.c			optional iwn6000fw | iwnfw		\
@@ -1318,12 +1318,12 @@ iwn6000fw.c			optional iwn6000fw | iwnfw
 	clean		"iwn6000fw.c"
 iwn6000fw.fwo			optional iwn6000fw | iwnfw		\
 	dependency	"iwn6000.fw"					\
-	compile-with	"${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwn6000.fw" \
+	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"iwn6000fw.fwo"
 iwn6000.fw			optional iwn6000fw | iwnfw		\
 	dependency	"$S/contrib/dev/iwn/iwlwifi-6000-9.221.4.1.fw.uu" \
-	compile-with	"uudecode -o ${.TARGET} $S/contrib/dev/iwn/iwlwifi-6000-9.221.4.1.fw.uu" \
+	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"iwn6000.fw"
 iwn6000g2afw.c			optional iwn6000g2afw | iwnfw		\
@@ -1332,12 +1332,12 @@ iwn6000g2afw.c			optional iwn6000g2afw |
 	clean		"iwn6000g2afw.c"
 iwn6000g2afw.fwo		optional iwn6000g2afw | iwnfw		\
 	dependency	"iwn6000g2a.fw"					\
-	compile-with	"${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwn6000g2a.fw" \
+	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"iwn6000g2afw.fwo"
 iwn6000g2a.fw			optional iwn6000g2afw | iwnfw		\
 	dependency	"$S/contrib/dev/iwn/iwlwifi-6000g2a-17.168.5.2.fw.uu" \
-	compile-with	"uudecode -o ${.TARGET} $S/contrib/dev/iwn/iwlwifi-6000g2a-17.168.5.2.fw.uu" \
+	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"iwn6000g2a.fw"
 iwn6000g2bfw.c			optional iwn6000g2bfw | iwnfw		\
@@ -1346,12 +1346,12 @@ iwn6000g2bfw.c			optional iwn6000g2bfw |
 	clean		"iwn6000g2bfw.c"
 iwn6000g2bfw.fwo		optional iwn6000g2bfw | iwnfw		\
 	dependency	"iwn6000g2b.fw"					\
-	compile-with	"${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwn6000g2b.fw" \
+	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"iwn6000g2bfw.fwo"
 iwn6000g2b.fw			optional iwn6000g2bfw | iwnfw		\
 	dependency	"$S/contrib/dev/iwn/iwlwifi-6000g2b-17.168.5.2.fw.uu" \
-	compile-with	"uudecode -o ${.TARGET} $S/contrib/dev/iwn/iwlwifi-6000g2b-17.168.5.2.fw.uu" \
+	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"iwn6000g2b.fw"
 iwn6050fw.c			optional iwn6050fw | iwnfw		\
@@ -1360,12 +1360,12 @@ iwn6050fw.c			optional iwn6050fw | iwnfw
 	clean		"iwn6050fw.c"
 iwn6050fw.fwo			optional iwn6050fw | iwnfw		\
 	dependency	"iwn6050.fw"					\
-	compile-with	"${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwn6050.fw" \
+	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"iwn6050fw.fwo"
 iwn6050.fw			optional iwn6050fw | iwnfw		\
 	dependency	"$S/contrib/dev/iwn/iwlwifi-6050-41.28.5.1.fw.uu" \
-	compile-with	"uudecode -o ${.TARGET} $S/contrib/dev/iwn/iwlwifi-6050-41.28.5.1.fw.uu" \
+	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"iwn6050.fw"
 dev/ixgb/if_ixgb.c		optional ixgb
@@ -1494,22 +1494,22 @@ mwlfw.c				optional mwlfw				\
 	clean		"mwlfw.c"
 mw88W8363.fwo		optional mwlfw					\
 	dependency	"mw88W8363.fw"					\
-	compile-with	"${LD} -b binary -d -warn-common -r -d -o ${.TARGET} mw88W8363.fw" \
+	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"mw88W8363.fwo"
 mw88W8363.fw		optional mwlfw					\
 	dependency	"$S/contrib/dev/mwl/mw88W8363.fw.uu"		\
-	compile-with	"uudecode -o ${.TARGET} $S/contrib/dev/mwl/mw88W8363.fw.uu"	\
+	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"mw88W8363.fw"
 mwlboot.fwo		optional mwlfw					\
 	dependency	"mwlboot.fw"					\
-	compile-with	"${LD} -b binary -d -warn-common -r -d -o ${.TARGET} mwlboot.fw" \
+	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"mwlboot.fwo"
 mwlboot.fw		optional mwlfw					\
 	dependency	"$S/contrib/dev/mwl/mwlboot.fw.uu"		\
-	compile-with	"uudecode -o ${.TARGET} $S/contrib/dev/mwl/mwlboot.fw.uu"	\
+	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"mwlboot.fw"
 dev/mxge/if_mxge.c		optional mxge pci
@@ -1626,12 +1626,12 @@ rt2561fw.c			optional rt2561fw | ralfw		
 	clean		"rt2561fw.c"
 rt2561fw.fwo			optional rt2561fw | ralfw		\
 	dependency	"rt2561.fw"					\
-	compile-with	"${LD} -b binary -d -warn-common -r -d -o ${.TARGET} rt2561.fw" \
+	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"rt2561fw.fwo"
 rt2561.fw			optional rt2561fw | ralfw		\
 	dependency	"$S/contrib/dev/ral/rt2561.fw.uu"		\
-	compile-with	"uudecode -o ${.TARGET} $S/contrib/dev/ral/rt2561.fw.uu" \
+	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"rt2561.fw"
 rt2561sfw.c			optional rt2561sfw | ralfw		\
@@ -1640,12 +1640,12 @@ rt2561sfw.c			optional rt2561sfw | ralfw
 	clean		"rt2561sfw.c"
 rt2561sfw.fwo			optional rt2561sfw | ralfw		\
 	dependency	"rt2561s.fw"					\
-	compile-with	"${LD} -b binary -d -warn-common -r -d -o ${.TARGET} rt2561s.fw" \
+	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"rt2561sfw.fwo"
 rt2561s.fw			optional rt2561sfw | ralfw		\
 	dependency	"$S/contrib/dev/ral/rt2561s.fw.uu"		\
-	compile-with	"uudecode -o ${.TARGET} $S/contrib/dev/ral/rt2561s.fw.uu"	\
+	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"rt2561s.fw"
 rt2661fw.c			optional rt2661fw | ralfw		\
@@ -1654,12 +1654,12 @@ rt2661fw.c			optional rt2661fw | ralfw		
 	clean		"rt2661fw.c"
 rt2661fw.fwo			optional rt2661fw | ralfw		\
 	dependency	"rt2661.fw"					\
-	compile-with	"${LD} -b binary -d -warn-common -r -d -o ${.TARGET} rt2661.fw" \
+	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"rt2661fw.fwo"
 rt2661.fw			optional rt2661fw | ralfw		\
 	dependency	"$S/contrib/dev/ral/rt2661.fw.uu"		\
-	compile-with	"uudecode -o ${.TARGET} $S/contrib/dev/ral/rt2661.fw.uu"	\
+	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"rt2661.fw"
 rt2860fw.c			optional rt2860fw | ralfw		\
@@ -1668,12 +1668,12 @@ rt2860fw.c			optional rt2860fw | ralfw		
 	clean		"rt2860fw.c"
 rt2860fw.fwo			optional rt2860fw | ralfw		\
 	dependency	"rt2860.fw"					\
-	compile-with	"${LD} -b binary -d -warn-common -r -d -o ${.TARGET} rt2860.fw" \
+	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"rt2860fw.fwo"
 rt2860.fw			optional rt2860fw | ralfw		\
 	dependency	"$S/contrib/dev/ral/rt2860.fw.uu"		\
-	compile-with	"uudecode -o ${.TARGET} $S/contrib/dev/ral/rt2860.fw.uu"	\
+	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"rt2860.fw"
 dev/random/harvest.c		standard
@@ -1958,12 +1958,12 @@ runfw.c				optional runfw							\
 	clean		"runfw.c"
 runfw.fwo			optional runfw							\
 	dependency	"runfw"									\
-	compile-with	"${LD} -b binary -d -warn-common -r -d -o ${.TARGET} runfw"		\
+	compile-with	"${NORMAL_FWO}"								\
 	no-implicit-rule									\
 	clean		"runfw.fwo"
 runfw				optional runfw							\
 	dependency	"$S/contrib/dev/run/rt2870.fw.uu"					\
-	compile-with	"uudecode -o ${.TARGET} $S/contrib/dev/run/rt2870.fw.uu"		\
+	compile-with	"${NORMAL_FW}"								\
 	no-obj no-implicit-rule									\
 	clean		"runfw"
 dev/usb/wlan/if_uath.c		optional uath
@@ -2071,12 +2071,12 @@ wpifw.c			optional wpifw					\
 	clean		"wpifw.c"
 wpifw.fwo			optional wpifw				\
 	dependency	"wpi.fw"					\
-	compile-with	"${LD} -b binary -d -warn-common -r -d -o ${.TARGET} wpi.fw" \
+	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
 	clean		"wpifw.fwo"
 wpi.fw			optional wpifw					\
 	dependency	"$S/contrib/dev/wpi/iwlwifi-3945-15.32.2.9.fw.uu"	\
-	compile-with	"uudecode -o ${.TARGET} $S/contrib/dev/wpi/iwlwifi-3945-15.32.2.9.fw.uu"	\
+	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"wpi.fw"
 dev/xe/if_xe.c			optional xe

Modified: stable/9/sys/conf/kern.pre.mk
==============================================================================
--- stable/9/sys/conf/kern.pre.mk	Sun Oct  7 20:36:46 2012	(r241333)
+++ stable/9/sys/conf/kern.pre.mk	Sun Oct  7 21:32:41 2012	(r241334)
@@ -131,6 +131,10 @@ NORMAL_C_NOWERROR= ${CC} -c ${CFLAGS} ${
 NORMAL_M= ${AWK} -f $S/tools/makeobjops.awk ${.IMPSRC} -c ; \
 	  ${CC} -c ${CFLAGS} ${WERROR} ${PROF} ${.PREFIX}.c
 
+NORMAL_FW= uudecode -o ${.TARGET} ${.ALLSRC}
+NORMAL_FWO= ${LD} -b binary --no-warn-mismatch -d -warn-common -r \
+	-o ${.TARGET} ${.ALLSRC:M*.fw}
+
 NORMAL_CTFCONVERT= [ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || \
 		   ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
 
@@ -151,7 +155,7 @@ SYSTEM_OBJS= locore.o ${MDOBJS} ${OBJS}
 SYSTEM_OBJS+= ${SYSTEM_CFILES:.c=.o}
 SYSTEM_OBJS+= hack.So
 SYSTEM_CTFMERGE= [ -z "${CTFMERGE}" -o -n "${NO_CTF}" ] || ${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${SYSTEM_OBJS} vers.o
-SYSTEM_LD= @${LD} -Bdynamic -T ${LDSCRIPT} \
+SYSTEM_LD= @${LD} -Bdynamic -T ${LDSCRIPT} --no-warn-mismatch \
 	-warn-common -export-dynamic -dynamic-linker /red/herring \
 	-o ${.TARGET} -X ${SYSTEM_OBJS} vers.o
 SYSTEM_LD_TAIL= @${OBJCOPY} --strip-symbol gcc2_compiled. ${.TARGET} ; \

