From owner-svn-src-stable-8@FreeBSD.ORG Sun Apr 18 00:57:31 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6FF53106564A; Sun, 18 Apr 2010 00:57:31 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 447CB8FC15; Sun, 18 Apr 2010 00:57:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3I0vVsq023282; Sun, 18 Apr 2010 00:57:31 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3I0vVut023279; Sun, 18 Apr 2010 00:57:31 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201004180057.o3I0vVut023279@svn.freebsd.org> From: Warner Losh Date: Sun, 18 Apr 2010 00:57:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206781 - stable/8/usr.sbin/config X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Apr 2010 00:57:31 -0000 Author: imp Date: Sun Apr 18 00:57:30 2010 New Revision: 206781 URL: http://svn.freebsd.org/changeset/base/206781 Log: MFC r206664: Allow option aliasing. Lines of the form: OLD_OPT = NEW_OPT in options* files will now map OLD_OPT to NEW_OPT with a friendly message. This is indented for situations where we need to preserve an interface in the config file in an upwards compatible fashion on a stable branch. Reviewed by: nwhitehorn@ MFC after: 3 days Modified: stable/8/usr.sbin/config/config.h stable/8/usr.sbin/config/mkoptions.c Directory Properties: stable/8/usr.sbin/config/ (props changed) Modified: stable/8/usr.sbin/config/config.h ============================================================================== --- stable/8/usr.sbin/config/config.h Sat Apr 17 23:48:07 2010 (r206780) +++ stable/8/usr.sbin/config/config.h Sun Apr 18 00:57:30 2010 (r206781) @@ -129,6 +129,8 @@ SLIST_HEAD(opt_head, opt) opt, mkopt, rm struct opt_list { char *o_name; char *o_file; + int o_flags; +#define OL_ALIAS 1 SLIST_ENTRY(opt_list) o_next; }; Modified: stable/8/usr.sbin/config/mkoptions.c ============================================================================== --- stable/8/usr.sbin/config/mkoptions.c Sat Apr 17 23:48:07 2010 (r206780) +++ stable/8/usr.sbin/config/mkoptions.c Sun Apr 18 00:57:30 2010 (r206781) @@ -94,6 +94,17 @@ options(void) SLIST_INSERT_HEAD(&opt, op, op_next); read_options(); + SLIST_FOREACH(op, &opt, op_next) { + SLIST_FOREACH(ol, &otab, o_next) { + if (eq(op->op_name, ol->o_name) && + (ol->o_flags & OL_ALIAS)) { + printf("Mapping option %s to %s.\n", + op->op_name, ol->o_file); + op->op_name = ol->o_file; + break; + } + } + } SLIST_FOREACH(ol, &otab, o_next) do_option(ol->o_name); SLIST_FOREACH(op, &opt, op_next) { @@ -124,7 +135,6 @@ do_option(char *name) int tidy; file = tooption(name); - /* * Check to see if the option was specified.. */ @@ -292,6 +302,7 @@ read_options(void) struct opt_list *po; int first = 1; char genopt[MAXPATHLEN]; + int flags = 0; SLIST_INIT(&otab); (void) snprintf(fname, sizeof(fname), "../../conf/options"); @@ -301,6 +312,7 @@ openit: return; } next: + flags = 0; wd = get_word(fp); if (wd == (char *)EOF) { (void) fclose(fp); @@ -332,6 +344,18 @@ next: (void) snprintf(genopt, sizeof(genopt), "opt_%s.h", lower(s)); val = genopt; free(s); + } else if (eq(val, "=")) { + val = get_word(fp); + if (val == (char *)EOF) { + printf("%s: unexpected end of file\n", fname); + exit(1); + } + if (val == 0) { + printf("%s: Expected a right hand side at %s\n", fname, + this); + exit(1); + } + flags |= OL_ALIAS; } val = ns(val); @@ -348,6 +372,7 @@ next: err(EXIT_FAILURE, "calloc"); po->o_name = this; po->o_file = val; + po->o_flags = flags; SLIST_INSERT_HEAD(&otab, po, o_next); goto next; From owner-svn-src-stable-8@FreeBSD.ORG Sun Apr 18 01:15:48 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 27854106566B; Sun, 18 Apr 2010 01:15:48 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0FE928FC0A; Sun, 18 Apr 2010 01:15:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3I1FlP5027359; Sun, 18 Apr 2010 01:15:47 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3I1FlLh027356; Sun, 18 Apr 2010 01:15:47 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201004180115.o3I1FlLh027356@svn.freebsd.org> From: Warner Losh Date: Sun, 18 Apr 2010 01:15:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206782 - stable/8/sys/conf X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Apr 2010 01:15:48 -0000 Author: imp Date: Sun Apr 18 01:15:47 2010 New Revision: 206782 URL: http://svn.freebsd.org/changeset/base/206782 Log: Remap COMPAT_IA32 to COMPAT_FREEBSD32 to ease the transition of this option and not break 8.0 config files later in the 8.x branch. # Yes, this is a direct commit, since this is not relevant to head. Modified: stable/8/sys/conf/options.amd64 stable/8/sys/conf/options.ia64 Modified: stable/8/sys/conf/options.amd64 ============================================================================== --- stable/8/sys/conf/options.amd64 Sun Apr 18 00:57:30 2010 (r206781) +++ stable/8/sys/conf/options.amd64 Sun Apr 18 01:15:47 2010 (r206782) @@ -11,6 +11,7 @@ MP_WATCHDOG # Options for emulators. These should only be used at config time, so # they are handled like options for static filesystems # (see src/sys/conf/options), except for broken debugging options. +COMPAT_IA32 = COMPAT_FREEBSD32 COMPAT_FREEBSD32 opt_compat.h #IBCS2 opt_dontuse.h #COMPAT_LINUX opt_dontuse.h Modified: stable/8/sys/conf/options.ia64 ============================================================================== --- stable/8/sys/conf/options.ia64 Sun Apr 18 00:57:30 2010 (r206781) +++ stable/8/sys/conf/options.ia64 Sun Apr 18 01:15:47 2010 (r206782) @@ -9,6 +9,7 @@ LOG2_PAGE_SIZE opt_global.h UWX_TRACE_ENABLE opt_global.h +COMPAT_IA32 = COMPAT_FREEBSD32 COMPAT_FREEBSD32 opt_compat.h EXCEPTION_TRACING opt_xtrace.h From owner-svn-src-stable-8@FreeBSD.ORG Sun Apr 18 03:52:41 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ADC9B1065673; Sun, 18 Apr 2010 03:52:41 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9B3478FC0A; Sun, 18 Apr 2010 03:52:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3I3qf4R061983; Sun, 18 Apr 2010 03:52:41 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3I3qf1q061982; Sun, 18 Apr 2010 03:52:41 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <201004180352.o3I3qf1q061982@svn.freebsd.org> From: Hajimu UMEMOTO Date: Sun, 18 Apr 2010 03:52:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206783 - stable/8/lib/libc/net X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Apr 2010 03:52:41 -0000 Author: ume Date: Sun Apr 18 03:52:41 2010 New Revision: 206783 URL: http://svn.freebsd.org/changeset/base/206783 Log: MFC ir206152, r206153, r206154: - Stop adding trailing '\n'. The servent_unpack() doesn't expect lines terminated with '\n'. - Treat '+' as special only when in compat mode, and simplify the logic bit. - Reduce duplicate code. Modified: stable/8/lib/libc/net/getservent.c Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) Modified: stable/8/lib/libc/net/getservent.c ============================================================================== --- stable/8/lib/libc/net/getservent.c Sun Apr 18 01:15:47 2010 (r206782) +++ stable/8/lib/libc/net/getservent.c Sun Apr 18 03:52:41 2010 (r206783) @@ -207,6 +207,32 @@ servent_unpack(char *p, struct servent * return 0; } +static int +parse_result(struct servent *serv, char *buffer, size_t bufsize, + char *resultbuf, size_t resultbuflen, int *errnop) +{ + char **aliases; + int aliases_size; + + if (bufsize <= resultbuflen + _ALIGNBYTES + sizeof(char *)) { + *errnop = ERANGE; + return (NS_RETURN); + } + aliases = (char **)_ALIGN(&buffer[resultbuflen + 1]); + aliases_size = (buffer + bufsize - (char *)aliases) / sizeof(char *); + if (aliases_size < 1) { + *errnop = ERANGE; + return (NS_RETURN); + } + + memcpy(buffer, resultbuf, resultbuflen); + buffer[resultbuflen] = '\0'; + + if (servent_unpack(buffer, serv, aliases, aliases_size, errnop) != 0) + return ((*errnop == 0) ? NS_NOTFOUND : NS_RETURN); + return (NS_SUCCESS); +} + /* files backend implementation */ static void files_endstate(void *p) @@ -258,8 +284,6 @@ files_servent(void *retval, void *mdata, size_t bufsize; int *errnop; - char **aliases; - int aliases_size; size_t linesize; char *line; char **cp; @@ -315,28 +339,8 @@ files_servent(void *retval, void *mdata, break; } - if (*line=='+') { - if (serv_mdata->compat_mode != 0) - st->compat_mode_active = 1; - } else { - if (bufsize <= linesize + _ALIGNBYTES + - sizeof(char *)) { - *errnop = ERANGE; - rv = NS_RETURN; - break; - } - aliases = (char **)_ALIGN(&buffer[linesize+1]); - aliases_size = (buffer + bufsize - - (char *)aliases) / sizeof(char *); - if (aliases_size < 1) { - *errnop = ERANGE; - rv = NS_RETURN; - break; - } - - memcpy(buffer, line, linesize); - buffer[linesize] = '\0'; - } + if (*line=='+' && serv_mdata->compat_mode != 0) + st->compat_mode_active = 1; } if (st->compat_mode_active != 0) { @@ -367,18 +371,12 @@ files_servent(void *retval, void *mdata, continue; } - rv = servent_unpack(buffer, serv, aliases, aliases_size, + rv = parse_result(serv, buffer, bufsize, line, linesize, errnop); - if (rv !=0 ) { - if (*errnop == 0) { - rv = NS_NOTFOUND; - continue; - } - else { - rv = NS_RETURN; - break; - } - } + if (rv == NS_NOTFOUND) + continue; + if (rv == NS_RETURN) + break; rv = NS_NOTFOUND; switch (serv_mdata->how) { @@ -486,9 +484,6 @@ nis_servent(void *retval, void *mdata, v size_t bufsize; int *errnop; - char **aliases; - int aliases_size; - name = NULL; proto = NULL; how = (enum nss_lookup_type)mdata; @@ -594,39 +589,8 @@ nis_servent(void *retval, void *mdata, v break; }; - /* we need a room for additional \n symbol */ - if (bufsize <= - resultbuflen + 1 + _ALIGNBYTES + sizeof(char *)) { - *errnop = ERANGE; - rv = NS_RETURN; - break; - } - - aliases = (char **)_ALIGN(&buffer[resultbuflen + 2]); - aliases_size = - (buffer + bufsize - (char *)aliases) / sizeof(char *); - if (aliases_size < 1) { - *errnop = ERANGE; - rv = NS_RETURN; - break; - } - - /* - * servent_unpack expects lines terminated with \n -- - * make it happy - */ - memcpy(buffer, resultbuf, resultbuflen); - buffer[resultbuflen] = '\n'; - buffer[resultbuflen + 1] = '\0'; - - if (servent_unpack(buffer, serv, aliases, aliases_size, - errnop) != 0) { - if (*errnop == 0) - rv = NS_NOTFOUND; - else - rv = NS_RETURN; - } else - rv = NS_SUCCESS; + rv = parse_result(serv, buffer, bufsize, resultbuf, + resultbuflen, errnop); free(resultbuf); } while (!(rv & NS_TERMINATE) && how == nss_lt_all); From owner-svn-src-stable-8@FreeBSD.ORG Sun Apr 18 04:07:33 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4DDA01065670; Sun, 18 Apr 2010 04:07:33 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 39E868FC1C; Sun, 18 Apr 2010 04:07:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3I47X5D065418; Sun, 18 Apr 2010 04:07:33 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3I47XDC065411; Sun, 18 Apr 2010 04:07:33 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <201004180407.o3I47XDC065411@svn.freebsd.org> From: Hajimu UMEMOTO Date: Sun, 18 Apr 2010 04:07:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206784 - in stable/8: include lib/libc/net share/man/man5 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Apr 2010 04:07:33 -0000 Author: ume Date: Sun Apr 18 04:07:32 2010 New Revision: 206784 URL: http://svn.freebsd.org/changeset/base/206784 Log: MFC r206155, r206267: Add capability to use a db version of services. It is enabled by specifying `db' as source of services in /etc/nsswitch.conf. Modified: stable/8/include/netdb.h stable/8/include/nsswitch.h stable/8/lib/libc/net/getservent.c stable/8/lib/libc/net/nsdispatch.3 stable/8/share/man/man5/nsswitch.conf.5 stable/8/share/man/man5/services.5 Directory Properties: stable/8/include/ (props changed) stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) stable/8/share/man/man5/ (props changed) Modified: stable/8/include/netdb.h ============================================================================== --- stable/8/include/netdb.h Sun Apr 18 03:52:41 2010 (r206783) +++ stable/8/include/netdb.h Sun Apr 18 04:07:32 2010 (r206784) @@ -86,6 +86,7 @@ typedef __uint32_t uint32_t; #define _PATH_NETWORKS "/etc/networks" #define _PATH_PROTOCOLS "/etc/protocols" #define _PATH_SERVICES "/etc/services" +#define _PATH_SERVICES_DB "/var/db/services.db" #define h_errno (*__h_errno()) Modified: stable/8/include/nsswitch.h ============================================================================== --- stable/8/include/nsswitch.h Sun Apr 18 03:52:41 2010 (r206783) +++ stable/8/include/nsswitch.h Sun Apr 18 04:07:32 2010 (r206784) @@ -65,6 +65,7 @@ * currently implemented sources */ #define NSSRC_FILES "files" /* local files */ +#define NSSRC_DB "db" /* database */ #define NSSRC_DNS "dns" /* DNS; IN for hosts, HS for others */ #define NSSRC_NIS "nis" /* YP/NIS */ #define NSSRC_COMPAT "compat" /* passwd,group in YP compat mode */ Modified: stable/8/lib/libc/net/getservent.c ============================================================================== --- stable/8/lib/libc/net/getservent.c Sun Apr 18 03:52:41 2010 (r206783) +++ stable/8/lib/libc/net/getservent.c Sun Apr 18 04:07:32 2010 (r206784) @@ -37,7 +37,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include #include #include #include @@ -94,6 +96,19 @@ NSS_TLS_HANDLING(files); static int files_servent(void *, void *, va_list); static int files_setservent(void *, void *, va_list); +/* db backend declarations */ +struct db_state +{ + DB *db; + int stayopen; + int keynum; +}; +static void db_endstate(void *); +NSS_TLS_HANDLING(db); + +static int db_servent(void *, void *, va_list); +static int db_setservent(void *, void *, va_list); + #ifdef YP /* nis backend declarations */ static int nis_servent(void *, void *, va_list); @@ -263,6 +278,8 @@ files_servent(void *retval, void *mdata, { NULL, 0 } }; ns_dtab compat_dtab[] = { + { NSSRC_DB, db_servent, + (void *)((struct servent_mdata *)mdata)->how }, #ifdef YP { NSSRC_NIS, nis_servent, (void *)((struct servent_mdata *)mdata)->how }, @@ -452,6 +469,183 @@ files_setservent(void *retval, void *mda return (NS_UNAVAIL); } +/* db backend implementation */ +static void +db_endstate(void *p) +{ + DB *db; + + if (p == NULL) + return; + + db = ((struct db_state *)p)->db; + if (db != NULL) + db->close(db); + + free(p); +} + +static int +db_servent(void *retval, void *mdata, va_list ap) +{ + char buf[BUFSIZ]; + DBT key, data, *result; + DB *db; + + struct db_state *st; + int rv; + int stayopen; + + enum nss_lookup_type how; + char *name; + char *proto; + int port; + + struct servent *serv; + char *buffer; + size_t bufsize; + int *errnop; + + name = NULL; + proto = NULL; + how = (enum nss_lookup_type)mdata; + switch (how) { + case nss_lt_name: + name = va_arg(ap, char *); + proto = va_arg(ap, char *); + break; + case nss_lt_id: + port = va_arg(ap, int); + proto = va_arg(ap, char *); + break; + case nss_lt_all: + break; + default: + return NS_NOTFOUND; + }; + + serv = va_arg(ap, struct servent *); + buffer = va_arg(ap, char *); + bufsize = va_arg(ap, size_t); + errnop = va_arg(ap,int *); + + *errnop = db_getstate(&st); + if (*errnop != 0) + return (NS_UNAVAIL); + + if (how == nss_lt_all && st->keynum < 0) + return (NS_NOTFOUND); + + if (st->db == NULL) { + st->db = dbopen(_PATH_SERVICES_DB, O_RDONLY, 0, DB_HASH, NULL); + if (st->db == NULL) { + *errnop = errno; + return (NS_UNAVAIL); + } + } + + stayopen = (how == nss_lt_all) ? 1 : st->stayopen; + db = st->db; + + do { + switch (how) { + case nss_lt_name: + key.data = buf; + if (proto == NULL) + key.size = snprintf(buf, sizeof(buf), + "\376%s", name); + else + key.size = snprintf(buf, sizeof(buf), + "\376%s/%s", name, proto); + key.size++; + if (db->get(db, &key, &data, 0) != 0 || + db->get(db, &data, &key, 0) != 0) { + rv = NS_NOTFOUND; + goto db_fin; + } + result = &key; + break; + case nss_lt_id: + key.data = buf; + port = htons(port); + if (proto == NULL) + key.size = snprintf(buf, sizeof(buf), + "\377%d", port); + else + key.size = snprintf(buf, sizeof(buf), + "\377%d/%s", port, proto); + key.size++; + if (db->get(db, &key, &data, 0) != 0 || + db->get(db, &data, &key, 0) != 0) { + rv = NS_NOTFOUND; + goto db_fin; + } + result = &key; + break; + case nss_lt_all: + key.data = buf; + key.size = snprintf(buf, sizeof(buf), "%d", + st->keynum++); + key.size++; + if (db->get(db, &key, &data, 0) != 0) { + st->keynum = -1; + rv = NS_NOTFOUND; + goto db_fin; + } + result = &data; + break; + } + + rv = parse_result(serv, buffer, bufsize, result->data, + result->size - 1, errnop); + + } while (!(rv & NS_TERMINATE) && how == nss_lt_all); + +db_fin: + if (!stayopen && st->db != NULL) { + db->close(db); + st->db = NULL; + } + + if (rv == NS_SUCCESS && retval != NULL) + *(struct servent **)retval = serv; + + return (rv); +} + +static int +db_setservent(void *retval, void *mdata, va_list ap) +{ + DB *db; + struct db_state *st; + int rv; + int f; + + rv = db_getstate(&st); + if (rv != 0) + return (NS_UNAVAIL); + + switch ((enum constants)mdata) { + case SETSERVENT: + f = va_arg(ap, int); + st->stayopen |= f; + st->keynum = 0; + break; + case ENDSERVENT: + db = st->db; + if (db != NULL) { + db->close(db); + st->db = NULL; + } + st->stayopen = 0; + break; + default: + break; + }; + + return (NS_UNAVAIL); +} + /* nis backend implementation */ #ifdef YP static void @@ -638,6 +832,7 @@ compat_setservent(void *retval, void *md { NULL, 0 } }; ns_dtab compat_dtab[] = { + { NSSRC_DB, db_setservent, mdata }, #ifdef YP { NSSRC_NIS, nis_setservent, mdata }, #endif @@ -924,6 +1119,7 @@ getservbyname_r(const char *name, const #endif /* NS_CACHING */ static const ns_dtab dtab[] = { { NSSRC_FILES, files_servent, (void *)&mdata }, + { NSSRC_DB, db_servent, (void *)nss_lt_name }, #ifdef YP { NSSRC_NIS, nis_servent, (void *)nss_lt_name }, #endif @@ -960,6 +1156,7 @@ getservbyport_r(int port, const char *pr #endif static const ns_dtab dtab[] = { { NSSRC_FILES, files_servent, (void *)&mdata }, + { NSSRC_DB, db_servent, (void *)nss_lt_id }, #ifdef YP { NSSRC_NIS, nis_servent, (void *)nss_lt_id }, #endif @@ -995,6 +1192,7 @@ getservent_r(struct servent *serv, char #endif static const ns_dtab dtab[] = { { NSSRC_FILES, files_servent, (void *)&mdata }, + { NSSRC_DB, db_servent, (void *)nss_lt_all }, #ifdef YP { NSSRC_NIS, nis_servent, (void *)nss_lt_all }, #endif @@ -1027,6 +1225,7 @@ setservent(int stayopen) #endif static const ns_dtab dtab[] = { { NSSRC_FILES, files_setservent, (void *)SETSERVENT }, + { NSSRC_DB, db_setservent, (void *)SETSERVENT }, #ifdef YP { NSSRC_NIS, nis_setservent, (void *)SETSERVENT }, #endif @@ -1051,6 +1250,7 @@ endservent() #endif static const ns_dtab dtab[] = { { NSSRC_FILES, files_setservent, (void *)ENDSERVENT }, + { NSSRC_DB, db_setservent, (void *)ENDSERVENT }, #ifdef YP { NSSRC_NIS, nis_setservent, (void *)ENDSERVENT }, #endif Modified: stable/8/lib/libc/net/nsdispatch.3 ============================================================================== --- stable/8/lib/libc/net/nsdispatch.3 Sun Apr 18 03:52:41 2010 (r206783) +++ stable/8/lib/libc/net/nsdispatch.3 Sun Apr 18 04:07:32 2010 (r206784) @@ -32,7 +32,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 22, 2007 +.Dd April 4, 2010 .Dt NSDISPATCH 3 .Os .Sh NAME @@ -176,6 +176,7 @@ While there is support for arbitrary sou .Bl -column NSSRC_COMPAT compat -offset indent .It Sy "#define value" .It Dv NSSRC_FILES Ta """files"" +.It Dv NSSRC_DB Ta """db"" .It Dv NSSRC_DNS Ta """dns"" .It Dv NSSRC_NIS Ta """nis"" .It Dv NSSRC_COMPAT Ta """compat"" Modified: stable/8/share/man/man5/nsswitch.conf.5 ============================================================================== --- stable/8/share/man/man5/nsswitch.conf.5 Sun Apr 18 03:52:41 2010 (r206783) +++ stable/8/share/man/man5/nsswitch.conf.5 Sun Apr 18 04:07:32 2010 (r206784) @@ -33,7 +33,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 23, 2008 +.Dd April 4, 2010 .Dt NSSWITCH.CONF 5 .Os .Sh NAME @@ -72,6 +72,8 @@ Local files, such as .Pa /etc/hosts , and .Pa /etc/passwd . +.It db +Local database. .It dns Internet Domain Name System. .Dq hosts Modified: stable/8/share/man/man5/services.5 ============================================================================== --- stable/8/share/man/man5/services.5 Sun Apr 18 03:52:41 2010 (r206783) +++ stable/8/share/man/man5/services.5 Sun Apr 18 04:07:32 2010 (r206784) @@ -32,7 +32,7 @@ .\" @(#)services.5 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd June 5, 1993 +.Dd April 4, 2010 .Dt SERVICES 5 .Os .Sh NAME @@ -65,6 +65,18 @@ not interpreted by the routines which se Service names may contain any printable character other than a field delimiter, newline, or comment character. +.Pp +If +.Dq db +is specified as source in the +.Xr nsswitch.conf 5 , +.Pa /var/db/services.db +is searched. +The database in +.Pa /var/db/services.db +needs to be updated with +.Xr services_mkdb 8 +after changes to the services file have been applied. .Sh NIS INTERACTION Access to the NIS .Pa services.byname @@ -84,6 +96,8 @@ file resides in .El .Sh SEE ALSO .Xr getservent 3 +.Xr nsswitch.conf 5 +.Xr services_mkdb 8 .Sh HISTORY The .Nm From owner-svn-src-stable-8@FreeBSD.ORG Sun Apr 18 04:15:21 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C980106564A; Sun, 18 Apr 2010 04:15:21 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 70C3B8FC1C; Sun, 18 Apr 2010 04:15:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3I4FLtx067202; Sun, 18 Apr 2010 04:15:21 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3I4FLoY067199; Sun, 18 Apr 2010 04:15:21 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <201004180415.o3I4FLoY067199@svn.freebsd.org> From: Hajimu UMEMOTO Date: Sun, 18 Apr 2010 04:15:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206785 - in stable/8/usr.sbin: . services_mkdb X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Apr 2010 04:15:21 -0000 Author: ume Date: Sun Apr 18 04:15:21 2010 New Revision: 206785 URL: http://svn.freebsd.org/changeset/base/206785 Log: MFC r206156, r206159, r206163: services_mkdb; generate db file from services(5) to increase speed of getserv*() Added: - copied from r206156, head/usr.sbin/services_mkdb/ Directory Properties: stable/8/usr.sbin/services_mkdb/ (props changed) Modified: stable/8/usr.sbin/Makefile (contents, props changed) stable/8/usr.sbin/services_mkdb/services_mkdb.c Modified: stable/8/usr.sbin/Makefile ============================================================================== --- stable/8/usr.sbin/Makefile Sun Apr 18 04:07:32 2010 (r206784) +++ stable/8/usr.sbin/Makefile Sun Apr 18 04:15:21 2010 (r206785) @@ -168,6 +168,7 @@ SUBDIR= ${_ac} \ ${_sade} \ ${_sendmail} \ service \ + services_mkdb \ setfib \ setfmac \ setpmac \ Modified: stable/8/usr.sbin/services_mkdb/services_mkdb.c ============================================================================== --- head/usr.sbin/services_mkdb/services_mkdb.c Sun Apr 4 08:38:14 2010 (r206156) +++ stable/8/usr.sbin/services_mkdb/services_mkdb.c Sun Apr 18 04:15:21 2010 (r206785) @@ -219,7 +219,7 @@ parseservices(const char *fname, StringL line = 0; if ((svc = calloc(PMASK + 1, sizeof(StringList **))) == NULL) - err(1, "Cannot allocate %zu bytes", PMASK + 1); + err(1, "Cannot allocate %zu bytes", (size_t)(PMASK + 1)); /* XXX: change NULL to "\0\0#" when fparseln fixed */ for (; (p = fparseln(fp, &len, &line, NULL, 0)) != NULL; free(p)) { @@ -271,7 +271,8 @@ parseservices(const char *fname, StringL if (svc[pnum] == NULL) { svc[pnum] = calloc(PROTOMAX, sizeof(StringList *)); if (svc[pnum] == NULL) - err(1, "Cannot allocate %zu bytes", PROTOMAX); + err(1, "Cannot allocate %zu bytes", + (size_t)PROTOMAX); } pindex = getprotoindex(sl, proto); @@ -282,11 +283,11 @@ parseservices(const char *fname, StringL /* build list of aliases */ if (sl_find(s, name) == NULL) { - char *p; + char *p2; - if ((p = strdup(name)) == NULL) + if ((p2 = strdup(name)) == NULL) err(1, "Cannot copy string"); - (void)sl_add(s, p); + (void)sl_add(s, p2); } if (aliases) { @@ -294,11 +295,11 @@ parseservices(const char *fname, StringL if (alias[0] == '\0') continue; if (sl_find(s, alias) == NULL) { - char *p; + char *p2; - if ((p = strdup(alias)) == NULL) + if ((p2 = strdup(alias)) == NULL) err(1, "Cannot copy string"); - (void)sl_add(s, p); + (void)sl_add(s, p2); } } } From owner-svn-src-stable-8@FreeBSD.ORG Sun Apr 18 04:35:16 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B749C106564A; Sun, 18 Apr 2010 04:35:16 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A572A8FC12; Sun, 18 Apr 2010 04:35:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3I4ZG3p071602; Sun, 18 Apr 2010 04:35:16 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3I4ZGWa071600; Sun, 18 Apr 2010 04:35:16 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201004180435.o3I4ZGWa071600@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 18 Apr 2010 04:35:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206786 - stable/8/sys/kern X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Apr 2010 04:35:16 -0000 Author: kib Date: Sun Apr 18 04:35:16 2010 New Revision: 206786 URL: http://svn.freebsd.org/changeset/base/206786 Log: MFC r206671: Fix typo. Modified: stable/8/sys/kern/vfs_cache.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/dev/uath/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/kern/vfs_cache.c ============================================================================== --- stable/8/sys/kern/vfs_cache.c Sun Apr 18 04:15:21 2010 (r206785) +++ stable/8/sys/kern/vfs_cache.c Sun Apr 18 04:35:16 2010 (r206786) @@ -610,7 +610,7 @@ cache_enter(dvp, vp, cnp) CTR3(KTR_VFS, "cache_enter(%p, %p, %s)", dvp, vp, cnp->cn_nameptr); VNASSERT(vp == NULL || (vp->v_iflag & VI_DOOMED) == 0, vp, - ("cahe_enter: Adding a doomed vnode")); + ("cache_enter: Adding a doomed vnode")); if (!doingcache) return; From owner-svn-src-stable-8@FreeBSD.ORG Sun Apr 18 10:29:27 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5EE3C106564A; Sun, 18 Apr 2010 10:29:27 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4D5A38FC14; Sun, 18 Apr 2010 10:29:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3IATR0x049930; Sun, 18 Apr 2010 10:29:27 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3IATQiq049925; Sun, 18 Apr 2010 10:29:26 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201004181029.o3IATQiq049925@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sun, 18 Apr 2010 10:29:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206788 - stable/8/share/man/man9 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Apr 2010 10:29:27 -0000 Author: trasz Date: Sun Apr 18 10:29:26 2010 New Revision: 206788 URL: http://svn.freebsd.org/changeset/base/206788 Log: MFC r205846: Fix references. Modified: stable/8/share/man/man9/ieee80211.9 stable/8/share/man/man9/ieee80211_crypto.9 stable/8/share/man/man9/ieee80211_node.9 stable/8/share/man/man9/ieee80211_output.9 stable/8/share/man/man9/ieee80211_scan.9 Directory Properties: stable/8/share/man/man9/ (props changed) Modified: stable/8/share/man/man9/ieee80211.9 ============================================================================== --- stable/8/share/man/man9/ieee80211.9 Sun Apr 18 04:49:07 2010 (r206787) +++ stable/8/share/man/man9/ieee80211.9 Sun Apr 18 10:29:26 2010 (r206788) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 4, 2009 +.Dd March 29, 2010 .Dt NET80211 9 .Os .Sh NAME @@ -551,11 +551,18 @@ Device supports Reduced Inter Frame Spac .Sh SEE ALSO .Xr ioctl 2 , .Xr ndis 4 , +.Xr ieee80211_amrr 9 , +.Xr ieee80211_beacon 9 , +.Xr ieee80211_bmiss 9 , +.Xr ieee80211_crypto 9 , +.Xr ieee80211_ddb 9 , .Xr ieee80211_input 9 , -.Xr ieee80211_input_all 9 , -.Xr ieee80211_scan_next 9 , -.Xr ieee80211_recv_action 9 , -.Xr ieee80211_send_action 9 , -.Xr ieee80211_radiotap_attach 9 , +.Xr ieee80211_node 9 , +.Xr ieee80211_output 9 , +.Xr ieee80211_proto 9 , +.Xr ieee80211_radiotap 9 , +.Xr ieee80211_regdomain 9 , +.Xr ieee80211_scan 9 , +.Xr ieee80211_vap 9 , .Xr ifnet 9 , .Xr malloc 9 Modified: stable/8/share/man/man9/ieee80211_crypto.9 ============================================================================== --- stable/8/share/man/man9/ieee80211_crypto.9 Sun Apr 18 04:49:07 2010 (r206787) +++ stable/8/share/man/man9/ieee80211_crypto.9 Sun Apr 18 10:29:26 2010 (r206788) @@ -27,7 +27,7 @@ .\" $FreeBSD$ .\" $Id: ieee80211_crypto.9,v 1.3 2004/03/04 10:42:56 bruce Exp $ .\" -.Dd August 4, 2009 +.Dd March 29, 2010 .Dt IEEE80211_CRYPTO 9 .Os .Sh NAME @@ -253,6 +253,7 @@ and These calls also synchronize hardware key state update when receive traffic is active. .Sh SEE ALSO +.Xr ieee80211 9 , .Xr ioctl 2 , .Xr wlan_ccmp 4 , .Xr wlan_tkip 4 , Modified: stable/8/share/man/man9/ieee80211_node.9 ============================================================================== --- stable/8/share/man/man9/ieee80211_node.9 Sun Apr 18 04:49:07 2010 (r206787) +++ stable/8/share/man/man9/ieee80211_node.9 Sun Apr 18 10:29:26 2010 (r206788) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 4, 2009 +.Dd March 29, 2010 .Dt IEEE80211_NODE 9 .Os .Sh NAME @@ -246,6 +246,6 @@ If the specified index is .Dv IEEE80211_KEYIX_NONE then a normal lookup is done without a table update. .Sh SEE ALSO -.Xr ddb 9 +.Xr ddb 9 , .Xr ieee80211 9 , .Xr ieee80211_proto 9 Modified: stable/8/share/man/man9/ieee80211_output.9 ============================================================================== --- stable/8/share/man/man9/ieee80211_output.9 Sun Apr 18 04:49:07 2010 (r206787) +++ stable/8/share/man/man9/ieee80211_output.9 Sun Apr 18 10:29:26 2010 (r206788) @@ -27,7 +27,7 @@ .\" $FreeBSD$ .\" $Id: ieee80211_output.9,v 1.5 2004/03/04 12:31:18 bruce Exp $ .\" -.Dd August 4, 2009 +.Dd March 29, 2010 .Dt IEEE80211_OUTPUT 9 .Os .Sh NAME @@ -189,6 +189,6 @@ a device may not report if an ACK frame transmit requests in its hardware and only report status on whether the frame was successfully queued. .Sh SEE ALSO -.Xr bpf 4 +.Xr bpf 4 , .Xr ieee80211 9 , .Xr ifnet 9 Modified: stable/8/share/man/man9/ieee80211_scan.9 ============================================================================== --- stable/8/share/man/man9/ieee80211_scan.9 Sun Apr 18 04:49:07 2010 (r206787) +++ stable/8/share/man/man9/ieee80211_scan.9 Sun Apr 18 10:29:26 2010 (r206788) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 20, 2010 +.Dd March 29, 2010 .Dt IEEE80211_SCAN 9 .Os .Sh NAME @@ -346,5 +346,5 @@ applications through the request. .Sh SEE ALSO .Xr ioctl 2 , -.Xr ieee80211 9 . +.Xr ieee80211 9 , .Xr ieee80211_proto 9 From owner-svn-src-stable-8@FreeBSD.ORG Sun Apr 18 10:36:50 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 484DA106564A; Sun, 18 Apr 2010 10:36:50 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 36A1C8FC1F; Sun, 18 Apr 2010 10:36:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3IAaoxK051627; Sun, 18 Apr 2010 10:36:50 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3IAaogr051625; Sun, 18 Apr 2010 10:36:50 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201004181036.o3IAaogr051625@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sun, 18 Apr 2010 10:36:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206789 - stable/8/share/man/man4 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Apr 2010 10:36:50 -0000 Author: trasz Date: Sun Apr 18 10:36:49 2010 New Revision: 206789 URL: http://svn.freebsd.org/changeset/base/206789 Log: MFC r201115: Line discipline support is gone; update tty(4) manual page to reflect this. Reviewed by: ed Modified: stable/8/share/man/man4/tty.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/tty.4 ============================================================================== --- stable/8/share/man/man4/tty.4 Sun Apr 18 10:29:26 2010 (r206788) +++ stable/8/share/man/man4/tty.4 Sun Apr 18 10:36:49 2010 (r206789) @@ -88,47 +88,6 @@ The remainder of this man page is concer with describing details of using and controlling terminal devices at a low level, such as that possibly required by a program wishing to provide features similar to those provided by the system. -.Ss Line disciplines -A terminal file is used like any other file in the system in that -it can be opened, read, and written to using standard system -calls. -For each existing terminal file, there is a software processing module -called a -.Em "line discipline" -is associated with it. -The -.Em "line discipline" -essentially glues the low level device driver code with the high -level generic interface routines (such as -.Xr read 2 -and -.Xr write 2 ) , -and is responsible for implementing the semantics associated -with the device. -When a terminal file is first opened by a program, the default -.Em "line discipline" -called the -.Dv termios -line discipline is associated with the file. -This is the primary -line discipline that is used in most cases and provides the semantics -that users normally associate with a terminal. -When the -.Dv termios -line discipline is in effect, the terminal file behaves and is -operated according to the rules described in -.Xr termios 4 . -Please refer to that man page for a full description of the terminal -semantics. -The operations described here -generally represent features common -across all -.Em "line disciplines" , -however some of these calls may not -make sense in conjunction with a line discipline other than -.Dv termios , -and some may not be supported by the underlying -hardware (or lack thereof, as in the case of ptys). .Ss Terminal File Operations All of the following operations are invoked using the .Xr ioctl 2 @@ -154,39 +113,24 @@ parameter (if any) are listed. For example, the first entry says .Pp -.D1 Em "TIOCSETD int *ldisc" +.D1 Em "TIOCSPGRP int *tpgrp" .Pp and would be called on the terminal associated with file descriptor zero by the following code fragment: .Bd -literal - int ldisc; + int pgrp; - ldisc = TTYDISC; - ioctl(0, TIOCSETD, &ldisc); + pgrp = getpgrp(); + ioctl(0, TIOCSPGRP, &pgrp); .Ed .Ss Terminal File Request Descriptions .Bl -tag -width TIOCGWINSZ .It Dv TIOCSETD Fa int *ldisc -Change to the new line discipline pointed to by +This call is obsolete but left for compatibility. +Before +.Fx 8.0 , +it would change to the new line discipline pointed to by .Fa ldisc . -The available line disciplines are listed in -.In sys/ttycom.h -and currently are: -.Pp -.Bl -tag -width NETGRAPHDISC -compact -.It TTYDISC -Termios interactive line discipline. -.It TABLDISC -Tablet line discipline. -.It SLIPDISC -Serial IP line discipline. -.It PPPDISC -PPP line discipline. -.It NETGRAPHDISC -Netgraph -.Xr ng_tty 4 -line discipline. -.El .Pp .It Dv TIOCGETD Fa int *ldisc Return the current line discipline in the integer pointed to by From owner-svn-src-stable-8@FreeBSD.ORG Sun Apr 18 10:38:17 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E8754106564A; Sun, 18 Apr 2010 10:38:17 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D77AB8FC08; Sun, 18 Apr 2010 10:38:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3IAcHpi051972; Sun, 18 Apr 2010 10:38:17 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3IAcH7R051970; Sun, 18 Apr 2010 10:38:17 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201004181038.o3IAcH7R051970@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sun, 18 Apr 2010 10:38:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206790 - stable/8/share/man/man4 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Apr 2010 10:38:18 -0000 Author: trasz Date: Sun Apr 18 10:38:17 2010 New Revision: 206790 URL: http://svn.freebsd.org/changeset/base/206790 Log: MFC r201114: Add references to termios-related stuff. Modified: stable/8/share/man/man4/termios.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/termios.4 ============================================================================== --- stable/8/share/man/man4/termios.4 Sun Apr 18 10:36:49 2010 (r206789) +++ stable/8/share/man/man4/termios.4 Sun Apr 18 10:38:17 2010 (r206790) @@ -1577,3 +1577,10 @@ after is set according to the values in the header .In sys/ttydefaults.h . +.Sh SEE ALSO +.Xr stty 1 , +.Xr tcgetsid 3 , +.Xr tcsendbreak 3 , +.Xr tcsetattr 3 , +.Xr tcsetsid 3 , +.Xr tty 4 From owner-svn-src-stable-8@FreeBSD.ORG Sun Apr 18 10:42:42 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7CD4F1065676; Sun, 18 Apr 2010 10:42:42 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6BA558FC2F; Sun, 18 Apr 2010 10:42:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3IAggXM053012; Sun, 18 Apr 2010 10:42:42 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3IAggK6053009; Sun, 18 Apr 2010 10:42:42 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201004181042.o3IAggK6053009@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sun, 18 Apr 2010 10:42:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206791 - stable/8/share/man/man4 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Apr 2010 10:42:42 -0000 Author: trasz Date: Sun Apr 18 10:42:42 2010 New Revision: 206791 URL: http://svn.freebsd.org/changeset/base/206791 Log: MFC r201118: Bump manual page dates. Modified: stable/8/share/man/man4/termios.4 stable/8/share/man/man4/tty.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/termios.4 ============================================================================== --- stable/8/share/man/man4/termios.4 Sun Apr 18 10:38:17 2010 (r206790) +++ stable/8/share/man/man4/termios.4 Sun Apr 18 10:42:42 2010 (r206791) @@ -32,7 +32,7 @@ .\" @(#)termios.4 8.4 (Berkeley) 4/19/94 .\" $FreeBSD$ .\" -.Dd August 20, 2008 +.Dd December 26, 2009 .Dt TERMIOS 4 .Os .Sh NAME Modified: stable/8/share/man/man4/tty.4 ============================================================================== --- stable/8/share/man/man4/tty.4 Sun Apr 18 10:38:17 2010 (r206790) +++ stable/8/share/man/man4/tty.4 Sun Apr 18 10:42:42 2010 (r206791) @@ -32,7 +32,7 @@ .\" @(#)tty.4 8.3 (Berkeley) 4/19/94 .\" $FreeBSD$ .\" -.Dd Jun 27, 2007 +.Dd December 26, 2009 .Dt TTY 4 .Os .Sh NAME From owner-svn-src-stable-8@FreeBSD.ORG Sun Apr 18 16:36:38 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 821811065674; Sun, 18 Apr 2010 16:36:38 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6F9BE8FC17; Sun, 18 Apr 2010 16:36:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3IGacdq033037; Sun, 18 Apr 2010 16:36:38 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3IGac8D033035; Sun, 18 Apr 2010 16:36:38 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201004181636.o3IGac8D033035@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sun, 18 Apr 2010 16:36:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206799 - stable/8/cddl/contrib/opensolaris/lib/libzfs/common X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Apr 2010 16:36:38 -0000 Author: trasz Date: Sun Apr 18 16:36:38 2010 New Revision: 206799 URL: http://svn.freebsd.org/changeset/base/206799 Log: MFC r197859: 'aclmode' and 'aclinherit' properties should work as advertised; don't refuse to set them. Modified: stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Directory Properties: stable/8/cddl/contrib/opensolaris/lib/libzfs/ (props changed) Modified: stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Sun Apr 18 12:50:26 2010 (r206798) +++ stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Sun Apr 18 16:36:38 2010 (r206799) @@ -1792,8 +1792,6 @@ zfs_prop_set(zfs_handle_t *zhp, const ch switch (prop) { case ZFS_PROP_SHAREISCSI: case ZFS_PROP_DEVICES: - case ZFS_PROP_ACLMODE: - case ZFS_PROP_ACLINHERIT: case ZFS_PROP_ISCSIOPTIONS: (void) snprintf(errbuf, sizeof (errbuf), "property '%s' not supported on FreeBSD", propname); From owner-svn-src-stable-8@FreeBSD.ORG Sun Apr 18 16:37:38 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D1807106566B; Sun, 18 Apr 2010 16:37:38 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BF36B8FC18; Sun, 18 Apr 2010 16:37:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3IGbc1K033313; Sun, 18 Apr 2010 16:37:38 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3IGbc0T033311; Sun, 18 Apr 2010 16:37:38 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201004181637.o3IGbc0T033311@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sun, 18 Apr 2010 16:37:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206800 - stable/8/cddl/contrib/opensolaris/lib/libzfs/common X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Apr 2010 16:37:38 -0000 Author: trasz Date: Sun Apr 18 16:37:38 2010 New Revision: 206800 URL: http://svn.freebsd.org/changeset/base/206800 Log: MFC r197867: Properly mark ZFS properties which are not changeable under FreeBSD. Reviewed by: pjd Modified: stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Directory Properties: stable/8/cddl/contrib/opensolaris/lib/libzfs/ (props changed) Modified: stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Sun Apr 18 16:36:38 2010 (r206799) +++ stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Sun Apr 18 16:37:38 2010 (r206800) @@ -1790,9 +1790,14 @@ zfs_prop_set(zfs_handle_t *zhp, const ch /* We don't support those properties on FreeBSD. */ switch (prop) { - case ZFS_PROP_SHAREISCSI: case ZFS_PROP_DEVICES: + case ZFS_PROP_ZONED: + case ZFS_PROP_SHAREISCSI: case ZFS_PROP_ISCSIOPTIONS: + case ZFS_PROP_XATTR: + case ZFS_PROP_VSCAN: + case ZFS_PROP_NBMAND: + case ZFS_PROP_SHARESMB: (void) snprintf(errbuf, sizeof (errbuf), "property '%s' not supported on FreeBSD", propname); ret = zfs_error(hdl, EZFS_PERM, errbuf); From owner-svn-src-stable-8@FreeBSD.ORG Sun Apr 18 19:21:08 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CD94A106566B; Sun, 18 Apr 2010 19:21:08 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B97B98FC13; Sun, 18 Apr 2010 19:21:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3IJL80l070039; Sun, 18 Apr 2010 19:21:08 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3IJL8eS070025; Sun, 18 Apr 2010 19:21:08 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201004181921.o3IJL8eS070025@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sun, 18 Apr 2010 19:21:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206804 - in stable/8: sbin/dumpfs sbin/mount sbin/tunefs sys/sys sys/ufs/ffs sys/ufs/ufs X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Apr 2010 19:21:08 -0000 Author: trasz Date: Sun Apr 18 19:21:08 2010 New Revision: 206804 URL: http://svn.freebsd.org/changeset/base/206804 Log: MFC r200796: Implement NFSv4 ACL support for UFS. Reviewed by: rwatson Modified: stable/8/sbin/dumpfs/dumpfs.c stable/8/sbin/mount/mntopts.h stable/8/sbin/mount/mount.8 stable/8/sbin/mount/mount.c stable/8/sbin/tunefs/tunefs.8 stable/8/sbin/tunefs/tunefs.c stable/8/sys/sys/mount.h stable/8/sys/ufs/ffs/ffs_vfsops.c stable/8/sys/ufs/ffs/fs.h stable/8/sys/ufs/ufs/acl.h stable/8/sys/ufs/ufs/ufs_acl.c stable/8/sys/ufs/ufs/ufs_lookup.c stable/8/sys/ufs/ufs/ufs_vnops.c Directory Properties: stable/8/sbin/dumpfs/ (props changed) stable/8/sbin/mount/ (props changed) stable/8/sbin/tunefs/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/dev/uath/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sbin/dumpfs/dumpfs.c ============================================================================== --- stable/8/sbin/dumpfs/dumpfs.c Sun Apr 18 18:43:36 2010 (r206803) +++ stable/8/sbin/dumpfs/dumpfs.c Sun Apr 18 19:21:08 2010 (r206804) @@ -251,8 +251,11 @@ dumpfs(const char *name) printf("gjournal "); if (fsflags & FS_FLAGS_UPDATED) printf("fs_flags expanded "); + if (fsflags & FS_NFS4ACLS) + printf("nfsv4acls "); fsflags &= ~(FS_UNCLEAN | FS_DOSOFTDEP | FS_NEEDSFSCK | FS_INDEXDIRS | - FS_ACLS | FS_MULTILABEL | FS_GJOURNAL | FS_FLAGS_UPDATED); + FS_ACLS | FS_MULTILABEL | FS_GJOURNAL | FS_FLAGS_UPDATED | + FS_NFS4ACLS); if (fsflags != 0) printf("unknown flags (%#x)", fsflags); putchar('\n'); Modified: stable/8/sbin/mount/mntopts.h ============================================================================== --- stable/8/sbin/mount/mntopts.h Sun Apr 18 18:43:36 2010 (r206803) +++ stable/8/sbin/mount/mntopts.h Sun Apr 18 19:21:08 2010 (r206804) @@ -54,6 +54,7 @@ struct mntopt { #define MOPT_SNAPSHOT { "snapshot", 0, MNT_SNAPSHOT, 0 } #define MOPT_MULTILABEL { "multilabel", 0, MNT_MULTILABEL, 0 } #define MOPT_ACLS { "acls", 0, MNT_ACLS, 0 } +#define MOPT_NFS4ACLS { "nfsv4acls", 0, MNT_NFS4ACLS, 0 } /* Control flags. */ #define MOPT_FORCE { "force", 0, MNT_FORCE, 0 } @@ -87,7 +88,8 @@ struct mntopt { MOPT_NOCLUSTERR, \ MOPT_NOCLUSTERW, \ MOPT_MULTILABEL, \ - MOPT_ACLS + MOPT_ACLS, \ + MOPT_NFS4ACLS void getmntopts(const char *, const struct mntopt *, int *, int *); void rmslashes(char *, char *); Modified: stable/8/sbin/mount/mount.8 ============================================================================== --- stable/8/sbin/mount/mount.8 Sun Apr 18 18:43:36 2010 (r206803) +++ stable/8/sbin/mount/mount.8 Sun Apr 18 19:21:08 2010 (r206804) @@ -120,11 +120,14 @@ takes effect. The following options are available: .Bl -tag -width indent .It Cm acls -Enable Access Control Lists, or ACLS, which can be customized via the +Enable POSIX.1e Access Control Lists, or ACLs, which can be customized via the .Xr setfacl 1 and .Xr getfacl 1 commands. +This flag is mutually exclusive with +.Cm nfsv4acls +flag. .It Cm async All .Tn I/O @@ -186,6 +189,15 @@ See .Xr mac 4 for more information, which cause the multilabel mount flag to be set automatically at mount-time. +.It Cm nfsv4acls +Enable NFSv4 ACLs, which can be customized via the +.Xr setfacl 1 +and +.Xr getfacl 1 +commands. +This flag is mutually exclusive with +.Cm acls +flag. .It Cm noasync Metadata I/O should be done synchronously, while data I/O should be done asynchronously. Modified: stable/8/sbin/mount/mount.c ============================================================================== --- stable/8/sbin/mount/mount.c Sun Apr 18 18:43:36 2010 (r206803) +++ stable/8/sbin/mount/mount.c Sun Apr 18 19:21:08 2010 (r206804) @@ -111,6 +111,7 @@ static struct opt { { MNT_SOFTDEP, "soft-updates" }, { MNT_MULTILABEL, "multilabel" }, { MNT_ACLS, "acls" }, + { MNT_NFS4ACLS, "nfsv4acls" }, { MNT_GJOURNAL, "gjournal" }, { 0, NULL } }; @@ -918,6 +919,7 @@ flags2opts(int flags) if (flags & MNT_SUIDDIR) res = catopt(res, "suiddir"); if (flags & MNT_MULTILABEL) res = catopt(res, "multilabel"); if (flags & MNT_ACLS) res = catopt(res, "acls"); + if (flags & MNT_NFS4ACLS) res = catopt(res, "nfsv4acls"); return (res); } Modified: stable/8/sbin/tunefs/tunefs.8 ============================================================================== --- stable/8/sbin/tunefs/tunefs.8 Sun Apr 18 18:43:36 2010 (r206803) +++ stable/8/sbin/tunefs/tunefs.8 Sun Apr 18 19:21:08 2010 (r206804) @@ -44,6 +44,7 @@ .Op Fl L Ar volname .Op Fl l Cm enable | disable .Op Fl m Ar minfree +.Op Fl N Cm enable | disable .Op Fl n Cm enable | disable .Op Fl o Cm space | time .Op Fl p @@ -70,7 +71,7 @@ this option will cause all backups to be primary super-block. This is potentially dangerous - use with caution. .It Fl a Cm enable | disable -Turn on/off the administrative ACL enable flag. +Turn on/off the administrative POSIX.1e ACL enable flag. .It Fl e Ar maxbpg Indicate the maximum number of blocks any single file can allocate out of a cylinder group before it is forced to begin @@ -114,6 +115,8 @@ factor of three over the performance obt If the value is raised above the current usage level, users will be unable to allocate files until enough files have been deleted to get under the higher threshold. +.It Fl N Cm enable | disable +Turn on/off the administrative NFSv4 ACL enable flag. .It Fl n Cm enable | disable Turn on/off soft updates. .It Fl o Cm space | time Modified: stable/8/sbin/tunefs/tunefs.c ============================================================================== --- stable/8/sbin/tunefs/tunefs.c Sun Apr 18 18:43:36 2010 (r206803) +++ stable/8/sbin/tunefs/tunefs.c Sun Apr 18 19:21:08 2010 (r206804) @@ -76,12 +76,12 @@ void printfs(void); int main(int argc, char *argv[]) { - char *avalue, *Jvalue, *Lvalue, *lvalue, *nvalue; + char *avalue, *Jvalue, *Lvalue, *lvalue, *Nvalue, *nvalue; const char *special, *on; const char *name; int active; int Aflag, aflag, eflag, evalue, fflag, fvalue, Jflag, Lflag, lflag; - int mflag, mvalue, nflag, oflag, ovalue, pflag, sflag, svalue; + int mflag, mvalue, Nflag, nflag, oflag, ovalue, pflag, sflag, svalue; int ch, found_arg, i; const char *chg[2]; struct ufs_args args; @@ -90,12 +90,12 @@ main(int argc, char *argv[]) if (argc < 3) usage(); Aflag = aflag = eflag = fflag = Jflag = Lflag = lflag = mflag = 0; - nflag = oflag = pflag = sflag = 0; - avalue = Jvalue = Lvalue = lvalue = nvalue = NULL; + Nflag = nflag = oflag = pflag = sflag = 0; + avalue = Jvalue = Lvalue = lvalue = Nvalue = nvalue = NULL; evalue = fvalue = mvalue = ovalue = svalue = 0; active = 0; found_arg = 0; /* At least one arg is required. */ - while ((ch = getopt(argc, argv, "Aa:e:f:J:L:l:m:n:o:ps:")) != -1) + while ((ch = getopt(argc, argv, "Aa:e:f:J:L:l:m:N:n:o:ps:")) != -1) switch (ch) { case 'A': @@ -105,7 +105,7 @@ main(int argc, char *argv[]) case 'a': found_arg = 1; - name = "ACLs"; + name = "POSIX.1e ACLs"; avalue = optarg; if (strcmp(avalue, "enable") && strcmp(avalue, "disable")) { @@ -187,6 +187,18 @@ main(int argc, char *argv[]) mflag = 1; break; + case 'N': + found_arg = 1; + name = "NFSv4 ACLs"; + Nvalue = optarg; + if (strcmp(Nvalue, "enable") && + strcmp(Nvalue, "disable")) { + errx(10, "bad %s (options are %s)", + name, "`enable' or `disable'"); + } + Nflag = 1; + break; + case 'n': found_arg = 1; name = "soft updates"; @@ -255,10 +267,13 @@ main(int argc, char *argv[]) strlcpy(sblock.fs_volname, Lvalue, MAXVOLLEN); } if (aflag) { - name = "ACLs"; + name = "POSIX.1e ACLs"; if (strcmp(avalue, "enable") == 0) { if (sblock.fs_flags & FS_ACLS) { warnx("%s remains unchanged as enabled", name); + } else if (sblock.fs_flags & FS_NFS4ACLS) { + warnx("%s and NFSv4 ACLs are mutually " + "exclusive", name); } else { sblock.fs_flags |= FS_ACLS; warnx("%s set", name); @@ -349,6 +364,29 @@ main(int argc, char *argv[]) warnx(OPTWARN, "space", "<", MINFREE); } } + if (Nflag) { + name = "NFSv4 ACLs"; + if (strcmp(Nvalue, "enable") == 0) { + if (sblock.fs_flags & FS_NFS4ACLS) { + warnx("%s remains unchanged as enabled", name); + } else if (sblock.fs_flags & FS_ACLS) { + warnx("%s and POSIX.1e ACLs are mutually " + "exclusive", name); + } else { + sblock.fs_flags |= FS_NFS4ACLS; + warnx("%s set", name); + } + } else if (strcmp(Nvalue, "disable") == 0) { + if ((~sblock.fs_flags & FS_NFS4ACLS) == + FS_NFS4ACLS) { + warnx("%s remains unchanged as disabled", + name); + } else { + sblock.fs_flags &= ~FS_NFS4ACLS; + warnx("%s cleared", name); + } + } + } if (nflag) { name = "soft updates"; if (strcmp(nvalue, "enable") == 0) { @@ -423,16 +461,18 @@ usage(void) fprintf(stderr, "%s\n%s\n%s\n%s\n", "usage: tunefs [-A] [-a enable | disable] [-e maxbpg] [-f avgfilesize]", " [-J enable | disable ] [-L volname] [-l enable | disable]", -" [-m minfree] [-n enable | disable] [-o space | time] [-p]", -" [-s avgfpdir] special | filesystem"); +" [-m minfree] [-N enable | disable] [-n enable | disable]", +" [-o space | time] [-p] [-s avgfpdir] special | filesystem"); exit(2); } void printfs(void) { - warnx("ACLs: (-a) %s", + warnx("POSIX.1e ACLs: (-a) %s", (sblock.fs_flags & FS_ACLS)? "enabled" : "disabled"); + warnx("NFSv4 ACLs: (-N) %s", + (sblock.fs_flags & FS_NFS4ACLS)? "enabled" : "disabled"); warnx("MAC multilabel: (-l) %s", (sblock.fs_flags & FS_MULTILABEL)? "enabled" : "disabled"); warnx("soft updates: (-n) %s", Modified: stable/8/sys/sys/mount.h ============================================================================== --- stable/8/sys/sys/mount.h Sun Apr 18 18:43:36 2010 (r206803) +++ stable/8/sys/sys/mount.h Sun Apr 18 19:21:08 2010 (r206804) @@ -239,6 +239,7 @@ void __mnt_vnode_markerfree(str #define MNT_NOATIME 0x10000000 /* disable update of file access time */ #define MNT_NOCLUSTERR 0x40000000 /* disable cluster read */ #define MNT_NOCLUSTERW 0x80000000 /* disable cluster write */ +#define MNT_NFS4ACLS 0x00000010 /* * NFS export related mount flags. @@ -274,7 +275,7 @@ void __mnt_vnode_markerfree(str MNT_ROOTFS | MNT_NOATIME | MNT_NOCLUSTERR| \ MNT_NOCLUSTERW | MNT_SUIDDIR | MNT_SOFTDEP | \ MNT_IGNORE | MNT_EXPUBLIC | MNT_NOSYMFOLLOW | \ - MNT_GJOURNAL | MNT_MULTILABEL | MNT_ACLS) + MNT_GJOURNAL | MNT_MULTILABEL | MNT_ACLS | MNT_NFS4ACLS) /* Mask of flags that can be updated. */ #define MNT_UPDATEMASK (MNT_NOSUID | MNT_NOEXEC | \ @@ -282,7 +283,7 @@ void __mnt_vnode_markerfree(str MNT_NOATIME | \ MNT_NOSYMFOLLOW | MNT_IGNORE | \ MNT_NOCLUSTERR | MNT_NOCLUSTERW | MNT_SUIDDIR | \ - MNT_ACLS | MNT_USER) + MNT_ACLS | MNT_USER | MNT_NFS4ACLS) /* * External filesystem command modifier flags. @@ -300,10 +301,6 @@ void __mnt_vnode_markerfree(str #define MNT_CMDFLAGS (MNT_UPDATE | MNT_DELEXPORT | MNT_RELOAD | \ MNT_FORCE | MNT_SNAPSHOT | MNT_BYFSID) /* - * Still available. - */ -#define MNT_SPARE_0x00000010 0x00000010 -/* * Internal filesystem control flags stored in mnt_kern_flag. * * MNTK_UNMOUNT locks the mount entry so that name lookup cannot proceed Modified: stable/8/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- stable/8/sys/ufs/ffs/ffs_vfsops.c Sun Apr 18 18:43:36 2010 (r206803) +++ stable/8/sys/ufs/ffs/ffs_vfsops.c Sun Apr 18 19:21:08 2010 (r206804) @@ -128,7 +128,7 @@ static struct buf_ops ffs_ops = { static const char *ffs_opts[] = { "acls", "async", "noatime", "noclusterr", "noclusterw", "noexec", "export", "force", "from", "multilabel", "snapshot", "nosuid", "suiddir", "nosymfollow", "sync", - "union", NULL }; + "union", "nfsv4acls", NULL }; static int ffs_mount(struct mount *mp) @@ -177,6 +177,15 @@ ffs_mount(struct mount *mp) vfs_deleteopt(mp->mnt_opt, "snapshot"); } + if (vfs_getopt(mp->mnt_optnew, "nfsv4acls", NULL, NULL) == 0) { + if (mntorflags & MNT_ACLS) { + printf("WARNING: \"acls\" and \"nfsv4acls\" " + "options are mutually exclusive\n"); + return (EINVAL); + } + mntorflags |= MNT_NFS4ACLS; + } + MNT_ILOCK(mp); mp->mnt_flag = (mp->mnt_flag | mntorflags) & ~mntandnotflags; MNT_IUNLOCK(mp); @@ -360,6 +369,13 @@ ffs_mount(struct mount *mp) MNT_IUNLOCK(mp); } + if ((fs->fs_flags & FS_NFS4ACLS) != 0) { + /* XXX: Set too late ? */ + MNT_ILOCK(mp); + mp->mnt_flag |= MNT_NFS4ACLS; + MNT_IUNLOCK(mp); + } + /* * If this is a snapshot request, take the snapshot. */ @@ -833,7 +849,13 @@ ffs_mountfs(devvp, mp, td) if ((fs->fs_flags & FS_ACLS) != 0) { #ifdef UFS_ACL MNT_ILOCK(mp); + + if (mp->mnt_flag & MNT_NFS4ACLS) + printf("WARNING: ACLs flag on fs conflicts with " + "\"nfsv4acls\" mount option; option ignored\n"); + mp->mnt_flag &= ~MNT_NFS4ACLS; mp->mnt_flag |= MNT_ACLS; + MNT_IUNLOCK(mp); #else printf( @@ -841,6 +863,24 @@ ffs_mountfs(devvp, mp, td) mp->mnt_stat.f_mntonname); #endif } + if ((fs->fs_flags & FS_NFS4ACLS) != 0) { +#ifdef UFS_ACL + MNT_ILOCK(mp); + + if (mp->mnt_flag & MNT_ACLS) + printf("WARNING: NFSv4 ACLs flag on fs conflicts with " + "\"acls\" mount option; option ignored\n"); + mp->mnt_flag &= ~MNT_ACLS; + mp->mnt_flag |= MNT_NFS4ACLS; + + MNT_IUNLOCK(mp); +#else + printf( +"WARNING: %s: NFSv4 ACLs flag on fs but no ACLs support\n", + mp->mnt_stat.f_mntonname); +#endif + } + ump->um_mountp = mp; ump->um_dev = dev; ump->um_devvp = devvp; Modified: stable/8/sys/ufs/ffs/fs.h ============================================================================== --- stable/8/sys/ufs/ffs/fs.h Sun Apr 18 18:43:36 2010 (r206803) +++ stable/8/sys/ufs/ffs/fs.h Sun Apr 18 19:21:08 2010 (r206804) @@ -393,22 +393,24 @@ CTASSERT(sizeof(struct fs) == 1376); * flag to indicate that the indicies need to be rebuilt (by fsck) before * they can be used. * - * FS_ACLS indicates that ACLs are administratively enabled for the - * file system, so they should be loaded from extended attributes, + * FS_ACLS indicates that POSIX.1e ACLs are administratively enabled + * for the file system, so they should be loaded from extended attributes, * observed for access control purposes, and be administered by object - * owners. FS_MULTILABEL indicates that the TrustedBSD MAC Framework - * should attempt to back MAC labels into extended attributes on the - * file system rather than maintain a single mount label for all - * objects. - */ -#define FS_UNCLEAN 0x01 /* filesystem not clean at mount */ -#define FS_DOSOFTDEP 0x02 /* filesystem using soft dependencies */ -#define FS_NEEDSFSCK 0x04 /* filesystem needs sync fsck before mount */ -#define FS_INDEXDIRS 0x08 /* kernel supports indexed directories */ -#define FS_ACLS 0x10 /* file system has ACLs enabled */ -#define FS_MULTILABEL 0x20 /* file system is MAC multi-label */ -#define FS_GJOURNAL 0x40 /* gjournaled file system */ -#define FS_FLAGS_UPDATED 0x80 /* flags have been moved to new location */ + * owners. FS_NFS4ACLS indicates that NFSv4 ACLs are administratively + * enabled. This flag is mutually exclusive with FS_ACLS. FS_MULTILABEL + * indicates that the TrustedBSD MAC Framework should attempt to back MAC + * labels into extended attributes on the file system rather than maintain + * a single mount label for all objects. + */ +#define FS_UNCLEAN 0x0001 /* filesystem not clean at mount */ +#define FS_DOSOFTDEP 0x0002 /* filesystem using soft dependencies */ +#define FS_NEEDSFSCK 0x0004 /* filesystem needs sync fsck before mount */ +#define FS_INDEXDIRS 0x0008 /* kernel supports indexed directories */ +#define FS_ACLS 0x0010 /* file system has POSIX.1e ACLs enabled */ +#define FS_MULTILABEL 0x0020 /* file system is MAC multi-label */ +#define FS_GJOURNAL 0x0040 /* gjournaled file system */ +#define FS_FLAGS_UPDATED 0x0080 /* flags have been moved to new location */ +#define FS_NFS4ACLS 0x0100 /* file system has NFSv4 ACLs enabled */ /* * Macros to access bits in the fs_active array. Modified: stable/8/sys/ufs/ufs/acl.h ============================================================================== --- stable/8/sys/ufs/ufs/acl.h Sun Apr 18 18:43:36 2010 (r206803) +++ stable/8/sys/ufs/ufs/acl.h Sun Apr 18 19:21:08 2010 (r206804) @@ -37,6 +37,8 @@ #ifdef _KERNEL +int ufs_getacl_nfs4_internal(struct vnode *vp, struct acl *aclp, struct thread *td); +int ufs_setacl_nfs4_internal(struct vnode *vp, struct acl *aclp, struct thread *td); void ufs_sync_acl_from_inode(struct inode *ip, struct acl *acl); void ufs_sync_inode_from_acl(struct acl *acl, struct inode *ip); Modified: stable/8/sys/ufs/ufs/ufs_acl.c ============================================================================== --- stable/8/sys/ufs/ufs/ufs_acl.c Sun Apr 18 18:43:36 2010 (r206803) +++ stable/8/sys/ufs/ufs/ufs_acl.c Sun Apr 18 19:21:08 2010 (r206804) @@ -141,6 +141,81 @@ ufs_sync_inode_from_acl(struct acl *acl, } /* + * Retrieve NFSv4 ACL, skipping access checks. Must be used in UFS code + * instead of VOP_GETACL() when we don't want to be restricted by the user + * not having ACL_READ_ACL permission, e.g. when calculating inherited ACL + * or in ufs_vnops.c:ufs_accessx(). + */ +int +ufs_getacl_nfs4_internal(struct vnode *vp, struct acl *aclp, struct thread *td) +{ + int error, len; + struct inode *ip = VTOI(vp); + + len = sizeof(*aclp); + bzero(aclp, len); + + error = vn_extattr_get(vp, IO_NODELOCKED, + NFS4_ACL_EXTATTR_NAMESPACE, NFS4_ACL_EXTATTR_NAME, + &len, (char *) aclp, td); + aclp->acl_maxcnt = ACL_MAX_ENTRIES; + if (error == ENOATTR) { + /* + * Legitimately no ACL set on object, purely + * emulate it through the inode. + */ + acl_nfs4_sync_acl_from_mode(aclp, ip->i_mode, ip->i_uid); + + return (0); + } + + if (error) + return (error); + + if (len != sizeof(*aclp)) { + /* + * A short (or long) read, meaning that for + * some reason the ACL is corrupted. Return + * EPERM since the object DAC protections + * are unsafe. + */ + printf("ufs_getacl_nfs4(): Loaded invalid ACL (" + "%d bytes), inumber %d on %s\n", len, + ip->i_number, ip->i_fs->fs_fsmnt); + + return (EPERM); + } + + error = acl_nfs4_check(aclp, vp->v_type == VDIR); + if (error) { + printf("ufs_getacl_nfs4(): Loaded invalid ACL " + "(failed acl_nfs4_check), inumber %d on %s\n", + ip->i_number, ip->i_fs->fs_fsmnt); + + return (EPERM); + } + + return (0); +} + +static int +ufs_getacl_nfs4(struct vop_getacl_args *ap) +{ + int error; + + if ((ap->a_vp->v_mount->mnt_flag & MNT_NFS4ACLS) == 0) + return (EINVAL); + + error = VOP_ACCESSX(ap->a_vp, VREAD_ACL, ap->a_td->td_ucred, ap->a_td); + if (error) + return (error); + + error = ufs_getacl_nfs4_internal(ap->a_vp, ap->a_aclp, ap->a_td); + + return (error); +} + +/* * Read POSIX.1e ACL from an EA. Return error if its not found * or if any other error has occured. */ @@ -209,7 +284,7 @@ ufs_getacl_posix1e(struct vop_getacl_arg * ACLs, remove this check. */ if ((ap->a_vp->v_mount->mnt_flag & MNT_ACLS) == 0) - return (EOPNOTSUPP); + return (EINVAL); old = malloc(sizeof(*old), M_ACL, M_WAITOK | M_ZERO); @@ -285,10 +360,118 @@ ufs_getacl(ap) } */ *ap; { + if ((ap->a_vp->v_mount->mnt_flag & (MNT_ACLS | MNT_NFS4ACLS)) == 0) + return (EOPNOTSUPP); + + if (ap->a_type == ACL_TYPE_NFS4) + return (ufs_getacl_nfs4(ap)); + return (ufs_getacl_posix1e(ap)); } /* + * Set NFSv4 ACL without doing any access checking. This is required + * e.g. by the UFS code that implements ACL inheritance, or from + * ufs_vnops.c:ufs_chmod(), as some of the checks have to be skipped + * in that case, and others are redundant. + */ +int +ufs_setacl_nfs4_internal(struct vnode *vp, struct acl *aclp, struct thread *td) +{ + int error; + mode_t mode; + struct inode *ip = VTOI(vp); + + KASSERT(acl_nfs4_check(aclp, vp->v_type == VDIR) == 0, + ("invalid ACL passed to ufs_setacl_nfs4_internal")); + + if (acl_nfs4_is_trivial(aclp, ip->i_uid)) { + error = vn_extattr_rm(vp, IO_NODELOCKED, + NFS4_ACL_EXTATTR_NAMESPACE, NFS4_ACL_EXTATTR_NAME, td); + + /* + * An attempt to remove ACL from a file that didn't have + * any extended entries is not an error. + */ + if (error == ENOATTR) + error = 0; + + } else { + error = vn_extattr_set(vp, IO_NODELOCKED, + NFS4_ACL_EXTATTR_NAMESPACE, NFS4_ACL_EXTATTR_NAME, + sizeof(*aclp), (char *) aclp, td); + } + + /* + * Map lack of attribute definition in UFS_EXTATTR into lack of + * support for ACLs on the filesystem. + */ + if (error == ENOATTR) + return (EOPNOTSUPP); + + if (error) + return (error); + + mode = ip->i_mode; + + acl_nfs4_sync_mode_from_acl(&mode, aclp); + + ip->i_mode &= ACL_PRESERVE_MASK; + ip->i_mode |= mode; + DIP_SET(ip, i_mode, ip->i_mode); + ip->i_flag |= IN_CHANGE; + + VN_KNOTE_UNLOCKED(vp, NOTE_ATTRIB); + + return (0); +} + +static int +ufs_setacl_nfs4(struct vop_setacl_args *ap) +{ + int error; + struct inode *ip = VTOI(ap->a_vp); + + if ((ap->a_vp->v_mount->mnt_flag & MNT_NFS4ACLS) == 0) + return (EINVAL); + + if (ap->a_vp->v_mount->mnt_flag & MNT_RDONLY) + return (EROFS); + + if (ap->a_aclp == NULL) + return (EINVAL); + + error = VOP_ACLCHECK(ap->a_vp, ap->a_type, ap->a_aclp, ap->a_cred, + ap->a_td); + if (error) + return (error); + + /* + * Authorize the ACL operation. + */ + if (ip->i_flags & (IMMUTABLE | APPEND)) + return (EPERM); + + /* + * Must hold VWRITE_ACL or have appropriate privilege. + */ + if ((error = VOP_ACCESSX(ap->a_vp, VWRITE_ACL, ap->a_cred, ap->a_td))) + return (error); + + /* + * With NFSv4 ACLs, chmod(2) may need to add additional entries. + * Make sure it has enough room for that - splitting every entry + * into two and appending "canonical six" entries at the end. + */ + if (ap->a_aclp->acl_cnt > (ACL_MAX_ENTRIES - 6) / 2) + return (ENOSPC); + + error = ufs_setacl_nfs4_internal(ap->a_vp, ap->a_aclp, ap->a_td); + + return (0); +} + +/* * Set the ACL on a file. * * As part of the ACL is stored in the inode, and the rest in an EA, @@ -305,7 +488,7 @@ ufs_setacl_posix1e(struct vop_setacl_arg struct oldacl *old; if ((ap->a_vp->v_mount->mnt_flag & MNT_ACLS) == 0) - return (EOPNOTSUPP); + return (EINVAL); /* * If this is a set operation rather than a delete operation, @@ -425,16 +608,43 @@ ufs_setacl(ap) struct thread *td; } */ *ap; { + if ((ap->a_vp->v_mount->mnt_flag & (MNT_ACLS | MNT_NFS4ACLS)) == 0) + return (EOPNOTSUPP); + + if (ap->a_type == ACL_TYPE_NFS4) + return (ufs_setacl_nfs4(ap)); return (ufs_setacl_posix1e(ap)); } static int +ufs_aclcheck_nfs4(struct vop_aclcheck_args *ap) +{ + int is_directory = 0; + + if ((ap->a_vp->v_mount->mnt_flag & MNT_NFS4ACLS) == 0) + return (EINVAL); + + /* + * With NFSv4 ACLs, chmod(2) may need to add additional entries. + * Make sure it has enough room for that - splitting every entry + * into two and appending "canonical six" entries at the end. + */ + if (ap->a_aclp->acl_cnt > (ACL_MAX_ENTRIES - 6) / 2) + return (ENOSPC); + + if (ap->a_vp->v_type == VDIR) + is_directory = 1; + + return (acl_nfs4_check(ap->a_aclp, is_directory)); +} + +static int ufs_aclcheck_posix1e(struct vop_aclcheck_args *ap) { if ((ap->a_vp->v_mount->mnt_flag & MNT_ACLS) == 0) - return (EOPNOTSUPP); + return (EINVAL); /* * Verify we understand this type of ACL, and that it applies @@ -474,6 +684,12 @@ ufs_aclcheck(ap) } */ *ap; { + if ((ap->a_vp->v_mount->mnt_flag & (MNT_ACLS | MNT_NFS4ACLS)) == 0) + return (EOPNOTSUPP); + + if (ap->a_type == ACL_TYPE_NFS4) + return (ufs_aclcheck_nfs4(ap)); + return (ufs_aclcheck_posix1e(ap)); } Modified: stable/8/sys/ufs/ufs/ufs_lookup.c ============================================================================== --- stable/8/sys/ufs/ufs/ufs_lookup.c Sun Apr 18 18:43:36 2010 (r206803) +++ stable/8/sys/ufs/ufs/ufs_lookup.c Sun Apr 18 19:21:08 2010 (r206804) @@ -80,6 +80,61 @@ SYSCTL_INT(_debug, OID_AUTO, dircheck, C static int ufs_lookup_(struct vnode *, struct vnode **, struct componentname *, ino_t *); +static int +ufs_delete_denied(struct vnode *vdp, struct vnode *tdp, struct ucred *cred, + struct thread *td) +{ + int error; + +#ifdef UFS_ACL + /* + * NFSv4 Minor Version 1, draft-ietf-nfsv4-minorversion1-03.txt + * + * 3.16.2.1. ACE4_DELETE vs. ACE4_DELETE_CHILD + */ + + /* + * XXX: Is this check required? + */ + error = VOP_ACCESS(vdp, VEXEC, cred, td); + if (error) + return (error); + + error = VOP_ACCESSX(tdp, VDELETE, cred, td); + if (error == 0) + return (0); + + error = VOP_ACCESSX(vdp, VDELETE_CHILD, cred, td); + if (error == 0) + return (0); + + error = VOP_ACCESSX(vdp, VEXPLICIT_DENY | VDELETE_CHILD, cred, td); + if (error) + return (error); + +#endif /* !UFS_ACL */ + + /* + * Standard Unix access control - delete access requires VWRITE. + */ + error = VOP_ACCESS(vdp, VWRITE, cred, td); + if (error) + return (error); + + /* + * If directory is "sticky", then user must own + * the directory, or the file in it, else she + * may not delete it (unless she's root). This + * implements append-only directories. + */ + if ((VTOI(vdp)->i_mode & ISVTX) && + VOP_ACCESS(vdp, VADMIN, cred, td) && + VOP_ACCESS(tdp, VADMIN, cred, td)) + return (EPERM); + + return (0); +} + /* * Convert a component of a pathname into a pointer to a locked inode. * This is a very central and rather complicated routine. @@ -410,8 +465,13 @@ notfound: /* * Access for write is interpreted as allowing * creation of files in the directory. + * + * XXX: Fix the comment above. */ - error = VOP_ACCESS(vdp, VWRITE, cred, cnp->cn_thread); + if (flags & WILLBEDIR) + error = VOP_ACCESSX(vdp, VWRITE | VAPPEND, cred, cnp->cn_thread); + else + error = VOP_ACCESS(vdp, VWRITE, cred, cnp->cn_thread); if (error) return (error); /* @@ -498,12 +558,17 @@ found: if (nameiop == DELETE && (flags & ISLASTCN)) { if (flags & LOCKPARENT) ASSERT_VOP_ELOCKED(vdp, __FUNCTION__); - /* - * Write access to directory required to delete files. - */ - error = VOP_ACCESS(vdp, VWRITE, cred, cnp->cn_thread); - if (error) + if ((error = VFS_VGET(vdp->v_mount, ino, + LK_EXCLUSIVE, &tdp)) != 0) return (error); + + error = ufs_delete_denied(vdp, tdp, cred, cnp->cn_thread); + if (error) { + vput(tdp); + return (error); + } + + /* * Return pointer to current entry in dp->i_offset, * and distance past previous entry (if there @@ -523,23 +588,10 @@ found: if (dp->i_number == ino) { VREF(vdp); *vpp = vdp; - return (0); - } - if ((error = VFS_VGET(vdp->v_mount, ino, - LK_EXCLUSIVE, &tdp)) != 0) - return (error); - /* - * If directory is "sticky", then user must own - * the directory, or the file in it, else she - * may not delete it (unless she's root). This - * implements append-only directories. - */ - if ((dp->i_mode & ISVTX) && - VOP_ACCESS(vdp, VADMIN, cred, cnp->cn_thread) && - VOP_ACCESS(tdp, VADMIN, cred, cnp->cn_thread)) { vput(tdp); - return (EPERM); + return (0); } + *vpp = tdp; return (0); } @@ -551,7 +603,11 @@ found: * regular file, or empty directory. */ if (nameiop == RENAME && (flags & ISLASTCN)) { - if ((error = VOP_ACCESS(vdp, VWRITE, cred, cnp->cn_thread))) + if (flags & WILLBEDIR) + error = VOP_ACCESSX(vdp, VWRITE | VAPPEND, cred, cnp->cn_thread); + else + error = VOP_ACCESS(vdp, VWRITE, cred, cnp->cn_thread); + if (error) return (error); /* * Careful about locking second inode. @@ -563,6 +619,33 @@ found: if ((error = VFS_VGET(vdp->v_mount, ino, LK_EXCLUSIVE, &tdp)) != 0) return (error); + + error = ufs_delete_denied(vdp, tdp, cred, cnp->cn_thread); + if (error) { + vput(tdp); + return (error); + } + +#ifdef SunOS_doesnt_do_that + /* + * The only purpose of this check is to return the correct + * error. Assume that we want to rename directory "a" + * to a file "b", and that we have no ACL_WRITE_DATA on + * a containing directory, but we _do_ have ACL_APPEND_DATA. + * In that case, the VOP_ACCESS check above will return 0, + * and the operation will fail with ENOTDIR instead + * of EACCESS. + */ + if (tdp->v_type == VDIR) + error = VOP_ACCESSX(vdp, VWRITE | VAPPEND, cred, cnp->cn_thread); + else + error = VOP_ACCESS(vdp, VWRITE, cred, cnp->cn_thread); + if (error) { + vput(tdp); + return (error); + } +#endif + *vpp = tdp; cnp->cn_flags |= SAVENAME; return (0); Modified: stable/8/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- stable/8/sys/ufs/ufs/ufs_vnops.c Sun Apr 18 18:43:36 2010 (r206803) +++ stable/8/sys/ufs/ufs/ufs_vnops.c Sun Apr 18 19:21:08 2010 (r206804) @@ -88,7 +88,7 @@ __FBSDID("$FreeBSD$"); #include -static vop_access_t ufs_access; +static vop_accessx_t ufs_accessx; static int ufs_chmod(struct vnode *, int, struct ucred *, struct thread *); static int ufs_chown(struct vnode *, uid_t, gid_t, struct ucred *, struct thread *); static vop_close_t ufs_close; @@ -298,8 +298,8 @@ ufs_close(ap) } static int -ufs_access(ap) - struct vop_access_args /* { +ufs_accessx(ap) + struct vop_accessx_args /* { struct vnode *a_vp; accmode_t a_accmode; struct ucred *a_cred; @@ -315,6 +315,7 @@ ufs_access(ap) #endif #ifdef UFS_ACL struct acl *acl; + acl_type_t type; #endif /* @@ -322,7 +323,7 @@ ufs_access(ap) * unless the file is a socket, fifo, or a block or * character device resident on the filesystem. */ - if (accmode & VWRITE) { + if (accmode & VMODIFY_PERMS) { switch (vp->v_type) { case VDIR: case VLNK: @@ -367,41 +368,63 @@ relock: } } - /* If immutable bit set, nobody gets to write it. */ - if ((accmode & VWRITE) && (ip->i_flags & (IMMUTABLE | SF_SNAPSHOT))) + /* + * If immutable bit set, nobody gets to write it. "& ~VADMIN_PERMS" + * is here, because without it, * it would be impossible for the owner + * to remove the IMMUTABLE flag. + */ + if ((accmode & (VMODIFY_PERMS & ~VADMIN_PERMS)) && + (ip->i_flags & (IMMUTABLE | SF_SNAPSHOT))) return (EPERM); #ifdef UFS_ACL - if ((vp->v_mount->mnt_flag & MNT_ACLS) != 0) { + if ((vp->v_mount->mnt_flag & (MNT_ACLS | MNT_NFS4ACLS)) != 0) { + if (vp->v_mount->mnt_flag & MNT_NFS4ACLS) + type = ACL_TYPE_NFS4; + else + type = ACL_TYPE_ACCESS; + acl = acl_alloc(M_WAITOK); - error = VOP_GETACL(vp, ACL_TYPE_ACCESS, acl, ap->a_cred, - ap->a_td); + if (type == ACL_TYPE_NFS4) + error = ufs_getacl_nfs4_internal(vp, acl, ap->a_td); + else + error = VOP_GETACL(vp, type, acl, ap->a_cred, ap->a_td); switch (error) { - case EOPNOTSUPP: - error = vaccess(vp->v_type, ip->i_mode, ip->i_uid, - ip->i_gid, ap->a_accmode, ap->a_cred, NULL); - break; case 0: - error = vaccess_acl_posix1e(vp->v_type, ip->i_uid, - ip->i_gid, acl, ap->a_accmode, ap->a_cred, NULL); + if (type == ACL_TYPE_NFS4) { + error = vaccess_acl_nfs4(vp->v_type, ip->i_uid, + ip->i_gid, acl, accmode, ap->a_cred, NULL); + } else { + error = vfs_unixify_accmode(&accmode); + if (error == 0) + error = vaccess_acl_posix1e(vp->v_type, ip->i_uid, + ip->i_gid, acl, accmode, ap->a_cred, NULL); + } break; default: - printf( -"ufs_access(): Error retrieving ACL on object (%d).\n", - error); + if (error != EOPNOTSUPP) + printf( +"ufs_accessx(): Error retrieving ACL on object (%d).\n", + error); /* * XXX: Fall back until debugged. Should * eventually possibly log an error, and return * EPERM for safety. */ - error = vaccess(vp->v_type, ip->i_mode, ip->i_uid, - ip->i_gid, ap->a_accmode, ap->a_cred, NULL); + error = vfs_unixify_accmode(&accmode); + if (error == 0) + error = vaccess(vp->v_type, ip->i_mode, ip->i_uid, + ip->i_gid, accmode, ap->a_cred, NULL); } acl_free(acl); - } else + + return (error); + } #endif /* !UFS_ACL */ + error = vfs_unixify_accmode(&accmode); + if (error == 0) error = vaccess(vp->v_type, ip->i_mode, ip->i_uid, ip->i_gid, - ap->a_accmode, ap->a_cred, NULL); + accmode, ap->a_cred, NULL); return (error); } @@ -608,11 +631,20 @@ ufs_setattr(ap) * check succeeds. */ if (vap->va_vaflags & VA_UTIMES_NULL) { - error = VOP_ACCESS(vp, VADMIN, cred, td); + /* + * NFSv4.1, draft 21, 6.2.1.3.1, Discussion of Mask Attributes + * + * "A user having ACL_WRITE_DATA or ACL_WRITE_ATTRIBUTES + * will be allowed to set the times [..] to the current *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-8@FreeBSD.ORG Sun Apr 18 19:40:53 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 42B4E1065670; Sun, 18 Apr 2010 19:40:53 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3088A8FC1B; Sun, 18 Apr 2010 19:40:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3IJerBV074406; Sun, 18 Apr 2010 19:40:53 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3IJerJi074405; Sun, 18 Apr 2010 19:40:53 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201004181940.o3IJerJi074405@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sun, 18 Apr 2010 19:40:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206805 - stable/8/tools/regression/acltools X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Apr 2010 19:40:53 -0000 Author: trasz Date: Sun Apr 18 19:40:52 2010 New Revision: 206805 URL: http://svn.freebsd.org/changeset/base/206805 Log: MFC r200811: Add regression test for NFSv4 ACLs on UFS. Added: stable/8/tools/regression/acltools/02.t - copied unchanged from r200811, head/tools/regression/acltools/02.t Modified: Directory Properties: stable/8/tools/regression/acltools/ (props changed) Copied: stable/8/tools/regression/acltools/02.t (from r200811, head/tools/regression/acltools/02.t) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/tools/regression/acltools/02.t Sun Apr 18 19:40:52 2010 (r206805, copy of r200811, head/tools/regression/acltools/02.t) @@ -0,0 +1,86 @@ +#!/bin/sh +# +# Copyright (c) 2008, 2009 Edward Tomasz Napierała +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +# This is a wrapper script to run tools-nfs4.test. +# +# If any of the tests fails, here is how to debug it: go to +# the directory with problematic filesystem mounted on it, +# and do /path/to/test run /path/to/test tools-nfs4.test, e.g. +# +# /usr/src/tools/regression/acltools/run /usr/src/tools/regression/acltools/tools-nfs4.test +# +# Output should be obvious. + +echo "1..4" + +if [ `whoami` != "root" ]; then + echo "not ok 1 - you need to be root to run this test." + exit 1 +fi + +TESTDIR=`dirname $0` + +# Set up the test filesystem. +MD=`mdconfig -at swap -s 10m` +MNT=`mktemp -dt acltools` +newfs /dev/$MD > /dev/null +mount -o nfsv4acls /dev/$MD $MNT +if [ $? -ne 0 ]; then + echo "not ok 1 - mount failed." + exit 1 +fi + +echo "ok 1" + +cd $MNT + +# First, check whether we can crash the kernel by creating too many +# entries. For some reason this won't work in the test file. +touch xxx +setfacl -x5 xxx +while :; do setfacl -a0 u:42:rwx:allow xxx 2> /dev/null; if [ $? -ne 0 ]; then break; fi; done +chmod 600 xxx +rm xxx +echo "ok 2" + +perl $TESTDIR/run $TESTDIR/tools-nfs4.test > /dev/null + +if [ $? -eq 0 ]; then + echo "ok 3" +else + echo "not ok 3" +fi + +cd / +umount -f $MNT +rmdir $MNT +mdconfig -du $MD + +echo "ok 4" + From owner-svn-src-stable-8@FreeBSD.ORG Sun Apr 18 19:44:54 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C12341065670; Sun, 18 Apr 2010 19:44:54 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AFD8B8FC23; Sun, 18 Apr 2010 19:44:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3IJis0c075355; Sun, 18 Apr 2010 19:44:54 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3IJisc6075353; Sun, 18 Apr 2010 19:44:54 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201004181944.o3IJisc6075353@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sun, 18 Apr 2010 19:44:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206806 - stable/8/sys/sys X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Apr 2010 19:44:54 -0000 Author: trasz Date: Sun Apr 18 19:44:54 2010 New Revision: 206806 URL: http://svn.freebsd.org/changeset/base/206806 Log: MFC r200829: Cosmetic fixes. Modified: stable/8/sys/sys/acl.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/dev/uath/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/sys/acl.h ============================================================================== --- stable/8/sys/sys/acl.h Sun Apr 18 19:40:52 2010 (r206805) +++ stable/8/sys/sys/acl.h Sun Apr 18 19:44:54 2010 (r206806) @@ -99,13 +99,13 @@ struct oldacl { * Current "struct acl". */ struct acl_entry { - acl_tag_t ae_tag; - uid_t ae_id; - acl_perm_t ae_perm; - /* "allow" or "deny". Unused in POSIX ACLs. */ + acl_tag_t ae_tag; + uid_t ae_id; + acl_perm_t ae_perm; + /* NFSv4 entry type, "allow" or "deny". Unused in POSIX.1e ACLs. */ acl_entry_type_t ae_entry_type; - /* Flags control inheritance. Unused in POSIX ACLs. */ - acl_flag_t ae_flags; + /* NFSv4 ACL inheritance. Unused in POSIX.1e ACLs. */ + acl_flag_t ae_flags; }; typedef struct acl_entry *acl_entry_t; From owner-svn-src-stable-8@FreeBSD.ORG Sun Apr 18 19:51:47 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4E83D106566B; Sun, 18 Apr 2010 19:51:47 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3D0188FC28; Sun, 18 Apr 2010 19:51:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3IJpl8e076922; Sun, 18 Apr 2010 19:51:47 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3IJplQn076920; Sun, 18 Apr 2010 19:51:47 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201004181951.o3IJplQn076920@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sun, 18 Apr 2010 19:51:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206807 - stable/8/sys/kern X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Apr 2010 19:51:47 -0000 Author: trasz Date: Sun Apr 18 19:51:46 2010 New Revision: 206807 URL: http://svn.freebsd.org/changeset/base/206807 Log: MFC r206160 by jh@: Add missing MNT_NFS4ACLS. Modified: stable/8/sys/kern/vfs_subr.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/dev/uath/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/kern/vfs_subr.c ============================================================================== --- stable/8/sys/kern/vfs_subr.c Sun Apr 18 19:44:54 2010 (r206806) +++ stable/8/sys/kern/vfs_subr.c Sun Apr 18 19:51:46 2010 (r206807) @@ -2799,6 +2799,7 @@ DB_SHOW_COMMAND(mount, db_show_mount) MNT_FLAG(MNT_NOATIME); MNT_FLAG(MNT_NOCLUSTERR); MNT_FLAG(MNT_NOCLUSTERW); + MNT_FLAG(MNT_NFS4ACLS); MNT_FLAG(MNT_EXRDONLY); MNT_FLAG(MNT_EXPORTED); MNT_FLAG(MNT_DEFEXPORTED); From owner-svn-src-stable-8@FreeBSD.ORG Sun Apr 18 20:23:08 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CEEF4106566B; Sun, 18 Apr 2010 20:23:08 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BD0A38FC0C; Sun, 18 Apr 2010 20:23:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3IKN8vt083892; Sun, 18 Apr 2010 20:23:08 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3IKN8gx083889; Sun, 18 Apr 2010 20:23:08 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201004182023.o3IKN8gx083889@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 18 Apr 2010 20:23:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206808 - in stable/8/sbin/ggate: ggated shared X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Apr 2010 20:23:08 -0000 Author: pjd Date: Sun Apr 18 20:23:08 2010 New Revision: 206808 URL: http://svn.freebsd.org/changeset/base/206808 Log: MFC r204075: Style nits. Modified: stable/8/sbin/ggate/ggated/ggated.c stable/8/sbin/ggate/shared/ggate.c Directory Properties: stable/8/sbin/ggate/ (props changed) Modified: stable/8/sbin/ggate/ggated/ggated.c ============================================================================== --- stable/8/sbin/ggate/ggated/ggated.c Sun Apr 18 19:51:46 2010 (r206807) +++ stable/8/sbin/ggate/ggated/ggated.c Sun Apr 18 20:23:08 2010 (r206808) @@ -10,7 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Modified: stable/8/sbin/ggate/shared/ggate.c ============================================================================== --- stable/8/sbin/ggate/shared/ggate.c Sun Apr 18 19:51:46 2010 (r206807) +++ stable/8/sbin/ggate/shared/ggate.c Sun Apr 18 20:23:08 2010 (r206808) @@ -10,7 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -159,7 +159,7 @@ g_gate_sectorsize(int fd) g_gate_xlog("fstat(): %s.", strerror(errno)); if (S_ISCHR(sb.st_mode)) { if (ioctl(fd, DIOCGSECTORSIZE, &secsize) == -1) { - g_gate_xlog("Can't get sector size: %s.", + g_gate_xlog("Can't get sector size: %s.", strerror(errno)); } } else if (S_ISREG(sb.st_mode)) { @@ -174,7 +174,7 @@ void g_gate_open_device(void) { - g_gate_devfd = open("/dev/" G_GATE_CTL_NAME, O_RDWR, 0); + g_gate_devfd = open("/dev/" G_GATE_CTL_NAME, O_RDWR); if (g_gate_devfd == -1) err(EXIT_FAILURE, "open(/dev/%s)", G_GATE_CTL_NAME); } @@ -281,7 +281,7 @@ g_gate_socket_settings(int sfd) /* Socket settings. */ on = 1; if (nagle) { - if (setsockopt(sfd, IPPROTO_TCP, TCP_NODELAY, &on, + if (setsockopt(sfd, IPPROTO_TCP, TCP_NODELAY, &on, sizeof(on)) == -1) { g_gate_xlog("setsockopt() error: %s.", strerror(errno)); } From owner-svn-src-stable-8@FreeBSD.ORG Sun Apr 18 20:34:47 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 38E60106566B; Sun, 18 Apr 2010 20:34:47 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 265DA8FC1C; Sun, 18 Apr 2010 20:34:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3IKYltU086532; Sun, 18 Apr 2010 20:34:47 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3IKYlA6086530; Sun, 18 Apr 2010 20:34:47 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201004182034.o3IKYlA6086530@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sun, 18 Apr 2010 20:34:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206809 - stable/8/sys/ufs/ufs X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Apr 2010 20:34:47 -0000 Author: trasz Date: Sun Apr 18 20:34:46 2010 New Revision: 206809 URL: http://svn.freebsd.org/changeset/base/206809 Log: MFC r202934: Move out code that does POSIX.1e ACL inheritance into separate routines. Reviewed by: rwatson Modified: stable/8/sys/ufs/ufs/ufs_vnops.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/dev/uath/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- stable/8/sys/ufs/ufs/ufs_vnops.c Sun Apr 18 20:23:08 2010 (r206808) +++ stable/8/sys/ufs/ufs/ufs_vnops.c Sun Apr 18 20:34:46 2010 (r206809) @@ -1471,6 +1471,163 @@ out: #ifdef UFS_ACL static int +ufs_do_posix1e_acl_inheritance_dir(struct vnode *dvp, struct vnode *tvp, + mode_t dmode, struct ucred *cred, struct thread *td) +{ + int error; + struct inode *ip = VTOI(tvp); + struct acl *dacl, *acl; + + acl = acl_alloc(M_WAITOK); + dacl = acl_alloc(M_WAITOK); + + /* + * Retrieve default ACL from parent, if any. + */ + error = VOP_GETACL(dvp, ACL_TYPE_DEFAULT, acl, cred, td); + switch (error) { + case 0: + /* + * Retrieved a default ACL, so merge mode and ACL if + * necessary. If the ACL is empty, fall through to + * the "not defined or available" case. + */ + if (acl->acl_cnt != 0) { + dmode = acl_posix1e_newfilemode(dmode, acl); + ip->i_mode = dmode; + DIP_SET(ip, i_mode, dmode); + *dacl = *acl; + ufs_sync_acl_from_inode(ip, acl); + break; + } + /* FALLTHROUGH */ + + case EOPNOTSUPP: + /* + * Just use the mode as-is. + */ + ip->i_mode = dmode; + DIP_SET(ip, i_mode, dmode); + error = 0; + goto out; + + default: + goto out; + } + + /* + * XXX: If we abort now, will Soft Updates notify the extattr + * code that the EAs for the file need to be released? + */ + error = VOP_SETACL(tvp, ACL_TYPE_ACCESS, acl, cred, td); + if (error == 0) + error = VOP_SETACL(tvp, ACL_TYPE_DEFAULT, dacl, cred, td); + switch (error) { + case 0: + break; + + case EOPNOTSUPP: + /* + * XXX: This should not happen, as EOPNOTSUPP above + * was supposed to free acl. + */ + printf("ufs_mkdir: VOP_GETACL() but no VOP_SETACL()\n"); + /* + panic("ufs_mkdir: VOP_GETACL() but no VOP_SETACL()"); + */ + break; + + default: + goto out; + } + +out: + acl_free(acl); + acl_free(dacl); + + return (error); +} + +static int +ufs_do_posix1e_acl_inheritance_file(struct vnode *dvp, struct vnode *tvp, + mode_t mode, struct ucred *cred, struct thread *td) +{ + int error; + struct inode *ip = VTOI(tvp); + struct acl *acl; + + acl = acl_alloc(M_WAITOK); + + /* + * Retrieve default ACL for parent, if any. + */ + error = VOP_GETACL(dvp, ACL_TYPE_DEFAULT, acl, cred, td); + switch (error) { + case 0: + /* + * Retrieved a default ACL, so merge mode and ACL if + * necessary. + */ + if (acl->acl_cnt != 0) { + /* + * Two possible ways for default ACL to not + * be present. First, the EA can be + * undefined, or second, the default ACL can + * be blank. If it's blank, fall through to + * the it's not defined case. + */ + mode = acl_posix1e_newfilemode(mode, acl); + ip->i_mode = mode; + DIP_SET(ip, i_mode, mode); + ufs_sync_acl_from_inode(ip, acl); + break; + } + /* FALLTHROUGH */ + + case EOPNOTSUPP: + /* + * Just use the mode as-is. + */ + ip->i_mode = mode; + DIP_SET(ip, i_mode, mode); + error = 0; + goto out; + + default: + goto out; + } + + /* + * XXX: If we abort now, will Soft Updates notify the extattr + * code that the EAs for the file need to be released? + */ + error = VOP_SETACL(tvp, ACL_TYPE_ACCESS, acl, cred, td); + switch (error) { + case 0: + break; + + case EOPNOTSUPP: + /* + * XXX: This should not happen, as EOPNOTSUPP above was + * supposed to free acl. + */ + printf("ufs_makeinode: VOP_GETACL() but no " + "VOP_SETACL()\n"); + /* panic("ufs_makeinode: VOP_GETACL() but no " + "VOP_SETACL()"); */ + break; + + default: + goto out; + } + +out: + acl_free(acl); + + return (error); +} + +static int ufs_do_nfs4_acl_inheritance(struct vnode *dvp, struct vnode *tvp, mode_t child_mode, struct ucred *cred, struct thread *td) { @@ -1516,9 +1673,6 @@ ufs_mkdir(ap) struct buf *bp; struct dirtemplate dirtemplate, *dtp; struct direct newdir; -#ifdef UFS_ACL - struct acl *acl, *dacl; -#endif int error, dmode; long blkoff; @@ -1607,59 +1761,8 @@ ufs_mkdir(ap) #endif #endif /* !SUIDDIR */ ip->i_flag |= IN_ACCESS | IN_CHANGE | IN_UPDATE; -#ifdef UFS_ACL - acl = dacl = NULL; - if ((dvp->v_mount->mnt_flag & MNT_ACLS) != 0) { - acl = acl_alloc(M_WAITOK); - dacl = acl_alloc(M_WAITOK); - - /* - * Retrieve default ACL from parent, if any. - */ - error = VOP_GETACL(dvp, ACL_TYPE_DEFAULT, acl, cnp->cn_cred, - cnp->cn_thread); - switch (error) { - case 0: - /* - * Retrieved a default ACL, so merge mode and ACL if - * necessary. If the ACL is empty, fall through to - * the "not defined or available" case. - */ - if (acl->acl_cnt != 0) { - dmode = acl_posix1e_newfilemode(dmode, acl); - ip->i_mode = dmode; - DIP_SET(ip, i_mode, dmode); - *dacl = *acl; - ufs_sync_acl_from_inode(ip, acl); - break; - } - /* FALLTHROUGH */ - - case EOPNOTSUPP: - /* - * Just use the mode as-is. - */ - ip->i_mode = dmode; - DIP_SET(ip, i_mode, dmode); - acl_free(acl); - acl_free(dacl); - dacl = acl = NULL; - break; - - default: - UFS_VFREE(tvp, ip->i_number, dmode); - vput(tvp); - acl_free(acl); - acl_free(dacl); - return (error); - } - } else { -#endif /* !UFS_ACL */ - ip->i_mode = dmode; - DIP_SET(ip, i_mode, dmode); -#ifdef UFS_ACL - } -#endif + ip->i_mode = dmode; + DIP_SET(ip, i_mode, dmode); tvp->v_type = VDIR; /* Rest init'd in getnewvnode(). */ ip->i_effnlink = 2; ip->i_nlink = 2; @@ -1694,43 +1797,12 @@ ufs_mkdir(ap) } #endif #ifdef UFS_ACL - if (acl != NULL) { - /* - * XXX: If we abort now, will Soft Updates notify the extattr - * code that the EAs for the file need to be released? - */ - error = VOP_SETACL(tvp, ACL_TYPE_ACCESS, acl, cnp->cn_cred, - cnp->cn_thread); - if (error == 0) - error = VOP_SETACL(tvp, ACL_TYPE_DEFAULT, dacl, - cnp->cn_cred, cnp->cn_thread); - switch (error) { - case 0: - break; - - case EOPNOTSUPP: - /* - * XXX: This should not happen, as EOPNOTSUPP above - * was supposed to free acl. - */ - printf("ufs_mkdir: VOP_GETACL() but no VOP_SETACL()\n"); - /* - panic("ufs_mkdir: VOP_GETACL() but no VOP_SETACL()"); - */ - break; - - default: - acl_free(acl); - acl_free(dacl); - dacl = acl = NULL; + if (dvp->v_mount->mnt_flag & MNT_ACLS) { + error = ufs_do_posix1e_acl_inheritance_dir(dvp, tvp, dmode, + cnp->cn_cred, cnp->cn_thread); + if (error) goto bad; - } - acl_free(acl); - acl_free(dacl); - dacl = acl = NULL; - } - - if (dvp->v_mount->mnt_flag & MNT_NFS4ACLS) { + } else if (dvp->v_mount->mnt_flag & MNT_NFS4ACLS) { error = ufs_do_nfs4_acl_inheritance(dvp, tvp, dmode, cnp->cn_cred, cnp->cn_thread); if (error) @@ -1797,12 +1869,6 @@ bad: if (error == 0) { *ap->a_vpp = tvp; } else { -#ifdef UFS_ACL - if (acl != NULL) - acl_free(acl); - if (dacl != NULL) - acl_free(dacl); -#endif dp->i_effnlink--; dp->i_nlink--; DIP_SET(dp, i_nlink, dp->i_nlink); @@ -2387,9 +2453,6 @@ ufs_makeinode(mode, dvp, vpp, cnp) struct inode *ip, *pdir; struct direct newdir; struct vnode *tvp; -#ifdef UFS_ACL - struct acl *acl; -#endif int error; pdir = VTOI(dvp); @@ -2469,62 +2532,8 @@ ufs_makeinode(mode, dvp, vpp, cnp) #endif #endif /* !SUIDDIR */ ip->i_flag |= IN_ACCESS | IN_CHANGE | IN_UPDATE; -#ifdef UFS_ACL - acl = NULL; - if ((dvp->v_mount->mnt_flag & MNT_ACLS) != 0) { - acl = acl_alloc(M_WAITOK); - - /* - * Retrieve default ACL for parent, if any. - */ - error = VOP_GETACL(dvp, ACL_TYPE_DEFAULT, acl, cnp->cn_cred, - cnp->cn_thread); - switch (error) { - case 0: - /* - * Retrieved a default ACL, so merge mode and ACL if - * necessary. - */ - if (acl->acl_cnt != 0) { - /* - * Two possible ways for default ACL to not - * be present. First, the EA can be - * undefined, or second, the default ACL can - * be blank. If it's blank, fall through to - * the it's not defined case. - */ - mode = acl_posix1e_newfilemode(mode, acl); - ip->i_mode = mode; - DIP_SET(ip, i_mode, mode); - ufs_sync_acl_from_inode(ip, acl); - break; - } - /* FALLTHROUGH */ - - case EOPNOTSUPP: - /* - * Just use the mode as-is. - */ - ip->i_mode = mode; - DIP_SET(ip, i_mode, mode); - acl_free(acl); - acl = NULL; - break; - - default: - UFS_VFREE(tvp, ip->i_number, mode); - vput(tvp); - acl_free(acl); - acl = NULL; - return (error); - } - } else { -#endif - ip->i_mode = mode; - DIP_SET(ip, i_mode, mode); -#ifdef UFS_ACL - } -#endif + ip->i_mode = mode; + DIP_SET(ip, i_mode, mode); tvp->v_type = IFTOVT(mode); /* Rest init'd in getnewvnode(). */ ip->i_effnlink = 1; ip->i_nlink = 1; @@ -2557,36 +2566,12 @@ ufs_makeinode(mode, dvp, vpp, cnp) } #endif #ifdef UFS_ACL - if (acl != NULL) { - /* - * XXX: If we abort now, will Soft Updates notify the extattr - * code that the EAs for the file need to be released? - */ - error = VOP_SETACL(tvp, ACL_TYPE_ACCESS, acl, cnp->cn_cred, - cnp->cn_thread); - switch (error) { - case 0: - break; - - case EOPNOTSUPP: - /* - * XXX: This should not happen, as EOPNOTSUPP above was - * supposed to free acl. - */ - printf("ufs_makeinode: VOP_GETACL() but no " - "VOP_SETACL()\n"); - /* panic("ufs_makeinode: VOP_GETACL() but no " - "VOP_SETACL()"); */ - break; - - default: - acl_free(acl); + if (dvp->v_mount->mnt_flag & MNT_ACLS) { + error = ufs_do_posix1e_acl_inheritance_file(dvp, tvp, mode, + cnp->cn_cred, cnp->cn_thread); + if (error) goto bad; - } - acl_free(acl); - } - - if (dvp->v_mount->mnt_flag & MNT_NFS4ACLS) { + } else if (dvp->v_mount->mnt_flag & MNT_NFS4ACLS) { error = ufs_do_nfs4_acl_inheritance(dvp, tvp, mode, cnp->cn_cred, cnp->cn_thread); if (error) From owner-svn-src-stable-8@FreeBSD.ORG Sun Apr 18 21:14:50 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1E0C4106566B; Sun, 18 Apr 2010 21:14:50 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 08D2A8FC1A; Sun, 18 Apr 2010 21:14:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3ILEoJb095444; Sun, 18 Apr 2010 21:14:50 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3ILEnUo095433; Sun, 18 Apr 2010 21:14:49 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201004182114.o3ILEnUo095433@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 18 Apr 2010 21:14:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206810 - in stable/8: etc/defaults etc/rc.d sbin sbin/ggate/ggatec sbin/ggate/ggatel sbin/hastctl sbin/hastd share/examples share/examples/hast share/man/man5 sys/geom/gate X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Apr 2010 21:14:50 -0000 Author: pjd Date: Sun Apr 18 21:14:49 2010 New Revision: 206810 URL: http://svn.freebsd.org/changeset/base/206810 Log: MFC r204076,r204077,r204083,r205279: r204076: Please welcome HAST - Highly Avalable Storage. HAST allows to transparently store data on two physically separated machines connected over the TCP/IP network. HAST works in Primary-Secondary (Master-Backup, Master-Slave) configuration, which means that only one of the cluster nodes can be active at any given time. Only Primary node is able to handle I/O requests to HAST-managed devices. Currently HAST is limited to two cluster nodes in total. HAST operates on block level - it provides disk-like devices in /dev/hast/ directory for use by file systems and/or applications. Working on block level makes it transparent for file systems and applications. There in no difference between using HAST-provided device and raw disk, partition, etc. All of them are just regular GEOM providers in FreeBSD. For more information please consult hastd(8), hastctl(8) and hast.conf(5) manual pages, as well as http://wiki.FreeBSD.org/HAST. Sponsored by: FreeBSD Foundation Sponsored by: OMCnet Internet Service GmbH Sponsored by: TransIP BV r204077: Remove some lines left over by accident. r204083: Add missing KEYWORD line. Pointed out by: dougb r205279 sys: Simplify loops. Added: stable/8/etc/rc.d/hastd - copied, changed from r204076, head/etc/rc.d/hastd stable/8/sbin/hastctl/ - copied from r204076, head/sbin/hastctl/ stable/8/sbin/hastd/ - copied from r204076, head/sbin/hastd/ stable/8/share/examples/hast/ - copied from r204076, head/share/examples/hast/ Modified: stable/8/etc/defaults/rc.conf stable/8/etc/rc.d/Makefile stable/8/sbin/Makefile stable/8/sbin/ggate/ggatec/ggatec.c stable/8/sbin/ggate/ggatel/ggatel.c stable/8/share/examples/Makefile stable/8/share/man/man5/rc.conf.5 stable/8/sys/geom/gate/g_gate.c stable/8/sys/geom/gate/g_gate.h Directory Properties: stable/8/etc/ (props changed) stable/8/sbin/ (props changed) stable/8/sbin/atacontrol/ (props changed) stable/8/sbin/bsdlabel/ (props changed) stable/8/sbin/camcontrol/ (props changed) stable/8/sbin/ddb/ (props changed) stable/8/sbin/devfs/ (props changed) stable/8/sbin/dhclient/ (props changed) stable/8/sbin/dump/ (props changed) stable/8/sbin/dumpfs/ (props changed) stable/8/sbin/fsck/ (props changed) stable/8/sbin/fsck_ffs/ (props changed) stable/8/sbin/geom/ (props changed) stable/8/sbin/geom/class/stripe/ (props changed) stable/8/sbin/ggate/ (props changed) stable/8/sbin/growfs/ (props changed) stable/8/sbin/ifconfig/ (props changed) stable/8/sbin/iscontrol/ (props changed) stable/8/sbin/mdconfig/ (props changed) stable/8/sbin/mksnap_ffs/ (props changed) stable/8/sbin/mount/ (props changed) stable/8/sbin/mount_cd9660/ (props changed) stable/8/sbin/mount_msdosfs/ (props changed) stable/8/sbin/mount_nfs/ (props changed) stable/8/sbin/natd/ (props changed) stable/8/sbin/newfs/ (props changed) stable/8/sbin/restore/ (props changed) stable/8/sbin/routed/ (props changed) stable/8/sbin/sysctl/ (props changed) stable/8/sbin/tunefs/ (props changed) stable/8/sbin/umount/ (props changed) stable/8/share/examples/ (props changed) stable/8/share/man/man5/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/dev/uath/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/etc/defaults/rc.conf ============================================================================== --- stable/8/etc/defaults/rc.conf Sun Apr 18 20:34:46 2010 (r206809) +++ stable/8/etc/defaults/rc.conf Sun Apr 18 21:14:49 2010 (r206810) @@ -258,6 +258,9 @@ syslogd_flags="-s" # Flags to syslogd ( inetd_enable="NO" # Run the network daemon dispatcher (YES/NO). inetd_program="/usr/sbin/inetd" # path to inetd, if you want a different one. inetd_flags="-wW -C 60" # Optional flags to inetd +hastd_enable="NO" # Run the HAST daemon (YES/NO). +hastd_program="/sbin/hastd" # path to hastd, if you want a different one. +hastd_flags="" # Optional flags to hastd. # # named. It may be possible to run named in a sandbox, man security for # details. Modified: stable/8/etc/rc.d/Makefile ============================================================================== --- stable/8/etc/rc.d/Makefile Sun Apr 18 20:34:46 2010 (r206809) +++ stable/8/etc/rc.d/Makefile Sun Apr 18 21:14:49 2010 (r206810) @@ -12,7 +12,7 @@ FILES= DAEMON FILESYSTEMS LOGIN NETWORKI encswap \ fsck ftp-proxy ftpd \ gbde geli geli2 gssd \ - hcsecd \ + hastd hcsecd \ hostapd hostid hostid_save hostname \ inetd initrandom \ ip6addrctl ipfilter ipfs ipfw ipmon \ Copied and modified: stable/8/etc/rc.d/hastd (from r204076, head/etc/rc.d/hastd) ============================================================================== --- head/etc/rc.d/hastd Thu Feb 18 23:16:19 2010 (r204076, copy source) +++ stable/8/etc/rc.d/hastd Sun Apr 18 21:14:49 2010 (r206810) @@ -6,6 +6,7 @@ # PROVIDE: hastd # REQUIRE: NETWORKING syslogd # BEFORE: DAEMON +# KEYWORD: nojail shutdown . /etc/rc.subr @@ -18,10 +19,6 @@ required_files="/etc/hast.conf" stop_precmd="hastd_stop_precmd" required_modules="geom_gate:g_gate" -sockfile="/var/run/syslogd.sockets" -evalargs="rc_flags=\"\`set_socketlist\` \$rc_flags\"" -altlog_proglist="named" - hastd_stop_precmd() { ${hastctl} role init all Modified: stable/8/sbin/Makefile ============================================================================== --- stable/8/sbin/Makefile Sun Apr 18 20:34:46 2010 (r206809) +++ stable/8/sbin/Makefile Sun Apr 18 21:14:49 2010 (r206810) @@ -36,6 +36,8 @@ SUBDIR= adjkerntz \ ggate \ growfs \ gvinum \ + hastctl \ + hastd \ ifconfig \ init \ ${_ipf} \ Modified: stable/8/sbin/ggate/ggatec/ggatec.c ============================================================================== --- stable/8/sbin/ggate/ggatec/ggatec.c Sun Apr 18 20:34:46 2010 (r206809) +++ stable/8/sbin/ggate/ggatec/ggatec.c Sun Apr 18 21:14:49 2010 (r206810) @@ -59,7 +59,7 @@ enum { UNSET, CREATE, DESTROY, LIST, RES static const char *path = NULL; static const char *host = NULL; -static int unit = -1; +static int unit = G_GATE_UNIT_AUTO; static unsigned flags = 0; static int force = 0; static unsigned queue_size = G_GATE_QUEUE_SIZE; Modified: stable/8/sbin/ggate/ggatel/ggatel.c ============================================================================== --- stable/8/sbin/ggate/ggatel/ggatel.c Sun Apr 18 20:34:46 2010 (r206809) +++ stable/8/sbin/ggate/ggatel/ggatel.c Sun Apr 18 21:14:49 2010 (r206810) @@ -50,7 +50,7 @@ enum { UNSET, CREATE, DESTROY, LIST, RESCUE } action = UNSET; static const char *path = NULL; -static int unit = -1; +static int unit = G_GATE_UNIT_AUTO; static unsigned flags = 0; static int force = 0; static unsigned queue_size = G_GATE_QUEUE_SIZE; Modified: stable/8/share/examples/Makefile ============================================================================== --- stable/8/share/examples/Makefile Sun Apr 18 20:34:46 2010 (r206809) +++ stable/8/share/examples/Makefile Sun Apr 18 21:14:49 2010 (r206810) @@ -13,6 +13,7 @@ LDIRS= BSD_daemon \ drivers \ etc \ find_interface \ + hast \ ibcs2 \ ipfw \ kld \ @@ -69,6 +70,11 @@ XFILES= BSD_daemon/FreeBSD.pfa \ find_interface/Makefile \ find_interface/README \ find_interface/find_interface.c \ + hast/ucarp.sh \ + hast/ucarp_down.sh \ + hast/ucarp_up.sh \ + hast/vip-down.sh \ + hast/vip-up.sh \ ibcs2/README \ ibcs2/hello.uu \ ipfw/change_rules.sh \ Modified: stable/8/share/man/man5/rc.conf.5 ============================================================================== --- stable/8/share/man/man5/rc.conf.5 Sun Apr 18 20:34:46 2010 (r206809) +++ stable/8/share/man/man5/rc.conf.5 Sun Apr 18 21:14:49 2010 (r206810) @@ -1645,6 +1645,27 @@ is set to .Dq Li YES , these are the flags to pass to .Xr inetd 8 . +.It Va hastd_enable +.Pq Vt bool +If set to +.Dq Li YES , +run the +.Xr hastd 8 +daemon. +.It Va hastd_program +.Pq Vt str +Path to +.Xr hastd 8 +(default +.Pa /sbin/hastd ) . +.It Va hastd_flags +.Pq Vt str +If +.Va hastd_enable +is set to +.Dq Li YES , +these are the flags to pass to +.Xr hastd 8 . .It Va named_enable .Pq Vt bool If set to Modified: stable/8/sys/geom/gate/g_gate.c ============================================================================== --- stable/8/sys/geom/gate/g_gate.c Sun Apr 18 20:34:46 2010 (r206809) +++ stable/8/sys/geom/gate/g_gate.c Sun Apr 18 21:14:49 2010 (r206810) @@ -1,7 +1,11 @@ /*- * Copyright (c) 2004-2006 Pawel Jakub Dawidek + * Copyright (c) 2009-2010 The FreeBSD Foundation * All rights reserved. * + * Portions of this software were developed by Pawel Jakub Dawidek + * under sponsorship from the FreeBSD Foundation. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -53,9 +57,14 @@ static MALLOC_DEFINE(M_GATE, "gg_data", SYSCTL_DECL(_kern_geom); SYSCTL_NODE(_kern_geom, OID_AUTO, gate, CTLFLAG_RW, 0, "GEOM_GATE stuff"); -static u_int g_gate_debug = 0; -SYSCTL_UINT(_kern_geom_gate, OID_AUTO, debug, CTLFLAG_RW, &g_gate_debug, 0, +static int g_gate_debug = 0; +TUNABLE_INT("kern.geom.gate.debug", &g_gate_debug); +SYSCTL_INT(_kern_geom_gate, OID_AUTO, debug, CTLFLAG_RW, &g_gate_debug, 0, "Debug level"); +static u_int g_gate_maxunits = 256; +TUNABLE_INT("kern.geom.gate.maxunits", &g_gate_maxunits); +SYSCTL_UINT(_kern_geom_gate, OID_AUTO, maxunits, CTLFLAG_RDTUN, + &g_gate_maxunits, 0, "Maximum number of ggate devices"); struct g_class g_gate_class = { .name = G_GATE_CLASS_NAME, @@ -71,10 +80,9 @@ static struct cdevsw g_gate_cdevsw = { }; -static LIST_HEAD(, g_gate_softc) g_gate_list = - LIST_HEAD_INITIALIZER(g_gate_list); -static struct mtx g_gate_list_mtx; - +static struct g_gate_softc **g_gate_units; +static u_int g_gate_nunits; +static struct mtx g_gate_units_lock; static int g_gate_destroy(struct g_gate_softc *sc, boolean_t force) @@ -84,13 +92,13 @@ g_gate_destroy(struct g_gate_softc *sc, struct bio *bp; g_topology_assert(); - mtx_assert(&g_gate_list_mtx, MA_OWNED); + mtx_assert(&g_gate_units_lock, MA_OWNED); pp = sc->sc_provider; if (!force && (pp->acr != 0 || pp->acw != 0 || pp->ace != 0)) { - mtx_unlock(&g_gate_list_mtx); + mtx_unlock(&g_gate_units_lock); return (EBUSY); } - mtx_unlock(&g_gate_list_mtx); + mtx_unlock(&g_gate_units_lock); mtx_lock(&sc->sc_queue_mtx); if ((sc->sc_flags & G_GATE_FLAG_DESTROY) == 0) sc->sc_flags |= G_GATE_FLAG_DESTROY; @@ -101,38 +109,29 @@ g_gate_destroy(struct g_gate_softc *sc, g_orphan_provider(pp, ENXIO); callout_drain(&sc->sc_callout); mtx_lock(&sc->sc_queue_mtx); - for (;;) { - bp = bioq_first(&sc->sc_inqueue); - if (bp != NULL) { - bioq_remove(&sc->sc_inqueue, bp); - sc->sc_queue_count--; - G_GATE_LOGREQ(1, bp, "Request canceled."); - g_io_deliver(bp, ENXIO); - } else { - break; - } + while ((bp = bioq_first(&sc->sc_inqueue)) != NULL) { + bioq_remove(&sc->sc_inqueue, bp); + sc->sc_queue_count--; + G_GATE_LOGREQ(1, bp, "Request canceled."); + g_io_deliver(bp, ENXIO); } - for (;;) { - bp = bioq_first(&sc->sc_outqueue); - if (bp != NULL) { - bioq_remove(&sc->sc_outqueue, bp); - sc->sc_queue_count--; - G_GATE_LOGREQ(1, bp, "Request canceled."); - g_io_deliver(bp, ENXIO); - } else { - break; - } + while ((bp = bioq_first(&sc->sc_outqueue)) != NULL) { + bioq_remove(&sc->sc_outqueue, bp); + sc->sc_queue_count--; + G_GATE_LOGREQ(1, bp, "Request canceled."); + g_io_deliver(bp, ENXIO); } mtx_unlock(&sc->sc_queue_mtx); g_topology_unlock(); - mtx_lock(&g_gate_list_mtx); + mtx_lock(&g_gate_units_lock); /* One reference is ours. */ sc->sc_ref--; - while (sc->sc_ref > 0) { - msleep(&sc->sc_ref, &g_gate_list_mtx, 0, "gg:destroy", 0); - } - LIST_REMOVE(sc, sc_next); - mtx_unlock(&g_gate_list_mtx); + while (sc->sc_ref > 0) + msleep(&sc->sc_ref, &g_gate_units_lock, 0, "gg:destroy", 0); + g_gate_units[sc->sc_unit] = NULL; + KASSERT(g_gate_nunits > 0, ("negative g_gate_nunits?")); + g_gate_nunits--; + mtx_unlock(&g_gate_units_lock); mtx_destroy(&sc->sc_queue_mtx); g_topology_lock(); G_GATE_DEBUG(0, "Device %s destroyed.", gp->name); @@ -196,7 +195,7 @@ g_gate_start(struct bio *bp) if (sc->sc_queue_count > sc->sc_queue_size) { mtx_unlock(&sc->sc_queue_mtx); G_GATE_LOGREQ(1, bp, "Queue full, request canceled."); - g_io_deliver(bp, EIO); + g_io_deliver(bp, ENOMEM); return; } @@ -211,18 +210,29 @@ g_gate_start(struct bio *bp) } static struct g_gate_softc * -g_gate_hold(u_int unit) +g_gate_hold(u_int unit, const char *name) { - struct g_gate_softc *sc; + struct g_gate_softc *sc = NULL; - mtx_lock(&g_gate_list_mtx); - LIST_FOREACH(sc, &g_gate_list, sc_next) { - if (sc->sc_unit == unit) + mtx_lock(&g_gate_units_lock); + if (unit >= 0 && unit < g_gate_maxunits) + sc = g_gate_units[unit]; + else if (unit == G_GATE_NAME_GIVEN) { + KASSERT(name != NULL, ("name is NULL")); + for (unit = 0; unit < g_gate_maxunits; unit++) { + if (g_gate_units[unit] == NULL) + continue; + if (strcmp(name, + g_gate_units[unit]->sc_provider->name) != 0) { + continue; + } + sc = g_gate_units[unit]; break; + } } if (sc != NULL) sc->sc_ref++; - mtx_unlock(&g_gate_list_mtx); + mtx_unlock(&g_gate_units_lock); return (sc); } @@ -231,40 +241,34 @@ g_gate_release(struct g_gate_softc *sc) { g_topology_assert_not(); - mtx_lock(&g_gate_list_mtx); + mtx_lock(&g_gate_units_lock); sc->sc_ref--; KASSERT(sc->sc_ref >= 0, ("Negative sc_ref for %s.", sc->sc_name)); - if (sc->sc_ref == 0 && (sc->sc_flags & G_GATE_FLAG_DESTROY) != 0) { + if (sc->sc_ref == 0 && (sc->sc_flags & G_GATE_FLAG_DESTROY) != 0) wakeup(&sc->sc_ref); - mtx_unlock(&g_gate_list_mtx); - } else { - mtx_unlock(&g_gate_list_mtx); - } + mtx_unlock(&g_gate_units_lock); } static int -g_gate_getunit(int unit) +g_gate_getunit(int unit, int *errorp) { - struct g_gate_softc *sc; - mtx_assert(&g_gate_list_mtx, MA_OWNED); + mtx_assert(&g_gate_units_lock, MA_OWNED); if (unit >= 0) { - LIST_FOREACH(sc, &g_gate_list, sc_next) { - if (sc->sc_unit == unit) - return (-1); - } + if (unit >= g_gate_maxunits) + *errorp = EINVAL; + else if (g_gate_units[unit] == NULL) + return (unit); + else + *errorp = EEXIST; } else { - unit = 0; -once_again: - LIST_FOREACH(sc, &g_gate_list, sc_next) { - if (sc->sc_unit == unit) { - if (++unit > 666) - return (-1); - goto once_again; - } + for (unit = 0; unit < g_gate_maxunits; unit++) { + if (g_gate_units[unit] == NULL) + return (unit); } + *errorp = ENFILE; } - return (unit); + return (-1); } static void @@ -276,7 +280,7 @@ g_gate_guard(void *arg) sc = arg; binuptime(&curtime); - g_gate_hold(sc->sc_unit); + g_gate_hold(sc->sc_unit, NULL); mtx_lock(&sc->sc_queue_mtx); TAILQ_FOREACH_SAFE(bp, &sc->sc_inqueue.queue, bio_queue, bp2) { if (curtime.sec - bp->bio_t0.sec < 5) @@ -311,7 +315,7 @@ g_gate_dumpconf(struct sbuf *sb, const c sc = gp->softc; if (sc == NULL || pp != NULL || cp != NULL) return; - g_gate_hold(sc->sc_unit); + g_gate_hold(sc->sc_unit, NULL); if ((sc->sc_flags & G_GATE_FLAG_READONLY) != 0) { sbuf_printf(sb, "%s%s\n", indent, "read-only"); } else if ((sc->sc_flags & G_GATE_FLAG_WRITEONLY) != 0) { @@ -328,6 +332,7 @@ g_gate_dumpconf(struct sbuf *sb, const c sbuf_printf(sb, "%s%u\n", indent, sc->sc_queue_size); sbuf_printf(sb, "%s%u\n", indent, sc->sc_ref); + sbuf_printf(sb, "%s%d\n", indent, sc->sc_unit); g_topology_unlock(); g_gate_release(sc); g_topology_lock(); @@ -339,6 +344,8 @@ g_gate_create(struct g_gate_ctl_create * struct g_gate_softc *sc; struct g_geom *gp; struct g_provider *pp; + char name[NAME_MAX]; + int error = 0, unit; if (ggio->gctl_mediasize == 0) { G_GATE_DEBUG(1, "Invalid media size."); @@ -357,15 +364,22 @@ g_gate_create(struct g_gate_ctl_create * G_GATE_DEBUG(1, "Invalid flags."); return (EINVAL); } - if (ggio->gctl_unit < -1) { + if (ggio->gctl_unit != G_GATE_UNIT_AUTO && + ggio->gctl_unit != G_GATE_NAME_GIVEN && + ggio->gctl_unit < 0) { G_GATE_DEBUG(1, "Invalid unit number."); return (EINVAL); } + if (ggio->gctl_unit == G_GATE_NAME_GIVEN && + ggio->gctl_name[0] == '\0') { + G_GATE_DEBUG(1, "No device name."); + return (EINVAL); + } sc = malloc(sizeof(*sc), M_GATE, M_WAITOK | M_ZERO); sc->sc_flags = (ggio->gctl_flags & G_GATE_USERFLAGS); strlcpy(sc->sc_info, ggio->gctl_info, sizeof(sc->sc_info)); - sc->sc_seq = 0; + sc->sc_seq = 1; bioq_init(&sc->sc_inqueue); bioq_init(&sc->sc_outqueue); mtx_init(&sc->sc_queue_mtx, "gg:queue", NULL, MTX_DEF); @@ -375,26 +389,44 @@ g_gate_create(struct g_gate_ctl_create * sc->sc_queue_size = G_GATE_MAX_QUEUE_SIZE; sc->sc_timeout = ggio->gctl_timeout; callout_init(&sc->sc_callout, CALLOUT_MPSAFE); - mtx_lock(&g_gate_list_mtx); - ggio->gctl_unit = g_gate_getunit(ggio->gctl_unit); - if (ggio->gctl_unit == -1) { - mtx_unlock(&g_gate_list_mtx); + mtx_lock(&g_gate_units_lock); + sc->sc_unit = g_gate_getunit(ggio->gctl_unit, &error); + if (sc->sc_unit < 0) { + mtx_unlock(&g_gate_units_lock); mtx_destroy(&sc->sc_queue_mtx); free(sc, M_GATE); - return (EBUSY); + return (error); } - sc->sc_unit = ggio->gctl_unit; - LIST_INSERT_HEAD(&g_gate_list, sc, sc_next); - mtx_unlock(&g_gate_list_mtx); + if (ggio->gctl_unit == G_GATE_NAME_GIVEN) + snprintf(name, sizeof(name), "%s", ggio->gctl_name); + else { + snprintf(name, sizeof(name), "%s%d", G_GATE_PROVIDER_NAME, + sc->sc_unit); + } + /* Check for name collision. */ + for (unit = 0; unit < g_gate_maxunits; unit++) { + if (g_gate_units[unit] == NULL) + continue; + if (strcmp(name, g_gate_units[unit]->sc_provider->name) != 0) + continue; + mtx_unlock(&g_gate_units_lock); + mtx_destroy(&sc->sc_queue_mtx); + free(sc, M_GATE); + return (EEXIST); + } + g_gate_units[sc->sc_unit] = sc; + g_gate_nunits++; + mtx_unlock(&g_gate_units_lock); + + ggio->gctl_unit = sc->sc_unit; g_topology_lock(); - gp = g_new_geomf(&g_gate_class, "%s%d", G_GATE_PROVIDER_NAME, - sc->sc_unit); + gp = g_new_geomf(&g_gate_class, "%s", name); gp->start = g_gate_start; gp->access = g_gate_access; gp->dumpconf = g_gate_dumpconf; gp->softc = sc; - pp = g_new_providerf(gp, "%s%d", G_GATE_PROVIDER_NAME, sc->sc_unit); + pp = g_new_providerf(gp, "%s", name); pp->mediasize = ggio->gctl_mediasize; pp->sectorsize = ggio->gctl_sectorsize; sc->sc_provider = pp; @@ -446,11 +478,11 @@ g_gate_ioctl(struct cdev *dev, u_long cm struct g_gate_ctl_destroy *ggio = (void *)addr; G_GATE_CHECK_VERSION(ggio); - sc = g_gate_hold(ggio->gctl_unit); + sc = g_gate_hold(ggio->gctl_unit, ggio->gctl_name); if (sc == NULL) return (ENXIO); g_topology_lock(); - mtx_lock(&g_gate_list_mtx); + mtx_lock(&g_gate_units_lock); error = g_gate_destroy(sc, ggio->gctl_force); g_topology_unlock(); if (error != 0) @@ -463,7 +495,7 @@ g_gate_ioctl(struct cdev *dev, u_long cm struct bio *tbp, *lbp; G_GATE_CHECK_VERSION(ggio); - sc = g_gate_hold(ggio->gctl_unit); + sc = g_gate_hold(ggio->gctl_unit, ggio->gctl_name); if (sc == NULL) return (ENXIO); lbp = NULL; @@ -491,6 +523,8 @@ g_gate_ioctl(struct cdev *dev, u_long cm break; } } + if (ggio->gctl_unit == G_GATE_NAME_GIVEN) + ggio->gctl_unit = sc->sc_unit; mtx_unlock(&sc->sc_queue_mtx); g_gate_release(sc); return (error); @@ -500,7 +534,7 @@ g_gate_ioctl(struct cdev *dev, u_long cm struct g_gate_ctl_io *ggio = (void *)addr; G_GATE_CHECK_VERSION(ggio); - sc = g_gate_hold(ggio->gctl_unit); + sc = g_gate_hold(ggio->gctl_unit, NULL); if (sc == NULL) return (ENXIO); error = 0; @@ -561,7 +595,7 @@ start_end: struct g_gate_ctl_io *ggio = (void *)addr; G_GATE_CHECK_VERSION(ggio); - sc = g_gate_hold(ggio->gctl_unit); + sc = g_gate_hold(ggio->gctl_unit, NULL); if (sc == NULL) return (ENOENT); error = 0; @@ -631,20 +665,24 @@ g_gate_modevent(module_t mod, int type, switch (type) { case MOD_LOAD: - mtx_init(&g_gate_list_mtx, "gg_list_lock", NULL, MTX_DEF); + mtx_init(&g_gate_units_lock, "gg_units_lock", NULL, MTX_DEF); + g_gate_units = malloc(g_gate_maxunits * sizeof(g_gate_units[0]), + M_GATE, M_WAITOK | M_ZERO); + g_gate_nunits = 0; g_gate_device(); break; case MOD_UNLOAD: - mtx_lock(&g_gate_list_mtx); - if (!LIST_EMPTY(&g_gate_list)) { - mtx_unlock(&g_gate_list_mtx); + mtx_lock(&g_gate_units_lock); + if (g_gate_nunits > 0) { + mtx_unlock(&g_gate_units_lock); error = EBUSY; break; } - mtx_unlock(&g_gate_list_mtx); - mtx_destroy(&g_gate_list_mtx); + mtx_unlock(&g_gate_units_lock); + mtx_destroy(&g_gate_units_lock); if (status_dev != 0) destroy_dev(status_dev); + free(g_gate_units, M_GATE); break; default: return (EOPNOTSUPP); Modified: stable/8/sys/geom/gate/g_gate.h ============================================================================== --- stable/8/sys/geom/gate/g_gate.h Sun Apr 18 20:34:46 2010 (r206809) +++ stable/8/sys/geom/gate/g_gate.h Sun Apr 18 21:14:49 2010 (r206810) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2004-2006 Pawel Jakub Dawidek + * Copyright (c) 2004-2009 Pawel Jakub Dawidek * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -41,7 +41,7 @@ #define G_GATE_MOD_NAME "ggate" #define G_GATE_CTL_NAME "ggctl" -#define G_GATE_VERSION 1 +#define G_GATE_VERSION 2 /* * Maximum number of request that can be stored in @@ -54,6 +54,15 @@ #define G_GATE_FLAG_DESTROY 0x1000 #define G_GATE_USERFLAGS (G_GATE_FLAG_READONLY | G_GATE_FLAG_WRITEONLY) +/* + * Pick unit number automatically in /dev/ggate. + */ +#define G_GATE_UNIT_AUTO (-1) +/* + * Full provider name is given, so don't use ggate. + */ +#define G_GATE_NAME_GIVEN (-2) + #define G_GATE_CMD_CREATE _IOWR('m', 0, struct g_gate_ctl_create) #define G_GATE_CMD_DESTROY _IOWR('m', 1, struct g_gate_ctl_destroy) #define G_GATE_CMD_CANCEL _IOWR('m', 2, struct g_gate_ctl_cancel) @@ -120,20 +129,23 @@ struct g_gate_ctl_create { u_int gctl_flags; u_int gctl_maxcount; u_int gctl_timeout; + char gctl_name[NAME_MAX]; char gctl_info[G_GATE_INFOSIZE]; - int gctl_unit; /* out */ + int gctl_unit; /* in/out */ }; struct g_gate_ctl_destroy { u_int gctl_version; int gctl_unit; int gctl_force; + char gctl_name[NAME_MAX]; }; struct g_gate_ctl_cancel { u_int gctl_version; int gctl_unit; uintptr_t gctl_seq; + char gctl_name[NAME_MAX]; }; struct g_gate_ctl_io { From owner-svn-src-stable-8@FreeBSD.ORG Sun Apr 18 21:18:33 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9F1131065673; Sun, 18 Apr 2010 21:18:33 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8CBC68FC24; Sun, 18 Apr 2010 21:18:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3ILIXLs096294; Sun, 18 Apr 2010 21:18:33 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3ILIWMM096292; Sun, 18 Apr 2010 21:18:32 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201004182118.o3ILIWMM096292@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 18 Apr 2010 21:18:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206811 - stable/8/sbin/hastd X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Apr 2010 21:18:33 -0000 Author: pjd Date: Sun Apr 18 21:18:32 2010 New Revision: 206811 URL: http://svn.freebsd.org/changeset/base/206811 Log: MFC r204177,r205738,r206669,r206696,r206697: r204177: Changing proto_socketpair.c compilation and linking order revealed a problem - we should simply ignore proto_server() if address doesn't start with socketpair://, and not abort. r205738: Don't hold connection lock when doing reconnects as it makes I/Os wait for connection timeouts. Reported by: Kevin Day r206669: Increase ggate queue size to maximum value. HAST was not able to stand heavy random load. Reported by: Hiroyuki Yamagami r206696: Fix control socket leak when worker process exits. Submitted by: Mikolaj Golub r206697: Fix log size calculation which caused message truncation. Submitted by: Mikolaj Golub Modified: stable/8/sbin/hastd/hastd.c stable/8/sbin/hastd/pjdlog.c stable/8/sbin/hastd/primary.c stable/8/sbin/hastd/proto_socketpair.c Directory Properties: stable/8/sbin/hastd/ (props changed) Modified: stable/8/sbin/hastd/hastd.c ============================================================================== --- stable/8/sbin/hastd/hastd.c Sun Apr 18 21:14:49 2010 (r206810) +++ stable/8/sbin/hastd/hastd.c Sun Apr 18 21:18:32 2010 (r206811) @@ -137,6 +137,7 @@ child_exit(void) pjdlog_error("Worker process failed (pid=%u, status=%d).", (unsigned int)pid, WEXITSTATUS(status)); } + proto_close(res->hr_ctrl); res->hr_workerpid = 0; if (res->hr_role == HAST_ROLE_PRIMARY) { sleep(1); Modified: stable/8/sbin/hastd/pjdlog.c ============================================================================== --- stable/8/sbin/hastd/pjdlog.c Sun Apr 18 21:14:49 2010 (r206810) +++ stable/8/sbin/hastd/pjdlog.c Sun Apr 18 21:18:32 2010 (r206811) @@ -228,7 +228,7 @@ pjdlogv_common(int loglevel, int debugle len = snprintf(log, sizeof(log), "%s", pjdlog_prefix); if ((size_t)len < sizeof(log)) - len = vsnprintf(log + len, sizeof(log) - len, fmt, ap); + len += vsnprintf(log + len, sizeof(log) - len, fmt, ap); if (error != -1 && (size_t)len < sizeof(log)) { (void)snprintf(log + len, sizeof(log) - len, ": %s.", strerror(error)); Modified: stable/8/sbin/hastd/primary.c ============================================================================== --- stable/8/sbin/hastd/primary.c Sun Apr 18 21:14:49 2010 (r206810) +++ stable/8/sbin/hastd/primary.c Sun Apr 18 21:18:32 2010 (r206811) @@ -460,9 +460,11 @@ init_local(struct hast_resource *res) exit(EX_NOINPUT); } -static void -init_remote(struct hast_resource *res) +static bool +init_remote(struct hast_resource *res, struct proto_conn **inp, + struct proto_conn **outp) { + struct proto_conn *in, *out; struct nv *nvout, *nvin; const unsigned char *token; unsigned char *map; @@ -472,13 +474,17 @@ init_remote(struct hast_resource *res) uint32_t mapsize; size_t size; + assert((inp == NULL && outp == NULL) || (inp != NULL && outp != NULL)); + + in = out = NULL; + /* Prepare outgoing connection with remote node. */ - if (proto_client(res->hr_remoteaddr, &res->hr_remoteout) < 0) { + if (proto_client(res->hr_remoteaddr, &out) < 0) { primary_exit(EX_OSERR, "Unable to create connection to %s", res->hr_remoteaddr); } /* Try to connect, but accept failure. */ - if (proto_connect(res->hr_remoteout) < 0) { + if (proto_connect(out) < 0) { pjdlog_errno(LOG_WARNING, "Unable to connect to %s", res->hr_remoteaddr); goto close; @@ -496,7 +502,7 @@ init_remote(struct hast_resource *res) nv_free(nvout); goto close; } - if (hast_proto_send(res, res->hr_remoteout, nvout, NULL, 0) < 0) { + if (hast_proto_send(res, out, nvout, NULL, 0) < 0) { pjdlog_errno(LOG_WARNING, "Unable to send handshake header to %s", res->hr_remoteaddr); @@ -504,7 +510,7 @@ init_remote(struct hast_resource *res) goto close; } nv_free(nvout); - if (hast_proto_recv_hdr(res->hr_remoteout, &nvin) < 0) { + if (hast_proto_recv_hdr(out, &nvin) < 0) { pjdlog_errno(LOG_WARNING, "Unable to receive handshake header from %s", res->hr_remoteaddr); @@ -536,12 +542,12 @@ init_remote(struct hast_resource *res) * Second handshake step. * Setup incoming connection with remote node. */ - if (proto_client(res->hr_remoteaddr, &res->hr_remotein) < 0) { + if (proto_client(res->hr_remoteaddr, &in) < 0) { pjdlog_errno(LOG_WARNING, "Unable to create connection to %s", res->hr_remoteaddr); } /* Try to connect, but accept failure. */ - if (proto_connect(res->hr_remotein) < 0) { + if (proto_connect(in) < 0) { pjdlog_errno(LOG_WARNING, "Unable to connect to %s", res->hr_remoteaddr); goto close; @@ -560,7 +566,7 @@ init_remote(struct hast_resource *res) nv_free(nvout); goto close; } - if (hast_proto_send(res, res->hr_remotein, nvout, NULL, 0) < 0) { + if (hast_proto_send(res, in, nvout, NULL, 0) < 0) { pjdlog_errno(LOG_WARNING, "Unable to send handshake header to %s", res->hr_remoteaddr); @@ -568,7 +574,7 @@ init_remote(struct hast_resource *res) goto close; } nv_free(nvout); - if (hast_proto_recv_hdr(res->hr_remoteout, &nvin) < 0) { + if (hast_proto_recv_hdr(out, &nvin) < 0) { pjdlog_errno(LOG_WARNING, "Unable to receive handshake header from %s", res->hr_remoteaddr); @@ -611,7 +617,7 @@ init_remote(struct hast_resource *res) * Remote node have some dirty extents on its own, lets * download its activemap. */ - if (hast_proto_recv_data(res, res->hr_remoteout, nvin, map, + if (hast_proto_recv_data(res, out, nvin, map, mapsize) < 0) { pjdlog_errno(LOG_ERR, "Unable to receive remote activemap"); @@ -631,18 +637,29 @@ init_remote(struct hast_resource *res) (void)hast_activemap_flush(res); } pjdlog_info("Connected to %s.", res->hr_remoteaddr); + if (inp != NULL && outp != NULL) { + *inp = in; + *outp = out; + } else { + res->hr_remotein = in; + res->hr_remoteout = out; + } + return (true); +close: + proto_close(out); + if (in != NULL) + proto_close(in); + return (false); +} + +static void +sync_start(void) +{ + mtx_lock(&sync_lock); sync_inprogress = true; mtx_unlock(&sync_lock); cv_signal(&sync_cond); - return; -close: - proto_close(res->hr_remoteout); - res->hr_remoteout = NULL; - if (res->hr_remotein != NULL) { - proto_close(res->hr_remotein); - res->hr_remotein = NULL; - } } static void @@ -665,7 +682,7 @@ init_ggate(struct hast_resource *res) ggiocreate.gctl_mediasize = res->hr_datasize; ggiocreate.gctl_sectorsize = res->hr_local_sectorsize; ggiocreate.gctl_flags = 0; - ggiocreate.gctl_maxcount = 128; + ggiocreate.gctl_maxcount = G_GATE_MAX_QUEUE_SIZE; ggiocreate.gctl_timeout = 0; ggiocreate.gctl_unit = G_GATE_NAME_GIVEN; snprintf(ggiocreate.gctl_name, sizeof(ggiocreate.gctl_name), "hast/%s", @@ -735,7 +752,8 @@ hastd_primary(struct hast_resource *res) setproctitle("%s (primary)", res->hr_name); init_local(res); - init_remote(res); + if (init_remote(res, NULL, NULL)) + sync_start(); init_ggate(res); init_environment(res); error = pthread_create(&td, NULL, ggate_recv_thread, res); @@ -1695,6 +1713,7 @@ static void * guard_thread(void *arg) { struct hast_resource *res = arg; + struct proto_conn *in, *out; unsigned int ii, ncomps; int timeout; @@ -1738,26 +1757,31 @@ guard_thread(void *arg) * connected. */ rw_unlock(&hio_remote_lock[ii]); - rw_wlock(&hio_remote_lock[ii]); - assert(res->hr_remotein == NULL); - assert(res->hr_remoteout == NULL); pjdlog_debug(2, "remote_guard: Reconnecting to %s.", res->hr_remoteaddr); - init_remote(res); - if (ISCONNECTED(res, ii)) { + in = out = NULL; + if (init_remote(res, &in, &out)) { + rw_wlock(&hio_remote_lock[ii]); + assert(res->hr_remotein == NULL); + assert(res->hr_remoteout == NULL); + assert(in != NULL && out != NULL); + res->hr_remotein = in; + res->hr_remoteout = out; + rw_unlock(&hio_remote_lock[ii]); pjdlog_info("Successfully reconnected to %s.", res->hr_remoteaddr); + sync_start(); } else { /* Both connections should be NULL. */ assert(res->hr_remotein == NULL); assert(res->hr_remoteout == NULL); + assert(in == NULL && out == NULL); pjdlog_debug(2, "remote_guard: Reconnect to %s failed.", res->hr_remoteaddr); timeout = RECONNECT_SLEEP; } - rw_unlock(&hio_remote_lock[ii]); } } (void)cv_timedwait(&hio_guard_cond, &hio_guard_lock, timeout); Modified: stable/8/sbin/hastd/proto_socketpair.c ============================================================================== --- stable/8/sbin/hastd/proto_socketpair.c Sun Apr 18 21:14:49 2010 (r206810) +++ stable/8/sbin/hastd/proto_socketpair.c Sun Apr 18 21:18:32 2010 (r206811) @@ -91,9 +91,12 @@ sp_connect(void *ctx __unused) } static int -sp_server(const char *addr __unused, void **ctxp __unused) +sp_server(const char *addr, void **ctxp __unused) { + if (strcmp(addr, "socketpair://") != 0) + return (-1); + assert(!"proto_server() not supported on socketpairs"); abort(); } From owner-svn-src-stable-8@FreeBSD.ORG Sun Apr 18 21:24:24 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 391611065676; Sun, 18 Apr 2010 21:24:24 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 27BA98FC27; Sun, 18 Apr 2010 21:24:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3ILOOTg097629; Sun, 18 Apr 2010 21:24:24 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3ILOO8o097628; Sun, 18 Apr 2010 21:24:24 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201004182124.o3ILOO8o097628@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 18 Apr 2010 21:24:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206812 - stable/8/sbin/geom/misc X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Apr 2010 21:24:24 -0000 Author: pjd Date: Sun Apr 18 21:24:23 2010 New Revision: 206812 URL: http://svn.freebsd.org/changeset/base/206812 Log: MFC r206666: Flush disk write cache after storing and clearing metadata. Modified: stable/8/sbin/geom/misc/subr.c Directory Properties: stable/8/sbin/geom/ (props changed) stable/8/sbin/geom/class/stripe/ (props changed) Modified: stable/8/sbin/geom/misc/subr.c ============================================================================== --- stable/8/sbin/geom/misc/subr.c Sun Apr 18 21:18:32 2010 (r206811) +++ stable/8/sbin/geom/misc/subr.c Sun Apr 18 21:24:23 2010 (r206812) @@ -236,6 +236,7 @@ g_metadata_store(const char *name, u_cha error = errno; goto out; } + (void)ioctl(fd, DIOCGFLUSH, NULL); out: if (sector != NULL) free(sector); @@ -293,6 +294,7 @@ g_metadata_clear(const char *name, const error = errno; goto out; } + (void)ioctl(fd, DIOCGFLUSH, NULL); out: if (sector != NULL) free(sector); From owner-svn-src-stable-8@FreeBSD.ORG Sun Apr 18 21:27:00 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2693E106566C; Sun, 18 Apr 2010 21:27:00 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 156208FC1B; Sun, 18 Apr 2010 21:27:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3ILQx9u098236; Sun, 18 Apr 2010 21:26:59 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3ILQxdu098234; Sun, 18 Apr 2010 21:26:59 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201004182126.o3ILQxdu098234@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 18 Apr 2010 21:26:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206813 - stable/8/sys/geom/eli X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Apr 2010 21:27:00 -0000 Author: pjd Date: Sun Apr 18 21:26:59 2010 New Revision: 206813 URL: http://svn.freebsd.org/changeset/base/206813 Log: MFC r206665: Use lower priority for GELI worker threads. This improves system responsiveness under heavy GELI load. Modified: stable/8/sys/geom/eli/g_eli.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/dev/uath/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/geom/eli/g_eli.c ============================================================================== --- stable/8/sys/geom/eli/g_eli.c Sun Apr 18 21:24:23 2010 (r206812) +++ stable/8/sys/geom/eli/g_eli.c Sun Apr 18 21:26:59 2010 (r206813) @@ -340,7 +340,7 @@ g_eli_worker(void *arg) } #endif thread_lock(curthread); - sched_prio(curthread, PRIBIO); + sched_prio(curthread, PUSER); if (sc->sc_crypto == G_ELI_CRYPTO_SW && g_eli_threads == 0) sched_bind(curthread, wr->w_number); thread_unlock(curthread); @@ -361,8 +361,7 @@ g_eli_worker(void *arg) mtx_unlock(&sc->sc_queue_mtx); kproc_exit(0); } - msleep(sc, &sc->sc_queue_mtx, PRIBIO | PDROP, - "geli:w", 0); + msleep(sc, &sc->sc_queue_mtx, PDROP, "geli:w", 0); continue; } mtx_unlock(&sc->sc_queue_mtx); From owner-svn-src-stable-8@FreeBSD.ORG Sun Apr 18 21:36:34 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D9E0A1065680; Sun, 18 Apr 2010 21:36:34 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C65578FC16; Sun, 18 Apr 2010 21:36:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3ILaYBX000555; Sun, 18 Apr 2010 21:36:34 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3ILaYHV000549; Sun, 18 Apr 2010 21:36:34 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201004182136.o3ILaYHV000549@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 18 Apr 2010 21:36:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206815 - in stable/8/sys: boot/zfs cddl/contrib/opensolaris/uts/common/fs/zfs modules/zfs sys X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Apr 2010 21:36:35 -0000 Author: pjd Date: Sun Apr 18 21:36:34 2010 New Revision: 206815 URL: http://svn.freebsd.org/changeset/base/206815 Log: MFC r203504,r204067,r204073,r204101,r204804,r205079,r205080,r205132,r205133, r205134,r205231,r205253,r205264,r205346,r206051,r206667,r206792,r206793, r206794,r206795,r206796,r206797: r203504: Open provider for writting when we find the right one. Opening too much providers for writing provokes huge traffic related to taste events send by GEOM on close. This can lead to various problems with opening GEOM providers that are created on top of other GEOM providers. Reorted by: Kurt Touet , mr Tested by: mr, Baginski Darren r204067: Update comment. We also look for GPT partitions. r204073: Add tunable and sysctl to skip hostid check on pool import. r204101: Don't set f_bsize to recordsize. It might confuse some software (like squid). Submitted by: Alexander Zagrebin r204804: Remove racy assertion. Reported by: Attila Nagy Obtained from: OpenSolaris, Bug ID 6827260 r205079: Remove bogus assertion. Reported by: Johan Ström Obtained from: OpenSolaris, Bug ID 6920880 r205080: Force commit to correct Bug ID: Obtained from: OpenSolaris, Bug ID 6920880 r205132: Don't bottleneck on acquiring the stream locks - this avoids a massive drop off in throughput with large numbers of simultaneous reads r205133: fix compilation under ZIO_USE_UMA r205134: make UMA the default allocator for ZFS buffers - this avoids a great deal of contention in kmem_alloc r205231: - reduce contention by breaking up ARC state locks in to 16 for data and 16 for metadata - export L2ARC tunables as sysctls - add several kstats to track L2ARC state more precisely - avoid holding a contended lock when atomically incrementing a contended counter (no lock protection needed for atomics) r205253: use CACHE_LINE_SIZE instead of hardcoding 128 for lock pad pointed out by Marius Nuennerich and jhb@ r205264: - cache line align arcs_lock array (h/t Marius Nuennerich) - fix ARCS_LOCK_PAD to use architecture defined CACHE_LINE_SIZE - cache line align buf_hash_table ht_locks array r205346: The same code is used to import and to create pool. The order of operations is the following: 1. Try to open vdev by remembered path and guid. 2. If 1 failed, try to find vdev which guid matches and ignore the path. 3. If 2 failed this means either that the vdev we're looking for is gone or that pool is being created and vdev doesn't contain proper guid yet. To be able to handle pool creation we open vdev by path anyway. Because of 3 it is possible that we open wrong vdev on import which can lead to confusions. The solution for this is to check spa_load_state. On pool creation it will be equal to SPA_LOAD_NONE and we can open vdev only by path immediately and if it is not equal to SPA_LOAD_NONE we first open by path+guid and when that fails, we open by guid. We no longer open wrong vdev on import. r206051: IOCPARM_MAX defines maximum size of a structure that can be passed directly to ioctl(2). Because of how ioctl command is build using _IO*() macros we have only 13 bits to encode structure size. So the structure can be up to 8kB-1. Currently we define IOCPARM_MAX as PAGE_SIZE. This is IMHO wrong for three main reasons: 1. It is confusing on archs with page size larger than 8kB (not really sure if we support such archs (sparc64?)), as even if PAGE_SIZE is bigger than 8kB, we won't be able to encode anything larger in ioctl command. 2. It is a waste. Why the structure can be only 4kB on most archs if we have 13 bits dedicated for that, not 12? 3. It shouldn't depend on architecture and page size. My ioctl command can work on one arch, but can't on the other? Increase IOCPARM_MAX to 8kB and make it independed of PAGE_SIZE and architecture it is compiled for. This allows to use all the bits on all the archs for size. Note that this doesn't mean we will copy more on every ioctl(2) call. No. We still copyin(9)/copyout(9) only exact number of bytes encoded in ioctl command. Practical use for this change is ZFS. zfs_cmd_t structure used for ZFS ioctls is larger than 4kB. Silence on: arch@ r206667: Fix 3-way deadlock that can happen because of ZFS and vnode lock order reversal. thread0 (vfs_fhtovp) thread1 (vop_getattr) thread2 (zfs_recv) -------------------- --------------------- ------------------ vn_lock rrw_enter_read rrw_enter_write (hangs) rrw_enter_read (hangs) vn_lock (hangs) Reported by: Attila Nagy r206792: Set ARC_L2_WRITING on L2ARC header creation. Obtained from: OpenSolaris r206793: Remove racy assertion. Obtained from: OpenSolaris r206794: Extend locks scope to match OpenSolaris. r206795: Add missing list and lock destruction. r206796: Style fixes. r206797: Restore previous order. Modified: stable/8/sys/boot/zfs/zfs.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c stable/8/sys/modules/zfs/Makefile stable/8/sys/sys/ioccom.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/dev/uath/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/boot/zfs/zfs.c ============================================================================== --- stable/8/sys/boot/zfs/zfs.c Sun Apr 18 21:29:28 2010 (r206814) +++ stable/8/sys/boot/zfs/zfs.c Sun Apr 18 21:36:34 2010 (r206815) @@ -397,7 +397,7 @@ zfs_dev_init(void) /* * Open all the disks we can find and see if we can reconstruct * ZFS pools from them. Bogusly assumes that the disks are named - * diskN or diskNsM. + * diskN, diskNpM or diskNsM. */ zfs_init(); for (unit = 0; unit < 32 /* XXX */; unit++) { Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sun Apr 18 21:29:28 2010 (r206814) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sun Apr 18 21:36:34 2010 (r206815) @@ -186,6 +186,11 @@ SYSCTL_QUAD(_vfs_zfs, OID_AUTO, arc_min, SYSCTL_INT(_vfs_zfs, OID_AUTO, mdcomp_disable, CTLFLAG_RDTUN, &zfs_mdcomp_disable, 0, "Disable metadata compression"); +#ifdef ZIO_USE_UMA +extern kmem_cache_t *zio_buf_cache[]; +extern kmem_cache_t *zio_data_buf_cache[]; +#endif + /* * Note that buffers can be in one of 6 states: * ARC_anon - anonymous (discussed below) @@ -218,13 +223,31 @@ SYSCTL_INT(_vfs_zfs, OID_AUTO, mdcomp_di * second level ARC benefit from these fast lookups. */ +#define ARCS_LOCK_PAD CACHE_LINE_SIZE +struct arcs_lock { + kmutex_t arcs_lock; +#ifdef _KERNEL + unsigned char pad[(ARCS_LOCK_PAD - sizeof (kmutex_t))]; +#endif +}; + +/* + * must be power of two for mask use to work + * + */ +#define ARC_BUFC_NUMDATALISTS 16 +#define ARC_BUFC_NUMMETADATALISTS 16 +#define ARC_BUFC_NUMLISTS (ARC_BUFC_NUMMETADATALISTS + ARC_BUFC_NUMDATALISTS) + typedef struct arc_state { - list_t arcs_list[ARC_BUFC_NUMTYPES]; /* list of evictable buffers */ uint64_t arcs_lsize[ARC_BUFC_NUMTYPES]; /* amount of evictable data */ uint64_t arcs_size; /* total amount of data in this state */ - kmutex_t arcs_mtx; + list_t arcs_lists[ARC_BUFC_NUMLISTS]; /* list of evictable buffers */ + struct arcs_lock arcs_locks[ARC_BUFC_NUMLISTS] __aligned(CACHE_LINE_SIZE); } arc_state_t; +#define ARCS_LOCK(s, i) (&((s)->arcs_locks[(i)].arcs_lock)) + /* The 6 states: */ static arc_state_t ARC_anon; static arc_state_t ARC_mru; @@ -248,7 +271,9 @@ typedef struct arc_stats { kstat_named_t arcstat_mru_ghost_hits; kstat_named_t arcstat_mfu_hits; kstat_named_t arcstat_mfu_ghost_hits; + kstat_named_t arcstat_allocated; kstat_named_t arcstat_deleted; + kstat_named_t arcstat_stolen; kstat_named_t arcstat_recycle_miss; kstat_named_t arcstat_mutex_miss; kstat_named_t arcstat_evict_skip; @@ -280,6 +305,19 @@ typedef struct arc_stats { kstat_named_t arcstat_l2_size; kstat_named_t arcstat_l2_hdr_size; kstat_named_t arcstat_memory_throttle_count; + kstat_named_t arcstat_l2_write_trylock_fail; + kstat_named_t arcstat_l2_write_passed_headroom; + kstat_named_t arcstat_l2_write_spa_mismatch; + kstat_named_t arcstat_l2_write_in_l2; + kstat_named_t arcstat_l2_write_hdr_io_in_progress; + kstat_named_t arcstat_l2_write_not_cacheable; + kstat_named_t arcstat_l2_write_full; + kstat_named_t arcstat_l2_write_buffer_iter; + kstat_named_t arcstat_l2_write_pios; + kstat_named_t arcstat_l2_write_bytes_written; + kstat_named_t arcstat_l2_write_buffer_bytes_scanned; + kstat_named_t arcstat_l2_write_buffer_list_iter; + kstat_named_t arcstat_l2_write_buffer_list_null_iter; } arc_stats_t; static arc_stats_t arc_stats = { @@ -297,7 +335,9 @@ static arc_stats_t arc_stats = { { "mru_ghost_hits", KSTAT_DATA_UINT64 }, { "mfu_hits", KSTAT_DATA_UINT64 }, { "mfu_ghost_hits", KSTAT_DATA_UINT64 }, + { "allocated", KSTAT_DATA_UINT64 }, { "deleted", KSTAT_DATA_UINT64 }, + { "stolen", KSTAT_DATA_UINT64 }, { "recycle_miss", KSTAT_DATA_UINT64 }, { "mutex_miss", KSTAT_DATA_UINT64 }, { "evict_skip", KSTAT_DATA_UINT64 }, @@ -328,7 +368,20 @@ static arc_stats_t arc_stats = { { "l2_io_error", KSTAT_DATA_UINT64 }, { "l2_size", KSTAT_DATA_UINT64 }, { "l2_hdr_size", KSTAT_DATA_UINT64 }, - { "memory_throttle_count", KSTAT_DATA_UINT64 } + { "memory_throttle_count", KSTAT_DATA_UINT64 }, + { "l2_write_trylock_fail", KSTAT_DATA_UINT64 }, + { "l2_write_passed_headroom", KSTAT_DATA_UINT64 }, + { "l2_write_spa_mismatch", KSTAT_DATA_UINT64 }, + { "l2_write_in_l2", KSTAT_DATA_UINT64 }, + { "l2_write_io_in_progress", KSTAT_DATA_UINT64 }, + { "l2_write_not_cacheable", KSTAT_DATA_UINT64 }, + { "l2_write_full", KSTAT_DATA_UINT64 }, + { "l2_write_buffer_iter", KSTAT_DATA_UINT64 }, + { "l2_write_pios", KSTAT_DATA_UINT64 }, + { "l2_write_bytes_written", KSTAT_DATA_UINT64 }, + { "l2_write_buffer_bytes_scanned", KSTAT_DATA_UINT64 }, + { "l2_write_buffer_list_iter", KSTAT_DATA_UINT64 }, + { "l2_write_buffer_list_null_iter", KSTAT_DATA_UINT64 } }; #define ARCSTAT(stat) (arc_stats.stat.value.ui64) @@ -336,7 +389,7 @@ static arc_stats_t arc_stats = { #define ARCSTAT_INCR(stat, val) \ atomic_add_64(&arc_stats.stat.value.ui64, (val)); -#define ARCSTAT_BUMP(stat) ARCSTAT_INCR(stat, 1) +#define ARCSTAT_BUMP(stat) ARCSTAT_INCR(stat, 1) #define ARCSTAT_BUMPDOWN(stat) ARCSTAT_INCR(stat, -1) #define ARCSTAT_MAX(stat, val) { \ @@ -370,7 +423,7 @@ static arc_stats_t arc_stats = { } kstat_t *arc_ksp; -static arc_state_t *arc_anon; +static arc_state_t *arc_anon; static arc_state_t *arc_mru; static arc_state_t *arc_mru_ghost; static arc_state_t *arc_mfu; @@ -514,7 +567,7 @@ static void arc_evict_ghost(arc_state_t * Hash table routines */ -#define HT_LOCK_PAD 128 +#define HT_LOCK_PAD CACHE_LINE_SIZE struct ht_lock { kmutex_t ht_lock; @@ -527,7 +580,7 @@ struct ht_lock { typedef struct buf_hash_table { uint64_t ht_mask; arc_buf_hdr_t **ht_table; - struct ht_lock ht_locks[BUF_LOCKS]; + struct ht_lock ht_locks[BUF_LOCKS] __aligned(CACHE_LINE_SIZE); } buf_hash_table_t; static buf_hash_table_t buf_hash_table; @@ -541,13 +594,19 @@ static buf_hash_table_t buf_hash_table; uint64_t zfs_crc64_table[256]; +#ifdef ZIO_USE_UMA +extern kmem_cache_t *zio_buf_cache[]; +extern kmem_cache_t *zio_data_buf_cache[]; +#endif + /* * Level 2 ARC */ -#define L2ARC_WRITE_SIZE (8 * 1024 * 1024) /* initial write max */ -#define L2ARC_HEADROOM 4 /* num of writes */ +#define L2ARC_WRITE_SIZE (64 * 1024 * 1024) /* initial write max */ +#define L2ARC_HEADROOM 128 /* num of writes */ #define L2ARC_FEED_SECS 1 /* caching interval */ +#define L2ARC_FEED_SECS_SHIFT 1 /* caching interval shift */ #define l2arc_writes_sent ARCSTAT(arcstat_l2_writes_sent) #define l2arc_writes_done ARCSTAT(arcstat_l2_writes_done) @@ -559,7 +618,66 @@ uint64_t l2arc_write_max = L2ARC_WRITE_S uint64_t l2arc_write_boost = L2ARC_WRITE_SIZE; /* extra write during warmup */ uint64_t l2arc_headroom = L2ARC_HEADROOM; /* number of dev writes */ uint64_t l2arc_feed_secs = L2ARC_FEED_SECS; /* interval seconds */ -boolean_t l2arc_noprefetch = B_TRUE; /* don't cache prefetch bufs */ +uint64_t l2arc_feed_secs_shift = L2ARC_FEED_SECS_SHIFT; /* interval seconds shift */ +boolean_t l2arc_noprefetch = B_FALSE; /* don't cache prefetch bufs */ + + +SYSCTL_QUAD(_vfs_zfs, OID_AUTO, l2arc_write_max, CTLFLAG_RW, + &l2arc_write_max, 0, "max write size"); +SYSCTL_QUAD(_vfs_zfs, OID_AUTO, l2arc_write_boost, CTLFLAG_RW, + &l2arc_write_boost, 0, "extra write during warmup"); +SYSCTL_QUAD(_vfs_zfs, OID_AUTO, l2arc_headroom, CTLFLAG_RW, + &l2arc_headroom, 0, "number of dev writes"); +SYSCTL_QUAD(_vfs_zfs, OID_AUTO, l2arc_feed_secs, CTLFLAG_RW, + &l2arc_feed_secs, 0, "interval seconds"); +SYSCTL_QUAD(_vfs_zfs, OID_AUTO, l2arc_feed_secs_shift, CTLFLAG_RW, + &l2arc_feed_secs_shift, 0, "power of 2 division of feed seconds"); + +SYSCTL_INT(_vfs_zfs, OID_AUTO, l2arc_noprefetch, CTLFLAG_RW, + &l2arc_noprefetch, 0, "don't cache prefetch bufs"); + + +SYSCTL_QUAD(_vfs_zfs, OID_AUTO, anon_size, CTLFLAG_RD, + &ARC_anon.arcs_size, 0, "size of anonymous state"); +SYSCTL_QUAD(_vfs_zfs, OID_AUTO, anon_metadata_lsize, CTLFLAG_RD, + &ARC_anon.arcs_lsize[ARC_BUFC_METADATA], 0, "size of anonymous state"); +SYSCTL_QUAD(_vfs_zfs, OID_AUTO, anon_data_lsize, CTLFLAG_RD, + &ARC_anon.arcs_lsize[ARC_BUFC_DATA], 0, "size of anonymous state"); + +SYSCTL_QUAD(_vfs_zfs, OID_AUTO, mru_size, CTLFLAG_RD, + &ARC_mru.arcs_size, 0, "size of mru state"); +SYSCTL_QUAD(_vfs_zfs, OID_AUTO, mru_metadata_lsize, CTLFLAG_RD, + &ARC_mru.arcs_lsize[ARC_BUFC_METADATA], 0, "size of metadata in mru state"); +SYSCTL_QUAD(_vfs_zfs, OID_AUTO, mru_data_lsize, CTLFLAG_RD, + &ARC_mru.arcs_lsize[ARC_BUFC_DATA], 0, "size of data in mru state"); + +SYSCTL_QUAD(_vfs_zfs, OID_AUTO, mru_ghost_size, CTLFLAG_RD, + &ARC_mru_ghost.arcs_size, 0, "size of mru ghost state"); +SYSCTL_QUAD(_vfs_zfs, OID_AUTO, mru_ghost_metadata_lsize, CTLFLAG_RD, + &ARC_mru_ghost.arcs_lsize[ARC_BUFC_METADATA], 0, + "size of metadata in mru ghost state"); +SYSCTL_QUAD(_vfs_zfs, OID_AUTO, mru_ghost_data_lsize, CTLFLAG_RD, + &ARC_mru_ghost.arcs_lsize[ARC_BUFC_DATA], 0, + "size of data in mru ghost state"); + +SYSCTL_QUAD(_vfs_zfs, OID_AUTO, mfu_size, CTLFLAG_RD, + &ARC_mfu.arcs_size, 0, "size of mfu state"); +SYSCTL_QUAD(_vfs_zfs, OID_AUTO, mfu_metadata_lsize, CTLFLAG_RD, + &ARC_mfu.arcs_lsize[ARC_BUFC_METADATA], 0, "size of metadata in mfu state"); +SYSCTL_QUAD(_vfs_zfs, OID_AUTO, mfu_data_lsize, CTLFLAG_RD, + &ARC_mfu.arcs_lsize[ARC_BUFC_DATA], 0, "size of data in mfu state"); + +SYSCTL_QUAD(_vfs_zfs, OID_AUTO, mfu_ghost_size, CTLFLAG_RD, + &ARC_mfu_ghost.arcs_size, 0, "size of mfu ghost state"); +SYSCTL_QUAD(_vfs_zfs, OID_AUTO, mfu_ghost_metadata_lsize, CTLFLAG_RD, + &ARC_mfu_ghost.arcs_lsize[ARC_BUFC_METADATA], 0, + "size of metadata in mfu ghost state"); +SYSCTL_QUAD(_vfs_zfs, OID_AUTO, mfu_ghost_data_lsize, CTLFLAG_RD, + &ARC_mfu_ghost.arcs_lsize[ARC_BUFC_DATA], 0, + "size of data in mfu ghost state"); + +SYSCTL_QUAD(_vfs_zfs, OID_AUTO, l2c_only_size, CTLFLAG_RD, + &ARC_l2c_only.arcs_size, 0, "size of mru state"); /* * L2ARC Internals @@ -953,18 +1071,38 @@ arc_buf_freeze(arc_buf_t *buf) } static void +get_buf_info(arc_buf_hdr_t *ab, arc_state_t *state, list_t **list, kmutex_t **lock) +{ + uint64_t buf_hashid = buf_hash(ab->b_spa, &ab->b_dva, ab->b_birth); + + if (ab->b_type == ARC_BUFC_METADATA) + buf_hashid &= (ARC_BUFC_NUMMETADATALISTS - 1); + else { + buf_hashid &= (ARC_BUFC_NUMDATALISTS - 1); + buf_hashid += ARC_BUFC_NUMMETADATALISTS; + } + + *list = &state->arcs_lists[buf_hashid]; + *lock = ARCS_LOCK(state, buf_hashid); +} + + +static void add_reference(arc_buf_hdr_t *ab, kmutex_t *hash_lock, void *tag) { + ASSERT(MUTEX_HELD(hash_lock)); if ((refcount_add(&ab->b_refcnt, tag) == 1) && (ab->b_state != arc_anon)) { uint64_t delta = ab->b_size * ab->b_datacnt; - list_t *list = &ab->b_state->arcs_list[ab->b_type]; uint64_t *size = &ab->b_state->arcs_lsize[ab->b_type]; + list_t *list; + kmutex_t *lock; - ASSERT(!MUTEX_HELD(&ab->b_state->arcs_mtx)); - mutex_enter(&ab->b_state->arcs_mtx); + get_buf_info(ab, ab->b_state, &list, &lock); + ASSERT(!MUTEX_HELD(lock)); + mutex_enter(lock); ASSERT(list_link_active(&ab->b_arc_node)); list_remove(list, ab); if (GHOST_STATE(ab->b_state)) { @@ -975,7 +1113,7 @@ add_reference(arc_buf_hdr_t *ab, kmutex_ ASSERT(delta > 0); ASSERT3U(*size, >=, delta); atomic_add_64(size, -delta); - mutex_exit(&ab->b_state->arcs_mtx); + mutex_exit(lock); /* remove the prefetch flag if we get a reference */ if (ab->b_flags & ARC_PREFETCH) ab->b_flags &= ~ARC_PREFETCH; @@ -994,14 +1132,17 @@ remove_reference(arc_buf_hdr_t *ab, kmut if (((cnt = refcount_remove(&ab->b_refcnt, tag)) == 0) && (state != arc_anon)) { uint64_t *size = &state->arcs_lsize[ab->b_type]; + list_t *list; + kmutex_t *lock; - ASSERT(!MUTEX_HELD(&state->arcs_mtx)); - mutex_enter(&state->arcs_mtx); + get_buf_info(ab, state, &list, &lock); + ASSERT(!MUTEX_HELD(lock)); + mutex_enter(lock); ASSERT(!list_link_active(&ab->b_arc_node)); - list_insert_head(&state->arcs_list[ab->b_type], ab); + list_insert_head(list, ab); ASSERT(ab->b_datacnt > 0); atomic_add_64(size, ab->b_size * ab->b_datacnt); - mutex_exit(&state->arcs_mtx); + mutex_exit(lock); } return (cnt); } @@ -1016,6 +1157,8 @@ arc_change_state(arc_state_t *new_state, arc_state_t *old_state = ab->b_state; int64_t refcnt = refcount_count(&ab->b_refcnt); uint64_t from_delta, to_delta; + list_t *list; + kmutex_t *lock; ASSERT(MUTEX_HELD(hash_lock)); ASSERT(new_state != old_state); @@ -1030,14 +1173,16 @@ arc_change_state(arc_state_t *new_state, */ if (refcnt == 0) { if (old_state != arc_anon) { - int use_mutex = !MUTEX_HELD(&old_state->arcs_mtx); + int use_mutex; uint64_t *size = &old_state->arcs_lsize[ab->b_type]; + get_buf_info(ab, old_state, &list, &lock); + use_mutex = !MUTEX_HELD(lock); if (use_mutex) - mutex_enter(&old_state->arcs_mtx); + mutex_enter(lock); ASSERT(list_link_active(&ab->b_arc_node)); - list_remove(&old_state->arcs_list[ab->b_type], ab); + list_remove(list, ab); /* * If prefetching out of the ghost cache, @@ -1052,16 +1197,18 @@ arc_change_state(arc_state_t *new_state, atomic_add_64(size, -from_delta); if (use_mutex) - mutex_exit(&old_state->arcs_mtx); + mutex_exit(lock); } if (new_state != arc_anon) { - int use_mutex = !MUTEX_HELD(&new_state->arcs_mtx); + int use_mutex; uint64_t *size = &new_state->arcs_lsize[ab->b_type]; + get_buf_info(ab, new_state, &list, &lock); + use_mutex = !MUTEX_HELD(lock); if (use_mutex) - mutex_enter(&new_state->arcs_mtx); + mutex_enter(lock); - list_insert_head(&new_state->arcs_list[ab->b_type], ab); + list_insert_head(list, ab); /* ghost elements have a ghost size */ if (GHOST_STATE(new_state)) { @@ -1072,7 +1219,7 @@ arc_change_state(arc_state_t *new_state, atomic_add_64(size, to_delta); if (use_mutex) - mutex_exit(&new_state->arcs_mtx); + mutex_exit(lock); } } @@ -1462,21 +1609,48 @@ arc_evict(arc_state_t *state, spa_t *spa { arc_state_t *evicted_state; uint64_t bytes_evicted = 0, skipped = 0, missed = 0; + int64_t bytes_remaining; arc_buf_hdr_t *ab, *ab_prev = NULL; - list_t *list = &state->arcs_list[type]; + list_t *evicted_list, *list, *evicted_list_start, *list_start; + kmutex_t *lock, *evicted_lock; kmutex_t *hash_lock; boolean_t have_lock; void *stolen = NULL; + static int evict_metadata_offset, evict_data_offset; + int i, idx, offset, list_count, count; ASSERT(state == arc_mru || state == arc_mfu); evicted_state = (state == arc_mru) ? arc_mru_ghost : arc_mfu_ghost; - mutex_enter(&state->arcs_mtx); - mutex_enter(&evicted_state->arcs_mtx); + if (type == ARC_BUFC_METADATA) { + offset = 0; + list_count = ARC_BUFC_NUMMETADATALISTS; + list_start = &state->arcs_lists[0]; + evicted_list_start = &evicted_state->arcs_lists[0]; + idx = evict_metadata_offset; + } else { + offset = ARC_BUFC_NUMMETADATALISTS; + list_start = &state->arcs_lists[offset]; + evicted_list_start = &evicted_state->arcs_lists[offset]; + list_count = ARC_BUFC_NUMDATALISTS; + idx = evict_data_offset; + } + bytes_remaining = evicted_state->arcs_lsize[type]; + count = 0; + +evict_start: + list = &list_start[idx]; + evicted_list = &evicted_list_start[idx]; + lock = ARCS_LOCK(state, (offset + idx)); + evicted_lock = ARCS_LOCK(evicted_state, (offset + idx)); + + mutex_enter(lock); + mutex_enter(evicted_lock); for (ab = list_tail(list); ab; ab = ab_prev) { ab_prev = list_prev(list, ab); + bytes_remaining -= (ab->b_size * ab->b_datacnt); /* prefetch buffers have a minimum lifespan */ if (HDR_IO_IN_PROGRESS(ab) || (spa && ab->b_spa != spa) || @@ -1536,17 +1710,35 @@ arc_evict(arc_state_t *state, spa_t *spa mutex_exit(hash_lock); if (bytes >= 0 && bytes_evicted >= bytes) break; + if (bytes_remaining > 0) { + mutex_exit(evicted_lock); + mutex_exit(lock); + idx = ((idx + 1) & (list_count - 1)); + count++; + goto evict_start; + } } else { missed += 1; } } - mutex_exit(&evicted_state->arcs_mtx); - mutex_exit(&state->arcs_mtx); + mutex_exit(evicted_lock); + mutex_exit(lock); + + idx = ((idx + 1) & (list_count - 1)); + count++; - if (bytes_evicted < bytes) - dprintf("only evicted %lld bytes from %x", - (longlong_t)bytes_evicted, state); + if (bytes_evicted < bytes) { + if (count < list_count) + goto evict_start; + else + dprintf("only evicted %lld bytes from %x", + (longlong_t)bytes_evicted, state); + } + if (type == ARC_BUFC_METADATA) + evict_metadata_offset = idx; + else + evict_data_offset = idx; if (skipped) ARCSTAT_INCR(arcstat_evict_skip, skipped); @@ -1574,6 +1766,8 @@ arc_evict(arc_state_t *state, spa_t *spa arc_evict_ghost(arc_mfu_ghost, NULL, todelete); } } + if (stolen) + ARCSTAT_BUMP(arcstat_stolen); return (stolen); } @@ -1586,14 +1780,28 @@ static void arc_evict_ghost(arc_state_t *state, spa_t *spa, int64_t bytes) { arc_buf_hdr_t *ab, *ab_prev; - list_t *list = &state->arcs_list[ARC_BUFC_DATA]; - kmutex_t *hash_lock; + list_t *list, *list_start; + kmutex_t *hash_lock, *lock; uint64_t bytes_deleted = 0; uint64_t bufs_skipped = 0; + static int evict_offset; + int list_count, idx = evict_offset; + int offset, count = 0; ASSERT(GHOST_STATE(state)); -top: - mutex_enter(&state->arcs_mtx); + + /* + * data lists come after metadata lists + */ + list_start = &state->arcs_lists[ARC_BUFC_NUMMETADATALISTS]; + list_count = ARC_BUFC_NUMDATALISTS; + offset = ARC_BUFC_NUMMETADATALISTS; + +evict_start: + list = &list_start[idx]; + lock = ARCS_LOCK(state, idx + offset); + + mutex_enter(lock); for (ab = list_tail(list); ab; ab = ab_prev) { ab_prev = list_prev(list, ab); if (spa && ab->b_spa != spa) @@ -1623,20 +1831,31 @@ top: break; } else { if (bytes < 0) { - mutex_exit(&state->arcs_mtx); + /* + * we're draining the ARC, retry + */ + mutex_exit(lock); mutex_enter(hash_lock); mutex_exit(hash_lock); - goto top; + goto evict_start; } bufs_skipped += 1; } } - mutex_exit(&state->arcs_mtx); + mutex_exit(lock); + idx = ((idx + 1) & (ARC_BUFC_NUMDATALISTS - 1)); + count++; + + if (count < list_count) + goto evict_start; - if (list == &state->arcs_list[ARC_BUFC_DATA] && + evict_offset = idx; + if ((uintptr_t)list > (uintptr_t)&state->arcs_lists[ARC_BUFC_NUMMETADATALISTS] && (bytes < 0 || bytes_deleted < bytes)) { - list = &state->arcs_list[ARC_BUFC_METADATA]; - goto top; + list_start = &state->arcs_lists[0]; + list_count = ARC_BUFC_NUMMETADATALISTS; + offset = count = 0; + goto evict_start; } if (bufs_skipped) { @@ -1718,7 +1937,7 @@ arc_do_user_evicts(void) /* * Move list over to avoid LOR */ -restart: +restart: mutex_enter(&arc_eviction_mtx); tmp_arc_eviction_list = arc_eviction_list; arc_eviction_list = NULL; @@ -1750,22 +1969,22 @@ restart: void arc_flush(spa_t *spa) { - while (list_head(&arc_mru->arcs_list[ARC_BUFC_DATA])) { + while (arc_mru->arcs_lsize[ARC_BUFC_DATA]) { (void) arc_evict(arc_mru, spa, -1, FALSE, ARC_BUFC_DATA); if (spa) break; } - while (list_head(&arc_mru->arcs_list[ARC_BUFC_METADATA])) { + while (arc_mru->arcs_lsize[ARC_BUFC_METADATA]) { (void) arc_evict(arc_mru, spa, -1, FALSE, ARC_BUFC_METADATA); if (spa) break; } - while (list_head(&arc_mfu->arcs_list[ARC_BUFC_DATA])) { + while (arc_mfu->arcs_lsize[ARC_BUFC_DATA]) { (void) arc_evict(arc_mfu, spa, -1, FALSE, ARC_BUFC_DATA); if (spa) break; } - while (list_head(&arc_mfu->arcs_list[ARC_BUFC_METADATA])) { + while (arc_mfu->arcs_lsize[ARC_BUFC_METADATA]) { (void) arc_evict(arc_mfu, spa, -1, FALSE, ARC_BUFC_METADATA); if (spa) break; @@ -1829,7 +2048,7 @@ arc_reclaim_needed(void) return (0); /* - * If pages are needed or we're within 2048 pages + * If pages are needed or we're within 2048 pages * of needing to page need to reclaim */ if (vm_pages_needed || (vm_paging_target() > -2048)) @@ -1896,8 +2115,6 @@ arc_kmem_reap_now(arc_reclaim_strategy_t size_t i; kmem_cache_t *prev_cache = NULL; kmem_cache_t *prev_data_cache = NULL; - extern kmem_cache_t *zio_buf_cache[]; - extern kmem_cache_t *zio_data_buf_cache[]; #endif #ifdef _KERNEL @@ -2203,6 +2420,7 @@ out: arc_anon->arcs_size + arc_mru->arcs_size > arc_p) arc_p = MIN(arc_c, arc_p + size); } + ARCSTAT_BUMP(arcstat_allocated); } /* @@ -2502,7 +2720,6 @@ arc_read(zio_t *pio, spa_t *spa, blkptr_ uint32_t *arc_flags, const zbookmark_t *zb) { int err; - arc_buf_hdr_t *hdr = pbuf->b_hdr; ASSERT(!refcount_is_zero(&pbuf->b_hdr->b_refcnt)); ASSERT3U((char *)bp - (char *)pbuf->b_data, <, pbuf->b_hdr->b_size); @@ -2510,8 +2727,6 @@ arc_read(zio_t *pio, spa_t *spa, blkptr_ err = arc_read_nolock(pio, spa, bp, done, private, priority, zio_flags, arc_flags, zb); - - ASSERT3P(hdr, ==, pbuf->b_hdr); rw_exit(&pbuf->b_lock); return (err); } @@ -2728,7 +2943,7 @@ top: * released by l2arc_read_done(). */ rzio = zio_read_phys(pio, vd, addr, size, - buf->b_data, ZIO_CHECKSUM_OFF, + buf->b_data, ZIO_CHECKSUM_OFF, l2arc_read_done, cb, priority, zio_flags | ZIO_FLAG_DONT_CACHE | ZIO_FLAG_CANFAIL | ZIO_FLAG_DONT_PROPAGATE | @@ -2823,6 +3038,8 @@ arc_buf_evict(arc_buf_t *buf) arc_buf_hdr_t *hdr; kmutex_t *hash_lock; arc_buf_t **bufp; + list_t *list, *evicted_list; + kmutex_t *lock, *evicted_lock; rw_enter(&buf->b_lock, RW_WRITER); hdr = buf->b_hdr; @@ -2871,16 +3088,18 @@ arc_buf_evict(arc_buf_t *buf) evicted_state = (old_state == arc_mru) ? arc_mru_ghost : arc_mfu_ghost; - mutex_enter(&old_state->arcs_mtx); - mutex_enter(&evicted_state->arcs_mtx); + get_buf_info(hdr, old_state, &list, &lock); + get_buf_info(hdr, evicted_state, &evicted_list, &evicted_lock); + mutex_enter(lock); + mutex_enter(evicted_lock); arc_change_state(evicted_state, hdr, hash_lock); ASSERT(HDR_IN_HASH_TABLE(hdr)); hdr->b_flags |= ARC_IN_HASH_TABLE; hdr->b_flags &= ~ARC_BUF_AVAILABLE; - mutex_exit(&evicted_state->arcs_mtx); - mutex_exit(&old_state->arcs_mtx); + mutex_exit(evicted_lock); + mutex_exit(lock); } mutex_exit(hash_lock); rw_exit(&buf->b_lock); @@ -3426,7 +3645,8 @@ void arc_init(void) { int prefetch_tunable_set = 0; - + int i; + mutex_init(&arc_reclaim_thr_lock, NULL, MUTEX_DEFAULT, NULL); cv_init(&arc_reclaim_thr_cv, NULL, CV_DEFAULT, NULL); mutex_init(&arc_lowmem_lock, NULL, MUTEX_DEFAULT, NULL); @@ -3494,33 +3714,33 @@ arc_init(void) arc_l2c_only = &ARC_l2c_only; arc_size = 0; - mutex_init(&arc_anon->arcs_mtx, NULL, MUTEX_DEFAULT, NULL); - mutex_init(&arc_mru->arcs_mtx, NULL, MUTEX_DEFAULT, NULL); - mutex_init(&arc_mru_ghost->arcs_mtx, NULL, MUTEX_DEFAULT, NULL); - mutex_init(&arc_mfu->arcs_mtx, NULL, MUTEX_DEFAULT, NULL); - mutex_init(&arc_mfu_ghost->arcs_mtx, NULL, MUTEX_DEFAULT, NULL); - mutex_init(&arc_l2c_only->arcs_mtx, NULL, MUTEX_DEFAULT, NULL); - - list_create(&arc_mru->arcs_list[ARC_BUFC_METADATA], - sizeof (arc_buf_hdr_t), offsetof(arc_buf_hdr_t, b_arc_node)); - list_create(&arc_mru->arcs_list[ARC_BUFC_DATA], - sizeof (arc_buf_hdr_t), offsetof(arc_buf_hdr_t, b_arc_node)); - list_create(&arc_mru_ghost->arcs_list[ARC_BUFC_METADATA], - sizeof (arc_buf_hdr_t), offsetof(arc_buf_hdr_t, b_arc_node)); - list_create(&arc_mru_ghost->arcs_list[ARC_BUFC_DATA], - sizeof (arc_buf_hdr_t), offsetof(arc_buf_hdr_t, b_arc_node)); - list_create(&arc_mfu->arcs_list[ARC_BUFC_METADATA], - sizeof (arc_buf_hdr_t), offsetof(arc_buf_hdr_t, b_arc_node)); - list_create(&arc_mfu->arcs_list[ARC_BUFC_DATA], - sizeof (arc_buf_hdr_t), offsetof(arc_buf_hdr_t, b_arc_node)); - list_create(&arc_mfu_ghost->arcs_list[ARC_BUFC_METADATA], - sizeof (arc_buf_hdr_t), offsetof(arc_buf_hdr_t, b_arc_node)); - list_create(&arc_mfu_ghost->arcs_list[ARC_BUFC_DATA], - sizeof (arc_buf_hdr_t), offsetof(arc_buf_hdr_t, b_arc_node)); - list_create(&arc_l2c_only->arcs_list[ARC_BUFC_METADATA], - sizeof (arc_buf_hdr_t), offsetof(arc_buf_hdr_t, b_arc_node)); - list_create(&arc_l2c_only->arcs_list[ARC_BUFC_DATA], - sizeof (arc_buf_hdr_t), offsetof(arc_buf_hdr_t, b_arc_node)); + for (i = 0; i < ARC_BUFC_NUMLISTS; i++) { + mutex_init(&arc_anon->arcs_locks[i].arcs_lock, + NULL, MUTEX_DEFAULT, NULL); + mutex_init(&arc_mru->arcs_locks[i].arcs_lock, + NULL, MUTEX_DEFAULT, NULL); + mutex_init(&arc_mru_ghost->arcs_locks[i].arcs_lock, + NULL, MUTEX_DEFAULT, NULL); + mutex_init(&arc_mfu->arcs_locks[i].arcs_lock, + NULL, MUTEX_DEFAULT, NULL); + mutex_init(&arc_mfu_ghost->arcs_locks[i].arcs_lock, + NULL, MUTEX_DEFAULT, NULL); + mutex_init(&arc_l2c_only->arcs_locks[i].arcs_lock, + NULL, MUTEX_DEFAULT, NULL); + + list_create(&arc_mru->arcs_lists[i], + sizeof (arc_buf_hdr_t), offsetof(arc_buf_hdr_t, b_arc_node)); + list_create(&arc_mru_ghost->arcs_lists[i], + sizeof (arc_buf_hdr_t), offsetof(arc_buf_hdr_t, b_arc_node)); + list_create(&arc_mfu->arcs_lists[i], + sizeof (arc_buf_hdr_t), offsetof(arc_buf_hdr_t, b_arc_node)); + list_create(&arc_mfu_ghost->arcs_lists[i], + sizeof (arc_buf_hdr_t), offsetof(arc_buf_hdr_t, b_arc_node)); + list_create(&arc_mfu_ghost->arcs_lists[i], + sizeof (arc_buf_hdr_t), offsetof(arc_buf_hdr_t, b_arc_node)); + list_create(&arc_l2c_only->arcs_lists[i], + sizeof (arc_buf_hdr_t), offsetof(arc_buf_hdr_t, b_arc_node)); + } buf_init(); @@ -3557,7 +3777,7 @@ arc_init(void) #ifdef _KERNEL if (TUNABLE_INT_FETCH("vfs.zfs.prefetch_disable", &zfs_prefetch_disable)) prefetch_tunable_set = 1; - + #ifdef __i386__ if (prefetch_tunable_set == 0) { printf("ZFS NOTICE: Prefetch is disabled by default on i386 " @@ -3566,7 +3786,7 @@ arc_init(void) "to /boot/loader.conf.\n"); zfs_prefetch_disable=1; } -#else +#else if ((((uint64_t)physmem * PAGESIZE) < (1ULL << 32)) && prefetch_tunable_set == 0) { printf("ZFS NOTICE: Prefetch is disabled by default if less " @@ -3575,7 +3795,7 @@ arc_init(void) "to /boot/loader.conf.\n"); zfs_prefetch_disable=1; } -#endif +#endif /* Warn about ZFS memory and address space requirements. */ if (((uint64_t)physmem * PAGESIZE) < (256 + 128 + 64) * (1 << 20)) { printf("ZFS WARNING: Recommended minimum RAM size is 512MB; " @@ -3594,6 +3814,7 @@ arc_init(void) void arc_fini(void) { + int i; mutex_enter(&arc_reclaim_thr_lock); arc_thread_exit = 1; @@ -3615,20 +3836,20 @@ arc_fini(void) mutex_destroy(&arc_reclaim_thr_lock); cv_destroy(&arc_reclaim_thr_cv); - list_destroy(&arc_mru->arcs_list[ARC_BUFC_METADATA]); - list_destroy(&arc_mru_ghost->arcs_list[ARC_BUFC_METADATA]); - list_destroy(&arc_mfu->arcs_list[ARC_BUFC_METADATA]); - list_destroy(&arc_mfu_ghost->arcs_list[ARC_BUFC_METADATA]); - list_destroy(&arc_mru->arcs_list[ARC_BUFC_DATA]); - list_destroy(&arc_mru_ghost->arcs_list[ARC_BUFC_DATA]); - list_destroy(&arc_mfu->arcs_list[ARC_BUFC_DATA]); - list_destroy(&arc_mfu_ghost->arcs_list[ARC_BUFC_DATA]); - - mutex_destroy(&arc_anon->arcs_mtx); - mutex_destroy(&arc_mru->arcs_mtx); - mutex_destroy(&arc_mru_ghost->arcs_mtx); - mutex_destroy(&arc_mfu->arcs_mtx); - mutex_destroy(&arc_mfu_ghost->arcs_mtx); + for (i = 0; i < ARC_BUFC_NUMLISTS; i++) { + list_destroy(&arc_mru->arcs_lists[i]); + list_destroy(&arc_mru_ghost->arcs_lists[i]); + list_destroy(&arc_mfu->arcs_lists[i]); + list_destroy(&arc_mfu_ghost->arcs_lists[i]); + list_destroy(&arc_l2c_only->arcs_lists[i]); + + mutex_destroy(&arc_anon->arcs_locks[i].arcs_lock); + mutex_destroy(&arc_mru->arcs_locks[i].arcs_lock); + mutex_destroy(&arc_mru_ghost->arcs_locks[i].arcs_lock); + mutex_destroy(&arc_mfu->arcs_locks[i].arcs_lock); + mutex_destroy(&arc_mfu_ghost->arcs_locks[i].arcs_lock); + mutex_destroy(&arc_l2c_only->arcs_locks[i].arcs_lock); + } mutex_destroy(&zfs_write_limit_lock); @@ -4024,26 +4245,27 @@ static list_t * l2arc_list_locked(int list_num, kmutex_t **lock) { list_t *list; + int idx; - ASSERT(list_num >= 0 && list_num <= 3); + ASSERT(list_num >= 0 && list_num < 2 * ARC_BUFC_NUMLISTS); - switch (list_num) { - case 0: - list = &arc_mfu->arcs_list[ARC_BUFC_METADATA]; - *lock = &arc_mfu->arcs_mtx; - break; - case 1: - list = &arc_mru->arcs_list[ARC_BUFC_METADATA]; - *lock = &arc_mru->arcs_mtx; - break; - case 2: - list = &arc_mfu->arcs_list[ARC_BUFC_DATA]; - *lock = &arc_mfu->arcs_mtx; - break; - case 3: - list = &arc_mru->arcs_list[ARC_BUFC_DATA]; - *lock = &arc_mru->arcs_mtx; - break; + if (list_num < ARC_BUFC_NUMMETADATALISTS) { + idx = list_num; + list = &arc_mfu->arcs_lists[idx]; + *lock = ARCS_LOCK(arc_mfu, idx); + } else if (list_num < ARC_BUFC_NUMMETADATALISTS * 2) { + idx = list_num - ARC_BUFC_NUMMETADATALISTS; + list = &arc_mru->arcs_lists[idx]; + *lock = ARCS_LOCK(arc_mru, idx); + } else if (list_num < (ARC_BUFC_NUMMETADATALISTS * 2 + + ARC_BUFC_NUMDATALISTS)) { + idx = list_num - ARC_BUFC_NUMMETADATALISTS; + list = &arc_mfu->arcs_lists[idx]; + *lock = ARCS_LOCK(arc_mfu, idx); + } else { + idx = list_num - ARC_BUFC_NUMLISTS; + list = &arc_mru->arcs_lists[idx]; + *lock = ARCS_LOCK(arc_mru, idx); } ASSERT(!(MUTEX_HELD(*lock))); @@ -4210,13 +4432,15 @@ l2arc_write_buffers(spa_t *spa, l2arc_de head = kmem_cache_alloc(hdr_cache, KM_PUSHPAGE); head->b_flags |= ARC_L2_WRITE_HEAD; + ARCSTAT_BUMP(arcstat_l2_write_buffer_iter); /* * Copy buffers for L2ARC writing. */ mutex_enter(&l2arc_buflist_mtx); - for (try = 0; try <= 3; try++) { + for (try = 0; try < 2 * ARC_BUFC_NUMLISTS; try++) { list = l2arc_list_locked(try, &list_lock); passed_sz = 0; + ARCSTAT_BUMP(arcstat_l2_write_buffer_list_iter); /* * L2ARC fast warmup. @@ -4229,52 +4453,65 @@ l2arc_write_buffers(spa_t *spa, l2arc_de ab = list_head(list); else ab = list_tail(list); + if (ab == NULL) + ARCSTAT_BUMP(arcstat_l2_write_buffer_list_null_iter); for (; ab; ab = ab_prev) { if (arc_warm == B_FALSE) ab_prev = list_next(list, ab); else ab_prev = list_prev(list, ab); + ARCSTAT_INCR(arcstat_l2_write_buffer_bytes_scanned, ab->b_size); hash_lock = HDR_LOCK(ab); have_lock = MUTEX_HELD(hash_lock); if (!have_lock && !mutex_tryenter(hash_lock)) { + ARCSTAT_BUMP(arcstat_l2_write_trylock_fail); /* * Skip this buffer rather than waiting. */ continue; } + if (ab->b_l2hdr != NULL) { + /* + * Already in L2ARC. + */ + mutex_exit(hash_lock); + ARCSTAT_BUMP(arcstat_l2_write_in_l2); + continue; + } + passed_sz += ab->b_size; if (passed_sz > headroom) { /* * Searched too far. */ mutex_exit(hash_lock); + ARCSTAT_BUMP(arcstat_l2_write_passed_headroom); break; } if (ab->b_spa != spa) { mutex_exit(hash_lock); + ARCSTAT_BUMP(arcstat_l2_write_spa_mismatch); continue; } - if (ab->b_l2hdr != NULL) { - /* - * Already in L2ARC. - */ + if (HDR_IO_IN_PROGRESS(ab)) { mutex_exit(hash_lock); + ARCSTAT_BUMP(arcstat_l2_write_hdr_io_in_progress); continue; } - - if (HDR_IO_IN_PROGRESS(ab) || !HDR_L2CACHE(ab)) { + if (!HDR_L2CACHE(ab)) { mutex_exit(hash_lock); + ARCSTAT_BUMP(arcstat_l2_write_not_cacheable); continue; } - if ((write_sz + ab->b_size) > target_sz) { full = B_TRUE; mutex_exit(hash_lock); + ARCSTAT_BUMP(arcstat_l2_write_full); break; } @@ -4298,8 +4535,10 @@ l2arc_write_buffers(spa_t *spa, l2arc_de cb->l2wcb_head = head; pio = zio_root(spa, l2arc_write_done, cb, ZIO_FLAG_CANFAIL); + ARCSTAT_BUMP(arcstat_l2_write_pios); } + ARCSTAT_INCR(arcstat_l2_write_bytes_written, ab->b_size); /* * Create and add a new L2ARC header. */ @@ -4395,7 +4634,7 @@ l2arc_feed_thread(void *dummy __unused) */ CALLB_CPR_SAFE_BEGIN(&cpr); (void) cv_timedwait(&l2arc_feed_thr_cv, &l2arc_feed_thr_lock, - hz * l2arc_feed_secs); + hz * l2arc_feed_secs >> l2arc_feed_secs_shift); CALLB_CPR_SAFE_END(&cpr, &l2arc_feed_thr_lock); /* Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Sun Apr 18 21:29:28 2010 (r206814) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Sun Apr 18 21:36:34 2010 (r206815) @@ -2210,9 +2210,6 @@ dbuf_write_ready(zio_t *zio, arc_buf_t * for (i = db->db.db_size >> SPA_BLKPTRSHIFT; i > 0; i--, ibp++) { if (BP_IS_HOLE(ibp)) continue; - ASSERT3U(BP_GET_LSIZE(ibp), ==, - db->db_level == 1 ? dn->dn_datablksz : - (1<dn_phys->dn_indblkshift)); fill += ibp->blk_fill; } } Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c Sun Apr 18 21:29:28 2010 (r206814) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c Sun Apr 18 21:36:34 2010 (r206815) @@ -49,11 +49,11 @@ uint32_t zfetch_block_cap = 256; uint64_t zfetch_array_rd_sz = 1024 * 1024; SYSCTL_DECL(_vfs_zfs); -SYSCTL_INT(_vfs_zfs, OID_AUTO, prefetch_disable, CTLFLAG_RDTUN, +SYSCTL_INT(_vfs_zfs, OID_AUTO, prefetch_disable, CTLFLAG_RW, &zfs_prefetch_disable, 0, "Disable prefetch"); SYSCTL_NODE(_vfs_zfs, OID_AUTO, zfetch, CTLFLAG_RW, 0, "ZFS ZFETCH"); TUNABLE_INT("vfs.zfs.zfetch.max_streams", &zfetch_max_streams); -SYSCTL_UINT(_vfs_zfs_zfetch, OID_AUTO, max_streams, CTLFLAG_RDTUN, +SYSCTL_UINT(_vfs_zfs_zfetch, OID_AUTO, max_streams, CTLFLAG_RW, &zfetch_max_streams, 0, "Max # of streams per zfetch"); TUNABLE_INT("vfs.zfs.zfetch.min_sec_reap", &zfetch_min_sec_reap); SYSCTL_UINT(_vfs_zfs_zfetch, OID_AUTO, min_sec_reap, CTLFLAG_RDTUN, @@ -338,8 +338,10 @@ top: *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-8@FreeBSD.ORG Sun Apr 18 22:51:16 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C5B2106566C; Sun, 18 Apr 2010 22:51:16 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2A75C8FC1B; Sun, 18 Apr 2010 22:51:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3IMpGVk018259; Sun, 18 Apr 2010 22:51:16 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3IMpGJb018257; Sun, 18 Apr 2010 22:51:16 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201004182251.o3IMpGJb018257@svn.freebsd.org> From: Rick Macklem Date: Sun, 18 Apr 2010 22:51:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206821 - stable/8/sys/fs/nfsserver X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Apr 2010 22:51:16 -0000 Author: rmacklem Date: Sun Apr 18 22:51:15 2010 New Revision: 206821 URL: http://svn.freebsd.org/changeset/base/206821 Log: MFC: r206170 Harden the experimental NFS server a little, by adding extra checks in the readdir functions for non-positive byte count arguments. For the negative case, set it to the maximum allowable, since it was actually a large positive value (unsigned) on the wire. Also, fix up the readdir function comment a bit. Modified: stable/8/sys/fs/nfsserver/nfs_nfsdport.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/dev/uath/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdport.c Sun Apr 18 22:34:29 2010 (r206820) +++ stable/8/sys/fs/nfsserver/nfs_nfsdport.c Sun Apr 18 22:51:15 2010 (r206821) @@ -1397,24 +1397,16 @@ nfsvno_fillattr(struct nfsrv_descript *n * nfs readdir service * - mallocs what it thinks is enough to read * count rounded up to a multiple of DIRBLKSIZ <= NFS_MAXREADDIR - * - calls nfsvno_readdir() + * - calls VOP_READDIR() * - loops around building the reply * if the output generated exceeds count break out of loop * The NFSM_CLGET macro is used here so that the reply will be packed * tightly in mbuf clusters. - * - it only knows that it has encountered eof when the nfsvno_readdir() - * reads nothing - * - as such one readdir rpc will return eof false although you are there - * and then the next will return eof * - it trims out records with d_fileno == 0 * this doesn't matter for Unix clients, but they might confuse clients * for other os'. * - it trims out records with d_type == DT_WHT * these cannot be seen through NFS (unless we extend the protocol) - * NB: It is tempting to set eof to true if the nfsvno_readdir() reads less - * than requested, but this may not apply to all filesystems. For - * example, client NFS does not { although it is never remote mounted - * anyhow } * The alternate call nfsrvd_readdirplus() does lookups as well. * PS: The NFS protocol spec. does not clarify what the "count" byte * argument is a count of.. just name strings and file id's or the @@ -1456,7 +1448,7 @@ nfsrvd_readdir(struct nfsrv_descript *nd } toff = off; cnt = fxdr_unsigned(int, *tl); - if (cnt > NFS_SRVMAXDATA(nd)) + if (cnt > NFS_SRVMAXDATA(nd) || cnt < 0) cnt = NFS_SRVMAXDATA(nd); siz = ((cnt + DIRBLKSIZ - 1) & ~(DIRBLKSIZ - 1)); fullsiz = siz; @@ -1474,6 +1466,13 @@ nfsrvd_readdir(struct nfsrv_descript *nd nd->nd_repstat = NFSERR_BAD_COOKIE; #endif } + if (nd->nd_repstat == 0 && cnt == 0) { + if (nd->nd_flag & ND_NFSV2) + /* NFSv2 does not have NFSERR_TOOSMALL */ + nd->nd_repstat = EPERM; + else + nd->nd_repstat = NFSERR_TOOSMALL; + } if (!nd->nd_repstat) nd->nd_repstat = nfsvno_accchk(vp, VEXEC, nd->nd_cred, exp, p, NFSACCCHK_NOOVERRIDE, @@ -1696,7 +1695,7 @@ nfsrvd_readdirplus(struct nfsrv_descript * Use the server's maximum data transfer size as the upper bound * on reply datalen. */ - if (cnt > NFS_SRVMAXDATA(nd)) + if (cnt > NFS_SRVMAXDATA(nd) || cnt < 0) cnt = NFS_SRVMAXDATA(nd); /* @@ -1705,7 +1704,7 @@ nfsrvd_readdirplus(struct nfsrv_descript * so I set it to cnt for that case. I also round it up to the * next multiple of DIRBLKSIZ. */ - if (siz == 0) + if (siz <= 0) siz = cnt; siz = ((siz + DIRBLKSIZ - 1) & ~(DIRBLKSIZ - 1)); From owner-svn-src-stable-8@FreeBSD.ORG Mon Apr 19 04:54:35 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 276DB106564A; Mon, 19 Apr 2010 04:54:35 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 15F6E8FC12; Mon, 19 Apr 2010 04:54:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3J4sYWu098274; Mon, 19 Apr 2010 04:54:34 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3J4sYgb098272; Mon, 19 Apr 2010 04:54:34 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201004190454.o3J4sYgb098272@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Mon, 19 Apr 2010 04:54:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206828 - stable/8/etc/mtree X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2010 04:54:35 -0000 Author: pjd Date: Mon Apr 19 04:54:34 2010 New Revision: 206828 URL: http://svn.freebsd.org/changeset/base/206828 Log: MFC r204080: Create a directory for hast's examples. Modified: stable/8/etc/mtree/BSD.usr.dist Directory Properties: stable/8/etc/ (props changed) Modified: stable/8/etc/mtree/BSD.usr.dist ============================================================================== --- stable/8/etc/mtree/BSD.usr.dist Mon Apr 19 04:22:45 2010 (r206827) +++ stable/8/etc/mtree/BSD.usr.dist Mon Apr 19 04:54:34 2010 (r206828) @@ -211,6 +211,8 @@ .. find_interface .. + hast + .. hostapd .. ibcs2 From owner-svn-src-stable-8@FreeBSD.ORG Mon Apr 19 06:51:59 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B4611106564A; Mon, 19 Apr 2010 06:51:59 +0000 (UTC) (envelope-from ndenev@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.158]) by mx1.freebsd.org (Postfix) with ESMTP id CEE4C8FC2F; Mon, 19 Apr 2010 06:51:58 +0000 (UTC) Received: by fg-out-1718.google.com with SMTP id e12so1669923fga.13 for ; Sun, 18 Apr 2010 23:51:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:mime-version :content-type:from:in-reply-to:date:cc:content-transfer-encoding :message-id:references:to:x-mailer; bh=JzofWUnxh9MP28ymFg3J5SAvAQqqk0T4/xXbFQ2EA28=; b=JGnvGgzjABSNEnth/fWbFMGkQa5X0Klcn8Uz/B31p70xS5f6KwRi54VG1Aq0o97s38 4mBHcye7hWZjlmf0MB/eedn0MlnSOk3EwHUmFEVIyRZgcEmjzsnmIyl5at9jdq7q4v8F uTXIRjbvCiKHFMfCUTGAu8Ag7P3i37oqERnMs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; b=W+CMPNoR3n/+vVREhj+Drrl2W3qC8rc91PJNJpcjVuM9JESa7Jk9xAeqfa0NcTqPtX G2Nib4ph3usM7z4U27aL+9zYbD9IUQl1vQ7A09Bb2Nof7Lgeczg6tiWcIhlnnEy+xV1J DswVw8NTJIEGgB6HOzIJ7zJYs3aw+tKbnnfTc= Received: by 10.223.63.138 with SMTP id b10mr2382043fai.95.1271658510497; Sun, 18 Apr 2010 23:28:30 -0700 (PDT) Received: from mbp-gige.totalterror.net (93-152-151-19.ddns.onlinedirect.bg [93.152.151.19]) by mx.google.com with ESMTPS id 21sm9721623fks.23.2010.04.18.23.28.28 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 18 Apr 2010 23:28:29 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v1078) Content-Type: text/plain; charset=us-ascii From: Nikolay Denev In-Reply-To: <201004180115.o3I1FlLh027356@svn.freebsd.org> Date: Mon, 19 Apr 2010 09:28:27 +0300 Content-Transfer-Encoding: quoted-printable Message-Id: <322ABBFE-C469-48FB-87FD-C00124238724@gmail.com> References: <201004180115.o3I1FlLh027356@svn.freebsd.org> To: Warner Losh X-Mailer: Apple Mail (2.1078) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r206782 - stable/8/sys/conf X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2010 06:51:59 -0000 On 18 Apr, 2010, at 04:15 , Warner Losh wrote: > Author: imp > Date: Sun Apr 18 01:15:47 2010 > New Revision: 206782 > URL: http://svn.freebsd.org/changeset/base/206782 >=20 > Log: > Remap COMPAT_IA32 to COMPAT_FREEBSD32 to ease the transition of this > option and not break 8.0 config files later in the 8.x branch. >=20 > # Yes, this is a direct commit, since this is not relevant to head. >=20 > Modified: > stable/8/sys/conf/options.amd64 > stable/8/sys/conf/options.ia64 >=20 > Modified: stable/8/sys/conf/options.amd64 > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- stable/8/sys/conf/options.amd64 Sun Apr 18 00:57:30 2010 = (r206781) > +++ stable/8/sys/conf/options.amd64 Sun Apr 18 01:15:47 2010 = (r206782) > @@ -11,6 +11,7 @@ MP_WATCHDOG > # Options for emulators. These should only be used at config time, so > # they are handled like options for static filesystems > # (see src/sys/conf/options), except for broken debugging options. > +COMPAT_IA32 =3D COMPAT_FREEBSD32 > COMPAT_FREEBSD32 opt_compat.h > #IBCS2 opt_dontuse.h > #COMPAT_LINUX opt_dontuse.h >=20 > Modified: stable/8/sys/conf/options.ia64 > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- stable/8/sys/conf/options.ia64 Sun Apr 18 00:57:30 2010 = (r206781) > +++ stable/8/sys/conf/options.ia64 Sun Apr 18 01:15:47 2010 = (r206782) > @@ -9,6 +9,7 @@ LOG2_PAGE_SIZE opt_global.h >=20 > UWX_TRACE_ENABLE opt_global.h >=20 > +COMPAT_IA32 =3D COMPAT_FREEBSD32 > COMPAT_FREEBSD32 opt_compat.h >=20 > EXCEPTION_TRACING opt_xtrace.h >=20 Hi, After this change I can no longer compile a kernel : nas# make -j8 buildkernel WITH_CTF=3D1 -------------------------------------------------------------- >>> Kernel build for NAS started on Mon Apr 19 09:25:57 EEST 2010 -------------------------------------------------------------- =3D=3D=3D> NAS mkdir -p /usr/obj/usr/src/sys -------------------------------------------------------------- >>> stage 1: configuring the kernel -------------------------------------------------------------- cd /usr/src/sys/amd64/conf; = PATH=3D/usr/obj/usr/src/tmp/legacy/usr/sbin:/usr/obj/usr/src/tmp/legacy/us= r/bin:/usr/obj/usr/src/tmp/legacy/usr/games:/usr/obj/usr/src/tmp/usr/sbin:= /usr/obj/usr/src/tmp/usr/bin:/usr/obj/usr/src/tmp/usr/games:/sbin:/bin:/us= r/sbin:/usr/bin config -d /usr/obj/usr/src/sys/NAS = /usr/src/sys/amd64/conf/NAS ../../conf/options.amd64: Duplicate option COMPAT_FREEBSD32. *** Error code 1 1 error *** Error code 2 1 error When the change is reverted everything compiles ok. -- Regards, Nikolay Denev From owner-svn-src-stable-8@FreeBSD.ORG Mon Apr 19 10:16:36 2010 Return-Path: Delivered-To: svn-src-stable-8@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9CDF0106564A; Mon, 19 Apr 2010 10:16:36 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 4E5518FC08; Mon, 19 Apr 2010 10:16:36 +0000 (UTC) Received: from [10.0.0.3] (warner-iphone.bsdimp.com [10.0.0.3]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o3JA8n6T044606; Mon, 19 Apr 2010 04:08:49 -0600 (MDT) (envelope-from imp@bsdimp.com) From: Warner Losh To: Nikolay Denev In-Reply-To: <322ABBFE-C469-48FB-87FD-C00124238724@gmail.com> X-Mailer: iPhone Mail (7E18) References: <201004180115.o3I1FlLh027356@svn.freebsd.org> <322ABBFE-C469-48FB-87FD-C00124238724@gmail.com> Message-Id: <98983E26-D091-42C8-B920-8D4F917E5019@bsdimp.com> Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (iPhone Mail 7E18) Date: Mon, 19 Apr 2010 04:08:46 -0600 Cc: "svn-src-stable@FreeBSD.org" , "svn-src-all@FreeBSD.org" , "src-committers@FreeBSD.org" , Warner Losh , "svn-src-stable-8@FreeBSD.org" Subject: Re: svn commit: r206782 - stable/8/sys/conf X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2010 10:16:36 -0000 Nikolay Did you do a buildworld after updating the sources before the buildkernel? Warner On Apr 19, 2010, at 12:28 AM, Nikolay Denev wrote: > On 18 Apr, 2010, at 04:15 , Warner Losh wrote: > >> Author: imp >> Date: Sun Apr 18 01:15:47 2010 >> New Revision: 206782 >> URL: http://svn.freebsd.org/changeset/base/206782 >> >> Log: >> Remap COMPAT_IA32 to COMPAT_FREEBSD32 to ease the transition of this >> option and not break 8.0 config files later in the 8.x branch. >> >> # Yes, this is a direct commit, since this is not relevant to head. >> >> Modified: >> stable/8/sys/conf/options.amd64 >> stable/8/sys/conf/options.ia64 >> >> Modified: stable/8/sys/conf/options.amd64 >> === >> === >> === >> ===================================================================== >> --- stable/8/sys/conf/options.amd64 Sun Apr 18 00:57:30 2010 >> (r206781) >> +++ stable/8/sys/conf/options.amd64 Sun Apr 18 01:15:47 2010 >> (r206782) >> @@ -11,6 +11,7 @@ MP_WATCHDOG >> # Options for emulators. These should only be used at config time, >> so >> # they are handled like options for static filesystems >> # (see src/sys/conf/options), except for broken debugging options. >> +COMPAT_IA32 = COMPAT_FREEBSD32 >> COMPAT_FREEBSD32 opt_compat.h >> #IBCS2 opt_dontuse.h >> #COMPAT_LINUX opt_dontuse.h >> >> Modified: stable/8/sys/conf/options.ia64 >> === >> === >> === >> ===================================================================== >> --- stable/8/sys/conf/options.ia64 Sun Apr 18 00:57:30 2010 >> (r206781) >> +++ stable/8/sys/conf/options.ia64 Sun Apr 18 01:15:47 2010 >> (r206782) >> @@ -9,6 +9,7 @@ LOG2_PAGE_SIZE opt_global.h >> >> UWX_TRACE_ENABLE opt_global.h >> >> +COMPAT_IA32 = COMPAT_FREEBSD32 >> COMPAT_FREEBSD32 opt_compat.h >> >> EXCEPTION_TRACING opt_xtrace.h >> > > > > Hi, > > After this change I can no longer compile a kernel : > > nas# make -j8 buildkernel WITH_CTF=1 > -------------------------------------------------------------- >>>> Kernel build for NAS started on Mon Apr 19 09:25:57 EEST 2010 > -------------------------------------------------------------- > ===> NAS > mkdir -p /usr/obj/usr/src/sys > -------------------------------------------------------------- >>>> stage 1: configuring the kernel > -------------------------------------------------------------- > cd /usr/src/sys/amd64/conf; PATH=/usr/obj/usr/src/tmp/legacy/usr/ > sbin:/usr/obj/usr/src/tmp/legacy/usr/bin:/usr/obj/usr/src/tmp/legacy/ > usr/games:/usr/obj/usr/src/tmp/usr/sbin:/usr/obj/usr/src/tmp/usr/ > bin:/usr/obj/usr/src/tmp/usr/games:/sbin:/bin:/usr/sbin:/usr/bin > config -d /usr/obj/usr/src/sys/NAS /usr/src/sys/amd64/conf/NAS > ../../conf/options.amd64: Duplicate option COMPAT_FREEBSD32. > *** Error code 1 > 1 error > *** Error code 2 > 1 error > > When the change is reverted everything compiles ok. > > -- > Regards, > Nikolay Denev > > > > > > > From owner-svn-src-stable-8@FreeBSD.ORG Mon Apr 19 11:34:50 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A3194106564A; Mon, 19 Apr 2010 11:34:50 +0000 (UTC) (envelope-from ndenev@gmail.com) Received: from mail-ew0-f224.google.com (mail-ew0-f224.google.com [209.85.219.224]) by mx1.freebsd.org (Postfix) with ESMTP id 806958FC0C; Mon, 19 Apr 2010 11:34:49 +0000 (UTC) Received: by ewy24 with SMTP id 24so1308936ewy.33 for ; Mon, 19 Apr 2010 04:34:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:mime-version :content-type:from:in-reply-to:date:cc:content-transfer-encoding :message-id:references:to:x-mailer; bh=l/NZis/UTbVsOzdCDwNG2TOlypjJ0y5Dcnds6klF04M=; b=IuH/NJ3QddRVRefqkd7ACy5mpDcR7fuKlRAcU02vhBn5OZTszSJVjogiVx6O5eGbQf wYLcSRamwo4RlsqlsfUjXPEfn2DKHfMBiTma5oL7D+FSzoe9MxSyrRTAjb/LZj2kyBTG N1QThTRx62B7BhqdAB3fi7AHmMxkgO3B4qAiI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; b=clj6/NCt9aPDTvXHKWHMFwJE0iLF5Z+mxTSTSpatgXbJ8qRCH1CJxDUm5gyeQpee82 KHanXHo+Vik9f9CqyYZZm4f2wG57zeLxDrI1UOekwfsNGrhpHpVYS2xmV+vefC87vDRC KEs8YokBacwSfV2WG4dFdKT9wtWbVDmcMUjME= Received: by 10.103.69.2 with SMTP id w2mr6298muk.18.1271676887433; Mon, 19 Apr 2010 04:34:47 -0700 (PDT) Received: from ndenevsa.sof.moneybookers.net ([195.34.111.178]) by mx.google.com with ESMTPS id y6sm27332959mug.50.2010.04.19.04.34.45 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 19 Apr 2010 04:34:46 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v1078) Content-Type: text/plain; charset=us-ascii From: Nikolay Denev In-Reply-To: <98983E26-D091-42C8-B920-8D4F917E5019@bsdimp.com> Date: Mon, 19 Apr 2010 14:34:44 +0300 Content-Transfer-Encoding: 7bit Message-Id: <677AD4C7-275F-40B3-821C-B23497950ABF@gmail.com> References: <201004180115.o3I1FlLh027356@svn.freebsd.org> <322ABBFE-C469-48FB-87FD-C00124238724@gmail.com> <98983E26-D091-42C8-B920-8D4F917E5019@bsdimp.com> To: Warner Losh X-Mailer: Apple Mail (2.1078) Cc: "svn-src-stable@FreeBSD.org" , "svn-src-all@FreeBSD.org" , "src-committers@FreeBSD.org" , Warner Losh , "svn-src-stable-8@FreeBSD.org" Subject: Re: svn commit: r206782 - stable/8/sys/conf X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2010 11:34:50 -0000 On Apr 19, 2010, at 1:08 PM, Warner Losh wrote: > Nikolay > > Did you do a buildworld after updating the sources before the buildkernel? > > > Warner > > Hmm, no... I tried first to build the kernel. Regards, Niki Denev From owner-svn-src-stable-8@FreeBSD.ORG Mon Apr 19 14:23:15 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 63B361065670; Mon, 19 Apr 2010 14:23:15 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 526818FC1A; Mon, 19 Apr 2010 14:23:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3JENFNl025446; Mon, 19 Apr 2010 14:23:15 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3JENFa7025444; Mon, 19 Apr 2010 14:23:15 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201004191423.o3JENFa7025444@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Mon, 19 Apr 2010 14:23:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206841 - stable/8/sbin/hastd X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2010 14:23:15 -0000 Author: pjd Date: Mon Apr 19 14:23:15 2010 New Revision: 206841 URL: http://svn.freebsd.org/changeset/base/206841 Log: MFC r204352: Fixed static linkage. Modified: stable/8/sbin/hastd/Makefile Directory Properties: stable/8/sbin/hastd/ (props changed) Modified: stable/8/sbin/hastd/Makefile ============================================================================== --- stable/8/sbin/hastd/Makefile Mon Apr 19 14:15:58 2010 (r206840) +++ stable/8/sbin/hastd/Makefile Mon Apr 19 14:23:15 2010 (r206841) @@ -27,8 +27,9 @@ CFLAGS+=-DINET6 # This is needed to have WARNS > 1. CFLAGS+=-DYY_NO_UNPUT -DPADD= ${LIBCRYPTO} ${LIBGEOM} ${LIBL} ${LIBPTHREAD} ${LIBUTIL} -LDADD= -lcrypto -lgeom -ll -lpthread -lutil +DPADD= ${LIBCRYPTO} ${LIBGEOM} ${LIBBSDXML} ${LIBSBUF} ${LIBL} \ + ${LIBPTHREAD} ${LIBUTIL} +LDADD= -lcrypto -lgeom -lbsdxml -lsbuf -ll -lpthread -lutil YFLAGS+=-v From owner-svn-src-stable-8@FreeBSD.ORG Mon Apr 19 17:51:58 2010 Return-Path: Delivered-To: svn-src-stable-8@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ED43B106566C; Mon, 19 Apr 2010 17:51:58 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 8C69A8FC1C; Mon, 19 Apr 2010 17:51:58 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o3JHjS47050955; Mon, 19 Apr 2010 11:45:29 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Mon, 19 Apr 2010 11:45:39 -0600 (MDT) Message-Id: <20100419.114539.867924114585647412.imp@bsdimp.com> To: ndenev@gmail.com From: "M. Warner Losh" In-Reply-To: <677AD4C7-275F-40B3-821C-B23497950ABF@gmail.com> References: <322ABBFE-C469-48FB-87FD-C00124238724@gmail.com> <98983E26-D091-42C8-B920-8D4F917E5019@bsdimp.com> <677AD4C7-275F-40B3-821C-B23497950ABF@gmail.com> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-8@FreeBSD.org Subject: Re: svn commit: r206782 - stable/8/sys/conf X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2010 17:51:59 -0000 In message: <677AD4C7-275F-40B3-821C-B23497950ABF@gmail.com> Nikolay Denev writes: : : On Apr 19, 2010, at 1:08 PM, Warner Losh wrote: : : > Nikolay : > : > Did you do a buildworld after updating the sources before the buildkernel? : > : > : > Warner : > : > : : : Hmm, no... I tried first to build the kernel. OK. Can you try a buildworld (or at least kernel-toolchain) before building the kernel? Warner From owner-svn-src-stable-8@FreeBSD.ORG Mon Apr 19 18:20:00 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 33627106566C; Mon, 19 Apr 2010 18:20:00 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1F5B28FC17; Mon, 19 Apr 2010 18:20:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3JIJxlm078126; Mon, 19 Apr 2010 18:19:59 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3JIJxJ1078124; Mon, 19 Apr 2010 18:19:59 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201004191819.o3JIJxJ1078124@svn.freebsd.org> From: Edward Tomasz Napierala Date: Mon, 19 Apr 2010 18:19:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206849 - stable/8/sys/ufs/ufs X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2010 18:20:00 -0000 Author: trasz Date: Mon Apr 19 18:19:59 2010 New Revision: 206849 URL: http://svn.freebsd.org/changeset/base/206849 Log: MFC r196987: Remove useless variable assignment. Modified: stable/8/sys/ufs/ufs/ufs_acl.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/dev/uath/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/ufs/ufs/ufs_acl.c ============================================================================== --- stable/8/sys/ufs/ufs/ufs_acl.c Mon Apr 19 17:16:23 2010 (r206848) +++ stable/8/sys/ufs/ufs/ufs_acl.c Mon Apr 19 18:19:59 2010 (r206849) @@ -330,9 +330,6 @@ ufs_getacl_posix1e(struct vop_getacl_arg old->acl_cnt = 0; break; } - - error = 0; - /* FALLTHROUGH */ case 0: error = acl_copy_oldacl_into_acl(old, ap->a_aclp); From owner-svn-src-stable-8@FreeBSD.ORG Mon Apr 19 18:22:21 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9F8A91065672; Mon, 19 Apr 2010 18:22:21 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8D8398FC16; Mon, 19 Apr 2010 18:22:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3JIMLvL078714; Mon, 19 Apr 2010 18:22:21 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3JIMLYU078712; Mon, 19 Apr 2010 18:22:21 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201004191822.o3JIMLYU078712@svn.freebsd.org> From: Edward Tomasz Napierala Date: Mon, 19 Apr 2010 18:22:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206850 - stable/8/sys/ufs/ufs X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2010 18:22:21 -0000 Author: trasz Date: Mon Apr 19 18:22:21 2010 New Revision: 206850 URL: http://svn.freebsd.org/changeset/base/206850 Log: MFC r202971: Return proper error code. Found with: clang Modified: stable/8/sys/ufs/ufs/ufs_acl.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/dev/uath/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/ufs/ufs/ufs_acl.c ============================================================================== --- stable/8/sys/ufs/ufs/ufs_acl.c Mon Apr 19 18:19:59 2010 (r206849) +++ stable/8/sys/ufs/ufs/ufs_acl.c Mon Apr 19 18:22:21 2010 (r206850) @@ -465,7 +465,7 @@ ufs_setacl_nfs4(struct vop_setacl_args * error = ufs_setacl_nfs4_internal(ap->a_vp, ap->a_aclp, ap->a_td); - return (0); + return (error); } /* From owner-svn-src-stable-8@FreeBSD.ORG Mon Apr 19 20:08:19 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DBC1A1065675; Mon, 19 Apr 2010 20:08:19 +0000 (UTC) (envelope-from ndenev@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.156]) by mx1.freebsd.org (Postfix) with ESMTP id BEE9C8FC2E; Mon, 19 Apr 2010 20:08:18 +0000 (UTC) Received: by fg-out-1718.google.com with SMTP id e12so1995152fga.13 for ; Mon, 19 Apr 2010 13:08:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:mime-version :content-type:from:in-reply-to:date:cc:content-transfer-encoding :message-id:references:to:x-mailer; bh=MR+GmuPvWIEhNc0wbGFWagxldjx5qnpW/mvN9AGzqG0=; b=Duv0qXFEc6Qvw3lf5rCg55ZS/Ss6LJ8gI8eQdq+NzQ2iGRgMB/nHkU/FlekQGpRDUm RZw3sJY52szoroFYUmlGuZKRkNfG2hvyCjIENmuhUrDMBbE1waZDm+IrFSDRiUety6aS T8toawycOSZDJR83ZY6+wlRcGEun0dYWIbaWw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; b=LdJ3o0g1Pfp3gP9wDQcK8TMqZZRHzYaJyKFeATc0rPjjgxsRSAlWz7VGENEpRB9g5m YVLmfthwcw/puKKSjPk9BYR6V1bbl0JKjvsqpvO8XM9qdXnfG93Wr3GtdxLvUehOTBiy lZoZncT6WwzZYMqnFCFeSB5gIBzGHgpBarWus= Received: by 10.223.17.136 with SMTP id s8mr532353faa.41.1271707535591; Mon, 19 Apr 2010 13:05:35 -0700 (PDT) Received: from mbp-gige.totalterror.net (93-152-151-19.ddns.onlinedirect.bg [93.152.151.19]) by mx.google.com with ESMTPS id 3sm4772295fge.20.2010.04.19.13.05.33 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 19 Apr 2010 13:05:34 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v1078) Content-Type: text/plain; charset=us-ascii From: Nikolay Denev In-Reply-To: <20100419.114539.867924114585647412.imp@bsdimp.com> Date: Mon, 19 Apr 2010 23:05:31 +0300 Content-Transfer-Encoding: quoted-printable Message-Id: <6FD1C0AB-AEFF-4089-B549-266E73093CCC@gmail.com> References: <322ABBFE-C469-48FB-87FD-C00124238724@gmail.com> <98983E26-D091-42C8-B920-8D4F917E5019@bsdimp.com> <677AD4C7-275F-40B3-821C-B23497950ABF@gmail.com> <20100419.114539.867924114585647412.imp@bsdimp.com> To: M. Warner Losh X-Mailer: Apple Mail (2.1078) Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-8@FreeBSD.org Subject: Re: svn commit: r206782 - stable/8/sys/conf X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2010 20:08:20 -0000 On 19 Apr, 2010, at 20:45 , M. Warner Losh wrote: > In message: <677AD4C7-275F-40B3-821C-B23497950ABF@gmail.com> > Nikolay Denev writes: > :=20 > : On Apr 19, 2010, at 1:08 PM, Warner Losh wrote: > :=20 > : > Nikolay > : >=20 > : > Did you do a buildworld after updating the sources before the = buildkernel? > : >=20 > : >=20 > : > Warner > : >=20 > : >=20 > :=20 > :=20 > : Hmm, no... I tried first to build the kernel. >=20 > OK. Can you try a buildworld (or at least kernel-toolchain) before > building the kernel? >=20 > Warner Yep, the kernel was built OK after the buildworld. From owner-svn-src-stable-8@FreeBSD.ORG Mon Apr 19 20:34:39 2010 Return-Path: Delivered-To: svn-src-stable-8@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C3B8B106566C; Mon, 19 Apr 2010 20:34:39 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 823CF8FC0A; Mon, 19 Apr 2010 20:34:39 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o3JKLvJN052954; Mon, 19 Apr 2010 14:21:57 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Mon, 19 Apr 2010 14:22:08 -0600 (MDT) Message-Id: <20100419.142208.81694732398034836.imp@bsdimp.com> To: ndenev@gmail.com From: "M. Warner Losh" In-Reply-To: <6FD1C0AB-AEFF-4089-B549-266E73093CCC@gmail.com> References: <677AD4C7-275F-40B3-821C-B23497950ABF@gmail.com> <20100419.114539.867924114585647412.imp@bsdimp.com> <6FD1C0AB-AEFF-4089-B549-266E73093CCC@gmail.com> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-8@FreeBSD.org Subject: Re: svn commit: r206782 - stable/8/sys/conf X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2010 20:34:39 -0000 In message: <6FD1C0AB-AEFF-4089-B549-266E73093CCC@gmail.com> Nikolay Denev writes: : On 19 Apr, 2010, at 20:45 , M. Warner Losh wrote: : : > In message: <677AD4C7-275F-40B3-821C-B23497950ABF@gmail.com> : > Nikolay Denev writes: : > : : > : On Apr 19, 2010, at 1:08 PM, Warner Losh wrote: : > : : > : > Nikolay : > : > : > : > Did you do a buildworld after updating the sources before the buildkernel? : > : > : > : > : > : > Warner : > : > : > : > : > : : > : : > : Hmm, no... I tried first to build the kernel. : > : > OK. Can you try a buildworld (or at least kernel-toolchain) before : > building the kernel? : > : > Warner : : Yep, the kernel was built OK after the buildworld. OK. Sounds like I need to add a version check on the config stuff then to make it clearer you need to do this. thanks. Warner From owner-svn-src-stable-8@FreeBSD.ORG Mon Apr 19 21:01:24 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 970BC106566B; Mon, 19 Apr 2010 21:01:24 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 83BA28FC2C; Mon, 19 Apr 2010 21:01:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3JL1OPu014960; Mon, 19 Apr 2010 21:01:24 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3JL1O9g014935; Mon, 19 Apr 2010 21:01:24 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201004192101.o3JL1O9g014935@svn.freebsd.org> From: Edwin Groothuis Date: Mon, 19 Apr 2010 21:01:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206869 - stable/8/share/zoneinfo X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2010 21:01:24 -0000 Author: edwin Date: Mon Apr 19 21:01:24 2010 New Revision: 206869 URL: http://svn.freebsd.org/changeset/base/206869 Log: MFC of tzdata2010i, r206868 - Marocco does have DST this year between May and August. - Historical data for Taiwan - Argentina / San Luis does not do DST this year. Modified: stable/8/share/zoneinfo/africa stable/8/share/zoneinfo/asia stable/8/share/zoneinfo/southamerica Directory Properties: stable/8/share/zoneinfo/ (props changed) Modified: stable/8/share/zoneinfo/africa ============================================================================== --- stable/8/share/zoneinfo/africa Mon Apr 19 20:59:39 2010 (r206868) +++ stable/8/share/zoneinfo/africa Mon Apr 19 21:01:24 2010 (r206869) @@ -1,5 +1,5 @@ #
-# @(#)africa	8.23
+# @(#)africa	8.26
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -680,6 +680,21 @@ Zone	Indian/Mayotte	3:00:56 -	LMT	1911 J
 # http://www.worldtimezone.com/dst_news/dst_news_morocco03.html
 # 
 
+# From Steffen Thorsen (2010-04-13):
+# Several news media in Morocco report that the Ministry of Modernization
+# of Public Sectors has announced that Morocco will have DST from
+# 2010-05-02 to 2010-08-08.
+#
+# Example:
+# 
+# http://www.lavieeco.com/actualites/4099-le-maroc-passera-a-l-heure-d-ete-gmt1-le-2-mai.html
+# 
+# (French)
+# Our page:
+# 
+# http://www.timeanddate.com/news/time/morocco-starts-dst-2010.html
+# 
+
 # RULE	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 
 Rule	Morocco	1939	only	-	Sep	12	 0:00	1:00	S
@@ -701,6 +716,8 @@ Rule	Morocco	2008	only	-	Jun	 1	 0:00	1:
 Rule	Morocco	2008	only	-	Sep	 1	 0:00	0	-
 Rule	Morocco	2009	only	-	Jun	 1	 0:00	1:00	S
 Rule	Morocco	2009	only	-	Aug	 21	 0:00	0	-
+Rule	Morocco	2010	only	-	May	 2	 0:00	1:00	S
+Rule	Morocco	2010	only	-	Aug	 8	 0:00	0	-
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone Africa/Casablanca	-0:30:20 -	LMT	1913 Oct 26
 			 0:00	Morocco	WE%sT	1984 Mar 16
@@ -942,6 +959,24 @@ Zone	Africa/Lome	0:04:52 -	LMT	1893
 # Therefore, the standard time will be kept unchanged the whole year long."
 # So foregoing DST seems to be an exception (albeit one that may be repeated in the  future).
 
+# From Alexander Krivenyshev (2010-03-27):
+# According to some news reports Tunis confirmed not to use DST in 2010
+#
+# (translation):
+# "The Tunisian government has decided to abandon DST, which was scheduled on
+# Sunday...
+# Tunisian authorities had suspended the DST for the first time last year also
+# coincided with the month of Ramadan..."
+#
+# (in Arabic)
+# 
+# http://www.moheet.com/show_news.aspx?nid=358861&pg=1
+# 
+# http://www.almadenahnews.com/newss/news.php?c=118&id=38036
+# or
+# 
+# http://www.worldtimezone.com/dst_news/dst_news_tunis02.html
+
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Tunisia	1939	only	-	Apr	15	23:00s	1:00	S
 Rule	Tunisia	1939	only	-	Nov	18	23:00s	0	-
@@ -968,8 +1003,7 @@ Rule	Tunisia	2005	only	-	May	 1	 0:00s	1
 Rule	Tunisia	2005	only	-	Sep	30	 1:00s	0	-
 Rule	Tunisia	2006	2008	-	Mar	lastSun	 2:00s	1:00	S
 Rule	Tunisia	2006	2008	-	Oct	lastSun	 2:00s	0	-
-Rule	Tunisia	2010	max	-	Mar	lastSun	 2:00s	1:00	S
-Rule	Tunisia	2010	max	-	Oct	lastSun	 2:00s	0	-
+
 # Shanks & Pottenger give 0:09:20 for Paris Mean Time; go with Howse's
 # more precise 0:09:21.
 # Shanks & Pottenger say the 1911 switch was on Mar 9; go with Howse's Mar 11.

Modified: stable/8/share/zoneinfo/asia
==============================================================================
--- stable/8/share/zoneinfo/asia	Mon Apr 19 20:59:39 2010	(r206868)
+++ stable/8/share/zoneinfo/asia	Mon Apr 19 21:01:24 2010	(r206869)
@@ -1,4 +1,4 @@
-# @(#)asia	8.58
+# @(#)asia	8.60
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -566,6 +566,28 @@ Zone	Asia/Hong_Kong	7:36:36 -	LMT	1904 O
 # was still controlled by Japan.  This is hard to believe, but we don't
 # have any other information.
 
+# From smallufo (2010-04-03):
+# According to Taiwan's CWB,
+# 
+# http://www.cwb.gov.tw/V6/astronomy/cdata/summert.htm
+# 
+# Taipei has DST in 1979 between July 1st and Sep 30.
+
+# From Arthur David Olson (2010-04-07):
+# Here's Google's translation of the table at the bottom of the "summert.htm" page:
+# Decade 	                                                    Name                      Start and end date
+# Republic of China 34 years to 40 years (AD 1945-1951 years) Summer Time               May 1 to September 30 
+# 41 years of the Republic of China (AD 1952)                 Daylight Saving Time      March 1 to October 31 
+# Republic of China 42 years to 43 years (AD 1953-1954 years) Daylight Saving Time      April 1 to October 31 
+# In the 44 years to 45 years (AD 1955-1956 years)            Daylight Saving Time      April 1 to September 30 
+# Republic of China 46 years to 48 years (AD 1957-1959)       Summer Time               April 1 to September 30 
+# Republic of China 49 years to 50 years (AD 1960-1961)       Summer Time               June 1 to September 30 
+# Republic of China 51 years to 62 years (AD 1962-1973 years) Stop Summer Time 
+# Republic of China 63 years to 64 years (1974-1975 AD)       Daylight Saving Time      April 1 to September 30 
+# Republic of China 65 years to 67 years (1976-1978 AD)       Stop Daylight Saving Time 
+# Republic of China 68 years (AD 1979)                        Daylight Saving Time      July 1 to September 30 
+# Republic of China since 69 years (AD 1980)                  Stop Daylight Saving Time
+
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Taiwan	1945	1951	-	May	1	0:00	1:00	D
 Rule	Taiwan	1945	1951	-	Oct	1	0:00	0	S
@@ -576,8 +598,9 @@ Rule	Taiwan	1955	1961	-	Oct	1	0:00	0	S
 Rule	Taiwan	1960	1961	-	Jun	1	0:00	1:00	D
 Rule	Taiwan	1974	1975	-	Apr	1	0:00	1:00	D
 Rule	Taiwan	1974	1975	-	Oct	1	0:00	0	S
-Rule	Taiwan	1980	only	-	Jun	30	0:00	1:00	D
-Rule	Taiwan	1980	only	-	Sep	30	0:00	0	S
+Rule	Taiwan	1979	only	-	Jun	30	0:00	1:00	D
+Rule	Taiwan	1979	only	-	Sep	30	0:00	0	S
+
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Taipei	8:06:00 -	LMT	1896 # or Taibei or T'ai-pei
 			8:00	Taiwan	C%sT
@@ -1912,13 +1935,35 @@ Zone	Asia/Muscat	3:54:20 -	LMT	1920
 # [T]he German Consulate General in Karachi reported me today that Pakistan
 # will go back to standard time on 1st of November.
 
+# From Steffen Thorsen (2010-03-26):
+# Steffen Thorsen wrote:
+# > On Thursday (2010-03-25) it was announced that DST would start in
+# > Pakistan on 2010-04-01.
+# >
+# > Then today, the president said that they might have to revert the
+# > decision if it is not supported by the parliament. So at the time
+# > being, it seems unclear if DST will be actually observed or not - but
+# > April 1 could be a more likely date than April 15.
+# Now, it seems that the decision to not observe DST in final:
+#
+# "Govt Withdraws Plan To Advance Clocks"
+# 
+# http://www.apakistannews.com/govt-withdraws-plan-to-advance-clocks-172041
+# 
+#
+# "People laud PM's announcement to end DST"
+# 
+# http://www.app.com.pk/en_/index.php?option=com_content&task=view&id=99374&Itemid=2
+# 
+
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule Pakistan	2002	only	-	Apr	Sun>=2	0:01	1:00	S
 Rule Pakistan	2002	only	-	Oct	Sun>=2	0:01	0	-
 Rule Pakistan	2008	only	-	Jun	1	0:00	1:00	S
 Rule Pakistan	2008	only	-	Nov	1	0:00	0	-
-Rule Pakistan	2009	max	-	Apr	15	0:00	1:00	S
-Rule Pakistan	2009	max	-	Nov	1	0:00	0	-
+Rule Pakistan	2009	only	-	Apr	15	0:00	1:00	S
+Rule Pakistan	2009	only	-	Nov	1	0:00	0	-
+
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Karachi	4:28:12 -	LMT	1907
 			5:30	-	IST	1942 Sep

Modified: stable/8/share/zoneinfo/southamerica
==============================================================================
--- stable/8/share/zoneinfo/southamerica	Mon Apr 19 20:59:39 2010	(r206868)
+++ stable/8/share/zoneinfo/southamerica	Mon Apr 19 21:01:24 2010	(r206869)
@@ -1,5 +1,5 @@
 # 
-# @(#)southamerica	8.43
+# @(#)southamerica	8.44
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -437,6 +437,27 @@ Rule	Arg	2008	only	-	Oct	Sun>=15	0:00	1:
 # of the country calls it "ART".
 # ...
 
+# From Alexander Krivenyshev (2010-04-09):
+# According to news reports from El Diario de la Republica Province San
+# Luis, Argentina (standard time UTC-04) will keep Daylight Saving Time
+# after April 11, 2010--will continue to have same time as rest of
+# Argentina (UTC-3) (no DST).
+#
+# Confirmaron la prórroga del huso horario de verano (Spanish)
+# 
+# http://www.eldiariodelarepublica.com/index.php?option=com_content&task=view&id=29383&Itemid=9
+# 
+# or (some English translation):
+# 
+# http://www.worldtimezone.com/dst_news/dst_news_argentina08.html
+# 
+
+# From Mariano Absatz (2010-04-12):
+# yes...I can confirm this...and given that San Luis keeps calling
+# UTC-03:00 "summer time", we should't just let San Luis go back to "Arg"
+# rules...San Luis is still using "Western ARgentina Time" and it got
+# stuck on Summer daylight savings time even though the summer is over.
+
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 #
 # Buenos Aires (BA), Capital Federal (CF),
@@ -570,8 +591,8 @@ Zone America/Argentina/Mendoza -4:35:16 
 #
 # San Luis (SL)
 
-Rule	SanLuis	2008	max	-	Mar	Sun>=8	0:00	0	-
-Rule	SanLuis	2007	max	-	Oct	Sun>=8	0:00	1:00	S
+Rule	SanLuis	2008	2009	-	Mar	Sun>=8	0:00	0	-
+Rule	SanLuis	2007	2009	-	Oct	Sun>=8	0:00	1:00	S
 
 Zone America/Argentina/San_Luis -4:25:24 - LMT	1894 Oct 31
 			-4:16:48 -	CMT	1920 May

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Apr 20 01:25:18 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 852941065675;
	Tue, 20 Apr 2010 01:25:18 +0000 (UTC)
	(envelope-from rmacklem@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 6A76B8FC08;
	Tue, 20 Apr 2010 01:25:18 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3K1PIi7073602;
	Tue, 20 Apr 2010 01:25:18 GMT
	(envelope-from rmacklem@svn.freebsd.org)
Received: (from rmacklem@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3K1PIk7073600;
	Tue, 20 Apr 2010 01:25:18 GMT
	(envelope-from rmacklem@svn.freebsd.org)
Message-Id: <201004200125.o3K1PIk7073600@svn.freebsd.org>
From: Rick Macklem 
Date: Tue, 20 Apr 2010 01:25:18 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206882 - stable/8/sys/fs/nfsserver
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 20 Apr 2010 01:25:18 -0000

Author: rmacklem
Date: Tue Apr 20 01:25:18 2010
New Revision: 206882
URL: http://svn.freebsd.org/changeset/base/206882

Log:
  MFC: r206236
  Harden the experimental NFS server a little, by adding range
  checks on the length of the client's open/lock owner name. Also,
  add free()'s for one case where they were missing and would
  have caused a leak if NFSERR_BADXDR had been replied. Probably
  never happens, but the leak is now plugged, just in case.

Modified:
  stable/8/sys/fs/nfsserver/nfs_nfsdserv.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/dev/uath/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/fs/nfsserver/nfs_nfsdserv.c
==============================================================================
--- stable/8/sys/fs/nfsserver/nfs_nfsdserv.c	Tue Apr 20 01:12:23 2010	(r206881)
+++ stable/8/sys/fs/nfsserver/nfs_nfsdserv.c	Tue Apr 20 01:25:18 2010	(r206882)
@@ -2086,6 +2086,10 @@ nfsrvd_lock(struct nfsrv_descript *nd, _
 	if (flags & NFSLCK_OPENTOLOCK) {
 		NFSM_DISSECT(tl, u_int32_t *, 5 * NFSX_UNSIGNED + NFSX_STATEID);
 		i = fxdr_unsigned(int, *(tl+4+(NFSX_STATEID / NFSX_UNSIGNED)));
+		if (i <= 0 || i > NFSV4_OPAQUELIMIT) {
+			nd->nd_repstat = NFSERR_BADXDR;
+			goto nfsmout;
+		}
 		MALLOC(stp, struct nfsstate *, sizeof (struct nfsstate) + i,
 			M_NFSDSTATE, M_WAITOK);
 		stp->ls_ownerlen = i;
@@ -2229,6 +2233,10 @@ nfsrvd_lockt(struct nfsrv_descript *nd, 
 
 	NFSM_DISSECT(tl, u_int32_t *, 8 * NFSX_UNSIGNED);
 	i = fxdr_unsigned(int, *(tl + 7));
+	if (i <= 0 || i > NFSV4_OPAQUELIMIT) {
+		nd->nd_repstat = NFSERR_BADXDR;
+		goto nfsmout;
+	}
 	MALLOC(stp, struct nfsstate *, sizeof (struct nfsstate) + i,
 	    M_NFSDSTATE, M_WAITOK);
 	stp->ls_ownerlen = i;
@@ -2350,6 +2358,8 @@ nfsrvd_locku(struct nfsrv_descript *nd, 
 		break;
 	default:
 		nd->nd_repstat = NFSERR_BADXDR;
+		free(stp, M_NFSDSTATE);
+		free(lop, M_NFSDLOCK);
 		goto nfsmout;
 	};
 	stp->ls_ownerlen = 0;
@@ -2439,6 +2449,14 @@ nfsrvd_open(struct nfsrv_descript *nd, _
 	named.ni_cnd.cn_nameiop = 0;
 	NFSM_DISSECT(tl, u_int32_t *, 6 * NFSX_UNSIGNED);
 	i = fxdr_unsigned(int, *(tl + 5));
+	if (i <= 0 || i > NFSV4_OPAQUELIMIT) {
+		nd->nd_repstat = NFSERR_BADXDR;
+		vrele(dp);
+#ifdef NFS4_ACL_EXTATTR_NAME
+		acl_free(aclp);
+#endif
+		return (0);
+	}
 	MALLOC(stp, struct nfsstate *, sizeof (struct nfsstate) + i,
 	    M_NFSDSTATE, M_WAITOK);
 	stp->ls_ownerlen = i;
@@ -3391,6 +3409,10 @@ nfsrvd_releaselckown(struct nfsrv_descri
 	}
 	NFSM_DISSECT(tl, u_int32_t *, 3 * NFSX_UNSIGNED);
 	len = fxdr_unsigned(int, *(tl + 2));
+	if (len <= 0 || len > NFSV4_OPAQUELIMIT) {
+		nd->nd_repstat = NFSERR_BADXDR;
+		return (0);
+	}
 	MALLOC(stp, struct nfsstate *, sizeof (struct nfsstate) + len,
 	    M_NFSDSTATE, M_WAITOK);
 	stp->ls_ownerlen = len;

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Apr 20 08:19:43 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 934EE106564A;
	Tue, 20 Apr 2010 08:19:43 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 801F38FC14;
	Tue, 20 Apr 2010 08:19:43 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3K8JhTa064836;
	Tue, 20 Apr 2010 08:19:43 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3K8Jhjx064830;
	Tue, 20 Apr 2010 08:19:43 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201004200819.o3K8Jhjx064830@svn.freebsd.org>
From: Konstantin Belousov 
Date: Tue, 20 Apr 2010 08:19:43 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206890 - in stable/8/sys: amd64/amd64 amd64/ia32
	i386/i386
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 20 Apr 2010 08:19:43 -0000

Author: kib
Date: Tue Apr 20 08:19:43 2010
New Revision: 206890
URL: http://svn.freebsd.org/changeset/base/206890

Log:
  MFC r206553:
  Change printf() calls to uprintf() for sigreturn() and trap() complaints
  about inacessible or wrong mcontext, and for dreaded "kernel trap with
  interrupts disabled" situation. The later is changed when trap is
  generated from user mode (shall never be ?).
  
  Normalize the messages to include both pid and thread name.

Modified:
  stable/8/sys/amd64/amd64/machdep.c
  stable/8/sys/amd64/amd64/trap.c
  stable/8/sys/amd64/ia32/ia32_signal.c
  stable/8/sys/i386/i386/machdep.c
  stable/8/sys/i386/i386/trap.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/dev/uath/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/amd64/amd64/machdep.c
==============================================================================
--- stable/8/sys/amd64/amd64/machdep.c	Tue Apr 20 06:10:05 2010	(r206889)
+++ stable/8/sys/amd64/amd64/machdep.c	Tue Apr 20 08:19:43 2010	(r206890)
@@ -422,13 +422,14 @@ sigreturn(td, uap)
 
 	error = copyin(uap->sigcntxp, &uc, sizeof(uc));
 	if (error != 0) {
-		printf("sigreturn (pid %d): copyin failed\n", p->p_pid);
+		uprintf("pid %d (%s): sigreturn copyin failed\n",
+		    p->p_pid, td->td_name);
 		return (error);
 	}
 	ucp = &uc;
 	if ((ucp->uc_mcontext.mc_flags & ~_MC_FLAG_MASK) != 0) {
-		printf("sigreturn (pid %d): mc_flags %x\n", p->p_pid,
-		    ucp->uc_mcontext.mc_flags);
+		uprintf("pid %d (%s): sigreturn mc_flags %x\n", p->p_pid,
+		    td->td_name, ucp->uc_mcontext.mc_flags);
 		return (EINVAL);
 	}
 	regs = td->td_frame;
@@ -447,8 +448,8 @@ sigreturn(td, uap)
 	 * one less debugger trap, so allowing it is fairly harmless.
 	 */
 	if (!EFL_SECURE(rflags & ~PSL_RF, regs->tf_rflags & ~PSL_RF)) {
-		printf("sigreturn (pid %d): rflags = 0x%lx\n", p->p_pid,
-		    rflags);
+		uprintf("pid %d (%s): sigreturn rflags = 0x%lx\n", p->p_pid,
+		    td->td_name, rflags);
 		return (EINVAL);
 	}
 
@@ -459,7 +460,8 @@ sigreturn(td, uap)
 	 */
 	cs = ucp->uc_mcontext.mc_cs;
 	if (!CS_SECURE(cs)) {
-		printf("sigreturn (pid %d): cs = 0x%x\n", p->p_pid, cs);
+		uprintf("pid %d (%s): sigreturn cs = 0x%x\n", p->p_pid,
+		    td->td_name, cs);
 		ksiginfo_init_trap(&ksi);
 		ksi.ksi_signo = SIGBUS;
 		ksi.ksi_code = BUS_OBJERR;
@@ -471,7 +473,8 @@ sigreturn(td, uap)
 
 	ret = set_fpcontext(td, &ucp->uc_mcontext);
 	if (ret != 0) {
-		printf("sigreturn (pid %d): set_fpcontext\n", p->p_pid);
+		uprintf("pid %d (%s): sigreturn set_fpcontext err %d\n",
+		    p->p_pid, td->td_name, ret);
 		return (ret);
 	}
 	bcopy(&ucp->uc_mcontext.mc_rdi, regs, sizeof(*regs));

Modified: stable/8/sys/amd64/amd64/trap.c
==============================================================================
--- stable/8/sys/amd64/amd64/trap.c	Tue Apr 20 06:10:05 2010	(r206889)
+++ stable/8/sys/amd64/amd64/trap.c	Tue Apr 20 08:19:43 2010	(r206890)
@@ -303,7 +303,7 @@ trap(struct trapframe *frame)
 		 * enabled later.
 		 */
 		if (ISPL(frame->tf_cs) == SEL_UPL)
-			printf(
+			uprintf(
 			    "pid %ld (%s): trap %d with interrupts disabled\n",
 			    (long)curproc->p_pid, curthread->td_name, type);
 		else if (type != T_NMI && type != T_BPTFLT &&

Modified: stable/8/sys/amd64/ia32/ia32_signal.c
==============================================================================
--- stable/8/sys/amd64/ia32/ia32_signal.c	Tue Apr 20 06:10:05 2010	(r206889)
+++ stable/8/sys/amd64/ia32/ia32_signal.c	Tue Apr 20 08:19:43 2010	(r206890)
@@ -565,7 +565,8 @@ freebsd4_freebsd32_sigreturn(td, uap)
 	 * one less debugger trap, so allowing it is fairly harmless.
 	 */
 	if (!EFL_SECURE(eflags & ~PSL_RF, regs->tf_rflags & ~PSL_RF)) {
-		printf("freebsd4_freebsd32_sigreturn: eflags = 0x%x\n", eflags);
+		uprintf("pid %d (%s): freebsd4_freebsd32_sigreturn eflags = 0x%x\n",
+		    td->td_proc->p_pid, td->td_name, eflags);
 		return (EINVAL);
 	}
 
@@ -576,7 +577,8 @@ freebsd4_freebsd32_sigreturn(td, uap)
 	 */
 	cs = ucp->uc_mcontext.mc_cs;
 	if (!CS_SECURE(cs)) {
-		printf("freebsd4_sigreturn: cs = 0x%x\n", cs);
+		uprintf("pid %d (%s): freebsd4_sigreturn cs = 0x%x\n",
+		    td->td_proc->p_pid, td->td_name, cs);
 		ksiginfo_init_trap(&ksi);
 		ksi.ksi_signo = SIGBUS;
 		ksi.ksi_code = BUS_OBJERR;
@@ -647,7 +649,8 @@ freebsd32_sigreturn(td, uap)
 	 * one less debugger trap, so allowing it is fairly harmless.
 	 */
 	if (!EFL_SECURE(eflags & ~PSL_RF, regs->tf_rflags & ~PSL_RF)) {
-		printf("freebsd32_sigreturn: eflags = 0x%x\n", eflags);
+		uprintf("pid %d (%s): freebsd32_sigreturn eflags = 0x%x\n",
+		    td->td_proc->p_pid, td->td_name, eflags);
 		return (EINVAL);
 	}
 
@@ -658,7 +661,8 @@ freebsd32_sigreturn(td, uap)
 	 */
 	cs = ucp->uc_mcontext.mc_cs;
 	if (!CS_SECURE(cs)) {
-		printf("sigreturn: cs = 0x%x\n", cs);
+		uprintf("pid %d (%s): sigreturn cs = 0x%x\n",
+		    td->td_proc->p_pid, td->td_name, cs);
 		ksiginfo_init_trap(&ksi);
 		ksi.ksi_signo = SIGBUS;
 		ksi.ksi_code = BUS_OBJERR;

Modified: stable/8/sys/i386/i386/machdep.c
==============================================================================
--- stable/8/sys/i386/i386/machdep.c	Tue Apr 20 06:10:05 2010	(r206889)
+++ stable/8/sys/i386/i386/machdep.c	Tue Apr 20 08:19:43 2010	(r206890)
@@ -944,7 +944,8 @@ freebsd4_sigreturn(td, uap)
 		 * one less debugger trap, so allowing it is fairly harmless.
 		 */
 		if (!EFL_SECURE(eflags & ~PSL_RF, regs->tf_eflags & ~PSL_RF)) {
-			printf("freebsd4_sigreturn: eflags = 0x%x\n", eflags);
+			uprintf("pid %d (%s): freebsd4_sigreturn eflags = 0x%x\n",
+			    td->td_proc->p_pid, td->td_name, eflags);
 	    		return (EINVAL);
 		}
 
@@ -955,7 +956,8 @@ freebsd4_sigreturn(td, uap)
 		 */
 		cs = ucp->uc_mcontext.mc_cs;
 		if (!CS_SECURE(cs)) {
-			printf("freebsd4_sigreturn: cs = 0x%x\n", cs);
+			uprintf("pid %d (%s): freebsd4_sigreturn cs = 0x%x\n",
+			    td->td_proc->p_pid, td->td_name, cs);
 			ksiginfo_init_trap(&ksi);
 			ksi.ksi_signo = SIGBUS;
 			ksi.ksi_code = BUS_OBJERR;
@@ -1056,7 +1058,8 @@ sigreturn(td, uap)
 		 * one less debugger trap, so allowing it is fairly harmless.
 		 */
 		if (!EFL_SECURE(eflags & ~PSL_RF, regs->tf_eflags & ~PSL_RF)) {
-			printf("sigreturn: eflags = 0x%x\n", eflags);
+			uprintf("pid %d (%s): sigreturn eflags = 0x%x\n",
+			    td->td_proc->p_pid, td->td_name, eflags);
 	    		return (EINVAL);
 		}
 
@@ -1067,7 +1070,8 @@ sigreturn(td, uap)
 		 */
 		cs = ucp->uc_mcontext.mc_cs;
 		if (!CS_SECURE(cs)) {
-			printf("sigreturn: cs = 0x%x\n", cs);
+			uprintf("pid %d (%s): sigreturn cs = 0x%x\n",
+			    td->td_proc->p_pid, td->td_name, cs);
 			ksiginfo_init_trap(&ksi);
 			ksi.ksi_signo = SIGBUS;
 			ksi.ksi_code = BUS_OBJERR;

Modified: stable/8/sys/i386/i386/trap.c
==============================================================================
--- stable/8/sys/i386/i386/trap.c	Tue Apr 20 06:10:05 2010	(r206889)
+++ stable/8/sys/i386/i386/trap.c	Tue Apr 20 08:19:43 2010	(r206890)
@@ -277,7 +277,7 @@ trap(struct trapframe *frame)
 		 * enabled later.
 		 */
 		if (ISPL(frame->tf_cs) == SEL_UPL || (frame->tf_eflags & PSL_VM))
-			printf(
+			uprintf(
 			    "pid %ld (%s): trap %d with interrupts disabled\n",
 			    (long)curproc->p_pid, curthread->td_name, type);
 		else if (type != T_BPTFLT && type != T_TRCTRAP &&
@@ -507,7 +507,7 @@ trap(struct trapframe *frame)
 			if (npxdna())
 				goto userout;
 #endif
-			printf("pid %d killed due to lack of floating point\n",
+			uprintf("pid %d killed due to lack of floating point\n",
 				p->p_pid);
 			i = SIGKILL;
 			ucode = 0;

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Apr 20 12:07:16 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CDB49106564A;
	Tue, 20 Apr 2010 12:07:16 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id BBB148FC26;
	Tue, 20 Apr 2010 12:07:16 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3KC7Gi2021072;
	Tue, 20 Apr 2010 12:07:16 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3KC7Gfo021070;
	Tue, 20 Apr 2010 12:07:16 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201004201207.o3KC7Gfo021070@svn.freebsd.org>
From: Rui Paulo 
Date: Tue, 20 Apr 2010 12:07:16 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206896 - in stable/8: etc/defaults etc/rc.d
	share/man/man5
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 20 Apr 2010 12:07:17 -0000

Author: rpaulo
Date: Tue Apr 20 12:07:16 2010
New Revision: 206896
URL: http://svn.freebsd.org/changeset/base/206896

Log:
  MFC r206427, r206706, r206771:
    ubthidhci rc.d script to switch an USB bluetooth dongle from HID to
    HCI mode.

Added:
  stable/8/etc/rc.d/ubthidhci
     - copied unchanged from r206427, head/etc/rc.d/ubthidhci
Modified:
  stable/8/etc/defaults/rc.conf
  stable/8/etc/rc.d/Makefile
  stable/8/share/man/man5/rc.conf.5
Directory Properties:
  stable/8/etc/   (props changed)
  stable/8/share/man/man5/   (props changed)

Modified: stable/8/etc/defaults/rc.conf
==============================================================================
--- stable/8/etc/defaults/rc.conf	Tue Apr 20 10:42:08 2010	(r206895)
+++ stable/8/etc/defaults/rc.conf	Tue Apr 20 12:07:16 2010	(r206896)
@@ -433,6 +433,11 @@ rfcomm_pppd_server_two_channel="3"	# Ove
 #rfcomm_pppd_server_two_register_sp="NO"	# Override SP and DUN register
 #rfcomm_pppd_server_two_register_dun="NO"	# for 'two'
 
+ubthidhci_enable="NO"		# Switch an USB BT controller present on
+#ubthidhci_busnum="3"		# bus 3 and addr 2 from HID mode to HCI mode.
+#ubthidhci_addr="2"		# Check usbconfig list to find the correct
+				# numbers for your system.
+
 ### Miscellaneous network options: ###
 icmp_bmcastecho="NO"	# respond to broadcast ping packets
 

Modified: stable/8/etc/rc.d/Makefile
==============================================================================
--- stable/8/etc/rc.d/Makefile	Tue Apr 20 10:42:08 2010	(r206895)
+++ stable/8/etc/rc.d/Makefile	Tue Apr 20 12:07:16 2010	(r206896)
@@ -50,6 +50,10 @@ FILES+=	sshd
 FILES+= nscd
 .endif
 
+.if ${MK_BLUETOOTH} != "no"
+FILES+=	ubthidhci
+.endif
+
 FILESDIR=	/etc/rc.d
 FILESMODE=	${BINMODE}
 

Copied: stable/8/etc/rc.d/ubthidhci (from r206427, head/etc/rc.d/ubthidhci)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/8/etc/rc.d/ubthidhci	Tue Apr 20 12:07:16 2010	(r206896, copy of r206427, head/etc/rc.d/ubthidhci)
@@ -0,0 +1,40 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# PROVIDE: ubthidhci
+# REQUIRE: DAEMON 
+# BEFORE: bluetooth 
+# KEYWORD: nojail shutdown
+
+. /etc/rc.subr
+
+name="ubthidhci"
+command="/usr/sbin/usbconfig"
+rcvar=`set_rcvar`
+start_precmd="ubthidhci_prestart"
+
+ubthidhci_prestart()
+{
+
+	if [ -z ${ubthidhci_busnum} ]; then
+		warn ubthidhci_busnum is not set
+		return 1
+	fi
+	if [ -z ${ubthidhci_addr} ]; then
+		warn ubthidhci_addr is not set
+		return 1
+	fi
+}
+
+load_rc_config $name
+#
+# We discard the output because:
+# 1) we don't want it to show up during boot; and
+# 2) the request usually returns an error, but that doesn't mean it failed
+#
+# NB: 0x40 is UT_VENDOR
+command_args="-u ${ubthidhci_busnum} -a ${ubthidhci_addr} do_request 0x40 0 0 0 0 > /dev/null 2>&1"
+
+run_rc_command "$1"

Modified: stable/8/share/man/man5/rc.conf.5
==============================================================================
--- stable/8/share/man/man5/rc.conf.5	Tue Apr 20 10:42:08 2010	(r206895)
+++ stable/8/share/man/man5/rc.conf.5	Tue Apr 20 12:07:16 2010	(r206896)
@@ -4143,6 +4143,26 @@ if it should register Dial-Up Networking
 RFCOMM channel.
 Default
 .Dq Li NO .
+.It Va ubthidhci_enable
+.Pq Vt bool
+If set to
+.Dq Li YES ,
+change the USB Bluetooth controller from HID mode to HCI mode.
+You also need to specify the location of USB Bluetooth controller with the
+.Va ubthidhci_busnum
+and
+.Va ubthidhci_addr
+variables.
+.It Va ubthidhci_busnum
+Bus number where the USB Bluetooth controller is located.
+Check the output of
+.Xr usbconfig 1
+on your system to find this information.
+.It Va ubthidhci_addr
+Bus address of the USB Bluetooth controller.
+Check the output of
+.Xr usbconfig 1
+on your system to find this information.
 .El
 .Sh FILES
 .Bl -tag -width ".Pa /etc/defaults/rc.conf" -compact
@@ -4158,6 +4178,7 @@ Default
 .Xr kbdcontrol 1 ,
 .Xr makewhatis 1 ,
 .Xr sh 1 ,
+.Xr usbconfig 1 ,
 .Xr vi 1 ,
 .Xr vidcontrol 1 ,
 .Xr bridge 4 ,

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Apr 20 15:23:13 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3E819106564A;
	Tue, 20 Apr 2010 15:23:13 +0000 (UTC)
	(envelope-from luigi@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 2AC1D8FC27;
	Tue, 20 Apr 2010 15:23:13 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3KFNCT6065922;
	Tue, 20 Apr 2010 15:23:13 GMT (envelope-from luigi@svn.freebsd.org)
Received: (from luigi@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3KFNCYP065917;
	Tue, 20 Apr 2010 15:23:12 GMT (envelope-from luigi@svn.freebsd.org)
Message-Id: <201004201523.o3KFNCYP065917@svn.freebsd.org>
From: Luigi Rizzo 
Date: Tue, 20 Apr 2010 15:23:12 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206899 - in stable/8: sbin/geom/class
	sbin/geom/class/sched sys/geom/sched sys/modules/geom
	sys/modules/geom/geom_sched
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 20 Apr 2010 15:23:13 -0000

Author: luigi
Date: Tue Apr 20 15:23:12 2010
New Revision: 206899
URL: http://svn.freebsd.org/changeset/base/206899

Log:
  MFC geom_sched code, a geom-based disk scheduling framework.

Added:
  stable/8/sbin/geom/class/sched/
     - copied from r206497, head/sbin/geom/class/sched/
  stable/8/sys/geom/sched/
     - copied from r206497, head/sys/geom/sched/
  stable/8/sys/modules/geom/geom_sched/
     - copied from r206497, head/sys/modules/geom/geom_sched/
Modified:
  stable/8/sbin/geom/class/Makefile
  stable/8/sbin/geom/class/sched/Makefile
  stable/8/sbin/geom/class/sched/geom_sched.c
  stable/8/sbin/geom/class/sched/gsched.8
  stable/8/sys/geom/sched/g_sched.c
  stable/8/sys/geom/sched/g_sched.h
  stable/8/sys/geom/sched/gs_rr.c
  stable/8/sys/geom/sched/gs_scheduler.h
  stable/8/sys/modules/geom/Makefile
Directory Properties:
  stable/8/sbin/geom/   (props changed)
  stable/8/sbin/geom/class/stripe/   (props changed)

Modified: stable/8/sbin/geom/class/Makefile
==============================================================================
--- stable/8/sbin/geom/class/Makefile	Tue Apr 20 14:22:29 2010	(r206898)
+++ stable/8/sbin/geom/class/Makefile	Tue Apr 20 15:23:12 2010	(r206899)
@@ -14,6 +14,7 @@ SUBDIR+=multipath
 SUBDIR+=nop
 SUBDIR+=part
 SUBDIR+=raid3
+SUBDIR+=sched
 SUBDIR+=shsec
 SUBDIR+=stripe
 SUBDIR+=virstor

Modified: stable/8/sbin/geom/class/sched/Makefile
==============================================================================
--- head/sbin/geom/class/sched/Makefile	Mon Apr 12 16:37:45 2010	(r206497)
+++ stable/8/sbin/geom/class/sched/Makefile	Tue Apr 20 15:23:12 2010	(r206899)
@@ -1,9 +1,8 @@
 # GEOM_LIBRARY_PATH
 # $FreeBSD$
 
-.PATH: /usr/src/sbin/geom/misc
-
-CFLAGS += -I/usr/src/sbin/geom
+.PATH: ${.CURDIR}/../../misc
+#CFLAGS += -I/usr/src/sbin/geom
 
 CLASS=sched
 

Modified: stable/8/sbin/geom/class/sched/geom_sched.c
==============================================================================
--- head/sbin/geom/class/sched/geom_sched.c	Mon Apr 12 16:37:45 2010	(r206497)
+++ stable/8/sbin/geom/class/sched/geom_sched.c	Tue Apr 20 15:23:12 2010	(r206899)
@@ -1,5 +1,6 @@
 /*-
- * Copyright (c) 2009 Fabio Checconi, Luigi Rizzo
+ * Copyright (c) 2009 Fabio Checconi
+ * Copyright (c) 2010 Luigi Rizzo, Universita` di Pisa
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without

Modified: stable/8/sbin/geom/class/sched/gsched.8
==============================================================================
--- head/sbin/geom/class/sched/gsched.8	Mon Apr 12 16:37:45 2010	(r206497)
+++ stable/8/sbin/geom/class/sched/gsched.8	Tue Apr 20 15:23:12 2010	(r206899)
@@ -1,6 +1,6 @@
-.\" Copyright (c) 2009-2010 Fabio Checconi, Luigi Rizzo
+.\" Copyright (c) 2009-2010 Fabio Checconi
+.\" Copyright (c) 2009-2010 Luigi Rizzo, Universita` di Pisa
 .\" All rights reserved.
-.\" $FreeBSD$
 .\"
 .\" Redistribution and use in source and binary forms, with or without
 .\" modification, are permitted provided that the following conditions
@@ -23,6 +23,8 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
+.\" $FreeBSD$
+.\"
 .Dd April 12, 2010
 .Dt GSCHED 8
 .Os

Modified: stable/8/sys/geom/sched/g_sched.c
==============================================================================
--- head/sys/geom/sched/g_sched.c	Mon Apr 12 16:37:45 2010	(r206497)
+++ stable/8/sys/geom/sched/g_sched.c	Tue Apr 20 15:23:12 2010	(r206899)
@@ -1,5 +1,6 @@
 /*-
- * Copyright (c) 2009-2010 Fabio Checconi, Luigi Rizzo
+ * Copyright (c) 2009-2010 Fabio Checconi
+ * Copyright (c) 2009-2010 Luigi Rizzo, Universita` di Pisa
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without

Modified: stable/8/sys/geom/sched/g_sched.h
==============================================================================
--- head/sys/geom/sched/g_sched.h	Mon Apr 12 16:37:45 2010	(r206497)
+++ stable/8/sys/geom/sched/g_sched.h	Tue Apr 20 15:23:12 2010	(r206899)
@@ -1,5 +1,6 @@
 /*-
- * Copyright (c) 2009-2010 Fabio Checconi, Luigi Rizzo
+ * Copyright (c) 2009-2010 Fabio Checconi
+ * Copyright (c) 2009-2010 Luigi Rizzo, Universita` di Pisa
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without

Modified: stable/8/sys/geom/sched/gs_rr.c
==============================================================================
--- head/sys/geom/sched/gs_rr.c	Mon Apr 12 16:37:45 2010	(r206497)
+++ stable/8/sys/geom/sched/gs_rr.c	Tue Apr 20 15:23:12 2010	(r206899)
@@ -1,5 +1,6 @@
 /*-
- * Copyright (c) 2009-2010 Fabio Checconi, Luigi Rizzo
+ * Copyright (c) 2009-2010 Fabio Checconi
+ * Copyright (c) 2009-2010 Luigi Rizzo, Universita` di Pisa
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without

Modified: stable/8/sys/geom/sched/gs_scheduler.h
==============================================================================
--- head/sys/geom/sched/gs_scheduler.h	Mon Apr 12 16:37:45 2010	(r206497)
+++ stable/8/sys/geom/sched/gs_scheduler.h	Tue Apr 20 15:23:12 2010	(r206899)
@@ -1,5 +1,6 @@
 /*-
- * Copyright (c) 2009-2010 Fabio Checconi, Luigi Rizzo
+ * Copyright (c) 2009-2010 Fabio Checconi
+ * Copyright (c) 2009-2010 Luigi Rizzo, Universita` di Pisa
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without

Modified: stable/8/sys/modules/geom/Makefile
==============================================================================
--- stable/8/sys/modules/geom/Makefile	Tue Apr 20 14:22:29 2010	(r206898)
+++ stable/8/sys/modules/geom/Makefile	Tue Apr 20 15:23:12 2010	(r206899)
@@ -18,6 +18,7 @@ SUBDIR=	geom_bde \
 	geom_part \
 	geom_pc98 \
 	geom_raid3 \
+	geom_sched \
 	geom_shsec \
 	geom_stripe \
 	geom_sunlabel \

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Apr 20 18:46:00 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 72F33106566C;
	Tue, 20 Apr 2010 18:46:00 +0000 (UTC)
	(envelope-from brucec@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 51D488FC15;
	Tue, 20 Apr 2010 18:46:00 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3KIk0v2012697;
	Tue, 20 Apr 2010 18:46:00 GMT (envelope-from brucec@svn.freebsd.org)
Received: (from brucec@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3KIk0Mr012695;
	Tue, 20 Apr 2010 18:46:00 GMT (envelope-from brucec@svn.freebsd.org)
Message-Id: <201004201846.o3KIk0Mr012695@svn.freebsd.org>
From: Bruce Cran 
Date: Tue, 20 Apr 2010 18:46:00 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206908 - stable/8/etc
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 20 Apr 2010 18:46:00 -0000

Author: brucec
Date: Tue Apr 20 18:46:00 2010
New Revision: 206908
URL: http://svn.freebsd.org/changeset/base/206908

Log:
  MFC r204820:
  
  Install /etc/termcap.small .
  
  PR:	conf/78419
  Submitted by:	Eygene A.Ryabinkin 
  Approved by:	rrs (mentor)

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

Modified: stable/8/etc/Makefile
==============================================================================
--- stable/8/etc/Makefile	Tue Apr 20 18:44:23 2010	(r206907)
+++ stable/8/etc/Makefile	Tue Apr 20 18:46:00 2010	(r206908)
@@ -18,7 +18,7 @@ BIN1=	auth.conf \
 	rc rc.bsdextended rc.firewall rc.initdiskless \
 	rc.sendmail rc.shutdown \
 	rc.subr remote rpc services shells \
-	sysctl.conf syslog.conf \
+	sysctl.conf syslog.conf termcap.small \
 	etc.${MACHINE_ARCH}/ttys
 
 OPENBSMDIR=			${.CURDIR}/../contrib/openbsm

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Apr 20 20:19:20 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 09FA41065670;
	Tue, 20 Apr 2010 20:19:20 +0000 (UTC)
	(envelope-from brucec@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id ECDAF8FC21;
	Tue, 20 Apr 2010 20:19:19 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3KKJJ3Z033341;
	Tue, 20 Apr 2010 20:19:19 GMT (envelope-from brucec@svn.freebsd.org)
Received: (from brucec@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3KKJJih033338;
	Tue, 20 Apr 2010 20:19:19 GMT (envelope-from brucec@svn.freebsd.org)
Message-Id: <201004202019.o3KKJJih033338@svn.freebsd.org>
From: Bruce Cran 
Date: Tue, 20 Apr 2010 20:19:19 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206911 - stable/8/contrib/top
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 20 Apr 2010 20:19:20 -0000

Author: brucec
Date: Tue Apr 20 20:19:19 2010
New Revision: 206911
URL: http://svn.freebsd.org/changeset/base/206911

Log:
  MFC r205119 and r206056:
  
  Prevent the SIZE field being corrupted when a process allocates more than
  2TB.
  
  PR:	bin/129706
  Submitted by:	brucec
  Approved by: 	rrs (mentor)

Modified:
  stable/8/contrib/top/utils.c
  stable/8/contrib/top/utils.h
Directory Properties:
  stable/8/contrib/top/   (props changed)
  stable/8/contrib/top/install-sh   (props changed)

Modified: stable/8/contrib/top/utils.c
==============================================================================
--- stable/8/contrib/top/utils.c	Tue Apr 20 20:09:45 2010	(r206910)
+++ stable/8/contrib/top/utils.c	Tue Apr 20 20:19:19 2010	(r206911)
@@ -476,7 +476,7 @@ int amt;
 
 char *format_k2(amt)
 
-int amt;
+unsigned long long amt;
 
 {
     static char retarray[NUM_STRINGS][16];

Modified: stable/8/contrib/top/utils.h
==============================================================================
--- stable/8/contrib/top/utils.h	Tue Apr 20 20:09:45 2010	(r206910)
+++ stable/8/contrib/top/utils.h	Tue Apr 20 20:19:19 2010	(r206911)
@@ -21,4 +21,4 @@ long percentages();
 char *errmsg();
 char *format_time();
 char *format_k();
-char *format_k2();
+char *format_k2(unsigned long long);

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Apr 20 20:24:01 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1B5F71065679;
	Tue, 20 Apr 2010 20:24:01 +0000 (UTC)
	(envelope-from brucec@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 0A28E8FC20;
	Tue, 20 Apr 2010 20:24:01 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3KKO04i034478;
	Tue, 20 Apr 2010 20:24:00 GMT (envelope-from brucec@svn.freebsd.org)
Received: (from brucec@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3KKO008034476;
	Tue, 20 Apr 2010 20:24:00 GMT (envelope-from brucec@svn.freebsd.org)
Message-Id: <201004202024.o3KKO008034476@svn.freebsd.org>
From: Bruce Cran 
Date: Tue, 20 Apr 2010 20:24:00 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206913 - stable/8/sbin/sysctl
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 20 Apr 2010 20:24:01 -0000

Author: brucec
Date: Tue Apr 20 20:24:00 2010
New Revision: 206913
URL: http://svn.freebsd.org/changeset/base/206913

Log:
  MFC r205118:
  
  Free the memory allocated via strdup.
  
  PR:	bin/113881
  Submitted by:	Alexander Drozdov (dzal_mail at mtu-net.ru)
  Approved by:	rrs (mentor)

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

Modified: stable/8/sbin/sysctl/sysctl.c
==============================================================================
--- stable/8/sbin/sysctl/sysctl.c	Tue Apr 20 20:21:01 2010	(r206912)
+++ stable/8/sbin/sysctl/sysctl.c	Tue Apr 20 20:24:00 2010	(r206913)
@@ -379,6 +379,7 @@ S_timeval(int l2, void *p)
 		if (*p2 == '\n')
 			*p2 = '\0';
 	fputs(p1, stdout);
+	free(p1);
 	return (0);
 }
 

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Apr 20 21:02:16 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 288B8106567F;
	Tue, 20 Apr 2010 21:02:16 +0000 (UTC)
	(envelope-from kostikbel@gmail.com)
Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200])
	by mx1.freebsd.org (Postfix) with ESMTP id 0D5668FC20;
	Tue, 20 Apr 2010 21:02:12 +0000 (UTC)
Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua
	[10.1.1.148])
	by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id o3KL28xv022346
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 21 Apr 2010 00:02:08 +0300 (EEST)
	(envelope-from kostikbel@gmail.com)
Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1])
	by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id
	o3KL28ba003894; Wed, 21 Apr 2010 00:02:08 +0300 (EEST)
	(envelope-from kostikbel@gmail.com)
Received: (from kostik@localhost)
	by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o3KL28DW003893; 
	Wed, 21 Apr 2010 00:02:08 +0300 (EEST)
	(envelope-from kostikbel@gmail.com)
X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to
	kostikbel@gmail.com using -f
Date: Wed, 21 Apr 2010 00:02:08 +0300
From: Kostik Belousov 
To: Bruce Cran 
Message-ID: <20100420210208.GA2422@deviant.kiev.zoral.com.ua>
References: <201004202019.o3KKJJih033338@svn.freebsd.org>
Mime-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="a8Wt8u1KmwUX3Y2C"
Content-Disposition: inline
In-Reply-To: <201004202019.o3KKJJih033338@svn.freebsd.org>
User-Agent: Mutt/1.4.2.3i
X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua
X-Virus-Status: Clean
X-Spam-Status: No, score=-3.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,
	DNS_FROM_OPENWHOIS autolearn=no version=3.2.5
X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on
	skuns.kiev.zoral.com.ua
Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, svn-src-stable-8@freebsd.org
Subject: Re: svn commit: r206911 - stable/8/contrib/top
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 20 Apr 2010 21:02:16 -0000


--a8Wt8u1KmwUX3Y2C
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, Apr 20, 2010 at 08:19:19PM +0000, Bruce Cran wrote:
> Author: brucec
> Date: Tue Apr 20 20:19:19 2010
> New Revision: 206911
> URL: http://svn.freebsd.org/changeset/base/206911
>=20
> Log:
>   MFC r205119 and r206056:
>  =20
>   Prevent the SIZE field being corrupted when a process allocates more th=
an
>   2TB.
>  =20
>   PR:	bin/129706
>   Submitted by:	brucec
>   Approved by: 	rrs (mentor)

Am I right that this change contains a bug that was fixed by r206842 ?
If yes, why is it merged as is ?

--a8Wt8u1KmwUX3Y2C
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (FreeBSD)

iEYEARECAAYFAkvOFlAACgkQC3+MBN1Mb4iODACdHeZsDEy7znvNrAWl9ltUA3tW
mEoAnjv9v2PaeISGkgZXEEmKDf/5DX7U
=C3DL
-----END PGP SIGNATURE-----

--a8Wt8u1KmwUX3Y2C--

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Apr 20 21:24:33 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0D4391065675;
	Tue, 20 Apr 2010 21:24:33 +0000 (UTC)
	(envelope-from weongyo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id EF6FE8FC0A;
	Tue, 20 Apr 2010 21:24:32 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3KLOWuv048527;
	Tue, 20 Apr 2010 21:24:32 GMT (envelope-from weongyo@svn.freebsd.org)
Received: (from weongyo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3KLOWm9048526;
	Tue, 20 Apr 2010 21:24:32 GMT (envelope-from weongyo@svn.freebsd.org)
Message-Id: <201004202124.o3KLOWm9048526@svn.freebsd.org>
From: Weongyo Jeong 
Date: Tue, 20 Apr 2010 21:24:32 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206927 - stable/8/sys/dev/siba
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 20 Apr 2010 21:24:33 -0000

Author: weongyo
Date: Tue Apr 20 21:24:32 2010
New Revision: 206927
URL: http://svn.freebsd.org/changeset/base/206927

Log:
  MFC r201978:
    Merge from projects/mips to head by hand:
  
    Merge the siba bus device.  This was moved from mips to dev because
    siba bus can be in other architectures, like ARM.
  
  MFC r202056:
    Move this to the right location.  Grump.
  
  MFC r202057:
    This was somehow copied to the wrong place :(.  Remove the spare copy.
  
  Approved by:	imp

Added:
     - copied unchanged from r202056, head/sys/dev/siba/siba_cc.c
Directory Properties:
  stable/8/sys/dev/siba/siba_cc.c   (props changed)
Modified:
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/dev/uath/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Copied: stable/8/sys/dev/siba/siba_cc.c (from r202056, head/sys/dev/siba/siba_cc.c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/8/sys/dev/siba/siba_cc.c	Tue Apr 20 21:24:32 2010	(r206927, copy of r202056, head/sys/dev/siba/siba_cc.c)
@@ -0,0 +1,154 @@
+/*-
+ * Copyright (c) 2007 Bruce M. Simpson.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+ * Child driver for ChipCommon core.
+ * This is not MI code at the moment.
+ * Two 16C550 compatible UARTs live here. On the WGT634U, uart1 is the
+ * system console, and uart0 is not pinned out.
+ *  Because their presence is conditional, they should probably
+ *  be attached from here.
+ * GPIO lives here.
+ * The hardware watchdog lives here.
+ * Clock control registers live here.
+ *  You don't need to read them to determine the clock speed on the 5365,
+ *  which is always 200MHz and thus may be hardcoded (for now).
+ * Flash config registers live here. There may or may not be system flash.
+ * The external interface bus lives here (conditionally).
+ * There is a JTAG interface here which may be used to attach probes to
+ * the SoC for debugging.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+#include 
+#include 
+
+static int	siba_cc_attach(device_t);
+static int	siba_cc_probe(device_t);
+static void	siba_cc_intr(void *v);
+
+static int
+siba_cc_probe(device_t dev)
+{
+
+	if (siba_get_vendor(dev) == SIBA_VID_BROADCOM &&
+	    siba_get_device(dev) == SIBA_DEVID_CHIPCOMMON) {
+		device_set_desc(dev, "ChipCommon core");
+		return (BUS_PROBE_DEFAULT);
+	}
+
+	return (ENXIO);
+}
+
+struct siba_cc_softc {
+	void *notused;
+};
+
+static int
+siba_cc_attach(device_t dev)
+{
+	//struct siba_cc_softc *sc = device_get_softc(dev);
+	struct resource *mem;
+	struct resource *irq;
+	int rid;
+
+	/*
+	 * Allocate the resources which the parent bus has already
+	 * determined for us.
+	 * TODO: interrupt routing
+	 */
+#define MIPS_MEM_RID 0x20
+	rid = MIPS_MEM_RID;
+	mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE);
+	if (mem == NULL) {
+		device_printf(dev, "unable to allocate memory\n");
+		return (ENXIO);
+	}
+
+	rid = 0;
+	irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, 0);
+	if (irq == NULL) {
+		device_printf(dev, "unable to allocate irq\n");
+		return (ENXIO);
+	}
+
+	/* now setup the interrupt */
+	/* may be fast, exclusive or mpsafe at a later date */
+
+	/*
+	 * XXX is this interrupt line in ChipCommon used for anything
+	 * other than the uart? in that case we shouldn't hog it ourselves
+	 * and let uart claim it to avoid polled mode.
+	 */
+	int err;
+	void *cookie;
+	err = bus_setup_intr(dev, irq, INTR_TYPE_TTY, NULL, siba_cc_intr, NULL,
+	    &cookie);
+	if (err != 0) {
+		device_printf(dev, "unable to setup intr\n");
+		return (ENXIO);
+	}
+
+	/* TODO: attach uart child */
+
+	return (0);
+}
+
+static void
+siba_cc_intr(void *v)
+{
+
+}
+
+static device_method_t siba_cc_methods[] = {
+	/* Device interface */
+	DEVMETHOD(device_attach,	siba_cc_attach),
+	DEVMETHOD(device_probe,		siba_cc_probe),
+
+	{0, 0},
+};
+
+static driver_t siba_cc_driver = {
+	"siba_cc",
+	siba_cc_methods,
+	sizeof(struct siba_softc),
+};
+static devclass_t siba_cc_devclass;
+
+DRIVER_MODULE(siba_cc, siba, siba_cc_driver, siba_cc_devclass, 0, 0);

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Apr 20 21:29:54 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 43973106567D;
	Tue, 20 Apr 2010 21:29:54 +0000 (UTC)
	(envelope-from weongyo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 307768FC24;
	Tue, 20 Apr 2010 21:29:54 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3KLTsJL049843;
	Tue, 20 Apr 2010 21:29:54 GMT (envelope-from weongyo@svn.freebsd.org)
Received: (from weongyo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3KLTsCG049837;
	Tue, 20 Apr 2010 21:29:54 GMT (envelope-from weongyo@svn.freebsd.org)
Message-Id: <201004202129.o3KLTsCG049837@svn.freebsd.org>
From: Weongyo Jeong 
Date: Tue, 20 Apr 2010 21:29:54 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206928 - in stable/8/sys: dev/siba modules/siba_bwn
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 20 Apr 2010 21:29:54 -0000

Author: weongyo
Date: Tue Apr 20 21:29:53 2010
New Revision: 206928
URL: http://svn.freebsd.org/changeset/base/206928

Log:
  MFC r203319:
    Adds siba_bwn module which is used with bwn(4).  Main purpose of this
    module is to distinguish parts of Silicon Backplane and of Broadcom
    Wireless.

Added:
  stable/8/sys/dev/siba/siba_bwn.c
     - copied unchanged from r203319, head/sys/dev/siba/siba_bwn.c
  stable/8/sys/dev/siba/siba_core.c
     - copied unchanged from r203319, head/sys/dev/siba/siba_core.c
  stable/8/sys/modules/siba_bwn/
     - copied from r203319, head/sys/modules/siba_bwn/
Modified:
  stable/8/sys/dev/siba/siba.c
  stable/8/sys/dev/siba/siba_cc.c   (contents, props changed)
  stable/8/sys/dev/siba/siba_ids.h
  stable/8/sys/dev/siba/siba_pcib.c
  stable/8/sys/dev/siba/sibareg.h
  stable/8/sys/dev/siba/sibavar.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/dev/uath/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/siba/siba.c
==============================================================================
--- stable/8/sys/dev/siba/siba.c	Tue Apr 20 21:24:32 2010	(r206927)
+++ stable/8/sys/dev/siba/siba.c	Tue Apr 20 21:29:53 2010	(r206928)
@@ -37,9 +37,9 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
-#include 
-#include 
 #include 
+#include 
+#include 
 
 /*
  * TODO: De-mipsify this code.
@@ -77,7 +77,7 @@ static struct siba_devid siba_devids[] =
 	  "MIPS core" },
 	{ SIBA_VID_BROADCOM,	SIBA_DEVID_ETHERNET,	SIBA_REV_ANY,
 	  "Ethernet core" },
-	{ SIBA_VID_BROADCOM,	SIBA_DEVID_USB,		SIBA_REV_ANY,
+	{ SIBA_VID_BROADCOM,	SIBA_DEVID_USB11_HOSTDEV, SIBA_REV_ANY,
 	  "USB host controller" },
 	{ SIBA_VID_BROADCOM,	SIBA_DEVID_IPSEC,	SIBA_REV_ANY,
 	  "IPSEC accelerator" },
@@ -103,7 +103,6 @@ static struct siba_devid *
 static struct resource_list *
 		siba_get_reslist(device_t, device_t);
 static uint8_t	siba_getirq(uint16_t);
-static uint8_t	siba_getncores(uint16_t);
 static int	siba_print_all_resources(device_t dev);
 static int	siba_print_child(device_t, device_t);
 static int	siba_probe(device_t);
@@ -112,30 +111,7 @@ int		siba_read_ivar(device_t, device_t, 
 static struct siba_devinfo *
 		siba_setup_devinfo(device_t, uint8_t);
 int		siba_write_ivar(device_t, device_t, int, uintptr_t);
-
-/*
- * Earlier ChipCommon revisions have hardcoded number of cores
- * present dependent on the ChipCommon ID.
- */
-static uint8_t
-siba_getncores(uint16_t ccid)
-{
-	uint8_t ncores;
-
-	switch (ccid) {
-	case SIBA_CCID_SENTRY5:
-		ncores = 7;
-		break;
-	case SIBA_CCID_BCM4710:
-	case SIBA_CCID_BCM4704:
-		ncores = 9;
-		break;
-	default:
-		ncores = 0;
-	}
-
-	return (ncores);
-}
+uint8_t		siba_getncores(device_t, uint16_t);
 
 /*
  * On the Sentry5, the system bus IRQs are the same as the
@@ -156,7 +132,7 @@ siba_getirq(uint16_t devid)
 	case SIBA_DEVID_IPSEC:
 		irq = 2;
 		break;
-	case SIBA_DEVID_USB:
+	case SIBA_DEVID_USB11_HOSTDEV:
 		irq = 3;
 		break;
 	case SIBA_DEVID_PCI:
@@ -188,7 +164,7 @@ siba_probe(device_t dev)
 	uint16_t ccid;
 	int rid;
 
-	sc->sc_dev = dev;
+	sc->siba_dev = dev;
 
 	//rman_debug = 1;	/* XXX */
 
@@ -197,24 +173,24 @@ siba_probe(device_t dev)
 	 * was compiled with.
 	 */
 	rid = MIPS_MEM_RID;
-	sc->sc_mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid,
+	sc->siba_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid,
 	    RF_ACTIVE);
-	if (sc->sc_mem == NULL) {
+	if (sc->siba_mem_res == NULL) {
 		device_printf(dev, "unable to allocate probe aperture\n");
 		return (ENXIO);
 	}
-	sc->sc_bt = rman_get_bustag(sc->sc_mem);
-	sc->sc_bh = rman_get_bushandle(sc->sc_mem);
-	sc->sc_maddr = rman_get_start(sc->sc_mem);
-	sc->sc_msize = rman_get_size(sc->sc_mem);
+	sc->siba_mem_bt = rman_get_bustag(sc->siba_mem_res);
+	sc->siba_mem_bh = rman_get_bushandle(sc->siba_mem_res);
+	sc->siba_maddr = rman_get_start(sc->siba_mem_res);
+	sc->siba_msize = rman_get_size(sc->siba_mem_res);
 
 	if (siba_debug) {
 		device_printf(dev, "start %08x len %08x\n",
-		    sc->sc_maddr, sc->sc_msize);
+		    sc->siba_maddr, sc->siba_msize);
 	}
 
-	idlo = siba_read_4(sc, 0, SIBA_CORE_IDLO);
-	idhi = siba_read_4(sc, 0, SIBA_CORE_IDHI);
+	idlo = siba_mips_read_4(sc, 0, SIBA_IDLOW);
+	idhi = siba_mips_read_4(sc, 0, SIBA_IDHIGH);
 	ccid = ((idhi & 0x8ff0) >> 4);
 	if (siba_debug) {
 		device_printf(dev, "idlo = %08x\n", idlo);
@@ -256,7 +232,7 @@ siba_probe(device_t dev)
 	uint16_t cc_id;
 	uint16_t cc_rev;
 
-	ccidreg = siba_read_4(sc, 0, SIBA_CC_CCID);
+	ccidreg = siba_mips_read_4(sc, 0, SIBA_CC_CHIPID);
 	cc_id = (ccidreg & SIBA_CC_IDMASK);
 	cc_rev = (ccidreg & SIBA_CC_REVMASK) >> SIBA_CC_REVSHIFT;
 	if (siba_debug) {
@@ -264,9 +240,9 @@ siba_probe(device_t dev)
 		     ccidreg, cc_id, cc_rev);
 	}
 
-	sc->sc_ncores = siba_getncores(cc_id);
+	sc->siba_ncores = siba_getncores(dev, cc_id);
 	if (siba_debug) {
-		device_printf(dev, "%d cores detected.\n", sc->sc_ncores);
+		device_printf(dev, "%d cores detected.\n", sc->siba_ncores);
 	}
 
 	/*
@@ -275,36 +251,38 @@ siba_probe(device_t dev)
 	 */
 	rid = MIPS_MEM_RID;
 	int result;
-	result = bus_release_resource(dev, SYS_RES_MEMORY, rid, sc->sc_mem);
+	result = bus_release_resource(dev, SYS_RES_MEMORY, rid,
+	    sc->siba_mem_res);
 	if (result != 0) {
 		device_printf(dev, "error %d releasing resource\n", result);
 		return (ENXIO);
 	}
 
 	uint32_t total;
-	total = sc->sc_ncores * SIBA_CORE_LEN;
+	total = sc->siba_ncores * SIBA_CORE_LEN;
 
 	/* XXX Don't allocate the entire window until we
 	 * enumerate the bus. Once the bus has been enumerated,
 	 * and instance variables/children instantiated + populated,
 	 * release the resource so children may attach.
 	 */
-	sc->sc_mem = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid,
-	    sc->sc_maddr, sc->sc_maddr + total - 1, total, RF_ACTIVE);
-	if (sc->sc_mem == NULL) {
+	sc->siba_mem_res = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid,
+	    sc->siba_maddr, sc->siba_maddr + total - 1, total, RF_ACTIVE);
+	if (sc->siba_mem_res == NULL) {
 		device_printf(dev, "unable to allocate entire aperture\n");
 		return (ENXIO);
 	}
-	sc->sc_bt = rman_get_bustag(sc->sc_mem);
-	sc->sc_bh = rman_get_bushandle(sc->sc_mem);
-	sc->sc_maddr = rman_get_start(sc->sc_mem);
-	sc->sc_msize = rman_get_size(sc->sc_mem);
+	sc->siba_mem_bt = rman_get_bustag(sc->siba_mem_res);
+	sc->siba_mem_bh = rman_get_bushandle(sc->siba_mem_res);
+	sc->siba_maddr = rman_get_start(sc->siba_mem_res);
+	sc->siba_msize = rman_get_size(sc->siba_mem_res);
 
 	if (siba_debug) {
 		device_printf(dev, "after remapping: start %08x len %08x\n",
-		    sc->sc_maddr, sc->sc_msize);
+		    sc->siba_maddr, sc->siba_msize);
 	}
-	bus_set_resource(dev, SYS_RES_MEMORY, rid, sc->sc_maddr, sc->sc_msize);
+	bus_set_resource(dev, SYS_RES_MEMORY, rid, sc->siba_maddr,
+	    sc->siba_msize);
 
 	/*
 	 * We need a manager for the space we claim on nexus to
@@ -313,12 +291,13 @@ siba_probe(device_t dev)
 	 * otherwise it may be claimed elsewhere.
 	 * XXX move to softc
 	 */
-	mem_rman.rm_start = sc->sc_maddr;
-	mem_rman.rm_end = sc->sc_maddr + sc->sc_msize - 1;
+	mem_rman.rm_start = sc->siba_maddr;
+	mem_rman.rm_end = sc->siba_maddr + sc->siba_msize - 1;
 	mem_rman.rm_type = RMAN_ARRAY;
 	mem_rman.rm_descr = "SiBa I/O memory addresses";
 	if (rman_init(&mem_rman) != 0 ||
-	    rman_manage_region(&mem_rman, mem_rman.rm_start, mem_rman.rm_end) != 0) {
+	    rman_manage_region(&mem_rman, mem_rman.rm_start,
+		mem_rman.rm_end) != 0) {
 		panic("%s: mem_rman", __func__);
 	}
 
@@ -344,7 +323,7 @@ siba_attach(device_t dev)
 	 * NB: only one core may be mapped at any time if the siba bus
 	 * is the child of a PCI or PCMCIA bus.
 	 */
-	for (idx = 0; idx < sc->sc_ncores; idx++) {
+	for (idx = 0; idx < sc->siba_ncores; idx++) {
 		sdi = siba_setup_devinfo(dev, idx);
 		child = device_add_child(dev, NULL, -1);
 		if (child == NULL)
@@ -483,13 +462,14 @@ siba_setup_devinfo(device_t dev, uint8_t
 	sdi = malloc(sizeof(*sdi), M_DEVBUF, M_WAITOK | M_ZERO);
 	resource_list_init(&sdi->sdi_rl);
 
-	idlo = siba_read_4(sc, idx, SIBA_CORE_IDLO);
-	idhi = siba_read_4(sc, idx, SIBA_CORE_IDHI);
+	idlo = siba_mips_read_4(sc, idx, SIBA_IDLOW);
+	idhi = siba_mips_read_4(sc, idx, SIBA_IDHIGH);
 
-	vendorid = (idhi & SIBA_IDHIGH_VC) >> SIBA_IDHIGH_VC_SHIFT;
+	vendorid = (idhi & SIBA_IDHIGH_VENDORMASK) >>
+	    SIBA_IDHIGH_VENDOR_SHIFT;
 	devid = ((idhi & 0x8ff0) >> 4);
-	rev = (idhi & SIBA_IDHIGH_RCLO);
-	rev |= (idhi & SIBA_IDHIGH_RCHI) >> SIBA_IDHIGH_RCHI_SHIFT;
+	rev = (idhi & SIBA_IDHIGH_REVLO);
+	rev |= (idhi & SIBA_IDHIGH_REVHI) >> SIBA_IDHIGH_REVHI_SHIFT;
 
 	sdi->sdi_vid = vendorid;
 	sdi->sdi_devid = devid;
@@ -500,7 +480,7 @@ siba_setup_devinfo(device_t dev, uint8_t
 	/*
 	 * Determine memory window on bus and irq if one is needed.
 	 */
-	baseaddr = sc->sc_maddr + (idx * SIBA_CORE_LEN);
+	baseaddr = sc->siba_maddr + (idx * SIBA_CORE_LEN);
 	resource_list_add(&sdi->sdi_rl, SYS_RES_MEMORY,
 	    MIPS_MEM_RID, /* XXX */
 	    baseaddr, baseaddr + SIBA_CORE_LEN - 1, SIBA_CORE_LEN);

Copied: stable/8/sys/dev/siba/siba_bwn.c (from r203319, head/sys/dev/siba/siba_bwn.c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/8/sys/dev/siba/siba_bwn.c	Tue Apr 20 21:29:53 2010	(r206928, copy of r203319, head/sys/dev/siba/siba_bwn.c)
@@ -0,0 +1,366 @@
+/*-
+ * Copyright (c) 2009-2010 Weongyo Jeong 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer,
+ *    without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ *    similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any
+ *    redistribution must be conditioned upon including a substantially
+ *    similar Disclaimer requirement for further binary redistribution.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY
+ * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY,
+ * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+ * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+/*
+ * Sonics Silicon Backplane front-end for bwn(4).
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+/*
+ * PCI glue.
+ */
+
+struct siba_bwn_softc {
+	/* Child driver using MSI. */
+	device_t			ssc_msi_child;
+	struct siba_softc		ssc_siba;
+};
+
+#define	BS_BAR				0x10
+#define	PCI_VENDOR_BROADCOM		0x14e4
+#define	N(a)				(sizeof(a) / sizeof(a[0]))
+
+static const struct siba_dev {
+	uint16_t	vid;
+	uint16_t	did;
+	const char	*desc;
+} siba_devices[] = {
+	{ PCI_VENDOR_BROADCOM, 0x4301, "Broadcom BCM4301 802.11b Wireless" },
+	{ PCI_VENDOR_BROADCOM, 0x4306, "Unknown" },
+	{ PCI_VENDOR_BROADCOM, 0x4307, "Broadcom BCM4307 802.11b Wireless" },
+	{ PCI_VENDOR_BROADCOM, 0x4311, "Broadcom BCM4311 802.11b/g Wireless" },
+	{ PCI_VENDOR_BROADCOM, 0x4312,
+	  "Broadcom BCM4312 802.11a/b/g Wireless" },
+	{ PCI_VENDOR_BROADCOM, 0x4315, "Broadcom BCM4312 802.11b/g Wireless" },
+	{ PCI_VENDOR_BROADCOM, 0x4318, "Broadcom BCM4318 802.11b/g Wireless" },
+	{ PCI_VENDOR_BROADCOM, 0x4319,
+	  "Broadcom BCM4318 802.11a/b/g Wireless" },
+	{ PCI_VENDOR_BROADCOM, 0x4320, "Broadcom BCM4306 802.11b/g Wireless" },
+	{ PCI_VENDOR_BROADCOM, 0x4321, "Broadcom BCM4306 802.11a Wireless" },
+	{ PCI_VENDOR_BROADCOM, 0x4324,
+	  "Broadcom BCM4309 802.11a/b/g Wireless" },
+	{ PCI_VENDOR_BROADCOM, 0x4325, "Broadcom BCM4306 802.11b/g Wireless" },
+	{ PCI_VENDOR_BROADCOM, 0x4328, "Unknown" },
+	{ PCI_VENDOR_BROADCOM, 0x4329, "Unknown" },
+	{ PCI_VENDOR_BROADCOM, 0x432b, "Unknown" }
+};
+
+device_t	siba_add_child(device_t, struct siba_softc *, int, const char *,
+		    int);
+int		siba_core_attach(struct siba_softc *);
+int		siba_core_detach(struct siba_softc *);
+int		siba_core_suspend(struct siba_softc *);
+int		siba_core_resume(struct siba_softc *);
+
+static int
+siba_bwn_probe(device_t dev)
+{
+	int i;
+	uint16_t did, vid;
+
+	did = pci_get_device(dev);
+	vid = pci_get_vendor(dev);
+
+	for (i = 0; i < N(siba_devices); i++) {
+		if (siba_devices[i].did == did && siba_devices[i].vid == vid) {
+			device_set_desc(dev, siba_devices[i].desc);
+			return (BUS_PROBE_DEFAULT);
+		}
+	}
+	return (ENXIO);
+}
+
+static int
+siba_bwn_attach(device_t dev)
+{
+	struct siba_bwn_softc *ssc = device_get_softc(dev);
+	struct siba_softc *siba = &ssc->ssc_siba;
+
+	siba->siba_dev = dev;
+	siba->siba_type = SIBA_TYPE_PCI;
+
+	/*
+	 * Enable bus mastering.
+	 */
+	pci_enable_busmaster(dev);
+
+	/* 
+	 * Setup memory-mapping of PCI registers.
+	 */
+	siba->siba_mem_rid = SIBA_PCIR_BAR;
+	siba->siba_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
+		&siba->siba_mem_rid, RF_ACTIVE);
+	if (siba->siba_mem_res == NULL) {
+		device_printf(dev, "cannot map register space\n");
+		return (ENXIO);
+	}
+	siba->siba_mem_bt = rman_get_bustag(siba->siba_mem_res);
+	siba->siba_mem_bh = rman_get_bushandle(siba->siba_mem_res);
+
+	/* Get more PCI information */
+	siba->siba_pci_did = pci_get_device(dev);
+	siba->siba_pci_vid = pci_get_vendor(dev);
+	siba->siba_pci_subvid = pci_get_subvendor(dev);
+	siba->siba_pci_subdid = pci_get_subdevice(dev);
+
+	return (siba_core_attach(siba));
+}
+
+static int
+siba_bwn_detach(device_t dev)
+{
+	struct siba_bwn_softc *ssc = device_get_softc(dev);
+	struct siba_softc *siba = &ssc->ssc_siba;
+
+	/* check if device was removed */
+	siba->siba_invalid = !bus_child_present(dev);
+
+	pci_disable_busmaster(dev);
+	bus_generic_detach(dev);
+	siba_core_detach(siba);
+
+	bus_release_resource(dev, SYS_RES_MEMORY, BS_BAR, siba->siba_mem_res);
+
+	return (0);
+}
+
+static int
+siba_bwn_shutdown(device_t dev)
+{
+	device_t *devlistp;
+	int devcnt, error = 0, i;
+
+	error = device_get_children(dev, &devlistp, &devcnt);
+	if (error != 0)
+		return (error);
+
+	for (i = 0 ; i < devcnt ; i++)
+		device_shutdown(devlistp[i]);
+	free(devlistp, M_TEMP);
+	return (0);
+}
+
+static int
+siba_bwn_suspend(device_t dev)
+{
+	struct siba_bwn_softc *ssc = device_get_softc(dev);
+	struct siba_softc *siba = &ssc->ssc_siba;
+	device_t *devlistp;
+	int devcnt, error = 0, i, j;
+
+	error = device_get_children(dev, &devlistp, &devcnt);
+	if (error != 0)
+		return (error);
+
+	for (i = 0 ; i < devcnt ; i++) {
+		error = DEVICE_SUSPEND(devlistp[i]);
+		if (error) {
+			for (j = 0; j < i; i++)
+				DEVICE_RESUME(devlistp[j]);
+			return (error);
+		}
+	}
+	free(devlistp, M_TEMP);
+	return (siba_core_suspend(siba));
+}
+
+static int
+siba_bwn_resume(device_t dev)
+{
+	struct siba_bwn_softc *ssc = device_get_softc(dev);
+	struct siba_softc *siba = &ssc->ssc_siba;
+	device_t *devlistp;
+	int devcnt, error = 0, i;
+
+	error = siba_core_resume(siba);
+	if (error != 0)
+		return (error);
+
+	error = device_get_children(dev, &devlistp, &devcnt);
+	if (error != 0)
+		return (error);
+
+	for (i = 0 ; i < devcnt ; i++)
+		DEVICE_RESUME(devlistp[i]);
+	free(devlistp, M_TEMP);
+	return (0);
+}
+
+static device_t
+siba_bwn_add_child(device_t dev, int order, const char *name, int unit)
+{
+	struct siba_bwn_softc *ssc = device_get_softc(dev);
+	struct siba_softc *siba = &ssc->ssc_siba;
+
+	return (siba_add_child(dev, siba, order, name, unit));
+}
+
+/* proxying to the parent */
+static struct resource *
+siba_bwn_alloc_resource(device_t dev, device_t child, int type, int *rid,
+    u_long start, u_long end, u_long count, u_int flags)
+{
+
+	return (BUS_ALLOC_RESOURCE(device_get_parent(dev), dev,
+	    type, rid, start, end, count, flags));
+}
+
+/* proxying to the parent */
+static int
+siba_bwn_release_resource(device_t dev, device_t child, int type,
+    int rid, struct resource *r)
+{
+
+	return (BUS_RELEASE_RESOURCE(device_get_parent(dev), dev, type,
+	    rid, r));
+}
+
+/* proxying to the parent */
+static int
+siba_bwn_setup_intr(device_t dev, device_t child, struct resource *irq,
+    int flags, driver_filter_t *filter, driver_intr_t *intr, void *arg,
+    void **cookiep)
+{
+
+	return (BUS_SETUP_INTR(device_get_parent(dev), dev, irq, flags,
+	    filter, intr, arg, cookiep));
+}
+
+/* proxying to the parent */
+static int
+siba_bwn_teardown_intr(device_t dev, device_t child, struct resource *irq,
+    void *cookie)
+{
+
+	return (BUS_TEARDOWN_INTR(device_get_parent(dev), dev, irq, cookie));
+}
+
+static int
+siba_bwn_find_extcap(device_t dev, device_t child, int capability,
+    int *capreg)
+{
+
+	return (pci_find_extcap(dev, capability, capreg));
+}
+
+static int
+siba_bwn_alloc_msi(device_t dev, device_t child, int *count)
+{
+	struct siba_bwn_softc *ssc;
+	int error;
+
+	ssc = device_get_softc(dev);
+	if (ssc->ssc_msi_child != NULL)
+		return (EBUSY);
+	error = pci_alloc_msi(dev, count);
+	if (error == 0)
+		ssc->ssc_msi_child = child;
+	return (error);
+}
+
+static int
+siba_bwn_release_msi(device_t dev, device_t child)
+{
+	struct siba_bwn_softc *ssc;
+	int error;
+
+	ssc = device_get_softc(dev);
+	if (ssc->ssc_msi_child != child)
+		return (ENXIO);
+	error = pci_release_msi(dev);
+	if (error == 0)
+		ssc->ssc_msi_child = NULL;
+	return (error);
+}
+
+static int
+siba_bwn_msi_count(device_t dev, device_t child)
+{
+
+	return (pci_msi_count(dev));
+}
+
+static device_method_t siba_bwn_methods[] = {
+	/* Device interface */
+	DEVMETHOD(device_probe,		siba_bwn_probe),
+	DEVMETHOD(device_attach,	siba_bwn_attach),
+	DEVMETHOD(device_detach,	siba_bwn_detach),
+	DEVMETHOD(device_shutdown,	siba_bwn_shutdown),
+	DEVMETHOD(device_suspend,	siba_bwn_suspend),
+	DEVMETHOD(device_resume,	siba_bwn_resume),
+
+	/* Bus interface */
+	DEVMETHOD(bus_add_child,	siba_bwn_add_child),
+	DEVMETHOD(bus_alloc_resource,   siba_bwn_alloc_resource),
+	DEVMETHOD(bus_release_resource, siba_bwn_release_resource),
+	DEVMETHOD(bus_setup_intr,       siba_bwn_setup_intr),
+	DEVMETHOD(bus_teardown_intr,    siba_bwn_teardown_intr),
+
+	/* PCI interface */
+	DEVMETHOD(pci_find_extcap,	siba_bwn_find_extcap),
+	DEVMETHOD(pci_alloc_msi,	siba_bwn_alloc_msi),
+	DEVMETHOD(pci_release_msi,	siba_bwn_release_msi),
+	DEVMETHOD(pci_msi_count,	siba_bwn_msi_count),
+
+	{ 0,0 }
+};
+static driver_t siba_bwn_driver = {
+	"siba_bwn",
+	siba_bwn_methods,
+	sizeof(struct siba_bwn_softc)
+};
+static devclass_t siba_bwn_devclass;
+DRIVER_MODULE(siba_bwn, pci, siba_bwn_driver, siba_bwn_devclass, 0, 0);
+MODULE_VERSION(siba_bwn, 1);

Modified: stable/8/sys/dev/siba/siba_cc.c
==============================================================================
--- stable/8/sys/dev/siba/siba_cc.c	Tue Apr 20 21:24:32 2010	(r206927)
+++ stable/8/sys/dev/siba/siba_cc.c	Tue Apr 20 21:29:53 2010	(r206928)
@@ -55,9 +55,9 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
-#include 
-#include 
 #include 
+#include 
+#include 
 
 static int	siba_cc_attach(device_t);
 static int	siba_cc_probe(device_t);

Copied: stable/8/sys/dev/siba/siba_core.c (from r203319, head/sys/dev/siba/siba_core.c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/8/sys/dev/siba/siba_core.c	Tue Apr 20 21:29:53 2010	(r206928, copy of r203319, head/sys/dev/siba/siba_core.c)
@@ -0,0 +1,2007 @@
+/*-
+ * Copyright (c) 2009-2010 Weongyo Jeong 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer,
+ *    without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ *    similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any
+ *    redistribution must be conditioned upon including a substantially
+ *    similar Disclaimer requirement for further binary redistribution.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY
+ * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY,
+ * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+ * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+/*
+ * the Sonics Silicon Backplane driver.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#ifdef SIBA_DEBUG
+enum {
+	SIBA_DEBUG_SCAN		= 0x00000001,	/* scan */
+	SIBA_DEBUG_PMU		= 0x00000002,	/* PMU */
+	SIBA_DEBUG_PLL		= 0x00000004,	/* PLL */
+	SIBA_DEBUG_SWITCHCORE	= 0x00000008,	/* switching core */
+	SIBA_DEBUG_SPROM	= 0x00000010,	/* SPROM */
+	SIBA_DEBUG_CORE		= 0x00000020,	/* handling cores */
+	SIBA_DEBUG_ANY		= 0xffffffff
+};
+#define DPRINTF(siba, m, fmt, ...) do {			\
+	if (siba->siba_debug & (m))			\
+		printf(fmt, __VA_ARGS__);		\
+} while (0)
+#else
+#define DPRINTF(siba, m, fmt, ...) do { (void) siba; } while (0)
+#endif
+#define	N(a)			(sizeof(a) / sizeof(a[0]))
+
+static void	siba_pci_gpio(struct siba_softc *, uint32_t, int);
+static void	siba_scan(struct siba_softc *);
+static int	siba_switchcore(struct siba_softc *, uint8_t);
+static int	siba_pci_switchcore_sub(struct siba_softc *, uint8_t);
+static uint32_t	siba_scan_read_4(struct siba_softc *, uint8_t, uint16_t);
+static uint16_t	siba_dev2chipid(struct siba_softc *);
+static uint16_t	siba_pci_read_2(struct siba_dev_softc *, uint16_t);
+static uint32_t	siba_pci_read_4(struct siba_dev_softc *, uint16_t);
+static void	siba_pci_write_2(struct siba_dev_softc *, uint16_t, uint16_t);
+static void	siba_pci_write_4(struct siba_dev_softc *, uint16_t, uint32_t);
+static void	siba_cc_clock(struct siba_cc *,
+		    enum siba_clock);
+static void	siba_cc_pmu_init(struct siba_cc *);
+static void	siba_cc_power_init(struct siba_cc *);
+static void	siba_cc_powerup_delay(struct siba_cc *);
+static int	siba_cc_clockfreq(struct siba_cc *, int);
+static void	siba_cc_pmu1_pll0_init(struct siba_cc *, uint32_t);
+static void	siba_cc_pmu0_pll0_init(struct siba_cc *, uint32_t);
+static enum siba_clksrc siba_cc_clksrc(struct siba_cc *);
+static const struct siba_cc_pmu1_plltab *siba_cc_pmu1_plltab_find(uint32_t);
+static uint32_t	siba_cc_pll_read(struct siba_cc *, uint32_t);
+static void	siba_cc_pll_write(struct siba_cc *, uint32_t,
+		    uint32_t);
+static const struct siba_cc_pmu0_plltab *
+		siba_cc_pmu0_plltab_findentry(uint32_t);
+static int	siba_pci_sprom(struct siba_softc *, struct siba_sprom *);
+static int	siba_sprom_read(struct siba_softc *, uint16_t *, uint16_t);
+static int	sprom_check_crc(const uint16_t *, size_t);
+static uint8_t	siba_crc8(uint8_t, uint8_t);
+static void	siba_sprom_r123(struct siba_sprom *, const uint16_t *);
+static void	siba_sprom_r45(struct siba_sprom *, const uint16_t *);
+static void	siba_sprom_r8(struct siba_sprom *, const uint16_t *);
+static int8_t	siba_sprom_r123_antgain(uint8_t, const uint16_t *, uint16_t,
+		    uint16_t);
+static uint32_t	siba_tmslow_reject_bitmask(struct siba_dev_softc *);
+static uint32_t	siba_pcicore_read_4(struct siba_pci *, uint16_t);
+static void	siba_pcicore_write_4(struct siba_pci *, uint16_t, uint32_t);
+static uint32_t	siba_pcie_read(struct siba_pci *, uint32_t);
+static void	siba_pcie_write(struct siba_pci *, uint32_t, uint32_t);
+static void	siba_pcie_mdio_write(struct siba_pci *, uint8_t, uint8_t,
+		    uint16_t);
+static void	siba_pci_read_multi_1(struct siba_dev_softc *, void *, size_t,
+		    uint16_t);
+static void	siba_pci_read_multi_2(struct siba_dev_softc *, void *, size_t,
+		    uint16_t);
+static void	siba_pci_read_multi_4(struct siba_dev_softc *, void *, size_t,
+		    uint16_t);
+static void	siba_pci_write_multi_1(struct siba_dev_softc *, const void *,
+		    size_t, uint16_t);
+static void	siba_pci_write_multi_2(struct siba_dev_softc *, const void *,
+		    size_t, uint16_t);
+static void	siba_pci_write_multi_4(struct siba_dev_softc *, const void *,
+		    size_t, uint16_t);
+static const char *siba_core_name(uint16_t);
+static void	siba_pcicore_init(struct siba_pci *);
+device_t	siba_add_child(device_t, struct siba_softc *, int, const char *,
+		    int);
+int		siba_core_attach(struct siba_softc *);
+int		siba_core_detach(struct siba_softc *);
+int		siba_core_suspend(struct siba_softc *);
+int		siba_core_resume(struct siba_softc *);
+uint8_t		siba_getncores(device_t, uint16_t);
+
+static const struct siba_bus_ops siba_pci_ops = {
+	.read_2		= siba_pci_read_2,
+	.read_4		= siba_pci_read_4,
+	.write_2	= siba_pci_write_2,
+	.write_4	= siba_pci_write_4,
+	.read_multi_1	= siba_pci_read_multi_1,
+	.read_multi_2	= siba_pci_read_multi_2,
+	.read_multi_4	= siba_pci_read_multi_4,
+	.write_multi_1	= siba_pci_write_multi_1,
+	.write_multi_2	= siba_pci_write_multi_2,
+	.write_multi_4	= siba_pci_write_multi_4,
+};
+
+static const struct siba_cc_pmu_res_updown siba_cc_pmu_4325_updown[] =
+    SIBA_CC_PMU_4325_RES_UPDOWN;
+static const struct siba_cc_pmu_res_depend siba_cc_pmu_4325_depend[] =
+    SIBA_CC_PMU_4325_RES_DEPEND;
+static const struct siba_cc_pmu_res_updown siba_cc_pmu_4328_updown[] =
+    SIBA_CC_PMU_4328_RES_UPDOWN;
+static const struct siba_cc_pmu_res_depend siba_cc_pmu_4328_depend[] =
+    SIBA_CC_PMU_4328_RES_DEPEND;
+static const struct siba_cc_pmu0_plltab siba_cc_pmu0_plltab[] =
+    SIBA_CC_PMU0_PLLTAB_ENTRY;
+static const struct siba_cc_pmu1_plltab siba_cc_pmu1_plltab[] =
+    SIBA_CC_PMU1_PLLTAB_ENTRY;
+
+int
+siba_core_attach(struct siba_softc *siba)
+{
+	struct siba_cc *scc;
+	int error;
+
+	KASSERT(siba->siba_type == SIBA_TYPE_PCI,
+	    ("unsupported BUS type (%#x)", siba->siba_type));
+
+	siba->siba_ops = &siba_pci_ops;
+
+	siba_pci_gpio(siba, SIBA_GPIO_CRYSTAL | SIBA_GPIO_PLL, 1);
+	siba_scan(siba);
+
+	/* XXX init PCI or PCMCIA host devices */
+
+	siba_powerup(siba, 0);
+
+	/* init ChipCommon */
+	scc = &siba->siba_cc;
+	if (scc->scc_dev != NULL) {
+		siba_cc_pmu_init(scc);
+		siba_cc_power_init(scc);
+		siba_cc_clock(scc, SIBA_CLOCK_FAST);
+		siba_cc_powerup_delay(scc);
+	}
+
+	/* fetch various internal informations for PCI */
+	siba->siba_board_vendor = pci_read_config(siba->siba_dev,
+	    PCIR_SUBVEND_0, 2);
+	siba->siba_board_type = pci_read_config(siba->siba_dev, PCIR_SUBDEV_0,
+	    2);
+	siba->siba_board_rev = pci_read_config(siba->siba_dev, PCIR_REVID, 2);
+	error = siba_pci_sprom(siba, &siba->siba_sprom);
+	if (error) {
+		siba_powerdown(siba);
+		return (error);
+	}
+
+	siba_powerdown(siba);
+	return (0);
+}
+
+int
+siba_core_detach(struct siba_softc *siba)
+{
+	device_t *devlistp;
+	int devcnt, error = 0, i;
+
+	error = device_get_children(siba->siba_dev, &devlistp, &devcnt);
+	if (error != 0)
+		return (0);
+
+	for ( i = 0 ; i < devcnt ; i++)
+		device_delete_child(siba->siba_dev, devlistp[i]);
+	free(devlistp, M_TEMP);
+	return (0);
+}
+
+static void
+siba_pci_gpio(struct siba_softc *siba, uint32_t what, int on)
+{
+	uint32_t in, out;
+	uint16_t status;
+
+	if (siba->siba_type != SIBA_TYPE_PCI)
+		return;
+
+	out = pci_read_config(siba->siba_dev, SIBA_GPIO_OUT, 4);
+	if (on == 0) {
+		if (what & SIBA_GPIO_PLL)
+			out |= SIBA_GPIO_PLL;
+		if (what & SIBA_GPIO_CRYSTAL)
+			out &= ~SIBA_GPIO_CRYSTAL;
+		pci_write_config(siba->siba_dev, SIBA_GPIO_OUT, out, 4);
+		pci_write_config(siba->siba_dev, SIBA_GPIO_OUT_EN,
+		    pci_read_config(siba->siba_dev,
+			SIBA_GPIO_OUT_EN, 4) | what, 4);
+		return;
+	}
+
+	in = pci_read_config(siba->siba_dev, SIBA_GPIO_IN, 4);
+	if ((in & SIBA_GPIO_CRYSTAL) != SIBA_GPIO_CRYSTAL) {
+		if (what & SIBA_GPIO_CRYSTAL) {
+			out |= SIBA_GPIO_CRYSTAL;
+			if (what & SIBA_GPIO_PLL)
+				out |= SIBA_GPIO_PLL;
+			pci_write_config(siba->siba_dev, SIBA_GPIO_OUT, out, 4);
+			pci_write_config(siba->siba_dev,
+			    SIBA_GPIO_OUT_EN, pci_read_config(siba->siba_dev,
+				SIBA_GPIO_OUT_EN, 4) | what, 4);
+			DELAY(1000);
+		}
+		if (what & SIBA_GPIO_PLL) {
+			out &= ~SIBA_GPIO_PLL;
+			pci_write_config(siba->siba_dev, SIBA_GPIO_OUT, out, 4);
+			DELAY(5000);
+		}
+	}
+
+	status = pci_read_config(siba->siba_dev, PCIR_STATUS, 2);
+	status &= ~PCIM_STATUS_STABORT;
+	pci_write_config(siba->siba_dev, PCIR_STATUS, status, 2);
+}
+
+static void
+siba_scan(struct siba_softc *siba)
+{
+	struct siba_dev_softc *sd;
+	uint32_t idhi, tmp;
+	int base, dev_i = 0, error, i, is_pcie, n_80211 = 0, n_cc = 0,
+	    n_pci = 0;
+
+	KASSERT(siba->siba_type == SIBA_TYPE_PCI,
+	    ("unsupported BUS type (%#x)", siba->siba_type));
+
+	siba->siba_ndevs = 0;
+	error = siba_switchcore(siba, 0); /* need the first core */
+	if (error)
+		return;
+
+	idhi = siba_scan_read_4(siba, 0, SIBA_IDHIGH);
+	if (SIBA_IDHIGH_CORECODE(idhi) == SIBA_DEVID_CHIPCOMMON) {
+		tmp = siba_scan_read_4(siba, 0, SIBA_CC_CHIPID);
+		siba->siba_chipid = SIBA_CC_ID(tmp);
+		siba->siba_chiprev = SIBA_CC_REV(tmp);
+		siba->siba_chippkg = SIBA_CC_PKG(tmp);
+		if (SIBA_IDHIGH_REV(idhi) >= 4)
+			siba->siba_ndevs = SIBA_CC_NCORES(tmp);
+		siba->siba_cc.scc_caps = siba_scan_read_4(siba, 0,
+		    SIBA_CC_CAPS);
+	} else {
+		if (siba->siba_type == SIBA_TYPE_PCI) {
+			siba->siba_chipid = siba_dev2chipid(siba);
+			siba->siba_chiprev = pci_read_config(siba->siba_dev,
+			    PCIR_REVID, 2);
+			siba->siba_chippkg = 0;
+		} else {
+			siba->siba_chipid = 0x4710;
+			siba->siba_chiprev = 0;
+			siba->siba_chippkg = 0;
+		}
+	}
+	if (siba->siba_ndevs == 0)
+		siba->siba_ndevs = siba_getncores(siba->siba_dev,
+		    siba->siba_chipid);
+	if (siba->siba_ndevs > SIBA_MAX_CORES) {
+		device_printf(siba->siba_dev,
+		    "too many siba cores (max %d %d)\n",
+		    SIBA_MAX_CORES, siba->siba_ndevs);
+		return;
+	}
+
+	/* looking basic information about each cores/devices */
+	for (i = 0; i < siba->siba_ndevs; i++) {
+		error = siba_switchcore(siba, i);
+		if (error)
+			return;
+		sd = &(siba->siba_devs[dev_i]);
+		idhi = siba_scan_read_4(siba, i, SIBA_IDHIGH);
+		sd->sd_bus = siba;
+		sd->sd_id.sd_device = SIBA_IDHIGH_CORECODE(idhi);
+		sd->sd_id.sd_rev = SIBA_IDHIGH_REV(idhi);
+		sd->sd_id.sd_vendor = SIBA_IDHIGH_VENDOR(idhi);
+		sd->sd_ops = siba->siba_ops;
+		sd->sd_coreidx = i;
+
+		DPRINTF(siba, SIBA_DEBUG_SCAN,
+		    "core %d (%s) found (cc %#xrev %#x vendor %#x)\n",
+		    i, siba_core_name(sd->sd_id.sd_device),
+		    sd->sd_id.sd_device, sd->sd_id.sd_rev, sd->sd_id.vendor);
+
+		switch (sd->sd_id.sd_device) {
+		case SIBA_DEVID_CHIPCOMMON:
+			n_cc++;
+			if (n_cc > 1) {
+				device_printf(siba->siba_dev,
+				    "warn: multiple ChipCommon\n");
+				break;
+			}
+			siba->siba_cc.scc_dev = sd;
+			break;
+		case SIBA_DEVID_80211:
+			n_80211++;
+			if (n_80211 > 1) {
+				device_printf(siba->siba_dev,
+				    "warn: multiple 802.11 core\n");
+				continue;
+			}
+			break;
+		case SIBA_DEVID_PCI:
+		case SIBA_DEVID_PCIE:
+			n_pci++;
+			error = pci_find_extcap(siba->siba_dev, PCIY_EXPRESS,
+			    &base);
+			is_pcie = (error == 0) ? 1 : 0;
+
+			if (n_pci > 1) {
+				device_printf(siba->siba_dev,
+				    "warn: multiple PCI(E) cores\n");
+				break;
+			}
+			if (sd->sd_id.sd_device == SIBA_DEVID_PCI &&
+			    is_pcie == 1)

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

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Apr 20 21:33:14 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A24A41065674;
	Tue, 20 Apr 2010 21:33:14 +0000 (UTC)
	(envelope-from luigi@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 912AC8FC14;
	Tue, 20 Apr 2010 21:33:14 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3KLXE0q050639;
	Tue, 20 Apr 2010 21:33:14 GMT (envelope-from luigi@svn.freebsd.org)
Received: (from luigi@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3KLXEsM050637;
	Tue, 20 Apr 2010 21:33:14 GMT (envelope-from luigi@svn.freebsd.org)
Message-Id: <201004202133.o3KLXEsM050637@svn.freebsd.org>
From: Luigi Rizzo 
Date: Tue, 20 Apr 2010 21:33:14 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206929 - stable/8/sys/geom/sched
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 20 Apr 2010 21:33:14 -0000

Author: luigi
Date: Tue Apr 20 21:33:14 2010
New Revision: 206929
URL: http://svn.freebsd.org/changeset/base/206929

Log:
  MFC r206551 (forgotten in previous commit): fix builds with ktr

Modified:
  stable/8/sys/geom/sched/g_sched.c
Directory Properties:
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/geom/sched/g_sched.c
==============================================================================
--- stable/8/sys/geom/sched/g_sched.c	Tue Apr 20 21:29:53 2010	(r206928)
+++ stable/8/sys/geom/sched/g_sched.c	Tue Apr 20 21:33:14 2010	(r206929)
@@ -754,13 +754,6 @@ g_gsched_modevent(module_t mod, int cmd,
 
 #ifdef KTR
 #define	TRC_BIO_EVENT(e, bp)	g_sched_trace_bio_ ## e (bp)
-static inline int
-g_sched_issuer_pid(struct bio *bp)
-{
-	struct thread *thread = g_sched_issuer(bp);
-
-	return (thread->td_tid);
-}
 
 static inline char
 g_sched_type(struct bio *bp)
@@ -777,7 +770,7 @@ static inline void
 g_sched_trace_bio_START(struct bio *bp)
 {
 
-	CTR5(KTR_GSCHED, "S %d %c %lu/%lu %lu", g_sched_issuer_pid(bp),
+	CTR5(KTR_GSCHED, "S %lu %c %lu/%lu %lu", g_sched_classify(bp),
 	    g_sched_type(bp), bp->bio_offset / ULONG_MAX,
 	    bp->bio_offset, bp->bio_length);
 }
@@ -786,13 +779,13 @@ static inline void
 g_sched_trace_bio_DONE(struct bio *bp)
 {
 
-	CTR5(KTR_GSCHED, "D %d %c %lu/%lu %lu", g_sched_issuer_pid(bp),
+	CTR5(KTR_GSCHED, "D %lu %c %lu/%lu %lu", g_sched_classify(bp),
 	    g_sched_type(bp), bp->bio_offset / ULONG_MAX,
 	    bp->bio_offset, bp->bio_length);
 }
-#else
+#else /* !KTR */
 #define	TRC_BIO_EVENT(e, bp)
-#endif
+#endif /* !KTR */
 
 /*
  * g_sched_done() and g_sched_start() dispatch the geom requests to

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Apr 20 21:35:48 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BB619106564A;
	Tue, 20 Apr 2010 21:35:48 +0000 (UTC)
	(envelope-from weongyo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id AA4D68FC20;
	Tue, 20 Apr 2010 21:35:48 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3KLZmAU051308;
	Tue, 20 Apr 2010 21:35:48 GMT (envelope-from weongyo@svn.freebsd.org)
Received: (from weongyo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3KLZm2v051306;
	Tue, 20 Apr 2010 21:35:48 GMT (envelope-from weongyo@svn.freebsd.org)
Message-Id: <201004202135.o3KLZm2v051306@svn.freebsd.org>
From: Weongyo Jeong 
Date: Tue, 20 Apr 2010 21:35:48 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206931 - in stable/8/sys: dev/siba modules
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 20 Apr 2010 21:35:48 -0000

Author: weongyo
Date: Tue Apr 20 21:35:48 2010
New Revision: 206931
URL: http://svn.freebsd.org/changeset/base/206931

Log:
  MFC r203320:
    Hook up the siba_bwn module to the build.

Modified:
  stable/8/sys/modules/Makefile
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/dev/uath/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/siba/siba_cc.c   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/modules/Makefile
==============================================================================
--- stable/8/sys/modules/Makefile	Tue Apr 20 21:34:35 2010	(r206930)
+++ stable/8/sys/modules/Makefile	Tue Apr 20 21:35:48 2010	(r206931)
@@ -248,6 +248,7 @@ SUBDIR=	${_3dfx} \
 	sdhci \
 	sem \
 	sf \
+	siba_bwn \
 	siis \
 	sis \
 	sk \

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Apr 20 21:37:47 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 78659106564A;
	Tue, 20 Apr 2010 21:37:47 +0000 (UTC)
	(envelope-from weongyo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 661018FC1C;
	Tue, 20 Apr 2010 21:37:47 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3KLblKT051779;
	Tue, 20 Apr 2010 21:37:47 GMT (envelope-from weongyo@svn.freebsd.org)
Received: (from weongyo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3KLblpm051775;
	Tue, 20 Apr 2010 21:37:47 GMT (envelope-from weongyo@svn.freebsd.org)
Message-Id: <201004202137.o3KLblpm051775@svn.freebsd.org>
From: Weongyo Jeong 
Date: Tue, 20 Apr 2010 21:37:47 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206932 - stable/8/sys/dev/siba
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 20 Apr 2010 21:37:47 -0000

Author: weongyo
Date: Tue Apr 20 21:37:47 2010
New Revision: 206932
URL: http://svn.freebsd.org/changeset/base/206932

Log:
  MFC r203944:
    supports SPROM rev8 informations properly which are used to support
    low-power PHY of bwn(4) and LDO voltage adjustments.

Modified:
  stable/8/sys/dev/siba/siba_core.c
  stable/8/sys/dev/siba/sibareg.h
  stable/8/sys/dev/siba/sibavar.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/dev/uath/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/siba/siba_cc.c   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/dev/siba/siba_core.c
==============================================================================
--- stable/8/sys/dev/siba/siba_core.c	Tue Apr 20 21:35:48 2010	(r206931)
+++ stable/8/sys/dev/siba/siba_core.c	Tue Apr 20 21:37:47 2010	(r206932)
@@ -1457,6 +1457,9 @@ siba_crc8(uint8_t crc, uint8_t data)
 	(((__x) & (__mask)) / SIBA_LOWEST_SET_BIT(__mask))
 #define	SIBA_SHIFTOUT(_var, _offset, _mask)				\
 	out->_var = SIBA_SHIFTOUT_SUB(in[SIBA_OFFSET(_offset)], (_mask))
+#define SIBA_SHIFTOUT_4(_var, _offset, _mask, _shift)			\
+	out->_var = ((((uint32_t)in[SIBA_OFFSET((_offset)+2)] << 16 |	\
+	    in[SIBA_OFFSET(_offset)]) & (_mask)) >> (_shift))
 
 static void
 siba_sprom_r123(struct siba_sprom *out, const uint16_t *in)
@@ -1511,6 +1514,7 @@ siba_sprom_r123(struct siba_sprom *out, 
 	SIBA_SHIFTOUT(gpio1, SIBA_SPROM1_GPIOA, SIBA_SPROM1_GPIOA_P1);
 	SIBA_SHIFTOUT(gpio2, SIBA_SPROM1_GPIOB, SIBA_SPROM1_GPIOB_P2);
 	SIBA_SHIFTOUT(gpio3, SIBA_SPROM1_GPIOB, SIBA_SPROM1_GPIOB_P3);
+
 	SIBA_SHIFTOUT(maxpwr_a, SIBA_SPROM1_MAXPWR, SIBA_SPROM1_MAXPWR_A);
 	SIBA_SHIFTOUT(maxpwr_bg, SIBA_SPROM1_MAXPWR, SIBA_SPROM1_MAXPWR_BG);
 	SIBA_SHIFTOUT(tssi_a, SIBA_SPROM1_TSSI, SIBA_SPROM1_TSSI_A);
@@ -1587,22 +1591,61 @@ siba_sprom_r8(struct siba_sprom *out, co
 	uint16_t v;
 
 	for (i = 0; i < 3; i++) {
-		v = in[SIBA_OFFSET(SIBA_SPROM1_MAC_80211BG) + i];
+		v = in[SIBA_OFFSET(SIBA_SPROM8_MAC_80211BG) + i];
 		*(((uint16_t *)out->mac_80211bg) + i) = htobe16(v);
 	}
 	SIBA_SHIFTOUT(ccode, SIBA_SPROM8_CCODE, 0xffff);
 	SIBA_SHIFTOUT(bf_lo, SIBA_SPROM8_BFLOW, 0xffff);
 	SIBA_SHIFTOUT(bf_hi, SIBA_SPROM8_BFHIGH, 0xffff);
+	SIBA_SHIFTOUT(bf2_lo, SIBA_SPROM8_BFL2LO, 0xffff);
+	SIBA_SHIFTOUT(bf2_hi, SIBA_SPROM8_BFL2HI, 0xffff);
 	SIBA_SHIFTOUT(ant_a, SIBA_SPROM8_ANTAVAIL, SIBA_SPROM8_ANTAVAIL_A);
 	SIBA_SHIFTOUT(ant_bg, SIBA_SPROM8_ANTAVAIL, SIBA_SPROM8_ANTAVAIL_BG);
 	SIBA_SHIFTOUT(maxpwr_bg, SIBA_SPROM8_MAXP_BG, SIBA_SPROM8_MAXP_BG_MASK);
 	SIBA_SHIFTOUT(tssi_bg, SIBA_SPROM8_MAXP_BG, SIBA_SPROM8_TSSI_BG);
 	SIBA_SHIFTOUT(maxpwr_a, SIBA_SPROM8_MAXP_A, SIBA_SPROM8_MAXP_A_MASK);
 	SIBA_SHIFTOUT(tssi_a, SIBA_SPROM8_MAXP_A, SIBA_SPROM8_TSSI_A);
+	SIBA_SHIFTOUT(maxpwr_ah, SIBA_SPROM8_MAXP_AHL,
+	    SIBA_SPROM8_MAXP_AH_MASK);
+	SIBA_SHIFTOUT(maxpwr_al, SIBA_SPROM8_MAXP_AHL,
+	    SIBA_SPROM8_MAXP_AL_MASK);
 	SIBA_SHIFTOUT(gpio0, SIBA_SPROM8_GPIOA, SIBA_SPROM8_GPIOA_P0);
 	SIBA_SHIFTOUT(gpio1, SIBA_SPROM8_GPIOA, SIBA_SPROM8_GPIOA_P1);
 	SIBA_SHIFTOUT(gpio2, SIBA_SPROM8_GPIOB, SIBA_SPROM8_GPIOB_P2);
 	SIBA_SHIFTOUT(gpio3, SIBA_SPROM8_GPIOB, SIBA_SPROM8_GPIOB_P3);
+	SIBA_SHIFTOUT(tri2g, SIBA_SPROM8_TRI25G, SIBA_SPROM8_TRI2G);
+	SIBA_SHIFTOUT(tri5g, SIBA_SPROM8_TRI25G, SIBA_SPROM8_TRI5G);
+	SIBA_SHIFTOUT(tri5gl, SIBA_SPROM8_TRI5GHL, SIBA_SPROM8_TRI5GL);
+	SIBA_SHIFTOUT(tri5gh, SIBA_SPROM8_TRI5GHL, SIBA_SPROM8_TRI5GH);
+	SIBA_SHIFTOUT(rxpo2g, SIBA_SPROM8_RXPO, SIBA_SPROM8_RXPO2G);
+	SIBA_SHIFTOUT(rxpo5g, SIBA_SPROM8_RXPO, SIBA_SPROM8_RXPO5G);
+	SIBA_SHIFTOUT(rssismf2g, SIBA_SPROM8_RSSIPARM2G, SIBA_SPROM8_RSSISMF2G);
+	SIBA_SHIFTOUT(rssismc2g, SIBA_SPROM8_RSSIPARM2G, SIBA_SPROM8_RSSISMC2G);
+	SIBA_SHIFTOUT(rssisav2g, SIBA_SPROM8_RSSIPARM2G, SIBA_SPROM8_RSSISAV2G);
+	SIBA_SHIFTOUT(bxa2g, SIBA_SPROM8_RSSIPARM2G, SIBA_SPROM8_BXA2G);
+	SIBA_SHIFTOUT(rssismf5g, SIBA_SPROM8_RSSIPARM5G, SIBA_SPROM8_RSSISMF5G);
+	SIBA_SHIFTOUT(rssismc5g, SIBA_SPROM8_RSSIPARM5G, SIBA_SPROM8_RSSISMC5G);
+	SIBA_SHIFTOUT(rssisav5g, SIBA_SPROM8_RSSIPARM5G, SIBA_SPROM8_RSSISAV5G);
+	SIBA_SHIFTOUT(bxa5g, SIBA_SPROM8_RSSIPARM5G, SIBA_SPROM8_BXA5G);
+
+	SIBA_SHIFTOUT(pa0b0, SIBA_SPROM8_PA0B0, 0xffff);
+	SIBA_SHIFTOUT(pa0b1, SIBA_SPROM8_PA0B1, 0xffff);
+	SIBA_SHIFTOUT(pa0b2, SIBA_SPROM8_PA0B2, 0xffff);
+	SIBA_SHIFTOUT(pa1b0, SIBA_SPROM8_PA1B0, 0xffff);
+	SIBA_SHIFTOUT(pa1b1, SIBA_SPROM8_PA1B1, 0xffff);
+	SIBA_SHIFTOUT(pa1b2, SIBA_SPROM8_PA1B2, 0xffff);
+	SIBA_SHIFTOUT(pa1lob0, SIBA_SPROM8_PA1LOB0, 0xffff);
+	SIBA_SHIFTOUT(pa1lob1, SIBA_SPROM8_PA1LOB1, 0xffff);
+	SIBA_SHIFTOUT(pa1lob2, SIBA_SPROM8_PA1LOB2, 0xffff);
+	SIBA_SHIFTOUT(pa1hib0, SIBA_SPROM8_PA1HIB0, 0xffff);
+	SIBA_SHIFTOUT(pa1hib1, SIBA_SPROM8_PA1HIB1, 0xffff);
+	SIBA_SHIFTOUT(pa1hib2, SIBA_SPROM8_PA1HIB2, 0xffff);
+	SIBA_SHIFTOUT(cck2gpo, SIBA_SPROM8_CCK2GPO, 0xffff);
+
+	SIBA_SHIFTOUT_4(ofdm2gpo, SIBA_SPROM8_OFDM2GPO, 0xffffffff, 0);
+	SIBA_SHIFTOUT_4(ofdm5glpo, SIBA_SPROM8_OFDM5GLPO, 0xffffffff, 0);
+	SIBA_SHIFTOUT_4(ofdm5gpo, SIBA_SPROM8_OFDM5GPO, 0xffffffff, 0);
+	SIBA_SHIFTOUT_4(ofdm5ghpo, SIBA_SPROM8_OFDM5GHPO, 0xffffffff, 0);
 
 	/* antenna gain */
 	SIBA_SHIFTOUT(again.ghz24.a0, SIBA_SPROM8_AGAIN01, SIBA_SPROM8_AGAIN0);
@@ -2005,3 +2048,79 @@ siba_core_resume(struct siba_softc *siba
 
 	return (0);
 }
+
+static void
+siba_cc_regctl_setmask(struct siba_cc *cc, uint32_t offset, uint32_t mask,
+    uint32_t set)
+{
+
+	SIBA_CC_READ32(cc, SIBA_CC_REGCTL_ADDR);
+	SIBA_CC_WRITE32(cc, SIBA_CC_REGCTL_ADDR, offset);
+	SIBA_CC_READ32(cc, SIBA_CC_REGCTL_ADDR);
+	SIBA_CC_WRITE32(cc, SIBA_CC_REGCTL_DATA,
+	    (SIBA_CC_READ32(cc, SIBA_CC_REGCTL_DATA) & mask) | set);
+	SIBA_CC_READ32(cc, SIBA_CC_REGCTL_DATA);
+}
+
+void
+siba_cc_pmu_set_ldovolt(struct siba_cc *scc, int id, uint32_t volt)
+{
+	struct siba_softc *siba = scc->scc_dev->sd_bus;
+	uint32_t *p = NULL, info[5][3] = {
+		{ 2, 25,  0xf },
+		{ 3,  1,  0xf },
+		{ 3,  9,  0xf },
+		{ 3, 17, 0x3f },
+		{ 0, 21, 0x3f }
+	};
+
+	if (siba->siba_chipid == 0x4312) {
+		if (id != SIBA_LDO_PAREF)
+			return;
+		p = info[4];
+		siba_cc_regctl_setmask(scc, p[0], ~(p[2] << p[1]),
+		    (volt & p[2]) << p[1]);
+		return;
+	}
+	if (siba->siba_chipid == 0x4328 || siba->siba_chipid == 0x5354) {
+		switch (id) {
+		case SIBA_LDO_PAREF:
+			p = info[3];
+			break;
+		case SIBA_LDO_VOLT1:
+			p = info[0];
+			break;
+		case SIBA_LDO_VOLT2:
+			p = info[1];
+			break;
+		case SIBA_LDO_VOLT3:
+			p = info[2];
+			break;
+		default:
+			KASSERT(0 == 1,
+			    ("%s: unsupported voltage ID %#x", __func__, id));
+			return;
+		}
+		siba_cc_regctl_setmask(scc, p[0], ~(p[2] << p[1]),
+		    (volt & p[2]) << p[1]);
+	}
+}
+
+void
+siba_cc_pmu_set_ldoparef(struct siba_cc *scc, uint8_t on)
+{
+	struct siba_softc *siba = scc->scc_dev->sd_bus;
+	int ldo;
+
+	ldo = ((siba->siba_chipid == 0x4312) ? SIBA_CC_PMU_4312_PA_REF :
+	    ((siba->siba_chipid == 0x4328) ? SIBA_CC_PMU_4328_PA_REF :
+	    ((siba->siba_chipid == 0x5354) ? SIBA_CC_PMU_5354_PA_REF : -1)));
+	if (ldo == -1)
+		return;
+
+	if (on)
+		SIBA_CC_SET32(scc, SIBA_CC_PMU_MINRES, 1 << ldo);
+	else
+		SIBA_CC_MASK32(scc, SIBA_CC_PMU_MINRES, ~(1 << ldo));
+	SIBA_CC_READ32(scc, SIBA_CC_PMU_MINRES);
+}

Modified: stable/8/sys/dev/siba/sibareg.h
==============================================================================
--- stable/8/sys/dev/siba/sibareg.h	Tue Apr 20 21:35:48 2010	(r206931)
+++ stable/8/sys/dev/siba/sibareg.h	Tue Apr 20 21:37:47 2010	(r206932)
@@ -32,7 +32,7 @@
  */
 
 #ifndef _SIBA_SIBAREG_H_
-#define _SIBA_SIBAREG_H_
+#define	_SIBA_SIBAREG_H_
 
 #define	PCI_DEVICE_ID_BCM4401		0x4401
 #define	PCI_DEVICE_ID_BCM4401B0		0x4402
@@ -92,6 +92,8 @@
 #define	SIBA_CC_PMU_TABSEL		0x0620
 #define	SIBA_CC_PMU_DEPMSK		0x0624
 #define	SIBA_CC_PMU_UPDNTM		0x0628
+#define	SIBA_CC_REGCTL_ADDR		0x0658
+#define	SIBA_CC_REGCTL_DATA		0x065c
 #define	SIBA_CC_PLLCTL_ADDR		0x0660
 #define	SIBA_CC_PLLCTL_DATA		0x0664
 
@@ -148,6 +150,7 @@
 	{ 38400, 13, 45, 873813, }, { 40000, 14, 45, 0,      },		\
 }
 
+#define	SIBA_CC_PMU_4312_PA_REF		2
 #define	SIBA_CC_PMU_4325_BURST		1
 #define	SIBA_CC_PMU_4325_CLBURST	3
 #define	SIBA_CC_PMU_4325_LN		10
@@ -178,6 +181,7 @@
 #define	SIBA_CC_PMU_4328_BB_PLL_FILTBYP	17
 #define	SIBA_CC_PMU_4328_RF_PLL_FILTBYP	18
 #define	SIBA_CC_PMU_4328_BB_PLL_PU	19
+#define	SIBA_CC_PMU_5354_PA_REF		8
 #define	SIBA_CC_PMU_5354_BB_PLL_PU	19
 
 #define	SIBA_CC_PMU_4325_RES_UPDOWN					\
@@ -237,9 +241,9 @@
 
 #define	SIBA_REGWIN(x)							\
 	(SIBA_ENUM_START + ((x) * SIBA_CORE_LEN))
-#define SIBA_CORE_LEN		0x00001000	/* Size of cfg per core */
-#define SIBA_CFG_END		0x00010000	/* Upper bound of cfg space */
-#define SIBA_MAX_CORES		(SIBA_CFG_END/SIBA_CORE_LEN)	/* #max cores */
+#define	SIBA_CORE_LEN		0x00001000	/* Size of cfg per core */
+#define	SIBA_CFG_END		0x00010000	/* Upper bound of cfg space */
+#define	SIBA_MAX_CORES		(SIBA_CFG_END/SIBA_CORE_LEN)	/* #max cores */
 #define	SIBA_ENUM_START			0x18000000U
 #define	SIBA_ENUM_END			0x18010000U
 
@@ -372,6 +376,9 @@
 #define	SIBA_SPROM5_GPIOB_P3		0xff00
 #define	SIBA_SPROM8_BFLOW		0x1084
 #define	SIBA_SPROM8_BFHIGH		0x1086
+#define	SIBA_SPROM8_BFL2LO		0x1088
+#define	SIBA_SPROM8_BFL2HI		0x108a
+#define	SIBA_SPROM8_MAC_80211BG		0x108c
 #define	SIBA_SPROM8_CCODE		0x1092
 #define	SIBA_SPROM8_ANTAVAIL		0x109c
 #define	SIBA_SPROM8_ANTAVAIL_A		0xff00
@@ -379,21 +386,60 @@
 #define	SIBA_SPROM8_AGAIN01		0x109e
 #define	SIBA_SPROM8_AGAIN0		0x00ff
 #define	SIBA_SPROM8_AGAIN1		0xff00
-#define	SIBA_SPROM8_AGAIN23		0x10a0
-#define	SIBA_SPROM8_AGAIN2		0x00ff
-#define	SIBA_SPROM8_AGAIN3		0xff00
 #define	SIBA_SPROM8_GPIOA		0x1096
 #define	SIBA_SPROM8_GPIOA_P0		0x00ff
 #define	SIBA_SPROM8_GPIOA_P1		0xff00
 #define	SIBA_SPROM8_GPIOB		0x1098
 #define	SIBA_SPROM8_GPIOB_P2		0x00ff
 #define	SIBA_SPROM8_GPIOB_P3		0xff00
+#define	SIBA_SPROM8_AGAIN23		0x10a0
+#define	SIBA_SPROM8_AGAIN2		0x00ff
+#define	SIBA_SPROM8_AGAIN3		0xff00
+#define	SIBA_SPROM8_RSSIPARM2G		0x10a4
+#define	SIBA_SPROM8_RSSISMF2G		0x000f
+#define	SIBA_SPROM8_RSSISMC2G		0x00f0
+#define	SIBA_SPROM8_RSSISAV2G		0x0700	/* BITMASK */
+#define	SIBA_SPROM8_BXA2G		0x1800	/* BITMASK */
+#define	SIBA_SPROM8_RSSIPARM5G		0x10a6
+#define	SIBA_SPROM8_RSSISMF5G		0x000f
+#define	SIBA_SPROM8_RSSISMC5G		0x00f0
+#define	SIBA_SPROM8_RSSISAV5G		0x0700	/* BITMASK */
+#define	SIBA_SPROM8_BXA5G		0x1800	/* BITMASK */
+#define	SIBA_SPROM8_TRI25G		0x10a8
+#define	SIBA_SPROM8_TRI2G		0x00ff
+#define	SIBA_SPROM8_TRI5G		0xff00
+#define	SIBA_SPROM8_TRI5GHL		0x10aa
+#define	SIBA_SPROM8_TRI5GL		0x00ff
+#define	SIBA_SPROM8_TRI5GH		0xff00
+#define	SIBA_SPROM8_RXPO		0x10ac
+#define	SIBA_SPROM8_RXPO2G		0x00ff
+#define	SIBA_SPROM8_RXPO5G		0xff00
 #define	SIBA_SPROM8_MAXP_BG		0x10c0
 #define	SIBA_SPROM8_MAXP_BG_MASK	0x00ff
 #define	SIBA_SPROM8_TSSI_BG		0xff00
+#define	SIBA_SPROM8_PA0B0		0x10c2
+#define	SIBA_SPROM8_PA0B1		0x10c4
+#define	SIBA_SPROM8_PA0B2		0x10c6
 #define	SIBA_SPROM8_MAXP_A		0x10c8
 #define	SIBA_SPROM8_MAXP_A_MASK		0x00ff
 #define	SIBA_SPROM8_TSSI_A		0xff00
+#define	SIBA_SPROM8_MAXP_AHL		0x10ca
+#define	SIBA_SPROM8_MAXP_AH_MASK	0x00ff
+#define	SIBA_SPROM8_MAXP_AL_MASK	0xff00
+#define	SIBA_SPROM8_PA1B0		0x10cc
+#define	SIBA_SPROM8_PA1B1		0x10ce
+#define	SIBA_SPROM8_PA1B2		0x10d0
+#define	SIBA_SPROM8_PA1LOB0		0x10d2
+#define	SIBA_SPROM8_PA1LOB1		0x10d4
+#define	SIBA_SPROM8_PA1LOB2		0x10d6
+#define	SIBA_SPROM8_PA1HIB0		0x10d8
+#define	SIBA_SPROM8_PA1HIB1		0x10da
+#define	SIBA_SPROM8_PA1HIB2		0x10dc
+#define	SIBA_SPROM8_CCK2GPO		0x1140
+#define	SIBA_SPROM8_OFDM2GPO		0x1142
+#define	SIBA_SPROM8_OFDM5GPO		0x1146
+#define	SIBA_SPROM8_OFDM5GLPO		0x114a
+#define	SIBA_SPROM8_OFDM5GHPO		0x114e
 
 #define	SIBA_BOARDVENDOR_DELL		0x1028
 #define	SIBA_BOARDVENDOR_BCM		0x14e4
@@ -413,4 +459,6 @@
 #define	SIBA_PCICORE_SBTOPCI_BURST	0x00000008
 #define	SIBA_PCICORE_SBTOPCI_MRM	0x00000020
 
+#define	SIBA_CHIPPACK_BCM4712S     1       /* Small 200pin 4712 */
+
 #endif /* _SIBA_SIBAREG_H_ */

Modified: stable/8/sys/dev/siba/sibavar.h
==============================================================================
--- stable/8/sys/dev/siba/sibavar.h	Tue Apr 20 21:35:48 2010	(r206931)
+++ stable/8/sys/dev/siba/sibavar.h	Tue Apr 20 21:37:47 2010	(r206932)
@@ -214,16 +214,46 @@ struct siba_sprom {
 	uint16_t		pa1b0;
 	uint16_t		pa1b1;
 	uint16_t		pa1b2;
+	uint16_t		pa1lob0;
+	uint16_t		pa1lob1;
+	uint16_t		pa1lob2;
+	uint16_t		pa1hib0;
+	uint16_t		pa1hib1;
+	uint16_t		pa1hib2;
 	uint8_t			gpio0;
 	uint8_t			gpio1;
 	uint8_t			gpio2;
 	uint8_t			gpio3;
+	uint16_t		maxpwr_al;
 	uint16_t		maxpwr_a;	/* A-PHY Max Power */
+	uint16_t		maxpwr_ah;
 	uint16_t		maxpwr_bg;	/* BG-PHY Max Power */
+	uint8_t			rxpo2g;
+	uint8_t			rxpo5g;
 	uint8_t			tssi_a;		/* Idle TSSI */
 	uint8_t			tssi_bg;	/* Idle TSSI */
+	uint8_t			tri2g;
+	uint8_t			tri5gl;
+	uint8_t			tri5g;
+	uint8_t			tri5gh;
+	uint8_t			rssisav2g;
+	uint8_t			rssismc2g;
+	uint8_t			rssismf2g;
+	uint8_t			bxa2g;
+	uint8_t			rssisav5g;
+	uint8_t			rssismc5g;
+	uint8_t			rssismf5g;
+	uint8_t			bxa5g;
+	uint16_t		cck2gpo;
+	uint32_t		ofdm2gpo;
+	uint32_t		ofdm5glpo;
+	uint32_t		ofdm5gpo;
+	uint32_t		ofdm5ghpo;
 	uint16_t		bf_lo;		/* boardflags */
 	uint16_t		bf_hi;		/* boardflags */
+	uint16_t		bf2_lo;
+	uint16_t		bf2_hi;
+
 	struct {
 		struct {
 			int8_t a0, a1, a2, a3;
@@ -234,6 +264,11 @@ struct siba_sprom {
 	} again;	/* antenna gain */
 };
 
+#define	SIBA_LDO_PAREF			0
+#define	SIBA_LDO_VOLT1			1
+#define	SIBA_LDO_VOLT2			2
+#define	SIBA_LDO_VOLT3			3
+
 struct siba_cc_pmu {
 	uint8_t				rev;	/* PMU rev */
 	uint32_t			freq;	/* crystal freq in kHz */
@@ -367,5 +402,7 @@ void		siba_write_multi_2(struct siba_dev
 void		siba_write_multi_4(struct siba_dev_softc *, const void *,
 		    size_t, uint16_t);
 void		siba_barrier(struct siba_dev_softc *, int);
+void		siba_cc_pmu_set_ldovolt(struct siba_cc *, int, uint32_t);
+void		siba_cc_pmu_set_ldoparef(struct siba_cc *, uint8_t);
 
 #endif /* _SIBA_SIBAVAR_H_ */

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Apr 20 21:40:12 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4EF3A1065670;
	Tue, 20 Apr 2010 21:40:12 +0000 (UTC)
	(envelope-from weongyo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 3D7F08FC0A;
	Tue, 20 Apr 2010 21:40:12 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3KLeChi052370;
	Tue, 20 Apr 2010 21:40:12 GMT (envelope-from weongyo@svn.freebsd.org)
Received: (from weongyo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3KLeCfC052369;
	Tue, 20 Apr 2010 21:40:12 GMT (envelope-from weongyo@svn.freebsd.org)
Message-Id: <201004202140.o3KLeCfC052369@svn.freebsd.org>
From: Weongyo Jeong 
Date: Tue, 20 Apr 2010 21:40:12 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206933 - in stable/8/sys: dev/bwn dev/siba modules/bwn
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 20 Apr 2010 21:40:12 -0000

Author: weongyo
Date: Tue Apr 20 21:40:09 2010
New Revision: 206933
URL: http://svn.freebsd.org/changeset/base/206933

Log:
  MFC r203945:
    adds bwn(4) driver for supporting Broadcom BCM43xx chipsets.
  
      o uses v4 firmware instead of v3.  A port will be committed to
        create the bwn firmware module.
      o supports B/G and LP(low power) PHYs.
      o supports 32 / 64 bits DMA operations.
      o tested on big / little endian machines so should work on all
        architectures.
  
    It'd not connected to the build until the firmware port is committed.

Added:
  stable/8/sys/dev/bwn/
     - copied from r203945, head/sys/dev/bwn/
  stable/8/sys/modules/bwn/
     - copied from r203945, head/sys/modules/bwn/
Modified:
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/dev/uath/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/siba/siba_cc.c   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Apr 20 21:41:43 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DFFCD106564A;
	Tue, 20 Apr 2010 21:41:43 +0000 (UTC)
	(envelope-from weongyo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id B563D8FC0A;
	Tue, 20 Apr 2010 21:41:43 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3KLfhkV052744;
	Tue, 20 Apr 2010 21:41:43 GMT (envelope-from weongyo@svn.freebsd.org)
Received: (from weongyo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3KLfhU4052742;
	Tue, 20 Apr 2010 21:41:43 GMT (envelope-from weongyo@svn.freebsd.org)
Message-Id: <201004202141.o3KLfhU4052742@svn.freebsd.org>
From: Weongyo Jeong 
Date: Tue, 20 Apr 2010 21:41:43 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206934 - in stable/8/sys/dev: bwn siba
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 20 Apr 2010 21:41:44 -0000

Author: weongyo
Date: Tue Apr 20 21:41:43 2010
New Revision: 206934
URL: http://svn.freebsd.org/changeset/base/206934

Log:
  MFC r204081:
    o print msgs with length if the frame is too short to pass to
      net80211.
    o print key index for debugging if the frame is attempted to decrypt
      for WEP, AES or TKIP though currently HW decryption isn't supported.

Modified:
  stable/8/sys/dev/bwn/if_bwn.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/dev/uath/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/siba/siba_cc.c   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/dev/bwn/if_bwn.c
==============================================================================
--- stable/8/sys/dev/bwn/if_bwn.c	Tue Apr 20 21:40:09 2010	(r206933)
+++ stable/8/sys/dev/bwn/if_bwn.c	Tue Apr 20 21:41:43 2010	(r206934)
@@ -9416,19 +9416,24 @@ bwn_rxeof(struct bwn_mac *mac, struct mb
 
 	padding = (macstat & BWN_RX_MAC_PADDING) ? 2 : 0;
 	if (m->m_pkthdr.len < (sizeof(struct bwn_plcp6) + padding)) {
-		device_printf(sc->sc_dev, "RX: Packet size underrun (1)\n");
+		device_printf(sc->sc_dev, "frame too short (length=%d)\n",
+		    m->m_pkthdr.len);
 		goto drop;
 	}
 	plcp = (struct bwn_plcp6 *)(mp + padding);
 	m_adj(m, sizeof(struct bwn_plcp6) + padding);
 	if (m->m_pkthdr.len < IEEE80211_MIN_LEN) {
-		device_printf(sc->sc_dev, "RX: Packet size underrun (2)\n");
+		device_printf(sc->sc_dev, "frame too short (length=%d)\n",
+		    m->m_pkthdr.len);
 		goto drop;
 	}
 	wh = mtod(m, struct ieee80211_frame_min *);
 
 	if (macstat & BWN_RX_MAC_DEC)
-		device_printf(sc->sc_dev, "TODO: BWN_RX_MAC_DEC\n");
+		device_printf(sc->sc_dev,
+		    "RX decryption attempted (old %d keyidx %#x)\n",
+		    BWN_ISOLDFMT(mac),
+		    (macstat & BWN_RX_MAC_KEYIDX) >> BWN_RX_MAC_KEYIDX_SHIFT);
 
 	/* XXX calculating RSSI & noise & antenna */
 

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Apr 20 21:48:48 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9B4B2106566B;
	Tue, 20 Apr 2010 21:48:48 +0000 (UTC)
	(envelope-from weongyo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 898418FC17;
	Tue, 20 Apr 2010 21:48:48 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3KLmmYZ054382;
	Tue, 20 Apr 2010 21:48:48 GMT (envelope-from weongyo@svn.freebsd.org)
Received: (from weongyo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3KLmmaM054380;
	Tue, 20 Apr 2010 21:48:48 GMT (envelope-from weongyo@svn.freebsd.org)
Message-Id: <201004202148.o3KLmmaM054380@svn.freebsd.org>
From: Weongyo Jeong 
Date: Tue, 20 Apr 2010 21:48:48 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206935 - in stable/8/sys/dev: bwn siba
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 20 Apr 2010 21:48:48 -0000

Author: weongyo
Date: Tue Apr 20 21:48:48 2010
New Revision: 206935
URL: http://svn.freebsd.org/changeset/base/206935

Log:
  MFC r204242:
    Fix compilation problems with INVARIANTS.
  
    # also limit RX decryption attempted messages to 50
  
    Reviewed by:  weongyo
  
  Approved by:	imp (implicit)

Modified:
  stable/8/sys/dev/bwn/if_bwn.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/dev/uath/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/siba/siba_cc.c   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/dev/bwn/if_bwn.c
==============================================================================
--- stable/8/sys/dev/bwn/if_bwn.c	Tue Apr 20 21:41:43 2010	(r206934)
+++ stable/8/sys/dev/bwn/if_bwn.c	Tue Apr 20 21:48:48 2010	(r206935)
@@ -1496,6 +1496,7 @@ bwn_pio_select(struct bwn_mac *mac, uint
 		return (&mac->mac_method.pio.wme[WME_AC_VO]);
 	}
 	KASSERT(0 == 1, ("%s:%d: fail", __func__, __LINE__));
+	return (NULL);
 }
 
 static int
@@ -1905,10 +1906,9 @@ bwn_setup_channels(struct bwn_mac *mac, 
 static uint32_t
 bwn_shm_read_4(struct bwn_mac *mac, uint16_t way, uint16_t offset)
 {
-	struct bwn_softc *sc = mac->mac_sc;
 	uint32_t ret;
 
-	BWN_ASSERT_LOCKED(sc);
+	BWN_ASSERT_LOCKED(mac->mac_sc);
 
 	if (way == BWN_SHARED) {
 		KASSERT((offset & 0x0001) == 0,
@@ -1932,10 +1932,9 @@ out:
 static uint16_t
 bwn_shm_read_2(struct bwn_mac *mac, uint16_t way, uint16_t offset)
 {
-	struct bwn_softc *sc = mac->mac_sc;
 	uint16_t ret;
 
-	BWN_ASSERT_LOCKED(sc);
+	BWN_ASSERT_LOCKED(mac->mac_sc);
 
 	if (way == BWN_SHARED) {
 		KASSERT((offset & 0x0001) == 0,
@@ -1970,9 +1969,7 @@ static void
 bwn_shm_write_4(struct bwn_mac *mac, uint16_t way, uint16_t offset,
     uint32_t value)
 {
-	struct bwn_softc *sc = mac->mac_sc;
-
-	BWN_ASSERT_LOCKED(sc);
+	BWN_ASSERT_LOCKED(mac->mac_sc);
 
 	if (way == BWN_SHARED) {
 		KASSERT((offset & 0x0001) == 0,
@@ -1995,9 +1992,7 @@ static void
 bwn_shm_write_2(struct bwn_mac *mac, uint16_t way, uint16_t offset,
     uint16_t value)
 {
-	struct bwn_softc *sc = mac->mac_sc;
-
-	BWN_ASSERT_LOCKED(sc);
+	BWN_ASSERT_LOCKED(mac->mac_sc);
 
 	if (way == BWN_SHARED) {
 		KASSERT((offset & 0x0001) == 0,
@@ -3335,10 +3330,9 @@ bwn_core_start(struct bwn_mac *mac)
 static void
 bwn_core_exit(struct bwn_mac *mac)
 {
-	struct bwn_softc *sc = mac->mac_sc;
 	uint32_t macctl;
 
-	BWN_ASSERT_LOCKED(sc);
+	BWN_ASSERT_LOCKED(mac->mac_sc);
 
 	KASSERT(mac->mac_status <= BWN_MAC_STATUS_INITED,
 	    ("%s:%d: fail", __func__, __LINE__));
@@ -5198,6 +5192,8 @@ bwn_rf_init_bcm2050(struct bwn_mac *mac)
 		0x0e, 0x0f, 0x0d, 0x0f,
 	};
 
+	loctl = lomask = reg0 = classctl = crs0 = analogoverval = analogover =
+	    rfoverval = rfover = cck3 = 0;
 	radio0 = BWN_RF_READ(mac, 0x43);
 	radio1 = BWN_RF_READ(mac, 0x51);
 	radio2 = BWN_RF_READ(mac, 0x52);
@@ -5891,7 +5887,6 @@ static void
 bwn_dummy_transmission(struct bwn_mac *mac, int ofdm, int paon)
 {
 	struct bwn_phy *phy = &mac->mac_phy;
-	struct bwn_softc *sc = mac->mac_sc;
 	unsigned int i, max_loop;
 	uint16_t value;
 	uint32_t buffer[5] = {
@@ -5906,7 +5901,7 @@ bwn_dummy_transmission(struct bwn_mac *m
 		buffer[0] = 0x000b846e;
 	}
 
-	BWN_ASSERT_LOCKED(sc);
+	BWN_ASSERT_LOCKED(mac->mac_sc);
 
 	for (i = 0; i < 5; i++)
 		bwn_ram_write(mac, i * 4, buffer[i]);
@@ -5972,10 +5967,9 @@ bwn_ram_write(struct bwn_mac *mac, uint1
 static void
 bwn_lo_write(struct bwn_mac *mac, struct bwn_loctl *ctl)
 {
-	struct bwn_phy *phy = &mac->mac_phy;
 	uint16_t value;
 
-	KASSERT(phy->type == BWN_PHYTYPE_G,
+	KASSERT(mac->mac_phy->type == BWN_PHYTYPE_G,
 	    ("%s:%d: fail", __func__, __LINE__));
 
 	value = (uint8_t) (ctl->q);
@@ -6570,7 +6564,7 @@ bwn_lo_calibset(struct bwn_mac *mac,
 	struct bwn_phy_g *pg = &phy->phy_g;
 	struct bwn_loctl loctl = { 0, 0 };
 	struct bwn_lo_calib *cal;
-	struct bwn_lo_g_value sval;
+	struct bwn_lo_g_value sval = { 0 };
 	int rxgain;
 	uint16_t pad, reg, value;
 
@@ -8984,9 +8978,7 @@ bwn_noise_gensample(struct bwn_mac *mac)
 static int
 bwn_dma_freeslot(struct bwn_dma_ring *dr)
 {
-	struct bwn_mac *mac = dr->dr_mac;
-
-	BWN_ASSERT_LOCKED(mac->mac_sc);
+	BWN_ASSERT_LOCKED(dr->dr_mac->mac_sc);
 
 	return (dr->dr_numslots - dr->dr_usedslot);
 }
@@ -8994,9 +8986,7 @@ bwn_dma_freeslot(struct bwn_dma_ring *dr
 static int
 bwn_dma_nextslot(struct bwn_dma_ring *dr, int slot)
 {
-	struct bwn_mac *mac = dr->dr_mac;
-
-	BWN_ASSERT_LOCKED(mac->mac_sc);
+	BWN_ASSERT_LOCKED(dr->dr_mac->mac_sc);
 
 	KASSERT(slot >= -1 && slot <= dr->dr_numslots - 1,
 	    ("%s:%d: fail", __func__, __LINE__));
@@ -9393,9 +9383,10 @@ bwn_rxeof(struct bwn_mac *mac, struct mb
 	struct ifnet *ifp = sc->sc_ifp;
 	struct ieee80211com *ic = ifp->if_l2com;
 	uint32_t macstat;
-	int padding, rate, rssi, noise, type;
+	int padding, rate, rssi = 0, noise = 0, type;
 	uint16_t phytype, phystat0, phystat3, chanstat;
 	unsigned char *mp = mtod(m, unsigned char *);
+	static int rx_mac_dec_rpt = 0;
 
 	BWN_ASSERT_LOCKED(sc);
 
@@ -9429,7 +9420,7 @@ bwn_rxeof(struct bwn_mac *mac, struct mb
 	}
 	wh = mtod(m, struct ieee80211_frame_min *);
 
-	if (macstat & BWN_RX_MAC_DEC)
+	if (macstat & BWN_RX_MAC_DEC && rx_mac_dec_rpt++ < 50)
 		device_printf(sc->sc_dev,
 		    "RX decryption attempted (old %d keyidx %#x)\n",
 		    BWN_ISOLDFMT(mac),
@@ -10086,15 +10077,15 @@ bwn_dma_select(struct bwn_mac *mac, uint
 		return (mac->mac_method.dma.wme[WME_AC_BK]);
 	}
 	KASSERT(0 == 1, ("%s:%d: fail", __func__, __LINE__));
+	return (NULL);
 }
 
 static int
 bwn_dma_getslot(struct bwn_dma_ring *dr)
 {
-	struct bwn_mac *mac = dr->dr_mac;
 	int slot;
 
-	BWN_ASSERT_LOCKED(mac->mac_sc);
+	BWN_ASSERT_LOCKED(dr->dr_mac->mac_sc);
 
 	KASSERT(dr->dr_tx, ("%s:%d: fail", __func__, __LINE__));
 	KASSERT(!(dr->dr_stop), ("%s:%d: fail", __func__, __LINE__));
@@ -10579,6 +10570,7 @@ bwn_dma_parse_cookie(struct bwn_mac *mac
 		dr = dma->mcast;
 		break;
 	default:
+		dr = NULL;
 		KASSERT(0 == 1,
 		    ("invalid cookie value %d", cookie & 0xf000));
 	}
@@ -11677,6 +11669,7 @@ bwn_phy_lp_set_txpctlmode(struct bwn_mac
 		ctl = BWN_PHY_TX_PWR_CTL_CMD_MODE_SW;
 		break;
 	default:
+		ctl = 0;
 		KASSERT(0 == 1, ("%s:%d: fail", __func__, __LINE__));
 	}
 	BWN_PHY_SETMASK(mac, BWN_PHY_TX_PWR_CTL_CMD,

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Apr 20 21:51:45 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 837ED1065741;
	Tue, 20 Apr 2010 21:51:45 +0000 (UTC)
	(envelope-from weongyo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 724598FC08;
	Tue, 20 Apr 2010 21:51:45 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3KLpjFh055096;
	Tue, 20 Apr 2010 21:51:45 GMT (envelope-from weongyo@svn.freebsd.org)
Received: (from weongyo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3KLpjpT055094;
	Tue, 20 Apr 2010 21:51:45 GMT (envelope-from weongyo@svn.freebsd.org)
Message-Id: <201004202151.o3KLpjpT055094@svn.freebsd.org>
From: Weongyo Jeong 
Date: Tue, 20 Apr 2010 21:51:45 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206937 - in stable/8/sys/dev: bwn siba
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 20 Apr 2010 21:51:45 -0000

Author: weongyo
Date: Tue Apr 20 21:51:45 2010
New Revision: 206937
URL: http://svn.freebsd.org/changeset/base/206937

Log:
  MFC r204256:
    fixes a compile error; invalid type argument of '->'.

Modified:
  stable/8/sys/dev/bwn/if_bwn.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/dev/uath/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/siba/siba_cc.c   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/dev/bwn/if_bwn.c
==============================================================================
--- stable/8/sys/dev/bwn/if_bwn.c	Tue Apr 20 21:51:28 2010	(r206936)
+++ stable/8/sys/dev/bwn/if_bwn.c	Tue Apr 20 21:51:45 2010	(r206937)
@@ -5969,7 +5969,7 @@ bwn_lo_write(struct bwn_mac *mac, struct
 {
 	uint16_t value;
 
-	KASSERT(mac->mac_phy->type == BWN_PHYTYPE_G,
+	KASSERT(mac->mac_phy.type == BWN_PHYTYPE_G,
 	    ("%s:%d: fail", __func__, __LINE__));
 
 	value = (uint8_t) (ctl->q);

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Apr 20 21:52:54 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B67D910656A6;
	Tue, 20 Apr 2010 21:52:54 +0000 (UTC)
	(envelope-from weongyo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A51C08FC15;
	Tue, 20 Apr 2010 21:52:54 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3KLqsXv055410;
	Tue, 20 Apr 2010 21:52:54 GMT (envelope-from weongyo@svn.freebsd.org)
Received: (from weongyo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3KLqsa4055407;
	Tue, 20 Apr 2010 21:52:54 GMT (envelope-from weongyo@svn.freebsd.org)
Message-Id: <201004202152.o3KLqsa4055407@svn.freebsd.org>
From: Weongyo Jeong 
Date: Tue, 20 Apr 2010 21:52:54 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206938 - in stable/8/sys/dev: bwn siba
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 20 Apr 2010 21:52:54 -0000

Author: weongyo
Date: Tue Apr 20 21:52:54 2010
New Revision: 206938
URL: http://svn.freebsd.org/changeset/base/206938

Log:
  MFC r204257:
    o adds sysctl variables to show device statistics.
    o records RTS success/fail statistics.
  
    Pointed by:   imp

Modified:
  stable/8/sys/dev/bwn/if_bwn.c
  stable/8/sys/dev/bwn/if_bwnvar.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/dev/uath/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/siba/siba_cc.c   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/dev/bwn/if_bwn.c
==============================================================================
--- stable/8/sys/dev/bwn/if_bwn.c	Tue Apr 20 21:51:45 2010	(r206937)
+++ stable/8/sys/dev/bwn/if_bwn.c	Tue Apr 20 21:52:54 2010	(r206938)
@@ -536,6 +536,7 @@ static void	bwn_phy_lp_gaintbl_write_r2(
 		    struct bwn_txgain_entry);
 static void	bwn_phy_lp_gaintbl_write_r01(struct bwn_mac *, int,
 		    struct bwn_txgain_entry);
+static void	bwn_sysctl_node(struct bwn_softc *);
 
 static struct resource_spec bwn_res_spec_legacy[] = {
 	{ SYS_RES_IRQ,		0,		RF_ACTIVE | RF_SHAREABLE },
@@ -1066,9 +1067,6 @@ bwn_attach_post(struct bwn_softc *sc)
 	struct ifnet *ifp = sc->sc_ifp;
 	struct siba_dev_softc *sd = sc->sc_sd;
 	struct siba_sprom *sprom = &sd->sd_bus->siba_sprom;
-#ifdef BWN_DEBUG
-	device_t dev = sc->sc_dev;
-#endif
 
 	ic = ifp->if_l2com;
 	ic->ic_ifp = ifp;
@@ -1117,11 +1115,7 @@ bwn_attach_post(struct bwn_softc *sc)
 	    &sc->sc_rx_th.wr_ihdr, sizeof(sc->sc_rx_th),
 	    BWN_RX_RADIOTAP_PRESENT);
 
-#ifdef BWN_DEBUG
-	SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev),
-	    SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO,
-	    "debug", CTLFLAG_RW, &sc->sc_debug, 0, "Debug flags");
-#endif
+	bwn_sysctl_node(sc);
 
 	if (bootverbose)
 		ieee80211_announce(ic);
@@ -9077,6 +9071,7 @@ bwn_handle_txeof(struct bwn_mac *mac, co
 	struct bwn_pio_txqueue *tq;
 	struct bwn_pio_txpkt *tp = NULL;
 	struct bwn_softc *sc = mac->mac_sc;
+	struct bwn_stats *stats = &mac->mac_stats;
 	struct ieee80211_node *ni;
 	int slot;
 
@@ -9088,9 +9083,9 @@ bwn_handle_txeof(struct bwn_mac *mac, co
 		device_printf(sc->sc_dev, "TODO: STATUS AMPDU\n");
 	if (status->rtscnt) {
 		if (status->rtscnt == 0xf)
-			device_printf(sc->sc_dev, "TODO: RTS fail\n");
+			stats->rtsfail++;
 		else
-			device_printf(sc->sc_dev, "TODO: RTS ok\n");
+			stats->rts++;
 	}
 
 	if (mac->mac_flags & BWN_MAC_FLAG_DMA) {
@@ -14286,6 +14281,36 @@ bwn_phy_lp_gaintbl_write_r01(struct bwn_
 }
 
 static void
+bwn_sysctl_node(struct bwn_softc *sc)
+{
+	device_t dev = sc->sc_dev;
+	struct bwn_mac *mac;
+	struct bwn_stats *stats;
+
+	/* XXX assume that count of MAC is only 1. */
+
+	if ((mac = sc->sc_curmac) == NULL)
+		return;
+	stats = &mac->mac_stats;
+
+	SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev),
+	    SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO,
+	    "linknoise", CTLFLAG_RW, &stats->rts, 0, "Noise level");
+	SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev),
+	    SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO,
+	    "rts", CTLFLAG_RW, &stats->rts, 0, "RTS");
+	SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev),
+	    SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO,
+	    "rtsfail", CTLFLAG_RW, &stats->rtsfail, 0, "RTS failed to send");
+
+#ifdef BWN_DEBUG
+	SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev),
+	    SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO,
+	    "debug", CTLFLAG_RW, &sc->sc_debug, 0, "Debug flags");
+#endif
+}
+
+static void
 bwn_identify(driver_t *driver, device_t parent)
 {
 

Modified: stable/8/sys/dev/bwn/if_bwnvar.h
==============================================================================
--- stable/8/sys/dev/bwn/if_bwnvar.h	Tue Apr 20 21:51:45 2010	(r206937)
+++ stable/8/sys/dev/bwn/if_bwnvar.h	Tue Apr 20 21:52:54 2010	(r206938)
@@ -515,6 +515,8 @@ struct bwn_tx_radiotap_header {
 };
 
 struct bwn_stats {
+	int32_t				rtsfail;
+	int32_t				rts;
 	int32_t				link_noise;
 };
 

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Apr 20 21:55:44 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8A7601065676;
	Tue, 20 Apr 2010 21:55:44 +0000 (UTC)
	(envelope-from weongyo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 796138FC15;
	Tue, 20 Apr 2010 21:55:44 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3KLtiH9056098;
	Tue, 20 Apr 2010 21:55:44 GMT (envelope-from weongyo@svn.freebsd.org)
Received: (from weongyo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3KLtiGQ056096;
	Tue, 20 Apr 2010 21:55:44 GMT (envelope-from weongyo@svn.freebsd.org)
Message-Id: <201004202155.o3KLtiGQ056096@svn.freebsd.org>
From: Weongyo Jeong 
Date: Tue, 20 Apr 2010 21:55:44 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206939 - in stable/8/sys: dev/siba modules
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 20 Apr 2010 21:55:44 -0000

Author: weongyo
Date: Tue Apr 20 21:55:44 2010
New Revision: 206939
URL: http://svn.freebsd.org/changeset/base/206939

Log:
  MFC r204326:
    Add bwn(4) driver to the build.

Modified:
  stable/8/sys/modules/Makefile
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/dev/uath/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/siba/siba_cc.c   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/modules/Makefile
==============================================================================
--- stable/8/sys/modules/Makefile	Tue Apr 20 21:52:54 2010	(r206938)
+++ stable/8/sys/modules/Makefile	Tue Apr 20 21:55:44 2010	(r206939)
@@ -41,6 +41,7 @@ SUBDIR=	${_3dfx} \
 	${_bktr} \
 	${_bm} \
 	bridgestp \
+	bwn \
 	cam \
 	${_canbepm} \
 	${_canbus} \

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Apr 20 22:00:57 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3EE1E106564A;
	Tue, 20 Apr 2010 22:00:57 +0000 (UTC)
	(envelope-from weongyo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 2CCF88FC08;
	Tue, 20 Apr 2010 22:00:57 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3KM0vLJ057321;
	Tue, 20 Apr 2010 22:00:57 GMT (envelope-from weongyo@svn.freebsd.org)
Received: (from weongyo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3KM0v8g057318;
	Tue, 20 Apr 2010 22:00:57 GMT (envelope-from weongyo@svn.freebsd.org)
Message-Id: <201004202200.o3KM0v8g057318@svn.freebsd.org>
From: Weongyo Jeong 
Date: Tue, 20 Apr 2010 22:00:57 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206940 - stable/8/share/man/man4
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 20 Apr 2010 22:00:57 -0000

Author: weongyo
Date: Tue Apr 20 22:00:56 2010
New Revision: 206940
URL: http://svn.freebsd.org/changeset/base/206940

Log:
  MFC r203945:
    adds bwn(4) driver man page which missed to be merged.
  
  MFC r204327:
    Connect bwn.4 to the build.

Added:
  stable/8/share/man/man4/bwn.4
     - copied unchanged from r203945, head/share/man/man4/bwn.4
Modified:
  stable/8/share/man/man4/Makefile
Directory Properties:
  stable/8/share/man/man4/   (props changed)

Modified: stable/8/share/man/man4/Makefile
==============================================================================
--- stable/8/share/man/man4/Makefile	Tue Apr 20 21:55:44 2010	(r206939)
+++ stable/8/share/man/man4/Makefile	Tue Apr 20 22:00:56 2010	(r206940)
@@ -58,6 +58,7 @@ MAN=	aac.4 \
 	bridge.4 \
 	bt.4 \
 	bwi.4 \
+	bwn.4 \
 	cardbus.4 \
 	carp.4 \
 	cas.4 \

Copied: stable/8/share/man/man4/bwn.4 (from r203945, head/share/man/man4/bwn.4)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/8/share/man/man4/bwn.4	Tue Apr 20 22:00:56 2010	(r206940, copy of r203945, head/share/man/man4/bwn.4)
@@ -0,0 +1,134 @@
+.\" Copyright (c) 2009 Christian Brueffer
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd February 15, 2010
+.Dt BWN 4
+.Os
+.Sh NAME
+.Nm bwn
+.Nd Broadcom BCM43xx IEEE 802.11b/g wireless network driver
+.Sh SYNOPSIS
+To compile this driver into the kernel,
+place the following lines in your
+kernel configuration file:
+.Bd -ragged -offset indent
+.Cd "device siba_bwn"
+.Cd "device bwn"
+.Cd "device wlan"
+.Cd "device wlan_amrr"
+.Cd "device firmware"
+.Ed
+.Pp
+Alternatively, to load the driver as a
+module at boot time, place the following line in
+.Xr loader.conf 5 :
+.Bd -literal -offset indent
+if_bwn_load="YES"
+.Ed
+.Sh DESCRIPTION
+The
+.Nm
+driver provides support for Broadcom BCM43xx based
+PCI/CardBus network adapters.
+.Pp
+It supports
+.Cm station
+and
+.Cm monitor
+mode operation.
+Only one virtual interface may be configured at any time.
+For more information on configuring this device, see
+.Xr ifconfig 8 .
+.Pp
+This driver requires firmware to be loaded before it will work.
+The
+.Pa ports/net/bwn-firmware-kmod
+port needs to be installed before
+.Xr ifconfig 8
+will work.
+.Sh HARDWARE
+The
+.Nm
+driver supports Broadcom BCM43xx based wireless devices, including:
+.Pp
+.Bl -column -compact "Apple Airport Extreme" "BCM4306" "Mini PCI" "a/b/g" -offset 6n
+.It Em "Card	Chip	Bus	Standard"
+.It "Apple Airport Extreme	BCM4306	PCI	b/g"
+.It "Apple Airport Extreme	BCM4318	PCI	b/g"
+.It "ASUS WL-138g	BCM4318	PCI	b/g"
+.It "Buffalo WLI-CB-G54S	BCM4318	CardBus	b/g"
+.It "Buffalo WLI-PCI-G54S	BCM4306	PCI	b/g"
+.It "Compaq R4035 onboard	BCM4306	PCI	b/g"
+.It "Dell Wireless 1470	BCM4318	Mini PCI	b/g"
+.It "Dell Truemobile 1400	BCM4309	Mini PCI	b/g"
+.It "HP nx6125	BCM4319	PCI	b/g"
+.It "Linksys WPC54G Ver 3	BCM4318	CardBus	b/g"
+.It "Linksys WPC54GS Ver 2	BCM4318	CardBus	b/g"
+.It "TRENDnet TEW-401PCplus	BCM4306	CardBus	b/g"
+.It "US Robotics 5411	BCM4318	CardBus	b/g"
+.El
+.Sh EXAMPLES
+Join an existing BSS network (i.e., connect to an access point):
+.Pp
+.Bd -literal -offset indent
+ifconfig wlan create wlandev bwn0 inet 192.168.0.20 \e
+    netmask 0xffffff00
+.Ed
+.Pp
+Join a specific BSS network with network name
+.Dq Li my_net :
+.Pp
+.Dl "ifconfig wlan create wlandev bwn0 ssid my_net up"
+.Pp
+Join a specific BSS network with 64-bit WEP encryption:
+.Bd -literal -offset indent
+ifconfig wlan create wlandev bwn0 ssid my_net \e
+        wepmode on wepkey 0x1234567890 weptxkey 1 up
+.Ed
+.Sh SEE ALSO
+.Xr arp 4 ,
+.Xr cardbus 4 ,
+.Xr intro 4 ,
+.Xr pci 4 ,
+.Xr wlan 4 ,
+.Xr wlan_amrr 4 ,
+.Xr ifconfig 8 ,
+.Xr wpa_supplicant 8
+.Sh HISTORY
+The
+.Nm
+driver first appeared in
+.Fx 8.0 .
+.Sh AUTHORS
+.An -nosplit
+The
+.Nm
+driver was written by
+.An Weongyo Jeong
+.Aq weongyo@FreeBSD.org .
+.\".Sh BUGS
+.\"Some card based on the BCM4306 and BCM4309 chips do not work properly
+.\"on channel 1, 2 and 3.

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Apr 20 22:20:32 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 82F0E106564A;
	Tue, 20 Apr 2010 22:20:32 +0000 (UTC)
	(envelope-from jilles@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 57DF58FC19;
	Tue, 20 Apr 2010 22:20:32 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3KMKW6a061711;
	Tue, 20 Apr 2010 22:20:32 GMT (envelope-from jilles@svn.freebsd.org)
Received: (from jilles@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3KMKWBt061708;
	Tue, 20 Apr 2010 22:20:32 GMT (envelope-from jilles@svn.freebsd.org)
Message-Id: <201004202220.o3KMKWBt061708@svn.freebsd.org>
From: Jilles Tjoelker 
Date: Tue, 20 Apr 2010 22:20:31 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206942 - in stable/8: bin/sh
	tools/regression/bin/sh/parser
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 20 Apr 2010 22:20:32 -0000

Author: jilles
Date: Tue Apr 20 22:20:31 2010
New Revision: 206942
URL: http://svn.freebsd.org/changeset/base/206942

Log:
  MFC r199282: sh: Allow a newline before "in" in a for command,
  as required by POSIX.

Added:
  stable/8/tools/regression/bin/sh/parser/for1.0
     - copied unchanged from r199282, head/tools/regression/bin/sh/parser/for1.0
Modified:
  stable/8/bin/sh/parser.c
Directory Properties:
  stable/8/bin/sh/   (props changed)
  stable/8/tools/regression/bin/sh/   (props changed)

Modified: stable/8/bin/sh/parser.c
==============================================================================
--- stable/8/bin/sh/parser.c	Tue Apr 20 22:15:41 2010	(r206941)
+++ stable/8/bin/sh/parser.c	Tue Apr 20 22:20:31 2010	(r206942)
@@ -365,7 +365,9 @@ TRACE(("expecting DO got %s %s\n", tokna
 		n1 = (union node *)stalloc(sizeof (struct nfor));
 		n1->type = NFOR;
 		n1->nfor.var = wordtext;
-		if (readtoken() == TWORD && ! quoteflag && equal(wordtext, "in")) {
+		while (readtoken() == TNL)
+			;
+		if (lasttoken == TWORD && ! quoteflag && equal(wordtext, "in")) {
 			app = ≈
 			while (readtoken() == TWORD) {
 				n2 = (union node *)stalloc(sizeof (struct narg));

Copied: stable/8/tools/regression/bin/sh/parser/for1.0 (from r199282, head/tools/regression/bin/sh/parser/for1.0)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/8/tools/regression/bin/sh/parser/for1.0	Tue Apr 20 22:20:31 2010	(r206942, copy of r199282, head/tools/regression/bin/sh/parser/for1.0)
@@ -0,0 +1,29 @@
+# $FreeBSD$
+
+nl='
+'
+list=' a b c'
+for s1 in "$nl" " "; do
+	for s2 in "$nl" ";"; do
+		for s3 in "$nl" " "; do
+			r=''
+			eval "for i${s1}in ${list}${s2}do${s3}r=\"\$r \$i\"; done"
+			[ "$r" = "$list" ] || exit 1
+		done
+	done
+done
+set -- $list
+for s2 in "$nl" " " ";"; do # s2=";" is an extension to POSIX
+	for s3 in "$nl" " "; do
+		r=''
+		eval "for i${s2}do${s3}r=\"\$r \$i\"; done"
+		[ "$r" = "$list" ] || exit 1
+	done
+done
+for s1 in "$nl" " "; do
+	for s2 in "$nl" ";"; do
+		for s3 in "$nl" " "; do
+			eval "for i${s1}in${s2}do${s3}exit 1; done"
+		done
+	done
+done

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Apr 20 22:32:34 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A1211106564A;
	Tue, 20 Apr 2010 22:32:34 +0000 (UTC)
	(envelope-from jilles@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 8FDBD8FC13;
	Tue, 20 Apr 2010 22:32:34 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3KMWYMB064380;
	Tue, 20 Apr 2010 22:32:34 GMT (envelope-from jilles@svn.freebsd.org)
Received: (from jilles@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3KMWYso064377;
	Tue, 20 Apr 2010 22:32:34 GMT (envelope-from jilles@svn.freebsd.org)
Message-Id: <201004202232.o3KMWYso064377@svn.freebsd.org>
From: Jilles Tjoelker 
Date: Tue, 20 Apr 2010 22:32:34 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206944 - stable/8/bin/sh
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 20 Apr 2010 22:32:34 -0000

Author: jilles
Date: Tue Apr 20 22:32:34 2010
New Revision: 206944
URL: http://svn.freebsd.org/changeset/base/206944

Log:
  MFC r200943: sh: Remove setting variables from dotcmd/exportcmd.
  
  It is already done by evalcommand(), unless special-ness has been removed,
  in which case variable assignments should not persist. (These are currently
  always special builtins, but this may change later: command builtin,
  command substitution.)
  
  This also fixes a memory leak when calling . with variable assignments.
  
  Example:
    valgrind --leak-check=full sh -c 'x=1 . /dev/null; x=2'

Modified:
  stable/8/bin/sh/main.c
  stable/8/bin/sh/var.c
Directory Properties:
  stable/8/bin/sh/   (props changed)

Modified: stable/8/bin/sh/main.c
==============================================================================
--- stable/8/bin/sh/main.c	Tue Apr 20 22:24:35 2010	(r206943)
+++ stable/8/bin/sh/main.c	Tue Apr 20 22:32:34 2010	(r206944)
@@ -315,7 +315,6 @@ find_dot_file(char *basename)
 int
 dotcmd(int argc, char **argv)
 {
-	struct strlist *sp;
 	char *fullname;
 
 	if (argc < 2)
@@ -323,9 +322,6 @@ dotcmd(int argc, char **argv)
 
 	exitstatus = 0;
 
-	for (sp = cmdenviron; sp ; sp = sp->next)
-		setvareq(savestr(sp->text), VSTRFIXED|VTEXTFIXED);
-
 	fullname = find_dot_file(argv[1]);
 	setinputfile(fullname, 1);
 	commandname = fullname;

Modified: stable/8/bin/sh/var.c
==============================================================================
--- stable/8/bin/sh/var.c	Tue Apr 20 22:24:35 2010	(r206943)
+++ stable/8/bin/sh/var.c	Tue Apr 20 22:32:34 2010	(r206944)
@@ -604,7 +604,6 @@ exportcmd(int argc, char **argv)
 
 	if (values && argc != 0)
 		error("-p requires no arguments");
-	listsetvar(cmdenviron);
 	if (argc != 0) {
 		while ((name = *argv++) != NULL) {
 			if ((p = strchr(name, '=')) != NULL) {

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Apr 20 22:47:24 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CB1001065670;
	Tue, 20 Apr 2010 22:47:24 +0000 (UTC)
	(envelope-from delphij@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id B99798FC17;
	Tue, 20 Apr 2010 22:47:24 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3KMlOuQ067865;
	Tue, 20 Apr 2010 22:47:24 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3KMlOHT067861;
	Tue, 20 Apr 2010 22:47:24 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201004202247.o3KMlOHT067861@svn.freebsd.org>
From: Xin LI 
Date: Tue, 20 Apr 2010 22:47:24 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206948 - stable/8/usr.bin/gzip
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 20 Apr 2010 22:47:25 -0000

Author: delphij
Date: Tue Apr 20 22:47:24 2010
New Revision: 206948
URL: http://svn.freebsd.org/changeset/base/206948

Log:
  MFC r206387:
  
  Diff reduction against NetBSD and add myself to AUTHORS section of the
  manual page as I wrote the unpack functionality.  No actual executable
  code change verified with md5(1).

Modified:
  stable/8/usr.bin/gzip/gzip.1
  stable/8/usr.bin/gzip/gzip.c
  stable/8/usr.bin/gzip/unbzip2.c
Directory Properties:
  stable/8/usr.bin/gzip/   (props changed)

Modified: stable/8/usr.bin/gzip/gzip.1
==============================================================================
--- stable/8/usr.bin/gzip/gzip.1	Tue Apr 20 22:46:23 2010	(r206947)
+++ stable/8/usr.bin/gzip/gzip.1	Tue Apr 20 22:47:24 2010	(r206948)
@@ -25,7 +25,7 @@
 .\" SUCH DAMAGE.
 .\"
 .\" $FreeBSD$
-.Dd June 24, 2009
+.Dd April 7, 2010
 .Dt GZIP 1
 .Os
 .Sh NAME
@@ -205,14 +205,17 @@ This implementation of
 .Nm
 was ported based on the
 .Nx
-.Nm
-20090412, and first appeared in
+.Nm ,
+and first appeared in
 .Fx 7.0 .
 .Sh AUTHORS
+.An -nosplit
 This implementation of
 .Nm
 was written by
-.An Matthew R. Green Aq mrg@eterna.com.au .
+.An Matthew R. Green Aq mrg@eterna.com.au
+with unpack support written by
+.An Xin LI Aq delphij@FreeBSD.org .
 .Sh BUGS
 According to RFC 1952, the recorded file size is stored in a 32-bit
 integer and therefore it can not represent files that is bigger than

Modified: stable/8/usr.bin/gzip/gzip.c
==============================================================================
--- stable/8/usr.bin/gzip/gzip.c	Tue Apr 20 22:46:23 2010	(r206947)
+++ stable/8/usr.bin/gzip/gzip.c	Tue Apr 20 22:47:24 2010	(r206948)
@@ -1,4 +1,4 @@
-/*	$NetBSD: gzip.c,v 1.94 2009/04/12 10:31:14 lukem Exp $	*/
+/*	$NetBSD: gzip.c,v 1.97 2009/10/11 09:17:21 mrg Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998, 2003, 2004, 2006 Matthew R. Green
@@ -149,10 +149,9 @@ static suffixes_t suffixes[] = {
 #undef SUFFIX
 };
 #define NUM_SUFFIXES (sizeof suffixes / sizeof suffixes[0])
-
 #define SUFFIX_MAXLEN	30
 
-static	const char	gzip_version[] = "FreeBSD gzip 20090621";
+static	const char	gzip_version[] = "FreeBSD gzip 20100407";
 
 #ifndef SMALL
 static	const char	gzip_copyright[] = \
@@ -206,7 +205,7 @@ static	char	*infile;		/* name of file co
 
 static	void	maybe_err(const char *fmt, ...) __dead2
     __attribute__((__format__(__printf__, 1, 2)));
-#ifndef NO_BZIP2_SUPPORT
+#if !defined(NO_BZIP2_SUPPORT) || !defined(NO_PACK_SUPPORT)
 static	void	maybe_errx(const char *fmt, ...) __dead2
     __attribute__((__format__(__printf__, 1, 2)));
 #endif
@@ -461,7 +460,7 @@ maybe_err(const char *fmt, ...)
 	exit(2);
 }
 
-#ifndef NO_BZIP2_SUPPORT
+#if !defined(NO_BZIP2_SUPPORT) || !defined(NO_PACK_SUPPORT)
 /* ... without an errno. */
 void
 maybe_errx(const char *fmt, ...)
@@ -1319,6 +1318,7 @@ file_uncompress(char *file, char *outfil
 	enum filetype method;
 	int fd, ofd, zfd = -1;
 #ifndef SMALL
+	ssize_t rv;
 	time_t timestamp = 0;
 	unsigned char name[PATH_MAX + 1];
 #endif
@@ -1364,7 +1364,6 @@ file_uncompress(char *file, char *outfil
 #ifndef SMALL
 	if (method == FT_GZIP && Nflag) {
 		unsigned char ts[4];	/* timestamp */
-		ssize_t rv;
 
 		rv = pread(fd, ts, sizeof ts, GZIP_TIMESTAMP);
 		if (rv >= 0 && rv < (ssize_t)(sizeof ts))
@@ -2054,7 +2053,7 @@ static void
 display_license(void)
 {
 
-	fprintf(stderr, "%s (based on NetBSD gzip 20060927)\n", gzip_version);
+	fprintf(stderr, "%s (based on NetBSD gzip 20091011)\n", gzip_version);
 	fprintf(stderr, "%s\n", gzip_copyright);
 	exit(0);
 }
@@ -2100,4 +2099,3 @@ read_retry(int fd, void *buf, size_t sz)
 
 	return sz - left;
 }
-

Modified: stable/8/usr.bin/gzip/unbzip2.c
==============================================================================
--- stable/8/usr.bin/gzip/unbzip2.c	Tue Apr 20 22:46:23 2010	(r206947)
+++ stable/8/usr.bin/gzip/unbzip2.c	Tue Apr 20 22:47:24 2010	(r206948)
@@ -1,4 +1,4 @@
-/*	$NetBSD: unbzip2.c,v 1.12 2009/10/11 05:17:20 mrg Exp $	*/
+/*	$NetBSD: unbzip2.c,v 1.13 2009/12/05 03:23:37 mrg Exp $	*/
 
 /*-
  * Copyright (c) 2006 The NetBSD Foundation, Inc.

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Apr 20 22:52:14 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 367481065672;
	Tue, 20 Apr 2010 22:52:14 +0000 (UTC)
	(envelope-from delphij@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 252998FC1D;
	Tue, 20 Apr 2010 22:52:14 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3KMqDd4068993;
	Tue, 20 Apr 2010 22:52:13 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3KMqDEV068991;
	Tue, 20 Apr 2010 22:52:13 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201004202252.o3KMqDEV068991@svn.freebsd.org>
From: Xin LI 
Date: Tue, 20 Apr 2010 22:52:13 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206949 - stable/8/usr.bin/minigzip
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 20 Apr 2010 22:52:14 -0000

Author: delphij
Date: Tue Apr 20 22:52:13 2010
New Revision: 206949
URL: http://svn.freebsd.org/changeset/base/206949

Log:
  MFC r205472:
  
  Enable mmap for minigzip(1).

Modified:
  stable/8/usr.bin/minigzip/Makefile
Directory Properties:
  stable/8/usr.bin/minigzip/   (props changed)

Modified: stable/8/usr.bin/minigzip/Makefile
==============================================================================
--- stable/8/usr.bin/minigzip/Makefile	Tue Apr 20 22:47:24 2010	(r206948)
+++ stable/8/usr.bin/minigzip/Makefile	Tue Apr 20 22:52:13 2010	(r206949)
@@ -1,8 +1,12 @@
 # $FreeBSD$
 
+SRCDIR=	${.CURDIR}/../../lib/libz
+.PATH:	${SRCDIR}
+
 PROG=	minigzip
-LDADD=	-lz
+
+CFLAGS+=-DUSE_MMAP
 DPADD=	${LIBZ}
-.PATH:	${.CURDIR}/../../lib/libz
+LDADD=	-lz
 
 .include 

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Apr 20 22:52:29 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 580631065686;
	Tue, 20 Apr 2010 22:52:29 +0000 (UTC)
	(envelope-from jilles@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 461AC8FC19;
	Tue, 20 Apr 2010 22:52:29 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3KMqTlU069093;
	Tue, 20 Apr 2010 22:52:29 GMT (envelope-from jilles@svn.freebsd.org)
Received: (from jilles@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3KMqTjk069088;
	Tue, 20 Apr 2010 22:52:29 GMT (envelope-from jilles@svn.freebsd.org)
Message-Id: <201004202252.o3KMqTjk069088@svn.freebsd.org>
From: Jilles Tjoelker 
Date: Tue, 20 Apr 2010 22:52:29 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206950 - in stable/8: bin/sh
	tools/regression/bin/sh/parameters
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 20 Apr 2010 22:52:29 -0000

Author: jilles
Date: Tue Apr 20 22:52:28 2010
New Revision: 206950
URL: http://svn.freebsd.org/changeset/base/206950

Log:
  MFC r203576,r203677: sh: Don't stat() $MAIL/$MAILPATH if not interactive.
  
  These may be NFS mounted, and we should not touch them unless we are going
  to do something useful with the information.

Added:
  stable/8/tools/regression/bin/sh/parameters/mail1.0
     - copied unchanged from r203576, head/tools/regression/bin/sh/parameters/mail1.0
  stable/8/tools/regression/bin/sh/parameters/mail2.0
     - copied, changed from r203576, head/tools/regression/bin/sh/parameters/mail2.0
Modified:
  stable/8/bin/sh/main.c
  stable/8/bin/sh/var.c
Directory Properties:
  stable/8/bin/sh/   (props changed)
  stable/8/tools/regression/bin/sh/   (props changed)

Modified: stable/8/bin/sh/main.c
==============================================================================
--- stable/8/bin/sh/main.c	Tue Apr 20 22:52:13 2010	(r206949)
+++ stable/8/bin/sh/main.c	Tue Apr 20 22:52:28 2010	(r206950)
@@ -157,6 +157,8 @@ main(int argc, char *argv[])
 		out2str("sh: cannot determine working directory\n");
 	if (getpwd() != NULL)
 		setvar ("PWD", getpwd(), VEXPORT);
+	if (iflag)
+		chkmail(1);
 	if (argv[0] && argv[0][0] == '-') {
 		state = 1;
 		read_profile("/etc/profile");

Modified: stable/8/bin/sh/var.c
==============================================================================
--- stable/8/bin/sh/var.c	Tue Apr 20 22:52:13 2010	(r206949)
+++ stable/8/bin/sh/var.c	Tue Apr 20 22:52:28 2010	(r206950)
@@ -335,8 +335,13 @@ setvareq(char *s, int flags)
 			/*
 			 * We could roll this to a function, to handle it as
 			 * a regular variable function callback, but why bother?
+			 *
+			 * Note: this assumes iflag is not set to 1 initially.
+			 * As part of init(), this is called before arguments
+			 * are looked at.
 			 */
-			if (vp == &vmpath || (vp == &vmail && ! mpathset()))
+			if ((vp == &vmpath || (vp == &vmail && ! mpathset())) &&
+			    iflag == 1)
 				chkmail(1);
 			if ((vp->flags & VEXPORT) && localevar(s)) {
 				change_env(s, 1);

Copied: stable/8/tools/regression/bin/sh/parameters/mail1.0 (from r203576, head/tools/regression/bin/sh/parameters/mail1.0)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/8/tools/regression/bin/sh/parameters/mail1.0	Tue Apr 20 22:52:28 2010	(r206950, copy of r203576, head/tools/regression/bin/sh/parameters/mail1.0)
@@ -0,0 +1,15 @@
+# $FreeBSD$
+# Test that a non-interactive shell does not access $MAIL.
+
+goodfile=/var/empty/sh-test-goodfile
+mailfile=/var/empty/sh-test-mailfile
+T=$(mktemp sh-test.XXXXXX) || exit
+MAIL=$mailfile ktrace -i -f "$T" sh -c "[ -s $goodfile ]" 2>/dev/null
+if ! grep -q $goodfile "$T"; then
+	# ktrace problem
+	rc=0
+elif ! grep -q $mailfile "$T"; then
+	rc=0
+fi
+rm "$T"
+exit ${rc:-3}

Copied and modified: stable/8/tools/regression/bin/sh/parameters/mail2.0 (from r203576, head/tools/regression/bin/sh/parameters/mail2.0)
==============================================================================
--- head/tools/regression/bin/sh/parameters/mail2.0	Sat Feb  6 22:57:24 2010	(r203576, copy source)
+++ stable/8/tools/regression/bin/sh/parameters/mail2.0	Tue Apr 20 22:52:28 2010	(r206950)
@@ -4,7 +4,7 @@
 goodfile=/var/empty/sh-test-goodfile
 mailfile=/var/empty/sh-test-mailfile
 T=$(mktemp sh-test.XXXXXX) || exit
-MAIL=$mailfile ktrace -i -f "$T" sh +m -i /dev/null 2>&1
+ENV=$goodfile MAIL=$mailfile ktrace -i -f "$T" sh +m -i /dev/null 2>&1
 if ! grep -q $goodfile "$T"; then
 	# ktrace problem
 	rc=0

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Apr 20 22:55:08 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 09C99106564A;
	Tue, 20 Apr 2010 22:55:08 +0000 (UTC)
	(envelope-from weongyo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D2B998FC14;
	Tue, 20 Apr 2010 22:55:07 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3KMt7Ca069723;
	Tue, 20 Apr 2010 22:55:07 GMT (envelope-from weongyo@svn.freebsd.org)
Received: (from weongyo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3KMt7mu069720;
	Tue, 20 Apr 2010 22:55:07 GMT (envelope-from weongyo@svn.freebsd.org)
Message-Id: <201004202255.o3KMt7mu069720@svn.freebsd.org>
From: Weongyo Jeong 
Date: Tue, 20 Apr 2010 22:55:07 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206951 - in stable/8: sys/boot/forth sys/dev/siba
	usr.sbin/sysinstall
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 20 Apr 2010 22:55:08 -0000

Author: weongyo
Date: Tue Apr 20 22:55:07 2010
New Revision: 206951
URL: http://svn.freebsd.org/changeset/base/206951

Log:
  MFC r204328:
    Add bwn(4) driver.

Modified:
  stable/8/sys/boot/forth/loader.conf
  stable/8/usr.sbin/sysinstall/devices.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/dev/uath/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/siba/siba_cc.c   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)
  stable/8/usr.sbin/sysinstall/   (props changed)

Modified: stable/8/sys/boot/forth/loader.conf
==============================================================================
--- stable/8/sys/boot/forth/loader.conf	Tue Apr 20 22:52:28 2010	(r206950)
+++ stable/8/sys/boot/forth/loader.conf	Tue Apr 20 22:55:07 2010	(r206951)
@@ -224,6 +224,7 @@ if_axe_load="NO"		# ASIX Electronics AX8
 if_bce_load="NO"		# Broadcom NetXtreme II Gigabit Ethernet
 if_bfe_load="NO"		# Broadcom BCM4401
 if_bge_load="NO"		# Broadcom BCM570x PCI Gigabit Ethernet
+if_bwn_load="NO"		# Broadcom BCM43xx IEEE 802.11 wireless NICs
 if_cas_load="NO"		# Sun Cassini/Cassini+ and NS DP83065 Saturn
 if_cm_load="NO"			# SMC (90c26, 90c56, 90c66)
 if_cs_load="NO"			# Crystal Semiconductor CS8920

Modified: stable/8/usr.sbin/sysinstall/devices.c
==============================================================================
--- stable/8/usr.sbin/sysinstall/devices.c	Tue Apr 20 22:52:28 2010	(r206950)
+++ stable/8/usr.sbin/sysinstall/devices.c	Tue Apr 20 22:55:07 2010	(r206951)
@@ -105,6 +105,7 @@ static struct _devname {
     NETWORK("bfe",	"Broadcom BCM440x PCI Ethernet card"),
     NETWORK("bge",	"Broadcom BCM570x PCI Gigabit Ethernet card"),
     NETWORK("bm",	"Apple BMAC Built-in Ethernet"),
+    NETWORK("bwn",	"Broadcom BCM43xx IEEE 802.11 wireless adapter"),
     NETWORK("cas",	"Sun Cassini/Cassini+ or NS DP83065 Saturn Ethernet"),
     NETWORK("cue",	"CATC USB Ethernet adapter"),
     NETWORK("cxgb",	"Chelsio T3 10Gb Ethernet card"),

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Apr 20 22:57:06 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 445CE1065675;
	Tue, 20 Apr 2010 22:57:06 +0000 (UTC)
	(envelope-from delphij@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 332DC8FC17;
	Tue, 20 Apr 2010 22:57:06 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3KMv6Wo070250;
	Tue, 20 Apr 2010 22:57:06 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3KMv6lQ070248;
	Tue, 20 Apr 2010 22:57:06 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201004202257.o3KMv6lQ070248@svn.freebsd.org>
From: Xin LI 
Date: Tue, 20 Apr 2010 22:57:06 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206952 - stable/8/lib/libz
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 20 Apr 2010 22:57:06 -0000

Author: delphij
Date: Tue Apr 20 22:57:05 2010
New Revision: 206952
URL: http://svn.freebsd.org/changeset/base/206952

Log:
  MFC assembler version of match functions for amd64 and i386(*).
  
  This gives approximately 15% improvement on compression case.
  
  (*) i386 assembler version is enabled ONLY when MACHINE_CPU have
  'i686' which is not default on FreeBSD/i386.  One can specify
  for instance CPUTYPE=pentium4 in /etc/make.conf to get this
  feature.

Added:
     - copied from r206950, user/delphij/libz-8/contrib/
Directory Properties:
  stable/8/lib/libz/contrib/   (props changed)
Modified:
  stable/8/lib/libz/Makefile
Directory Properties:
  stable/8/lib/libz/   (props changed)

Modified: stable/8/lib/libz/Makefile
==============================================================================
--- stable/8/lib/libz/Makefile	Tue Apr 20 22:55:07 2010	(r206951)
+++ stable/8/lib/libz/Makefile	Tue Apr 20 22:57:05 2010	(r206952)
@@ -19,6 +19,18 @@ SRCS = adler32.c compress.c crc32.c gzio
        zutil.c inflate.c inftrees.c inffast.c zopen.c infback.c
 INCS=		zconf.h zlib.h
 
+.if ${MACHINE_ARCH} == "i386" && ${MACHINE_CPU:M*i686*}
+.PATH:		${.CURDIR}/contrib/asm686
+SRCS+=		match.S
+CFLAGS+=	-DASMV -DNO_UNDERLINE
+.endif
+
+.if ${MACHINE_ARCH} == "amd64"
+.PATH:		${.CURDIR}/contrib/gcc_gvmat64
+SRCS+=		gvmat64.S
+CFLAGS+=	-DASMV -DNO_UNDERLINE
+.endif
+
 minigzip:	all minigzip.o
 	$(CC) -o minigzip minigzip.o -L. -lz
 

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Apr 20 23:59:03 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 068051065670;
	Tue, 20 Apr 2010 23:59:03 +0000 (UTC)
	(envelope-from weongyo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E8F778FC08;
	Tue, 20 Apr 2010 23:59:02 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3KNx2eV084130;
	Tue, 20 Apr 2010 23:59:02 GMT (envelope-from weongyo@svn.freebsd.org)
Received: (from weongyo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3KNx288084128;
	Tue, 20 Apr 2010 23:59:02 GMT (envelope-from weongyo@svn.freebsd.org)
Message-Id: <201004202359.o3KNx288084128@svn.freebsd.org>
From: Weongyo Jeong 
Date: Tue, 20 Apr 2010 23:59:02 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206961 - stable/8/share/man/man4
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 20 Apr 2010 23:59:03 -0000

Author: weongyo
Date: Tue Apr 20 23:59:02 2010
New Revision: 206961
URL: http://svn.freebsd.org/changeset/base/206961

Log:
  MFC  r204343:
    Updates what firmware module should be used for LP (low power) PHY
    users and bumps date.

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

Modified: stable/8/share/man/man4/bwn.4
==============================================================================
--- stable/8/share/man/man4/bwn.4	Tue Apr 20 23:45:48 2010	(r206960)
+++ stable/8/share/man/man4/bwn.4	Tue Apr 20 23:59:02 2010	(r206961)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd February 15, 2010
+.Dd February 25, 2010
 .Dt BWN 4
 .Os
 .Sh NAME
@@ -69,6 +69,8 @@ The
 port needs to be installed before
 .Xr ifconfig 8
 will work.
+Most cases you need to use bwn_v4_ucode module but if you are a
+LP (low power) PHY user please uses bwn_v4_lp_ucode module.
 .Sh HARDWARE
 The
 .Nm

From owner-svn-src-stable-8@FreeBSD.ORG  Wed Apr 21 00:01:39 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 06838106564A;
	Wed, 21 Apr 2010 00:01:39 +0000 (UTC)
	(envelope-from weongyo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E8BAE8FC16;
	Wed, 21 Apr 2010 00:01:38 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3L01c74084776;
	Wed, 21 Apr 2010 00:01:38 GMT (envelope-from weongyo@svn.freebsd.org)
Received: (from weongyo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3L01cl9084774;
	Wed, 21 Apr 2010 00:01:38 GMT (envelope-from weongyo@svn.freebsd.org)
Message-Id: <201004210001.o3L01cl9084774@svn.freebsd.org>
From: Weongyo Jeong 
Date: Wed, 21 Apr 2010 00:01:38 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206962 - in stable/8/sys/dev: bwn siba
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Wed, 21 Apr 2010 00:01:39 -0000

Author: weongyo
Date: Wed Apr 21 00:01:38 2010
New Revision: 206962
URL: http://svn.freebsd.org/changeset/base/206962

Log:
  MFC  r204385:
    don't need to check BWN_RX_PHYST0_SHORTPRMBL flag because it's already
    handled in later.
  
    Reported from: imp, nwhitehorn

Modified:
  stable/8/sys/dev/bwn/if_bwn.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/dev/uath/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/siba/siba_cc.c   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/dev/bwn/if_bwn.c
==============================================================================
--- stable/8/sys/dev/bwn/if_bwn.c	Tue Apr 20 23:59:02 2010	(r206961)
+++ stable/8/sys/dev/bwn/if_bwn.c	Wed Apr 21 00:01:38 2010	(r206962)
@@ -9395,8 +9395,6 @@ bwn_rxeof(struct bwn_mac *mac, struct mb
 		device_printf(sc->sc_dev, "TODO RX: RX_FLAG_FAILED_FCS_CRC\n");
 	if (phystat0 & (BWN_RX_PHYST0_PLCPHCF | BWN_RX_PHYST0_PLCPFV))
 		device_printf(sc->sc_dev, "TODO RX: RX_FLAG_FAILED_PLCP_CRC\n");
-	if (phystat0 & BWN_RX_PHYST0_SHORTPRMBL)
-		device_printf(sc->sc_dev, "TODO RX: RX_FLAG_SHORTPRE\n");
 	if (macstat & BWN_RX_MAC_DECERR)
 		goto drop;
 

From owner-svn-src-stable-8@FreeBSD.ORG  Wed Apr 21 00:02:48 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C5E8E1065670;
	Wed, 21 Apr 2010 00:02:48 +0000 (UTC)
	(envelope-from weongyo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id B49438FC34;
	Wed, 21 Apr 2010 00:02:48 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3L02mjA085082;
	Wed, 21 Apr 2010 00:02:48 GMT (envelope-from weongyo@svn.freebsd.org)
Received: (from weongyo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3L02mbX085080;
	Wed, 21 Apr 2010 00:02:48 GMT (envelope-from weongyo@svn.freebsd.org)
Message-Id: <201004210002.o3L02mbX085080@svn.freebsd.org>
From: Weongyo Jeong 
Date: Wed, 21 Apr 2010 00:02:48 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206963 - in stable/8/sys/dev: bwn siba
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Wed, 21 Apr 2010 00:02:48 -0000

Author: weongyo
Date: Wed Apr 21 00:02:48 2010
New Revision: 206963
URL: http://svn.freebsd.org/changeset/base/206963

Log:
  MFC r204436:
    supports the adhoc demo mode that it's tested on modified aircrack-ng
    suite and worked.
  
    Submitted by:	Paul B Mahol 

Modified:
  stable/8/sys/dev/bwn/if_bwn.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/dev/uath/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/siba/siba_cc.c   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/dev/bwn/if_bwn.c
==============================================================================
--- stable/8/sys/dev/bwn/if_bwn.c	Wed Apr 21 00:01:38 2010	(r206962)
+++ stable/8/sys/dev/bwn/if_bwn.c	Wed Apr 21 00:02:48 2010	(r206963)
@@ -1076,6 +1076,7 @@ bwn_attach_post(struct bwn_softc *sc)
 	ic->ic_caps =
 		  IEEE80211_C_STA		/* station mode supported */
 		| IEEE80211_C_MONITOR		/* monitor mode */
+		| IEEE80211_C_AHDEMO		/* adhoc demo mode */
 		| IEEE80211_C_SHPREAMBLE	/* short preamble supported */
 		| IEEE80211_C_SHSLOT		/* short slot time supported */
 		| IEEE80211_C_WME		/* WME/WMM supported */
@@ -8447,7 +8448,8 @@ bwn_newstate(struct ieee80211vap *vap, e
 		}
 	}
 
-	if (vap->iv_opmode == IEEE80211_M_MONITOR) {
+	if (vap->iv_opmode == IEEE80211_M_MONITOR ||
+	    vap->iv_opmode == IEEE80211_M_AHDEMO) {
 		/* XXX nothing to do? */
 	} else if (nstate == IEEE80211_S_RUN) {
 		memcpy(sc->sc_bssid, vap->iv_bss->ni_bssid, IEEE80211_ADDR_LEN);

From owner-svn-src-stable-8@FreeBSD.ORG  Wed Apr 21 00:05:23 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3117F106564A;
	Wed, 21 Apr 2010 00:05:23 +0000 (UTC)
	(envelope-from weongyo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1F9E38FC08;
	Wed, 21 Apr 2010 00:05:23 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3L05NOF085692;
	Wed, 21 Apr 2010 00:05:23 GMT (envelope-from weongyo@svn.freebsd.org)
Received: (from weongyo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3L05MjW085690;
	Wed, 21 Apr 2010 00:05:22 GMT (envelope-from weongyo@svn.freebsd.org)
Message-Id: <201004210005.o3L05MjW085690@svn.freebsd.org>
From: Weongyo Jeong 
Date: Wed, 21 Apr 2010 00:05:22 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206964 - in stable/8/sys/dev: bwn siba
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Wed, 21 Apr 2010 00:05:23 -0000

Author: weongyo
Date: Wed Apr 21 00:05:22 2010
New Revision: 206964
URL: http://svn.freebsd.org/changeset/base/206964

Log:
  MFC r204437:
    fixes a bug to load firmware images for LP PHY. For LP PHY always,
    `lp_' string is contained in its full image names.

Modified:
  stable/8/sys/dev/bwn/if_bwn.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/dev/uath/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/siba/siba_cc.c   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/dev/bwn/if_bwn.c
==============================================================================
--- stable/8/sys/dev/bwn/if_bwn.c	Wed Apr 21 00:02:48 2010	(r206963)
+++ stable/8/sys/dev/bwn/if_bwn.c	Wed Apr 21 00:05:22 2010	(r206964)
@@ -7789,8 +7789,9 @@ bwn_fw_get(struct bwn_mac *mac, enum bwn
 		bwn_do_release_fw(bfw);
 	}
 
-	snprintf(namebuf, sizeof(namebuf), "bwn%s_v4_%s",
-	    (type == BWN_FWTYPE_OPENSOURCE) ? "-open" : "", name);
+	snprintf(namebuf, sizeof(namebuf), "bwn%s_v4_%s%s",
+	    (type == BWN_FWTYPE_OPENSOURCE) ? "-open" : "",
+	    (mac->mac_phy.type == BWN_PHYTYPE_LP) ? "lp_" : "", name);
 	/* XXX Sleeping on "fwload" with the non-sleepable locks held */
 	fw = firmware_get(namebuf);
 	if (fw == NULL) {

From owner-svn-src-stable-8@FreeBSD.ORG  Wed Apr 21 00:06:40 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 316F8106564A;
	Wed, 21 Apr 2010 00:06:40 +0000 (UTC)
	(envelope-from weongyo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1FF338FC14;
	Wed, 21 Apr 2010 00:06:40 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3L06erZ086031;
	Wed, 21 Apr 2010 00:06:40 GMT (envelope-from weongyo@svn.freebsd.org)
Received: (from weongyo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3L06dig086029;
	Wed, 21 Apr 2010 00:06:40 GMT (envelope-from weongyo@svn.freebsd.org)
Message-Id: <201004210006.o3L06dig086029@svn.freebsd.org>
From: Weongyo Jeong 
Date: Wed, 21 Apr 2010 00:06:39 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206965 - in stable/8/sys/dev: bwn siba
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Wed, 21 Apr 2010 00:06:40 -0000

Author: weongyo
Date: Wed Apr 21 00:06:39 2010
New Revision: 206965
URL: http://svn.freebsd.org/changeset/base/206965

Log:
  MFC r204542:
    calculates the integer square root if a positive integer X is larger
    than 256 instead of using sqrt_table.
  
    Reported by: Joe Marcus Clarke 

Modified:
  stable/8/sys/dev/bwn/if_bwn.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/dev/uath/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/siba/siba_cc.c   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/dev/bwn/if_bwn.c
==============================================================================
--- stable/8/sys/dev/bwn/if_bwn.c	Wed Apr 21 00:05:22 2010	(r206964)
+++ stable/8/sys/dev/bwn/if_bwn.c	Wed Apr 21 00:06:39 2010	(r206965)
@@ -12846,7 +12846,6 @@ bwn_phy_lp_clear_deaf(struct bwn_mac *ma
 static unsigned int
 bwn_sqrt(struct bwn_mac *mac, unsigned int x)
 {
-	struct bwn_softc *sc = mac->mac_sc;
 	/* Table holding (10 * sqrt(x)) for x between 1 and 256. */
 	static uint8_t sqrt_table[256] = {
 		10, 14, 17, 20, 22, 24, 26, 28,
@@ -12886,9 +12885,11 @@ bwn_sqrt(struct bwn_mac *mac, unsigned i
 	if (x == 0)
 		return (0);
 	if (x >= 256) {
-		device_printf(sc->sc_dev,
-		    "out of bounds of the square-root table (%d)\n", x);
-		return (16);
+		unsigned int tmp;
+
+		for (tmp = 0; x >= (2 * tmp) + 1; x -= (2 * tmp++) + 1)
+			/* do nothing */ ;
+		return (tmp);
 	}
 	return (sqrt_table[x - 1] / 10);
 }

From owner-svn-src-stable-8@FreeBSD.ORG  Wed Apr 21 00:13:44 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C429D106568D;
	Wed, 21 Apr 2010 00:13:44 +0000 (UTC)
	(envelope-from weongyo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id B23678FC26;
	Wed, 21 Apr 2010 00:13:44 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3L0DiiM087715;
	Wed, 21 Apr 2010 00:13:44 GMT (envelope-from weongyo@svn.freebsd.org)
Received: (from weongyo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3L0DiE0087711;
	Wed, 21 Apr 2010 00:13:44 GMT (envelope-from weongyo@svn.freebsd.org)
Message-Id: <201004210013.o3L0DiE0087711@svn.freebsd.org>
From: Weongyo Jeong 
Date: Wed, 21 Apr 2010 00:13:44 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206967 - in stable/8/sys/dev: bwn siba
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Wed, 21 Apr 2010 00:13:44 -0000

Author: weongyo
Date: Wed Apr 21 00:13:44 2010
New Revision: 206967
URL: http://svn.freebsd.org/changeset/base/206967

Log:
  MFC r204657:
    fixes an attached-at-boot issue that bwn(4) using device_identify
    interface didn't be attached automatically at boot time so changes a
    approach to attach children based on leveraging some newbus niceties.
  
    Submitted by: nwhitehorn

Modified:
  stable/8/sys/dev/bwn/if_bwn.c
  stable/8/sys/dev/siba/siba_bwn.c
  stable/8/sys/dev/siba/siba_core.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/dev/uath/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/siba/siba_cc.c   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/dev/bwn/if_bwn.c
==============================================================================
--- stable/8/sys/dev/bwn/if_bwn.c	Wed Apr 21 00:10:30 2010	(r206966)
+++ stable/8/sys/dev/bwn/if_bwn.c	Wed Apr 21 00:13:44 2010	(r206967)
@@ -14312,16 +14312,8 @@ bwn_sysctl_node(struct bwn_softc *sc)
 #endif
 }
 
-static void
-bwn_identify(driver_t *driver, device_t parent)
-{
-
-	BUS_ADD_CHILD(parent, 0, "bwn", -1);
-}
-
 static device_method_t bwn_methods[] = {
 	/* Device interface */
-	DEVMETHOD(device_identify,	bwn_identify),
 	DEVMETHOD(device_probe,		bwn_probe),
 	DEVMETHOD(device_attach,	bwn_attach),
 	DEVMETHOD(device_detach,	bwn_detach),

Modified: stable/8/sys/dev/siba/siba_bwn.c
==============================================================================
--- stable/8/sys/dev/siba/siba_bwn.c	Wed Apr 21 00:10:30 2010	(r206966)
+++ stable/8/sys/dev/siba/siba_bwn.c	Wed Apr 21 00:13:44 2010	(r206967)
@@ -97,8 +97,6 @@ static const struct siba_dev {
 	{ PCI_VENDOR_BROADCOM, 0x432b, "Unknown" }
 };
 
-device_t	siba_add_child(device_t, struct siba_softc *, int, const char *,
-		    int);
 int		siba_core_attach(struct siba_softc *);
 int		siba_core_detach(struct siba_softc *);
 int		siba_core_suspend(struct siba_softc *);
@@ -238,15 +236,6 @@ siba_bwn_resume(device_t dev)
 	return (0);
 }
 
-static device_t
-siba_bwn_add_child(device_t dev, int order, const char *name, int unit)
-{
-	struct siba_bwn_softc *ssc = device_get_softc(dev);
-	struct siba_softc *siba = &ssc->ssc_siba;
-
-	return (siba_add_child(dev, siba, order, name, unit));
-}
-
 /* proxying to the parent */
 static struct resource *
 siba_bwn_alloc_resource(device_t dev, device_t child, int type, int *rid,
@@ -342,7 +331,6 @@ static device_method_t siba_bwn_methods[
 	DEVMETHOD(device_resume,	siba_bwn_resume),
 
 	/* Bus interface */
-	DEVMETHOD(bus_add_child,	siba_bwn_add_child),
 	DEVMETHOD(bus_alloc_resource,   siba_bwn_alloc_resource),
 	DEVMETHOD(bus_release_resource, siba_bwn_release_resource),
 	DEVMETHOD(bus_setup_intr,       siba_bwn_setup_intr),

Modified: stable/8/sys/dev/siba/siba_core.c
==============================================================================
--- stable/8/sys/dev/siba/siba_core.c	Wed Apr 21 00:10:30 2010	(r206966)
+++ stable/8/sys/dev/siba/siba_core.c	Wed Apr 21 00:13:44 2010	(r206967)
@@ -133,8 +133,6 @@ static void	siba_pci_write_multi_4(struc
 		    size_t, uint16_t);
 static const char *siba_core_name(uint16_t);
 static void	siba_pcicore_init(struct siba_pci *);
-device_t	siba_add_child(device_t, struct siba_softc *, int, const char *,
-		    int);
 int		siba_core_attach(struct siba_softc *);
 int		siba_core_detach(struct siba_softc *);
 int		siba_core_suspend(struct siba_softc *);
@@ -206,8 +204,10 @@ siba_core_attach(struct siba_softc *siba
 		return (error);
 	}
 
+	siba_pcicore_init(&siba->siba_pci);
 	siba_powerdown(siba);
-	return (0);
+	
+	return (bus_generic_attach(siba->siba_dev));
 }
 
 int
@@ -277,6 +277,7 @@ siba_scan(struct siba_softc *siba)
 {
 	struct siba_dev_softc *sd;
 	uint32_t idhi, tmp;
+	device_t child;
 	int base, dev_i = 0, error, i, is_pcie, n_80211 = 0, n_cc = 0,
 	    n_pci = 0;
 
@@ -387,6 +388,14 @@ siba_scan(struct siba_softc *siba)
 			break;
 		}
 		dev_i++;
+
+		child = device_add_child(siba->siba_dev, NULL, -1);
+		if (child == NULL) {
+			device_printf(siba->siba_dev, "child attach failed\n");
+			continue;
+		}
+
+		device_set_ivars(child, sd);
 	}
 	siba->siba_ndevs = dev_i;
 }
@@ -1964,52 +1973,6 @@ siba_barrier(struct siba_dev_softc *sd, 
 	SIBA_BARRIER(siba, flags);
 }
 
-/*
- * Attach it as child.
- */
-device_t
-siba_add_child(device_t dev, struct siba_softc *siba, int order,
-    const char *name, int unit)
-{
-	struct siba_dev_softc *sd;
-	device_t child;
-	int idx = 0, i;
-
-	child = device_add_child(dev, name, unit);
-	if (child == NULL)
-		return (NULL);
-
-	siba_powerup(siba, 0);
-	siba_pcicore_init(&siba->siba_pci);
-	siba_powerdown(siba);
-
-	for (i = 0; i < siba->siba_ndevs; i++) {
-		sd = &(siba->siba_devs[i]);
-
-		if (sd->sd_id.sd_device != SIBA_DEVID_80211) {
-			DPRINTF(siba, SIBA_DEBUG_CORE,
-			    "skip to register coreid %#x (%s)\n",
-			    sd->sd_id.sd_device,
-			    siba_core_name(sd->sd_id.sd_device));
-			continue;
-		}
-
-		DPRINTF(siba, SIBA_DEBUG_CORE,
-		    "siba: attaching coreid %#x (%s) idx %d\n",
-		    sd->sd_id.sd_device,
-		    siba_core_name(sd->sd_id.sd_device), idx);
-
-		KASSERT(sd->sd_id.sd_device == SIBA_DEVID_80211,
-		    ("%s:%d: SIBA_DEVID_80211 is only supportted currently.",
-			__func__, __LINE__));
-
-		device_set_ivars(child, sd);
-		device_probe_and_attach(child);
-		idx++;
-	}
-	return (child);
-}
-
 static void
 siba_cc_suspend(struct siba_cc *scc)
 {

From owner-svn-src-stable-8@FreeBSD.ORG  Wed Apr 21 00:15:58 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AF13A106564A;
	Wed, 21 Apr 2010 00:15:58 +0000 (UTC)
	(envelope-from weongyo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 9D2BB8FC2C;
	Wed, 21 Apr 2010 00:15:58 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3L0FwtB088252;
	Wed, 21 Apr 2010 00:15:58 GMT (envelope-from weongyo@svn.freebsd.org)
Received: (from weongyo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3L0Fw0p088250;
	Wed, 21 Apr 2010 00:15:58 GMT (envelope-from weongyo@svn.freebsd.org)
Message-Id: <201004210015.o3L0Fw0p088250@svn.freebsd.org>
From: Weongyo Jeong 
Date: Wed, 21 Apr 2010 00:15:58 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206968 - in stable/8/sys: conf dev/siba
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Wed, 21 Apr 2010 00:15:58 -0000

Author: weongyo
Date: Wed Apr 21 00:15:58 2010
New Revision: 206968
URL: http://svn.freebsd.org/changeset/base/206968

Log:
  MFC r204662:
    Hook up the bwn driver.
  
    Pointed by: nwhitehorn

Modified:
  stable/8/sys/conf/files
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/dev/uath/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/siba/siba_cc.c   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/conf/files
==============================================================================
--- stable/8/sys/conf/files	Wed Apr 21 00:13:44 2010	(r206967)
+++ stable/8/sys/conf/files	Wed Apr 21 00:15:58 2010	(r206968)
@@ -771,6 +771,7 @@ dev/bwi/bwiphy.c		optional bwi
 dev/bwi/bwirf.c			optional bwi
 dev/bwi/if_bwi.c		optional bwi
 dev/bwi/if_bwi_pci.c		optional bwi pci
+dev/bwn/if_bwn.c		optional bwn siba_bwn
 dev/cardbus/cardbus.c		optional cardbus
 dev/cardbus/cardbus_cis.c	optional cardbus
 dev/cardbus/cardbus_device.c	optional cardbus
@@ -1481,6 +1482,8 @@ dev/si/si3_t225.c		optional si
 dev/si/si_eisa.c		optional si eisa
 dev/si/si_isa.c			optional si isa
 dev/si/si_pci.c			optional si pci
+dev/siba/siba_bwn.c		optional siba_bwn pci
+dev/siba/siba_core.c		optional siba_bwn pci
 dev/siis/siis.c			optional siis pci
 dev/sis/if_sis.c		optional sis pci
 dev/sk/if_sk.c			optional sk pci inet

From owner-svn-src-stable-8@FreeBSD.ORG  Wed Apr 21 00:22:17 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2B3F31065675;
	Wed, 21 Apr 2010 00:22:17 +0000 (UTC)
	(envelope-from weongyo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 186A68FC12;
	Wed, 21 Apr 2010 00:22:17 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3L0MHrh089766;
	Wed, 21 Apr 2010 00:22:17 GMT (envelope-from weongyo@svn.freebsd.org)
Received: (from weongyo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3L0MHNg089763;
	Wed, 21 Apr 2010 00:22:17 GMT (envelope-from weongyo@svn.freebsd.org)
Message-Id: <201004210022.o3L0MHNg089763@svn.freebsd.org>
From: Weongyo Jeong 
Date: Wed, 21 Apr 2010 00:22:17 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206969 - in stable/8/sys/dev: bwn siba
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Wed, 21 Apr 2010 00:22:17 -0000

Author: weongyo
Date: Wed Apr 21 00:22:16 2010
New Revision: 206969
URL: http://svn.freebsd.org/changeset/base/206969

Log:
  MFC r205003:
    Revert r204992 and just wrap it all in ifdef INVARIANTS to fix the debug
    and non-debug cases
  
  MFC r204992:
    fixes a compile error if INVARIANTS is disabled.
  
    Pointy hat to: me
    Submitted by: Michael Butler 
  
  MFC r204983:
    Fix build breakage introduced in r204922.
  
  MFC r204923:
    uses KOBJMETHOD_END macro to indicate the end of method table.
  
    Submitted by: yongari
  
  MFC r204922:
    o uses bus accessor macros to read values from ivar so no more values
      are referenced directly from ivar pointer.  It's to do like what other
      buses do. [1]
    o changes exported prototypes.  It doesn't use struct siba_* structures
      anymore that instead of it it uses only device_t.
    o removes duplicate code and debug messages.
    o style(9)
  
    Pointed out by:        imp [1]

Modified:
  stable/8/sys/dev/bwn/if_bwn.c
  stable/8/sys/dev/bwn/if_bwnvar.h
  stable/8/sys/dev/siba/siba.c
  stable/8/sys/dev/siba/siba_bwn.c
  stable/8/sys/dev/siba/siba_cc.c   (contents, props changed)
  stable/8/sys/dev/siba/siba_core.c
  stable/8/sys/dev/siba/siba_pcib.c
  stable/8/sys/dev/siba/sibavar.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/dev/uath/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/dev/bwn/if_bwn.c
==============================================================================
--- stable/8/sys/dev/bwn/if_bwn.c	Wed Apr 21 00:15:58 2010	(r206968)
+++ stable/8/sys/dev/bwn/if_bwn.c	Wed Apr 21 00:22:16 2010	(r206969)
@@ -134,7 +134,7 @@ SYSCTL_INT(_hw_bwn, OID_AUTO, wme, CTLFL
 
 static int	bwn_attach_pre(struct bwn_softc *);
 static int	bwn_attach_post(struct bwn_softc *);
-static void	bwn_sprom_bugfixes(struct siba_softc *);
+static void	bwn_sprom_bugfixes(device_t);
 static void	bwn_init(void *);
 static int	bwn_init_locked(struct bwn_softc *);
 static int	bwn_ioctl(struct ifnet *, u_long, caddr_t);
@@ -205,7 +205,6 @@ static void	bwn_stop_locked(struct bwn_s
 static int	bwn_core_init(struct bwn_mac *);
 static void	bwn_core_start(struct bwn_mac *);
 static void	bwn_core_exit(struct bwn_mac *);
-static void	bwn_fix_imcfglobug(struct bwn_mac *);
 static void	bwn_bt_disable(struct bwn_mac *);
 static int	bwn_chip_init(struct bwn_mac *);
 static uint64_t	bwn_hf_read(struct bwn_mac *);
@@ -225,7 +224,6 @@ static int	bwn_fw_loadinitvals(struct bw
 static int	bwn_phy_init(struct bwn_mac *);
 static void	bwn_set_txantenna(struct bwn_mac *, int);
 static void	bwn_set_opmode(struct bwn_mac *);
-static void	bwn_gpio_cleanup(struct bwn_mac *);
 static void	bwn_rate_write(struct bwn_mac *, uint16_t, int);
 static uint8_t	bwn_plcp_getcck(const uint8_t);
 static uint8_t	bwn_plcp_getofdm(const uint8_t);
@@ -910,13 +908,12 @@ static const struct siba_devid bwn_devs[
 static int
 bwn_probe(device_t dev)
 {
-	struct siba_dev_softc *sd = device_get_ivars(dev);
 	int i;
 
 	for (i = 0; i < sizeof(bwn_devs) / sizeof(bwn_devs[0]); i++) {
-		if (sd->sd_id.sd_vendor == bwn_devs[i].sd_vendor &&
-		    sd->sd_id.sd_device == bwn_devs[i].sd_device &&
-		    sd->sd_id.sd_rev == bwn_devs[i].sd_rev)
+		if (siba_get_vendor(dev) == bwn_devs[i].sd_vendor &&
+		    siba_get_device(dev) == bwn_devs[i].sd_device &&
+		    siba_get_revid(dev) == bwn_devs[i].sd_rev)
 			return (BUS_PROBE_DEFAULT);
 	}
 
@@ -928,12 +925,9 @@ bwn_attach(device_t dev)
 {
 	struct bwn_mac *mac;
 	struct bwn_softc *sc = device_get_softc(dev);
-	struct siba_dev_softc *sd = device_get_ivars(dev);
-	struct siba_softc *siba = sd->sd_bus;
 	int error, i, msic, reg;
 
 	sc->sc_dev = dev;
-	sc->sc_sd = sd;
 #ifdef BWN_DEBUG
 	sc->sc_debug = bwn_debug;
 #endif
@@ -942,14 +936,14 @@ bwn_attach(device_t dev)
 		error = bwn_attach_pre(sc);
 		if (error != 0)
 			return (error);
-		bwn_sprom_bugfixes(sd->sd_bus);
+		bwn_sprom_bugfixes(dev);
 		sc->sc_flags |= BWN_FLAG_ATTACHED;
 	}
 
 	if (!TAILQ_EMPTY(&sc->sc_maclist)) {
-		if (siba->siba_pci_did != 0x4313 &&
-		    siba->siba_pci_did != 0x431a &&
-		    siba->siba_pci_did != 0x4321) {
+		if (siba_get_pci_device(dev) != 0x4313 &&
+		    siba_get_pci_device(dev) != 0x431a &&
+		    siba_get_pci_device(dev) != 0x4321) {
 			device_printf(sc->sc_dev,
 			    "skip 802.11 cores\n");
 			return (ENODEV);
@@ -961,7 +955,6 @@ bwn_attach(device_t dev)
 	if (mac == NULL)
 		return (ENOMEM);
 	mac->mac_sc = sc;
-	mac->mac_sd = sd;
 	mac->mac_status = BWN_MAC_STATUS_UNINIT;
 	if (bwn_bfp != 0)
 		mac->mac_flags |= BWN_MAC_FLAG_BADFRAME_PREEMP;
@@ -977,7 +970,7 @@ bwn_attach(device_t dev)
 
 	device_printf(sc->sc_dev, "WLAN (chipid %#x rev %u) "
 	    "PHY (analog %d type %d rev %d) RADIO (manuf %#x ver %#x rev %d)\n",
-	    sd->sd_bus->siba_chipid, sd->sd_id.sd_rev,
+	    siba_get_chipid(sc->sc_dev), siba_get_revid(sc->sc_dev),
 	    mac->mac_phy.analog, mac->mac_phy.type, mac->mac_phy.rev,
 	    mac->mac_phy.rf_manuf, mac->mac_phy.rf_ver,
 	    mac->mac_phy.rf_rev);
@@ -1065,8 +1058,6 @@ bwn_attach_post(struct bwn_softc *sc)
 {
 	struct ieee80211com *ic;
 	struct ifnet *ifp = sc->sc_ifp;
-	struct siba_dev_softc *sd = sc->sc_sd;
-	struct siba_sprom *sprom = &sd->sd_bus->siba_sprom;
 
 	ic = ifp->if_l2com;
 	ic->ic_ifp = ifp;
@@ -1087,8 +1078,9 @@ bwn_attach_post(struct bwn_softc *sc)
 
 	/* call MI attach routine. */
 	ieee80211_ifattach(ic,
-	    bwn_is_valid_ether_addr(sprom->mac_80211a) ? sprom->mac_80211a :
-	    sprom->mac_80211bg);
+	    bwn_is_valid_ether_addr(siba_sprom_get_mac_80211a(sc->sc_dev)) ?
+	    siba_sprom_get_mac_80211a(sc->sc_dev) :
+	    siba_sprom_get_mac_80211bg(sc->sc_dev));
 
 	ic->ic_headroom = sizeof(struct bwn_txhdr);
 
@@ -1219,21 +1211,24 @@ fail:	BWN_LOCK_DESTROY(sc);
 }
 
 static void
-bwn_sprom_bugfixes(struct siba_softc *siba)
+bwn_sprom_bugfixes(device_t dev)
 {
 #define	BWN_ISDEV(_vendor, _device, _subvendor, _subdevice)		\
-	((siba->siba_pci_vid == PCI_VENDOR_##_vendor) &&		\
-	 (siba->siba_pci_did == _device) &&				\
-	 (siba->siba_pci_subvid == PCI_VENDOR_##_subvendor) &&		\
-	 (siba->siba_pci_subdid == _subdevice))
-
-	if (siba->siba_board_vendor == PCI_VENDOR_APPLE &&
-	    siba->siba_board_type == 0x4e && siba->siba_board_rev > 0x40)
-		siba->siba_sprom.bf_lo |= BWN_BFL_PACTRL;
-	if (siba->siba_board_vendor == SIBA_BOARDVENDOR_DELL &&
-	    siba->siba_chipid == 0x4301 && siba->siba_board_rev == 0x74)
-		siba->siba_sprom.bf_lo |= BWN_BFL_BTCOEXIST;
-	if (siba->siba_type == SIBA_TYPE_PCI) {
+	((siba_get_pci_vendor(dev) == PCI_VENDOR_##_vendor) &&		\
+	 (siba_get_pci_device(dev) == _device) &&			\
+	 (siba_get_pci_subvendor(dev) == PCI_VENDOR_##_subvendor) &&	\
+	 (siba_get_pci_subdevice(dev) == _subdevice))
+
+	if (siba_get_pci_subvendor(dev) == PCI_VENDOR_APPLE &&
+	    siba_get_pci_subdevice(dev) == 0x4e &&
+	    siba_get_pci_revid(dev) > 0x40)
+		siba_sprom_set_bf_lo(dev,
+		    siba_sprom_get_bf_lo(dev) | BWN_BFL_PACTRL);
+	if (siba_get_pci_subvendor(dev) == SIBA_BOARDVENDOR_DELL &&
+	    siba_get_chipid(dev) == 0x4301 && siba_get_pci_revid(dev) == 0x74)
+		siba_sprom_set_bf_lo(dev,
+		    siba_sprom_get_bf_lo(dev) | BWN_BFL_BTCOEXIST);
+	if (siba_get_type(dev) == SIBA_TYPE_PCI) {
 		if (BWN_ISDEV(BROADCOM, 0x4318, ASUSTEK, 0x100f) ||
 		    BWN_ISDEV(BROADCOM, 0x4320, DELL, 0x0003) ||
 		    BWN_ISDEV(BROADCOM, 0x4320, HP, 0x12f8) ||
@@ -1241,7 +1236,8 @@ bwn_sprom_bugfixes(struct siba_softc *si
 		    BWN_ISDEV(BROADCOM, 0x4320, LINKSYS, 0x0014) ||
 		    BWN_ISDEV(BROADCOM, 0x4320, LINKSYS, 0x0015) ||
 		    BWN_ISDEV(BROADCOM, 0x4320, MOTOROLA, 0x7010))
-			siba->siba_sprom.bf_lo &= ~BWN_BFL_BTCOEXIST;
+			siba_sprom_set_bf_lo(dev,
+			    siba_sprom_get_bf_lo(dev) & ~BWN_BFL_BTCOEXIST);
 	}
 #undef	BWN_ISDEV
 }
@@ -1434,7 +1430,7 @@ bwn_pio_tx_start(struct bwn_mac *mac, st
 	tq->tq_used += roundup(m->m_pkthdr.len + BWN_HDRSIZE(mac), 4);
 	tq->tq_free--;
 
-	if (mac->mac_sd->sd_id.sd_rev >= 8) {
+	if (siba_get_revid(sc->sc_dev) >= 8) {
 		/*
 		 * XXX please removes m_defrag(9)
 		 */
@@ -1606,17 +1602,15 @@ static int
 bwn_attach_core(struct bwn_mac *mac)
 {
 	struct bwn_softc *sc = mac->mac_sc;
-	struct siba_dev_softc *sd = mac->mac_sd;
-	struct siba_softc *siba = sd->sd_bus;
 	int error, have_bg = 0, have_a = 0;
 	uint32_t high;
 
-	KASSERT(sd->sd_id.sd_rev >= 5,
-	    ("unsupported revision %d", sd->sd_id.sd_rev));
+	KASSERT(siba_get_revid(sc->sc_dev) >= 5,
+	    ("unsupported revision %d", siba_get_revid(sc->sc_dev)));
 
-	siba_powerup(siba, 0);
+	siba_powerup(sc->sc_dev, 0);
 
-	high = siba_read_4(sd, SIBA_TGSHIGH);
+	high = siba_read_4(sc->sc_dev, SIBA_TGSHIGH);
 	bwn_reset_core(mac,
 	    (high & BWN_TGSHIGH_HAVE_2GHZ) ? BWN_TGSLOW_SUPPORT_G : 0);
 	error = bwn_phy_getinfo(mac, high);
@@ -1625,8 +1619,9 @@ bwn_attach_core(struct bwn_mac *mac)
 
 	have_a = (high & BWN_TGSHIGH_HAVE_5GHZ) ? 1 : 0;
 	have_bg = (high & BWN_TGSHIGH_HAVE_2GHZ) ? 1 : 0;
-	if (siba->siba_pci_did != 0x4312 && siba->siba_pci_did != 0x4319 &&
-	    siba->siba_pci_did != 0x4324) {
+	if (siba_get_pci_device(sc->sc_dev) != 0x4312 &&
+	    siba_get_pci_device(sc->sc_dev) != 0x4319 &&
+	    siba_get_pci_device(sc->sc_dev) != 0x4324) {
 		have_a = have_bg = 0;
 		if (mac->mac_phy.type == BWN_PHYTYPE_A)
 			have_a = 1;
@@ -1719,30 +1714,30 @@ bwn_attach_core(struct bwn_mac *mac)
 
 	mac->mac_phy.switch_analog(mac, 0);
 
-	siba_dev_down(sd, 0);
+	siba_dev_down(sc->sc_dev, 0);
 fail:
-	siba_powerdown(siba);
+	siba_powerdown(sc->sc_dev);
 	return (error);
 }
 
 static void
 bwn_reset_core(struct bwn_mac *mac, uint32_t flags)
 {
-	struct siba_dev_softc *sd = mac->mac_sd;
+	struct bwn_softc *sc = mac->mac_sc;
 	uint32_t low, ctl;
 
 	flags |= (BWN_TGSLOW_PHYCLOCK_ENABLE | BWN_TGSLOW_PHYRESET);
 
-	siba_dev_up(sd, flags);
+	siba_dev_up(sc->sc_dev, flags);
 	DELAY(2000);
 
-	low = (siba_read_4(sd, SIBA_TGSLOW) | SIBA_TGSLOW_FGC) &
+	low = (siba_read_4(sc->sc_dev, SIBA_TGSLOW) | SIBA_TGSLOW_FGC) &
 	    ~BWN_TGSLOW_PHYRESET;
-	siba_write_4(sd, SIBA_TGSLOW, low);
-	siba_read_4(sd, SIBA_TGSLOW);
+	siba_write_4(sc->sc_dev, SIBA_TGSLOW, low);
+	siba_read_4(sc->sc_dev, SIBA_TGSLOW);
 	DELAY(1000);
-	siba_write_4(sd, SIBA_TGSLOW, low & ~SIBA_TGSLOW_FGC);
-	siba_read_4(sd, SIBA_TGSLOW);
+	siba_write_4(sc->sc_dev, SIBA_TGSLOW, low & ~SIBA_TGSLOW_FGC);
+	siba_read_4(sc->sc_dev, SIBA_TGSLOW);
 	DELAY(1000);
 
 	if (mac->mac_phy.switch_analog != NULL)
@@ -1759,8 +1754,6 @@ bwn_phy_getinfo(struct bwn_mac *mac, int
 {
 	struct bwn_phy *phy = &mac->mac_phy;
 	struct bwn_softc *sc = mac->mac_sc;
-	struct siba_dev_softc *sd = mac->mac_sd;
-	struct siba_softc *siba = sd->sd_bus;
 	uint32_t tmp;
 
 	/* PHY */
@@ -1779,10 +1772,10 @@ bwn_phy_getinfo(struct bwn_mac *mac, int
 		goto unsupphy;
 
 	/* RADIO */
-	if (siba->siba_chipid == 0x4317) {
-		if (siba->siba_chiprev == 0)
+	if (siba_get_chipid(sc->sc_dev) == 0x4317) {
+		if (siba_get_chiprev(sc->sc_dev) == 0)
 			tmp = 0x3205017f;
-		else if (siba->siba_chiprev == 1)
+		else if (siba_get_chiprev(sc->sc_dev) == 1)
 			tmp = 0x4205017f;
 		else
 			tmp = 0x5205017f;
@@ -1826,7 +1819,6 @@ bwn_chiptest(struct bwn_mac *mac)
 #define	TESTVAL0	0x55aaaa55
 #define	TESTVAL1	0xaa5555aa
 	struct bwn_softc *sc = mac->mac_sc;
-	struct siba_dev_softc *sd = mac->mac_sd;
 	uint32_t v, backup;
 
 	BWN_LOCK(sc);
@@ -1842,7 +1834,8 @@ bwn_chiptest(struct bwn_mac *mac)
 
 	bwn_shm_write_4(mac, BWN_SHARED, 0, backup);
 
-	if ((sd->sd_id.sd_rev >= 3) && (sd->sd_id.sd_rev <= 10)) {
+	if ((siba_get_revid(sc->sc_dev) >= 3) &&
+	    (siba_get_revid(sc->sc_dev) <= 10)) {
 		BWN_WRITE_2(mac, BWN_TSF_CFP_START, 0xaaaa);
 		BWN_WRITE_4(mac, BWN_TSF_CFP_START, 0xccccbbbb);
 		if (BWN_READ_2(mac, BWN_TSF_CFP_START_LOW) != 0xbbbb)
@@ -2070,15 +2063,17 @@ bwn_phy_g_attach(struct bwn_mac *mac)
 	struct bwn_softc *sc = mac->mac_sc;
 	struct bwn_phy *phy = &mac->mac_phy;
 	struct bwn_phy_g *pg = &phy->phy_g;
-	struct siba_dev_softc *sd = mac->mac_sd;
-	struct siba_sprom *sprom = &sd->sd_bus->siba_sprom;
 	unsigned int i;
-	int16_t pab0 = (int16_t)(sprom->pa0b0), pab1 = (int16_t)(sprom->pa0b1),
-	    pab2 = (int16_t)(sprom->pa0b2);
+	int16_t pab0, pab1, pab2;
 	static int8_t bwn_phy_g_tssi2dbm_table[] = BWN_PHY_G_TSSI2DBM_TABLE;
-	int8_t bg = (int8_t)sprom->tssi_bg;
+	int8_t bg;
+
+	bg = (int8_t)siba_sprom_get_tssi_bg(sc->sc_dev);
+	pab0 = (int16_t)siba_sprom_get_pa0b0(sc->sc_dev);
+	pab1 = (int16_t)siba_sprom_get_pa0b1(sc->sc_dev);
+	pab2 = (int16_t)siba_sprom_get_pa0b2(sc->sc_dev);
 
-	if ((sd->sd_bus->siba_chipid == 0x4301) && (phy->rf_ver != 0x2050))
+	if ((siba_get_chipid(sc->sc_dev) == 0x4301) && (phy->rf_ver != 0x2050))
 		device_printf(sc->sc_dev, "not supported anymore\n");
 
 	pg->pg_flags = 0;
@@ -2175,8 +2170,8 @@ bwn_phy_g_prepare_hw(struct bwn_mac *mac
 {
 	struct bwn_phy *phy = &mac->mac_phy;
 	struct bwn_phy_g *pg = &phy->phy_g;
+	struct bwn_softc *sc = mac->mac_sc;
 	struct bwn_txpwr_loctl *lo = &pg->pg_loctl;
-	struct siba_softc *bus = mac->mac_sd->sd_bus;
 	static const struct bwn_rfatt rfatt0[] = {
 		{ 3, 0 }, { 1, 0 }, { 5, 0 }, { 7, 0 },	{ 9, 0 }, { 2, 0 },
 		{ 0, 0 }, { 4, 0 }, { 6, 0 }, { 8, 0 }, { 1, 1 }, { 2, 1 },
@@ -2204,12 +2199,12 @@ bwn_phy_g_prepare_hw(struct bwn_mac *mac
 	/* prepare Radio Attenuation */
 	pg->pg_rfatt.padmix = 0;
 
-	if (bus->siba_board_vendor == SIBA_BOARDVENDOR_BCM &&
-	    bus->siba_board_type == SIBA_BOARD_BCM4309G) {
-		if (bus->siba_board_rev < 0x43) {
+	if (siba_get_pci_subvendor(sc->sc_dev) == SIBA_BOARDVENDOR_BCM &&
+	    siba_get_pci_subdevice(sc->sc_dev) == SIBA_BOARD_BCM4309G) {
+		if (siba_get_pci_revid(sc->sc_dev) < 0x43) {
 			pg->pg_rfatt.att = 2;
 			goto done;
-		} else if (bus->siba_board_rev < 0x51) {
+		} else if (siba_get_pci_revid(sc->sc_dev) < 0x51) {
 			pg->pg_rfatt.att = 3;
 			goto done;
 		}
@@ -2228,24 +2223,25 @@ bwn_phy_g_prepare_hw(struct bwn_mac *mac
 			goto done;
 		case 1:
 			if (phy->type == BWN_PHYTYPE_G) {
-				if (bus->siba_board_vendor ==
+				if (siba_get_pci_subvendor(sc->sc_dev) ==
 				    SIBA_BOARDVENDOR_BCM &&
-				    bus->siba_board_type ==
+				    siba_get_pci_subdevice(sc->sc_dev) ==
 				    SIBA_BOARD_BCM4309G &&
-				    bus->siba_board_rev >= 30)
+				    siba_get_pci_revid(sc->sc_dev) >= 30)
 					pg->pg_rfatt.att = 3;
-				else if (bus->siba_board_vendor ==
+				else if (siba_get_pci_subvendor(sc->sc_dev) ==
 				    SIBA_BOARDVENDOR_BCM &&
-				    bus->siba_board_type == SIBA_BOARD_BU4306)
+				    siba_get_pci_subdevice(sc->sc_dev) ==
+				    SIBA_BOARD_BU4306)
 					pg->pg_rfatt.att = 3;
 				else
 					pg->pg_rfatt.att = 1;
 			} else {
-				if (bus->siba_board_vendor ==
+				if (siba_get_pci_subvendor(sc->sc_dev) ==
 				    SIBA_BOARDVENDOR_BCM &&
-				    bus->siba_board_type ==
+				    siba_get_pci_subdevice(sc->sc_dev) ==
 				    SIBA_BOARD_BCM4309G &&
-				    bus->siba_board_rev >= 30)
+				    siba_get_pci_revid(sc->sc_dev) >= 30)
 					pg->pg_rfatt.att = 7;
 				else
 					pg->pg_rfatt.att = 6;
@@ -2253,17 +2249,18 @@ bwn_phy_g_prepare_hw(struct bwn_mac *mac
 			goto done;
 		case 2:
 			if (phy->type == BWN_PHYTYPE_G) {
-				if (bus->siba_board_vendor ==
+				if (siba_get_pci_subvendor(sc->sc_dev) ==
 				    SIBA_BOARDVENDOR_BCM &&
-				    bus->siba_board_type ==
+				    siba_get_pci_subdevice(sc->sc_dev) ==
 				    SIBA_BOARD_BCM4309G &&
-				    bus->siba_board_rev >= 30)
+				    siba_get_pci_revid(sc->sc_dev) >= 30)
 					pg->pg_rfatt.att = 3;
-				else if (bus->siba_board_vendor ==
+				else if (siba_get_pci_subvendor(sc->sc_dev) ==
 				    SIBA_BOARDVENDOR_BCM &&
-				    bus->siba_board_type == SIBA_BOARD_BU4306)
+				    siba_get_pci_subdevice(sc->sc_dev) ==
+				    SIBA_BOARD_BU4306)
 					pg->pg_rfatt.att = 5;
-				else if (bus->siba_chipid == 0x4320)
+				else if (siba_get_chipid(sc->sc_dev) == 0x4320)
 					pg->pg_rfatt.att = 4;
 				else
 					pg->pg_rfatt.att = 3;
@@ -2547,7 +2544,6 @@ bwn_phy_g_recalc_txpwr(struct bwn_mac *m
 	struct bwn_phy *phy = &mac->mac_phy;
 	struct bwn_phy_g *pg = &phy->phy_g;
 	struct bwn_softc *sc = mac->mac_sc;
-	struct siba_softc *siba = mac->mac_sd->sd_bus;
 	unsigned int tssi;
 	int cck, ofdm;
 	int power;
@@ -2570,12 +2566,13 @@ bwn_phy_g_recalc_txpwr(struct bwn_mac *m
 	pg->pg_avgtssi = tssi;
 	KASSERT(tssi < BWN_TSSI_MAX, ("%s:%d: fail", __func__, __LINE__));
 
-	max = siba->siba_sprom.maxpwr_bg;
-	if (siba->siba_sprom.bf_lo & BWN_BFL_PACTRL)
+	max = siba_sprom_get_maxpwr_bg(sc->sc_dev);
+	if (siba_sprom_get_bf_lo(sc->sc_dev) & BWN_BFL_PACTRL)
 		max -= 3;
 	if (max >= 120) {
 		device_printf(sc->sc_dev, "invalid max TX-power value\n");
-		siba->siba_sprom.maxpwr_bg = max = 80;
+		max = 80;
+		siba_sprom_set_maxpwr_bg(sc->sc_dev, max);
 	}
 
 	power = MIN(MAX((phy->txpower < 0) ? 0 : (phy->txpower << 2), 0), max) -
@@ -2619,9 +2616,8 @@ bwn_phy_g_set_txpwr(struct bwn_mac *mac)
 				txctl = BWN_TXCTL_PA2DB | BWN_TXCTL_TXMIX;
 				rfatt += 2;
 				bbatt += 2;
-			} else if (mac->mac_sd->sd_bus->siba_sprom.
-				   bf_lo &
-				   BWN_BFL_PACTRL) {
+			} else if (siba_sprom_get_bf_lo(sc->sc_dev) &
+			    BWN_BFL_PACTRL) {
 				bbatt += 4 * (rfatt - 2);
 				rfatt = 2;
 			}
@@ -2716,9 +2712,10 @@ static void
 bwn_phy_g_task_60s(struct bwn_mac *mac)
 {
 	struct bwn_phy *phy = &mac->mac_phy;
+	struct bwn_softc *sc = mac->mac_sc;
 	uint8_t old = phy->chan;
 
-	if (!(mac->mac_sd->sd_bus->siba_sprom.bf_lo & BWN_BFL_RSSI))
+	if (!(siba_sprom_get_bf_lo(sc->sc_dev) & BWN_BFL_RSSI))
 		return;
 
 	bwn_mac_suspend(mac);
@@ -3182,20 +3179,15 @@ bwn_wme_clear(struct bwn_softc *sc)
 static int
 bwn_core_init(struct bwn_mac *mac)
 {
-#ifdef BWN_DEBUG
 	struct bwn_softc *sc = mac->mac_sc;
-#endif
-	struct siba_dev_softc *sd = mac->mac_sd;
-	struct siba_softc *siba = sd->sd_bus;
-	struct siba_sprom *sprom = &siba->siba_sprom;
 	uint64_t hf;
 	int error;
 
 	KASSERT(mac->mac_status == BWN_MAC_STATUS_UNINIT,
 	    ("%s:%d: fail", __func__, __LINE__));
 
-	siba_powerup(siba, 0);
-	if (!siba_dev_isup(sd))
+	siba_powerup(sc->sc_dev, 0);
+	if (!siba_dev_isup(sc->sc_dev))
 		bwn_reset_core(mac,
 		    mac->mac_phy.gmode ? BWN_TGSLOW_SUPPORT_G : 0);
 
@@ -3219,9 +3211,9 @@ bwn_core_init(struct bwn_mac *mac)
 
 	mac->mac_phy.init_pre(mac);
 
-	siba_pcicore_intr(&siba->siba_pci, sd);
+	siba_pcicore_intr(sc->sc_dev);
 
-	bwn_fix_imcfglobug(mac);
+	siba_fix_imcfglobug(sc->sc_dev);
 	bwn_bt_disable(mac);
 	if (mac->mac_phy.prepare_hw) {
 		error = mac->mac_phy.prepare_hw(mac);
@@ -3232,11 +3224,11 @@ bwn_core_init(struct bwn_mac *mac)
 	if (error)
 		goto fail0;
 	bwn_shm_write_2(mac, BWN_SHARED, BWN_SHARED_COREREV,
-	    mac->mac_sd->sd_id.sd_rev);
+	    siba_get_revid(sc->sc_dev));
 	hf = bwn_hf_read(mac);
 	if (mac->mac_phy.type == BWN_PHYTYPE_G) {
 		hf |= BWN_HF_GPHY_SYM_WORKAROUND;
-		if (sprom->bf_lo & BWN_BFL_PACTRL)
+		if (siba_sprom_get_bf_lo(sc->sc_dev) & BWN_BFL_PACTRL)
 			hf |= BWN_HF_PAGAINBOOST_OFDM_ON;
 		if (mac->mac_phy.rev == 1)
 			hf |= BWN_HF_GPHY_DC_CANCELFILTER;
@@ -3247,10 +3239,10 @@ bwn_core_init(struct bwn_mac *mac)
 		if (mac->mac_phy.rf_rev == 6)
 			hf |= BWN_HF_4318_TSSI;
 	}
-	if (sprom->bf_lo & BWN_BFL_CRYSTAL_NOSLOW)
+	if (siba_sprom_get_bf_lo(sc->sc_dev) & BWN_BFL_CRYSTAL_NOSLOW)
 		hf |= BWN_HF_SLOWCLOCK_REQ_OFF;
-	if ((siba->siba_type == SIBA_TYPE_PCI) &&
-	    (siba->siba_pci.spc_dev->sd_id.sd_rev <= 10))
+	if ((siba_get_type(sc->sc_dev) == SIBA_TYPE_PCI) &&
+	    (siba_get_pcicore_revid(sc->sc_dev) <= 10))
 		hf |= BWN_HF_PCI_SLOWCLOCK_WORKAROUND;
 	hf &= ~BWN_HF_SKIP_CFP_UPDATE;
 	bwn_hf_write(mac, hf);
@@ -3267,7 +3259,7 @@ bwn_core_init(struct bwn_mac *mac)
 	    (mac->mac_phy.type == BWN_PHYTYPE_B) ? 0x1f : 0xf);
 	bwn_shm_write_2(mac, BWN_SCRATCH, BWN_SCRATCH_CONT_MAX, 0x3ff);
 
-	if (siba->siba_type == SIBA_TYPE_PCMCIA || bwn_usedma == 0)
+	if (siba_get_type(sc->sc_dev) == SIBA_TYPE_PCMCIA || bwn_usedma == 0)
 		bwn_pio_init(mac);
 	else
 		bwn_dma_init(mac);
@@ -3277,7 +3269,8 @@ bwn_core_init(struct bwn_mac *mac)
 	bwn_spu_setdelay(mac, 1);
 	bwn_bt_enable(mac);
 
-	siba_powerup(siba, !(sprom->bf_lo & BWN_BFL_CRYSTAL_NOSLOW));
+	siba_powerup(sc->sc_dev,
+	    !(siba_sprom_get_bf_lo(sc->sc_dev) & BWN_BFL_CRYSTAL_NOSLOW));
 	bwn_set_macaddr(mac);
 	bwn_crypt_init(mac);
 
@@ -3290,7 +3283,7 @@ bwn_core_init(struct bwn_mac *mac)
 fail1:
 	bwn_chip_exit(mac);
 fail0:
-	siba_powerdown(siba);
+	siba_powerdown(sc->sc_dev);
 	KASSERT(mac->mac_status == BWN_MAC_STATUS_UNINIT,
 	    ("%s:%d: fail", __func__, __LINE__));
 	return (error);
@@ -3305,7 +3298,7 @@ bwn_core_start(struct bwn_mac *mac)
 	KASSERT(mac->mac_status == BWN_MAC_STATUS_INITED,
 	    ("%s:%d: fail", __func__, __LINE__));
 
-	if (mac->mac_sd->sd_id.sd_rev < 5)
+	if (siba_get_revid(sc->sc_dev) < 5)
 		return;
 
 	while (1) {
@@ -3325,6 +3318,7 @@ bwn_core_start(struct bwn_mac *mac)
 static void
 bwn_core_exit(struct bwn_mac *mac)
 {
+	struct bwn_softc *sc = mac->mac_sc;
 	uint32_t macctl;
 
 	BWN_ASSERT_LOCKED(mac->mac_sc);
@@ -3345,35 +3339,8 @@ bwn_core_exit(struct bwn_mac *mac)
 	bwn_pio_stop(mac);
 	bwn_chip_exit(mac);
 	mac->mac_phy.switch_analog(mac, 0);
-	siba_dev_down(mac->mac_sd, 0);
-	siba_powerdown(mac->mac_sd->sd_bus);
-}
-
-static void
-bwn_fix_imcfglobug(struct bwn_mac *mac)
-{
-	struct siba_dev_softc *sd = mac->mac_sd;
-	struct siba_softc *siba = sd->sd_bus;
-	uint32_t tmp;
-
-	if (siba->siba_pci.spc_dev == NULL)
-		return;
-	if (siba->siba_pci.spc_dev->sd_id.sd_device != SIBA_DEVID_PCI ||
-	    siba->siba_pci.spc_dev->sd_id.sd_rev > 5)
-		return;
-
-	tmp = siba_read_4(sd, SIBA_IMCFGLO) &
-	    ~(SIBA_IMCFGLO_REQTO | SIBA_IMCFGLO_SERTO);
-	switch (siba->siba_type) {
-	case SIBA_TYPE_PCI:
-	case SIBA_TYPE_PCMCIA:
-		tmp |= 0x32;
-		break;
-	case SIBA_TYPE_SSB:
-		tmp |= 0x53;
-		break;
-	}
-	siba_write_4(sd, SIBA_IMCFGLO, tmp);
+	siba_dev_down(sc->sc_dev, 0);
+	siba_powerdown(sc->sc_dev);
 }
 
 static void
@@ -3388,6 +3355,7 @@ bwn_bt_disable(struct bwn_mac *mac)
 static int
 bwn_chip_init(struct bwn_mac *mac)
 {
+	struct bwn_softc *sc = mac->mac_sc;
 	struct bwn_phy *phy = &mac->mac_phy;
 	uint32_t macctl;
 	int error;
@@ -3410,13 +3378,13 @@ bwn_chip_init(struct bwn_mac *mac)
 
 	error = bwn_fw_loadinitvals(mac);
 	if (error) {
-		bwn_gpio_cleanup(mac);
+		siba_gpio_set(sc->sc_dev, 0);
 		return (error);
 	}
 	phy->switch_analog(mac, 1);
 	error = bwn_phy_init(mac);
 	if (error) {
-		bwn_gpio_cleanup(mac);
+		siba_gpio_set(sc->sc_dev, 0);
 		return (error);
 	}
 	if (phy->set_im)
@@ -3428,7 +3396,7 @@ bwn_chip_init(struct bwn_mac *mac)
 	if (phy->type == BWN_PHYTYPE_B)
 		BWN_WRITE_2(mac, 0x005e, BWN_READ_2(mac, 0x005e) | 0x0004);
 	BWN_WRITE_4(mac, 0x0100, 0x01000000);
-	if (mac->mac_sd->sd_id.sd_rev < 5)
+	if (siba_get_revid(sc->sc_dev) < 5)
 		BWN_WRITE_4(mac, 0x010c, 0x01000000);
 
 	BWN_WRITE_4(mac, BWN_MACCTL,
@@ -3438,7 +3406,7 @@ bwn_chip_init(struct bwn_mac *mac)
 	bwn_shm_write_2(mac, BWN_SHARED, 0x0074, 0x0000);
 
 	bwn_set_opmode(mac);
-	if (mac->mac_sd->sd_id.sd_rev < 3) {
+	if (siba_get_revid(sc->sc_dev) < 3) {
 		BWN_WRITE_2(mac, 0x060e, 0x0000);
 		BWN_WRITE_2(mac, 0x0610, 0x8000);
 		BWN_WRITE_2(mac, 0x0604, 0x0000);
@@ -3454,10 +3422,9 @@ bwn_chip_init(struct bwn_mac *mac)
 	BWN_WRITE_4(mac, BWN_DMA3_INTR_MASK, 0x0001dc00);
 	BWN_WRITE_4(mac, BWN_DMA4_INTR_MASK, 0x0000dc00);
 	BWN_WRITE_4(mac, BWN_DMA5_INTR_MASK, 0x0000dc00);
-	siba_write_4(mac->mac_sd, SIBA_TGSLOW,
-	    siba_read_4(mac->mac_sd, SIBA_TGSLOW) | 0x00100000);
-	BWN_WRITE_2(mac, BWN_POWERUP_DELAY,
-	    mac->mac_sd->sd_bus->siba_cc.scc_powerup_delay);
+	siba_write_4(sc->sc_dev, SIBA_TGSLOW,
+	    siba_read_4(sc->sc_dev, SIBA_TGSLOW) | 0x00100000);
+	BWN_WRITE_2(mac, BWN_POWERUP_DELAY, siba_get_cc_powerdelay(sc->sc_dev));
 	return (error);
 }
 
@@ -3619,13 +3586,14 @@ bwn_pio_set_txqueue(struct bwn_mac *mac,
     int index)
 {
 	struct bwn_pio_txpkt *tp;
+	struct bwn_softc *sc = mac->mac_sc;
 	unsigned int i;
 
 	tq->tq_base = bwn_pio_idx2base(mac, index) + BWN_PIO_TXQOFFSET(mac);
 	tq->tq_index = index;
 
 	tq->tq_free = BWN_PIO_MAX_TXPACKETS;
-	if (mac->mac_sd->sd_id.sd_rev >= 8)
+	if (siba_get_revid(sc->sc_dev) >= 8)
 		tq->tq_size = 1920;
 	else {
 		tq->tq_size = bwn_pio_read_2(mac, tq, BWN_PIO_TXQBUFSIZE);
@@ -3664,7 +3632,7 @@ bwn_pio_idx2base(struct bwn_mac *mac, in
 		BWN_PIO11_BASE5,
 	};
 
-	if (mac->mac_sd->sd_id.sd_rev >= 11) {
+	if (siba_get_revid(sc->sc_dev) >= 11) {
 		if (index >= N(bases_rev11))
 			device_printf(sc->sc_dev, "%s: warning\n", __func__);
 		return (bases_rev11[index]);
@@ -3678,9 +3646,10 @@ static void
 bwn_pio_setupqueue_rx(struct bwn_mac *mac, struct bwn_pio_rxqueue *prq,
     int index)
 {
+	struct bwn_softc *sc = mac->mac_sc;
 
 	prq->prq_mac = mac;
-	prq->prq_rev = mac->mac_sd->sd_id.sd_rev;
+	prq->prq_rev = siba_get_revid(sc->sc_dev);
 	prq->prq_base = bwn_pio_idx2base(mac, index) + BWN_PIO_RXQOFFSET(mac);
 	bwn_dma_rxdirectfifo(mac, index, 1);
 }
@@ -4027,6 +3996,7 @@ bwn_dma_32_setdesc(struct bwn_dma_ring *
     int start, int end, int irq)
 {
 	struct bwn_dmadesc32 *descbase = dr->dr_ring_descbase;
+	struct bwn_softc *sc = dr->dr_mac->mac_sc;
 	uint32_t addr, addrext, ctl;
 	int slot;
 
@@ -4036,7 +4006,7 @@ bwn_dma_32_setdesc(struct bwn_dma_ring *
 
 	addr = (uint32_t) (dmaaddr & ~SIBA_DMA_TRANSLATION_MASK);
 	addrext = (uint32_t) (dmaaddr & SIBA_DMA_TRANSLATION_MASK) >> 30;
-	addr |= siba_dma_translation(dr->dr_mac->mac_sd);
+	addr |= siba_dma_translation(sc->sc_dev);
 	ctl = bufsize & BWN_DMA32_DCTL_BYTECNT;
 	if (slot == dr->dr_numslots - 1)
 		ctl |= BWN_DMA32_DCTL_DTABLEEND;
@@ -4115,6 +4085,7 @@ bwn_dma_64_setdesc(struct bwn_dma_ring *
     int start, int end, int irq)
 {
 	struct bwn_dmadesc64 *descbase = dr->dr_ring_descbase;
+	struct bwn_softc *sc = dr->dr_mac->mac_sc;
 	int slot;
 	uint32_t ctl0 = 0, ctl1 = 0;
 	uint32_t addrlo, addrhi;
@@ -4128,7 +4099,7 @@ bwn_dma_64_setdesc(struct bwn_dma_ring *
 	addrhi = (((uint64_t) dmaaddr >> 32) & ~SIBA_DMA_TRANSLATION_MASK);
 	addrext = (((uint64_t) dmaaddr >> 32) & SIBA_DMA_TRANSLATION_MASK) >>
 	    30;
-	addrhi |= (siba_dma_translation(dr->dr_mac->mac_sd) << 1);
+	addrhi |= (siba_dma_translation(sc->sc_dev) << 1);
 	if (slot == dr->dr_numslots - 1)
 		ctl0 |= BWN_DMA64_DCTL0_DTABLEEND;
 	if (start)
@@ -4238,9 +4209,10 @@ bwn_dma_allocringmemory(struct bwn_dma_r
 static void
 bwn_dma_setup(struct bwn_dma_ring *dr)
 {
+	struct bwn_softc *sc = dr->dr_mac->mac_sc;
 	uint64_t ring64;
 	uint32_t addrext, ring32, value;
-	uint32_t trans = siba_dma_translation(dr->dr_mac->mac_sd);
+	uint32_t trans = siba_dma_translation(sc->sc_dev);
 
 	if (dr->dr_tx) {
 		dr->dr_curslot = -1;
@@ -4536,18 +4508,18 @@ bwn_spu_setdelay(struct bwn_mac *mac, in
 static void
 bwn_bt_enable(struct bwn_mac *mac)
 {
-	struct siba_sprom *sprom = &mac->mac_sd->sd_bus->siba_sprom;
+	struct bwn_softc *sc = mac->mac_sc;
 	uint64_t hf;
 
 	if (bwn_bluetooth == 0)
 		return;
-	if ((sprom->bf_lo & BWN_BFL_BTCOEXIST) == 0)
+	if ((siba_sprom_get_bf_lo(sc->sc_dev) & BWN_BFL_BTCOEXIST) == 0)
 		return;
 	if (mac->mac_phy.type != BWN_PHYTYPE_B && !mac->mac_phy.gmode)
 		return;
 
 	hf = bwn_hf_read(mac);
-	if (sprom->bf_lo & BWN_BFL_BTCMOD)
+	if (siba_sprom_get_bf_lo(sc->sc_dev) & BWN_BFL_BTCMOD)
 		hf |= BWN_HF_BT_COEXISTALT;
 	else
 		hf |= BWN_HF_BT_COEXIST;
@@ -4584,25 +4556,25 @@ bwn_clear_keys(struct bwn_mac *mac)
 static void
 bwn_crypt_init(struct bwn_mac *mac)
 {
+	struct bwn_softc *sc = mac->mac_sc;
 
-	mac->mac_max_nr_keys = (mac->mac_sd->sd_id.sd_rev >= 5) ? 58 : 20;
+	mac->mac_max_nr_keys = (siba_get_revid(sc->sc_dev) >= 5) ? 58 : 20;
 	KASSERT(mac->mac_max_nr_keys <= N(mac->mac_key),
 	    ("%s:%d: fail", __func__, __LINE__));
 	mac->mac_ktp = bwn_shm_read_2(mac, BWN_SHARED, BWN_SHARED_KEY_TABLEP);
 	mac->mac_ktp *= 2;
-	if (mac->mac_sd->sd_id.sd_rev >= 5) {
-		BWN_WRITE_2(mac, BWN_RCMTA_COUNT,
-		    mac->mac_max_nr_keys - 8);
-	}
+	if (siba_get_revid(sc->sc_dev) >= 5)
+		BWN_WRITE_2(mac, BWN_RCMTA_COUNT, mac->mac_max_nr_keys - 8);
 	bwn_clear_keys(mac);
 }
 
 static void
 bwn_chip_exit(struct bwn_mac *mac)
 {
+	struct bwn_softc *sc = mac->mac_sc;
 
 	bwn_phy_exit(mac);
-	bwn_gpio_cleanup(mac);
+	siba_gpio_set(sc->sc_dev, 0);
 }
 
 static int
@@ -4622,33 +4594,31 @@ bwn_fw_fillinfo(struct bwn_mac *mac)
 static int
 bwn_gpio_init(struct bwn_mac *mac)
 {
-	struct siba_softc *bus = mac->mac_sd->sd_bus;
-	struct siba_dev_softc *sd;
-	uint32_t mask = 0x0000001f, set = 0x0000000f;
+	struct bwn_softc *sc = mac->mac_sc;
+	uint32_t mask = 0x1f, set = 0xf, value;
 
 	BWN_WRITE_4(mac, BWN_MACCTL,
 	    BWN_READ_4(mac, BWN_MACCTL) & ~BWN_MACCTL_GPOUT_MASK);
 	BWN_WRITE_2(mac, BWN_GPIO_MASK,
 	    BWN_READ_2(mac, BWN_GPIO_MASK) | 0x000f);
 
-	if (bus->siba_chipid == 0x4301) {
+	if (siba_get_chipid(sc->sc_dev) == 0x4301) {
 		mask |= 0x0060;
 		set |= 0x0060;
 	}
-	if (bus->siba_sprom.bf_lo & BWN_BFL_PACTRL) {
+	if (siba_sprom_get_bf_lo(sc->sc_dev) & BWN_BFL_PACTRL) {
 		BWN_WRITE_2(mac, BWN_GPIO_MASK,
 		    BWN_READ_2(mac, BWN_GPIO_MASK) | 0x0200);
 		mask |= 0x0200;
 		set |= 0x0200;
 	}
-	if (mac->mac_sd->sd_id.sd_rev >= 2)
+	if (siba_get_revid(sc->sc_dev) >= 2)
 		mask |= 0x0010;
-	sd = (bus->siba_cc.scc_dev != NULL) ? bus->siba_cc.scc_dev :
-	    bus->siba_pci.spc_dev;
-	if (sd == NULL)
+
+	value = siba_gpio_get(sc->sc_dev);
+	if (value == -1)
 		return (0);
-	siba_write_4(sd, BWN_GPIOCTL,
-	    (siba_read_4(sd, BWN_GPIOCTL) & mask) | set);
+	siba_gpio_set(sc->sc_dev, (value & mask) | set);
 
 	return (0);
 }
@@ -4749,15 +4719,15 @@ bwn_set_opmode(struct bwn_mac *mac)
 		ctl &= ~BWN_MACCTL_STA;
 	ctl |= sc->sc_filters;
 
-	if (mac->mac_sd->sd_id.sd_rev <= 4)
+	if (siba_get_revid(sc->sc_dev) <= 4)
 		ctl |= BWN_MACCTL_PROMISC;
 
 	BWN_WRITE_4(mac, BWN_MACCTL, ctl);
 
 	cfp_pretbtt = 2;
 	if ((ctl & BWN_MACCTL_STA) && !(ctl & BWN_MACCTL_HOSTAP)) {
-		if (mac->mac_sd->sd_bus->siba_chipid == 0x4306 &&
-		    mac->mac_sd->sd_bus->siba_chiprev == 3)
+		if (siba_get_chipid(sc->sc_dev) == 0x4306 &&
+		    siba_get_chiprev(sc->sc_dev) == 3)
 			cfp_pretbtt = 100;
 		else
 			cfp_pretbtt = 50;
@@ -4765,19 +4735,6 @@ bwn_set_opmode(struct bwn_mac *mac)
 	BWN_WRITE_2(mac, 0x612, cfp_pretbtt);
 }
 
-static void
-bwn_gpio_cleanup(struct bwn_mac *mac)
-{
-	struct siba_softc *bus = mac->mac_sd->sd_bus;
-	struct siba_dev_softc *gpiodev, *pcidev = NULL;
-
-	pcidev = bus->siba_pci.spc_dev;
-	gpiodev = bus->siba_cc.scc_dev ? bus->siba_cc.scc_dev : pcidev;
-	if (!gpiodev)
-		return;
-	siba_write_4(gpiodev, BWN_GPIOCTL, 0);
-}
-
 static int
 bwn_dma_gettype(struct bwn_mac *mac)
 {
@@ -4810,6 +4767,7 @@ bwn_phy_g_init_sub(struct bwn_mac *mac)
 {
 	struct bwn_phy *phy = &mac->mac_phy;
 	struct bwn_phy_g *pg = &phy->phy_g;
+	struct bwn_softc *sc = mac->mac_sc;
 	uint16_t i, tmp;
 
 	if (phy->rev == 1)
@@ -4872,7 +4830,7 @@ bwn_phy_g_init_sub(struct bwn_mac *mac)
 		BWN_PHY_SETMASK(mac, BWN_PHY_CCK(0x36), 0x0fff,
 		    (pg->pg_loctl.tx_bias << 12));
 	}
-	if (mac->mac_sd->sd_bus->siba_sprom.bf_lo & BWN_BFL_PACTRL)
+	if (siba_sprom_get_bf_lo(sc->sc_dev) & BWN_BFL_PACTRL)
 		BWN_PHY_WRITE(mac, BWN_PHY_CCK(0x2e), 0x8075);
 	else
 		BWN_PHY_WRITE(mac, BWN_PHY_CCK(0x2e), 0x807f);
@@ -4885,7 +4843,7 @@ bwn_phy_g_init_sub(struct bwn_mac *mac)
 		BWN_PHY_WRITE(mac, BWN_PHY_LO_MASK, 0x8078);
 	}
 
-	if (!(mac->mac_sd->sd_bus->siba_sprom.bf_lo & BWN_BFL_RSSI)) {
+	if (!(siba_sprom_get_bf_lo(sc->sc_dev) & BWN_BFL_RSSI)) {
 		for (i = 0; i < 64; i++) {
 			BWN_PHY_WRITE(mac, BWN_PHY_NRSSI_CTRL, i);
 			BWN_PHY_WRITE(mac, BWN_PHY_NRSSI_DATA,
@@ -4904,8 +4862,8 @@ bwn_phy_g_init_sub(struct bwn_mac *mac)
 	if (phy->rf_rev == 8)
 		BWN_PHY_WRITE(mac, BWN_PHY_EXTG(0x05), 0x3230);
 	bwn_phy_hwpctl_init(mac);
-	if ((mac->mac_sd->sd_bus->siba_chipid == 0x4306
-	     && mac->mac_sd->sd_bus->siba_chippkg == 2) || 0) {
+	if ((siba_get_chipid(sc->sc_dev) == 0x4306
+	     && siba_get_chippkg(sc->sc_dev) == 2) || 0) {
 		BWN_PHY_MASK(mac, BWN_PHY_CRS0, 0xbfff);
 		BWN_PHY_MASK(mac, BWN_PHY_OFDM(0xc3), 0x7fff);
 	}
@@ -4923,16 +4881,16 @@ bwn_has_hwpctl(struct bwn_mac *mac)
 static void
 bwn_phy_init_b5(struct bwn_mac *mac)
 {
-	struct siba_softc *bus = mac->mac_sd->sd_bus;
 	struct bwn_phy *phy = &mac->mac_phy;
 	struct bwn_phy_g *pg = &phy->phy_g;
+	struct bwn_softc *sc = mac->mac_sc;
 	uint16_t offset, value;
 	uint8_t old_channel;
 
 	if (phy->analog == 1)
 		BWN_RF_SET(mac, 0x007a, 0x0050);
-	if ((bus->siba_board_vendor != SIBA_BOARDVENDOR_BCM) &&
-	    (bus->siba_board_type != SIBA_BOARD_BU4306)) {
+	if ((siba_get_pci_subvendor(sc->sc_dev) != SIBA_BOARDVENDOR_BCM) &&
+	    (siba_get_pci_subdevice(sc->sc_dev) != SIBA_BOARD_BU4306)) {
 		value = 0x2120;
 		for (offset = 0x00a8; offset < 0x00c7; offset++) {
 			BWN_PHY_WRITE(mac, offset, value);
@@ -5021,6 +4979,7 @@ bwn_loopback_calcgain(struct bwn_mac *ma
 {
 	struct bwn_phy *phy = &mac->mac_phy;
 	struct bwn_phy_g *pg = &phy->phy_g;
+	struct bwn_softc *sc = mac->mac_sc;
 	uint16_t backup_phy[16] = { 0 };
 	uint16_t backup_radio[3];
 	uint16_t backup_bband;
@@ -5099,7 +5058,7 @@ bwn_loopback_calcgain(struct bwn_mac *ma
 	BWN_PHY_SET(mac, BWN_PHY_RFOVER, 0x0100);
 	BWN_PHY_MASK(mac, BWN_PHY_RFOVERVAL, 0xcfff);
 
-	if (mac->mac_sd->sd_bus->siba_sprom.bf_lo & BWN_BFL_EXTLNA) {
+	if (siba_sprom_get_bf_lo(sc->sc_dev) & BWN_BFL_EXTLNA) {
 		if (phy->rev >= 7) {
 			BWN_PHY_SET(mac, BWN_PHY_RFOVER, 0x0800);
 			BWN_PHY_SET(mac, BWN_PHY_RFOVERVAL, 0x8000);
@@ -5399,6 +5358,7 @@ bwn_phy_init_b6(struct bwn_mac *mac)
 {
 	struct bwn_phy *phy = &mac->mac_phy;
 	struct bwn_phy_g *pg = &phy->phy_g;
+	struct bwn_softc *sc = mac->mac_sc;
 	uint16_t offset, val;
 	uint8_t old_channel;
 
@@ -5428,7 +5388,7 @@ bwn_phy_init_b6(struct bwn_mac *mac)
 		BWN_RF_WRITE(mac, 0x5a, 0x88);
 		BWN_RF_WRITE(mac, 0x5b, 0x6b);
 		BWN_RF_WRITE(mac, 0x5c, 0x0f);
-		if (mac->mac_sd->sd_bus->siba_sprom.bf_lo & BWN_BFL_ALTIQ) {
+		if (siba_sprom_get_bf_lo(sc->sc_dev) & BWN_BFL_ALTIQ) {
 			BWN_RF_WRITE(mac, 0x5d, 0xfa);
 			BWN_RF_WRITE(mac, 0x5e, 0xd8);
 		} else {
@@ -5509,6 +5469,7 @@ static void
 bwn_phy_init_a(struct bwn_mac *mac)
 {
 	struct bwn_phy *phy = &mac->mac_phy;
+	struct bwn_softc *sc = mac->mac_sc;
 
 	KASSERT(phy->type == BWN_PHYTYPE_A || phy->type == BWN_PHYTYPE_G,
 	    ("%s:%d: fail", __func__, __LINE__));
@@ -5525,7 +5486,7 @@ bwn_phy_init_a(struct bwn_mac *mac)
 	bwn_wa_init(mac);
 
 	if (phy->type == BWN_PHYTYPE_G &&
-	    (mac->mac_sd->sd_bus->siba_sprom.bf_lo & BWN_BFL_PACTRL))
+	    (siba_sprom_get_bf_lo(sc->sc_dev) & BWN_BFL_PACTRL))
 		BWN_PHY_SETMASK(mac, BWN_PHY_OFDM(0x6e), 0xe000, 0x3cf);
 }
 
@@ -5776,7 +5737,7 @@ static void
 bwn_wa_init(struct bwn_mac *mac)
 {
 	struct bwn_phy *phy = &mac->mac_phy;
-	struct siba_softc *bus = mac->mac_sd->sd_bus;
+	struct bwn_softc *sc = mac->mac_sc;
 
 	KASSERT(phy->type == BWN_PHYTYPE_G, ("%s fail", __func__));
 
@@ -5795,9 +5756,9 @@ bwn_wa_init(struct bwn_mac *mac)
 		KASSERT(0 == 1, ("%s:%d: fail", __func__, __LINE__));
 	}
 
-	if (bus->siba_board_vendor != SIBA_BOARDVENDOR_BCM ||
-	    bus->siba_board_type != SIBA_BOARD_BU4306 ||
-	    bus->siba_board_rev != 0x17) {
+	if (siba_get_pci_subvendor(sc->sc_dev) != SIBA_BOARDVENDOR_BCM ||
+	    siba_get_pci_subdevice(sc->sc_dev) != SIBA_BOARD_BU4306 ||
+	    siba_get_pci_revid(sc->sc_dev) != 0x17) {
 		if (phy->rev < 2) {
 			bwn_ofdmtab_write_2(mac, BWN_OFDMTAB_GAINX_R1, 1,
 			    0x0002);
@@ -5806,7 +5767,8 @@ bwn_wa_init(struct bwn_mac *mac)
 		} else {
 			bwn_ofdmtab_write_2(mac, BWN_OFDMTAB_GAINX, 1, 0x0002);
 			bwn_ofdmtab_write_2(mac, BWN_OFDMTAB_GAINX, 2, 0x0001);

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

From owner-svn-src-stable-8@FreeBSD.ORG  Wed Apr 21 00:23:24 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 02CE7106566C;
	Wed, 21 Apr 2010 00:23:24 +0000 (UTC)
	(envelope-from weongyo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E570A8FC17;
	Wed, 21 Apr 2010 00:23:23 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3L0NN1V090085;
	Wed, 21 Apr 2010 00:23:23 GMT (envelope-from weongyo@svn.freebsd.org)
Received: (from weongyo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3L0NNC0090083;
	Wed, 21 Apr 2010 00:23:23 GMT (envelope-from weongyo@svn.freebsd.org)
Message-Id: <201004210023.o3L0NNC0090083@svn.freebsd.org>
From: Weongyo Jeong 
Date: Wed, 21 Apr 2010 00:23:23 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206970 - in stable/8/sys/dev: bwn siba
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Wed, 21 Apr 2010 00:23:24 -0000

Author: weongyo
Date: Wed Apr 21 00:23:23 2010
New Revision: 206970
URL: http://svn.freebsd.org/changeset/base/206970

Log:
  MFC r205141:
    enables S/W beacon miss handler.
  
    Reported by:	imp

Modified:
  stable/8/sys/dev/bwn/if_bwn.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/dev/uath/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/siba/siba_cc.c   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/dev/bwn/if_bwn.c
==============================================================================
--- stable/8/sys/dev/bwn/if_bwn.c	Wed Apr 21 00:22:16 2010	(r206969)
+++ stable/8/sys/dev/bwn/if_bwn.c	Wed Apr 21 00:23:23 2010	(r206970)
@@ -1076,6 +1076,8 @@ bwn_attach_post(struct bwn_softc *sc)
 		| IEEE80211_C_TXPMGT		/* capable of txpow mgt */
 		;
 
+	ic->ic_flags_ext |= IEEE80211_FEXT_SWBMISS;	/* s/w bmiss */
+
 	/* call MI attach routine. */
 	ieee80211_ifattach(ic,
 	    bwn_is_valid_ether_addr(siba_sprom_get_mac_80211a(sc->sc_dev)) ?

From owner-svn-src-stable-8@FreeBSD.ORG  Wed Apr 21 00:26:42 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6A60E106564A;
	Wed, 21 Apr 2010 00:26:42 +0000 (UTC)
	(envelope-from weongyo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 401E68FC21;
	Wed, 21 Apr 2010 00:26:42 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3L0QgGU090836;
	Wed, 21 Apr 2010 00:26:42 GMT (envelope-from weongyo@svn.freebsd.org)
Received: (from weongyo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3L0Qg2B090835;
	Wed, 21 Apr 2010 00:26:42 GMT (envelope-from weongyo@svn.freebsd.org)
Message-Id: <201004210026.o3L0Qg2B090835@svn.freebsd.org>
From: Weongyo Jeong 
Date: Wed, 21 Apr 2010 00:26:42 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206971 - stable/8/sys/dev/siba
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Wed, 21 Apr 2010 00:26:42 -0000

Author: weongyo
Date: Wed Apr 21 00:26:41 2010
New Revision: 206971
URL: http://svn.freebsd.org/changeset/base/206971

Log:
  remove svn:mergeinfo properties committed during my MFCs.

Modified:
Directory Properties:
  stable/8/sys/contrib/dev/uath/   (props changed)
  stable/8/sys/dev/siba/siba_cc.c   (props changed)

From owner-svn-src-stable-8@FreeBSD.ORG  Wed Apr 21 05:35:07 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3866C106564A;
	Wed, 21 Apr 2010 05:35:07 +0000 (UTC)
	(envelope-from maxim@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 273BB8FC1C;
	Wed, 21 Apr 2010 05:35:07 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3L5Z7ic060019;
	Wed, 21 Apr 2010 05:35:07 GMT (envelope-from maxim@svn.freebsd.org)
Received: (from maxim@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3L5Z7f6060017;
	Wed, 21 Apr 2010 05:35:07 GMT (envelope-from maxim@svn.freebsd.org)
Message-Id: <201004210535.o3L5Z7f6060017@svn.freebsd.org>
From: Maxim Konovalov 
Date: Wed, 21 Apr 2010 05:35:07 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206980 - stable/8/usr.sbin/sysinstall
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Wed, 21 Apr 2010 05:35:07 -0000

Author: maxim
Date: Wed Apr 21 05:35:06 2010
New Revision: 206980
URL: http://svn.freebsd.org/changeset/base/206980

Log:
  MFC r205671: trim leading w/space.

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

Modified: stable/8/usr.sbin/sysinstall/sysinstall.8
==============================================================================
--- stable/8/usr.sbin/sysinstall/sysinstall.8	Wed Apr 21 04:58:48 2010	(r206979)
+++ stable/8/usr.sbin/sysinstall/sysinstall.8	Wed Apr 21 05:35:06 2010	(r206980)
@@ -543,7 +543,7 @@ Commit any rc.conf changes to disk.
 Preserve existing rc.conf parameters.
 This is useful if you have a post-install script which modifies rc.conf.
 .El
- .It installExpress
+.It installExpress
 Start an "express" installation, asking few questions of
 the user.
 .Pp

From owner-svn-src-stable-8@FreeBSD.ORG  Wed Apr 21 05:36:54 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 21B061065672;
	Wed, 21 Apr 2010 05:36:54 +0000 (UTC)
	(envelope-from maxim@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 10F6B8FC22;
	Wed, 21 Apr 2010 05:36:54 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3L5arAO060457;
	Wed, 21 Apr 2010 05:36:53 GMT (envelope-from maxim@svn.freebsd.org)
Received: (from maxim@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3L5arh8060455;
	Wed, 21 Apr 2010 05:36:53 GMT (envelope-from maxim@svn.freebsd.org)
Message-Id: <201004210536.o3L5arh8060455@svn.freebsd.org>
From: Maxim Konovalov 
Date: Wed, 21 Apr 2010 05:36:53 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206981 - stable/8/sbin/setkey
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Wed, 21 Apr 2010 05:36:54 -0000

Author: maxim
Date: Wed Apr 21 05:36:53 2010
New Revision: 206981
URL: http://svn.freebsd.org/changeset/base/206981

Log:
  MFC r205672: fix typo.

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

Modified: stable/8/sbin/setkey/setkey.8
==============================================================================
--- stable/8/sbin/setkey/setkey.8	Wed Apr 21 05:35:06 2010	(r206980)
+++ stable/8/sbin/setkey/setkey.8	Wed Apr 21 05:36:53 2010	(r206981)
@@ -674,7 +674,7 @@ add 10.0.11.41 10.0.11.33 esp 0x10001
 	-A hmac-md5 "authentication!!" ;
 
 .Ed
-Get the SA information assocaited with first example above:
+Get the SA information associated with first example above:
 .Bd -literal -offset
 get 3ffe:501:4819::1 3ffe:501:481d::1 ah 123456 ;
 

From owner-svn-src-stable-8@FreeBSD.ORG  Wed Apr 21 05:38:16 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 723F71065674;
	Wed, 21 Apr 2010 05:38:16 +0000 (UTC)
	(envelope-from maxim@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 61BBB8FC08;
	Wed, 21 Apr 2010 05:38:16 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3L5cGJG060807;
	Wed, 21 Apr 2010 05:38:16 GMT (envelope-from maxim@svn.freebsd.org)
Received: (from maxim@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3L5cGmo060805;
	Wed, 21 Apr 2010 05:38:16 GMT (envelope-from maxim@svn.freebsd.org)
Message-Id: <201004210538.o3L5cGmo060805@svn.freebsd.org>
From: Maxim Konovalov 
Date: Wed, 21 Apr 2010 05:38:16 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206982 - stable/8/usr.sbin/mtree
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Wed, 21 Apr 2010 05:38:16 -0000

Author: maxim
Date: Wed Apr 21 05:38:16 2010
New Revision: 206982
URL: http://svn.freebsd.org/changeset/base/206982

Log:
  MFC r205873: remove duplication, improve wording.

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

Modified: stable/8/usr.sbin/mtree/mtree.8
==============================================================================
--- stable/8/usr.sbin/mtree/mtree.8	Wed Apr 21 05:36:53 2010	(r206981)
+++ stable/8/usr.sbin/mtree/mtree.8	Wed Apr 21 05:38:16 2010	(r206982)
@@ -41,9 +41,6 @@
 .Op Fl f Ar spec
 .Ek
 .Bk -words
-.Op Fl f Ar spec
-.Ek
-.Bk -words
 .Op Fl K Ar keywords
 .Ek
 .Bk -words
@@ -119,7 +116,7 @@ Same as
 except a status of 2 is returned if the file hierarchy did not match
 the specification.
 .It Fl w
-Make some errorconditions non-fatal warnings.
+Make some errors non-fatal warnings.
 .It Fl x
 Do not descend below mount points in the file hierarchy.
 .It Fl f Ar file

From owner-svn-src-stable-8@FreeBSD.ORG  Wed Apr 21 05:39:52 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 095F6106567B;
	Wed, 21 Apr 2010 05:39:52 +0000 (UTC)
	(envelope-from maxim@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id ECD528FC24;
	Wed, 21 Apr 2010 05:39:51 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3L5dpIh061185;
	Wed, 21 Apr 2010 05:39:51 GMT (envelope-from maxim@svn.freebsd.org)
Received: (from maxim@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3L5dpL4061183;
	Wed, 21 Apr 2010 05:39:51 GMT (envelope-from maxim@svn.freebsd.org)
Message-Id: <201004210539.o3L5dpL4061183@svn.freebsd.org>
From: Maxim Konovalov 
Date: Wed, 21 Apr 2010 05:39:51 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206983 - stable/8/usr.bin/sockstat
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Wed, 21 Apr 2010 05:39:52 -0000

Author: maxim
Date: Wed Apr 21 05:39:51 2010
New Revision: 206983
URL: http://svn.freebsd.org/changeset/base/206983

Log:
  MFC r205874: make sockstat -6 output more readable for long ipv6
  addresses.

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

Modified: stable/8/usr.bin/sockstat/sockstat.c
==============================================================================
--- stable/8/usr.bin/sockstat/sockstat.c	Wed Apr 21 05:38:16 2010	(r206982)
+++ stable/8/usr.bin/sockstat/sockstat.c	Wed Apr 21 05:39:51 2010	(r206983)
@@ -621,6 +621,8 @@ display(void)
 		case AF_INET:
 		case AF_INET6:
 			pos += printaddr(s->family, &s->laddr);
+			if (s->family == AF_INET6 && pos >= 58)
+				pos += xprintf(" ");
 			while (pos < 58)
 				pos += xprintf(" ");
 			pos += printaddr(s->family, &s->faddr);

From owner-svn-src-stable-8@FreeBSD.ORG  Wed Apr 21 06:33:11 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 39DE5106564A;
	Wed, 21 Apr 2010 06:33:11 +0000 (UTC) (envelope-from des@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 242D18FC24;
	Wed, 21 Apr 2010 06:33:11 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3L6XBuA072911;
	Wed, 21 Apr 2010 06:33:11 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3L6XBtp072908;
	Wed, 21 Apr 2010 06:33:11 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <201004210633.o3L6XBtp072908@svn.freebsd.org>
From: Dag-Erling Smorgrav 
Date: Wed, 21 Apr 2010 06:33:11 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206984 - in stable/8: crypto/openssh
	crypto/openssh/openbsd-compat lib/libpam/modules/pam_ssh
	secure/lib/libssh secure/libexec secure/libexec/sftp-server
	secure/libexec/ssh-keysign sec...
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Wed, 21 Apr 2010 06:33:11 -0000

Author: des
Date: Wed Apr 21 06:33:10 2010
New Revision: 206984
URL: http://svn.freebsd.org/changeset/base/206984

Log:
  MFH OpenSSH 5.4p1

Added:
  stable/8/crypto/openssh/PROTOCOL.certkeys
     - copied unchanged from r206396, head/crypto/openssh/PROTOCOL.certkeys
  stable/8/crypto/openssh/PROTOCOL.mux
     - copied unchanged from r206396, head/crypto/openssh/PROTOCOL.mux
  stable/8/crypto/openssh/openbsd-compat/pwcache.c
     - copied unchanged from r206396, head/crypto/openssh/openbsd-compat/pwcache.c
  stable/8/crypto/openssh/pkcs11.h
     - copied unchanged from r206396, head/crypto/openssh/pkcs11.h
  stable/8/crypto/openssh/roaming.h
     - copied, changed from r198019, head/crypto/openssh/roaming.h
  stable/8/crypto/openssh/roaming_client.c
     - copied unchanged from r206396, head/crypto/openssh/roaming_client.c
  stable/8/crypto/openssh/roaming_common.c
     - copied, changed from r198019, head/crypto/openssh/roaming_common.c
  stable/8/crypto/openssh/roaming_dummy.c
     - copied unchanged from r198019, head/crypto/openssh/roaming_dummy.c
  stable/8/crypto/openssh/roaming_serv.c
     - copied unchanged from r206396, head/crypto/openssh/roaming_serv.c
  stable/8/crypto/openssh/schnorr.h
     - copied unchanged from r198019, head/crypto/openssh/schnorr.h
  stable/8/crypto/openssh/ssh-pkcs11-client.c
     - copied unchanged from r206396, head/crypto/openssh/ssh-pkcs11-client.c
  stable/8/crypto/openssh/ssh-pkcs11-helper.0
     - copied unchanged from r206396, head/crypto/openssh/ssh-pkcs11-helper.0
  stable/8/crypto/openssh/ssh-pkcs11-helper.8
     - copied unchanged from r206396, head/crypto/openssh/ssh-pkcs11-helper.8
  stable/8/crypto/openssh/ssh-pkcs11-helper.c
     - copied unchanged from r206396, head/crypto/openssh/ssh-pkcs11-helper.c
  stable/8/crypto/openssh/ssh-pkcs11.c
     - copied unchanged from r206396, head/crypto/openssh/ssh-pkcs11.c
  stable/8/crypto/openssh/ssh-pkcs11.h
     - copied unchanged from r206396, head/crypto/openssh/ssh-pkcs11.h
  stable/8/secure/libexec/ssh-pkcs11-helper/
     - copied from r204917, head/secure/libexec/ssh-pkcs11-helper/
  stable/8/secure/libexec/ssh-pkcs11-helper/Makefile
     - copied unchanged from r204948, head/secure/libexec/ssh-pkcs11-helper/Makefile
Deleted:
  stable/8/crypto/openssh/README.smartcard
  stable/8/crypto/openssh/scard-opensc.c
  stable/8/crypto/openssh/scard.c
  stable/8/crypto/openssh/scard.h
Modified:
  stable/8/crypto/openssh/ChangeLog
  stable/8/crypto/openssh/INSTALL
  stable/8/crypto/openssh/PROTOCOL
  stable/8/crypto/openssh/PROTOCOL.agent
  stable/8/crypto/openssh/README
  stable/8/crypto/openssh/README.platform
  stable/8/crypto/openssh/addrmatch.c
  stable/8/crypto/openssh/auth-krb5.c
  stable/8/crypto/openssh/auth-options.c
  stable/8/crypto/openssh/auth-options.h
  stable/8/crypto/openssh/auth-pam.c
  stable/8/crypto/openssh/auth-passwd.c
  stable/8/crypto/openssh/auth-rh-rsa.c
  stable/8/crypto/openssh/auth-rhosts.c
  stable/8/crypto/openssh/auth-rsa.c
  stable/8/crypto/openssh/auth-sia.c
  stable/8/crypto/openssh/auth.c
  stable/8/crypto/openssh/auth.h
  stable/8/crypto/openssh/auth1.c
  stable/8/crypto/openssh/auth2-hostbased.c
  stable/8/crypto/openssh/auth2-jpake.c
  stable/8/crypto/openssh/auth2-kbdint.c
  stable/8/crypto/openssh/auth2-none.c
  stable/8/crypto/openssh/auth2-passwd.c
  stable/8/crypto/openssh/auth2-pubkey.c
  stable/8/crypto/openssh/auth2.c
  stable/8/crypto/openssh/authfd.c
  stable/8/crypto/openssh/authfd.h
  stable/8/crypto/openssh/authfile.c
  stable/8/crypto/openssh/authfile.h
  stable/8/crypto/openssh/bufaux.c
  stable/8/crypto/openssh/buffer.c
  stable/8/crypto/openssh/buffer.h
  stable/8/crypto/openssh/canohost.c
  stable/8/crypto/openssh/canohost.h
  stable/8/crypto/openssh/channels.c
  stable/8/crypto/openssh/channels.h
  stable/8/crypto/openssh/clientloop.c
  stable/8/crypto/openssh/clientloop.h
  stable/8/crypto/openssh/config.guess
  stable/8/crypto/openssh/config.h
  stable/8/crypto/openssh/config.h.in
  stable/8/crypto/openssh/defines.h
  stable/8/crypto/openssh/dh.c
  stable/8/crypto/openssh/dns.c
  stable/8/crypto/openssh/dns.h
  stable/8/crypto/openssh/gss-genr.c
  stable/8/crypto/openssh/hostfile.c
  stable/8/crypto/openssh/hostfile.h
  stable/8/crypto/openssh/includes.h
  stable/8/crypto/openssh/jpake.c
  stable/8/crypto/openssh/jpake.h
  stable/8/crypto/openssh/kex.c
  stable/8/crypto/openssh/kex.h
  stable/8/crypto/openssh/kexdhs.c
  stable/8/crypto/openssh/kexgexs.c
  stable/8/crypto/openssh/key.c
  stable/8/crypto/openssh/key.h
  stable/8/crypto/openssh/loginrec.c
  stable/8/crypto/openssh/match.h
  stable/8/crypto/openssh/misc.c
  stable/8/crypto/openssh/misc.h
  stable/8/crypto/openssh/monitor.c
  stable/8/crypto/openssh/monitor_fdpass.c
  stable/8/crypto/openssh/monitor_mm.c
  stable/8/crypto/openssh/monitor_wrap.c
  stable/8/crypto/openssh/monitor_wrap.h
  stable/8/crypto/openssh/mux.c
  stable/8/crypto/openssh/myproposal.h
  stable/8/crypto/openssh/nchan.c
  stable/8/crypto/openssh/openbsd-compat/bsd-cygwin_util.c
  stable/8/crypto/openssh/openbsd-compat/bsd-cygwin_util.h
  stable/8/crypto/openssh/openbsd-compat/daemon.c
  stable/8/crypto/openssh/openbsd-compat/getrrsetbyname.c
  stable/8/crypto/openssh/openbsd-compat/openbsd-compat.h
  stable/8/crypto/openssh/openbsd-compat/openssl-compat.c
  stable/8/crypto/openssh/openbsd-compat/openssl-compat.h
  stable/8/crypto/openssh/openbsd-compat/port-aix.c
  stable/8/crypto/openssh/openbsd-compat/port-aix.h
  stable/8/crypto/openssh/openbsd-compat/port-linux.c
  stable/8/crypto/openssh/openbsd-compat/port-linux.h
  stable/8/crypto/openssh/openbsd-compat/readpassphrase.c
  stable/8/crypto/openssh/packet.c
  stable/8/crypto/openssh/packet.h
  stable/8/crypto/openssh/pathnames.h
  stable/8/crypto/openssh/platform.c
  stable/8/crypto/openssh/platform.h
  stable/8/crypto/openssh/readconf.c
  stable/8/crypto/openssh/readconf.h
  stable/8/crypto/openssh/schnorr.c
  stable/8/crypto/openssh/scp.1
  stable/8/crypto/openssh/scp.c
  stable/8/crypto/openssh/servconf.c
  stable/8/crypto/openssh/servconf.h
  stable/8/crypto/openssh/serverloop.c
  stable/8/crypto/openssh/session.c
  stable/8/crypto/openssh/sftp-client.c
  stable/8/crypto/openssh/sftp-client.h
  stable/8/crypto/openssh/sftp-common.c
  stable/8/crypto/openssh/sftp-common.h
  stable/8/crypto/openssh/sftp-server.8   (contents, props changed)
  stable/8/crypto/openssh/sftp-server.c
  stable/8/crypto/openssh/sftp.1
  stable/8/crypto/openssh/sftp.c
  stable/8/crypto/openssh/ssh-add.1
  stable/8/crypto/openssh/ssh-add.c
  stable/8/crypto/openssh/ssh-agent.1   (contents, props changed)
  stable/8/crypto/openssh/ssh-agent.c
  stable/8/crypto/openssh/ssh-dss.c
  stable/8/crypto/openssh/ssh-keygen.1
  stable/8/crypto/openssh/ssh-keygen.c
  stable/8/crypto/openssh/ssh-keyscan.1
  stable/8/crypto/openssh/ssh-keyscan.c
  stable/8/crypto/openssh/ssh-keysign.c
  stable/8/crypto/openssh/ssh-rand-helper.c
  stable/8/crypto/openssh/ssh-rsa.c
  stable/8/crypto/openssh/ssh.1
  stable/8/crypto/openssh/ssh.c
  stable/8/crypto/openssh/ssh2.h
  stable/8/crypto/openssh/ssh_config
  stable/8/crypto/openssh/ssh_config.5
  stable/8/crypto/openssh/ssh_namespace.h
  stable/8/crypto/openssh/sshconnect.c
  stable/8/crypto/openssh/sshconnect.h
  stable/8/crypto/openssh/sshconnect2.c
  stable/8/crypto/openssh/sshd.8
  stable/8/crypto/openssh/sshd.c
  stable/8/crypto/openssh/sshd_config
  stable/8/crypto/openssh/sshd_config.5
  stable/8/crypto/openssh/sshlogin.c
  stable/8/crypto/openssh/sshpty.h
  stable/8/crypto/openssh/sshtty.c
  stable/8/crypto/openssh/uuencode.c
  stable/8/crypto/openssh/version.h
  stable/8/lib/libpam/modules/pam_ssh/Makefile
  stable/8/lib/libpam/modules/pam_ssh/pam_ssh.c
  stable/8/secure/lib/libssh/Makefile
  stable/8/secure/libexec/Makefile
  stable/8/secure/libexec/sftp-server/Makefile
  stable/8/secure/libexec/ssh-keysign/Makefile
  stable/8/secure/usr.bin/scp/Makefile
  stable/8/secure/usr.bin/sftp/Makefile
  stable/8/secure/usr.bin/ssh-add/Makefile
  stable/8/secure/usr.bin/ssh-agent/Makefile
  stable/8/secure/usr.bin/ssh-keygen/Makefile
  stable/8/secure/usr.bin/ssh-keyscan/Makefile
  stable/8/secure/usr.bin/ssh/Makefile
  stable/8/secure/usr.sbin/sshd/Makefile
Directory Properties:
  stable/8/crypto/openssh/   (props changed)
  stable/8/lib/libpam/   (props changed)
  stable/8/secure/   (props changed)
  stable/8/secure/usr.bin/bdes/   (props changed)

Modified: stable/8/crypto/openssh/ChangeLog
==============================================================================
--- stable/8/crypto/openssh/ChangeLog	Wed Apr 21 05:39:51 2010	(r206983)
+++ stable/8/crypto/openssh/ChangeLog	Wed Apr 21 06:33:10 2010	(r206984)
@@ -1,3 +1,1261 @@
+20100307
+ - (djm) OpenBSD CVS Sync
+   - djm@cvs.openbsd.org 2010/03/07 22:16:01
+     [ssh-keygen.c]
+     make internal strptime string match strftime format;
+     suggested by vinschen AT redhat.com and markus@
+   - djm@cvs.openbsd.org 2010/03/08 00:28:55
+     [ssh-keygen.1]
+     document permit-agent-forwarding certificate constraint; patch from
+     stevesk@
+   - djm@cvs.openbsd.org 2010/03/07 22:01:32
+     [version.h]
+     openssh-5.4
+ - (djm) [README contrib/caldera/openssh.spec contrib/redhat/openssh.spec]
+   crank version numbers
+ - (djm) Release OpenSSH-5.4p1
+
+20100307
+ - (dtucker) [auth.c] Bug #1710: call setauthdb on AIX before getpwuid so that
+   it gets the passwd struct from the LAM that knows about the user which is
+   not necessarily the default.  Patch from Alexandre Letourneau.
+ - (dtucker) [session.c] Bug #1567: move setpcred call to before chroot and
+   do not set real uid, since that's needed for the chroot, and will be set
+   by permanently_set_uid.
+ - (dtucker) [session.c] Also initialize creds to NULL for handing to
+    setpcred.
+ - (dtucker) OpenBSD CVS Sync
+   - dtucker@cvs.openbsd.org 2010/03/07 11:57:13
+     [auth-rhosts.c monitor.c monitor_wrap.c session.c auth-options.c sshd.c]
+     Hold authentication debug messages until after successful authentication.
+     Fixes an info leak of environment variables specified in authorized_keys,
+     reported by Jacob Appelbaum.  ok djm@
+
+20100305
+ - OpenBSD CVS Sync
+   - jmc@cvs.openbsd.org 2010/03/04 12:51:25
+     [ssh.1 sshd_config.5]
+     tweak previous;
+   - djm@cvs.openbsd.org 2010/03/04 20:35:08
+     [ssh-keygen.1 ssh-keygen.c]
+     Add a -L flag to print the contents of a certificate; ok markus@
+   - jmc@cvs.openbsd.org 2010/03/04 22:52:40
+     [ssh-keygen.1]
+     fix Bk/Ek;
+   - djm@cvs.openbsd.org 2010/03/04 23:17:25
+     [sshd_config.5]
+     missing word; spotted by jmc@
+   - djm@cvs.openbsd.org 2010/03/04 23:19:29
+     [ssh.1 sshd.8]
+     move section on CA and revoked keys from ssh.1 to sshd.8's known hosts
+     format section and rework it a bit; requested by jmc@
+   - djm@cvs.openbsd.org 2010/03/04 23:27:25
+     [auth-options.c ssh-keygen.c]
+     "force-command" is not spelled "forced-command"; spotted by
+     imorgan AT nas.nasa.gov
+   - djm@cvs.openbsd.org 2010/03/05 02:58:11
+     [auth.c]
+     make the warning for a revoked key louder and more noticable
+   - jmc@cvs.openbsd.org 2010/03/05 06:50:35
+     [ssh.1 sshd.8]
+     tweak previous;
+   - jmc@cvs.openbsd.org 2010/03/05 08:31:20
+     [ssh.1]
+     document certificate authentication; help/ok djm
+   - djm@cvs.openbsd.org 2010/03/05 10:28:21
+     [ssh-add.1 ssh.1 ssh_config.5]
+     mention loading of certificate files from [private]-cert.pub when
+     they are present; feedback and ok jmc@
+ - (tim) [ssh-pkcs11.c] Fix "non-constant initializer" errors in older
+   compilers. OK djm@
+ - (djm) [ssh-rand-helper.c] declare optind, avoiding compilation failure
+   on some platforms
+ - (djm) [configure.ac] set -fno-strict-aliasing for gcc4; ok dtucker@
+
+20100304
+ - (djm) [ssh-keygen.c] Use correct local variable, instead of
+   maybe-undefined global "optarg"
+ - (djm) [contrib/redhat/openssh.spec] Replace obsolete BuildPreReq
+   on XFree86-devel with neutral /usr/include/X11/Xlib.h;
+   imorgan AT nas.nasa.gov in bz#1731
+ - (djm) [.cvsignore] Ignore ssh-pkcs11-helper
+ - (djm) [regress/Makefile] Cleanup sshd_proxy_orig
+ - OpenBSD CVS Sync
+   - djm@cvs.openbsd.org 2010/03/03 01:44:36
+     [auth-options.c key.c]
+     reject strings with embedded ASCII nul chars in certificate key IDs,
+     principal names and constraints
+   - djm@cvs.openbsd.org 2010/03/03 22:49:50
+     [sshd.8]
+     the authorized_keys option for CA keys is "cert-authority", not
+     "from=cert-authority". spotted by imorgan AT nas.nasa.gov
+   - djm@cvs.openbsd.org 2010/03/03 22:50:40
+     [PROTOCOL.certkeys]
+     s/similar same/similar/; from imorgan AT nas.nasa.gov
+   - djm@cvs.openbsd.org 2010/03/04 01:44:57
+     [key.c]
+     use buffer_get_string_ptr_ret() where we are checking the return
+     value explicitly instead of the fatal()-causing buffer_get_string_ptr()
+   - djm@cvs.openbsd.org 2010/03/04 10:36:03
+     [auth-rh-rsa.c auth-rsa.c auth.c auth.h auth2-hostbased.c auth2-pubkey.c]
+     [authfile.c authfile.h hostfile.c hostfile.h servconf.c servconf.h]
+     [ssh-keygen.c ssh.1 sshconnect.c sshd_config.5]
+     Add a TrustedUserCAKeys option to sshd_config to specify CA keys that
+     are trusted to authenticate users (in addition than doing it per-user
+     in authorized_keys).
+     
+     Add a RevokedKeys option to sshd_config and a @revoked marker to
+     known_hosts to allow keys to me revoked and banned for user or host
+     authentication.
+     
+     feedback and ok markus@
+   - djm@cvs.openbsd.org 2010/03/03 00:47:23
+     [regress/cert-hostkey.sh regress/cert-userkey.sh]
+     add an extra test to ensure that authentication with the wrong
+     certificate fails as it should (and it does)
+   - djm@cvs.openbsd.org 2010/03/04 10:38:23
+     [regress/cert-hostkey.sh regress/cert-userkey.sh]
+     additional regression tests for revoked keys and TrustedUserCAKeys
+
+20100303
+ - (djm) [PROTOCOL.certkeys] Add RCS Ident
+ - OpenBSD CVS Sync
+   - jmc@cvs.openbsd.org 2010/02/26 22:09:28
+     [ssh-keygen.1 ssh.1 sshd.8]
+     tweak previous;
+   - otto@cvs.openbsd.org 2010/03/01 11:07:06
+     [ssh-add.c]
+     zap what seems to be a left-over debug message; ok markus@
+   - djm@cvs.openbsd.org 2010/03/02 23:20:57
+     [ssh-keygen.c]
+     POSIX strptime is stricter than OpenBSD's so do a little dance to
+     appease it.
+ - (djm) [regress/cert-userkey.sh] s/echo -n/echon/ here too
+
+20100302
+ - (tim) [config.guess config.sub] Bug 1722: Update to latest versions from
+   http://git.savannah.gnu.org/gitweb/ (2009-12-30 and 2010-01-22
+   respectively).
+
+20100301
+ - (dtucker) [regress/{cert-hostkey,cfgmatch,cipher-speed}.sh} Replace
+   "echo -n" with "echon" for portability.
+ - (dtucker) [openbsd-compat/port-linux.c] Make failure to write to the OOM
+   adjust log at verbose only, since according to cjwatson in bug #1470
+   some virtualization platforms don't allow writes.
+
+20100228
+ - (djm) [auth.c] On Cygwin, refuse usernames that have differences in
+   case from that matched in the system password database. On this
+   platform, passwords are stored case-insensitively, but sshd requires
+   exact case matching for Match blocks in sshd_config(5). Based on
+   a patch from vinschen AT redhat.com.
+ - (tim) [ssh-pkcs11-helper.c] Move declarations before calling functions
+   to make older compilers (gcc 2.95) happy.
+
+20100227
+ - (djm) [ssh-pkcs11-helper.c ] Ensure RNG is initialised and seeded
+ - (djm) [openbsd-compat/bsd-cygwin_util.c] Reduce the set of environment
+   variables copied into sshd child processes. From vinschen AT redhat.com
+
+20100226
+ - OpenBSD CVS Sync
+   - djm@cvs.openbsd.org 2010/02/26 20:29:54
+     [PROTOCOL PROTOCOL.agent PROTOCOL.certkeys addrmatch.c auth-options.c]
+     [auth-options.h auth.h auth2-pubkey.c authfd.c dns.c dns.h hostfile.c]
+     [hostfile.h kex.h kexdhs.c kexgexs.c key.c key.h match.h monitor.c]
+     [myproposal.h servconf.c servconf.h ssh-add.c ssh-agent.c ssh-dss.c]
+     [ssh-keygen.1 ssh-keygen.c ssh-rsa.c ssh.1 ssh.c ssh2.h sshconnect.c]
+     [sshconnect2.c sshd.8 sshd.c sshd_config.5]
+     Add support for certificate key types for users and hosts.
+     
+     OpenSSH certificate key types are not X.509 certificates, but a much
+     simpler format that encodes a public key, identity information and
+     some validity constraints and signs it with a CA key. CA keys are
+     regular SSH keys. This certificate style avoids the attack surface
+     of X.509 certificates and is very easy to deploy.
+     
+     Certified host keys allow automatic acceptance of new host keys
+     when a CA certificate is marked as trusted in ~/.ssh/known_hosts.
+     see VERIFYING HOST KEYS in ssh(1) for details.
+     
+     Certified user keys allow authentication of users when the signing
+     CA key is marked as trusted in authorized_keys. See "AUTHORIZED_KEYS
+     FILE FORMAT" in sshd(8) for details.
+     
+     Certificates are minted using ssh-keygen(1), documentation is in
+     the "CERTIFICATES" section of that manpage.
+     
+     Documentation on the format of certificates is in the file
+     PROTOCOL.certkeys
+     
+     feedback and ok markus@
+   - djm@cvs.openbsd.org 2010/02/26 20:33:21
+     [Makefile regress/cert-hostkey.sh regress/cert-userkey.sh]
+     regression tests for certified keys
+
+20100224
+ - (djm) [pkcs11.h ssh-pkcs11-client.c ssh-pkcs11-helper.c ssh-pkcs11.c]
+   [ssh-pkcs11.h] Add $OpenBSD$ RCS idents so we can sync portable
+ - (djm) OpenBSD CVS Sync
+   - djm@cvs.openbsd.org 2010/02/11 20:37:47
+     [pathnames.h]
+     correct comment
+   - dtucker@cvs.openbsd.org 2009/11/09 04:20:04
+     [regress/Makefile]
+     add regression test for ssh-keygen pubkey conversions
+   - dtucker@cvs.openbsd.org 2010/01/11 02:53:44
+     [regress/forwarding.sh]
+     regress test for stdio forwarding
+   - djm@cvs.openbsd.org 2010/02/09 04:57:36
+     [regress/addrmatch.sh]
+     clean up droppings
+   - djm@cvs.openbsd.org 2010/02/09 06:29:02
+     [regress/Makefile]
+     turn on all the malloc(3) checking options when running regression
+     tests. this has caught a few bugs for me in the past; ok dtucker@
+   - djm@cvs.openbsd.org 2010/02/24 06:21:56
+     [regress/test-exec.sh]
+     wait for sshd to fully stop in cleanup() function; avoids races in tests
+     that do multiple start_sshd/cleanup cycles; "I hate pidfiles" deraadt@
+   - markus@cvs.openbsd.org 2010/02/08 10:52:47
+     [regress/agent-pkcs11.sh]
+     test for PKCS#11 support (currently disabled)
+ - (djm) [Makefile.in ssh-pkcs11-helper.8] Add manpage for PKCS#11 helper
+ - (djm) [contrib/caldera/openssh.spec contrib/redhat/openssh.spec]
+   [contrib/suse/openssh.spec] Add PKCS#11 helper binary and manpage
+
+20100212
+ - (djm) OpenBSD CVS Sync
+   - djm@cvs.openbsd.org 2010/02/02 22:49:34
+     [bufaux.c]
+     make buffer_get_string_ret() really non-fatal in all cases (it was
+     using buffer_get_int(), which could fatal() on buffer empty);
+     ok markus dtucker
+   - markus@cvs.openbsd.org 2010/02/08 10:50:20
+     [pathnames.h readconf.c readconf.h scp.1 sftp.1 ssh-add.1 ssh-add.c]
+     [ssh-agent.c ssh-keygen.1 ssh-keygen.c ssh.1 ssh.c ssh_config.5]
+     replace our obsolete smartcard code with PKCS#11.
+        ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-11/v2-20/pkcs-11v2-20.pdf
+     ssh(1) and ssh-keygen(1) use dlopen(3) directly to talk to a PKCS#11
+     provider (shared library) while ssh-agent(1) delegates PKCS#11 to
+     a forked a ssh-pkcs11-helper process.
+     PKCS#11 is currently a compile time option.
+     feedback and ok djm@; inspired by patches from Alon Bar-Lev
+   - jmc@cvs.openbsd.org 2010/02/08 22:03:05
+     [ssh-add.1 ssh-keygen.1 ssh.1 ssh.c]
+     tweak previous; ok markus
+   - djm@cvs.openbsd.org 2010/02/09 00:50:36
+     [ssh-agent.c]
+     fallout from PKCS#11: unbreak -D
+   - djm@cvs.openbsd.org 2010/02/09 00:50:59
+     [ssh-keygen.c]
+     fix -Wall
+   - djm@cvs.openbsd.org 2010/02/09 03:56:28
+     [buffer.c buffer.h]
+     constify the arguments to buffer_len, buffer_ptr and buffer_dump
+   - djm@cvs.openbsd.org 2010/02/09 06:18:46
+     [auth.c]
+     unbreak ChrootDirectory+internal-sftp by skipping check for executable
+     shell when chrooting; reported by danh AT wzrd.com; ok dtucker@
+   - markus@cvs.openbsd.org 2010/02/10 23:20:38
+     [ssh-add.1 ssh-keygen.1 ssh.1 ssh_config.5]
+     pkcs#11 is no longer optional; improve wording; ok jmc@
+   - jmc@cvs.openbsd.org 2010/02/11 13:23:29
+     [ssh.1]
+     libarary -> library;
+ - (djm) [INSTALL Makefile.in README.smartcard configure.ac scard-opensc.c]
+   [scard.c scard.h pkcs11.h scard/Makefile.in scard/Ssh.bin.uu scard/Ssh.java]
+   Remove obsolete smartcard support
+ - (djm) [ssh-pkcs11-client.c ssh-pkcs11-helper.c ssh-pkcs11.c]
+   Make it compile on OSX
+ - (djm) [ssh-pkcs11-client.c ssh-pkcs11-helper.c ssh-pkcs11.c]
+   Use ssh_get_progname to fill __progname
+ - (djm) [configure.ac] Enable PKCS#11 support only when we find a working
+   dlopen()
+
+20100210
+ - (djm) add -lselinux to LIBS before calling AC_CHECK_FUNCS for
+   getseuserbyname; patch from calebcase AT gmail.com via
+   cjwatson AT debian.org
+
+20100202
+ - (djm) OpenBSD CVS Sync
+   - djm@cvs.openbsd.org 2010/01/30 21:08:33
+     [sshd.8]
+     debug output goes to stderr, not "the system log"; ok markus dtucker
+   - djm@cvs.openbsd.org 2010/01/30 21:12:08
+     [channels.c]
+     fake local addr:port when stdio fowarding as some servers (Tectia at
+     least) validate that they are well-formed;
+     reported by imorgan AT nas.nasa.gov
+     ok dtucker
+
+20100130
+ - (djm) OpenBSD CVS Sync
+   - djm@cvs.openbsd.org 2010/01/28 00:21:18
+     [clientloop.c]
+     downgrade an error() to a debug() - this particular case can be hit in
+     normal operation for certain sequences of mux slave vs session closure
+     and is harmless
+   - djm@cvs.openbsd.org 2010/01/29 00:20:41
+     [sshd.c]
+     set FD_CLOEXEC on sock_in/sock_out; bz#1706 from jchadima AT redhat.com
+     ok dtucker@
+   - djm@cvs.openbsd.org 2010/01/29 20:16:17
+     [mux.c]
+     kill correct channel (was killing already-dead mux channel, not
+     its session channel)
+   - djm@cvs.openbsd.org 2010/01/30 02:54:53
+     [mux.c]
+     don't mark channel as read failed if it is already closing; suppresses
+     harmless error messages when connecting to SSH.COM Tectia server
+     report by imorgan AT nas.nasa.gov
+
+20100129
+ - (dtucker) [openbsd-compat/openssl-compat.c] Bug #1707: Call OPENSSL_config()
+   after registering the hardware engines, which causes the openssl.cnf file to
+   be processed.  See OpenSSL's man page for OPENSSL_config(3) for details.
+   Patch from Solomon Peachy, ok djm@.
+
+20100128
+ - (djm) OpenBSD CVS Sync
+   - djm@cvs.openbsd.org 2010/01/26 02:15:20
+     [mux.c]
+     -Wuninitialized and remove a // comment; from portable
+     (Id sync only)
+   - djm@cvs.openbsd.org 2010/01/27 13:26:17
+     [mux.c]
+     fix bug introduced in mux rewrite:
+     
+     In a mux master, when a socket to a mux slave closes before its server
+     session (as may occur when the slave has been signalled), gracefully
+     close the server session rather than deleting its channel immediately.
+     A server may have more messages on that channel to send (e.g. an exit
+     message) that will fatal() the client if they are sent to a channel that
+     has been prematurely deleted.
+     
+     spotted by imorgan AT nas.nasa.gov
+   - djm@cvs.openbsd.org 2010/01/27 19:21:39
+     [sftp.c]
+     add missing "p" flag to getopt optstring;
+     bz#1704 from imorgan AT nas.nasa.gov
+
+20100126
+ - (djm) OpenBSD CVS Sync
+   - tedu@cvs.openbsd.org 2010/01/17 21:49:09
+     [ssh-agent.1]
+     Correct and clarify ssh-add's password asking behavior.
+     Improved text dtucker and ok jmc
+   - dtucker@cvs.openbsd.org 2010/01/18 01:50:27
+     [roaming_client.c]
+     s/long long unsigned/unsigned long long/, from tim via portable
+     (Id sync only, change already in portable)
+   - djm@cvs.openbsd.org 2010/01/26 01:28:35
+     [channels.c channels.h clientloop.c clientloop.h mux.c nchan.c ssh.c]
+     rewrite ssh(1) multiplexing code to a more sensible protocol.
+     
+     The new multiplexing code uses channels for the listener and
+     accepted control sockets to make the mux master non-blocking, so
+     no stalls when processing messages from a slave.
+     
+     avoid use of fatal() in mux master protocol parsing so an errant slave
+     process cannot take down a running master.
+     
+     implement requesting of port-forwards over multiplexed sessions. Any
+     port forwards requested by the slave are added to those the master has
+     established.
+     
+     add support for stdio forwarding ("ssh -W host:port ...") in mux slaves.
+     
+     document master/slave mux protocol so that other tools can use it to
+     control a running ssh(1). Note: there are no guarantees that this
+     protocol won't be incompatibly changed (though it is versioned).
+     
+     feedback Salvador Fandino, dtucker@
+     channel changes ok markus@
+
+20100122
+ - (tim) [configure.ac] Due to constraints in Windows Sockets in terms of
+   socket inheritance, reduce the default SO_RCVBUF/SO_SNDBUF buffer size
+   in Cygwin to 65535. Patch from Corinna Vinschen.
+
+20100117
+ - (tim) [configure.ac] OpenServer 5 needs BROKEN_GETADDRINFO too.
+ - (tim) [configure.ac] On SVR5 systems, use the C99-conforming functions
+   snprintf() and vsnprintf() named _xsnprintf() and _xvsnprintf().
+
+20100116
+ - (dtucker) [openbsd-compat/pwcache.c] Pull in includes.h and thus defines.h
+   so we correctly detect whether or not we have a native user_from_uid.
+ - (dtucker) [openbsd-compat/openbsd-compat.h] Prototypes for user_from_uid
+   and group_from_gid.
+ - (dtucker) [openbsd-compat/openbsd-compat.h] Fix prototypes, spotted by
+   Tim.
+ - (dtucker) OpenBSD CVS Sync
+   - markus@cvs.openbsd.org 2010/01/15 09:24:23
+     [sftp-common.c]
+     unused
+ - (dtucker) [openbsd-compat/pwcache.c] Shrink ifdef area to prevent unused
+   variable warnings.
+ - (dtucker) [openbsd-compat/openbsd-compat.h] Typo.
+ - (tim) [regress/portnum.sh] Shell portability fix.
+ - (tim) [configure.ac] Define BROKEN_GETADDRINFO on SVR5 systems. The native
+   getaddrinfo() is too old and limited for addr_pton() in addrmatch.c.
+ - (tim) [roaming_client.c] Use of  is not really portable so we
+   use "openbsd-compat/sys-queue.h". s/long long unsigned/unsigned long long/
+   to keep USL compilers happy.
+
+20100115
+ - (dtucker) OpenBSD CVS Sync
+   - jmc@cvs.openbsd.org 2010/01/13 12:48:34
+     [sftp.1 sftp.c]
+     sftp.1: put ls -h in the right place
+     sftp.c: as above, plus add -p to get/put, and shorten their arg names
+     to keep the help usage nicely aligned
+     ok djm
+   - djm@cvs.openbsd.org 2010/01/13 23:47:26
+     [auth.c]
+     when using ChrootDirectory, make sure we test for the existence of the
+     user's shell inside the chroot; bz #1679, patch from alex AT rtfs.hu;
+     ok dtucker
+   - dtucker@cvs.openbsd.org 2010/01/14 23:41:49
+     [sftp-common.c]
+     use user_from{uid,gid} to lookup up ids since it keeps a small cache.
+     ok djm
+   - guenther@cvs.openbsd.org 2010/01/15 00:05:22
+     [sftp.c]
+     Reset SIGTERM to SIG_DFL before executing ssh, so that even if sftp
+     inherited SIGTERM as ignored it will still be able to kill the ssh it
+     starts.
+     ok dtucker@
+ - (dtucker) [openbsd-compat/pwcache.c] Pull in pwcache.c from OpenBSD (no
+   changes yet but there will be some to come).
+ - (dtucker) [configure.ac openbsd-compat/{Makefile.in,pwcache.c} Portability
+   for pwcache.  Also, added caching of negative hits.
+
+20100114
+ - (djm) [platform.h] Add missing prototype for
+   platform_krb5_get_principal_name
+
+20100113
+ - (dtucker) [monitor_fdpass.c] Wrap poll.h include in ifdefs.
+ - (dtucker) [openbsd-compat/readpassphrase.c] Resync against OpenBSD's r1.18:
+   missing restore of SIGTTOU and some whitespace.
+ - (dtucker) [openbsd-compat/readpassphrase.c] Update to OpenBSD's r1.21.
+ - (dtucker) [openbsd-compat/readpassphrase.c] Update to OpenBSD's r1.22.
+   Fixes bz #1590, where sometimes you could not interrupt a connection while
+   ssh was prompting for a passphrase or password.
+ - (dtucker) OpenBSD CVS Sync
+   - dtucker@cvs.openbsd.org 2010/01/13 00:19:04
+     [sshconnect.c auth.c]
+     Fix a couple of typos/mispellings in comments
+   - dtucker@cvs.openbsd.org 2010/01/13 01:10:56
+     [key.c]
+     Ignore and log any Protocol 1 keys where the claimed size is not equal to
+     the actual size.  Noted by Derek Martin, ok djm@
+   - dtucker@cvs.openbsd.org 2010/01/13 01:20:20
+     [canohost.c ssh-keysign.c sshconnect2.c]
+     Make HostBased authentication work with a ProxyCommand.  bz #1569, patch
+     from imorgan at nas nasa gov, ok djm@
+   - djm@cvs.openbsd.org 2010/01/13 01:40:16
+     [sftp.c sftp-server.c sftp.1 sftp-common.c sftp-common.h]
+     support '-h' (human-readable units) for sftp's ls command, just like
+     ls(1); ok dtucker@
+   - djm@cvs.openbsd.org 2010/01/13 03:48:13
+     [servconf.c servconf.h sshd.c]
+     avoid run-time failures when specifying hostkeys via a relative
+     path by prepending the cwd in these cases; bz#1290; ok dtucker@
+   - djm@cvs.openbsd.org 2010/01/13 04:10:50
+     [sftp.c]
+     don't append a space after inserting a completion of a directory (i.e.
+     a path ending in '/') for a slightly better user experience; ok dtucker@
+ - (dtucker) [sftp-common.c] Wrap include of util.h in an ifdef.
+ - (tim) [defines.h] openbsd-compat/readpassphrase.c now needs _NSIG. 
+   feedback and ok dtucker@
+
+20100112
+ - (dtucker) OpenBSD CVS Sync
+   - dtucker@cvs.openbsd.org 2010/01/11 01:39:46
+     [ssh_config channels.c ssh.1 channels.h ssh.c]
+     Add a 'netcat mode' (ssh -W).  This connects stdio on the client to a
+     single port forward on the server.  This allows, for example, using ssh as
+     a ProxyCommand to route connections via intermediate servers.
+     bz #1618, man page help from jmc@, ok markus@
+   - dtucker@cvs.openbsd.org 2010/01/11 04:46:45
+     [authfile.c sshconnect2.c]
+     Do not prompt for a passphrase if we fail to open a keyfile, and log the
+     reason the open failed to debug.
+     bz #1693, found by tj AT castaglia org, ok djm@
+   - djm@cvs.openbsd.org 2010/01/11 10:51:07
+     [ssh-keygen.c]
+     when converting keys, truncate key comments at 72 chars as per RFC4716;
+     bz#1630 reported by tj AT castaglia.org; ok markus@
+   - dtucker@cvs.openbsd.org 2010/01/12 00:16:47
+     [authfile.c]
+     Fix bug introduced in r1.78 (incorrect brace location) that broke key auth.
+     Patch from joachim joachimschipper nl.
+   - djm@cvs.openbsd.org 2010/01/12 00:58:25
+     [monitor_fdpass.c]
+     avoid spinning when fd passing on nonblocking sockets by calling poll()
+     in the EINTR/EAGAIN path, much like we do in atomicio; ok dtucker@
+   - djm@cvs.openbsd.org 2010/01/12 00:59:29
+     [roaming_common.c]
+     delete with extreme prejudice a debug() that fired with every keypress;
+     ok dtucker deraadt
+   - dtucker@cvs.openbsd.org 2010/01/12 01:31:05
+     [session.c]
+     Do not allow logins if /etc/nologin exists but is not readable by the user
+     logging in.  Noted by Jan.Pechanec at Sun, ok djm@ deraadt@
+   - djm@cvs.openbsd.org 2010/01/12 01:36:08
+     [buffer.h bufaux.c]
+     add a buffer_get_string_ptr_ret() that does the same as
+     buffer_get_string_ptr() but does not fatal() on error; ok dtucker@
+   - dtucker@cvs.openbsd.org 2010/01/12 08:33:17
+     [session.c]
+     Add explicit stat so we reliably detect nologin with bad perms.
+     ok djm markus
+
+20100110
+ - (dtucker) [configure.ac misc.c readconf.c servconf.c ssh-keyscan.c]
+   Remove hacks add for RoutingDomain in preparation for its removal.
+ - (dtucker) OpenBSD CVS Sync
+   - dtucker@cvs.openbsd.org 2010/01/09 23:04:13
+     [channels.c ssh.1 servconf.c sshd_config.5 sshd.c channels.h servconf.h
+     ssh-keyscan.1 ssh-keyscan.c readconf.c sshconnect.c misc.c ssh.c
+     readconf.h scp.1 sftp.1 ssh_config.5 misc.h]
+     Remove RoutingDomain from ssh since it's now not needed.  It can be
+     replaced with "route exec" or "nc -V" as a proxycommand.  "route exec"
+     also ensures that trafic such as DNS lookups stays withing the specified
+     routingdomain.  For example (from reyk):
+     # route -T 2 exec /usr/sbin/sshd
+     or inherited from the parent process
+     $ route -T 2 exec sh
+     $ ssh 10.1.2.3
+     ok deraadt@ markus@ stevesk@ reyk@
+   - dtucker@cvs.openbsd.org 2010/01/10 03:51:17
+     [servconf.c]
+     Add ChrootDirectory to sshd.c test-mode output
+   - dtucker@cvs.openbsd.org 2010/01/10 07:15:56
+     [auth.c]
+     Output a debug if we can't open an existing keyfile.  bz#1694, ok djm@
+
+20100109
+ - (dtucker) Wrap use of IPPROTO_IPV6 in an ifdef for platforms that don't
+   have it.
+ - (dtucker) [defines.h] define PRIu64 for platforms that don't have it.
+ - (dtucker) [roaming_client.c] Wrap inttypes.h in an ifdef.
+ - (dtucker) [loginrec.c] Use the SUSv3 specified name for the user name
+   when using utmpx.  Patch from Ed Schouten.
+ - (dtucker) OpenBSD CVS Sync
+   - djm@cvs.openbsd.org 2010/01/09 00:20:26
+     [sftp-server.c sftp-server.8]
+     add a 'read-only' mode to sftp-server(8) that disables open in write mode
+     and all other fs-modifying protocol methods. bz#430 ok dtucker@
+   - djm@cvs.openbsd.org 2010/01/09 00:57:10
+     [PROTOCOL]
+     tweak language
+   - jmc@cvs.openbsd.org 2010/01/09 03:36:00
+     [sftp-server.8]
+     bad place to forget a comma...
+   - djm@cvs.openbsd.org 2010/01/09 05:04:24
+     [mux.c sshpty.h clientloop.c sshtty.c]
+     quell tc[gs]etattr warnings when forcing a tty (ssh -tt), since we
+     usually don't actually have a tty to read/set; bz#1686 ok dtucker@
+   - dtucker@cvs.openbsd.org 2010/01/09 05:17:00
+     [roaming_client.c]
+     Remove a PRIu64 format string that snuck in with roaming.  ok djm@
+   - dtucker@cvs.openbsd.org 2010/01/09 11:13:02
+     [sftp.c]
+     Prevent sftp from derefing a null pointer when given a "-" without a
+     command.  Also, allow whitespace to follow a "-".  bz#1691, path from
+     Colin Watson via Debian.  ok djm@ deraadt@
+   - dtucker@cvs.openbsd.org 2010/01/09 11:17:56
+     [sshd.c]
+     Afer sshd receives a SIGHUP, ignore subsequent HUPs while sshd re-execs
+     itself.  Prevents two HUPs in quick succession from resulting in sshd
+     dying.  bz#1692, patch from Colin Watson via Ubuntu.
+ - (dtucker) [defines.h] Remove now-undeeded PRIu64 define.
+
+20100108
+ - (dtucker) OpenBSD CVS Sync
+   - andreas@cvs.openbsd.org 2009/10/24 11:11:58
+     [roaming.h]
+     Declarations needed for upcoming changes.
+     ok markus@
+   - andreas@cvs.openbsd.org 2009/10/24 11:13:54
+     [sshconnect2.c kex.h kex.c]
+     Let the client detect if the server supports roaming by looking
+     for the resume@appgate.com kex algorithm.
+     ok markus@
+   - andreas@cvs.openbsd.org 2009/10/24 11:15:29
+     [clientloop.c]
+     client_loop() must detect if the session has been suspended and resumed,
+     and take appropriate action in that case.
+     From Martin Forssen, maf at appgate dot com
+   - andreas@cvs.openbsd.org 2009/10/24 11:19:17
+     [ssh2.h]
+     Define the KEX messages used when resuming a suspended connection.
+     ok markus@
+   - andreas@cvs.openbsd.org 2009/10/24 11:22:37
+     [roaming_common.c]
+     Do the actual suspend/resume in the client. This won't be useful until
+     the server side supports roaming.
+     Most code from Martin Forssen, maf at appgate dot com. Some changes by
+     me and markus@
+     ok markus@
+   - andreas@cvs.openbsd.org 2009/10/24 11:23:42
+     [ssh.c]
+     Request roaming to be enabled if UseRoaming is true and the server
+     supports it.
+     ok markus@
+   - reyk@cvs.openbsd.org 2009/10/28 16:38:18
+     [ssh_config.5 sshd.c misc.h ssh-keyscan.1 readconf.h sshconnect.c
+     channels.c channels.h servconf.h servconf.c ssh.1 ssh-keyscan.c scp.1
+     sftp.1 sshd_config.5 readconf.c ssh.c misc.c]
+     Allow to set the rdomain in ssh/sftp/scp/sshd and ssh-keyscan.
+     ok markus@
+   - jmc@cvs.openbsd.org 2009/10/28 21:45:08
+     [sshd_config.5 sftp.1]
+     tweak previous;
+   - djm@cvs.openbsd.org 2009/11/10 02:56:22
+     [ssh_config.5]
+     explain the constraints on LocalCommand some more so people don't
+     try to abuse it.
+   - djm@cvs.openbsd.org 2009/11/10 02:58:56
+     [sshd_config.5]
+     clarify that StrictModes does not apply to ChrootDirectory. Permissions
+     and ownership are always checked when chrooting. bz#1532
+   - dtucker@cvs.openbsd.org 2009/11/10 04:30:45
+     [sshconnect2.c channels.c sshconnect.c]
+     Set close-on-exec on various descriptors so they don't get leaked to
+     child processes.  bz #1643, patch from jchadima at redhat, ok deraadt.
+   - markus@cvs.openbsd.org 2009/11/11 21:37:03
+     [channels.c channels.h]
+     fix race condition in x11/agent channel allocation: don't read after
+     the end of the select read/write fdset and make sure a reused FD
+     is not touched before the pre-handlers are called.
+     with and ok djm@
+   - djm@cvs.openbsd.org 2009/11/17 05:31:44
+     [clientloop.c]
+     fix incorrect exit status when multiplexing and channel ID 0 is recycled
+     bz#1570 reported by peter.oliver AT eon-is.co.uk; ok dtucker
+   - djm@cvs.openbsd.org 2009/11/19 23:39:50
+     [session.c]
+     bz#1606: error when an attempt is made to connect to a server
+     with ForceCommand=internal-sftp with a shell session (i.e. not a
+     subsystem session). Avoids stuck client when attempting to ssh to such a
+     service. ok dtucker@
+   - dtucker@cvs.openbsd.org 2009/11/20 00:15:41
+     [session.c]
+     Warn but do not fail if stat()ing the subsystem binary fails.  This helps
+     with chrootdirectory+forcecommand=sftp-server and restricted shells.
+     bz #1599, ok djm.
+   - djm@cvs.openbsd.org 2009/11/20 00:54:01
+     [sftp.c]
+     bz#1588 change "Connecting to host..." message to "Connected to host."
+     and delay it until after the sftp protocol connection has been established.
+     Avoids confusing sequence of messages when the underlying ssh connection
+     experiences problems. ok dtucker@
+   - dtucker@cvs.openbsd.org 2009/11/20 00:59:36
+     [sshconnect2.c]
+     Use the HostKeyAlias when prompting for passwords.  bz#1039, ok djm@
+   - djm@cvs.openbsd.org 2009/11/20 03:24:07
+     [misc.c]
+     correct off-by-one in percent_expand(): we would fatal() when trying
+     to expand EXPAND_MAX_KEYS, allowing only EXPAND_MAX_KEYS-1 to actually
+     work.  Note that nothing in OpenSSH actually uses close to this limit at
+     present.  bz#1607 from Jan.Pechanec AT Sun.COM
+   - halex@cvs.openbsd.org 2009/11/22 13:18:00
+     [sftp.c]
+     make passing of zero-length arguments to ssh safe by
+     passing "-" "" rather than "-"
+     ok dtucker@, guenther@, djm@
+   - dtucker@cvs.openbsd.org 2009/12/06 23:41:15
+     [sshconnect2.c]
+     zap unused variable and strlen; from Steve McClellan, ok djm
+   - djm@cvs.openbsd.org 2009/12/06 23:53:45
+     [roaming_common.c]
+     use socklen_t for getsockopt optlen parameter; reported by
+     Steve.McClellan AT radisys.com, ok dtucker@
+   - dtucker@cvs.openbsd.org 2009/12/06 23:53:54
+     [sftp.c]
+     fix potential divide-by-zero in sftp's "df" output when talking to a server
+     that reports zero files on the filesystem (Unix filesystems always have at
+     least the root inode).  From Steve McClellan at radisys, ok djm@
+   - markus@cvs.openbsd.org 2009/12/11 18:16:33
+     [key.c]
+     switch from 35 to the more common value of RSA_F4 == (2**16)+1 == 65537
+     for the RSA public exponent; discussed with provos; ok djm@
+   - guenther@cvs.openbsd.org 2009/12/20 07:28:36
+     [ssh.c sftp.c scp.c]
+     When passing user-controlled options with arguments to other programs,
+     pass the option and option argument as separate argv entries and
+     not smashed into one (e.g., as -l foo and not -lfoo).  Also, always
+     pass a "--" argument to stop option parsing, so that a positional
+     argument that starts with a '-' isn't treated as an option.  This
+     fixes some error cases as well as the handling of hostnames and
+     filenames that start with a '-'.
+     Based on a diff by halex@
+     ok halex@ djm@ deraadt@
+   - djm@cvs.openbsd.org 2009/12/20 23:20:40
+     [PROTOCOL]
+     fix an incorrect magic number and typo in PROTOCOL; bz#1688
+     report and fix from ueno AT unixuser.org
+   - stevesk@cvs.openbsd.org 2009/12/25 19:40:21
+     [readconf.c servconf.c misc.h ssh-keyscan.c misc.c]
+     validate routing domain is in range 0-RT_TABLEID_MAX.
+     'Looks right' deraadt@
+   - stevesk@cvs.openbsd.org 2009/12/29 16:38:41
+     [sshd_config.5 readconf.c ssh_config.5 scp.1 servconf.c sftp.1 ssh.1]
+     Rename RDomain config option to RoutingDomain to be more clear and
+     consistent with other options.
+     NOTE: if you currently use RDomain in the ssh client or server config,
+     or ssh/sshd -o, you must update to use RoutingDomain.
+     ok markus@ djm@
+   - jmc@cvs.openbsd.org 2009/12/29 18:03:32
+     [sshd_config.5 ssh_config.5]
+     sort previous;
+   - dtucker@cvs.openbsd.org 2010/01/04 01:45:30
+     [sshconnect2.c]
+     Don't escape backslashes in the SSH2 banner.  bz#1533, patch from
+     Michal Gorny via Gentoo.
+   - djm@cvs.openbsd.org 2010/01/04 02:03:57
+     [sftp.c]
+     Implement tab-completion of commands, local and remote filenames for sftp.
+     Hacked on and off for some time by myself, mouring, Carlos Silva (via 2009
+     Google Summer of Code) and polished to a fine sheen by myself again.
+     It should deal more-or-less correctly with the ikky corner-cases presented
+     by quoted filenames, but the UI could still be slightly improved.
+     In particular, it is quite slow for remote completion on large directories.
+     bz#200; ok markus@
+   - djm@cvs.openbsd.org 2010/01/04 02:25:15
+     [sftp-server.c]
+     bz#1566 don't unnecessarily dup() in and out fds for sftp-server;
+     ok markus@
+   - dtucker@cvs.openbsd.org 2010/01/08 21:50:49
+     [sftp.c]
+     Fix two warnings: possibly used unitialized and use a nul byte instead of
+     NULL pointer.  ok djm@
+ - (dtucker) [Makefile.in added roaming_client.c roaming_serv.c] Import new
+   files for roaming and add to Makefile.
+ - (dtucker) [Makefile.in] .c files do not belong in the OBJ lines.
+ - (dtucker) [sftp.c] ifdef out the sftp completion bits for platforms that
+   don't have libedit.
+ - (dtucker) [configure.ac misc.c readconf.c servconf.c ssh-keyscan.c] Make
+   RoutingDomain an unsupported option on platforms that don't have it.
+ - (dtucker) [sftp.c] Expand ifdef for libedit to cover complete_is_remote
+   too.
+ - (dtucker) [misc.c] Move the routingdomain ifdef to allow the socket to
+   be created.
+ - (dtucker] [misc.c] Shrink the area covered by USE_ROUTINGDOMAIN more
+   to eliminate an unused variable warning.
+ - (dtucker) [roaming_serv.c] Include includes.h for u_intXX_t types.
+
+20091226
+ - (tim) [contrib/cygwin/Makefile] Install ssh-copy-id and ssh-copy-id.1
+   Gzip all man pages. Patch from Corinna Vinschen.
+
+20091221
+ - (dtucker) [auth-krb5.c platform.{c,h} openbsd-compat/port-aix.{c,h}]
+   Bug #1583: Use system's kerberos principal name on AIX if it's available.
+   Based on a patch from and tested by Miguel Sanders 
+
+20091208
+ - (dtucker) Bug #1470: Disable OOM-killing of the listening sshd on Linux,
+   based on a patch from Vaclav Ovsik and Colin Watson.  ok djm.
+
+20091207
+ - (dtucker) Bug #1160: use pkg-config for opensc config if it's available.
+   Tested by Martin Paljak.
+ - (dtucker) Bug #1677: add conditionals around the source for ssh-askpass.
+
+20091121
+ - (tim) [opensshd.init.in] If PidFile is set in sshd_config, use it.
+   Bug 1628. OK dtucker@
+
+20091120
+ - (djm) [ssh-rand-helper.c] Print error and usage() when passed command-
+   line arguments as none are supported. Exit when passed unrecognised
+   commandline flags. bz#1568 from gson AT araneus.fi
+
+20091118
+ - (djm) [channels.c misc.c misc.h sshd.c] add missing setsockopt() to
+   set IPV6_V6ONLY for local forwarding with GatwayPorts=yes. Unify
+   setting IPV6_V6ONLY behind a new function misc.c:sock_set_v6only()
+   bz#1648, report and fix from jan.kratochvil AT redhat.com
+ - (djm) [contrib/gnome-ssh-askpass2.c] Make askpass dialog desktop-modal.
+   bz#1645, patch from jchadima AT redhat.com
+
+20091107
+ - (dtucker) [authfile.c] Fall back to 3DES for the encryption of private
+    keys when built with OpenSSL versions that don't do AES.
+
+20091105
+ - (dtucker) [authfile.c] Add OpenSSL compat header so this still builds with
+   older versions of OpenSSL.
+
+20091024
+ - (dtucker) OpenBSD CVS Sync
+   - djm@cvs.openbsd.org 2009/10/11 23:03:15
+     [hostfile.c]
+     mention the host name that we are looking for in check_host_in_hostfile()
+   - sobrado@cvs.openbsd.org 2009/10/17 12:10:39
+     [sftp-server.c]
+     sort flags.
+   - sobrado@cvs.openbsd.org 2009/10/22 12:35:53
+     [ssh.1 ssh-agent.1 ssh-add.1]
+     use the UNIX-related macros (.At and .Ux) where appropriate.
+     ok jmc@
+   - sobrado@cvs.openbsd.org 2009/10/22 15:02:12
+     [ssh-agent.1 ssh-add.1 ssh.1]
+     write UNIX-domain in a more consistent way; while here, replace a
+     few remaining ".Tn UNIX" macros with ".Ux" ones.
+     pointed out by ratchov@, thanks!
+     ok jmc@
+   - djm@cvs.openbsd.org 2009/10/22 22:26:13
+     [authfile.c]
+     switch from 3DES to AES-128 for encryption of passphrase-protected
+     SSH protocol 2 private keys; ok several
+   - djm@cvs.openbsd.org 2009/10/23 01:57:11
+     [sshconnect2.c]
+     disallow a hostile server from checking jpake auth by sending an
+     out-of-sequence success message. (doesn't affect code enabled by default)
+   - dtucker@cvs.openbsd.org 2009/10/24 00:48:34
+     [ssh-keygen.1]
+     ssh-keygen now uses AES-128 for private keys
+ - (dtucker) [mdoc2man.awk] Teach it to understand the .Ux macro.
+ - (dtucker) [session.c openbsd-compat/port-linux.{c,h}] Bug #1637: if selinux
+   is enabled set the security context to "sftpd_t" before running the
+   internal sftp server   Based on a patch from jchadima at redhat.
+
+20091011
+ - (dtucker) [configure.ac sftp-client.c] Remove the gyrations required for
+   dirent d_type and DTTOIF as we've switched OpenBSD to the more portable
+   lstat.
+ - (dtucker) OpenBSD CVS Sync
+   - markus@cvs.openbsd.org 2009/10/08 14:03:41
+     [sshd_config readconf.c ssh_config.5 servconf.c sshd_config.5]
+     disable protocol 1 by default (after a transition period of about 10 years)
+     ok deraadt
+   - jmc@cvs.openbsd.org 2009/10/08 20:42:12
+     [sshd_config.5 ssh_config.5 sshd.8 ssh.1]
+     some tweaks now that protocol 1 is not offered by default; ok markus
+   - dtucker@cvs.openbsd.org 2009/10/11 10:41:26
+     [sftp-client.c]
+     d_type isn't portable so use lstat to get dirent modes.  Suggested by and
+     "looks sane" deraadt@
+   - markus@cvs.openbsd.org 2009/10/08 18:04:27
+     [regress/test-exec.sh]
+     re-enable protocol v1 for the tests.
+
+20091007
+ - (dtucker) OpenBSD CVS Sync
+   - djm@cvs.openbsd.org 2009/08/12 00:13:00
+     [sftp.c sftp.1]
+     support most of scp(1)'s commandline arguments in sftp(1), as a first
+     step towards making sftp(1) a drop-in replacement for scp(1).
+     One conflicting option (-P) has not been changed, pending further
+     discussion.
+     Patch from carlosvsilvapt@gmail.com as part of his work in the
+     Google Summer of Code
+  - jmc@cvs.openbsd.org 2009/08/12 06:31:42
+     [sftp.1]
+     sort options;
+   - djm@cvs.openbsd.org 2009/08/13 01:11:19
+     [sftp.1 sftp.c]
+     Swizzle options: "-P sftp_server_path" moves to "-D sftp_server_path",
+     add "-P port" to match scp(1). Fortunately, the -P option is only really
+     used by our regression scripts.
+     part of larger patch from carlosvsilvapt@gmail.com for his Google Summer
+     of Code work; ok deraadt markus
+   - jmc@cvs.openbsd.org 2009/08/13 13:39:54
+     [sftp.1 sftp.c]
+     sync synopsis and usage();
+   - djm@cvs.openbsd.org 2009/08/14 18:17:49
+     [sftp-client.c]
+     make the "get_handle: ..." error messages vaguely useful by allowing
+     callers to specify their own error message strings.
+   - fgsch@cvs.openbsd.org 2009/08/15 18:56:34
+     [auth.h]
+     remove unused define. markus@ ok.
+     (Id sync only, Portable still uses this.)
+   - dtucker@cvs.openbsd.org 2009/08/16 23:29:26
+     [sshd_config.5]
+     Add PubkeyAuthentication to the list allowed in a Match block (bz #1577)
+   - djm@cvs.openbsd.org 2009/08/18 18:36:21
+     [sftp-client.h sftp.1 sftp-client.c sftp.c]
+     recursive transfer support for get/put and on the commandline
+     work mostly by carlosvsilvapt@gmail.com for the Google Summer of Code
+     with some tweaks by me; "go for it" deraadt@
+  - djm@cvs.openbsd.org 2009/08/18 21:15:59
+     [sftp.1]
+     fix "get" command usage, spotted by jmc@
+   - jmc@cvs.openbsd.org 2009/08/19 04:56:03
+     [sftp.1]
+     ether -> either;
+   - dtucker@cvs.openbsd.org 2009/08/20 23:54:28
+     [mux.c]
+     subsystem_flag is defined in ssh.c so it's extern; ok djm
+   - djm@cvs.openbsd.org 2009/08/27 17:28:52
+     [sftp-server.c]
+     allow setting an explicit umask on the commandline to override whatever
+     default the user has. bz#1229; ok dtucker@ deraadt@ markus@
+   - djm@cvs.openbsd.org 2009/08/27 17:33:49
+     [ssh-keygen.c]
+     force use of correct hash function for random-art signature display
+     as it was inheriting the wrong one when bubblebabble signatures were
+     activated; bz#1611 report and patch from fwojcik+openssh AT besh.com;
+     ok markus@
+   - djm@cvs.openbsd.org 2009/08/27 17:43:00
+     [sftp-server.8]
+     allow setting an explicit umask on the commandline to override whatever
+     default the user has. bz#1229; ok dtucker@ deraadt@ markus@
+   - djm@cvs.openbsd.org 2009/08/27 17:44:52
+     [authfd.c ssh-add.c authfd.h]
+     Do not fall back to adding keys without contraints (ssh-add -c / -t ...)
+     when the agent refuses the constrained add request. This was a useful
+     migration measure back in 2002 when constraints were new, but just
+     adds risk now.
+     bz #1612, report and patch from dkg AT fifthhorseman.net; ok markus@
+   - djm@cvs.openbsd.org 2009/08/31 20:56:02
+     [sftp-server.c]
+     check correct variable for error message, spotted by martynas@
+   - djm@cvs.openbsd.org 2009/08/31 21:01:29
+     [sftp-server.8]
+     document -e and -h; prodded by jmc@
+   - djm@cvs.openbsd.org 2009/09/01 14:43:17
+     [ssh-agent.c]
+     fix a race condition in ssh-agent that could result in a wedged or
+     spinning agent: don't read off the end of the allocated fd_sets, and
+     don't issue blocking read/write on agent sockets - just fall back to
+     select() on retriable read/write errors. bz#1633 reported and tested
+     by "noodle10000 AT googlemail.com"; ok dtucker@ markus@
+   - grunk@cvs.openbsd.org 2009/10/01 11:37:33
+     [dh.c]
+     fix a cast
+     ok djm@ markus@
+   - djm@cvs.openbsd.org 2009/10/06 04:46:40
+     [session.c]
+     bz#1596: fflush(NULL) before exec() to ensure that everying (motd
+     in particular) has made it out before the streams go away.
+   - djm@cvs.openbsd.org 2008/12/07 22:17:48
+     [regress/addrmatch.sh]
+     match string "passwordauthentication" only at start of line, not anywhere
+     in sshd -T output
+   - dtucker@cvs.openbsd.org 2009/05/05 07:51:36
+     [regress/multiplex.sh]
+     Always specify ssh_config for multiplex tests: prevents breakage caused
+     by options in ~/.ssh/config.  From Dan Peterson.
+   - djm@cvs.openbsd.org 2009/08/13 00:57:17
+     [regress/Makefile]
+     regression test for port number parsing. written as part of the a2port
+     change that went into 5.2 but I forgot to commit it at the time...
+   - djm@cvs.openbsd.org 2009/08/13 01:11:55
+     [regress/sftp-batch.sh regress/sftp-badcmds.sh regress/sftp.sh
+     regress/sftp-cmds.sh regres/sftp-glob.sh]
+     date: 2009/08/13 01:11:19;  author: djm;  state: Exp;  lines: +10 -7
+     Swizzle options: "-P sftp_server_path" moves to "-D sftp_server_path",
+     add "-P port" to match scp(1). Fortunately, the -P option is only really
+     used by our regression scripts.
+     part of larger patch from carlosvsilvapt@gmail.com for his Google Summer
+     of Code work; ok deraadt markus
+   - djm@cvs.openbsd.org 2009/08/20 18:43:07
+     [regress/ssh-com-sftp.sh]
+     fix one sftp -D ... => sftp -P ... conversion that I missed; from Carlos
+     Silva for Google Summer of Code
+   - dtucker@cvs.openbsd.org 2009/10/06 23:51:49
+     [regress/ssh2putty.sh]
+     Add OpenBSD tag to make syncs easier
+ - (dtucker) [regress/portnum.sh] Import new test.
+ - (dtucker) [configure.ac sftp-client.c] DTOTIF is in fs/ffs/dir.h on at
+   least dragonflybsd.
+ - (dtucker) d_type is not mandated by POSIX, so add fallback code using
+    stat(), needed on at least cygwin.
+
+20091002
+ - (djm) [Makefile.in] Mention readconf.o in ssh-keysign's make deps.
+   spotted by des AT des.no
+
+20090926
+ - (djm) [contrib/caldera/openssh.spec contrib/redhat/openssh.spec]
+         [contrib/suse/openssh.spec] Update for release
+ - (djm) [README] update relnotes URL
+ - (djm) [packet.c] Restore EWOULDBLOCK handling that got lost somewhere
+ - (djm) Release 5.3p1
+
+20090911
+ - (dtucker) [configure.ac] Change the -lresolv check so it works on Mac OS X
+   10.6 (which doesn't have BIND8_COMPAT and thus uses res_9_query).  Patch
+   from jbasney at ncsa uiuc edu.
+
+20090908
+ - (djm) [serverloop.c] Fix test for server-assigned remote forwarding port
+   (-R 0:...); bz#1578, spotted and fix by gavin AT emf.net; ok dtucker@
+
+20090901
+ - (dtucker) [configure.ac] Bug #1639: use AC_PATH_PROG to search the path for

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

From owner-svn-src-stable-8@FreeBSD.ORG  Wed Apr 21 11:09:13 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9B465106564A;
	Wed, 21 Apr 2010 11:09:13 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 6F7F38FC19;
	Wed, 21 Apr 2010 11:09:13 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3LB9DEF035116;
	Wed, 21 Apr 2010 11:09:13 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3LB9DQO035114;
	Wed, 21 Apr 2010 11:09:13 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201004211109.o3LB9DQO035114@svn.freebsd.org>
From: Konstantin Belousov 
Date: Wed, 21 Apr 2010 11:09:13 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r206990 - stable/8/lib/libc/sys
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Wed, 21 Apr 2010 11:09:13 -0000

Author: kib
Date: Wed Apr 21 11:09:13 2010
New Revision: 206990
URL: http://svn.freebsd.org/changeset/base/206990

Log:
  MFC r206549:
  Align the declaration for sa_sigaction with POSIX.
  
  MFC r206649:
  Still reference struct __sigaction with clarification when this form
  of argument declaration is needed.
  
  MFC r206802:
  Revert r206649. Simplify the presented declaration of struct sigaction.

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

Modified: stable/8/lib/libc/sys/sigaction.2
==============================================================================
--- stable/8/lib/libc/sys/sigaction.2	Wed Apr 21 10:21:34 2010	(r206989)
+++ stable/8/lib/libc/sys/sigaction.2	Wed Apr 21 11:09:13 2010	(r206990)
@@ -28,7 +28,7 @@
 .\"	From: @(#)sigaction.2	8.2 (Berkeley) 4/3/94
 .\" $FreeBSD$
 .\"
-.Dd June 7, 2004
+.Dd April 18, 2010
 .Dt SIGACTION 2
 .Os
 .Sh NAME
@@ -40,16 +40,11 @@
 .In signal.h
 .Bd -literal
 struct  sigaction {
-        union {
-                void    (*__sa_handler)(int);
-                void    (*__sa_sigaction)(int, struct __siginfo *, void *);
-        } __sigaction_u;                /* signal handler */
+        void    (*sa_handler)(int);
+        void    (*sa_sigaction)(int, siginfo_t *, void *);
         int     sa_flags;               /* see signal options below */
         sigset_t sa_mask;               /* signal mask to apply */
 };
-
-#define	sa_handler	__sigaction_u.__sa_handler
-#define	sa_sigaction	__sigaction_u.__sa_sigaction
 .Ed
 .Ft int
 .Fo sigaction
@@ -148,6 +143,16 @@ If
 is non-zero, the previous handling information for the signal
 is returned to the user.
 .Pp
+The above declaration of
+.Vt "struct sigaction"
+is not literal.
+It is provided only to list the accessible members.
+See
+.In sys/signal.h
+for the actual definition.
+In particular, the storage occupied by sa_handler and sa_sigaction overlaps,
+and an application can not use both simultaneously.
+.Pp
 Once a signal handler is installed, it normally remains installed
 until another
 .Fn sigaction

From owner-svn-src-stable-8@FreeBSD.ORG  Wed Apr 21 17:02:45 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2826D106566B;
	Wed, 21 Apr 2010 17:02:45 +0000 (UTC)
	(envelope-from bruce@cran.org.uk)
Received: from muon.cran.org.uk (unknown [IPv6:2001:470:1f09:679::1])
	by mx1.freebsd.org (Postfix) with ESMTP id DF4658FC15;
	Wed, 21 Apr 2010 17:02:44 +0000 (UTC)
Received: from muon.cran.org.uk (localhost [127.0.0.1])
	by muon.cran.org.uk (Postfix) with ESMTP id 6620EC400C;
	Wed, 21 Apr 2010 17:02:43 +0000 (UTC)
X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on muon.cran.org.uk
X-Spam-Level: 
X-Spam-Status: No, score=-3.0 required=8.0 tests=AWL,BAYES_00,RDNS_DYNAMIC
	autolearn=no version=3.2.5
Received: from core.draftnet (87-194-158-129.bethere.co.uk [87.194.158.129])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by muon.cran.org.uk (Postfix) with ESMTPSA;
	Wed, 21 Apr 2010 17:02:43 +0000 (UTC)
From: Bruce Cran 
To: Kostik Belousov 
Date: Wed, 21 Apr 2010 18:01:58 +0100
User-Agent: KMail/1.13.2 (FreeBSD/9.0-CURRENT; KDE/4.4.2; amd64; ; )
References: <201004202019.o3KKJJih033338@svn.freebsd.org>
	<20100420210208.GA2422@deviant.kiev.zoral.com.ua>
In-Reply-To: <20100420210208.GA2422@deviant.kiev.zoral.com.ua>
MIME-Version: 1.0
Content-Type: Text/Plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Message-Id: <201004211801.59151.bruce@cran.org.uk>
Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, svn-src-stable-8@freebsd.org,
	Bruce Cran 
Subject: Re: svn commit: r206911 - stable/8/contrib/top
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Wed, 21 Apr 2010 17:02:45 -0000

On Tuesday 20 April 2010 22:02:08 Kostik Belousov wrote:
> On Tue, Apr 20, 2010 at 08:19:19PM +0000, Bruce Cran wrote:
> > Author: brucec
> > Date: Tue Apr 20 20:19:19 2010
> > New Revision: 206911
> > URL: http://svn.freebsd.org/changeset/base/206911
> > 
> > Log:
> >   MFC r205119 and r206056:
> >   
> >   Prevent the SIZE field being corrupted when a process allocates more
> >   than 2TB.
> >   
> >   PR:	bin/129706
> >   Submitted by:	brucec
> >   Approved by: 	rrs (mentor)
> 
> Am I right that this change contains a bug that was fixed by r206842 ?
> If yes, why is it merged as is ?

Yes, it looks like it does have a bug. I was unaware of it when I did the 
merge.

-- 
Bruce Cran

From owner-svn-src-stable-8@FreeBSD.ORG  Wed Apr 21 19:45:42 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 33086106566C;
	Wed, 21 Apr 2010 19:45:42 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 206B38FC1C;
	Wed, 21 Apr 2010 19:45:42 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3LJjgp3049988;
	Wed, 21 Apr 2010 19:45:42 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3LJjfOf049983;
	Wed, 21 Apr 2010 19:45:41 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <201004211945.o3LJjfOf049983@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Wed, 21 Apr 2010 19:45:41 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r207010 - in stable/8/sys: kern net sys
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Wed, 21 Apr 2010 19:45:42 -0000

Author: bz
Date: Wed Apr 21 19:45:41 2010
New Revision: 207010
URL: http://svn.freebsd.org/changeset/base/207010

Log:
  MFC r205345:
  
    Split eventhandler_register() into an internal part and a wrapper function
    that provides the allocated and setup eventhandler entry.
  
    Add a new wrapper for VIMAGE that allocates extra space to hold the
    callback function and argument in addition to an extra wrapper function.
    While the wrapper function goes as normal callback function the
    argument points to the extra space allocated holding the original func
    and arg that the wrapper function can then call.
  
    Provide an iterator function for the virtual network stack (vnet) that
    will call the callback function for each network stack.
  
    Provide a new set of macros for VNET that in the non-VIMAGE case will
    just call eventhandler_register() while in the VIMAGE case it will use
    vimage_eventhandler_register() passing in the extra iterator function
    but will only register once rather than per-vnet.
    We need a special macro in case we are interested in the tag returned
    as we must check for curvnet and can neither simply assign the
    return value, nor not change it in the non-vnet0 case without that.
  
    Discussed with:       jhb
    Reviewed by:  zec (earlier version), jhb

Modified:
  stable/8/sys/kern/subr_eventhandler.c
  stable/8/sys/net/vnet.c
  stable/8/sys/net/vnet.h
  stable/8/sys/sys/eventhandler.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/kern/subr_eventhandler.c
==============================================================================
--- stable/8/sys/kern/subr_eventhandler.c	Wed Apr 21 19:35:56 2010	(r207009)
+++ stable/8/sys/kern/subr_eventhandler.c	Wed Apr 21 19:45:41 2010	(r207010)
@@ -68,15 +68,15 @@ SYSINIT(eventhandlers, SI_SUB_EVENTHANDL
  * Insertion is O(n) due to the priority scan, but optimises to O(1)
  * if all priorities are identical.
  */
-eventhandler_tag
-eventhandler_register(struct eventhandler_list *list, const char *name, 
-		      void *func, void *arg, int priority)
+static eventhandler_tag
+eventhandler_register_internal(struct eventhandler_list *list,
+    const char *name, eventhandler_tag epn)
 {
     struct eventhandler_list		*new_list;
-    struct eventhandler_entry_generic	*eg;
     struct eventhandler_entry		*ep;
     
     KASSERT(eventhandler_lists_initted, ("eventhandler registered too early"));
+    KASSERT(epn != NULL, ("%s: cannot register NULL event", __func__));
 
     /* lock the eventhandler lists */
     mtx_lock(&eventhandler_mutex);
@@ -117,31 +117,68 @@ eventhandler_register(struct eventhandle
     }
     mtx_unlock(&eventhandler_mutex);
 
-    /* allocate an entry for this handler, populate it */
-    eg = malloc(sizeof(struct eventhandler_entry_generic), M_EVENTHANDLER,
-	M_WAITOK | M_ZERO);
-    eg->func = func;
-    eg->ee.ee_arg = arg;
-    eg->ee.ee_priority = priority;
-    KASSERT(priority != EHE_DEAD_PRIORITY,
+    KASSERT(epn->ee_priority != EHE_DEAD_PRIORITY,
 	("%s: handler for %s registered with dead priority", __func__, name));
 
     /* sort it into the list */
-    CTR4(KTR_EVH, "%s: adding item %p (function %p) to \"%s\"", __func__, eg,
-	func, name);
+    CTR4(KTR_EVH, "%s: adding item %p (function %p) to \"%s\"", __func__, epn,
+	((struct eventhandler_entry_generic *)epn)->func, name);
     EHL_LOCK(list);
     TAILQ_FOREACH(ep, &list->el_entries, ee_link) {
 	if (ep->ee_priority != EHE_DEAD_PRIORITY &&
-	    eg->ee.ee_priority < ep->ee_priority) {
-	    TAILQ_INSERT_BEFORE(ep, &eg->ee, ee_link);
+	    epn->ee_priority < ep->ee_priority) {
+	    TAILQ_INSERT_BEFORE(ep, epn, ee_link);
 	    break;
 	}
     }
     if (ep == NULL)
-	TAILQ_INSERT_TAIL(&list->el_entries, &eg->ee, ee_link);
+	TAILQ_INSERT_TAIL(&list->el_entries, epn, ee_link);
     EHL_UNLOCK(list);
-    return(&eg->ee);
+    return(epn);
+}
+
+eventhandler_tag
+eventhandler_register(struct eventhandler_list *list, const char *name, 
+		      void *func, void *arg, int priority)
+{
+    struct eventhandler_entry_generic	*eg;
+    
+    /* allocate an entry for this handler, populate it */
+    eg = malloc(sizeof(struct eventhandler_entry_generic), M_EVENTHANDLER,
+	M_WAITOK | M_ZERO);
+    eg->func = func;
+    eg->ee.ee_arg = arg;
+    eg->ee.ee_priority = priority;
+
+    return (eventhandler_register_internal(list, name, &eg->ee));
+}
+
+#ifdef VIMAGE
+struct eventhandler_entry_generic_vimage
+{
+    struct eventhandler_entry		ee;
+    vimage_iterator_func_t		func;		/* Vimage iterator function. */
+    struct eventhandler_entry_vimage	v_ee;		/* Original func, arg. */
+};
+
+eventhandler_tag
+vimage_eventhandler_register(struct eventhandler_list *list, const char *name, 
+    void *func, void *arg, int priority, vimage_iterator_func_t iterfunc)
+{
+    struct eventhandler_entry_generic_vimage	*eg;
+    
+    /* allocate an entry for this handler, populate it */
+    eg = malloc(sizeof(struct eventhandler_entry_generic_vimage),
+	M_EVENTHANDLER, M_WAITOK | M_ZERO);
+    eg->func = iterfunc;
+    eg->v_ee.func = func;
+    eg->v_ee.ee_arg = arg;
+    eg->ee.ee_arg = &eg->v_ee;
+    eg->ee.ee_priority = priority;
+
+    return (eventhandler_register_internal(list, name, &eg->ee));
 }
+#endif
 
 void
 eventhandler_deregister(struct eventhandler_list *list, eventhandler_tag tag)

Modified: stable/8/sys/net/vnet.c
==============================================================================
--- stable/8/sys/net/vnet.c	Wed Apr 21 19:35:56 2010	(r207009)
+++ stable/8/sys/net/vnet.c	Wed Apr 21 19:45:41 2010	(r207010)
@@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -55,6 +56,8 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#include 
+
 #ifdef DDB
 #include 
 #include 
@@ -637,6 +640,39 @@ vnet_sysuninit(void)
 	VNET_SYSINIT_RUNLOCK();
 }
 
+/*
+ * EVENTHANDLER(9) extensions.
+ */
+/*
+ * Invoke the eventhandler function originally registered with the possibly
+ * registered argument for all virtual network stack instances.
+ *
+ * This iterator can only be used for eventhandlers that do not take any
+ * additional arguments, as we do ignore the variadic arguments from the
+ * EVENTHANDLER_INVOKE() call.
+ */
+void
+vnet_global_eventhandler_iterator_func(void *arg, ...)
+{
+	VNET_ITERATOR_DECL(vnet_iter);
+	struct eventhandler_entry_vimage *v_ee;
+
+	/*
+	 * There is a bug here in that we should actually cast things to
+	 * (struct eventhandler_entry_ ## name *)  but that's not easily
+	 * possible in here so just re-using the variadic version we
+	 * defined for the generic vimage case.
+	 */
+	v_ee = arg;
+	VNET_LIST_RLOCK();
+	VNET_FOREACH(vnet_iter) {
+		CURVNET_SET(vnet_iter);
+		((vimage_iterator_func_t)v_ee->func)(v_ee->ee_arg);
+		CURVNET_RESTORE();
+	}
+	VNET_LIST_RUNLOCK();
+}
+
 #ifdef VNET_DEBUG
 struct vnet_recursion {
 	SLIST_ENTRY(vnet_recursion)	 vnr_le;
@@ -696,6 +732,9 @@ vnet_log_recursion(struct vnet *old_vnet
 }
 #endif /* VNET_DEBUG */
 
+/*
+ * DDB(4).
+ */
 #ifdef DDB
 DB_SHOW_COMMAND(vnets, db_show_vnets)
 {

Modified: stable/8/sys/net/vnet.h
==============================================================================
--- stable/8/sys/net/vnet.h	Wed Apr 21 19:35:56 2010	(r207009)
+++ stable/8/sys/net/vnet.h	Wed Apr 21 19:45:41 2010	(r207010)
@@ -313,6 +313,29 @@ void	vnet_register_sysuninit(void *arg);
 void	vnet_deregister_sysinit(void *arg);
 void	vnet_deregister_sysuninit(void *arg);
 
+/*
+ * EVENTHANDLER(9) extensions.
+ */
+#include 
+
+void	vnet_global_eventhandler_iterator_func(void *, ...);
+#define VNET_GLOBAL_EVENTHANDLER_REGISTER_TAG(tag, name, func, arg, priority) \
+do {									\
+	if (IS_DEFAULT_VNET(curvnet)) {					\
+		(tag) = vimage_eventhandler_register(NULL, #name, func,	\
+		    arg, priority,					\
+		    vnet_global_eventhandler_iterator_func);		\
+	}								\
+} while(0)
+#define VNET_GLOBAL_EVENTHANDLER_REGISTER(name, func, arg, priority)	\
+do {									\
+	if (IS_DEFAULT_VNET(curvnet)) {					\
+		vimage_eventhandler_register(NULL, #name, func,		\
+		    arg, priority,					\
+		    vnet_global_eventhandler_iterator_func);		\
+	}								\
+} while(0)
+
 #else /* !VIMAGE */
 
 /*
@@ -384,6 +407,13 @@ void	vnet_deregister_sysuninit(void *arg
 #define	VNET_SYSUNINIT(ident, subsystem, order, func, arg)		\
 	SYSUNINIT(ident, subsystem, order, func, arg)
 
+/*
+ * Without VIMAGE revert to the default implementation.
+ */
+#define VNET_GLOBAL_EVENTHANDLER_REGISTER_TAG(tag, name, func, arg, priority) \
+	(tag) = eventhandler_register(NULL, #name, func, arg, priority)
+#define VNET_GLOBAL_EVENTHANDLER_REGISTER(name, func, arg, priority)	\
+	eventhandler_register(NULL, #name, func, arg, priority)
 #endif /* VIMAGE */
 #endif /* _KERNEL */
 

Modified: stable/8/sys/sys/eventhandler.h
==============================================================================
--- stable/8/sys/sys/eventhandler.h	Wed Apr 21 19:35:56 2010	(r207009)
+++ stable/8/sys/sys/eventhandler.h	Wed Apr 21 19:45:41 2010	(r207010)
@@ -41,6 +41,14 @@ struct eventhandler_entry {
 	void				*ee_arg;
 };
 
+#ifdef VIMAGE
+struct eventhandler_entry_vimage {
+	void	(* func)(void);		/* Original function registered. */
+	void	*ee_arg;		/* Original argument registered. */
+	void	*sparep[2];
+};
+#endif
+
 struct eventhandler_list {
 	char				*el_name;
 	int				el_flags;
@@ -142,6 +150,14 @@ void	eventhandler_deregister(struct even
 struct eventhandler_list *eventhandler_find_list(const char *name);
 void	eventhandler_prune_list(struct eventhandler_list *list);
 
+#ifdef VIMAGE
+typedef	void (*vimage_iterator_func_t)(void *, ...);
+
+eventhandler_tag vimage_eventhandler_register(struct eventhandler_list *list,
+	    const char *name, void *func, void *arg, int priority,
+	    vimage_iterator_func_t);
+#endif
+
 /*
  * Standard system event queues.
  */

From owner-svn-src-stable-8@FreeBSD.ORG  Wed Apr 21 19:47:19 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 81D601065673;
	Wed, 21 Apr 2010 19:47:19 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 70B378FC0C;
	Wed, 21 Apr 2010 19:47:19 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3LJlJV0050415;
	Wed, 21 Apr 2010 19:47:19 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3LJlJTI050413;
	Wed, 21 Apr 2010 19:47:19 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <201004211947.o3LJlJTI050413@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Wed, 21 Apr 2010 19:47:19 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r207011 - stable/8/sys/net
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Wed, 21 Apr 2010 19:47:19 -0000

Author: bz
Date: Wed Apr 21 19:47:19 2010
New Revision: 207011
URL: http://svn.freebsd.org/changeset/base/207011

Log:
  MFC r206469:
  
    In if_detach_internal() only try to do the detach run if if_attachdomain1()
    has actually succeeded to initialize and attach.  There is a theoretical
    possibility to drop out early in if_attachdomain1() leaving the array
    uninitialized if we cannot get the lock.
  
    Discussed with:       rwatson

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

Modified: stable/8/sys/net/if.c
==============================================================================
--- stable/8/sys/net/if.c	Wed Apr 21 19:45:41 2010	(r207010)
+++ stable/8/sys/net/if.c	Wed Apr 21 19:47:19 2010	(r207011)
@@ -931,7 +931,7 @@ if_detach_internal(struct ifnet *ifp, in
 	if_delgroups(ifp);
 
 	IF_AFDATA_LOCK(ifp);
-	for (dp = domains; dp; dp = dp->dom_next) {
+	for (dp = domains; ifp->if_afdata_initialized > 0 && dp; dp = dp->dom_next) {
 		if (dp->dom_ifdetach && ifp->if_afdata[dp->dom_family])
 			(*dp->dom_ifdetach)(ifp,
 			    ifp->if_afdata[dp->dom_family]);

From owner-svn-src-stable-8@FreeBSD.ORG  Wed Apr 21 19:48:41 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 22BDB106564A;
	Wed, 21 Apr 2010 19:48:41 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 11AF48FC0C;
	Wed, 21 Apr 2010 19:48:41 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3LJmevN050771;
	Wed, 21 Apr 2010 19:48:40 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3LJmeox050769;
	Wed, 21 Apr 2010 19:48:40 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <201004211948.o3LJmeox050769@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Wed, 21 Apr 2010 19:48:40 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r207012 - stable/8/sys/net
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Wed, 21 Apr 2010 19:48:41 -0000

Author: bz
Date: Wed Apr 21 19:48:40 2010
New Revision: 207012
URL: http://svn.freebsd.org/changeset/base/207012

Log:
  MFC r206470:
  
    In if_detach_internal() we cannot hold the af_data lock over the
    dom_ifdetach() calls as they might sleep for callout_drain().
    Do as we do in if_attachdomain1() [r121470] and handle
    if_afdata_initialized earlier and call dom_ifdetach() unlocked.
  
    Discussed with:       rwatson

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

Modified: stable/8/sys/net/if.c
==============================================================================
--- stable/8/sys/net/if.c	Wed Apr 21 19:47:19 2010	(r207011)
+++ stable/8/sys/net/if.c	Wed Apr 21 19:48:40 2010	(r207012)
@@ -930,14 +930,20 @@ if_detach_internal(struct ifnet *ifp, in
 		devctl_notify("IFNET", ifp->if_xname, "DETACH", NULL);
 	if_delgroups(ifp);
 
+	/*
+	 * We cannot hold the lock over dom_ifdetach calls as they might
+	 * sleep, for example trying to drain a callout, thus open up the
+	 * theoretical race with re-attaching.
+	 */
 	IF_AFDATA_LOCK(ifp);
-	for (dp = domains; ifp->if_afdata_initialized > 0 && dp; dp = dp->dom_next) {
+	i = ifp->if_afdata_initialized;
+	ifp->if_afdata_initialized = 0;
+	IF_AFDATA_UNLOCK(ifp);
+	for (dp = domains; i > 0 && dp; dp = dp->dom_next) {
 		if (dp->dom_ifdetach && ifp->if_afdata[dp->dom_family])
 			(*dp->dom_ifdetach)(ifp,
 			    ifp->if_afdata[dp->dom_family]);
 	}
-	ifp->if_afdata_initialized = 0;
-	IF_AFDATA_UNLOCK(ifp);
 }
 
 #ifdef VIMAGE

From owner-svn-src-stable-8@FreeBSD.ORG  Wed Apr 21 19:51:22 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A047D106566C;
	Wed, 21 Apr 2010 19:51:22 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 8E5A78FC15;
	Wed, 21 Apr 2010 19:51:22 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3LJpMtc051427;
	Wed, 21 Apr 2010 19:51:22 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3LJpMs9051421;
	Wed, 21 Apr 2010 19:51:22 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <201004211951.o3LJpMs9051421@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Wed, 21 Apr 2010 19:51:22 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r207013 - in stable/8/sys: net netinet netinet6
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Wed, 21 Apr 2010 19:51:22 -0000

Author: bz
Date: Wed Apr 21 19:51:22 2010
New Revision: 207013
URL: http://svn.freebsd.org/changeset/base/207013

Log:
  MFC r206481:
  
    Plug reference leaks in the link-layer code ("new-arp") that previously
    prevented the link-layer entry from being freed.
  
    In both in.c and in6.c (though that code path seems to be basically dead)
    plug a reference leak in case of a pending callout being drained.
  
    In if_ether.c consistently add a reference before resetting the callout
    and in case we canceled a pending one remove the reference for that.
    In the final case in arptimer, before freeing the expired entry, remove
    the reference again and explicitly call callout_stop() to clear the active
    flag.
  
    In nd6.c:nd6_free() we are only ever called from the callout function and
    thus need to remove the reference there as well before calling into
    llentry_free().
  
    In if_llatbl.c when freeing the entire tables make sure that in case we
    cancel a pending callout to remove the reference as well.
  
    Reviewed by:          qingli (earlier version)
    MFC after:            10 days
    Problem observed, patch tested by: simon on ipv6gw.f.o,
                          Christian Kratzer (ck cksoft.de),
                          Evgenii Davidov (dado korolev-net.ru)
  PR:			kern/144564
  Configurations still affected:	with options FLOWTABLE

Modified:
  stable/8/sys/net/if_llatbl.c
  stable/8/sys/netinet/if_ether.c
  stable/8/sys/netinet/in.c
  stable/8/sys/netinet6/in6.c
  stable/8/sys/netinet6/nd6.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/net/if_llatbl.c
==============================================================================
--- stable/8/sys/net/if_llatbl.c	Wed Apr 21 19:48:40 2010	(r207012)
+++ stable/8/sys/net/if_llatbl.c	Wed Apr 21 19:51:22 2010	(r207013)
@@ -170,9 +170,12 @@ lltable_free(struct lltable *llt)
 
 	for (i=0; i < LLTBL_HASHTBL_SIZE; i++) {
 		LIST_FOREACH_SAFE(lle, &llt->lle_head[i], lle_next, next) {
+			int canceled;
 
-			callout_drain(&lle->la_timer);
+			canceled = callout_drain(&lle->la_timer);
 			LLE_WLOCK(lle);
+			if (canceled)
+				LLE_REMREF(lle);
 			llentry_free(lle);
 		}
 	}

Modified: stable/8/sys/netinet/if_ether.c
==============================================================================
--- stable/8/sys/netinet/if_ether.c	Wed Apr 21 19:48:40 2010	(r207012)
+++ stable/8/sys/netinet/if_ether.c	Wed Apr 21 19:51:22 2010	(r207013)
@@ -180,6 +180,8 @@ arptimer(void *arg)
 	else {
 		if (!callout_pending(&lle->la_timer) &&
 		    callout_active(&lle->la_timer)) {
+			callout_stop(&lle->la_timer);
+			LLE_REMREF(lle);
 			(void) llentry_free(lle);
 			ARPSTAT_INC(timeouts);
 		} 
@@ -382,9 +384,14 @@ retry:
 		    EHOSTUNREACH : EHOSTDOWN;
 
 	if (renew) {
+		int canceled;
+
 		LLE_ADDREF(la);
 		la->la_expire = time_second + V_arpt_down;
-		callout_reset(&la->la_timer, hz * V_arpt_down, arptimer, la);
+		canceled = callout_reset(&la->la_timer, hz * V_arpt_down,
+		    arptimer, la);
+		if (canceled)
+			LLE_REMREF(la);
 		la->la_asked++;
 		LLE_WUNLOCK(la);
 		arprequest(ifp, NULL, &SIN(dst)->sin_addr,
@@ -694,9 +701,14 @@ match:
 		la->la_flags |= LLE_VALID;
 
 		if (!(la->la_flags & LLE_STATIC)) {
+			int canceled;
+
+			LLE_ADDREF(la);
 			la->la_expire = time_second + V_arpt_keep;
-			callout_reset(&la->la_timer, hz * V_arpt_keep,
-			    arptimer, la);
+			canceled = callout_reset(&la->la_timer,
+			    hz * V_arpt_keep, arptimer, la);
+			if (canceled)
+				LLE_REMREF(la);
 		}
 		la->la_asked = 0;
 		la->la_preempt = V_arp_maxtries;

Modified: stable/8/sys/netinet/in.c
==============================================================================
--- stable/8/sys/netinet/in.c	Wed Apr 21 19:48:40 2010	(r207012)
+++ stable/8/sys/netinet/in.c	Wed Apr 21 19:51:22 2010	(r207013)
@@ -1357,8 +1357,12 @@ in_lltable_prefix_free(struct lltable *l
 
 			if (IN_ARE_MASKED_ADDR_EQUAL((struct sockaddr_in *)L3_ADDR(lle), 
 						     pfx, msk)) {
-				callout_drain(&lle->la_timer);
+				int canceled;
+
+				canceled = callout_drain(&lle->la_timer);
 				LLE_WLOCK(lle);
+				if (canceled)
+					LLE_REMREF(lle);
 				llentry_free(lle);
 			}
 		}

Modified: stable/8/sys/netinet6/in6.c
==============================================================================
--- stable/8/sys/netinet6/in6.c	Wed Apr 21 19:48:40 2010	(r207012)
+++ stable/8/sys/netinet6/in6.c	Wed Apr 21 19:51:22 2010	(r207013)
@@ -2337,8 +2337,12 @@ in6_lltable_prefix_free(struct lltable *
 				    &((struct sockaddr_in6 *)L3_ADDR(lle))->sin6_addr, 
 				    &pfx->sin6_addr, 
 				    &msk->sin6_addr)) {
-				callout_drain(&lle->la_timer);
+				int canceled;
+
+				canceled = callout_drain(&lle->la_timer);
 				LLE_WLOCK(lle);
+				if (canceled)
+					LLE_REMREF(lle);
 				llentry_free(lle);
 			}
 		}

Modified: stable/8/sys/netinet6/nd6.c
==============================================================================
--- stable/8/sys/netinet6/nd6.c	Wed Apr 21 19:48:40 2010	(r207012)
+++ stable/8/sys/netinet6/nd6.c	Wed Apr 21 19:51:22 2010	(r207013)
@@ -1124,6 +1124,7 @@ nd6_free(struct llentry *ln, int gc)
 	ifp = ln->lle_tbl->llt_ifp;
 	IF_AFDATA_LOCK(ifp);
 	LLE_WLOCK(ln);
+	LLE_REMREF(ln);
 	llentry_free(ln);
 	IF_AFDATA_UNLOCK(ifp);
 

From owner-svn-src-stable-8@FreeBSD.ORG  Wed Apr 21 19:55:43 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 60C9A1065673;
	Wed, 21 Apr 2010 19:55:43 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 4FB5B8FC0C;
	Wed, 21 Apr 2010 19:55:43 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3LJthD2052439;
	Wed, 21 Apr 2010 19:55:43 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3LJthEg052437;
	Wed, 21 Apr 2010 19:55:43 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <201004211955.o3LJthEg052437@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Wed, 21 Apr 2010 19:55:43 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r207014 - stable/8/sys/net
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Wed, 21 Apr 2010 19:55:43 -0000

Author: bz
Date: Wed Apr 21 19:55:43 2010
New Revision: 207014
URL: http://svn.freebsd.org/changeset/base/207014

Log:
  MFC r206486:
  
    Check that the interface is on the list of cloned interfaces before trying
    to remove it to avoid panics in case of two threads trying to remove it in
    parallel.
  
  PR:	      kern/116837
  Submitted by: Takahiro Kurosawa (takahiro.kurosawa gmail.com) (orig version)

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

Modified: stable/8/sys/net/if_clone.c
==============================================================================
--- stable/8/sys/net/if_clone.c	Wed Apr 21 19:51:22 2010	(r207013)
+++ stable/8/sys/net/if_clone.c	Wed Apr 21 19:55:43 2010	(r207014)
@@ -234,6 +234,7 @@ int
 if_clone_destroyif(struct if_clone *ifc, struct ifnet *ifp)
 {
 	int err;
+	struct ifnet *ifcifp;
 
 	if (ifc->ifc_destroy == NULL)
 		return(EOPNOTSUPP);
@@ -246,8 +247,17 @@ if_clone_destroyif(struct if_clone *ifc,
 	CURVNET_SET_QUIET(ifp->if_vnet);
 
 	IF_CLONE_LOCK(ifc);
-	IFC_IFLIST_REMOVE(ifc, ifp);
+	LIST_FOREACH(ifcifp, &ifc->ifc_iflist, if_clones) {
+		if (ifcifp == ifp) {
+			IFC_IFLIST_REMOVE(ifc, ifp);
+			break;
+		}
+	}
 	IF_CLONE_UNLOCK(ifc);
+	if (ifcifp == NULL) {
+		CURVNET_RESTORE();
+		return (ENXIO);		/* ifp is not on the list. */
+	}
 
 	if_delgroup(ifp, ifc->ifc_name);
 

From owner-svn-src-stable-8@FreeBSD.ORG  Wed Apr 21 20:00:13 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C7C891065672;
	Wed, 21 Apr 2010 20:00:13 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id B69188FC27;
	Wed, 21 Apr 2010 20:00:13 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3LK0Drq053522;
	Wed, 21 Apr 2010 20:00:13 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3LK0Df1053520;
	Wed, 21 Apr 2010 20:00:13 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <201004212000.o3LK0Df1053520@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Wed, 21 Apr 2010 20:00:13 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r207015 - stable/8/sys/net
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Wed, 21 Apr 2010 20:00:13 -0000

Author: bz
Date: Wed Apr 21 20:00:13 2010
New Revision: 207015
URL: http://svn.freebsd.org/changeset/base/207015

Log:
  MFC r206488:
  
    Take a reference to make sure that the interface cannot go away during
    if_clone_destroy() in case parallel threads try to.
  
  PR:		kern/116837
  Submitted by:	Mikolaj Golub (to.my.trociny gmail.com)

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

Modified: stable/8/sys/net/if_clone.c
==============================================================================
--- stable/8/sys/net/if_clone.c	Wed Apr 21 19:55:43 2010	(r207014)
+++ stable/8/sys/net/if_clone.c	Wed Apr 21 20:00:13 2010	(r207015)
@@ -196,10 +196,11 @@ if_clone_createif(struct if_clone *ifc, 
 int
 if_clone_destroy(const char *name)
 {
+	int err;
 	struct if_clone *ifc;
 	struct ifnet *ifp;
 
-	ifp = ifunit(name);
+	ifp = ifunit_ref(name);
 	if (ifp == NULL)
 		return (ENXIO);
 
@@ -221,10 +222,14 @@ if_clone_destroy(const char *name)
 	}
 #endif
 	IF_CLONERS_UNLOCK();
-	if (ifc == NULL)
+	if (ifc == NULL) {
+		if_rele(ifp);
 		return (EINVAL);
+	}
 
-	return (if_clone_destroyif(ifc, ifp));
+	err = if_clone_destroyif(ifc, ifp);
+	if_rele(ifp);
+	return err;
 }
 
 /*

From owner-svn-src-stable-8@FreeBSD.ORG  Thu Apr 22 00:28:49 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 76575106566B;
	Thu, 22 Apr 2010 00:28:49 +0000 (UTC)
	(envelope-from delphij@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 6539D8FC20;
	Thu, 22 Apr 2010 00:28:49 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3M0SnwO014649;
	Thu, 22 Apr 2010 00:28:49 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3M0Snmg014646;
	Thu, 22 Apr 2010 00:28:49 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201004220028.o3M0Snmg014646@svn.freebsd.org>
From: Xin LI 
Date: Thu, 22 Apr 2010 00:28:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r207040 - stable/8/contrib/netcat
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Thu, 22 Apr 2010 00:28:49 -0000

Author: delphij
Date: Thu Apr 22 00:28:49 2010
New Revision: 207040
URL: http://svn.freebsd.org/changeset/base/207040

Log:
  MFC: netcat 4.7.

Deleted:
  stable/8/contrib/netcat/FREEBSD-upgrade
  stable/8/contrib/netcat/FREEBSD-vendor
Modified:
  stable/8/contrib/netcat/nc.1
  stable/8/contrib/netcat/netcat.c
Directory Properties:
  stable/8/contrib/netcat/   (props changed)

Modified: stable/8/contrib/netcat/nc.1
==============================================================================
--- stable/8/contrib/netcat/nc.1	Thu Apr 22 00:21:30 2010	(r207039)
+++ stable/8/contrib/netcat/nc.1	Thu Apr 22 00:28:49 2010	(r207040)
@@ -1,4 +1,4 @@
-.\"     $OpenBSD: nc.1,v 1.50 2009/06/05 06:47:12 jmc Exp $
+.\"     $OpenBSD: nc.1,v 1.53 2010/02/23 23:00:52 schwarze Exp $
 .\"
 .\" Copyright (c) 1996 David Sacerdote
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd June 5 2009
+.Dd April 15, 2010
 .Dt NC 1
 .Os
 .Sh NAME
@@ -36,7 +36,7 @@
 .Sh SYNOPSIS
 .Nm nc
 .Bk -words
-.Op Fl 46DdEhklnorStUuvz
+.Op Fl 46DdEhklnrStUuvz
 .Op Fl e Ar IPsec_policy
 .Op Fl I Ar length
 .Op Fl i Ar interval
@@ -51,8 +51,8 @@
 .Op Fl X Ar proxy_protocol
 .Oo Xo
 .Fl x Ar proxy_address Ns Oo : Ns
-.Ar port Oc Oc
-.Xc
+.Ar port Oc
+.Xc Oc
 .Op Ar hostname
 .Op Ar port
 .Ek
@@ -159,15 +159,6 @@ socket option.
 .It Fl O Ar length
 Specifies the size of the TCP send buffer.
 When
-.It Fl o
-.Dq Once-only mode .
-By default,
-.Nm
-does not terminate on EOF condition on input,
-but continues until the network side has been closed down.
-Specifying
-.Fl o
-will make it terminate on EOF as well.
 .It Fl P Ar proxy_username
 Specifies a username to present to a proxy server that requires authentication.
 If no username is specified then authentication will not be attempted.
@@ -206,7 +197,9 @@ This makes it possible to use
 .Nm
 to script telnet sessions.
 .It Fl U
-Specifies to use Unix Domain Sockets.
+Specifies to use
+.Ux Ns -domain
+sockets.
 .It Fl u
 Use UDP instead of the default option of TCP.
 .It Fl V Ar fib
@@ -428,7 +421,9 @@ outgoing traffic only.
 .Pp
 .Dl $ nc -e 'out ipsec esp/transport//require' host.example.com 42
 .Pp
-Create and listen on a Unix Domain Socket:
+Create and listen on a
+.Ux Ns -domain
+socket:
 .Pp
 .Dl $ nc -lU /var/tmp/dsocket
 .Pp

Modified: stable/8/contrib/netcat/netcat.c
==============================================================================
--- stable/8/contrib/netcat/netcat.c	Thu Apr 22 00:21:30 2010	(r207039)
+++ stable/8/contrib/netcat/netcat.c	Thu Apr 22 00:28:49 2010	(r207040)
@@ -1,4 +1,4 @@
-/* $OpenBSD: netcat.c,v 1.93 2009/06/05 00:18:10 claudio Exp $ */
+/* $OpenBSD: netcat.c,v 1.95 2010/02/27 00:58:56 nicm Exp $ */
 /*
  * Copyright (c) 2001 Eric Jackson 
  *
@@ -72,14 +72,12 @@
 #define PORT_MAX_LEN	6
 
 /* Command Line Options */
-int	Eflag;					/* Use IPsec ESP */
 int	dflag;					/* detached, no stdin */
 unsigned int iflag;				/* Interval Flag */
 int	jflag;					/* use jumbo frames if we can */
 int	kflag;					/* More than one connect */
 int	lflag;					/* Bind to local port */
 int	nflag;					/* Don't do name look up */
-int	oflag;					/* Once only: stop on EOF */
 int	FreeBSD_Oflag;				/* Do not use TCP options */
 char   *Pflag;					/* Proxy username */
 char   *pflag;					/* Localport flag */
@@ -151,7 +149,7 @@ main(int argc, char *argv[])
 	sv = NULL;
 
 	while ((ch = getopt_long(argc, argv,
-	    "46DdEe:hI:i:jklnO:oP:p:rSs:tT:UuV:vw:X:x:z",
+	    "46DdEe:hI:i:jklnoO:P:p:rSs:tT:UuV:vw:X:x:z",
 	    longopts, NULL)) != -1) {
 		switch (ch) {
 		case '4':
@@ -214,7 +212,7 @@ main(int argc, char *argv[])
 			nflag = 1;
 			break;
 		case 'o':
-			oflag = 1;
+			fprintf(stderr, "option -o is deprecated.\n");
 			break;
 		case 'P':
 			Pflag = optarg;
@@ -282,8 +280,6 @@ main(int argc, char *argv[])
 		case 'T':
 			Tflag = parse_iptos(optarg);
 			break;
-		case 0:
-			break;
 		default:
 			usage(1);
 		}
@@ -455,8 +451,10 @@ main(int argc, char *argv[])
 					    uflag ? "udp" : "tcp");
 				}
 
-				printf("Connection to %s %s port [%s/%s] succeeded!\n",
-				    host, portlist[i], uflag ? "udp" : "tcp",
+				fprintf(stderr,
+				    "Connection to %s %s port [%s/%s] "
+				    "succeeded!\n", host, portlist[i],
+				    uflag ? "udp" : "tcp",
 				    sv ? sv->s_name : "*");
 			}
 			if (!zflag)
@@ -572,10 +570,8 @@ remote_connect(const char *host, const c
 		if (sflag || pflag) {
 			struct addrinfo ahints, *ares;
 
-#ifdef SO_BINDANY
-			/* try SO_BINDANY, but don't insist */
-			setsockopt(s, SOL_SOCKET, SO_BINDANY, &on, sizeof(on));
-#endif
+			/* try IP_BINDANY, but don't insist */
+			setsockopt(s, IPPROTO_IP, IP_BINDANY, &on, sizeof(on));
 			memset(&ahints, 0, sizeof(struct addrinfo));
 			ahints.ai_family = res0->ai_family;
 			ahints.ai_socktype = uflag ? SOCK_DGRAM : SOCK_STREAM;
@@ -727,10 +723,9 @@ readwrite(int nfd)
 		}
 
 		if (!dflag && pfd[1].revents & POLLIN) {
-			if ((n = read(wfd, buf, plen)) < 0 ||
-			    (oflag && n == 0)) {
+			if ((n = read(wfd, buf, plen)) < 0)
 				return;
-			} else if (n == 0) {
+			else if (n == 0) {
 				shutdown(nfd, SHUT_WR);
 				pfd[1].fd = -1;
 				pfd[1].events = 0;
@@ -749,27 +744,27 @@ atelnet(int nfd, unsigned char *buf, uns
 	unsigned char *p, *end;
 	unsigned char obuf[4];
 
-	end = buf + size;
-	obuf[0] = '\0';
+	if (size < 3)
+		return;
+	end = buf + size - 2;
 
 	for (p = buf; p < end; p++) {
 		if (*p != IAC)
-			break;
+			continue;
 
 		obuf[0] = IAC;
 		p++;
 		if ((*p == WILL) || (*p == WONT))
 			obuf[1] = DONT;
-		if ((*p == DO) || (*p == DONT))
+		else if ((*p == DO) || (*p == DONT))
 			obuf[1] = WONT;
-		if (obuf) {
-			p++;
-			obuf[2] = *p;
-			obuf[3] = '\0';
-			if (atomicio(vwrite, nfd, obuf, 3) != 3)
-				warn("Write Error!");
-			obuf[0] = '\0';
-		}
+		else
+			continue;
+
+		p++;
+		obuf[2] = *p;
+		if (atomicio(vwrite, nfd, obuf, 3) != 3)
+			warn("Write Error!");
 	}
 }
 
@@ -943,7 +938,6 @@ help(void)
 	\t-n		Suppress name/port resolutions\n\
 	\t--no-tcpopt	Disable TCP options\n\
 	\t-O length	TCP send buffer length\n\
-	\t-o		Terminate on EOF on input\n\
 	\t-P proxyuser\tUsername for proxy authentication\n\
 	\t-p port\t	Specify local port for remote connects\n\
 	\t-r		Randomize remote ports\n\
@@ -993,9 +987,9 @@ usage(int ret)
 {
 	fprintf(stderr,
 #ifdef IPSEC
-	    "usage: nc [-46DdEhklnorStUuvz] [-e policy] [-I length] [-i interval] [-O length]\n"
+	    "usage: nc [-46DdEhklnrStUuvz] [-e policy] [-I length] [-i interval] [-O length]\n"
 #else
-	    "usage: nc [-46DdhklnorStUuvz] [-I length] [-i interval] [-O length]\n"
+	    "usage: nc [-46DdhklnrStUuvz] [-I length] [-i interval] [-O length]\n"
 #endif
 	    "\t  [-P proxy_username] [-p source_port] [-s source_ip_address] [-T ToS]\n"
 	    "\t  [-V fib] [-w timeout] [-X proxy_protocol]\n"

From owner-svn-src-stable-8@FreeBSD.ORG  Thu Apr 22 00:29:37 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 545B8106566B;
	Thu, 22 Apr 2010 00:29:37 +0000 (UTC)
	(envelope-from delphij@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 2A93E8FC08;
	Thu, 22 Apr 2010 00:29:37 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3M0Tbe2014917;
	Thu, 22 Apr 2010 00:29:37 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3M0TbqW014916;
	Thu, 22 Apr 2010 00:29:37 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201004220029.o3M0TbqW014916@svn.freebsd.org>
From: Xin LI 
Date: Thu, 22 Apr 2010 00:29:37 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r207042 - stable/8/contrib/netcat
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Thu, 22 Apr 2010 00:29:37 -0000

Author: delphij
Date: Thu Apr 22 00:29:36 2010
New Revision: 207042
URL: http://svn.freebsd.org/changeset/base/207042

Log:
  Remove a file that is not supposed to be part of -STABLE branch.

Deleted:
  stable/8/contrib/netcat/FREEBSD-Xlist

From owner-svn-src-stable-8@FreeBSD.ORG  Thu Apr 22 01:39:45 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 89C1C106566C;
	Thu, 22 Apr 2010 01:39:45 +0000 (UTC)
	(envelope-from yongari@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 5F95A8FC15;
	Thu, 22 Apr 2010 01:39:45 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3M1djZV030379;
	Thu, 22 Apr 2010 01:39:45 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3M1djYI030376;
	Thu, 22 Apr 2010 01:39:45 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <201004220139.o3M1djYI030376@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Thu, 22 Apr 2010 01:39:45 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r207046 - stable/8/sys/dev/mii
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Thu, 22 Apr 2010 01:39:45 -0000

Author: yongari
Date: Thu Apr 22 01:39:45 2010
New Revision: 207046
URL: http://svn.freebsd.org/changeset/base/207046

Log:
  MFC r206563:
    Add Agere ET1011 PHY which is found on Belkin F5D5055 USB
    controller. Unlike Agere ET1011C, Agere ET1011 does not seem to
    need special DSP programming to workaround silicon bug.

Modified:
  stable/8/sys/dev/mii/miidevs
  stable/8/sys/dev/mii/truephy.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/dev/mii/miidevs
==============================================================================
--- stable/8/sys/dev/mii/miidevs	Thu Apr 22 01:12:28 2010	(r207045)
+++ stable/8/sys/dev/mii/miidevs	Thu Apr 22 01:39:45 2010	(r207046)
@@ -109,6 +109,7 @@ oui xxREALTEK			0x000732
  */
 
 /* Agere Systems PHYs */
+model AGERE ET1011		0x0001 ET1011 10/100/1000baseT PHY
 model AGERE ET1011C		0x0004 ET1011C 10/100/1000baseT PHY
 
 /* Altima Communications PHYs */

Modified: stable/8/sys/dev/mii/truephy.c
==============================================================================
--- stable/8/sys/dev/mii/truephy.c	Thu Apr 22 01:12:28 2010	(r207045)
+++ stable/8/sys/dev/mii/truephy.c	Thu Apr 22 01:39:45 2010	(r207046)
@@ -76,6 +76,7 @@ static device_method_t truephy_methods[]
 };
 
 static const struct mii_phydesc truephys[] = {
+	MII_PHY_DESC(AGERE,	ET1011),
 	MII_PHY_DESC(AGERE,	ET1011C),
 	MII_PHY_END
 };
@@ -161,7 +162,10 @@ truephy_attach(device_t dev)
 
 	mii->mii_instance++;
 
-	truephy_reset(sc);
+	if (MII_MODEL(ma->mii_id2) == MII_MODEL_AGERE_ET1011)
+		mii_phy_reset(sc);
+	else
+		truephy_reset(sc);
 
 	sc->mii_capabilities = PHY_READ(sc, MII_BMSR) & ma->mii_capmask;
 	if (sc->mii_capabilities & BMSR_EXTSTAT) {

From owner-svn-src-stable-8@FreeBSD.ORG  Thu Apr 22 11:46:42 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A6540106566B;
	Thu, 22 Apr 2010 11:46:42 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 957FA8FC15;
	Thu, 22 Apr 2010 11:46:42 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3MBkgIs066839;
	Thu, 22 Apr 2010 11:46:42 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3MBkg1h066837;
	Thu, 22 Apr 2010 11:46:42 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201004221146.o3MBkg1h066837@svn.freebsd.org>
From: Andriy Gapon 
Date: Thu, 22 Apr 2010 11:46:42 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r207059 - stable/8/sys/cam/scsi
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Thu, 22 Apr 2010 11:46:42 -0000

Author: avg
Date: Thu Apr 22 11:46:42 2010
New Revision: 207059
URL: http://svn.freebsd.org/changeset/base/207059

Log:
  MFC r206648,206651: scsi_cd: CD_FLAG_VALID_MEDIA is sufficient to set
  d_sectorsize and d_mediasize
  
  PR:		kern/138789

Modified:
  stable/8/sys/cam/scsi/scsi_cd.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/cam/scsi/scsi_cd.c
==============================================================================
--- stable/8/sys/cam/scsi/scsi_cd.c	Thu Apr 22 09:30:02 2010	(r207058)
+++ stable/8/sys/cam/scsi/scsi_cd.c	Thu Apr 22 11:46:42 2010	(r207059)
@@ -2777,8 +2777,12 @@ cdcheckmedia(struct cam_periph *periph)
 		softc->flags &= ~(CD_FLAG_VALID_MEDIA|CD_FLAG_VALID_TOC);
 		cdprevent(periph, PR_ALLOW);
 		return (error);
-	} else
+	} else {
 		softc->flags |= CD_FLAG_VALID_MEDIA;
+		softc->disk->d_sectorsize = softc->params.blksize;
+		softc->disk->d_mediasize =
+		    (off_t)softc->params.blksize * softc->params.disksize;
+	}
 
 	/*
 	 * Now we check the table of contents.  This (currently) is only
@@ -2867,9 +2871,6 @@ cdcheckmedia(struct cam_periph *periph)
 	}
 
 	softc->flags |= CD_FLAG_VALID_TOC;
-	softc->disk->d_sectorsize = softc->params.blksize;
-	softc->disk->d_mediasize =
-	    (off_t)softc->params.blksize * softc->params.disksize;
 
 bailout:
 

From owner-svn-src-stable-8@FreeBSD.ORG  Thu Apr 22 12:24:59 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 81E3C106566B;
	Thu, 22 Apr 2010 12:24:59 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 71A928FC0A;
	Thu, 22 Apr 2010 12:24:59 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3MCOxP6075380;
	Thu, 22 Apr 2010 12:24:59 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3MCOxcW075378;
	Thu, 22 Apr 2010 12:24:59 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201004221224.o3MCOxcW075378@svn.freebsd.org>
From: Andriy Gapon 
Date: Thu, 22 Apr 2010 12:24:59 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r207061 - stable/8/sys/geom
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Thu, 22 Apr 2010 12:24:59 -0000

Author: avg
Date: Thu Apr 22 12:24:59 2010
New Revision: 207061
URL: http://svn.freebsd.org/changeset/base/207061

Log:
  MFC r206650: g_io_check: respond to zero pp->mediasize with ENXIO

Modified:
  stable/8/sys/geom/geom_io.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/geom/geom_io.c
==============================================================================
--- stable/8/sys/geom/geom_io.c	Thu Apr 22 12:12:52 2010	(r207060)
+++ stable/8/sys/geom/geom_io.c	Thu Apr 22 12:24:59 2010	(r207061)
@@ -309,8 +309,8 @@ g_io_check(struct bio *bp)
 	case BIO_READ:
 	case BIO_WRITE:
 	case BIO_DELETE:
-		/* Zero sectorsize is a probably lack of media */
-		if (pp->sectorsize == 0)
+		/* Zero sectorsize or mediasize is probably a lack of media. */
+		if (pp->sectorsize == 0 || pp->mediasize == 0)
 			return (ENXIO);
 		/* Reject I/O not on sector boundary */
 		if (bp->bio_offset % pp->sectorsize)

From owner-svn-src-stable-8@FreeBSD.ORG  Thu Apr 22 12:51:55 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7A6BD1065672;
	Thu, 22 Apr 2010 12:51:55 +0000 (UTC) (envelope-from avg@freebsd.org)
Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140])
	by mx1.freebsd.org (Postfix) with ESMTP id 21A878FC20;
	Thu, 22 Apr 2010 12:51:53 +0000 (UTC)
Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua
	[212.40.38.101])
	by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id PAA05178;
	Thu, 22 Apr 2010 15:51:52 +0300 (EEST)
	(envelope-from avg@freebsd.org)
Message-ID: <4BD04667.6020903@freebsd.org>
Date: Thu, 22 Apr 2010 15:51:51 +0300
From: Andriy Gapon 
User-Agent: Thunderbird 2.0.0.24 (X11/20100319)
MIME-Version: 1.0
To: src-committers@freebsd.org
References: <201004221224.o3MCOxcW075378@svn.freebsd.org>
In-Reply-To: <201004221224.o3MCOxcW075378@svn.freebsd.org>
X-Enigmail-Version: 0.95.7
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable-8@freebsd.org
Subject: Re: svn commit: r207061 - stable/8/sys/geom
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Thu, 22 Apr 2010 12:51:55 -0000

on 22/04/2010 15:24 Andriy Gapon said the following:
> Author: avg
> Date: Thu Apr 22 12:24:59 2010
> New Revision: 207061
> URL: http://svn.freebsd.org/changeset/base/207061
> 
> Log:
>   MFC r206650: g_io_check: respond to zero pp->mediasize with ENXIO
> 
> Modified:
>   stable/8/sys/geom/geom_io.c
> Directory Properties:
>   stable/8/sys/   (props changed)
>   stable/8/sys/amd64/include/xen/   (props changed)
>   stable/8/sys/cddl/contrib/opensolaris/   (props changed)
>   stable/8/sys/contrib/dev/acpica/   (props changed)
>   stable/8/sys/contrib/pf/   (props changed)
>   stable/8/sys/dev/xen/xenpci/   (props changed)
>   stable/8/sys/geom/sched/   (props changed)
             ^^^^^^^^^^^^^^^
I am not sure where the above came from and if its mergeinfo can be pushed up to sys.

-- 
Andriy Gapon

From owner-svn-src-stable-8@FreeBSD.ORG  Thu Apr 22 13:16:18 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8B271106566B;
	Thu, 22 Apr 2010 13:16:18 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 7AE6C8FC29;
	Thu, 22 Apr 2010 13:16:18 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3MDGI5c086895;
	Thu, 22 Apr 2010 13:16:18 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3MDGIPF086893;
	Thu, 22 Apr 2010 13:16:18 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201004221316.o3MDGIPF086893@svn.freebsd.org>
From: Andriy Gapon 
Date: Thu, 22 Apr 2010 13:16:18 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r207063 - stable/8/usr.bin/indent
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Thu, 22 Apr 2010 13:16:18 -0000

Author: avg
Date: Thu Apr 22 13:16:18 2010
New Revision: 207063
URL: http://svn.freebsd.org/changeset/base/207063

Log:
  MFC r206687: indent(1): don't treat bare '_t' as a type name with -ta

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

Modified: stable/8/usr.bin/indent/lexi.c
==============================================================================
--- stable/8/usr.bin/indent/lexi.c	Thu Apr 22 12:50:01 2010	(r207062)
+++ stable/8/usr.bin/indent/lexi.c	Thu Apr 22 13:16:18 2010	(r207063)
@@ -251,9 +251,10 @@ lexi(void)
 
 	if (auto_typedefs) {
 	    const char *q = s_token;
+	    size_t q_len = strlen(q);
 	    /* Check if we have an "_t" in the end */
-	    if (q[0] && q[1] &&
-	        (strcmp(q + strlen(q) - 2, "_t") == 0)) {
+	    if (q_len > 2 &&
+	        (strcmp(q + q_len - 2, "_t") == 0)) {
 	        ps.its_a_keyword = true;
 		ps.last_u_d = true;
 	        goto found_auto_typedef;

From owner-svn-src-stable-8@FreeBSD.ORG  Thu Apr 22 14:11:59 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6C2B21065675;
	Thu, 22 Apr 2010 14:11:59 +0000 (UTC)
	(envelope-from nwhitehorn@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 5B4DD8FC27;
	Thu, 22 Apr 2010 14:11:59 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3MEBxDX099221;
	Thu, 22 Apr 2010 14:11:59 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Received: (from nwhitehorn@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3MEBxus099219;
	Thu, 22 Apr 2010 14:11:59 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Message-Id: <201004221411.o3MEBxus099219@svn.freebsd.org>
From: Nathan Whitehorn 
Date: Thu, 22 Apr 2010 14:11:59 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r207064 - stable/8/contrib/top
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Thu, 22 Apr 2010 14:11:59 -0000

Author: nwhitehorn
Date: Thu Apr 22 14:11:59 2010
New Revision: 207064
URL: http://svn.freebsd.org/changeset/base/207064

Log:
  MFC r206842:
  
  Fix brokenness in top on big-endian 32-bit systems introduced when
  changing format_k2 to take a long long. Because itoa is defined as a K&R
  C function, without prototyping its arguments, format_k2 passed a 64-bit
  value, but itoa() received only the first word, showing '0' in all memory
  fields.

Modified:
  stable/8/contrib/top/utils.c
Directory Properties:
  stable/8/contrib/top/   (props changed)
  stable/8/contrib/top/install-sh   (props changed)

Modified: stable/8/contrib/top/utils.c
==============================================================================
--- stable/8/contrib/top/utils.c	Thu Apr 22 13:16:18 2010	(r207063)
+++ stable/8/contrib/top/utils.c	Thu Apr 22 14:11:59 2010	(r207064)
@@ -499,7 +499,7 @@ unsigned long long amt;
 	}
     }
 
-    p = strecpy(p, itoa(amt));
+    p = strecpy(p, itoa((int)amt));
     *p++ = tag;
     *p = '\0';
 

From owner-svn-src-stable-8@FreeBSD.ORG  Thu Apr 22 14:13:12 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 718C61065672;
	Thu, 22 Apr 2010 14:13:12 +0000 (UTC)
	(envelope-from nwhitehorn@freebsd.org)
Received: from argol.doit.wisc.edu (argol.doit.wisc.edu [144.92.197.212])
	by mx1.freebsd.org (Postfix) with ESMTP id 3C3468FC1F;
	Thu, 22 Apr 2010 14:13:12 +0000 (UTC)
MIME-version: 1.0
Content-transfer-encoding: 7BIT
Content-type: text/plain; CHARSET=US-ASCII; format=flowed
Received: from avs-daemon.smtpauth3.wiscmail.wisc.edu by
	smtpauth3.wiscmail.wisc.edu
	(Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30
	2009)) id <0L1A00G1C7HZO500@smtpauth3.wiscmail.wisc.edu>; Thu,
	22 Apr 2010 09:13:11 -0500 (CDT)
Received: from comporellon.tachypleus.net ([unknown] [76.210.66.137])
	by smtpauth3.wiscmail.wisc.edu
	(Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30
	2009))
	with ESMTPSA id <0L1A00CPJ7HVO160@smtpauth3.wiscmail.wisc.edu>; Thu,
	22 Apr 2010 09:13:08 -0500 (CDT)
Date: Thu, 22 Apr 2010 09:13:03 -0500
From: Nathan Whitehorn 
In-reply-to: <201004211801.59151.bruce@cran.org.uk>
To: Bruce Cran 
Message-id: <4BD0596F.7060209@freebsd.org>
X-Spam-Report: AuthenticatedSender=yes, SenderIP=76.210.66.137
X-Spam-PmxInfo: Server=avs-11, Version=5.5.5.374460,
	Antispam-Engine: 2.7.1.369594, Antispam-Data: 2010.4.22.140615,
	SenderIP=76.210.66.137
References: <201004202019.o3KKJJih033338@svn.freebsd.org>
	<20100420210208.GA2422@deviant.kiev.zoral.com.ua>
	<201004211801.59151.bruce@cran.org.uk>
User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.1.9)
	Gecko/20100407 Thunderbird/3.0.4
Cc: src-committers@freebsd.org, svn-src-stable@freebsd.org,
	svn-src-all@freebsd.org, svn-src-stable-8@freebsd.org,
	Bruce Cran , Kostik Belousov 
Subject: Re: svn commit: r206911 - stable/8/contrib/top
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Thu, 22 Apr 2010 14:13:12 -0000

On 04/21/10 12:01, Bruce Cran wrote:
> On Tuesday 20 April 2010 22:02:08 Kostik Belousov wrote:
>    
>> On Tue, Apr 20, 2010 at 08:19:19PM +0000, Bruce Cran wrote:
>>      
>>> Author: brucec
>>> Date: Tue Apr 20 20:19:19 2010
>>> New Revision: 206911
>>> URL: http://svn.freebsd.org/changeset/base/206911
>>>
>>> Log:
>>>    MFC r205119 and r206056:
>>>
>>>    Prevent the SIZE field being corrupted when a process allocates more
>>>    than 2TB.
>>>
>>>    PR:	bin/129706
>>>    Submitted by:	brucec
>>>    Approved by: 	rrs (mentor)
>>>        
>> Am I right that this change contains a bug that was fixed by r206842 ?
>> If yes, why is it merged as is ?
>>      
> Yes, it looks like it does have a bug. I was unaware of it when I did the
> merge.
>    

I have MFC'ed the bug fix. There's a possibility it is still broken on 
32-bit big-endian MIPS, which I hope to check up on soon.
-Nathan


From owner-svn-src-stable-8@FreeBSD.ORG  Fri Apr 23 00:12:23 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CE08E106564A;
	Fri, 23 Apr 2010 00:12:23 +0000 (UTC)
	(envelope-from rmacklem@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id BB6F98FC12;
	Fri, 23 Apr 2010 00:12:23 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3N0CNKx033897;
	Fri, 23 Apr 2010 00:12:23 GMT
	(envelope-from rmacklem@svn.freebsd.org)
Received: (from rmacklem@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3N0CNiZ033891;
	Fri, 23 Apr 2010 00:12:23 GMT
	(envelope-from rmacklem@svn.freebsd.org)
Message-Id: <201004230012.o3N0CNiZ033891@svn.freebsd.org>
From: Rick Macklem 
Date: Fri, 23 Apr 2010 00:12:23 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r207085 - in stable/8/sys/fs: nfs nfsclient
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Fri, 23 Apr 2010 00:12:24 -0000

Author: rmacklem
Date: Fri Apr 23 00:12:23 2010
New Revision: 207085
URL: http://svn.freebsd.org/changeset/base/207085

Log:
  MFC: r206688
  The experimental NFS client was not filling in recovery credentials
  for opens done locally in the client when a delegation for the file
  was held. This could cause the client to crash in crsetgroups() when
  recovering from a server crash/reboot. This patch fills in the
  recovery credentials for this case, in order to avoid the client crash.
  Also, add KASSERT()s to the credential copy functions, to catch any
  other cases where the credentials aren't filled in correctly.

Modified:
  stable/8/sys/fs/nfs/nfs_commonport.c
  stable/8/sys/fs/nfs/nfsclstate.h
  stable/8/sys/fs/nfsclient/nfs_clport.c
  stable/8/sys/fs/nfsclient/nfs_clrpcops.c
  stable/8/sys/fs/nfsclient/nfs_clstate.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/fs/nfs/nfs_commonport.c
==============================================================================
--- stable/8/sys/fs/nfs/nfs_commonport.c	Fri Apr 23 00:11:38 2010	(r207084)
+++ stable/8/sys/fs/nfs/nfs_commonport.c	Fri Apr 23 00:12:23 2010	(r207085)
@@ -225,6 +225,8 @@ void
 newnfs_copycred(struct nfscred *nfscr, struct ucred *cr)
 {
 
+	KASSERT(nfscr->nfsc_ngroups >= 0,
+	    ("newnfs_copycred: negative nfsc_ngroups"));
 	cr->cr_uid = nfscr->nfsc_uid;
 	crsetgroups(cr, nfscr->nfsc_ngroups, nfscr->nfsc_groups);
 }

Modified: stable/8/sys/fs/nfs/nfsclstate.h
==============================================================================
--- stable/8/sys/fs/nfs/nfsclstate.h	Fri Apr 23 00:11:38 2010	(r207084)
+++ stable/8/sys/fs/nfs/nfsclstate.h	Fri Apr 23 00:12:23 2010	(r207085)
@@ -140,6 +140,7 @@ struct nfsclopen {
 #define	NFSCLOPEN_OK		0
 #define	NFSCLOPEN_DOOPEN	1
 #define	NFSCLOPEN_DOOPENDOWNGRADE 2
+#define	NFSCLOPEN_SETCRED	3
 
 struct nfscllockowner {
 	LIST_ENTRY(nfscllockowner) nfsl_list;

Modified: stable/8/sys/fs/nfsclient/nfs_clport.c
==============================================================================
--- stable/8/sys/fs/nfsclient/nfs_clport.c	Fri Apr 23 00:11:38 2010	(r207084)
+++ stable/8/sys/fs/nfsclient/nfs_clport.c	Fri Apr 23 00:12:23 2010	(r207085)
@@ -978,6 +978,8 @@ newnfs_copyincred(struct ucred *cr, stru
 {
 	int i;
 
+	KASSERT(cr->cr_ngroups >= 0,
+	    ("newnfs_copyincred: negative cr_ngroups"));
 	nfscr->nfsc_uid = cr->cr_uid;
 	nfscr->nfsc_ngroups = MIN(cr->cr_ngroups, NFS_MAXGRPS + 1);
 	for (i = 0; i < nfscr->nfsc_ngroups; i++)

Modified: stable/8/sys/fs/nfsclient/nfs_clrpcops.c
==============================================================================
--- stable/8/sys/fs/nfsclient/nfs_clrpcops.c	Fri Apr 23 00:11:38 2010	(r207084)
+++ stable/8/sys/fs/nfsclient/nfs_clrpcops.c	Fri Apr 23 00:12:23 2010	(r207085)
@@ -280,7 +280,13 @@ else printf(" fhl=0\n");
 			error = EIO;
 		}
 		newnfs_copyincred(cred, &op->nfso_cred);
-	    }
+	    } else if (ret == NFSCLOPEN_SETCRED)
+		/*
+		 * This is a new local open on a delegation. It needs
+		 * to have credentials so that an open can be done
+		 * against the server during recovery.
+		 */
+		newnfs_copyincred(cred, &op->nfso_cred);
 
 	    /*
 	     * nfso_opencnt is the count of how many VOP_OPEN()s have

Modified: stable/8/sys/fs/nfsclient/nfs_clstate.c
==============================================================================
--- stable/8/sys/fs/nfsclient/nfs_clstate.c	Fri Apr 23 00:11:38 2010	(r207084)
+++ stable/8/sys/fs/nfsclient/nfs_clstate.c	Fri Apr 23 00:12:23 2010	(r207085)
@@ -274,8 +274,13 @@ nfscl_open(vnode_t vp, u_int8_t *nfhp, i
 		*owpp = owp;
 	if (opp != NULL)
 		*opp = op;
-	if (retp != NULL)
-		*retp = NFSCLOPEN_OK;
+	if (retp != NULL) {
+		if (nfhp != NULL && dp != NULL && nop == NULL)
+			/* new local open on delegation */
+			*retp = NFSCLOPEN_SETCRED;
+		else
+			*retp = NFSCLOPEN_OK;
+	}
 
 	/*
 	 * Now, check the mode on the open and return the appropriate

From owner-svn-src-stable-8@FreeBSD.ORG  Fri Apr 23 00:34:59 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id F12F2106566B;
	Fri, 23 Apr 2010 00:34:59 +0000 (UTC)
	(envelope-from rmacklem@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id DBD788FC2D;
	Fri, 23 Apr 2010 00:34:59 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3N0Yxhf039000;
	Fri, 23 Apr 2010 00:34:59 GMT
	(envelope-from rmacklem@svn.freebsd.org)
Received: (from rmacklem@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3N0YxAp038998;
	Fri, 23 Apr 2010 00:34:59 GMT
	(envelope-from rmacklem@svn.freebsd.org)
Message-Id: <201004230034.o3N0YxAp038998@svn.freebsd.org>
From: Rick Macklem 
Date: Fri, 23 Apr 2010 00:34:59 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r207086 - stable/8/sys/fs/nfsclient
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Fri, 23 Apr 2010 00:35:00 -0000

Author: rmacklem
Date: Fri Apr 23 00:34:59 2010
New Revision: 207086
URL: http://svn.freebsd.org/changeset/base/207086

Log:
  MFC: r206690
  Add mutex lock calls to 2 cases in the experimental NFS client's
  renew thread where they were missing.

Modified:
  stable/8/sys/fs/nfsclient/nfs_clstate.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/fs/nfsclient/nfs_clstate.c
==============================================================================
--- stable/8/sys/fs/nfsclient/nfs_clstate.c	Fri Apr 23 00:12:23 2010	(r207085)
+++ stable/8/sys/fs/nfsclient/nfs_clstate.c	Fri Apr 23 00:34:59 2010	(r207086)
@@ -2318,7 +2318,9 @@ nfscl_renewthread(struct nfsclclient *cl
 	int error, cbpathdown, islept, igotlock, ret, clearok;
 
 	cred = newnfs_getcred();
+	NFSLOCKCLSTATE();
 	clp->nfsc_flags |= NFSCLFLAGS_HASTHREAD;
+	NFSUNLOCKCLSTATE();
 	for(;;) {
 		newnfs_setroot(cred);
 		cbpathdown = 0;
@@ -2331,9 +2333,11 @@ nfscl_renewthread(struct nfsclclient *cl
 			error = nfsrpc_renew(clp, cred, p);
 			if (error == NFSERR_CBPATHDOWN)
 			    cbpathdown = 1;
-			else if (error == NFSERR_STALECLIENTID)
+			else if (error == NFSERR_STALECLIENTID) {
+			    NFSLOCKCLSTATE();
 			    clp->nfsc_flags |= NFSCLFLAGS_RECOVER;
-			else if (error == NFSERR_EXPIRED)
+			    NFSUNLOCKCLSTATE();
+			} else if (error == NFSERR_EXPIRED)
 			    (void) nfscl_hasexpired(clp, clidrev, p);
 		}
 

From owner-svn-src-stable-8@FreeBSD.ORG  Fri Apr 23 15:24:57 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 414781065676;
	Fri, 23 Apr 2010 15:24:57 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 2F4AD8FC12;
	Fri, 23 Apr 2010 15:24:57 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3NFOvQt037762;
	Fri, 23 Apr 2010 15:24:57 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3NFOvT7037759;
	Fri, 23 Apr 2010 15:24:57 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201004231524.o3NFOvT7037759@svn.freebsd.org>
From: Andriy Gapon 
Date: Fri, 23 Apr 2010 15:24:57 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r207119 - in stable/8: etc/mtree share/examples
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Fri, 23 Apr 2010 15:24:57 -0000

Author: avg
Date: Fri Apr 23 15:24:56 2010
New Revision: 207119
URL: http://svn.freebsd.org/changeset/base/207119

Log:
  MFC r206996: indent.pro example: actually install the sample file

Modified:
  stable/8/etc/mtree/BSD.usr.dist
  stable/8/share/examples/Makefile
Directory Properties:
  stable/8/etc/   (props changed)
  stable/8/share/examples/   (props changed)

Modified: stable/8/etc/mtree/BSD.usr.dist
==============================================================================
--- stable/8/etc/mtree/BSD.usr.dist	Fri Apr 23 14:48:30 2010	(r207118)
+++ stable/8/etc/mtree/BSD.usr.dist	Fri Apr 23 15:24:56 2010	(r207119)
@@ -217,6 +217,8 @@
             ..
             ibcs2
             ..
+            indent
+            ..
             ipfilter
             ..
             ipfw

Modified: stable/8/share/examples/Makefile
==============================================================================
--- stable/8/share/examples/Makefile	Fri Apr 23 14:48:30 2010	(r207118)
+++ stable/8/share/examples/Makefile	Fri Apr 23 15:24:56 2010	(r207119)
@@ -15,6 +15,7 @@ LDIRS=	BSD_daemon \
 	find_interface \
 	hast \
 	ibcs2 \
+	indent \
 	ipfw \
 	kld \
 	libvgl \
@@ -77,6 +78,7 @@ XFILES=	BSD_daemon/FreeBSD.pfa \
 	hast/vip-up.sh \
 	ibcs2/README \
 	ibcs2/hello.uu \
+	indent/indent.pro \
 	ipfw/change_rules.sh \
 	kld/Makefile \
 	kld/cdev/Makefile \

From owner-svn-src-stable-8@FreeBSD.ORG  Fri Apr 23 16:20:45 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B7F8B106566C;
	Fri, 23 Apr 2010 16:20:45 +0000 (UTC)
	(envelope-from mjacob@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A5C4A8FC17;
	Fri, 23 Apr 2010 16:20:45 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3NGKje2050310;
	Fri, 23 Apr 2010 16:20:45 GMT (envelope-from mjacob@svn.freebsd.org)
Received: (from mjacob@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3NGKjoL050308;
	Fri, 23 Apr 2010 16:20:45 GMT (envelope-from mjacob@svn.freebsd.org)
Message-Id: <201004231620.o3NGKjoL050308@svn.freebsd.org>
From: Matt Jacob 
Date: Fri, 23 Apr 2010 16:20:45 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r207122 - stable/8/sbin/geom/class/multipath
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Fri, 23 Apr 2010 16:20:45 -0000

Author: mjacob
Date: Fri Apr 23 16:20:45 2010
New Revision: 207122
URL: http://svn.freebsd.org/changeset/base/207122

Log:
  This is an MFS of 205412.
  
  Add 'rotate' and 'getactive' verbs to provide some control and information
  about what the currently active path is.

Modified:
  stable/8/sbin/geom/class/multipath/geom_multipath.c
Directory Properties:
  stable/8/sbin/geom/   (props changed)
  stable/8/sbin/geom/class/stripe/   (props changed)

Modified: stable/8/sbin/geom/class/multipath/geom_multipath.c
==============================================================================
--- stable/8/sbin/geom/class/multipath/geom_multipath.c	Fri Apr 23 16:13:09 2010	(r207121)
+++ stable/8/sbin/geom/class/multipath/geom_multipath.c	Fri Apr 23 16:20:45 2010	(r207122)
@@ -62,6 +62,14 @@ struct g_command class_commands[] = {
 		"clear", G_FLAG_VERBOSE, mp_main, G_NULL_OPTS,
 		NULL, "[-v] prov ..."
 	},
+	{
+		"rotate", G_FLAG_VERBOSE, NULL, G_NULL_OPTS,
+		NULL, "[-v] prov ..."
+	},
+	{
+		"getactive", G_FLAG_VERBOSE, NULL, G_NULL_OPTS,
+		NULL, "[-v] prov ..."
+	},
 	G_CMD_SENTINEL
 };
 

From owner-svn-src-stable-8@FreeBSD.ORG  Fri Apr 23 16:26:11 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 04258106568B;
	Fri, 23 Apr 2010 16:26:11 +0000 (UTC)
	(envelope-from mjacob@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E365E8FC13;
	Fri, 23 Apr 2010 16:26:10 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3NGQAZX051664;
	Fri, 23 Apr 2010 16:26:10 GMT (envelope-from mjacob@svn.freebsd.org)
Received: (from mjacob@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3NGQAFo051662;
	Fri, 23 Apr 2010 16:26:10 GMT (envelope-from mjacob@svn.freebsd.org)
Message-Id: <201004231626.o3NGQAFo051662@svn.freebsd.org>
From: Matt Jacob 
Date: Fri, 23 Apr 2010 16:26:10 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r207124 - stable/8/sys/geom/multipath
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Fri, 23 Apr 2010 16:26:11 -0000

Author: mjacob
Date: Fri Apr 23 16:26:10 2010
New Revision: 207124
URL: http://svn.freebsd.org/changeset/base/207124

Log:
  This is an MFC of 205412.
  
  Add 'rotate' and 'getactive' verbs to provide some control and information
  about what the currently active path is.

Modified:
  stable/8/sys/geom/multipath/g_multipath.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/geom/multipath/g_multipath.c
==============================================================================
--- stable/8/sys/geom/multipath/g_multipath.c	Fri Apr 23 16:21:40 2010	(r207123)
+++ stable/8/sys/geom/multipath/g_multipath.c	Fri Apr 23 16:26:10 2010	(r207124)
@@ -70,6 +70,8 @@ static int g_multipath_destroy(struct g_
 static int
 g_multipath_destroy_geom(struct gctl_req *, struct g_class *, struct g_geom *);
 
+static int g_multipath_rotate(struct g_geom *);
+
 static g_taste_t g_multipath_taste;
 static g_ctl_req_t g_multipath_config;
 static g_init_t g_multipath_init;
@@ -417,6 +419,30 @@ g_multipath_destroy_geom(struct gctl_req
 	return (g_multipath_destroy(gp));
 }
 
+static int
+g_multipath_rotate(struct g_geom *gp)
+{
+	struct g_consumer *lcp;
+	struct g_multipath_softc *sc = gp->softc;
+
+	g_topology_assert();
+	if (sc == NULL)
+		return (ENXIO);
+	LIST_FOREACH(lcp, &gp->consumer, consumer) {
+		if ((lcp->index & MP_BAD) == 0) {
+			if (sc->cp_active != lcp) {
+				break;
+			}
+		}
+	}
+	if (lcp) {
+		sc->cp_active = lcp;
+		printf("GEOM_MULTIPATH: %s now active path in %s\n",
+		    lcp->provider->name, sc->sc_name);
+	}
+	return (0);
+}
+
 static void
 g_multipath_init(struct g_class *mp)
 {
@@ -749,6 +775,63 @@ g_multipath_ctl_destroy(struct gctl_req 
 }
 
 static void
+g_multipath_ctl_rotate(struct gctl_req *req, struct g_class *mp)
+{
+	struct g_geom *gp;
+	const char *name;
+	int error;
+
+	g_topology_assert();
+
+	name = gctl_get_asciiparam(req, "arg0");
+        if (name == NULL) {
+                gctl_error(req, "No 'arg0' argument");
+                return;
+        }
+	gp = g_multipath_find_geom(mp, name);
+	if (gp == NULL) {
+		gctl_error(req, "Device %s is invalid", name);
+		return;
+	}
+	error = g_multipath_rotate(gp);
+	if (error != 0) {
+		gctl_error(req, "failed to rotate %s (err=%d)", name, error);
+	}
+}
+
+static void
+g_multipath_ctl_getactive(struct gctl_req *req, struct g_class *mp)
+{
+	struct sbuf *sb;
+	struct g_geom *gp;
+	struct g_multipath_softc *sc;
+	const char *name;
+
+	sb = sbuf_new_auto();
+
+	g_topology_assert();
+	name = gctl_get_asciiparam(req, "arg0");
+        if (name == NULL) {
+                gctl_error(req, "No 'arg0' argument");
+                return;
+        }
+	gp = g_multipath_find_geom(mp, name);
+	if (gp == NULL) {
+		gctl_error(req, "Device %s is invalid", name);
+		return;
+	}
+	sc = gp->softc;
+	if (sc->cp_active) {
+		sbuf_printf(sb, "%s\n", sc->cp_active->provider->name);
+	} else {
+		sbuf_printf(sb, "none\n");
+	}
+	sbuf_finish(sb);
+	gctl_set_param_err(req, "output", sbuf_data(sb), sbuf_len(sb) + 1);
+	sbuf_delete(sb);
+}
+
+static void
 g_multipath_config(struct gctl_req *req, struct g_class *mp, const char *verb)
 {
 	uint32_t *version;
@@ -762,6 +845,10 @@ g_multipath_config(struct gctl_req *req,
 		g_multipath_ctl_create(req, mp);
 	} else if (strcmp(verb, "destroy") == 0) {
 		g_multipath_ctl_destroy(req, mp);
+	} else if (strcmp(verb, "rotate") == 0) {
+		g_multipath_ctl_rotate(req, mp);
+	} else if (strcmp(verb, "getactive") == 0) {
+		g_multipath_ctl_getactive(req, mp);
 	} else {
 		gctl_error(req, "Unknown verb %s", verb);
 	}

From owner-svn-src-stable-8@FreeBSD.ORG  Fri Apr 23 16:49:18 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D8DF11065672;
	Fri, 23 Apr 2010 16:49:18 +0000 (UTC)
	(envelope-from mjacob@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C58088FC20;
	Fri, 23 Apr 2010 16:49:18 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3NGnIG8057065;
	Fri, 23 Apr 2010 16:49:18 GMT (envelope-from mjacob@svn.freebsd.org)
Received: (from mjacob@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3NGnIqa057063;
	Fri, 23 Apr 2010 16:49:18 GMT (envelope-from mjacob@svn.freebsd.org)
Message-Id: <201004231649.o3NGnIqa057063@svn.freebsd.org>
From: Matt Jacob 
Date: Fri, 23 Apr 2010 16:49:18 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r207126 - stable/8/sys/geom/multipath
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Fri, 23 Apr 2010 16:49:19 -0000

Author: mjacob
Date: Fri Apr 23 16:49:18 2010
New Revision: 207126
URL: http://svn.freebsd.org/changeset/base/207126

Log:
  This is an MFC of 205847, 204071 and 196580
  
  ------
  Change how multipath labels are created and managed. This makes it easier
  to support various storage boxes which really aren't active-active.
  
  We only write the label on the *first* provider. For all other providers
  we just "add" the disk. This also allows for an "add" verb.
  
  A usage implication is that you should specificy the currently active
  storage path as the first provider.
  
  Note that this does not add RDAC-like functionality, but better allows for
  autovolumefailover configurations (additional checkins elsewhere will support
  this).
  
  ------------------------------------------------------------------------
  
  - Style fixes.
  - Prefer strlcpy() over strncpy().
  
  ------------------------------------------------------------------------
  
  There's no need for checking result of M_WAITOK allocation.

Modified:
  stable/8/sys/geom/multipath/g_multipath.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/geom/multipath/g_multipath.c
==============================================================================
--- stable/8/sys/geom/multipath/g_multipath.c	Fri Apr 23 16:28:06 2010	(r207125)
+++ stable/8/sys/geom/multipath/g_multipath.c	Fri Apr 23 16:49:18 2010	(r207126)
@@ -97,9 +97,8 @@ g_mpd(void *arg, int flags __unused)
 
 	g_topology_assert();
 	cp = arg;
-	if (cp->acr > 0 || cp->acw > 0 || cp->ace > 0) {
+	if (cp->acr > 0 || cp->acw > 0 || cp->ace > 0)
 		g_access(cp, -cp->acr, -cp->acw, -cp->ace);
-	}
 	if (cp->provider) {
 		printf("GEOM_MULTIPATH: %s removed from %s\n",
 		    cp->provider->name, cp->geom->name);
@@ -224,15 +223,16 @@ g_multipath_done_error(struct bio *bp)
 static void
 g_multipath_kt(void *arg)
 {
+
 	g_multipath_kt_state = GKT_RUN;
 	mtx_lock(&gmtbq_mtx);
 	while (g_multipath_kt_state == GKT_RUN) {
 		for (;;) {
 			struct bio *bp;
+
 			bp = bioq_takefirst(&gmtbq);
-			if (bp == NULL) {
+			if (bp == NULL)
 				break;
-			}
 			mtx_unlock(&gmtbq_mtx);
 			g_multipath_done_error(bp);
 			mtx_lock(&gmtbq_mtx);
@@ -266,9 +266,8 @@ g_multipath_access(struct g_provider *pp
 
 fail:
 	LIST_FOREACH(cp, &gp->consumer, consumer) {
-		if (cp == badcp) {
+		if (cp == badcp)
 			break;
-		}
 		(void) g_access(cp, -dr, -dw, -de);
 	}
 	return (error);
@@ -292,15 +291,10 @@ g_multipath_create(struct g_class *mp, s
 	}
 
 	gp = g_new_geomf(mp, md->md_name);
-	if (gp == NULL) {
+	if (gp == NULL)
 		goto fail;
-	}
 
 	sc = g_malloc(sizeof(*sc), M_WAITOK | M_ZERO);
-	if (sc == NULL) {
-		goto fail;
-	}
-
 	gp->softc = sc;
 	gp->start = g_multipath_start;
 	gp->orphan = g_multipath_orphan;
@@ -309,9 +303,8 @@ g_multipath_create(struct g_class *mp, s
 	memcpy(sc->sc_name, md->md_name, sizeof (sc->sc_name));
 
 	pp = g_new_providerf(gp, "multipath/%s", md->md_name);
-	if (pp == NULL) {
+	if (pp == NULL)
 		goto fail;
-	}
 	/* limit the provider to not have it stomp on metadata */
 	pp->mediasize = md->md_size - md->md_sectorsize;
 	pp->sectorsize = md->md_sectorsize;
@@ -320,9 +313,8 @@ g_multipath_create(struct g_class *mp, s
 	return (gp);
 fail:
 	if (gp != NULL) {
-		if (gp->softc != NULL) {
+		if (gp->softc != NULL)
 			g_free(gp->softc);
-		}
 		g_destroy_geom(gp);
 	}
 	return (NULL);
@@ -344,9 +336,8 @@ g_multipath_add_disk(struct g_geom *gp, 
 	 * Make sure that the passed provider isn't already attached
 	 */
 	LIST_FOREACH(cp, &gp->consumer, consumer) {
-		if (cp->provider == pp) {
+		if (cp->provider == pp)
 			break;
-		}
 	}
 	if (cp) {
 		printf("GEOM_MULTIPATH: provider %s already attached to %s\n",
@@ -355,9 +346,8 @@ g_multipath_add_disk(struct g_geom *gp, 
 	}
 	nxtcp = LIST_FIRST(&gp->consumer);
 	cp = g_new_consumer(gp);
-	if (cp == NULL) {
+	if (cp == NULL)
 		return (ENOMEM);
-	}
 	error = g_attach(cp, pp);
 	if (error != 0) {
 		printf("GEOM_MULTIPATH: cannot attach %s to %s",
@@ -398,13 +388,11 @@ g_multipath_destroy(struct g_geom *gp)
 	struct g_provider *pp;
 
 	g_topology_assert();
-	if (gp->softc == NULL) {
+	if (gp->softc == NULL)
 		return (ENXIO);
-	}
 	pp = LIST_FIRST(&gp->provider);
-	if (pp != NULL && (pp->acr != 0 || pp->acw != 0 || pp->ace != 0)) {
+	if (pp != NULL && (pp->acr != 0 || pp->acw != 0 || pp->ace != 0))
 		return (EBUSY);
-	}
 	printf("GEOM_MULTIPATH: destroying %s\n", gp->name);
 	g_free(gp->softc);
 	gp->softc = NULL;
@@ -416,6 +404,7 @@ static int
 g_multipath_destroy_geom(struct gctl_req *req, struct g_class *mp,
     struct g_geom *gp)
 {
+
 	return (g_multipath_destroy(gp));
 }
 
@@ -448,9 +437,8 @@ g_multipath_init(struct g_class *mp)
 {
 	bioq_init(&gmtbq);
 	mtx_init(&gmtbq_mtx, "gmtbq", NULL, MTX_DEF);
-	if (kproc_create(g_multipath_kt, mp, NULL, 0, 0, "g_mp_kt") == 0) {
+	if (kproc_create(g_multipath_kt, mp, NULL, 0, 0, "g_mp_kt") == 0)
 		g_multipath_kt_state = GKT_RUN;
-	}
 }
 
 static void
@@ -476,18 +464,16 @@ g_multipath_read_metadata(struct g_consu
 
 	g_topology_assert();
 	error = g_access(cp, 1, 0, 0);
-	if (error != 0) {
+	if (error != 0)
 		return (error);
-	}
 	pp = cp->provider;
 	g_topology_unlock();
 	buf = g_read_data(cp, pp->mediasize - pp->sectorsize,
 	    pp->sectorsize, &error);
 	g_topology_lock();
 	g_access(cp, -1, 0, 0);
-	if (buf == NULL) {
+	if (buf == NULL)
 		return (error);
-	}
 	multipath_metadata_decode(buf, md);
 	g_free(buf);
 	return (0);
@@ -514,15 +500,13 @@ g_multipath_taste(struct g_class *mp, st
 	g_detach(cp);
 	g_destroy_consumer(cp);
 	g_destroy_geom(gp);
-	if (error != 0) {
+	if (error != 0)
 		return (NULL);
-	}
 	gp = NULL;
 
 	if (strcmp(md.md_magic, G_MULTIPATH_MAGIC) != 0) {
-		if (g_multipath_debug) {
+		if (g_multipath_debug)
 			printf("%s is not MULTIPATH\n", pp->name);
-		}
 		return (NULL);
 	}
 	if (md.md_version != G_MULTIPATH_VERSION) {
@@ -531,9 +515,8 @@ g_multipath_taste(struct g_class *mp, st
 		    G_MULTIPATH_VERSION);
 		return (NULL);
 	}
-	if (g_multipath_debug) {
+	if (g_multipath_debug)
 		printf("MULTIPATH: %s/%s\n", md.md_name, md.md_uuid);
-	}
 
 	/*
 	 * Let's check if such a device already is present. We check against
@@ -549,25 +532,20 @@ g_multipath_taste(struct g_class *mp, st
 	sc = NULL;
 	LIST_FOREACH(gp, &mp->geom, geom) {
 		sc = gp->softc;
-		if (sc == NULL) {
+		if (sc == NULL)
 			continue;
-		}
-		if (strncmp(md.md_uuid, sc->sc_uuid, sizeof(md.md_uuid)) == 0) {
+		if (strncmp(md.md_uuid, sc->sc_uuid, sizeof(md.md_uuid)) == 0)
 			break;
-		}
 	}
 
 	LIST_FOREACH(gp1, &mp->geom, geom) {
-		if (gp1 == gp) {
+		if (gp1 == gp)
 			continue;
-		}
 		sc = gp1->softc;
-		if (sc == NULL) {
+		if (sc == NULL)
 			continue;
-		}
-		if (strncmp(md.md_name, sc->sc_name, sizeof(md.md_name)) == 0) {
+		if (strncmp(md.md_name, sc->sc_name, sizeof(md.md_name)) == 0)
 			break;
-		}
 	}
 
 	/*
@@ -594,9 +572,9 @@ g_multipath_taste(struct g_class *mp, st
 			    sc->sc_name, sc->sc_uuid);
 			printf("GEOM_MULTIPATH: %s will be (temporarily) %s\n",
 			    md.md_uuid, buf);
-			strlcpy(md.md_name, buf, sizeof (md.md_name));
+			strlcpy(md.md_name, buf, sizeof(md.md_name));
 		} else {
-			strlcpy(md.md_name, sc->sc_name, sizeof (md.md_name));
+			strlcpy(md.md_name, sc->sc_name, sizeof(md.md_name));
 		}
 	}
 
@@ -616,9 +594,8 @@ g_multipath_taste(struct g_class *mp, st
 	KASSERT(sc != NULL, ("sc is NULL"));
 	error = g_multipath_add_disk(gp, pp);
 	if (error != 0) {
-		if (isnew) {
+		if (isnew)
 			g_multipath_destroy(gp);
-		}
 		return (NULL);
 	}
 	return (gp);
@@ -657,9 +634,8 @@ g_multipath_ctl_create(struct gctl_req *
 		gctl_error(req, "No 'arg1' argument");
 		return;
 	}
-	if (strncmp(name, devpf, 5) == 0) {
+	if (strncmp(name, devpf, 5) == 0)
 		name += 5;
-	}
 	pp0 = g_provider_by_name(name);
 	if (pp0 == NULL) {
 		gctl_error(req, "Provider %s is invalid", name);
@@ -671,9 +647,8 @@ g_multipath_ctl_create(struct gctl_req *
 		gctl_error(req, "No 'arg2' argument");
 		return;
 	}
-	if (strncmp(name, devpf, 5) == 0) {
+	if (strncmp(name, devpf, 5) == 0)
 		name += 5;
-	}
 	pp1 = g_provider_by_name(name);
 	if (pp1 == NULL) {
 		gctl_error(req, "Provider %s is invalid", name);
@@ -717,13 +692,12 @@ g_multipath_ctl_create(struct gctl_req *
 	memset(&md, 0, sizeof(md));
 	md.md_size = pp0->mediasize;
 	md.md_sectorsize = pp0->sectorsize;
-	strncpy(md.md_name, mpname, sizeof (md.md_name));
-	strncpy(md.md_uuid, uuid, sizeof (md.md_uuid));
+	strlcpy(md.md_name, mpname, sizeof(md.md_name));
+	strlcpy(md.md_uuid, uuid, sizeof(md.md_uuid));
 
 	gp = g_multipath_create(mp, &md);
-	if (gp == NULL) {
+	if (gp == NULL)
 		return;
-	}
 	error = g_multipath_add_disk(gp, pp0);
 	if (error) {
 		g_multipath_destroy(gp);

From owner-svn-src-stable-8@FreeBSD.ORG  Fri Apr 23 17:52:36 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 83DBE1065673;
	Fri, 23 Apr 2010 17:52:36 +0000 (UTC)
	(envelope-from jilles@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 6FE9D8FC0A;
	Fri, 23 Apr 2010 17:52:36 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3NHqaMI071096;
	Fri, 23 Apr 2010 17:52:36 GMT (envelope-from jilles@svn.freebsd.org)
Received: (from jilles@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3NHqaLB071093;
	Fri, 23 Apr 2010 17:52:36 GMT (envelope-from jilles@svn.freebsd.org)
Message-Id: <201004231752.o3NHqaLB071093@svn.freebsd.org>
From: Jilles Tjoelker 
Date: Fri, 23 Apr 2010 17:52:36 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r207128 - stable/8/tools/regression/lib/libc/gen
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Fri, 23 Apr 2010 17:52:36 -0000

Author: jilles
Date: Fri Apr 23 17:52:36 2010
New Revision: 207128
URL: http://svn.freebsd.org/changeset/base/207128

Log:
  MFC r206710: Add some tests for fnmatch(3).

Added:
  stable/8/tools/regression/lib/libc/gen/test-fnmatch.c
     - copied unchanged from r206710, head/tools/regression/lib/libc/gen/test-fnmatch.c
Modified:
  stable/8/tools/regression/lib/libc/gen/Makefile
Directory Properties:
  stable/8/tools/regression/lib/libc/   (props changed)

Modified: stable/8/tools/regression/lib/libc/gen/Makefile
==============================================================================
--- stable/8/tools/regression/lib/libc/gen/Makefile	Fri Apr 23 17:26:49 2010	(r207127)
+++ stable/8/tools/regression/lib/libc/gen/Makefile	Fri Apr 23 17:52:36 2010	(r207128)
@@ -1,6 +1,6 @@
 # $FreeBSD$
 
-TESTS=	test-fmtcheck test-fpclassify test-wordexp
+TESTS=	test-fmtcheck test-fnmatch test-fpclassify test-wordexp
 
 .PHONY: tests
 tests: ${TESTS}

Copied: stable/8/tools/regression/lib/libc/gen/test-fnmatch.c (from r206710, head/tools/regression/lib/libc/gen/test-fnmatch.c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/8/tools/regression/lib/libc/gen/test-fnmatch.c	Fri Apr 23 17:52:36 2010	(r207128, copy of r206710, head/tools/regression/lib/libc/gen/test-fnmatch.c)
@@ -0,0 +1,335 @@
+/*-
+ * Copyright (c) 2010 Jilles Tjoelker
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+struct testcase {
+	const char *pattern;
+	const char *string;
+	int flags;
+	int result;
+} testcases[] = {
+	"", "", 0, 0,
+	"a", "a", 0, 0,
+	"a", "b", 0, FNM_NOMATCH,
+	"a", "A", 0, FNM_NOMATCH,
+	"*", "a", 0, 0,
+	"*", "aa", 0, 0,
+	"*a", "a", 0, 0,
+	"*a", "b", 0, FNM_NOMATCH,
+	"*a*", "b", 0, FNM_NOMATCH,
+	"*a*b*", "ab", 0, 0,
+	"*a*b*", "qaqbq", 0, 0,
+	"*a*bb*", "qaqbqbbq", 0, 0,
+	"*a*bc*", "qaqbqbcq", 0, 0,
+	"*a*bb*", "qaqbqbb", 0, 0,
+	"*a*bc*", "qaqbqbc", 0, 0,
+	"*a*bb", "qaqbqbb", 0, 0,
+	"*a*bc", "qaqbqbc", 0, 0,
+	"*a*bb", "qaqbqbbq", 0, FNM_NOMATCH,
+	"*a*bc", "qaqbqbcq", 0, FNM_NOMATCH,
+	"*a*a*a*a*a*a*a*a*a*a*", "aaaaaaaaa", 0, FNM_NOMATCH,
+	"*a*a*a*a*a*a*a*a*a*a*", "aaaaaaaaaa", 0, 0,
+	"*a*a*a*a*a*a*a*a*a*a*", "aaaaaaaaaaa", 0, 0,
+	".*.*.*.*.*.*.*.*.*.*", ".........", 0, FNM_NOMATCH,
+	".*.*.*.*.*.*.*.*.*.*", "..........", 0, 0,
+	".*.*.*.*.*.*.*.*.*.*", "...........", 0, 0,
+	"*?*?*?*?*?*?*?*?*?*?*", "123456789", 0, FNM_NOMATCH,
+	"??????????*", "123456789", 0, FNM_NOMATCH,
+	"*??????????", "123456789", 0, FNM_NOMATCH,
+	"*?*?*?*?*?*?*?*?*?*?*", "1234567890", 0, 0,
+	"??????????*", "1234567890", 0, 0,
+	"*??????????", "1234567890", 0, 0,
+	"*?*?*?*?*?*?*?*?*?*?*", "12345678901", 0, 0,
+	"??????????*", "12345678901", 0, 0,
+	"*??????????", "12345678901", 0, 0,
+	"[x]", "x", 0, 0,
+	"[*]", "*", 0, 0,
+	"[?]", "?", 0, 0,
+	"[", "[", 0, 0,
+	"[[]", "[", 0, 0,
+	"[[]", "x", 0, FNM_NOMATCH,
+	"[*]", "", 0, FNM_NOMATCH,
+	"[*]", "x", 0, FNM_NOMATCH,
+	"[?]", "x", 0, FNM_NOMATCH,
+	"*[*]*", "foo*foo", 0, 0,
+	"*[*]*", "foo", 0, FNM_NOMATCH,
+	"[0-9]", "0", 0, 0,
+	"[0-9]", "5", 0, 0,
+	"[0-9]", "9", 0, 0,
+	"[0-9]", "/", 0, FNM_NOMATCH,
+	"[0-9]", ":", 0, FNM_NOMATCH,
+	"[0-9]", "*", 0, FNM_NOMATCH,
+	"[!0-9]", "0", 0, FNM_NOMATCH,
+	"[!0-9]", "5", 0, FNM_NOMATCH,
+	"[!0-9]", "9", 0, FNM_NOMATCH,
+	"[!0-9]", "/", 0, 0,
+	"[!0-9]", ":", 0, 0,
+	"[!0-9]", "*", 0, 0,
+	"*[0-9]", "a0", 0, 0,
+	"*[0-9]", "a5", 0, 0,
+	"*[0-9]", "a9", 0, 0,
+	"*[0-9]", "a/", 0, FNM_NOMATCH,
+	"*[0-9]", "a:", 0, FNM_NOMATCH,
+	"*[0-9]", "a*", 0, FNM_NOMATCH,
+	"*[!0-9]", "a0", 0, FNM_NOMATCH,
+	"*[!0-9]", "a5", 0, FNM_NOMATCH,
+	"*[!0-9]", "a9", 0, FNM_NOMATCH,
+	"*[!0-9]", "a/", 0, 0,
+	"*[!0-9]", "a:", 0, 0,
+	"*[!0-9]", "a*", 0, 0,
+	"*[0-9]", "a00", 0, 0,
+	"*[0-9]", "a55", 0, 0,
+	"*[0-9]", "a99", 0, 0,
+	"*[0-9]", "a0a0", 0, 0,
+	"*[0-9]", "a5a5", 0, 0,
+	"*[0-9]", "a9a9", 0, 0,
+	"\\*", "*", 0, 0,
+	"\\?", "?", 0, 0,
+	"\\[x]", "[x]", 0, 0,
+	"\\[", "[", 0, 0,
+	"\\\\", "\\", 0, 0,
+	"*\\**", "foo*foo", 0, 0,
+	"*\\**", "foo", 0, FNM_NOMATCH,
+	"*\\\\*", "foo\\foo", 0, 0,
+	"*\\\\*", "foo", 0, FNM_NOMATCH,
+	"\\(", "(", 0, 0,
+	"\\a", "a", 0, 0,
+	"\\*", "a", 0, FNM_NOMATCH,
+	"\\?", "a", 0, FNM_NOMATCH,
+	"\\*", "\\*", 0, FNM_NOMATCH,
+	"\\?", "\\?", 0, FNM_NOMATCH,
+	"\\[x]", "\\[x]", 0, FNM_NOMATCH,
+	"\\[x]", "\\x", 0, FNM_NOMATCH,
+	"\\[", "\\[", 0, FNM_NOMATCH,
+	"\\(", "\\(", 0, FNM_NOMATCH,
+	"\\a", "\\a", 0, FNM_NOMATCH,
+	"\\*", "\\*", FNM_NOESCAPE, 0,
+	"\\?", "\\?", FNM_NOESCAPE, 0,
+	"\\", "\\", FNM_NOESCAPE, 0,
+	"\\\\", "\\", FNM_NOESCAPE, FNM_NOMATCH,
+	"\\\\", "\\\\", FNM_NOESCAPE, 0,
+	"*\\*", "foo\\foo", FNM_NOESCAPE, 0,
+	"*\\*", "foo", FNM_NOESCAPE, FNM_NOMATCH,
+	"*", ".", FNM_PERIOD, FNM_NOMATCH,
+	"?", ".", FNM_PERIOD, FNM_NOMATCH,
+	".*", ".", 0, 0,
+	".*", "..", 0, 0,
+	".*", ".a", 0, 0,
+	"[0-9]", ".", FNM_PERIOD, FNM_NOMATCH,
+	"a*", "a.", 0, 0,
+	"a/a", "a/a", FNM_PATHNAME, 0,
+	"a/*", "a/a", FNM_PATHNAME, 0,
+	"*/a", "a/a", FNM_PATHNAME, 0,
+	"*/*", "a/a", FNM_PATHNAME, 0,
+	"a*b/*", "abbb/x", FNM_PATHNAME, 0,
+	"a*b/*", "abbb/.x", FNM_PATHNAME, 0,
+	"*", "a/a", FNM_PATHNAME, FNM_NOMATCH,
+	"*/*", "a/a/a", FNM_PATHNAME, FNM_NOMATCH,
+	"b/*", "b/.x", FNM_PATHNAME | FNM_PERIOD, FNM_NOMATCH,
+	"b*/*", "a/.x", FNM_PATHNAME | FNM_PERIOD, FNM_NOMATCH,
+	"b/.*", "b/.x", FNM_PATHNAME | FNM_PERIOD, 0,
+	"b*/.*", "b/.x", FNM_PATHNAME | FNM_PERIOD, 0,
+	"a", "A", FNM_CASEFOLD, 0,
+	"A", "a", FNM_CASEFOLD, 0,
+	"[a]", "A", FNM_CASEFOLD, 0,
+	"[A]", "a", FNM_CASEFOLD, 0,
+	"a", "b", FNM_CASEFOLD, FNM_NOMATCH,
+	"a", "a/b", FNM_PATHNAME, FNM_NOMATCH,
+	"*", "a/b", FNM_PATHNAME, FNM_NOMATCH,
+	"*b", "a/b", FNM_PATHNAME, FNM_NOMATCH,
+	"a", "a/b", FNM_PATHNAME | FNM_LEADING_DIR, 0,
+	"*", "a/b", FNM_PATHNAME | FNM_LEADING_DIR, 0,
+	"*", ".a/b", FNM_PATHNAME | FNM_LEADING_DIR, 0,
+	"*a", ".a/b", FNM_PATHNAME | FNM_LEADING_DIR, 0,
+	"*", ".a/b", FNM_PATHNAME | FNM_PERIOD | FNM_LEADING_DIR, FNM_NOMATCH,
+	"*a", ".a/b", FNM_PATHNAME | FNM_PERIOD | FNM_LEADING_DIR, FNM_NOMATCH,
+};
+
+static const char *
+flags_to_string(int flags)
+{
+	static const int flagvalues[] = { FNM_NOESCAPE, FNM_PATHNAME,
+		FNM_PERIOD, FNM_LEADING_DIR, FNM_CASEFOLD, 0 };
+	static const char flagnames[] = "FNM_NOESCAPE\0FNM_PATHNAME\0FNM_PERIOD\0FNM_LEADING_DIR\0FNM_CASEFOLD\0";
+	static char result[sizeof(flagnames) + 3 * sizeof(int) + 2];
+	char *p;
+	size_t i, len;
+	const char *fp;
+
+	p = result;
+	fp = flagnames;
+	for (i = 0; flagvalues[i] != 0; i++) {
+		len = strlen(fp);
+		if (flags & flagvalues[i]) {
+			if (p != result)
+				*p++ = '|';
+			memcpy(p, fp, len);
+			p += len;
+			flags &= ~flagvalues[i];
+		}
+		fp += len + 1;
+	}
+	if (p == result)
+		memcpy(p, "0", 2);
+	else if (flags != 0)
+		sprintf(p, "%d", flags);
+	else
+		*p = '\0';
+	return result;
+}
+
+int
+main(int argc, char *argv[])
+{
+	size_t i, n;
+	int flags, result, extra, errors;
+	struct testcase *t;
+
+	n = sizeof(testcases) / sizeof(testcases[0]);
+	errors = 0;
+	printf("1..%zu\n", n);
+	for (i = 0; i < n; i++) {
+		t = &testcases[i];
+		flags = t->flags;
+		extra = 0;
+		do {
+			result = fnmatch(t->pattern, t->string, flags);
+			if (result != t->result)
+				break;
+			if (strchr(t->pattern, '\\') == NULL &&
+			    !(flags & FNM_NOESCAPE)) {
+				flags |= FNM_NOESCAPE;
+				result = fnmatch(t->pattern, t->string, flags);
+				if (result != t->result)
+					break;
+				flags = t->flags;
+				extra++;
+			}
+			if (strchr(t->pattern, '\\') != NULL &&
+			    strchr(t->string, '\\') == NULL &&
+			    t->result == FNM_NOMATCH &&
+			    !(flags & (FNM_NOESCAPE | FNM_LEADING_DIR))) {
+				flags |= FNM_NOESCAPE;
+				result = fnmatch(t->pattern, t->string, flags);
+				if (result != t->result)
+					break;
+				flags = t->flags;
+				extra++;
+			}
+			if ((t->string[0] != '.' || t->pattern[0] == '.' ||
+			    t->result == FNM_NOMATCH) &&
+			    !(flags & (FNM_PATHNAME | FNM_PERIOD))) {
+				flags |= FNM_PERIOD;
+				result = fnmatch(t->pattern, t->string, flags);
+				if (result != t->result)
+					break;
+				flags = t->flags;
+				extra++;
+			}
+			if ((strchr(t->string, '/') == NULL ||
+			    t->result == FNM_NOMATCH) &&
+			    !(flags & FNM_PATHNAME)) {
+				flags |= FNM_PATHNAME;
+				result = fnmatch(t->pattern, t->string, flags);
+				if (result != t->result)
+					break;
+				flags = t->flags;
+				extra++;
+			}
+			if ((((t->string[0] != '.' || t->pattern[0] == '.') &&
+			    strstr(t->string, "/.") == NULL) ||
+			    t->result == FNM_NOMATCH) &&
+			    flags & FNM_PATHNAME && !(flags & FNM_PERIOD)) {
+				flags |= FNM_PERIOD;
+				result = fnmatch(t->pattern, t->string, flags);
+				if (result != t->result)
+					break;
+				flags = t->flags;
+				extra++;
+			}
+			if ((((t->string[0] != '.' || t->pattern[0] == '.') &&
+			    strchr(t->string, '/') == NULL) ||
+			    t->result == FNM_NOMATCH) &&
+			    !(flags & (FNM_PATHNAME | FNM_PERIOD))) {
+				flags |= FNM_PATHNAME | FNM_PERIOD;
+				result = fnmatch(t->pattern, t->string, flags);
+				if (result != t->result)
+					break;
+				flags = t->flags;
+				extra++;
+			}
+			if ((strchr(t->string, '/') == NULL || t->result == 0)
+			    && !(flags & FNM_LEADING_DIR)) {
+				flags |= FNM_LEADING_DIR;
+				result = fnmatch(t->pattern, t->string, flags);
+				if (result != t->result)
+					break;
+				flags = t->flags;
+				extra++;
+			}
+			if (t->result == 0 && !(flags & FNM_CASEFOLD)) {
+				flags |= FNM_CASEFOLD;
+				result = fnmatch(t->pattern, t->string, flags);
+				if (result != t->result)
+					break;
+				flags = t->flags;
+				extra++;
+			}
+			if (strchr(t->pattern, '\\') == NULL &&
+			    t->result == 0 &&
+			    !(flags & (FNM_NOESCAPE | FNM_CASEFOLD))) {
+				flags |= FNM_NOESCAPE | FNM_CASEFOLD;
+				result = fnmatch(t->pattern, t->string, flags);
+				if (result != t->result)
+					break;
+				flags = t->flags;
+				extra++;
+			}
+		} while (0);
+		if (result == t->result)
+			printf("ok %zu - fnmatch(\"%s\", \"%s\", %s) = %d (+%d)\n",
+			    i + 1, t->pattern, t->string,
+			    flags_to_string(flags),
+			    result, extra);
+		else {
+			printf("not ok %zu - fnmatch(\"%s\", \"%s\", %s) = %d != %d\n",
+			    i + 1, t->pattern, t->string,
+			    flags_to_string(flags),
+			    result, t->result);
+			errors = 1;
+		}
+	}
+
+	return (errors);
+}

From owner-svn-src-stable-8@FreeBSD.ORG  Fri Apr 23 18:01:20 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 52C9D106567A;
	Fri, 23 Apr 2010 18:01:20 +0000 (UTC)
	(envelope-from jilles@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 268118FC46;
	Fri, 23 Apr 2010 18:01:20 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3NI1Kt7073108;
	Fri, 23 Apr 2010 18:01:20 GMT (envelope-from jilles@svn.freebsd.org)
Received: (from jilles@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3NI1K3e073105;
	Fri, 23 Apr 2010 18:01:20 GMT (envelope-from jilles@svn.freebsd.org)
Message-Id: <201004231801.o3NI1K3e073105@svn.freebsd.org>
From: Jilles Tjoelker 
Date: Fri, 23 Apr 2010 18:01:20 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r207129 - in stable/8: lib/libc/gen
	tools/regression/lib/libc/gen
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Fri, 23 Apr 2010 18:01:20 -0000

Author: jilles
Date: Fri Apr 23 18:01:19 2010
New Revision: 207129
URL: http://svn.freebsd.org/changeset/base/207129

Log:
  MFC r206711: fnmatch: Fix bad FNM_PERIOD disabling
  if an asterisk has been seen.
  
  Example: fnmatch("a*b/*", "abbb/.x", FNM_PATHNAME | FNM_PERIOD)
  
  PR:		116074

Modified:
  stable/8/lib/libc/gen/fnmatch.c
  stable/8/tools/regression/lib/libc/gen/test-fnmatch.c
Directory Properties:
  stable/8/lib/libc/   (props changed)
  stable/8/lib/libc/stdtime/   (props changed)
  stable/8/tools/regression/lib/libc/   (props changed)

Modified: stable/8/lib/libc/gen/fnmatch.c
==============================================================================
--- stable/8/lib/libc/gen/fnmatch.c	Fri Apr 23 17:52:36 2010	(r207128)
+++ stable/8/lib/libc/gen/fnmatch.c	Fri Apr 23 18:01:19 2010	(r207129)
@@ -67,7 +67,8 @@ __FBSDID("$FreeBSD$");
 #define RANGE_ERROR     (-1)
 
 static int rangematch(const char *, wchar_t, int, char **, mbstate_t *);
-static int fnmatch1(const char *, const char *, int, mbstate_t, mbstate_t);
+static int fnmatch1(const char *, const char *, const char *, int, mbstate_t,
+		mbstate_t);
 
 int
 fnmatch(pattern, string, flags)
@@ -76,22 +77,21 @@ fnmatch(pattern, string, flags)
 {
 	static const mbstate_t initial;
 
-	return (fnmatch1(pattern, string, flags, initial, initial));
+	return (fnmatch1(pattern, string, string, flags, initial, initial));
 }
 
 static int
-fnmatch1(pattern, string, flags, patmbs, strmbs)
-	const char *pattern, *string;
+fnmatch1(pattern, string, stringstart, flags, patmbs, strmbs)
+	const char *pattern, *string, *stringstart;
 	int flags;
 	mbstate_t patmbs, strmbs;
 {
-	const char *stringstart;
 	char *newp;
 	char c;
 	wchar_t pc, sc;
 	size_t pclen, sclen;
 
-	for (stringstart = string;;) {
+	for (;;) {
 		pclen = mbrtowc(&pc, pattern, MB_LEN_MAX, &patmbs);
 		if (pclen == (size_t)-1 || pclen == (size_t)-2)
 			return (FNM_NOMATCH);
@@ -145,8 +145,8 @@ fnmatch1(pattern, string, flags, patmbs,
 
 			/* General case, use recursion. */
 			while (sc != EOS) {
-				if (!fnmatch1(pattern, string,
-				    flags & ~FNM_PERIOD, patmbs, strmbs))
+				if (!fnmatch1(pattern, string, stringstart,
+				    flags, patmbs, strmbs))
 					return (0);
 				sclen = mbrtowc(&sc, string, MB_LEN_MAX,
 				    &strmbs);

Modified: stable/8/tools/regression/lib/libc/gen/test-fnmatch.c
==============================================================================
--- stable/8/tools/regression/lib/libc/gen/test-fnmatch.c	Fri Apr 23 17:52:36 2010	(r207128)
+++ stable/8/tools/regression/lib/libc/gen/test-fnmatch.c	Fri Apr 23 18:01:19 2010	(r207129)
@@ -174,6 +174,7 @@ struct testcase {
 	"*a", ".a/b", FNM_PATHNAME | FNM_LEADING_DIR, 0,
 	"*", ".a/b", FNM_PATHNAME | FNM_PERIOD | FNM_LEADING_DIR, FNM_NOMATCH,
 	"*a", ".a/b", FNM_PATHNAME | FNM_PERIOD | FNM_LEADING_DIR, FNM_NOMATCH,
+	"a*b/*", "abbb/.x", FNM_PATHNAME | FNM_PERIOD, FNM_NOMATCH,
 };
 
 static const char *

From owner-svn-src-stable-8@FreeBSD.ORG  Fri Apr 23 19:26:04 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 57226106564A;
	Fri, 23 Apr 2010 19:26:04 +0000 (UTC)
	(envelope-from jilles@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 45AE98FC18;
	Fri, 23 Apr 2010 19:26:04 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3NJQ41W092030;
	Fri, 23 Apr 2010 19:26:04 GMT (envelope-from jilles@svn.freebsd.org)
Received: (from jilles@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3NJQ4UR092028;
	Fri, 23 Apr 2010 19:26:04 GMT (envelope-from jilles@svn.freebsd.org)
Message-Id: <201004231926.o3NJQ4UR092028@svn.freebsd.org>
From: Jilles Tjoelker 
Date: Fri, 23 Apr 2010 19:26:04 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r207132 - stable/8/bin/sh
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Fri, 23 Apr 2010 19:26:04 -0000

Author: jilles
Date: Fri Apr 23 19:26:03 2010
New Revision: 207132
URL: http://svn.freebsd.org/changeset/base/207132

Log:
  MFC r197848: Clarify quoting of word in ${v=word} in sh(1).

Modified:
  stable/8/bin/sh/sh.1
Directory Properties:
  stable/8/bin/sh/   (props changed)

Modified: stable/8/bin/sh/sh.1
==============================================================================
--- stable/8/bin/sh/sh.1	Fri Apr 23 19:20:56 2010	(r207131)
+++ stable/8/bin/sh/sh.1	Fri Apr 23 19:26:03 2010	(r207132)
@@ -1227,6 +1227,9 @@ In all cases, the
 final value of
 .Ar parameter
 is substituted.
+Quoting inside
+.Ar word
+does not prevent field splitting or pathname expansion.
 Only variables, not positional
 parameters or special parameters, can be
 assigned in this way.

From owner-svn-src-stable-8@FreeBSD.ORG  Sat Apr 24 00:49:20 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4702C106566C;
	Sat, 24 Apr 2010 00:49:20 +0000 (UTC)
	(envelope-from attilio@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1B1678FC0A;
	Sat, 24 Apr 2010 00:49:20 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3O0nKlZ064510;
	Sat, 24 Apr 2010 00:49:20 GMT (envelope-from attilio@svn.freebsd.org)
Received: (from attilio@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3O0nJqi064506;
	Sat, 24 Apr 2010 00:49:19 GMT (envelope-from attilio@svn.freebsd.org)
Message-Id: <201004240049.o3O0nJqi064506@svn.freebsd.org>
From: Attilio Rao 
Date: Sat, 24 Apr 2010 00:49:19 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r207137 - in stable/8/sys: amd64/isa i386/isa pc98/cbus
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Sat, 24 Apr 2010 00:49:20 -0000

Author: attilio
Date: Sat Apr 24 00:49:19 2010
New Revision: 207137
URL: http://svn.freebsd.org/changeset/base/207137

Log:
  MFC r206421:
  Default the machdep.lapic_allclocks to be enabled in order to cope with
  broken atrtc.
  Now if you want more correct stats on profhz and stathz it may be
  disabled by setting to 0.
  
  Sponsored by:	Sandvine Incorporated

Modified:
  stable/8/sys/amd64/isa/clock.c
  stable/8/sys/i386/isa/clock.c
  stable/8/sys/pc98/cbus/clock.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/amd64/isa/clock.c
==============================================================================
--- stable/8/sys/amd64/isa/clock.c	Fri Apr 23 23:09:18 2010	(r207136)
+++ stable/8/sys/amd64/isa/clock.c	Sat Apr 24 00:49:19 2010	(r207137)
@@ -84,7 +84,7 @@ TUNABLE_INT("hw.i8254.freq", &i8254_freq
 int	i8254_max_count;
 static int i8254_real_max_count;
 
-static int lapic_allclocks;
+static int lapic_allclocks = 1;
 TUNABLE_INT("machdep.lapic_allclocks", &lapic_allclocks);
 
 struct mtx clock_lock;

Modified: stable/8/sys/i386/isa/clock.c
==============================================================================
--- stable/8/sys/i386/isa/clock.c	Fri Apr 23 23:09:18 2010	(r207136)
+++ stable/8/sys/i386/isa/clock.c	Sat Apr 24 00:49:19 2010	(r207137)
@@ -97,7 +97,7 @@ TUNABLE_INT("hw.i8254.freq", &i8254_freq
 int	i8254_max_count;
 static int i8254_real_max_count;
 
-static int lapic_allclocks;
+static int lapic_allclocks = 1;
 TUNABLE_INT("machdep.lapic_allclocks", &lapic_allclocks);
 
 struct mtx clock_lock;

Modified: stable/8/sys/pc98/cbus/clock.c
==============================================================================
--- stable/8/sys/pc98/cbus/clock.c	Fri Apr 23 23:09:18 2010	(r207136)
+++ stable/8/sys/pc98/cbus/clock.c	Sat Apr 24 00:49:19 2010	(r207137)
@@ -93,7 +93,7 @@ TUNABLE_INT("hw.i8254.freq", &i8254_freq
 int	i8254_max_count;
 static int i8254_real_max_count;
 
-static int lapic_allclocks;
+static int lapic_allclocks = 1;
 TUNABLE_INT("machdep.lapic_allclocks", &lapic_allclocks);
 
 static	struct mtx clock_lock;

From owner-svn-src-stable-8@FreeBSD.ORG  Sat Apr 24 00:53:42 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 701B91065676;
	Sat, 24 Apr 2010 00:53:42 +0000 (UTC)
	(envelope-from attilio@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 44F928FC18;
	Sat, 24 Apr 2010 00:53:42 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3O0rgUK065846;
	Sat, 24 Apr 2010 00:53:42 GMT (envelope-from attilio@svn.freebsd.org)
Received: (from attilio@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3O0rgVg065844;
	Sat, 24 Apr 2010 00:53:42 GMT (envelope-from attilio@svn.freebsd.org)
Message-Id: <201004240053.o3O0rgVg065844@svn.freebsd.org>
From: Attilio Rao 
Date: Sat, 24 Apr 2010 00:53:42 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r207138 - stable/8/sys/kern
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Sat, 24 Apr 2010 00:53:42 -0000

Author: attilio
Date: Sat Apr 24 00:53:41 2010
New Revision: 207138
URL: http://svn.freebsd.org/changeset/base/207138

Log:
  MFC r206482, r206879:
  - Introduce a blessed list for sxlocks that prevents the deadlkres to
    panic on those ones. Populate this list with getblk and so_snd_sx and
    so_rcv_sx.
  - Fix ticks counter wrap-up
  
  Sponsored by:	Sandvine Incorporated

Modified:
  stable/8/sys/kern/kern_clock.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/kern/kern_clock.c
==============================================================================
--- stable/8/sys/kern/kern_clock.c	Sat Apr 24 00:49:19 2010	(r207137)
+++ stable/8/sys/kern/kern_clock.c	Sat Apr 24 00:53:41 2010	(r207138)
@@ -162,6 +162,12 @@ SYSCTL_PROC(_kern, OID_AUTO, cp_times, C
     0,0, sysctl_kern_cp_times, "LU", "per-CPU time statistics");
 
 #ifdef DEADLKRES
+static const char *blessed[] = {
+	"getblk",
+	"so_snd_sx",
+	"so_rcv_sx",
+	NULL
+};
 static int slptime_threshold = 1800;
 static int blktime_threshold = 900;
 static int sleepfreq = 3;
@@ -172,7 +178,7 @@ deadlkres(void)
 	struct proc *p;
 	struct thread *td;
 	void *wchan;
-	int blkticks, slpticks, slptype, tryl, tticks;
+	int blkticks, i, slpticks, slptype, tryl, tticks;
 
 	tryl = 0;
 	for (;;) {
@@ -205,6 +211,10 @@ deadlkres(void)
 					 * turnstile channel is in good state.
 					 */
 					MPASS(td->td_blocked != NULL);
+
+					/* Handle ticks wrap-up. */
+					if (ticks < td->td_blktick)
+						continue;
 					tticks = ticks - td->td_blktick;
 					thread_unlock(td);
 					if (tticks > blkticks) {
@@ -222,6 +232,10 @@ deadlkres(void)
 					}
 				} else if (TD_IS_SLEEPING(td)) {
 
+					/* Handle ticks wrap-up. */
+					if (ticks < td->td_blktick)
+						continue;
+
 					/*
 					 * Check if the thread is sleeping on a
 					 * lock, otherwise skip the check.
@@ -242,7 +256,24 @@ deadlkres(void)
 						 * thresholds, this thread is
 						 * stuck for too long on a
 						 * sleepqueue.
+						 * However, being on a
+						 * sleepqueue, we might still
+						 * check for the blessed
+						 * list.
 						 */
+						tryl = 0;
+						for (i = 0; blessed[i] != NULL;
+						    i++) {
+							if (!strcmp(blessed[i],
+							    td->td_wmesg)) {
+								tryl = 1;
+								break;
+							}
+						}
+						if (tryl != 0) {
+							tryl = 0;
+							continue;
+						}
 						PROC_UNLOCK(p);
 						sx_sunlock(&allproc_lock);
 	panic("%s: possible deadlock detected for %p, blocked for %d ticks\n",

From owner-svn-src-stable-8@FreeBSD.ORG  Sat Apr 24 23:05:56 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B4B10106564A;
	Sat, 24 Apr 2010 23:05:56 +0000 (UTC)
	(envelope-from mjacob@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A33658FC24;
	Sat, 24 Apr 2010 23:05:56 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3ON5uUJ073236;
	Sat, 24 Apr 2010 23:05:56 GMT (envelope-from mjacob@svn.freebsd.org)
Received: (from mjacob@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3ON5ucN073230;
	Sat, 24 Apr 2010 23:05:56 GMT (envelope-from mjacob@svn.freebsd.org)
Message-Id: <201004242305.o3ON5ucN073230@svn.freebsd.org>
From: Matt Jacob 
Date: Sat, 24 Apr 2010 23:05:56 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r207171 - stable/8/sys/dev/isp
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Sat, 24 Apr 2010 23:05:56 -0000

Author: mjacob
Date: Sat Apr 24 23:05:56 2010
New Revision: 207171
URL: http://svn.freebsd.org/changeset/base/207171

Log:
  This is an MFC of 205236
  
  Put gone device timer into a structure tag that can hold more than 32 seconds. Oops.
  
  Untangle some of the confusion about what role means when it's in the FCPARAM/SDPARAM
  or isp_fc/isp_spi structures. This fixed a problem about seeing targets appear if you've
  turned off autologin and find them, or rather don't, via camcontrol rescan.

Modified:
  stable/8/sys/dev/isp/isp_freebsd.c
  stable/8/sys/dev/isp/isp_freebsd.h
  stable/8/sys/dev/isp/isp_pci.c
  stable/8/sys/dev/isp/isp_sbus.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/dev/isp/isp_freebsd.c
==============================================================================
--- stable/8/sys/dev/isp/isp_freebsd.c	Sat Apr 24 22:52:14 2010	(r207170)
+++ stable/8/sys/dev/isp/isp_freebsd.c	Sat Apr 24 23:05:56 2010	(r207171)
@@ -3945,11 +3945,15 @@ isp_gdt(void *arg)
 		if (lp->dev_map_idx == 0 || lp->target_mode) {
 			continue;
 		}
-		if (lp->new_reserved == 0) {
+		/*
+		 * We can use new_portid here because it is untouched
+		 * while the state is ZOMBIE
+		 */
+		if (lp->new_portid == 0) {
 			continue;
 		}
-		lp->new_reserved -= 1;
-		if (lp->new_reserved != 0) {
+		lp->new_portid -= 1;
+		if (lp->new_portid != 0) {
 			more_to_do++;
 			continue;
 		}
@@ -4059,7 +4063,7 @@ isp_kthread(void *arg)
 		 *
 		 * If not, we simply just wait for loop to come up.
 		 */
-		if (lb && (fc->role & ISP_ROLE_INITIATOR)) {
+		if (lb && (FCPARAM(isp, chan)->role & ISP_ROLE_INITIATOR)) {
 			/*
 			 * Increment loop down time by the last sleep interval
 			 */
@@ -4927,7 +4931,7 @@ isp_async(ispsoftc_t *isp, ispasync_t cm
 			/*
 			 * We don't do any simq freezing if we are only in target mode
 			 */
-			if (fc->role & ISP_ROLE_INITIATOR) {
+			if (FCPARAM(isp, bus)->role & ISP_ROLE_INITIATOR) {
 				if (fc->path) {
 					isp_freeze_loopdown(isp, bus, msg);
 				}
@@ -4963,7 +4967,7 @@ isp_async(ispsoftc_t *isp, ispasync_t cm
 		va_end(ap);
 		fc = ISP_FC_PC(isp, bus);
 		lp->reserved = 0;
-		if ((fc->role & ISP_ROLE_INITIATOR) && (lp->roles & (SVC3_TGT_ROLE >> SVC3_ROLE_SHIFT))) {
+		if ((FCPARAM(isp, bus)->role & ISP_ROLE_INITIATOR) && (lp->roles & (SVC3_TGT_ROLE >> SVC3_ROLE_SHIFT))) {
 			int dbidx = lp - FCPARAM(isp, bus)->portdb;
 			int i;
 
@@ -5051,10 +5055,13 @@ isp_async(ispsoftc_t *isp, ispasync_t cm
 		 *
 		 * If it isn't marked that isp_gdt is going to get rid of it,
 		 * announce that it's gone.
+		 *
+		 * We can use new_portid for the gone timer because it's
+		 * undefined while the state is ZOMBIE.
 		 */
 		if (lp->dev_map_idx && lp->reserved == 0) {
 			lp->reserved = 1;
-			lp->new_reserved = ISP_FC_PC(isp, bus)->gone_device_time;
+			lp->new_portid = ISP_FC_PC(isp, bus)->gone_device_time;
 			lp->state = FC_PORTDB_STATE_ZOMBIE;
 			if (fc->ready && !callout_active(&fc->gdt)) {
 				isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, "Chan %d starting Gone Device Timer", bus);
@@ -5101,7 +5108,7 @@ isp_async(ispsoftc_t *isp, ispasync_t cm
 			callout_stop(&fc->ldt);
 		}
 		isp_prt(isp, ISP_LOGINFO, msg, bus);
-		if (fc->role & ISP_ROLE_INITIATOR) {
+		if (FCPARAM(isp, bus)->role & ISP_ROLE_INITIATOR) {
 			isp_freeze_loopdown(isp, bus, msg);
 		}
 		wakeup(fc);

Modified: stable/8/sys/dev/isp/isp_freebsd.h
==============================================================================
--- stable/8/sys/dev/isp/isp_freebsd.h	Sat Apr 24 22:52:14 2010	(r207170)
+++ stable/8/sys/dev/isp/isp_freebsd.h	Sat Apr 24 23:05:56 2010	(r207171)
@@ -175,7 +175,7 @@ struct isp_fc {
 		simqfrozen	: 3,
 		default_id	: 8,
 		hysteresis	: 8,
-		role		: 2,
+		def_role	: 2,	/* default role */
 		gdt_running	: 1,
 		loop_dead	: 1,
 		fcbsy		: 1,
@@ -203,7 +203,7 @@ struct isp_spi {
 		tm_enabled	: 1,
 #endif
 		simqfrozen	: 3,
-		role		: 3,
+		def_role	: 2,
 		iid		: 4;
 #ifdef	ISP_TARGET_MODE
 	struct tslist lun_hash[LUN_HASH_SIZE];
@@ -469,12 +469,12 @@ default:							\
 #define	DEFAULT_EXEC_THROTTLE(isp)	isp->isp_osinfo.exec_throttle
 
 #define	GET_DEFAULT_ROLE(isp, chan)	\
-	(IS_FC(isp)? ISP_FC_PC(isp, chan)->role : ISP_SPI_PC(isp, chan)->role)
+	(IS_FC(isp)? ISP_FC_PC(isp, chan)->def_role : ISP_SPI_PC(isp, chan)->def_role)
 #define	SET_DEFAULT_ROLE(isp, chan, val)		\
 	if (IS_FC(isp)) { 				\
-		ISP_FC_PC(isp, chan)->role = val;	\
+		ISP_FC_PC(isp, chan)->def_role = val;	\
 	} else {					\
-		ISP_SPI_PC(isp, chan)->role = val;	\
+		ISP_SPI_PC(isp, chan)->def_role = val;	\
 	}
 
 #define	DEFAULT_IID(isp, chan)		isp->isp_osinfo.pc.spi[chan].iid

Modified: stable/8/sys/dev/isp/isp_pci.c
==============================================================================
--- stable/8/sys/dev/isp/isp_pci.c	Sat Apr 24 22:52:14 2010	(r207170)
+++ stable/8/sys/dev/isp/isp_pci.c	Sat Apr 24 23:05:56 2010	(r207171)
@@ -547,10 +547,10 @@ isp_get_specific_options(device_t dev, i
 	}
 
 	if (IS_SCSI(isp)) {
-		ISP_SPI_PC(isp, chan)->role = tval;
+		ISP_SPI_PC(isp, chan)->def_role = tval;
 		return;
 	}
-	ISP_FC_PC(isp, chan)->role = tval;
+	ISP_FC_PC(isp, chan)->def_role = tval;
 
 	tval = 0;
 	if (resource_int_value(device_get_name(dev), device_get_unit(dev), "fullduplex", &tval) == 0 && tval != 0) {
@@ -833,7 +833,7 @@ isp_pci_attach(device_t dev)
 	 * The 'it' suffix really only matters for SCSI cards in target mode.
 	 */
 	isp->isp_osinfo.fw = NULL;
-	if (IS_SCSI(isp) && (ISP_SPI_PC(isp, 0)->role & ISP_ROLE_TARGET)) {
+	if (IS_SCSI(isp) && (ISP_SPI_PC(isp, 0)->def_role & ISP_ROLE_TARGET)) {
 		snprintf(fwname, sizeof (fwname), "isp_%04x_it", did);
 		isp->isp_osinfo.fw = firmware_get(fwname);
 	} else if (IS_24XX(isp) && (isp->isp_nchan > 1 || isp->isp_osinfo.forcemulti)) {

Modified: stable/8/sys/dev/isp/isp_sbus.c
==============================================================================
--- stable/8/sys/dev/isp/isp_sbus.c	Sat Apr 24 22:52:14 2010	(r207170)
+++ stable/8/sys/dev/isp/isp_sbus.c	Sat Apr 24 23:05:56 2010	(r207171)
@@ -195,7 +195,7 @@ isp_sbus_attach(device_t dev)
 	isp->isp_revision = 0;	/* XXX */
 	isp->isp_dev = dev;
 	isp->isp_nchan = 1;
-	ISP_SET_PC(isp, 0, role, role);
+	ISP_SET_PC(isp, 0, def_role, role);
 
 	/*
 	 * Get the clock frequency and convert it from HZ to MHz,

From owner-svn-src-stable-8@FreeBSD.ORG  Sat Apr 24 23:10:14 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3616F1065677;
	Sat, 24 Apr 2010 23:10:14 +0000 (UTC)
	(envelope-from mjacob@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 250D18FC16;
	Sat, 24 Apr 2010 23:10:14 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3ONAEiC074281;
	Sat, 24 Apr 2010 23:10:14 GMT (envelope-from mjacob@svn.freebsd.org)
Received: (from mjacob@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3ONAEW2074279;
	Sat, 24 Apr 2010 23:10:14 GMT (envelope-from mjacob@svn.freebsd.org)
Message-Id: <201004242310.o3ONAEW2074279@svn.freebsd.org>
From: Matt Jacob 
Date: Sat, 24 Apr 2010 23:10:14 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r207173 - stable/8/sys/cam/scsi
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Sat, 24 Apr 2010 23:10:14 -0000

Author: mjacob
Date: Sat Apr 24 23:10:13 2010
New Revision: 207173
URL: http://svn.freebsd.org/changeset/base/207173

Log:
  This is an MFC of 205252.
  
  We actually can generate a host number.

Modified:
  stable/8/sys/cam/scsi/scsi_sg.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/cam/scsi/scsi_sg.c
==============================================================================
--- stable/8/sys/cam/scsi/scsi_sg.c	Sat Apr 24 23:07:34 2010	(r207172)
+++ stable/8/sys/cam/scsi/scsi_sg.c	Sat Apr 24 23:10:13 2010	(r207173)
@@ -586,7 +586,7 @@ sgioctl(struct cdev *dev, u_long cmd, ca
 	{
 		struct sg_scsi_id id;
 
-		id.host_no = 0; /* XXX */
+		id.host_no = cam_sim_path(xpt_path_sim(periph->path));
 		id.channel = xpt_path_path_id(periph->path);
 		id.scsi_id = xpt_path_target_id(periph->path);
 		id.lun = xpt_path_lun_id(periph->path);

From owner-svn-src-stable-8@FreeBSD.ORG  Sat Apr 24 23:20:51 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 94C031065670;
	Sat, 24 Apr 2010 23:20:51 +0000 (UTC)
	(envelope-from mjacob@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 8321C8FC12;
	Sat, 24 Apr 2010 23:20:51 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3ONKpK1076678;
	Sat, 24 Apr 2010 23:20:51 GMT (envelope-from mjacob@svn.freebsd.org)
Received: (from mjacob@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3ONKpUB076676;
	Sat, 24 Apr 2010 23:20:51 GMT (envelope-from mjacob@svn.freebsd.org)
Message-Id: <201004242320.o3ONKpUB076676@svn.freebsd.org>
From: Matt Jacob 
Date: Sat, 24 Apr 2010 23:20:51 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r207175 - stable/8/sys/dev/isp
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Sat, 24 Apr 2010 23:20:51 -0000

Author: mjacob
Date: Sat Apr 24 23:20:51 2010
New Revision: 207175
URL: http://svn.freebsd.org/changeset/base/207175

Log:
  This is an MFC of 204050.
  
  Don't try and re-use a handle, even if the firmware tells you that's what is logged in.
  
  PR:             kern/144026

Modified:
  stable/8/sys/dev/isp/isp.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/dev/isp/isp.c
==============================================================================
--- stable/8/sys/dev/isp/isp.c	Sat Apr 24 23:13:05 2010	(r207174)
+++ stable/8/sys/dev/isp/isp.c	Sat Apr 24 23:20:51 2010	(r207175)
@@ -2167,9 +2167,7 @@ isp_plogx(ispsoftc_t *isp, int chan, uin
 		msg = "no Exchange Control Block";
 		break;
 	case PLOGX_IOCBERR_FAILED:
-		ISP_SNPRINTF(buf, sizeof (buf),
-		    "reason 0x%x (last LOGIN state 0x%x)",
-		    parm1 & 0xff, (parm1 >> 8) & 0xff);
+		ISP_SNPRINTF(buf, sizeof (buf), "reason 0x%x (last LOGIN state 0x%x)", parm1 & 0xff, (parm1 >> 8) & 0xff);
 		msg = buf;
 		break;
 	case PLOGX_IOCBERR_NOFABRIC:
@@ -2179,8 +2177,7 @@ isp_plogx(ispsoftc_t *isp, int chan, uin
 		msg = "firmware not ready";
 		break;
 	case PLOGX_IOCBERR_NOLOGIN:
-		ISP_SNPRINTF(buf, sizeof (buf), "not logged in (last state 0x%x)",
-		    parm1);
+		ISP_SNPRINTF(buf, sizeof (buf), "not logged in (last state 0x%x)", parm1);
 		msg = buf;
 		rval = MBOX_NOT_LOGGED_IN;
 		break;
@@ -2192,21 +2189,18 @@ isp_plogx(ispsoftc_t *isp, int chan, uin
 		msg = "no PCB allocated";
 		break;
 	case PLOGX_IOCBERR_EINVAL:
-		ISP_SNPRINTF(buf, sizeof (buf), "invalid parameter at offset 0x%x",
-		    parm1);
+		ISP_SNPRINTF(buf, sizeof (buf), "invalid parameter at offset 0x%x", parm1);
 		msg = buf;
 		break;
 	case PLOGX_IOCBERR_PORTUSED:
 		lev = ISP_LOGSANCFG|ISP_LOGDEBUG0;
-		ISP_SNPRINTF(buf, sizeof (buf),
-		    "already logged in with N-Port handle 0x%x", parm1);
+		ISP_SNPRINTF(buf, sizeof (buf), "already logged in with N-Port handle 0x%x", parm1);
 		msg = buf;
 		rval = MBOX_PORT_ID_USED | (parm1 << 16);
 		break;
 	case PLOGX_IOCBERR_HNDLUSED:
 		lev = ISP_LOGSANCFG|ISP_LOGDEBUG0;
-		ISP_SNPRINTF(buf, sizeof (buf),
-		    "handle already used for PortID 0x%06x", parm1);
+		ISP_SNPRINTF(buf, sizeof (buf), "handle already used for PortID 0x%06x", parm1);
 		msg = buf;
 		rval = MBOX_LOOP_ID_USED;
 		break;
@@ -2217,15 +2211,12 @@ isp_plogx(ispsoftc_t *isp, int chan, uin
 		msg = "no FLOGI_ACC";
 		break;
 	default:
-		ISP_SNPRINTF(buf, sizeof (buf), "status %x from %x",
-		    plp->plogx_status, flags);
+		ISP_SNPRINTF(buf, sizeof (buf), "status %x from %x", plp->plogx_status, flags);
 		msg = buf;
 		break;
 	}
 	if (msg) {
-		isp_prt(isp, ISP_LOGERR,
-		    "Chan %d PLOGX PortID 0x%06x to N-Port handle 0x%x: %s",
-		    chan, portid, handle, msg);
+		isp_prt(isp, ISP_LOGERR, "Chan %d PLOGX PortID 0x%06x to N-Port handle 0x%x: %s", chan, portid, handle, msg);
 	}
 out:
 	if (gs == 0) {
@@ -3886,8 +3877,7 @@ isp_scan_fabric(ispsoftc_t *isp, int cha
  * Find an unused handle and try and use to login to a port.
  */
 static int
-isp_login_device(ispsoftc_t *isp, int chan, uint32_t portid, isp_pdb_t *p,
-    uint16_t *ohp)
+isp_login_device(ispsoftc_t *isp, int chan, uint32_t portid, isp_pdb_t *p, uint16_t *ohp)
 {
 	int lim, i, r;
 	uint16_t handle;
@@ -3907,8 +3897,7 @@ isp_login_device(ispsoftc_t *isp, int ch
 		 */
 		r = isp_getpdb(isp, chan, handle, p, 0);
 		if (r == 0 && p->portid != portid) {
-			(void) isp_plogx(isp, chan, handle, portid,
-			    PLOGX_FLG_CMD_LOGO | PLOGX_FLG_IMPLICIT, 1);
+			(void) isp_plogx(isp, chan, handle, portid, PLOGX_FLG_CMD_LOGO | PLOGX_FLG_IMPLICIT | PLOGX_FLG_FREE_NPHDL, 1);
 		} else if (r == 0) {
 			break;
 		}
@@ -3918,8 +3907,7 @@ isp_login_device(ispsoftc_t *isp, int ch
 		/*
 		 * Now try and log into the device
 		 */
-		r = isp_plogx(isp, chan, handle, portid,
-		    PLOGX_FLG_CMD_PLOGI, 1);
+		r = isp_plogx(isp, chan, handle, portid, PLOGX_FLG_CMD_PLOGI, 1);
 		if (FCPARAM(isp, chan)->isp_loopstate != LOOP_SCANNING_FABRIC) {
 			return (-1);
 		}
@@ -3927,7 +3915,26 @@ isp_login_device(ispsoftc_t *isp, int ch
 			*ohp = handle;
 			break;
 		} else if ((r & 0xffff) == MBOX_PORT_ID_USED) {
-			handle = r >> 16;
+			/*
+			 * If we get here, then the firmwware still thinks we're logged into this device, but with a different
+			 * handle. We need to break that association. We used to try and just substitute the handle, but then
+			 * failed to get any data via isp_getpdb (below).
+			 */
+			if (isp_plogx(isp, chan, r >> 16, portid, PLOGX_FLG_CMD_LOGO | PLOGX_FLG_IMPLICIT | PLOGX_FLG_FREE_NPHDL, 1)) {
+				isp_prt(isp, ISP_LOGERR, "baw... logout of %x failed", r >> 16);
+			}
+			if (FCPARAM(isp, chan)->isp_loopstate != LOOP_SCANNING_FABRIC) {
+				return (-1);
+			}
+			r = isp_plogx(isp, chan, handle, portid, PLOGX_FLG_CMD_PLOGI, 1);
+			if (FCPARAM(isp, chan)->isp_loopstate != LOOP_SCANNING_FABRIC) {
+				return (-1);
+			}
+			if (r == 0) {
+				*ohp = handle;
+			} else {
+				i = lim;
+			}
 			break;
 		} else if (r != MBOX_LOOP_ID_USED) {
 			i = lim;
@@ -3941,8 +3948,7 @@ isp_login_device(ispsoftc_t *isp, int ch
 	}
 
 	if (i == lim) {
-		isp_prt(isp, ISP_LOGWARN, "Chan %d PLOGI 0x%06x failed",
-		    chan, portid);
+		isp_prt(isp, ISP_LOGWARN, "Chan %d PLOGI 0x%06x failed", chan, portid);
 		return (-1);
 	}
 
@@ -3956,15 +3962,12 @@ isp_login_device(ispsoftc_t *isp, int ch
 		return (-1);
 	}
 	if (r != 0) {
-		isp_prt(isp, ISP_LOGERR,
-		    "Chan %d new device 0x%06x@0x%x disappeared",
-		    chan, portid, handle);
+		isp_prt(isp, ISP_LOGERR, "Chan %d new device 0x%06x@0x%x disappeared", chan, portid, handle);
 		return (-1);
 	}
 
 	if (p->handle != handle || p->portid != portid) {
-		isp_prt(isp, ISP_LOGERR,
-		    "Chan %d new device 0x%06x@0x%x changed (0x%06x@0x%0x)",
+		isp_prt(isp, ISP_LOGERR, "Chan %d new device 0x%06x@0x%x changed (0x%06x@0x%0x)",
 		    chan, portid, handle, p->portid, p->handle);
 		return (-1);
 	}