From owner-svn-src-projects@FreeBSD.ORG  Sun Jan  4 17:27:00 2009
Return-Path: <owner-svn-src-projects@FreeBSD.ORG>
Delivered-To: svn-src-projects@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2F78D106567A;
	Sun,  4 Jan 2009 17:27:00 +0000 (UTC)
	(envelope-from lulf@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1D5798FC0C;
	Sun,  4 Jan 2009 17:27:00 +0000 (UTC)
	(envelope-from lulf@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n04HQxVE063799;
	Sun, 4 Jan 2009 17:26:59 GMT (envelope-from lulf@svn.freebsd.org)
Received: (from lulf@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n04HQxHj063796;
	Sun, 4 Jan 2009 17:26:59 GMT (envelope-from lulf@svn.freebsd.org)
Message-Id: <200901041726.n04HQxHj063796@svn.freebsd.org>
From: Ulf Lilleengen <lulf@FreeBSD.org>
Date: Sun, 4 Jan 2009 17:26:59 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-projects@freebsd.org
X-SVN-Group: projects
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r186741 - projects/csup_cvsmode/contrib/csup
X-BeenThere: svn-src-projects@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the src &quot; projects&quot;
	tree" <svn-src-projects.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
	<mailto:svn-src-projects-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-projects>
List-Post: <mailto:svn-src-projects@freebsd.org>
List-Help: <mailto:svn-src-projects-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
	<mailto:svn-src-projects-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 04 Jan 2009 17:27:00 -0000

Author: lulf
Date: Sun Jan  4 17:26:59 2009
New Revision: 186741
URL: http://svn.freebsd.org/changeset/base/186741

Log:
  - Try to match style(9).
  - Remove old comments.

Modified:
  projects/csup_cvsmode/contrib/csup/detailer.c
  projects/csup_cvsmode/contrib/csup/rcsfile.c
  projects/csup_cvsmode/contrib/csup/updater.c

Modified: projects/csup_cvsmode/contrib/csup/detailer.c
==============================================================================
--- projects/csup_cvsmode/contrib/csup/detailer.c	Sun Jan  4 15:56:49 2009	(r186740)
+++ projects/csup_cvsmode/contrib/csup/detailer.c	Sun Jan  4 17:26:59 2009	(r186741)
@@ -532,7 +532,7 @@ detailer_checkrcsattr(struct detailer *d
 	char *attr, *path;
 	int error;
 
-	/* 
+	/*
 	 * I don't think we can use the status file, since it only records file
 	 * attributes in cvsmode.
 	 */
@@ -572,7 +572,7 @@ detailer_send_details(struct detailer *d
 	int error;
 	size_t len;
 
-       /* 
+       /*
         * Try to check if the file exists either live or dead to see if we can
         * edit it and put it live or dead, rather than receiving the entire
         * file.

Modified: projects/csup_cvsmode/contrib/csup/rcsfile.c
==============================================================================
--- projects/csup_cvsmode/contrib/csup/rcsfile.c	Sun Jan  4 15:56:49 2009	(r186740)
+++ projects/csup_cvsmode/contrib/csup/rcsfile.c	Sun Jan  4 17:26:59 2009	(r186741)
@@ -123,7 +123,6 @@ struct rcsfile {
 	struct branch *trunk; /* The tip delta. */
 
 	LIST_HEAD(, delta) deltatable;
-	LIST_HEAD(, delta) deltatable_dates;
 
 	char *desc;
 };
@@ -144,7 +143,6 @@ static struct stream 	*rcsfile_getdeltat
 static void		 rcsdelta_writestring(char *, size_t, struct stream *);
 static void		 rcsdelta_insertbranch(struct delta *, struct branch *);
 
-
 /* Space formatting of RCS file. */
 const char *head_space = "\t";
 const char *branch_space = "\t";
@@ -408,12 +406,6 @@ rcsfile_write(struct rcsfile *rf, struct
 	stream_printf(dest, "desc\n@@");
 	d = LIST_FIRST(&rf->trunk->deltalist);
 
-	/* 
-	 * XXX: We do not take as much care as cvsup to cope with hand-hacked
-	 * RCS-files, and therefore we'll just let them be updated. If having
-	 * them correct is important, it will be catched by the checksum anyway.
-	 */
-
 	/* Write out deltatexts. */
 	error = rcsfile_write_deltatext(rf, dest);
 	stream_printf(dest, "\n");
@@ -815,10 +807,6 @@ rcsfile_freedelta(struct delta *d)
 		buf_free(d->text);
 
 	/* Free all subbranches of a delta. */
-	/* XXX: Is this ok? Since the branchpoint is removed, there is no good
-	 * reason for the branch to exists, but we might still have deltas in
-	 * these branches.
-	 */
 	while (!LIST_EMPTY(&d->branchlist)) {
 		b = LIST_FIRST(&d->branchlist);
 		LIST_REMOVE(b, branch_next);
@@ -903,7 +891,7 @@ rcsfile_deletetag(struct rcsfile *rf, ch
 	}
 }
 
-/* 
+/*
  * Searches the global deltalist for a delta.
  */
 struct delta *
@@ -925,38 +913,38 @@ rcsfile_setval(struct rcsfile *rf, int f
 	size_t len;
 
 	switch (field) {
-		case RCSFILE_HEAD:
-			if (rf->head != NULL)
-				free(rf->head);
-			rf->head = xstrdup(val);
+	case RCSFILE_HEAD:
+		if (rf->head != NULL)
+			free(rf->head);
+		rf->head = xstrdup(val);
 		break;
-		case RCSFILE_BRANCH:
-			if (rf->branch != NULL)
-				free(rf->branch);
-			rf->branch = (val == NULL) ? NULL : xstrdup(val);
+	case RCSFILE_BRANCH:
+		if (rf->branch != NULL)
+			free(rf->branch);
+		rf->branch = (val == NULL) ? NULL : xstrdup(val);
 		break;
-		case RCSFILE_STRICT:
-			if (val != NULL)
-				rf->strictlock = 1;
+	case RCSFILE_STRICT:
+		if (val != NULL)
+			rf->strictlock = 1;
 		break;
-		case RCSFILE_COMMENT:
-			if (rf->comment != NULL)
-				free(rf->comment);
-			rf->comment = xstrdup(val);
+	case RCSFILE_COMMENT:
+		if (rf->comment != NULL)
+			free(rf->comment);
+		rf->comment = xstrdup(val);
 		break;
-		case RCSFILE_EXPAND:
-			len = strlen(val) - 1;
-			val++;
-			val[len - 1] = '\0';
-			rf->expand = keyword_decode_expand(val);
+	case RCSFILE_EXPAND:
+		len = strlen(val) - 1;
+		val++;
+		val[len - 1] = '\0';
+		rf->expand = keyword_decode_expand(val);
 		break;
-		case RCSFILE_DESC:
-			if (rf->desc != NULL)
-				free(rf->desc);
-			rf->desc = xstrdup(val);
+	case RCSFILE_DESC:
+		if (rf->desc != NULL)
+			free(rf->desc);
+		rf->desc = xstrdup(val);
 		break;
-		default:
-			lprintf(-1, "Setting invalid RCSfile value.\n");
+	default:
+		lprintf(-1, "Setting invalid RCSfile value.\n");
 		break;
 	}
 }
@@ -1123,10 +1111,9 @@ rcsfile_importdelta(struct rcsfile *rf, 
 			rcsfile_insertdelta(b, d, 1);
 		else {
 			rcsfile_insertdelta(b, d, 0);
-			/* 
+			/*
 			 * On import we need to set the diffbase to our
 			 * branchpoint for writing out later.
-			 * XXX: this could perhaps be done at a better time.
 			 */
 			if (LIST_FIRST(&b->deltalist) == d) {
 				brev = rcsrev_prefix(d->revnum);

Modified: projects/csup_cvsmode/contrib/csup/updater.c
==============================================================================
--- projects/csup_cvsmode/contrib/csup/updater.c	Sun Jan  4 15:56:49 2009	(r186740)
+++ projects/csup_cvsmode/contrib/csup/updater.c	Sun Jan  4 17:26:59 2009	(r186741)
@@ -613,7 +613,7 @@ updater_docoll(struct updater *up, struc
 				return (error);
 			break;
 		case 'I':
-			/* 
+			/*
 			 * Create directory and add DirDown entry in status
 			 * file.
 			 */
@@ -661,7 +661,7 @@ updater_docoll(struct updater *up, struc
 			}
 			break;
 		case 'J':
-			/* 
+			/*
 			 * Set attributes of directory and update DirUp entry in
 			 * status file.
 			 */
@@ -802,7 +802,8 @@ updater_docoll(struct updater *up, struc
 			name = proto_get_ascii(&line);
 			attr = proto_get_ascii(&line);
 			pos  = proto_get_ascii(&line);
-			if (name == NULL || attr == NULL || pos == NULL || line != NULL)
+			if (name == NULL || attr == NULL || pos == NULL ||
+			    line != NULL)
 				return (UPDATER_ERR_PROTO);
 			error = fup_prepare(fup, name, 0);
 			fup->temppath = tempname(fup->destpath);
@@ -1050,7 +1051,7 @@ updater_setdirattrs(struct updater *up, 
 		    fup->temppath, fup->destpath, strerror(errno));
 		return (UPDATER_ERR_MSG);
 	}
-	/* 
+	/*
 	 * Now, make sure they were set and record what was set in the status
 	 * file.
 	 */

From owner-svn-src-projects@FreeBSD.ORG  Sun Jan  4 17:31:02 2009
Return-Path: <owner-svn-src-projects@FreeBSD.ORG>
Delivered-To: svn-src-projects@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 00B0A106566B;
	Sun,  4 Jan 2009 17:31:02 +0000 (UTC)
	(envelope-from lulf@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E272D8FC17;
	Sun,  4 Jan 2009 17:31:01 +0000 (UTC)
	(envelope-from lulf@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n04HV1KO064491;
	Sun, 4 Jan 2009 17:31:01 GMT (envelope-from lulf@svn.freebsd.org)
Received: (from lulf@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n04HV1fC064484;
	Sun, 4 Jan 2009 17:31:01 GMT (envelope-from lulf@svn.freebsd.org)
Message-Id: <200901041731.n04HV1fC064484@svn.freebsd.org>
From: Ulf Lilleengen <lulf@FreeBSD.org>
Date: Sun, 4 Jan 2009 17:31:01 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-projects@freebsd.org
X-SVN-Group: projects
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r186743 - projects/csup_cvsmode/contrib/csup
X-BeenThere: svn-src-projects@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the src &quot; projects&quot;
	tree" <svn-src-projects.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
	<mailto:svn-src-projects-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-projects>
List-Post: <mailto:svn-src-projects@freebsd.org>
List-Help: <mailto:svn-src-projects-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
	<mailto:svn-src-projects-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 04 Jan 2009 17:31:02 -0000

Author: lulf
Date: Sun Jan  4 17:31:01 2009
New Revision: 186743
URL: http://svn.freebsd.org/changeset/base/186743

Log:
  - Update copyright.

Modified:
  projects/csup_cvsmode/contrib/csup/rcsfile.c
  projects/csup_cvsmode/contrib/csup/rcsfile.h
  projects/csup_cvsmode/contrib/csup/rcsparse.c
  projects/csup_cvsmode/contrib/csup/rcsparse.h
  projects/csup_cvsmode/contrib/csup/rcstokenizer.l
  projects/csup_cvsmode/contrib/csup/rsyncfile.c
  projects/csup_cvsmode/contrib/csup/rsyncfile.h

Modified: projects/csup_cvsmode/contrib/csup/rcsfile.c
==============================================================================
--- projects/csup_cvsmode/contrib/csup/rcsfile.c	Sun Jan  4 17:27:11 2009	(r186742)
+++ projects/csup_cvsmode/contrib/csup/rcsfile.c	Sun Jan  4 17:31:01 2009	(r186743)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2007-2008, Ulf Lilleengen <lulf@FreeBSD.org>
+ * Copyright (c) 2007-2009, Ulf Lilleengen <lulf@FreeBSD.org>
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without

Modified: projects/csup_cvsmode/contrib/csup/rcsfile.h
==============================================================================
--- projects/csup_cvsmode/contrib/csup/rcsfile.h	Sun Jan  4 17:27:11 2009	(r186742)
+++ projects/csup_cvsmode/contrib/csup/rcsfile.h	Sun Jan  4 17:31:01 2009	(r186743)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2007-2008, Ulf Lilleengen <lulf@FreeBSD.org>
+ * Copyright (c) 2007-2009, Ulf Lilleengen <lulf@FreeBSD.org>
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without

Modified: projects/csup_cvsmode/contrib/csup/rcsparse.c
==============================================================================
--- projects/csup_cvsmode/contrib/csup/rcsparse.c	Sun Jan  4 17:27:11 2009	(r186742)
+++ projects/csup_cvsmode/contrib/csup/rcsparse.c	Sun Jan  4 17:31:01 2009	(r186743)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2008, Ulf Lilleengen <lulf@FreeBSD.org>
+ * Copyright (c) 2008-2009, Ulf Lilleengen <lulf@FreeBSD.org>
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without

Modified: projects/csup_cvsmode/contrib/csup/rcsparse.h
==============================================================================
--- projects/csup_cvsmode/contrib/csup/rcsparse.h	Sun Jan  4 17:27:11 2009	(r186742)
+++ projects/csup_cvsmode/contrib/csup/rcsparse.h	Sun Jan  4 17:31:01 2009	(r186743)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2008, Ulf Lilleengen <lulf@FreeBSD.org>
+ * Copyright (c) 2008-2009, Ulf Lilleengen <lulf@FreeBSD.org>
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without

Modified: projects/csup_cvsmode/contrib/csup/rcstokenizer.l
==============================================================================
--- projects/csup_cvsmode/contrib/csup/rcstokenizer.l	Sun Jan  4 17:27:11 2009	(r186742)
+++ projects/csup_cvsmode/contrib/csup/rcstokenizer.l	Sun Jan  4 17:31:01 2009	(r186743)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2007-2008, Ulf Lilleengen <lulf@FreeBSD.org>
+ * Copyright (c) 2007-2009, Ulf Lilleengen <lulf@FreeBSD.org>
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without

Modified: projects/csup_cvsmode/contrib/csup/rsyncfile.c
==============================================================================
--- projects/csup_cvsmode/contrib/csup/rsyncfile.c	Sun Jan  4 17:27:11 2009	(r186742)
+++ projects/csup_cvsmode/contrib/csup/rsyncfile.c	Sun Jan  4 17:31:01 2009	(r186743)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2008, Ulf Lilleengen <lulf@FreeBSD.org>
+ * Copyright (c) 2008-2009, Ulf Lilleengen <lulf@FreeBSD.org>
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without

Modified: projects/csup_cvsmode/contrib/csup/rsyncfile.h
==============================================================================
--- projects/csup_cvsmode/contrib/csup/rsyncfile.h	Sun Jan  4 17:27:11 2009	(r186742)
+++ projects/csup_cvsmode/contrib/csup/rsyncfile.h	Sun Jan  4 17:31:01 2009	(r186743)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2008, Ulf Lilleengen <lulf@FreeBSD.org>
+ * Copyright (c) 2008-2009, Ulf Lilleengen <lulf@FreeBSD.org>
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without

From owner-svn-src-projects@FreeBSD.ORG  Sun Jan  4 18:18:59 2009
Return-Path: <owner-svn-src-projects@FreeBSD.ORG>
Delivered-To: svn-src-projects@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E41C4106566B;
	Sun,  4 Jan 2009 18:18:59 +0000 (UTC)
	(envelope-from lulf@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D2FD58FC08;
	Sun,  4 Jan 2009 18:18:59 +0000 (UTC)
	(envelope-from lulf@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n04IIxIM070903;
	Sun, 4 Jan 2009 18:18:59 GMT (envelope-from lulf@svn.freebsd.org)
Received: (from lulf@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n04IIxOk070902;
	Sun, 4 Jan 2009 18:18:59 GMT (envelope-from lulf@svn.freebsd.org)
Message-Id: <200901041818.n04IIxOk070902@svn.freebsd.org>
From: Ulf Lilleengen <lulf@FreeBSD.org>
Date: Sun, 4 Jan 2009 18:18:59 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-projects@freebsd.org
X-SVN-Group: projects
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r186744 - projects/csup_cvsmode/contrib/csup
X-BeenThere: svn-src-projects@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the src &quot; projects&quot;
	tree" <svn-src-projects.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
	<mailto:svn-src-projects-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-projects>
List-Post: <mailto:svn-src-projects@freebsd.org>
List-Help: <mailto:svn-src-projects-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
	<mailto:svn-src-projects-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 04 Jan 2009 18:19:00 -0000

Author: lulf
Date: Sun Jan  4 18:18:59 2009
New Revision: 186744
URL: http://svn.freebsd.org/changeset/base/186744

Log:
  - Sort children branches by revision number rather than by date since a few RCS
    files have the wrong date.

Modified:
  projects/csup_cvsmode/contrib/csup/rcsfile.c

Modified: projects/csup_cvsmode/contrib/csup/rcsfile.c
==============================================================================
--- projects/csup_cvsmode/contrib/csup/rcsfile.c	Sun Jan  4 17:31:01 2009	(r186743)
+++ projects/csup_cvsmode/contrib/csup/rcsfile.c	Sun Jan  4 18:18:59 2009	(r186744)
@@ -1243,7 +1243,7 @@ rcsfile_insertdelta(struct branch *b, st
 		} else {
 			/* XXX: here we depend on the date being set, but it
 			 * should be before this is called anyway. */
-			if (rcsnum_cmp(d->revdate, d2->revdate) < 0) {
+			if (rcsnum_cmp(d->revnum, d2->revnum) < 0) {
 				LIST_INSERT_BEFORE(d2, d, delta_next);
 				return;
 			}

From owner-svn-src-projects@FreeBSD.ORG  Mon Jan  5 20:02:12 2009
Return-Path: <owner-svn-src-projects@FreeBSD.ORG>
Delivered-To: svn-src-projects@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D7B07106564A;
	Mon,  5 Jan 2009 20:02:12 +0000 (UTC)
	(envelope-from lulf@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id AD0CC8FC08;
	Mon,  5 Jan 2009 20:02:12 +0000 (UTC)
	(envelope-from lulf@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n05K2Cc0009427;
	Mon, 5 Jan 2009 20:02:12 GMT (envelope-from lulf@svn.freebsd.org)
Received: (from lulf@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n05K2C24009426;
	Mon, 5 Jan 2009 20:02:12 GMT (envelope-from lulf@svn.freebsd.org)
Message-Id: <200901052002.n05K2C24009426@svn.freebsd.org>
From: Ulf Lilleengen <lulf@FreeBSD.org>
Date: Mon, 5 Jan 2009 20:02:12 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-projects@freebsd.org
X-SVN-Group: projects
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r186788 - in projects: csup_cvsmode csup_wip
X-BeenThere: svn-src-projects@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the src &quot; projects&quot;
	tree" <svn-src-projects.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
	<mailto:svn-src-projects-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-projects>
List-Post: <mailto:svn-src-projects@freebsd.org>
List-Help: <mailto:svn-src-projects-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
	<mailto:svn-src-projects-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 05 Jan 2009 20:02:13 -0000

Author: lulf
Date: Mon Jan  5 20:02:12 2009
New Revision: 186788
URL: http://svn.freebsd.org/changeset/base/186788

Log:
  - Make the project name a bit more generic.

Added:
  projects/csup_wip/
     - copied from r186787, projects/csup_cvsmode/
Deleted:
  projects/csup_cvsmode/

From owner-svn-src-projects@FreeBSD.ORG  Tue Jan  6 19:52:40 2009
Return-Path: <owner-svn-src-projects@FreeBSD.ORG>
Delivered-To: svn-src-projects@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8E01C10656C1;
	Tue,  6 Jan 2009 19:52:40 +0000 (UTC)
	(envelope-from lulf@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 7C03B8FC0C;
	Tue,  6 Jan 2009 19:52:40 +0000 (UTC)
	(envelope-from lulf@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n06JqeNc040397;
	Tue, 6 Jan 2009 19:52:40 GMT (envelope-from lulf@svn.freebsd.org)
Received: (from lulf@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n06JqeAO040391;
	Tue, 6 Jan 2009 19:52:40 GMT (envelope-from lulf@svn.freebsd.org)
Message-Id: <200901061952.n06JqeAO040391@svn.freebsd.org>
From: Ulf Lilleengen <lulf@FreeBSD.org>
Date: Tue, 6 Jan 2009 19:52:40 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-projects@freebsd.org
X-SVN-Group: projects
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r186837 - projects/csup_wip/contrib/csup
X-BeenThere: svn-src-projects@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the src &quot; projects&quot;
	tree" <svn-src-projects.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
	<mailto:svn-src-projects-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-projects>
List-Post: <mailto:svn-src-projects@freebsd.org>
List-Help: <mailto:svn-src-projects-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
	<mailto:svn-src-projects-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 06 Jan 2009 19:52:41 -0000

Author: lulf
Date: Tue Jan  6 19:52:40 2009
New Revision: 186837
URL: http://svn.freebsd.org/changeset/base/186837

Log:
  - Add a handler for SIGINFO, which will print the collection, and the progress
    of updating the current collection.

Modified:
  projects/csup_wip/contrib/csup/config.c
  projects/csup_wip/contrib/csup/config.h
  projects/csup_wip/contrib/csup/lister.c
  projects/csup_wip/contrib/csup/status.c
  projects/csup_wip/contrib/csup/status.h
  projects/csup_wip/contrib/csup/updater.c

Modified: projects/csup_wip/contrib/csup/config.c
==============================================================================
--- projects/csup_wip/contrib/csup/config.c	Tue Jan  6 19:25:24 2009	(r186836)
+++ projects/csup_wip/contrib/csup/config.c	Tue Jan  6 19:52:40 2009	(r186837)
@@ -311,6 +311,7 @@ coll_new(struct coll *def)
 	new->co_accepts = pattlist_new();
 	new->co_refusals = pattlist_new();
 	new->co_attrignore = FA_DEV | FA_INODE;
+	new->co_numdone = 0;
 	return (new);
 }
 

Modified: projects/csup_wip/contrib/csup/config.h
==============================================================================
--- projects/csup_wip/contrib/csup/config.h	Tue Jan  6 19:25:24 2009	(r186836)
+++ projects/csup_wip/contrib/csup/config.h	Tue Jan  6 19:52:40 2009	(r186837)
@@ -93,6 +93,7 @@ struct coll {
 	int co_options;
 	mode_t co_umask;
 	struct keyword *co_keyword;
+	int co_numdone;
 	STAILQ_ENTRY(coll) co_next;
 };
 

Modified: projects/csup_wip/contrib/csup/lister.c
==============================================================================
--- projects/csup_wip/contrib/csup/lister.c	Tue Jan  6 19:25:24 2009	(r186836)
+++ projects/csup_wip/contrib/csup/lister.c	Tue Jan  6 19:52:40 2009	(r186837)
@@ -212,6 +212,7 @@ lister_coll(struct lister *l, struct col
 			}
 			break;
 		}
+		coll->co_numdone++;
 	}
 	if (ret == -1) {
 		l->errmsg = status_errmsg(st);

Modified: projects/csup_wip/contrib/csup/status.c
==============================================================================
--- projects/csup_wip/contrib/csup/status.c	Tue Jan  6 19:25:24 2009	(r186836)
+++ projects/csup_wip/contrib/csup/status.c	Tue Jan  6 19:52:40 2009	(r186837)
@@ -86,6 +86,7 @@ struct status {
 	int linenum;
 	int depth;
 	int dirty;
+	int numentries;
 };
 
 static void
@@ -521,11 +522,12 @@ struct status *
 status_open(struct coll *coll, time_t scantime, char **errmsg)
 {
 	struct status *st;
-	struct stream *file;
+	struct stream *file, *tmp;
 	struct fattr *fa;
 	char *destpath, *path;
-	int error, rv;
+	int error, isnew, rv;
 
+	isnew = access(path, F_OK);
 	path = coll_statuspath(coll);
 	file = stream_open_file(path, O_RDONLY);
 	if (file == NULL) {
@@ -536,6 +538,7 @@ status_open(struct coll *coll, time_t sc
 			return (NULL);
 		}
 		st = status_fromnull(path);
+		isnew = 1;
 	} else {
 		st = status_fromrd(path, file);
 		if (st == NULL) {
@@ -591,6 +594,17 @@ status_open(struct coll *coll, time_t sc
 			return (NULL);
 		}
 	}
+
+	/* Count the number of entries in the file. */
+	if (isnew) {
+		st->numentries = 0;
+		tmp = stream_open_file(path, O_RDONLY);
+		if (tmp == NULL)
+			return (st);
+		while (stream_getln(tmp, NULL) != NULL)
+			st->numentries++;
+		stream_close(tmp);
+	}
 	return (st);
 }
 
@@ -872,3 +886,9 @@ status_close(struct status *st, char **e
 bad:
 	status_free(st);
 }
+
+int
+status_numentries(struct status *st)
+{
+	return (st->numentries);
+}

Modified: projects/csup_wip/contrib/csup/status.h
==============================================================================
--- projects/csup_wip/contrib/csup/status.h	Tue Jan  6 19:25:24 2009	(r186836)
+++ projects/csup_wip/contrib/csup/status.h	Tue Jan  6 19:52:40 2009	(r186837)
@@ -68,5 +68,6 @@ int		 status_eof(struct status *);
 char		*status_errmsg(struct status *);
 int		 status_delete(struct status *, char *, int);
 void		 status_close(struct status *, char **);
+int		 status_numentries(struct status *);
 
 #endif /* !_STATUS_H_ */

Modified: projects/csup_wip/contrib/csup/updater.c
==============================================================================
--- projects/csup_wip/contrib/csup/updater.c	Tue Jan  6 19:25:24 2009	(r186836)
+++ projects/csup_wip/contrib/csup/updater.c	Tue Jan  6 19:52:40 2009	(r186837)
@@ -33,6 +33,7 @@
 #include <err.h>
 #include <errno.h>
 #include <fcntl.h>
+#include <signal.h>
 #include <stddef.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -85,6 +86,9 @@ struct updater {
 	int deletecount;
 };
 
+static struct file_update *curfup = NULL;
+static pthread_mutex_t fuplock;
+
 static struct file_update	*fup_new(struct coll *, struct status *);
 static int	 fup_prepare(struct file_update *, char *, int);
 static void	 fup_cleanup(struct file_update *);
@@ -117,6 +121,7 @@ int		 updater_append_file(struct updater
 		     off_t);
 static int	 updater_rsync(struct updater *, struct file_update *, size_t);
 static int	 updater_read_checkout(struct stream *, struct stream *);
+void		 updater_infohandler(int);
 
 static struct file_update *
 fup_new(struct coll *coll, struct status *st)
@@ -127,6 +132,7 @@ fup_new(struct coll *coll, struct status
 	memset(fup, 0, sizeof(*fup));
 	fup->coll = coll;
 	fup->st = st;
+	fup->coname = NULL;
 	return (fup);
 }
 
@@ -233,6 +239,8 @@ updater(void *arg)
 	up->rd = args->rd;
 	up->errmsg = NULL;
 	up->deletecount = 0;
+	pthread_mutex_init(&fuplock, NULL);
+	signal(SIGINFO, updater_infohandler);
 
 	error = updater_batch(up, 0);
 
@@ -316,8 +324,14 @@ updater_batch(struct updater *up, int is
 			return (UPDATER_ERR_MSG);
 		}
 		fup = fup_new(coll, st);
+		pthread_mutex_lock(&fuplock);
+		curfup = fup;
+		pthread_mutex_unlock(&fuplock);
 		error = updater_docoll(up, fup, isfixups);
 		status_close(st, &errmsg);
+		pthread_mutex_lock(&fuplock);
+		curfup = NULL;
+		pthread_mutex_unlock(&fuplock);
 		fup_free(fup);
 		if (errmsg != NULL) {
 			/* Discard previous error. */
@@ -2013,3 +2027,18 @@ bad:
 	free(buf);
 	return (error);
 }
+
+void
+updater_infohandler(int sig __unused)
+{
+	pthread_mutex_lock(&fuplock);
+	if (curfup != NULL) {
+		printf("Updating %s", curfup->coll->co_name);
+		if (status_numentries(curfup->st) > 0)
+			printf(" (%d%% done)", (int)
+			    (((double)curfup->coll->co_numdone * 100.0) /
+			     (double)status_numentries(curfup->st)));
+		printf("\n");
+	}
+	pthread_mutex_unlock(&fuplock);
+}

From owner-svn-src-projects@FreeBSD.ORG  Tue Jan  6 19:54:30 2009
Return-Path: <owner-svn-src-projects@FreeBSD.ORG>
Delivered-To: svn-src-projects@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2876410657F6;
	Tue,  6 Jan 2009 19:54:30 +0000 (UTC)
	(envelope-from lulf@freebsd.org)
Received: from bene1.itea.ntnu.no (bene1.itea.ntnu.no
	[IPv6:2001:700:300:3::56])
	by mx1.freebsd.org (Postfix) with ESMTP id A01E68FC30;
	Tue,  6 Jan 2009 19:54:29 +0000 (UTC)
	(envelope-from lulf@freebsd.org)
Received: from localhost (localhost [127.0.0.1])
	by bene1.itea.ntnu.no (Postfix) with ESMTP id 0ADD82401C;
	Tue,  6 Jan 2009 20:54:28 +0100 (CET)
Received: from carrot (unknown [IPv6:2001:700:300:3::184])
	by bene1.itea.ntnu.no (Postfix) with ESMTP id A99A02401E;
	Tue,  6 Jan 2009 20:54:27 +0100 (CET)
Date: Tue, 6 Jan 2009 21:54:25 +0100
From: Ulf Lilleengen <lulf@freebsd.org>
To: src-committers@freebsd.org, svn-src-projects@freebsd.org
Message-ID: <20090106205425.GA65058@carrot.lan>
References: <200901061952.n06JqeAO040391@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <200901061952.n06JqeAO040391@svn.freebsd.org>
User-Agent: Mutt/1.5.18 (2008-05-17)
X-Virus-Scanned: Debian amavisd-new at bene1.itea.ntnu.no
Cc: 
Subject: Re: svn commit: r186837 - projects/csup_wip/contrib/csup
X-BeenThere: svn-src-projects@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the src &quot; projects&quot;
	tree" <svn-src-projects.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
	<mailto:svn-src-projects-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-projects>
List-Post: <mailto:svn-src-projects@freebsd.org>
List-Help: <mailto:svn-src-projects-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
	<mailto:svn-src-projects-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 06 Jan 2009 19:54:32 -0000

On Tue, Jan 06, 2009 at 07:52:40PM +0000, Ulf Lilleengen wrote:
> Author: lulf
> Date: Tue Jan  6 19:52:40 2009
> New Revision: 186837
> URL: http://svn.freebsd.org/changeset/base/186837
> 
> Log:
>   - Add a handler for SIGINFO, which will print the collection, and the progress
>     of updating the current collection.
> 
Suggested by:	rdivacky

-- 
Ulf Lilleengen

From owner-svn-src-projects@FreeBSD.ORG  Wed Jan  7 11:54:00 2009
Return-Path: <owner-svn-src-projects@FreeBSD.ORG>
Delivered-To: svn-src-projects@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D5E33106564A;
	Wed,  7 Jan 2009 11:54:00 +0000 (UTC)
	(envelope-from lulf@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C34158FC0C;
	Wed,  7 Jan 2009 11:54:00 +0000 (UTC)
	(envelope-from lulf@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n07Bs0M0085003;
	Wed, 7 Jan 2009 11:54:00 GMT (envelope-from lulf@svn.freebsd.org)
Received: (from lulf@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n07Bs06u084998;
	Wed, 7 Jan 2009 11:54:00 GMT (envelope-from lulf@svn.freebsd.org)
Message-Id: <200901071154.n07Bs06u084998@svn.freebsd.org>
From: Ulf Lilleengen <lulf@FreeBSD.org>
Date: Wed, 7 Jan 2009 11:54:00 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-projects@freebsd.org
X-SVN-Group: projects
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r186858 - projects/csup_wip/contrib/csup
X-BeenThere: svn-src-projects@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the src &quot; projects&quot;
	tree" <svn-src-projects.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
	<mailto:svn-src-projects-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-projects>
List-Post: <mailto:svn-src-projects@freebsd.org>
List-Help: <mailto:svn-src-projects-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
	<mailto:svn-src-projects-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 07 Jan 2009 11:54:01 -0000

Author: lulf
Date: Wed Jan  7 11:54:00 2009
New Revision: 186858
URL: http://svn.freebsd.org/changeset/base/186858

Log:
  - Handle SIGINFO in a way that prevents calling of non async-signal safe
    functions.

Modified:
  projects/csup_wip/contrib/csup/config.c
  projects/csup_wip/contrib/csup/config.h
  projects/csup_wip/contrib/csup/lister.c
  projects/csup_wip/contrib/csup/updater.c
  projects/csup_wip/contrib/csup/updater.h

Modified: projects/csup_wip/contrib/csup/config.c
==============================================================================
--- projects/csup_wip/contrib/csup/config.c	Wed Jan  7 11:44:03 2009	(r186857)
+++ projects/csup_wip/contrib/csup/config.c	Wed Jan  7 11:54:00 2009	(r186858)
@@ -311,7 +311,6 @@ coll_new(struct coll *def)
 	new->co_accepts = pattlist_new();
 	new->co_refusals = pattlist_new();
 	new->co_attrignore = FA_DEV | FA_INODE;
-	new->co_numdone = 0;
 	return (new);
 }
 

Modified: projects/csup_wip/contrib/csup/config.h
==============================================================================
--- projects/csup_wip/contrib/csup/config.h	Wed Jan  7 11:44:03 2009	(r186857)
+++ projects/csup_wip/contrib/csup/config.h	Wed Jan  7 11:54:00 2009	(r186858)
@@ -93,7 +93,6 @@ struct coll {
 	int co_options;
 	mode_t co_umask;
 	struct keyword *co_keyword;
-	int co_numdone;
 	STAILQ_ENTRY(coll) co_next;
 };
 

Modified: projects/csup_wip/contrib/csup/lister.c
==============================================================================
--- projects/csup_wip/contrib/csup/lister.c	Wed Jan  7 11:44:03 2009	(r186857)
+++ projects/csup_wip/contrib/csup/lister.c	Wed Jan  7 11:54:00 2009	(r186858)
@@ -29,6 +29,7 @@
 #include <assert.h>
 #include <errno.h>
 #include <limits.h>
+#include <signal.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -68,6 +69,9 @@ static int	lister_dorcsfile(struct liste
 		    struct statusrec *);
 static int	lister_dorcsdead(struct lister *, struct coll *,
 		    struct statusrec *);
+void		 lister_infohandler(int);
+
+int printinfo = 0;
 
 void *
 lister(void *arg)
@@ -81,6 +85,7 @@ lister(void *arg)
 	l->config = args->config;
 	l->wr = args->wr;
 	l->errmsg = NULL;
+	signal(SIGINFO, lister_infohandler);
 	error = lister_batch(l);
 	switch (error) {
 	case LISTER_ERR_WRITE:
@@ -150,10 +155,11 @@ lister_coll(struct lister *l, struct col
 	struct statusrec *sr;
 	struct fattr *fa;
 	size_t i;
-	int depth, error, ret, prunedepth;
+	int depth, error, numdone, ret, prunedepth;
 
 	wr = l->wr;
 	depth = 0;
+	numdone = 0;
 	prunedepth = INT_MAX;
 	as = attrstack_new();
 	while ((ret = status_get(st, NULL, 0, 0, &sr)) == 1) {
@@ -212,7 +218,16 @@ lister_coll(struct lister *l, struct col
 			}
 			break;
 		}
-		coll->co_numdone++;
+		numdone++;
+		if (printinfo) {
+			printf("Updating %s", coll->co_name);
+			if (status_numentries(st) > 0)
+				printf(" (%d%% done)", (int)
+				    (((double)numdone * 100.0) /
+				    (double)status_numentries(st)));
+			printf("\n");
+			printinfo = 0;
+		}
 	}
 	if (ret == -1) {
 		l->errmsg = status_errmsg(st);
@@ -568,3 +583,9 @@ lister_dorcsdead(struct lister *l, struc
 		return (LISTER_ERR_WRITE);
 	return (0);
 }
+
+void
+lister_infohandler(int sig __unused)
+{
+	printinfo = 1;
+}

Modified: projects/csup_wip/contrib/csup/updater.c
==============================================================================
--- projects/csup_wip/contrib/csup/updater.c	Wed Jan  7 11:44:03 2009	(r186857)
+++ projects/csup_wip/contrib/csup/updater.c	Wed Jan  7 11:54:00 2009	(r186858)
@@ -33,7 +33,6 @@
 #include <err.h>
 #include <errno.h>
 #include <fcntl.h>
-#include <signal.h>
 #include <stddef.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -86,9 +85,6 @@ struct updater {
 	int deletecount;
 };
 
-static struct file_update *curfup = NULL;
-static pthread_mutex_t fuplock;
-
 static struct file_update	*fup_new(struct coll *, struct status *);
 static int	 fup_prepare(struct file_update *, char *, int);
 static void	 fup_cleanup(struct file_update *);
@@ -121,7 +117,6 @@ int		 updater_append_file(struct updater
 		     off_t);
 static int	 updater_rsync(struct updater *, struct file_update *, size_t);
 static int	 updater_read_checkout(struct stream *, struct stream *);
-void		 updater_infohandler(int);
 
 static struct file_update *
 fup_new(struct coll *coll, struct status *st)
@@ -132,7 +127,6 @@ fup_new(struct coll *coll, struct status
 	memset(fup, 0, sizeof(*fup));
 	fup->coll = coll;
 	fup->st = st;
-	fup->coname = NULL;
 	return (fup);
 }
 
@@ -239,8 +233,6 @@ updater(void *arg)
 	up->rd = args->rd;
 	up->errmsg = NULL;
 	up->deletecount = 0;
-	pthread_mutex_init(&fuplock, NULL);
-	signal(SIGINFO, updater_infohandler);
 
 	error = updater_batch(up, 0);
 
@@ -324,14 +316,8 @@ updater_batch(struct updater *up, int is
 			return (UPDATER_ERR_MSG);
 		}
 		fup = fup_new(coll, st);
-		pthread_mutex_lock(&fuplock);
-		curfup = fup;
-		pthread_mutex_unlock(&fuplock);
 		error = updater_docoll(up, fup, isfixups);
 		status_close(st, &errmsg);
-		pthread_mutex_lock(&fuplock);
-		curfup = NULL;
-		pthread_mutex_unlock(&fuplock);
 		fup_free(fup);
 		if (errmsg != NULL) {
 			/* Discard previous error. */
@@ -2027,18 +2013,3 @@ bad:
 	free(buf);
 	return (error);
 }
-
-void
-updater_infohandler(int sig __unused)
-{
-	pthread_mutex_lock(&fuplock);
-	if (curfup != NULL) {
-		printf("Updating %s", curfup->coll->co_name);
-		if (status_numentries(curfup->st) > 0)
-			printf(" (%d%% done)", (int)
-			    (((double)curfup->coll->co_numdone * 100.0) /
-			     (double)status_numentries(curfup->st)));
-		printf("\n");
-	}
-	pthread_mutex_unlock(&fuplock);
-}

Modified: projects/csup_wip/contrib/csup/updater.h
==============================================================================
--- projects/csup_wip/contrib/csup/updater.h	Wed Jan  7 11:44:03 2009	(r186857)
+++ projects/csup_wip/contrib/csup/updater.h	Wed Jan  7 11:54:00 2009	(r186858)
@@ -29,5 +29,6 @@
 #define _UPDATER_H
 
 void	*updater(void *);
+void	 updater_printinfo(void);
 
 #endif /* !_UPDATER_H_ */

From owner-svn-src-projects@FreeBSD.ORG  Wed Jan  7 21:10:16 2009
Return-Path: <owner-svn-src-projects@FreeBSD.ORG>
Delivered-To: svn-src-projects@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id EE78B1065670;
	Wed,  7 Jan 2009 21:10:16 +0000 (UTC)
	(envelope-from lulf@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id DDE1A8FC12;
	Wed,  7 Jan 2009 21:10:16 +0000 (UTC)
	(envelope-from lulf@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n07LAGit099684;
	Wed, 7 Jan 2009 21:10:16 GMT (envelope-from lulf@svn.freebsd.org)
Received: (from lulf@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n07LAG18099683;
	Wed, 7 Jan 2009 21:10:16 GMT (envelope-from lulf@svn.freebsd.org)
Message-Id: <200901072110.n07LAG18099683@svn.freebsd.org>
From: Ulf Lilleengen <lulf@FreeBSD.org>
Date: Wed, 7 Jan 2009 21:10:16 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-projects@freebsd.org
X-SVN-Group: projects
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r186874 - projects/csup_wip/contrib/csup
X-BeenThere: svn-src-projects@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the src &quot; projects&quot;
	tree" <svn-src-projects.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
	<mailto:svn-src-projects-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-projects>
List-Post: <mailto:svn-src-projects@freebsd.org>
List-Help: <mailto:svn-src-projects-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
	<mailto:svn-src-projects-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 07 Jan 2009 21:10:17 -0000

Author: lulf
Date: Wed Jan  7 21:10:16 2009
New Revision: 186874
URL: http://svn.freebsd.org/changeset/base/186874

Log:
  - Use sig_atomic_t as type for variables used in SIGINFO signal handler.
  
  Pointed out by:		maxim

Modified:
  projects/csup_wip/contrib/csup/lister.c

Modified: projects/csup_wip/contrib/csup/lister.c
==============================================================================
--- projects/csup_wip/contrib/csup/lister.c	Wed Jan  7 21:03:41 2009	(r186873)
+++ projects/csup_wip/contrib/csup/lister.c	Wed Jan  7 21:10:16 2009	(r186874)
@@ -71,7 +71,7 @@ static int	lister_dorcsdead(struct liste
 		    struct statusrec *);
 void		 lister_infohandler(int);
 
-int printinfo = 0;
+static volatile sig_atomic_t printinfo = 0;
 
 void *
 lister(void *arg)

From owner-svn-src-projects@FreeBSD.ORG  Wed Jan  7 21:36:25 2009
Return-Path: <owner-svn-src-projects@FreeBSD.ORG>
Delivered-To: svn-src-projects@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 13565106564A;
	Wed,  7 Jan 2009 21:36:25 +0000 (UTC)
	(envelope-from lulf@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 0118B8FC24;
	Wed,  7 Jan 2009 21:36:25 +0000 (UTC)
	(envelope-from lulf@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n07LaO34000471;
	Wed, 7 Jan 2009 21:36:24 GMT (envelope-from lulf@svn.freebsd.org)
Received: (from lulf@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n07LaOcP000470;
	Wed, 7 Jan 2009 21:36:24 GMT (envelope-from lulf@svn.freebsd.org)
Message-Id: <200901072136.n07LaOcP000470@svn.freebsd.org>
From: Ulf Lilleengen <lulf@FreeBSD.org>
Date: Wed, 7 Jan 2009 21:36:24 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-projects@freebsd.org
X-SVN-Group: projects
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r186877 - projects/csup_wip/contrib/csup
X-BeenThere: svn-src-projects@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the src &quot; projects&quot;
	tree" <svn-src-projects.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
	<mailto:svn-src-projects-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-projects>
List-Post: <mailto:svn-src-projects@freebsd.org>
List-Help: <mailto:svn-src-projects-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
	<mailto:svn-src-projects-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 07 Jan 2009 21:36:26 -0000

Author: lulf
Date: Wed Jan  7 21:36:24 2009
New Revision: 186877
URL: http://svn.freebsd.org/changeset/base/186877

Log:
  MFH

Modified:
  projects/csup_wip/contrib/csup/   (props changed)
  projects/csup_wip/contrib/csup/csup.1

Modified: projects/csup_wip/contrib/csup/csup.1
==============================================================================
--- projects/csup_wip/contrib/csup/csup.1	Wed Jan  7 21:25:44 2009	(r186876)
+++ projects/csup_wip/contrib/csup/csup.1	Wed Jan  7 21:36:24 2009	(r186877)
@@ -442,8 +442,6 @@ They are called
 mode and
 .Em checkout
 mode.
-.Nm
-only supports the checkout mode for now.
 .Pp
 In CVS mode, the client receives copies of the actual RCS files making
 up the master CVS repository.  CVS mode is the default mode of operation.

From owner-svn-src-projects@FreeBSD.ORG  Thu Jan  8 21:46:55 2009
Return-Path: <owner-svn-src-projects@FreeBSD.ORG>
Delivered-To: svn-src-projects@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id EEA411065674;
	Thu,  8 Jan 2009 21:46:55 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C4CDC8FC1A;
	Thu,  8 Jan 2009 21:46:55 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n08Lkt4E034288;
	Thu, 8 Jan 2009 21:46:55 GMT (envelope-from sam@svn.freebsd.org)
Received: (from sam@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n08Lkt9A034287;
	Thu, 8 Jan 2009 21:46:55 GMT (envelope-from sam@svn.freebsd.org)
Message-Id: <200901082146.n08Lkt9A034287@svn.freebsd.org>
From: Sam Leffler <sam@FreeBSD.org>
Date: Thu, 8 Jan 2009 21:46:55 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-projects@freebsd.org
X-SVN-Group: projects
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r186914 - projects/vap7
X-BeenThere: svn-src-projects@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the src &quot; projects&quot;
	tree" <svn-src-projects.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
	<mailto:svn-src-projects-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-projects>
List-Post: <mailto:svn-src-projects@freebsd.org>
List-Help: <mailto:svn-src-projects-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
	<mailto:svn-src-projects-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 08 Jan 2009 21:46:56 -0000

Author: sam
Date: Thu Jan  8 21:46:55 2009
New Revision: 186914
URL: http://svn.freebsd.org/changeset/base/186914

Log:
  branch releng7 to backport vap support

Added:
  projects/vap7/
     - copied from r186913, stable/7/

From owner-svn-src-projects@FreeBSD.ORG  Fri Jan  9 01:47:26 2009
Return-Path: <owner-svn-src-projects@FreeBSD.ORG>
Delivered-To: svn-src-projects@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0DB46106564A;
	Fri,  9 Jan 2009 01:47:26 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id EC9A68FC1A;
	Fri,  9 Jan 2009 01:47:25 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n091lPJG039257;
	Fri, 9 Jan 2009 01:47:25 GMT (envelope-from sam@svn.freebsd.org)
Received: (from sam@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n091lOYm039238;
	Fri, 9 Jan 2009 01:47:24 GMT (envelope-from sam@svn.freebsd.org)
Message-Id: <200901090147.n091lOYm039238@svn.freebsd.org>
From: Sam Leffler <sam@FreeBSD.org>
Date: Fri, 9 Jan 2009 01:47:24 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-projects@freebsd.org
X-SVN-Group: projects
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r186918 - in projects/vap7/sys: . amd64/conf arm/conf
	conf contrib/dev/ath contrib/dev/ral contrib/pf dev dev/ath
	dev/ath/ath_hal/ar5210 dev/ath/ath_hal/ar5211
	dev/ath/ath_hal/ar5212 de...
X-BeenThere: svn-src-projects@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the src &quot; projects&quot;
	tree" <svn-src-projects.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
	<mailto:svn-src-projects-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-projects>
List-Post: <mailto:svn-src-projects@freebsd.org>
List-Help: <mailto:svn-src-projects-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
	<mailto:svn-src-projects-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 09 Jan 2009 01:47:26 -0000

Author: sam
Date: Fri Jan  9 01:47:24 2009
New Revision: 186918
URL: http://svn.freebsd.org/changeset/base/186918

Log:
  start backmerging vap support; this brings in net80211 and drivers; GENERIC
  compiles but nothing tested or reviewed

Added:
  projects/vap7/sys/contrib/dev/ral/
     - copied from r178354, head/sys/contrib/dev/ral/
  projects/vap7/sys/modules/ralfw/
     - copied from r178354, head/sys/modules/ralfw/
  projects/vap7/sys/modules/wlan_rssadapt/
     - copied from r178354, head/sys/modules/wlan_rssadapt/
  projects/vap7/sys/net80211/ieee80211_adhoc.c
     - copied, changed from r178375, head/sys/net80211/ieee80211_adhoc.c
  projects/vap7/sys/net80211/ieee80211_adhoc.h
     - copied unchanged from r178375, head/sys/net80211/ieee80211_adhoc.h
  projects/vap7/sys/net80211/ieee80211_ddb.c
     - copied, changed from r178375, head/sys/net80211/ieee80211_ddb.c
  projects/vap7/sys/net80211/ieee80211_dfs.c
     - copied, changed from r178375, head/sys/net80211/ieee80211_dfs.c
  projects/vap7/sys/net80211/ieee80211_dfs.h
     - copied, changed from r178375, head/sys/net80211/ieee80211_dfs.h
  projects/vap7/sys/net80211/ieee80211_hostap.c
     - copied, changed from r178375, head/sys/net80211/ieee80211_hostap.c
  projects/vap7/sys/net80211/ieee80211_hostap.h
     - copied unchanged from r178375, head/sys/net80211/ieee80211_hostap.h
  projects/vap7/sys/net80211/ieee80211_monitor.c
     - copied unchanged from r178375, head/sys/net80211/ieee80211_monitor.c
  projects/vap7/sys/net80211/ieee80211_monitor.h
     - copied unchanged from r178375, head/sys/net80211/ieee80211_monitor.h
  projects/vap7/sys/net80211/ieee80211_phy.c
     - copied, changed from r178375, head/sys/net80211/ieee80211_phy.c
  projects/vap7/sys/net80211/ieee80211_phy.h
     - copied, changed from r178375, head/sys/net80211/ieee80211_phy.h
  projects/vap7/sys/net80211/ieee80211_rssadapt.c
     - copied unchanged from r178375, head/sys/net80211/ieee80211_rssadapt.c
  projects/vap7/sys/net80211/ieee80211_rssadapt.h
     - copied unchanged from r178375, head/sys/net80211/ieee80211_rssadapt.h
  projects/vap7/sys/net80211/ieee80211_sta.c
     - copied, changed from r178375, head/sys/net80211/ieee80211_sta.c
  projects/vap7/sys/net80211/ieee80211_sta.h
     - copied unchanged from r178375, head/sys/net80211/ieee80211_sta.h
  projects/vap7/sys/net80211/ieee80211_tdma.c
     - copied unchanged from r186915, head/sys/net80211/ieee80211_tdma.c
  projects/vap7/sys/net80211/ieee80211_tdma.h
     - copied unchanged from r186915, head/sys/net80211/ieee80211_tdma.h
  projects/vap7/sys/net80211/ieee80211_wds.c
     - copied, changed from r178375, head/sys/net80211/ieee80211_wds.c
  projects/vap7/sys/net80211/ieee80211_wds.h
     - copied unchanged from r178375, head/sys/net80211/ieee80211_wds.h
Deleted:
  projects/vap7/sys/contrib/dev/ath/
  projects/vap7/sys/dev/awi/
  projects/vap7/sys/dev/ral/if_ralrate.c
  projects/vap7/sys/dev/ral/if_ralrate.h
  projects/vap7/sys/dev/ral/rt2661_ucode.h
  projects/vap7/sys/dev/wi/spectrum24t_cf.h
  projects/vap7/sys/modules/ath_hal/
  projects/vap7/sys/modules/ath_rate_amrr/
  projects/vap7/sys/modules/ath_rate_onoe/
  projects/vap7/sys/modules/ath_rate_sample/
  projects/vap7/sys/modules/awi/
  projects/vap7/sys/modules/wlan_scan_ap/
  projects/vap7/sys/modules/wlan_scan_sta/
  projects/vap7/sys/net80211/ieee80211_scan_ap.c
Modified:
  projects/vap7/sys/   (props changed)
  projects/vap7/sys/amd64/conf/GENERIC
  projects/vap7/sys/amd64/conf/NOTES
  projects/vap7/sys/arm/conf/AVILA
  projects/vap7/sys/arm/conf/HL200
  projects/vap7/sys/arm/conf/KB920X
  projects/vap7/sys/conf/NOTES
  projects/vap7/sys/conf/files
  projects/vap7/sys/conf/files.amd64
  projects/vap7/sys/conf/files.arm
  projects/vap7/sys/conf/files.i386
  projects/vap7/sys/conf/files.pc98
  projects/vap7/sys/conf/files.powerpc
  projects/vap7/sys/conf/files.sparc64
  projects/vap7/sys/conf/kern.pre.mk
  projects/vap7/sys/conf/options
  projects/vap7/sys/contrib/pf/   (props changed)
  projects/vap7/sys/dev/   (props changed)
  projects/vap7/sys/dev/ath/   (props changed)
  projects/vap7/sys/dev/ath/ah_osdep.c
  projects/vap7/sys/dev/ath/ah_osdep.h
  projects/vap7/sys/dev/ath/ath_hal/ar5210/   (props changed)
  projects/vap7/sys/dev/ath/ath_hal/ar5211/   (props changed)
  projects/vap7/sys/dev/ath/ath_hal/ar5212/   (props changed)
  projects/vap7/sys/dev/ath/ath_hal/ar5312/   (props changed)
  projects/vap7/sys/dev/ath/ath_hal/ar5416/   (props changed)
  projects/vap7/sys/dev/ath/ath_rate/amrr/amrr.c
  projects/vap7/sys/dev/ath/ath_rate/amrr/amrr.h
  projects/vap7/sys/dev/ath/ath_rate/onoe/onoe.c
  projects/vap7/sys/dev/ath/ath_rate/onoe/onoe.h
  projects/vap7/sys/dev/ath/ath_rate/sample/sample.c
  projects/vap7/sys/dev/ath/ath_rate/sample/sample.h
  projects/vap7/sys/dev/ath/if_ath.c
  projects/vap7/sys/dev/ath/if_ath_pci.c
  projects/vap7/sys/dev/ath/if_athioctl.h
  projects/vap7/sys/dev/ath/if_athrate.h
  projects/vap7/sys/dev/ath/if_athvar.h
  projects/vap7/sys/dev/cxgb/   (props changed)
  projects/vap7/sys/dev/if_ndis/if_ndis.c
  projects/vap7/sys/dev/if_ndis/if_ndisvar.h
  projects/vap7/sys/dev/ipw/if_ipw.c
  projects/vap7/sys/dev/ipw/if_ipwvar.h
  projects/vap7/sys/dev/iwi/if_iwi.c
  projects/vap7/sys/dev/iwi/if_iwivar.h
  projects/vap7/sys/dev/malo/if_malo.c
  projects/vap7/sys/dev/malo/if_malo.h
  projects/vap7/sys/dev/ral/if_ral_pci.c
  projects/vap7/sys/dev/ral/rt2560.c
  projects/vap7/sys/dev/ral/rt2560reg.h
  projects/vap7/sys/dev/ral/rt2560var.h
  projects/vap7/sys/dev/ral/rt2661.c
  projects/vap7/sys/dev/ral/rt2661var.h
  projects/vap7/sys/dev/usb/if_rum.c
  projects/vap7/sys/dev/usb/if_rumvar.h
  projects/vap7/sys/dev/usb/if_ural.c
  projects/vap7/sys/dev/usb/if_uralvar.h
  projects/vap7/sys/dev/usb/if_zyd.c
  projects/vap7/sys/dev/usb/if_zydreg.h
  projects/vap7/sys/dev/wi/if_wavelan_ieee.h
  projects/vap7/sys/dev/wi/if_wi.c
  projects/vap7/sys/dev/wi/if_wi_pccard.c
  projects/vap7/sys/dev/wi/if_wi_pci.c
  projects/vap7/sys/dev/wi/if_wivar.h
  projects/vap7/sys/dev/wpi/if_wpi.c
  projects/vap7/sys/dev/wpi/if_wpivar.h
  projects/vap7/sys/i386/conf/GENERIC
  projects/vap7/sys/i386/conf/NOTES
  projects/vap7/sys/i386/conf/PAE
  projects/vap7/sys/kern/kern_timeout.c
  projects/vap7/sys/modules/Makefile
  projects/vap7/sys/modules/ath/Makefile
  projects/vap7/sys/modules/malo/Makefile
  projects/vap7/sys/modules/ral/Makefile
  projects/vap7/sys/modules/wlan/Makefile
  projects/vap7/sys/modules/wlan_acl/Makefile
  projects/vap7/sys/modules/wlan_amrr/Makefile
  projects/vap7/sys/modules/wlan_ccmp/Makefile
  projects/vap7/sys/modules/wlan_tkip/Makefile
  projects/vap7/sys/modules/wlan_wep/Makefile
  projects/vap7/sys/modules/wlan_xauth/Makefile
  projects/vap7/sys/net/if.c
  projects/vap7/sys/net/if_clone.c
  projects/vap7/sys/net/if_clone.h
  projects/vap7/sys/net/if_var.h
  projects/vap7/sys/net80211/   (props changed)
  projects/vap7/sys/net80211/_ieee80211.h
  projects/vap7/sys/net80211/ieee80211.c
  projects/vap7/sys/net80211/ieee80211.h
  projects/vap7/sys/net80211/ieee80211_acl.c
  projects/vap7/sys/net80211/ieee80211_amrr.c
  projects/vap7/sys/net80211/ieee80211_amrr.h
  projects/vap7/sys/net80211/ieee80211_crypto.c
  projects/vap7/sys/net80211/ieee80211_crypto.h
  projects/vap7/sys/net80211/ieee80211_crypto_ccmp.c
  projects/vap7/sys/net80211/ieee80211_crypto_none.c
  projects/vap7/sys/net80211/ieee80211_crypto_tkip.c
  projects/vap7/sys/net80211/ieee80211_crypto_wep.c
  projects/vap7/sys/net80211/ieee80211_freebsd.c
  projects/vap7/sys/net80211/ieee80211_freebsd.h
  projects/vap7/sys/net80211/ieee80211_ht.c
  projects/vap7/sys/net80211/ieee80211_ht.h
  projects/vap7/sys/net80211/ieee80211_input.c
  projects/vap7/sys/net80211/ieee80211_input.h
  projects/vap7/sys/net80211/ieee80211_ioctl.c
  projects/vap7/sys/net80211/ieee80211_ioctl.h
  projects/vap7/sys/net80211/ieee80211_node.c
  projects/vap7/sys/net80211/ieee80211_node.h
  projects/vap7/sys/net80211/ieee80211_output.c
  projects/vap7/sys/net80211/ieee80211_power.c
  projects/vap7/sys/net80211/ieee80211_power.h
  projects/vap7/sys/net80211/ieee80211_proto.c
  projects/vap7/sys/net80211/ieee80211_proto.h
  projects/vap7/sys/net80211/ieee80211_regdomain.c
  projects/vap7/sys/net80211/ieee80211_regdomain.h
  projects/vap7/sys/net80211/ieee80211_scan.c
  projects/vap7/sys/net80211/ieee80211_scan.h
  projects/vap7/sys/net80211/ieee80211_scan_sta.c
  projects/vap7/sys/net80211/ieee80211_var.h
  projects/vap7/sys/net80211/ieee80211_xauth.c
  projects/vap7/sys/pc98/conf/GENERIC
  projects/vap7/sys/pc98/conf/NOTES
  projects/vap7/sys/sparc64/conf/GENERIC
  projects/vap7/sys/sys/callout.h

Modified: projects/vap7/sys/amd64/conf/GENERIC
==============================================================================
--- projects/vap7/sys/amd64/conf/GENERIC	Thu Jan  8 23:50:32 2009	(r186917)
+++ projects/vap7/sys/amd64/conf/GENERIC	Fri Jan  9 01:47:24 2009	(r186918)
@@ -238,13 +238,11 @@ device		wlan_wep	# 802.11 WEP support
 device		wlan_ccmp	# 802.11 CCMP support
 device		wlan_tkip	# 802.11 TKIP support
 device		wlan_amrr	# AMRR transmit rate control algorithm
-device		wlan_scan_ap	# 802.11 AP mode scanning
-device		wlan_scan_sta	# 802.11 STA mode scanning
 device		an		# Aironet 4500/4800 802.11 wireless NICs.
 device		ath		# Atheros pci/cardbus NIC's
-device		ath_hal		# Atheros HAL (Hardware Access Layer)
+device		ath_hal		# pci/cardbus chip support
+options		AH_SUPPORT_AR5416	# enable AR5416 tx/rx descriptors
 device		ath_rate_sample	# SampleRate tx rate control for ath
-device		awi		# BayStack 660 and others
 device		ral		# Ralink Technology RT2500 wireless NICs.
 device		wi		# WaveLAN/Intersil/Symbol 802.11 wireless NICs.
 

Modified: projects/vap7/sys/amd64/conf/NOTES
==============================================================================
--- projects/vap7/sys/amd64/conf/NOTES	Thu Jan  8 23:50:32 2009	(r186917)
+++ projects/vap7/sys/amd64/conf/NOTES	Fri Jan  9 01:47:24 2009	(r186918)
@@ -305,7 +305,6 @@ options 	DRM_DEBUG	# Include debug print
 # Network interfaces:
 #
 
-# ath:  Atheros a/b/g WiFi adapters (requires ath_hal and wlan)
 # ed:   Western Digital and SMC 80xx; Novell NE1000 and NE2000; 3Com 3C503
 #       HP PC Lan+, various PC Card devices
 #       (requires miibus)
@@ -329,12 +328,12 @@ device		ral
 device		ural
 device		wpi
 
-device		ath
-device		ath_hal		# Atheros HAL (includes binary component)
-#device		ath_rate_amrr	# AMRR rate control for ath driver
-#device		ath_rate_onoe	# Onoe rate control for ath driver
-device		ath_rate_sample	# SampleRate rate control for the ath driver
-#device		wlan		# 802.11 layer
+device		ath			# Atheros pci/cardbus NIC's
+device		ath_hal			# pci/cardbus chip support
+options		AH_SUPPORT_AR5416	# enable AR5416 tx/rx descriptors
+device		ath_rate_sample		# SampleRate tx rate control for ath
+#device		ath_rate_amrr		# AMRR rate control for ath driver
+#device		ath_rate_onoe		# Onoe rate control for ath driver
 
 #
 #XXX this stores pointers in a 32bit field that is defined by the hardware

Modified: projects/vap7/sys/arm/conf/AVILA
==============================================================================
--- projects/vap7/sys/arm/conf/AVILA	Thu Jan  8 23:50:32 2009	(r186917)
+++ projects/vap7/sys/arm/conf/AVILA	Fri Jan  9 01:47:24 2009	(r186918)
@@ -127,11 +127,13 @@ device          random          # Entrop
 
 # Wireless NIC cards
 device		wlan		# 802.11 support
-#device		wlan_wep	# 802.11 WEP support
-#device		wlan_ccmp	# 802.11 CCMP support
-#device		wlan_tkip	# 802.11 TKIP support
+device		wlan_wep	# 802.11 WEP support
+device		wlan_ccmp	# 802.11 CCMP support
+device		wlan_tkip	# 802.11 TKIP support
+device		wlan_xauth
 device		ath		# Atheros pci/cardbus NIC's
 device		ath_hal		# Atheros HAL (Hardware Access Layer)
+options		AH_SUPPORT_AR5416	# enable AR5416 tx/rx descriptors
 device		ath_rate_sample	# SampleRate tx rate control for ath
 options		ATH_DEBUG
 

Modified: projects/vap7/sys/arm/conf/HL200
==============================================================================
--- projects/vap7/sys/arm/conf/HL200	Thu Jan  8 23:50:32 2009	(r186917)
+++ projects/vap7/sys/arm/conf/HL200	Fri Jan  9 01:47:24 2009	(r186918)
@@ -148,5 +148,3 @@ device          wlan_wep        # 802.11
 device          wlan_ccmp       # 802.11 CCMP support
 device          wlan_tkip       # 802.11 TKIP support
 device          wlan_amrr       # AMRR transmit rate control algorithm
-device          wlan_scan_ap    # 802.11 AP mode scanning
-device          wlan_scan_sta   # 802.11 STA mode scanning

Modified: projects/vap7/sys/arm/conf/KB920X
==============================================================================
--- projects/vap7/sys/arm/conf/KB920X	Thu Jan  8 23:50:32 2009	(r186917)
+++ projects/vap7/sys/arm/conf/KB920X	Fri Jan  9 01:47:24 2009	(r186918)
@@ -136,5 +136,3 @@ device          wlan_wep        # 802.11
 device          wlan_ccmp       # 802.11 CCMP support
 device          wlan_tkip       # 802.11 TKIP support
 device          wlan_amrr       # AMRR transmit rate control algorithm
-device          wlan_scan_ap    # 802.11 AP mode scanning
-device          wlan_scan_sta   # 802.11 STA mode scanning

Modified: projects/vap7/sys/conf/NOTES
==============================================================================
--- projects/vap7/sys/conf/NOTES	Thu Jan  8 23:50:32 2009	(r186917)
+++ projects/vap7/sys/conf/NOTES	Fri Jan  9 01:47:24 2009	(r186918)
@@ -713,7 +713,7 @@ device		mn	# Munich32x/Falc54 Nx64kbit/s
 #  according to IEEE 802.1Q.  It requires `device miibus'.
 #  The `wlan' device provides generic code to support 802.11
 #  drivers, including host AP mode; it is MANDATORY for the wi,
-#  ath, and awi drivers and will eventually be required by all 802.11 drivers.
+#  and ath drivers and will eventually be required by all 802.11 drivers.
 #  The `wlan_wep', `wlan_tkip', and `wlan_ccmp' devices provide
 #  support for WEP, TKIP, and AES-CCMP crypto protocols optionally
 #  used with 802.11 devices that depend on the `wlan' module.
@@ -774,8 +774,6 @@ device		wlan_tkip		#802.11 TKIP support
 device		wlan_xauth		#802.11 external authenticator support
 device		wlan_acl		#802.11 MAC ACL support
 device		wlan_amrr		#AMRR transmit rate control algorithm
-device		wlan_scan_ap		#802.11 AP mode scanning
-device		wlan_scan_sta		#802.11 STA mode scanning
 device		token			#Generic TokenRing
 device		fddi			#Generic FDDI
 device		arcnet			#Generic Arcnet
@@ -1720,8 +1718,6 @@ device		miibus
 #       L2 PCI-Express FastEthernet controllers.
 # an:   Aironet 4500/4800 802.11 wireless adapters. Supports the PCMCIA,
 #       PCI and ISA varieties.
-# awi:  Support for IEEE 802.11 PC Card devices using the AMD Am79C930 and
-#       Harris (Intersil) Chipset with PCnetMobile firmware by AMD.
 # age:  Support for gigabit ethernet adapters based on the Attansic/Atheros
 #       L1 PCI express gigabit ethernet controllers.
 # ale:  Support for Atheros AR8121/AR8113/AR8114 PCIe ethernet controllers.
@@ -1861,7 +1857,6 @@ hint.sn.0.at="isa"
 hint.sn.0.port="0x300"
 hint.sn.0.irq="10"
 device		an
-device		awi
 device		cnw
 device		wi
 device		xe

Modified: projects/vap7/sys/conf/files
==============================================================================
--- projects/vap7/sys/conf/files	Thu Jan  8 23:50:32 2009	(r186917)
+++ projects/vap7/sys/conf/files	Fri Jan  9 01:47:24 2009	(r186918)
@@ -475,21 +475,179 @@ dev/ata/atapi-cam.c		optional atapicam
 dev/ata/atapi-cd.c		optional atapicd
 dev/ata/atapi-fd.c		optional atapifd
 dev/ata/atapi-tape.c		optional atapist
-dev/ath/ah_osdep.c optional ath_hal \
+dev/ath/if_ath.c		optional ath \
+	compile-with "${NORMAL_C} -I$S/dev/ath"
+dev/ath/if_ath_pci.c		optional ath pci \
+	compile-with "${NORMAL_C} -I$S/dev/ath"
+dev/ath/ah_osdep.c		optional ath \
+	compile-with "${NORMAL_C} -I$S/dev/ath"
+dev/ath/ath_hal/ah.c		optional ath \
+	compile-with "${NORMAL_C} -I$S/dev/ath"
+dev/ath/ath_hal/ah_eeprom_v1.c	optional ath_hal | ath_ar5210 \
+	compile-with "${NORMAL_C} -I$S/dev/ath"
+dev/ath/ath_hal/ah_eeprom_v3.c	optional ath_hal | ath_ar5211 | ath_ar5212 \
 	compile-with "${NORMAL_C} -I$S/dev/ath"
+dev/ath/ath_hal/ah_eeprom_v14.c optional ath_hal | ath_ar5416 | ath_ar9160 \
+	compile-with "${NORMAL_C} -I$S/dev/ath"
+dev/ath/ath_hal/ah_regdomain.c	optional ath \
+	compile-with "${NORMAL_C} -I$S/dev/ath"
+dev/ath/ath_hal/ar5210/ar5210_attach.c		optional ath_hal | ath_ar5210 \
+	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
+dev/ath/ath_hal/ar5210/ar5210_beacon.c		optional ath_hal | ath_ar5210 \
+	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
+dev/ath/ath_hal/ar5210/ar5210_interrupts.c	optional ath_hal | ath_ar5210 \
+	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
+dev/ath/ath_hal/ar5210/ar5210_keycache.c	optional ath_hal | ath_ar5210 \
+	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
+dev/ath/ath_hal/ar5210/ar5210_misc.c		optional ath_hal | ath_ar5210 \
+	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
+dev/ath/ath_hal/ar5210/ar5210_phy.c		optional ath_hal | ath_ar5210 \
+	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
+dev/ath/ath_hal/ar5210/ar5210_power.c		optional ath_hal | ath_ar5210 \
+	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
+dev/ath/ath_hal/ar5210/ar5210_recv.c		optional ath_hal | ath_ar5210 \
+	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
+dev/ath/ath_hal/ar5210/ar5210_reset.c		optional ath_hal | ath_ar5210 \
+	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
+dev/ath/ath_hal/ar5210/ar5210_xmit.c		optional ath_hal | ath_ar5210 \
+	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
+dev/ath/ath_hal/ar5211/ar5211_attach.c		optional ath_hal | ath_ar5211 \
+	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
+dev/ath/ath_hal/ar5211/ar5211_beacon.c		optional ath_hal | ath_ar5211 \
+	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
+dev/ath/ath_hal/ar5211/ar5211_interrupts.c	optional ath_hal | ath_ar5211 \
+	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
+dev/ath/ath_hal/ar5211/ar5211_keycache.c	optional ath_hal | ath_ar5211 \
+	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
+dev/ath/ath_hal/ar5211/ar5211_misc.c		optional ath_hal | ath_ar5211 \
+	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
+dev/ath/ath_hal/ar5211/ar5211_phy.c		optional ath_hal | ath_ar5211 \
+	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
+dev/ath/ath_hal/ar5211/ar5211_power.c		optional ath_hal | ath_ar5211 \
+	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
+dev/ath/ath_hal/ar5211/ar5211_recv.c		optional ath_hal | ath_ar5211 \
+	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
+dev/ath/ath_hal/ar5211/ar5211_reset.c		optional ath_hal | ath_ar5211 \
+	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
+dev/ath/ath_hal/ar5211/ar5211_xmit.c		optional ath_hal | ath_ar5211 \
+	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
+dev/ath/ath_hal/ar5212/ar5212_ani.c \
+	optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 \
+	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
+dev/ath/ath_hal/ar5212/ar5212_attach.c \
+	optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 \
+	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
+dev/ath/ath_hal/ar5212/ar5212_beacon.c \
+	optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 \
+	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
+dev/ath/ath_hal/ar5212/ar5212_eeprom.c \
+	optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 \
+	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
+dev/ath/ath_hal/ar5212/ar5212_gpio.c \
+	optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 \
+	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
+dev/ath/ath_hal/ar5212/ar5212_interrupts.c \
+	optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 \
+	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
+dev/ath/ath_hal/ar5212/ar5212_keycache.c \
+	optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 \
+	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
+dev/ath/ath_hal/ar5212/ar5212_misc.c \
+	optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 \
+	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
+dev/ath/ath_hal/ar5212/ar5212_phy.c \
+	optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 \
+	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
+dev/ath/ath_hal/ar5212/ar5212_power.c \
+	optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 \
+	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
+dev/ath/ath_hal/ar5212/ar5212_recv.c \
+	optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 \
+	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
+dev/ath/ath_hal/ar5212/ar5212_reset.c \
+	optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 \
+	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
+dev/ath/ath_hal/ar5212/ar5212_rfgain.c \
+	optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 \
+	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
+dev/ath/ath_hal/ar5212/ar5212_xmit.c \
+	optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 \
+	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
+dev/ath/ath_hal/ar5212/ar2316.c	optional ath_rf2316 \
+	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
+dev/ath/ath_hal/ar5212/ar2317.c	optional ath_rf2317 \
+	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
+dev/ath/ath_hal/ar5212/ar2413.c	optional ath_hal | ath_rf2413 \
+	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
+dev/ath/ath_hal/ar5212/ar2425.c	optional ath_hal | ath_rf2425 | ath_rf2417 \
+	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
+dev/ath/ath_hal/ar5212/ar5111.c	optional ath_hal | ath_rf5111 \
+	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
+dev/ath/ath_hal/ar5212/ar5112.c	optional ath_hal | ath_rf5112 \
+	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
+dev/ath/ath_hal/ar5212/ar5413.c	optional ath_hal | ath_rf5413 \
+	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
+dev/ath/ath_hal/ar5416/ar2133.c	optional ath_hal | ath_ar5416 | ath_ar9160 \
+	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
+dev/ath/ath_hal/ar5416/ar5416_ani.c \
+	optional ath_hal | ath_ar5416 | ath_ar9160 \
+	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
+dev/ath/ath_hal/ar5416/ar5416_attach.c \
+	optional ath_hal | ath_ar5416 | ath_ar9160 \
+	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
+dev/ath/ath_hal/ar5416/ar5416_beacon.c \
+	optional ath_hal | ath_ar5416 | ath_ar9160 \
+	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
+dev/ath/ath_hal/ar5416/ar5416_cal.c \
+	optional ath_hal | ath_ar5416 | ath_ar9160 \
+	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
+dev/ath/ath_hal/ar5416/ar5416_cal_iq.c \
+	optional ath_hal | ath_ar5416 | ath_ar9160 \
+	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
+dev/ath/ath_hal/ar5416/ar5416_cal_adcgain.c \
+	optional ath_hal | ath_ar5416 | ath_ar9160 \
+	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
+dev/ath/ath_hal/ar5416/ar5416_cal_adcdc.c \
+	optional ath_hal | ath_ar5416 | ath_ar9160 \
+	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
+dev/ath/ath_hal/ar5416/ar5416_eeprom.c \
+	optional ath_hal | ath_ar5416 | ath_ar9160 \
+	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
+dev/ath/ath_hal/ar5416/ar5416_gpio.c \
+	optional ath_hal | ath_ar5416 | ath_ar9160 \
+	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
+dev/ath/ath_hal/ar5416/ar5416_interrupts.c \
+	optional ath_hal | ath_ar5416 | ath_ar9160 \
+	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
+dev/ath/ath_hal/ar5416/ar5416_keycache.c \
+	optional ath_hal | ath_ar5416 | ath_ar9160 \
+	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
+dev/ath/ath_hal/ar5416/ar5416_misc.c \
+	optional ath_hal | ath_ar5416 | ath_ar9160 \
+	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
+dev/ath/ath_hal/ar5416/ar5416_phy.c \
+	optional ath_hal | ath_ar5416 | ath_ar9160 \
+	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
+dev/ath/ath_hal/ar5416/ar5416_power.c \
+	optional ath_hal | ath_ar5416 | ath_ar9160 \
+	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
+dev/ath/ath_hal/ar5416/ar5416_recv.c \
+	optional ath_hal | ath_ar5416 | ath_ar9160 \
+	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
+dev/ath/ath_hal/ar5416/ar5416_reset.c \
+	optional ath_hal | ath_ar5416 | ath_ar9160 \
+	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
+dev/ath/ath_hal/ar5416/ar5416_xmit.c \
+	optional ath_hal | ath_ar5416 | ath_ar9160 \
+	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
+dev/ath/ath_hal/ar5416/ar9160_attach.c optional ath_hal | ath_ar9160 \
+	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_rate/amrr/amrr.c	optional ath_rate_amrr \
 	compile-with "${NORMAL_C} -I$S/dev/ath"
 dev/ath/ath_rate/onoe/onoe.c	optional ath_rate_onoe \
 	compile-with "${NORMAL_C} -I$S/dev/ath"
 dev/ath/ath_rate/sample/sample.c	optional ath_rate_sample \
 	compile-with "${NORMAL_C} -I$S/dev/ath"
-dev/ath/if_ath.c		optional ath \
-	compile-with "${NORMAL_C} -I$S/dev/ath"
-dev/ath/if_ath_pci.c		optional ath pci \
-	compile-with "${NORMAL_C} -I$S/dev/ath"
-dev/awi/am79c930.c		optional awi
-dev/awi/awi.c			optional awi
-dev/awi/if_awi_pccard.c		optional awi pccard
 dev/bce/if_bce.c		optional bce
 dev/bfe/if_bfe.c		optional bfe
 dev/bge/if_bge.c		optional bge
@@ -759,6 +917,9 @@ dev/le/lance.c			optional le
 dev/led/led.c			standard
 dev/lge/if_lge.c		optional lge
 dev/lmc/if_lmc.c		optional lmc
+dev/malo/if_malo.c		optional malo
+dev/malo/if_malohal.c		optional malo
+dev/malo/if_malo_pci.c		optional malo pci
 dev/mc146818/mc146818.c		optional mc146818
 dev/mca/mca_bus.c		optional mca
 dev/mcd/mcd.c			optional mcd isa nowerror
@@ -910,7 +1071,6 @@ dev/puc/puc_pci.c		optional puc pci
 dev/puc/pucdata.c		optional puc pci
 dev/ral/rt2560.c		optional ral
 dev/ral/rt2661.c		optional ral
-dev/ral/if_ralrate.c		optional ral
 dev/ral/if_ral_pci.c		optional ral pci
 dev/random/harvest.c		standard
 dev/random/hash.c		optional random
@@ -1663,24 +1823,33 @@ net/zlib.c			optional crypto | geom_uzip
 					 ddb_ctf
 net80211/ieee80211.c		optional wlan
 net80211/ieee80211_acl.c	optional wlan_acl
+net80211/ieee80211_adhoc.c	optional wlan
 net80211/ieee80211_amrr.c	optional wlan_amrr
 net80211/ieee80211_crypto.c	optional wlan
 net80211/ieee80211_crypto_ccmp.c optional wlan_ccmp
 net80211/ieee80211_crypto_none.c optional wlan
 net80211/ieee80211_crypto_tkip.c optional wlan_tkip
 net80211/ieee80211_crypto_wep.c	optional wlan_wep
+net80211/ieee80211_ddb.c	optional wlan ddb
+net80211/ieee80211_dfs.c	optional wlan
 net80211/ieee80211_freebsd.c	optional wlan
+net80211/ieee80211_hostap.c	optional wlan
 net80211/ieee80211_ht.c		optional wlan
 net80211/ieee80211_input.c	optional wlan
 net80211/ieee80211_ioctl.c	optional wlan
+net80211/ieee80211_monitor.c	optional wlan
 net80211/ieee80211_node.c	optional wlan
 net80211/ieee80211_output.c	optional wlan
+net80211/ieee80211_phy.c	optional wlan
 net80211/ieee80211_power.c	optional wlan
 net80211/ieee80211_proto.c	optional wlan
 net80211/ieee80211_regdomain.c	optional wlan
+net80211/ieee80211_rssadapt.c	optional wlan_rssadapt
 net80211/ieee80211_scan.c	optional wlan
-net80211/ieee80211_scan_ap.c	optional wlan_scan_ap
-net80211/ieee80211_scan_sta.c	optional wlan_scan_sta
+net80211/ieee80211_scan_sta.c	optional wlan
+net80211/ieee80211_sta.c	optional wlan
+net80211/ieee80211_tdma.c	optional wlan
+net80211/ieee80211_wds.c	optional wlan
 net80211/ieee80211_xauth.c	optional wlan_xauth
 netatalk/aarp.c			optional netatalk
 netatalk/at_control.c		optional netatalk

Modified: projects/vap7/sys/conf/files.amd64
==============================================================================
--- projects/vap7/sys/conf/files.amd64	Thu Jan  8 23:50:32 2009	(r186917)
+++ projects/vap7/sys/conf/files.amd64	Fri Jan  9 01:47:24 2009	(r186918)
@@ -47,16 +47,6 @@ ukbdmap.h			optional	ukbd_dflt_keymap	\
 	no-obj no-implicit-rule before-depend				\
 	clean		"ukbdmap.h"
 #
-hal.o				optional	ath_hal			\
-	dependency	"$S/contrib/dev/ath/public/x86_64-elf.hal.o.uu"	\
-	compile-with	"uudecode < $S/contrib/dev/ath/public/x86_64-elf.hal.o.uu" \
-	no-implicit-rule
-opt_ah.h			optional	ath_hal			\
-	dependency	"$S/contrib/dev/ath/public/x86_64-elf.opt_ah.h"	\
-	compile-with	"rm -f opt_ah.h; cp $S/contrib/dev/ath/public/x86_64-elf.opt_ah.h opt_ah.h" \
-	no-obj no-implicit-rule before-depend				\
-	clean		"opt_ah.h"
-#
 nvenetlib.o			optional	nve pci			\
 	dependency	"$S/contrib/dev/nve/amd64/nvenetlib.o.bz2.uu"	\
 	compile-with	"uudecode $S/contrib/dev/nve/amd64/nvenetlib.o.bz2.uu ; bzip2 -df nvenetlib.o.bz2" \

Modified: projects/vap7/sys/conf/files.arm
==============================================================================
--- projects/vap7/sys/conf/files.arm	Thu Jan  8 23:50:32 2009	(r186917)
+++ projects/vap7/sys/conf/files.arm	Fri Jan  9 01:47:24 2009	(r186918)
@@ -52,13 +52,6 @@ geom/geom_bsd.c			standard
 geom/geom_bsd_enc.c		standard
 geom/geom_mbr.c			standard
 geom/geom_mbr_enc.c		standard
-hal.o				optional	ath_hal		\
-	compile-with		"ATH_HAL_CPU=`echo ${CONF_CFLAGS}|sed 's/.*-mcpu=\([a-zA-Z0-9]*\).*/\1/'`; ATH_ENDIAN=`if (echo ${CC}|grep mbig-endian>/dev/null); then echo be; else echo le; fi;`; uudecode < $S/contrib/dev/ath/public/$$ATH_HAL_CPU-$$ATH_ENDIAN-elf.hal.o.uu" \
-	no-implicit-rule
-opt_ah.h			optional	ath_hal		\
-	compile-with		"ATH_HAL_CPU=`echo ${CONF_CFLAGS}|sed 's/.*-mcpu=\([a-zA-Z0-9]*\).*/\1/'`; ATH_ENDIAN=`if (echo ${CC}|grep mbig-endian>/dev/null); then echo be; else echo le; fi;`; rm -f opt_ah.h; cp $S/contrib/dev/ath/public/$$ATH_HAL_CPU-$$ATH_ENDIAN-elf.opt_ah.h opt_ah.h" \
-	no-obj no-implicit-rule before-depend			\
-	clean		"opt_ah.h"
 libkern/arm/divsi3.S		standard
 libkern/arm/ffs.S		standard
 libkern/arm/muldi3.c		standard

Modified: projects/vap7/sys/conf/files.i386
==============================================================================
--- projects/vap7/sys/conf/files.i386	Thu Jan  8 23:50:32 2009	(r186917)
+++ projects/vap7/sys/conf/files.i386	Fri Jan  9 01:47:24 2009	(r186918)
@@ -50,17 +50,6 @@ trlld.o				optional	oltr			\
 	dependency	"$S/contrib/dev/oltr/i386-elf.trlld.o.uu"	\
 	compile-with	"uudecode < $S/contrib/dev/oltr/i386-elf.trlld.o.uu"	\
 	no-implicit-rule
-#
-hal.o				optional	ath_hal			\
-	dependency	"$S/contrib/dev/ath/public/i386-elf.hal.o.uu"	\
-	compile-with	"uudecode < $S/contrib/dev/ath/public/i386-elf.hal.o.uu" \
-	no-implicit-rule
-opt_ah.h			optional	ath_hal			\
-	dependency	"$S/contrib/dev/ath/public/i386-elf.opt_ah.h"	\
-	compile-with	"rm -f opt_ah.h; cp $S/contrib/dev/ath/public/i386-elf.opt_ah.h opt_ah.h" \
-	no-obj no-implicit-rule before-depend				\
-	clean		"opt_ah.h"
-#
 nvenetlib.o			optional	nve pci			\
 	dependency	"$S/contrib/dev/nve/i386/nvenetlib.o.bz2.uu"	\
 	compile-with	"uudecode $S/contrib/dev/nve/i386/nvenetlib.o.bz2.uu ; bzip2 -df nvenetlib.o.bz2" \

Modified: projects/vap7/sys/conf/files.pc98
==============================================================================
--- projects/vap7/sys/conf/files.pc98	Thu Jan  8 23:50:32 2009	(r186917)
+++ projects/vap7/sys/conf/files.pc98	Fri Jan  9 01:47:24 2009	(r186918)
@@ -42,17 +42,6 @@ trlld.o				optional	oltr			\
 	dependency	"$S/contrib/dev/oltr/i386-elf.trlld.o.uu"	\
 	compile-with	"uudecode < $S/contrib/dev/oltr/i386-elf.trlld.o.uu"	\
 	no-implicit-rule
-#
-hal.o				optional	ath_hal			\
-	dependency	"$S/contrib/dev/ath/public/i386-elf.hal.o.uu"	\
-	compile-with	"uudecode < $S/contrib/dev/ath/public/i386-elf.hal.o.uu" \
-	no-implicit-rule
-opt_ah.h			optional	ath_hal			\
-	dependency	"$S/contrib/dev/ath/public/i386-elf.opt_ah.h"	\
-	compile-with	"rm -f opt_ah.h; cp $S/contrib/dev/ath/public/i386-elf.opt_ah.h opt_ah.h" \
-	no-obj no-implicit-rule before-depend				\
-	clean		"opt_ah.h"
-#
 compat/linprocfs/linprocfs.c	optional linprocfs
 compat/linsysfs/linsysfs.c	optional linsysfs
 compat/linux/linux_emul.c	optional compat_linux

Modified: projects/vap7/sys/conf/files.powerpc
==============================================================================
--- projects/vap7/sys/conf/files.powerpc	Thu Jan  8 23:50:32 2009	(r186917)
+++ projects/vap7/sys/conf/files.powerpc	Fri Jan  9 01:47:24 2009	(r186918)
@@ -14,16 +14,6 @@ font.h                          optional
 	no-obj no-implicit-rule before-depend				\
 	clean	"font.h ${SC_DFLT_FONT}-8x14 ${SC_DFLT_FONT}-8x16 ${SC_DFLT_FONT}-8x8"
 #
-hal.o				optional	ath_hal			\
-	dependency	"$S/contrib/dev/ath/public/powerpc-be-elf.hal.o.uu"	\
-	compile-with	"uudecode < $S/contrib/dev/ath/public/powerpc-be-elf.hal.o.uu" \
-	no-implicit-rule
-opt_ah.h			optional	ath_hal			\
-	dependency	"$S/contrib/dev/ath/public/powerpc-be-elf.opt_ah.h"	\
-	compile-with	"rm -f opt_ah.h; cp $S/contrib/dev/ath/public/powerpc-be-elf.opt_ah.h opt_ah.h" \
-	no-obj no-implicit-rule before-depend				\
-	clean		"opt_ah.h"
-#
 
 dev/bm/if_bm.c			optional	bm powermac
 dev/fb/fb.c			optional	sc

Modified: projects/vap7/sys/conf/files.sparc64
==============================================================================
--- projects/vap7/sys/conf/files.sparc64	Thu Jan  8 23:50:32 2009	(r186917)
+++ projects/vap7/sys/conf/files.sparc64	Fri Jan  9 01:47:24 2009	(r186918)
@@ -22,16 +22,6 @@ ukbdmap.h			optional	ukbd_dflt_keymap	\
 	no-obj no-implicit-rule before-depend				\
 	clean		"ukbdmap.h"
 #
-hal.o				optional	ath_hal			\
-	dependency	"$S/contrib/dev/ath/public/sparc64-be-elf.hal.o.uu"	\
-	compile-with	"uudecode < $S/contrib/dev/ath/public/sparc64-be-elf.hal.o.uu" \
-	no-implicit-rule
-opt_ah.h			optional	ath_hal			\
-	dependency	"$S/contrib/dev/ath/public/sparc64-be-elf.opt_ah.h"	\
-	compile-with	"rm -f opt_ah.h; cp $S/contrib/dev/ath/public/sparc64-be-elf.opt_ah.h opt_ah.h" \
-	no-obj no-implicit-rule before-depend				\
-	clean		"opt_ah.h"
-#
 crypto/blowfish/bf_enc.c	optional	crypto | ipsec 
 crypto/des/des_enc.c		optional	crypto | ipsec | netsmb
 dev/atkbdc/atkbd.c		optional	atkbd atkbdc

Modified: projects/vap7/sys/conf/kern.pre.mk
==============================================================================
--- projects/vap7/sys/conf/kern.pre.mk	Thu Jan  8 23:50:32 2009	(r186917)
+++ projects/vap7/sys/conf/kern.pre.mk	Fri Jan  9 01:47:24 2009	(r186918)
@@ -67,8 +67,8 @@ INCLUDES+= -I$S/contrib/ipfilter
 # ... and the same for pf
 INCLUDES+= -I$S/contrib/pf
 
-# ... and the same for Atheros HAL
-INCLUDES+= -I$S/dev/ath
+# ... and the same for ath
+INCLUDES+= -I$S/dev/ath -I$S/dev/ath/ath_hal
 
 # ... and the same for the NgATM stuff
 INCLUDES+= -I$S/contrib/ngatm

Modified: projects/vap7/sys/conf/options
==============================================================================
--- projects/vap7/sys/conf/options	Thu Jan  8 23:50:32 2009	(r186917)
+++ projects/vap7/sys/conf/options	Fri Jan  9 01:47:24 2009	(r186918)
@@ -726,6 +726,27 @@ ATH_TXBUF		opt_ath.h
 ATH_RXBUF		opt_ath.h
 ATH_DIAGAPI		opt_ath.h
 ATH_TX99_DIAG		opt_ath.h
+ATH_SUPPORT_TDMA	opt_ath.h
+
+# options for the Atheros hal
+AH_SUPPORT_AR5416	opt_ah.h
+
+AH_DEBUG		opt_ah.h
+AH_ASSERT		opt_ah.h
+AH_DEBUG_ALQ		opt_ah.h
+AH_REGOPS_FUNC		opt_ah.h
+AH_WRITE_REGDOMAIN	opt_ah.h
+AH_DEBUG_COUNTRY	opt_ah.h
+AH_WRITE_EEPROM		opt_ah.h
+AH_PRIVATE_DIAG		opt_ah.h
+AH_NEED_DESC_SWAP	opt_ah.h
+AH_USE_INIPDGAIN	opt_ah.h
+AH_SUPPORT_11D		opt_ah.h
+
+# options for the Marvell 8335 wireless driver
+MALO_DEBUG		opt_malo.h
+MALO_TXBUF		opt_malo.h
+MALO_RXBUF		opt_malo.h
 
 # dcons options 
 DCONS_BUF_SIZE		opt_dcons.h
@@ -754,4 +775,17 @@ XBOX			opt_xbox.h
 XFS
 
 # Interrupt filtering
-INTR_FILTER             opt_global.h
+INTR_FILTER
+
+# 802.11 support layer
+IEEE80211_DEBUG		opt_wlan.h
+IEEE80211_DEBUG_REFCNT	opt_wlan.h
+IEEE80211_AMPDU_AGE	opt_wlan.h
+IEEE80211_SUPPORT_TDMA	opt_wlan.h
+
+# 802.11 TDMA support
+TDMA_SLOTLEN_DEFAULT	opt_tdma.h
+TDMA_SLOTCNT_DEFAULT	opt_tdma.h
+TDMA_BINTVAL_DEFAULT	opt_tdma.h
+TDMA_TXRATE_11B_DEFAULT	opt_tdma.h
+TDMA_TXRATE_11G_DEFAULT	opt_tdma.h

Modified: projects/vap7/sys/dev/ath/ah_osdep.c
==============================================================================
--- projects/vap7/sys/dev/ath/ah_osdep.c	Thu Jan  8 23:50:32 2009	(r186917)
+++ projects/vap7/sys/dev/ath/ah_osdep.c	Fri Jan  9 01:47:24 2009	(r186918)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2002-2007 Sam Leffler, Errno Consulting
+ * Copyright (c) 2002-2008 Sam Leffler, Errno Consulting
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -43,7 +43,7 @@
 
 #include <net/ethernet.h>		/* XXX for ether_sprintf */
 
-#include <contrib/dev/ath/ah.h>
+#include <dev/ath/ath_hal/ah.h>
 
 /*
  * WiSoC boards overload the bus tag with information about the
@@ -56,7 +56,7 @@
 #define	BUSTAG(ah) \
 	((bus_space_tag_t) ((struct ar531x_config *)((ah)->ah_st))->tag)
 #else
-#define	BUSTAG(ah)	((bus_space_tag_t) (ah)->ah_st)
+#define	BUSTAG(ah)	((ah)->ah_st)
 #endif
 
 extern	void ath_hal_printf(struct ath_hal *, const char*, ...)
@@ -71,8 +71,12 @@ extern	void ath_hal_assert_failed(const 
 		int lineno, const char* msg);
 #endif
 #ifdef AH_DEBUG
+#if HAL_ABI_VERSION >= 0x08090101
+extern	void HALDEBUG(struct ath_hal *ah, u_int mask, const char* fmt, ...);
+#else
 extern	void HALDEBUG(struct ath_hal *ah, const char* fmt, ...);
 extern	void HALDEBUGn(struct ath_hal *ah, u_int level, const char* fmt, ...);
+#endif
 #endif /* AH_DEBUG */
 
 /* NB: put this here instead of the driver to avoid circular references */
@@ -86,9 +90,6 @@ SYSCTL_INT(_hw_ath_hal, OID_AUTO, debug,
 TUNABLE_INT("hw.ath.hal.debug", &ath_hal_debug);
 #endif /* AH_DEBUG */
 
-SYSCTL_STRING(_hw_ath_hal, OID_AUTO, version, CTLFLAG_RD, ath_hal_version, 0,
-	"Atheros HAL version");
-
 /* NB: these are deprecated; they exist for now for compatibility */
 int	ath_hal_dma_beacon_response_time = 2;	/* in TU's */
 SYSCTL_INT(_hw_ath_hal, OID_AUTO, dma_brt, CTLFLAG_RW,
@@ -139,6 +140,18 @@ ath_hal_ether_sprintf(const u_int8_t *ma
 }
 
 #ifdef AH_DEBUG
+#if HAL_ABI_VERSION >= 0x08090101
+void
+HALDEBUG(struct ath_hal *ah, u_int mask, const char* fmt, ...)
+{
+	if (ath_hal_debug & mask) {
+		__va_list ap;
+		va_start(ap, fmt);
+		ath_hal_vprintf(ah, fmt, ap);
+		va_end(ap);
+	}
+}
+#else
 void
 HALDEBUG(struct ath_hal *ah, const char* fmt, ...)
 {
@@ -160,6 +173,7 @@ HALDEBUGn(struct ath_hal *ah, u_int leve
 		va_end(ap);
 	}
 }
+#endif
 #endif /* AH_DEBUG */
 
 #ifdef AH_DEBUG_ALQ
@@ -178,7 +192,7 @@ HALDEBUGn(struct ath_hal *ah, u_int leve
  */
 #include <sys/alq.h>
 #include <sys/pcpu.h>
-#include <contrib/dev/ath/ah_decode.h>
+#include <dev/ath/ath_hal/ah_decode.h>
 
 static	struct alq *ath_hal_alq;
 static	int ath_hal_alq_emitdev;	/* need to emit DEVICE record */
@@ -256,7 +270,7 @@ void
 ath_hal_reg_write(struct ath_hal *ah, u_int32_t reg, u_int32_t val)
 {
 	bus_space_tag_t tag = BUSTAG(ah);
-	bus_space_handle_t h = (bus_space_handle_t) ah->ah_sh;
+	bus_space_handle_t h = ah->ah_sh;
 
 	if (ath_hal_alq) {
 		struct ale *ale = ath_hal_alq_get(ah);
@@ -280,7 +294,7 @@ u_int32_t
 ath_hal_reg_read(struct ath_hal *ah, u_int32_t reg)
 {
 	bus_space_tag_t tag = BUSTAG(ah);
-	bus_space_handle_t h = (bus_space_handle_t) ah->ah_sh;
+	bus_space_handle_t h = ah->ah_sh;
 	u_int32_t val;
 
 #if _BYTE_ORDER == _BIG_ENDIAN
@@ -332,7 +346,7 @@ void
 ath_hal_reg_write(struct ath_hal *ah, u_int32_t reg, u_int32_t val)
 {
 	bus_space_tag_t tag = BUSTAG(ah);
-	bus_space_handle_t h = (bus_space_handle_t) ah->ah_sh;
+	bus_space_handle_t h = ah->ah_sh;
 
 #if _BYTE_ORDER == _BIG_ENDIAN
 	if (reg >= 0x4000 && reg < 0x5000)
@@ -346,7 +360,7 @@ u_int32_t
 ath_hal_reg_read(struct ath_hal *ah, u_int32_t reg)
 {
 	bus_space_tag_t tag = BUSTAG(ah);
-	bus_space_handle_t h = (bus_space_handle_t) ah->ah_sh;
+	bus_space_handle_t h = ah->ah_sh;
 	u_int32_t val;
 
 #if _BYTE_ORDER == _BIG_ENDIAN
@@ -398,37 +412,3 @@ ath_hal_memcpy(void *dst, const void *sr
 {
 	return memcpy(dst, src, n);
 }
-
-/*
- * Module glue.
- */
-
-static int
-ath_hal_modevent(module_t mod, int type, void *unused)
-{
-	const char *sep;
-	int i;
-
-	switch (type) {
-	case MOD_LOAD:
-		printf("ath_hal: %s (", ath_hal_version);
-		sep = "";
-		for (i = 0; ath_hal_buildopts[i] != NULL; i++) {
-			printf("%s%s", sep, ath_hal_buildopts[i]);
-			sep = ", ";
-		}
-		printf(")\n");
-		return 0;
-	case MOD_UNLOAD:
-		return 0;
-	}
-	return EINVAL;
-}
-
-static moduledata_t ath_hal_mod = {
-	"ath_hal",
-	ath_hal_modevent,
-	0
-};
-DECLARE_MODULE(ath_hal, ath_hal_mod, SI_SUB_DRIVERS, SI_ORDER_ANY);
-MODULE_VERSION(ath_hal, 1);

Modified: projects/vap7/sys/dev/ath/ah_osdep.h
==============================================================================
--- projects/vap7/sys/dev/ath/ah_osdep.h	Thu Jan  8 23:50:32 2009	(r186917)
+++ projects/vap7/sys/dev/ath/ah_osdep.h	Fri Jan  9 01:47:24 2009	(r186918)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2002-2007 Sam Leffler, Errno Consulting
+ * Copyright (c) 2002-2008 Sam Leffler, Errno Consulting
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -33,13 +33,29 @@
 /*
  * Atheros Hardware Access Layer (HAL) OS Dependent Definitions.
  */
+#include <sys/cdefs.h>
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/endian.h>
+#include <sys/linker_set.h>
 
 #include <machine/bus.h>
 
 /*
+ * Bus i/o type definitions.
+ */
+typedef void *HAL_SOFTC;
+typedef bus_space_tag_t HAL_BUS_TAG;
+typedef bus_space_handle_t HAL_BUS_HANDLE;
+
+/*
+ * Linker set writearounds for chip and RF backend registration.
+ */
+#define	OS_DATA_SET(set, item)	DATA_SET(set, item)
+#define	OS_SET_DECLARE(set, ptype)	SET_DECLARE(set, ptype)
+#define	OS_SET_FOREACH(pvar, set)	SET_FOREACH(pvar, set)
+
+/*
  * Delay n microseconds.
  */
 extern	void ath_hal_delay(int);

Modified: projects/vap7/sys/dev/ath/ath_rate/amrr/amrr.c
==============================================================================
--- projects/vap7/sys/dev/ath/ath_rate/amrr/amrr.c	Thu Jan  8 23:50:32 2009	(r186917)
+++ projects/vap7/sys/dev/ath/ath_rate/amrr/amrr.c	Fri Jan  9 01:47:24 2009	(r186918)
@@ -46,11 +46,11 @@ __FBSDID("$FreeBSD$");
  *    Mathieu Lacage, Hossein Manshaei, Thierry Turletti
  */
 #include "opt_inet.h"
+#include "opt_wlan.h"
 
 #include <sys/param.h>
 #include <sys/systm.h> 
 #include <sys/sysctl.h>
-#include <sys/module.h>
 #include <sys/kernel.h>
 #include <sys/lock.h>
 #include <sys/mutex.h>
@@ -65,7 +65,6 @@ __FBSDID("$FreeBSD$");
 #include <net/if.h>
 #include <net/if_media.h>
 #include <net/if_arp.h>
-#include <net/ethernet.h>		/* XXX for ether_sprintf */
 
 #include <net80211/ieee80211_var.h>
 
@@ -78,23 +77,12 @@ __FBSDID("$FreeBSD$");
 
 #include <dev/ath/if_athvar.h>
 #include <dev/ath/ath_rate/amrr/amrr.h>
-#include <contrib/dev/ath/ah_desc.h>
-
-#define	AMRR_DEBUG
-#ifdef AMRR_DEBUG
-#define	DPRINTF(sc, _fmt, ...) do {					\
-	if (sc->sc_debug & 0x10)					\
-		printf(_fmt, __VA_ARGS__);				\
-} while (0)
-#else
-#define	DPRINTF(sc, _fmt, ...)
-#endif
+#include <dev/ath/ath_hal/ah_desc.h>
 
 static	int ath_rateinterval = 1000;		/* rate ctl interval (ms)  */
 static	int ath_rate_max_success_threshold = 10;
 static	int ath_rate_min_success_threshold = 1;
 
-static void	ath_ratectl(void *);
 static void	ath_rate_update(struct ath_softc *, struct ieee80211_node *,
 			int rate);
 static void	ath_rate_ctl_start(struct ath_softc *, struct ieee80211_node *);
@@ -104,7 +92,6 @@ void
 ath_rate_node_init(struct ath_softc *sc, struct ath_node *an)
 {
 	/* NB: assumed to be zero'd by caller */
-	ath_rate_update(sc, &an->an_node, 0);
 }
 
 void
@@ -166,6 +153,11 @@ ath_rate_tx_complete(struct ath_softc *s
 		amn->amn_tx_try3_cnt++;
 		amn->amn_tx_failure_cnt++;
 	}
+	if (amn->amn_interval != 0 &&
+	    ticks - amn->amn_ticks > amn->amn_interval) {
+		ath_rate_ctl(sc, &an->an_node);
+		amn->amn_ticks = ticks;
+	}
 }
 
 void
@@ -176,7 +168,7 @@ ath_rate_newassoc(struct ath_softc *sc, 
 }
 
 static void 
-node_reset (struct amrr_node *amn)
+node_reset(struct amrr_node *amn)
 {
 	amn->amn_tx_try0_cnt = 0;
 	amn->amn_tx_try1_cnt = 0;
@@ -200,17 +192,18 @@ ath_rate_update(struct ath_softc *sc, st
 {
 	struct ath_node *an = ATH_NODE(ni);
 	struct amrr_node *amn = ATH_NODE_AMRR(an);
+	struct ieee80211vap *vap = ni->ni_vap;
 	const HAL_RATE_TABLE *rt = sc->sc_currates;
 	u_int8_t rix;
 
 	KASSERT(rt != NULL, ("no rate table, mode %u", sc->sc_curmode));
 
-	DPRINTF(sc, "%s: set xmit rate for %s to %dM\n",
-	    __func__, ether_sprintf(ni->ni_macaddr),
+	IEEE80211_NOTE(vap, IEEE80211_MSG_RATECTL, ni,
+	    "%s: set xmit rate to %dM", __func__, 
 	    ni->ni_rates.rs_nrates > 0 ?
 		(ni->ni_rates.rs_rates[rate] & IEEE80211_RATE_VAL) / 2 : 0);
 
-	ni->ni_txrate = rate;
+	amn->amn_rix = rate;
 	/*
 	 * Before associating a node has no rate set setup
 	 * so we can't calculate any transmit codes to use.
@@ -219,8 +212,8 @@ ath_rate_update(struct ath_softc *sc, st
 	 * lowest hardware rate.
 	 */
 	if (ni->ni_rates.rs_nrates > 0) {
-		amn->amn_tx_rix0 = sc->sc_rixmap[
-					       ni->ni_rates.rs_rates[rate] & IEEE80211_RATE_VAL];
+		ni->ni_txrate = ni->ni_rates.rs_rates[rate] & IEEE80211_RATE_VAL;
+		amn->amn_tx_rix0 = sc->sc_rixmap[ni->ni_txrate];
 		amn->amn_tx_rate0 = rt->info[amn->amn_tx_rix0].rateCode;
 		amn->amn_tx_rate0sp = amn->amn_tx_rate0 |
 			rt->info[amn->amn_tx_rix0].shortPreamble;
@@ -268,7 +261,12 @@ ath_rate_update(struct ath_softc *sc, st
 			amn->amn_tx_rate3 = amn->amn_tx_rate3sp = 0;
 		}
 	}
-	node_reset (amn);
+	node_reset(amn);
+
+	amn->amn_interval = ath_rateinterval;
+	if (vap->iv_opmode == IEEE80211_M_STA)
+		amn->amn_interval /= 2;
+	amn->amn_interval = (amn->amn_interval * hz) / 1000;
 }
 
 /*
@@ -278,11 +276,11 @@ static void
 ath_rate_ctl_start(struct ath_softc *sc, struct ieee80211_node *ni)
 {
 #define	RATE(_ix)	(ni->ni_rates.rs_rates[(_ix)] & IEEE80211_RATE_VAL)
-	struct ieee80211com *ic = &sc->sc_ic;
+	const struct ieee80211_txparam *tp = ni->ni_txparms;
 	int srate;
 
 	KASSERT(ni->ni_rates.rs_nrates > 0, ("no rates"));
-	if (ic->ic_fixed_rate == IEEE80211_FIXED_RATE_NONE) {
+	if (tp == NULL || tp->ucastrate == IEEE80211_FIXED_RATE_NONE) {
 		/*
 		 * No fixed rate is requested. For 11b start with
 		 * the highest negotiated rate; otherwise, for 11g
@@ -308,7 +306,7 @@ ath_rate_ctl_start(struct ath_softc *sc,
 		 */
 		/* NB: the rate set is assumed sorted */
 		srate = ni->ni_rates.rs_nrates - 1;
-		for (; srate >= 0 && RATE(srate) != ic->ic_fixed_rate; srate--)
+		for (; srate >= 0 && RATE(srate) != tp->ucastrate; srate--)
 			;
 	}
 	/*
@@ -321,64 +319,6 @@ ath_rate_ctl_start(struct ath_softc *sc,
 #undef RATE
 }
 
-static void
-ath_rate_cb(void *arg, struct ieee80211_node *ni)
-{
-	struct ath_softc *sc = arg;
-
-	ath_rate_update(sc, ni, 0);
-}
-
-/*
- * Reset the rate control state for each 802.11 state transition.
- */
-void
-ath_rate_newstate(struct ath_softc *sc, enum ieee80211_state state)
-{
-	struct amrr_softc *asc = (struct amrr_softc *) sc->sc_rc;
-	struct ieee80211com *ic = &sc->sc_ic;
-	struct ieee80211_node *ni;
-
-	if (state == IEEE80211_S_INIT) {
-		callout_stop(&asc->timer);
-		return;
-	}
-	if (ic->ic_opmode == IEEE80211_M_STA) {
-		/*
-		 * Reset local xmit state; this is really only
-		 * meaningful when operating in station mode.
-		 */
-		ni = ic->ic_bss;
-		if (state == IEEE80211_S_RUN) {
-			ath_rate_ctl_start(sc, ni);
-		} else {
-			ath_rate_update(sc, ni, 0);
-		}
-	} else {
-		/*
-		 * When operating as a station the node table holds
-		 * the AP's that were discovered during scanning.
-		 * For any other operating mode we want to reset the
-		 * tx rate state of each node.
-		 */
-		ieee80211_iterate_nodes(&ic->ic_sta, ath_rate_cb, sc);
-		ath_rate_update(sc, ic->ic_bss, 0);
-	}
-	if (ic->ic_fixed_rate == IEEE80211_FIXED_RATE_NONE &&
-	    state == IEEE80211_S_RUN) {
-		int interval;
-		/*
-		 * Start the background rate control thread if we
-		 * are not configured to use a fixed xmit rate.
-		 */
-		interval = ath_rateinterval;
-		if (ic->ic_opmode == IEEE80211_M_STA)
-			interval /= 2;
-		callout_reset(&asc->timer, (interval * hz) / 1000,
-			ath_ratectl, sc->sc_ifp);
-	}
-}
-
 /* 
  * Examine and potentially adjust the transmit rate.
  */
@@ -387,7 +327,7 @@ ath_rate_ctl(void *arg, struct ieee80211
 {
 	struct ath_softc *sc = arg;
 	struct amrr_node *amn = ATH_NODE_AMRR(ATH_NODE (ni));
-	int old_rate;
+	int rix;
 
 #define is_success(amn) \
 (amn->amn_tx_try1_cnt  < (amn->amn_tx_try0_cnt/10))
@@ -395,52 +335,53 @@ ath_rate_ctl(void *arg, struct ieee80211
 (amn->amn_tx_try0_cnt > 10)
 #define is_failure(amn) \
 (amn->amn_tx_try1_cnt > (amn->amn_tx_try0_cnt/3))
-#define is_max_rate(ni) \
-((ni->ni_txrate + 1) >= ni->ni_rates.rs_nrates)
-#define is_min_rate(ni) \
-(ni->ni_txrate == 0)
 
-	old_rate = ni->ni_txrate;
+	rix = amn->amn_rix;
   
-  	DPRINTF (sc, "cnt0: %d cnt1: %d cnt2: %d cnt3: %d -- threshold: %d\n",
-		 amn->amn_tx_try0_cnt,
-		 amn->amn_tx_try1_cnt,
-		 amn->amn_tx_try2_cnt,
-		 amn->amn_tx_try3_cnt,
-		 amn->amn_success_threshold);
+  	IEEE80211_NOTE(ni->ni_vap, IEEE80211_MSG_RATECTL, ni,
+	    "cnt0: %d cnt1: %d cnt2: %d cnt3: %d -- threshold: %d",
+	    amn->amn_tx_try0_cnt, amn->amn_tx_try1_cnt, amn->amn_tx_try2_cnt,
+	    amn->amn_tx_try3_cnt, amn->amn_success_threshold);
   	if (is_success (amn) && is_enough (amn)) {
 		amn->amn_success++;
 		if (amn->amn_success == amn->amn_success_threshold &&
-  		    !is_max_rate (ni)) {
+		    rix + 1 < ni->ni_rates.rs_nrates) {
   			amn->amn_recovery = 1;
   			amn->amn_success = 0;
-  			ni->ni_txrate++;
-			DPRINTF (sc, "increase rate to %d\n", ni->ni_txrate);
+  			rix++;
+			IEEE80211_NOTE(ni->ni_vap, IEEE80211_MSG_RATECTL, ni,
+			    "increase rate to %d", rix);
   		} else {
 			amn->amn_recovery = 0;
 		}
   	} else if (is_failure (amn)) {
   		amn->amn_success = 0;
-  		if (!is_min_rate (ni)) {
+		if (rix > 0) {
   			if (amn->amn_recovery) {

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

From owner-svn-src-projects@FreeBSD.ORG  Fri Jan  9 19:45:08 2009
Return-Path: <owner-svn-src-projects@FreeBSD.ORG>
Delivered-To: svn-src-projects@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2C816106566C;
	Fri,  9 Jan 2009 19:45:08 +0000 (UTC)
	(envelope-from thompsa@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1719A8FC13;
	Fri,  9 Jan 2009 19:45:08 +0000 (UTC)
	(envelope-from thompsa@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n09Jj7vW066469;
	Fri, 9 Jan 2009 19:45:07 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n09Jj7fY066452;
	Fri, 9 Jan 2009 19:45:07 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <200901091945.n09Jj7fY066452@svn.freebsd.org>
From: Andrew Thompson <thompsa@FreeBSD.org>
Date: Fri, 9 Jan 2009 19:45:07 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-projects@freebsd.org
X-SVN-Group: projects
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r186964 - in projects/vap7: etc/mtree include lib
	lib/libusb20 share/man/man7 share/mk sys/conf
	sys/dev/sound/pcm sys/dev/usb sys/dev/usb2 sys/dev/usb2/core
	sys/dev/usb2/serial sys/i386...
X-BeenThere: svn-src-projects@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the src &quot; projects&quot;
	tree" <svn-src-projects.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
	<mailto:svn-src-projects-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-projects>
List-Post: <mailto:svn-src-projects@freebsd.org>
List-Help: <mailto:svn-src-projects-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
	<mailto:svn-src-projects-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 09 Jan 2009 19:45:08 -0000

Author: thompsa
Date: Fri Jan  9 19:45:06 2009
New Revision: 186964
URL: http://svn.freebsd.org/changeset/base/186964

Log:
  Bring in USB2, libusb20 and usbconfig from HEAD.

Added:
  projects/vap7/lib/libusb20/   (props changed)
     - copied from r186961, head/lib/libusb20/
  projects/vap7/sys/dev/usb2/   (props changed)
     - copied from r186961, head/sys/dev/usb2/
  projects/vap7/sys/i386/conf/USB2   (contents, props changed)
     - copied, changed from r186962, head/sys/i386/conf/USB2
  projects/vap7/sys/modules/usb2/   (props changed)
     - copied from r186961, head/sys/modules/usb2/
  projects/vap7/usr.sbin/usbconfig/   (props changed)
     - copied from r186962, head/usr.sbin/usbconfig/
Modified:
  projects/vap7/etc/mtree/BSD.include.dist
  projects/vap7/include/Makefile
  projects/vap7/lib/Makefile
  projects/vap7/share/man/man7/hier.7
  projects/vap7/share/mk/bsd.libnames.mk
  projects/vap7/sys/conf/files
  projects/vap7/sys/conf/kmod.mk
  projects/vap7/sys/dev/sound/pcm/channel.c
  projects/vap7/sys/dev/sound/pcm/channel.h
  projects/vap7/sys/dev/sound/pcm/mixer.c
  projects/vap7/sys/dev/sound/pcm/mixer.h
  projects/vap7/sys/dev/usb/rio500_usb.h
  projects/vap7/sys/dev/usb2/core/usb2_dev.c
  projects/vap7/sys/dev/usb2/serial/usb2_serial.c
  projects/vap7/sys/modules/Makefile
  projects/vap7/usr.sbin/Makefile

Modified: projects/vap7/etc/mtree/BSD.include.dist
==============================================================================
--- projects/vap7/etc/mtree/BSD.include.dist	Fri Jan  9 18:38:57 2009	(r186963)
+++ projects/vap7/etc/mtree/BSD.include.dist	Fri Jan  9 19:45:06 2009	(r186964)
@@ -120,6 +120,10 @@
         ..
         usb
         ..
+        usb2
+            include
+            ..
+        ..
         utopia
         ..
         vkbd

Modified: projects/vap7/include/Makefile
==============================================================================
--- projects/vap7/include/Makefile	Fri Jan  9 18:38:57 2009	(r186963)
+++ projects/vap7/include/Makefile	Fri Jan  9 19:45:06 2009	(r186964)
@@ -57,7 +57,7 @@ LSUBDIRS=	cam/scsi \
 	security/mac_mls security/mac_partition \
 	ufs/ffs ufs/ufs
 
-LSUBSUBDIRS=	dev/mpt/mpilib
+LSUBSUBDIRS=	dev/mpt/mpilib dev/usb2/include
 
 .if ${MACHINE_ARCH} == "powerpc"
 _dev_powermac_nvram=	dev/powermac_nvram

Modified: projects/vap7/lib/Makefile
==============================================================================
--- projects/vap7/lib/Makefile	Fri Jan  9 18:38:57 2009	(r186963)
+++ projects/vap7/lib/Makefile	Fri Jan  9 19:45:06 2009	(r186964)
@@ -37,7 +37,8 @@ SUBDIR=	${_csu} libc libbsm libcom_err l
 	libpmc libproc ${_libkse} librt ${_libsdp} ${_libsm} ${_libsmb} \
 	${_libsmdb} \
 	${_libsmutil} libstand libtelnet ${_libthr} libthread_db libufs \
-	libugidfw ${_libusbhid} ${_libvgl} libwrap liby libz ${_bind}
+	libugidfw ${_libusbhid} ${_libusb20} ${_libvgl} libwrap liby libz \
+	${_bind}
 
 .if exists(${.CURDIR}/csu/${MACHINE_ARCH}-elf)
 _csu=csu/${MACHINE_ARCH}-elf
@@ -112,6 +113,7 @@ _libthr=	libthr
 
 .if ${MK_USB} != "no"
 _libusbhid=	libusbhid
+_libusb20=	libusb20
 .endif
 
 .if ${MK_NIS} != "no"

Modified: projects/vap7/share/man/man7/hier.7
==============================================================================
--- projects/vap7/share/man/man7/hier.7	Fri Jan  9 18:38:57 2009	(r186963)
+++ projects/vap7/share/man/man7/hier.7	Fri Jan  9 19:45:06 2009	(r186964)
@@ -236,6 +236,8 @@ see
 .Xr ppbus 4
 .It Pa usb/
 The USB subsystem
+.It Pa usb2/include
+The USB subsystem
 .It Pa utopia/
 Physical chip driver for ATM interfaces;
 see

Modified: projects/vap7/share/mk/bsd.libnames.mk
==============================================================================
--- projects/vap7/share/mk/bsd.libnames.mk	Fri Jan  9 18:38:57 2009	(r186963)
+++ projects/vap7/share/mk/bsd.libnames.mk	Fri Jan  9 19:45:06 2009	(r186964)
@@ -145,6 +145,7 @@ LIBUFS?=	${DESTDIR}${LIBDIR}/libufs.a
 LIBUGIDFW?=	${DESTDIR}${LIBDIR}/libugidfw.a
 LIBUMEM?=	${DESTDIR}${LIBDIR}/libumem.a
 LIBUSBHID?=	${DESTDIR}${LIBDIR}/libusbhid.a
+LIBUSB20?=	${DESTDIR}${LIBDIR}/libusb20.a
 LIBUTIL?=	${DESTDIR}${LIBDIR}/libutil.a
 LIBUUTIL?=	${DESTDIR}${LIBDIR}/libuutil.a
 LIBVGL?=	${DESTDIR}${LIBDIR}/libvgl.a

Modified: projects/vap7/sys/conf/files
==============================================================================
--- projects/vap7/sys/conf/files	Fri Jan  9 18:38:57 2009	(r186963)
+++ projects/vap7/sys/conf/files	Fri Jan  9 19:45:06 2009	(r186964)
@@ -1315,6 +1315,146 @@ dev/usb/uscanner.c		optional uscanner
 dev/usb/uslcom.c		optional uslcom
 dev/usb/uvisor.c		optional uvisor
 dev/usb/uvscom.c		optional uvscom
+#
+# USB2 controller drivers
+#
+dev/usb2/controller/at91dci.c		optional usb2_core usb2_controller usb2_controller_at91dci
+dev/usb2/controller/at91dci_atmelarm.c	optional usb2_core usb2_controller usb2_controller_at91dci at91rm9200
+dev/usb2/controller/musb2_otg.c		optional usb2_core usb2_controller usb2_controller_musb
+dev/usb2/controller/musb2_otg_atmelarm.c optional usb2_core usb2_controller usb2_controller_musb at91rm9200
+dev/usb2/controller/ehci2.c		optional usb2_core usb2_controller usb2_controller_ehci
+dev/usb2/controller/ehci2_pci.c		optional usb2_core usb2_controller usb2_controller_ehci pci
+dev/usb2/controller/ohci2.c		optional usb2_core usb2_controller usb2_controller_ohci
+dev/usb2/controller/ohci2_atmelarm.c	optional usb2_core usb2_controller usb2_controller_ohci at91rm9200
+dev/usb2/controller/ohci2_pci.c		optional usb2_core usb2_controller usb2_controller_ohci pci
+dev/usb2/controller/uhci2.c		optional usb2_core usb2_controller usb2_controller_uhci
+dev/usb2/controller/uhci2_pci.c		optional usb2_core usb2_controller usb2_controller_uhci pci
+dev/usb2/controller/uss820dci.c		optional usb2_core usb2_controller usb2_controller_uss820dci
+dev/usb2/controller/uss820dci_atmelarm.c	optional usb2_core usb2_controller usb2_controller_uss820dci at91rm9200
+dev/usb2/controller/usb2_controller.c	optional usb2_core usb2_controller
+#
+# USB2 storage drivers
+#
+dev/usb2/storage/ata-usb2.c		optional usb2_core usb2_storage usb2_storage_ata
+dev/usb2/storage/umass2.c		optional usb2_core usb2_storage usb2_storage_mass
+dev/usb2/storage/urio2.c		optional usb2_core usb2_storage usb2_storage_rio
+dev/usb2/storage/usb2_storage.c		optional usb2_core usb2_storage
+dev/usb2/storage/ustorage2_fs.c		optional usb2_core usb2_storage usb2_storage_fs
+#
+# USB2 NDIS driver
+#
+dev/usb2/ndis/if_ndis_usb2.c		optional usb2_core usb2_ndis
+dev/usb2/ndis/usb2_ndis.c		optional usb2_core usb2_ndis
+#
+# USB2 core
+#
+dev/usb2/core/usb2_busdma.c		optional usb2_core
+dev/usb2/core/usb2_compat_linux.c	optional usb2_core
+dev/usb2/core/usb2_config_td.c		optional usb2_core
+dev/usb2/core/usb2_core.c		optional usb2_core
+dev/usb2/core/usb2_debug.c		optional usb2_core
+dev/usb2/core/usb2_dev.c		optional usb2_core
+dev/usb2/core/usb2_device.c		optional usb2_core
+dev/usb2/core/usb2_dynamic.c		optional usb2_core
+dev/usb2/core/usb2_error.c		optional usb2_core
+dev/usb2/core/usb2_generic.c		optional usb2_core
+dev/usb2/core/usb2_handle_request.c	optional usb2_core
+dev/usb2/core/usb2_hid.c		optional usb2_core
+dev/usb2/core/usb2_hub.c		optional usb2_core
+dev/usb2/core/usb2_if.m			optional usb2_core
+dev/usb2/core/usb2_lookup.c		optional usb2_core
+dev/usb2/core/usb2_mbuf.c		optional usb2_core
+dev/usb2/core/usb2_msctest.c		optional usb2_core
+dev/usb2/core/usb2_parse.c		optional usb2_core
+dev/usb2/core/usb2_process.c		optional usb2_core
+dev/usb2/core/usb2_request.c		optional usb2_core
+dev/usb2/core/usb2_sw_transfer.c	optional usb2_core
+dev/usb2/core/usb2_transfer.c		optional usb2_core
+dev/usb2/core/usb2_util.c		optional usb2_core
+#
+# USB2 ethernet drivers
+#
+dev/usb2/ethernet/if_aue2.c		optional usb2_core usb2_ethernet usb2_ethernet_aue
+dev/usb2/ethernet/if_axe2.c		optional usb2_core usb2_ethernet usb2_ethernet_axe
+dev/usb2/ethernet/if_cdce2.c		optional usb2_core usb2_ethernet usb2_ethernet_cdce
+dev/usb2/ethernet/if_cue2.c		optional usb2_core usb2_ethernet usb2_ethernet_cue
+dev/usb2/ethernet/if_kue2.c		optional usb2_core usb2_ethernet usb2_ethernet_kue
+dev/usb2/ethernet/if_rue2.c		optional usb2_core usb2_ethernet usb2_ethernet_rue
+dev/usb2/ethernet/if_udav2.c		optional usb2_core usb2_ethernet usb2_ethernet_dav
+dev/usb2/ethernet/usb2_ethernet.c	optional usb2_core usb2_ethernet
+#
+# USB2 WLAN drivers
+#
+dev/usb2/wlan/if_rum2.c		optional usb2_core usb2_wlan usb2_wlan_rum
+dev/usb2/wlan/if_ural2.c	optional usb2_core usb2_wlan usb2_wlan_ral
+dev/usb2/wlan/if_zyd2.c		optional usb2_core usb2_wlan usb2_wlan_zyd
+dev/usb2/wlan/usb2_wlan.c	optional usb2_core usb2_wlan
+#
+# USB2 serial and parallel port drivers
+#
+dev/usb2/serial/uark2.c		optional usb2_core usb2_serial usb2_serial_ark
+dev/usb2/serial/ubsa2.c		optional usb2_core usb2_serial usb2_serial_bsa
+dev/usb2/serial/ubser2.c	optional usb2_core usb2_serial usb2_serial_bser
+dev/usb2/serial/uchcom2.c	optional usb2_core usb2_serial usb2_serial_chcom
+dev/usb2/serial/ucycom2.c	optional usb2_core usb2_serial usb2_serial_cycom
+dev/usb2/serial/ufoma2.c	optional usb2_core usb2_serial usb2_serial_foma
+dev/usb2/serial/uftdi2.c	optional usb2_core usb2_serial usb2_serial_ftdi
+dev/usb2/serial/ugensa2.c	optional usb2_core usb2_serial usb2_serial_gensa
+dev/usb2/serial/uipaq2.c	optional usb2_core usb2_serial usb2_serial_ipaq
+dev/usb2/serial/ulpt2.c		optional usb2_core usb2_serial usb2_serial_lpt
+dev/usb2/serial/umct2.c		optional usb2_core usb2_serial usb2_serial_mct
+dev/usb2/serial/umodem2.c	optional usb2_core usb2_serial usb2_serial_modem
+dev/usb2/serial/umoscom2.c	optional usb2_core usb2_serial usb2_serial_moscom
+dev/usb2/serial/uplcom2.c	optional usb2_core usb2_serial usb2_serial_plcom
+dev/usb2/serial/usb2_serial.c	optional usb2_core usb2_serial
+dev/usb2/serial/uvisor2.c	optional usb2_core usb2_serial usb2_serial_visor
+dev/usb2/serial/uvscom2.c	optional usb2_core usb2_serial usb2_serial_vscom
+dev/usb2/serial/u3g2.c		optional usb2_core usb2_serial usb2_serial_3g
+#
+# USB2 bluetooth drivers
+#
+dev/usb2/bluetooth/usb2_bluetooth.c	optional usb2_core usb2_bluetooth
+dev/usb2/bluetooth/ng_ubt2.c		optional usb2_core usb2_bluetooth usb2_bluetooth_ng
+dev/usb2/bluetooth/ubtbcmfw2.c		optional usb2_core usb2_bluetooth usb2_bluetooth_fw
+
+#
+# USB2 misc drivers
+#
+dev/usb2/misc/usb2_misc.c	optional usb2_core usb2_misc
+dev/usb2/misc/ufm2.c		optional usb2_core usb2_misc usb2_misc_fm
+dev/usb2/misc/udbp2.c		optional usb2_core usb2_misc usb2_misc_dbp
+#
+# USB2 input drivers
+#
+dev/usb2/input/uhid2.c		optional usb2_core usb2_input usb2_input_hid
+dev/usb2/input/ukbd2.c		optional usb2_core usb2_input usb2_input_kbd
+dev/usb2/input/ums2.c		optional usb2_core usb2_input usb2_input_ms
+dev/usb2/input/usb2_input.c	optional usb2_core usb2_input
+#
+# USB2 quirks
+#
+dev/usb2/quirk/usb2_quirk.c	optional usb2_core usb2_quirk
+#
+# USB2 templates
+#
+dev/usb2/template/usb2_template.c	optional usb2_core usb2_template
+dev/usb2/template/usb2_template_cdce.c	optional usb2_core usb2_template
+dev/usb2/template/usb2_template_msc.c	optional usb2_core usb2_template
+dev/usb2/template/usb2_template_mtp.c	optional usb2_core usb2_template
+#
+# USB2 image drivers
+#
+dev/usb2/image/usb2_image.c	optional usb2_core usb2_image
+dev/usb2/image/uscanner2.c	optional usb2_core usb2_image usb2_scanner
+#
+# USB2 sound and MIDI drivers
+#
+dev/usb2/sound/usb2_sound.c	optional usb2_core usb2_sound
+dev/usb2/sound/uaudio2.c	optional usb2_core usb2_sound
+dev/usb2/sound/uaudio2_pcm.c	optional usb2_core usb2_sound
+#
+# USB2 END
+#
 dev/utopia/idtphy.c		optional utopia
 dev/utopia/suni.c		optional utopia
 dev/utopia/utopia.c		optional utopia

Modified: projects/vap7/sys/conf/kmod.mk
==============================================================================
--- projects/vap7/sys/conf/kmod.mk	Fri Jan  9 18:38:57 2009	(r186963)
+++ projects/vap7/sys/conf/kmod.mk	Fri Jan  9 19:45:06 2009	(r186964)
@@ -331,6 +331,7 @@ MFILES?= dev/acpica/acpi_if.m dev/ata/at
 	dev/sound/pcm/feeder_if.m dev/sound/pcm/mixer_if.m \
 	dev/sound/midi/mpu_if.m dev/sound/midi/mpufoi_if.m \
 	dev/sound/midi/synth_if.m dev/usb/usb_if.m isa/isa_if.m \
+	dev/usb2/core/usb2_if.m \
 	kern/bus_if.m kern/cpufreq_if.m kern/device_if.m kern/serdev_if.m \
 	libkern/iconv_converter_if.m opencrypto/cryptodev_if.m \
 	pc98/pc98/canbus_if.m pci/agp_if.m

Modified: projects/vap7/sys/dev/sound/pcm/channel.c
==============================================================================
--- projects/vap7/sys/dev/sound/pcm/channel.c	Fri Jan  9 18:38:57 2009	(r186963)
+++ projects/vap7/sys/dev/sound/pcm/channel.c	Fri Jan  9 19:45:06 2009	(r186964)
@@ -570,13 +570,26 @@ chn_read(struct pcm_channel *c, struct u
 void
 chn_intr(struct pcm_channel *c)
 {
-	CHN_LOCK(c);
+	uint8_t do_unlock;
+	if (CHN_LOCK_OWNED(c)) {
+		/* 
+		 * Allow sound drivers to call this function with
+		 * "CHN_LOCK()" locked:
+		 */
+		do_unlock = 0;
+	} else {
+		do_unlock = 1;
+		CHN_LOCK(c);
+	}
 	c->interrupts++;
 	if (c->direction == PCMDIR_PLAY)
 		chn_wrintr(c);
 	else
 		chn_rdintr(c);
-	CHN_UNLOCK(c);
+	if (do_unlock) {
+		CHN_UNLOCK(c);
+	}
+	return;
 }
 
 u_int32_t

Modified: projects/vap7/sys/dev/sound/pcm/channel.h
==============================================================================
--- projects/vap7/sys/dev/sound/pcm/channel.h	Fri Jan  9 18:38:57 2009	(r186963)
+++ projects/vap7/sys/dev/sound/pcm/channel.h	Fri Jan  9 19:45:06 2009	(r186964)
@@ -258,11 +258,13 @@ int chn_getpeaks(struct pcm_channel *c, 
 #endif
 
 #ifdef	USING_MUTEX
+#define CHN_LOCK_OWNED(c) mtx_owned((struct mtx *)((c)->lock))
 #define CHN_LOCK(c) mtx_lock((struct mtx *)((c)->lock))
 #define CHN_UNLOCK(c) mtx_unlock((struct mtx *)((c)->lock))
 #define CHN_TRYLOCK(c) mtx_trylock((struct mtx *)((c)->lock))
 #define CHN_LOCKASSERT(c) mtx_assert((struct mtx *)((c)->lock), MA_OWNED)
 #else
+#define CHN_LOCK_OWNED(c) 0
 #define CHN_LOCK(c)
 #define CHN_UNLOCK(c)
 #define CHN_TRYLOCK(c)

Modified: projects/vap7/sys/dev/sound/pcm/mixer.c
==============================================================================
--- projects/vap7/sys/dev/sound/pcm/mixer.c	Fri Jan  9 18:38:57 2009	(r186963)
+++ projects/vap7/sys/dev/sound/pcm/mixer.c	Fri Jan  9 19:45:06 2009	(r186964)
@@ -589,7 +589,7 @@ mixer_delete(struct snd_mixer *m)
 	KASSERT(m->type == MIXER_TYPE_SECONDARY,
 	    ("%s(): illegal mixer type=%d", __func__, m->type));
 
-	snd_mtxlock(m->lock);
+	/* mixer uninit can sleep --hps */
 
 	MIXER_UNINIT(m);
 
@@ -704,14 +704,24 @@ mixer_uninit(device_t dev)
 		return EBUSY;
 	}
 
+	/* destroy dev can sleep --hps */
+
+	snd_mtxunlock(m->lock);
+
 	pdev->si_drv1 = NULL;
 	destroy_dev(pdev);
 
+	snd_mtxlock(m->lock);
+
 	for (i = 0; i < SOUND_MIXER_NRDEVICES; i++)
 		mixer_set(m, i, 0);
 
 	mixer_setrecsrc(m, SOUND_MASK_MIC);
 
+	snd_mtxunlock(m->lock);
+
+	/* mixer uninit can sleep --hps */
+
 	MIXER_UNINIT(m);
 
 	snd_mtxfree(m->lock);
@@ -1280,3 +1290,16 @@ mixer_oss_mixerinfo(struct cdev *i_dev, 
 
 	return (EINVAL);
 }
+
+/*
+ * Allow the sound driver to use the mixer lock to protect its mixer
+ * data:
+ */
+struct mtx *
+mixer_get_lock(struct snd_mixer *m)
+{
+	if (m->lock == NULL) {
+		return (&Giant);
+	}
+	return (m->lock);
+}

Modified: projects/vap7/sys/dev/sound/pcm/mixer.h
==============================================================================
--- projects/vap7/sys/dev/sound/pcm/mixer.h	Fri Jan  9 18:38:57 2009	(r186963)
+++ projects/vap7/sys/dev/sound/pcm/mixer.h	Fri Jan  9 19:45:06 2009	(r186964)
@@ -56,6 +56,7 @@ void mix_setrealdev(struct snd_mixer *m,
 u_int32_t mix_getparent(struct snd_mixer *m, u_int32_t dev);
 u_int32_t mix_getchild(struct snd_mixer *m, u_int32_t dev);
 void *mix_getdevinfo(struct snd_mixer *m);
+struct mtx *mixer_get_lock(struct snd_mixer *m);
 
 extern int mixer_count;
 

Modified: projects/vap7/sys/dev/usb/rio500_usb.h
==============================================================================
--- projects/vap7/sys/dev/usb/rio500_usb.h	Fri Jan  9 18:38:57 2009	(r186963)
+++ projects/vap7/sys/dev/usb/rio500_usb.h	Fri Jan  9 19:45:06 2009	(r186964)
@@ -32,7 +32,7 @@
 
 struct RioCommand
 {
-  u_int16_t  length;
+  uint16_t  length;
   int   request;
   int   requesttype;
   int   value;

Modified: projects/vap7/sys/dev/usb2/core/usb2_dev.c
==============================================================================
--- head/sys/dev/usb2/core/usb2_dev.c	Fri Jan  9 17:21:22 2009	(r186961)
+++ projects/vap7/sys/dev/usb2/core/usb2_dev.c	Fri Jan  9 19:45:06 2009	(r186964)
@@ -1306,8 +1306,14 @@ usb2_fdopen(struct cdev *dev, int xxx_of
 	 * Take over the file so that we get all the callbacks
 	 * directly and don't have to create another device:
 	 */
+#if __FreeBSD_version < 800009
+	fp->f_ops = &usb2_ops_f;
+	fp->f_type = DTYPE_VNODE;
+	fp->f_data = ((uint8_t *)0) + devloc;
+#else
 	finit(fp, fp->f_flag, DTYPE_VNODE,
 	    ((uint8_t *)0) + devloc, &usb2_ops_f);
+#endif
 
 	usb2_unref_device(&loc);
 

Modified: projects/vap7/sys/dev/usb2/serial/usb2_serial.c
==============================================================================
--- head/sys/dev/usb2/serial/usb2_serial.c	Fri Jan  9 17:21:22 2009	(r186961)
+++ projects/vap7/sys/dev/usb2/serial/usb2_serial.c	Fri Jan  9 19:45:06 2009	(r186964)
@@ -125,28 +125,17 @@ static void	usb2_com_queue_command(struc
 		    usb2_config_td_command_t *, int);
 static void	usb2_com_shutdown(struct usb2_com_softc *);
 static void	usb2_com_start_transfers(struct usb2_com_softc *);
-static void	usb2_com_break(struct usb2_com_softc *, uint8_t);
+static int	usb2_com_open(struct tty *, struct cdev *);
+static void	usb2_com_close(struct tty *);
+static int	usb2_com_ioctl(struct tty *, u_long, void *, int,
+		    struct thread *);
+static int	usb2_com_modem(struct tty *, int, int);
+static void	usb2_com_break(struct tty *, int);
 static void	usb2_com_dtr(struct usb2_com_softc *, uint8_t);
 static void	usb2_com_rts(struct usb2_com_softc *, uint8_t);
-
-static tsw_open_t usb2_com_open;
-static tsw_close_t usb2_com_close;
-static tsw_ioctl_t usb2_com_ioctl;
-static tsw_modem_t usb2_com_modem;
-static tsw_param_t usb2_com_param;
-static tsw_outwakeup_t usb2_com_start_write;
-static tsw_free_t usb2_com_free;
-
-static struct ttydevsw usb2_com_class = {
-	.tsw_flags = TF_INITLOCK | TF_CALLOUT,
-	.tsw_open = usb2_com_open,
-	.tsw_close = usb2_com_close,
-	.tsw_outwakeup = usb2_com_start_write,
-	.tsw_ioctl = usb2_com_ioctl,
-	.tsw_param = usb2_com_param,
-	.tsw_modem = usb2_com_modem,
-	.tsw_free = usb2_com_free,
-};
+static int	usb2_com_param(struct tty *, struct termios *);
+static void	usb2_com_start_write(struct tty *);
+static void	usb2_com_stop_write(struct tty *, int);
 
 MODULE_DEPEND(usb2_serial, usb2_core, 1, 1, 1);
 MODULE_VERSION(usb2_serial, 1);
@@ -242,7 +231,8 @@ usb2_com_attach(struct usb2_com_super_so
 	uint32_t root_unit;
 	int error = 0;
 
-	if ((sc == NULL) ||
+	if ((p_mtx != &Giant) ||	/* XXX TTY layer requires Giant */
+	    (sc == NULL) ||
 	    (sub_units == 0) ||
 	    (sub_units > UCOM_SUB_UNIT_MAX) ||
 	    (callback == NULL)) {
@@ -309,11 +299,23 @@ usb2_com_attach_sub(struct usb2_com_soft
 	int error = 0;
 	char buf[32];			/* temporary TTY device name buffer */
 
-	tp = tty_alloc(&usb2_com_class, sc, sc->sc_parent_mtx);
+	mtx_lock(&Giant);	/* XXX TTY layer */
+	tp = ttyalloc();
+
 	if (tp == NULL) {
 		error = ENOMEM;
 		goto done;
 	}
+	tp->t_sc = sc;
+	tp->t_oproc = usb2_com_start_write;
+	tp->t_param = usb2_com_param;
+	tp->t_stop = usb2_com_stop_write;
+	tp->t_break = usb2_com_break;
+	tp->t_open = usb2_com_open;
+	tp->t_close = usb2_com_close;
+	tp->t_modem = usb2_com_modem;
+	tp->t_ioctl = usb2_com_ioctl;
+
 	DPRINTF("tp = %p, unit = %d\n", tp, sc->sc_unit);
 
 	buf[0] = 0;			/* set some default value */
@@ -325,46 +327,49 @@ usb2_com_attach_sub(struct usb2_com_soft
 	}
 	if (buf[0] == 0) {
 		/* Use default TTY name */
-		if (snprintf(buf, sizeof(buf), "U%u", sc->sc_unit)) {
+		if (snprintf(buf, sizeof(buf), "ttyU%u", sc->sc_unit)) {
 			/* ignore */
 		}
 	}
-	tty_makedev(tp, NULL, "%s", buf);
 
+#if !(defined(TS_CALLOUT) || (__FreeBSD_version >= 700022))
+#define	TS_CALLOUT NULL, sc->sc_unit, MINOR_CALLOUT	/* compile fix for
+							 * FreeBSD 6.x */
+#endif
+	error = ttycreate(tp, TS_CALLOUT, buf);
+	if (error) {
+		ttyfree(tp);
+		goto done;
+	}
 	sc->sc_tty = tp;
 
 	DPRINTF("ttycreate: %s\n", buf);
-	usb2_cv_init(&sc->sc_cv, "usb2_com");
 
 done:
+	mtx_unlock(&Giant);	/* XXX TTY layer */
 	return (error);
 }
 
-static void
+void
 usb2_com_detach_sub(struct usb2_com_softc *sc)
 {
 	struct tty *tp = sc->sc_tty;
 
+	mtx_lock(&Giant);	/* XXX TTY layer */
 	DPRINTF("sc = %p, tp = %p\n", sc, sc->sc_tty);
 
-	/* the config thread has been stopped when we get here */
+	/* the config thread is stopped when we get here */
 
-	mtx_lock(sc->sc_parent_mtx);
 	sc->sc_flag |= UCOM_FLAG_GONE;
 	sc->sc_flag &= ~(UCOM_FLAG_HL_READY |
 	    UCOM_FLAG_LL_READY);
-	mtx_unlock(sc->sc_parent_mtx);
 	if (tp) {
-		tty_lock(tp);
-
-		usb2_com_close(tp);	/* close, if any */
 
-		tty_rel_gone(tp);
+		ttygone(tp);
 
-		mtx_lock(sc->sc_parent_mtx);
-		/* Wait for the callback after the TTY is torn down */
-		while (sc->sc_ttyfreed == 0)
-			usb2_cv_wait(&sc->sc_cv, sc->sc_parent_mtx);
+		if (tp->t_state & TS_ISOPEN) {
+			usb2_com_close(tp);
+		}
 		/*
 		 * make sure that read and write transfers are stopped
 		 */
@@ -374,9 +379,9 @@ usb2_com_detach_sub(struct usb2_com_soft
 		if (sc->sc_callback->usb2_com_stop_write) {
 			(sc->sc_callback->usb2_com_stop_write) (sc);
 		}
-		mtx_unlock(sc->sc_parent_mtx);
+		ttyfree(tp);
 	}
-	usb2_cv_destroy(&sc->sc_cv);
+	mtx_unlock(&Giant);	/* XXX TTY layer */
 }
 
 static void
@@ -414,7 +419,7 @@ usb2_com_shutdown(struct usb2_com_softc 
 	/*
 	 * Hang up if necessary:
 	 */
-	if (tp->t_termios.c_cflag & HUPCL) {
+	if (tp->t_cflag & HUPCL) {
 		usb2_com_modem(tp, 0, SER_DTR);
 	}
 }
@@ -515,9 +520,9 @@ usb2_com_cfg_open(struct usb2_com_softc 
 }
 
 static int
-usb2_com_open(struct tty *tp)
+usb2_com_open(struct tty *tp, struct cdev *dev)
 {
-	struct usb2_com_softc *sc = tty_softc(tp);
+	struct usb2_com_softc *sc = tp->t_sc;
 	int error;
 
 	mtx_assert(sc->sc_parent_mtx, MA_OWNED);
@@ -556,7 +561,7 @@ usb2_com_open(struct tty *tp)
 
 	usb2_com_modem(tp, SER_DTR | SER_RTS, 0);
 
-	usb2_com_break(sc, 0);
+	usb2_com_break(tp, 0);
 
 	usb2_com_status_change(sc);
 
@@ -587,21 +592,17 @@ usb2_com_cfg_close(struct usb2_com_softc
 static void
 usb2_com_close(struct tty *tp)
 {
-	struct usb2_com_softc *sc = tty_softc(tp);
-	struct usb2_com_super_softc *ssc = sc->sc_super;
-	
+	struct usb2_com_softc *sc = tp->t_sc;
+
 	mtx_assert(sc->sc_parent_mtx, MA_OWNED);
 
 	DPRINTF("tp=%p\n", tp);
 
-	if (!(sc->sc_flag & UCOM_FLAG_HL_READY)) {
-		DPRINTF("tp=%p already closed\n", tp);
-		return;
-	}
+	tp->t_state &= ~TS_BUSY;
+
 	usb2_com_shutdown(sc);
 
 	usb2_com_queue_command(sc, &usb2_com_cfg_close, 0);
-	usb2_config_td_sync(&ssc->sc_config_td);
 
 	sc->sc_flag &= ~(UCOM_FLAG_HL_READY |
 	    UCOM_FLAG_WR_START |
@@ -616,9 +617,10 @@ usb2_com_close(struct tty *tp)
 }
 
 static int
-usb2_com_ioctl(struct tty *tp, u_long cmd, caddr_t data, struct thread *td)
+usb2_com_ioctl(struct tty *tp, u_long cmd, void *data,
+    int flag, struct thread *td)
 {
-	struct usb2_com_softc *sc = tty_softc(tp);
+	struct usb2_com_softc *sc = tp->t_sc;
 	int error;
 
 	mtx_assert(sc->sc_parent_mtx, MA_OWNED);
@@ -628,23 +630,9 @@ usb2_com_ioctl(struct tty *tp, u_long cm
 	}
 	DPRINTF("cmd = 0x%08lx\n", cmd);
 
-	switch (cmd) {
-	case TIOCSBRK:
-		usb2_com_break(sc, 1);
-		error = 0;
-		break;
-	case TIOCCBRK:
-		usb2_com_break(sc, 0);
-		error = 0;
-		break;
-	default:
-		if (sc->sc_callback->usb2_com_ioctl) {
-			error = (sc->sc_callback->usb2_com_ioctl)
-			    (sc, cmd, data, 0, td);
-		} else {
-			error = ENOIOCTL;
-		}
-		break;
+	error = ENOTTY;
+	if (sc->sc_callback->usb2_com_ioctl) {
+		error = (sc->sc_callback->usb2_com_ioctl) (sc, cmd, data, flag, td);
 	}
 	return (error);
 }
@@ -652,7 +640,7 @@ usb2_com_ioctl(struct tty *tp, u_long cm
 static int
 usb2_com_modem(struct tty *tp, int sigon, int sigoff)
 {
-	struct usb2_com_softc *sc = tty_softc(tp);
+	struct usb2_com_softc *sc = tp->t_sc;
 	uint8_t onoff;
 
 	mtx_assert(sc->sc_parent_mtx, MA_OWNED);
@@ -720,8 +708,10 @@ usb2_com_cfg_break(struct usb2_com_softc
 }
 
 static void
-usb2_com_break(struct usb2_com_softc *sc, uint8_t onoff)
+usb2_com_break(struct tty *tp, int onoff)
 {
+	struct usb2_com_softc *sc = tp->t_sc;
+
 	mtx_assert(sc->sc_parent_mtx, MA_OWNED);
 
 	if (!(sc->sc_flag & UCOM_FLAG_HL_READY)) {
@@ -791,8 +781,8 @@ usb2_com_rts(struct usb2_com_softc *sc, 
 }
 
 static void
-usb2_com_cfg_status_change(struct usb2_com_softc *sc,
-    struct usb2_com_config_copy *cc, uint16_t refcount)
+usb2_com_cfg_status_change(struct usb2_com_softc *sc, struct usb2_com_config_copy *cc,
+    uint16_t refcount)
 {
 	struct tty *tp;
 
@@ -803,8 +793,6 @@ usb2_com_cfg_status_change(struct usb2_c
 	sc = cc->cc_softc;
 	tp = sc->sc_tty;
 
-	mtx_assert(sc->sc_parent_mtx, MA_OWNED);
-
 	if (!(sc->sc_flag & UCOM_FLAG_LL_READY)) {
 		return;
 	}
@@ -833,7 +821,7 @@ usb2_com_cfg_status_change(struct usb2_c
 
 		DPRINTF("DCD changed to %d\n", onoff);
 
-		ttydisc_modem(tp, onoff);
+		ttyld_modem(tp, onoff);
 	}
 }
 
@@ -875,7 +863,7 @@ usb2_com_cfg_param(struct usb2_com_softc
 static int
 usb2_com_param(struct tty *tp, struct termios *t)
 {
-	struct usb2_com_softc *sc = tty_softc(tp);
+	struct usb2_com_softc *sc = tp->t_sc;
 	uint8_t opened;
 	int error;
 
@@ -888,7 +876,7 @@ usb2_com_param(struct tty *tp, struct te
 
 		/* XXX the TTY layer should call "open()" first! */
 
-		error = usb2_com_open(tp);
+		error = usb2_com_open(tp, NULL);
 		if (error) {
 			goto done;
 		}
@@ -907,7 +895,20 @@ usb2_com_param(struct tty *tp, struct te
 		error = EINVAL;
 		goto done;
 	}
-	t->c_ispeed = t->c_ospeed;
+	/*
+	 * If there were no changes, don't do anything.  This avoids dropping
+	 * input and improves performance when all we did was frob things like
+	 * VMIN and VTIME.
+	 */
+	if ((tp->t_ospeed == t->c_ospeed) &&
+	    (tp->t_cflag == t->c_cflag)) {
+		error = 0;
+		goto done;
+	}
+	/* And copy to tty. */
+	tp->t_ispeed = 0;
+	tp->t_ospeed = t->c_ospeed;
+	tp->t_cflag = t->c_cflag;
 
 	if (sc->sc_callback->usb2_com_pre_param) {
 		/* Let the lower layer verify the parameters */
@@ -929,12 +930,16 @@ usb2_com_param(struct tty *tp, struct te
 	/* Queue transfer enable command last */
 	usb2_com_start_transfers(sc);
 
+	ttsetwater(tp);
+
 	if (t->c_cflag & CRTS_IFLOW) {
 		sc->sc_flag |= UCOM_FLAG_RTS_IFLOW;
 	} else if (sc->sc_flag & UCOM_FLAG_RTS_IFLOW) {
 		sc->sc_flag &= ~UCOM_FLAG_RTS_IFLOW;
 		usb2_com_modem(tp, SER_RTS, 0);
 	}
+	ttyldoptim(tp);
+
 done:
 	if (error) {
 		if (opened) {
@@ -947,28 +952,62 @@ done:
 static void
 usb2_com_start_write(struct tty *tp)
 {
-	struct usb2_com_softc *sc = tty_softc(tp);
+	struct usb2_com_softc *sc = tp->t_sc;
 
 	mtx_assert(sc->sc_parent_mtx, MA_OWNED);
 
 	DPRINTF("sc = %p\n", sc);
 
+	if (tp->t_outq.c_cc == 0) {
+		/*
+		 * The TTY layer does not expect TS_BUSY to be set
+		 * when there are no characters to output.
+		 */
+		return;
+	}
 	if (!(sc->sc_flag & UCOM_FLAG_HL_READY)) {
 		/* The higher layer is not ready */
 		return;
 	}
+	tp->t_state |= TS_BUSY;
+
 	sc->sc_flag |= UCOM_FLAG_WR_START;
 
 	usb2_com_start_transfers(sc);
 }
 
-/*------------------------------------------------------------------------*
- *	usb2_com_get_data
- *
- * Return values:
- * 0: No data is available.
- * Else: Data is available.
- *------------------------------------------------------------------------*/
+static void
+usb2_com_stop_write(struct tty *tp, int fflags)
+{
+	struct usb2_com_softc *sc = tp->t_sc;
+
+	mtx_assert(sc->sc_parent_mtx, MA_OWNED);
+
+	if (!(sc->sc_flag & UCOM_FLAG_HL_READY)) {
+		return;
+	}
+	DPRINTF("fflags=%d\n", fflags);
+
+	if (fflags & FWRITE) {
+		DPRINTF("write\n");
+		if (tp->t_state & TS_BUSY) {
+			/* XXX do what? */
+			if (!(tp->t_state & TS_TTSTOP)) {
+				tp->t_state |= TS_FLUSH;
+			}
+		}
+	}
+	/* Flush out any leftover data */
+	usb2_com_start_write(tp);
+
+	DPRINTF("done\n");
+}
+
+/*
+ * the following function returns
+ * 1 if data is available, else 0
+ */
+
 uint8_t
 usb2_com_get_data(struct usb2_com_softc *sc, struct usb2_page_cache *pc,
     uint32_t offset, uint32_t len, uint32_t *actlen)
@@ -980,12 +1019,32 @@ usb2_com_get_data(struct usb2_com_softc 
 
 	mtx_assert(sc->sc_parent_mtx, MA_OWNED);
 
+	actlen[0] = 0;
+
 	if ((!(sc->sc_flag & UCOM_FLAG_HL_READY)) ||
 	    (!(sc->sc_flag & UCOM_FLAG_GP_DATA)) ||
 	    (!(sc->sc_flag & UCOM_FLAG_WR_START))) {
-		actlen[0] = 0;
 		return (0);		/* multiport device polling */
 	}
+	if (tp->t_state & TS_TBLOCK) {
+		if ((sc->sc_mcr & SER_RTS) &&
+		    (sc->sc_flag & UCOM_FLAG_RTS_IFLOW)) {
+			DPRINTF("clear RTS\n");
+			usb2_com_modem(tp, 0, SER_RTS);
+		}
+	} else {
+		if (!(sc->sc_mcr & SER_RTS) &&
+		    (tp->t_rawq.c_cc <= tp->t_ilowat) &&
+		    (sc->sc_flag & UCOM_FLAG_RTS_IFLOW)) {
+			DPRINTF("set RTS\n");
+			usb2_com_modem(tp, SER_RTS, 0);
+		}
+	}
+
+	if (tp->t_state & (TS_TIMEOUT | TS_TTSTOP)) {
+		DPRINTF("stopped\n");
+		goto done;
+	}
 	offset_orig = offset;
 
 	while (len != 0) {
@@ -995,8 +1054,7 @@ usb2_com_get_data(struct usb2_com_softc 
 		if (res.length > len) {
 			res.length = len;
 		}
-		/* copy data directly into USB buffer */
-		cnt = ttydisc_getc(tp, res.buffer, res.length);
+		cnt = q_to_b(&tp->t_outq, res.buffer, res.length);
 
 		offset += cnt;
 		len -= cnt;
@@ -1012,9 +1070,18 @@ usb2_com_get_data(struct usb2_com_softc 
 	DPRINTF("cnt=%d\n", actlen[0]);
 
 	if (actlen[0] == 0) {
-		return (0);
+		goto done;
 	}
+	ttwwakeup(tp);
+
 	return (1);
+
+done:
+	tp->t_state &= ~(TS_BUSY | TS_FLUSH);
+
+	ttwwakeup(tp);
+
+	return (0);
 }
 
 void
@@ -1023,7 +1090,6 @@ usb2_com_put_data(struct usb2_com_softc 
 {
 	struct usb2_page_search res;
 	struct tty *tp = sc->sc_tty;
-	char *buf;
 	uint32_t cnt;
 
 	mtx_assert(sc->sc_parent_mtx, MA_OWNED);
@@ -1032,9 +1098,6 @@ usb2_com_put_data(struct usb2_com_softc 
 	    (!(sc->sc_flag & UCOM_FLAG_GP_DATA))) {
 		return;			/* multiport device polling */
 	}
-	if (len == 0)
-		return;			/* no data */
-
 	/* set a flag to prevent recursation ? */
 
 	while (len > 0) {
@@ -1047,41 +1110,56 @@ usb2_com_put_data(struct usb2_com_softc 
 		len -= res.length;
 		offset += res.length;
 
-		/* pass characters to tty layer */
+		if (tp->t_state & TS_CAN_BYPASS_L_RINT) {
+
+			if (((tp->t_rawq.c_cc + res.length) > tp->t_ihiwat) &&
+			    ((sc->sc_flag & UCOM_FLAG_RTS_IFLOW) ||
+			    (tp->t_iflag & IXOFF)) &&
+			    (!(tp->t_state & TS_TBLOCK))) {
+				ttyblock(tp);
+			}
+			cnt = b_to_q(res.buffer, res.length, &(tp->t_rawq));
 
-		buf = res.buffer;
-		cnt = res.length;
+			tp->t_rawcc += res.length;
 
-		/* first check if we can pass the buffer directly */
+			ttwakeup(tp);
 
-		if (ttydisc_can_bypass(tp)) {
-			if (ttydisc_rint_bypass(tp, buf, cnt) != cnt) {
-				DPRINTF("tp=%p, data lost\n", tp);
+			if ((tp->t_state & TS_TTSTOP) &&
+			    ((tp->t_iflag & IXANY) ||
+			    (tp->t_cc[VSTART] == tp->t_cc[VSTOP]))) {
+				tp->t_state &= ~TS_TTSTOP;
+				tp->t_lflag &= ~FLUSHO;
+				usb2_com_start_write(tp);
 			}
-			continue;
-		}
-		/* need to loop */
+			if (cnt > 0) {
+				DPRINTF("tp=%p, lost %d "
+				    "chars\n", tp, cnt);
+			}
+		} else {
 
-		for (cnt = 0; cnt != res.length; cnt++) {
-			if (ttydisc_rint(tp, buf[cnt], 0) == -1) {
-				/* XXX what should we do? */
+			uint8_t *buf;
 
-				DPRINTF("tp=%p, lost %d "
-				    "chars\n", tp, res.length - cnt);
-				break;
+			/* pass characters to tty layer */
+
+			buf = res.buffer;
+
+			for (cnt = 0; cnt != res.length; cnt++) {
+
+				if (ttyld_rint(tp, buf[cnt]) == -1) {
+
+					/* XXX what should we do? */
+
+					DPRINTF("tp=%p, lost %d "
+					    "chars\n", tp, res.length - cnt);
+					break;
+				}
 			}
 		}
 	}
-	ttydisc_rint_done(tp);
-}
 
-static void
-usb2_com_free(void *xsc)
-{
-	struct usb2_com_softc *sc = xsc;
-
-	mtx_lock(sc->sc_parent_mtx);
-	sc->sc_ttyfreed = 1;
-	usb2_cv_signal(&sc->sc_cv);
-	mtx_unlock(sc->sc_parent_mtx);
+	if ((sc->sc_flag & UCOM_FLAG_RTS_IFLOW) &&
+	    (!(sc->sc_mcr & SER_RTS)) &&
+	    (!(tp->t_state & TS_TBLOCK))) {
+		usb2_com_modem(tp, SER_RTS, 0);
+	}
 }

Copied and modified: projects/vap7/sys/i386/conf/USB2 (from r186962, head/sys/i386/conf/USB2)
==============================================================================
--- head/sys/i386/conf/USB2	Fri Jan  9 18:08:50 2009	(r186962, copy source)
+++ projects/vap7/sys/i386/conf/USB2	Fri Jan  9 19:45:06 2009	(r186964)
@@ -29,6 +29,7 @@ nodevice	ucom
 nodevice	u3g
 nodevice	uark
 nodevice	ubsa
+nodevice	ubser
 nodevice	uftdi
 nodevice	uipaq
 nodevice	uplcom

Modified: projects/vap7/sys/modules/Makefile
==============================================================================
--- projects/vap7/sys/modules/Makefile	Fri Jan  9 18:38:57 2009	(r186963)
+++ projects/vap7/sys/modules/Makefile	Fri Jan  9 19:45:06 2009	(r186964)
@@ -301,6 +301,7 @@ SUBDIR=	${_3dfx} \
 	ural \
 	urio \
 	usb \
+	usb2 \
 	uscanner \
 	uslcom \
 	utopia \

Modified: projects/vap7/usr.sbin/Makefile
==============================================================================
--- projects/vap7/usr.sbin/Makefile	Fri Jan  9 18:38:57 2009	(r186963)
+++ projects/vap7/usr.sbin/Makefile	Fri Jan  9 19:45:06 2009	(r186964)
@@ -182,6 +182,7 @@ SUBDIR=	ac \
 	tzsetup \
 	ugidfw \
 	${_usbdevs} \
+	${_usbconfig} \
 	vidcontrol \
 	vipw \
 	watch \
@@ -291,6 +292,7 @@ _sendmail=	sendmail
 
 .if ${MK_USB} != "no"
 _usbdevs=	usbdevs
+_usbconfig=	usbconfig
 .endif
 
 .if ${MACHINE_ARCH} == "arm"

From owner-svn-src-projects@FreeBSD.ORG  Fri Jan  9 20:57:44 2009
Return-Path: <owner-svn-src-projects@FreeBSD.ORG>
Delivered-To: svn-src-projects@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8FEC01065673;
	Fri,  9 Jan 2009 20:57:44 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 7B5278FC0A;
	Fri,  9 Jan 2009 20:57:44 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n09Kvidx068619;
	Fri, 9 Jan 2009 20:57:44 GMT (envelope-from sam@svn.freebsd.org)
Received: (from sam@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n09Kvhpi068605;
	Fri, 9 Jan 2009 20:57:43 GMT (envelope-from sam@svn.freebsd.org)
Message-Id: <200901092057.n09Kvhpi068605@svn.freebsd.org>
From: Sam Leffler <sam@FreeBSD.org>
Date: Fri, 9 Jan 2009 20:57:43 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-projects@freebsd.org
X-SVN-Group: projects
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r186975 - in projects/vap7/sys: . contrib/pf dev
	dev/acpi_support dev/ath/ath_hal/ar5210
	dev/ath/ath_hal/ar5211 dev/ath/ath_hal/ar5212
	dev/ath/ath_hal/ar5312 dev/ath/ath_hal/ar5416 dev/...
X-BeenThere: svn-src-projects@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the src &quot; projects&quot;
	tree" <svn-src-projects.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
	<mailto:svn-src-projects-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-projects>
List-Post: <mailto:svn-src-projects@freebsd.org>
List-Help: <mailto:svn-src-projects-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
	<mailto:svn-src-projects-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 09 Jan 2009 20:57:45 -0000

Author: sam
Date: Fri Jan  9 20:57:43 2009
New Revision: 186975
URL: http://svn.freebsd.org/changeset/base/186975

Log:
  merge r181463 which revs the sbuf api; need this so user code builds unchanged

Modified:
  projects/vap7/sys/   (props changed)
  projects/vap7/sys/contrib/pf/   (props changed)
  projects/vap7/sys/dev/   (props changed)
  projects/vap7/sys/dev/acpi_support/acpi_asus.c
  projects/vap7/sys/dev/ath/ath_hal/ar5210/   (props changed)
  projects/vap7/sys/dev/ath/ath_hal/ar5211/   (props changed)
  projects/vap7/sys/dev/ath/ath_hal/ar5212/   (props changed)
  projects/vap7/sys/dev/ath/ath_hal/ar5312/   (props changed)
  projects/vap7/sys/dev/ath/ath_hal/ar5416/   (props changed)
  projects/vap7/sys/dev/cxgb/   (props changed)
  projects/vap7/sys/dev/led/led.c
  projects/vap7/sys/geom/concat/g_concat.c
  projects/vap7/sys/geom/geom_ccd.c
  projects/vap7/sys/geom/geom_ctl.c
  projects/vap7/sys/geom/geom_disk.c
  projects/vap7/sys/geom/geom_kern.c
  projects/vap7/sys/geom/geom_slice.c
  projects/vap7/sys/geom/geom_subr.c
  projects/vap7/sys/geom/part/g_part.c
  projects/vap7/sys/geom/stripe/g_stripe.c
  projects/vap7/sys/kern/vfs_mount.c
  projects/vap7/sys/security/mac_portacl/mac_portacl.c
  projects/vap7/sys/sys/sbuf.h

Modified: projects/vap7/sys/dev/acpi_support/acpi_asus.c
==============================================================================
--- projects/vap7/sys/dev/acpi_support/acpi_asus.c	Fri Jan  9 20:57:01 2009	(r186974)
+++ projects/vap7/sys/dev/acpi_support/acpi_asus.c	Fri Jan  9 20:57:43 2009	(r186975)
@@ -552,7 +552,7 @@ acpi_asus_probe(device_t dev)
 		}
 	}
 
-	sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND);
+	sb = sbuf_new_auto();
 	if (sb == NULL)
 		return (ENOMEM);
 

Modified: projects/vap7/sys/dev/led/led.c
==============================================================================
--- projects/vap7/sys/dev/led/led.c	Fri Jan  9 20:57:01 2009	(r186974)
+++ projects/vap7/sys/dev/led/led.c	Fri Jan  9 20:57:43 2009	(r186975)
@@ -141,7 +141,7 @@ led_write(struct cdev *dev, struct uio *
 		return(error);
 	}
 
-	sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND);
+	sb = sbuf_new_auto();
 	if (sb == NULL) {
 		free(s2, M_DEVBUF);
 		return (ENOMEM);

Modified: projects/vap7/sys/geom/concat/g_concat.c
==============================================================================
--- projects/vap7/sys/geom/concat/g_concat.c	Fri Jan  9 20:57:01 2009	(r186974)
+++ projects/vap7/sys/geom/concat/g_concat.c	Fri Jan  9 20:57:43 2009	(r186975)
@@ -748,7 +748,7 @@ g_concat_ctl_create(struct gctl_req *req
 	}
 
 	sc = gp->softc;
-	sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND);
+	sb = sbuf_new_auto();
 	sbuf_printf(sb, "Can't attach disk(s) to %s:", gp->name);
 	for (attached = 0, no = 1; no < *nargs; no++) {
 		snprintf(param, sizeof(param), "arg%u", no);

Modified: projects/vap7/sys/geom/geom_ccd.c
==============================================================================
--- projects/vap7/sys/geom/geom_ccd.c	Fri Jan  9 20:57:01 2009	(r186974)
+++ projects/vap7/sys/geom/geom_ccd.c	Fri Jan  9 20:57:43 2009	(r186975)
@@ -790,7 +790,7 @@ g_ccd_create(struct gctl_req *req, struc
 	pp->sectorsize = sc->sc_secsize;
 	g_error_provider(pp, 0);
 
-	sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND);
+	sb = sbuf_new_auto();
 	sbuf_printf(sb, "ccd%d: %d components ", sc->sc_unit, *nprovider);
 	for (i = 0; i < *nprovider; i++) {
 		sbuf_printf(sb, "%s%s",
@@ -840,7 +840,7 @@ g_ccd_list(struct gctl_req *req, struct 
 
 	up = gctl_get_paraml(req, "unit", sizeof (int));
 	unit = *up;
-	sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND);
+	sb = sbuf_new_auto();
 	LIST_FOREACH(gp, &mp->geom, geom) {
 		cs = gp->softc;
 		if (cs == NULL || (unit >= 0 && unit != cs->sc_unit))

Modified: projects/vap7/sys/geom/geom_ctl.c
==============================================================================
--- projects/vap7/sys/geom/geom_ctl.c	Fri Jan  9 20:57:01 2009	(r186974)
+++ projects/vap7/sys/geom/geom_ctl.c	Fri Jan  9 20:57:43 2009	(r186975)
@@ -464,7 +464,7 @@ g_ctl_ioctl_ctl(struct cdev *dev, u_long
 
 	req = (void *)data;
 	req->nerror = 0;
-	req->serror = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND);
+	req->serror = sbuf_new_auto();
 	/* It is an error if we cannot return an error text */
 	if (req->lerror < 2)
 		return (EINVAL);

Modified: projects/vap7/sys/geom/geom_disk.c
==============================================================================
--- projects/vap7/sys/geom/geom_disk.c	Fri Jan  9 20:57:01 2009	(r186974)
+++ projects/vap7/sys/geom/geom_disk.c	Fri Jan  9 20:57:43 2009	(r186975)
@@ -516,7 +516,7 @@ sysctl_disks(SYSCTL_HANDLER_ARGS)
 	int error;
 	struct sbuf *sb;
 
-	sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND);
+	sb = sbuf_new_auto();
 	g_waitfor_event(g_kern_disks, sb, M_WAITOK, NULL);
 	error = SYSCTL_OUT(req, sbuf_data(sb), sbuf_len(sb) + 1);
 	sbuf_delete(sb);

Modified: projects/vap7/sys/geom/geom_kern.c
==============================================================================
--- projects/vap7/sys/geom/geom_kern.c	Fri Jan  9 20:57:01 2009	(r186974)
+++ projects/vap7/sys/geom/geom_kern.c	Fri Jan  9 20:57:43 2009	(r186975)
@@ -180,7 +180,7 @@ sysctl_kern_geom_conftxt(SYSCTL_HANDLER_
 	int error;
 	struct sbuf *sb;
 
-	sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND);
+	sb = sbuf_new_auto();
 	g_waitfor_event(g_conftxt, sb, M_WAITOK, NULL);
 	error = SYSCTL_OUT(req, sbuf_data(sb), sbuf_len(sb) + 1);
 	sbuf_delete(sb);
@@ -193,7 +193,7 @@ sysctl_kern_geom_confdot(SYSCTL_HANDLER_
 	int error;
 	struct sbuf *sb;
 
-	sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND);
+	sb = sbuf_new_auto();
 	g_waitfor_event(g_confdot, sb, M_WAITOK, NULL);
 	error = SYSCTL_OUT(req, sbuf_data(sb), sbuf_len(sb) + 1);
 	sbuf_delete(sb);
@@ -206,7 +206,7 @@ sysctl_kern_geom_confxml(SYSCTL_HANDLER_
 	int error;
 	struct sbuf *sb;
 
-	sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND);
+	sb = sbuf_new_auto();
 	g_waitfor_event(g_confxml, sb, M_WAITOK, NULL);
 	error = SYSCTL_OUT(req, sbuf_data(sb), sbuf_len(sb) + 1);
 	sbuf_delete(sb);

Modified: projects/vap7/sys/geom/geom_slice.c
==============================================================================
--- projects/vap7/sys/geom/geom_slice.c	Fri Jan  9 20:57:01 2009	(r186974)
+++ projects/vap7/sys/geom/geom_slice.c	Fri Jan  9 20:57:43 2009	(r186975)
@@ -385,7 +385,7 @@ g_slice_config(struct g_geom *gp, u_int 
 		pp->mediasize = gsl->length;
 		return (0);
 	}
-	sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND);
+	sb = sbuf_new_auto();
 	va_start(ap, fmt);
 	sbuf_vprintf(sb, fmt, ap);
 	va_end(ap);

Modified: projects/vap7/sys/geom/geom_subr.c
==============================================================================
--- projects/vap7/sys/geom/geom_subr.c	Fri Jan  9 20:57:01 2009	(r186974)
+++ projects/vap7/sys/geom/geom_subr.c	Fri Jan  9 20:57:43 2009	(r186975)
@@ -324,7 +324,7 @@ g_new_geomf(struct g_class *mp, const ch
 
 	g_topology_assert();
 	G_VALID_CLASS(mp);
-	sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND);
+	sb = sbuf_new_auto();
 	va_start(ap, fmt);
 	sbuf_vprintf(sb, fmt, ap);
 	va_end(ap);
@@ -564,7 +564,7 @@ g_new_providerf(struct g_geom *gp, const
 	KASSERT(!(gp->flags & G_GEOM_WITHER),
 	    ("new provider on WITHERing geom(%s) (class %s)",
 	    gp->name, gp->class->name));
-	sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND);
+	sb = sbuf_new_auto();
 	va_start(ap, fmt);
 	sbuf_vprintf(sb, fmt, ap);
 	va_end(ap);

Modified: projects/vap7/sys/geom/part/g_part.c
==============================================================================
--- projects/vap7/sys/geom/part/g_part.c	Fri Jan  9 20:57:01 2009	(r186974)
+++ projects/vap7/sys/geom/part/g_part.c	Fri Jan  9 20:57:43 2009	(r186975)
@@ -506,7 +506,7 @@ g_part_ctl_add(struct gctl_req *req, str
 
 	/* Provide feedback if so requested. */
 	if (gpp->gpp_parms & G_PART_PARM_OUTPUT) {
-		sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND);
+		sb = sbuf_new_auto();
 		sbuf_printf(sb, "%s%s added\n", gp->name,
 		    G_PART_NAME(table, entry, buf, sizeof(buf)));
 		sbuf_finish(sb);
@@ -545,7 +545,7 @@ g_part_ctl_bootcode(struct gctl_req *req
 
 	/* Provide feedback if so requested. */
 	if (gpp->gpp_parms & G_PART_PARM_OUTPUT) {
-		sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND);
+		sb = sbuf_new_auto();
 		sbuf_printf(sb, "%s has bootcode\n", gp->name);
 		sbuf_finish(sb);
 		gctl_set_param(req, "output", sbuf_data(sb), sbuf_len(sb) + 1);
@@ -749,7 +749,7 @@ g_part_ctl_create(struct gctl_req *req, 
 
 	/* Provide feedback if so requested. */
 	if (gpp->gpp_parms & G_PART_PARM_OUTPUT) {
-		sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND);
+		sb = sbuf_new_auto();
 		sbuf_printf(sb, "%s created\n", gp->name);
 		sbuf_finish(sb);
 		gctl_set_param(req, "output", sbuf_data(sb), sbuf_len(sb) + 1);
@@ -821,7 +821,7 @@ g_part_ctl_delete(struct gctl_req *req, 
 
 	/* Provide feedback if so requested. */
 	if (gpp->gpp_parms & G_PART_PARM_OUTPUT) {
-		sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND);
+		sb = sbuf_new_auto();
 		sbuf_printf(sb, "%s%s deleted\n", gp->name,
 		    G_PART_NAME(table, entry, buf, sizeof(buf)));
 		sbuf_finish(sb);
@@ -877,7 +877,7 @@ g_part_ctl_destroy(struct gctl_req *req,
 
 	/* Provide feedback if so requested. */
 	if (gpp->gpp_parms & G_PART_PARM_OUTPUT) {
-		sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND);
+		sb = sbuf_new_auto();
 		sbuf_printf(sb, "%s destroyed\n", gp->name);
 		sbuf_finish(sb);
 		gctl_set_param(req, "output", sbuf_data(sb), sbuf_len(sb) + 1);
@@ -924,7 +924,7 @@ g_part_ctl_modify(struct gctl_req *req, 
 
 	/* Provide feedback if so requested. */
 	if (gpp->gpp_parms & G_PART_PARM_OUTPUT) {
-		sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND);
+		sb = sbuf_new_auto();
 		sbuf_printf(sb, "%s%s modified\n", gp->name,
 		    G_PART_NAME(table, entry, buf, sizeof(buf)));
 		sbuf_finish(sb);
@@ -991,7 +991,7 @@ g_part_ctl_setunset(struct gctl_req *req
 
 	/* Provide feedback if so requested. */
 	if (gpp->gpp_parms & G_PART_PARM_OUTPUT) {
-		sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND);
+		sb = sbuf_new_auto();
 		sbuf_printf(sb, "%s%s has %s %sset\n", gp->name,
 		    G_PART_NAME(table, entry, buf, sizeof(buf)),
 		    gpp->gpp_attrib, (set) ? "" : "un");

Modified: projects/vap7/sys/geom/stripe/g_stripe.c
==============================================================================
--- projects/vap7/sys/geom/stripe/g_stripe.c	Fri Jan  9 20:57:01 2009	(r186974)
+++ projects/vap7/sys/geom/stripe/g_stripe.c	Fri Jan  9 20:57:43 2009	(r186975)
@@ -1069,7 +1069,7 @@ g_stripe_ctl_create(struct gctl_req *req
 	}
 
 	sc = gp->softc;
-	sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND);
+	sb = sbuf_new_auto();
 	sbuf_printf(sb, "Can't attach disk(s) to %s:", gp->name);
 	for (attached = 0, no = 1; no < *nargs; no++) {
 		snprintf(param, sizeof(param), "arg%u", no);

Modified: projects/vap7/sys/kern/vfs_mount.c
==============================================================================
--- projects/vap7/sys/kern/vfs_mount.c	Fri Jan  9 20:57:01 2009	(r186974)
+++ projects/vap7/sys/kern/vfs_mount.c	Fri Jan  9 20:57:43 2009	(r186975)
@@ -2177,7 +2177,7 @@ mount_argf(struct mntarg *ma, const char
 	ma->v[ma->len].iov_len = strlen(name) + 1;
 	ma->len++;
 
-	sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND);
+	sb = sbuf_new_auto();
 	va_start(ap, fmt);
 	sbuf_vprintf(sb, fmt, ap);
 	va_end(ap);

Modified: projects/vap7/sys/security/mac_portacl/mac_portacl.c
==============================================================================
--- projects/vap7/sys/security/mac_portacl/mac_portacl.c	Fri Jan  9 20:57:01 2009	(r186974)
+++ projects/vap7/sys/security/mac_portacl/mac_portacl.c	Fri Jan  9 20:57:43 2009	(r186975)
@@ -306,7 +306,7 @@ rules_to_string(void)
 	int needcomma;
 	char *temp;
 
-	sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND);
+	sb = sbuf_new_auto();
 	needcomma = 0;
 	mtx_lock(&rule_mtx);
 	for (rule = TAILQ_FIRST(&rule_head); rule != NULL;

Modified: projects/vap7/sys/sys/sbuf.h
==============================================================================
--- projects/vap7/sys/sys/sbuf.h	Fri Jan  9 20:57:01 2009	(r186974)
+++ projects/vap7/sys/sys/sbuf.h	Fri Jan  9 20:57:43 2009	(r186975)
@@ -56,6 +56,8 @@ __BEGIN_DECLS
  * API functions
  */
 struct sbuf	*sbuf_new(struct sbuf *, char *, int, int);
+#define		 sbuf_new_auto()				\
+	sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND)
 void		 sbuf_clear(struct sbuf *);
 int		 sbuf_setpos(struct sbuf *, int);
 int		 sbuf_bcat(struct sbuf *, const void *, size_t);

From owner-svn-src-projects@FreeBSD.ORG  Fri Jan  9 21:04:09 2009
Return-Path: <owner-svn-src-projects@FreeBSD.ORG>
Delivered-To: svn-src-projects@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8733F1065680;
	Fri,  9 Jan 2009 21:04:09 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 76C948FC08;
	Fri,  9 Jan 2009 21:04:09 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n09L493e068865;
	Fri, 9 Jan 2009 21:04:09 GMT (envelope-from sam@svn.freebsd.org)
Received: (from sam@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n09L49KU068864;
	Fri, 9 Jan 2009 21:04:09 GMT (envelope-from sam@svn.freebsd.org)
Message-Id: <200901092104.n09L49KU068864@svn.freebsd.org>
From: Sam Leffler <sam@FreeBSD.org>
Date: Fri, 9 Jan 2009 21:04:09 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-projects@freebsd.org
X-SVN-Group: projects
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r186977 - projects/vap7/share/mk
X-BeenThere: svn-src-projects@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the src &quot; projects&quot;
	tree" <svn-src-projects.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
	<mailto:svn-src-projects-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-projects>
List-Post: <mailto:svn-src-projects@freebsd.org>
List-Help: <mailto:svn-src-projects-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
	<mailto:svn-src-projects-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 09 Jan 2009 21:04:09 -0000

Author: sam
Date: Fri Jan  9 21:04:09 2009
New Revision: 186977
URL: http://svn.freebsd.org/changeset/base/186977

Log:
  merge additional build knobs from HEAD; need this to build w/ other changes,
  will bring the remaining stuff in shortly

Modified:
  projects/vap7/share/mk/   (props changed)
  projects/vap7/share/mk/bsd.own.mk

Modified: projects/vap7/share/mk/bsd.own.mk
==============================================================================
--- projects/vap7/share/mk/bsd.own.mk	Fri Jan  9 21:02:54 2009	(r186976)
+++ projects/vap7/share/mk/bsd.own.mk	Fri Jan  9 21:04:09 2009	(r186977)
@@ -285,8 +285,12 @@ WITH_IDEA=
 # MK_* options which default to "yes".
 #
 .for var in \
+    ACCT \
     ACPI \
+    AMD \
+    APM \
     ASSERT_DEBUG \
+    AT \
     ATM \
     AUDIT \
     AUTHPF \
@@ -299,18 +303,22 @@ WITH_IDEA=
     BIND_UTILS \
     BLUETOOTH \
     BOOT \
+    BSNMP \
     BZIP2 \
     CALENDAR \
     CDDL \
     CPP \
     CRYPT \
+    CTM \
     CVS \
     CXX \
     DICT \
     DYNAMICROOT \
     EXAMPLES \
+    FLOPPY \
     FORTH \
     FP_LIBC \
+    FREEBSD_UPDATE \
     GAMES \
     GCOV \
     GDB \
@@ -323,41 +331,61 @@ WITH_IDEA=
     INFO \
     INSTALLLIB \
     IPFILTER \
+    IPFW \
     IPX \
+    JAIL \
     KERBEROS \
     KVM \
+    LEGACY_CONSOLE \
     LIB32 \
     LIBPTHREAD \
     LIBKSE \
     LIBTHR \
     LOCALES \
+    LOCATE \
     LPR \
+    MAIL \
     MAILWRAPPER \
+    MAKE \
     MAN \
     NCP \
+    NDIS \
     NETCAT \
+    NETGRAPH \
     NIS \
     NLS \
     NLS_CATALOGS \
     NS_CACHING \
+    NTP \
     OBJC \
     OPENSSH \
     OPENSSL \
     PAM \
     PF \
+    PKGTOOLS \
+    PMC \
+    PORTSNAP \
+    PPP \
     PROFILE \
+    QUOTAS \
     RCMDS \
     RCS \
     RESCUE \
+    ROUTED \
     SENDMAIL \
     SETUID_LOGIN \
     SHAREDOCS \
+    SLIP \
     SSP \
+    SYSINSTALL \
     SYMVER \
     SYSCONS \
     TCSH \
+    TELNET \
+    TEXTPROC \
     TOOLCHAIN \
     USB \
+    WIRELESS \
     WPA_SUPPLICANT_EAPOL \
     ZONEINFO \
     ZFS
@@ -435,6 +463,11 @@ MK_KERBEROS:=	no
 MK_NCP:=	no
 .endif
 
+.if ${MK_MAIL} == "no"
+MK_MAILWRAPPER:= no
+MK_SENDMAIL:=	no
+.endif
+
 .if ${MK_OPENSSL} == "no"
 MK_OPENSSH:=	no
 MK_KERBEROS:=	no
@@ -444,6 +477,10 @@ MK_KERBEROS:=	no
 MK_AUTHPF:=	no
 .endif
 
+.if ${MK_TEXTPROC} == "no"
+MK_GROFF:=	no
+.endif
+
 .if ${MK_TOOLCHAIN} == "no"
 MK_GDB:=	no
 .endif
@@ -463,7 +500,9 @@ MK_GDB:=	no
     IPX \
     KERBEROS \
     KVM \
-    PAM
+    NETGRAPH \
+    PAM \
+    WIRELESS
 .if defined(WITH_${var}_SUPPORT) && defined(WITHOUT_${var}_SUPPORT)
 .error WITH_${var}_SUPPORT and WITHOUT_${var}_SUPPORT can't both be set.
 .endif

From owner-svn-src-projects@FreeBSD.ORG  Fri Jan  9 21:05:37 2009
Return-Path: <owner-svn-src-projects@FreeBSD.ORG>
Delivered-To: svn-src-projects@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 420B3106566B;
	Fri,  9 Jan 2009 21:05:37 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 2DAD48FC1A;
	Fri,  9 Jan 2009 21:05:37 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n09L5bYc068943;
	Fri, 9 Jan 2009 21:05:37 GMT (envelope-from sam@svn.freebsd.org)
Received: (from sam@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n09L5ak0068932;
	Fri, 9 Jan 2009 21:05:36 GMT (envelope-from sam@svn.freebsd.org)
Message-Id: <200901092105.n09L5ak0068932@svn.freebsd.org>
From: Sam Leffler <sam@FreeBSD.org>
Date: Fri, 9 Jan 2009 21:05:36 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-projects@freebsd.org
X-SVN-Group: projects
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r186978 - in projects/vap7: etc etc/defaults etc/rc.d
	sbin/ifconfig tools/tools/ath tools/tools/ath/athdebug
	tools/tools/ath/athkey tools/tools/ath/athpow
	tools/tools/ath/athprom tools/...
X-BeenThere: svn-src-projects@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the src &quot; projects&quot;
	tree" <svn-src-projects.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
	<mailto:svn-src-projects-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-projects>
List-Post: <mailto:svn-src-projects@freebsd.org>
List-Help: <mailto:svn-src-projects-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
	<mailto:svn-src-projects-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 09 Jan 2009 21:05:37 -0000

Author: sam
Date: Fri Jan  9 21:05:36 2009
New Revision: 186978
URL: http://svn.freebsd.org/changeset/base/186978

Log:
  first cut at merging vap/wireless-related support from HEAD:
  o ifconfig
  o tools (net80211, atH)
  o wpa_supplicant
  o hostapd
  o rc support

Added:
  projects/vap7/etc/regdomain.xml
     - copied, changed from r178355, head/etc/regdomain.xml
  projects/vap7/sbin/ifconfig/regdomain.c
     - copied, changed from r178354, head/sbin/ifconfig/regdomain.c
  projects/vap7/sbin/ifconfig/regdomain.h
     - copied, changed from r178354, head/sbin/ifconfig/regdomain.h
  projects/vap7/tools/tools/ath/Makefile.inc
     - copied unchanged from r186961, head/tools/tools/ath/Makefile.inc
  projects/vap7/tools/tools/ath/athkey/
     - copied from r186961, head/tools/tools/ath/athkey/
  projects/vap7/tools/tools/ath/athpow/
     - copied from r186961, head/tools/tools/ath/athpow/
  projects/vap7/tools/tools/ath/athprom/
     - copied from r186961, head/tools/tools/ath/athprom/
  projects/vap7/tools/tools/ath/athregs/
     - copied from r186961, head/tools/tools/ath/athregs/
  projects/vap7/tools/tools/ath/common/
     - copied from r186961, head/tools/tools/ath/common/
  projects/vap7/tools/tools/net80211/scripts/
     - copied from r186961, head/tools/tools/net80211/scripts/
  projects/vap7/tools/tools/net80211/wlanwds/
     - copied from r186961, head/tools/tools/net80211/wlanwds/
  projects/vap7/usr.sbin/wpa/wpa_supplicant/driver_wired.c
     - copied unchanged from r178358, head/usr.sbin/wpa/wpa_supplicant/driver_wired.c
Modified:
  projects/vap7/etc/   (props changed)
  projects/vap7/etc/Makefile
  projects/vap7/etc/defaults/rc.conf
  projects/vap7/etc/network.subr
  projects/vap7/etc/pccard_ether
  projects/vap7/etc/rc.d/hostapd
  projects/vap7/etc/rc.d/netif
  projects/vap7/etc/rc.d/wpa_supplicant
  projects/vap7/sbin/ifconfig/   (props changed)
  projects/vap7/sbin/ifconfig/Makefile
  projects/vap7/sbin/ifconfig/ifconfig.8
  projects/vap7/sbin/ifconfig/ifconfig.c
  projects/vap7/sbin/ifconfig/ifieee80211.c
  projects/vap7/sbin/ifconfig/ifmedia.c
  projects/vap7/sbin/ifconfig/ifvlan.c
  projects/vap7/tools/tools/ath/   (props changed)
  projects/vap7/tools/tools/ath/Makefile
  projects/vap7/tools/tools/ath/athdebug/Makefile
  projects/vap7/tools/tools/ath/athdebug/athdebug.c
  projects/vap7/tools/tools/ath/athstats/Makefile
  projects/vap7/tools/tools/ath/athstats/athstats.c
  projects/vap7/tools/tools/ath/athstats/athstats.h
  projects/vap7/tools/tools/ath/athstats/main.c
  projects/vap7/tools/tools/ath/athstats/statfoo.c
  projects/vap7/tools/tools/ath/athstats/statfoo.h
  projects/vap7/tools/tools/net80211/   (props changed)
  projects/vap7/tools/tools/net80211/Makefile
  projects/vap7/tools/tools/net80211/README
  projects/vap7/tools/tools/net80211/wlanstats/main.c
  projects/vap7/tools/tools/net80211/wlanstats/statfoo.c
  projects/vap7/tools/tools/net80211/wlanstats/statfoo.h
  projects/vap7/tools/tools/net80211/wlanstats/wlanstats.c
  projects/vap7/tools/tools/net80211/wlanstats/wlanstats.h
  projects/vap7/tools/tools/net80211/wlanwatch/wlanwatch.c
  projects/vap7/usr.sbin/wlandebug/   (props changed)
  projects/vap7/usr.sbin/wlandebug/wlandebug.8
  projects/vap7/usr.sbin/wlandebug/wlandebug.c
  projects/vap7/usr.sbin/wpa/   (props changed)
  projects/vap7/usr.sbin/wpa/hostapd/Makefile
  projects/vap7/usr.sbin/wpa/hostapd/driver_freebsd.c
  projects/vap7/usr.sbin/wpa/wpa_supplicant/   (props changed)
  projects/vap7/usr.sbin/wpa/wpa_supplicant/Packet32.c
  projects/vap7/usr.sbin/wpa/wpa_supplicant/driver_freebsd.c

Modified: projects/vap7/etc/Makefile
==============================================================================
--- projects/vap7/etc/Makefile	Fri Jan  9 21:04:09 2009	(r186977)
+++ projects/vap7/etc/Makefile	Fri Jan  9 21:05:36 2009	(r186978)
@@ -17,7 +17,7 @@ BIN1=	amd.map apmd.conf auth.conf \
 	portsnap.conf pf.os phones profile protocols \
 	rc rc.bsdextended rc.firewall rc.firewall6 rc.initdiskless \
 	rc.sendmail rc.shutdown \
-	rc.subr remote rpc services shells \
+	rc.subr regdomain.xml remote rpc services shells \
 	snmpd.config sysctl.conf syslog.conf \
 	etc.${MACHINE_ARCH}/ttys \
 	${.CURDIR}/../gnu/usr.bin/man/manpath/manpath.config \
@@ -49,6 +49,10 @@ SSH=	${.CURDIR}/../crypto/openssh/ssh_co
 SSL=	${.CURDIR}/../crypto/openssl/apps/openssl.cnf
 .endif
 
+.if ${MK_WIRELESS} != "no"
+BIN1+= regdomain.xml
+.endif
+
 # -rwxr-xr-x root:wheel, for the new cron root:wheel
 BIN2=	netstart pccard_ether rc.suspend rc.resume
 

Modified: projects/vap7/etc/defaults/rc.conf
==============================================================================
--- projects/vap7/etc/defaults/rc.conf	Fri Jan  9 21:04:09 2009	(r186977)
+++ projects/vap7/etc/defaults/rc.conf	Fri Jan  9 21:05:36 2009	(r186978)
@@ -103,7 +103,7 @@ dhclient_flags=""		# Extra flags to pass
 #dhclient_flags_fxp0=""		# Extra dhclient flags for fxp0 only
 background_dhclient="NO"	# Start dhcp client in the background.
 #background_dhclient_fxp0="YES"	# Start dhcp client on fxp0 in the background.
-synchronous_dhclient="YES"	# Start dhclient directly on configured
+synchronous_dhclient="NO"	# Start dhclient directly on configured
 				# interfaces during startup.
 firewall_enable="NO"		# Set to YES to enable firewall functionality
 firewall_script="/etc/rc.firewall" # Which script to run to set up the firewall
@@ -185,12 +185,14 @@ tcp_drop_synfin="NO"		# Set to YES to dr
 icmp_drop_redirect="NO" 	# Set to YES to ignore ICMP REDIRECT packets
 icmp_log_redirect="NO"		# Set to YES to log ICMP REDIRECT packets
 network_interfaces="auto"	# List of network interfaces (or "auto").
+if_up_delay="30"		# Time to wait for interfaces to come up.
 cloned_interfaces=""		# List of cloned network interfaces to create.
 #cloned_interfaces="gif0 gif1 gif2 gif3" # Pre-cloning GENERIC config.
 ifconfig_lo0="inet 127.0.0.1"	# default loopback device configuration.
 #ifconfig_lo0_alias0="inet 127.0.0.254 netmask 0xffffffff" # Sample alias entry.
 #ifconfig_ed0_ipx="ipx 0x00010010"	# Sample IPX address family entry.
 #ifconfig_fxp0_name="net0"	# Change interface name from fxp0 to net0.
+#vaps_ath0="wlan0"		# VAP interfaces for ath0 device
 #ipv4_addrs_fxp0="192.168.0.1/24 192.168.1.1-5/28" # example IPv4 address entry.
 #
 #autobridge_interfaces="bridge0"	# List of bridges to check 

Modified: projects/vap7/etc/network.subr
==============================================================================
--- projects/vap7/etc/network.subr	Fri Jan  9 21:04:09 2009	(r186977)
+++ projects/vap7/etc/network.subr	Fri Jan  9 21:05:36 2009	(r186978)
@@ -30,6 +30,48 @@
 # Requires that rc.conf be loaded first.
 #
 
+# ifn_start ifn
+# Bring up and configure an interface.  If some configuration is applied
+# print the interface configuration.
+#
+ifn_start()
+{
+	local ifn cfg
+	ifn="$1"
+	cfg=1
+
+	[ -z "$ifn" ] && err 1 "ifn_start called without an interface"
+
+	ifscript_up ${ifn} && cfg=0
+	ifconfig_up ${ifn} && cfg=0
+	ipv4_up ${ifn} && cfg=0
+	ipx_up ${ifn} && cfg=0
+	childif_create ${ifn}
+
+	return $cfg
+}
+
+# ifn_start ifn
+# Shutdown and de-configure an interface.  If action is taken print the
+# interface name.
+#
+ifn_stop()
+{
+	local ifn cfg
+	ifn="$1"
+	cfg=1
+
+	[ -z "$ifn" ] && return 1
+
+	ipx_down ${ifn} && cfg=0
+	ipv4_down ${ifn} && cfg=0
+	ifconfig_down ${ifn} && cfg=0
+	ifscript_down ${ifn} && cfg=0
+	childif_destroy ${ifn}
+
+	return $cfg
+}
+
 # ifconfig_up if
 #	Evaluate ifconfig(8) arguments for interface $if and
 #	run ifconfig(8) with those arguments. It returns 0 if
@@ -43,8 +85,8 @@ ifconfig_up()
 
 	ifconfig_args=`ifconfig_getargs $1`
 	if [ -n "${ifconfig_args}" ]; then
-		ifconfig $1 up
 		ifconfig $1 ${ifconfig_args}
+		ifconfig $1 up
 		_cfg=0
 	fi
 
@@ -426,7 +468,7 @@ clone_up()
 	_prefix=
 	_list=
 	for ifn in ${cloned_interfaces}; do
-		ifconfig ${ifn} create
+		ifconfig ${ifn} create `get_if_var ${ifn} create_args_IF`
 		if [ $? -eq 0 ]; then
 			_list="${_list}${_prefix}${ifn}"
 			[ -z "$_prefix" ] && _prefix=' '
@@ -452,6 +494,45 @@ clone_down()
 	debug "Destroyed clones: ${_list}"
 }
 
+# Create and configure child interfaces.
+# Return 0 if child interfaces are created.
+#
+childif_create()
+{
+	local cfg child child_wlans create_args ifn i
+	cfg=1
+
+	ifn=$1
+
+	# Create wireless interfaces
+	child_wlans=`get_if_var $ifn wlans_IF`
+
+	for child in ${child_wlans}; do
+		create_args="wlandev $ifn `get_if_var $child create_args_IF`"
+		if expr $child : 'wlan[0-9][0-9]*$' >/dev/null 2>&1; then
+			ifconfig $child create ${create_args} && cfg=0
+		else
+			i=`ifconfig wlan create ${create_args}`
+			ifconfig $i name $child && cfg=0
+		fi
+		ifn_start $child
+	done
+
+	return ${cfg}
+}
+
+# Destroy child interfaces.
+#
+childif_destroy()
+{
+	local cfg child child_wlans ifn
+
+	child_wlans="`get_if_var $ifn wlans_IF` `get_if_var $ifn vaps_IF`"
+	for child in ${child_wlans}; do
+		ifconfig $child destroy && cfg=0
+	done
+}
+
 # Create netgraph nodes.
 #
 ng_mkpeer() {
@@ -676,6 +757,29 @@ list_net_interfaces()
 	return 0
 }
 
+# get_default_if -address_family
+#	Get the interface of the default route for the given address family.
+#	The -address_family argument must be suitable passing to route(8).
+#
+get_default_if()
+{
+	routeget="`route -n get $1 default 2>/dev/null`"
+	oldifs="$IFS"
+	IFS="
+"
+	defif=
+	for line in $routeget ; do
+		case $line in
+		*interface:*)
+			defif=${line##*: }
+			;;
+		esac
+	done
+	IFS=${oldifs}
+
+	echo $defif
+}
+
 hexdigit()
 {
 	if [ $1 -lt 10 ]; then

Modified: projects/vap7/etc/pccard_ether
==============================================================================
--- projects/vap7/etc/pccard_ether	Fri Jan  9 21:04:09 2009	(r186977)
+++ projects/vap7/etc/pccard_ether	Fri Jan  9 21:05:36 2009	(r186978)
@@ -78,7 +78,7 @@ pccard_ether_start()
 		done
 	fi
 
-	/etc/rc.d/netif start $ifn
+	/etc/rc.d/netif quietstart $ifn
 
 	# Do route configuration if needed.
 	# XXX: should probably do this by calling rc.d/routing.
@@ -99,7 +99,7 @@ pccard_ether_stop()
 		fi
 	fi
 
-	/etc/rc.d/netif stop $ifn
+	/etc/rc.d/netif quietstop $ifn
 
 	# clean ARP table
 	ifexists $ifn && arp -d -i $ifn -a

Modified: projects/vap7/etc/rc.d/hostapd
==============================================================================
--- projects/vap7/etc/rc.d/hostapd	Fri Jan  9 21:04:09 2009	(r186977)
+++ projects/vap7/etc/rc.d/hostapd	Fri Jan  9 21:05:36 2009	(r186978)
@@ -18,6 +18,7 @@ pidfile="/var/run/${name}.pid"
 
 command_args="-P ${pidfile} -B ${conf_file}"
 required_files="${conf_file}"
+required_modules="wlan_xauth wlan_wep wlan_tkip wlan_ccmp"
 extra_commands="reload"
 
 load_rc_config ${name}

Modified: projects/vap7/etc/rc.d/netif
==============================================================================
--- projects/vap7/etc/rc.d/netif	Fri Jan  9 21:04:09 2009	(r186977)
+++ projects/vap7/etc/rc.d/netif	Fri Jan  9 21:05:36 2009	(r186978)
@@ -68,7 +68,30 @@ network_start()
 	fi
 
 	# Configure the interface(s).
-	network_common ifn_start verbose
+	network_common ifn_start
+
+	if [ -z "$cmdifn" ]; then
+		dhcp_interfaces=`list_net_interfaces dhcp`
+		if [ -n "${dhcp_interfaces}" ]; then
+			delay=${if_up_delay}
+			while [ ${delay} -gt 0 ]; do
+				defif=`get_default_if -inet`
+				if [ -n "${defif}" ]; then
+					if [ ${delay} -ne ${if_up_delay} ]; then
+						echo "($defif)"
+					fi
+					break
+				fi
+				if [ ${delay} -eq ${if_up_delay} ]; then
+					echo -n "Waiting for an interface to come up: "
+				else
+					echo -n .
+				fi
+				sleep 1
+				delay=`expr $delay - 1`
+			done
+		fi
+	fi
 
 	if [ -f /etc/rc.d/ipfilter ] ; then
 		# Resync ipfilter
@@ -85,100 +108,67 @@ network_stop()
 	#
 	cmdifn=$*
 
-	echo -n "Stopping network:"
-
 	# Deconfigure the interface(s)
 	network_common ifn_stop
-	echo '.'
 }
 
-# network_common routine verbose
+# network_common routine
 #	Common configuration subroutine for network interfaces. This
 #	routine takes all the preparatory steps needed for configuriing
-#	an interface and then calls $routine. If $verbose is specified,
-#	it will call ifconfig(8) to show, in long format, the configured
-#	interfaces. If $verbose is not given, it will simply output the
-#	configured interface(s).
+#	an interface and then calls $routine.
 network_common()
 {
-	local _cooked_list _fail _func _verbose
+	local _cooked_list _fail _func _ok _str
 
 	_func=
-	_verbose=
 
 	if [ -z "$1" ]; then
 		err 1 "network_common(): No function name specified."
 	else
 		_func="$1"
 	fi
-	[ -n "$2" ] && _verbose=yes
 
 	# Set the scope of the command (all interfaces or just one).
 	#
 	_cooked_list=
 	if [ -n "$cmdifn" ]; then
-		# Don't check that the interfaces exist.  We need to run
+		# Don't check that the interface(s) exist.  We need to run
 		# the down code even when the interface doesn't exist to
 		# kill off wpa_supplicant.
+		# XXXBED: is this really true or does wpa_supplicant die?
+		# if so, we should get rid of the devd entry
 		_cooked_list="$cmdifn"
 	else
 		_cooked_list="`list_net_interfaces`"
 	fi
 
 	_fail=
+	_ok=
 	for ifn in ${_cooked_list}; do
-		if ${_func} ${ifn} ; then
-			eval showstat_$ifn=1
+		if ${_func} ${ifn} $2; then
+			_ok="${_ok} ${ifn}"
 		else
-			_fail="$_fail $ifn"
+			_fail="${_fail} ${ifn}"
 		fi
 	done
 
-	# Display interfaces configured by this script
-	#
-	for ifn in ${_cooked_list}; do
-		eval showstat=\$showstat_${ifn}
-		if [ ! -z ${showstat} ]; then
-			if [ -n "$_verbose" ]; then
-				ifconfig ${ifn}
-			else
-				echo -n " ${ifn}"
-			fi
+	_str=
+	if [ -n "${_ok}" ]; then
+		case ${_func} in
+		ifn_start)
+			_str='Starting'
+			;;
+		ifn_stop)
+			_str='Stopping'
+			;;
+		esac
+		echo "${_str} Network:${_ok}."
+		if [ -z "${rc_quiet}" ]; then
+			/sbin/ifconfig ${_ok}
 		fi
-	done
-	debug "The following interfaces were not configured: $_fail"
-}
-
-ifn_start()
-{
-	local ifn cfg
-	ifn="$1"
-	cfg=1
-
-	[ -z "$ifn" ] && return 1
-
-	ifscript_up ${ifn} && cfg=0
-	ifconfig_up ${ifn} && cfg=0
-	ipv4_up ${ifn} && cfg=0
-	ipx_up ${ifn} && cfg=0
-
-	return $cfg
-}
-
-ifn_stop()
-{
-	local ifn cfg
-	ifn="$1"
-	cfg=1
-
-	[ -z "$ifn" ] && return 1
-
-	ipx_down ${ifn} && cfg=0
-	ipv4_down ${ifn} && cfg=0
-	ifconfig_down ${ifn} && cfg=0
-	ifscript_down ${ifn} && cfg=0
+	fi
 
-	return $cfg
+	debug "The following interfaces were not configured: $_fail"
 }
 
 load_rc_config $name

Modified: projects/vap7/etc/rc.d/wpa_supplicant
==============================================================================
--- projects/vap7/etc/rc.d/wpa_supplicant	Fri Jan  9 21:04:09 2009	(r186977)
+++ projects/vap7/etc/rc.d/wpa_supplicant	Fri Jan  9 21:05:36 2009	(r186978)
@@ -20,12 +20,25 @@ if [ -z "$ifn" ]; then
 	return 1
 fi
 
-case ${ifn} in
-ndis*)
+is_ndis_interface()
+{
+	case `sysctl -n net.wlan.${1#wlan}.%parent 2>/dev/null` in
+		ndis*) true ;;
+		*) false ;;
+	esac
+}
+
+if is_wired_interface ${ifn} ; then
+	driver="wired"
+elif is_ndis_interface ${ifn} ; then
 	driver="ndis"
 	;;
 *)
-	driver="bsd"
+	if is_wired_interface ${ifn} ; then
+		driver="wired"
+	else
+		driver="bsd"
+	fi
 	;;
 esac
 
@@ -34,5 +47,6 @@ load_rc_config $name
 pidfile="/var/run/${name}/${ifn}.pid"
 command_args="-B -q -i $ifn -c $conf_file -D $driver -P $pidfile"
 required_files=$conf_file
+required_modules="wlan_wep wlan_tkip wlan_ccmp"
 
 run_rc_command "$1"

Copied and modified: projects/vap7/etc/regdomain.xml (from r178355, head/etc/regdomain.xml)
==============================================================================
--- head/etc/regdomain.xml	Sun Apr 20 20:37:02 2008	(r178355, copy source)
+++ projects/vap7/etc/regdomain.xml	Fri Jan  9 21:05:36 2009	(r186978)
@@ -39,7 +39,7 @@
 -->
 <rd id="debug">
   <name>DEBUG</name>
-  <sku>0</sku>
+  <sku>0x1ff</sku>
 </rd>
 
 <rd id="fcc">
@@ -1080,6 +1080,75 @@
     </band>
   </netband>
 </rd>
+
+<rd id="sr9">
+  <name>SR9</name>
+  <sku>0x0298</sku>
+  <defcc ref="SR9"/>
+  <netband mode="11g">
+    <band>
+      <freqband ref="S1_907_922_5"/>
+      <maxpower>30</maxpower>
+      <flags>IEEE80211_CHAN_G</flags>
+    </band>
+    <band>
+      <freqband ref="S1_907_922_10"/>
+      <maxpower>30</maxpower>
+      <flags>IEEE80211_CHAN_G</flags>
+    </band>
+    <band>
+      <freqband ref="S1_912_917"/>
+      <maxpower>30</maxpower>
+      <flags>IEEE80211_CHAN_G</flags>
+    </band>
+  </netband>
+</rd>
+
+<rd id="xr9">
+  <name>XR9</name>
+  <sku>0x299</sku>
+  <defcc ref="XR9"/>
+  <netband mode="11g">
+    <band>
+      <freqband ref="S2_907_922_5"/>
+      <maxpower>30</maxpower>
+      <flags>IEEE80211_CHAN_G</flags>
+    </band>
+    <band>
+      <freqband ref="S2_907_922_10"/>
+      <maxpower>30</maxpower>
+      <flags>IEEE80211_CHAN_G</flags>
+    </band>
+    <band>
+      <freqband ref="S2_912_917"/>
+      <maxpower>30</maxpower>
+      <flags>IEEE80211_CHAN_G</flags>
+    </band>
+  </netband>
+</rd>
+
+<rd id="gz901">
+  <name>GZ901</name>
+  <sku>0x29a</sku>
+  <defcc ref="GZ901"/>
+  <netband mode="11g">
+    <band>
+      <freqband ref="S1_908_923_5"/>
+      <maxpower>30</maxpower>
+      <flags>IEEE80211_CHAN_G</flags>
+    </band>
+    <band>
+      <freqband ref="S1_913_918_10"/>
+      <maxpower>30</maxpower>
+      <flags>IEEE80211_CHAN_G</flags>
+    </band>
+    <band>
+      <freqband ref="S1_913_918"/>
+      <maxpower>30</maxpower>
+      <flags>IEEE80211_CHAN_G</flags>
+    </band>
+  </netband>
+</rd>
 </regulatory-domains>
 
 <country-codes>
@@ -1201,6 +1270,9 @@
 <country id="GT">
   <isocc>320</isocc> <name>Guatemala</name> <rd ref="none"/>
 </country>
+<country id="GZ901">
+  <isocc>5002</isocc> <name>ZComax GZ-901</name> <rd ref="gz901"/>
+</country>
 <country id="HN">
   <isocc>340</isocc> <name>Honduras</name> <rd ref="none"/>
 </country>
@@ -1396,6 +1468,12 @@
 <country id="TR">
   <isocc>792</isocc> <name>Turkey</name> <rd ref="etsi"/>
 </country>
+<country id="SR9">
+  <isocc>5000</isocc> <name>Ubiquiti SR9</name> <rd ref="sr9"/>
+</country>
+<country id="XR9">
+  <isocc>5001</isocc> <name>Ubiquiti XR9</name> <rd ref="xr9"/>
+</country>
 <country id="UA">
   <isocc>804</isocc> <name>Ukraine</name> <rd ref="none"/>
 </country>
@@ -1426,6 +1504,10 @@
 <country id="ZW">
   <isocc>716</isocc> <name>Zimbabwe</name> <rd ref="none"/>
 </country>
+
+<country id="DEBUG">
+  <isocc>0</isocc> <name>Debug</name> <rd ref="debug"/>
+</country>
 </country-codes>
 
 <!--
@@ -1575,6 +1657,61 @@
   <freqstart>2512</freqstart> <freqend>2732</freqend>
   <chanwidth>20</chanwidth> <chansep>5</chansep>
 </freqband>
+
+<freqband id="S1_907_922_5">
+  <freqstart>2422</freqstart> <freqend>2437</freqend>
+  <chanwidth>5</chanwidth> <chansep>5</chansep>
+  <flags>IEEE80211_CHAN_GSM</flags>
+  <flags>IEEE80211_CHAN_QUARTER</flags>
+</freqband>
+<freqband id="S1_907_922_10">
+  <freqstart>2422</freqstart> <freqend>2437</freqend>
+  <chanwidth>10</chanwidth> <chansep>5</chansep>
+  <flags>IEEE80211_CHAN_GSM</flags>
+  <flags>IEEE80211_CHAN_HALF</flags>
+</freqband>
+<freqband id="S1_912_917">
+  <freqstart>2427</freqstart> <freqend>2432</freqend>
+  <chanwidth>20</chanwidth> <chansep>5</chansep>
+  <flags>IEEE80211_CHAN_GSM</flags>
+</freqband>
+
+<freqband id="S2_907_922_5">
+  <freqstart>2427</freqstart> <freqend>2442</freqend>
+  <chanwidth>5</chanwidth> <chansep>5</chansep>
+  <flags>IEEE80211_CHAN_GSM</flags>
+  <flags>IEEE80211_CHAN_QUARTER</flags>
+</freqband>
+<freqband id="S2_907_922_10">
+  <freqstart>2427</freqstart> <freqend>2442</freqend>
+  <chanwidth>10</chanwidth> <chansep>5</chansep>
+  <flags>IEEE80211_CHAN_GSM</flags>
+  <flags>IEEE80211_CHAN_HALF</flags>
+</freqband>
+<freqband id="S2_912_917">
+  <freqstart>2432</freqstart> <freqend>2437</freqend>
+  <chanwidth>20</chanwidth> <chansep>5</chansep>
+  <flags>IEEE80211_CHAN_GSM</flags>
+</freqband>
+
+<freqband id="S1_908_923_5">
+  <freqstart>2447</freqstart> <freqend>2467</freqend>
+  <chanwidth>5</chanwidth> <chansep>5</chansep>
+  <flags>IEEE80211_CHAN_GSM</flags>
+  <flags>IEEE80211_CHAN_QUARTER</flags>
+</freqband>
+<freqband id="S1_913_918_10">
+  <freqstart>2457</freqstart> <freqend>2462</freqend>
+  <chanwidth>10</chanwidth> <chansep>5</chansep>
+  <flags>IEEE80211_CHAN_GSM</flags>
+  <flags>IEEE80211_CHAN_HALF</flags>
+</freqband>
+<freqband id="S1_913_918">
+  <freqstart>2457</freqstart> <freqend>2462</freqend>
+  <chanwidth>20</chanwidth> <chansep>5</chansep>
+  <flags>IEEE80211_CHAN_GSM</flags>
+</freqband>
+
 </shared-frequency-bands>
 
 </regulatory-data>

Modified: projects/vap7/sbin/ifconfig/Makefile
==============================================================================
--- projects/vap7/sbin/ifconfig/Makefile	Fri Jan  9 21:04:09 2009	(r186977)
+++ projects/vap7/sbin/ifconfig/Makefile	Fri Jan  9 21:05:36 2009	(r186978)
@@ -23,9 +23,12 @@ SRCS+=	ifclone.c		# clone device support
 SRCS+=	ifmac.c			# MAC support
 SRCS+=	ifmedia.c		# SIOC[GS]IFMEDIA support
 SRCS+=	ifvlan.c		# SIOC[GS]ETVLAN support
-SRCS+=	ifieee80211.c		# SIOC[GS]IEEE80211 support
 SRCS+=	ifgre.c			# GRE keys etc
 
+SRCS+=	ifieee80211.c regdomain.c # SIOC[GS]IEEE80211 support
+DPADD+=	${LIBBSDXML} ${LIBSBUF}
+LDADD+=	-lbsdxml -lsbuf
+
 SRCS+=	ifcarp.c		# SIOC[GS]VH support
 SRCS+=	ifgroup.c		# ...
 SRCS+=	ifpfsync.c		# pfsync(4) support
@@ -35,8 +38,8 @@ SRCS+=	iflagg.c		# lagg support
 
 .if ${MK_IPX_SUPPORT} != "no" && !defined(RELEASE_CRUNCH)
 SRCS+=	af_ipx.c		# IPX support
-DPADD=	${LIBIPX}
-LDADD=	-lipx
+DPADD+=	${LIBIPX}
+LDADD+=	-lipx
 .endif
 
 MAN=	ifconfig.8

Modified: projects/vap7/sbin/ifconfig/ifconfig.8
==============================================================================
--- projects/vap7/sbin/ifconfig/ifconfig.8	Fri Jan  9 21:04:09 2009	(r186977)
+++ projects/vap7/sbin/ifconfig/ifconfig.8	Fri Jan  9 21:05:36 2009	(r186978)
@@ -28,7 +28,7 @@
 .\"     From: @(#)ifconfig.8	8.3 (Berkeley) 1/5/94
 .\" $FreeBSD$
 .\"
-.Dd June 20, 2008
+.Dd January 7, 2009
 .Dt IFCONFIG 8
 .Os
 .Sh NAME
@@ -584,8 +584,143 @@ If the interface was reset when previous
 the hardware will be re-initialized.
 .El
 .Pp
-The following parameters are specific to IEEE 802.11 wireless interfaces:
+The following parameters are specific to cloning
+IEEE 802.11 wireless interfaces with the
+.Cm create
+request:
 .Bl -tag -width indent
+.It Cm wlandev Ar device
+Use
+.Ar device
+as the parent for the cloned device.
+.It Cm wlanmode Ar mode
+Specify the operating mode for this cloned device.
+.Ar mode
+is one of
+.Cm sta ,
+.Cm ahdemo 
+(or
+.Cm adhoc-demo ),
+.Cm ibss ,
+(or
+.Cm adhoc ),
+.Cm ap ,
+(or
+.Cm hostap ),
+.Cm wds ,
+.Cm tdma ,
+and
+.Cm monitor .
+The operating mode of a cloned interface cannot be changed.
+The
+.Cm tdma
+mode is actually implemented as an
+.Cm adhoc-demo
+interface with special properties.
+.It Cm wlanbssid Ar bssid
+The 802.11 mac address to use for the bssid.
+This must be specified at create time for a legacy
+.Cm wds
+device.
+.It Cm wlanaddr Ar address
+The local mac address.
+If this is not specified then a mac address will automatically be assigned
+to the cloned device.
+Typically this address is the same as the address of the parent device
+but if the
+.Cm bssid
+parameter is specified then the driver will craft a unique address for
+the device (if supported).
+.It Cm wdslegacy
+Mark a
+.Cm wds
+device as operating in ``legacy mode''.
+Legacy 
+.Cm wds
+devices have a fixed peer relationship and do not, for example, roam
+if their peer stops communicating.
+For completeness a Dynamic WDS (DWDS) interface may marked as
+.Fl wdslegacy .
+.It Cm bssid
+Request a unique local mac address for the cloned device.
+This is only possible if the device supports multiple mac addresses.
+To force use of the parent's mac address use
+.Fl bssid .
+.It Cm beacons
+Mark the cloned interface as depending on hardware support to
+track received beacons.
+To have beacons tracked in software use
+.Fl beacons .
+For 
+.Cm hostap
+mode 
+.Fl beacons
+can also be used to indicate no beacons should
+be transmitted; this can be useful when creating a WDS configuration but
+.Cm wds
+interfaces can only be created as companions to an access point.
+.El
+.Pp
+The following parameters are specific to IEEE 802.11 wireless interfaces
+cloned with a
+.Cm create
+operation:
+.Bl -tag -width indent
+.It Cm ampdu
+Enable sending and receiving AMPDU frames when using 802.11n (default).
+The 802.11n specification states a compliant station must be capable
+of receiving AMPDU frames but transmision is optional.
+Use
+.Fl ampdu
+to disable all use of AMPDU with 802.11n.
+For testing and/or to work around interoperability problems one can use
+.Cm ampdutx
+and
+.Cm ampdurx
+to control use of AMPDU in one direction.
+.It Cm ampdudensity Ar density
+Set the AMPDU density parameter used when operating with 802.11n.
+This parameter controls the inter-packet gap for AMPDU frames.
+The sending device normally controls this setting but a receiving station
+may request wider gaps.
+Legal values for
+.Ar density
+are 0, .25, .5, 1, 2, 4, 8, and 16 (microseconds).
+A value of
+.Cm -
+is treated the same as 0.
+.It Cm ampdulimit Ar limit
+Set the limit on packet size for receiving AMPDU frames when operating
+with 802.11n.
+Legal values for
+.Ar limit
+are 8192, 16384, 32768, and 65536 but one can also specify
+just the unique prefix: 8, 16, 32, 64.
+Note the sender may limit the size of AMPDU frames to be less
+than the maximum specified by the receiving station.
+.It Cm amsdu
+Enable sending and receiving AMSDU frames when using 802.11n.
+By default AMSDU is received but not transmitted.
+Use
+.Fl amsdu
+to disable all use of AMSDU with 802.11n.
+For testing and/or to work around interoperability problems one can use
+.Cm amsdutx
+and
+.Cm amsdurx
+to control use of AMSDU in one direction.
+.It Cm amsdulimit Ar limit
+Set the limit on packet size for sending and receiving AMSDU frames
+when operating with 802.11n.
+Legal values for
+.Ar limit
+are 7935 and 3839 (bytes).
+Note the sender may limit the size of AMSDU frames to be less
+than the maximum specified by the receiving station.
+Note also that devices are not required to support the 7935 limit,
+only 3839 is required by the specification and the larger value
+may require more memory to be dedicated to support functionality
+that is rarely used.
 .It Cm apbridge
 When operating as an access point, pass packets between
 wireless clients directly (default).
@@ -597,7 +732,7 @@ is useful when traffic is to be processe
 packet filtering.
 .It Cm authmode Ar mode
 Set the desired authentication mode in infrastructure mode.
-Not all adaptors support all modes.
+Not all adapters support all modes.
 The set of
 valid modes is
 .Cm none , open , shared
@@ -725,7 +860,7 @@ or
 .Cm -
 will give you the default for your adaptor.
 Some
-adaptors ignore this setting unless you are in ad-hoc mode.
+adapters ignore this setting unless you are in ad-hoc mode.
 Alternatively the frequency, in megahertz, may be specified
 instead of the channel number.
 .Pp
@@ -770,9 +905,61 @@ a 40MHz HT channel specification may inc
 of the extension channel by appending ``+'' or ``-'' for above and below,
 respectively; e.g. ``2437:ht/40+'' specifies 40MHz wide HT operation 
 with the center channel at frequency 2437 and the extension channel above.
+.It Cm country Ar name
+Set the country code to use in calculating the regulatory constraints
+for operation.
+In particular the set of available channels, how the wireless device
+will operation on the channels, and the maximum transmit power that
+can be used on a channel are defined by this setting.
+Country/Region codes are specified as a 2-character abbreviation
+defined by ISO 3166 or using a longer, but possibly ambiguous, spelling;
+e.g. "ES" and "Spain".
+The set of country codes are taken from /etc/regdomain.xml and can also
+be viewed with the ``list countries'' request.
+Note that not all devices support changing the country code from a default
+setting; typically stored in EEPROM.
+See also
+.Cm regdomain ,
+.Cm indoor ,
+.Cm outdoor ,
+and
+.Cm anywhere .
+.It Cm dfs
+Enable Dynamic Frequency Selection (DFS) as specified in 802.11h.
+DFS embodies several facilities including detection of overlapping
+radar signals, dynamic transmit power control, and channel selection
+according to a least-congested criteria.
+DFS support is mandatory for some 5Ghz frequencies in certain
+locales (e.g. ETSI).
+By default DFS is enabled according to the regulatory definitions
+specified in /etc/regdomain.xml and the curent country code, regdomain,
+and channel.
+Note the underlying device (and driver) must support radar detection
+for full DFS support to work.
+To be fully compliant with the local regulatory agency frequencies that
+require DFS should not be used unless it is fully supported.
+Use
+.Fl dfs
+to disable this functionality for testing.
+.It Cm dotd
+Enable support for the 802.11d specification (default).
+When this support is enabled in station mode, beacon frames that advertise
+a country code different than the currently configured country code will
+cause an event to be dispatched to user applications.
+This event can be used by the station to adopt that country code and
+operate according to the associated regulatory constraints.
+When operating as an access point with 802.11d enabled the beacon and
+probe response frames transmitted will advertise the current regulatory
+domain settings.
+To disable 802.11d use
+.Fl dotd .
 .It Cm doth
-Enable inclusion of an 802.11h country information element in beacon
-frames transmitted when operating as an access point.
+Enable 802.11h support including spectrum management.
+When 802.11h is enabled beacon and probe response frames will have
+the SpectrumMgt bit set in the capabilities field and
+country and power constraint information elements will be present.
+802.11h support also includes handling Channel Switch Announcements (CSA)
+which are a mechanism to coordinate channel changes by an access point.
 By default 802.11h is enabled if the device is capable.
 To disable 802.11h use
 .Fl doth .
@@ -811,6 +998,48 @@ channels depending on the regulatory con
 command to identify the channels where turbo mode may be used.
 To disable Dynamic Turbo mode use
 .Fl dturbo .
+.It Cm dwds
+Enable Dynamic WDS (DWDS) support.
+DWDS is a facility by which 4-address traffic can be carried between
+stations operating in infrastructure mode.
+A station first associates to an access point and authenticates using
+normal procedures (e.g. WPA).
+Then 4-address frames are passed to carry traffic for stations
+operating on either side of the wireless link.
+DWDS extends the normal WDS mechanism by leveraging existing security
+protocols and eliminating static binding.
+.Pp
+When DWDS is enabled on an access point 4-address frames received from
+an authorized station will generate a ``DWDS discovery'' event to user
+applications.
+This event should be used to create a WDS interface that is bound
+to the remote station (and usually plumbed into a bridge).
+Once the WDS interface is up and running 4-address traffic then logically
+flows through that interface.
+.Pp
+When DWDS is enabled on a station, traffic with a destination address
+different from the peer station are encapsulated in a 4-address frame
+and transmitted to the peer.
+All 4-address traffic uses the security information of the stations
+(e.g. cryptographic keys).
+A station is associated using 802.11n facilities may transport
+4-address traffic using these same mechanisms; this depends on available
+resources and capabilities of the device.
+The DWDS implementation guards against layer 2 routing loops of
+multicast traffic.
+.It Cm ff
+Enable the use of Atheros Fast Frames when communicating with
+another Fast Frames-capable station.
+Fast Frames are an encapsulation technique by which two 802.3
+frames are transmitted in a single 802.11 frame.
+This can noticeably improve throughput but requires that the
+receiving station understand how to decapsulate the frame.
+Fast frame use is negotiated using the Atheros 802.11 vendor-specific
+protocol extension so enabling use is safe when communicating with
+non-Atheros devices.
+By default, use of fast frames is enabled if the device is capable.
+To explicitly disable fast frames, use
+.Fl ff .
 .It Cm fragthreshold Ar length
 Set the threshold for which transmitted frames are broken into fragments.
 The
@@ -824,7 +1053,7 @@ to
 or
 .Cm -
 disables transmit fragmentation.
-Not all adaptors honor the fragmentation threshold.
+Not all adapters honor the fragmentation threshold.
 .It Cm hidessid
 When operating as an access point, do not broadcast the SSID
 in beacon frames or respond to probe request frames unless
@@ -833,19 +1062,76 @@ By default, the SSID is included in beac
 undirected probe request frames are answered.
 To re-enable the broadcast of the SSID etc., use
 .Fl hidessid .
-.It Cm ff
-Enable the use of Atheros Fast Frames when communicating with
-another Fast Frames-capable station.
-Fast Frames are an encapsulation technique by which two 802.3
-frames are transmitted in a single 802.11 frame.
-This can noticeably improve throughput but requires that the
-receiving station understand how to decapsulate the frame.
-Fast frame use is negotiated using the Atheros 802.11 vendor-specific
-protocol extension so enabling use is safe when communicating with
-non-Atheros devices.
-By default, use of fast frames is enabled if the device is capable.
-To explicitly disable fast frames, use
-.Fl ff .
+.It Cm ht
+Enable use of High Throughput (HT) when using 802.11n (default).
+The 802.11n specification includes mechanisms for operation
+on 20MHz and 40MHz wide channels using different signalling mechanisms
+than specified in 802.11b, 802.11g, and 802.11a.
+Stations negotiate use of these facilities, termed HT20 and HT40,
+when they associate.
+To disable all use of 802.11n use
+.Fl ht .
+To disable use of HT20 (e.g. to force only HT40 use) use
+.Fl ht20 .
+To disable use of HT40 use
+.Fl ht40 .
+.Pp
+HT configuration is used to ``auto promote'' operation
+when several choices are available.
+For example, if a station associates to an 11n-capable access point
+it controls whether the station uses legacy operation, HT20, or HT40.
+When an 11n-capable device is setup as an access point and
+Auto Channel Selection is used to locate a channel to operate on,
+HT configuration controls whether legacy, HT20, or HT40 operation is setup
+on the selected channel.
+If a fixed channel is specified for a station then HT configuration can
+be given as part of the channel specification; e.g. 6:ht/20 to setup
+HT20 operation on channel 6.
+.It Cm htcompat
+Enable use of compatibility support for pre-802.11n devices (default).
+The 802.11n protocol specification went through several incompatible iterations.
+Some vendors implemented 11n support to older specifications that
+will not interoperate with a purely 11n-compliant station.
+In particular the information elements included in management frames
+for old devices are different.
+When compatibility support is enabled both standard and compatible data
+will be provided.
+Stations that associate using the compatiblity mechanisms are flagged
+in ``list sta''.
+To disable compatiblity support use
+.Fl htcompat .
+.It Cm htprotmode Ar technique
+For interfaces operating in 802.11n, use the specified
+.Ar technique
+for protecting HT frames in a mixed legacy/HT network.
+The set of valid techniques is
+.Cm off ,
+and
+.Cm rts
+(RTS/CTS, default).
+Technique names are case insensitive.
+.It Cm inact
+Enable inactivity processing for stations associated to an
+access point (default).
+When operating as an access point the 802.11 layer monitors
+the activity of each associated station.
+When a station is inactive for 5 minutes it will send several
+``probe frames'' to see if the station is still present.

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

From owner-svn-src-projects@FreeBSD.ORG  Sat Jan 10 00:17:03 2009
Return-Path: <owner-svn-src-projects@FreeBSD.ORG>
Delivered-To: svn-src-projects@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BC08A106566B;
	Sat, 10 Jan 2009 00:17:03 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id AB9B18FC08;
	Sat, 10 Jan 2009 00:17:03 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0A0H3NS073275;
	Sat, 10 Jan 2009 00:17:03 GMT (envelope-from sam@svn.freebsd.org)
Received: (from sam@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0A0H31C073274;
	Sat, 10 Jan 2009 00:17:03 GMT (envelope-from sam@svn.freebsd.org)
Message-Id: <200901100017.n0A0H31C073274@svn.freebsd.org>
From: Sam Leffler <sam@FreeBSD.org>
Date: Sat, 10 Jan 2009 00:17:03 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-projects@freebsd.org
X-SVN-Group: projects
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r186987 - projects/vap7/sys/net80211
X-BeenThere: svn-src-projects@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the src &quot; projects&quot;
	tree" <svn-src-projects.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
	<mailto:svn-src-projects-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-projects>
List-Post: <mailto:svn-src-projects@freebsd.org>
List-Help: <mailto:svn-src-projects-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
	<mailto:svn-src-projects-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sat, 10 Jan 2009 00:17:04 -0000

Author: sam
Date: Sat Jan 10 00:17:03 2009
New Revision: 186987
URL: http://svn.freebsd.org/changeset/base/186987

Log:
  revert vimage support brought in by merge

Modified:
  projects/vap7/sys/net80211/ieee80211_ddb.c

Modified: projects/vap7/sys/net80211/ieee80211_ddb.c
==============================================================================
--- projects/vap7/sys/net80211/ieee80211_ddb.c	Fri Jan  9 23:57:59 2009	(r186986)
+++ projects/vap7/sys/net80211/ieee80211_ddb.c	Sat Jan 10 00:17:03 2009	(r186987)
@@ -37,14 +37,12 @@ __FBSDID("$FreeBSD$");
 #include <sys/systm.h> 
 #include <sys/kernel.h>
 #include <sys/socket.h>
-#include <sys/vimage.h>
 
 #include <net/if.h>
 #include <net/if_dl.h>
 #include <net/if_media.h>
 #include <net/if_types.h>
 #include <net/ethernet.h>
-#include <net/vnet.h>
 
 #include <net80211/ieee80211_var.h>
 
@@ -191,7 +189,6 @@ DB_SHOW_COMMAND(com, db_show_com)
 
 DB_SHOW_ALL_COMMAND(vaps, db_show_all_vaps)
 {
-	VNET_ITERATOR_DECL(vnet_iter);
 	const struct ifnet *ifp;
 	int i, showall = 0;
 
@@ -202,25 +199,22 @@ DB_SHOW_ALL_COMMAND(vaps, db_show_all_va
 			break;
 		}
 
-	VNET_FOREACH(vnet_iter) {
-		INIT_VNET_NET(vnet_iter);
-		TAILQ_FOREACH(ifp, &V_ifnet, if_list)
-			if (ifp->if_type == IFT_IEEE80211) {
-				const struct ieee80211com *ic = ifp->if_l2com;
-
-				if (!showall) {
-					const struct ieee80211vap *vap;
-					db_printf("%s: com %p vaps:",
-					    ifp->if_xname, ic);
-					TAILQ_FOREACH(vap, &ic->ic_vaps,
-					    iv_next)
-						db_printf(" %s(%p)",
-						    vap->iv_ifp->if_xname, vap);
-					db_printf("\n");
-				} else
-					_db_show_com(ic, 1, 1, 1);
-			}
-	}
+	TAILQ_FOREACH(ifp, &ifnet, if_list)
+		if (ifp->if_type == IFT_IEEE80211) {
+			const struct ieee80211com *ic = ifp->if_l2com;
+
+			if (!showall) {
+				const struct ieee80211vap *vap;
+				db_printf("%s: com %p vaps:",
+				    ifp->if_xname, ic);
+				TAILQ_FOREACH(vap, &ic->ic_vaps,
+				    iv_next)
+					db_printf(" %s(%p)",
+					    vap->iv_ifp->if_xname, vap);
+				db_printf("\n");
+			} else
+				_db_show_com(ic, 1, 1, 1);
+		}
 }
 
 static void

From owner-svn-src-projects@FreeBSD.ORG  Sat Jan 10 00:25:40 2009
Return-Path: <owner-svn-src-projects@FreeBSD.ORG>
Delivered-To: svn-src-projects@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id EF0CA1065672;
	Sat, 10 Jan 2009 00:25:40 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id DB4DD8FC0A;
	Sat, 10 Jan 2009 00:25:40 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0A0Pe9H073510;
	Sat, 10 Jan 2009 00:25:40 GMT (envelope-from sam@svn.freebsd.org)
Received: (from sam@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0A0Pecp073496;
	Sat, 10 Jan 2009 00:25:40 GMT (envelope-from sam@svn.freebsd.org)
Message-Id: <200901100025.n0A0Pecp073496@svn.freebsd.org>
From: Sam Leffler <sam@FreeBSD.org>
Date: Sat, 10 Jan 2009 00:25:40 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-projects@freebsd.org
X-SVN-Group: projects
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r186988 - in projects/vap7/sys: . arm/conf conf
	contrib/pf dev dev/ath/ath_hal/ar5210 dev/ath/ath_hal/ar5211
	dev/ath/ath_hal/ar5212 dev/ath/ath_hal/ar5312
	dev/ath/ath_hal/ar5416 dev/cxg...
X-BeenThere: svn-src-projects@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the src &quot; projects&quot;
	tree" <svn-src-projects.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
	<mailto:svn-src-projects-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-projects>
List-Post: <mailto:svn-src-projects@freebsd.org>
List-Help: <mailto:svn-src-projects-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
	<mailto:svn-src-projects-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sat, 10 Jan 2009 00:25:41 -0000

Author: sam
Date: Sat Jan 10 00:25:40 2009
New Revision: 186988
URL: http://svn.freebsd.org/changeset/base/186988

Log:
  mfc r178372: make genclock standard on all platforms
  
  Note this requires ia64+ppc mods that are not brought back; this is brought
  back to simplify code sharing w/ head for other platforms.

Modified:
  projects/vap7/sys/   (props changed)
  projects/vap7/sys/arm/conf/AVILA
  projects/vap7/sys/arm/conf/BWCT
  projects/vap7/sys/arm/conf/CRB
  projects/vap7/sys/arm/conf/EP80219
  projects/vap7/sys/arm/conf/HL200
  projects/vap7/sys/arm/conf/IQ31244
  projects/vap7/sys/arm/conf/KB920X
  projects/vap7/sys/arm/conf/SIMICS
  projects/vap7/sys/arm/conf/SKYEYE
  projects/vap7/sys/conf/files
  projects/vap7/sys/contrib/pf/   (props changed)
  projects/vap7/sys/dev/   (props changed)
  projects/vap7/sys/dev/ath/ath_hal/ar5210/   (props changed)
  projects/vap7/sys/dev/ath/ath_hal/ar5211/   (props changed)
  projects/vap7/sys/dev/ath/ath_hal/ar5212/   (props changed)
  projects/vap7/sys/dev/ath/ath_hal/ar5312/   (props changed)
  projects/vap7/sys/dev/ath/ath_hal/ar5416/   (props changed)
  projects/vap7/sys/dev/cxgb/   (props changed)
  projects/vap7/sys/sparc64/conf/GENERIC
  projects/vap7/sys/sparc64/conf/NOTES
  projects/vap7/sys/sun4v/conf/DEFAULTS
  projects/vap7/sys/sun4v/conf/NOTES

Modified: projects/vap7/sys/arm/conf/AVILA
==============================================================================
--- projects/vap7/sys/arm/conf/AVILA	Sat Jan 10 00:17:03 2009	(r186987)
+++ projects/vap7/sys/arm/conf/AVILA	Sat Jan 10 00:25:40 2009	(r186988)
@@ -80,7 +80,6 @@ options		BOOTP_COMPAT
 #options		PREEMPTION
 #options		VERBOSE_SYSINIT
 
-device		genclock
 device		nexus
 device		mem			# Memory and kernel memory devices
 #device		saarm

Modified: projects/vap7/sys/arm/conf/BWCT
==============================================================================
--- projects/vap7/sys/arm/conf/BWCT	Sat Jan 10 00:17:03 2009	(r186987)
+++ projects/vap7/sys/arm/conf/BWCT	Sat Jan 10 00:25:40 2009	(r186988)
@@ -68,7 +68,6 @@ options 	MUTEX_NOINLINE
 options		RWLOCK_NOINLINE
 options 	NO_FFS_SNAPSHOT
 options 	NO_SWAPPING
-device		genclock
 device		loop
 device		random
 device		ether

Modified: projects/vap7/sys/arm/conf/CRB
==============================================================================
--- projects/vap7/sys/arm/conf/CRB	Sat Jan 10 00:17:03 2009	(r186987)
+++ projects/vap7/sys/arm/conf/CRB	Sat Jan 10 00:25:40 2009	(r186988)
@@ -65,7 +65,6 @@ options		BOOTP_NFSV3
 options		BOOTP_WIRED_TO=em0
 options		BOOTP_COMPAT
 #options		PREEMPTION
-device		genclock
 device		loop
 device		ether
 device		nexus

Modified: projects/vap7/sys/arm/conf/EP80219
==============================================================================
--- projects/vap7/sys/arm/conf/EP80219	Sat Jan 10 00:17:03 2009	(r186987)
+++ projects/vap7/sys/arm/conf/EP80219	Sat Jan 10 00:25:40 2009	(r186988)
@@ -67,7 +67,6 @@ options	BOOTP_NFSV3
 options	BOOTP_WIRED_TO=fxp0
 options	BOOTP_COMPAT
 #options	PREEMPTION
-device		genclock
 device		loop
 device		ether
 device		nexus

Modified: projects/vap7/sys/arm/conf/HL200
==============================================================================
--- projects/vap7/sys/arm/conf/HL200	Sat Jan 10 00:17:03 2009	(r186987)
+++ projects/vap7/sys/arm/conf/HL200	Sat Jan 10 00:25:40 2009	(r186988)
@@ -74,7 +74,6 @@ options 	MUTEX_NOINLINE
 options		RWLOCK_NOINLINE
 options 	NO_FFS_SNAPSHOT
 options 	NO_SWAPPING
-device		genclock
 device		random
 device		pty
 device		loop

Modified: projects/vap7/sys/arm/conf/IQ31244
==============================================================================
--- projects/vap7/sys/arm/conf/IQ31244	Sat Jan 10 00:17:03 2009	(r186987)
+++ projects/vap7/sys/arm/conf/IQ31244	Sat Jan 10 00:25:40 2009	(r186988)
@@ -64,7 +64,6 @@ options		BOOTP_NFSV3
 options		BOOTP_WIRED_TO=em0
 options		BOOTP_COMPAT
 #options		PREEMPTION
-device		genclock
 device		loop
 device		ether
 device		nexus

Modified: projects/vap7/sys/arm/conf/KB920X
==============================================================================
--- projects/vap7/sys/arm/conf/KB920X	Sat Jan 10 00:17:03 2009	(r186987)
+++ projects/vap7/sys/arm/conf/KB920X	Sat Jan 10 00:25:40 2009	(r186988)
@@ -62,7 +62,6 @@ options 	MUTEX_NOINLINE
 options		RWLOCK_NOINLINE
 options 	NO_FFS_SNAPSHOT
 options 	NO_SWAPPING
-device		genclock
 device		random
 device		pty
 device		loop

Modified: projects/vap7/sys/arm/conf/SIMICS
==============================================================================
--- projects/vap7/sys/arm/conf/SIMICS	Sat Jan 10 00:17:03 2009	(r186987)
+++ projects/vap7/sys/arm/conf/SIMICS	Sat Jan 10 00:25:40 2009	(r186988)
@@ -54,7 +54,6 @@ options 	SYSVSHM			#SYSV-style shared me
 options 	SYSVMSG			#SYSV-style message queues
 options 	SYSVSEM			#SYSV-style semaphores
 options 	_KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions
-device		genclock
 device		loop
 device		ether
 device		saip

Modified: projects/vap7/sys/arm/conf/SKYEYE
==============================================================================
--- projects/vap7/sys/arm/conf/SKYEYE	Sat Jan 10 00:17:03 2009	(r186987)
+++ projects/vap7/sys/arm/conf/SKYEYE	Sat Jan 10 00:25:40 2009	(r186988)
@@ -59,7 +59,6 @@ options 	SYSVMSG			#SYSV-style message q
 options 	SYSVSEM			#SYSV-style semaphores
 options 	_KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions
 options 	KBD_INSTALL_CDEV	# install a CDEV entry in /dev
-device		genclock
 device		loop
 device		ether
 device		nexus

Modified: projects/vap7/sys/conf/files
==============================================================================
--- projects/vap7/sys/conf/files	Sat Jan 10 00:17:03 2009	(r186987)
+++ projects/vap7/sys/conf/files	Sat Jan 10 00:25:40 2009	(r186988)
@@ -1711,7 +1711,7 @@ fs/cd9660/cd9660_vfsops.c	optional cd966
 fs/cd9660/cd9660_vnops.c	optional cd9660
 fs/cd9660/cd9660_iconv.c	optional cd9660_iconv
 kern/bus_if.m			standard
-kern/clock_if.m			optional genclock
+kern/clock_if.m			standard
 kern/cpufreq_if.m		standard
 kern/device_if.m		standard
 kern/imgact_elf.c		standard
@@ -1810,7 +1810,7 @@ kern/subr_power.c		standard
 kern/subr_prf.c			standard
 kern/subr_prof.c		standard
 kern/subr_rman.c		standard
-kern/subr_rtc.c			optional genclock
+kern/subr_rtc.c			standard
 kern/subr_sbuf.c		standard
 kern/subr_scanf.c		standard
 kern/kern_sdt.c			optional kdtrace_hooks

Modified: projects/vap7/sys/sparc64/conf/GENERIC
==============================================================================
--- projects/vap7/sys/sparc64/conf/GENERIC	Sat Jan 10 00:17:03 2009	(r186987)
+++ projects/vap7/sys/sparc64/conf/GENERIC	Sat Jan 10 00:25:40 2009	(r186988)
@@ -132,7 +132,6 @@ options 	KBD_INSTALL_CDEV # install a CD
 # Builtin hardware
 device		auxio		# auxiliary I/O device
 device		clkbrd		# Clock Board (blinkenlight on Sun Exx00)
-device		genclock	# Generic clock interface
 device		eeprom		# eeprom (really a front-end for the MK48Txx)
 device		mk48txx		# Mostek MK48Txx clocks
 device		rtc		# rtc (really a front-end for the MC146818)

Modified: projects/vap7/sys/sparc64/conf/NOTES
==============================================================================
--- projects/vap7/sys/sparc64/conf/NOTES	Sat Jan 10 00:17:03 2009	(r186987)
+++ projects/vap7/sys/sparc64/conf/NOTES	Sat Jan 10 00:25:40 2009	(r186988)
@@ -33,7 +33,6 @@ device		fhc
 # Mandatory devices:
 #
 
-device		genclock	# Generic clock interface
 device		eeprom		# eeprom (really a front-end for the MK48Txx)
 device		mk48txx		# Mostek MK48Txx clocks
 device		rtc		# rtc (really a front-end for the MC146818)

Modified: projects/vap7/sys/sun4v/conf/DEFAULTS
==============================================================================
--- projects/vap7/sys/sun4v/conf/DEFAULTS	Sat Jan 10 00:17:03 2009	(r186987)
+++ projects/vap7/sys/sun4v/conf/DEFAULTS	Sat Jan 10 00:25:40 2009	(r186988)
@@ -7,7 +7,6 @@ machine		sun4v
 
 # Pseudo devices.
 device		mem		# Memory and kernel memory devices
-device		genclock	# Generic clock interface
 
 # Default partitioning schemes
 options 	GEOM_BSD

Modified: projects/vap7/sys/sun4v/conf/NOTES
==============================================================================
--- projects/vap7/sys/sun4v/conf/NOTES	Sat Jan 10 00:17:03 2009	(r186987)
+++ projects/vap7/sys/sun4v/conf/NOTES	Sat Jan 10 00:25:40 2009	(r186988)
@@ -33,7 +33,6 @@ device		fhc
 # Mandatory devices:
 #
 
-device		genclock	# Generic clock interface
 #device		eeprom		# eeprom (really a front-end for the MK48Txx)
 device		mk48txx		# Mostek MK48Txx clocks
 #device		rtc		# rtc (really a front-end for the MC146818)

From owner-svn-src-projects@FreeBSD.ORG  Sat Jan 10 00:33:24 2009
Return-Path: <owner-svn-src-projects@FreeBSD.ORG>
Delivered-To: svn-src-projects@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8FFE71065670;
	Sat, 10 Jan 2009 00:33:24 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 7E4DB8FC1E;
	Sat, 10 Jan 2009 00:33:24 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0A0XO71073685;
	Sat, 10 Jan 2009 00:33:24 GMT (envelope-from sam@svn.freebsd.org)
Received: (from sam@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0A0XOY3073682;
	Sat, 10 Jan 2009 00:33:24 GMT (envelope-from sam@svn.freebsd.org)
Message-Id: <200901100033.n0A0XOY3073682@svn.freebsd.org>
From: Sam Leffler <sam@FreeBSD.org>
Date: Sat, 10 Jan 2009 00:33:24 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-projects@freebsd.org
X-SVN-Group: projects
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r186989 - in projects/vap7/tools/tools/nanobsd: .
	Files/root
X-BeenThere: svn-src-projects@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the src &quot; projects&quot;
	tree" <svn-src-projects.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
	<mailto:svn-src-projects-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-projects>
List-Post: <mailto:svn-src-projects@freebsd.org>
List-Help: <mailto:svn-src-projects-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
	<mailto:svn-src-projects-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sat, 10 Jan 2009 00:33:24 -0000

Author: sam
Date: Sat Jan 10 00:33:24 2009
New Revision: 186989
URL: http://svn.freebsd.org/changeset/base/186989

Log:
  sync with head

Added:
  projects/vap7/tools/tools/nanobsd/Files/root/save_cfg
     - copied unchanged from r186962, stable/7/tools/tools/nanobsd/Files/root/save_cfg
Modified:
  projects/vap7/tools/tools/nanobsd/   (props changed)
  projects/vap7/tools/tools/nanobsd/FlashDevice.sub
  projects/vap7/tools/tools/nanobsd/nanobsd.sh

Copied: projects/vap7/tools/tools/nanobsd/Files/root/save_cfg (from r186962, stable/7/tools/tools/nanobsd/Files/root/save_cfg)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/vap7/tools/tools/nanobsd/Files/root/save_cfg	Sat Jan 10 00:33:24 2009	(r186989, copy of r186962, stable/7/tools/tools/nanobsd/Files/root/save_cfg)
@@ -0,0 +1,42 @@
+#!/bin/sh
+#
+# Copyright (c) 2006 Mathieu Arnold
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# $FreeBSD$
+#
+
+set -e
+
+trap "umount /cfg" 1 2 15 EXIT
+mount /cfg
+(
+cd /cfg
+for i in "$@" `find * -type f`
+do
+        cmp -s /etc/$i /cfg/$i || cp -pfv /etc/$i /cfg/$i
+done
+)
+umount /cfg
+trap 1 2 15 EXIT

Modified: projects/vap7/tools/tools/nanobsd/FlashDevice.sub
==============================================================================
--- projects/vap7/tools/tools/nanobsd/FlashDevice.sub	Sat Jan 10 00:25:40 2009	(r186988)
+++ projects/vap7/tools/tools/nanobsd/FlashDevice.sub	Sat Jan 10 00:33:24 2009	(r186989)
@@ -117,7 +117,7 @@ sub_FlashDevice () {
 			NANO_SECTS=63
 			;;
 		4096|4096mb|4g)
-			NANO_MEDIASIZE=`expr 4097802240 / 512`
+			NANO_MEDIASIZE=`expr -e 4097802240 / 512`
 			NANO_HEADS=16
 			NANO_SECTS=63
 			;;
@@ -128,9 +128,9 @@ sub_FlashDevice () {
 		esac
 		;;
 	siliconsystems)
-		case $2 in
+		case $a2 in
 		4096|4g)
-			NANO_MEDIASIZE=`expr 4224761856 / 512`
+			NANO_MEDIASIZE=`expr -e 4224761856 / 512`
 			NANO_HEADS=16
 			NANO_SECTS=63
 			;;
@@ -141,7 +141,7 @@ sub_FlashDevice () {
 		esac
 		;;
 	soekris)
-		case $2 in
+		case $a2 in
 		net4526 | 4526 | net4826 | 4826 | 64 | 64mb)
 			NANO_MEDIASIZE=125056
 			NANO_HEADS=4
@@ -154,7 +154,7 @@ sub_FlashDevice () {
 		esac
 		;;
 	transcend)
-		case $2 in
+		case $a2 in
 		dom064m)
 			NANO_MEDIASIZE=125184
 			NANO_HEADS=4

Modified: projects/vap7/tools/tools/nanobsd/nanobsd.sh
==============================================================================
--- projects/vap7/tools/tools/nanobsd/nanobsd.sh	Sat Jan 10 00:25:40 2009	(r186988)
+++ projects/vap7/tools/tools/nanobsd/nanobsd.sh	Sat Jan 10 00:33:24 2009	(r186989)
@@ -47,15 +47,23 @@ NANO_TOOLS=tools/tools/nanobsd
 
 # Where cust_pkg() finds packages to install
 NANO_PACKAGE_DIR=${NANO_SRC}/${NANO_TOOLS}/Pkg
+NANO_PACKAGE_LIST="*"
 
 # Object tree directory
 # default is subdir of /usr/obj
 # XXX: MAKEOBJDIRPREFIX handling... ?
 #NANO_OBJ=""
 
+# The directory to put the final images
+# default is ${NANO_OBJ}
+#NANO_DISKIMGDIR=""
+
 # Parallel Make
 NANO_PMAKE="make -j 3"
 
+# The default name for any image we create.
+NANO_IMGNAME="_.disk.full"
+
 # Options to put in make.conf during buildworld only
 CONF_BUILD=' '
 
@@ -71,6 +79,9 @@ NANO_KERNEL=GENERIC
 # Customize commands.
 NANO_CUSTOMIZE=""
 
+# Late customize commands.
+NANO_LATE_CUSTOMIZE=""
+
 # Newfs paramters to use
 NANO_NEWFS="-b 4096 -f 512 -i 8192 -O1 -U"
 
@@ -78,7 +89,7 @@ NANO_NEWFS="-b 4096 -f 512 -i 8192 -O1 -
 NANO_DRIVE=ad0
 
 # Target media size in 512 bytes sectors
-NANO_MEDIASIZE=1000000
+NANO_MEDIASIZE=1200000
 
 # Number of code images on media (1 or 2)
 NANO_IMAGES=2
@@ -114,6 +125,13 @@ NANO_HEADS=16
 NANO_BOOT0CFG="-o packet -s 1 -m 3"
 NANO_BOOTLOADER="boot/boot0sio"
 
+# Backing type of md(4) device
+# Can be "file" or "swap"
+NANO_MD_BACKING="file"
+
+# Progress Print level
+PPLEVEL=3
+
 #######################################################################
 # Not a variable at this time
 
@@ -127,7 +145,7 @@ NANO_ARCH=i386
 #######################################################################
 
 clean_build ( ) (
-	echo "## Clean and create object directory (${MAKEOBJDIRPREFIX})"
+	pprint 2 "Clean and create object directory (${MAKEOBJDIRPREFIX})"
 
 	if rm -rf ${MAKEOBJDIRPREFIX} > /dev/null 2>&1 ; then
 		true
@@ -140,24 +158,25 @@ clean_build ( ) (
 )
 
 make_conf_build ( ) (
-	echo "## Construct build make.conf ($NANO_MAKE_CONF)"
+	pprint 2 "Construct build make.conf ($NANO_MAKE_CONF)"
 
 	echo "${CONF_WORLD}" > ${NANO_MAKE_CONF}
 	echo "${CONF_BUILD}" >> ${NANO_MAKE_CONF}
 )
 
 build_world ( ) (
-	echo "## run buildworld"
-	echo "### log: ${MAKEOBJDIRPREFIX}/_.bw"
+	pprint 2 "run buildworld"
+	pprint 3 "log: ${MAKEOBJDIRPREFIX}/_.bw"
 
 	cd ${NANO_SRC}
-	${NANO_PMAKE} __MAKE_CONF=${NANO_MAKE_CONF} buildworld \
+	env TARGET_ARCH=${NANO_ARCH} ${NANO_PMAKE} \
+		__MAKE_CONF=${NANO_MAKE_CONF} buildworld \
 		> ${MAKEOBJDIRPREFIX}/_.bw 2>&1
 )
 
 build_kernel ( ) (
-	echo "## build kernel ($NANO_KERNEL)"
-	echo "### log: ${MAKEOBJDIRPREFIX}/_.bk"
+	pprint 2 "build kernel ($NANO_KERNEL)"
+	pprint 3 "log: ${MAKEOBJDIRPREFIX}/_.bk"
 
 	if [ -f ${NANO_KERNEL} ] ; then
 		cp ${NANO_KERNEL} ${NANO_SRC}/sys/${NANO_ARCH}/conf
@@ -168,14 +187,14 @@ build_kernel ( ) (
 	# when cross-building
 	unset TARGET_CPUTYPE
 	unset TARGET_BIG_ENDIAN
-	${NANO_PMAKE} buildkernel \
+	env TARGET_ARCH=${NANO_ARCH} ${NANO_PMAKE} buildkernel \
 		__MAKE_CONF=${NANO_MAKE_CONF} KERNCONF=`basename ${NANO_KERNEL}` \
 		> ${MAKEOBJDIRPREFIX}/_.bk 2>&1
 	)
 )
 
 clean_world ( ) (
-	echo "## Clean and create world directory (${NANO_WORLDDIR})"
+	pprint 2 "Clean and create world directory (${NANO_WORLDDIR})"
 	if rm -rf ${NANO_WORLDDIR}/ > /dev/null 2>&1 ; then
 		true
 	else
@@ -186,17 +205,18 @@ clean_world ( ) (
 )
 
 make_conf_install ( ) (
-	echo "## Construct install make.conf ($NANO_MAKE_CONF)"
+	pprint 2 "Construct install make.conf ($NANO_MAKE_CONF)"
 
 	echo "${CONF_WORLD}" > ${NANO_MAKE_CONF}
 	echo "${CONF_INSTALL}" >> ${NANO_MAKE_CONF}
 )
 
 install_world ( ) (
-	echo "## installworld"
-	echo "### log: ${MAKEOBJDIRPREFIX}/_.iw"
+	pprint 2 "installworld"
+	pprint 3 "log: ${MAKEOBJDIRPREFIX}/_.iw"
 
 	cd ${NANO_SRC}
+	env TARGET_ARCH=${NANO_ARCH} \
 	${NANO_PMAKE} __MAKE_CONF=${NANO_MAKE_CONF} installworld \
 		DESTDIR=${NANO_WORLDDIR} \
 		> ${MAKEOBJDIRPREFIX}/_.iw 2>&1
@@ -205,21 +225,22 @@ install_world ( ) (
 
 install_etc ( ) (
 
-	echo "## install /etc"
-	echo "### log: ${MAKEOBJDIRPREFIX}/_.etc"
+	pprint 2 "install /etc"
+	pprint 3 "log: ${MAKEOBJDIRPREFIX}/_.etc"
 
 	cd ${NANO_SRC}
+	env TARGET_ARCH=${NANO_ARCH} \
 	${NANO_PMAKE} __MAKE_CONF=${NANO_MAKE_CONF} distribution \
 		DESTDIR=${NANO_WORLDDIR} \
 		> ${MAKEOBJDIRPREFIX}/_.etc 2>&1
 )
 
 install_kernel ( ) (
-	echo "## install kernel"
-	echo "### log: ${MAKEOBJDIRPREFIX}/_.ik"
+	pprint 2 "install kernel"
+	pprint 3 "log: ${MAKEOBJDIRPREFIX}/_.ik"
 
 	cd ${NANO_SRC}
-	${NANO_PMAKE} installkernel \
+	env TARGET_ARCH=${NANO_ARCH} ${NANO_PMAKE} installkernel \
 		DESTDIR=${NANO_WORLDDIR} \
 		__MAKE_CONF=${NANO_MAKE_CONF} KERNCONF=`basename ${NANO_KERNEL}` \
 		> ${MAKEOBJDIRPREFIX}/_.ik 2>&1
@@ -227,19 +248,31 @@ install_kernel ( ) (
 
 run_customize() (
 
-	echo "## run customize scripts"
+	pprint 2 "run customize scripts"
 	for c in $NANO_CUSTOMIZE
 	do
-		echo "## customize \"$c\""
-		echo "### log: ${MAKEOBJDIRPREFIX}/_.cust.$c"
-		echo "### `type $c`"
+		pprint 2 "customize \"$c\""
+		pprint 3 "log: ${MAKEOBJDIRPREFIX}/_.cust.$c"
+		pprint 4 "`type $c`"
 		( $c ) > ${MAKEOBJDIRPREFIX}/_.cust.$c 2>&1
 	done
 )
 
+run_late_customize() (
+
+	pprint 2 "run late customize scripts"
+	for c in $NANO_LATE_CUSTOMIZE
+	do
+		pprint 2 "late customize \"$c\""
+		pprint 3 "log: ${MAKEOBJDIRPREFIX}/_.late_cust.$c"
+		pprint 4 "`type $c`"
+		( $c ) > ${MAKEOBJDIRPREFIX}/_.late_cust.$c 2>&1
+	done
+)
+
 setup_nanobsd ( ) (
-	echo "## configure nanobsd setup"
-	echo "### log: ${MAKEOBJDIRPREFIX}/_.dl"
+	pprint 2 "configure nanobsd setup"
+	pprint 3 "log: ${MAKEOBJDIRPREFIX}/_.dl"
 
 	(
 	cd ${NANO_WORLDDIR}
@@ -249,7 +282,7 @@ setup_nanobsd ( ) (
 	# have hardcoded paths under ${prefix}/etc are not tweakable.
 	if [ -d usr/local/etc ] ; then
 		(
-		mkdir etc/local
+		mkdir -p etc/local
 		cd usr/local/etc
 		find . -print | cpio -dumpl ../../../etc/local
 		cd ..
@@ -283,7 +316,7 @@ setup_nanobsd ( ) (
 )
 
 setup_nanobsd_etc ( ) (
-	echo "## configure nanobsd /etc"
+	pprint 2 "configure nanobsd /etc"
 
 	(
 	cd ${NANO_WORLDDIR}
@@ -314,8 +347,8 @@ prune_usr() (
 )
 
 create_i386_diskimage ( ) (
-	echo "## build diskimage"
-	echo "### log: ${MAKEOBJDIRPREFIX}/_.di"
+	pprint 2 "build diskimage"
+	pprint 3 "log: ${MAKEOBJDIRPREFIX}/_.di"
 
 	(
 	echo $NANO_MEDIASIZE $NANO_IMAGES \
@@ -372,24 +405,34 @@ create_i386_diskimage ( ) (
 		# Data partition (if any) starts at cylinder boundary.
 		if ($7 > 0) {
 			print "p 4 165 " c, dsl * cs
-		} else if ($7 < 0 && $1 > $c) {
-			print "p 4 165 " c, $1 - $c
+		} else if ($7 < 0 && $1 > c) {
+			print "p 4 165 " c, $1 - c
 		} else if ($1 < c) {
 			print "Disk space overcommitted by", \
 			    c - $1, "sectors" > "/dev/stderr"
 			exit 2
 		}
+
+		# Force slice 1 to be marked active. This is necessary
+		# for booting the image from a USB device to work.
+		print "a 1"
 	}
 	' > ${MAKEOBJDIRPREFIX}/_.fdisk
 
-	IMG=${MAKEOBJDIRPREFIX}/_.disk.full
+	IMG=${NANO_DISKIMGDIR}/${NANO_IMGNAME}
 	MNT=${MAKEOBJDIRPREFIX}/_.mnt
 	mkdir -p ${MNT}
 
-	dd if=/dev/zero of=${IMG} bs=${NANO_SECTS}b \
-	    count=`expr ${NANO_MEDIASIZE} / ${NANO_SECTS}`
-
-	MD=`mdconfig -a -t vnode -f ${IMG} -x ${NANO_SECTS} -y ${NANO_HEADS}`
+	if [ "${NANO_MD_BACKING}" = "swap" ] ; then
+		MD=`mdconfig -a -t swap -s ${NANO_MEDIASIZE} -x ${NANO_SECTS} \
+			-y ${NANO_HEADS}`
+	else
+		echo "Creating md backing file..."
+		dd if=/dev/zero of=${IMG} bs=${NANO_SECTS}b \
+			count=`expr ${NANO_MEDIASIZE} / ${NANO_SECTS}`
+		MD=`mdconfig -a -t vnode -f ${IMG} -x ${NANO_SECTS} \
+			-y ${NANO_HEADS}`
+	fi
 
 	trap "df -i ${MNT} ; umount ${MNT} || true ; mdconfig -d -u $MD" 1 2 15 EXIT
 
@@ -405,14 +448,17 @@ create_i386_diskimage ( ) (
 	newfs ${NANO_NEWFS} /dev/${MD}s1a
 	mount /dev/${MD}s1a ${MNT}
 	df -i ${MNT}
+	echo "Copying worlddir..."
 	( cd ${NANO_WORLDDIR} && find . -print | cpio -dump ${MNT} )
 	df -i ${MNT}
+	echo "Generating mtree..."
 	( cd ${MNT} && mtree -c ) > ${MAKEOBJDIRPREFIX}/_.mtree
 	( cd ${MNT} && du -k ) > ${MAKEOBJDIRPREFIX}/_.du
 	umount ${MNT}
 
 	if [ $NANO_IMAGES -gt 1 -a $NANO_INIT_IMG2 -gt 0 ] ; then
 		# Duplicate to second image (if present)
+		echo "Duplicating to second image..."
 		dd if=/dev/${MD}s1 of=/dev/${MD}s2 bs=64k
 		mount /dev/${MD}s2a ${MNT}
 		for f in ${MNT}/etc/fstab ${MNT}/conf/base/etc/fstab
@@ -433,7 +479,13 @@ create_i386_diskimage ( ) (
 		# XXX: fill from where ?
 	fi
 
-	dd if=/dev/${MD}s1 of=${MAKEOBJDIRPREFIX}/_.disk.image bs=64k
+	if [ "${NANO_MD_BACKING}" = "swap" ] ; then
+		echo "Writing out _.disk.full..."
+		dd if=/dev/${MD} of=${IMG} bs=64k
+	fi
+
+	echo "Writing out _.disk.image..."
+	dd if=/dev/${MD}s1 of=${NANO_DISKIMGDIR}/_.disk.image bs=64k
 	mdconfig -d -u $MD
 	) > ${MAKEOBJDIRPREFIX}/_.di 2>&1
 )
@@ -464,13 +516,52 @@ FlashDevice () {
 	sub_FlashDevice $1 $2
 }
 
+#######################################################################
+# USB device geometries
+#
+# Usage:
+#	UsbDevice Generic 1000	# a generic flash key sold as having 1GB
+#
+# This function will set NANO_MEDIASIZE, NANO_HEADS and NANO_SECTS for you.
+#
+# Note that the capacity of a flash key is usually advertised in MB or
+# GB, *not* MiB/GiB. As such, the precise number of cylinders available
+# for C/H/S geometry may vary depending on the actual flash geometry.
+#
+# The following generic device layouts are understood:
+#  generic           An alias for generic-hdd.
+#  generic-hdd       255H 63S/T xxxxC with no MBR restrictions.
+#  generic-fdd       64H 32S/T xxxxC with no MBR restrictions.
+#
+# The generic-hdd device is preferred for flash devices larger than 1GB.
+#
+
+UsbDevice () {
+	a1=`echo $1 | tr '[:upper:]' '[:lower:]'`
+	case $a1 in
+	generic-fdd)
+		NANO_HEADS=64
+		NANO_SECTS=32
+		NANO_MEDIASIZE=$(( $2 * 1000 * 1000 / 512 ))
+		;;
+	generic|generic-hdd)
+		NANO_HEADS=255
+		NANO_SECTS=63
+		NANO_MEDIASIZE=$(( $2 * 1000 * 1000 / 512 ))
+		;;
+	*)
+		echo "Unknown USB flash device"
+		exit 2
+		;;
+	esac
+}
 
 #######################################################################
 # Setup serial console
 
 cust_comconsole () (
 	# Enable getty on console
-	sed -i "" -e /ttyd0/s/off/on/ ${NANO_WORLDDIR}/etc/ttys
+	sed -i "" -e /tty[du]0/s/off/on/ ${NANO_WORLDDIR}/etc/ttys
 
 	# Disable getty on syscons devices
 	sed -i "" -e '/^ttyv[0-8]/s/	on/	off/' ${NANO_WORLDDIR}/etc/ttys
@@ -492,7 +583,7 @@ cust_allow_ssh_root () (
 
 cust_install_files () (
 	cd ${NANO_TOOLS}/Files
-	find . -print | grep -v /CVS | cpio -dumpv ${NANO_WORLDDIR}
+	find . -print | grep -Ev '/(CVS|\.svn)' | cpio -dumpv ${NANO_WORLDDIR}
 )
 
 #######################################################################
@@ -502,7 +593,11 @@ cust_pkg () (
 
 	# Copy packages into chroot
 	mkdir -p ${NANO_WORLDDIR}/Pkg
-	cp ${NANO_PACKAGE_DIR}/* ${NANO_WORLDDIR}/Pkg
+	(
+		cd ${NANO_PACKAGE_DIR}
+		find ${NANO_PACKAGE_LIST} -print |
+		    cpio -dumpv ${NANO_WORLDDIR}/Pkg
+	)
 
 	# Count & report how many we have to install
 	todo=`ls ${NANO_WORLDDIR}/Pkg | wc -l`
@@ -511,7 +606,7 @@ cust_pkg () (
 	echo "==="
 	while true
 	do
-		# Record how may we have now
+		# Record how many we have now
 		have=`ls ${NANO_WORLDDIR}/var/db/pkg | wc -l`
 
 		# Attempt to install more packages
@@ -547,16 +642,37 @@ customize_cmd () {
 }
 
 #######################################################################
+# Convenience function:
+# 	Register $1 as late customize function to run just before
+#	image creation.
+
+late_customize_cmd () {
+	NANO_LATE_CUSTOMIZE="$NANO_LATE_CUSTOMIZE $1"
+}
+
+#######################################################################
 #
 # All set up to go...
 #
 #######################################################################
 
+# Progress Print
+#	Print $2 at level $1.
+pprint() {
+    if [ "$1" -le $PPLEVEL ]; then
+	printf "%.${1}s %s\n" "#####" "$2"
+    fi
+}
+
 usage () {
 	(
-	echo "Usage: $0 [-b/-k/-w] [-c config_file]"
+	echo "Usage: $0 [-bikqvw] [-c config_file]"
 	echo "	-b	suppress builds (both kernel and world)"
+	echo "	-i	suppress disk image build"
 	echo "	-k	suppress buildkernel"
+	echo "	-n	add -DNO_CLEAN to buildworld, buildkernel, etc"
+	echo "	-q	make output more quite"
+	echo "	-v	make output more verbose"
 	echo "	-w	suppress buildworld"
 	echo "	-c	specify config file"
 	) 1>&2
@@ -566,11 +682,13 @@ usage () {
 #######################################################################
 # Parse arguments
 
+do_clean=true
 do_kernel=true
 do_world=true
+do_image=true
 
 set +e
-args=`getopt bc:hkw $*`
+args=`getopt bc:hiknqvw $*`
 if [ $? -ne 0 ] ; then
 	usage
 	exit 2
@@ -583,29 +701,45 @@ do
 	case "$i" 
 	in
 	-b)
-		shift;
 		do_world=false
 		do_kernel=false
+		shift
 		;;
 	-k)
-		shift;
 		do_kernel=false
+		shift
 		;;
 	-c)
 		. "$2"
-		shift;
-		shift;
+		shift
+		shift
 		;;
 	-h)
 		usage
 		;;
+	-i)
+		do_image=false
+		shift
+		;;
+	-n)
+		do_clean=false
+		shift
+		;;
+	-q)
+		PPLEVEL=$(($PPLEVEL - 1))
+		shift
+		;;
+	-v)
+		PPLEVEL=$(($PPLEVEL + 1))
+		shift
+		;;
 	-w)
-		shift;
 		do_world=false
+		shift
 		;;
 	--)
-		shift;
-		break;
+		shift
+		break
 	esac
 done
 
@@ -624,6 +758,10 @@ else
 	MAKEOBJDIRPREFIX=${NANO_OBJ}
 fi
 
+if [ "x${NANO_DISKIMGDIR}" = "x" ] ; then
+	NANO_DISKIMGDIR=${MAKEOBJDIRPREFIX}
+fi
+
 NANO_WORLDDIR=${MAKEOBJDIRPREFIX}/_.w
 NANO_MAKE_CONF=${MAKEOBJDIRPREFIX}/make.conf
 
@@ -636,6 +774,12 @@ else
 	exit 1
 fi
 
+if $do_clean ; then
+	true
+else
+	NANO_PMAKE="${NANO_PMAKE} -DNO_CLEAN"
+fi
+
 export MAKEOBJDIRPREFIX
 
 export NANO_ARCH
@@ -646,6 +790,7 @@ export NANO_DATASIZE
 export NANO_DRIVE
 export NANO_HEADS
 export NANO_IMAGES
+export NANO_IMGNAME
 export NANO_MAKE_CONF
 export NANO_MEDIASIZE
 export NANO_NAME
@@ -662,18 +807,24 @@ export NANO_BOOTLOADER
 #######################################################################
 # And then it is as simple as that...
 
+pprint 1 "NanoBSD image ${NANO_NAME} build starting"
+
 if $do_world ; then
-	clean_build
+	if $do_clean ; then
+		clean_build
+	else
+		pprint 2 "Using existing build tree (as instructed)"
+	fi
 	make_conf_build
 	build_world
 else
-	echo "## Skipping buildworld (as instructed)"
+	pprint 2 "Skipping buildworld (as instructed)"
 fi
 
 if $do_kernel ; then
 	build_kernel
 else
-	echo "## Skipping buildkernel (as instructed)"
+	pprint 2 "Skipping buildkernel (as instructed)"
 fi
 
 clean_world
@@ -686,7 +837,13 @@ install_kernel
 run_customize
 setup_nanobsd
 prune_usr
-create_${NANO_ARCH}_diskimage
+run_late_customize
+if $do_image ; then
+	create_${NANO_ARCH}_diskimage
+	echo "# Created NanoBSD disk image: ${MAKEOBJDIRPREFIX}/${NANO_IMGNAME}"
+else
+	pprint 2 "Skipping image build (as instructed)"
+fi
 last_orders
 
-echo "# NanoBSD image completed"
+pprint 1 "NanoBSD image ${NANO_NAME} completed"

From owner-svn-src-projects@FreeBSD.ORG  Sat Jan 10 00:36:59 2009
Return-Path: <owner-svn-src-projects@FreeBSD.ORG>
Delivered-To: svn-src-projects@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 34CBB1065673;
	Sat, 10 Jan 2009 00:36:59 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 203DF8FC08;
	Sat, 10 Jan 2009 00:36:59 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0A0axhC073867;
	Sat, 10 Jan 2009 00:36:59 GMT (envelope-from sam@svn.freebsd.org)
Received: (from sam@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0A0avLt073829;
	Sat, 10 Jan 2009 00:36:57 GMT (envelope-from sam@svn.freebsd.org)
Message-Id: <200901100036.n0A0avLt073829@svn.freebsd.org>
From: Sam Leffler <sam@FreeBSD.org>
Date: Sat, 10 Jan 2009 00:36:57 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-projects@freebsd.org
X-SVN-Group: projects
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r186990 - in projects/vap7: etc etc/periodic/daily
	etc/periodic/monthly etc/periodic/security
	etc/periodic/weekly gnu gnu/usr.bin lib sbin share
	tools/build tools/build/options usr.bin ...
X-BeenThere: svn-src-projects@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the src &quot; projects&quot;
	tree" <svn-src-projects.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
	<mailto:svn-src-projects-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-projects>
List-Post: <mailto:svn-src-projects@freebsd.org>
List-Help: <mailto:svn-src-projects-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
	<mailto:svn-src-projects-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sat, 10 Jan 2009 00:36:59 -0000

Author: sam
Date: Sat Jan 10 00:36:57 2009
New Revision: 186990
URL: http://svn.freebsd.org/changeset/base/186990

Log:
  merge nanobsd build infrastructure changes from head

Added:
  projects/vap7/tools/build/options/WITHOUT_ACCT
     - copied unchanged from r183242, head/tools/build/options/WITHOUT_ACCT
  projects/vap7/tools/build/options/WITHOUT_AMD
     - copied unchanged from r183242, head/tools/build/options/WITHOUT_AMD
  projects/vap7/tools/build/options/WITHOUT_APM
     - copied unchanged from r183242, head/tools/build/options/WITHOUT_APM
  projects/vap7/tools/build/options/WITHOUT_AT
     - copied unchanged from r183242, head/tools/build/options/WITHOUT_AT
  projects/vap7/tools/build/options/WITHOUT_CTM
     - copied unchanged from r183242, head/tools/build/options/WITHOUT_CTM
  projects/vap7/tools/build/options/WITHOUT_FREEBSD_UPDATE
     - copied unchanged from r183242, head/tools/build/options/WITHOUT_FREEBSD_UPDATE
  projects/vap7/tools/build/options/WITHOUT_IPFW
     - copied unchanged from r183242, head/tools/build/options/WITHOUT_IPFW
  projects/vap7/tools/build/options/WITHOUT_JAIL
     - copied unchanged from r183242, head/tools/build/options/WITHOUT_JAIL
  projects/vap7/tools/build/options/WITHOUT_LEGACY_CONSOLE
     - copied unchanged from r183242, head/tools/build/options/WITHOUT_LEGACY_CONSOLE
  projects/vap7/tools/build/options/WITHOUT_LOCATE
     - copied unchanged from r183242, head/tools/build/options/WITHOUT_LOCATE
  projects/vap7/tools/build/options/WITHOUT_MAIL
     - copied unchanged from r183242, head/tools/build/options/WITHOUT_MAIL
  projects/vap7/tools/build/options/WITHOUT_MAKE
     - copied unchanged from r183242, head/tools/build/options/WITHOUT_MAKE
  projects/vap7/tools/build/options/WITHOUT_NDIS
     - copied unchanged from r183242, head/tools/build/options/WITHOUT_NDIS
  projects/vap7/tools/build/options/WITHOUT_NETGRAPH
     - copied unchanged from r183242, head/tools/build/options/WITHOUT_NETGRAPH
  projects/vap7/tools/build/options/WITHOUT_NTP
     - copied unchanged from r183242, head/tools/build/options/WITHOUT_NTP
  projects/vap7/tools/build/options/WITHOUT_PKGTOOLS
     - copied unchanged from r183242, head/tools/build/options/WITHOUT_PKGTOOLS
  projects/vap7/tools/build/options/WITHOUT_PMC
     - copied unchanged from r183242, head/tools/build/options/WITHOUT_PMC
  projects/vap7/tools/build/options/WITHOUT_PORTSNAP
     - copied unchanged from r183242, head/tools/build/options/WITHOUT_PORTSNAP
  projects/vap7/tools/build/options/WITHOUT_PPP
     - copied unchanged from r183242, head/tools/build/options/WITHOUT_PPP
  projects/vap7/tools/build/options/WITHOUT_QUOTAS
     - copied unchanged from r183242, head/tools/build/options/WITHOUT_QUOTAS
  projects/vap7/tools/build/options/WITHOUT_ROUTED
     - copied unchanged from r183242, head/tools/build/options/WITHOUT_ROUTED
  projects/vap7/tools/build/options/WITHOUT_SLIP
     - copied unchanged from r183242, head/tools/build/options/WITHOUT_SLIP
  projects/vap7/tools/build/options/WITHOUT_SYSINSTALL
     - copied unchanged from r183242, head/tools/build/options/WITHOUT_SYSINSTALL
  projects/vap7/tools/build/options/WITHOUT_TELNET
     - copied unchanged from r183242, head/tools/build/options/WITHOUT_TELNET
  projects/vap7/tools/build/options/WITHOUT_TEXTPROC
     - copied unchanged from r183242, head/tools/build/options/WITHOUT_TEXTPROC
  projects/vap7/tools/build/options/WITHOUT_WIRELESS
     - copied unchanged from r183242, head/tools/build/options/WITHOUT_WIRELESS
Modified:
  projects/vap7/etc/   (props changed)
  projects/vap7/etc/Makefile
  projects/vap7/etc/periodic/daily/Makefile
  projects/vap7/etc/periodic/monthly/Makefile
  projects/vap7/etc/periodic/security/Makefile
  projects/vap7/etc/periodic/weekly/Makefile
  projects/vap7/gnu/   (props changed)
  projects/vap7/gnu/usr.bin/Makefile
  projects/vap7/lib/   (props changed)
  projects/vap7/lib/Makefile
  projects/vap7/sbin/   (props changed)
  projects/vap7/sbin/Makefile
  projects/vap7/share/   (props changed)
  projects/vap7/share/Makefile
  projects/vap7/tools/build/   (props changed)
  projects/vap7/usr.bin/   (props changed)
  projects/vap7/usr.bin/Makefile
  projects/vap7/usr.bin/netstat/   (props changed)
  projects/vap7/usr.bin/netstat/Makefile
  projects/vap7/usr.bin/netstat/main.c
  projects/vap7/usr.bin/netstat/netstat.h
  projects/vap7/usr.sbin/   (props changed)
  projects/vap7/usr.sbin/Makefile

Modified: projects/vap7/etc/Makefile
==============================================================================
--- projects/vap7/etc/Makefile	Sat Jan 10 00:33:24 2009	(r186989)
+++ projects/vap7/etc/Makefile	Sat Jan 10 00:36:57 2009	(r186990)
@@ -7,22 +7,19 @@
 SUBDIR=	sendmail
 .endif
 
-BIN1=	amd.map apmd.conf auth.conf \
-	crontab csh.cshrc csh.login csh.logout devd.conf devfs.conf \
-	ddb.conf dhclient.conf disktab fbtab freebsd-update.conf \
+BIN1=	auth.conf \
+	crontab devd.conf devfs.conf \
+	ddb.conf dhclient.conf disktab fbtab \
 	ftpusers gettytab group \
-	hosts hosts.allow hosts.equiv hosts.lpd \
+	hosts hosts.allow hosts.equiv \
 	inetd.conf libalias.conf login.access login.conf mac.conf motd \
 	netconfig network.subr networks newsyslog.conf nsswitch.conf \
-	portsnap.conf pf.os phones profile protocols \
+	phones profile protocols \
 	rc rc.bsdextended rc.firewall rc.firewall6 rc.initdiskless \
 	rc.sendmail rc.shutdown \
-	rc.subr regdomain.xml remote rpc services shells \
-	snmpd.config sysctl.conf syslog.conf \
-	etc.${MACHINE_ARCH}/ttys \
-	${.CURDIR}/../gnu/usr.bin/man/manpath/manpath.config \
-	${.CURDIR}/../usr.bin/mail/misc/mail.rc \
-	${.CURDIR}/../usr.bin/locate/locate/locate.rc
+	rc.subr remote rpc services shells \
+	sysctl.conf syslog.conf \
+	etc.${MACHINE_ARCH}/ttys
 
 OPENBSMDIR=			${.CURDIR}/../contrib/openbsm
 BSM_ETC_OPEN_FILES=		${OPENBSMDIR}/etc/audit_class \
@@ -32,12 +29,38 @@ BSM_ETC_RESTRICTED_FILES=	${OPENBSMDIR}/
 BSM_ETC_EXEC_FILES=		${OPENBSMDIR}/etc/audit_warn
 BSM_ETC_DIR=			${DESTDIR}/etc/security
 
+# NB: keep these sorted by MK_* knobs
+
+.if ${MK_AMD} != "no"
+BIN1+= amd.map
+.endif
+
+.if ${MK_APM} != "no"
+BIN1+= apmd.conf
+.endif
+
+.if ${MK_BSNMP} != "no"
+BIN1+= snmpd.config
+.endif
+
+.if ${MK_FREEBSD_UPDATE} != "no"
+BIN1+= freebsd-update.conf
+.endif
+
+.if ${MK_LOCATE} != "no"
+BIN1+=	${.CURDIR}/../usr.bin/locate/locate/locate.rc
+.endif
+
 .if ${MK_LPR} != "no"
-BIN1+=	printcap
+BIN1+=	hosts.lpd printcap
 .endif
 
-.if ${MK_NS_CACHING} != "no"
-BIN1+= nscd.conf
+.if ${MK_MAIL} != "no"
+BIN1+=	${.CURDIR}/../usr.bin/mail/misc/mail.rc
+.endif
+
+.if ${MK_MAN} != "no"
+BIN1+=	${.CURDIR}/../gnu/usr.bin/man/manpath/manpath.config
 .endif
 
 .if ${MK_OPENSSH} != "no"
@@ -49,6 +72,22 @@ SSH=	${.CURDIR}/../crypto/openssh/ssh_co
 SSL=	${.CURDIR}/../crypto/openssl/apps/openssl.cnf
 .endif
 
+.if ${MK_NS_CACHING} != "no"
+BIN1+= nscd.conf
+.endif
+
+.if ${MK_PORTSNAP} != "no"
+BIN1+= portsnap.conf
+.endif
+
+.if ${MK_PF} != "no"
+BIN1+= pf.os
+.endif
+
+.if ${MK_TCSH} != "no"
+BIN1+= csh.cshrc csh.login csh.logout
+.endif
+
 .if ${MK_WIRELESS} != "no"
 BIN1+= regdomain.xml
 .endif
@@ -113,10 +152,15 @@ distribution:
 	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 755 \
 		${BIN2} ${DESTDIR}/etc; \
 	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
-		master.passwd nsmb.conf opieaccess ${DESTDIR}/etc; \
-	    pwd_mkdb ${PWD_MKDB_ENDIAN} -i -p -d ${DESTDIR}/etc \
-		${DESTDIR}/etc/master.passwd
+		master.passwd nsmb.conf opieaccess ${DESTDIR}/etc;
+.if ${MK_TCSH} == "no"
+	sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd
+.endif
+	pwd_mkdb ${PWD_MKDB_ENDIAN} -i -p -d ${DESTDIR}/etc \
+	    ${DESTDIR}/etc/master.passwd
+.if ${MK_BLUETOOTH} != "no"
 	${_+_}cd ${.CURDIR}/bluetooth; ${MAKE} install
+.endif
 	${_+_}cd ${.CURDIR}/defaults; ${MAKE} install
 	${_+_}cd ${.CURDIR}/gss; ${MAKE} install
 	${_+_}cd ${.CURDIR}/periodic; ${MAKE} install
@@ -161,18 +205,25 @@ distribution:
 .endif
 	cd ${.CURDIR}/root; \
 	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
+		dot.profile ${DESTDIR}/root/.profile; \
+	    rm -f ${DESTDIR}/.profile; \
+	    ln ${DESTDIR}/root/.profile ${DESTDIR}/.profile
+.if ${MK_TCSH} != "no"
+	cd ${.CURDIR}/root; \
+	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
 		dot.cshrc ${DESTDIR}/root/.cshrc; \
 	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
 		dot.login ${DESTDIR}/root/.login; \
-	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
-		dot.profile ${DESTDIR}/root/.profile; \
-	    rm -f ${DESTDIR}/.cshrc ${DESTDIR}/.profile; \
-	    ln ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc; \
-	    ln ${DESTDIR}/root/.profile ${DESTDIR}/.profile
+	    rm -f ${DESTDIR}/.cshrc; \
+	    ln ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc
+.endif
 	cd ${.CURDIR}/mtree; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
 	    ${MTREE} ${DESTDIR}/etc/mtree
+.if ${MK_PPP} != "no"
 	cd ${.CURDIR}/ppp; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
 	    ${PPPCNF} ${DESTDIR}/etc/ppp
+.endif
+.if ${MK_MAIL} != "no"
 	cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
 	    ${ETCMAIL} ${DESTDIR}/etc/mail
 	@if [ -d ${DESTDIR}/etc/mail -a -f ${DESTDIR}/etc/mail/aliases -a \
@@ -180,6 +231,7 @@ distribution:
 		set -x; \
 		ln -s mail/aliases ${DESTDIR}/etc/aliases; \
 	fi
+.endif
 	${INSTALL} -o ${BINOWN} -g operator -m 664 /dev/null \
 	    ${DESTDIR}/etc/dumpdates
 	${INSTALL} -o nobody -g ${BINGRP} -m 644 /dev/null \

Modified: projects/vap7/etc/periodic/daily/Makefile
==============================================================================
--- projects/vap7/etc/periodic/daily/Makefile	Sat Jan 10 00:33:24 2009	(r186989)
+++ projects/vap7/etc/periodic/daily/Makefile	Sat Jan 10 00:36:57 2009	(r186990)
@@ -1,15 +1,11 @@
 # $FreeBSD$
 
+.include <bsd.own.mk>
+
 FILES=	100.clean-disks \
 	110.clean-tmps \
 	120.clean-preserve \
-	130.clean-msgs \
-	140.clean-rwho \
-	150.clean-hoststat \
 	200.backup-passwd \
-	210.backup-aliases \
-	300.calendar \
-	310.accounting \
 	330.news \
 	400.status-disks \
 	404.status-zfs \
@@ -19,13 +15,42 @@ FILES=	100.clean-disks \
 	408.status-gstripe \
 	409.status-gconcat \
 	420.status-network \
-	430.status-rwho \
-	440.status-mailq \
 	450.status-security \
-	460.status-mail-rejects \
-	470.status-named \
-	480.status-ntpd \
-	500.queuerun \
 	999.local
 
+# NB: keep these sorted by MK_* knobs
+
+.if ${MK_ACCT} != "no"
+FILES+=	310.accounting
+.endif
+
+.if ${MK_BIND_NAMED} != "no"
+FILES+=	470.status-named
+.endif
+
+.if ${MK_CALENDAR} != "no"
+FILES+=	300.calendar
+.endif
+
+.if ${MK_MAIL} != "no"
+FILES+=	130.clean-msgs
+.endif
+
+.if ${MK_NTP} != "no"
+FILES+=	480.status-ntpd
+.endif
+
+.if ${MK_RCMDS} != "no"
+FILES+=	140.clean-rwho \
+	430.status-rwho
+.endif
+
+.if ${MK_SENDMAIL} != "no"
+FILES+=	150.clean-hoststat \
+	210.backup-aliases \
+	440.status-mailq \
+	460.status-mail-rejects \
+	500.queuerun
+.endif
+
 .include <bsd.prog.mk>

Modified: projects/vap7/etc/periodic/monthly/Makefile
==============================================================================
--- projects/vap7/etc/periodic/monthly/Makefile	Sat Jan 10 00:33:24 2009	(r186989)
+++ projects/vap7/etc/periodic/monthly/Makefile	Sat Jan 10 00:36:57 2009	(r186990)
@@ -1,6 +1,13 @@
 # $FreeBSD$
 
-FILES=	200.accounting \
-	999.local
+.include <bsd.own.mk>
+
+FILES=	999.local
+
+# NB: keep these sorted by MK_* knobs
+
+.if ${MK_ACCT} != "no"
+FILES+=	200.accounting
+.endif
 
 .include <bsd.prog.mk>

Modified: projects/vap7/etc/periodic/security/Makefile
==============================================================================
--- projects/vap7/etc/periodic/security/Makefile	Sat Jan 10 00:33:24 2009	(r186989)
+++ projects/vap7/etc/periodic/security/Makefile	Sat Jan 10 00:36:57 2009	(r186990)
@@ -1,17 +1,30 @@
 # $FreeBSD$
 
+.include <bsd.own.mk>
+
 FILES=	100.chksetuid \
 	200.chkmounts \
 	300.chkuid0 \
 	400.passwdless \
 	410.logincheck \
-	500.ipfwdenied \
-	510.ipfdenied \
-	520.pfdenied \
-	550.ipfwlimit \
 	700.kernelmsg \
 	800.loginfail \
 	900.tcpwrap \
 	security.functions
 
+# NB: keep these sorted by MK_* knobs
+
+.if ${MK_IPFILTER} != "no"
+FILES+=	510.ipfdenied
+.endif
+
+.if ${MK_IPFW} != "no"
+FILES+=	500.ipfwdenied \
+	550.ipfwlimit
+.endif
+
+.if ${MK_PF} != "no"
+FILES+=	520.pfdenied
+.endif
+
 .include <bsd.prog.mk>

Modified: projects/vap7/etc/periodic/weekly/Makefile
==============================================================================
--- projects/vap7/etc/periodic/weekly/Makefile	Sat Jan 10 00:33:24 2009	(r186989)
+++ projects/vap7/etc/periodic/weekly/Makefile	Sat Jan 10 00:36:57 2009	(r186990)
@@ -1,10 +1,22 @@
 # $FreeBSD$
 
-FILES=	310.locate \
-	320.whatis \
-	330.catman \
-	340.noid \
-	400.status-pkg \
+.include <bsd.own.mk>
+
+FILES=	340.noid \
 	999.local
 
+# NB: keep these sorted by MK_* knobs
+
+.if ${MK_LOCATE} != "no"
+FILES+=	310.locate
+.endif
+
+.if ${MK_MAN} != "no"
+FILES+=	320.whatis 330.catman
+.endif
+
+.if ${MK_PKGTOOLS} != "no"
+FLES+=	400.status-pkg
+.endif
+
 .include <bsd.prog.mk>

Modified: projects/vap7/gnu/usr.bin/Makefile
==============================================================================
--- projects/vap7/gnu/usr.bin/Makefile	Sat Jan 10 00:33:24 2009	(r186989)
+++ projects/vap7/gnu/usr.bin/Makefile	Sat Jan 10 00:36:57 2009	(r186990)
@@ -34,12 +34,16 @@ _groff=		groff
 _cvs=		cvs
 .endif
 
+.if ${MK_INFO} != "no"
+_texinfo=	texinfo
+.endif
+
 .if ${MK_MAN} != "no"
 _man=		man
 .endif
 
-.if ${MK_INFO} != "no"
-_texinfo=	texinfo
+.if ${MK_RCS} != "no"
+_rcs=		rcs
 .endif
 
 .if ${MK_TOOLCHAIN} != "no"
@@ -49,8 +53,5 @@ _cc=		cc
 _gdb=		gdb
 .endif
 .endif
-.if ${MK_RCS} != "no"
-_rcs=		rcs
-.endif
 
 .include <bsd.subdir.mk>

Modified: projects/vap7/lib/Makefile
==============================================================================
--- projects/vap7/lib/Makefile	Sat Jan 10 00:33:24 2009	(r186989)
+++ projects/vap7/lib/Makefile	Sat Jan 10 00:36:57 2009	(r186990)
@@ -26,17 +26,17 @@
 # Otherwise, the SUBDIR list should be in alphabetical order.
 
 SUBDIR=	${_csu} libc libbsm libcom_err libcrypt libelf libkvm msun libmd \
-	ncurses libnetgraph libradius librpcsvc libsbuf libtacplus libutil \
-	${_libypclnt} libalias libarchive ${_libatm} \
-	libbegemot ${_libbluetooth} libbsnmp libbz2 \
+	ncurses ${_libnetgraph} libradius librpcsvc libsbuf \
+	libtacplus libutil ${_libypclnt} libalias libarchive ${_libatm} \
+	libbegemot ${_libbluetooth} ${_libbsnmp} libbz2 \
 	libcalendar libcam libcompat libdevinfo libdevstat libdisk \
 	libdwarf libedit libexpat libfetch libftpio libgeom ${_libgpib} \
 	${_libgssapi} libipsec \
 	${_libipx} libkiconv libmagic libmemstat ${_libmilter} ${_libmp} \
 	${_libncp} ${_libngatm} libopie libpam libpcap \
-	libpmc libproc ${_libkse} librt ${_libsdp} ${_libsm} ${_libsmb} \
+	${_libpmc} libproc ${_libkse} librt ${_libsdp} ${_libsm} ${_libsmb} \
 	${_libsmdb} \
-	${_libsmutil} libstand libtelnet ${_libthr} libthread_db libufs \
+	${_libsmutil} libstand ${_libtelnet} ${_libthr} libthread_db libufs \
 	libugidfw ${_libusbhid} ${_libusb20} ${_libvgl} libwrap liby libz \
 	${_bind}
 
@@ -48,6 +48,8 @@ _csu=csu/${MACHINE_ARCH}
 _csu=csu
 .endif
 
+# NB: keep these sorted by MK_* knobs
+
 .if ${MK_ATM} != "no"
 _libngatm=	libngatm
 .endif
@@ -61,6 +63,14 @@ _libbluetooth=	libbluetooth
 _libsdp=	libsdp
 .endif
 
+.if ${MK_BSNMP} != "no"
+_libbsnmp=	libbsnmp
+.endif
+
+.if ${MK_GPIB} != "no"
+_libgpib=	libgpib
+.endif
+
 .if ${MK_GSSAPI} != "no"
 _libgssapi=	libgssapi
 .endif
@@ -69,6 +79,22 @@ _libgssapi=	libgssapi
 _libipx=	libipx
 .endif
 
+.if ${MK_LIBKSE} != "no"
+_libkse=	libkse
+.endif
+
+.if ${MK_LIBTHR} != "no"
+_libthr=	libthr
+.endif
+
+.if ${MK_NETGRAPH} != "no"
+_libnetgraph=	libnetgraph
+.endif
+
+.if ${MK_NIS} != "no"
+_libypclnt=	libypclnt
+.endif
+
 .if ${MACHINE_ARCH} == "i386"
 .if ${MK_NCP} != "no"
 _libncp=	libncp
@@ -81,17 +107,6 @@ _libvgl=	libvgl
 _libsmb=	libsmb
 .endif
 
-.if ${MK_SENDMAIL} != "no"
-_libmilter=	libmilter
-_libsm=		libsm
-_libsmdb=	libsmdb
-_libsmutil=	libsmutil
-.endif
-
-.if ${MK_OPENSSL} != "no"
-_libmp=		libmp
-.endif
-
 .if ${MACHINE_ARCH} == "amd64"
 .if ${MK_NCP} != "no"
 _libncp=	libncp
@@ -103,25 +118,28 @@ _libsmb=	libsmb
 _libsmb=	libsmb
 .endif
 
-.if ${MK_LIBKSE} != "no"
-_libkse=	libkse
+.if ${MK_OPENSSL} != "no"
+_libmp=		libmp
 .endif
 
-.if ${MK_LIBTHR} != "no"
-_libthr=	libthr
+.if ${MK_PMC} != "no"
+_libpmc=	libpmc
+_libusb20=	libusb20
 .endif
 
-.if ${MK_USB} != "no"
-_libusbhid=	libusbhid
-_libusb20=	libusb20
+.if ${MK_SENDMAIL} != "no"
+_libmilter=	libmilter
+_libsm=		libsm
+_libsmdb=	libsmdb
+_libsmutil=	libsmutil
 .endif
 
-.if ${MK_NIS} != "no"
-_libypclnt=	libypclnt
+.if ${MK_TELNET} != "no"
+_libtelnet=	libtelnet
 .endif
 
-.if ${MK_GPIB} != "no"
-_libgpib=	libgpib
+.if ${MK_USB} != "no"
+_libusbhid=	libusbhid
 .endif
 
 .include <bsd.subdir.mk>

Modified: projects/vap7/sbin/Makefile
==============================================================================
--- projects/vap7/sbin/Makefile	Sat Jan 10 00:33:24 2009	(r186989)
+++ projects/vap7/sbin/Makefile	Sat Jan 10 00:36:57 2009	(r186990)
@@ -41,7 +41,7 @@ SUBDIR=	adjkerntz \
 	ifconfig \
 	init \
 	${_ipf} \
-	ipfw \
+	${_ipfw} \
 	iscontrol \
 	kldconfig \
 	kldload \
@@ -62,7 +62,7 @@ SUBDIR=	adjkerntz \
 	mount_nullfs \
 	mount_udf \
 	mount_unionfs \
-	natd \
+	${_natd} \
 	newfs \
 	newfs_msdos \
 	nfsiod \
@@ -71,13 +71,13 @@ SUBDIR=	adjkerntz \
 	${_pflogd} \
 	ping \
 	${_ping6} \
-	quotacheck \
+	${_quotacheck} \
 	rcorder \
 	reboot \
 	recoverdisk \
 	restore \
 	route \
-	routed \
+	${_routed} \
 	${_rtsol} \
 	savecore \
 	${_sconfig} \
@@ -85,7 +85,7 @@ SUBDIR=	adjkerntz \
 	shutdown \
 	slattach \
 	spppcontrol \
-	startslip \
+	${_startslip} \
 	sunlabel \
 	swapon \
 	sysctl \
@@ -104,6 +104,11 @@ _devd=		devd
 _ipf=		ipf
 .endif
 
+.if ${MK_IPFW} != "no"
+_ipfw=		ipfw
+_natd=		natd
+.endif
+
 .if ${MK_PF} != "no"
 _pfctl=		pfctl
 _pflogd=	pflogd
@@ -114,6 +119,18 @@ _ping6=		ping6
 _rtsol=		rtsol
 .endif
 
+.if ${MK_QUOTAS} != "no"
+_quotacheck=	quotacheck
+.endif
+
+.if ${MK_ROUTED} != "no"
+_routed=	routed
+.endif
+
+.if ${MK_SLIP} != "no"
+_startslip=	startslip
+.endif
+
 .if ${MACHINE_ARCH} == "i386"
 .if ${MACHINE} == "i386"
 _fdisk=		fdisk

Modified: projects/vap7/share/Makefile
==============================================================================
--- projects/vap7/share/Makefile	Sat Jan 10 00:33:24 2009	(r186989)
+++ projects/vap7/share/Makefile	Sat Jan 10 00:36:57 2009	(r186990)
@@ -13,51 +13,57 @@ SUBDIR=	${_colldef} \
 	${_man} \
 	${_me} \
 	misc \
-	mk \
+	${_mk} \
 	${_mklocale} \
 	${_monetdef} \
 	${_msgdef} \
 	${_numericdef} \
 	${_sendmail} \
 	skel \
-	snmp \
+	${_snmp} \
 	${_syscons} \
 	tabset \
 	termcap \
 	${_timedef} \
 	${_zoneinfo}
 
-.if ${MK_LOCALES} != "no"
-_colldef =	colldef
-_mklocale =	mklocale
-_monetdef =	monetdef
-_msgdef =	msgdef
-_numericdef =	numericdef
-_timedef =	timedef
+# NB: keep these sorted by MK_* knobs
+
+.if ${MK_BSNMP} != "no"
+_snmp=		snmp
 .endif
 
-.if ${MK_SYSCONS} != "no"
-_syscons=	syscons
+.if ${MK_DICT} != "no"
+_dict=	 	dict
 .endif
 
-.if ${MK_MAN} != "no"
-_man=		man
+.if ${MK_EXAMPLES} != "no"
+_examples=	examples
 .endif
 
 .if ${MK_GROFF} != "no"
 _me=		me
 .endif
 
-.if ${MK_EXAMPLES} != "no"
-_examples=	examples
-.endif
-
 .if ${MK_I4B} != "no"
 _isdn=		isdn
 .endif
 
-.if ${MK_DICT} != "no"
-_dict=	 	dict
+.if ${MK_LOCALES} != "no"
+_colldef =	colldef
+_mklocale =	mklocale
+_monetdef =	monetdef
+_msgdef =	msgdef
+_numericdef =	numericdef
+_timedef =	timedef
+.endif
+
+.if ${MK_MAKE} != "no"
+_mk=		mk
+.endif
+
+.if ${MK_MAN} != "no"
+_man=		man
 .endif
 
 .if ${MK_SENDMAIL} != "no"
@@ -68,6 +74,10 @@ _sendmail=	 sendmail
 _doc=		doc
 .endif
 
+.if ${MK_SYSCONS} != "no"
+_syscons=	syscons
+.endif
+
 .if ${MK_ZONEINFO} != "no"
 _zoneinfo=	zoneinfo
 .endif

Copied: projects/vap7/tools/build/options/WITHOUT_ACCT (from r183242, head/tools/build/options/WITHOUT_ACCT)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/vap7/tools/build/options/WITHOUT_ACCT	Sat Jan 10 00:36:57 2009	(r186990, copy of r183242, head/tools/build/options/WITHOUT_ACCT)
@@ -0,0 +1,5 @@
+.\" $FreeBSD$
+Set to not build process accounting tools such as
+.Xr ac 8 
+and
+.Xr accton 8 .

Copied: projects/vap7/tools/build/options/WITHOUT_AMD (from r183242, head/tools/build/options/WITHOUT_AMD)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/vap7/tools/build/options/WITHOUT_AMD	Sat Jan 10 00:36:57 2009	(r186990, copy of r183242, head/tools/build/options/WITHOUT_AMD)
@@ -0,0 +1,4 @@
+.\" $FreeBSD$
+Set to not build
+.Xr amd 8 ,
+and related programs.

Copied: projects/vap7/tools/build/options/WITHOUT_APM (from r183242, head/tools/build/options/WITHOUT_APM)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/vap7/tools/build/options/WITHOUT_APM	Sat Jan 10 00:36:57 2009	(r186990, copy of r183242, head/tools/build/options/WITHOUT_APM)
@@ -0,0 +1,5 @@
+.\" $FreeBSD$
+Set to not build
+.Xr apm 8 ,
+.Xr apmd 8
+and related programs.

Copied: projects/vap7/tools/build/options/WITHOUT_AT (from r183242, head/tools/build/options/WITHOUT_AT)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/vap7/tools/build/options/WITHOUT_AT	Sat Jan 10 00:36:57 2009	(r186990, copy of r183242, head/tools/build/options/WITHOUT_AT)
@@ -0,0 +1,4 @@
+.\" $FreeBSD$
+Set to not build
+.Xr at 1
+and related utilities.

Copied: projects/vap7/tools/build/options/WITHOUT_CTM (from r183242, head/tools/build/options/WITHOUT_CTM)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/vap7/tools/build/options/WITHOUT_CTM	Sat Jan 10 00:36:57 2009	(r186990, copy of r183242, head/tools/build/options/WITHOUT_CTM)
@@ -0,0 +1,4 @@
+.\" $FreeBSD$
+Set to not build
+.Xr ctm 1
+and related utilities.

Copied: projects/vap7/tools/build/options/WITHOUT_FREEBSD_UPDATE (from r183242, head/tools/build/options/WITHOUT_FREEBSD_UPDATE)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/vap7/tools/build/options/WITHOUT_FREEBSD_UPDATE	Sat Jan 10 00:36:57 2009	(r186990, copy of r183242, head/tools/build/options/WITHOUT_FREEBSD_UPDATE)
@@ -0,0 +1,3 @@
+.\" $FreeBSD$
+Set to not build
+.Xr freebsd-update 8 .

Copied: projects/vap7/tools/build/options/WITHOUT_IPFW (from r183242, head/tools/build/options/WITHOUT_IPFW)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/vap7/tools/build/options/WITHOUT_IPFW	Sat Jan 10 00:36:57 2009	(r186990, copy of r183242, head/tools/build/options/WITHOUT_IPFW)
@@ -0,0 +1,2 @@
+.\" $FreeBSD$
+Set to not build IPFW tools.

Copied: projects/vap7/tools/build/options/WITHOUT_JAIL (from r183242, head/tools/build/options/WITHOUT_JAIL)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/vap7/tools/build/options/WITHOUT_JAIL	Sat Jan 10 00:36:57 2009	(r186990, copy of r183242, head/tools/build/options/WITHOUT_JAIL)
@@ -0,0 +1,3 @@
+.\" $FreeBSD$
+Set to not build tools for the support of jails; e.g.
+.Xr jail 8 .

Copied: projects/vap7/tools/build/options/WITHOUT_LEGACY_CONSOLE (from r183242, head/tools/build/options/WITHOUT_LEGACY_CONSOLE)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/vap7/tools/build/options/WITHOUT_LEGACY_CONSOLE	Sat Jan 10 00:36:57 2009	(r186990, copy of r183242, head/tools/build/options/WITHOUT_LEGACY_CONSOLE)
@@ -0,0 +1,5 @@
+.\" $FreeBSD$
+Set to not build programs that support a legacy PC console; e.g.
+.Xr kbdcontrol 8
+and
+.Xr vidcontrol 8 .

Copied: projects/vap7/tools/build/options/WITHOUT_LOCATE (from r183242, head/tools/build/options/WITHOUT_LOCATE)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/vap7/tools/build/options/WITHOUT_LOCATE	Sat Jan 10 00:36:57 2009	(r186990, copy of r183242, head/tools/build/options/WITHOUT_LOCATE)
@@ -0,0 +1,4 @@
+.\" $FreeBSD$
+Set to not build
+.Xr locate 1
+and related programs.

Copied: projects/vap7/tools/build/options/WITHOUT_MAIL (from r183242, head/tools/build/options/WITHOUT_MAIL)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/vap7/tools/build/options/WITHOUT_MAIL	Sat Jan 10 00:36:57 2009	(r186990, copy of r183242, head/tools/build/options/WITHOUT_MAIL)
@@ -0,0 +1,2 @@
+.\" $FreeBSD$
+Set to not build any mail support (MUA or MTA).

Copied: projects/vap7/tools/build/options/WITHOUT_MAKE (from r183242, head/tools/build/options/WITHOUT_MAKE)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/vap7/tools/build/options/WITHOUT_MAKE	Sat Jan 10 00:36:57 2009	(r186990, copy of r183242, head/tools/build/options/WITHOUT_MAKE)
@@ -0,0 +1,4 @@
+.\" $FreeBSD$
+Set to not install
+.Xr make 1
+and related support files.

Copied: projects/vap7/tools/build/options/WITHOUT_NDIS (from r183242, head/tools/build/options/WITHOUT_NDIS)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/vap7/tools/build/options/WITHOUT_NDIS	Sat Jan 10 00:36:57 2009	(r186990, copy of r183242, head/tools/build/options/WITHOUT_NDIS)
@@ -0,0 +1,3 @@
+.\" $FreeBSD$
+Set to not build programs and libraries
+related to NDIS emulation support.

Copied: projects/vap7/tools/build/options/WITHOUT_NETGRAPH (from r183242, head/tools/build/options/WITHOUT_NETGRAPH)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/vap7/tools/build/options/WITHOUT_NETGRAPH	Sat Jan 10 00:36:57 2009	(r186990, copy of r183242, head/tools/build/options/WITHOUT_NETGRAPH)
@@ -0,0 +1,3 @@
+.\" $FreeBSD$
+Set to not build applications to support
+.Xr netgraph 4 .

Copied: projects/vap7/tools/build/options/WITHOUT_NTP (from r183242, head/tools/build/options/WITHOUT_NTP)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/vap7/tools/build/options/WITHOUT_NTP	Sat Jan 10 00:36:57 2009	(r186990, copy of r183242, head/tools/build/options/WITHOUT_NTP)
@@ -0,0 +1,4 @@
+.\" $FreeBSD$
+Set to not build
+.Xr ntpd 8
+and related programs.

Copied: projects/vap7/tools/build/options/WITHOUT_PKGTOOLS (from r183242, head/tools/build/options/WITHOUT_PKGTOOLS)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/vap7/tools/build/options/WITHOUT_PKGTOOLS	Sat Jan 10 00:36:57 2009	(r186990, copy of r183242, head/tools/build/options/WITHOUT_PKGTOOLS)
@@ -0,0 +1,4 @@
+.\" $FreeBSD$
+Set to not build
+.Xr pkg_add 8
+and related programs.

Copied: projects/vap7/tools/build/options/WITHOUT_PMC (from r183242, head/tools/build/options/WITHOUT_PMC)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/vap7/tools/build/options/WITHOUT_PMC	Sat Jan 10 00:36:57 2009	(r186990, copy of r183242, head/tools/build/options/WITHOUT_PMC)
@@ -0,0 +1,4 @@
+.\" $FreeBSD$
+Set to not build
+.Xr pmccontrol 8
+and related programs.

Copied: projects/vap7/tools/build/options/WITHOUT_PORTSNAP (from r183242, head/tools/build/options/WITHOUT_PORTSNAP)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/vap7/tools/build/options/WITHOUT_PORTSNAP	Sat Jan 10 00:36:57 2009	(r186990, copy of r183242, head/tools/build/options/WITHOUT_PORTSNAP)
@@ -0,0 +1,4 @@
+.\" $FreeBSD$
+Set to not build or install
+.Xr portsnap 8
+and related files.

Copied: projects/vap7/tools/build/options/WITHOUT_PPP (from r183242, head/tools/build/options/WITHOUT_PPP)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/vap7/tools/build/options/WITHOUT_PPP	Sat Jan 10 00:36:57 2009	(r186990, copy of r183242, head/tools/build/options/WITHOUT_PPP)
@@ -0,0 +1,4 @@
+.\" $FreeBSD$
+Set to not build
+.Xr ppp 8
+and related programs.

Copied: projects/vap7/tools/build/options/WITHOUT_QUOTAS (from r183242, head/tools/build/options/WITHOUT_QUOTAS)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/vap7/tools/build/options/WITHOUT_QUOTAS	Sat Jan 10 00:36:57 2009	(r186990, copy of r183242, head/tools/build/options/WITHOUT_QUOTAS)
@@ -0,0 +1,4 @@
+.\" $FreeBSD$
+Set to not build
+.Xr quota 8
+and related programs.

Copied: projects/vap7/tools/build/options/WITHOUT_ROUTED (from r183242, head/tools/build/options/WITHOUT_ROUTED)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/vap7/tools/build/options/WITHOUT_ROUTED	Sat Jan 10 00:36:57 2009	(r186990, copy of r183242, head/tools/build/options/WITHOUT_ROUTED)
@@ -0,0 +1,4 @@
+.\" $FreeBSD$
+Set to not build
+.Xr routed 8
+utility.

Copied: projects/vap7/tools/build/options/WITHOUT_SLIP (from r183242, head/tools/build/options/WITHOUT_SLIP)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/vap7/tools/build/options/WITHOUT_SLIP	Sat Jan 10 00:36:57 2009	(r186990, copy of r183242, head/tools/build/options/WITHOUT_SLIP)
@@ -0,0 +1,4 @@
+.\" $FreeBSD$
+Set to not build
+.Xr sliplogin 8
+and related programs.

Copied: projects/vap7/tools/build/options/WITHOUT_SYSINSTALL (from r183242, head/tools/build/options/WITHOUT_SYSINSTALL)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/vap7/tools/build/options/WITHOUT_SYSINSTALL	Sat Jan 10 00:36:57 2009	(r186990, copy of r183242, head/tools/build/options/WITHOUT_SYSINSTALL)
@@ -0,0 +1,4 @@
+.\" $FreeBSD$
+Set to not build
+.Xr sysinstall 8
+and related programs.

Copied: projects/vap7/tools/build/options/WITHOUT_TELNET (from r183242, head/tools/build/options/WITHOUT_TELNET)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/vap7/tools/build/options/WITHOUT_TELNET	Sat Jan 10 00:36:57 2009	(r186990, copy of r183242, head/tools/build/options/WITHOUT_TELNET)
@@ -0,0 +1,4 @@
+.\" $FreeBSD$
+Set to not build
+.Xr telnet 8
+and related programs.

Copied: projects/vap7/tools/build/options/WITHOUT_TEXTPROC (from r183242, head/tools/build/options/WITHOUT_TEXTPROC)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/vap7/tools/build/options/WITHOUT_TEXTPROC	Sat Jan 10 00:36:57 2009	(r186990, copy of r183242, head/tools/build/options/WITHOUT_TEXTPROC)
@@ -0,0 +1,3 @@
+.\" $FreeBSD$
+Set to not build
+programs used for text processing.

Copied: projects/vap7/tools/build/options/WITHOUT_WIRELESS (from r183242, head/tools/build/options/WITHOUT_WIRELESS)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/vap7/tools/build/options/WITHOUT_WIRELESS	Sat Jan 10 00:36:57 2009	(r186990, copy of r183242, head/tools/build/options/WITHOUT_WIRELESS)
@@ -0,0 +1,5 @@
+.\" $FreeBSD$
+Set to not build programs used for 802.11 wireless networks; especially
+.Xr wpa_supplicant 8
+and
+.Xr hostapd 8 .

Modified: projects/vap7/usr.bin/Makefile
==============================================================================
--- projects/vap7/usr.bin/Makefile	Sat Jan 10 00:33:24 2009	(r186989)
+++ projects/vap7/usr.bin/Makefile	Sat Jan 10 00:36:57 2009	(r186990)
@@ -12,12 +12,12 @@
 SUBDIR=	alias \
 	apply \
 	asa \
-	at \
+	${_at} \
 	${_atm} \
 	awk \
 	banner \
 	basename \
-	biff \
+	${_biff} \
 	${_bluetooth} \
 	brandelf \
 	bsdiff \
@@ -29,23 +29,23 @@ SUBDIR=	alias \
 	cap_mkdb \
 	${_catman} \
 	chat \
-	checknr \
+	${_checknr} \
 	${_chkey} \
 	chpass \
 	cksum \
 	cmp \
 	col \
-	colcrt \
+	${_colcrt} \
 	colldef \
 	colrm \
 	column \
 	comm \
-	compile_et \
+	${_compile_et} \
 	compress \
 	cpuset \
 	csplit \
 	${_csup} \
-	ctags \
+	${_ctags} \
 	cut \
 	${_dig} \
 	dirname \
@@ -59,12 +59,12 @@ SUBDIR=	alias \
 	false \
 	fetch \
 	file \
-	file2c \
+	${_file2c} \
 	find \
 	finger \
-	fmt \
+	${_fmt} \
 	fold \
-	from \
+	${_from} \
 	fstat \
 	fsync \
 	ftp \
@@ -80,7 +80,7 @@ SUBDIR=	alias \
 	hexdump \
 	${_host} \
 	id \
-	indent \
+	${_indent} \
 	ipcrm \
 	ipcs \
 	join \
@@ -102,7 +102,7 @@ SUBDIR=	alias \
 	${_lex} \
 	limits \
 	locale \
-	locate \
+	${_locate} \
 	lock \
 	lockf \
 	logger \
@@ -113,18 +113,18 @@ SUBDIR=	alias \
 	lorder \
 	lsvfs \
 	m4 \
-	mail \
-	make \
+	${_mail} \
+	${_make} \
 	makewhatis \
 	mesg \
 	minigzip \
 	mkdep \
 	mkfifo \
 	mklocale \
-	mkstr \
+	${_mkstr} \
 	mktemp \
 	mkuzip \
-	msgs \
+	${_msgs} \
 	mt \
 	${_nc} \
 	ncal \
@@ -151,19 +151,19 @@ SUBDIR=	alias \
 	printenv \
 	printf \
 	procstat \
-	quota \
+	${_quota} \
 	renice \
 	rev \
 	${_rlogin} \
-	rpcgen \
+	${_rpcgen} \
 	rpcinfo \
 	rs \
 	${_rsh} \
 	rup \
-	ruptime \
+	${_ruptime} \
 	rusers \
 	rwall \
-	rwho \
+	${_rwho} \
 	script \
 	sed \
 	shar \
@@ -180,7 +180,7 @@ SUBDIR=	alias \
 	tar \
 	tcopy \
 	tee \
-	telnet \
+	${_telnet} \
 	tftp \
 	time \
 	tip \
@@ -194,10 +194,10 @@ SUBDIR=	alias \
 	tset \
 	tsort \
 	tty \
-	ul \
+	${_ul} \
 	uname \
 	unexpand \
-	unifdef \
+	${_unifdef} \
 	uniq \
 	units \
 	unvis \
@@ -207,7 +207,7 @@ SUBDIR=	alias \
 	uudecode \
 	uuencode \
 	${_vacation} \
-	vgrind \
+	${_vgrind} \
 	vi \
 	vis \
 	vmstat \
@@ -224,7 +224,7 @@ SUBDIR=	alias \
 	xargs \
 	xinstall \
 	${_xlint} \
-	xstr \
+	${_xstr} \
 	${_yacc} \
 	yes \
 	${_ypcat} \
@@ -235,6 +235,12 @@ SUBDIR=	alias \
 _truss=		truss
 .endif
 
+# NB: keep these sorted by MK_* knobs
+
+.if ${MK_AT} != "no"
+_at=		at
+.endif
+
 .if ${MK_ATM} != "no"
 _atm=		atm
 .endif
@@ -258,6 +264,10 @@ _bluetooth=	bluetooth
 _calendar=	calendar
 .endif
 
+.if ${MK_HESIOD} != "no"
+_hesinfo=	hesinfo
+.endif
+

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

From owner-svn-src-projects@FreeBSD.ORG  Sat Jan 10 01:47:16 2009
Return-Path: <owner-svn-src-projects@FreeBSD.ORG>
Delivered-To: svn-src-projects@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 217B31065670;
	Sat, 10 Jan 2009 01:47:16 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 108E18FC08;
	Sat, 10 Jan 2009 01:47:16 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0A1lFO8076025;
	Sat, 10 Jan 2009 01:47:15 GMT (envelope-from sam@svn.freebsd.org)
Received: (from sam@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0A1lFC6076022;
	Sat, 10 Jan 2009 01:47:15 GMT (envelope-from sam@svn.freebsd.org)
Message-Id: <200901100147.n0A1lFC6076022@svn.freebsd.org>
From: Sam Leffler <sam@FreeBSD.org>
Date: Sat, 10 Jan 2009 01:47:15 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-projects@freebsd.org
X-SVN-Group: projects
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r186993 - in projects/vap7/etc: . rc.d
X-BeenThere: svn-src-projects@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the src &quot; projects&quot;
	tree" <svn-src-projects.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
	<mailto:svn-src-projects-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-projects>
List-Post: <mailto:svn-src-projects@freebsd.org>
List-Help: <mailto:svn-src-projects-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
	<mailto:svn-src-projects-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sat, 10 Jan 2009 01:47:16 -0000

Author: sam
Date: Sat Jan 10 01:47:15 2009
New Revision: 186993
URL: http://svn.freebsd.org/changeset/base/186993

Log:
  bring back quietstart stuff (r175676)

Modified:
  projects/vap7/etc/   (props changed)
  projects/vap7/etc/rc
  projects/vap7/etc/rc.d/netif
  projects/vap7/etc/rc.subr

Modified: projects/vap7/etc/rc
==============================================================================
--- projects/vap7/etc/rc	Sat Jan 10 01:22:23 2009	(r186992)
+++ projects/vap7/etc/rc	Sat Jan 10 01:47:15 2009	(r186993)
@@ -56,7 +56,7 @@ if [ "$1" = autoboot ]; then
 	rc_fast=yes        # run_rc_command(): do fast booting
 else
 	autoboot=no
-	_boot="start"
+	_boot="quietstart"
 fi
 
 dlv=`/sbin/sysctl -n vfs.nfs.diskless_valid 2> /dev/null`

Modified: projects/vap7/etc/rc.d/netif
==============================================================================
--- projects/vap7/etc/rc.d/netif	Sat Jan 10 01:22:23 2009	(r186992)
+++ projects/vap7/etc/rc.d/netif	Sat Jan 10 01:47:15 2009	(r186993)
@@ -95,7 +95,7 @@ network_start()
 
 	if [ -f /etc/rc.d/ipfilter ] ; then
 		# Resync ipfilter
-		/etc/rc.d/ipfilter resync
+		/etc/rc.d/ipfilter quietresync
 	fi
 	if [ -f /etc/rc.d/bridge -a -n "$cmdifn" ] ; then
 		/etc/rc.d/bridge start $cmdifn

Modified: projects/vap7/etc/rc.subr
==============================================================================
--- projects/vap7/etc/rc.subr	Sat Jan 10 01:22:23 2009	(r186992)
+++ projects/vap7/etc/rc.subr	Sat Jan 10 01:47:15 2009	(r186993)
@@ -381,9 +381,10 @@ wait_for_pids()
 #	If argument has a given prefix, then change the operation as follows:
 #		Prefix	Operation
 #		------	---------
-#		fast	Skip the pid check, and set rc_fast=yes
+#		fast	Skip the pid check, and set rc_fast=yes, rc_quiet=yes
 #		force	Set ${rcvar} to YES, and set rc_force=yes
 #		one	Set ${rcvar} to YES
+#		quiet	Don't output some diagnostics, and set rc_quiet=yes
 #
 #	The following globals are used:
 #
@@ -526,6 +527,8 @@ wait_for_pids()
 #
 #	rc_force	Not empty if "force" was provided (q.v.)
 #
+#	rc_quiet	Not empty if "quiet" was provided
+#
 #
 run_rc_command()
 {
@@ -546,6 +549,7 @@ run_rc_command()
 	fast*)				# "fast" prefix; don't check pid
 		rc_arg=${rc_arg#fast}
 		rc_fast=yes
+		rc_quiet=yes
 		;;
 	force*)				# "force prefix; always run
 		rc_force=yes
@@ -562,6 +566,11 @@ run_rc_command()
 			eval ${rcvar}=YES
 		fi
 		;;
+	quiet*)				# "quiet" prefix; omit some messages
+		_rc_prefix=quiet
+		rc_arg=${rc_arg#${_rc_prefix}}
+		rc_quiet=yes
+		;;
 	esac
 
 	eval _override_command=\$${name}_program
@@ -610,6 +619,12 @@ run_rc_command()
 					#
 	if [ -n "${rcvar}" -a "$rc_arg" != "rcvar" ]; then
 		if ! checkyesno ${rcvar}; then
+			if [ -n "${rc_quiet}" ]; then
+				return 0
+			fi
+			echo -n "Cannot '${rc_arg}' $name. Set ${rcvar} to "
+			echo -n "YES in /etc/rc.conf or use 'one${rc_arg}' "
+			echo "instead of '${rc_arg}'."
 			return 0
 		fi
 	fi