From owner-svn-src-projects@FreeBSD.ORG Sun Jan 4 17:27:00 2009 Return-Path: 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 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 " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-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: 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 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 " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-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 + * Copyright (c) 2007-2009, Ulf Lilleengen * 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 + * Copyright (c) 2007-2009, Ulf Lilleengen * 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 + * Copyright (c) 2008-2009, Ulf Lilleengen * 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 + * Copyright (c) 2008-2009, Ulf Lilleengen * 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 + * Copyright (c) 2007-2009, Ulf Lilleengen * 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 + * Copyright (c) 2008-2009, Ulf Lilleengen * 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 + * Copyright (c) 2008-2009, Ulf Lilleengen * 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: 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 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 " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-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: 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 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 " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-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: 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 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 " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-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 #include #include +#include #include #include #include @@ -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: 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 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 " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-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: 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 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 " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-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 #include #include +#include #include #include #include @@ -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 #include #include -#include #include #include #include @@ -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: 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 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 " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-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: 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 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 " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-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: 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 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 " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-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: 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 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 " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-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 /* XXX for ether_sprintf */ -#include +#include /* * 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 #include -#include +#include 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 #include #include #include +#include #include /* + * 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 #include #include -#include #include #include #include @@ -65,7 +65,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include /* XXX for ether_sprintf */ #include @@ -78,23 +77,12 @@ __FBSDID("$FreeBSD$"); #include #include -#include - -#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 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: 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 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 " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-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: 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 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 " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-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: 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 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 " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-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: 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 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 " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-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 @@ --> DEBUG - 0 + 0x1ff @@ -1080,6 +1080,75 @@ + + + SR9 + 0x0298 + + + + + 30 + IEEE80211_CHAN_G + + + + 30 + IEEE80211_CHAN_G + + + + 30 + IEEE80211_CHAN_G + + + + + + XR9 + 0x299 + + + + + 30 + IEEE80211_CHAN_G + + + + 30 + IEEE80211_CHAN_G + + + + 30 + IEEE80211_CHAN_G + + + + + + GZ901 + 0x29a + + + + + 30 + IEEE80211_CHAN_G + + + + 30 + IEEE80211_CHAN_G + + + + 30 + IEEE80211_CHAN_G + + + @@ -1201,6 +1270,9 @@ 320 Guatemala + + 5002 ZComax GZ-901 + 340 Honduras @@ -1396,6 +1468,12 @@ 792 Turkey + + 5000 Ubiquiti SR9 + + + 5001 Ubiquiti XR9 + 804 Ukraine @@ -1426,6 +1504,10 @@ 716 Zimbabwe + + + 0 Debug +