From owner-svn-src-all@FreeBSD.ORG Sun Sep 16 00:32:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 39BED106566C; Sun, 16 Sep 2012 00:32:26 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2372A8FC15; Sun, 16 Sep 2012 00:32:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8G0WPux067063; Sun, 16 Sep 2012 00:32:25 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8G0WPLb067059; Sun, 16 Sep 2012 00:32:25 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201209160032.q8G0WPLb067059@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sun, 16 Sep 2012 00:32:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240542 - in stable/9: include/rpc sys/rpc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Sep 2012 00:32:26 -0000 Author: pfg Date: Sun Sep 16 00:32:25 2012 New Revision: 240542 URL: http://svn.freebsd.org/changeset/base/240542 Log: MFC r240060, r240062: Rename __rpc_xdr with XDR. This fixes at least one C++ application and matches what upstream (Solaris) has done on their xdr.h header. PR: 137443 Modified: stable/9/include/rpc/xdr.h stable/9/sys/rpc/rpc_com.h stable/9/sys/rpc/xdr.h Modified: stable/9/include/rpc/xdr.h ============================================================================== --- stable/9/include/rpc/xdr.h Sat Sep 15 21:56:30 2012 (r240541) +++ stable/9/include/rpc/xdr.h Sun Sep 16 00:32:25 2012 (r240542) @@ -97,26 +97,26 @@ enum xdr_op { * an operations vector for the particular implementation (e.g. see xdr_mem.c), * and two private fields for the use of the particular implementation. */ -typedef struct __rpc_xdr { +typedef struct XDR { enum xdr_op x_op; /* operation; fast additional param */ const struct xdr_ops { /* get a long from underlying stream */ - bool_t (*x_getlong)(struct __rpc_xdr *, long *); + bool_t (*x_getlong)(struct XDR *, long *); /* put a long to " */ - bool_t (*x_putlong)(struct __rpc_xdr *, const long *); + bool_t (*x_putlong)(struct XDR *, const long *); /* get some bytes from " */ - bool_t (*x_getbytes)(struct __rpc_xdr *, char *, u_int); + bool_t (*x_getbytes)(struct XDR *, char *, u_int); /* put some bytes to " */ - bool_t (*x_putbytes)(struct __rpc_xdr *, const char *, u_int); + bool_t (*x_putbytes)(struct XDR *, const char *, u_int); /* returns bytes off from beginning */ - u_int (*x_getpostn)(struct __rpc_xdr *); + u_int (*x_getpostn)(struct XDR *); /* lets you reposition the stream */ - bool_t (*x_setpostn)(struct __rpc_xdr *, u_int); + bool_t (*x_setpostn)(struct XDR *, u_int); /* buf quick ptr to buffered data */ - int32_t *(*x_inline)(struct __rpc_xdr *, u_int); + int32_t *(*x_inline)(struct XDR *, u_int); /* free privates of this xdr_stream */ - void (*x_destroy)(struct __rpc_xdr *); - bool_t (*x_control)(struct __rpc_xdr *, int, void *); + void (*x_destroy)(struct XDR *); + bool_t (*x_control)(struct XDR *, int, void *); } *x_ops; char * x_public; /* users' data */ void * x_private; /* pointer to private data */ Modified: stable/9/sys/rpc/rpc_com.h ============================================================================== --- stable/9/sys/rpc/rpc_com.h Sat Sep 15 21:56:30 2012 (r240541) +++ stable/9/sys/rpc/rpc_com.h Sun Sep 16 00:32:25 2012 (r240542) @@ -114,8 +114,8 @@ extern int __rpc_sockisbound(struct sock extern int bindresvport(struct socket *so, struct sockaddr *sa); struct xucred; -struct __rpc_xdr; -bool_t xdr_authunix_parms(struct __rpc_xdr *xdrs, uint32_t *time, struct xucred *cred); +struct XDR; +bool_t xdr_authunix_parms(struct XDR *xdrs, uint32_t *time, struct xucred *cred); #endif __END_DECLS Modified: stable/9/sys/rpc/xdr.h ============================================================================== --- stable/9/sys/rpc/xdr.h Sat Sep 15 21:56:30 2012 (r240541) +++ stable/9/sys/rpc/xdr.h Sun Sep 16 00:32:25 2012 (r240542) @@ -97,26 +97,26 @@ enum xdr_op { * an operations vector for the particular implementation (e.g. see xdr_mem.c), * and two private fields for the use of the particular implementation. */ -typedef struct __rpc_xdr { +typedef struct XDR { enum xdr_op x_op; /* operation; fast additional param */ const struct xdr_ops { /* get a long from underlying stream */ - bool_t (*x_getlong)(struct __rpc_xdr *, long *); + bool_t (*x_getlong)(struct XDR *, long *); /* put a long to " */ - bool_t (*x_putlong)(struct __rpc_xdr *, const long *); + bool_t (*x_putlong)(struct XDR *, const long *); /* get some bytes from " */ - bool_t (*x_getbytes)(struct __rpc_xdr *, char *, u_int); + bool_t (*x_getbytes)(struct XDR *, char *, u_int); /* put some bytes to " */ - bool_t (*x_putbytes)(struct __rpc_xdr *, const char *, u_int); + bool_t (*x_putbytes)(struct XDR *, const char *, u_int); /* returns bytes off from beginning */ - u_int (*x_getpostn)(struct __rpc_xdr *); + u_int (*x_getpostn)(struct XDR *); /* lets you reposition the stream */ - bool_t (*x_setpostn)(struct __rpc_xdr *, u_int); + bool_t (*x_setpostn)(struct XDR *, u_int); /* buf quick ptr to buffered data */ - int32_t *(*x_inline)(struct __rpc_xdr *, u_int); + int32_t *(*x_inline)(struct XDR *, u_int); /* free privates of this xdr_stream */ - void (*x_destroy)(struct __rpc_xdr *); - bool_t (*x_control)(struct __rpc_xdr *, int, void *); + void (*x_destroy)(struct XDR *); + bool_t (*x_control)(struct XDR *, int, void *); } *x_ops; char * x_public; /* users' data */ void * x_private; /* pointer to private data */ From owner-svn-src-all@FreeBSD.ORG Sun Sep 16 00:34:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CBE4D1065670; Sun, 16 Sep 2012 00:34:04 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AD3C48FC0A; Sun, 16 Sep 2012 00:34:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8G0Y4TH067323; Sun, 16 Sep 2012 00:34:04 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8G0Y47w067318; Sun, 16 Sep 2012 00:34:04 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201209160034.q8G0Y47w067318@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sun, 16 Sep 2012 00:34: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: r240543 - in stable/8: include/rpc sys/rpc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Sep 2012 00:34:04 -0000 Author: pfg Date: Sun Sep 16 00:34:04 2012 New Revision: 240543 URL: http://svn.freebsd.org/changeset/base/240543 Log: MFC r240060, r240062: Rename __rpc_xdr with XDR. This fixes at least one C++ application and matches what upstream (Solaris) has done on their xdr.h header. PR: 137443 Modified: stable/8/include/rpc/xdr.h stable/8/sys/rpc/rpc_com.h stable/8/sys/rpc/xdr.h Directory Properties: stable/8/include/rpc/ (props changed) stable/8/sys/rpc/ (props changed) Modified: stable/8/include/rpc/xdr.h ============================================================================== --- stable/8/include/rpc/xdr.h Sun Sep 16 00:32:25 2012 (r240542) +++ stable/8/include/rpc/xdr.h Sun Sep 16 00:34:04 2012 (r240543) @@ -97,26 +97,26 @@ enum xdr_op { * an operations vector for the particular implementation (e.g. see xdr_mem.c), * and two private fields for the use of the particular implementation. */ -typedef struct __rpc_xdr { +typedef struct XDR { enum xdr_op x_op; /* operation; fast additional param */ const struct xdr_ops { /* get a long from underlying stream */ - bool_t (*x_getlong)(struct __rpc_xdr *, long *); + bool_t (*x_getlong)(struct XDR *, long *); /* put a long to " */ - bool_t (*x_putlong)(struct __rpc_xdr *, const long *); + bool_t (*x_putlong)(struct XDR *, const long *); /* get some bytes from " */ - bool_t (*x_getbytes)(struct __rpc_xdr *, char *, u_int); + bool_t (*x_getbytes)(struct XDR *, char *, u_int); /* put some bytes to " */ - bool_t (*x_putbytes)(struct __rpc_xdr *, const char *, u_int); + bool_t (*x_putbytes)(struct XDR *, const char *, u_int); /* returns bytes off from beginning */ - u_int (*x_getpostn)(struct __rpc_xdr *); + u_int (*x_getpostn)(struct XDR *); /* lets you reposition the stream */ - bool_t (*x_setpostn)(struct __rpc_xdr *, u_int); + bool_t (*x_setpostn)(struct XDR *, u_int); /* buf quick ptr to buffered data */ - int32_t *(*x_inline)(struct __rpc_xdr *, u_int); + int32_t *(*x_inline)(struct XDR *, u_int); /* free privates of this xdr_stream */ - void (*x_destroy)(struct __rpc_xdr *); - bool_t (*x_control)(struct __rpc_xdr *, int, void *); + void (*x_destroy)(struct XDR *); + bool_t (*x_control)(struct XDR *, int, void *); } *x_ops; char * x_public; /* users' data */ void * x_private; /* pointer to private data */ Modified: stable/8/sys/rpc/rpc_com.h ============================================================================== --- stable/8/sys/rpc/rpc_com.h Sun Sep 16 00:32:25 2012 (r240542) +++ stable/8/sys/rpc/rpc_com.h Sun Sep 16 00:34:04 2012 (r240543) @@ -114,8 +114,8 @@ extern int __rpc_sockisbound(struct sock extern int bindresvport(struct socket *so, struct sockaddr *sa); struct xucred; -struct __rpc_xdr; -bool_t xdr_authunix_parms(struct __rpc_xdr *xdrs, uint32_t *time, struct xucred *cred); +struct XDR; +bool_t xdr_authunix_parms(struct XDR *xdrs, uint32_t *time, struct xucred *cred); #endif __END_DECLS Modified: stable/8/sys/rpc/xdr.h ============================================================================== --- stable/8/sys/rpc/xdr.h Sun Sep 16 00:32:25 2012 (r240542) +++ stable/8/sys/rpc/xdr.h Sun Sep 16 00:34:04 2012 (r240543) @@ -97,26 +97,26 @@ enum xdr_op { * an operations vector for the particular implementation (e.g. see xdr_mem.c), * and two private fields for the use of the particular implementation. */ -typedef struct __rpc_xdr { +typedef struct XDR { enum xdr_op x_op; /* operation; fast additional param */ const struct xdr_ops { /* get a long from underlying stream */ - bool_t (*x_getlong)(struct __rpc_xdr *, long *); + bool_t (*x_getlong)(struct XDR *, long *); /* put a long to " */ - bool_t (*x_putlong)(struct __rpc_xdr *, const long *); + bool_t (*x_putlong)(struct XDR *, const long *); /* get some bytes from " */ - bool_t (*x_getbytes)(struct __rpc_xdr *, char *, u_int); + bool_t (*x_getbytes)(struct XDR *, char *, u_int); /* put some bytes to " */ - bool_t (*x_putbytes)(struct __rpc_xdr *, const char *, u_int); + bool_t (*x_putbytes)(struct XDR *, const char *, u_int); /* returns bytes off from beginning */ - u_int (*x_getpostn)(struct __rpc_xdr *); + u_int (*x_getpostn)(struct XDR *); /* lets you reposition the stream */ - bool_t (*x_setpostn)(struct __rpc_xdr *, u_int); + bool_t (*x_setpostn)(struct XDR *, u_int); /* buf quick ptr to buffered data */ - int32_t *(*x_inline)(struct __rpc_xdr *, u_int); + int32_t *(*x_inline)(struct XDR *, u_int); /* free privates of this xdr_stream */ - void (*x_destroy)(struct __rpc_xdr *); - bool_t (*x_control)(struct __rpc_xdr *, int, void *); + void (*x_destroy)(struct XDR *); + bool_t (*x_control)(struct XDR *, int, void *); } *x_ops; char * x_public; /* users' data */ void * x_private; /* pointer to private data */ From owner-svn-src-all@FreeBSD.ORG Sun Sep 16 00:35:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 08D95106566C; Sun, 16 Sep 2012 00:35:10 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C933B8FC0C; Sun, 16 Sep 2012 00:35:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8G0Z9sC067521; Sun, 16 Sep 2012 00:35:09 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8G0Z9iL067507; Sun, 16 Sep 2012 00:35:09 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201209160035.q8G0Z9iL067507@svn.freebsd.org> From: Eitan Adler Date: Sun, 16 Sep 2012 00:35:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240544 - in stable/8/share/examples: . cvsup X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Sep 2012 00:35:10 -0000 Author: eadler Date: Sun Sep 16 00:35:09 2012 New Revision: 240544 URL: http://svn.freebsd.org/changeset/base/240544 Log: MFC r240252,r240253: Remove documentation and www cvsup files as they are no longer useful with the switch to subversion. Specifically document that an incomplete ports tree is not supported. Remove useless comment about sendmail. Approved by: cperciva (implicit) Deleted: stable/8/share/examples/cvsup/doc-supfile stable/8/share/examples/cvsup/www-supfile Modified: stable/8/share/examples/Makefile stable/8/share/examples/cvsup/cvs-supfile stable/8/share/examples/cvsup/refuse stable/8/share/examples/cvsup/refuse.README stable/8/share/examples/cvsup/stable-supfile Directory Properties: stable/8/share/examples/ (props changed) stable/8/share/examples/cvsup/ (props changed) stable/8/share/man/man5/ (props changed) Modified: stable/8/share/examples/Makefile ============================================================================== --- stable/8/share/examples/Makefile Sun Sep 16 00:34:04 2012 (r240543) +++ stable/8/share/examples/Makefile Sun Sep 16 00:35:09 2012 (r240544) @@ -52,14 +52,12 @@ XFILES= BSD_daemon/FreeBSD.pfa \ csh/dot.cshrc \ cvsup/README \ cvsup/cvs-supfile \ - cvsup/doc-supfile \ cvsup/gnats-supfile \ cvsup/ports-supfile \ cvsup/refuse \ cvsup/refuse.README \ cvsup/stable-supfile \ cvsup/standard-supfile \ - cvsup/www-supfile \ diskless/ME \ diskless/README.BOOTP \ diskless/README.TEMPLATING \ Modified: stable/8/share/examples/cvsup/cvs-supfile ============================================================================== --- stable/8/share/examples/cvsup/cvs-supfile Sun Sep 16 00:34:04 2012 (r240543) +++ stable/8/share/examples/cvsup/cvs-supfile Sun Sep 16 00:35:09 2012 (r240544) @@ -169,19 +169,6 @@ ports-all #ports-x11-toolkits #ports-x11-wm -## Documentation -# -# The easiest way to get the doc tree is to use the "doc-all" -# mega-collection. It includes all of the individual "doc-*" -# collections, -doc-all - -## Website -# -# This collection retrieves the www tree of the FreeBSD -# repository -www - ## Projects # # This collection retrieves the projects tree of the FreeBSD @@ -200,4 +187,3 @@ cvsroot-all #cvsroot-common #cvsroot-src #cvsroot-ports -#cvsroot-doc Modified: stable/8/share/examples/cvsup/refuse ============================================================================== --- stable/8/share/examples/cvsup/refuse Sun Sep 16 00:34:04 2012 (r240543) +++ stable/8/share/examples/cvsup/refuse Sun Sep 16 00:35:09 2012 (r240544) @@ -1,23 +1,3 @@ -doc/bn_* -doc/da_* -doc/de_* -doc/el_* -doc/es_* -doc/fr_* -doc/hu_* -doc/id_* -doc/it_* -doc/ja_* -doc/mn_* -doc/nl_* -doc/no_* -doc/pl_* -doc/pt_* -doc/ro_* -doc/ru_* -doc/sr_* -doc/tr_* -doc/zh_* ports/arabic ports/chinese ports/french Modified: stable/8/share/examples/cvsup/refuse.README ============================================================================== --- stable/8/share/examples/cvsup/refuse.README Sun Sep 16 00:34:04 2012 (r240543) +++ stable/8/share/examples/cvsup/refuse.README Sun Sep 16 00:35:09 2012 (r240544) @@ -16,33 +16,9 @@ CVSup's base directory to "/var/db". Th directory; i.e., it is "/var/db/sup". If you have changed your base directory, your sup directory is /path/to/base/sup. -This file used to contain /usr/src/etc/sendmail/freebsd.mc in case -you modified that file. However, this was removed as it can break -buildworld. Modify /etc/mail/`hostname`.mc instead. - If you are an English speaker and don't wish to receive the -foreign-language documentation or ports, use the following patterns: +non-English ports, use the following patterns: - doc/bn_* - doc/da_* - doc/de_* - doc/el_* - doc/es_* - doc/fr_* - doc/hu_* - doc/id_* - doc/it_* - doc/ja_* - doc/mn_* - doc/nl_* - doc/no_* - doc/pl_* - doc/pt_* - doc/ro_* - doc/ru_* - doc/sr_* - doc/tr_* - doc/zh_* ports/arabic ports/chinese ports/french @@ -57,6 +33,9 @@ foreign-language documentation or ports, ports/ukrainian ports/vietnamese +Note that this is *not* a supported configuration and may result +in ports builds breaking. + Use refuse files with care. Some parts of the src distribution depend on files in completely different parts. Modified: stable/8/share/examples/cvsup/stable-supfile ============================================================================== --- stable/8/share/examples/cvsup/stable-supfile Sun Sep 16 00:34:04 2012 (r240543) +++ stable/8/share/examples/cvsup/stable-supfile Sun Sep 16 00:35:09 2012 (r240544) @@ -43,14 +43,13 @@ # # DANGER! WARNING! LOOK OUT! VORSICHT! # -# If you add any of the ports or doc collections to this file, be sure to +# If you add any of the ports collections to this file, be sure to # specify them with a "tag" value set to ".", like this: # # ports-all tag=. -# doc-all tag=. # # If you leave out the "tag=." portion, CVSup will delete all of -# the files in your ports or doc tree. That is because the ports and doc +# the files in your ports. That is because the ports # collections do not use the same tags as the main part of the FreeBSD # source tree. # From owner-svn-src-all@FreeBSD.ORG Sun Sep 16 00:35:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 374DA1065670; Sun, 16 Sep 2012 00:35:10 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 177818FC16; Sun, 16 Sep 2012 00:35:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8G0Z91L067532; Sun, 16 Sep 2012 00:35:09 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8G0Z9q6067523; Sun, 16 Sep 2012 00:35:09 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201209160035.q8G0Z9q6067523@svn.freebsd.org> From: Eitan Adler Date: Sun, 16 Sep 2012 00:35:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240545 - in stable/9/share/examples: . cvsup etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Sep 2012 00:35:10 -0000 Author: eadler Date: Sun Sep 16 00:35:09 2012 New Revision: 240545 URL: http://svn.freebsd.org/changeset/base/240545 Log: MFC r240252,r240253: Remove documentation and www cvsup files as they are no longer useful with the switch to subversion. Specifically document that an incomplete ports tree is not supported. Remove useless comment about sendmail. Approved by: cperciva (implicit) Deleted: stable/9/share/examples/cvsup/doc-supfile stable/9/share/examples/cvsup/www-supfile Modified: stable/9/share/examples/Makefile stable/9/share/examples/cvsup/cvs-supfile stable/9/share/examples/cvsup/refuse stable/9/share/examples/cvsup/refuse.README stable/9/share/examples/cvsup/stable-supfile stable/9/share/examples/etc/make.conf Directory Properties: stable/9/share/examples/ (props changed) stable/9/share/examples/cvsup/ (props changed) stable/9/share/examples/etc/ (props changed) stable/9/share/man/man5/ (props changed) Modified: stable/9/share/examples/Makefile ============================================================================== --- stable/9/share/examples/Makefile Sun Sep 16 00:35:09 2012 (r240544) +++ stable/9/share/examples/Makefile Sun Sep 16 00:35:09 2012 (r240545) @@ -53,14 +53,12 @@ XFILES= BSD_daemon/FreeBSD.pfa \ csh/dot.cshrc \ cvsup/README \ cvsup/cvs-supfile \ - cvsup/doc-supfile \ cvsup/gnats-supfile \ cvsup/ports-supfile \ cvsup/refuse \ cvsup/refuse.README \ cvsup/stable-supfile \ cvsup/standard-supfile \ - cvsup/www-supfile \ diskless/ME \ diskless/README.BOOTP \ diskless/README.TEMPLATING \ Modified: stable/9/share/examples/cvsup/cvs-supfile ============================================================================== --- stable/9/share/examples/cvsup/cvs-supfile Sun Sep 16 00:35:09 2012 (r240544) +++ stable/9/share/examples/cvsup/cvs-supfile Sun Sep 16 00:35:09 2012 (r240545) @@ -169,19 +169,6 @@ ports-all #ports-x11-toolkits #ports-x11-wm -## Documentation -# -# The easiest way to get the doc tree is to use the "doc-all" -# mega-collection. It includes all of the individual "doc-*" -# collections, -doc-all - -## Website -# -# This collection retrieves the www tree of the FreeBSD -# repository -www - ## Projects # # This collection retrieves the projects tree of the FreeBSD @@ -200,4 +187,3 @@ cvsroot-all #cvsroot-common #cvsroot-src #cvsroot-ports -#cvsroot-doc Modified: stable/9/share/examples/cvsup/refuse ============================================================================== --- stable/9/share/examples/cvsup/refuse Sun Sep 16 00:35:09 2012 (r240544) +++ stable/9/share/examples/cvsup/refuse Sun Sep 16 00:35:09 2012 (r240545) @@ -1,23 +1,3 @@ -doc/bn_* -doc/da_* -doc/de_* -doc/el_* -doc/es_* -doc/fr_* -doc/hu_* -doc/id_* -doc/it_* -doc/ja_* -doc/mn_* -doc/nl_* -doc/no_* -doc/pl_* -doc/pt_* -doc/ro_* -doc/ru_* -doc/sr_* -doc/tr_* -doc/zh_* ports/arabic ports/chinese ports/french Modified: stable/9/share/examples/cvsup/refuse.README ============================================================================== --- stable/9/share/examples/cvsup/refuse.README Sun Sep 16 00:35:09 2012 (r240544) +++ stable/9/share/examples/cvsup/refuse.README Sun Sep 16 00:35:09 2012 (r240545) @@ -16,33 +16,9 @@ CVSup's base directory to "/var/db". Th directory; i.e., it is "/var/db/sup". If you have changed your base directory, your sup directory is /path/to/base/sup. -This file used to contain /usr/src/etc/sendmail/freebsd.mc in case -you modified that file. However, this was removed as it can break -buildworld. Modify /etc/mail/`hostname`.mc instead. - If you are an English speaker and don't wish to receive the -foreign-language documentation or ports, use the following patterns: +non-English ports, use the following patterns: - doc/bn_* - doc/da_* - doc/de_* - doc/el_* - doc/es_* - doc/fr_* - doc/hu_* - doc/id_* - doc/it_* - doc/ja_* - doc/mn_* - doc/nl_* - doc/no_* - doc/pl_* - doc/pt_* - doc/ro_* - doc/ru_* - doc/sr_* - doc/tr_* - doc/zh_* ports/arabic ports/chinese ports/french @@ -57,6 +33,9 @@ foreign-language documentation or ports, ports/ukrainian ports/vietnamese +Note that this is *not* a supported configuration and may result +in ports builds breaking. + Use refuse files with care. Some parts of the src distribution depend on files in completely different parts. Modified: stable/9/share/examples/cvsup/stable-supfile ============================================================================== --- stable/9/share/examples/cvsup/stable-supfile Sun Sep 16 00:35:09 2012 (r240544) +++ stable/9/share/examples/cvsup/stable-supfile Sun Sep 16 00:35:09 2012 (r240545) @@ -43,14 +43,13 @@ # # DANGER! WARNING! LOOK OUT! VORSICHT! # -# If you add any of the ports or doc collections to this file, be sure to +# If you add any of the ports collections to this file, be sure to # specify them with a "tag" value set to ".", like this: # # ports-all tag=. -# doc-all tag=. # # If you leave out the "tag=." portion, CVSup will delete all of -# the files in your ports or doc tree. That is because the ports and doc +# the files in your ports. That is because the ports # collections do not use the same tags as the main part of the FreeBSD # source tree. # Modified: stable/9/share/examples/etc/make.conf ============================================================================== --- stable/9/share/examples/etc/make.conf Sun Sep 16 00:35:09 2012 (r240544) +++ stable/9/share/examples/etc/make.conf Sun Sep 16 00:35:09 2012 (r240545) @@ -187,8 +187,6 @@ #SUPHOST= cvsup.uk.FreeBSD.org #SUPFILE= /usr/share/examples/cvsup/standard-supfile #PORTSSUPFILE= /usr/share/examples/cvsup/ports-supfile -#DOCSUPFILE= /usr/share/examples/cvsup/doc-supfile -#WWWSUPFILE= /usr/share/examples/cvsup/www-supfile # # top(1) uses a hash table for the user names. The size of this hash # can be tuned to match the number of local users. The table size should From owner-svn-src-all@FreeBSD.ORG Sun Sep 16 05:52:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A2CF6106564A; Sun, 16 Sep 2012 05:52:55 +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 533708FC08; Sun, 16 Sep 2012 05:52:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8G5qttR017346; Sun, 16 Sep 2012 05:52:55 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8G5qtwf017344; Sun, 16 Sep 2012 05:52:55 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201209160552.q8G5qtwf017344@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 16 Sep 2012 05:52:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240546 - head/usr.bin/procstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Sep 2012 05:52:55 -0000 Author: kib Date: Sun Sep 16 05:52:54 2012 New Revision: 240546 URL: http://svn.freebsd.org/changeset/base/240546 Log: Handle AT_TIMEKEEP in procstat(1) -x [1]. Remove the AT_COUNT switch case, since AT_COUNT is not an aux vector, it is the counter of total number of defined vectors. PR: bin/171662 [1] MFC after: 1 week Modified: head/usr.bin/procstat/procstat_auxv.c Modified: head/usr.bin/procstat/procstat_auxv.c ============================================================================== --- head/usr.bin/procstat/procstat_auxv.c Sun Sep 16 00:35:09 2012 (r240545) +++ head/usr.bin/procstat/procstat_auxv.c Sun Sep 16 05:52:54 2012 (r240546) @@ -231,9 +231,11 @@ procstat_auxv(struct kinfo_proc *kipp) else PRINT(AT_STACKPROT, %s, "EXECUTABLE"); break; - case AT_COUNT: - PRINT(AT_COUNT, %ld, (long)auxv[i].a_un.a_val); +#ifdef AT_TIMEKEEP + case AT_TIMEKEEP: + PRINT(AT_TIMEKEEP, %p, auxv[i].a_un.a_ptr); break; +#endif default: PRINT_UNKNOWN(auxv[i].a_type, auxv[i].a_un.a_val); break; From owner-svn-src-all@FreeBSD.ORG Sun Sep 16 06:01:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B9D22106564A; Sun, 16 Sep 2012 06:01:34 +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 A55258FC1B; Sun, 16 Sep 2012 06:01:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8G61YM9018705; Sun, 16 Sep 2012 06:01:34 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8G61Y7i018703; Sun, 16 Sep 2012 06:01:34 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201209160601.q8G61Y7i018703@svn.freebsd.org> From: Rui Paulo Date: Sun, 16 Sep 2012 06:01:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240547 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Sep 2012 06:01:34 -0000 Author: rpaulo Date: Sun Sep 16 06:01:34 2012 New Revision: 240547 URL: http://svn.freebsd.org/changeset/base/240547 Log: Add Perforce support. Modified: head/sys/conf/newvers.sh Modified: head/sys/conf/newvers.sh ============================================================================== --- head/sys/conf/newvers.sh Sun Sep 16 05:52:54 2012 (r240546) +++ head/sys/conf/newvers.sh Sun Sep 16 06:01:34 2012 (r240547) @@ -88,9 +88,11 @@ v=`cat version` u=${USER:-root} d=`pwd` i=`${MAKE:-make} -V KERN_IDENT` for dir in /bin /usr/bin /usr/local/bin; do - if [ -x "${dir}/svnversion" ] ; then + if [ -x "${dir}/svnversion" ] && [ -z ${svnversion} ] ; then svnversion=${dir}/svnversion - break + fi + if [ -x "${dir}/p4" ] && [ -z ${p4_cmd} ] ; then + p4_cmd=${dir}/p4 fi done if [ -d "${SYSDIR}/../.git" ] ; then @@ -132,10 +134,27 @@ if [ -n "$git_cmd" ] ; then fi fi +if [ -n "$p4_cmd" ] ; then + p4version=`cd ${SYSDIR} && $p4_cmd changes -m1 "./...#have" 2>&1 | \ + awk '{ print $2 }'` + case "$p4version" in + [0-9]*) + p4version=" ${p4version}" + p4opened=`$p4_cmd opened 2>&1` + case "$p4opened" in + File*) ;; + *) p4version="${p4version}+pending" ;; + esac + ;; + *) unset p4version ;; + esac +fi + + cat << EOF > vers.c $COPYRIGHT -#define SCCSSTR "@(#)${VERSION} #${v}${svn}${git}: ${t}" -#define VERSTR "${VERSION} #${v}${svn}${git}: ${t}\\n ${u}@${h}:${d}\\n" +#define SCCSSTR "@(#)${VERSION} #${v}${svn}${git}${p4version}: ${t}" +#define VERSTR "${VERSION} #${v}${svn}${git}${p4version}: ${t}\\n ${u}@${h}:${d}\\n" #define RELSTR "${RELEASE}" char sccs[sizeof(SCCSSTR) > 128 ? sizeof(SCCSSTR) : 128] = SCCSSTR; From owner-svn-src-all@FreeBSD.ORG Sun Sep 16 06:44:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DFE0C106566C; Sun, 16 Sep 2012 06:44:58 +0000 (UTC) (envelope-from peterj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B14B18FC1D; Sun, 16 Sep 2012 06:44:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8G6iwmE025215; Sun, 16 Sep 2012 06:44:58 GMT (envelope-from peterj@svn.freebsd.org) Received: (from peterj@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8G6iw6A025212; Sun, 16 Sep 2012 06:44:58 GMT (envelope-from peterj@svn.freebsd.org) Message-Id: <201209160644.q8G6iw6A025212@svn.freebsd.org> From: Peter Jeremy Date: Sun, 16 Sep 2012 06:44:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240548 - in head: share/misc usr.bin/calendar/calendars X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Sep 2012 06:44:59 -0000 Author: peterj Date: Sun Sep 16 06:44:58 2012 New Revision: 240548 URL: http://svn.freebsd.org/changeset/base/240548 Log: - Add myself as a new src committer. - Sort jhb's mentees - Add grog's (ex-)mentor Approved by: jhb (co-mentor), grog (co-mentor) Modified: head/share/misc/committers-src.dot head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Sun Sep 16 06:01:34 2012 (r240547) +++ head/share/misc/committers-src.dot Sun Sep 16 06:44:58 2012 (r240548) @@ -215,6 +215,7 @@ obrien [label="David E. O'Brien\nobrien@ olli [label="Oliver Fromme\nolli@FreeBSD.org\n2008/02/14"] peadar [label="Peter Edwards\npeadar@FreeBSD.org\n2004/03/08"] peter [label="Peter Wemm\npeter@FreeBSD.org\n????/??/??"] +peterj [label="Peter Jeremy\npeterj@FreeBSD.org\n2012/09/14"] pfg [label="Pedro Giffuni\npfg@FreeBSD.org\n2011/12/01"] philip [label="Philip Paeps\nphilip@FreeBSD.org\n2004/01/21"] phk [label="Poul-Henning Kamp\nphk@FreeBSD.org\n1994/02/21"] @@ -396,6 +397,7 @@ gnn -> davide grog -> edwin grog -> le +grog -> peterj imp -> akiyama imp -> ambrisko @@ -439,9 +441,11 @@ jhb -> arr jhb -> avg jhb -> jeff jhb -> kbyanc -jhb -> rnoland +jhb -> peterj jhb -> pfg +jhb -> rnoland +jkh -> grog jkh -> imp jkh -> jlemon jkh -> joerg Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Sun Sep 16 06:01:34 2012 (r240547) +++ head/usr.bin/calendar/calendars/calendar.freebsd Sun Sep 16 06:44:58 2012 (r240548) @@ -119,6 +119,7 @@ 04/03 Tong Liu born in Beijing, People's Republic of China, 1981 04/03 Gabor Pali born in Kunhegyes, Hungary, 1982 04/05 Stacey Son born in Burley, Idaho, United States, 1967 +04/06 Peter Jeremy born in Sydney, New South Wales, Australia, 1961 04/07 Edward Tomasz Napierala born in Wolsztyn, Poland, 1981 04/08 Jordan K. Hubbard born in Honolulu, Hawaii, United States, 1963 04/09 Ceri Davies born in Haverfordwest, Pembrokeshire, United Kingdom, 1976 From owner-svn-src-all@FreeBSD.ORG Sun Sep 16 07:55:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D421D106564A; Sun, 16 Sep 2012 07:55:49 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BF32E8FC08; Sun, 16 Sep 2012 07:55:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8G7tnuX036334; Sun, 16 Sep 2012 07:55:49 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8G7tnMH036332; Sun, 16 Sep 2012 07:55:49 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201209160755.q8G7tnMH036332@svn.freebsd.org> From: Andrew Turner Date: Sun, 16 Sep 2012 07:55:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240549 - head/sys/arm/tegra X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Sep 2012 07:55:50 -0000 Author: andrew Date: Sun Sep 16 07:55:49 2012 New Revision: 240549 URL: http://svn.freebsd.org/changeset/base/240549 Log: The cpu_reset function is noreturn, make sure this is true on Tegra 2. While here fix a typo. Modified: head/sys/arm/tegra/common.c Modified: head/sys/arm/tegra/common.c ============================================================================== --- head/sys/arm/tegra/common.c Sun Sep 16 06:44:58 2012 (r240548) +++ head/sys/arm/tegra/common.c Sun Sep 16 07:55:49 2012 (r240549) @@ -47,9 +47,11 @@ void cpu_reset(void) { bus_space_handle_t bsh; - printf("Restetting...\n"); + printf("Resetting...\n"); bus_space_map(fdtbus_bs_tag,TEGRA2_CLK_RST_PA_BASE, 0x1000, 0, &bsh); bus_space_write_4(fdtbus_bs_tag, bsh, 4, 4); + + while(1); } struct fdt_fixup_entry fdt_fixup_table[] = { From owner-svn-src-all@FreeBSD.ORG Sun Sep 16 08:00:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 22A891065673; Sun, 16 Sep 2012 08:00:30 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0070F8FC12; Sun, 16 Sep 2012 08:00:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8G80Twk037029; Sun, 16 Sep 2012 08:00:29 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8G80TV3037028; Sun, 16 Sep 2012 08:00:29 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201209160800.q8G80TV3037028@svn.freebsd.org> From: Andrew Turner Date: Sun, 16 Sep 2012 08:00:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240550 - head/sys/arm/tegra X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Sep 2012 08:00:30 -0000 Author: andrew Date: Sun Sep 16 08:00:29 2012 New Revision: 240550 URL: http://svn.freebsd.org/changeset/base/240550 Log: In the Tegra 2 standard config: * Remove an unneeded makeoption * Set machine correctly * Properly indent the include of files.tegra2 Modified: head/sys/arm/tegra/std.tegra2 Modified: head/sys/arm/tegra/std.tegra2 ============================================================================== --- head/sys/arm/tegra/std.tegra2 Sun Sep 16 07:55:49 2012 (r240549) +++ head/sys/arm/tegra/std.tegra2 Sun Sep 16 08:00:29 2012 (r240550) @@ -2,7 +2,7 @@ #$FreeBSD$ cpu CPU_CORTEXA -makeoption ARM_LITTLE_ENDIAN +machine arm armv6 options PHYSADDR=0x00000000 @@ -13,4 +13,4 @@ options KERNVIRTADDR=0xc0200000 options STARTUP_PAGETABLE_ADDR=0x00100000 -files "../tegra/files.tegra2" +files "../tegra/files.tegra2" From owner-svn-src-all@FreeBSD.ORG Sun Sep 16 08:09:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 35241106564A; Sun, 16 Sep 2012 08:09:11 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1615E8FC08; Sun, 16 Sep 2012 08:09:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8G89A5U038290; Sun, 16 Sep 2012 08:09:10 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8G89AUA038288; Sun, 16 Sep 2012 08:09:10 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201209160809.q8G89AUA038288@svn.freebsd.org> From: Andrew Turner Date: Sun, 16 Sep 2012 08:09:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240551 - head/sys/arm/tegra X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Sep 2012 08:09:11 -0000 Author: andrew Date: Sun Sep 16 08:09:10 2012 New Revision: 240551 URL: http://svn.freebsd.org/changeset/base/240551 Log: Start to clean up ARMv6 initarm implementations by making the Tegra 2 version similar to the Ti version. Modified: head/sys/arm/tegra/tegra2_machdep.c Modified: head/sys/arm/tegra/tegra2_machdep.c ============================================================================== --- head/sys/arm/tegra/tegra2_machdep.c Sun Sep 16 08:00:29 2012 (r240550) +++ head/sys/arm/tegra/tegra2_machdep.c Sun Sep 16 08:09:10 2012 (r240551) @@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -83,7 +84,7 @@ __FBSDID("$FreeBSD$"); /* FIXME move to tegrareg.h */ #define TEGRA2_BASE 0xE0000000 /* KVM base for peripherials */ -#define TEGRA2_UARTA_VA_BASE 0xE1006000 +#define TEGRA2_UARTA_VA_BASE 0xE0006000 #define TEGRA2_UARTA_PA_BASE 0x70006000 @@ -96,8 +97,6 @@ __FBSDID("$FreeBSD$"); #define UND_STACK_SIZE 1 #define FIQ_STACK_SIZE 1 -#define PTE_DEVICE 3 - #define debugf(fmt, args...) printf(fmt, ##args) #define KERNEL_PT_SYS 0 /* Page table for mapping proc0 zero page */ @@ -126,12 +125,7 @@ extern u_int undefined_handler_address; struct pv_addr kernel_pt_table[KERNEL_PT_MAX]; - - -static struct pv_addr kernel_l1pt; /* Level-1 page table entry */ - /* Physical and virtual addresses for some global pages */ - vm_paddr_t phys_avail[10]; vm_paddr_t dump_avail[4]; @@ -141,18 +135,17 @@ static int availmem_regions_sz; extern vm_offset_t pmap_bootstrap_lastaddr; vm_offset_t pmap_bootstrap_lastaddr; +vm_paddr_t pmap_pa; const struct pmap_devmap *pmap_devmap_bootstrap_table; struct pv_addr systempage; struct pv_addr msgbufpv; -static struct pv_addr fiqstack; -static struct pv_addr irqstack; -static struct pv_addr undstack; -static struct pv_addr abtstack; -static struct pv_addr kernelstack; +static struct pv_addr irqstack; +static struct pv_addr undstack; +static struct pv_addr abtstack; +static struct pv_addr kernelstack; -#define PHYS2VIRT(x) ((x - KERNPHYSADDR) + KERNVIRTADDR) -#define VIRT2PHYS(x) ((x - KERNVIRTADDR) + KERNPHYSADDR) +static void set_stackptrs(int cpu); static int platform_devmap_init(void); @@ -170,53 +163,6 @@ kenv_next(char *cp) return (cp); } - -/* - * Early Print - */ - -#define DEBUGBUF_SIZE 256 -#define LSR_THRE 0x20 /* Xmit holding register empty */ -#define EARLY_UART_VA_BASE TEGRA2_UARTA_VA_BASE -#define EARLY_UART_PA_BASE TEGRA2_UARTA_PA_BASE -char debugbuf[DEBUGBUF_SIZE]; - -void early_putstr(unsigned char *str) -{ - volatile uint8_t *p_lsr = (volatile uint8_t*) (EARLY_UART_VA_BASE + 0x14); - volatile uint8_t *p_thr = (volatile uint8_t*) (EARLY_UART_VA_BASE + 0x00); - - do { - while ((*p_lsr & LSR_THRE) == 0); - *p_thr = *str; - - if (*str == '\n') - { - while ((*p_lsr & LSR_THRE) == 0); - *p_thr = '\r'; - } - } while (*++str != '\0'); -} - -#if (STARTUP_PAGETABLE_ADDR < PHYSADDR) || \ - (STARTUP_PAGETABLE_ADDR > (PHYSADDR + (64 * 1024 * 1024))) -#error STARTUP_PAGETABLE_ADDR is not within init. MMU table, early print support not possible -#endif - -void -early_print_init(void) -{ - volatile uint32_t *mmu_tbl = (volatile uint32_t*)STARTUP_PAGETABLE_ADDR; - mmu_tbl[(EARLY_UART_VA_BASE >> L1_S_SHIFT)] = L1_TYPE_S | L1_S_AP(AP_KRW) | (EARLY_UART_PA_BASE & L1_S_FRAME); - __asm __volatile ("mcr p15, 0, r0, c8, c7, 0"); /* invalidate I+D TLBs */ - __asm __volatile ("mcr p15, 0, r0, c7, c10, 4"); /* drain the write buffer */ - early_putstr("Early printf initialise\n"); -} - -#define EPRINTF(args...) \ - snprintf(debugbuf,DEBUGBUF_SIZE, ##args ); \ - early_putstr(debugbuf); - static void print_kenv(void) { @@ -348,6 +294,7 @@ physmap_init(void) #define OSC_FREQ_DET_TRIG (1<<31) #define OSC_FREQ_DET_BUSY (1<<31) +#if 0 static int tegra2_osc_freq_detect(void) { @@ -386,73 +333,28 @@ tegra2_osc_freq_detect(void) bus_space_free(fdtbus_bs_tag, bsh, 0x1000); return r; } +#endif void * -initarm(void *mdp, void *unused __unused) +initarm(struct arm_boot_params *abp) { - vm_offset_t freemempos; - vm_offset_t dtbp; - vm_offset_t lastaddr; - vm_offset_t l2_start; - struct pv_addr dpcpu; - uint32_t memsize = 0; - u_int l1pagetable; - uint32_t l2size; - int i = 0; - int j = 0; + struct pv_addr kernel_l1pt; + struct pv_addr dpcpu; + vm_offset_t dtbp, freemempos, l2_start, lastaddr; + uint32_t memsize, l2size; void *kmdp; + u_int l1pagetable; + int i = 0, j = 0, err_devmap = 0; - lastaddr = 0; - dtbp = (vm_offset_t)NULL; - - /* FIXME */ - early_print_init(); - -#define PHYS2VIRT(x) ((x - KERNPHYSADDR) + KERNVIRTADDR) -#define VIRT2PHYS(x) ((x - KERNVIRTADDR) + KERNPHYSADDR) - -#define VALLOC_PAGES(var, np) \ - ALLOC_PAGES((var).pv_pa, (np)); \ - (var).pv_va = PHYS2VIRT((var).pv_pa); - -#define ALLOC_PAGES(var, np) \ - (var) = freemempos; \ - freemempos += (np * PAGE_SIZE); \ - memset((char *)(var), 0, ((np) * PAGE_SIZE)); - -#define ROUND_L_PAGE(x) (((x) + L2_L_OFFSET) & L2_L_FRAME) - + lastaddr = parse_boot_param(abp); + memsize = 0; set_cpufuncs(); - /* - * Mask metadata pointer: it is supposed to be on page boundary. If - * the first argument (mdp) doesn't point to a valid address the - * bootloader must have passed us something else than the metadata - * ptr... In this case we want to fall back to some built-in settings. - */ - mdp = (void *)((uint32_t)mdp & ~PAGE_MASK); - - /* Parse metadata and fetch parameters */ - if (mdp != NULL) { - preload_metadata = mdp; - kmdp = preload_search_by_type("elf kernel"); - if (kmdp != NULL) { - boothowto = MD_FETCH(kmdp, MODINFOMD_HOWTO, int); - kern_envp = MD_FETCH(kmdp, MODINFOMD_ENVP, char *); - dtbp = MD_FETCH(kmdp, MODINFOMD_DTBP, vm_offset_t); - lastaddr = MD_FETCH(kmdp, MODINFOMD_KERNEND, - vm_offset_t); -#ifdef DDB - ksym_start = MD_FETCH(kmdp, MODINFOMD_SSYM, uintptr_t); - ksym_end = MD_FETCH(kmdp, MODINFOMD_ESYM, uintptr_t); -#endif - } - - preload_addr_relocate = KERNVIRTADDR - KERNPHYSADDR; - } else { - /* Fall back to hardcoded metadata. */ - lastaddr = fake_preload_metadata(); - } + kmdp = preload_search_by_type("elf kernel"); + if (kmdp != NULL) + dtbp = MD_FETCH(kmdp, MODINFOMD_DTBP, vm_offset_t); + else + dtbp = (vm_offset_t)NULL; #if defined(FDT_DTB_STATIC) /* @@ -487,18 +389,33 @@ initarm(void *mdp, void *unused __unused /* * Add one table for end of kernel map, one for stacks, msgbuf and - * L1 and L2 tables map and one for vectors map and make it div by 4. + * L1 and L2 tables map and one for vectors map. */ l2size += 3; + + /* Make it divisible by 4 */ l2size = (l2size + 3) & ~3; - freemempos = VIRT2PHYS(ROUND_L_PAGE(lastaddr)); +#define KERNEL_TEXT_BASE (KERNBASE) + freemempos = (lastaddr + PAGE_MASK) & ~PAGE_MASK; - VALLOC_PAGES(kernel_l1pt, L1_TABLE_SIZE / PAGE_SIZE); + /* Define a macro to simplify memory allocation */ +#define valloc_pages(var, np) \ + alloc_pages((var).pv_va, (np)); \ + (var).pv_pa = (var).pv_va + (KERNPHYSADDR - KERNVIRTADDR); + +#define alloc_pages(var, np) \ + (var) = freemempos; \ + freemempos += (np * PAGE_SIZE); \ + memset((char *)(var), 0, ((np) * PAGE_SIZE)); + + while (((freemempos - L1_TABLE_SIZE) & (L1_TABLE_SIZE - 1)) != 0) + freemempos += PAGE_SIZE; + valloc_pages(kernel_l1pt, L1_TABLE_SIZE / PAGE_SIZE); for (i = 0; i < l2size; ++i) { if (!(i % (PAGE_SIZE / L2_TABLE_SIZE_REAL))) { - VALLOC_PAGES(kernel_pt_table[i], + valloc_pages(kernel_pt_table[i], L2_TABLE_SIZE / PAGE_SIZE); j = i; } else { @@ -515,24 +432,21 @@ initarm(void *mdp, void *unused __unused * or 0xffff0000. This page will just contain the system vectors * and can be shared by all processes. */ - - VALLOC_PAGES(systempage, 1); - EPRINTF("systempage PA:0x%08x VA:0x%08x\n", systempage.pv_pa, systempage.pv_va); + valloc_pages(systempage, 1); /* Allocate dynamic per-cpu area. */ - VALLOC_PAGES(dpcpu, DPCPU_SIZE / PAGE_SIZE); + valloc_pages(dpcpu, DPCPU_SIZE / PAGE_SIZE); dpcpu_init((void *)dpcpu.pv_va, 0); /* Allocate stacks for all modes */ - VALLOC_PAGES(fiqstack, FIQ_STACK_SIZE); - VALLOC_PAGES(irqstack, IRQ_STACK_SIZE); - VALLOC_PAGES(abtstack, ABT_STACK_SIZE); - VALLOC_PAGES(undstack, UND_STACK_SIZE); - VALLOC_PAGES(kernelstack, KSTACK_PAGES); + valloc_pages(irqstack, (IRQ_STACK_SIZE * MAXCPU)); + valloc_pages(abtstack, (ABT_STACK_SIZE * MAXCPU)); + valloc_pages(undstack, (UND_STACK_SIZE * MAXCPU)); + valloc_pages(kernelstack, (KSTACK_PAGES * MAXCPU)); init_param1(); - VALLOC_PAGES(msgbufpv, round_page(msgbufsize) / PAGE_SIZE); + valloc_pages(msgbufpv, round_page(msgbufsize) / PAGE_SIZE); /* * Now we start construction of the L1 page table @@ -561,6 +475,7 @@ initarm(void *mdp, void *unused __unused (((uint32_t)(lastaddr) - KERNVIRTADDR) + PAGE_MASK) & ~PAGE_MASK, VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); + /* Map L1 directory and allocated L2 page tables */ pmap_map_chunk(l1pagetable, kernel_l1pt.pv_va, kernel_l1pt.pv_pa, L1_TABLE_SIZE, VM_PROT_READ|VM_PROT_WRITE, PTE_PAGETABLE); @@ -572,7 +487,7 @@ initarm(void *mdp, void *unused __unused /* Map allocated DPCPU, stacks and msgbuf */ pmap_map_chunk(l1pagetable, dpcpu.pv_va, dpcpu.pv_pa, - PHYS2VIRT(freemempos) - dpcpu.pv_va, + freemempos - dpcpu.pv_va, VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); /* Link and map the vector page */ @@ -582,28 +497,37 @@ initarm(void *mdp, void *unused __unused VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE, PTE_CACHE); /* Map pmap_devmap[] entries */ - if (platform_devmap_init() != 0) - while (1); + err_devmap = platform_devmap_init(); pmap_devmap_bootstrap(l1pagetable, pmap_devmap_bootstrap_table); - /* Switch L1 table */ - cpu_domains((DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL*2)) | DOMAIN_CLIENT); + cpu_domains((DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL * 2)) | + DOMAIN_CLIENT); + pmap_pa = kernel_l1pt.pv_pa; setttb(kernel_l1pt.pv_pa); cpu_tlb_flushID(); - cpu_domains((DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL*2))); + cpu_domains(DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL * 2)); + /* + * Only after the SOC registers block is mapped we can perform device + * tree fixups, as they may attempt to read parameters from hardware. + */ OF_interpret("perform-fixup", 0); cninit(); + physmem = memsize / PAGE_SIZE; debugf("initarm: console initialized\n"); - debugf(" arg1 mdp = 0x%08x\n", (uint32_t)mdp); + debugf(" arg1 kmdp = 0x%08x\n", (uint32_t)kmdp); debugf(" boothowto = 0x%08x\n", boothowto); - printf(" dtbp = 0x%08x\n", (uint32_t)dtbp); + debugf(" dtbp = 0x%08x\n", (uint32_t)dtbp); print_kernel_section_addr(); print_kenv(); + if (err_devmap != 0) + printf("WARNING: could not fully configure devmap, error=%d\n", + err_devmap); + /* * Pages were allocated during the secondary bootstrap for the * stacks for different CPU modes. @@ -613,14 +537,8 @@ initarm(void *mdp, void *unused __unused * of the stack memory. */ cpu_control(CPU_CONTROL_MMU_ENABLE, CPU_CONTROL_MMU_ENABLE); - set_stackptr(PSR_FIQ32_MODE, - fiqstack.pv_va + FIQ_STACK_SIZE * PAGE_SIZE); - set_stackptr(PSR_IRQ32_MODE, - irqstack.pv_va + IRQ_STACK_SIZE * PAGE_SIZE); - set_stackptr(PSR_ABT32_MODE, - abtstack.pv_va + ABT_STACK_SIZE * PAGE_SIZE); - set_stackptr(PSR_UND32_MODE, - undstack.pv_va + UND_STACK_SIZE * PAGE_SIZE); + + set_stackptrs(0); /* * We must now clean the cache again.... @@ -643,12 +561,8 @@ initarm(void *mdp, void *unused __unused init_proc0(kernelstack.pv_va); arm_vector_init(ARM_VECTORS_HIGH, ARM_VEC_ALL); - dump_avail[0] = 0; - dump_avail[1] = memsize; - dump_avail[2] = 0; - dump_avail[3] = 0; - - pmap_bootstrap(PHYS2VIRT(freemempos), pmap_bootstrap_lastaddr, &kernel_l1pt); + arm_dump_avail_init(memsize, sizeof(dump_avail) / sizeof(dump_avail[0])); + pmap_bootstrap(freemempos, pmap_bootstrap_lastaddr, &kernel_l1pt); msgbufp = (void *)msgbufpv.pv_va; msgbufinit(msgbufp, msgbufsize); mutex_init(); @@ -656,16 +570,29 @@ initarm(void *mdp, void *unused __unused /* * Prepare map of physical memory regions available to vm subsystem. */ - physmap_init(); /* Do basic tuning, hz etc */ init_param2(physmem); kdb_init(); + return ((void *)(kernelstack.pv_va + USPACE_SVC_STACK_TOP - sizeof(struct pcb))); } +static void +set_stackptrs(int cpu) +{ + + set_stackptr(PSR_IRQ32_MODE, + irqstack.pv_va + ((IRQ_STACK_SIZE * PAGE_SIZE) * (cpu + 1))); + set_stackptr(PSR_ABT32_MODE, + abtstack.pv_va + ((ABT_STACK_SIZE * PAGE_SIZE) * (cpu + 1))); + set_stackptr(PSR_UND32_MODE, + undstack.pv_va + ((UND_STACK_SIZE * PAGE_SIZE) * (cpu + 1))); +} + + #define FDT_DEVMAP_MAX (1 + 2 + 1 + 1) /* FIXME */ static struct pmap_devmap fdt_devmap[FDT_DEVMAP_MAX] = { { 0, 0, 0, 0, 0, } @@ -689,7 +616,6 @@ platform_devmap_init(void) return (0); } - struct arm32_dma_range * bus_dma_get_range(void) { From owner-svn-src-all@FreeBSD.ORG Sun Sep 16 08:42:41 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 29E52106566B; Sun, 16 Sep 2012 08:42:41 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0BABE8FC12; Sun, 16 Sep 2012 08:42:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8G8ge5F043358; Sun, 16 Sep 2012 08:42:41 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8G8gelW043344; Sun, 16 Sep 2012 08:42:40 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201209160842.q8G8gelW043344@svn.freebsd.org> From: Alexander Motin Date: Sun, 16 Sep 2012 08:42:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240552 - stable/9/sys/geom/raid X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Sep 2012 08:42:41 -0000 Author: mav Date: Sun Sep 16 08:42:40 2012 New Revision: 240552 URL: http://svn.freebsd.org/changeset/base/240552 Log: MFC r240465: Add global and per-module sysctls/tunables to enable/disable metadata taste. That should help to handle some cases when disk has some RAID metadata that should be ignored, especially during boot. Modified: stable/9/sys/geom/raid/g_raid.c stable/9/sys/geom/raid/g_raid.h stable/9/sys/geom/raid/md_ddf.c stable/9/sys/geom/raid/md_intel.c stable/9/sys/geom/raid/md_jmicron.c stable/9/sys/geom/raid/md_nvidia.c stable/9/sys/geom/raid/md_promise.c stable/9/sys/geom/raid/md_sii.c stable/9/sys/geom/raid/tr_concat.c stable/9/sys/geom/raid/tr_raid0.c stable/9/sys/geom/raid/tr_raid1.c stable/9/sys/geom/raid/tr_raid1e.c stable/9/sys/geom/raid/tr_raid5.c Directory Properties: stable/9/share/man/man4/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sys/geom/raid/g_raid.c ============================================================================== --- stable/9/sys/geom/raid/g_raid.c Sun Sep 16 08:09:10 2012 (r240551) +++ stable/9/sys/geom/raid/g_raid.c Sun Sep 16 08:42:40 2012 (r240552) @@ -52,6 +52,10 @@ static MALLOC_DEFINE(M_RAID, "raid_data" SYSCTL_DECL(_kern_geom); SYSCTL_NODE(_kern_geom, OID_AUTO, raid, CTLFLAG_RW, 0, "GEOM_RAID stuff"); +int g_raid_enable = 1; +TUNABLE_INT("kern.geom.raid.enable", &g_raid_enable); +SYSCTL_INT(_kern_geom_raid, OID_AUTO, enable, CTLFLAG_RW, + &g_raid_enable, 0, "Enable on-disk metadata taste"); u_int g_raid_aggressive_spare = 0; TUNABLE_INT("kern.geom.raid.aggressive_spare", &g_raid_aggressive_spare); SYSCTL_UINT(_kern_geom_raid, OID_AUTO, aggressive_spare, CTLFLAG_RW, @@ -1920,6 +1924,8 @@ int g_raid_start_volume(struct g_raid_vo G_RAID_DEBUG1(2, vol->v_softc, "Starting volume %s.", vol->v_name); LIST_FOREACH(class, &g_raid_tr_classes, trc_list) { + if (!class->trc_enable) + continue; G_RAID_DEBUG1(2, vol->v_softc, "Tasting volume %s for %s transformation.", vol->v_name, class->name); @@ -2142,6 +2148,8 @@ g_raid_taste(struct g_class *mp, struct g_topology_assert(); g_trace(G_T_TOPOLOGY, "%s(%s, %s)", __func__, mp->name, pp->name); + if (!g_raid_enable) + return (NULL); G_RAID_DEBUG(2, "Tasting provider %s.", pp->name); gp = g_new_geomf(mp, "raid:taste"); @@ -2154,6 +2162,8 @@ g_raid_taste(struct g_class *mp, struct geom = NULL; LIST_FOREACH(class, &g_raid_md_classes, mdc_list) { + if (!class->mdc_enable) + continue; G_RAID_DEBUG(2, "Tasting provider %s for %s metadata.", pp->name, class->name); obj = (void *)kobj_create((kobj_class_t)class, M_RAID, Modified: stable/9/sys/geom/raid/g_raid.h ============================================================================== --- stable/9/sys/geom/raid/g_raid.h Sun Sep 16 08:09:10 2012 (r240551) +++ stable/9/sys/geom/raid/g_raid.h Sun Sep 16 08:42:40 2012 (r240552) @@ -33,6 +33,9 @@ #include #include #include +#ifdef _KERNEL +#include +#endif #define G_RAID_CLASS_NAME "RAID" @@ -51,6 +54,7 @@ struct g_raid_tr_object; #ifdef _KERNEL extern u_int g_raid_aggressive_spare; extern u_int g_raid_debug; +extern int g_raid_enable; extern int g_raid_read_err_thresh; extern u_int g_raid_start_timeout; extern struct g_class g_raid_class; @@ -322,11 +326,14 @@ struct g_raid_softc { }; #define sc_name sc_geom->name +SYSCTL_DECL(_kern_geom_raid); + /* * KOBJ parent class of metadata processing modules. */ struct g_raid_md_class { KOBJ_CLASS_FIELDS; + int mdc_enable; int mdc_priority; LIST_ENTRY(g_raid_md_class) mdc_list; }; @@ -342,20 +349,29 @@ struct g_raid_md_object { int g_raid_md_modevent(module_t, int, void *); -#define G_RAID_MD_DECLARE(name) \ - static moduledata_t name##_mod = { \ - #name, \ +#define G_RAID_MD_DECLARE(name, label) \ + static moduledata_t g_raid_md_##name##_mod = { \ + "g_raid_md_" __XSTRING(name), \ g_raid_md_modevent, \ - &name##_class \ + &g_raid_md_##name##_class \ }; \ - DECLARE_MODULE(name, name##_mod, SI_SUB_DRIVERS, SI_ORDER_SECOND); \ - MODULE_DEPEND(name, geom_raid, 0, 0, 0) + DECLARE_MODULE(g_raid_md_##name, g_raid_md_##name##_mod, \ + SI_SUB_DRIVERS, SI_ORDER_SECOND); \ + MODULE_DEPEND(g_raid_md_##name, geom_raid, 0, 0, 0); \ + SYSCTL_NODE(_kern_geom_raid, OID_AUTO, name, CTLFLAG_RD, \ + NULL, label " metadata module"); \ + SYSCTL_INT(_kern_geom_raid_##name, OID_AUTO, enable, \ + CTLFLAG_RW, &g_raid_md_##name##_class.mdc_enable, 0, \ + "Enable " label " metadata format taste"); \ + TUNABLE_INT("kern.geom.raid." __XSTRING(name) ".enable", \ + &g_raid_md_##name##_class.mdc_enable) /* * KOBJ parent class of data transformation modules. */ struct g_raid_tr_class { KOBJ_CLASS_FIELDS; + int trc_enable; int trc_priority; LIST_ENTRY(g_raid_tr_class) trc_list; }; @@ -371,14 +387,22 @@ struct g_raid_tr_object { int g_raid_tr_modevent(module_t, int, void *); -#define G_RAID_TR_DECLARE(name) \ - static moduledata_t name##_mod = { \ - #name, \ +#define G_RAID_TR_DECLARE(name, label) \ + static moduledata_t g_raid_tr_##name##_mod = { \ + "g_raid_tr_" __XSTRING(name), \ g_raid_tr_modevent, \ - &name##_class \ + &g_raid_tr_##name##_class \ }; \ - DECLARE_MODULE(name, name##_mod, SI_SUB_DRIVERS, SI_ORDER_FIRST); \ - MODULE_DEPEND(name, geom_raid, 0, 0, 0) + DECLARE_MODULE(g_raid_tr_##name, g_raid_tr_##name##_mod, \ + SI_SUB_DRIVERS, SI_ORDER_FIRST); \ + MODULE_DEPEND(g_raid_tr_##name, geom_raid, 0, 0, 0); \ + SYSCTL_NODE(_kern_geom_raid, OID_AUTO, name, CTLFLAG_RD, \ + NULL, label " transformation module"); \ + SYSCTL_INT(_kern_geom_raid_##name, OID_AUTO, enable, \ + CTLFLAG_RW, &g_raid_tr_##name##_class.trc_enable, 0, \ + "Enable " label " transformation module taste"); \ + TUNABLE_INT("kern.geom.raid." __XSTRING(name) ".enable", \ + &g_raid_tr_##name##_class.trc_enable) const char * g_raid_volume_level2str(int level, int qual); int g_raid_volume_str2level(const char *str, int *level, int *qual); Modified: stable/9/sys/geom/raid/md_ddf.c ============================================================================== --- stable/9/sys/geom/raid/md_ddf.c Sun Sep 16 08:09:10 2012 (r240551) +++ stable/9/sys/geom/raid/md_ddf.c Sun Sep 16 08:42:40 2012 (r240552) @@ -125,6 +125,7 @@ static struct g_raid_md_class g_raid_md_ "DDF", g_raid_md_ddf_methods, sizeof(struct g_raid_md_ddf_object), + .mdc_enable = 1, .mdc_priority = 100 }; @@ -3065,4 +3066,4 @@ g_raid_md_free_ddf(struct g_raid_md_obje return (0); } -G_RAID_MD_DECLARE(g_raid_md_ddf); +G_RAID_MD_DECLARE(ddf, "DDF"); Modified: stable/9/sys/geom/raid/md_intel.c ============================================================================== --- stable/9/sys/geom/raid/md_intel.c Sun Sep 16 08:09:10 2012 (r240551) +++ stable/9/sys/geom/raid/md_intel.c Sun Sep 16 08:42:40 2012 (r240552) @@ -224,6 +224,7 @@ static struct g_raid_md_class g_raid_md_ "Intel", g_raid_md_intel_methods, sizeof(struct g_raid_md_intel_object), + .mdc_enable = 1, .mdc_priority = 100 }; @@ -2432,4 +2433,4 @@ g_raid_md_free_intel(struct g_raid_md_ob return (0); } -G_RAID_MD_DECLARE(g_raid_md_intel); +G_RAID_MD_DECLARE(intel, "Intel"); Modified: stable/9/sys/geom/raid/md_jmicron.c ============================================================================== --- stable/9/sys/geom/raid/md_jmicron.c Sun Sep 16 08:09:10 2012 (r240551) +++ stable/9/sys/geom/raid/md_jmicron.c Sun Sep 16 08:42:40 2012 (r240552) @@ -132,6 +132,7 @@ static struct g_raid_md_class g_raid_md_ "JMicron", g_raid_md_jmicron_methods, sizeof(struct g_raid_md_jmicron_object), + .mdc_enable = 1, .mdc_priority = 100 }; @@ -1581,4 +1582,4 @@ g_raid_md_free_jmicron(struct g_raid_md_ return (0); } -G_RAID_MD_DECLARE(g_raid_md_jmicron); +G_RAID_MD_DECLARE(jmicron, "JMicron"); Modified: stable/9/sys/geom/raid/md_nvidia.c ============================================================================== --- stable/9/sys/geom/raid/md_nvidia.c Sun Sep 16 08:09:10 2012 (r240551) +++ stable/9/sys/geom/raid/md_nvidia.c Sun Sep 16 08:42:40 2012 (r240552) @@ -143,6 +143,7 @@ static struct g_raid_md_class g_raid_md_ "NVIDIA", g_raid_md_nvidia_methods, sizeof(struct g_raid_md_nvidia_object), + .mdc_enable = 1, .mdc_priority = 100 }; @@ -1600,4 +1601,4 @@ g_raid_md_free_nvidia(struct g_raid_md_o return (0); } -G_RAID_MD_DECLARE(g_raid_md_nvidia); +G_RAID_MD_DECLARE(nvidia, "NVIDIA"); Modified: stable/9/sys/geom/raid/md_promise.c ============================================================================== --- stable/9/sys/geom/raid/md_promise.c Sun Sep 16 08:09:10 2012 (r240551) +++ stable/9/sys/geom/raid/md_promise.c Sun Sep 16 08:42:40 2012 (r240552) @@ -171,6 +171,7 @@ static struct g_raid_md_class g_raid_md_ "Promise", g_raid_md_promise_methods, sizeof(struct g_raid_md_object), + .mdc_enable = 1, .mdc_priority = 100 }; @@ -1967,4 +1968,4 @@ g_raid_md_free_promise(struct g_raid_md_ return (0); } -G_RAID_MD_DECLARE(g_raid_md_promise); +G_RAID_MD_DECLARE(promise, "Promise"); Modified: stable/9/sys/geom/raid/md_sii.c ============================================================================== --- stable/9/sys/geom/raid/md_sii.c Sun Sep 16 08:09:10 2012 (r240551) +++ stable/9/sys/geom/raid/md_sii.c Sun Sep 16 08:42:40 2012 (r240552) @@ -140,6 +140,7 @@ static struct g_raid_md_class g_raid_md_ "SiI", g_raid_md_sii_methods, sizeof(struct g_raid_md_sii_object), + .mdc_enable = 1, .mdc_priority = 100 }; @@ -1688,4 +1689,4 @@ g_raid_md_free_sii(struct g_raid_md_obje return (0); } -G_RAID_MD_DECLARE(g_raid_md_sii); +G_RAID_MD_DECLARE(sii, "SiI"); Modified: stable/9/sys/geom/raid/tr_concat.c ============================================================================== --- stable/9/sys/geom/raid/tr_concat.c Sun Sep 16 08:09:10 2012 (r240551) +++ stable/9/sys/geom/raid/tr_concat.c Sun Sep 16 08:42:40 2012 (r240552) @@ -73,6 +73,7 @@ static struct g_raid_tr_class g_raid_tr_ "CONCAT", g_raid_tr_concat_methods, sizeof(struct g_raid_tr_concat_object), + .trc_enable = 1, .trc_priority = 50 }; @@ -340,4 +341,4 @@ g_raid_tr_free_concat(struct g_raid_tr_o return (0); } -G_RAID_TR_DECLARE(g_raid_tr_concat); +G_RAID_TR_DECLARE(concat, "CONCAT"); Modified: stable/9/sys/geom/raid/tr_raid0.c ============================================================================== --- stable/9/sys/geom/raid/tr_raid0.c Sun Sep 16 08:09:10 2012 (r240551) +++ stable/9/sys/geom/raid/tr_raid0.c Sun Sep 16 08:42:40 2012 (r240552) @@ -73,6 +73,7 @@ static struct g_raid_tr_class g_raid_tr_ "RAID0", g_raid_tr_raid0_methods, sizeof(struct g_raid_tr_raid0_object), + .trc_enable = 1, .trc_priority = 100 }; @@ -323,4 +324,4 @@ g_raid_tr_free_raid0(struct g_raid_tr_ob return (0); } -G_RAID_TR_DECLARE(g_raid_tr_raid0); +G_RAID_TR_DECLARE(raid0, "RAID0"); Modified: stable/9/sys/geom/raid/tr_raid1.c ============================================================================== --- stable/9/sys/geom/raid/tr_raid1.c Sun Sep 16 08:09:10 2012 (r240551) +++ stable/9/sys/geom/raid/tr_raid1.c Sun Sep 16 08:42:40 2012 (r240552) @@ -42,9 +42,7 @@ __FBSDID("$FreeBSD$"); #include "geom/raid/g_raid.h" #include "g_raid_tr_if.h" -SYSCTL_DECL(_kern_geom_raid); -SYSCTL_NODE(_kern_geom_raid, OID_AUTO, raid1, CTLFLAG_RW, 0, - "RAID1 parameters"); +SYSCTL_DECL(_kern_geom_raid_raid1); #define RAID1_REBUILD_SLAB (1 << 20) /* One transation in a rebuild */ static int g_raid1_rebuild_slab = RAID1_REBUILD_SLAB; @@ -131,6 +129,7 @@ static struct g_raid_tr_class g_raid_tr_ "RAID1", g_raid_tr_raid1_methods, sizeof(struct g_raid_tr_raid1_object), + .trc_enable = 1, .trc_priority = 100 }; @@ -996,4 +995,4 @@ g_raid_tr_free_raid1(struct g_raid_tr_ob return (0); } -G_RAID_TR_DECLARE(g_raid_tr_raid1); +G_RAID_TR_DECLARE(raid1, "RAID1"); Modified: stable/9/sys/geom/raid/tr_raid1e.c ============================================================================== --- stable/9/sys/geom/raid/tr_raid1e.c Sun Sep 16 08:09:10 2012 (r240551) +++ stable/9/sys/geom/raid/tr_raid1e.c Sun Sep 16 08:42:40 2012 (r240552) @@ -44,9 +44,7 @@ __FBSDID("$FreeBSD$"); #define N 2 -SYSCTL_DECL(_kern_geom_raid); -SYSCTL_NODE(_kern_geom_raid, OID_AUTO, raid1e, CTLFLAG_RW, 0, - "RAID1E parameters"); +SYSCTL_DECL(_kern_geom_raid_raid1e); #define RAID1E_REBUILD_SLAB (1 << 20) /* One transation in a rebuild */ static int g_raid1e_rebuild_slab = RAID1E_REBUILD_SLAB; @@ -135,6 +133,7 @@ static struct g_raid_tr_class g_raid_tr_ "RAID1E", g_raid_tr_raid1e_methods, sizeof(struct g_raid_tr_raid1e_object), + .trc_enable = 1, .trc_priority = 200 }; @@ -1236,4 +1235,4 @@ g_raid_tr_free_raid1e(struct g_raid_tr_o return (0); } -G_RAID_TR_DECLARE(g_raid_tr_raid1e); +G_RAID_TR_DECLARE(raid1e, "RAID1E"); Modified: stable/9/sys/geom/raid/tr_raid5.c ============================================================================== --- stable/9/sys/geom/raid/tr_raid5.c Sun Sep 16 08:09:10 2012 (r240551) +++ stable/9/sys/geom/raid/tr_raid5.c Sun Sep 16 08:42:40 2012 (r240552) @@ -42,8 +42,6 @@ __FBSDID("$FreeBSD$"); #include "geom/raid/g_raid.h" #include "g_raid_tr_if.h" -SYSCTL_DECL(_kern_geom_raid); - static MALLOC_DEFINE(M_TR_RAID5, "tr_raid5_data", "GEOM_RAID RAID5 data"); #define TR_RAID5_NONE 0 @@ -95,6 +93,7 @@ static struct g_raid_tr_class g_raid_tr_ "RAID5", g_raid_tr_raid5_methods, sizeof(struct g_raid_tr_raid5_object), + .trc_enable = 1, .trc_priority = 100 }; @@ -419,4 +418,4 @@ g_raid_tr_free_raid5(struct g_raid_tr_ob return (0); } -G_RAID_TR_DECLARE(g_raid_tr_raid5); +G_RAID_TR_DECLARE(raid5, "RAID5"); From owner-svn-src-all@FreeBSD.ORG Sun Sep 16 08:44:56 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1856D106566B; Sun, 16 Sep 2012 08:44:56 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DDAC98FC08; Sun, 16 Sep 2012 08:44:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8G8itMQ043781; Sun, 16 Sep 2012 08:44:55 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8G8itGJ043780; Sun, 16 Sep 2012 08:44:55 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201209160844.q8G8itGJ043780@svn.freebsd.org> From: Alexander Motin Date: Sun, 16 Sep 2012 08:44:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240553 - stable/8/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Sep 2012 08:44:56 -0000 Author: mav Date: Sun Sep 16 08:44:55 2012 New Revision: 240553 URL: http://svn.freebsd.org/changeset/base/240553 Log: MFC r240465: Add global and per-module sysctls/tunables to enable/disable metadata taste. That should help to handle some cases when disk has some RAID metadata that should be ignored, especially during boot. Modified: Directory Properties: stable/8/share/man/man4/ (props changed) From owner-svn-src-all@FreeBSD.ORG Sun Sep 16 08:58:35 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 197B81065675; Sun, 16 Sep 2012 08:58:35 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EED6F8FC16; Sun, 16 Sep 2012 08:58:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8G8wYk2045858; Sun, 16 Sep 2012 08:58:34 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8G8wYQT045844; Sun, 16 Sep 2012 08:58:34 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201209160858.q8G8wYQT045844@svn.freebsd.org> From: Alexander Motin Date: Sun, 16 Sep 2012 08:58: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: r240554 - stable/8/sys/geom/raid X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Sep 2012 08:58:35 -0000 Author: mav Date: Sun Sep 16 08:58:34 2012 New Revision: 240554 URL: http://svn.freebsd.org/changeset/base/240554 Log: MFC r240465: Add global and per-module sysctls/tunables to enable/disable metadata taste. That should help to handle some cases when disk has some RAID metadata that should be ignored, especially during boot. pR: Modified: stable/8/sys/geom/raid/g_raid.c stable/8/sys/geom/raid/g_raid.h stable/8/sys/geom/raid/md_ddf.c stable/8/sys/geom/raid/md_intel.c stable/8/sys/geom/raid/md_jmicron.c stable/8/sys/geom/raid/md_nvidia.c stable/8/sys/geom/raid/md_promise.c stable/8/sys/geom/raid/md_sii.c stable/8/sys/geom/raid/tr_concat.c stable/8/sys/geom/raid/tr_raid0.c stable/8/sys/geom/raid/tr_raid1.c stable/8/sys/geom/raid/tr_raid1e.c stable/8/sys/geom/raid/tr_raid5.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/geom/ (props changed) Modified: stable/8/sys/geom/raid/g_raid.c ============================================================================== --- stable/8/sys/geom/raid/g_raid.c Sun Sep 16 08:44:55 2012 (r240553) +++ stable/8/sys/geom/raid/g_raid.c Sun Sep 16 08:58:34 2012 (r240554) @@ -51,6 +51,10 @@ static MALLOC_DEFINE(M_RAID, "raid_data" SYSCTL_DECL(_kern_geom); SYSCTL_NODE(_kern_geom, OID_AUTO, raid, CTLFLAG_RW, 0, "GEOM_RAID stuff"); +int g_raid_enable = 1; +TUNABLE_INT("kern.geom.raid.enable", &g_raid_enable); +SYSCTL_INT(_kern_geom_raid, OID_AUTO, enable, CTLFLAG_RW, + &g_raid_enable, 0, "Enable on-disk metadata taste"); u_int g_raid_aggressive_spare = 0; TUNABLE_INT("kern.geom.raid.aggressive_spare", &g_raid_aggressive_spare); SYSCTL_UINT(_kern_geom_raid, OID_AUTO, aggressive_spare, CTLFLAG_RW, @@ -1919,6 +1923,8 @@ int g_raid_start_volume(struct g_raid_vo G_RAID_DEBUG1(2, vol->v_softc, "Starting volume %s.", vol->v_name); LIST_FOREACH(class, &g_raid_tr_classes, trc_list) { + if (!class->trc_enable) + continue; G_RAID_DEBUG1(2, vol->v_softc, "Tasting volume %s for %s transformation.", vol->v_name, class->name); @@ -2141,6 +2147,8 @@ g_raid_taste(struct g_class *mp, struct g_topology_assert(); g_trace(G_T_TOPOLOGY, "%s(%s, %s)", __func__, mp->name, pp->name); + if (!g_raid_enable) + return (NULL); G_RAID_DEBUG(2, "Tasting provider %s.", pp->name); gp = g_new_geomf(mp, "raid:taste"); @@ -2153,6 +2161,8 @@ g_raid_taste(struct g_class *mp, struct geom = NULL; LIST_FOREACH(class, &g_raid_md_classes, mdc_list) { + if (!class->mdc_enable) + continue; G_RAID_DEBUG(2, "Tasting provider %s for %s metadata.", pp->name, class->name); obj = (void *)kobj_create((kobj_class_t)class, M_RAID, Modified: stable/8/sys/geom/raid/g_raid.h ============================================================================== --- stable/8/sys/geom/raid/g_raid.h Sun Sep 16 08:44:55 2012 (r240553) +++ stable/8/sys/geom/raid/g_raid.h Sun Sep 16 08:58:34 2012 (r240554) @@ -33,6 +33,9 @@ #include #include #include +#ifdef _KERNEL +#include +#endif #define G_RAID_CLASS_NAME "RAID" @@ -51,6 +54,7 @@ struct g_raid_tr_object; #ifdef _KERNEL extern u_int g_raid_aggressive_spare; extern u_int g_raid_debug; +extern int g_raid_enable; extern int g_raid_read_err_thresh; extern u_int g_raid_start_timeout; extern struct g_class g_raid_class; @@ -322,11 +326,14 @@ struct g_raid_softc { }; #define sc_name sc_geom->name +SYSCTL_DECL(_kern_geom_raid); + /* * KOBJ parent class of metadata processing modules. */ struct g_raid_md_class { KOBJ_CLASS_FIELDS; + int mdc_enable; int mdc_priority; LIST_ENTRY(g_raid_md_class) mdc_list; }; @@ -342,20 +349,29 @@ struct g_raid_md_object { int g_raid_md_modevent(module_t, int, void *); -#define G_RAID_MD_DECLARE(name) \ - static moduledata_t name##_mod = { \ - #name, \ +#define G_RAID_MD_DECLARE(name, label) \ + static moduledata_t g_raid_md_##name##_mod = { \ + "g_raid_md_" __XSTRING(name), \ g_raid_md_modevent, \ - &name##_class \ + &g_raid_md_##name##_class \ }; \ - DECLARE_MODULE(name, name##_mod, SI_SUB_DRIVERS, SI_ORDER_SECOND); \ - MODULE_DEPEND(name, geom_raid, 0, 0, 0) + DECLARE_MODULE(g_raid_md_##name, g_raid_md_##name##_mod, \ + SI_SUB_DRIVERS, SI_ORDER_SECOND); \ + MODULE_DEPEND(g_raid_md_##name, geom_raid, 0, 0, 0); \ + SYSCTL_NODE(_kern_geom_raid, OID_AUTO, name, CTLFLAG_RD, \ + NULL, label " metadata module"); \ + SYSCTL_INT(_kern_geom_raid_##name, OID_AUTO, enable, \ + CTLFLAG_RW, &g_raid_md_##name##_class.mdc_enable, 0, \ + "Enable " label " metadata format taste"); \ + TUNABLE_INT("kern.geom.raid." __XSTRING(name) ".enable", \ + &g_raid_md_##name##_class.mdc_enable) /* * KOBJ parent class of data transformation modules. */ struct g_raid_tr_class { KOBJ_CLASS_FIELDS; + int trc_enable; int trc_priority; LIST_ENTRY(g_raid_tr_class) trc_list; }; @@ -371,14 +387,22 @@ struct g_raid_tr_object { int g_raid_tr_modevent(module_t, int, void *); -#define G_RAID_TR_DECLARE(name) \ - static moduledata_t name##_mod = { \ - #name, \ +#define G_RAID_TR_DECLARE(name, label) \ + static moduledata_t g_raid_tr_##name##_mod = { \ + "g_raid_tr_" __XSTRING(name), \ g_raid_tr_modevent, \ - &name##_class \ + &g_raid_tr_##name##_class \ }; \ - DECLARE_MODULE(name, name##_mod, SI_SUB_DRIVERS, SI_ORDER_FIRST); \ - MODULE_DEPEND(name, geom_raid, 0, 0, 0) + DECLARE_MODULE(g_raid_tr_##name, g_raid_tr_##name##_mod, \ + SI_SUB_DRIVERS, SI_ORDER_FIRST); \ + MODULE_DEPEND(g_raid_tr_##name, geom_raid, 0, 0, 0); \ + SYSCTL_NODE(_kern_geom_raid, OID_AUTO, name, CTLFLAG_RD, \ + NULL, label " transformation module"); \ + SYSCTL_INT(_kern_geom_raid_##name, OID_AUTO, enable, \ + CTLFLAG_RW, &g_raid_tr_##name##_class.trc_enable, 0, \ + "Enable " label " transformation module taste"); \ + TUNABLE_INT("kern.geom.raid." __XSTRING(name) ".enable", \ + &g_raid_tr_##name##_class.trc_enable) const char * g_raid_volume_level2str(int level, int qual); int g_raid_volume_str2level(const char *str, int *level, int *qual); Modified: stable/8/sys/geom/raid/md_ddf.c ============================================================================== --- stable/8/sys/geom/raid/md_ddf.c Sun Sep 16 08:44:55 2012 (r240553) +++ stable/8/sys/geom/raid/md_ddf.c Sun Sep 16 08:58:34 2012 (r240554) @@ -125,6 +125,7 @@ static struct g_raid_md_class g_raid_md_ "DDF", g_raid_md_ddf_methods, sizeof(struct g_raid_md_ddf_object), + .mdc_enable = 1, .mdc_priority = 100 }; @@ -3065,4 +3066,4 @@ g_raid_md_free_ddf(struct g_raid_md_obje return (0); } -G_RAID_MD_DECLARE(g_raid_md_ddf); +G_RAID_MD_DECLARE(ddf, "DDF"); Modified: stable/8/sys/geom/raid/md_intel.c ============================================================================== --- stable/8/sys/geom/raid/md_intel.c Sun Sep 16 08:44:55 2012 (r240553) +++ stable/8/sys/geom/raid/md_intel.c Sun Sep 16 08:58:34 2012 (r240554) @@ -224,6 +224,7 @@ static struct g_raid_md_class g_raid_md_ "Intel", g_raid_md_intel_methods, sizeof(struct g_raid_md_intel_object), + .mdc_enable = 1, .mdc_priority = 100 }; @@ -2432,4 +2433,4 @@ g_raid_md_free_intel(struct g_raid_md_ob return (0); } -G_RAID_MD_DECLARE(g_raid_md_intel); +G_RAID_MD_DECLARE(intel, "Intel"); Modified: stable/8/sys/geom/raid/md_jmicron.c ============================================================================== --- stable/8/sys/geom/raid/md_jmicron.c Sun Sep 16 08:44:55 2012 (r240553) +++ stable/8/sys/geom/raid/md_jmicron.c Sun Sep 16 08:58:34 2012 (r240554) @@ -132,6 +132,7 @@ static struct g_raid_md_class g_raid_md_ "JMicron", g_raid_md_jmicron_methods, sizeof(struct g_raid_md_jmicron_object), + .mdc_enable = 1, .mdc_priority = 100 }; @@ -1581,4 +1582,4 @@ g_raid_md_free_jmicron(struct g_raid_md_ return (0); } -G_RAID_MD_DECLARE(g_raid_md_jmicron); +G_RAID_MD_DECLARE(jmicron, "JMicron"); Modified: stable/8/sys/geom/raid/md_nvidia.c ============================================================================== --- stable/8/sys/geom/raid/md_nvidia.c Sun Sep 16 08:44:55 2012 (r240553) +++ stable/8/sys/geom/raid/md_nvidia.c Sun Sep 16 08:58:34 2012 (r240554) @@ -143,6 +143,7 @@ static struct g_raid_md_class g_raid_md_ "NVIDIA", g_raid_md_nvidia_methods, sizeof(struct g_raid_md_nvidia_object), + .mdc_enable = 1, .mdc_priority = 100 }; @@ -1600,4 +1601,4 @@ g_raid_md_free_nvidia(struct g_raid_md_o return (0); } -G_RAID_MD_DECLARE(g_raid_md_nvidia); +G_RAID_MD_DECLARE(nvidia, "NVIDIA"); Modified: stable/8/sys/geom/raid/md_promise.c ============================================================================== --- stable/8/sys/geom/raid/md_promise.c Sun Sep 16 08:44:55 2012 (r240553) +++ stable/8/sys/geom/raid/md_promise.c Sun Sep 16 08:58:34 2012 (r240554) @@ -171,6 +171,7 @@ static struct g_raid_md_class g_raid_md_ "Promise", g_raid_md_promise_methods, sizeof(struct g_raid_md_object), + .mdc_enable = 1, .mdc_priority = 100 }; @@ -1967,4 +1968,4 @@ g_raid_md_free_promise(struct g_raid_md_ return (0); } -G_RAID_MD_DECLARE(g_raid_md_promise); +G_RAID_MD_DECLARE(promise, "Promise"); Modified: stable/8/sys/geom/raid/md_sii.c ============================================================================== --- stable/8/sys/geom/raid/md_sii.c Sun Sep 16 08:44:55 2012 (r240553) +++ stable/8/sys/geom/raid/md_sii.c Sun Sep 16 08:58:34 2012 (r240554) @@ -140,6 +140,7 @@ static struct g_raid_md_class g_raid_md_ "SiI", g_raid_md_sii_methods, sizeof(struct g_raid_md_sii_object), + .mdc_enable = 1, .mdc_priority = 100 }; @@ -1688,4 +1689,4 @@ g_raid_md_free_sii(struct g_raid_md_obje return (0); } -G_RAID_MD_DECLARE(g_raid_md_sii); +G_RAID_MD_DECLARE(sii, "SiI"); Modified: stable/8/sys/geom/raid/tr_concat.c ============================================================================== --- stable/8/sys/geom/raid/tr_concat.c Sun Sep 16 08:44:55 2012 (r240553) +++ stable/8/sys/geom/raid/tr_concat.c Sun Sep 16 08:58:34 2012 (r240554) @@ -73,6 +73,7 @@ static struct g_raid_tr_class g_raid_tr_ "CONCAT", g_raid_tr_concat_methods, sizeof(struct g_raid_tr_concat_object), + .trc_enable = 1, .trc_priority = 50 }; @@ -340,4 +341,4 @@ g_raid_tr_free_concat(struct g_raid_tr_o return (0); } -G_RAID_TR_DECLARE(g_raid_tr_concat); +G_RAID_TR_DECLARE(concat, "CONCAT"); Modified: stable/8/sys/geom/raid/tr_raid0.c ============================================================================== --- stable/8/sys/geom/raid/tr_raid0.c Sun Sep 16 08:44:55 2012 (r240553) +++ stable/8/sys/geom/raid/tr_raid0.c Sun Sep 16 08:58:34 2012 (r240554) @@ -73,6 +73,7 @@ static struct g_raid_tr_class g_raid_tr_ "RAID0", g_raid_tr_raid0_methods, sizeof(struct g_raid_tr_raid0_object), + .trc_enable = 1, .trc_priority = 100 }; @@ -323,4 +324,4 @@ g_raid_tr_free_raid0(struct g_raid_tr_ob return (0); } -G_RAID_TR_DECLARE(g_raid_tr_raid0); +G_RAID_TR_DECLARE(raid0, "RAID0"); Modified: stable/8/sys/geom/raid/tr_raid1.c ============================================================================== --- stable/8/sys/geom/raid/tr_raid1.c Sun Sep 16 08:44:55 2012 (r240553) +++ stable/8/sys/geom/raid/tr_raid1.c Sun Sep 16 08:58:34 2012 (r240554) @@ -42,9 +42,7 @@ __FBSDID("$FreeBSD$"); #include "geom/raid/g_raid.h" #include "g_raid_tr_if.h" -SYSCTL_DECL(_kern_geom_raid); -SYSCTL_NODE(_kern_geom_raid, OID_AUTO, raid1, CTLFLAG_RW, 0, - "RAID1 parameters"); +SYSCTL_DECL(_kern_geom_raid_raid1); #define RAID1_REBUILD_SLAB (1 << 20) /* One transation in a rebuild */ static int g_raid1_rebuild_slab = RAID1_REBUILD_SLAB; @@ -131,6 +129,7 @@ static struct g_raid_tr_class g_raid_tr_ "RAID1", g_raid_tr_raid1_methods, sizeof(struct g_raid_tr_raid1_object), + .trc_enable = 1, .trc_priority = 100 }; @@ -996,4 +995,4 @@ g_raid_tr_free_raid1(struct g_raid_tr_ob return (0); } -G_RAID_TR_DECLARE(g_raid_tr_raid1); +G_RAID_TR_DECLARE(raid1, "RAID1"); Modified: stable/8/sys/geom/raid/tr_raid1e.c ============================================================================== --- stable/8/sys/geom/raid/tr_raid1e.c Sun Sep 16 08:44:55 2012 (r240553) +++ stable/8/sys/geom/raid/tr_raid1e.c Sun Sep 16 08:58:34 2012 (r240554) @@ -44,9 +44,7 @@ __FBSDID("$FreeBSD$"); #define N 2 -SYSCTL_DECL(_kern_geom_raid); -SYSCTL_NODE(_kern_geom_raid, OID_AUTO, raid1e, CTLFLAG_RW, 0, - "RAID1E parameters"); +SYSCTL_DECL(_kern_geom_raid_raid1e); #define RAID1E_REBUILD_SLAB (1 << 20) /* One transation in a rebuild */ static int g_raid1e_rebuild_slab = RAID1E_REBUILD_SLAB; @@ -135,6 +133,7 @@ static struct g_raid_tr_class g_raid_tr_ "RAID1E", g_raid_tr_raid1e_methods, sizeof(struct g_raid_tr_raid1e_object), + .trc_enable = 1, .trc_priority = 200 }; @@ -1236,4 +1235,4 @@ g_raid_tr_free_raid1e(struct g_raid_tr_o return (0); } -G_RAID_TR_DECLARE(g_raid_tr_raid1e); +G_RAID_TR_DECLARE(raid1e, "RAID1E"); Modified: stable/8/sys/geom/raid/tr_raid5.c ============================================================================== --- stable/8/sys/geom/raid/tr_raid5.c Sun Sep 16 08:44:55 2012 (r240553) +++ stable/8/sys/geom/raid/tr_raid5.c Sun Sep 16 08:58:34 2012 (r240554) @@ -42,8 +42,6 @@ __FBSDID("$FreeBSD$"); #include "geom/raid/g_raid.h" #include "g_raid_tr_if.h" -SYSCTL_DECL(_kern_geom_raid); - static MALLOC_DEFINE(M_TR_RAID5, "tr_raid5_data", "GEOM_RAID RAID5 data"); #define TR_RAID5_NONE 0 @@ -95,6 +93,7 @@ static struct g_raid_tr_class g_raid_tr_ "RAID5", g_raid_tr_raid5_methods, sizeof(struct g_raid_tr_raid5_object), + .trc_enable = 1, .trc_priority = 100 }; @@ -419,4 +418,4 @@ g_raid_tr_free_raid5(struct g_raid_tr_ob return (0); } -G_RAID_TR_DECLARE(g_raid_tr_raid5); +G_RAID_TR_DECLARE(raid5, "RAID5"); From owner-svn-src-all@FreeBSD.ORG Sun Sep 16 09:00:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 45341106566C; Sun, 16 Sep 2012 09:00:54 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2FBEF8FC24; Sun, 16 Sep 2012 09:00:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8G90sCr046274; Sun, 16 Sep 2012 09:00:54 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8G90rfs046272; Sun, 16 Sep 2012 09:00:53 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201209160900.q8G90rfs046272@svn.freebsd.org> From: Alexander Motin Date: Sun, 16 Sep 2012 09:00:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240555 - stable/9/sbin/geom/class/raid X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Sep 2012 09:00:54 -0000 Author: mav Date: Sun Sep 16 09:00:53 2012 New Revision: 240555 URL: http://svn.freebsd.org/changeset/base/240555 Log: MFC r240465: Add global and per-module sysctls/tunables to enable/disable metadata taste. That should help to handle some cases when disk has some RAID metadata that should be ignored, especially during boot. Modified: stable/9/sbin/geom/class/raid/graid.8 Directory Properties: stable/9/sbin/geom/class/raid/ (props changed) Modified: stable/9/sbin/geom/class/raid/graid.8 ============================================================================== --- stable/9/sbin/geom/class/raid/graid.8 Sun Sep 16 08:58:34 2012 (r240554) +++ stable/9/sbin/geom/class/raid/graid.8 Sun Sep 16 09:00:53 2012 (r240555) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 6, 2012 +.Dd September 13, 2012 .Dt GRAID 8 .Os .Sh NAME @@ -293,6 +293,8 @@ Mark volume as clean when idle for the s Debug level of the .Nm RAID GEOM class. +.It Va kern.geom.raid.enable : No 1 +Enable on-disk metadata taste. .It Va kern.geom.raid.idle_threshold : No 1000000 Time in microseconds to consider a volume idle for rebuild purposes. .It Va kern.geom.raid.name_format : No 0 @@ -302,6 +304,8 @@ Number of read errors equated to disk fa Write errors are always considered as disk failures. .It Va kern.geom.raid.start_timeout : No 30 Time to wait for missing array components on startup. +.It Va kern.geom.raid. Ns Ar X Ns Va .enable : No 1 +Enable taste for specific metadata or transformation module. .El .Sh EXIT STATUS Exit status is 0 on success, and non-zero if the command fails. From owner-svn-src-all@FreeBSD.ORG Sun Sep 16 09:01:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8F5C51065705; Sun, 16 Sep 2012 09:01:40 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7A2158FC08; Sun, 16 Sep 2012 09:01:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8G91eIq046421; Sun, 16 Sep 2012 09:01:40 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8G91ekr046419; Sun, 16 Sep 2012 09:01:40 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201209160901.q8G91ekr046419@svn.freebsd.org> From: Alexander Motin Date: Sun, 16 Sep 2012 09:01: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: r240556 - stable/8/sbin/geom/class/raid X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Sep 2012 09:01:40 -0000 Author: mav Date: Sun Sep 16 09:01:40 2012 New Revision: 240556 URL: http://svn.freebsd.org/changeset/base/240556 Log: MFC r240465: Add global and per-module sysctls/tunables to enable/disable metadata taste. That should help to handle some cases when disk has some RAID metadata that should be ignored, especially during boot. Modified: stable/8/sbin/geom/class/raid/graid.8 Directory Properties: stable/8/sbin/geom/class/raid/ (props changed) Modified: stable/8/sbin/geom/class/raid/graid.8 ============================================================================== --- stable/8/sbin/geom/class/raid/graid.8 Sun Sep 16 09:00:53 2012 (r240555) +++ stable/8/sbin/geom/class/raid/graid.8 Sun Sep 16 09:01:40 2012 (r240556) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 6, 2012 +.Dd September 13, 2012 .Dt GRAID 8 .Os .Sh NAME @@ -293,6 +293,8 @@ Mark volume as clean when idle for the s Debug level of the .Nm RAID GEOM class. +.It Va kern.geom.raid.enable : No 1 +Enable on-disk metadata taste. .It Va kern.geom.raid.idle_threshold : No 1000000 Time in microseconds to consider a volume idle for rebuild purposes. .It Va kern.geom.raid.name_format : No 0 @@ -302,6 +304,8 @@ Number of read errors equated to disk fa Write errors are always considered as disk failures. .It Va kern.geom.raid.start_timeout : No 30 Time to wait for missing array components on startup. +.It Va kern.geom.raid. Ns Ar X Ns Va .enable : No 1 +Enable taste for specific metadata or transformation module. .El .Sh EXIT STATUS Exit status is 0 on success, and non-zero if the command fails. From owner-svn-src-all@FreeBSD.ORG Sun Sep 16 09:28:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 015DD1065672; Sun, 16 Sep 2012 09:28:18 +0000 (UTC) Date: Sun, 16 Sep 2012 09:28:18 +0000 From: Alexey Dokuchaev To: Andrew Turner Message-ID: <20120916092818.GA81952@FreeBSD.org> References: <201209160755.q8G7tnMH036332@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <201209160755.q8G7tnMH036332@svn.freebsd.org> User-Agent: Mutt/1.4.2.1i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r240549 - head/sys/arm/tegra X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Sep 2012 09:28:19 -0000 On Sun, Sep 16, 2012 at 07:55:49AM +0000, Andrew Turner wrote: > New Revision: 240549 > URL: http://svn.freebsd.org/changeset/base/240549 > > Log: > The cpu_reset function is noreturn, make sure this is true on Tegra 2. > While here fix a typo. > > + > + while(1); I thought preferred and more style(9) compliant way to code this is: for (;;) continue; ./danfe From owner-svn-src-all@FreeBSD.ORG Sun Sep 16 09:38:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2F5FB1065670; Sun, 16 Sep 2012 09:38:36 +0000 (UTC) (envelope-from utisoft@gmail.com) Received: from mail-lpp01m010-f54.google.com (mail-lpp01m010-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id D1EE38FC12; Sun, 16 Sep 2012 09:38:34 +0000 (UTC) Received: by lage12 with SMTP id e12so4352040lag.13 for ; Sun, 16 Sep 2012 02:38:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=F+XGuZBq9j4rXBng8NXwLFQtqjfBQ88fCkEu8Mw4X6w=; b=ixkxJkwrVfSWjpfDj4XG6lOOFrMaFELoZrNIJa1NP9lMbukcZRdW2adfA6cBnGD0aX 7+l+XGOI5Tqxi9ZkwliMTPqdx4VLhdMgvtqW+QxlLtWy9qTGhVBp9EWYLC9lHy3vNMq6 NqL7wj1e8P46O8Q/7vFd4MlnVRlUJfwnR/Yl6h7XV/Pybh6vxbgq8rfZi96TQ1uFLx8K 03sEAsG4waMfSKNqMVO984BzR86owQoGhtJ4AJzYeYOGUI5iuioRkd+IhTMhZCiwZWnt eDCG7HiE4dj6feDzWbLSQCidPLp6X5ahoqKB5KSGz5yy3Mh3DIGzWJpBerRJZHEEFeMY Mijw== Received: by 10.152.105.210 with SMTP id go18mr7093994lab.13.1347788307682; Sun, 16 Sep 2012 02:38:27 -0700 (PDT) MIME-Version: 1.0 Sender: utisoft@gmail.com Received: by 10.112.43.199 with HTTP; Sun, 16 Sep 2012 02:37:56 -0700 (PDT) In-Reply-To: <20120916092818.GA81952@FreeBSD.org> References: <201209160755.q8G7tnMH036332@svn.freebsd.org> <20120916092818.GA81952@FreeBSD.org> From: Chris Rees Date: Sun, 16 Sep 2012 10:37:56 +0100 X-Google-Sender-Auth: MmkOXEjZvJ-OK1n_Py2mwTPa44o Message-ID: To: Alexey Dokuchaev Content-Type: text/plain; charset=ISO-8859-1 Cc: Andrew Turner , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r240549 - head/sys/arm/tegra X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Sep 2012 09:38:36 -0000 On 16 September 2012 10:28, Alexey Dokuchaev wrote: > On Sun, Sep 16, 2012 at 07:55:49AM +0000, Andrew Turner wrote: >> New Revision: 240549 >> URL: http://svn.freebsd.org/changeset/base/240549 >> >> Log: >> The cpu_reset function is noreturn, make sure this is true on Tegra 2. >> While here fix a typo. >> >> + >> + while(1); > > I thought preferred and more style(9) compliant way to code this is: > > for (;;) > continue; Actually: for (;;) ; Chris From owner-svn-src-all@FreeBSD.ORG Sun Sep 16 09:53:56 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 184941065672; Sun, 16 Sep 2012 09:53:55 +0000 (UTC) Date: Sun, 16 Sep 2012 09:53:55 +0000 From: Alexey Dokuchaev To: Chris Rees Message-ID: <20120916095355.GA83285@FreeBSD.org> References: <201209160755.q8G7tnMH036332@svn.freebsd.org> <20120916092818.GA81952@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.1i Cc: Andrew Turner , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r240549 - head/sys/arm/tegra X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Sep 2012 09:53:56 -0000 On Sun, Sep 16, 2012 at 10:37:56AM +0100, Chris Rees wrote: > On 16 September 2012 10:28, Alexey Dokuchaev wrote: > > I thought preferred and more style(9) compliant way to code [empty > > endless loop] is: > > > > for (;;) > > continue; > > Actually: > > for (;;) > ; Explicit "continue" is supposed to tell reviewer that original author did not make a typo, but indeed knew what he was doing. Lonely semicolon is too ambiguous in this case. ./danfe From owner-svn-src-all@FreeBSD.ORG Sun Sep 16 10:07:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9CF28106566C; Sun, 16 Sep 2012 10:07:36 +0000 (UTC) (envelope-from utisoft@gmail.com) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id 3B8598FC14; Sun, 16 Sep 2012 10:07:34 +0000 (UTC) Received: by lbbgg13 with SMTP id gg13so4415905lbb.13 for ; Sun, 16 Sep 2012 03:07:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=QOYHahmx4bH7EJO0PHaPl1JygXdI5ZAsaxgC8wS3kJA=; b=G4ASdw422HMrkCuHLk2CpAwRtY2AjZxlPLIELWag0HWZxCH7Zh1SeSE7lel1Vv7i/W A47RmlZNYIWPuR7mk2MdBaNWXuPIXIf8wu/M7UFbz0kzGM3hhbkO+H3elf+M9HCdUMN1 GAqWgFNmcxLer5dxhplRAXfn9BkqAKt8bredL3m/30kmD3nnj9dz8kDsTsNAaCinjalL NsdfO8Pg6WgIQXvyiIPxes8v3dcZOPqgRlNGi0ftvvV27MScVdcEOKn5LQWIWVfrrO9p AqCKiAmVRpZ7b9XLA4fc1Y/lV0pFzrGbgoF1ttI/YAVagsOA0pgaaGV7QsoHAhv+THwI BucA== MIME-Version: 1.0 Received: by 10.152.162.10 with SMTP id xw10mr7009337lab.12.1347790054001; Sun, 16 Sep 2012 03:07:34 -0700 (PDT) Received: by 10.112.43.199 with HTTP; Sun, 16 Sep 2012 03:07:33 -0700 (PDT) Received: by 10.112.43.199 with HTTP; Sun, 16 Sep 2012 03:07:33 -0700 (PDT) In-Reply-To: <20120916095355.GA83285@FreeBSD.org> References: <201209160755.q8G7tnMH036332@svn.freebsd.org> <20120916092818.GA81952@FreeBSD.org> <20120916095355.GA83285@FreeBSD.org> Date: Sun, 16 Sep 2012 11:07:33 +0100 Message-ID: From: Chris Rees To: Alexey Dokuchaev Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: svn-src-head@freebsd.org, Andrew Turner , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r240549 - head/sys/arm/tegra X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Sep 2012 10:07:36 -0000 On 16 Sep 2012 10:53, "Alexey Dokuchaev" wrote: > > On Sun, Sep 16, 2012 at 10:37:56AM +0100, Chris Rees wrote: > > On 16 September 2012 10:28, Alexey Dokuchaev wrote: > > > I thought preferred and more style(9) compliant way to code [empty > > > endless loop] is: > > > > > > for (;;) > > > continue; > > > > Actually: > > > > for (;;) > > ; > > Explicit "continue" is supposed to tell reviewer that original author did > not make a typo, but indeed knew what he was doing. Lonely semicolon is too > ambiguous in this case. > > ./danfe > That's not what man style says... Chris From owner-svn-src-all@FreeBSD.ORG Sun Sep 16 10:40:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D17B4106566B; Sun, 16 Sep 2012 10:40:17 +0000 (UTC) (envelope-from issyl0@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BB42D8FC0C; Sun, 16 Sep 2012 10:40:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8GAeHKd063007; Sun, 16 Sep 2012 10:40:17 GMT (envelope-from issyl0@svn.freebsd.org) Received: (from issyl0@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8GAeHUV063005; Sun, 16 Sep 2012 10:40:17 GMT (envelope-from issyl0@svn.freebsd.org) Message-Id: <201209161040.q8GAeHUV063005@svn.freebsd.org> From: Isabell Long Date: Sun, 16 Sep 2012 10:40:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240557 - stable/9/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Sep 2012 10:40:17 -0000 Author: issyl0 (doc committer) Date: Sun Sep 16 10:40:17 2012 New Revision: 240557 URL: http://svn.freebsd.org/changeset/base/240557 Log: MFC r239840 from HEAD: - Fix a dead link in sk(4). PR: docs/146958 Approved by: gabor (mentor) Modified: stable/9/share/man/man4/sk.4 Directory Properties: stable/9/share/man/man4/ (props changed) Modified: stable/9/share/man/man4/sk.4 ============================================================================== --- stable/9/share/man/man4/sk.4 Sun Sep 16 09:01:40 2012 (r240556) +++ stable/9/share/man/man4/sk.4 Sun Sep 16 10:40:17 2012 (r240557) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 23, 2010 +.Dd August 29, 2012 .Dt SK 4 .Os .Sh NAME @@ -223,7 +223,7 @@ the network connection (cable). .Xr ifconfig 8 .Rs .%T XaQti XMAC II datasheet -.%U http://www.xaqti.com +.%U http://people.freebsd.org/~wpaul/SysKonnect/xmacii_datasheet_rev_c_9-29.pdf .Re .Rs .%T SysKonnect GEnesis programming manual From owner-svn-src-all@FreeBSD.ORG Sun Sep 16 11:02:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0C3F6106564A; Sun, 16 Sep 2012 11:02:23 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E90958FC0C; Sun, 16 Sep 2012 11:02:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8GB2MOQ068612; Sun, 16 Sep 2012 11:02:22 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8GB2Mbw068597; Sun, 16 Sep 2012 11:02:22 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201209161102.q8GB2Mbw068597@svn.freebsd.org> From: Alexander Motin Date: Sun, 16 Sep 2012 11:02:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240558 - in releng/9.1: sbin/geom/class/raid sys/geom/raid X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Sep 2012 11:02:23 -0000 Author: mav Date: Sun Sep 16 11:02:22 2012 New Revision: 240558 URL: http://svn.freebsd.org/changeset/base/240558 Log: MFC r240465: Add global and per-module sysctls/tunables to enable/disable metadata taste. That should help to handle some cases when disk has some RAID metadata that should be ignored, especially during boot. Approved by: re (kib) Modified: releng/9.1/sbin/geom/class/raid/graid.8 releng/9.1/sys/geom/raid/g_raid.c releng/9.1/sys/geom/raid/g_raid.h releng/9.1/sys/geom/raid/md_ddf.c releng/9.1/sys/geom/raid/md_intel.c releng/9.1/sys/geom/raid/md_jmicron.c releng/9.1/sys/geom/raid/md_nvidia.c releng/9.1/sys/geom/raid/md_promise.c releng/9.1/sys/geom/raid/md_sii.c releng/9.1/sys/geom/raid/tr_concat.c releng/9.1/sys/geom/raid/tr_raid0.c releng/9.1/sys/geom/raid/tr_raid1.c releng/9.1/sys/geom/raid/tr_raid1e.c releng/9.1/sys/geom/raid/tr_raid5.c Directory Properties: releng/9.1/sbin/geom/class/raid/ (props changed) releng/9.1/sys/ (props changed) Modified: releng/9.1/sbin/geom/class/raid/graid.8 ============================================================================== --- releng/9.1/sbin/geom/class/raid/graid.8 Sun Sep 16 10:40:17 2012 (r240557) +++ releng/9.1/sbin/geom/class/raid/graid.8 Sun Sep 16 11:02:22 2012 (r240558) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 6, 2012 +.Dd September 13, 2012 .Dt GRAID 8 .Os .Sh NAME @@ -293,6 +293,8 @@ Mark volume as clean when idle for the s Debug level of the .Nm RAID GEOM class. +.It Va kern.geom.raid.enable : No 1 +Enable on-disk metadata taste. .It Va kern.geom.raid.idle_threshold : No 1000000 Time in microseconds to consider a volume idle for rebuild purposes. .It Va kern.geom.raid.name_format : No 0 @@ -302,6 +304,8 @@ Number of read errors equated to disk fa Write errors are always considered as disk failures. .It Va kern.geom.raid.start_timeout : No 30 Time to wait for missing array components on startup. +.It Va kern.geom.raid. Ns Ar X Ns Va .enable : No 1 +Enable taste for specific metadata or transformation module. .El .Sh EXIT STATUS Exit status is 0 on success, and non-zero if the command fails. Modified: releng/9.1/sys/geom/raid/g_raid.c ============================================================================== --- releng/9.1/sys/geom/raid/g_raid.c Sun Sep 16 10:40:17 2012 (r240557) +++ releng/9.1/sys/geom/raid/g_raid.c Sun Sep 16 11:02:22 2012 (r240558) @@ -52,6 +52,10 @@ static MALLOC_DEFINE(M_RAID, "raid_data" SYSCTL_DECL(_kern_geom); SYSCTL_NODE(_kern_geom, OID_AUTO, raid, CTLFLAG_RW, 0, "GEOM_RAID stuff"); +int g_raid_enable = 1; +TUNABLE_INT("kern.geom.raid.enable", &g_raid_enable); +SYSCTL_INT(_kern_geom_raid, OID_AUTO, enable, CTLFLAG_RW, + &g_raid_enable, 0, "Enable on-disk metadata taste"); u_int g_raid_aggressive_spare = 0; TUNABLE_INT("kern.geom.raid.aggressive_spare", &g_raid_aggressive_spare); SYSCTL_UINT(_kern_geom_raid, OID_AUTO, aggressive_spare, CTLFLAG_RW, @@ -1920,6 +1924,8 @@ int g_raid_start_volume(struct g_raid_vo G_RAID_DEBUG1(2, vol->v_softc, "Starting volume %s.", vol->v_name); LIST_FOREACH(class, &g_raid_tr_classes, trc_list) { + if (!class->trc_enable) + continue; G_RAID_DEBUG1(2, vol->v_softc, "Tasting volume %s for %s transformation.", vol->v_name, class->name); @@ -2142,6 +2148,8 @@ g_raid_taste(struct g_class *mp, struct g_topology_assert(); g_trace(G_T_TOPOLOGY, "%s(%s, %s)", __func__, mp->name, pp->name); + if (!g_raid_enable) + return (NULL); G_RAID_DEBUG(2, "Tasting provider %s.", pp->name); gp = g_new_geomf(mp, "raid:taste"); @@ -2154,6 +2162,8 @@ g_raid_taste(struct g_class *mp, struct geom = NULL; LIST_FOREACH(class, &g_raid_md_classes, mdc_list) { + if (!class->mdc_enable) + continue; G_RAID_DEBUG(2, "Tasting provider %s for %s metadata.", pp->name, class->name); obj = (void *)kobj_create((kobj_class_t)class, M_RAID, Modified: releng/9.1/sys/geom/raid/g_raid.h ============================================================================== --- releng/9.1/sys/geom/raid/g_raid.h Sun Sep 16 10:40:17 2012 (r240557) +++ releng/9.1/sys/geom/raid/g_raid.h Sun Sep 16 11:02:22 2012 (r240558) @@ -33,6 +33,9 @@ #include #include #include +#ifdef _KERNEL +#include +#endif #define G_RAID_CLASS_NAME "RAID" @@ -51,6 +54,7 @@ struct g_raid_tr_object; #ifdef _KERNEL extern u_int g_raid_aggressive_spare; extern u_int g_raid_debug; +extern int g_raid_enable; extern int g_raid_read_err_thresh; extern u_int g_raid_start_timeout; extern struct g_class g_raid_class; @@ -322,11 +326,14 @@ struct g_raid_softc { }; #define sc_name sc_geom->name +SYSCTL_DECL(_kern_geom_raid); + /* * KOBJ parent class of metadata processing modules. */ struct g_raid_md_class { KOBJ_CLASS_FIELDS; + int mdc_enable; int mdc_priority; LIST_ENTRY(g_raid_md_class) mdc_list; }; @@ -342,20 +349,29 @@ struct g_raid_md_object { int g_raid_md_modevent(module_t, int, void *); -#define G_RAID_MD_DECLARE(name) \ - static moduledata_t name##_mod = { \ - #name, \ +#define G_RAID_MD_DECLARE(name, label) \ + static moduledata_t g_raid_md_##name##_mod = { \ + "g_raid_md_" __XSTRING(name), \ g_raid_md_modevent, \ - &name##_class \ + &g_raid_md_##name##_class \ }; \ - DECLARE_MODULE(name, name##_mod, SI_SUB_DRIVERS, SI_ORDER_SECOND); \ - MODULE_DEPEND(name, geom_raid, 0, 0, 0) + DECLARE_MODULE(g_raid_md_##name, g_raid_md_##name##_mod, \ + SI_SUB_DRIVERS, SI_ORDER_SECOND); \ + MODULE_DEPEND(g_raid_md_##name, geom_raid, 0, 0, 0); \ + SYSCTL_NODE(_kern_geom_raid, OID_AUTO, name, CTLFLAG_RD, \ + NULL, label " metadata module"); \ + SYSCTL_INT(_kern_geom_raid_##name, OID_AUTO, enable, \ + CTLFLAG_RW, &g_raid_md_##name##_class.mdc_enable, 0, \ + "Enable " label " metadata format taste"); \ + TUNABLE_INT("kern.geom.raid." __XSTRING(name) ".enable", \ + &g_raid_md_##name##_class.mdc_enable) /* * KOBJ parent class of data transformation modules. */ struct g_raid_tr_class { KOBJ_CLASS_FIELDS; + int trc_enable; int trc_priority; LIST_ENTRY(g_raid_tr_class) trc_list; }; @@ -371,14 +387,22 @@ struct g_raid_tr_object { int g_raid_tr_modevent(module_t, int, void *); -#define G_RAID_TR_DECLARE(name) \ - static moduledata_t name##_mod = { \ - #name, \ +#define G_RAID_TR_DECLARE(name, label) \ + static moduledata_t g_raid_tr_##name##_mod = { \ + "g_raid_tr_" __XSTRING(name), \ g_raid_tr_modevent, \ - &name##_class \ + &g_raid_tr_##name##_class \ }; \ - DECLARE_MODULE(name, name##_mod, SI_SUB_DRIVERS, SI_ORDER_FIRST); \ - MODULE_DEPEND(name, geom_raid, 0, 0, 0) + DECLARE_MODULE(g_raid_tr_##name, g_raid_tr_##name##_mod, \ + SI_SUB_DRIVERS, SI_ORDER_FIRST); \ + MODULE_DEPEND(g_raid_tr_##name, geom_raid, 0, 0, 0); \ + SYSCTL_NODE(_kern_geom_raid, OID_AUTO, name, CTLFLAG_RD, \ + NULL, label " transformation module"); \ + SYSCTL_INT(_kern_geom_raid_##name, OID_AUTO, enable, \ + CTLFLAG_RW, &g_raid_tr_##name##_class.trc_enable, 0, \ + "Enable " label " transformation module taste"); \ + TUNABLE_INT("kern.geom.raid." __XSTRING(name) ".enable", \ + &g_raid_tr_##name##_class.trc_enable) const char * g_raid_volume_level2str(int level, int qual); int g_raid_volume_str2level(const char *str, int *level, int *qual); Modified: releng/9.1/sys/geom/raid/md_ddf.c ============================================================================== --- releng/9.1/sys/geom/raid/md_ddf.c Sun Sep 16 10:40:17 2012 (r240557) +++ releng/9.1/sys/geom/raid/md_ddf.c Sun Sep 16 11:02:22 2012 (r240558) @@ -125,6 +125,7 @@ static struct g_raid_md_class g_raid_md_ "DDF", g_raid_md_ddf_methods, sizeof(struct g_raid_md_ddf_object), + .mdc_enable = 1, .mdc_priority = 100 }; @@ -3065,4 +3066,4 @@ g_raid_md_free_ddf(struct g_raid_md_obje return (0); } -G_RAID_MD_DECLARE(g_raid_md_ddf); +G_RAID_MD_DECLARE(ddf, "DDF"); Modified: releng/9.1/sys/geom/raid/md_intel.c ============================================================================== --- releng/9.1/sys/geom/raid/md_intel.c Sun Sep 16 10:40:17 2012 (r240557) +++ releng/9.1/sys/geom/raid/md_intel.c Sun Sep 16 11:02:22 2012 (r240558) @@ -224,6 +224,7 @@ static struct g_raid_md_class g_raid_md_ "Intel", g_raid_md_intel_methods, sizeof(struct g_raid_md_intel_object), + .mdc_enable = 1, .mdc_priority = 100 }; @@ -2432,4 +2433,4 @@ g_raid_md_free_intel(struct g_raid_md_ob return (0); } -G_RAID_MD_DECLARE(g_raid_md_intel); +G_RAID_MD_DECLARE(intel, "Intel"); Modified: releng/9.1/sys/geom/raid/md_jmicron.c ============================================================================== --- releng/9.1/sys/geom/raid/md_jmicron.c Sun Sep 16 10:40:17 2012 (r240557) +++ releng/9.1/sys/geom/raid/md_jmicron.c Sun Sep 16 11:02:22 2012 (r240558) @@ -132,6 +132,7 @@ static struct g_raid_md_class g_raid_md_ "JMicron", g_raid_md_jmicron_methods, sizeof(struct g_raid_md_jmicron_object), + .mdc_enable = 1, .mdc_priority = 100 }; @@ -1581,4 +1582,4 @@ g_raid_md_free_jmicron(struct g_raid_md_ return (0); } -G_RAID_MD_DECLARE(g_raid_md_jmicron); +G_RAID_MD_DECLARE(jmicron, "JMicron"); Modified: releng/9.1/sys/geom/raid/md_nvidia.c ============================================================================== --- releng/9.1/sys/geom/raid/md_nvidia.c Sun Sep 16 10:40:17 2012 (r240557) +++ releng/9.1/sys/geom/raid/md_nvidia.c Sun Sep 16 11:02:22 2012 (r240558) @@ -143,6 +143,7 @@ static struct g_raid_md_class g_raid_md_ "NVIDIA", g_raid_md_nvidia_methods, sizeof(struct g_raid_md_nvidia_object), + .mdc_enable = 1, .mdc_priority = 100 }; @@ -1600,4 +1601,4 @@ g_raid_md_free_nvidia(struct g_raid_md_o return (0); } -G_RAID_MD_DECLARE(g_raid_md_nvidia); +G_RAID_MD_DECLARE(nvidia, "NVIDIA"); Modified: releng/9.1/sys/geom/raid/md_promise.c ============================================================================== --- releng/9.1/sys/geom/raid/md_promise.c Sun Sep 16 10:40:17 2012 (r240557) +++ releng/9.1/sys/geom/raid/md_promise.c Sun Sep 16 11:02:22 2012 (r240558) @@ -171,6 +171,7 @@ static struct g_raid_md_class g_raid_md_ "Promise", g_raid_md_promise_methods, sizeof(struct g_raid_md_object), + .mdc_enable = 1, .mdc_priority = 100 }; @@ -1967,4 +1968,4 @@ g_raid_md_free_promise(struct g_raid_md_ return (0); } -G_RAID_MD_DECLARE(g_raid_md_promise); +G_RAID_MD_DECLARE(promise, "Promise"); Modified: releng/9.1/sys/geom/raid/md_sii.c ============================================================================== --- releng/9.1/sys/geom/raid/md_sii.c Sun Sep 16 10:40:17 2012 (r240557) +++ releng/9.1/sys/geom/raid/md_sii.c Sun Sep 16 11:02:22 2012 (r240558) @@ -140,6 +140,7 @@ static struct g_raid_md_class g_raid_md_ "SiI", g_raid_md_sii_methods, sizeof(struct g_raid_md_sii_object), + .mdc_enable = 1, .mdc_priority = 100 }; @@ -1688,4 +1689,4 @@ g_raid_md_free_sii(struct g_raid_md_obje return (0); } -G_RAID_MD_DECLARE(g_raid_md_sii); +G_RAID_MD_DECLARE(sii, "SiI"); Modified: releng/9.1/sys/geom/raid/tr_concat.c ============================================================================== --- releng/9.1/sys/geom/raid/tr_concat.c Sun Sep 16 10:40:17 2012 (r240557) +++ releng/9.1/sys/geom/raid/tr_concat.c Sun Sep 16 11:02:22 2012 (r240558) @@ -73,6 +73,7 @@ static struct g_raid_tr_class g_raid_tr_ "CONCAT", g_raid_tr_concat_methods, sizeof(struct g_raid_tr_concat_object), + .trc_enable = 1, .trc_priority = 50 }; @@ -340,4 +341,4 @@ g_raid_tr_free_concat(struct g_raid_tr_o return (0); } -G_RAID_TR_DECLARE(g_raid_tr_concat); +G_RAID_TR_DECLARE(concat, "CONCAT"); Modified: releng/9.1/sys/geom/raid/tr_raid0.c ============================================================================== --- releng/9.1/sys/geom/raid/tr_raid0.c Sun Sep 16 10:40:17 2012 (r240557) +++ releng/9.1/sys/geom/raid/tr_raid0.c Sun Sep 16 11:02:22 2012 (r240558) @@ -73,6 +73,7 @@ static struct g_raid_tr_class g_raid_tr_ "RAID0", g_raid_tr_raid0_methods, sizeof(struct g_raid_tr_raid0_object), + .trc_enable = 1, .trc_priority = 100 }; @@ -323,4 +324,4 @@ g_raid_tr_free_raid0(struct g_raid_tr_ob return (0); } -G_RAID_TR_DECLARE(g_raid_tr_raid0); +G_RAID_TR_DECLARE(raid0, "RAID0"); Modified: releng/9.1/sys/geom/raid/tr_raid1.c ============================================================================== --- releng/9.1/sys/geom/raid/tr_raid1.c Sun Sep 16 10:40:17 2012 (r240557) +++ releng/9.1/sys/geom/raid/tr_raid1.c Sun Sep 16 11:02:22 2012 (r240558) @@ -42,9 +42,7 @@ __FBSDID("$FreeBSD$"); #include "geom/raid/g_raid.h" #include "g_raid_tr_if.h" -SYSCTL_DECL(_kern_geom_raid); -SYSCTL_NODE(_kern_geom_raid, OID_AUTO, raid1, CTLFLAG_RW, 0, - "RAID1 parameters"); +SYSCTL_DECL(_kern_geom_raid_raid1); #define RAID1_REBUILD_SLAB (1 << 20) /* One transation in a rebuild */ static int g_raid1_rebuild_slab = RAID1_REBUILD_SLAB; @@ -131,6 +129,7 @@ static struct g_raid_tr_class g_raid_tr_ "RAID1", g_raid_tr_raid1_methods, sizeof(struct g_raid_tr_raid1_object), + .trc_enable = 1, .trc_priority = 100 }; @@ -996,4 +995,4 @@ g_raid_tr_free_raid1(struct g_raid_tr_ob return (0); } -G_RAID_TR_DECLARE(g_raid_tr_raid1); +G_RAID_TR_DECLARE(raid1, "RAID1"); Modified: releng/9.1/sys/geom/raid/tr_raid1e.c ============================================================================== --- releng/9.1/sys/geom/raid/tr_raid1e.c Sun Sep 16 10:40:17 2012 (r240557) +++ releng/9.1/sys/geom/raid/tr_raid1e.c Sun Sep 16 11:02:22 2012 (r240558) @@ -44,9 +44,7 @@ __FBSDID("$FreeBSD$"); #define N 2 -SYSCTL_DECL(_kern_geom_raid); -SYSCTL_NODE(_kern_geom_raid, OID_AUTO, raid1e, CTLFLAG_RW, 0, - "RAID1E parameters"); +SYSCTL_DECL(_kern_geom_raid_raid1e); #define RAID1E_REBUILD_SLAB (1 << 20) /* One transation in a rebuild */ static int g_raid1e_rebuild_slab = RAID1E_REBUILD_SLAB; @@ -135,6 +133,7 @@ static struct g_raid_tr_class g_raid_tr_ "RAID1E", g_raid_tr_raid1e_methods, sizeof(struct g_raid_tr_raid1e_object), + .trc_enable = 1, .trc_priority = 200 }; @@ -1236,4 +1235,4 @@ g_raid_tr_free_raid1e(struct g_raid_tr_o return (0); } -G_RAID_TR_DECLARE(g_raid_tr_raid1e); +G_RAID_TR_DECLARE(raid1e, "RAID1E"); Modified: releng/9.1/sys/geom/raid/tr_raid5.c ============================================================================== --- releng/9.1/sys/geom/raid/tr_raid5.c Sun Sep 16 10:40:17 2012 (r240557) +++ releng/9.1/sys/geom/raid/tr_raid5.c Sun Sep 16 11:02:22 2012 (r240558) @@ -42,8 +42,6 @@ __FBSDID("$FreeBSD$"); #include "geom/raid/g_raid.h" #include "g_raid_tr_if.h" -SYSCTL_DECL(_kern_geom_raid); - static MALLOC_DEFINE(M_TR_RAID5, "tr_raid5_data", "GEOM_RAID RAID5 data"); #define TR_RAID5_NONE 0 @@ -95,6 +93,7 @@ static struct g_raid_tr_class g_raid_tr_ "RAID5", g_raid_tr_raid5_methods, sizeof(struct g_raid_tr_raid5_object), + .trc_enable = 1, .trc_priority = 100 }; @@ -419,4 +418,4 @@ g_raid_tr_free_raid5(struct g_raid_tr_ob return (0); } -G_RAID_TR_DECLARE(g_raid_tr_raid5); +G_RAID_TR_DECLARE(raid5, "RAID5"); From owner-svn-src-all@FreeBSD.ORG Sun Sep 16 12:06:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A422106566B; Sun, 16 Sep 2012 12:06:46 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 147D98FC08; Sun, 16 Sep 2012 12:06:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8GC6jcF079798; Sun, 16 Sep 2012 12:06:45 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8GC6jYN079796; Sun, 16 Sep 2012 12:06:45 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201209161206.q8GC6jYN079796@svn.freebsd.org> From: Alexander Motin Date: Sun, 16 Sep 2012 12:06:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240559 - stable/9/sys/dev/sound/pci/hda X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Sep 2012 12:06:46 -0000 Author: mav Date: Sun Sep 16 12:06:45 2012 New Revision: 240559 URL: http://svn.freebsd.org/changeset/base/240559 Log: MFC r239326: Fix "speaker" volume control, broken at r230451. Modified: stable/9/sys/dev/sound/pci/hda/hdaa.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/sound/pci/hda/hdaa.c ============================================================================== --- stable/9/sys/dev/sound/pci/hda/hdaa.c Sun Sep 16 11:02:22 2012 (r240558) +++ stable/9/sys/dev/sound/pci/hda/hdaa.c Sun Sep 16 12:06:45 2012 (r240559) @@ -2127,11 +2127,14 @@ hdaa_audio_ctl_dev_volume(struct hdaa_pc w = hdaa_widget_get(devinfo, i); if (w == NULL || w->enable == 0) continue; - if (w->bindas < 0 && pdevinfo->index != 0) - continue; - if (w->bindas != pdevinfo->playas && - w->bindas != pdevinfo->recas) - continue; + if (w->bindas < 0) { + if (pdevinfo->index != 0) + continue; + } else { + if (w->bindas != pdevinfo->playas && + w->bindas != pdevinfo->recas) + continue; + } if (dev == SOUND_MIXER_RECLEV && w->type == HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_AUDIO_INPUT) { hdaa_audio_ctl_dest_volume(pdevinfo, dev, From owner-svn-src-all@FreeBSD.ORG Sun Sep 16 12:08:06 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 85F90106566C; Sun, 16 Sep 2012 12:08:06 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 70F008FC08; Sun, 16 Sep 2012 12:08:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8GC86ul080091; Sun, 16 Sep 2012 12:08:06 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8GC86JH080089; Sun, 16 Sep 2012 12:08:06 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201209161208.q8GC86JH080089@svn.freebsd.org> From: Alexander Motin Date: Sun, 16 Sep 2012 12:08: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: r240560 - stable/8/sys/dev/sound/pci/hda X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Sep 2012 12:08:06 -0000 Author: mav Date: Sun Sep 16 12:08:06 2012 New Revision: 240560 URL: http://svn.freebsd.org/changeset/base/240560 Log: MFC r239326: Fix "speaker" volume control, broken at r230451. Modified: stable/8/sys/dev/sound/pci/hda/hdaa.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/sound/ (props changed) stable/8/sys/dev/sound/pci/ (props changed) Modified: stable/8/sys/dev/sound/pci/hda/hdaa.c ============================================================================== --- stable/8/sys/dev/sound/pci/hda/hdaa.c Sun Sep 16 12:06:45 2012 (r240559) +++ stable/8/sys/dev/sound/pci/hda/hdaa.c Sun Sep 16 12:08:06 2012 (r240560) @@ -2127,11 +2127,14 @@ hdaa_audio_ctl_dev_volume(struct hdaa_pc w = hdaa_widget_get(devinfo, i); if (w == NULL || w->enable == 0) continue; - if (w->bindas < 0 && pdevinfo->index != 0) - continue; - if (w->bindas != pdevinfo->playas && - w->bindas != pdevinfo->recas) - continue; + if (w->bindas < 0) { + if (pdevinfo->index != 0) + continue; + } else { + if (w->bindas != pdevinfo->playas && + w->bindas != pdevinfo->recas) + continue; + } if (dev == SOUND_MIXER_RECLEV && w->type == HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_AUDIO_INPUT) { hdaa_audio_ctl_dest_volume(pdevinfo, dev, From owner-svn-src-all@FreeBSD.ORG Sun Sep 16 13:13:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B0F8A106566C; Sun, 16 Sep 2012 13:13:02 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9BF198FC0A; Sun, 16 Sep 2012 13:13:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8GDD2qP091524; Sun, 16 Sep 2012 13:13:02 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8GDD2LH091522; Sun, 16 Sep 2012 13:13:02 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201209161313.q8GDD2LH091522@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Sun, 16 Sep 2012 13:13:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240561 - head/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Sep 2012 13:13:02 -0000 Author: melifaro Date: Sun Sep 16 13:13:02 2012 New Revision: 240561 URL: http://svn.freebsd.org/changeset/base/240561 Log: Add section describing existing filtering points. Document byteorder behavior in AF_INET[6] hooks in new section. MFC after: 2 weeks Modified: head/share/man/man9/pfil.9 Modified: head/share/man/man9/pfil.9 ============================================================================== --- head/share/man/man9/pfil.9 Sun Sep 16 12:08:06 2012 (r240560) +++ head/share/man/man9/pfil.9 Sun Sep 16 13:13:02 2012 (r240561) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 29, 2004 +.Dd September 16, 2012 .Dt PFIL 9 .Os .Sh NAME @@ -122,6 +122,18 @@ The filter returns an error (errno) if t if the processing is to continue. If the packet processing is to stop, it is the responsibility of the filter to free the packet. +.Sh FILTERING POINTS +Currently, filtering points are implemented for the following link types: +.Pp +.Bl -tag -width "AF_INET6" -offset XXX -compact +.It AF_INET +.It AF_INET6 +IPv4 and IPv6 packets. Note that packet header is already +.Cm converted to host format. +Host format has to be preserved in case of header modifications. +.It AF_LINK +Link-layer packets. +.El .Sh RETURN VALUES If successful, .Fn pfil_head_get @@ -187,23 +199,6 @@ The function is only safe for internal use. .Pp -.Fx -implements only hooks for -.Dv AF_INET -and -.Dv AF_INET6 . -Packets diverted through these hooks have data in -host byte order contrary to the above statements. -.Pp -The -.Xr if_bridge 4 -diverts -.Dv AF_INET -and -.Dv AF_INET6 -traffic according to its sysctl settings, but contrary to the above -statements, the data is provided in host byte order. -.Pp When a .Vt pfil_head is being modified, no traffic is diverted From owner-svn-src-all@FreeBSD.ORG Sun Sep 16 14:24:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 89303106566B; Sun, 16 Sep 2012 14:24:49 +0000 (UTC) (envelope-from tijl@coosemans.org) Received: from mailrelay009.isp.belgacom.be (mailrelay009.isp.belgacom.be [195.238.6.176]) by mx1.freebsd.org (Postfix) with ESMTP id 723318FC08; Sun, 16 Sep 2012 14:24:47 +0000 (UTC) X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgUFADvgVVBbsSJD/2dsb2JhbABFhUBHtgqBCIIgAQEFIzMiARALDgoJFgsCAgkDAgECASceBg0BBQIBAYgAB6dvkWmLIYVWgRIDjmmBIIZtjw2CaA Received: from 67.34-177-91.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([91.177.34.67]) by relay.skynet.be with ESMTP; 16 Sep 2012 16:24:39 +0200 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.14.5/8.14.5) with ESMTP id q8GEOcZk042835; Sun, 16 Sep 2012 16:24:38 +0200 (CEST) (envelope-from tijl@coosemans.org) Message-ID: <5055E121.2030208@coosemans.org> Date: Sun, 16 Sep 2012 16:24:33 +0200 From: Tijl Coosemans User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:14.0) Gecko/20120804 Thunderbird/14.0 MIME-Version: 1.0 To: Eitan Adler References: <201209142347.q8ENlN7N034951@svn.freebsd.org> <5054EBCB.6070105@coosemans.org> <5054F116.8090503@cran.org.uk> In-Reply-To: X-Enigmail-Version: 1.4.2 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enig64D04E78E6E01D521E57E296" Cc: Bruce Cran , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r240527 - head/bin/df X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Sep 2012 14:24:49 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig64D04E78E6E01D521E57E296 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 16-09-2012 01:27, Eitan Adler wrote: > On 15 September 2012 17:20, Bruce Cran wrote: >> On 15/09/2012 21:57, Tijl Coosemans wrote: >>> >>> Freeing memory right before exiting is a waste of time. The tool shou= ldn't >>> complain about it. >=20 > Perhaps, but tools do. This has already been brought up on cfe-dev. >=20 >> "/Stop wasting time and just exit already/." - >> http://blogs.msdn.com/b/oldnewthing/archive/2012/01/05/10253268.aspx >=20 > I read this blog post when it came out. :) In this case the free is actually wrong, because the pointer can point to memory allocated by getmntinfo(3) and that manpage says an application= cannot free it. --------------enig64D04E78E6E01D521E57E296 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iF4EAREIAAYFAlBV4SYACgkQfoCS2CCgtiumFAD+LnchYDKAQbLekIn2QPiSI6cp 1fP1DNaeX+1N5Mu+jI4A/2PDG2/qlwF+499uPoZQjXQ1DfkMFO2VYUY69V1VKU+h =0FKG -----END PGP SIGNATURE----- --------------enig64D04E78E6E01D521E57E296-- From owner-svn-src-all@FreeBSD.ORG Sun Sep 16 14:38:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B79E1065674; Sun, 16 Sep 2012 14:38:02 +0000 (UTC) (envelope-from zont@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2578E8FC12; Sun, 16 Sep 2012 14:38:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8GEc19M008272; Sun, 16 Sep 2012 14:38:01 GMT (envelope-from zont@svn.freebsd.org) Received: (from zont@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8GEc14B008266; Sun, 16 Sep 2012 14:38:01 GMT (envelope-from zont@svn.freebsd.org) Message-Id: <201209161438.q8GEc14B008266@svn.freebsd.org> From: Andrey Zonov Date: Sun, 16 Sep 2012 14:38:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240562 - head/usr.bin/truss X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Sep 2012 14:38:02 -0000 Author: zont Date: Sun Sep 16 14:38:01 2012 New Revision: 240562 URL: http://svn.freebsd.org/changeset/base/240562 Log: - Make truss thread-aware. Approved by: kib (mentor) MFC after: 2 weeks Modified: head/usr.bin/truss/amd64-fbsd.c head/usr.bin/truss/amd64-fbsd32.c head/usr.bin/truss/amd64-linux32.c head/usr.bin/truss/i386-fbsd.c head/usr.bin/truss/i386-linux.c head/usr.bin/truss/ia64-fbsd.c head/usr.bin/truss/main.c head/usr.bin/truss/mips-fbsd.c head/usr.bin/truss/powerpc-fbsd.c head/usr.bin/truss/powerpc64-fbsd.c head/usr.bin/truss/setup.c head/usr.bin/truss/sparc64-fbsd.c head/usr.bin/truss/syscalls.c head/usr.bin/truss/truss.h Modified: head/usr.bin/truss/amd64-fbsd.c ============================================================================== --- head/usr.bin/truss/amd64-fbsd.c Sun Sep 16 13:13:02 2012 (r240561) +++ head/usr.bin/truss/amd64-fbsd.c Sun Sep 16 14:38:01 2012 (r240562) @@ -62,8 +62,6 @@ static const char rcsid[] = #include "syscall.h" #include "extern.h" -static int cpid = -1; - #include "syscalls.h" static int nsyscalls = sizeof(syscallnames) / sizeof(syscallnames[0]); @@ -77,30 +75,35 @@ static int nsyscalls = sizeof(syscallnam * 'struct syscall' describes the system call; it may be NULL, however, * if we don't know about this particular system call yet. */ -static struct freebsd_syscall { +struct freebsd_syscall { struct syscall *sc; const char *name; int number; unsigned long *args; int nargs; /* number of arguments -- *not* number of words! */ char **s_args; /* the printable arguments */ -} fsc; +}; + +static struct freebsd_syscall * +alloc_fsc(void) +{ + + return (malloc(sizeof(struct freebsd_syscall))); +} /* Clear up and free parts of the fsc structure. */ -static __inline void -clear_fsc(void) +static void +free_fsc(struct freebsd_syscall *fsc) { int i; - if (fsc.args) - free(fsc.args); - if (fsc.s_args) { - for (i = 0; i < fsc.nargs; i++) - if (fsc.s_args[i]) - free(fsc.s_args[i]); - free(fsc.s_args); + free(fsc->args); + if (fsc->s_args) { + for (i = 0; i < fsc->nargs; i++) + free(fsc->s_args[i]); + free(fsc->s_args); } - memset(&fsc, 0, sizeof(fsc)); + free(fsc); } /* @@ -115,14 +118,14 @@ amd64_syscall_entry(struct trussinfo *tr { struct ptrace_io_desc iorequest; struct reg regs; + struct freebsd_syscall *fsc; struct syscall *sc; + lwpid_t tid; int i, reg, syscall_num; - clear_fsc(); - - cpid = trussinfo->curthread->tid; + tid = trussinfo->curthread->tid; - if (ptrace(PT_GETREGS, cpid, (caddr_t)®s, 0) < 0) { + if (ptrace(PT_GETREGS, tid, (caddr_t)®s, 0) < 0) { fprintf(trussinfo->outfile, "-- CANNOT READ REGISTERS --\n"); return; } @@ -142,57 +145,60 @@ amd64_syscall_entry(struct trussinfo *tr break; } - fsc.number = syscall_num; - fsc.name = (syscall_num < 0 || syscall_num >= nsyscalls) ? + fsc = alloc_fsc(); + if (fsc == NULL) + return; + fsc->number = syscall_num; + fsc->name = (syscall_num < 0 || syscall_num >= nsyscalls) ? NULL : syscallnames[syscall_num]; - if (!fsc.name) { + if (!fsc->name) { fprintf(trussinfo->outfile, "-- UNKNOWN SYSCALL %d --\n", syscall_num); } - if (fsc.name && (trussinfo->flags & FOLLOWFORKS) && - (strcmp(fsc.name, "fork") == 0 || - strcmp(fsc.name, "rfork") == 0|| - strcmp(fsc.name, "vfork") == 0)) + if (fsc->name && (trussinfo->flags & FOLLOWFORKS) && + (strcmp(fsc->name, "fork") == 0 || + strcmp(fsc->name, "rfork") == 0 || + strcmp(fsc->name, "vfork") == 0)) trussinfo->curthread->in_fork = 1; if (nargs == 0) return; - fsc.args = malloc((1 + nargs) * sizeof(unsigned long)); + fsc->args = malloc((1 + nargs) * sizeof(unsigned long)); for (i = 0; i < nargs && reg < 6; i++, reg++) { switch (reg) { - case 0: fsc.args[i] = regs.r_rdi; break; - case 1: fsc.args[i] = regs.r_rsi; break; - case 2: fsc.args[i] = regs.r_rdx; break; - case 3: fsc.args[i] = regs.r_rcx; break; - case 4: fsc.args[i] = regs.r_r8; break; - case 5: fsc.args[i] = regs.r_r9; break; + case 0: fsc->args[i] = regs.r_rdi; break; + case 1: fsc->args[i] = regs.r_rsi; break; + case 2: fsc->args[i] = regs.r_rdx; break; + case 3: fsc->args[i] = regs.r_rcx; break; + case 4: fsc->args[i] = regs.r_r8; break; + case 5: fsc->args[i] = regs.r_r9; break; } } if (nargs > i) { iorequest.piod_op = PIOD_READ_D; iorequest.piod_offs = (void *)(regs.r_rsp + sizeof(register_t)); - iorequest.piod_addr = &fsc.args[i]; + iorequest.piod_addr = &fsc->args[i]; iorequest.piod_len = (nargs - i) * sizeof(register_t); - ptrace(PT_IO, cpid, (caddr_t)&iorequest, 0); + ptrace(PT_IO, tid, (caddr_t)&iorequest, 0); if (iorequest.piod_len == 0) return; } - sc = get_syscall(fsc.name); + sc = get_syscall(fsc->name); if (sc) - fsc.nargs = sc->nargs; + fsc->nargs = sc->nargs; else { #if DEBUG fprintf(trussinfo->outfile, "unknown syscall %s -- setting " - "args to %d\n", fsc.name, nargs); + "args to %d\n", fsc->name, nargs); #endif - fsc.nargs = nargs; + fsc->nargs = nargs; } - fsc.s_args = calloc(1, (1 + fsc.nargs) * sizeof(char *)); - fsc.sc = sc; + fsc->s_args = calloc(1, (1 + fsc->nargs) * sizeof(char *)); + fsc->sc = sc; /* * At this point, we set up the system call arguments. @@ -202,19 +208,19 @@ amd64_syscall_entry(struct trussinfo *tr * passed in *and* out, however. */ - if (fsc.name) { + if (fsc->name) { #if DEBUG - fprintf(stderr, "syscall %s(", fsc.name); + fprintf(stderr, "syscall %s(", fsc->name); #endif - for (i = 0; i < fsc.nargs; i++) { + for (i = 0; i < fsc->nargs; i++) { #if DEBUG fprintf(stderr, "0x%lx%s", sc ? - fsc.args[sc->args[i].offset] : fsc.args[i], - i < (fsc.nargs - 1) ? "," : ""); + fsc->args[sc->args[i].offset] : fsc->args[i], + i < (fsc->nargs - 1) ? "," : ""); #endif if (sc && !(sc->args[i].type & OUT)) { - fsc.s_args[i] = print_arg(&sc->args[i], - fsc.args, 0, trussinfo); + fsc->s_args[i] = print_arg(&sc->args[i], + fsc->args, 0, trussinfo); } } #if DEBUG @@ -226,30 +232,29 @@ amd64_syscall_entry(struct trussinfo *tr fprintf(trussinfo->outfile, "\n"); #endif - if (fsc.name != NULL && (strcmp(fsc.name, "execve") == 0 || - strcmp(fsc.name, "exit") == 0)) { + if (fsc->name != NULL && (strcmp(fsc->name, "execve") == 0 || + strcmp(fsc->name, "exit") == 0)) { /* * XXX * This could be done in a more general * manner but it still wouldn't be very pretty. */ - if (strcmp(fsc.name, "execve") == 0) { + if (strcmp(fsc->name, "execve") == 0) { if ((trussinfo->flags & EXECVEARGS) == 0) { - if (fsc.s_args[1]) { - free(fsc.s_args[1]); - fsc.s_args[1] = NULL; + if (fsc->s_args[1]) { + free(fsc->s_args[1]); + fsc->s_args[1] = NULL; } } if ((trussinfo->flags & EXECVEENVS) == 0) { - if (fsc.s_args[2]) { - free(fsc.s_args[2]); - fsc.s_args[2] = NULL; + if (fsc->s_args[2]) { + free(fsc->s_args[2]); + fsc->s_args[2] = NULL; } } } } - - return; + trussinfo->curthread->fsc = fsc; } /* @@ -263,16 +268,18 @@ long amd64_syscall_exit(struct trussinfo *trussinfo, int syscall_num __unused) { struct reg regs; + struct freebsd_syscall *fsc; struct syscall *sc; + lwpid_t tid; long retval; int errorp, i; - if (fsc.name == NULL) + if (trussinfo->curthread->fsc == NULL) return (-1); - cpid = trussinfo->curthread->tid; + tid = trussinfo->curthread->tid; - if (ptrace(PT_GETREGS, cpid, (caddr_t)®s, 0) < 0) { + if (ptrace(PT_GETREGS, tid, (caddr_t)®s, 0) < 0) { fprintf(trussinfo->outfile, "-- CANNOT READ REGISTERS --\n"); return (-1); } @@ -285,10 +292,11 @@ amd64_syscall_exit(struct trussinfo *tru * stand some significant cleaning. */ - sc = fsc.sc; + fsc = trussinfo->curthread->fsc; + sc = fsc->sc; if (!sc) { - for (i = 0; i < fsc.nargs; i++) - asprintf(&fsc.s_args[i], "0x%lx", fsc.args[i]); + for (i = 0; i < fsc->nargs; i++) + asprintf(&fsc->s_args[i], "0x%lx", fsc->args[i]); } else { /* * Here, we only look for arguments that have OUT masked in -- @@ -303,18 +311,18 @@ amd64_syscall_exit(struct trussinfo *tru */ if (errorp) { asprintf(&temp, "0x%lx", - fsc.args[sc->args[i].offset]); + fsc->args[sc->args[i].offset]); } else { temp = print_arg(&sc->args[i], - fsc.args, retval, trussinfo); + fsc->args, retval, trussinfo); } - fsc.s_args[i] = temp; + fsc->s_args[i] = temp; } } } - if (fsc.name != NULL && (strcmp(fsc.name, "execve") == 0 || - strcmp(fsc.name, "exit") == 0)) + if (fsc->name != NULL && (strcmp(fsc->name, "execve") == 0 || + strcmp(fsc->name, "exit") == 0)) trussinfo->curthread->in_syscall = 1; /* @@ -322,9 +330,9 @@ amd64_syscall_exit(struct trussinfo *tru * but that complicates things considerably. */ - print_syscall_ret(trussinfo, fsc.name, fsc.nargs, fsc.s_args, errorp, - retval, fsc.sc); - clear_fsc(); + print_syscall_ret(trussinfo, fsc->name, fsc->nargs, fsc->s_args, errorp, + retval, fsc->sc); + free_fsc(fsc); return (retval); } Modified: head/usr.bin/truss/amd64-fbsd32.c ============================================================================== --- head/usr.bin/truss/amd64-fbsd32.c Sun Sep 16 13:13:02 2012 (r240561) +++ head/usr.bin/truss/amd64-fbsd32.c Sun Sep 16 14:38:01 2012 (r240562) @@ -62,8 +62,6 @@ static const char rcsid[] = #include "syscall.h" #include "extern.h" -static int cpid = -1; - #include "freebsd32_syscalls.h" static int nsyscalls = sizeof(freebsd32_syscallnames) / @@ -78,7 +76,7 @@ static int nsyscalls = sizeof(freebsd32_ * 'struct syscall' describes the system call; it may be NULL, however, * if we don't know about this particular system call yet. */ -static struct freebsd32_syscall { +struct freebsd32_syscall { struct syscall *sc; const char *name; int number; @@ -86,25 +84,29 @@ static struct freebsd32_syscall { unsigned int *args32; int nargs; /* number of arguments -- *not* number of words! */ char **s_args; /* the printable arguments */ -} fsc; +}; + +static struct freebsd32_syscall * +alloc_fsc(void) +{ + + return (malloc(sizeof(struct freebsd32_syscall))); +} /* Clear up and free parts of the fsc structure. */ -static __inline void -clear_fsc(void) +static void +free_fsc(struct freebsd32_syscall *fsc) { int i; - if (fsc.args) - free(fsc.args); - if (fsc.args32) - free(fsc.args32); - if (fsc.s_args) { - for (i = 0; i < fsc.nargs; i++) - if (fsc.s_args[i]) - free(fsc.s_args[i]); - free(fsc.s_args); + free(fsc->args); + free(fsc->args32); + if (fsc->s_args) { + for (i = 0; i < fsc->nargs; i++) + free(fsc->s_args[i]); + free(fsc->s_args); } - memset(&fsc, 0, sizeof(fsc)); + free(fsc); } /* @@ -119,15 +121,15 @@ amd64_fbsd32_syscall_entry(struct trussi { struct ptrace_io_desc iorequest; struct reg regs; + struct freebsd32_syscall *fsc; struct syscall *sc; + lwpid_t tid; unsigned long parm_offset; int i, syscall_num; - clear_fsc(); - - cpid = trussinfo->curthread->tid; + tid = trussinfo->curthread->tid; - if (ptrace(PT_GETREGS, cpid, (caddr_t)®s, 0) < 0) { + if (ptrace(PT_GETREGS, tid, (caddr_t)®s, 0) < 0) { fprintf(trussinfo->outfile, "-- CANNOT READ REGISTERS --\n"); return; } @@ -141,60 +143,63 @@ amd64_fbsd32_syscall_entry(struct trussi syscall_num = regs.r_rax; switch (syscall_num) { case SYS_syscall: - syscall_num = ptrace(PT_READ_D, cpid, (caddr_t)parm_offset, 0); + syscall_num = ptrace(PT_READ_D, tid, (caddr_t)parm_offset, 0); parm_offset += sizeof(int); break; case SYS___syscall: - syscall_num = ptrace(PT_READ_D, cpid, (caddr_t)parm_offset, 0); + syscall_num = ptrace(PT_READ_D, tid, (caddr_t)parm_offset, 0); parm_offset += sizeof(quad_t); break; } - fsc.number = syscall_num; - fsc.name = (syscall_num < 0 || syscall_num >= nsyscalls) ? + fsc = alloc_fsc(); + if (fsc == NULL) + return; + fsc->number = syscall_num; + fsc->name = (syscall_num < 0 || syscall_num >= nsyscalls) ? NULL : freebsd32_syscallnames[syscall_num]; - if (!fsc.name) { + if (!fsc->name) { fprintf(trussinfo->outfile, "-- UNKNOWN SYSCALL %d --\n", syscall_num); } - if (fsc.name && (trussinfo->flags & FOLLOWFORKS) && - (strcmp(fsc.name, "fork") == 0 || - strcmp(fsc.name, "rfork") == 0|| - strcmp(fsc.name, "vfork") == 0)) + if (fsc->name && (trussinfo->flags & FOLLOWFORKS) && + (strcmp(fsc->name, "fork") == 0 || + strcmp(fsc->name, "rfork") == 0 || + strcmp(fsc->name, "vfork") == 0)) trussinfo->curthread->in_fork = 1; if (nargs == 0) return; - fsc.args32 = malloc((1 + nargs) * sizeof(unsigned int)); + fsc->args32 = malloc((1 + nargs) * sizeof(unsigned int)); iorequest.piod_op = PIOD_READ_D; iorequest.piod_offs = (void *)parm_offset; - iorequest.piod_addr = fsc.args32; + iorequest.piod_addr = fsc->args32; iorequest.piod_len = (1 + nargs) * sizeof(unsigned int); - ptrace(PT_IO, cpid, (caddr_t)&iorequest, 0); + ptrace(PT_IO, tid, (caddr_t)&iorequest, 0); if (iorequest.piod_len == 0) return; - fsc.args = malloc((1 + nargs) * sizeof(unsigned long)); + fsc->args = malloc((1 + nargs) * sizeof(unsigned long)); for (i = 0; i < nargs + 1; i++) - fsc.args[i] = fsc.args32[i]; + fsc->args[i] = fsc->args32[i]; sc = NULL; - if (fsc.name) - sc = get_syscall(fsc.name); + if (fsc->name) + sc = get_syscall(fsc->name); if (sc) - fsc.nargs = sc->nargs; + fsc->nargs = sc->nargs; else { #if DEBUG fprintf(trussinfo->outfile, "unknown syscall %s -- setting " - "args to %d\n", fsc.name, nargs); + "args to %d\n", fsc->name, nargs); #endif - fsc.nargs = nargs; + fsc->nargs = nargs; } - fsc.s_args = calloc(1, (1 + fsc.nargs) * sizeof(char *)); - fsc.sc = sc; + fsc->s_args = calloc(1, (1 + fsc->nargs) * sizeof(char *)); + fsc->sc = sc; /* * At this point, we set up the system call arguments. @@ -204,19 +209,19 @@ amd64_fbsd32_syscall_entry(struct trussi * passed in *and* out, however. */ - if (fsc.name) { + if (fsc->name) { #if DEBUG - fprintf(stderr, "syscall %s(", fsc.name); + fprintf(stderr, "syscall %s(", fsc->name); #endif - for (i = 0; i < fsc.nargs; i++) { + for (i = 0; i < fsc->nargs; i++) { #if DEBUG fprintf(stderr, "0x%x%s", sc ? - fsc.args[sc->args[i].offset] : fsc.args[i], - i < (fsc.nargs - 1) ? "," : ""); + fsc->args[sc->args[i].offset] : fsc->args[i], + i < (fsc->nargs - 1) ? "," : ""); #endif if (sc && !(sc->args[i].type & OUT)) { - fsc.s_args[i] = print_arg(&sc->args[i], - fsc.args, 0, trussinfo); + fsc->s_args[i] = print_arg(&sc->args[i], + fsc->args, 0, trussinfo); } } #if DEBUG @@ -228,30 +233,29 @@ amd64_fbsd32_syscall_entry(struct trussi fprintf(trussinfo->outfile, "\n"); #endif - if (fsc.name != NULL && (strcmp(fsc.name, "freebsd32_execve") == 0|| - strcmp(fsc.name, "exit") == 0)) { + if (fsc->name != NULL && (strcmp(fsc->name, "freebsd32_execve") == 0 || + strcmp(fsc->name, "exit") == 0)) { /* * XXX * This could be done in a more general * manner but it still wouldn't be very pretty. */ - if (strcmp(fsc.name, "freebsd32_execve") == 0) { + if (strcmp(fsc->name, "freebsd32_execve") == 0) { if ((trussinfo->flags & EXECVEARGS) == 0) { - if (fsc.s_args[1]) { - free(fsc.s_args[1]); - fsc.s_args[1] = NULL; + if (fsc->s_args[1]) { + free(fsc->s_args[1]); + fsc->s_args[1] = NULL; } } if ((trussinfo->flags & EXECVEENVS) == 0) { - if (fsc.s_args[2]) { - free(fsc.s_args[2]); - fsc.s_args[2] = NULL; + if (fsc->s_args[2]) { + free(fsc->s_args[2]); + fsc->s_args[2] = NULL; } } } } - - return; + trussinfo->curthread->fsc = fsc; } /* @@ -265,16 +269,18 @@ long amd64_fbsd32_syscall_exit(struct trussinfo *trussinfo, int syscall_num __unused) { struct reg regs; + struct freebsd32_syscall *fsc; struct syscall *sc; + lwpid_t tid; long retval; int errorp, i; - if (fsc.name == NULL) + if (trussinfo->curthread->fsc == NULL) return (-1); - cpid = trussinfo->curthread->tid; + tid = trussinfo->curthread->tid; - if (ptrace(PT_GETREGS, cpid, (caddr_t)®s, 0) < 0) { + if (ptrace(PT_GETREGS, tid, (caddr_t)®s, 0) < 0) { fprintf(trussinfo->outfile, "-- CANNOT READ REGISTERS --\n"); return (-1); } @@ -287,10 +293,11 @@ amd64_fbsd32_syscall_exit(struct trussin * stand some significant cleaning. */ - sc = fsc.sc; + fsc = trussinfo->curthread->fsc; + sc = fsc->sc; if (!sc) { - for (i = 0; i < fsc.nargs; i++) - asprintf(&fsc.s_args[i], "0x%lx", fsc.args[i]); + for (i = 0; i < fsc->nargs; i++) + asprintf(&fsc->s_args[i], "0x%lx", fsc->args[i]); } else { /* * Here, we only look for arguments that have OUT masked in -- @@ -305,18 +312,18 @@ amd64_fbsd32_syscall_exit(struct trussin */ if (errorp) { asprintf(&temp, "0x%lx", - fsc.args[sc->args[i].offset]); + fsc->args[sc->args[i].offset]); } else { temp = print_arg(&sc->args[i], - fsc.args, retval, trussinfo); + fsc->args, retval, trussinfo); } - fsc.s_args[i] = temp; + fsc->s_args[i] = temp; } } } - if (fsc.name != NULL && (strcmp(fsc.name, "freebsd32_execve") == 0 || - strcmp(fsc.name, "exit") == 0)) + if (fsc->name != NULL && (strcmp(fsc->name, "freebsd32_execve") == 0 || + strcmp(fsc->name, "exit") == 0)) trussinfo->curthread->in_syscall = 1; /* @@ -324,9 +331,9 @@ amd64_fbsd32_syscall_exit(struct trussin * but that complicates things considerably. */ - print_syscall_ret(trussinfo, fsc.name, fsc.nargs, fsc.s_args, errorp, - retval, fsc.sc); - clear_fsc(); + print_syscall_ret(trussinfo, fsc->name, fsc->nargs, fsc->s_args, errorp, + retval, fsc->sc); + free_fsc(fsc); return (retval); } Modified: head/usr.bin/truss/amd64-linux32.c ============================================================================== --- head/usr.bin/truss/amd64-linux32.c Sun Sep 16 13:13:02 2012 (r240561) +++ head/usr.bin/truss/amd64-linux32.c Sun Sep 16 14:38:01 2012 (r240562) @@ -59,8 +59,6 @@ static const char rcsid[] = #include "syscall.h" #include "extern.h" -static int cpid = -1; - #include "linux32_syscalls.h" static int nsyscalls = @@ -75,28 +73,34 @@ static int nsyscalls = * 'struct syscall' describes the system call; it may be NULL, however, * if we don't know about this particular system call yet. */ -static struct linux_syscall { +struct linux_syscall { struct syscall *sc; const char *name; int number; unsigned long args[5]; int nargs; /* number of arguments -- *not* number of words! */ char **s_args; /* the printable arguments */ -} fsc; +}; + +static struct linux_syscall * +alloc_fsc(void) +{ + + return (malloc(sizeof(struct linux_syscall))); +} /* Clear up and free parts of the fsc structure. */ -static __inline void -clear_fsc(void) +static void +free_fsc(struct linux_syscall *fsc) { int i; - if (fsc.s_args) { - for (i = 0; i < fsc.nargs; i++) - if (fsc.s_args[i]) - free(fsc.s_args[i]); - free(fsc.s_args); + if (fsc->s_args) { + for (i = 0; i < fsc->nargs; i++) + free(fsc->s_args[i]); + free(fsc->s_args); } - memset(&fsc, 0, sizeof(fsc)); + free(fsc); } /* @@ -110,31 +114,34 @@ void amd64_linux32_syscall_entry(struct trussinfo *trussinfo, int nargs) { struct reg regs; + struct linux_syscall *fsc; struct syscall *sc; + lwpid_t tid; int i, syscall_num; - clear_fsc(); - - cpid = trussinfo->curthread->tid; + tid = trussinfo->curthread->tid; - if (ptrace(PT_GETREGS, cpid, (caddr_t)®s, 0) < 0) { + if (ptrace(PT_GETREGS, tid, (caddr_t)®s, 0) < 0) { fprintf(trussinfo->outfile, "-- CANNOT READ REGISTERS --\n"); return; } syscall_num = regs.r_rax; - fsc.number = syscall_num; - fsc.name = (syscall_num < 0 || syscall_num >= nsyscalls) ? + fsc = alloc_fsc(); + if (fsc == NULL) + return; + fsc->number = syscall_num; + fsc->name = (syscall_num < 0 || syscall_num >= nsyscalls) ? NULL : linux32_syscallnames[syscall_num]; - if (!fsc.name) { + if (!fsc->name) { fprintf(trussinfo->outfile, "-- UNKNOWN SYSCALL %d --\n", syscall_num); } - if (fsc.name && (trussinfo->flags & FOLLOWFORKS) && - (strcmp(fsc.name, "linux_fork") == 0|| - strcmp(fsc.name, "linux_vfork") == 0)) + if (fsc->name && (trussinfo->flags & FOLLOWFORKS) && + (strcmp(fsc->name, "linux_fork") == 0 || + strcmp(fsc->name, "linux_vfork") == 0)) trussinfo->curthread->in_fork = 1; if (nargs == 0) @@ -148,25 +155,25 @@ amd64_linux32_syscall_entry(struct truss * that have more than five arguments? */ - fsc.args[0] = regs.r_rbx; - fsc.args[1] = regs.r_rcx; - fsc.args[2] = regs.r_rdx; - fsc.args[3] = regs.r_rsi; - fsc.args[4] = regs.r_rdi; + fsc->args[0] = regs.r_rbx; + fsc->args[1] = regs.r_rcx; + fsc->args[2] = regs.r_rdx; + fsc->args[3] = regs.r_rsi; + fsc->args[4] = regs.r_rdi; - sc = get_syscall(fsc.name); + sc = get_syscall(fsc->name); if (sc) - fsc.nargs = sc->nargs; + fsc->nargs = sc->nargs; else { #if DEBUG fprintf(trussinfo->outfile, "unknown syscall %s -- setting " - "args to %d\n", fsc.name, nargs); + "args to %d\n", fsc->name, nargs); #endif - fsc.nargs = nargs; + fsc->nargs = nargs; } - fsc.s_args = calloc(1, (1 + fsc.nargs) * sizeof(char *)); - fsc.sc = sc; + fsc->s_args = calloc(1, (1 + fsc->nargs) * sizeof(char *)); + fsc->sc = sc; /* * At this point, we set up the system call arguments. @@ -176,19 +183,19 @@ amd64_linux32_syscall_entry(struct truss * passed in *and* out, however. */ - if (fsc.name) { + if (fsc->name) { #if DEBUG - fprintf(stderr, "syscall %s(", fsc.name); + fprintf(stderr, "syscall %s(", fsc->name); #endif - for (i = 0; i < fsc.nargs; i++) { + for (i = 0; i < fsc->nargs; i++) { #if DEBUG fprintf(stderr, "0x%x%s", sc ? - fsc.args[sc->args[i].offset] : fsc.args[i], - i < (fsc.nargs - 1) ? "," : ""); + fsc->args[sc->args[i].offset] : fsc->args[i], + i < (fsc->nargs - 1) ? "," : ""); #endif if (sc && !(sc->args[i].type & OUT)) { - fsc.s_args[i] = print_arg(&sc->args[i], - fsc.args, 0, trussinfo); + fsc->s_args[i] = print_arg(&sc->args[i], + fsc->args, 0, trussinfo); } } #if DEBUG @@ -200,30 +207,29 @@ amd64_linux32_syscall_entry(struct truss fprintf(trussinfo->outfile, "\n"); #endif - if (fsc.name != NULL && (strcmp(fsc.name, "linux_execve") == 0 || - strcmp(fsc.name, "exit") == 0)) { + if (fsc->name != NULL && (strcmp(fsc->name, "linux_execve") == 0 || + strcmp(fsc->name, "exit") == 0)) { /* * XXX * This could be done in a more general * manner but it still wouldn't be very pretty. */ - if (strcmp(fsc.name, "linux_execve") == 0) { + if (strcmp(fsc->name, "linux_execve") == 0) { if ((trussinfo->flags & EXECVEARGS) == 0) { - if (fsc.s_args[1]) { - free(fsc.s_args[1]); - fsc.s_args[1] = NULL; + if (fsc->s_args[1]) { + free(fsc->s_args[1]); + fsc->s_args[1] = NULL; } } if ((trussinfo->flags & EXECVEENVS) == 0) { - if (fsc.s_args[2]) { - free(fsc.s_args[2]); - fsc.s_args[2] = NULL; + if (fsc->s_args[2]) { + free(fsc->s_args[2]); + fsc->s_args[2] = NULL; } } } } - - return; + trussinfo->curthread->fsc = fsc; } /* @@ -246,16 +252,18 @@ amd64_linux32_syscall_exit(struct trussi int syscall_num __unused) { struct reg regs; + struct linux_syscall *fsc; struct syscall *sc; + lwpid_t tid; long retval; int errorp, i; - if (fsc.name == NULL) + if (trussinfo->curthread->fsc == NULL) return (-1); - cpid = trussinfo->curthread->tid; + tid = trussinfo->curthread->tid; - if (ptrace(PT_GETREGS, cpid, (caddr_t)®s, 0) < 0) { + if (ptrace(PT_GETREGS, tid, (caddr_t)®s, 0) < 0) { fprintf(trussinfo->outfile, "-- CANNOT READ REGISTERS --\n"); return (-1); } @@ -268,10 +276,11 @@ amd64_linux32_syscall_exit(struct trussi * stand some significant cleaning. */ - sc = fsc.sc; + fsc = trussinfo->curthread->fsc; + sc = fsc->sc; if (!sc) { - for (i = 0; i < fsc.nargs; i++) - asprintf(&fsc.s_args[i], "0x%lx", fsc.args[i]); + for (i = 0; i < fsc->nargs; i++) + asprintf(&fsc->s_args[i], "0x%lx", fsc->args[i]); } else { /* * Here, we only look for arguments that have OUT masked in -- @@ -286,12 +295,12 @@ amd64_linux32_syscall_exit(struct trussi */ if (errorp) { asprintf(&temp, "0x%lx", - fsc.args[sc->args[i].offset]); + fsc->args[sc->args[i].offset]); } else { temp = print_arg(&sc->args[i], - fsc.args, retval, trussinfo); + fsc->args, retval, trussinfo); } - fsc.s_args[i] = temp; + fsc->s_args[i] = temp; } } } @@ -308,13 +317,13 @@ amd64_linux32_syscall_exit(struct trussi } } - if (fsc.name != NULL && (strcmp(fsc.name, "linux_execve") == 0 || - strcmp(fsc.name, "exit") == 0)) + if (fsc->name != NULL && (strcmp(fsc->name, "linux_execve") == 0 || + strcmp(fsc->name, "exit") == 0)) trussinfo->curthread->in_syscall = 1; - print_syscall_ret(trussinfo, fsc.name, fsc.nargs, fsc.s_args, errorp, - errorp ? i : retval, fsc.sc); - clear_fsc(); + print_syscall_ret(trussinfo, fsc->name, fsc->nargs, fsc->s_args, errorp, + errorp ? i : retval, fsc->sc); + free_fsc(fsc); return (retval); } Modified: head/usr.bin/truss/i386-fbsd.c ============================================================================== --- head/usr.bin/truss/i386-fbsd.c Sun Sep 16 13:13:02 2012 (r240561) +++ head/usr.bin/truss/i386-fbsd.c Sun Sep 16 14:38:01 2012 (r240562) @@ -62,8 +62,6 @@ static const char rcsid[] = #include "syscall.h" #include "extern.h" -static int cpid = -1; - #include "syscalls.h" static int nsyscalls = sizeof(syscallnames) / sizeof(syscallnames[0]); @@ -77,30 +75,35 @@ static int nsyscalls = sizeof(syscallnam * 'struct syscall' describes the system call; it may be NULL, however, * if we don't know about this particular system call yet. */ -static struct freebsd_syscall { +struct freebsd_syscall { struct syscall *sc; const char *name; int number; unsigned long *args; int nargs; /* number of arguments -- *not* number of words! */ char **s_args; /* the printable arguments */ -} fsc; +}; + +static struct freebsd_syscall * +alloc_fsc(void) +{ + + return (malloc(sizeof(struct freebsd_syscall))); +} /* Clear up and free parts of the fsc structure. */ -static __inline void -clear_fsc(void) +static void +free_fsc(struct freebsd_syscall *fsc) { int i; - if (fsc.args) - free(fsc.args); - if (fsc.s_args) { - for (i = 0; i < fsc.nargs; i++) - if (fsc.s_args[i]) - free(fsc.s_args[i]); - free(fsc.s_args); + free(fsc->args); + if (fsc->s_args) { + for (i = 0; i < fsc->nargs; i++) + free(fsc->s_args[i]); + free(fsc->s_args); } - memset(&fsc, 0, sizeof(fsc)); + free(fsc); } /* @@ -115,15 +118,15 @@ i386_syscall_entry(struct trussinfo *tru { struct ptrace_io_desc iorequest; struct reg regs; + struct freebsd_syscall *fsc; struct syscall *sc; + lwpid_t tid; unsigned int parm_offset; int i, syscall_num; - clear_fsc(); - - cpid = trussinfo->curthread->tid; + tid = trussinfo->curthread->tid; - if (ptrace(PT_GETREGS, cpid, (caddr_t)®s, 0) < 0) { + if (ptrace(PT_GETREGS, tid, (caddr_t)®s, 0) < 0) { fprintf(trussinfo->outfile, "-- CANNOT READ REGISTERS --\n"); return; } @@ -137,56 +140,59 @@ i386_syscall_entry(struct trussinfo *tru syscall_num = regs.r_eax; switch (syscall_num) { case SYS_syscall: - syscall_num = ptrace(PT_READ_D, cpid, (caddr_t)parm_offset, 0); + syscall_num = ptrace(PT_READ_D, tid, (caddr_t)parm_offset, 0); parm_offset += sizeof(int); break; case SYS___syscall: - syscall_num = ptrace(PT_READ_D, cpid, (caddr_t)parm_offset, 0); + syscall_num = ptrace(PT_READ_D, tid, (caddr_t)parm_offset, 0); parm_offset += sizeof(quad_t); break; } - fsc.number = syscall_num; - fsc.name = (syscall_num < 0 || syscall_num >= nsyscalls) ? + fsc = alloc_fsc(); + if (fsc == NULL) + return; + fsc->number = syscall_num; + fsc->name = (syscall_num < 0 || syscall_num >= nsyscalls) ? NULL : syscallnames[syscall_num]; - if (!fsc.name) { + if (!fsc->name) { fprintf(trussinfo->outfile, "-- UNKNOWN SYSCALL %d --\n", syscall_num); } - if (fsc.name && (trussinfo->flags & FOLLOWFORKS) && *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Sep 16 15:09:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 260E1106564A; Sun, 16 Sep 2012 15:09:21 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-pb0-f54.google.com (mail-pb0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id CCB618FC08; Sun, 16 Sep 2012 15:09:20 +0000 (UTC) Received: by pbbrp2 with SMTP id rp2so8522752pbb.13 for ; Sun, 16 Sep 2012 08:09:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=eR7xCxIQ5sh/Rt8TZMgkcOCnQtBfoqQZO5epbgfr1JI=; b=J0pP9dD/FaJukx0UoHtOBvrc41ZvrKnxUPkfkzqg9999NCo7oN6lUqu2SwKkhcmOeI 7+wngUBy8CBAPrJCy+/IYJ0mV+em467XKJ8xcyFcB8+a2G3IDWesPqAlM/wFnFGZpiZt UZ124x4Qb0e9TojEI07rJND5S8GAnVvIl0vbZHbVZXze1YXltKqknaENwXy7o8HGREQZ Eqyah/Omj6ZIfya26HQoRK6W9T35mbEO5mDUObFC/4tJxsbwkj4zvsokWk98csJPlKwZ eLbnq/p/rVmWuKVD3Qhr6Uou5m9stkuHK4iuOMoozTovJ5FfV3XL548iKZ4GNKq0pzoA JI6w== MIME-Version: 1.0 Received: by 10.68.234.98 with SMTP id ud2mr16323522pbc.165.1347808160307; Sun, 16 Sep 2012 08:09:20 -0700 (PDT) Sender: mdf356@gmail.com Received: by 10.68.13.170 with HTTP; Sun, 16 Sep 2012 08:09:20 -0700 (PDT) In-Reply-To: <20120916095355.GA83285@FreeBSD.org> References: <201209160755.q8G7tnMH036332@svn.freebsd.org> <20120916092818.GA81952@FreeBSD.org> <20120916095355.GA83285@FreeBSD.org> Date: Sun, 16 Sep 2012 08:09:20 -0700 X-Google-Sender-Auth: gwBE-1mTUzcmWupgK6iDOU54sj4 Message-ID: From: mdf@FreeBSD.org To: Alexey Dokuchaev Content-Type: text/plain; charset=ISO-8859-1 Cc: Chris Rees , Andrew Turner , svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r240549 - head/sys/arm/tegra X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Sep 2012 15:09:21 -0000 On Sun, Sep 16, 2012 at 2:53 AM, Alexey Dokuchaev wrote: > On Sun, Sep 16, 2012 at 10:37:56AM +0100, Chris Rees wrote: >> On 16 September 2012 10:28, Alexey Dokuchaev wrote: >> > I thought preferred and more style(9) compliant way to code [empty >> > endless loop] is: >> > >> > for (;;) >> > continue; >> >> Actually: >> >> for (;;) >> ; > > Explicit "continue" is supposed to tell reviewer that original author did > not make a typo, but indeed knew what he was doing. Lonely semicolon is too > ambiguous in this case. The semicolon being on its own line is not ambiguous, and is good style everywhere. A semicolon on the same line as a while or for is a red flag that it may be unintentional. Cheers, matthew From owner-svn-src-all@FreeBSD.ORG Sun Sep 16 15:18:22 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1817A106566C; Sun, 16 Sep 2012 15:18:22 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) by mx1.freebsd.org (Postfix) with ESMTP id D37F78FC0C; Sun, 16 Sep 2012 15:18:21 +0000 (UTC) Received: from [192.168.0.2] (cpc2-cmbg15-2-0-cust445.5-4.cable.virginmedia.com [86.26.13.190]) (authenticated bits=0) by theravensnest.org (8.14.5/8.14.5) with ESMTP id q8GFID3S051728 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Sun, 16 Sep 2012 15:18:14 GMT (envelope-from theraven@FreeBSD.org) Mime-Version: 1.0 (Apple Message framework v1278) Content-Type: text/plain; charset=iso-8859-1 From: David Chisnall In-Reply-To: Date: Sun, 16 Sep 2012 16:18:08 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <38FB39C4-7626-4D54-8197-E302BB9452D2@FreeBSD.org> References: <201209160755.q8G7tnMH036332@svn.freebsd.org> <20120916092818.GA81952@FreeBSD.org> To: Chris Rees X-Mailer: Apple Mail (2.1278) Cc: Andrew Turner , svn-src-head@FreeBSD.org, Alexey Dokuchaev , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org Subject: Re: svn commit: r240549 - head/sys/arm/tegra X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Sep 2012 15:18:22 -0000 On 16 Sep 2012, at 10:37, Chris Rees wrote: > Actually: >=20 > for (;;) > ; This form will generate a compiler warning, because it looks like a = missing loop body. You can silence the warning by this form: for (;;) {} This makes it clear that you have an explicit body containing no = statements. =20 David= From owner-svn-src-all@FreeBSD.ORG Sun Sep 16 15:22:16 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0D916106564A; Sun, 16 Sep 2012 15:22:16 +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 ECCC68FC12; Sun, 16 Sep 2012 15:22:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8GFMFhU016651; Sun, 16 Sep 2012 15:22:15 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8GFMFco016649; Sun, 16 Sep 2012 15:22:15 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201209161522.q8GFMFco016649@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Sun, 16 Sep 2012 15:22:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240563 - head/usr.sbin/jail X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Sep 2012 15:22:16 -0000 Author: des Date: Sun Sep 16 15:22:15 2012 New Revision: 240563 URL: http://svn.freebsd.org/changeset/base/240563 Log: Warn about filesystem-based attacks. Modified: head/usr.sbin/jail/jail.8 Modified: head/usr.sbin/jail/jail.8 ============================================================================== --- head/usr.sbin/jail/jail.8 Sun Sep 16 14:38:01 2012 (r240562) +++ head/usr.sbin/jail/jail.8 Sun Sep 16 15:22:15 2012 (r240563) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 23, 2012 +.Dd September 15, 2012 .Dt JAIL 8 .Os .Sh NAME @@ -1225,3 +1225,11 @@ directory that is moved out of the jail' access to the file space outside of the jail. It is recommended that directories always be copied, rather than moved, out of a jail. +.Pp +In addition, there are several ways in which an unprivileged user +outside the jail can cooperate with a privileged user inside the jail +and thereby obtain elevated privileges in the host environment. +Most of these attacks can be mitigated by ensuring that the jail root +is not accessible to unprivileged users in the host environment. +Regardless, as a general rule, untrusted users with privileged access +to a jail should not be given access to the host environment. From owner-svn-src-all@FreeBSD.ORG Sun Sep 16 16:06:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 58C5D106564A for ; Sun, 16 Sep 2012 16:06:12 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-pb0-f54.google.com (mail-pb0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id 1E8C58FC0C for ; Sun, 16 Sep 2012 16:06:12 +0000 (UTC) Received: by pbbrp2 with SMTP id rp2so8565593pbb.13 for ; Sun, 16 Sep 2012 09:06:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=QAI+qv46z2LVY2EEXRQ8ZYLM4whKsP1pnMHkHh0T+GM=; b=C7hBqH7d3ivETlQYmVV4Vi1RViu5n5aKXHULgEnmqAASKlaKCQjvPZ+AZJFkdVUc6t pFHc4UXOvr3E0liae4MohHxURqn+o1M4egpapfPBeESaOk9v4pnmSl5XDpQ0AHjf4B5D oBjK+O6yHHUSVBmHxAadtqbKxfWTu/oKzJbuk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=QAI+qv46z2LVY2EEXRQ8ZYLM4whKsP1pnMHkHh0T+GM=; b=asE9JItNwJ6nMDodKIfxUZtWyYGuSuiHotn3mcGOWNYrni5svFTBnQkppwIhdFPLWy Eq1btrR9XdzvJUs4JM74rZtBihfzQERB2VtrTApffwqCmCi2hgfhhl1FZUbh9ZdD8RNS vzNhB4JLUQLz4pp5Dd2sHG12zn2/xcuAdrKinjXJ+Rz1Z3iYh0jpOmEU926oGB0Lw9wy Rj4tVJyQWQ1wd47EhcVvMChX9lDY88b6w4c/ew9Ily8fExA6S4J8hB7xAfEw44+t4GIX wG0wG9Wuiqsx+2EMG78PmboOVlZEGbpj2znHuJ12X+7GtTpg6gz8OQey7KxZDV96OuSp wQIA== Received: by 10.68.210.207 with SMTP id mw15mr123048pbc.81.1347811571801; Sun, 16 Sep 2012 09:06:11 -0700 (PDT) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.66.87.41 with HTTP; Sun, 16 Sep 2012 09:05:41 -0700 (PDT) In-Reply-To: <5055E121.2030208@coosemans.org> References: <201209142347.q8ENlN7N034951@svn.freebsd.org> <5054EBCB.6070105@coosemans.org> <5054F116.8090503@cran.org.uk> <5055E121.2030208@coosemans.org> From: Eitan Adler Date: Sun, 16 Sep 2012 12:05:41 -0400 X-Google-Sender-Auth: 1uxuEuBFkE9yU7Rwb09DhC4HenE Message-ID: To: Tijl Coosemans Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQmsz0yNvvTnUUXyBLo1iA2OkrE03JzkpNv51QTTt1rIIc6wku4sxk90T8oAz3nNb8IcO14A Cc: Bruce Cran , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r240527 - head/bin/df X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Sep 2012 16:06:12 -0000 On 16 September 2012 10:24, Tijl Coosemans wrote: > On 16-09-2012 01:27, Eitan Adler wrote: >> On 15 September 2012 17:20, Bruce Cran wrote: >>> On 15/09/2012 21:57, Tijl Coosemans wrote: >>>> >>>> Freeing memory right before exiting is a waste of time. The tool shouldn't >>>> complain about it. >> >> Perhaps, but tools do. This has already been brought up on cfe-dev. >> >>> "/Stop wasting time and just exit already/." - >>> http://blogs.msdn.com/b/oldnewthing/archive/2012/01/05/10253268.aspx >> >> I read this blog post when it came out. :) > > In this case the free is actually wrong, because the pointer can point > to memory allocated by getmntinfo(3) and that manpage says an application > cannot free it. Ah, I missed that. I wish this point was brought up earlier. I'll revert the commit -- Eitan Adler Source & Ports committer X11, Bugbusting teams From owner-svn-src-all@FreeBSD.ORG Sun Sep 16 16:08:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2AC5A106566C; Sun, 16 Sep 2012 16:08:21 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 16E408FC08; Sun, 16 Sep 2012 16:08:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8GG8K9H025643; Sun, 16 Sep 2012 16:08:20 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8GG8KBQ025640; Sun, 16 Sep 2012 16:08:20 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201209161608.q8GG8KBQ025640@svn.freebsd.org> From: Eitan Adler Date: Sun, 16 Sep 2012 16:08:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240565 - head/bin/df X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Sep 2012 16:08:21 -0000 Author: eadler Date: Sun Sep 16 16:08:20 2012 New Revision: 240565 URL: http://svn.freebsd.org/changeset/base/240565 Log: Revert 240527: mntbuf can poit to memory allocated by getmntinfo(3) which can't be freed PR: bin/171634 Approved by: cperciva (implicit) Modified: head/bin/df/df.c Modified: head/bin/df/df.c ============================================================================== --- head/bin/df/df.c Sun Sep 16 15:35:05 2012 (r240564) +++ head/bin/df/df.c Sun Sep 16 16:08:20 2012 (r240565) @@ -290,7 +290,6 @@ main(int argc, char *argv[]) prtstat(&mntbuf[i], &maxwidths); if (cflag) prtstat(&totalbuf, &maxwidths); - free(mntbuf); return (rv); } From owner-svn-src-all@FreeBSD.ORG Sun Sep 16 16:58:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2FD46106566C; Sun, 16 Sep 2012 16:58:50 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1AA448FC08; Sun, 16 Sep 2012 16:58:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8GGwn2x034877; Sun, 16 Sep 2012 16:58:49 GMT (envelope-from tijl@svn.freebsd.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8GGwnM6034873; Sun, 16 Sep 2012 16:58:49 GMT (envelope-from tijl@svn.freebsd.org) Message-Id: <201209161658.q8GGwnM6034873@svn.freebsd.org> From: Tijl Coosemans Date: Sun, 16 Sep 2012 16:58:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240566 - head/lib/msun/i387 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Sep 2012 16:58:50 -0000 Author: tijl Date: Sun Sep 16 16:58:49 2012 New Revision: 240566 URL: http://svn.freebsd.org/changeset/base/240566 Log: Optimise i387 trigonometric functions. Replace "andw 0x400,%ax \ jnz" with "sahf \ jp", "fprem1" with "fprem" and "fstsw %ax" with "fnstsw %ax". Modified: head/lib/msun/i387/s_cos.S head/lib/msun/i387/s_sin.S head/lib/msun/i387/s_tan.S Modified: head/lib/msun/i387/s_cos.S ============================================================================== --- head/lib/msun/i387/s_cos.S Sun Sep 16 16:08:20 2012 (r240565) +++ head/lib/msun/i387/s_cos.S Sun Sep 16 16:58:49 2012 (r240566) @@ -40,16 +40,16 @@ ENTRY(cos) fldl 4(%esp) fcos fnstsw %ax - andw $0x400,%ax - jnz 1f + sahf + jp 1f ret 1: fldpi fadd %st(0) fxch %st(1) -2: fprem1 +2: fprem fnstsw %ax - andw $0x400,%ax - jnz 2b + sahf + jp 2b fstp %st(1) fcos ret Modified: head/lib/msun/i387/s_sin.S ============================================================================== --- head/lib/msun/i387/s_sin.S Sun Sep 16 16:08:20 2012 (r240565) +++ head/lib/msun/i387/s_sin.S Sun Sep 16 16:58:49 2012 (r240566) @@ -40,16 +40,16 @@ ENTRY(sin) fldl 4(%esp) fsin fnstsw %ax - andw $0x400,%ax - jnz 1f + sahf + jp 1f ret 1: fldpi fadd %st(0) fxch %st(1) -2: fprem1 +2: fprem fnstsw %ax - andw $0x400,%ax - jnz 2b + sahf + jp 2b fstp %st(1) fsin ret Modified: head/lib/msun/i387/s_tan.S ============================================================================== --- head/lib/msun/i387/s_tan.S Sun Sep 16 16:08:20 2012 (r240565) +++ head/lib/msun/i387/s_tan.S Sun Sep 16 16:58:49 2012 (r240566) @@ -40,17 +40,17 @@ ENTRY(tan) fldl 4(%esp) fptan fnstsw %ax - andw $0x400,%ax - jnz 1f + sahf + jp 1f fstp %st(0) ret 1: fldpi fadd %st(0) fxch %st(1) -2: fprem1 - fstsw %ax - andw $0x400,%ax - jnz 2b +2: fprem + fnstsw %ax + sahf + jp 2b fstp %st(1) fptan fstp %st(0) From owner-svn-src-all@FreeBSD.ORG Sun Sep 16 17:30:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 88B2F106564A; Sun, 16 Sep 2012 17:30:21 +0000 (UTC) (envelope-from utisoft@gmail.com) Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 15B938FC14; Sun, 16 Sep 2012 17:30:19 +0000 (UTC) Received: by bkcje9 with SMTP id je9so1948733bkc.13 for ; Sun, 16 Sep 2012 10:30:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=IrcpWgGXOGh/xt8Dc5mdEojijdCQWSH+FnOmVD4PjoU=; b=sCOA5V0SJbO8IrEghZhRGXsl7FxPytJnWU1QQ8vqo+J7tIakzTMVRy7dxNhNepHJMm /3gaVey1D1tL726YqV9+dhaSRiud1Lh0CMm1Ko6kT3fqefPz5xsPfyQCITZ8dzAyFjRQ kGF3npux8RjEy1aGcnB40X0LnI06ucLk8kuOkNEODS3wurgyiZ86fdCucq/rtj0luO6Z zo7QugkVdUxjI70iLnt1ZYFmVy8Z17oHNEKB2OK77cEl2yMwbZRfgOXcIuIdAy9Qezfn UbGjeyOLPt5PUrBabYeLeWt5sgCXUAZM5RbDO2UQ6p4q2D5q0j9Q6Z1jO1Xz3C8NtNFX Pt3w== MIME-Version: 1.0 Received: by 10.204.129.14 with SMTP id m14mr3641207bks.7.1347816618652; Sun, 16 Sep 2012 10:30:18 -0700 (PDT) Received: by 10.204.10.141 with HTTP; Sun, 16 Sep 2012 10:30:18 -0700 (PDT) Received: by 10.204.10.141 with HTTP; Sun, 16 Sep 2012 10:30:18 -0700 (PDT) In-Reply-To: <38FB39C4-7626-4D54-8197-E302BB9452D2@FreeBSD.org> References: <201209160755.q8G7tnMH036332@svn.freebsd.org> <20120916092818.GA81952@FreeBSD.org> <38FB39C4-7626-4D54-8197-E302BB9452D2@FreeBSD.org> Date: Sun, 16 Sep 2012 18:30:18 +0100 Message-ID: From: Chris Rees To: David Chisnall , Bruce Evans Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: svn-src-head@freebsd.org, Andrew Turner , svn-src-all@freebsd.org, src-committers@freebsd.org, Alexey Dokuchaev Subject: Re: svn commit: r240549 - head/sys/arm/tegra X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Sep 2012 17:30:21 -0000 On 16 Sep 2012 16:19, "David Chisnall" wrote: > > On 16 Sep 2012, at 10:37, Chris Rees wrote: > > > Actually: > > > > for (;;) > > ; > > This form will generate a compiler warning, because it looks like a missing loop body. You can silence the warning by this form: > > for (;;) {} > > This makes it clear that you have an explicit body containing no statements. Please fix the style man page then, and make sure bde approves! Chris From owner-svn-src-all@FreeBSD.ORG Sun Sep 16 17:42:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5EA41106564A; Sun, 16 Sep 2012 17:42:15 +0000 (UTC) (envelope-from freebsd@damnhippie.dyndns.org) Received: from duck.symmetricom.us (duck.symmetricom.us [206.168.13.214]) by mx1.freebsd.org (Postfix) with ESMTP id B0B058FC1C; Sun, 16 Sep 2012 17:41:56 +0000 (UTC) Received: from damnhippie.dyndns.org (daffy.symmetricom.us [206.168.13.218]) by duck.symmetricom.us (8.14.5/8.14.5) with ESMTP id q8GHfnYl004300; Sun, 16 Sep 2012 11:41:49 -0600 (MDT) (envelope-from freebsd@damnhippie.dyndns.org) Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id q8GHfOPM055096; Sun, 16 Sep 2012 11:41:24 -0600 (MDT) (envelope-from freebsd@damnhippie.dyndns.org) From: Ian Lepore To: Chris Rees In-Reply-To: References: <201209160755.q8G7tnMH036332@svn.freebsd.org> <20120916092818.GA81952@FreeBSD.org> <38FB39C4-7626-4D54-8197-E302BB9452D2@FreeBSD.org> Content-Type: text/plain; charset="us-ascii" Date: Sun, 16 Sep 2012 11:41:24 -0600 Message-ID: <1347817284.1114.2.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: Alexey Dokuchaev , src-committers@freebsd.org, svn-src-all@freebsd.org, David Chisnall , Andrew Turner , Bruce Evans , svn-src-head@freebsd.org Subject: Re: svn commit: r240549 - head/sys/arm/tegra X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Sep 2012 17:42:15 -0000 On Sun, 2012-09-16 at 18:30 +0100, Chris Rees wrote: > On 16 Sep 2012 16:19, "David Chisnall" wrote: > > > > On 16 Sep 2012, at 10:37, Chris Rees wrote: > > > > > Actually: > > > > > > for (;;) > > > ; > > > > This form will generate a compiler warning, because it looks like a > missing loop body. You can silence the warning by this form: > > > > for (;;) {} > > > > This makes it clear that you have an explicit body containing no > statements. > > Please fix the style man page then, and make sure bde approves! One of the examples allows for (;;) stmt; Using "continue;" as the statement is consistant with that. -- Ian From owner-svn-src-all@FreeBSD.ORG Sun Sep 16 17:46:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3C923106566B; Sun, 16 Sep 2012 17:46:04 +0000 (UTC) (envelope-from utisoft@gmail.com) Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id B68EA8FC12; Sun, 16 Sep 2012 17:46:02 +0000 (UTC) Received: by bkcje9 with SMTP id je9so1952572bkc.13 for ; Sun, 16 Sep 2012 10:46:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=foLDBXJCXa0lDansQ7xq14N3C9dLa0UmahRpiY7SgIA=; b=eC7C/9fc8LfmV8Lua4mqwUNfaZSf/IdJaDA27TflC8Rd3K9vzlEz/9MndCNnJtwJSC JeZkkCmSaz3m9++d/duVS2JSbTMIUyvaQdjIc2d5CI5zig8JETSOi01VIJwNmo6AvLkL jPMSwo/WJRRsyD10Pd/IzfSoZQCIeTtAjh9JJYLULn+yQEwvDK9TIhXLVUjwERKTteWp r9vh4IjCVMoimENBF2U5iuyOSiKXldp2Pe/pIvWx7qpc0A3s3ukhbscao673EMyYUjuW 98PE4TvQWDSuCSYvrRYzWHTME6X2i6y91goCQMn+awIeFjwcQmTHl+3GApR3D1N5nXip RW+w== Received: by 10.204.145.82 with SMTP id c18mr3508156bkv.133.1347817561299; Sun, 16 Sep 2012 10:46:01 -0700 (PDT) MIME-Version: 1.0 Received: by 10.204.10.141 with HTTP; Sun, 16 Sep 2012 10:45:30 -0700 (PDT) In-Reply-To: <1347817284.1114.2.camel@revolution.hippie.lan> References: <201209160755.q8G7tnMH036332@svn.freebsd.org> <20120916092818.GA81952@FreeBSD.org> <38FB39C4-7626-4D54-8197-E302BB9452D2@FreeBSD.org> <1347817284.1114.2.camel@revolution.hippie.lan> From: Chris Rees Date: Sun, 16 Sep 2012 18:45:30 +0100 Message-ID: To: Ian Lepore Content-Type: text/plain; charset=ISO-8859-1 Cc: Alexey Dokuchaev , src-committers@freebsd.org, svn-src-all@freebsd.org, David Chisnall , Andrew Turner , Bruce Evans , svn-src-head@freebsd.org Subject: Re: svn commit: r240549 - head/sys/arm/tegra X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Sep 2012 17:46:04 -0000 On 16 September 2012 18:41, Ian Lepore wrote: > On Sun, 2012-09-16 at 18:30 +0100, Chris Rees wrote: >> On 16 Sep 2012 16:19, "David Chisnall" wrote: >> > >> > On 16 Sep 2012, at 10:37, Chris Rees wrote: >> > >> > > Actually: >> > > >> > > for (;;) >> > > ; >> > >> > This form will generate a compiler warning, because it looks like a >> missing loop body. You can silence the warning by this form: >> > >> > for (;;) {} >> > >> > This makes it clear that you have an explicit body containing no >> statements. >> >> Please fix the style man page then, and make sure bde approves! > > One of the examples allows > > for (;;) > stmt; > > Using "continue;" as the statement is consistant with that. Ok, so with approval from a docs/src guy I'd like to commit [1] to update the style page to use continue; instead of a lone ; Anyone like to approve/commit? Chris [1] http://www.bayofrum.net/~crees/patches/style-empty-loop.diff From owner-svn-src-all@FreeBSD.ORG Sun Sep 16 18:00:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 97AEB106566C; Sun, 16 Sep 2012 18:00:49 +0000 (UTC) Date: Sun, 16 Sep 2012 18:00:49 +0000 From: Alexey Dokuchaev To: Chris Rees Message-ID: <20120916180049.GA62999@FreeBSD.org> References: <201209160755.q8G7tnMH036332@svn.freebsd.org> <20120916092818.GA81952@FreeBSD.org> <38FB39C4-7626-4D54-8197-E302BB9452D2@FreeBSD.org> <1347817284.1114.2.camel@revolution.hippie.lan> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.1i Cc: Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, David Chisnall , Andrew Turner , Bruce Evans , svn-src-head@freebsd.org Subject: Re: svn commit: r240549 - head/sys/arm/tegra X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Sep 2012 18:00:49 -0000 On Sun, Sep 16, 2012 at 06:45:30PM +0100, Chris Rees wrote: > On 16 September 2012 18:41, Ian Lepore wrote: > > One of the examples allows > > > > for (;;) > > stmt; > > > > Using "continue;" as the statement is consistant with that. > > Ok, so with approval from a docs/src guy I'd like to commit [1] to > update the style page to use continue; instead of a lone ; > > Anyone like to approve/commit? I personally like you patch, but I'd really want to get bde@'s blessing. (Maybe that "nothing" in comment should be replaced with "do nothing", hmm... Bruce, where are you?) ./danfe > [1] http://www.bayofrum.net/~crees/patches/style-empty-loop.diff From owner-svn-src-all@FreeBSD.ORG Sun Sep 16 18:17:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E4C0A106566B; Sun, 16 Sep 2012 18:17:39 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CF15F8FC1F; Sun, 16 Sep 2012 18:17:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8GIHduo049252; Sun, 16 Sep 2012 18:17:39 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8GIHdAS049249; Sun, 16 Sep 2012 18:17:39 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201209161817.q8GIHdAS049249@svn.freebsd.org> From: Gavin Atkinson Date: Sun, 16 Sep 2012 18:17:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240567 - in stable/9/sys/dev/usb: . serial X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Sep 2012 18:17:40 -0000 Author: gavin Date: Sun Sep 16 18:17:39 2012 New Revision: 240567 URL: http://svn.freebsd.org/changeset/base/240567 Log: Merge r240118 from head: Support another uchcom(4) device. Modified: stable/9/sys/dev/usb/serial/uchcom.c stable/9/sys/dev/usb/usbdevs Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/serial/uchcom.c ============================================================================== --- stable/9/sys/dev/usb/serial/uchcom.c Sun Sep 16 16:58:49 2012 (r240566) +++ stable/9/sys/dev/usb/serial/uchcom.c Sun Sep 16 18:17:39 2012 (r240567) @@ -207,6 +207,7 @@ static const struct uchcom_divider_recor static const STRUCT_USB_HOST_ID uchcom_devs[] = { {USB_VPI(USB_VENDOR_WCH, USB_PRODUCT_WCH_CH341SER, 0)}, {USB_VPI(USB_VENDOR_WCH2, USB_PRODUCT_WCH2_CH341SER, 0)}, + {USB_VPI(USB_VENDOR_WCH2, USB_PRODUCT_WCH2_CH341SER_2, 0)}, }; /* protypes */ Modified: stable/9/sys/dev/usb/usbdevs ============================================================================== --- stable/9/sys/dev/usb/usbdevs Sun Sep 16 16:58:49 2012 (r240566) +++ stable/9/sys/dev/usb/usbdevs Sun Sep 16 18:17:39 2012 (r240567) @@ -3456,6 +3456,7 @@ product WAVESENSE JAZZ 0xaaaa Jazz bloo /* WCH products */ product WCH CH341SER 0x5523 CH341/CH340 USB-Serial Bridge +product WCH2 CH341SER_2 0x5523 CH341/CH340 USB-Serial Bridge product WCH2 CH341SER 0x7523 CH341/CH340 USB-Serial Bridge /* Western Digital products */ From owner-svn-src-all@FreeBSD.ORG Sun Sep 16 18:25:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A07711065670; Sun, 16 Sep 2012 18:25:08 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8AF598FC12; Sun, 16 Sep 2012 18:25:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8GIP8r8050631; Sun, 16 Sep 2012 18:25:08 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8GIP8TN050629; Sun, 16 Sep 2012 18:25:08 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201209161825.q8GIP8TN050629@svn.freebsd.org> From: Gavin Atkinson Date: Sun, 16 Sep 2012 18:25:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240568 - stable/9/usr.sbin/pciconf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Sep 2012 18:25:08 -0000 Author: gavin Date: Sun Sep 16 18:25:08 2012 New Revision: 240568 URL: http://svn.freebsd.org/changeset/base/240568 Log: Merge r240146 from head: - If the PCIe "SLOT" flag is set, include this in the capability output - Fix printing of PCIe interrupt number, the shift was incorrect. Modified: stable/9/usr.sbin/pciconf/cap.c Directory Properties: stable/9/usr.sbin/pciconf/ (props changed) Modified: stable/9/usr.sbin/pciconf/cap.c ============================================================================== --- stable/9/usr.sbin/pciconf/cap.c Sun Sep 16 18:17:39 2012 (r240567) +++ stable/9/usr.sbin/pciconf/cap.c Sun Sep 16 18:25:08 2012 (r240568) @@ -403,8 +403,10 @@ cap_express(int fd, struct pci_conf *p, printf("type %d", (flags & PCIM_EXP_FLAGS_TYPE) >> 4); break; } + if (flags & PCIM_EXP_FLAGS_SLOT) + printf(" slot"); if (flags & PCIM_EXP_FLAGS_IRQ) - printf(" IRQ %d", (flags & PCIM_EXP_FLAGS_IRQ) >> 8); + printf(" IRQ %d", (flags & PCIM_EXP_FLAGS_IRQ) >> 9); val = read_config(fd, &p->pc_sel, ptr + PCIR_EXPRESS_DEVICE_CAP, 4); flags = read_config(fd, &p->pc_sel, ptr + PCIR_EXPRESS_DEVICE_CTL, 2); printf(" max data %d(%d)", From owner-svn-src-all@FreeBSD.ORG Sun Sep 16 18:26:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B2C8106566B; Sun, 16 Sep 2012 18:26:33 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 54ED08FC0A; Sun, 16 Sep 2012 18:26:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8GIQXWe050949; Sun, 16 Sep 2012 18:26:33 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8GIQXNT050947; Sun, 16 Sep 2012 18:26:33 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201209161826.q8GIQXNT050947@svn.freebsd.org> From: Gavin Atkinson Date: Sun, 16 Sep 2012 18:26: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: r240569 - stable/8/usr.sbin/pciconf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Sep 2012 18:26:33 -0000 Author: gavin Date: Sun Sep 16 18:26:32 2012 New Revision: 240569 URL: http://svn.freebsd.org/changeset/base/240569 Log: Merge r240146 from head: - If the PCIe "SLOT" flag is set, include this in the capability output - Fix printing of PCIe interrupt number, the shift was incorrect. Modified: stable/8/usr.sbin/pciconf/cap.c Directory Properties: stable/8/usr.sbin/pciconf/ (props changed) Modified: stable/8/usr.sbin/pciconf/cap.c ============================================================================== --- stable/8/usr.sbin/pciconf/cap.c Sun Sep 16 18:25:08 2012 (r240568) +++ stable/8/usr.sbin/pciconf/cap.c Sun Sep 16 18:26:32 2012 (r240569) @@ -403,8 +403,10 @@ cap_express(int fd, struct pci_conf *p, printf("type %d", (flags & PCIM_EXP_FLAGS_TYPE) >> 4); break; } + if (flags & PCIM_EXP_FLAGS_SLOT) + printf(" slot"); if (flags & PCIM_EXP_FLAGS_IRQ) - printf(" IRQ %d", (flags & PCIM_EXP_FLAGS_IRQ) >> 8); + printf(" IRQ %d", (flags & PCIM_EXP_FLAGS_IRQ) >> 9); val = read_config(fd, &p->pc_sel, ptr + PCIR_EXPRESS_DEVICE_CAP, 4); flags = read_config(fd, &p->pc_sel, ptr + PCIR_EXPRESS_DEVICE_CTL, 2); printf(" max data %d(%d)", From owner-svn-src-all@FreeBSD.ORG Sun Sep 16 18:38:05 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 826341065672 for ; Sun, 16 Sep 2012 18:38:05 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-pb0-f54.google.com (mail-pb0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id 175248FC14 for ; Sun, 16 Sep 2012 18:38:04 +0000 (UTC) Received: by pbbrp2 with SMTP id rp2so8676949pbb.13 for ; Sun, 16 Sep 2012 11:38:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=LmiwIronrD7Z01DBz6AmMXeW2eEJRla6L73fvD9KASc=; b=YozUTjtUIGX03lxR3sDwo2yWNrSSUrUOi1TEuTc3i1SeSTvFDmCraXagqvkEjCpYL5 xLpHYz4UHW/nFfWfexeYwvCGrDtoA2P8HofUgFSbzVksc/qwCxoRE3fGsXdd66+0MUQP x0xggjJPgCN23SoLp/p2CmjYxB4DT2bTH3p74= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=LmiwIronrD7Z01DBz6AmMXeW2eEJRla6L73fvD9KASc=; b=mPZ2DwNuKNMf3HJgWhlMoNt9UAtYnqBPNfTxqj0Rgyne/HP1026JSRVOn36B1Z1rPv yp+zYe4hboQFgjn2M+paFw8cW7tP9Xd6KpD23zymOiOe7qwWh79CZwco6iz6Nc+i3ZOB jlauPYmsLl3osiCzURenGSU/K5doIpvmKVx12Hf7+/rCuo8OeHX0IE+uMubetzVE8tDa FHiklBfT3Cg1AVB9NcYH6J3Oj2bhiot2v/z66TdQenVS1SARIAcANQSMKNgxLBfUtiac E9PNqyxYBwfHFR7tg3VPVrl1MF5OI318RrPeY+gHQRJPsmddDYRa4LU/chU79JU46/7z wH2Q== Received: by 10.66.73.100 with SMTP id k4mr15547593pav.49.1347820681827; Sun, 16 Sep 2012 11:38:01 -0700 (PDT) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.66.87.41 with HTTP; Sun, 16 Sep 2012 11:37:31 -0700 (PDT) In-Reply-To: References: <201209160755.q8G7tnMH036332@svn.freebsd.org> <20120916092818.GA81952@FreeBSD.org> <38FB39C4-7626-4D54-8197-E302BB9452D2@FreeBSD.org> <1347817284.1114.2.camel@revolution.hippie.lan> From: Eitan Adler Date: Sun, 16 Sep 2012 14:37:31 -0400 X-Google-Sender-Auth: lwVCgZQMLzZVERymXgTVArVn_vM Message-ID: To: Chris Rees Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQm2UOBYc+kNc1K/AFE7bLwegNDp5TZ8NAP6Y51kGEPca9cC4lC2EyxM2b/ptBNhje+ewD50 Cc: Ian Lepore , Alexey Dokuchaev , src-committers@freebsd.org, svn-src-all@freebsd.org, David Chisnall , Andrew Turner , Bruce Evans , svn-src-head@freebsd.org Subject: Re: svn commit: r240549 - head/sys/arm/tegra X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Sep 2012 18:38:05 -0000 On 16 September 2012 13:45, Chris Rees wrote: > On 16 September 2012 18:41, Ian Lepore wrote: >> On Sun, 2012-09-16 at 18:30 +0100, Chris Rees wrote: >>> On 16 Sep 2012 16:19, "David Chisnall" wrote: >>> > >>> > On 16 Sep 2012, at 10:37, Chris Rees wrote: >>> > >>> > > Actually: >>> > > >>> > > for (;;) >>> > > ; >>> > >>> > This form will generate a compiler warning, because it looks like a >>> missing loop body. You can silence the warning by this form: >>> > >>> > for (;;) {} >>> > >>> > This makes it clear that you have an explicit body containing no >>> statements. >>> >>> Please fix the style man page then, and make sure bde approves! >> >> One of the examples allows >> >> for (;;) >> stmt; >> >> Using "continue;" as the statement is consistant with that. > > Ok, so with approval from a docs/src guy I'd like to commit [1] to > update the style page to use continue; instead of a lone ; > > Anyone like to approve/commit? +1 to your patch, though I prefer "do nothing" to "nothing." > > Chris > > [1] http://www.bayofrum.net/~crees/patches/style-empty-loop.diff > -- Eitan Adler Source & Ports committer X11, Bugbusting teams From owner-svn-src-all@FreeBSD.ORG Sun Sep 16 18:57:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C077D1065670; Sun, 16 Sep 2012 18:57:32 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AB3D48FC1C; Sun, 16 Sep 2012 18:57:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8GIvWel056637; Sun, 16 Sep 2012 18:57:32 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8GIvWRU056634; Sun, 16 Sep 2012 18:57:32 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201209161857.q8GIvWRU056634@svn.freebsd.org> From: Gavin Atkinson Date: Sun, 16 Sep 2012 18:57: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: r240570 - in stable/8/sys/dev/usb: . serial X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Sep 2012 18:57:32 -0000 Author: gavin Date: Sun Sep 16 18:57:32 2012 New Revision: 240570 URL: http://svn.freebsd.org/changeset/base/240570 Log: Merge r240118 from head: Support another uchcom(4) device. Modified: stable/8/sys/dev/usb/serial/uchcom.c stable/8/sys/dev/usb/usbdevs Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/usb/ (props changed) Modified: stable/8/sys/dev/usb/serial/uchcom.c ============================================================================== --- stable/8/sys/dev/usb/serial/uchcom.c Sun Sep 16 18:26:32 2012 (r240569) +++ stable/8/sys/dev/usb/serial/uchcom.c Sun Sep 16 18:57:32 2012 (r240570) @@ -207,6 +207,7 @@ static const struct uchcom_divider_recor static const STRUCT_USB_HOST_ID uchcom_devs[] = { {USB_VPI(USB_VENDOR_WCH, USB_PRODUCT_WCH_CH341SER, 0)}, {USB_VPI(USB_VENDOR_WCH2, USB_PRODUCT_WCH2_CH341SER, 0)}, + {USB_VPI(USB_VENDOR_WCH2, USB_PRODUCT_WCH2_CH341SER_2, 0)}, }; /* protypes */ Modified: stable/8/sys/dev/usb/usbdevs ============================================================================== --- stable/8/sys/dev/usb/usbdevs Sun Sep 16 18:26:32 2012 (r240569) +++ stable/8/sys/dev/usb/usbdevs Sun Sep 16 18:57:32 2012 (r240570) @@ -3443,6 +3443,7 @@ product WAVESENSE JAZZ 0xaaaa Jazz bloo /* WCH products */ product WCH CH341SER 0x5523 CH341/CH340 USB-Serial Bridge +product WCH2 CH341SER_2 0x5523 CH341/CH340 USB-Serial Bridge product WCH2 CH341SER 0x7523 CH341/CH340 USB-Serial Bridge /* Western Digital products */ From owner-svn-src-all@FreeBSD.ORG Sun Sep 16 18:57:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CFCFD106579D; Sun, 16 Sep 2012 18:57:42 +0000 (UTC) (envelope-from erik@cederstrand.dk) Received: from csmtp3.one.com (csmtp3.one.com [91.198.169.23]) by mx1.freebsd.org (Postfix) with ESMTP id 0F8878FC19; Sun, 16 Sep 2012 18:57:42 +0000 (UTC) Received: from [192.168.1.27] (unknown [176.222.238.90]) by csmtp3.one.com (Postfix) with ESMTPA id 4182C240B1C3; Sun, 16 Sep 2012 18:57:35 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.0 \(1486\)) From: Erik Cederstrand In-Reply-To: Date: Sun, 16 Sep 2012 20:57:34 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <950ECA11-BDDF-4805-AB9F-07F233A8429E@cederstrand.dk> References: <201209142347.q8ENlN7N034951@svn.freebsd.org> <5054EBCB.6070105@coosemans.org> <5054F116.8090503@cran.org.uk> <5055E121.2030208@coosemans.org> To: Eitan Adler X-Mailer: Apple Mail (2.1486) Cc: Bruce Cran , svn-src-head@freebsd.org, svn-src-all@freebsd.org, Tijl Coosemans , src-committers@freebsd.org Subject: Re: svn commit: r240527 - head/bin/df X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Sep 2012 18:57:43 -0000 Den 16/09/2012 kl. 18.05 skrev Eitan Adler : > On 16 September 2012 10:24, Tijl Coosemans wrote: >> On 16-09-2012 01:27, Eitan Adler wrote: >>> On 15 September 2012 17:20, Bruce Cran wrote: >>>> On 15/09/2012 21:57, Tijl Coosemans wrote: >>>>>=20 >>>>> Freeing memory right before exiting is a waste of time. The tool = shouldn't >>>>> complain about it. >>>=20 >>> Perhaps, but tools do. This has already been brought up on cfe-dev. >>>=20 >>>> "/Stop wasting time and just exit already/." - >>>> = http://blogs.msdn.com/b/oldnewthing/archive/2012/01/05/10253268.aspx >>>=20 >>> I read this blog post when it came out. :) >>=20 >> In this case the free is actually wrong, because the pointer can = point >> to memory allocated by getmntinfo(3) and that manpage says an = application >> cannot free it. >=20 > Ah, I missed that. I wish this point was brought up earlier. I'll > revert the commit I was the one who filed the PR = (http://www.freebsd.org/cgi/query-pr.cgi?pr=3D171634). I'm embarrassed = to have caused a wrong commit. The big picture is I'm looking through the Clang Analyzer scans at = http://scan.freebsd.your.org/freebsd-head trying to find false positives = to report back to LLVM. Their PR originated in this warning: = http://scan.freebsd.your.org/freebsd-head/bin.df/2012-09-12-amd64/report-W= wB2qk.html#EndPath The scan has 326 warnings about possible memory leaks = in world, so I'd really like to do something here, be it either via bug = report with LLVM or FreeBSD or to annotate the code to say it's okay to = break the rules. There response from LLVM (disregarding that mntbuf can't be freed) is = either that: 1) if main() is redefined as a macro, it's still a leak, = and 2) they can skip the warning only if it's feasible to reason that = prtstat() doesn't allocate memory. I noticed that the sentence "The memory allocated by getmntinfo() cannot = be free(3)'d by the application." in the getmntinfo(3) manage is in the = bugs section. Does this mean it's something that should be fixed in = FreeBSD eventually? Erik= From owner-svn-src-all@FreeBSD.ORG Sun Sep 16 18:58:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BDCEA10656D4; Sun, 16 Sep 2012 18:58:48 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) by mx1.freebsd.org (Postfix) with ESMTP id 8665A8FC12; Sun, 16 Sep 2012 18:58:48 +0000 (UTC) Received: from JRE-MBP-2.local (c-50-143-149-8.hsd1.ca.comcast.net [50.143.149.8]) (authenticated bits=0) by vps1.elischer.org (8.14.5/8.14.5) with ESMTP id q8GIwfoe081548 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sun, 16 Sep 2012 11:58:42 -0700 (PDT) (envelope-from julian@freebsd.org) Message-ID: <50562161.2000103@freebsd.org> Date: Sun, 16 Sep 2012 11:58:41 -0700 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:15.0) Gecko/20120907 Thunderbird/15.0.1 MIME-Version: 1.0 To: Chris Rees References: <201209160755.q8G7tnMH036332@svn.freebsd.org> <20120916092818.GA81952@FreeBSD.org> <20120916095355.GA83285@FreeBSD.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: svn-src-head@freebsd.org, Andrew Turner , Alexey Dokuchaev , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r240549 - head/sys/arm/tegra X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Sep 2012 18:58:49 -0000 On 9/16/12 3:07 AM, Chris Rees wrote: > > > On 16 Sep 2012 10:53, "Alexey Dokuchaev" > wrote: > > > > On Sun, Sep 16, 2012 at 10:37:56AM +0100, Chris Rees wrote: > > > On 16 September 2012 10:28, Alexey Dokuchaev > wrote: > > > > I thought preferred and more style(9) compliant way to code [empty > > > > endless loop] is: > > > > > > > > for (;;) > > > > continue; > > > > > > Actually: > > > > > > for (;;) > > > ; > > > > Explicit "continue" is supposed to tell reviewer that original > author did > > not make a typo, but indeed knew what he was doing. Lonely > semicolon is too > > ambiguous in this case. > > > > ./danfe > > > for (;;) {} > That's not what man style says... > > Chris > From owner-svn-src-all@FreeBSD.ORG Sun Sep 16 19:42:28 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 876D01065712; Sun, 16 Sep 2012 19:42:28 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 72B5E8FC08; Sun, 16 Sep 2012 19:42:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8GJgSjW064951; Sun, 16 Sep 2012 19:42:28 GMT (envelope-from jmg@svn.freebsd.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8GJgSxK064948; Sun, 16 Sep 2012 19:42:28 GMT (envelope-from jmg@svn.freebsd.org) Message-Id: <201209161942.q8GJgSxK064948@svn.freebsd.org> From: John-Mark Gurney Date: Sun, 16 Sep 2012 19:42:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240571 - head/sys/arm/ti/cpsw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Sep 2012 19:42:28 -0000 Author: jmg Date: Sun Sep 16 19:42:27 2012 New Revision: 240571 URL: http://svn.freebsd.org/changeset/base/240571 Log: remove some unnecessary debugging statements, dead code and incorrect comment... Reviewed by: gnn, imp Modified: head/sys/arm/ti/cpsw/if_cpsw.c Modified: head/sys/arm/ti/cpsw/if_cpsw.c ============================================================================== --- head/sys/arm/ti/cpsw/if_cpsw.c Sun Sep 16 18:57:32 2012 (r240570) +++ head/sys/arm/ti/cpsw/if_cpsw.c Sun Sep 16 19:42:27 2012 (r240571) @@ -713,8 +713,6 @@ cpsw_ioctl(struct ifnet *ifp, u_long com sc->cpsw_if_flags = ifp->if_flags; CPSW_GLOBAL_UNLOCK(sc); break; - printf("%s: SIOCSIFFLAGS\n",__func__); - break; case SIOCADDMULTI: printf("%s: SIOCADDMULTI\n",__func__); break; @@ -724,12 +722,10 @@ cpsw_ioctl(struct ifnet *ifp, u_long com case SIOCSIFCAP: printf("%s: SIOCSIFCAP\n",__func__); break; - case SIOCGIFMEDIA: /* fall through */ - printf("%s: SIOCGIFMEDIA\n",__func__); + case SIOCGIFMEDIA: error = ifmedia_ioctl(ifp, ifr, &sc->mii->mii_media, command); break; case SIOCSIFMEDIA: - printf("%s: SIOCSIFMEDIA\n",__func__); error = ifmedia_ioctl(ifp, ifr, &sc->mii->mii_media, command); break; default: From owner-svn-src-all@FreeBSD.ORG Sun Sep 16 19:48:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 94082106566C; Sun, 16 Sep 2012 19:48:49 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7D2FC8FC18; Sun, 16 Sep 2012 19:48:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8GJmnEJ066092; Sun, 16 Sep 2012 19:48:49 GMT (envelope-from jmg@svn.freebsd.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8GJmnon066073; Sun, 16 Sep 2012 19:48:49 GMT (envelope-from jmg@svn.freebsd.org) Message-Id: <201209161948.q8GJmnon066073@svn.freebsd.org> From: John-Mark Gurney Date: Sun, 16 Sep 2012 19:48:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240572 - head/sys/arm/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Sep 2012 19:48:49 -0000 Author: jmg Date: Sun Sep 16 19:48:48 2012 New Revision: 240572 URL: http://svn.freebsd.org/changeset/base/240572 Log: fix the kernel files to match our standard "option" format such that when commenting/uncommentting lines, horizontal spacing is maintained... Also fix some minor comment formatting to line things up, etc... Reviewed by: gnn, imp MFC after: 1 week Modified: head/sys/arm/conf/ARMADAXP head/sys/arm/conf/BEAGLEBONE head/sys/arm/conf/CNS11XXNAS head/sys/arm/conf/DOCKSTAR head/sys/arm/conf/EA3250 head/sys/arm/conf/GUMSTIX-QEMU head/sys/arm/conf/HL201 head/sys/arm/conf/KB920X head/sys/arm/conf/LN2410SBC head/sys/arm/conf/PANDABOARD head/sys/arm/conf/QILA9G20 head/sys/arm/conf/RPI-B head/sys/arm/conf/SAM9G20EK head/sys/arm/conf/SAM9X25EK head/sys/arm/conf/SHEEVAPLUG head/sys/arm/conf/SN9G45 head/sys/arm/conf/TS7800 Modified: head/sys/arm/conf/ARMADAXP ============================================================================== --- head/sys/arm/conf/ARMADAXP Sun Sep 16 19:42:27 2012 (r240571) +++ head/sys/arm/conf/ARMADAXP Sun Sep 16 19:48:48 2012 (r240572) @@ -92,8 +92,8 @@ device mge # Marvell Gigabit Ethernet device mii device e1000phy device bpf -options HZ=1000 -options DEVICE_POLLING +options HZ=1000 +options DEVICE_POLLING device vlan #PCI/PCIE Modified: head/sys/arm/conf/BEAGLEBONE ============================================================================== --- head/sys/arm/conf/BEAGLEBONE Sun Sep 16 19:42:27 2012 (r240571) +++ head/sys/arm/conf/BEAGLEBONE Sun Sep 16 19:48:48 2012 (r240572) @@ -25,52 +25,52 @@ include "../ti/am335x/std.beaglebone" makeoptions MODULES_OVERRIDE="" makeoptions WITHOUT_MODULES="ahc" -options HZ=100 -options SCHED_4BSD #4BSD scheduler -options INET #InterNETworking -options INET6 #IPv6 communications protocols -options FFS #Berkeley Fast Filesystem -options SOFTUPDATES #Enable FFS soft updates support -options UFS_ACL #Support for access control lists -options UFS_DIRHASH #Improve performance on big directories -options MSDOSFS #MSDOS Filesystem -options CD9660 #ISO 9660 Filesystem -options PROCFS #Process filesystem (requires PSEUDOFS) -options PSEUDOFS #Pseudo-filesystem framework -options COMPAT_43 #Compatible with BSD 4.3 [KEEP THIS!] -options SCSI_DELAY=5000 #Delay (in ms) before probing SCSI -options KTRACE #ktrace(1) support -options SYSVSHM #SYSV-style shared memory -options SYSVMSG #SYSV-style message queues -options SYSVSEM #SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions -options KBD_INSTALL_CDEV # install a CDEV entry in /dev -options PREEMPTION +options HZ=100 +options SCHED_4BSD #4BSD scheduler +options INET #InterNETworking +options INET6 #IPv6 communications protocols +options FFS #Berkeley Fast Filesystem +options SOFTUPDATES #Enable FFS soft updates support +options UFS_ACL #Support for access control lists +options UFS_DIRHASH #Improve performance on big directories +options MSDOSFS #MSDOS Filesystem +options CD9660 #ISO 9660 Filesystem +options PROCFS #Process filesystem (requires PSEUDOFS) +options PSEUDOFS #Pseudo-filesystem framework +options COMPAT_43 #Compatible with BSD 4.3 [KEEP THIS!] +options SCSI_DELAY=5000 #Delay (in ms) before probing SCSI +options KTRACE #ktrace(1) support +options SYSVSHM #SYSV-style shared memory +options SYSVMSG #SYSV-style message queues +options SYSVSEM #SYSV-style semaphores +options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions +options KBD_INSTALL_CDEV # install a CDEV entry in /dev +options PREEMPTION # Debugging makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols -options BREAK_TO_DEBUGGER -#options VERBOSE_SYSINIT #Enable verbose sysinit messages -options KDB -options DDB #Enable the kernel debugger -options INVARIANTS #Enable calls of extra sanity checking -options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS -options WITNESS #Enable checks to detect deadlocks and cycles -options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed -#options DIAGNOSTIC +options BREAK_TO_DEBUGGER +#options VERBOSE_SYSINIT #Enable verbose sysinit messages +options KDB +options DDB #Enable the kernel debugger +options INVARIANTS #Enable calls of extra sanity checking +options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS +options WITNESS #Enable checks to detect deadlocks and cycles +options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed +#options DIAGNOSTIC # NFS support -#options NFSCL -#options NFSSERVER #Network Filesystem Server -#options NFSCLIENT #Network Filesystem Client +#options NFSCL +#options NFSSERVER #Network Filesystem Server +#options NFSCLIENT #Network Filesystem Client # Uncomment this for NFS root -#options NFS_ROOT #NFS usable as /, requires NFSCLIENT -#options BOOTP_NFSROOT -#options BOOTP_COMPAT -#options BOOTP -#options BOOTP_NFSV3 -#options BOOTP_WIRED_TO=cpsw0 +#options NFS_ROOT #NFS usable as /, requires NFSCLIENT +#options BOOTP_NFSROOT +#options BOOTP_COMPAT +#options BOOTP +#options BOOTP_NFSV3 +#options BOOTP_WIRED_TO=cpsw0 # MMC/SD/SDIO card slot support @@ -78,7 +78,7 @@ device mmc # mmc/sd bus device mmcsd # mmc/sd flash cards # Boot device is 2nd slice on MMC/SD card -options ROOTDEVNAME=\"ufs:mmcsd0s2\" +options ROOTDEVNAME=\"ufs:mmcsd0s2\" # Console and misc device uart @@ -99,9 +99,9 @@ device gpio # USB support device usb -options USB_DEBUG -#options USB_REQ_DEBUG -#options USB_VERBOSE +options USB_DEBUG +#options USB_REQ_DEBUG +#options USB_VERBOSE device musb device umass device scbus # SCSI bus (required for SCSI) Modified: head/sys/arm/conf/CNS11XXNAS ============================================================================== --- head/sys/arm/conf/CNS11XXNAS Sun Sep 16 19:42:27 2012 (r240571) +++ head/sys/arm/conf/CNS11XXNAS Sun Sep 16 19:48:48 2012 (r240572) @@ -47,9 +47,9 @@ options DDB #Enable the kernel debugg #options DIAGNOSTIC -#options COMPAT_FREEBSD5 -#options COMPAT_FREEBSD6 -#options COMPAT_FREEBSD7 +#options COMPAT_FREEBSD5 +#options COMPAT_FREEBSD6 +#options COMPAT_FREEBSD7 options SCHED_ULE #ULE scheduler @@ -121,4 +121,4 @@ device geom_label device geom_journal device geom_part_bsd -options ROOTDEVNAME=\"ufs:da0s1a\" +options ROOTDEVNAME=\"ufs:da0s1a\" Modified: head/sys/arm/conf/DOCKSTAR ============================================================================== --- head/sys/arm/conf/DOCKSTAR Sun Sep 16 19:42:27 2012 (r240571) +++ head/sys/arm/conf/DOCKSTAR Sun Sep 16 19:48:48 2012 (r240572) @@ -56,8 +56,8 @@ device ether device mge # Marvell Gigabit Ethernet controller device mii device bpf -options HZ=1000 -options DEVICE_POLLING +options HZ=1000 +options DEVICE_POLLING device vlan # USB @@ -71,5 +71,5 @@ device da # Flattened Device Tree options FDT -options FDT_DTB_STATIC +options FDT_DTB_STATIC makeoptions FDT_DTS_FILE=dockstar.dts Modified: head/sys/arm/conf/EA3250 ============================================================================== --- head/sys/arm/conf/EA3250 Sun Sep 16 19:42:27 2012 (r240571) +++ head/sys/arm/conf/EA3250 Sun Sep 16 19:48:48 2012 (r240572) @@ -65,7 +65,7 @@ device bpf device lpe # USB -options USB_DEBUG +options USB_DEBUG device usb device ohci device umass Modified: head/sys/arm/conf/GUMSTIX-QEMU ============================================================================== --- head/sys/arm/conf/GUMSTIX-QEMU Sun Sep 16 19:42:27 2012 (r240571) +++ head/sys/arm/conf/GUMSTIX-QEMU Sun Sep 16 19:48:48 2012 (r240572) @@ -21,5 +21,5 @@ include GUMSTIX ident GUMSTIX-QEMU -options QEMU_WORKAROUNDS +options QEMU_WORKAROUNDS nooptions ARM_CACHE_LOCK_ENABLE # QEMU does not implement this Modified: head/sys/arm/conf/HL201 ============================================================================== --- head/sys/arm/conf/HL201 Sun Sep 16 19:42:27 2012 (r240571) +++ head/sys/arm/conf/HL201 Sun Sep 16 19:48:48 2012 (r240572) @@ -49,7 +49,7 @@ options BOOTP_NFSV3 #options BOOTP_WIRED_TO=ate0 options BOOTP_COMPAT -options ALT_BREAK_TO_DEBUGGER +options ALT_BREAK_TO_DEBUGGER #options MSDOSFS #MSDOS Filesystem #options CD9660 #ISO 9660 Filesystem @@ -128,5 +128,5 @@ device pass # Passthrough device (dire #device wlan_ccmp # 802.11 CCMP support #device wlan_tkip # 802.11 TKIP support #device wlan_amrr # AMRR transmit rate control algorithm -options ROOTDEVNAME=\"ufs:da0s1a\" +options ROOTDEVNAME=\"ufs:da0s1a\" Modified: head/sys/arm/conf/KB920X ============================================================================== --- head/sys/arm/conf/KB920X Sun Sep 16 19:42:27 2012 (r240571) +++ head/sys/arm/conf/KB920X Sun Sep 16 19:48:48 2012 (r240572) @@ -144,6 +144,6 @@ device usfs # emulate a flash device cdce # emulate an ethernet device usb_template # Control of the gadget -options IEEE80211_SUPPORT_MESH +options IEEE80211_SUPPORT_MESH -options AH_SUPPORT_AR5416 +options AH_SUPPORT_AR5416 Modified: head/sys/arm/conf/LN2410SBC ============================================================================== --- head/sys/arm/conf/LN2410SBC Sun Sep 16 19:42:27 2012 (r240571) +++ head/sys/arm/conf/LN2410SBC Sun Sep 16 19:48:48 2012 (r240572) @@ -40,7 +40,7 @@ options FFS #Berkeley Fast Filesystem #options UFS_DIRHASH #Improve performance on big directories #options MD_ROOT #MD is a potential root device #options MD_ROOT_SIZE=4096 # 4MB ram disk -options ROOTDEVNAME=\"ufs:da0s1\" +options ROOTDEVNAME=\"ufs:da0s1\" #options BOOTP #options BOOTP_NFSROOT # NFS mount root filesystem using BOOTP info Modified: head/sys/arm/conf/PANDABOARD ============================================================================== --- head/sys/arm/conf/PANDABOARD Sun Sep 16 19:42:27 2012 (r240571) +++ head/sys/arm/conf/PANDABOARD Sun Sep 16 19:48:48 2012 (r240572) @@ -46,15 +46,15 @@ options UFS_ACL #Support for access c options UFS_DIRHASH #Improve performance on big directories options NFSCLIENT #Network Filesystem Client device snp -#options NFSCL +#options NFSCL #options NFSSERVER #Network Filesystem Server options NFS_ROOT #NFS usable as /, requires NFSCLIENT -options BREAK_TO_DEBUGGER -options BOOTP_NFSROOT -options BOOTP_COMPAT -options BOOTP -options BOOTP_NFSV3 -options BOOTP_WIRED_TO=ue0 +options BREAK_TO_DEBUGGER +options BOOTP_NFSROOT +options BOOTP_COMPAT +options BOOTP +options BOOTP_NFSV3 +options BOOTP_WIRED_TO=ue0 options MSDOSFS #MSDOS Filesystem #options CD9660 #ISO 9660 Filesystem #options PROCFS #Process filesystem (requires PSEUDOFS) @@ -93,7 +93,7 @@ device pty device pl310 # PL310 L2 cache controller # Debugging for use in -current -#options VERBOSE_SYSINIT #Enable verbose sysinit messages +#options VERBOSE_SYSINIT #Enable verbose sysinit messages options KDB options DDB #Enable the kernel debugger #options INVARIANTS #Enable calls of extra sanity checking @@ -106,16 +106,16 @@ device md # The following enables MFS as root, this seems similar to an initramfs or initrd # as used in Linux. -# options MD_ROOT -# options MD_ROOT_SIZE=7560 +#options MD_ROOT +#options MD_ROOT_SIZE=7560 device random # Entropy device # USB support device usb options USB_DEBUG -#options USB_REQ_DEBUG -#options USB_VERBOSE +#options USB_REQ_DEBUG +#options USB_VERBOSE device ohci device ehci device umass @@ -125,7 +125,7 @@ device da # Direct Access (disks) # USB Ethernet support, requires miibus device miibus -# device axe # ASIX Electronics USB Ethernet +#device axe # ASIX Electronics USB Ethernet device smsc # SMSC LAN95xx USB Ethernet @@ -140,5 +140,5 @@ options FDT options FDT_DTB_STATIC makeoptions FDT_DTS_FILE=pandaboard.dts -# device vfp # vfp/neon -# options ARM_VFP_SUPPORT # vfp/neon +#device vfp # vfp/neon +#options ARM_VFP_SUPPORT # vfp/neon Modified: head/sys/arm/conf/QILA9G20 ============================================================================== --- head/sys/arm/conf/QILA9G20 Sun Sep 16 19:42:27 2012 (r240571) +++ head/sys/arm/conf/QILA9G20 Sun Sep 16 19:48:48 2012 (r240572) @@ -51,7 +51,7 @@ options NFSCL #New Network Filesystem options ROOTDEVNAME=\"ufs:/dev/mmcsd0s1a\" -options ALT_BREAK_TO_DEBUGGER +options ALT_BREAK_TO_DEBUGGER #options MSDOSFS #MSDOS Filesystem #options CD9660 #ISO 9660 Filesystem Modified: head/sys/arm/conf/RPI-B ============================================================================== --- head/sys/arm/conf/RPI-B Sun Sep 16 19:42:27 2012 (r240571) +++ head/sys/arm/conf/RPI-B Sun Sep 16 19:48:48 2012 (r240572) @@ -24,12 +24,12 @@ cpu CPU_ARM11 files "../broadcom/bcm2835/files.bcm2835" makeoptions MODULES_OVERRIDE="" -options KERNVIRTADDR=0xc0100000 +options KERNVIRTADDR=0xc0100000 makeoptions KERNVIRTADDR=0xc0100000 -options KERNPHYSADDR=0x00100000 +options KERNPHYSADDR=0x00100000 makeoptions KERNPHYSADDR=0x00100000 -options PHYSADDR=0x00000000 -options STARTUP_PAGETABLE_ADDR=0x01000000 +options PHYSADDR=0x00000000 +options STARTUP_PAGETABLE_ADDR=0x01000000 makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols options HZ=100 @@ -42,13 +42,13 @@ options UFS_ACL #Support for access c options UFS_DIRHASH #Improve performance on big directories device snp -# options NFSCL #Network Filesystem Client -# options NFS_ROOT #NFS usable as /, requires NFSCLIENT -# options BOOTP_NFSROOT -# options BOOTP_COMPAT -# options BOOTP -# options BOOTP_NFSV3 -# options BOOTP_WIRED_TO=ue0 +#options NFSCL #Network Filesystem Client +#options NFS_ROOT #NFS usable as /, requires NFSCLIENT +#options BOOTP_NFSROOT +#options BOOTP_COMPAT +#options BOOTP +#options BOOTP_NFSV3 +#options BOOTP_WIRED_TO=ue0 options PSEUDOFS #Pseudo-filesystem framework options COMPAT_43 #Compatible with BSD 4.3 [KEEP THIS!] Modified: head/sys/arm/conf/SAM9G20EK ============================================================================== --- head/sys/arm/conf/SAM9G20EK Sun Sep 16 19:42:27 2012 (r240571) +++ head/sys/arm/conf/SAM9G20EK Sun Sep 16 19:48:48 2012 (r240572) @@ -50,7 +50,7 @@ options NFSCL #New Network Filesystem options ROOTDEVNAME=\"ufs:/dev/mmcsd0s1a\" -options ALT_BREAK_TO_DEBUGGER +options ALT_BREAK_TO_DEBUGGER #options MSDOSFS #MSDOS Filesystem #options CD9660 #ISO 9660 Filesystem Modified: head/sys/arm/conf/SAM9X25EK ============================================================================== --- head/sys/arm/conf/SAM9X25EK Sun Sep 16 19:42:27 2012 (r240571) +++ head/sys/arm/conf/SAM9X25EK Sun Sep 16 19:48:48 2012 (r240572) @@ -51,7 +51,7 @@ options NFSCL #New Network Filesystem options ROOTDEVNAME=\"ufs:/dev/mmcsd0s1a\" -options ALT_BREAK_TO_DEBUGGER +options ALT_BREAK_TO_DEBUGGER #options MSDOSFS #MSDOS Filesystem #options CD9660 #ISO 9660 Filesystem Modified: head/sys/arm/conf/SHEEVAPLUG ============================================================================== --- head/sys/arm/conf/SHEEVAPLUG Sun Sep 16 19:42:27 2012 (r240571) +++ head/sys/arm/conf/SHEEVAPLUG Sun Sep 16 19:48:48 2012 (r240572) @@ -56,8 +56,8 @@ device mge # Marvell Gigabit Ethernet device mii device e1000phy device bpf -options HZ=1000 -options DEVICE_POLLING +options HZ=1000 +options DEVICE_POLLING device vlan device cesa # Marvell security engine @@ -78,5 +78,5 @@ device nand # Flattened Device Tree options FDT -options FDT_DTB_STATIC +options FDT_DTB_STATIC makeoptions FDT_DTS_FILE=sheevaplug.dts Modified: head/sys/arm/conf/SN9G45 ============================================================================== --- head/sys/arm/conf/SN9G45 Sun Sep 16 19:42:27 2012 (r240571) +++ head/sys/arm/conf/SN9G45 Sun Sep 16 19:48:48 2012 (r240572) @@ -50,7 +50,7 @@ options NFSCL #New Network Filesystem options ROOTDEVNAME=\"ufs:/dev/da0s1\" -options ALT_BREAK_TO_DEBUGGER +options ALT_BREAK_TO_DEBUGGER #options MSDOSFS #MSDOS Filesystem #options CD9660 #ISO 9660 Filesystem Modified: head/sys/arm/conf/TS7800 ============================================================================== --- head/sys/arm/conf/TS7800 Sun Sep 16 19:42:27 2012 (r240571) +++ head/sys/arm/conf/TS7800 Sun Sep 16 19:48:48 2012 (r240572) @@ -74,6 +74,6 @@ options ATA_CAM # Flattened Device Tree options FDT -options FDT_DTB_STATIC +options FDT_DTB_STATIC makeoptions FDT_DTS_FILE=ts7800.dts From owner-svn-src-all@FreeBSD.ORG Sun Sep 16 21:17:28 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ACBC8106566B; Sun, 16 Sep 2012 21:17:28 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 98A898FC0C; Sun, 16 Sep 2012 21:17:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8GLHSAn082099; Sun, 16 Sep 2012 21:17:28 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8GLHSQT082096; Sun, 16 Sep 2012 21:17:28 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201209162117.q8GLHSQT082096@svn.freebsd.org> From: Joel Dahl Date: Sun, 16 Sep 2012 21:17:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240573 - head/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Sep 2012 21:17:28 -0000 Author: joel (doc committer) Date: Sun Sep 16 21:17:28 2012 New Revision: 240573 URL: http://svn.freebsd.org/changeset/base/240573 Log: Remove trailing whitespace. Modified: head/share/man/man9/pfil.9 Modified: head/share/man/man9/pfil.9 ============================================================================== --- head/share/man/man9/pfil.9 Sun Sep 16 19:48:48 2012 (r240572) +++ head/share/man/man9/pfil.9 Sun Sep 16 21:17:28 2012 (r240573) @@ -132,7 +132,7 @@ IPv4 and IPv6 packets. Note that packet .Cm converted to host format. Host format has to be preserved in case of header modifications. .It AF_LINK -Link-layer packets. +Link-layer packets. .El .Sh RETURN VALUES If successful, From owner-svn-src-all@FreeBSD.ORG Sun Sep 16 21:22:06 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B4961106564A; Sun, 16 Sep 2012 21:22:06 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail04.syd.optusnet.com.au (mail04.syd.optusnet.com.au [211.29.132.185]) by mx1.freebsd.org (Postfix) with ESMTP id 3BD728FC0A; Sun, 16 Sep 2012 21:22:05 +0000 (UTC) Received: from c122-106-157-84.carlnfd1.nsw.optusnet.com.au (c122-106-157-84.carlnfd1.nsw.optusnet.com.au [122.106.157.84]) by mail04.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q8GLLqsa026855 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 17 Sep 2012 07:21:53 +1000 Date: Mon, 17 Sep 2012 07:21:52 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Chris Rees In-Reply-To: Message-ID: <20120917063509.E3825@besplex.bde.org> References: <201209160755.q8G7tnMH036332@svn.freebsd.org> <20120916092818.GA81952@FreeBSD.org> <38FB39C4-7626-4D54-8197-E302BB9452D2@FreeBSD.org> <1347817284.1114.2.camel@revolution.hippie.lan> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Ian Lepore , Alexey Dokuchaev , src-committers@freebsd.org, svn-src-all@freebsd.org, David Chisnall , Andrew Turner , Bruce Evans , svn-src-head@freebsd.org Subject: Re: svn commit: r240549 - head/sys/arm/tegra X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Sep 2012 21:22:07 -0000 On Sun, 16 Sep 2012, Chris Rees wrote: > On 16 September 2012 18:41, Ian Lepore wrote: >> On Sun, 2012-09-16 at 18:30 +0100, Chris Rees wrote: >>> On 16 Sep 2012 16:19, "David Chisnall" wrote: >>>> >>>> On 16 Sep 2012, at 10:37, Chris Rees wrote: >>>> >>>>> Actually: >>>>> >>>>> for (;;) >>>>> ; >>>> >>>> This form will generate a compiler warning, because it looks like a >>> missing loop body. You can silence the warning by this form: >>>> >>>> for (;;) {} >>>> >>>> This makes it clear that you have an explicit body containing no >>> statements. This is forbidden by style(9) (it has excessive braces). >>> Please fix the style man page then, and make sure bde approves! >> >> One of the examples allows >> >> for (;;) >> stmt; >> >> Using "continue;" as the statement is consistant with that. So is using a null statement. Actually, the informal grammar in the example is buggy. In more formal grammars, the semicolon is part of a statement (unless the statement is compound). So the above should really be: for (;;) statement but that looks strange, and we know what the current version means. > Ok, so with approval from a docs/src guy I'd like to commit [1] to > update the style page to use continue; instead of a lone ; > ... > [1] http://www.bayofrum.net/~crees/patches/style-empty-loop.diff I don't like this. The style is whatever it was, not what you want it to be. However, I couldn't find a single example in /usr/src/*bin or libc that has an empty for loop. Normal code just doesn't do that. It would be better to remove the example of the empty loop in style(9), so that style(9) doesn't require any particular style for rarely-written code. Oops. The loop that you changed is not the above fully empty one, but one with control statements but no body. I couldn't find any like the above, and ones with control statements are too hard to grep for. The one that you changed is basically strlen(), and an example of existing (mal)practice was in the 4.4BSD version of strlen.c: % size_t % strlen(str) % const char *str; % { % const char *s; % % for (s = str; *s; ++s); % return(s - str); % } It doesn't even put the semicolon on a new line. strlen.c is now recomplicated, so it no longer provides a bad example. strlen() is also in K&R, with better style but a while loop: while (s[i] != '\0') i++; and of course the classic obfuscated idiom for strcpy is to do all the work in the control statment. This obfuscation is done fairly well in 4.4BSD again: for (; *to = *from; ++from, ++to); (why not *to++, etc?). I use a single semicolon for fully empty loops, but not put all of the work in the control statement for loops that do something, so that the never have an empty body. Adding 'continue /* nothing */' to the old BSD code wouldn't improve it. Its only good point is that it is concise, and this is defeated by redundant addiitons. Bruce From owner-svn-src-all@FreeBSD.ORG Sun Sep 16 22:45:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 20D4C106564A; Sun, 16 Sep 2012 22:45:01 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 083B98FC08; Sun, 16 Sep 2012 22:45:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8GMj054098524; Sun, 16 Sep 2012 22:45:00 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8GMj0Ig098522; Sun, 16 Sep 2012 22:45:00 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201209162245.q8GMj0Ig098522@svn.freebsd.org> From: Adrian Chadd Date: Sun, 16 Sep 2012 22:45:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240574 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Sep 2012 22:45:01 -0000 Author: adrian Date: Sun Sep 16 22:45:00 2012 New Revision: 240574 URL: http://svn.freebsd.org/changeset/base/240574 Log: Fix a crash bug introduced in the iterate node work recently done. When resuming, the first VAP is checked for max_aid; however if there is no VAP, this results in a NULL pointer dereference and kernel panic. Modified: head/sys/net80211/ieee80211_node.c Modified: head/sys/net80211/ieee80211_node.c ============================================================================== --- head/sys/net80211/ieee80211_node.c Sun Sep 16 21:17:28 2012 (r240573) +++ head/sys/net80211/ieee80211_node.c Sun Sep 16 22:45:00 2012 (r240574) @@ -2245,8 +2245,16 @@ ieee80211_iterate_nodes(struct ieee80211 size_t size; int i; uint16_t max_aid; + struct ieee80211vap *vap; + + /* Overdoing it default */ + max_aid = IEEE80211_AID_MAX; + + /* Handle the case of there being no vaps just yet */ + vap = TAILQ_FIRST(&nt->nt_ic->ic_vaps); + if (vap != NULL) + max_aid = vap->iv_max_aid; - max_aid = TAILQ_FIRST(&nt->nt_ic->ic_vaps)->iv_max_aid; size = max_aid * sizeof(struct ieee80211_node *); ni_arr = (struct ieee80211_node **) malloc(size, M_80211_NODE, M_NOWAIT | M_ZERO); From owner-svn-src-all@FreeBSD.ORG Sun Sep 16 23:25:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 449BA106564A; Sun, 16 Sep 2012 23:25:14 +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 3006F8FC08; Sun, 16 Sep 2012 23:25:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8GNPEi7005514; Sun, 16 Sep 2012 23:25:14 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8GNPDQC005510; Sun, 16 Sep 2012 23:25:13 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201209162325.q8GNPDQC005510@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sun, 16 Sep 2012 23:25:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240575 - head/usr.bin/rctl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Sep 2012 23:25:14 -0000 Author: trasz Date: Sun Sep 16 23:25:13 2012 New Revision: 240575 URL: http://svn.freebsd.org/changeset/base/240575 Log: Remove references to userstat(1) and jailstat(1). Those tools were never merged from the Perforce branch. They might be brought in when %CPU limits go into the tree. PR: docs/171240 MFC after: 2 weeks Modified: head/usr.bin/rctl/rctl.8 Modified: head/usr.bin/rctl/rctl.8 ============================================================================== --- head/usr.bin/rctl/rctl.8 Sun Sep 16 22:45:00 2012 (r240574) +++ head/usr.bin/rctl/rctl.8 Sun Sep 16 23:25:13 2012 (r240575) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 1, 2012 +.Dd September 16, 2012 .Dt RCTL 8 .Os .Sh NAME @@ -184,9 +184,7 @@ Display resource usage information for j .Pp Display all the rules applicable to process with PID 512. .Sh SEE ALSO -.Xr rctl.conf 5 , -.Xr jailstat 8 , -.Xr userstat 8 +.Xr rctl.conf 5 .Sh HISTORY The .Nm From owner-svn-src-all@FreeBSD.ORG Mon Sep 17 00:32:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 29848106564A; Mon, 17 Sep 2012 00:32:36 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 139938FC17; Mon, 17 Sep 2012 00:32:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8H0WZkE014164; Mon, 17 Sep 2012 00:32:35 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8H0WZR4014161; Mon, 17 Sep 2012 00:32:35 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201209170032.q8H0WZR4014161@svn.freebsd.org> From: Eitan Adler Date: Mon, 17 Sep 2012 00:32:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240576 - stable/8/sys/dev/isci/scil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2012 00:32:36 -0000 Author: eadler Date: Mon Sep 17 00:32:35 2012 New Revision: 240576 URL: http://svn.freebsd.org/changeset/base/240576 Log: MFC r240521: s/ is is / is /g s/ a a / a /g Approved by: cperciva (implicit) Modified: stable/8/sys/dev/isci/scil/scic_sds_remote_device.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cam/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/isci/ (props changed) stable/8/sys/dev/xen/ (props changed) stable/8/sys/libkern/ (props changed) stable/8/sys/net80211/ (props changed) Modified: stable/8/sys/dev/isci/scil/scic_sds_remote_device.h ============================================================================== --- stable/8/sys/dev/isci/scil/scic_sds_remote_device.h Sun Sep 16 23:25:13 2012 (r240575) +++ stable/8/sys/dev/isci/scil/scic_sds_remote_device.h Mon Sep 17 00:32:35 2012 (r240576) @@ -121,7 +121,7 @@ enum SCIC_SDS_STP_REMOTE_DEVICE_READY_SU { /** * This is the idle substate for the stp remote device. When there are no - * active IO for the device it is is in this state. + * active IO for the device it is in this state. */ SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_IDLE, From owner-svn-src-all@FreeBSD.ORG Mon Sep 17 00:32:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9E3E8106566B; Mon, 17 Sep 2012 00:32:36 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 88B208FC19; Mon, 17 Sep 2012 00:32:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8H0Watf014179; Mon, 17 Sep 2012 00:32:36 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8H0Wa8f014177; Mon, 17 Sep 2012 00:32:36 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201209170032.q8H0Wa8f014177@svn.freebsd.org> From: Eitan Adler Date: Mon, 17 Sep 2012 00:32:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240577 - stable/9/sys/dev/isci/scil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2012 00:32:36 -0000 Author: eadler Date: Mon Sep 17 00:32:36 2012 New Revision: 240577 URL: http://svn.freebsd.org/changeset/base/240577 Log: MFC r240521: s/ is is / is /g s/ a a / a /g Approved by: cperciva (implicit) Modified: stable/9/sys/dev/isci/scil/scic_sds_remote_device.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/isci/scil/scic_sds_remote_device.h ============================================================================== --- stable/9/sys/dev/isci/scil/scic_sds_remote_device.h Mon Sep 17 00:32:35 2012 (r240576) +++ stable/9/sys/dev/isci/scil/scic_sds_remote_device.h Mon Sep 17 00:32:36 2012 (r240577) @@ -121,7 +121,7 @@ enum SCIC_SDS_STP_REMOTE_DEVICE_READY_SU { /** * This is the idle substate for the stp remote device. When there are no - * active IO for the device it is is in this state. + * active IO for the device it is in this state. */ SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_IDLE, From owner-svn-src-all@FreeBSD.ORG Mon Sep 17 00:44:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 70B031065670; Mon, 17 Sep 2012 00:44:12 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 41E5D8FC19; Mon, 17 Sep 2012 00:44:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8H0iCBw015853; Mon, 17 Sep 2012 00:44:12 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8H0iCDJ015850; Mon, 17 Sep 2012 00:44:12 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201209170044.q8H0iCDJ015850@svn.freebsd.org> From: Eitan Adler Date: Mon, 17 Sep 2012 00:44: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: r240578 - in stable/8/sys: kern sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2012 00:44:12 -0000 Author: eadler Date: Mon Sep 17 00:44:11 2012 New Revision: 240578 URL: http://svn.freebsd.org/changeset/base/240578 Log: MFC r240518: Correct double "the the" Approved by: cperciva (implicit) Modified: stable/8/sys/kern/subr_unit.c stable/8/sys/sparc64/sparc64/ata_machdep.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/kern/ (props changed) stable/8/sys/sparc64/ (props changed) stable/8/sys/vm/ (props changed) stable/8/tools/kerneldoc/ (props changed) stable/8/tools/kerneldoc/subsys/ (props changed) stable/8/usr.bin/lex/ (props changed) stable/8/usr.sbin/tcpdump/ (props changed) Modified: stable/8/sys/kern/subr_unit.c ============================================================================== --- stable/8/sys/kern/subr_unit.c Mon Sep 17 00:32:36 2012 (r240577) +++ stable/8/sys/kern/subr_unit.c Mon Sep 17 00:44:11 2012 (r240578) @@ -63,7 +63,7 @@ * in the usermode test program included, the worst case usage * was 798 bytes on i386 for 5000 allocated and 5000 free units. * * The worst case is where every other unit number is allocated and - * the the rest are free. In that case 44 + N/4 bytes are used where + * the rest are free. In that case 44 + N/4 bytes are used where * N is the number of the highest unit allocated. */ Modified: stable/8/sys/sparc64/sparc64/ata_machdep.c ============================================================================== --- stable/8/sys/sparc64/sparc64/ata_machdep.c Mon Sep 17 00:32:36 2012 (r240577) +++ stable/8/sys/sparc64/sparc64/ata_machdep.c Mon Sep 17 00:44:11 2012 (r240578) @@ -40,7 +40,7 @@ sparc64_ata_disk_firmware_geom_adjust(st * and sectors so the geometry of large disks has to be adjusted. * If the disk is > 32GB at 16 heads and 63 sectors, adjust to 255 * sectors (this matches what the OpenSolaris dad(7D) driver does). - * If the the disk is even > 128GB, additionally adjust the heads to + * If the disk is even > 128GB, additionally adjust the heads to * 255. This allows disks up to the 2TB limit of the extended VTOC8. * XXX the OpenSolaris dad(7D) driver limits the mediasize to 128GB. */ From owner-svn-src-all@FreeBSD.ORG Mon Sep 17 00:44:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 29489106564A; Mon, 17 Sep 2012 00:44:17 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 109DA8FC12; Mon, 17 Sep 2012 00:44:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8H0iHwF015918; Mon, 17 Sep 2012 00:44:17 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8H0iGEh015896; Mon, 17 Sep 2012 00:44:16 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201209170044.q8H0iGEh015896@svn.freebsd.org> From: Eitan Adler Date: Mon, 17 Sep 2012 00:44:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240579 - in stable/9: sys/dev/buslogic sys/dev/e1000 sys/dev/isci/scil sys/dev/isp sys/dev/mps sys/kern sys/sparc64/sparc64 sys/vm usr.sbin/tcpdump/tcpdump X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2012 00:44:17 -0000 Author: eadler Date: Mon Sep 17 00:44:16 2012 New Revision: 240579 URL: http://svn.freebsd.org/changeset/base/240579 Log: MFC r240518: Correct double "the the" Approved by: cperciva (implicit) Modified: stable/9/sys/dev/buslogic/bt.c stable/9/sys/dev/e1000/e1000_82575.c stable/9/sys/dev/e1000/e1000_ich8lan.c stable/9/sys/dev/isci/scil/sati.c stable/9/sys/dev/isci/scil/sati_callbacks.h stable/9/sys/dev/isci/scil/sci_base_controller.h stable/9/sys/dev/isci/scil/sci_base_domain.h stable/9/sys/dev/isci/scil/sci_base_phy.h stable/9/sys/dev/isci/scil/sci_base_remote_device.h stable/9/sys/dev/isci/scil/scic_io_request.h stable/9/sys/dev/isci/scil/scic_sds_phy.c stable/9/sys/dev/isci/scil/scic_sds_port.h stable/9/sys/dev/isci/scil/scic_sds_remote_node_context.h stable/9/sys/dev/isci/scil/scic_sds_request.c stable/9/sys/dev/isci/scil/scu_bios_definitions.h stable/9/sys/dev/isp/isp_freebsd.c stable/9/sys/dev/mps/mps_sas.c stable/9/sys/kern/subr_unit.c stable/9/sys/sparc64/sparc64/ata_machdep.c stable/9/sys/vm/vm_pageout.c stable/9/usr.sbin/tcpdump/tcpdump/tcpdump.1 Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/isp/ (props changed) stable/9/tools/kerneldoc/ (props changed) stable/9/usr.bin/lex/ (props changed) stable/9/usr.sbin/tcpdump/ (props changed) Modified: stable/9/sys/dev/buslogic/bt.c ============================================================================== --- stable/9/sys/dev/buslogic/bt.c Mon Sep 17 00:44:11 2012 (r240578) +++ stable/9/sys/dev/buslogic/bt.c Mon Sep 17 00:44:16 2012 (r240579) @@ -1945,7 +1945,7 @@ bt_cmd(struct bt_softc *bt, bt_op_t opco bt_outb(bt, COMMAND_REG, opcode); /* - * Wait for up to 1sec for each byte of the the + * Wait for up to 1sec for each byte of the * parameter list sent to be sent. */ timeout = 10000; Modified: stable/9/sys/dev/e1000/e1000_82575.c ============================================================================== --- stable/9/sys/dev/e1000/e1000_82575.c Mon Sep 17 00:44:11 2012 (r240578) +++ stable/9/sys/dev/e1000/e1000_82575.c Mon Sep 17 00:44:16 2012 (r240579) @@ -2280,7 +2280,7 @@ out: * e1000_reset_mdicnfg_82580 - Reset MDICNFG destination and com_mdio bits * @hw: pointer to the HW structure * - * This resets the the MDICNFG.Destination and MDICNFG.Com_MDIO bits based on + * This resets the MDICNFG.Destination and MDICNFG.Com_MDIO bits based on * the values found in the EEPROM. This addresses an issue in which these * bits are not restored from EEPROM after reset. **/ Modified: stable/9/sys/dev/e1000/e1000_ich8lan.c ============================================================================== --- stable/9/sys/dev/e1000/e1000_ich8lan.c Mon Sep 17 00:44:11 2012 (r240578) +++ stable/9/sys/dev/e1000/e1000_ich8lan.c Mon Sep 17 00:44:16 2012 (r240579) @@ -3228,7 +3228,7 @@ out: * @hw: pointer to the HW structure * * ICH8 use the PCI Express bus, but does not contain a PCI Express Capability - * register, so the the bus width is hard coded. + * register, so the bus width is hard coded. **/ static s32 e1000_get_bus_info_ich8lan(struct e1000_hw *hw) { Modified: stable/9/sys/dev/isci/scil/sati.c ============================================================================== --- stable/9/sys/dev/isci/scil/sati.c Mon Sep 17 00:44:11 2012 (r240578) +++ stable/9/sys/dev/isci/scil/sati.c Mon Sep 17 00:44:16 2012 (r240579) @@ -1236,7 +1236,7 @@ void sati_sequence_terminate( ) { // Decode the sequence type to determine how to handle the termination - // of the the translation method. + // of the translation method. switch (sequence->type) { case SATI_SEQUENCE_UNMAP: Modified: stable/9/sys/dev/isci/scil/sati_callbacks.h ============================================================================== --- stable/9/sys/dev/isci/scil/sati_callbacks.h Mon Sep 17 00:44:11 2012 (r240578) +++ stable/9/sys/dev/isci/scil/sati_callbacks.h Mon Sep 17 00:44:16 2012 (r240579) @@ -153,7 +153,7 @@ void sati_cb_get_data_byte( ); /** - * @brief This callback method gets the the task type for the SCSI task + * @brief This callback method gets the task type for the SCSI task * request. * * @param[in] scsi_task This parameter specifies the user's SCSI Task request. Modified: stable/9/sys/dev/isci/scil/sci_base_controller.h ============================================================================== --- stable/9/sys/dev/isci/scil/sci_base_controller.h Mon Sep 17 00:44:11 2012 (r240578) +++ stable/9/sys/dev/isci/scil/sci_base_controller.h Mon Sep 17 00:44:16 2012 (r240579) @@ -113,7 +113,7 @@ typedef enum _SCI_BASE_CONTROLLER_STATES SCI_BASE_CONTROLLER_STATE_INITIALIZED, /** - * This state indicates the the controller is in the process of becoming + * This state indicates the controller is in the process of becoming * ready (i.e. starting). In this state no new IO operations are permitted. * This state is entered from the INITIALIZED state. */ Modified: stable/9/sys/dev/isci/scil/sci_base_domain.h ============================================================================== --- stable/9/sys/dev/isci/scil/sci_base_domain.h Mon Sep 17 00:44:11 2012 (r240578) +++ stable/9/sys/dev/isci/scil/sci_base_domain.h Mon Sep 17 00:44:16 2012 (r240579) @@ -92,7 +92,7 @@ typedef enum _SCI_BASE_DOMAIN_STATES SCI_BASE_DOMAIN_STATE_STARTING, /** - * This state indicates the the domain is now ready. Thus, the user + * This state indicates the domain is now ready. Thus, the user * is able to perform IO operations to remote devices in this domain. * This state is entered from the STOPPED state. * This state is entered from the STOPPING state. Modified: stable/9/sys/dev/isci/scil/sci_base_phy.h ============================================================================== --- stable/9/sys/dev/isci/scil/sci_base_phy.h Mon Sep 17 00:44:11 2012 (r240578) +++ stable/9/sys/dev/isci/scil/sci_base_phy.h Mon Sep 17 00:44:16 2012 (r240579) @@ -102,7 +102,7 @@ typedef enum _SCI_BASE_PHY_STATES SCI_BASE_PHY_STATE_STARTING, /** - * This state indicates the the phy is now ready. Thus, the user + * This state indicates the phy is now ready. Thus, the user * is able to perform IO operations utilizing this phy as long as it * is currently part of a valid port. * This state is entered from the STARTING state. Modified: stable/9/sys/dev/isci/scil/sci_base_remote_device.h ============================================================================== --- stable/9/sys/dev/isci/scil/sci_base_remote_device.h Mon Sep 17 00:44:11 2012 (r240578) +++ stable/9/sys/dev/isci/scil/sci_base_remote_device.h Mon Sep 17 00:44:16 2012 (r240579) @@ -93,7 +93,7 @@ typedef enum _SCI_BASE_REMOTE_DEVICE_STA SCI_BASE_REMOTE_DEVICE_STATE_STOPPED, /** - * This state indicates the the remote device is in the process of + * This state indicates the remote device is in the process of * becoming ready (i.e. starting). In this state no new IO operations * are permitted. * This state is entered from the STOPPED state. Modified: stable/9/sys/dev/isci/scil/scic_io_request.h ============================================================================== --- stable/9/sys/dev/isci/scil/scic_io_request.h Mon Sep 17 00:44:11 2012 (r240578) +++ stable/9/sys/dev/isci/scil/scic_io_request.h Mon Sep 17 00:44:16 2012 (r240579) @@ -260,12 +260,12 @@ typedef struct SCIC_SMP_PASSTHRU_REQUEST */ U8 (* scic_cb_smp_passthru_get_frame_type) ( void *); /** - * Function pointer to get the function in the the smp request + * Function pointer to get the function in the smp request */ U8 (* scic_cb_smp_passthru_get_function) ( void * ); /** - * Function pointer to get the "allocated response length" in the the smp request + * Function pointer to get the "allocated response length" in the smp request */ U8 (* scic_cb_smp_passthru_get_allocated_response_length) ( void * ); Modified: stable/9/sys/dev/isci/scil/scic_sds_phy.c ============================================================================== --- stable/9/sys/dev/isci/scil/scic_sds_phy.c Mon Sep 17 00:44:11 2012 (r240578) +++ stable/9/sys/dev/isci/scil/scic_sds_phy.c Mon Sep 17 00:44:16 2012 (r240579) @@ -658,7 +658,7 @@ void scic_sds_phy_construct( // Clear out the error counter data memset(this_phy->error_counter, 0, sizeof(this_phy->error_counter)); - // Initialize the the substate machines + // Initialize the substate machines sci_base_state_machine_construct( &this_phy->starting_substate_machine, &this_phy->parent.parent, Modified: stable/9/sys/dev/isci/scil/scic_sds_port.h ============================================================================== --- stable/9/sys/dev/isci/scil/scic_sds_port.h Mon Sep 17 00:44:11 2012 (r240578) +++ stable/9/sys/dev/isci/scil/scic_sds_port.h Mon Sep 17 00:44:16 2012 (r240579) @@ -109,7 +109,7 @@ struct SCIC_SDS_REQUEST; /** * @struct SCIC_SDS_PORT * - * The core port object provides the the abstraction for an SCU port. + * The core port object provides the abstraction for an SCU port. */ typedef struct SCIC_SDS_PORT { Modified: stable/9/sys/dev/isci/scil/scic_sds_remote_node_context.h ============================================================================== --- stable/9/sys/dev/isci/scil/scic_sds_remote_node_context.h Mon Sep 17 00:44:11 2012 (r240578) +++ stable/9/sys/dev/isci/scil/scic_sds_remote_node_context.h Mon Sep 17 00:44:16 2012 (r240579) @@ -237,7 +237,7 @@ enum SCIC_SDS_REMOTE_NODE_CONTEXT_DESTIN * * @brief This structure contains the data associated with the remote * node context object. The remote node context (RNC) object models - * the the remote device information necessary to manage the + * the remote device information necessary to manage the * silicon RNC. */ typedef struct SCIC_SDS_REMOTE_NODE_CONTEXT Modified: stable/9/sys/dev/isci/scil/scic_sds_request.c ============================================================================== --- stable/9/sys/dev/isci/scil/scic_sds_request.c Mon Sep 17 00:44:11 2012 (r240578) +++ stable/9/sys/dev/isci/scil/scic_sds_request.c Mon Sep 17 00:44:16 2012 (r240579) @@ -2679,7 +2679,7 @@ void scic_sds_request_initial_state_ente /** * This method implements the actions taken when entering the * SCI_BASE_REQUEST_STATE_CONSTRUCTED state. - * The method sets the state handlers for the the constructed state. + * The method sets the state handlers for the constructed state. * * @param[in] object The io request object that is to enter the constructed * state. Modified: stable/9/sys/dev/isci/scil/scu_bios_definitions.h ============================================================================== --- stable/9/sys/dev/isci/scil/scu_bios_definitions.h Mon Sep 17 00:44:11 2012 (r240578) +++ stable/9/sys/dev/isci/scil/scu_bios_definitions.h Mon Sep 17 00:44:16 2012 (r240579) @@ -299,7 +299,7 @@ typedef struct SCI_BIOS_OEM_PARAM_ELEMEN } sas_address; /** - * These are the per PHY equalization settings associated with the the + * These are the per PHY equalization settings associated with the * AFE XCVR Tx Amplitude and Equalization Control Register Set * (0 thru 3). * @@ -496,7 +496,7 @@ typedef struct SCI_BIOS_OEM_PARAM_ELEMEN } sas_address; /** - * These are the per PHY equalization settings associated with the the + * These are the per PHY equalization settings associated with the * AFE XCVR Tx Amplitude and Equalization Control Register Set * (0 thru 3). * @@ -706,7 +706,7 @@ typedef struct SCI_BIOS_OEM_PARAM_ELEMEN } sas_address; /** - * These are the per PHY equalization settings associated with the the + * These are the per PHY equalization settings associated with the * AFE XCVR Tx Amplitude and Equalization Control Register Set * (0 thru 3). * @@ -927,7 +927,7 @@ typedef struct SCI_BIOS_OEM_PARAM_ELEMEN } sas_address; /** - * These are the per PHY equalization settings associated with the the + * These are the per PHY equalization settings associated with the * AFE XCVR Tx Amplitude and Equalization Control Register Set * (0 thru 3). * Modified: stable/9/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/9/sys/dev/isp/isp_freebsd.c Mon Sep 17 00:44:11 2012 (r240578) +++ stable/9/sys/dev/isp/isp_freebsd.c Mon Sep 17 00:44:16 2012 (r240579) @@ -1889,7 +1889,7 @@ isp_target_start_ctio(ispsoftc_t *isp, u * Mode 1, status, no data. Only possible when we are sending status, have * no data to transfer, and the sense length can fit in the ct7_entry. * - * Mode 2, status, no data. We have to use this in the case the the response + * Mode 2, status, no data. We have to use this in the case the response * length won't fit into a ct2_entry_t. * * We'll fill out this structure with information as if this were a Modified: stable/9/sys/dev/mps/mps_sas.c ============================================================================== --- stable/9/sys/dev/mps/mps_sas.c Mon Sep 17 00:44:11 2012 (r240578) +++ stable/9/sys/dev/mps/mps_sas.c Mon Sep 17 00:44:16 2012 (r240579) @@ -360,7 +360,7 @@ mpssas_remove_volume(struct mps_softc *s mps_printf(sc, "Reset aborted %u commands\n", reply->TerminationCount); mps_free_reply(sc, tm->cm_reply_data); - tm->cm_reply = NULL; /* Ensures the the reply won't get re-freed */ + tm->cm_reply = NULL; /* Ensures the reply won't get re-freed */ mps_printf(sc, "clearing target %u handle 0x%04x\n", targ->tid, handle); @@ -550,7 +550,7 @@ mpssas_remove_device(struct mps_softc *s mps_dprint(sc, MPS_INFO, "Reset aborted %u commands\n", le32toh(reply->TerminationCount)); mps_free_reply(sc, tm->cm_reply_data); - tm->cm_reply = NULL; /* Ensures the the reply won't get re-freed */ + tm->cm_reply = NULL; /* Ensures the reply won't get re-freed */ /* Reuse the existing command */ req = (MPI2_SAS_IOUNIT_CONTROL_REQUEST *)tm->cm_req; Modified: stable/9/sys/kern/subr_unit.c ============================================================================== --- stable/9/sys/kern/subr_unit.c Mon Sep 17 00:44:11 2012 (r240578) +++ stable/9/sys/kern/subr_unit.c Mon Sep 17 00:44:16 2012 (r240579) @@ -63,7 +63,7 @@ * in the usermode test program included, the worst case usage * was 798 bytes on i386 for 5000 allocated and 5000 free units. * * The worst case is where every other unit number is allocated and - * the the rest are free. In that case 44 + N/4 bytes are used where + * the rest are free. In that case 44 + N/4 bytes are used where * N is the number of the highest unit allocated. */ Modified: stable/9/sys/sparc64/sparc64/ata_machdep.c ============================================================================== --- stable/9/sys/sparc64/sparc64/ata_machdep.c Mon Sep 17 00:44:11 2012 (r240578) +++ stable/9/sys/sparc64/sparc64/ata_machdep.c Mon Sep 17 00:44:16 2012 (r240579) @@ -40,7 +40,7 @@ sparc64_ata_disk_firmware_geom_adjust(st * and sectors so the geometry of large disks has to be adjusted. * If the disk is > 32GB at 16 heads and 63 sectors, adjust to 255 * sectors (this matches what the OpenSolaris dad(7D) driver does). - * If the the disk is even > 128GB, additionally adjust the heads to + * If the disk is even > 128GB, additionally adjust the heads to * 255. This allows disks up to the 2TB limit of the extended VTOC8. * XXX the OpenSolaris dad(7D) driver limits the mediasize to 128GB. */ Modified: stable/9/sys/vm/vm_pageout.c ============================================================================== --- stable/9/sys/vm/vm_pageout.c Mon Sep 17 00:44:11 2012 (r240578) +++ stable/9/sys/vm/vm_pageout.c Mon Sep 17 00:44:16 2012 (r240579) @@ -755,7 +755,7 @@ vm_pageout_scan(int pass) uma_reclaim(); /* - * The addl_page_shortage is the the number of temporarily + * The addl_page_shortage is the number of temporarily * stuck pages in the inactive queue. In other words, the * number of pages from cnt.v_inactive_count that should be * discounted in setting the target for the active queue scan. Modified: stable/9/usr.sbin/tcpdump/tcpdump/tcpdump.1 ============================================================================== --- stable/9/usr.sbin/tcpdump/tcpdump/tcpdump.1 Mon Sep 17 00:44:11 2012 (r240578) +++ stable/9/usr.sbin/tcpdump/tcpdump/tcpdump.1 Mon Sep 17 00:44:16 2012 (r240579) @@ -1436,11 +1436,11 @@ not be useful to people who are not fami AFS and RX. .LP If the -v (verbose) flag is given twice, acknowledgement packets and -additional header information is printed, such as the the RX call ID, +additional header information is printed, such as the RX call ID, call number, sequence number, serial number, and the RX packet flags. .LP If the -v flag is given twice, additional information is printed, -such as the the RX call ID, serial number, and the RX packet flags. +such as the RX call ID, serial number, and the RX packet flags. The MTU negotiation information is also printed from RX ack packets. .LP If the -v flag is given three times, the security index and service id From owner-svn-src-all@FreeBSD.ORG Mon Sep 17 00:47:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EA6F3106564A; Mon, 17 Sep 2012 00:47:36 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CC44D8FC0A; Mon, 17 Sep 2012 00:47:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8H0laQo016433; Mon, 17 Sep 2012 00:47:36 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8H0laRW016421; Mon, 17 Sep 2012 00:47:36 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201209170047.q8H0laRW016421@svn.freebsd.org> From: Eitan Adler Date: Mon, 17 Sep 2012 00:47:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240580 - in stable/9/sys: dev/isci/scil dev/vxge/include i386/include/xen netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2012 00:47:37 -0000 Author: eadler Date: Mon Sep 17 00:47:35 2012 New Revision: 240580 URL: http://svn.freebsd.org/changeset/base/240580 Log: MFC r240520: s/teh/the/g Approved by: cperciva (implicit) Modified: stable/9/sys/dev/isci/scil/scic_io_request.h stable/9/sys/dev/vxge/include/vxgehal-ll.h stable/9/sys/i386/include/xen/xen-os.h stable/9/sys/netinet/sctp_input.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/isci/scil/scic_io_request.h ============================================================================== --- stable/9/sys/dev/isci/scil/scic_io_request.h Mon Sep 17 00:44:16 2012 (r240579) +++ stable/9/sys/dev/isci/scil/scic_io_request.h Mon Sep 17 00:47:35 2012 (r240580) @@ -706,7 +706,7 @@ void * scic_stp_io_request_get_h2d_reg_a * @brief This method will return the address of the device to host register * fis region for the io request object. * - * @param[in] scic_io_request This parameter specifies teh handle to the io + * @param[in] scic_io_request This parameter specifies the handle to the io * request object from which to get the device to host register fis * buffer. * Modified: stable/9/sys/dev/vxge/include/vxgehal-ll.h ============================================================================== --- stable/9/sys/dev/vxge/include/vxgehal-ll.h Mon Sep 17 00:44:16 2012 (r240579) +++ stable/9/sys/dev/vxge/include/vxgehal-ll.h Mon Sep 17 00:47:35 2012 (r240580) @@ -3095,7 +3095,7 @@ typedef struct vxge_hal_device_pmd_info_ * @mac_addr_masks: Mac address masks for each vpath * * Returns the vpath mask that has the bits set for each vpath allocated - * for the driver and teh first mac addresse for each vpath + * for the driver and the first mac addresse for each vpath */ typedef struct vxge_hal_device_hw_info_t { u32 host_type; Modified: stable/9/sys/i386/include/xen/xen-os.h ============================================================================== --- stable/9/sys/i386/include/xen/xen-os.h Mon Sep 17 00:44:16 2012 (r240579) +++ stable/9/sys/i386/include/xen/xen-os.h Mon Sep 17 00:47:35 2012 (r240580) @@ -99,7 +99,7 @@ void trap_init(void); /* * STI/CLI equivalents. These basically set and clear the virtual - * event_enable flag in teh shared_info structure. Note that when + * event_enable flag in the shared_info structure. Note that when * the enable bit is set, there may be pending events to be handled. * We may therefore call into do_hypervisor_callback() directly. */ Modified: stable/9/sys/netinet/sctp_input.c ============================================================================== --- stable/9/sys/netinet/sctp_input.c Mon Sep 17 00:44:16 2012 (r240579) +++ stable/9/sys/netinet/sctp_input.c Mon Sep 17 00:47:35 2012 (r240580) @@ -3160,7 +3160,7 @@ sctp_handle_ecn_cwr(struct sctp_cwr_chun { /* * Here we get a CWR from the peer. We must look in the outqueue and - * make sure that we have a covered ECNE in teh control chunk part. + * make sure that we have a covered ECNE in the control chunk part. * If so remove it. */ struct sctp_tmit_chunk *chk; From owner-svn-src-all@FreeBSD.ORG Mon Sep 17 00:47:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 02008106566C; Mon, 17 Sep 2012 00:47:38 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E0E0F8FC0C; Mon, 17 Sep 2012 00:47:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8H0lb4T016458; Mon, 17 Sep 2012 00:47:37 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8H0lboF016455; Mon, 17 Sep 2012 00:47:37 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201209170047.q8H0lboF016455@svn.freebsd.org> From: Eitan Adler Date: Mon, 17 Sep 2012 00:47: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: r240581 - in stable/8/sys: i386/include/xen netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2012 00:47:38 -0000 Author: eadler Date: Mon Sep 17 00:47:37 2012 New Revision: 240581 URL: http://svn.freebsd.org/changeset/base/240581 Log: MFC r240520: s/teh/the/g Approved by: cperciva (implicit) Modified: stable/8/sys/i386/include/xen/xen-os.h stable/8/sys/netinet/sctp_input.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/i386/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/i386/include/xen/xen-os.h ============================================================================== --- stable/8/sys/i386/include/xen/xen-os.h Mon Sep 17 00:47:35 2012 (r240580) +++ stable/8/sys/i386/include/xen/xen-os.h Mon Sep 17 00:47:37 2012 (r240581) @@ -99,7 +99,7 @@ void trap_init(void); /* * STI/CLI equivalents. These basically set and clear the virtual - * event_enable flag in teh shared_info structure. Note that when + * event_enable flag in the shared_info structure. Note that when * the enable bit is set, there may be pending events to be handled. * We may therefore call into do_hypervisor_callback() directly. */ Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Mon Sep 17 00:47:35 2012 (r240580) +++ stable/8/sys/netinet/sctp_input.c Mon Sep 17 00:47:37 2012 (r240581) @@ -3107,7 +3107,7 @@ sctp_handle_ecn_cwr(struct sctp_cwr_chun { /* * Here we get a CWR from the peer. We must look in the outqueue and - * make sure that we have a covered ECNE in teh control chunk part. + * make sure that we have a covered ECNE in the control chunk part. * If so remove it. */ struct sctp_tmit_chunk *chk; From owner-svn-src-all@FreeBSD.ORG Mon Sep 17 00:56:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C1901106564A; Mon, 17 Sep 2012 00:56:11 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A80658FC15; Mon, 17 Sep 2012 00:56:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8H0uB1E017867; Mon, 17 Sep 2012 00:56:11 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8H0uBSH017854; Mon, 17 Sep 2012 00:56:11 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201209170056.q8H0uBSH017854@svn.freebsd.org> From: Eitan Adler Date: Mon, 17 Sep 2012 00:56:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240582 - in stable/9: lib/libpam/modules/pam_lastlog libexec/comsat libexec/ftpd share/man/man7 usr.bin/finger usr.bin/last usr.bin/ncplist usr.bin/talk usr.bin/users usr.bin/w usr.sbi... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2012 00:56:12 -0000 Author: eadler Date: Mon Sep 17 00:56:10 2012 New Revision: 240582 URL: http://svn.freebsd.org/changeset/base/240582 Log: MFC r240506: Bump date missed in r202756 PR: docs/171624 Approved by: cperciva (implicit) Modified: stable/9/lib/libpam/modules/pam_lastlog/pam_lastlog.8 stable/9/libexec/comsat/comsat.8 stable/9/libexec/ftpd/ftpd.8 stable/9/share/man/man7/hier.7 stable/9/usr.bin/finger/finger.1 stable/9/usr.bin/last/last.1 stable/9/usr.bin/ncplist/ncplist.1 stable/9/usr.bin/talk/talk.1 stable/9/usr.bin/users/users.1 stable/9/usr.bin/w/w.1 stable/9/usr.sbin/ac/ac.8 stable/9/usr.sbin/rwhod/rwhod.8 Directory Properties: stable/9/lib/libpam/ (props changed) stable/9/libexec/comsat/ (props changed) stable/9/libexec/ftpd/ (props changed) stable/9/share/man/man4/ (props changed) stable/9/share/man/man7/ (props changed) stable/9/usr.bin/finger/ (props changed) stable/9/usr.bin/last/ (props changed) stable/9/usr.bin/ncplist/ (props changed) stable/9/usr.bin/talk/ (props changed) stable/9/usr.bin/users/ (props changed) stable/9/usr.bin/w/ (props changed) stable/9/usr.sbin/ac/ (props changed) stable/9/usr.sbin/rwhod/ (props changed) Modified: stable/9/lib/libpam/modules/pam_lastlog/pam_lastlog.8 ============================================================================== --- stable/9/lib/libpam/modules/pam_lastlog/pam_lastlog.8 Mon Sep 17 00:47:37 2012 (r240581) +++ stable/9/lib/libpam/modules/pam_lastlog/pam_lastlog.8 Mon Sep 17 00:56:10 2012 (r240582) @@ -34,7 +34,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 24, 2002 +.Dd January 21, 2010 .Dt PAM_LASTLOG 8 .Os .Sh NAME Modified: stable/9/libexec/comsat/comsat.8 ============================================================================== --- stable/9/libexec/comsat/comsat.8 Mon Sep 17 00:47:37 2012 (r240581) +++ stable/9/libexec/comsat/comsat.8 Mon Sep 17 00:56:10 2012 (r240582) @@ -32,7 +32,7 @@ .\" @(#)comsat.8 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd July 9, 2002 +.Dd January 21, 2010 .Dt COMSAT 8 .Os .Sh NAME Modified: stable/9/libexec/ftpd/ftpd.8 ============================================================================== --- stable/9/libexec/ftpd/ftpd.8 Mon Sep 17 00:47:37 2012 (r240581) +++ stable/9/libexec/ftpd/ftpd.8 Mon Sep 17 00:56:10 2012 (r240582) @@ -32,7 +32,7 @@ .\" @(#)ftpd.8 8.2 (Berkeley) 4/19/94 .\" $FreeBSD$ .\" -.Dd April 20, 2007 +.Dd January 21, 2010 .Dt FTPD 8 .Os .Sh NAME Modified: stable/9/share/man/man7/hier.7 ============================================================================== --- stable/9/share/man/man7/hier.7 Mon Sep 17 00:47:37 2012 (r240581) +++ stable/9/share/man/man7/hier.7 Mon Sep 17 00:56:10 2012 (r240582) @@ -32,7 +32,7 @@ .\" @(#)hier.7 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd May 25, 2008 +.Dd January 21, 2010 .Dt HIER 7 .Os .Sh NAME Modified: stable/9/usr.bin/finger/finger.1 ============================================================================== --- stable/9/usr.bin/finger/finger.1 Mon Sep 17 00:47:37 2012 (r240581) +++ stable/9/usr.bin/finger/finger.1 Mon Sep 17 00:56:10 2012 (r240582) @@ -28,7 +28,7 @@ .\" @(#)finger.1 8.3 (Berkeley) 5/5/94 .\" $FreeBSD$ .\" -.Dd April 11, 2007 +.Dd January 21, 2010 .Dt FINGER 1 .Os .Sh NAME Modified: stable/9/usr.bin/last/last.1 ============================================================================== --- stable/9/usr.bin/last/last.1 Mon Sep 17 00:47:37 2012 (r240581) +++ stable/9/usr.bin/last/last.1 Mon Sep 17 00:56:10 2012 (r240582) @@ -28,7 +28,7 @@ .\" @(#)last.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd July 27, 2003 +.Dd January 21, 2010 .Dt LAST 1 .Os .Sh NAME Modified: stable/9/usr.bin/ncplist/ncplist.1 ============================================================================== --- stable/9/usr.bin/ncplist/ncplist.1 Mon Sep 17 00:47:37 2012 (r240581) +++ stable/9/usr.bin/ncplist/ncplist.1 Mon Sep 17 00:56:10 2012 (r240582) @@ -1,5 +1,5 @@ .\" $FreeBSD$ -.Dd June 24, 1999 +.Dd January 21, 2010 .Dt NCPLIST 1 .Os .Sh NAME Modified: stable/9/usr.bin/talk/talk.1 ============================================================================== --- stable/9/usr.bin/talk/talk.1 Mon Sep 17 00:47:37 2012 (r240581) +++ stable/9/usr.bin/talk/talk.1 Mon Sep 17 00:56:10 2012 (r240582) @@ -28,7 +28,7 @@ .\" @(#)talk.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd July 3, 2004 +.Dd January 21, 2010 .Dt TALK 1 .Os .Sh NAME Modified: stable/9/usr.bin/users/users.1 ============================================================================== --- stable/9/usr.bin/users/users.1 Mon Sep 17 00:47:37 2012 (r240581) +++ stable/9/usr.bin/users/users.1 Mon Sep 17 00:56:10 2012 (r240582) @@ -28,7 +28,7 @@ .\" @(#)users.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd June 6, 1993 +.Dd January 21, 2010 .Dt USERS 1 .Os .Sh NAME Modified: stable/9/usr.bin/w/w.1 ============================================================================== --- stable/9/usr.bin/w/w.1 Mon Sep 17 00:47:37 2012 (r240581) +++ stable/9/usr.bin/w/w.1 Mon Sep 17 00:56:10 2012 (r240582) @@ -28,7 +28,7 @@ .\" @(#)w.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd June 6, 1993 +.Dd January 21, 2010 .Dt W 1 .Os .Sh NAME Modified: stable/9/usr.sbin/ac/ac.8 ============================================================================== --- stable/9/usr.sbin/ac/ac.8 Mon Sep 17 00:47:37 2012 (r240581) +++ stable/9/usr.sbin/ac/ac.8 Mon Sep 17 00:56:10 2012 (r240582) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 15, 1994 +.Dd January 21, 2010 .Dt AC 8 .Os .Sh NAME Modified: stable/9/usr.sbin/rwhod/rwhod.8 ============================================================================== --- stable/9/usr.sbin/rwhod/rwhod.8 Mon Sep 17 00:47:37 2012 (r240581) +++ stable/9/usr.sbin/rwhod/rwhod.8 Mon Sep 17 00:56:10 2012 (r240582) @@ -28,7 +28,7 @@ .\" @(#)rwhod.8 8.2 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd December 11, 1993 +.Dd January 21, 2010 .Dt RWHOD 8 .Os .Sh NAME From owner-svn-src-all@FreeBSD.ORG Mon Sep 17 01:09:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DCA33106564A; Mon, 17 Sep 2012 01:09:17 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AE4F38FC08; Mon, 17 Sep 2012 01:09:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8H19HaF020108; Mon, 17 Sep 2012 01:09:17 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8H19HJD020106; Mon, 17 Sep 2012 01:09:17 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201209170109.q8H19HJD020106@svn.freebsd.org> From: Adrian Chadd Date: Mon, 17 Sep 2012 01:09:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240583 - head/sys/dev/ath/ath_rate/sample X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2012 01:09:18 -0000 Author: adrian Date: Mon Sep 17 01:09:17 2012 New Revision: 240583 URL: http://svn.freebsd.org/changeset/base/240583 Log: Improve performance of the Sample rate algorithm on 802.11n networks. * Don't treat high percentage failures as "sucessive failures" - high MCS rates are very picky and will quite happily "fade" from low to high failure % and back again within a few seconds. If they really don't work, the aggregate will just plain fail. * Only sample MCS rates +/- 3 from the current MCS. Sample will back off quite quickly, so there's no need to sample _all_ MCS rates between a high MCS rate and MCS0; there may be a lot of them. * Modify the smoothing rate to be 75% rather than 95% - it's more adaptive but it comes with a cost of being slightly less stable at times. A per-node, hysterisis behaviour would be nicer. Modified: head/sys/dev/ath/ath_rate/sample/sample.c Modified: head/sys/dev/ath/ath_rate/sample/sample.c ============================================================================== --- head/sys/dev/ath/ath_rate/sample/sample.c Mon Sep 17 00:56:10 2012 (r240582) +++ head/sys/dev/ath/ath_rate/sample/sample.c Mon Sep 17 01:09:17 2012 (r240583) @@ -293,27 +293,17 @@ pick_sample_rate(struct sample_softc *ss } /* - * When doing aggregation, successive failures don't happen - * as often, as sometimes some of the sub-frames get through. - * - * If the sample rix average tx time is greater than the - * average tx time of the current rix, don't immediately use - * the rate for sampling. + * For HT, only sample a few rates on either side of the + * current rix; there's quite likely a lot of them. */ if (an->an_node.ni_flags & IEEE80211_NODE_HT) { - if ((sn->stats[size_bin][rix].average_tx_time * 10 > - sn->stats[size_bin][current_rix].average_tx_time * 9) && - (ticks - sn->stats[size_bin][rix].last_tx < ssc->stale_failure_timeout)) { + if (rix < (current_rix - 3) || + rix > (current_rix + 3)) { mask &= ~((uint64_t) 1< 11M for non-HT rates */ if (! (an->an_node.ni_flags & IEEE80211_NODE_HT)) { if (DOT11RATE(rix) > 2*11 && rix > current_rix + 2) { @@ -1420,7 +1410,7 @@ ath_rate_attach(struct ath_softc *sc) if (ssc == NULL) return NULL; ssc->arc.arc_space = sizeof(struct sample_node); - ssc->smoothing_rate = 95; /* ewma percentage ([0..99]) */ + ssc->smoothing_rate = 75; /* ewma percentage ([0..99]) */ ssc->smoothing_minpackets = 100 / (100 - ssc->smoothing_rate); ssc->sample_rate = 10; /* %time to try diff tx rates */ ssc->max_successive_failures = 3; /* threshold for rate sampling*/ From owner-svn-src-all@FreeBSD.ORG Mon Sep 17 01:18:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6EB4B106566C; Mon, 17 Sep 2012 01:18:48 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 59E5E8FC08; Mon, 17 Sep 2012 01:18:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8H1Im5t021340; Mon, 17 Sep 2012 01:18:48 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8H1ImMg021338; Mon, 17 Sep 2012 01:18:48 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201209170118.q8H1ImMg021338@svn.freebsd.org> From: Adrian Chadd Date: Mon, 17 Sep 2012 01:18:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240584 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2012 01:18:48 -0000 Author: adrian Date: Mon Sep 17 01:18:47 2012 New Revision: 240584 URL: http://svn.freebsd.org/changeset/base/240584 Log: Add a debug bit for TX destination filtering. Modified: head/sys/dev/ath/if_ath_debug.h Modified: head/sys/dev/ath/if_ath_debug.h ============================================================================== --- head/sys/dev/ath/if_ath_debug.h Mon Sep 17 01:09:17 2012 (r240583) +++ head/sys/dev/ath/if_ath_debug.h Mon Sep 17 01:18:47 2012 (r240584) @@ -65,6 +65,7 @@ enum { ATH_DEBUG_FATAL = 0x080000000ULL, /* fatal errors */ ATH_DEBUG_SW_TX_BAR = 0x100000000ULL, /* BAR TX */ ATH_DEBUG_EDMA_RX = 0x200000000ULL, /* RX EDMA state */ + ATH_DEBUG_SW_TX_FILT = 0x400000000ULL, /* SW TX FF */ ATH_DEBUG_ANY = 0xffffffffffffffffULL }; From owner-svn-src-all@FreeBSD.ORG Mon Sep 17 01:21:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B9625106566B; Mon, 17 Sep 2012 01:21:55 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8B3A28FC08; Mon, 17 Sep 2012 01:21:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8H1Ltba021743; Mon, 17 Sep 2012 01:21:55 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8H1Lta0021740; Mon, 17 Sep 2012 01:21:55 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201209170121.q8H1Lta0021740@svn.freebsd.org> From: Adrian Chadd Date: Mon, 17 Sep 2012 01:21:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240585 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2012 01:21:55 -0000 Author: adrian Date: Mon Sep 17 01:21:55 2012 New Revision: 240585 URL: http://svn.freebsd.org/changeset/base/240585 Log: Add a per-TID filter queue and filter state bits. These are intended for software TX filtering support, where the NIC decides there has been too many successive failues to a destination and will filter it. Although the filtering is done per-destination (via the keycache), the state and queue is kept per-TID for now. It simplifies the overall architecture design and locking. Whilst here, add ATH_TID_UNLOCK_ASSERT(). Modified: head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Mon Sep 17 01:18:47 2012 (r240584) +++ head/sys/dev/ath/if_athvar.h Mon Sep 17 01:21:55 2012 (r240585) @@ -107,6 +107,12 @@ struct ath_tid { int ac; /* which AC gets this trafic */ int hwq_depth; /* how many buffers are on HW */ + struct { + TAILQ_HEAD(,ath_buf) axq_q; /* filtered queue */ + u_int axq_depth; /* SW queue depth */ + char axq_name[48]; /* lock name */ + } filtq; + /* * Entry on the ath_txq; when there's traffic * to send @@ -114,9 +120,16 @@ struct ath_tid { TAILQ_ENTRY(ath_tid) axq_qelem; int sched; int paused; /* >0 if the TID has been paused */ + + /* + * These are flags - perhaps later collapse + * down to a single uint32_t ? + */ int addba_tx_pending; /* TX ADDBA pending */ int bar_wait; /* waiting for BAR */ int bar_tx; /* BAR TXed */ + int isfiltered; /* is this node currently filtered */ + int clrdmask; /* has clrdmask been set */ /* * Is the TID being cleaned up after a transition @@ -336,6 +349,8 @@ struct ath_txq { #define ATH_TID_LOCK_ASSERT(_sc, _tid) \ ATH_TXQ_LOCK_ASSERT((_sc)->sc_ac2q[(_tid)->ac]) +#define ATH_TID_UNLOCK_ASSERT(_sc, _tid) \ + ATH_TXQ_UNLOCK_ASSERT((_sc)->sc_ac2q[(_tid)->ac]) #define ATH_TXQ_INSERT_HEAD(_tq, _elm, _field) do { \ TAILQ_INSERT_HEAD(&(_tq)->axq_q, (_elm), _field); \ From owner-svn-src-all@FreeBSD.ORG Mon Sep 17 02:23:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 095CE106564A; Mon, 17 Sep 2012 02:23:04 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D071A8FC17; Mon, 17 Sep 2012 02:23:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8H2N30s029390; Mon, 17 Sep 2012 02:23:03 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8H2N3Bi029388; Mon, 17 Sep 2012 02:23:03 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201209170223.q8H2N3Bi029388@svn.freebsd.org> From: Glen Barber Date: Mon, 17 Sep 2012 02:23:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240586 - head/release X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2012 02:23:04 -0000 Author: gjb (doc,ports committer) Date: Mon Sep 17 02:23:03 2012 New Revision: 240586 URL: http://svn.freebsd.org/changeset/base/240586 Log: Update generate-release.sh script: - Use svn for ports and doc trees - When installing a binary textproc/docproj package, switch pkg_add(1) to pkg(8) [1] Reviewed by: nwhitehorn Approved by: nwhitehorn Enhanced by: glebius [1] MFC After: 1 week X-MFC-To: 9-only Modified: head/release/generate-release.sh Modified: head/release/generate-release.sh ============================================================================== --- head/release/generate-release.sh Mon Sep 17 01:21:55 2012 (r240585) +++ head/release/generate-release.sh Mon Sep 17 02:23:03 2012 (r240586) @@ -23,16 +23,24 @@ usage() { - echo "Usage: $0 [-r revision] svn-branch scratch-dir" + echo "Usage: $0 [-r revision] [-d docrevision] [-p portsrevision] svn-branch scratch-dir" exit 1 } REVISION= -while getopts r: opt; do +DOCREVISION= +PORTSREVISION= +while getopts d:r:p: opt; do case $opt in + d) + DOCREVISION="-r $OPTARG" + ;; r) REVISION="-r $OPTARG" ;; + p) + PORTSREVISION="-r $OPTARG" + ;; \?) usage ;; @@ -57,22 +65,8 @@ esac mkdir -p $2/usr/src svn co ${SVNROOT:-svn://svn.freebsd.org/base}/$1 $2/usr/src $REVISION -if [ ! -z $CVSUP_HOST ]; then - cat > $2/docports-supfile << EOF - *default host=$CVSUP_HOST - *default base=/var/db - *default prefix=/usr - *default release=cvs tag=${CVS_TAG:-.} - *default delete use-rel-suffix - *default compress - ports-all - doc-all -EOF -elif [ ! -z $CVSROOT ]; then - cd $2/usr - cvs -R ${CVSARGS} -d ${CVSROOT} co -P -r ${CVS_TAG:-HEAD} ports - cvs -R ${CVSARGS} -d ${CVSROOT} co -P -r ${CVS_TAG:-HEAD} doc -fi +svn co ${SVNROOT:-svn://svn.freebsd.org/doc}/head $2/usr/doc $DOCREVISION +svn co ${SVNROOT:-svn://svn.freebsd.org/ports}/head $2/usr/ports $PORTSREVISION cd $2/usr/src make $MAKE_FLAGS buildworld @@ -80,18 +74,11 @@ make installworld distribution DESTDIR=$ mount -t devfs devfs $2/dev trap "umount $2/dev" EXIT # Clean up devfs mount on exit -if [ ! -z $CVSUP_HOST ]; then - cp /etc/resolv.conf $2/etc/resolv.conf - - # Checkout ports and doc trees - chroot $2 /usr/bin/csup /docports-supfile -fi - if [ -d $2/usr/doc ]; then cp /etc/resolv.conf $2/etc/resolv.conf - # Build ports to build release documentation - chroot $2 /bin/sh -c 'pkg_add -r docproj || (cd /usr/ports/textproc/docproj && make install clean BATCH=yes WITHOUT_X11=yes JADETEX=no WITHOUT_PYTHON=yes)' + # Install docproj to build release documentation + chroot $2 /bin/sh -c '(export ASSUME_ALWAYS_YES=1 && /usr/sbin/pkg install -y docproj) || (cd /usr/ports/textproc/docproj && make install clean BATCH=yes WITHOUT_X11=yes JADETEX=no WITHOUT_PYTHON=yes)' fi chroot $2 make -C /usr/src $MAKE_FLAGS buildworld buildkernel From owner-svn-src-all@FreeBSD.ORG Mon Sep 17 02:35:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 436F2106564A; Mon, 17 Sep 2012 02:35:01 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2E62E8FC16; Mon, 17 Sep 2012 02:35:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8H2Z1JY030951; Mon, 17 Sep 2012 02:35:01 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8H2Z0XO030949; Mon, 17 Sep 2012 02:35:00 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201209170235.q8H2Z0XO030949@svn.freebsd.org> From: Glen Barber Date: Mon, 17 Sep 2012 02:35:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240587 - head/release X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2012 02:35:01 -0000 Author: gjb (doc,ports committer) Date: Mon Sep 17 02:35:00 2012 New Revision: 240587 URL: http://svn.freebsd.org/changeset/base/240587 Log: Update usage() in comment section. Remove CVS_* variables in comments. MFC after: 1 week X-MFC-With: r240586 Modified: head/release/generate-release.sh Modified: head/release/generate-release.sh ============================================================================== --- head/release/generate-release.sh Mon Sep 17 02:23:03 2012 (r240586) +++ head/release/generate-release.sh Mon Sep 17 02:35:00 2012 (r240587) @@ -3,14 +3,10 @@ # generate-release.sh: check out source trees, and build release components with # totally clean, fresh trees. # -# Usage: generate-release.sh [-r revision] svn-branch scratch-dir +# Usage: generate-release.sh [-r revision] [-d docrevision] \ +# [-p portsrevision] svn-branch scratch-dir # # Environment variables: -# CVSUP_HOST: Host of a cvsup server to obtain the ports and documentation -# trees. This or CVSROOT must be set to include ports and documentation. -# CVSROOT: CVS root to obtain the ports and documentation trees. This or -# CVSUP_HOST must be set to include ports and documentation. -# CVS_TAG: CVS tag for ports and documentation (HEAD by default) # SVNROOT: SVN URL to FreeBSD source repository (by default, # svn://svn.freebsd.org/base) # MAKE_FLAGS: optional flags to pass to make (e.g. -j) From owner-svn-src-all@FreeBSD.ORG Mon Sep 17 02:45:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8A840106564A; Mon, 17 Sep 2012 02:45:53 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3A7458FC08; Mon, 17 Sep 2012 02:45:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8H2jrJQ032513; Mon, 17 Sep 2012 02:45:53 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8H2jrdK032511; Mon, 17 Sep 2012 02:45:53 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201209170245.q8H2jrdK032511@svn.freebsd.org> From: Glen Barber Date: Mon, 17 Sep 2012 02:45:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240588 - head/share/man/man7 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2012 02:45:53 -0000 Author: gjb (doc,ports committer) Date: Mon Sep 17 02:45:52 2012 New Revision: 240588 URL: http://svn.freebsd.org/changeset/base/240588 Log: Update release(7) to reflect changes from r240586 and r240587: - Remove cvs(1) references. - Remove CVS* environment references. - Add default entries for the default SVNROOT for the Ports Collection, and Documentation Project. - While here, update 'SGML-based documentation' to 'XML-based', since the recent SGML->XML conversion. - Update an example providing SVNROOT environment usage. Reminded by: nwhitehorn MFC After: 1 week X-MFC-With: r240586, r240587 Modified: head/share/man/man7/release.7 Modified: head/share/man/man7/release.7 ============================================================================== --- head/share/man/man7/release.7 Mon Sep 17 02:35:00 2012 (r240587) +++ head/share/man/man7/release.7 Mon Sep 17 02:45:52 2012 (r240588) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 14, 2012 +.Dd September 16, 2012 .Dt RELEASE 7 .Os .Sh NAME @@ -105,11 +105,7 @@ environment in It then checks out the src tree specified by .Ar svn-branch using -.Xr svn 1 -and (optionally) the ports and documentation trees using -.Xr csup 1 -or -.Xr cvs 1 . +.Xr svn 1 . Once the various source trees have been obtained, it executes .Dq Li "make release" within the @@ -122,33 +118,19 @@ release media. .Pp Environment variables: .Bl -tag -width ".Cm MAKE_FLAGS" -.It Ev CVSUP_HOST -The CVSUP server to use for the doc and ports trees. One of -.Ev CVSUP_HOST -or -.Ev CVSROOT -must be specified for ports and documentation to be included in the release. -.It Ev CVSROOT -The location of the -.Fx -CVS repository to use for the doc and ports trees. One of -.Ev CVSUP_HOST -or -.Ev CVSROOT -must be specified for ports and documentation to be included in the release. -.It Ev CVS_TAG -If the variable -.Ev CVS_TAG -is set, that tag will be used for CVS checkouts (doc and ports), otherwise -.Ic generate-release.sh -will use HEAD. .It Ev MAKE_FLAGS This environment variable can be set to pass flags (e.g. -j) to .Xr make 1 when invoked by the script. .It Ev SVNROOT -The location of the FreeBSD SVN source repository. Defaults to -.Pa svn://svn.freebsd.org/base . +The location of the FreeBSD SVN source, doc, and ports repositories. +Defaults to +.Pa svn://svn.freebsd.org/base +for the source tree, +.Pa svn://svn.freebsd.org/ports/head +for the Ports Collection, and +.Pa svn://svn.freebsd.org/doc/head +for the Documentation Project source. .It Ev RELSTRING Optional base name for generated media images (e.g. FreeBSD-9.0-RC2-amd64). Defaults to the output of @@ -246,7 +228,7 @@ If defined, the Ports Collection will be .It Va NOSRC If set, do not include system source code in the release. .It Va NODOC -If defined, the SGML-based documentation from the +If defined, the XML-based documentation from the .Fx Documentation Project will not be built. However, the @@ -317,7 +299,7 @@ The following sequence of commands can b in a clean environment, including ports and documentation: .Bd -literal -offset indent cd /usr/src/release -export CVSUP_HOST=cvsupN.freebsd.org +export SVNROOT=svn://svn.freebsd.org/base sh generate-release.sh head /local3/release .Ed .Pp @@ -326,7 +308,6 @@ After running these commands, all prepar directory. .Sh SEE ALSO .Xr cc 1 , -.Xr cvs 1 , .Xr install 1 , .Xr make 1 , .Xr svn 1 Pq Pa ports/devel/subversion-freebsd , @@ -376,7 +357,7 @@ was overhauled and the wrapper script introduced to support the introduction of a new installer. .Pp At near 1000 revisions spread over multiple branches, the -.Xr cvs 1 +.Xr svn 1 log of .Pa src/release/Makefile contains a vivid historical record of some From owner-svn-src-all@FreeBSD.ORG Mon Sep 17 02:49:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 90106106564A; Mon, 17 Sep 2012 02:49:03 +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 7BA438FC08; Mon, 17 Sep 2012 02:49:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8H2n3iV032943; Mon, 17 Sep 2012 02:49:03 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8H2n3o8032941; Mon, 17 Sep 2012 02:49:03 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201209170249.q8H2n3o8032941@svn.freebsd.org> From: Matt Jacob Date: Mon, 17 Sep 2012 02:49:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240589 - head/sys/dev/isp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2012 02:49:03 -0000 Author: mjacob Date: Mon Sep 17 02:49:02 2012 New Revision: 240589 URL: http://svn.freebsd.org/changeset/base/240589 Log: Add some edits to the changed comments so that they make more sense. MFC after: 1 day Modified: head/sys/dev/isp/isp_freebsd.c Modified: head/sys/dev/isp/isp_freebsd.c ============================================================================== --- head/sys/dev/isp/isp_freebsd.c Mon Sep 17 02:45:52 2012 (r240588) +++ head/sys/dev/isp/isp_freebsd.c Mon Sep 17 02:49:02 2012 (r240589) @@ -1735,10 +1735,10 @@ isp_target_start_ctio(ispsoftc_t *isp, u /* * Mode 1, status, no data. Only possible when we are sending status, have - * no data to transfer, and any sense length can fit in the ct7_entry. + * no data to transfer, and any sense data can fit in the ct7_entry. * - * Mode 2, status, no data. We have to use this in the case sense data - * won't fit into a ct7_entry_t. + * Mode 2, status, no data. We have to use this in the case that + * the sense data won't fit into a ct7_entry_t. * */ if (sendstatus && xfrlen == 0) { From owner-svn-src-all@FreeBSD.ORG Mon Sep 17 02:50:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 131C31065672; Mon, 17 Sep 2012 02:50:17 +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 F37188FC16; Mon, 17 Sep 2012 02:50:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8H2oGPd033209; Mon, 17 Sep 2012 02:50:16 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8H2oGlb033206; Mon, 17 Sep 2012 02:50:16 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201209170250.q8H2oGlb033206@svn.freebsd.org> From: Matt Jacob Date: Mon, 17 Sep 2012 02:50:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240590 - head/sys/dev/isp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2012 02:50:17 -0000 Author: mjacob Date: Mon Sep 17 02:50:16 2012 New Revision: 240590 URL: http://svn.freebsd.org/changeset/base/240590 Log: Minor correction. MFC after: 1 day Modified: head/sys/dev/isp/isp_freebsd.c Modified: head/sys/dev/isp/isp_freebsd.c ============================================================================== --- head/sys/dev/isp/isp_freebsd.c Mon Sep 17 02:49:02 2012 (r240589) +++ head/sys/dev/isp/isp_freebsd.c Mon Sep 17 02:50:16 2012 (r240590) @@ -1735,7 +1735,7 @@ isp_target_start_ctio(ispsoftc_t *isp, u /* * Mode 1, status, no data. Only possible when we are sending status, have - * no data to transfer, and any sense data can fit in the ct7_entry. + * no data to transfer, and any sense data can fit into a ct7_entry_t. * * Mode 2, status, no data. We have to use this in the case that * the sense data won't fit into a ct7_entry_t. From owner-svn-src-all@FreeBSD.ORG Mon Sep 17 03:17:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 54011106566B; Mon, 17 Sep 2012 03:17:43 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3F7B48FC14; Mon, 17 Sep 2012 03:17:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8H3HhAN037195; Mon, 17 Sep 2012 03:17:43 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8H3HhX0037193; Mon, 17 Sep 2012 03:17:43 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201209170317.q8H3HhX0037193@svn.freebsd.org> From: Adrian Chadd Date: Mon, 17 Sep 2012 03:17:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240592 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2012 03:17:43 -0000 Author: adrian Date: Mon Sep 17 03:17:42 2012 New Revision: 240592 URL: http://svn.freebsd.org/changeset/base/240592 Log: Take credit for the work I've done in this source file. Modified: head/sys/dev/ath/if_ath_tx.c Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Mon Sep 17 03:12:42 2012 (r240591) +++ head/sys/dev/ath/if_ath_tx.c Mon Sep 17 03:17:42 2012 (r240592) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2002-2009 Sam Leffler, Errno Consulting + * Copyright (c) 2010-2012 Adrian Chadd, Xenion Pty Ltd * All rights reserved. * * Redistribution and use in source and binary forms, with or without From owner-svn-src-all@FreeBSD.ORG Mon Sep 17 07:14:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 17C88106564A; Mon, 17 Sep 2012 07:14:08 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ECF178FC08; Mon, 17 Sep 2012 07:14:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8H7E7Fd067508; Mon, 17 Sep 2012 07:14:07 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8H7E7SQ067505; Mon, 17 Sep 2012 07:14:07 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201209170714.q8H7E7SQ067505@svn.freebsd.org> From: Andrew Turner Date: Mon, 17 Sep 2012 07:14:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240594 - head/sys/boot/fdt/dts X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2012 07:14:08 -0000 Author: andrew Date: Mon Sep 17 07:14:07 2012 New Revision: 240594 URL: http://svn.freebsd.org/changeset/base/240594 Log: Add the Tegra2 DTS files. Now our dtc supports including other files use this support to pull out the SoC specific parts of the dts file. Added: head/sys/boot/fdt/dts/tegra20-paz00.dts (contents, props changed) head/sys/boot/fdt/dts/tegra20.dtsi (contents, props changed) Added: head/sys/boot/fdt/dts/tegra20-paz00.dts ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/tegra20-paz00.dts Mon Sep 17 07:14:07 2012 (r240594) @@ -0,0 +1,58 @@ +/*- + * Copyright (c) 2011 The FreeBSD Foundation + * Copyright (c) 2012 Andrew Turner + * All rights reserved. + * + * Developed by Damjan Marion + * + * 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$ + */ +/dts-v1/; + +/include/ "tegra20.dtsi" + +/ { + model = "Toshiba AC100 / Dynabook AZ"; + + aliases { + serial0 = &serial0; + soc = &SOC; + }; + + memory { + device_type = "memory"; + reg = < 0x00000000 0x20000000 >; /* 512MB RAM at 0x0 */ + }; + + chosen { + stdin = "serial0"; + stdout = "serial0"; + }; + + SOC: tegra20@0 { + serial0: serial@70006000 { + }; + }; +}; + Added: head/sys/boot/fdt/dts/tegra20.dtsi ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/tegra20.dtsi Mon Sep 17 07:14:07 2012 (r240594) @@ -0,0 +1,74 @@ +/*- + * Copyright (c) 2011 The FreeBSD Foundation + * Copyright (c) 2012 Andrew Turner + * All rights reserved. + * + * Developed by Damjan Marion + * + * 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$ + */ + +/ { + compatible = "compal,paz00", "nvidia,tegra20"; + #address-cells = <1>; + #size-cells = <1>; + interrupt-parent = <&GIC>; + + SOC: tegra20@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "simple-bus"; + ranges; + bus-frequency = <0>; + + GIC: interrupt-controller@50041000 { + compatible = "arm,gic"; + reg = < 0x50041000 0x1000 >, /* Distributor Registers */ + < 0x50040100 0x0100 >; /* CPU Interface Registers */ + interrupt-controller; + #interrupt-cells = <1>; + }; + + mp_tmr@50040200 { + compatible = "arm,mpcore-timers"; + clock-frequency = < 50040200 >; + #address-cells = <1>; + #size-cells = <0>; + reg = < 0x50040200 0x100 >, /* Global Timer Registers */ + < 0x50040600 0x100 >; /* Private Timer Registers */ + interrupts = < 27 29 >; + interrupt-parent = <&GIC>; + }; + + serial@70006000 { + compatible = "ns16550"; + reg = <0x70006000 0x40>; + reg-shift = <2>; + interrupts = < 68 >; + interrupt-parent = <&GIC>; + clock-frequency = < 215654400 >; + }; + }; +}; + From owner-svn-src-all@FreeBSD.ORG Mon Sep 17 07:32:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 554F81065672; Mon, 17 Sep 2012 07:32:54 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3F6858FC1E; Mon, 17 Sep 2012 07:32:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8H7Ws4H070016; Mon, 17 Sep 2012 07:32:54 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8H7Wsvr070014; Mon, 17 Sep 2012 07:32:54 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201209170732.q8H7Wsvr070014@svn.freebsd.org> From: Mikolaj Golub Date: Mon, 17 Sep 2012 07:32:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240595 - head/usr.sbin/bsnmpd/modules/snmp_hostres X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2012 07:32:54 -0000 Author: trociny Date: Mon Sep 17 07:32:53 2012 New Revision: 240595 URL: http://svn.freebsd.org/changeset/base/240595 Log: In snmp_hostres, device_map table is used for consistent device table indexing. When a device has gone it is not removed from device_map table but just its entry_p field is set to NULL. So when traversing device_map in disk_OS_get_ATA_disks() and disk_OS_get_MD_disks() check for entry_p being NULL, otherwise the bsnmpd crash is possible when a removed map entry is dereferenced. Before the fix, for disk_OS_get_ATA_disks() the crash could be easily reproduced running: atacontrol detach ata1 The crash was not observed in disk_OS_get_MD_disks() because currently snmp_hostres does no see md(4) disks: to get the device list it uses devinfo(3), which does not return md devices. Reported by: Miroslav Lachman 000.fbsd quip.cz MFC after: 1 week Modified: head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_diskstorage_tbl.c Modified: head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_diskstorage_tbl.c ============================================================================== --- head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_diskstorage_tbl.c Mon Sep 17 07:14:07 2012 (r240594) +++ head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_diskstorage_tbl.c Mon Sep 17 07:32:53 2012 (r240595) @@ -287,6 +287,9 @@ disk_OS_get_ATA_disks(void) /* Walk over the device table looking for ata disks */ STAILQ_FOREACH(map, &device_map, link) { + /* Skip deleted entries. */ + if (map->entry_p == NULL) + continue; for (found = lookup; found->media != DSM_UNKNOWN; found++) { if (strncmp(map->name_key, found->dev_name, strlen(found->dev_name)) != 0) @@ -345,6 +348,9 @@ disk_OS_get_MD_disks(void) /* Look for md devices */ STAILQ_FOREACH(map, &device_map, link) { + /* Skip deleted entries. */ + if (map->entry_p == NULL) + continue; if (sscanf(map->name_key, "md%d", &unit) != 1) continue; From owner-svn-src-all@FreeBSD.ORG Mon Sep 17 07:46:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 34988106566C; Mon, 17 Sep 2012 07:46:45 +0000 (UTC) (envelope-from gber@freebsd.org) Received: from smtp.semihalf.com (smtp.semihalf.com [213.17.239.109]) by mx1.freebsd.org (Postfix) with ESMTP id D1B408FC12; Mon, 17 Sep 2012 07:46:44 +0000 (UTC) Received: from localhost (unknown [213.17.239.109]) by smtp.semihalf.com (Postfix) with ESMTP id 2D0FB119C09; Mon, 17 Sep 2012 09:46:38 +0200 (CEST) X-Virus-Scanned: by amavisd-new at semihalf.com Received: from smtp.semihalf.com ([213.17.239.109]) by localhost (smtp.semihalf.com [213.17.239.109]) (amavisd-new, port 10024) with ESMTP id PIz3S5hI7BtK; Mon, 17 Sep 2012 09:46:37 +0200 (CEST) Received: from [10.0.0.93] (cardhu.semihalf.com [213.17.239.108]) by smtp.semihalf.com (Postfix) with ESMTPSA id 76BEA119C00; Mon, 17 Sep 2012 09:46:37 +0200 (CEST) Message-ID: <5056F10C.9000602@freebsd.org> Date: Mon, 17 Sep 2012 11:44:44 +0200 From: Grzegorz Bernacki User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.24) Gecko/20120127 Thunderbird/3.1.16 MIME-Version: 1.0 To: Aleksandr Rybalko References: <201209140933.q8E9XZnd088621@svn.freebsd.org> <20120914171652.780e25c6.ray@freebsd.org> <50535E29.2030102@freebsd.org> <20120916022702.055cb08b.ray@freebsd.org> In-Reply-To: <20120916022702.055cb08b.ray@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r240484 - head/sys/dev/fdt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2012 07:46:45 -0000 On 09/16/12 01:27, Aleksandr Rybalko wrote: > On Fri, 14 Sep 2012 18:41:13 +0200 > Grzegorz Bernacki wrote: > >> On 09/14/12 16:16, Aleksandr Rybalko wrote: >>> On Fri, 14 Sep 2012 09:33:35 +0000 (UTC) >>> Grzegorz Bernacki wrote: >>> >>>> Author: gber >>>> Date: Fri Sep 14 09:33:35 2012 >>>> New Revision: 240484 >>>> URL: http://svn.freebsd.org/changeset/base/240484 >>>> >>>> Log: >>>> Set busaddr and bussize to 0 when fdt_get_range() fails. >>> >>> Why bussize is 0? >> >> I though that setting it to 0 makes sense, since we do not use >> this variable in this function and setting it to some value could be >> confused. I could skip setting it, but I also thought it could cause >> confusion :). If you think that setting it to other value or remove >> it will be better please let me know and I will change it. >> >> thanks >> grzesiek > > Yeah, indeed, false alarm. Sorry for noise. > > But it will be very nice to hear developers opinion about ePAPR1.1 row > (about "range" property): > "If the property is not present in a bus node, it is assumed that no > mapping exists between children of the node and the parent address > space." > > Assuming since in most cases root node have no "ranges" property, but > his child "SOC" have that property with defaults (0x0 x 0xffffffff). > So nodes which have property "ranges" or not, must be processed same > way. Right? > > WBW Hi, I am not quite sure that I understand your question. What nodes are you referring to and what to you mean by processing them the same way? regards, grzesiek From owner-svn-src-all@FreeBSD.ORG Mon Sep 17 08:03:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7CBF1106564A; Mon, 17 Sep 2012 08:03:07 +0000 (UTC) (envelope-from bawitabooks@gmail.com) Received: from mail-ob0-f186.google.com (mail-ob0-f186.google.com [209.85.214.186]) by mx1.freebsd.org (Postfix) with ESMTP id C68F18FC08; Mon, 17 Sep 2012 08:03:06 +0000 (UTC) Received: by obbta17 with SMTP id ta17so5002999obb.13 for ; Mon, 17 Sep 2012 01:03:06 -0700 (PDT) Received: by 10.236.201.134 with SMTP id b6mr1570298yho.15.1347868986296; Mon, 17 Sep 2012 01:03:06 -0700 (PDT) X-Google-Doc-Id: b02296497a1e81be X-Google-Web-Client: true Date: Mon, 17 Sep 2012 01:03:05 -0700 (PDT) From: John Rumbaugh To: bsdmailinglist@googlegroups.com Message-Id: <6190ae24-a88a-41f7-8998-aad48184985c@googlegroups.com> In-Reply-To: <201209170732.q8H7Wsvr070014@svn.freebsd.org> References: <201209170732.q8H7Wsvr070014@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_197_16140277.1347868985469" X-Google-IP: 75.171.18.210 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: svn-src-head@freebsd.org, trociny@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r240595 - head/usr.sbin/bsnmpd/modules/snmp_hostres X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2012 08:03:07 -0000 ------=_Part_197_16140277.1347868985469 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit http://www.chumleaf.com On Monday, September 17, 2012 12:34:10 AM UTC-7, Mikolaj Golub wrote: > > Author: trociny > Date: Mon Sep 17 07:32:53 2012 > New Revision: 240595 > URL: http://svn.freebsd.org/changeset/base/240595 > > Log: > In snmp_hostres, device_map table is used for consistent device table > indexing. When a device has gone it is not removed from device_map > table but just its entry_p field is set to NULL. > > So when traversing device_map in disk_OS_get_ATA_disks() and > disk_OS_get_MD_disks() check for entry_p being NULL, otherwise the > bsnmpd crash is possible when a removed map entry is dereferenced. > > Before the fix, for disk_OS_get_ATA_disks() the crash could be easily > reproduced running: > > atacontrol detach ata1 > > The crash was not observed in disk_OS_get_MD_disks() because currently > snmp_hostres does no see md(4) disks: to get the device list it uses > devinfo(3), which does not return md devices. > > Reported by: Miroslav Lachman 000.fbsd quip.cz > MFC after: 1 week > > Modified: > head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_diskstorage_tbl.c > > Modified: > head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_diskstorage_tbl.c > ============================================================================== > > --- > head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_diskstorage_tbl.c Mon > Sep 17 07:14:07 2012 (r240594) > +++ > head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_diskstorage_tbl.c Mon > Sep 17 07:32:53 2012 (r240595) > @@ -287,6 +287,9 @@ disk_OS_get_ATA_disks(void) > > /* Walk over the device table looking for ata disks */ > STAILQ_FOREACH(map, &device_map, link) { > + /* Skip deleted entries. */ > + if (map->entry_p == NULL) > + continue; > for (found = lookup; found->media != DSM_UNKNOWN; > found++) { > if (strncmp(map->name_key, found->dev_name, > strlen(found->dev_name)) != 0) > @@ -345,6 +348,9 @@ disk_OS_get_MD_disks(void) > > /* Look for md devices */ > STAILQ_FOREACH(map, &device_map, link) { > + /* Skip deleted entries. */ > + if (map->entry_p == NULL) > + continue; > if (sscanf(map->name_key, "md%d", &unit) != 1) > continue; > > _______________________________________________ > svn-s...@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all...@freebsd.org " > > ------=_Part_197_16140277.1347868985469-- From owner-svn-src-all@FreeBSD.ORG Mon Sep 17 09:22:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D15781065670; Mon, 17 Sep 2012 09:22:59 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A2F428FC14; Mon, 17 Sep 2012 09:22:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8H9MxNa085623; Mon, 17 Sep 2012 09:22:59 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8H9MxIw085621; Mon, 17 Sep 2012 09:22:59 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201209170922.q8H9MxIw085621@svn.freebsd.org> From: Andrew Turner Date: Mon, 17 Sep 2012 09:22:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240596 - head/sys/arm/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2012 09:22:59 -0000 Author: andrew Date: Mon Sep 17 09:22:59 2012 New Revision: 240596 URL: http://svn.freebsd.org/changeset/base/240596 Log: Add a kernel config for the Toshiba AC100. The AC100 is an ARM laptop with an NVidia Tegra 2 CPU. Tegra 2 needs an external patch to pmap for atomic operations to work. Even with this the Kernel only gets to the mount root prompt. As such Tegra support is considered experimental, however adding the kernel config will help ensure the Tegra code builds. Added: head/sys/arm/conf/AC100 (contents, props changed) Added: head/sys/arm/conf/AC100 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/conf/AC100 Mon Sep 17 09:22:59 2012 (r240596) @@ -0,0 +1,96 @@ +# +# Custom kernel for Toshiba AC100 +# +# $FreeBSD$ +# + +ident AC100 +include "../tegra/std.tegra2" + +makeoptions MODULES_OVERRIDE="" + +makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols +makeoptions WERROR="-Werror" + +#options SCHED_ULE #ULE scheduler +options SCHED_4BSD #4BSD scheduler +options INET #InterNETworking +#options INET6 #IPv6 communications protocols +options FFS #Berkeley Fast Filesystem +#options NFSCL #Network Filesystem Client +#options NFSLOCKD #Network Lock Manager +#options NFS_ROOT #NFS usable as /, requires NFSCLIENT +#options BOOTP +#options BOOTP_NFSROOT +#options BOOTP_NFSV3 +#options BOOTP_WIRED_TO=mge0 + +options GEOM_PART_GPT +options ROOTDEVNAME=\"ufs:/dev/da0p1\" + +options SYSVSHM #SYSV-style shared memory +options SYSVMSG #SYSV-style message queues +options SYSVSEM #SYSV-style semaphores +options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions +options MUTEX_NOINLINE +options RWLOCK_NOINLINE +options NO_FFS_SNAPSHOT +options NO_SWAPPING + +#options SMP + +# Debugging +options VERBOSE_SYSINIT +#options ALT_BREAK_TO_DEBUGGER +options DDB +options GDB +options DIAGNOSTIC +options INVARIANTS #Enable calls of extra sanity checking +options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS +options KDB +options KDB_TRACE +#options KTR +#options KTR_VERBOSE=0 +#options KTR_ENTRIES=16384 +#options KTR_MASK=(KTR_SPARE2) +#options KTR_COMPILE=KTR_ALL +options WITNESS #Enable checks to detect deadlocks and cycles +options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed +#options WITNESS_KDB +options MUTEX_DEBUG + +# Pseudo devices +device random +device pty +device loop +device md + +# USB +#options USB_DEBUG # enable debug msgs +#device usb +#device ehci +#device umass +#device scbus +#device pass +#device da + +# SATA +#device ata +#device atadisk +#device mvs + +# Serial ports +device uart + +# I2C (TWSI) +#device iic +#device iicbus + +#Network +device ether + +#FDT +options FDT +options FDT_DTB_STATIC +makeoptions FDT_DTS_FILE=tegra20-paz00.dts + From owner-svn-src-all@FreeBSD.ORG Mon Sep 17 09:32:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E1D1E106564A; Mon, 17 Sep 2012 09:32:11 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CCFC08FC0C; Mon, 17 Sep 2012 09:32:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8H9WBGn087076; Mon, 17 Sep 2012 09:32:11 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8H9WB45087074; Mon, 17 Sep 2012 09:32:11 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201209170932.q8H9WB45087074@svn.freebsd.org> From: Kevin Lo Date: Mon, 17 Sep 2012 09:32:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240597 - head/sys/dev/usb/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2012 09:32:12 -0000 Author: kevlo Date: Mon Sep 17 09:32:11 2012 New Revision: 240597 URL: http://svn.freebsd.org/changeset/base/240597 Log: Remove unused variable cd. This variable is initialized but not used. Modified: head/sys/dev/usb/net/uhso.c Modified: head/sys/dev/usb/net/uhso.c ============================================================================== --- head/sys/dev/usb/net/uhso.c Mon Sep 17 09:22:59 2012 (r240596) +++ head/sys/dev/usb/net/uhso.c Mon Sep 17 09:32:11 2012 (r240597) @@ -540,7 +540,6 @@ uhso_attach(device_t self) { struct uhso_softc *sc = device_get_softc(self); struct usb_attach_arg *uaa = device_get_ivars(self); - struct usb_config_descriptor *cd; struct usb_interface_descriptor *id; struct sysctl_ctx_list *sctx; struct sysctl_oid *soid; @@ -561,7 +560,6 @@ uhso_attach(device_t self) sc->sc_ttys = 0; sc->sc_radio = 1; - cd = usbd_get_config_descriptor(uaa->device); id = usbd_get_interface_descriptor(uaa->iface); sc->sc_ctrl_iface_no = id->bInterfaceNumber; From owner-svn-src-all@FreeBSD.ORG Mon Sep 17 11:21:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 89EF1106564A; Mon, 17 Sep 2012 11:21:57 +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 7472C8FC12; Mon, 17 Sep 2012 11:21:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8HBLvjC004139; Mon, 17 Sep 2012 11:21:57 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8HBLviY004137; Mon, 17 Sep 2012 11:21:57 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201209171121.q8HBLviY004137@svn.freebsd.org> From: Edward Tomasz Napierala Date: Mon, 17 Sep 2012 11:21:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240598 - stable/9/bin/setfacl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2012 11:21:57 -0000 Author: trasz Date: Mon Sep 17 11:21:57 2012 New Revision: 240598 URL: http://svn.freebsd.org/changeset/base/240598 Log: MFC r240076: Fix compact form of "synchronize" permission in setfacl(1) manual page - it should be "s", not "S". PR: docs/162380 Modified: stable/9/bin/setfacl/setfacl.1 Directory Properties: stable/9/bin/setfacl/ (props changed) Modified: stable/9/bin/setfacl/setfacl.1 ============================================================================== --- stable/9/bin/setfacl/setfacl.1 Mon Sep 17 09:32:11 2012 (r240597) +++ stable/9/bin/setfacl/setfacl.1 Mon Sep 17 11:21:57 2012 (r240598) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 9, 2011 +.Dd September 2, 2012 .Dt SETFACL 1 .Os .Sh NAME @@ -337,7 +337,7 @@ read_acl write_acl .It o write_owner -.It S +.It s synchronize .El .Pp From owner-svn-src-all@FreeBSD.ORG Mon Sep 17 11:27:56 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AEC551065677; Mon, 17 Sep 2012 11:27:56 +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 994FC8FC1C; Mon, 17 Sep 2012 11:27:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8HBRuFn004991; Mon, 17 Sep 2012 11:27:56 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8HBRunu004989; Mon, 17 Sep 2012 11:27:56 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201209171127.q8HBRunu004989@svn.freebsd.org> From: Edward Tomasz Napierala Date: Mon, 17 Sep 2012 11:27:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240599 - stable/9/usr.bin/rctl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2012 11:27:56 -0000 Author: trasz Date: Mon Sep 17 11:27:56 2012 New Revision: 240599 URL: http://svn.freebsd.org/changeset/base/240599 Log: MFC r232329: Use proper "maxproc" name, not "nproc". PR: docs/162172 Modified: stable/9/usr.bin/rctl/rctl.8 Directory Properties: stable/9/usr.bin/rctl/ (props changed) Modified: stable/9/usr.bin/rctl/rctl.8 ============================================================================== --- stable/9/usr.bin/rctl/rctl.8 Mon Sep 17 11:21:57 2012 (r240598) +++ stable/9/usr.bin/rctl/rctl.8 Mon Sep 17 11:27:56 2012 (r240599) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 22, 2011 +.Dd March 1, 2012 .Dt RCTL 8 .Os .Sh NAME @@ -117,8 +117,8 @@ A filter is a rule for which one of more For example, a filter that matches every rule could be written as ":::=/", or, in short, ":". A filter that matches all the login classes would be "loginclass:". -A filter that matches all defined rules for nproc resource would be -"::nproc". +A filter that matches all defined rules for maxproc resource would be +"::maxproc". .Pp .Sh RESOURCES .Bl -column -offset 3n "pseudoterminals" From owner-svn-src-all@FreeBSD.ORG Mon Sep 17 11:35:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1BCCF1065670; Mon, 17 Sep 2012 11:35:39 +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 061408FC08; Mon, 17 Sep 2012 11:35:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8HBZcRV006098; Mon, 17 Sep 2012 11:35:38 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8HBZcp7006096; Mon, 17 Sep 2012 11:35:38 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201209171135.q8HBZcp7006096@svn.freebsd.org> From: Edward Tomasz Napierala Date: Mon, 17 Sep 2012 11:35:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240600 - stable/9/usr.bin/rctl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2012 11:35:39 -0000 Author: trasz Date: Mon Sep 17 11:35:38 2012 New Revision: 240600 URL: http://svn.freebsd.org/changeset/base/240600 Log: MFC r233456 by joel@: Remove superfluous paragraph macro. MFC r233665 by joel@: mandoc complains loudly when s are misused in columnated lists. Fix this syntax violation and while I'm here also convert to Ta and adjust quotation marks in order to prevent this problem in the future. MFC r233667 by joel@: Remove superfluous paragraph macro. MFC r234568 by delphij@: The .Fx macro needs the version number be in its own word separated by a space. This change have no visible effect for rendering. Modified: stable/9/usr.bin/rctl/rctl.8 Directory Properties: stable/9/usr.bin/rctl/ (props changed) Modified: stable/9/usr.bin/rctl/rctl.8 ============================================================================== --- stable/9/usr.bin/rctl/rctl.8 Mon Sep 17 11:27:56 2012 (r240599) +++ stable/9/usr.bin/rctl/rctl.8 Mon Sep 17 11:35:38 2012 (r240600) @@ -119,36 +119,34 @@ or, in short, ":". A filter that matches all the login classes would be "loginclass:". A filter that matches all defined rules for maxproc resource would be "::maxproc". -.Pp .Sh RESOURCES .Bl -column -offset 3n "pseudoterminals" -.It "cputime CPU time, in seconds" -.It "datasize data size, in bytes" -.It "stacksize stack size, in bytes" -.It "coredumpsize core dump size, in bytes" -.It "memoryuse resident set size, in bytes" -.It "memorylocked locked memory, in bytes" -.It "maxproc number of processes" -.It "openfiles file descriptor table size" -.It "vmemoryuse address space limit, in bytes" -.It "pseudoterminals number of PTYs" -.It "swapuse swap usage, in bytes" -.It "nthr number of threads" -.It "msgqqueued number of queued SysV messages" -.It "msgqsize SysV message queue size, in bytes" -.It "nmsgq number of SysV message queues" -.It "nsem number of SysV semaphores" -.It "nsemop number of SysV semaphores modified in a single semop(2) call" -.It "nshm number of SysV shared memory segments" -.It "shmsize SysV shared memory size, in bytes" -.It "wallclock wallclock time, in seconds" +.It cputime Ta "CPU time, in seconds" +.It datasize Ta "data size, in bytes" +.It stacksize Ta "stack size, in bytes" +.It coredumpsize Ta "core dump size, in bytes" +.It memoryuse Ta "resident set size, in bytes" +.It memorylocked Ta "locked memory, in bytes" +.It maxproc Ta "number of processes" +.It openfiles Ta "file descriptor table size" +.It vmemoryuse Ta "address space limit, in bytes" +.It pseudoterminals Ta "number of PTYs" +.It swapuse Ta "swap usage, in bytes" +.It nthr Ta "number of threads" +.It msgqqueued Ta "number of queued SysV messages" +.It msgqsize Ta "SysV message queue size, in bytes" +.It nmsgq Ta "number of SysV message queues" +.It nsem Ta "number of SysV semaphores" +.It nsemop Ta "number of SysV semaphores modified in a single semop(2) call" +.It nshm Ta "number of SysV shared memory segments" +.It shmsize Ta "SysV shared memory size, in bytes" +.It wallclock Ta "wallclock time, in seconds" .El -.Pp .Sh ACTIONS .Bl -column -offset 3n "pseudoterminals" -.It "deny deny the allocation; not supported for cpu and wallclock" -.It "log log a warning to the console" -.It "devctl send notification to" +.It deny Ta "deny the allocation; not supported for cpu and wallclock" +.It log Ta "log a warning to the console" +.It devctl Ta "send notification to" .Xr devd 8 .It "sig* e.g. sigterm; send a signal to the offending process" .El @@ -162,7 +160,6 @@ Attempt to add rule with action not supp in error. .Pp Note that limiting RSS may kill the machine due to thrashing. -.Pp .Sh EXIT STATUS .Ex -std .Sh EXAMPLES @@ -189,7 +186,7 @@ Display all the rules applicable to proc The .Nm command appeared in -.Fx 9.0. +.Fx 9.0 . .Sh AUTHORS .An -nosplit The From owner-svn-src-all@FreeBSD.ORG Mon Sep 17 11:39:28 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A27321065702; Mon, 17 Sep 2012 11:39:28 +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 8CCEA8FC16; Mon, 17 Sep 2012 11:39:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8HBdSVw006642; Mon, 17 Sep 2012 11:39:28 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8HBdS4r006640; Mon, 17 Sep 2012 11:39:28 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201209171139.q8HBdS4r006640@svn.freebsd.org> From: Edward Tomasz Napierala Date: Mon, 17 Sep 2012 11:39:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240601 - stable/9/usr.bin/rctl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2012 11:39:28 -0000 Author: trasz Date: Mon Sep 17 11:39:28 2012 New Revision: 240601 URL: http://svn.freebsd.org/changeset/base/240601 Log: MFC r239990: Improve description for "rctl -l". Modified: stable/9/usr.bin/rctl/rctl.8 Directory Properties: stable/9/usr.bin/rctl/ (props changed) Modified: stable/9/usr.bin/rctl/rctl.8 ============================================================================== --- stable/9/usr.bin/rctl/rctl.8 Mon Sep 17 11:35:38 2012 (r240600) +++ stable/9/usr.bin/rctl/rctl.8 Mon Sep 17 11:39:28 2012 (r240601) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 1, 2012 +.Dd September 1, 2012 .Dt RCTL 8 .Os .Sh NAME @@ -68,6 +68,10 @@ to the RCTL database. .It Fl l Ar filter Display rules applicable to the process defined by .Ar filter . +Note that this is different from showing the rules when called without +any options, as it shows not just the rules with subject equal to that +of process, but also rules for the user, jail, and login class applicable +to the process. .It Fl r Ar filter Remove rules matching .Ar filter @@ -90,7 +94,8 @@ Subject defines the kind of entity the r It can be either process, user, login class, or jail. .Pp Subject ID identifies the subject. -It can be user name, numerical user ID, login class name, or jail name. +It can be a process ID, user name, numerical user ID, login class name, +or jail name. .Pp Resource identifies the resource the rule controls. .Pp From owner-svn-src-all@FreeBSD.ORG Mon Sep 17 12:51:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1883C1065687; Mon, 17 Sep 2012 12:51:49 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 044098FC0A; Mon, 17 Sep 2012 12:51:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8HCpmpO017783; Mon, 17 Sep 2012 12:51:48 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8HCpmwT017781; Mon, 17 Sep 2012 12:51:48 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201209171251.q8HCpmwT017781@svn.freebsd.org> From: Gavin Atkinson Date: Mon, 17 Sep 2012 12:51:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240602 - head/sys/dev/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2012 12:51:49 -0000 Author: gavin Date: Mon Sep 17 12:51:48 2012 New Revision: 240602 URL: http://svn.freebsd.org/changeset/base/240602 Log: - Add #defines for the bits within the iPCI Express PCIR_EXPRESS_LINK_CTL register - Add missing register PCIR_EXPRESS_ROOT_CAP - Correct a spelling mistake (SLAT -> SLOT) [1] Reviewed by: jhb [1] Modified: head/sys/dev/pci/pcireg.h Modified: head/sys/dev/pci/pcireg.h ============================================================================== --- head/sys/dev/pci/pcireg.h Mon Sep 17 11:39:28 2012 (r240601) +++ head/sys/dev/pci/pcireg.h Mon Sep 17 12:51:48 2012 (r240602) @@ -687,6 +687,19 @@ #define PCIM_LINK_CAP_ASPM_COMPLIANCE 0x00400000 #define PCIM_LINK_CAP_PORT 0xff000000 #define PCIR_EXPRESS_LINK_CTL 0x10 +#define PCIM_EXP_LINK_CTL_ASPMC_DIS 0x0000 +#define PCIM_EXP_LINK_CTL_ASPMC_L0S 0x0001 +#define PCIM_EXP_LINK_CTL_ASPMC_L1 0x0002 +#define PCIM_EXP_LINK_CTL_ASPMC 0x0003 +#define PCIM_EXP_LINK_CTL_RCB 0x0008 +#define PCIM_EXP_LINK_CTL_LINK_DIS 0x0010 +#define PCIM_EXP_LINK_CTL_RETRAIN_LINK 0x0020 +#define PCIM_EXP_LINK_CTL_COMMON_CLOCK 0x0040 +#define PCIM_EXP_LINK_CTL_EXTENDED_SYNC 0x0080 +#define PCIM_EXP_LINK_CTL_ECPM 0x0100 +#define PCIM_EXP_LINK_CTL_HAWD 0x0200 +#define PCIM_EXP_LINK_CTL_LBMIE 0x0400 +#define PCIM_EXP_LINK_CTL_LABIE 0x0800 #define PCIR_EXPRESS_LINK_STA 0x12 #define PCIM_LINK_STA_SPEED 0x000f #define PCIM_LINK_STA_WIDTH 0x03f0 @@ -732,6 +745,7 @@ #define PCIM_EXP_SLOT_STA_EIS 0x0080 #define PCIM_EXP_SLOT_STA_DLLSC 0x0100 #define PCIR_EXPRESS_ROOT_CTL 0x1c +#define PCIR_EXPRESS_ROOT_CAP 0x1e #define PCIR_EXPRESS_ROOT_STA 0x20 #define PCIR_EXPRESS_DEVICE_CAP2 0x24 #define PCIR_EXPRESS_DEVICE_CTL2 0x28 @@ -753,7 +767,7 @@ #define PCIR_EXPRESS_LINK_CAP2 0x2c #define PCIR_EXPRESS_LINK_CTL2 0x30 #define PCIR_EXPRESS_LINK_STA2 0x32 -#define PCIR_EXPRESS_SLAT_CAP2 0x34 +#define PCIR_EXPRESS_SLOT_CAP2 0x34 #define PCIR_EXPRESS_SLOT_CTL2 0x38 #define PCIR_EXPRESS_SLOT_STA2 0x3a From owner-svn-src-all@FreeBSD.ORG Mon Sep 17 13:05:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C87AF106564A; Mon, 17 Sep 2012 13:05:39 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 951358FC0C; Mon, 17 Sep 2012 13:05:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8HD5d5l020505; Mon, 17 Sep 2012 13:05:39 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8HD5d9F020502; Mon, 17 Sep 2012 13:05:39 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201209171305.q8HD5d9F020502@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 17 Sep 2012 13:05:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240603 - stable/9/lib/libc/locale X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2012 13:05:39 -0000 Author: glebius Date: Mon Sep 17 13:05:39 2012 New Revision: 240603 URL: http://svn.freebsd.org/changeset/base/240603 Log: Merge r238182 by theraven@: Restore the __collate_load_error global that was accidentally removed in the xlocale refactoring. Modified: stable/9/lib/libc/locale/collate.c stable/9/lib/libc/locale/setrunelocale.c Directory Properties: stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/locale/collate.c ============================================================================== --- stable/9/lib/libc/locale/collate.c Mon Sep 17 12:51:48 2012 (r240602) +++ stable/9/lib/libc/locale/collate.c Mon Sep 17 13:05:39 2012 (r240603) @@ -56,11 +56,11 @@ __FBSDID("$FreeBSD$"); * We also modify the collation table test functions to search the thread-local * table first and the global table second. */ -#define __collate_load_error (table->__collate_load_error) #define __collate_substitute_nontrivial (table->__collate_substitute_nontrivial) #define __collate_substitute_table_ptr (table->__collate_substitute_table_ptr) #define __collate_char_pri_table_ptr (table->__collate_char_pri_table_ptr) #define __collate_chain_pri_table (table->__collate_chain_pri_table) +int __collate_load_error; struct xlocale_collate __xlocale_global_collate = { @@ -109,7 +109,9 @@ __collate_load(const char *encoding, loc int __collate_load_tables(const char *encoding) { - return __collate_load_tables_l(encoding, &__xlocale_global_collate); + int ret = __collate_load_tables_l(encoding, &__xlocale_global_collate); + __collate_load_error = __xlocale_global_collate.__collate_load_error; + return ret; } int @@ -123,7 +125,7 @@ __collate_load_tables_l(const char *enco /* 'encoding' must be already checked. */ if (strcmp(encoding, "C") == 0 || strcmp(encoding, "POSIX") == 0) { - __collate_load_error = 1; + table->__collate_load_error = 1; return (_LDP_CACHE); } @@ -240,7 +242,7 @@ __collate_load_tables_l(const char *enco break; } } - __collate_load_error = 0; + table->__collate_load_error = 0; return (_LDP_LOADED); } Modified: stable/9/lib/libc/locale/setrunelocale.c ============================================================================== --- stable/9/lib/libc/locale/setrunelocale.c Mon Sep 17 12:51:48 2012 (r240602) +++ stable/9/lib/libc/locale/setrunelocale.c Mon Sep 17 13:05:39 2012 (r240603) @@ -67,7 +67,6 @@ extern _RuneLocale *_Read_RuneMagi(FILE static int __setrunelocale(struct xlocale_ctype *l, const char *); -#define __collate_load_error (table->__collate_load_error) #define __collate_substitute_nontrivial (table->__collate_substitute_nontrivial) #define __collate_substitute_table_ptr (table->__collate_substitute_table_ptr) #define __collate_char_pri_table_ptr (table->__collate_char_pri_table_ptr) From owner-svn-src-all@FreeBSD.ORG Mon Sep 17 13:06:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE705106566C; Mon, 17 Sep 2012 13:06:48 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8FCEC8FC17; Mon, 17 Sep 2012 13:06:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8HD6mPf020773; Mon, 17 Sep 2012 13:06:48 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8HD6mJJ020770; Mon, 17 Sep 2012 13:06:48 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201209171306.q8HD6mJJ020770@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 17 Sep 2012 13:06:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240604 - in stable/9/sys/geom: mirror raid3 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2012 13:06:48 -0000 Author: glebius Date: Mon Sep 17 13:06:47 2012 New Revision: 240604 URL: http://svn.freebsd.org/changeset/base/240604 Log: Merge r240371: When synchronizing, include in the config dump amount of bytes syncronized. The rationale behind this is the following: for large disks the percent synchronisation counter ticks too seldom, and monitoring software (as well as human operator) can't tell whether synchronisation goes on or one of disks got stuck. On an idle server one can look into gstat and see whether synchronisation goes on or not, but on a busy server that won't work. Also, new value monitored can be differentiated obtaining the synchronisation speed quite precisely. Submitted by: Konstantin Kukushkin Reviewed by: pjd Modified: stable/9/sys/geom/mirror/g_mirror.c stable/9/sys/geom/raid3/g_raid3.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/mirror/g_mirror.c ============================================================================== --- stable/9/sys/geom/mirror/g_mirror.c Mon Sep 17 13:05:39 2012 (r240603) +++ stable/9/sys/geom/mirror/g_mirror.c Mon Sep 17 13:06:47 2012 (r240604) @@ -3143,6 +3143,11 @@ g_mirror_dumpconf(struct sbuf *sb, const sc->sc_provider->mediasize)); } sbuf_printf(sb, "\n"); + if (disk->d_sync.ds_offset > 0) { + sbuf_printf(sb, "%s%jd" + "\n", indent, + (intmax_t)disk->d_sync.ds_offset); + } } sbuf_printf(sb, "%s%u\n", indent, disk->d_sync.ds_syncid); Modified: stable/9/sys/geom/raid3/g_raid3.c ============================================================================== --- stable/9/sys/geom/raid3/g_raid3.c Mon Sep 17 13:05:39 2012 (r240603) +++ stable/9/sys/geom/raid3/g_raid3.c Mon Sep 17 13:06:47 2012 (r240604) @@ -3447,6 +3447,11 @@ g_raid3_dumpconf(struct sbuf *sb, const (sc->sc_mediasize / (sc->sc_ndisks - 1)))); } sbuf_printf(sb, "\n"); + if (disk->d_sync.ds_offset > 0) { + sbuf_printf(sb, "%s%jd" + "\n", indent, + (intmax_t)disk->d_sync.ds_offset); + } } sbuf_printf(sb, "%s%u\n", indent, disk->d_sync.ds_syncid); From owner-svn-src-all@FreeBSD.ORG Mon Sep 17 13:36:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E71FC106564A; Mon, 17 Sep 2012 13:36:47 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D14758FC0C; Mon, 17 Sep 2012 13:36:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8HDalGM026656; Mon, 17 Sep 2012 13:36:47 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8HDalx3026645; Mon, 17 Sep 2012 13:36:47 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201209171336.q8HDalx3026645@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Mon, 17 Sep 2012 13:36:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240605 - head/usr.bin/systat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2012 13:36:48 -0000 Author: melifaro Date: Mon Sep 17 13:36:47 2012 New Revision: 240605 URL: http://svn.freebsd.org/changeset/base/240605 Log: Make systat(1) accept fractional number of seconds. Make old alarm(3)-based code use select(2). MFC after: 2 weeks Modified: head/usr.bin/systat/cmds.c head/usr.bin/systat/extern.h head/usr.bin/systat/icmp.c head/usr.bin/systat/icmp6.c head/usr.bin/systat/ip.c head/usr.bin/systat/ip6.c head/usr.bin/systat/keyboard.c head/usr.bin/systat/main.c head/usr.bin/systat/systat.1 head/usr.bin/systat/tcp.c Modified: head/usr.bin/systat/cmds.c ============================================================================== --- head/usr.bin/systat/cmds.c Mon Sep 17 13:06:47 2012 (r240604) +++ head/usr.bin/systat/cmds.c Mon Sep 17 13:36:47 2012 (r240605) @@ -35,6 +35,8 @@ __FBSDID("$FreeBSD$"); static const char sccsid[] = "@(#)cmds.c 8.2 (Berkeley) 4/29/95"; #endif +#include + #include #include #include @@ -49,10 +51,9 @@ command(const char *cmd) { struct cmdtab *p; char *cp, *tmpstr, *tmpstr1; - int interval, omask; + double t; tmpstr = tmpstr1 = strdup(cmd); - omask = sigblock(sigmask(SIGALRM)); for (cp = tmpstr1; *cp && !isspace(*cp); cp++) ; if (*cp) @@ -68,7 +69,7 @@ command(const char *cmd) goto done; } if (strcmp(tmpstr1, "stop") == 0) { - alarm(0); + delay = 0; mvaddstr(CMDLINE, 0, "Refresh disabled."); clrtoeol(); goto done; @@ -88,19 +89,23 @@ command(const char *cmd) clrtoeol(); goto done; } - interval = atoi(tmpstr1); - if (interval <= 0 && - (strcmp(tmpstr1, "start") == 0 || strcmp(tmpstr1, "interval") == 0)) { - interval = *cp ? atoi(cp) : naptime; - if (interval <= 0) { - error("%d: bad interval.", interval); - goto done; + t = strtod(tmpstr1, NULL) * 1000000.0; + if (t > 0 && t < (double)UINT_MAX) + delay = (unsigned int)t; + if ((t <= 0 || t > (double)UINT_MAX) && + (strcmp(tmpstr1, "start") == 0 || + strcmp(tmpstr1, "interval") == 0)) { + if (*cp != '\0') { + t = strtod(cp, NULL) * 1000000.0; + if (t <= 0 || t >= (double)UINT_MAX) { + error("%d: bad interval.", (int)t); + goto done; + } } } - if (interval > 0) { - alarm(0); - naptime = interval; - display(0); + if (t > 0) { + delay = (unsigned int)t; + display(); status(); goto done; } @@ -112,7 +117,6 @@ command(const char *cmd) if (p) { if (curcmd == p) goto done; - alarm(0); (*curcmd->c_close)(wnd); curcmd->c_flags &= ~CF_INIT; wnd = (*p->c_open)(); @@ -133,14 +137,13 @@ command(const char *cmd) } curcmd = p; labels(); - display(0); + display(); status(); goto done; } if (curcmd->c_cmd == 0 || !(*curcmd->c_cmd)(tmpstr1, cp)) error("%s: Unknown command.", tmpstr1); done: - sigsetmask(omask); free(tmpstr); } @@ -177,7 +180,7 @@ status(void) { error("Showing %s, refresh every %d seconds.", - curcmd->c_name, naptime); + curcmd->c_name, delay / 1000000); } int Modified: head/usr.bin/systat/extern.h ============================================================================== --- head/usr.bin/systat/extern.h Mon Sep 17 13:06:47 2012 (r240604) +++ head/usr.bin/systat/extern.h Mon Sep 17 13:36:47 2012 (r240605) @@ -49,11 +49,12 @@ extern int CMDLINE; extern int dk_ndrive; extern int hz, stathz; extern double hertz; /* sampling frequency for cp_time and dk_time */ -extern int naptime, col; +extern int col; extern int nhosts; extern int nports; extern int protos; extern int verbose; +extern unsigned int delay; struct inpcb; @@ -87,7 +88,7 @@ int cmdnetstat(const char *, const char struct cmdtab *lookup(const char *); void command(const char *); void die(int); -void display(int); +void display(void); int dkinit(void); int dkcmd(char *, char *); void error(const char *fmt, ...) __printflike(1, 2); Modified: head/usr.bin/systat/icmp.c ============================================================================== --- head/usr.bin/systat/icmp.c Mon Sep 17 13:06:47 2012 (r240604) +++ head/usr.bin/systat/icmp.c Mon Sep 17 13:36:47 2012 (r240605) @@ -138,7 +138,7 @@ domode(struct icmpstat *ret) switch(currentmode) { case display_RATE: sub = &oldstat; - divisor = naptime; + divisor = (delay > 1000000) ? delay / 1000000 : 1; break; case display_DELTA: sub = &oldstat; Modified: head/usr.bin/systat/icmp6.c ============================================================================== --- head/usr.bin/systat/icmp6.c Mon Sep 17 13:06:47 2012 (r240604) +++ head/usr.bin/systat/icmp6.c Mon Sep 17 13:36:47 2012 (r240605) @@ -137,7 +137,7 @@ domode(struct icmp6stat *ret) switch(currentmode) { case display_RATE: sub = &oldstat; - divisor = naptime; + divisor = (delay > 1000000) ? delay / 1000000 : 1; break; case display_DELTA: sub = &oldstat; Modified: head/usr.bin/systat/ip.c ============================================================================== --- head/usr.bin/systat/ip.c Mon Sep 17 13:06:47 2012 (r240604) +++ head/usr.bin/systat/ip.c Mon Sep 17 13:36:47 2012 (r240605) @@ -146,7 +146,7 @@ domode(struct stat *ret) switch(currentmode) { case display_RATE: sub = &oldstat; - divisor = naptime; + divisor = (delay > 1000000) ? delay / 1000000 : 1; break; case display_DELTA: sub = &oldstat; Modified: head/usr.bin/systat/ip6.c ============================================================================== --- head/usr.bin/systat/ip6.c Mon Sep 17 13:06:47 2012 (r240604) +++ head/usr.bin/systat/ip6.c Mon Sep 17 13:36:47 2012 (r240605) @@ -142,7 +142,7 @@ domode(struct ip6stat *ret) switch(currentmode) { case display_RATE: sub = &oldstat; - divisor = naptime; + divisor = (delay > 1000000) ? delay / 1000000 : 1; break; case display_DELTA: sub = &oldstat; Modified: head/usr.bin/systat/keyboard.c ============================================================================== --- head/usr.bin/systat/keyboard.c Mon Sep 17 13:06:47 2012 (r240604) +++ head/usr.bin/systat/keyboard.c Mon Sep 17 13:36:47 2012 (r240605) @@ -35,88 +35,146 @@ __FBSDID("$FreeBSD$"); static const char sccsid[] = "@(#)keyboard.c 8.1 (Berkeley) 6/6/93"; #endif +#include +#include + #include #include -#include #include #include +#include #include "systat.h" #include "extern.h" +static char line[80]; +static int keyboard_dispatch(int ch); + int keyboard(void) { - char line[80]; - int ch, oldmask; + int ch, n; + struct timeval last, intvl, now, tm; + fd_set rfds; + /* Set initial timings */ + gettimeofday(&last, NULL); + intvl.tv_sec = delay / 1000000; + intvl.tv_usec = delay % 1000000; for (;;) { col = 0; move(CMDLINE, 0); - do { - refresh(); - ch = getch(); - if (ch == ERR) { - if (errno == EINTR) - continue; - exit(1); + for (;;) { + /* Determine interval to sleep */ + (void)gettimeofday(&now, NULL); + tm.tv_sec = last.tv_sec + intvl.tv_sec - now.tv_sec; + tm.tv_usec = last.tv_usec + intvl.tv_usec - now.tv_usec; + while (tm.tv_usec < 0) { + tm.tv_usec += 1000000; + tm.tv_sec--; + } + while (tm.tv_usec >= 1000000) { + tm.tv_usec -= 1000000; + tm.tv_sec++; + } + if (tm.tv_sec < 0) { + /* We have to update screen immediately */ + display(); + gettimeofday(&last, NULL); + continue; } - if (ch >= 'A' && ch <= 'Z') - ch += 'a' - 'A'; - if (col == 0) { -#define mask(s) (1 << ((s) - 1)) - if (ch == CTRL('l')) { - oldmask = sigblock(mask(SIGALRM)); - wrefresh(curscr); - sigsetmask(oldmask); - continue; - } - if (ch == CTRL('g')) { - oldmask = sigblock(mask(SIGALRM)); - status(); - sigsetmask(oldmask); + + /* Prepare select */ + FD_ZERO(&rfds); + FD_SET(STDIN_FILENO, &rfds); + n = select(STDIN_FILENO + 1, &rfds, NULL, NULL, &tm); + + if (n > 0) { + /* Read event on stdin */ + ch = getch(); + + if (keyboard_dispatch(ch) == 0) { + refresh(); continue; } - if (ch != ':') - continue; - move(CMDLINE, 0); - clrtoeol(); - } - if (ch == erasechar() && col > 0) { - if (col == 1 && line[0] == ':') - continue; - col--; - goto doerase; - } - if (ch == CTRL('w') && col > 0) { - while (--col >= 0 && isspace(line[col])) - ; - col++; - while (--col >= 0 && !isspace(line[col])) - if (col == 0 && line[0] == ':') - break; - col++; - goto doerase; - } - if (ch == killchar() && col > 0) { - col = 0; - if (line[0] == ':') - col++; - doerase: - move(CMDLINE, col); - clrtoeol(); - continue; - } - if (isprint(ch) || ch == ' ') { - line[col] = ch; - mvaddch(CMDLINE, col, ch); - col++; + + line[col] = '\0'; + command(line + 1); + /* Refresh delay */ + intvl.tv_sec = delay / 1000000; + intvl.tv_usec = delay % 1000000; + refresh(); + break; } - } while (col == 0 || (ch != '\r' && ch != '\n')); - line[col] = '\0'; - oldmask = sigblock(mask(SIGALRM)); - command(line + 1); - sigsetmask(oldmask); + + if (n < 0 && errno != EINTR) + exit(1); + + /* Timeout or signal. Call display another time */ + display(); + gettimeofday(&last, NULL); + } } - /*NOTREACHED*/ +} + +static int +keyboard_dispatch(int ch) +{ + + if (ch == ERR) { + if (errno == EINTR) + return 0; + exit(1); + } + if (ch >= 'A' && ch <= 'Z') + ch += 'a' - 'A'; + if (col == 0) { + if (ch == CTRL('l')) { + wrefresh(curscr); + return 0; + } + if (ch == CTRL('g')) { + status(); + return 0; + } + if (ch != ':') + return 0; + move(CMDLINE, 0); + clrtoeol(); + } + if (ch == erasechar() && col > 0) { + if (col == 1 && line[0] == ':') + return 0; + col--; + goto doerase; + } + if (ch == CTRL('w') && col > 0) { + while (--col >= 0 && isspace(line[col])) + ; + col++; + while (--col >= 0 && !isspace(line[col])) + if (col == 0 && line[0] == ':') + return 1; + col++; + goto doerase; + } + if (ch == killchar() && col > 0) { + col = 0; + if (line[0] == ':') + col++; +doerase: + move(CMDLINE, col); + clrtoeol(); + return 0; + } + if (isprint(ch) || ch == ' ') { + line[col] = ch; + mvaddch(CMDLINE, col, ch); + col++; + } + + if (col == 0 || (ch != '\r' && ch != '\n')) + return 0; + + return 1; } Modified: head/usr.bin/systat/main.c ============================================================================== --- head/usr.bin/systat/main.c Mon Sep 17 13:06:47 2012 (r240604) +++ head/usr.bin/systat/main.c Mon Sep 17 13:36:47 2012 (r240605) @@ -64,7 +64,7 @@ kvm_t *kd; sig_t sigtstpdfl; double avenrun[3]; int col; -int naptime = 5; +unsigned int delay = 5000000; /* in microseconds */ int verbose = 1; /* to report kvm read errs */ struct clockinfo clkinfo; double hertz; @@ -82,6 +82,7 @@ main(int argc, char **argv) { char errbuf[_POSIX2_LINE_MAX], dummy; size_t size; + double t; (void) setlocale(LC_ALL, ""); @@ -97,9 +98,9 @@ main(int argc, char **argv) errx(1, "%s: unknown request", &argv[0][1]); curcmd = p; } else { - naptime = atoi(argv[0]); - if (naptime <= 0) - naptime = 5; + t = strtod(argv[0], NULL) * 1000000.0; + if (t > 0 && t < (double)UINT_MAX) + delay = (unsigned int)t; } argc--, argv++; } @@ -166,8 +167,7 @@ main(int argc, char **argv) dellave = 0.0; - signal(SIGALRM, display); - display(0); + display(); noecho(); crmode(); keyboard(); @@ -192,7 +192,7 @@ labels(void) } void -display(int signo __unused) +display() { int i, j; @@ -223,7 +223,6 @@ display(int signo __unused) wrefresh(wnd); move(CMDLINE, col); refresh(); - alarm(naptime); } void Modified: head/usr.bin/systat/systat.1 ============================================================================== --- head/usr.bin/systat/systat.1 Mon Sep 17 13:06:47 2012 (r240604) +++ head/usr.bin/systat/systat.1 Mon Sep 17 13:36:47 2012 (r240605) @@ -28,7 +28,7 @@ .\" @(#)systat.1 8.2 (Berkeley) 12/30/93 .\" $FreeBSD$ .\" -.Dd October 14, 2007 +.Dd September 17, 2012 .Dt SYSTAT 1 .Os .Sh NAME @@ -109,6 +109,7 @@ full detail below. The .Ar refresh-value specifies the screen refresh time interval in seconds. +Time interval can be fractional. .El .Pp Certain characters cause immediate action by Modified: head/usr.bin/systat/tcp.c ============================================================================== --- head/usr.bin/systat/tcp.c Mon Sep 17 13:06:47 2012 (r240604) +++ head/usr.bin/systat/tcp.c Mon Sep 17 13:36:47 2012 (r240605) @@ -147,7 +147,7 @@ domode(struct tcpstat *ret) switch(currentmode) { case display_RATE: sub = &oldstat; - divisor = naptime; + divisor = (delay > 1000000) ? delay / 1000000 : 1; break; case display_DELTA: sub = &oldstat; From owner-svn-src-all@FreeBSD.ORG Mon Sep 17 13:42:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C8730106566B; Mon, 17 Sep 2012 13:42:45 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from mail.ipfw.ru (unknown [IPv6:2a01:4f8:120:6141::2]) by mx1.freebsd.org (Postfix) with ESMTP id 62A198FC15; Mon, 17 Sep 2012 13:42:45 +0000 (UTC) Received: from [2a02:6b8:0:401:222:4dff:fe50:cd2f] (helo=dhcp170-36-red.yandex.net) by mail.ipfw.ru with esmtpsa (TLSv1:CAMELLIA256-SHA:256) (Exim 4.76 (FreeBSD)) (envelope-from ) id 1TDbeN-0006SD-GA; Mon, 17 Sep 2012 17:46:11 +0400 Message-ID: <505728D3.3000707@ipfw.ru> Date: Mon, 17 Sep 2012 17:42:43 +0400 From: "Alexander V. Chernikov" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:13.0) Gecko/20120627 Thunderbird/13.0.1 MIME-Version: 1.0 To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201209171336.q8HDalx3026645@svn.freebsd.org> In-Reply-To: <201209171336.q8HDalx3026645@svn.freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Subject: Re: svn commit: r240605 - head/usr.bin/systat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2012 13:42:45 -0000 On 17.09.2012 17:36, Alexander V. Chernikov wrote: > Author: melifaro > Date: Mon Sep 17 13:36:47 2012 > New Revision: 240605 > URL: http://svn.freebsd.org/changeset/base/240605 > > Log: > Make systat(1) accept fractional number of seconds. > Make old alarm(3)-based code use select(2). Ability to specify small intervals can be very handy while debugging traffic microbursts. Note that locale-aware strtod(3) is used to parse delay which is slightly different from ping. > > MFC after: 2 weeks From owner-svn-src-all@FreeBSD.ORG Mon Sep 17 14:53:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1A0AE1065672; Mon, 17 Sep 2012 14:53:34 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0439C8FC0A; Mon, 17 Sep 2012 14:53:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8HErXRv039191; Mon, 17 Sep 2012 14:53:33 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8HErXIm039189; Mon, 17 Sep 2012 14:53:33 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201209171453.q8HErXIm039189@svn.freebsd.org> From: Mikolaj Golub Date: Mon, 17 Sep 2012 14:53:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240606 - stable/9/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2012 14:53:34 -0000 Author: trociny Date: Mon Sep 17 14:53:33 2012 New Revision: 240606 URL: http://svn.freebsd.org/changeset/base/240606 Log: MFC r240003, r240004: r240003: In soreceive_generic() when checking if the type of mbuf has changed check it for MT_CONTROL type too, otherwise the assertion "m->m_type == MT_DATA" below may be triggered by the following scenario: - the sender sends some data (MT_DATA) and then a file descriptor (MT_CONTROL); - the receiver calls recv(2) with a MSG_WAITALL asking for data larger than the receive buffer (uio_resid > hiwat). r240004: In soreceive_generic() remove the optimization for the case when MSG_WAITALL is set, and it is possible to do the entire receive operation at once if we block (resid <= hiwat). Actually it might make the recv(2) with MSG_WAITALL flag get stuck when there is enough space in the receiver buffer to satisfy the request but not enough to open the window closed previously due to the buffer being full. The issue can be reproduced using the following scenario: On the sender side do 2 send(2) requests: 1) data of size much smaller than SOBUF_SIZE (e.g. SOBUF_SIZE / 10); 2) data of size equal to SOBUF_SIZE. On the receiver side do 2 recv(2) requests with MSG_WAITALL flag set: 1) recv() data of SOBUF_SIZE / 10 size; 2) recv() data of SOBUF_SIZE size; We totally fill the receiver buffer with one SOBUF_SIZE/10 size request and partial SOBUF_SIZE request. When the first request is processed we get SOBUF_SIZE/10 free space. It is just enough to receive the rest of bytes for the second request, and soreceive_generic() blocks in the part that is a subject of this change waiting for the rest. But the window was closed when the buffer was filled and to avoid silly window syndrome it opens only when available space is larger than sb_hiwat/4 or maxseg. So it is stuck and pending data is only sent via TCP window probes. Discussed with: kib (long ago) Modified: stable/9/sys/kern/uipc_socket.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/uipc_socket.c ============================================================================== --- stable/9/sys/kern/uipc_socket.c Mon Sep 17 13:36:47 2012 (r240605) +++ stable/9/sys/kern/uipc_socket.c Mon Sep 17 14:53:33 2012 (r240606) @@ -1496,17 +1496,11 @@ restart: * If we have less data than requested, block awaiting more (subject * to any timeout) if: * 1. the current count is less than the low water mark, or - * 2. MSG_WAITALL is set, and it is possible to do the entire - * receive operation at once if we block (resid <= hiwat). - * 3. MSG_DONTWAIT is not set - * If MSG_WAITALL is set but resid is larger than the receive buffer, - * we have to do the receive in sections, and thus risk returning a - * short count if a timeout or signal occurs after we start. + * 2. MSG_DONTWAIT is not set */ if (m == NULL || (((flags & MSG_DONTWAIT) == 0 && so->so_rcv.sb_cc < uio->uio_resid) && - (so->so_rcv.sb_cc < so->so_rcv.sb_lowat || - ((flags & MSG_WAITALL) && uio->uio_resid <= so->so_rcv.sb_hiwat)) && + so->so_rcv.sb_cc < so->so_rcv.sb_lowat && m->m_nextpkt == NULL && (pr->pr_flags & PR_ATOMIC) == 0)) { KASSERT(m != NULL || !so->so_rcv.sb_cc, ("receive: m == %p so->so_rcv.sb_cc == %u", @@ -1695,8 +1689,8 @@ dontblock: * examined ('type'), end the receive operation. */ SOCKBUF_LOCK_ASSERT(&so->so_rcv); - if (m->m_type == MT_OOBDATA) { - if (type != MT_OOBDATA) + if (m->m_type == MT_OOBDATA || m->m_type == MT_CONTROL) { + if (type != m->m_type) break; } else if (type == MT_OOBDATA) break; From owner-svn-src-all@FreeBSD.ORG Mon Sep 17 14:54:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 63C571065677; Mon, 17 Sep 2012 14:54:59 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4F25A8FC14; Mon, 17 Sep 2012 14:54:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8HEsxjp039406; Mon, 17 Sep 2012 14:54:59 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8HEsxEJ039404; Mon, 17 Sep 2012 14:54:59 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201209171454.q8HEsxEJ039404@svn.freebsd.org> From: Mikolaj Golub Date: Mon, 17 Sep 2012 14:54: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: r240607 - stable/8/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2012 14:54:59 -0000 Author: trociny Date: Mon Sep 17 14:54:58 2012 New Revision: 240607 URL: http://svn.freebsd.org/changeset/base/240607 Log: MFC r240003, r240004: r240003: In soreceive_generic() when checking if the type of mbuf has changed check it for MT_CONTROL type too, otherwise the assertion "m->m_type == MT_DATA" below may be triggered by the following scenario: - the sender sends some data (MT_DATA) and then a file descriptor (MT_CONTROL); - the receiver calls recv(2) with a MSG_WAITALL asking for data larger than the receive buffer (uio_resid > hiwat). r240004: In soreceive_generic() remove the optimization for the case when MSG_WAITALL is set, and it is possible to do the entire receive operation at once if we block (resid <= hiwat). Actually it might make the recv(2) with MSG_WAITALL flag get stuck when there is enough space in the receiver buffer to satisfy the request but not enough to open the window closed previously due to the buffer being full. The issue can be reproduced using the following scenario: On the sender side do 2 send(2) requests: 1) data of size much smaller than SOBUF_SIZE (e.g. SOBUF_SIZE / 10); 2) data of size equal to SOBUF_SIZE. On the receiver side do 2 recv(2) requests with MSG_WAITALL flag set: 1) recv() data of SOBUF_SIZE / 10 size; 2) recv() data of SOBUF_SIZE size; We totally fill the receiver buffer with one SOBUF_SIZE/10 size request and partial SOBUF_SIZE request. When the first request is processed we get SOBUF_SIZE/10 free space. It is just enough to receive the rest of bytes for the second request, and soreceive_generic() blocks in the part that is a subject of this change waiting for the rest. But the window was closed when the buffer was filled and to avoid silly window syndrome it opens only when available space is larger than sb_hiwat/4 or maxseg. So it is stuck and pending data is only sent via TCP window probes. Discussed with: kib (long ago) Modified: stable/8/sys/kern/uipc_socket.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/kern/ (props changed) Modified: stable/8/sys/kern/uipc_socket.c ============================================================================== --- stable/8/sys/kern/uipc_socket.c Mon Sep 17 14:53:33 2012 (r240606) +++ stable/8/sys/kern/uipc_socket.c Mon Sep 17 14:54:58 2012 (r240607) @@ -1483,17 +1483,11 @@ restart: * If we have less data than requested, block awaiting more (subject * to any timeout) if: * 1. the current count is less than the low water mark, or - * 2. MSG_WAITALL is set, and it is possible to do the entire - * receive operation at once if we block (resid <= hiwat). - * 3. MSG_DONTWAIT is not set - * If MSG_WAITALL is set but resid is larger than the receive buffer, - * we have to do the receive in sections, and thus risk returning a - * short count if a timeout or signal occurs after we start. + * 2. MSG_DONTWAIT is not set */ if (m == NULL || (((flags & MSG_DONTWAIT) == 0 && so->so_rcv.sb_cc < uio->uio_resid) && - (so->so_rcv.sb_cc < so->so_rcv.sb_lowat || - ((flags & MSG_WAITALL) && uio->uio_resid <= so->so_rcv.sb_hiwat)) && + so->so_rcv.sb_cc < so->so_rcv.sb_lowat && m->m_nextpkt == NULL && (pr->pr_flags & PR_ATOMIC) == 0)) { KASSERT(m != NULL || !so->so_rcv.sb_cc, ("receive: m == %p so->so_rcv.sb_cc == %u", @@ -1682,8 +1676,8 @@ dontblock: * examined ('type'), end the receive operation. */ SOCKBUF_LOCK_ASSERT(&so->so_rcv); - if (m->m_type == MT_OOBDATA) { - if (type != MT_OOBDATA) + if (m->m_type == MT_OOBDATA || m->m_type == MT_CONTROL) { + if (type != m->m_type) break; } else if (type == MT_OOBDATA) break; From owner-svn-src-all@FreeBSD.ORG Mon Sep 17 15:27:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 72376106566C; Mon, 17 Sep 2012 15:27:31 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5BB158FC0C; Mon, 17 Sep 2012 15:27:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8HFRVPB043810; Mon, 17 Sep 2012 15:27:31 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8HFRVjF043807; Mon, 17 Sep 2012 15:27:31 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201209171527.q8HFRVjF043807@svn.freebsd.org> From: John Baldwin Date: Mon, 17 Sep 2012 15:27:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240608 - head/sys/dev/mlx X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2012 15:27:31 -0000 Author: jhb Date: Mon Sep 17 15:27:30 2012 New Revision: 240608 URL: http://svn.freebsd.org/changeset/base/240608 Log: Add locking to mlx(4) to make it MPSAFE along with some other fixes: - Use callout(9) rather than timeout(9). - Add a mutex as an I/O lock that protects the adapter and is used for the I/O path. - Add an sx lock as a configuration lock that protects the relationship of configured volumes. - Freeze the request queue when a DMA load is deferred with EINPROGRESS and unfreeze the queue when the DMA callback is invoked. - Explicitly poll the hardware while waiting to submit a command to allow completed commands to free up slots in the command ring. - Remove driver-wide 'initted' variable from mlx_*_fw_handshake() routines. That state should be per-controller instead. Add it as an argument since the first caller knows when it is the first caller. - Remove explicit bus_space tag/handle and use bus_*() rather than bus_space_*(). - Move duplicated PCI device ID probing into a mlx_pci_match() routine. - Don't check for PCIM_CMD_MEMEN (the PCI bus will enable that when allocating the resource) and use pci_enable_busmaster() rather than manipulating the register directly. Tested by: no one despite multiple requests (hope it works) Modified: head/sys/dev/mlx/mlx.c head/sys/dev/mlx/mlx_disk.c head/sys/dev/mlx/mlx_pci.c head/sys/dev/mlx/mlxreg.h head/sys/dev/mlx/mlxvar.h Modified: head/sys/dev/mlx/mlx.c ============================================================================== --- head/sys/dev/mlx/mlx.c Mon Sep 17 14:54:58 2012 (r240607) +++ head/sys/dev/mlx/mlx.c Mon Sep 17 15:27:30 2012 (r240608) @@ -32,8 +32,11 @@ #include #include +#include #include +#include #include +#include #include #include @@ -53,7 +56,6 @@ static struct cdevsw mlx_cdevsw = { .d_version = D_VERSION, - .d_flags = D_NEEDGIANT, .d_open = mlx_open, .d_close = mlx_close, .d_ioctl = mlx_ioctl, @@ -68,17 +70,17 @@ devclass_t mlx_devclass; static int mlx_v3_tryqueue(struct mlx_softc *sc, struct mlx_command *mc); static int mlx_v3_findcomplete(struct mlx_softc *sc, u_int8_t *slot, u_int16_t *status); static void mlx_v3_intaction(struct mlx_softc *sc, int action); -static int mlx_v3_fw_handshake(struct mlx_softc *sc, int *error, int *param1, int *param2); +static int mlx_v3_fw_handshake(struct mlx_softc *sc, int *error, int *param1, int *param2, int first); static int mlx_v4_tryqueue(struct mlx_softc *sc, struct mlx_command *mc); static int mlx_v4_findcomplete(struct mlx_softc *sc, u_int8_t *slot, u_int16_t *status); static void mlx_v4_intaction(struct mlx_softc *sc, int action); -static int mlx_v4_fw_handshake(struct mlx_softc *sc, int *error, int *param1, int *param2); +static int mlx_v4_fw_handshake(struct mlx_softc *sc, int *error, int *param1, int *param2, int first); static int mlx_v5_tryqueue(struct mlx_softc *sc, struct mlx_command *mc); static int mlx_v5_findcomplete(struct mlx_softc *sc, u_int8_t *slot, u_int16_t *status); static void mlx_v5_intaction(struct mlx_softc *sc, int action); -static int mlx_v5_fw_handshake(struct mlx_softc *sc, int *error, int *param1, int *param2); +static int mlx_v5_fw_handshake(struct mlx_softc *sc, int *error, int *param1, int *param2, int first); /* * Status monitoring @@ -130,8 +132,9 @@ static void mlx_setup_dmamap(struct ml bus_dma_segment_t *segs, int nsegments, int error); static void mlx_unmapcmd(struct mlx_command *mc); +static int mlx_shutdown_locked(struct mlx_softc *sc); static int mlx_start(struct mlx_command *mc); -static int mlx_done(struct mlx_softc *sc); +static int mlx_done(struct mlx_softc *sc, int startio); static void mlx_complete(struct mlx_softc *sc); /* @@ -164,14 +167,24 @@ mlx_free(struct mlx_softc *sc) debug_called(1); + /* destroy control device */ + if (sc->mlx_dev_t != NULL) + destroy_dev(sc->mlx_dev_t); + + if (sc->mlx_intr) + bus_teardown_intr(sc->mlx_dev, sc->mlx_irq, sc->mlx_intr); + /* cancel status timeout */ - untimeout(mlx_periodic, sc, sc->mlx_timeout); + MLX_IO_LOCK(sc); + callout_stop(&sc->mlx_timeout); /* throw away any command buffers */ while ((mc = TAILQ_FIRST(&sc->mlx_freecmds)) != NULL) { TAILQ_REMOVE(&sc->mlx_freecmds, mc, mc_link); mlx_freecmd(mc); } + MLX_IO_UNLOCK(sc); + callout_drain(&sc->mlx_timeout); /* destroy data-transfer DMA tag */ if (sc->mlx_buffer_dmat) @@ -184,8 +197,6 @@ mlx_free(struct mlx_softc *sc) bus_dma_tag_destroy(sc->mlx_sg_dmat); /* disconnect the interrupt handler */ - if (sc->mlx_intr) - bus_teardown_intr(sc->mlx_dev, sc->mlx_irq, sc->mlx_intr); if (sc->mlx_irq != NULL) bus_release_resource(sc->mlx_dev, SYS_RES_IRQ, 0, sc->mlx_irq); @@ -201,9 +212,8 @@ mlx_free(struct mlx_softc *sc) if (sc->mlx_enq2 != NULL) free(sc->mlx_enq2, M_DEVBUF); - /* destroy control device */ - if (sc->mlx_dev_t != (struct cdev *)NULL) - destroy_dev(sc->mlx_dev_t); + sx_destroy(&sc->mlx_config_lock); + mtx_destroy(&sc->mlx_io_lock); } /******************************************************************************** @@ -327,7 +337,9 @@ mlx_attach(struct mlx_softc *sc) } /* disable interrupts before we start talking to the controller */ + MLX_IO_LOCK(sc); sc->mlx_intaction(sc, MLX_INTACTION_DISABLE); + MLX_IO_UNLOCK(sc); /* * Wait for the controller to come ready, handshake with the firmware if required. @@ -336,7 +348,8 @@ mlx_attach(struct mlx_softc *sc) */ hsmsg = 0; DELAY(1000); - while ((hscode = sc->mlx_fw_handshake(sc, &hserror, &hsparam1, &hsparam2)) != 0) { + while ((hscode = sc->mlx_fw_handshake(sc, &hserror, &hsparam1, &hsparam2, + hsmsg == 0)) != 0) { /* report first time around... */ if (hsmsg == 0) { device_printf(sc->mlx_dev, "controller initialisation in progress...\n"); @@ -364,7 +377,8 @@ mlx_attach(struct mlx_softc *sc) device_printf(sc->mlx_dev, "can't allocate interrupt\n"); return(ENXIO); } - error = bus_setup_intr(sc->mlx_dev, sc->mlx_irq, INTR_TYPE_BIO | INTR_ENTROPY, NULL, mlx_intr, sc, &sc->mlx_intr); + error = bus_setup_intr(sc->mlx_dev, sc->mlx_irq, INTR_TYPE_BIO | + INTR_ENTROPY | INTR_MPSAFE, NULL, mlx_intr, sc, &sc->mlx_intr); if (error) { device_printf(sc->mlx_dev, "can't set up interrupt\n"); return(ENXIO); @@ -382,7 +396,7 @@ mlx_attach(struct mlx_softc *sc) BUS_SPACE_MAXSIZE_32BIT, /* maxsegsize */ 0, /* flags */ busdma_lock_mutex, /* lockfunc */ - &Giant, /* lockarg */ + &sc->mlx_io_lock, /* lockarg */ &sc->mlx_buffer_dmat); if (error != 0) { device_printf(sc->mlx_dev, "can't allocate buffer DMA tag\n"); @@ -407,7 +421,9 @@ mlx_attach(struct mlx_softc *sc) /* * Obtain controller feature information */ + MLX_IO_LOCK(sc); if ((sc->mlx_enq2 = mlx_enquire(sc, MLX_CMD_ENQUIRY2, sizeof(struct mlx_enquiry2), NULL)) == NULL) { + MLX_IO_UNLOCK(sc); device_printf(sc->mlx_dev, "ENQUIRY2 failed\n"); return(ENXIO); } @@ -420,6 +436,7 @@ mlx_attach(struct mlx_softc *sc) case MLX_IFTYPE_2: /* These controllers don't report the firmware version in the ENQUIRY2 response */ if ((meo = mlx_enquire(sc, MLX_CMD_ENQUIRY_OLD, sizeof(struct mlx_enquiry_old), NULL)) == NULL) { + MLX_IO_UNLOCK(sc); device_printf(sc->mlx_dev, "ENQUIRY_OLD failed\n"); return(ENXIO); } @@ -453,8 +470,10 @@ mlx_attach(struct mlx_softc *sc) } break; default: + MLX_IO_UNLOCK(sc); return(ENXIO); /* should never happen */ } + MLX_IO_UNLOCK(sc); /* * Create the final scatter/gather mappings now that we have characterised the controller. @@ -481,7 +500,7 @@ mlx_attach(struct mlx_softc *sc) /* * Start the timeout routine. */ - sc->mlx_timeout = timeout(mlx_periodic, sc, hz); + callout_reset(&sc->mlx_timeout, hz, mlx_periodic, sc); /* print a little information about the controller */ mlx_describe_controller(sc); @@ -505,13 +524,16 @@ mlx_startup(struct mlx_softc *sc) * Scan all the system drives and attach children for those that * don't currently have them. */ + MLX_IO_LOCK(sc); mes = mlx_enquire(sc, MLX_CMD_ENQSYSDRIVE, sizeof(*mes) * MLX_MAXDRIVES, NULL); + MLX_IO_UNLOCK(sc); if (mes == NULL) { device_printf(sc->mlx_dev, "error fetching drive status\n"); return; } /* iterate over drives returned */ + MLX_CONFIG_LOCK(sc); for (i = 0, dr = &sc->mlx_sysdrive[0]; (i < MLX_MAXDRIVES) && (mes[i].sd_size != 0xffffffff); i++, dr++) { @@ -543,10 +565,13 @@ mlx_startup(struct mlx_softc *sc) device_printf(sc->mlx_dev, "bus_generic_attach returned %d", error); /* mark controller back up */ + MLX_IO_LOCK(sc); sc->mlx_state &= ~MLX_STATE_SHUTDOWN; /* enable interrupts */ sc->mlx_intaction(sc, MLX_INTACTION_ENABLE); + MLX_IO_UNLOCK(sc); + MLX_CONFIG_UNLOCK(sc); } /******************************************************************************** @@ -557,12 +582,12 @@ mlx_detach(device_t dev) { struct mlx_softc *sc = device_get_softc(dev); struct mlxd_softc *mlxd; - int i, s, error; + int i, error; debug_called(1); error = EBUSY; - s = splbio(); + MLX_CONFIG_LOCK(sc); if (sc->mlx_state & MLX_STATE_OPEN) goto out; @@ -577,12 +602,13 @@ mlx_detach(device_t dev) } if ((error = mlx_shutdown(dev))) goto out; + MLX_CONFIG_UNLOCK(sc); mlx_free(sc); - error = 0; + return (0); out: - splx(s); + MLX_CONFIG_UNLOCK(sc); return(error); } @@ -600,13 +626,24 @@ int mlx_shutdown(device_t dev) { struct mlx_softc *sc = device_get_softc(dev); - int i, s, error; + int error; + + MLX_CONFIG_LOCK(sc); + error = mlx_shutdown_locked(sc); + MLX_CONFIG_UNLOCK(sc); + return (error); +} + +static int +mlx_shutdown_locked(struct mlx_softc *sc) +{ + int i, error; debug_called(1); - s = splbio(); - error = 0; + MLX_CONFIG_ASSERT_LOCKED(sc); + MLX_IO_LOCK(sc); sc->mlx_state |= MLX_STATE_SHUTDOWN; sc->mlx_intaction(sc, MLX_INTACTION_DISABLE); @@ -617,19 +654,18 @@ mlx_shutdown(device_t dev) } else { printf("done\n"); } + MLX_IO_UNLOCK(sc); /* delete all our child devices */ for (i = 0; i < MLX_MAXDRIVES; i++) { if (sc->mlx_sysdrive[i].ms_disk != 0) { if ((error = device_delete_child(sc->mlx_dev, sc->mlx_sysdrive[i].ms_disk)) != 0) - goto out; + return (error); sc->mlx_sysdrive[i].ms_disk = 0; } } - out: - splx(s); - return(error); + return (0); } /******************************************************************************** @@ -639,11 +675,10 @@ int mlx_suspend(device_t dev) { struct mlx_softc *sc = device_get_softc(dev); - int s; debug_called(1); - s = splbio(); + MLX_IO_LOCK(sc); sc->mlx_state |= MLX_STATE_SUSPEND; /* flush controller */ @@ -651,7 +686,7 @@ mlx_suspend(device_t dev) printf("%s\n", mlx_flush(sc) ? "failed" : "done"); sc->mlx_intaction(sc, MLX_INTACTION_DISABLE); - splx(s); + MLX_IO_UNLOCK(sc); return(0); } @@ -666,8 +701,10 @@ mlx_resume(device_t dev) debug_called(1); + MLX_IO_LOCK(sc); sc->mlx_state &= ~MLX_STATE_SUSPEND; sc->mlx_intaction(sc, MLX_INTACTION_ENABLE); + MLX_IO_UNLOCK(sc); return(0); } @@ -684,7 +721,9 @@ mlx_intr(void *arg) debug_called(1); /* collect finished commands, queue anything waiting */ - mlx_done(sc); + MLX_IO_LOCK(sc); + mlx_done(sc, 1); + MLX_IO_UNLOCK(sc); }; /******************************************************************************* @@ -694,14 +733,12 @@ mlx_intr(void *arg) int mlx_submit_buf(struct mlx_softc *sc, mlx_bio *bp) { - int s; debug_called(1); - s = splbio(); + MLX_IO_ASSERT_LOCKED(sc); MLX_BIO_QINSERT(sc->mlx_bioq, bp); sc->mlx_waitbufs++; - splx(s); mlx_startio(sc); return(0); } @@ -714,7 +751,11 @@ mlx_open(struct cdev *dev, int flags, in { struct mlx_softc *sc = dev->si_drv1; + MLX_CONFIG_LOCK(sc); + MLX_IO_LOCK(sc); sc->mlx_state |= MLX_STATE_OPEN; + MLX_IO_UNLOCK(sc); + MLX_CONFIG_UNLOCK(sc); return(0); } @@ -726,7 +767,11 @@ mlx_close(struct cdev *dev, int flags, i { struct mlx_softc *sc = dev->si_drv1; + MLX_CONFIG_LOCK(sc); + MLX_IO_LOCK(sc); sc->mlx_state &= ~MLX_STATE_OPEN; + MLX_IO_UNLOCK(sc); + MLX_CONFIG_UNLOCK(sc); return (0); } @@ -753,12 +798,14 @@ mlx_ioctl(struct cdev *dev, u_long cmd, */ case MLX_NEXT_CHILD: /* search system drives */ + MLX_CONFIG_LOCK(sc); for (i = 0; i < MLX_MAXDRIVES; i++) { /* is this one attached? */ if (sc->mlx_sysdrive[i].ms_disk != 0) { /* looking for the next one we come across? */ if (*arg == -1) { *arg = device_get_unit(sc->mlx_sysdrive[i].ms_disk); + MLX_CONFIG_UNLOCK(sc); return(0); } /* we want the one after this one */ @@ -766,13 +813,16 @@ mlx_ioctl(struct cdev *dev, u_long cmd, *arg = -1; } } + MLX_CONFIG_UNLOCK(sc); return(ENOENT); /* * Scan the controller to see whether new drives have appeared. */ case MLX_RESCAN_DRIVES: + mtx_lock(&Giant); mlx_startup(sc); + mtx_unlock(&Giant); return(0); /* @@ -780,10 +830,12 @@ mlx_ioctl(struct cdev *dev, u_long cmd, * away. */ case MLX_DETACH_DRIVE: /* detach one drive */ - + MLX_CONFIG_LOCK(sc); if (((dr = mlx_findunit(sc, *arg)) == NULL) || - ((mlxd = device_get_softc(dr->ms_disk)) == NULL)) + ((mlxd = device_get_softc(dr->ms_disk)) == NULL)) { + MLX_CONFIG_UNLOCK(sc); return(ENOENT); + } device_printf(dr->ms_disk, "detaching..."); error = 0; @@ -793,10 +845,13 @@ mlx_ioctl(struct cdev *dev, u_long cmd, } /* flush controller */ + MLX_IO_LOCK(sc); if (mlx_flush(sc)) { + MLX_IO_UNLOCK(sc); error = EBUSY; goto detach_out; } + MLX_IO_UNLOCK(sc); /* nuke drive */ if ((error = device_delete_child(sc->mlx_dev, dr->ms_disk)) != 0) @@ -804,6 +859,7 @@ mlx_ioctl(struct cdev *dev, u_long cmd, dr->ms_disk = 0; detach_out: + MLX_CONFIG_UNLOCK(sc); if (error) { printf("failed\n"); } else { @@ -823,28 +879,33 @@ mlx_ioctl(struct cdev *dev, u_long cmd, if (!(sc->mlx_feature & MLX_FEAT_PAUSEWORKS)) return(EOPNOTSUPP); + /* check time values */ mp = (struct mlx_pause *)addr; + if ((mp->mp_when < 0) || (mp->mp_when > 3600)) + return(EINVAL); + if ((mp->mp_howlong < 1) || (mp->mp_howlong > (0xf * 30))) + return(EINVAL); + + MLX_IO_LOCK(sc); if ((mp->mp_which == MLX_PAUSE_CANCEL) && (sc->mlx_pause.mp_when != 0)) { /* cancel a pending pause operation */ sc->mlx_pause.mp_which = 0; } else { /* fix for legal channels */ mp->mp_which &= ((1 << sc->mlx_enq2->me_actual_channels) -1); - /* check time values */ - if ((mp->mp_when < 0) || (mp->mp_when > 3600)) - return(EINVAL); - if ((mp->mp_howlong < 1) || (mp->mp_howlong > (0xf * 30))) - return(EINVAL); /* check for a pause currently running */ - if ((sc->mlx_pause.mp_which != 0) && (sc->mlx_pause.mp_when == 0)) + if ((sc->mlx_pause.mp_which != 0) && (sc->mlx_pause.mp_when == 0)) { + MLX_IO_UNLOCK(sc); return(EBUSY); + } /* looks ok, go with it */ sc->mlx_pause.mp_which = mp->mp_which; sc->mlx_pause.mp_when = time_second + mp->mp_when; sc->mlx_pause.mp_howlong = sc->mlx_pause.mp_when + mp->mp_howlong; } + MLX_IO_UNLOCK(sc); return(0); /* @@ -857,7 +918,9 @@ mlx_ioctl(struct cdev *dev, u_long cmd, * Start a rebuild on a given SCSI disk */ case MLX_REBUILDASYNC: + MLX_IO_LOCK(sc); if (sc->mlx_background != 0) { + MLX_IO_UNLOCK(sc); rb->rr_status = 0x0106; return(EBUSY); } @@ -887,13 +950,16 @@ mlx_ioctl(struct cdev *dev, u_long cmd, } if (error == 0) sc->mlx_background = MLX_BACKGROUND_REBUILD; + MLX_IO_UNLOCK(sc); return(error); /* * Get the status of the current rebuild or consistency check. */ case MLX_REBUILDSTAT: + MLX_IO_LOCK(sc); *rs = sc->mlx_rebuildstat; + MLX_IO_UNLOCK(sc); return(0); /* @@ -902,12 +968,16 @@ mlx_ioctl(struct cdev *dev, u_long cmd, */ case MLX_GET_SYSDRIVE: error = ENOENT; + MLX_CONFIG_LOCK(sc); + mtx_lock(&Giant); mlxd = (struct mlxd_softc *)devclass_get_softc(mlxd_devclass, *arg); + mtx_unlock(&Giant); if ((mlxd != NULL) && (mlxd->mlxd_drive >= sc->mlx_sysdrive) && (mlxd->mlxd_drive < (sc->mlx_sysdrive + MLX_MAXDRIVES))) { error = 0; *arg = mlxd->mlxd_drive - sc->mlx_sysdrive; } + MLX_CONFIG_UNLOCK(sc); return(error); default: @@ -930,14 +1000,18 @@ mlx_submit_ioctl(struct mlx_softc *sc, s * Return the current status of this drive. */ case MLXD_STATUS: + MLX_IO_LOCK(sc); *arg = drive->ms_state; + MLX_IO_UNLOCK(sc); return(0); /* * Start a background consistency check on this drive. */ case MLXD_CHECKASYNC: /* start a background consistency check */ + MLX_IO_LOCK(sc); if (sc->mlx_background != 0) { + MLX_IO_UNLOCK(sc); *arg = 0x0106; return(EBUSY); } @@ -964,6 +1038,7 @@ mlx_submit_ioctl(struct mlx_softc *sc, s } if (error == 0) sc->mlx_background = MLX_BACKGROUND_CHECK; + MLX_IO_UNLOCK(sc); *arg = result; return(error); @@ -987,6 +1062,7 @@ mlx_periodic(void *data) struct mlx_softc *sc = (struct mlx_softc *)data; debug_called(1); + MLX_IO_ASSERT_LOCKED(sc); /* * Run a bus pause? @@ -1045,10 +1121,10 @@ mlx_periodic(void *data) mlx_enquire(sc, MLX_CMD_REBUILDSTAT, sizeof(struct mlx_rebuild_stat), mlx_periodic_rebuild); /* deal with possibly-missed interrupts and timed-out commands */ - mlx_done(sc); + mlx_done(sc, 1); /* reschedule another poll next second or so */ - sc->mlx_timeout = timeout(mlx_periodic, sc, hz); + callout_reset(&sc->mlx_timeout, hz, mlx_periodic, sc); } /******************************************************************************** @@ -1060,6 +1136,7 @@ mlx_periodic_enquiry(struct mlx_command struct mlx_softc *sc = mc->mc_sc; debug_called(1); + MLX_IO_ASSERT_LOCKED(sc); /* Command completed OK? */ if (mc->mc_status != 0) { @@ -1124,7 +1201,7 @@ mlx_periodic_enquiry(struct mlx_command debug(1, "event log pointer was %d, now %d\n", sc->mlx_lastevent, sc->mlx_currevent); /* mark the event log as busy */ - atomic_set_int(&sc->mlx_flags, MLX_EVENTLOG_BUSY); + sc->mlx_flags |= MLX_EVENTLOG_BUSY; /* drain new eventlog entries */ mlx_periodic_eventlog_poll(sc); @@ -1205,6 +1282,7 @@ mlx_periodic_eventlog_poll(struct mlx_so int error = 0; debug_called(1); + MLX_IO_ASSERT_LOCKED(sc); /* get ourselves a command buffer */ error = 1; @@ -1263,6 +1341,7 @@ mlx_periodic_eventlog_respond(struct mlx char *reason; debug_called(1); + MLX_IO_ASSERT_LOCKED(sc); sc->mlx_lastevent++; /* next message... */ if (mc->mc_status == 0) { @@ -1321,7 +1400,7 @@ mlx_periodic_eventlog_respond(struct mlx mlx_periodic_eventlog_poll(sc); } else { /* clear log-busy status */ - atomic_clear_int(&sc->mlx_flags, MLX_EVENTLOG_BUSY); + sc->mlx_flags &= ~MLX_EVENTLOG_BUSY; } } @@ -1334,6 +1413,7 @@ mlx_periodic_rebuild(struct mlx_command struct mlx_softc *sc = mc->mc_sc; struct mlx_rebuild_status *mr = (struct mlx_rebuild_status *)mc->mc_data; + MLX_IO_ASSERT_LOCKED(sc); switch(mc->mc_status) { case 0: /* operation running, update stats */ sc->mlx_rebuildstat = *mr; @@ -1384,6 +1464,8 @@ mlx_pause_action(struct mlx_softc *sc) struct mlx_command *mc; int failsafe, i, command; + MLX_IO_ASSERT_LOCKED(sc); + /* What are we doing here? */ if (sc->mlx_pause.mp_when == 0) { command = MLX_CMD_STARTCHANNEL; @@ -1440,7 +1522,8 @@ mlx_pause_done(struct mlx_command *mc) struct mlx_softc *sc = mc->mc_sc; int command = mc->mc_mailbox[0]; int channel = mc->mc_mailbox[2] & 0xf; - + + MLX_IO_ASSERT_LOCKED(sc); if (mc->mc_status != 0) { device_printf(sc->mlx_dev, "%s command failed - %s\n", command == MLX_CMD_STOPCHANNEL ? "pause" : "resume", mlx_diagnose_command(mc)); @@ -1509,6 +1592,7 @@ mlx_enquire(struct mlx_softc *sc, int co int error; debug_called(1); + MLX_IO_ASSERT_LOCKED(sc); /* get ourselves a command buffer */ error = 1; @@ -1562,6 +1646,7 @@ mlx_flush(struct mlx_softc *sc) int error; debug_called(1); + MLX_IO_ASSERT_LOCKED(sc); /* get ourselves a command buffer */ error = 1; @@ -1604,6 +1689,7 @@ mlx_check(struct mlx_softc *sc, int driv int error; debug_called(1); + MLX_IO_ASSERT_LOCKED(sc); /* get ourselves a command buffer */ error = 0x10000; @@ -1647,6 +1733,7 @@ mlx_rebuild(struct mlx_softc *sc, int ch int error; debug_called(1); + MLX_IO_ASSERT_LOCKED(sc); /* get ourselves a command buffer */ error = 0x10000; @@ -1689,6 +1776,7 @@ mlx_wait_command(struct mlx_command *mc) int error, count; debug_called(1); + MLX_IO_ASSERT_LOCKED(sc); mc->mc_complete = NULL; mc->mc_private = mc; /* wake us when you're done */ @@ -1698,7 +1786,7 @@ mlx_wait_command(struct mlx_command *mc) count = 0; /* XXX better timeout? */ while ((mc->mc_status == MLX_STATUS_BUSY) && (count < 30)) { - tsleep(mc->mc_private, PRIBIO | PCATCH, "mlxwcmd", hz); + mtx_sleep(mc->mc_private, &sc->mlx_io_lock, PRIBIO | PCATCH, "mlxwcmd", hz); } if (mc->mc_status != 0) { @@ -1720,9 +1808,10 @@ static int mlx_poll_command(struct mlx_command *mc) { struct mlx_softc *sc = mc->mc_sc; - int error, count, s; + int error, count; debug_called(1); + MLX_IO_ASSERT_LOCKED(sc); mc->mc_complete = NULL; mc->mc_private = NULL; /* we will poll for it */ @@ -1732,13 +1821,11 @@ mlx_poll_command(struct mlx_command *mc) count = 0; do { /* poll for completion */ - mlx_done(mc->mc_sc); + mlx_done(mc->mc_sc, 1); } while ((mc->mc_status == MLX_STATUS_BUSY) && (count++ < 15000000)); if (mc->mc_status != MLX_STATUS_BUSY) { - s = splbio(); TAILQ_REMOVE(&sc->mlx_work, mc, mc_link); - splx(s); return(0); } device_printf(sc->mlx_dev, "command failed - %s\n", mlx_diagnose_command(mc)); @@ -1809,30 +1896,27 @@ mlx_startio_cb(void *arg, bus_dma_segmen mc->mc_status = MLX_STATUS_WEDGED; mlx_completeio(mc); } + + sc->mlx_state &= ~MLX_STATE_QFROZEN; } /******************************************************************************** * Pull as much work off the softc's work queue as possible and give it to the * controller. Leave a couple of slots free for emergencies. - * - * Must be called at splbio or in an equivalent fashion that prevents - * reentry or activity on the bioq. */ static void mlx_startio(struct mlx_softc *sc) { struct mlx_command *mc; mlx_bio *bp; - int s; int error; - /* avoid reentrancy */ - if (mlx_lock_tas(sc, MLX_LOCK_STARTING)) - return; + MLX_IO_ASSERT_LOCKED(sc); /* spin until something prevents us from doing any work */ - s = splbio(); for (;;) { + if (sc->mlx_state & MLX_STATE_QFROZEN) + break; /* see if there's work to be done */ if ((bp = MLX_BIO_QFIRST(sc->mlx_bioq)) == NULL) @@ -1848,7 +1932,6 @@ mlx_startio(struct mlx_softc *sc) /* get the buf containing our work */ MLX_BIO_QREMOVE(sc->mlx_bioq, bp); sc->mlx_waitbufs--; - splx(s); /* connect the buf to the command */ mc->mc_complete = mlx_completeio; @@ -1859,14 +1942,11 @@ mlx_startio(struct mlx_softc *sc) /* map the command so the controller can work with it */ error = bus_dmamap_load(sc->mlx_buffer_dmat, mc->mc_dmamap, mc->mc_data, mc->mc_length, mlx_startio_cb, mc, 0); - if (error == EINPROGRESS) { - break; + if (error == EINPROGRESS) { + sc->mlx_state |= MLX_STATE_QFROZEN; + break; } - - s = splbio(); } - splx(s); - mlx_lock_clr(sc, MLX_LOCK_STARTING); } /******************************************************************************** @@ -1878,7 +1958,8 @@ mlx_completeio(struct mlx_command *mc) struct mlx_softc *sc = mc->mc_sc; mlx_bio *bp = (mlx_bio *)mc->mc_private; struct mlxd_softc *mlxd = (struct mlxd_softc *)MLX_BIO_SOFTC(bp); - + + MLX_IO_ASSERT_LOCKED(sc); if (mc->mc_status != MLX_STATUS_OK) { /* could be more verbose here? */ MLX_BIO_SET_ERROR(bp, EIO); @@ -1969,8 +2050,11 @@ mlx_user_command(struct mlx_softc *sc, s error = ENOMEM; /* get ourselves a command and copy in from user space */ - if ((mc = mlx_alloccmd(sc)) == NULL) + MLX_IO_LOCK(sc); + if ((mc = mlx_alloccmd(sc)) == NULL) { + MLX_IO_UNLOCK(sc); return(error); + } bcopy(mu->mu_command, mc->mc_mailbox, sizeof(mc->mc_mailbox)); debug(0, "got command buffer"); @@ -1983,9 +2067,13 @@ mlx_user_command(struct mlx_softc *sc, s error = EINVAL; goto out; } + MLX_IO_UNLOCK(sc); if (((kbuf = malloc(mu->mu_datasize, M_DEVBUF, M_WAITOK)) == NULL) || - (error = copyin(mu->mu_buf, kbuf, mu->mu_datasize))) + (error = copyin(mu->mu_buf, kbuf, mu->mu_datasize))) { + MLX_IO_LOCK(sc); goto out; + } + MLX_IO_LOCK(sc); debug(0, "got kernel buffer"); } @@ -2010,17 +2098,20 @@ mlx_user_command(struct mlx_softc *sc, s mc->mc_private = mu; error = bus_dmamap_load(sc->mlx_buffer_dmat, mc->mc_dmamap, mc->mc_data, mc->mc_length, mlx_user_cb, mc, BUS_DMA_NOWAIT); + if (error) + goto out; /* copy out status and data */ mu->mu_status = mc->mc_status; - if ((mu->mu_datasize > 0) && - ((error = copyout(kbuf, mu->mu_buf, mu->mu_datasize)))) - goto out; - - error = 0; + if (mu->mu_datasize > 0) { + MLX_IO_UNLOCK(sc); + error = copyout(kbuf, mu->mu_buf, mu->mu_datasize); + MLX_IO_LOCK(sc); + } out: mlx_releasecmd(mc); + MLX_IO_UNLOCK(sc); if (kbuf != NULL) free(kbuf, M_DEVBUF); return(error); @@ -2042,10 +2133,12 @@ static int mlx_getslot(struct mlx_command *mc) { struct mlx_softc *sc = mc->mc_sc; - int s, slot, limit; + int slot, limit; debug_called(1); + MLX_IO_ASSERT_LOCKED(sc); + /* * Enforce slot-usage limit, if we have the required information. */ @@ -2062,7 +2155,6 @@ mlx_getslot(struct mlx_command *mc) * * XXX linear search is slow */ - s = splbio(); for (slot = 0; slot < limit; slot++) { debug(2, "try slot %d", slot); if (sc->mlx_busycmd[slot] == NULL) @@ -2072,7 +2164,6 @@ mlx_getslot(struct mlx_command *mc) sc->mlx_busycmd[slot] = mc; sc->mlx_busycmds++; } - splx(s); /* out of slots? */ if (slot >= limit) @@ -2153,7 +2244,7 @@ static int mlx_start(struct mlx_command *mc) { struct mlx_softc *sc = mc->mc_sc; - int i, s, done; + int i; debug_called(1); @@ -2165,22 +2256,17 @@ mlx_start(struct mlx_command *mc) /* set a default 60-second timeout XXX tunable? XXX not currently used */ mc->mc_timeout = time_second + 60; - + /* spin waiting for the mailbox */ - for (i = 100000, done = 0; (i > 0) && !done; i--) { - s = splbio(); + for (i = 100000; i > 0; i--) { if (sc->mlx_tryqueue(sc, mc)) { - done = 1; /* move command to work queue */ TAILQ_INSERT_TAIL(&sc->mlx_work, mc, mc_link); - } - splx(s); /* drop spl to allow completion interrupts */ + return (0); + } else if (i > 1) + mlx_done(sc, 0); } - /* command is enqueued */ - if (done) - return(0); - /* * We couldn't get the controller to take the command. Revoke the slot * that the command was given and return it with a bad status. @@ -2200,19 +2286,19 @@ mlx_start(struct mlx_command *mc) * Returns nonzero if one or more commands were completed. */ static int -mlx_done(struct mlx_softc *sc) +mlx_done(struct mlx_softc *sc, int startio) { struct mlx_command *mc; - int s, result; + int result; u_int8_t slot; u_int16_t status; debug_called(2); + MLX_IO_ASSERT_LOCKED(sc); result = 0; /* loop collecting completed commands */ - s = splbio(); for (;;) { /* poll for a completed command's identifier and status */ if (sc->mlx_findcomplete(sc, &slot, &status)) { @@ -2235,10 +2321,9 @@ mlx_done(struct mlx_softc *sc) break; } } - splx(s); /* if we've completed any commands, try posting some more */ - if (result) + if (result && startio) mlx_startio(sc); /* handle completion and timeouts */ @@ -2254,15 +2339,9 @@ static void mlx_complete(struct mlx_softc *sc) { struct mlx_command *mc, *nc; - int s; debug_called(2); - - /* avoid reentrancy XXX might want to signal and request a restart */ - if (mlx_lock_tas(sc, MLX_LOCK_COMPLETING)) - return; - - s = splbio(); + MLX_IO_ASSERT_LOCKED(sc); /* scan the list of busy/done commands */ mc = TAILQ_FIRST(&sc->mlx_work); @@ -2299,9 +2378,6 @@ mlx_complete(struct mlx_softc *sc) } mc = nc; } - splx(s); - - mlx_lock_clr(sc, MLX_LOCK_COMPLETING); } /******************************************************************************** @@ -2329,14 +2405,12 @@ mlx_alloccmd(struct mlx_softc *sc) { struct mlx_command *mc; int error; - int s; debug_called(1); - s = splbio(); + MLX_IO_ASSERT_LOCKED(sc); if ((mc = TAILQ_FIRST(&sc->mlx_freecmds)) != NULL) TAILQ_REMOVE(&sc->mlx_freecmds, mc, mc_link); - splx(s); /* allocate a new command buffer? */ if (mc == NULL) { @@ -2362,13 +2436,11 @@ mlx_alloccmd(struct mlx_softc *sc) static void mlx_releasecmd(struct mlx_command *mc) { - int s; debug_called(1); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Sep 17 15:43:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4B273106564A; Mon, 17 Sep 2012 15:43:58 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 34B128FC1B; Mon, 17 Sep 2012 15:43:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8HFhwvJ045948; Mon, 17 Sep 2012 15:43:58 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8HFhwY5045945; Mon, 17 Sep 2012 15:43:58 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201209171543.q8HFhwY5045945@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 17 Sep 2012 15:43:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240609 - head/sys/dev/sound/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2012 15:43:58 -0000 Author: hselasky Date: Mon Sep 17 15:43:57 2012 New Revision: 240609 URL: http://svn.freebsd.org/changeset/base/240609 Log: Implement support for USB Audio v2.0. Remove some redundant USB audio v1.0 debug data, hence userspace tools like lsusb exist to show this information properly. Modified: head/sys/dev/sound/usb/uaudio.c head/sys/dev/sound/usb/uaudioreg.h Modified: head/sys/dev/sound/usb/uaudio.c ============================================================================== --- head/sys/dev/sound/usb/uaudio.c Mon Sep 17 15:27:30 2012 (r240608) +++ head/sys/dev/sound/usb/uaudio.c Mon Sep 17 15:43:57 2012 (r240609) @@ -115,13 +115,28 @@ SYSCTL_INT(_hw_usb_uaudio, OID_AUTO, def #endif #define UAUDIO_NFRAMES 64 /* must be factor of 8 due HS-USB */ -#define UAUDIO_NCHANBUFS 2 /* number of outstanding request */ -#define UAUDIO_RECURSE_LIMIT 24 /* rounds */ +#define UAUDIO_NCHANBUFS 2 /* number of outstanding request */ +#define UAUDIO_RECURSE_LIMIT 255 /* rounds */ #define MAKE_WORD(h,l) (((h) << 8) | (l)) #define BIT_TEST(bm,bno) (((bm)[(bno) / 8] >> (7 - ((bno) % 8))) & 1) #define UAUDIO_MAX_CHAN(x) (x) +union uaudio_asid { + const struct usb_audio_streaming_interface_descriptor *v1; + const struct usb_audio20_streaming_interface_descriptor *v2; +}; + +union uaudio_asf1d { + const struct usb_audio_streaming_type1_descriptor *v1; + const struct usb_audio20_streaming_type1_descriptor *v2; +}; + +union uaudio_sed { + const struct usb_audio_streaming_endpoint_descriptor *v1; + const struct usb_audio20_streaming_endpoint_descriptor *v2; +}; + struct uaudio_mixer_node { int32_t minval; int32_t maxval; @@ -162,11 +177,9 @@ struct uaudio_chan { struct uaudio_softc *priv_sc; struct pcm_channel *pcm_ch; struct usb_xfer *xfer[UAUDIO_NCHANBUFS]; - const struct usb_audio_streaming_interface_descriptor *p_asid; - const struct usb_audio_streaming_type1_descriptor *p_asf1d; - const struct usb_audio_streaming_endpoint_descriptor *p_sed; + union uaudio_asf1d p_asf1d; + union uaudio_sed p_sed; const usb_endpoint_descriptor_audio_t *p_ed1; - const usb_endpoint_descriptor_audio_t *p_ed2; const struct uaudio_format *p_fmt; uint8_t *buf; /* pointer to buffer */ @@ -192,6 +205,7 @@ struct uaudio_chan { uint8_t valid; uint8_t iface_index; uint8_t iface_alt_index; + uint8_t channels; }; #define UMIDI_CABLES_MAX 16 /* units */ @@ -242,12 +256,21 @@ struct umidi_chan { uint8_t single_command; }; +struct uaudio_search_result { + uint8_t bit_input[(256 + 7) / 8]; + uint8_t bit_output[(256 + 7) / 8]; + uint8_t recurse_level; + uint8_t id_max; + uint8_t is_input; +}; + struct uaudio_softc { struct sbuf sc_sndstat; struct sndcard_func sc_sndcard_func; struct uaudio_chan sc_rec_chan; struct uaudio_chan sc_play_chan; struct umidi_chan sc_midi_chan; + struct uaudio_search_result sc_mixer_clocks; struct usb_device *sc_udev; struct usb_xfer *sc_mixer_xfer[1]; @@ -273,24 +296,28 @@ struct uaudio_softc { uint8_t sc_uq_au_vendor_class:1; }; -struct uaudio_search_result { - uint8_t bit_input[(256 + 7) / 8]; - uint8_t bit_output[(256 + 7) / 8]; - uint8_t bit_visited[(256 + 7) / 8]; - uint8_t recurse_level; - uint8_t id_max; -}; - struct uaudio_terminal_node { union { const struct usb_descriptor *desc; - const struct usb_audio_input_terminal *it; - const struct usb_audio_output_terminal *ot; - const struct usb_audio_mixer_unit_0 *mu; - const struct usb_audio_selector_unit *su; - const struct usb_audio_feature_unit *fu; - const struct usb_audio_processing_unit_0 *pu; - const struct usb_audio_extension_unit_0 *eu; + const struct usb_audio_input_terminal *it_v1; + const struct usb_audio_output_terminal *ot_v1; + const struct usb_audio_mixer_unit_0 *mu_v1; + const struct usb_audio_selector_unit *su_v1; + const struct usb_audio_feature_unit *fu_v1; + const struct usb_audio_processing_unit_0 *pu_v1; + const struct usb_audio_extension_unit_0 *eu_v1; + const struct usb_audio20_clock_source_unit *csrc_v2; + const struct usb_audio20_clock_selector_unit_0 *csel_v2; + const struct usb_audio20_clock_multiplier_unit *cmul_v2; + const struct usb_audio20_input_terminal *it_v2; + const struct usb_audio20_output_terminal *ot_v2; + const struct usb_audio20_mixer_unit_0 *mu_v2; + const struct usb_audio20_selector_unit *su_v2; + const struct usb_audio20_feature_unit *fu_v2; + const struct usb_audio20_sample_rate_unit *ru_v2; + const struct usb_audio20_processing_unit_0 *pu_v2; + const struct usb_audio20_extension_unit_0 *eu_v2; + const struct usb_audio20_effect_unit *ef_v2; } u; struct uaudio_search_result usr; struct uaudio_terminal_node *root; @@ -303,7 +330,7 @@ struct uaudio_format { const char *description; }; -static const struct uaudio_format uaudio_formats[] = { +static const struct uaudio_format uaudio10_formats[] = { {UA_FMT_PCM8, 8, AFMT_U8, "8-bit U-LE PCM"}, {UA_FMT_PCM8, 16, AFMT_U16_LE, "16-bit U-LE PCM"}, @@ -321,6 +348,24 @@ static const struct uaudio_format uaudio {0, 0, 0, NULL} }; +static const struct uaudio_format uaudio20_formats[] = { + + {UA20_FMT_PCM, 8, AFMT_S8, "8-bit S-LE PCM"}, + {UA20_FMT_PCM, 16, AFMT_S16_LE, "16-bit S-LE PCM"}, + {UA20_FMT_PCM, 24, AFMT_S24_LE, "24-bit S-LE PCM"}, + {UA20_FMT_PCM, 32, AFMT_S32_LE, "32-bit S-LE PCM"}, + + {UA20_FMT_PCM8, 8, AFMT_U8, "8-bit U-LE PCM"}, + {UA20_FMT_PCM8, 16, AFMT_U16_LE, "16-bit U-LE PCM"}, + {UA20_FMT_PCM8, 24, AFMT_U24_LE, "24-bit U-LE PCM"}, + {UA20_FMT_PCM8, 32, AFMT_U32_LE, "32-bit U-LE PCM"}, + + {UA20_FMT_ALAW, 8, AFMT_A_LAW, "8-bit A-Law"}, + {UA20_FMT_MULAW, 8, AFMT_MU_LAW, "8-bit mu-Law"}, + + {0, 0, 0, NULL} +}; + #define UAC_OUTPUT 0 #define UAC_INPUT 1 #define UAC_EQUAL 2 @@ -346,18 +391,8 @@ static usb_callback_t uaudio_mixer_write static usb_callback_t umidi_bulk_read_callback; static usb_callback_t umidi_bulk_write_callback; -static void uaudio_chan_fill_info_sub(struct uaudio_softc *, - struct usb_device *, uint32_t, uint8_t, uint8_t); -static void uaudio_chan_fill_info(struct uaudio_softc *, - struct usb_device *); -static void uaudio_mixer_add_ctl_sub(struct uaudio_softc *, - struct uaudio_mixer_node *); -static void uaudio_mixer_add_ctl(struct uaudio_softc *, - struct uaudio_mixer_node *); -static void uaudio_mixer_add_input(struct uaudio_softc *, - const struct uaudio_terminal_node *, int); -static void uaudio_mixer_add_output(struct uaudio_softc *, - const struct uaudio_terminal_node *, int); +/* ==== USB audio v1.0 ==== */ + static void uaudio_mixer_add_mixer(struct uaudio_softc *, const struct uaudio_terminal_node *, int); static void uaudio_mixer_add_selector(struct uaudio_softc *, @@ -378,25 +413,56 @@ static uint16_t uaudio_mixer_determine_c struct uaudio_mixer_node *); static uint16_t uaudio_mixer_feature_name(const struct uaudio_terminal_node *, struct uaudio_mixer_node *); -static const struct uaudio_terminal_node *uaudio_mixer_get_input( - const struct uaudio_terminal_node *, uint8_t); -static const struct uaudio_terminal_node *uaudio_mixer_get_output( - const struct uaudio_terminal_node *, uint8_t); static void uaudio_mixer_find_inputs_sub(struct uaudio_terminal_node *, const uint8_t *, uint8_t, struct uaudio_search_result *); -static void uaudio_mixer_find_outputs_sub(struct uaudio_terminal_node *, - uint8_t, uint8_t, struct uaudio_search_result *); +static const void *uaudio_mixer_verify_desc(const void *, uint32_t); +static usb_error_t uaudio_set_speed(struct usb_device *, uint8_t, uint32_t); +static int uaudio_mixer_get(struct usb_device *, uint16_t, uint8_t, + struct uaudio_mixer_node *); + +/* ==== USB audio v2.0 ==== */ + +static void uaudio20_mixer_add_mixer(struct uaudio_softc *, + const struct uaudio_terminal_node *, int); +static void uaudio20_mixer_add_selector(struct uaudio_softc *, + const struct uaudio_terminal_node *, int); +static void uaudio20_mixer_add_feature(struct uaudio_softc *, + const struct uaudio_terminal_node *, int); +static struct usb_audio20_cluster uaudio20_mixer_get_cluster(uint8_t, + const struct uaudio_terminal_node *); +static uint16_t uaudio20_mixer_determine_class(const struct uaudio_terminal_node *, + struct uaudio_mixer_node *); +static uint16_t uaudio20_mixer_feature_name(const struct uaudio_terminal_node *, + struct uaudio_mixer_node *); +static void uaudio20_mixer_find_inputs_sub(struct uaudio_terminal_node *, + const uint8_t *, uint8_t, struct uaudio_search_result *); +static const void *uaudio20_mixer_verify_desc(const void *, uint32_t); +static usb_error_t uaudio20_set_speed(struct usb_device *, uint8_t, + uint8_t, uint32_t); + +/* USB audio v1.0 and v2.0 */ + +static void uaudio_chan_fill_info_sub(struct uaudio_softc *, + struct usb_device *, uint32_t, uint8_t, uint8_t); +static void uaudio_chan_fill_info(struct uaudio_softc *, + struct usb_device *); +static void uaudio_mixer_add_ctl_sub(struct uaudio_softc *, + struct uaudio_mixer_node *); +static void uaudio_mixer_add_ctl(struct uaudio_softc *, + struct uaudio_mixer_node *); static void uaudio_mixer_fill_info(struct uaudio_softc *, struct usb_device *, void *); -static uint16_t uaudio_mixer_get(struct usb_device *, uint8_t, - struct uaudio_mixer_node *); static void uaudio_mixer_ctl_set(struct uaudio_softc *, struct uaudio_mixer_node *, uint8_t, int32_t val); -static usb_error_t uaudio_set_speed(struct usb_device *, uint8_t, uint32_t); static int uaudio_mixer_signext(uint8_t, int); static int uaudio_mixer_bsd2value(struct uaudio_mixer_node *, int32_t val); -static const void *uaudio_mixer_verify_desc(const void *, uint32_t); static void uaudio_mixer_init(struct uaudio_softc *); +static const struct uaudio_terminal_node *uaudio_mixer_get_input( + const struct uaudio_terminal_node *, uint8_t); +static const struct uaudio_terminal_node *uaudio_mixer_get_output( + const struct uaudio_terminal_node *, uint8_t); +static void uaudio_mixer_find_outputs_sub(struct uaudio_terminal_node *, + uint8_t, uint8_t, struct uaudio_search_result *); static uint8_t umidi_convert_to_usb(struct umidi_sub_chan *, uint8_t, uint8_t); static struct umidi_sub_chan *umidi_sub_by_fifo(struct usb_fifo *); static void umidi_start_read(struct usb_fifo *); @@ -413,9 +479,6 @@ static int umidi_detach(device_t dev); #ifdef USB_DEBUG static void uaudio_chan_dump_ep_desc( const usb_endpoint_descriptor_audio_t *); -static void uaudio_mixer_dump_cluster(uint8_t, - const struct uaudio_terminal_node *); -static const char *uaudio_mixer_get_terminal_name(uint16_t); #endif static const struct usb_config @@ -614,10 +677,12 @@ uaudio_attach(device_t dev) id = usbd_get_interface_descriptor(uaa->iface); - uaudio_chan_fill_info(sc, uaa->device); - + /* must fill mixer info before channel info */ uaudio_mixer_fill_info(sc, uaa->device, id); + /* fill channel info */ + uaudio_chan_fill_info(sc, uaa->device); + DPRINTF("audio rev %d.%02x\n", sc->sc_audio_rev >> 8, sc->sc_audio_rev & 0xff); @@ -628,7 +693,7 @@ uaudio_attach(device_t dev) if (sc->sc_play_chan.valid) { device_printf(dev, "Play: %d Hz, %d ch, %s format.\n", sc->sc_play_chan.sample_rate, - sc->sc_play_chan.p_asf1d->bNrChannels, + sc->sc_play_chan.channels, sc->sc_play_chan.p_fmt->description); } else { device_printf(dev, "No playback.\n"); @@ -637,7 +702,7 @@ uaudio_attach(device_t dev) if (sc->sc_rec_chan.valid) { device_printf(dev, "Record: %d Hz, %d ch, %s format.\n", sc->sc_rec_chan.sample_rate, - sc->sc_rec_chan.p_asf1d->bNrChannels, + sc->sc_play_chan.channels, sc->sc_rec_chan.p_fmt->description); } else { device_printf(dev, "No recording.\n"); @@ -857,28 +922,88 @@ uaudio_record_fix_fs(usb_endpoint_descri } } +static usb_error_t +uaudio20_check_rate(struct usb_device *udev, uint8_t iface_no, + uint8_t clockid, uint32_t rate) +{ + struct usb_device_request req; + usb_error_t error; + uint8_t data[255]; + uint16_t actlen; + uint16_t rates; + uint16_t x; + + DPRINTFN(6, "ifaceno=%d clockid=%d rate=%u\n", + iface_no, clockid, rate); + + req.bmRequestType = UT_READ_CLASS_INTERFACE; + req.bRequest = UA20_CS_RANGE; + USETW2(req.wValue, UA20_CS_SAM_FREQ_CONTROL, 0); + USETW2(req.wIndex, clockid, iface_no); + USETW(req.wLength, 255); + + error = usbd_do_request_flags(udev, NULL, &req, data, + USB_SHORT_XFER_OK, &actlen, USB_DEFAULT_TIMEOUT); + + if (error != 0 || actlen < 2) + return (USB_ERR_INVAL); + + rates = data[0] | (data[1] << 8); + actlen = (actlen - 2) / 12; + + if (rates > actlen) { + DPRINTF("Too many rates\n"); + rates = actlen; + } + + for (x = 0; x != rates; x++) { + uint32_t min = UGETDW(data + 2 + (12 * x)); + uint32_t max = UGETDW(data + 6 + (12 * x)); + uint32_t res = UGETDW(data + 10 + (12 * x)); + + if (res == 0) { + DPRINTF("Zero residue\n"); + res = 1; + } + + if (min > max) { + DPRINTF("Swapped max and min\n"); + uint32_t temp; + temp = min; + min = max; + max = temp; + } + + if (rate >= min && rate <= max && + (((rate - min) % res) == 0)) { + return (0); + } + } + return (USB_ERR_INVAL); +} + static void uaudio_chan_fill_info_sub(struct uaudio_softc *sc, struct usb_device *udev, uint32_t rate, uint8_t channels, uint8_t bit_resolution) { struct usb_descriptor *desc = NULL; - const struct usb_audio_streaming_interface_descriptor *asid = NULL; - const struct usb_audio_streaming_type1_descriptor *asf1d = NULL; - const struct usb_audio_streaming_endpoint_descriptor *sed = NULL; + union uaudio_asid asid = { NULL }; + union uaudio_asf1d asf1d = { NULL }; + union uaudio_sed sed = { NULL }; usb_endpoint_descriptor_audio_t *ed1 = NULL; - const usb_endpoint_descriptor_audio_t *ed2 = NULL; + const struct usb_audio_control_descriptor *acdp = NULL; struct usb_config_descriptor *cd = usbd_get_config_descriptor(udev); struct usb_interface_descriptor *id; - const struct uaudio_format *p_fmt; + const struct uaudio_format *p_fmt = NULL; struct uaudio_chan *chan; uint16_t curidx = 0xFFFF; uint16_t lastidx = 0xFFFF; uint16_t alt_index = 0; - uint16_t wFormat; + uint16_t audio_rev = 0; + uint16_t x; uint8_t ep_dir; uint8_t bChannels; uint8_t bBitResolution; - uint8_t x; uint8_t audio_if = 0; uint8_t uma_if_class; @@ -923,171 +1048,258 @@ uaudio_chan_fill_info_sub(struct uaudio_ sc->sc_midi_chan.valid = 1; } } - asid = NULL; - asf1d = NULL; + asid.v1 = NULL; + asf1d.v1 = NULL; ed1 = NULL; - ed2 = NULL; - sed = NULL; + sed.v1 = NULL; + } + + if ((acdp == NULL) && + (desc->bDescriptorType == UDESC_CS_INTERFACE) && + (desc->bDescriptorSubtype == AS_GENERAL) && + (desc->bDescriptorSubtype == UDESCSUB_AC_HEADER) && + (desc->bLength >= sizeof(*acdp))) { + acdp = (void *)desc; + audio_rev = UGETW(acdp->bcdADC); } - if ((desc->bDescriptorType == UDESC_CS_INTERFACE) && + + if ((acdp != NULL) && + (desc->bDescriptorType == UDESC_CS_INTERFACE) && (desc->bDescriptorSubtype == AS_GENERAL) && - (desc->bLength >= sizeof(*asid))) { - if (asid == NULL) { - asid = (void *)desc; + (asid.v1 == NULL)) { + if (audio_rev >= UAUDIO_VERSION_30) { + /* FALLTHROUGH */ + } else if (audio_rev >= UAUDIO_VERSION_20) { + if (desc->bLength >= sizeof(*asid.v2)) { + asid.v2 = (void *)desc; + } + } else { + if (desc->bLength >= sizeof(*asid.v1)) { + asid.v1 = (void *)desc; + } } } - if ((desc->bDescriptorType == UDESC_CS_INTERFACE) && + if ((acdp != NULL) && + (desc->bDescriptorType == UDESC_CS_INTERFACE) && (desc->bDescriptorSubtype == FORMAT_TYPE) && - (desc->bLength >= sizeof(*asf1d))) { - if (asf1d == NULL) { - asf1d = (void *)desc; - if (asf1d->bFormatType != FORMAT_TYPE_I) { - DPRINTFN(11, "ignored bFormatType = %d\n", - asf1d->bFormatType); - asf1d = NULL; - continue; - } - if (asf1d->bLength < (sizeof(*asf1d) + - ((asf1d->bSamFreqType == 0) ? 6 : - (asf1d->bSamFreqType * 3)))) { - DPRINTFN(11, "'asf1d' descriptor is too short\n"); - asf1d = NULL; - continue; + (asf1d.v1 == NULL)) { + if (audio_rev >= UAUDIO_VERSION_30) { + /* FALLTHROUGH */ + } else if (audio_rev >= UAUDIO_VERSION_20) { + if (desc->bLength >= sizeof(*asf1d.v2)) + asf1d.v2 = (void *)desc; + } else { + if (desc->bLength >= sizeof(*asf1d.v1)) { + asf1d.v1 = (void *)desc; + + if (asf1d.v1->bFormatType != FORMAT_TYPE_I) { + DPRINTFN(11, "ignored bFormatType = %d\n", + asf1d.v1->bFormatType); + asf1d.v1 = NULL; + continue; + } + if (desc->bLength < (sizeof(*asf1d.v1) + + ((asf1d.v1->bSamFreqType == 0) ? 6 : + (asf1d.v1->bSamFreqType * 3)))) { + DPRINTFN(11, "invalid descriptor, " + "too short\n"); + asf1d.v1 = NULL; + continue; + } } } } if ((desc->bDescriptorType == UDESC_ENDPOINT) && - (desc->bLength >= UEP_MINSIZE)) { - if (ed1 == NULL) { - ed1 = (void *)desc; - if (UE_GET_XFERTYPE(ed1->bmAttributes) != UE_ISOCHRONOUS) { - ed1 = NULL; - } + (desc->bLength >= UEP_MINSIZE) && + (ed1 == NULL)) { + ed1 = (void *)desc; + if (UE_GET_XFERTYPE(ed1->bmAttributes) != UE_ISOCHRONOUS) { + ed1 = NULL; + continue; } } - if ((desc->bDescriptorType == UDESC_CS_ENDPOINT) && + if ((acdp != NULL) && + (desc->bDescriptorType == UDESC_CS_ENDPOINT) && (desc->bDescriptorSubtype == AS_GENERAL) && - (desc->bLength >= sizeof(*sed))) { - if (sed == NULL) { - sed = (void *)desc; + (sed.v1 == NULL)) { + if (audio_rev >= UAUDIO_VERSION_30) { + /* FALLTHROUGH */ + } else if (audio_rev >= UAUDIO_VERSION_20) { + if (desc->bLength >= sizeof(*sed.v2)) + sed.v2 = (void *)desc; + } else { + if (desc->bLength >= sizeof(*sed.v1)) + sed.v1 = (void *)desc; } } - if (audio_if && asid && asf1d && ed1 && sed) { + if (audio_if == 0 || asid.v1 == NULL || + asf1d.v1 == NULL || ed1 == NULL || + sed.v1 == NULL) { + /* need more descriptors */ + continue; + } + + ep_dir = UE_GET_DIR(ed1->bEndpointAddress); + + /* We ignore sync endpoint information until further. */ + + if (audio_rev >= UAUDIO_VERSION_30) { + goto next_ep; + } else if (audio_rev >= UAUDIO_VERSION_20) { + + uint32_t dwFormat; + uint8_t bSubslotSize; + + dwFormat = UGETDW(asid.v2->bmFormats); + bChannels = asid.v2->bNrChannels; + bBitResolution = asf1d.v2->bBitResolution; + bSubslotSize = asf1d.v2->bSubslotSize; + + if (bBitResolution != (bSubslotSize * 8)) { + DPRINTF("Invalid bSubslotSize\n"); + goto next_ep; + } + + if ((bChannels != channels) || + (bBitResolution != bit_resolution)) { + DPRINTF("Wrong number of channels\n"); + goto next_ep; + } + + for (p_fmt = uaudio20_formats; + p_fmt->wFormat != 0; p_fmt++) { + if ((p_fmt->wFormat & dwFormat) && + (p_fmt->bPrecision == bBitResolution)) + break; + } + + if (p_fmt->wFormat == 0) { + DPRINTF("Unsupported audio format\n"); + goto next_ep; + } + + for (x = 0; x != 256; x++) { + if (ep_dir == UE_DIR_OUT) { + if (!(sc->sc_mixer_clocks.bit_output[x / 8] & + (1 << (x % 8)))) { + continue; + } + } else { + if (!(sc->sc_mixer_clocks.bit_input[x / 8] & + (1 << (x % 8)))) { + continue; + } + } - ep_dir = UE_GET_DIR(ed1->bEndpointAddress); + DPRINTF("Checking clock ID=%d\n", x); - /* We ignore sync endpoint information until further. */ + if (uaudio20_check_rate(udev, + sc->sc_mixer_iface_no, x, rate)) { + DPRINTF("Unsupported sampling " + "rate, id=%d\n", x); + goto next_ep; + } + } + } else { + uint16_t wFormat; - wFormat = UGETW(asid->wFormatTag); - bChannels = UAUDIO_MAX_CHAN(asf1d->bNrChannels); - bBitResolution = asf1d->bBitResolution; + wFormat = UGETW(asid.v1->wFormatTag); + bChannels = UAUDIO_MAX_CHAN(asf1d.v1->bNrChannels); + bBitResolution = asf1d.v1->bBitResolution; - if (asf1d->bSamFreqType == 0) { + if (asf1d.v1->bSamFreqType == 0) { DPRINTFN(16, "Sample rate: %d-%dHz\n", - UA_SAMP_LO(asf1d), UA_SAMP_HI(asf1d)); + UA_SAMP_LO(asf1d.v1), + UA_SAMP_HI(asf1d.v1)); - if ((rate >= UA_SAMP_LO(asf1d)) && - (rate <= UA_SAMP_HI(asf1d))) { + if ((rate >= UA_SAMP_LO(asf1d.v1)) && + (rate <= UA_SAMP_HI(asf1d.v1))) goto found_rate; - } } else { - for (x = 0; x < asf1d->bSamFreqType; x++) { + for (x = 0; x < asf1d.v1->bSamFreqType; x++) { DPRINTFN(16, "Sample rate = %dHz\n", - UA_GETSAMP(asf1d, x)); + UA_GETSAMP(asf1d.v1, x)); - if (rate == UA_GETSAMP(asf1d, x)) { + if (rate == UA_GETSAMP(asf1d.v1, x)) goto found_rate; - } } } - - audio_if = 0; - continue; + goto next_ep; found_rate: - - for (p_fmt = uaudio_formats; - p_fmt->wFormat; - p_fmt++) { + for (p_fmt = uaudio10_formats; + p_fmt->wFormat != 0; p_fmt++) { if ((p_fmt->wFormat == wFormat) && - (p_fmt->bPrecision == bBitResolution)) { - goto found_format; - } + (p_fmt->bPrecision == bBitResolution)) + break; + } + if (p_fmt->wFormat == 0) { + DPRINTF("Unsupported audio format\n"); + goto next_ep; } - audio_if = 0; - continue; - - found_format: - - if ((bChannels == channels) && - (bBitResolution == bit_resolution)) { + if ((bChannels != channels) || + (bBitResolution != bit_resolution)) { + DPRINTF("Wrong number of channels\n"); + goto next_ep; + } + } - chan = (ep_dir == UE_DIR_IN) ? - &sc->sc_rec_chan : - &sc->sc_play_chan; + chan = (ep_dir == UE_DIR_IN) ? + &sc->sc_rec_chan : &sc->sc_play_chan; - if ((chan->valid == 0) && usbd_get_iface(udev, curidx)) { + if (chan->valid != 0 || + usbd_get_iface(udev, curidx) == NULL) { + DPRINTF("Channel already exists or " + "interface is not valid\n"); + goto next_ep; + } - chan->valid = 1; + chan->valid = 1; #ifdef USB_DEBUG - uaudio_chan_dump_ep_desc(ed1); - uaudio_chan_dump_ep_desc(ed2); - - if (sed->bmAttributes & UA_SED_FREQ_CONTROL) { - DPRINTFN(2, "FREQ_CONTROL\n"); - } - if (sed->bmAttributes & UA_SED_PITCH_CONTROL) { - DPRINTFN(2, "PITCH_CONTROL\n"); - } + uaudio_chan_dump_ep_desc(ed1); #endif - DPRINTF("Sample rate = %dHz, channels = %d, " - "bits = %d, format = %s\n", rate, channels, - bit_resolution, p_fmt->description); - - chan->sample_rate = rate; - chan->p_asid = asid; - chan->p_asf1d = asf1d; - chan->p_ed1 = ed1; - chan->p_ed2 = ed2; - chan->p_fmt = p_fmt; - chan->p_sed = sed; - chan->iface_index = curidx; - chan->iface_alt_index = alt_index; - - if (ep_dir == UE_DIR_IN) - chan->usb_cfg = - uaudio_cfg_record; - else - chan->usb_cfg = - uaudio_cfg_play; - - chan->sample_size = (( - UAUDIO_MAX_CHAN(chan->p_asf1d->bNrChannels) * - chan->p_asf1d->bBitResolution) / 8); - - if (ep_dir == UE_DIR_IN && - usbd_get_speed(udev) == USB_SPEED_FULL) { - uaudio_record_fix_fs(ed1, - chan->sample_size * (rate / 1000), - chan->sample_size * (rate / 4000)); - } + DPRINTF("Sample rate = %dHz, channels = %d, " + "bits = %d, format = %s\n", rate, channels, + bit_resolution, p_fmt->description); + + chan->sample_rate = rate; + chan->p_asf1d = asf1d; + chan->p_ed1 = ed1; + chan->p_fmt = p_fmt; + chan->p_sed = sed; + chan->iface_index = curidx; + chan->iface_alt_index = alt_index; - if (sc->sc_sndstat_valid) { - sbuf_printf(&sc->sc_sndstat, "\n\t" - "mode %d.%d:(%s) %dch, %d/%dbit, %s, %dHz", - curidx, alt_index, - (ep_dir == UE_DIR_IN) ? "input" : "output", - asf1d->bNrChannels, asf1d->bBitResolution, - asf1d->bSubFrameSize * 8, - p_fmt->description, rate); - } - } - } - audio_if = 0; - continue; - } + if (ep_dir == UE_DIR_IN) + chan->usb_cfg = uaudio_cfg_record; + else + chan->usb_cfg = uaudio_cfg_play; + + chan->sample_size = (UAUDIO_MAX_CHAN(channels) * + p_fmt->bPrecision) / 8; + chan->channels = channels; + + if (ep_dir == UE_DIR_IN && + usbd_get_speed(udev) == USB_SPEED_FULL) { + uaudio_record_fix_fs(ed1, + chan->sample_size * (rate / 1000), + chan->sample_size * (rate / 4000)); + } + + if (sc->sc_sndstat_valid != 0) { + sbuf_printf(&sc->sc_sndstat, "\n\t" + "mode %d.%d:(%s) %dch, %dbit, %s, %dHz", + curidx, alt_index, + (ep_dir == UE_DIR_IN) ? "input" : "output", + channels, p_fmt->bPrecision, + p_fmt->description, rate); + } + + next_ep: + sed.v1 = NULL; + ed1 = NULL; } } @@ -1390,7 +1602,7 @@ uaudio_chan_init(struct uaudio_softc *sc format = ch->p_fmt->freebsd_fmt; - switch (ch->p_asf1d->bNrChannels) { + switch (ch->channels) { case 2: /* stereo */ format = SND_FORMAT(format, 2, 0); @@ -1402,7 +1614,7 @@ uaudio_chan_init(struct uaudio_softc *sc default: /* surround and more */ format = feeder_matrix_default_format( - SND_FORMAT(format, ch->p_asf1d->bNrChannels, 0)); + SND_FORMAT(format, ch->channels, 0)); break; } @@ -1438,13 +1650,43 @@ uaudio_chan_init(struct uaudio_softc *sc * Only set the sample rate if the channel reports that it * supports the frequency control. */ - if (ch->p_sed->bmAttributes & UA_SED_FREQ_CONTROL) { + + if (sc->sc_audio_rev >= UAUDIO_VERSION_30) { + /* FALLTHROUGH */ + } else if (sc->sc_audio_rev >= UAUDIO_VERSION_20) { + unsigned int x; + + for (x = 0; x != 256; x++) { + if (dir == PCMDIR_PLAY) { + if (!(sc->sc_mixer_clocks.bit_output[x / 8] & + (1 << (x % 8)))) { + continue; + } + } else { + if (!(sc->sc_mixer_clocks.bit_input[x / 8] & + (1 << (x % 8)))) { + continue; + } + } + + if (uaudio20_set_speed(sc->sc_udev, + sc->sc_mixer_iface_no, x, ch->sample_rate)) { + /* + * If the endpoint is adaptive setting + * the speed may fail. + */ + DPRINTF("setting of sample rate failed! " + "(continuing anyway)\n"); + } + } + } else if (ch->p_sed.v1->bmAttributes & UA_SED_FREQ_CONTROL) { if (uaudio_set_speed(sc->sc_udev, endpoint, ch->sample_rate)) { /* - * If the endpoint is adaptive setting the speed may - * fail. + * If the endpoint is adaptive setting the + * speed may fail. */ - DPRINTF("setting of sample rate failed! (continuing anyway)\n"); + DPRINTF("setting of sample rate failed! " + "(continuing anyway)\n"); } } if (usbd_transfer_setup(sc->sc_udev, &iface_index, ch->xfer, @@ -1679,13 +1921,10 @@ uaudio_mixer_add_ctl(struct uaudio_softc /* determine min and max values */ - mc->minval = uaudio_mixer_get(sc->sc_udev, GET_MIN, mc); - - mc->minval = uaudio_mixer_signext(mc->type, mc->minval); - - mc->maxval = uaudio_mixer_get(sc->sc_udev, GET_MAX, mc); - - mc->maxval = uaudio_mixer_signext(mc->type, mc->maxval); + mc->minval = uaudio_mixer_get(sc->sc_udev, + sc->sc_audio_rev, GET_MIN, mc); + mc->maxval = uaudio_mixer_get(sc->sc_udev, + sc->sc_audio_rev, GET_MAX, mc); /* check if max and min was swapped */ @@ -1701,7 +1940,8 @@ uaudio_mixer_add_ctl(struct uaudio_softc mc->mul = 1; /* compute value alignment */ - res = uaudio_mixer_get(sc->sc_udev, GET_RES, mc); + res = uaudio_mixer_get(sc->sc_udev, + sc->sc_audio_rev, GET_RES, mc); DPRINTF("Resolution = %d\n", (int)res); } @@ -1724,42 +1964,12 @@ uaudio_mixer_add_ctl(struct uaudio_softc } static void -uaudio_mixer_add_input(struct uaudio_softc *sc, - const struct uaudio_terminal_node *iot, int id) -{ -#ifdef USB_DEBUG - const struct usb_audio_input_terminal *d = iot[id].u.it; - - DPRINTFN(3, "bTerminalId=%d wTerminalType=0x%04x " - "bAssocTerminal=%d bNrChannels=%d wChannelConfig=%d " - "iChannelNames=%d\n", - d->bTerminalId, UGETW(d->wTerminalType), d->bAssocTerminal, - d->bNrChannels, UGETW(d->wChannelConfig), - d->iChannelNames); -#endif -} - -static void -uaudio_mixer_add_output(struct uaudio_softc *sc, - const struct uaudio_terminal_node *iot, int id) -{ -#ifdef USB_DEBUG - const struct usb_audio_output_terminal *d = iot[id].u.ot; - - DPRINTFN(3, "bTerminalId=%d wTerminalType=0x%04x " - "bAssocTerminal=%d bSourceId=%d iTerminal=%d\n", - d->bTerminalId, UGETW(d->wTerminalType), d->bAssocTerminal, - d->bSourceId, d->iTerminal); -#endif -} - -static void uaudio_mixer_add_mixer(struct uaudio_softc *sc, const struct uaudio_terminal_node *iot, int id) { struct uaudio_mixer_node mix; - const struct usb_audio_mixer_unit_0 *d0 = iot[id].u.mu; + const struct usb_audio_mixer_unit_0 *d0 = iot[id].u.mu_v1; const struct usb_audio_mixer_unit_1 *d1; uint32_t bno; /* bit number */ @@ -1780,8 +1990,8 @@ uaudio_mixer_add_mixer(struct uaudio_sof ichs = 0; for (i = 0; i < d0->bNrInPins; i++) { - ichs += (uaudio_mixer_get_cluster(d0->baSourceId[i], iot) - .bNrChannels); + ichs += uaudio_mixer_get_cluster( + d0->baSourceId[i], iot).bNrChannels; } d1 = (const void *)(d0->baSourceId + d0->bNrInPins); @@ -1798,23 +2008,22 @@ uaudio_mixer_add_mixer(struct uaudio_sof uaudio_mixer_determine_class(&iot[id], &mix); mix.type = MIX_SIGNED_16; - if (uaudio_mixer_verify_desc(d0, ((ichs * ochs) + 7) / 8) == NULL) { + if (uaudio_mixer_verify_desc(d0, ((ichs * ochs) + 7) / 8) == NULL) return; - } + for (p = i = 0; i < d0->bNrInPins; i++) { - chs = uaudio_mixer_get_cluster(d0->baSourceId[i], iot).bNrChannels; + chs = uaudio_mixer_get_cluster( + d0->baSourceId[i], iot).bNrChannels; mc = 0; for (c = 0; c < chs; c++) { mo = 0; for (o = 0; o < ochs; o++) { bno = ((p + c) * ochs) + o; - if (BIT_TEST(d1->bmControls, bno)) { + if (BIT_TEST(d1->bmControls, bno)) mo++; - } } - if (mo == 1) { + if (mo == 1) mc++; - } } if ((mc == chs) && (chs <= MIX_MAX_CHAN)) { @@ -1824,62 +2033,183 @@ uaudio_mixer_add_mixer(struct uaudio_sof for (c = 0; c < chs; c++) { for (o = 0; o < ochs; o++) { bno = ((p + c) * ochs) + o; - if (BIT_TEST(d1->bmControls, bno)) { + if (BIT_TEST(d1->bmControls, bno)) mix.wValue[mc++] = MAKE_WORD(p + c + 1, o + 1); - } } } mix.nchan = chs; uaudio_mixer_add_ctl(sc, &mix); - } else { - /* XXX */ } p += chs; } } static void -uaudio_mixer_add_selector(struct uaudio_softc *sc, +uaudio20_mixer_add_mixer(struct uaudio_softc *sc, const struct uaudio_terminal_node *iot, int id) { - const struct usb_audio_selector_unit *d = iot[id].u.su; struct uaudio_mixer_node mix; - uint16_t i; - DPRINTFN(3, "bUnitId=%d bNrInPins=%d\n", - d->bUnitId, d->bNrInPins); + const struct usb_audio20_mixer_unit_0 *d0 = iot[id].u.mu_v2; + const struct usb_audio20_mixer_unit_1 *d1; - if (d->bNrInPins == 0) { - return; - } - memset(&mix, 0, sizeof(mix)); + uint32_t bno; /* bit number */ + uint32_t p; /* bit number accumulator */ + uint32_t mo; /* matching outputs */ + uint32_t mc; /* matching channels */ + uint32_t ichs; /* input channels */ + uint32_t ochs; /* output channels */ + uint32_t c; + uint32_t chs; /* channels */ + uint32_t i; + uint32_t o; - mix.wIndex = MAKE_WORD(d->bUnitId, sc->sc_mixer_iface_no); - mix.wValue[0] = MAKE_WORD(0, 0); - uaudio_mixer_determine_class(&iot[id], &mix); - mix.nchan = 1; - mix.type = MIX_SELECTOR; + DPRINTFN(3, "bUnitId=%d bNrInPins=%d\n", + d0->bUnitId, d0->bNrInPins); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Sep 17 15:45:28 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5E6D1106566C; Mon, 17 Sep 2012 15:45:28 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 492EE8FC14; Mon, 17 Sep 2012 15:45:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8HFjSZ3046170; Mon, 17 Sep 2012 15:45:28 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8HFjSGb046167; Mon, 17 Sep 2012 15:45:28 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201209171545.q8HFjSGb046167@svn.freebsd.org> From: Glen Barber Date: Mon, 17 Sep 2012 15:45:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240610 - stable/9/release X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2012 15:45:28 -0000 Author: gjb (doc,ports committer) Date: Mon Sep 17 15:45:27 2012 New Revision: 240610 URL: http://svn.freebsd.org/changeset/base/240610 Log: MFC r232714 (nwhitehorn): Make sure not to tar up CVS directories if this ports tree is a CVS checkout. PR: bin/165868 Modified: stable/9/release/Makefile Directory Properties: stable/9/release/ (props changed) Modified: stable/9/release/Makefile ============================================================================== --- stable/9/release/Makefile Mon Sep 17 15:43:57 2012 (r240609) +++ stable/9/release/Makefile Mon Sep 17 15:45:27 2012 (r240610) @@ -87,6 +87,7 @@ ports.txz: -mkdir -p ${DISTDIR}/usr ln -fs ${PORTSDIR} ${DISTDIR}/usr/ports cd ${DISTDIR} && tar cLvJf ${.OBJDIR}/ports.txz \ + --exclude CVS --exclude .svn \ --exclude usr/ports/distfiles --exclude usr/ports/packages \ --exclude 'usr/ports/INDEX*' --exclude work usr/ports From owner-svn-src-all@FreeBSD.ORG Mon Sep 17 15:48:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 505D91065670; Mon, 17 Sep 2012 15:48:43 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from onyx.glenbarber.us (onyx.glenbarber.us [IPv6:2607:fc50:1000:c200::face]) by mx1.freebsd.org (Postfix) with ESMTP id E17668FC18; Mon, 17 Sep 2012 15:48:42 +0000 (UTC) Received: from glenbarber.us (75-146-225-65-Philadelphia.hfc.comcastbusiness.net [75.146.225.65]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: gjb) by onyx.glenbarber.us (Postfix) with ESMTPSA id 27E8323F6D9; Mon, 17 Sep 2012 11:48:42 -0400 (EDT) Date: Mon, 17 Sep 2012 11:48:40 -0400 From: Glen Barber To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Message-ID: <20120917154840.GF1295@glenbarber.us> References: <201209171545.q8HFjSGb046167@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="wj9ZLJVQDRFjGSdK" Content-Disposition: inline In-Reply-To: <201209171545.q8HFjSGb046167@svn.freebsd.org> X-Operating-System: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Subject: Re: svn commit: r240610 - stable/9/release X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2012 15:48:43 -0000 --wj9ZLJVQDRFjGSdK Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Sep 17, 2012 at 03:45:28PM +0000, Glen Barber wrote: > Author: gjb (doc,ports committer) > Date: Mon Sep 17 15:45:27 2012 > New Revision: 240610 > URL: http://svn.freebsd.org/changeset/base/240610 >=20 > Log: > MFC r232714 (nwhitehorn): > =20 > Make sure not to tar up CVS directories if this ports tree is a CVS > checkout. > =20 > PR: bin/165868 >=20 Forgot to add: Approved by: nwhitehorn Glen --wj9ZLJVQDRFjGSdK Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQEcBAEBCAAGBQJQV0ZYAAoJEFJPDDeguUajR5QH/1gaDYfigQk+7X9jLwfEG3hG +4p/i+pvL2v0w1Eysyk/AzqvT/o3ySW5pelLoi004Nmc4xPS2RqsiHDMkTSaUBwn h09C3UZRiEiWsr5XXvJ9/MHD9JfpwhKlYLPRFD1KkOoeHW7htYyz43irWZJbIWis Ash9XJGCQIQa+eJuUCBZFhgkIeYPLZbKBe1SZ2dsG7bHD6GJ7Xi2fC4UjFKZP52v lBVIag3deuD6JMePlcWc/DXo36s/j0DPe+SdTTaaPqefG+xagcess1lFyDTuZ49t Y+IQdD/4y+eBnhmaLcmcy+csOSOA7m2KJCoAkEik4mDztMl7Wxe3rR/Wk1C0GQk= =d2qj -----END PGP SIGNATURE----- --wj9ZLJVQDRFjGSdK-- From owner-svn-src-all@FreeBSD.ORG Mon Sep 17 16:05:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DC059106566C; Mon, 17 Sep 2012 16:05:03 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C0A718FC0C; Mon, 17 Sep 2012 16:05:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8HG53Wl048881; Mon, 17 Sep 2012 16:05:03 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8HG53Hd048878; Mon, 17 Sep 2012 16:05:03 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201209171605.q8HG53Hd048878@svn.freebsd.org> From: Jim Harris Date: Mon, 17 Sep 2012 16:05:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240611 - stable/9/sys/dev/isci/scil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2012 16:05:04 -0000 Author: jimharris Date: Mon Sep 17 16:05:03 2012 New Revision: 240611 URL: http://svn.freebsd.org/changeset/base/240611 Log: MFC r240514: isci(4): Fix SCSI/ATA translation for SCSI_WRITE_BUFFER w/ mode==0x7 (download microcode with offsets, save, and activate). SATI translation layer was incorrectly using allocation length instead of blocks, and was constructing the ATA command incorrectly. Also change #define to specify that the 512 block size here is specific for DOWNLOAD_MICROCODE, and does not relate to the device's logical block size. Modified: stable/9/sys/dev/isci/scil/sati_util.c stable/9/sys/dev/isci/scil/sati_write_buffer.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/isci/scil/sati_util.c ============================================================================== --- stable/9/sys/dev/isci/scil/sati_util.c Mon Sep 17 15:45:27 2012 (r240610) +++ stable/9/sys/dev/isci/scil/sati_util.c Mon Sep 17 16:05:03 2012 (r240611) @@ -1976,6 +1976,8 @@ void sati_ata_download_microcode_constru ) { U8 * register_fis = sati_cb_get_h2d_register_fis_address(ata_io); + U32 allocation_blocks = allocation_length >> 9; + U32 buffer_blkoffset = buffer_offset >> 9; sati_set_ata_command(register_fis, ATA_DOWNLOAD_MICROCODE); sati_set_ata_features(register_fis, mode); @@ -1987,9 +1989,10 @@ void sati_ata_download_microcode_constru } else //mode == 0x03 { - sati_set_ata_sector_count(register_fis, (U8) (allocation_length >> 9)); - sati_set_ata_lba_low(register_fis, (U8) (allocation_length >> 17)); - sati_set_ata_lba_high(register_fis, (U8) (buffer_offset >> 9)); + sati_set_ata_sector_count(register_fis, (U8) (allocation_blocks & 0xff)); + sati_set_ata_lba_low(register_fis, (U8) ((allocation_blocks >> 8) & 0xff)); + sati_set_ata_lba_mid(register_fis, (U8) (buffer_blkoffset & 0xff)); + sati_set_ata_lba_high(register_fis, (U8) ((buffer_blkoffset >> 8) & 0xff)); } if((allocation_length == 0) && (buffer_offset == 0)) Modified: stable/9/sys/dev/isci/scil/sati_write_buffer.c ============================================================================== --- stable/9/sys/dev/isci/scil/sati_write_buffer.c Mon Sep 17 15:45:27 2012 (r240610) +++ stable/9/sys/dev/isci/scil/sati_write_buffer.c Mon Sep 17 16:05:03 2012 (r240611) @@ -66,7 +66,7 @@ __FBSDID("$FreeBSD$"); #define WRITE_BUFFER_WRITE_DATA 0x02 #define WRITE_BUFFER_DOWNLOAD_SAVE 0x05 #define WRITE_BUFFER_OFFSET_DOWNLOAD_SAVE 0x07 -#define BLOCK_SIZE 512 +#define DOWNLOAD_MICROCODE_BLOCK_SIZE 512 /** * @brief This method will translate the SCSI Write Buffer command @@ -89,6 +89,7 @@ SATI_STATUS sati_write_buffer_translate_ U8 * cdb = sati_cb_get_cdb_address(scsi_io); SATI_STATUS status = SATI_FAILURE; U32 allocation_length; + U32 allocation_blocks; U32 buffer_offset; allocation_length = ((sati_get_cdb_byte(cdb, 6) << 16) | @@ -100,11 +101,13 @@ SATI_STATUS sati_write_buffer_translate_ (sati_get_cdb_byte(cdb, 5))); sequence->allocation_length = allocation_length; + allocation_blocks = allocation_length / DOWNLOAD_MICROCODE_BLOCK_SIZE; switch(sati_get_cdb_byte(cdb, 1)) { case WRITE_BUFFER_WRITE_DATA: - if((allocation_length == BLOCK_SIZE) && (buffer_offset == 0) && + if((allocation_length == DOWNLOAD_MICROCODE_BLOCK_SIZE) && + (buffer_offset == 0) && (sati_get_cdb_byte(cdb, 2) == 0)) { sati_ata_write_buffer_construct(ata_io, sequence); @@ -146,8 +149,9 @@ SATI_STATUS sati_write_buffer_translate_ case WRITE_BUFFER_OFFSET_DOWNLOAD_SAVE: if(((allocation_length & 0x000001FF) == 0) && //Bits 08:00 need to be zero per SAT2v7 ((buffer_offset & 0x000001FF) == 0) && - (allocation_length <= sequence->device->max_blocks_per_microcode_command) && - (allocation_length >= sequence->device->min_blocks_per_microcode_command)) + (allocation_blocks <= sequence->device->max_blocks_per_microcode_command) && + ((allocation_blocks >= sequence->device->min_blocks_per_microcode_command) || + (allocation_length == 0))) { sati_ata_download_microcode_construct( ata_io, From owner-svn-src-all@FreeBSD.ORG Mon Sep 17 16:11:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 058A11065670; Mon, 17 Sep 2012 16:11:23 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E3D528FC0A; Mon, 17 Sep 2012 16:11:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8HGBMaF049781; Mon, 17 Sep 2012 16:11:22 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8HGBMlU049778; Mon, 17 Sep 2012 16:11:22 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201209171611.q8HGBMlU049778@svn.freebsd.org> From: Jim Harris Date: Mon, 17 Sep 2012 16:11: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: r240612 - stable/8/sys/dev/isci/scil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2012 16:11:23 -0000 Author: jimharris Date: Mon Sep 17 16:11:22 2012 New Revision: 240612 URL: http://svn.freebsd.org/changeset/base/240612 Log: MFC r240514: isci(4): Fix SCSI/ATA translation for SCSI_WRITE_BUFFER w/ mode==0x7 (download microcode with offsets, save, and activate). SATI translation layer was incorrectly using allocation length instead of blocks, and was constructing the ATA command incorrectly. Also change #define to specify that the 512 block size here is specific for DOWNLOAD_MICROCODE, and does not relate to the device's logical block size. Modified: stable/8/sys/dev/isci/scil/sati_util.c stable/8/sys/dev/isci/scil/sati_write_buffer.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/isci/ (props changed) Modified: stable/8/sys/dev/isci/scil/sati_util.c ============================================================================== --- stable/8/sys/dev/isci/scil/sati_util.c Mon Sep 17 16:05:03 2012 (r240611) +++ stable/8/sys/dev/isci/scil/sati_util.c Mon Sep 17 16:11:22 2012 (r240612) @@ -1976,6 +1976,8 @@ void sati_ata_download_microcode_constru ) { U8 * register_fis = sati_cb_get_h2d_register_fis_address(ata_io); + U32 allocation_blocks = allocation_length >> 9; + U32 buffer_blkoffset = buffer_offset >> 9; sati_set_ata_command(register_fis, ATA_DOWNLOAD_MICROCODE); sati_set_ata_features(register_fis, mode); @@ -1987,9 +1989,10 @@ void sati_ata_download_microcode_constru } else //mode == 0x03 { - sati_set_ata_sector_count(register_fis, (U8) (allocation_length >> 9)); - sati_set_ata_lba_low(register_fis, (U8) (allocation_length >> 17)); - sati_set_ata_lba_high(register_fis, (U8) (buffer_offset >> 9)); + sati_set_ata_sector_count(register_fis, (U8) (allocation_blocks & 0xff)); + sati_set_ata_lba_low(register_fis, (U8) ((allocation_blocks >> 8) & 0xff)); + sati_set_ata_lba_mid(register_fis, (U8) (buffer_blkoffset & 0xff)); + sati_set_ata_lba_high(register_fis, (U8) ((buffer_blkoffset >> 8) & 0xff)); } if((allocation_length == 0) && (buffer_offset == 0)) Modified: stable/8/sys/dev/isci/scil/sati_write_buffer.c ============================================================================== --- stable/8/sys/dev/isci/scil/sati_write_buffer.c Mon Sep 17 16:05:03 2012 (r240611) +++ stable/8/sys/dev/isci/scil/sati_write_buffer.c Mon Sep 17 16:11:22 2012 (r240612) @@ -66,7 +66,7 @@ __FBSDID("$FreeBSD$"); #define WRITE_BUFFER_WRITE_DATA 0x02 #define WRITE_BUFFER_DOWNLOAD_SAVE 0x05 #define WRITE_BUFFER_OFFSET_DOWNLOAD_SAVE 0x07 -#define BLOCK_SIZE 512 +#define DOWNLOAD_MICROCODE_BLOCK_SIZE 512 /** * @brief This method will translate the SCSI Write Buffer command @@ -89,6 +89,7 @@ SATI_STATUS sati_write_buffer_translate_ U8 * cdb = sati_cb_get_cdb_address(scsi_io); SATI_STATUS status = SATI_FAILURE; U32 allocation_length; + U32 allocation_blocks; U32 buffer_offset; allocation_length = ((sati_get_cdb_byte(cdb, 6) << 16) | @@ -100,11 +101,13 @@ SATI_STATUS sati_write_buffer_translate_ (sati_get_cdb_byte(cdb, 5))); sequence->allocation_length = allocation_length; + allocation_blocks = allocation_length / DOWNLOAD_MICROCODE_BLOCK_SIZE; switch(sati_get_cdb_byte(cdb, 1)) { case WRITE_BUFFER_WRITE_DATA: - if((allocation_length == BLOCK_SIZE) && (buffer_offset == 0) && + if((allocation_length == DOWNLOAD_MICROCODE_BLOCK_SIZE) && + (buffer_offset == 0) && (sati_get_cdb_byte(cdb, 2) == 0)) { sati_ata_write_buffer_construct(ata_io, sequence); @@ -146,8 +149,9 @@ SATI_STATUS sati_write_buffer_translate_ case WRITE_BUFFER_OFFSET_DOWNLOAD_SAVE: if(((allocation_length & 0x000001FF) == 0) && //Bits 08:00 need to be zero per SAT2v7 ((buffer_offset & 0x000001FF) == 0) && - (allocation_length <= sequence->device->max_blocks_per_microcode_command) && - (allocation_length >= sequence->device->min_blocks_per_microcode_command)) + (allocation_blocks <= sequence->device->max_blocks_per_microcode_command) && + ((allocation_blocks >= sequence->device->min_blocks_per_microcode_command) || + (allocation_length == 0))) { sati_ata_download_microcode_construct( ata_io, From owner-svn-src-all@FreeBSD.ORG Mon Sep 17 16:12:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 56817106564A; Mon, 17 Sep 2012 16:12:54 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 412DC8FC20; Mon, 17 Sep 2012 16:12:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8HGCssu050021; Mon, 17 Sep 2012 16:12:54 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8HGCscS050018; Mon, 17 Sep 2012 16:12:54 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201209171612.q8HGCscS050018@svn.freebsd.org> From: Jim Harris Date: Mon, 17 Sep 2012 16:12:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240613 - stable/7/sys/dev/isci/scil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2012 16:12:54 -0000 Author: jimharris Date: Mon Sep 17 16:12:53 2012 New Revision: 240613 URL: http://svn.freebsd.org/changeset/base/240613 Log: MFC r240514: isci(4): Fix SCSI/ATA translation for SCSI_WRITE_BUFFER w/ mode==0x7 (download microcode with offsets, save, and activate). SATI translation layer was incorrectly using allocation length instead of blocks, and was constructing the ATA command incorrectly. Also change #define to specify that the 512 block size here is specific for DOWNLOAD_MICROCODE, and does not relate to the device's logical block size. Modified: stable/7/sys/dev/isci/scil/sati_util.c stable/7/sys/dev/isci/scil/sati_write_buffer.c Directory Properties: stable/7/sys/ (props changed) Modified: stable/7/sys/dev/isci/scil/sati_util.c ============================================================================== --- stable/7/sys/dev/isci/scil/sati_util.c Mon Sep 17 16:11:22 2012 (r240612) +++ stable/7/sys/dev/isci/scil/sati_util.c Mon Sep 17 16:12:53 2012 (r240613) @@ -1976,6 +1976,8 @@ void sati_ata_download_microcode_constru ) { U8 * register_fis = sati_cb_get_h2d_register_fis_address(ata_io); + U32 allocation_blocks = allocation_length >> 9; + U32 buffer_blkoffset = buffer_offset >> 9; sati_set_ata_command(register_fis, ATA_DOWNLOAD_MICROCODE); sati_set_ata_features(register_fis, mode); @@ -1987,9 +1989,10 @@ void sati_ata_download_microcode_constru } else //mode == 0x03 { - sati_set_ata_sector_count(register_fis, (U8) (allocation_length >> 9)); - sati_set_ata_lba_low(register_fis, (U8) (allocation_length >> 17)); - sati_set_ata_lba_high(register_fis, (U8) (buffer_offset >> 9)); + sati_set_ata_sector_count(register_fis, (U8) (allocation_blocks & 0xff)); + sati_set_ata_lba_low(register_fis, (U8) ((allocation_blocks >> 8) & 0xff)); + sati_set_ata_lba_mid(register_fis, (U8) (buffer_blkoffset & 0xff)); + sati_set_ata_lba_high(register_fis, (U8) ((buffer_blkoffset >> 8) & 0xff)); } if((allocation_length == 0) && (buffer_offset == 0)) Modified: stable/7/sys/dev/isci/scil/sati_write_buffer.c ============================================================================== --- stable/7/sys/dev/isci/scil/sati_write_buffer.c Mon Sep 17 16:11:22 2012 (r240612) +++ stable/7/sys/dev/isci/scil/sati_write_buffer.c Mon Sep 17 16:12:53 2012 (r240613) @@ -66,7 +66,7 @@ __FBSDID("$FreeBSD$"); #define WRITE_BUFFER_WRITE_DATA 0x02 #define WRITE_BUFFER_DOWNLOAD_SAVE 0x05 #define WRITE_BUFFER_OFFSET_DOWNLOAD_SAVE 0x07 -#define BLOCK_SIZE 512 +#define DOWNLOAD_MICROCODE_BLOCK_SIZE 512 /** * @brief This method will translate the SCSI Write Buffer command @@ -89,6 +89,7 @@ SATI_STATUS sati_write_buffer_translate_ U8 * cdb = sati_cb_get_cdb_address(scsi_io); SATI_STATUS status = SATI_FAILURE; U32 allocation_length; + U32 allocation_blocks; U32 buffer_offset; allocation_length = ((sati_get_cdb_byte(cdb, 6) << 16) | @@ -100,11 +101,13 @@ SATI_STATUS sati_write_buffer_translate_ (sati_get_cdb_byte(cdb, 5))); sequence->allocation_length = allocation_length; + allocation_blocks = allocation_length / DOWNLOAD_MICROCODE_BLOCK_SIZE; switch(sati_get_cdb_byte(cdb, 1)) { case WRITE_BUFFER_WRITE_DATA: - if((allocation_length == BLOCK_SIZE) && (buffer_offset == 0) && + if((allocation_length == DOWNLOAD_MICROCODE_BLOCK_SIZE) && + (buffer_offset == 0) && (sati_get_cdb_byte(cdb, 2) == 0)) { sati_ata_write_buffer_construct(ata_io, sequence); @@ -146,8 +149,9 @@ SATI_STATUS sati_write_buffer_translate_ case WRITE_BUFFER_OFFSET_DOWNLOAD_SAVE: if(((allocation_length & 0x000001FF) == 0) && //Bits 08:00 need to be zero per SAT2v7 ((buffer_offset & 0x000001FF) == 0) && - (allocation_length <= sequence->device->max_blocks_per_microcode_command) && - (allocation_length >= sequence->device->min_blocks_per_microcode_command)) + (allocation_blocks <= sequence->device->max_blocks_per_microcode_command) && + ((allocation_blocks >= sequence->device->min_blocks_per_microcode_command) || + (allocation_length == 0))) { sati_ata_download_microcode_construct( ata_io, From owner-svn-src-all@FreeBSD.ORG Mon Sep 17 16:39:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DBC84106564A; Mon, 17 Sep 2012 16:39:32 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C64558FC0C; Mon, 17 Sep 2012 16:39:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8HGdWbu053426; Mon, 17 Sep 2012 16:39:32 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8HGdW4Z053423; Mon, 17 Sep 2012 16:39:32 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201209171639.q8HGdW4Z053423@svn.freebsd.org> From: Jim Harris Date: Mon, 17 Sep 2012 16:39:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240614 - releng/9.1/sys/dev/isci/scil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2012 16:39:33 -0000 Author: jimharris Date: Mon Sep 17 16:39:32 2012 New Revision: 240614 URL: http://svn.freebsd.org/changeset/base/240614 Log: MFC r240514: isci(4): Fix SCSI/ATA translation for SCSI_WRITE_BUFFER w/ mode==0x7 (download microcode with offsets, save, and activate). SATI translation layer was incorrectly using allocation length instead of blocks, and was constructing the ATA command incorrectly. Also change #define to specify that the 512 block size here is specific for DOWNLOAD_MICROCODE, and does not relate to the device's logical block size. Approved by: re (kib) Modified: releng/9.1/sys/dev/isci/scil/sati_util.c releng/9.1/sys/dev/isci/scil/sati_write_buffer.c Directory Properties: releng/9.1/sys/ (props changed) releng/9.1/sys/dev/ (props changed) Modified: releng/9.1/sys/dev/isci/scil/sati_util.c ============================================================================== --- releng/9.1/sys/dev/isci/scil/sati_util.c Mon Sep 17 16:12:53 2012 (r240613) +++ releng/9.1/sys/dev/isci/scil/sati_util.c Mon Sep 17 16:39:32 2012 (r240614) @@ -1976,6 +1976,8 @@ void sati_ata_download_microcode_constru ) { U8 * register_fis = sati_cb_get_h2d_register_fis_address(ata_io); + U32 allocation_blocks = allocation_length >> 9; + U32 buffer_blkoffset = buffer_offset >> 9; sati_set_ata_command(register_fis, ATA_DOWNLOAD_MICROCODE); sati_set_ata_features(register_fis, mode); @@ -1987,9 +1989,10 @@ void sati_ata_download_microcode_constru } else //mode == 0x03 { - sati_set_ata_sector_count(register_fis, (U8) (allocation_length >> 9)); - sati_set_ata_lba_low(register_fis, (U8) (allocation_length >> 17)); - sati_set_ata_lba_high(register_fis, (U8) (buffer_offset >> 9)); + sati_set_ata_sector_count(register_fis, (U8) (allocation_blocks & 0xff)); + sati_set_ata_lba_low(register_fis, (U8) ((allocation_blocks >> 8) & 0xff)); + sati_set_ata_lba_mid(register_fis, (U8) (buffer_blkoffset & 0xff)); + sati_set_ata_lba_high(register_fis, (U8) ((buffer_blkoffset >> 8) & 0xff)); } if((allocation_length == 0) && (buffer_offset == 0)) Modified: releng/9.1/sys/dev/isci/scil/sati_write_buffer.c ============================================================================== --- releng/9.1/sys/dev/isci/scil/sati_write_buffer.c Mon Sep 17 16:12:53 2012 (r240613) +++ releng/9.1/sys/dev/isci/scil/sati_write_buffer.c Mon Sep 17 16:39:32 2012 (r240614) @@ -66,7 +66,7 @@ __FBSDID("$FreeBSD$"); #define WRITE_BUFFER_WRITE_DATA 0x02 #define WRITE_BUFFER_DOWNLOAD_SAVE 0x05 #define WRITE_BUFFER_OFFSET_DOWNLOAD_SAVE 0x07 -#define BLOCK_SIZE 512 +#define DOWNLOAD_MICROCODE_BLOCK_SIZE 512 /** * @brief This method will translate the SCSI Write Buffer command @@ -89,6 +89,7 @@ SATI_STATUS sati_write_buffer_translate_ U8 * cdb = sati_cb_get_cdb_address(scsi_io); SATI_STATUS status = SATI_FAILURE; U32 allocation_length; + U32 allocation_blocks; U32 buffer_offset; allocation_length = ((sati_get_cdb_byte(cdb, 6) << 16) | @@ -100,11 +101,13 @@ SATI_STATUS sati_write_buffer_translate_ (sati_get_cdb_byte(cdb, 5))); sequence->allocation_length = allocation_length; + allocation_blocks = allocation_length / DOWNLOAD_MICROCODE_BLOCK_SIZE; switch(sati_get_cdb_byte(cdb, 1)) { case WRITE_BUFFER_WRITE_DATA: - if((allocation_length == BLOCK_SIZE) && (buffer_offset == 0) && + if((allocation_length == DOWNLOAD_MICROCODE_BLOCK_SIZE) && + (buffer_offset == 0) && (sati_get_cdb_byte(cdb, 2) == 0)) { sati_ata_write_buffer_construct(ata_io, sequence); @@ -146,8 +149,9 @@ SATI_STATUS sati_write_buffer_translate_ case WRITE_BUFFER_OFFSET_DOWNLOAD_SAVE: if(((allocation_length & 0x000001FF) == 0) && //Bits 08:00 need to be zero per SAT2v7 ((buffer_offset & 0x000001FF) == 0) && - (allocation_length <= sequence->device->max_blocks_per_microcode_command) && - (allocation_length >= sequence->device->min_blocks_per_microcode_command)) + (allocation_blocks <= sequence->device->max_blocks_per_microcode_command) && + ((allocation_blocks >= sequence->device->min_blocks_per_microcode_command) || + (allocation_length == 0))) { sati_ata_download_microcode_construct( ata_io, From owner-svn-src-all@FreeBSD.ORG Mon Sep 17 19:06:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DBD0A1065674; Mon, 17 Sep 2012 19:06:35 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BE0B68FC24; Mon, 17 Sep 2012 19:06:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8HJ6ZaQ070964; Mon, 17 Sep 2012 19:06:35 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8HJ6ZEC070957; Mon, 17 Sep 2012 19:06:35 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201209171906.q8HJ6ZEC070957@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 17 Sep 2012 19:06:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240615 - in head: share/man/man4 sys/dev/usb/input sys/dev/usb/quirk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2012 19:06:36 -0000 Author: hselasky Date: Mon Sep 17 19:06:35 2012 New Revision: 240615 URL: http://svn.freebsd.org/changeset/base/240615 Log: Add UQ_UMS_IGNORE quirk. Wrap two long lines. Some minor spelling correction. PR: usb/171721 Modified: head/share/man/man4/usb_quirk.4 head/sys/dev/usb/input/ums.c head/sys/dev/usb/quirk/usb_quirk.c head/sys/dev/usb/quirk/usb_quirk.h Modified: head/share/man/man4/usb_quirk.4 ============================================================================== --- head/share/man/man4/usb_quirk.4 Mon Sep 17 16:39:32 2012 (r240614) +++ head/share/man/man4/usb_quirk.4 Mon Sep 17 19:06:35 2012 (r240615) @@ -66,6 +66,8 @@ device should be ignored by hid class device should be ignored by kbd class .It UQ_KBD_BOOTPROTO device should set the boot protocol +.It UQ_UMS_IGNORE +device should be ignored by ums class .It UQ_MS_BAD_CLASS doesn't identify properly .It UQ_MS_LEADING_BYTE Modified: head/sys/dev/usb/input/ums.c ============================================================================== --- head/sys/dev/usb/input/ums.c Mon Sep 17 16:39:32 2012 (r240614) +++ head/sys/dev/usb/input/ums.c Mon Sep 17 19:06:35 2012 (r240615) @@ -381,6 +381,9 @@ ums_probe(device_t dev) if (uaa->info.bInterfaceClass != UICLASS_HID) return (ENXIO); + if (usb_test_quirk(uaa, UQ_UMS_IGNORE)) + return (ENXIO); + if ((uaa->info.bInterfaceSubClass == UISUBCLASS_BOOT) && (uaa->info.bInterfaceProtocol == UIPROTO_MOUSE)) return (BUS_PROBE_DEFAULT); Modified: head/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- head/sys/dev/usb/quirk/usb_quirk.c Mon Sep 17 16:39:32 2012 (r240614) +++ head/sys/dev/usb/quirk/usb_quirk.c Mon Sep 17 19:06:35 2012 (r240615) @@ -494,6 +494,7 @@ static const char *usb_quirk_str[USB_QUI [UQ_HID_IGNORE] = "UQ_HID_IGNORE", [UQ_KBD_IGNORE] = "UQ_KBD_IGNORE", [UQ_KBD_BOOTPROTO] = "UQ_KBD_BOOTPROTO", + [UQ_UMS_IGNORE] = "UQ_UMS_IGNORE", [UQ_MS_BAD_CLASS] = "UQ_MS_BAD_CLASS", [UQ_MS_LEADING_BYTE] = "UQ_MS_LEADING_BYTE", [UQ_MS_REVZ] = "UQ_MS_REVZ", Modified: head/sys/dev/usb/quirk/usb_quirk.h ============================================================================== --- head/sys/dev/usb/quirk/usb_quirk.h Mon Sep 17 16:39:32 2012 (r240614) +++ head/sys/dev/usb/quirk/usb_quirk.h Mon Sep 17 19:06:35 2012 (r240615) @@ -29,7 +29,7 @@ enum { /* - * Keep in sync with theusb_quirk_str usb_quirk.c, and with the + * Keep in sync with usb_quirk_str in usb_quirk.c, and with * share/man/man4/usb_quirk.4 */ UQ_NONE, /* not a valid quirk */ @@ -49,6 +49,7 @@ enum { UQ_HID_IGNORE, /* device should be ignored by hid class */ UQ_KBD_IGNORE, /* device should be ignored by kbd class */ UQ_KBD_BOOTPROTO, /* device should set the boot protocol */ + UQ_UMS_IGNORE, /* device should be ignored by ums class */ UQ_MS_BAD_CLASS, /* doesn't identify properly */ UQ_MS_LEADING_BYTE, /* mouse sends an unknown leading byte */ UQ_MS_REVZ, /* mouse has Z-axis reversed */ @@ -64,7 +65,10 @@ enum { UQ_CFG_INDEX_0, /* select configuration index 0 by default */ UQ_ASSUME_CM_OVER_DATA, /* assume cm over data feature */ - /* USB Mass Storage Quirks. See "storage/umass.c" for a detailed description. */ + /* + * USB Mass Storage Quirks. See "storage/umass.c" for a + * detailed description. + */ UQ_MSC_NO_TEST_UNIT_READY, /* send start/stop instead of TUR */ UQ_MSC_NO_RS_CLEAR_UA, /* does not reset Unit Att. */ UQ_MSC_NO_START_STOP, /* does not support start/stop */ From owner-svn-src-all@FreeBSD.ORG Mon Sep 17 19:23:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 62521106564A; Mon, 17 Sep 2012 19:23:02 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1069D8FC08; Mon, 17 Sep 2012 19:23:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8HJN27D073084; Mon, 17 Sep 2012 19:23:02 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8HJN1IZ073080; Mon, 17 Sep 2012 19:23:01 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201209171923.q8HJN1IZ073080@svn.freebsd.org> From: Jim Harris Date: Mon, 17 Sep 2012 19:23:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240616 - in head/sys/dev: nvd nvme X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2012 19:23:02 -0000 Author: jimharris Date: Mon Sep 17 19:23:01 2012 New Revision: 240616 URL: http://svn.freebsd.org/changeset/base/240616 Log: This is the first of several commits which will add NVM Express (NVMe) support to FreeBSD. A full description of the overall functionality being added is below. nvmexpress.org defines NVM Express as "an optimized register interface, command set and feature set fo PCI Express (PCIe)-based Solid-State Drives (SSDs)." This commit adds nvme(4) and nvd(4) driver source code and Makefiles to the tree. Full NVMe functionality description: Add nvme(4) and nvd(4) drivers and nvmecontrol(8) for NVM Express (NVMe) device support. There will continue to be ongoing work on NVM Express support, but there is more than enough to allow for evaluation of pre-production NVM Express devices as well as soliciting feedback. Questions and feedback are welcome. nvme(4) implements NVMe hardware abstraction and is a provider of NVMe namespaces. The closest equivalent of an NVMe namespace is a SCSI LUN. nvd(4) is an NVMe consumer, surfacing NVMe namespaces as GEOM disks. nvmecontrol(8) is used for NVMe configuration and management. The following are currently supported: nvme(4) - full mandatory NVM command set support - per-CPU IO queues (enabled by default but configurable) - per-queue sysctls for statistics and full command/completion queue dumps for debugging - registration API for NVMe namespace consumers - I/O error handling (except for timeoutsee below) - compilation switches for support back to stable-7 nvd(4) - BIO_DELETE and BIO_FLUSH (if supported by controller) - proper BIO_ORDERED handling nvmecontrol(8) - devlist: list NVMe controllers and their namespaces - identify: display controller or namespace identify data in human-readable or hex format - perftest: quick and dirty performance test to measure raw performance of NVMe device without userspace/physio/GEOM overhead The following are still work in progress and will be completed over the next 3-6 months in rough priority order: - complete man pages - firmware download and activation - asynchronous error requests - command timeout error handling - controller resets - nvmecontrol(8) log page retrieval This has been primarily tested on amd64, with light testing on i386. I would be happy to provide assistance to anyone interested in porting this to other architectures, but am not currently planning to do this work myself. Big-endian and dmamap sync for command/completion queues are the main areas that would need to be addressed. The nvme(4) driver currently has references to Chatham, which is an Intel-developed prototype board which is not fully spec compliant. These references will all be removed over time. Sponsored by: Intel Contributions from: Joe Golio/EMC Added: head/sys/dev/nvd/ head/sys/dev/nvd/nvd.c (contents, props changed) head/sys/dev/nvme/ head/sys/dev/nvme/nvme.c (contents, props changed) head/sys/dev/nvme/nvme.h (contents, props changed) head/sys/dev/nvme/nvme_ctrlr.c (contents, props changed) head/sys/dev/nvme/nvme_ctrlr_cmd.c (contents, props changed) head/sys/dev/nvme/nvme_ns.c (contents, props changed) head/sys/dev/nvme/nvme_ns_cmd.c (contents, props changed) head/sys/dev/nvme/nvme_private.h (contents, props changed) head/sys/dev/nvme/nvme_qpair.c (contents, props changed) head/sys/dev/nvme/nvme_sysctl.c (contents, props changed) head/sys/dev/nvme/nvme_test.c (contents, props changed) head/sys/dev/nvme/nvme_uio.c (contents, props changed) Added: head/sys/dev/nvd/nvd.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/nvd/nvd.c Mon Sep 17 19:23:01 2012 (r240616) @@ -0,0 +1,318 @@ +/*- + * Copyright (C) 2012 Intel Corporation + * 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 +#include +#include + +#include +#include + +#include + +struct nvd_disk; + +static disk_ioctl_t nvd_ioctl; +static disk_strategy_t nvd_strategy; + +static void create_geom_disk(void *, struct nvme_namespace *ns); +static void destroy_geom_disk(struct nvd_disk *ndisk); + +static int nvd_load(void); +static void nvd_unload(void); + +MALLOC_DEFINE(M_NVD, "nvd", "nvd(4) allocations"); + +struct nvme_consumer *consumer_handle; + +struct nvd_disk { + + struct bio_queue_head bioq; + struct task bioqtask; + struct mtx bioqlock; + + struct disk *disk; + struct taskqueue *tq; + struct nvme_namespace *ns; + + uint32_t cur_depth; + + TAILQ_ENTRY(nvd_disk) tailq; +}; + +TAILQ_HEAD(, nvd_disk) nvd_head; + +static int nvd_modevent(module_t mod, int type, void *arg) +{ + int error = 0; + + switch (type) { + case MOD_LOAD: + error = nvd_load(); + break; + case MOD_UNLOAD: + nvd_unload(); + break; + default: + break; + } + + return (error); +} + +moduledata_t nvd_mod = { + "nvd", + (modeventhand_t)nvd_modevent, + 0 +}; + +DECLARE_MODULE(nvd, nvd_mod, SI_SUB_DRIVERS, SI_ORDER_ANY); +MODULE_VERSION(nvd, 1); +MODULE_DEPEND(nvd, nvme, 1, 1, 1); + +static int +nvd_load() +{ + + TAILQ_INIT(&nvd_head); + consumer_handle = nvme_register_consumer(create_geom_disk, NULL); + + return (consumer_handle != NULL ? 0 : -1); +} + +static void +nvd_unload() +{ + struct nvd_disk *nvd; + + while (!TAILQ_EMPTY(&nvd_head)) { + nvd = TAILQ_FIRST(&nvd_head); + TAILQ_REMOVE(&nvd_head, nvd, tailq); + destroy_geom_disk(nvd); + free(nvd, M_NVD); + } + + nvme_unregister_consumer(consumer_handle); +} + +static void +nvd_strategy(struct bio *bp) +{ + struct nvd_disk *ndisk; + + ndisk = (struct nvd_disk *)bp->bio_disk->d_drv1; + + mtx_lock(&ndisk->bioqlock); + bioq_insert_tail(&ndisk->bioq, bp); + mtx_unlock(&ndisk->bioqlock); + taskqueue_enqueue(ndisk->tq, &ndisk->bioqtask); +} + +static int +nvd_ioctl(struct disk *ndisk, u_long cmd, void *data, int fflag, + struct thread *td) +{ + int ret = 0; + + switch (cmd) { + default: + ret = EIO; + } + + return (ret); +} + +static void +nvd_done(void *arg, const struct nvme_completion *status) +{ + struct bio *bp; + struct nvd_disk *ndisk; + + bp = (struct bio *)arg; + + ndisk = bp->bio_disk->d_drv1; + + if (atomic_fetchadd_int(&ndisk->cur_depth, -1) == NVME_QD) + taskqueue_enqueue(ndisk->tq, &ndisk->bioqtask); + + /* + * TODO: add more extensive translation of NVMe status codes + * to different bio error codes (i.e. EIO, EINVAL, etc.) + */ + if (status->sf_sc || status->sf_sct) { + bp->bio_error = EIO; + bp->bio_flags |= BIO_ERROR; + bp->bio_resid = bp->bio_bcount; + } else + bp->bio_resid = 0; + + biodone(bp); +} + +static void +nvd_bioq_process(void *arg, int pending) +{ + struct nvd_disk *ndisk = arg; + struct bio *bp; + int err; + + for (;;) { + if (atomic_load_acq_int(&ndisk->cur_depth) >= NVME_QD) + break; + + mtx_lock(&ndisk->bioqlock); + bp = bioq_takefirst(&ndisk->bioq); + mtx_unlock(&ndisk->bioqlock); + if (bp == NULL) + break; + +#ifdef BIO_ORDERED + /* + * BIO_ORDERED flag dictates that all outstanding bios + * must be completed before processing the bio with + * BIO_ORDERED flag set. + */ + if (bp->bio_flags & BIO_ORDERED) { + while (ndisk->cur_depth > 0) { + pause("nvd flush", 1); + } + } +#endif + + bp->bio_driver1 = NULL; + atomic_add_acq_int(&ndisk->cur_depth, 1); + + err = nvme_ns_bio_process(ndisk->ns, bp, nvd_done); + + if (err) { + atomic_add_acq_int(&ndisk->cur_depth, -1); + bp->bio_error = EIO; + bp->bio_flags |= BIO_ERROR; + bp->bio_resid = bp->bio_bcount; + biodone(bp); + } + +#ifdef BIO_ORDERED + /* + * BIO_ORDERED flag dictates that the bio with BIO_ORDERED + * flag set must be completed before proceeding with + * additional bios. + */ + if (bp->bio_flags & BIO_ORDERED) { + while (ndisk->cur_depth > 0) { + pause("nvd flush", 1); + } + } +#endif + } +} + +static void +create_geom_disk(void *arg, struct nvme_namespace *ns) +{ + struct nvd_disk *ndisk; + struct disk *disk; + + ndisk = malloc(sizeof(struct nvd_disk), M_NVD, M_ZERO | M_NOWAIT); + + disk = disk_alloc(); + disk->d_strategy = nvd_strategy; + disk->d_ioctl = nvd_ioctl; + disk->d_name = "nvd"; + disk->d_drv1 = ndisk; + + disk->d_maxsize = nvme_ns_get_max_io_xfer_size(ns); + disk->d_sectorsize = nvme_ns_get_sector_size(ns); + disk->d_mediasize = (off_t)nvme_ns_get_size(ns); + + if (TAILQ_EMPTY(&nvd_head)) + disk->d_unit = 0; + else + disk->d_unit = TAILQ_FIRST(&nvd_head)->disk->d_unit + 1; + + disk->d_flags = 0; + + if (nvme_ns_get_flags(ns) & NVME_NS_DEALLOCATE_SUPPORTED) + disk->d_flags |= DISKFLAG_CANDELETE; + + if (nvme_ns_get_flags(ns) & NVME_NS_FLUSH_SUPPORTED) + disk->d_flags |= DISKFLAG_CANFLUSHCACHE; + + strlcpy(disk->d_ident, nvme_ns_get_serial_number(ns), + sizeof(disk->d_ident)); + +#if __FreeBSD_version >= 900034 + strlcpy(disk->d_descr, nvme_ns_get_model_number(ns), + sizeof(disk->d_descr)); +#endif + + disk_create(disk, DISK_VERSION); + + ndisk->ns = ns; + ndisk->disk = disk; + ndisk->cur_depth = 0; + + mtx_init(&ndisk->bioqlock, "NVD bioq lock", NULL, MTX_DEF); + bioq_init(&ndisk->bioq); + + TASK_INIT(&ndisk->bioqtask, 0, nvd_bioq_process, ndisk); + ndisk->tq = taskqueue_create("nvd_taskq", M_WAITOK, + taskqueue_thread_enqueue, &ndisk->tq); + taskqueue_start_threads(&ndisk->tq, 1, PI_DISK, "nvd taskq"); + + TAILQ_INSERT_HEAD(&nvd_head, ndisk, tailq); +} + +static void +destroy_geom_disk(struct nvd_disk *ndisk) +{ + struct bio *bp; + + taskqueue_free(ndisk->tq); + disk_destroy(ndisk->disk); + + mtx_lock(&ndisk->bioqlock); + for (;;) { + bp = bioq_takefirst(&ndisk->bioq); + if (bp == NULL) + break; + bp->bio_error = EIO; + bp->bio_flags |= BIO_ERROR; + bp->bio_resid = bp->bio_bcount; + + biodone(bp); + } + mtx_unlock(&ndisk->bioqlock); + + mtx_destroy(&ndisk->bioqlock); +} Added: head/sys/dev/nvme/nvme.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/nvme/nvme.c Mon Sep 17 19:23:01 2012 (r240616) @@ -0,0 +1,408 @@ +/*- + * Copyright (C) 2012 Intel Corporation + * 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 + +#include "nvme_private.h" + +struct nvme_consumer { + nvme_consumer_cb_fn_t cb_fn; + void *cb_arg; +}; + +struct nvme_consumer nvme_consumer[NVME_MAX_CONSUMERS]; + +MALLOC_DEFINE(M_NVME, "nvme", "nvme(4) memory allocations"); + +static int nvme_probe(device_t); +static int nvme_attach(device_t); +static int nvme_detach(device_t); + +static devclass_t nvme_devclass; + +static device_method_t nvme_pci_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, nvme_probe), + DEVMETHOD(device_attach, nvme_attach), + DEVMETHOD(device_detach, nvme_detach), + { 0, 0 } +}; + +static driver_t nvme_pci_driver = { + "nvme", + nvme_pci_methods, + sizeof(struct nvme_controller), +}; + +DRIVER_MODULE(nvme, pci, nvme_pci_driver, nvme_devclass, 0, 0); +MODULE_VERSION(nvme, 1); + +static struct _pcsid +{ + u_int32_t type; + const char *desc; +} pci_ids[] = { + { 0x01118086, "NVMe Controller" }, + { CHATHAM_PCI_ID, "Chatham Prototype NVMe Controller" }, + { IDT_PCI_ID, "IDT NVMe Controller" }, + { 0x00000000, NULL } +}; + +static int +nvme_probe (device_t device) +{ + u_int32_t type = pci_get_devid(device); + struct _pcsid *ep = pci_ids; + + while (ep->type && ep->type != type) + ++ep; + + if (ep->desc) { + device_set_desc(device, ep->desc); + return (BUS_PROBE_DEFAULT); + } else + return (ENXIO); +} + +static void +nvme_load(void) +{ +} + +static void +nvme_unload(void) +{ +} + +static void +nvme_shutdown(void) +{ + device_t *devlist; + struct nvme_controller *ctrlr; + union cc_register cc; + union csts_register csts; + int dev, devcount; + + if (devclass_get_devices(nvme_devclass, &devlist, &devcount)) + return; + + for (dev = 0; dev < devcount; dev++) { + /* + * Only notify controller of shutdown when a real shutdown is + * in process, not when a module unload occurs. It seems at + * least some controllers (Chatham at least) don't let you + * re-enable the controller after shutdown notification has + * been received. + */ + ctrlr = DEVICE2SOFTC(devlist[dev]); + cc.raw = nvme_mmio_read_4(ctrlr, cc); + cc.bits.shn = NVME_SHN_NORMAL; + nvme_mmio_write_4(ctrlr, cc, cc.raw); + csts.raw = nvme_mmio_read_4(ctrlr, csts); + while (csts.bits.shst != NVME_SHST_COMPLETE) { + DELAY(5); + csts.raw = nvme_mmio_read_4(ctrlr, csts); + } + } + + free(devlist, M_TEMP); +} + +static int +nvme_modevent(module_t mod, int type, void *arg) +{ + + switch (type) { + case MOD_LOAD: + nvme_load(); + break; + case MOD_UNLOAD: + nvme_unload(); + break; + case MOD_SHUTDOWN: + nvme_shutdown(); + break; + default: + break; + } + + return (0); +} + +moduledata_t nvme_mod = { + "nvme", + (modeventhand_t)nvme_modevent, + 0 +}; + +DECLARE_MODULE(nvme, nvme_mod, SI_SUB_DRIVERS, SI_ORDER_FIRST); + +void +nvme_dump_command(struct nvme_command *cmd) +{ + printf("opc:%x f:%x r1:%x cid:%x nsid:%x r2:%x r3:%x " + "mptr:%qx prp1:%qx prp2:%qx cdw:%x %x %x %x %x %x\n", + cmd->opc, cmd->fuse, cmd->rsvd1, cmd->cid, cmd->nsid, + cmd->rsvd2, cmd->rsvd3, + (long long unsigned int)cmd->mptr, + (long long unsigned int)cmd->prp1, + (long long unsigned int)cmd->prp2, + cmd->cdw10, cmd->cdw11, cmd->cdw12, cmd->cdw13, cmd->cdw14, + cmd->cdw15); +} + +void +nvme_dump_completion(struct nvme_completion *cpl) +{ + printf("cdw0:%08x sqhd:%04x sqid:%04x " + "cid:%04x p:%x sc:%02x sct:%x m:%x dnr:%x\n", + cpl->cdw0, cpl->sqhd, cpl->sqid, + cpl->cid, cpl->p, cpl->sf_sc, cpl->sf_sct, cpl->sf_m, + cpl->sf_dnr); +} + +void +nvme_payload_map(void *arg, bus_dma_segment_t *seg, int nseg, int error) +{ + struct nvme_tracker *tr; + struct nvme_qpair *qpair; + struct nvme_prp_list *prp_list; + uint32_t cur_nseg; + + KASSERT(error == 0, ("nvme_payload_map error != 0\n")); + + tr = (struct nvme_tracker *)arg; + qpair = tr->qpair; + + /* + * Note that we specified PAGE_SIZE for alignment and max + * segment size when creating the bus dma tags. So here + * we can safely just transfer each segment to its + * associated PRP entry. + */ + tr->cmd.prp1 = seg[0].ds_addr; + + if (nseg == 2) { + tr->cmd.prp2 = seg[1].ds_addr; + } else if (nseg > 2) { + KASSERT(tr->prp_list, + ("prp_list needed but not attached to tracker\n")); + cur_nseg = 1; + prp_list = tr->prp_list; + tr->cmd.prp2 = (uint64_t)prp_list->bus_addr; + while (cur_nseg < nseg) { + prp_list->prp[cur_nseg-1] = + (uint64_t)seg[cur_nseg].ds_addr; + cur_nseg++; + } + } + + nvme_qpair_submit_cmd(qpair, tr); +} + +struct nvme_tracker * +nvme_allocate_tracker(struct nvme_controller *ctrlr, boolean_t is_admin, + nvme_cb_fn_t cb_fn, void *cb_arg, uint32_t payload_size, void *payload) +{ + struct nvme_tracker *tr; + struct nvme_qpair *qpair; + uint32_t modulo, offset, num_prps; + boolean_t alloc_prp_list = FALSE; + + if (is_admin) { + qpair = &ctrlr->adminq; + } else { + if (ctrlr->per_cpu_io_queues) + qpair = &ctrlr->ioq[curcpu]; + else + qpair = &ctrlr->ioq[0]; + } + + num_prps = payload_size / PAGE_SIZE; + modulo = payload_size % PAGE_SIZE; + offset = (uint32_t)((uintptr_t)payload % PAGE_SIZE); + + if (modulo || offset) + num_prps += 1 + (modulo + offset - 1) / PAGE_SIZE; + + if (num_prps > 2) + alloc_prp_list = TRUE; + + tr = nvme_qpair_allocate_tracker(qpair, alloc_prp_list); + + memset(&tr->cmd, 0, sizeof(tr->cmd)); + + tr->qpair = qpair; + tr->cb_fn = cb_fn; + tr->cb_arg = cb_arg; + tr->payload_size = payload_size; + + return (tr); +} + +static int +nvme_attach(device_t dev) +{ + struct nvme_controller *ctrlr = DEVICE2SOFTC(dev); + int status; + + status = nvme_ctrlr_construct(ctrlr, dev); + + if (status != 0) + return (status); + + /* + * Reset controller twice to ensure we do a transition from cc.en==1 + * to cc.en==0. This is because we don't really know what status + * the controller was left in when boot handed off to OS. + */ + status = nvme_ctrlr_reset(ctrlr); + if (status != 0) + return (status); + + status = nvme_ctrlr_reset(ctrlr); + if (status != 0) + return (status); + + ctrlr->config_hook.ich_func = nvme_ctrlr_start; + ctrlr->config_hook.ich_arg = ctrlr; + + config_intrhook_establish(&ctrlr->config_hook); + + return (0); +} + +static int +nvme_detach (device_t dev) +{ + struct nvme_controller *ctrlr = DEVICE2SOFTC(dev); + struct nvme_namespace *ns; + int i; + + if (ctrlr->taskqueue) { + taskqueue_drain(ctrlr->taskqueue, &ctrlr->task); + taskqueue_free(ctrlr->taskqueue); + } + + for (i = 0; i < NVME_MAX_NAMESPACES; i++) { + ns = &ctrlr->ns[i]; + if (ns->cdev) + destroy_dev(ns->cdev); + } + + if (ctrlr->cdev) + destroy_dev(ctrlr->cdev); + + for (i = 0; i < ctrlr->num_io_queues; i++) { + nvme_io_qpair_destroy(&ctrlr->ioq[i]); + } + + free(ctrlr->ioq, M_NVME); + + nvme_admin_qpair_destroy(&ctrlr->adminq); + + if (ctrlr->resource != NULL) { + bus_release_resource(dev, SYS_RES_MEMORY, + ctrlr->resource_id, ctrlr->resource); + } + +#ifdef CHATHAM2 + if (ctrlr->chatham_resource != NULL) { + bus_release_resource(dev, SYS_RES_MEMORY, + ctrlr->chatham_resource_id, ctrlr->chatham_resource); + } +#endif + + if (ctrlr->tag) + bus_teardown_intr(ctrlr->dev, ctrlr->res, ctrlr->tag); + + if (ctrlr->res) + bus_release_resource(ctrlr->dev, SYS_RES_IRQ, + rman_get_rid(ctrlr->res), ctrlr->res); + + if (ctrlr->msix_enabled) + pci_release_msi(dev); + + return (0); +} + +static void +nvme_notify_consumer(struct nvme_consumer *consumer) +{ + device_t *devlist; + struct nvme_controller *ctrlr; + int dev, ns, devcount; + + if (devclass_get_devices(nvme_devclass, &devlist, &devcount)) + return; + + for (dev = 0; dev < devcount; dev++) { + ctrlr = DEVICE2SOFTC(devlist[dev]); + for (ns = 0; ns < ctrlr->cdata.nn; ns++) + (*consumer->cb_fn)(consumer->cb_arg, &ctrlr->ns[ns]); + } + + free(devlist, M_TEMP); +} + +struct nvme_consumer * +nvme_register_consumer(nvme_consumer_cb_fn_t cb_fn, void *cb_arg) +{ + int i; + + /* + * TODO: add locking around consumer registration. Not an issue + * right now since we only have one nvme consumer - nvd(4). + */ + for (i = 0; i < NVME_MAX_CONSUMERS; i++) + if (nvme_consumer[i].cb_fn == NULL) { + nvme_consumer[i].cb_fn = cb_fn; + nvme_consumer[i].cb_arg = cb_arg; + + nvme_notify_consumer(&nvme_consumer[i]); + return (&nvme_consumer[i]); + } + + printf("nvme(4): consumer not registered - no slots available\n"); + return (NULL); +} + +void +nvme_unregister_consumer(struct nvme_consumer *consumer) +{ + + consumer->cb_fn = NULL; + consumer->cb_arg = NULL; +} + Added: head/sys/dev/nvme/nvme.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/nvme/nvme.h Mon Sep 17 19:23:01 2012 (r240616) @@ -0,0 +1,738 @@ +/*- + * Copyright (C) 2012 Intel Corporation + * 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$ + */ + +#ifndef __NVME_H__ +#define __NVME_H__ + +#ifdef _KERNEL +#include +#endif + +#define NVME_IDENTIFY_CONTROLLER _IOR('n', 0, struct nvme_controller_data) +#define NVME_IDENTIFY_NAMESPACE _IOR('n', 1, struct nvme_namespace_data) +#define NVME_IO_TEST _IOWR('n', 2, struct nvme_io_test) +#define NVME_BIO_TEST _IOWR('n', 4, struct nvme_io_test) + +/* + * Use to mark a command to apply to all namespaces, or to retrieve global + * log pages. + */ +#define NVME_GLOBAL_NAMESPACE_TAG ((uint32_t)0xFFFFFFFF) + +union cap_lo_register { + uint32_t raw; + struct { + /** maximum queue entries supported */ + uint32_t mqes : 16; + + /** contiguous queues required */ + uint32_t cqr : 1; + + /** arbitration mechanism supported */ + uint32_t ams : 2; + + uint32_t reserved1 : 5; + + /** timeout */ + uint32_t to : 8; + } bits __packed; +} __packed; + +union cap_hi_register { + uint32_t raw; + struct { + /** doorbell stride */ + uint32_t dstrd : 4; + + uint32_t reserved3 : 1; + + /** command sets supported */ + uint32_t css_nvm : 1; + + uint32_t css_reserved : 3; + uint32_t reserved2 : 7; + + /** memory page size minimum */ + uint32_t mpsmin : 4; + + /** memory page size maximum */ + uint32_t mpsmax : 4; + + uint32_t reserved1 : 8; + } bits __packed; +} __packed; + +union cc_register { + uint32_t raw; + struct { + /** enable */ + uint32_t en : 1; + + uint32_t reserved1 : 3; + + /** i/o command set selected */ + uint32_t css : 3; + + /** memory page size */ + uint32_t mps : 4; + + /** arbitration mechanism selected */ + uint32_t ams : 3; + + /** shutdown notification */ + uint32_t shn : 2; + + /** i/o submission queue entry size */ + uint32_t iosqes : 4; + + /** i/o completion queue entry size */ + uint32_t iocqes : 4; + + uint32_t reserved2 : 8; + } bits __packed; +} __packed; + +enum shn_value { + NVME_SHN_NORMAL = 0x1, + NVME_SHN_ABRUPT = 0x2, +}; + +union csts_register { + uint32_t raw; + struct { + /** ready */ + uint32_t rdy : 1; + + /** controller fatal status */ + uint32_t cfs : 1; + + /** shutdown status */ + uint32_t shst : 2; + + uint32_t reserved1 : 28; + } bits __packed; +} __packed; + +enum shst_value { + NVME_SHST_NORMAL = 0x0, + NVME_SHST_OCCURRING = 0x1, + NVME_SHST_COMPLETE = 0x2, +}; + +union aqa_register { + uint32_t raw; + struct { + /** admin submission queue size */ + uint32_t asqs : 12; + + uint32_t reserved1 : 4; + + /** admin completion queue size */ + uint32_t acqs : 12; + + uint32_t reserved2 : 4; + } bits __packed; +} __packed; + +struct nvme_registers +{ + /** controller capabilities */ + union cap_lo_register cap_lo; + union cap_hi_register cap_hi; + + uint32_t vs; /* version */ + uint32_t intms; /* interrupt mask set */ + uint32_t intmc; /* interrupt mask clear */ + + /** controller configuration */ + union cc_register cc; + + uint32_t reserved1; + uint32_t csts; /* controller status */ + uint32_t reserved2; + + /** admin queue attributes */ + union aqa_register aqa; + + uint64_t asq; /* admin submission queue base addr */ + uint64_t acq; /* admin completion queue base addr */ + uint32_t reserved3[0x3f2]; + + struct { + uint32_t sq_tdbl; /* submission queue tail doorbell */ + uint32_t cq_hdbl; /* completion queue head doorbell */ + } doorbell[1] __packed; +} __packed; + +struct nvme_command +{ + /* dword 0 */ + uint16_t opc : 8; /* opcode */ + uint16_t fuse : 2; /* fused operation */ + uint16_t rsvd1 : 6; + uint16_t cid; /* command identifier */ + + /* dword 1 */ + uint32_t nsid; /* namespace identifier */ + + /* dword 2-3 */ + uint32_t rsvd2; + uint32_t rsvd3; + + /* dword 4-5 */ + uint64_t mptr; /* metadata pointer */ + + /* dword 6-7 */ + uint64_t prp1; /* prp entry 1 */ + + /* dword 8-9 */ + uint64_t prp2; /* prp entry 2 */ + + /* dword 10-15 */ + uint32_t cdw10; /* command-specific */ + uint32_t cdw11; /* command-specific */ + uint32_t cdw12; /* command-specific */ + uint32_t cdw13; /* command-specific */ + uint32_t cdw14; /* command-specific */ + uint32_t cdw15; /* command-specific */ +} __packed; + +struct nvme_completion { + + /* dword 0 */ + uint32_t cdw0; /* command-specific */ + + /* dword 1 */ + uint32_t rsvd1; + + /* dword 2 */ + uint16_t sqhd; /* submission queue head pointer */ + uint16_t sqid; /* submission queue identifier */ + + /* dword 3 */ + uint16_t cid; /* command identifier */ + uint16_t p : 1; /* phase tag */ + uint16_t sf_sc : 8; /* status field - status code */ + uint16_t sf_sct : 3; /* status field - status code type */ + uint16_t rsvd2 : 2; + uint16_t sf_m : 1; /* status field - more */ + uint16_t sf_dnr : 1; /* status field - do not retry */ +} __packed; + +struct nvme_dsm_range { + + uint32_t attributes; + uint32_t length; + uint64_t starting_lba; +} __packed; + +/* status code types */ +enum nvme_status_code_type { + NVME_SCT_GENERIC = 0x0, + NVME_SCT_COMMAND_SPECIFIC = 0x1, + NVME_SCT_MEDIA_ERROR = 0x2, + /* 0x3-0x6 - reserved */ + NVME_SCT_VENDOR_SPECIFIC = 0x7, +}; + +/* generic command status codes */ +enum nvme_generic_command_status_code { + NVME_SC_SUCCESS = 0x00, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Sep 17 19:25:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D31BC106566C; Mon, 17 Sep 2012 19:25:24 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A61948FC14; Mon, 17 Sep 2012 19:25:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8HJPORf073385; Mon, 17 Sep 2012 19:25:24 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8HJPOki073382; Mon, 17 Sep 2012 19:25:24 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201209171925.q8HJPOki073382@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 17 Sep 2012 19:25:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240617 - releng/9.1/lib/libc/locale X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2012 19:25:24 -0000 Author: glebius Date: Mon Sep 17 19:25:24 2012 New Revision: 240617 URL: http://svn.freebsd.org/changeset/base/240617 Log: Merge r238182 by theraven@: Restore the __collate_load_error global that was accidentally removed in the xlocale refactoring. Approved by: re (kib) Modified: releng/9.1/lib/libc/locale/collate.c releng/9.1/lib/libc/locale/setrunelocale.c Directory Properties: releng/9.1/lib/libc/ (props changed) Modified: releng/9.1/lib/libc/locale/collate.c ============================================================================== --- releng/9.1/lib/libc/locale/collate.c Mon Sep 17 19:23:01 2012 (r240616) +++ releng/9.1/lib/libc/locale/collate.c Mon Sep 17 19:25:24 2012 (r240617) @@ -56,11 +56,11 @@ __FBSDID("$FreeBSD$"); * We also modify the collation table test functions to search the thread-local * table first and the global table second. */ -#define __collate_load_error (table->__collate_load_error) #define __collate_substitute_nontrivial (table->__collate_substitute_nontrivial) #define __collate_substitute_table_ptr (table->__collate_substitute_table_ptr) #define __collate_char_pri_table_ptr (table->__collate_char_pri_table_ptr) #define __collate_chain_pri_table (table->__collate_chain_pri_table) +int __collate_load_error; struct xlocale_collate __xlocale_global_collate = { @@ -109,7 +109,9 @@ __collate_load(const char *encoding, loc int __collate_load_tables(const char *encoding) { - return __collate_load_tables_l(encoding, &__xlocale_global_collate); + int ret = __collate_load_tables_l(encoding, &__xlocale_global_collate); + __collate_load_error = __xlocale_global_collate.__collate_load_error; + return ret; } int @@ -123,7 +125,7 @@ __collate_load_tables_l(const char *enco /* 'encoding' must be already checked. */ if (strcmp(encoding, "C") == 0 || strcmp(encoding, "POSIX") == 0) { - __collate_load_error = 1; + table->__collate_load_error = 1; return (_LDP_CACHE); } @@ -240,7 +242,7 @@ __collate_load_tables_l(const char *enco break; } } - __collate_load_error = 0; + table->__collate_load_error = 0; return (_LDP_LOADED); } Modified: releng/9.1/lib/libc/locale/setrunelocale.c ============================================================================== --- releng/9.1/lib/libc/locale/setrunelocale.c Mon Sep 17 19:23:01 2012 (r240616) +++ releng/9.1/lib/libc/locale/setrunelocale.c Mon Sep 17 19:25:24 2012 (r240617) @@ -67,7 +67,6 @@ extern _RuneLocale *_Read_RuneMagi(FILE static int __setrunelocale(struct xlocale_ctype *l, const char *); -#define __collate_load_error (table->__collate_load_error) #define __collate_substitute_nontrivial (table->__collate_substitute_nontrivial) #define __collate_substitute_table_ptr (table->__collate_substitute_table_ptr) #define __collate_char_pri_table_ptr (table->__collate_char_pri_table_ptr) From owner-svn-src-all@FreeBSD.ORG Mon Sep 17 19:26:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7DBDD1065673; Mon, 17 Sep 2012 19:26:34 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6863A8FC12; Mon, 17 Sep 2012 19:26:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8HJQYAB073567; Mon, 17 Sep 2012 19:26:34 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8HJQYKV073561; Mon, 17 Sep 2012 19:26:34 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201209171926.q8HJQYKV073561@svn.freebsd.org> From: Jim Harris Date: Mon, 17 Sep 2012 19:26:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240618 - in head/sys: amd64/conf conf i386/conf modules X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2012 19:26:34 -0000 Author: jimharris Date: Mon Sep 17 19:26:33 2012 New Revision: 240618 URL: http://svn.freebsd.org/changeset/base/240618 Log: Integrate nvme(4) and nvd(4) into the amd64 and i386 builds. Sponsored by: Intel Modified: head/sys/amd64/conf/NOTES head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/i386/conf/NOTES head/sys/modules/Makefile Modified: head/sys/amd64/conf/NOTES ============================================================================== --- head/sys/amd64/conf/NOTES Mon Sep 17 19:25:24 2012 (r240617) +++ head/sys/amd64/conf/NOTES Mon Sep 17 19:26:33 2012 (r240618) @@ -428,6 +428,11 @@ device isci options ISCI_LOGGING # enable debugging in isci HAL # +# NVM Express (NVMe) support +device nvme # base NVMe driver +device nvd # expose NVMe namespaces as disks, depends on nvme + +# # SafeNet crypto driver: can be moved to the MI NOTES as soon as # it's tested on a big-endian machine # Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Mon Sep 17 19:25:24 2012 (r240617) +++ head/sys/conf/files.amd64 Mon Sep 17 19:26:33 2012 (r240618) @@ -212,7 +212,17 @@ dev/kbd/kbd.c optional atkbd | sc | uk dev/lindev/full.c optional lindev dev/lindev/lindev.c optional lindev dev/nfe/if_nfe.c optional nfe pci +dev/nvd/nvd.c optional nvd nvme dev/nve/if_nve.c optional nve pci +dev/nvme/nvme.c optional nvme +dev/nvme/nvme_ctrlr.c optional nvme +dev/nvme/nvme_ctrlr_cmd.c optional nvme +dev/nvme/nvme_ns.c optional nvme +dev/nvme/nvme_ns_cmd.c optional nvme +dev/nvme/nvme_qpair.c optional nvme +dev/nvme/nvme_sysctl.c optional nvme +dev/nvme/nvme_test.c optional nvme +dev/nvme/nvme_uio.c optional nvme dev/nvram/nvram.c optional nvram isa dev/random/ivy.c optional random rdrand_rng dev/random/nehemiah.c optional random padlock_rng Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Mon Sep 17 19:25:24 2012 (r240617) +++ head/sys/conf/files.i386 Mon Sep 17 19:26:33 2012 (r240618) @@ -224,7 +224,17 @@ dev/lindev/lindev.c optional lindev dev/mse/mse.c optional mse dev/mse/mse_isa.c optional mse isa dev/nfe/if_nfe.c optional nfe pci +dev/nvd/nvd.c optional nvd nvme dev/nve/if_nve.c optional nve pci +dev/nvme/nvme.c optional nvme +dev/nvme/nvme_ctrlr.c optional nvme +dev/nvme/nvme_ctrlr_cmd.c optional nvme +dev/nvme/nvme_ns.c optional nvme +dev/nvme/nvme_ns_cmd.c optional nvme +dev/nvme/nvme_qpair.c optional nvme +dev/nvme/nvme_sysctl.c optional nvme +dev/nvme/nvme_test.c optional nvme +dev/nvme/nvme_uio.c optional nvme dev/nvram/nvram.c optional nvram isa dev/pcf/pcf_isa.c optional pcf dev/random/ivy.c optional random rdrand_rng Modified: head/sys/i386/conf/NOTES ============================================================================== --- head/sys/i386/conf/NOTES Mon Sep 17 19:25:24 2012 (r240617) +++ head/sys/i386/conf/NOTES Mon Sep 17 19:26:33 2012 (r240618) @@ -747,6 +747,11 @@ device isci options ISCI_LOGGING # enable debugging in isci HAL # +# NVM Express (NVMe) support +device nvme # base NVMe driver +device nvd # expose NVMe namespaces as disks, depends on nvme + +# # SafeNet crypto driver: can be moved to the MI NOTES as soon as # it's tested on a big-endian machine # Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Mon Sep 17 19:25:24 2012 (r240617) +++ head/sys/modules/Makefile Mon Sep 17 19:26:33 2012 (r240618) @@ -244,7 +244,9 @@ SUBDIR= \ ntfs \ ntfs_iconv \ nullfs \ + ${_nvd} \ ${_nve} \ + ${_nvme} \ ${_nvram} \ ${_nwfs} \ ${_nxge} \ @@ -586,9 +588,11 @@ _ixgb= ixgb _ixgbe= ixgbe _mly= mly _nfe= nfe +_nvd= nvd .if ${MK_SOURCELESS_HOST} != "no" _nve= nve .endif +_nvme= nvme _nvram= nvram _nxge= nxge _tpm= tpm @@ -695,9 +699,11 @@ _mthca= mthca .endif _ndis= ndis _nfe= nfe +_nvd= nvd .if ${MK_SOURCELESS_HOST} != "no" _nve= nve .endif +_nvme= nvme _nvram= nvram _nxge= nxge .if ${MK_CDDL} != "no" || defined(ALL_MODULES) From owner-svn-src-all@FreeBSD.ORG Mon Sep 17 19:58:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2089D106564A; Mon, 17 Sep 2012 19:58:03 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0B5298FC19; Mon, 17 Sep 2012 19:58:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8HJw2g3077597; Mon, 17 Sep 2012 19:58:02 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8HJw2pj077595; Mon, 17 Sep 2012 19:58:02 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201209171958.q8HJw2pj077595@svn.freebsd.org> From: Jim Harris Date: Mon, 17 Sep 2012 19:58:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240619 - in head/sys/modules: nvd nvme X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2012 19:58:03 -0000 Author: jimharris Date: Mon Sep 17 19:58:02 2012 New Revision: 240619 URL: http://svn.freebsd.org/changeset/base/240619 Log: Add nvme(4) and nvd(4) Makefiles to the tree. Noticed by: pluknet Pointy-hat to: jimharris Added: head/sys/modules/nvd/ head/sys/modules/nvd/Makefile (contents, props changed) head/sys/modules/nvme/ head/sys/modules/nvme/Makefile (contents, props changed) Added: head/sys/modules/nvd/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/nvd/Makefile Mon Sep 17 19:58:02 2012 (r240619) @@ -0,0 +1,8 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../dev/nvd + +KMOD= nvd +SRCS= nvd.c opt_geom.h device_if.h bus_if.h + +.include Added: head/sys/modules/nvme/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/nvme/Makefile Mon Sep 17 19:58:02 2012 (r240619) @@ -0,0 +1,21 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../dev/nvme + +KMOD = nvme + +SRCS = nvme.c \ + nvme_ctrlr.c \ + nvme_ctrlr_cmd.c \ + nvme_ns.c \ + nvme_ns_cmd.c \ + nvme_qpair.c \ + nvme_sysctl.c \ + nvme_test.c \ + nvme_uio.c \ + \ + bus_if.h \ + device_if.h \ + pci_if.h + +.include From owner-svn-src-all@FreeBSD.ORG Mon Sep 17 21:26:56 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 37DF81065678; Mon, 17 Sep 2012 21:26:56 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EADD98FC21; Mon, 17 Sep 2012 21:26:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8HLQtBv089412; Mon, 17 Sep 2012 21:26:55 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8HLQtrp089409; Mon, 17 Sep 2012 21:26:55 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201209172126.q8HLQtrp089409@svn.freebsd.org> From: Jim Harris Date: Mon, 17 Sep 2012 21:26:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240620 - head/sbin/nvmecontrol X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2012 21:26:56 -0000 Author: jimharris Date: Mon Sep 17 21:26:55 2012 New Revision: 240620 URL: http://svn.freebsd.org/changeset/base/240620 Log: Add nvmecontrol(8) source code and beginnings of a man page to the tree. Sponsored by: Intel Contributions from: Joe Golio/EMC Added: head/sbin/nvmecontrol/ head/sbin/nvmecontrol/Makefile (contents, props changed) head/sbin/nvmecontrol/nvmecontrol.8 (contents, props changed) head/sbin/nvmecontrol/nvmecontrol.c (contents, props changed) Added: head/sbin/nvmecontrol/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/nvmecontrol/Makefile Mon Sep 17 21:26:55 2012 (r240620) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +PROG= nvmecontrol +MAN= nvmecontrol.8 + +.include Added: head/sbin/nvmecontrol/nvmecontrol.8 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/nvmecontrol/nvmecontrol.8 Mon Sep 17 21:26:55 2012 (r240620) @@ -0,0 +1,87 @@ +.\" +.\" Copyright (c) 2012 Intel Corporation +.\" 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 +.\" substantially 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 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. +.\" +.\" nvmecontrol man page. +.\" +.\" Author: Jim Harris +.\" +.\" $FreeBSD$ +.\" +.Dd September 17, 2012 +.Dt NVMECONTROL 8 +.Os +.Sh NAME +.Nm nvmecontrol +.Nd NVM Express control utility +.Sh SYNOPSIS +.Nm +.Ic devlist +.Nm +.Ic identify +.Op Fl v +.Op Fl x +.Aq device id +.Nm +.Ic perftest +.Aq Fl n Ar num_threads +.Aq Fl o Ar read|write +.Op Fl p +.Aq Fl s Ar size_in_bytes +.Aq Fl t Ar time_in_sec +.Aq device id +.Sh DESCRIPTION +NVM Express (NVMe) is a storage protocol standard, for SSDs and other +high-speed storage devices over PCI Express. +.Sh EXAMPLES +.Dl nvmecontrol devlist +.Pp +Display a list of NVMe controllers and namespaces along with their device nodes. +.Dl nvmecontrol identify nvme0 +.Pp +Display a human-readable summary of the nvme0 IDENTIFY_CONTROLLER data. +.Pp +.Dl nvmecontrol identify -x -v nvme0ns1 +.Pp +Display a hexadecimal dump of the nvme0 IDENTIFY_NAMESPACE data for namespace +1. +.Pp +.Dl nvmecontrol perftest -n 32 -o read -s 512 -t 30 nvme0ns1 +.Pp +Run a performance test on nvme0ns1 using 32 kernel threads for 30 seconds. Each +thread will issue a single 512 byte read command. Results are printed to +stdout when 30 seconds expires. +.Pp +.Sh AUTHORS +.An -nosplit +.Nm +was developed by Intel and originally written by +.An Jim Harris Aq jimharris@FreeBSD.org . +.Pp +This man page was written by +.An Jim Harris Aq jimharris@FreeBSD.org . Added: head/sbin/nvmecontrol/nvmecontrol.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/nvmecontrol/nvmecontrol.c Mon Sep 17 21:26:55 2012 (r240620) @@ -0,0 +1,600 @@ +/*- + * Copyright (C) 2012 Intel Corporation + * 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 +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define DEVLIST_USAGE \ +" nvmecontrol devlist\n" + +#define IDENTIFY_USAGE \ +" nvmecontrol identify \n" + +#define PERFTEST_USAGE \ +" nvmecontrol perftest <-n num_threads> <-o read|write>\n" \ +" <-s size_in_bytes> <-t time_in_seconds>\n" \ +" <-i intr|wait> [-f refthread] [-p]\n" \ +" \n" + +static void perftest_usage(void); + +static void +usage(void) +{ + fprintf(stderr, "usage:\n"); + fprintf(stderr, DEVLIST_USAGE); + fprintf(stderr, IDENTIFY_USAGE); + fprintf(stderr, PERFTEST_USAGE); + exit(EX_USAGE); +} + +static void +print_controller_hex(struct nvme_controller_data *cdata, uint32_t length) +{ + uint32_t *p; + uint32_t i, j; + + p = (uint32_t *)cdata; + length /= sizeof(uint32_t); + + for (i = 0; i < length; i+=8) { + printf("%03x: ", i*4); + for (j = 0; j < 8; j++) + printf("%08x ", p[i+j]); + printf("\n"); + } + + printf("\n"); +} + +static void +print_controller(struct nvme_controller_data *cdata) +{ + printf("Controller Capabilities/Features\n"); + printf("================================\n"); + printf("Vendor ID: %04x\n", cdata->vid); + printf("Subsystem Vendor ID: %04x\n", cdata->ssvid); + printf("Serial Number: %s\n", cdata->sn); + printf("Model Number: %s\n", cdata->mn); + printf("Firmware Version: %s\n", cdata->fr); + printf("Recommended Arb Burst: %d\n", cdata->rab); + printf("IEEE OUI Identifier: %02x %02x %02x\n", + cdata->ieee[0], cdata->ieee[1], cdata->ieee[2]); + printf("Multi-Interface Cap: %02x\n", cdata->mic); + /* TODO: Use CAP.MPSMIN to determine true memory page size. */ + printf("Max Data Transfer Size: "); + if (cdata->mdts == 0) + printf("Unlimited\n"); + else + printf("%d\n", PAGE_SIZE * (1 << cdata->mdts)); + printf("\n"); + + printf("Admin Command Set Attributes\n"); + printf("============================\n"); + printf("Security Send/Receive: %s\n", + cdata->oacs.security ? "Supported" : "Not Supported"); + printf("Format NVM: %s\n", + cdata->oacs.format ? "Supported" : "Not Supported"); + printf("Firmware Activate/Download: %s\n", + cdata->oacs.firmware ? "Supported" : "Not Supported"); + printf("Abort Command Limit: %d\n", cdata->acl+1); + printf("Async Event Request Limit: %d\n", cdata->aerl+1); + printf("Number of Firmware Slots: "); + if (cdata->oacs.firmware != 0) + printf("%d\n", cdata->frmw.num_slots); + else + printf("N/A\n"); + printf("Firmware Slot 1 Read-Only: "); + if (cdata->oacs.firmware != 0) + printf("%s\n", cdata->frmw.slot1_ro ? "Yes" : "No"); + else + printf("N/A\n"); + printf("Per-Namespace SMART Log: %s\n", + cdata->lpa.ns_smart ? "Yes" : "No"); + printf("Error Log Page Entries: %d\n", cdata->elpe+1); + printf("Number of Power States: %d\n", cdata->npss+1); + printf("\n"); + + printf("NVM Command Set Attributes\n"); + printf("==========================\n"); + printf("Submission Queue Entry Size\n"); + printf(" Max: %d\n", 1 << cdata->sqes.max); + printf(" Min: %d\n", 1 << cdata->sqes.min); + printf("Completion Queue Entry Size\n"); + printf(" Max: %d\n", 1 << cdata->cqes.max); + printf(" Min: %d\n", 1 << cdata->cqes.min); + printf("Number of Namespaces: %d\n", cdata->nn); + printf("Compare Command: %s\n", + cdata->oncs.compare ? "Supported" : "Not Supported"); + printf("Write Uncorrectable Command: %s\n", + cdata->oncs.write_unc ? "Supported" : "Not Supported"); + printf("Dataset Management Command: %s\n", + cdata->oncs.dsm ? "Supported" : "Not Supported"); + printf("Volatile Write Cache: %s\n", + cdata->vwc.present ? "Present" : "Not Present"); +} + +static void +print_namespace_hex(struct nvme_namespace_data *nsdata, uint32_t length) +{ + uint32_t *p; + uint32_t i, j; + + p = (uint32_t *)nsdata; + length /= sizeof(uint32_t); + + for (i = 0; i < length; i+=8) { + printf("%03x: ", i*4); + for (j = 0; j < 8; j++) + printf("%08x ", p[i+j]); + printf("\n"); + } + + printf("\n"); +} + +static void +print_namespace(struct nvme_namespace_data *nsdata) +{ + uint32_t i; + + printf("Size (in LBAs): %lld (%lldM)\n", + (long long)nsdata->nsze, + (long long)nsdata->nsze / 1024 / 1024); + printf("Capacity (in LBAs): %lld (%lldM)\n", + (long long)nsdata->ncap, + (long long)nsdata->ncap / 1024 / 1024); + printf("Utilization (in LBAs): %lld (%lldM)\n", + (long long)nsdata->nuse, + (long long)nsdata->nuse / 1024 / 1024); + printf("Thin Provisioning: %s\n", + nsdata->nsfeat.thin_prov ? "Supported" : "Not Supported"); + printf("Number of LBA Formats: %d\n", nsdata->nlbaf+1); + printf("Current LBA Format: LBA Format #%d\n", + nsdata->flbas.format); + for (i = 0; i <= nsdata->nlbaf; i++) { + printf("LBA Format #%d:\n", i); + printf(" LBA Data Size: %d\n", + 1 << nsdata->lbaf[i].lbads); + } +} + +static uint32_t +ns_get_sector_size(struct nvme_namespace_data *nsdata) +{ + + return (1 << nsdata->lbaf[0].lbads); +} + + +static void +devlist(int argc, char *argv[]) +{ + struct nvme_controller_data cdata; + struct nvme_namespace_data nsdata; + struct stat devstat; + char name[64], path[64]; + uint32_t i; + int ch, ctrlr, exit_code, fd, found; + + exit_code = EX_OK; + + while ((ch = getopt(argc, argv, "")) != -1) { + switch ((char)ch) { + default: + usage(); + } + } + + ctrlr = -1; + found = 0; + + while (1) { + ctrlr++; + sprintf(name, "nvme%d", ctrlr); + sprintf(path, "/dev/%s", name); + + if (stat(path, &devstat) != 0) + break; + + found++; + + fd = open(path, O_RDWR); + if (fd < 0) { + printf("Could not open %s.\n", path); + exit_code = EX_NOPERM; + continue; + } + + if (ioctl(fd, NVME_IDENTIFY_CONTROLLER, &cdata) == -1) { + printf("ioctl to %s failed.\n", path); + exit_code = EX_IOERR; + continue; + } + + printf("%6s: %s\n", name, cdata.mn); + + for (i = 0; i < cdata.nn; i++) { + sprintf(name, "nvme%dns%d", ctrlr, i+1); + sprintf(path, "/dev/%s", name); + + fd = open(path, O_RDWR); + if (fd < 0) { + printf("Could not open %s.\n", path); + exit_code = EX_NOPERM; + continue; + } + if (ioctl(fd, NVME_IDENTIFY_NAMESPACE, &nsdata) == -1) { + printf("ioctl to %s failed.\n", path); + exit_code = EX_IOERR; + continue; + } + printf(" %10s (%lldGB)\n", + name, + nsdata.nsze * + (long long)ns_get_sector_size(&nsdata) / + 1024 / 1024 / 1024); + } + } + + if (found == 0) + printf("No NVMe controllers found.\n"); + + exit(exit_code); +} + +static void +identify_ctrlr(int argc, char *argv[]) +{ + struct nvme_controller_data cdata; + struct stat devstat; + char path[64]; + int ch, fd, hexflag = 0, hexlength; + int verboseflag = 0; + + while ((ch = getopt(argc, argv, "vx")) != -1) { + switch ((char)ch) { + case 'v': + verboseflag = 1; + break; + case 'x': + hexflag = 1; + break; + default: + usage(); + } + } + + sprintf(path, "/dev/%s", argv[optind]); + + if (stat(path, &devstat) != 0) { + printf("Invalid device node '%s'.\n", path); + exit(EX_IOERR); + } + + fd = open(path, O_RDWR); + if (fd < 0) { + printf("Could not open %s.\n", path); + exit(EX_NOPERM); + } + + if (ioctl(fd, NVME_IDENTIFY_CONTROLLER, &cdata) == -1) { + printf("ioctl to %s failed.\n", path); + exit(EX_IOERR); + } + + if (hexflag == 1) { + if (verboseflag == 1) + hexlength = sizeof(struct nvme_controller_data); + else + hexlength = offsetof(struct nvme_controller_data, + reserved5); + print_controller_hex(&cdata, hexlength); + exit(EX_OK); + } + + if (verboseflag == 1) { + printf("-v not currently supported without -x.\n"); + usage(); + } + + print_controller(&cdata); + exit(EX_OK); +} + +static void +identify_ns(int argc, char *argv[]) +{ + struct nvme_namespace_data nsdata; + struct stat devstat; + char path[64]; + int ch, fd, hexflag = 0, hexlength; + int verboseflag = 0; + + while ((ch = getopt(argc, argv, "vx")) != -1) { + switch ((char)ch) { + case 'v': + verboseflag = 1; + break; + case 'x': + hexflag = 1; + break; + default: + usage(); + } + } + + sprintf(path, "/dev/%s", argv[optind]); + + if (stat(path, &devstat) != 0) { + printf("Invalid device node '%s'.\n", path); + exit(EX_IOERR); + } + + fd = open(path, O_RDWR); + if (fd < 0) { + printf("Could not open %s.\n", path); + exit(EX_NOPERM); + } + + if (ioctl(fd, NVME_IDENTIFY_NAMESPACE, &nsdata) == -1) { + printf("ioctl to %s failed.\n", path); + exit(EX_IOERR); + } + + if (hexflag == 1) { + if (verboseflag == 1) + hexlength = sizeof(struct nvme_namespace_data); + else + hexlength = offsetof(struct nvme_namespace_data, + reserved6); + print_namespace_hex(&nsdata, hexlength); + exit(EX_OK); + } + + if (verboseflag == 1) { + printf("-v not currently supported without -x.\n"); + usage(); + } + + print_namespace(&nsdata); + exit(EX_OK); +} + +static void +identify(int argc, char *argv[]) +{ + char *target; + + if (argc < 2) + usage(); + + while (getopt(argc, argv, "vx") != -1) ; + + target = argv[optind]; + + /* Specified device node must have "nvme" in it. */ + if (strstr(argv[optind], "nvme") == NULL) { + printf("Invalid device node '%s'.\n", argv[optind]); + exit(EX_IOERR); + } + + optreset = 1; + optind = 1; + + /* + * If devicde node contains "ns", we consider it a namespace, + * otherwise, consider it a controller. + */ + if (strstr(target, "ns") == NULL) + identify_ctrlr(argc, argv); + else + identify_ns(argc, argv); +} + +static void +print_perftest(struct nvme_io_test *io_test, bool perthread) +{ + uint32_t i, io_completed = 0, iops, mbps; + + for (i = 0; i < io_test->num_threads; i++) + io_completed += io_test->io_completed[i]; + + iops = io_completed/io_test->time; + mbps = iops * io_test->size / (1024*1024); + + printf("Threads: %2d Size: %6d %5s Time: %3d IO/s: %7d MB/s: %4d\n", + io_test->num_threads, io_test->size, + io_test->opc == NVME_OPC_READ ? "READ" : "WRITE", + io_test->time, iops, mbps); + + if (perthread) + for (i = 0; i < io_test->num_threads; i++) + printf("\t%3d: %8d IO/s\n", i, + io_test->io_completed[i]/io_test->time); + + exit(1); +} + +static void +perftest_usage(void) +{ + fprintf(stderr, "usage:\n"); + fprintf(stderr, PERFTEST_USAGE); + exit(EX_USAGE); +} + +static void +perftest(int argc, char *argv[]) +{ + struct nvme_io_test io_test; + int fd; + char ch; + char *p; + const char *name; + char path[64]; + u_long ioctl_cmd = NVME_IO_TEST; + bool nflag, oflag, sflag, tflag; + int err, perthread = 0; + + nflag = oflag = sflag = tflag = false; + name = NULL; + + memset(&io_test, 0, sizeof(io_test)); + + while ((ch = getopt(argc, argv, "f:i:n:o:ps:t:")) != -1) { + switch (ch) { + case 'f': + if (!strcmp(optarg, "refthread")) + io_test.flags |= NVME_TEST_FLAG_REFTHREAD; + break; + case 'i': + if (!strcmp(optarg, "bio") || + !strcmp(optarg, "wait")) + ioctl_cmd = NVME_BIO_TEST; + else if (!strcmp(optarg, "io") || + !strcmp(optarg, "intr")) + ioctl_cmd = NVME_IO_TEST; + break; + case 'n': + nflag = true; + io_test.num_threads = strtoul(optarg, &p, 0); + if (p != NULL && *p != '\0') { + fprintf(stderr, + "\"%s\" not valid number of threads.\n", + optarg); + perftest_usage(); + } else if (io_test.num_threads == 0 || + io_test.num_threads > 128) { + fprintf(stderr, + "\"%s\" not valid number of threads.\n", + optarg); + perftest_usage(); + } + break; + case 'o': + oflag = true; + if (!strcmp(optarg, "read") || !strcmp(optarg, "READ")) + io_test.opc = NVME_OPC_READ; + else if (!strcmp(optarg, "write") || + !strcmp(optarg, "WRITE")) + io_test.opc = NVME_OPC_WRITE; + else { + fprintf(stderr, "\"%s\" not valid opcode.\n", + optarg); + perftest_usage(); + } + break; + case 'p': + perthread = 1; + break; + case 's': + sflag = true; + io_test.size = strtoul(optarg, &p, 0); + if (p == NULL || *p == '\0' || toupper(*p) == 'B') { + // do nothing + } else if (toupper(*p) == 'K') { + io_test.size *= 1024; + } else if (toupper(*p) == 'M') { + io_test.size *= 1024 * 1024; + } else { + fprintf(stderr, "\"%s\" not valid size.\n", + optarg); + perftest_usage(); + } + break; + case 't': + tflag = true; + io_test.time = strtoul(optarg, &p, 0); + if (p != NULL && *p != '\0') { + fprintf(stderr, + "\"%s\" not valid time duration.\n", + optarg); + perftest_usage(); + } + break; + } + } + + name = argv[optind]; + + if (!nflag || !oflag || !sflag || !tflag || name == NULL) + perftest_usage(); + + sprintf(path, "/dev/%s", name); + + fd = open(path, O_RDWR); + if (fd < 0) { + fprintf(stderr, "%s not valid device.\n", path); + perftest_usage(); + } + + err = ioctl(fd, ioctl_cmd, &io_test); + + if (err) { + fprintf(stderr, "NVME_IO_TEST returned %d\n", errno); + exit(EX_IOERR); + } + + print_perftest(&io_test, perthread); + exit(EX_OK); +} + +int +main(int argc, char *argv[]) +{ + + if (argc < 2) + usage(); + + if (strcmp(argv[1], "devlist") == 0) + devlist(argc-1, &argv[1]); + else if (strcmp(argv[1], "identify") == 0) + identify(argc-1, &argv[1]); + else if (strcmp(argv[1], "perftest") == 0) + perftest(argc-1, &argv[1]); + + usage(); + + return (0); +} From owner-svn-src-all@FreeBSD.ORG Mon Sep 17 21:41:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3E28D106564A; Mon, 17 Sep 2012 21:41:39 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0EDA68FC15; Mon, 17 Sep 2012 21:41:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8HLfc2o091252; Mon, 17 Sep 2012 21:41:38 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8HLfc3R091247; Mon, 17 Sep 2012 21:41:38 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201209172141.q8HLfc3R091247@svn.freebsd.org> From: Jim Harris Date: Mon, 17 Sep 2012 21:41:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240621 - in head: etc/mtree include sbin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2012 21:41:39 -0000 Author: jimharris Date: Mon Sep 17 21:41:38 2012 New Revision: 240621 URL: http://svn.freebsd.org/changeset/base/240621 Log: Integrate nvmecontrol(8) into the amd64 and i386 builds. This includes adding NVMe header files to /usr/include/dev/nvme. Sponsored by: Intel Modified: head/etc/mtree/BSD.include.dist head/include/Makefile head/sbin/Makefile.amd64 head/sbin/Makefile.i386 Modified: head/etc/mtree/BSD.include.dist ============================================================================== --- head/etc/mtree/BSD.include.dist Mon Sep 17 21:26:55 2012 (r240620) +++ head/etc/mtree/BSD.include.dist Mon Sep 17 21:41:38 2012 (r240621) @@ -126,6 +126,8 @@ .. nand .. + nvme + .. ofw .. pbio Modified: head/include/Makefile ============================================================================== --- head/include/Makefile Mon Sep 17 21:26:55 2012 (r240620) +++ head/include/Makefile Mon Sep 17 21:41:38 2012 (r240621) @@ -40,8 +40,8 @@ LDIRS= bsm cam geom net net80211 netatal LSUBDIRS= cam/ata cam/scsi \ dev/acpica dev/an dev/bktr dev/ciss dev/filemon dev/firewire dev/hwpmc \ - dev/ic dev/iicbus ${_dev_ieee488} dev/io dev/lmc dev/mfi dev/ofw \ - dev/pbio ${_dev_powermac_nvram} dev/ppbus dev/smbus \ + dev/ic dev/iicbus ${_dev_ieee488} dev/io dev/lmc dev/mfi dev/nvme \ + dev/ofw dev/pbio ${_dev_powermac_nvram} dev/ppbus dev/smbus \ dev/speaker dev/usb dev/utopia dev/vkbd dev/wi \ fs/devfs fs/fdescfs fs/msdosfs fs/nandfs fs/nfs fs/ntfs fs/nullfs \ ${_fs_nwfs} fs/portalfs fs/procfs fs/smbfs fs/udf fs/unionfs \ Modified: head/sbin/Makefile.amd64 ============================================================================== --- head/sbin/Makefile.amd64 Mon Sep 17 21:26:55 2012 (r240620) +++ head/sbin/Makefile.amd64 Mon Sep 17 21:41:38 2012 (r240621) @@ -2,3 +2,4 @@ SUBDIR += bsdlabel SUBDIR += fdisk +SUBDIR += nvmecontrol Modified: head/sbin/Makefile.i386 ============================================================================== --- head/sbin/Makefile.i386 Mon Sep 17 21:26:55 2012 (r240620) +++ head/sbin/Makefile.i386 Mon Sep 17 21:41:38 2012 (r240621) @@ -2,4 +2,5 @@ SUBDIR += bsdlabel SUBDIR += fdisk +SUBDIR += nvmecontrol SUBDIR += sconfig From owner-svn-src-all@FreeBSD.ORG Mon Sep 17 23:04:16 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 21E121065670; Mon, 17 Sep 2012 23:04:16 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E7BE98FC16; Mon, 17 Sep 2012 23:04:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8HN4F5j001852; Mon, 17 Sep 2012 23:04:15 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8HN4FwU001850; Mon, 17 Sep 2012 23:04:15 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201209172304.q8HN4FwU001850@svn.freebsd.org> From: "David E. O'Brien" Date: Mon, 17 Sep 2012 23:04:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240622 - head/usr.bin/yes X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2012 23:04:16 -0000 Author: obrien Date: Mon Sep 17 23:04:15 2012 New Revision: 240622 URL: http://svn.freebsd.org/changeset/base/240622 Log: yes(1) actually comes from V7. Submitted by: Simon Gerraty Modified: head/usr.bin/yes/yes.1 Modified: head/usr.bin/yes/yes.1 ============================================================================== --- head/usr.bin/yes/yes.1 Mon Sep 17 21:41:38 2012 (r240621) +++ head/usr.bin/yes/yes.1 Mon Sep 17 23:04:15 2012 (r240622) @@ -49,4 +49,4 @@ forever. The .Nm command appeared in -.At 32v . +.At v7 . From owner-svn-src-all@FreeBSD.ORG Mon Sep 17 23:24:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C7224106564A; Mon, 17 Sep 2012 23:24:45 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B21018FC17; Mon, 17 Sep 2012 23:24:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8HNOjUa005105; Mon, 17 Sep 2012 23:24:45 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8HNOjCr005101; Mon, 17 Sep 2012 23:24:45 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201209172324.q8HNOjCr005101@svn.freebsd.org> From: Adrian Chadd Date: Mon, 17 Sep 2012 23:24:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240623 - head/sys/dev/ath/ath_hal X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2012 23:24:46 -0000 Author: adrian Date: Mon Sep 17 23:24:45 2012 New Revision: 240623 URL: http://svn.freebsd.org/changeset/base/240623 Log: Rename AH_MIMO_MAX_CHAINS to AH_MAX_CHAINS, for compatibility with internal atheros HAL code. Modified: head/sys/dev/ath/ath_hal/ah.c head/sys/dev/ath/ath_hal/ah.h head/sys/dev/ath/ath_hal/ah_internal.h Modified: head/sys/dev/ath/ath_hal/ah.c ============================================================================== --- head/sys/dev/ath/ath_hal/ah.c Mon Sep 17 23:04:15 2012 (r240622) +++ head/sys/dev/ath/ath_hal/ah.c Mon Sep 17 23:24:45 2012 (r240623) @@ -1053,7 +1053,7 @@ ath_hal_getChanNoise(struct ath_hal *ah, * populated with values from NOISE_FLOOR[] + ath_hal_getNfAdjust(). * * The caller must supply ctl/ext NF arrays which are at least - * AH_MIMO_MAX_CHAINS entries long. + * AH_MAX_CHAINS entries long. */ int ath_hal_get_mimo_chan_noise(struct ath_hal *ah, @@ -1069,7 +1069,7 @@ ath_hal_get_mimo_chan_noise(struct ath_h HALDEBUG(ah, HAL_DEBUG_NFCAL, "%s: invalid channel %u/0x%x; no mapping\n", __func__, chan->ic_freq, chan->ic_flags); - for (i = 0; i < AH_MIMO_MAX_CHAINS; i++) { + for (i = 0; i < AH_MAX_CHAINS; i++) { nf_ctl[i] = nf_ext[i] = 0; } return 0; @@ -1077,7 +1077,7 @@ ath_hal_get_mimo_chan_noise(struct ath_h /* Return 0 if there's no valid MIMO values (yet) */ if (! (ichan->privFlags & CHANNEL_MIMO_NF_VALID)) { - for (i = 0; i < AH_MIMO_MAX_CHAINS; i++) { + for (i = 0; i < AH_MAX_CHAINS; i++) { nf_ctl[i] = nf_ext[i] = 0; } return 0; @@ -1090,7 +1090,7 @@ ath_hal_get_mimo_chan_noise(struct ath_h * stations which have a very low RSSI, below the * 'normalised' NF values in NOISE_FLOOR[]. */ - for (i = 0; i < AH_MIMO_MAX_CHAINS; i++) { + for (i = 0; i < AH_MAX_CHAINS; i++) { nf_ctl[i] = nf_ext[i] = NOISE_FLOOR[mode] + ath_hal_getNfAdjust(ah, ichan); } @@ -1109,7 +1109,7 @@ ath_hal_get_mimo_chan_noise(struct ath_h * don't "wrap" when RSSI is less than the "adjusted" NF value. * ("Adjust" here is via ichan->noiseFloorAdjust.) */ - for (i = 0; i < AH_MIMO_MAX_CHAINS; i++) { + for (i = 0; i < AH_MAX_CHAINS; i++) { nf_ctl[i] = ichan->noiseFloorCtl[i] + ath_hal_getNfAdjust(ah, ichan); nf_ext[i] = ichan->noiseFloorExt[i] + ath_hal_getNfAdjust(ah, ichan); } Modified: head/sys/dev/ath/ath_hal/ah.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah.h Mon Sep 17 23:04:15 2012 (r240622) +++ head/sys/dev/ath/ath_hal/ah.h Mon Sep 17 23:24:45 2012 (r240623) @@ -35,7 +35,7 @@ * This is intended to be used by various statistics gathering operations * (NF, RSSI, EVM). */ -#define AH_MIMO_MAX_CHAINS 3 +#define AH_MAX_CHAINS 3 #define AH_MIMO_MAX_EVM_PILOTS 6 /* Modified: head/sys/dev/ath/ath_hal/ah_internal.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_internal.h Mon Sep 17 23:04:15 2012 (r240622) +++ head/sys/dev/ath/ath_hal/ah_internal.h Mon Sep 17 23:24:45 2012 (r240623) @@ -153,8 +153,8 @@ typedef struct { int16_t rawNoiseFloor; int16_t noiseFloorAdjust; #ifdef AH_SUPPORT_AR5416 - int16_t noiseFloorCtl[AH_MIMO_MAX_CHAINS]; - int16_t noiseFloorExt[AH_MIMO_MAX_CHAINS]; + int16_t noiseFloorCtl[AH_MAX_CHAINS]; + int16_t noiseFloorExt[AH_MAX_CHAINS]; #endif /* AH_SUPPORT_AR5416 */ uint16_t mainSpur; /* cached spur value for this channel */ } HAL_CHANNEL_INTERNAL; From owner-svn-src-all@FreeBSD.ORG Tue Sep 18 00:43:16 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0692D106566C; Tue, 18 Sep 2012 00:43:16 +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 CD0E28FC1C; Tue, 18 Sep 2012 00:43:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8I0hFkX012213; Tue, 18 Sep 2012 00:43:15 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8I0hFHx012210; Tue, 18 Sep 2012 00:43:15 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201209180043.q8I0hFHx012210@svn.freebsd.org> From: Attilio Rao Date: Tue, 18 Sep 2012 00:43:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240624 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Sep 2012 00:43:16 -0000 Author: attilio Date: Tue Sep 18 00:43:15 2012 New Revision: 240624 URL: http://svn.freebsd.org/changeset/base/240624 Log: Remove namespace pollution in _rmlock.h by defining rm_queue structure directly in _rmlock.h and then including it (and its dependencies) in pcpu.h. This leads to few _*.h headers to be included in pcpu.h but this is not considered a big deal. Really pc_rm_queue should be implemented as a dynamic member with DPCPU interface, but we really want to keep the read acquisition as fast as possible, so even the further pc_dynamic indirection should be avoided, and the pollution is dealt like this. Discussed with: jhb MFC after: 1 week Modified: head/sys/sys/_rmlock.h head/sys/sys/pcpu.h Modified: head/sys/sys/_rmlock.h ============================================================================== --- head/sys/sys/_rmlock.h Mon Sep 17 23:24:45 2012 (r240623) +++ head/sys/sys/_rmlock.h Tue Sep 18 00:43:15 2012 (r240624) @@ -32,17 +32,17 @@ #ifndef _SYS__RMLOCK_H_ #define _SYS__RMLOCK_H_ -/* - * XXXUPS remove as soon as we have per cpu variable - * linker sets and can define rm_queue in _rm_lock.h -*/ -#include /* * Mostly reader/occasional writer lock. */ LIST_HEAD(rmpriolist,rm_priotracker); +struct rm_queue { + struct rm_queue *volatile rmq_next; + struct rm_queue *volatile rmq_prev; +}; + struct rmlock { struct lock_object lock_object; volatile cpuset_t rm_writecpus; Modified: head/sys/sys/pcpu.h ============================================================================== --- head/sys/sys/pcpu.h Mon Sep 17 23:24:45 2012 (r240623) +++ head/sys/sys/pcpu.h Tue Sep 18 00:43:15 2012 (r240624) @@ -38,7 +38,11 @@ #endif #include +#include +#include +#include #include +#include #include #include #include @@ -137,15 +141,6 @@ extern uintptr_t dpcpu_off[]; #endif /* _KERNEL */ -/* - * XXXUPS remove as soon as we have per cpu variable - * linker sets and can define rm_queue in _rm_lock.h - */ -struct rm_queue { - struct rm_queue* volatile rmq_next; - struct rm_queue* volatile rmq_prev; -}; - /* * This structure maps out the global data that needs to be kept on a * per-cpu basis. The members are accessed via the PCPU_GET/SET/PTR @@ -169,15 +164,7 @@ struct pcpu { void *pc_netisr; /* netisr SWI cookie */ int pc_dnweight; /* vm_page_dontneed() */ int pc_domain; /* Memory domain. */ - - /* - * Stuff for read mostly lock - * - * XXXUPS remove as soon as we have per cpu variable - * linker sets. - */ - struct rm_queue pc_rm_queue; - + struct rm_queue pc_rm_queue; /* rmlock list of trackers */ uintptr_t pc_dynamic; /* Dynamic per-cpu data area */ /* From owner-svn-src-all@FreeBSD.ORG Tue Sep 18 01:27:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 07692106564A; Tue, 18 Sep 2012 01:27:25 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E5E698FC08; Tue, 18 Sep 2012 01:27:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8I1ROei016404; Tue, 18 Sep 2012 01:27:24 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8I1RORL016402; Tue, 18 Sep 2012 01:27:24 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201209180127.q8I1RORL016402@svn.freebsd.org> From: Adrian Chadd Date: Tue, 18 Sep 2012 01:27:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240625 - head/sys/dev/ath/ath_hal X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Sep 2012 01:27:25 -0000 Author: adrian Date: Tue Sep 18 01:27:24 2012 New Revision: 240625 URL: http://svn.freebsd.org/changeset/base/240625 Log: Add a couple of accessor inline functions for state that exists in net80211. Obtained from: Qualcomm Atheros Modified: head/sys/dev/ath/ath_hal/ah_internal.h Modified: head/sys/dev/ath/ath_hal/ah_internal.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_internal.h Tue Sep 18 00:43:15 2012 (r240624) +++ head/sys/dev/ath/ath_hal/ah_internal.h Tue Sep 18 01:27:24 2012 (r240625) @@ -913,5 +913,36 @@ extern int16_t ath_ee_interpolate(uint16 AH_PRIVATE((_ah))->ah_caps.halSupportsFastClock5GHz && \ ath_hal_eepromGetFlag((_ah), AR_EEP_FSTCLK_5G)) +/* + * Fetch the maximum regulatory domain power for the given channel + * in 1/2dBm steps. + */ +static inline int +ath_hal_get_twice_max_regpower(struct ath_hal_private *ahp, + const HAL_CHANNEL_INTERNAL *ichan, const struct ieee80211_channel *chan) +{ + struct ath_hal *ah = &ahp->h; + + if (! chan) { + ath_hal_printf(ah, "%s: called with chan=NULL!\n", __func__); + return (0); + } + return (chan->ic_maxpower); +} + +/* + * Get the maximum antenna gain allowed, in 1/2dBm steps. + */ +static inline int +ath_hal_getantennaallowed(struct ath_hal *ah, + const struct ieee80211_channel *chan) +{ + + if (! chan) + return (0); + + return (chan->ic_maxantgain); +} + #endif /* _ATH_AH_INTERAL_H_ */ From owner-svn-src-all@FreeBSD.ORG Tue Sep 18 02:14:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2C106106566C; Tue, 18 Sep 2012 02:14:48 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 16D938FC14; Tue, 18 Sep 2012 02:14:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8I2ElYv020694; Tue, 18 Sep 2012 02:14:47 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8I2El0h020692; Tue, 18 Sep 2012 02:14:47 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201209180214.q8I2El0h020692@svn.freebsd.org> From: Kevin Lo Date: Tue, 18 Sep 2012 02:14:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240626 - stable/9/usr.sbin/timed/timed X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Sep 2012 02:14:48 -0000 Author: kevlo Date: Tue Sep 18 02:14:47 2012 New Revision: 240626 URL: http://svn.freebsd.org/changeset/base/240626 Log: MFC r240388: Add missing braces Obtained from: DragonFly Modified: stable/9/usr.sbin/timed/timed/timed.c Directory Properties: stable/9/usr.sbin/timed/timed/ (props changed) Modified: stable/9/usr.sbin/timed/timed/timed.c ============================================================================== --- stable/9/usr.sbin/timed/timed/timed.c Tue Sep 18 01:27:24 2012 (r240625) +++ stable/9/usr.sbin/timed/timed/timed.c Tue Sep 18 02:14:47 2012 (r240626) @@ -419,9 +419,10 @@ main(argc, argv) justquit = 1; } for (ntp = nettab; ntp != NULL; ntp = ntp->next) { - if (ntp->status == MASTER) + if (ntp->status == MASTER) { rmnetmachs(ntp); ntp->status = NOMASTER; + } } checkignorednets(); pickslavenet(0); From owner-svn-src-all@FreeBSD.ORG Tue Sep 18 02:19:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 03B751065670; Tue, 18 Sep 2012 02:19:44 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E27AA8FC16; Tue, 18 Sep 2012 02:19:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8I2Jhev021164; Tue, 18 Sep 2012 02:19:43 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8I2JhV2021161; Tue, 18 Sep 2012 02:19:43 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201209180219.q8I2JhV2021161@svn.freebsd.org> From: Kevin Lo Date: Tue, 18 Sep 2012 02:19:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240627 - in head/sys/dev: ata mly X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Sep 2012 02:19:44 -0000 Author: kevlo Date: Tue Sep 18 02:19:43 2012 New Revision: 240627 URL: http://svn.freebsd.org/changeset/base/240627 Log: Remove bogus break statements. Obtained from: DragonFly Modified: head/sys/dev/ata/ata-lowlevel.c head/sys/dev/mly/mly.c Modified: head/sys/dev/ata/ata-lowlevel.c ============================================================================== --- head/sys/dev/ata/ata-lowlevel.c Tue Sep 18 02:14:47 2012 (r240626) +++ head/sys/dev/ata/ata-lowlevel.c Tue Sep 18 02:19:43 2012 (r240627) @@ -370,7 +370,6 @@ ata_end_transaction(struct ata_request * "%s trying to write on read buffer\n", ata_cmd2str(request)); goto end_finished; - break; } ata_pio_write(request, length); request->donecount += length; Modified: head/sys/dev/mly/mly.c ============================================================================== --- head/sys/dev/mly/mly.c Tue Sep 18 02:14:47 2012 (r240626) +++ head/sys/dev/mly/mly.c Tue Sep 18 02:19:43 2012 (r240627) @@ -1350,7 +1350,6 @@ mly_process_event(struct mly_softc *sc, if (action == 'r') sc->mly_btl[bus][target].mb_flags |= MLY_BTL_RESCAN; break; - break; case 's': /* report of sense data */ if (((ssd->flags & SSD_KEY) == SSD_KEY_NO_SENSE) || (((ssd->flags & SSD_KEY) == SSD_KEY_NOT_READY) && From owner-svn-src-all@FreeBSD.ORG Tue Sep 18 02:33:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 27B8E106566C; Tue, 18 Sep 2012 02:33:23 +0000 (UTC) (envelope-from bjk@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CAEBE8FC12; Tue, 18 Sep 2012 02:33:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8I2XNcn022366; Tue, 18 Sep 2012 02:33:23 GMT (envelope-from bjk@svn.freebsd.org) Received: (from bjk@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8I2XNs3022364; Tue, 18 Sep 2012 02:33:23 GMT (envelope-from bjk@svn.freebsd.org) Message-Id: <201209180233.q8I2XNs3022364@svn.freebsd.org> From: Benjamin Kaduk Date: Tue, 18 Sep 2012 02:33:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240628 - head/sbin/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Sep 2012 02:33:24 -0000 Author: bjk (doc committer) Date: Tue Sep 18 02:33:23 2012 New Revision: 240628 URL: http://svn.freebsd.org/changeset/base/240628 Log: Whitespace cleanup for ipfw.8 -- start each sentence on a new line, and put a comma after e.g. and i.e.. While here, wrap long lines. PR: docs/157452 Approved by: hrs (mentor) Modified: head/sbin/ipfw/ipfw.8 Modified: head/sbin/ipfw/ipfw.8 ============================================================================== --- head/sbin/ipfw/ipfw.8 Tue Sep 18 02:19:43 2012 (r240627) +++ head/sbin/ipfw/ipfw.8 Tue Sep 18 02:33:23 2012 (r240628) @@ -141,7 +141,7 @@ the firewall will have a .Em stateful behaviour, i.e., upon a match it will create .Em dynamic rules , -i.e. rules that match packets with the same 5-tuple +i.e., rules that match packets with the same 5-tuple (protocol, source and destination addresses and ports) as the packet which caused their creation. Dynamic rules, which have a limited lifetime, are checked @@ -223,14 +223,15 @@ When listing and is specified, also show expired dynamic rules. .It Fl f Do not ask for confirmation for commands that can cause problems -if misused, -.No i.e. Cm flush . +if misused, i.e., +.Cm flush . If there is no tty associated with the process, this is implied. .It Fl i When listing a table (see the .Sx LOOKUP TABLES section below for more information on lookup tables), format values -as IP addresses. By default, values are shown as integers. +as IP addresses. +By default, values are shown as integers. .It Fl n Only check syntax of the command strings, without actually passing them to the kernel. @@ -421,7 +422,7 @@ Keywords are case-sensitive, whereas arg or may not be case-sensitive depending on their nature (e.g.\& uid's are, hostnames are not). .Pp -Some arguments (e.g. port or address lists) are comma-separated +Some arguments (e.g., port or address lists) are comma-separated lists of values. In this case, spaces after commas ',' are allowed to make the line more readable. @@ -873,7 +874,8 @@ Takes rule number saved to internal stac action and returns ruleset processing to the first rule with number greater than number of corresponding .Cm call -rule. See description of the +rule. +See description of the .Cm call action for more details. .Pp @@ -960,23 +962,29 @@ Initially this is limited to the values Processing continues at the next rule. It is possible to use the .Cm tablearg -keyword with a setfib. If tablearg value is not within compiled FIB range packet fib is set to 0. +keyword with a setfib. +If tablearg value is not within compiled FIB range packet fib is set to 0. .It Cm reass Queue and reassemble ip fragments. -If the packet is not fragmented, counters are updated and processing continues with the next rule. +If the packet is not fragmented, counters are updated and +processing continues with the next rule. If the packet is the last logical fragment, the packet is reassembled and, if .Va net.inet.ip.fw.one_pass -is set to 0, processing continues with the next rule, else packet is allowed to pass and search terminates. -If the packet is a fragment in the middle, it is consumed and processing stops immediately. +is set to 0, processing continues with the next rule, else packet is +allowed to pass and search terminates. +If the packet is a fragment in the middle, it is consumed and +processing stops immediately. .Pp Fragments handling can be tuned via .Va net.inet.ip.maxfragpackets and .Va net.inet.ip.maxfragsperpacket -which limit, respectively, the maximum number of processable fragments (default: 800) and +which limit, respectively, the maximum number of processable +fragments (default: 800) and the maximum number of fragments per packet (default: 16). .Pp -NOTA BENE: since fragments do not contain port numbers, they should be avoided with the +NOTA BENE: since fragments do not contain port numbers, +they should be avoided with the .Nm reass rule. Alternatively, direction-based (like @@ -1596,7 +1604,8 @@ This is the short form of .It Cm sockarg Matches packets that are associated to a local socket and for which the SO_USER_COOKIE socket option has been set -to a non-zero value. As a side effect, the value of the +to a non-zero value. +As a side effect, the value of the option is made available as .Cm tablearg value, which in turn can be used as @@ -1746,7 +1755,7 @@ connected networks instead of all source .El .Sh LOOKUP TABLES Lookup tables are useful to handle large sparse sets of -addresses or other search keys (e.g. ports, jail IDs, interface names). +addresses or other search keys (e.g., ports, jail IDs, interface names). In the rest of this section we will use the term ``address''. There may be up to 65535 different lookup tables, numbered 0 to 65534. .Pp @@ -1784,7 +1793,8 @@ the routing table (see .Xr route 4 ) . .Pp Lookup tables currently support only ports, jail IDs, IPv4/IPv6 addresses -and interface names. Wildcards is not supported for interface names. +and interface names. +Wildcards is not supported for interface names. .Pp The .Cm tablearg @@ -1813,7 +1823,8 @@ Section for example usage of tables and When used with the .Cm skipto action, the user should be aware that the code will walk the ruleset -up to a rule equal to, or past, the given number, and should therefore try keep the +up to a rule equal to, or past, the given number, +and should therefore try keep the ruleset compact between the skipto and the target rules. .Sh SETS OF RULES Each rule belongs to one of 32 different @@ -2021,10 +2032,12 @@ As an example, using ``src-ip 0xffffff00 for each /24 destination subnet. .Pp The FLOW_MASK, together with the SCHED_MASK, is used to split -packets into flows. As an example, using +packets into flows. +As an example, using ``src-ip 0x000000ff'' together with the previous SCHED_MASK makes a flow for -each individual source address. In turn, flows for each /24 +each individual source address. +In turn, flows for each /24 subnet will be sent to the same scheduler instance. .Pp The above diagram holds even for the @@ -2143,12 +2156,13 @@ A file specifying the additional overhea of a packet on the link. .Pp Some link types introduce extra delays in the transmission -of a packet, e.g. because of MAC level framing, contention on +of a packet, e.g., because of MAC level framing, contention on the use of the channel, MAC level retransmissions and so on. From our point of view, the channel is effectively unavailable for this extra time, which is constant or variable depending -on the link type. Additionally, packets may be dropped after this -time (e.g. on a wireless link after too many retransmissions). +on the link type. +Additionally, packets may be dropped after this +time (e.g., on a wireless link after too many retransmissions). We can model the additional delay with an empirical curve that represents its distribution. .Bd -literal -offset indent @@ -2184,7 +2198,7 @@ If not specified here, it must be presen explicitly as a configuration parameter for the pipe; .It Cm loss-level Ar L the probability above which packets are lost. -(0.0 <= L <= 1.0, default 1.0 i.e. no loss); +(0.0 <= L <= 1.0, default 1.0 i.e., no loss); .It Cm samples Ar N the number of samples used in the internal representation of the curve (2..1024; default 100); @@ -2249,7 +2263,8 @@ but gives no service guarantees. .It Cm wf2q+ implements the WF2Q+ algorithm, which is a Weighted Fair Queueing algorithm which permits flows to share bandwidth according to -their weights. Note that weights are not priorities; even a flow +their weights. +Note that weights are not priorities; even a flow with a minuscule weight will never starve. WF2Q+ has O(log N) per-packet processing cost, where N is the number of flows, and is the default algorithm used by previous versions @@ -2535,7 +2550,8 @@ in .Xr natd 8 for more information. .It Cm tablearg -Uses argument supplied in lookup table. See +Uses argument supplied in lookup table. +See .Sx LOOKUP TABLES section below for more information on lookup tables. .El @@ -2597,11 +2613,13 @@ or before ipfw module gets loaded. .Bl -tag -width indent .It Va net.inet.ip.fw.default_to_accept: No 0 -Defines ipfw last rule behavior. This value overrides +Defines ipfw last rule behavior. +This value overrides .Cd "options IPFW_DEFAULT_TO_(ACCEPT|DENY)" from kernel configuration file. .It Va net.inet.ip.fw.tables_max: No 128 -Defines number of tables available in ipfw. Number cannot exceed 65534. +Defines number of tables available in ipfw. +Number cannot exceed 65534. .El .Sh SYSCTL VARIABLES A set of @@ -2631,12 +2649,14 @@ Option 1 should never be selected as thi An attacker can establish multiple fake associations by sending AddIP messages. .It Va net.inet.ip.alias.sctp.chunk_proc_limit: No 5 -Defines the maximum number of chunks in an SCTP packet that will be parsed for a +Defines the maximum number of chunks in an SCTP packet that will be +parsed for a packet that matches an existing association. This value is enforced to be greater or equal than .Cm net.inet.ip.alias.sctp.initialising_chunk_proc_limit . A high value is -a DoS risk yet setting too low a value may result in important control chunks in +a DoS risk yet setting too low a value may result in +important control chunks in the packet not being located and parsed. .It Va net.inet.ip.alias.sctp.error_on_ootb: No 1 Defines when the @@ -2658,7 +2678,8 @@ This value is only useful if the .Nm nat is tracking global IP addresses. .It Cm 3 -ErrorM is sent in response to all OOTB packets on both the local and global side +ErrorM is sent in response to all OOTB packets on both +the local and global side (DoS risk). .El .Pp @@ -2709,12 +2730,14 @@ will only be an INIT or ASCONF-AddIP pac A higher value may become a DoS risk as malformed packets can consume processing resources. .It Va net.inet.ip.alias.sctp.param_proc_limit: No 25 -Defines the maximum number of parameters within a chunk that will be parsed in a +Defines the maximum number of parameters within a chunk that will be +parsed in a packet. As for other similar sysctl variables, larger values pose a DoS risk. .It Va net.inet.ip.alias.sctp.log_level: No 0 Level of detail in the system log messages (0 \- minimal, 1 \- event, -2 \- info, 3 \- detail, 4 \- debug, 5 \- max debug). May be a good +2 \- info, 3 \- detail, 4 \- debug, 5 \- max debug). +May be a good option in high loss environments. .It Va net.inet.ip.alias.sctp.shutdown_time: No 15 Timeout value while waiting for SHUTDOWN-COMPLETE. @@ -2733,7 +2756,8 @@ association is limited to this value .El .Pp This variable is fully dynamic, the new value will be adopted for all newly -arriving associations, existing associations are treated as they were previously. +arriving associations, existing associations are treated +as they were previously. Global tracking will decrease the number of collisions within the .Nm nat at a cost @@ -3280,7 +3304,8 @@ Some early work (1999-2000) on the traffic shaper supported by Akamba Corp. .Pp The ipfw core (ipfw2) has been completely redesigned and -reimplemented by Luigi Rizzo in summer 2002. Further +reimplemented by Luigi Rizzo in summer 2002. +Further actions and options have been added by various developer over the years. .Pp From owner-svn-src-all@FreeBSD.ORG Tue Sep 18 05:15:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 23FF9106566B; Tue, 18 Sep 2012 05:15:29 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from opti.dougb.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 59EE414E1D4; Tue, 18 Sep 2012 05:15:27 +0000 (UTC) Message-ID: <5058036F.1010104@FreeBSD.org> Date: Mon, 17 Sep 2012 22:15:27 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:15.0) Gecko/20120911 Thunderbird/15.0.1 MIME-Version: 1.0 To: Benjamin Kaduk References: <201209180233.q8I2XNs3022364@svn.freebsd.org> In-Reply-To: <201209180233.q8I2XNs3022364@svn.freebsd.org> X-Enigmail-Version: 1.4.4 OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, hrs@FreeBSD.org Subject: Re: svn commit: r240628 - head/sbin/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Sep 2012 05:15:29 -0000 On 09/17/2012 19:33, Benjamin Kaduk wrote: > Whitespace cleanup for ipfw.8 -- start each sentence on a new line, We generally don't do this at all absent other changes. We definitely don't make whitespace-only changes mixed in with other changes, as it makes the diff too hard to read. Your mentor should have caught this. -- I am only one, but I am one. I cannot do everything, but I can do something. And I will not let what I cannot do interfere with what I can do. -- Edward Everett Hale, (1822 - 1909) From owner-svn-src-all@FreeBSD.ORG Tue Sep 18 07:57:35 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 649EB106566B; Tue, 18 Sep 2012 07:57:35 +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 505078FC1D; Tue, 18 Sep 2012 07:57:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8I7vZE6052887; Tue, 18 Sep 2012 07:57:35 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8I7vZnF052885; Tue, 18 Sep 2012 07:57:35 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201209180757.q8I7vZnF052885@svn.freebsd.org> From: Andriy Gapon Date: Tue, 18 Sep 2012 07:57:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240629 - head/sys/geom X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Sep 2012 07:57:35 -0000 Author: avg Date: Tue Sep 18 07:57:34 2012 New Revision: 240629 URL: http://svn.freebsd.org/changeset/base/240629 Log: g_disk_flushcache definitely should not be traced under G_T_TOPOLOGY ... use G_T_BIO instead MFC after: 1 week Modified: head/sys/geom/geom_disk.c Modified: head/sys/geom/geom_disk.c ============================================================================== --- head/sys/geom/geom_disk.c Tue Sep 18 02:33:23 2012 (r240628) +++ head/sys/geom/geom_disk.c Tue Sep 18 07:57:34 2012 (r240629) @@ -392,7 +392,7 @@ g_disk_start(struct bio *bp) error = ENOIOCTL; break; case BIO_FLUSH: - g_trace(G_T_TOPOLOGY, "g_disk_flushcache(%s)", + g_trace(G_T_BIO, "g_disk_flushcache(%s)", bp->bio_to->name); if (!(dp->d_flags & DISKFLAG_CANFLUSHCACHE)) { error = EOPNOTSUPP; From owner-svn-src-all@FreeBSD.ORG Tue Sep 18 08:00:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F20191065680; Tue, 18 Sep 2012 08:00:43 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C50D18FC08; Tue, 18 Sep 2012 08:00:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8I80hrO053283; Tue, 18 Sep 2012 08:00:43 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8I80hNs053281; Tue, 18 Sep 2012 08:00:43 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201209180800.q8I80hNs053281@svn.freebsd.org> From: Kevin Lo Date: Tue, 18 Sep 2012 08:00:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240630 - head/sys/netipsec X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Sep 2012 08:00:44 -0000 Author: kevlo Date: Tue Sep 18 08:00:43 2012 New Revision: 240630 URL: http://svn.freebsd.org/changeset/base/240630 Log: Add missing break Modified: head/sys/netipsec/xform_ipip.c Modified: head/sys/netipsec/xform_ipip.c ============================================================================== --- head/sys/netipsec/xform_ipip.c Tue Sep 18 07:57:34 2012 (r240629) +++ head/sys/netipsec/xform_ipip.c Tue Sep 18 08:00:43 2012 (r240630) @@ -575,6 +575,7 @@ ipip_output( itos = ntohl(itos32) >> 20; ip6o->ip6_nxt = IPPROTO_IPV6; + break; } default: goto nofamily; From owner-svn-src-all@FreeBSD.ORG Tue Sep 18 08:00:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 406D61065675; Tue, 18 Sep 2012 08:00: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 2B3608FC1E; Tue, 18 Sep 2012 08:00:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8I80vC5053339; Tue, 18 Sep 2012 08:00:57 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8I80uJ5053337; Tue, 18 Sep 2012 08:00:56 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201209180800.q8I80uJ5053337@svn.freebsd.org> From: Andriy Gapon Date: Tue, 18 Sep 2012 08:00:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240631 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Sep 2012 08:00:57 -0000 Author: avg Date: Tue Sep 18 08:00:56 2012 New Revision: 240631 URL: http://svn.freebsd.org/changeset/base/240631 Log: zfs: allow both DEBUG and ZFS_DEBUG to be defined on command line Discussed with: pjd MFC after: 10 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_debug.h Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_debug.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_debug.h Tue Sep 18 08:00:43 2012 (r240630) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_debug.h Tue Sep 18 08:00:56 2012 (r240631) @@ -43,8 +43,10 @@ extern "C" { */ #if defined(DEBUG) || !defined(_KERNEL) +#if !defined(ZFS_DEBUG) #define ZFS_DEBUG #endif +#endif extern int zfs_flags; From owner-svn-src-all@FreeBSD.ORG Tue Sep 18 08:02:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2A19D106566C; Tue, 18 Sep 2012 08:02:55 +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 1589E8FC1D; Tue, 18 Sep 2012 08:02:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8I82s0q053615; Tue, 18 Sep 2012 08:02:54 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8I82sbu053613; Tue, 18 Sep 2012 08:02:54 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201209180802.q8I82sbu053613@svn.freebsd.org> From: Andriy Gapon Date: Tue, 18 Sep 2012 08:02:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240632 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Sep 2012 08:02:55 -0000 Author: avg Date: Tue Sep 18 08:02:54 2012 New Revision: 240632 URL: http://svn.freebsd.org/changeset/base/240632 Log: zfs: correctly calculate dn_bonuslen for saving SAs to disk Since all attribute values start at 8-byte aligned boundary, we would previously incorrectly calculate dn_bonuslen if any attribute but the last had a variable-length value with length not multiple of 8. Reported by: Nicolas Rachinsky Tested by: Nicolas Rachinsky Reviewed by: Matthew Ahrens (for upstream) MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c Tue Sep 18 08:00:56 2012 (r240631) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c Tue Sep 18 08:02:54 2012 (r240632) @@ -578,7 +578,7 @@ sa_find_sizes(sa_os_t *sa, sa_bulk_attr_ for (i = 0; i != attr_count; i++) { boolean_t is_var_sz; - *total += attr_desc[i].sa_length; + *total += P2ROUNDUP(attr_desc[i].sa_length, 8); if (done) goto next; @@ -713,6 +713,8 @@ sa_build_layouts(sa_handle_t *hdl, sa_bu length = SA_REGISTERED_LEN(sa, attrs[i]); if (length == 0) length = attr_desc[i].sa_length; + else + VERIFY(length == attr_desc[i].sa_length); if (buf_space < length) { /* switch to spill buffer */ VERIFY(bonustype == DMU_OT_SA); @@ -742,6 +744,7 @@ sa_build_layouts(sa_handle_t *hdl, sa_bu if (sa->sa_attr_table[attrs[i]].sa_length == 0) { sahdr->sa_lengths[len_idx++] = length; } + VERIFY((uintptr_t)data_start % 8 == 0); data_start = (void *)P2ROUNDUP(((uintptr_t)data_start + length), 8); buf_space -= P2ROUNDUP(length, 8); From owner-svn-src-all@FreeBSD.ORG Tue Sep 18 08:12:28 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 95EB91065670; Tue, 18 Sep 2012 08:12:28 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 821348FC17; Tue, 18 Sep 2012 08:12:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8I8CSgl054745; Tue, 18 Sep 2012 08:12:28 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8I8CSVh054743; Tue, 18 Sep 2012 08:12:28 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201209180812.q8I8CSVh054743@svn.freebsd.org> From: Joel Dahl Date: Tue, 18 Sep 2012 08:12:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240633 - head/sbin/nvmecontrol X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Sep 2012 08:12:28 -0000 Author: joel (doc committer) Date: Tue Sep 18 08:12:28 2012 New Revision: 240633 URL: http://svn.freebsd.org/changeset/base/240633 Log: mdoc: remove superfluous paragraph macro. Modified: head/sbin/nvmecontrol/nvmecontrol.8 Modified: head/sbin/nvmecontrol/nvmecontrol.8 ============================================================================== --- head/sbin/nvmecontrol/nvmecontrol.8 Tue Sep 18 08:02:54 2012 (r240632) +++ head/sbin/nvmecontrol/nvmecontrol.8 Tue Sep 18 08:12:28 2012 (r240633) @@ -76,7 +76,6 @@ Display a hexadecimal dump of the nvme0 Run a performance test on nvme0ns1 using 32 kernel threads for 30 seconds. Each thread will issue a single 512 byte read command. Results are printed to stdout when 30 seconds expires. -.Pp .Sh AUTHORS .An -nosplit .Nm From owner-svn-src-all@FreeBSD.ORG Tue Sep 18 08:17:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E862B1065675; Tue, 18 Sep 2012 08:17:29 +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 D0D2C8FC08; Tue, 18 Sep 2012 08:17:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8I8HTCo055324; Tue, 18 Sep 2012 08:17:29 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8I8HTNH055322; Tue, 18 Sep 2012 08:17:29 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201209180817.q8I8HTNH055322@svn.freebsd.org> From: Andriy Gapon Date: Tue, 18 Sep 2012 08:17:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240634 - head/sys/dev/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Sep 2012 08:17:30 -0000 Author: avg Date: Tue Sep 18 08:17:29 2012 New Revision: 240634 URL: http://svn.freebsd.org/changeset/base/240634 Log: acpi_cpu: explicitly notify userland about c-state changes ... after they are committed. A notification is sent per CPU. Reviewed by: imp MFC after: 3 weeks Modified: head/sys/dev/acpica/acpi_cpu.c Modified: head/sys/dev/acpica/acpi_cpu.c ============================================================================== --- head/sys/dev/acpica/acpi_cpu.c Tue Sep 18 08:12:28 2012 (r240633) +++ head/sys/dev/acpica/acpi_cpu.c Tue Sep 18 08:17:29 2012 (r240634) @@ -1063,6 +1063,8 @@ acpi_cpu_notify(ACPI_HANDLE h, UINT32 no ACPI_SERIAL_BEGIN(cpu); acpi_cpu_set_cx_lowest(sc); ACPI_SERIAL_END(cpu); + + acpi_UserNotify("PROCESSOR", sc->cpu_handle, notify); } static int From owner-svn-src-all@FreeBSD.ORG Tue Sep 18 08:27:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 449EE1065676; Tue, 18 Sep 2012 08:27:02 +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 2F5F18FC1D; Tue, 18 Sep 2012 08:27:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8I8R21j056375; Tue, 18 Sep 2012 08:27:02 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8I8R1eF056373; Tue, 18 Sep 2012 08:27:01 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201209180827.q8I8R1eF056373@svn.freebsd.org> From: Andriy Gapon Date: Tue, 18 Sep 2012 08:27:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240635 - stable/9/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Sep 2012 08:27:02 -0000 Author: avg Date: Tue Sep 18 08:27:01 2012 New Revision: 240635 URL: http://svn.freebsd.org/changeset/base/240635 Log: MFC r240340: acpi.4: machdep.cpu_idle_hlt no longer exists Modified: stable/9/share/man/man4/acpi.4 Directory Properties: stable/9/share/man/man4/ (props changed) Modified: stable/9/share/man/man4/acpi.4 ============================================================================== --- stable/9/share/man/man4/acpi.4 Tue Sep 18 08:17:29 2012 (r240634) +++ stable/9/share/man/man4/acpi.4 Tue Sep 18 08:27:01 2012 (r240635) @@ -80,8 +80,12 @@ A scheduling algorithm will select state and this setting as system load dictates. To enable ACPI CPU idling control, -.Va machdep.cpu_idle_hlt -must be set to 1. +.Va machdep.idle +should be set to +.Li acpi +if it is listed in +.Va machdep.idle_available +. .It Va hw.acpi.cpu.cx_supported List of supported CPU idle states and their transition latency in microseconds. From owner-svn-src-all@FreeBSD.ORG Tue Sep 18 08:28:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5455E1065711; Tue, 18 Sep 2012 08:28:09 +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 3FC978FC18; Tue, 18 Sep 2012 08:28:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8I8S9YP056545; Tue, 18 Sep 2012 08:28:09 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8I8S99Y056543; Tue, 18 Sep 2012 08:28:09 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201209180828.q8I8S99Y056543@svn.freebsd.org> From: Andriy Gapon Date: Tue, 18 Sep 2012 08:28:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240636 - stable/8/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Sep 2012 08:28:09 -0000 Author: avg Date: Tue Sep 18 08:28:08 2012 New Revision: 240636 URL: http://svn.freebsd.org/changeset/base/240636 Log: MFC r240340: acpi.4: machdep.cpu_idle_hlt no longer exists Modified: stable/8/share/man/man4/acpi.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/acpi.4 ============================================================================== --- stable/8/share/man/man4/acpi.4 Tue Sep 18 08:27:01 2012 (r240635) +++ stable/8/share/man/man4/acpi.4 Tue Sep 18 08:28:08 2012 (r240636) @@ -80,8 +80,12 @@ A scheduling algorithm will select state and this setting as system load dictates. To enable ACPI CPU idling control, -.Va machdep.cpu_idle_hlt -must be set to 1. +.Va machdep.idle +should be set to +.Li acpi +if it is listed in +.Va machdep.idle_available +. .It Va hw.acpi.cpu.cx_supported List of supported CPU idle states and their transition latency in microseconds. From owner-svn-src-all@FreeBSD.ORG Tue Sep 18 08:53:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A21F8106566B; Tue, 18 Sep 2012 08:53:11 +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 8D99A8FC14; Tue, 18 Sep 2012 08:53:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8I8rBQh059277; Tue, 18 Sep 2012 08:53:11 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8I8rBlQ059275; Tue, 18 Sep 2012 08:53:11 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201209180853.q8I8rBlQ059275@svn.freebsd.org> From: Andriy Gapon Date: Tue, 18 Sep 2012 08:53:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240637 - head/sys/boot/i386/loader X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Sep 2012 08:53:11 -0000 Author: avg Date: Tue Sep 18 08:53:11 2012 New Revision: 240637 URL: http://svn.freebsd.org/changeset/base/240637 Log: loader/i386: replace ugly inb/outb re-implementations with cpufunc.h Use of __builtin_constant_p in a function that is only called via a pointer is a good example of how out-of-date it was. Suggested by: bde MFC after: 1 week Modified: head/sys/boot/i386/loader/main.c Modified: head/sys/boot/i386/loader/main.c ============================================================================== --- head/sys/boot/i386/loader/main.c Tue Sep 18 08:28:08 2012 (r240636) +++ head/sys/boot/i386/loader/main.c Tue Sep 18 08:53:11 2012 (r240637) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -321,34 +322,19 @@ command_heap(int argc, char *argv[]) return(CMD_OK); } -/* ISA bus access functions for PnP, derived from */ +/* ISA bus access functions for PnP. */ static int isa_inb(int port) { - u_char data; - if (__builtin_constant_p(port) && - (((port) & 0xffff) < 0x100) && - ((port) < 0x10000)) { - __asm __volatile("inb %1,%0" : "=a" (data) : "id" ((u_short)(port))); - } else { - __asm __volatile("inb %%dx,%0" : "=a" (data) : "d" (port)); - } - return(data); + return (inb(port)); } static void isa_outb(int port, int value) { - u_char al = value; - if (__builtin_constant_p(port) && - (((port) & 0xffff) < 0x100) && - ((port) < 0x10000)) { - __asm __volatile("outb %0,%1" : : "a" (al), "id" ((u_short)(port))); - } else { - __asm __volatile("outb %0,%%dx" : : "a" (al), "d" (port)); - } + outb(port, value); } #ifdef LOADER_ZFS_SUPPORT From owner-svn-src-all@FreeBSD.ORG Tue Sep 18 09:15:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD328106564A; Tue, 18 Sep 2012 09:15:32 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C92C18FC15; Tue, 18 Sep 2012 09:15:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8I9FWTb061931; Tue, 18 Sep 2012 09:15:32 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8I9FWo5061929; Tue, 18 Sep 2012 09:15:32 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201209180915.q8I9FWo5061929@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 18 Sep 2012 09:15:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240638 - head/sys/netpfil/pf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Sep 2012 09:15:33 -0000 Author: glebius Date: Tue Sep 18 09:15:32 2012 New Revision: 240638 URL: http://svn.freebsd.org/changeset/base/240638 Log: Fix DIOCNATLOOK: zero key padding before performing lookup. Modified: head/sys/netpfil/pf/pf_ioctl.c Modified: head/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- head/sys/netpfil/pf/pf_ioctl.c Tue Sep 18 08:53:11 2012 (r240637) +++ head/sys/netpfil/pf/pf_ioctl.c Tue Sep 18 09:15:32 2012 (r240638) @@ -1808,6 +1808,7 @@ DIOCGETSTATES_full: (!pnl->dport || !pnl->sport))) error = EINVAL; else { + bzero(&key, sizeof(key)); key.af = pnl->af; key.proto = pnl->proto; PF_ACPY(&key.addr[sidx], &pnl->saddr, pnl->af); From owner-svn-src-all@FreeBSD.ORG Tue Sep 18 10:14:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 70A8C1065673; Tue, 18 Sep 2012 10:14:18 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5ADC28FC14; Tue, 18 Sep 2012 10:14:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8IAEIlZ068973; Tue, 18 Sep 2012 10:14:18 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8IAEIcn068969; Tue, 18 Sep 2012 10:14:18 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201209181014.q8IAEIcn068969@svn.freebsd.org> From: Adrian Chadd Date: Tue, 18 Sep 2012 10:14:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240639 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Sep 2012 10:14:18 -0000 Author: adrian Date: Tue Sep 18 10:14:17 2012 New Revision: 240639 URL: http://svn.freebsd.org/changeset/base/240639 Log: Implement my first cut at filtered frames in aggregation sessions. The hardware can optionally "filter" frames if successive transmissions to a given node (ie, "entry in the keycache") fail. That way the hardware can implement a kind of early abort of all the other frames queued to that destination, rather than simply trying to TX each frame to that destination (and failing.) The background: * If a frame comes back as being filtered, the hardware didn't try to TX it (or it was outside the TX burst opportunity.) So, take it as a hint that some (but not all, see below) frames to the destination may be filtered. * If the CLRDMASK bit is set in a TX descriptor, the "filter to this destination" bit in the keycache entry is cleared and TX to that host will be unconditionally retried. * Right now everything has the CLRDMASK bit set, so filtered frames tend to be aggregates and frames that fall outside of the WME burst window. It was a bit worse in the past as I had messed up the TX flags and CLRDMASK wasn't being set on aggregate frames. The annoying bits: * It's easy (ish) to do for aggregate session frames - firstly, they can be retried in any order as long as they're within the BAW, and there's already a bunch of infrastructure tracking how many frames the TID has queued to the hardware (tid->hwq_depth.) However, for frames that bypassed the software queue, hwq_depth doesn't get incremented. I'll fix that in a subsequent commit. * For non-aggregate session frames, the only retries that can occur are ones for sequence numbers that hvaen't successfully been TXed yet. Since there's no re-ordering going on in non-aggregate sessions, if any subsequent seqno frames make it out, any filtered frames before that seqno need to be dropped. Hence why this initially is just for aggregate session frames. * Since there may be intermediary frames to the destination that have CLRDMASK set - for example, any directly dispatched management frames to that destination - it's possible that there will be some filtered frames followed up by some non filtered frames. Thus, it can't be assumed that once you see a filtered frame for the given destination node, all subsequent frames for all TIDs will be filtered. Ok, with that in mind: * Create a per-TID filtered frame queue for frames that the hardware returns as filtered. * Track filtered frames per-tid, rather than per-node. It just makes the locking much easier. * When a filtered frame appears in the completion function, the node transitions to "filtered", and all subsequent completed error frames (filtered or otherwise) are put on the filtered frame queue. The TID is paused once (during the transition from non-filtered to filtered). * If a filtered frame retry count exceeds SWMAX_RETRIES, a BAR should be sent. * Once all the frames queued to the hardware for the given filtered frame TID, transition back from filtered frame to non-filtered frame, which means pre-pending all the filtered frames onto the head of the software queue, clearing the filtered frame state and unpausing the TID. Things get quite hairy around handling completion (aggr, non-aggr, norm, direct-dispatched frames to a hardware queue); whether it's an "error", "cleanup" or "BAR" state as well as filtered, which order to do things in (eg do filtered BEFORE checking for BAR, as the filter completion may be needed to actually transmit a BAR frame.) This work has definitely reminded me that I have to tidy up all the locking and remove some of the ridiculous lock/unlock/lock/unlock going on in the completion functions. It's also reminded me that I should really split out TID versus hardware TXQ locking, even if the underlying locking is still the destination hardware TXQ. Finally, this is all pre-requisite for working on AP mode power save support (PS-POLL, uAPSD) as well as improving performance to misbehaving nodes (as they can transition into filter mode, stopping any TX until everything has caught up.) Finally (ish) - this should also be done for non-aggregate sessions as there are still plenty of laptops and mobile devices that don't speak 802.11n but do wish for stable, useful power save AP support where packets aren't simply dropped. This requires software retransmission for non-aggregate sessions to be implemented, which includes the caveats I've mentioned above. Finally finally - this doesn't yet do anything about the CLRDMASK bit in the TX descriptor. That's still unconditionally set to 1. I'll debug the current work (mostly ensuring I haven't busted up the hairy transitions between BAR, filtered, error (all frames in an aggregate failing) and cleanup (when transitioning from aggregation -> non-aggregation.)) Finally finally finally - this is all original work by yours truely, rather than ported from the Atheros internal driver codebase or Linux ath9k. Tested: * AR9280, AR5416 in STA mode * AR9280, AR9130 in hostap mode * Lots and lots of iperf testing in very marginal and non-marginal conditions, complete with inducing filtered frames + BAR TX conditions. Modified: head/sys/dev/ath/if_ath_sysctl.c head/sys/dev/ath/if_ath_tx.c head/sys/dev/ath/if_athioctl.h Modified: head/sys/dev/ath/if_ath_sysctl.c ============================================================================== --- head/sys/dev/ath/if_ath_sysctl.c Tue Sep 18 09:15:32 2012 (r240638) +++ head/sys/dev/ath/if_ath_sysctl.c Tue Sep 18 10:14:17 2012 (r240639) @@ -937,6 +937,8 @@ ath_sysctl_stats_attach(struct ath_softc "Number of multicast frames exceeding maximum mcast queue depth"); SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_rx_keymiss", CTLFLAG_RD, &sc->sc_stats.ast_rx_keymiss, 0, ""); + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_tx_swfiltered", CTLFLAG_RD, + &sc->sc_stats.ast_tx_swfiltered, 0, ""); /* Attach the RX phy error array */ ath_sysctl_stats_attach_rxphyerr(sc, child); Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Tue Sep 18 09:15:32 2012 (r240638) +++ head/sys/dev/ath/if_ath_tx.c Tue Sep 18 10:14:17 2012 (r240639) @@ -114,6 +114,9 @@ static ieee80211_seq ath_tx_tid_seqno_as struct ieee80211_node *ni, struct ath_buf *bf, struct mbuf *m0); static int ath_tx_action_frame_override_queue(struct ath_softc *sc, struct ieee80211_node *ni, struct mbuf *m0, int *tid); +static struct ath_buf * +ath_tx_retry_clone(struct ath_softc *sc, struct ath_node *an, + struct ath_tid *tid, struct ath_buf *bf); /* * Whether to use the 11n rate scenario functions or not @@ -145,6 +148,22 @@ ath_tx_gettid(struct ath_softc *sc, cons return WME_AC_TO_TID(pri); } +static void +ath_tx_set_retry(struct ath_softc *sc, struct ath_buf *bf) +{ + struct ieee80211_frame *wh; + + wh = mtod(bf->bf_m, struct ieee80211_frame *); + /* Only update/resync if needed */ + if (bf->bf_state.bfs_isretried == 0) { + wh->i_fc[1] |= IEEE80211_FC1_RETRY; + bus_dmamap_sync(sc->sc_dmat, bf->bf_dmamap, + BUS_DMASYNC_PREWRITE); + } + bf->bf_state.bfs_isretried = 1; + bf->bf_state.bfs_retries ++; +} + /* * Determine what the correct AC queue for the given frame * should be. @@ -2711,7 +2730,12 @@ ath_tx_tid_init(struct ath_softc *sc, st for (i = 0; i < IEEE80211_TID_SIZE; i++) { atid = &an->an_tid[i]; + + /* XXX now with this bzer(), is the field 0'ing needed? */ + bzero(atid, sizeof(*atid)); + TAILQ_INIT(&atid->axq_q); + TAILQ_INIT(&atid->filtq.axq_q); atid->tid = i; atid->an = an; for (j = 0; j < ATH_TID_MAX_BUFS; j++) @@ -2721,6 +2745,7 @@ ath_tx_tid_init(struct ath_softc *sc, st atid->sched = 0; atid->hwq_depth = 0; atid->cleanup_inprogress = 0; + atid->clrdmask = 1; /* Always start by setting this bit */ if (i == IEEE80211_NONQOS_TID) atid->ac = WME_AC_BE; else @@ -2762,6 +2787,12 @@ ath_tx_tid_resume(struct ath_softc *sc, return; } + /* XXX isfiltered shouldn't ever be 0 at this point */ + if (tid->isfiltered == 1) { + device_printf(sc->sc_dev, "%s: filtered?!\n", __func__); + return; + } + ath_tx_tid_sched(sc, tid); /* Punt some frames to the hardware if needed */ //ath_txq_sched(sc, sc->sc_ac2q[tid->ac]); @@ -2769,6 +2800,192 @@ ath_tx_tid_resume(struct ath_softc *sc, } /* + * Add the given ath_buf to the TID filtered frame list. + * This requires the TID be filtered. + */ +static void +ath_tx_tid_filt_addbuf(struct ath_softc *sc, struct ath_tid *tid, + struct ath_buf *bf) +{ + + ATH_TID_LOCK_ASSERT(sc, tid); + if (! tid->isfiltered) + device_printf(sc->sc_dev, "%s: not filtered?!\n", __func__); + + DPRINTF(sc, ATH_DEBUG_SW_TX_FILT, "%s: bf=%p\n", __func__, bf); + + /* Set the retry bit and bump the retry counter */ + ath_tx_set_retry(sc, bf); + sc->sc_stats.ast_tx_swfiltered++; + + ATH_TXQ_INSERT_TAIL(&tid->filtq, bf, bf_list); +} + +/* + * Handle a completed filtered frame from the given TID. + * This just enables/pauses the filtered frame state if required + * and appends the filtered frame to the filtered queue. + */ +static void +ath_tx_tid_filt_comp_buf(struct ath_softc *sc, struct ath_tid *tid, + struct ath_buf *bf) +{ + + ATH_TID_LOCK_ASSERT(sc, tid); + + if (! tid->isfiltered) { + DPRINTF(sc, ATH_DEBUG_SW_TX_FILT, "%s: filter transition\n", + __func__); + tid->isfiltered = 1; + ath_tx_tid_pause(sc, tid); + } + + /* Add the frame to the filter queue */ + ath_tx_tid_filt_addbuf(sc, tid, bf); +} + +/* + * Complete the filtered frame TX completion. + * + * If there are no more frames in the hardware queue, unpause/unfilter + * the TID if applicable. Otherwise we will wait for a node PS transition + * to unfilter. + */ +static void +ath_tx_tid_filt_comp_complete(struct ath_softc *sc, struct ath_tid *tid) +{ + struct ath_buf *bf; + + ATH_TID_LOCK_ASSERT(sc, tid); + + if (tid->hwq_depth != 0) + return; + + DPRINTF(sc, ATH_DEBUG_SW_TX_FILT, "%s: hwq=0, transition back\n", + __func__); + tid->isfiltered = 0; + tid->clrdmask = 1; + + /* XXX this is really quite inefficient */ + while ((bf = TAILQ_LAST(&tid->filtq.axq_q, ath_bufhead_s)) != NULL) { + ATH_TXQ_REMOVE(&tid->filtq, bf, bf_list); + ATH_TXQ_INSERT_HEAD(tid, bf, bf_list); + } + + ath_tx_tid_resume(sc, tid); +} + +/* + * Called when a single (aggregate or otherwise) frame is completed. + * + * Returns 1 if the buffer could be added to the filtered list + * (cloned or otherwise), 0 if the buffer couldn't be added to the + * filtered list (failed clone; expired retry) and the caller should + * free it and handle it like a failure (eg by sending a BAR.) + */ +static int +ath_tx_tid_filt_comp_single(struct ath_softc *sc, struct ath_tid *tid, + struct ath_buf *bf) +{ + struct ath_buf *nbf; + int retval; + + ATH_TID_LOCK_ASSERT(sc, tid); + + /* + * Don't allow a filtered frame to live forever. + */ + if (bf->bf_state.bfs_retries > SWMAX_RETRIES) { + DPRINTF(sc, ATH_DEBUG_SW_TX_FILT, + "%s: bf=%p, seqno=%d, exceeded retries\n", + __func__, + bf, + bf->bf_state.bfs_seqno); + return (0); + } + + /* + * A busy buffer can't be added to the retry list. + * It needs to be cloned. + */ + if (bf->bf_flags & ATH_BUF_BUSY) { + nbf = ath_tx_retry_clone(sc, tid->an, tid, bf); + DPRINTF(sc, ATH_DEBUG_SW_TX_FILT, + "%s: busy buffer clone: %p -> %p\n", + __func__, bf, nbf); + } else { + nbf = bf; + } + + if (nbf == NULL) { + DPRINTF(sc, ATH_DEBUG_SW_TX_FILT, + "%s: busy buffer couldn't be cloned (%p)!\n", + __func__, bf); + retval = 1; + } else { + ath_tx_tid_filt_comp_buf(sc, tid, nbf); + retval = 0; + } + ath_tx_tid_filt_comp_complete(sc, tid); + + return (retval); +} + +static void +ath_tx_tid_filt_comp_aggr(struct ath_softc *sc, struct ath_tid *tid, + struct ath_buf *bf_first, ath_bufhead *bf_q) +{ + struct ath_buf *bf, *bf_next, *nbf; + + ATH_TID_LOCK_ASSERT(sc, tid); + + bf = bf_first; + while (bf) { + bf_next = bf->bf_next; + bf->bf_next = NULL; /* Remove it from the aggr list */ + + /* + * Don't allow a filtered frame to live forever. + */ + if (bf->bf_state.bfs_retries > SWMAX_RETRIES) { + DPRINTF(sc, ATH_DEBUG_SW_TX_FILT, + "%s: bf=%p, seqno=%d, exceeded retries\n", + __func__, + bf, + bf->bf_state.bfs_seqno); + TAILQ_INSERT_TAIL(bf_q, bf, bf_list); + goto next; + } + + if (bf->bf_flags & ATH_BUF_BUSY) { + nbf = ath_tx_retry_clone(sc, tid->an, tid, bf); + DPRINTF(sc, ATH_DEBUG_SW_TX_FILT, + "%s: busy buffer cloned: %p -> %p", + __func__, bf, nbf); + } else { + nbf = bf; + } + + /* + * If the buffer couldn't be cloned, add it to bf_q; + * the caller will free the buffer(s) as required. + */ + if (nbf == NULL) { + DPRINTF(sc, ATH_DEBUG_SW_TX_FILT, + "%s: buffer couldn't be cloned! (%p)\n", + __func__, bf); + TAILQ_INSERT_TAIL(bf_q, bf, bf_list); + } else { + ath_tx_tid_filt_comp_buf(sc, tid, nbf); + } +next: + bf = bf_next; + } + + ath_tx_tid_filt_comp_complete(sc, tid); +} + +/* * Suspend the queue because we need to TX a BAR. */ static void @@ -2924,6 +3141,80 @@ ath_tx_tid_bar_tx(struct ath_softc *sc, ath_tx_tid_bar_unsuspend(sc, tid); } +static void +ath_tx_tid_drain_pkt(struct ath_softc *sc, struct ath_node *an, + struct ath_tid *tid, ath_bufhead *bf_cq, struct ath_buf *bf) +{ + + ATH_TID_LOCK_ASSERT(sc, tid); + + /* + * If the current TID is running AMPDU, update + * the BAW. + */ + if (ath_tx_ampdu_running(sc, an, tid->tid) && + bf->bf_state.bfs_dobaw) { + /* + * Only remove the frame from the BAW if it's + * been transmitted at least once; this means + * the frame was in the BAW to begin with. + */ + if (bf->bf_state.bfs_retries > 0) { + ath_tx_update_baw(sc, an, tid, bf); + bf->bf_state.bfs_dobaw = 0; + } + /* + * This has become a non-fatal error now + */ + if (! bf->bf_state.bfs_addedbaw) + device_printf(sc->sc_dev, + "%s: wasn't added: seqno %d\n", + __func__, SEQNO(bf->bf_state.bfs_seqno)); + } + TAILQ_INSERT_TAIL(bf_cq, bf, bf_list); +} + +static void +ath_tx_tid_drain_print(struct ath_softc *sc, struct ath_node *an, + struct ath_tid *tid, struct ath_buf *bf) +{ + struct ieee80211_node *ni = &an->an_node; + struct ath_txq *txq = sc->sc_ac2q[tid->ac]; + struct ieee80211_tx_ampdu *tap; + + tap = ath_tx_get_tx_tid(an, tid->tid); + + device_printf(sc->sc_dev, + "%s: node %p: bf=%p: addbaw=%d, dobaw=%d, " + "seqno=%d, retry=%d\n", + __func__, ni, bf, + bf->bf_state.bfs_addedbaw, + bf->bf_state.bfs_dobaw, + SEQNO(bf->bf_state.bfs_seqno), + bf->bf_state.bfs_retries); + device_printf(sc->sc_dev, + "%s: node %p: bf=%p: tid txq_depth=%d hwq_depth=%d, bar_wait=%d, isfiltered=%d\n", + __func__, ni, bf, + tid->axq_depth, + tid->hwq_depth, + tid->bar_wait, + tid->isfiltered); + device_printf(sc->sc_dev, + "%s: node %p: tid %d: txq_depth=%d, " + "txq_aggr_depth=%d, sched=%d, paused=%d, " + "hwq_depth=%d, incomp=%d, baw_head=%d, " + "baw_tail=%d txa_start=%d, ni_txseqs=%d\n", + __func__, ni, tid->tid, txq->axq_depth, + txq->axq_aggr_depth, tid->sched, tid->paused, + tid->hwq_depth, tid->incomp, tid->baw_head, + tid->baw_tail, tap == NULL ? -1 : tap->txa_start, + ni->ni_txseqs[tid->tid]); + + /* XXX Dump the frame, see what it is? */ + ieee80211_dump_pkt(ni->ni_ic, + mtod(bf->bf_m, const uint8_t *), + bf->bf_m->m_len, 0, -1); +} /* * Free any packets currently pending in the software TX queue. @@ -2947,14 +3238,14 @@ ath_tx_tid_drain(struct ath_softc *sc, s struct ath_buf *bf; struct ieee80211_tx_ampdu *tap; struct ieee80211_node *ni = &an->an_node; - int t = 0; - struct ath_txq *txq = sc->sc_ac2q[tid->ac]; + int t; tap = ath_tx_get_tx_tid(an, tid->tid); - ATH_TXQ_LOCK_ASSERT(sc->sc_ac2q[tid->ac]); + ATH_TID_LOCK_ASSERT(sc, tid); /* Walk the queue, free frames */ + t = 0; for (;;) { bf = TAILQ_FIRST(&tid->axq_q); if (bf == NULL) { @@ -2962,65 +3253,28 @@ ath_tx_tid_drain(struct ath_softc *sc, s } if (t == 0) { - device_printf(sc->sc_dev, - "%s: node %p: bf=%p: addbaw=%d, dobaw=%d, " - "seqno=%d, retry=%d\n", - __func__, ni, bf, - bf->bf_state.bfs_addedbaw, - bf->bf_state.bfs_dobaw, - SEQNO(bf->bf_state.bfs_seqno), - bf->bf_state.bfs_retries); - device_printf(sc->sc_dev, - "%s: node %p: bf=%p: tid txq_depth=%d hwq_depth=%d, bar_wait=%d\n", - __func__, ni, bf, - tid->axq_depth, - tid->hwq_depth, - tid->bar_wait); - device_printf(sc->sc_dev, - "%s: node %p: tid %d: txq_depth=%d, " - "txq_aggr_depth=%d, sched=%d, paused=%d, " - "hwq_depth=%d, incomp=%d, baw_head=%d, " - "baw_tail=%d txa_start=%d, ni_txseqs=%d\n", - __func__, ni, tid->tid, txq->axq_depth, - txq->axq_aggr_depth, tid->sched, tid->paused, - tid->hwq_depth, tid->incomp, tid->baw_head, - tid->baw_tail, tap == NULL ? -1 : tap->txa_start, - ni->ni_txseqs[tid->tid]); - - /* XXX Dump the frame, see what it is? */ - ieee80211_dump_pkt(ni->ni_ic, - mtod(bf->bf_m, const uint8_t *), - bf->bf_m->m_len, 0, -1); - + ath_tx_tid_drain_print(sc, an, tid, bf); t = 1; } + ATH_TXQ_REMOVE(tid, bf, bf_list); + ath_tx_tid_drain_pkt(sc, an, tid, bf_cq, bf); + } - /* - * If the current TID is running AMPDU, update - * the BAW. - */ - if (ath_tx_ampdu_running(sc, an, tid->tid) && - bf->bf_state.bfs_dobaw) { - /* - * Only remove the frame from the BAW if it's - * been transmitted at least once; this means - * the frame was in the BAW to begin with. - */ - if (bf->bf_state.bfs_retries > 0) { - ath_tx_update_baw(sc, an, tid, bf); - bf->bf_state.bfs_dobaw = 0; - } - /* - * This has become a non-fatal error now - */ - if (! bf->bf_state.bfs_addedbaw) - device_printf(sc->sc_dev, - "%s: wasn't added: seqno %d\n", - __func__, SEQNO(bf->bf_state.bfs_seqno)); + /* And now, drain the filtered frame queue */ + t = 0; + for (;;) { + bf = TAILQ_FIRST(&tid->filtq.axq_q); + if (bf == NULL) + break; + + if (t == 0) { + ath_tx_tid_drain_print(sc, an, tid, bf); + t = 1; } - ATH_TXQ_REMOVE(tid, bf, bf_list); - TAILQ_INSERT_TAIL(bf_cq, bf, bf_list); + + ATH_TXQ_REMOVE(&tid->filtq, bf, bf_list); + ath_tx_tid_drain_pkt(sc, an, tid, bf_cq, bf); } /* @@ -3134,9 +3388,29 @@ ath_tx_normal_comp(struct ath_softc *sc, __func__, bf, fail, atid->hwq_depth - 1); atid->hwq_depth--; + + if (atid->isfiltered) + device_printf(sc->sc_dev, "%s: isfiltered=1, normal_comp?\n", + __func__); + if (atid->hwq_depth < 0) device_printf(sc->sc_dev, "%s: hwq_depth < 0: %d\n", __func__, atid->hwq_depth); + + /* + * If the queue is filtered, potentially mark it as complete + * and reschedule it as needed. + * + * This is required as there may be a subsequent TX descriptor + * for this end-node that has CLRDMASK set, so it's quite possible + * that a filtered frame will be followed by a non-filtered + * (complete or otherwise) frame. + * + * XXX should we do this before we complete the frame? + */ + if (atid->isfiltered) + ath_tx_tid_filt_comp_complete(sc, atid); + ATH_TXQ_UNLOCK(sc->sc_ac2q[atid->ac]); /* @@ -3209,6 +3483,16 @@ ath_tx_tid_cleanup(struct ath_softc *sc, ATH_TXQ_LOCK(sc->sc_ac2q[atid->ac]); /* + * Move the filtered frames to the TX queue, before + * we run off and discard/process things. + */ + /* XXX this is really quite inefficient */ + while ((bf = TAILQ_LAST(&atid->filtq.axq_q, ath_bufhead_s)) != NULL) { + ATH_TXQ_REMOVE(&atid->filtq, bf, bf_list); + ATH_TXQ_INSERT_HEAD(atid, bf, bf_list); + } + + /* * Update the frames in the software TX queue: * * + Discard retry frames in the queue @@ -3287,23 +3571,6 @@ ath_tx_tid_cleanup(struct ath_softc *sc, } } -static void -ath_tx_set_retry(struct ath_softc *sc, struct ath_buf *bf) -{ - struct ieee80211_frame *wh; - - wh = mtod(bf->bf_m, struct ieee80211_frame *); - /* Only update/resync if needed */ - if (bf->bf_state.bfs_isretried == 0) { - wh->i_fc[1] |= IEEE80211_FC1_RETRY; - bus_dmamap_sync(sc->sc_dmat, bf->bf_dmamap, - BUS_DMASYNC_PREWRITE); - } - sc->sc_stats.ast_tx_swretries++; - bf->bf_state.bfs_isretried = 1; - bf->bf_state.bfs_retries ++; -} - static struct ath_buf * ath_tx_retry_clone(struct ath_softc *sc, struct ath_node *an, struct ath_tid *tid, struct ath_buf *bf) @@ -3352,6 +3619,7 @@ ath_tx_retry_clone(struct ath_softc *sc, bf->bf_m = NULL; bf->bf_node = NULL; ath_freebuf(sc, bf); + return nbf; } @@ -3433,6 +3701,7 @@ ath_tx_aggr_retry_unaggr(struct ath_soft * body. */ ath_tx_set_retry(sc, bf); + sc->sc_stats.ast_tx_swretries++; /* * Insert this at the head of the queue, so it's @@ -3468,6 +3737,7 @@ ath_tx_retry_subframe(struct ath_softc * /* XXX clr11naggr should be done for all subframes */ ath_hal_clr11n_aggr(sc->sc_ah, bf->bf_desc); ath_hal_set11nburstduration(sc->sc_ah, bf->bf_desc, 0); + /* ath_hal_set11n_virtualmorefrag(sc->sc_ah, bf->bf_desc, 0); */ /* @@ -3504,6 +3774,7 @@ ath_tx_retry_subframe(struct ath_softc * } ath_tx_set_retry(sc, bf); + sc->sc_stats.ast_tx_swretries++; bf->bf_next = NULL; /* Just to make sure */ /* Clear the aggregate state */ @@ -3590,6 +3861,7 @@ ath_tx_comp_aggr_error(struct ath_softc */ if (ath_tx_tid_bar_tx_ready(sc, tid)) ath_tx_tid_bar_tx(sc, tid); + ATH_TXQ_UNLOCK(sc->sc_ac2q[tid->ac]); /* Complete frames which errored out */ @@ -3633,8 +3905,10 @@ ath_tx_comp_cleanup_aggr(struct ath_soft } /* Send BAR if required */ + /* XXX why would we send a BAR when transitioning to non-aggregation? */ if (ath_tx_tid_bar_tx_ready(sc, atid)) ath_tx_tid_bar_tx(sc, atid); + ATH_TXQ_UNLOCK(sc->sc_ac2q[atid->ac]); /* Handle frame completion */ @@ -3681,6 +3955,9 @@ ath_tx_aggr_comp_aggr(struct ath_softc * DPRINTF(sc, ATH_DEBUG_SW_TX_AGGR, "%s: called; hwq_depth=%d\n", __func__, atid->hwq_depth); + TAILQ_INIT(&bf_q); + TAILQ_INIT(&bf_cq); + /* The TID state is kept behind the TXQ lock */ ATH_TXQ_LOCK(sc->sc_ac2q[atid->ac]); @@ -3690,15 +3967,69 @@ ath_tx_aggr_comp_aggr(struct ath_softc * __func__, atid->hwq_depth); /* + * If the TID is filtered, handle completing the filter + * transition before potentially kicking it to the cleanup + * function. + */ + if (atid->isfiltered) + ath_tx_tid_filt_comp_complete(sc, atid); + + /* * Punt cleanup to the relevant function, not our problem now */ if (atid->cleanup_inprogress) { + if (atid->isfiltered) + device_printf(sc->sc_dev, + "%s: isfiltered=1, normal_comp?\n", + __func__); ATH_TXQ_UNLOCK(sc->sc_ac2q[atid->ac]); ath_tx_comp_cleanup_aggr(sc, bf_first); return; } /* + * If the frame is filtered, transition to filtered frame + * mode and add this to the filtered frame list. + * + * XXX TODO: figure out how this interoperates with + * BAR, pause and cleanup states. + */ + if ((ts.ts_status & HAL_TXERR_FILT) || + (ts.ts_status != 0 && atid->isfiltered)) { + if (fail != 0) + device_printf(sc->sc_dev, + "%s: isfiltered=1, fail=%d\n", __func__, fail); + ath_tx_tid_filt_comp_aggr(sc, atid, bf_first, &bf_cq); + + /* Remove from BAW */ + TAILQ_FOREACH_SAFE(bf, &bf_cq, bf_list, bf_next) { + if (bf->bf_state.bfs_addedbaw) + drops++; + if (bf->bf_state.bfs_dobaw) { + ath_tx_update_baw(sc, an, atid, bf); + if (! bf->bf_state.bfs_addedbaw) + device_printf(sc->sc_dev, + "%s: wasn't added: seqno %d\n", + __func__, + SEQNO(bf->bf_state.bfs_seqno)); + } + bf->bf_state.bfs_dobaw = 0; + } + /* + * If any intermediate frames in the BAW were dropped when + * handling filtering things, send a BAR. + */ + if (drops) + ath_tx_tid_bar_suspend(sc, atid); + + /* + * Finish up by sending a BAR if required and freeing + * the frames outside of the TX lock. + */ + goto finish_send_bar; + } + + /* * Take a copy; this may be needed -after- bf_first * has been completed and freed. */ @@ -3725,8 +4056,6 @@ ath_tx_aggr_comp_aggr(struct ath_softc * return; } - TAILQ_INIT(&bf_q); - TAILQ_INIT(&bf_cq); tap = ath_tx_get_tx_tid(an, tid); /* @@ -3883,6 +4212,21 @@ ath_tx_aggr_comp_aggr(struct ath_softc * ath_tx_tid_sched(sc, atid); /* + * If the queue is filtered, re-schedule as required. + * + * This is required as there may be a subsequent TX descriptor + * for this end-node that has CLRDMASK set, so it's quite possible + * that a filtered frame will be followed by a non-filtered + * (complete or otherwise) frame. + * + * XXX should we do this before we complete the frame? + */ + if (atid->isfiltered) + ath_tx_tid_filt_comp_complete(sc, atid); + +finish_send_bar: + + /* * Send BAR if required */ if (ath_tx_tid_bar_tx_ready(sc, atid)) @@ -3912,6 +4256,7 @@ ath_tx_aggr_comp_unaggr(struct ath_softc int tid = bf->bf_state.bfs_tid; struct ath_tid *atid = &an->an_tid[tid]; struct ath_tx_status *ts = &bf->bf_status.ds_txstat; + int drops = 0; /* * Update rate control status here, before we possibly @@ -3946,12 +4291,24 @@ ath_tx_aggr_comp_unaggr(struct ath_softc __func__, atid->hwq_depth); /* + * If the TID is filtered, handle completing the filter + * transition before potentially kicking it to the cleanup + * function. + */ + if (atid->isfiltered) + ath_tx_tid_filt_comp_complete(sc, atid); + + /* * If a cleanup is in progress, punt to comp_cleanup; * rather than handling it here. It's thus their * responsibility to clean up, call the completion * function in net80211, etc. */ if (atid->cleanup_inprogress) { + if (atid->isfiltered) + device_printf(sc->sc_dev, + "%s: isfiltered=1, normal_comp?\n", + __func__); ATH_TXQ_UNLOCK(sc->sc_ac2q[atid->ac]); DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: cleanup_unaggr\n", __func__); @@ -3960,6 +4317,66 @@ ath_tx_aggr_comp_unaggr(struct ath_softc } /* + * XXX TODO: how does cleanup, BAR and filtered frame handling + * overlap? + * + * If the frame is filtered OR if it's any failure but + * the TID is filtered, the frame must be added to the + * filtered frame list. + * + * However - a busy buffer can't be added to the filtered + * list as it will end up being recycled without having + * been made available for the hardware. + */ + if ((ts->ts_status & HAL_TXERR_FILT) || + (ts->ts_status != 0 && atid->isfiltered)) { + int freeframe; + + if (fail != 0) + device_printf(sc->sc_dev, + "%s: isfiltered=1, fail=%d\n", + __func__, + fail); + freeframe = ath_tx_tid_filt_comp_single(sc, atid, bf); + if (freeframe) { + /* Remove from BAW */ + if (bf->bf_state.bfs_addedbaw) + drops++; + if (bf->bf_state.bfs_dobaw) { + ath_tx_update_baw(sc, an, atid, bf); + if (! bf->bf_state.bfs_addedbaw) + device_printf(sc->sc_dev, + "%s: wasn't added: seqno %d\n", + __func__, SEQNO(bf->bf_state.bfs_seqno)); + } + bf->bf_state.bfs_dobaw = 0; + } + + /* + * If the frame couldn't be filtered, treat it as a drop and + * prepare to send a BAR. + */ + if (freeframe && drops) + ath_tx_tid_bar_suspend(sc, atid); + + /* + * Send BAR if required + */ + if (ath_tx_tid_bar_tx_ready(sc, atid)) + ath_tx_tid_bar_tx(sc, atid); + + ATH_TXQ_UNLOCK(sc->sc_ac2q[atid->ac]); + /* + * If freeframe is set, then the frame couldn't be + * cloned and bf is still valid. Just complete/free it. + */ + if (freeframe) + ath_tx_default_comp(sc, bf, fail); + + + return; + } + /* * Don't bother with the retry check if all frames * are being failed (eg during queue deletion.) */ @@ -3987,6 +4404,19 @@ ath_tx_aggr_comp_unaggr(struct ath_softc } /* + * If the queue is filtered, re-schedule as required. + * + * This is required as there may be a subsequent TX descriptor + * for this end-node that has CLRDMASK set, so it's quite possible + * that a filtered frame will be followed by a non-filtered + * (complete or otherwise) frame. + * + * XXX should we do this before we complete the frame? + */ + if (atid->isfiltered) + ath_tx_tid_filt_comp_complete(sc, atid); + + /* * Send BAR if required */ if (ath_tx_tid_bar_tx_ready(sc, atid)) Modified: head/sys/dev/ath/if_athioctl.h ============================================================================== --- head/sys/dev/ath/if_athioctl.h Tue Sep 18 09:15:32 2012 (r240638) +++ head/sys/dev/ath/if_athioctl.h Tue Sep 18 10:14:17 2012 (r240639) @@ -162,8 +162,9 @@ struct ath_stats { u_int32_t ast_tx_aggr_fail; /* aggregate TX failed */ u_int32_t ast_tx_mcastq_overflow; /* multicast queue overflow */ u_int32_t ast_rx_keymiss; + u_int32_t ast_tx_swfiltered; - u_int32_t ast_pad[16]; + u_int32_t ast_pad[15]; }; #define SIOCGATHSTATS _IOWR('i', 137, struct ifreq) From owner-svn-src-all@FreeBSD.ORG Tue Sep 18 10:37:40 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D500B106564A; Tue, 18 Sep 2012 10:37:40 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from mail.allbsd.org (gatekeeper.allbsd.org [IPv6:2001:2f0:104:e001::32]) by mx1.freebsd.org (Postfix) with ESMTP id 396C78FC08; Tue, 18 Sep 2012 10:37:40 +0000 (UTC) Received: from alph.allbsd.org (p1137-ipbf1505funabasi.chiba.ocn.ne.jp [118.7.212.137]) (authenticated bits=128) by mail.allbsd.org (8.14.5/8.14.5) with ESMTP id q8IAbNoJ030011 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 18 Sep 2012 19:37:33 +0900 (JST) (envelope-from hrs@FreeBSD.org) Received: from localhost (localhost [127.0.0.1]) (authenticated bits=0) by alph.allbsd.org (8.14.5/8.14.5) with ESMTP id q8IAbN8L069206; Tue, 18 Sep 2012 19:37:23 +0900 (JST) (envelope-from hrs@FreeBSD.org) Date: Tue, 18 Sep 2012 19:36:50 +0900 (JST) Message-Id: <20120918.193650.1501104806829364201.hrs@allbsd.org> To: dougb@FreeBSD.org From: Hiroki Sato In-Reply-To: <5058036F.1010104@FreeBSD.org> References: <201209180233.q8I2XNs3022364@svn.freebsd.org> <5058036F.1010104@FreeBSD.org> X-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530 FFD7 4F2C D3D8 2793 CF2D X-Mailer: Mew version 6.5 on Emacs 23.4 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Multipart/Signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="--Security_Multipart(Tue_Sep_18_19_36_50_2012_640)--" Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.97.4 at gatekeeper.allbsd.org X-Virus-Status: Clean X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (mail.allbsd.org [133.31.130.32]); Tue, 18 Sep 2012 19:37:33 +0900 (JST) X-Spam-Status: No, score=-96.8 required=13.0 tests=CONTENT_TYPE_PRESENT, ONLY1HOPDIRECT, RCVD_IN_RP_RNBL, SAMEHELOBY2HOP, USER_IN_WHITELIST autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on gatekeeper.allbsd.org Cc: svn-src-head@FreeBSD.org, bjk@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r240628 - head/sbin/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Sep 2012 10:37:41 -0000 ----Security_Multipart(Tue_Sep_18_19_36_50_2012_640)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Doug Barton wrote in <5058036F.1010104@FreeBSD.org>: do> On 09/17/2012 19:33, Benjamin Kaduk wrote: do> > Whitespace cleanup for ipfw.8 -- start each sentence on a new line, do> do> We generally don't do this at all absent other changes. do> do> We definitely don't make whitespace-only changes mixed in with other do> changes, as it makes the diff too hard to read. Please read docs/157452 before blaming the commit. And I do not think adding commas is not making the diff hard to read. -- Hiroki ----Security_Multipart(Tue_Sep_18_19_36_50_2012_640)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEABECAAYFAlBYTsIACgkQTyzT2CeTzy1SAwCgyC212UjWPexiuf9SCCfqf70Z 7WcAoJTVb4mY9yeFwfflLDvWw/7uXqFR =d/fz -----END PGP SIGNATURE----- ----Security_Multipart(Tue_Sep_18_19_36_50_2012_640)---- From owner-svn-src-all@FreeBSD.ORG Tue Sep 18 10:52:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 34FDA1065680; Tue, 18 Sep 2012 10:52:47 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2048D8FC0A; Tue, 18 Sep 2012 10:52:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8IAqkHO074912; Tue, 18 Sep 2012 10:52:46 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8IAqkT1074910; Tue, 18 Sep 2012 10:52:46 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201209181052.q8IAqkT1074910@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 18 Sep 2012 10:52:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240640 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Sep 2012 10:52:47 -0000 Author: glebius Date: Tue Sep 18 10:52:46 2012 New Revision: 240640 URL: http://svn.freebsd.org/changeset/base/240640 Log: - Add $FreeBSD$ to allow modifications to this file. - Move $OpenBSD$ to a more standard place. Modified: head/sys/net/pfvar.h Modified: head/sys/net/pfvar.h ============================================================================== --- head/sys/net/pfvar.h Tue Sep 18 10:14:17 2012 (r240639) +++ head/sys/net/pfvar.h Tue Sep 18 10:52:46 2012 (r240640) @@ -1,5 +1,3 @@ -/* $OpenBSD: pfvar.h,v 1.282 2009/01/29 15:12:28 pyr Exp $ */ - /* * Copyright (c) 2001 Daniel Hartmeier * All rights reserved. @@ -28,6 +26,8 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * + * $OpenBSD: pfvar.h,v 1.282 2009/01/29 15:12:28 pyr Exp $ */ + * $FreeBSD$ */ #ifndef _NET_PFVAR_H_ From owner-svn-src-all@FreeBSD.ORG Tue Sep 18 10:54:56 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BC3B21065672; Tue, 18 Sep 2012 10:54:56 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9C7B78FC1B; Tue, 18 Sep 2012 10:54:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8IAsuFq075255; Tue, 18 Sep 2012 10:54:56 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8IAsug5075250; Tue, 18 Sep 2012 10:54:56 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201209181054.q8IAsug5075250@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 18 Sep 2012 10:54:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240641 - in head/sys: net netpfil/pf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Sep 2012 10:54:56 -0000 Author: glebius Date: Tue Sep 18 10:54:56 2012 New Revision: 240641 URL: http://svn.freebsd.org/changeset/base/240641 Log: Make ruleset anchors in pf(4) reentrant. We've got two problems here: 1) Ruleset parser uses a global variable for anchor stack. 2) When processing a wildcard anchor, matching anchors are marked. To fix the first one: o Allocate anchor processing stack on stack. To make this allocation as small as possible, following measures taken: - Maximum stack size reduced from 64 to 32. - The struct pf_anchor_stackframe trimmed by one pointer - parent. We can always obtain the parent via the rule pointer. - When pf_test_rule() calls pf_get_translation(), the former lends its stack to the latter, to avoid recursive allocation 32 entries. The second one appeared more tricky. The code, that marks anchors was added in OpenBSD rev. 1.516 of pf.c. According to commit log, the idea is to enable the "quick" keyword on an anchor rule. The feature isn't documented anywhere. The most obscure part of the 1.516 was that code examines the "match" mark on a just processed child, which couldn't be put here by current frame. Since this wasn't documented even in the commit message and functionality of this is not clear to me, I decided to drop this examination for now. The rest of 1.516 is redone in a thread safe manner - the mark isn't put on the anchor itself, but on current stack frame. To avoid growing stack frame, we utilize LSB from the rule pointer, relying on kernel malloc(9) returning pointer aligned addresses. Discussed with: dhartmei Modified: head/sys/net/pfvar.h head/sys/netpfil/pf/pf.c head/sys/netpfil/pf/pf_lb.c Modified: head/sys/net/pfvar.h ============================================================================== --- head/sys/net/pfvar.h Tue Sep 18 10:52:46 2012 (r240640) +++ head/sys/net/pfvar.h Tue Sep 18 10:54:56 2012 (r240641) @@ -989,7 +989,7 @@ struct pf_anchor { char path[MAXPATHLEN]; struct pf_ruleset ruleset; int refcnt; /* anchor rules */ - int match; + int match; /* XXX: used for pfctl black magic */ }; RB_PROTOTYPE(pf_anchor_global, pf_anchor, entry_global, pf_anchor_compare); RB_PROTOTYPE(pf_anchor_node, pf_anchor, entry_node, pf_anchor_compare); @@ -1019,6 +1019,8 @@ RB_PROTOTYPE(pf_anchor_node, pf_anchor, PFR_TFLAG_REFDANCHOR | \ PFR_TFLAG_COUNTERS) +struct pf_anchor_stackframe; + struct pfr_table { char pfrt_anchor[MAXPATHLEN]; char pfrt_name[PF_TABLE_NAME_SIZE]; @@ -1938,11 +1940,12 @@ int pf_osfp_match(struct pf_osfp_enlist #ifdef _KERNEL void pf_print_host(struct pf_addr *, u_int16_t, u_int8_t); -void pf_step_into_anchor(int *, struct pf_ruleset **, int, - struct pf_rule **, struct pf_rule **, int *); -int pf_step_out_of_anchor(int *, struct pf_ruleset **, - int, struct pf_rule **, struct pf_rule **, - int *); +void pf_step_into_anchor(struct pf_anchor_stackframe *, int *, + struct pf_ruleset **, int, struct pf_rule **, + struct pf_rule **, int *); +int pf_step_out_of_anchor(struct pf_anchor_stackframe *, int *, + struct pf_ruleset **, int, struct pf_rule **, + struct pf_rule **, int *); int pf_map_addr(u_int8_t, struct pf_rule *, struct pf_addr *, struct pf_addr *, @@ -1951,7 +1954,7 @@ struct pf_rule *pf_get_translation(stru int, int, struct pfi_kif *, struct pf_src_node **, struct pf_state_key **, struct pf_state_key **, struct pf_addr *, struct pf_addr *, - u_int16_t, u_int16_t); + uint16_t, uint16_t, struct pf_anchor_stackframe *); struct pf_state_key *pf_state_key_setup(struct pf_pdesc *, struct pf_addr *, struct pf_addr *, u_int16_t, u_int16_t); Modified: head/sys/netpfil/pf/pf.c ============================================================================== --- head/sys/netpfil/pf/pf.c Tue Sep 18 10:52:46 2012 (r240640) +++ head/sys/netpfil/pf/pf.c Tue Sep 18 10:54:56 2012 (r240641) @@ -127,15 +127,6 @@ VNET_DEFINE(int, pf_tcp_secret_init); VNET_DEFINE(int, pf_tcp_iss_off); #define V_pf_tcp_iss_off VNET(pf_tcp_iss_off) -struct pf_anchor_stackframe { - struct pf_ruleset *rs; - struct pf_rule *r; - struct pf_anchor_node *parent; - struct pf_anchor *child; -}; -VNET_DEFINE(struct pf_anchor_stackframe, pf_anchor_stack[64]); -#define V_pf_anchor_stack VNET(pf_anchor_stack) - /* * Queue for pf_intr() sends. */ @@ -2461,37 +2452,56 @@ pf_tag_packet(struct mbuf *m, struct pf_ return (0); } +#define PF_ANCHOR_STACKSIZE 32 +struct pf_anchor_stackframe { + struct pf_ruleset *rs; + struct pf_rule *r; /* XXX: + match bit */ + struct pf_anchor *child; +}; + +/* + * XXX: We rely on malloc(9) returning pointer aligned addresses. + */ +#define PF_ANCHORSTACK_MATCH 0x00000001 +#define PF_ANCHORSTACK_MASK (PF_ANCHORSTACK_MATCH) + +#define PF_ANCHOR_MATCH(f) ((uintptr_t)(f)->r & PF_ANCHORSTACK_MATCH) +#define PF_ANCHOR_RULE(f) (struct pf_rule *) \ + ((uintptr_t)(f)->r & ~PF_ANCHORSTACK_MASK) +#define PF_ANCHOR_SET_MATCH(f) do { (f)->r = (void *) \ + ((uintptr_t)(f)->r | PF_ANCHORSTACK_MATCH); \ +} while (0) + void -pf_step_into_anchor(int *depth, struct pf_ruleset **rs, int n, - struct pf_rule **r, struct pf_rule **a, int *match) +pf_step_into_anchor(struct pf_anchor_stackframe *stack, int *depth, + struct pf_ruleset **rs, int n, struct pf_rule **r, struct pf_rule **a, + int *match) { struct pf_anchor_stackframe *f; PF_RULES_RASSERT(); - (*r)->anchor->match = 0; if (match) *match = 0; - if (*depth >= sizeof(V_pf_anchor_stack) / - sizeof(V_pf_anchor_stack[0])) { - printf("pf_step_into_anchor: stack overflow\n"); + if (*depth >= PF_ANCHOR_STACKSIZE) { + printf("%s: anchor stack overflow on %s\n", + __func__, (*r)->anchor->name); *r = TAILQ_NEXT(*r, entries); return; } else if (*depth == 0 && a != NULL) *a = *r; - f = V_pf_anchor_stack + (*depth)++; + f = stack + (*depth)++; f->rs = *rs; f->r = *r; if ((*r)->anchor_wildcard) { - f->parent = &(*r)->anchor->children; - if ((f->child = RB_MIN(pf_anchor_node, f->parent)) == - NULL) { + struct pf_anchor_node *parent = &(*r)->anchor->children; + + if ((f->child = RB_MIN(pf_anchor_node, parent)) == NULL) { *r = NULL; return; } *rs = &f->child->ruleset; } else { - f->parent = NULL; f->child = NULL; *rs = &(*r)->anchor->ruleset; } @@ -2499,10 +2509,12 @@ pf_step_into_anchor(int *depth, struct p } int -pf_step_out_of_anchor(int *depth, struct pf_ruleset **rs, int n, - struct pf_rule **r, struct pf_rule **a, int *match) +pf_step_out_of_anchor(struct pf_anchor_stackframe *stack, int *depth, + struct pf_ruleset **rs, int n, struct pf_rule **r, struct pf_rule **a, + int *match) { struct pf_anchor_stackframe *f; + struct pf_rule *fr; int quick = 0; PF_RULES_RASSERT(); @@ -2510,14 +2522,26 @@ pf_step_out_of_anchor(int *depth, struct do { if (*depth <= 0) break; - f = V_pf_anchor_stack + *depth - 1; - if (f->parent != NULL && f->child != NULL) { - if (f->child->match || - (match != NULL && *match)) { - f->r->anchor->match = 1; + f = stack + *depth - 1; + fr = PF_ANCHOR_RULE(f); + if (f->child != NULL) { + struct pf_anchor_node *parent; + + /* + * This block traverses through + * a wildcard anchor. + */ + parent = &fr->anchor->children; + if (match != NULL && *match) { + /* + * If any of "*" matched, then + * "foo/ *" matched, mark frame + * appropriately. + */ + PF_ANCHOR_SET_MATCH(f); *match = 0; } - f->child = RB_NEXT(pf_anchor_node, f->parent, f->child); + f->child = RB_NEXT(pf_anchor_node, parent, f->child); if (f->child != NULL) { *rs = &f->child->ruleset; *r = TAILQ_FIRST((*rs)->rules[n].active.ptr); @@ -2531,9 +2555,9 @@ pf_step_out_of_anchor(int *depth, struct if (*depth == 0 && a != NULL) *a = NULL; *rs = f->rs; - if (f->r->anchor->match || (match != NULL && *match)) - quick = f->r->quick; - *r = TAILQ_NEXT(f->r, entries); + if (PF_ANCHOR_MATCH(f) || (match != NULL && *match)) + quick = fr->quick; + *r = TAILQ_NEXT(fr, entries); } while (*r == NULL); return (quick); @@ -2887,6 +2911,7 @@ pf_test_rule(struct pf_rule **rm, struct u_int16_t sport = 0, dport = 0; u_int16_t bproto_sum = 0, bip_sum = 0; u_int8_t icmptype = 0, icmpcode = 0; + struct pf_anchor_stackframe anchor_stack[PF_ANCHOR_STACKSIZE]; PF_RULES_RASSERT(); @@ -2950,7 +2975,7 @@ pf_test_rule(struct pf_rule **rm, struct /* check packet for BINAT/NAT/RDR */ if ((nr = pf_get_translation(pd, m, off, direction, kif, &nsn, &sk, - &nk, saddr, daddr, sport, dport)) != NULL) { + &nk, saddr, daddr, sport, dport, anchor_stack)) != NULL) { KASSERT(sk != NULL, ("%s: null sk", __func__)); KASSERT(nk != NULL, ("%s: null nk", __func__)); @@ -3150,11 +3175,12 @@ pf_test_rule(struct pf_rule **rm, struct break; r = TAILQ_NEXT(r, entries); } else - pf_step_into_anchor(&asd, &ruleset, - PF_RULESET_FILTER, &r, &a, &match); + pf_step_into_anchor(anchor_stack, &asd, + &ruleset, PF_RULESET_FILTER, &r, &a, + &match); } - if (r == NULL && pf_step_out_of_anchor(&asd, &ruleset, - PF_RULESET_FILTER, &r, &a, &match)) + if (r == NULL && pf_step_out_of_anchor(anchor_stack, &asd, + &ruleset, PF_RULESET_FILTER, &r, &a, &match)) break; } r = *rm; @@ -3527,6 +3553,7 @@ pf_test_fragment(struct pf_rule **rm, in int tag = -1; int asd = 0; int match = 0; + struct pf_anchor_stackframe anchor_stack[PF_ANCHOR_STACKSIZE]; PF_RULES_RASSERT(); @@ -3577,11 +3604,12 @@ pf_test_fragment(struct pf_rule **rm, in break; r = TAILQ_NEXT(r, entries); } else - pf_step_into_anchor(&asd, &ruleset, - PF_RULESET_FILTER, &r, &a, &match); + pf_step_into_anchor(anchor_stack, &asd, + &ruleset, PF_RULESET_FILTER, &r, &a, + &match); } - if (r == NULL && pf_step_out_of_anchor(&asd, &ruleset, - PF_RULESET_FILTER, &r, &a, &match)) + if (r == NULL && pf_step_out_of_anchor(anchor_stack, &asd, + &ruleset, PF_RULESET_FILTER, &r, &a, &match)) break; } r = *rm; Modified: head/sys/netpfil/pf/pf_lb.c ============================================================================== --- head/sys/netpfil/pf/pf_lb.c Tue Sep 18 10:52:46 2012 (r240640) +++ head/sys/netpfil/pf/pf_lb.c Tue Sep 18 10:54:56 2012 (r240641) @@ -58,7 +58,7 @@ static void pf_hash(struct pf_addr *, static struct pf_rule *pf_match_translation(struct pf_pdesc *, struct mbuf *, int, int, struct pfi_kif *, struct pf_addr *, u_int16_t, struct pf_addr *, - u_int16_t, int); + uint16_t, int, struct pf_anchor_stackframe *); static int pf_get_sport(sa_family_t, u_int8_t, struct pf_rule *, struct pf_addr *, struct pf_addr *, u_int16_t, struct pf_addr *, u_int16_t*, u_int16_t, u_int16_t, @@ -124,7 +124,8 @@ pf_hash(struct pf_addr *inaddr, struct p static struct pf_rule * pf_match_translation(struct pf_pdesc *pd, struct mbuf *m, int off, int direction, struct pfi_kif *kif, struct pf_addr *saddr, u_int16_t sport, - struct pf_addr *daddr, u_int16_t dport, int rs_num) + struct pf_addr *daddr, uint16_t dport, int rs_num, + struct pf_anchor_stackframe *anchor_stack) { struct pf_rule *r, *rm = NULL; struct pf_ruleset *ruleset = NULL; @@ -189,12 +190,12 @@ pf_match_translation(struct pf_pdesc *pd if (r->anchor == NULL) { rm = r; } else - pf_step_into_anchor(&asd, &ruleset, rs_num, - &r, NULL, NULL); + pf_step_into_anchor(anchor_stack, &asd, + &ruleset, rs_num, &r, NULL, NULL); } if (r == NULL) - pf_step_out_of_anchor(&asd, &ruleset, rs_num, &r, - NULL, NULL); + pf_step_out_of_anchor(anchor_stack, &asd, &ruleset, + rs_num, &r, NULL, NULL); } if (tag > 0 && pf_tag_packet(m, pd, tag)) @@ -499,7 +500,7 @@ pf_get_translation(struct pf_pdesc *pd, struct pfi_kif *kif, struct pf_src_node **sn, struct pf_state_key **skp, struct pf_state_key **nkp, struct pf_addr *saddr, struct pf_addr *daddr, - u_int16_t sport, u_int16_t dport) + uint16_t sport, uint16_t dport, struct pf_anchor_stackframe *anchor_stack) { struct pf_rule *r = NULL; struct pf_addr *naddr; @@ -511,16 +512,18 @@ pf_get_translation(struct pf_pdesc *pd, if (direction == PF_OUT) { r = pf_match_translation(pd, m, off, direction, kif, saddr, - sport, daddr, dport, PF_RULESET_BINAT); + sport, daddr, dport, PF_RULESET_BINAT, anchor_stack); if (r == NULL) r = pf_match_translation(pd, m, off, direction, kif, - saddr, sport, daddr, dport, PF_RULESET_NAT); + saddr, sport, daddr, dport, PF_RULESET_NAT, + anchor_stack); } else { r = pf_match_translation(pd, m, off, direction, kif, saddr, - sport, daddr, dport, PF_RULESET_RDR); + sport, daddr, dport, PF_RULESET_RDR, anchor_stack); if (r == NULL) r = pf_match_translation(pd, m, off, direction, kif, - saddr, sport, daddr, dport, PF_RULESET_BINAT); + saddr, sport, daddr, dport, PF_RULESET_BINAT, + anchor_stack); } if (r == NULL) From owner-svn-src-all@FreeBSD.ORG Tue Sep 18 11:07:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 264121065672; Tue, 18 Sep 2012 11:07:20 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 103BD8FC14; Tue, 18 Sep 2012 11:07:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8IB7JBf077204; Tue, 18 Sep 2012 11:07:19 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8IB7J1C077198; Tue, 18 Sep 2012 11:07:19 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201209181107.q8IB7J1C077198@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 18 Sep 2012 11:07:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240642 - in head: share/man/man4 sys/conf sys/netpfil/pf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Sep 2012 11:07:20 -0000 Author: glebius Date: Tue Sep 18 11:07:19 2012 New Revision: 240642 URL: http://svn.freebsd.org/changeset/base/240642 Log: Provide kernel compile time option to make pf(4) default rule to drop. This is important to secure a small timeframe at boot time, when network is already configured, but pf(4) is not yet. PR: kern/171622 Submitted by: Olivier Cochard-LabbИ Modified: head/share/man/man4/pf.4 head/sys/conf/NOTES head/sys/conf/options head/sys/netpfil/pf/pf_ioctl.c Modified: head/share/man/man4/pf.4 ============================================================================== --- head/share/man/man4/pf.4 Tue Sep 18 10:54:56 2012 (r240641) +++ head/share/man/man4/pf.4 Tue Sep 18 11:07:19 2012 (r240642) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 29 2012 +.Dd September 18 2012 .Dt PF 4 .Os .Sh NAME @@ -36,6 +36,7 @@ .Nd packet filter .Sh SYNOPSIS .Cd "device pf" +.Cd "options PF_DEFAULT_TO_DROP" .Sh DESCRIPTION Packet filtering takes place in the kernel. A pseudo-device, @@ -94,6 +95,15 @@ Read only .Xr sysctl 8 variables with matching names are provided to obtain current values at runtime. +.Sh KERNEL OPTIONS +The following options in the kernel configuration file are related to +.Nm +operation: +.Pp +.Bl -tag -width ".Dv PF_DEFAULT_TO_DROP" -compact +.It Dv PF_DEFAULT_TO_DROP +Change default policy to drop by default +.El .Sh IOCTL INTERFACE .Nm supports the following Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Tue Sep 18 10:54:56 2012 (r240641) +++ head/sys/conf/NOTES Tue Sep 18 11:07:19 2012 (r240642) @@ -918,6 +918,8 @@ device lagg # packets without touching the TTL). This can be useful to hide firewalls # from traceroute and similar tools. # +# PF_DEFAULT_TO_DROP causes the default pf(4) rule to deny everything. +# # TCPDEBUG enables code which keeps traces of the TCP state machine # for sockets with the SO_DEBUG option set, which can then be examined # using the trpt(8) utility. @@ -937,6 +939,7 @@ options IPFILTER_LOG #ipfilter logging options IPFILTER_LOOKUP #ipfilter pools options IPFILTER_DEFAULT_BLOCK #block all packets by default options IPSTEALTH #support for stealth forwarding +options PF_DEFAULT_TO_DROP #drop everything by default options TCPDEBUG options RADIX_MPATH Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Tue Sep 18 10:54:56 2012 (r240641) +++ head/sys/conf/options Tue Sep 18 11:07:19 2012 (r240642) @@ -430,6 +430,7 @@ NCP NETATALK opt_atalk.h NFSLOCKD PCBGROUP opt_pcbgroup.h +PF_DEFAULT_TO_DROP opt_pf.h RADIX_MPATH opt_mpath.h ROUTETABLES opt_route.h SLIP_IFF_OPTS opt_slip.h Modified: head/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- head/sys/netpfil/pf/pf_ioctl.c Tue Sep 18 10:54:56 2012 (r240641) +++ head/sys/netpfil/pf/pf_ioctl.c Tue Sep 18 11:07:19 2012 (r240642) @@ -216,7 +216,11 @@ pfattach(void) /* default rule should never be garbage collected */ V_pf_default_rule.entries.tqe_prev = &V_pf_default_rule.entries.tqe_next; +#ifdef PF_DEFAULT_TO_DROP + V_pf_default_rule.action = PF_DROP; +#else V_pf_default_rule.action = PF_PASS; +#endif V_pf_default_rule.nr = -1; V_pf_default_rule.rtableid = -1; From owner-svn-src-all@FreeBSD.ORG Tue Sep 18 11:25:05 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 64697106564A; Tue, 18 Sep 2012 11:25:05 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 49B608FC0C; Tue, 18 Sep 2012 11:25:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8IBP5TJ079867; Tue, 18 Sep 2012 11:25:05 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8IBP57E079865; Tue, 18 Sep 2012 11:25:05 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201209181125.q8IBP57E079865@svn.freebsd.org> From: Glen Barber Date: Tue, 18 Sep 2012 11:25:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240643 - stable/9/release/doc/en_US.ISO8859-1/relnotes X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Sep 2012 11:25:05 -0000 Author: gjb (doc,ports committer) Date: Tue Sep 18 11:25:04 2012 New Revision: 240643 URL: http://svn.freebsd.org/changeset/base/240643 Log: Fix release notes build on 9-STABLE. This is a direct commit to stable/9. Modified: stable/9/release/doc/en_US.ISO8859-1/relnotes/article.sgml Modified: stable/9/release/doc/en_US.ISO8859-1/relnotes/article.sgml ============================================================================== --- stable/9/release/doc/en_US.ISO8859-1/relnotes/article.sgml Tue Sep 18 11:07:19 2012 (r240642) +++ stable/9/release/doc/en_US.ISO8859-1/relnotes/article.sgml Tue Sep 18 11:25:04 2012 (r240643) @@ -1264,7 +1264,7 @@ nfsuserd_enable="YES" when a login daemon crashes or fails to remove the entry during shutdown. - The &man.zpool.8: utility now supports a + The &man.zpool.8; utility now supports a zpool labelclear command. This allows to wipe the label data from a drive that is not active in a pool. From owner-svn-src-all@FreeBSD.ORG Tue Sep 18 12:21:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 329061065672; Tue, 18 Sep 2012 12:21:33 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1D7628FC1A; Tue, 18 Sep 2012 12:21:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8ICLWbI088981; Tue, 18 Sep 2012 12:21:32 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8ICLWmq088979; Tue, 18 Sep 2012 12:21:32 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201209181221.q8ICLWmq088979@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 18 Sep 2012 12:21:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240644 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Sep 2012 12:21:33 -0000 Author: glebius Date: Tue Sep 18 12:21:32 2012 New Revision: 240644 URL: http://svn.freebsd.org/changeset/base/240644 Log: Fix build, pass the pointy hat please. Modified: head/sys/net/pfvar.h Modified: head/sys/net/pfvar.h ============================================================================== --- head/sys/net/pfvar.h Tue Sep 18 11:25:04 2012 (r240643) +++ head/sys/net/pfvar.h Tue Sep 18 12:21:32 2012 (r240644) @@ -26,7 +26,7 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $OpenBSD: pfvar.h,v 1.282 2009/01/29 15:12:28 pyr Exp $ */ + * $OpenBSD: pfvar.h,v 1.282 2009/01/29 15:12:28 pyr Exp $ * $FreeBSD$ */ From owner-svn-src-all@FreeBSD.ORG Tue Sep 18 12:25:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 68211106564A; Tue, 18 Sep 2012 12:25:15 +0000 (UTC) (envelope-from zont@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 399428FC14; Tue, 18 Sep 2012 12:25:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8ICPFM0089603; Tue, 18 Sep 2012 12:25:15 GMT (envelope-from zont@svn.freebsd.org) Received: (from zont@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8ICPF3r089600; Tue, 18 Sep 2012 12:25:15 GMT (envelope-from zont@svn.freebsd.org) Message-Id: <201209181225.q8ICPF3r089600@svn.freebsd.org> From: Andrey Zonov Date: Tue, 18 Sep 2012 12:25:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240645 - head/bin/ps X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Sep 2012 12:25:15 -0000 Author: zont Date: Tue Sep 18 12:25:14 2012 New Revision: 240645 URL: http://svn.freebsd.org/changeset/base/240645 Log: - Add 'dsiz' and 'ssiz' keywords to show data and stack size respectively. Approved by: kib (mentor) MFC after: 1 week Modified: head/bin/ps/keyword.c head/bin/ps/ps.1 Modified: head/bin/ps/keyword.c ============================================================================== --- head/bin/ps/keyword.c Tue Sep 18 12:21:32 2012 (r240644) +++ head/bin/ps/keyword.c Tue Sep 18 12:25:14 2012 (r240645) @@ -79,6 +79,7 @@ static VAR var[] = { {"cow", "COW", NULL, 0, kvar, KOFF(ki_cow), UINT, "u", 0}, {"cpu", "CPU", NULL, 0, kvar, KOFF(ki_estcpu), UINT, "d", 0}, {"cputime", "", "time", 0, NULL, 0, CHAR, NULL, 0}, + {"dsiz", "DSIZ", NULL, 0, kvar, KOFF(ki_dsize), PGTOK, "ld", 0}, {"egid", "", "gid", 0, NULL, 0, CHAR, NULL, 0}, {"egroup", "", "group", 0, NULL, 0, CHAR, NULL, 0}, {"emul", "EMUL", NULL, LJUST, emulname, 0, CHAR, NULL, 0}, @@ -141,6 +142,7 @@ static VAR var[] = { UINT, "x", 0}, {"sigmask", "BLOCKED", NULL, 0, kvar, KOFF(ki_sigmask), UINT, "x", 0}, {"sl", "SL", NULL, INF127, kvar, KOFF(ki_slptime), UINT, "d", 0}, + {"ssiz", "SSIZ", NULL, 0, kvar, KOFF(ki_ssize), PGTOK, "ld", 0}, {"start", "STARTED", NULL, LJUST|USER, started, 0, CHAR, NULL, 0}, {"stat", "", "state", 0, NULL, 0, CHAR, NULL, 0}, {"state", "STAT", NULL, LJUST, state, 0, CHAR, NULL, 0}, Modified: head/bin/ps/ps.1 ============================================================================== --- head/bin/ps/ps.1 Tue Sep 18 12:21:32 2012 (r240644) +++ head/bin/ps/ps.1 Tue Sep 18 12:25:14 2012 (r240645) @@ -500,6 +500,8 @@ command and arguments number of copy-on-write faults .It Cm cpu short-term CPU usage factor (for scheduling) +.It Cm dsiz +data size (in Kbytes) .It Cm emul system-call emulation environment .It Cm etime @@ -610,6 +612,8 @@ blocked signals (alias .Cm blocked ) .It Cm sl sleep time (in seconds; 127 = infinity) +.It Cm ssiz +stack size (in Kbytes) .It Cm start time started .It Cm state From owner-svn-src-all@FreeBSD.ORG Tue Sep 18 12:34:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 607DC106566B; Tue, 18 Sep 2012 12:34:36 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4B6B48FC16; Tue, 18 Sep 2012 12:34:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8ICYa9A091113; Tue, 18 Sep 2012 12:34:36 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8ICYaFB091109; Tue, 18 Sep 2012 12:34:36 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201209181234.q8ICYaFB091109@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 18 Sep 2012 12:34:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240646 - head/sys/contrib/altq/altq X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Sep 2012 12:34:36 -0000 Author: glebius Date: Tue Sep 18 12:34:35 2012 New Revision: 240646 URL: http://svn.freebsd.org/changeset/base/240646 Log: Do more than r236298 did in the projects/pf branch: use M_NOWAIT in altq_add() and its descendants. Currently altq(4) in FreeBSD is configured via pf(4) ioctls, which can't configure altq(4) w/o holding locks. Fortunately, altq(4) code in spife of using M_WAITOK is ready to receive NULL from malloc(9), so change is mostly mechanical. While here, utilize M_ZERO instead of bzero(). A large redesign needed to achieve M_WAITOK usage when configuring altq(4). Or an alternative (not pf(4)) configuration interface should be implemented. Reported by: pluknet Modified: head/sys/contrib/altq/altq/altq_hfsc.c head/sys/contrib/altq/altq/altq_priq.c head/sys/contrib/altq/altq/altq_rmclass.c Modified: head/sys/contrib/altq/altq/altq_hfsc.c ============================================================================== --- head/sys/contrib/altq/altq/altq_hfsc.c Tue Sep 18 12:25:14 2012 (r240645) +++ head/sys/contrib/altq/altq/altq_hfsc.c Tue Sep 18 12:34:35 2012 (r240646) @@ -400,15 +400,13 @@ hfsc_class_create(struct hfsc_if *hif, s } #endif - cl = malloc(sizeof(struct hfsc_class), M_DEVBUF, M_WAITOK); + cl = malloc(sizeof(struct hfsc_class), M_DEVBUF, M_NOWAIT | M_ZERO); if (cl == NULL) return (NULL); - bzero(cl, sizeof(struct hfsc_class)); - cl->cl_q = malloc(sizeof(class_queue_t), M_DEVBUF, M_WAITOK); + cl->cl_q = malloc(sizeof(class_queue_t), M_DEVBUF, M_NOWAIT | M_ZERO); if (cl->cl_q == NULL) goto err_ret; - bzero(cl->cl_q, sizeof(class_queue_t)); cl->cl_actc = actlist_alloc(); if (cl->cl_actc == NULL) @@ -466,7 +464,7 @@ hfsc_class_create(struct hfsc_if *hif, s if (rsc != NULL && (rsc->m1 != 0 || rsc->m2 != 0)) { cl->cl_rsc = malloc(sizeof(struct internal_sc), - M_DEVBUF, M_WAITOK); + M_DEVBUF, M_NOWAIT); if (cl->cl_rsc == NULL) goto err_ret; sc2isc(rsc, cl->cl_rsc); @@ -475,7 +473,7 @@ hfsc_class_create(struct hfsc_if *hif, s } if (fsc != NULL && (fsc->m1 != 0 || fsc->m2 != 0)) { cl->cl_fsc = malloc(sizeof(struct internal_sc), - M_DEVBUF, M_WAITOK); + M_DEVBUF, M_NOWAIT); if (cl->cl_fsc == NULL) goto err_ret; sc2isc(fsc, cl->cl_fsc); @@ -483,7 +481,7 @@ hfsc_class_create(struct hfsc_if *hif, s } if (usc != NULL && (usc->m1 != 0 || usc->m2 != 0)) { cl->cl_usc = malloc(sizeof(struct internal_sc), - M_DEVBUF, M_WAITOK); + M_DEVBUF, M_NOWAIT); if (cl->cl_usc == NULL) goto err_ret; sc2isc(usc, cl->cl_usc); Modified: head/sys/contrib/altq/altq/altq_priq.c ============================================================================== --- head/sys/contrib/altq/altq/altq_priq.c Tue Sep 18 12:25:14 2012 (r240645) +++ head/sys/contrib/altq/altq/altq_priq.c Tue Sep 18 12:34:35 2012 (r240646) @@ -316,17 +316,15 @@ priq_class_create(struct priq_if *pif, i red_destroy(cl->cl_red); #endif } else { - cl = malloc(sizeof(struct priq_class), - M_DEVBUF, M_WAITOK); + cl = malloc(sizeof(struct priq_class), M_DEVBUF, + M_NOWAIT | M_ZERO); if (cl == NULL) return (NULL); - bzero(cl, sizeof(struct priq_class)); - cl->cl_q = malloc(sizeof(class_queue_t), - M_DEVBUF, M_WAITOK); + cl->cl_q = malloc(sizeof(class_queue_t), M_DEVBUF, + M_NOWAIT | M_ZERO); if (cl->cl_q == NULL) goto err_ret; - bzero(cl->cl_q, sizeof(class_queue_t)); } pif->pif_classes[pri] = cl; Modified: head/sys/contrib/altq/altq/altq_rmclass.c ============================================================================== --- head/sys/contrib/altq/altq/altq_rmclass.c Tue Sep 18 12:25:14 2012 (r240645) +++ head/sys/contrib/altq/altq/altq_rmclass.c Tue Sep 18 12:34:35 2012 (r240646) @@ -218,19 +218,15 @@ rmc_newclass(int pri, struct rm_ifdat *i } #endif - cl = malloc(sizeof(struct rm_class), - M_DEVBUF, M_WAITOK); + cl = malloc(sizeof(struct rm_class), M_DEVBUF, M_NOWAIT | M_ZERO); if (cl == NULL) return (NULL); - bzero(cl, sizeof(struct rm_class)); CALLOUT_INIT(&cl->callout_); - cl->q_ = malloc(sizeof(class_queue_t), - M_DEVBUF, M_WAITOK); + cl->q_ = malloc(sizeof(class_queue_t), M_DEVBUF, M_NOWAIT | M_ZERO); if (cl->q_ == NULL) { free(cl, M_DEVBUF); return (NULL); } - bzero(cl->q_, sizeof(class_queue_t)); /* * Class initialization. From owner-svn-src-all@FreeBSD.ORG Tue Sep 18 12:53:06 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BEA831065670; Tue, 18 Sep 2012 12:53:06 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id 5C5B08FC0C; Tue, 18 Sep 2012 12:53:06 +0000 (UTC) Received: by iayy25 with SMTP id y25so7784849iay.13 for ; Tue, 18 Sep 2012 05:53:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=9q45l/hesWue2eCBAFwuc8uIiLp1sZy+N0wOJXZ0hRI=; b=AQ8bPd1U8+AYaEwHswGDTvQATgU2+Zz3+yOSn+RLaWxUfwKxyDPIFi66bZrQqAeNNs 2T30Ubw4vX8G8uRRUgCXF7Vju0QzQQHPOjP0/iy812HB9iqovlzrLf57lXU+0BUtEI/q 3uBa+VHxhYkM5p51qOIGvyPtpwrS3xywW8ck/oS6zkcIFS+4hmRlk7QvAw/GCrh5REj9 dGflk0ia2cq1MDujA65n0o1B2KR2vE5SiEt4ikkq2OhE16bDhU23pZpVE6hoAEVRC0zw JjivphlocvtULgnj4cYIg09xAQo7rkqatjH4y+Ul6+ayke1BHs/6qoAoo+O8NRDq6g8B S27Q== MIME-Version: 1.0 Received: by 10.43.48.129 with SMTP id uw1mr97572icb.10.1347972785780; Tue, 18 Sep 2012 05:53:05 -0700 (PDT) Sender: pluknet@gmail.com Received: by 10.64.165.34 with HTTP; Tue, 18 Sep 2012 05:53:05 -0700 (PDT) In-Reply-To: <201209181234.q8ICYaFB091109@svn.freebsd.org> References: <201209181234.q8ICYaFB091109@svn.freebsd.org> Date: Tue, 18 Sep 2012 16:53:05 +0400 X-Google-Sender-Auth: Zd_k75c10pjoiIRwA3zfjnVWf-4 Message-ID: From: Sergey Kandaurov To: Gleb Smirnoff Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r240646 - head/sys/contrib/altq/altq X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Sep 2012 12:53:06 -0000 On 18 September 2012 16:34, Gleb Smirnoff wrote: > Author: glebius > Date: Tue Sep 18 12:34:35 2012 > New Revision: 240646 > URL: http://svn.freebsd.org/changeset/base/240646 > > Log: > Do more than r236298 did in the projects/pf branch: use M_NOWAIT in > altq_add() and its descendants. Currently altq(4) in FreeBSD is configured > via pf(4) ioctls, which can't configure altq(4) w/o holding locks. > Fortunately, altq(4) code in spife of using M_WAITOK is ready to receive > NULL from malloc(9), so change is mostly mechanical. While here, utilize > M_ZERO instead of bzero(). > > A large redesign needed to achieve M_WAITOK usage when configuring altq(4). > Or an alternative (not pf(4)) configuration interface should be implemented. > > Reported by: pluknet Actually Kim Culhan was initial reporter. I just reposted the problem closer to glebius and pointed out the roots. -- wbr, pluknet From owner-svn-src-all@FreeBSD.ORG Tue Sep 18 13:03:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 28FD11065670; Tue, 18 Sep 2012 13:03:01 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1442D8FC12; Tue, 18 Sep 2012 13:03:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8ID30mR096056; Tue, 18 Sep 2012 13:03:00 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8ID30xb096054; Tue, 18 Sep 2012 13:03:00 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201209181303.q8ID30xb096054@svn.freebsd.org> From: Ed Maste Date: Tue, 18 Sep 2012 13:03:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240647 - releng/9.1/lib/libc/stdlib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Sep 2012 13:03:01 -0000 Author: emaste Date: Tue Sep 18 13:03:00 2012 New Revision: 240647 URL: http://svn.freebsd.org/changeset/base/240647 Log: MFC r240410: Avoid mapping ENOENT to ENOTDIR for non-existent path components. The ENOTDIR mapping was introduced in r235266 for kern/128933 based on an interpretation of the somewhat ambiguous language in the POSIX realpath specification. The interpretation is inconsistent with Solaris and Linux, a regression from 9.0, and does not appear to be permitted by the description of ENOTDIR: 20 ENOTDIR Not a directory. A component of the specified pathname existed, but it was not a directory, when a directory was expected. PR: standards/171577 Approved by: re Sponsored by: ADARA Networks Modified: releng/9.1/lib/libc/stdlib/realpath.c Directory Properties: releng/9.1/lib/libc/ (props changed) Modified: releng/9.1/lib/libc/stdlib/realpath.c ============================================================================== --- releng/9.1/lib/libc/stdlib/realpath.c Tue Sep 18 12:34:35 2012 (r240646) +++ releng/9.1/lib/libc/stdlib/realpath.c Tue Sep 18 13:03:00 2012 (r240647) @@ -181,8 +181,6 @@ realpath(const char * __restrict path, c return (NULL); } if (lstat(resolved, &sb) != 0) { - if (errno != ENOENT || p != NULL) - errno = ENOTDIR; if (m) free(resolved); return (NULL); From owner-svn-src-all@FreeBSD.ORG Tue Sep 18 13:13:28 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E3EF71065670; Tue, 18 Sep 2012 13:13:28 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CE7B48FC15; Tue, 18 Sep 2012 13:13:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8IDDSNb097920; Tue, 18 Sep 2012 13:13:28 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8IDDSG9097917; Tue, 18 Sep 2012 13:13:28 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201209181313.q8IDDSG9097917@svn.freebsd.org> From: Ed Maste Date: Tue, 18 Sep 2012 13:13:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240648 - releng/9.1/lib/libc/stdlib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Sep 2012 13:13:29 -0000 Author: emaste Date: Tue Sep 18 13:13:28 2012 New Revision: 240648 URL: http://svn.freebsd.org/changeset/base/240648 Log: MFC r240412: According to a clarification at http://austingroupbugs.net/view.php?id=503 ptsname may set errno, so avoid saving and restoring errno across the function. PR: standards/171572 Approved by: re Sponsored by: ADARA Networks Modified: releng/9.1/lib/libc/stdlib/ptsname.3 releng/9.1/lib/libc/stdlib/ptsname.c Directory Properties: releng/9.1/lib/libc/ (props changed) Modified: releng/9.1/lib/libc/stdlib/ptsname.3 ============================================================================== --- releng/9.1/lib/libc/stdlib/ptsname.3 Tue Sep 18 13:03:00 2012 (r240647) +++ releng/9.1/lib/libc/stdlib/ptsname.3 Tue Sep 18 13:13:28 2012 (r240648) @@ -102,7 +102,8 @@ of the slave device on success; otherwis pointer is returned. .Sh ERRORS The -.Fn grantpt +.Fn grantpt , +.Fn ptsname and .Fn unlockpt functions may fail and set Modified: releng/9.1/lib/libc/stdlib/ptsname.c ============================================================================== --- releng/9.1/lib/libc/stdlib/ptsname.c Tue Sep 18 13:03:00 2012 (r240647) +++ releng/9.1/lib/libc/stdlib/ptsname.c Tue Sep 18 13:13:28 2012 (r240648) @@ -77,7 +77,6 @@ ptsname(int fildes) { static char pt_slave[sizeof _PATH_DEV + SPECNAMELEN] = _PATH_DEV; char *ret = NULL; - int sverrno = errno; /* Make sure fildes points to a master device. */ if (__isptmaster(fildes) != 0) @@ -87,7 +86,6 @@ ptsname(int fildes) sizeof pt_slave - (sizeof _PATH_DEV - 1)) != NULL) ret = pt_slave; -done: /* Make sure ptsname() does not overwrite errno. */ - errno = sverrno; +done: return (ret); } From owner-svn-src-all@FreeBSD.ORG Tue Sep 18 13:24:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C4C0E106566B; Tue, 18 Sep 2012 13:24:15 +0000 (UTC) (envelope-from zont@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 971318FC12; Tue, 18 Sep 2012 13:24:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8IDOFMo099920; Tue, 18 Sep 2012 13:24:15 GMT (envelope-from zont@svn.freebsd.org) Received: (from zont@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8IDOFLB099918; Tue, 18 Sep 2012 13:24:15 GMT (envelope-from zont@svn.freebsd.org) Message-Id: <201209181324.q8IDOFLB099918@svn.freebsd.org> From: Andrey Zonov Date: Tue, 18 Sep 2012 13:24:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240649 - head/bin/ps X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Sep 2012 13:24:15 -0000 Author: zont Date: Tue Sep 18 13:24:14 2012 New Revision: 240649 URL: http://svn.freebsd.org/changeset/base/240649 Log: - Bump date. Submitted by: pluknet Approved by: kib (mentor) X-MFC-With: r240645 Modified: head/bin/ps/ps.1 Modified: head/bin/ps/ps.1 ============================================================================== --- head/bin/ps/ps.1 Tue Sep 18 13:13:28 2012 (r240648) +++ head/bin/ps/ps.1 Tue Sep 18 13:24:14 2012 (r240649) @@ -29,7 +29,7 @@ .\" @(#)ps.1 8.3 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd May 20, 2012 +.Dd September 18, 2012 .Dt PS 1 .Os .Sh NAME From owner-svn-src-all@FreeBSD.ORG Tue Sep 18 13:33:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BF93E106566C; Tue, 18 Sep 2012 13:33:39 +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 AB3F58FC12; Tue, 18 Sep 2012 13:33:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8IDXdlM001773; Tue, 18 Sep 2012 13:33:39 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8IDXdf9001771; Tue, 18 Sep 2012 13:33:39 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201209181333.q8IDXdf9001771@svn.freebsd.org> From: Andriy Gapon Date: Tue, 18 Sep 2012 13:33:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240650 - head/sys/dev/hwpmc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Sep 2012 13:33:39 -0000 Author: avg Date: Tue Sep 18 13:33:39 2012 New Revision: 240650 URL: http://svn.freebsd.org/changeset/base/240650 Log: hwpmc amd_pcpu_fini: fix a bug in code locked under DEBUG MFC after: 16 days Modified: head/sys/dev/hwpmc/hwpmc_amd.c Modified: head/sys/dev/hwpmc/hwpmc_amd.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_amd.c Tue Sep 18 13:24:14 2012 (r240649) +++ head/sys/dev/hwpmc/hwpmc_amd.c Tue Sep 18 13:33:39 2012 (r240650) @@ -839,7 +839,7 @@ amd_pcpu_fini(struct pmc_mdep *md, int c for (i = 0; i < AMD_NPMCS; i++) { KASSERT(pac->pc_amdpmcs[i].phw_pmc == NULL, ("[amd,%d] CPU%d/PMC%d in use", __LINE__, cpu, i)); - KASSERT(AMD_PMC_IS_STOPPED(AMD_PMC_EVSEL_0 + (i-1)), + KASSERT(AMD_PMC_IS_STOPPED(AMD_PMC_EVSEL_0 + i), ("[amd,%d] CPU%d/PMC%d not stopped", __LINE__, cpu, i)); } #endif From owner-svn-src-all@FreeBSD.ORG Tue Sep 18 13:54:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 34169106566B; Tue, 18 Sep 2012 13:54:49 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1A07D8FC0A; Tue, 18 Sep 2012 13:54:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8IDsm6P005133; Tue, 18 Sep 2012 13:54:48 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8IDsmcG005106; Tue, 18 Sep 2012 13:54:48 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201209181354.q8IDsmcG005106@svn.freebsd.org> From: Glen Barber Date: Tue, 18 Sep 2012 13:54:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240651 - in stable/9/release/doc: de_DE.ISO8859-1/early-adopter de_DE.ISO8859-1/errata de_DE.ISO8859-1/hardware/alpha de_DE.ISO8859-1/hardware/i386 de_DE.ISO8859-1/hardware/ia64 de_DE.... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Sep 2012 13:54:49 -0000 Author: gjb (doc,ports committer) Date: Tue Sep 18 13:54:48 2012 New Revision: 240651 URL: http://svn.freebsd.org/changeset/base/240651 Log: MFC r240508, r240516, r240519 (gabor): Update stable/9/release/doc files post-XML conversion. This commit fixes most of the 9-STABLE release build problems. Modified: stable/9/release/doc/de_DE.ISO8859-1/early-adopter/article.sgml stable/9/release/doc/de_DE.ISO8859-1/errata/article.sgml stable/9/release/doc/de_DE.ISO8859-1/hardware/alpha/article.sgml stable/9/release/doc/de_DE.ISO8859-1/hardware/i386/article.sgml stable/9/release/doc/de_DE.ISO8859-1/hardware/ia64/article.sgml stable/9/release/doc/de_DE.ISO8859-1/hardware/pc98/article.sgml stable/9/release/doc/de_DE.ISO8859-1/hardware/sparc64/article.sgml stable/9/release/doc/de_DE.ISO8859-1/installation/alpha/article.sgml stable/9/release/doc/de_DE.ISO8859-1/installation/common/install.sgml stable/9/release/doc/de_DE.ISO8859-1/installation/common/layout.sgml stable/9/release/doc/de_DE.ISO8859-1/installation/i386/article.sgml stable/9/release/doc/de_DE.ISO8859-1/installation/ia64/article.sgml stable/9/release/doc/de_DE.ISO8859-1/installation/pc98/article.sgml stable/9/release/doc/de_DE.ISO8859-1/installation/sparc64/article.sgml stable/9/release/doc/de_DE.ISO8859-1/readme/article.sgml stable/9/release/doc/de_DE.ISO8859-1/relnotes/alpha/article.sgml stable/9/release/doc/de_DE.ISO8859-1/relnotes/i386/article.sgml stable/9/release/doc/de_DE.ISO8859-1/relnotes/ia64/article.sgml stable/9/release/doc/de_DE.ISO8859-1/relnotes/pc98/article.sgml stable/9/release/doc/de_DE.ISO8859-1/relnotes/sparc64/article.sgml stable/9/release/doc/en_US.ISO8859-1/errata/article.sgml stable/9/release/doc/en_US.ISO8859-1/hardware/article.sgml stable/9/release/doc/en_US.ISO8859-1/readme/article.sgml stable/9/release/doc/en_US.ISO8859-1/relnotes/article.sgml stable/9/release/doc/fr_FR.ISO8859-1/early-adopter/article.sgml stable/9/release/doc/fr_FR.ISO8859-1/errata/article.sgml stable/9/release/doc/fr_FR.ISO8859-1/hardware/alpha/article.sgml stable/9/release/doc/fr_FR.ISO8859-1/hardware/common/dev.sgml stable/9/release/doc/fr_FR.ISO8859-1/hardware/i386/article.sgml stable/9/release/doc/fr_FR.ISO8859-1/hardware/ia64/article.sgml stable/9/release/doc/fr_FR.ISO8859-1/hardware/pc98/article.sgml stable/9/release/doc/fr_FR.ISO8859-1/hardware/sparc64/article.sgml stable/9/release/doc/fr_FR.ISO8859-1/installation/alpha/article.sgml stable/9/release/doc/fr_FR.ISO8859-1/installation/common/install.sgml stable/9/release/doc/fr_FR.ISO8859-1/installation/common/layout.sgml stable/9/release/doc/fr_FR.ISO8859-1/installation/common/trouble.sgml stable/9/release/doc/fr_FR.ISO8859-1/installation/common/upgrade.sgml stable/9/release/doc/fr_FR.ISO8859-1/installation/i386/article.sgml stable/9/release/doc/fr_FR.ISO8859-1/installation/pc98/article.sgml stable/9/release/doc/fr_FR.ISO8859-1/installation/sparc64/article.sgml stable/9/release/doc/fr_FR.ISO8859-1/installation/sparc64/install.sgml stable/9/release/doc/fr_FR.ISO8859-1/relnotes/alpha/article.sgml stable/9/release/doc/fr_FR.ISO8859-1/relnotes/common/new.sgml stable/9/release/doc/fr_FR.ISO8859-1/relnotes/i386/article.sgml Directory Properties: stable/9/release/ (props changed) stable/9/release/doc/en_US.ISO8859-1/hardware/ (props changed) Modified: stable/9/release/doc/de_DE.ISO8859-1/early-adopter/article.sgml ============================================================================== --- stable/9/release/doc/de_DE.ISO8859-1/early-adopter/article.sgml Tue Sep 18 13:33:39 2012 (r240650) +++ stable/9/release/doc/de_DE.ISO8859-1/early-adopter/article.sgml Tue Sep 18 13:54:48 2012 (r240651) @@ -1,3 +1,14 @@ + + +%entities; + +%release; + +X"> +X"> +]> + - -%man; - - -%freebsd; - - -%authors; - - -%teams; - - -%mailing-lists; - - -%release; - -X"> -X"> - -]> -
Hinweise für die ersten Anwender von &os; Modified: stable/9/release/doc/de_DE.ISO8859-1/errata/article.sgml ============================================================================== --- stable/9/release/doc/de_DE.ISO8859-1/errata/article.sgml Tue Sep 18 13:33:39 2012 (r240650) +++ stable/9/release/doc/de_DE.ISO8859-1/errata/article.sgml Tue Sep 18 13:54:48 2012 (r240651) @@ -1,3 +1,11 @@ +<?xml version="1.0" encoding="iso-8859-1" standalone="no"?> +<!DOCTYPE article PUBLIC "-//FreeBSD//DTD DocBook XML V4.2-Based Extension//EN" [ +<!ENTITY % entities PUBLIC "-//FreeBSD//ENTITIES DocBook FreeBSD Entity Set//DE"> +%entities; +<!ENTITY % release PUBLIC "-//FreeBSD//ENTITIES Release Specification//EN"> +%release; +]> + <!-- FreeBSD errata document. Unlike some of the other RELNOTESng files, this file should remain as a single SGML file, so that @@ -12,19 +20,6 @@ basiert auf: 1.38 --> -<!DOCTYPE ARTICLE PUBLIC "-//FreeBSD//DTD DocBook V4.1-Based Extension//EN" [ -<!ENTITY % man PUBLIC "-//FreeBSD//ENTITIES DocBook Manual Page Entities//EN"> -%man; -<!ENTITY % authors PUBLIC "-//FreeBSD//ENTITIES DocBook Author Entities//EN"> -%authors; -<!ENTITY % translators PUBLIC "-//FreeBSD//ENTITIES DocBook Translator Entities//DE"> -%translators; -<!ENTITY % mlists PUBLIC "-//FreeBSD//ENTITIES DocBook Mailing List Entities//DE"> -%mlists; -<!ENTITY % release PUBLIC "-//FreeBSD//ENTITIES Release Specification//EN"> -%release; -]> - <article lang="de"> <articleinfo> Modified: stable/9/release/doc/de_DE.ISO8859-1/hardware/alpha/article.sgml ============================================================================== --- stable/9/release/doc/de_DE.ISO8859-1/hardware/alpha/article.sgml Tue Sep 18 13:33:39 2012 (r240650) +++ stable/9/release/doc/de_DE.ISO8859-1/hardware/alpha/article.sgml Tue Sep 18 13:54:48 2012 (r240651) @@ -1,29 +1,23 @@ -<!-- - $FreeBSD$ - $FreeBSDde: de-docproj/relnotes/de_DE.ISO8859-1/hardware/alpha/article.sgml,v 1.5 2002/10/12 18:02:21 ue Exp $ - basiert auf: 1.4 ---> - -<!DOCTYPE article PUBLIC "-//FreeBSD//DTD DocBook V4.1-Based Extension//EN" [ -<!ENTITY % man PUBLIC "-//FreeBSD//ENTITIES DocBook Manual Page Entities//EN"> -%man; -<!ENTITY % authors PUBLIC "-//FreeBSD//ENTITIES DocBook Author Entities//EN"> -%authors; -<!ENTITY % translators PUBLIC "-//FreeBSD//ENTITIES DocBook Translator Entities//DE"> -%translators; -<!ENTITY % mlists PUBLIC "-//FreeBSD//ENTITIES DocBook Mailing List Entities//DE"> -%mlists; +<?xml version="1.0" encoding="iso-8859-1" standalone="no"?> +<!DOCTYPE article PUBLIC "-//FreeBSD//DTD DocBook XML V4.2-Based Extension//EN" [ +<!ENTITY % entities PUBLIC "-//FreeBSD//ENTITIES DocBook FreeBSD Entity Set//DE"> +%entities; <!ENTITY % release PUBLIC "-//FreeBSD//ENTITIES Release Specification//EN"> %release; -<!ENTITY % sections SYSTEM "../common/hw.ent"> %sections; +<!ENTITY % sections SYSTEM "../common/hw.ent"> %sections <!-- Architecture-specific customization --> <!ENTITY arch "alpha"> <!ENTITY arch.print "Alpha/AXP"> - ]> +<!-- + $FreeBSD$ + $FreeBSDde: de-docproj/relnotes/de_DE.ISO8859-1/hardware/alpha/article.sgml,v 1.5 2002/10/12 18:02:21 ue Exp $ + basiert auf: 1.4 +--> + <article lang="de"> &artheader; §.intro; Modified: stable/9/release/doc/de_DE.ISO8859-1/hardware/i386/article.sgml ============================================================================== --- stable/9/release/doc/de_DE.ISO8859-1/hardware/i386/article.sgml Tue Sep 18 13:33:39 2012 (r240650) +++ stable/9/release/doc/de_DE.ISO8859-1/hardware/i386/article.sgml Tue Sep 18 13:54:48 2012 (r240651) @@ -1,27 +1,23 @@ -<!-- - $FreeBSD$ - $FreeBSDde: de-docproj/relnotes/de_DE.ISO8859-1/hardware/i386/article.sgml,v 1.5 2002/12/07 21:09:09 ue Exp $ - basiert auf: 1.4 ---> - -<!DOCTYPE article PUBLIC "-//FreeBSD//DTD DocBook V4.1-Based Extension//EN" [ -<!ENTITY % man PUBLIC "-//FreeBSD//ENTITIES DocBook Manual Page Entities//EN"> -%man; -<!ENTITY % authors PUBLIC "-//FreeBSD//ENTITIES DocBook Author Entities//EN"> -%authors; -<!ENTITY % mlists PUBLIC "-//FreeBSD//ENTITIES DocBook Mailing List Entities//DE"> -%mlists; +<?xml version="1.0" encoding="iso-8859-1" standalone="no"?> +<!DOCTYPE article PUBLIC "-//FreeBSD//DTD DocBook XML V4.2-Based Extension//EN" [ +<!ENTITY % entities PUBLIC "-//FreeBSD//ENTITIES DocBook FreeBSD Entity Set//DE"> +%entities; <!ENTITY % release PUBLIC "-//FreeBSD//ENTITIES Release Specification//EN"> %release; -<!ENTITY % sections SYSTEM "../common/hw.ent"> %sections; +<!ENTITY % sections SYSTEM "../common/hw.ent"> %sections <!-- Architecture-specific customization --> <!ENTITY arch "i386"> <!ENTITY arch.print "i386"> - ]> +<!-- + $FreeBSD$ + $FreeBSDde: de-docproj/relnotes/de_DE.ISO8859-1/hardware/i386/article.sgml,v 1.5 2002/12/07 21:09:09 ue Exp $ + basiert auf: 1.4 +--> + <article lang="de"> &artheader; §.intro; Modified: stable/9/release/doc/de_DE.ISO8859-1/hardware/ia64/article.sgml ============================================================================== --- stable/9/release/doc/de_DE.ISO8859-1/hardware/ia64/article.sgml Tue Sep 18 13:33:39 2012 (r240650) +++ stable/9/release/doc/de_DE.ISO8859-1/hardware/ia64/article.sgml Tue Sep 18 13:54:48 2012 (r240651) @@ -1,27 +1,23 @@ -<!-- - $FreeBSD$ - $FreeBSDde: de-docproj/relnotes/de_DE.ISO8859-1/hardware/ia64/article.sgml,v 1.6 2003/05/24 21:52:46 ue Exp $ - basiert auf: 1.3 ---> - -<!DOCTYPE article PUBLIC "-//FreeBSD//DTD DocBook V4.1-Based Extension//EN" [ -<!ENTITY % man PUBLIC "-//FreeBSD//ENTITIES DocBook Manual Page Entities//EN"> -%man; -<!ENTITY % authors PUBLIC "-//FreeBSD//ENTITIES DocBook Author Entities//EN"> -%authors; -<!ENTITY % mlists PUBLIC "-//FreeBSD//ENTITIES DocBook Mailing List Entities//DE"> -%mlists; +<?xml version="1.0" encoding="iso-8859-1" standalone="no"?> +<!DOCTYPE article PUBLIC "-//FreeBSD//DTD DocBook XML V4.2-Based Extension//EN" [ +<!ENTITY % entities PUBLIC "-//FreeBSD//ENTITIES DocBook FreeBSD Entity Set//DE"> +%entities; <!ENTITY % release PUBLIC "-//FreeBSD//ENTITIES Release Specification//EN"> %release; -<!ENTITY % sections SYSTEM "../common/hw.ent"> %sections; +<!ENTITY % sections SYSTEM "../common/hw.ent"> %sections <!-- Architecture-specific customization --> <!ENTITY arch "ia64"> <!ENTITY arch.print "IA-64"> - ]> +<!-- + $FreeBSD$ + $FreeBSDde: de-docproj/relnotes/de_DE.ISO8859-1/hardware/ia64/article.sgml,v 1.6 2003/05/24 21:52:46 ue Exp $ + basiert auf: 1.3 +--> + <article lang="de"> &artheader; Modified: stable/9/release/doc/de_DE.ISO8859-1/hardware/pc98/article.sgml ============================================================================== --- stable/9/release/doc/de_DE.ISO8859-1/hardware/pc98/article.sgml Tue Sep 18 13:33:39 2012 (r240650) +++ stable/9/release/doc/de_DE.ISO8859-1/hardware/pc98/article.sgml Tue Sep 18 13:54:48 2012 (r240651) @@ -1,27 +1,23 @@ -<!-- - $FreeBSD$ - $FreeBSDde: de-docproj/relnotes/de_DE.ISO8859-1/hardware/pc98/article.sgml,v 1.2 2002/10/12 18:02:22 ue Exp $ - basiert auf: 1.1 ---> - -<!DOCTYPE article PUBLIC "-//FreeBSD//DTD DocBook V4.1-Based Extension//EN" [ -<!ENTITY % man PUBLIC "-//FreeBSD//ENTITIES DocBook Manual Page Entities//EN"> -%man; -<!ENTITY % authors PUBLIC "-//FreeBSD//ENTITIES DocBook Author Entities//EN"> -%authors; -<!ENTITY % mlists PUBLIC "-//FreeBSD//ENTITIES DocBook Mailing List Entities//DE"> -%mlists; +<?xml version="1.0" encoding="iso-8859-1" standalone="no"?> +<!DOCTYPE article PUBLIC "-//FreeBSD//DTD DocBook XML V4.2-Based Extension//EN" [ +<!ENTITY % entities PUBLIC "-//FreeBSD//ENTITIES DocBook FreeBSD Entity Set//DE"> +%entities; <!ENTITY % release PUBLIC "-//FreeBSD//ENTITIES Release Specification//EN"> %release; -<!ENTITY % sections SYSTEM "../common/hw.ent"> %sections; +<!ENTITY % sections SYSTEM "../common/hw.ent"> %sections <!-- Architecture-specific customization --> <!ENTITY arch "pc98"> <!ENTITY arch.print "NEC PC-98x1"> - ]> +<!-- + $FreeBSD$ + $FreeBSDde: de-docproj/relnotes/de_DE.ISO8859-1/hardware/pc98/article.sgml,v 1.2 2002/10/12 18:02:22 ue Exp $ + basiert auf: 1.1 +--> + <article lang="de"> &artheader; §.intro; Modified: stable/9/release/doc/de_DE.ISO8859-1/hardware/sparc64/article.sgml ============================================================================== --- stable/9/release/doc/de_DE.ISO8859-1/hardware/sparc64/article.sgml Tue Sep 18 13:33:39 2012 (r240650) +++ stable/9/release/doc/de_DE.ISO8859-1/hardware/sparc64/article.sgml Tue Sep 18 13:54:48 2012 (r240651) @@ -1,19 +1,10 @@ -<!-- - $FreeBSD$ - $FreeBSDde: de-docproj/relnotes/de_DE.ISO8859-1/hardware/sparc64/article.sgml,v 1.7 2003/01/09 12:46:28 ue Exp $ - basiert auf: 1.3 ---> - -<!DOCTYPE article PUBLIC "-//FreeBSD//DTD DocBook V4.1-Based Extension//EN" [ -<!ENTITY % man PUBLIC "-//FreeBSD//ENTITIES DocBook Manual Page Entities//EN"> -%man; -<!ENTITY % authors PUBLIC "-//FreeBSD//ENTITIES DocBook Author Entities//EN"> -%authors; -<!ENTITY % mlists PUBLIC "-//FreeBSD//ENTITIES DocBook Mailing List Entities//DE"> -%mlists; +<?xml version="1.0" encoding="iso-8859-1" standalone="no"?> +<!DOCTYPE article PUBLIC "-//FreeBSD//DTD DocBook XML V4.2-Based Extension//EN" [ +<!ENTITY % entities PUBLIC "-//FreeBSD//ENTITIES DocBook FreeBSD Entity Set//DE"> +%entities; <!ENTITY % release PUBLIC "-//FreeBSD//ENTITIES Release Specification//EN"> %release; -<!ENTITY % sections SYSTEM "../common/hw.ent"> %sections; +<!ENTITY % sections SYSTEM "../common/hw.ent"> %sections <!-- Architecture-specific customization --> @@ -21,6 +12,12 @@ <!ENTITY arch.print "UltraSPARC"> ]> +<!-- + $FreeBSD$ + $FreeBSDde: de-docproj/relnotes/de_DE.ISO8859-1/hardware/sparc64/article.sgml,v 1.7 2003/01/09 12:46:28 ue Exp $ + basiert auf: 1.3 +--> + <article lang="de"> &artheader; §.intro; Modified: stable/9/release/doc/de_DE.ISO8859-1/installation/alpha/article.sgml ============================================================================== --- stable/9/release/doc/de_DE.ISO8859-1/installation/alpha/article.sgml Tue Sep 18 13:33:39 2012 (r240650) +++ stable/9/release/doc/de_DE.ISO8859-1/installation/alpha/article.sgml Tue Sep 18 13:54:48 2012 (r240651) @@ -1,16 +1,7 @@ -<!-- - $FreeBSD$ - $FreeBSDde: de-docproj/relnotes/de_DE.ISO8859-1/installation/alpha/article.sgml,v 1.4 2002/10/12 18:02:23 ue Exp $ - basiert auf: 1.3 ---> - -<!DOCTYPE article PUBLIC "-//FreeBSD//DTD DocBook V4.1-Based Extension//EN" [ -<!ENTITY % man PUBLIC "-//FreeBSD//ENTITIES DocBook Manual Page Entities//EN"> -%man; -<!ENTITY % authors PUBLIC "-//FreeBSD//ENTITIES DocBook Author Entities//EN"> -%authors; -<!ENTITY % mlists PUBLIC "-//FreeBSD//ENTITIES DocBook Mailing List Entities//DE"> -%mlists; +<?xml version="1.0" encoding="iso-8859-1" standalone="no"?> +<!DOCTYPE article PUBLIC "-//FreeBSD//DTD DocBook XML V4.2-Based Extension//EN" [ +<!ENTITY % entities PUBLIC "-//FreeBSD//ENTITIES DocBook FreeBSD Entity Set//DE"> +%entities; <!ENTITY % release PUBLIC "-//FreeBSD//ENTITIES Release Specification//EN"> %release; <!ENTITY % sections SYSTEM "../common/install.ent"> %sections; @@ -21,6 +12,12 @@ <!ENTITY arch.print "Alpha/AXP"> ]> +<!-- + $FreeBSD$ + $FreeBSDde: de-docproj/relnotes/de_DE.ISO8859-1/installation/alpha/article.sgml,v 1.4 2002/10/12 18:02:23 ue Exp $ + basiert auf: 1.3 +--> + <article lang="de"> &artheader; &abstract; Modified: stable/9/release/doc/de_DE.ISO8859-1/installation/common/install.sgml ============================================================================== --- stable/9/release/doc/de_DE.ISO8859-1/installation/common/install.sgml Tue Sep 18 13:33:39 2012 (r240650) +++ stable/9/release/doc/de_DE.ISO8859-1/installation/common/install.sgml Tue Sep 18 13:54:48 2012 (r240651) @@ -26,7 +26,7 @@ from {alpha,i386}/INSTALL.TXT. ausführlichen, bebilderten Installationsleitung.</para> <para>Wenn Sie eine ältere Version von &os; aktualisieren - wollen, sollten Sie <xref linkend="upgrading">, Aktualisierung von + wollen, sollten Sie <xref linkend="upgrading"/>, Aktualisierung von FreeBSD, lesen.</para> <sect2 id="getting-started"> @@ -60,7 +60,7 @@ from {alpha,i386}/INSTALL.TXT. <para>Irgend etwas kann immer schiefgehen und wenn Ihnen das passiert, sollten Sie einen Blick in <xref - linkend="trouble"> werfen, wo Sie hilfreiche Informationen + linkend="trouble"/> werfen, wo Sie hilfreiche Informationen finden können. Sie sollten ebenfalls einen Blick auf die aktuelle Version von <filename>ERRATA.TXT</filename> werfen, bevor Sie mit der Installation beginnen, da Sie dort @@ -76,6 +76,7 @@ from {alpha,i386}/INSTALL.TXT. Backup haben, bevor Sie die Installation durchführen.</para> </important> + </sect2> <sect2> <title>Hardware-Anforderungen @@ -286,7 +287,7 @@ from {alpha,i386}/INSTALL.TXT. benutzen, können Sie das Script makeflp.bat verwenden. Weitere Informationen zu diesem Thema finden Sie im Kapitel . Danach müssen Sie nur noch von + linkend="floppies"/>. Danach müssen Sie nur noch von der ersten Diskette booten, um die &os;-Installation zu starten. @@ -306,7 +307,7 @@ from {alpha,i386}/INSTALL.TXT. benutzen, können Sie das Script makeflp.bat verwenden. Weitere Informationen zu diesem Thema finden Sie im Kapitel . Danach müssen Sie nur noch von + linkend="floppies"/>. Danach müssen Sie nur noch von der ersten Diskette booten, um die &os;-Installation zu starten. @@ -320,12 +321,12 @@ from {alpha,i386}/INSTALL.TXT. müssen Sie ebenfalls die beiden &os; Bootdisketten aus den Dateien floppies/kern.flp und floppies/mfsroot.flp erzeugen, wie in - beschrieben. Booten Sie Ihren + beschrieben. Booten Sie Ihren Rechner von der Diskette mit kern.flp; und legen Sie die Diskette mit mfsroot.flp ein, sobald Sie dazu aufgefordert werden. Weitere Informationen zu dieser Art der Installation finden Sie in . + linkend="ftpnfs"/>. Wenn Ihr Rechner kein CDROM Laufwerk hat, können Sie &os; auch direkt über das Internet @@ -334,12 +335,12 @@ from {alpha,i386}/INSTALL.TXT. Bootdisketten aus den Dateien floppies/kern.flp und floppies/mfsroot.flp erzeugen, wie in beschrieben. Booten Sie Ihren Rechner von + linkend="floppies"/> beschrieben. Booten Sie Ihren Rechner von der Diskette mit kern.flp; und legen Sie die Diskette mit mfsroot.flp ein, sobald Sie dazu aufgefordert werden. Weitere Informationen zu dieser Art der Installation finden Sie in . + linkend="ftpnfs"/>. @@ -358,7 +359,7 @@ from {alpha,i386}/INSTALL.TXT. Bootdisketten aus den Dateien floppies/kern.flp und floppies/mfsroot.flp erzeugen, wie in - beschrieben. Legen Sie die + beschrieben. Legen Sie die Diskette mit dem Inhalt von kern.flp ein und geben Sie an der Eingabeaufforderung des SRM (>>>) den folgenden Befehl ein, um @@ -400,8 +401,8 @@ Ethernet address 0:3:ba:b:92:d4, Host ID - - + + ok @@ -506,7 +507,7 @@ pqb0.0.1.4.0 PQB0 Wenn Sie von einem lokalen CDROM installieren wollen, sollten Sie nicht dieses Kapitel lesen, sondern - . Wenn in Ihrem System + . Wenn in Ihrem System kein CDROM vorhanden ist und Sie eine &os; CD benutzen wollen, die in einem CDROM Laufwerk eines anderen Systems liegt und Sie dieses System über ein Netzwerk erreichen @@ -580,10 +581,10 @@ pqb0.0.1.4.0 PQB0 Installation vorbereiten. Der erste Schritt ist die Erstellung der Bootdisketten, - wie in beschrieben. + wie in beschrieben. Der zweite Schritt ist, einen Blick in zu werfen. Das Kapitel Distribution + linkend="layout"/> zu werfen. Das Kapitel Distribution Format ist besonders wichtig, da Sie hier erfahren, welche Dateien Sie auf Diskette übertragen müssen und welche Sie ignorieren können. @@ -733,14 +734,14 @@ pqb0.0.1.4.0 PQB0 Der letzte Schritt ist die Erzeugung der Bootdisketten, - siehe . + siehe . Netzwerk-Installation mit FTP oder NFS Wenn Sie die Bootdisketten erzeugt haben, wie in beschrieben, können Sie die restliche + linkend="floppies"/> beschrieben, können Sie die restliche Installation über eine Netzwerk-Verbindung durchführen, wobei drei Arten von Netzwerkverbindungen unterstützt werden: seriell, parallel, oder @@ -981,7 +982,7 @@ pqb0.0.1.4.0 PQB0 Wenn Sie keine Meldungen auf Ihrer seriellen Konsole sehen, müssen Sie die Tastatur wieder einstecken und auf ein Tonsignal warten. Wenn Sie von CD booten, machen - Sie bei weiter, wenn Sie das + Sie bei weiter, wenn Sie das Tonsignal hören.. Modified: stable/9/release/doc/de_DE.ISO8859-1/installation/common/layout.sgml ============================================================================== --- stable/9/release/doc/de_DE.ISO8859-1/installation/common/layout.sgml Tue Sep 18 13:33:39 2012 (r240650) +++ stable/9/release/doc/de_DE.ISO8859-1/installation/common/layout.sgml Tue Sep 18 13:54:48 2012 (r240651) @@ -23,7 +23,7 @@ README.HTM cdrom.inf crypto Wenn Sie dieses Verzeichnis für eine CD-, FTP- oder NFS-Installation nutzen wollen, brauchen Sie nur die beiden 1.44 MByte großen Bootdisketten zu erstellen (wie das geht, ist - in beschrieben), von diesen zu booten, + in beschrieben), von diesen zu booten, und dann den Anweisungen zu folgen. Alle anderen Dateien, die für die Installation notwendig sind, werden auf der Grundlage Ihrer Angaben automatisch geholt. Wenn Sie &os; noch nie @@ -86,7 +86,7 @@ README.HTM cdrom.inf crypto Das Verzeichnis floppies/ enthält die Images der Bootdisketten. Informationen, wie man diese Images benutzt, finden Sie in . + linkend="floppies"/>. Modified: stable/9/release/doc/de_DE.ISO8859-1/installation/i386/article.sgml ============================================================================== --- stable/9/release/doc/de_DE.ISO8859-1/installation/i386/article.sgml Tue Sep 18 13:33:39 2012 (r240650) +++ stable/9/release/doc/de_DE.ISO8859-1/installation/i386/article.sgml Tue Sep 18 13:54:48 2012 (r240651) @@ -1,16 +1,7 @@ - - - -%man; - -%authors; - -%mlists; + + +%entities; %release; %sections; @@ -19,9 +10,14 @@ - ]> + +
&artheader; &abstract; Modified: stable/9/release/doc/de_DE.ISO8859-1/installation/ia64/article.sgml ============================================================================== --- stable/9/release/doc/de_DE.ISO8859-1/installation/ia64/article.sgml Tue Sep 18 13:33:39 2012 (r240650) +++ stable/9/release/doc/de_DE.ISO8859-1/installation/ia64/article.sgml Tue Sep 18 13:54:48 2012 (r240651) @@ -1,17 +1,7 @@ - - - - -%man; - -%authors; - -%mlists; + + +%entities; %release; %sections; @@ -20,9 +10,14 @@ - ]> + +
&artheader; &abstract; Modified: stable/9/release/doc/de_DE.ISO8859-1/installation/pc98/article.sgml ============================================================================== --- stable/9/release/doc/de_DE.ISO8859-1/installation/pc98/article.sgml Tue Sep 18 13:33:39 2012 (r240650) +++ stable/9/release/doc/de_DE.ISO8859-1/installation/pc98/article.sgml Tue Sep 18 13:54:48 2012 (r240651) @@ -1,16 +1,7 @@ - - - -%man; - -%authors; - -%mlists; + + +%entities; %release; %sections; @@ -19,9 +10,14 @@ - ]> + +
&artheader; &abstract; Modified: stable/9/release/doc/de_DE.ISO8859-1/installation/sparc64/article.sgml ============================================================================== --- stable/9/release/doc/de_DE.ISO8859-1/installation/sparc64/article.sgml Tue Sep 18 13:33:39 2012 (r240650) +++ stable/9/release/doc/de_DE.ISO8859-1/installation/sparc64/article.sgml Tue Sep 18 13:54:48 2012 (r240651) @@ -1,19 +1,8 @@ - - - + +%entities; - - -%man; - -%authors; - -%mlists; %release; %sections; @@ -24,6 +13,12 @@ ]> + +
&artheader; &abstract; Modified: stable/9/release/doc/de_DE.ISO8859-1/readme/article.sgml ============================================================================== --- stable/9/release/doc/de_DE.ISO8859-1/readme/article.sgml Tue Sep 18 13:33:39 2012 (r240650) +++ stable/9/release/doc/de_DE.ISO8859-1/readme/article.sgml Tue Sep 18 13:54:48 2012 (r240651) @@ -1,3 +1,11 @@ + + +%entities; + +%release; +]> + - -%man; - -%authors; - -%mlists; - -%release; - -%misc; -]> -
&os; &release.current; README @@ -229,7 +224,7 @@ wenn Sie an weiteren Informationen zu diesem Thema interessiert sind. Zusätzliche Informationen zu diesem Thema finden Sie im Artikel Mirroring + url="http://www.FreeBSD.org/doc/en_US.ISO8859-1/articles/hubs/">Mirroring FreeBSD. Sie finden die für den Start der Installation Modified: stable/9/release/doc/de_DE.ISO8859-1/relnotes/alpha/article.sgml ============================================================================== --- stable/9/release/doc/de_DE.ISO8859-1/relnotes/alpha/article.sgml Tue Sep 18 13:33:39 2012 (r240650) +++ stable/9/release/doc/de_DE.ISO8859-1/relnotes/alpha/article.sgml Tue Sep 18 13:54:48 2012 (r240651) @@ -1,16 +1,7 @@ - - - -%man; - -%authors; - -%mlists; + + +%entities; %release; %sections; @@ -19,9 +10,14 @@ - ]> + +
&art;
Modified: stable/9/release/doc/de_DE.ISO8859-1/relnotes/i386/article.sgml ============================================================================== --- stable/9/release/doc/de_DE.ISO8859-1/relnotes/i386/article.sgml Tue Sep 18 13:33:39 2012 (r240650) +++ stable/9/release/doc/de_DE.ISO8859-1/relnotes/i386/article.sgml Tue Sep 18 13:54:48 2012 (r240651) @@ -1,16 +1,7 @@ - - - -%man; - -%authors; - -%mlists; + + +%entities; %release; %sections; @@ -19,9 +10,15 @@ - ]> + + +
&art;
Modified: stable/9/release/doc/de_DE.ISO8859-1/relnotes/ia64/article.sgml ============================================================================== --- stable/9/release/doc/de_DE.ISO8859-1/relnotes/ia64/article.sgml Tue Sep 18 13:33:39 2012 (r240650) +++ stable/9/release/doc/de_DE.ISO8859-1/relnotes/ia64/article.sgml Tue Sep 18 13:54:48 2012 (r240651) @@ -1,16 +1,7 @@ - - - -%man; - -%authors; - -%mlists; + + +%entities; %release; %sections; @@ -19,8 +10,12 @@ - ]> +
&art; Modified: stable/9/release/doc/de_DE.ISO8859-1/relnotes/pc98/article.sgml ============================================================================== --- stable/9/release/doc/de_DE.ISO8859-1/relnotes/pc98/article.sgml Tue Sep 18 13:33:39 2012 (r240650) +++ stable/9/release/doc/de_DE.ISO8859-1/relnotes/pc98/article.sgml Tue Sep 18 13:54:48 2012 (r240651) @@ -1,16 +1,7 @@ - - - -%man; - -%authors; - -%mlists; + + +%entities; %release; %sections; @@ -19,9 +10,15 @@ - ]> + + +
&art;
Modified: stable/9/release/doc/de_DE.ISO8859-1/relnotes/sparc64/article.sgml ============================================================================== --- stable/9/release/doc/de_DE.ISO8859-1/relnotes/sparc64/article.sgml Tue Sep 18 13:33:39 2012 (r240650) +++ stable/9/release/doc/de_DE.ISO8859-1/relnotes/sparc64/article.sgml Tue Sep 18 13:54:48 2012 (r240651) @@ -1,19 +1,7 @@ - - - - - -%man; - -%authors; - -%mlists; + + +%entities; %release; %sections; @@ -22,9 +10,14 @@ - ]> + +
&art;
Modified: stable/9/release/doc/en_US.ISO8859-1/errata/article.sgml ============================================================================== --- stable/9/release/doc/en_US.ISO8859-1/errata/article.sgml Tue Sep 18 13:33:39 2012 (r240650) +++ stable/9/release/doc/en_US.ISO8859-1/errata/article.sgml Tue Sep 18 13:54:48 2012 (r240651) @@ -1,3 +1,22 @@ + + +%entities; + + +%release; + + +]]> + +]]> + +]]> +]> + - -%articles.ent; - - -%release; -]> -
- &os; -<![ %release.type.current [ - &release.current; -]]> -<![ %release.type.snapshot [ - &release.prev; -]]> -<![ %release.type.release [ - &release.current; -]]> - Errata + &os; &release; Errata The &os; Project Modified: stable/9/release/doc/en_US.ISO8859-1/hardware/article.sgml ============================================================================== --- stable/9/release/doc/en_US.ISO8859-1/hardware/article.sgml Tue Sep 18 13:33:39 2012 (r240650) +++ stable/9/release/doc/en_US.ISO8859-1/hardware/article.sgml Tue Sep 18 13:54:48 2012 (r240651) @@ -1,14 +1,12 @@ - -%articles.ent; + + +%entities; %release; %devauto; - - - ]>
Modified: stable/9/release/doc/en_US.ISO8859-1/readme/article.sgml ============================================================================== --- stable/9/release/doc/en_US.ISO8859-1/readme/article.sgml Tue Sep 18 13:33:39 2012 (r240650) +++ stable/9/release/doc/en_US.ISO8859-1/readme/article.sgml Tue Sep 18 13:54:48 2012 (r240651) @@ -1,6 +1,7 @@ - -%articles.ent; + + +%entities; %release; @@ -184,7 +185,7 @@ freebsd-admin@FreeBSD.org for more details on becoming an official mirror site. You can also find useful information for mirror sites at the Mirroring + url="&url.articles.hubs;/">Mirroring &os; article. Mirrors generally contain the ISO images generally used to Modified: stable/9/release/doc/en_US.ISO8859-1/relnotes/article.sgml ============================================================================== --- stable/9/release/doc/en_US.ISO8859-1/relnotes/article.sgml Tue Sep 18 13:33:39 2012 (r240650) +++ stable/9/release/doc/en_US.ISO8859-1/relnotes/article.sgml Tue Sep 18 13:54:48 2012 (r240651) @@ -1,6 +1,7 @@ - -%articles.ent; + + +%entities; %release; Modified: stable/9/release/doc/fr_FR.ISO8859-1/early-adopter/article.sgml ============================================================================== --- stable/9/release/doc/fr_FR.ISO8859-1/early-adopter/article.sgml Tue Sep 18 13:33:39 2012 (r240650) +++ stable/9/release/doc/fr_FR.ISO8859-1/early-adopter/article.sgml Tue Sep 18 13:54:48 2012 (r240651) @@ -1,3 +1,14 @@ + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Sep 18 14:05:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 165401065786; Tue, 18 Sep 2012 14:05:36 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DAC3C8FC1C; Tue, 18 Sep 2012 14:05:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8IE5Zn8006867; Tue, 18 Sep 2012 14:05:35 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8IE5Zcb006864; Tue, 18 Sep 2012 14:05:35 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201209181405.q8IE5Zcb006864@svn.freebsd.org> From: Glen Barber Date: Tue, 18 Sep 2012 14:05:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240653 - in stable/9/release/doc: en_US.ISO8859-1/errata en_US.ISO8859-1/relnotes ru_RU.KOI8-R/relnotes/common X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Sep 2012 14:05:36 -0000 Author: gjb (doc,ports committer) Date: Tue Sep 18 14:05:35 2012 New Revision: 240653 URL: http://svn.freebsd.org/changeset/base/240653 Log: Close colspec tags to conform to XML standards. This commit should fix more 9-STABLE release build problems. This is a direct commit to stable/9. Modified: stable/9/release/doc/en_US.ISO8859-1/errata/article.sgml stable/9/release/doc/en_US.ISO8859-1/relnotes/article.sgml stable/9/release/doc/ru_RU.KOI8-R/relnotes/common/new.sgml (contents, props changed) Modified: stable/9/release/doc/en_US.ISO8859-1/errata/article.sgml ============================================================================== --- stable/9/release/doc/en_US.ISO8859-1/errata/article.sgml Tue Sep 18 14:00:11 2012 (r240652) +++ stable/9/release/doc/en_US.ISO8859-1/errata/article.sgml Tue Sep 18 14:05:35 2012 (r240653) @@ -132,9 +132,9 @@ - - - + + + Modified: stable/9/release/doc/en_US.ISO8859-1/relnotes/article.sgml ============================================================================== --- stable/9/release/doc/en_US.ISO8859-1/relnotes/article.sgml Tue Sep 18 14:00:11 2012 (r240652) +++ stable/9/release/doc/en_US.ISO8859-1/relnotes/article.sgml Tue Sep 18 14:05:35 2012 (r240653) @@ -97,9 +97,9 @@ - - - + + + Advisory @@ -295,8 +295,8 @@ - - + + &man.sysctl.8; variable name Modified: stable/9/release/doc/ru_RU.KOI8-R/relnotes/common/new.sgml ============================================================================== Binary file (source and/or target). No diff available. From owner-svn-src-all@FreeBSD.ORG Tue Sep 18 14:09:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA91A1065670; Tue, 18 Sep 2012 14:09:09 +0000 (UTC) (envelope-from tijl@coosemans.org) Received: from mailrelay011.isp.belgacom.be (mailrelay011.isp.belgacom.be [195.238.6.178]) by mx1.freebsd.org (Postfix) with ESMTP id E939B8FC0A; Tue, 18 Sep 2012 14:09:08 +0000 (UTC) X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av8EAAt/WFBbsUA+/2dsb2JhbABFvDuBCYIgAQEEAVYiAQULCxgJFg8JAwIBAgEnHgYNAQUCAQEFh3EKB7o6ixuGcAOOaYEghm6PDYJo Received: from 62.64-177-91.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([91.177.64.62]) by relay.skynet.be with ESMTP; 18 Sep 2012 16:07:58 +0200 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.14.5/8.14.5) with ESMTP id q8IE7vrH002986; Tue, 18 Sep 2012 16:07:57 +0200 (CEST) (envelope-from tijl@coosemans.org) Message-ID: <50588037.6010009@coosemans.org> Date: Tue, 18 Sep 2012 16:07:51 +0200 From: Tijl Coosemans User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:14.0) Gecko/20120804 Thunderbird/14.0 MIME-Version: 1.0 To: Erik Cederstrand References: <201209142347.q8ENlN7N034951@svn.freebsd.org> <5054EBCB.6070105@coosemans.org> <5054F116.8090503@cran.org.uk> <5055E121.2030208@coosemans.org> <950ECA11-BDDF-4805-AB9F-07F233A8429E@cederstrand.dk> In-Reply-To: <950ECA11-BDDF-4805-AB9F-07F233A8429E@cederstrand.dk> X-Enigmail-Version: 1.4.2 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enig009E4C34CAAFB2C1D94D079F" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r240527 - head/bin/df X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Sep 2012 14:09:09 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig009E4C34CAAFB2C1D94D079F Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 16-09-2012 20:57, Erik Cederstrand wrote: > Den 16/09/2012 kl. 18.05 skrev Eitan Adler : >> On 16 September 2012 10:24, Tijl Coosemans wrote:= >>> On 16-09-2012 01:27, Eitan Adler wrote: >>>> On 15 September 2012 17:20, Bruce Cran wrote: >>>>> On 15/09/2012 21:57, Tijl Coosemans wrote: >>>>>> Freeing memory right before exiting is a waste of time. The tool s= houldn't >>>>>> complain about it. >>>> >>>> Perhaps, but tools do. This has already been brought up on cfe-dev. >>> >>> In this case the free is actually wrong, because the pointer can poin= t >>> to memory allocated by getmntinfo(3) and that manpage says an applica= tion >>> cannot free it. >> >> Ah, I missed that. I wish this point was brought up earlier. I'll >> revert the commit >=20 > I was the one who filed the PR > (http://www.freebsd.org/cgi/query-pr.cgi?pr=3D171634). I'm embarrassed > to have caused a wrong commit. >=20 > The big picture is I'm looking through the Clang Analyzer scans at > http://scan.freebsd.your.org/freebsd-head trying to find false > positives to report back to LLVM. Their PR originated in this > warning: > http://scan.freebsd.your.org/freebsd-head/bin.df/2012-09-12-amd64/repor= t-WwB2qk.html#EndPath > The scan has 326 warnings about possible memory leaks in world, so > I'd really like to do something here, be it either via bug report > with LLVM or FreeBSD or to annotate the code to say it's okay to > break the rules. >=20 > There response from LLVM (disregarding that mntbuf can't be freed) is > either that: 1) if main() is redefined as a macro, it's still a leak, If main is renamed using a macro it isn't main anymore and it's ok to complain about leaks. A more valid objection would be that main is still an ordinary function that can be called from other functions, so a memory leak there is potentially just as problematic as in any other function. But that's very theoretical. In practice I think not complaining about leaks in main by default would take out more false positives than create false negatives. > and 2) they can skip the warning only if it's feasible to reason that > prtstat() doesn't allocate memory. I don't understand why this is a requirement. If there's a call to exit(3) instead of a return statement the analyzer already doesn't seem to complain and a return from main() is the same as a call to exit() in practice. > I noticed that the sentence "The memory allocated by getmntinfo() > cannot be free(3)'d by the application." in the getmntinfo(3) manage > is in the bugs section. Does this mean it's something that should be > fixed in FreeBSD eventually? Probably not. The section could be renamed CAVEATS like basename(3). --------------enig009E4C34CAAFB2C1D94D079F Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iF4EAREIAAYFAlBYgDwACgkQfoCS2CCgtitI5gD/bLujB/9Bq+5V8jV33oqIq2i7 MxTEOA0cgFXj2Tvs7/IA/3bIl9H31NooDVuGKHQ5ycHC53Pe+Y+McHTTTat0GtDb =XN7/ -----END PGP SIGNATURE----- --------------enig009E4C34CAAFB2C1D94D079F-- From owner-svn-src-all@FreeBSD.ORG Tue Sep 18 15:38:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 05DE5106564A; Tue, 18 Sep 2012 15:38:43 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E4C808FC14; Tue, 18 Sep 2012 15:38:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8IFcgop018341; Tue, 18 Sep 2012 15:38:42 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8IFcguO018335; Tue, 18 Sep 2012 15:38:42 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201209181538.q8IFcguO018335@svn.freebsd.org> From: Alexander Motin Date: Tue, 18 Sep 2012 15:38:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240655 - head/sys/boot/ofw/libofw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Sep 2012 15:38:43 -0000 Author: mav Date: Tue Sep 18 15:38:42 2012 New Revision: 240655 URL: http://svn.freebsd.org/changeset/base/240655 Log: Fix panics on attempt to dereference uninitizlized pointer, returned via 'path' argument of ofw_parsedev() if devspec refers raw device with no path. For example, `ls /pci@1f,0/ide@d/disk@0,0:a/` works fine, while `ls /pci@1f,0/ide@d/disk@0,0:a` panicked before this change. Modified: head/sys/boot/ofw/libofw/devicename.c Modified: head/sys/boot/ofw/libofw/devicename.c ============================================================================== --- head/sys/boot/ofw/libofw/devicename.c Tue Sep 18 14:33:27 2012 (r240654) +++ head/sys/boot/ofw/libofw/devicename.c Tue Sep 18 15:38:42 2012 (r240655) @@ -105,7 +105,7 @@ ofw_parsedev(struct ofw_devdesc **dev, c return(ENOENT); found: - if (path != NULL && *s != '\0') + if (path != NULL) *path = s; idev = malloc(sizeof(struct ofw_devdesc)); if (idev == NULL) { From owner-svn-src-all@FreeBSD.ORG Tue Sep 18 16:00:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C33F1106564A; Tue, 18 Sep 2012 16:00:44 +0000 (UTC) (envelope-from bjk@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 95D128FC15; Tue, 18 Sep 2012 16:00:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8IG0ile021119; Tue, 18 Sep 2012 16:00:44 GMT (envelope-from bjk@svn.freebsd.org) Received: (from bjk@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8IG0iY4021117; Tue, 18 Sep 2012 16:00:44 GMT (envelope-from bjk@svn.freebsd.org) Message-Id: <201209181600.q8IG0iY4021117@svn.freebsd.org> From: Benjamin Kaduk Date: Tue, 18 Sep 2012 16:00:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240656 - head/sbin/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Sep 2012 16:00:44 -0000 Author: bjk (doc committer) Date: Tue Sep 18 16:00:44 2012 New Revision: 240656 URL: http://svn.freebsd.org/changeset/base/240656 Log: Fix grammar in the portion about FIBs. Also, cross-reference setfib(2) instead of setfib(1) for the 16-FIB limit. PR: docs/157452 Approved by: hrs (mentor) Modified: head/sbin/ipfw/ipfw.8 Modified: head/sbin/ipfw/ipfw.8 ============================================================================== --- head/sbin/ipfw/ipfw.8 Tue Sep 18 15:38:42 2012 (r240655) +++ head/sbin/ipfw/ipfw.8 Tue Sep 18 16:00:44 2012 (r240656) @@ -957,25 +957,27 @@ actions. The packet is tagged so as to use the FIB (routing table) .Ar fibnum in any subsequent forwarding decisions. -Initially this is limited to the values 0 through 15, see -.Xr setfib 1 . +In the current implementation, this is limited to the values 0 through 15, see +.Xr setfib 2 . Processing continues at the next rule. It is possible to use the .Cm tablearg -keyword with a setfib. -If tablearg value is not within compiled FIB range packet fib is set to 0. +keyword with setfib. +If the tablearg value is not within the compiled range of fibs, +the packet's fib is set to 0. .It Cm reass -Queue and reassemble ip fragments. +Queue and reassemble IP fragments. If the packet is not fragmented, counters are updated and processing continues with the next rule. If the packet is the last logical fragment, the packet is reassembled and, if .Va net.inet.ip.fw.one_pass -is set to 0, processing continues with the next rule, else packet is -allowed to pass and search terminates. -If the packet is a fragment in the middle, it is consumed and +is set to 0, processing continues with the next rule. +Otherwise, the packet is allowed to pass and the search terminates. +If the packet is a fragment in the middle of a logical group of fragments, +it is consumed and processing stops immediately. .Pp -Fragments handling can be tuned via +Fragment handling can be tuned via .Va net.inet.ip.maxfragpackets and .Va net.inet.ip.maxfragsperpacket From owner-svn-src-all@FreeBSD.ORG Tue Sep 18 16:01:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 689FF10656F0; Tue, 18 Sep 2012 16:01:26 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 49ED48FC19; Tue, 18 Sep 2012 16:01:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8IG1QeT021237; Tue, 18 Sep 2012 16:01:26 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8IG1QLA021234; Tue, 18 Sep 2012 16:01:26 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201209181601.q8IG1QLA021234@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 18 Sep 2012 16:01:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240657 - in stable/9/sys/dev/usb: . wlan X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Sep 2012 16:01:26 -0000 Author: hselasky Date: Tue Sep 18 16:01:25 2012 New Revision: 240657 URL: http://svn.freebsd.org/changeset/base/240657 Log: MFC r238274 and r239358 Add new USB device ID's. Modified: stable/9/sys/dev/usb/usbdevs stable/9/sys/dev/usb/wlan/if_run.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/usbdevs ============================================================================== --- stable/9/sys/dev/usb/usbdevs Tue Sep 18 16:00:44 2012 (r240656) +++ stable/9/sys/dev/usb/usbdevs Tue Sep 18 16:01:25 2012 (r240657) @@ -1077,6 +1077,7 @@ product ASUS A730W 0x4202 ASUS MyPal A7 product ASUS P535 0x420f ASUS P535 PDA product ASUS GMSC 0x422f ASUS Generic Mass Storage product ASUS RT2570 0x1706 RT2500USB Wireless Adapter +product ASUS USB_N53 0x179d ASUS Black Diamond Dual Band USB-N53 /* ATen products */ product ATEN UC1284 0x2001 Parallel printer @@ -2147,6 +2148,7 @@ product LOGITEC RT2870_1 0x0162 RT2870 product LOGITEC RT2870_2 0x0163 RT2870 product LOGITEC RT2870_3 0x0164 RT2870 product LOGITEC LANW300NU2 0x0166 LAN-W300N/U2 +product LOGITEC LANW150NU2 0x0168 LAN-W150N/U2 /* Longcheer Holdings, Ltd. products */ product LONGCHEER WM66 0x6061 Longcheer WM66 HSDPA @@ -2211,7 +2213,8 @@ product MELCO RT2870_1 0x0148 RT2870 product MELCO RT2870_2 0x0150 RT2870 product MELCO WLIUCGN 0x015d WLI-UC-GN product MELCO WLIUCG301N 0x016f WLI-UC-G301N -product MELCO WLIUCGNM 0x01a2 WLI-UC-GNM +product MELCO WLIUCGNM 0x01a2 WLI-UC-GNM +product MELCO WLIUCGNM2 0x01ee WLI-UC-GNM2 /* Merlin products */ product MERLIN V620 0x1110 Merlin V620 @@ -2629,6 +2632,7 @@ product PLANEX2 GWUS54GD 0xed01 GW-US54G product PLANEX2 GWUSMM 0xed02 GW-USMM product PLANEX2 RT2870 0xed06 RT2870 product PLANEX2 GWUSMICRON 0xed14 GW-USMicroN +product PLANEX2 GWUSVALUEEZ 0xed17 GW-USValue-EZ product PLANEX3 GWUS54GZ 0xab10 GW-US54GZ product PLANEX3 GU1000T 0xab11 GU-1000T product PLANEX3 GWUS54MINI 0xab13 GW-US54Mini Modified: stable/9/sys/dev/usb/wlan/if_run.c ============================================================================== --- stable/9/sys/dev/usb/wlan/if_run.c Tue Sep 18 16:00:44 2012 (r240656) +++ stable/9/sys/dev/usb/wlan/if_run.c Tue Sep 18 16:01:25 2012 (r240657) @@ -136,6 +136,7 @@ static const STRUCT_USB_HOST_ID run_devs RUN_DEV(ASUS, RT2870_5), RUN_DEV(ASUS, USBN13), RUN_DEV(ASUS, RT3070_1), + RUN_DEV(ASUS, USB_N53), RUN_DEV(ASUS2, USBN11), RUN_DEV(AZUREWAVE, RT2870_1), RUN_DEV(AZUREWAVE, RT2870_2), @@ -209,6 +210,7 @@ static const STRUCT_USB_HOST_ID run_devs RUN_DEV(LOGITEC, RT2870_2), RUN_DEV(LOGITEC, RT2870_3), RUN_DEV(LOGITEC, LANW300NU2), + RUN_DEV(LOGITEC, LANW150NU2), RUN_DEV(MELCO, RT2870_1), RUN_DEV(MELCO, RT2870_2), RUN_DEV(MELCO, WLIUCAG300N), @@ -216,6 +218,7 @@ static const STRUCT_USB_HOST_ID run_devs RUN_DEV(MELCO, WLIUCG301N), RUN_DEV(MELCO, WLIUCGN), RUN_DEV(MELCO, WLIUCGNM), + RUN_DEV(MELCO, WLIUCGNM2), RUN_DEV(MOTOROLA4, RT2770), RUN_DEV(MOTOROLA4, RT3070), RUN_DEV(MSI, RT3070_1), From owner-svn-src-all@FreeBSD.ORG Tue Sep 18 16:28:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B7DB1106566C; Tue, 18 Sep 2012 16:28:50 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9F6CC8FC16; Tue, 18 Sep 2012 16:28:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8IGSoZF024644; Tue, 18 Sep 2012 16:28:50 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8IGSoOF024628; Tue, 18 Sep 2012 16:28:50 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201209181628.q8IGSoOF024628@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 18 Sep 2012 16:28:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240659 - in stable/9/sys: dev/usb/net dev/usb/serial kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Sep 2012 16:28:50 -0000 Author: hselasky Date: Tue Sep 18 16:28:49 2012 New Revision: 240659 URL: http://svn.freebsd.org/changeset/base/240659 Log: MFC r239178, r239179, r239180, r239181, r239182 and r239299: Fix detach of USB serial devices so that it doesn't block the USB explore thread forever. To accomplish this two new functions have been added to the kernel, to claim and free the newbus allocated softc. This change is backwards API compatible, but not binary compatible. The FreeBSD version has been bumped to force a recompile of all kernel modules. Discussed with: kib, ed, jhb Modified: stable/9/sys/dev/usb/net/if_usie.c stable/9/sys/dev/usb/net/uhso.c stable/9/sys/dev/usb/serial/u3g.c stable/9/sys/dev/usb/serial/uark.c stable/9/sys/dev/usb/serial/ubsa.c stable/9/sys/dev/usb/serial/ubser.c stable/9/sys/dev/usb/serial/uchcom.c stable/9/sys/dev/usb/serial/ucycom.c stable/9/sys/dev/usb/serial/ufoma.c stable/9/sys/dev/usb/serial/uftdi.c stable/9/sys/dev/usb/serial/ugensa.c stable/9/sys/dev/usb/serial/uipaq.c stable/9/sys/dev/usb/serial/ulpt.c stable/9/sys/dev/usb/serial/umcs.c stable/9/sys/dev/usb/serial/umct.c stable/9/sys/dev/usb/serial/umodem.c stable/9/sys/dev/usb/serial/umoscom.c stable/9/sys/dev/usb/serial/uplcom.c stable/9/sys/dev/usb/serial/usb_serial.c stable/9/sys/dev/usb/serial/usb_serial.h stable/9/sys/dev/usb/serial/uslcom.c stable/9/sys/dev/usb/serial/uvisor.c stable/9/sys/dev/usb/serial/uvscom.c stable/9/sys/kern/subr_bus.c stable/9/sys/sys/bus.h stable/9/sys/sys/param.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/net/if_usie.c ============================================================================== --- stable/9/sys/dev/usb/net/if_usie.c Tue Sep 18 16:23:23 2012 (r240658) +++ stable/9/sys/dev/usb/net/if_usie.c Tue Sep 18 16:28:49 2012 (r240659) @@ -95,7 +95,9 @@ static const STRUCT_USB_HOST_ID usie_dev static device_probe_t usie_probe; static device_attach_t usie_attach; static device_detach_t usie_detach; +static void usie_free_softc(struct usie_softc *); +static void usie_free(struct ucom_softc *); static void usie_uc_update_line_state(struct ucom_softc *, uint8_t); static void usie_uc_cfg_get_status(struct ucom_softc *, uint8_t *, uint8_t *); static void usie_uc_cfg_set_dtr(struct ucom_softc *, uint8_t); @@ -189,7 +191,7 @@ static device_method_t usie_methods[] = DEVMETHOD(device_probe, usie_probe), DEVMETHOD(device_attach, usie_attach), DEVMETHOD(device_detach, usie_detach), - {0, 0} + DEVMETHOD_END }; static driver_t usie_driver = { @@ -216,6 +218,7 @@ static const struct ucom_callback usie_u .ucom_stop_read = &usie_uc_stop_read, .ucom_start_write = &usie_uc_start_write, .ucom_stop_write = &usie_uc_stop_write, + .ucom_free = &usie_free, }; static void @@ -298,6 +301,7 @@ usie_attach(device_t self) sc->sc_dev = self; mtx_init(&sc->sc_mtx, "usie", MTX_NETWORK_LOCK, MTX_DEF); + ucom_ref(&sc->sc_super_ucom); TASK_INIT(&sc->sc_if_status_task, 0, usie_if_status_cb, sc); TASK_INIT(&sc->sc_if_sync_task, 0, usie_if_sync_cb, sc); @@ -482,11 +486,31 @@ usie_detach(device_t self) for (x = 0; x != USIE_UCOM_MAX; x++) usbd_transfer_unsetup(sc->sc_uc_xfer[x], USIE_UC_N_XFER); - mtx_destroy(&sc->sc_mtx); + + device_claim_softc(self); + + usie_free_softc(sc); return (0); } +UCOM_UNLOAD_DRAIN(usie); + +static void +usie_free_softc(struct usie_softc *sc) +{ + if (ucom_unref(&sc->sc_super_ucom)) { + mtx_destroy(&sc->sc_mtx); + device_free_softc(sc); + } +} + +static void +usie_free(struct ucom_softc *ucom) +{ + usie_free_softc(ucom->sc_parent); +} + static void usie_uc_update_line_state(struct ucom_softc *ucom, uint8_t ls) { Modified: stable/9/sys/dev/usb/net/uhso.c ============================================================================== --- stable/9/sys/dev/usb/net/uhso.c Tue Sep 18 16:23:23 2012 (r240658) +++ stable/9/sys/dev/usb/net/uhso.c Tue Sep 18 16:28:49 2012 (r240659) @@ -455,6 +455,7 @@ static int uhso_driver_loaded(struct mo static int uhso_radio_sysctl(SYSCTL_HANDLER_ARGS); static int uhso_radio_ctrl(struct uhso_softc *, int); +static void uhso_free(struct ucom_softc *); static void uhso_ucom_start_read(struct ucom_softc *); static void uhso_ucom_stop_read(struct ucom_softc *); static void uhso_ucom_start_write(struct ucom_softc *); @@ -473,6 +474,7 @@ static void uhso_if_rxflush(void *); static device_probe_t uhso_probe; static device_attach_t uhso_attach; static device_detach_t uhso_detach; +static void uhso_free_softc(struct uhso_softc *); static device_method_t uhso_methods[] = { DEVMETHOD(device_probe, uhso_probe), @@ -500,7 +502,8 @@ static struct ucom_callback uhso_ucom_ca .ucom_start_read = uhso_ucom_start_read, .ucom_stop_read = uhso_ucom_stop_read, .ucom_start_write = uhso_ucom_start_write, - .ucom_stop_write = uhso_ucom_stop_write + .ucom_stop_write = uhso_ucom_stop_write, + .ucom_free = &uhso_free, }; static int @@ -552,6 +555,7 @@ uhso_attach(device_t self) sc->sc_dev = self; sc->sc_udev = uaa->device; mtx_init(&sc->sc_mtx, "uhso", NULL, MTX_DEF); + ucom_ref(&sc->sc_super_ucom); sc->sc_ucom = NULL; sc->sc_ttys = 0; @@ -692,10 +696,30 @@ uhso_detach(device_t self) usbd_transfer_unsetup(sc->sc_if_xfer, UHSO_IFNET_MAX); } - mtx_destroy(&sc->sc_mtx); + device_claim_softc(self); + + uhso_free_softc(sc); + return (0); } +UCOM_UNLOAD_DRAIN(uhso); + +static void +uhso_free_softc(struct uhso_softc *sc) +{ + if (ucom_unref(&sc->sc_super_ucom)) { + mtx_destroy(&sc->sc_mtx); + device_free_softc(sc); + } +} + +static void +uhso_free(struct ucom_softc *ucom) +{ + uhso_free_softc(ucom->sc_parent); +} + static void uhso_test_autoinst(void *arg, struct usb_device *udev, struct usb_attach_arg *uaa) Modified: stable/9/sys/dev/usb/serial/u3g.c ============================================================================== --- stable/9/sys/dev/usb/serial/u3g.c Tue Sep 18 16:23:23 2012 (r240658) +++ stable/9/sys/dev/usb/serial/u3g.c Tue Sep 18 16:28:49 2012 (r240659) @@ -118,10 +118,12 @@ struct u3g_softc { static device_probe_t u3g_probe; static device_attach_t u3g_attach; static device_detach_t u3g_detach; +static void u3g_free_softc(struct u3g_softc *); static usb_callback_t u3g_write_callback; static usb_callback_t u3g_read_callback; +static void u3g_free(struct ucom_softc *ucom); static void u3g_start_read(struct ucom_softc *ucom); static void u3g_stop_read(struct ucom_softc *ucom); static void u3g_start_write(struct ucom_softc *ucom); @@ -160,13 +162,14 @@ static const struct ucom_callback u3g_ca .ucom_stop_read = &u3g_stop_read, .ucom_start_write = &u3g_start_write, .ucom_stop_write = &u3g_stop_write, + .ucom_free = &u3g_free, }; static device_method_t u3g_methods[] = { DEVMETHOD(device_probe, u3g_probe), DEVMETHOD(device_attach, u3g_attach), DEVMETHOD(device_detach, u3g_detach), - {0, 0} + DEVMETHOD_END }; static devclass_t u3g_devclass; @@ -799,6 +802,7 @@ u3g_attach(device_t dev) device_set_usb_desc(dev); mtx_init(&sc->sc_mtx, "u3g", NULL, MTX_DEF); + ucom_ref(&sc->sc_super_ucom); sc->sc_udev = uaa->device; @@ -886,11 +890,31 @@ u3g_detach(device_t dev) for (subunit = 0; subunit != U3G_MAXPORTS; subunit++) usbd_transfer_unsetup(sc->sc_xfer[subunit], U3G_N_TRANSFER); - mtx_destroy(&sc->sc_mtx); + + device_claim_softc(dev); + + u3g_free_softc(sc); return (0); } +UCOM_UNLOAD_DRAIN(u3g); + +static void +u3g_free_softc(struct u3g_softc *sc) +{ + if (ucom_unref(&sc->sc_super_ucom)) { + mtx_destroy(&sc->sc_mtx); + device_free_softc(sc); + } +} + +static void +u3g_free(struct ucom_softc *ucom) +{ + u3g_free_softc(ucom->sc_parent); +} + static void u3g_start_read(struct ucom_softc *ucom) { @@ -898,7 +922,6 @@ u3g_start_read(struct ucom_softc *ucom) /* start read endpoint */ usbd_transfer_start(sc->sc_xfer[ucom->sc_subunit][U3G_BULK_RD]); - return; } static void @@ -908,7 +931,6 @@ u3g_stop_read(struct ucom_softc *ucom) /* stop read endpoint */ usbd_transfer_stop(sc->sc_xfer[ucom->sc_subunit][U3G_BULK_RD]); - return; } static void @@ -917,7 +939,6 @@ u3g_start_write(struct ucom_softc *ucom) struct u3g_softc *sc = ucom->sc_parent; usbd_transfer_start(sc->sc_xfer[ucom->sc_subunit][U3G_BULK_WR]); - return; } static void @@ -926,7 +947,6 @@ u3g_stop_write(struct ucom_softc *ucom) struct u3g_softc *sc = ucom->sc_parent; usbd_transfer_stop(sc->sc_xfer[ucom->sc_subunit][U3G_BULK_WR]); - return; } static void @@ -955,7 +975,6 @@ tr_setup: } break; } - return; } static void @@ -986,5 +1005,4 @@ tr_setup: } break; } - return; } Modified: stable/9/sys/dev/usb/serial/uark.c ============================================================================== --- stable/9/sys/dev/usb/serial/uark.c Tue Sep 18 16:23:23 2012 (r240658) +++ stable/9/sys/dev/usb/serial/uark.c Tue Sep 18 16:28:49 2012 (r240659) @@ -99,10 +99,12 @@ struct uark_softc { static device_probe_t uark_probe; static device_attach_t uark_attach; static device_detach_t uark_detach; +static void uark_free_softc(struct uark_softc *); static usb_callback_t uark_bulk_write_callback; static usb_callback_t uark_bulk_read_callback; +static void uark_free(struct ucom_softc *); static void uark_start_read(struct ucom_softc *); static void uark_stop_read(struct ucom_softc *); static void uark_start_write(struct ucom_softc *); @@ -147,6 +149,7 @@ static const struct ucom_callback uark_c .ucom_start_write = &uark_start_write, .ucom_stop_write = &uark_stop_write, .ucom_poll = &uark_poll, + .ucom_free = &uark_free, }; static device_method_t uark_methods[] = { @@ -154,7 +157,7 @@ static device_method_t uark_methods[] = DEVMETHOD(device_probe, uark_probe), DEVMETHOD(device_attach, uark_attach), DEVMETHOD(device_detach, uark_detach), - {0, 0} + DEVMETHOD_END }; static devclass_t uark_devclass; @@ -201,6 +204,7 @@ uark_attach(device_t dev) device_set_usb_desc(dev); mtx_init(&sc->sc_mtx, "uark", NULL, MTX_DEF); + ucom_ref(&sc->sc_super_ucom); sc->sc_udev = uaa->device; @@ -242,11 +246,31 @@ uark_detach(device_t dev) ucom_detach(&sc->sc_super_ucom, &sc->sc_ucom); usbd_transfer_unsetup(sc->sc_xfer, UARK_N_TRANSFER); - mtx_destroy(&sc->sc_mtx); + + device_claim_softc(dev); + + uark_free_softc(sc); return (0); } +UCOM_UNLOAD_DRAIN(uark); + +static void +uark_free_softc(struct uark_softc *sc) +{ + if (ucom_unref(&sc->sc_super_ucom)) { + mtx_destroy(&sc->sc_mtx); + device_free_softc(sc); + } +} + +static void +uark_free(struct ucom_softc *ucom) +{ + uark_free_softc(ucom->sc_parent); +} + static void uark_bulk_write_callback(struct usb_xfer *xfer, usb_error_t error) { Modified: stable/9/sys/dev/usb/serial/ubsa.c ============================================================================== --- stable/9/sys/dev/usb/serial/ubsa.c Tue Sep 18 16:23:23 2012 (r240658) +++ stable/9/sys/dev/usb/serial/ubsa.c Tue Sep 18 16:28:49 2012 (r240659) @@ -176,12 +176,14 @@ struct ubsa_softc { static device_probe_t ubsa_probe; static device_attach_t ubsa_attach; static device_detach_t ubsa_detach; +static void ubsa_free_softc(struct ubsa_softc *); static usb_callback_t ubsa_write_callback; static usb_callback_t ubsa_read_callback; static usb_callback_t ubsa_intr_callback; static void ubsa_cfg_request(struct ubsa_softc *, uint8_t, uint16_t); +static void ubsa_free(struct ucom_softc *); static void ubsa_cfg_set_dtr(struct ucom_softc *, uint8_t); static void ubsa_cfg_set_rts(struct ucom_softc *, uint8_t); static void ubsa_cfg_set_break(struct ucom_softc *, uint8_t); @@ -237,6 +239,7 @@ static const struct ucom_callback ubsa_c .ucom_start_write = &ubsa_start_write, .ucom_stop_write = &ubsa_stop_write, .ucom_poll = &ubsa_poll, + .ucom_free = &ubsa_free, }; static const STRUCT_USB_HOST_ID ubsa_devs[] = { @@ -262,7 +265,7 @@ static device_method_t ubsa_methods[] = DEVMETHOD(device_probe, ubsa_probe), DEVMETHOD(device_attach, ubsa_attach), DEVMETHOD(device_detach, ubsa_detach), - {0, 0} + DEVMETHOD_END }; static devclass_t ubsa_devclass; @@ -306,6 +309,7 @@ ubsa_attach(device_t dev) device_set_usb_desc(dev); mtx_init(&sc->sc_mtx, "ubsa", NULL, MTX_DEF); + ucom_ref(&sc->sc_super_ucom); sc->sc_udev = uaa->device; sc->sc_iface_no = uaa->info.bIfaceNum; @@ -348,11 +352,31 @@ ubsa_detach(device_t dev) ucom_detach(&sc->sc_super_ucom, &sc->sc_ucom); usbd_transfer_unsetup(sc->sc_xfer, UBSA_N_TRANSFER); - mtx_destroy(&sc->sc_mtx); + + device_claim_softc(dev); + + ubsa_free_softc(sc); return (0); } +UCOM_UNLOAD_DRAIN(ubsa); + +static void +ubsa_free_softc(struct ubsa_softc *sc) +{ + if (ucom_unref(&sc->sc_super_ucom)) { + mtx_destroy(&sc->sc_mtx); + device_free_softc(sc); + } +} + +static void +ubsa_free(struct ucom_softc *ucom) +{ + ubsa_free_softc(ucom->sc_parent); +} + static void ubsa_cfg_request(struct ubsa_softc *sc, uint8_t index, uint16_t value) { Modified: stable/9/sys/dev/usb/serial/ubser.c ============================================================================== --- stable/9/sys/dev/usb/serial/ubser.c Tue Sep 18 16:23:23 2012 (r240658) +++ stable/9/sys/dev/usb/serial/ubser.c Tue Sep 18 16:28:49 2012 (r240659) @@ -141,7 +141,6 @@ struct ubser_softc { uint8_t sc_iface_no; uint8_t sc_iface_index; uint8_t sc_curr_tx_unit; - uint8_t sc_name[16]; }; /* prototypes */ @@ -149,10 +148,12 @@ struct ubser_softc { static device_probe_t ubser_probe; static device_attach_t ubser_attach; static device_detach_t ubser_detach; +static void ubser_free_softc(struct ubser_softc *); static usb_callback_t ubser_write_callback; static usb_callback_t ubser_read_callback; +static void ubser_free(struct ucom_softc *); static int ubser_pre_param(struct ucom_softc *, struct termios *); static void ubser_cfg_set_break(struct ucom_softc *, uint8_t); static void ubser_cfg_get_status(struct ucom_softc *, uint8_t *, @@ -193,13 +194,14 @@ static const struct ucom_callback ubser_ .ucom_start_write = &ubser_start_write, .ucom_stop_write = &ubser_stop_write, .ucom_poll = &ubser_poll, + .ucom_free = &ubser_free, }; static device_method_t ubser_methods[] = { DEVMETHOD(device_probe, ubser_probe), DEVMETHOD(device_attach, ubser_attach), DEVMETHOD(device_detach, ubser_detach), - {0, 0} + DEVMETHOD_END }; static devclass_t ubser_devclass; @@ -243,9 +245,7 @@ ubser_attach(device_t dev) device_set_usb_desc(dev); mtx_init(&sc->sc_mtx, "ubser", NULL, MTX_DEF); - - snprintf(sc->sc_name, sizeof(sc->sc_name), "%s", - device_get_nameunit(dev)); + ucom_ref(&sc->sc_super_ucom); sc->sc_iface_no = uaa->info.bIfaceNum; sc->sc_iface_index = uaa->info.bIfaceIndex; @@ -319,11 +319,31 @@ ubser_detach(device_t dev) ucom_detach(&sc->sc_super_ucom, sc->sc_ucom); usbd_transfer_unsetup(sc->sc_xfer, UBSER_N_TRANSFER); - mtx_destroy(&sc->sc_mtx); + + device_claim_softc(dev); + + ubser_free_softc(sc); return (0); } +UCOM_UNLOAD_DRAIN(ubser); + +static void +ubser_free_softc(struct ubser_softc *sc) +{ + if (ucom_unref(&sc->sc_super_ucom)) { + mtx_destroy(&sc->sc_mtx); + device_free_softc(sc); + } +} + +static void +ubser_free(struct ucom_softc *ucom) +{ + ubser_free_softc(ucom->sc_parent); +} + static int ubser_pre_param(struct ucom_softc *ucom, struct termios *t) { Modified: stable/9/sys/dev/usb/serial/uchcom.c ============================================================================== --- stable/9/sys/dev/usb/serial/uchcom.c Tue Sep 18 16:23:23 2012 (r240658) +++ stable/9/sys/dev/usb/serial/uchcom.c Tue Sep 18 16:28:49 2012 (r240659) @@ -212,6 +212,7 @@ static const STRUCT_USB_HOST_ID uchcom_d /* protypes */ +static void uchcom_free(struct ucom_softc *); static int uchcom_pre_param(struct ucom_softc *, struct termios *); static void uchcom_cfg_get_status(struct ucom_softc *, uint8_t *, uint8_t *); @@ -235,6 +236,7 @@ static void uchcom_poll(struct ucom_soft static device_probe_t uchcom_probe; static device_attach_t uchcom_attach; static device_detach_t uchcom_detach; +static void uchcom_free_softc(struct uchcom_softc *); static usb_callback_t uchcom_intr_callback; static usb_callback_t uchcom_write_callback; @@ -283,6 +285,7 @@ static struct ucom_callback uchcom_callb .ucom_start_write = &uchcom_start_write, .ucom_stop_write = &uchcom_stop_write, .ucom_poll = &uchcom_poll, + .ucom_free = &uchcom_free, }; /* ---------------------------------------------------------------------- @@ -320,6 +323,7 @@ uchcom_attach(device_t dev) device_set_usb_desc(dev); mtx_init(&sc->sc_mtx, "uchcom", NULL, MTX_DEF); + ucom_ref(&sc->sc_super_ucom); sc->sc_udev = uaa->device; @@ -372,11 +376,31 @@ uchcom_detach(device_t dev) ucom_detach(&sc->sc_super_ucom, &sc->sc_ucom); usbd_transfer_unsetup(sc->sc_xfer, UCHCOM_N_TRANSFER); - mtx_destroy(&sc->sc_mtx); + + device_claim_softc(dev); + + uchcom_free_softc(sc); return (0); } +UCOM_UNLOAD_DRAIN(uchcom); + +static void +uchcom_free_softc(struct uchcom_softc *sc) +{ + if (ucom_unref(&sc->sc_super_ucom)) { + mtx_destroy(&sc->sc_mtx); + device_free_softc(sc); + } +} + +static void +uchcom_free(struct ucom_softc *ucom) +{ + uchcom_free_softc(ucom->sc_parent); +} + /* ---------------------------------------------------------------------- * low level i/o */ @@ -842,8 +866,7 @@ static device_method_t uchcom_methods[] DEVMETHOD(device_probe, uchcom_probe), DEVMETHOD(device_attach, uchcom_attach), DEVMETHOD(device_detach, uchcom_detach), - - {0, 0} + DEVMETHOD_END }; static driver_t uchcom_driver = { Modified: stable/9/sys/dev/usb/serial/ucycom.c ============================================================================== --- stable/9/sys/dev/usb/serial/ucycom.c Tue Sep 18 16:23:23 2012 (r240658) +++ stable/9/sys/dev/usb/serial/ucycom.c Tue Sep 18 16:28:49 2012 (r240659) @@ -101,7 +101,6 @@ struct ucycom_softc { #define UCYCOM_CFG_STOPB 0x08 #define UCYCOM_CFG_DATAB 0x03 uint8_t sc_ist; /* status flags from last input */ - uint8_t sc_name[16]; uint8_t sc_iface_no; uint8_t sc_temp_cfg[32]; }; @@ -111,10 +110,12 @@ struct ucycom_softc { static device_probe_t ucycom_probe; static device_attach_t ucycom_attach; static device_detach_t ucycom_detach; +static void ucycom_free_softc(struct ucycom_softc *); static usb_callback_t ucycom_ctrl_write_callback; static usb_callback_t ucycom_intr_read_callback; +static void ucycom_free(struct ucom_softc *); static void ucycom_cfg_open(struct ucom_softc *); static void ucycom_start_read(struct ucom_softc *); static void ucycom_stop_read(struct ucom_softc *); @@ -155,13 +156,14 @@ static const struct ucom_callback ucycom .ucom_start_write = &ucycom_start_write, .ucom_stop_write = &ucycom_stop_write, .ucom_poll = &ucycom_poll, + .ucom_free = &ucycom_free, }; static device_method_t ucycom_methods[] = { DEVMETHOD(device_probe, ucycom_probe), DEVMETHOD(device_attach, ucycom_attach), DEVMETHOD(device_detach, ucycom_detach), - {0, 0} + DEVMETHOD_END }; static devclass_t ucycom_devclass; @@ -218,9 +220,7 @@ ucycom_attach(device_t dev) device_set_usb_desc(dev); mtx_init(&sc->sc_mtx, "ucycom", NULL, MTX_DEF); - - snprintf(sc->sc_name, sizeof(sc->sc_name), - "%s", device_get_nameunit(dev)); + ucom_ref(&sc->sc_super_ucom); DPRINTF("\n"); @@ -297,11 +297,31 @@ ucycom_detach(device_t dev) ucom_detach(&sc->sc_super_ucom, &sc->sc_ucom); usbd_transfer_unsetup(sc->sc_xfer, UCYCOM_N_TRANSFER); - mtx_destroy(&sc->sc_mtx); + + device_claim_softc(dev); + + ucycom_free_softc(sc); return (0); } +UCOM_UNLOAD_DRAIN(ucycom); + +static void +ucycom_free_softc(struct ucycom_softc *sc) +{ + if (ucom_unref(&sc->sc_super_ucom)) { + mtx_destroy(&sc->sc_mtx); + device_free_softc(sc); + } +} + +static void +ucycom_free(struct ucom_softc *ucom) +{ + ucycom_free_softc(ucom->sc_parent); +} + static void ucycom_cfg_open(struct ucom_softc *ucom) { Modified: stable/9/sys/dev/usb/serial/ufoma.c ============================================================================== --- stable/9/sys/dev/usb/serial/ufoma.c Tue Sep 18 16:23:23 2012 (r240658) +++ stable/9/sys/dev/usb/serial/ufoma.c Tue Sep 18 16:28:49 2012 (r240659) @@ -195,7 +195,6 @@ struct ufoma_softc { uint8_t sc_msr; uint8_t sc_modetoactivate; uint8_t sc_currentmode; - uint8_t sc_name[16]; }; /* prototypes */ @@ -203,6 +202,7 @@ struct ufoma_softc { static device_probe_t ufoma_probe; static device_attach_t ufoma_attach; static device_detach_t ufoma_detach; +static void ufoma_free_softc(struct ufoma_softc *); static usb_callback_t ufoma_ctrl_read_callback; static usb_callback_t ufoma_ctrl_write_callback; @@ -214,6 +214,7 @@ static void *ufoma_get_intconf(struct us struct usb_interface_descriptor *, uint8_t, uint8_t); static void ufoma_cfg_link_state(struct ufoma_softc *); static void ufoma_cfg_activate_state(struct ufoma_softc *, uint16_t); +static void ufoma_free(struct ucom_softc *); static void ufoma_cfg_open(struct ucom_softc *); static void ufoma_cfg_close(struct ucom_softc *); static void ufoma_cfg_set_break(struct ucom_softc *, uint8_t); @@ -304,6 +305,7 @@ static const struct ucom_callback ufoma_ .ucom_start_write = &ufoma_start_write, .ucom_stop_write = &ufoma_stop_write, .ucom_poll = &ufoma_poll, + .ucom_free = &ufoma_free, }; static device_method_t ufoma_methods[] = { @@ -311,7 +313,7 @@ static device_method_t ufoma_methods[] = DEVMETHOD(device_probe, ufoma_probe), DEVMETHOD(device_attach, ufoma_attach), DEVMETHOD(device_detach, ufoma_detach), - {0, 0} + DEVMETHOD_END }; static devclass_t ufoma_devclass; @@ -385,13 +387,11 @@ ufoma_attach(device_t dev) sc->sc_unit = device_get_unit(dev); mtx_init(&sc->sc_mtx, "ufoma", NULL, MTX_DEF); + ucom_ref(&sc->sc_super_ucom); cv_init(&sc->sc_cv, "CWAIT"); device_set_usb_desc(dev); - snprintf(sc->sc_name, sizeof(sc->sc_name), - "%s", device_get_nameunit(dev)); - DPRINTF("\n"); /* setup control transfers */ @@ -495,12 +495,32 @@ ufoma_detach(device_t dev) if (sc->sc_modetable) { free(sc->sc_modetable, M_USBDEV); } - mtx_destroy(&sc->sc_mtx); cv_destroy(&sc->sc_cv); + device_claim_softc(dev); + + ufoma_free_softc(sc); + return (0); } +UCOM_UNLOAD_DRAIN(ufoma); + +static void +ufoma_free_softc(struct ufoma_softc *sc) +{ + if (ucom_unref(&sc->sc_super_ucom)) { + mtx_destroy(&sc->sc_mtx); + device_free_softc(sc); + } +} + +static void +ufoma_free(struct ucom_softc *ucom) +{ + ufoma_free_softc(ucom->sc_parent); +} + static void * ufoma_get_intconf(struct usb_config_descriptor *cd, struct usb_interface_descriptor *id, uint8_t type, uint8_t subtype) Modified: stable/9/sys/dev/usb/serial/uftdi.c ============================================================================== --- stable/9/sys/dev/usb/serial/uftdi.c Tue Sep 18 16:23:23 2012 (r240658) +++ stable/9/sys/dev/usb/serial/uftdi.c Tue Sep 18 16:28:49 2012 (r240659) @@ -110,8 +110,6 @@ struct uftdi_softc { uint8_t sc_hdrlen; uint8_t sc_msr; uint8_t sc_lsr; - - uint8_t sc_name[16]; }; struct uftdi_param_config { @@ -127,10 +125,12 @@ struct uftdi_param_config { static device_probe_t uftdi_probe; static device_attach_t uftdi_attach; static device_detach_t uftdi_detach; +static void uftdi_free_softc(struct uftdi_softc *); static usb_callback_t uftdi_write_callback; static usb_callback_t uftdi_read_callback; +static void uftdi_free(struct ucom_softc *); static void uftdi_cfg_open(struct ucom_softc *); static void uftdi_cfg_set_dtr(struct ucom_softc *, uint8_t); static void uftdi_cfg_set_rts(struct ucom_softc *, uint8_t); @@ -182,6 +182,7 @@ static const struct ucom_callback uftdi_ .ucom_start_write = &uftdi_start_write, .ucom_stop_write = &uftdi_stop_write, .ucom_poll = &uftdi_poll, + .ucom_free = &uftdi_free, }; static device_method_t uftdi_methods[] = { @@ -189,7 +190,6 @@ static device_method_t uftdi_methods[] = DEVMETHOD(device_probe, uftdi_probe), DEVMETHOD(device_attach, uftdi_attach), DEVMETHOD(device_detach, uftdi_detach), - DEVMETHOD_END }; @@ -304,9 +304,7 @@ uftdi_attach(device_t dev) device_set_usb_desc(dev); mtx_init(&sc->sc_mtx, "uftdi", NULL, MTX_DEF); - - snprintf(sc->sc_name, sizeof(sc->sc_name), - "%s", device_get_nameunit(dev)); + ucom_ref(&sc->sc_super_ucom); DPRINTF("\n"); @@ -368,11 +366,31 @@ uftdi_detach(device_t dev) ucom_detach(&sc->sc_super_ucom, &sc->sc_ucom); usbd_transfer_unsetup(sc->sc_xfer, UFTDI_N_TRANSFER); - mtx_destroy(&sc->sc_mtx); + + device_claim_softc(dev); + + uftdi_free_softc(sc); return (0); } +UCOM_UNLOAD_DRAIN(uftdi); + +static void +uftdi_free_softc(struct uftdi_softc *sc) +{ + if (ucom_unref(&sc->sc_super_ucom)) { + mtx_destroy(&sc->sc_mtx); + device_free_softc(sc); + } +} + +static void +uftdi_free(struct ucom_softc *ucom) +{ + uftdi_free_softc(ucom->sc_parent); +} + static void uftdi_cfg_open(struct ucom_softc *ucom) { Modified: stable/9/sys/dev/usb/serial/ugensa.c ============================================================================== --- stable/9/sys/dev/usb/serial/ugensa.c Tue Sep 18 16:23:23 2012 (r240658) +++ stable/9/sys/dev/usb/serial/ugensa.c Tue Sep 18 16:28:49 2012 (r240659) @@ -94,10 +94,12 @@ struct ugensa_softc { static device_probe_t ugensa_probe; static device_attach_t ugensa_attach; static device_detach_t ugensa_detach; +static void ugensa_free_softc(struct ugensa_softc *); static usb_callback_t ugensa_bulk_write_callback; static usb_callback_t ugensa_bulk_read_callback; +static void ugensa_free(struct ucom_softc *); static void ugensa_start_read(struct ucom_softc *); static void ugensa_stop_read(struct ucom_softc *); static void ugensa_start_write(struct ucom_softc *); @@ -131,6 +133,7 @@ static const struct ucom_callback ugensa .ucom_start_write = &ugensa_start_write, .ucom_stop_write = &ugensa_stop_write, .ucom_poll = &ugensa_poll, + .ucom_free = &ugensa_free, }; static device_method_t ugensa_methods[] = { @@ -138,7 +141,7 @@ static device_method_t ugensa_methods[] DEVMETHOD(device_probe, ugensa_probe), DEVMETHOD(device_attach, ugensa_attach), DEVMETHOD(device_detach, ugensa_detach), - {0, 0} + DEVMETHOD_END }; static devclass_t ugensa_devclass; @@ -192,6 +195,7 @@ ugensa_attach(device_t dev) device_set_usb_desc(dev); mtx_init(&sc->sc_mtx, "ugensa", NULL, MTX_DEF); + ucom_ref(&sc->sc_super_ucom); /* Figure out how many interfaces this device has got */ for (cnt = 0; cnt < UGENSA_IFACE_MAX; cnt++) { @@ -266,11 +270,31 @@ ugensa_detach(device_t dev) for (x = 0; x < sc->sc_niface; x++) { usbd_transfer_unsetup(sc->sc_sub[x].sc_xfer, UGENSA_N_TRANSFER); } - mtx_destroy(&sc->sc_mtx); + + device_claim_softc(dev); + + ugensa_free_softc(sc); return (0); } +UCOM_UNLOAD_DRAIN(ugensa); + +static void +ugensa_free_softc(struct ugensa_softc *sc) +{ + if (ucom_unref(&sc->sc_super_ucom)) { + mtx_destroy(&sc->sc_mtx); + device_free_softc(sc); + } +} + +static void +ugensa_free(struct ucom_softc *ucom) +{ + ugensa_free_softc(ucom->sc_parent); +} + static void ugensa_bulk_write_callback(struct usb_xfer *xfer, usb_error_t error) { Modified: stable/9/sys/dev/usb/serial/uipaq.c ============================================================================== --- stable/9/sys/dev/usb/serial/uipaq.c Tue Sep 18 16:23:23 2012 (r240658) +++ stable/9/sys/dev/usb/serial/uipaq.c Tue Sep 18 16:28:49 2012 (r240659) @@ -103,10 +103,12 @@ struct uipaq_softc { static device_probe_t uipaq_probe; static device_attach_t uipaq_attach; static device_detach_t uipaq_detach; +static void uipaq_free_softc(struct uipaq_softc *); static usb_callback_t uipaq_write_callback; static usb_callback_t uipaq_read_callback; +static void uipaq_free(struct ucom_softc *); static void uipaq_start_read(struct ucom_softc *); static void uipaq_stop_read(struct ucom_softc *); static void uipaq_start_write(struct ucom_softc *); @@ -146,6 +148,7 @@ static const struct ucom_callback uipaq_ .ucom_start_write = &uipaq_start_write, .ucom_stop_write = &uipaq_stop_write, .ucom_poll = &uipaq_poll, + .ucom_free = &uipaq_free, }; /* @@ -1070,7 +1073,7 @@ static device_method_t uipaq_methods[] = DEVMETHOD(device_probe, uipaq_probe), DEVMETHOD(device_attach, uipaq_attach), DEVMETHOD(device_detach, uipaq_detach), - {0, 0} + DEVMETHOD_END }; static devclass_t uipaq_devclass; @@ -1121,6 +1124,7 @@ uipaq_attach(device_t dev) device_set_usb_desc(dev); mtx_init(&sc->sc_mtx, "uipaq", NULL, MTX_DEF); + ucom_ref(&sc->sc_super_ucom); /* * Send magic bytes, cribbed from Linux ipaq driver that @@ -1176,11 +1180,31 @@ uipaq_detach(device_t dev) ucom_detach(&sc->sc_super_ucom, &sc->sc_ucom); usbd_transfer_unsetup(sc->sc_xfer, UIPAQ_N_TRANSFER); - mtx_destroy(&sc->sc_mtx); + + device_claim_softc(dev); + + uipaq_free_softc(sc); return (0); } +UCOM_UNLOAD_DRAIN(uipaq); + +static void +uipaq_free_softc(struct uipaq_softc *sc) +{ + if (ucom_unref(&sc->sc_super_ucom)) { + mtx_destroy(&sc->sc_mtx); + device_free_softc(sc); + } +} + +static void +uipaq_free(struct ucom_softc *ucom) +{ + uipaq_free_softc(ucom->sc_parent); +} + static void uipaq_start_read(struct ucom_softc *ucom) { Modified: stable/9/sys/dev/usb/serial/ulpt.c ============================================================================== --- stable/9/sys/dev/usb/serial/ulpt.c Tue Sep 18 16:23:23 2012 (r240658) +++ stable/9/sys/dev/usb/serial/ulpt.c Tue Sep 18 16:28:49 2012 (r240659) @@ -747,7 +747,7 @@ static device_method_t ulpt_methods[] = DEVMETHOD(device_probe, ulpt_probe), DEVMETHOD(device_attach, ulpt_attach), DEVMETHOD(device_detach, ulpt_detach), - {0, 0} + DEVMETHOD_END }; static driver_t ulpt_driver = { Modified: stable/9/sys/dev/usb/serial/umcs.c ============================================================================== --- stable/9/sys/dev/usb/serial/umcs.c Tue Sep 18 16:23:23 2012 (r240658) +++ stable/9/sys/dev/usb/serial/umcs.c Tue Sep 18 16:28:49 2012 (r240659) @@ -154,6 +154,7 @@ static usb_error_t umcs7840_set_UART_reg static usb_error_t umcs7840_set_baudrate(struct umcs7840_softc *, uint8_t, uint32_t); static usb_error_t umcs7840_calc_baudrate(uint32_t rate, uint16_t *, uint8_t *); +static void umcs7840_free(struct ucom_softc *); static void umcs7840_cfg_get_status(struct ucom_softc *, uint8_t *, uint8_t *); static void umcs7840_cfg_set_dtr(struct ucom_softc *, uint8_t); static void umcs7840_cfg_set_rts(struct ucom_softc *, uint8_t); @@ -175,6 +176,7 @@ static void umcs7840_poll(struct ucom_so static device_probe_t umcs7840_probe; static device_attach_t umcs7840_attach; static device_detach_t umcs7840_detach; +static void umcs7840_free_softc(struct umcs7840_softc *); static usb_callback_t umcs7840_intr_callback; static usb_callback_t umcs7840_read_callback1; @@ -251,6 +253,7 @@ static struct ucom_callback umcs7840_cal .ucom_stop_write = &umcs7840_stop_write, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Sep 18 16:33:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B63E1106564A; Tue, 18 Sep 2012 16:33:53 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9FF478FC1D; Tue, 18 Sep 2012 16:33:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8IGXrC7025332; Tue, 18 Sep 2012 16:33:53 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8IGXrKx025330; Tue, 18 Sep 2012 16:33:53 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201209181633.q8IGXrKx025330@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 18 Sep 2012 16:33:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240660 - stable/9/sys/dev/usb/serial X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Sep 2012 16:33:53 -0000 Author: hselasky Date: Tue Sep 18 16:33:53 2012 New Revision: 240660 URL: http://svn.freebsd.org/changeset/base/240660 Log: MFC r239050 and r239260: Rename command defines to match names used in the datasheet. Modified: stable/9/sys/dev/usb/serial/uslcom.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/serial/uslcom.c ============================================================================== --- stable/9/sys/dev/usb/serial/uslcom.c Tue Sep 18 16:28:49 2012 (r240659) +++ stable/9/sys/dev/usb/serial/uslcom.c Tue Sep 18 16:33:53 2012 (r240660) @@ -19,6 +19,12 @@ __FBSDID("$FreeBSD$"); * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +/* + * Driver for Silicon Laboratories CP2101/CP2102/CP2103/CP2104/CP2105 + * USB-Serial adapters. Based on datasheet AN571, publicly available from + * http://www.silabs.com/Support%20Documents/TechnicalDocs/AN571.pdf + */ + #include #include #include @@ -61,55 +67,54 @@ SYSCTL_INT(_hw_usb_uslcom, OID_AUTO, deb #define USLCOM_BULK_BUF_SIZE 1024 #define USLCOM_CONFIG_INDEX 0 -#define USLCOM_SET_DATA_BITS(x) ((x) << 8) - /* Request types */ #define USLCOM_WRITE 0x41 #define USLCOM_READ 0xc1 /* Request codes */ -#define USLCOM_UART 0x00 -#define USLCOM_SET_BAUD_DIV 0x01 -#define USLCOM_DATA 0x03 -#define USLCOM_BREAK 0x05 -#define USLCOM_CTRL 0x07 -#define USLCOM_RCTRL 0x08 -#define USLCOM_SET_FLOWCTRL 0x13 -#define USLCOM_SET_BAUD_RATE 0x1e +#define USLCOM_IFC_ENABLE 0x00 +#define USLCOM_SET_BAUDDIV 0x01 +#define USLCOM_SET_LINE_CTL 0x03 +#define USLCOM_SET_BREAK 0x05 +#define USLCOM_SET_MHS 0x07 +#define USLCOM_GET_MDMSTS 0x08 +#define USLCOM_SET_FLOW 0x13 +#define USLCOM_SET_BAUDRATE 0x1e #define USLCOM_VENDOR_SPECIFIC 0xff -/* USLCOM_UART values */ -#define USLCOM_UART_DISABLE 0x00 -#define USLCOM_UART_ENABLE 0x01 - -/* USLCOM_CTRL/USLCOM_RCTRL values */ -#define USLCOM_CTRL_DTR_ON 0x0001 -#define USLCOM_CTRL_DTR_SET 0x0100 -#define USLCOM_CTRL_RTS_ON 0x0002 -#define USLCOM_CTRL_RTS_SET 0x0200 -#define USLCOM_CTRL_CTS 0x0010 -#define USLCOM_CTRL_DSR 0x0020 -#define USLCOM_CTRL_RI 0x0040 -#define USLCOM_CTRL_DCD 0x0080 +/* USLCOM_IFC_ENABLE values */ +#define USLCOM_IFC_ENABLE_DIS 0x00 +#define USLCOM_IFC_ENABLE_EN 0x01 + +/* USLCOM_SET_MHS/USLCOM_GET_MDMSTS values */ +#define USLCOM_MHS_DTR_ON 0x0001 +#define USLCOM_MHS_DTR_SET 0x0100 +#define USLCOM_MHS_RTS_ON 0x0002 +#define USLCOM_MHS_RTS_SET 0x0200 +#define USLCOM_MHS_CTS 0x0010 +#define USLCOM_MHS_DSR 0x0020 +#define USLCOM_MHS_RI 0x0040 +#define USLCOM_MHS_DCD 0x0080 -/* USLCOM_SET_BAUD_DIV values */ -#define USLCOM_BAUD_REF 3686400 /* 3.6864 MHz */ +/* USLCOM_SET_BAUDDIV values */ +#define USLCOM_BAUDDIV_REF 3686400 /* 3.6864 MHz */ -/* USLCOM_DATA values */ +/* USLCOM_SET_LINE_CTL values */ #define USLCOM_STOP_BITS_1 0x00 #define USLCOM_STOP_BITS_2 0x02 #define USLCOM_PARITY_NONE 0x00 #define USLCOM_PARITY_ODD 0x10 #define USLCOM_PARITY_EVEN 0x20 +#define USLCOM_SET_DATA_BITS(x) ((x) << 8) -/* USLCOM_BREAK values */ -#define USLCOM_BREAK_OFF 0x00 -#define USLCOM_BREAK_ON 0x01 +/* USLCOM_SET_BREAK values */ +#define USLCOM_SET_BREAK_OFF 0x00 +#define USLCOM_SET_BREAK_ON 0x01 -/* USLCOM_SET_FLOWCTRL values - 1st word */ +/* USLCOM_SET_FLOW values - 1st word */ #define USLCOM_FLOW_DTR_ON 0x00000001 /* DTR static active */ #define USLCOM_FLOW_CTS_HS 0x00000008 /* CTS handshake */ -/* USLCOM_SET_FLOWCTRL values - 2nd word */ +/* USLCOM_SET_FLOW values - 2nd word */ #define USLCOM_FLOW_RTS_ON 0x00000040 /* RTS static active */ #define USLCOM_FLOW_RTS_HS 0x00000080 /* RTS handshake */ @@ -460,8 +465,8 @@ uslcom_open(struct ucom_softc *ucom) struct usb_device_request req; req.bmRequestType = USLCOM_WRITE; - req.bRequest = USLCOM_UART; - USETW(req.wValue, USLCOM_UART_ENABLE); + req.bRequest = USLCOM_IFC_ENABLE; + USETW(req.wValue, USLCOM_IFC_ENABLE_EN); USETW(req.wIndex, sc->sc_iface_no); USETW(req.wLength, 0); @@ -484,8 +489,8 @@ uslcom_close(struct ucom_softc *ucom) usb_callout_stop(&sc->sc_watchdog); req.bmRequestType = USLCOM_WRITE; - req.bRequest = USLCOM_UART; - USETW(req.wValue, USLCOM_UART_DISABLE); + req.bRequest = USLCOM_IFC_ENABLE; + USETW(req.wValue, USLCOM_IFC_ENABLE_DIS); USETW(req.wIndex, sc->sc_iface_no); USETW(req.wLength, 0); @@ -504,11 +509,11 @@ uslcom_set_dtr(struct ucom_softc *ucom, DPRINTF("onoff = %d\n", onoff); - ctl = onoff ? USLCOM_CTRL_DTR_ON : 0; - ctl |= USLCOM_CTRL_DTR_SET; + ctl = onoff ? USLCOM_MHS_DTR_ON : 0; + ctl |= USLCOM_MHS_DTR_SET; req.bmRequestType = USLCOM_WRITE; - req.bRequest = USLCOM_CTRL; + req.bRequest = USLCOM_SET_MHS; USETW(req.wValue, ctl); USETW(req.wIndex, sc->sc_iface_no); USETW(req.wLength, 0); @@ -528,11 +533,11 @@ uslcom_set_rts(struct ucom_softc *ucom, DPRINTF("onoff = %d\n", onoff); - ctl = onoff ? USLCOM_CTRL_RTS_ON : 0; - ctl |= USLCOM_CTRL_RTS_SET; + ctl = onoff ? USLCOM_MHS_RTS_ON : 0; + ctl |= USLCOM_MHS_RTS_SET; req.bmRequestType = USLCOM_WRITE; - req.bRequest = USLCOM_CTRL; + req.bRequest = USLCOM_SET_MHS; USETW(req.wValue, ctl); USETW(req.wIndex, sc->sc_iface_no); USETW(req.wLength, 0); @@ -563,7 +568,7 @@ uslcom_param(struct ucom_softc *ucom, st baudrate = t->c_ospeed; req.bmRequestType = USLCOM_WRITE; - req.bRequest = USLCOM_SET_BAUD_RATE; + req.bRequest = USLCOM_SET_BAUDRATE; USETW(req.wValue, 0); USETW(req.wIndex, sc->sc_iface_no); USETW(req.wLength, sizeof(baudrate)); @@ -600,7 +605,7 @@ uslcom_param(struct ucom_softc *ucom, st } req.bmRequestType = USLCOM_WRITE; - req.bRequest = USLCOM_DATA; + req.bRequest = USLCOM_SET_LINE_CTL; USETW(req.wValue, data); USETW(req.wIndex, sc->sc_iface_no); USETW(req.wLength, 0); @@ -613,16 +618,14 @@ uslcom_param(struct ucom_softc *ucom, st if (t->c_cflag & CRTSCTS) { flowctrl[0] = htole32(USLCOM_FLOW_DTR_ON | USLCOM_FLOW_CTS_HS); flowctrl[1] = htole32(USLCOM_FLOW_RTS_HS); - flowctrl[2] = 0; - flowctrl[3] = 0; } else { flowctrl[0] = htole32(USLCOM_FLOW_DTR_ON); flowctrl[1] = htole32(USLCOM_FLOW_RTS_ON); - flowctrl[2] = 0; - flowctrl[3] = 0; } + flowctrl[2] = 0; + flowctrl[3] = 0; req.bmRequestType = USLCOM_WRITE; - req.bRequest = USLCOM_SET_FLOWCTRL; + req.bRequest = USLCOM_SET_FLOW; USETW(req.wValue, 0); USETW(req.wIndex, sc->sc_iface_no); USETW(req.wLength, sizeof(flowctrl)); @@ -649,10 +652,10 @@ uslcom_set_break(struct ucom_softc *ucom { struct uslcom_softc *sc = ucom->sc_parent; struct usb_device_request req; - uint16_t brk = onoff ? USLCOM_BREAK_ON : USLCOM_BREAK_OFF; + uint16_t brk = onoff ? USLCOM_SET_BREAK_ON : USLCOM_SET_BREAK_OFF; req.bmRequestType = USLCOM_WRITE; - req.bRequest = USLCOM_BREAK; + req.bRequest = USLCOM_SET_BREAK; USETW(req.wValue, brk); USETW(req.wIndex, sc->sc_iface_no); USETW(req.wLength, 0); @@ -787,13 +790,13 @@ uslcom_control_callback(struct usb_xfer case USB_ST_TRANSFERRED: pc = usbd_xfer_get_frame(xfer, 1); usbd_copy_out(pc, 0, &buf, sizeof(buf)); - if (buf & USLCOM_CTRL_CTS) + if (buf & USLCOM_MHS_CTS) msr |= SER_CTS; - if (buf & USLCOM_CTRL_DSR) + if (buf & USLCOM_MHS_DSR) msr |= SER_DSR; - if (buf & USLCOM_CTRL_RI) + if (buf & USLCOM_MHS_RI) msr |= SER_RI; - if (buf & USLCOM_CTRL_DCD) + if (buf & USLCOM_MHS_DCD) msr |= SER_DCD; if (msr != sc->sc_msr) { @@ -806,7 +809,7 @@ uslcom_control_callback(struct usb_xfer case USB_ST_SETUP: req.bmRequestType = USLCOM_READ; - req.bRequest = USLCOM_RCTRL; + req.bRequest = USLCOM_GET_MDMSTS; USETW(req.wValue, 0); USETW(req.wIndex, sc->sc_iface_no); USETW(req.wLength, sizeof(buf)); From owner-svn-src-all@FreeBSD.ORG Tue Sep 18 16:37:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 43A67106564A; Tue, 18 Sep 2012 16:37:12 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2BEA18FC0C; Tue, 18 Sep 2012 16:37:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8IGbCYl025780; Tue, 18 Sep 2012 16:37:12 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8IGbBZt025778; Tue, 18 Sep 2012 16:37:11 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201209181637.q8IGbBZt025778@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 18 Sep 2012 16:37:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240661 - stable/9/sys/dev/usb/storage X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Sep 2012 16:37:12 -0000 Author: hselasky Date: Tue Sep 18 16:37:11 2012 New Revision: 240661 URL: http://svn.freebsd.org/changeset/base/240661 Log: MFC r232361: Style change: Expand redundant #if's. Remove a couple of empty lines. Modified: stable/9/sys/dev/usb/storage/umass.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/storage/umass.c ============================================================================== --- stable/9/sys/dev/usb/storage/umass.c Tue Sep 18 16:33:53 2012 (r240660) +++ stable/9/sys/dev/usb/storage/umass.c Tue Sep 18 16:37:11 2012 (r240661) @@ -137,14 +137,6 @@ __FBSDID("$FreeBSD$"); #include -#define UMASS_EXT_BUFFER -#ifdef UMASS_EXT_BUFFER -/* this enables loading of virtual buffers into DMA */ -#define UMASS_USB_FLAGS .ext_buffer=1, -#else -#define UMASS_USB_FLAGS -#endif - #ifdef USB_DEBUG #define DIF(m, x) \ do { \ @@ -542,7 +534,7 @@ static struct usb_config umass_bbb_confi .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, .bufsize = UMASS_BULK_SIZE, - .flags = {.proxy_buffer = 1,.short_xfer_ok = 1, UMASS_USB_FLAGS}, + .flags = {.proxy_buffer = 1,.short_xfer_ok = 1,.ext_buffer=1,}, .callback = &umass_t_bbb_data_read_callback, .timeout = 0, /* overwritten later */ }, @@ -561,7 +553,7 @@ static struct usb_config umass_bbb_confi .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, .bufsize = UMASS_BULK_SIZE, - .flags = {.proxy_buffer = 1,.short_xfer_ok = 1, UMASS_USB_FLAGS}, + .flags = {.proxy_buffer = 1,.short_xfer_ok = 1,.ext_buffer=1,}, .callback = &umass_t_bbb_data_write_callback, .timeout = 0, /* overwritten later */ }, @@ -634,7 +626,7 @@ static struct usb_config umass_cbi_confi .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, .bufsize = UMASS_BULK_SIZE, - .flags = {.proxy_buffer = 1,.short_xfer_ok = 1, UMASS_USB_FLAGS}, + .flags = {.proxy_buffer = 1,.short_xfer_ok = 1,.ext_buffer=1,}, .callback = &umass_t_cbi_data_read_callback, .timeout = 0, /* overwritten later */ }, @@ -653,7 +645,7 @@ static struct usb_config umass_cbi_confi .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, .bufsize = UMASS_BULK_SIZE, - .flags = {.proxy_buffer = 1,.short_xfer_ok = 1, UMASS_USB_FLAGS}, + .flags = {.proxy_buffer = 1,.short_xfer_ok = 1,.ext_buffer=1,}, .callback = &umass_t_cbi_data_write_callback, .timeout = 0, /* overwritten later */ }, @@ -1053,14 +1045,11 @@ umass_detach(device_t dev) usbd_transfer_unsetup(sc->sc_xfer, UMASS_T_MAX); -#if (__FreeBSD_version >= 700037) mtx_lock(&sc->sc_mtx); -#endif umass_cam_detach_sim(sc); -#if (__FreeBSD_version >= 700037) mtx_unlock(&sc->sc_mtx); -#endif + mtx_destroy(&sc->sc_mtx); return (0); /* success */ @@ -1201,7 +1190,6 @@ umass_t_bbb_reset1_callback(struct usb_x default: /* Error */ umass_tr_error(xfer, error); return; - } } @@ -1240,7 +1228,6 @@ tr_transferred: default: /* Error */ umass_tr_error(xfer, error); return; - } } @@ -1326,7 +1313,6 @@ umass_t_bbb_command_callback(struct usb_ default: /* Error */ umass_tr_error(xfer, error); return; - } } @@ -1335,19 +1321,12 @@ umass_t_bbb_data_read_callback(struct us { struct umass_softc *sc = usbd_xfer_softc(xfer); uint32_t max_bulk = usbd_xfer_max_len(xfer); -#ifndef UMASS_EXT_BUFFER - struct usb_page_cache *pc; -#endif int actlen, sumlen; usbd_xfer_status(xfer, &actlen, &sumlen, NULL, NULL); switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: -#ifndef UMASS_EXT_BUFFER - pc = usbd_xfer_get_frame(xfer, 0); - usbd_copy_out(pc, 0, sc->sc_transfer.data_ptr, actlen); -#endif sc->sc_transfer.data_rem -= actlen; sc->sc_transfer.data_ptr += actlen; sc->sc_transfer.actlen += actlen; @@ -1369,12 +1348,9 @@ umass_t_bbb_data_read_callback(struct us } usbd_xfer_set_timeout(xfer, sc->sc_transfer.data_timeout); -#ifdef UMASS_EXT_BUFFER usbd_xfer_set_frame_data(xfer, 0, sc->sc_transfer.data_ptr, max_bulk); -#else - usbd_xfer_set_frame_len(xfer, 0, max_bulk); -#endif + usbd_transfer_submit(xfer); return; @@ -1385,7 +1361,6 @@ umass_t_bbb_data_read_callback(struct us umass_transfer_start(sc, UMASS_T_BBB_DATA_RD_CS); } return; - } } @@ -1401,9 +1376,6 @@ umass_t_bbb_data_write_callback(struct u { struct umass_softc *sc = usbd_xfer_softc(xfer); uint32_t max_bulk = usbd_xfer_max_len(xfer); -#ifndef UMASS_EXT_BUFFER - struct usb_page_cache *pc; -#endif int actlen, sumlen; usbd_xfer_status(xfer, &actlen, &sumlen, NULL, NULL); @@ -1431,14 +1403,8 @@ umass_t_bbb_data_write_callback(struct u } usbd_xfer_set_timeout(xfer, sc->sc_transfer.data_timeout); -#ifdef UMASS_EXT_BUFFER usbd_xfer_set_frame_data(xfer, 0, sc->sc_transfer.data_ptr, max_bulk); -#else - pc = usbd_xfer_get_frame(xfer, 0); - usbd_copy_in(pc, 0, sc->sc_transfer.data_ptr, max_bulk); - usbd_xfer_set_frame_len(xfer, 0, max_bulk); -#endif usbd_transfer_submit(xfer); return; @@ -1450,7 +1416,6 @@ umass_t_bbb_data_write_callback(struct u umass_transfer_start(sc, UMASS_T_BBB_DATA_WR_CS); } return; - } } @@ -1576,7 +1541,6 @@ tr_error: umass_transfer_start(sc, UMASS_T_BBB_DATA_RD_CS); } return; - } } @@ -1728,7 +1692,6 @@ umass_t_cbi_reset1_callback(struct usb_x else umass_transfer_start(sc, UMASS_T_CBI_RESET2); break; - } } @@ -1783,7 +1746,6 @@ tr_transferred: default: /* Error */ umass_tr_error(xfer, error); break; - } } @@ -1873,19 +1835,12 @@ umass_t_cbi_data_read_callback(struct us { struct umass_softc *sc = usbd_xfer_softc(xfer); uint32_t max_bulk = usbd_xfer_max_len(xfer); -#ifndef UMASS_EXT_BUFFER - struct usb_page_cache *pc; -#endif int actlen, sumlen; usbd_xfer_status(xfer, &actlen, &sumlen, NULL, NULL); switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: -#ifndef UMASS_EXT_BUFFER - pc = usbd_xfer_get_frame(xfer, 0); - usbd_copy_out(pc, 0, sc->sc_transfer.data_ptr, actlen); -#endif sc->sc_transfer.data_rem -= actlen; sc->sc_transfer.data_ptr += actlen; sc->sc_transfer.actlen += actlen; @@ -1907,12 +1862,9 @@ umass_t_cbi_data_read_callback(struct us } usbd_xfer_set_timeout(xfer, sc->sc_transfer.data_timeout); -#ifdef UMASS_EXT_BUFFER usbd_xfer_set_frame_data(xfer, 0, sc->sc_transfer.data_ptr, max_bulk); -#else - usbd_xfer_set_frame_len(xfer, 0, max_bulk); -#endif + usbd_transfer_submit(xfer); break; @@ -1924,7 +1876,6 @@ umass_t_cbi_data_read_callback(struct us umass_transfer_start(sc, UMASS_T_CBI_DATA_RD_CS); } break; - } } @@ -1940,9 +1891,6 @@ umass_t_cbi_data_write_callback(struct u { struct umass_softc *sc = usbd_xfer_softc(xfer); uint32_t max_bulk = usbd_xfer_max_len(xfer); -#ifndef UMASS_EXT_BUFFER - struct usb_page_cache *pc; -#endif int actlen, sumlen; usbd_xfer_status(xfer, &actlen, &sumlen, NULL, NULL); @@ -1970,14 +1918,8 @@ umass_t_cbi_data_write_callback(struct u } usbd_xfer_set_timeout(xfer, sc->sc_transfer.data_timeout); -#ifdef UMASS_EXT_BUFFER usbd_xfer_set_frame_data(xfer, 0, sc->sc_transfer.data_ptr, max_bulk); -#else - pc = usbd_xfer_get_frame(xfer, 0); - usbd_copy_in(pc, 0, sc->sc_transfer.data_ptr, max_bulk); - usbd_xfer_set_frame_len(xfer, 0, max_bulk); -#endif usbd_transfer_submit(xfer); break; @@ -1990,7 +1932,6 @@ umass_t_cbi_data_write_callback(struct u umass_transfer_start(sc, UMASS_T_CBI_DATA_WR_CS); } break; - } } @@ -2092,7 +2033,6 @@ tr_setup: usbd_errstr(error)); umass_tr_error(xfer, error); break; - } } @@ -2121,9 +2061,7 @@ umass_cam_attach_sim(struct umass_softc DEVNAME_SIM, sc /* priv */ , sc->sc_unit /* unit number */ , -#if (__FreeBSD_version >= 700037) &sc->sc_mtx /* mutex */ , -#endif 1 /* maximum device openings */ , 0 /* maximum tagged device openings */ , devq); @@ -2133,27 +2071,15 @@ umass_cam_attach_sim(struct umass_softc return (ENOMEM); } -#if (__FreeBSD_version >= 700037) mtx_lock(&sc->sc_mtx); -#endif -#if (__FreeBSD_version >= 700048) - if (xpt_bus_register(sc->sc_sim, sc->sc_dev, sc->sc_unit) != CAM_SUCCESS) { + if (xpt_bus_register(sc->sc_sim, sc->sc_dev, + sc->sc_unit) != CAM_SUCCESS) { mtx_unlock(&sc->sc_mtx); return (ENOMEM); } -#else - if (xpt_bus_register(sc->sc_sim, sc->sc_unit) != CAM_SUCCESS) { -#if (__FreeBSD_version >= 700037) - mtx_unlock(&sc->sc_mtx); -#endif - return (ENOMEM); - } -#endif - -#if (__FreeBSD_version >= 700037) mtx_unlock(&sc->sc_mtx); -#endif + return (0); } @@ -2204,11 +2130,6 @@ umass_cam_action(struct cam_sim *sim, un xpt_done(ccb); return; } - if (sc) { -#if (__FreeBSD_version < 700037) - mtx_lock(&sc->sc_mtx); -#endif - } /* * Verify, depending on the operation to perform, that we either got * a valid sc, because an existing target was referenced, or @@ -2411,12 +2332,11 @@ umass_cam_action(struct cam_sim *sim, un strlcpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN); cpi->unit_number = cam_sim_unit(sim); cpi->bus_id = sc->sc_unit; -#if (__FreeBSD_version >= 700025) cpi->protocol = PROTO_SCSI; cpi->protocol_version = SCSI_REV_2; cpi->transport = XPORT_USB; cpi->transport_version = 0; -#endif + if (sc == NULL) { cpi->base_transfer_speed = 0; cpi->max_lun = 0; @@ -2468,16 +2388,12 @@ umass_cam_action(struct cam_sim *sim, un cam_sim_path(sc->sc_sim), ccb->ccb_h.target_id, ccb->ccb_h.target_lun); -#if (__FreeBSD_version >= 700025) cts->protocol = PROTO_SCSI; cts->protocol_version = SCSI_REV_2; cts->transport = XPORT_USB; cts->transport_version = 0; cts->xport_specific.valid = 0; -#else - cts->valid = 0; - cts->flags = 0; /* no disconnection, tagging */ -#endif + ccb->ccb_h.status = CAM_REQ_CMP; xpt_done(ccb); break; @@ -2520,11 +2436,6 @@ umass_cam_action(struct cam_sim *sim, un } done: -#if (__FreeBSD_version < 700037) - if (sc) { - mtx_unlock(&sc->sc_mtx); - } -#endif return; } From owner-svn-src-all@FreeBSD.ORG Tue Sep 18 16:39:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id ACDBD1065673; Tue, 18 Sep 2012 16:39:04 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 972D78FC17; Tue, 18 Sep 2012 16:39:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8IGd4vm026061; Tue, 18 Sep 2012 16:39:04 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8IGd45G026059; Tue, 18 Sep 2012 16:39:04 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201209181639.q8IGd45G026059@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 18 Sep 2012 16:39:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240662 - stable/9/sys/dev/usb/storage X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Sep 2012 16:39:04 -0000 Author: hselasky Date: Tue Sep 18 16:39:04 2012 New Revision: 240662 URL: http://svn.freebsd.org/changeset/base/240662 Log: MFC r232358: Close a detach race. Make sure all pending CCB's get canceled at device detach. Modified: stable/9/sys/dev/usb/storage/umass.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/storage/umass.c ============================================================================== --- stable/9/sys/dev/usb/storage/umass.c Tue Sep 18 16:37:11 2012 (r240661) +++ stable/9/sys/dev/usb/storage/umass.c Tue Sep 18 16:39:04 2012 (r240662) @@ -1046,6 +1046,11 @@ umass_detach(device_t dev) usbd_transfer_unsetup(sc->sc_xfer, UMASS_T_MAX); mtx_lock(&sc->sc_mtx); + + /* cancel any leftover CCB's */ + + umass_cancel_ccb(sc); + umass_cam_detach_sim(sc); mtx_unlock(&sc->sc_mtx); @@ -1571,8 +1576,7 @@ umass_command_start(struct umass_softc * if (sc->sc_xfer[sc->sc_last_xfer_index]) { usbd_transfer_start(sc->sc_xfer[sc->sc_last_xfer_index]); } else { - ccb->ccb_h.status = CAM_TID_INVALID; - xpt_done(ccb); + umass_cancel_ccb(sc); } } From owner-svn-src-all@FreeBSD.ORG Tue Sep 18 16:49:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 22D2D106567F; Tue, 18 Sep 2012 16:49:57 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D9D368FC1C; Tue, 18 Sep 2012 16:49:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8IGnvAZ027508; Tue, 18 Sep 2012 16:49:57 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8IGnvmK027506; Tue, 18 Sep 2012 16:49:57 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201209181649.q8IGnvmK027506@svn.freebsd.org> From: Glen Barber Date: Tue, 18 Sep 2012 16:49:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240663 - stable/9/release/doc/en_US.ISO8859-1/installation X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Sep 2012 16:49:58 -0000 Author: gjb (doc,ports committer) Date: Tue Sep 18 16:49:57 2012 New Revision: 240663 URL: http://svn.freebsd.org/changeset/base/240663 Log: Convert installation article to XML stanards. This commit should be the final fix for the 9-STABLE release build. This is a direct commit to stable/9. Modified: stable/9/release/doc/en_US.ISO8859-1/installation/article.sgml Modified: stable/9/release/doc/en_US.ISO8859-1/installation/article.sgml ============================================================================== --- stable/9/release/doc/en_US.ISO8859-1/installation/article.sgml Tue Sep 18 16:39:04 2012 (r240662) +++ stable/9/release/doc/en_US.ISO8859-1/installation/article.sgml Tue Sep 18 16:49:57 2012 (r240663) @@ -1,9 +1,15 @@ - -%articles.ent; + + +%entities; %release; + + + + + ]>
From owner-svn-src-all@FreeBSD.ORG Tue Sep 18 17:03:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 087F31065701; Tue, 18 Sep 2012 17:03:33 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E1CEA8FC15; Tue, 18 Sep 2012 17:03:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8IH3WVB029256; Tue, 18 Sep 2012 17:03:32 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8IH3WhV029251; Tue, 18 Sep 2012 17:03:32 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201209181703.q8IH3WhV029251@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 18 Sep 2012 17:03:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240664 - in stable/9/sys/dev/usb: . quirk serial X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Sep 2012 17:03:33 -0000 Author: hselasky Date: Tue Sep 18 17:03:32 2012 New Revision: 240664 URL: http://svn.freebsd.org/changeset/base/240664 Log: MFC r237079, r238078, r238779, r238803, r238804, r239055, r239298, r239358 and r239567: Add new USB ID's and some quirks. Modified: stable/9/sys/dev/usb/quirk/usb_quirk.c stable/9/sys/dev/usb/serial/uftdi.c stable/9/sys/dev/usb/serial/uftdi_reg.h stable/9/sys/dev/usb/usbdevs Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- stable/9/sys/dev/usb/quirk/usb_quirk.c Tue Sep 18 16:49:57 2012 (r240663) +++ stable/9/sys/dev/usb/quirk/usb_quirk.c Tue Sep 18 17:03:32 2012 (r240664) @@ -125,6 +125,8 @@ static struct usb_quirk_entry usb_quirks /* MS keyboards do weird things */ USB_QUIRK(MICROSOFT, NATURAL4000, 0x0000, 0xFFFF, UQ_KBD_BOOTPROTO), USB_QUIRK(MICROSOFT, WLINTELLIMOUSE, 0x0000, 0xffff, UQ_MS_LEADING_BYTE), + /* Quirk for Corsair Vengeance K60 keyboard */ + USB_QUIRK(CORSAIR, K60, 0x0000, 0xffff, UQ_KBD_BOOTPROTO), /* umodem(4) device quirks */ USB_QUIRK(METRICOM, RICOCHET_GS, 0x100, 0x100, UQ_ASSUME_CM_OVER_DATA), USB_QUIRK(SANYO, SCP4900, 0x000, 0x000, UQ_ASSUME_CM_OVER_DATA), @@ -438,6 +440,9 @@ static struct usb_quirk_entry usb_quirks USB_QUIRK(MEIZU, M6_SL, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_INQUIRY, UQ_MSC_NO_SYNC_CACHE), + USB_QUIRK(TOSHIBA, TRANSMEMORY, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE), + USB_QUIRK(VIALABS, USB30SATABRIDGE, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE), + /* Non-standard USB MIDI devices */ USB_QUIRK(ROLAND, UM1, 0x0000, 0xffff, UQ_AU_VENDOR_CLASS), USB_QUIRK(ROLAND, SC8850, 0x0000, 0xffff, UQ_AU_VENDOR_CLASS), @@ -455,7 +460,13 @@ static struct usb_quirk_entry usb_quirks USB_QUIRK(ROLAND, SD20, 0x0000, 0xffff, UQ_AU_VENDOR_CLASS), USB_QUIRK(ROLAND, SD80, 0x0000, 0xffff, UQ_AU_VENDOR_CLASS), USB_QUIRK(ROLAND, UA700, 0x0000, 0xffff, UQ_AU_VENDOR_CLASS), + USB_QUIRK(EGO, M4U, 0x0000, 0xffff, UQ_SINGLE_CMD_MIDI), + USB_QUIRK(LOGILINK, U2M, 0x0000, 0xffff, UQ_SINGLE_CMD_MIDI), USB_QUIRK(MEDELI, DD305, 0x0000, 0xffff, UQ_SINGLE_CMD_MIDI, UQ_MATCH_VENDOR_ONLY), + USB_QUIRK(REDOCTANE, GHMIDI, 0x0000, 0xffff, UQ_SINGLE_CMD_MIDI), + USB_QUIRK(TEXTECH, U2M_1, 0x0000, 0xffff, UQ_SINGLE_CMD_MIDI), + USB_QUIRK(TEXTECH, U2M_2, 0x0000, 0xffff, UQ_SINGLE_CMD_MIDI), + USB_QUIRK(WCH2, U2M, 0x0000, 0xffff, UQ_SINGLE_CMD_MIDI), /* * Quirks for manufacturers which USB devices does not respond Modified: stable/9/sys/dev/usb/serial/uftdi.c ============================================================================== --- stable/9/sys/dev/usb/serial/uftdi.c Tue Sep 18 16:49:57 2012 (r240663) +++ stable/9/sys/dev/usb/serial/uftdi.c Tue Sep 18 17:03:32 2012 (r240664) @@ -209,53 +209,635 @@ MODULE_VERSION(uftdi, 1); static const STRUCT_USB_HOST_ID uftdi_devs[] = { #define UFTDI_DEV(v, p, i) \ { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, i) } + UFTDI_DEV(ACTON, SPECTRAPRO, UFTDI_TYPE_AUTO), + UFTDI_DEV(ALTI2, N3, UFTDI_TYPE_AUTO), + UFTDI_DEV(ANALOGDEVICES, GNICE, UFTDI_TYPE_AUTO | UFTDI_FLAG_JTAG), + UFTDI_DEV(ANALOGDEVICES, GNICEPLUS, UFTDI_TYPE_AUTO | UFTDI_FLAG_JTAG), UFTDI_DEV(ATMEL, STK541, UFTDI_TYPE_8U232AM), + UFTDI_DEV(BAYER, CONTOUR_CABLE, UFTDI_TYPE_AUTO), + UFTDI_DEV(BBELECTRONICS, 232USB9M, UFTDI_TYPE_AUTO), + UFTDI_DEV(BBELECTRONICS, 485USB9F_2W, UFTDI_TYPE_AUTO), + UFTDI_DEV(BBELECTRONICS, 485USB9F_4W, UFTDI_TYPE_AUTO), + UFTDI_DEV(BBELECTRONICS, 485USBTB_2W, UFTDI_TYPE_AUTO), + UFTDI_DEV(BBELECTRONICS, 485USBTB_4W, UFTDI_TYPE_AUTO), + UFTDI_DEV(BBELECTRONICS, TTL3USB9M, UFTDI_TYPE_AUTO), + UFTDI_DEV(BBELECTRONICS, TTL5USB9M, UFTDI_TYPE_AUTO), + UFTDI_DEV(BBELECTRONICS, USO9ML2, UFTDI_TYPE_AUTO), + UFTDI_DEV(BBELECTRONICS, USO9ML2DR, UFTDI_TYPE_AUTO), + UFTDI_DEV(BBELECTRONICS, USO9ML2DR_2, UFTDI_TYPE_AUTO), + UFTDI_DEV(BBELECTRONICS, USOPTL4, UFTDI_TYPE_AUTO), + UFTDI_DEV(BBELECTRONICS, USOPTL4DR, UFTDI_TYPE_AUTO), + UFTDI_DEV(BBELECTRONICS, USOPTL4DR2, UFTDI_TYPE_AUTO), UFTDI_DEV(BBELECTRONICS, USOTL4, UFTDI_TYPE_8U232AM), - UFTDI_DEV(DRESDENELEKTRONIK, SENSORTERMINALBOARD, - UFTDI_TYPE_8U232AM), - UFTDI_DEV(DRESDENELEKTRONIK, WIRELESSHANDHELDTERMINAL, - UFTDI_TYPE_8U232AM), + UFTDI_DEV(BBELECTRONICS, USPTL4, UFTDI_TYPE_AUTO), + UFTDI_DEV(BBELECTRONICS, USTL4, UFTDI_TYPE_AUTO), + UFTDI_DEV(BBELECTRONICS, ZZ_PROG1_USB, UFTDI_TYPE_AUTO), + UFTDI_DEV(CONTEC, COM1USBH, UFTDI_TYPE_AUTO), + UFTDI_DEV(DRESDENELEKTRONIK, SENSORTERMINALBOARD, UFTDI_TYPE_8U232AM), + UFTDI_DEV(DRESDENELEKTRONIK, WIRELESSHANDHELDTERMINAL, UFTDI_TYPE_8U232AM), + UFTDI_DEV(ELEKTOR, FT323R, UFTDI_TYPE_AUTO), + UFTDI_DEV(EVOLUTION, ER1, UFTDI_TYPE_AUTO), + UFTDI_DEV(EVOLUTION, HYBRID, UFTDI_TYPE_AUTO), + UFTDI_DEV(EVOLUTION, RCM4, UFTDI_TYPE_AUTO), + UFTDI_DEV(FALCOM, SAMBA, UFTDI_TYPE_AUTO), UFTDI_DEV(FALCOM, TWIST, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FIC, NEO1973_DEBUG, UFTDI_TYPE_AUTO | UFTDI_FLAG_JTAG), + UFTDI_DEV(FIC, NEO1973_DEBUG, UFTDI_TYPE_AUTO | UFTDI_FLAG_JTAG), + UFTDI_DEV(FTDI, 232H, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, 232RL, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, 4N_GALAXY_DE_1, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, 4N_GALAXY_DE_2, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, 4N_GALAXY_DE_3, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, 8U232AM_ALT, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, ACCESSO, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, ACG_HFDUAL, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, ACTIVE_ROBOTS, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, ACTZWAVE, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, AMC232, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, ARTEMIS, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, ASK_RDR400, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, ATIK_ATK16, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, ATIK_ATK16C, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, ATIK_ATK16HR, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, ATIK_ATK16HRC, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, ATIK_ATK16IC, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, BCS_SE923, UFTDI_TYPE_AUTO), UFTDI_DEV(FTDI, BEAGLEBONE, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, CANDAPTER, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, CANUSB, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, CCSICDU20_0, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, CCSICDU40_1, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, CCSICDU64_4, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, CCSLOAD_N_GO_3, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, CCSMACHX_2, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, CCSPRIME8_5, UFTDI_TYPE_AUTO), UFTDI_DEV(FTDI, CFA_631, UFTDI_TYPE_8U232AM), UFTDI_DEV(FTDI, CFA_632, UFTDI_TYPE_8U232AM), UFTDI_DEV(FTDI, CFA_633, UFTDI_TYPE_8U232AM), UFTDI_DEV(FTDI, CFA_634, UFTDI_TYPE_8U232AM), UFTDI_DEV(FTDI, CFA_635, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, CHAMSYS_24_MASTER_WING, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, CHAMSYS_MAXI_WING, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, CHAMSYS_MEDIA_WING, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, CHAMSYS_MIDI_TIMECODE, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, CHAMSYS_MINI_WING, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, CHAMSYS_PC_WING, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, CHAMSYS_USB_DMX, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, CHAMSYS_WING, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, COM4SM, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, CONVERTER_0, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, CONVERTER_1, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, CONVERTER_2, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, CONVERTER_3, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, CONVERTER_4, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, CONVERTER_5, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, CONVERTER_6, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, CONVERTER_7, UFTDI_TYPE_AUTO), UFTDI_DEV(FTDI, CTI_USB_MINI_485, UFTDI_TYPE_8U232AM), UFTDI_DEV(FTDI, CTI_USB_NANO_485, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, DMX4ALL, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, DOMINTELL_DGQG, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, DOMINTELL_DUSB, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, DOTEC, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, ECLO_COM_1WIRE, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, ECO_PRO_CDS, UFTDI_TYPE_AUTO), UFTDI_DEV(FTDI, EISCOU, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, ELSTER_UNICOM, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, ELV_ALC8500, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, ELV_CLI7000, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, ELV_CSI8, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, ELV_EC3000, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, ELV_EM1000DL, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, ELV_EM1010PC, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, ELV_FEM, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, ELV_FHZ1000PC, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, ELV_FHZ1300PC, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, ELV_FM3RX, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, ELV_FS20SIG, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, ELV_HS485, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, ELV_KL100, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, ELV_MSM1, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, ELV_PCD200, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, ELV_PCK100, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, ELV_PPS7330, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, ELV_RFP500, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, ELV_T1100, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, ELV_TFD128, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, ELV_TFM100, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, ELV_TWS550, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, ELV_UAD8, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, ELV_UDA7, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, ELV_UDF77, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, ELV_UIO88, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, ELV_ULA200, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, ELV_UM100, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, ELV_UMS100, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, ELV_UO100, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, ELV_UR100, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, ELV_USI2, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, ELV_USR, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, ELV_UTP8, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, ELV_WS300PC, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, ELV_WS444PC, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, ELV_WS500, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, ELV_WS550, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, ELV_WS777, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, ELV_WS888, UFTDI_TYPE_AUTO), UFTDI_DEV(FTDI, EMCU2D, UFTDI_TYPE_8U232AM), UFTDI_DEV(FTDI, EMCU2H, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, FUTURE_0, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, FUTURE_1, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, FUTURE_2, UFTDI_TYPE_AUTO), UFTDI_DEV(FTDI, GAMMASCOUT, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, GENERIC, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, GUDEADS_E808, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, GUDEADS_E809, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, GUDEADS_E80A, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, GUDEADS_E80B, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, GUDEADS_E80C, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, GUDEADS_E80D, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, GUDEADS_E80E, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, GUDEADS_E80F, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, GUDEADS_E88D, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, GUDEADS_E88E, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, GUDEADS_E88F, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, HD_RADIO, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, HO720, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, HO730, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, HO820, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, HO870, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, IBS_APP70, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, IBS_PCMCIA, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, IBS_PEDO, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, IBS_PICPRO, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, IBS_PK1, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, IBS_PROD, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, IBS_RS232MON, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, IBS_US485, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, IPLUS, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, IPLUS2, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, IRTRANS, UFTDI_TYPE_AUTO), UFTDI_DEV(FTDI, KBS, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, LENZ_LIUSB, UFTDI_TYPE_AUTO), UFTDI_DEV(FTDI, LK202, UFTDI_TYPE_8U232AM), UFTDI_DEV(FTDI, LK204, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, LM3S_DEVEL_BOARD, UFTDI_TYPE_AUTO | UFTDI_FLAG_JTAG), + UFTDI_DEV(FTDI, LM3S_EVAL_BOARD, UFTDI_TYPE_AUTO | UFTDI_FLAG_JTAG), + UFTDI_DEV(FTDI, MASTERDEVEL2, UFTDI_TYPE_AUTO), UFTDI_DEV(FTDI, MAXSTREAM, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, MHAM_DB9, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, MHAM_IC, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, MHAM_KW, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, MHAM_RS232, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, MHAM_Y6, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, MHAM_Y8, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, MHAM_Y9, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, MHAM_YS, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, MICRO_CHAMELEON, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, MTXORB_5, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, MTXORB_6, UFTDI_TYPE_AUTO), UFTDI_DEV(FTDI, MX2_3, UFTDI_TYPE_8U232AM), UFTDI_DEV(FTDI, MX4_5, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, NXTCAM, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, OCEANIC, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, OOCDLINK, UFTDI_TYPE_AUTO | UFTDI_FLAG_JTAG), + UFTDI_DEV(FTDI, OPENDCC, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, OPENDCC_GATEWAY, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, OPENDCC_GBM, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, OPENDCC_SNIFFER, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, OPENDCC_THROTTLE, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, PCDJ_DAC2, UFTDI_TYPE_AUTO), UFTDI_DEV(FTDI, PCMSFU, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, PERLE_ULTRAPORT, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, PHI_FISCO, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, PIEGROUP, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, PROPOX_JTAGCABLEII, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, R2000KU_TRUE_RNG, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, R2X0, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, RELAIS, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, REU_TINY, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, RMP200, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, RM_CANVIEW, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, RRCIRKITS_LOCOBUFFER, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, SCIENCESCOPE_HS_LOGBOOK, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, SCIENCESCOPE_LOGBOOKML, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, SCIENCESCOPE_LS_LOGBOOK, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, SCS_DEVICE_0, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, SCS_DEVICE_1, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, SCS_DEVICE_2, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, SCS_DEVICE_3, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, SCS_DEVICE_4, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, SCS_DEVICE_5, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, SCS_DEVICE_6, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, SCS_DEVICE_7, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, SDMUSBQSS, UFTDI_TYPE_AUTO), UFTDI_DEV(FTDI, SEMC_DSS20, UFTDI_TYPE_8U232AM), UFTDI_DEV(FTDI, SERIAL_2232C, UFTDI_TYPE_8U232AM), UFTDI_DEV(FTDI, SERIAL_2232D, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, SERIAL_232RL, UFTDI_TYPE_AUTO), UFTDI_DEV(FTDI, SERIAL_4232H, UFTDI_TYPE_8U232AM), UFTDI_DEV(FTDI, SERIAL_8U100AX, UFTDI_TYPE_SIO), UFTDI_DEV(FTDI, SERIAL_8U232AM, UFTDI_TYPE_8U232AM), UFTDI_DEV(FTDI, SERIAL_8U232AM4, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, SIGNALYZER_SH2, UFTDI_TYPE_AUTO | UFTDI_FLAG_JTAG), + UFTDI_DEV(FTDI, SIGNALYZER_SH4, UFTDI_TYPE_AUTO | UFTDI_FLAG_JTAG), + UFTDI_DEV(FTDI, SIGNALYZER_SLITE, UFTDI_TYPE_AUTO | UFTDI_FLAG_JTAG), + UFTDI_DEV(FTDI, SIGNALYZER_ST, UFTDI_TYPE_AUTO | UFTDI_FLAG_JTAG), + UFTDI_DEV(FTDI, SPECIAL_1, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, SPECIAL_3, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, SPECIAL_4, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, SPROG_II, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, SR_RADIO, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, SUUNTO_SPORTS, UFTDI_TYPE_AUTO), UFTDI_DEV(FTDI, TACTRIX_OPENPORT_13M, UFTDI_TYPE_8U232AM), UFTDI_DEV(FTDI, TACTRIX_OPENPORT_13S, UFTDI_TYPE_8U232AM), UFTDI_DEV(FTDI, TACTRIX_OPENPORT_13U, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, TAVIR_STK500, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, TERATRONIK_D2XX, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, TERATRONIK_VCP, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, THORLABS, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, TNC_X, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, TTUSB, UFTDI_TYPE_AUTO), UFTDI_DEV(FTDI, TURTELIZER2, UFTDI_TYPE_8U232AM | UFTDI_FLAG_JTAG), UFTDI_DEV(FTDI, UOPTBR, UFTDI_TYPE_8U232AM), UFTDI_DEV(FTDI, USBSERIAL, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, USBX_707, UFTDI_TYPE_AUTO), UFTDI_DEV(FTDI, USB_UIRT, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, USINT_CAT, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, USINT_RS232, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, USINT_WKEY, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, VARDAAN, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, VNHCPCUSB_D, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, WESTREX_MODEL_777, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, WESTREX_MODEL_8900F, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, XF_547, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, XF_640, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, XF_642, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, XM_RADIO, UFTDI_TYPE_AUTO), + UFTDI_DEV(FTDI, YEI_SERVOCENTER31, UFTDI_TYPE_AUTO), + UFTDI_DEV(GNOTOMETRICS, USB, UFTDI_TYPE_AUTO), + UFTDI_DEV(ICOM, SP1, UFTDI_TYPE_AUTO), + UFTDI_DEV(ICOM, OPC_U_UC, UFTDI_TYPE_AUTO), + UFTDI_DEV(ICOM, RP2C1, UFTDI_TYPE_AUTO), + UFTDI_DEV(ICOM, RP2C2, UFTDI_TYPE_AUTO), + UFTDI_DEV(ICOM, RP2D, UFTDI_TYPE_AUTO), + UFTDI_DEV(ICOM, RP2KVR, UFTDI_TYPE_AUTO), + UFTDI_DEV(ICOM, RP2KVT, UFTDI_TYPE_AUTO), + UFTDI_DEV(ICOM, RP2VR, UFTDI_TYPE_AUTO), + UFTDI_DEV(ICOM, RP2VT, UFTDI_TYPE_AUTO), + UFTDI_DEV(ICOM, RP4KVR, UFTDI_TYPE_AUTO), + UFTDI_DEV(ICOM, RP4KVT, UFTDI_TYPE_AUTO), + UFTDI_DEV(IDTECH, IDT1221U, UFTDI_TYPE_AUTO), + UFTDI_DEV(INTERBIOMETRICS, IOBOARD, UFTDI_TYPE_AUTO), + UFTDI_DEV(INTERBIOMETRICS, MINI_IOBOARD, UFTDI_TYPE_AUTO), UFTDI_DEV(INTREPIDCS, NEOVI, UFTDI_TYPE_8U232AM), UFTDI_DEV(INTREPIDCS, VALUECAN, UFTDI_TYPE_8U232AM), + UFTDI_DEV(IONICS, PLUGCOMPUTER, UFTDI_TYPE_AUTO | UFTDI_FLAG_JTAG), + UFTDI_DEV(JETI, SPC1201, UFTDI_TYPE_AUTO), + UFTDI_DEV(KOBIL, CONV_B1, UFTDI_TYPE_AUTO), + UFTDI_DEV(KOBIL, CONV_KAAN, UFTDI_TYPE_AUTO), + UFTDI_DEV(LARSENBRUSGAARD, ALTITRACK, UFTDI_TYPE_AUTO), UFTDI_DEV(MARVELL, SHEEVAPLUG, UFTDI_TYPE_8U232AM), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0100, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0101, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0102, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0103, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0104, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0105, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0106, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0107, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0108, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0109, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_010A, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_010B, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_010C, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_010D, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_010E, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_010F, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0110, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0111, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0112, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0113, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0114, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0115, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0116, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0117, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0118, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0119, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_011A, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_011B, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_011C, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_011D, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_011E, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_011F, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0120, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0121, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0122, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0123, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0124, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0125, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0126, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0128, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0129, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_012A, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_012B, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_012D, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_012E, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_012F, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0130, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0131, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0132, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0133, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0134, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0135, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0136, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0137, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0138, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0139, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_013A, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_013B, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_013C, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_013D, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_013E, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_013F, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0140, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0141, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0142, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0143, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0144, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0145, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0146, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0147, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0148, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0149, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_014A, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_014B, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_014C, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_014D, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_014E, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_014F, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0150, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0151, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0152, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0159, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_015A, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_015B, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_015C, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_015D, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_015E, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_015F, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0160, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0161, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0162, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0163, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0164, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0165, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0166, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0167, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0168, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0169, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_016A, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_016B, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_016C, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_016D, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_016E, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_016F, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0170, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0171, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0172, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0173, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0174, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0175, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0176, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0177, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0178, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0179, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_017A, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_017B, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_017C, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_017D, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_017E, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_017F, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0180, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0181, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0182, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0183, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0184, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0185, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0186, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0187, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0188, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0189, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_018A, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_018B, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_018C, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_018D, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_018E, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_018F, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0190, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0191, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0192, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0193, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0194, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0195, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0196, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0197, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0198, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0199, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_019A, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_019B, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_019C, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_019D, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_019E, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_019F, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01A0, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01A1, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01A2, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01A3, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01A4, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01A5, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01A6, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01A7, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01A8, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01A9, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01AA, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01AB, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01AC, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01AD, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01AE, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01AF, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01B0, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01B1, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01B2, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01B3, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01B4, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01B5, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01B6, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01B7, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01B8, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01B9, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01BA, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01BB, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01BC, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01BD, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01BE, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01BF, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01C0, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01C1, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01C2, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01C3, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01C4, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01C5, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01C6, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01C7, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01C8, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01C9, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01CA, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01CB, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01CC, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01CD, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01CE, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01CF, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01D0, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01D1, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01D2, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01D3, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01D4, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01D5, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01D6, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01D7, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01D8, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01D9, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01DA, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01DB, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01DC, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01DD, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01DE, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01DF, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01E0, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01E1, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01E2, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01E3, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01E4, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01E5, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01E6, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01E7, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01E8, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01E9, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01EA, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01EB, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01EC, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01ED, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01EE, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01EF, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01F0, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01F1, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01F2, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01F3, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01F4, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01F5, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01F6, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01F7, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01F8, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01F9, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01FA, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01FB, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01FC, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01FD, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01FE, UFTDI_TYPE_AUTO), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01FF, UFTDI_TYPE_AUTO), UFTDI_DEV(MATRIXORBITAL, MOUA, UFTDI_TYPE_8U232AM), UFTDI_DEV(MELCO, PCOPRS1, UFTDI_TYPE_8U232AM), + UFTDI_DEV(METAGEEK, TELLSTICK, UFTDI_TYPE_AUTO), + UFTDI_DEV(MOBILITY, USB_SERIAL, UFTDI_TYPE_AUTO), + UFTDI_DEV(OLIMEX, ARM_USB_OCD, UFTDI_TYPE_AUTO | UFTDI_FLAG_JTAG), + UFTDI_DEV(OLIMEX, ARM_USB_OCD_H, UFTDI_TYPE_AUTO | UFTDI_FLAG_JTAG), + UFTDI_DEV(PAPOUCH, AD4USB, UFTDI_TYPE_AUTO), + UFTDI_DEV(PAPOUCH, AP485, UFTDI_TYPE_AUTO), + UFTDI_DEV(PAPOUCH, AP485_2, UFTDI_TYPE_AUTO), + UFTDI_DEV(PAPOUCH, DRAK5, UFTDI_TYPE_AUTO), + UFTDI_DEV(PAPOUCH, DRAK6, UFTDI_TYPE_AUTO), + UFTDI_DEV(PAPOUCH, GMSR, UFTDI_TYPE_AUTO), + UFTDI_DEV(PAPOUCH, GMUX, UFTDI_TYPE_AUTO), + UFTDI_DEV(PAPOUCH, IRAMP, UFTDI_TYPE_AUTO), + UFTDI_DEV(PAPOUCH, LEC, UFTDI_TYPE_AUTO), + UFTDI_DEV(PAPOUCH, MU, UFTDI_TYPE_AUTO), + UFTDI_DEV(PAPOUCH, QUIDO10X1, UFTDI_TYPE_AUTO), + UFTDI_DEV(PAPOUCH, QUIDO2X16, UFTDI_TYPE_AUTO), + UFTDI_DEV(PAPOUCH, QUIDO2X2, UFTDI_TYPE_AUTO), + UFTDI_DEV(PAPOUCH, QUIDO30X3, UFTDI_TYPE_AUTO), + UFTDI_DEV(PAPOUCH, QUIDO3X32, UFTDI_TYPE_AUTO), + UFTDI_DEV(PAPOUCH, QUIDO4X4, UFTDI_TYPE_AUTO), + UFTDI_DEV(PAPOUCH, QUIDO60X3, UFTDI_TYPE_AUTO), + UFTDI_DEV(PAPOUCH, QUIDO8X8, UFTDI_TYPE_AUTO), + UFTDI_DEV(PAPOUCH, SB232, UFTDI_TYPE_AUTO), + UFTDI_DEV(PAPOUCH, SB422, UFTDI_TYPE_AUTO), + UFTDI_DEV(PAPOUCH, SB422_2, UFTDI_TYPE_AUTO), + UFTDI_DEV(PAPOUCH, SB485, UFTDI_TYPE_AUTO), + UFTDI_DEV(PAPOUCH, SB485C, UFTDI_TYPE_AUTO), + UFTDI_DEV(PAPOUCH, SB485S, UFTDI_TYPE_AUTO), + UFTDI_DEV(PAPOUCH, SB485_2, UFTDI_TYPE_AUTO), + UFTDI_DEV(PAPOUCH, SIMUKEY, UFTDI_TYPE_AUTO), + UFTDI_DEV(PAPOUCH, TMU, UFTDI_TYPE_AUTO), + UFTDI_DEV(PAPOUCH, UPSUSB, UFTDI_TYPE_AUTO), + UFTDI_DEV(POSIFLEX, PP7000, UFTDI_TYPE_AUTO), + UFTDI_DEV(QIHARDWARE, JTAGSERIAL, UFTDI_TYPE_AUTO | UFTDI_FLAG_JTAG), UFTDI_DEV(RATOC, REXUSB60F, UFTDI_TYPE_8U232AM), - UFTDI_DEV(SIIG2, US2308, UFTDI_TYPE_8U232AM) + UFTDI_DEV(RTSYSTEMS, CT29B, UFTDI_TYPE_AUTO), + UFTDI_DEV(RTSYSTEMS, SERIAL_VX7, UFTDI_TYPE_AUTO), + UFTDI_DEV(SEALEVEL, 2101, UFTDI_TYPE_AUTO), + UFTDI_DEV(SEALEVEL, 2102, UFTDI_TYPE_AUTO), + UFTDI_DEV(SEALEVEL, 2103, UFTDI_TYPE_AUTO), + UFTDI_DEV(SEALEVEL, 2104, UFTDI_TYPE_AUTO), + UFTDI_DEV(SEALEVEL, 2106, UFTDI_TYPE_AUTO), + UFTDI_DEV(SEALEVEL, 2201_1, UFTDI_TYPE_AUTO), + UFTDI_DEV(SEALEVEL, 2201_2, UFTDI_TYPE_AUTO), + UFTDI_DEV(SEALEVEL, 2202_1, UFTDI_TYPE_AUTO), + UFTDI_DEV(SEALEVEL, 2202_2, UFTDI_TYPE_AUTO), + UFTDI_DEV(SEALEVEL, 2203_1, UFTDI_TYPE_AUTO), + UFTDI_DEV(SEALEVEL, 2203_2, UFTDI_TYPE_AUTO), + UFTDI_DEV(SEALEVEL, 2401_1, UFTDI_TYPE_AUTO), + UFTDI_DEV(SEALEVEL, 2401_2, UFTDI_TYPE_AUTO), + UFTDI_DEV(SEALEVEL, 2401_3, UFTDI_TYPE_AUTO), + UFTDI_DEV(SEALEVEL, 2401_4, UFTDI_TYPE_AUTO), + UFTDI_DEV(SEALEVEL, 2402_1, UFTDI_TYPE_AUTO), + UFTDI_DEV(SEALEVEL, 2402_2, UFTDI_TYPE_AUTO), + UFTDI_DEV(SEALEVEL, 2402_3, UFTDI_TYPE_AUTO), + UFTDI_DEV(SEALEVEL, 2402_4, UFTDI_TYPE_AUTO), + UFTDI_DEV(SEALEVEL, 2403_1, UFTDI_TYPE_AUTO), + UFTDI_DEV(SEALEVEL, 2403_2, UFTDI_TYPE_AUTO), + UFTDI_DEV(SEALEVEL, 2403_3, UFTDI_TYPE_AUTO), + UFTDI_DEV(SEALEVEL, 2403_4, UFTDI_TYPE_AUTO), + UFTDI_DEV(SEALEVEL, 2801_1, UFTDI_TYPE_AUTO), + UFTDI_DEV(SEALEVEL, 2801_2, UFTDI_TYPE_AUTO), + UFTDI_DEV(SEALEVEL, 2801_3, UFTDI_TYPE_AUTO), + UFTDI_DEV(SEALEVEL, 2801_4, UFTDI_TYPE_AUTO), + UFTDI_DEV(SEALEVEL, 2801_5, UFTDI_TYPE_AUTO), + UFTDI_DEV(SEALEVEL, 2801_6, UFTDI_TYPE_AUTO), + UFTDI_DEV(SEALEVEL, 2801_7, UFTDI_TYPE_AUTO), + UFTDI_DEV(SEALEVEL, 2801_8, UFTDI_TYPE_AUTO), + UFTDI_DEV(SEALEVEL, 2802_1, UFTDI_TYPE_AUTO), + UFTDI_DEV(SEALEVEL, 2802_2, UFTDI_TYPE_AUTO), + UFTDI_DEV(SEALEVEL, 2802_3, UFTDI_TYPE_AUTO), + UFTDI_DEV(SEALEVEL, 2802_4, UFTDI_TYPE_AUTO), + UFTDI_DEV(SEALEVEL, 2802_5, UFTDI_TYPE_AUTO), + UFTDI_DEV(SEALEVEL, 2802_6, UFTDI_TYPE_AUTO), + UFTDI_DEV(SEALEVEL, 2802_7, UFTDI_TYPE_AUTO), + UFTDI_DEV(SEALEVEL, 2802_8, UFTDI_TYPE_AUTO), + UFTDI_DEV(SEALEVEL, 2803_1, UFTDI_TYPE_AUTO), + UFTDI_DEV(SEALEVEL, 2803_2, UFTDI_TYPE_AUTO), + UFTDI_DEV(SEALEVEL, 2803_3, UFTDI_TYPE_AUTO), + UFTDI_DEV(SEALEVEL, 2803_4, UFTDI_TYPE_AUTO), + UFTDI_DEV(SEALEVEL, 2803_5, UFTDI_TYPE_AUTO), + UFTDI_DEV(SEALEVEL, 2803_6, UFTDI_TYPE_AUTO), + UFTDI_DEV(SEALEVEL, 2803_7, UFTDI_TYPE_AUTO), + UFTDI_DEV(SEALEVEL, 2803_8, UFTDI_TYPE_AUTO), + UFTDI_DEV(SIIG2, DK201, UFTDI_TYPE_AUTO), + UFTDI_DEV(SIIG2, US2308, UFTDI_TYPE_8U232AM), + UFTDI_DEV(TESTO, USB_INTERFACE, UFTDI_TYPE_AUTO), + UFTDI_DEV(TML, USB_SERIAL, UFTDI_TYPE_AUTO), + UFTDI_DEV(TTI, QL355P, UFTDI_TYPE_AUTO), + UFTDI_DEV(UNKNOWN4, NF_RIC, UFTDI_TYPE_AUTO), #undef UFTDI_DEV }; @@ -312,6 +894,17 @@ uftdi_attach(device_t dev) sc->sc_type = USB_GET_DRIVER_INFO(uaa) & UFTDI_TYPE_MASK; switch (sc->sc_type) { + case UFTDI_TYPE_AUTO: + /* simplified type check */ + if (uaa->info.bcdDevice >= 0x0200 || + usbd_get_iface(uaa->device, 1) != NULL) { + sc->sc_type = UFTDI_TYPE_8U232AM; + sc->sc_hdrlen = 0; + } else { + sc->sc_type = UFTDI_TYPE_SIO; + sc->sc_hdrlen = 1; + } + break; case UFTDI_TYPE_SIO: sc->sc_hdrlen = 1; break; Modified: stable/9/sys/dev/usb/serial/uftdi_reg.h ============================================================================== --- stable/9/sys/dev/usb/serial/uftdi_reg.h Tue Sep 18 16:49:57 2012 (r240663) +++ stable/9/sys/dev/usb/serial/uftdi_reg.h Tue Sep 18 17:03:32 2012 (r240664) @@ -39,6 +39,7 @@ #define UFTDI_TYPE_MASK 0x000000ff #define UFTDI_TYPE_SIO 0x00000001 #define UFTDI_TYPE_8U232AM 0x00000002 +#define UFTDI_TYPE_AUTO (UFTDI_TYPE_SIO | UFTDI_TYPE_8U232AM) #define UFTDI_FLAG_MASK 0x0000ff00 #define UFTDI_FLAG_JTAG 0x00000100 Modified: stable/9/sys/dev/usb/usbdevs ============================================================================== --- stable/9/sys/dev/usb/usbdevs Tue Sep 18 16:49:57 2012 (r240663) +++ stable/9/sys/dev/usb/usbdevs Tue Sep 18 17:03:32 2012 (r240664) @@ -322,6 +322,7 @@ vendor VIVITAR 0x0636 Vivitar vendor GUNZE 0x0637 Gunze Electronics USA vendor AVISION 0x0638 Avision vendor TEAC 0x0644 TEAC +vendor ACTON 0x0647 Acton Research Corp. vendor SGI 0x065e Silicon Graphics vendor SANWASUPPLY 0x0663 Sanwa Supply vendor MEGATEC 0x0665 Megatec @@ -346,6 +347,7 @@ vendor AGFA 0x06bd AGFA-Gevaert vendor ASIAMD 0x06be Asia Microelectronic Development vendor BIZLINK 0x06c4 Bizlink International vendor KEYSPAN 0x06cd Keyspan / InnoSys Inc. +vendor CONTEC 0x06ce Contec products vendor AASHIMA 0x06d6 Aashima Technology vendor LIEBERT 0x06da Liebert vendor MULTITECH 0x06e0 MultiTech @@ -487,7 +489,9 @@ vendor BROADCOM 0x0a5c Broadcom vendor GREENHOUSE 0x0a6b GREENHOUSE vendor MEDELI 0x0a67 Medeli vendor GEOCAST 0x0a79 Geocast Network Systems -vendor IDQUANTIQUE 0x0aba id Quantique +vendor EGO 0x0a92 EGO systems +vendor IDQUANTIQUE 0x0aba ID Quantique +vendor IDTECH 0x0acd ID TECH vendor ZYDAS 0x0ace Zydas Technology Corporation vendor NEODIO 0x0aec Neodio vendor OPTION 0x0af0 Option N.V. @@ -514,14 +518,20 @@ vendor ADDONICS2 0x0bf6 Addonics Technol vendor FSC 0x0bf8 Fujitsu Siemens Computers vendor AGATE 0x0c08 Agate Technologies vendor DMI 0x0c0b DMI +vendor ICOM 0x0c26 Icom Inc. +vendor GNOTOMETRICS 0x0c33 GN Otometrics vendor CHICONY2 0x0c45 Chicony vendor REINERSCT 0x0c4b Reiner-SCT vendor SEALEVEL 0x0c52 Sealevel System +vendor JETI 0x0c6c Jeti vendor LUWEN 0x0c76 Luwen +vendor ELEKTOR 0x0c7d ELEKTOR Electronics vendor KYOCERA2 0x0c88 Kyocera Wireless Corp. vendor ZCOM 0x0cde Z-Com vendor ATHEROS2 0x0cf3 Atheros Communications +vendor POSIFLEX 0x0d3a POSIFLEX vendor TANGTOP 0x0d3d Tangtop +vendor KOBIL 0x0d46 KOBIL vendor SMC3 0x0d5c Standard Microsystems vendor ADDON 0x0d7d Add-on Technology vendor ACDC 0x0d7e American Computer & Digital Components @@ -530,6 +540,7 @@ vendor CONCEPTRONIC 0x0d8e Conceptronic vendor SKANHEX 0x0d96 Skanhex Technology, Inc. vendor MSI 0x0db0 Micro Star International vendor ELCON 0x0db7 ELCON Systemtechnik +vendor UNKNOWN4 0x0dcd Unknown vendor vendor NETAC 0x0dd8 Netac vendor SITECOMEU 0x0df6 Sitecom Europe vendor MOBILEACTION 0x0df7 Mobile Action @@ -553,6 +564,7 @@ vendor VTECH 0x0f88 VTech vendor FALCOM 0x0f94 Falcom Wireless Communications GmbH vendor RIM 0x0fca Research In Motion vendor DYNASTREAM 0x0fcf Dynastream Innovations +vendor LARSENBRUSGAARD 0x0fd8 Larsen and Brusgaard vendor KONTRON 0x0fe6 Kontron AG vendor QUALCOMM 0x1004 Qualcomm vendor APACER 0x1005 Apacer @@ -560,6 +572,7 @@ vendor MOTOROLA4 0x100d Motorola vendor AIRPLUS 0x1011 Airplus vendor DESKNOTE 0x1019 Desknote vendor NEC3 0x1033 NEC +vendor TTI 0x103e Thurlby Thandar Instruments vendor GIGABYTE 0x1044 GIGABYTE vendor WESTERN 0x1058 Western Digital vendor MOTOROLA 0x1063 Motorola @@ -588,12 +601,14 @@ vendor TOPFIELD 0x11db Topfield Co., Lt vendor SIEMENS3 0x11f5 Siemens vendor NETINDEX 0x11f6 NetIndex vendor ALCATEL 0x11f7 Alcatel +vendor INTERBIOMETRICS 0x1209 Interbiometrics vendor UNKNOWN3 0x1233 Unknown vendor vendor TSUNAMI 0x1241 Tsunami vendor PHEENET 0x124a Pheenet vendor TARGUS 0x1267 Targus vendor TWINMOS 0x126f TwinMOS vendor TENDA 0x1286 Tenda +vendor TESTO 0x128d Testo products vendor CREATIVE2 0x1292 Creative Labs vendor BELKIN2 0x1293 Belkin Components vendor CYBERTAN 0x129b CyberTAN Technology @@ -612,8 +627,10 @@ vendor INITIO 0x13fd Initio Corporation vendor EMTEC 0x13fe Emtec vendor NOVATEL 0x1410 Novatel Wireless vendor MERLIN 0x1416 Merlin +vendor REDOCTANE 0x1430 RedOctane vendor WISTRONNEWEB 0x1435 Wistron NeWeb vendor RADIOSHACK 0x1453 Radio Shack +vendor FIC 0x1457 FIC / OpenMoko vendor HUAWEI3COM 0x1472 Huawei-3Com vendor ABOCOM2 0x1482 AboCom Systems vendor SILICOM 0x1485 Silicom @@ -632,8 +649,10 @@ vendor OQO 0x1557 OQO vendor UMEDIA 0x157e U-MEDIA Communications vendor FIBERLINE 0x1582 Fiberline vendor SPARKLAN 0x15a9 SparkLAN +vendor OLIMEX 0x15ba Olimex vendor SOUNDGRAPH 0x15c2 Soundgraph, Inc. vendor AMIT2 0x15c5 AMIT +vendor TEXTECH 0x15ca Textech International Ltd. vendor SOHOWARE 0x15e8 SOHOware vendor UMAX 0x1606 UMAX Data Systems vendor INSIDEOUT 0x1608 Inside Out Networks @@ -665,13 +684,19 @@ vendor QCOM 0x18e8 Qcom vendor ELV 0x18ef ELV vendor LINKSYS3 0x1915 Linksys vendor QUALCOMMINC 0x19d2 Qualcomm, Incorporated +vendor BAYER 0x1a79 Bayer vendor WCH2 0x1a86 QinHeng Electronics vendor STELERA 0x1a8d Stelera Wireless +vendor CORSAIR 0x1b1c Corsair vendor MATRIXORBITAL 0x1b3d Matrix Orbital vendor OVISLINK 0x1b75 OvisLink +vendor TML 0x1b91 The Mobility Lab vendor TCTMOBILE 0x1bbb TCT Mobile +vendor ALTI2 0x1bc9 Alti-2 products +vendor SUNPLUS 0x1bcf Sunplus Innovation Technology Inc. vendor WAGO 0x1be3 WAGO Kontakttechnik GmbH. vendor TELIT 0x1bc7 Telit +vendor IONICS 0x1c0c Ionics PlugComputer vendor LONGCHEER 0x1c9e Longcheer Holdings, Ltd. vendor MPMAN 0x1cae MpMan vendor DRESDENELEKTRONIK 0x1cf1 dresden elektronik @@ -688,8 +713,11 @@ vendor PLANEX2 0x2019 Planex Communicat vendor HAUPPAUGE2 0x2040 Hauppauge Computer Works vendor TLAYTECH 0x20b9 Tlay Tech vendor ENCORE 0x203d Encore +vendor QIHARDWARE 0x20b7 QI-hardware vendor PARA 0x20b8 PARA Industrial vendor SIMTEC 0x20df Simtec Electronics +vendor RTSYSTEMS 0x2100 RTSYSTEMS +vendor VIALABS 0x2109 VIA Labs vendor ERICSSON 0x2282 Ericsson vendor MOTOROLA2 0x22b8 Motorola vendor TRIPPLITE 0x2478 Tripp-Lite @@ -709,6 +737,7 @@ vendor IRIVER 0x4102 iRiver vendor DELL 0x413c Dell vendor WCH 0x4348 QinHeng Electronics vendor ACEECA 0x4766 Aceeca +vendor PAPOUCH 0x5050 Papouch products vendor AVERATEC 0x50c2 Averatec vendor SWEEX 0x5173 Sweex vendor PROLIFIC2 0x5372 Prolific Technologies @@ -725,8 +754,10 @@ vendor SITECOM2 0x9016 Sitecom vendor MOSCHIP 0x9710 MosChip Semiconductor vendor MARVELL 0x9e88 Marvell Technology Group Ltd. vendor 3COM3 0xa727 3Com +vendor EVOLUTION 0xdeee Evolution Robotics products vendor DATAAPEX 0xdaae DataApex vendor HP2 0xf003 Hewlett Packard +vendor LOGILINK 0xfc08 LogiLink vendor USRP 0xfffe GNU Radio USRP /* @@ -780,6 +811,9 @@ product ABOCOM RT2573_3 0xb21d RT2573 product ABOCOM RT2573_4 0xb21e RT2573 product ABOCOM WUG2700 0xb21f WUG2700 +/* Acton Research Corp. */ +product ACTON SPECTRAPRO 0x0100 FTDI compatible adapter + /* Accton products */ product ACCTON USB320_EC 0x1046 USB320-EC Ethernet Adapter product ACCTON 2664W 0x3501 2664W @@ -943,6 +977,9 @@ product ALINK 3GU 0x9200 3G modem product ALTEC ADA70 0x0070 ADA70 Speakers product ALTEC ASC495 0xff05 ASC495 Speakers +/* Alti-2 products */ +product ALTI2 N3 0x6001 FTDI compatible adapter + /* Allied Telesyn International products */ product ALLIEDTELESYN ATUSB100 0xb100 AT-USB100 @@ -989,6 +1026,10 @@ product AMIT RT2870_1 0x0012 RT2870 /* AMIT(2) products */ product AMIT2 RT2870 0x0008 RT2870 +/* Analog Devices products */ +product ANALOGDEVICES GNICE 0xf000 FTDI compatible adapter +product ANALOGDEVICES GNICEPLUS 0xf001 FTDI compatible adapter + /* Anchor products */ product ANCHOR SERIAL 0x2008 Serial product ANCHOR EZUSB 0x2131 EZUSB @@ -1124,8 +1165,27 @@ product AZUREWAVE RT3070_3 0x3305 RT3070 /* Baltech products */ product BALTECH CARDREADER 0x9999 Card reader +/* Bayer products */ +product BAYER CONTOUR_CABLE 0x6001 FTDI compatible adapter + /* B&B Electronics products */ product BBELECTRONICS USOTL4 0xAC01 RS-422/485 +product BBELECTRONICS 232USB9M 0xac27 FTDI compatible adapter +product BBELECTRONICS 485USB9F_2W 0xac25 FTDI compatible adapter +product BBELECTRONICS 485USB9F_4W 0xac26 FTDI compatible adapter +product BBELECTRONICS 485USBTB_2W 0xac33 FTDI compatible adapter +product BBELECTRONICS 485USBTB_4W 0xac34 FTDI compatible adapter +product BBELECTRONICS TTL3USB9M 0xac50 FTDI compatible adapter +product BBELECTRONICS TTL5USB9M 0xac49 FTDI compatible adapter +product BBELECTRONICS USO9ML2 0xac03 FTDI compatible adapter +product BBELECTRONICS USO9ML2DR 0xac17 FTDI compatible adapter +product BBELECTRONICS USO9ML2DR_2 0xac16 FTDI compatible adapter +product BBELECTRONICS USOPTL4 0xac11 FTDI compatible adapter +product BBELECTRONICS USOPTL4DR 0xac19 FTDI compatible adapter +product BBELECTRONICS USOPTL4DR2 0xac18 FTDI compatible adapter +product BBELECTRONICS USPTL4 0xac12 FTDI compatible adapter +product BBELECTRONICS USTL4 0xac02 FTDI compatible adapter +product BBELECTRONICS ZZ_PROG1_USB 0xba02 FTDI compatible adapter /* Belkin products */ /*product BELKIN F5U111 0x???? F5U111 Ethernet*/ @@ -1292,6 +1352,9 @@ product CONCEPTRONIC2 RT2870_6 0x3c28 RT /* Connectix products */ product CONNECTIX QUICKCAM 0x0001 QuickCam +/* Conect products */ +product CONTEC COM1USBH 0x8311 FTDI compatible adapter + /* Corega products */ product COREGA ETHER_USB_T 0x0001 Ether USB-T product COREGA FETHER_USB_TX 0x0004 FEther USB-TX @@ -1312,6 +1375,9 @@ product COREGA CGWLUSB300GNM 0x0042 CG-W product COREGA WLUSB_11_STICK 0x7613 WLAN USB Stick 11 product COREGA FETHER_USB_TXC 0x9601 FEther USB-TXC +/* Corsair products */ +product CORSAIR K60 0x0a60 Corsair Vengeance K60 keyboard + /* Creative products */ product CREATIVE NOMAD_II 0x1002 Nomad II MP3 player product CREATIVE NOMAD_IIMG 0x4004 Nomad II MG @@ -1483,6 +1549,10 @@ product EGALAX TPANEL 0x0001 Touch Pane product EGALAX TPANEL2 0x0002 Touch Panel product EGALAX2 TPANEL 0x0001 Touch Panel +/* EGO Products */ +product EGO DUMMY 0x0000 Dummy Product +product EGO M4U 0x1020 ESI M4U + /* Eicon Networks */ product EICON DIVA852 0x4905 Diva 852 ISDN TA @@ -1504,6 +1574,9 @@ product ELECOM UCSGT 0x5003 UC-SGT product ELECOM UCSGT0 0x5004 UC-SGT product ELECOM LDUSBTX3 0xabc1 LD-USB/TX +/* Elektor products */ +product ELEKTOR FT323R 0x0005 FTDI compatible adapter + /* Elsa products */ product ELSA MODEM1 0x2265 ELSA Modem Board product ELSA USB2ETHERNET 0x3000 Microlink USB2Ethernet @@ -1581,11 +1654,17 @@ product EPSON SX400 0x084a SX400/NX400/ /* e-TEK Labs products */ product ETEK 1COM 0x8007 Serial +/* Evolution products */ +product EVOLUTION ER1 0x0300 FTDI compatible adapter +product EVOLUTION HYBRID 0x0302 FTDI compatible adapter +product EVOLUTION RCM4 0x0303 FTDI compatible adapter + /* Extended Systems products */ product EXTENDED XTNDACCESS 0x0100 XTNDAccess IrDA /* Falcom products */ product FALCOM TWIST 0x0001 USB GSM/GPRS Modem +product FALCOM SAMBA 0x0005 FTDI compatible adapter /* FEIYA products */ product FEIYA DUMMY 0x0000 Dummy product @@ -1599,6 +1678,9 @@ product FESTO CMSP 0x0501 CMSP /* Fiberline */ product FIBERLINE WL430U 0x6003 WL-430U +/* FIC / OpenMoko */ +product FIC NEO1973_DEBUG 0x5118 FTDI compatible adapter + /* Fossil, Inc products */ product FOSSIL WRISTPDA 0x0002 Wrist PDA @@ -1617,7 +1699,9 @@ product FSC E5400 0x1009 PrismGT USB 2. product FTDI SERIAL_8U100AX 0x8372 8U100AX Serial product FTDI SERIAL_8U232AM 0x6001 8U232AM Serial product FTDI SERIAL_8U232AM4 0x6004 8U232AM Serial *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Sep 18 17:08:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0CF3D106564A; Tue, 18 Sep 2012 17:08:15 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EB6E68FC12; Tue, 18 Sep 2012 17:08:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8IH8E14029890; Tue, 18 Sep 2012 17:08:14 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8IH8E67029888; Tue, 18 Sep 2012 17:08:14 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201209181708.q8IH8E67029888@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 18 Sep 2012 17:08:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240665 - stable/9/sys/dev/usb/serial X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Sep 2012 17:08:15 -0000 Author: hselasky Date: Tue Sep 18 17:08:14 2012 New Revision: 240665 URL: http://svn.freebsd.org/changeset/base/240665 Log: MFC r240382: Restart the USB transfer if the error is not USB_ERR_CANCELLED. Modified: stable/9/sys/dev/usb/serial/ufoma.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/serial/ufoma.c ============================================================================== --- stable/9/sys/dev/usb/serial/ufoma.c Tue Sep 18 17:03:32 2012 (r240664) +++ stable/9/sys/dev/usb/serial/ufoma.c Tue Sep 18 17:08:14 2012 (r240665) @@ -631,10 +631,7 @@ tr_setup: if (error == USB_ERR_CANCELLED) { return; - } else { - goto tr_setup; } - goto tr_transferred; } } @@ -651,7 +648,6 @@ ufoma_ctrl_write_callback(struct usb_xfe case USB_ST_TRANSFERRED: tr_transferred: case USB_ST_SETUP: -tr_setup: pc = usbd_xfer_get_frame(xfer, 1); if (ucom_get_data(&sc->sc_ucom, pc, 0, 1, &actlen)) { @@ -677,10 +673,7 @@ tr_setup: if (error == USB_ERR_CANCELLED) { return; - } else { - goto tr_setup; } - goto tr_transferred; } } From owner-svn-src-all@FreeBSD.ORG Tue Sep 18 17:10:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CD3C91065673; Tue, 18 Sep 2012 17:10:26 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9E5858FC19; Tue, 18 Sep 2012 17:10:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8IHAQQR030233; Tue, 18 Sep 2012 17:10:26 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8IHAQ32030231; Tue, 18 Sep 2012 17:10:26 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201209181710.q8IHAQ32030231@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 18 Sep 2012 17:10:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240666 - stable/9/sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Sep 2012 17:10:26 -0000 Author: hselasky Date: Tue Sep 18 17:10:26 2012 New Revision: 240666 URL: http://svn.freebsd.org/changeset/base/240666 Log: MFC r239237: Improve auto-quirks detection for certain Kingston memory sticks. Modified: stable/9/sys/dev/usb/usb_msctest.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/usb_msctest.c ============================================================================== --- stable/9/sys/dev/usb/usb_msctest.c Tue Sep 18 17:08:14 2012 (r240665) +++ stable/9/sys/dev/usb/usb_msctest.c Tue Sep 18 17:10:26 2012 (r240666) @@ -103,6 +103,8 @@ static uint8_t scsi_sync_cache[] = { 0x3 0x00, 0x00, 0x00, 0x00 }; static uint8_t scsi_request_sense[] = { 0x03, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; +static uint8_t scsi_read_capacity[] = { 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00 }; #define BULK_SIZE 64 /* dummy */ #define ERR_CSW_FAILED -1 @@ -652,7 +654,7 @@ usb_msc_auto_quirk(struct usb_device *ud } is_no_direct = 1; - for (timeout = 4; timeout; timeout--) { + for (timeout = 4; timeout != 0; timeout--) { err = bbb_command_start(sc, DIR_IN, 0, sc->buffer, SCSI_INQ_LEN, &scsi_inquiry, sizeof(scsi_inquiry), USB_MS_HZ); @@ -681,7 +683,9 @@ usb_msc_auto_quirk(struct usb_device *ud if (err != ERR_CSW_FAILED) goto error; } + timeout = 1; +retry_sync_cache: err = bbb_command_start(sc, DIR_IN, 0, NULL, 0, &scsi_sync_cache, sizeof(scsi_sync_cache), USB_MS_HZ); @@ -694,6 +698,42 @@ usb_msc_auto_quirk(struct usb_device *ud DPRINTF("Device doesn't handle synchronize cache\n"); usbd_add_dynamic_quirk(udev, UQ_MSC_NO_SYNC_CACHE); + + } else { + + /* + * Certain Kingston memory sticks fail the first + * read capacity after a synchronize cache command + * has been issued. Disable the synchronize cache + * command for such devices. + */ + + err = bbb_command_start(sc, DIR_IN, 0, sc->buffer, 8, + &scsi_read_capacity, sizeof(scsi_read_capacity), + USB_MS_HZ); + + if (err != 0) { + if (err != ERR_CSW_FAILED) + goto error; + + err = bbb_command_start(sc, DIR_IN, 0, sc->buffer, 8, + &scsi_read_capacity, sizeof(scsi_read_capacity), + USB_MS_HZ); + + if (err == 0) { + if (timeout--) + goto retry_sync_cache; + + DPRINTF("Device most likely doesn't " + "handle synchronize cache\n"); + + usbd_add_dynamic_quirk(udev, + UQ_MSC_NO_SYNC_CACHE); + } else { + if (err != ERR_CSW_FAILED) + goto error; + } + } } /* clear sense status of any failed commands on the device */ From owner-svn-src-all@FreeBSD.ORG Tue Sep 18 17:15:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3AA06106564A; Tue, 18 Sep 2012 17:15:00 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1AF148FC1A; Tue, 18 Sep 2012 17:15:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8IHExxT030869; Tue, 18 Sep 2012 17:14:59 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8IHEx4d030865; Tue, 18 Sep 2012 17:14:59 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201209181714.q8IHEx4d030865@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 18 Sep 2012 17:14:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240667 - in stable/9/sys/dev/usb: input quirk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Sep 2012 17:15:00 -0000 Author: hselasky Date: Tue Sep 18 17:14:59 2012 New Revision: 240667 URL: http://svn.freebsd.org/changeset/base/240667 Log: MFC r240615: Add UQ_UMS_IGNORE quirk. Wrap two long lines. Some minor spelling correction. PR: usb/171721 Modified: stable/9/sys/dev/usb/input/ums.c stable/9/sys/dev/usb/quirk/usb_quirk.c stable/9/sys/dev/usb/quirk/usb_quirk.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/input/ums.c ============================================================================== --- stable/9/sys/dev/usb/input/ums.c Tue Sep 18 17:10:26 2012 (r240666) +++ stable/9/sys/dev/usb/input/ums.c Tue Sep 18 17:14:59 2012 (r240667) @@ -381,6 +381,9 @@ ums_probe(device_t dev) if (uaa->info.bInterfaceClass != UICLASS_HID) return (ENXIO); + if (usb_test_quirk(uaa, UQ_UMS_IGNORE)) + return (ENXIO); + if ((uaa->info.bInterfaceSubClass == UISUBCLASS_BOOT) && (uaa->info.bInterfaceProtocol == UIPROTO_MOUSE)) return (BUS_PROBE_DEFAULT); Modified: stable/9/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- stable/9/sys/dev/usb/quirk/usb_quirk.c Tue Sep 18 17:10:26 2012 (r240666) +++ stable/9/sys/dev/usb/quirk/usb_quirk.c Tue Sep 18 17:14:59 2012 (r240667) @@ -494,6 +494,7 @@ static const char *usb_quirk_str[USB_QUI [UQ_HID_IGNORE] = "UQ_HID_IGNORE", [UQ_KBD_IGNORE] = "UQ_KBD_IGNORE", [UQ_KBD_BOOTPROTO] = "UQ_KBD_BOOTPROTO", + [UQ_UMS_IGNORE] = "UQ_UMS_IGNORE", [UQ_MS_BAD_CLASS] = "UQ_MS_BAD_CLASS", [UQ_MS_LEADING_BYTE] = "UQ_MS_LEADING_BYTE", [UQ_MS_REVZ] = "UQ_MS_REVZ", Modified: stable/9/sys/dev/usb/quirk/usb_quirk.h ============================================================================== --- stable/9/sys/dev/usb/quirk/usb_quirk.h Tue Sep 18 17:10:26 2012 (r240666) +++ stable/9/sys/dev/usb/quirk/usb_quirk.h Tue Sep 18 17:14:59 2012 (r240667) @@ -29,7 +29,7 @@ enum { /* - * Keep in sync with theusb_quirk_str usb_quirk.c, and with the + * Keep in sync with usb_quirk_str in usb_quirk.c, and with * share/man/man4/usb_quirk.4 */ UQ_NONE, /* not a valid quirk */ @@ -49,6 +49,7 @@ enum { UQ_HID_IGNORE, /* device should be ignored by hid class */ UQ_KBD_IGNORE, /* device should be ignored by kbd class */ UQ_KBD_BOOTPROTO, /* device should set the boot protocol */ + UQ_UMS_IGNORE, /* device should be ignored by ums class */ UQ_MS_BAD_CLASS, /* doesn't identify properly */ UQ_MS_LEADING_BYTE, /* mouse sends an unknown leading byte */ UQ_MS_REVZ, /* mouse has Z-axis reversed */ @@ -64,7 +65,10 @@ enum { UQ_CFG_INDEX_0, /* select configuration index 0 by default */ UQ_ASSUME_CM_OVER_DATA, /* assume cm over data feature */ - /* USB Mass Storage Quirks. See "storage/umass.c" for a detailed description. */ + /* + * USB Mass Storage Quirks. See "storage/umass.c" for a + * detailed description. + */ UQ_MSC_NO_TEST_UNIT_READY, /* send start/stop instead of TUR */ UQ_MSC_NO_RS_CLEAR_UA, /* does not reset Unit Att. */ UQ_MSC_NO_START_STOP, /* does not support start/stop */ From owner-svn-src-all@FreeBSD.ORG Tue Sep 18 17:17:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BBD21106564A; Tue, 18 Sep 2012 17:17:04 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A62318FC15; Tue, 18 Sep 2012 17:17:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8IHH4Ck031203; Tue, 18 Sep 2012 17:17:04 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8IHH48L031201; Tue, 18 Sep 2012 17:17:04 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201209181717.q8IHH48L031201@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 18 Sep 2012 17:17:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240668 - stable/9/sys/dev/usb/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Sep 2012 17:17:04 -0000 Author: hselasky Date: Tue Sep 18 17:17:04 2012 New Revision: 240668 URL: http://svn.freebsd.org/changeset/base/240668 Log: MFC r240597: Remove unused variable cd. This variable is initialized but not used. Modified: stable/9/sys/dev/usb/net/uhso.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/net/uhso.c ============================================================================== --- stable/9/sys/dev/usb/net/uhso.c Tue Sep 18 17:14:59 2012 (r240667) +++ stable/9/sys/dev/usb/net/uhso.c Tue Sep 18 17:17:04 2012 (r240668) @@ -540,7 +540,6 @@ uhso_attach(device_t self) { struct uhso_softc *sc = device_get_softc(self); struct usb_attach_arg *uaa = device_get_ivars(self); - struct usb_config_descriptor *cd; struct usb_interface_descriptor *id; struct sysctl_ctx_list *sctx; struct sysctl_oid *soid; @@ -561,7 +560,6 @@ uhso_attach(device_t self) sc->sc_ttys = 0; sc->sc_radio = 1; - cd = usbd_get_config_descriptor(uaa->device); id = usbd_get_interface_descriptor(uaa->iface); sc->sc_ctrl_iface_no = id->bInterfaceNumber; From owner-svn-src-all@FreeBSD.ORG Tue Sep 18 17:23:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B6E9B106566B; Tue, 18 Sep 2012 17:23:00 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9738F8FC19; Tue, 18 Sep 2012 17:23:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8IHN0tl032023; Tue, 18 Sep 2012 17:23:00 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8IHN0rI032020; Tue, 18 Sep 2012 17:23:00 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201209181723.q8IHN0rI032020@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 18 Sep 2012 17:23:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240669 - in stable/9/sys/dev/usb: . serial X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Sep 2012 17:23:01 -0000 Author: hselasky Date: Tue Sep 18 17:23:00 2012 New Revision: 240669 URL: http://svn.freebsd.org/changeset/base/240669 Log: MFC r238079, r238493, r238526, r238529 and r238717: Add new USB ID's. PR: usb/169789 Modified: stable/9/sys/dev/usb/serial/u3g.c stable/9/sys/dev/usb/usbdevs Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/serial/u3g.c ============================================================================== --- stable/9/sys/dev/usb/serial/u3g.c Tue Sep 18 17:17:04 2012 (r240668) +++ stable/9/sys/dev/usb/serial/u3g.c Tue Sep 18 17:23:00 2012 (r240669) @@ -285,14 +285,18 @@ static const STRUCT_USB_HOST_ID u3g_devs U3G_DEV(HUAWEI, E143F, U3GINIT_HUAWEI), U3G_DEV(HUAWEI, E173, 0), U3G_DEV(HUAWEI, E173_INIT, U3GINIT_HUAWEISCSI), + U3G_DEV(HUAWEI, E3131, 0), + U3G_DEV(HUAWEI, E3131_INIT, U3GINIT_HUAWEISCSI), U3G_DEV(HUAWEI, E180V, U3GINIT_HUAWEI), U3G_DEV(HUAWEI, E220, U3GINIT_HUAWEI), U3G_DEV(HUAWEI, E220BIS, U3GINIT_HUAWEI), + U3G_DEV(HUAWEI, E392, U3GINIT_HUAWEISCSI), U3G_DEV(HUAWEI, MOBILE, U3GINIT_HUAWEI), U3G_DEV(HUAWEI, E1752, U3GINIT_HUAWEISCSI), U3G_DEV(HUAWEI, E1820, U3GINIT_HUAWEISCSI), U3G_DEV(HUAWEI, K3765, U3GINIT_HUAWEI), U3G_DEV(HUAWEI, K3765_INIT, U3GINIT_HUAWEISCSI), + U3G_DEV(HUAWEI, ETS2055, U3GINIT_HUAWEI), U3G_DEV(KYOCERA2, CDMA_MSM_K, 0), U3G_DEV(KYOCERA2, KPC680, 0), U3G_DEV(LONGCHEER, WM66, U3GINIT_HUAWEI), @@ -359,6 +363,8 @@ static const STRUCT_USB_HOST_ID u3g_devs U3G_DEV(QUALCOMM2, MF330, 0), U3G_DEV(QUALCOMM2, SIM5218, 0), U3G_DEV(QUALCOMM2, VW110L, U3GINIT_SCSIEJECT), + U3G_DEV(QUALCOMM2, GOBI2000_QDL, 0), + U3G_DEV(QUALCOMM2, GOBI2000, 0), U3G_DEV(QUALCOMMINC, AC2726, 0), U3G_DEV(QUALCOMMINC, AC8700, 0), U3G_DEV(QUALCOMMINC, AC8710, 0), Modified: stable/9/sys/dev/usb/usbdevs ============================================================================== --- stable/9/sys/dev/usb/usbdevs Tue Sep 18 17:17:04 2012 (r240668) +++ stable/9/sys/dev/usb/usbdevs Tue Sep 18 17:23:00 2012 (r240669) @@ -2184,7 +2184,11 @@ product HUAWEI E143F 0x143f 3G modem product HUAWEI E1752 0x1446 3G modem product HUAWEI K3765 0x1465 3G modem product HUAWEI E1820 0x14ac E1820 HSPA+ USB Slider +product HUAWEI E3131_INIT 0x14fe 3G modem initial +product HUAWEI E392 0x1505 LTE modem +product HUAWEI E3131 0x1506 3G modem product HUAWEI K3765_INIT 0x1520 K3765 Initial +product HUAWEI ETS2055 0x1803 CDMA modem product HUAWEI E173 0x1c05 3G modem product HUAWEI E173_INIT 0x1c0b 3G modem initial @@ -3328,6 +3332,8 @@ product QUALCOMM2 CDMA_MSM 0x3196 CDMA T product QUALCOMM2 AC8700 0x6000 AC8700 product QUALCOMM2 VW110L 0x1000 Vertex Wireless 110L modem product QUALCOMM2 SIM5218 0x9000 SIM5218 +product QUALCOMM2 GOBI2000_QDL 0x9204 Qualcomm Gobi 2000 QDL +product QUALCOMM2 GOBI2000 0x9205 Qualcomm Gobi 2000 modem product QUALCOMMINC CDMA_MSM 0x0001 CDMA Technologies MSM modem product QUALCOMMINC E0002 0x0002 3G modem product QUALCOMMINC E0003 0x0003 3G modem From owner-svn-src-all@FreeBSD.ORG Tue Sep 18 17:27:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 389FA106564A; Tue, 18 Sep 2012 17:27:10 +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 A1C768FC16; Tue, 18 Sep 2012 17:27:09 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q8IHRHrA032535; Tue, 18 Sep 2012 20:27:17 +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.5/8.14.5) with ESMTP id q8IHR5nJ036320; Tue, 18 Sep 2012 20:27:05 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q8IHR52w036319; Tue, 18 Sep 2012 20:27:05 +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: Tue, 18 Sep 2012 20:27:05 +0300 From: Konstantin Belousov To: Hans Petter Selasky Message-ID: <20120918172705.GK37286@deviant.kiev.zoral.com.ua> References: <201209181628.q8IGSoOF024628@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="CZI63rpYmK/igF6U" Content-Disposition: inline In-Reply-To: <201209181628.q8IGSoOF024628@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.0 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham 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-9@freebsd.org Subject: Re: svn commit: r240659 - in stable/9/sys: dev/usb/net dev/usb/serial kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Sep 2012 17:27:10 -0000 --CZI63rpYmK/igF6U Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Sep 18, 2012 at 04:28:50PM +0000, Hans Petter Selasky wrote: > Author: hselasky > Date: Tue Sep 18 16:28:49 2012 > New Revision: 240659 > URL: http://svn.freebsd.org/changeset/base/240659 >=20 > Log: > MFC r239178, r239179, r239180, r239181, r239182 and r239299: > =20 > Fix detach of USB serial devices so that it doesn't block > the USB explore thread forever. To accomplish this two new > functions have been added to the kernel, to claim and free > the newbus allocated softc. > =20 > This change is backwards API compatible, but not binary > compatible. The FreeBSD version has been bumped to force > a recompile of all kernel modules. Thank you, I run with this change since it was committed to head, and the only issue left is that the same serial adapter reappears under the different cuaUNN name after the glitch. This causes apcupsd to not able to reconnect. And, the big question that still applies, is why UPSes are lost from the USB bus ? --CZI63rpYmK/igF6U Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAlBYrukACgkQC3+MBN1Mb4jUgACgtcFReuqjU80Tmc5mCMK60ejL LkUAoONhTv3mqTuzH6kLyCW4bgI/5Val =4rX/ -----END PGP SIGNATURE----- --CZI63rpYmK/igF6U-- From owner-svn-src-all@FreeBSD.ORG Tue Sep 18 17:30:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9A3AC106567F; Tue, 18 Sep 2012 17:30:11 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 940E08FC14; Tue, 18 Sep 2012 17:30:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8IHU83b032968; Tue, 18 Sep 2012 17:30:08 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8IHU84e032966; Tue, 18 Sep 2012 17:30:08 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201209181730.q8IHU84e032966@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 18 Sep 2012 17:30:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240670 - stable/9/etc/devd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Sep 2012 17:30:11 -0000 Author: hselasky Date: Tue Sep 18 17:30:08 2012 New Revision: 240670 URL: http://svn.freebsd.org/changeset/base/240670 Log: MFC r239056: Regenerate usb.conf Modified: stable/9/etc/devd/usb.conf Directory Properties: stable/9/etc/ (props changed) Modified: stable/9/etc/devd/usb.conf ============================================================================== --- stable/9/etc/devd/usb.conf Tue Sep 18 17:23:00 2012 (r240669) +++ stable/9/etc/devd/usb.conf Tue Sep 18 17:30:08 2012 (r240670) @@ -157,7 +157,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0403"; - match "product" "(0x6001|0x6004|0x6010|0x6011|0x8372|0x9e90|0xcc48|0xcc49|0xcc4a|0xd678|0xe6c8|0xe888|0xe889|0xe88a|0xe88b|0xe88c|0xee18|0xf608|0xf60b|0xf850|0xfa00|0xfa01|0xfa02|0xfa03|0xfa04|0xfc08|0xfc09|0xfc0b|0xfc0c|0xfc0d|0xfc82)"; + match "product" "(0x6001|0x6004|0x6006|0x6010|0x6011|0x6014|0x8372|0x9378|0x9379|0x937a|0x937c|0x9868|0x9e90|0x9f80|0xa6d0|0xabb8|0xb810|0xb811|0xb812|0xbaf8|0xbca0|0xbca1|0xbca2|0xbca4|0xbcd8|0xbcd9|0xbdc8|0xbfd8|0xbfd9|0xbfda|0xbfdb|0xbfdc|0xc7d0|0xc850|0xc991|0xcaa0|0xcc48|0xcc49|0xcc4a|0xd010|0xd011|0xd012|0xd013|0xd014|0xd015|0xd016|0xd017|0xd070|0xd071|0xd388|0xd389|0xd38a|0xd38b|0xd38c|0xd38d|0xd38e|0xd38f|0xd578|0xd678|0xd738|0xd780|0xdaf8|0xdaf9|0xdafa|0xdafb|0xdafc|0xdafd|0xdafe|0xdaff|0xdc00|0xdc01|0xdd20|0xdf28|0xdf30|0xdf31|0xdf32|0xdf33|0xdf35|0xe000|0xe001|0xe002|0xe004|0xe006|0xe008|0xe009|0xe00a|0xe050|0xe0e8|0xe0e9|0xe0ea|0xe0eb|0xe0ec|0xe0ed|0xe0ee|0xe0ef|0xe0f0|0xe0f1|0xe0f2|0xe0f3|0xe0f4|0xe0f5|0xe0f6|0xe0f7|0xe40b|0xe520|0xe548|0xe6c8|0xe700|0xe729|0xe808|0xe809|0xe80a|0xe80b|0xe80c|0xe80d|0xe80e|0xe80f|0xe888|0xe889|0xe88a|0xe88b|0xe88c|0xe88d|0xe88e|0xe88f|0xea90|0xebe0|0xec88|0xec89|0xed22|0xed71|0xed72|0xed73|0xed74|0xee18|0xeee8|0xeee9|0xeeea|0xeeeb|0xeee c|0xeeed|0xeeee|0xeeef|0xef50|0xef51|0xf068|0xf069|0xf06a|0xf06b|0xf06c|0xf06d|0xf06e|0xf06f|0xf070|0xf0c0|0xf0c8|0xf208|0xf2d0|0xf3c0|0xf3c1|0xf3c2|0xf448|0xf449|0xf44a|0xf44b|0xf44c|0xf460|0xf608|0xf60b|0xf680|0xf850|0xf857|0xf9d0|0xf9d1|0xf9d2|0xf9d3|0xf9d4|0xf9d5|0xfa00|0xfa01|0xfa02|0xfa03|0xfa04|0xfa05|0xfa06|0xfa10|0xfa33|0xfa88|0xfad0|0xfaf0|0xfb58|0xfb59|0xfb5a|0xfb5b|0xfb5c|0xfb5d|0xfb5e|0xfb5f|0xfb80|0xfb99|0xfbfa|0xfc08|0xfc09|0xfc0a|0xfc0b|0xfc0c|0xfc0d|0xfc0e|0xfc0f|0xfc60|0xfc70|0xfc71|0xfc72|0xfc73|0xfc82|0xfd60|0xfe38|0xff00|0xff18|0xff1c|0xff1d|0xff20|0xff38|0xff39|0xff3a|0xff3b|0xff3c|0xff3d|0xff3e|0xff3f|0xffa8)"; action "kldload -n uftdi"; }; @@ -293,7 +293,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0411"; - match "product" "(0x0148|0x0150|0x015d|0x016f|0x01a2)"; + match "product" "(0x0148|0x0150|0x015d|0x016f|0x01a2|0x01ee)"; action "kldload -n if_run"; }; @@ -324,6 +324,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x0456"; + match "product" "(0xf000|0xf001)"; + action "kldload -n uftdi"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x045a"; match "product" "(0x5001|0x5002)"; action "kldload -n urio"; @@ -1021,7 +1029,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x05c6"; - match "product" "(0x1000|0x6000|0x6613|0x9000)"; + match "product" "(0x1000|0x6000|0x6613|0x9000|0x9204|0x9205)"; action "kldload -n u3g"; }; @@ -1068,6 +1076,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x0647"; + match "product" "0x0100"; + action "kldload -n uftdi"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x066b"; match "product" "(0x200c|0x2202)"; action "kldload -n if_aue"; @@ -1109,7 +1125,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x067b"; - match "product" "(0x04bb|0x0609|0x0611|0x0612|0x1234|0x206a|0x2303)"; + match "product" "(0x0307|0x04bb|0x0609|0x0611|0x0612|0x1234|0x206a|0x2303)"; action "kldload -n uplcom"; }; @@ -1156,6 +1172,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x06ce"; + match "product" "0x8311"; + action "kldload -n uftdi"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x06e1"; match "product" "(0x0008|0x0009)"; action "kldload -n if_kue"; @@ -1301,7 +1325,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0789"; - match "product" "(0x0162|0x0163|0x0164|0x0166)"; + match "product" "(0x0162|0x0163|0x0164|0x0166|0x0168)"; action "kldload -n if_run"; }; @@ -1653,7 +1677,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0856"; - match "product" "0xac01"; + match "product" "(0xac01|0xac02|0xac03|0xac11|0xac12|0xac16|0xac17|0xac18|0xac19|0xac25|0xac26|0xac27|0xac33|0xac34|0xac49|0xac50|0xba02)"; action "kldload -n uftdi"; }; @@ -1876,6 +1900,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x0acd"; + match "product" "0x0300"; + action "kldload -n uftdi"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x0ace"; match "product" "(0x1211|0x1215)"; action "kldload -n if_zyd"; @@ -2045,6 +2077,14 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0b39"; + match "product" "0x0103"; + action "kldload -n uftdi"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0b39"; match "product" "0x0109"; action "kldload -n if_aue"; }; @@ -2172,6 +2212,22 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x0c26"; + match "product" "(0x0004|0x0009|0x000a|0x000b|0x000c|0x000d|0x0010|0x0011|0x0012|0x0013|0x0018)"; + action "kldload -n uftdi"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0c33"; + match "product" "0x0010"; + action "kldload -n uftdi"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x0c44"; match "product" "0x03a2"; action "kldload -n uipaq"; @@ -2180,6 +2236,30 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x0c52"; + match "product" "(0x2101|0x2102|0x2103|0x2104|0x2211|0x2212|0x2213|0x2221|0x2222|0x2223|0x2411|0x2412|0x2413|0x2421|0x2422|0x2423|0x2431|0x2432|0x2433|0x2441|0x2442|0x2443|0x2811|0x2812|0x2813|0x2821|0x2822|0x2823|0x2831|0x2832|0x2833|0x2841|0x2842|0x2843|0x2851|0x2852|0x2853|0x2861|0x2862|0x2863|0x2871|0x2872|0x2873|0x2881|0x2882|0x2883|0x9020)"; + action "kldload -n uftdi"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0c6c"; + match "product" "0x04b2"; + action "kldload -n uftdi"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0c7d"; + match "product" "0x0005"; + action "kldload -n uftdi"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x0c88"; match "product" "0x17da"; action "kldload -n u3g"; @@ -2276,6 +2356,22 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x0d3a"; + match "product" "0x0300"; + action "kldload -n uftdi"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0d46"; + match "product" "(0x2020|0x2021)"; + action "kldload -n uftdi"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x0d8e"; match "product" "0x3762"; action "kldload -n if_upgt"; @@ -2340,6 +2436,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x0dcd"; + match "product" "0x0001"; + action "kldload -n uftdi"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x0df6"; match "product" "0x000d"; action "kldload -n if_urtw"; @@ -2557,7 +2661,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0f94"; - match "product" "0x0001"; + match "product" "(0x0001|0x0005)"; action "kldload -n uftdi"; }; @@ -2588,6 +2692,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x0fd8"; + match "product" "0x0001"; + action "kldload -n uftdi"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x0fe6"; match "product" "(0x8101|0x9700)"; action "kldload -n if_udav"; @@ -2612,6 +2724,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x103e"; + match "product" "0x03e8"; + action "kldload -n uftdi"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x1044"; match "product" "0x8001"; action "kldload -n if_ural"; @@ -2725,7 +2845,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x10c4"; - match "product" "(0x8066|0x806f|0x807a|0x80ca|0x80dd|0x80ed|0x80f6|0x8115|0x813d|0x813f|0x814a|0x814a|0x814b|0x8156|0x815e|0x818b|0x819f|0x81a6|0x81ac|0x81ad|0x81c8|0x81e2|0x81e7|0x81e8|0x81f2|0x8218|0x822b|0x826b|0x8293|0x82f9|0x8341|0x8382|0x83a8|0x8411|0x846e|0x8477|0xea60|0xea61|0xea71|0xf001|0xf002|0xf003|0xf004)"; + match "product" "(0x8066|0x806f|0x807a|0x80c4|0x80ca|0x80dd|0x80ed|0x80f6|0x8115|0x813d|0x813f|0x814a|0x814a|0x814b|0x8156|0x815e|0x815f|0x818b|0x819f|0x81a6|0x81a9|0x81ac|0x81ad|0x81c8|0x81e2|0x81e7|0x81e8|0x81f2|0x8218|0x822b|0x826b|0x8293|0x82f9|0x8341|0x8382|0x83a8|0x83d8|0x8411|0x8418|0x846e|0x8477|0x85ea|0x85eb|0x8664|0x8665|0xea60|0xea61|0xea70|0xea71|0xea80|0xf001|0xf002|0xf003|0xf004)"; action "kldload -n uslcom"; }; @@ -2900,6 +3020,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x1209"; + match "product" "(0x1002|0x1006)"; + action "kldload -n uftdi"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x1231"; match "product" "(0xce01|0xce02)"; action "kldload -n uipaq"; @@ -2916,6 +3044,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x128d"; + match "product" "0x0001"; + action "kldload -n uftdi"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x129b"; match "product" "0x1666"; action "kldload -n if_zyd"; @@ -2933,7 +3069,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x12d1"; - match "product" "(0x1001|0x1003|0x1004|0x1401|0x1402|0x1403|0x1404|0x1405|0x1406|0x1407|0x1408|0x1409|0x140a|0x140b|0x140c|0x140d|0x140e|0x140f|0x1410|0x1411|0x1412|0x1413|0x1414|0x1415|0x1416|0x1417|0x1418|0x1419|0x141a|0x141b|0x141c|0x141d|0x141e|0x141f|0x1420|0x1421|0x1422|0x1423|0x1424|0x1425|0x1426|0x1427|0x1428|0x1429|0x142a|0x142b|0x142c|0x142d|0x142e|0x142f|0x1430|0x1431|0x1432|0x1433|0x1434|0x1435|0x1436|0x1437|0x1438|0x1439|0x143a|0x143b|0x143c|0x143d|0x143e|0x143f|0x1446|0x1465|0x14ac|0x1520|0x1c05|0x1c0b)"; + match "product" "(0x1001|0x1003|0x1004|0x1401|0x1402|0x1403|0x1404|0x1405|0x1406|0x1407|0x1408|0x1409|0x140a|0x140b|0x140c|0x140d|0x140e|0x140f|0x1410|0x1411|0x1412|0x1413|0x1414|0x1415|0x1416|0x1417|0x1418|0x1419|0x141a|0x141b|0x141c|0x141d|0x141e|0x141f|0x1420|0x1421|0x1422|0x1423|0x1424|0x1425|0x1426|0x1427|0x1428|0x1429|0x142a|0x142b|0x142c|0x142d|0x142e|0x142f|0x1430|0x1431|0x1432|0x1433|0x1434|0x1435|0x1436|0x1437|0x1438|0x1439|0x143a|0x143b|0x143c|0x143d|0x143e|0x143f|0x1446|0x1465|0x14ac|0x14fe|0x1505|0x1506|0x1520|0x1803|0x1c05|0x1c0b)"; action "kldload -n u3g"; }; @@ -2949,6 +3085,14 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x1342"; + match "product" "0x0202"; + action "kldload -n uftdi"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1342"; match "product" "0x0204"; action "kldload -n if_kue"; }; @@ -3108,6 +3252,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x1457"; + match "product" "(0x5118|0x5118)"; + action "kldload -n uftdi"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x1472"; match "product" "0x0009"; action "kldload -n if_rum"; @@ -3332,6 +3484,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x15ba"; + match "product" "(0x0003|0x002b)"; + action "kldload -n uftdi"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x15c5"; match "product" "0x0008"; action "kldload -n if_run"; @@ -3381,7 +3541,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x166a"; - match "product" "0x0303"; + match "product" "(0x0101|0x0201|0x0301|0x0303|0x0304|0x0305|0x0401)"; action "kldload -n uslcom"; }; @@ -3477,7 +3637,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x16d6"; - match "product" "(0x0001|0x0001)"; + match "product" "0x0001"; action "kldload -n uslcom"; }; @@ -3596,6 +3756,22 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x1781"; + match "product" "0x0c30"; + action "kldload -n uftdi"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x17a8"; + match "product" "(0x0001|0x0005)"; + action "kldload -n uslcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x17f4"; match "product" "0xaaaa"; action "kldload -n uslcom"; @@ -3676,6 +3852,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x1a79"; + match "product" "0x6001"; + action "kldload -n uftdi"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x1a86"; match "product" "0x7523"; action "kldload -n uchcom"; @@ -3693,7 +3877,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x1b3d"; - match "product" "0x0153"; + match "product" "(0x0100|0x0101|0x0102|0x0103|0x0104|0x0105|0x0106|0x0107|0x0108|0x0109|0x010a|0x010b|0x010c|0x010d|0x010e|0x010f|0x0110|0x0111|0x0112|0x0113|0x0114|0x0115|0x0116|0x0117|0x0118|0x0119|0x011a|0x011b|0x011c|0x011d|0x011e|0x011f|0x0120|0x0121|0x0122|0x0123|0x0124|0x0125|0x0126|0x0128|0x0129|0x012a|0x012b|0x012d|0x012e|0x012f|0x0130|0x0131|0x0132|0x0133|0x0134|0x0135|0x0136|0x0137|0x0138|0x0139|0x013a|0x013b|0x013c|0x013d|0x013e|0x013f|0x0140|0x0141|0x0142|0x0143|0x0144|0x0145|0x0146|0x0147|0x0148|0x0149|0x014a|0x014b|0x014c|0x014d|0x014e|0x014f|0x0150|0x0151|0x0152|0x0153|0x0159|0x015a|0x015b|0x015c|0x015d|0x015e|0x015f|0x0160|0x0161|0x0162|0x0163|0x0164|0x0165|0x0166|0x0167|0x0168|0x0169|0x016a|0x016b|0x016c|0x016d|0x016e|0x016f|0x0170|0x0171|0x0172|0x0173|0x0174|0x0175|0x0176|0x0177|0x0178|0x0179|0x017a|0x017b|0x017c|0x017d|0x017e|0x017f|0x0180|0x0181|0x0182|0x0183|0x0184|0x0185|0x0186|0x0187|0x0188|0x0189|0x018a|0x018b|0x018c|0x018d|0x018e|0x018f|0x0190|0x0191|0x019 2|0x0193|0x0194|0x0195|0x0196|0x0197|0x0198|0x0199|0x019a|0x019b|0x019c|0x019d|0x019e|0x019f|0x01a0|0x01a1|0x01a2|0x01a3|0x01a4|0x01a5|0x01a6|0x01a7|0x01a8|0x01a9|0x01aa|0x01ab|0x01ac|0x01ad|0x01ae|0x01af|0x01b0|0x01b1|0x01b2|0x01b3|0x01b4|0x01b5|0x01b6|0x01b7|0x01b8|0x01b9|0x01ba|0x01bb|0x01bc|0x01bd|0x01be|0x01bf|0x01c0|0x01c1|0x01c2|0x01c3|0x01c4|0x01c5|0x01c6|0x01c7|0x01c8|0x01c9|0x01ca|0x01cb|0x01cc|0x01cd|0x01ce|0x01cf|0x01d0|0x01d1|0x01d2|0x01d3|0x01d4|0x01d5|0x01d6|0x01d7|0x01d8|0x01d9|0x01da|0x01db|0x01dc|0x01dd|0x01de|0x01df|0x01e0|0x01e1|0x01e2|0x01e3|0x01e4|0x01e5|0x01e6|0x01e7|0x01e8|0x01e9|0x01ea|0x01eb|0x01ec|0x01ed|0x01ee|0x01ef|0x01f0|0x01f1|0x01f2|0x01f3|0x01f4|0x01f5|0x01f6|0x01f7|0x01f8|0x01f9|0x01fa|0x01fb|0x01fc|0x01fd|0x01fe|0x01ff)"; action "kldload -n uftdi"; }; @@ -3716,6 +3900,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x1b91"; + match "product" "0x0064"; + action "kldload -n uftdi"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x1bbb"; match "product" "(0x0000|0xf000)"; action "kldload -n u3g"; @@ -3732,6 +3924,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x1bc9"; + match "product" "0x6001"; + action "kldload -n uftdi"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x1be3"; match "product" "0x07a6"; action "kldload -n uslcom"; @@ -3740,6 +3940,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x1c0c"; + match "product" "0x0102"; + action "kldload -n uftdi"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x1c9e"; match "product" "(0x6061|0x9603|0x9605|0xf000)"; action "kldload -n u3g"; @@ -3788,6 +3996,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x1e29"; + match "product" "(0x0102|0x0501)"; + action "kldload -n uslcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x1eda"; match "product" "0x2310"; action "kldload -n if_run"; @@ -3924,6 +4140,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x20b7"; + match "product" "0x0713"; + action "kldload -n uftdi"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x20b8"; match "product" "0x8888"; action "kldload -n if_run"; @@ -3940,6 +4164,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x2100"; + match "product" "(0x9e52|0x9e54)"; + action "kldload -n uftdi"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x22b8"; match "product" "(0x4204|0x4214|0x4224|0x4234|0x4244)"; action "kldload -n uipaq"; @@ -3964,6 +4196,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x3195"; + match "product" "(0xf190|0xf280|0xf281)"; + action "kldload -n uslcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x3334"; match "product" "0x1701"; action "kldload -n if_aue"; @@ -4052,6 +4292,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x5050"; + match "product" "(0x0100|0x0101|0x0102|0x0103|0x0104|0x0105|0x0106|0x0107|0x0300|0x0301|0x0400|0x0500|0x0700|0x0800|0x0900|0x0a00|0x0b00|0x0c00|0x0d00|0x0e00|0x0f00|0x1000|0x8000|0x8001|0x8002|0x8003|0x8004|0x8005)"; + action "kldload -n uftdi"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x5173"; match "product" "0x1809"; action "kldload -n if_zyd"; @@ -4204,6 +4452,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0xdeee"; + match "product" "(0x0300|0x0302|0x0303)"; + action "kldload -n uftdi"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "intclass" "0x02"; match "intsubclass" "0x02"; match "intprotocol" "0x01"; @@ -4344,5 +4600,5 @@ nomatch 32 { action "kldload -n umass"; }; -# 1654 USB entries processed +# 2271 USB entries processed From owner-svn-src-all@FreeBSD.ORG Tue Sep 18 17:37:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7D1821065686; Tue, 18 Sep 2012 17:37:49 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe06.c2i.net [212.247.154.162]) by mx1.freebsd.org (Postfix) with ESMTP id 84C018FC17; Tue, 18 Sep 2012 17:37:47 +0000 (UTC) X-T2-Spam-Status: No, hits=-1.0 required=5.0 tests=ALL_TRUSTED Received: from [176.74.213.204] (account mc467741@c2i.net HELO laptop015.hselasky.homeunix.org) by mailfe06.swip.net (CommuniGate Pro SMTP 5.4.4) with ESMTPA id 320548105; Tue, 18 Sep 2012 19:37:46 +0200 From: Hans Petter Selasky To: Konstantin Belousov Date: Tue, 18 Sep 2012 19:38:58 +0200 User-Agent: KMail/1.13.7 (FreeBSD/9.1-PRERELEASE; KDE/4.8.4; amd64; ; ) References: <201209181628.q8IGSoOF024628@svn.freebsd.org> <20120918172705.GK37286@deviant.kiev.zoral.com.ua> In-Reply-To: <20120918172705.GK37286@deviant.kiev.zoral.com.ua> X-Face: 'mmZ:T{)),Oru^0c+/}w'`gU1$ubmG?lp!=R4Wy\ELYo2)@'UZ24N@d2+AyewRX}mAm; Yp |U[@, _z/([?1bCfM{_"B<.J>mICJCHAzzGHI{y7{%JVz%R~yJHIji`y>Y}k1C4TfysrsUI -%GU9V5]iUZF&nRn9mJ'?&>O MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201209181938.59008.hselasky@c2i.net> Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org Subject: Re: svn commit: r240659 - in stable/9/sys: dev/usb/net dev/usb/serial kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Sep 2012 17:37:49 -0000 On Tuesday 18 September 2012 19:27:05 Konstantin Belousov wrote: > On Tue, Sep 18, 2012 at 04:28:50PM +0000, Hans Petter Selasky wrote: > > Author: hselasky > > Date: Tue Sep 18 16:28:49 2012 > > New Revision: 240659 > > URL: http://svn.freebsd.org/changeset/base/240659 > > > > Log: > > MFC r239178, r239179, r239180, r239181, r239182 and r239299: > > > > Fix detach of USB serial devices so that it doesn't block > > the USB explore thread forever. To accomplish this two new > > functions have been added to the kernel, to claim and free > > the newbus allocated softc. > > > > This change is backwards API compatible, but not binary > > compatible. The FreeBSD version has been bumped to force > > a recompile of all kernel modules. > > Thank you, I run with this change since it was committed to head, and > the only issue left is that the same serial adapter reappears under the > different cuaUNN name after the glitch. This causes apcupsd to not able > to reconnect. > > And, the big question that still applies, is why UPSes are lost from the > USB bus ? Hi, Loss of VBUS (+5) and overcurrent are some natural reasons a device can suddenly disconnect. Do you have a bad/loose connector? Other reasons: Device firmware has restarted. Many serial applications fail to exit when reading from a serial device fails. --HPS From owner-svn-src-all@FreeBSD.ORG Tue Sep 18 17:45:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4A478106566B; Tue, 18 Sep 2012 17:45:20 +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 D3F038FC08; Tue, 18 Sep 2012 17:45:19 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q8IHjO4H034061; Tue, 18 Sep 2012 20:45:24 +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.5/8.14.5) with ESMTP id q8IHjCNX036459; Tue, 18 Sep 2012 20:45:12 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q8IHjCU0036458; Tue, 18 Sep 2012 20:45:12 +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: Tue, 18 Sep 2012 20:45:12 +0300 From: Konstantin Belousov To: Hans Petter Selasky Message-ID: <20120918174512.GL37286@deviant.kiev.zoral.com.ua> References: <201209181628.q8IGSoOF024628@svn.freebsd.org> <20120918172705.GK37286@deviant.kiev.zoral.com.ua> <201209181938.59008.hselasky@c2i.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="KasUm1oH6X2AfSvU" Content-Disposition: inline In-Reply-To: <201209181938.59008.hselasky@c2i.net> User-Agent: Mutt/1.5.21 (2010-09-15) X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.0 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham 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-9@freebsd.org Subject: Re: svn commit: r240659 - in stable/9/sys: dev/usb/net dev/usb/serial kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Sep 2012 17:45:20 -0000 --KasUm1oH6X2AfSvU Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Sep 18, 2012 at 07:38:58PM +0200, Hans Petter Selasky wrote: > On Tuesday 18 September 2012 19:27:05 Konstantin Belousov wrote: > > On Tue, Sep 18, 2012 at 04:28:50PM +0000, Hans Petter Selasky wrote: > > > Author: hselasky > > > Date: Tue Sep 18 16:28:49 2012 > > > New Revision: 240659 > > > URL: http://svn.freebsd.org/changeset/base/240659 > > >=20 > > > Log: > > > MFC r239178, r239179, r239180, r239181, r239182 and r239299: > > > =20 > > > Fix detach of USB serial devices so that it doesn't block > > > the USB explore thread forever. To accomplish this two new > > > functions have been added to the kernel, to claim and free > > > the newbus allocated softc. > > > =20 > > > This change is backwards API compatible, but not binary > > > compatible. The FreeBSD version has been bumped to force > > > a recompile of all kernel modules. > >=20 > > Thank you, I run with this change since it was committed to head, and > > the only issue left is that the same serial adapter reappears under the > > different cuaUNN name after the glitch. This causes apcupsd to not able > > to reconnect. > >=20 > > And, the big question that still applies, is why UPSes are lost from the > > USB bus ? >=20 > Hi, >=20 > Loss of VBUS (+5) and overcurrent are some natural reasons a device can= =20 > suddenly disconnect. >=20 > Do you have a bad/loose connector? I doubt it. The device reattaches momentarily after the loss. >=20 > Other reasons: Device firmware has restarted. Both 'devices' are APC UPSes, one is attached through the USB/serial cable driven by uplcom, another one (attached to different machine, with different chipset) is seen as gen device. I hear the relay clicks synchronous with the kernel reporting device lost. >=20 > Many serial applications fail to exit when reading from a serial device f= ails. This is apcupsd. --KasUm1oH6X2AfSvU Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAlBYsygACgkQC3+MBN1Mb4jAcQCg4oGFoGe1qUBqt/ASvLovQwlU EDQAn1/yVUucnO4WA22HDOS9uzn/HsyA =E29A -----END PGP SIGNATURE----- --KasUm1oH6X2AfSvU-- From owner-svn-src-all@FreeBSD.ORG Tue Sep 18 18:16:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 90C321065679; Tue, 18 Sep 2012 18:16:53 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 790468FC14; Tue, 18 Sep 2012 18:16:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8IIGrBT038931; Tue, 18 Sep 2012 18:16:53 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8IIGrSc038928; Tue, 18 Sep 2012 18:16:53 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201209181816.q8IIGrSc038928@svn.freebsd.org> From: Jim Harris Date: Tue, 18 Sep 2012 18:16:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240671 - head/sys/dev/nvme X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Sep 2012 18:16:53 -0000 Author: jimharris Date: Tue Sep 18 18:16:52 2012 New Revision: 240671 URL: http://svn.freebsd.org/changeset/base/240671 Log: Add __aligned(4) to NVMe defined data structures. This fixes issue in nvmecontrol(8), where clang throws a cast-align warning when casting a __packed structure pointer to a uint32_t pointer as part of printing raw hex output. Reported by: dhw Modified: head/sys/dev/nvme/nvme.h Modified: head/sys/dev/nvme/nvme.h ============================================================================== --- head/sys/dev/nvme/nvme.h Tue Sep 18 17:30:08 2012 (r240670) +++ head/sys/dev/nvme/nvme.h Tue Sep 18 18:16:52 2012 (r240671) @@ -513,7 +513,7 @@ struct nvme_controller_data { /* bytes 3072-4095: vendor specific */ uint8_t reserved7[1024]; -} __packed; +} __packed __aligned(4); struct nvme_namespace_data { @@ -603,7 +603,7 @@ struct nvme_namespace_data { uint8_t reserved6[192]; uint8_t vendor_specific[3712]; -}; +} __packed __aligned(4); enum nvme_log_page { @@ -661,7 +661,7 @@ struct nvme_health_information_page { uint64_t num_error_info_log_entries[2]; uint8_t reserved2[320]; -} __packed; +} __packed __aligned(4); #define NVME_TEST_MAX_THREADS 128 From owner-svn-src-all@FreeBSD.ORG Tue Sep 18 18:23:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4C120106566C; Tue, 18 Sep 2012 18:23:22 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 379238FC0A; Tue, 18 Sep 2012 18:23:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8IINM2h039789; Tue, 18 Sep 2012 18:23:22 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8IINMMp039787; Tue, 18 Sep 2012 18:23:22 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201209181823.q8IINMMp039787@svn.freebsd.org> From: Jim Harris Date: Tue, 18 Sep 2012 18:23:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240672 - head/sys/dev/nvme X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Sep 2012 18:23:22 -0000 Author: jimharris Date: Tue Sep 18 18:23:21 2012 New Revision: 240672 URL: http://svn.freebsd.org/changeset/base/240672 Log: Add #if 0 around nvme_async_event_cb() until NVMe AER functionality can be tested. This fixes a build warning found only with clang. Modified: head/sys/dev/nvme/nvme_ctrlr.c Modified: head/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- head/sys/dev/nvme/nvme_ctrlr.c Tue Sep 18 18:16:52 2012 (r240671) +++ head/sys/dev/nvme/nvme_ctrlr.c Tue Sep 18 18:23:21 2012 (r240672) @@ -381,6 +381,11 @@ nvme_ctrlr_reset(struct nvme_controller return (nvme_ctrlr_enable(ctrlr)); } +/* + * Disable this code for now, since Chatham doesn't support + * AERs so I have no good way to test them. + */ +#if 0 static void nvme_async_event_cb(void *arg, const struct nvme_completion *status) { @@ -398,6 +403,7 @@ nvme_async_event_cb(void *arg, const str nvme_ctrlr_cmd_asynchronous_event_request(ctrlr, nvme_async_event_cb, ctrlr); } +#endif static int nvme_ctrlr_identify(struct nvme_controller *ctrlr) From owner-svn-src-all@FreeBSD.ORG Tue Sep 18 19:08:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BABD81065692; Tue, 18 Sep 2012 19:08:08 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 90C9F8FC0A; Tue, 18 Sep 2012 19:08:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8IJ88cX045976; Tue, 18 Sep 2012 19:08:08 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8IJ88U5045970; Tue, 18 Sep 2012 19:08:08 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201209181908.q8IJ88U5045970@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 18 Sep 2012 19:08:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240673 - in stable/9/usr.sbin/pkg_install: add lib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Sep 2012 19:08:09 -0000 Author: jkim Date: Tue Sep 18 19:08:07 2012 New Revision: 240673 URL: http://svn.freebsd.org/changeset/base/240673 Log: MFC: r240476 Do not change owner, group, or mode when package database directory and its contents are created with pkg_add(1). It may happen when the packing list contains @owner, @group, or @mode. Approved by: portmgr (bapt) Modified: stable/9/usr.sbin/pkg_install/add/add.h stable/9/usr.sbin/pkg_install/add/extract.c stable/9/usr.sbin/pkg_install/add/futil.c stable/9/usr.sbin/pkg_install/add/perform.c stable/9/usr.sbin/pkg_install/lib/lib.h Directory Properties: stable/9/usr.sbin/pkg_install/ (props changed) stable/9/usr.sbin/pkg_install/add/ (props changed) Modified: stable/9/usr.sbin/pkg_install/add/add.h ============================================================================== --- stable/9/usr.sbin/pkg_install/add/add.h Tue Sep 18 18:23:21 2012 (r240672) +++ stable/9/usr.sbin/pkg_install/add/add.h Tue Sep 18 19:08:07 2012 (r240673) @@ -41,7 +41,7 @@ extern char *PkgAddCmd; extern char FirstPen[]; extern add_mode_t AddMode; -int make_hierarchy(char *); +int make_hierarchy(char *, Boolean); void extract_plist(const char *, Package *); void apply_perms(const char *, const char *); Modified: stable/9/usr.sbin/pkg_install/add/extract.c ============================================================================== --- stable/9/usr.sbin/pkg_install/add/extract.c Tue Sep 18 18:23:21 2012 (r240672) +++ stable/9/usr.sbin/pkg_install/add/extract.c Tue Sep 18 19:08:07 2012 (r240673) @@ -225,7 +225,7 @@ extract_plist(const char *home, Package printf("extract: CWD to %s\n", p->name); PUSHOUT(Directory); if (strcmp(p->name, ".")) { - if (!Fake && make_hierarchy(p->name) == FAIL) { + if (!Fake && make_hierarchy(p->name, TRUE) == FAIL) { cleanup(0); errx(2, "%s: unable to cwd to '%s'", __func__, p->name); } Modified: stable/9/usr.sbin/pkg_install/add/futil.c ============================================================================== --- stable/9/usr.sbin/pkg_install/add/futil.c Tue Sep 18 18:23:21 2012 (r240672) +++ stable/9/usr.sbin/pkg_install/add/futil.c Tue Sep 18 19:08:07 2012 (r240673) @@ -31,7 +31,7 @@ __FBSDID("$FreeBSD$"); */ int -make_hierarchy(char *dir) +make_hierarchy(char *dir, Boolean set_perm) { char *cp1, *cp2; @@ -55,7 +55,8 @@ make_hierarchy(char *dir) *cp2 = '/'; return FAIL; } - apply_perms(NULL, dir); + if (set_perm) + apply_perms(NULL, dir); } /* Put it back */ if (cp2) { Modified: stable/9/usr.sbin/pkg_install/add/perform.c ============================================================================== --- stable/9/usr.sbin/pkg_install/add/perform.c Tue Sep 18 18:23:21 2012 (r240672) +++ stable/9/usr.sbin/pkg_install/add/perform.c Tue Sep 18 19:08:07 2012 (r240673) @@ -511,7 +511,7 @@ pkg_do(char *pkg) zapLogDir = 1; if (Verbose) printf("Attempting to record package into %s..\n", LogDir); - if (make_hierarchy(LogDir)) { + if (make_hierarchy(LogDir, FALSE)) { warnx("can't record package into '%s', you're on your own!", LogDir); bzero(LogDir, FILENAME_MAX); Modified: stable/9/usr.sbin/pkg_install/lib/lib.h ============================================================================== --- stable/9/usr.sbin/pkg_install/lib/lib.h Tue Sep 18 18:23:21 2012 (r240672) +++ stable/9/usr.sbin/pkg_install/lib/lib.h Tue Sep 18 19:08:07 2012 (r240673) @@ -99,7 +99,7 @@ * Version of the package tools - increase whenever you make a change * in the code that is not cosmetic only. */ -#define PKG_INSTALL_VERSION 20120530 +#define PKG_INSTALL_VERSION 20120913 #define PKG_WRAPCONF_FNAME "/var/db/pkg_install.conf" #define main(argc, argv) real_main(argc, argv) From owner-svn-src-all@FreeBSD.ORG Tue Sep 18 20:20:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1A30D1065676; Tue, 18 Sep 2012 20:20:30 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 011048FC1C; Tue, 18 Sep 2012 20:20:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8IKKTnY055893; Tue, 18 Sep 2012 20:20:29 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8IKKT4q055880; Tue, 18 Sep 2012 20:20:29 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201209182020.q8IKKT4q055880@svn.freebsd.org> From: Baptiste Daroussin Date: Tue, 18 Sep 2012 20:20: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: r240674 - in stable/8/usr.sbin/pkg_install: add lib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Sep 2012 20:20:30 -0000 Author: bapt Date: Tue Sep 18 20:20:29 2012 New Revision: 240674 URL: http://svn.freebsd.org/changeset/base/240674 Log: MFC: r236213, r236333, r236336, r240476 - Let pkg_add use the ENV variable PACKAGESUFFIX - Make sure that each va_start has one and only one matching va_end - Do not change owner, group, or mode when package database directory and its contents are created with pkg_add(1). It may happen when the packing list contains @owner, @group, or @mode. Modified: stable/8/usr.sbin/pkg_install/add/add.h stable/8/usr.sbin/pkg_install/add/extract.c stable/8/usr.sbin/pkg_install/add/futil.c stable/8/usr.sbin/pkg_install/add/main.c stable/8/usr.sbin/pkg_install/add/perform.c stable/8/usr.sbin/pkg_install/add/pkg_add.1 stable/8/usr.sbin/pkg_install/lib/exec.c stable/8/usr.sbin/pkg_install/lib/file.c stable/8/usr.sbin/pkg_install/lib/lib.h stable/8/usr.sbin/pkg_install/lib/msg.c stable/8/usr.sbin/pkg_install/lib/url.c Directory Properties: stable/8/usr.sbin/pkg_install/ (props changed) stable/8/usr.sbin/pkg_install/add/ (props changed) Modified: stable/8/usr.sbin/pkg_install/add/add.h ============================================================================== --- stable/8/usr.sbin/pkg_install/add/add.h Tue Sep 18 19:08:07 2012 (r240673) +++ stable/8/usr.sbin/pkg_install/add/add.h Tue Sep 18 20:20:29 2012 (r240674) @@ -41,7 +41,7 @@ extern char *PkgAddCmd; extern char FirstPen[]; extern add_mode_t AddMode; -int make_hierarchy(char *); +int make_hierarchy(char *, Boolean); void extract_plist(const char *, Package *); void apply_perms(const char *, const char *); Modified: stable/8/usr.sbin/pkg_install/add/extract.c ============================================================================== --- stable/8/usr.sbin/pkg_install/add/extract.c Tue Sep 18 19:08:07 2012 (r240673) +++ stable/8/usr.sbin/pkg_install/add/extract.c Tue Sep 18 20:20:29 2012 (r240674) @@ -225,7 +225,7 @@ extract_plist(const char *home, Package printf("extract: CWD to %s\n", p->name); PUSHOUT(Directory); if (strcmp(p->name, ".")) { - if (!Fake && make_hierarchy(p->name) == FAIL) { + if (!Fake && make_hierarchy(p->name, TRUE) == FAIL) { cleanup(0); errx(2, "%s: unable to cwd to '%s'", __func__, p->name); } Modified: stable/8/usr.sbin/pkg_install/add/futil.c ============================================================================== --- stable/8/usr.sbin/pkg_install/add/futil.c Tue Sep 18 19:08:07 2012 (r240673) +++ stable/8/usr.sbin/pkg_install/add/futil.c Tue Sep 18 20:20:29 2012 (r240674) @@ -31,7 +31,7 @@ __FBSDID("$FreeBSD$"); */ int -make_hierarchy(char *dir) +make_hierarchy(char *dir, Boolean set_perm) { char *cp1, *cp2; @@ -55,7 +55,8 @@ make_hierarchy(char *dir) *cp2 = '/'; return FAIL; } - apply_perms(NULL, dir); + if (set_perm) + apply_perms(NULL, dir); } /* Put it back */ if (cp2) { Modified: stable/8/usr.sbin/pkg_install/add/main.c ============================================================================== --- stable/8/usr.sbin/pkg_install/add/main.c Tue Sep 18 19:08:07 2012 (r240673) +++ stable/8/usr.sbin/pkg_install/add/main.c Tue Sep 18 20:20:29 2012 (r240674) @@ -234,10 +234,17 @@ main(int argc, char **argv) remotepkg = temppackageroot; if (!((ptr = strrchr(remotepkg, '.')) && ptr[1] == 't' && (ptr[2] == 'b' || ptr[2] == 'g' || ptr[2] == 'x') && - ptr[3] == 'z' && !ptr[4])) - if (strlcat(remotepkg, ".tbz", - sizeof(temppackageroot)) >= sizeof(temppackageroot)) - errx(1, "package name too long"); + ptr[3] == 'z' && !ptr[4])) { + if (getenv("PACKAGESUFFIX")) { + if (strlcat(remotepkg, getenv("PACKAGESUFFIX"), + sizeof(temppackageroot)) >= sizeof(temppackageroot)) + errx(1, "package name too long"); + } else { + if (strlcat(remotepkg, ".tbz", + sizeof(temppackageroot)) >= sizeof(temppackageroot)) + errx(1, "package name too long"); + } + } } if (!strcmp(*argv, "-")) /* stdin? */ pkgs[ch] = (char *)"-"; Modified: stable/8/usr.sbin/pkg_install/add/perform.c ============================================================================== --- stable/8/usr.sbin/pkg_install/add/perform.c Tue Sep 18 19:08:07 2012 (r240673) +++ stable/8/usr.sbin/pkg_install/add/perform.c Tue Sep 18 20:20:29 2012 (r240674) @@ -307,8 +307,12 @@ pkg_do(char *pkg) *sep = '\0'; strlcat(subpkg, "/All/", sizeof subpkg); strlcat(subpkg, p->name, sizeof subpkg); - if ((ext = strrchr(pkg, '.')) == NULL) - ext = ".tbz"; + if ((ext = strrchr(pkg, '.')) == NULL) { + if (getenv("PACKAGESUFFIX")) + ext = getenv("PACKAGESUFFIX"); + else + ext = ".tbz"; + } strlcat(subpkg, ext, sizeof subpkg); pkg_do(subpkg); } @@ -345,8 +349,13 @@ pkg_do(char *pkg) const char *ext; ext = strrchr(pkg_fullname, '.'); - if (ext == NULL) - ext = ".tbz"; + if (ext == NULL) { + if (getenv("PACKAGESUFFIX")) { + ext = getenv("PACKAGESUFFIX"); + } else { + ext = ".tbz"; + } + } snprintf(path, FILENAME_MAX, "%s/%s%s", getenv("_TOP"), p->name, ext); if (fexists(path)) cp = path; @@ -502,7 +511,7 @@ pkg_do(char *pkg) zapLogDir = 1; if (Verbose) printf("Attempting to record package into %s..\n", LogDir); - if (make_hierarchy(LogDir)) { + if (make_hierarchy(LogDir, FALSE)) { warnx("can't record package into '%s', you're on your own!", LogDir); bzero(LogDir, FILENAME_MAX); Modified: stable/8/usr.sbin/pkg_install/add/pkg_add.1 ============================================================================== --- stable/8/usr.sbin/pkg_install/add/pkg_add.1 Tue Sep 18 19:08:07 2012 (r240673) +++ stable/8/usr.sbin/pkg_install/add/pkg_add.1 Tue Sep 18 20:20:29 2012 (r240674) @@ -553,6 +553,11 @@ The environment variable specifies an alternative location to save downloaded packages to when .Fl K option is used. +.Pp +The environment variable +.Ev PACKAGESUFFIX +specifies an alternative file extension to use when fetching remote +packages. Default is .tbz .Sh FILES .Bl -tag -width /var/db/pkg -compact .It Pa /var/tmp Modified: stable/8/usr.sbin/pkg_install/lib/exec.c ============================================================================== --- stable/8/usr.sbin/pkg_install/lib/exec.c Tue Sep 18 19:08:07 2012 (r240673) +++ stable/8/usr.sbin/pkg_install/lib/exec.c Tue Sep 18 20:20:29 2012 (r240674) @@ -47,6 +47,7 @@ vsystem(const char *fmt, ...) va_start(args, fmt); if (vsnprintf(cmd, maxargs, fmt, args) > maxargs) { warnx("vsystem args are too long"); + va_end(args); return 1; } #ifdef DEBUG @@ -82,6 +83,7 @@ vpipe(const char *fmt, ...) va_start(args, fmt); if (vsnprintf(cmd, maxargs, fmt, args) > maxargs) { warnx("vsystem args are too long"); + va_end(args); return NULL; } #ifdef DEBUG Modified: stable/8/usr.sbin/pkg_install/lib/file.c ============================================================================== --- stable/8/usr.sbin/pkg_install/lib/file.c Tue Sep 18 19:08:07 2012 (r240673) +++ stable/8/usr.sbin/pkg_install/lib/file.c Tue Sep 18 20:20:29 2012 (r240674) @@ -140,7 +140,7 @@ fileFindByPath(const char *base, const c { static char tmp[FILENAME_MAX]; char *cp; - const char *suffixes[] = {".tbz", ".tgz", ".tar", NULL}; + const char *suffixes[] = {".tbz", ".tgz", ".tar", ".txz", NULL}; int i; if (fexists(fname) && isfile(fname)) { Modified: stable/8/usr.sbin/pkg_install/lib/lib.h ============================================================================== --- stable/8/usr.sbin/pkg_install/lib/lib.h Tue Sep 18 19:08:07 2012 (r240673) +++ stable/8/usr.sbin/pkg_install/lib/lib.h Tue Sep 18 20:20:29 2012 (r240674) @@ -99,7 +99,7 @@ * Version of the package tools - increase whenever you make a change * in the code that is not cosmetic only. */ -#define PKG_INSTALL_VERSION 20100403 +#define PKG_INSTALL_VERSION 20120913 #define PKG_WRAPCONF_FNAME "/var/db/pkg_install.conf" #define main(argc, argv) real_main(argc, argv) Modified: stable/8/usr.sbin/pkg_install/lib/msg.c ============================================================================== --- stable/8/usr.sbin/pkg_install/lib/msg.c Tue Sep 18 19:08:07 2012 (r240673) +++ stable/8/usr.sbin/pkg_install/lib/msg.c Tue Sep 18 20:20:29 2012 (r240674) @@ -71,5 +71,6 @@ y_or_n(Boolean def, const char *msg, ... ch = (def) ? 'Y' : 'N'; } fclose(tty) ; + va_end(args); return (ch == 'Y') ? TRUE : FALSE; } Modified: stable/8/usr.sbin/pkg_install/lib/url.c ============================================================================== --- stable/8/usr.sbin/pkg_install/lib/url.c Tue Sep 18 19:08:07 2012 (r240673) +++ stable/8/usr.sbin/pkg_install/lib/url.c Tue Sep 18 20:20:29 2012 (r240674) @@ -73,7 +73,10 @@ fileGetURL(const char *base, const char *(cp + 1) = '\0'; strcat(cp, "All/"); strcat(cp, spec); - strcat(cp, ".tbz"); + if (getenv("PACKAGESUFFIX")) + strcat(cp, getenv("PACKAGESUFFIX")); + else + strcat(cp, ".tbz"); } else return NULL; @@ -85,7 +88,10 @@ fileGetURL(const char *base, const char */ strcpy(fname, hint); strcat(fname, spec); - strcat(fname, ".tbz"); + if (getenv("PACKAGESUFFIX")) + strcat(fname, getenv("PACKAGESUFFIX")); + else + strcat(fname, ".tbz"); } } else From owner-svn-src-all@FreeBSD.ORG Tue Sep 18 20:28:56 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 01BE8106566B; Tue, 18 Sep 2012 20:28:56 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E28298FC0A; Tue, 18 Sep 2012 20:28:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8IKStfM056966; Tue, 18 Sep 2012 20:28:55 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8IKStPK056964; Tue, 18 Sep 2012 20:28:55 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201209182028.q8IKStPK056964@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 18 Sep 2012 20:28:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240676 - head/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Sep 2012 20:28:56 -0000 Author: glebius Date: Tue Sep 18 20:28:55 2012 New Revision: 240676 URL: http://svn.freebsd.org/changeset/base/240676 Log: If caller specifies UMA_ZONE_OFFPAGE explicitly, then do not waste memory in an allocation for a slab. Reviewed by: jeff Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Tue Sep 18 20:28:01 2012 (r240675) +++ head/sys/vm/uma_core.c Tue Sep 18 20:28:55 2012 (r240676) @@ -1127,7 +1127,9 @@ keg_small_init(uma_keg_t keg) keg->uk_rsize = rsize; keg->uk_ppera = 1; - if (keg->uk_flags & UMA_ZONE_REFCNT) { + if (keg->uk_flags & UMA_ZONE_OFFPAGE) { + shsize = 0; + } else if (keg->uk_flags & UMA_ZONE_REFCNT) { rsize += UMA_FRITMREF_SZ; /* linkage & refcnt */ shsize = sizeof(struct uma_slab_refcnt); } else { From owner-svn-src-all@FreeBSD.ORG Tue Sep 18 20:33:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A30DA106566C; Tue, 18 Sep 2012 20:33:04 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8E2528FC0C; Tue, 18 Sep 2012 20:33:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8IKX4QH057549; Tue, 18 Sep 2012 20:33:04 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8IKX4O5057547; Tue, 18 Sep 2012 20:33:04 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201209182033.q8IKX4O5057547@svn.freebsd.org> From: Adrian Chadd Date: Tue, 18 Sep 2012 20:33:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240677 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Sep 2012 20:33:04 -0000 Author: adrian Date: Tue Sep 18 20:33:04 2012 New Revision: 240677 URL: http://svn.freebsd.org/changeset/base/240677 Log: Oops - take a copy of ath_tx_status from the buffer before the TX processing is done. The aggregate path was definitely accessing 'ts' before it was actually being assigned. This had the side effect of over-filtering frames, since occasionally that bit would be '1'. Whilst here, do the same thing in the non-aggregate completion function - as calling the filter function may also invalidate bf. Pointy hat to: adrian, for not noticing this over many, many code reviews. Modified: head/sys/dev/ath/if_ath_tx.c Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Tue Sep 18 20:28:55 2012 (r240676) +++ head/sys/dev/ath/if_ath_tx.c Tue Sep 18 20:33:04 2012 (r240677) @@ -3955,6 +3955,12 @@ ath_tx_aggr_comp_aggr(struct ath_softc * DPRINTF(sc, ATH_DEBUG_SW_TX_AGGR, "%s: called; hwq_depth=%d\n", __func__, atid->hwq_depth); + /* + * Take a copy; this may be needed -after- bf_first + * has been completed and freed. + */ + ts = bf_first->bf_status.ds_txstat; + TAILQ_INIT(&bf_q); TAILQ_INIT(&bf_cq); @@ -3970,6 +3976,8 @@ ath_tx_aggr_comp_aggr(struct ath_softc * * If the TID is filtered, handle completing the filter * transition before potentially kicking it to the cleanup * function. + * + * XXX this is duplicate work, ew. */ if (atid->isfiltered) ath_tx_tid_filt_comp_complete(sc, atid); @@ -4030,11 +4038,6 @@ ath_tx_aggr_comp_aggr(struct ath_softc * } /* - * Take a copy; this may be needed -after- bf_first - * has been completed and freed. - */ - ts = bf_first->bf_status.ds_txstat; - /* * XXX for now, use the first frame in the aggregate for * XXX rate control completion; it's at least consistent. */ @@ -4255,10 +4258,16 @@ ath_tx_aggr_comp_unaggr(struct ath_softc struct ath_node *an = ATH_NODE(ni); int tid = bf->bf_state.bfs_tid; struct ath_tid *atid = &an->an_tid[tid]; - struct ath_tx_status *ts = &bf->bf_status.ds_txstat; + struct ath_tx_status ts; int drops = 0; /* + * Take a copy of this; filtering/cloning the frame may free the + * bf pointer. + */ + ts = bf->bf_status.ds_txstat; + + /* * Update rate control status here, before we possibly * punt to retry or cleanup. * @@ -4268,7 +4277,7 @@ ath_tx_aggr_comp_unaggr(struct ath_softc ath_tx_update_ratectrl(sc, ni, bf->bf_state.bfs_rc, &bf->bf_status.ds_txstat, bf->bf_state.bfs_pktlen, - 1, (ts->ts_status == 0) ? 0 : 1); + 1, (ts.ts_status == 0) ? 0 : 1); /* * This is called early so atid->hwq_depth can be tracked. @@ -4328,8 +4337,8 @@ ath_tx_aggr_comp_unaggr(struct ath_softc * list as it will end up being recycled without having * been made available for the hardware. */ - if ((ts->ts_status & HAL_TXERR_FILT) || - (ts->ts_status != 0 && atid->isfiltered)) { + if ((ts.ts_status & HAL_TXERR_FILT) || + (ts.ts_status != 0 && atid->isfiltered)) { int freeframe; if (fail != 0) @@ -4383,7 +4392,7 @@ ath_tx_aggr_comp_unaggr(struct ath_softc #if 0 if (fail == 0 && ts->ts_status & HAL_TXERR_XRETRY) { #endif - if (fail == 0 && ts->ts_status != 0) { + if (fail == 0 && ts.ts_status != 0) { ATH_TXQ_UNLOCK(sc->sc_ac2q[atid->ac]); DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: retry_unaggr\n", __func__); From owner-svn-src-all@FreeBSD.ORG Tue Sep 18 22:05:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 318CF1065674; Tue, 18 Sep 2012 22:05:00 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1812D8FC12; Tue, 18 Sep 2012 22:05:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8IM50fD070498; Tue, 18 Sep 2012 22:05:00 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8IM4xMX070480; Tue, 18 Sep 2012 22:04:59 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201209182204.q8IM4xMX070480@svn.freebsd.org> From: Gavin Atkinson Date: Tue, 18 Sep 2012 22:04:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240680 - in head: sys/dev/alc sys/dev/bge sys/dev/cxgb sys/dev/cxgbe sys/dev/e1000 sys/dev/et sys/dev/jme sys/dev/pci sys/dev/re sys/ofed/include/linux sys/powerpc/mpc85xx usr.sbin/pci... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Sep 2012 22:05:00 -0000 Author: gavin Date: Tue Sep 18 22:04:59 2012 New Revision: 240680 URL: http://svn.freebsd.org/changeset/base/240680 Log: Align the PCI Express #defines with the style used for the PCI-X #defines. This also has the advantage that it makes the names more compact, iand also allows us to correct the non-uniform naming of the PCIM_LINK_* defines, making them all consistent amongst themselves. This is a mostly mechanical rename: s/PCIR_EXPRESS_/PCIER_/g s/PCIM_EXP_/PCIEM_/g s/PCIM_LINK_/PCIEM_LINK_/g When this is MFC'd, #defines will be added for the old names to assist out-of-tree drivers. Discussed with: jhb MFC after: 1 week Modified: head/sys/dev/alc/if_alc.c head/sys/dev/bge/if_bge.c head/sys/dev/cxgb/cxgb_main.c head/sys/dev/cxgb/cxgb_osdep.h head/sys/dev/cxgbe/osdep.h head/sys/dev/cxgbe/t4_main.c head/sys/dev/e1000/if_em.c head/sys/dev/et/if_et.c head/sys/dev/jme/if_jme.c head/sys/dev/pci/pci.c head/sys/dev/pci/pcireg.h head/sys/dev/re/if_re.c head/sys/ofed/include/linux/pci.h head/sys/powerpc/mpc85xx/pci_fdt.c head/usr.sbin/pciconf/cap.c head/usr.sbin/pciconf/err.c Modified: head/sys/dev/alc/if_alc.c ============================================================================== --- head/sys/dev/alc/if_alc.c Tue Sep 18 21:36:24 2012 (r240679) +++ head/sys/dev/alc/if_alc.c Tue Sep 18 22:04:59 2012 (r240680) @@ -683,7 +683,7 @@ alc_aspm(struct alc_softc *sc, int media if ((sc->alc_flags & (ALC_FLAG_APS | ALC_FLAG_PCIE)) == (ALC_FLAG_APS | ALC_FLAG_PCIE)) linkcfg = CSR_READ_2(sc, sc->alc_expcap + - PCIR_EXPRESS_LINK_CTL); + PCIER_LINK_CTL); else linkcfg = 0; pmcfg &= ~PM_CFG_SERDES_PD_EX_L1; @@ -698,7 +698,7 @@ alc_aspm(struct alc_softc *sc, int media if (sc->alc_ident->deviceid == DEVICEID_ATHEROS_AR8152_B && sc->alc_rev == ATHEROS_AR8152_B_V10) linkcfg |= 0x80; - CSR_WRITE_2(sc, sc->alc_expcap + PCIR_EXPRESS_LINK_CTL, + CSR_WRITE_2(sc, sc->alc_expcap + PCIER_LINK_CTL, linkcfg); pmcfg &= ~(PM_CFG_EN_BUFS_RX_L0S | PM_CFG_SA_DLY_ENB | PM_CFG_HOTRST); @@ -798,10 +798,10 @@ alc_attach(device_t dev) if (pci_find_cap(dev, PCIY_EXPRESS, &base) == 0) { sc->alc_flags |= ALC_FLAG_PCIE; sc->alc_expcap = base; - burst = CSR_READ_2(sc, base + PCIR_EXPRESS_DEVICE_CTL); + burst = CSR_READ_2(sc, base + PCIER_DEVICE_CTL); sc->alc_dma_rd_burst = - (burst & PCIM_EXP_CTL_MAX_READ_REQUEST) >> 12; - sc->alc_dma_wr_burst = (burst & PCIM_EXP_CTL_MAX_PAYLOAD) >> 5; + (burst & PCIEM_CTL_MAX_READ_REQUEST) >> 12; + sc->alc_dma_wr_burst = (burst & PCIEM_CTL_MAX_PAYLOAD) >> 5; if (bootverbose) { device_printf(dev, "Read request size : %u bytes.\n", alc_dma_burst[sc->alc_dma_rd_burst]); @@ -831,9 +831,9 @@ alc_attach(device_t dev) CSR_WRITE_4(sc, ALC_PCIE_PHYMISC2, val); } /* Disable ASPM L0S and L1. */ - cap = CSR_READ_2(sc, base + PCIR_EXPRESS_LINK_CAP); - if ((cap & PCIM_LINK_CAP_ASPM) != 0) { - ctl = CSR_READ_2(sc, base + PCIR_EXPRESS_LINK_CTL); + cap = CSR_READ_2(sc, base + PCIER_LINK_CAP); + if ((cap & PCIEM_LINK_CAP_ASPM) != 0) { + ctl = CSR_READ_2(sc, base + PCIER_LINK_CTL); if ((ctl & 0x08) != 0) sc->alc_rcb = DMA_CFG_RCB_128; if (bootverbose) Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Tue Sep 18 21:36:24 2012 (r240679) +++ head/sys/dev/bge/if_bge.c Tue Sep 18 22:04:59 2012 (r240680) @@ -3625,17 +3625,17 @@ bge_reset(struct bge_softc *sc) pci_write_config(dev, 0xC4, val | (1 << 15), 4); } devctl = pci_read_config(dev, - sc->bge_expcap + PCIR_EXPRESS_DEVICE_CTL, 2); + sc->bge_expcap + PCIER_DEVICE_CTL, 2); /* Clear enable no snoop and disable relaxed ordering. */ - devctl &= ~(PCIM_EXP_CTL_RELAXED_ORD_ENABLE | - PCIM_EXP_CTL_NOSNOOP_ENABLE); - pci_write_config(dev, sc->bge_expcap + PCIR_EXPRESS_DEVICE_CTL, + devctl &= ~(PCIEM_CTL_RELAXED_ORD_ENABLE | + PCIEM_CTL_NOSNOOP_ENABLE); + pci_write_config(dev, sc->bge_expcap + PCIER_DEVICE_CTL, devctl, 2); /* Clear error status. */ - pci_write_config(dev, sc->bge_expcap + PCIR_EXPRESS_DEVICE_STA, - PCIM_EXP_STA_CORRECTABLE_ERROR | - PCIM_EXP_STA_NON_FATAL_ERROR | PCIM_EXP_STA_FATAL_ERROR | - PCIM_EXP_STA_UNSUPPORTED_REQ, 2); + pci_write_config(dev, sc->bge_expcap + PCIER_DEVICE_STA, + PCIEM_STA_CORRECTABLE_ERROR | + PCIEM_STA_NON_FATAL_ERROR | PCIEM_STA_FATAL_ERROR | + PCIEM_STA_UNSUPPORTED_REQ, 2); } /* Reset some of the PCI state that got zapped by reset. */ Modified: head/sys/dev/cxgb/cxgb_main.c ============================================================================== --- head/sys/dev/cxgb/cxgb_main.c Tue Sep 18 21:36:24 2012 (r240679) +++ head/sys/dev/cxgb/cxgb_main.c Tue Sep 18 22:04:59 2012 (r240680) @@ -476,8 +476,8 @@ cxgb_controller_attach(device_t dev) if (pci_find_cap(dev, PCIY_EXPRESS, ®) == 0) { uint16_t lnk; - lnk = pci_read_config(dev, reg + PCIR_EXPRESS_LINK_STA, 2); - sc->link_width = (lnk & PCIM_LINK_STA_WIDTH) >> 4; + lnk = pci_read_config(dev, reg + PCIER_LINK_STA, 2); + sc->link_width = (lnk & PCIEM_LINK_STA_WIDTH) >> 4; if (sc->link_width < 8 && (ai->caps & SUPPORTED_10000baseT_Full)) { device_printf(sc->dev, Modified: head/sys/dev/cxgb/cxgb_osdep.h ============================================================================== --- head/sys/dev/cxgb/cxgb_osdep.h Tue Sep 18 21:36:24 2012 (r240679) +++ head/sys/dev/cxgb/cxgb_osdep.h Tue Sep 18 22:04:59 2012 (r240680) @@ -215,11 +215,11 @@ static const int debug_flags = DBG_RX; #define PCI_VPD_DATA PCIR_VPD_DATA #define PCI_CAP_ID_EXP PCIY_EXPRESS -#define PCI_EXP_DEVCTL PCIR_EXPRESS_DEVICE_CTL -#define PCI_EXP_DEVCTL_PAYLOAD PCIM_EXP_CTL_MAX_PAYLOAD -#define PCI_EXP_DEVCTL_READRQ PCIM_EXP_CTL_MAX_READ_REQUEST -#define PCI_EXP_LNKCTL PCIR_EXPRESS_LINK_CTL -#define PCI_EXP_LNKSTA PCIR_EXPRESS_LINK_STA +#define PCI_EXP_DEVCTL PCIER_DEVICE_CTL +#define PCI_EXP_DEVCTL_PAYLOAD PCIEM_CTL_MAX_PAYLOAD +#define PCI_EXP_DEVCTL_READRQ PCIEM_CTL_MAX_READ_REQUEST +#define PCI_EXP_LNKCTL PCIER_LINK_CTL +#define PCI_EXP_LNKSTA PCIER_LINK_STA /* * Linux compatibility macros Modified: head/sys/dev/cxgbe/osdep.h ============================================================================== --- head/sys/dev/cxgbe/osdep.h Tue Sep 18 21:36:24 2012 (r240679) +++ head/sys/dev/cxgbe/osdep.h Tue Sep 18 22:04:59 2012 (r240680) @@ -118,13 +118,13 @@ typedef boolean_t bool; #define PCI_VPD_DATA PCIR_VPD_DATA #define PCI_CAP_ID_EXP PCIY_EXPRESS -#define PCI_EXP_DEVCTL PCIR_EXPRESS_DEVICE_CTL -#define PCI_EXP_DEVCTL_PAYLOAD PCIM_EXP_CTL_MAX_PAYLOAD -#define PCI_EXP_DEVCTL_READRQ PCIM_EXP_CTL_MAX_READ_REQUEST -#define PCI_EXP_LNKCTL PCIR_EXPRESS_LINK_CTL -#define PCI_EXP_LNKSTA PCIR_EXPRESS_LINK_STA -#define PCI_EXP_LNKSTA_CLS PCIM_LINK_STA_SPEED -#define PCI_EXP_LNKSTA_NLW PCIM_LINK_STA_WIDTH +#define PCI_EXP_DEVCTL PCIER_DEVICE_CTL +#define PCI_EXP_DEVCTL_PAYLOAD PCIEM_CTL_MAX_PAYLOAD +#define PCI_EXP_DEVCTL_READRQ PCIEM_CTL_MAX_READ_REQUEST +#define PCI_EXP_LNKCTL PCIER_LINK_CTL +#define PCI_EXP_LNKSTA PCIER_LINK_STA +#define PCI_EXP_LNKSTA_CLS PCIEM_LINK_STA_SPEED +#define PCI_EXP_LNKSTA_NLW PCIEM_LINK_STA_WIDTH #define PCI_EXP_DEVCTL2 0x28 static inline int Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Tue Sep 18 21:36:24 2012 (r240679) +++ head/sys/dev/cxgbe/t4_main.c Tue Sep 18 22:04:59 2012 (r240680) @@ -429,9 +429,9 @@ t4_attach(device_t dev) uint32_t v; pci_set_max_read_req(dev, 4096); - v = pci_read_config(dev, i + PCIR_EXPRESS_DEVICE_CTL, 2); - v |= PCIM_EXP_CTL_RELAXED_ORD_ENABLE; - pci_write_config(dev, i + PCIR_EXPRESS_DEVICE_CTL, v, 2); + v = pci_read_config(dev, i + PCIER_DEVICE_CTL, 2); + v |= PCIEM_CTL_RELAXED_ORD_ENABLE; + pci_write_config(dev, i + PCIER_DEVICE_CTL, v, 2); } snprintf(sc->lockname, sizeof(sc->lockname), "%s", Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Tue Sep 18 21:36:24 2012 (r240679) +++ head/sys/dev/e1000/if_em.c Tue Sep 18 22:04:59 2012 (r240680) @@ -5113,11 +5113,11 @@ em_disable_aspm(struct adapter *adapter) } if (pci_find_cap(dev, PCIY_EXPRESS, &base) != 0) return; - reg = base + PCIR_EXPRESS_LINK_CAP; + reg = base + PCIER_LINK_CAP; link_cap = pci_read_config(dev, reg, 2); - if ((link_cap & PCIM_LINK_CAP_ASPM) == 0) + if ((link_cap & PCIEM_LINK_CAP_ASPM) == 0) return; - reg = base + PCIR_EXPRESS_LINK_CTL; + reg = base + PCIER_LINK_CTL; link_ctrl = pci_read_config(dev, reg, 2); link_ctrl &= 0xFFFC; /* turn off bit 1 and 2 */ pci_write_config(dev, reg, link_ctrl, 2); Modified: head/sys/dev/et/if_et.c ============================================================================== --- head/sys/dev/et/if_et.c Tue Sep 18 21:36:24 2012 (r240679) +++ head/sys/dev/et/if_et.c Tue Sep 18 22:04:59 2012 (r240680) @@ -700,8 +700,8 @@ et_bus_config(struct et_softc *sc) * max playload size */ val = pci_read_config(sc->dev, - sc->sc_expcap + PCIR_EXPRESS_DEVICE_CAP, 4); - max_plsz = val & PCIM_EXP_CAP_MAX_PAYLOAD; + sc->sc_expcap + PCIER_DEVICE_CAP, 4); + max_plsz = val & PCIEM_CAP_MAX_PAYLOAD; switch (max_plsz) { case ET_PCIV_DEVICE_CAPS_PLSZ_128: @@ -732,7 +732,7 @@ et_bus_config(struct et_softc *sc) * Set L0s and L1 latency timer to 2us */ val = pci_read_config(sc->dev, ET_PCIR_L0S_L1_LATENCY, 4); - val &= ~(PCIM_LINK_CAP_L0S_EXIT | PCIM_LINK_CAP_L1_EXIT); + val &= ~(PCIEM_LINK_CAP_L0S_EXIT | PCIEM_LINK_CAP_L1_EXIT); /* L0s exit latency : 2us */ val |= 0x00005000; /* L1 exit latency : 2us */ Modified: head/sys/dev/jme/if_jme.c ============================================================================== --- head/sys/dev/jme/if_jme.c Tue Sep 18 21:36:24 2012 (r240679) +++ head/sys/dev/jme/if_jme.c Tue Sep 18 22:04:59 2012 (r240680) @@ -778,7 +778,7 @@ jme_attach(device_t dev) /* Set max allowable DMA size. */ if (pci_find_cap(dev, PCIY_EXPRESS, &i) == 0) { sc->jme_flags |= JME_FLAG_PCIE; - burst = pci_read_config(dev, i + PCIR_EXPRESS_DEVICE_CTL, 2); + burst = pci_read_config(dev, i + PCIER_DEVICE_CTL, 2); if (bootverbose) { device_printf(dev, "Read request size : %d bytes.\n", 128 << ((burst >> 12) & 0x07)); Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Tue Sep 18 21:36:24 2012 (r240679) +++ head/sys/dev/pci/pci.c Tue Sep 18 22:04:59 2012 (r240680) @@ -743,8 +743,8 @@ pci_read_cap(device_t pcib, pcicfgregs * */ pcie_chipset = 1; cfg->pcie.pcie_location = ptr; - val = REG(ptr + PCIR_EXPRESS_FLAGS, 2); - cfg->pcie.pcie_type = val & PCIM_EXP_FLAGS_TYPE; + val = REG(ptr + PCIER_FLAGS, 2); + cfg->pcie.pcie_type = val & PCIEM_FLAGS_TYPE; break; default: break; @@ -1791,8 +1791,8 @@ pci_get_max_read_req(device_t dev) cap = dinfo->cfg.pcie.pcie_location; if (cap == 0) return (0); - val = pci_read_config(dev, cap + PCIR_EXPRESS_DEVICE_CTL, 2); - val &= PCIM_EXP_CTL_MAX_READ_REQUEST; + val = pci_read_config(dev, cap + PCIER_DEVICE_CTL, 2); + val &= PCIEM_CTL_MAX_READ_REQUEST; val >>= 12; return (1 << (val + 7)); } @@ -1812,10 +1812,10 @@ pci_set_max_read_req(device_t dev, int s if (size > 4096) size = 4096; size = (1 << (fls(size) - 1)); - val = pci_read_config(dev, cap + PCIR_EXPRESS_DEVICE_CTL, 2); - val &= ~PCIM_EXP_CTL_MAX_READ_REQUEST; + val = pci_read_config(dev, cap + PCIER_DEVICE_CTL, 2); + val &= ~PCIEM_CTL_MAX_READ_REQUEST; val |= (fls(size) - 8) << 12; - pci_write_config(dev, cap + PCIR_EXPRESS_DEVICE_CTL, val, 2); + pci_write_config(dev, cap + PCIER_DEVICE_CTL, val, 2); return (size); } @@ -4469,28 +4469,28 @@ pci_cfg_restore_pcie(device_t dev, struc cfg = &dinfo->cfg.pcie; pos = cfg->pcie_location; - version = cfg->pcie_flags & PCIM_EXP_FLAGS_VERSION; + version = cfg->pcie_flags & PCIEM_FLAGS_VERSION; - WREG(PCIR_EXPRESS_DEVICE_CTL, cfg->pcie_device_ctl); + WREG(PCIER_DEVICE_CTL, cfg->pcie_device_ctl); - if (version > 1 || cfg->pcie_type == PCIM_EXP_TYPE_ROOT_PORT || - cfg->pcie_type == PCIM_EXP_TYPE_ENDPOINT || - cfg->pcie_type == PCIM_EXP_TYPE_LEGACY_ENDPOINT) - WREG(PCIR_EXPRESS_LINK_CTL, cfg->pcie_link_ctl); - - if (version > 1 || (cfg->pcie_type == PCIM_EXP_TYPE_ROOT_PORT || - (cfg->pcie_type == PCIM_EXP_TYPE_DOWNSTREAM_PORT && - (cfg->pcie_flags & PCIM_EXP_FLAGS_SLOT)))) - WREG(PCIR_EXPRESS_SLOT_CTL, cfg->pcie_slot_ctl); - - if (version > 1 || cfg->pcie_type == PCIM_EXP_TYPE_ROOT_PORT || - cfg->pcie_type == PCIM_EXP_TYPE_ROOT_EC) - WREG(PCIR_EXPRESS_ROOT_CTL, cfg->pcie_root_ctl); + if (version > 1 || cfg->pcie_type == PCIEM_TYPE_ROOT_PORT || + cfg->pcie_type == PCIEM_TYPE_ENDPOINT || + cfg->pcie_type == PCIEM_TYPE_LEGACY_ENDPOINT) + WREG(PCIER_LINK_CTL, cfg->pcie_link_ctl); + + if (version > 1 || (cfg->pcie_type == PCIEM_TYPE_ROOT_PORT || + (cfg->pcie_type == PCIEM_TYPE_DOWNSTREAM_PORT && + (cfg->pcie_flags & PCIEM_FLAGS_SLOT)))) + WREG(PCIER_SLOT_CTL, cfg->pcie_slot_ctl); + + if (version > 1 || cfg->pcie_type == PCIEM_TYPE_ROOT_PORT || + cfg->pcie_type == PCIEM_TYPE_ROOT_EC) + WREG(PCIER_ROOT_CTL, cfg->pcie_root_ctl); if (version > 1) { - WREG(PCIR_EXPRESS_DEVICE_CTL2, cfg->pcie_device_ctl2); - WREG(PCIR_EXPRESS_LINK_CTL2, cfg->pcie_link_ctl2); - WREG(PCIR_EXPRESS_SLOT_CTL2, cfg->pcie_slot_ctl2); + WREG(PCIER_DEVICE_CTL2, cfg->pcie_device_ctl2); + WREG(PCIER_LINK_CTL2, cfg->pcie_link_ctl2); + WREG(PCIER_SLOT_CTL2, cfg->pcie_slot_ctl2); } #undef WREG } @@ -4562,30 +4562,30 @@ pci_cfg_save_pcie(device_t dev, struct p cfg = &dinfo->cfg.pcie; pos = cfg->pcie_location; - cfg->pcie_flags = RREG(PCIR_EXPRESS_FLAGS); + cfg->pcie_flags = RREG(PCIER_FLAGS); - version = cfg->pcie_flags & PCIM_EXP_FLAGS_VERSION; + version = cfg->pcie_flags & PCIEM_FLAGS_VERSION; - cfg->pcie_device_ctl = RREG(PCIR_EXPRESS_DEVICE_CTL); + cfg->pcie_device_ctl = RREG(PCIER_DEVICE_CTL); - if (version > 1 || cfg->pcie_type == PCIM_EXP_TYPE_ROOT_PORT || - cfg->pcie_type == PCIM_EXP_TYPE_ENDPOINT || - cfg->pcie_type == PCIM_EXP_TYPE_LEGACY_ENDPOINT) - cfg->pcie_link_ctl = RREG(PCIR_EXPRESS_LINK_CTL); + if (version > 1 || cfg->pcie_type == PCIEM_TYPE_ROOT_PORT || + cfg->pcie_type == PCIEM_TYPE_ENDPOINT || + cfg->pcie_type == PCIEM_TYPE_LEGACY_ENDPOINT) + cfg->pcie_link_ctl = RREG(PCIER_LINK_CTL); - if (version > 1 || (cfg->pcie_type == PCIM_EXP_TYPE_ROOT_PORT || - (cfg->pcie_type == PCIM_EXP_TYPE_DOWNSTREAM_PORT && - (cfg->pcie_flags & PCIM_EXP_FLAGS_SLOT)))) - cfg->pcie_slot_ctl = RREG(PCIR_EXPRESS_SLOT_CTL); + if (version > 1 || (cfg->pcie_type == PCIEM_TYPE_ROOT_PORT || + (cfg->pcie_type == PCIEM_TYPE_DOWNSTREAM_PORT && + (cfg->pcie_flags & PCIEM_FLAGS_SLOT)))) + cfg->pcie_slot_ctl = RREG(PCIER_SLOT_CTL); - if (version > 1 || cfg->pcie_type == PCIM_EXP_TYPE_ROOT_PORT || - cfg->pcie_type == PCIM_EXP_TYPE_ROOT_EC) - cfg->pcie_root_ctl = RREG(PCIR_EXPRESS_ROOT_CTL); + if (version > 1 || cfg->pcie_type == PCIEM_TYPE_ROOT_PORT || + cfg->pcie_type == PCIEM_TYPE_ROOT_EC) + cfg->pcie_root_ctl = RREG(PCIER_ROOT_CTL); if (version > 1) { - cfg->pcie_device_ctl2 = RREG(PCIR_EXPRESS_DEVICE_CTL2); - cfg->pcie_link_ctl2 = RREG(PCIR_EXPRESS_LINK_CTL2); - cfg->pcie_slot_ctl2 = RREG(PCIR_EXPRESS_SLOT_CTL2); + cfg->pcie_device_ctl2 = RREG(PCIER_DEVICE_CTL2); + cfg->pcie_link_ctl2 = RREG(PCIER_LINK_CTL2); + cfg->pcie_slot_ctl2 = RREG(PCIER_SLOT_CTL2); } #undef RREG } Modified: head/sys/dev/pci/pcireg.h ============================================================================== --- head/sys/dev/pci/pcireg.h Tue Sep 18 21:36:24 2012 (r240679) +++ head/sys/dev/pci/pcireg.h Tue Sep 18 22:04:59 2012 (r240680) @@ -629,147 +629,147 @@ #define PCIR_SUBVENDCAP_ID 0x4 /* PCI Express definitions */ -#define PCIR_EXPRESS_FLAGS 0x2 -#define PCIM_EXP_FLAGS_VERSION 0x000F -#define PCIM_EXP_FLAGS_TYPE 0x00F0 -#define PCIM_EXP_TYPE_ENDPOINT 0x0000 -#define PCIM_EXP_TYPE_LEGACY_ENDPOINT 0x0010 -#define PCIM_EXP_TYPE_ROOT_PORT 0x0040 -#define PCIM_EXP_TYPE_UPSTREAM_PORT 0x0050 -#define PCIM_EXP_TYPE_DOWNSTREAM_PORT 0x0060 -#define PCIM_EXP_TYPE_PCI_BRIDGE 0x0070 -#define PCIM_EXP_TYPE_PCIE_BRIDGE 0x0080 -#define PCIM_EXP_TYPE_ROOT_INT_EP 0x0090 -#define PCIM_EXP_TYPE_ROOT_EC 0x00a0 -#define PCIM_EXP_FLAGS_SLOT 0x0100 -#define PCIM_EXP_FLAGS_IRQ 0x3e00 -#define PCIR_EXPRESS_DEVICE_CAP 0x4 -#define PCIM_EXP_CAP_MAX_PAYLOAD 0x00000007 -#define PCIM_EXP_CAP_PHANTHOM_FUNCS 0x00000018 -#define PCIM_EXP_CAP_EXT_TAG_FIELD 0x00000020 -#define PCIM_EXP_CAP_L0S_LATENCY 0x000001c0 -#define PCIM_EXP_CAP_L1_LATENCY 0x00000e00 -#define PCIM_EXP_CAP_ROLE_ERR_RPT 0x00008000 -#define PCIM_EXP_CAP_SLOT_PWR_LIM_VAL 0x03fc0000 -#define PCIM_EXP_CAP_SLOT_PWR_LIM_SCALE 0x0c000000 -#define PCIM_EXP_CAP_FLR 0x10000000 -#define PCIR_EXPRESS_DEVICE_CTL 0x8 -#define PCIM_EXP_CTL_COR_ENABLE 0x0001 -#define PCIM_EXP_CTL_NFER_ENABLE 0x0002 -#define PCIM_EXP_CTL_FER_ENABLE 0x0004 -#define PCIM_EXP_CTL_URR_ENABLE 0x0008 -#define PCIM_EXP_CTL_RELAXED_ORD_ENABLE 0x0010 -#define PCIM_EXP_CTL_MAX_PAYLOAD 0x00e0 -#define PCIM_EXP_CTL_EXT_TAG_FIELD 0x0100 -#define PCIM_EXP_CTL_PHANTHOM_FUNCS 0x0200 -#define PCIM_EXP_CTL_AUX_POWER_PM 0x0400 -#define PCIM_EXP_CTL_NOSNOOP_ENABLE 0x0800 -#define PCIM_EXP_CTL_MAX_READ_REQUEST 0x7000 -#define PCIM_EXP_CTL_BRDG_CFG_RETRY 0x8000 /* PCI-E - PCI/PCI-X bridges */ -#define PCIM_EXP_CTL_INITIATE_FLR 0x8000 /* FLR capable endpoints */ -#define PCIR_EXPRESS_DEVICE_STA 0xa -#define PCIM_EXP_STA_CORRECTABLE_ERROR 0x0001 -#define PCIM_EXP_STA_NON_FATAL_ERROR 0x0002 -#define PCIM_EXP_STA_FATAL_ERROR 0x0004 -#define PCIM_EXP_STA_UNSUPPORTED_REQ 0x0008 -#define PCIM_EXP_STA_AUX_POWER 0x0010 -#define PCIM_EXP_STA_TRANSACTION_PND 0x0020 -#define PCIR_EXPRESS_LINK_CAP 0xc -#define PCIM_LINK_CAP_MAX_SPEED 0x0000000f -#define PCIM_LINK_CAP_MAX_WIDTH 0x000003f0 -#define PCIM_LINK_CAP_ASPM 0x00000c00 -#define PCIM_LINK_CAP_L0S_EXIT 0x00007000 -#define PCIM_LINK_CAP_L1_EXIT 0x00038000 -#define PCIM_LINK_CAP_CLOCK_PM 0x00040000 -#define PCIM_LINK_CAP_SURPRISE_DOWN 0x00080000 -#define PCIM_LINK_CAP_DL_ACTIVE 0x00100000 -#define PCIM_LINK_CAP_LINK_BW_NOTIFY 0x00200000 -#define PCIM_LINK_CAP_ASPM_COMPLIANCE 0x00400000 -#define PCIM_LINK_CAP_PORT 0xff000000 -#define PCIR_EXPRESS_LINK_CTL 0x10 -#define PCIM_EXP_LINK_CTL_ASPMC_DIS 0x0000 -#define PCIM_EXP_LINK_CTL_ASPMC_L0S 0x0001 -#define PCIM_EXP_LINK_CTL_ASPMC_L1 0x0002 -#define PCIM_EXP_LINK_CTL_ASPMC 0x0003 -#define PCIM_EXP_LINK_CTL_RCB 0x0008 -#define PCIM_EXP_LINK_CTL_LINK_DIS 0x0010 -#define PCIM_EXP_LINK_CTL_RETRAIN_LINK 0x0020 -#define PCIM_EXP_LINK_CTL_COMMON_CLOCK 0x0040 -#define PCIM_EXP_LINK_CTL_EXTENDED_SYNC 0x0080 -#define PCIM_EXP_LINK_CTL_ECPM 0x0100 -#define PCIM_EXP_LINK_CTL_HAWD 0x0200 -#define PCIM_EXP_LINK_CTL_LBMIE 0x0400 -#define PCIM_EXP_LINK_CTL_LABIE 0x0800 -#define PCIR_EXPRESS_LINK_STA 0x12 -#define PCIM_LINK_STA_SPEED 0x000f -#define PCIM_LINK_STA_WIDTH 0x03f0 -#define PCIM_LINK_STA_TRAINING_ERROR 0x0400 -#define PCIM_LINK_STA_TRAINING 0x0800 -#define PCIM_LINK_STA_SLOT_CLOCK 0x1000 -#define PCIM_LINK_STA_DL_ACTIVE 0x2000 -#define PCIM_LINK_STA_LINK_BW_MGMT 0x4000 -#define PCIM_LINK_STA_LINK_AUTO_BW 0x8000 -#define PCIR_EXPRESS_SLOT_CAP 0x14 -#define PCIM_EXP_SLOT_CAP_APB 0x00000001 -#define PCIM_EXP_SLOT_CAP_PCP 0x00000002 -#define PCIM_EXP_SLOT_CAP_MRLSP 0x00000004 -#define PCIM_EXP_SLOT_CAP_AIP 0x00000008 -#define PCIM_EXP_SLOT_CAP_PIP 0x00000010 -#define PCIM_EXP_SLOT_CAP_HPS 0x00000020 -#define PCIM_EXP_SLOT_CAP_HPC 0x00000040 -#define PCIM_EXP_SLOT_CAP_SPLV 0x00007f80 -#define PCIM_EXP_SLOT_CAP_SPLS 0x00018000 -#define PCIM_EXP_SLOT_CAP_EIP 0x00020000 -#define PCIM_EXP_SLOT_CAP_NCCS 0x00040000 -#define PCIM_EXP_SLOT_CAP_PSN 0xfff80000 -#define PCIR_EXPRESS_SLOT_CTL 0x18 -#define PCIM_EXP_SLOT_CTL_ABPE 0x0001 -#define PCIM_EXP_SLOT_CTL_PFDE 0x0002 -#define PCIM_EXP_SLOT_CTL_MRLSCE 0x0004 -#define PCIM_EXP_SLOT_CTL_PDCE 0x0008 -#define PCIM_EXP_SLOT_CTL_CCIE 0x0010 -#define PCIM_EXP_SLOT_CTL_HPIE 0x0020 -#define PCIM_EXP_SLOT_CTL_AIC 0x00c0 -#define PCIM_EXP_SLOT_CTL_PIC 0x0300 -#define PCIM_EXP_SLOT_CTL_PCC 0x0400 -#define PCIM_EXP_SLOT_CTL_EIC 0x0800 -#define PCIM_EXP_SLOT_CTL_DLLSCE 0x1000 -#define PCIR_EXPRESS_SLOT_STA 0x1a -#define PCIM_EXP_SLOT_STA_ABP 0x0001 -#define PCIM_EXP_SLOT_STA_PFD 0x0002 -#define PCIM_EXP_SLOT_STA_MRLSC 0x0004 -#define PCIM_EXP_SLOT_STA_PDC 0x0008 -#define PCIM_EXP_SLOT_STA_CC 0x0010 -#define PCIM_EXP_SLOT_STA_MRLSS 0x0020 -#define PCIM_EXP_SLOT_STA_PDS 0x0040 -#define PCIM_EXP_SLOT_STA_EIS 0x0080 -#define PCIM_EXP_SLOT_STA_DLLSC 0x0100 -#define PCIR_EXPRESS_ROOT_CTL 0x1c -#define PCIR_EXPRESS_ROOT_CAP 0x1e -#define PCIR_EXPRESS_ROOT_STA 0x20 -#define PCIR_EXPRESS_DEVICE_CAP2 0x24 -#define PCIR_EXPRESS_DEVICE_CTL2 0x28 -#define PCIM_EXP_CTL2_COMP_TIMEOUT_VAL 0x000f -#define PCIM_EXP_CTL2_COMP_TIMEOUT_DIS 0x0010 -#define PCIM_EXP_CTL2_ARI 0x0020 -#define PCIM_EXP_CTL2_ATOMIC_REQ_ENABLE 0x0040 -#define PCIM_EXP_CTL2_ATOMIC_EGR_BLOCK 0x0080 -#define PCIM_EXP_CTL2_ID_ORDERED_REQ_EN 0x0100 -#define PCIM_EXP_CTL2_ID_ORDERED_CMP_EN 0x0200 -#define PCIM_EXP_CTL2_LTR_ENABLE 0x0400 -#define PCIM_EXP_CTL2_OBFF 0x6000 -#define PCIM_EXP_OBFF_DISABLE 0x0000 -#define PCIM_EXP_OBFF_MSGA_ENABLE 0x2000 -#define PCIM_EXP_OBFF_MSGB_ENABLE 0x4000 -#define PCIM_EXP_OBFF_WAKE_ENABLE 0x6000 -#define PCIM_EXP_CTL2_END2END_TLP 0x8000 -#define PCIR_EXPRESS_DEVICE_STA2 0x2a -#define PCIR_EXPRESS_LINK_CAP2 0x2c -#define PCIR_EXPRESS_LINK_CTL2 0x30 -#define PCIR_EXPRESS_LINK_STA2 0x32 -#define PCIR_EXPRESS_SLOT_CAP2 0x34 -#define PCIR_EXPRESS_SLOT_CTL2 0x38 -#define PCIR_EXPRESS_SLOT_STA2 0x3a +#define PCIER_FLAGS 0x2 +#define PCIEM_FLAGS_VERSION 0x000F +#define PCIEM_FLAGS_TYPE 0x00F0 +#define PCIEM_TYPE_ENDPOINT 0x0000 +#define PCIEM_TYPE_LEGACY_ENDPOINT 0x0010 +#define PCIEM_TYPE_ROOT_PORT 0x0040 +#define PCIEM_TYPE_UPSTREAM_PORT 0x0050 +#define PCIEM_TYPE_DOWNSTREAM_PORT 0x0060 +#define PCIEM_TYPE_PCI_BRIDGE 0x0070 +#define PCIEM_TYPE_PCIE_BRIDGE 0x0080 +#define PCIEM_TYPE_ROOT_INT_EP 0x0090 +#define PCIEM_TYPE_ROOT_EC 0x00a0 +#define PCIEM_FLAGS_SLOT 0x0100 +#define PCIEM_FLAGS_IRQ 0x3e00 +#define PCIER_DEVICE_CAP 0x4 +#define PCIEM_CAP_MAX_PAYLOAD 0x00000007 +#define PCIEM_CAP_PHANTHOM_FUNCS 0x00000018 +#define PCIEM_CAP_EXT_TAG_FIELD 0x00000020 +#define PCIEM_CAP_L0S_LATENCY 0x000001c0 +#define PCIEM_CAP_L1_LATENCY 0x00000e00 +#define PCIEM_CAP_ROLE_ERR_RPT 0x00008000 +#define PCIEM_CAP_SLOT_PWR_LIM_VAL 0x03fc0000 +#define PCIEM_CAP_SLOT_PWR_LIM_SCALE 0x0c000000 +#define PCIEM_CAP_FLR 0x10000000 +#define PCIER_DEVICE_CTL 0x8 +#define PCIEM_CTL_COR_ENABLE 0x0001 +#define PCIEM_CTL_NFER_ENABLE 0x0002 +#define PCIEM_CTL_FER_ENABLE 0x0004 +#define PCIEM_CTL_URR_ENABLE 0x0008 +#define PCIEM_CTL_RELAXED_ORD_ENABLE 0x0010 +#define PCIEM_CTL_MAX_PAYLOAD 0x00e0 +#define PCIEM_CTL_EXT_TAG_FIELD 0x0100 +#define PCIEM_CTL_PHANTHOM_FUNCS 0x0200 +#define PCIEM_CTL_AUX_POWER_PM 0x0400 +#define PCIEM_CTL_NOSNOOP_ENABLE 0x0800 +#define PCIEM_CTL_MAX_READ_REQUEST 0x7000 +#define PCIEM_CTL_BRDG_CFG_RETRY 0x8000 /* PCI-E - PCI/PCI-X bridges */ +#define PCIEM_CTL_INITIATE_FLR 0x8000 /* FLR capable endpoints */ +#define PCIER_DEVICE_STA 0xa +#define PCIEM_STA_CORRECTABLE_ERROR 0x0001 +#define PCIEM_STA_NON_FATAL_ERROR 0x0002 +#define PCIEM_STA_FATAL_ERROR 0x0004 +#define PCIEM_STA_UNSUPPORTED_REQ 0x0008 +#define PCIEM_STA_AUX_POWER 0x0010 +#define PCIEM_STA_TRANSACTION_PND 0x0020 +#define PCIER_LINK_CAP 0xc +#define PCIEM_LINK_CAP_MAX_SPEED 0x0000000f +#define PCIEM_LINK_CAP_MAX_WIDTH 0x000003f0 +#define PCIEM_LINK_CAP_ASPM 0x00000c00 +#define PCIEM_LINK_CAP_L0S_EXIT 0x00007000 +#define PCIEM_LINK_CAP_L1_EXIT 0x00038000 +#define PCIEM_LINK_CAP_CLOCK_PM 0x00040000 +#define PCIEM_LINK_CAP_SURPRISE_DOWN 0x00080000 +#define PCIEM_LINK_CAP_DL_ACTIVE 0x00100000 +#define PCIEM_LINK_CAP_LINK_BW_NOTIFY 0x00200000 +#define PCIEM_LINK_CAP_ASPM_COMPLIANCE 0x00400000 +#define PCIEM_LINK_CAP_PORT 0xff000000 +#define PCIER_LINK_CTL 0x10 +#define PCIEM_LINK_CTL_ASPMC_DIS 0x0000 +#define PCIEM_LINK_CTL_ASPMC_L0S 0x0001 +#define PCIEM_LINK_CTL_ASPMC_L1 0x0002 +#define PCIEM_LINK_CTL_ASPMC 0x0003 +#define PCIEM_LINK_CTL_RCB 0x0008 +#define PCIEM_LINK_CTL_LINK_DIS 0x0010 +#define PCIEM_LINK_CTL_RETRAIN_LINK 0x0020 +#define PCIEM_LINK_CTL_COMMON_CLOCK 0x0040 +#define PCIEM_LINK_CTL_EXTENDED_SYNC 0x0080 +#define PCIEM_LINK_CTL_ECPM 0x0100 +#define PCIEM_LINK_CTL_HAWD 0x0200 +#define PCIEM_LINK_CTL_LBMIE 0x0400 +#define PCIEM_LINK_CTL_LABIE 0x0800 +#define PCIER_LINK_STA 0x12 +#define PCIEM_LINK_STA_SPEED 0x000f +#define PCIEM_LINK_STA_WIDTH 0x03f0 +#define PCIEM_LINK_STA_TRAINING_ERROR 0x0400 +#define PCIEM_LINK_STA_TRAINING 0x0800 +#define PCIEM_LINK_STA_SLOT_CLOCK 0x1000 +#define PCIEM_LINK_STA_DL_ACTIVE 0x2000 +#define PCIEM_LINK_STA_LINK_BW_MGMT 0x4000 +#define PCIEM_LINK_STA_LINK_AUTO_BW 0x8000 +#define PCIER_SLOT_CAP 0x14 +#define PCIEM_SLOT_CAP_APB 0x00000001 +#define PCIEM_SLOT_CAP_PCP 0x00000002 +#define PCIEM_SLOT_CAP_MRLSP 0x00000004 +#define PCIEM_SLOT_CAP_AIP 0x00000008 +#define PCIEM_SLOT_CAP_PIP 0x00000010 +#define PCIEM_SLOT_CAP_HPS 0x00000020 +#define PCIEM_SLOT_CAP_HPC 0x00000040 +#define PCIEM_SLOT_CAP_SPLV 0x00007f80 +#define PCIEM_SLOT_CAP_SPLS 0x00018000 +#define PCIEM_SLOT_CAP_EIP 0x00020000 +#define PCIEM_SLOT_CAP_NCCS 0x00040000 +#define PCIEM_SLOT_CAP_PSN 0xfff80000 +#define PCIER_SLOT_CTL 0x18 +#define PCIEM_SLOT_CTL_ABPE 0x0001 +#define PCIEM_SLOT_CTL_PFDE 0x0002 +#define PCIEM_SLOT_CTL_MRLSCE 0x0004 +#define PCIEM_SLOT_CTL_PDCE 0x0008 +#define PCIEM_SLOT_CTL_CCIE 0x0010 +#define PCIEM_SLOT_CTL_HPIE 0x0020 +#define PCIEM_SLOT_CTL_AIC 0x00c0 +#define PCIEM_SLOT_CTL_PIC 0x0300 +#define PCIEM_SLOT_CTL_PCC 0x0400 +#define PCIEM_SLOT_CTL_EIC 0x0800 +#define PCIEM_SLOT_CTL_DLLSCE 0x1000 +#define PCIER_SLOT_STA 0x1a +#define PCIEM_SLOT_STA_ABP 0x0001 +#define PCIEM_SLOT_STA_PFD 0x0002 +#define PCIEM_SLOT_STA_MRLSC 0x0004 +#define PCIEM_SLOT_STA_PDC 0x0008 +#define PCIEM_SLOT_STA_CC 0x0010 +#define PCIEM_SLOT_STA_MRLSS 0x0020 +#define PCIEM_SLOT_STA_PDS 0x0040 +#define PCIEM_SLOT_STA_EIS 0x0080 +#define PCIEM_SLOT_STA_DLLSC 0x0100 +#define PCIER_ROOT_CTL 0x1c +#define PCIER_ROOT_CAP 0x1e +#define PCIER_ROOT_STA 0x20 +#define PCIER_DEVICE_CAP2 0x24 +#define PCIER_DEVICE_CTL2 0x28 +#define PCIEM_CTL2_COMP_TIMEOUT_VAL 0x000f +#define PCIEM_CTL2_COMP_TIMEOUT_DIS 0x0010 +#define PCIEM_CTL2_ARI 0x0020 +#define PCIEM_CTL2_ATOMIC_REQ_ENABLE 0x0040 +#define PCIEM_CTL2_ATOMIC_EGR_BLOCK 0x0080 +#define PCIEM_CTL2_ID_ORDERED_REQ_EN 0x0100 +#define PCIEM_CTL2_ID_ORDERED_CMP_EN 0x0200 +#define PCIEM_CTL2_LTR_ENABLE 0x0400 +#define PCIEM_CTL2_OBFF 0x6000 +#define PCIEM_OBFF_DISABLE 0x0000 +#define PCIEM_OBFF_MSGA_ENABLE 0x2000 +#define PCIEM_OBFF_MSGB_ENABLE 0x4000 +#define PCIEM_OBFF_WAKE_ENABLE 0x6000 +#define PCIEM_CTL2_END2END_TLP 0x8000 +#define PCIER_DEVICE_STA2 0x2a +#define PCIER_LINK_CAP2 0x2c +#define PCIER_LINK_CTL2 0x30 +#define PCIER_LINK_STA2 0x32 +#define PCIER_SLOT_CAP2 0x34 +#define PCIER_SLOT_CTL2 0x38 +#define PCIER_SLOT_STA2 0x3a /* MSI-X definitions */ #define PCIR_MSIX_CTRL 0x2 Modified: head/sys/dev/re/if_re.c ============================================================================== --- head/sys/dev/re/if_re.c Tue Sep 18 21:36:24 2012 (r240679) +++ head/sys/dev/re/if_re.c Tue Sep 18 22:04:59 2012 (r240680) @@ -1343,14 +1343,14 @@ re_attach(device_t dev) /* Disable ASPM L0S/L1. */ if (sc->rl_expcap != 0) { cap = pci_read_config(dev, sc->rl_expcap + - PCIR_EXPRESS_LINK_CAP, 2); - if ((cap & PCIM_LINK_CAP_ASPM) != 0) { + PCIER_LINK_CAP, 2); + if ((cap & PCIEM_LINK_CAP_ASPM) != 0) { ctl = pci_read_config(dev, sc->rl_expcap + - PCIR_EXPRESS_LINK_CTL, 2); + PCIER_LINK_CTL, 2); if ((ctl & 0x0003) != 0) { ctl &= ~0x0003; pci_write_config(dev, sc->rl_expcap + - PCIR_EXPRESS_LINK_CTL, ctl, 2); + PCIER_LINK_CTL, ctl, 2); device_printf(dev, "ASPM disabled\n"); } } else Modified: head/sys/ofed/include/linux/pci.h ============================================================================== --- head/sys/ofed/include/linux/pci.h Tue Sep 18 21:36:24 2012 (r240679) +++ head/sys/ofed/include/linux/pci.h Tue Sep 18 22:04:59 2012 (r240680) @@ -82,8 +82,8 @@ struct pci_device_id { #define PCI_VENDOR_ID PCIR_DEVVENDOR #define PCI_COMMAND PCIR_COMMAND -#define PCI_EXP_DEVCTL PCIR_EXPRESS_DEVICE_CTL -#define PCI_EXP_LNKCTL PCIR_EXPRESS_LINK_CTL +#define PCI_EXP_DEVCTL PCIER_DEVICE_CTL +#define PCI_EXP_LNKCTL PCIER_LINK_CTL #define IORESOURCE_MEM SYS_RES_MEMORY #define IORESOURCE_IO SYS_RES_IOPORT Modified: head/sys/powerpc/mpc85xx/pci_fdt.c ============================================================================== --- head/sys/powerpc/mpc85xx/pci_fdt.c Tue Sep 18 21:36:24 2012 (r240679) +++ head/sys/powerpc/mpc85xx/pci_fdt.c Tue Sep 18 22:04:59 2012 (r240680) @@ -848,10 +848,10 @@ fsl_pcib_err_init(device_t dev) 0xffffffff); dsr = fsl_pcib_cfgread(sc, 0, 0, 0, - sc->sc_pcie_capreg + PCIR_EXPRESS_DEVICE_STA, 2); + sc->sc_pcie_capreg + PCIER_DEVICE_STA, 2); if (dsr) fsl_pcib_cfgwrite(sc, 0, 0, 0, - sc->sc_pcie_capreg + PCIR_EXPRESS_DEVICE_STA, + sc->sc_pcie_capreg + PCIER_DEVICE_STA, 0xffff, 2); /* Enable all errors reporting */ @@ -861,11 +861,11 @@ fsl_pcib_err_init(device_t dev) /* Enable error reporting: URR, FER, NFER */ dcr = fsl_pcib_cfgread(sc, 0, 0, 0, - sc->sc_pcie_capreg + PCIR_EXPRESS_DEVICE_CTL, 4); - dcr |= PCIM_EXP_CTL_URR_ENABLE | PCIM_EXP_CTL_FER_ENABLE | - PCIM_EXP_CTL_NFER_ENABLE; + sc->sc_pcie_capreg + PCIER_DEVICE_CTL, 4); + dcr |= PCIEM_CTL_URR_ENABLE | PCIEM_CTL_FER_ENABLE | + PCIEM_CTL_NFER_ENABLE; fsl_pcib_cfgwrite(sc, 0, 0, 0, - sc->sc_pcie_capreg + PCIR_EXPRESS_DEVICE_CTL, dcr, 4); + sc->sc_pcie_capreg + PCIER_DEVICE_CTL, dcr, 4); } } Modified: head/usr.sbin/pciconf/cap.c ============================================================================== --- head/usr.sbin/pciconf/cap.c Tue Sep 18 21:36:24 2012 (r240679) +++ head/usr.sbin/pciconf/cap.c Tue Sep 18 22:04:59 2012 (r240680) @@ -369,55 +369,55 @@ cap_express(int fd, struct pci_conf *p, uint32_t val; uint16_t flags; - flags = read_config(fd, &p->pc_sel, ptr + PCIR_EXPRESS_FLAGS, 2); - printf("PCI-Express %d ", flags & PCIM_EXP_FLAGS_VERSION); - switch (flags & PCIM_EXP_FLAGS_TYPE) { - case PCIM_EXP_TYPE_ENDPOINT: + flags = read_config(fd, &p->pc_sel, ptr + PCIER_FLAGS, 2); + printf("PCI-Express %d ", flags & PCIEM_FLAGS_VERSION); + switch (flags & PCIEM_FLAGS_TYPE) { + case PCIEM_TYPE_ENDPOINT: printf("endpoint"); break; - case PCIM_EXP_TYPE_LEGACY_ENDPOINT: + case PCIEM_TYPE_LEGACY_ENDPOINT: printf("legacy endpoint"); break; - case PCIM_EXP_TYPE_ROOT_PORT: + case PCIEM_TYPE_ROOT_PORT: printf("root port"); break; - case PCIM_EXP_TYPE_UPSTREAM_PORT: + case PCIEM_TYPE_UPSTREAM_PORT: printf("upstream port"); break; - case PCIM_EXP_TYPE_DOWNSTREAM_PORT: + case PCIEM_TYPE_DOWNSTREAM_PORT: printf("downstream port"); break; - case PCIM_EXP_TYPE_PCI_BRIDGE: + case PCIEM_TYPE_PCI_BRIDGE: printf("PCI bridge"); break; - case PCIM_EXP_TYPE_PCIE_BRIDGE: + case PCIEM_TYPE_PCIE_BRIDGE: printf("PCI to PCIe bridge"); break; - case PCIM_EXP_TYPE_ROOT_INT_EP: + case PCIEM_TYPE_ROOT_INT_EP: printf("root endpoint"); break; - case PCIM_EXP_TYPE_ROOT_EC: + case PCIEM_TYPE_ROOT_EC: printf("event collector"); break; default: - printf("type %d", (flags & PCIM_EXP_FLAGS_TYPE) >> 4); + printf("type %d", (flags & PCIEM_FLAGS_TYPE) >> 4); break; } - if (flags & PCIM_EXP_FLAGS_SLOT) + if (flags & PCIEM_FLAGS_SLOT) printf(" slot"); - if (flags & PCIM_EXP_FLAGS_IRQ) - printf(" IRQ %d", (flags & PCIM_EXP_FLAGS_IRQ) >> 9); - val = read_config(fd, &p->pc_sel, ptr + PCIR_EXPRESS_DEVICE_CAP, 4); - flags = read_config(fd, &p->pc_sel, ptr + PCIR_EXPRESS_DEVICE_CTL, 2); + if (flags & PCIEM_FLAGS_IRQ) + printf(" IRQ %d", (flags & PCIEM_FLAGS_IRQ) >> 9); + val = read_config(fd, &p->pc_sel, ptr + PCIER_DEVICE_CAP, 4); + flags = read_config(fd, &p->pc_sel, ptr + PCIER_DEVICE_CTL, 2); printf(" max data %d(%d)", - MAX_PAYLOAD((flags & PCIM_EXP_CTL_MAX_PAYLOAD) >> 5), - MAX_PAYLOAD(val & PCIM_EXP_CAP_MAX_PAYLOAD)); - if (val & PCIM_EXP_CAP_FLR) + MAX_PAYLOAD((flags & PCIEM_CTL_MAX_PAYLOAD) >> 5), + MAX_PAYLOAD(val & PCIEM_CAP_MAX_PAYLOAD)); + if (val & PCIEM_CAP_FLR) printf(" FLR"); - val = read_config(fd, &p->pc_sel, ptr + PCIR_EXPRESS_LINK_CAP, 4); - flags = read_config(fd, &p->pc_sel, ptr+ PCIR_EXPRESS_LINK_STA, 2); - printf(" link x%d(x%d)", (flags & PCIM_LINK_STA_WIDTH) >> 4, - (val & PCIM_LINK_CAP_MAX_WIDTH) >> 4); + val = read_config(fd, &p->pc_sel, ptr + PCIER_LINK_CAP, 4); + flags = read_config(fd, &p->pc_sel, ptr+ PCIER_LINK_STA, 2); + printf(" link x%d(x%d)", (flags & PCIEM_LINK_STA_WIDTH) >> 4, + (val & PCIEM_LINK_CAP_MAX_WIDTH) >> 4); } static void Modified: head/usr.sbin/pciconf/err.c ============================================================================== --- head/usr.sbin/pciconf/err.c Tue Sep 18 21:36:24 2012 (r240679) +++ head/usr.sbin/pciconf/err.c Tue Sep 18 22:04:59 2012 (r240680) @@ -63,18 +63,18 @@ static struct bit_table pci_status[] = { /* Error indicators in the PCI-Express device status register. */ static struct bit_table pcie_device_status[] = { - { PCIM_EXP_STA_CORRECTABLE_ERROR, "Correctable Error Detected" }, - { PCIM_EXP_STA_NON_FATAL_ERROR, "Non-Fatal Error Detected" }, - { PCIM_EXP_STA_FATAL_ERROR, "Fatal Error Detected" }, - { PCIM_EXP_STA_UNSUPPORTED_REQ, "Unsupported Request Detected" }, + { PCIEM_STA_CORRECTABLE_ERROR, "Correctable Error Detected" }, + { PCIEM_STA_NON_FATAL_ERROR, "Non-Fatal Error Detected" }, + { PCIEM_STA_FATAL_ERROR, "Fatal Error Detected" }, + { PCIEM_STA_UNSUPPORTED_REQ, "Unsupported Request Detected" }, { 0, NULL }, }; /* Valid error indicator bits in the PCI-Express device status register. */ -#define PCIE_ERRORS (PCIM_EXP_STA_CORRECTABLE_ERROR | \ - PCIM_EXP_STA_NON_FATAL_ERROR | \ - PCIM_EXP_STA_FATAL_ERROR | \ - PCIM_EXP_STA_UNSUPPORTED_REQ) +#define PCIE_ERRORS (PCIEM_STA_CORRECTABLE_ERROR | \ + PCIEM_STA_NON_FATAL_ERROR | \ + PCIEM_STA_FATAL_ERROR | \ + PCIEM_STA_UNSUPPORTED_REQ) /* AER Uncorrected errors. */ static struct bit_table aer_uc[] = { @@ -153,7 +153,7 @@ list_errors(int fd, struct pci_conf *p) return; /* Check for PCI-e errors. */ - sta = read_config(fd, &p->pc_sel, pcie + PCIR_EXPRESS_DEVICE_STA, 2); + sta = read_config(fd, &p->pc_sel, pcie + PCIER_DEVICE_STA, 2); print_bits("PCI-e errors", pcie_device_status, sta & PCIE_ERRORS); /* See if this device supports AER. */ From owner-svn-src-all@FreeBSD.ORG Tue Sep 18 22:09:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A959A1065780; Tue, 18 Sep 2012 22:09:24 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 92D968FC1A; Tue, 18 Sep 2012 22:09:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8IM9OAb071106; Tue, 18 Sep 2012 22:09:24 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8IM9OfK071096; Tue, 18 Sep 2012 22:09:24 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201209182209.q8IM9OfK071096@svn.freebsd.org> From: Baptiste Daroussin Date: Tue, 18 Sep 2012 22:09:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240682 - in head/usr.sbin/pkg_install: add create info lib version X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Sep 2012 22:09:24 -0000 Author: bapt Date: Tue Sep 18 22:09:23 2012 New Revision: 240682 URL: http://svn.freebsd.org/changeset/base/240682 Log: if a file in plist starts with / then do not prefix it with "prefix" [1] pkg info -g returns 1 if a file mismatch [2] flush stdout in pkg info -g [3] clean up quiet mode (-q | --quiet) output of pkg_version(1) [4] fix missing error call in uname check added to pkg_version(1) [5] fix pkg_add(1) fails to install with -C from bad path [6] only resolve path from pkg_add(1) -p if the given prefix do not start with a '/' [7] PR: bin/13128 [1] bin/139015 [2] bin/113702 [3] bin/142570 [4] bin/146857 [5] bin/157543 [6] Submitted by: cy [1] Anton Yuzhaninov [2] Ighighi [3] "N.J. Mann" [4] gcooper [5] David Naylor [6] netchild [7] MFC after: 2 weeks Modified: head/usr.sbin/pkg_install/add/main.c head/usr.sbin/pkg_install/create/perform.c head/usr.sbin/pkg_install/info/info.h head/usr.sbin/pkg_install/info/perform.c head/usr.sbin/pkg_install/info/show.c head/usr.sbin/pkg_install/lib/lib.h head/usr.sbin/pkg_install/lib/plist.c head/usr.sbin/pkg_install/version/perform.c Modified: head/usr.sbin/pkg_install/add/main.c ============================================================================== --- head/usr.sbin/pkg_install/add/main.c Tue Sep 18 22:08:51 2012 (r240681) +++ head/usr.sbin/pkg_install/add/main.c Tue Sep 18 22:09:23 2012 (r240682) @@ -288,7 +288,9 @@ main(int argc, char **argv) } /* Perform chroot if requested */ if (Chroot != NULL) { - if (chroot(Chroot)) + if (chdir(Chroot)) + errx(1, "chdir to %s failed", Chroot); + if (chroot(".")) errx(1, "chroot to %s failed", Chroot); } /* Make sure the sub-execs we invoke get found */ Modified: head/usr.sbin/pkg_install/create/perform.c ============================================================================== --- head/usr.sbin/pkg_install/create/perform.c Tue Sep 18 22:08:51 2012 (r240681) +++ head/usr.sbin/pkg_install/create/perform.c Tue Sep 18 22:09:23 2012 (r240682) @@ -215,10 +215,14 @@ pkg_perform(char **pkgs) /* Prefix should add an @cwd to the packing list */ if (Prefix) { - char resolved_prefix[PATH_MAX]; - if (realpath(Prefix, resolved_prefix) == NULL) - err(EXIT_FAILURE, "couldn't resolve path for prefix: %s", Prefix); - add_plist_top(&plist, PLIST_CWD, resolved_prefix); + if (Prefix[0] != '/') { + char resolved_prefix[PATH_MAX]; + if (realpath(Prefix, resolved_prefix) == NULL) + err(EXIT_FAILURE, "couldn't resolve path for prefix: %s", Prefix); + add_plist_top(&plist, PLIST_CWD, resolved_prefix); + } else { + add_plist_top(&plist, PLIST_CWD, Prefix); + } } /* Add the origin if asked, at the top */ Modified: head/usr.sbin/pkg_install/info/info.h ============================================================================== --- head/usr.sbin/pkg_install/info/info.h Tue Sep 18 22:08:51 2012 (r240681) +++ head/usr.sbin/pkg_install/info/info.h Tue Sep 18 22:09:23 2012 (r240682) @@ -77,7 +77,7 @@ extern void show_plist(const char *, Pac extern void show_files(const char *, Package *); extern void show_index(const char *, const char *); extern void show_size(const char *, Package *); -extern void show_cksum(const char *, Package *); +extern int show_cksum(const char *, Package *); extern void show_origin(const char *, Package *); extern void show_fmtrev(const char *, Package *); Modified: head/usr.sbin/pkg_install/info/perform.c ============================================================================== --- head/usr.sbin/pkg_install/info/perform.c Tue Sep 18 22:08:51 2012 (r240681) +++ head/usr.sbin/pkg_install/info/perform.c Tue Sep 18 22:09:23 2012 (r240682) @@ -221,7 +221,7 @@ pkg_do(char *pkg) if ((Flags & SHOW_SIZE) && installed) show_size("Package Size:\n", &plist); if ((Flags & SHOW_CKSUM) && installed) - show_cksum("Mismatched Checksums:\n", &plist); + code += show_cksum("Mismatched Checksums:\n", &plist); if (Flags & SHOW_ORIGIN) show_origin("Origin:\n", &plist); if (Flags & SHOW_FMTREV) @@ -234,7 +234,7 @@ pkg_do(char *pkg) leave_playpen(); if (isTMP) unlink(fname); - return code; + return (code ? 1 : 0); } void Modified: head/usr.sbin/pkg_install/info/show.c ============================================================================== --- head/usr.sbin/pkg_install/info/show.c Tue Sep 18 22:08:51 2012 (r240681) +++ head/usr.sbin/pkg_install/info/show.c Tue Sep 18 22:09:23 2012 (r240682) @@ -61,8 +61,10 @@ show_index(const char *title, const char strlcpy(line, "???\n", sizeof(line)); - if (!Quiet) + if (!Quiet) { printf("%s%s", InfoPrefix, title); + fflush(stdout); + } fp = fopen(fname, "r"); if (fp == (FILE *) NULL) { warnx("show_file: can't open '%s' for reading", fname); @@ -88,8 +90,10 @@ show_plist(const char *title, Package *p Boolean ign = FALSE; char *prefix = NULL; - if (!Quiet) + if (!Quiet) { printf("%s%s", InfoPrefix, title); + fflush(stdout); + } p = plist->head; while (p) { if (p->type != type && showall != TRUE) { @@ -272,8 +276,10 @@ show_size(const char *title, Package *pl char *prefix = NULL; descr = getbsize(&headerlen, &blksize); - if (!Quiet) + if (!Quiet) { printf("%s%s", InfoPrefix, title); + fflush(stdout); + } for (p = plist->head; p != NULL; p = p->next) { switch (p->type) { case PLIST_FILE: @@ -316,16 +322,19 @@ show_size(const char *title, Package *pl } /* Show files that don't match the recorded checksum */ -void +int show_cksum(const char *title, Package *plist) { PackingList p; const char *dir = "."; char *prefix = NULL; char tmp[FILENAME_MAX]; + int errcode = 0; - if (!Quiet) + if (!Quiet) { printf("%s%s", InfoPrefix, title); + fflush(stdout); + } for (p = plist->head; p != NULL; p = p->next) if (p->type == PLIST_CWD) { @@ -337,9 +346,10 @@ show_cksum(const char *title, Package *p dir = p->name; } else if (p->type == PLIST_FILE) { snprintf(tmp, FILENAME_MAX, "%s/%s", elide_root(dir), p->name); - if (!fexists(tmp)) + if (!fexists(tmp)) { warnx("%s doesn't exist", tmp); - else if (p->next && p->next->type == PLIST_COMMENT && + errcode = 1; + } else if (p->next && p->next->type == PLIST_COMMENT && (strncmp(p->next->name, "MD5:", 4) == 0)) { char *cp = NULL, buf[33]; @@ -366,6 +376,7 @@ show_cksum(const char *title, Package *p } } } + return (errcode); } /* Show an "origin" path (usually category/portname) */ @@ -373,8 +384,10 @@ void show_origin(const char *title, Package *plist) { - if (!Quiet) + if (!Quiet) { printf("%s%s", InfoPrefix, title); + fflush(stdout); + } printf("%s\n", plist->origin != NULL ? plist->origin : ""); } @@ -383,7 +396,9 @@ void show_fmtrev(const char *title, Package *plist) { - if (!Quiet) + if (!Quiet) { printf("%s%s", InfoPrefix, title); + fflush(stdout); + } printf("%d.%d\n", plist->fmtver_maj, plist->fmtver_mnr); } Modified: head/usr.sbin/pkg_install/lib/lib.h ============================================================================== --- head/usr.sbin/pkg_install/lib/lib.h Tue Sep 18 22:08:51 2012 (r240681) +++ head/usr.sbin/pkg_install/lib/lib.h Tue Sep 18 22:09:23 2012 (r240682) @@ -99,7 +99,7 @@ * Version of the package tools - increase whenever you make a change * in the code that is not cosmetic only. */ -#define PKG_INSTALL_VERSION 20120913 +#define PKG_INSTALL_VERSION 20120918 #define PKG_WRAPCONF_FNAME "/var/db/pkg_install.conf" #define main(argc, argv) real_main(argc, argv) Modified: head/usr.sbin/pkg_install/lib/plist.c ============================================================================== --- head/usr.sbin/pkg_install/lib/plist.c Tue Sep 18 22:08:51 2012 (r240681) +++ head/usr.sbin/pkg_install/lib/plist.c Tue Sep 18 22:09:23 2012 (r240682) @@ -458,7 +458,10 @@ delete_package(Boolean ign_err, Boolean case PLIST_FILE: last_file = p->name; - sprintf(tmp, "%s/%s", Where, p->name); + if (*p->name == '/') + strlcpy(tmp, p->name, FILENAME_MAX); + else + sprintf(tmp, "%s/%s", Where, p->name); if (isdir(tmp) && fexists(tmp) && !issymlink(tmp)) { warnx("cannot delete specified file '%s' - it is a directory!\n" "this packing list is incorrect - ignoring delete request", tmp); Modified: head/usr.sbin/pkg_install/version/perform.c ============================================================================== --- head/usr.sbin/pkg_install/version/perform.c Tue Sep 18 22:08:51 2012 (r240681) +++ head/usr.sbin/pkg_install/version/perform.c Tue Sep 18 22:09:23 2012 (r240682) @@ -56,10 +56,11 @@ pkg_perform(char **indexarg) struct utsname u; if (uname(&u) == -1) { - warn("%s(): failed to determine uname information", __func__); + warn("%s: failed to determine uname information", __func__); return 1; } else if ((rel_major_ver = (int) strtol(u.release, NULL, 10)) <= 0) { - + warnx("%s: bad release version specified: %s", __func__, u.release); + return 1; } /* @@ -321,19 +322,31 @@ show_version(Package plist, const char * ver = strrchr(latest, '-'); ver = ver ? &ver[1] : latest; if (cmp < 0 && OUTPUT('<')) { - printf("%-34s %c", tmp, Quiet ? '\0' : '<'); - if (Verbose) - printf(" needs updating (%s has %s)", source, ver); + if (Quiet) + printf("%s", tmp); + else { + printf("%-34s <", tmp); + if (Verbose) + printf(" needs updating (%s has %s)", source, ver); + } printf("\n"); } else if (cmp == 0 && OUTPUT('=')) { - printf("%-34s %c", tmp, Quiet ? '\0' : '='); - if (Verbose) - printf(" up-to-date with %s", source); + if (Quiet) + printf("%s", tmp); + else { + printf("%-34s =", tmp); + if (Verbose) + printf(" up-to-date with %s", source); + } printf("\n"); } else if (cmp > 0 && OUTPUT('>')) { - printf("%-34s %c", tmp, Quiet ? '\0' : '>'); - if (Verbose) - printf(" succeeds %s (%s has %s)", source, source, ver); + if (Quiet) + printf("%s", tmp); + else { + printf("%-34s >", tmp); + if (Verbose) + printf(" succeeds %s (%s has %s)", source, source, ver); + } printf("\n"); } } From owner-svn-src-all@FreeBSD.ORG Tue Sep 18 22:25:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B8885106566C; Tue, 18 Sep 2012 22:25:49 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A3FFE8FC0C; Tue, 18 Sep 2012 22:25:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8IMPnTn073465; Tue, 18 Sep 2012 22:25:49 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8IMPn0Q073463; Tue, 18 Sep 2012 22:25:49 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201209182225.q8IMPn0Q073463@svn.freebsd.org> From: Gavin Atkinson Date: Tue, 18 Sep 2012 22:25:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240683 - head/sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Sep 2012 22:25:49 -0000 Author: gavin Date: Tue Sep 18 22:25:49 2012 New Revision: 240683 URL: http://svn.freebsd.org/changeset/base/240683 Log: Add entries for two USB devices I have locally. MFC after: 1 week Modified: head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Tue Sep 18 22:09:23 2012 (r240682) +++ head/sys/dev/usb/usbdevs Tue Sep 18 22:25:49 2012 (r240683) @@ -407,6 +407,7 @@ vendor ALLIEDCABLE 0x07e6 Allied Cable vendor STSN 0x07ef STSN vendor CENTURY 0x07f7 Century Corp vendor NEWLINK 0x07ff NEWlink +vendor MAGTEK 0x0801 Mag-Tek vendor ZOOM 0x0803 Zoom Telephonics vendor PCS 0x0810 Personal Communication Systems vendor ALPHASMART 0x081e AlphaSmart, Inc. @@ -2493,6 +2494,9 @@ product LUWEN EASYDISK 0x0005 EasyDisc /* Macally products */ product MACALLY MOUSE1 0x0101 mouse +/* Mag-Tek products */ +product MAGTEK USBSWIPE 0x0002 USB Mag Stripe Swipe Reader + /* Marvell Technology Group, Ltd. products */ product MARVELL SHEEVAPLUG 0x9e8f SheevaPlug serial interface @@ -3446,6 +3450,7 @@ product RALINK RT3071 0x3071 RT3071 product RALINK RT3072 0x3072 RT3072 product RALINK RT3370 0x3370 RT3370 product RALINK RT3572 0x3572 RT3572 +product RALINK RT5370 0x5370 RT5370 product RALINK RT8070 0x8070 RT8070 product RALINK RT2570_3 0x9020 RT2500USB Wireless Adapter product RALINK RT2573_2 0x9021 RT2501USB Wireless Adapter From owner-svn-src-all@FreeBSD.ORG Tue Sep 18 22:28:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 19B3A1065672; Tue, 18 Sep 2012 22:28:44 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F3E448FC0A; Tue, 18 Sep 2012 22:28:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8IMShfA073891; Tue, 18 Sep 2012 22:28:43 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8IMShup073845; Tue, 18 Sep 2012 22:28:43 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201209182228.q8IMShup073845@svn.freebsd.org> From: Devin Teske Date: Tue, 18 Sep 2012 22:28:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240684 - in head/usr.sbin/bsdconfig: . console diskmgmt docsinstall dot include mouse networking networking/include networking/share password password/include password/share security s... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Sep 2012 22:28:44 -0000 Author: dteske Date: Tue Sep 18 22:28:42 2012 New Revision: 240684 URL: http://svn.freebsd.org/changeset/base/240684 Log: Move major includes into /usr/share/bsdconfig for easy external access. Reviewed by: adrian (co-mentor) Approved by: adrian (co-mentor) Added: head/usr.sbin/bsdconfig/networking/share/ head/usr.sbin/bsdconfig/networking/share/Makefile (contents, props changed) head/usr.sbin/bsdconfig/networking/share/common.subr - copied, changed from r239358, head/usr.sbin/bsdconfig/networking/include/common.subr head/usr.sbin/bsdconfig/networking/share/device.subr - copied, changed from r239358, head/usr.sbin/bsdconfig/networking/include/device.subr head/usr.sbin/bsdconfig/networking/share/hostname.subr - copied, changed from r239358, head/usr.sbin/bsdconfig/networking/include/hostname.subr head/usr.sbin/bsdconfig/networking/share/ipaddr.subr - copied, changed from r239358, head/usr.sbin/bsdconfig/networking/include/ipaddr.subr head/usr.sbin/bsdconfig/networking/share/media.subr - copied, changed from r240679, head/usr.sbin/bsdconfig/networking/include/media.subr head/usr.sbin/bsdconfig/networking/share/netmask.subr - copied, changed from r239358, head/usr.sbin/bsdconfig/networking/include/netmask.subr head/usr.sbin/bsdconfig/networking/share/resolv.subr - copied, changed from r239358, head/usr.sbin/bsdconfig/networking/include/resolv.subr head/usr.sbin/bsdconfig/networking/share/routing.subr - copied, changed from r239358, head/usr.sbin/bsdconfig/networking/include/routing.subr head/usr.sbin/bsdconfig/password/share/ head/usr.sbin/bsdconfig/password/share/Makefile (contents, props changed) head/usr.sbin/bsdconfig/password/share/password.subr - copied, changed from r239358, head/usr.sbin/bsdconfig/password/include/password.subr head/usr.sbin/bsdconfig/share/ head/usr.sbin/bsdconfig/share/Makefile (contents, props changed) head/usr.sbin/bsdconfig/share/common.subr - copied unchanged from r239358, head/usr.sbin/bsdconfig/include/common.subr head/usr.sbin/bsdconfig/share/dialog.subr - copied, changed from r239358, head/usr.sbin/bsdconfig/include/dialog.subr head/usr.sbin/bsdconfig/share/mustberoot.subr - copied, changed from r239358, head/usr.sbin/bsdconfig/include/mustberoot.subr head/usr.sbin/bsdconfig/share/strings.subr - copied unchanged from r239358, head/usr.sbin/bsdconfig/include/strings.subr head/usr.sbin/bsdconfig/share/sysrc.subr - copied, changed from r239358, head/usr.sbin/bsdconfig/include/sysrc.subr head/usr.sbin/bsdconfig/startup/share/ head/usr.sbin/bsdconfig/startup/share/Makefile (contents, props changed) head/usr.sbin/bsdconfig/startup/share/rcconf.subr - copied, changed from r239358, head/usr.sbin/bsdconfig/startup/include/rcconf.subr head/usr.sbin/bsdconfig/startup/share/rcedit.subr - copied, changed from r239358, head/usr.sbin/bsdconfig/startup/include/rcedit.subr head/usr.sbin/bsdconfig/startup/share/rcvar.subr - copied, changed from r239358, head/usr.sbin/bsdconfig/startup/include/rcvar.subr head/usr.sbin/bsdconfig/timezone/share/ head/usr.sbin/bsdconfig/timezone/share/Makefile (contents, props changed) head/usr.sbin/bsdconfig/timezone/share/continents.subr - copied, changed from r239358, head/usr.sbin/bsdconfig/timezone/include/continents.subr head/usr.sbin/bsdconfig/timezone/share/countries.subr - copied unchanged from r239358, head/usr.sbin/bsdconfig/timezone/include/countries.subr head/usr.sbin/bsdconfig/timezone/share/iso3166.subr - copied, changed from r239358, head/usr.sbin/bsdconfig/timezone/include/iso3166.subr head/usr.sbin/bsdconfig/timezone/share/menus.subr - copied, changed from r239358, head/usr.sbin/bsdconfig/timezone/include/menus.subr head/usr.sbin/bsdconfig/timezone/share/zones.subr - copied, changed from r239358, head/usr.sbin/bsdconfig/timezone/include/zones.subr head/usr.sbin/bsdconfig/usermgmt/share/ head/usr.sbin/bsdconfig/usermgmt/share/Makefile (contents, props changed) head/usr.sbin/bsdconfig/usermgmt/share/group_input.subr - copied, changed from r239358, head/usr.sbin/bsdconfig/usermgmt/include/group_input.subr head/usr.sbin/bsdconfig/usermgmt/share/user_input.subr - copied, changed from r239358, head/usr.sbin/bsdconfig/usermgmt/include/user_input.subr Deleted: head/usr.sbin/bsdconfig/include/common.subr head/usr.sbin/bsdconfig/include/dialog.subr head/usr.sbin/bsdconfig/include/mustberoot.subr head/usr.sbin/bsdconfig/include/strings.subr head/usr.sbin/bsdconfig/include/sysrc.subr head/usr.sbin/bsdconfig/networking/include/common.subr head/usr.sbin/bsdconfig/networking/include/device.subr head/usr.sbin/bsdconfig/networking/include/hostname.subr head/usr.sbin/bsdconfig/networking/include/ipaddr.subr head/usr.sbin/bsdconfig/networking/include/media.subr head/usr.sbin/bsdconfig/networking/include/netmask.subr head/usr.sbin/bsdconfig/networking/include/resolv.subr head/usr.sbin/bsdconfig/networking/include/routing.subr head/usr.sbin/bsdconfig/password/include/password.subr head/usr.sbin/bsdconfig/startup/include/rcconf.subr head/usr.sbin/bsdconfig/startup/include/rcedit.subr head/usr.sbin/bsdconfig/startup/include/rcvar.subr head/usr.sbin/bsdconfig/timezone/include/continents.subr head/usr.sbin/bsdconfig/timezone/include/countries.subr head/usr.sbin/bsdconfig/timezone/include/iso3166.subr head/usr.sbin/bsdconfig/timezone/include/menus.subr head/usr.sbin/bsdconfig/timezone/include/zones.subr head/usr.sbin/bsdconfig/usermgmt/include/group_input.subr head/usr.sbin/bsdconfig/usermgmt/include/user_input.subr Modified: head/usr.sbin/bsdconfig/Makefile head/usr.sbin/bsdconfig/bsdconfig head/usr.sbin/bsdconfig/console/console head/usr.sbin/bsdconfig/console/font head/usr.sbin/bsdconfig/console/keymap head/usr.sbin/bsdconfig/console/repeat head/usr.sbin/bsdconfig/console/saver head/usr.sbin/bsdconfig/console/screenmap head/usr.sbin/bsdconfig/console/ttys head/usr.sbin/bsdconfig/diskmgmt/diskmgmt head/usr.sbin/bsdconfig/docsinstall/docsinstall head/usr.sbin/bsdconfig/dot/dot head/usr.sbin/bsdconfig/include/Makefile head/usr.sbin/bsdconfig/mouse/disable head/usr.sbin/bsdconfig/mouse/enable head/usr.sbin/bsdconfig/mouse/flags head/usr.sbin/bsdconfig/mouse/mouse head/usr.sbin/bsdconfig/mouse/port head/usr.sbin/bsdconfig/mouse/type head/usr.sbin/bsdconfig/networking/Makefile head/usr.sbin/bsdconfig/networking/defaultrouter head/usr.sbin/bsdconfig/networking/devices head/usr.sbin/bsdconfig/networking/hostname head/usr.sbin/bsdconfig/networking/include/Makefile head/usr.sbin/bsdconfig/networking/nameservers head/usr.sbin/bsdconfig/networking/networking head/usr.sbin/bsdconfig/password/Makefile head/usr.sbin/bsdconfig/password/include/Makefile head/usr.sbin/bsdconfig/password/password head/usr.sbin/bsdconfig/security/kern_securelevel head/usr.sbin/bsdconfig/security/security head/usr.sbin/bsdconfig/startup/Makefile head/usr.sbin/bsdconfig/startup/include/Makefile head/usr.sbin/bsdconfig/startup/misc head/usr.sbin/bsdconfig/startup/rcadd head/usr.sbin/bsdconfig/startup/rcconf head/usr.sbin/bsdconfig/startup/rcdelete head/usr.sbin/bsdconfig/startup/rcedit head/usr.sbin/bsdconfig/startup/rcvar head/usr.sbin/bsdconfig/startup/startup head/usr.sbin/bsdconfig/timezone/Makefile head/usr.sbin/bsdconfig/timezone/include/Makefile head/usr.sbin/bsdconfig/timezone/timezone head/usr.sbin/bsdconfig/ttys/ttys head/usr.sbin/bsdconfig/usermgmt/Makefile head/usr.sbin/bsdconfig/usermgmt/groupadd head/usr.sbin/bsdconfig/usermgmt/groupdel head/usr.sbin/bsdconfig/usermgmt/groupedit head/usr.sbin/bsdconfig/usermgmt/groupinput head/usr.sbin/bsdconfig/usermgmt/include/Makefile head/usr.sbin/bsdconfig/usermgmt/useradd head/usr.sbin/bsdconfig/usermgmt/userdel head/usr.sbin/bsdconfig/usermgmt/useredit head/usr.sbin/bsdconfig/usermgmt/userinput head/usr.sbin/bsdconfig/usermgmt/usermgmt Modified: head/usr.sbin/bsdconfig/Makefile ============================================================================== --- head/usr.sbin/bsdconfig/Makefile Tue Sep 18 22:25:49 2012 (r240683) +++ head/usr.sbin/bsdconfig/Makefile Tue Sep 18 22:28:42 2012 (r240684) @@ -12,6 +12,7 @@ SUBDIR= console \ networking \ password \ security \ + share \ startup \ timezone \ ttys \ Modified: head/usr.sbin/bsdconfig/bsdconfig ============================================================================== --- head/usr.sbin/bsdconfig/bsdconfig Tue Sep 18 22:25:49 2012 (r240683) +++ head/usr.sbin/bsdconfig/bsdconfig Tue Sep 18 22:28:42 2012 (r240684) @@ -29,11 +29,13 @@ # ############################################################ INCLUDES +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/mustberoot.subr +f_include $BSDCFG_SHARE/strings.subr + BSDCFG_LIBE="/usr/libexec/bsdconfig" -. $BSDCFG_LIBE/include/common.subr || exit 1 -f_include $BSDCFG_LIBE/include/dialog.subr -f_include $BSDCFG_LIBE/include/mustberoot.subr -f_include $BSDCFG_LIBE/include/strings.subr f_include_lang $BSDCFG_LIBE/include/messages.subr ############################################################ FUNCTIONS Modified: head/usr.sbin/bsdconfig/console/console ============================================================================== --- head/usr.sbin/bsdconfig/console/console Tue Sep 18 22:25:49 2012 (r240683) +++ head/usr.sbin/bsdconfig/console/console Tue Sep 18 22:28:42 2012 (r240684) @@ -28,12 +28,12 @@ # ############################################################ INCLUDES -BSDCFG_LIBE="/usr/libexec/bsdconfig" -. $BSDCFG_LIBE/include/common.subr || exit 1 -f_include $BSDCFG_LIBE/include/dialog.subr -f_include $BSDCFG_LIBE/include/mustberoot.subr +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/mustberoot.subr -APP_DIR="080.console" +BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="080.console" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) Modified: head/usr.sbin/bsdconfig/console/font ============================================================================== --- head/usr.sbin/bsdconfig/console/font Tue Sep 18 22:25:49 2012 (r240683) +++ head/usr.sbin/bsdconfig/console/font Tue Sep 18 22:28:42 2012 (r240684) @@ -28,13 +28,13 @@ # ############################################################ INCLUDES -BSDCFG_LIBE="/usr/libexec/bsdconfig" -. $BSDCFG_LIBE/include/common.subr || exit 1 -f_include $BSDCFG_LIBE/include/dialog.subr -f_include $BSDCFG_LIBE/include/mustberoot.subr -f_include $BSDCFG_LIBE/include/sysrc.subr +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/mustberoot.subr +f_include $BSDCFG_SHARE/sysrc.subr -APP_DIR="080.console" +BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="080.console" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) Modified: head/usr.sbin/bsdconfig/console/keymap ============================================================================== --- head/usr.sbin/bsdconfig/console/keymap Tue Sep 18 22:25:49 2012 (r240683) +++ head/usr.sbin/bsdconfig/console/keymap Tue Sep 18 22:28:42 2012 (r240684) @@ -28,13 +28,13 @@ # ############################################################ INCLUDES -BSDCFG_LIBE="/usr/libexec/bsdconfig" -. $BSDCFG_LIBE/include/common.subr || exit 1 -f_include $BSDCFG_LIBE/include/dialog.subr -f_include $BSDCFG_LIBE/include/mustberoot.subr -f_include $BSDCFG_LIBE/include/sysrc.subr +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/mustberoot.subr +f_include $BSDCFG_SHARE/sysrc.subr -APP_DIR="080.console" +BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="080.console" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) Modified: head/usr.sbin/bsdconfig/console/repeat ============================================================================== --- head/usr.sbin/bsdconfig/console/repeat Tue Sep 18 22:25:49 2012 (r240683) +++ head/usr.sbin/bsdconfig/console/repeat Tue Sep 18 22:28:42 2012 (r240684) @@ -28,13 +28,13 @@ # ############################################################ INCLUDES -BSDCFG_LIBE="/usr/libexec/bsdconfig" -. $BSDCFG_LIBE/include/common.subr || exit 1 -f_include $BSDCFG_LIBE/include/dialog.subr -f_include $BSDCFG_LIBE/include/mustberoot.subr -f_include $BSDCFG_LIBE/include/sysrc.subr +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/mustberoot.subr +f_include $BSDCFG_SHARE/sysrc.subr -APP_DIR="080.console" +BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="080.console" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) Modified: head/usr.sbin/bsdconfig/console/saver ============================================================================== --- head/usr.sbin/bsdconfig/console/saver Tue Sep 18 22:25:49 2012 (r240683) +++ head/usr.sbin/bsdconfig/console/saver Tue Sep 18 22:28:42 2012 (r240684) @@ -28,13 +28,13 @@ # ############################################################ INCLUDES -BSDCFG_LIBE="/usr/libexec/bsdconfig" -. $BSDCFG_LIBE/include/common.subr || exit 1 -f_include $BSDCFG_LIBE/include/dialog.subr -f_include $BSDCFG_LIBE/include/mustberoot.subr -f_include $BSDCFG_LIBE/include/sysrc.subr +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/mustberoot.subr +f_include $BSDCFG_SHARE/sysrc.subr -APP_DIR="080.console" +BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="080.console" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) Modified: head/usr.sbin/bsdconfig/console/screenmap ============================================================================== --- head/usr.sbin/bsdconfig/console/screenmap Tue Sep 18 22:25:49 2012 (r240683) +++ head/usr.sbin/bsdconfig/console/screenmap Tue Sep 18 22:28:42 2012 (r240684) @@ -28,13 +28,13 @@ # ############################################################ INCLUDES -BSDCFG_LIBE="/usr/libexec/bsdconfig" -. $BSDCFG_LIBE/include/common.subr || exit 1 -f_include $BSDCFG_LIBE/include/dialog.subr -f_include $BSDCFG_LIBE/include/mustberoot.subr -f_include $BSDCFG_LIBE/include/sysrc.subr +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/mustberoot.subr +f_include $BSDCFG_SHARE/sysrc.subr -APP_DIR="080.console" +BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="080.console" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) Modified: head/usr.sbin/bsdconfig/console/ttys ============================================================================== --- head/usr.sbin/bsdconfig/console/ttys Tue Sep 18 22:25:49 2012 (r240683) +++ head/usr.sbin/bsdconfig/console/ttys Tue Sep 18 22:28:42 2012 (r240684) @@ -28,13 +28,13 @@ # ############################################################ INCLUDES -BSDCFG_LIBE="/usr/libexec/bsdconfig" -. $BSDCFG_LIBE/include/common.subr || exit 1 -f_include $BSDCFG_LIBE/include/dialog.subr -f_include $BSDCFG_LIBE/include/mustberoot.subr -f_include $BSDCFG_LIBE/include/sysrc.subr +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/mustberoot.subr +f_include $BSDCFG_SHARE/sysrc.subr -APP_DIR="080.console" +BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="080.console" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) Modified: head/usr.sbin/bsdconfig/diskmgmt/diskmgmt ============================================================================== --- head/usr.sbin/bsdconfig/diskmgmt/diskmgmt Tue Sep 18 22:25:49 2012 (r240683) +++ head/usr.sbin/bsdconfig/diskmgmt/diskmgmt Tue Sep 18 22:28:42 2012 (r240684) @@ -28,12 +28,12 @@ # ############################################################ INCLUDES -BSDCFG_LIBE="/usr/libexec/bsdconfig" -. $BSDCFG_LIBE/include/common.subr || exit 1 -f_include $BSDCFG_LIBE/include/dialog.subr -f_include $BSDCFG_LIBE/include/mustberoot.subr +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/mustberoot.subr -APP_DIR="050.diskmgmt" +BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="050.diskmgmt" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) Modified: head/usr.sbin/bsdconfig/docsinstall/docsinstall ============================================================================== --- head/usr.sbin/bsdconfig/docsinstall/docsinstall Tue Sep 18 22:25:49 2012 (r240683) +++ head/usr.sbin/bsdconfig/docsinstall/docsinstall Tue Sep 18 22:28:42 2012 (r240684) @@ -28,12 +28,12 @@ # ############################################################ INCLUDES -BSDCFG_LIBE="/usr/libexec/bsdconfig" -. $BSDCFG_LIBE/include/common.subr || exit 1 -f_include $BSDCFG_LIBE/include/dialog.subr -f_include $BSDCFG_LIBE/include/mustberoot.subr +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/mustberoot.subr -APP_DIR="020.docsinstall" +BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="020.docsinstall" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) Modified: head/usr.sbin/bsdconfig/dot/dot ============================================================================== --- head/usr.sbin/bsdconfig/dot/dot Tue Sep 18 22:25:49 2012 (r240683) +++ head/usr.sbin/bsdconfig/dot/dot Tue Sep 18 22:28:42 2012 (r240684) @@ -28,11 +28,11 @@ # ############################################################ INCLUDES -BSDCFG_LIBE="/usr/libexec/bsdconfig" -. $BSDCFG_LIBE/include/common.subr || exit 1 -f_include_lang $BSDCFG_LIBE/include/messages.subr +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 -APP_DIR="dot" +BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="dot" +f_include_lang $BSDCFG_LIBE/include/messages.subr f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) Modified: head/usr.sbin/bsdconfig/include/Makefile ============================================================================== --- head/usr.sbin/bsdconfig/include/Makefile Tue Sep 18 22:25:49 2012 (r240683) +++ head/usr.sbin/bsdconfig/include/Makefile Tue Sep 18 22:28:42 2012 (r240684) @@ -3,8 +3,7 @@ NO_OBJ= FILESDIR= ${LIBEXECDIR}/bsdconfig/include -FILES= common.subr dialog.subr messages.subr mustberoot.subr \ - strings.subr sysrc.subr +FILES= messages.subr beforeinstall: mkdir -p ${DESTDIR}${FILESDIR} Modified: head/usr.sbin/bsdconfig/mouse/disable ============================================================================== --- head/usr.sbin/bsdconfig/mouse/disable Tue Sep 18 22:25:49 2012 (r240683) +++ head/usr.sbin/bsdconfig/mouse/disable Tue Sep 18 22:28:42 2012 (r240684) @@ -28,13 +28,13 @@ # ############################################################ INCLUDES -BSDCFG_LIBE="/usr/libexec/bsdconfig" -. $BSDCFG_LIBE/include/common.subr || exit 1 -f_include $BSDCFG_LIBE/include/dialog.subr -f_include $BSDCFG_LIBE/include/mustberoot.subr -f_include $BSDCFG_LIBE/include/sysrc.subr +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/mustberoot.subr +f_include $BSDCFG_SHARE/sysrc.subr -APP_DIR="110.mouse" +BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="110.mouse" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) Modified: head/usr.sbin/bsdconfig/mouse/enable ============================================================================== --- head/usr.sbin/bsdconfig/mouse/enable Tue Sep 18 22:25:49 2012 (r240683) +++ head/usr.sbin/bsdconfig/mouse/enable Tue Sep 18 22:28:42 2012 (r240684) @@ -28,13 +28,13 @@ # ############################################################ INCLUDES -BSDCFG_LIBE="/usr/libexec/bsdconfig" -. $BSDCFG_LIBE/include/common.subr || exit 1 -f_include $BSDCFG_LIBE/include/dialog.subr -f_include $BSDCFG_LIBE/include/mustberoot.subr -f_include $BSDCFG_LIBE/include/sysrc.subr +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/mustberoot.subr +f_include $BSDCFG_SHARE/sysrc.subr -APP_DIR="110.mouse" +BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="110.mouse" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) Modified: head/usr.sbin/bsdconfig/mouse/flags ============================================================================== --- head/usr.sbin/bsdconfig/mouse/flags Tue Sep 18 22:25:49 2012 (r240683) +++ head/usr.sbin/bsdconfig/mouse/flags Tue Sep 18 22:28:42 2012 (r240684) @@ -28,13 +28,13 @@ # ############################################################ INCLUDES -BSDCFG_LIBE="/usr/libexec/bsdconfig" -. $BSDCFG_LIBE/include/common.subr || exit 1 -f_include $BSDCFG_LIBE/include/dialog.subr -f_include $BSDCFG_LIBE/include/mustberoot.subr -f_include $BSDCFG_LIBE/include/sysrc.subr +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/mustberoot.subr +f_include $BSDCFG_SHARE/sysrc.subr -APP_DIR="110.mouse" +BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="110.mouse" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) Modified: head/usr.sbin/bsdconfig/mouse/mouse ============================================================================== --- head/usr.sbin/bsdconfig/mouse/mouse Tue Sep 18 22:25:49 2012 (r240683) +++ head/usr.sbin/bsdconfig/mouse/mouse Tue Sep 18 22:28:42 2012 (r240684) @@ -28,12 +28,12 @@ # ############################################################ INCLUDES -BSDCFG_LIBE="/usr/libexec/bsdconfig" -. $BSDCFG_LIBE/include/common.subr || exit 1 -f_include $BSDCFG_LIBE/include/dialog.subr -f_include $BSDCFG_LIBE/include/mustberoot.subr +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/mustberoot.subr -APP_DIR="110.mouse" +BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="110.mouse" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) Modified: head/usr.sbin/bsdconfig/mouse/port ============================================================================== --- head/usr.sbin/bsdconfig/mouse/port Tue Sep 18 22:25:49 2012 (r240683) +++ head/usr.sbin/bsdconfig/mouse/port Tue Sep 18 22:28:42 2012 (r240684) @@ -28,13 +28,13 @@ # ############################################################ INCLUDES -BSDCFG_LIBE="/usr/libexec/bsdconfig" -. $BSDCFG_LIBE/include/common.subr || exit 1 -f_include $BSDCFG_LIBE/include/dialog.subr -f_include $BSDCFG_LIBE/include/mustberoot.subr -f_include $BSDCFG_LIBE/include/sysrc.subr +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/mustberoot.subr +f_include $BSDCFG_SHARE/sysrc.subr -APP_DIR="110.mouse" +BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="110.mouse" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) Modified: head/usr.sbin/bsdconfig/mouse/type ============================================================================== --- head/usr.sbin/bsdconfig/mouse/type Tue Sep 18 22:25:49 2012 (r240683) +++ head/usr.sbin/bsdconfig/mouse/type Tue Sep 18 22:28:42 2012 (r240684) @@ -28,13 +28,13 @@ # ############################################################ INCLUDES -BSDCFG_LIBE="/usr/libexec/bsdconfig" -. $BSDCFG_LIBE/include/common.subr || exit 1 -f_include $BSDCFG_LIBE/include/dialog.subr -f_include $BSDCFG_LIBE/include/mustberoot.subr -f_include $BSDCFG_LIBE/include/sysrc.subr +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/mustberoot.subr +f_include $BSDCFG_SHARE/sysrc.subr -APP_DIR="110.mouse" +BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="110.mouse" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) Modified: head/usr.sbin/bsdconfig/networking/Makefile ============================================================================== --- head/usr.sbin/bsdconfig/networking/Makefile Tue Sep 18 22:25:49 2012 (r240683) +++ head/usr.sbin/bsdconfig/networking/Makefile Tue Sep 18 22:28:42 2012 (r240684) @@ -2,7 +2,7 @@ NO_OBJ= -SUBDIR= include +SUBDIR= include share FILESDIR= ${LIBEXECDIR}/bsdconfig/120.networking FILES= INDEX USAGE Modified: head/usr.sbin/bsdconfig/networking/defaultrouter ============================================================================== --- head/usr.sbin/bsdconfig/networking/defaultrouter Tue Sep 18 22:25:49 2012 (r240683) +++ head/usr.sbin/bsdconfig/networking/defaultrouter Tue Sep 18 22:28:42 2012 (r240684) @@ -28,13 +28,13 @@ # ############################################################ INCLUDES -BSDCFG_LIBE="/usr/libexec/bsdconfig" -. $BSDCFG_LIBE/include/common.subr || exit 1 -f_include $BSDCFG_LIBE/include/dialog.subr -f_include $BSDCFG_LIBE/include/mustberoot.subr +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/mustberoot.subr +f_include $BSDCFG_SHARE/networking/routing.subr -APP_DIR="120.networking" -f_include $BSDCFG_LIBE/$APP_DIR/include/routing.subr +BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="120.networking" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) Modified: head/usr.sbin/bsdconfig/networking/devices ============================================================================== --- head/usr.sbin/bsdconfig/networking/devices Tue Sep 18 22:25:49 2012 (r240683) +++ head/usr.sbin/bsdconfig/networking/devices Tue Sep 18 22:28:42 2012 (r240684) @@ -28,17 +28,17 @@ # ############################################################ INCLUDES -BSDCFG_LIBE="/usr/libexec/bsdconfig" -. $BSDCFG_LIBE/include/common.subr || exit 1 -f_include $BSDCFG_LIBE/include/dialog.subr -f_include $BSDCFG_LIBE/include/mustberoot.subr -f_include $BSDCFG_LIBE/include/sysrc.subr - -APP_DIR="120.networking" -f_include $BSDCFG_LIBE/$APP_DIR/include/device.subr -f_include $BSDCFG_LIBE/$APP_DIR/include/ipaddr.subr -f_include $BSDCFG_LIBE/$APP_DIR/include/media.subr -f_include $BSDCFG_LIBE/$APP_DIR/include/netmask.subr +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/mustberoot.subr +f_include $BSDCFG_SHARE/sysrc.subr +f_include $BSDCFG_SHARE/networking/device.subr +f_include $BSDCFG_SHARE/networking/ipaddr.subr +f_include $BSDCFG_SHARE/networking/media.subr +f_include $BSDCFG_SHARE/networking/netmask.subr + +BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="120.networking" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) Modified: head/usr.sbin/bsdconfig/networking/hostname ============================================================================== --- head/usr.sbin/bsdconfig/networking/hostname Tue Sep 18 22:25:49 2012 (r240683) +++ head/usr.sbin/bsdconfig/networking/hostname Tue Sep 18 22:28:42 2012 (r240684) @@ -28,13 +28,13 @@ # ############################################################ INCLUDES -BSDCFG_LIBE="/usr/libexec/bsdconfig" -. $BSDCFG_LIBE/include/common.subr || exit 1 -f_include $BSDCFG_LIBE/include/dialog.subr -f_include $BSDCFG_LIBE/include/mustberoot.subr +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/mustberoot.subr +f_include $BSDCFG_SHARE/networking/hostname.subr -APP_DIR="120.networking" -f_include $BSDCFG_LIBE/$APP_DIR/include/hostname.subr +BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="120.networking" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) Modified: head/usr.sbin/bsdconfig/networking/include/Makefile ============================================================================== --- head/usr.sbin/bsdconfig/networking/include/Makefile Tue Sep 18 22:25:49 2012 (r240683) +++ head/usr.sbin/bsdconfig/networking/include/Makefile Tue Sep 18 22:28:42 2012 (r240684) @@ -3,8 +3,7 @@ NO_OBJ= FILESDIR= ${LIBEXECDIR}/bsdconfig/120.networking/include -FILES= common.subr device.subr hostname.subr ipaddr.subr media.subr \ - messages.subr netmask.subr resolv.subr routing.subr +FILES= messages.subr beforeinstall: mkdir -p ${DESTDIR}${FILESDIR} Modified: head/usr.sbin/bsdconfig/networking/nameservers ============================================================================== --- head/usr.sbin/bsdconfig/networking/nameservers Tue Sep 18 22:25:49 2012 (r240683) +++ head/usr.sbin/bsdconfig/networking/nameservers Tue Sep 18 22:28:42 2012 (r240684) @@ -28,13 +28,13 @@ # ############################################################ INCLUDES -BSDCFG_LIBE="/usr/libexec/bsdconfig" -. $BSDCFG_LIBE/include/common.subr || exit 1 -f_include $BSDCFG_LIBE/include/dialog.subr -f_include $BSDCFG_LIBE/include/mustberoot.subr +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/mustberoot.subr +f_include $BSDCFG_SHARE/networking/resolv.subr -APP_DIR="120.networking" -f_include $BSDCFG_LIBE/$APP_DIR/include/resolv.subr +BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="120.networking" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) Modified: head/usr.sbin/bsdconfig/networking/networking ============================================================================== --- head/usr.sbin/bsdconfig/networking/networking Tue Sep 18 22:25:49 2012 (r240683) +++ head/usr.sbin/bsdconfig/networking/networking Tue Sep 18 22:28:42 2012 (r240684) @@ -28,12 +28,12 @@ # ############################################################ INCLUDES -BSDCFG_LIBE="/usr/libexec/bsdconfig" -. $BSDCFG_LIBE/include/common.subr || exit 1 -f_include $BSDCFG_LIBE/include/dialog.subr -f_include $BSDCFG_LIBE/include/mustberoot.subr +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/mustberoot.subr -APP_DIR="120.networking" +BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="120.networking" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) @@ -122,7 +122,7 @@ while :; do # Make subsequent uses of this menu faster by not performing # "ifconfig up" (limiting the pain one must endure). See also - # `$BSDCFG_LIBE/$APP_DIR/include/device.subr'. + # `$BSDCFG_SHARE/networking/device.subr'. # export DIALOG_MENU_NETDEV_KICK_INTERFACES= ;; Added: head/usr.sbin/bsdconfig/networking/share/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsdconfig/networking/share/Makefile Tue Sep 18 22:28:42 2012 (r240684) @@ -0,0 +1,12 @@ +# $FreeBSD$ + +NO_OBJ= + +FILESDIR= ${SHAREDIR}/bsdconfig/networking +FILES= common.subr device.subr hostname.subr ipaddr.subr media.subr \ + netmask.subr resolv.subr routing.subr + +beforeinstall: + mkdir -p ${DESTDIR}${FILESDIR} + +.include Copied and modified: head/usr.sbin/bsdconfig/networking/share/common.subr (from r239358, head/usr.sbin/bsdconfig/networking/include/common.subr) ============================================================================== --- head/usr.sbin/bsdconfig/networking/include/common.subr Fri Aug 17 16:27:11 2012 (r239358, copy source) +++ head/usr.sbin/bsdconfig/networking/share/common.subr Tue Sep 18 22:28:42 2012 (r240684) @@ -28,8 +28,8 @@ if [ ! "$_NETWORKING_COMMON_SUBR" ]; the # ############################################################ INCLUDES -BSDCFG_LIBE="/usr/libexec/bsdconfig" -. $BSDCFG_LIBE/include/common.subr || exit 1 +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 ############################################################ FUNCTIONS Copied and modified: head/usr.sbin/bsdconfig/networking/share/device.subr (from r239358, head/usr.sbin/bsdconfig/networking/include/device.subr) ============================================================================== --- head/usr.sbin/bsdconfig/networking/include/device.subr Fri Aug 17 16:27:11 2012 (r239358, copy source) +++ head/usr.sbin/bsdconfig/networking/share/device.subr Tue Sep 18 22:28:42 2012 (r240684) @@ -28,18 +28,18 @@ if [ ! "$_NETWORKING_DEVICE_SUBR" ]; the # ############################################################ INCLUDES -BSDCFG_LIBE="/usr/libexec/bsdconfig" -. $BSDCFG_LIBE/include/common.subr || exit 1 -f_include $BSDCFG_LIBE/include/dialog.subr -f_include $BSDCFG_LIBE/include/sysrc.subr - -APP_DIR="120.networking" -f_include $BSDCFG_LIBE/$APP_DIR/include/common.subr -f_include $BSDCFG_LIBE/$APP_DIR/include/ipaddr.subr -f_include $BSDCFG_LIBE/$APP_DIR/include/media.subr -f_include $BSDCFG_LIBE/$APP_DIR/include/netmask.subr -f_include $BSDCFG_LIBE/$APP_DIR/include/resolv.subr -f_include $BSDCFG_LIBE/$APP_DIR/include/routing.subr +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/sysrc.subr +f_include $BSDCFG_SHARE/networking/common.subr +f_include $BSDCFG_SHARE/networking/ipaddr.subr +f_include $BSDCFG_SHARE/networking/media.subr +f_include $BSDCFG_SHARE/networking/netmask.subr +f_include $BSDCFG_SHARE/networking/resolv.subr +f_include $BSDCFG_SHARE/networking/routing.subr + +BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="120.networking" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr ############################################################ GLOBALS Copied and modified: head/usr.sbin/bsdconfig/networking/share/hostname.subr (from r239358, head/usr.sbin/bsdconfig/networking/include/hostname.subr) ============================================================================== --- head/usr.sbin/bsdconfig/networking/include/hostname.subr Fri Aug 17 16:27:11 2012 (r239358, copy source) +++ head/usr.sbin/bsdconfig/networking/share/hostname.subr Tue Sep 18 22:28:42 2012 (r240684) @@ -28,14 +28,14 @@ if [ ! "$_NETWORKING_HOSTNAME_SUBR" ]; t # ############################################################ INCLUDES -BSDCFG_LIBE="/usr/libexec/bsdconfig" -. $BSDCFG_LIBE/include/common.subr || exit 1 -f_include $BSDCFG_LIBE/include/sysrc.subr -f_include $BSDCFG_LIBE/include/dialog.subr - -APP_DIR="120.networking" -f_include $BSDCFG_LIBE/$APP_DIR/include/common.subr -f_include $BSDCFG_LIBE/$APP_DIR/include/resolv.subr +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_include $BSDCFG_SHARE/sysrc.subr +f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/networking/common.subr +f_include $BSDCFG_SHARE/networking/resolv.subr + +BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="120.networking" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr ############################################################ FUNCTIONS Copied and modified: head/usr.sbin/bsdconfig/networking/share/ipaddr.subr (from r239358, head/usr.sbin/bsdconfig/networking/include/ipaddr.subr) ============================================================================== --- head/usr.sbin/bsdconfig/networking/include/ipaddr.subr Fri Aug 17 16:27:11 2012 (r239358, copy source) +++ head/usr.sbin/bsdconfig/networking/share/ipaddr.subr Tue Sep 18 22:28:42 2012 (r240684) @@ -28,14 +28,14 @@ if [ ! "$_NETWORKING_IPADDR_SUBR" ]; the # ############################################################ INCLUDES -BSDCFG_LIBE="/usr/libexec/bsdconfig" -. $BSDCFG_LIBE/include/common.subr || exit 1 -f_include $BSDCFG_LIBE/include/sysrc.subr -f_include $BSDCFG_LIBE/include/dialog.subr -f_include $BSDCFG_LIBE/include/strings.subr +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_include $BSDCFG_SHARE/sysrc.subr +f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/strings.subr +f_include $BSDCFG_SHARE/networking/common.subr -APP_DIR="120.networking" -f_include $BSDCFG_LIBE/$APP_DIR/include/common.subr +BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="120.networking" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr ############################################################ FUNCTIONS Copied and modified: head/usr.sbin/bsdconfig/networking/share/media.subr (from r240679, head/usr.sbin/bsdconfig/networking/include/media.subr) ============================================================================== --- head/usr.sbin/bsdconfig/networking/include/media.subr Tue Sep 18 21:36:24 2012 (r240679, copy source) +++ head/usr.sbin/bsdconfig/networking/share/media.subr Tue Sep 18 22:28:42 2012 (r240684) @@ -28,14 +28,14 @@ if [ ! "$_NETWORKING_MEDIA_SUBR" ]; then # ############################################################ INCLUDES -BSDCFG_LIBE="/usr/libexec/bsdconfig" -. $BSDCFG_LIBE/include/common.subr || exit 1 -f_include $BSDCFG_LIBE/include/dialog.subr -f_include $BSDCFG_LIBE/include/strings.subr -f_include $BSDCFG_LIBE/include/sysrc.subr +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/strings.subr +f_include $BSDCFG_SHARE/sysrc.subr +f_include $BSDCFG_SHARE/networking/common.subr -APP_DIR="120.networking" -f_include $BSDCFG_LIBE/$APP_DIR/include/common.subr +BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="120.networking" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr ############################################################ FUNCTIONS Copied and modified: head/usr.sbin/bsdconfig/networking/share/netmask.subr (from r239358, head/usr.sbin/bsdconfig/networking/include/netmask.subr) ============================================================================== --- head/usr.sbin/bsdconfig/networking/include/netmask.subr Fri Aug 17 16:27:11 2012 (r239358, copy source) +++ head/usr.sbin/bsdconfig/networking/share/netmask.subr Tue Sep 18 22:28:42 2012 (r240684) @@ -28,13 +28,13 @@ if [ ! "$_NETWORKING_NETMASK_SUBR" ]; th # ############################################################ INCLUDES -BSDCFG_LIBE="/usr/libexec/bsdconfig" -. $BSDCFG_LIBE/include/common.subr || exit 1 -f_include $BSDCFG_LIBE/include/dialog.subr -f_include $BSDCFG_LIBE/include/strings.subr +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/strings.subr +f_include $BSDCFG_SHARE/networking/common.subr -APP_DIR="120.networking" -f_include $BSDCFG_LIBE/$APP_DIR/include/common.subr +BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="120.networking" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr ############################################################ FUNCTIONS Copied and modified: head/usr.sbin/bsdconfig/networking/share/resolv.subr (from r239358, head/usr.sbin/bsdconfig/networking/include/resolv.subr) ============================================================================== --- head/usr.sbin/bsdconfig/networking/include/resolv.subr Fri Aug 17 16:27:11 2012 (r239358, copy source) +++ head/usr.sbin/bsdconfig/networking/share/resolv.subr Tue Sep 18 22:28:42 2012 (r240684) @@ -28,14 +28,14 @@ if [ ! "$_NETWORKING_RESOLV_SUBR" ]; the # ############################################################ INCLUDES -BSDCFG_LIBE="/usr/libexec/bsdconfig" -. $BSDCFG_LIBE/include/common.subr || exit 1 -f_include $BSDCFG_LIBE/include/dialog.subr -f_include $BSDCFG_LIBE/include/strings.subr - -APP_DIR="120.networking" -f_include $BSDCFG_LIBE/$APP_DIR/include/common.subr -f_include $BSDCFG_LIBE/$APP_DIR/include/ipaddr.subr +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/strings.subr +f_include $BSDCFG_SHARE/networking/common.subr +f_include $BSDCFG_SHARE/networking/ipaddr.subr + +BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="120.networking" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr ############################################################ CONFIGURATION Copied and modified: head/usr.sbin/bsdconfig/networking/share/routing.subr (from r239358, head/usr.sbin/bsdconfig/networking/include/routing.subr) ============================================================================== --- head/usr.sbin/bsdconfig/networking/include/routing.subr Fri Aug 17 16:27:11 2012 (r239358, copy source) +++ head/usr.sbin/bsdconfig/networking/share/routing.subr Tue Sep 18 22:28:42 2012 (r240684) @@ -28,14 +28,14 @@ if [ ! "$_NETWORKING_ROUTING_SUBR" ]; th # ############################################################ INCLUDES -BSDCFG_LIBE="/usr/libexec/bsdconfig" -. $BSDCFG_LIBE/include/common.subr || exit 1 -f_include $BSDCFG_LIBE/include/sysrc.subr -f_include $BSDCFG_LIBE/include/dialog.subr - -APP_DIR="120.networking" -f_include $BSDCFG_LIBE/$APP_DIR/include/common.subr -f_include $BSDCFG_LIBE/$APP_DIR/include/ipaddr.subr +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_include $BSDCFG_SHARE/sysrc.subr +f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/networking/common.subr +f_include $BSDCFG_SHARE/networking/ipaddr.subr + +BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="120.networking" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr ############################################################ FUNCTIONS Modified: head/usr.sbin/bsdconfig/password/Makefile ============================================================================== --- head/usr.sbin/bsdconfig/password/Makefile Tue Sep 18 22:25:49 2012 (r240683) +++ head/usr.sbin/bsdconfig/password/Makefile Tue Sep 18 22:28:42 2012 (r240684) @@ -2,7 +2,7 @@ NO_OBJ= -SUBDIR= include +SUBDIR= include share FILESDIR= ${LIBEXECDIR}/bsdconfig/040.password FILES= INDEX USAGE Modified: head/usr.sbin/bsdconfig/password/include/Makefile ============================================================================== --- head/usr.sbin/bsdconfig/password/include/Makefile Tue Sep 18 22:25:49 2012 (r240683) +++ head/usr.sbin/bsdconfig/password/include/Makefile Tue Sep 18 22:28:42 2012 (r240684) @@ -3,7 +3,7 @@ NO_OBJ= FILESDIR= ${LIBEXECDIR}/bsdconfig/040.password/include -FILES= messages.subr password.subr +FILES= messages.subr beforeinstall: mkdir -p ${DESTDIR}${FILESDIR} Modified: head/usr.sbin/bsdconfig/password/password ============================================================================== --- head/usr.sbin/bsdconfig/password/password Tue Sep 18 22:25:49 2012 (r240683) +++ head/usr.sbin/bsdconfig/password/password Tue Sep 18 22:28:42 2012 (r240684) @@ -28,13 +28,13 @@ # ############################################################ INCLUDES -BSDCFG_LIBE="/usr/libexec/bsdconfig" -. $BSDCFG_LIBE/include/common.subr || exit 1 -f_include $BSDCFG_LIBE/include/dialog.subr -f_include $BSDCFG_LIBE/include/mustberoot.subr +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/mustberoot.subr +f_include $BSDCFG_SHARE/password/password.subr -APP_DIR="040.password" -f_include $BSDCFG_LIBE/$APP_DIR/include/password.subr +BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="040.password" ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) [ $? -eq $SUCCESS -a "$ipgm" ] && pgm="$ipgm" Added: head/usr.sbin/bsdconfig/password/share/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsdconfig/password/share/Makefile Tue Sep 18 22:28:42 2012 (r240684) @@ -0,0 +1,11 @@ +# $FreeBSD$ + +NO_OBJ= + +FILESDIR= ${SHAREDIR}/bsdconfig/password +FILES= password.subr + +beforeinstall: + mkdir -p ${DESTDIR}${FILESDIR} + +.include Copied and modified: head/usr.sbin/bsdconfig/password/share/password.subr (from r239358, head/usr.sbin/bsdconfig/password/include/password.subr) ============================================================================== --- head/usr.sbin/bsdconfig/password/include/password.subr Fri Aug 17 16:27:11 2012 (r239358, copy source) +++ head/usr.sbin/bsdconfig/password/share/password.subr Tue Sep 18 22:28:42 2012 (r240684) @@ -28,11 +28,11 @@ if [ ! "$_PASSWORD_PASSWORD_SUBR" ]; the # ############################################################ INCLUDES -BSDCFG_LIBE="/usr/libexec/bsdconfig" -. $BSDCFG_LIBE/include/common.subr || exit 1 -f_include $BSDCFG_LIBE/include/dialog.subr +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_include $BSDCFG_SHARE/dialog.subr -APP_DIR="040.password" +BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="040.password" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr ############################################################ FUNCTIONS Modified: head/usr.sbin/bsdconfig/security/kern_securelevel ============================================================================== --- head/usr.sbin/bsdconfig/security/kern_securelevel Tue Sep 18 22:25:49 2012 (r240683) +++ head/usr.sbin/bsdconfig/security/kern_securelevel Tue Sep 18 22:28:42 2012 (r240684) @@ -28,13 +28,13 @@ # ############################################################ INCLUDES -BSDCFG_LIBE="/usr/libexec/bsdconfig" -. $BSDCFG_LIBE/include/common.subr || exit 1 -f_include $BSDCFG_LIBE/include/dialog.subr -f_include $BSDCFG_LIBE/include/mustberoot.subr -f_include $BSDCFG_LIBE/include/sysrc.subr +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/mustberoot.subr +f_include $BSDCFG_SHARE/sysrc.subr -APP_DIR="130.security" +BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="130.security" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) Modified: head/usr.sbin/bsdconfig/security/security ============================================================================== --- head/usr.sbin/bsdconfig/security/security Tue Sep 18 22:25:49 2012 (r240683) +++ head/usr.sbin/bsdconfig/security/security Tue Sep 18 22:28:42 2012 (r240684) @@ -28,13 +28,13 @@ # ############################################################ INCLUDES -BSDCFG_LIBE="/usr/libexec/bsdconfig" -. $BSDCFG_LIBE/include/common.subr || exit 1 -f_include $BSDCFG_LIBE/include/dialog.subr -f_include $BSDCFG_LIBE/include/mustberoot.subr -f_include $BSDCFG_LIBE/include/sysrc.subr +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/mustberoot.subr +f_include $BSDCFG_SHARE/sysrc.subr -APP_DIR="130.security" +BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="130.security" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) Added: head/usr.sbin/bsdconfig/share/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsdconfig/share/Makefile Tue Sep 18 22:28:42 2012 (r240684) @@ -0,0 +1,11 @@ +# $FreeBSD$ + +NO_OBJ= + +FILESDIR= ${SHAREDIR}/bsdconfig +FILES= common.subr dialog.subr mustberoot.subr strings.subr sysrc.subr + +beforeinstall: + mkdir -p ${DESTDIR}${FILESDIR} + +.include Copied: head/usr.sbin/bsdconfig/share/common.subr (from r239358, head/usr.sbin/bsdconfig/include/common.subr) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsdconfig/share/common.subr Tue Sep 18 22:28:42 2012 (r240684, copy of r239358, head/usr.sbin/bsdconfig/include/common.subr) @@ -0,0 +1,299 @@ +if [ ! "$_COMMON_SUBR" ]; then _COMMON_SUBR=1 +# +# Copyright (c) 2012 Ron McDowell +# Copyright (c) 2012 Devin Teske +# 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$ +# +############################################################ GLOBALS + +# +# Program name +# +pgm="${0##*/}" + +# +# Program arguments +# +ARGC="$#" +ARGV="$@" + +# +# Global exit status variables +# +SUCCESS=0 +FAILURE=1 + +############################################################ FUNCTIONS + +# +# This is an empty function by default, to use it, copy +# /usr/share/examples/bsdconfig/bsdconfigrc to $HOME/.bsdconfigrc +# +f_dprintf() +{ + : this page intentionally left blank +} + +# f_err $fmt [ $opts ... ] +# +# Print a message to stderr (fd=2). +# +f_err() +{ + printf "$@" >&2 +} + +# f_quietly $command [ $arguments ... ] +# +# run a command quietly (quell any output to stdout or stderr) +# +f_quietly() +{ + "$@" > /dev/null 2>&1 +} + +# f_have $anything ... +# +# A wrapper to the `type' built-in. Returns true if argument is a valid shell +# built-in, keyword, or externally-tracked binary, otherwise false. +# +f_have() +{ + f_quietly type "$@" +} + +# f_die [ $status [ $fmt [ $opts ... ]]] +# +# Abruptly terminate due to an error optionally displaying a message in a +# dialog box using printf(1) syntax. +# +f_die() +{ + local status=$FAILURE + + # If there is at least one argument, take it as the status + if [ $# -gt 0 ]; then + status=$1 + shift 1 # status + fi + + # If there are still arguments left, pass them to f_show_msg + [ $# -gt 0 ] && f_show_msg "$@" + + # Optionally call f_clean_up() function if it exists + f_have f_clean_up && f_clean_up + + exit $status +} + +# f_interrupt +# +# Interrupt handler. +# +f_interrupt() +{ + exec 2>&1 # fix sh(1) bug where stderr gets lost within async-trap + f_die +} + +# f_show_msg $fmt [ $opts ... ] +# +# Display a message in a dialog box using printf(1) syntax. +# +f_show_msg() *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Sep 19 01:06:43 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 92115106564A; Wed, 19 Sep 2012 01:06:43 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from opti.dougb.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 448E814FF33; Wed, 19 Sep 2012 01:06:43 +0000 (UTC) Message-ID: <50591AA3.2050600@FreeBSD.org> Date: Tue, 18 Sep 2012 18:06:43 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:15.0) Gecko/20120911 Thunderbird/15.0.1 MIME-Version: 1.0 To: Hiroki Sato References: <201209180233.q8I2XNs3022364@svn.freebsd.org> <5058036F.1010104@FreeBSD.org> <20120918.193650.1501104806829364201.hrs@allbsd.org> In-Reply-To: <20120918.193650.1501104806829364201.hrs@allbsd.org> X-Enigmail-Version: 1.4.4 OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, bjk@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r240628 - head/sbin/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Sep 2012 01:06:43 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 09/18/2012 03:36, Hiroki Sato wrote: > Doug Barton wrote > in <5058036F.1010104@FreeBSD.org>: > > do> On 09/17/2012 19:33, Benjamin Kaduk wrote: > do> > Whitespace cleanup for ipfw.8 -- start each sentence on a new line, > do> > do> We generally don't do this at all absent other changes. > do> > do> We definitely don't make whitespace-only changes mixed in with other > do> changes, as it makes the diff too hard to read. > > Please read docs/157452 before blaming the commit. The committer is responsible for what they finally commit. The mentor is responsible for review to make sure that final commit meets project guidelines. That said, Ben properly split his changes into 2 patches for the PR, so you should have been sure to tell him to commit it that way, and more importantly, WHY to commit it that way. > And I do not > think adding commas is not making the diff hard to read. That wasn't my point. Mixing ws changes with content changes makes it hard to pick out the content changes (as you well know). Doug - -- I am only one, but I am one. I cannot do everything, but I can do something. And I will not let what I cannot do interfere with what I can do. -- Edward Everett Hale, (1822 - 1909) -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQEcBAEBCAAGBQJQWRqjAAoJEFzGhvEaGryEt+cIAKQ0eCL/aftTelXyl6pbZT4X UlMECcMqpdQdEtbT91qz+6Pvl3HBO1OcrkywVX3kVt7WNsIKRcBoN/Ns+6Vnvagm G5wMY2MBoJO/v56S7JPC9E6O5YbYM03Fek6ZPNbGO9aIWAzjVhoW7ceN5J4cVErJ Xhtasz86HGXQVpbjmbhGT17iMvXRKHS3Nj+6C48rKr9DmNyqC2snXoY7HsLCmA/z x9GEtkbVOS+fR2REWP/6rseHCqn+MiqMtM5nMwyfHREp1noDNi2oqOtf/oDXDqAK TAWP/nv+m81gK0VFmnpHS6Z/YhhtGUyoNzryZmfpArXtML3+GzbId1R0Y+l6rmY= =O2Vn -----END PGP SIGNATURE----- From owner-svn-src-all@FreeBSD.ORG Wed Sep 19 05:11:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 01B5F1065670; Wed, 19 Sep 2012 05:11:26 +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 E15D28FC0C; Wed, 19 Sep 2012 05:11:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8J5BPqJ029824; Wed, 19 Sep 2012 05:11:25 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8J5BPZL029822; Wed, 19 Sep 2012 05:11:25 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201209190511.q8J5BPZL029822@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 19 Sep 2012 05:11:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240686 - head/libexec/rtld-elf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Sep 2012 05:11:26 -0000 Author: kib Date: Wed Sep 19 05:11:25 2012 New Revision: 240686 URL: http://svn.freebsd.org/changeset/base/240686 Log: Do not reference z_nodeflib for !objgiven case, thus fixing LD_PRELOAD for a non-absolute path. PR: bin/171604 MFC after: 3 days Modified: head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Wed Sep 19 00:27:50 2012 (r240685) +++ head/libexec/rtld-elf/rtld.c Wed Sep 19 05:11:25 2012 (r240686) @@ -1429,7 +1429,7 @@ find_library(const char *xname, const Ob { char *pathname; char *name; - bool objgiven; + bool nodeflib, objgiven; objgiven = refobj != NULL; if (strchr(xname, '/') != NULL) { /* Hard coded pathname */ @@ -1464,6 +1464,7 @@ find_library(const char *xname, const Ob (pathname = search_library_path(name, STANDARD_LIBRARY_PATH)) != NULL) return (pathname); } else { + nodeflib = objgiven ? refobj->z_nodeflib : false; if ((objgiven && (pathname = search_library_path(name, refobj->rpath)) != NULL) || (objgiven && refobj->runpath == NULL && refobj != obj_main && @@ -1471,9 +1472,8 @@ find_library(const char *xname, const Ob (pathname = search_library_path(name, ld_library_path)) != NULL || (objgiven && (pathname = search_library_path(name, refobj->runpath)) != NULL) || - (pathname = search_library_path(name, gethints(refobj->z_nodeflib))) - != NULL || - (objgiven && !refobj->z_nodeflib && + (pathname = search_library_path(name, gethints(nodeflib))) != NULL || + (objgiven && !nodeflib && (pathname = search_library_path(name, STANDARD_LIBRARY_PATH)) != NULL)) return (pathname); } From owner-svn-src-all@FreeBSD.ORG Wed Sep 19 06:18:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 23DC31065672; Wed, 19 Sep 2012 06:18:43 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0DF248FC08; Wed, 19 Sep 2012 06:18:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8J6Ig4H038338; Wed, 19 Sep 2012 06:18:42 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8J6IgVU038336; Wed, 19 Sep 2012 06:18:42 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201209190618.q8J6IgVU038336@svn.freebsd.org> From: Baptiste Daroussin Date: Wed, 19 Sep 2012 06:18:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240687 - stable/9/lib/libutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Sep 2012 06:18:43 -0000 Author: bapt Date: Wed Sep 19 06:18:42 2012 New Revision: 240687 URL: http://svn.freebsd.org/changeset/base/240687 Log: MFC: r240391 Fix IEC / SI binary prefixes (Ki, Mi, Gi, etc) production by humanize_number(3) PR: bin/171487 Submitted by: matthew Modified: stable/9/lib/libutil/humanize_number.c Directory Properties: stable/9/lib/libutil/ (props changed) Modified: stable/9/lib/libutil/humanize_number.c ============================================================================== --- stable/9/lib/libutil/humanize_number.c Wed Sep 19 05:11:25 2012 (r240686) +++ stable/9/lib/libutil/humanize_number.c Wed Sep 19 06:18:42 2012 (r240687) @@ -76,7 +76,7 @@ humanize_number(char *buf, size_t len, i if (flags & HN_B) prefixes = "B\0\0Ki\0Mi\0Gi\0Ti\0Pi\0Ei"; else - prefixes = "\0\0Ki\0Mi\0Gi\0Ti\0Pi\0Ei"; + prefixes = "\0\0\0Ki\0Mi\0Gi\0Ti\0Pi\0Ei"; } else { baselen = 1; if (flags & HN_DIVISOR_1000) From owner-svn-src-all@FreeBSD.ORG Wed Sep 19 06:20:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2DAF5106566B; Wed, 19 Sep 2012 06:20:26 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 191E48FC08; Wed, 19 Sep 2012 06:20:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8J6KPMG038610; Wed, 19 Sep 2012 06:20:25 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8J6KPVw038608; Wed, 19 Sep 2012 06:20:25 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201209190620.q8J6KPVw038608@svn.freebsd.org> From: Baptiste Daroussin Date: Wed, 19 Sep 2012 06:20:25 +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: r240688 - stable/8/lib/libutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Sep 2012 06:20:26 -0000 Author: bapt Date: Wed Sep 19 06:20:25 2012 New Revision: 240688 URL: http://svn.freebsd.org/changeset/base/240688 Log: MFC: r240391 Fix IEC / SI binary prefixes (Ki, Mi, Gi, etc) production by humanize_number(3) PR: bin/171487 Submitted by: matthew Modified: stable/8/lib/libutil/humanize_number.c Directory Properties: stable/8/lib/libutil/ (props changed) Modified: stable/8/lib/libutil/humanize_number.c ============================================================================== --- stable/8/lib/libutil/humanize_number.c Wed Sep 19 06:18:42 2012 (r240687) +++ stable/8/lib/libutil/humanize_number.c Wed Sep 19 06:20:25 2012 (r240688) @@ -76,7 +76,7 @@ humanize_number(char *buf, size_t len, i if (flags & HN_B) prefixes = "B\0\0Ki\0Mi\0Gi\0Ti\0Pi\0Ei"; else - prefixes = "\0\0Ki\0Mi\0Gi\0Ti\0Pi\0Ei"; + prefixes = "\0\0\0Ki\0Mi\0Gi\0Ti\0Pi\0Ei"; } else { baselen = 1; if (flags & HN_DIVISOR_1000) From owner-svn-src-all@FreeBSD.ORG Wed Sep 19 09:34:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C0D04106564A; Wed, 19 Sep 2012 09:34:21 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AAD5E8FC08; Wed, 19 Sep 2012 09:34:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8J9YLEW066128; Wed, 19 Sep 2012 09:34:21 GMT (envelope-from zeising@svn.freebsd.org) Received: (from zeising@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8J9YL6h066125; Wed, 19 Sep 2012 09:34:21 GMT (envelope-from zeising@svn.freebsd.org) Message-Id: <201209190934.q8J9YL6h066125@svn.freebsd.org> From: Niclas Zeising Date: Wed, 19 Sep 2012 09:34:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240689 - in head/share/man: man4 man5 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Sep 2012 09:34:21 -0000 Author: zeising (doc,ports committer) Date: Wed Sep 19 09:34:21 2012 New Revision: 240689 URL: http://svn.freebsd.org/changeset/base/240689 Log: Do not install pf related man pages if WITHOUT_PF is set. PR: bin/171767 Submitted by: zeising Approved by: joel (mentor), glebius Modified: head/share/man/man4/Makefile head/share/man/man5/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Wed Sep 19 06:20:25 2012 (r240688) +++ head/share/man/man4/Makefile Wed Sep 19 09:34:21 2012 (r240689) @@ -1,6 +1,8 @@ # @(#)Makefile 8.1 (Berkeley) 6/18/93 # $FreeBSD$ +.include + MAN= aac.4 \ acpi.4 \ ${_acpi_asus.4} \ @@ -354,9 +356,9 @@ MAN= aac.4 \ pcii.4 \ pcm.4 \ pcn.4 \ - pf.4 \ - pflog.4 \ - pfsync.4 \ + ${_pf.4} \ + ${_pflog.4} \ + ${_pfsync.4} \ pim.4 \ polling.4 \ ppbus.4 \ @@ -798,4 +800,10 @@ _nvram2env.4= nvram2env.4 SUBDIR= man4.${MACHINE_CPUARCH} .endif +.if ${MK_PF} != "no" +_pf.4= pf.4 +_pflog.4= pflog.4 +_pfsync.4= pfsync.4 +.endif + .include Modified: head/share/man/man5/Makefile ============================================================================== --- head/share/man/man5/Makefile Wed Sep 19 06:20:25 2012 (r240688) +++ head/share/man/man5/Makefile Wed Sep 19 09:34:21 2012 (r240689) @@ -50,8 +50,6 @@ MAN= acct.5 \ passwd.5 \ pbm.5 \ periodic.conf.5 \ - pf.conf.5 \ - pf.os.5 \ phones.5 \ portindex.5 \ portsnap.conf.5 \ @@ -91,6 +89,11 @@ MAN+= hesiod.conf.5 MAN+= nandfs.5 .endif +.if ${MK_PF} != "no" +MAN+= pf.conf.5 \ + pf.os.5 +.endif + .if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" _boot.config.5= boot.config.5 .endif From owner-svn-src-all@FreeBSD.ORG Wed Sep 19 11:38:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6582F1065673; Wed, 19 Sep 2012 11:38:38 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4B5E28FC15; Wed, 19 Sep 2012 11:38:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8JBccKe083998; Wed, 19 Sep 2012 11:38:38 GMT (envelope-from zeising@svn.freebsd.org) Received: (from zeising@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8JBcccA083997; Wed, 19 Sep 2012 11:38:38 GMT (envelope-from zeising@svn.freebsd.org) Message-Id: <201209191138.q8JBcccA083997@svn.freebsd.org> From: Niclas Zeising Date: Wed, 19 Sep 2012 11:38:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240690 - head/tools/build/options X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Sep 2012 11:38:38 -0000 Author: zeising (doc,ports committer) Date: Wed Sep 19 11:38:37 2012 New Revision: 240690 URL: http://svn.freebsd.org/changeset/base/240690 Log: Add documentation for the WITHOUT_KDUMP switch. This swtich was introduced in r240404 Approved by: joel (mentor) Added: head/tools/build/options/WITHOUT_KDUMP (contents, props changed) Added: head/tools/build/options/WITHOUT_KDUMP ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITHOUT_KDUMP Wed Sep 19 11:38:37 2012 (r240690) @@ -0,0 +1,5 @@ +.\" $FreeBSD$ +Set to not build +.Xr kdump 1 +and +.Xr truss 1 . From owner-svn-src-all@FreeBSD.ORG Wed Sep 19 11:40:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4DF091065670; Wed, 19 Sep 2012 11:40:18 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 38F028FC0A; Wed, 19 Sep 2012 11:40:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8JBeIHc084229; Wed, 19 Sep 2012 11:40:18 GMT (envelope-from zeising@svn.freebsd.org) Received: (from zeising@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8JBeISl084227; Wed, 19 Sep 2012 11:40:18 GMT (envelope-from zeising@svn.freebsd.org) Message-Id: <201209191140.q8JBeISl084227@svn.freebsd.org> From: Niclas Zeising Date: Wed, 19 Sep 2012 11:40:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240691 - head/share/man/man5 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Sep 2012 11:40:18 -0000 Author: zeising (doc,ports committer) Date: Wed Sep 19 11:40:17 2012 New Revision: 240691 URL: http://svn.freebsd.org/changeset/base/240691 Log: Regen for r240690 Approved by: joel (mentor) Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Wed Sep 19 11:38:37 2012 (r240690) +++ head/share/man/man5/src.conf.5 Wed Sep 19 11:40:17 2012 (r240691) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: head/tools/build/options/makeman 236279 2012-05-30 02:37:20Z gjb .\" $FreeBSD$ -.Dd September 8, 2012 +.Dd September 19, 2012 .Dt SRC.CONF 5 .Os .Sh NAME @@ -551,6 +551,12 @@ Set to build some programs without IPX s .\" from FreeBSD: head/tools/build/options/WITHOUT_JAIL 183242 2008-09-21 22:02:26Z sam Set to not build tools for the support of jails; e.g. .Xr jail 8 . +.It Va WITHOUT_KDUMP +.\" $FreeBSD$ +Set to not build +.Xr kdump 1 +and +.Xr truss 1 . .It Va WITHOUT_KERBEROS .\" from FreeBSD: head/tools/build/options/WITHOUT_KERBEROS 174549 2007-12-12 16:42:03Z ru Set this if you do not want to build Kerberos 5 (KTH Heimdal). From owner-svn-src-all@FreeBSD.ORG Wed Sep 19 11:54:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A0C1A106564A; Wed, 19 Sep 2012 11:54:33 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8C5F58FC16; Wed, 19 Sep 2012 11:54:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8JBsXOP086017; Wed, 19 Sep 2012 11:54:33 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8JBsXCU086015; Wed, 19 Sep 2012 11:54:33 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201209191154.q8JBsXCU086015@svn.freebsd.org> From: John Baldwin Date: Wed, 19 Sep 2012 11:54:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240692 - head/sys/dev/amr X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Sep 2012 11:54:33 -0000 Author: jhb Date: Wed Sep 19 11:54:32 2012 New Revision: 240692 URL: http://svn.freebsd.org/changeset/base/240692 Log: As a followup to r234501, ensure that the native ioctl path always allocates a 4kb buffer if a request uses a buffer size of 0. (The Linux ioctl path already did this.) PR: kern/155658 Submitted by: Andreas Longwitz MFC after: 1 week Modified: head/sys/dev/amr/amr.c Modified: head/sys/dev/amr/amr.c ============================================================================== --- head/sys/dev/amr/amr.c Wed Sep 19 11:40:17 2012 (r240691) +++ head/sys/dev/amr/amr.c Wed Sep 19 11:54:32 2012 (r240692) @@ -846,11 +846,8 @@ amr_ioctl(struct cdev *dev, u_long cmd, /* handle inbound data buffer */ real_length = amr_ioctl_buffer_length(au_length); + dp = malloc(real_length, M_AMR, M_WAITOK|M_ZERO); if (au_length != 0 && au_cmd[0] != 0x06) { - if ((dp = malloc(real_length, M_AMR, M_WAITOK|M_ZERO)) == NULL) { - error = ENOMEM; - goto out; - } if ((error = copyin(au_buffer, dp, au_length)) != 0) { free(dp, M_AMR); return (error); @@ -920,8 +917,7 @@ amr_ioctl(struct cdev *dev, u_long cmd, error = copyout(dp, au_buffer, au_length); } debug(2, "copyout %ld bytes from %p -> %p", au_length, dp, au_buffer); - if (dp != NULL) - debug(2, "%p status 0x%x", dp, ac->ac_status); + debug(2, "%p status 0x%x", dp, ac->ac_status); *au_statusp = ac->ac_status; out: From owner-svn-src-all@FreeBSD.ORG Wed Sep 19 12:27:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 811F91065670; Wed, 19 Sep 2012 12:27:24 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6BDA48FC17; Wed, 19 Sep 2012 12:27:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8JCROhm090975; Wed, 19 Sep 2012 12:27:24 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8JCRO97090969; Wed, 19 Sep 2012 12:27:24 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201209191227.q8JCRO97090969@svn.freebsd.org> From: Gavin Atkinson Date: Wed, 19 Sep 2012 12:27:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240693 - in head/sys/dev: ahci alc cxgbe e1000 re X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Sep 2012 12:27:24 -0000 Author: gavin Date: Wed Sep 19 12:27:23 2012 New Revision: 240693 URL: http://svn.freebsd.org/changeset/base/240693 Log: Switch some PCI register reads from using magic numbers to using the names defined in pcireg.h MFC after: 1 week Modified: head/sys/dev/ahci/ahci.c head/sys/dev/alc/if_alc.c head/sys/dev/cxgbe/osdep.h head/sys/dev/e1000/if_em.c head/sys/dev/re/if_re.c Modified: head/sys/dev/ahci/ahci.c ============================================================================== --- head/sys/dev/ahci/ahci.c Wed Sep 19 11:54:32 2012 (r240692) +++ head/sys/dev/ahci/ahci.c Wed Sep 19 12:27:23 2012 (r240693) @@ -543,7 +543,7 @@ ahci_ctlr_reset(device_t dev) struct ahci_controller *ctlr = device_get_softc(dev); int timeout; - if (pci_read_config(dev, 0x00, 4) == 0x28298086 && + if (pci_read_config(dev, PCIR_DEVVENDOR, 4) == 0x28298086 && (pci_read_config(dev, 0x92, 1) & 0xfe) == 0x04) pci_write_config(dev, 0x92, 0x01, 1); /* Enable AHCI mode */ Modified: head/sys/dev/alc/if_alc.c ============================================================================== --- head/sys/dev/alc/if_alc.c Wed Sep 19 11:54:32 2012 (r240692) +++ head/sys/dev/alc/if_alc.c Wed Sep 19 12:27:23 2012 (r240693) @@ -694,10 +694,10 @@ alc_aspm(struct alc_softc *sc, int media if ((sc->alc_flags & ALC_FLAG_APS) != 0) { /* Disable extended sync except AR8152 B v1.0 */ - linkcfg &= ~0x80; + linkcfg &= ~PCIEM_LINK_CTL_EXTENDED_SYNC; if (sc->alc_ident->deviceid == DEVICEID_ATHEROS_AR8152_B && sc->alc_rev == ATHEROS_AR8152_B_V10) - linkcfg |= 0x80; + linkcfg |= PCIEM_LINK_CTL_EXTENDED_SYNC; CSR_WRITE_2(sc, sc->alc_expcap + PCIER_LINK_CTL, linkcfg); pmcfg &= ~(PM_CFG_EN_BUFS_RX_L0S | PM_CFG_SA_DLY_ENB | @@ -834,15 +834,15 @@ alc_attach(device_t dev) cap = CSR_READ_2(sc, base + PCIER_LINK_CAP); if ((cap & PCIEM_LINK_CAP_ASPM) != 0) { ctl = CSR_READ_2(sc, base + PCIER_LINK_CTL); - if ((ctl & 0x08) != 0) + if ((ctl & PCIEM_LINK_CTL_RCB) != 0) sc->alc_rcb = DMA_CFG_RCB_128; if (bootverbose) device_printf(dev, "RCB %u bytes\n", sc->alc_rcb == DMA_CFG_RCB_64 ? 64 : 128); - state = ctl & 0x03; - if (state & 0x01) + state = ctl & PCIEM_LINK_CTL_ASPMC; + if (state & PCIEM_LINK_CTL_ASPMC_L0S) sc->alc_flags |= ALC_FLAG_L0S; - if (state & 0x02) + if (state & PCIEM_LINK_CTL_ASPMC_L1) sc->alc_flags |= ALC_FLAG_L1S; if (bootverbose) device_printf(sc->alc_dev, "ASPM %s %s\n", Modified: head/sys/dev/cxgbe/osdep.h ============================================================================== --- head/sys/dev/cxgbe/osdep.h Wed Sep 19 11:54:32 2012 (r240692) +++ head/sys/dev/cxgbe/osdep.h Wed Sep 19 12:27:23 2012 (r240693) @@ -125,7 +125,7 @@ typedef boolean_t bool; #define PCI_EXP_LNKSTA PCIER_LINK_STA #define PCI_EXP_LNKSTA_CLS PCIEM_LINK_STA_SPEED #define PCI_EXP_LNKSTA_NLW PCIEM_LINK_STA_WIDTH -#define PCI_EXP_DEVCTL2 0x28 +#define PCI_EXP_DEVCTL2 PCIER_DEVICE_CTL2 static inline int ilog2(long x) Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Wed Sep 19 11:54:32 2012 (r240692) +++ head/sys/dev/e1000/if_em.c Wed Sep 19 12:27:23 2012 (r240693) @@ -5119,7 +5119,7 @@ em_disable_aspm(struct adapter *adapter) return; reg = base + PCIER_LINK_CTL; link_ctrl = pci_read_config(dev, reg, 2); - link_ctrl &= 0xFFFC; /* turn off bit 1 and 2 */ + link_ctrl &= ~PCIEM_LINK_CTL_ASPMC; pci_write_config(dev, reg, link_ctrl, 2); return; } Modified: head/sys/dev/re/if_re.c ============================================================================== --- head/sys/dev/re/if_re.c Wed Sep 19 11:54:32 2012 (r240692) +++ head/sys/dev/re/if_re.c Wed Sep 19 12:27:23 2012 (r240693) @@ -1347,8 +1347,8 @@ re_attach(device_t dev) if ((cap & PCIEM_LINK_CAP_ASPM) != 0) { ctl = pci_read_config(dev, sc->rl_expcap + PCIER_LINK_CTL, 2); - if ((ctl & 0x0003) != 0) { - ctl &= ~0x0003; + if ((ctl & PCIEM_LINK_CTL_ASPMC) != 0) { + ctl &= ~PCIEM_LINK_CTL_ASPMC; pci_write_config(dev, sc->rl_expcap + PCIER_LINK_CTL, ctl, 2); device_printf(dev, "ASPM disabled\n"); From owner-svn-src-all@FreeBSD.ORG Wed Sep 19 12:54:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 88E3C1065677; Wed, 19 Sep 2012 12:54:26 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 73FE88FC12; Wed, 19 Sep 2012 12:54:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8JCsQai094401; Wed, 19 Sep 2012 12:54:26 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8JCsQBh094399; Wed, 19 Sep 2012 12:54:26 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201209191254.q8JCsQBh094399@svn.freebsd.org> From: Gavin Atkinson Date: Wed, 19 Sep 2012 12:54:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240694 - head/sys/dev/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Sep 2012 12:54:26 -0000 Author: gavin Date: Wed Sep 19 12:54:25 2012 New Revision: 240694 URL: http://svn.freebsd.org/changeset/base/240694 Log: Add PCI subclass for NVM Express devices. Reference: http://www.nvmexpress.org/index.php/download_file/view/42/1/NVM_Express_1_0b.pdf section 2.1.5. MFC after: 1 week Modified: head/sys/dev/pci/pcireg.h Modified: head/sys/dev/pci/pcireg.h ============================================================================== --- head/sys/dev/pci/pcireg.h Wed Sep 19 12:27:23 2012 (r240693) +++ head/sys/dev/pci/pcireg.h Wed Sep 19 12:54:25 2012 (r240694) @@ -275,6 +275,7 @@ #define PCIS_STORAGE_SATA 0x06 #define PCIP_STORAGE_SATA_AHCI_1_0 0x01 #define PCIS_STORAGE_SAS 0x07 +#define PCIS_STORAGE_NVM 0x08 #define PCIS_STORAGE_OTHER 0x80 #define PCIC_NETWORK 0x02 From owner-svn-src-all@FreeBSD.ORG Wed Sep 19 15:43:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 84CA8106566B; Wed, 19 Sep 2012 15:43:31 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7052D8FC14; Wed, 19 Sep 2012 15:43:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8JFhVte019447; Wed, 19 Sep 2012 15:43:31 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8JFhVJH019444; Wed, 19 Sep 2012 15:43:31 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201209191543.q8JFhVJH019444@svn.freebsd.org> From: Jim Harris Date: Wed, 19 Sep 2012 15:43:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240695 - head/sys/dev/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Sep 2012 15:43:31 -0000 Author: jimharris Date: Wed Sep 19 15:43:30 2012 New Revision: 240695 URL: http://svn.freebsd.org/changeset/base/240695 Log: Add constants for programming interfaces for NVM/solid state storage controller sub-class code. Reference: PCI Code and ID Assignment Specification Rev 1.2 Sponsored by: Intel Inspired by: gavin MFC after: 1 week X-MFC-With: r240694 Modified: head/sys/dev/pci/pcireg.h Modified: head/sys/dev/pci/pcireg.h ============================================================================== --- head/sys/dev/pci/pcireg.h Wed Sep 19 12:54:25 2012 (r240694) +++ head/sys/dev/pci/pcireg.h Wed Sep 19 15:43:30 2012 (r240695) @@ -276,6 +276,8 @@ #define PCIP_STORAGE_SATA_AHCI_1_0 0x01 #define PCIS_STORAGE_SAS 0x07 #define PCIS_STORAGE_NVM 0x08 +#define PCIP_STORAGE_NVM_NVMHCI_1_0 0x01 +#define PCIP_STORAGE_NVM_ENTERPRISE_NVMHCI_1_0 0x02 #define PCIS_STORAGE_OTHER 0x80 #define PCIC_NETWORK 0x02 From owner-svn-src-all@FreeBSD.ORG Wed Sep 19 16:20:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9461D106564A; Wed, 19 Sep 2012 16:20:50 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 661778FC0C; Wed, 19 Sep 2012 16:20:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8JGKoko024464; Wed, 19 Sep 2012 16:20:50 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8JGKorx024460; Wed, 19 Sep 2012 16:20:50 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201209191620.q8JGKorx024460@svn.freebsd.org> From: Baptiste Daroussin Date: Wed, 19 Sep 2012 16:20:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240696 - in head/cddl: contrib/opensolaris/cmd/zfs sbin/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Sep 2012 16:20:50 -0000 Author: bapt Date: Wed Sep 19 16:20:49 2012 New Revision: 240696 URL: http://svn.freebsd.org/changeset/base/240696 Log: Allow zfs jail and zfs unjail to use both jailnames and jailid Reviewed by: pjd MFC after: 1 month Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c head/cddl/sbin/zfs/Makefile Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Wed Sep 19 15:43:30 2012 (r240695) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Wed Sep 19 16:20:49 2012 (r240696) @@ -256,10 +256,10 @@ .Op Ar snapshot Ns | Ns Ar filesystem .Nm .Cm jail -.Ar jailid filesystem +.Ar jailid Ns | Ns Ar jailname filesystem .Nm .Cm unjail -.Ar jailid filesystem +.Ar jailid Ns | Ns Ar jailname filesystem .Sh DESCRIPTION The .Nm Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Wed Sep 19 15:43:30 2012 (r240695) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Wed Sep 19 16:20:49 2012 (r240696) @@ -6300,9 +6300,9 @@ do_jail(int argc, char **argv, int attac usage(B_FALSE); } - jailid = atoi(argv[1]); - if (jailid == 0) { - (void) fprintf(stderr, gettext("invalid jailid\n")); + jailid = jail_getid(argv[1]); + if (jailid < 0) { + (void) fprintf(stderr, gettext("invalid jail id or name\n")); usage(B_FALSE); } Modified: head/cddl/sbin/zfs/Makefile ============================================================================== --- head/cddl/sbin/zfs/Makefile Wed Sep 19 15:43:30 2012 (r240695) +++ head/cddl/sbin/zfs/Makefile Wed Sep 19 16:20:49 2012 (r240696) @@ -21,8 +21,8 @@ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/sys CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/zfs -DPADD= ${LIBGEOM} ${LIBNVPAIR} ${LIBUMEM} \ +DPADD= ${LIBGEOM} ${LIBJAIL} ${LIBNVPAIR} ${LIBUMEM} \ ${LIBUTIL} ${LIBUUTIL} ${LIBZFS} -LDADD= -lgeom -lnvpair -lumem -lutil -luutil -lzfs +LDADD= -lgeom -ljail -lnvpair -lumem -lutil -luutil -lzfs .include From owner-svn-src-all@FreeBSD.ORG Wed Sep 19 16:21:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1A2C4106571F; Wed, 19 Sep 2012 16:21:24 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 660148FC14; Wed, 19 Sep 2012 16:21:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8JGLOeq024648; Wed, 19 Sep 2012 16:21:24 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8JGLOaR024645; Wed, 19 Sep 2012 16:21:24 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201209191621.q8JGLOaR024645@svn.freebsd.org> From: Jim Harris Date: Wed, 19 Sep 2012 16:21:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240697 - head/sys/dev/nvme X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Sep 2012 16:21:25 -0000 Author: jimharris Date: Wed Sep 19 16:21:23 2012 New Revision: 240697 URL: http://svn.freebsd.org/changeset/base/240697 Log: Report nvme(4) as a generic driver for NVMe devices if PCI class, subclass and programming interface codes match. Sponsored by: Intel Modified: head/sys/dev/nvme/nvme.c Modified: head/sys/dev/nvme/nvme.c ============================================================================== --- head/sys/dev/nvme/nvme.c Wed Sep 19 16:20:49 2012 (r240696) +++ head/sys/dev/nvme/nvme.c Wed Sep 19 16:21:23 2012 (r240697) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include "nvme_private.h" @@ -82,17 +83,29 @@ static struct _pcsid static int nvme_probe (device_t device) { - u_int32_t type = pci_get_devid(device); - struct _pcsid *ep = pci_ids; + struct _pcsid *ep; + int probe_val = ENXIO; + u_int32_t type; + + type = pci_get_devid(device); + ep = pci_ids; + +#if defined(PCIS_STORAGE_NVM) + if (pci_get_class(device) == PCIC_STORAGE && + pci_get_subclass(device) == PCIS_STORAGE_NVM && + pci_get_progif(device) == PCIP_STORAGE_NVM_ENTERPRISE_NVMHCI_1_0) + probe_val = BUS_PROBE_GENERIC; +#endif while (ep->type && ep->type != type) ++ep; if (ep->desc) { device_set_desc(device, ep->desc); - return (BUS_PROBE_DEFAULT); - } else - return (ENXIO); + probe_val = BUS_PROBE_DEFAULT; + } + + return (probe_val); } static void From owner-svn-src-all@FreeBSD.ORG Wed Sep 19 16:28:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 324471065672; Wed, 19 Sep 2012 16:28:39 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1D3AF8FC12; Wed, 19 Sep 2012 16:28:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8JGScan025685; Wed, 19 Sep 2012 16:28:38 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8JGSckQ025683; Wed, 19 Sep 2012 16:28:38 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201209191628.q8JGSckQ025683@svn.freebsd.org> From: Baptiste Daroussin Date: Wed, 19 Sep 2012 16:28:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240698 - head/cddl/contrib/opensolaris/cmd/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Sep 2012 16:28:39 -0000 Author: bapt Date: Wed Sep 19 16:28:38 2012 New Revision: 240698 URL: http://svn.freebsd.org/changeset/base/240698 Log: Update usage to show the possiblity to use jail name Reported by: bdrewery MFC after: 1 month Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Wed Sep 19 16:21:23 2012 (r240697) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Wed Sep 19 16:28:38 2012 (r240698) @@ -240,9 +240,9 @@ get_usage(zfs_help_t idx) return (gettext("\tupgrade [-v]\n" "\tupgrade [-r] [-V version] <-a | filesystem ...>\n")); case HELP_JAIL: - return (gettext("\tjail \n")); + return (gettext("\tjail \n")); case HELP_UNJAIL: - return (gettext("\tunjail \n")); + return (gettext("\tunjail \n")); case HELP_LIST: return (gettext("\tlist [-rH][-d max] " "[-o property[,...]] [-t type[,...]] [-s property] ...\n" From owner-svn-src-all@FreeBSD.ORG Wed Sep 19 18:00:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 837871065670; Wed, 19 Sep 2012 18:00:06 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 46BF38FC08; Wed, 19 Sep 2012 18:00:06 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id A9A9CB91E; Wed, 19 Sep 2012 14:00:05 -0400 (EDT) From: John Baldwin To: Jim Harris Date: Wed, 19 Sep 2012 13:52:02 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p17; KDE/4.5.5; amd64; ; ) References: <201209191621.q8JGLOaR024645@svn.freebsd.org> In-Reply-To: <201209191621.q8JGLOaR024645@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201209191352.02814.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 19 Sep 2012 14:00:05 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r240697 - head/sys/dev/nvme X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Sep 2012 18:00:11 -0000 On Wednesday, September 19, 2012 12:21:24 pm Jim Harris wrote: > Author: jimharris > Date: Wed Sep 19 16:21:23 2012 > New Revision: 240697 > URL: http://svn.freebsd.org/changeset/base/240697 > > Log: > Report nvme(4) as a generic driver for NVMe devices if PCI class, subclass > and programming interface codes match. You need to set a description in the generic case. I would suggest doing something like: while (ep->type && ep->type != type) ++ep; if (ep->desc) { device_set_desc(device, ep->desc); return (BUS_PROBE_DEFAULT); } #ifdef PCIS_STORAGE_NVM if (pci_get_class(device) == PCIC_STORAGE && ...) { device_set_desc(device, "blah blah"); return (BUS_PROBE_GENERIC); } #endif return (ENXIO); I think that might be a bit clearer to the reader. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Wed Sep 19 18:22:16 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id ED385106564A; Wed, 19 Sep 2012 18:22:15 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9E7F48FC08; Wed, 19 Sep 2012 18:22:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8JIMFQx043015; Wed, 19 Sep 2012 18:22:15 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8JIMFEi043012; Wed, 19 Sep 2012 18:22:15 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201209191822.q8JIMFEi043012@svn.freebsd.org> From: Gavin Atkinson Date: Wed, 19 Sep 2012 18:22:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240699 - in head: sys/dev/pci usr.sbin/pciconf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Sep 2012 18:22:16 -0000 Author: gavin Date: Wed Sep 19 18:22:14 2012 New Revision: 240699 URL: http://svn.freebsd.org/changeset/base/240699 Log: Recognise NVM Express devices and pretty-print their name. MFC after: 1 week Modified: head/sys/dev/pci/pci.c head/usr.sbin/pciconf/pciconf.c Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Wed Sep 19 16:28:38 2012 (r240698) +++ head/sys/dev/pci/pci.c Wed Sep 19 18:22:14 2012 (r240699) @@ -3661,6 +3661,7 @@ static struct {PCIC_STORAGE, PCIS_STORAGE_ATA_ADMA, "ATA (ADMA)"}, {PCIC_STORAGE, PCIS_STORAGE_SATA, "SATA"}, {PCIC_STORAGE, PCIS_STORAGE_SAS, "SAS"}, + {PCIC_STORAGE, PCIS_STORAGE_NVM, "NVM Express"}, {PCIC_NETWORK, -1, "network"}, {PCIC_NETWORK, PCIS_NETWORK_ETHERNET, "ethernet"}, {PCIC_NETWORK, PCIS_NETWORK_TOKENRING, "token ring"}, Modified: head/usr.sbin/pciconf/pciconf.c ============================================================================== --- head/usr.sbin/pciconf/pciconf.c Wed Sep 19 16:28:38 2012 (r240698) +++ head/usr.sbin/pciconf/pciconf.c Wed Sep 19 18:22:14 2012 (r240699) @@ -345,6 +345,7 @@ static struct {PCIC_STORAGE, PCIS_STORAGE_ATA_ADMA, "ATA (ADMA)"}, {PCIC_STORAGE, PCIS_STORAGE_SATA, "SATA"}, {PCIC_STORAGE, PCIS_STORAGE_SAS, "SAS"}, + {PCIC_STORAGE, PCIS_STORAGE_NVM, "NVM Express"}, {PCIC_NETWORK, -1, "network"}, {PCIC_NETWORK, PCIS_NETWORK_ETHERNET, "ethernet"}, {PCIC_NETWORK, PCIS_NETWORK_TOKENRING, "token ring"}, From owner-svn-src-all@FreeBSD.ORG Wed Sep 19 18:25:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3BD39106564A; Wed, 19 Sep 2012 18:25:26 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 276F18FC16; Wed, 19 Sep 2012 18:25:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8JIPPEq043523; Wed, 19 Sep 2012 18:25:25 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8JIPPog043521; Wed, 19 Sep 2012 18:25:25 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201209191825.q8JIPPog043521@svn.freebsd.org> From: Jim Harris Date: Wed, 19 Sep 2012 18:25:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240700 - head/sys/dev/nvme X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Sep 2012 18:25:26 -0000 Author: jimharris Date: Wed Sep 19 18:25:25 2012 New Revision: 240700 URL: http://svn.freebsd.org/changeset/base/240700 Log: In nvme(4), set device description for BUS_PROBE_GENERIC case. Reported by: jhb Modified: head/sys/dev/nvme/nvme.c Modified: head/sys/dev/nvme/nvme.c ============================================================================== --- head/sys/dev/nvme/nvme.c Wed Sep 19 18:22:14 2012 (r240699) +++ head/sys/dev/nvme/nvme.c Wed Sep 19 18:25:25 2012 (r240700) @@ -84,28 +84,29 @@ static int nvme_probe (device_t device) { struct _pcsid *ep; - int probe_val = ENXIO; u_int32_t type; type = pci_get_devid(device); ep = pci_ids; -#if defined(PCIS_STORAGE_NVM) - if (pci_get_class(device) == PCIC_STORAGE && - pci_get_subclass(device) == PCIS_STORAGE_NVM && - pci_get_progif(device) == PCIP_STORAGE_NVM_ENTERPRISE_NVMHCI_1_0) - probe_val = BUS_PROBE_GENERIC; -#endif - while (ep->type && ep->type != type) ++ep; if (ep->desc) { device_set_desc(device, ep->desc); - probe_val = BUS_PROBE_DEFAULT; + return (BUS_PROBE_DEFAULT); } - return (probe_val); +#if defined(PCIS_STORAGE_NVM) + if (pci_get_class(device) == PCIC_STORAGE && + pci_get_subclass(device) == PCIS_STORAGE_NVM && + pci_get_progif(device) == PCIP_STORAGE_NVM_ENTERPRISE_NVMHCI_1_0) { + device_set_desc(device, "Generic NVMe Device"); + return (BUS_PROBE_GENERIC); + } +#endif + + return (ENXIO); } static void From owner-svn-src-all@FreeBSD.ORG Wed Sep 19 18:42:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 89EF1106564A; Wed, 19 Sep 2012 18:42:32 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 758788FC08; Wed, 19 Sep 2012 18:42:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8JIgWBB046271; Wed, 19 Sep 2012 18:42:32 GMT (envelope-from tijl@svn.freebsd.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8JIgW2S046269; Wed, 19 Sep 2012 18:42:32 GMT (envelope-from tijl@svn.freebsd.org) Message-Id: <201209191842.q8JIgW2S046269@svn.freebsd.org> From: Tijl Coosemans Date: Wed, 19 Sep 2012 18:42:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240701 - head/sys/cam/scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Sep 2012 18:42:32 -0000 Author: tijl Date: Wed Sep 19 18:42:31 2012 New Revision: 240701 URL: http://svn.freebsd.org/changeset/base/240701 Log: Fix a panic when trying to play invalid audio tracks. Modified: head/sys/cam/scsi/scsi_cd.c Modified: head/sys/cam/scsi/scsi_cd.c ============================================================================== --- head/sys/cam/scsi/scsi_cd.c Wed Sep 19 18:25:25 2012 (r240700) +++ head/sys/cam/scsi/scsi_cd.c Wed Sep 19 18:42:31 2012 (r240701) @@ -2080,6 +2080,7 @@ cdioctl(struct disk *dp, u_long cmd, voi || (st > (softc->toc.header.ending_track - softc->toc.header.starting_track))) { error = EINVAL; + cam_periph_unlock(periph); break; } sentry = &softc->toc.entries[st].addr; From owner-svn-src-all@FreeBSD.ORG Wed Sep 19 19:14:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3E2E6106564A; Wed, 19 Sep 2012 19:14:22 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 28A708FC0C; Wed, 19 Sep 2012 19:14:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8JJEMHj051616; Wed, 19 Sep 2012 19:14:22 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8JJELAP051610; Wed, 19 Sep 2012 19:14:21 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201209191914.q8JJELAP051610@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 19 Sep 2012 19:14:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240702 - in releng/9.1/usr.sbin/pkg_install: add lib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Sep 2012 19:14:22 -0000 Author: jkim Date: Wed Sep 19 19:14:21 2012 New Revision: 240702 URL: http://svn.freebsd.org/changeset/base/240702 Log: MFC: r240476 Do not change owner, group, or mode when package database directory and its contents are created with pkg_add(1). It may happen when the packing list contains @owner, @group, or @mode. Approved by: re (kib), portmgr (bapt) Modified: releng/9.1/usr.sbin/pkg_install/add/add.h releng/9.1/usr.sbin/pkg_install/add/extract.c releng/9.1/usr.sbin/pkg_install/add/futil.c releng/9.1/usr.sbin/pkg_install/add/perform.c releng/9.1/usr.sbin/pkg_install/lib/lib.h Directory Properties: releng/9.1/usr.sbin/pkg_install/ (props changed) releng/9.1/usr.sbin/pkg_install/add/ (props changed) Modified: releng/9.1/usr.sbin/pkg_install/add/add.h ============================================================================== --- releng/9.1/usr.sbin/pkg_install/add/add.h Wed Sep 19 18:42:31 2012 (r240701) +++ releng/9.1/usr.sbin/pkg_install/add/add.h Wed Sep 19 19:14:21 2012 (r240702) @@ -41,7 +41,7 @@ extern char *PkgAddCmd; extern char FirstPen[]; extern add_mode_t AddMode; -int make_hierarchy(char *); +int make_hierarchy(char *, Boolean); void extract_plist(const char *, Package *); void apply_perms(const char *, const char *); Modified: releng/9.1/usr.sbin/pkg_install/add/extract.c ============================================================================== --- releng/9.1/usr.sbin/pkg_install/add/extract.c Wed Sep 19 18:42:31 2012 (r240701) +++ releng/9.1/usr.sbin/pkg_install/add/extract.c Wed Sep 19 19:14:21 2012 (r240702) @@ -225,7 +225,7 @@ extract_plist(const char *home, Package printf("extract: CWD to %s\n", p->name); PUSHOUT(Directory); if (strcmp(p->name, ".")) { - if (!Fake && make_hierarchy(p->name) == FAIL) { + if (!Fake && make_hierarchy(p->name, TRUE) == FAIL) { cleanup(0); errx(2, "%s: unable to cwd to '%s'", __func__, p->name); } Modified: releng/9.1/usr.sbin/pkg_install/add/futil.c ============================================================================== --- releng/9.1/usr.sbin/pkg_install/add/futil.c Wed Sep 19 18:42:31 2012 (r240701) +++ releng/9.1/usr.sbin/pkg_install/add/futil.c Wed Sep 19 19:14:21 2012 (r240702) @@ -31,7 +31,7 @@ __FBSDID("$FreeBSD$"); */ int -make_hierarchy(char *dir) +make_hierarchy(char *dir, Boolean set_perm) { char *cp1, *cp2; @@ -55,7 +55,8 @@ make_hierarchy(char *dir) *cp2 = '/'; return FAIL; } - apply_perms(NULL, dir); + if (set_perm) + apply_perms(NULL, dir); } /* Put it back */ if (cp2) { Modified: releng/9.1/usr.sbin/pkg_install/add/perform.c ============================================================================== --- releng/9.1/usr.sbin/pkg_install/add/perform.c Wed Sep 19 18:42:31 2012 (r240701) +++ releng/9.1/usr.sbin/pkg_install/add/perform.c Wed Sep 19 19:14:21 2012 (r240702) @@ -511,7 +511,7 @@ pkg_do(char *pkg) zapLogDir = 1; if (Verbose) printf("Attempting to record package into %s..\n", LogDir); - if (make_hierarchy(LogDir)) { + if (make_hierarchy(LogDir, FALSE)) { warnx("can't record package into '%s', you're on your own!", LogDir); bzero(LogDir, FILENAME_MAX); Modified: releng/9.1/usr.sbin/pkg_install/lib/lib.h ============================================================================== --- releng/9.1/usr.sbin/pkg_install/lib/lib.h Wed Sep 19 18:42:31 2012 (r240701) +++ releng/9.1/usr.sbin/pkg_install/lib/lib.h Wed Sep 19 19:14:21 2012 (r240702) @@ -99,7 +99,7 @@ * Version of the package tools - increase whenever you make a change * in the code that is not cosmetic only. */ -#define PKG_INSTALL_VERSION 20120530 +#define PKG_INSTALL_VERSION 20120913 #define PKG_WRAPCONF_FNAME "/var/db/pkg_install.conf" #define main(argc, argv) real_main(argc, argv) From owner-svn-src-all@FreeBSD.ORG Wed Sep 19 19:21:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DF461106564A; Wed, 19 Sep 2012 19:21:22 +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 CB5AC8FC15; Wed, 19 Sep 2012 19:21:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8JJLMop052780; Wed, 19 Sep 2012 19:21:22 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8JJLMlE052778; Wed, 19 Sep 2012 19:21:22 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201209191921.q8JJLMlE052778@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 19 Sep 2012 19:21:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240704 - head/lib/libc/string X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Sep 2012 19:21:23 -0000 Author: jilles Date: Wed Sep 19 19:21:22 2012 New Revision: 240704 URL: http://svn.freebsd.org/changeset/base/240704 Log: strsignal(): Do not append signal numbers to messages for known signals. Messages for known signals looked like "Terminated: 15" instead of "Terminated". Modified: head/lib/libc/string/strsignal.c Modified: head/lib/libc/string/strsignal.c ============================================================================== --- head/lib/libc/string/strsignal.c Wed Sep 19 19:16:08 2012 (r240703) +++ head/lib/libc/string/strsignal.c Wed Sep 19 19:21:22 2012 (r240704) @@ -120,7 +120,6 @@ strsignal(int num) UPREFIX, #endif sizeof(sig_ebuf)); - } signum = num; if (num < 0) @@ -143,6 +142,7 @@ strsignal(int num) break; } *p = '\0'; + } #if defined(NLS) catclose(catd); From owner-svn-src-all@FreeBSD.ORG Wed Sep 19 19:22:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 746A41065673; Wed, 19 Sep 2012 19:22:25 +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 606368FC12; Wed, 19 Sep 2012 19:22:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8JJMPEN052953; Wed, 19 Sep 2012 19:22:25 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8JJMPLK052950; Wed, 19 Sep 2012 19:22:25 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201209191922.q8JJMPLK052950@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 19 Sep 2012 19:22:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240705 - head/lib/libc/string X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Sep 2012 19:22:25 -0000 Author: jilles Date: Wed Sep 19 19:22:24 2012 New Revision: 240705 URL: http://svn.freebsd.org/changeset/base/240705 Log: strsignal(): Reindent. Modified: head/lib/libc/string/strsignal.c Modified: head/lib/libc/string/strsignal.c ============================================================================== --- head/lib/libc/string/strsignal.c Wed Sep 19 19:21:22 2012 (r240704) +++ head/lib/libc/string/strsignal.c Wed Sep 19 19:22:24 2012 (r240705) @@ -121,27 +121,27 @@ strsignal(int num) #endif sizeof(sig_ebuf)); - signum = num; - if (num < 0) - signum = -signum; + signum = num; + if (num < 0) + signum = -signum; - t = tmp; - do { - *t++ = "0123456789"[signum % 10]; - } while (signum /= 10); - if (num < 0) - *t++ = '-'; + t = tmp; + do { + *t++ = "0123456789"[signum % 10]; + } while (signum /= 10); + if (num < 0) + *t++ = '-'; - p = (ebuf + n); - *p++ = ':'; - *p++ = ' '; + p = (ebuf + n); + *p++ = ':'; + *p++ = ' '; - for (;;) { - *p++ = *--t; - if (t <= tmp) - break; - } - *p = '\0'; + for (;;) { + *p++ = *--t; + if (t <= tmp) + break; + } + *p = '\0'; } #if defined(NLS) From owner-svn-src-all@FreeBSD.ORG Wed Sep 19 19:28:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 117601065670; Wed, 19 Sep 2012 19:28:53 +0000 (UTC) (envelope-from jim.harris@gmail.com) Received: from mail-qc0-f182.google.com (mail-qc0-f182.google.com [209.85.216.182]) by mx1.freebsd.org (Postfix) with ESMTP id 7F7318FC12; Wed, 19 Sep 2012 19:28:52 +0000 (UTC) Received: by qcsg15 with SMTP id g15so1345943qcs.13 for ; Wed, 19 Sep 2012 12:28:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=2UL0tZrXcMBMXVwd7crKgilemCmpIuzLinPCa7rfW6E=; b=jheLPEnoJGmBjVzOUJTLc/VWidt6U7fGqO0XgkJKnnYUi2/At3hUssd2y8yvJrWB7T DqEdZsDBt60fNs964Z5RFpLaSIgM578oT/HjXZXLVjjRmLVLzAE2mIuIxx75TRMBKqFV Vg5rWkG+92kizKcfjvBVJIin0pwI6DKlujtaHYmiJ2QTQBYZO/t5DDU6VU2rhw2uZ4O0 2484cWDYGKp+VTbf7ot6JBSf87l0BzLk+U+t7PadFnvtA5K7RKZCmc5TPCsSRqvs3L2O TgpUiLvEuvm6aQhC8F/HjEu5mTWI29t9cA5/nZI+nE2V0bk03lD/1c0g4uT3nDyBHtjB godw== MIME-Version: 1.0 Received: by 10.224.189.5 with SMTP id dc5mr9231190qab.89.1348082931748; Wed, 19 Sep 2012 12:28:51 -0700 (PDT) Received: by 10.49.104.70 with HTTP; Wed, 19 Sep 2012 12:28:51 -0700 (PDT) In-Reply-To: <201209191822.q8JIMFEi043012@svn.freebsd.org> References: <201209191822.q8JIMFEi043012@svn.freebsd.org> Date: Wed, 19 Sep 2012 12:28:51 -0700 Message-ID: From: Jim Harris To: Gavin Atkinson Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r240699 - in head: sys/dev/pci usr.sbin/pciconf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Sep 2012 19:28:53 -0000 On Wed, Sep 19, 2012 at 11:22 AM, Gavin Atkinson wrote: > Author: gavin > Date: Wed Sep 19 18:22:14 2012 > New Revision: 240699 > URL: http://svn.freebsd.org/changeset/base/240699 > > Log: > Recognise NVM Express devices and pretty-print their name. > > MFC after: 1 week > > Modified: > head/sys/dev/pci/pci.c > head/usr.sbin/pciconf/pciconf.c > > Modified: head/sys/dev/pci/pci.c > ============================================================================== > --- head/sys/dev/pci/pci.c Wed Sep 19 16:28:38 2012 (r240698) > +++ head/sys/dev/pci/pci.c Wed Sep 19 18:22:14 2012 (r240699) > @@ -3661,6 +3661,7 @@ static struct > {PCIC_STORAGE, PCIS_STORAGE_ATA_ADMA, "ATA (ADMA)"}, > {PCIC_STORAGE, PCIS_STORAGE_SATA, "SATA"}, > {PCIC_STORAGE, PCIS_STORAGE_SAS, "SAS"}, > + {PCIC_STORAGE, PCIS_STORAGE_NVM, "NVM Express"}, Hi Gavin, This should really read "NVM", not "NVM Express". NVM Express should be reserved for NVM subclass devices with the NVM Express PI (Programming Interface). PCI SIG refers to this PI as "Enterprise NVMHCI", but it's the same thing. Regards, -Jim > {PCIC_NETWORK, -1, "network"}, > {PCIC_NETWORK, PCIS_NETWORK_ETHERNET, "ethernet"}, > {PCIC_NETWORK, PCIS_NETWORK_TOKENRING, "token ring"}, > > Modified: head/usr.sbin/pciconf/pciconf.c > ============================================================================== > --- head/usr.sbin/pciconf/pciconf.c Wed Sep 19 16:28:38 2012 (r240698) > +++ head/usr.sbin/pciconf/pciconf.c Wed Sep 19 18:22:14 2012 (r240699) > @@ -345,6 +345,7 @@ static struct > {PCIC_STORAGE, PCIS_STORAGE_ATA_ADMA, "ATA (ADMA)"}, > {PCIC_STORAGE, PCIS_STORAGE_SATA, "SATA"}, > {PCIC_STORAGE, PCIS_STORAGE_SAS, "SAS"}, > + {PCIC_STORAGE, PCIS_STORAGE_NVM, "NVM Express"}, > {PCIC_NETWORK, -1, "network"}, > {PCIC_NETWORK, PCIS_NETWORK_ETHERNET, "ethernet"}, > {PCIC_NETWORK, PCIS_NETWORK_TOKENRING, "token ring"}, From owner-svn-src-all@FreeBSD.ORG Wed Sep 19 20:11:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B312106566C; Wed, 19 Sep 2012 20:11:48 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 640F08FC12; Wed, 19 Sep 2012 20:11:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8JKBmKp061531; Wed, 19 Sep 2012 20:11:48 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8JKBmt7061527; Wed, 19 Sep 2012 20:11:48 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201209192011.q8JKBmt7061527@svn.freebsd.org> From: "David E. O'Brien" Date: Wed, 19 Sep 2012 20:11: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: r240707 - in stable/8: share/man/man4 sys/dev/filemon sys/modules sys/modules/filemon tools/regression/filemon X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Sep 2012 20:11:48 -0000 Author: obrien Date: Wed Sep 19 20:11:47 2012 New Revision: 240707 URL: http://svn.freebsd.org/changeset/base/240707 Log: MF9: r237795 MFC: r236592 r236593 r236594 r236620 r236621 r236622 r236637 r237794: filemon(4) Added: stable/8/share/man/man4/filemon.4 - copied unchanged from r237795, stable/9/share/man/man4/filemon.4 stable/8/sys/dev/filemon/ - copied from r237795, stable/9/sys/dev/filemon/ stable/8/sys/modules/filemon/ - copied from r237795, stable/9/sys/modules/filemon/ stable/8/tools/regression/filemon/ - copied from r237795, stable/9/tools/regression/filemon/ Modified: stable/8/share/man/man4/Makefile stable/8/sys/modules/Makefile Directory Properties: stable/8/ (props changed) stable/8/share/ (props changed) stable/8/share/man/ (props changed) stable/8/share/man/man4/ (props changed) stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/modules/ (props changed) stable/8/tools/ (props changed) Modified: stable/8/share/man/man4/Makefile ============================================================================== --- stable/8/share/man/man4/Makefile Wed Sep 19 19:59:15 2012 (r240706) +++ stable/8/share/man/man4/Makefile Wed Sep 19 20:11:47 2012 (r240707) @@ -118,6 +118,7 @@ MAN= aac.4 \ fatm.4 \ fd.4 \ fdc.4 \ + filemon.4 \ firewire.4 \ fpa.4 \ fwe.4 \ Copied: stable/8/share/man/man4/filemon.4 (from r237795, stable/9/share/man/man4/filemon.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/share/man/man4/filemon.4 Wed Sep 19 20:11:47 2012 (r240707, copy of r237795, stable/9/share/man/man4/filemon.4) @@ -0,0 +1,176 @@ +.\" Copyright (c) 2012 +.\" David E. O'Brien . 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. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by David E. O'Brien and +.\" contributors. +.\" 4. Neither the name of the author nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE 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 May 30, 2012 +.Dt FILEMON 4 +.Os +.Sh NAME +.Nm filemon +.Nd the filemon device +.Sh SYNOPSIS +.In dev/filemon/filemon.h +.Sh DESCRIPTION +The +.Nm +device allows a process to collect file operations data of its children. +The device +.Pa /dev/filemon +responds to two +.Xr ioctl 2 +calls. +.Pp +System calls are denoted using the following single letters: +.Pp +.Bl -tag -width indent -compact +.It Ql C +.Xr chdir 2 +.It Ql D +.Xr unlink 2 +.It Ql E +.Xr exec 2 +.It Ql F +.Xr fork 2 , +.Xr vfork 2 +.It Ql L +.Xr link 2 , +.Xr linkat 2 , +.Xr symlink 2 , +.Xr symlinkat 2 +.It Ql M +.Xr rename 2 +.It Ql R +.Xr open 2 +for read +.It Ql S +.Xr stat 2 +.It Ql W +.Xr open 2 +for write +.It Ql X +.Xr _exit 2 +.El +.Pp +Note that +.Ql R +following +.Ql W +records can represent a single +.Xr open 2 +for R/W, +or two seperate +.Xr open 2 +calls, one for +.Ql R +and one for +.Ql W . +.Sh IOCTLS +User mode programs communicate with the +.Nm +driver through a number of ioctls which are described below. +Each takes a single argument. +.Bl -tag -width ".Dv FILEMON_SET_PID" +.It Dv FILEMON_SET_FD +Write the internal tracing buffer to the supplied open file descriptor. +.It Dv FILEMON_SET_PID +Child process ID to trace. +.El +.Sh RETURN VALUES +.\" .Rv -std ioctl +The +.Fn ioctl +function returns the value 0 if successful; +otherwise the value \-1 is returned and the global variable +.Va errno +is set to indicate the error. +.Sh FILES +.Bl -tag -width ".Pa /dev/filemon" +.It Pa /dev/filemon +.El +.Sh EXAMPLES +.Bd -literal +#include +#include +#include +#include +#include +#include +#include + +static void +open_filemon(void) +{ + pid_t child; + int fm_fd, fm_log; + + if ((fm_fd = open("/dev/filemon", O_RDWR)) == -1) + err(1, "open(\e"/dev/filemon\e", O_RDWR)"); + if ((fm_log = open("filemon.out", + O_CREAT | O_WRONLY | O_TRUNC, DEFFILEMODE)) == -1) + err(1, "open(filemon.out)"); + + if (ioctl(fm_fd, FILEMON_SET_FD, &fm_log) == -1) + err(1, "Cannot set filemon log file descriptor"); + /* Set up these two fd's to close on exec. */ + (void)fcntl(fm_fd, F_SETFD, FD_CLOEXEC); + (void)fcntl(fm_log, F_SETFD, FD_CLOEXEC); + + if ((child = fork()) == 0) { + child = getpid(); + if (ioctl(fm_fd, FILEMON_SET_PID, &child) == -1) + err(1, "Cannot set filemon PID"); + /* Do something here. */ + return 0; + } else { + wait(&child); + close(fm_fd); + } + return 0; +} +.Ed +.Pp +Creates a file named +.Pa filemon.out +and configures the +.Nm +device to write the +.Nm +buffer contents to it. +.Sh SEE ALSO +.Xr dtrace 1 , +.Xr ktrace 1 , +.Xr truss 1 +.Sh HISTORY +A +.Nm +device appeared in +.Fx 9.1 . Modified: stable/8/sys/modules/Makefile ============================================================================== --- stable/8/sys/modules/Makefile Wed Sep 19 19:59:15 2012 (r240706) +++ stable/8/sys/modules/Makefile Wed Sep 19 20:11:47 2012 (r240707) @@ -2,7 +2,8 @@ .include -SUBDIR= ${_3dfx} \ +SUBDIR= \ + ${_3dfx} \ ${_3dfx_linux} \ ${_aac} \ accf_data \ @@ -96,6 +97,7 @@ SUBDIR= ${_3dfx} \ fdc \ fdescfs \ ${_fe} \ + ${_filemon} \ firewire \ firmware \ fxp \ @@ -336,6 +338,10 @@ SUBDIR= ${_3dfx} \ ${_zfs} \ zlib \ +.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64" +_filemon= filemon +.endif + .if ${MACHINE_ARCH} != "powerpc" && ${MACHINE_ARCH} != "arm" && \ ${MACHINE_ARCH} != "mips" _syscons= syscons From owner-svn-src-all@FreeBSD.ORG Wed Sep 19 20:42:56 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 98A821065677; Wed, 19 Sep 2012 20:42:56 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 83D0B8FC1A; Wed, 19 Sep 2012 20:42:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8JKgu2K066748; Wed, 19 Sep 2012 20:42:56 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8JKguJi066746; Wed, 19 Sep 2012 20:42:56 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201209192042.q8JKguJi066746@svn.freebsd.org> From: "David E. O'Brien" Date: Wed, 19 Sep 2012 20:42:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240708 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Sep 2012 20:42:56 -0000 Author: obrien Date: Wed Sep 19 20:42:55 2012 New Revision: 240708 URL: http://svn.freebsd.org/changeset/base/240708 Log: Add Intel RdRand. Modified: head/share/man/man4/random.4 Modified: head/share/man/man4/random.4 ============================================================================== --- head/share/man/man4/random.4 Wed Sep 19 20:11:47 2012 (r240707) +++ head/share/man/man4/random.4 Wed Sep 19 20:42:55 2012 (r240708) @@ -315,11 +315,16 @@ and is an implementation of the .Em Yarrow algorithm by Bruce Schneier, .Em et al . -The only hardware implementation -currently is for the +The only hardware implementations +currently are for the .Tn VIA C3 Nehemiah (stepping 3 or greater) -CPU. +CPU +and the +.Tn Intel +.Dq Bull Mountain +.Em RdRand +instruction and underlying random number generator (RNG). More will be added in the future. .Pp The author gratefully acknowledges From owner-svn-src-all@FreeBSD.ORG Wed Sep 19 21:44:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 40E25106564A; Wed, 19 Sep 2012 21:44:40 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2745C8FC14; Wed, 19 Sep 2012 21:44:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8JLid1P076820; Wed, 19 Sep 2012 21:44:40 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8JLid7h076793; Wed, 19 Sep 2012 21:44:39 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201209192144.q8JLid7h076793@svn.freebsd.org> From: Glen Barber Date: Wed, 19 Sep 2012 21:44:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240710 - in releng/9.1/release/doc: de_DE.ISO8859-1/early-adopter de_DE.ISO8859-1/errata de_DE.ISO8859-1/hardware/alpha de_DE.ISO8859-1/hardware/i386 de_DE.ISO8859-1/hardware/ia64 de_D... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Sep 2012 21:44:40 -0000 Author: gjb (doc,ports committer) Date: Wed Sep 19 21:44:39 2012 New Revision: 240710 URL: http://svn.freebsd.org/changeset/base/240710 Log: - Fix release notes build on releng/9.1 [1] - MFC r240508, r240516, r240519 (gabor): o Update releng/9.1/release/doc files post-XML conversion. o This commit fixes most of the 9-STABLE release build problems. - Close colspec tags to conform to XML standards. [1] - Convert installation article to XML stanards. [1] [1] - These are direct commits to releng/9.1 Approved by: re (hrs) Modified: releng/9.1/release/doc/de_DE.ISO8859-1/early-adopter/article.sgml releng/9.1/release/doc/de_DE.ISO8859-1/errata/article.sgml releng/9.1/release/doc/de_DE.ISO8859-1/hardware/alpha/article.sgml releng/9.1/release/doc/de_DE.ISO8859-1/hardware/i386/article.sgml releng/9.1/release/doc/de_DE.ISO8859-1/hardware/ia64/article.sgml releng/9.1/release/doc/de_DE.ISO8859-1/hardware/pc98/article.sgml releng/9.1/release/doc/de_DE.ISO8859-1/hardware/sparc64/article.sgml releng/9.1/release/doc/de_DE.ISO8859-1/installation/alpha/article.sgml releng/9.1/release/doc/de_DE.ISO8859-1/installation/common/install.sgml releng/9.1/release/doc/de_DE.ISO8859-1/installation/common/layout.sgml releng/9.1/release/doc/de_DE.ISO8859-1/installation/i386/article.sgml releng/9.1/release/doc/de_DE.ISO8859-1/installation/ia64/article.sgml releng/9.1/release/doc/de_DE.ISO8859-1/installation/pc98/article.sgml releng/9.1/release/doc/de_DE.ISO8859-1/installation/sparc64/article.sgml releng/9.1/release/doc/de_DE.ISO8859-1/readme/article.sgml releng/9.1/release/doc/de_DE.ISO8859-1/relnotes/alpha/article.sgml releng/9.1/release/doc/de_DE.ISO8859-1/relnotes/i386/article.sgml releng/9.1/release/doc/de_DE.ISO8859-1/relnotes/ia64/article.sgml releng/9.1/release/doc/de_DE.ISO8859-1/relnotes/pc98/article.sgml releng/9.1/release/doc/de_DE.ISO8859-1/relnotes/sparc64/article.sgml releng/9.1/release/doc/en_US.ISO8859-1/errata/article.sgml releng/9.1/release/doc/en_US.ISO8859-1/hardware/article.sgml releng/9.1/release/doc/en_US.ISO8859-1/installation/article.sgml releng/9.1/release/doc/en_US.ISO8859-1/readme/article.sgml releng/9.1/release/doc/en_US.ISO8859-1/relnotes/article.sgml releng/9.1/release/doc/fr_FR.ISO8859-1/early-adopter/article.sgml releng/9.1/release/doc/fr_FR.ISO8859-1/errata/article.sgml releng/9.1/release/doc/fr_FR.ISO8859-1/hardware/alpha/article.sgml releng/9.1/release/doc/fr_FR.ISO8859-1/hardware/common/dev.sgml releng/9.1/release/doc/fr_FR.ISO8859-1/hardware/i386/article.sgml releng/9.1/release/doc/fr_FR.ISO8859-1/hardware/ia64/article.sgml releng/9.1/release/doc/fr_FR.ISO8859-1/hardware/pc98/article.sgml releng/9.1/release/doc/fr_FR.ISO8859-1/hardware/sparc64/article.sgml releng/9.1/release/doc/fr_FR.ISO8859-1/installation/alpha/article.sgml releng/9.1/release/doc/fr_FR.ISO8859-1/installation/common/install.sgml releng/9.1/release/doc/fr_FR.ISO8859-1/installation/common/layout.sgml releng/9.1/release/doc/fr_FR.ISO8859-1/installation/common/trouble.sgml releng/9.1/release/doc/fr_FR.ISO8859-1/installation/common/upgrade.sgml releng/9.1/release/doc/fr_FR.ISO8859-1/installation/i386/article.sgml releng/9.1/release/doc/fr_FR.ISO8859-1/installation/pc98/article.sgml releng/9.1/release/doc/fr_FR.ISO8859-1/installation/sparc64/article.sgml releng/9.1/release/doc/fr_FR.ISO8859-1/installation/sparc64/install.sgml releng/9.1/release/doc/fr_FR.ISO8859-1/relnotes/alpha/article.sgml releng/9.1/release/doc/fr_FR.ISO8859-1/relnotes/common/new.sgml releng/9.1/release/doc/fr_FR.ISO8859-1/relnotes/i386/article.sgml Directory Properties: releng/9.1/release/ (props changed) releng/9.1/release/doc/en_US.ISO8859-1/hardware/ (props changed) Modified: releng/9.1/release/doc/de_DE.ISO8859-1/early-adopter/article.sgml ============================================================================== --- releng/9.1/release/doc/de_DE.ISO8859-1/early-adopter/article.sgml Wed Sep 19 20:43:23 2012 (r240709) +++ releng/9.1/release/doc/de_DE.ISO8859-1/early-adopter/article.sgml Wed Sep 19 21:44:39 2012 (r240710) @@ -1,3 +1,14 @@ + + +%entities; + +%release; + +X"> +X"> +]> + - -%man; - - -%freebsd; - - -%authors; - - -%teams; - - -%mailing-lists; - - -%release; - -X"> -X"> - -]> -
Hinweise für die ersten Anwender von &os; Modified: releng/9.1/release/doc/de_DE.ISO8859-1/errata/article.sgml ============================================================================== --- releng/9.1/release/doc/de_DE.ISO8859-1/errata/article.sgml Wed Sep 19 20:43:23 2012 (r240709) +++ releng/9.1/release/doc/de_DE.ISO8859-1/errata/article.sgml Wed Sep 19 21:44:39 2012 (r240710) @@ -1,3 +1,11 @@ +<?xml version="1.0" encoding="iso-8859-1" standalone="no"?> +<!DOCTYPE article PUBLIC "-//FreeBSD//DTD DocBook XML V4.2-Based Extension//EN" [ +<!ENTITY % entities PUBLIC "-//FreeBSD//ENTITIES DocBook FreeBSD Entity Set//DE"> +%entities; +<!ENTITY % release PUBLIC "-//FreeBSD//ENTITIES Release Specification//EN"> +%release; +]> + <!-- FreeBSD errata document. Unlike some of the other RELNOTESng files, this file should remain as a single SGML file, so that @@ -12,19 +20,6 @@ basiert auf: 1.38 --> -<!DOCTYPE ARTICLE PUBLIC "-//FreeBSD//DTD DocBook V4.1-Based Extension//EN" [ -<!ENTITY % man PUBLIC "-//FreeBSD//ENTITIES DocBook Manual Page Entities//EN"> -%man; -<!ENTITY % authors PUBLIC "-//FreeBSD//ENTITIES DocBook Author Entities//EN"> -%authors; -<!ENTITY % translators PUBLIC "-//FreeBSD//ENTITIES DocBook Translator Entities//DE"> -%translators; -<!ENTITY % mlists PUBLIC "-//FreeBSD//ENTITIES DocBook Mailing List Entities//DE"> -%mlists; -<!ENTITY % release PUBLIC "-//FreeBSD//ENTITIES Release Specification//EN"> -%release; -]> - <article lang="de"> <articleinfo> Modified: releng/9.1/release/doc/de_DE.ISO8859-1/hardware/alpha/article.sgml ============================================================================== --- releng/9.1/release/doc/de_DE.ISO8859-1/hardware/alpha/article.sgml Wed Sep 19 20:43:23 2012 (r240709) +++ releng/9.1/release/doc/de_DE.ISO8859-1/hardware/alpha/article.sgml Wed Sep 19 21:44:39 2012 (r240710) @@ -1,29 +1,23 @@ -<!-- - $FreeBSD$ - $FreeBSDde: de-docproj/relnotes/de_DE.ISO8859-1/hardware/alpha/article.sgml,v 1.5 2002/10/12 18:02:21 ue Exp $ - basiert auf: 1.4 ---> - -<!DOCTYPE article PUBLIC "-//FreeBSD//DTD DocBook V4.1-Based Extension//EN" [ -<!ENTITY % man PUBLIC "-//FreeBSD//ENTITIES DocBook Manual Page Entities//EN"> -%man; -<!ENTITY % authors PUBLIC "-//FreeBSD//ENTITIES DocBook Author Entities//EN"> -%authors; -<!ENTITY % translators PUBLIC "-//FreeBSD//ENTITIES DocBook Translator Entities//DE"> -%translators; -<!ENTITY % mlists PUBLIC "-//FreeBSD//ENTITIES DocBook Mailing List Entities//DE"> -%mlists; +<?xml version="1.0" encoding="iso-8859-1" standalone="no"?> +<!DOCTYPE article PUBLIC "-//FreeBSD//DTD DocBook XML V4.2-Based Extension//EN" [ +<!ENTITY % entities PUBLIC "-//FreeBSD//ENTITIES DocBook FreeBSD Entity Set//DE"> +%entities; <!ENTITY % release PUBLIC "-//FreeBSD//ENTITIES Release Specification//EN"> %release; -<!ENTITY % sections SYSTEM "../common/hw.ent"> %sections; +<!ENTITY % sections SYSTEM "../common/hw.ent"> %sections <!-- Architecture-specific customization --> <!ENTITY arch "alpha"> <!ENTITY arch.print "Alpha/AXP"> - ]> +<!-- + $FreeBSD$ + $FreeBSDde: de-docproj/relnotes/de_DE.ISO8859-1/hardware/alpha/article.sgml,v 1.5 2002/10/12 18:02:21 ue Exp $ + basiert auf: 1.4 +--> + <article lang="de"> &artheader; §.intro; Modified: releng/9.1/release/doc/de_DE.ISO8859-1/hardware/i386/article.sgml ============================================================================== --- releng/9.1/release/doc/de_DE.ISO8859-1/hardware/i386/article.sgml Wed Sep 19 20:43:23 2012 (r240709) +++ releng/9.1/release/doc/de_DE.ISO8859-1/hardware/i386/article.sgml Wed Sep 19 21:44:39 2012 (r240710) @@ -1,27 +1,23 @@ -<!-- - $FreeBSD$ - $FreeBSDde: de-docproj/relnotes/de_DE.ISO8859-1/hardware/i386/article.sgml,v 1.5 2002/12/07 21:09:09 ue Exp $ - basiert auf: 1.4 ---> - -<!DOCTYPE article PUBLIC "-//FreeBSD//DTD DocBook V4.1-Based Extension//EN" [ -<!ENTITY % man PUBLIC "-//FreeBSD//ENTITIES DocBook Manual Page Entities//EN"> -%man; -<!ENTITY % authors PUBLIC "-//FreeBSD//ENTITIES DocBook Author Entities//EN"> -%authors; -<!ENTITY % mlists PUBLIC "-//FreeBSD//ENTITIES DocBook Mailing List Entities//DE"> -%mlists; +<?xml version="1.0" encoding="iso-8859-1" standalone="no"?> +<!DOCTYPE article PUBLIC "-//FreeBSD//DTD DocBook XML V4.2-Based Extension//EN" [ +<!ENTITY % entities PUBLIC "-//FreeBSD//ENTITIES DocBook FreeBSD Entity Set//DE"> +%entities; <!ENTITY % release PUBLIC "-//FreeBSD//ENTITIES Release Specification//EN"> %release; -<!ENTITY % sections SYSTEM "../common/hw.ent"> %sections; +<!ENTITY % sections SYSTEM "../common/hw.ent"> %sections <!-- Architecture-specific customization --> <!ENTITY arch "i386"> <!ENTITY arch.print "i386"> - ]> +<!-- + $FreeBSD$ + $FreeBSDde: de-docproj/relnotes/de_DE.ISO8859-1/hardware/i386/article.sgml,v 1.5 2002/12/07 21:09:09 ue Exp $ + basiert auf: 1.4 +--> + <article lang="de"> &artheader; §.intro; Modified: releng/9.1/release/doc/de_DE.ISO8859-1/hardware/ia64/article.sgml ============================================================================== --- releng/9.1/release/doc/de_DE.ISO8859-1/hardware/ia64/article.sgml Wed Sep 19 20:43:23 2012 (r240709) +++ releng/9.1/release/doc/de_DE.ISO8859-1/hardware/ia64/article.sgml Wed Sep 19 21:44:39 2012 (r240710) @@ -1,27 +1,23 @@ -<!-- - $FreeBSD$ - $FreeBSDde: de-docproj/relnotes/de_DE.ISO8859-1/hardware/ia64/article.sgml,v 1.6 2003/05/24 21:52:46 ue Exp $ - basiert auf: 1.3 ---> - -<!DOCTYPE article PUBLIC "-//FreeBSD//DTD DocBook V4.1-Based Extension//EN" [ -<!ENTITY % man PUBLIC "-//FreeBSD//ENTITIES DocBook Manual Page Entities//EN"> -%man; -<!ENTITY % authors PUBLIC "-//FreeBSD//ENTITIES DocBook Author Entities//EN"> -%authors; -<!ENTITY % mlists PUBLIC "-//FreeBSD//ENTITIES DocBook Mailing List Entities//DE"> -%mlists; +<?xml version="1.0" encoding="iso-8859-1" standalone="no"?> +<!DOCTYPE article PUBLIC "-//FreeBSD//DTD DocBook XML V4.2-Based Extension//EN" [ +<!ENTITY % entities PUBLIC "-//FreeBSD//ENTITIES DocBook FreeBSD Entity Set//DE"> +%entities; <!ENTITY % release PUBLIC "-//FreeBSD//ENTITIES Release Specification//EN"> %release; -<!ENTITY % sections SYSTEM "../common/hw.ent"> %sections; +<!ENTITY % sections SYSTEM "../common/hw.ent"> %sections <!-- Architecture-specific customization --> <!ENTITY arch "ia64"> <!ENTITY arch.print "IA-64"> - ]> +<!-- + $FreeBSD$ + $FreeBSDde: de-docproj/relnotes/de_DE.ISO8859-1/hardware/ia64/article.sgml,v 1.6 2003/05/24 21:52:46 ue Exp $ + basiert auf: 1.3 +--> + <article lang="de"> &artheader; Modified: releng/9.1/release/doc/de_DE.ISO8859-1/hardware/pc98/article.sgml ============================================================================== --- releng/9.1/release/doc/de_DE.ISO8859-1/hardware/pc98/article.sgml Wed Sep 19 20:43:23 2012 (r240709) +++ releng/9.1/release/doc/de_DE.ISO8859-1/hardware/pc98/article.sgml Wed Sep 19 21:44:39 2012 (r240710) @@ -1,27 +1,23 @@ -<!-- - $FreeBSD$ - $FreeBSDde: de-docproj/relnotes/de_DE.ISO8859-1/hardware/pc98/article.sgml,v 1.2 2002/10/12 18:02:22 ue Exp $ - basiert auf: 1.1 ---> - -<!DOCTYPE article PUBLIC "-//FreeBSD//DTD DocBook V4.1-Based Extension//EN" [ -<!ENTITY % man PUBLIC "-//FreeBSD//ENTITIES DocBook Manual Page Entities//EN"> -%man; -<!ENTITY % authors PUBLIC "-//FreeBSD//ENTITIES DocBook Author Entities//EN"> -%authors; -<!ENTITY % mlists PUBLIC "-//FreeBSD//ENTITIES DocBook Mailing List Entities//DE"> -%mlists; +<?xml version="1.0" encoding="iso-8859-1" standalone="no"?> +<!DOCTYPE article PUBLIC "-//FreeBSD//DTD DocBook XML V4.2-Based Extension//EN" [ +<!ENTITY % entities PUBLIC "-//FreeBSD//ENTITIES DocBook FreeBSD Entity Set//DE"> +%entities; <!ENTITY % release PUBLIC "-//FreeBSD//ENTITIES Release Specification//EN"> %release; -<!ENTITY % sections SYSTEM "../common/hw.ent"> %sections; +<!ENTITY % sections SYSTEM "../common/hw.ent"> %sections <!-- Architecture-specific customization --> <!ENTITY arch "pc98"> <!ENTITY arch.print "NEC PC-98x1"> - ]> +<!-- + $FreeBSD$ + $FreeBSDde: de-docproj/relnotes/de_DE.ISO8859-1/hardware/pc98/article.sgml,v 1.2 2002/10/12 18:02:22 ue Exp $ + basiert auf: 1.1 +--> + <article lang="de"> &artheader; §.intro; Modified: releng/9.1/release/doc/de_DE.ISO8859-1/hardware/sparc64/article.sgml ============================================================================== --- releng/9.1/release/doc/de_DE.ISO8859-1/hardware/sparc64/article.sgml Wed Sep 19 20:43:23 2012 (r240709) +++ releng/9.1/release/doc/de_DE.ISO8859-1/hardware/sparc64/article.sgml Wed Sep 19 21:44:39 2012 (r240710) @@ -1,19 +1,10 @@ -<!-- - $FreeBSD$ - $FreeBSDde: de-docproj/relnotes/de_DE.ISO8859-1/hardware/sparc64/article.sgml,v 1.7 2003/01/09 12:46:28 ue Exp $ - basiert auf: 1.3 ---> - -<!DOCTYPE article PUBLIC "-//FreeBSD//DTD DocBook V4.1-Based Extension//EN" [ -<!ENTITY % man PUBLIC "-//FreeBSD//ENTITIES DocBook Manual Page Entities//EN"> -%man; -<!ENTITY % authors PUBLIC "-//FreeBSD//ENTITIES DocBook Author Entities//EN"> -%authors; -<!ENTITY % mlists PUBLIC "-//FreeBSD//ENTITIES DocBook Mailing List Entities//DE"> -%mlists; +<?xml version="1.0" encoding="iso-8859-1" standalone="no"?> +<!DOCTYPE article PUBLIC "-//FreeBSD//DTD DocBook XML V4.2-Based Extension//EN" [ +<!ENTITY % entities PUBLIC "-//FreeBSD//ENTITIES DocBook FreeBSD Entity Set//DE"> +%entities; <!ENTITY % release PUBLIC "-//FreeBSD//ENTITIES Release Specification//EN"> %release; -<!ENTITY % sections SYSTEM "../common/hw.ent"> %sections; +<!ENTITY % sections SYSTEM "../common/hw.ent"> %sections <!-- Architecture-specific customization --> @@ -21,6 +12,12 @@ <!ENTITY arch.print "UltraSPARC"> ]> +<!-- + $FreeBSD$ + $FreeBSDde: de-docproj/relnotes/de_DE.ISO8859-1/hardware/sparc64/article.sgml,v 1.7 2003/01/09 12:46:28 ue Exp $ + basiert auf: 1.3 +--> + <article lang="de"> &artheader; §.intro; Modified: releng/9.1/release/doc/de_DE.ISO8859-1/installation/alpha/article.sgml ============================================================================== --- releng/9.1/release/doc/de_DE.ISO8859-1/installation/alpha/article.sgml Wed Sep 19 20:43:23 2012 (r240709) +++ releng/9.1/release/doc/de_DE.ISO8859-1/installation/alpha/article.sgml Wed Sep 19 21:44:39 2012 (r240710) @@ -1,16 +1,7 @@ -<!-- - $FreeBSD$ - $FreeBSDde: de-docproj/relnotes/de_DE.ISO8859-1/installation/alpha/article.sgml,v 1.4 2002/10/12 18:02:23 ue Exp $ - basiert auf: 1.3 ---> - -<!DOCTYPE article PUBLIC "-//FreeBSD//DTD DocBook V4.1-Based Extension//EN" [ -<!ENTITY % man PUBLIC "-//FreeBSD//ENTITIES DocBook Manual Page Entities//EN"> -%man; -<!ENTITY % authors PUBLIC "-//FreeBSD//ENTITIES DocBook Author Entities//EN"> -%authors; -<!ENTITY % mlists PUBLIC "-//FreeBSD//ENTITIES DocBook Mailing List Entities//DE"> -%mlists; +<?xml version="1.0" encoding="iso-8859-1" standalone="no"?> +<!DOCTYPE article PUBLIC "-//FreeBSD//DTD DocBook XML V4.2-Based Extension//EN" [ +<!ENTITY % entities PUBLIC "-//FreeBSD//ENTITIES DocBook FreeBSD Entity Set//DE"> +%entities; <!ENTITY % release PUBLIC "-//FreeBSD//ENTITIES Release Specification//EN"> %release; <!ENTITY % sections SYSTEM "../common/install.ent"> %sections; @@ -21,6 +12,12 @@ <!ENTITY arch.print "Alpha/AXP"> ]> +<!-- + $FreeBSD$ + $FreeBSDde: de-docproj/relnotes/de_DE.ISO8859-1/installation/alpha/article.sgml,v 1.4 2002/10/12 18:02:23 ue Exp $ + basiert auf: 1.3 +--> + <article lang="de"> &artheader; &abstract; Modified: releng/9.1/release/doc/de_DE.ISO8859-1/installation/common/install.sgml ============================================================================== --- releng/9.1/release/doc/de_DE.ISO8859-1/installation/common/install.sgml Wed Sep 19 20:43:23 2012 (r240709) +++ releng/9.1/release/doc/de_DE.ISO8859-1/installation/common/install.sgml Wed Sep 19 21:44:39 2012 (r240710) @@ -26,7 +26,7 @@ from {alpha,i386}/INSTALL.TXT. ausführlichen, bebilderten Installationsleitung.</para> <para>Wenn Sie eine ältere Version von &os; aktualisieren - wollen, sollten Sie <xref linkend="upgrading">, Aktualisierung von + wollen, sollten Sie <xref linkend="upgrading"/>, Aktualisierung von FreeBSD, lesen.</para> <sect2 id="getting-started"> @@ -60,7 +60,7 @@ from {alpha,i386}/INSTALL.TXT. <para>Irgend etwas kann immer schiefgehen und wenn Ihnen das passiert, sollten Sie einen Blick in <xref - linkend="trouble"> werfen, wo Sie hilfreiche Informationen + linkend="trouble"/> werfen, wo Sie hilfreiche Informationen finden können. Sie sollten ebenfalls einen Blick auf die aktuelle Version von <filename>ERRATA.TXT</filename> werfen, bevor Sie mit der Installation beginnen, da Sie dort @@ -76,6 +76,7 @@ from {alpha,i386}/INSTALL.TXT. Backup haben, bevor Sie die Installation durchführen.</para> </important> + </sect2> <sect2> <title>Hardware-Anforderungen @@ -286,7 +287,7 @@ from {alpha,i386}/INSTALL.TXT. benutzen, können Sie das Script makeflp.bat verwenden. Weitere Informationen zu diesem Thema finden Sie im Kapitel . Danach müssen Sie nur noch von + linkend="floppies"/>. Danach müssen Sie nur noch von der ersten Diskette booten, um die &os;-Installation zu starten. @@ -306,7 +307,7 @@ from {alpha,i386}/INSTALL.TXT. benutzen, können Sie das Script makeflp.bat verwenden. Weitere Informationen zu diesem Thema finden Sie im Kapitel . Danach müssen Sie nur noch von + linkend="floppies"/>. Danach müssen Sie nur noch von der ersten Diskette booten, um die &os;-Installation zu starten. @@ -320,12 +321,12 @@ from {alpha,i386}/INSTALL.TXT. müssen Sie ebenfalls die beiden &os; Bootdisketten aus den Dateien floppies/kern.flp und floppies/mfsroot.flp erzeugen, wie in - beschrieben. Booten Sie Ihren + beschrieben. Booten Sie Ihren Rechner von der Diskette mit kern.flp; und legen Sie die Diskette mit mfsroot.flp ein, sobald Sie dazu aufgefordert werden. Weitere Informationen zu dieser Art der Installation finden Sie in . + linkend="ftpnfs"/>. Wenn Ihr Rechner kein CDROM Laufwerk hat, können Sie &os; auch direkt über das Internet @@ -334,12 +335,12 @@ from {alpha,i386}/INSTALL.TXT. Bootdisketten aus den Dateien floppies/kern.flp und floppies/mfsroot.flp erzeugen, wie in beschrieben. Booten Sie Ihren Rechner von + linkend="floppies"/> beschrieben. Booten Sie Ihren Rechner von der Diskette mit kern.flp; und legen Sie die Diskette mit mfsroot.flp ein, sobald Sie dazu aufgefordert werden. Weitere Informationen zu dieser Art der Installation finden Sie in . + linkend="ftpnfs"/>. @@ -358,7 +359,7 @@ from {alpha,i386}/INSTALL.TXT. Bootdisketten aus den Dateien floppies/kern.flp und floppies/mfsroot.flp erzeugen, wie in - beschrieben. Legen Sie die + beschrieben. Legen Sie die Diskette mit dem Inhalt von kern.flp ein und geben Sie an der Eingabeaufforderung des SRM (>>>) den folgenden Befehl ein, um @@ -400,8 +401,8 @@ Ethernet address 0:3:ba:b:92:d4, Host ID - - + + ok @@ -506,7 +507,7 @@ pqb0.0.1.4.0 PQB0 Wenn Sie von einem lokalen CDROM installieren wollen, sollten Sie nicht dieses Kapitel lesen, sondern - . Wenn in Ihrem System + . Wenn in Ihrem System kein CDROM vorhanden ist und Sie eine &os; CD benutzen wollen, die in einem CDROM Laufwerk eines anderen Systems liegt und Sie dieses System über ein Netzwerk erreichen @@ -580,10 +581,10 @@ pqb0.0.1.4.0 PQB0 Installation vorbereiten. Der erste Schritt ist die Erstellung der Bootdisketten, - wie in beschrieben. + wie in beschrieben. Der zweite Schritt ist, einen Blick in zu werfen. Das Kapitel Distribution + linkend="layout"/> zu werfen. Das Kapitel Distribution Format ist besonders wichtig, da Sie hier erfahren, welche Dateien Sie auf Diskette übertragen müssen und welche Sie ignorieren können. @@ -733,14 +734,14 @@ pqb0.0.1.4.0 PQB0 Der letzte Schritt ist die Erzeugung der Bootdisketten, - siehe . + siehe . Netzwerk-Installation mit FTP oder NFS Wenn Sie die Bootdisketten erzeugt haben, wie in beschrieben, können Sie die restliche + linkend="floppies"/> beschrieben, können Sie die restliche Installation über eine Netzwerk-Verbindung durchführen, wobei drei Arten von Netzwerkverbindungen unterstützt werden: seriell, parallel, oder @@ -981,7 +982,7 @@ pqb0.0.1.4.0 PQB0 Wenn Sie keine Meldungen auf Ihrer seriellen Konsole sehen, müssen Sie die Tastatur wieder einstecken und auf ein Tonsignal warten. Wenn Sie von CD booten, machen - Sie bei weiter, wenn Sie das + Sie bei weiter, wenn Sie das Tonsignal hören.. Modified: releng/9.1/release/doc/de_DE.ISO8859-1/installation/common/layout.sgml ============================================================================== --- releng/9.1/release/doc/de_DE.ISO8859-1/installation/common/layout.sgml Wed Sep 19 20:43:23 2012 (r240709) +++ releng/9.1/release/doc/de_DE.ISO8859-1/installation/common/layout.sgml Wed Sep 19 21:44:39 2012 (r240710) @@ -23,7 +23,7 @@ README.HTM cdrom.inf crypto Wenn Sie dieses Verzeichnis für eine CD-, FTP- oder NFS-Installation nutzen wollen, brauchen Sie nur die beiden 1.44 MByte großen Bootdisketten zu erstellen (wie das geht, ist - in beschrieben), von diesen zu booten, + in beschrieben), von diesen zu booten, und dann den Anweisungen zu folgen. Alle anderen Dateien, die für die Installation notwendig sind, werden auf der Grundlage Ihrer Angaben automatisch geholt. Wenn Sie &os; noch nie @@ -86,7 +86,7 @@ README.HTM cdrom.inf crypto Das Verzeichnis floppies/ enthält die Images der Bootdisketten. Informationen, wie man diese Images benutzt, finden Sie in . + linkend="floppies"/>. Modified: releng/9.1/release/doc/de_DE.ISO8859-1/installation/i386/article.sgml ============================================================================== --- releng/9.1/release/doc/de_DE.ISO8859-1/installation/i386/article.sgml Wed Sep 19 20:43:23 2012 (r240709) +++ releng/9.1/release/doc/de_DE.ISO8859-1/installation/i386/article.sgml Wed Sep 19 21:44:39 2012 (r240710) @@ -1,16 +1,7 @@ - - - -%man; - -%authors; - -%mlists; + + +%entities; %release; %sections; @@ -19,9 +10,14 @@ - ]> + +
&artheader; &abstract; Modified: releng/9.1/release/doc/de_DE.ISO8859-1/installation/ia64/article.sgml ============================================================================== --- releng/9.1/release/doc/de_DE.ISO8859-1/installation/ia64/article.sgml Wed Sep 19 20:43:23 2012 (r240709) +++ releng/9.1/release/doc/de_DE.ISO8859-1/installation/ia64/article.sgml Wed Sep 19 21:44:39 2012 (r240710) @@ -1,17 +1,7 @@ - - - - -%man; - -%authors; - -%mlists; + + +%entities; %release; %sections; @@ -20,9 +10,14 @@ - ]> + +
&artheader; &abstract; Modified: releng/9.1/release/doc/de_DE.ISO8859-1/installation/pc98/article.sgml ============================================================================== --- releng/9.1/release/doc/de_DE.ISO8859-1/installation/pc98/article.sgml Wed Sep 19 20:43:23 2012 (r240709) +++ releng/9.1/release/doc/de_DE.ISO8859-1/installation/pc98/article.sgml Wed Sep 19 21:44:39 2012 (r240710) @@ -1,16 +1,7 @@ - - - -%man; - -%authors; - -%mlists; + + +%entities; %release; %sections; @@ -19,9 +10,14 @@ - ]> + +
&artheader; &abstract; Modified: releng/9.1/release/doc/de_DE.ISO8859-1/installation/sparc64/article.sgml ============================================================================== --- releng/9.1/release/doc/de_DE.ISO8859-1/installation/sparc64/article.sgml Wed Sep 19 20:43:23 2012 (r240709) +++ releng/9.1/release/doc/de_DE.ISO8859-1/installation/sparc64/article.sgml Wed Sep 19 21:44:39 2012 (r240710) @@ -1,19 +1,8 @@ - - - + +%entities; - - -%man; - -%authors; - -%mlists; %release; %sections; @@ -24,6 +13,12 @@ ]> + +
&artheader; &abstract; Modified: releng/9.1/release/doc/de_DE.ISO8859-1/readme/article.sgml ============================================================================== --- releng/9.1/release/doc/de_DE.ISO8859-1/readme/article.sgml Wed Sep 19 20:43:23 2012 (r240709) +++ releng/9.1/release/doc/de_DE.ISO8859-1/readme/article.sgml Wed Sep 19 21:44:39 2012 (r240710) @@ -1,3 +1,11 @@ + + +%entities; + +%release; +]> + - -%man; - -%authors; - -%mlists; - -%release; - -%misc; -]> -
&os; &release.current; README @@ -229,7 +224,7 @@ wenn Sie an weiteren Informationen zu diesem Thema interessiert sind. Zusätzliche Informationen zu diesem Thema finden Sie im Artikel Mirroring + url="http://www.FreeBSD.org/doc/en_US.ISO8859-1/articles/hubs/">Mirroring FreeBSD. Sie finden die für den Start der Installation Modified: releng/9.1/release/doc/de_DE.ISO8859-1/relnotes/alpha/article.sgml ============================================================================== --- releng/9.1/release/doc/de_DE.ISO8859-1/relnotes/alpha/article.sgml Wed Sep 19 20:43:23 2012 (r240709) +++ releng/9.1/release/doc/de_DE.ISO8859-1/relnotes/alpha/article.sgml Wed Sep 19 21:44:39 2012 (r240710) @@ -1,16 +1,7 @@ - - - -%man; - -%authors; - -%mlists; + + +%entities; %release; %sections; @@ -19,9 +10,14 @@ - ]> + +
&art;
Modified: releng/9.1/release/doc/de_DE.ISO8859-1/relnotes/i386/article.sgml ============================================================================== --- releng/9.1/release/doc/de_DE.ISO8859-1/relnotes/i386/article.sgml Wed Sep 19 20:43:23 2012 (r240709) +++ releng/9.1/release/doc/de_DE.ISO8859-1/relnotes/i386/article.sgml Wed Sep 19 21:44:39 2012 (r240710) @@ -1,16 +1,7 @@ - - - -%man; - -%authors; - -%mlists; + + +%entities; %release; %sections; @@ -19,9 +10,15 @@ - ]> + + +
&art;
Modified: releng/9.1/release/doc/de_DE.ISO8859-1/relnotes/ia64/article.sgml ============================================================================== --- releng/9.1/release/doc/de_DE.ISO8859-1/relnotes/ia64/article.sgml Wed Sep 19 20:43:23 2012 (r240709) +++ releng/9.1/release/doc/de_DE.ISO8859-1/relnotes/ia64/article.sgml Wed Sep 19 21:44:39 2012 (r240710) @@ -1,16 +1,7 @@ - - - -%man; - -%authors; - -%mlists; + + +%entities; %release; %sections; @@ -19,8 +10,12 @@ - ]> +
&art; Modified: releng/9.1/release/doc/de_DE.ISO8859-1/relnotes/pc98/article.sgml ============================================================================== --- releng/9.1/release/doc/de_DE.ISO8859-1/relnotes/pc98/article.sgml Wed Sep 19 20:43:23 2012 (r240709) +++ releng/9.1/release/doc/de_DE.ISO8859-1/relnotes/pc98/article.sgml Wed Sep 19 21:44:39 2012 (r240710) @@ -1,16 +1,7 @@ - - - -%man; - -%authors; - -%mlists; + + +%entities; %release; %sections; @@ -19,9 +10,15 @@ - ]> + + +
&art;
Modified: releng/9.1/release/doc/de_DE.ISO8859-1/relnotes/sparc64/article.sgml ============================================================================== --- releng/9.1/release/doc/de_DE.ISO8859-1/relnotes/sparc64/article.sgml Wed Sep 19 20:43:23 2012 (r240709) +++ releng/9.1/release/doc/de_DE.ISO8859-1/relnotes/sparc64/article.sgml Wed Sep 19 21:44:39 2012 (r240710) @@ -1,19 +1,7 @@ - - - - - -%man; - -%authors; - -%mlists; + + +%entities; %release; %sections; @@ -22,9 +10,14 @@ - ]> + +
&art;
Modified: releng/9.1/release/doc/en_US.ISO8859-1/errata/article.sgml ============================================================================== --- releng/9.1/release/doc/en_US.ISO8859-1/errata/article.sgml Wed Sep 19 20:43:23 2012 (r240709) +++ releng/9.1/release/doc/en_US.ISO8859-1/errata/article.sgml Wed Sep 19 21:44:39 2012 (r240710) @@ -1,3 +1,22 @@ + + +%entities; + + +%release; + + +]]> + +]]> + +]]> +]> + - -%articles.ent; - - -%release; -]> -
- &os; -<![ %release.type.current [ - &release.current; -]]> -<![ %release.type.snapshot [ - &release.prev; -]]> -<![ %release.type.release [ - &release.current; -]]> - Errata + &os; &release; Errata The &os; Project @@ -131,9 +132,9 @@ - - - + + + Modified: releng/9.1/release/doc/en_US.ISO8859-1/hardware/article.sgml ============================================================================== --- releng/9.1/release/doc/en_US.ISO8859-1/hardware/article.sgml Wed Sep 19 20:43:23 2012 (r240709) +++ releng/9.1/release/doc/en_US.ISO8859-1/hardware/article.sgml Wed Sep 19 21:44:39 2012 (r240710) @@ -1,14 +1,12 @@ - -%articles.ent; + + +%entities; %release; %devauto; - - - ]>
Modified: releng/9.1/release/doc/en_US.ISO8859-1/installation/article.sgml ============================================================================== --- releng/9.1/release/doc/en_US.ISO8859-1/installation/article.sgml Wed Sep 19 20:43:23 2012 (r240709) +++ releng/9.1/release/doc/en_US.ISO8859-1/installation/article.sgml Wed Sep 19 21:44:39 2012 (r240710) @@ -1,9 +1,15 @@ - -%articles.ent; + + +%entities; %release; + + + + + ]>
Modified: releng/9.1/release/doc/en_US.ISO8859-1/readme/article.sgml ============================================================================== --- releng/9.1/release/doc/en_US.ISO8859-1/readme/article.sgml Wed Sep 19 20:43:23 2012 (r240709) +++ releng/9.1/release/doc/en_US.ISO8859-1/readme/article.sgml Wed Sep 19 21:44:39 2012 (r240710) @@ -1,6 +1,7 @@ - *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Sep 19 22:12:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 99023106564A; Wed, 19 Sep 2012 22:12:58 +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 805DD8FC16; Wed, 19 Sep 2012 22:12:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8JMCwLn081422; Wed, 19 Sep 2012 22:12:58 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8JMCwYi081417; Wed, 19 Sep 2012 22:12:58 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201209192212.q8JMCwYi081417@svn.freebsd.org> From: Xin LI Date: Wed, 19 Sep 2012 22:12:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240712 - in stable/9: share/man/man4 sys/dev/arcmsr X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Sep 2012 22:12:58 -0000 Author: delphij Date: Wed Sep 19 22:12:57 2012 New Revision: 240712 URL: http://svn.freebsd.org/changeset/base/240712 Log: MFC r240079: Update arcmsr(4) to vendor version 1.20.00.25. Many thanks to Areca for continuing to support FreeBSD. Submitted by: Ching-Lung Huang Modified: stable/9/share/man/man4/arcmsr.4 stable/9/sys/dev/arcmsr/arcmsr.c stable/9/sys/dev/arcmsr/arcmsr.h Directory Properties: stable/9/share/man/man4/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/share/man/man4/arcmsr.4 ============================================================================== --- stable/9/share/man/man4/arcmsr.4 Wed Sep 19 21:50:18 2012 (r240711) +++ stable/9/share/man/man4/arcmsr.4 Wed Sep 19 22:12:57 2012 (r240712) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 25, 2010 +.Dd September 3, 2012 .Dt ARCMSR 4 .Os .Sh NAME @@ -98,10 +98,14 @@ ARC-1210 .It ARC-1212 .It +ARC-1213 +.It ARC-1220 .It ARC-1222 .It +ARC-1223 +.It ARC-1230 .It ARC-1231 @@ -133,6 +137,8 @@ ARC-1680 ARC-1681 .It ARC-1880 +.It +ARC-1882 .El .Sh FILES .Bl -tag -width ".Pa /dev/arcmsr?" -compact Modified: stable/9/sys/dev/arcmsr/arcmsr.c ============================================================================== --- stable/9/sys/dev/arcmsr/arcmsr.c Wed Sep 19 21:50:18 2012 (r240711) +++ stable/9/sys/dev/arcmsr/arcmsr.c Wed Sep 19 22:12:57 2012 (r240712) @@ -37,38 +37,43 @@ ************************************************************************** ** History ** -** REV# DATE NAME DESCRIPTION -** 1.00.00.00 03/31/2004 Erich Chen First release -** 1.20.00.02 11/29/2004 Erich Chen bug fix with arcmsr_bus_reset when PHY error -** 1.20.00.03 04/19/2005 Erich Chen add SATA 24 Ports adapter type support +** REV# DATE NAME DESCRIPTION +** 1.00.00.00 03/31/2004 Erich Chen First release +** 1.20.00.02 11/29/2004 Erich Chen bug fix with arcmsr_bus_reset when PHY error +** 1.20.00.03 04/19/2005 Erich Chen add SATA 24 Ports adapter type support ** clean unused function -** 1.20.00.12 09/12/2005 Erich Chen bug fix with abort command handling, +** 1.20.00.12 09/12/2005 Erich Chen bug fix with abort command handling, ** firmware version check ** and firmware update notify for hardware bug fix ** handling if none zero high part physical address ** of srb resource -** 1.20.00.13 08/18/2006 Erich Chen remove pending srb and report busy +** 1.20.00.13 08/18/2006 Erich Chen remove pending srb and report busy ** add iop message xfer ** with scsi pass-through command ** add new device id of sas raid adapters ** code fit for SPARC64 & PPC -** 1.20.00.14 02/05/2007 Erich Chen bug fix for incorrect ccb_h.status report +** 1.20.00.14 02/05/2007 Erich Chen bug fix for incorrect ccb_h.status report ** and cause g_vfs_done() read write error -** 1.20.00.15 10/10/2007 Erich Chen support new RAID adapter type ARC120x -** 1.20.00.16 10/10/2009 Erich Chen Bug fix for RAID adapter type ARC120x +** 1.20.00.15 10/10/2007 Erich Chen support new RAID adapter type ARC120x +** 1.20.00.16 10/10/2009 Erich Chen Bug fix for RAID adapter type ARC120x ** bus_dmamem_alloc() with BUS_DMA_ZERO -** 1.20.00.17 07/15/2010 Ching Huang Added support ARC1880 -** report CAM_DEV_NOT_THERE instead of CAM_SEL_TIMEOUT when device failed, -** prevent cam_periph_error removing all LUN devices of one Target id -** for any one LUN device failed -** 1.20.00.18 10/14/2010 Ching Huang Fixed "inquiry data fails comparion at DV1 step" -** 10/25/2010 Ching Huang Fixed bad range input in bus_alloc_resource for ADAPTER_TYPE_B -** 1.20.00.19 11/11/2010 Ching Huang Fixed arcmsr driver prevent arcsas support for Areca SAS HBA ARC13x0 -** 1.20.00.20 12/08/2010 Ching Huang Avoid calling atomic_set_int function -** 1.20.00.21 02/08/2011 Ching Huang Implement I/O request timeout -** 02/14/2011 Ching Huang Modified pktRequestCount -** 1.20.00.21 03/03/2011 Ching Huang if a command timeout, then wait its ccb back before free it -** 1.20.00.22 07/04/2011 Ching Huang Fixed multiple MTX panic +** 1.20.00.17 07/15/2010 Ching Huang Added support ARC1880 +** report CAM_DEV_NOT_THERE instead of CAM_SEL_TIMEOUT when device failed, +** prevent cam_periph_error removing all LUN devices of one Target id +** for any one LUN device failed +** 1.20.00.18 10/14/2010 Ching Huang Fixed "inquiry data fails comparion at DV1 step" +** 10/25/2010 Ching Huang Fixed bad range input in bus_alloc_resource for ADAPTER_TYPE_B +** 1.20.00.19 11/11/2010 Ching Huang Fixed arcmsr driver prevent arcsas support for Areca SAS HBA ARC13x0 +** 1.20.00.20 12/08/2010 Ching Huang Avoid calling atomic_set_int function +** 1.20.00.21 02/08/2011 Ching Huang Implement I/O request timeout +** 02/14/2011 Ching Huang Modified pktRequestCount +** 1.20.00.21 03/03/2011 Ching Huang if a command timeout, then wait its ccb back before free it +** 1.20.00.22 07/04/2011 Ching Huang Fixed multiple MTX panic +** 1.20.00.23 10/28/2011 Ching Huang Added TIMEOUT_DELAY in case of too many HDDs need to start +** 1.20.00.23 11/08/2011 Ching Huang Added report device transfer speed +** 1.20.00.23 01/30/2012 Ching Huang Fixed Request requeued and Retrying command +** 1.20.00.24 06/11/2012 Ching Huang Fixed return sense data condition +** 1.20.00.25 08/17/2012 Ching Huang Fixed hotplug device no function on type A adapter ****************************************************************************************** */ @@ -154,7 +159,7 @@ __FBSDID("$FreeBSD$"); #define arcmsr_callout_init(a) callout_init(a); #endif -#define ARCMSR_DRIVER_VERSION "Driver Version 1.20.00.22 2011-07-04" +#define ARCMSR_DRIVER_VERSION "Driver Version 1.20.00.25 2012-08-17" #include #define SRB_SIZE ((sizeof(struct CommandControlBlock)+0x1f) & 0xffe0) #define ARCMSR_SRBS_POOL_SIZE (SRB_SIZE * ARCMSR_MAX_FREESRB_NUM) @@ -296,7 +301,7 @@ static struct cdevsw arcmsr_cdevsw = { if(acb==NULL) { return ENXIO; } - return 0; + return (0); } /* ************************************************************************** @@ -347,7 +352,7 @@ static struct cdevsw arcmsr_cdevsw = { if(acb==NULL) { return ENXIO; } - return(arcmsr_iop_ioctlcmd(acb, ioctl_cmd, arg)); + return (arcmsr_iop_ioctlcmd(acb, ioctl_cmd, arg)); } /* ********************************************************************** @@ -378,7 +383,7 @@ static u_int32_t arcmsr_disable_allintr( } break; } - return(intmask_org); + return (intmask_org); } /* ********************************************************************** @@ -411,7 +416,6 @@ static void arcmsr_enable_allintr( struc } break; } - return; } /* ********************************************************************** @@ -431,7 +435,7 @@ static u_int8_t arcmsr_hba_wait_msgint_r UDELAY(10000); }/*max 1 seconds*/ }while(Retries++ < 20);/*max 20 sec*/ - return FALSE; + return (FALSE); } /* ********************************************************************** @@ -452,7 +456,7 @@ static u_int8_t arcmsr_hbb_wait_msgint_r UDELAY(10000); }/*max 1 seconds*/ }while(Retries++ < 20);/*max 20 sec*/ - return FALSE; + return (FALSE); } /* ********************************************************************** @@ -472,7 +476,7 @@ static u_int8_t arcmsr_hbc_wait_msgint_r UDELAY(10000); }/*max 1 seconds*/ }while(Retries++ < 20);/*max 20 sec*/ - return FALSE; + return (FALSE); } /* ************************************************************************ @@ -490,7 +494,6 @@ static void arcmsr_flush_hba_cache(struc retry_count--; } }while(retry_count!=0); - return; } /* ************************************************************************ @@ -509,7 +512,6 @@ static void arcmsr_flush_hbb_cache(struc retry_count--; } }while(retry_count!=0); - return; } /* ************************************************************************ @@ -528,7 +530,6 @@ static void arcmsr_flush_hbc_cache(struc retry_count--; } }while(retry_count!=0); - return; } /* ************************************************************************ @@ -550,7 +551,6 @@ static void arcmsr_flush_adapter_cache(s } break; } - return; } /* ******************************************************************************* @@ -596,7 +596,7 @@ static void arcmsr_async(void *cb_arg, u if((target_id > ARCMSR_MAX_TARGETID) || (target_lun > ARCMSR_MAX_TARGETLUN)) { break; } - printf("%s:scsi id=%d lun=%d device lost \n", device_get_name(acb->pci_dev), target_id, target_lun); + // printf("%s:scsi id=%d lun=%d device lost \n", device_get_name(acb->pci_dev), target_id, target_lun); break; default: break; @@ -612,14 +612,13 @@ static void arcmsr_report_sense_info(str pccb->ccb_h.status |= CAM_SCSI_STATUS_ERROR; pccb->csio.scsi_status = SCSI_STATUS_CHECK_COND; - if(&pccb->csio.sense_data) { + if(pccb->csio.sense_len) { memset(&pccb->csio.sense_data, 0, sizeof(pccb->csio.sense_data)); memcpy(&pccb->csio.sense_data, srb->arcmsr_cdb.SenseData, get_min(sizeof(struct SENSE_DATA), sizeof(pccb->csio.sense_data))); ((u_int8_t *)&pccb->csio.sense_data)[0] = (0x1 << 7 | 0x70); /* Valid,ErrorCode */ pccb->ccb_h.status |= CAM_AUTOSNS_VALID; } - return; } /* ********************************************************************* @@ -631,7 +630,6 @@ static void arcmsr_abort_hba_allcmd(stru if(!arcmsr_hba_wait_msgint_ready(acb)) { printf("arcmsr%d: wait 'abort all outstanding command' timeout \n", acb->pci_unit); } - return; } /* ********************************************************************* @@ -643,7 +641,6 @@ static void arcmsr_abort_hbb_allcmd(stru if(!arcmsr_hbb_wait_msgint_ready(acb)) { printf("arcmsr%d: wait 'abort all outstanding command' timeout \n", acb->pci_unit); } - return; } /* ********************************************************************* @@ -656,7 +653,6 @@ static void arcmsr_abort_hbc_allcmd(stru if(!arcmsr_hbc_wait_msgint_ready(acb)) { printf("arcmsr%d: wait 'abort all outstanding command' timeout \n", acb->pci_unit); } - return; } /* ********************************************************************* @@ -678,7 +674,6 @@ static void arcmsr_abort_allcmd(struct A } break; } - return; } /* ********************************************************************** @@ -716,7 +711,6 @@ static void arcmsr_srb_complete(struct C acb->pktReturnCount++; #endif xpt_done(pccb); - return; } /* ************************************************************************** @@ -768,7 +762,6 @@ static void arcmsr_report_srb_state(stru break; } } - return; } /* ************************************************************************** @@ -801,7 +794,6 @@ static void arcmsr_drain_donequeue(struc return; } arcmsr_report_srb_state(acb, srb, error); - return; } /* ************************************************************************** @@ -883,7 +875,6 @@ static void arcmsr_done4abort_postqueue( } break; } - return; } /* **************************************************************************** @@ -923,7 +914,6 @@ static void arcmsr_iop_reset(struct Adap acb->pktRequestCount = 0; acb->pktReturnCount = 0; #endif - return; } /* ********************************************************************** @@ -1011,7 +1001,6 @@ static void arcmsr_build_srb(struct Comm arcmsr_cdb->DataLength = 0; } srb->arc_cdb_size=arccdbsize; - return; } /* ************************************************************************** @@ -1072,7 +1061,6 @@ static void arcmsr_post_srb(struct Adapt } break; } - return; } /* ************************************************************************ @@ -1156,7 +1144,6 @@ static void arcmsr_iop_message_read(stru CHIP_REG_WRITE32(HBC_MessageUnit, 0, inbound_doorbell, ARCMSR_HBCMU_DRV2IOP_DATA_READ_OK); } } - return; } /* ************************************************************************** @@ -1221,7 +1208,6 @@ static void arcmsr_post_ioctldata2iop(st */ arcmsr_iop_message_wrote(acb); } - return; } /* ************************************************************************ @@ -1236,7 +1222,6 @@ static void arcmsr_stop_hba_bgrb(struct printf("arcmsr%d: wait 'stop adapter background rebulid' timeout \n" , acb->pci_unit); } - return; } /* ************************************************************************ @@ -1251,7 +1236,6 @@ static void arcmsr_stop_hbb_bgrb(struct printf( "arcmsr%d: wait 'stop adapter background rebulid' timeout \n" , acb->pci_unit); } - return; } /* ************************************************************************ @@ -1265,7 +1249,6 @@ static void arcmsr_stop_hbc_bgrb(struct if(!arcmsr_hbc_wait_msgint_ready(acb)) { printf("arcmsr%d: wait 'stop adapter background rebulid' timeout \n", acb->pci_unit); } - return; } /* ************************************************************************ @@ -1287,7 +1270,6 @@ static void arcmsr_stop_adapter_bgrb(str } break; } - return; } /* ************************************************************************ @@ -1305,7 +1287,6 @@ static void arcmsr_poll(struct cam_sim * arcmsr_interrupt(acb); if( mutex == 0 ) ARCMSR_LOCK_RELEASE(&acb->qbuffer_lock); - return; } /* ************************************************************************** @@ -1340,7 +1321,6 @@ static void arcmsr_iop2drv_data_wrote_ha } else { acb->acb_flags|=ACB_F_IOPDATA_OVERFLOW; } - return; } /* ************************************************************************** @@ -1383,7 +1363,6 @@ static void arcmsr_iop2drv_data_read_han if(acb->wqbuf_firstindex==acb->wqbuf_lastindex) { acb->acb_flags |= ACB_F_MESSAGE_WQBUFFER_CLEARED; } - return; } static void arcmsr_rescanLun_cb(struct cam_periph *periph, union ccb *ccb) @@ -1417,7 +1396,6 @@ static void arcmsr_rescan_lun(struct Ada ccb->ccb_h.cbfcnp = arcmsr_rescanLun_cb; ccb->crcn.flags = CAM_FLAG_NONE; xpt_action(ccb); - return; } @@ -1488,6 +1466,7 @@ static void arcmsr_dr_handle(struct Adap } break; } + if(acb->acb_flags & ACB_F_BUS_HANG_ON) { acb->acb_flags &= ~ACB_F_BUS_HANG_ON; @@ -1592,7 +1571,6 @@ static void arcmsr_hba_doorbell_isr(stru if(outbound_doorbell & ARCMSR_OUTBOUND_IOP331_DATA_READ_OK) { arcmsr_iop2drv_data_read_handle(acb); } - return; } /* ************************************************************************** @@ -1620,7 +1598,6 @@ static void arcmsr_hbc_doorbell_isr(stru if(outbound_doorbell & ARCMSR_HBCMU_IOP2DRV_MESSAGE_CMD_DONE) { arcmsr_hbc_message_isr(acb); /* messenger of "driver to iop commands" */ } - return; } /* ************************************************************************** @@ -1644,7 +1621,6 @@ static void arcmsr_hba_postqueue_isr(str error=(flag_srb & ARCMSR_SRBREPLY_FLAG_ERROR_MODE0)?TRUE:FALSE; arcmsr_drain_donequeue(acb, flag_srb, error); } /*drain reply FIFO*/ - return; } /* ************************************************************************** @@ -1674,7 +1650,6 @@ static void arcmsr_hbb_postqueue_isr(str error=(flag_srb & ARCMSR_SRBREPLY_FLAG_ERROR_MODE0)?TRUE:FALSE; arcmsr_drain_donequeue(acb, flag_srb, error); } /*drain reply FIFO*/ - return; } /* ************************************************************************** @@ -1704,7 +1679,6 @@ static void arcmsr_hbc_postqueue_isr(str } throttling++; } /*drain reply FIFO*/ - return; } /* ********************************************************************** @@ -1712,30 +1686,29 @@ static void arcmsr_hbc_postqueue_isr(str */ static void arcmsr_handle_hba_isr( struct AdapterControlBlock *acb) { - u_int32_t outbound_intstatus; + u_int32_t outbound_intStatus; /* ********************************************* ** check outbound intstatus ********************************************* */ - outbound_intstatus=CHIP_REG_READ32(HBA_MessageUnit, 0, outbound_intstatus) & acb->outbound_int_enable; - if(!outbound_intstatus) { + outbound_intStatus=CHIP_REG_READ32(HBA_MessageUnit, 0, outbound_intstatus) & acb->outbound_int_enable; + if(!outbound_intStatus) { /*it must be share irq*/ return; } - CHIP_REG_WRITE32(HBA_MessageUnit, 0, outbound_intstatus, outbound_intstatus);/*clear interrupt*/ + CHIP_REG_WRITE32(HBA_MessageUnit, 0, outbound_intstatus, outbound_intStatus);/*clear interrupt*/ /* MU doorbell interrupts*/ - if(outbound_intstatus & ARCMSR_MU_OUTBOUND_DOORBELL_INT) { + if(outbound_intStatus & ARCMSR_MU_OUTBOUND_DOORBELL_INT) { arcmsr_hba_doorbell_isr(acb); } /* MU post queue interrupts*/ - if(outbound_intstatus & ARCMSR_MU_OUTBOUND_POSTQUEUE_INT) { + if(outbound_intStatus & ARCMSR_MU_OUTBOUND_POSTQUEUE_INT) { arcmsr_hba_postqueue_isr(acb); } - if(outbound_intstatus & ARCMSR_MU_OUTBOUND_MESSAGE0_INT) { + if(outbound_intStatus & ARCMSR_MU_OUTBOUND_MESSAGE0_INT) { arcmsr_hba_message_isr(acb); } - return; } /* ********************************************************************** @@ -1771,7 +1744,6 @@ static void arcmsr_handle_hbb_isr( struc if(outbound_doorbell & ARCMSR_IOP2DRV_MESSAGE_CMD_DONE) { arcmsr_hbb_message_isr(acb); } - return; } /* ********************************************************************** @@ -1798,7 +1770,6 @@ static void arcmsr_handle_hbc_isr( struc if(host_interrupt_status & ARCMSR_HBCMU_OUTBOUND_POSTQUEUE_ISR) { arcmsr_hbc_postqueue_isr(acb); } - return; } /* ****************************************************************************** @@ -1821,7 +1792,6 @@ static void arcmsr_interrupt(struct Adap " unknow adapter type =%d\n", acb->pci_unit, acb->adapter_type); break; } - return; } /* ********************************************************************** @@ -1844,7 +1814,7 @@ static void arcmsr_polling_devmap(void* struct AdapterControlBlock *acb = (struct AdapterControlBlock *)arg; switch (acb->adapter_type) { case ACB_ADAPTER_TYPE_A: - CHIP_REG_WRITE32(HBC_MessageUnit, 0, inbound_msgaddr0, ARCMSR_INBOUND_MESG0_GET_CONFIG); + CHIP_REG_WRITE32(HBA_MessageUnit, 0, inbound_msgaddr0, ARCMSR_INBOUND_MESG0_GET_CONFIG); break; case ACB_ADAPTER_TYPE_B: @@ -2065,7 +2035,7 @@ u_int32_t arcmsr_iop_ioctlcmd(struct Ada break; } ARCMSR_LOCK_RELEASE(&acb->qbuffer_lock); - return retvalue; + return (retvalue); } /* ************************************************************************** @@ -2191,7 +2161,7 @@ static int arcmsr_iop_message_xfer(struc if (wqbuf_lastindex != wqbuf_firstindex) { arcmsr_post_ioctldata2iop(acb); /* has error report sensedata */ - if(&pccb->csio.sense_data) { + if(pccb->csio.sense_len) { ((u_int8_t *)&pccb->csio.sense_data)[0] = (0x1 << 7 | 0x70); /* Valid,ErrorCode */ ((u_int8_t *)&pccb->csio.sense_data)[2] = 0x05; @@ -2221,7 +2191,7 @@ static int arcmsr_iop_message_xfer(struc } } else { /* has error report sensedata */ - if(&pccb->csio.sense_data) { + if(pccb->csio.sense_len) { ((u_int8_t *)&pccb->csio.sense_data)[0] = (0x1 << 7 | 0x70); /* Valid,ErrorCode */ ((u_int8_t *)&pccb->csio.sense_data)[2] = 0x05; @@ -2312,7 +2282,7 @@ static int arcmsr_iop_message_xfer(struc retvalue = ARCMSR_MESSAGE_FAIL; } message_out: - return retvalue; + return (retvalue); } /* ********************************************************************* @@ -2375,7 +2345,7 @@ static void arcmsr_execute_srb(void *arg arcmsr_srb_complete(srb, 0); return; } - if(acb->srboutstandingcount >= ARCMSR_MAX_OUTSTANDING_CMD) { + if(acb->srboutstandingcount > ARCMSR_MAX_OUTSTANDING_CMD) { xpt_freeze_simq(acb->psim, 1); pccb->ccb_h.status = CAM_REQUEUE_REQ; acb->acb_flags |= ACB_F_CAM_DEV_QFRZN; @@ -2388,10 +2358,9 @@ static void arcmsr_execute_srb(void *arg if (pccb->ccb_h.timeout != CAM_TIME_INFINITY) { arcmsr_callout_init(&srb->ccb_callout); - callout_reset(&srb->ccb_callout, (pccb->ccb_h.timeout * hz ) / 1000, arcmsr_srb_timeout, srb); + callout_reset(&srb->ccb_callout, ((pccb->ccb_h.timeout + (ARCMSR_TIMEOUT_DELAY * 1000)) * hz) / 1000, arcmsr_srb_timeout, srb); srb->srb_flags |= SRB_FLAG_TIMER_START; } - return; } /* ***************************************************************************************** @@ -2455,7 +2424,6 @@ static void arcmsr_bus_reset(struct Adap } arcmsr_iop_reset(acb); acb->acb_flags &= ~ACB_F_BUS_RESET; - return; } /* ************************************************************************** @@ -2607,10 +2575,24 @@ static void arcmsr_action(struct cam_sim strncpy(cpi->dev_name, cam_sim_name(psim), DEV_IDLEN); cpi->unit_number=cam_sim_unit(psim); #ifdef CAM_NEW_TRAN_CODE - cpi->transport = XPORT_SPI; - cpi->transport_version = 2; + if(acb->adapter_bus_speed == ACB_BUS_SPEED_6G) + cpi->base_transfer_speed = 600000; + else + cpi->base_transfer_speed = 300000; + if((acb->vendor_device_id == PCIDevVenIDARC1880) || + (acb->vendor_device_id == PCIDevVenIDARC1680)) + { + cpi->transport = XPORT_SAS; + cpi->transport_version = 0; + cpi->protocol_version = SCSI_REV_SPC2; + } + else + { + cpi->transport = XPORT_SPI; + cpi->transport_version = 2; + cpi->protocol_version = SCSI_REV_2; + } cpi->protocol = PROTO_SCSI; - cpi->protocol_version = SCSI_REV_2; #endif cpi->ccb_h.status |= CAM_REQ_CMP; xpt_done(pccb); @@ -2674,28 +2656,46 @@ static void arcmsr_action(struct cam_sim { struct ccb_trans_settings_scsi *scsi; struct ccb_trans_settings_spi *spi; + struct ccb_trans_settings_sas *sas; scsi = &cts->proto_specific.scsi; - spi = &cts->xport_specific.spi; - cts->protocol = PROTO_SCSI; - cts->protocol_version = SCSI_REV_2; - cts->transport = XPORT_SPI; - cts->transport_version = 2; - spi->flags = CTS_SPI_FLAGS_DISC_ENB; - spi->sync_period=3; - spi->sync_offset=32; - spi->bus_width=MSG_EXT_WDTR_BUS_16_BIT; scsi->flags = CTS_SCSI_FLAGS_TAG_ENB; - spi->valid = CTS_SPI_VALID_DISC - | CTS_SPI_VALID_SYNC_RATE - | CTS_SPI_VALID_SYNC_OFFSET - | CTS_SPI_VALID_BUS_WIDTH; scsi->valid = CTS_SCSI_VALID_TQ; + cts->protocol = PROTO_SCSI; + + if((acb->vendor_device_id == PCIDevVenIDARC1880) || + (acb->vendor_device_id == PCIDevVenIDARC1680)) + { + cts->protocol_version = SCSI_REV_SPC2; + cts->transport_version = 0; + cts->transport = XPORT_SAS; + sas = &cts->xport_specific.sas; + sas->valid = CTS_SAS_VALID_SPEED; + if(acb->vendor_device_id == PCIDevVenIDARC1880) + sas->bitrate = 600000; + else if(acb->vendor_device_id == PCIDevVenIDARC1680) + sas->bitrate = 300000; + } + else + { + cts->protocol_version = SCSI_REV_2; + cts->transport_version = 2; + cts->transport = XPORT_SPI; + spi = &cts->xport_specific.spi; + spi->flags = CTS_SPI_FLAGS_DISC_ENB; + spi->sync_period=2; + spi->sync_offset=32; + spi->bus_width=MSG_EXT_WDTR_BUS_16_BIT; + spi->valid = CTS_SPI_VALID_DISC + | CTS_SPI_VALID_SYNC_RATE + | CTS_SPI_VALID_SYNC_OFFSET + | CTS_SPI_VALID_BUS_WIDTH; + } } #else { cts->flags=(CCB_TRANS_DISC_ENB | CCB_TRANS_TAG_ENB); - cts->sync_period=3; + cts->sync_period=2; cts->sync_offset=32; cts->bus_width=MSG_EXT_WDTR_BUS_16_BIT; cts->valid=CCB_TRANS_SYNC_RATE_VALID | @@ -2759,7 +2759,6 @@ static void arcmsr_action(struct cam_sim xpt_done(pccb); break; } - return; } /* ********************************************************************** @@ -2772,7 +2771,6 @@ static void arcmsr_start_hba_bgrb(struct if(!arcmsr_hba_wait_msgint_ready(acb)) { printf("arcmsr%d: wait 'start adapter background rebulid' timeout \n", acb->pci_unit); } - return; } /* ********************************************************************** @@ -2785,7 +2783,6 @@ static void arcmsr_start_hbb_bgrb(struct if(!arcmsr_hbb_wait_msgint_ready(acb)) { printf( "arcmsr%d: wait 'start adapter background rebulid' timeout \n", acb->pci_unit); } - return; } /* ********************************************************************** @@ -2799,7 +2796,6 @@ static void arcmsr_start_hbc_bgrb(struct if(!arcmsr_hbc_wait_msgint_ready(acb)) { printf("arcmsr%d: wait 'start adapter background rebulid' timeout \n", acb->pci_unit); } - return; } /* ********************************************************************** @@ -2818,7 +2814,6 @@ static void arcmsr_start_adapter_bgrb(st arcmsr_start_hbc_bgrb(acb); break; } - return; } /* ********************************************************************** @@ -2873,7 +2868,6 @@ polling_ccb_retry: } arcmsr_report_srb_state(acb, srb, error); } /*drain reply FIFO*/ - return; } /* ********************************************************************** @@ -2934,7 +2928,6 @@ polling_ccb_retry: } arcmsr_report_srb_state(acb, srb, error); } /*drain reply FIFO*/ - return; } /* ********************************************************************** @@ -2985,7 +2978,6 @@ polling_ccb_retry: } arcmsr_report_srb_state(acb, srb, error); } /*drain reply FIFO*/ - return; } /* ********************************************************************** @@ -3053,7 +3045,6 @@ static void arcmsr_get_hba_config(struct acb->firm_sdram_size=CHIP_REG_READ32(HBA_MessageUnit, 0, msgcode_rwbuffer[3]); /*firm_sdram_size, 3, 12-15*/ acb->firm_ide_channels=CHIP_REG_READ32(HBA_MessageUnit, 0, msgcode_rwbuffer[4]); /*firm_ide_channels, 4, 16-19*/ acb->firm_cfg_version=CHIP_REG_READ32(HBA_MessageUnit, 0, msgcode_rwbuffer[ARCMSR_FW_CFGVER_OFFSET]); /*firm_cfg_version, 25, */ - return; } /* ********************************************************************** @@ -3100,7 +3091,6 @@ static void arcmsr_get_hbb_config(struct acb->firm_sdram_size=CHIP_REG_READ32(HBB_RWBUFFER, 1, msgcode_rwbuffer[3]); /*firm_sdram_size, 3, 12-15*/ acb->firm_ide_channels=CHIP_REG_READ32(HBB_RWBUFFER, 1, msgcode_rwbuffer[4]); /*firm_ide_channels, 4, 16-19*/ acb->firm_cfg_version=CHIP_REG_READ32(HBB_RWBUFFER, 1, msgcode_rwbuffer[ARCMSR_FW_CFGVER_OFFSET]); /*firm_cfg_version, 25, */ - return; } /* ********************************************************************** @@ -3148,7 +3138,6 @@ static void arcmsr_get_hbc_config(struct acb->firm_sdram_size =CHIP_REG_READ32(HBC_MessageUnit, 0, msgcode_rwbuffer[3]); /*firm_sdram_size, 3, 12-15*/ acb->firm_ide_channels =CHIP_REG_READ32(HBC_MessageUnit, 0, msgcode_rwbuffer[4]); /*firm_ide_channels, 4, 16-19*/ acb->firm_cfg_version =CHIP_REG_READ32(HBC_MessageUnit, 0, msgcode_rwbuffer[ARCMSR_FW_CFGVER_OFFSET]); /*firm_cfg_version, 25, */ - return; } /* ********************************************************************** @@ -3170,7 +3159,6 @@ static void arcmsr_get_firmware_spec(str } break; } - return; } /* ********************************************************************** @@ -3219,7 +3207,6 @@ static void arcmsr_wait_firmware_ready( } break; } - return; } /* ********************************************************************** @@ -3253,7 +3240,6 @@ static void arcmsr_clear_doorbell_queue_ } break; } - return; } /* ************************************************************************ @@ -3336,7 +3322,7 @@ static u_int32_t arcmsr_iop_confirm(stru } break; } - return TRUE; + return (TRUE); } /* ************************************************************************ @@ -3359,7 +3345,6 @@ static void arcmsr_enable_eoi_mode(struc } break; } - return; } /* ********************************************************************** @@ -3382,7 +3367,6 @@ static void arcmsr_iop_init(struct Adapt /* enable outbound Post Queue, outbound doorbell Interrupt */ arcmsr_enable_allintr(acb, intmask_org); acb->acb_flags |=ACB_F_IOP_INITED; - return; } /* ********************************************************************** @@ -3414,7 +3398,6 @@ static void arcmsr_map_free_srb(void *ar srb_tmp = (struct CommandControlBlock *)((unsigned long)srb_tmp+SRB_SIZE); } acb->vir2phy_offset=(unsigned long)srb_tmp-(unsigned long)srb_phyaddr; - return; } /* ************************************************************************ @@ -3433,7 +3416,6 @@ static void arcmsr_free_resource(struct bus_dma_tag_destroy(acb->srb_dmat); bus_dma_tag_destroy(acb->dm_segs_dmat); bus_dma_tag_destroy(acb->parent_dmat); - return; } /* ************************************************************************ @@ -3444,16 +3426,24 @@ static u_int32_t arcmsr_initialize(devic struct AdapterControlBlock *acb=device_get_softc(dev); u_int16_t pci_command; int i, j,max_coherent_size; - - switch (pci_get_devid(dev)) { - case PCIDevVenIDARC1880: { + u_int32_t vendor_dev_id; + + vendor_dev_id = pci_get_devid(dev); + acb->vendor_device_id = vendor_dev_id; + switch (vendor_dev_id) { + case PCIDevVenIDARC1880: + case PCIDevVenIDARC1882: + case PCIDevVenIDARC1213: + case PCIDevVenIDARC1223: { acb->adapter_type=ACB_ADAPTER_TYPE_C; + acb->adapter_bus_speed = ACB_BUS_SPEED_6G; max_coherent_size=ARCMSR_SRBS_POOL_SIZE; } break; case PCIDevVenIDARC1200: case PCIDevVenIDARC1201: { acb->adapter_type=ACB_ADAPTER_TYPE_B; + acb->adapter_bus_speed = ACB_BUS_SPEED_3G; max_coherent_size=ARCMSR_SRBS_POOL_SIZE+(sizeof(struct HBB_MessageUnit)); } break; @@ -3477,6 +3467,7 @@ static u_int32_t arcmsr_initialize(devic case PCIDevVenIDARC1680: case PCIDevVenIDARC1681: { acb->adapter_type=ACB_ADAPTER_TYPE_A; + acb->adapter_bus_speed = ACB_BUS_SPEED_3G; max_coherent_size=ARCMSR_SRBS_POOL_SIZE; } break; @@ -3804,7 +3795,7 @@ static int arcmsr_attach(device_t dev) #endif arcmsr_callout_init(&acb->devmap_callout); callout_reset(&acb->devmap_callout, 60 * hz, arcmsr_polling_devmap, acb); - return 0; + return (0); } /* @@ -3851,6 +3842,9 @@ static int arcmsr_probe(device_t dev) type = "SAS 3G"; break; case PCIDevVenIDARC1880: + case PCIDevVenIDARC1882: + case PCIDevVenIDARC1213: + case PCIDevVenIDARC1223: type = "SAS 6G"; break; default: Modified: stable/9/sys/dev/arcmsr/arcmsr.h ============================================================================== --- stable/9/sys/dev/arcmsr/arcmsr.h Wed Sep 19 21:50:18 2012 (r240711) +++ stable/9/sys/dev/arcmsr/arcmsr.h Wed Sep 19 22:12:57 2012 (r240712) @@ -52,6 +52,7 @@ #define ARCMSR_MAX_ADAPTER 4 #define ARCMSR_RELEASE_SIMQ_LEVEL 230 #define ARCMSR_MAX_HBB_POSTQUEUE 264 /* (ARCMSR_MAX_OUTSTANDING_CMD+8) */ +#define ARCMSR_TIMEOUT_DELAY 60 /* in sec */ /* ********************************************************************* */ @@ -97,6 +98,13 @@ #define PCI_DEVICE_ID_ARECA_1681 0x1681 /* Device ID */ #define PCI_DEVICE_ID_ARECA_1880 0x1880 /* Device ID */ +#define ARECA_SUB_DEV_ID_1880 0x1880 /* Subsystem Device ID */ +#define ARECA_SUB_DEV_ID_1882 0x1882 /* Subsystem Device ID */ +#define ARECA_SUB_DEV_ID_1212 0x1212 /* Subsystem Device ID */ +#define ARECA_SUB_DEV_ID_1213 0x1213 /* Subsystem Device ID */ +#define ARECA_SUB_DEV_ID_1222 0x1222 /* Subsystem Device ID */ +#define ARECA_SUB_DEV_ID_1223 0x1223 /* Subsystem Device ID */ + #define PCIDevVenIDARC1110 0x111017D3 /* Vendor Device ID */ #define PCIDevVenIDARC1120 0x112017D3 /* Vendor Device ID */ #define PCIDevVenIDARC1130 0x113017D3 /* Vendor Device ID */ @@ -106,8 +114,10 @@ #define PCIDevVenIDARC1201 0x120117D3 /* Vendor Device ID */ #define PCIDevVenIDARC1210 0x121017D3 /* Vendor Device ID */ #define PCIDevVenIDARC1212 0x121217D3 /* Vendor Device ID */ +#define PCIDevVenIDARC1213 0x121317D3 /* Vendor Device ID */ #define PCIDevVenIDARC1220 0x122017D3 /* Vendor Device ID */ #define PCIDevVenIDARC1222 0x122217D3 /* Vendor Device ID */ +#define PCIDevVenIDARC1223 0x122317D3 /* Vendor Device ID */ #define PCIDevVenIDARC1230 0x123017D3 /* Vendor Device ID */ #define PCIDevVenIDARC1231 0x123117D3 /* Vendor Device ID */ #define PCIDevVenIDARC1260 0x126017D3 /* Vendor Device ID */ @@ -119,6 +129,7 @@ #define PCIDevVenIDARC1680 0x168017D3 /* Vendor Device ID */ #define PCIDevVenIDARC1681 0x168117D3 /* Vendor Device ID */ #define PCIDevVenIDARC1880 0x188017D3 /* Vendor Device ID */ +#define PCIDevVenIDARC1882 0x188217D3 /* Vendor Device ID */ #ifndef PCIR_BARS #define PCIR_BARS 0x10 @@ -830,6 +841,8 @@ struct AdapterControlBlock { u_int32_t pktRequestCount; u_int32_t pktReturnCount; #endif + u_int32_t vendor_device_id; + u_int32_t adapter_bus_speed; };/* HW_DEVICE_EXTENSION */ /* acb_flags */ #define ACB_F_SCSISTOPADAPTER 0x0001 @@ -848,6 +861,10 @@ struct AdapterControlBlock { /* devstate */ #define ARECA_RAID_GONE 0x55 #define ARECA_RAID_GOOD 0xaa +/* adapter_bus_speed */ +#define ACB_BUS_SPEED_3G 0 +#define ACB_BUS_SPEED_6G 1 +#define ACB_BUS_SPEED_12G 2 /* ********************************************************************* ** Message Unit structure From owner-svn-src-all@FreeBSD.ORG Wed Sep 19 22:24:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B2E2D1065673; Wed, 19 Sep 2012 22:24:09 +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 9DA748FC17; Wed, 19 Sep 2012 22:24:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8JMO9cF083637; Wed, 19 Sep 2012 22:24:09 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8JMO9EE083635; Wed, 19 Sep 2012 22:24:09 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201209192224.q8JMO9EE083635@svn.freebsd.org> From: Matt Jacob Date: Wed, 19 Sep 2012 22:24:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240713 - stable/9/sys/dev/isp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Sep 2012 22:24:09 -0000 Author: mjacob Date: Wed Sep 19 22:24:09 2012 New Revision: 240713 URL: http://svn.freebsd.org/changeset/base/240713 Log: MFC of 240580 and 240590- correct some comments. Modified: stable/9/sys/dev/isp/isp_freebsd.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/isp/ (props changed) Modified: stable/9/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/9/sys/dev/isp/isp_freebsd.c Wed Sep 19 22:12:57 2012 (r240712) +++ stable/9/sys/dev/isp/isp_freebsd.c Wed Sep 19 22:24:09 2012 (r240713) @@ -1735,10 +1735,10 @@ isp_target_start_ctio(ispsoftc_t *isp, u /* * Mode 1, status, no data. Only possible when we are sending status, have - * no data to transfer, and any sense length can fit in the ct7_entry. + * no data to transfer, and any sense data can fit into a ct7_entry_t. * - * Mode 2, status, no data. We have to use this in the case sense data - * won't fit into a ct7_entry_t. + * Mode 2, status, no data. We have to use this in the case that + * the sense data won't fit into a ct7_entry_t. * */ if (sendstatus && xfrlen == 0) { From owner-svn-src-all@FreeBSD.ORG Wed Sep 19 23:03:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 40073106566C; Wed, 19 Sep 2012 23:03:55 +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 287088FC14; Wed, 19 Sep 2012 23:03:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8JN3tXD090577; Wed, 19 Sep 2012 23:03:55 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8JN3slm090573; Wed, 19 Sep 2012 23:03:54 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201209192303.q8JN3slm090573@svn.freebsd.org> From: Xin LI Date: Wed, 19 Sep 2012 23:03: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: r240715 - in stable/8: share/man/man4 sys/dev/arcmsr X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Sep 2012 23:03:55 -0000 Author: delphij Date: Wed Sep 19 23:03:54 2012 New Revision: 240715 URL: http://svn.freebsd.org/changeset/base/240715 Log: MFC r240079,215837: Update arcmsr(4) to vendor version 1.20.00.25. Many thanks to Areca for continuing to support FreeBSD. Submitted by: Ching-Lung Huang Modified: stable/8/share/man/man4/arcmsr.4 stable/8/sys/dev/arcmsr/arcmsr.c stable/8/sys/dev/arcmsr/arcmsr.h Directory Properties: stable/8/share/man/man4/ (props changed) stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/arcmsr/ (props changed) Modified: stable/8/share/man/man4/arcmsr.4 ============================================================================== --- stable/8/share/man/man4/arcmsr.4 Wed Sep 19 22:26:05 2012 (r240714) +++ stable/8/share/man/man4/arcmsr.4 Wed Sep 19 23:03:54 2012 (r240715) @@ -24,12 +24,12 @@ .\" .\" $FreeBSD$ .\" -.Dd March 28, 2008 +.Dd September 3, 2012 .Dt ARCMSR 4 .Os .Sh NAME .Nm arcmsr -.Nd Areca SATA II RAID Controller driver +.Nd Areca RAID Controller driver .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your @@ -50,11 +50,11 @@ arcmsr_load="YES" .Sh DESCRIPTION The .Nm -driver provides support for the Areca ARC-11xx and ARC-12xx series of SATA II -RAID controllers. +driver provides support for the Areca ARC-11xx, ARC-12xx, ARC-13xx, +ARC-16xx and ARC-18xx series of SAS and SATA RAID controllers. These controllers feature RAID-0, 1, 3, 5, 6, and 10 and JBOD acceleration for up to 16 SATA drives. -Raid level and stripe level +RAID level and stripe level migration, online capacity expansion, hot insertion/removal, automatic failover and rebuild, and SMART are also supported. Access to the arrays is provided @@ -82,8 +82,6 @@ ARC-1160 .It ARC-1170 .It -ARC-1180 -.It ARC-1110ML .It ARC-1120ML @@ -92,14 +90,32 @@ ARC-1130ML .It ARC-1160ML .It +ARC-1200 +.It +ARC-1201 +.It ARC-1210 .It +ARC-1212 +.It +ARC-1213 +.It ARC-1220 .It +ARC-1222 +.It +ARC-1223 +.It ARC-1230 .It +ARC-1231 +.It ARC-1260 .It +ARC-1261 +.It +ARC-1270 +.It ARC-1280 .It ARC-1210ML @@ -111,6 +127,18 @@ ARC-1231ML ARC-1261ML .It ARC-1280ML +.It +ARC-1380 +.It +ARC-1381 +.It +ARC-1680 +.It +ARC-1681 +.It +ARC-1880 +.It +ARC-1882 .El .Sh FILES .Bl -tag -width ".Pa /dev/arcmsr?" -compact Modified: stable/8/sys/dev/arcmsr/arcmsr.c ============================================================================== --- stable/8/sys/dev/arcmsr/arcmsr.c Wed Sep 19 22:26:05 2012 (r240714) +++ stable/8/sys/dev/arcmsr/arcmsr.c Wed Sep 19 23:03:54 2012 (r240715) @@ -37,38 +37,43 @@ ************************************************************************** ** History ** -** REV# DATE NAME DESCRIPTION -** 1.00.00.00 03/31/2004 Erich Chen First release -** 1.20.00.02 11/29/2004 Erich Chen bug fix with arcmsr_bus_reset when PHY error -** 1.20.00.03 04/19/2005 Erich Chen add SATA 24 Ports adapter type support +** REV# DATE NAME DESCRIPTION +** 1.00.00.00 03/31/2004 Erich Chen First release +** 1.20.00.02 11/29/2004 Erich Chen bug fix with arcmsr_bus_reset when PHY error +** 1.20.00.03 04/19/2005 Erich Chen add SATA 24 Ports adapter type support ** clean unused function -** 1.20.00.12 09/12/2005 Erich Chen bug fix with abort command handling, +** 1.20.00.12 09/12/2005 Erich Chen bug fix with abort command handling, ** firmware version check ** and firmware update notify for hardware bug fix ** handling if none zero high part physical address ** of srb resource -** 1.20.00.13 08/18/2006 Erich Chen remove pending srb and report busy +** 1.20.00.13 08/18/2006 Erich Chen remove pending srb and report busy ** add iop message xfer ** with scsi pass-through command ** add new device id of sas raid adapters ** code fit for SPARC64 & PPC -** 1.20.00.14 02/05/2007 Erich Chen bug fix for incorrect ccb_h.status report +** 1.20.00.14 02/05/2007 Erich Chen bug fix for incorrect ccb_h.status report ** and cause g_vfs_done() read write error -** 1.20.00.15 10/10/2007 Erich Chen support new RAID adapter type ARC120x -** 1.20.00.16 10/10/2009 Erich Chen Bug fix for RAID adapter type ARC120x +** 1.20.00.15 10/10/2007 Erich Chen support new RAID adapter type ARC120x +** 1.20.00.16 10/10/2009 Erich Chen Bug fix for RAID adapter type ARC120x ** bus_dmamem_alloc() with BUS_DMA_ZERO -** 1.20.00.17 07/15/2010 Ching Huang Added support ARC1880 -** report CAM_DEV_NOT_THERE instead of CAM_SEL_TIMEOUT when device failed, -** prevent cam_periph_error removing all LUN devices of one Target id -** for any one LUN device failed -** 1.20.00.18 10/14/2010 Ching Huang Fixed "inquiry data fails comparion at DV1 step" -** 10/25/2010 Ching Huang Fixed bad range input in bus_alloc_resource for ADAPTER_TYPE_B -** 1.20.00.19 11/11/2010 Ching Huang Fixed arcmsr driver prevent arcsas support for Areca SAS HBA ARC13x0 -** 1.20.00.20 12/08/2010 Ching Huang Avoid calling atomic_set_int function -** 1.20.00.21 02/08/2011 Ching Huang Implement I/O request timeout -** 02/14/2011 Ching Huang Modified pktRequestCount -** 1.20.00.21 03/03/2011 Ching Huang if a command timeout, then wait its ccb back before free it -** 1.20.00.22 07/04/2011 Ching Huang Fixed multiple MTX panic +** 1.20.00.17 07/15/2010 Ching Huang Added support ARC1880 +** report CAM_DEV_NOT_THERE instead of CAM_SEL_TIMEOUT when device failed, +** prevent cam_periph_error removing all LUN devices of one Target id +** for any one LUN device failed +** 1.20.00.18 10/14/2010 Ching Huang Fixed "inquiry data fails comparion at DV1 step" +** 10/25/2010 Ching Huang Fixed bad range input in bus_alloc_resource for ADAPTER_TYPE_B +** 1.20.00.19 11/11/2010 Ching Huang Fixed arcmsr driver prevent arcsas support for Areca SAS HBA ARC13x0 +** 1.20.00.20 12/08/2010 Ching Huang Avoid calling atomic_set_int function +** 1.20.00.21 02/08/2011 Ching Huang Implement I/O request timeout +** 02/14/2011 Ching Huang Modified pktRequestCount +** 1.20.00.21 03/03/2011 Ching Huang if a command timeout, then wait its ccb back before free it +** 1.20.00.22 07/04/2011 Ching Huang Fixed multiple MTX panic +** 1.20.00.23 10/28/2011 Ching Huang Added TIMEOUT_DELAY in case of too many HDDs need to start +** 1.20.00.23 11/08/2011 Ching Huang Added report device transfer speed +** 1.20.00.23 01/30/2012 Ching Huang Fixed Request requeued and Retrying command +** 1.20.00.24 06/11/2012 Ching Huang Fixed return sense data condition +** 1.20.00.25 08/17/2012 Ching Huang Fixed hotplug device no function on type A adapter ****************************************************************************************** */ @@ -154,7 +159,7 @@ __FBSDID("$FreeBSD$"); #define arcmsr_callout_init(a) callout_init(a); #endif -#define ARCMSR_DRIVER_VERSION "Driver Version 1.20.00.22 2011-07-04" +#define ARCMSR_DRIVER_VERSION "Driver Version 1.20.00.25 2012-08-17" #include #define SRB_SIZE ((sizeof(struct CommandControlBlock)+0x1f) & 0xffe0) #define ARCMSR_SRBS_POOL_SIZE (SRB_SIZE * ARCMSR_MAX_FREESRB_NUM) @@ -296,7 +301,7 @@ static struct cdevsw arcmsr_cdevsw = { if(acb==NULL) { return ENXIO; } - return 0; + return (0); } /* ************************************************************************** @@ -347,7 +352,7 @@ static struct cdevsw arcmsr_cdevsw = { if(acb==NULL) { return ENXIO; } - return(arcmsr_iop_ioctlcmd(acb, ioctl_cmd, arg)); + return (arcmsr_iop_ioctlcmd(acb, ioctl_cmd, arg)); } /* ********************************************************************** @@ -378,7 +383,7 @@ static u_int32_t arcmsr_disable_allintr( } break; } - return(intmask_org); + return (intmask_org); } /* ********************************************************************** @@ -411,7 +416,6 @@ static void arcmsr_enable_allintr( struc } break; } - return; } /* ********************************************************************** @@ -431,7 +435,7 @@ static u_int8_t arcmsr_hba_wait_msgint_r UDELAY(10000); }/*max 1 seconds*/ }while(Retries++ < 20);/*max 20 sec*/ - return FALSE; + return (FALSE); } /* ********************************************************************** @@ -452,7 +456,7 @@ static u_int8_t arcmsr_hbb_wait_msgint_r UDELAY(10000); }/*max 1 seconds*/ }while(Retries++ < 20);/*max 20 sec*/ - return FALSE; + return (FALSE); } /* ********************************************************************** @@ -472,7 +476,7 @@ static u_int8_t arcmsr_hbc_wait_msgint_r UDELAY(10000); }/*max 1 seconds*/ }while(Retries++ < 20);/*max 20 sec*/ - return FALSE; + return (FALSE); } /* ************************************************************************ @@ -490,7 +494,6 @@ static void arcmsr_flush_hba_cache(struc retry_count--; } }while(retry_count!=0); - return; } /* ************************************************************************ @@ -509,7 +512,6 @@ static void arcmsr_flush_hbb_cache(struc retry_count--; } }while(retry_count!=0); - return; } /* ************************************************************************ @@ -528,7 +530,6 @@ static void arcmsr_flush_hbc_cache(struc retry_count--; } }while(retry_count!=0); - return; } /* ************************************************************************ @@ -550,7 +551,6 @@ static void arcmsr_flush_adapter_cache(s } break; } - return; } /* ******************************************************************************* @@ -596,7 +596,7 @@ static void arcmsr_async(void *cb_arg, u if((target_id > ARCMSR_MAX_TARGETID) || (target_lun > ARCMSR_MAX_TARGETLUN)) { break; } - printf("%s:scsi id=%d lun=%d device lost \n", device_get_name(acb->pci_dev), target_id, target_lun); + // printf("%s:scsi id=%d lun=%d device lost \n", device_get_name(acb->pci_dev), target_id, target_lun); break; default: break; @@ -612,14 +612,13 @@ static void arcmsr_report_sense_info(str pccb->ccb_h.status |= CAM_SCSI_STATUS_ERROR; pccb->csio.scsi_status = SCSI_STATUS_CHECK_COND; - if(&pccb->csio.sense_data) { + if(pccb->csio.sense_len) { memset(&pccb->csio.sense_data, 0, sizeof(pccb->csio.sense_data)); memcpy(&pccb->csio.sense_data, srb->arcmsr_cdb.SenseData, get_min(sizeof(struct SENSE_DATA), sizeof(pccb->csio.sense_data))); ((u_int8_t *)&pccb->csio.sense_data)[0] = (0x1 << 7 | 0x70); /* Valid,ErrorCode */ pccb->ccb_h.status |= CAM_AUTOSNS_VALID; } - return; } /* ********************************************************************* @@ -631,7 +630,6 @@ static void arcmsr_abort_hba_allcmd(stru if(!arcmsr_hba_wait_msgint_ready(acb)) { printf("arcmsr%d: wait 'abort all outstanding command' timeout \n", acb->pci_unit); } - return; } /* ********************************************************************* @@ -643,7 +641,6 @@ static void arcmsr_abort_hbb_allcmd(stru if(!arcmsr_hbb_wait_msgint_ready(acb)) { printf("arcmsr%d: wait 'abort all outstanding command' timeout \n", acb->pci_unit); } - return; } /* ********************************************************************* @@ -656,7 +653,6 @@ static void arcmsr_abort_hbc_allcmd(stru if(!arcmsr_hbc_wait_msgint_ready(acb)) { printf("arcmsr%d: wait 'abort all outstanding command' timeout \n", acb->pci_unit); } - return; } /* ********************************************************************* @@ -678,7 +674,6 @@ static void arcmsr_abort_allcmd(struct A } break; } - return; } /* ********************************************************************** @@ -716,7 +711,6 @@ static void arcmsr_srb_complete(struct C acb->pktReturnCount++; #endif xpt_done(pccb); - return; } /* ************************************************************************** @@ -768,7 +762,6 @@ static void arcmsr_report_srb_state(stru break; } } - return; } /* ************************************************************************** @@ -801,7 +794,6 @@ static void arcmsr_drain_donequeue(struc return; } arcmsr_report_srb_state(acb, srb, error); - return; } /* ************************************************************************** @@ -883,7 +875,6 @@ static void arcmsr_done4abort_postqueue( } break; } - return; } /* **************************************************************************** @@ -923,7 +914,6 @@ static void arcmsr_iop_reset(struct Adap acb->pktRequestCount = 0; acb->pktReturnCount = 0; #endif - return; } /* ********************************************************************** @@ -1011,7 +1001,6 @@ static void arcmsr_build_srb(struct Comm arcmsr_cdb->DataLength = 0; } srb->arc_cdb_size=arccdbsize; - return; } /* ************************************************************************** @@ -1072,7 +1061,6 @@ static void arcmsr_post_srb(struct Adapt } break; } - return; } /* ************************************************************************ @@ -1156,7 +1144,6 @@ static void arcmsr_iop_message_read(stru CHIP_REG_WRITE32(HBC_MessageUnit, 0, inbound_doorbell, ARCMSR_HBCMU_DRV2IOP_DATA_READ_OK); } } - return; } /* ************************************************************************** @@ -1221,7 +1208,6 @@ static void arcmsr_post_ioctldata2iop(st */ arcmsr_iop_message_wrote(acb); } - return; } /* ************************************************************************ @@ -1236,7 +1222,6 @@ static void arcmsr_stop_hba_bgrb(struct printf("arcmsr%d: wait 'stop adapter background rebulid' timeout \n" , acb->pci_unit); } - return; } /* ************************************************************************ @@ -1251,7 +1236,6 @@ static void arcmsr_stop_hbb_bgrb(struct printf( "arcmsr%d: wait 'stop adapter background rebulid' timeout \n" , acb->pci_unit); } - return; } /* ************************************************************************ @@ -1265,7 +1249,6 @@ static void arcmsr_stop_hbc_bgrb(struct if(!arcmsr_hbc_wait_msgint_ready(acb)) { printf("arcmsr%d: wait 'stop adapter background rebulid' timeout \n", acb->pci_unit); } - return; } /* ************************************************************************ @@ -1287,7 +1270,6 @@ static void arcmsr_stop_adapter_bgrb(str } break; } - return; } /* ************************************************************************ @@ -1305,7 +1287,6 @@ static void arcmsr_poll(struct cam_sim * arcmsr_interrupt(acb); if( mutex == 0 ) ARCMSR_LOCK_RELEASE(&acb->qbuffer_lock); - return; } /* ************************************************************************** @@ -1340,7 +1321,6 @@ static void arcmsr_iop2drv_data_wrote_ha } else { acb->acb_flags|=ACB_F_IOPDATA_OVERFLOW; } - return; } /* ************************************************************************** @@ -1383,7 +1363,6 @@ static void arcmsr_iop2drv_data_read_han if(acb->wqbuf_firstindex==acb->wqbuf_lastindex) { acb->acb_flags |= ACB_F_MESSAGE_WQBUFFER_CLEARED; } - return; } static void arcmsr_rescanLun_cb(struct cam_periph *periph, union ccb *ccb) @@ -1417,7 +1396,6 @@ static void arcmsr_rescan_lun(struct Ada ccb->ccb_h.cbfcnp = arcmsr_rescanLun_cb; ccb->crcn.flags = CAM_FLAG_NONE; xpt_action(ccb); - return; } @@ -1488,6 +1466,7 @@ static void arcmsr_dr_handle(struct Adap } break; } + if(acb->acb_flags & ACB_F_BUS_HANG_ON) { acb->acb_flags &= ~ACB_F_BUS_HANG_ON; @@ -1592,7 +1571,6 @@ static void arcmsr_hba_doorbell_isr(stru if(outbound_doorbell & ARCMSR_OUTBOUND_IOP331_DATA_READ_OK) { arcmsr_iop2drv_data_read_handle(acb); } - return; } /* ************************************************************************** @@ -1620,7 +1598,6 @@ static void arcmsr_hbc_doorbell_isr(stru if(outbound_doorbell & ARCMSR_HBCMU_IOP2DRV_MESSAGE_CMD_DONE) { arcmsr_hbc_message_isr(acb); /* messenger of "driver to iop commands" */ } - return; } /* ************************************************************************** @@ -1644,7 +1621,6 @@ static void arcmsr_hba_postqueue_isr(str error=(flag_srb & ARCMSR_SRBREPLY_FLAG_ERROR_MODE0)?TRUE:FALSE; arcmsr_drain_donequeue(acb, flag_srb, error); } /*drain reply FIFO*/ - return; } /* ************************************************************************** @@ -1674,7 +1650,6 @@ static void arcmsr_hbb_postqueue_isr(str error=(flag_srb & ARCMSR_SRBREPLY_FLAG_ERROR_MODE0)?TRUE:FALSE; arcmsr_drain_donequeue(acb, flag_srb, error); } /*drain reply FIFO*/ - return; } /* ************************************************************************** @@ -1704,7 +1679,6 @@ static void arcmsr_hbc_postqueue_isr(str } throttling++; } /*drain reply FIFO*/ - return; } /* ********************************************************************** @@ -1712,30 +1686,29 @@ static void arcmsr_hbc_postqueue_isr(str */ static void arcmsr_handle_hba_isr( struct AdapterControlBlock *acb) { - u_int32_t outbound_intstatus; + u_int32_t outbound_intStatus; /* ********************************************* ** check outbound intstatus ********************************************* */ - outbound_intstatus=CHIP_REG_READ32(HBA_MessageUnit, 0, outbound_intstatus) & acb->outbound_int_enable; - if(!outbound_intstatus) { + outbound_intStatus=CHIP_REG_READ32(HBA_MessageUnit, 0, outbound_intstatus) & acb->outbound_int_enable; + if(!outbound_intStatus) { /*it must be share irq*/ return; } - CHIP_REG_WRITE32(HBA_MessageUnit, 0, outbound_intstatus, outbound_intstatus);/*clear interrupt*/ + CHIP_REG_WRITE32(HBA_MessageUnit, 0, outbound_intstatus, outbound_intStatus);/*clear interrupt*/ /* MU doorbell interrupts*/ - if(outbound_intstatus & ARCMSR_MU_OUTBOUND_DOORBELL_INT) { + if(outbound_intStatus & ARCMSR_MU_OUTBOUND_DOORBELL_INT) { arcmsr_hba_doorbell_isr(acb); } /* MU post queue interrupts*/ - if(outbound_intstatus & ARCMSR_MU_OUTBOUND_POSTQUEUE_INT) { + if(outbound_intStatus & ARCMSR_MU_OUTBOUND_POSTQUEUE_INT) { arcmsr_hba_postqueue_isr(acb); } - if(outbound_intstatus & ARCMSR_MU_OUTBOUND_MESSAGE0_INT) { + if(outbound_intStatus & ARCMSR_MU_OUTBOUND_MESSAGE0_INT) { arcmsr_hba_message_isr(acb); } - return; } /* ********************************************************************** @@ -1771,7 +1744,6 @@ static void arcmsr_handle_hbb_isr( struc if(outbound_doorbell & ARCMSR_IOP2DRV_MESSAGE_CMD_DONE) { arcmsr_hbb_message_isr(acb); } - return; } /* ********************************************************************** @@ -1798,7 +1770,6 @@ static void arcmsr_handle_hbc_isr( struc if(host_interrupt_status & ARCMSR_HBCMU_OUTBOUND_POSTQUEUE_ISR) { arcmsr_hbc_postqueue_isr(acb); } - return; } /* ****************************************************************************** @@ -1821,7 +1792,6 @@ static void arcmsr_interrupt(struct Adap " unknow adapter type =%d\n", acb->pci_unit, acb->adapter_type); break; } - return; } /* ********************************************************************** @@ -1844,7 +1814,7 @@ static void arcmsr_polling_devmap(void* struct AdapterControlBlock *acb = (struct AdapterControlBlock *)arg; switch (acb->adapter_type) { case ACB_ADAPTER_TYPE_A: - CHIP_REG_WRITE32(HBC_MessageUnit, 0, inbound_msgaddr0, ARCMSR_INBOUND_MESG0_GET_CONFIG); + CHIP_REG_WRITE32(HBA_MessageUnit, 0, inbound_msgaddr0, ARCMSR_INBOUND_MESG0_GET_CONFIG); break; case ACB_ADAPTER_TYPE_B: @@ -2065,7 +2035,7 @@ u_int32_t arcmsr_iop_ioctlcmd(struct Ada break; } ARCMSR_LOCK_RELEASE(&acb->qbuffer_lock); - return retvalue; + return (retvalue); } /* ************************************************************************** @@ -2191,7 +2161,7 @@ static int arcmsr_iop_message_xfer(struc if (wqbuf_lastindex != wqbuf_firstindex) { arcmsr_post_ioctldata2iop(acb); /* has error report sensedata */ - if(&pccb->csio.sense_data) { + if(pccb->csio.sense_len) { ((u_int8_t *)&pccb->csio.sense_data)[0] = (0x1 << 7 | 0x70); /* Valid,ErrorCode */ ((u_int8_t *)&pccb->csio.sense_data)[2] = 0x05; @@ -2221,7 +2191,7 @@ static int arcmsr_iop_message_xfer(struc } } else { /* has error report sensedata */ - if(&pccb->csio.sense_data) { + if(pccb->csio.sense_len) { ((u_int8_t *)&pccb->csio.sense_data)[0] = (0x1 << 7 | 0x70); /* Valid,ErrorCode */ ((u_int8_t *)&pccb->csio.sense_data)[2] = 0x05; @@ -2312,7 +2282,7 @@ static int arcmsr_iop_message_xfer(struc retvalue = ARCMSR_MESSAGE_FAIL; } message_out: - return retvalue; + return (retvalue); } /* ********************************************************************* @@ -2375,7 +2345,7 @@ static void arcmsr_execute_srb(void *arg arcmsr_srb_complete(srb, 0); return; } - if(acb->srboutstandingcount >= ARCMSR_MAX_OUTSTANDING_CMD) { + if(acb->srboutstandingcount > ARCMSR_MAX_OUTSTANDING_CMD) { xpt_freeze_simq(acb->psim, 1); pccb->ccb_h.status = CAM_REQUEUE_REQ; acb->acb_flags |= ACB_F_CAM_DEV_QFRZN; @@ -2388,10 +2358,9 @@ static void arcmsr_execute_srb(void *arg if (pccb->ccb_h.timeout != CAM_TIME_INFINITY) { arcmsr_callout_init(&srb->ccb_callout); - callout_reset(&srb->ccb_callout, (pccb->ccb_h.timeout * hz ) / 1000, arcmsr_srb_timeout, srb); + callout_reset(&srb->ccb_callout, ((pccb->ccb_h.timeout + (ARCMSR_TIMEOUT_DELAY * 1000)) * hz) / 1000, arcmsr_srb_timeout, srb); srb->srb_flags |= SRB_FLAG_TIMER_START; } - return; } /* ***************************************************************************************** @@ -2455,7 +2424,6 @@ static void arcmsr_bus_reset(struct Adap } arcmsr_iop_reset(acb); acb->acb_flags &= ~ACB_F_BUS_RESET; - return; } /* ************************************************************************** @@ -2607,10 +2575,24 @@ static void arcmsr_action(struct cam_sim strncpy(cpi->dev_name, cam_sim_name(psim), DEV_IDLEN); cpi->unit_number=cam_sim_unit(psim); #ifdef CAM_NEW_TRAN_CODE - cpi->transport = XPORT_SPI; - cpi->transport_version = 2; + if(acb->adapter_bus_speed == ACB_BUS_SPEED_6G) + cpi->base_transfer_speed = 600000; + else + cpi->base_transfer_speed = 300000; + if((acb->vendor_device_id == PCIDevVenIDARC1880) || + (acb->vendor_device_id == PCIDevVenIDARC1680)) + { + cpi->transport = XPORT_SAS; + cpi->transport_version = 0; + cpi->protocol_version = SCSI_REV_SPC2; + } + else + { + cpi->transport = XPORT_SPI; + cpi->transport_version = 2; + cpi->protocol_version = SCSI_REV_2; + } cpi->protocol = PROTO_SCSI; - cpi->protocol_version = SCSI_REV_2; #endif cpi->ccb_h.status |= CAM_REQ_CMP; xpt_done(pccb); @@ -2674,28 +2656,46 @@ static void arcmsr_action(struct cam_sim { struct ccb_trans_settings_scsi *scsi; struct ccb_trans_settings_spi *spi; + struct ccb_trans_settings_sas *sas; scsi = &cts->proto_specific.scsi; - spi = &cts->xport_specific.spi; - cts->protocol = PROTO_SCSI; - cts->protocol_version = SCSI_REV_2; - cts->transport = XPORT_SPI; - cts->transport_version = 2; - spi->flags = CTS_SPI_FLAGS_DISC_ENB; - spi->sync_period=3; - spi->sync_offset=32; - spi->bus_width=MSG_EXT_WDTR_BUS_16_BIT; scsi->flags = CTS_SCSI_FLAGS_TAG_ENB; - spi->valid = CTS_SPI_VALID_DISC - | CTS_SPI_VALID_SYNC_RATE - | CTS_SPI_VALID_SYNC_OFFSET - | CTS_SPI_VALID_BUS_WIDTH; scsi->valid = CTS_SCSI_VALID_TQ; + cts->protocol = PROTO_SCSI; + + if((acb->vendor_device_id == PCIDevVenIDARC1880) || + (acb->vendor_device_id == PCIDevVenIDARC1680)) + { + cts->protocol_version = SCSI_REV_SPC2; + cts->transport_version = 0; + cts->transport = XPORT_SAS; + sas = &cts->xport_specific.sas; + sas->valid = CTS_SAS_VALID_SPEED; + if(acb->vendor_device_id == PCIDevVenIDARC1880) + sas->bitrate = 600000; + else if(acb->vendor_device_id == PCIDevVenIDARC1680) + sas->bitrate = 300000; + } + else + { + cts->protocol_version = SCSI_REV_2; + cts->transport_version = 2; + cts->transport = XPORT_SPI; + spi = &cts->xport_specific.spi; + spi->flags = CTS_SPI_FLAGS_DISC_ENB; + spi->sync_period=2; + spi->sync_offset=32; + spi->bus_width=MSG_EXT_WDTR_BUS_16_BIT; + spi->valid = CTS_SPI_VALID_DISC + | CTS_SPI_VALID_SYNC_RATE + | CTS_SPI_VALID_SYNC_OFFSET + | CTS_SPI_VALID_BUS_WIDTH; + } } #else { cts->flags=(CCB_TRANS_DISC_ENB | CCB_TRANS_TAG_ENB); - cts->sync_period=3; + cts->sync_period=2; cts->sync_offset=32; cts->bus_width=MSG_EXT_WDTR_BUS_16_BIT; cts->valid=CCB_TRANS_SYNC_RATE_VALID | @@ -2759,7 +2759,6 @@ static void arcmsr_action(struct cam_sim xpt_done(pccb); break; } - return; } /* ********************************************************************** @@ -2772,7 +2771,6 @@ static void arcmsr_start_hba_bgrb(struct if(!arcmsr_hba_wait_msgint_ready(acb)) { printf("arcmsr%d: wait 'start adapter background rebulid' timeout \n", acb->pci_unit); } - return; } /* ********************************************************************** @@ -2785,7 +2783,6 @@ static void arcmsr_start_hbb_bgrb(struct if(!arcmsr_hbb_wait_msgint_ready(acb)) { printf( "arcmsr%d: wait 'start adapter background rebulid' timeout \n", acb->pci_unit); } - return; } /* ********************************************************************** @@ -2799,7 +2796,6 @@ static void arcmsr_start_hbc_bgrb(struct if(!arcmsr_hbc_wait_msgint_ready(acb)) { printf("arcmsr%d: wait 'start adapter background rebulid' timeout \n", acb->pci_unit); } - return; } /* ********************************************************************** @@ -2818,7 +2814,6 @@ static void arcmsr_start_adapter_bgrb(st arcmsr_start_hbc_bgrb(acb); break; } - return; } /* ********************************************************************** @@ -2873,7 +2868,6 @@ polling_ccb_retry: } arcmsr_report_srb_state(acb, srb, error); } /*drain reply FIFO*/ - return; } /* ********************************************************************** @@ -2934,7 +2928,6 @@ polling_ccb_retry: } arcmsr_report_srb_state(acb, srb, error); } /*drain reply FIFO*/ - return; } /* ********************************************************************** @@ -2985,7 +2978,6 @@ polling_ccb_retry: } arcmsr_report_srb_state(acb, srb, error); } /*drain reply FIFO*/ - return; } /* ********************************************************************** @@ -3053,7 +3045,6 @@ static void arcmsr_get_hba_config(struct acb->firm_sdram_size=CHIP_REG_READ32(HBA_MessageUnit, 0, msgcode_rwbuffer[3]); /*firm_sdram_size, 3, 12-15*/ acb->firm_ide_channels=CHIP_REG_READ32(HBA_MessageUnit, 0, msgcode_rwbuffer[4]); /*firm_ide_channels, 4, 16-19*/ acb->firm_cfg_version=CHIP_REG_READ32(HBA_MessageUnit, 0, msgcode_rwbuffer[ARCMSR_FW_CFGVER_OFFSET]); /*firm_cfg_version, 25, */ - return; } /* ********************************************************************** @@ -3100,7 +3091,6 @@ static void arcmsr_get_hbb_config(struct acb->firm_sdram_size=CHIP_REG_READ32(HBB_RWBUFFER, 1, msgcode_rwbuffer[3]); /*firm_sdram_size, 3, 12-15*/ acb->firm_ide_channels=CHIP_REG_READ32(HBB_RWBUFFER, 1, msgcode_rwbuffer[4]); /*firm_ide_channels, 4, 16-19*/ acb->firm_cfg_version=CHIP_REG_READ32(HBB_RWBUFFER, 1, msgcode_rwbuffer[ARCMSR_FW_CFGVER_OFFSET]); /*firm_cfg_version, 25, */ - return; } /* ********************************************************************** @@ -3148,7 +3138,6 @@ static void arcmsr_get_hbc_config(struct acb->firm_sdram_size =CHIP_REG_READ32(HBC_MessageUnit, 0, msgcode_rwbuffer[3]); /*firm_sdram_size, 3, 12-15*/ acb->firm_ide_channels =CHIP_REG_READ32(HBC_MessageUnit, 0, msgcode_rwbuffer[4]); /*firm_ide_channels, 4, 16-19*/ acb->firm_cfg_version =CHIP_REG_READ32(HBC_MessageUnit, 0, msgcode_rwbuffer[ARCMSR_FW_CFGVER_OFFSET]); /*firm_cfg_version, 25, */ - return; } /* ********************************************************************** @@ -3170,7 +3159,6 @@ static void arcmsr_get_firmware_spec(str } break; } - return; } /* ********************************************************************** @@ -3219,7 +3207,6 @@ static void arcmsr_wait_firmware_ready( } break; } - return; } /* ********************************************************************** @@ -3253,7 +3240,6 @@ static void arcmsr_clear_doorbell_queue_ } break; } - return; } /* ************************************************************************ @@ -3336,7 +3322,7 @@ static u_int32_t arcmsr_iop_confirm(stru } break; } - return TRUE; + return (TRUE); } /* ************************************************************************ @@ -3359,7 +3345,6 @@ static void arcmsr_enable_eoi_mode(struc } break; } - return; } /* ********************************************************************** @@ -3382,7 +3367,6 @@ static void arcmsr_iop_init(struct Adapt /* enable outbound Post Queue, outbound doorbell Interrupt */ arcmsr_enable_allintr(acb, intmask_org); acb->acb_flags |=ACB_F_IOP_INITED; - return; } /* ********************************************************************** @@ -3414,7 +3398,6 @@ static void arcmsr_map_free_srb(void *ar srb_tmp = (struct CommandControlBlock *)((unsigned long)srb_tmp+SRB_SIZE); } acb->vir2phy_offset=(unsigned long)srb_tmp-(unsigned long)srb_phyaddr; - return; } /* ************************************************************************ @@ -3433,7 +3416,6 @@ static void arcmsr_free_resource(struct bus_dma_tag_destroy(acb->srb_dmat); bus_dma_tag_destroy(acb->dm_segs_dmat); bus_dma_tag_destroy(acb->parent_dmat); - return; } /* ************************************************************************ @@ -3444,16 +3426,24 @@ static u_int32_t arcmsr_initialize(devic struct AdapterControlBlock *acb=device_get_softc(dev); u_int16_t pci_command; int i, j,max_coherent_size; - - switch (pci_get_devid(dev)) { - case PCIDevVenIDARC1880: { + u_int32_t vendor_dev_id; + + vendor_dev_id = pci_get_devid(dev); + acb->vendor_device_id = vendor_dev_id; + switch (vendor_dev_id) { + case PCIDevVenIDARC1880: + case PCIDevVenIDARC1882: + case PCIDevVenIDARC1213: + case PCIDevVenIDARC1223: { acb->adapter_type=ACB_ADAPTER_TYPE_C; + acb->adapter_bus_speed = ACB_BUS_SPEED_6G; max_coherent_size=ARCMSR_SRBS_POOL_SIZE; } break; case PCIDevVenIDARC1200: case PCIDevVenIDARC1201: { acb->adapter_type=ACB_ADAPTER_TYPE_B; + acb->adapter_bus_speed = ACB_BUS_SPEED_3G; max_coherent_size=ARCMSR_SRBS_POOL_SIZE+(sizeof(struct HBB_MessageUnit)); } break; @@ -3477,6 +3467,7 @@ static u_int32_t arcmsr_initialize(devic case PCIDevVenIDARC1680: case PCIDevVenIDARC1681: { acb->adapter_type=ACB_ADAPTER_TYPE_A; + acb->adapter_bus_speed = ACB_BUS_SPEED_3G; max_coherent_size=ARCMSR_SRBS_POOL_SIZE; } break; @@ -3804,7 +3795,7 @@ static int arcmsr_attach(device_t dev) #endif arcmsr_callout_init(&acb->devmap_callout); callout_reset(&acb->devmap_callout, 60 * hz, arcmsr_polling_devmap, acb); - return 0; + return (0); } /* @@ -3851,6 +3842,9 @@ static int arcmsr_probe(device_t dev) type = "SAS 3G"; break; case PCIDevVenIDARC1880: + case PCIDevVenIDARC1882: + case PCIDevVenIDARC1213: + case PCIDevVenIDARC1223: type = "SAS 6G"; break; default: Modified: stable/8/sys/dev/arcmsr/arcmsr.h ============================================================================== --- stable/8/sys/dev/arcmsr/arcmsr.h Wed Sep 19 22:26:05 2012 (r240714) +++ stable/8/sys/dev/arcmsr/arcmsr.h Wed Sep 19 23:03:54 2012 (r240715) @@ -52,6 +52,7 @@ #define ARCMSR_MAX_ADAPTER 4 #define ARCMSR_RELEASE_SIMQ_LEVEL 230 #define ARCMSR_MAX_HBB_POSTQUEUE 264 /* (ARCMSR_MAX_OUTSTANDING_CMD+8) */ +#define ARCMSR_TIMEOUT_DELAY 60 /* in sec */ /* ********************************************************************* */ @@ -97,6 +98,13 @@ #define PCI_DEVICE_ID_ARECA_1681 0x1681 /* Device ID */ #define PCI_DEVICE_ID_ARECA_1880 0x1880 /* Device ID */ +#define ARECA_SUB_DEV_ID_1880 0x1880 /* Subsystem Device ID */ +#define ARECA_SUB_DEV_ID_1882 0x1882 /* Subsystem Device ID */ +#define ARECA_SUB_DEV_ID_1212 0x1212 /* Subsystem Device ID */ +#define ARECA_SUB_DEV_ID_1213 0x1213 /* Subsystem Device ID */ +#define ARECA_SUB_DEV_ID_1222 0x1222 /* Subsystem Device ID */ +#define ARECA_SUB_DEV_ID_1223 0x1223 /* Subsystem Device ID */ + #define PCIDevVenIDARC1110 0x111017D3 /* Vendor Device ID */ #define PCIDevVenIDARC1120 0x112017D3 /* Vendor Device ID */ #define PCIDevVenIDARC1130 0x113017D3 /* Vendor Device ID */ @@ -106,8 +114,10 @@ #define PCIDevVenIDARC1201 0x120117D3 /* Vendor Device ID */ #define PCIDevVenIDARC1210 0x121017D3 /* Vendor Device ID */ #define PCIDevVenIDARC1212 0x121217D3 /* Vendor Device ID */ +#define PCIDevVenIDARC1213 0x121317D3 /* Vendor Device ID */ #define PCIDevVenIDARC1220 0x122017D3 /* Vendor Device ID */ #define PCIDevVenIDARC1222 0x122217D3 /* Vendor Device ID */ +#define PCIDevVenIDARC1223 0x122317D3 /* Vendor Device ID */ #define PCIDevVenIDARC1230 0x123017D3 /* Vendor Device ID */ #define PCIDevVenIDARC1231 0x123117D3 /* Vendor Device ID */ #define PCIDevVenIDARC1260 0x126017D3 /* Vendor Device ID */ @@ -119,6 +129,7 @@ #define PCIDevVenIDARC1680 0x168017D3 /* Vendor Device ID */ #define PCIDevVenIDARC1681 0x168117D3 /* Vendor Device ID */ #define PCIDevVenIDARC1880 0x188017D3 /* Vendor Device ID */ +#define PCIDevVenIDARC1882 0x188217D3 /* Vendor Device ID */ #ifndef PCIR_BARS #define PCIR_BARS 0x10 @@ -830,6 +841,8 @@ struct AdapterControlBlock { u_int32_t pktRequestCount; u_int32_t pktReturnCount; #endif + u_int32_t vendor_device_id; + u_int32_t adapter_bus_speed; };/* HW_DEVICE_EXTENSION */ /* acb_flags */ #define ACB_F_SCSISTOPADAPTER 0x0001 @@ -848,6 +861,10 @@ struct AdapterControlBlock { /* devstate */ #define ARECA_RAID_GONE 0x55 #define ARECA_RAID_GOOD 0xaa +/* adapter_bus_speed */ +#define ACB_BUS_SPEED_3G 0 +#define ACB_BUS_SPEED_6G 1 +#define ACB_BUS_SPEED_12G 2 /* ********************************************************************* ** Message Unit structure *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Sep 19 23:25:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 893E51065670; Wed, 19 Sep 2012 23:25:25 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6FCE28FC08; Wed, 19 Sep 2012 23:25:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8JNPPCr094369; Wed, 19 Sep 2012 23:25:25 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8JNPPtK094348; Wed, 19 Sep 2012 23:25:25 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201209192325.q8JNPPtK094348@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 19 Sep 2012 23:25:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240716 - in head/sys/contrib/dev/acpica: . common compiler components/debugger components/disassembler components/tables include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Sep 2012 23:25:25 -0000 Author: jkim Date: Wed Sep 19 23:25:24 2012 New Revision: 240716 URL: http://svn.freebsd.org/changeset/base/240716 Log: Merge ACPICA 20120913. Modified: head/sys/contrib/dev/acpica/changes.txt (contents, props changed) head/sys/contrib/dev/acpica/common/dmrestag.c head/sys/contrib/dev/acpica/compiler/aslcompile.c head/sys/contrib/dev/acpica/compiler/aslcompiler.h head/sys/contrib/dev/acpica/compiler/aslerror.c head/sys/contrib/dev/acpica/compiler/aslfiles.c head/sys/contrib/dev/acpica/compiler/aslfold.c head/sys/contrib/dev/acpica/compiler/aslglobal.h head/sys/contrib/dev/acpica/compiler/aslmain.c head/sys/contrib/dev/acpica/compiler/aslmessages.h head/sys/contrib/dev/acpica/compiler/asloperands.c head/sys/contrib/dev/acpica/compiler/aslopt.c head/sys/contrib/dev/acpica/compiler/aslstartup.c head/sys/contrib/dev/acpica/compiler/aslsupport.l head/sys/contrib/dev/acpica/compiler/asltypes.h head/sys/contrib/dev/acpica/compiler/aslutils.c head/sys/contrib/dev/acpica/compiler/dtio.c head/sys/contrib/dev/acpica/compiler/preprocess.h head/sys/contrib/dev/acpica/components/debugger/dbexec.c head/sys/contrib/dev/acpica/components/debugger/dbinput.c head/sys/contrib/dev/acpica/components/debugger/dbmethod.c head/sys/contrib/dev/acpica/components/debugger/dbnames.c head/sys/contrib/dev/acpica/components/debugger/dbstats.c head/sys/contrib/dev/acpica/components/debugger/dbutils.c head/sys/contrib/dev/acpica/components/disassembler/dmopcode.c head/sys/contrib/dev/acpica/components/tables/tbinstal.c head/sys/contrib/dev/acpica/components/tables/tbxface.c head/sys/contrib/dev/acpica/include/acdebug.h head/sys/contrib/dev/acpica/include/acpixf.h head/sys/contrib/dev/acpica/include/actbl1.h Directory Properties: head/sys/contrib/dev/acpica/ (props changed) head/sys/contrib/dev/acpica/common/ (props changed) head/sys/contrib/dev/acpica/compiler/ (props changed) head/sys/contrib/dev/acpica/components/debugger/ (props changed) head/sys/contrib/dev/acpica/components/disassembler/ (props changed) head/sys/contrib/dev/acpica/components/tables/ (props changed) head/sys/contrib/dev/acpica/include/ (props changed) Modified: head/sys/contrib/dev/acpica/changes.txt ============================================================================== --- head/sys/contrib/dev/acpica/changes.txt Wed Sep 19 23:03:54 2012 (r240715) +++ head/sys/contrib/dev/acpica/changes.txt Wed Sep 19 23:25:24 2012 (r240716) @@ -1,4 +1,75 @@ ---------------------------------------- +13 September 2012. Summary of changes for version 20120913: + +This release is available at https://www.acpica.org/downloads The ACPI 5.0 +specification is available at www.acpi.info + +1) ACPICA Kernel-resident Subsystem: + +ACPI 5.0: Added two new notify types for the Hardware Error Notification +Structure within the Hardware Error Source Table (HEST) table -- CMCI(5) and +MCE(6). + +Table Manager: Merged/removed duplicate code in the root table resize +functions. One function is external, the other is internal. Lv Zheng, ACPICA +BZ 846. + +Makefiles: Completely removed the obsolete "Linux" makefiles under +acpica/generate/linux. These makefiles are obsolete and have been replaced by +the generic unix makefiles under acpica/generate/unix. + +Makefiles: Ensure that binary files always copied properly. Minor rule change +to ensure that the final binary output files are always copied up to the +appropriate binary directory (bin32 or bin64.) + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The debug +version of the code includes the debug output trace mechanism and has a much +larger code and data size. + + Previous Release: + Non-Debug Version: 93.8K Code, 25.3K Data, 119.1K Total + Debug Version: 175.7K Code, 74.8K Data, 250.5K Total + Current Release: + Non-Debug Version: 93.7K Code, 25.3K Data, 119.0K Total + Debug Version: 175.0K Code, 74.4K Data, 249.4K Total + + +2) iASL Compiler/Disassembler and Tools: + +Disassembler: Fixed a possible fault during the disassembly of resource +descriptors when a second parse is required because of the invocation of +external control methods within the table. With assistance from +adq@lidskialf.net. ACPICA BZ 976. + +iASL: Fixed a namepath optimization problem. An error can occur if the parse +node that contains the namepath to be optimized does not have a parent node +that is a named object. This change fixes the problem. + +iASL: Fixed a regression where the AML file is not deleted on errors. The AML +output file should be deleted if there are any errors during the compiler. The +only exception is if the -f (force output) option is used. ACPICA BZ 974. + +iASL: Added a feature to automatically increase internal line buffer sizes. +Via realloc(), automatically increase the internal line buffer sizes as +necessary to support very long source code lines. The current version of the +preprocessor requires a buffer long enough to contain full source code lines. +This change increases the line buffer(s) if the input lines go beyond the +current buffer size. This eliminates errors that occurred when a source code +line was longer than the buffer. + +iASL: Fixed a problem with constant folding in method declarations. The +SyncLevel term is a ByteConstExpr, and incorrect code would be generated if a +Type3 opcode was used. + +Debugger: Improved command help support. For incorrect argument count, display +full help for the command. For help command itself, allow an argument to +specify a command. + +Test Suites: Several bug fixes for the ASLTS suite reduces the number of +errors during execution of the suite. Guan Chao. + +---------------------------------------- 16 August 2012. Summary of changes for version 20120816: This release is available at https://www.acpica.org/downloads Modified: head/sys/contrib/dev/acpica/common/dmrestag.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmrestag.c Wed Sep 19 23:03:54 2012 (r240715) +++ head/sys/contrib/dev/acpica/common/dmrestag.c Wed Sep 19 23:25:24 2012 (r240716) @@ -469,6 +469,11 @@ AcpiDmCheckResourceReference ( /* Get the Index term, must be an integer constant to convert */ IndexOp = BufferNameOp->Common.Next; + + /* Major cheat: The Node field is also used for the Tag ptr. Clear it now */ + + IndexOp->Common.Node = NULL; + OpInfo = AcpiPsGetOpcodeInfo (IndexOp->Common.AmlOpcode); if (OpInfo->ObjectType != ACPI_TYPE_INTEGER) { Modified: head/sys/contrib/dev/acpica/compiler/aslcompile.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslcompile.c Wed Sep 19 23:03:54 2012 (r240715) +++ head/sys/contrib/dev/acpica/compiler/aslcompile.c Wed Sep 19 23:25:24 2012 (r240716) @@ -800,6 +800,7 @@ CmCleanupAndExit ( void) { UINT32 i; + BOOLEAN DeleteAmlFile = FALSE; AePrintErrorLog (ASL_FILE_STDERR); @@ -851,6 +852,16 @@ CmCleanupAndExit ( UtDisplaySummary (ASL_FILE_STDOUT); + /* + * We will delete the AML file if there are errors and the + * force AML output option has not been used. + */ + if ((Gbl_ExceptionCount[ASL_ERROR] > 0) && (!Gbl_IgnoreErrors) && + Gbl_Files[ASL_FILE_AML_OUTPUT].Handle) + { + DeleteAmlFile = TRUE; + } + /* Close all open files */ Gbl_Files[ASL_FILE_PREPROCESSOR].Handle = NULL; /* the .i file is same as source file */ @@ -862,29 +873,17 @@ CmCleanupAndExit ( /* Delete AML file if there are errors */ - if ((Gbl_ExceptionCount[ASL_ERROR] > 0) && (!Gbl_IgnoreErrors) && - Gbl_Files[ASL_FILE_AML_OUTPUT].Handle) + if (DeleteAmlFile) { - if (remove (Gbl_Files[ASL_FILE_AML_OUTPUT].Filename)) - { - printf ("%s: ", - Gbl_Files[ASL_FILE_AML_OUTPUT].Filename); - perror ("Could not delete AML file"); - } + FlDeleteFile (ASL_FILE_AML_OUTPUT); } /* Delete the preprocessor output file (.i) unless -li flag is set */ if (!Gbl_PreprocessorOutputFlag && - Gbl_PreprocessFlag && - Gbl_Files[ASL_FILE_PREPROCESSOR].Filename) + Gbl_PreprocessFlag) { - if (remove (Gbl_Files[ASL_FILE_PREPROCESSOR].Filename)) - { - printf ("%s: ", - Gbl_Files[ASL_FILE_PREPROCESSOR].Filename); - perror ("Could not delete preprocessor .i file"); - } + FlDeleteFile (ASL_FILE_PREPROCESSOR); } /* @@ -901,14 +900,9 @@ CmCleanupAndExit ( * * TBD: SourceOutput should be .TMP, then rename if we want to keep it? */ - if (!Gbl_SourceOutputFlag && Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Filename) + if (!Gbl_SourceOutputFlag) { - if (remove (Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Filename)) - { - printf ("%s: ", - Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Filename); - perror ("Could not delete SRC file"); - } + FlDeleteFile (ASL_FILE_SOURCE_OUTPUT); } } Modified: head/sys/contrib/dev/acpica/compiler/aslcompiler.h ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslcompiler.h Wed Sep 19 23:03:54 2012 (r240715) +++ head/sys/contrib/dev/acpica/compiler/aslcompiler.h Wed Sep 19 23:25:24 2012 (r240716) @@ -661,6 +661,10 @@ FlPrintFile ( ...); void +FlDeleteFile ( + UINT32 FileId); + +void FlSetLineNumber ( UINT32 LineNumber); @@ -779,6 +783,10 @@ char * UtGetStringBuffer ( UINT32 Length); +void +UtExpandLineBuffers ( + void); + ACPI_STATUS UtInternalizeName ( char *ExternalName, Modified: head/sys/contrib/dev/acpica/compiler/aslerror.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslerror.c Wed Sep 19 23:03:54 2012 (r240715) +++ head/sys/contrib/dev/acpica/compiler/aslerror.c Wed Sep 19 23:25:24 2012 (r240716) @@ -183,6 +183,7 @@ AePrintException ( FILE *SourceFile = NULL; long FileSize; BOOLEAN PrematureEOF = FALSE; + UINT32 Total = 0; if (Gbl_NoErrors) @@ -300,11 +301,21 @@ AePrintException ( "[*** iASL: Read error on source code temp file %s ***]", Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Filename); } - - else while (RActual && SourceByte && (SourceByte != '\n')) + else { - fwrite (&SourceByte, 1, 1, OutputFile); - RActual = fread (&SourceByte, 1, 1, SourceFile); + while (RActual && SourceByte && (SourceByte != '\n') && (Total < 256)) + { + fwrite (&SourceByte, 1, 1, OutputFile); + RActual = fread (&SourceByte, 1, 1, SourceFile); + Total++; + } + + if (Total >= 256) + { + fprintf (OutputFile, + "\n[*** iASL: Long input line, an error occurred at column %u ***]", + Enode->Column); + } } } } @@ -381,20 +392,28 @@ AePrintException ( if (Gbl_VerboseErrors && !PrematureEOF) { - SourceColumn = Enode->Column + Enode->FilenameLength + 6 + 2; - ErrorColumn = ASL_ERROR_LEVEL_LENGTH + 5 + 2 + 1; - - if ((MsgLength + ErrorColumn) < (SourceColumn - 1)) + if (Total >= 256) { - fprintf (OutputFile, "%*s%s", - (int) ((SourceColumn - 1) - ErrorColumn), - MainMessage, " ^ "); + fprintf (OutputFile, " %s", + MainMessage); } else { - fprintf (OutputFile, "%*s %s", - (int) ((SourceColumn - ErrorColumn) + 1), "^", - MainMessage); + SourceColumn = Enode->Column + Enode->FilenameLength + 6 + 2; + ErrorColumn = ASL_ERROR_LEVEL_LENGTH + 5 + 2 + 1; + + if ((MsgLength + ErrorColumn) < (SourceColumn - 1)) + { + fprintf (OutputFile, "%*s%s", + (int) ((SourceColumn - 1) - ErrorColumn), + MainMessage, " ^ "); + } + else + { + fprintf (OutputFile, "%*s %s", + (int) ((SourceColumn - ErrorColumn) + 1), "^", + MainMessage); + } } } else Modified: head/sys/contrib/dev/acpica/compiler/aslfiles.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslfiles.c Wed Sep 19 23:03:54 2012 (r240715) +++ head/sys/contrib/dev/acpica/compiler/aslfiles.c Wed Sep 19 23:25:24 2012 (r240716) @@ -63,6 +63,7 @@ FlParseInputPathname ( #endif + /******************************************************************************* * * FUNCTION: AslAbort @@ -376,6 +377,42 @@ FlCloseFile ( /******************************************************************************* * + * FUNCTION: FlDeleteFile + * + * PARAMETERS: FileId - Index into file info array + * + * RETURN: None + * + * DESCRIPTION: Delete a file. + * + ******************************************************************************/ + +void +FlDeleteFile ( + UINT32 FileId) +{ + ASL_FILE_INFO *Info = &Gbl_Files[FileId]; + + + if (!Info->Filename) + { + return; + } + + if (remove (Info->Filename)) + { + printf ("%s (%s file) ", + Info->Filename, Info->Description); + perror ("Could not delete"); + } + + Info->Filename = NULL; + return; +} + + +/******************************************************************************* + * * FUNCTION: FlSetLineNumber * * PARAMETERS: Op - Parse node for the LINE asl statement Modified: head/sys/contrib/dev/acpica/compiler/aslfold.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslfold.c Wed Sep 19 23:03:54 2012 (r240715) +++ head/sys/contrib/dev/acpica/compiler/aslfold.c Wed Sep 19 23:25:24 2012 (r240716) @@ -200,6 +200,19 @@ OpcAmlCheckForConstant ( DbgPrint (ASL_PARSE_OUTPUT, "[%.4d] Opcode: %12.12s ", Op->Asl.LogicalLineNumber, Op->Asl.ParseOpName); + /* + * These opcodes do not appear in the OpcodeInfo table, but + * they represent constants, so abort the constant walk now. + */ + if ((WalkState->Opcode == AML_RAW_DATA_BYTE) || + (WalkState->Opcode == AML_RAW_DATA_WORD) || + (WalkState->Opcode == AML_RAW_DATA_DWORD) || + (WalkState->Opcode == AML_RAW_DATA_QWORD)) + { + WalkState->WalkType = ACPI_WALK_CONST_OPTIONAL; + return (AE_TYPE); + } + if (!(WalkState->OpInfo->Flags & AML_CONSTANT)) { /* The opcode is not a Type 3/4/5 opcode */ @@ -254,8 +267,8 @@ OpcAmlCheckForConstant ( { DbgPrint (ASL_PARSE_OUTPUT, " TERMARG"); } - DbgPrint (ASL_PARSE_OUTPUT, "\n"); + DbgPrint (ASL_PARSE_OUTPUT, "\n"); return (AE_OK); } Modified: head/sys/contrib/dev/acpica/compiler/aslglobal.h ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslglobal.h Wed Sep 19 23:03:54 2012 (r240715) +++ head/sys/contrib/dev/acpica/compiler/aslglobal.h Wed Sep 19 23:25:24 2012 (r240716) @@ -63,6 +63,41 @@ #endif +#ifdef _DECLARE_GLOBALS +UINT32 Gbl_ExceptionCount[ASL_NUM_REPORT_LEVELS] = {0,0,0,0,0,0}; +char AslHexLookup[] = +{ + '0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F' +}; + + +/* Table below must match ASL_FILE_TYPES in asltypes.h */ + +ASL_FILE_INFO Gbl_Files [ASL_NUM_FILES] = +{ + {NULL, NULL, "stdout: ", "Standard Output"}, + {NULL, NULL, "stderr: ", "Standard Error"}, + {NULL, NULL, "Table Input: ", "Source Input"}, + {NULL, NULL, "Binary Output:", "AML Output"}, + {NULL, NULL, "Source Output:", "Source Output"}, + {NULL, NULL, "Preprocessor: ", "Preprocessor Output"}, + {NULL, NULL, "Listing File: ", "Listing Output"}, + {NULL, NULL, "Hex Dump: ", "Hex Table Output"}, + {NULL, NULL, "Namespace: ", "Namespace Output"}, + {NULL, NULL, "Debug File: ", "Debug Output"}, + {NULL, NULL, "ASM Source: ", "Assembly Code Output"}, + {NULL, NULL, "C Source: ", "C Code Output"}, + {NULL, NULL, "ASM Include: ", "Assembly Header Output"}, + {NULL, NULL, "C Include: ", "C Header Output"} +}; + +#else +extern UINT32 Gbl_ExceptionCount[ASL_NUM_REPORT_LEVELS]; +extern char AslHexLookup[]; +extern ASL_FILE_INFO Gbl_Files [ASL_NUM_FILES]; +#endif + + /* * Parser and other externals */ @@ -74,21 +109,22 @@ extern int PrPa extern const ASL_MAPPING_ENTRY AslKeywordMapping[]; extern char *AslCompilertext; -#define ASL_LINE_BUFFER_SIZE (4096 * 4) /* 16K */ -#define ASL_MSG_BUFFER_SIZE 4096 -#define HEX_TABLE_LINE_SIZE 8 -#define HEX_LISTING_LINE_SIZE 8 +#define ASL_DEFAULT_LINE_BUFFER_SIZE (1024 * 32) /* 32K */ +#define ASL_MSG_BUFFER_SIZE 4096 +#define HEX_TABLE_LINE_SIZE 8 +#define HEX_LISTING_LINE_SIZE 8 /* Source code buffers and pointers for error reporting */ -ASL_EXTERN char Gbl_CurrentLineBuffer[ASL_LINE_BUFFER_SIZE]; +ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_CurrentLineBuffer, NULL); +ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_LineBufPtr, NULL); +ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_LineBufferSize, ASL_DEFAULT_LINE_BUFFER_SIZE); ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_CurrentColumn, 0); ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_PreviousLineNumber, 0); ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_CurrentLineNumber, 1); ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_LogicalLineNumber, 1); ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_CurrentLineOffset, 0); -ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_LineBufPtr, Gbl_CurrentLineBuffer); /* Exception reporting */ @@ -135,18 +171,16 @@ ASL_EXTERN BOOLEAN ASL_ ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_CompileGeneric, FALSE); -#define HEX_OUTPUT_NONE 0 -#define HEX_OUTPUT_C 1 -#define HEX_OUTPUT_ASM 2 -#define HEX_OUTPUT_ASL 3 +#define HEX_OUTPUT_NONE 0 +#define HEX_OUTPUT_C 1 +#define HEX_OUTPUT_ASM 2 +#define HEX_OUTPUT_ASL 3 ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_HexOutputFlag, HEX_OUTPUT_NONE); /* Files */ -ASL_EXTERN ASL_FILE_INFO Gbl_Files [ASL_NUM_FILES]; - ASL_EXTERN char *Gbl_DirectoryPath; ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_IncludeFilename, NULL); ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_OutputFilenamePrefix, NULL); @@ -203,7 +237,6 @@ ASL_EXTERN FILE *Acp ASL_EXTERN ASL_ANALYSIS_WALK_INFO AnalysisWalkInfo; ASL_EXTERN ACPI_TABLE_HEADER TableHeader; -extern char AslHexLookup[]; /* Event timing */ @@ -220,11 +253,5 @@ ASL_EXTERN char Stri ASL_EXTERN char StringBuffer2[ASL_MSG_BUFFER_SIZE]; -#ifdef _DECLARE_GLOBALS -UINT32 Gbl_ExceptionCount[ASL_NUM_REPORT_LEVELS] = {0,0,0,0,0,0}; -#else -extern UINT32 Gbl_ExceptionCount[ASL_NUM_REPORT_LEVELS]; -#endif - #endif /* __ASLGLOBAL_H */ Modified: head/sys/contrib/dev/acpica/compiler/aslmain.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslmain.c Wed Sep 19 23:03:54 2012 (r240715) +++ head/sys/contrib/dev/acpica/compiler/aslmain.c Wed Sep 19 23:25:24 2012 (r240716) @@ -48,6 +48,7 @@ #include #include #include +#include #ifdef _DEBUG #include @@ -70,6 +71,10 @@ static void Usage ( void); +static void ACPI_SYSTEM_XFACE +AslSignalHandler ( + int Sig); + static void AslInitialize ( void); @@ -96,7 +101,7 @@ AslDoResponseFile ( #define ASL_TOKEN_SEPARATORS " \t\n" -#define ASL_SUPPORTED_OPTIONS "@:2b|c|d^D:e:fgh^i|I:l^mno|p:P^r:s|t|T:G^v^w|x:z" +#define ASL_SUPPORTED_OPTIONS "@:2b|c|d^D:e:fgh^i|I:l^m:no|p:P^r:s|t|T:G^v^w|x:z" /******************************************************************************* @@ -163,10 +168,10 @@ Options ( printf ("\nAML Disassembler:\n"); ACPI_OPTION ("-d [file]", "Disassemble or decode binary ACPI table to file (*.dsl)"); ACPI_OPTION ("-da [f1,f2]", "Disassemble multiple tables from single namespace"); + ACPI_OPTION ("-db", "Do not translate Buffers to Resource Templates"); ACPI_OPTION ("-dc [file]", "Disassemble AML and immediately compile it"); ACPI_OPTION ("", "(Obtain DSDT from current system if no input file)"); ACPI_OPTION ("-e [f1,f2]", "Include ACPI table(s) for external symbol resolution"); - ACPI_OPTION ("-m", "Do not translate Buffers to Resource Templates"); ACPI_OPTION ("-2", "Emit ACPI 2.0 compatible ASL code"); ACPI_OPTION ("-g", "Get ACPI tables and write to files (*.dat)"); @@ -238,6 +243,49 @@ Usage ( } +/****************************************************************************** + * + * FUNCTION: AslSignalHandler + * + * PARAMETERS: Sig - Signal that invoked this handler + * + * RETURN: None + * + * DESCRIPTION: Control-C handler. Delete any intermediate files and any + * output files that may be left in an indeterminate state. + * + *****************************************************************************/ + +static void ACPI_SYSTEM_XFACE +AslSignalHandler ( + int Sig) +{ + UINT32 i; + + + signal (Sig, SIG_IGN); + printf ("Aborting\n\n"); + + /* Close all open files */ + + Gbl_Files[ASL_FILE_PREPROCESSOR].Handle = NULL; /* the .i file is same as source file */ + + for (i = ASL_FILE_INPUT; i < ASL_MAX_FILE_TYPE; i++) + { + FlCloseFile (i); + } + + /* Delete any output files */ + + for (i = ASL_FILE_AML_OUTPUT; i < ASL_MAX_FILE_TYPE; i++) + { + FlDeleteFile (i); + } + + exit (0); +} + + /******************************************************************************* * * FUNCTION: AslInitialize @@ -261,7 +309,6 @@ AslInitialize ( _CrtSetDbgFlag (_CRTDBG_CHECK_ALWAYS_DF | _CrtSetDbgFlag(0)); #endif - AcpiDbgLevel = 0; for (i = 0; i < ASL_NUM_FILES; i++) { @@ -274,6 +321,11 @@ AslInitialize ( Gbl_Files[ASL_FILE_STDERR].Handle = stderr; Gbl_Files[ASL_FILE_STDERR].Filename = "STDERR"; + + /* Allocate the line buffer(s) */ + + Gbl_LineBufferSize /= 2; + UtExpandLineBuffers (); } @@ -475,6 +527,10 @@ AslDoOptions ( Gbl_DisassembleAll = TRUE; break; + case 'b': /* Do not convert buffers to resource descriptors */ + AcpiGbl_NoResourceDisassembly = TRUE; + break; + case 'c': break; @@ -613,8 +669,13 @@ AslDoOptions ( break; - case 'm': /* Do not convert buffers to resource descriptors */ - AcpiGbl_NoResourceDisassembly = TRUE; + case 'm': /* Set line buffer size */ + Gbl_LineBufferSize = (UINT32) strtoul (AcpiGbl_Optarg, NULL, 0) * 1024; + if (Gbl_LineBufferSize < ASL_DEFAULT_LINE_BUFFER_SIZE) + { + Gbl_LineBufferSize = ASL_DEFAULT_LINE_BUFFER_SIZE; + } + printf ("Line Buffer Size: %u\n", Gbl_LineBufferSize); break; @@ -946,7 +1007,10 @@ main ( int Index2; + signal (SIGINT, AslSignalHandler); + AcpiGbl_ExternalFileList = NULL; + AcpiDbgLevel = 0; #ifdef _DEBUG _CrtSetDbgFlag (_CRTDBG_CHECK_ALWAYS_DF | _CRTDBG_LEAK_CHECK_DF | @@ -955,9 +1019,10 @@ main ( /* Init and command line */ + Index1 = Index2 = AslCommandLine (argc, argv); + AslInitialize (); PrInitializePreprocessor (); - Index1 = Index2 = AslCommandLine (argc, argv); /* Options that have no additional parameters or pathnames */ Modified: head/sys/contrib/dev/acpica/compiler/aslmessages.h ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslmessages.h Wed Sep 19 23:03:54 2012 (r240715) +++ head/sys/contrib/dev/acpica/compiler/aslmessages.h Wed Sep 19 23:25:24 2012 (r240716) @@ -198,6 +198,7 @@ typedef enum ASL_MSG_VENDOR_LIST, ASL_MSG_WRITE, ASL_MSG_RANGE, + ASL_MSG_BUFFER_ALLOCATION, /* These messages are used by the Preprocessor only */ @@ -373,6 +374,7 @@ char *AslMessages /* ASL_MSG_VENDOR_LIST */ "Too many vendor data bytes (7 max)", /* ASL_MSG_WRITE */ "Could not write file", /* ASL_MSG_RANGE */ "Constant out of range", +/* ASL_MSG_BUFFER_ALLOCATION */ "Could not allocate line buffer", /* Preprocessor */ Modified: head/sys/contrib/dev/acpica/compiler/asloperands.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/asloperands.c Wed Sep 19 23:03:54 2012 (r240715) +++ head/sys/contrib/dev/acpica/compiler/asloperands.c Wed Sep 19 23:25:24 2012 (r240716) @@ -182,6 +182,10 @@ OpnDoMethod ( Next = Next->Asl.Next; if (Next->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG) { + /* This is a ByteConstExpr, so eval the constant now */ + + OpcAmlConstantWalk (Next, 0, NULL); + if (Next->Asl.Value.Integer > 15) { AslError (ASL_ERROR, ASL_MSG_SYNC_LEVEL, Next, NULL); Modified: head/sys/contrib/dev/acpica/compiler/aslopt.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslopt.c Wed Sep 19 23:03:54 2012 (r240715) +++ head/sys/contrib/dev/acpica/compiler/aslopt.c Wed Sep 19 23:25:24 2012 (r240716) @@ -441,7 +441,6 @@ OptOptimizeNameDeclaration ( { ACPI_STATUS Status; char *NewPathExternal; - ACPI_GENERIC_STATE ScopeInfo; ACPI_NAMESPACE_NODE *Node; @@ -473,9 +472,10 @@ OptOptimizeNameDeclaration ( * Check to make sure that the optimization finds the node we are * looking for. This is simply a sanity check on the new * path that has been created. + * + * We know that we are at the root, so NULL is used for the scope. */ - ScopeInfo.Scope.Node = CurrentNode; - Status = AcpiNsLookup (&ScopeInfo, *NewPath, + Status = AcpiNsLookup (NULL, *NewPath, ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE, ACPI_NS_DONT_OPEN_SCOPE, WalkState, &(Node)); if (ACPI_SUCCESS (Status)) @@ -624,11 +624,21 @@ OptOptimizeNamePath ( ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS, "NAME")); /* - * The node of interest is the parent of this node - * (the containing scope) + * The node of interest is the parent of this node (the containing + * scope). The actual namespace node may be up more than one level + * of parse op or it may not exist at all (if we traverse back + * up to the root.) */ - CurrentNode = Op->Asl.Parent->Asl.Node; - if (!CurrentNode) + NextOp = Op->Asl.Parent; + while (NextOp && (!NextOp->Asl.Node)) + { + NextOp = NextOp->Asl.Parent; + } + if (NextOp && NextOp->Asl.Node) + { + CurrentNode = NextOp->Asl.Node; + } + else { CurrentNode = AcpiGbl_RootNode; } Modified: head/sys/contrib/dev/acpica/compiler/aslstartup.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslstartup.c Wed Sep 19 23:03:54 2012 (r240715) +++ head/sys/contrib/dev/acpica/compiler/aslstartup.c Wed Sep 19 23:25:24 2012 (r240716) @@ -239,7 +239,7 @@ AslDetectSourceFileType ( * File is ASCII. Determine if this is an ASL file or an ACPI data * table file. */ - while (fgets (Gbl_CurrentLineBuffer, ASL_LINE_BUFFER_SIZE, Info->Handle)) + while (fgets (Gbl_CurrentLineBuffer, Gbl_LineBufferSize, Info->Handle)) { /* Uppercase the buffer for caseless compare */ Modified: head/sys/contrib/dev/acpica/compiler/aslsupport.l ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslsupport.l Wed Sep 19 23:03:54 2012 (r240715) +++ head/sys/contrib/dev/acpica/compiler/aslsupport.l Wed Sep 19 23:25:24 2012 (r240716) @@ -343,14 +343,14 @@ AslInsertLineBuffer ( *Gbl_LineBufPtr = (UINT8) SourceChar; Gbl_LineBufPtr++; - if (Gbl_LineBufPtr > (Gbl_CurrentLineBuffer + (ASL_LINE_BUFFER_SIZE - 1))) + if (Gbl_LineBufPtr > (Gbl_CurrentLineBuffer + (Gbl_LineBufferSize - 1))) { #if 0 /* * Warning if we have split a long source line. * */ - sprintf (MsgBuffer, "Max %u", ASL_LINE_BUFFER_SIZE); + sprintf (MsgBuffer, "Max %u", Gbl_LineBufferSize); AslCommonError (ASL_WARNING, ASL_MSG_LONG_LINE, Gbl_CurrentLineNumber, Gbl_LogicalLineNumber, Gbl_CurrentLineOffset, Gbl_CurrentColumn, Modified: head/sys/contrib/dev/acpica/compiler/asltypes.h ============================================================================== --- head/sys/contrib/dev/acpica/compiler/asltypes.h Wed Sep 19 23:03:54 2012 (r240715) +++ head/sys/contrib/dev/acpica/compiler/asltypes.h Wed Sep 19 23:25:24 2012 (r240716) @@ -133,6 +133,8 @@ typedef struct asl_file_info { FILE *Handle; char *Filename; + const char *ShortDescription; + const char *Description; } ASL_FILE_INFO; @@ -146,14 +148,14 @@ typedef struct asl_file_status /* * File types. Note: Any changes to this table must also be reflected - * in the AslFileTypeNames array. + * in the Gbl_Files array. */ typedef enum { ASL_FILE_STDOUT = 0, ASL_FILE_STDERR, - ASL_FILE_INPUT, /* Don't move these first 3 file types */ - ASL_FILE_AML_OUTPUT, + ASL_FILE_INPUT, + ASL_FILE_AML_OUTPUT, /* Don't move these first 4 file types */ ASL_FILE_SOURCE_OUTPUT, ASL_FILE_PREPROCESSOR, ASL_FILE_LISTING_OUTPUT, Modified: head/sys/contrib/dev/acpica/compiler/aslutils.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslutils.c Wed Sep 19 23:03:54 2012 (r240715) +++ head/sys/contrib/dev/acpica/compiler/aslutils.c Wed Sep 19 23:25:24 2012 (r240716) @@ -54,31 +54,6 @@ ACPI_MODULE_NAME ("aslutils") -char AslHexLookup[] = -{ - '0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F' -}; - -/* Table below must match ASL_FILE_TYPES in asltypes.h */ - -static const char *AslFileTypeNames [ASL_NUM_FILES] = -{ - "stdout: ", - "stderr: ", - "Table Input: ", - "Binary Output:", - "Source Output:", - "Preprocessor: ", - "Listing File: ", - "Hex Dump: ", - "Namespace: ", - "Debug File: ", - "ASM Source: ", - "C Source: ", - "ASM Include: ", - "C Include: " -}; - /* Local prototypes */ @@ -547,7 +522,7 @@ UtDisplaySummary ( } FlPrintFile (FileId, "%14s %s - %u bytes\n", - AslFileTypeNames [i], + Gbl_Files[i].ShortDescription, Gbl_Files[i].Filename, FlGetFileSize (i)); } @@ -646,6 +621,79 @@ UtGetStringBuffer ( } +/****************************************************************************** + * + * FUNCTION: UtExpandLineBuffers + * + * PARAMETERS: None. Updates global line buffer pointers. + * + * RETURN: None. Reallocates the global line buffers + * + * DESCRIPTION: Called if the current line buffer becomes filled. Reallocates + * all global line buffers and updates Gbl_LineBufferSize. NOTE: + * Also used for the initial allocation of the buffers, when + * all of the buffer pointers are NULL. Initial allocations are + * of size ASL_DEFAULT_LINE_BUFFER_SIZE + * + *****************************************************************************/ + +void +UtExpandLineBuffers ( + void) +{ + UINT32 NewSize; + + + /* Attempt to double the size of all line buffers */ + + NewSize = Gbl_LineBufferSize * 2; + if (Gbl_CurrentLineBuffer) + { + DbgPrint (ASL_DEBUG_OUTPUT,"Increasing line buffer size from %u to %u\n", + Gbl_LineBufferSize, NewSize); + } + + Gbl_CurrentLineBuffer = realloc (Gbl_CurrentLineBuffer, NewSize); + Gbl_LineBufPtr = Gbl_CurrentLineBuffer; + if (!Gbl_CurrentLineBuffer) + { + goto ErrorExit; + } + + Gbl_MainTokenBuffer = realloc (Gbl_MainTokenBuffer, NewSize); + if (!Gbl_MainTokenBuffer) + { + goto ErrorExit; + } + + Gbl_MacroTokenBuffer = realloc (Gbl_MacroTokenBuffer, NewSize); + if (!Gbl_MacroTokenBuffer) + { + goto ErrorExit; + } + + Gbl_ExpressionTokenBuffer = realloc (Gbl_ExpressionTokenBuffer, NewSize); + if (!Gbl_ExpressionTokenBuffer) + { + goto ErrorExit; + } + + Gbl_LineBufferSize = NewSize; + return; + + + /* On error above, simply issue error messages and abort, cannot continue */ + +ErrorExit: + printf ("Could not increase line buffer size from %u to %u\n", + Gbl_LineBufferSize, Gbl_LineBufferSize * 2); + + AslError (ASL_ERROR, ASL_MSG_BUFFER_ALLOCATION, + NULL, NULL); + AslAbort (); +} + + /******************************************************************************* * * FUNCTION: UtInternalizeName Modified: head/sys/contrib/dev/acpica/compiler/dtio.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/dtio.c Wed Sep 19 23:03:54 2012 (r240715) +++ head/sys/contrib/dev/acpica/compiler/dtio.c Wed Sep 19 23:25:24 2012 (r240716) @@ -413,13 +413,21 @@ DtGetNextLine ( BOOLEAN LineNotAllBlanks = FALSE; UINT32 State = DT_NORMAL_TEXT; UINT32 CurrentLineOffset; - UINT32 BeyondBufferCount; UINT32 i; char c; - for (i = 0; i < ASL_LINE_BUFFER_SIZE;) + for (i = 0; ;) { + /* + * If line is too long, expand the line buffers. Also increases + * Gbl_LineBufferSize. + */ + if (i >= Gbl_LineBufferSize) + { + UtExpandLineBuffers (); + } + c = (char) getc (Handle); if (c == EOF) { @@ -491,6 +499,11 @@ DtGetNextLine ( */ if ((i != 0) && LineNotAllBlanks) { + if ((i + 1) >= Gbl_LineBufferSize) + { + UtExpandLineBuffers (); + } + Gbl_CurrentLineBuffer[i+1] = 0; /* Terminate string */ return (CurrentLineOffset); } @@ -565,6 +578,11 @@ DtGetNextLine ( default: /* Not a comment */ i++; /* Save the preceeding slash */ + if (i >= Gbl_LineBufferSize) + { + UtExpandLineBuffers (); + } + Gbl_CurrentLineBuffer[i] = c; i++; State = DT_NORMAL_TEXT; @@ -668,21 +686,6 @@ DtGetNextLine ( return (ASL_EOF); } } - - /* Line is too long for internal buffer. Determine actual length */ - - BeyondBufferCount = 1; - c = (char) getc (Handle); - while (c != '\n') - { - c = (char) getc (Handle); - BeyondBufferCount++; - } - - printf ("ERROR - At %u: Input line (%u bytes) is too long (max %u)\n", - Gbl_CurrentLineNumber++, ASL_LINE_BUFFER_SIZE + BeyondBufferCount, - ASL_LINE_BUFFER_SIZE); - return (ASL_EOF); } Modified: head/sys/contrib/dev/acpica/compiler/preprocess.h ============================================================================== --- head/sys/contrib/dev/acpica/compiler/preprocess.h Wed Sep 19 23:03:54 2012 (r240715) +++ head/sys/contrib/dev/acpica/compiler/preprocess.h Wed Sep 19 23:25:24 2012 (r240716) @@ -128,10 +128,13 @@ typedef struct pr_file_node /* * Globals */ -PR_EXTERN char XXXEvalBuffer[ASL_LINE_BUFFER_SIZE]; -PR_EXTERN char Gbl_MainTokenBuffer[ASL_LINE_BUFFER_SIZE]; -PR_EXTERN char Gbl_MacroTokenBuffer[ASL_LINE_BUFFER_SIZE]; -PR_EXTERN char Gbl_ExpressionTokenBuffer[ASL_LINE_BUFFER_SIZE]; +#if 0 /* TBD for macros */ +PR_EXTERN char PR_INIT_GLOBAL (*XXXEvalBuffer, NULL); /* [ASL_LINE_BUFFER_SIZE]; */ +#endif + +PR_EXTERN char PR_INIT_GLOBAL (*Gbl_MainTokenBuffer, NULL); /* [ASL_LINE_BUFFER_SIZE]; */ +PR_EXTERN char PR_INIT_GLOBAL (*Gbl_MacroTokenBuffer, NULL); /* [ASL_LINE_BUFFER_SIZE]; */ +PR_EXTERN char PR_INIT_GLOBAL (*Gbl_ExpressionTokenBuffer, NULL); /* [ASL_LINE_BUFFER_SIZE]; */ PR_EXTERN PR_FILE_NODE *Gbl_InputFileList; PR_EXTERN PR_DEFINE_INFO PR_INIT_GLOBAL (*Gbl_DefineList, NULL); Modified: head/sys/contrib/dev/acpica/components/debugger/dbexec.c ============================================================================== --- head/sys/contrib/dev/acpica/components/debugger/dbexec.c Wed Sep 19 23:03:54 2012 (r240715) +++ head/sys/contrib/dev/acpica/components/debugger/dbexec.c Wed Sep 19 23:25:24 2012 (r240716) @@ -607,7 +607,7 @@ AcpiDbExecuteSetup ( AcpiDbPrepNamestring (Info->Pathname); AcpiDbSetOutputDestination (ACPI_DB_DUPLICATE_OUTPUT); - AcpiOsPrintf ("Executing %s\n", Info->Pathname); + AcpiOsPrintf ("Evaluating %s\n", Info->Pathname); if (Info->Flags & EX_SINGLE_STEP) { @@ -701,7 +701,7 @@ AcpiDbExecutionWalk ( ReturnObj.Pointer = NULL; ReturnObj.Length = ACPI_ALLOCATE_BUFFER; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Sep 20 00:51:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8F775106564A; Thu, 20 Sep 2012 00:51:10 +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 6EF988FC0A; Thu, 20 Sep 2012 00:51:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8K0pAK4009477; Thu, 20 Sep 2012 00:51:10 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8K0pAHd009473; Thu, 20 Sep 2012 00:51:10 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201209200051.q8K0pAHd009473@svn.freebsd.org> From: Matt Jacob Date: Thu, 20 Sep 2012 00:51:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240717 - stable/9/sys/dev/isp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Sep 2012 00:51:10 -0000 Author: mjacob Date: Thu Sep 20 00:51:09 2012 New Revision: 240717 URL: http://svn.freebsd.org/changeset/base/240717 Log: MFC of 239502: Remove dependence on MAXPHYS. Modified: stable/9/sys/dev/isp/isp_freebsd.h stable/9/sys/dev/isp/isp_pci.c stable/9/sys/dev/isp/isp_sbus.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/isp/ (props changed) Modified: stable/9/sys/dev/isp/isp_freebsd.h ============================================================================== --- stable/9/sys/dev/isp/isp_freebsd.h Wed Sep 19 23:25:24 2012 (r240716) +++ stable/9/sys/dev/isp/isp_freebsd.h Thu Sep 20 00:51:09 2012 (r240717) @@ -726,9 +726,6 @@ int isp_fcp_next_crn(ispsoftc_t *, uint8 #define isp_sim_alloc(a, b, c, d, e, f, g, h) \ cam_sim_alloc(a, b, c, d, e, &(d)->isp_osinfo.lock, f, g, h) -/* Should be BUS_SPACE_MAXSIZE, but MAXPHYS is larger than BUS_SPACE_MAXSIZE */ -#define ISP_NSEGS ((MAXPHYS / PAGE_SIZE) + 1) - #define ISP_PATH_PRT(i, l, p, ...) \ if ((l) == ISP_LOGALL || ((l)& (i)->isp_dblev) != 0) { \ xpt_print(p, __VA_ARGS__); \ Modified: stable/9/sys/dev/isp/isp_pci.c ============================================================================== --- stable/9/sys/dev/isp/isp_pci.c Wed Sep 19 23:25:24 2012 (r240716) +++ stable/9/sys/dev/isp/isp_pci.c Thu Sep 20 00:51:09 2012 (r240717) @@ -1525,7 +1525,7 @@ static int isp_pci_mbxdma(ispsoftc_t *isp) { caddr_t base; - uint32_t len; + uint32_t len, nsegs; int i, error, ns, cmap = 0; bus_size_t slim; /* segment size */ bus_addr_t llim; /* low limit of unavailable dma */ @@ -1567,6 +1567,11 @@ isp_pci_mbxdma(ispsoftc_t *isp) return (1); } + if (isp->isp_osinfo.sixtyfourbit) { + nsegs = ISP_NSEG64_MAX; + } else { + nsegs = ISP_NSEG_MAX; + } #ifdef ISP_TARGET_MODE /* * XXX: We don't really support 64 bit target mode for parallel scsi yet @@ -1579,7 +1584,7 @@ isp_pci_mbxdma(ispsoftc_t *isp) } #endif - if (isp_dma_tag_create(BUS_DMA_ROOTARG(ISP_PCD(isp)), 1, slim, llim, hlim, NULL, NULL, BUS_SPACE_MAXSIZE, ISP_NSEGS, slim, 0, &isp->isp_osinfo.dmat)) { + if (isp_dma_tag_create(BUS_DMA_ROOTARG(ISP_PCD(isp)), 1, slim, llim, hlim, NULL, NULL, BUS_SPACE_MAXSIZE, nsegs, slim, 0, &isp->isp_osinfo.dmat)) { free(isp->isp_osinfo.pcmd_pool, M_DEVBUF); ISP_LOCK(isp); isp_prt(isp, ISP_LOGERR, "could not create master dma tag"); Modified: stable/9/sys/dev/isp/isp_sbus.c ============================================================================== --- stable/9/sys/dev/isp/isp_sbus.c Wed Sep 19 23:25:24 2012 (r240716) +++ stable/9/sys/dev/isp/isp_sbus.c Thu Sep 20 00:51:09 2012 (r240717) @@ -497,7 +497,7 @@ isp_sbus_mbxdma(ispsoftc_t *isp) if (isp_dma_tag_create(BUS_DMA_ROOTARG(ISP_SBD(isp)), 1, BUS_SPACE_MAXADDR_24BIT+1, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR_32BIT, NULL, NULL, BUS_SPACE_MAXSIZE_32BIT, - ISP_NSEGS, BUS_SPACE_MAXADDR_24BIT, 0, &isp->isp_osinfo.dmat)) { + ISP_NSEG_MAX, BUS_SPACE_MAXADDR_24BIT, 0, &isp->isp_osinfo.dmat)) { isp_prt(isp, ISP_LOGERR, "could not create master dma tag"); free(isp->isp_osinfo.pcmd_pool, M_DEVBUF); free(isp->isp_xflist, M_DEVBUF); From owner-svn-src-all@FreeBSD.ORG Thu Sep 20 01:23:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4AA861065702; Thu, 20 Sep 2012 01:23:55 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 338E38FC14; Thu, 20 Sep 2012 01:23:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8K1NtDF013984; Thu, 20 Sep 2012 01:23:55 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8K1NsPV013979; Thu, 20 Sep 2012 01:23:54 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <201209200123.q8K1NsPV013979@svn.freebsd.org> From: Scott Long Date: Thu, 20 Sep 2012 01:23:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240718 - stable/9/sys/dev/ixgbe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Sep 2012 01:23:55 -0000 Author: scottl Date: Thu Sep 20 01:23:54 2012 New Revision: 240718 URL: http://svn.freebsd.org/changeset/base/240718 Log: Sync the ixgbe driver from HEAD to stable/9 r236627 - Fix driver deadlock due to OACTIVE flag r236729 - Fix prefetch programming typo r239940 - Improve small RX packet performance r240155 - Fix missing braces in PHY configuration r240366 - Remove a prefetch directive that hurts performance Approved by: jfv Obtained from: Netflix, inc. Modified: stable/9/sys/dev/ixgbe/ixgbe.c stable/9/sys/dev/ixgbe/ixgbe.h stable/9/sys/dev/ixgbe/ixgbe_osdep.h Directory Properties: stable/9/sys/dev/ixgbe/ (props changed) Modified: stable/9/sys/dev/ixgbe/ixgbe.c ============================================================================== --- stable/9/sys/dev/ixgbe/ixgbe.c Thu Sep 20 00:51:09 2012 (r240717) +++ stable/9/sys/dev/ixgbe/ixgbe.c Thu Sep 20 01:23:54 2012 (r240718) @@ -1145,7 +1145,7 @@ ixgbe_init_locked(struct adapter *adapte * from the Intel linux driver 3.8.21. * Prefetching enables tx line rate even with 1 queue. */ - txdctl |= (16 << 0) | (1 << 8); + txdctl |= (32 << 0) | (1 << 8); IXGBE_WRITE_REG(hw, IXGBE_TXDCTL(i), txdctl); } @@ -1390,7 +1390,7 @@ ixgbe_handle_que(void *context, int pend ixgbe_start_locked(txr, ifp); #endif IXGBE_TX_UNLOCK(txr); - if (more || (ifp->if_drv_flags & IFF_DRV_OACTIVE)) { + if (more) { taskqueue_enqueue(que->tq, &que->que_task); return; } @@ -3698,21 +3698,30 @@ no_split: mp = rxbuf->m_pack; mp->m_pkthdr.len = mp->m_len = adapter->rx_mbuf_sz; - /* Get the memory mapping */ - error = bus_dmamap_load_mbuf_sg(rxr->ptag, - rxbuf->pmap, mp, pseg, &nsegs, BUS_DMA_NOWAIT); - if (error != 0) { - printf("Refresh mbufs: payload dmamap load" - " failure - %d\n", error); - m_free(mp); - rxbuf->m_pack = NULL; - goto update; + + /* If we're dealing with an mbuf that was copied rather + * than replaced, there's no need to go through busdma. + */ + if ((rxbuf->flags & IXGBE_RX_COPY) == 0) { + /* Get the memory mapping */ + error = bus_dmamap_load_mbuf_sg(rxr->ptag, + rxbuf->pmap, mp, pseg, &nsegs, BUS_DMA_NOWAIT); + if (error != 0) { + printf("Refresh mbufs: payload dmamap load" + " failure - %d\n", error); + m_free(mp); + rxbuf->m_pack = NULL; + goto update; + } + rxbuf->m_pack = mp; + bus_dmamap_sync(rxr->ptag, rxbuf->pmap, + BUS_DMASYNC_PREREAD); + rxbuf->paddr = rxr->rx_base[i].read.pkt_addr = + htole64(pseg[0].ds_addr); + } else { + rxr->rx_base[i].read.pkt_addr = rxbuf->paddr; + rxbuf->flags &= ~IXGBE_RX_COPY; } - rxbuf->m_pack = mp; - bus_dmamap_sync(rxr->ptag, rxbuf->pmap, - BUS_DMASYNC_PREREAD); - rxr->rx_base[i].read.pkt_addr = - htole64(pseg[0].ds_addr); refreshed = TRUE; /* Next is precalculated */ @@ -4025,6 +4034,7 @@ skip_head: rxr->next_to_refresh = 0; rxr->lro_enabled = FALSE; rxr->rx_split_packets = 0; + rxr->rx_copies = 0; rxr->rx_bytes = 0; rxr->discard = FALSE; rxr->vtag_strip = FALSE; @@ -4580,14 +4590,36 @@ ixgbe_rxeof(struct ix_queue *que, int co ** that determines what we are */ sendmp = rbuf->fmp; - rbuf->m_pack = rbuf->fmp = NULL; if (sendmp != NULL) { /* secondary frag */ + rbuf->m_pack = rbuf->fmp = NULL; mp->m_flags &= ~M_PKTHDR; sendmp->m_pkthdr.len += mp->m_len; } else { + /* + * Optimize. This might be a small packet, + * maybe just a TCP ACK. Do a fast copy that + * is cache aligned into a new mbuf, and + * leave the old mbuf+cluster for re-use. + */ + if (eop && plen <= IXGBE_RX_COPY_LEN) { + sendmp = m_gethdr(M_DONTWAIT, MT_DATA); + if (sendmp != NULL) { + sendmp->m_data += + IXGBE_RX_COPY_ALIGN; + ixgbe_bcopy(mp->m_data, + sendmp->m_data, plen); + sendmp->m_len = plen; + rxr->rx_copies++; + rbuf->flags |= IXGBE_RX_COPY; + } + } + if (sendmp == NULL) { + rbuf->m_pack = rbuf->fmp = NULL; + sendmp = mp; + } + /* first desc of a non-ps chain */ - sendmp = mp; sendmp->m_flags |= M_PKTHDR; sendmp->m_pkthdr.len = mp->m_len; if (staterr & IXGBE_RXD_STAT_VP) { @@ -5438,6 +5470,9 @@ ixgbe_add_hw_stats(struct adapter *adapt SYSCTL_ADD_UQUAD(ctx, queue_list, OID_AUTO, "rx_bytes", CTLFLAG_RD, &rxr->rx_bytes, "Queue Bytes Received"); + SYSCTL_ADD_UQUAD(ctx, queue_list, OID_AUTO, "rx_copies", + CTLFLAG_RD, &rxr->rx_copies, + "Copied RX Frames"); SYSCTL_ADD_INT(ctx, queue_list, OID_AUTO, "lro_queued", CTLFLAG_RD, &lro->lro_queued, 0, "LRO Queued"); Modified: stable/9/sys/dev/ixgbe/ixgbe.h ============================================================================== --- stable/9/sys/dev/ixgbe/ixgbe.h Thu Sep 20 00:51:09 2012 (r240717) +++ stable/9/sys/dev/ixgbe/ixgbe.h Thu Sep 20 01:23:54 2012 (r240718) @@ -154,6 +154,19 @@ #define IXGBE_FC_HI 0x20000 #define IXGBE_FC_LO 0x10000 +/* + * Used for optimizing small rx mbufs. Effort is made to keep the copy + * small and aligned for the CPU L1 cache. + * + * MHLEN is typically 168 bytes, giving us 8-byte alignment. Getting + * 32 byte alignment needed for the fast bcopy results in 8 bytes being + * wasted. Getting 64 byte alignment, which _should_ be ideal for + * modern Intel CPUs, results in 40 bytes wasted and a significant drop + * in observed efficiency of the optimization, 97.9% -> 81.8%. + */ +#define IXGBE_RX_COPY_LEN 160 +#define IXGBE_RX_COPY_ALIGN (MHLEN - IXGBE_RX_COPY_LEN) + /* Keep older OS drivers building... */ #if !defined(SYSCTL_ADD_UQUAD) #define SYSCTL_ADD_UQUAD SYSCTL_ADD_QUAD @@ -245,6 +258,9 @@ struct ixgbe_rx_buf { struct mbuf *fmp; bus_dmamap_t hmap; bus_dmamap_t pmap; + u_int flags; +#define IXGBE_RX_COPY 0x01 + uint64_t paddr; }; /* @@ -339,6 +355,7 @@ struct rx_ring { /* Soft stats */ u64 rx_irq; u64 rx_split_packets; + u64 rx_copies; u64 rx_packets; u64 rx_bytes; u64 rx_discarded; Modified: stable/9/sys/dev/ixgbe/ixgbe_osdep.h ============================================================================== --- stable/9/sys/dev/ixgbe/ixgbe_osdep.h Thu Sep 20 00:51:09 2012 (r240717) +++ stable/9/sys/dev/ixgbe/ixgbe_osdep.h Thu Sep 20 01:23:54 2012 (r240718) @@ -143,6 +143,25 @@ void prefetch(void *x) #define prefetch(x) #endif +/* + * Optimized bcopy thanks to Luigi Rizzo's investigative work. Assumes + * non-overlapping regions and 32-byte padding on both src and dst. + */ +static __inline int +ixgbe_bcopy(void *_src, void *_dst, int l) +{ + uint64_t *src = _src; + uint64_t *dst = _dst; + + for (; l > 0; l -= 32) { + *dst++ = *src++; + *dst++ = *src++; + *dst++ = *src++; + *dst++ = *src++; + } + return (0); +} + struct ixgbe_osdep { bus_space_tag_t mem_bus_space_tag; From owner-svn-src-all@FreeBSD.ORG Thu Sep 20 02:25:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5CD64106566B; Thu, 20 Sep 2012 02:25:19 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 481AD8FC0C; Thu, 20 Sep 2012 02:25:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8K2PJDK022022; Thu, 20 Sep 2012 02:25:19 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8K2PJNC022020; Thu, 20 Sep 2012 02:25:19 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201209200225.q8K2PJNC022020@svn.freebsd.org> From: Kevin Lo Date: Thu, 20 Sep 2012 02:25:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240719 - head/lib/libc/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Sep 2012 02:25:19 -0000 Author: kevlo Date: Thu Sep 20 02:25:18 2012 New Revision: 240719 URL: http://svn.freebsd.org/changeset/base/240719 Log: Remove the restrict qualifier to match function prototype. Modified: head/lib/libc/sys/recv.2 Modified: head/lib/libc/sys/recv.2 ============================================================================== --- head/lib/libc/sys/recv.2 Thu Sep 20 01:23:54 2012 (r240718) +++ head/lib/libc/sys/recv.2 Thu Sep 20 02:25:18 2012 (r240719) @@ -44,7 +44,7 @@ .Ft ssize_t .Fn recv "int s" "void *buf" "size_t len" "int flags" .Ft ssize_t -.Fn recvfrom "int s" "void * restrict buf" "size_t len" "int flags" "struct sockaddr * restrict from" "socklen_t * restrict fromlen" +.Fn recvfrom "int s" "void *buf" "size_t len" "int flags" "struct sockaddr * restrict from" "socklen_t * restrict fromlen" .Ft ssize_t .Fn recvmsg "int s" "struct msghdr *msg" "int flags" .Sh DESCRIPTION From owner-svn-src-all@FreeBSD.ORG Thu Sep 20 02:49:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3FABE1065670; Thu, 20 Sep 2012 02:49:26 +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 2977E8FC0C; Thu, 20 Sep 2012 02:49:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8K2nPNX025209; Thu, 20 Sep 2012 02:49:25 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8K2nPoM025202; Thu, 20 Sep 2012 02:49:25 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201209200249.q8K2nPoM025202@svn.freebsd.org> From: Rick Macklem Date: Thu, 20 Sep 2012 02:49:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240720 - in head/sys/fs: nfs nfsclient nfsserver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Sep 2012 02:49:26 -0000 Author: rmacklem Date: Thu Sep 20 02:49:25 2012 New Revision: 240720 URL: http://svn.freebsd.org/changeset/base/240720 Log: Modify the NFSv4 client so that it can handle owner and owner_group strings that consist entirely of digits, interpreting them as the uid/gid number. This change was needed since new (>= 3.3) Linux servers reply with these strings by default. This change is mandated by the rfc3530bis draft. Reported on freebsd-stable@ under the Subject heading "Problem with Linux >= 3.3 as NFSv4 server" by Norbert Aschendorff on Aug. 20, 2012. Tested by: norbert.aschendorff at yahoo.de Reviewed by: jhb MFC after: 2 weeks Modified: head/sys/fs/nfs/nfs.h head/sys/fs/nfs/nfs_commonacl.c head/sys/fs/nfs/nfs_commonsubs.c head/sys/fs/nfs/nfs_var.h head/sys/fs/nfsclient/nfs_clcomsubs.c head/sys/fs/nfsserver/nfs_nfsdport.c Modified: head/sys/fs/nfs/nfs.h ============================================================================== --- head/sys/fs/nfs/nfs.h Thu Sep 20 02:25:18 2012 (r240719) +++ head/sys/fs/nfs/nfs.h Thu Sep 20 02:49:25 2012 (r240720) @@ -559,6 +559,7 @@ struct nfsrv_descript { #define ND_EXGSSINTEGRITY 0x00200000 #define ND_EXGSSPRIVACY 0x00400000 #define ND_INCRSEQID 0x00800000 +#define ND_NFSCL 0x01000000 /* * ND_GSS should be the "or" of all GSS type authentications. Modified: head/sys/fs/nfs/nfs_commonacl.c ============================================================================== --- head/sys/fs/nfs/nfs_commonacl.c Thu Sep 20 02:25:18 2012 (r240719) +++ head/sys/fs/nfs/nfs_commonacl.c Thu Sep 20 02:49:25 2012 (r240720) @@ -101,12 +101,12 @@ nfsrv_dissectace(struct nfsrv_descript * if (gotid == 0) { if (flag & NFSV4ACE_IDENTIFIERGROUP) { acep->ae_tag = ACL_GROUP; - aceerr = nfsv4_strtogid(name, len, &gid, p); + aceerr = nfsv4_strtogid(nd, name, len, &gid, p); if (aceerr == 0) acep->ae_id = (uid_t)gid; } else { acep->ae_tag = ACL_USER; - aceerr = nfsv4_strtouid(name, len, &uid, p); + aceerr = nfsv4_strtouid(nd, name, len, &uid, p); if (aceerr == 0) acep->ae_id = uid; } Modified: head/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- head/sys/fs/nfs/nfs_commonsubs.c Thu Sep 20 02:25:18 2012 (r240719) +++ head/sys/fs/nfs/nfs_commonsubs.c Thu Sep 20 02:49:25 2012 (r240720) @@ -1401,12 +1401,12 @@ nfsv4_loadattr(struct nfsrv_descript *nd } if (compare) { if (!(*retcmpp)) { - if (nfsv4_strtouid(cp, j, &uid, p) || + if (nfsv4_strtouid(nd, cp, j, &uid, p) || nap->na_uid != uid) *retcmpp = NFSERR_NOTSAME; } } else if (nap != NULL) { - if (nfsv4_strtouid(cp, j, &uid, p)) + if (nfsv4_strtouid(nd, cp, j, &uid, p)) nap->na_uid = nfsrv_defaultuid; else nap->na_uid = uid; @@ -1434,12 +1434,12 @@ nfsv4_loadattr(struct nfsrv_descript *nd } if (compare) { if (!(*retcmpp)) { - if (nfsv4_strtogid(cp, j, &gid, p) || + if (nfsv4_strtogid(nd, cp, j, &gid, p) || nap->na_gid != gid) *retcmpp = NFSERR_NOTSAME; } } else if (nap != NULL) { - if (nfsv4_strtogid(cp, j, &gid, p)) + if (nfsv4_strtogid(nd, cp, j, &gid, p)) nap->na_gid = nfsrv_defaultgid; else nap->na_gid = gid; @@ -2594,27 +2594,41 @@ tryagain: * Convert a string to a uid. * If no conversion is possible return NFSERR_BADOWNER, otherwise * return 0. + * If this is called from a client side mount using AUTH_SYS and the + * string is made up entirely of digits, just convert the string to + * a number. */ APPLESTATIC int -nfsv4_strtouid(u_char *str, int len, uid_t *uidp, NFSPROC_T *p) +nfsv4_strtouid(struct nfsrv_descript *nd, u_char *str, int len, uid_t *uidp, + NFSPROC_T *p) { int i; - u_char *cp; + char *cp, *endstr, *str0; struct nfsusrgrp *usrp; int cnt, ret; int error = 0; + uid_t tuid; if (len == 0) { error = NFSERR_BADOWNER; goto out; } + /* If a string of digits and an AUTH_SYS mount, just convert it. */ + str0 = str; + tuid = (uid_t)strtoul(str0, &endstr, 10); + if ((endstr - str0) == len && + (nd->nd_flag & (ND_KERBV | ND_NFSCL)) == ND_NFSCL) { + *uidp = tuid; + goto out; + } /* * Look for an '@'. */ - cp = str; - for (i = 0; i < len; i++) - if (*cp++ == '@') - break; + cp = strchr(str0, '@'); + if (cp != NULL) + i = (int)(cp++ - str0); + else + i = len; cnt = 0; tryagain: @@ -2783,27 +2797,43 @@ tryagain: /* * Convert a string to a gid. + * If no conversion is possible return NFSERR_BADOWNER, otherwise + * return 0. + * If this is called from a client side mount using AUTH_SYS and the + * string is made up entirely of digits, just convert the string to + * a number. */ APPLESTATIC int -nfsv4_strtogid(u_char *str, int len, gid_t *gidp, NFSPROC_T *p) +nfsv4_strtogid(struct nfsrv_descript *nd, u_char *str, int len, gid_t *gidp, + NFSPROC_T *p) { int i; - u_char *cp; + char *cp, *endstr, *str0; struct nfsusrgrp *usrp; int cnt, ret; int error = 0; + gid_t tgid; if (len == 0) { error = NFSERR_BADOWNER; goto out; } + /* If a string of digits and an AUTH_SYS mount, just convert it. */ + str0 = str; + tgid = (gid_t)strtoul(str0, &endstr, 10); + if ((endstr - str0) == len && + (nd->nd_flag & (ND_KERBV | ND_NFSCL)) == ND_NFSCL) { + *gidp = tgid; + goto out; + } /* * Look for an '@'. */ - cp = str; - for (i = 0; i < len; i++) - if (*cp++ == '@') - break; + cp = strchr(str0, '@'); + if (cp != NULL) + i = (int)(cp++ - str0); + else + i = len; cnt = 0; tryagain: Modified: head/sys/fs/nfs/nfs_var.h ============================================================================== --- head/sys/fs/nfs/nfs_var.h Thu Sep 20 02:25:18 2012 (r240719) +++ head/sys/fs/nfs/nfs_var.h Thu Sep 20 02:49:25 2012 (r240720) @@ -295,9 +295,11 @@ void nfsrv_adj(mbuf_t, int, int); void nfsrv_postopattr(struct nfsrv_descript *, int, struct nfsvattr *); int nfsd_errmap(struct nfsrv_descript *); void nfsv4_uidtostr(uid_t, u_char **, int *, NFSPROC_T *); -int nfsv4_strtouid(u_char *, int, uid_t *, NFSPROC_T *); +int nfsv4_strtouid(struct nfsrv_descript *, u_char *, int, uid_t *, + NFSPROC_T *); void nfsv4_gidtostr(gid_t, u_char **, int *, NFSPROC_T *); -int nfsv4_strtogid(u_char *, int, gid_t *, NFSPROC_T *); +int nfsv4_strtogid(struct nfsrv_descript *, u_char *, int, gid_t *, + NFSPROC_T *); int nfsrv_checkuidgid(struct nfsrv_descript *, struct nfsvattr *); void nfsrv_fixattr(struct nfsrv_descript *, vnode_t, struct nfsvattr *, NFSACL_T *, NFSPROC_T *, nfsattrbit_t *, Modified: head/sys/fs/nfsclient/nfs_clcomsubs.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clcomsubs.c Thu Sep 20 02:25:18 2012 (r240719) +++ head/sys/fs/nfsclient/nfs_clcomsubs.c Thu Sep 20 02:49:25 2012 (r240720) @@ -126,11 +126,11 @@ nfscl_reqstart(struct nfsrv_descript *nd * First, fill in some of the fields of nd. */ if (NFSHASNFSV4(nmp)) - nd->nd_flag = ND_NFSV4; + nd->nd_flag = ND_NFSV4 | ND_NFSCL; else if (NFSHASNFSV3(nmp)) - nd->nd_flag = ND_NFSV3; + nd->nd_flag = ND_NFSV3 | ND_NFSCL; else - nd->nd_flag = ND_NFSV2; + nd->nd_flag = ND_NFSV2 | ND_NFSCL; nd->nd_procnum = procnum; nd->nd_repstat = 0; Modified: head/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdport.c Thu Sep 20 02:25:18 2012 (r240719) +++ head/sys/fs/nfsserver/nfs_nfsdport.c Thu Sep 20 02:49:25 2012 (r240720) @@ -2437,7 +2437,8 @@ nfsv4_sattr(struct nfsrv_descript *nd, s goto nfsmout; } if (!nd->nd_repstat) { - nd->nd_repstat = nfsv4_strtouid(cp,j,&uid,p); + nd->nd_repstat = nfsv4_strtouid(nd, cp, j, &uid, + p); if (!nd->nd_repstat) nvap->na_uid = uid; } @@ -2463,7 +2464,8 @@ nfsv4_sattr(struct nfsrv_descript *nd, s goto nfsmout; } if (!nd->nd_repstat) { - nd->nd_repstat = nfsv4_strtogid(cp,j,&gid,p); + nd->nd_repstat = nfsv4_strtogid(nd, cp, j, &gid, + p); if (!nd->nd_repstat) nvap->na_gid = gid; } From owner-svn-src-all@FreeBSD.ORG Thu Sep 20 03:03:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0577E1065672; Thu, 20 Sep 2012 03:03:02 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E48898FC0C; Thu, 20 Sep 2012 03:03:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8K331KO027292; Thu, 20 Sep 2012 03:03:01 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8K331KZ027290; Thu, 20 Sep 2012 03:03:01 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201209200303.q8K331KZ027290@svn.freebsd.org> From: Adrian Chadd Date: Thu, 20 Sep 2012 03:03:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240721 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Sep 2012 03:03:02 -0000 Author: adrian Date: Thu Sep 20 03:03:01 2012 New Revision: 240721 URL: http://svn.freebsd.org/changeset/base/240721 Log: Add a work-around for some strange net80211 BAR races in the wireless stack. There are unfortunately quite a few odd cases in BAR TX and BAR TX retransmission that I haven't yet fully diagnosed. So for now, add this work-around so the resume() function isn't called too often, decrementing pause to -1 (and causing things to stay paused.) Modified: head/sys/dev/ath/if_ath_tx.c Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Thu Sep 20 02:49:25 2012 (r240720) +++ head/sys/dev/ath/if_ath_tx.c Thu Sep 20 03:03:01 2012 (r240721) @@ -5043,10 +5043,19 @@ ath_bar_response(struct ieee80211_node * * XXX if this is attempt=50, the TID will be downgraded * XXX to a non-aggregate session. So we must unpause the * XXX TID here or it'll never be done. + * + * Also, don't call it if bar_tx/bar_wait are 0; something + * has beaten us to the punch? (XXX figure out what?) */ if (status == 0 || attempts == 50) { ATH_TXQ_LOCK(sc->sc_ac2q[atid->ac]); - ath_tx_tid_bar_unsuspend(sc, atid); + if (atid->bar_tx == 0 || atid->bar_wait == 0) + device_printf(sc->sc_dev, + "%s: huh? bar_tx=%d, bar_wait=%d\n", + __func__, + atid->bar_tx, atid->bar_wait); + else + ath_tx_tid_bar_unsuspend(sc, atid); ATH_TXQ_UNLOCK(sc->sc_ac2q[atid->ac]); } } From owner-svn-src-all@FreeBSD.ORG Thu Sep 20 03:04:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id ED3E4106566C; Thu, 20 Sep 2012 03:04:19 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D967E8FC14; Thu, 20 Sep 2012 03:04:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8K34J9H027511; Thu, 20 Sep 2012 03:04:19 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8K34Jen027509; Thu, 20 Sep 2012 03:04:19 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201209200304.q8K34Jen027509@svn.freebsd.org> From: Adrian Chadd Date: Thu, 20 Sep 2012 03:04:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240722 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Sep 2012 03:04:20 -0000 Author: adrian Date: Thu Sep 20 03:04:19 2012 New Revision: 240722 URL: http://svn.freebsd.org/changeset/base/240722 Log: Place the comment where it should be. Modified: head/sys/dev/ath/if_ath_tx.c Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Thu Sep 20 03:03:01 2012 (r240721) +++ head/sys/dev/ath/if_ath_tx.c Thu Sep 20 03:04:19 2012 (r240722) @@ -1289,8 +1289,18 @@ ath_tx_xmit_normal(struct ath_softc *sc, ath_tx_handoff(sc, txq, bf); } - - +/* + * Do the basic frame setup stuff that's required before the frame + * is added to a software queue. + * + * All frames get mostly the same treatment and it's done once. + * Retransmits fiddle with things like the rate control setup, + * setting the retransmit bit in the packet; doing relevant DMA/bus + * syncing and relinking it (back) into the hardware TX queue. + * + * Note that this may cause the mbuf to be reallocated, so + * m0 may not be valid. + */ static int ath_tx_normal_setup(struct ath_softc *sc, struct ieee80211_node *ni, struct ath_buf *bf, struct mbuf *m0, struct ath_txq *txq) @@ -2701,20 +2711,6 @@ ath_tx_swq(struct ath_softc *sc, struct } /* - * Do the basic frame setup stuff that's required before the frame - * is added to a software queue. - * - * All frames get mostly the same treatment and it's done once. - * Retransmits fiddle with things like the rate control setup, - * setting the retransmit bit in the packet; doing relevant DMA/bus - * syncing and relinking it (back) into the hardware TX queue. - * - * Note that this may cause the mbuf to be reallocated, so - * m0 may not be valid. - */ - - -/* * Configure the per-TID node state. * * This likely belongs in if_ath_node.c but I can't think of anywhere From owner-svn-src-all@FreeBSD.ORG Thu Sep 20 03:09:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E9C3A1065673; Thu, 20 Sep 2012 03:09:58 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D61688FC0C; Thu, 20 Sep 2012 03:09:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8K39wCS028294; Thu, 20 Sep 2012 03:09:58 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8K39w3E028291; Thu, 20 Sep 2012 03:09:58 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201209200309.q8K39w3E028291@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 20 Sep 2012 03:09:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240723 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Sep 2012 03:09:59 -0000 Author: glebius Date: Thu Sep 20 03:09:58 2012 New Revision: 240723 URL: http://svn.freebsd.org/changeset/base/240723 Log: Add missing break. Pointy hat to: glebius Modified: head/sys/net/pfvar.h Modified: head/sys/net/pfvar.h ============================================================================== --- head/sys/net/pfvar.h Thu Sep 20 03:04:19 2012 (r240722) +++ head/sys/net/pfvar.h Thu Sep 20 03:09:58 2012 (r240723) @@ -1743,6 +1743,7 @@ pf_hashsrc(struct pf_addr *addr, sa_fami break; case AF_INET6: h = ADDR_HASH(addr->v6.__u6_addr.__u6_addr32[3]); + break; default: panic("%s: unknown address family %u", __func__, af); } From owner-svn-src-all@FreeBSD.ORG Thu Sep 20 03:13:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DF9EF106566C; Thu, 20 Sep 2012 03:13:20 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C9D748FC0C; Thu, 20 Sep 2012 03:13:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8K3DKuK028961; Thu, 20 Sep 2012 03:13:20 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8K3DKlO028959; Thu, 20 Sep 2012 03:13:20 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201209200313.q8K3DKlO028959@svn.freebsd.org> From: Adrian Chadd Date: Thu, 20 Sep 2012 03:13:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240724 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Sep 2012 03:13:21 -0000 Author: adrian Date: Thu Sep 20 03:13:20 2012 New Revision: 240724 URL: http://svn.freebsd.org/changeset/base/240724 Log: Introduce the CLRDMASK gating based on tid->clrdmask, enabling filtered frames to occur. * Create a new function which will set the bf_flags CLRDMASK bit if required. * For raw frames, always set CLRDMASK. * For BAR, ADDBA frames, always set CLRDMASK. * For everything else, check if CLRDMASK needs to be set before calling tx_setds() or tx_setds11n(). * When unpausing a queue or drain/resetting it, set tid->clrdmask=1 just to ensure traffic starts flowing. What I need to do: * Modify that function to _clear_ the CLRDMASK if it's not required, or retried frames may have CLRDMASK set when they don't need to. (Which isn't a huge deal, but..) Whilst I'm here: * ath_tx_normal_xmit() should really act like the AMPDU session TX functions - any incomplete frames will end up being assigned ath_tx_normal_comp() which will decrement tid->hwq_depth - but that won't have been incremented. So whilst I'm here, add a comment to do that. * Fix the debug print function to be slightly clearer about things; it's not a good sign when I can't interpret my own debugging output. I've done some testing on AR9280/AR5416/AR9160 STA and AP modes. Modified: head/sys/dev/ath/if_ath_tx.c Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Thu Sep 20 03:09:58 2012 (r240723) +++ head/sys/dev/ath/if_ath_tx.c Thu Sep 20 03:13:20 2012 (r240724) @@ -1285,6 +1285,9 @@ ath_tx_xmit_normal(struct ath_softc *sc, ath_tx_rate_fill_rcflags(sc, bf); ath_tx_setds(sc, bf); + /* XXX Bump TID HWQ counter */ + /* XXX Assign a completion handler */ + /* Hand off to hardware */ ath_tx_handoff(sc, txq, bf); } @@ -1384,7 +1387,8 @@ ath_tx_normal_setup(struct ath_softc *sc } an = ATH_NODE(ni); - flags = HAL_TXDESC_CLRDMASK; /* XXX needed for crypto errs */ + //flags = HAL_TXDESC_CLRDMASK; /* XXX needed for crypto errs */ + flags = 0; ismrr = 0; /* default no multi-rate retry*/ pri = M_WME_GETAC(m0); /* honor classification */ /* XXX use txparams instead of fixed values */ @@ -1598,12 +1602,15 @@ ath_tx_normal_setup(struct ath_softc *sc } /* - * Direct-dispatch the current frame to the hardware. + * Queue a frame to the hardware or software queue. * * This can be called by the net80211 code. * * XXX what about locking? Or, push the seqno assign into the * XXX aggregate scheduler so its serialised? + * + * XXX When sending management frames via ath_raw_xmit(), + * should CLRDMASK be set unconditionally? */ int ath_tx_start(struct ath_softc *sc, struct ieee80211_node *ni, @@ -1774,11 +1781,13 @@ ath_tx_start(struct ath_softc *sc, struc if (txq == &avp->av_mcastq) { DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: bf=%p: mcastq: TX'ing\n", __func__, bf); + bf->bf_state.bfs_txflags |= HAL_TXDESC_CLRDMASK; ath_tx_xmit_normal(sc, txq, bf); } else if (type == IEEE80211_FC0_TYPE_CTL && subtype == IEEE80211_FC0_SUBTYPE_BAR) { DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: BAR: TX'ing direct\n", __func__); + bf->bf_state.bfs_txflags |= HAL_TXDESC_CLRDMASK; ath_tx_xmit_normal(sc, txq, bf); } else { /* add to software queue */ @@ -1791,6 +1800,7 @@ ath_tx_start(struct ath_softc *sc, struc * For now, since there's no software queue, * direct-dispatch to the hardware. */ + bf->bf_state.bfs_txflags |= HAL_TXDESC_CLRDMASK; ath_tx_xmit_normal(sc, txq, bf); #endif done: @@ -1874,6 +1884,7 @@ ath_tx_raw_start(struct ath_softc *sc, s wh = mtod(m0, struct ieee80211_frame *); bf->bf_node = ni; /* NB: held reference */ + /* Always enable CLRDMASK for raw frames for now.. */ flags = HAL_TXDESC_CLRDMASK; /* XXX needed for crypto errs */ flags |= HAL_TXDESC_INTREQ; /* force interrupt */ if (params->ibp_flags & IEEE80211_BPF_RTS) @@ -2002,6 +2013,7 @@ ath_tx_raw_start(struct ath_softc *sc, s __func__, do_override); if (do_override) { + bf->bf_state.bfs_txflags |= HAL_TXDESC_CLRDMASK; ath_tx_xmit_normal(sc, sc->sc_ac2q[pri], bf); } else { /* Queue to software queue */ @@ -2467,6 +2479,22 @@ ath_tx_tid_unsched(struct ath_softc *sc, } /* + * Update the CLRDMASK bit in the ath_buf if it needs to be set. + */ +static void +ath_tx_update_clrdmask(struct ath_softc *sc, struct ath_tid *tid, + struct ath_buf *bf) +{ + + ATH_TID_LOCK_ASSERT(sc, tid); + + if (tid->clrdmask == 1) { + bf->bf_state.bfs_txflags |= HAL_TXDESC_CLRDMASK; + tid->clrdmask = 0; + } +} + +/* * Assign a sequence number manually to the given frame. * * This should only be called for A-MPDU TX frames. @@ -2582,6 +2610,9 @@ ath_tx_xmit_aggr(struct ath_softc *sc, s bf->bf_state.bfs_nframes = 1; } + /* Update CLRDMASK just before this frame is queued */ + ath_tx_update_clrdmask(sc, tid, bf); + /* Direct dispatch to hardware */ ath_tx_do_ratelookup(sc, bf); ath_tx_calc_duration(sc, bf); @@ -2701,6 +2732,7 @@ ath_tx_swq(struct ath_softc *sc, struct } else if (txq->axq_depth < sc->sc_hwq_limit) { /* AMPDU not running, attempt direct dispatch */ DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: xmit_normal\n", __func__); + ath_tx_update_clrdmask(sc, atid, bf); ath_tx_xmit_normal(sc, txq, bf); } else { /* Busy; queue */ @@ -2789,6 +2821,12 @@ ath_tx_tid_resume(struct ath_softc *sc, return; } + /* + * Override the clrdmask configuration for the next frame, + * just to get the ball rolling. + */ + tid->clrdmask = 1; + ath_tx_tid_sched(sc, tid); /* Punt some frames to the hardware if needed */ //ath_txq_sched(sc, sc->sc_ac2q[tid->ac]); @@ -3109,6 +3147,12 @@ ath_tx_tid_bar_tx(struct ath_softc *sc, tid->bar_tx = 1; /* + * Override the clrdmask configuration for the next frame, + * just to get the ball rolling. + */ + tid->clrdmask = 1; + + /* * Calculate new BAW left edge, now that all frames have either * succeeded or failed. * @@ -3189,6 +3233,12 @@ ath_tx_tid_drain_print(struct ath_softc SEQNO(bf->bf_state.bfs_seqno), bf->bf_state.bfs_retries); device_printf(sc->sc_dev, + "%s: node %p: bf=%p: txq axq_depth=%d, axq_aggr_depth=%d\n", + __func__, ni, bf, + txq->axq_depth, + txq->axq_aggr_depth); + + device_printf(sc->sc_dev, "%s: node %p: bf=%p: tid txq_depth=%d hwq_depth=%d, bar_wait=%d, isfiltered=%d\n", __func__, ni, bf, tid->axq_depth, @@ -3196,13 +3246,13 @@ ath_tx_tid_drain_print(struct ath_softc tid->bar_wait, tid->isfiltered); device_printf(sc->sc_dev, - "%s: node %p: tid %d: txq_depth=%d, " - "txq_aggr_depth=%d, sched=%d, paused=%d, " - "hwq_depth=%d, incomp=%d, baw_head=%d, " + "%s: node %p: tid %d: " + "sched=%d, paused=%d, " + "incomp=%d, baw_head=%d, " "baw_tail=%d txa_start=%d, ni_txseqs=%d\n", - __func__, ni, tid->tid, txq->axq_depth, - txq->axq_aggr_depth, tid->sched, tid->paused, - tid->hwq_depth, tid->incomp, tid->baw_head, + __func__, ni, tid->tid, + tid->sched, tid->paused, + tid->incomp, tid->baw_head, tid->baw_tail, tap == NULL ? -1 : tap->txa_start, ni->ni_txseqs[tid->tid]); @@ -3274,6 +3324,15 @@ ath_tx_tid_drain(struct ath_softc *sc, s } /* + * Override the clrdmask configuration for the next frame + * in case there is some future transmission, just to get + * the ball rolling. + * + * This won't hurt things if the TID is about to be freed. + */ + tid->clrdmask = 1; + + /* * Now that it's completed, grab the TID lock and update * the sequence number and BAW window. * Because sequence numbers have been assigned to frames @@ -4511,6 +4570,9 @@ ath_tx_tid_hw_queue_aggr(struct ath_soft bf->bf_state.bfs_aggr = 0; bf->bf_state.bfs_nframes = 1; + /* Update CLRDMASK just before this frame is queued */ + ath_tx_update_clrdmask(sc, tid, bf); + ath_tx_do_ratelookup(sc, bf); ath_tx_calc_duration(sc, bf); ath_tx_calc_protection(sc, bf); @@ -4573,6 +4635,10 @@ ath_tx_tid_hw_queue_aggr(struct ath_soft if (bf->bf_state.bfs_nframes == 1) { DPRINTF(sc, ATH_DEBUG_SW_TX_AGGR, "%s: single-frame aggregate\n", __func__); + + /* Update CLRDMASK just before this frame is queued */ + ath_tx_update_clrdmask(sc, tid, bf); + bf->bf_state.bfs_aggr = 0; bf->bf_state.bfs_ndelim = 0; ath_tx_setds(sc, bf); @@ -4591,6 +4657,9 @@ ath_tx_tid_hw_queue_aggr(struct ath_soft sc->sc_aggr_stats.aggr_pkts[bf->bf_state.bfs_nframes]++; sc->sc_aggr_stats.aggr_aggr_pkt++; + /* Update CLRDMASK just before this frame is queued */ + ath_tx_update_clrdmask(sc, tid, bf); + /* * Calculate the duration/protection as required. */ @@ -4654,7 +4723,7 @@ ath_tx_tid_hw_queue_norm(struct ath_soft DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: node %p: TID %d: called\n", __func__, an, tid->tid); - ATH_TXQ_LOCK_ASSERT(txq); + ATH_TID_LOCK_ASSERT(sc, tid); /* Check - is AMPDU pending or running? then print out something */ if (ath_tx_ampdu_pending(sc, an, tid->tid)) @@ -4691,6 +4760,9 @@ ath_tx_tid_hw_queue_norm(struct ath_soft /* Normal completion handler */ bf->bf_comp = ath_tx_normal_comp; + /* Update CLRDMASK just before this frame is queued */ + ath_tx_update_clrdmask(sc, tid, bf); + /* Program descriptors + rate control */ ath_tx_do_ratelookup(sc, bf); ath_tx_calc_duration(sc, bf); From owner-svn-src-all@FreeBSD.ORG Thu Sep 20 03:29:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 55FDB106566C; Thu, 20 Sep 2012 03:29:44 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 26F468FC0A; Thu, 20 Sep 2012 03:29:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8K3Ti9n031277; Thu, 20 Sep 2012 03:29:44 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8K3ThNc031273; Thu, 20 Sep 2012 03:29:43 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201209200329.q8K3ThNc031273@svn.freebsd.org> From: Kevin Lo Date: Thu, 20 Sep 2012 03:29:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240725 - in head: contrib/libpcap sys/contrib/ipfilter/netinet sys/netinet/libalias X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Sep 2012 03:29:44 -0000 Author: kevlo Date: Thu Sep 20 03:29:43 2012 New Revision: 240725 URL: http://svn.freebsd.org/changeset/base/240725 Log: Fix typo: s/pakcet/packet Modified: head/contrib/libpcap/pcap-snoop.c head/sys/contrib/ipfilter/netinet/ip_auth.c head/sys/netinet/libalias/alias_skinny.c Modified: head/contrib/libpcap/pcap-snoop.c ============================================================================== --- head/contrib/libpcap/pcap-snoop.c Thu Sep 20 03:13:20 2012 (r240724) +++ head/contrib/libpcap/pcap-snoop.c Thu Sep 20 03:29:43 2012 (r240725) @@ -100,7 +100,7 @@ again: /* * XXX - Sigh, snoop_packetlen is a 16 bit quantity. If we - * got a short length, but read a full sized snoop pakcet, + * got a short length, but read a full sized snoop packet, * assume we overflowed and add back the 64K... */ if (cc == (p->snapshot + sizeof(struct snoopheader)) && Modified: head/sys/contrib/ipfilter/netinet/ip_auth.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_auth.c Thu Sep 20 03:13:20 2012 (r240724) +++ head/sys/contrib/ipfilter/netinet/ip_auth.c Thu Sep 20 03:29:43 2012 (r240725) @@ -712,7 +712,7 @@ int fr_authflush() /* ------------------------------------------------------------------------ */ /* Function: fr_auth_waiting */ -/* Returns: int - 0 = no pakcets wiating, 1 = packets waiting. */ +/* Returns: int - 0 = no packets waiting, 1 = packets waiting. */ /* Parameters: None */ /* */ /* Simple truth check to see if there are any packets waiting in the auth */ Modified: head/sys/netinet/libalias/alias_skinny.c ============================================================================== --- head/sys/netinet/libalias/alias_skinny.c Thu Sep 20 03:13:20 2012 (r240724) +++ head/sys/netinet/libalias/alias_skinny.c Thu Sep 20 03:29:43 2012 (r240725) @@ -340,7 +340,7 @@ AliasHandleSkinny(struct libalias *la, s * through the packet using len to determine message boundaries. * This comes into play big time with port messages being in the * same packet as register messages. Also, open receive channel - * acks are usually buried in a pakcet some 400 bytes long. + * acks are usually buried in a packet some 400 bytes long. */ while (dlen >= skinny_hdr_len) { len = (sd->len); From owner-svn-src-all@FreeBSD.ORG Thu Sep 20 03:38:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 191E7106566B; Thu, 20 Sep 2012 03:38:29 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EEED98FC17; Thu, 20 Sep 2012 03:38:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8K3cS1V032538; Thu, 20 Sep 2012 03:38:28 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8K3cS4i032531; Thu, 20 Sep 2012 03:38:28 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201209200338.q8K3cS4i032531@svn.freebsd.org> From: Doug Barton Date: Thu, 20 Sep 2012 03:38:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240726 - in vendor/bind9/dist: . lib/dns lib/dns/include/dns X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Sep 2012 03:38:29 -0000 Author: dougb Date: Thu Sep 20 03:38:28 2012 New Revision: 240726 URL: http://svn.freebsd.org/changeset/base/240726 Log: Vendor import of BIND 9.8.3-P3 Modified: vendor/bind9/dist/CHANGES vendor/bind9/dist/lib/dns/include/dns/rdata.h vendor/bind9/dist/lib/dns/master.c vendor/bind9/dist/lib/dns/rdata.c vendor/bind9/dist/lib/dns/rdataslab.c vendor/bind9/dist/version Modified: vendor/bind9/dist/CHANGES ============================================================================== --- vendor/bind9/dist/CHANGES Thu Sep 20 03:29:43 2012 (r240725) +++ vendor/bind9/dist/CHANGES Thu Sep 20 03:38:28 2012 (r240726) @@ -1,3 +1,8 @@ + --- 9.8.3-P3 released --- + +3364. [security] Named could die on specially crafted record. + [RT #30416] + --- 9.8.3-P2 released --- 3346. [security] Bad-cache data could be used before it was Modified: vendor/bind9/dist/lib/dns/include/dns/rdata.h ============================================================================== --- vendor/bind9/dist/lib/dns/include/dns/rdata.h Thu Sep 20 03:29:43 2012 (r240725) +++ vendor/bind9/dist/lib/dns/include/dns/rdata.h Thu Sep 20 03:38:28 2012 (r240726) @@ -147,6 +147,17 @@ struct dns_rdata { (((rdata)->flags & ~(DNS_RDATA_UPDATE|DNS_RDATA_OFFLINE)) == 0) /* + * The maximum length of a RDATA that can be sent on the wire. + * Max packet size (65535) less header (12), less name (1), type (2), + * class (2), ttl(4), length (2). + * + * None of the defined types that support name compression can exceed + * this and all new types are to be sent uncompressed. + */ + +#define DNS_RDATA_MAXLENGTH 65512U + +/* * Flags affecting rdata formatting style. Flags 0xFFFF0000 * are used by masterfile-level formatting and defined elsewhere. * See additional comments at dns_rdata_tofmttext(). Modified: vendor/bind9/dist/lib/dns/master.c ============================================================================== --- vendor/bind9/dist/lib/dns/master.c Thu Sep 20 03:29:43 2012 (r240725) +++ vendor/bind9/dist/lib/dns/master.c Thu Sep 20 03:38:28 2012 (r240726) @@ -75,7 +75,7 @@ /*% * max message size - header - root - type - class - ttl - rdlen */ -#define MINTSIZ (65535 - 12 - 1 - 2 - 2 - 4 - 2) +#define MINTSIZ DNS_RDATA_MAXLENGTH /*% * Size for tokens in the presentation format, * The largest tokens are the base64 blocks in KEY and CERT records, Modified: vendor/bind9/dist/lib/dns/rdata.c ============================================================================== --- vendor/bind9/dist/lib/dns/rdata.c Thu Sep 20 03:29:43 2012 (r240725) +++ vendor/bind9/dist/lib/dns/rdata.c Thu Sep 20 03:38:28 2012 (r240726) @@ -429,6 +429,7 @@ dns_rdata_fromwire(dns_rdata_t *rdata, d isc_buffer_t st; isc_boolean_t use_default = ISC_FALSE; isc_uint32_t activelength; + size_t length; REQUIRE(dctx != NULL); if (rdata != NULL) { @@ -459,6 +460,14 @@ dns_rdata_fromwire(dns_rdata_t *rdata, d } /* + * Reject any rdata that expands out to more than DNS_RDATA_MAXLENGTH + * as we cannot transmit it. + */ + length = isc_buffer_usedlength(target) - isc_buffer_usedlength(&st); + if (result == ISC_R_SUCCESS && length > DNS_RDATA_MAXLENGTH) + result = DNS_R_FORMERR; + + /* * We should have consumed all of our buffer. */ if (result == ISC_R_SUCCESS && !buffer_empty(source)) @@ -466,8 +475,7 @@ dns_rdata_fromwire(dns_rdata_t *rdata, d if (rdata != NULL && result == ISC_R_SUCCESS) { region.base = isc_buffer_used(&st); - region.length = isc_buffer_usedlength(target) - - isc_buffer_usedlength(&st); + region.length = length; dns_rdata_fromregion(rdata, rdclass, type, ®ion); } @@ -602,6 +610,7 @@ dns_rdata_fromtext(dns_rdata_t *rdata, d unsigned long line; void (*callback)(dns_rdatacallbacks_t *, const char *, ...); isc_result_t tresult; + size_t length; REQUIRE(origin == NULL || dns_name_isabsolute(origin) == ISC_TRUE); if (rdata != NULL) { @@ -673,10 +682,13 @@ dns_rdata_fromtext(dns_rdata_t *rdata, d } } while (1); + length = isc_buffer_usedlength(target) - isc_buffer_usedlength(&st); + if (result == ISC_R_SUCCESS && length > DNS_RDATA_MAXLENGTH) + result = ISC_R_NOSPACE; + if (rdata != NULL && result == ISC_R_SUCCESS) { region.base = isc_buffer_used(&st); - region.length = isc_buffer_usedlength(target) - - isc_buffer_usedlength(&st); + region.length = length; dns_rdata_fromregion(rdata, rdclass, type, ®ion); } if (result != ISC_R_SUCCESS) { @@ -804,6 +816,7 @@ dns_rdata_fromstruct(dns_rdata_t *rdata, isc_buffer_t st; isc_region_t region; isc_boolean_t use_default = ISC_FALSE; + size_t length; REQUIRE(source != NULL); if (rdata != NULL) { @@ -818,10 +831,13 @@ dns_rdata_fromstruct(dns_rdata_t *rdata, if (use_default) (void)NULL; + length = isc_buffer_usedlength(target) - isc_buffer_usedlength(&st); + if (result == ISC_R_SUCCESS && length > DNS_RDATA_MAXLENGTH) + result = ISC_R_NOSPACE; + if (rdata != NULL && result == ISC_R_SUCCESS) { region.base = isc_buffer_used(&st); - region.length = isc_buffer_usedlength(target) - - isc_buffer_usedlength(&st); + region.length = length; dns_rdata_fromregion(rdata, rdclass, type, ®ion); } if (result != ISC_R_SUCCESS) Modified: vendor/bind9/dist/lib/dns/rdataslab.c ============================================================================== --- vendor/bind9/dist/lib/dns/rdataslab.c Thu Sep 20 03:29:43 2012 (r240725) +++ vendor/bind9/dist/lib/dns/rdataslab.c Thu Sep 20 03:38:28 2012 (r240726) @@ -305,6 +305,7 @@ dns_rdataslab_fromrdataset(dns_rdataset_ length = x[i].rdata.length; if (rdataset->type == dns_rdatatype_rrsig) length++; + INSIST(length <= 0xffff); *rawbuf++ = (length & 0xff00) >> 8; *rawbuf++ = (length & 0x00ff); #if DNS_RDATASET_FIXED Modified: vendor/bind9/dist/version ============================================================================== --- vendor/bind9/dist/version Thu Sep 20 03:29:43 2012 (r240725) +++ vendor/bind9/dist/version Thu Sep 20 03:38:28 2012 (r240726) @@ -7,4 +7,4 @@ MAJORVER=9 MINORVER=8 PATCHVER=3 RELEASETYPE=-P -RELEASEVER=2 +RELEASEVER=3 From owner-svn-src-all@FreeBSD.ORG Thu Sep 20 03:42:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3800E106566B; Thu, 20 Sep 2012 03:42:15 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0A8978FC08; Thu, 20 Sep 2012 03:42:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8K3gEL4033118; Thu, 20 Sep 2012 03:42:14 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8K3gEg4033117; Thu, 20 Sep 2012 03:42:14 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201209200342.q8K3gEg4033117@svn.freebsd.org> From: Doug Barton Date: Thu, 20 Sep 2012 03:42:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240727 - vendor/bind9/9.8.3-P3 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Sep 2012 03:42:15 -0000 Author: dougb Date: Thu Sep 20 03:42:14 2012 New Revision: 240727 URL: http://svn.freebsd.org/changeset/base/240727 Log: Tag the 9.8.3-P3 release Added: vendor/bind9/9.8.3-P3/ - copied from r240726, vendor/bind9/dist/ From owner-svn-src-all@FreeBSD.ORG Thu Sep 20 03:48:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E0777106567C; Thu, 20 Sep 2012 03:48:36 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CA66A8FC08; Thu, 20 Sep 2012 03:48:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8K3maPc034113; Thu, 20 Sep 2012 03:48:36 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8K3maMO034111; Thu, 20 Sep 2012 03:48:36 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201209200348.q8K3maMO034111@svn.freebsd.org> From: Eitan Adler Date: Thu, 20 Sep 2012 03:48:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240728 - head/share/man/man7 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Sep 2012 03:48:37 -0000 Author: eadler Date: Thu Sep 20 03:48:36 2012 New Revision: 240728 URL: http://svn.freebsd.org/changeset/base/240728 Log: Rewrite portions of development.7 to make sense in the world of subversion. Approved by: gjb MFC after: 2 weeks Modified: head/share/man/man7/development.7 Modified: head/share/man/man7/development.7 ============================================================================== --- head/share/man/man7/development.7 Thu Sep 20 03:42:14 2012 (r240727) +++ head/share/man/man7/development.7 Thu Sep 20 03:48:36 2012 (r240728) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 2, 2012 +.Dd September 19, 2012 .Dt DEVELOPMENT 7 .Os .Sh NAME @@ -48,7 +48,7 @@ kernel. The methods described here are as applicable to production installations as it is to development environments. -You need a good 12-17GB of disk space on one machine to make this work +You need approximately 10GB of disk space on one machine to make this work conveniently. .Sh SETTING UP THE ENVIRONMENT ON THE MASTER SERVER Your master server should always run a stable, production version of the @@ -62,9 +62,9 @@ where you lose the environment and/or ca .Pp Create a huge partition called .Pa /FreeBSD . -8-12GB is recommended. +Approximately 7GB is recommended. This partition will contain nearly all the development environment, -including the CVS tree, broken-out source, and possibly even object files. +including the subversion tree, broken-out source, and possibly even object files. You are going to export this partition to your other machines via a READ-ONLY NFS export so do not mix it with other more security-sensitive partitions. @@ -89,70 +89,19 @@ I recommend a partition of at least 5GB. .Pp On the master server, use -.Xr csup 1 -to automatically pull down and maintain +.Xr svn 1 +to pull down and maintain the .Fx -CVS archive once a day. +source. The first pull will take a long time, it is several gigabytes, but once you have it, -the daily synchronizations will be quite small. -.Bd -literal -offset 4n -mkdir /FreeBSD/FreeBSD-CVS -rm -rf /home/ncvs -ln -s /FreeBSD/FreeBSD-CVS /home/ncvs -.Ed -.Pp -The -.Xr cron 8 -job should look something like this (please randomize the time of -day!). -Note that you can use the -.Xr csup 1 -configuration file example directly from -.Pa /usr/share/examples -without modification by supplying appropriate arguments -to -.Xr csup 1 . -.Bd -literal -offset 4n -33 6 * * * /usr/bin/csup -r 20 -L 2 -h cvsup.freebsd.org /usr/share/examples/cvsup/cvs-supfile -.Ed -.Pp -Run the -.Xr csup 1 -manually the first time to pull down the archive. -It could take -all day depending on how fast your connection is! -You will run all -.Xr csup 1 -and -.Xr cvs 1 +the updates will be quite small. +Run all +.Xr svn 1 operations as .Dq Li root -and you need to set up a -.Pa ~/.cvsrc -.Pq Pa /root/.cvsrc -file, as shown below, for proper -.Xr cvs 1 -operation. -Using -.Pa ~/.cvsrc -to specify -.Xr cvs 1 -defaults is an excellent way to -.Dq "file and forget" , -but you should never forget that you put them in there. -.Bd -literal -offset 4n -# cvs -q -diff -u -update -Pd -checkout -P -.Ed -.Pp -Now use -.Xr cvs 1 -to check out a -STABLE source tree and a -CURRENT source tree, -as well as ports and docs, to create your initial source environment. +.Pp Keeping the broken-out source and ports in .Pa /FreeBSD allows you to export @@ -160,71 +109,16 @@ it to other machines via read-only NFS. This also means you only need to edit/maintain files in one place and all your clients automatically pick up the changes. .Bd -literal -offset 4n -mkdir /FreeBSD/FreeBSD-4.x -mkdir /FreeBSD/FreeBSD-current - -cd /FreeBSD/FreeBSD-4.x -cvs -d /home/ncvs checkout -rRELENG_4 src - -cd /FreeBSD/FreeBSD-current -cvs -d /home/ncvs checkout src -cvs -d /home/ncvs checkout ports -cvs -d /home/ncvs checkout doc -.Ed -.Pp -Now create a softlink for -.Pa /usr/src -and -.Pa /usr/src2 . -On the main server I always point -.Pa /usr/src -at -STABLE and -.Pa /usr/src2 -at -CURRENT. -On client machines I usually do not have a -.Pa /usr/src2 -and I make -.Pa /usr/src -point at whatever version of -.Fx -the client box is intended to -run. -.Bd -literal -offset 4n +mkdir /FreeBSD +cd /FreeBSD +svn co svn://svn.freebsd.org/ports/head ports +svn co svn://svn.freebsd.org/doc/head doc +svn co svn://svn.freebsd.org/base/head src cd /usr -rm -rf src src2 -ln -s /FreeBSD/FreeBSD-4.x/src src (could be -CURRENT on a client) -ln -s /FreeBSD/FreeBSD-current/src src2 (MASTER SERVER ONLY) +rm -rf src +ln -s /FreeBSD/src src .Ed .Pp -Now you have to make a choice for -.Pa /usr/obj . -Well, hopefully you made it already and chose the partition method. -If you -chose poorly you probably intend to put it in -.Pa /FreeBSD -and, if so, this is -what you want to do: -.Bd -literal -offset 4n -(ONLY IF YOU MADE A POOR CHOICE AND PUT /usr/obj in /FreeBSD!) -mkdir /FreeBSD/obj -cd /usr -rm -rf obj -ln -s /FreeBSD/obj obj -.Ed -.Pp -Alternatively you may chose simply to leave -.Pa /usr/obj -in -.Pa /usr . -If your -.Pa /usr -is large enough this will work, but I do not recommend it for -safety reasons -.Pa ( /usr/obj -is constantly being modified, -.Pa /usr -is not). -.Pp Note that exporting .Pa /usr/obj via read-only NFS to your other boxes will @@ -240,19 +134,17 @@ problems and issues down the line and pr It is far easier to do builds on the master server and then only do installs on the clients. .Pp -I usually maintain my ports tree via CVS. -It is sitting right there in the master CVS archive and I have even told you -to check it out (see above). +I usually maintain my ports tree via svn or portsnap. With some fancy softlinks you can make the ports tree available both on your master server and on all of your other machines. -Note that the ports tree exists only on the HEAD CVS branch, so its always --CURRENT even on a -STABLE box. +Note that the ports tree exists only on the HEAD ports branch, so its always +usable even on a -STABLE box. This is what you do: .Bd -literal -offset 4n (THESE COMMANDS ON THE MASTER SERVER AND ON ALL CLIENTS) cd /usr rm -rf ports -ln -s /FreeBSD/FreeBSD-current/ports ports +ln -s /FreeBSD/ports ports cd /usr/ports (this pushes into the softlink) rm -rf distfiles (ON MASTER SERVER ONLY) @@ -344,7 +236,7 @@ into the NFS-mounted environment. If a particular client is running -CURRENT, .Pa /usr/src should be a softlink to -.Pa /FreeBSD/FreeBSD-current/src . +.Pa /FreeBSD/src . If it is running -STABLE, .Pa /usr/src should be a softlink to @@ -359,8 +251,8 @@ human variety) on a client. (ON EACH CLIENT) cd /usr rm -rf ports src -ln -s /FreeBSD/FreeBSD-current/ports ports -ln -s /FreeBSD/FreeBSD-XXX/src src +ln -s /FreeBSD/ports ports +ln -s /FreeBSD/src src .Ed .Pp Do not forget to create the working directories so you can build ports, as @@ -521,11 +413,6 @@ subdirectory in which is typically local to the client. You can then do builds to your heart's content! .Sh MAINTAINING A LOCAL BRANCH -I have described how to maintain two versions of the source tree, a stable -version in -.Pa /FreeBSD/FreeBSD-4.x -and a current version in -.Pa /FreeBSD/FreeBSD-current . There is absolutely nothing preventing you from breaking out other versions of the source tree into @@ -548,135 +435,33 @@ which can build those other operating sy Many developers choose to maintain a local branch of .Fx to test patches or build a custom distribution. -This can be done with CVS or another source code management system -(SubVersion, Perforce, BitKeeper) with its own repository. -Since the main -.Fx -tree is based on CVS, the former is convenient. +This can be done with svn or another source code management system +(git, mercurial, Perforce, BitKeeper) with its own repository. .Pp -First, you need to modify your -.Xr csup 1 -environment to avoid it modifying -the local changes you have committed to the repository. -It is important to remove the -.Ic delete -keyword from your -.Pa supfile -and to add the -.Pa CVSROOT -subdirectory to your -.Pa refuse -file. -For more information, see -.Xr csup 1 . -.Pp -The -.Fx -version of -.Xr cvs 1 -examines a custom environmental variable, -.Ev CVS_LOCAL_BRANCH_NUM , -which specifies an integer to use when doing a -.Xr cvs 1 -.Cm tag Ns / Ns Cm rtag . -Set this number to something high (say 1000) to avoid colliding -with potential future branches of the main repository. -For example, -branching a file with version 1.4 produces 1.4.1000. -Future commits to this branch will produce revisions 1.4.1000.1, -1.4.1000.2, etc. -.Pp -To fork your local branch, do: -.Bd -literal -offset 4n -cvs rtag -r RELENG_4 -b LOCAL_RELENG_4 src -.Ed -.Pp -After this, you can check out a copy from your local repository using the -new tag and begin making changes and committing them. -For more information on using CVS, see -.Xr cvs 1 . -.Pp -.Sy WARNING! -The -.Xr csup 1 -utility may blow away changes made on a local branch in -some situations. -This has been reported to occur when the master CVS repository is -directly manipulated or an RCS file is changed. -At this point, -.Xr csup 1 -notices that the client and server have entirely -different RCS files, so it does a full replace instead of trying to -send just deltas. -Ideally this situation should never arise, but in the real world it -happens all the time. -.Pp -While this is the only scenario where the problem should crop up, -there have been some suspicious-sounding reports of -.Ev CVS_LOCAL_BRANCH_NUM -lossage that cannot be explained by this alone. -Bottom line is, if you value your local branch then you -should back it up before every update. -.Sh UPDATING VIA CVS -The advantage of using -.Xr csup 1 -to maintain an updated copy of the CVS -repository instead of using it to maintain source trees directly is that you -can then pick and choose when you bring your source tree (or pieces of your -source tree) up to date. +.Sh "UPDATING VIA SVN" By using a .Xr cron 8 -job to maintain an updated CVS repository, you can update -your source tree at any time without any network cost as follows: +job to maintain an updated svn repository, +the source tree can be +updated at any time as follows: .Bd -literal -offset 4n (on the main development server) -cd /usr/src -cvs -d /home/ncvs update -cd /usr/src2 -cvs -d /home/ncvs update -cd /usr/ports -cvs -d /home/ncvs update +cd /usr +svn update src doc ports .Ed .Pp It is that simple, and since you are exporting the whole lot to your clients, your clients have immediate visibility into the updated source. This is a good time to also remind you that most of the -.Xr cvs 1 +.Xr svn 1 operations you do will be done as -.Dq Li root , -and that certain options are -required for CVS to operate properly on the -.Fx -repository. -For example, -.Fl Pd -is necessary when running -.Nm cvs Cm update . -These options are typically placed in your -.Pa ~/.cvsrc -(as already described) -so you do not have to re-specify them every time you run a -.Xr cvs 1 -command. -Maintaining the CVS repository also gives you far more flexibility -in regards to breaking out multiple versions of the source tree. +.Dq Li root . It is a good idea to give your .Pa /FreeBSD partition a lot of space (I recommend -8-12GB) precisely for that reason. -If you can make it 15GB I would do it. +10-15GB) precisely for that reason. .Pp -I generally do not -.Nm cvs Cm update -via a -.Xr cron 8 -job. -This is because I generally want the source to not change out from under me -when I am developing code. -Instead I manually update the source every so often...\& when I feel it is -a good time. -My recommendation is to only keep the CVS repository synchronized via .Xr cron 8 . .Sh SEE ALSO .Xr crontab 1 , @@ -696,3 +481,9 @@ and first appeared in .Fx 5.0 , December 2002. +It was since extensively modified by +.An Eitan Adler Aq eadler@FreeBSD.org +to reflect the repository conversion from +.Xr cvs +to +.Xr svn . From owner-svn-src-all@FreeBSD.ORG Thu Sep 20 04:12:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E72A6106566C; Thu, 20 Sep 2012 04:12:09 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D2E498FC14; Thu, 20 Sep 2012 04:12:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8K4C9LN037895; Thu, 20 Sep 2012 04:12:09 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8K4C9NC037888; Thu, 20 Sep 2012 04:12:09 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201209200412.q8K4C9NC037888@svn.freebsd.org> From: Doug Barton Date: Thu, 20 Sep 2012 04:12:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240729 - in head/contrib/bind9: . lib/dns lib/dns/include/dns X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Sep 2012 04:12:10 -0000 Author: dougb Date: Thu Sep 20 04:12:09 2012 New Revision: 240729 URL: http://svn.freebsd.org/changeset/base/240729 Log: Upgrade to 9.8.3-P3: Prevents a crash when queried for a record whose RDATA exceeds 65535 bytes. Prevents a crash when validating caused by using "Bad cache" data before it has been initialized. ISC_QUEUE handling for recursive clients was updated to address a race condition that could cause a memory leak. This rarely occurred with UDP clients, but could be a significant problem for a server handling a steady rate of TCP queries. A condition has been corrected where improper handling of zero-length RDATA could cause undesirable behavior, including termination of the named process. For more information: https://kb.isc.org/article/AA-00788 Modified: head/contrib/bind9/CHANGES head/contrib/bind9/lib/dns/include/dns/rdata.h head/contrib/bind9/lib/dns/master.c head/contrib/bind9/lib/dns/rdata.c head/contrib/bind9/lib/dns/rdataslab.c head/contrib/bind9/version Directory Properties: head/contrib/bind9/ (props changed) Modified: head/contrib/bind9/CHANGES ============================================================================== --- head/contrib/bind9/CHANGES Thu Sep 20 03:48:36 2012 (r240728) +++ head/contrib/bind9/CHANGES Thu Sep 20 04:12:09 2012 (r240729) @@ -1,3 +1,8 @@ + --- 9.8.3-P3 released --- + +3364. [security] Named could die on specially crafted record. + [RT #30416] + --- 9.8.3-P2 released --- 3346. [security] Bad-cache data could be used before it was Modified: head/contrib/bind9/lib/dns/include/dns/rdata.h ============================================================================== --- head/contrib/bind9/lib/dns/include/dns/rdata.h Thu Sep 20 03:48:36 2012 (r240728) +++ head/contrib/bind9/lib/dns/include/dns/rdata.h Thu Sep 20 04:12:09 2012 (r240729) @@ -147,6 +147,17 @@ struct dns_rdata { (((rdata)->flags & ~(DNS_RDATA_UPDATE|DNS_RDATA_OFFLINE)) == 0) /* + * The maximum length of a RDATA that can be sent on the wire. + * Max packet size (65535) less header (12), less name (1), type (2), + * class (2), ttl(4), length (2). + * + * None of the defined types that support name compression can exceed + * this and all new types are to be sent uncompressed. + */ + +#define DNS_RDATA_MAXLENGTH 65512U + +/* * Flags affecting rdata formatting style. Flags 0xFFFF0000 * are used by masterfile-level formatting and defined elsewhere. * See additional comments at dns_rdata_tofmttext(). Modified: head/contrib/bind9/lib/dns/master.c ============================================================================== --- head/contrib/bind9/lib/dns/master.c Thu Sep 20 03:48:36 2012 (r240728) +++ head/contrib/bind9/lib/dns/master.c Thu Sep 20 04:12:09 2012 (r240729) @@ -75,7 +75,7 @@ /*% * max message size - header - root - type - class - ttl - rdlen */ -#define MINTSIZ (65535 - 12 - 1 - 2 - 2 - 4 - 2) +#define MINTSIZ DNS_RDATA_MAXLENGTH /*% * Size for tokens in the presentation format, * The largest tokens are the base64 blocks in KEY and CERT records, Modified: head/contrib/bind9/lib/dns/rdata.c ============================================================================== --- head/contrib/bind9/lib/dns/rdata.c Thu Sep 20 03:48:36 2012 (r240728) +++ head/contrib/bind9/lib/dns/rdata.c Thu Sep 20 04:12:09 2012 (r240729) @@ -429,6 +429,7 @@ dns_rdata_fromwire(dns_rdata_t *rdata, d isc_buffer_t st; isc_boolean_t use_default = ISC_FALSE; isc_uint32_t activelength; + size_t length; REQUIRE(dctx != NULL); if (rdata != NULL) { @@ -459,6 +460,14 @@ dns_rdata_fromwire(dns_rdata_t *rdata, d } /* + * Reject any rdata that expands out to more than DNS_RDATA_MAXLENGTH + * as we cannot transmit it. + */ + length = isc_buffer_usedlength(target) - isc_buffer_usedlength(&st); + if (result == ISC_R_SUCCESS && length > DNS_RDATA_MAXLENGTH) + result = DNS_R_FORMERR; + + /* * We should have consumed all of our buffer. */ if (result == ISC_R_SUCCESS && !buffer_empty(source)) @@ -466,8 +475,7 @@ dns_rdata_fromwire(dns_rdata_t *rdata, d if (rdata != NULL && result == ISC_R_SUCCESS) { region.base = isc_buffer_used(&st); - region.length = isc_buffer_usedlength(target) - - isc_buffer_usedlength(&st); + region.length = length; dns_rdata_fromregion(rdata, rdclass, type, ®ion); } @@ -602,6 +610,7 @@ dns_rdata_fromtext(dns_rdata_t *rdata, d unsigned long line; void (*callback)(dns_rdatacallbacks_t *, const char *, ...); isc_result_t tresult; + size_t length; REQUIRE(origin == NULL || dns_name_isabsolute(origin) == ISC_TRUE); if (rdata != NULL) { @@ -673,10 +682,13 @@ dns_rdata_fromtext(dns_rdata_t *rdata, d } } while (1); + length = isc_buffer_usedlength(target) - isc_buffer_usedlength(&st); + if (result == ISC_R_SUCCESS && length > DNS_RDATA_MAXLENGTH) + result = ISC_R_NOSPACE; + if (rdata != NULL && result == ISC_R_SUCCESS) { region.base = isc_buffer_used(&st); - region.length = isc_buffer_usedlength(target) - - isc_buffer_usedlength(&st); + region.length = length; dns_rdata_fromregion(rdata, rdclass, type, ®ion); } if (result != ISC_R_SUCCESS) { @@ -804,6 +816,7 @@ dns_rdata_fromstruct(dns_rdata_t *rdata, isc_buffer_t st; isc_region_t region; isc_boolean_t use_default = ISC_FALSE; + size_t length; REQUIRE(source != NULL); if (rdata != NULL) { @@ -818,10 +831,13 @@ dns_rdata_fromstruct(dns_rdata_t *rdata, if (use_default) (void)NULL; + length = isc_buffer_usedlength(target) - isc_buffer_usedlength(&st); + if (result == ISC_R_SUCCESS && length > DNS_RDATA_MAXLENGTH) + result = ISC_R_NOSPACE; + if (rdata != NULL && result == ISC_R_SUCCESS) { region.base = isc_buffer_used(&st); - region.length = isc_buffer_usedlength(target) - - isc_buffer_usedlength(&st); + region.length = length; dns_rdata_fromregion(rdata, rdclass, type, ®ion); } if (result != ISC_R_SUCCESS) Modified: head/contrib/bind9/lib/dns/rdataslab.c ============================================================================== --- head/contrib/bind9/lib/dns/rdataslab.c Thu Sep 20 03:48:36 2012 (r240728) +++ head/contrib/bind9/lib/dns/rdataslab.c Thu Sep 20 04:12:09 2012 (r240729) @@ -305,6 +305,7 @@ dns_rdataslab_fromrdataset(dns_rdataset_ length = x[i].rdata.length; if (rdataset->type == dns_rdatatype_rrsig) length++; + INSIST(length <= 0xffff); *rawbuf++ = (length & 0xff00) >> 8; *rawbuf++ = (length & 0x00ff); #if DNS_RDATASET_FIXED Modified: head/contrib/bind9/version ============================================================================== --- head/contrib/bind9/version Thu Sep 20 03:48:36 2012 (r240728) +++ head/contrib/bind9/version Thu Sep 20 04:12:09 2012 (r240729) @@ -7,4 +7,4 @@ MAJORVER=9 MINORVER=8 PATCHVER=3 RELEASETYPE=-P -RELEASEVER=2 +RELEASEVER=3 From owner-svn-src-all@FreeBSD.ORG Thu Sep 20 04:21:06 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 629531065673; Thu, 20 Sep 2012 04:21:06 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4C5798FC12; Thu, 20 Sep 2012 04:21:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8K4L6GI039184; Thu, 20 Sep 2012 04:21:06 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8K4L50S039175; Thu, 20 Sep 2012 04:21:06 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201209200421.q8K4L50S039175@svn.freebsd.org> From: Doug Barton Date: Thu, 20 Sep 2012 04:21:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240730 - in vendor/bind9/dist-9.6: . bin/named bin/nsupdate lib/dns lib/dns/include/dns X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Sep 2012 04:21:06 -0000 Author: dougb Date: Thu Sep 20 04:21:05 2012 New Revision: 240730 URL: http://svn.freebsd.org/changeset/base/240730 Log: Vendor import of BIND 9.6-ESV-R7-P3 Modified: vendor/bind9/dist-9.6/CHANGES vendor/bind9/dist-9.6/bin/named/server.c vendor/bind9/dist-9.6/bin/nsupdate/nsupdate.c vendor/bind9/dist-9.6/lib/dns/include/dns/rdata.h vendor/bind9/dist-9.6/lib/dns/master.c vendor/bind9/dist-9.6/lib/dns/rdata.c vendor/bind9/dist-9.6/lib/dns/rdataslab.c vendor/bind9/dist-9.6/version Modified: vendor/bind9/dist-9.6/CHANGES ============================================================================== --- vendor/bind9/dist-9.6/CHANGES Thu Sep 20 04:12:09 2012 (r240729) +++ vendor/bind9/dist-9.6/CHANGES Thu Sep 20 04:21:05 2012 (r240730) @@ -1,3 +1,11 @@ + --- 9.6-ESV-R7-P3 released --- + +3364. [security] Named could die on specially crafted record. + [RT #30416] + +3358 [bug] Fix declaration of fatal in bin/named/server.c + and bin/nsupdate/main.c. [RT #30522] + --- 9.6-ESV-R7-P2 released --- 3346. [security] Bad-cache data could be used before it was Modified: vendor/bind9/dist-9.6/bin/named/server.c ============================================================================== --- vendor/bind9/dist-9.6/bin/named/server.c Thu Sep 20 04:12:09 2012 (r240729) +++ vendor/bind9/dist-9.6/bin/named/server.c Thu Sep 20 04:21:05 2012 (r240730) @@ -228,7 +228,7 @@ static const struct { { NULL, ISC_FALSE } }; -ISC_PLATFORM_NORETURN_POST static void +ISC_PLATFORM_NORETURN_PRE static void fatal(const char *msg, isc_result_t result) ISC_PLATFORM_NORETURN_POST; static void Modified: vendor/bind9/dist-9.6/bin/nsupdate/nsupdate.c ============================================================================== --- vendor/bind9/dist-9.6/bin/nsupdate/nsupdate.c Thu Sep 20 04:12:09 2012 (r240729) +++ vendor/bind9/dist-9.6/bin/nsupdate/nsupdate.c Thu Sep 20 04:21:05 2012 (r240730) @@ -174,7 +174,7 @@ typedef struct nsu_requestinfo { static void sendrequest(isc_sockaddr_t *srcaddr, isc_sockaddr_t *destaddr, dns_message_t *msg, dns_request_t **request); -ISC_PLATFORM_NORETURN_POST static void +ISC_PLATFORM_NORETURN_PRE static void fatal(const char *format, ...) ISC_FORMAT_PRINTF(1, 2) ISC_PLATFORM_NORETURN_POST; Modified: vendor/bind9/dist-9.6/lib/dns/include/dns/rdata.h ============================================================================== --- vendor/bind9/dist-9.6/lib/dns/include/dns/rdata.h Thu Sep 20 04:12:09 2012 (r240729) +++ vendor/bind9/dist-9.6/lib/dns/include/dns/rdata.h Thu Sep 20 04:21:05 2012 (r240730) @@ -128,6 +128,17 @@ struct dns_rdata { #define DNS_RDATA_OFFLINE 0x0002 /*%< RRSIG has a offline key. */ /* + * The maximum length of a RDATA that can be sent on the wire. + * Max packet size (65535) less header (12), less name (1), type (2), + * class (2), ttl(4), length (2). + * + * None of the defined types that support name compression can exceed + * this and all new types are to be sent uncompressed. + */ + +#define DNS_RDATA_MAXLENGTH 65512U + +/* * Flags affecting rdata formatting style. Flags 0xFFFF0000 * are used by masterfile-level formatting and defined elsewhere. * See additional comments at dns_rdata_tofmttext(). Modified: vendor/bind9/dist-9.6/lib/dns/master.c ============================================================================== --- vendor/bind9/dist-9.6/lib/dns/master.c Thu Sep 20 04:12:09 2012 (r240729) +++ vendor/bind9/dist-9.6/lib/dns/master.c Thu Sep 20 04:21:05 2012 (r240730) @@ -75,7 +75,7 @@ /*% * max message size - header - root - type - class - ttl - rdlen */ -#define MINTSIZ (65535 - 12 - 1 - 2 - 2 - 4 - 2) +#define MINTSIZ DNS_RDATA_MAXLENGTH /*% * Size for tokens in the presentation format, * The largest tokens are the base64 blocks in KEY and CERT records, Modified: vendor/bind9/dist-9.6/lib/dns/rdata.c ============================================================================== --- vendor/bind9/dist-9.6/lib/dns/rdata.c Thu Sep 20 04:12:09 2012 (r240729) +++ vendor/bind9/dist-9.6/lib/dns/rdata.c Thu Sep 20 04:21:05 2012 (r240730) @@ -414,6 +414,7 @@ dns_rdata_fromwire(dns_rdata_t *rdata, d isc_buffer_t st; isc_boolean_t use_default = ISC_FALSE; isc_uint32_t activelength; + size_t length; REQUIRE(dctx != NULL); if (rdata != NULL) { @@ -444,6 +445,14 @@ dns_rdata_fromwire(dns_rdata_t *rdata, d } /* + * Reject any rdata that expands out to more than DNS_RDATA_MAXLENGTH + * as we cannot transmit it. + */ + length = isc_buffer_usedlength(target) - isc_buffer_usedlength(&st); + if (result == ISC_R_SUCCESS && length > DNS_RDATA_MAXLENGTH) + result = DNS_R_FORMERR; + + /* * We should have consumed all of our buffer. */ if (result == ISC_R_SUCCESS && !buffer_empty(source)) @@ -451,8 +460,7 @@ dns_rdata_fromwire(dns_rdata_t *rdata, d if (rdata != NULL && result == ISC_R_SUCCESS) { region.base = isc_buffer_used(&st); - region.length = isc_buffer_usedlength(target) - - isc_buffer_usedlength(&st); + region.length = length; dns_rdata_fromregion(rdata, rdclass, type, ®ion); } @@ -587,6 +595,7 @@ dns_rdata_fromtext(dns_rdata_t *rdata, d unsigned long line; void (*callback)(dns_rdatacallbacks_t *, const char *, ...); isc_result_t tresult; + size_t length; REQUIRE(origin == NULL || dns_name_isabsolute(origin) == ISC_TRUE); if (rdata != NULL) { @@ -658,10 +667,13 @@ dns_rdata_fromtext(dns_rdata_t *rdata, d } } while (1); + length = isc_buffer_usedlength(target) - isc_buffer_usedlength(&st); + if (result == ISC_R_SUCCESS && length > DNS_RDATA_MAXLENGTH) + result = ISC_R_NOSPACE; + if (rdata != NULL && result == ISC_R_SUCCESS) { region.base = isc_buffer_used(&st); - region.length = isc_buffer_usedlength(target) - - isc_buffer_usedlength(&st); + region.length = length; dns_rdata_fromregion(rdata, rdclass, type, ®ion); } if (result != ISC_R_SUCCESS) { @@ -789,6 +801,7 @@ dns_rdata_fromstruct(dns_rdata_t *rdata, isc_buffer_t st; isc_region_t region; isc_boolean_t use_default = ISC_FALSE; + size_t length; REQUIRE(source != NULL); if (rdata != NULL) { @@ -803,10 +816,13 @@ dns_rdata_fromstruct(dns_rdata_t *rdata, if (use_default) (void)NULL; + length = isc_buffer_usedlength(target) - isc_buffer_usedlength(&st); + if (result == ISC_R_SUCCESS && length > DNS_RDATA_MAXLENGTH) + result = ISC_R_NOSPACE; + if (rdata != NULL && result == ISC_R_SUCCESS) { region.base = isc_buffer_used(&st); - region.length = isc_buffer_usedlength(target) - - isc_buffer_usedlength(&st); + region.length = length; dns_rdata_fromregion(rdata, rdclass, type, ®ion); } if (result != ISC_R_SUCCESS) Modified: vendor/bind9/dist-9.6/lib/dns/rdataslab.c ============================================================================== --- vendor/bind9/dist-9.6/lib/dns/rdataslab.c Thu Sep 20 04:12:09 2012 (r240729) +++ vendor/bind9/dist-9.6/lib/dns/rdataslab.c Thu Sep 20 04:21:05 2012 (r240730) @@ -298,6 +298,7 @@ dns_rdataslab_fromrdataset(dns_rdataset_ length = x[i].rdata.length; if (rdataset->type == dns_rdatatype_rrsig) length++; + INSIST(length <= 0xffff); *rawbuf++ = (length & 0xff00) >> 8; *rawbuf++ = (length & 0x00ff); #if DNS_RDATASET_FIXED Modified: vendor/bind9/dist-9.6/version ============================================================================== --- vendor/bind9/dist-9.6/version Thu Sep 20 04:12:09 2012 (r240729) +++ vendor/bind9/dist-9.6/version Thu Sep 20 04:21:05 2012 (r240730) @@ -7,4 +7,4 @@ MAJORVER=9 MINORVER=6 PATCHVER= RELEASETYPE=-ESV -RELEASEVER=-R7-P2 +RELEASEVER=-R7-P3 From owner-svn-src-all@FreeBSD.ORG Thu Sep 20 04:21:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B32CF10656A4; Thu, 20 Sep 2012 04:21:29 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 85BFF8FC08; Thu, 20 Sep 2012 04:21:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8K4LT7Z039272; Thu, 20 Sep 2012 04:21:29 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8K4LTKA039271; Thu, 20 Sep 2012 04:21:29 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201209200421.q8K4LTKA039271@svn.freebsd.org> From: Doug Barton Date: Thu, 20 Sep 2012 04:21:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240731 - vendor/bind9/9.6-ESV-R7-P3 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Sep 2012 04:21:29 -0000 Author: dougb Date: Thu Sep 20 04:21:29 2012 New Revision: 240731 URL: http://svn.freebsd.org/changeset/base/240731 Log: Tag the 9.6-ESV-R7-P3 release Added: vendor/bind9/9.6-ESV-R7-P3/ - copied from r240730, vendor/bind9/dist-9.6/ From owner-svn-src-all@FreeBSD.ORG Thu Sep 20 04:35:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9E532106564A; Thu, 20 Sep 2012 04:35:21 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 878F08FC08; Thu, 20 Sep 2012 04:35:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8K4ZLfC041316; Thu, 20 Sep 2012 04:35:21 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8K4ZLRI041307; Thu, 20 Sep 2012 04:35:21 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201209200435.q8K4ZLRI041307@svn.freebsd.org> From: Doug Barton Date: Thu, 20 Sep 2012 04:35: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: r240732 - in stable/8/contrib/bind9: . bin/named bin/nsupdate lib/dns lib/dns/include/dns X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Sep 2012 04:35:21 -0000 Author: dougb Date: Thu Sep 20 04:35:20 2012 New Revision: 240732 URL: http://svn.freebsd.org/changeset/base/240732 Log: Upgrade to 9.6-ESV-R7-P3: Prevents a crash when queried for a record whose RDATA exceeds 65535 bytes. Prevents a crash when validating caused by using "Bad cache" data before it has been initialized. ISC_QUEUE handling for recursive clients was updated to address a race condition that could cause a memory leak. This rarely occurred with UDP clients, but could be a significant problem for a server handling a steady rate of TCP queries. A condition has been corrected where improper handling of zero-length RDATA could cause undesirable behavior, including termination of the named process. For more information: https://kb.isc.org/article/AA-00788 Modified: stable/8/contrib/bind9/CHANGES stable/8/contrib/bind9/bin/named/server.c stable/8/contrib/bind9/bin/nsupdate/nsupdate.c stable/8/contrib/bind9/lib/dns/include/dns/rdata.h stable/8/contrib/bind9/lib/dns/master.c stable/8/contrib/bind9/lib/dns/rdata.c stable/8/contrib/bind9/lib/dns/rdataslab.c stable/8/contrib/bind9/version Directory Properties: stable/8/contrib/bind9/ (props changed) Modified: stable/8/contrib/bind9/CHANGES ============================================================================== --- stable/8/contrib/bind9/CHANGES Thu Sep 20 04:21:29 2012 (r240731) +++ stable/8/contrib/bind9/CHANGES Thu Sep 20 04:35:20 2012 (r240732) @@ -1,3 +1,11 @@ + --- 9.6-ESV-R7-P3 released --- + +3364. [security] Named could die on specially crafted record. + [RT #30416] + +3358 [bug] Fix declaration of fatal in bin/named/server.c + and bin/nsupdate/main.c. [RT #30522] + --- 9.6-ESV-R7-P2 released --- 3346. [security] Bad-cache data could be used before it was Modified: stable/8/contrib/bind9/bin/named/server.c ============================================================================== --- stable/8/contrib/bind9/bin/named/server.c Thu Sep 20 04:21:29 2012 (r240731) +++ stable/8/contrib/bind9/bin/named/server.c Thu Sep 20 04:35:20 2012 (r240732) @@ -228,7 +228,7 @@ static const struct { { NULL, ISC_FALSE } }; -ISC_PLATFORM_NORETURN_POST static void +ISC_PLATFORM_NORETURN_PRE static void fatal(const char *msg, isc_result_t result) ISC_PLATFORM_NORETURN_POST; static void Modified: stable/8/contrib/bind9/bin/nsupdate/nsupdate.c ============================================================================== --- stable/8/contrib/bind9/bin/nsupdate/nsupdate.c Thu Sep 20 04:21:29 2012 (r240731) +++ stable/8/contrib/bind9/bin/nsupdate/nsupdate.c Thu Sep 20 04:35:20 2012 (r240732) @@ -174,7 +174,7 @@ typedef struct nsu_requestinfo { static void sendrequest(isc_sockaddr_t *srcaddr, isc_sockaddr_t *destaddr, dns_message_t *msg, dns_request_t **request); -ISC_PLATFORM_NORETURN_POST static void +ISC_PLATFORM_NORETURN_PRE static void fatal(const char *format, ...) ISC_FORMAT_PRINTF(1, 2) ISC_PLATFORM_NORETURN_POST; Modified: stable/8/contrib/bind9/lib/dns/include/dns/rdata.h ============================================================================== --- stable/8/contrib/bind9/lib/dns/include/dns/rdata.h Thu Sep 20 04:21:29 2012 (r240731) +++ stable/8/contrib/bind9/lib/dns/include/dns/rdata.h Thu Sep 20 04:35:20 2012 (r240732) @@ -128,6 +128,17 @@ struct dns_rdata { #define DNS_RDATA_OFFLINE 0x0002 /*%< RRSIG has a offline key. */ /* + * The maximum length of a RDATA that can be sent on the wire. + * Max packet size (65535) less header (12), less name (1), type (2), + * class (2), ttl(4), length (2). + * + * None of the defined types that support name compression can exceed + * this and all new types are to be sent uncompressed. + */ + +#define DNS_RDATA_MAXLENGTH 65512U + +/* * Flags affecting rdata formatting style. Flags 0xFFFF0000 * are used by masterfile-level formatting and defined elsewhere. * See additional comments at dns_rdata_tofmttext(). Modified: stable/8/contrib/bind9/lib/dns/master.c ============================================================================== --- stable/8/contrib/bind9/lib/dns/master.c Thu Sep 20 04:21:29 2012 (r240731) +++ stable/8/contrib/bind9/lib/dns/master.c Thu Sep 20 04:35:20 2012 (r240732) @@ -75,7 +75,7 @@ /*% * max message size - header - root - type - class - ttl - rdlen */ -#define MINTSIZ (65535 - 12 - 1 - 2 - 2 - 4 - 2) +#define MINTSIZ DNS_RDATA_MAXLENGTH /*% * Size for tokens in the presentation format, * The largest tokens are the base64 blocks in KEY and CERT records, Modified: stable/8/contrib/bind9/lib/dns/rdata.c ============================================================================== --- stable/8/contrib/bind9/lib/dns/rdata.c Thu Sep 20 04:21:29 2012 (r240731) +++ stable/8/contrib/bind9/lib/dns/rdata.c Thu Sep 20 04:35:20 2012 (r240732) @@ -414,6 +414,7 @@ dns_rdata_fromwire(dns_rdata_t *rdata, d isc_buffer_t st; isc_boolean_t use_default = ISC_FALSE; isc_uint32_t activelength; + size_t length; REQUIRE(dctx != NULL); if (rdata != NULL) { @@ -444,6 +445,14 @@ dns_rdata_fromwire(dns_rdata_t *rdata, d } /* + * Reject any rdata that expands out to more than DNS_RDATA_MAXLENGTH + * as we cannot transmit it. + */ + length = isc_buffer_usedlength(target) - isc_buffer_usedlength(&st); + if (result == ISC_R_SUCCESS && length > DNS_RDATA_MAXLENGTH) + result = DNS_R_FORMERR; + + /* * We should have consumed all of our buffer. */ if (result == ISC_R_SUCCESS && !buffer_empty(source)) @@ -451,8 +460,7 @@ dns_rdata_fromwire(dns_rdata_t *rdata, d if (rdata != NULL && result == ISC_R_SUCCESS) { region.base = isc_buffer_used(&st); - region.length = isc_buffer_usedlength(target) - - isc_buffer_usedlength(&st); + region.length = length; dns_rdata_fromregion(rdata, rdclass, type, ®ion); } @@ -587,6 +595,7 @@ dns_rdata_fromtext(dns_rdata_t *rdata, d unsigned long line; void (*callback)(dns_rdatacallbacks_t *, const char *, ...); isc_result_t tresult; + size_t length; REQUIRE(origin == NULL || dns_name_isabsolute(origin) == ISC_TRUE); if (rdata != NULL) { @@ -658,10 +667,13 @@ dns_rdata_fromtext(dns_rdata_t *rdata, d } } while (1); + length = isc_buffer_usedlength(target) - isc_buffer_usedlength(&st); + if (result == ISC_R_SUCCESS && length > DNS_RDATA_MAXLENGTH) + result = ISC_R_NOSPACE; + if (rdata != NULL && result == ISC_R_SUCCESS) { region.base = isc_buffer_used(&st); - region.length = isc_buffer_usedlength(target) - - isc_buffer_usedlength(&st); + region.length = length; dns_rdata_fromregion(rdata, rdclass, type, ®ion); } if (result != ISC_R_SUCCESS) { @@ -789,6 +801,7 @@ dns_rdata_fromstruct(dns_rdata_t *rdata, isc_buffer_t st; isc_region_t region; isc_boolean_t use_default = ISC_FALSE; + size_t length; REQUIRE(source != NULL); if (rdata != NULL) { @@ -803,10 +816,13 @@ dns_rdata_fromstruct(dns_rdata_t *rdata, if (use_default) (void)NULL; + length = isc_buffer_usedlength(target) - isc_buffer_usedlength(&st); + if (result == ISC_R_SUCCESS && length > DNS_RDATA_MAXLENGTH) + result = ISC_R_NOSPACE; + if (rdata != NULL && result == ISC_R_SUCCESS) { region.base = isc_buffer_used(&st); - region.length = isc_buffer_usedlength(target) - - isc_buffer_usedlength(&st); + region.length = length; dns_rdata_fromregion(rdata, rdclass, type, ®ion); } if (result != ISC_R_SUCCESS) Modified: stable/8/contrib/bind9/lib/dns/rdataslab.c ============================================================================== --- stable/8/contrib/bind9/lib/dns/rdataslab.c Thu Sep 20 04:21:29 2012 (r240731) +++ stable/8/contrib/bind9/lib/dns/rdataslab.c Thu Sep 20 04:35:20 2012 (r240732) @@ -298,6 +298,7 @@ dns_rdataslab_fromrdataset(dns_rdataset_ length = x[i].rdata.length; if (rdataset->type == dns_rdatatype_rrsig) length++; + INSIST(length <= 0xffff); *rawbuf++ = (length & 0xff00) >> 8; *rawbuf++ = (length & 0x00ff); #if DNS_RDATASET_FIXED Modified: stable/8/contrib/bind9/version ============================================================================== --- stable/8/contrib/bind9/version Thu Sep 20 04:21:29 2012 (r240731) +++ stable/8/contrib/bind9/version Thu Sep 20 04:35:20 2012 (r240732) @@ -7,4 +7,4 @@ MAJORVER=9 MINORVER=6 PATCHVER= RELEASETYPE=-ESV -RELEASEVER=-R7-P2 +RELEASEVER=-R7-P3 From owner-svn-src-all@FreeBSD.ORG Thu Sep 20 04:53:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8355B106564A; Thu, 20 Sep 2012 04:53:13 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6FF798FC12; Thu, 20 Sep 2012 04:53:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8K4rDQE043955; Thu, 20 Sep 2012 04:53:13 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8K4rDmZ043953; Thu, 20 Sep 2012 04:53:13 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201209200453.q8K4rDmZ043953@svn.freebsd.org> From: Joel Dahl Date: Thu, 20 Sep 2012 04:53:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240733 - head/share/man/man7 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Sep 2012 04:53:13 -0000 Author: joel (doc committer) Date: Thu Sep 20 04:53:12 2012 New Revision: 240733 URL: http://svn.freebsd.org/changeset/base/240733 Log: mdoc: remove superfluous paragraph macro. Modified: head/share/man/man7/development.7 Modified: head/share/man/man7/development.7 ============================================================================== --- head/share/man/man7/development.7 Thu Sep 20 04:35:20 2012 (r240732) +++ head/share/man/man7/development.7 Thu Sep 20 04:53:12 2012 (r240733) @@ -437,7 +437,6 @@ Many developers choose to maintain a loc to test patches or build a custom distribution. This can be done with svn or another source code management system (git, mercurial, Perforce, BitKeeper) with its own repository. -.Pp .Sh "UPDATING VIA SVN" By using a .Xr cron 8 From owner-svn-src-all@FreeBSD.ORG Thu Sep 20 05:41:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EC028106566B; Thu, 20 Sep 2012 05:41:21 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8356E8FC08; Thu, 20 Sep 2012 05:41:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8K5fLIk051472; Thu, 20 Sep 2012 05:41:21 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8K5fL7j051469; Thu, 20 Sep 2012 05:41:21 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201209200541.q8K5fL7j051469@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 20 Sep 2012 05:41:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240734 - head/contrib/bsnmp/snmpd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Sep 2012 05:41:22 -0000 Author: glebius Date: Thu Sep 20 05:41:20 2012 New Revision: 240734 URL: http://svn.freebsd.org/changeset/base/240734 Log: Re-do r240271: - Set IP_RECVDSTADDR sockopt on the socket only in case if it is INADDR_ANY bound. - Supply IP_SENDSRCADDR control message only if we did receive IP_RECVDSTADDR control message. This fixes operation of snmpd bound to a specific local IP address. PR: bin/171279 Modified: head/contrib/bsnmp/snmpd/main.c head/contrib/bsnmp/snmpd/trans_udp.c Modified: head/contrib/bsnmp/snmpd/main.c ============================================================================== --- head/contrib/bsnmp/snmpd/main.c Thu Sep 20 04:53:12 2012 (r240733) +++ head/contrib/bsnmp/snmpd/main.c Thu Sep 20 05:41:20 2012 (r240734) @@ -1203,6 +1203,8 @@ snmpd_input(struct port_input *pi, struc ret = recv_stream(pi); } else { + struct in_addr *laddr; + memset(cbuf, 0, CMSG_SPACE(sizeof(struct in_addr))); msg.msg_control = cbuf; msg.msg_controllen = CMSG_SPACE(sizeof(struct in_addr)); @@ -1210,8 +1212,14 @@ snmpd_input(struct port_input *pi, struc cmsgp->cmsg_len = CMSG_LEN(sizeof(struct in_addr)); cmsgp->cmsg_level = IPPROTO_IP; cmsgp->cmsg_type = IP_SENDSRCADDR; + laddr = (struct in_addr *)CMSG_DATA(cmsgp); - ret = recv_dgram(pi, (struct in_addr *)CMSG_DATA(cmsgp)); + ret = recv_dgram(pi, laddr); + + if (laddr->s_addr == 0) { + msg.msg_control = NULL; + msg.msg_controllen = 0; + } } if (ret == -1) Modified: head/contrib/bsnmp/snmpd/trans_udp.c ============================================================================== --- head/contrib/bsnmp/snmpd/trans_udp.c Thu Sep 20 04:53:12 2012 (r240733) +++ head/contrib/bsnmp/snmpd/trans_udp.c Thu Sep 20 05:41:20 2012 (r240734) @@ -109,13 +109,6 @@ udp_init_port(struct tport *tp) syslog(LOG_ERR, "creating UDP socket: %m"); return (SNMP_ERR_RES_UNAVAIL); } - if (setsockopt(p->input.fd, IPPROTO_IP, IP_RECVDSTADDR, &on, - sizeof(on)) == -1) { - syslog(LOG_ERR, "setsockopt(IP_RECVDSTADDR): %m"); - close(p->input.fd); - p->input.fd = -1; - return (SNMP_ERR_GENERR); - } ip = (p->addr[0] << 24) | (p->addr[1] << 16) | (p->addr[2] << 8) | p->addr[3]; memset(&addr, 0, sizeof(addr)); @@ -123,6 +116,14 @@ udp_init_port(struct tport *tp) addr.sin_port = htons(p->port); addr.sin_family = AF_INET; addr.sin_len = sizeof(addr); + if (addr.sin_addr.s_addr == INADDR_ANY && + setsockopt(p->input.fd, IPPROTO_IP, IP_RECVDSTADDR, &on, + sizeof(on)) == -1) { + syslog(LOG_ERR, "setsockopt(IP_RECVDSTADDR): %m"); + close(p->input.fd); + p->input.fd = -1; + return (SNMP_ERR_GENERR); + } if (bind(p->input.fd, (struct sockaddr *)&addr, sizeof(addr))) { if (errno == EADDRNOTAVAIL) { close(p->input.fd); From owner-svn-src-all@FreeBSD.ORG Thu Sep 20 05:49:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0C40A106566C; Thu, 20 Sep 2012 05:49:32 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EC7A08FC08; Thu, 20 Sep 2012 05:49:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8K5nVGO052747; Thu, 20 Sep 2012 05:49:31 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8K5nVHs052745; Thu, 20 Sep 2012 05:49:31 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201209200549.q8K5nVHs052745@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 20 Sep 2012 05:49:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240735 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Sep 2012 05:49:32 -0000 Author: glebius Date: Thu Sep 20 05:49:31 2012 New Revision: 240735 URL: http://svn.freebsd.org/changeset/base/240735 Log: Redo r240386 providing more correct information. Modified: head/share/man/man4/ip.4 Modified: head/share/man/man4/ip.4 ============================================================================== --- head/share/man/man4/ip.4 Thu Sep 20 05:41:20 2012 (r240734) +++ head/share/man/man4/ip.4 Thu Sep 20 05:49:31 2012 (r240735) @@ -32,7 +32,7 @@ .\" @(#)ip.4 8.2 (Berkeley) 11/30/93 .\" $FreeBSD$ .\" -.Dd September 12, 2012 +.Dd September 20, 2012 .Dt IP 4 .Os .Sh NAME @@ -187,21 +187,19 @@ cmsg_level = IPPROTO_IP cmsg_type = IP_SENDSRCADDR .Ed .Pp -The socket should be bound to a local port. -The socket may be bound or not bound to a local address. -In the former case address supplied with -.Dv IP_SENDSRCADDR -overrides bound address. -If the socket is bound to a local address and the address supplied with +The socket should be either bound to +.Dv INADDR_ANY +and a local port, and the address supplied with .Dv IP_SENDSRCADDR -is +should't be .Dv INADDR_ANY , -then bound address is overriden via generic source address selection logic, -which would choose IP address of interface closest to destination. -If the socket is not bound to a local address, then address supplied with +or the socket should be bound to a local address and the address supplied with .Dv IP_SENDSRCADDR -can't be +should be .Dv INADDR_ANY . +In the latter case bound address is overriden via generic source address +selection logic, which would choose IP address of interface closest to +destination. .Pp For convenience, .Dv IP_SENDSRCADDR From owner-svn-src-all@FreeBSD.ORG Thu Sep 20 06:52:06 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AB1AB1065670; Thu, 20 Sep 2012 06:52:06 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7D7DB8FC0C; Thu, 20 Sep 2012 06:52:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8K6q6KC061852; Thu, 20 Sep 2012 06:52:06 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8K6q6Eq061849; Thu, 20 Sep 2012 06:52:06 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201209200652.q8K6q6Eq061849@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 20 Sep 2012 06:52:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240736 - in head/sys: net netpfil/pf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Sep 2012 06:52:06 -0000 Author: glebius Date: Thu Sep 20 06:52:05 2012 New Revision: 240736 URL: http://svn.freebsd.org/changeset/base/240736 Log: Utilize Jenkins hash with random seed for source nodes storage. Modified: head/sys/net/pfvar.h head/sys/netpfil/pf/pf.c Modified: head/sys/net/pfvar.h ============================================================================== --- head/sys/net/pfvar.h Thu Sep 20 05:49:31 2012 (r240735) +++ head/sys/net/pfvar.h Thu Sep 20 06:52:05 2012 (r240736) @@ -1730,28 +1730,6 @@ extern int pf_state_insert(struct pfi struct pf_state *); extern void pf_free_state(struct pf_state *); -static __inline u_int -pf_hashsrc(struct pf_addr *addr, sa_family_t af) -{ - u_int h; - -#define ADDR_HASH(a) ((a) ^ ((a) >> 16)) - - switch (af) { - case AF_INET: - h = ADDR_HASH(addr->v4.s_addr); - break; - case AF_INET6: - h = ADDR_HASH(addr->v6.__u6_addr.__u6_addr32[3]); - break; - default: - panic("%s: unknown address family %u", __func__, af); - } -#undef ADDR_HASH - - return (h & V_pf_srchashmask); -} - static __inline void pf_ref_state(struct pf_state *s) { Modified: head/sys/netpfil/pf/pf.c ============================================================================== --- head/sys/netpfil/pf/pf.c Thu Sep 20 05:49:31 2012 (r240735) +++ head/sys/netpfil/pf/pf.c Thu Sep 20 06:52:05 2012 (r240736) @@ -387,6 +387,27 @@ pf_hashkey(struct pf_state_key *sk) return (h & V_pf_hashmask); } +static __inline uint32_t +pf_hashsrc(struct pf_addr *addr, sa_family_t af) +{ + uint32_t h; + + switch (af) { + case AF_INET: + h = jenkins_hash32((uint32_t *)&addr->v4, + sizeof(addr->v4)/sizeof(uint32_t), V_pf_hashseed); + break; + case AF_INET6: + h = jenkins_hash32((uint32_t *)&addr->v6, + sizeof(addr->v6)/sizeof(uint32_t), V_pf_hashseed); + break; + default: + panic("%s: unknown address family %u", __func__, af); + } + + return (h & V_pf_srchashmask); +} + #ifdef INET6 void pf_addrcpy(struct pf_addr *dst, struct pf_addr *src, sa_family_t af) From owner-svn-src-all@FreeBSD.ORG Thu Sep 20 07:04:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EA0F91065674; Thu, 20 Sep 2012 07:04:08 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D54998FC15; Thu, 20 Sep 2012 07:04:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8K748Ai063824; Thu, 20 Sep 2012 07:04:08 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8K748Kg063822; Thu, 20 Sep 2012 07:04:08 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201209200704.q8K748Kg063822@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 20 Sep 2012 07:04:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240737 - head/sys/netpfil/pf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Sep 2012 07:04:09 -0000 Author: glebius Date: Thu Sep 20 07:04:08 2012 New Revision: 240737 URL: http://svn.freebsd.org/changeset/base/240737 Log: Reduce copy/paste when freeing an source node. Modified: head/sys/netpfil/pf/pf.c Modified: head/sys/netpfil/pf/pf.c ============================================================================== --- head/sys/netpfil/pf/pf.c Thu Sep 20 06:52:05 2012 (r240736) +++ head/sys/netpfil/pf/pf.c Thu Sep 20 07:04:08 2012 (r240737) @@ -673,6 +673,11 @@ pf_remove_src_node(struct pf_src_node *s PF_HASHROW_LOCK(sh); LIST_REMOVE(src, entry); PF_HASHROW_UNLOCK(sh); + + V_pf_status.scounters[SCNT_SRC_NODE_REMOVALS]++; + V_pf_status.src_nodes--; + + uma_zfree(V_pf_sources_z, src); } /* Data storage structures initialization. */ @@ -3547,18 +3552,12 @@ csfailed: if (nk != NULL) uma_zfree(V_pf_state_key_z, nk); - if (sn != NULL && sn->states == 0 && sn->expire == 0) { + if (sn != NULL && sn->states == 0 && sn->expire == 0) pf_remove_src_node(sn); - V_pf_status.scounters[SCNT_SRC_NODE_REMOVALS]++; - V_pf_status.src_nodes--; - uma_zfree(V_pf_sources_z, sn); - } - if (nsn != sn && nsn != NULL && nsn->states == 0 && nsn->expire == 0) { + + if (nsn != sn && nsn != NULL && nsn->states == 0 && nsn->expire == 0) pf_remove_src_node(nsn); - V_pf_status.scounters[SCNT_SRC_NODE_REMOVALS]++; - V_pf_status.src_nodes--; - uma_zfree(V_pf_sources_z, nsn); - } + return (PF_DROP); } From owner-svn-src-all@FreeBSD.ORG Thu Sep 20 07:07:35 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C9BBD106566C; Thu, 20 Sep 2012 07:07:35 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B5E318FC19; Thu, 20 Sep 2012 07:07:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8K77ZaS064386; Thu, 20 Sep 2012 07:07:35 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8K77Zlj064384; Thu, 20 Sep 2012 07:07:35 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201209200707.q8K77Zlj064384@svn.freebsd.org> From: Kevin Lo Date: Thu, 20 Sep 2012 07:07:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240738 - head/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Sep 2012 07:07:35 -0000 Author: kevlo Date: Thu Sep 20 07:07:35 2012 New Revision: 240738 URL: http://svn.freebsd.org/changeset/base/240738 Log: Remove references to brelse and bremfree, which don't actually exist. Modified: head/share/man/man9/vinvalbuf.9 Modified: head/share/man/man9/vinvalbuf.9 ============================================================================== --- head/share/man/man9/vinvalbuf.9 Thu Sep 20 07:04:08 2012 (r240737) +++ head/share/man/man9/vinvalbuf.9 Thu Sep 20 07:07:35 2012 (r240738) @@ -110,8 +110,6 @@ set in .Fa slpflag ) .El .Sh SEE ALSO -.Xr brelse 9 , -.Xr bremfree 9 , .Xr tsleep 9 , .Xr VOP_FSYNC 9 .Sh AUTHORS From owner-svn-src-all@FreeBSD.ORG Thu Sep 20 08:30:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E81D7106566B; Thu, 20 Sep 2012 08:30:17 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D3BDA8FC1A; Thu, 20 Sep 2012 08:30:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8K8UHdr077800; Thu, 20 Sep 2012 08:30:17 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8K8UHJk077797; Thu, 20 Sep 2012 08:30:17 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201209200830.q8K8UHJk077797@svn.freebsd.org> From: Gavin Atkinson Date: Thu, 20 Sep 2012 08:30:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240739 - in head: sys/dev/pci usr.sbin/pciconf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Sep 2012 08:30:18 -0000 Author: gavin Date: Thu Sep 20 08:30:17 2012 New Revision: 240739 URL: http://svn.freebsd.org/changeset/base/240739 Log: The correct generic term for PCIS_STORAGE_NVM is "NVM" not "NVM Express". Submitted by: jimharris MFC after: 6 days Modified: head/sys/dev/pci/pci.c head/usr.sbin/pciconf/pciconf.c Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Thu Sep 20 07:07:35 2012 (r240738) +++ head/sys/dev/pci/pci.c Thu Sep 20 08:30:17 2012 (r240739) @@ -3661,7 +3661,7 @@ static struct {PCIC_STORAGE, PCIS_STORAGE_ATA_ADMA, "ATA (ADMA)"}, {PCIC_STORAGE, PCIS_STORAGE_SATA, "SATA"}, {PCIC_STORAGE, PCIS_STORAGE_SAS, "SAS"}, - {PCIC_STORAGE, PCIS_STORAGE_NVM, "NVM Express"}, + {PCIC_STORAGE, PCIS_STORAGE_NVM, "NVM"}, {PCIC_NETWORK, -1, "network"}, {PCIC_NETWORK, PCIS_NETWORK_ETHERNET, "ethernet"}, {PCIC_NETWORK, PCIS_NETWORK_TOKENRING, "token ring"}, Modified: head/usr.sbin/pciconf/pciconf.c ============================================================================== --- head/usr.sbin/pciconf/pciconf.c Thu Sep 20 07:07:35 2012 (r240738) +++ head/usr.sbin/pciconf/pciconf.c Thu Sep 20 08:30:17 2012 (r240739) @@ -345,7 +345,7 @@ static struct {PCIC_STORAGE, PCIS_STORAGE_ATA_ADMA, "ATA (ADMA)"}, {PCIC_STORAGE, PCIS_STORAGE_SATA, "SATA"}, {PCIC_STORAGE, PCIS_STORAGE_SAS, "SAS"}, - {PCIC_STORAGE, PCIS_STORAGE_NVM, "NVM Express"}, + {PCIC_STORAGE, PCIS_STORAGE_NVM, "NVM"}, {PCIC_NETWORK, -1, "network"}, {PCIC_NETWORK, PCIS_NETWORK_ETHERNET, "ethernet"}, {PCIC_NETWORK, PCIS_NETWORK_TOKENRING, "token ring"}, From owner-svn-src-all@FreeBSD.ORG Thu Sep 20 08:50:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DA80B106566C; Thu, 20 Sep 2012 08:50:39 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C60E48FC0C; Thu, 20 Sep 2012 08:50:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8K8odXO081348; Thu, 20 Sep 2012 08:50:39 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8K8odbp081346; Thu, 20 Sep 2012 08:50:39 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201209200850.q8K8odbp081346@svn.freebsd.org> From: Baptiste Daroussin Date: Thu, 20 Sep 2012 08:50:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240740 - head/rescue/rescue X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Sep 2012 08:50:40 -0000 Author: bapt Date: Thu Sep 20 08:50:39 2012 New Revision: 240740 URL: http://svn.freebsd.org/changeset/base/240740 Log: unbreak build: rescue now needs -ljail if MK_ZFS is on Modified: head/rescue/rescue/Makefile Modified: head/rescue/rescue/Makefile ============================================================================== --- head/rescue/rescue/Makefile Thu Sep 20 08:30:17 2012 (r240739) +++ head/rescue/rescue/Makefile Thu Sep 20 08:50:39 2012 (r240740) @@ -123,7 +123,7 @@ CRUNCH_LIBS+= -lalias -lcam -lcurses -ld CRUNCH_LIBS+= -lipx .endif .if ${MK_ZFS} != "no" -CRUNCH_LIBS+= -lavl -lzfs -lnvpair -lpthread -luutil -lumem +CRUNCH_LIBS+= -lavl -ljail -lzfs -lnvpair -lpthread -luutil -lumem .endif CRUNCH_LIBS+= -lgeom -lbsdxml -lkiconv -lmd -lsbuf -lufs -lz From owner-svn-src-all@FreeBSD.ORG Thu Sep 20 09:52:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B26F106564A; Thu, 20 Sep 2012 09:52:58 +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 EA4A58FC12; Thu, 20 Sep 2012 09:52:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8K9qvXN092285; Thu, 20 Sep 2012 09:52:57 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8K9qvDX092283; Thu, 20 Sep 2012 09:52:57 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201209200952.q8K9qvDX092283@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 20 Sep 2012 09:52:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240741 - head/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Sep 2012 09:52:58 -0000 Author: kib Date: Thu Sep 20 09:52:57 2012 New Revision: 240741 URL: http://svn.freebsd.org/changeset/base/240741 Log: Plug the accounting leak for the wired pages when msync(MS_INVALIDATE) is performed on the vnode mapping which is wired in other address space. While there, explicitely assert that the page is unwired and zero the wire_count instead of substract. The condition is rechecked later in vm_page_free(_toq) already. Reported and tested by: zont Reviewed by: alc (previous version) MFC after: 1 week Modified: head/sys/vm/vm_object.c Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Thu Sep 20 08:50:39 2012 (r240740) +++ head/sys/vm/vm_object.c Thu Sep 20 09:52:57 2012 (r240741) @@ -1918,8 +1918,13 @@ again: if ((options & OBJPR_NOTMAPPED) == 0) { pmap_remove_all(p); /* Account for removal of wired mappings. */ - if (wirings != 0) - p->wire_count -= wirings; + if (wirings != 0) { + KASSERT(p->wire_count == wirings, + ("inconsistent wire count %d %d %p", + p->wire_count, wirings, p)); + p->wire_count = 0; + atomic_subtract_int(&cnt.v_wire_count, 1); + } } vm_page_free(p); vm_page_unlock(p); From owner-svn-src-all@FreeBSD.ORG Thu Sep 20 10:05:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 93DB1106566C; Thu, 20 Sep 2012 10:05:11 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 658548FC1F; Thu, 20 Sep 2012 10:05:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8KA5BiJ094416; Thu, 20 Sep 2012 10:05:11 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8KA5BqZ094414; Thu, 20 Sep 2012 10:05:11 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201209201005.q8KA5BqZ094414@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 20 Sep 2012 10:05:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240742 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Sep 2012 10:05:11 -0000 Author: glebius Date: Thu Sep 20 10:05:10 2012 New Revision: 240742 URL: http://svn.freebsd.org/changeset/base/240742 Log: Convert lagg(4) to use if_transmit instead of if_start. In collaboration with: thompsa, sbruno, fabient Modified: head/sys/net/if_lagg.c Modified: head/sys/net/if_lagg.c ============================================================================== --- head/sys/net/if_lagg.c Thu Sep 20 09:52:57 2012 (r240741) +++ head/sys/net/if_lagg.c Thu Sep 20 10:05:10 2012 (r240742) @@ -110,7 +110,8 @@ static int lagg_ether_cmdmulti(struct la static int lagg_setflag(struct lagg_port *, int, int, int (*func)(struct ifnet *, int)); static int lagg_setflags(struct lagg_port *, int status); -static void lagg_start(struct ifnet *); +static int lagg_transmit(struct ifnet *, struct mbuf *); +static void lagg_qflush(struct ifnet *); static int lagg_media_change(struct ifnet *); static void lagg_media_status(struct ifnet *, struct ifmediareq *); static struct lagg_port *lagg_link_active(struct lagg_softc *, @@ -312,15 +313,12 @@ lagg_clone_create(struct if_clone *ifc, if_initname(ifp, ifc->ifc_name, unit); ifp->if_softc = sc; - ifp->if_start = lagg_start; + ifp->if_transmit = lagg_transmit; + ifp->if_qflush = lagg_qflush; ifp->if_init = lagg_init; ifp->if_ioctl = lagg_ioctl; ifp->if_flags = IFF_SIMPLEX | IFF_BROADCAST | IFF_MULTICAST; - IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); - ifp->if_snd.ifq_drv_maxlen = ifqmaxlen; - IFQ_SET_READY(&ifp->if_snd); - /* * Attach as an ordinary ethernet device, children will be attached * as special device IFT_IEEE8023ADLAG. @@ -1222,35 +1220,45 @@ lagg_setflags(struct lagg_port *lp, int return (0); } -static void -lagg_start(struct ifnet *ifp) +static int +lagg_transmit(struct ifnet *ifp, struct mbuf *m) { struct lagg_softc *sc = (struct lagg_softc *)ifp->if_softc; - struct mbuf *m; - int error = 0; + int error, len, mcast; + + len = m->m_pkthdr.len; + mcast = (m->m_flags & (M_MCAST | M_BCAST)) ? 1 : 0; LAGG_RLOCK(sc); /* We need a Tx algorithm and at least one port */ if (sc->sc_proto == LAGG_PROTO_NONE || sc->sc_count == 0) { - IF_DRAIN(&ifp->if_snd); LAGG_RUNLOCK(sc); - return; + m_freem(m); + ifp->if_oerrors++; + return (ENXIO); } - for (;; error = 0) { - IFQ_DEQUEUE(&ifp->if_snd, m); - if (m == NULL) - break; + ETHER_BPF_MTAP(ifp, m); - ETHER_BPF_MTAP(ifp, m); - - error = (*sc->sc_start)(sc, m); - if (error == 0) - ifp->if_opackets++; - else - ifp->if_oerrors++; - } + error = (*sc->sc_start)(sc, m); LAGG_RUNLOCK(sc); + + if (error == 0) { + ifp->if_opackets++; + ifp->if_omcasts += mcast; + ifp->if_obytes += len; + } else + ifp->if_oerrors++; + + return (error); +} + +/* + * The ifp->if_qflush entry point for lagg(4) is no-op. + */ +static void +lagg_qflush(struct ifnet *ifp __unused) +{ } static struct mbuf * From owner-svn-src-all@FreeBSD.ORG Thu Sep 20 10:07:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E28C7106566B; Thu, 20 Sep 2012 10:07:31 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B2FEC8FC18; Thu, 20 Sep 2012 10:07:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8KA7Vpd094893; Thu, 20 Sep 2012 10:07:31 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8KA7VmI094889; Thu, 20 Sep 2012 10:07:31 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201209201007.q8KA7VmI094889@svn.freebsd.org> From: Kevin Lo Date: Thu, 20 Sep 2012 10:07:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240743 - in head/sys/dev: atkbdc isci/scil usb/serial X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Sep 2012 10:07:32 -0000 Author: kevlo Date: Thu Sep 20 10:07:31 2012 New Revision: 240743 URL: http://svn.freebsd.org/changeset/base/240743 Log: Fix typo: s/protocl/protocol Modified: head/sys/dev/atkbdc/psm.c head/sys/dev/isci/scil/scic_sds_phy.c head/sys/dev/usb/serial/uftdi_reg.h Modified: head/sys/dev/atkbdc/psm.c ============================================================================== --- head/sys/dev/atkbdc/psm.c Thu Sep 20 10:05:10 2012 (r240742) +++ head/sys/dev/atkbdc/psm.c Thu Sep 20 10:07:31 2012 (r240743) @@ -2456,7 +2456,7 @@ proc_mmanplus(struct psm_softc *sc, pack { /* - * PS2++ protocl packet + * PS2++ protocol packet * * b7 b6 b5 b4 b3 b2 b1 b0 * byte 1: * 1 p3 p2 1 * * * @@ -3740,7 +3740,7 @@ enable_mmanplus(KBDC kbdc, struct psm_so return (FALSE); /* - * PS2++ protocl, packet type 0 + * PS2++ protocol, packet type 0 * * b7 b6 b5 b4 b3 b2 b1 b0 * byte 1: * 1 p3 p2 1 * * * Modified: head/sys/dev/isci/scil/scic_sds_phy.c ============================================================================== --- head/sys/dev/isci/scil/scic_sds_phy.c Thu Sep 20 10:05:10 2012 (r240742) +++ head/sys/dev/isci/scil/scic_sds_phy.c Thu Sep 20 10:07:31 2012 (r240743) @@ -2317,7 +2317,7 @@ void scic_sds_phy_stopped_state_enter( * entering the SCI_BASE_PHY_STATE_STARTING. * - This function sets the state handlers for the phy object base state * machine starting state. - * - The SCU hardware is requested to start OOB/SN on this protocl engine. + * - The SCU hardware is requested to start OOB/SN on this protocol engine. * - The phy starting substate machine is started. * - If the previous state was the ready state then the * SCIC_SDS_CONTROLLER is informed that the phy has gone link down. Modified: head/sys/dev/usb/serial/uftdi_reg.h ============================================================================== --- head/sys/dev/usb/serial/uftdi_reg.h Thu Sep 20 10:05:10 2012 (r240742) +++ head/sys/dev/usb/serial/uftdi_reg.h Thu Sep 20 10:07:31 2012 (r240743) @@ -176,7 +176,7 @@ enum { * BmRequestType: 0100 0000b * bRequest: FTDI_SIO_SET_FLOW_CTRL * wValue: Xoff/Xon - * wIndex: Protocol/Port - hIndex is protocl / lIndex is port + * wIndex: Protocol/Port - hIndex is protocol / lIndex is port * wLength: 0 * Data: None * From owner-svn-src-all@FreeBSD.ORG Thu Sep 20 10:13:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E7A251065670; Thu, 20 Sep 2012 10:13:14 +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 B8ED48FC0C; Thu, 20 Sep 2012 10:13:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8KADEos095892; Thu, 20 Sep 2012 10:13:14 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8KADE9a095890; Thu, 20 Sep 2012 10:13:14 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201209201013.q8KADE9a095890@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 20 Sep 2012 10:13:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240744 - stable/9/sys/fs/deadfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Sep 2012 10:13:15 -0000 Author: kib Date: Thu Sep 20 10:13:14 2012 New Revision: 240744 URL: http://svn.freebsd.org/changeset/base/240744 Log: MFC r240464: The deadfs VOPs for vop_ioctl and vop_bmap call itself recursively, which is an elaborate way to cause kernel panic. Change the VOPs implementation to return EBADF for a reclaimed vnode. Modified: stable/9/sys/fs/deadfs/dead_vnops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/deadfs/dead_vnops.c ============================================================================== --- stable/9/sys/fs/deadfs/dead_vnops.c Thu Sep 20 10:07:31 2012 (r240743) +++ stable/9/sys/fs/deadfs/dead_vnops.c Thu Sep 20 10:13:14 2012 (r240744) @@ -41,8 +41,6 @@ /* * Prototypes for dead operations on vnodes. */ -static vop_bmap_t dead_bmap; -static vop_ioctl_t dead_ioctl; static vop_lookup_t dead_lookup; static vop_open_t dead_open; static vop_poll_t dead_poll; @@ -56,12 +54,12 @@ struct vop_vector dead_vnodeops = { .vop_access = VOP_EBADF, .vop_advlock = VOP_EBADF, - .vop_bmap = dead_bmap, + .vop_bmap = VOP_EBADF, .vop_create = VOP_PANIC, .vop_getattr = VOP_EBADF, .vop_getwritemount = dead_getwritemount, .vop_inactive = VOP_NULL, - .vop_ioctl = dead_ioctl, + .vop_ioctl = VOP_EBADF, .vop_link = VOP_PANIC, .vop_lookup = dead_lookup, .vop_mkdir = VOP_PANIC, @@ -166,43 +164,6 @@ dead_write(ap) } /* - * Device ioctl operation. - */ -/* ARGSUSED */ -static int -dead_ioctl(ap) - struct vop_ioctl_args /* { - struct vnode *a_vp; - u_long a_command; - caddr_t a_data; - int a_fflag; - struct ucred *a_cred; - struct proc *a_p; - } */ *ap; -{ - /* XXX: Doesn't this just recurse back here ? */ - return (VOP_IOCTL_AP(ap)); -} - -/* - * Wait until the vnode has finished changing state. - */ -static int -dead_bmap(ap) - struct vop_bmap_args /* { - struct vnode *a_vp; - daddr_t a_bn; - struct bufobj **a_bop; - daddr_t *a_bnp; - int *a_runp; - int *a_runb; - } */ *ap; -{ - - return (VOP_BMAP(ap->a_vp, ap->a_bn, ap->a_bop, ap->a_bnp, ap->a_runp, ap->a_runb)); -} - -/* * Trivial poll routine that always returns POLLHUP. * This is necessary so that a process which is polling a file * gets notified when that file is revoke()d. From owner-svn-src-all@FreeBSD.ORG Thu Sep 20 10:28:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B323F106566C; Thu, 20 Sep 2012 10:28:44 +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 83F848FC08; Thu, 20 Sep 2012 10:28:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8KASieA000545; Thu, 20 Sep 2012 10:28:44 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8KASiN3000543; Thu, 20 Sep 2012 10:28:44 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201209201028.q8KASiN3000543@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 20 Sep 2012 10:28: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: r240745 - stable/8/sys/fs/deadfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Sep 2012 10:28:44 -0000 Author: kib Date: Thu Sep 20 10:28:44 2012 New Revision: 240745 URL: http://svn.freebsd.org/changeset/base/240745 Log: MFC r240464: The deadfs VOPs for vop_ioctl and vop_bmap call itself recursively, which is an elaborate way to cause kernel panic. Change the VOPs implementation to return EBADF for a reclaimed vnode. Modified: stable/8/sys/fs/deadfs/dead_vnops.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/fs/ (props changed) Modified: stable/8/sys/fs/deadfs/dead_vnops.c ============================================================================== --- stable/8/sys/fs/deadfs/dead_vnops.c Thu Sep 20 10:13:14 2012 (r240744) +++ stable/8/sys/fs/deadfs/dead_vnops.c Thu Sep 20 10:28:44 2012 (r240745) @@ -41,8 +41,6 @@ /* * Prototypes for dead operations on vnodes. */ -static vop_bmap_t dead_bmap; -static vop_ioctl_t dead_ioctl; static vop_lookup_t dead_lookup; static vop_open_t dead_open; static vop_poll_t dead_poll; @@ -56,12 +54,12 @@ struct vop_vector dead_vnodeops = { .vop_access = VOP_EBADF, .vop_advlock = VOP_EBADF, - .vop_bmap = dead_bmap, + .vop_bmap = VOP_EBADF, .vop_create = VOP_PANIC, .vop_getattr = VOP_EBADF, .vop_getwritemount = dead_getwritemount, .vop_inactive = VOP_NULL, - .vop_ioctl = dead_ioctl, + .vop_ioctl = VOP_EBADF, .vop_link = VOP_PANIC, .vop_lookup = dead_lookup, .vop_mkdir = VOP_PANIC, @@ -166,43 +164,6 @@ dead_write(ap) } /* - * Device ioctl operation. - */ -/* ARGSUSED */ -static int -dead_ioctl(ap) - struct vop_ioctl_args /* { - struct vnode *a_vp; - u_long a_command; - caddr_t a_data; - int a_fflag; - struct ucred *a_cred; - struct proc *a_p; - } */ *ap; -{ - /* XXX: Doesn't this just recurse back here ? */ - return (VOP_IOCTL_AP(ap)); -} - -/* - * Wait until the vnode has finished changing state. - */ -static int -dead_bmap(ap) - struct vop_bmap_args /* { - struct vnode *a_vp; - daddr_t a_bn; - struct bufobj **a_bop; - daddr_t *a_bnp; - int *a_runp; - int *a_runb; - } */ *ap; -{ - - return (VOP_BMAP(ap->a_vp, ap->a_bn, ap->a_bop, ap->a_bnp, ap->a_runp, ap->a_runb)); -} - -/* * Trivial poll routine that always returns POLLHUP. * This is necessary so that a process which is polling a file * gets notified when that file is revoke()d. From owner-svn-src-all@FreeBSD.ORG Thu Sep 20 15:12:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4DED1106566B; Thu, 20 Sep 2012 15:12:00 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 37EAD8FC0A; Thu, 20 Sep 2012 15:12:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8KFC0ix041108; Thu, 20 Sep 2012 15:12:00 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8KFC0Ib041105; Thu, 20 Sep 2012 15:12:00 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201209201512.q8KFC0Ib041105@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 20 Sep 2012 15:12:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240750 - head/sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Sep 2012 15:12:00 -0000 Author: hselasky Date: Thu Sep 20 15:11:59 2012 New Revision: 240750 URL: http://svn.freebsd.org/changeset/base/240750 Log: Fix typo. Modified: head/sys/dev/usb/usb_request.c Modified: head/sys/dev/usb/usb_request.c ============================================================================== --- head/sys/dev/usb/usb_request.c Thu Sep 20 15:05:57 2012 (r240749) +++ head/sys/dev/usb/usb_request.c Thu Sep 20 15:11:59 2012 (r240750) @@ -87,7 +87,7 @@ struct usb_ctrl_debug { int bus_index; /* target bus */ int dev_index; /* target address */ int ds_fail; /* fail data stage */ - int ss_fail; /* fail data stage */ + int ss_fail; /* fail status stage */ int ds_delay; /* data stage delay in ms */ int ss_delay; /* status stage delay in ms */ int bmRequestType_value; From owner-svn-src-all@FreeBSD.ORG Thu Sep 20 16:03:05 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9E0A8106566C; Thu, 20 Sep 2012 16:03:05 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 881158FC12; Thu, 20 Sep 2012 16:03:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8KG35Nh048471; Thu, 20 Sep 2012 16:03:05 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8KG35nY048466; Thu, 20 Sep 2012 16:03:05 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201209201603.q8KG35nY048466@svn.freebsd.org> From: Alan Cox Date: Thu, 20 Sep 2012 16:03:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240754 - in stable/9/sys: amd64/amd64 i386/i386 i386/xen mips/mips X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Sep 2012 16:03:05 -0000 Author: alc Date: Thu Sep 20 16:03:04 2012 New Revision: 240754 URL: http://svn.freebsd.org/changeset/base/240754 Log: MFC r240317 Simplify pmap_unmapdev(). Don't set PTE_W on the page table entry in pmap_kenter{,_attr}() on MIPS. Modified: stable/9/sys/amd64/amd64/pmap.c stable/9/sys/i386/i386/pmap.c stable/9/sys/i386/xen/pmap.c stable/9/sys/mips/mips/pmap.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/amd64/amd64/pmap.c ============================================================================== --- stable/9/sys/amd64/amd64/pmap.c Thu Sep 20 15:53:55 2012 (r240753) +++ stable/9/sys/amd64/amd64/pmap.c Thu Sep 20 16:03:04 2012 (r240754) @@ -4998,7 +4998,7 @@ pmap_mapbios(vm_paddr_t pa, vm_size_t si void pmap_unmapdev(vm_offset_t va, vm_size_t size) { - vm_offset_t base, offset, tmpva; + vm_offset_t base, offset; /* If we gave a direct map region in pmap_mapdev, do nothing */ if (va >= DMAP_MIN_ADDRESS && va < DMAP_MAX_ADDRESS) @@ -5006,9 +5006,6 @@ pmap_unmapdev(vm_offset_t va, vm_size_t base = trunc_page(va); offset = va & PAGE_MASK; size = roundup(offset + size, PAGE_SIZE); - for (tmpva = base; tmpva < (base + size); tmpva += PAGE_SIZE) - pmap_kremove(tmpva); - pmap_invalidate_range(kernel_pmap, va, tmpva); kmem_free(kernel_map, base, size); } Modified: stable/9/sys/i386/i386/pmap.c ============================================================================== --- stable/9/sys/i386/i386/pmap.c Thu Sep 20 15:53:55 2012 (r240753) +++ stable/9/sys/i386/i386/pmap.c Thu Sep 20 16:03:04 2012 (r240754) @@ -5011,16 +5011,13 @@ pmap_mapbios(vm_paddr_t pa, vm_size_t si void pmap_unmapdev(vm_offset_t va, vm_size_t size) { - vm_offset_t base, offset, tmpva; + vm_offset_t base, offset; if (va >= KERNBASE && va + size <= KERNBASE + KERNLOAD) return; base = trunc_page(va); offset = va & PAGE_MASK; size = roundup(offset + size, PAGE_SIZE); - for (tmpva = base; tmpva < (base + size); tmpva += PAGE_SIZE) - pmap_kremove(tmpva); - pmap_invalidate_range(kernel_pmap, va, tmpva); kmem_free(kernel_map, base, size); } Modified: stable/9/sys/i386/xen/pmap.c ============================================================================== --- stable/9/sys/i386/xen/pmap.c Thu Sep 20 15:53:55 2012 (r240753) +++ stable/9/sys/i386/xen/pmap.c Thu Sep 20 16:03:04 2012 (r240754) @@ -3992,18 +3992,13 @@ pmap_mapbios(vm_paddr_t pa, vm_size_t si void pmap_unmapdev(vm_offset_t va, vm_size_t size) { - vm_offset_t base, offset, tmpva; + vm_offset_t base, offset; if (va >= KERNBASE && va + size <= KERNBASE + KERNLOAD) return; base = trunc_page(va); offset = va & PAGE_MASK; size = roundup(offset + size, PAGE_SIZE); - critical_enter(); - for (tmpva = base; tmpva < (base + size); tmpva += PAGE_SIZE) - pmap_kremove(tmpva); - pmap_invalidate_range(kernel_pmap, va, tmpva); - critical_exit(); kmem_free(kernel_map, base, size); } Modified: stable/9/sys/mips/mips/pmap.c ============================================================================== --- stable/9/sys/mips/mips/pmap.c Thu Sep 20 15:53:55 2012 (r240753) +++ stable/9/sys/mips/mips/pmap.c Thu Sep 20 16:03:04 2012 (r240754) @@ -837,10 +837,10 @@ pmap_kenter_attr(vm_offset_t va, vm_padd #ifdef PMAP_DEBUG printf("pmap_kenter: va: %p -> pa: %p\n", (void *)va, (void *)pa); #endif - npte = TLBLO_PA_TO_PFN(pa) | PTE_D | PTE_V | PTE_G | PTE_W | attr; pte = pmap_pte(kernel_pmap, va); opte = *pte; + npte = TLBLO_PA_TO_PFN(pa) | attr | PTE_D | PTE_V | PTE_G; *pte = npte; if (pte_test(&opte, PTE_V) && opte != npte) pmap_update_page(kernel_pmap, va, npte); @@ -2877,7 +2877,7 @@ void pmap_unmapdev(vm_offset_t va, vm_size_t size) { #ifndef __mips_n64 - vm_offset_t base, offset, tmpva; + vm_offset_t base, offset; /* If the address is within KSEG1 then there is nothing to do */ if (va >= MIPS_KSEG1_START && va <= MIPS_KSEG1_END) @@ -2886,8 +2886,6 @@ pmap_unmapdev(vm_offset_t va, vm_size_t base = trunc_page(va); offset = va & PAGE_MASK; size = roundup(size + offset, PAGE_SIZE); - for (tmpva = base; tmpva < base + size; tmpva += PAGE_SIZE) - pmap_kremove(tmpva); kmem_free(kernel_map, base, size); #endif } From owner-svn-src-all@FreeBSD.ORG Thu Sep 20 16:27:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 608FA1065673; Thu, 20 Sep 2012 16:27:22 +0000 (UTC) (envelope-from issyl0@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4B5168FC08; Thu, 20 Sep 2012 16:27:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8KGRMpT052467; Thu, 20 Sep 2012 16:27:22 GMT (envelope-from issyl0@svn.freebsd.org) Received: (from issyl0@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8KGRMBI052465; Thu, 20 Sep 2012 16:27:22 GMT (envelope-from issyl0@svn.freebsd.org) Message-Id: <201209201627.q8KGRMBI052465@svn.freebsd.org> From: Isabell Long Date: Thu, 20 Sep 2012 16:27:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240755 - stable/9/usr.sbin/adduser X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Sep 2012 16:27:22 -0000 Author: issyl0 (doc committer) Date: Thu Sep 20 16:27:21 2012 New Revision: 240755 URL: http://svn.freebsd.org/changeset/base/240755 Log: MFC r240530 from HEAD: - Remove a reference to CVS and freefall from a user-facing man page. PR: docs/171658 Approved by: gabor (mentor) Modified: stable/9/usr.sbin/adduser/adduser.8 Directory Properties: stable/9/usr.sbin/adduser/ (props changed) Modified: stable/9/usr.sbin/adduser/adduser.8 ============================================================================== --- stable/9/usr.sbin/adduser/adduser.8 Thu Sep 20 16:03:04 2012 (r240754) +++ stable/9/usr.sbin/adduser/adduser.8 Thu Sep 20 16:27:21 2012 (r240755) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 16, 2008 +.Dd September 15, 2012 .Dt ADDUSER 8 .Os .Sh NAME @@ -129,9 +129,8 @@ they can safely run with a umask of 002 and create files in their home directory without worrying about others being able to change them. .Pp -For a shared area you create a separate UID/GID (like cvs or ncvs on freefall), -you place each person that should be able to access this area into that new -group. +For a shared area you create a separate UID/GID, you place each person +that should be able to access this area into that new group. .Pp This model of UID/GID administration allows far greater flexibility than lumping users into groups and having to muck with the umask when working in a shared From owner-svn-src-all@FreeBSD.ORG Thu Sep 20 17:02:05 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5ED27106566C; Thu, 20 Sep 2012 17:02:05 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3FEB98FC12; Thu, 20 Sep 2012 17:02:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8KH256V057348; Thu, 20 Sep 2012 17:02:05 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8KH25ha057346; Thu, 20 Sep 2012 17:02:05 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201209201702.q8KH25ha057346@svn.freebsd.org> From: Alan Cox Date: Thu, 20 Sep 2012 17:02:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240757 - stable/9/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Sep 2012 17:02:05 -0000 Author: alc Date: Thu Sep 20 17:02:04 2012 New Revision: 240757 URL: http://svn.freebsd.org/changeset/base/240757 Log: MFC r238456 and r238536 Various improvements to vm_contig_grow_cache(). Modified: stable/9/sys/vm/vm_contig.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/vm/vm_contig.c ============================================================================== --- stable/9/sys/vm/vm_contig.c Thu Sep 20 16:36:58 2012 (r240756) +++ stable/9/sys/vm/vm_contig.c Thu Sep 20 17:02:04 2012 (r240757) @@ -64,6 +64,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -87,7 +88,7 @@ __FBSDID("$FreeBSD$"); #include static int -vm_contig_launder_page(vm_page_t m, vm_page_t *next) +vm_contig_launder_page(vm_page_t m, vm_page_t *next, int tries) { vm_object_t object; vm_page_t m_tmp; @@ -96,7 +97,10 @@ vm_contig_launder_page(vm_page_t m, vm_p int vfslocked; mtx_assert(&vm_page_queue_mtx, MA_OWNED); - vm_page_lock_assert(m, MA_OWNED); + if (!vm_pageout_page_lock(m, next) || m->hold_count != 0) { + vm_page_unlock(m); + return (EAGAIN); + } object = m->object; if (!VM_OBJECT_TRYLOCK(object) && (!vm_pageout_fallback_object_lock(m, next) || m->hold_count != 0)) { @@ -104,7 +108,13 @@ vm_contig_launder_page(vm_page_t m, vm_p VM_OBJECT_UNLOCK(object); return (EAGAIN); } - if (vm_page_sleep_if_busy(m, TRUE, "vpctw0")) { + if ((m->oflags & VPO_BUSY) != 0 || m->busy != 0) { + if (tries == 0) { + vm_page_unlock(m); + VM_OBJECT_UNLOCK(object); + return (EAGAIN); + } + vm_page_sleep(m, "vpctw0"); VM_OBJECT_UNLOCK(object); vm_page_lock_queues(); return (EBUSY); @@ -114,7 +124,7 @@ vm_contig_launder_page(vm_page_t m, vm_p pmap_remove_all(m); if (m->dirty != 0) { vm_page_unlock(m); - if ((object->flags & OBJ_DEAD) != 0) { + if (tries == 0 || (object->flags & OBJ_DEAD) != 0) { VM_OBJECT_UNLOCK(object); return (EAGAIN); } @@ -150,34 +160,25 @@ vm_contig_launder_page(vm_page_t m, vm_p vm_page_unlock(m); } VM_OBJECT_UNLOCK(object); - return (0); + return (EAGAIN); } static int -vm_contig_launder(int queue, vm_paddr_t low, vm_paddr_t high) +vm_contig_launder(int queue, int tries, vm_paddr_t low, vm_paddr_t high) { vm_page_t m, next; vm_paddr_t pa; int error; TAILQ_FOREACH_SAFE(m, &vm_page_queues[queue].pl, pageq, next) { - - /* Skip marker pages */ + KASSERT(m->queue == queue, + ("vm_contig_launder: page %p's queue is not %d", m, queue)); if ((m->flags & PG_MARKER) != 0) continue; - pa = VM_PAGE_TO_PHYS(m); if (pa < low || pa + PAGE_SIZE > high) continue; - - if (!vm_pageout_page_lock(m, &next) || m->hold_count != 0) { - vm_page_unlock(m); - continue; - } - KASSERT(m->queue == queue, - ("vm_contig_launder: page %p's queue is not %d", m, queue)); - error = vm_contig_launder_page(m, &next); - vm_page_lock_assert(m, MA_NOTOWNED); + error = vm_contig_launder_page(m, &next, tries); if (error == 0) return (TRUE); if (error == EBUSY) @@ -203,24 +204,47 @@ vm_page_release_contig(vm_page_t m, vm_p } /* - * Increase the number of cached pages. + * Increase the number of cached pages. The specified value, "tries", + * determines which categories of pages are cached: + * + * 0: All clean, inactive pages within the specified physical address range + * are cached. Will not sleep. + * 1: The vm_lowmem handlers are called. All inactive pages within + * the specified physical address range are cached. May sleep. + * 2: The vm_lowmem handlers are called. All inactive and active pages + * within the specified physical address range are cached. May sleep. */ void vm_contig_grow_cache(int tries, vm_paddr_t low, vm_paddr_t high) { int actl, actmax, inactl, inactmax; + if (tries > 0) { + /* + * Decrease registered cache sizes. The vm_lowmem handlers + * may acquire locks and/or sleep, so they can only be invoked + * when "tries" is greater than zero. + */ + EVENTHANDLER_INVOKE(vm_lowmem, 0); + + /* + * We do this explicitly after the caches have been drained + * above. + */ + uma_reclaim(); + } vm_page_lock_queues(); inactl = 0; - inactmax = tries < 1 ? 0 : cnt.v_inactive_count; + inactmax = cnt.v_inactive_count; actl = 0; actmax = tries < 2 ? 0 : cnt.v_active_count; again: - if (inactl < inactmax && vm_contig_launder(PQ_INACTIVE, low, high)) { + if (inactl < inactmax && vm_contig_launder(PQ_INACTIVE, tries, low, + high)) { inactl++; goto again; } - if (actl < actmax && vm_contig_launder(PQ_ACTIVE, low, high)) { + if (actl < actmax && vm_contig_launder(PQ_ACTIVE, tries, low, high)) { actl++; goto again; } From owner-svn-src-all@FreeBSD.ORG Thu Sep 20 17:30:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 150C2106566B; Thu, 20 Sep 2012 17:30:27 +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 F2CFA8FC08; Thu, 20 Sep 2012 17:30:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8KHUQag061465; Thu, 20 Sep 2012 17:30:26 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8KHUQDW061461; Thu, 20 Sep 2012 17:30:26 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201209201730.q8KHUQDW061461@svn.freebsd.org> From: Xin LI Date: Thu, 20 Sep 2012 17:30:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240758 - in releng/9.1: share/man/man4 sys/dev/arcmsr X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Sep 2012 17:30:27 -0000 Author: delphij Date: Thu Sep 20 17:30:26 2012 New Revision: 240758 URL: http://svn.freebsd.org/changeset/base/240758 Log: MFC r240079: Update arcmsr(4) to vendor version 1.20.00.25. Many thanks to Areca for continuing to support FreeBSD. Submitted by: Ching-Lung Huang Approved by: re (kib) Modified: releng/9.1/share/man/man4/arcmsr.4 releng/9.1/sys/dev/arcmsr/arcmsr.c releng/9.1/sys/dev/arcmsr/arcmsr.h Directory Properties: releng/9.1/share/man/man4/ (props changed) releng/9.1/sys/ (props changed) releng/9.1/sys/dev/ (props changed) Modified: releng/9.1/share/man/man4/arcmsr.4 ============================================================================== --- releng/9.1/share/man/man4/arcmsr.4 Thu Sep 20 17:02:04 2012 (r240757) +++ releng/9.1/share/man/man4/arcmsr.4 Thu Sep 20 17:30:26 2012 (r240758) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 25, 2010 +.Dd September 3, 2012 .Dt ARCMSR 4 .Os .Sh NAME @@ -98,10 +98,14 @@ ARC-1210 .It ARC-1212 .It +ARC-1213 +.It ARC-1220 .It ARC-1222 .It +ARC-1223 +.It ARC-1230 .It ARC-1231 @@ -133,6 +137,8 @@ ARC-1680 ARC-1681 .It ARC-1880 +.It +ARC-1882 .El .Sh FILES .Bl -tag -width ".Pa /dev/arcmsr?" -compact Modified: releng/9.1/sys/dev/arcmsr/arcmsr.c ============================================================================== --- releng/9.1/sys/dev/arcmsr/arcmsr.c Thu Sep 20 17:02:04 2012 (r240757) +++ releng/9.1/sys/dev/arcmsr/arcmsr.c Thu Sep 20 17:30:26 2012 (r240758) @@ -37,38 +37,43 @@ ************************************************************************** ** History ** -** REV# DATE NAME DESCRIPTION -** 1.00.00.00 03/31/2004 Erich Chen First release -** 1.20.00.02 11/29/2004 Erich Chen bug fix with arcmsr_bus_reset when PHY error -** 1.20.00.03 04/19/2005 Erich Chen add SATA 24 Ports adapter type support +** REV# DATE NAME DESCRIPTION +** 1.00.00.00 03/31/2004 Erich Chen First release +** 1.20.00.02 11/29/2004 Erich Chen bug fix with arcmsr_bus_reset when PHY error +** 1.20.00.03 04/19/2005 Erich Chen add SATA 24 Ports adapter type support ** clean unused function -** 1.20.00.12 09/12/2005 Erich Chen bug fix with abort command handling, +** 1.20.00.12 09/12/2005 Erich Chen bug fix with abort command handling, ** firmware version check ** and firmware update notify for hardware bug fix ** handling if none zero high part physical address ** of srb resource -** 1.20.00.13 08/18/2006 Erich Chen remove pending srb and report busy +** 1.20.00.13 08/18/2006 Erich Chen remove pending srb and report busy ** add iop message xfer ** with scsi pass-through command ** add new device id of sas raid adapters ** code fit for SPARC64 & PPC -** 1.20.00.14 02/05/2007 Erich Chen bug fix for incorrect ccb_h.status report +** 1.20.00.14 02/05/2007 Erich Chen bug fix for incorrect ccb_h.status report ** and cause g_vfs_done() read write error -** 1.20.00.15 10/10/2007 Erich Chen support new RAID adapter type ARC120x -** 1.20.00.16 10/10/2009 Erich Chen Bug fix for RAID adapter type ARC120x +** 1.20.00.15 10/10/2007 Erich Chen support new RAID adapter type ARC120x +** 1.20.00.16 10/10/2009 Erich Chen Bug fix for RAID adapter type ARC120x ** bus_dmamem_alloc() with BUS_DMA_ZERO -** 1.20.00.17 07/15/2010 Ching Huang Added support ARC1880 -** report CAM_DEV_NOT_THERE instead of CAM_SEL_TIMEOUT when device failed, -** prevent cam_periph_error removing all LUN devices of one Target id -** for any one LUN device failed -** 1.20.00.18 10/14/2010 Ching Huang Fixed "inquiry data fails comparion at DV1 step" -** 10/25/2010 Ching Huang Fixed bad range input in bus_alloc_resource for ADAPTER_TYPE_B -** 1.20.00.19 11/11/2010 Ching Huang Fixed arcmsr driver prevent arcsas support for Areca SAS HBA ARC13x0 -** 1.20.00.20 12/08/2010 Ching Huang Avoid calling atomic_set_int function -** 1.20.00.21 02/08/2011 Ching Huang Implement I/O request timeout -** 02/14/2011 Ching Huang Modified pktRequestCount -** 1.20.00.21 03/03/2011 Ching Huang if a command timeout, then wait its ccb back before free it -** 1.20.00.22 07/04/2011 Ching Huang Fixed multiple MTX panic +** 1.20.00.17 07/15/2010 Ching Huang Added support ARC1880 +** report CAM_DEV_NOT_THERE instead of CAM_SEL_TIMEOUT when device failed, +** prevent cam_periph_error removing all LUN devices of one Target id +** for any one LUN device failed +** 1.20.00.18 10/14/2010 Ching Huang Fixed "inquiry data fails comparion at DV1 step" +** 10/25/2010 Ching Huang Fixed bad range input in bus_alloc_resource for ADAPTER_TYPE_B +** 1.20.00.19 11/11/2010 Ching Huang Fixed arcmsr driver prevent arcsas support for Areca SAS HBA ARC13x0 +** 1.20.00.20 12/08/2010 Ching Huang Avoid calling atomic_set_int function +** 1.20.00.21 02/08/2011 Ching Huang Implement I/O request timeout +** 02/14/2011 Ching Huang Modified pktRequestCount +** 1.20.00.21 03/03/2011 Ching Huang if a command timeout, then wait its ccb back before free it +** 1.20.00.22 07/04/2011 Ching Huang Fixed multiple MTX panic +** 1.20.00.23 10/28/2011 Ching Huang Added TIMEOUT_DELAY in case of too many HDDs need to start +** 1.20.00.23 11/08/2011 Ching Huang Added report device transfer speed +** 1.20.00.23 01/30/2012 Ching Huang Fixed Request requeued and Retrying command +** 1.20.00.24 06/11/2012 Ching Huang Fixed return sense data condition +** 1.20.00.25 08/17/2012 Ching Huang Fixed hotplug device no function on type A adapter ****************************************************************************************** */ @@ -154,7 +159,7 @@ __FBSDID("$FreeBSD$"); #define arcmsr_callout_init(a) callout_init(a); #endif -#define ARCMSR_DRIVER_VERSION "Driver Version 1.20.00.22 2011-07-04" +#define ARCMSR_DRIVER_VERSION "Driver Version 1.20.00.25 2012-08-17" #include #define SRB_SIZE ((sizeof(struct CommandControlBlock)+0x1f) & 0xffe0) #define ARCMSR_SRBS_POOL_SIZE (SRB_SIZE * ARCMSR_MAX_FREESRB_NUM) @@ -296,7 +301,7 @@ static struct cdevsw arcmsr_cdevsw = { if(acb==NULL) { return ENXIO; } - return 0; + return (0); } /* ************************************************************************** @@ -347,7 +352,7 @@ static struct cdevsw arcmsr_cdevsw = { if(acb==NULL) { return ENXIO; } - return(arcmsr_iop_ioctlcmd(acb, ioctl_cmd, arg)); + return (arcmsr_iop_ioctlcmd(acb, ioctl_cmd, arg)); } /* ********************************************************************** @@ -378,7 +383,7 @@ static u_int32_t arcmsr_disable_allintr( } break; } - return(intmask_org); + return (intmask_org); } /* ********************************************************************** @@ -411,7 +416,6 @@ static void arcmsr_enable_allintr( struc } break; } - return; } /* ********************************************************************** @@ -431,7 +435,7 @@ static u_int8_t arcmsr_hba_wait_msgint_r UDELAY(10000); }/*max 1 seconds*/ }while(Retries++ < 20);/*max 20 sec*/ - return FALSE; + return (FALSE); } /* ********************************************************************** @@ -452,7 +456,7 @@ static u_int8_t arcmsr_hbb_wait_msgint_r UDELAY(10000); }/*max 1 seconds*/ }while(Retries++ < 20);/*max 20 sec*/ - return FALSE; + return (FALSE); } /* ********************************************************************** @@ -472,7 +476,7 @@ static u_int8_t arcmsr_hbc_wait_msgint_r UDELAY(10000); }/*max 1 seconds*/ }while(Retries++ < 20);/*max 20 sec*/ - return FALSE; + return (FALSE); } /* ************************************************************************ @@ -490,7 +494,6 @@ static void arcmsr_flush_hba_cache(struc retry_count--; } }while(retry_count!=0); - return; } /* ************************************************************************ @@ -509,7 +512,6 @@ static void arcmsr_flush_hbb_cache(struc retry_count--; } }while(retry_count!=0); - return; } /* ************************************************************************ @@ -528,7 +530,6 @@ static void arcmsr_flush_hbc_cache(struc retry_count--; } }while(retry_count!=0); - return; } /* ************************************************************************ @@ -550,7 +551,6 @@ static void arcmsr_flush_adapter_cache(s } break; } - return; } /* ******************************************************************************* @@ -596,7 +596,7 @@ static void arcmsr_async(void *cb_arg, u if((target_id > ARCMSR_MAX_TARGETID) || (target_lun > ARCMSR_MAX_TARGETLUN)) { break; } - printf("%s:scsi id=%d lun=%d device lost \n", device_get_name(acb->pci_dev), target_id, target_lun); + // printf("%s:scsi id=%d lun=%d device lost \n", device_get_name(acb->pci_dev), target_id, target_lun); break; default: break; @@ -612,14 +612,13 @@ static void arcmsr_report_sense_info(str pccb->ccb_h.status |= CAM_SCSI_STATUS_ERROR; pccb->csio.scsi_status = SCSI_STATUS_CHECK_COND; - if(&pccb->csio.sense_data) { + if(pccb->csio.sense_len) { memset(&pccb->csio.sense_data, 0, sizeof(pccb->csio.sense_data)); memcpy(&pccb->csio.sense_data, srb->arcmsr_cdb.SenseData, get_min(sizeof(struct SENSE_DATA), sizeof(pccb->csio.sense_data))); ((u_int8_t *)&pccb->csio.sense_data)[0] = (0x1 << 7 | 0x70); /* Valid,ErrorCode */ pccb->ccb_h.status |= CAM_AUTOSNS_VALID; } - return; } /* ********************************************************************* @@ -631,7 +630,6 @@ static void arcmsr_abort_hba_allcmd(stru if(!arcmsr_hba_wait_msgint_ready(acb)) { printf("arcmsr%d: wait 'abort all outstanding command' timeout \n", acb->pci_unit); } - return; } /* ********************************************************************* @@ -643,7 +641,6 @@ static void arcmsr_abort_hbb_allcmd(stru if(!arcmsr_hbb_wait_msgint_ready(acb)) { printf("arcmsr%d: wait 'abort all outstanding command' timeout \n", acb->pci_unit); } - return; } /* ********************************************************************* @@ -656,7 +653,6 @@ static void arcmsr_abort_hbc_allcmd(stru if(!arcmsr_hbc_wait_msgint_ready(acb)) { printf("arcmsr%d: wait 'abort all outstanding command' timeout \n", acb->pci_unit); } - return; } /* ********************************************************************* @@ -678,7 +674,6 @@ static void arcmsr_abort_allcmd(struct A } break; } - return; } /* ********************************************************************** @@ -716,7 +711,6 @@ static void arcmsr_srb_complete(struct C acb->pktReturnCount++; #endif xpt_done(pccb); - return; } /* ************************************************************************** @@ -768,7 +762,6 @@ static void arcmsr_report_srb_state(stru break; } } - return; } /* ************************************************************************** @@ -801,7 +794,6 @@ static void arcmsr_drain_donequeue(struc return; } arcmsr_report_srb_state(acb, srb, error); - return; } /* ************************************************************************** @@ -883,7 +875,6 @@ static void arcmsr_done4abort_postqueue( } break; } - return; } /* **************************************************************************** @@ -923,7 +914,6 @@ static void arcmsr_iop_reset(struct Adap acb->pktRequestCount = 0; acb->pktReturnCount = 0; #endif - return; } /* ********************************************************************** @@ -1011,7 +1001,6 @@ static void arcmsr_build_srb(struct Comm arcmsr_cdb->DataLength = 0; } srb->arc_cdb_size=arccdbsize; - return; } /* ************************************************************************** @@ -1072,7 +1061,6 @@ static void arcmsr_post_srb(struct Adapt } break; } - return; } /* ************************************************************************ @@ -1156,7 +1144,6 @@ static void arcmsr_iop_message_read(stru CHIP_REG_WRITE32(HBC_MessageUnit, 0, inbound_doorbell, ARCMSR_HBCMU_DRV2IOP_DATA_READ_OK); } } - return; } /* ************************************************************************** @@ -1221,7 +1208,6 @@ static void arcmsr_post_ioctldata2iop(st */ arcmsr_iop_message_wrote(acb); } - return; } /* ************************************************************************ @@ -1236,7 +1222,6 @@ static void arcmsr_stop_hba_bgrb(struct printf("arcmsr%d: wait 'stop adapter background rebulid' timeout \n" , acb->pci_unit); } - return; } /* ************************************************************************ @@ -1251,7 +1236,6 @@ static void arcmsr_stop_hbb_bgrb(struct printf( "arcmsr%d: wait 'stop adapter background rebulid' timeout \n" , acb->pci_unit); } - return; } /* ************************************************************************ @@ -1265,7 +1249,6 @@ static void arcmsr_stop_hbc_bgrb(struct if(!arcmsr_hbc_wait_msgint_ready(acb)) { printf("arcmsr%d: wait 'stop adapter background rebulid' timeout \n", acb->pci_unit); } - return; } /* ************************************************************************ @@ -1287,7 +1270,6 @@ static void arcmsr_stop_adapter_bgrb(str } break; } - return; } /* ************************************************************************ @@ -1305,7 +1287,6 @@ static void arcmsr_poll(struct cam_sim * arcmsr_interrupt(acb); if( mutex == 0 ) ARCMSR_LOCK_RELEASE(&acb->qbuffer_lock); - return; } /* ************************************************************************** @@ -1340,7 +1321,6 @@ static void arcmsr_iop2drv_data_wrote_ha } else { acb->acb_flags|=ACB_F_IOPDATA_OVERFLOW; } - return; } /* ************************************************************************** @@ -1383,7 +1363,6 @@ static void arcmsr_iop2drv_data_read_han if(acb->wqbuf_firstindex==acb->wqbuf_lastindex) { acb->acb_flags |= ACB_F_MESSAGE_WQBUFFER_CLEARED; } - return; } static void arcmsr_rescanLun_cb(struct cam_periph *periph, union ccb *ccb) @@ -1417,7 +1396,6 @@ static void arcmsr_rescan_lun(struct Ada ccb->ccb_h.cbfcnp = arcmsr_rescanLun_cb; ccb->crcn.flags = CAM_FLAG_NONE; xpt_action(ccb); - return; } @@ -1488,6 +1466,7 @@ static void arcmsr_dr_handle(struct Adap } break; } + if(acb->acb_flags & ACB_F_BUS_HANG_ON) { acb->acb_flags &= ~ACB_F_BUS_HANG_ON; @@ -1592,7 +1571,6 @@ static void arcmsr_hba_doorbell_isr(stru if(outbound_doorbell & ARCMSR_OUTBOUND_IOP331_DATA_READ_OK) { arcmsr_iop2drv_data_read_handle(acb); } - return; } /* ************************************************************************** @@ -1620,7 +1598,6 @@ static void arcmsr_hbc_doorbell_isr(stru if(outbound_doorbell & ARCMSR_HBCMU_IOP2DRV_MESSAGE_CMD_DONE) { arcmsr_hbc_message_isr(acb); /* messenger of "driver to iop commands" */ } - return; } /* ************************************************************************** @@ -1644,7 +1621,6 @@ static void arcmsr_hba_postqueue_isr(str error=(flag_srb & ARCMSR_SRBREPLY_FLAG_ERROR_MODE0)?TRUE:FALSE; arcmsr_drain_donequeue(acb, flag_srb, error); } /*drain reply FIFO*/ - return; } /* ************************************************************************** @@ -1674,7 +1650,6 @@ static void arcmsr_hbb_postqueue_isr(str error=(flag_srb & ARCMSR_SRBREPLY_FLAG_ERROR_MODE0)?TRUE:FALSE; arcmsr_drain_donequeue(acb, flag_srb, error); } /*drain reply FIFO*/ - return; } /* ************************************************************************** @@ -1704,7 +1679,6 @@ static void arcmsr_hbc_postqueue_isr(str } throttling++; } /*drain reply FIFO*/ - return; } /* ********************************************************************** @@ -1712,30 +1686,29 @@ static void arcmsr_hbc_postqueue_isr(str */ static void arcmsr_handle_hba_isr( struct AdapterControlBlock *acb) { - u_int32_t outbound_intstatus; + u_int32_t outbound_intStatus; /* ********************************************* ** check outbound intstatus ********************************************* */ - outbound_intstatus=CHIP_REG_READ32(HBA_MessageUnit, 0, outbound_intstatus) & acb->outbound_int_enable; - if(!outbound_intstatus) { + outbound_intStatus=CHIP_REG_READ32(HBA_MessageUnit, 0, outbound_intstatus) & acb->outbound_int_enable; + if(!outbound_intStatus) { /*it must be share irq*/ return; } - CHIP_REG_WRITE32(HBA_MessageUnit, 0, outbound_intstatus, outbound_intstatus);/*clear interrupt*/ + CHIP_REG_WRITE32(HBA_MessageUnit, 0, outbound_intstatus, outbound_intStatus);/*clear interrupt*/ /* MU doorbell interrupts*/ - if(outbound_intstatus & ARCMSR_MU_OUTBOUND_DOORBELL_INT) { + if(outbound_intStatus & ARCMSR_MU_OUTBOUND_DOORBELL_INT) { arcmsr_hba_doorbell_isr(acb); } /* MU post queue interrupts*/ - if(outbound_intstatus & ARCMSR_MU_OUTBOUND_POSTQUEUE_INT) { + if(outbound_intStatus & ARCMSR_MU_OUTBOUND_POSTQUEUE_INT) { arcmsr_hba_postqueue_isr(acb); } - if(outbound_intstatus & ARCMSR_MU_OUTBOUND_MESSAGE0_INT) { + if(outbound_intStatus & ARCMSR_MU_OUTBOUND_MESSAGE0_INT) { arcmsr_hba_message_isr(acb); } - return; } /* ********************************************************************** @@ -1771,7 +1744,6 @@ static void arcmsr_handle_hbb_isr( struc if(outbound_doorbell & ARCMSR_IOP2DRV_MESSAGE_CMD_DONE) { arcmsr_hbb_message_isr(acb); } - return; } /* ********************************************************************** @@ -1798,7 +1770,6 @@ static void arcmsr_handle_hbc_isr( struc if(host_interrupt_status & ARCMSR_HBCMU_OUTBOUND_POSTQUEUE_ISR) { arcmsr_hbc_postqueue_isr(acb); } - return; } /* ****************************************************************************** @@ -1821,7 +1792,6 @@ static void arcmsr_interrupt(struct Adap " unknow adapter type =%d\n", acb->pci_unit, acb->adapter_type); break; } - return; } /* ********************************************************************** @@ -1844,7 +1814,7 @@ static void arcmsr_polling_devmap(void* struct AdapterControlBlock *acb = (struct AdapterControlBlock *)arg; switch (acb->adapter_type) { case ACB_ADAPTER_TYPE_A: - CHIP_REG_WRITE32(HBC_MessageUnit, 0, inbound_msgaddr0, ARCMSR_INBOUND_MESG0_GET_CONFIG); + CHIP_REG_WRITE32(HBA_MessageUnit, 0, inbound_msgaddr0, ARCMSR_INBOUND_MESG0_GET_CONFIG); break; case ACB_ADAPTER_TYPE_B: @@ -2065,7 +2035,7 @@ u_int32_t arcmsr_iop_ioctlcmd(struct Ada break; } ARCMSR_LOCK_RELEASE(&acb->qbuffer_lock); - return retvalue; + return (retvalue); } /* ************************************************************************** @@ -2191,7 +2161,7 @@ static int arcmsr_iop_message_xfer(struc if (wqbuf_lastindex != wqbuf_firstindex) { arcmsr_post_ioctldata2iop(acb); /* has error report sensedata */ - if(&pccb->csio.sense_data) { + if(pccb->csio.sense_len) { ((u_int8_t *)&pccb->csio.sense_data)[0] = (0x1 << 7 | 0x70); /* Valid,ErrorCode */ ((u_int8_t *)&pccb->csio.sense_data)[2] = 0x05; @@ -2221,7 +2191,7 @@ static int arcmsr_iop_message_xfer(struc } } else { /* has error report sensedata */ - if(&pccb->csio.sense_data) { + if(pccb->csio.sense_len) { ((u_int8_t *)&pccb->csio.sense_data)[0] = (0x1 << 7 | 0x70); /* Valid,ErrorCode */ ((u_int8_t *)&pccb->csio.sense_data)[2] = 0x05; @@ -2312,7 +2282,7 @@ static int arcmsr_iop_message_xfer(struc retvalue = ARCMSR_MESSAGE_FAIL; } message_out: - return retvalue; + return (retvalue); } /* ********************************************************************* @@ -2375,7 +2345,7 @@ static void arcmsr_execute_srb(void *arg arcmsr_srb_complete(srb, 0); return; } - if(acb->srboutstandingcount >= ARCMSR_MAX_OUTSTANDING_CMD) { + if(acb->srboutstandingcount > ARCMSR_MAX_OUTSTANDING_CMD) { xpt_freeze_simq(acb->psim, 1); pccb->ccb_h.status = CAM_REQUEUE_REQ; acb->acb_flags |= ACB_F_CAM_DEV_QFRZN; @@ -2388,10 +2358,9 @@ static void arcmsr_execute_srb(void *arg if (pccb->ccb_h.timeout != CAM_TIME_INFINITY) { arcmsr_callout_init(&srb->ccb_callout); - callout_reset(&srb->ccb_callout, (pccb->ccb_h.timeout * hz ) / 1000, arcmsr_srb_timeout, srb); + callout_reset(&srb->ccb_callout, ((pccb->ccb_h.timeout + (ARCMSR_TIMEOUT_DELAY * 1000)) * hz) / 1000, arcmsr_srb_timeout, srb); srb->srb_flags |= SRB_FLAG_TIMER_START; } - return; } /* ***************************************************************************************** @@ -2455,7 +2424,6 @@ static void arcmsr_bus_reset(struct Adap } arcmsr_iop_reset(acb); acb->acb_flags &= ~ACB_F_BUS_RESET; - return; } /* ************************************************************************** @@ -2607,10 +2575,24 @@ static void arcmsr_action(struct cam_sim strncpy(cpi->dev_name, cam_sim_name(psim), DEV_IDLEN); cpi->unit_number=cam_sim_unit(psim); #ifdef CAM_NEW_TRAN_CODE - cpi->transport = XPORT_SPI; - cpi->transport_version = 2; + if(acb->adapter_bus_speed == ACB_BUS_SPEED_6G) + cpi->base_transfer_speed = 600000; + else + cpi->base_transfer_speed = 300000; + if((acb->vendor_device_id == PCIDevVenIDARC1880) || + (acb->vendor_device_id == PCIDevVenIDARC1680)) + { + cpi->transport = XPORT_SAS; + cpi->transport_version = 0; + cpi->protocol_version = SCSI_REV_SPC2; + } + else + { + cpi->transport = XPORT_SPI; + cpi->transport_version = 2; + cpi->protocol_version = SCSI_REV_2; + } cpi->protocol = PROTO_SCSI; - cpi->protocol_version = SCSI_REV_2; #endif cpi->ccb_h.status |= CAM_REQ_CMP; xpt_done(pccb); @@ -2674,28 +2656,46 @@ static void arcmsr_action(struct cam_sim { struct ccb_trans_settings_scsi *scsi; struct ccb_trans_settings_spi *spi; + struct ccb_trans_settings_sas *sas; scsi = &cts->proto_specific.scsi; - spi = &cts->xport_specific.spi; - cts->protocol = PROTO_SCSI; - cts->protocol_version = SCSI_REV_2; - cts->transport = XPORT_SPI; - cts->transport_version = 2; - spi->flags = CTS_SPI_FLAGS_DISC_ENB; - spi->sync_period=3; - spi->sync_offset=32; - spi->bus_width=MSG_EXT_WDTR_BUS_16_BIT; scsi->flags = CTS_SCSI_FLAGS_TAG_ENB; - spi->valid = CTS_SPI_VALID_DISC - | CTS_SPI_VALID_SYNC_RATE - | CTS_SPI_VALID_SYNC_OFFSET - | CTS_SPI_VALID_BUS_WIDTH; scsi->valid = CTS_SCSI_VALID_TQ; + cts->protocol = PROTO_SCSI; + + if((acb->vendor_device_id == PCIDevVenIDARC1880) || + (acb->vendor_device_id == PCIDevVenIDARC1680)) + { + cts->protocol_version = SCSI_REV_SPC2; + cts->transport_version = 0; + cts->transport = XPORT_SAS; + sas = &cts->xport_specific.sas; + sas->valid = CTS_SAS_VALID_SPEED; + if(acb->vendor_device_id == PCIDevVenIDARC1880) + sas->bitrate = 600000; + else if(acb->vendor_device_id == PCIDevVenIDARC1680) + sas->bitrate = 300000; + } + else + { + cts->protocol_version = SCSI_REV_2; + cts->transport_version = 2; + cts->transport = XPORT_SPI; + spi = &cts->xport_specific.spi; + spi->flags = CTS_SPI_FLAGS_DISC_ENB; + spi->sync_period=2; + spi->sync_offset=32; + spi->bus_width=MSG_EXT_WDTR_BUS_16_BIT; + spi->valid = CTS_SPI_VALID_DISC + | CTS_SPI_VALID_SYNC_RATE + | CTS_SPI_VALID_SYNC_OFFSET + | CTS_SPI_VALID_BUS_WIDTH; + } } #else { cts->flags=(CCB_TRANS_DISC_ENB | CCB_TRANS_TAG_ENB); - cts->sync_period=3; + cts->sync_period=2; cts->sync_offset=32; cts->bus_width=MSG_EXT_WDTR_BUS_16_BIT; cts->valid=CCB_TRANS_SYNC_RATE_VALID | @@ -2759,7 +2759,6 @@ static void arcmsr_action(struct cam_sim xpt_done(pccb); break; } - return; } /* ********************************************************************** @@ -2772,7 +2771,6 @@ static void arcmsr_start_hba_bgrb(struct if(!arcmsr_hba_wait_msgint_ready(acb)) { printf("arcmsr%d: wait 'start adapter background rebulid' timeout \n", acb->pci_unit); } - return; } /* ********************************************************************** @@ -2785,7 +2783,6 @@ static void arcmsr_start_hbb_bgrb(struct if(!arcmsr_hbb_wait_msgint_ready(acb)) { printf( "arcmsr%d: wait 'start adapter background rebulid' timeout \n", acb->pci_unit); } - return; } /* ********************************************************************** @@ -2799,7 +2796,6 @@ static void arcmsr_start_hbc_bgrb(struct if(!arcmsr_hbc_wait_msgint_ready(acb)) { printf("arcmsr%d: wait 'start adapter background rebulid' timeout \n", acb->pci_unit); } - return; } /* ********************************************************************** @@ -2818,7 +2814,6 @@ static void arcmsr_start_adapter_bgrb(st arcmsr_start_hbc_bgrb(acb); break; } - return; } /* ********************************************************************** @@ -2873,7 +2868,6 @@ polling_ccb_retry: } arcmsr_report_srb_state(acb, srb, error); } /*drain reply FIFO*/ - return; } /* ********************************************************************** @@ -2934,7 +2928,6 @@ polling_ccb_retry: } arcmsr_report_srb_state(acb, srb, error); } /*drain reply FIFO*/ - return; } /* ********************************************************************** @@ -2985,7 +2978,6 @@ polling_ccb_retry: } arcmsr_report_srb_state(acb, srb, error); } /*drain reply FIFO*/ - return; } /* ********************************************************************** @@ -3053,7 +3045,6 @@ static void arcmsr_get_hba_config(struct acb->firm_sdram_size=CHIP_REG_READ32(HBA_MessageUnit, 0, msgcode_rwbuffer[3]); /*firm_sdram_size, 3, 12-15*/ acb->firm_ide_channels=CHIP_REG_READ32(HBA_MessageUnit, 0, msgcode_rwbuffer[4]); /*firm_ide_channels, 4, 16-19*/ acb->firm_cfg_version=CHIP_REG_READ32(HBA_MessageUnit, 0, msgcode_rwbuffer[ARCMSR_FW_CFGVER_OFFSET]); /*firm_cfg_version, 25, */ - return; } /* ********************************************************************** @@ -3100,7 +3091,6 @@ static void arcmsr_get_hbb_config(struct acb->firm_sdram_size=CHIP_REG_READ32(HBB_RWBUFFER, 1, msgcode_rwbuffer[3]); /*firm_sdram_size, 3, 12-15*/ acb->firm_ide_channels=CHIP_REG_READ32(HBB_RWBUFFER, 1, msgcode_rwbuffer[4]); /*firm_ide_channels, 4, 16-19*/ acb->firm_cfg_version=CHIP_REG_READ32(HBB_RWBUFFER, 1, msgcode_rwbuffer[ARCMSR_FW_CFGVER_OFFSET]); /*firm_cfg_version, 25, */ - return; } /* ********************************************************************** @@ -3148,7 +3138,6 @@ static void arcmsr_get_hbc_config(struct acb->firm_sdram_size =CHIP_REG_READ32(HBC_MessageUnit, 0, msgcode_rwbuffer[3]); /*firm_sdram_size, 3, 12-15*/ acb->firm_ide_channels =CHIP_REG_READ32(HBC_MessageUnit, 0, msgcode_rwbuffer[4]); /*firm_ide_channels, 4, 16-19*/ acb->firm_cfg_version =CHIP_REG_READ32(HBC_MessageUnit, 0, msgcode_rwbuffer[ARCMSR_FW_CFGVER_OFFSET]); /*firm_cfg_version, 25, */ - return; } /* ********************************************************************** @@ -3170,7 +3159,6 @@ static void arcmsr_get_firmware_spec(str } break; } - return; } /* ********************************************************************** @@ -3219,7 +3207,6 @@ static void arcmsr_wait_firmware_ready( } break; } - return; } /* ********************************************************************** @@ -3253,7 +3240,6 @@ static void arcmsr_clear_doorbell_queue_ } break; } - return; } /* ************************************************************************ @@ -3336,7 +3322,7 @@ static u_int32_t arcmsr_iop_confirm(stru } break; } - return TRUE; + return (TRUE); } /* ************************************************************************ @@ -3359,7 +3345,6 @@ static void arcmsr_enable_eoi_mode(struc } break; } - return; } /* ********************************************************************** @@ -3382,7 +3367,6 @@ static void arcmsr_iop_init(struct Adapt /* enable outbound Post Queue, outbound doorbell Interrupt */ arcmsr_enable_allintr(acb, intmask_org); acb->acb_flags |=ACB_F_IOP_INITED; - return; } /* ********************************************************************** @@ -3414,7 +3398,6 @@ static void arcmsr_map_free_srb(void *ar srb_tmp = (struct CommandControlBlock *)((unsigned long)srb_tmp+SRB_SIZE); } acb->vir2phy_offset=(unsigned long)srb_tmp-(unsigned long)srb_phyaddr; - return; } /* ************************************************************************ @@ -3433,7 +3416,6 @@ static void arcmsr_free_resource(struct bus_dma_tag_destroy(acb->srb_dmat); bus_dma_tag_destroy(acb->dm_segs_dmat); bus_dma_tag_destroy(acb->parent_dmat); - return; } /* ************************************************************************ @@ -3444,16 +3426,24 @@ static u_int32_t arcmsr_initialize(devic struct AdapterControlBlock *acb=device_get_softc(dev); u_int16_t pci_command; int i, j,max_coherent_size; - - switch (pci_get_devid(dev)) { - case PCIDevVenIDARC1880: { + u_int32_t vendor_dev_id; + + vendor_dev_id = pci_get_devid(dev); + acb->vendor_device_id = vendor_dev_id; + switch (vendor_dev_id) { + case PCIDevVenIDARC1880: + case PCIDevVenIDARC1882: + case PCIDevVenIDARC1213: + case PCIDevVenIDARC1223: { acb->adapter_type=ACB_ADAPTER_TYPE_C; + acb->adapter_bus_speed = ACB_BUS_SPEED_6G; max_coherent_size=ARCMSR_SRBS_POOL_SIZE; } break; case PCIDevVenIDARC1200: case PCIDevVenIDARC1201: { acb->adapter_type=ACB_ADAPTER_TYPE_B; + acb->adapter_bus_speed = ACB_BUS_SPEED_3G; max_coherent_size=ARCMSR_SRBS_POOL_SIZE+(sizeof(struct HBB_MessageUnit)); } break; @@ -3477,6 +3467,7 @@ static u_int32_t arcmsr_initialize(devic case PCIDevVenIDARC1680: case PCIDevVenIDARC1681: { acb->adapter_type=ACB_ADAPTER_TYPE_A; + acb->adapter_bus_speed = ACB_BUS_SPEED_3G; max_coherent_size=ARCMSR_SRBS_POOL_SIZE; } break; @@ -3804,7 +3795,7 @@ static int arcmsr_attach(device_t dev) #endif arcmsr_callout_init(&acb->devmap_callout); callout_reset(&acb->devmap_callout, 60 * hz, arcmsr_polling_devmap, acb); - return 0; + return (0); } /* @@ -3851,6 +3842,9 @@ static int arcmsr_probe(device_t dev) type = "SAS 3G"; break; case PCIDevVenIDARC1880: + case PCIDevVenIDARC1882: + case PCIDevVenIDARC1213: + case PCIDevVenIDARC1223: type = "SAS 6G"; break; default: Modified: releng/9.1/sys/dev/arcmsr/arcmsr.h ============================================================================== --- releng/9.1/sys/dev/arcmsr/arcmsr.h Thu Sep 20 17:02:04 2012 (r240757) +++ releng/9.1/sys/dev/arcmsr/arcmsr.h Thu Sep 20 17:30:26 2012 (r240758) @@ -52,6 +52,7 @@ #define ARCMSR_MAX_ADAPTER 4 #define ARCMSR_RELEASE_SIMQ_LEVEL 230 #define ARCMSR_MAX_HBB_POSTQUEUE 264 /* (ARCMSR_MAX_OUTSTANDING_CMD+8) */ +#define ARCMSR_TIMEOUT_DELAY 60 /* in sec */ /* ********************************************************************* */ @@ -97,6 +98,13 @@ #define PCI_DEVICE_ID_ARECA_1681 0x1681 /* Device ID */ #define PCI_DEVICE_ID_ARECA_1880 0x1880 /* Device ID */ +#define ARECA_SUB_DEV_ID_1880 0x1880 /* Subsystem Device ID */ +#define ARECA_SUB_DEV_ID_1882 0x1882 /* Subsystem Device ID */ +#define ARECA_SUB_DEV_ID_1212 0x1212 /* Subsystem Device ID */ +#define ARECA_SUB_DEV_ID_1213 0x1213 /* Subsystem Device ID */ +#define ARECA_SUB_DEV_ID_1222 0x1222 /* Subsystem Device ID */ +#define ARECA_SUB_DEV_ID_1223 0x1223 /* Subsystem Device ID */ + #define PCIDevVenIDARC1110 0x111017D3 /* Vendor Device ID */ #define PCIDevVenIDARC1120 0x112017D3 /* Vendor Device ID */ #define PCIDevVenIDARC1130 0x113017D3 /* Vendor Device ID */ @@ -106,8 +114,10 @@ #define PCIDevVenIDARC1201 0x120117D3 /* Vendor Device ID */ #define PCIDevVenIDARC1210 0x121017D3 /* Vendor Device ID */ #define PCIDevVenIDARC1212 0x121217D3 /* Vendor Device ID */ +#define PCIDevVenIDARC1213 0x121317D3 /* Vendor Device ID */ #define PCIDevVenIDARC1220 0x122017D3 /* Vendor Device ID */ #define PCIDevVenIDARC1222 0x122217D3 /* Vendor Device ID */ +#define PCIDevVenIDARC1223 0x122317D3 /* Vendor Device ID */ #define PCIDevVenIDARC1230 0x123017D3 /* Vendor Device ID */ #define PCIDevVenIDARC1231 0x123117D3 /* Vendor Device ID */ #define PCIDevVenIDARC1260 0x126017D3 /* Vendor Device ID */ @@ -119,6 +129,7 @@ #define PCIDevVenIDARC1680 0x168017D3 /* Vendor Device ID */ #define PCIDevVenIDARC1681 0x168117D3 /* Vendor Device ID */ #define PCIDevVenIDARC1880 0x188017D3 /* Vendor Device ID */ +#define PCIDevVenIDARC1882 0x188217D3 /* Vendor Device ID */ #ifndef PCIR_BARS #define PCIR_BARS 0x10 @@ -830,6 +841,8 @@ struct AdapterControlBlock { u_int32_t pktRequestCount; u_int32_t pktReturnCount; #endif + u_int32_t vendor_device_id; + u_int32_t adapter_bus_speed; };/* HW_DEVICE_EXTENSION */ /* acb_flags */ #define ACB_F_SCSISTOPADAPTER 0x0001 @@ -848,6 +861,10 @@ struct AdapterControlBlock { /* devstate */ #define ARECA_RAID_GONE 0x55 #define ARECA_RAID_GOOD 0xaa +/* adapter_bus_speed */ +#define ACB_BUS_SPEED_3G 0 +#define ACB_BUS_SPEED_6G 1 +#define ACB_BUS_SPEED_12G 2 /* ********************************************************************* ** Message Unit structure From owner-svn-src-all@FreeBSD.ORG Thu Sep 20 17:39:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9036A106566C; Thu, 20 Sep 2012 17:39:07 +0000 (UTC) (envelope-from issyl0@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7A0C28FC17; Thu, 20 Sep 2012 17:39:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8KHd7Rq062674; Thu, 20 Sep 2012 17:39:07 GMT (envelope-from issyl0@svn.freebsd.org) Received: (from issyl0@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8KHd7Rv062672; Thu, 20 Sep 2012 17:39:07 GMT (envelope-from issyl0@svn.freebsd.org) Message-Id: <201209201739.q8KHd7Rv062672@svn.freebsd.org> From: Isabell Long Date: Thu, 20 Sep 2012 17:39: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: r240759 - stable/8/usr.sbin/adduser X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Sep 2012 17:39:07 -0000 Author: issyl0 (doc committer) Date: Thu Sep 20 17:39:07 2012 New Revision: 240759 URL: http://svn.freebsd.org/changeset/base/240759 Log: MFC r240530 from HEAD: - Remove a reference to CVS and freefall from a user-facing man page. PR: docs/171658 Approved by: gabor (mentor) Modified: stable/8/usr.sbin/adduser/adduser.8 Directory Properties: stable/8/usr.sbin/adduser/ (props changed) Modified: stable/8/usr.sbin/adduser/adduser.8 ============================================================================== --- stable/8/usr.sbin/adduser/adduser.8 Thu Sep 20 17:30:26 2012 (r240758) +++ stable/8/usr.sbin/adduser/adduser.8 Thu Sep 20 17:39:07 2012 (r240759) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 16, 2008 +.Dd September 15, 2012 .Dt ADDUSER 8 .Os .Sh NAME @@ -129,9 +129,8 @@ they can safely run with a umask of 002 and create files in their home directory without worrying about others being able to change them. .Pp -For a shared area you create a separate UID/GID (like cvs or ncvs on freefall), -you place each person that should be able to access this area into that new -group. +For a shared area you create a separate UID/GID, you place each person +that should be able to access this area into that new group. .Pp This model of UID/GID administration allows far greater flexibility than lumping users into groups and having to muck with the umask when working in a shared From owner-svn-src-all@FreeBSD.ORG Thu Sep 20 18:21:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9110C106566B; Thu, 20 Sep 2012 18:21:30 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7978D8FC0A; Thu, 20 Sep 2012 18:21:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8KILUis069311; Thu, 20 Sep 2012 18:21:30 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8KILUMV069297; Thu, 20 Sep 2012 18:21:30 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201209201821.q8KILUMV069297@svn.freebsd.org> From: Alan Cox Date: Thu, 20 Sep 2012 18:21:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240760 - in stable/9/sys: amd64/include arm/include i386/include ia64/include mips/include powerpc/include sparc64/include vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Sep 2012 18:21:30 -0000 Author: alc Date: Thu Sep 20 18:21:29 2012 New Revision: 240760 URL: http://svn.freebsd.org/changeset/base/240760 Log: MFC r237168 The page flag PGA_WRITEABLE is set and cleared exclusively by the pmap layer, but it is read directly by the MI VM layer. This change introduces pmap_page_is_write_mapped() in order to completely encapsulate all direct access to PGA_WRITEABLE in the pmap layer. Modified: stable/9/sys/amd64/include/pmap.h stable/9/sys/arm/include/pmap.h stable/9/sys/i386/include/pmap.h stable/9/sys/ia64/include/pmap.h stable/9/sys/mips/include/pmap.h stable/9/sys/powerpc/include/pmap.h stable/9/sys/sparc64/include/pmap.h stable/9/sys/vm/pmap.h stable/9/sys/vm/swap_pager.c stable/9/sys/vm/vm_page.c stable/9/sys/vm/vm_page.h stable/9/sys/vm/vm_pageout.c stable/9/sys/vm/vnode_pager.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/amd64/include/pmap.h ============================================================================== --- stable/9/sys/amd64/include/pmap.h Thu Sep 20 17:39:07 2012 (r240759) +++ stable/9/sys/amd64/include/pmap.h Thu Sep 20 18:21:29 2012 (r240760) @@ -309,6 +309,7 @@ extern vm_offset_t virtual_avail; extern vm_offset_t virtual_end; #define pmap_page_get_memattr(m) ((vm_memattr_t)(m)->md.pat_mode) +#define pmap_page_is_write_mapped(m) (((m)->aflags & PGA_WRITEABLE) != 0) #define pmap_unmapbios(va, sz) pmap_unmapdev((va), (sz)) void pmap_bootstrap(vm_paddr_t *); Modified: stable/9/sys/arm/include/pmap.h ============================================================================== --- stable/9/sys/arm/include/pmap.h Thu Sep 20 17:39:07 2012 (r240759) +++ stable/9/sys/arm/include/pmap.h Thu Sep 20 18:21:29 2012 (r240760) @@ -78,6 +78,7 @@ #define pmap_page_get_memattr(m) VM_MEMATTR_DEFAULT #define pmap_page_is_mapped(m) (!TAILQ_EMPTY(&(m)->md.pv_list)) +#define pmap_page_is_write_mapped(m) (((m)->aflags & PGA_WRITEABLE) != 0) #define pmap_page_set_memattr(m, ma) (void)0 /* Modified: stable/9/sys/i386/include/pmap.h ============================================================================== --- stable/9/sys/i386/include/pmap.h Thu Sep 20 17:39:07 2012 (r240759) +++ stable/9/sys/i386/include/pmap.h Thu Sep 20 18:21:29 2012 (r240760) @@ -498,6 +498,7 @@ extern vm_offset_t virtual_avail; extern vm_offset_t virtual_end; #define pmap_page_get_memattr(m) ((vm_memattr_t)(m)->md.pat_mode) +#define pmap_page_is_write_mapped(m) (((m)->aflags & PGA_WRITEABLE) != 0) #define pmap_unmapbios(va, sz) pmap_unmapdev((va), (sz)) /* Modified: stable/9/sys/ia64/include/pmap.h ============================================================================== --- stable/9/sys/ia64/include/pmap.h Thu Sep 20 17:39:07 2012 (r240759) +++ stable/9/sys/ia64/include/pmap.h Thu Sep 20 18:21:29 2012 (r240760) @@ -118,6 +118,7 @@ extern int pmap_vhpt_log2size; #define pmap_page_get_memattr(m) ((m)->md.memattr) #define pmap_page_is_mapped(m) (!TAILQ_EMPTY(&(m)->md.pv_list)) +#define pmap_page_is_write_mapped(m) (((m)->aflags & PGA_WRITEABLE) != 0) #define pmap_mapbios(pa, sz) pmap_mapdev(pa, sz) #define pmap_unmapbios(va, sz) pmap_unmapdev(va, sz) Modified: stable/9/sys/mips/include/pmap.h ============================================================================== --- stable/9/sys/mips/include/pmap.h Thu Sep 20 17:39:07 2012 (r240759) +++ stable/9/sys/mips/include/pmap.h Thu Sep 20 18:21:29 2012 (r240760) @@ -151,6 +151,7 @@ extern vm_paddr_t dump_avail[PHYS_AVAIL_ #define pmap_page_get_memattr(m) VM_MEMATTR_DEFAULT #define pmap_page_is_mapped(m) (!TAILQ_EMPTY(&(m)->md.pv_list)) +#define pmap_page_is_write_mapped(m) (((m)->aflags & PGA_WRITEABLE) != 0) #define pmap_page_set_memattr(m, ma) (void)0 void pmap_bootstrap(void); Modified: stable/9/sys/powerpc/include/pmap.h ============================================================================== --- stable/9/sys/powerpc/include/pmap.h Thu Sep 20 17:39:07 2012 (r240759) +++ stable/9/sys/powerpc/include/pmap.h Thu Sep 20 18:21:29 2012 (r240760) @@ -220,6 +220,8 @@ extern struct pmap kernel_pmap_store; #define PMAP_TRYLOCK(pmap) mtx_trylock(&(pmap)->pm_mtx) #define PMAP_UNLOCK(pmap) mtx_unlock(&(pmap)->pm_mtx) +#define pmap_page_is_write_mapped(m) (((m)->aflags & PGA_WRITEABLE) != 0) + void pmap_bootstrap(vm_offset_t, vm_offset_t); void pmap_kenter(vm_offset_t va, vm_offset_t pa); void pmap_kenter_attr(vm_offset_t va, vm_offset_t pa, vm_memattr_t); Modified: stable/9/sys/sparc64/include/pmap.h ============================================================================== --- stable/9/sys/sparc64/include/pmap.h Thu Sep 20 17:39:07 2012 (r240759) +++ stable/9/sys/sparc64/include/pmap.h Thu Sep 20 18:21:29 2012 (r240760) @@ -85,6 +85,7 @@ struct tte_list_lock { #define PMAP_UNLOCK(pmap) mtx_unlock(&(pmap)->pm_mtx) #define pmap_page_get_memattr(m) VM_MEMATTR_DEFAULT +#define pmap_page_is_write_mapped(m) (((m)->aflags & PGA_WRITEABLE) != 0) #define pmap_page_set_memattr(m, ma) (void)0 void pmap_bootstrap(u_int cpu_impl); Modified: stable/9/sys/vm/pmap.h ============================================================================== --- stable/9/sys/vm/pmap.h Thu Sep 20 17:39:07 2012 (r240759) +++ stable/9/sys/vm/pmap.h Thu Sep 20 18:21:29 2012 (r240760) @@ -80,10 +80,11 @@ struct pmap_statistics { typedef struct pmap_statistics *pmap_statistics_t; /* - * Each machine dependent implementation is expected to provide: + * Each machine-dependent implementation is required to provide: * * vm_memattr_t pmap_page_get_memattr(vm_page_t); * boolean_t pmap_page_is_mapped(vm_page_t); + * boolean_t pmap_page_is_write_mapped(vm_page_t); * void pmap_page_set_memattr(vm_page_t, vm_memattr_t); */ #include Modified: stable/9/sys/vm/swap_pager.c ============================================================================== --- stable/9/sys/vm/swap_pager.c Thu Sep 20 17:39:07 2012 (r240759) +++ stable/9/sys/vm/swap_pager.c Thu Sep 20 18:21:29 2012 (r240760) @@ -1593,7 +1593,7 @@ swp_pager_async_iodone(struct buf *bp) * status, then finish the I/O ( which decrements the * busy count and possibly wakes waiter's up ). */ - KASSERT((m->aflags & PGA_WRITEABLE) == 0, + KASSERT(!pmap_page_is_write_mapped(m), ("swp_pager_async_iodone: page %p is not write" " protected", m)); vm_page_undirty(m); Modified: stable/9/sys/vm/vm_page.c ============================================================================== --- stable/9/sys/vm/vm_page.c Thu Sep 20 17:39:07 2012 (r240759) +++ stable/9/sys/vm/vm_page.c Thu Sep 20 18:21:29 2012 (r240760) @@ -965,7 +965,7 @@ vm_page_insert(vm_page_t m, vm_object_t * Since we are inserting a new and possibly dirty page, * update the object's OBJ_MIGHTBEDIRTY flag. */ - if (m->aflags & PGA_WRITEABLE) + if (pmap_page_is_write_mapped(m)) vm_object_set_writeable_dirty(object); } @@ -2504,11 +2504,11 @@ vm_page_clear_dirty_mask(vm_page_t m, vm /* * If the object is locked and the page is neither VPO_BUSY nor - * PGA_WRITEABLE, then the page's dirty field cannot possibly be + * write mapped, then the page's dirty field cannot possibly be * set by a concurrent pmap operation. */ VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED); - if ((m->oflags & VPO_BUSY) == 0 && (m->aflags & PGA_WRITEABLE) == 0) + if ((m->oflags & VPO_BUSY) == 0 && !pmap_page_is_write_mapped(m)) m->dirty &= ~pagebits; else { /* Modified: stable/9/sys/vm/vm_page.h ============================================================================== --- stable/9/sys/vm/vm_page.h Thu Sep 20 17:39:07 2012 (r240759) +++ stable/9/sys/vm/vm_page.h Thu Sep 20 18:21:29 2012 (r240760) @@ -237,20 +237,22 @@ extern struct vpglocks pa_lock[]; #endif #define vm_page_queue_free_mtx vm_page_queue_free_lock.data + /* * These are the flags defined for vm_page. * - * aflags are updated by atomic accesses. Use the vm_page_aflag_set() + * aflags are updated by atomic accesses. Use the vm_page_aflag_set() * and vm_page_aflag_clear() functions to set and clear the flags. * * PGA_REFERENCED may be cleared only if the object containing the page is - * locked. + * locked. It is set by both the MI and MD VM layers. * * PGA_WRITEABLE is set exclusively on managed pages by pmap_enter(). When it - * does so, the page must be VPO_BUSY. + * does so, the page must be VPO_BUSY. The MI VM layer must never access this + * flag directly. Instead, it should call pmap_page_is_write_mapped(). * * PGA_EXECUTABLE may be set by pmap routines, and indicates that a page has - * at least one executable mapping. It is not consumed by the VM layer. + * at least one executable mapping. It is not consumed by the MI VM layer. */ #define PGA_WRITEABLE 0x01 /* page may be mapped writeable */ #define PGA_REFERENCED 0x02 /* page has been referenced */ @@ -262,12 +264,12 @@ extern struct vpglocks pa_lock[]; */ #define PG_CACHED 0x01 /* page is cached */ #define PG_FREE 0x02 /* page is free */ -#define PG_FICTITIOUS 0x04 /* physical page doesn't exist (O) */ +#define PG_FICTITIOUS 0x04 /* physical page doesn't exist */ #define PG_ZERO 0x08 /* page is zeroed */ #define PG_MARKER 0x10 /* special queue marker page */ #define PG_SLAB 0x20 /* object pointer is actually a slab */ #define PG_WINATCFLS 0x40 /* flush dirty page on inactive q */ -#define PG_NODUMP 0x80 /* don't include this page in the dump */ +#define PG_NODUMP 0x80 /* don't include this page in a dump */ /* * Misc constants. Modified: stable/9/sys/vm/vm_pageout.c ============================================================================== --- stable/9/sys/vm/vm_pageout.c Thu Sep 20 17:39:07 2012 (r240759) +++ stable/9/sys/vm/vm_pageout.c Thu Sep 20 18:21:29 2012 (r240760) @@ -503,7 +503,7 @@ vm_pageout_flush(vm_page_t *mc, int coun vm_page_t mt = mc[i]; KASSERT(pageout_status[i] == VM_PAGER_PEND || - (mt->aflags & PGA_WRITEABLE) == 0, + !pmap_page_is_write_mapped(mt), ("vm_pageout_flush: page %p is not write protected", mt)); switch (pageout_status[i]) { case VM_PAGER_OK: @@ -922,7 +922,7 @@ vm_pageout_scan(int pass) * be updated. */ if (m->dirty != VM_PAGE_BITS_ALL && - (m->aflags & PGA_WRITEABLE) != 0) { + pmap_page_is_write_mapped(m)) { /* * Avoid a race condition: Unless write access is * removed from the page, another processor could Modified: stable/9/sys/vm/vnode_pager.c ============================================================================== --- stable/9/sys/vm/vnode_pager.c Thu Sep 20 17:39:07 2012 (r240759) +++ stable/9/sys/vm/vnode_pager.c Thu Sep 20 18:21:29 2012 (r240760) @@ -1116,7 +1116,7 @@ vnode_pager_generic_putpages(struct vnod m = ma[ncount - 1]; KASSERT(m->busy > 0, ("vnode_pager_generic_putpages: page %p is not busy", m)); - KASSERT((m->aflags & PGA_WRITEABLE) == 0, + KASSERT(!pmap_page_is_write_mapped(m), ("vnode_pager_generic_putpages: page %p is not read-only", m)); vm_page_clear_dirty(m, pgoff, PAGE_SIZE - pgoff); From owner-svn-src-all@FreeBSD.ORG Thu Sep 20 18:56:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B87B2106564A; Thu, 20 Sep 2012 18:56:27 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A2F518FC0C; Thu, 20 Sep 2012 18:56:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8KIuRRE075063; Thu, 20 Sep 2012 18:56:27 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8KIuRIY075059; Thu, 20 Sep 2012 18:56:27 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201209201856.q8KIuRIY075059@svn.freebsd.org> From: Alexander Motin Date: Thu, 20 Sep 2012 18:56:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240762 - head/lib/libusbhid X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Sep 2012 18:56:27 -0000 Author: mav Date: Thu Sep 20 18:56:27 2012 New Revision: 240762 URL: http://svn.freebsd.org/changeset/base/240762 Log: Restore handling of the third argument (id) of hid_start_parse(), same as it is done in NetBSD/OpenBSD, and as it was here before r205728. I personally think this API or its implementation is incorrect, as it is not correct to filter collections based on report ID, as they are orthogonal in general case, but I see no harm from supporting this feature. PR: usb/171810 Submitted by: Vitaly Magerya MFC after: 1 month Modified: head/lib/libusbhid/descr.c head/lib/libusbhid/parse.c head/lib/libusbhid/usbhid.3 Modified: head/lib/libusbhid/descr.c ============================================================================== --- head/lib/libusbhid/descr.c Thu Sep 20 18:42:00 2012 (r240761) +++ head/lib/libusbhid/descr.c Thu Sep 20 18:56:27 2012 (r240762) @@ -68,7 +68,7 @@ hid_get_report_id(int fd) if ((rep = hid_get_report_desc(fd)) == NULL) goto use_ioctl; kindset = 1 << hid_input | 1 << hid_output | 1 << hid_feature; - for (d = hid_start_parse(rep, kindset, 0); hid_get_item(d, &h); ) { + for (d = hid_start_parse(rep, kindset, -1); hid_get_item(d, &h); ) { /* Return the first report ID we met. */ if (h.report_ID != 0) { temp = h.report_ID; Modified: head/lib/libusbhid/parse.c ============================================================================== --- head/lib/libusbhid/parse.c Thu Sep 20 18:42:00 2012 (r240761) +++ head/lib/libusbhid/parse.c Thu Sep 20 18:56:27 2012 (r240762) @@ -70,6 +70,7 @@ struct hid_data { uint8_t iusage; /* current "usages_min/max" index */ uint8_t ousage; /* current "usages_min/max" offset */ uint8_t susage; /* usage set flags */ + int32_t reportid; /* requested report ID */ }; /*------------------------------------------------------------------------* @@ -149,7 +150,7 @@ hid_switch_rid(struct hid_data *s, struc * hid_start_parse *------------------------------------------------------------------------*/ hid_data_t -hid_start_parse(report_desc_t d, int kindset, int id __unused) +hid_start_parse(report_desc_t d, int kindset, int id) { struct hid_data *s; @@ -158,6 +159,7 @@ hid_start_parse(report_desc_t d, int kin s->start = s->p = d->data; s->end = d->data + d->size; s->kindset = kindset; + s->reportid = id; return (s); } @@ -207,8 +209,8 @@ hid_get_byte(struct hid_data *s, const u /*------------------------------------------------------------------------* * hid_get_item *------------------------------------------------------------------------*/ -int -hid_get_item(hid_data_t s, hid_item_t *h) +static int +hid_get_item_raw(hid_data_t s, hid_item_t *h) { hid_item_t *c; unsigned int bTag, bType, bSize; @@ -509,6 +511,19 @@ hid_get_item(hid_data_t s, hid_item_t *h } int +hid_get_item(hid_data_t s, hid_item_t *h) +{ + int r; + + for (;;) { + r = hid_get_item_raw(s, h); + if (r <= 0 || s->reportid == -1 || h->report_ID == s->reportid) + break; + } + return (r); +} + +int hid_report_size(report_desc_t r, enum hid_kind k, int id) { struct hid_data *d; @@ -523,7 +538,7 @@ hid_report_size(report_desc_t r, enum hi memset(&h, 0, sizeof h); for (d = hid_start_parse(r, 1 << k, id); hid_get_item(d, &h); ) { - if ((h.report_ID == id || id < 0) && h.kind == k) { + if (h.kind == k) { /* compute minimum */ if (lpos > h.pos) lpos = h.pos; Modified: head/lib/libusbhid/usbhid.3 ============================================================================== --- head/lib/libusbhid/usbhid.3 Thu Sep 20 18:42:00 2012 (r240761) +++ head/lib/libusbhid/usbhid.3 Thu Sep 20 18:56:27 2012 (r240762) @@ -144,16 +144,15 @@ fails it will return .Ss Descriptor Parsing Functions To parse the report descriptor the .Fn hid_start_parse -function should be called with a report descriptor and a set that -describes which items that are interesting. +function should be called with a report descriptor, a set that +describes which items that are interesting, and the desired report +ID (or -1 to obtain items of all report IDs). The set is obtained by OR-ing together values .Fa "(1 << k)" where .Fa k is an item of type .Vt hid_kind_t . -The report ID (if present) is given by -.Fa id . The function returns .Dv NULL if the initialization fails, otherwise an opaque value to be used From owner-svn-src-all@FreeBSD.ORG Thu Sep 20 18:59:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8027F106564A; Thu, 20 Sep 2012 18:59:51 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6C0988FC1F; Thu, 20 Sep 2012 18:59:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8KIxp7g075982; Thu, 20 Sep 2012 18:59:51 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8KIxpOP075980; Thu, 20 Sep 2012 18:59:51 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201209201859.q8KIxpOP075980@svn.freebsd.org> From: Alexander Motin Date: Thu, 20 Sep 2012 18:59:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240763 - stable/9/sys/dev/ahci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Sep 2012 18:59:51 -0000 Author: mav Date: Thu Sep 20 18:59:50 2012 New Revision: 240763 URL: http://svn.freebsd.org/changeset/base/240763 Log: MFC r240383: Fix AHCI 1.2 version checks. This should be mostly cosmetic. Modified: stable/9/sys/dev/ahci/ahci.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/ahci/ahci.c ============================================================================== --- stable/9/sys/dev/ahci/ahci.c Thu Sep 20 18:56:27 2012 (r240762) +++ stable/9/sys/dev/ahci/ahci.c Thu Sep 20 18:59:50 2012 (r240763) @@ -409,7 +409,7 @@ ahci_attach(device_t dev) /* Get the HW capabilities */ version = ATA_INL(ctlr->r_mem, AHCI_VS); ctlr->caps = ATA_INL(ctlr->r_mem, AHCI_CAP); - if (version >= 0x00010020) + if (version >= 0x00010200) ctlr->caps2 = ATA_INL(ctlr->r_mem, AHCI_CAP2); if (ctlr->caps & AHCI_CAP_EMS) ctlr->capsem = ATA_INL(ctlr->r_mem, AHCI_EM_CTL); @@ -490,7 +490,7 @@ ahci_attach(device_t dev) (ctlr->caps & AHCI_CAP_SXS) ? " eSATA":"", (ctlr->caps & AHCI_CAP_NPMASK) + 1); } - if (bootverbose && version >= 0x00010020) { + if (bootverbose && version >= 0x00010200) { device_printf(dev, "Caps2:%s%s%s\n", (ctlr->caps2 & AHCI_CAP2_APST) ? " APST":"", (ctlr->caps2 & AHCI_CAP2_NVMP) ? " NVMP":"", @@ -975,7 +975,7 @@ ahci_ch_attach(device_t dev) } ch->chcaps = ATA_INL(ch->r_mem, AHCI_P_CMD); version = ATA_INL(ctlr->r_mem, AHCI_VS); - if (version < 0x00010020 && (ctlr->caps & AHCI_CAP_FBSS)) + if (version < 0x00010200 && (ctlr->caps & AHCI_CAP_FBSS)) ch->chcaps |= AHCI_P_CMD_FBSCP; if (bootverbose) { device_printf(dev, "Caps:%s%s%s%s%s\n", From owner-svn-src-all@FreeBSD.ORG Thu Sep 20 19:05:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D3516106566B; Thu, 20 Sep 2012 19:05:24 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BDD9F8FC08; Thu, 20 Sep 2012 19:05:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8KJ5OpH076964; Thu, 20 Sep 2012 19:05:24 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8KJ5Ori076961; Thu, 20 Sep 2012 19:05:24 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201209201905.q8KJ5Ori076961@svn.freebsd.org> From: Alexander Motin Date: Thu, 20 Sep 2012 19:05: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: r240764 - stable/8/sys/dev/ahci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Sep 2012 19:05:25 -0000 Author: mav Date: Thu Sep 20 19:05:24 2012 New Revision: 240764 URL: http://svn.freebsd.org/changeset/base/240764 Log: MFC r240383: Fix AHCI 1.2 version checks. This should be mostly cosmetic. Modified: stable/8/sys/dev/ahci/ahci.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/ahci/ (props changed) Modified: stable/8/sys/dev/ahci/ahci.c ============================================================================== --- stable/8/sys/dev/ahci/ahci.c Thu Sep 20 18:59:50 2012 (r240763) +++ stable/8/sys/dev/ahci/ahci.c Thu Sep 20 19:05:24 2012 (r240764) @@ -408,7 +408,7 @@ ahci_attach(device_t dev) /* Get the HW capabilities */ version = ATA_INL(ctlr->r_mem, AHCI_VS); ctlr->caps = ATA_INL(ctlr->r_mem, AHCI_CAP); - if (version >= 0x00010020) + if (version >= 0x00010200) ctlr->caps2 = ATA_INL(ctlr->r_mem, AHCI_CAP2); if (ctlr->caps & AHCI_CAP_EMS) ctlr->capsem = ATA_INL(ctlr->r_mem, AHCI_EM_CTL); @@ -489,7 +489,7 @@ ahci_attach(device_t dev) (ctlr->caps & AHCI_CAP_SXS) ? " eSATA":"", (ctlr->caps & AHCI_CAP_NPMASK) + 1); } - if (bootverbose && version >= 0x00010020) { + if (bootverbose && version >= 0x00010200) { device_printf(dev, "Caps2:%s%s%s\n", (ctlr->caps2 & AHCI_CAP2_APST) ? " APST":"", (ctlr->caps2 & AHCI_CAP2_NVMP) ? " NVMP":"", @@ -972,7 +972,7 @@ ahci_ch_attach(device_t dev) } ch->chcaps = ATA_INL(ch->r_mem, AHCI_P_CMD); version = ATA_INL(ctlr->r_mem, AHCI_VS); - if (version < 0x00010020 && (ctlr->caps & AHCI_CAP_FBSS)) + if (version < 0x00010200 && (ctlr->caps & AHCI_CAP_FBSS)) ch->chcaps |= AHCI_P_CMD_FBSCP; if (bootverbose) { device_printf(dev, "Caps:%s%s%s%s%s\n", From owner-svn-src-all@FreeBSD.ORG Thu Sep 20 21:16:41 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B14C5106566B; Thu, 20 Sep 2012 21:16:41 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id 3ADA98FC0C; Thu, 20 Sep 2012 21:16:41 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id EFB3F806; Thu, 20 Sep 2012 23:15:44 +0200 (CEST) Date: Thu, 20 Sep 2012 23:17:01 +0200 From: Pawel Jakub Dawidek To: Baptiste Daroussin Message-ID: <20120920211701.GD1407@garage.freebsd.pl> References: <201209191628.q8JGSckQ025683@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="IDYEmSnFhs3mNXr+" Content-Disposition: inline In-Reply-To: <201209191628.q8JGSckQ025683@svn.freebsd.org> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r240698 - head/cddl/contrib/opensolaris/cmd/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Sep 2012 21:16:41 -0000 --IDYEmSnFhs3mNXr+ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Sep 19, 2012 at 04:28:38PM +0000, Baptiste Daroussin wrote: > Author: bapt > Date: Wed Sep 19 16:28:38 2012 > New Revision: 240698 > URL: http://svn.freebsd.org/changeset/base/240698 >=20 > Log: > Update usage to show the possiblity to use jail name > =20 > Reported by: bdrewery > MFC after: 1 month >=20 > Modified: > head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c >=20 > Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c > =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 > --- head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Wed Sep 19 16:21:23 = 2012 (r240697) > +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Wed Sep 19 16:28:38 = 2012 (r240698) > @@ -240,9 +240,9 @@ get_usage(zfs_help_t idx) > return (gettext("\tupgrade [-v]\n" > "\tupgrade [-r] [-V version] <-a | filesystem ...>\n")); > case HELP_JAIL: > - return (gettext("\tjail \n")); > + return (gettext("\tjail \n")); Please keep the style consistent. As you can see two lines above there are spaces around |. > case HELP_UNJAIL: > - return (gettext("\tunjail \n")); > + return (gettext("\tunjail \n")); > case HELP_LIST: > return (gettext("\tlist [-rH][-d max] " > "[-o property[,...]] [-t type[,...]] [-s property] ...\n" --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --IDYEmSnFhs3mNXr+ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlBbh80ACgkQForvXbEpPzQZIwCff7+muhxlJ/w+VtwsZpo6k7x1 QzwAnRsiZpGW7Lsf2Zy2V+DVVGmTVGP1 =w65W -----END PGP SIGNATURE----- --IDYEmSnFhs3mNXr+-- From owner-svn-src-all@FreeBSD.ORG Thu Sep 20 21:38:46 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5430A1065670; Thu, 20 Sep 2012 21:38:46 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 1EFC58FC12; Thu, 20 Sep 2012 21:38:46 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q8KLckKN040307; Thu, 20 Sep 2012 21:38:46 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q8KLcjxH040306; Thu, 20 Sep 2012 21:38:45 GMT (envelope-from bapt@FreeBSD.org) X-Authentication-Warning: freefall.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f Date: Thu, 20 Sep 2012 23:38:43 +0200 From: Baptiste Daroussin To: Pawel Jakub Dawidek Message-ID: <20120920213843.GQ26107@ithaqua.etoilebsd.net> References: <201209191628.q8JGSckQ025683@svn.freebsd.org> <20120920211701.GD1407@garage.freebsd.pl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Y9o+fgG4MNl0mnzl" Content-Disposition: inline In-Reply-To: <20120920211701.GD1407@garage.freebsd.pl> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r240698 - head/cddl/contrib/opensolaris/cmd/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Sep 2012 21:38:46 -0000 --Y9o+fgG4MNl0mnzl Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Sep 20, 2012 at 11:17:01PM +0200, Pawel Jakub Dawidek wrote: > On Wed, Sep 19, 2012 at 04:28:38PM +0000, Baptiste Daroussin wrote: > > Author: bapt > > Date: Wed Sep 19 16:28:38 2012 > > New Revision: 240698 > > URL: http://svn.freebsd.org/changeset/base/240698 > >=20 > > Log: > > Update usage to show the possiblity to use jail name > > =20 > > Reported by: bdrewery > > MFC after: 1 month > >=20 > > Modified: > > head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c > >=20 > > Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c > > =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 > > --- head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Wed Sep 19 16:21:2= 3 2012 (r240697) > > +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Wed Sep 19 16:28:3= 8 2012 (r240698) > > @@ -240,9 +240,9 @@ get_usage(zfs_help_t idx) > > return (gettext("\tupgrade [-v]\n" > > "\tupgrade [-r] [-V version] <-a | filesystem ...>\n")); > > case HELP_JAIL: > > - return (gettext("\tjail \n")); > > + return (gettext("\tjail \n")); >=20 > Please keep the style consistent. As you can see two lines above there > are spaces around |. >=20 Sure but both syntax are present in the usage: = in fact the only one with space around | is the line above you are showing, al= l the rest of the usage is without space, That is why I did it without spaces. If you tell me it is better with spaces, I'll add space. regards, Bapt --Y9o+fgG4MNl0mnzl Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlBbjOMACgkQ8kTtMUmk6EyUTwCeI7gGybplsOsDYFs6a51Ce38X cdAAnAkoiZqCF/NBYJ+pnuBCbspxHmEP =uzqg -----END PGP SIGNATURE----- --Y9o+fgG4MNl0mnzl-- From owner-svn-src-all@FreeBSD.ORG Thu Sep 20 23:44:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F2BA0106566C; Thu, 20 Sep 2012 23:44:14 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D97AC8FC0A; Thu, 20 Sep 2012 23:44:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8KNiEt0015444; Thu, 20 Sep 2012 23:44:14 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8KNiEmn015410; Thu, 20 Sep 2012 23:44:14 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201209202344.q8KNiEmn015410@svn.freebsd.org> From: Devin Teske Date: Thu, 20 Sep 2012 23:44:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240768 - in head/usr.sbin/bsdconfig: . console mouse networking networking/share password/share security share startup startup/share timezone usermgmt usermgmt/share X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Sep 2012 23:44:15 -0000 Author: dteske Date: Thu Sep 20 23:44:13 2012 New Revision: 240768 URL: http://svn.freebsd.org/changeset/base/240768 Log: Change all invocations of dialog(1) to no-longer require temporary files. This allows bsdconfig to -- like bsdinstall -- operate from read-only media. Reviewed by: adrian (co-mentor) Approved by: adrian (co-mentor) Modified: head/usr.sbin/bsdconfig/bsdconfig head/usr.sbin/bsdconfig/console/console head/usr.sbin/bsdconfig/console/font head/usr.sbin/bsdconfig/console/keymap head/usr.sbin/bsdconfig/console/repeat head/usr.sbin/bsdconfig/console/saver head/usr.sbin/bsdconfig/console/screenmap head/usr.sbin/bsdconfig/console/ttys head/usr.sbin/bsdconfig/mouse/flags head/usr.sbin/bsdconfig/mouse/mouse head/usr.sbin/bsdconfig/mouse/port head/usr.sbin/bsdconfig/mouse/type head/usr.sbin/bsdconfig/networking/networking head/usr.sbin/bsdconfig/networking/share/device.subr head/usr.sbin/bsdconfig/networking/share/hostname.subr head/usr.sbin/bsdconfig/networking/share/ipaddr.subr head/usr.sbin/bsdconfig/networking/share/media.subr head/usr.sbin/bsdconfig/networking/share/netmask.subr head/usr.sbin/bsdconfig/networking/share/resolv.subr head/usr.sbin/bsdconfig/networking/share/routing.subr head/usr.sbin/bsdconfig/password/share/password.subr head/usr.sbin/bsdconfig/security/kern_securelevel head/usr.sbin/bsdconfig/security/security head/usr.sbin/bsdconfig/share/dialog.subr head/usr.sbin/bsdconfig/share/mustberoot.subr head/usr.sbin/bsdconfig/startup/misc head/usr.sbin/bsdconfig/startup/rcadd head/usr.sbin/bsdconfig/startup/rcconf head/usr.sbin/bsdconfig/startup/rcdelete head/usr.sbin/bsdconfig/startup/rcvar head/usr.sbin/bsdconfig/startup/share/rcconf.subr head/usr.sbin/bsdconfig/startup/share/rcedit.subr head/usr.sbin/bsdconfig/startup/startup head/usr.sbin/bsdconfig/timezone/timezone head/usr.sbin/bsdconfig/usermgmt/groupinput head/usr.sbin/bsdconfig/usermgmt/share/group_input.subr head/usr.sbin/bsdconfig/usermgmt/share/user_input.subr head/usr.sbin/bsdconfig/usermgmt/userinput head/usr.sbin/bsdconfig/usermgmt/usermgmt Modified: head/usr.sbin/bsdconfig/bsdconfig ============================================================================== --- head/usr.sbin/bsdconfig/bsdconfig Thu Sep 20 23:00:01 2012 (r240767) +++ head/usr.sbin/bsdconfig/bsdconfig Thu Sep 20 23:44:13 2012 (r240768) @@ -177,7 +177,8 @@ dialog_menu_main() \"\" \ $menu_list ) - eval $DIALOG \ + local dialog_menu + dialog_menu=$( eval $DIALOG \ --clear \ --title \"\$title\" \ --backtitle \"\$btitle\" \ @@ -185,7 +186,11 @@ dialog_menu_main() --ok-label \"\$msg_ok\" \ --cancel-label \"\$msg_exit_bsdconfig\" \ --menu \"\$prompt\" $size $menu_list \ - 2> "$DIALOG_TMPDIR/dialog.menu.$$" + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) + local retval=$? + setvar DIALOG_MENU_$$ "$dialog_menu" + return $retval } ############################################################ MAIN Modified: head/usr.sbin/bsdconfig/console/console ============================================================================== --- head/usr.sbin/bsdconfig/console/console Thu Sep 20 23:00:01 2012 (r240767) +++ head/usr.sbin/bsdconfig/console/console Thu Sep 20 23:44:13 2012 (r240768) @@ -68,7 +68,8 @@ dialog_menu_main() \"\$hline\" \ $menu_list ) - eval $DIALOG \ + local dialog_menu + dialog_menu=$( eval $DIALOG \ --clear --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -76,7 +77,11 @@ dialog_menu_main() --cancel-label \"\$msg_cancel\" \ --menu \"\$prompt\" $size \ $menu_list \ - 2> "$DIALOG_TMPDIR/dialog.menu.$$" + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) + local retval=$? + setvar DIALOG_MENU_$$ "$dialog_menu" + return $retval } ############################################################ MAIN Modified: head/usr.sbin/bsdconfig/console/font ============================================================================== --- head/usr.sbin/bsdconfig/console/font Thu Sep 20 23:00:01 2012 (r240767) +++ head/usr.sbin/bsdconfig/console/font Thu Sep 20 23:44:13 2012 (r240768) @@ -76,7 +76,8 @@ dialog_menu_main() \"\$hline\" \ $menu_list ) - eval $DIALOG \ + local dialog_menu + dialog_menu=$( eval $DIALOG \ --clear --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -84,7 +85,11 @@ dialog_menu_main() --cancel-label \"\$msg_cancel\" \ --menu \"\$prompt\" $size \ $menu_list \ - 2> "$DIALOG_TMPDIR/dialog.menu.$$" + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) + local retval=$? + setvar DIALOG_MENU_$$ "$dialog_menu" + return $retval } ############################################################ MAIN Modified: head/usr.sbin/bsdconfig/console/keymap ============================================================================== --- head/usr.sbin/bsdconfig/console/keymap Thu Sep 20 23:00:01 2012 (r240767) +++ head/usr.sbin/bsdconfig/console/keymap Thu Sep 20 23:44:13 2012 (r240768) @@ -116,7 +116,8 @@ dialog_menu_main() \"\$hline\" \ $menu_list ) - eval $DIALOG \ + local dialog_menu + dialog_menu=$( eval $DIALOG \ --clear --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -124,7 +125,11 @@ dialog_menu_main() --cancel-label \"\$msg_cancel\" \ --menu \"\$prompt\" $size \ $menu_list \ - 2> "$DIALOG_TMPDIR/dialog.menu.$$" + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) + local retval=$? + setvar DIALOG_MENU_$$ "$dialog_menu" + return $retval } ############################################################ MAIN Modified: head/usr.sbin/bsdconfig/console/repeat ============================================================================== --- head/usr.sbin/bsdconfig/console/repeat Thu Sep 20 23:00:01 2012 (r240767) +++ head/usr.sbin/bsdconfig/console/repeat Thu Sep 20 23:44:13 2012 (r240768) @@ -66,7 +66,8 @@ dialog_menu_main() \"\$hline\" \ $menu_list ) - eval $DIALOG \ + local dialog_menu + dialog_menu=$( eval $DIALOG \ --clear --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -74,7 +75,11 @@ dialog_menu_main() --cancel-label \"\$msg_cancel\" \ --menu \"\$prompt\" $size \ $menu_list \ - 2> "$DIALOG_TMPDIR/dialog.menu.$$" + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) + local retval=$? + setvar DIALOG_MENU_$$ "$dialog_menu" + return $retval } ############################################################ MAIN Modified: head/usr.sbin/bsdconfig/console/saver ============================================================================== --- head/usr.sbin/bsdconfig/console/saver Thu Sep 20 23:00:01 2012 (r240767) +++ head/usr.sbin/bsdconfig/console/saver Thu Sep 20 23:44:13 2012 (r240768) @@ -76,7 +76,8 @@ dialog_menu_main() \"\$hline\" \ $menu_list ) - eval $DIALOG \ + local dialog_menu + dialog_menu=$( eval $DIALOG \ --clear --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -84,7 +85,11 @@ dialog_menu_main() --cancel-label \"\$msg_cancel\" \ --menu \"\$prompt\" $size \ $menu_list \ - 2> "$DIALOG_TMPDIR/dialog.menu.$$" + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) + local retval=$? + setvar DIALOG_MENU_$$ "$dialog_menu" + return $retval } ############################################################ MAIN @@ -174,7 +179,7 @@ while :; do "$prompt" \ "$blanktime" \ "$hline" ) - $DIALOG \ + dialog_inputbox=$( $DIALOG \ --title "$title" \ --backtitle "$btitle" \ --hline "$hline" \ @@ -182,8 +187,10 @@ while :; do --cancel-label "$msg_cancel" \ --inputbox "$prompt" $size \ "$blanktime" \ - 2> "$DIALOG_TMPDIR/dialog.inputbox.$$" + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) retval=$? + setvar DIALOG_INPUTBOX_$$ "$dialog_inputbox" blanktime=$( f_dialog_inputstr ) [ $retval -eq $SUCCESS ] && f_sysrc_set blanktime "$blanktime" Modified: head/usr.sbin/bsdconfig/console/screenmap ============================================================================== --- head/usr.sbin/bsdconfig/console/screenmap Thu Sep 20 23:00:01 2012 (r240767) +++ head/usr.sbin/bsdconfig/console/screenmap Thu Sep 20 23:44:13 2012 (r240768) @@ -68,7 +68,8 @@ dialog_menu_main() \"\$hline\" \ $menu_list ) - eval $DIALOG \ + local dialog_menu + dialog_menu=$( eval $DIALOG \ --clear --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -76,7 +77,11 @@ dialog_menu_main() --cancel-label \"\$msg_cancel\" \ --menu \"\$prompt\" $size \ $menu_list \ - 2> "$DIALOG_TMPDIR/dialog.menu.$$" + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) + local retval=$? + setvar DIALOG_MENU_$$ "$dialog_menu" + return $retval } ############################################################ MAIN Modified: head/usr.sbin/bsdconfig/console/ttys ============================================================================== --- head/usr.sbin/bsdconfig/console/ttys Thu Sep 20 23:00:01 2012 (r240767) +++ head/usr.sbin/bsdconfig/console/ttys Thu Sep 20 23:44:13 2012 (r240768) @@ -82,7 +82,8 @@ dialog_menu_main() \"\$hline\" \ $TTY_MENU_LIST ) - eval $DIALOG \ + local dialog_menu + dialog_menu=$( eval $DIALOG \ --clear --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -90,7 +91,11 @@ dialog_menu_main() --cancel-label \"\$msg_cancel\" \ --menu \"\$prompt\" $size \ $TTY_MENU_LIST \ - 2> "$DIALOG_TMPDIR/dialog.menu.$$" + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) + local retval=$? + setvar DIALOG_MENU_$$ "$dialog_menu" + return $retval } # ttys_set_type $consterm Modified: head/usr.sbin/bsdconfig/mouse/flags ============================================================================== --- head/usr.sbin/bsdconfig/mouse/flags Thu Sep 20 23:00:01 2012 (r240767) +++ head/usr.sbin/bsdconfig/mouse/flags Thu Sep 20 23:44:13 2012 (r240768) @@ -90,7 +90,7 @@ size=$( f_dialog_inputbox_size \ "$prompt" \ "$flags" \ "$hline" ) -eval $DIALOG \ +dialog_inputbox=$( eval $DIALOG \ --title \"\$title\" \ --backtitle \"\$btitle\" \ --hline \"\$hline\" \ @@ -98,8 +98,10 @@ eval $DIALOG \ --cancel-label \"\$msg_cancel\" \ --inputbox \"\$prompt\" $size \ \"\$flags\" \ - 2> "$DIALOG_TMPDIR/dialog.inputbox.$$" + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD +) retval=$? +setvar MENU_INPUTBOX_$$ "$dialog_inputbox" flags=$( f_dialog_inputstr ) [ $retval -eq $SUCCESS ] || f_die Modified: head/usr.sbin/bsdconfig/mouse/mouse ============================================================================== --- head/usr.sbin/bsdconfig/mouse/mouse Thu Sep 20 23:00:01 2012 (r240767) +++ head/usr.sbin/bsdconfig/mouse/mouse Thu Sep 20 23:44:13 2012 (r240768) @@ -67,7 +67,8 @@ dialog_menu_main() \"\$hline\" \ $menu_list ) - eval $DIALOG \ + local dialog_menu + dialog_menu=$( eval $DIALOG \ --clear --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -75,7 +76,11 @@ dialog_menu_main() --cancel-label \"\$msg_cancel\" \ --menu \"\$prompt\" $size \ $menu_list \ - 2> "$DIALOG_TMPDIR/dialog.menu.$$" + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) + local retval=$? + setvar DIALOG_MENU_$$ "$dialog_menu" + return $retval } ############################################################ MAIN Modified: head/usr.sbin/bsdconfig/mouse/port ============================================================================== --- head/usr.sbin/bsdconfig/mouse/port Thu Sep 20 23:00:01 2012 (r240767) +++ head/usr.sbin/bsdconfig/mouse/port Thu Sep 20 23:44:13 2012 (r240768) @@ -68,7 +68,8 @@ dialog_menu_main() \"\$hline\" \ $menu_list ) - eval $DIALOG \ + local dialog_menu + dialog_menu=$( eval $DIALOG \ --clear --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -76,7 +77,11 @@ dialog_menu_main() --cancel-label \"\$msg_cancel\" \ --menu \"\$prompt\" $size \ $menu_list \ - 2> "$DIALOG_TMPDIR/dialog.menu.$$" + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) + local retval=$? + setvar DIALOG_MENU_$$ "$dialog_menu" + return $retval } ############################################################ MAIN Modified: head/usr.sbin/bsdconfig/mouse/type ============================================================================== --- head/usr.sbin/bsdconfig/mouse/type Thu Sep 20 23:00:01 2012 (r240767) +++ head/usr.sbin/bsdconfig/mouse/type Thu Sep 20 23:44:13 2012 (r240768) @@ -72,7 +72,8 @@ dialog_menu_main() \"\$hline\" \ $menu_list ) - eval $DIALOG \ + local dialog_menu + dialog_menu=$( eval $DIALOG \ --clear --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -80,7 +81,11 @@ dialog_menu_main() --cancel-label \"\$msg_cancel\" \ --menu \"\$prompt\" $size \ $menu_list \ - 2> "$DIALOG_TMPDIR/dialog.menu.$$" + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) + local retval=$? + setvar DIALOG_MENU_$$ "$dialog_menu" + return $retval } ############################################################ MAIN Modified: head/usr.sbin/bsdconfig/networking/networking ============================================================================== --- head/usr.sbin/bsdconfig/networking/networking Thu Sep 20 23:00:01 2012 (r240767) +++ head/usr.sbin/bsdconfig/networking/networking Thu Sep 20 23:44:13 2012 (r240768) @@ -65,14 +65,19 @@ dialog_menu_main() \"\$hline\" \ $menu_list ) - eval $DIALOG \ + local dialog_menu + dialog_menu=$( eval $DIALOG \ --clear --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ --ok-label \"\$msg_ok\" \ --cancel-label \"\$msg_cancel\" \ --menu \"\" $size $menu_list \ - 2> "$DIALOG_TMPDIR/dialog.menu.$$" + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) + local retval=$? + setvar DIALOG_MENU_$$ "$dialog_menu" + return $retval } ############################################################ MAIN Modified: head/usr.sbin/bsdconfig/networking/share/device.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/device.subr Thu Sep 20 23:00:01 2012 (r240767) +++ head/usr.sbin/bsdconfig/networking/share/device.subr Thu Sep 20 23:44:13 2012 (r240768) @@ -265,7 +265,8 @@ f_dialog_menu_netdev() \"\$prompt\" \ \"\$hline\" \ $interfaces ) - eval $DIALOG \ + local dialog_menu + dialog_menu=$( eval $DIALOG \ --clear --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -273,7 +274,11 @@ f_dialog_menu_netdev() --cancel-label \"\$msg_cancel\" \ --menu \"\$prompt\" $size \ $interfaces \ - 2> "$DIALOG_TMPDIR/dialog.menu.$$" + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) + local retval=$? + setvar DIALOG_MENU_$$ "$dialog_menu" + return $retval } # f_dialog_menu_netdev_edit $interface $ipaddr $netmask $options $dhcp @@ -330,7 +335,8 @@ f_dialog_menu_netdev_edit() \"\$prompt\" \ \"\$hline\" \ $menu_list ) - eval $DIALOG \ + local dialog_menu + dialog_menu=$( eval $DIALOG \ --clear --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -338,9 +344,11 @@ f_dialog_menu_netdev_edit() --cancel-label \"\$msg_cancel\" \ --menu \"\$prompt\" $size \ $menu_list \ - 2> "$DIALOG_TMPDIR/dialog.menu.$$" + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) local retval=$? + setvar DIALOG_MENU_$$ "$dialog_menu" local tag="$( f_dialog_menutag )" # Return if "Cancel" was chosen (-1) or ESC was pressed (255) Modified: head/usr.sbin/bsdconfig/networking/share/hostname.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/hostname.subr Thu Sep 20 23:00:01 2012 (r240767) +++ head/usr.sbin/bsdconfig/networking/share/hostname.subr Thu Sep 20 23:44:13 2012 (r240768) @@ -146,7 +146,8 @@ f_dialog_input_hostname() "$msg" \ "$hostname" \ "$hline" ) - eval $DIALOG \ + local dialog_inputbox + dialog_inputbox=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -154,9 +155,11 @@ f_dialog_input_hostname() --cancel-label \"\$msg_cancel\" \ --inputbox \"\$msg\" $size \ \"\$hostname\" \ - 2> "$DIALOG_TMPDIR/dialog.inputbox.$$" + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) local retval=$? + setvar DIALOG_INPUTBOX_$$ "$dialog_inputbox" hostname=$( f_dialog_inputstr ) [ $retval -eq $SUCCESS ] || return $retval Modified: head/usr.sbin/bsdconfig/networking/share/ipaddr.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/ipaddr.subr Thu Sep 20 23:00:01 2012 (r240767) +++ head/usr.sbin/bsdconfig/networking/share/ipaddr.subr Thu Sep 20 23:44:13 2012 (r240768) @@ -167,7 +167,8 @@ f_dialog_input_ipaddr() # Loop until the user provides taint-free input. # while :; do - eval $DIALOG \ + local dialog_inputbox + dialog_inputbox=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -175,9 +176,11 @@ f_dialog_input_ipaddr() --cancel-label \"\$msg_cancel\" \ --inputbox \"\$msg\" $size \ \"\$_ipaddr\" \ - 2> "$DIALOG_TMPDIR/dialog.inputbox.$$" + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) local retval=$? + setvar DIALOG_INPUTBOX_$$ "$dialog_inputbox" _input=$( f_dialog_inputstr ) # Modified: head/usr.sbin/bsdconfig/networking/share/media.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/media.subr Thu Sep 20 23:00:01 2012 (r240767) +++ head/usr.sbin/bsdconfig/networking/share/media.subr Thu Sep 20 23:44:13 2012 (r240768) @@ -123,7 +123,8 @@ f_dialog_input_options() local msg="$( printf "$msg_please_enter_mediaopts" "$interface" )" local hline="$hline_alnum_punc_tab_enter" - $DIALOG \ + local dialog_inputbox + dialog_inputbox=$( $DIALOG \ --title "$DIALOG_TITLE" \ --backtitle "$DIALOG_BACKTITLE" \ --hline "$hline" \ @@ -131,9 +132,11 @@ f_dialog_input_options() --cancel-label "$msg_cancel" \ --inputbox "$msg" 9 70 \ "$options" \ - 2> "$DIALOG_TMPDIR/dialog.inputbox.$$" + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) local retval=$? + setvar DIALOG_INPUTBOX_$$ "$dialog_inputbox" local _options="$( f_dialog_inputstr )" [ $retval -eq $SUCCESS ] && options="$_options" @@ -205,7 +208,8 @@ f_dialog_menu_media_options() local hline="$hline_arrows_tab_enter" - eval $DIALOG \ + local dialog_menu + dialog_menu=$( eval $DIALOG \ --clear --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -213,9 +217,11 @@ f_dialog_menu_media_options() --cancel-label \"\$msg_cancel\" \ --menu \"\$msg\" 21 60 12 \ $supported_media \ - 2> "$DIALOG_TMPDIR/dialog.menu.$$" + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) local retval=$? + setvar DIALOG_MENU_$$ "$dialog_menu" if [ $retval -eq $SUCCESS ]; then local tag="$( f_dialog_menutag )" options=$( eval f_dialog_menutag2item \"\$tag\" \ Modified: head/usr.sbin/bsdconfig/networking/share/netmask.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/netmask.subr Thu Sep 20 23:00:01 2012 (r240767) +++ head/usr.sbin/bsdconfig/networking/share/netmask.subr Thu Sep 20 23:44:13 2012 (r240768) @@ -177,7 +177,8 @@ f_dialog_input_netmask() # Loop until the user provides taint-free input. # while :; do - eval $DIALOG \ + local dialog_inputbox + dialog_inputbox=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -185,9 +186,11 @@ f_dialog_input_netmask() --cancel-label \"\$msg_cancel\" \ --inputbox \"\$msg\" $size \ \"\$_netmask\" \ - 2> "$DIALOG_TMPDIR/dialog.inputbox.$$" + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) local retval=$? + setvar DIALOG_INPUTBOX_$$ "$dialog_inputbox" _input=$( f_dialog_inputstr ) # Modified: head/usr.sbin/bsdconfig/networking/share/resolv.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/resolv.subr Thu Sep 20 23:00:01 2012 (r240767) +++ head/usr.sbin/bsdconfig/networking/share/resolv.subr Thu Sep 20 23:44:13 2012 (r240768) @@ -342,7 +342,8 @@ f_dialog_input_nameserver() # while :; do - eval $DIALOG \ + local dialog_inputbox + dialog_inputbox=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -350,9 +351,11 @@ f_dialog_input_nameserver() --cancel-label \"\$msg_cancel\" \ --inputbox \"\$msg\" $size \ \"\$ns\" \ - 2> "$DIALOG_TMPDIR/dialog.inputbox.$$" + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) local retval=$? + setvar DIALOG_INPUTBOX_$$ "$dialog_inputbox" new_ns=$( f_dialog_inputstr ) [ $retval -eq $SUCCESS ] || return $retval @@ -476,7 +479,8 @@ f_dialog_menu_nameservers() \"\$prompt\" \ \"\$hline\" \ $menu_list ) - eval $DIALOG \ + local dialog_menu + dialog_menu=$( eval $DIALOG \ --clear --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -484,9 +488,11 @@ f_dialog_menu_nameservers() --cancel-label \"\$msg_cancel\" \ --menu \"\$prompt\" $size \ $menu_list \ - 2> "$DIALOG_TMPDIR/dialog.menu.$$" + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) local retval=$? + setvar DIALOG_MENU_$$ "$dialog_menu" local tag="$( f_dialog_menutag )" ns="" # Return if "Cancel" was chosen (-1) or ESC was pressed (255) Modified: head/usr.sbin/bsdconfig/networking/share/routing.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/routing.subr Thu Sep 20 23:00:01 2012 (r240767) +++ head/usr.sbin/bsdconfig/networking/share/routing.subr Thu Sep 20 23:44:13 2012 (r240768) @@ -110,7 +110,8 @@ f_dialog_input_defaultrouter() # Loop until the user provides taint-free input. # while :; do - eval $DIALOG \ + local dialog_inputbox + dialog_inputbox=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -118,9 +119,11 @@ f_dialog_input_defaultrouter() --cancel-label \"\$msg_cancel\" \ --inputbox \"\$msg\" $size \ \"\$defaultrouter\" \ - 2> "$DIALOG_TMPDIR/dialog.inputbox.$$" + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) local retval=$? + setvar DIALOG_INPUTBOX_$$ "$dialog_inputbox" defaultrouter=$( f_dialog_inputstr ) [ "$defaultrouter" ] || return $SUCCESS Modified: head/usr.sbin/bsdconfig/password/share/password.subr ============================================================================== --- head/usr.sbin/bsdconfig/password/share/password.subr Thu Sep 20 23:00:01 2012 (r240767) +++ head/usr.sbin/bsdconfig/password/share/password.subr Thu Sep 20 23:44:13 2012 (r240768) @@ -68,7 +68,8 @@ f_dialog_input_password() # local retval _password1 _password2 while :; do - eval $DIALOG \ + local dialog_inputbox + dialog_inputbox=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -76,15 +77,17 @@ f_dialog_input_password() --cancel-label \"\$msg_cancel\" \ --insecure \ --passwordbox \"\$msg\" $size \ - 2> $DIALOG_TMPDIR/dialog.inputbox.$$ + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) retval=$? + setvar DIALOG_INPUTBOX_$$ "$dialog_inputbox" _password1=$( f_dialog_inputstr ) # Return if user has either pressed ESC or chosen Cancel/No [ $retval -eq $SUCCESS ] || return $retval - eval $DIALOG \ + dialog_inputbox=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -92,9 +95,11 @@ f_dialog_input_password() --cancel-label \"\$msg_cancel\" \ --insecure \ --passwordbox \"\$rmsg\" $rsize \ - 2> $DIALOG_TMPDIR/dialog.inputbox.$$ + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) retval=$? + setvar DIALOG_INPUTBOX_$$ "$dialog_inputbox" _password2=$( f_dialog_inputstr ) # Return if user has either pressed ESC or chosen Cancel/No Modified: head/usr.sbin/bsdconfig/security/kern_securelevel ============================================================================== --- head/usr.sbin/bsdconfig/security/kern_securelevel Thu Sep 20 23:00:01 2012 (r240767) +++ head/usr.sbin/bsdconfig/security/kern_securelevel Thu Sep 20 23:44:13 2012 (r240768) @@ -67,7 +67,8 @@ dialog_menu_main() \"\$hline\" \ $menu_list ) - eval $DIALOG \ + local dialog_menu + dialog_menu=$( eval $DIALOG \ --clear --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -75,7 +76,11 @@ dialog_menu_main() --cancel-label \"\$msg_cancel\" \ --menu \"\$prompt\" $size \ $menu_list \ - 2> "$DIALOG_TMPDIR/dialog.menu.$$" + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) + local retval=$? + setvar DIALOG_MENU_$$ "$dialog_menu" + return $retval } ############################################################ MAIN Modified: head/usr.sbin/bsdconfig/security/security ============================================================================== --- head/usr.sbin/bsdconfig/security/security Thu Sep 20 23:00:01 2012 (r240767) +++ head/usr.sbin/bsdconfig/security/security Thu Sep 20 23:44:13 2012 (r240768) @@ -86,7 +86,8 @@ dialog_menu_main() \"\$hline\" \ $menu_list ) - eval $DIALOG \ + local dialog_menu + dialog_menu=$( eval $DIALOG \ --clear --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -94,7 +95,11 @@ dialog_menu_main() --cancel-label \"\$msg_cancel\" \ --menu \"\$prompt\" $size \ $menu_list \ - 2> "$DIALOG_TMPDIR/dialog.menu.$$" + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) + local retval=$? + setvar DIALOG_MENU_$$ "$dialog_menu" + return $retval } ############################################################ MAIN Modified: head/usr.sbin/bsdconfig/share/dialog.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/dialog.subr Thu Sep 20 23:00:01 2012 (r240767) +++ head/usr.sbin/bsdconfig/share/dialog.subr Thu Sep 20 23:44:13 2012 (r240768) @@ -38,9 +38,11 @@ f_include_lang $BSDCFG_LIBE/include/mess ############################################################ CONFIGURATION # -# Default directory to store dialog(1) temporary files +# Default file descriptor to link to stdout for dialog(1) passthru allowing +# execution of dialog from within a sub-shell (so-long as its standard output +# is explicitly redirected to this file descriptor). # -: ${DIALOG_TMPDIR:="/tmp"} +: ${DIALOG_TERMINAL_PASSTHRU_FD:=3} ############################################################ GLOBALS @@ -1108,12 +1110,8 @@ f_dialog_noyes() # f_dialog_inputstr() { - local tmpfile="$DIALOG_TMPDIR/dialog.inputbox.$$" - - [ -f "$tmpfile" ] || return $FAILURE - # Skip warnings and trim leading/trailing whitespace from user input - awk ' + eval echo \"\$DIALOG_INPUTBOX_$$\" | awk ' BEGIN { found = 0 } { if ( ! found ) @@ -1126,9 +1124,8 @@ f_dialog_inputstr() sub(/[[:space:]]*$/, "") print } - ' "$tmpfile" 2> /dev/null - f_quietly rm -f "$tmpfile" - + ' + setvar DIALOG_INPUTBOX_$$ "" # scrub memory in case data was sensitive return $SUCCESS } @@ -1141,11 +1138,8 @@ f_dialog_inputstr() # f_dialog_menutag() { - local tmpfile="$DIALOG_TMPDIR/dialog.menu.$$" - - [ -f "$tmpfile" ] || return $FAILURE - - awk ' + # Skip warnings + eval echo \"\$DIALOG_MENU_$$\" | awk ' BEGIN { found = 0 } { if ( found ) # ... just spew @@ -1158,9 +1152,8 @@ f_dialog_menutag() found = 1 print } - ' "$tmpfile" 2> /dev/null - f_quietly rm -f "$tmpfile" - + ' + setvar DIALOG_MENU_$$ "" # scrub memory in case data was sensitive return $SUCCESS } @@ -1320,6 +1313,11 @@ f_dialog_init() DIALOG_SELF_INITIALIZE= # + # Clone terminal stdout so we can redirect to it from within sub-shells + # + eval exec $DIALOG_TERMINAL_PASSTHRU_FD\>\&1 + + # # Process stored command-line arguments # SECURE=$( set -- "$ARGV" @@ -1422,22 +1420,4 @@ f_dialog_init() fi } -############################################################ CLEAN-UP FUNCTIONS - -# f_clean_up -# -# Clean-up routines (run when script exits or is killed). -# -f_clean_up() -{ - f_quietly rm -f "$DIALOG_TMPDIR"/dialog.*.$$ -} - -############################################################ MAIN - -# -# Trap signals so we can recover gracefully -# -trap 'f_clean_up' EXIT - fi # ! $_DIALOG_SUBR Modified: head/usr.sbin/bsdconfig/share/mustberoot.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/mustberoot.subr Thu Sep 20 23:00:01 2012 (r240767) +++ head/usr.sbin/bsdconfig/share/mustberoot.subr Thu Sep 20 23:44:13 2012 (r240768) @@ -119,7 +119,8 @@ f_become_root_via_sudo() [ $retval -eq 255 ] && f_die $retval "$password" else - $DIALOG \ + local dialog_inputbox + dialog_inputbox=$( $DIALOG \ --title "$DIALOG_TITLE" \ --backtitle "$DIALOG_BACKTITLE" \ --hline "$hline" \ @@ -127,8 +128,10 @@ f_become_root_via_sudo() --cancel-label "$msg_cancel" \ --insecure \ --passwordbox "$msg" $size \ - 2> "$DIALOG_TMPDIR/dialog.inputbox.$$" + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) retval=$? + setvar DIALOG_INPUTBOX_$$ "$dialog_inputbox" password=$( f_dialog_inputstr ) fi Modified: head/usr.sbin/bsdconfig/startup/misc ============================================================================== --- head/usr.sbin/bsdconfig/startup/misc Thu Sep 20 23:00:01 2012 (r240767) +++ head/usr.sbin/bsdconfig/startup/misc Thu Sep 20 23:44:13 2012 (r240768) @@ -230,7 +230,8 @@ dialog_menu_main() \"\$hline\" \ $menu_list ) - eval $DIALOG \ + local dialog_menu + dialog_menu=$( eval $DIALOG \ --clear --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -238,7 +239,11 @@ dialog_menu_main() --cancel-label \"\$msg_cancel\" \ --menu \"\$prompt\" $size \ $menu_list \ - 2> "$DIALOG_TMPDIR/dialog.menu.$$" + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) + local retval=$? + setvar DIALOG_MENU_$$ "$dialog_menu" + return $retval } # dialog_input_value [ $prompt [ $init ] ] @@ -260,7 +265,8 @@ dialog_input_value() "$_input" \ "$hline" ) - eval $DIALOG \ + local dialog_inputbox + dialog_inputbox=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -268,9 +274,11 @@ dialog_input_value() --cancel-label \"\$msg_cancel\" \ --inputbox \"\$prompt\" $size \ \"\$_input\" \ - 2> $DIALOG_TMPDIR/dialog.inputbox.$$ + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) retval=$? + setvar DIALOG_INPUTBOX_$$ "$dialog_inputbox" _input=$( f_dialog_inputstr ) f_dialog_title_restore Modified: head/usr.sbin/bsdconfig/startup/rcadd ============================================================================== --- head/usr.sbin/bsdconfig/startup/rcadd Thu Sep 20 23:00:01 2012 (r240767) +++ head/usr.sbin/bsdconfig/startup/rcadd Thu Sep 20 23:44:13 2012 (r240768) @@ -72,7 +72,8 @@ dialog_menu_main() \"\$hline\" \ $menu_list ) - eval $DIALOG \ + local dialog_menu + dialog_menu=$( eval $DIALOG \ --clear --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -80,7 +81,11 @@ dialog_menu_main() --cancel-label \"\$msg_cancel\" \ --menu \"\$prompt\" $size \ $menu_list \ - 2> "$DIALOG_TMPDIR/dialog.menu.$$" + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) + local retval=$? + setvar DIALOG_MENU_$$ "$dialog_menu" + return $retval } ############################################################ MAIN Modified: head/usr.sbin/bsdconfig/startup/rcconf ============================================================================== --- head/usr.sbin/bsdconfig/startup/rcconf Thu Sep 20 23:00:01 2012 (r240767) +++ head/usr.sbin/bsdconfig/startup/rcconf Thu Sep 20 23:44:13 2012 (r240768) @@ -168,7 +168,8 @@ dialog_menu_main() \"\$hline\" \ $RCCONF_MENU_LIST ) - eval $DIALOG \ + local dialog_menu + dialog_menu=$( eval $DIALOG \ --clear --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -179,7 +180,11 @@ dialog_menu_main() ${SHOW_DESC:+--item-help} \ --menu \"\$prompt\" $size \ $RCCONF_MENU_LIST \ - 2> "$DIALOG_TMPDIR/dialog.menu.$$" + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) + local retval=$? + setvar DIALOG_MENU_$$ "$dialog_menu" + return $retval } ############################################################ MAIN Modified: head/usr.sbin/bsdconfig/startup/rcdelete ============================================================================== --- head/usr.sbin/bsdconfig/startup/rcdelete Thu Sep 20 23:00:01 2012 (r240767) +++ head/usr.sbin/bsdconfig/startup/rcdelete Thu Sep 20 23:44:13 2012 (r240768) @@ -175,7 +175,8 @@ dialog_menu_main() \"\$hline\" \ $RCCONF_MENU_LIST ) - eval $DIALOG \ + local dialog_menu + dialog_menu=$( eval $DIALOG \ --clear --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -186,7 +187,11 @@ dialog_menu_main() ${SHOW_DESC:+--item-help} \ --menu \"\$prompt\" $size \ $RCCONF_MENU_LIST \ - 2> "$DIALOG_TMPDIR/dialog.menu.$$" + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) + local retval=$? + setvar DIALOG_MENU_$$ "$dialog_menu" + return $retval } # dialog_menu_delete $var1 [$var2 ...] @@ -240,7 +245,8 @@ dialog_menu_delete() local defaultno="defaultno" [ "$USE_XDIALOG" ] && defaultno="default-no" - eval $DIALOG \ + local dialog_menu + dialog_menu=$( eval $DIALOG \ --clear --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -249,7 +255,11 @@ dialog_menu_delete() --cancel-label \"\$msg_cancel\" \ --menu \"\$prompt\" $size \ $menu_list \ - 2> "$DIALOG_TMPDIR/dialog.menu.$$" + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) + local retval=$? + setvar DIALOG_MENU_$$ "$dialog_menu" + return $retval } ############################################################ MAIN Modified: head/usr.sbin/bsdconfig/startup/rcvar ============================================================================== --- head/usr.sbin/bsdconfig/startup/rcvar Thu Sep 20 23:00:01 2012 (r240767) +++ head/usr.sbin/bsdconfig/startup/rcvar Thu Sep 20 23:44:13 2012 (r240768) @@ -132,7 +132,8 @@ dialog_menu_main() \"\$hline\" \ $RCVAR_MENU_LIST ) - eval $DIALOG \ + local dialog_menu + dialog_menu=$( eval $DIALOG \ --clear --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -141,7 +142,11 @@ dialog_menu_main() ${SHOW_DESC:+--item-help} \ --menu \"\$prompt\" $size \ $RCVAR_MENU_LIST \ - 2> "$DIALOG_TMPDIR/dialog.menu.$$" + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) + local retval=$? + setvar DIALOG_MENU_$$ "$dialog_menu" + return $retval } ############################################################ MAIN Modified: head/usr.sbin/bsdconfig/startup/share/rcconf.subr ============================================================================== --- head/usr.sbin/bsdconfig/startup/share/rcconf.subr Thu Sep 20 23:00:01 2012 (r240767) +++ head/usr.sbin/bsdconfig/startup/share/rcconf.subr Thu Sep 20 23:44:13 2012 (r240768) @@ -282,7 +282,8 @@ f_dialog_input_view_details() f_dialog_title "$msg_choose_view_details" - eval $DIALOG \ + local dialog_menu + dialog_menu=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -290,9 +291,11 @@ f_dialog_input_view_details() --cancel-label \"\$msg_cancel\" \ --menu \"\$prompt\" $size \ $menu_list \ - 2> "$DIALOG_TMPDIR/dialog.menu.$$" + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Sep 21 00:36:35 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD75E106564A; Fri, 21 Sep 2012 00:36:35 +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 9772E8FC0C; Fri, 21 Sep 2012 00:36:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8L0aZVg022761; Fri, 21 Sep 2012 00:36:35 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8L0aZpd022759; Fri, 21 Sep 2012 00:36:35 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201209210036.q8L0aZpd022759@svn.freebsd.org> From: Matt Jacob Date: Fri, 21 Sep 2012 00:36:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240769 - stable/9/sys/dev/isp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Sep 2012 00:36:35 -0000 Author: mjacob Date: Fri Sep 21 00:36:35 2012 New Revision: 240769 URL: http://svn.freebsd.org/changeset/base/240769 Log: MFC of 240219 - remove useless test. Modified: stable/9/sys/dev/isp/isp_pci.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/isp/ (props changed) Modified: stable/9/sys/dev/isp/isp_pci.c ============================================================================== --- stable/9/sys/dev/isp/isp_pci.c Thu Sep 20 23:44:13 2012 (r240768) +++ stable/9/sys/dev/isp/isp_pci.c Fri Sep 21 00:36:35 2012 (r240769) @@ -1268,8 +1268,7 @@ isp_pci_rd_reg_1080(ispsoftc_t *isp, int { uint32_t rv, oc = 0; - if ((regoff & _BLK_REG_MASK) == SXP_BLOCK || - (regoff & _BLK_REG_MASK) == (SXP_BLOCK|SXP_BANK1_SELECT)) { + if ((regoff & _BLK_REG_MASK) == SXP_BLOCK) { uint32_t tc; /* * We will assume that someone has paused the RISC processor. @@ -1301,8 +1300,7 @@ isp_pci_wr_reg_1080(ispsoftc_t *isp, int { int oc = 0; - if ((regoff & _BLK_REG_MASK) == SXP_BLOCK || - (regoff & _BLK_REG_MASK) == (SXP_BLOCK|SXP_BANK1_SELECT)) { + if ((regoff & _BLK_REG_MASK) == SXP_BLOCK) { uint32_t tc; /* * We will assume that someone has paused the RISC processor. From owner-svn-src-all@FreeBSD.ORG Fri Sep 21 01:36:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 14F9E106564A; Fri, 21 Sep 2012 01:36:21 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F139E8FC0A; Fri, 21 Sep 2012 01:36:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8L1aKHU032014; Fri, 21 Sep 2012 01:36:20 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8L1aKiF031991; Fri, 21 Sep 2012 01:36:20 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201209210136.q8L1aKiF031991@svn.freebsd.org> From: Devin Teske Date: Fri, 21 Sep 2012 01:36:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240770 - in head/usr.sbin/bsdconfig: . console mouse networking networking/share share startup startup/share timezone/share usermgmt/share X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Sep 2012 01:36:21 -0000 Author: dteske Date: Fri Sep 21 01:36:20 2012 New Revision: 240770 URL: http://svn.freebsd.org/changeset/base/240770 Log: Replace redirections to /dev/null with "close file-descriptor" syntax (>&-). Reviewed by: adrian (co-mentor) Approved by: adrian (co-mentor) Modified: head/usr.sbin/bsdconfig/bsdconfig head/usr.sbin/bsdconfig/console/ttys head/usr.sbin/bsdconfig/mouse/enable head/usr.sbin/bsdconfig/networking/devices head/usr.sbin/bsdconfig/networking/share/device.subr head/usr.sbin/bsdconfig/networking/share/ipaddr.subr head/usr.sbin/bsdconfig/networking/share/media.subr head/usr.sbin/bsdconfig/networking/share/netmask.subr head/usr.sbin/bsdconfig/networking/share/resolv.subr head/usr.sbin/bsdconfig/networking/share/routing.subr head/usr.sbin/bsdconfig/share/common.subr head/usr.sbin/bsdconfig/share/dialog.subr head/usr.sbin/bsdconfig/share/mustberoot.subr head/usr.sbin/bsdconfig/share/strings.subr head/usr.sbin/bsdconfig/share/sysrc.subr head/usr.sbin/bsdconfig/startup/rcadd head/usr.sbin/bsdconfig/startup/rcconf head/usr.sbin/bsdconfig/startup/rcdelete head/usr.sbin/bsdconfig/startup/rcvar head/usr.sbin/bsdconfig/startup/share/rcconf.subr head/usr.sbin/bsdconfig/timezone/share/zones.subr head/usr.sbin/bsdconfig/usermgmt/share/user_input.subr Modified: head/usr.sbin/bsdconfig/bsdconfig ============================================================================== --- head/usr.sbin/bsdconfig/bsdconfig Fri Sep 21 00:36:35 2012 (r240769) +++ head/usr.sbin/bsdconfig/bsdconfig Fri Sep 21 01:36:20 2012 (r240770) @@ -73,7 +73,7 @@ usage() # Determine the maximum width of terminal/console # local max_size max_width - max_size=$( stty size 2> /dev/null ) + max_size=$( stty size 2>&- ) : ${max_size:="24 80"} max_width="${max_size#*[$IFS]}" f_dprintf "max_width=[$max_width]" @@ -242,8 +242,8 @@ if [ "$1" ]; then # lang="${LANG:-$LC_ALL}" if [ "$lang" ]; then - sel=$( grep "^menu_selection=\"$1|" */INDEX.$lang \ - 2> /dev/null | tail -1 ) + sel=$( grep "^menu_selection=\"$1|" */INDEX.$lang 2>&- | + tail -1 ) # Fall-back to non-i18n sources if nothing was found [ "$sel" ] || Modified: head/usr.sbin/bsdconfig/console/ttys ============================================================================== --- head/usr.sbin/bsdconfig/console/ttys Fri Sep 21 00:36:35 2012 (r240769) +++ head/usr.sbin/bsdconfig/console/ttys Fri Sep 21 01:36:20 2012 (r240770) @@ -117,8 +117,8 @@ ttys_set_type() # with 0600 permissions -- change the permissions and ownership to # match ttys(5) before we write it out and mv(1) it into place). # - local mode="$( stat -f '%#Lp' "$ETC_TTYS" 2> /dev/null )" - local owner="$( stat -f '%u:%g' "$ETC_TTYS" 2> /dev/null )" + local mode="$( stat -f '%#Lp' "$ETC_TTYS" 2>&- )" + local owner="$( stat -f '%u:%g' "$ETC_TTYS" 2>&- )" f_quietly chmod "${mode:-0644}" "$tmpfile" f_quietly chown "${owner:-root:wheel}" "$tmpfile" Modified: head/usr.sbin/bsdconfig/mouse/enable ============================================================================== --- head/usr.sbin/bsdconfig/mouse/enable Fri Sep 21 00:36:35 2012 (r240769) +++ head/usr.sbin/bsdconfig/mouse/enable Fri Sep 21 01:36:20 2012 (r240770) @@ -86,7 +86,7 @@ flags=$( f_sysrc_get moused_flags ) # f_dialog_info "$msg_trying_to_start_the_mouse_daemon" [ -r "$MOUSED_PIDFILE" ] && - f_quietly kill "$( cat "$MOUSED_PIDFILE" 2> /dev/null )" + f_quietly kill "$( cat "$MOUSED_PIDFILE" 2>&- )" f_quietly vidcontrol -m on f_quietly moused -t "$type" -p "$port" $flags Modified: head/usr.sbin/bsdconfig/networking/devices ============================================================================== --- head/usr.sbin/bsdconfig/networking/devices Fri Sep 21 00:36:35 2012 (r240769) +++ head/usr.sbin/bsdconfig/networking/devices Fri Sep 21 01:36:20 2012 (r240770) @@ -112,7 +112,7 @@ while :; do # configuration # dhcp= - eval "$( exec 2> /dev/null + eval "$( exec 2>&- set -- $_ifconfig while [ $# -gt 0 ]; do case "$1" in Modified: head/usr.sbin/bsdconfig/networking/share/device.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/device.subr Fri Sep 21 00:36:35 2012 (r240769) +++ head/usr.sbin/bsdconfig/networking/share/device.subr Fri Sep 21 01:36:20 2012 (r240770) @@ -72,7 +72,7 @@ f_device_desc() devname="${device%%$d*}" devunit="${device#$devname}" devunit="${devunit%%[a-zA-Z_]*}" - sysctl -n "dev.$devname.$devunit.%desc" 2> /dev/null && + sysctl -n "dev.$devname.$devunit.%desc" 2>&- && return $SUCCESS fi Modified: head/usr.sbin/bsdconfig/networking/share/ipaddr.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/ipaddr.subr Fri Sep 21 00:36:35 2012 (r240769) +++ head/usr.sbin/bsdconfig/networking/share/ipaddr.subr Fri Sep 21 01:36:20 2012 (r240770) @@ -47,7 +47,7 @@ f_include_lang $BSDCFG_LIBE/$APP_DIR/inc f_ifconfig_inet() { local interface="$1" - ifconfig "$interface" 2> /dev/null | awk \ + ifconfig "$interface" 2>&- | awk \ ' BEGIN { found = 0 } ( $1 == "inet" ) \ Modified: head/usr.sbin/bsdconfig/networking/share/media.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/media.subr Fri Sep 21 00:36:35 2012 (r240769) +++ head/usr.sbin/bsdconfig/networking/share/media.subr Fri Sep 21 01:36:20 2012 (r240770) @@ -83,7 +83,7 @@ f_ifconfig_options() f_ifconfig_media() { local interface="$1" - ifconfig -m "$interface" 2> /dev/null | awk \ + ifconfig -m "$interface" 2>&- | awk \ ' BEGIN { media_found = 0 } { Modified: head/usr.sbin/bsdconfig/networking/share/netmask.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/netmask.subr Fri Sep 21 00:36:35 2012 (r240769) +++ head/usr.sbin/bsdconfig/networking/share/netmask.subr Fri Sep 21 01:36:20 2012 (r240770) @@ -46,7 +46,7 @@ f_include_lang $BSDCFG_LIBE/$APP_DIR/inc f_ifconfig_netmask() { local interface="$1" octets - octets=$( ifconfig "$interface" 2> /dev/null | awk \ + octets=$( ifconfig "$interface" 2>&- | awk \ ' BEGIN { found = 0 } ( $1 == "inet" ) \ Modified: head/usr.sbin/bsdconfig/networking/share/resolv.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/resolv.subr Fri Sep 21 00:36:35 2012 (r240769) +++ head/usr.sbin/bsdconfig/networking/share/resolv.subr Fri Sep 21 01:36:20 2012 (r240770) @@ -65,7 +65,7 @@ f_include_lang $BSDCFG_LIBE/$APP_DIR/inc # f_resolv_conf_domain() { - tail -r "$RESOLV_CONF" 2> /dev/null | awk \ + tail -r "$RESOLV_CONF" 2>&- | awk \ ' BEGIN { found = 0 } ( tolower($1) == "domain" ) \ @@ -84,7 +84,7 @@ f_resolv_conf_domain() # f_resolv_conf_search() { - tail -r "$RESOLV_CONF" 2> /dev/null | awk \ + tail -r "$RESOLV_CONF" 2>&- | awk \ ' BEGIN { found = 0 } { @@ -118,7 +118,7 @@ f_resolv_conf_nameservers() } END { exit ! found } ' \ - "$RESOLV_CONF" 2> /dev/null + "$RESOLV_CONF" 2>&- } # f_dialog_resolv_conf_update $hostname @@ -225,8 +225,8 @@ f_dialog_resolv_conf_update() # permissions and ownership to match resolv.conf(5) before # we write it out and mv(1) it into place). # - local mode="$( stat -f '%#Lp' "$RESOLV_CONF" 2> /dev/null )" - local owner="$( stat -f '%u:%g' "$RESOLV_CONF" 2> /dev/null )" + local mode="$( stat -f '%#Lp' "$RESOLV_CONF" 2>&- )" + local owner="$( stat -f '%u:%g' "$RESOLV_CONF" 2>&- )" f_quietly chmod "${mode:-0644}" "$tmpfile" f_quietly chown "${owner:-root:wheel}" "$tmpfile" @@ -246,7 +246,7 @@ f_dialog_resolv_conf_update() # local domain="${hostname#*.}" new_contents [ "$domain" = "$hostname" ] && domain= - new_contents=$( tail -r "$RESOLV_CONF" 2> /dev/null ) + new_contents=$( tail -r "$RESOLV_CONF" 2>&- ) new_contents=$( echo "$new_contents" | awk \ -v domain="$domain" \ -v search_all="${RESOLVER_SEARCH_DOMAINS_ALL:-1}" \ @@ -397,8 +397,8 @@ f_dialog_input_nameserver() # Quietly fixup permissions and ownership # local mode owner - mode=$( stat -f '%#Lp' "$RESOLV_CONF" 2> /dev/null ) - owner=$( stat -f '%u:%g' "$RESOLV_CONF" 2> /dev/null ) + mode=$( stat -f '%#Lp' "$RESOLV_CONF" 2>&- ) + owner=$( stat -f '%u:%g' "$RESOLV_CONF" 2>&- ) f_quietly chmod "${mode:-0644}" "$tmpfile" f_quietly chown "${owner:-root:wheel}" "$tmpfile" Modified: head/usr.sbin/bsdconfig/networking/share/routing.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/routing.subr Fri Sep 21 00:36:35 2012 (r240769) +++ head/usr.sbin/bsdconfig/networking/share/routing.subr Fri Sep 21 01:36:20 2012 (r240770) @@ -46,7 +46,7 @@ f_include_lang $BSDCFG_LIBE/$APP_DIR/inc # f_route_get_default() { - route -n get default 2> /dev/null | awk \ + route -n get default 2>&- | awk \ ' BEGIN { found = 0 } ( $1 == "gateway:" ) \ Modified: head/usr.sbin/bsdconfig/share/common.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/common.subr Fri Sep 21 00:36:35 2012 (r240769) +++ head/usr.sbin/bsdconfig/share/common.subr Fri Sep 21 01:36:20 2012 (r240770) @@ -72,7 +72,7 @@ f_err() # f_quietly() { - "$@" > /dev/null 2>&1 + "$@" >&- 2>&- } # f_have $anything ... Modified: head/usr.sbin/bsdconfig/share/dialog.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/dialog.subr Fri Sep 21 00:36:35 2012 (r240769) +++ head/usr.sbin/bsdconfig/share/dialog.subr Fri Sep 21 01:36:20 2012 (r240770) @@ -1321,7 +1321,7 @@ f_dialog_init() # Process stored command-line arguments # SECURE=$( set -- "$ARGV" - while getopts S flag > /dev/null; do + while getopts S flag >&-; do case "$flag" in S) echo 1;; \?) continue;; @@ -1329,7 +1329,7 @@ f_dialog_init() done ) USE_XDIALOG=$( set -- "$ARGV" - while getopts SX flag > /dev/null; do + while getopts SX flag >&-; do case "$flag" in S|X) echo 1;; \?) continue;; @@ -1372,7 +1372,7 @@ f_dialog_init() eval xauth -if \~$SUDO_USER/.Xauthority extract - \ \"\$HOSTNAME/unix:\$displaynum\" \ \"\$HOSTNAME:\$displaynum\" | sudo sh -c 'xauth -ivf \ - ~root/.Xauthority merge - > /dev/null 2>&1' + ~root/.Xauthority merge - >&- 2>&-' fi # Modified: head/usr.sbin/bsdconfig/share/mustberoot.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/mustberoot.subr Fri Sep 21 00:36:35 2012 (r240769) +++ head/usr.sbin/bsdconfig/share/mustberoot.subr Fri Sep 21 01:36:20 2012 (r240770) @@ -85,7 +85,7 @@ f_become_root_via_sudo() # # Check sudo(8) access before prompting for password. # - :| sudo -S -v 2> /dev/null + :| sudo -S -v 2>&- if [ $? -ne $SUCCESS ]; then # # sudo(8) access denied. Prompt for their password. @@ -112,7 +112,7 @@ f_become_root_via_sudo() --ok-label "$msg_ok" \ --cancel-label "$msg_cancel" \ --password --inputbox "$msg" $size \ - 2>&1 > /dev/null ) + 2>&1 >&- ) retval=$? # Catch X11-related errors @@ -141,7 +141,7 @@ f_become_root_via_sudo() # # Validate sudo(8) credentials # - sudo -S -v 2> /dev/null <<-EOF + sudo -S -v 2>&- <<-EOF $password EOF retval=$? @@ -186,7 +186,7 @@ f_become_root_via_sudo() displaynum="${DISPLAY#*:}" xauth -f ~/.Xauthority extract - $HOSTNAME/unix:$displaynum \ $HOSTNAME:$displaynum | sudo sh -c 'xauth -ivf \ - ~root/.Xauthority merge - > /dev/null 2>&1' + ~root/.Xauthority merge - >&- 2>&-' fi # Re-execute ourselves with sudo(8) @@ -254,7 +254,7 @@ f_authenticate_some_user() $height $width \ "$field_username" "" \ "$field_password" "" \ - 2>&1 > /dev/null ) + 2>&1 >&- ) retval=$? # Catch X11-related errors @@ -302,7 +302,7 @@ f_authenticate_some_user() su -m "$user" <<-EOF sh < /dev/null <&- < /dev/null 2>&1 + ( : $((0/$arg)) ) >&- 2>&- } fi # ! $_STRINGS_SUBR Modified: head/usr.sbin/bsdconfig/share/sysrc.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/sysrc.subr Fri Sep 21 00:36:35 2012 (r240769) +++ head/usr.sbin/bsdconfig/share/sysrc.subr Fri Sep 21 01:36:20 2012 (r240770) @@ -134,7 +134,7 @@ f_sysrc_get() # f_clean_env --except RC_CONFS RC_DEFAULTS SUCCESS - . "$RC_DEFAULTS" > /dev/null 2>&1 + . "$RC_DEFAULTS" >&- 2>&- unset RC_DEFAULTS # no longer needed @@ -153,7 +153,7 @@ f_sysrc_get() # If RC_CONFS is defined, set $rc_conf_files to an explicit # value, modifying the default behavior of source_rc_confs(). # - ( : ${RC_CONFS?} ) > /dev/null 2>&1 + ( : ${RC_CONFS?} ) >&- 2>&- if [ $? -eq ${SUCCESS:-0} ]; then rc_conf_files="$RC_CONFS" _rc_confs_set=1 @@ -162,7 +162,7 @@ f_sysrc_get() unset SUCCESS # no longer needed - source_rc_confs > /dev/null 2>&1 + source_rc_confs >&- 2>&- # # If the query was for `rc_conf_files' AND after calling @@ -190,7 +190,7 @@ f_sysrc_get() # such as "${varname?}" and "${varname:?}" (see "Parameter # Expansion" in sh(1) for more information). # - eval echo '"${'"$1"'}"' 2> /dev/null + eval echo '"${'"$1"'}"' 2>&- ) } @@ -221,7 +221,7 @@ f_sysrc_get_default() # f_clean_env --except RC_DEFAULTS - . "$RC_DEFAULTS" > /dev/null 2>&1 + . "$RC_DEFAULTS" >&- 2>&- unset RC_DEFAULTS # no longer needed @@ -232,7 +232,7 @@ f_sysrc_get_default() # such as "${varname?}" and "${varname:?}" (see "Parameter # Expansion" in sh(1) for more information). # - eval echo '"${'"$1"'}"' 2> /dev/null + eval echo '"${'"$1"'}"' 2>&- ) } @@ -477,7 +477,7 @@ f_sysrc_set() # permissions from the temporary file). # local mode - mode=$( stat -f '%#Lp' "$file" 2> /dev/null ) + mode=$( stat -f '%#Lp' "$file" 2>&- ) f_quietly chmod "${mode:-0644}" "$tmpfile" # @@ -486,14 +486,14 @@ f_sysrc_set() # permissions (so we throw stderr into the bit-bucket). # local owner - owner=$( stat -f '%u:%g' "$file" 2> /dev/null ) + owner=$( stat -f '%u:%g' "$file" 2>&- ) f_quietly chown "${owner:-root:wheel}" "$tmpfile" # # Operate on the matching file, replacing only the last occurrence. # local new_contents retval - new_contents=$( tail -r $file 2> /dev/null ) + new_contents=$( tail -r $file 2>&- ) new_contents=$( echo "$new_contents" | awk -v varname="$varname" \ -v new_value="$new_value" "$f_sysrc_set_awk" ) retval=$? @@ -572,8 +572,8 @@ f_sysrc_delete() # permissions) to instead match the destination file. # local mode owner - mode=$( stat -f '%#Lp' "$file" 2> /dev/null ) - owner=$( stat -f '%u:%g' "$file" 2> /dev/null ) + mode=$( stat -f '%#Lp' "$file" 2>&- ) + owner=$( stat -f '%u:%g' "$file" 2>&- ) f_quietly chmod "${mode:-0644}" "$tmpfile" f_quietly chown "${owner:-root:wheel}" "$tmpfile" Modified: head/usr.sbin/bsdconfig/startup/rcadd ============================================================================== --- head/usr.sbin/bsdconfig/startup/rcadd Fri Sep 21 00:36:35 2012 (r240769) +++ head/usr.sbin/bsdconfig/startup/rcadd Fri Sep 21 01:36:20 2012 (r240770) @@ -46,7 +46,7 @@ ipgm=$( f_index_menu_selection $BSDCFG_L # Options # # Inherit SHOW_DESC value if set, otherwise default to 1 -( : ${SHOW_DESC?} ) > /dev/null 2>&1 || SHOW_DESC=1 +( : ${SHOW_DESC?} ) >&- 2>&- || SHOW_DESC=1 ############################################################ FUNCTIONS Modified: head/usr.sbin/bsdconfig/startup/rcconf ============================================================================== --- head/usr.sbin/bsdconfig/startup/rcconf Fri Sep 21 00:36:35 2012 (r240769) +++ head/usr.sbin/bsdconfig/startup/rcconf Fri Sep 21 01:36:20 2012 (r240770) @@ -54,7 +54,7 @@ RCCONF_MENU_LIST= # Options # # Inherit SHOW_DESC value if set, otherwise default to 1 -( : ${SHOW_DESC?} ) > /dev/null 2>&1 || SHOW_DESC=1 +( : ${SHOW_DESC?} ) >&- 2>&- || SHOW_DESC=1 # Selectively inherit SHOW_* value (in order of preference) if [ "$SHOW_DEFAULT_VALUE" ]; then SHOW_DEFAULT_VALUE=1 @@ -110,8 +110,8 @@ dialog_menu_main() f_dialog_info "$msg_creating_menu_list" RCCONF_MENU_LIST="$RCCONF_MENU_LIST $( - . "$RC_DEFAULTS" > /dev/null - source_rc_confs > /dev/null + . "$RC_DEFAULTS" >&- + source_rc_confs >&- var_list=$( f_startup_rcconf_list ) for var in $var_list; do eval export $var Modified: head/usr.sbin/bsdconfig/startup/rcdelete ============================================================================== --- head/usr.sbin/bsdconfig/startup/rcdelete Fri Sep 21 00:36:35 2012 (r240769) +++ head/usr.sbin/bsdconfig/startup/rcdelete Fri Sep 21 01:36:20 2012 (r240770) @@ -54,7 +54,7 @@ RCCONF_MENU_LIST= # Options # # Inherit SHOW_DESC value if set, otherwise default to 1 -( : ${SHOW_DESC?} ) > /dev/null 2>&1 || SHOW_DESC=1 +( : ${SHOW_DESC?} ) >&- 2>&- || SHOW_DESC=1 # Selectively inherit SHOW_* value (in order of preference) if [ "$SHOW_DEFAULT_VALUE" ]; then SHOW_DEFAULT_VALUE=1 @@ -112,8 +112,8 @@ dialog_menu_main() f_dialog_info "$msg_creating_menu_list" RCCONF_MENU_LIST="$RCCONF_MENU_LIST $( - . "$RC_DEFAULTS" > /dev/null - source_rc_confs > /dev/null + . "$RC_DEFAULTS" >&- + source_rc_confs >&- var_list=$( f_startup_rcconf_list ) for var in $var_list; do eval export $var @@ -348,7 +348,7 @@ while :; do var="${mtag# }" # Toggle the state-variable and loop back to menu - if ( eval : \${_${var}_delete?} ) > /dev/null 2>&1; then + if ( eval : \${_${var}_delete?} ) >&- 2>&-; then unset _${var}_delete else setvar _${var}_delete 1 Modified: head/usr.sbin/bsdconfig/startup/rcvar ============================================================================== --- head/usr.sbin/bsdconfig/startup/rcvar Fri Sep 21 00:36:35 2012 (r240769) +++ head/usr.sbin/bsdconfig/startup/rcvar Fri Sep 21 01:36:20 2012 (r240770) @@ -54,7 +54,7 @@ RCVAR_MENU_LIST= # Options # # Inherit SHOW_DESC value if set, otherwise default to 1 -( ${SHOW_DESC?} ) > /dev/null 2>&1 || SHOW_DESC=1 +( ${SHOW_DESC?} ) >&- 2>&- || SHOW_DESC=1 ############################################################ FUNCTIONS @@ -82,8 +82,8 @@ dialog_menu_main() fi RCVAR_MENU_LIST="$RCVAR_MENU_LIST $( - . "$RC_DEFAULTS" > /dev/null - source_rc_confs > /dev/null + . "$RC_DEFAULTS" >&- + source_rc_confs >&- for rcvar in $( echo "$RCVAR_MAP" | awk '{print $1}' ); do eval export $rcvar done Modified: head/usr.sbin/bsdconfig/startup/share/rcconf.subr ============================================================================== --- head/usr.sbin/bsdconfig/startup/share/rcconf.subr Fri Sep 21 00:36:35 2012 (r240769) +++ head/usr.sbin/bsdconfig/startup/share/rcconf.subr Fri Sep 21 01:36:20 2012 (r240770) @@ -63,9 +63,9 @@ STARTUP_RCCONF_MAP_CACHEFILE="/var/run/b f_startup_rcconf_list() { ( # Operate within a sub-shell to protect the parent environment - . "$RC_DEFAULTS" > /dev/null + . "$RC_DEFAULTS" >&- f_clean_env --except PATH STARTUP_RCCONF_REGEX rc_conf_files - source_rc_confs > /dev/null + source_rc_confs >&- export _rc_conf_files_file="$( f_sysrc_find rc_conf_files )" export RC_DEFAULTS set | awk -F= " Modified: head/usr.sbin/bsdconfig/timezone/share/zones.subr ============================================================================== --- head/usr.sbin/bsdconfig/timezone/share/zones.subr Fri Sep 21 00:36:35 2012 (r240769) +++ head/usr.sbin/bsdconfig/timezone/share/zones.subr Fri Sep 21 01:36:20 2012 (r240770) @@ -610,7 +610,7 @@ f_install_zoneinfo() # Save knowledge for later if [ "$REALLYDOIT" -a $rv -eq $SUCCESS ]; then - if : 2> /dev/null > "$_PATH_DB"; then + if : 2>&- > "$_PATH_DB"; then cat <<-EOF > "$_PATH_DB" $zoneinfo EOF Modified: head/usr.sbin/bsdconfig/usermgmt/share/user_input.subr ============================================================================== --- head/usr.sbin/bsdconfig/usermgmt/share/user_input.subr Fri Sep 21 00:36:35 2012 (r240769) +++ head/usr.sbin/bsdconfig/usermgmt/share/user_input.subr Fri Sep 21 01:36:20 2012 (r240770) @@ -627,7 +627,7 @@ f_dialog_input_change() local secs="$_input" { f_isinteger "$secs" && [ $secs -gt 0 ]; } || secs= _input_date=$( date -j -f "%s" -- "$secs" \ - "+%d %m %Y" 2> /dev/null ) + "+%d %m %Y" 2>&- ) calendar_size=$( f_dialog_calendar_size \ "$DIALOG_TITLE" \ "$DIALOG_BACKTITLE" \ @@ -654,7 +654,7 @@ f_dialog_input_change() _input_time= [ "$secs" ] && _input_time=$( date -j \ - -f %s -- "$_input" "+%H %M %S" 2> /dev/null ) + -f %s -- "$_input" "+%H %M %S" 2>&- ) timebox_size=$( f_dialog_timebox_size \ "$DIALOG_TITLE" \ "$DIALOG_BACKTITLE" \ @@ -682,7 +682,7 @@ f_dialog_input_change() _input=$( date \ -j -f "%d/%m/%Y %T" \ -- "$ret_date $ret_time" \ - +%s 2> /dev/null ) + +%s 2>&- ) f_dprintf "_input=[$_input]" break ;; @@ -852,7 +852,7 @@ f_dialog_input_expire() local secs="$_input" { f_isinteger "$secs" && [ $secs -gt 0 ]; } || secs= _input_date=$( date -j -f "%s" -- "$secs" \ - "+%d %m %Y" 2> /dev/null ) + "+%d %m %Y" 2>&- ) calendar_size=$( f_dialog_calendar_size \ "$DIALOG_TITLE" \ "$DIALOG_BACKTITLE" \ @@ -879,7 +879,7 @@ f_dialog_input_expire() _input_time= [ "$secs" ] && _input_time=$( date -j \ - -f %s -- "$_input" "+%H %M %S" 2> /dev/null ) + -f %s -- "$_input" "+%H %M %S" 2>&- ) timebox_size=$( f_dialog_timebox_size \ "$DIALOG_TITLE" \ "$DIALOG_BACKTITLE" \ @@ -906,7 +906,7 @@ f_dialog_input_expire() _input=$( date \ -j -f "%d/%m/%Y %T" \ -- "$ret_date $ret_time" \ - +%s 2> /dev/null ) + +%s 2>&- ) f_dprintf "_input=[$_input]" break ;; From owner-svn-src-all@FreeBSD.ORG Fri Sep 21 05:30:24 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8D2F11065670; Fri, 21 Sep 2012 05:30:24 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id 1EA148FC12; Fri, 21 Sep 2012 05:30:24 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id 85F808CA; Fri, 21 Sep 2012 07:29:27 +0200 (CEST) Date: Fri, 21 Sep 2012 07:30:43 +0200 From: Pawel Jakub Dawidek To: Baptiste Daroussin Message-ID: <20120921053043.GE1407@garage.freebsd.pl> References: <201209191628.q8JGSckQ025683@svn.freebsd.org> <20120920211701.GD1407@garage.freebsd.pl> <20120920213843.GQ26107@ithaqua.etoilebsd.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="XuV1QlJbYrcVoo+x" Content-Disposition: inline In-Reply-To: <20120920213843.GQ26107@ithaqua.etoilebsd.net> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r240698 - head/cddl/contrib/opensolaris/cmd/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Sep 2012 05:30:24 -0000 --XuV1QlJbYrcVoo+x Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Sep 20, 2012 at 11:38:43PM +0200, Baptiste Daroussin wrote: > On Thu, Sep 20, 2012 at 11:17:01PM +0200, Pawel Jakub Dawidek wrote: > > On Wed, Sep 19, 2012 at 04:28:38PM +0000, Baptiste Daroussin wrote: > > > Author: bapt > > > Date: Wed Sep 19 16:28:38 2012 > > > New Revision: 240698 > > > URL: http://svn.freebsd.org/changeset/base/240698 > > >=20 > > > Log: > > > Update usage to show the possiblity to use jail name > > > =20 > > > Reported by: bdrewery > > > MFC after: 1 month > > >=20 > > > Modified: > > > head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c > > >=20 > > > Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c > > > =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 > > > --- head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Wed Sep 19 16:21= :23 2012 (r240697) > > > +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Wed Sep 19 16:28= :38 2012 (r240698) > > > @@ -240,9 +240,9 @@ get_usage(zfs_help_t idx) > > > return (gettext("\tupgrade [-v]\n" > > > "\tupgrade [-r] [-V version] <-a | filesystem ...>\n")); > > > case HELP_JAIL: > > > - return (gettext("\tjail \n")); > > > + return (gettext("\tjail \n")); > >=20 > > Please keep the style consistent. As you can see two lines above there > > are spaces around |. > >=20 >=20 > Sure but both syntax are present in the usage: in > fact the only one with space around | is the line above you are showing, = all the > rest of the usage is without space, That is why I did it without spaces. >=20 > If you tell me it is better with spaces, I'll add space. It is probably better to leave it as-is then, I only looked at the diff context. Sorry for the noise. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --XuV1QlJbYrcVoo+x Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlBb+4IACgkQForvXbEpPzQEMgCg1tY+3lZ1bJW3Pkad7xY8T6y8 qmEAoPPfoDOkRKwX+nKLdaTGPeUc0Tty =4aL0 -----END PGP SIGNATURE----- --XuV1QlJbYrcVoo+x-- From owner-svn-src-all@FreeBSD.ORG Fri Sep 21 10:31:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B91A106566B; Fri, 21 Sep 2012 10:31:20 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 66CDC8FC1C; Fri, 21 Sep 2012 10:31:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8LAVKJ8014605; Fri, 21 Sep 2012 10:31:20 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8LAVKVC014601; Fri, 21 Sep 2012 10:31:20 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201209211031.q8LAVKVC014601@svn.freebsd.org> From: Dimitry Andric Date: Fri, 21 Sep 2012 10:31:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240773 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Sep 2012 10:31:20 -0000 Author: dim Date: Fri Sep 21 10:31:19 2012 New Revision: 240773 URL: http://svn.freebsd.org/changeset/base/240773 Log: After r205013, amd64 and i386 CPU family and model IDs were printed out in hexadecimal, but without any 0x prefix, which can be very misleading. MFC after: 3 days Modified: head/sys/amd64/amd64/identcpu.c head/sys/i386/i386/identcpu.c Modified: head/sys/amd64/amd64/identcpu.c ============================================================================== --- head/sys/amd64/amd64/identcpu.c Fri Sep 21 03:09:23 2012 (r240772) +++ head/sys/amd64/amd64/identcpu.c Fri Sep 21 10:31:19 2012 (r240773) @@ -213,8 +213,8 @@ printcpuinfo(void) if (cpu_vendor_id == CPU_VENDOR_INTEL || cpu_vendor_id == CPU_VENDOR_AMD || cpu_vendor_id == CPU_VENDOR_CENTAUR) { - printf(" Family = %x", CPUID_TO_FAMILY(cpu_id)); - printf(" Model = %x", CPUID_TO_MODEL(cpu_id)); + printf(" Family = 0x%x", CPUID_TO_FAMILY(cpu_id)); + printf(" Model = 0x%x", CPUID_TO_MODEL(cpu_id)); printf(" Stepping = %u", cpu_id & CPUID_STEPPING); /* Modified: head/sys/i386/i386/identcpu.c ============================================================================== --- head/sys/i386/i386/identcpu.c Fri Sep 21 03:09:23 2012 (r240772) +++ head/sys/i386/i386/identcpu.c Fri Sep 21 10:31:19 2012 (r240773) @@ -688,8 +688,8 @@ printcpuinfo(void) cpu_vendor_id == CPU_VENDOR_NSC || (cpu_vendor_id == CPU_VENDOR_CYRIX && ((cpu_id & 0xf00) > 0x500))) { - printf(" Family = %x", CPUID_TO_FAMILY(cpu_id)); - printf(" Model = %x", CPUID_TO_MODEL(cpu_id)); + printf(" Family = 0x%x", CPUID_TO_FAMILY(cpu_id)); + printf(" Model = 0x%x", CPUID_TO_MODEL(cpu_id)); printf(" Stepping = %u", cpu_id & CPUID_STEPPING); if (cpu_vendor_id == CPU_VENDOR_CYRIX) printf("\n DIR=0x%04x", cyrix_did); From owner-svn-src-all@FreeBSD.ORG Fri Sep 21 11:36:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 503E01065677; Fri, 21 Sep 2012 11:36:59 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (unknown [IPv6:2001:610:1108:5012::107]) by mx1.freebsd.org (Postfix) with ESMTP id D953C8FC26; Fri, 21 Sep 2012 11:36:58 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id D8B7D12013D; Fri, 21 Sep 2012 13:36:54 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id B53E72847B; Fri, 21 Sep 2012 13:36:54 +0200 (CEST) Date: Fri, 21 Sep 2012 13:36:54 +0200 From: Jilles Tjoelker To: Devin Teske Message-ID: <20120921113654.GA7865@stack.nl> References: <201209210136.q8L1aKiF031991@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201209210136.q8L1aKiF031991@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r240770 - in head/usr.sbin/bsdconfig: . console mouse networking networking/share share startup startup/share timezone/share usermgmt/share X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Sep 2012 11:36:59 -0000 On Fri, Sep 21, 2012 at 01:36:20AM +0000, Devin Teske wrote: > Author: dteske > Date: Fri Sep 21 01:36:20 2012 > New Revision: 240770 > URL: http://svn.freebsd.org/changeset/base/240770 > Log: > Replace redirections to /dev/null with "close file-descriptor" syntax (>&-). > Reviewed by: adrian (co-mentor) > Approved by: adrian (co-mentor) > [snip] > Modified: head/usr.sbin/bsdconfig/bsdconfig > ============================================================================== > --- head/usr.sbin/bsdconfig/bsdconfig Fri Sep 21 00:36:35 2012 (r240769) > +++ head/usr.sbin/bsdconfig/bsdconfig Fri Sep 21 01:36:20 2012 (r240770) > @@ -73,7 +73,7 @@ usage() > # Determine the maximum width of terminal/console > # > local max_size max_width > - max_size=$( stty size 2> /dev/null ) > + max_size=$( stty size 2>&- ) > : ${max_size:="24 80"} > max_width="${max_size#*[$IFS]}" > f_dprintf "max_width=[$max_width]" > [snip] This change is risky because it may cause error messages to be written to unexpected files. The first file the utility opens will be fd 2, and if something decides to write an error message to fd 2 it will try to write to that file. For this reason, the kernel will automatically open /dev/null if you execute suid/sgid binaries with fd 0, 1 and/or 2 closed. Particularly with fd 1 (>&-) there is another danger in that the output may fail with [EBADF] rather than being silently discarded. This may cause unexpected failures. If the reason is that there may be no /dev/null, then you will have to change the environment such that there will be a /dev/null. -- Jilles Tjoelker From owner-svn-src-all@FreeBSD.ORG Fri Sep 21 12:19:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA59F106566C; Fri, 21 Sep 2012 12:19:37 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CB5508FC14; Fri, 21 Sep 2012 12:19:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8LCJbVc031960; Fri, 21 Sep 2012 12:19:37 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8LCJb3o031958; Fri, 21 Sep 2012 12:19:37 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201209211219.q8LCJb3o031958@svn.freebsd.org> From: Alexander Motin Date: Fri, 21 Sep 2012 12:19:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240774 - head/lib/libstand X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Sep 2012 12:19:38 -0000 Author: mav Date: Fri Sep 21 12:19:36 2012 New Revision: 240774 URL: http://svn.freebsd.org/changeset/base/240774 Log: Don't use global nfs_root_node variable as per-file storage. There are fields that should be file-specific. Modified: head/lib/libstand/nfs.c Modified: head/lib/libstand/nfs.c ============================================================================== --- head/lib/libstand/nfs.c Fri Sep 21 10:31:19 2012 (r240773) +++ head/lib/libstand/nfs.c Fri Sep 21 12:19:36 2012 (r240774) @@ -486,6 +486,9 @@ nfs_open(const char *upath, struct open_ desc->destip = rootip; if ((error = nfs_getrootfh(desc, rootpath, nfs_root_node.fh))) return (error); + nfs_root_node.fa.fa_type = htonl(NFDIR); + nfs_root_node.fa.fa_mode = htonl(0755); + nfs_root_node.fa.fa_nlink = htonl(2); nfs_root_node.iodesc = desc; fh = &nfs_root_node.fh[0]; @@ -498,14 +501,15 @@ nfs_open(const char *upath, struct open_ setenv("boot.nfsroot.path", rootpath, 1); setenv("boot.nfsroot.nfshandle", buf, 1); -#ifndef NFS_NOSYMLINK - /* Fake up attributes for the root dir. */ - fa = &nfs_root_node.fa; - fa->fa_type = htonl(NFDIR); - fa->fa_mode = htonl(0755); - fa->fa_nlink = htonl(2); + /* Allocate file system specific data structure */ + currfd = malloc(sizeof(*newfd)); + if (currfd == NULL) { + error = ENOMEM; + goto out; + } - currfd = &nfs_root_node; +#ifndef NFS_NOSYMLINK + bcopy(&nfs_root_node, currfd, sizeof(*currfd)); newfd = 0; cp = path = strdup(upath); @@ -533,7 +537,6 @@ nfs_open(const char *upath, struct open_ /* allocate file system specific data structure */ newfd = malloc(sizeof(*newfd)); newfd->iodesc = currfd->iodesc; - newfd->off = 0; /* * Get next component of path name. @@ -585,11 +588,8 @@ nfs_open(const char *upath, struct open_ * If relative pathname, restart at parent directory. */ cp = namebuf; - if (*cp == '/') { - if (currfd != &nfs_root_node) - free(currfd); - currfd = &nfs_root_node; - } + if (*cp == '/') + bcopy(&nfs_root_node, currfd, sizeof(*currfd)); free(newfd); newfd = 0; @@ -597,8 +597,7 @@ nfs_open(const char *upath, struct open_ continue; } - if (currfd != &nfs_root_node) - free(currfd); + free(currfd); currfd = newfd; newfd = 0; } @@ -611,14 +610,12 @@ out: if (path) free(path); #else - /* allocate file system specific data structure */ - currfd = malloc(sizeof(*currfd)); currfd->iodesc = desc; - currfd->off = 0; error = nfs_lookupfh(&nfs_root_node, upath, currfd); #endif if (!error) { + currfd->off = 0; f->f_fsdata = (void *)currfd; return (0); } @@ -628,10 +625,7 @@ out: printf("nfs_open: %s lookupfh failed: %s\n", path, strerror(error)); #endif -#ifndef NFS_NOSYMLINK - if (currfd != &nfs_root_node) -#endif - free(currfd); + free(currfd); return (error); } @@ -646,7 +640,7 @@ nfs_close(struct open_file *f) printf("nfs_close: fp=0x%lx\n", (u_long)fp); #endif - if (fp != &nfs_root_node && fp) + if (fp) free(fp); f->f_fsdata = (void *)0; @@ -1133,6 +1127,9 @@ nfs_open(const char *upath, struct open_ if ((error = nfs_getrootfh(desc, rootpath, &nfs_root_node.fhsize, nfs_root_node.fh))) return (error); + nfs_root_node.fa.fa_type = htonl(NFDIR); + nfs_root_node.fa.fa_mode = htonl(0755); + nfs_root_node.fa.fa_nlink = htonl(2); nfs_root_node.iodesc = desc; fh = &nfs_root_node.fh[0]; @@ -1147,14 +1144,14 @@ nfs_open(const char *upath, struct open_ sprintf(buf, "%d", nfs_root_node.fhsize); setenv("boot.nfsroot.nfshandlelen", buf, 1); + /* Allocate file system specific data structure */ + currfd = malloc(sizeof(*newfd)); + if (currfd == NULL) { + error = ENOMEM; + goto out; + } #ifndef NFS_NOSYMLINK - /* Fake up attributes for the root dir. */ - fa = &nfs_root_node.fa; - fa->fa_type = htonl(NFDIR); - fa->fa_mode = htonl(0755); - fa->fa_nlink = htonl(2); - - currfd = &nfs_root_node; + bcopy(&nfs_root_node, currfd, sizeof(*currfd)); newfd = 0; cp = path = strdup(upath); @@ -1186,7 +1183,6 @@ nfs_open(const char *upath, struct open_ goto out; } newfd->iodesc = currfd->iodesc; - newfd->off = 0; /* * Get next component of path name. @@ -1238,11 +1234,8 @@ nfs_open(const char *upath, struct open_ * If relative pathname, restart at parent directory. */ cp = namebuf; - if (*cp == '/') { - if (currfd != &nfs_root_node) - free(currfd); - currfd = &nfs_root_node; - } + if (*cp == '/') + bcopy(&nfs_root_node, currfd, sizeof(*currfd)); free(newfd); newfd = 0; @@ -1250,8 +1243,7 @@ nfs_open(const char *upath, struct open_ continue; } - if (currfd != &nfs_root_node) - free(currfd); + free(currfd); currfd = newfd; newfd = 0; } @@ -1262,17 +1254,12 @@ out: free(newfd); free(path); #else - /* allocate file system specific data structure */ - currfd = malloc(sizeof(*currfd)); - if (currfd != NULL) { - currfd->iodesc = desc; - currfd->off = 0; + currfd->iodesc = desc; - error = nfs_lookupfh(&nfs_root_node, upath, currfd); - } else - error = ENOMEM; + error = nfs_lookupfh(&nfs_root_node, upath, currfd); #endif if (!error) { + currfd->off = 0; f->f_fsdata = (void *)currfd; return (0); } @@ -1282,10 +1269,7 @@ out: printf("nfs_open: %s lookupfh failed: %s\n", path, strerror(error)); #endif -#ifndef NFS_NOSYMLINK - if (currfd != &nfs_root_node) -#endif - free(currfd); + free(currfd); return (error); } @@ -1300,7 +1284,7 @@ nfs_close(struct open_file *f) printf("nfs_close: fp=0x%lx\n", (u_long)fp); #endif - if (fp != &nfs_root_node && fp) + if (fp) free(fp); f->f_fsdata = (void *)0; From owner-svn-src-all@FreeBSD.ORG Fri Sep 21 12:28:56 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A0D33106564A; Fri, 21 Sep 2012 12:28:56 +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 716768FC1A; Fri, 21 Sep 2012 12:28:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8LCSuLF033381; Fri, 21 Sep 2012 12:28:56 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8LCSujN033379; Fri, 21 Sep 2012 12:28:56 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201209211228.q8LCSujN033379@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 21 Sep 2012 12:28:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240775 - stable/9/share/man/man3 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Sep 2012 12:28:56 -0000 Author: jilles Date: Fri Sep 21 12:28:56 2012 New Revision: 240775 URL: http://svn.freebsd.org/changeset/base/240775 Log: MFC r240552: siginfo(3): Document SI_USER and SI_KERNEL signal codes. Modified: stable/9/share/man/man3/siginfo.3 Directory Properties: stable/9/share/man/man3/ (props changed) Modified: stable/9/share/man/man3/siginfo.3 ============================================================================== --- stable/9/share/man/man3/siginfo.3 Fri Sep 21 12:19:36 2012 (r240774) +++ stable/9/share/man/man3/siginfo.3 Fri Sep 21 12:28:56 2012 (r240775) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 8, 2005 +.Dd September 14, 2012 .Dt SIGINFO 3 .Os .Sh NAME @@ -195,6 +195,8 @@ signal generated by expiration of a time signal generated by completion of an asynchronous I/O request .It Ta Dv SI_MESGQ Ta signal generated by arrival of a message on an empty message queue +.It Ta Dv SI_KERNEL Ta +signal generated by miscellaneous parts of the kernel .El .Pp In addition, the following signal-specific information is available: @@ -235,6 +237,10 @@ or Finally, the following code-specific information is available: .Bl -column ".Dv SI_QUEUE" ".Va si_overrun" .It Sy "Code Member Value" +.It Dv SI_USER Ta Va si_pid Ta +the process ID that sent the signal +.It Ta Va si_uid Ta +real user ID of the process that sent the signal .It Dv SI_QUEUE Ta Va si_value Ta the value passed to .Xr sigqueue 2 @@ -277,6 +283,14 @@ signal is queued when a process changed .Tn POSIX Realtime Extensions like aio, timer, and message queue also queue signals. +Signals with code +.Dv SI_USER +or +.Dv SI_KERNEL +are only queued if there are sufficient resources; +otherwise, +.Dv SI_NOINFO +results. For some hardware architectures, the exact value of .Va si_addr might not be available. @@ -289,7 +303,8 @@ might not be available. .Xr sigwaitinfo 2 , .Xr timer_create 2 , .Xr timer_settime 2 , -.Xr waitpid 2 +.Xr waitpid 2 , +.Xr pthread_kill 3 .Sh STANDARDS The .Vt siginfo_t @@ -300,6 +315,12 @@ Full support for .Tn POSIX signal information first appeared in .Fx 7.0 . +The codes +.Dv SI_USER +and +.Dv SI_KERNEL +can be generated as of +.Fx 8.1 . .Sh AUTHORS This manual page was written by .An "David Xu" Aq davidxu@FreeBSD.org . From owner-svn-src-all@FreeBSD.ORG Fri Sep 21 12:31:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E4828106564A; Fri, 21 Sep 2012 12:31:37 +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 CFBE98FC18; Fri, 21 Sep 2012 12:31:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8LCVbBC033734; Fri, 21 Sep 2012 12:31:37 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8LCVblT033732; Fri, 21 Sep 2012 12:31:37 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201209211231.q8LCVblT033732@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 21 Sep 2012 12:31:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240776 - stable/9/share/man/man3 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Sep 2012 12:31:38 -0000 Author: jilles Date: Fri Sep 21 12:31:37 2012 New Revision: 240776 URL: http://svn.freebsd.org/changeset/base/240776 Log: MFC r240523: siginfo(3): Document SI_LWP signal code. Describe SI_LWP as being generated by pthread_kill() because thr_kill() is a private undocumented function. Modified: stable/9/share/man/man3/siginfo.3 Directory Properties: stable/9/share/man/man3/ (props changed) Modified: stable/9/share/man/man3/siginfo.3 ============================================================================== --- stable/9/share/man/man3/siginfo.3 Fri Sep 21 12:28:56 2012 (r240775) +++ stable/9/share/man/man3/siginfo.3 Fri Sep 21 12:31:37 2012 (r240776) @@ -197,6 +197,9 @@ signal generated by completion of an asy signal generated by arrival of a message on an empty message queue .It Ta Dv SI_KERNEL Ta signal generated by miscellaneous parts of the kernel +.It Ta Dv SI_LWP Ta +signal sent by +.Xr pthread_kill 3 .El .Pp In addition, the following signal-specific information is available: @@ -273,6 +276,10 @@ the value passed to system call .It Ta Va si_mqd Ta the ID of the message queue which generated the signal +.It Dv SI_LWP Ta Va si_pid Ta +the process ID that sent the signal +.It Ta Va si_uid Ta +real user ID of the process that sent the signal .El .Sh NOTES Currently, the kernel never generates the @@ -284,9 +291,10 @@ signal is queued when a process changed Realtime Extensions like aio, timer, and message queue also queue signals. Signals with code -.Dv SI_USER -or +.Dv SI_USER , .Dv SI_KERNEL +or +.Dv SI_LWP are only queued if there are sufficient resources; otherwise, .Dv SI_NOINFO @@ -321,6 +329,10 @@ and .Dv SI_KERNEL can be generated as of .Fx 8.1 . +The code +.Dv SI_LWP +can be generated as of +.Fx 9.0 . .Sh AUTHORS This manual page was written by .An "David Xu" Aq davidxu@FreeBSD.org . From owner-svn-src-all@FreeBSD.ORG Fri Sep 21 12:33:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A87231065678; Fri, 21 Sep 2012 12:33:25 +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 938C48FC0A; Fri, 21 Sep 2012 12:33:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8LCXPkQ034065; Fri, 21 Sep 2012 12:33:25 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8LCXPVN034063; Fri, 21 Sep 2012 12:33:25 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201209211233.q8LCXPVN034063@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 21 Sep 2012 12:33:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240777 - stable/9/share/man/man3 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Sep 2012 12:33:25 -0000 Author: jilles Date: Fri Sep 21 12:33:25 2012 New Revision: 240777 URL: http://svn.freebsd.org/changeset/base/240777 Log: MFC r240524: siginfo(3): Document TRAP_DTRACE signal code. Modified: stable/9/share/man/man3/siginfo.3 Directory Properties: stable/9/share/man/man3/ (props changed) Modified: stable/9/share/man/man3/siginfo.3 ============================================================================== --- stable/9/share/man/man3/siginfo.3 Fri Sep 21 12:31:37 2012 (r240776) +++ stable/9/share/man/man3/siginfo.3 Fri Sep 21 12:33:25 2012 (r240777) @@ -154,6 +154,8 @@ object-specific hardware error process breakpoint .It Ta Dv TRAP_TRACE Ta process trace trap +.It Ta Dv TRAP_DTRACE Ta +DTrace induced trap .It Dv SIGCHLD Ta Dv CLD_EXITED Ta child has exited .It Ta Dv CLD_KILLED Ta From owner-svn-src-all@FreeBSD.ORG Fri Sep 21 12:38:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BAA16106566B; Fri, 21 Sep 2012 12:38:52 +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 8AD1F8FC0C; Fri, 21 Sep 2012 12:38:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8LCcqZe034924; Fri, 21 Sep 2012 12:38:52 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8LCcqFt034922; Fri, 21 Sep 2012 12:38:52 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201209211238.q8LCcqFt034922@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 21 Sep 2012 12:38:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240778 - stable/8/share/man/man3 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Sep 2012 12:38:52 -0000 Author: jilles Date: Fri Sep 21 12:38:52 2012 New Revision: 240778 URL: http://svn.freebsd.org/changeset/base/240778 Log: siginfo(3): Document SI_USER and SI_KERNEL signal codes. Different from stable/9 and head, do not mention pthread_kill(3), which generates a different code (SI_USER) in stable/8. Modified: stable/8/share/man/man3/siginfo.3 Directory Properties: stable/8/share/man/man3/ (props changed) Modified: stable/8/share/man/man3/siginfo.3 ============================================================================== --- stable/8/share/man/man3/siginfo.3 Fri Sep 21 12:33:25 2012 (r240777) +++ stable/8/share/man/man3/siginfo.3 Fri Sep 21 12:38:52 2012 (r240778) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 8, 2005 +.Dd September 14, 2012 .Dt SIGINFO 3 .Os .Sh NAME @@ -195,6 +195,8 @@ signal generated by expiration of a time signal generated by completion of an asynchronous I/O request .It Ta Dv SI_MESGQ Ta signal generated by arrival of a message on an empty message queue +.It Ta Dv SI_KERNEL Ta +signal generated by miscellaneous parts of the kernel .El .Pp In addition, the following signal-specific information is available: @@ -235,6 +237,10 @@ or Finally, the following code-specific information is available: .Bl -column ".Dv SI_QUEUE" ".Va si_overrun" .It Sy "Code Member Value" +.It Dv SI_USER Ta Va si_pid Ta +the process ID that sent the signal +.It Ta Va si_uid Ta +real user ID of the process that sent the signal .It Dv SI_QUEUE Ta Va si_value Ta the value passed to .Xr sigqueue 2 @@ -281,6 +287,14 @@ signal is queued when a process changed .Tn POSIX Realtime Extensions like aio, timer, and message queue also queue signals. +Signals with code +.Dv SI_USER +or +.Dv SI_KERNEL +are only queued if there are sufficient resources; +otherwise, +.Dv SI_NOINFO +results. For some hardware architectures, the exact value of .Va si_addr might not be available. @@ -304,6 +318,12 @@ Full support for .Tn POSIX signal information first appeared in .Fx 7.0 . +The codes +.Dv SI_USER +and +.Dv SI_KERNEL +can be generated as of +.Fx 8.1 . .Sh AUTHORS This manual page was written by .An "David Xu" Aq davidxu@FreeBSD.org . From owner-svn-src-all@FreeBSD.ORG Fri Sep 21 12:40:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6341A1065670; Fri, 21 Sep 2012 12:40: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 4DF9B8FC15; Fri, 21 Sep 2012 12:40:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8LCeW71035142; Fri, 21 Sep 2012 12:40:32 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8LCeW2N035140; Fri, 21 Sep 2012 12:40:32 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201209211240.q8LCeW2N035140@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 21 Sep 2012 12:40: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: r240779 - stable/8/share/man/man3 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Sep 2012 12:40:32 -0000 Author: jilles Date: Fri Sep 21 12:40:31 2012 New Revision: 240779 URL: http://svn.freebsd.org/changeset/base/240779 Log: MFC r240524: siginfo(3): Document TRAP_DTRACE signal code. Modified: stable/8/share/man/man3/siginfo.3 Directory Properties: stable/8/share/man/man3/ (props changed) Modified: stable/8/share/man/man3/siginfo.3 ============================================================================== --- stable/8/share/man/man3/siginfo.3 Fri Sep 21 12:38:52 2012 (r240778) +++ stable/8/share/man/man3/siginfo.3 Fri Sep 21 12:40:31 2012 (r240779) @@ -154,6 +154,8 @@ object-specific hardware error process breakpoint .It Ta Dv TRAP_TRACE Ta process trace trap +.It Ta Dv TRAP_DTRACE Ta +DTrace induced trap .It Dv SIGCHLD Ta Dv CLD_EXITED Ta child has exited .It Ta Dv CLD_KILLED Ta From owner-svn-src-all@FreeBSD.ORG Fri Sep 21 13:25:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E7DAD106564A; Fri, 21 Sep 2012 13:25:50 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D31498FC0C; Fri, 21 Sep 2012 13:25:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8LDPoUB041431; Fri, 21 Sep 2012 13:25:50 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8LDPoFw041429; Fri, 21 Sep 2012 13:25:50 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201209211325.q8LDPoFw041429@svn.freebsd.org> From: Alexander Motin Date: Fri, 21 Sep 2012 13:25:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240780 - head/lib/libstand X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Sep 2012 13:25:51 -0000 Author: mav Date: Fri Sep 21 13:25:50 2012 New Revision: 240780 URL: http://svn.freebsd.org/changeset/base/240780 Log: Make nfs_readdir() more careful about using response data, cached in global buffer. For now it fixes bug when following `ls` command will return data from previous one aborted by pager. Also it should allow to read several directories same time, for example, for recursive tracerse. Modified: head/lib/libstand/nfs.c Modified: head/lib/libstand/nfs.c ============================================================================== --- head/lib/libstand/nfs.c Fri Sep 21 12:40:31 2012 (r240779) +++ head/lib/libstand/nfs.c Fri Sep 21 13:25:50 2012 (r240780) @@ -181,6 +181,7 @@ struct nfs_iodesc { uint32_t fhsize; u_char fh[NFS_V3MAXFHSIZE]; struct nfsv3_fattrs fa; /* all in network order */ + uint64_t cookie; }; #endif /* OLD_NFSV2 */ @@ -755,6 +756,7 @@ nfs_readdir(struct open_file *f, struct struct nfs_readdir_data *rd; struct nfs_readdir_off *roff = NULL; static char *buf; + static struct nfs_iodesc *pfp = NULL; static n_long cookie = 0; size_t cc; n_long eof; @@ -768,13 +770,14 @@ nfs_readdir(struct open_file *f, struct u_char d[NFS_READDIRSIZE]; } rdata; - if (cookie == 0) { + if (fp != pfp || fp->off != cookie) { + pfp = NULL; refill: args = &sdata.d; bzero(args, sizeof(*args)); bcopy(fp->fh, args->fh, NFS_FHSIZE); - args->cookie = htonl(cookie); + args->cookie = htonl(fp->off); args->count = htonl(NFS_READDIRSIZE); cc = rpc_call(fp->iodesc, NFS_PROG, NFS_VER2, NFSPROC_READDIR, @@ -784,6 +787,8 @@ nfs_readdir(struct open_file *f, struct roff = (struct nfs_readdir_off *)buf; if (ntohl(roff->cookie) != 0) return EIO; + pfp = fp; + cookie = fp->off; } roff = (struct nfs_readdir_off *)buf; @@ -804,7 +809,7 @@ nfs_readdir(struct open_file *f, struct buf += (sizeof(struct nfs_readdir_data) + roundup(htonl(rd->len),4)); roff = (struct nfs_readdir_off *)buf; - cookie = ntohl(roff->cookie); + fp->off = cookie = ntohl(roff->cookie); return 0; } #else /* !OLD_NFSV2 */ @@ -1260,6 +1265,7 @@ out: #endif if (!error) { currfd->off = 0; + currfd->cookie = 0; f->f_fsdata = (void *)currfd; return (0); } @@ -1398,11 +1404,9 @@ nfs_readdir(struct open_file *f, struct struct nfsv3_readdir_repl *repl; struct nfsv3_readdir_entry *rent; static char *buf; - static uint32_t cookie0 = 0; - static uint32_t cookie1 = 0; + static struct nfs_iodesc *pfp = NULL; + static uint64_t cookie = 0; size_t cc; - static uint32_t cookieverf0 = 0; - static uint32_t cookieverf1 = 0; int pos; struct args { @@ -1418,7 +1422,8 @@ nfs_readdir(struct open_file *f, struct u_char d[NFS_READDIRSIZE]; } rdata; - if (cookie0 == 0 && cookie1 == 0) { + if (fp != pfp || fp->off != cookie) { + pfp = NULL; refill: args = &sdata.d; bzero(args, sizeof(*args)); @@ -1426,10 +1431,10 @@ nfs_readdir(struct open_file *f, struct args->fhsize = htonl(fp->fhsize); bcopy(fp->fh, args->fhpluscookie, fp->fhsize); pos = roundup(fp->fhsize, sizeof(uint32_t)) / sizeof(uint32_t); - args->fhpluscookie[pos++] = cookie0; - args->fhpluscookie[pos++] = cookie1; - args->fhpluscookie[pos++] = cookieverf0; - args->fhpluscookie[pos++] = cookieverf1; + args->fhpluscookie[pos++] = htonl(fp->off >> 32); + args->fhpluscookie[pos++] = htonl(fp->off); + args->fhpluscookie[pos++] = htonl(fp->cookie >> 32); + args->fhpluscookie[pos++] = htonl(fp->cookie); args->fhpluscookie[pos] = htonl(NFS_READDIRSIZE); cc = rpc_call(fp->iodesc, NFS_PROG, NFS_VER3, NFSPROCV3_READDIR, @@ -1440,8 +1445,10 @@ nfs_readdir(struct open_file *f, struct repl = (struct nfsv3_readdir_repl *)buf; if (repl->errno != 0) return (ntohl(repl->errno)); - cookieverf0 = repl->cookiev0; - cookieverf1 = repl->cookiev1; + pfp = fp; + cookie = fp->off; + fp->cookie = ((uint64_t)ntohl(repl->cookiev0) << 32) | + ntohl(repl->cookiev1); buf += sizeof (struct nfsv3_readdir_repl); } rent = (struct nfsv3_readdir_entry *)buf; @@ -1449,10 +1456,7 @@ nfs_readdir(struct open_file *f, struct if (rent->follows == 0) { /* fid0 is actually eof */ if (rent->fid0 != 0) { - cookie0 = 0; - cookie1 = 0; - cookieverf0 = 0; - cookieverf1 = 0; + cookie = 0; return (ENOENT); } goto refill; @@ -1463,8 +1467,8 @@ nfs_readdir(struct open_file *f, struct d->d_name[d->d_namlen] = '\0'; pos = roundup(d->d_namlen, sizeof(uint32_t)) / sizeof(uint32_t); - cookie0 = rent->nameplus[pos++]; - cookie1 = rent->nameplus[pos++]; + fp->off = cookie = ((uint64_t)ntohl(rent->nameplus[pos++]) << 32) | + ntohl(rent->nameplus[pos++]); buf = (u_char *)&rent->nameplus[pos]; return (0); } From owner-svn-src-all@FreeBSD.ORG Fri Sep 21 16:20:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9FDF5106566B; Fri, 21 Sep 2012 16:20:55 +0000 (UTC) (envelope-from Devin.Teske@fisglobal.com) Received: from mx1.fisglobal.com (mx1.fisglobal.com [199.200.24.190]) by mx1.freebsd.org (Postfix) with ESMTP id 603EB8FC0A; Fri, 21 Sep 2012 16:20:55 +0000 (UTC) Received: from smtp.fisglobal.com ([10.132.206.15]) by ltcfislmsgpa06.fnfis.com (8.14.4/8.14.4) with ESMTP id q8LGKps1014464 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Fri, 21 Sep 2012 11:20:53 -0500 Received: from [10.0.0.100] (10.14.152.61) by smtp.fisglobal.com (10.132.206.15) with Microsoft SMTP Server (TLS) id 14.2.309.2; Fri, 21 Sep 2012 11:20:05 -0500 MIME-Version: 1.0 (Apple Message framework v1278) Content-Type: text/plain; charset="us-ascii" From: Devin Teske In-Reply-To: <20120921113654.GA7865@stack.nl> Date: Fri, 21 Sep 2012 09:19:58 -0700 Content-Transfer-Encoding: quoted-printable Message-ID: <7D546F33-EECC-4940-BDC6-FA73F330882A@fisglobal.com> References: <201209210136.q8L1aKiF031991@svn.freebsd.org> <20120921113654.GA7865@stack.nl> To: Jilles Tjoelker X-Mailer: Apple Mail (2.1278) X-Originating-IP: [10.14.152.61] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.7.7855, 1.0.431, 0.0.0000 definitions=2012-09-21_01:2012-09-20, 2012-09-21, 1970-01-01 signatures=0 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Devin Teske , src-committers@freebsd.org Subject: Re: svn commit: r240770 - in head/usr.sbin/bsdconfig: . console mouse networking networking/share share startup startup/share timezone/share usermgmt/share X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Devin Teske List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Sep 2012 16:20:55 -0000 On Sep 21, 2012, at 4:36 AM, Jilles Tjoelker wrote: > On Fri, Sep 21, 2012 at 01:36:20AM +0000, Devin Teske wrote: >> Author: dteske >> Date: Fri Sep 21 01:36:20 2012 >> New Revision: 240770 >> URL: http://svn.freebsd.org/changeset/base/240770 >=20 >> Log: >> Replace redirections to /dev/null with "close file-descriptor" syntax (= >&-). >=20 >> Reviewed by: adrian (co-mentor) >> Approved by: adrian (co-mentor) >=20 >> [snip] >=20 >> Modified: head/usr.sbin/bsdconfig/bsdconfig >> =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 >> --- head/usr.sbin/bsdconfig/bsdconfig Fri Sep 21 00:36:35 2012 (r240769) >> +++ head/usr.sbin/bsdconfig/bsdconfig Fri Sep 21 01:36:20 2012 (r240770) >> @@ -73,7 +73,7 @@ usage() >> # Determine the maximum width of terminal/console >> # >> local max_size max_width >> - max_size=3D$( stty size 2> /dev/null ) >> + max_size=3D$( stty size 2>&- ) >> : ${max_size:=3D"24 80"} >> max_width=3D"${max_size#*[$IFS]}" >> f_dprintf "max_width=3D[$max_width]" >> [snip] >=20 > This change is risky because it may cause error messages to be written > to unexpected files. The first file the utility opens will be fd 2, and > if something decides to write an error message to fd 2 it will try to > write to that file. >=20 > For this reason, the kernel will automatically open /dev/null if you > execute suid/sgid binaries with fd 0, 1 and/or 2 closed. >=20 > Particularly with fd 1 (>&-) there is another danger in that the output > may fail with [EBADF] rather than being silently discarded. This may > cause unexpected failures. >=20 > If the reason is that there may be no /dev/null, then you will have to > change the environment such that there will be a /dev/null. >=20 Jilles and I discussed in IRC and he showed me how I can make /dev/null ava= ilable in the embedded environment that this was needed for. I'm going to make another revision that reverses the changes in SVN r240770= (this change). Thanks Jilles! --=20 Devin _____________ The information contained in this message is proprietary and/or confidentia= l. If you are not the intended recipient, please: (i) delete the message an= d all copies; (ii) do not disclose, distribute or use the message in any ma= nner; and (iii) notify the sender immediately. In addition, please be aware= that any message addressed to our domain is subject to archiving and revie= w by persons other than the intended recipient. Thank you. From owner-svn-src-all@FreeBSD.ORG Fri Sep 21 16:33:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C07DD106564A; Fri, 21 Sep 2012 16:33:30 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-pb0-f54.google.com (mail-pb0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id 79AB18FC08; Fri, 21 Sep 2012 16:33:30 +0000 (UTC) Received: by pbbrp2 with SMTP id rp2so8730569pbb.13 for ; Fri, 21 Sep 2012 09:33:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=3vHi9X2aIfxXG4lJnSHbz3PQV5Xz8jSmdtMzoOgEAVc=; b=SK5/4Nt1ErWsfxfp+l4X6fD4BOt/fqYPnBvc3hB+h6ipTksvbj+QFvELDCNHR6HUMW wiyIOTWQbu0eP0TnkTaGiuBFB+d39UuY98xXv5Rj11DPFepMYVCnd06kXhDWQD0Vu2ua MT1G25VpGD062ES6NfwTR0LjKTW+yZZ3KJqUKhchx8x8hh8pSEW3VrZrLlq2PuIjWjs6 nsc2/tVWR5V3oY5pWJD90wU/cFr1GS91TfUWDH6oJRkEHGbhByty8GGEnl7ztwkQDOtD jtTNrgtBnBu3ElFLp2QBwfGihgwPlwigjRTbv9Zvcvzoo5sKAVMED3jpiKCjOgVNtKtl NXAQ== MIME-Version: 1.0 Received: by 10.68.189.164 with SMTP id gj4mr17039810pbc.48.1348245209928; Fri, 21 Sep 2012 09:33:29 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.68.36.106 with HTTP; Fri, 21 Sep 2012 09:33:29 -0700 (PDT) In-Reply-To: <7D546F33-EECC-4940-BDC6-FA73F330882A@fisglobal.com> References: <201209210136.q8L1aKiF031991@svn.freebsd.org> <20120921113654.GA7865@stack.nl> <7D546F33-EECC-4940-BDC6-FA73F330882A@fisglobal.com> Date: Fri, 21 Sep 2012 09:33:29 -0700 X-Google-Sender-Auth: h5A7qsp3HUtSwkPoaZOe8kkdI3o Message-ID: From: Adrian Chadd To: Devin Teske Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Jilles Tjoelker Subject: Re: svn commit: r240770 - in head/usr.sbin/bsdconfig: . console mouse networking networking/share share startup startup/share timezone/share usermgmt/share X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Sep 2012 16:33:31 -0000 Sweet. The reversal is approved. Let's rope some sh script people in on the next few commits, just for some feedback? Adrian On 21 September 2012 09:19, Devin Teske wrote: > > On Sep 21, 2012, at 4:36 AM, Jilles Tjoelker wrote: > >> On Fri, Sep 21, 2012 at 01:36:20AM +0000, Devin Teske wrote: >>> Author: dteske >>> Date: Fri Sep 21 01:36:20 2012 >>> New Revision: 240770 >>> URL: http://svn.freebsd.org/changeset/base/240770 >> >>> Log: >>> Replace redirections to /dev/null with "close file-descriptor" syntax = (>&-). >> >>> Reviewed by: adrian (co-mentor) >>> Approved by: adrian (co-mentor) >> >>> [snip] >> >>> Modified: head/usr.sbin/bsdconfig/bsdconfig >>> =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 >>> --- head/usr.sbin/bsdconfig/bsdconfig Fri Sep 21 00:36:35 2012 = (r240769) >>> +++ head/usr.sbin/bsdconfig/bsdconfig Fri Sep 21 01:36:20 2012 = (r240770) >>> @@ -73,7 +73,7 @@ usage() >>> # Determine the maximum width of terminal/console >>> # >>> local max_size max_width >>> - max_size=3D$( stty size 2> /dev/null ) >>> + max_size=3D$( stty size 2>&- ) >>> : ${max_size:=3D"24 80"} >>> max_width=3D"${max_size#*[$IFS]}" >>> f_dprintf "max_width=3D[$max_width]" >>> [snip] >> >> This change is risky because it may cause error messages to be written >> to unexpected files. The first file the utility opens will be fd 2, and >> if something decides to write an error message to fd 2 it will try to >> write to that file. >> >> For this reason, the kernel will automatically open /dev/null if you >> execute suid/sgid binaries with fd 0, 1 and/or 2 closed. >> >> Particularly with fd 1 (>&-) there is another danger in that the output >> may fail with [EBADF] rather than being silently discarded. This may >> cause unexpected failures. >> >> If the reason is that there may be no /dev/null, then you will have to >> change the environment such that there will be a /dev/null. >> > > Jilles and I discussed in IRC and he showed me how I can make /dev/null a= vailable in the embedded environment that this was needed for. > > I'm going to make another revision that reverses the changes in SVN r2407= 70 (this change). > > Thanks Jilles! > -- > Devin > > _____________ > The information contained in this message is proprietary and/or confident= ial. If you are not the intended recipient, please: (i) delete the message = and all copies; (ii) do not disclose, distribute or use the message in any = manner; and (iii) notify the sender immediately. In addition, please be awa= re that any message addressed to our domain is subject to archiving and rev= iew by persons other than the intended recipient. Thank you. From owner-svn-src-all@FreeBSD.ORG Fri Sep 21 18:21:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 67DE1106566B; Fri, 21 Sep 2012 18:21:32 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 530C28FC08; Fri, 21 Sep 2012 18:21:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8LILW3S081480; Fri, 21 Sep 2012 18:21:32 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8LILWiD081478; Fri, 21 Sep 2012 18:21:32 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201209211821.q8LILWiD081478@svn.freebsd.org> From: Andreas Tobler Date: Fri, 21 Sep 2012 18:21:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240782 - head/sys/boot/common X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Sep 2012 18:21:32 -0000 Author: andreast Date: Fri Sep 21 18:21:31 2012 New Revision: 240782 URL: http://svn.freebsd.org/changeset/base/240782 Log: Implement elfN(reloc) for powerpc. With this change the kernel is now able to resolve dependencies of modules at boot time and load additional modules when needed. MFC after: 1 week Modified: head/sys/boot/common/reloc_elf.c Modified: head/sys/boot/common/reloc_elf.c ============================================================================== --- head/sys/boot/common/reloc_elf.c Fri Sep 21 13:42:30 2012 (r240781) +++ head/sys/boot/common/reloc_elf.c Fri Sep 21 18:21:31 2012 (r240782) @@ -193,6 +193,31 @@ __elfN(reloc)(struct elf_file *ef, symad } return (0); +#elif defined(__powerpc__) + Elf_Size w; + const Elf_Rela *rela; + + switch (reltype) { + case ELF_RELOC_RELA: + rela = reldata; + if (relbase + rela->r_offset >= dataaddr && + relbase + rela->r_offset < dataaddr + len) { + switch (ELF_R_TYPE(rela->r_info)) { + case R_PPC_RELATIVE: + w = relbase + rela->r_addend; + bcopy(&w, (u_char *)data + (relbase + + rela->r_offset - dataaddr), sizeof(w)); + break; + default: + printf("\nunhandled relocation type %u\n", + (u_int)ELF_R_TYPE(rela->r_info)); + return (EFTYPE); + } + } + break; + } + + return (0); #else return (EOPNOTSUPP); #endif From owner-svn-src-all@FreeBSD.ORG Fri Sep 21 19:03:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E490106564A; Fri, 21 Sep 2012 19:03:26 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 473B48FC0A; Fri, 21 Sep 2012 19:03:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8LJ3QlB088041; Fri, 21 Sep 2012 19:03:26 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8LJ3PIe088018; Fri, 21 Sep 2012 19:03:25 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201209211903.q8LJ3PIe088018@svn.freebsd.org> From: Devin Teske Date: Fri, 21 Sep 2012 19:03:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240783 - in head/usr.sbin/bsdconfig: . console mouse networking networking/share share startup startup/share timezone/share usermgmt/share X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Sep 2012 19:03:26 -0000 Author: dteske Date: Fri Sep 21 19:03:25 2012 New Revision: 240783 URL: http://svn.freebsd.org/changeset/base/240783 Log: Reverse SVN r240770 -- jilles@ made a suggestion that allowed us to redesign our embedded rescue environment to support /dev/null making r240770 obsolete. Reviewed by: jilles, adrian (co-mentor) Approved by: jilles, adrian (co-mentor) Modified: head/usr.sbin/bsdconfig/bsdconfig head/usr.sbin/bsdconfig/console/ttys head/usr.sbin/bsdconfig/mouse/enable head/usr.sbin/bsdconfig/networking/devices head/usr.sbin/bsdconfig/networking/share/device.subr head/usr.sbin/bsdconfig/networking/share/ipaddr.subr head/usr.sbin/bsdconfig/networking/share/media.subr head/usr.sbin/bsdconfig/networking/share/netmask.subr head/usr.sbin/bsdconfig/networking/share/resolv.subr head/usr.sbin/bsdconfig/networking/share/routing.subr head/usr.sbin/bsdconfig/share/common.subr head/usr.sbin/bsdconfig/share/dialog.subr head/usr.sbin/bsdconfig/share/mustberoot.subr head/usr.sbin/bsdconfig/share/strings.subr head/usr.sbin/bsdconfig/share/sysrc.subr head/usr.sbin/bsdconfig/startup/rcadd head/usr.sbin/bsdconfig/startup/rcconf head/usr.sbin/bsdconfig/startup/rcdelete head/usr.sbin/bsdconfig/startup/rcvar head/usr.sbin/bsdconfig/startup/share/rcconf.subr head/usr.sbin/bsdconfig/timezone/share/zones.subr head/usr.sbin/bsdconfig/usermgmt/share/user_input.subr Modified: head/usr.sbin/bsdconfig/bsdconfig ============================================================================== --- head/usr.sbin/bsdconfig/bsdconfig Fri Sep 21 18:21:31 2012 (r240782) +++ head/usr.sbin/bsdconfig/bsdconfig Fri Sep 21 19:03:25 2012 (r240783) @@ -73,7 +73,7 @@ usage() # Determine the maximum width of terminal/console # local max_size max_width - max_size=$( stty size 2>&- ) + max_size=$( stty size 2> /dev/null ) : ${max_size:="24 80"} max_width="${max_size#*[$IFS]}" f_dprintf "max_width=[$max_width]" @@ -242,8 +242,8 @@ if [ "$1" ]; then # lang="${LANG:-$LC_ALL}" if [ "$lang" ]; then - sel=$( grep "^menu_selection=\"$1|" */INDEX.$lang 2>&- | - tail -1 ) + sel=$( grep "^menu_selection=\"$1|" */INDEX.$lang \ + 2> /dev/null | tail -1 ) # Fall-back to non-i18n sources if nothing was found [ "$sel" ] || Modified: head/usr.sbin/bsdconfig/console/ttys ============================================================================== --- head/usr.sbin/bsdconfig/console/ttys Fri Sep 21 18:21:31 2012 (r240782) +++ head/usr.sbin/bsdconfig/console/ttys Fri Sep 21 19:03:25 2012 (r240783) @@ -117,8 +117,8 @@ ttys_set_type() # with 0600 permissions -- change the permissions and ownership to # match ttys(5) before we write it out and mv(1) it into place). # - local mode="$( stat -f '%#Lp' "$ETC_TTYS" 2>&- )" - local owner="$( stat -f '%u:%g' "$ETC_TTYS" 2>&- )" + local mode="$( stat -f '%#Lp' "$ETC_TTYS" 2> /dev/null )" + local owner="$( stat -f '%u:%g' "$ETC_TTYS" 2> /dev/null )" f_quietly chmod "${mode:-0644}" "$tmpfile" f_quietly chown "${owner:-root:wheel}" "$tmpfile" Modified: head/usr.sbin/bsdconfig/mouse/enable ============================================================================== --- head/usr.sbin/bsdconfig/mouse/enable Fri Sep 21 18:21:31 2012 (r240782) +++ head/usr.sbin/bsdconfig/mouse/enable Fri Sep 21 19:03:25 2012 (r240783) @@ -86,7 +86,7 @@ flags=$( f_sysrc_get moused_flags ) # f_dialog_info "$msg_trying_to_start_the_mouse_daemon" [ -r "$MOUSED_PIDFILE" ] && - f_quietly kill "$( cat "$MOUSED_PIDFILE" 2>&- )" + f_quietly kill "$( cat "$MOUSED_PIDFILE" 2> /dev/null )" f_quietly vidcontrol -m on f_quietly moused -t "$type" -p "$port" $flags Modified: head/usr.sbin/bsdconfig/networking/devices ============================================================================== --- head/usr.sbin/bsdconfig/networking/devices Fri Sep 21 18:21:31 2012 (r240782) +++ head/usr.sbin/bsdconfig/networking/devices Fri Sep 21 19:03:25 2012 (r240783) @@ -112,7 +112,7 @@ while :; do # configuration # dhcp= - eval "$( exec 2>&- + eval "$( exec 2> /dev/null set -- $_ifconfig while [ $# -gt 0 ]; do case "$1" in Modified: head/usr.sbin/bsdconfig/networking/share/device.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/device.subr Fri Sep 21 18:21:31 2012 (r240782) +++ head/usr.sbin/bsdconfig/networking/share/device.subr Fri Sep 21 19:03:25 2012 (r240783) @@ -72,7 +72,7 @@ f_device_desc() devname="${device%%$d*}" devunit="${device#$devname}" devunit="${devunit%%[a-zA-Z_]*}" - sysctl -n "dev.$devname.$devunit.%desc" 2>&- && + sysctl -n "dev.$devname.$devunit.%desc" 2> /dev/null && return $SUCCESS fi Modified: head/usr.sbin/bsdconfig/networking/share/ipaddr.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/ipaddr.subr Fri Sep 21 18:21:31 2012 (r240782) +++ head/usr.sbin/bsdconfig/networking/share/ipaddr.subr Fri Sep 21 19:03:25 2012 (r240783) @@ -47,7 +47,7 @@ f_include_lang $BSDCFG_LIBE/$APP_DIR/inc f_ifconfig_inet() { local interface="$1" - ifconfig "$interface" 2>&- | awk \ + ifconfig "$interface" 2> /dev/null | awk \ ' BEGIN { found = 0 } ( $1 == "inet" ) \ Modified: head/usr.sbin/bsdconfig/networking/share/media.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/media.subr Fri Sep 21 18:21:31 2012 (r240782) +++ head/usr.sbin/bsdconfig/networking/share/media.subr Fri Sep 21 19:03:25 2012 (r240783) @@ -83,7 +83,7 @@ f_ifconfig_options() f_ifconfig_media() { local interface="$1" - ifconfig -m "$interface" 2>&- | awk \ + ifconfig -m "$interface" 2> /dev/null | awk \ ' BEGIN { media_found = 0 } { Modified: head/usr.sbin/bsdconfig/networking/share/netmask.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/netmask.subr Fri Sep 21 18:21:31 2012 (r240782) +++ head/usr.sbin/bsdconfig/networking/share/netmask.subr Fri Sep 21 19:03:25 2012 (r240783) @@ -46,7 +46,7 @@ f_include_lang $BSDCFG_LIBE/$APP_DIR/inc f_ifconfig_netmask() { local interface="$1" octets - octets=$( ifconfig "$interface" 2>&- | awk \ + octets=$( ifconfig "$interface" 2> /dev/null | awk \ ' BEGIN { found = 0 } ( $1 == "inet" ) \ Modified: head/usr.sbin/bsdconfig/networking/share/resolv.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/resolv.subr Fri Sep 21 18:21:31 2012 (r240782) +++ head/usr.sbin/bsdconfig/networking/share/resolv.subr Fri Sep 21 19:03:25 2012 (r240783) @@ -65,7 +65,7 @@ f_include_lang $BSDCFG_LIBE/$APP_DIR/inc # f_resolv_conf_domain() { - tail -r "$RESOLV_CONF" 2>&- | awk \ + tail -r "$RESOLV_CONF" 2> /dev/null | awk \ ' BEGIN { found = 0 } ( tolower($1) == "domain" ) \ @@ -84,7 +84,7 @@ f_resolv_conf_domain() # f_resolv_conf_search() { - tail -r "$RESOLV_CONF" 2>&- | awk \ + tail -r "$RESOLV_CONF" 2> /dev/null | awk \ ' BEGIN { found = 0 } { @@ -118,7 +118,7 @@ f_resolv_conf_nameservers() } END { exit ! found } ' \ - "$RESOLV_CONF" 2>&- + "$RESOLV_CONF" 2> /dev/null } # f_dialog_resolv_conf_update $hostname @@ -225,8 +225,8 @@ f_dialog_resolv_conf_update() # permissions and ownership to match resolv.conf(5) before # we write it out and mv(1) it into place). # - local mode="$( stat -f '%#Lp' "$RESOLV_CONF" 2>&- )" - local owner="$( stat -f '%u:%g' "$RESOLV_CONF" 2>&- )" + local mode="$( stat -f '%#Lp' "$RESOLV_CONF" 2> /dev/null )" + local owner="$( stat -f '%u:%g' "$RESOLV_CONF" 2> /dev/null )" f_quietly chmod "${mode:-0644}" "$tmpfile" f_quietly chown "${owner:-root:wheel}" "$tmpfile" @@ -246,7 +246,7 @@ f_dialog_resolv_conf_update() # local domain="${hostname#*.}" new_contents [ "$domain" = "$hostname" ] && domain= - new_contents=$( tail -r "$RESOLV_CONF" 2>&- ) + new_contents=$( tail -r "$RESOLV_CONF" 2> /dev/null ) new_contents=$( echo "$new_contents" | awk \ -v domain="$domain" \ -v search_all="${RESOLVER_SEARCH_DOMAINS_ALL:-1}" \ @@ -397,8 +397,8 @@ f_dialog_input_nameserver() # Quietly fixup permissions and ownership # local mode owner - mode=$( stat -f '%#Lp' "$RESOLV_CONF" 2>&- ) - owner=$( stat -f '%u:%g' "$RESOLV_CONF" 2>&- ) + mode=$( stat -f '%#Lp' "$RESOLV_CONF" 2> /dev/null ) + owner=$( stat -f '%u:%g' "$RESOLV_CONF" 2> /dev/null ) f_quietly chmod "${mode:-0644}" "$tmpfile" f_quietly chown "${owner:-root:wheel}" "$tmpfile" Modified: head/usr.sbin/bsdconfig/networking/share/routing.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/routing.subr Fri Sep 21 18:21:31 2012 (r240782) +++ head/usr.sbin/bsdconfig/networking/share/routing.subr Fri Sep 21 19:03:25 2012 (r240783) @@ -46,7 +46,7 @@ f_include_lang $BSDCFG_LIBE/$APP_DIR/inc # f_route_get_default() { - route -n get default 2>&- | awk \ + route -n get default 2> /dev/null | awk \ ' BEGIN { found = 0 } ( $1 == "gateway:" ) \ Modified: head/usr.sbin/bsdconfig/share/common.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/common.subr Fri Sep 21 18:21:31 2012 (r240782) +++ head/usr.sbin/bsdconfig/share/common.subr Fri Sep 21 19:03:25 2012 (r240783) @@ -72,7 +72,7 @@ f_err() # f_quietly() { - "$@" >&- 2>&- + "$@" > /dev/null 2>&1 } # f_have $anything ... Modified: head/usr.sbin/bsdconfig/share/dialog.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/dialog.subr Fri Sep 21 18:21:31 2012 (r240782) +++ head/usr.sbin/bsdconfig/share/dialog.subr Fri Sep 21 19:03:25 2012 (r240783) @@ -1321,7 +1321,7 @@ f_dialog_init() # Process stored command-line arguments # SECURE=$( set -- "$ARGV" - while getopts S flag >&-; do + while getopts S flag > /dev/null; do case "$flag" in S) echo 1;; \?) continue;; @@ -1329,7 +1329,7 @@ f_dialog_init() done ) USE_XDIALOG=$( set -- "$ARGV" - while getopts SX flag >&-; do + while getopts SX flag > /dev/null; do case "$flag" in S|X) echo 1;; \?) continue;; @@ -1372,7 +1372,7 @@ f_dialog_init() eval xauth -if \~$SUDO_USER/.Xauthority extract - \ \"\$HOSTNAME/unix:\$displaynum\" \ \"\$HOSTNAME:\$displaynum\" | sudo sh -c 'xauth -ivf \ - ~root/.Xauthority merge - >&- 2>&-' + ~root/.Xauthority merge - > /dev/null 2>&1' fi # Modified: head/usr.sbin/bsdconfig/share/mustberoot.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/mustberoot.subr Fri Sep 21 18:21:31 2012 (r240782) +++ head/usr.sbin/bsdconfig/share/mustberoot.subr Fri Sep 21 19:03:25 2012 (r240783) @@ -85,7 +85,7 @@ f_become_root_via_sudo() # # Check sudo(8) access before prompting for password. # - :| sudo -S -v 2>&- + :| sudo -S -v 2> /dev/null if [ $? -ne $SUCCESS ]; then # # sudo(8) access denied. Prompt for their password. @@ -112,7 +112,7 @@ f_become_root_via_sudo() --ok-label "$msg_ok" \ --cancel-label "$msg_cancel" \ --password --inputbox "$msg" $size \ - 2>&1 >&- ) + 2>&1 > /dev/null ) retval=$? # Catch X11-related errors @@ -141,7 +141,7 @@ f_become_root_via_sudo() # # Validate sudo(8) credentials # - sudo -S -v 2>&- <<-EOF + sudo -S -v 2> /dev/null <<-EOF $password EOF retval=$? @@ -186,7 +186,7 @@ f_become_root_via_sudo() displaynum="${DISPLAY#*:}" xauth -f ~/.Xauthority extract - $HOSTNAME/unix:$displaynum \ $HOSTNAME:$displaynum | sudo sh -c 'xauth -ivf \ - ~root/.Xauthority merge - >&- 2>&-' + ~root/.Xauthority merge - > /dev/null 2>&1' fi # Re-execute ourselves with sudo(8) @@ -254,7 +254,7 @@ f_authenticate_some_user() $height $width \ "$field_username" "" \ "$field_password" "" \ - 2>&1 >&- ) + 2>&1 > /dev/null ) retval=$? # Catch X11-related errors @@ -302,7 +302,7 @@ f_authenticate_some_user() su -m "$user" <<-EOF sh <&- < /dev/null <&- 2>&- + ( : $((0/$arg)) ) > /dev/null 2>&1 } fi # ! $_STRINGS_SUBR Modified: head/usr.sbin/bsdconfig/share/sysrc.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/sysrc.subr Fri Sep 21 18:21:31 2012 (r240782) +++ head/usr.sbin/bsdconfig/share/sysrc.subr Fri Sep 21 19:03:25 2012 (r240783) @@ -134,7 +134,7 @@ f_sysrc_get() # f_clean_env --except RC_CONFS RC_DEFAULTS SUCCESS - . "$RC_DEFAULTS" >&- 2>&- + . "$RC_DEFAULTS" > /dev/null 2>&1 unset RC_DEFAULTS # no longer needed @@ -153,7 +153,7 @@ f_sysrc_get() # If RC_CONFS is defined, set $rc_conf_files to an explicit # value, modifying the default behavior of source_rc_confs(). # - ( : ${RC_CONFS?} ) >&- 2>&- + ( : ${RC_CONFS?} ) > /dev/null 2>&1 if [ $? -eq ${SUCCESS:-0} ]; then rc_conf_files="$RC_CONFS" _rc_confs_set=1 @@ -162,7 +162,7 @@ f_sysrc_get() unset SUCCESS # no longer needed - source_rc_confs >&- 2>&- + source_rc_confs > /dev/null 2>&1 # # If the query was for `rc_conf_files' AND after calling @@ -190,7 +190,7 @@ f_sysrc_get() # such as "${varname?}" and "${varname:?}" (see "Parameter # Expansion" in sh(1) for more information). # - eval echo '"${'"$1"'}"' 2>&- + eval echo '"${'"$1"'}"' 2> /dev/null ) } @@ -221,7 +221,7 @@ f_sysrc_get_default() # f_clean_env --except RC_DEFAULTS - . "$RC_DEFAULTS" >&- 2>&- + . "$RC_DEFAULTS" > /dev/null 2>&1 unset RC_DEFAULTS # no longer needed @@ -232,7 +232,7 @@ f_sysrc_get_default() # such as "${varname?}" and "${varname:?}" (see "Parameter # Expansion" in sh(1) for more information). # - eval echo '"${'"$1"'}"' 2>&- + eval echo '"${'"$1"'}"' 2> /dev/null ) } @@ -477,7 +477,7 @@ f_sysrc_set() # permissions from the temporary file). # local mode - mode=$( stat -f '%#Lp' "$file" 2>&- ) + mode=$( stat -f '%#Lp' "$file" 2> /dev/null ) f_quietly chmod "${mode:-0644}" "$tmpfile" # @@ -486,14 +486,14 @@ f_sysrc_set() # permissions (so we throw stderr into the bit-bucket). # local owner - owner=$( stat -f '%u:%g' "$file" 2>&- ) + owner=$( stat -f '%u:%g' "$file" 2> /dev/null ) f_quietly chown "${owner:-root:wheel}" "$tmpfile" # # Operate on the matching file, replacing only the last occurrence. # local new_contents retval - new_contents=$( tail -r $file 2>&- ) + new_contents=$( tail -r $file 2> /dev/null ) new_contents=$( echo "$new_contents" | awk -v varname="$varname" \ -v new_value="$new_value" "$f_sysrc_set_awk" ) retval=$? @@ -572,8 +572,8 @@ f_sysrc_delete() # permissions) to instead match the destination file. # local mode owner - mode=$( stat -f '%#Lp' "$file" 2>&- ) - owner=$( stat -f '%u:%g' "$file" 2>&- ) + mode=$( stat -f '%#Lp' "$file" 2> /dev/null ) + owner=$( stat -f '%u:%g' "$file" 2> /dev/null ) f_quietly chmod "${mode:-0644}" "$tmpfile" f_quietly chown "${owner:-root:wheel}" "$tmpfile" Modified: head/usr.sbin/bsdconfig/startup/rcadd ============================================================================== --- head/usr.sbin/bsdconfig/startup/rcadd Fri Sep 21 18:21:31 2012 (r240782) +++ head/usr.sbin/bsdconfig/startup/rcadd Fri Sep 21 19:03:25 2012 (r240783) @@ -46,7 +46,7 @@ ipgm=$( f_index_menu_selection $BSDCFG_L # Options # # Inherit SHOW_DESC value if set, otherwise default to 1 -( : ${SHOW_DESC?} ) >&- 2>&- || SHOW_DESC=1 +( : ${SHOW_DESC?} ) > /dev/null 2>&1 || SHOW_DESC=1 ############################################################ FUNCTIONS Modified: head/usr.sbin/bsdconfig/startup/rcconf ============================================================================== --- head/usr.sbin/bsdconfig/startup/rcconf Fri Sep 21 18:21:31 2012 (r240782) +++ head/usr.sbin/bsdconfig/startup/rcconf Fri Sep 21 19:03:25 2012 (r240783) @@ -54,7 +54,7 @@ RCCONF_MENU_LIST= # Options # # Inherit SHOW_DESC value if set, otherwise default to 1 -( : ${SHOW_DESC?} ) >&- 2>&- || SHOW_DESC=1 +( : ${SHOW_DESC?} ) > /dev/null 2>&1 || SHOW_DESC=1 # Selectively inherit SHOW_* value (in order of preference) if [ "$SHOW_DEFAULT_VALUE" ]; then SHOW_DEFAULT_VALUE=1 @@ -110,8 +110,8 @@ dialog_menu_main() f_dialog_info "$msg_creating_menu_list" RCCONF_MENU_LIST="$RCCONF_MENU_LIST $( - . "$RC_DEFAULTS" >&- - source_rc_confs >&- + . "$RC_DEFAULTS" > /dev/null + source_rc_confs > /dev/null var_list=$( f_startup_rcconf_list ) for var in $var_list; do eval export $var Modified: head/usr.sbin/bsdconfig/startup/rcdelete ============================================================================== --- head/usr.sbin/bsdconfig/startup/rcdelete Fri Sep 21 18:21:31 2012 (r240782) +++ head/usr.sbin/bsdconfig/startup/rcdelete Fri Sep 21 19:03:25 2012 (r240783) @@ -54,7 +54,7 @@ RCCONF_MENU_LIST= # Options # # Inherit SHOW_DESC value if set, otherwise default to 1 -( : ${SHOW_DESC?} ) >&- 2>&- || SHOW_DESC=1 +( : ${SHOW_DESC?} ) > /dev/null 2>&1 || SHOW_DESC=1 # Selectively inherit SHOW_* value (in order of preference) if [ "$SHOW_DEFAULT_VALUE" ]; then SHOW_DEFAULT_VALUE=1 @@ -112,8 +112,8 @@ dialog_menu_main() f_dialog_info "$msg_creating_menu_list" RCCONF_MENU_LIST="$RCCONF_MENU_LIST $( - . "$RC_DEFAULTS" >&- - source_rc_confs >&- + . "$RC_DEFAULTS" > /dev/null + source_rc_confs > /dev/null var_list=$( f_startup_rcconf_list ) for var in $var_list; do eval export $var @@ -348,7 +348,7 @@ while :; do var="${mtag# }" # Toggle the state-variable and loop back to menu - if ( eval : \${_${var}_delete?} ) >&- 2>&-; then + if ( eval : \${_${var}_delete?} ) > /dev/null 2>&1; then unset _${var}_delete else setvar _${var}_delete 1 Modified: head/usr.sbin/bsdconfig/startup/rcvar ============================================================================== --- head/usr.sbin/bsdconfig/startup/rcvar Fri Sep 21 18:21:31 2012 (r240782) +++ head/usr.sbin/bsdconfig/startup/rcvar Fri Sep 21 19:03:25 2012 (r240783) @@ -54,7 +54,7 @@ RCVAR_MENU_LIST= # Options # # Inherit SHOW_DESC value if set, otherwise default to 1 -( ${SHOW_DESC?} ) >&- 2>&- || SHOW_DESC=1 +( ${SHOW_DESC?} ) > /dev/null 2>&1 || SHOW_DESC=1 ############################################################ FUNCTIONS @@ -82,8 +82,8 @@ dialog_menu_main() fi RCVAR_MENU_LIST="$RCVAR_MENU_LIST $( - . "$RC_DEFAULTS" >&- - source_rc_confs >&- + . "$RC_DEFAULTS" > /dev/null + source_rc_confs > /dev/null for rcvar in $( echo "$RCVAR_MAP" | awk '{print $1}' ); do eval export $rcvar done Modified: head/usr.sbin/bsdconfig/startup/share/rcconf.subr ============================================================================== --- head/usr.sbin/bsdconfig/startup/share/rcconf.subr Fri Sep 21 18:21:31 2012 (r240782) +++ head/usr.sbin/bsdconfig/startup/share/rcconf.subr Fri Sep 21 19:03:25 2012 (r240783) @@ -63,9 +63,9 @@ STARTUP_RCCONF_MAP_CACHEFILE="/var/run/b f_startup_rcconf_list() { ( # Operate within a sub-shell to protect the parent environment - . "$RC_DEFAULTS" >&- + . "$RC_DEFAULTS" > /dev/null f_clean_env --except PATH STARTUP_RCCONF_REGEX rc_conf_files - source_rc_confs >&- + source_rc_confs > /dev/null export _rc_conf_files_file="$( f_sysrc_find rc_conf_files )" export RC_DEFAULTS set | awk -F= " Modified: head/usr.sbin/bsdconfig/timezone/share/zones.subr ============================================================================== --- head/usr.sbin/bsdconfig/timezone/share/zones.subr Fri Sep 21 18:21:31 2012 (r240782) +++ head/usr.sbin/bsdconfig/timezone/share/zones.subr Fri Sep 21 19:03:25 2012 (r240783) @@ -610,7 +610,7 @@ f_install_zoneinfo() # Save knowledge for later if [ "$REALLYDOIT" -a $rv -eq $SUCCESS ]; then - if : 2>&- > "$_PATH_DB"; then + if : 2> /dev/null > "$_PATH_DB"; then cat <<-EOF > "$_PATH_DB" $zoneinfo EOF Modified: head/usr.sbin/bsdconfig/usermgmt/share/user_input.subr ============================================================================== --- head/usr.sbin/bsdconfig/usermgmt/share/user_input.subr Fri Sep 21 18:21:31 2012 (r240782) +++ head/usr.sbin/bsdconfig/usermgmt/share/user_input.subr Fri Sep 21 19:03:25 2012 (r240783) @@ -627,7 +627,7 @@ f_dialog_input_change() local secs="$_input" { f_isinteger "$secs" && [ $secs -gt 0 ]; } || secs= _input_date=$( date -j -f "%s" -- "$secs" \ - "+%d %m %Y" 2>&- ) + "+%d %m %Y" 2> /dev/null ) calendar_size=$( f_dialog_calendar_size \ "$DIALOG_TITLE" \ "$DIALOG_BACKTITLE" \ @@ -654,7 +654,7 @@ f_dialog_input_change() _input_time= [ "$secs" ] && _input_time=$( date -j \ - -f %s -- "$_input" "+%H %M %S" 2>&- ) + -f %s -- "$_input" "+%H %M %S" 2> /dev/null ) timebox_size=$( f_dialog_timebox_size \ "$DIALOG_TITLE" \ "$DIALOG_BACKTITLE" \ @@ -682,7 +682,7 @@ f_dialog_input_change() _input=$( date \ -j -f "%d/%m/%Y %T" \ -- "$ret_date $ret_time" \ - +%s 2>&- ) + +%s 2> /dev/null ) f_dprintf "_input=[$_input]" break ;; @@ -852,7 +852,7 @@ f_dialog_input_expire() local secs="$_input" { f_isinteger "$secs" && [ $secs -gt 0 ]; } || secs= _input_date=$( date -j -f "%s" -- "$secs" \ - "+%d %m %Y" 2>&- ) + "+%d %m %Y" 2> /dev/null ) calendar_size=$( f_dialog_calendar_size \ "$DIALOG_TITLE" \ "$DIALOG_BACKTITLE" \ @@ -879,7 +879,7 @@ f_dialog_input_expire() _input_time= [ "$secs" ] && _input_time=$( date -j \ - -f %s -- "$_input" "+%H %M %S" 2>&- ) + -f %s -- "$_input" "+%H %M %S" 2> /dev/null ) timebox_size=$( f_dialog_timebox_size \ "$DIALOG_TITLE" \ "$DIALOG_BACKTITLE" \ @@ -906,7 +906,7 @@ f_dialog_input_expire() _input=$( date \ -j -f "%d/%m/%Y %T" \ -- "$ret_date $ret_time" \ - +%s 2>&- ) + +%s 2> /dev/null ) f_dprintf "_input=[$_input]" break ;; From owner-svn-src-all@FreeBSD.ORG Fri Sep 21 19:18:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 33B34106564A; Fri, 21 Sep 2012 19:18:40 +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 1F3068FC0A; Fri, 21 Sep 2012 19:18:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8LJIddF090450; Fri, 21 Sep 2012 19:18:39 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8LJIdwG090448; Fri, 21 Sep 2012 19:18:39 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201209211918.q8LJIdwG090448@svn.freebsd.org> From: Rui Paulo Date: Fri, 21 Sep 2012 19:18:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240784 - head/sys/contrib/altq/altq X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Sep 2012 19:18:40 -0000 Author: rpaulo Date: Fri Sep 21 19:18:39 2012 New Revision: 240784 URL: http://svn.freebsd.org/changeset/base/240784 Log: Remove #ident macro. -This line, and those below, will be ignored-- > Description of fields to fill in above: 76 columns --| > PR: If a GNATS PR is affected by the change. > Submitted by: If someone else sent in the change. > Reviewed by: If someone else reviewed your modification. > Approved by: If you needed approval for this commit. > Obtained from: If the change is from a third party. > MFC after: N [day[s]|week[s]|month[s]]. Request a reminder email. > Security: Vulnerability reference (one per line) or description. > Empty fields above will be automatically removed. M altq/altq/altq_rmclass.c Modified: head/sys/contrib/altq/altq/altq_rmclass.c Modified: head/sys/contrib/altq/altq/altq_rmclass.c ============================================================================== --- head/sys/contrib/altq/altq/altq_rmclass.c Fri Sep 21 19:03:25 2012 (r240783) +++ head/sys/contrib/altq/altq/altq_rmclass.c Fri Sep 21 19:18:39 2012 (r240784) @@ -35,10 +35,9 @@ * * LBL code modified by speer@eng.sun.com, May 1977. * For questions and/or comments, please send mail to cbq@ee.lbl.gov + * + * @(#)rm_class.c 1.48 97/12/05 SMI */ - -#ident "@(#)rm_class.c 1.48 97/12/05 SMI" - #if defined(__FreeBSD__) || defined(__NetBSD__) #include "opt_altq.h" #include "opt_inet.h" From owner-svn-src-all@FreeBSD.ORG Fri Sep 21 20:10:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A435D106566B for ; Fri, 21 Sep 2012 20:10:45 +0000 (UTC) (envelope-from mcdouga9@egr.msu.edu) Received: from mail.egr.msu.edu (hill.egr.msu.edu [35.9.37.162]) by mx1.freebsd.org (Postfix) with ESMTP id 654A58FC0A for ; Fri, 21 Sep 2012 20:10:45 +0000 (UTC) Received: from hill (localhost [127.0.0.1]) by mail.egr.msu.edu (Postfix) with ESMTP id 9A38C7EFFD for ; Fri, 21 Sep 2012 16:10:44 -0400 (EDT) X-Virus-Scanned: amavisd-new at egr.msu.edu Received: from mail.egr.msu.edu ([127.0.0.1]) by hill (hill.egr.msu.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id C0ZPhkYdTEja for ; Fri, 21 Sep 2012 16:10:44 -0400 (EDT) Received: from EGR authenticated sender Message-ID: <505CC9C4.2010108@egr.msu.edu> Date: Fri, 21 Sep 2012 16:10:44 -0400 From: Adam McDougall User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:15.0) Gecko/20120910 Thunderbird/15.0.1 MIME-Version: 1.0 To: svn-src-all@freebsd.org References: <201209161102.q8GB2Mbw068597@svn.freebsd.org> In-Reply-To: <201209161102.q8GB2Mbw068597@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: svn commit: r240558 - in releng/9.1: sbin/geom/class/raid sys/geom/raid X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Sep 2012 20:10:45 -0000 Could someone add similar sysctls for gmirror and ideally all other geom modules that do similar tasting? To summarize why, it is EXTREMELY frustrating to try fighting geom in efforts to stop and clear a label when it keeps coming back before you can clear it on a live system. Example from 9.1 built today: # gmirror stop swap GEOM_MIRROR: Device swap: provider mirror/swap destroyed. GEOM_MIRROR: Device swap destroyed. GEOM_MIRROR: Device mirror/swap launched (1/1). # gmirror stop swap GEOM_MIRROR: Device swap: provider mirror/swap destroyed. GEOM_MIRROR: Device swap destroyed. GEOM_MIRROR: Device mirror/swap launched (1/1). # gmirror stop swap GEOM_MIRROR: Device swap: provider mirror/swap destroyed. GEOM_MIRROR: Device swap destroyed. GEOM_MIRROR: Device mirror/swap launched (1/1). (currently pulling out hair) On 09/16/12 07:02, Alexander Motin wrote: > Author: mav > Date: Sun Sep 16 11:02:22 2012 > New Revision: 240558 > URL: http://svn.freebsd.org/changeset/base/240558 > > Log: > MFC r240465: > Add global and per-module sysctls/tunables to enable/disable metadata taste. > That should help to handle some cases when disk has some RAID metadata that > should be ignored, especially during boot. > > Approved by: re (kib) > > Modified: > releng/9.1/sbin/geom/class/raid/graid.8 > releng/9.1/sys/geom/raid/g_raid.c > releng/9.1/sys/geom/raid/g_raid.h > releng/9.1/sys/geom/raid/md_ddf.c > releng/9.1/sys/geom/raid/md_intel.c > releng/9.1/sys/geom/raid/md_jmicron.c > releng/9.1/sys/geom/raid/md_nvidia.c > releng/9.1/sys/geom/raid/md_promise.c > releng/9.1/sys/geom/raid/md_sii.c > releng/9.1/sys/geom/raid/tr_concat.c > releng/9.1/sys/geom/raid/tr_raid0.c > releng/9.1/sys/geom/raid/tr_raid1.c > releng/9.1/sys/geom/raid/tr_raid1e.c > releng/9.1/sys/geom/raid/tr_raid5.c > Directory Properties: > releng/9.1/sbin/geom/class/raid/ (props changed) > releng/9.1/sys/ (props changed) > > Modified: releng/9.1/sbin/geom/class/raid/graid.8 > ============================================================================== > --- releng/9.1/sbin/geom/class/raid/graid.8 Sun Sep 16 10:40:17 2012 (r240557) > +++ releng/9.1/sbin/geom/class/raid/graid.8 Sun Sep 16 11:02:22 2012 (r240558) > @@ -24,7 +24,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd May 6, 2012 > +.Dd September 13, 2012 > .Dt GRAID 8 > .Os > .Sh NAME > @@ -293,6 +293,8 @@ Mark volume as clean when idle for the s > Debug level of the > .Nm RAID > GEOM class. > +.It Va kern.geom.raid.enable : No 1 > +Enable on-disk metadata taste. > .It Va kern.geom.raid.idle_threshold : No 1000000 > Time in microseconds to consider a volume idle for rebuild purposes. > .It Va kern.geom.raid.name_format : No 0 > @@ -302,6 +304,8 @@ Number of read errors equated to disk fa > Write errors are always considered as disk failures. > .It Va kern.geom.raid.start_timeout : No 30 > Time to wait for missing array components on startup. > +.It Va kern.geom.raid. Ns Ar X Ns Va .enable : No 1 > +Enable taste for specific metadata or transformation module. > .El > .Sh EXIT STATUS > Exit status is 0 on success, and non-zero if the command fails. > > Modified: releng/9.1/sys/geom/raid/g_raid.c > ============================================================================== > --- releng/9.1/sys/geom/raid/g_raid.c Sun Sep 16 10:40:17 2012 (r240557) > +++ releng/9.1/sys/geom/raid/g_raid.c Sun Sep 16 11:02:22 2012 (r240558) > @@ -52,6 +52,10 @@ static MALLOC_DEFINE(M_RAID, "raid_data" > > SYSCTL_DECL(_kern_geom); > SYSCTL_NODE(_kern_geom, OID_AUTO, raid, CTLFLAG_RW, 0, "GEOM_RAID stuff"); > +int g_raid_enable = 1; > +TUNABLE_INT("kern.geom.raid.enable", &g_raid_enable); > +SYSCTL_INT(_kern_geom_raid, OID_AUTO, enable, CTLFLAG_RW, > + &g_raid_enable, 0, "Enable on-disk metadata taste"); > u_int g_raid_aggressive_spare = 0; > TUNABLE_INT("kern.geom.raid.aggressive_spare", &g_raid_aggressive_spare); > SYSCTL_UINT(_kern_geom_raid, OID_AUTO, aggressive_spare, CTLFLAG_RW, > @@ -1920,6 +1924,8 @@ int g_raid_start_volume(struct g_raid_vo > > G_RAID_DEBUG1(2, vol->v_softc, "Starting volume %s.", vol->v_name); > LIST_FOREACH(class, &g_raid_tr_classes, trc_list) { > + if (!class->trc_enable) > + continue; > G_RAID_DEBUG1(2, vol->v_softc, > "Tasting volume %s for %s transformation.", > vol->v_name, class->name); > @@ -2142,6 +2148,8 @@ g_raid_taste(struct g_class *mp, struct > > g_topology_assert(); > g_trace(G_T_TOPOLOGY, "%s(%s, %s)", __func__, mp->name, pp->name); > + if (!g_raid_enable) > + return (NULL); > G_RAID_DEBUG(2, "Tasting provider %s.", pp->name); > > gp = g_new_geomf(mp, "raid:taste"); > @@ -2154,6 +2162,8 @@ g_raid_taste(struct g_class *mp, struct > > geom = NULL; > LIST_FOREACH(class, &g_raid_md_classes, mdc_list) { > + if (!class->mdc_enable) > + continue; > G_RAID_DEBUG(2, "Tasting provider %s for %s metadata.", > pp->name, class->name); > obj = (void *)kobj_create((kobj_class_t)class, M_RAID, > > Modified: releng/9.1/sys/geom/raid/g_raid.h > ============================================================================== > --- releng/9.1/sys/geom/raid/g_raid.h Sun Sep 16 10:40:17 2012 (r240557) > +++ releng/9.1/sys/geom/raid/g_raid.h Sun Sep 16 11:02:22 2012 (r240558) > @@ -33,6 +33,9 @@ > #include > #include > #include > +#ifdef _KERNEL > +#include > +#endif > > #define G_RAID_CLASS_NAME "RAID" > > @@ -51,6 +54,7 @@ struct g_raid_tr_object; > #ifdef _KERNEL > extern u_int g_raid_aggressive_spare; > extern u_int g_raid_debug; > +extern int g_raid_enable; > extern int g_raid_read_err_thresh; > extern u_int g_raid_start_timeout; > extern struct g_class g_raid_class; > @@ -322,11 +326,14 @@ struct g_raid_softc { > }; > #define sc_name sc_geom->name > > +SYSCTL_DECL(_kern_geom_raid); > + > /* > * KOBJ parent class of metadata processing modules. > */ > struct g_raid_md_class { > KOBJ_CLASS_FIELDS; > + int mdc_enable; > int mdc_priority; > LIST_ENTRY(g_raid_md_class) mdc_list; > }; > @@ -342,20 +349,29 @@ struct g_raid_md_object { > > int g_raid_md_modevent(module_t, int, void *); > > -#define G_RAID_MD_DECLARE(name) \ > - static moduledata_t name##_mod = { \ > - #name, \ > +#define G_RAID_MD_DECLARE(name, label) \ > + static moduledata_t g_raid_md_##name##_mod = { \ > + "g_raid_md_" __XSTRING(name), \ > g_raid_md_modevent, \ > - &name##_class \ > + &g_raid_md_##name##_class \ > }; \ > - DECLARE_MODULE(name, name##_mod, SI_SUB_DRIVERS, SI_ORDER_SECOND); \ > - MODULE_DEPEND(name, geom_raid, 0, 0, 0) > + DECLARE_MODULE(g_raid_md_##name, g_raid_md_##name##_mod, \ > + SI_SUB_DRIVERS, SI_ORDER_SECOND); \ > + MODULE_DEPEND(g_raid_md_##name, geom_raid, 0, 0, 0); \ > + SYSCTL_NODE(_kern_geom_raid, OID_AUTO, name, CTLFLAG_RD, \ > + NULL, label " metadata module"); \ > + SYSCTL_INT(_kern_geom_raid_##name, OID_AUTO, enable, \ > + CTLFLAG_RW, &g_raid_md_##name##_class.mdc_enable, 0, \ > + "Enable " label " metadata format taste"); \ > + TUNABLE_INT("kern.geom.raid." __XSTRING(name) ".enable", \ > + &g_raid_md_##name##_class.mdc_enable) > > /* > * KOBJ parent class of data transformation modules. > */ > struct g_raid_tr_class { > KOBJ_CLASS_FIELDS; > + int trc_enable; > int trc_priority; > LIST_ENTRY(g_raid_tr_class) trc_list; > }; > @@ -371,14 +387,22 @@ struct g_raid_tr_object { > > int g_raid_tr_modevent(module_t, int, void *); > > -#define G_RAID_TR_DECLARE(name) \ > - static moduledata_t name##_mod = { \ > - #name, \ > +#define G_RAID_TR_DECLARE(name, label) \ > + static moduledata_t g_raid_tr_##name##_mod = { \ > + "g_raid_tr_" __XSTRING(name), \ > g_raid_tr_modevent, \ > - &name##_class \ > + &g_raid_tr_##name##_class \ > }; \ > - DECLARE_MODULE(name, name##_mod, SI_SUB_DRIVERS, SI_ORDER_FIRST); \ > - MODULE_DEPEND(name, geom_raid, 0, 0, 0) > + DECLARE_MODULE(g_raid_tr_##name, g_raid_tr_##name##_mod, \ > + SI_SUB_DRIVERS, SI_ORDER_FIRST); \ > + MODULE_DEPEND(g_raid_tr_##name, geom_raid, 0, 0, 0); \ > + SYSCTL_NODE(_kern_geom_raid, OID_AUTO, name, CTLFLAG_RD, \ > + NULL, label " transformation module"); \ > + SYSCTL_INT(_kern_geom_raid_##name, OID_AUTO, enable, \ > + CTLFLAG_RW, &g_raid_tr_##name##_class.trc_enable, 0, \ > + "Enable " label " transformation module taste"); \ > + TUNABLE_INT("kern.geom.raid." __XSTRING(name) ".enable", \ > + &g_raid_tr_##name##_class.trc_enable) > > const char * g_raid_volume_level2str(int level, int qual); > int g_raid_volume_str2level(const char *str, int *level, int *qual); > > Modified: releng/9.1/sys/geom/raid/md_ddf.c > ============================================================================== > --- releng/9.1/sys/geom/raid/md_ddf.c Sun Sep 16 10:40:17 2012 (r240557) > +++ releng/9.1/sys/geom/raid/md_ddf.c Sun Sep 16 11:02:22 2012 (r240558) > @@ -125,6 +125,7 @@ static struct g_raid_md_class g_raid_md_ > "DDF", > g_raid_md_ddf_methods, > sizeof(struct g_raid_md_ddf_object), > + .mdc_enable = 1, > .mdc_priority = 100 > }; > > @@ -3065,4 +3066,4 @@ g_raid_md_free_ddf(struct g_raid_md_obje > return (0); > } > > -G_RAID_MD_DECLARE(g_raid_md_ddf); > +G_RAID_MD_DECLARE(ddf, "DDF"); > > Modified: releng/9.1/sys/geom/raid/md_intel.c > ============================================================================== > --- releng/9.1/sys/geom/raid/md_intel.c Sun Sep 16 10:40:17 2012 (r240557) > +++ releng/9.1/sys/geom/raid/md_intel.c Sun Sep 16 11:02:22 2012 (r240558) > @@ -224,6 +224,7 @@ static struct g_raid_md_class g_raid_md_ > "Intel", > g_raid_md_intel_methods, > sizeof(struct g_raid_md_intel_object), > + .mdc_enable = 1, > .mdc_priority = 100 > }; > > @@ -2432,4 +2433,4 @@ g_raid_md_free_intel(struct g_raid_md_ob > return (0); > } > > -G_RAID_MD_DECLARE(g_raid_md_intel); > +G_RAID_MD_DECLARE(intel, "Intel"); > > Modified: releng/9.1/sys/geom/raid/md_jmicron.c > ============================================================================== > --- releng/9.1/sys/geom/raid/md_jmicron.c Sun Sep 16 10:40:17 2012 (r240557) > +++ releng/9.1/sys/geom/raid/md_jmicron.c Sun Sep 16 11:02:22 2012 (r240558) > @@ -132,6 +132,7 @@ static struct g_raid_md_class g_raid_md_ > "JMicron", > g_raid_md_jmicron_methods, > sizeof(struct g_raid_md_jmicron_object), > + .mdc_enable = 1, > .mdc_priority = 100 > }; > > @@ -1581,4 +1582,4 @@ g_raid_md_free_jmicron(struct g_raid_md_ > return (0); > } > > -G_RAID_MD_DECLARE(g_raid_md_jmicron); > +G_RAID_MD_DECLARE(jmicron, "JMicron"); > > Modified: releng/9.1/sys/geom/raid/md_nvidia.c > ============================================================================== > --- releng/9.1/sys/geom/raid/md_nvidia.c Sun Sep 16 10:40:17 2012 (r240557) > +++ releng/9.1/sys/geom/raid/md_nvidia.c Sun Sep 16 11:02:22 2012 (r240558) > @@ -143,6 +143,7 @@ static struct g_raid_md_class g_raid_md_ > "NVIDIA", > g_raid_md_nvidia_methods, > sizeof(struct g_raid_md_nvidia_object), > + .mdc_enable = 1, > .mdc_priority = 100 > }; > > @@ -1600,4 +1601,4 @@ g_raid_md_free_nvidia(struct g_raid_md_o > return (0); > } > > -G_RAID_MD_DECLARE(g_raid_md_nvidia); > +G_RAID_MD_DECLARE(nvidia, "NVIDIA"); > > Modified: releng/9.1/sys/geom/raid/md_promise.c > ============================================================================== > --- releng/9.1/sys/geom/raid/md_promise.c Sun Sep 16 10:40:17 2012 (r240557) > +++ releng/9.1/sys/geom/raid/md_promise.c Sun Sep 16 11:02:22 2012 (r240558) > @@ -171,6 +171,7 @@ static struct g_raid_md_class g_raid_md_ > "Promise", > g_raid_md_promise_methods, > sizeof(struct g_raid_md_object), > + .mdc_enable = 1, > .mdc_priority = 100 > }; > > @@ -1967,4 +1968,4 @@ g_raid_md_free_promise(struct g_raid_md_ > return (0); > } > > -G_RAID_MD_DECLARE(g_raid_md_promise); > +G_RAID_MD_DECLARE(promise, "Promise"); > > Modified: releng/9.1/sys/geom/raid/md_sii.c > ============================================================================== > --- releng/9.1/sys/geom/raid/md_sii.c Sun Sep 16 10:40:17 2012 (r240557) > +++ releng/9.1/sys/geom/raid/md_sii.c Sun Sep 16 11:02:22 2012 (r240558) > @@ -140,6 +140,7 @@ static struct g_raid_md_class g_raid_md_ > "SiI", > g_raid_md_sii_methods, > sizeof(struct g_raid_md_sii_object), > + .mdc_enable = 1, > .mdc_priority = 100 > }; > > @@ -1688,4 +1689,4 @@ g_raid_md_free_sii(struct g_raid_md_obje > return (0); > } > > -G_RAID_MD_DECLARE(g_raid_md_sii); > +G_RAID_MD_DECLARE(sii, "SiI"); > > Modified: releng/9.1/sys/geom/raid/tr_concat.c > ============================================================================== > --- releng/9.1/sys/geom/raid/tr_concat.c Sun Sep 16 10:40:17 2012 (r240557) > +++ releng/9.1/sys/geom/raid/tr_concat.c Sun Sep 16 11:02:22 2012 (r240558) > @@ -73,6 +73,7 @@ static struct g_raid_tr_class g_raid_tr_ > "CONCAT", > g_raid_tr_concat_methods, > sizeof(struct g_raid_tr_concat_object), > + .trc_enable = 1, > .trc_priority = 50 > }; > > @@ -340,4 +341,4 @@ g_raid_tr_free_concat(struct g_raid_tr_o > return (0); > } > > -G_RAID_TR_DECLARE(g_raid_tr_concat); > +G_RAID_TR_DECLARE(concat, "CONCAT"); > > Modified: releng/9.1/sys/geom/raid/tr_raid0.c > ============================================================================== > --- releng/9.1/sys/geom/raid/tr_raid0.c Sun Sep 16 10:40:17 2012 (r240557) > +++ releng/9.1/sys/geom/raid/tr_raid0.c Sun Sep 16 11:02:22 2012 (r240558) > @@ -73,6 +73,7 @@ static struct g_raid_tr_class g_raid_tr_ > "RAID0", > g_raid_tr_raid0_methods, > sizeof(struct g_raid_tr_raid0_object), > + .trc_enable = 1, > .trc_priority = 100 > }; > > @@ -323,4 +324,4 @@ g_raid_tr_free_raid0(struct g_raid_tr_ob > return (0); > } > > -G_RAID_TR_DECLARE(g_raid_tr_raid0); > +G_RAID_TR_DECLARE(raid0, "RAID0"); > > Modified: releng/9.1/sys/geom/raid/tr_raid1.c > ============================================================================== > --- releng/9.1/sys/geom/raid/tr_raid1.c Sun Sep 16 10:40:17 2012 (r240557) > +++ releng/9.1/sys/geom/raid/tr_raid1.c Sun Sep 16 11:02:22 2012 (r240558) > @@ -42,9 +42,7 @@ __FBSDID("$FreeBSD$"); > #include "geom/raid/g_raid.h" > #include "g_raid_tr_if.h" > > -SYSCTL_DECL(_kern_geom_raid); > -SYSCTL_NODE(_kern_geom_raid, OID_AUTO, raid1, CTLFLAG_RW, 0, > - "RAID1 parameters"); > +SYSCTL_DECL(_kern_geom_raid_raid1); > > #define RAID1_REBUILD_SLAB (1 << 20) /* One transation in a rebuild */ > static int g_raid1_rebuild_slab = RAID1_REBUILD_SLAB; > @@ -131,6 +129,7 @@ static struct g_raid_tr_class g_raid_tr_ > "RAID1", > g_raid_tr_raid1_methods, > sizeof(struct g_raid_tr_raid1_object), > + .trc_enable = 1, > .trc_priority = 100 > }; > > @@ -996,4 +995,4 @@ g_raid_tr_free_raid1(struct g_raid_tr_ob > return (0); > } > > -G_RAID_TR_DECLARE(g_raid_tr_raid1); > +G_RAID_TR_DECLARE(raid1, "RAID1"); > > Modified: releng/9.1/sys/geom/raid/tr_raid1e.c > ============================================================================== > --- releng/9.1/sys/geom/raid/tr_raid1e.c Sun Sep 16 10:40:17 2012 (r240557) > +++ releng/9.1/sys/geom/raid/tr_raid1e.c Sun Sep 16 11:02:22 2012 (r240558) > @@ -44,9 +44,7 @@ __FBSDID("$FreeBSD$"); > > #define N 2 > > -SYSCTL_DECL(_kern_geom_raid); > -SYSCTL_NODE(_kern_geom_raid, OID_AUTO, raid1e, CTLFLAG_RW, 0, > - "RAID1E parameters"); > +SYSCTL_DECL(_kern_geom_raid_raid1e); > > #define RAID1E_REBUILD_SLAB (1 << 20) /* One transation in a rebuild */ > static int g_raid1e_rebuild_slab = RAID1E_REBUILD_SLAB; > @@ -135,6 +133,7 @@ static struct g_raid_tr_class g_raid_tr_ > "RAID1E", > g_raid_tr_raid1e_methods, > sizeof(struct g_raid_tr_raid1e_object), > + .trc_enable = 1, > .trc_priority = 200 > }; > > @@ -1236,4 +1235,4 @@ g_raid_tr_free_raid1e(struct g_raid_tr_o > return (0); > } > > -G_RAID_TR_DECLARE(g_raid_tr_raid1e); > +G_RAID_TR_DECLARE(raid1e, "RAID1E"); > > Modified: releng/9.1/sys/geom/raid/tr_raid5.c > ============================================================================== > --- releng/9.1/sys/geom/raid/tr_raid5.c Sun Sep 16 10:40:17 2012 (r240557) > +++ releng/9.1/sys/geom/raid/tr_raid5.c Sun Sep 16 11:02:22 2012 (r240558) > @@ -42,8 +42,6 @@ __FBSDID("$FreeBSD$"); > #include "geom/raid/g_raid.h" > #include "g_raid_tr_if.h" > > -SYSCTL_DECL(_kern_geom_raid); > - > static MALLOC_DEFINE(M_TR_RAID5, "tr_raid5_data", "GEOM_RAID RAID5 data"); > > #define TR_RAID5_NONE 0 > @@ -95,6 +93,7 @@ static struct g_raid_tr_class g_raid_tr_ > "RAID5", > g_raid_tr_raid5_methods, > sizeof(struct g_raid_tr_raid5_object), > + .trc_enable = 1, > .trc_priority = 100 > }; > > @@ -419,4 +418,4 @@ g_raid_tr_free_raid5(struct g_raid_tr_ob > return (0); > } > > -G_RAID_TR_DECLARE(g_raid_tr_raid5); > +G_RAID_TR_DECLARE(raid5, "RAID5"); > _______________________________________________ > svn-src-all@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" > From owner-svn-src-all@FreeBSD.ORG Fri Sep 21 21:27:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5EE831065672; Fri, 21 Sep 2012 21:27:58 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4A7AC8FC17; Fri, 21 Sep 2012 21:27:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8LLRvCi012192; Fri, 21 Sep 2012 21:27:58 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8LLRvXP012190; Fri, 21 Sep 2012 21:27:57 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201209212127.q8LLRvXP012190@svn.freebsd.org> From: Andreas Tobler Date: Fri, 21 Sep 2012 21:27:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240793 - head/sys/powerpc/ofw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Sep 2012 21:27:58 -0000 Author: andreast Date: Fri Sep 21 21:27:57 2012 New Revision: 240793 URL: http://svn.freebsd.org/changeset/base/240793 Log: Remove leftover from r215163. Modified: head/sys/powerpc/ofw/ofw_real.c Modified: head/sys/powerpc/ofw/ofw_real.c ============================================================================== --- head/sys/powerpc/ofw/ofw_real.c Fri Sep 21 20:59:22 2012 (r240792) +++ head/sys/powerpc/ofw/ofw_real.c Fri Sep 21 21:27:57 2012 (r240793) @@ -170,7 +170,6 @@ static size_t of_bounce_size; static struct mtx of_bounce_mtx; extern int ofw_real_mode; -extern struct pmap ofw_pmap; /* * After the VM is up, allocate a wired, low memory bounce page. From owner-svn-src-all@FreeBSD.ORG Sat Sep 22 03:11:35 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D812D106564A; Sat, 22 Sep 2012 03:11:35 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C242B8FC08; Sat, 22 Sep 2012 03:11:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8M3BZWk071126; Sat, 22 Sep 2012 03:11:35 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8M3BZn5071121; Sat, 22 Sep 2012 03:11:35 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201209220311.q8M3BZn5071121@svn.freebsd.org> From: Devin Teske Date: Sat, 22 Sep 2012 03:11:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240797 - in head/usr.sbin/bsdconfig: include share startup/share X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Sep 2012 03:11:36 -0000 Author: dteske Date: Sat Sep 22 03:11:35 2012 New Revision: 240797 URL: http://svn.freebsd.org/changeset/base/240797 Log: Spelling and whitespace corrections. Reviewed by: adrian (co-mentor) Approved by: adrian (co-mentor) Modified: head/usr.sbin/bsdconfig/include/messages.subr head/usr.sbin/bsdconfig/share/common.subr head/usr.sbin/bsdconfig/share/sysrc.subr head/usr.sbin/bsdconfig/startup/share/rcconf.subr Modified: head/usr.sbin/bsdconfig/include/messages.subr ============================================================================== --- head/usr.sbin/bsdconfig/include/messages.subr Fri Sep 21 22:07:46 2012 (r240796) +++ head/usr.sbin/bsdconfig/include/messages.subr Sat Sep 22 03:11:35 2012 (r240797) @@ -44,7 +44,7 @@ msg_no_such_file_or_directory="%s: %s: N msg_no_username="No username provided!" msg_not_found="not found" msg_ok="OK" -msg_permission_denied="%s: %s: permission denied" +msg_permission_denied="%s: %s: Permission denied" msg_please_enter_password="Please enter your password for sudo(8):" msg_please_enter_username_password="Please enter a username and password for sudo(8):" msg_previous_syntax_errors="%s: Not overwriting \`%s' due to previous syntax errors" Modified: head/usr.sbin/bsdconfig/share/common.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/common.subr Fri Sep 21 22:07:46 2012 (r240796) +++ head/usr.sbin/bsdconfig/share/common.subr Sat Sep 22 03:11:35 2012 (r240797) @@ -63,12 +63,12 @@ f_dprintf() # f_err() { - printf "$@" >&2 + printf "$@" >&2 } # f_quietly $command [ $arguments ... ] # -# run a command quietly (quell any output to stdout or stderr) +# Run a command quietly (quell any output to stdout or stderr) # f_quietly() { @@ -76,7 +76,7 @@ f_quietly() } # f_have $anything ... -# +# # A wrapper to the `type' built-in. Returns true if argument is a valid shell # built-in, keyword, or externally-tracked binary, otherwise false. # Modified: head/usr.sbin/bsdconfig/share/sysrc.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/sysrc.subr Fri Sep 21 22:07:46 2012 (r240796) +++ head/usr.sbin/bsdconfig/share/sysrc.subr Sat Sep 22 03:11:35 2012 (r240797) @@ -17,7 +17,7 @@ if [ ! "$_SYSRC_SUBR" ]; then _SYSRC_SUB # 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 (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# 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 @@ -166,7 +166,7 @@ f_sysrc_get() # # If the query was for `rc_conf_files' AND after calling - # source_rc_confs the vaue has not changed, then we should + # source_rc_confs the value has not changed, then we should # restore the value to the one inherited from RC_DEFAULTS # before performing the final query (preventing us from # returning what was set via RC_CONFS when the intent was Modified: head/usr.sbin/bsdconfig/startup/share/rcconf.subr ============================================================================== --- head/usr.sbin/bsdconfig/startup/share/rcconf.subr Fri Sep 21 22:07:46 2012 (r240796) +++ head/usr.sbin/bsdconfig/startup/share/rcconf.subr Sat Sep 22 03:11:35 2012 (r240797) @@ -113,8 +113,8 @@ f_startup_rcconf_map() # # Calculate digest used to determine if the on-disk global persistant - # cache file (containg this digest on the first line) is valid and can - # be used to quickly populate the cache value for immediate return. + # cache file (containing this digest on the first line) is valid and + # can be used to quickly populate the cache value for immediate return. # local rc_defaults_digest rc_defaults_digest=$( md5 < "$RC_DEFAULTS" ) From owner-svn-src-all@FreeBSD.ORG Sat Sep 22 04:04:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B171106564A; Sat, 22 Sep 2012 04:04:03 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 156BA8FC0A; Sat, 22 Sep 2012 04:04:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8M442MT080309; Sat, 22 Sep 2012 04:04:02 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8M442gF080303; Sat, 22 Sep 2012 04:04:02 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201209220404.q8M442gF080303@svn.freebsd.org> From: Devin Teske Date: Sat, 22 Sep 2012 04:04:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240798 - in head/usr.sbin/bsdconfig: share startup X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Sep 2012 04:04:03 -0000 Author: dteske Date: Sat Sep 22 04:04:02 2012 New Revision: 240798 URL: http://svn.freebsd.org/changeset/base/240798 Log: Replace "( : ${var?} )" syntax with better "[ ${var+set} ]" syntax. Reviewed by: jilles, adrian (co-mentor) Approved by: jilles, adrian (co-mentor) Modified: head/usr.sbin/bsdconfig/share/sysrc.subr head/usr.sbin/bsdconfig/startup/rcadd head/usr.sbin/bsdconfig/startup/rcconf head/usr.sbin/bsdconfig/startup/rcdelete head/usr.sbin/bsdconfig/startup/rcvar Modified: head/usr.sbin/bsdconfig/share/sysrc.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/sysrc.subr Sat Sep 22 03:11:35 2012 (r240797) +++ head/usr.sbin/bsdconfig/share/sysrc.subr Sat Sep 22 04:04:02 2012 (r240798) @@ -132,7 +132,7 @@ f_sysrc_get() # Clear the environment of all variables, preventing the # expansion of normals such as `PS1', `TERM', etc. # - f_clean_env --except RC_CONFS RC_DEFAULTS SUCCESS + f_clean_env --except RC_CONFS RC_DEFAULTS . "$RC_DEFAULTS" > /dev/null 2>&1 @@ -153,15 +153,11 @@ f_sysrc_get() # If RC_CONFS is defined, set $rc_conf_files to an explicit # value, modifying the default behavior of source_rc_confs(). # - ( : ${RC_CONFS?} ) > /dev/null 2>&1 - if [ $? -eq ${SUCCESS:-0} ]; then + if [ "${RC_CONFS+set}" ]; then rc_conf_files="$RC_CONFS" _rc_confs_set=1 fi - unset SUCCESS - # no longer needed - source_rc_confs > /dev/null 2>&1 # Modified: head/usr.sbin/bsdconfig/startup/rcadd ============================================================================== --- head/usr.sbin/bsdconfig/startup/rcadd Sat Sep 22 03:11:35 2012 (r240797) +++ head/usr.sbin/bsdconfig/startup/rcadd Sat Sep 22 04:04:02 2012 (r240798) @@ -46,7 +46,7 @@ ipgm=$( f_index_menu_selection $BSDCFG_L # Options # # Inherit SHOW_DESC value if set, otherwise default to 1 -( : ${SHOW_DESC?} ) > /dev/null 2>&1 || SHOW_DESC=1 +[ "${SHOW_DESC+set}" ] || SHOW_DESC=1 ############################################################ FUNCTIONS Modified: head/usr.sbin/bsdconfig/startup/rcconf ============================================================================== --- head/usr.sbin/bsdconfig/startup/rcconf Sat Sep 22 03:11:35 2012 (r240797) +++ head/usr.sbin/bsdconfig/startup/rcconf Sat Sep 22 04:04:02 2012 (r240798) @@ -54,7 +54,7 @@ RCCONF_MENU_LIST= # Options # # Inherit SHOW_DESC value if set, otherwise default to 1 -( : ${SHOW_DESC?} ) > /dev/null 2>&1 || SHOW_DESC=1 +[ "${SHOW_DESC+set}" ] || SHOW_DESC=1 # Selectively inherit SHOW_* value (in order of preference) if [ "$SHOW_DEFAULT_VALUE" ]; then SHOW_DEFAULT_VALUE=1 Modified: head/usr.sbin/bsdconfig/startup/rcdelete ============================================================================== --- head/usr.sbin/bsdconfig/startup/rcdelete Sat Sep 22 03:11:35 2012 (r240797) +++ head/usr.sbin/bsdconfig/startup/rcdelete Sat Sep 22 04:04:02 2012 (r240798) @@ -54,7 +54,7 @@ RCCONF_MENU_LIST= # Options # # Inherit SHOW_DESC value if set, otherwise default to 1 -( : ${SHOW_DESC?} ) > /dev/null 2>&1 || SHOW_DESC=1 +[ "${SHOW_DESC+set}" ] || SHOW_DESC=1 # Selectively inherit SHOW_* value (in order of preference) if [ "$SHOW_DEFAULT_VALUE" ]; then SHOW_DEFAULT_VALUE=1 @@ -348,7 +348,7 @@ while :; do var="${mtag# }" # Toggle the state-variable and loop back to menu - if ( eval : \${_${var}_delete?} ) > /dev/null 2>&1; then + if eval [ \"\${_${var}_delete+set}\" ]; then unset _${var}_delete else setvar _${var}_delete 1 Modified: head/usr.sbin/bsdconfig/startup/rcvar ============================================================================== --- head/usr.sbin/bsdconfig/startup/rcvar Sat Sep 22 03:11:35 2012 (r240797) +++ head/usr.sbin/bsdconfig/startup/rcvar Sat Sep 22 04:04:02 2012 (r240798) @@ -54,7 +54,7 @@ RCVAR_MENU_LIST= # Options # # Inherit SHOW_DESC value if set, otherwise default to 1 -( ${SHOW_DESC?} ) > /dev/null 2>&1 || SHOW_DESC=1 +[ "${SHOW_DESC+set}" ] || SHOW_DESC=1 ############################################################ FUNCTIONS From owner-svn-src-all@FreeBSD.ORG Sat Sep 22 04:18:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D5DF4106566B; Sat, 22 Sep 2012 04:18:43 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BE8DF8FC0A; Sat, 22 Sep 2012 04:18:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8M4Ih6d083083; Sat, 22 Sep 2012 04:18:43 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8M4Ihkl083067; Sat, 22 Sep 2012 04:18:43 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201209220418.q8M4Ihkl083067@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sat, 22 Sep 2012 04:18:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240799 - in stable/9: include/rpc lib/libc/rpc sys/rpc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Sep 2012 04:18:44 -0000 Author: pfg Date: Sat Sep 22 04:18:42 2012 New Revision: 240799 URL: http://svn.freebsd.org/changeset/base/240799 Log: MFC r239963: Bring some changes from Bull's NFSv4 libtirpc implementation. ____ Fixed infinite loop in svc_run() ____ __rpc_taddr2uaddr_af() assumes the netbuf to always have a non-zero data. This is a bad assumption and can lead to a seg-fault. This patch adds a check for zero length and returns NULL when found. ____ Changed clnt_spcreateerror() to return clearer and more concise error messages. ____ Converted all uid and gid variables of the type uid_t and gid_t. ____ libtirpc: set r_netid and r_owner in __rpcb_findaddr_timed These fields in the rpcbind GETADDR call are being passed uninitialized to CLNT_CALL. In the case of x86_64 at least, this usually leads to a segfault. On x86, it sometimes causes segfaults and other times causes garbage to be sent on the wire. rpcbind generally ignores the r_owner field for calls that come in over the wire, so it really doesn't matter what we send in that slot. We just need to send something. The reference implementation from Sun seems to send a blank string. Have ours follow suit. ____ libtirpc: be sure to free cl_netid and cl_tp When creating a client with clnt_tli_create, it uses strdup to copy strings for these fields if nconf is passed in. clnt_dg_destroy frees these strings already. Make sure clnt_vc_destroy frees them in the same way. ____ Obtained from: Bull GNU/Linux NFSv4 Project Modified: stable/9/include/rpc/auth.h stable/9/include/rpc/auth_unix.h stable/9/lib/libc/rpc/auth_unix.c stable/9/lib/libc/rpc/authunix_prot.c stable/9/lib/libc/rpc/clnt_perror.c stable/9/lib/libc/rpc/clnt_vc.c stable/9/lib/libc/rpc/rpc_generic.c stable/9/lib/libc/rpc/rpc_soc.3 stable/9/lib/libc/rpc/rpcb_clnt.c stable/9/lib/libc/rpc/svc_auth_unix.c stable/9/lib/libc/rpc/svc_run.c stable/9/sys/rpc/auth.h stable/9/sys/rpc/clnt_vc.c stable/9/sys/rpc/rpcb_clnt.c Directory Properties: stable/9/include/ (props changed) stable/9/lib/ (props changed) stable/9/lib/libc/ (props changed) Modified: stable/9/include/rpc/auth.h ============================================================================== --- stable/9/include/rpc/auth.h Sat Sep 22 04:04:02 2012 (r240798) +++ stable/9/include/rpc/auth.h Sat Sep 22 04:18:42 2012 (r240799) @@ -243,14 +243,13 @@ __END_DECLS * System style authentication * AUTH *authunix_create(machname, uid, gid, len, aup_gids) * char *machname; - * int uid; - * int gid; + * uid_t uid; + * gid_t gid; * int len; - * int *aup_gids; + * gid_t *aup_gids; */ __BEGIN_DECLS -extern AUTH *authunix_create(char *, int, int, int, - int *); +extern AUTH *authunix_create(char *, uid_t, gid_t, int, gid_t *); extern AUTH *authunix_create_default(void); /* takes no parameters */ extern AUTH *authnone_create(void); /* takes no parameters */ __END_DECLS Modified: stable/9/include/rpc/auth_unix.h ============================================================================== --- stable/9/include/rpc/auth_unix.h Sat Sep 22 04:04:02 2012 (r240798) +++ stable/9/include/rpc/auth_unix.h Sat Sep 22 04:18:42 2012 (r240799) @@ -60,10 +60,10 @@ struct authunix_parms { u_long aup_time; char *aup_machname; - int aup_uid; - int aup_gid; + uid_t aup_uid; + gid_t aup_gid; u_int aup_len; - int *aup_gids; + gid_t *aup_gids; }; #define authsys_parms authunix_parms Modified: stable/9/lib/libc/rpc/auth_unix.c ============================================================================== --- stable/9/lib/libc/rpc/auth_unix.c Sat Sep 22 04:04:02 2012 (r240798) +++ stable/9/lib/libc/rpc/auth_unix.c Sat Sep 22 04:18:42 2012 (r240799) @@ -94,10 +94,10 @@ struct audata { AUTH * authunix_create(machname, uid, gid, len, aup_gids) char *machname; - int uid; - int gid; + uid_t uid; + gid_t gid; int len; - int *aup_gids; + gid_t *aup_gids; { struct authunix_parms aup; char mymem[MAX_AUTH_BYTES]; @@ -207,9 +207,7 @@ authunix_create_default() abort(); if (ngids > NGRPS) ngids = NGRPS; - /* XXX: interface problem; those should all have been unsigned */ - auth = authunix_create(machname, (int)uid, (int)gid, ngids, - (int *)gids); + auth = authunix_create(machname, uid, gid, ngids, gids); free(gids); return (auth); } Modified: stable/9/lib/libc/rpc/authunix_prot.c ============================================================================== --- stable/9/lib/libc/rpc/authunix_prot.c Sat Sep 22 04:04:02 2012 (r240798) +++ stable/9/lib/libc/rpc/authunix_prot.c Sat Sep 22 04:18:42 2012 (r240799) @@ -60,7 +60,7 @@ xdr_authunix_parms(xdrs, p) XDR *xdrs; struct authunix_parms *p; { - int **paup_gids; + gid_t **paup_gids; assert(xdrs != NULL); assert(p != NULL); @@ -69,8 +69,8 @@ xdr_authunix_parms(xdrs, p) if (xdr_u_long(xdrs, &(p->aup_time)) && xdr_string(xdrs, &(p->aup_machname), MAX_MACHINE_NAME) - && xdr_int(xdrs, &(p->aup_uid)) - && xdr_int(xdrs, &(p->aup_gid)) + && xdr_u_int(xdrs, &(p->aup_uid)) + && xdr_u_int(xdrs, &(p->aup_gid)) && xdr_array(xdrs, (char **) paup_gids, &(p->aup_len), NGRPS, sizeof(int), (xdrproc_t)xdr_int) ) { return (TRUE); Modified: stable/9/lib/libc/rpc/clnt_perror.c ============================================================================== --- stable/9/lib/libc/rpc/clnt_perror.c Sat Sep 22 04:04:02 2012 (r240798) +++ stable/9/lib/libc/rpc/clnt_perror.c Sat Sep 22 04:18:42 2012 (r240799) @@ -242,7 +242,7 @@ char * clnt_spcreateerror(s) const char *s; { - char *str; + char *str, *err; size_t len, i; assert(s != NULL); @@ -258,8 +258,21 @@ clnt_spcreateerror(s) switch (rpc_createerr.cf_stat) { case RPC_PMAPFAILURE: (void) strncat(str, " - ", len - 1); - (void) strncat(str, - clnt_sperrno(rpc_createerr.cf_error.re_status), len - 4); + err = clnt_sperrno(rpc_createerr.cf_error.re_status); + if (err) + (void) strncat(str, err+5, len-5); + switch(rpc_createerr.cf_error.re_status) { + case RPC_CANTSEND: + case RPC_CANTRECV: + i = strlen(str); + len -= i; + snprintf(str+i, len, ": errno %d (%s)", + rpc_createerr.cf_error.re_errno, + strerror(rpc_createerr.cf_error.re_errno)); + break; + default: + break; + } break; case RPC_SYSTEMERROR: Modified: stable/9/lib/libc/rpc/clnt_vc.c ============================================================================== --- stable/9/lib/libc/rpc/clnt_vc.c Sat Sep 22 04:04:02 2012 (r240798) +++ stable/9/lib/libc/rpc/clnt_vc.c Sat Sep 22 04:18:42 2012 (r240799) @@ -672,6 +672,10 @@ clnt_vc_destroy(cl) if (ct->ct_addr.buf) free(ct->ct_addr.buf); mem_free(ct, sizeof(struct ct_data)); + if (cl->cl_netid && cl->cl_netid[0]) + mem_free(cl->cl_netid, strlen(cl->cl_netid) +1); + if (cl->cl_tp && cl->cl_tp[0]) + mem_free(cl->cl_tp, strlen(cl->cl_tp) +1); mem_free(cl, sizeof(CLIENT)); mutex_unlock(&clnt_fd_lock); thr_sigsetmask(SIG_SETMASK, &(mask), NULL); Modified: stable/9/lib/libc/rpc/rpc_generic.c ============================================================================== --- stable/9/lib/libc/rpc/rpc_generic.c Sat Sep 22 04:04:02 2012 (r240798) +++ stable/9/lib/libc/rpc/rpc_generic.c Sat Sep 22 04:18:42 2012 (r240799) @@ -269,7 +269,8 @@ __rpc_getconfip(nettype) } while ((nconf = getnetconfig(confighandle)) != NULL) { if (strcmp(nconf->nc_protofmly, NC_INET) == 0) { - if (strcmp(nconf->nc_proto, NC_TCP) == 0) { + if (strcmp(nconf->nc_proto, NC_TCP) == 0 && + netid_tcp == NULL) { netid_tcp = strdup(nconf->nc_netid); if (main_thread) netid_tcp_main = netid_tcp; @@ -277,7 +278,8 @@ __rpc_getconfip(nettype) thr_setspecific(tcp_key, (void *) netid_tcp); } else - if (strcmp(nconf->nc_proto, NC_UDP) == 0) { + if (strcmp(nconf->nc_proto, NC_UDP) == 0 && + netid_udp == NULL) { netid_udp = strdup(nconf->nc_netid); if (main_thread) netid_udp_main = netid_udp; @@ -616,6 +618,9 @@ __rpc_taddr2uaddr_af(int af, const struc #endif u_int16_t port; + if (nbuf->len <= 0) + return NULL; + switch (af) { case AF_INET: sin = nbuf->buf; Modified: stable/9/lib/libc/rpc/rpc_soc.3 ============================================================================== --- stable/9/lib/libc/rpc/rpc_soc.3 Sat Sep 22 04:04:02 2012 (r240798) +++ stable/9/lib/libc/rpc/rpc_soc.3 Sat Sep 22 04:18:42 2012 (r240799) @@ -148,7 +148,7 @@ default authentication used by .Ft "AUTH *" .Xc .It Xo -.Fn authunix_create "char *host" "int uid" "int gid" "int len" "int *aup_gids" +.Fn authunix_create "char *host" "uid_t uid" "gid_t gid" "int len" "gid_t *aup_gids" .Xc .Pp Create and return an Modified: stable/9/lib/libc/rpc/rpcb_clnt.c ============================================================================== --- stable/9/lib/libc/rpc/rpcb_clnt.c Sat Sep 22 04:04:02 2012 (r240798) +++ stable/9/lib/libc/rpc/rpcb_clnt.c Sat Sep 22 04:18:42 2012 (r240799) @@ -770,6 +770,13 @@ __rpcb_findaddr_timed(program, version, } parms.r_addr = NULL; + parms.r_netid = nconf->nc_netid; + + /* + * According to wire captures, the reference implementation + * (OpenSolaris) sends a blank string here too. + */ + parms.r_owner = ""; /* * Use default total timeout if no timeout is specified. Modified: stable/9/lib/libc/rpc/svc_auth_unix.c ============================================================================== --- stable/9/lib/libc/rpc/svc_auth_unix.c Sat Sep 22 04:04:02 2012 (r240798) +++ stable/9/lib/libc/rpc/svc_auth_unix.c Sat Sep 22 04:18:42 2012 (r240799) @@ -68,7 +68,7 @@ _svcauth_unix(rqst, msg) struct area { struct authunix_parms area_aup; char area_machname[MAX_MACHINE_NAME+1]; - int area_gids[NGRPS]; + gid_t area_gids[NGRPS]; } *area; u_int auth_len; size_t str_len, gid_len; Modified: stable/9/lib/libc/rpc/svc_run.c ============================================================================== --- stable/9/lib/libc/rpc/svc_run.c Sat Sep 22 04:04:02 2012 (r240798) +++ stable/9/lib/libc/rpc/svc_run.c Sat Sep 22 04:18:42 2012 (r240799) @@ -60,14 +60,13 @@ svc_run() fd_set readfds, cleanfds; struct timeval timeout; - timeout.tv_sec = 30; - timeout.tv_usec = 0; - for (;;) { rwlock_rdlock(&svc_fd_lock); readfds = svc_fdset; cleanfds = svc_fdset; rwlock_unlock(&svc_fd_lock); + timeout.tv_sec = 30; + timeout.tv_usec = 0; switch (_select(svc_maxfd+1, &readfds, NULL, NULL, &timeout)) { case -1: FD_ZERO(&readfds); Modified: stable/9/sys/rpc/auth.h ============================================================================== --- stable/9/sys/rpc/auth.h Sat Sep 22 04:04:02 2012 (r240798) +++ stable/9/sys/rpc/auth.h Sat Sep 22 04:18:42 2012 (r240799) @@ -234,18 +234,17 @@ __END_DECLS * System style authentication * AUTH *authunix_create(machname, uid, gid, len, aup_gids) * char *machname; - * int uid; - * int gid; + * uid_t uid; + * gid_t gid; * int len; - * int *aup_gids; + * gid_t *aup_gids; */ __BEGIN_DECLS #ifdef _KERNEL struct ucred; extern AUTH *authunix_create(struct ucred *); #else -extern AUTH *authunix_create(char *, int, int, int, - int *); +extern AUTH *authunix_create(char *, uid_t, gid_t, int, gid_t *); extern AUTH *authunix_create_default(void); /* takes no parameters */ #endif extern AUTH *authnone_create(void); /* takes no parameters */ Modified: stable/9/sys/rpc/clnt_vc.c ============================================================================== --- stable/9/sys/rpc/clnt_vc.c Sat Sep 22 04:04:02 2012 (r240798) +++ stable/9/sys/rpc/clnt_vc.c Sat Sep 22 04:18:42 2012 (r240799) @@ -836,6 +836,10 @@ clnt_vc_destroy(CLIENT *cl) soclose(so); } mem_free(ct, sizeof(struct ct_data)); + if (cl->cl_netid && cl->cl_netid[0]) + mem_free(cl->cl_netid, strlen(cl->cl_netid) +1); + if (cl->cl_tp && cl->cl_tp[0]) + mem_free(cl->cl_tp, strlen(cl->cl_tp) +1); mem_free(cl, sizeof(CLIENT)); } Modified: stable/9/sys/rpc/rpcb_clnt.c ============================================================================== --- stable/9/sys/rpc/rpcb_clnt.c Sat Sep 22 04:04:02 2012 (r240798) +++ stable/9/sys/rpc/rpcb_clnt.c Sat Sep 22 04:18:42 2012 (r240799) @@ -780,6 +780,13 @@ __rpcb_findaddr_timed(program, version, } parms.r_addr = NULL; + parms.r_netid = nconf->nc_netid; + + /* + * According to wire captures, the reference implementation + * (OpenSolaris) sends a blank string here too. + */ + parms.r_owner = ""; /* * Use default total timeout if no timeout is specified. From owner-svn-src-all@FreeBSD.ORG Sat Sep 22 04:22:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A5EEB106564A; Sat, 22 Sep 2012 04:22:18 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8EC088FC0A; Sat, 22 Sep 2012 04:22:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8M4MI5v083730; Sat, 22 Sep 2012 04:22:18 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8M4MIUH083715; Sat, 22 Sep 2012 04:22:18 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201209220422.q8M4MIUH083715@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sat, 22 Sep 2012 04:22: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: r240800 - in stable/8: include/rpc lib/libc/rpc sys/rpc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Sep 2012 04:22:19 -0000 Author: pfg Date: Sat Sep 22 04:22:17 2012 New Revision: 240800 URL: http://svn.freebsd.org/changeset/base/240800 Log: MFC r239963: Bring some changes from Bull's NFSv4 libtirpc implementation. ____ Fixed infinite loop in svc_run() ____ __rpc_taddr2uaddr_af() assumes the netbuf to always have a non-zero data. This is a bad assumption and can lead to a seg-fault. This patch adds a check for zero length and returns NULL when found. ____ Changed clnt_spcreateerror() to return clearer and more concise error messages. ____ Converted all uid and gid variables of the type uid_t and gid_t. ____ libtirpc: set r_netid and r_owner in __rpcb_findaddr_timed These fields in the rpcbind GETADDR call are being passed uninitialized to CLNT_CALL. In the case of x86_64 at least, this usually leads to a segfault. On x86, it sometimes causes segfaults and other times causes garbage to be sent on the wire. rpcbind generally ignores the r_owner field for calls that come in over the wire, so it really doesn't matter what we send in that slot. We just need to send something. The reference implementation from Sun seems to send a blank string. Have ours follow suit. ____ libtirpc: be sure to free cl_netid and cl_tp When creating a client with clnt_tli_create, it uses strdup to copy strings for these fields if nconf is passed in. clnt_dg_destroy frees these strings already. Make sure clnt_vc_destroy frees them in the same way. ____ Obtained from: Bull GNU/Linux NFSv4 Project Modified: stable/8/include/rpc/auth.h stable/8/include/rpc/auth_unix.h stable/8/lib/libc/rpc/auth_unix.c stable/8/lib/libc/rpc/authunix_prot.c stable/8/lib/libc/rpc/clnt_perror.c stable/8/lib/libc/rpc/clnt_vc.c stable/8/lib/libc/rpc/rpc_generic.c stable/8/lib/libc/rpc/rpc_soc.3 stable/8/lib/libc/rpc/rpcb_clnt.c stable/8/lib/libc/rpc/svc_auth_unix.c stable/8/lib/libc/rpc/svc_run.c stable/8/sys/rpc/auth.h stable/8/sys/rpc/clnt_vc.c stable/8/sys/rpc/rpcb_clnt.c Directory Properties: stable/8/include/ (props changed) stable/8/include/rpc/ (props changed) stable/8/lib/ (props changed) stable/8/lib/libc/ (props changed) stable/8/lib/libc/rpc/ (props changed) stable/8/sys/ (props changed) stable/8/sys/rpc/ (props changed) Modified: stable/8/include/rpc/auth.h ============================================================================== --- stable/8/include/rpc/auth.h Sat Sep 22 04:18:42 2012 (r240799) +++ stable/8/include/rpc/auth.h Sat Sep 22 04:22:17 2012 (r240800) @@ -243,14 +243,13 @@ __END_DECLS * System style authentication * AUTH *authunix_create(machname, uid, gid, len, aup_gids) * char *machname; - * int uid; - * int gid; + * uid_t uid; + * gid_t gid; * int len; - * int *aup_gids; + * gid_t *aup_gids; */ __BEGIN_DECLS -extern AUTH *authunix_create(char *, int, int, int, - int *); +extern AUTH *authunix_create(char *, uid_t, gid_t, int, gid_t *); extern AUTH *authunix_create_default(void); /* takes no parameters */ extern AUTH *authnone_create(void); /* takes no parameters */ __END_DECLS Modified: stable/8/include/rpc/auth_unix.h ============================================================================== --- stable/8/include/rpc/auth_unix.h Sat Sep 22 04:18:42 2012 (r240799) +++ stable/8/include/rpc/auth_unix.h Sat Sep 22 04:22:17 2012 (r240800) @@ -60,10 +60,10 @@ struct authunix_parms { u_long aup_time; char *aup_machname; - int aup_uid; - int aup_gid; + uid_t aup_uid; + gid_t aup_gid; u_int aup_len; - int *aup_gids; + gid_t *aup_gids; }; #define authsys_parms authunix_parms Modified: stable/8/lib/libc/rpc/auth_unix.c ============================================================================== --- stable/8/lib/libc/rpc/auth_unix.c Sat Sep 22 04:18:42 2012 (r240799) +++ stable/8/lib/libc/rpc/auth_unix.c Sat Sep 22 04:22:17 2012 (r240800) @@ -94,10 +94,10 @@ struct audata { AUTH * authunix_create(machname, uid, gid, len, aup_gids) char *machname; - int uid; - int gid; + uid_t uid; + gid_t gid; int len; - int *aup_gids; + gid_t *aup_gids; { struct authunix_parms aup; char mymem[MAX_AUTH_BYTES]; @@ -207,9 +207,7 @@ authunix_create_default() abort(); if (ngids > NGRPS) ngids = NGRPS; - /* XXX: interface problem; those should all have been unsigned */ - auth = authunix_create(machname, (int)uid, (int)gid, ngids, - (int *)gids); + auth = authunix_create(machname, uid, gid, ngids, gids); free(gids); return (auth); } Modified: stable/8/lib/libc/rpc/authunix_prot.c ============================================================================== --- stable/8/lib/libc/rpc/authunix_prot.c Sat Sep 22 04:18:42 2012 (r240799) +++ stable/8/lib/libc/rpc/authunix_prot.c Sat Sep 22 04:22:17 2012 (r240800) @@ -60,7 +60,7 @@ xdr_authunix_parms(xdrs, p) XDR *xdrs; struct authunix_parms *p; { - int **paup_gids; + gid_t **paup_gids; assert(xdrs != NULL); assert(p != NULL); @@ -69,8 +69,8 @@ xdr_authunix_parms(xdrs, p) if (xdr_u_long(xdrs, &(p->aup_time)) && xdr_string(xdrs, &(p->aup_machname), MAX_MACHINE_NAME) - && xdr_int(xdrs, &(p->aup_uid)) - && xdr_int(xdrs, &(p->aup_gid)) + && xdr_u_int(xdrs, &(p->aup_uid)) + && xdr_u_int(xdrs, &(p->aup_gid)) && xdr_array(xdrs, (char **) paup_gids, &(p->aup_len), NGRPS, sizeof(int), (xdrproc_t)xdr_int) ) { return (TRUE); Modified: stable/8/lib/libc/rpc/clnt_perror.c ============================================================================== --- stable/8/lib/libc/rpc/clnt_perror.c Sat Sep 22 04:18:42 2012 (r240799) +++ stable/8/lib/libc/rpc/clnt_perror.c Sat Sep 22 04:22:17 2012 (r240800) @@ -242,7 +242,7 @@ char * clnt_spcreateerror(s) const char *s; { - char *str; + char *str, *err; size_t len, i; assert(s != NULL); @@ -258,8 +258,21 @@ clnt_spcreateerror(s) switch (rpc_createerr.cf_stat) { case RPC_PMAPFAILURE: (void) strncat(str, " - ", len - 1); - (void) strncat(str, - clnt_sperrno(rpc_createerr.cf_error.re_status), len - 4); + err = clnt_sperrno(rpc_createerr.cf_error.re_status); + if (err) + (void) strncat(str, err+5, len-5); + switch(rpc_createerr.cf_error.re_status) { + case RPC_CANTSEND: + case RPC_CANTRECV: + i = strlen(str); + len -= i; + snprintf(str+i, len, ": errno %d (%s)", + rpc_createerr.cf_error.re_errno, + strerror(rpc_createerr.cf_error.re_errno)); + break; + default: + break; + } break; case RPC_SYSTEMERROR: Modified: stable/8/lib/libc/rpc/clnt_vc.c ============================================================================== --- stable/8/lib/libc/rpc/clnt_vc.c Sat Sep 22 04:18:42 2012 (r240799) +++ stable/8/lib/libc/rpc/clnt_vc.c Sat Sep 22 04:22:17 2012 (r240800) @@ -672,6 +672,10 @@ clnt_vc_destroy(cl) if (ct->ct_addr.buf) free(ct->ct_addr.buf); mem_free(ct, sizeof(struct ct_data)); + if (cl->cl_netid && cl->cl_netid[0]) + mem_free(cl->cl_netid, strlen(cl->cl_netid) +1); + if (cl->cl_tp && cl->cl_tp[0]) + mem_free(cl->cl_tp, strlen(cl->cl_tp) +1); mem_free(cl, sizeof(CLIENT)); mutex_unlock(&clnt_fd_lock); thr_sigsetmask(SIG_SETMASK, &(mask), NULL); Modified: stable/8/lib/libc/rpc/rpc_generic.c ============================================================================== --- stable/8/lib/libc/rpc/rpc_generic.c Sat Sep 22 04:18:42 2012 (r240799) +++ stable/8/lib/libc/rpc/rpc_generic.c Sat Sep 22 04:22:17 2012 (r240800) @@ -269,7 +269,8 @@ __rpc_getconfip(nettype) } while ((nconf = getnetconfig(confighandle)) != NULL) { if (strcmp(nconf->nc_protofmly, NC_INET) == 0) { - if (strcmp(nconf->nc_proto, NC_TCP) == 0) { + if (strcmp(nconf->nc_proto, NC_TCP) == 0 && + netid_tcp == NULL) { netid_tcp = strdup(nconf->nc_netid); if (main_thread) netid_tcp_main = netid_tcp; @@ -277,7 +278,8 @@ __rpc_getconfip(nettype) thr_setspecific(tcp_key, (void *) netid_tcp); } else - if (strcmp(nconf->nc_proto, NC_UDP) == 0) { + if (strcmp(nconf->nc_proto, NC_UDP) == 0 && + netid_udp == NULL) { netid_udp = strdup(nconf->nc_netid); if (main_thread) netid_udp_main = netid_udp; @@ -616,6 +618,9 @@ __rpc_taddr2uaddr_af(int af, const struc #endif u_int16_t port; + if (nbuf->len <= 0) + return NULL; + switch (af) { case AF_INET: sin = nbuf->buf; Modified: stable/8/lib/libc/rpc/rpc_soc.3 ============================================================================== --- stable/8/lib/libc/rpc/rpc_soc.3 Sat Sep 22 04:18:42 2012 (r240799) +++ stable/8/lib/libc/rpc/rpc_soc.3 Sat Sep 22 04:22:17 2012 (r240800) @@ -148,7 +148,7 @@ default authentication used by .Ft "AUTH *" .Xc .It Xo -.Fn authunix_create "char *host" "int uid" "int gid" "int len" "int *aup_gids" +.Fn authunix_create "char *host" "uid_t uid" "gid_t gid" "int len" "gid_t *aup_gids" .Xc .Pp Create and return an Modified: stable/8/lib/libc/rpc/rpcb_clnt.c ============================================================================== --- stable/8/lib/libc/rpc/rpcb_clnt.c Sat Sep 22 04:18:42 2012 (r240799) +++ stable/8/lib/libc/rpc/rpcb_clnt.c Sat Sep 22 04:22:17 2012 (r240800) @@ -770,6 +770,13 @@ __rpcb_findaddr_timed(program, version, } parms.r_addr = NULL; + parms.r_netid = nconf->nc_netid; + + /* + * According to wire captures, the reference implementation + * (OpenSolaris) sends a blank string here too. + */ + parms.r_owner = ""; /* * Use default total timeout if no timeout is specified. Modified: stable/8/lib/libc/rpc/svc_auth_unix.c ============================================================================== --- stable/8/lib/libc/rpc/svc_auth_unix.c Sat Sep 22 04:18:42 2012 (r240799) +++ stable/8/lib/libc/rpc/svc_auth_unix.c Sat Sep 22 04:22:17 2012 (r240800) @@ -68,7 +68,7 @@ _svcauth_unix(rqst, msg) struct area { struct authunix_parms area_aup; char area_machname[MAX_MACHINE_NAME+1]; - int area_gids[NGRPS]; + gid_t area_gids[NGRPS]; } *area; u_int auth_len; size_t str_len, gid_len; Modified: stable/8/lib/libc/rpc/svc_run.c ============================================================================== --- stable/8/lib/libc/rpc/svc_run.c Sat Sep 22 04:18:42 2012 (r240799) +++ stable/8/lib/libc/rpc/svc_run.c Sat Sep 22 04:22:17 2012 (r240800) @@ -60,14 +60,13 @@ svc_run() fd_set readfds, cleanfds; struct timeval timeout; - timeout.tv_sec = 30; - timeout.tv_usec = 0; - for (;;) { rwlock_rdlock(&svc_fd_lock); readfds = svc_fdset; cleanfds = svc_fdset; rwlock_unlock(&svc_fd_lock); + timeout.tv_sec = 30; + timeout.tv_usec = 0; switch (_select(svc_maxfd+1, &readfds, NULL, NULL, &timeout)) { case -1: FD_ZERO(&readfds); Modified: stable/8/sys/rpc/auth.h ============================================================================== --- stable/8/sys/rpc/auth.h Sat Sep 22 04:18:42 2012 (r240799) +++ stable/8/sys/rpc/auth.h Sat Sep 22 04:22:17 2012 (r240800) @@ -234,18 +234,17 @@ __END_DECLS * System style authentication * AUTH *authunix_create(machname, uid, gid, len, aup_gids) * char *machname; - * int uid; - * int gid; + * uid_t uid; + * gid_t gid; * int len; - * int *aup_gids; + * gid_t *aup_gids; */ __BEGIN_DECLS #ifdef _KERNEL struct ucred; extern AUTH *authunix_create(struct ucred *); #else -extern AUTH *authunix_create(char *, int, int, int, - int *); +extern AUTH *authunix_create(char *, uid_t, gid_t, int, gid_t *); extern AUTH *authunix_create_default(void); /* takes no parameters */ #endif extern AUTH *authnone_create(void); /* takes no parameters */ Modified: stable/8/sys/rpc/clnt_vc.c ============================================================================== --- stable/8/sys/rpc/clnt_vc.c Sat Sep 22 04:18:42 2012 (r240799) +++ stable/8/sys/rpc/clnt_vc.c Sat Sep 22 04:22:17 2012 (r240800) @@ -836,6 +836,10 @@ clnt_vc_destroy(CLIENT *cl) soclose(so); } mem_free(ct, sizeof(struct ct_data)); + if (cl->cl_netid && cl->cl_netid[0]) + mem_free(cl->cl_netid, strlen(cl->cl_netid) +1); + if (cl->cl_tp && cl->cl_tp[0]) + mem_free(cl->cl_tp, strlen(cl->cl_tp) +1); mem_free(cl, sizeof(CLIENT)); } Modified: stable/8/sys/rpc/rpcb_clnt.c ============================================================================== --- stable/8/sys/rpc/rpcb_clnt.c Sat Sep 22 04:18:42 2012 (r240799) +++ stable/8/sys/rpc/rpcb_clnt.c Sat Sep 22 04:22:17 2012 (r240800) @@ -780,6 +780,13 @@ __rpcb_findaddr_timed(program, version, } parms.r_addr = NULL; + parms.r_netid = nconf->nc_netid; + + /* + * According to wire captures, the reference implementation + * (OpenSolaris) sends a blank string here too. + */ + parms.r_owner = ""; /* * Use default total timeout if no timeout is specified. From owner-svn-src-all@FreeBSD.ORG Sat Sep 22 05:27:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 07586106566B; Sat, 22 Sep 2012 05:27:48 +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 E5EC68FC0C; Sat, 22 Sep 2012 05:27:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8M5RlVM094773; Sat, 22 Sep 2012 05:27:47 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8M5RlNH094771; Sat, 22 Sep 2012 05:27:47 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201209220527.q8M5RlNH094771@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 22 Sep 2012 05:27:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240801 - stable/9/libexec/rtld-elf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Sep 2012 05:27:48 -0000 Author: kib Date: Sat Sep 22 05:27:47 2012 New Revision: 240801 URL: http://svn.freebsd.org/changeset/base/240801 Log: MFC r240686: Do not reference z_nodeflib for !objgiven case, thus fixing LD_PRELOAD for a non-absolute path. PR: bin/171604 Modified: stable/9/libexec/rtld-elf/rtld.c Directory Properties: stable/9/libexec/rtld-elf/ (props changed) Modified: stable/9/libexec/rtld-elf/rtld.c ============================================================================== --- stable/9/libexec/rtld-elf/rtld.c Sat Sep 22 04:22:17 2012 (r240800) +++ stable/9/libexec/rtld-elf/rtld.c Sat Sep 22 05:27:47 2012 (r240801) @@ -1429,7 +1429,7 @@ find_library(const char *xname, const Ob { char *pathname; char *name; - bool objgiven; + bool nodeflib, objgiven; objgiven = refobj != NULL; if (strchr(xname, '/') != NULL) { /* Hard coded pathname */ @@ -1464,6 +1464,7 @@ find_library(const char *xname, const Ob (pathname = search_library_path(name, STANDARD_LIBRARY_PATH)) != NULL) return (pathname); } else { + nodeflib = objgiven ? refobj->z_nodeflib : false; if ((objgiven && (pathname = search_library_path(name, refobj->rpath)) != NULL) || (objgiven && refobj->runpath == NULL && refobj != obj_main && @@ -1471,9 +1472,8 @@ find_library(const char *xname, const Ob (pathname = search_library_path(name, ld_library_path)) != NULL || (objgiven && (pathname = search_library_path(name, refobj->runpath)) != NULL) || - (pathname = search_library_path(name, gethints(refobj->z_nodeflib))) - != NULL || - (objgiven && !refobj->z_nodeflib && + (pathname = search_library_path(name, gethints(nodeflib))) != NULL || + (objgiven && !nodeflib && (pathname = search_library_path(name, STANDARD_LIBRARY_PATH)) != NULL)) return (pathname); } From owner-svn-src-all@FreeBSD.ORG Sat Sep 22 06:41:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id ABD0E106564A; Sat, 22 Sep 2012 06:41:57 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9335F8FC15; Sat, 22 Sep 2012 06:41:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8M6fvtB007301; Sat, 22 Sep 2012 06:41:57 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8M6fvrh007283; Sat, 22 Sep 2012 06:41:57 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201209220641.q8M6fvrh007283@svn.freebsd.org> From: Andrew Turner Date: Sat, 22 Sep 2012 06:41:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240802 - in head/sys/arm: arm at91 broadcom/bcm2835 econa include lpc mv s3c2xx0 sa11x0 tegra ti xscale/i80321 xscale/i8134x xscale/ixp425 xscale/pxa X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Sep 2012 06:41:57 -0000 Author: andrew Date: Sat Sep 22 06:41:56 2012 New Revision: 240802 URL: http://svn.freebsd.org/changeset/base/240802 Log: Create a common set_stackptrs in sys/arm/machdep.c. On single core devices set_stackptrs is only ever called with cpu = 0 in initarm and will be identical to the existing function. On SMP this needs to be implemented for sys/arm/mp_machdep.c, but the implementations are identical for each SoC. Modified: head/sys/arm/arm/machdep.c head/sys/arm/at91/at91_machdep.c head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c head/sys/arm/econa/econa_machdep.c head/sys/arm/include/machdep.h head/sys/arm/lpc/lpc_machdep.c head/sys/arm/mv/mv_machdep.c head/sys/arm/s3c2xx0/s3c24x0_machdep.c head/sys/arm/sa11x0/assabet_machdep.c head/sys/arm/tegra/tegra2_machdep.c head/sys/arm/ti/ti_machdep.c head/sys/arm/xscale/i80321/ep80219_machdep.c head/sys/arm/xscale/i80321/iq31244_machdep.c head/sys/arm/xscale/i8134x/crb_machdep.c head/sys/arm/xscale/ixp425/avila_machdep.c head/sys/arm/xscale/pxa/pxa_machdep.c Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Sat Sep 22 05:27:47 2012 (r240801) +++ head/sys/arm/arm/machdep.c Sat Sep 22 06:41:56 2012 (r240802) @@ -948,3 +948,16 @@ init_proc0(vm_offset_t kstack) thread0.td_frame = &proc0_tf; pcpup->pc_curpcb = thread0.td_pcb; } + +void +set_stackptrs(int cpu) +{ + + set_stackptr(PSR_IRQ32_MODE, + irqstack.pv_va + ((IRQ_STACK_SIZE * PAGE_SIZE) * (cpu + 1))); + set_stackptr(PSR_ABT32_MODE, + abtstack.pv_va + ((ABT_STACK_SIZE * PAGE_SIZE) * (cpu + 1))); + set_stackptr(PSR_UND32_MODE, + undstack.pv_va + ((UND_STACK_SIZE * PAGE_SIZE) * (cpu + 1))); +} + Modified: head/sys/arm/at91/at91_machdep.c ============================================================================== --- head/sys/arm/at91/at91_machdep.c Sat Sep 22 05:27:47 2012 (r240801) +++ head/sys/arm/at91/at91_machdep.c Sat Sep 22 06:41:56 2012 (r240802) @@ -107,11 +107,6 @@ __FBSDID("$FreeBSD$"); /* this should be evenly divisable by PAGE_SIZE / L2_TABLE_SIZE_REAL (or 4) */ #define NUM_KERNEL_PTS (KERNEL_PT_AFKERNEL + KERNEL_PT_AFKERNEL_NUM) -/* Define various stack sizes in pages */ -#define IRQ_STACK_SIZE 1 -#define ABT_STACK_SIZE 1 -#define UND_STACK_SIZE 1 - extern u_int data_abort_handler_address; extern u_int prefetch_abort_handler_address; extern u_int undefined_handler_address; @@ -597,12 +592,8 @@ initarm(struct arm_boot_params *abp) * of the stack memory. */ cpu_control(CPU_CONTROL_MMU_ENABLE, CPU_CONTROL_MMU_ENABLE); - set_stackptr(PSR_IRQ32_MODE, - irqstack.pv_va + IRQ_STACK_SIZE * PAGE_SIZE); - set_stackptr(PSR_ABT32_MODE, - abtstack.pv_va + ABT_STACK_SIZE * PAGE_SIZE); - set_stackptr(PSR_UND32_MODE, - undstack.pv_va + UND_STACK_SIZE * PAGE_SIZE); + + set_stackptrs(0); /* * We must now clean the cache again.... Modified: head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c Sat Sep 22 05:27:47 2012 (r240801) +++ head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c Sat Sep 22 06:41:56 2012 (r240802) @@ -108,11 +108,6 @@ __FBSDID("$FreeBSD$"); */ #define KERNEL_PT_MAX 78 -/* Define various stack sizes in pages */ -#define IRQ_STACK_SIZE 1 -#define ABT_STACK_SIZE 1 -#define UND_STACK_SIZE 1 - extern unsigned char kernbase[]; extern unsigned char _etext[]; extern unsigned char _edata[]; @@ -147,8 +142,6 @@ struct pv_addr undstack; struct pv_addr abtstack; struct pv_addr kernelstack; -void set_stackptrs(int cpu); - static struct mem_region availmem_regions[FDT_MEM_REGIONS]; static int availmem_regions_sz; @@ -544,18 +537,6 @@ initarm(struct arm_boot_params *abp) sizeof(struct pcb))); } -void -set_stackptrs(int cpu) -{ - - set_stackptr(PSR_IRQ32_MODE, - irqstack.pv_va + ((IRQ_STACK_SIZE * PAGE_SIZE) * (cpu + 1))); - set_stackptr(PSR_ABT32_MODE, - abtstack.pv_va + ((ABT_STACK_SIZE * PAGE_SIZE) * (cpu + 1))); - set_stackptr(PSR_UND32_MODE, - undstack.pv_va + ((UND_STACK_SIZE * PAGE_SIZE) * (cpu + 1))); -} - #define FDT_DEVMAP_MAX (2) // FIXME static struct pmap_devmap fdt_devmap[FDT_DEVMAP_MAX] = { { 0, 0, 0, 0, 0, } Modified: head/sys/arm/econa/econa_machdep.c ============================================================================== --- head/sys/arm/econa/econa_machdep.c Sat Sep 22 05:27:47 2012 (r240801) +++ head/sys/arm/econa/econa_machdep.c Sat Sep 22 06:41:56 2012 (r240802) @@ -92,11 +92,6 @@ __FBSDID("$FreeBSD$"); /* this should be evenly divisable by PAGE_SIZE / L2_TABLE_SIZE_REAL (or 4) */ #define NUM_KERNEL_PTS (KERNEL_PT_AFKERNEL + KERNEL_PT_AFKERNEL_NUM) -/* Define various stack sizes in pages */ -#define IRQ_STACK_SIZE 1 -#define ABT_STACK_SIZE 1 -#define UND_STACK_SIZE 1 - extern u_int data_abort_handler_address; extern u_int prefetch_abort_handler_address; extern u_int undefined_handler_address; @@ -303,12 +298,7 @@ initarm(struct arm_boot_params *abp) */ cpu_control(CPU_CONTROL_MMU_ENABLE, CPU_CONTROL_MMU_ENABLE); - set_stackptr(PSR_IRQ32_MODE, - irqstack.pv_va + IRQ_STACK_SIZE * PAGE_SIZE); - set_stackptr(PSR_ABT32_MODE, - abtstack.pv_va + ABT_STACK_SIZE * PAGE_SIZE); - set_stackptr(PSR_UND32_MODE, - undstack.pv_va + UND_STACK_SIZE * PAGE_SIZE); + set_stackptrs(0); /* * We must now clean the cache again.... Modified: head/sys/arm/include/machdep.h ============================================================================== --- head/sys/arm/include/machdep.h Sat Sep 22 05:27:47 2012 (r240801) +++ head/sys/arm/include/machdep.h Sat Sep 22 06:41:56 2012 (r240802) @@ -4,12 +4,23 @@ #ifndef _MACHDEP_BOOT_MACHDEP_H_ #define _MACHDEP_BOOT_MACHDEP_H_ +/* Structs that need to be initialised by initarm */ +extern struct pv_addr irqstack; +extern struct pv_addr undstack; +extern struct pv_addr abtstack; + +/* Define various stack sizes in pages */ +#define IRQ_STACK_SIZE 1 +#define ABT_STACK_SIZE 1 +#define UND_STACK_SIZE 1 + /* misc prototypes used by the many arm machdeps */ void arm_lock_cache_line(vm_offset_t); void init_proc0(vm_offset_t kstack); void halt(void); void data_abort_handler(trapframe_t *); void prefetch_abort_handler(trapframe_t *); +void set_stackptrs(int cpu); void undefinedinstruction_bounce(trapframe_t *); /* Early boot related helper functions */ Modified: head/sys/arm/lpc/lpc_machdep.c ============================================================================== --- head/sys/arm/lpc/lpc_machdep.c Sat Sep 22 05:27:47 2012 (r240801) +++ head/sys/arm/lpc/lpc_machdep.c Sat Sep 22 06:41:56 2012 (r240802) @@ -109,11 +109,6 @@ __FBSDID("$FreeBSD$"); */ #define KERNEL_PT_MAX 78 -/* Define various stack sizes in pages */ -#define IRQ_STACK_SIZE 1 -#define ABT_STACK_SIZE 1 -#define UND_STACK_SIZE 1 - extern unsigned char kernbase[]; extern unsigned char _etext[]; extern unsigned char _edata[]; @@ -504,12 +499,8 @@ initarm(struct arm_boot_params *abp) * of the stack memory. */ cpu_control(CPU_CONTROL_MMU_ENABLE, CPU_CONTROL_MMU_ENABLE); - set_stackptr(PSR_IRQ32_MODE, - irqstack.pv_va + IRQ_STACK_SIZE * PAGE_SIZE); - set_stackptr(PSR_ABT32_MODE, - abtstack.pv_va + ABT_STACK_SIZE * PAGE_SIZE); - set_stackptr(PSR_UND32_MODE, - undstack.pv_va + UND_STACK_SIZE * PAGE_SIZE); + + set_stackptrs(0); /* * We must now clean the cache again.... Modified: head/sys/arm/mv/mv_machdep.c ============================================================================== --- head/sys/arm/mv/mv_machdep.c Sat Sep 22 05:27:47 2012 (r240801) +++ head/sys/arm/mv/mv_machdep.c Sat Sep 22 06:41:56 2012 (r240802) @@ -104,11 +104,6 @@ __FBSDID("$FreeBSD$"); */ #define KERNEL_PT_MAX 78 -/* Define various stack sizes in pages */ -#define IRQ_STACK_SIZE 1 -#define ABT_STACK_SIZE 1 -#define UND_STACK_SIZE 1 - extern unsigned char kernbase[]; extern unsigned char _etext[]; extern unsigned char _edata[]; @@ -137,8 +132,6 @@ struct pv_addr undstack; struct pv_addr abtstack; struct pv_addr kernelstack; -void set_stackptrs(int cpu); - static struct mem_region availmem_regions[FDT_MEM_REGIONS]; static int availmem_regions_sz; @@ -565,18 +558,6 @@ initarm(struct arm_boot_params *abp) sizeof(struct pcb))); } -void -set_stackptrs(int cpu) -{ - - set_stackptr(PSR_IRQ32_MODE, - irqstack.pv_va + ((IRQ_STACK_SIZE * PAGE_SIZE) * (cpu + 1))); - set_stackptr(PSR_ABT32_MODE, - abtstack.pv_va + ((ABT_STACK_SIZE * PAGE_SIZE) * (cpu + 1))); - set_stackptr(PSR_UND32_MODE, - undstack.pv_va + ((UND_STACK_SIZE * PAGE_SIZE) * (cpu + 1))); -} - #define MPP_PIN_MAX 68 #define MPP_PIN_CELLS 2 #define MPP_PINS_PER_REG 8 Modified: head/sys/arm/s3c2xx0/s3c24x0_machdep.c ============================================================================== --- head/sys/arm/s3c2xx0/s3c24x0_machdep.c Sat Sep 22 05:27:47 2012 (r240801) +++ head/sys/arm/s3c2xx0/s3c24x0_machdep.c Sat Sep 22 06:41:56 2012 (r240802) @@ -105,11 +105,6 @@ __FBSDID("$FreeBSD$"); /* this should be evenly divisable by PAGE_SIZE / L2_TABLE_SIZE_REAL (or 4) */ #define NUM_KERNEL_PTS (KERNEL_PT_AFKERNEL + KERNEL_PT_AFKERNEL_NUM) -/* Define various stack sizes in pages */ -#define IRQ_STACK_SIZE 1 -#define ABT_STACK_SIZE 1 -#define UND_STACK_SIZE 1 - extern int s3c2410_pclk; extern u_int data_abort_handler_address; @@ -349,12 +344,7 @@ initarm(struct arm_boot_params *abp) */ cpu_control(CPU_CONTROL_MMU_ENABLE, CPU_CONTROL_MMU_ENABLE); - set_stackptr(PSR_IRQ32_MODE, - irqstack.pv_va + IRQ_STACK_SIZE * PAGE_SIZE); - set_stackptr(PSR_ABT32_MODE, - abtstack.pv_va + ABT_STACK_SIZE * PAGE_SIZE); - set_stackptr(PSR_UND32_MODE, - undstack.pv_va + UND_STACK_SIZE * PAGE_SIZE); + set_stackptrs(0); /* * We must now clean the cache again.... Modified: head/sys/arm/sa11x0/assabet_machdep.c ============================================================================== --- head/sys/arm/sa11x0/assabet_machdep.c Sat Sep 22 05:27:47 2012 (r240801) +++ head/sys/arm/sa11x0/assabet_machdep.c Sat Sep 22 06:41:56 2012 (r240802) @@ -105,11 +105,6 @@ __FBSDID("$FreeBSD$"); #define KERNEL_PT_VMDATA_NUM 7 /* start with 16MB of KVM */ #define NUM_KERNEL_PTS (KERNEL_PT_VMDATA + KERNEL_PT_VMDATA_NUM) -/* Define various stack sizes in pages */ -#define IRQ_STACK_SIZE 1 -#define ABT_STACK_SIZE 1 -#define UND_STACK_SIZE 1 - #define KERNEL_VM_BASE (KERNBASE + 0x00100000) #define KERNEL_VM_SIZE 0x05000000 @@ -352,12 +347,7 @@ initarm(struct arm_boot_params *abp) * Since the ARM stacks use STMFD etc. we must set r13 to the top end * of the stack memory. */ - set_stackptr(PSR_IRQ32_MODE, - irqstack.pv_va + IRQ_STACK_SIZE * PAGE_SIZE); - set_stackptr(PSR_ABT32_MODE, - abtstack.pv_va + ABT_STACK_SIZE * PAGE_SIZE); - set_stackptr(PSR_UND32_MODE, - undstack.pv_va + UND_STACK_SIZE * PAGE_SIZE); + set_stackptrs(0); /* * We must now clean the cache again.... Modified: head/sys/arm/tegra/tegra2_machdep.c ============================================================================== --- head/sys/arm/tegra/tegra2_machdep.c Sat Sep 22 05:27:47 2012 (r240801) +++ head/sys/arm/tegra/tegra2_machdep.c Sat Sep 22 06:41:56 2012 (r240802) @@ -92,10 +92,6 @@ __FBSDID("$FreeBSD$"); #define KERNEL_PT_MAX 78 -#define IRQ_STACK_SIZE 1 -#define ABT_STACK_SIZE 1 -#define UND_STACK_SIZE 1 -#define FIQ_STACK_SIZE 1 #define debugf(fmt, args...) printf(fmt, ##args) @@ -140,13 +136,11 @@ vm_paddr_t pmap_pa; const struct pmap_devmap *pmap_devmap_bootstrap_table; struct pv_addr systempage; struct pv_addr msgbufpv; -static struct pv_addr irqstack; -static struct pv_addr undstack; -static struct pv_addr abtstack; +struct pv_addr irqstack; +struct pv_addr undstack; +struct pv_addr abtstack; static struct pv_addr kernelstack; -static void set_stackptrs(int cpu); - static int platform_devmap_init(void); static char * @@ -580,19 +574,6 @@ initarm(struct arm_boot_params *abp) sizeof(struct pcb))); } -static void -set_stackptrs(int cpu) -{ - - set_stackptr(PSR_IRQ32_MODE, - irqstack.pv_va + ((IRQ_STACK_SIZE * PAGE_SIZE) * (cpu + 1))); - set_stackptr(PSR_ABT32_MODE, - abtstack.pv_va + ((ABT_STACK_SIZE * PAGE_SIZE) * (cpu + 1))); - set_stackptr(PSR_UND32_MODE, - undstack.pv_va + ((UND_STACK_SIZE * PAGE_SIZE) * (cpu + 1))); -} - - #define FDT_DEVMAP_MAX (1 + 2 + 1 + 1) /* FIXME */ static struct pmap_devmap fdt_devmap[FDT_DEVMAP_MAX] = { { 0, 0, 0, 0, 0, } Modified: head/sys/arm/ti/ti_machdep.c ============================================================================== --- head/sys/arm/ti/ti_machdep.c Sat Sep 22 05:27:47 2012 (r240801) +++ head/sys/arm/ti/ti_machdep.c Sat Sep 22 06:41:56 2012 (r240802) @@ -107,11 +107,6 @@ __FBSDID("$FreeBSD$"); */ #define KERNEL_PT_MAX 78 -/* Define various stack sizes in pages */ -#define IRQ_STACK_SIZE 1 -#define ABT_STACK_SIZE 1 -#define UND_STACK_SIZE 1 - extern unsigned char kernbase[]; extern unsigned char _etext[]; extern unsigned char _edata[]; @@ -146,8 +141,6 @@ struct pv_addr undstack; struct pv_addr abtstack; struct pv_addr kernelstack; -void set_stackptrs(int cpu); - static struct mem_region availmem_regions[FDT_MEM_REGIONS]; static int availmem_regions_sz; @@ -541,18 +534,6 @@ initarm(struct arm_boot_params *abp) sizeof(struct pcb))); } -void -set_stackptrs(int cpu) -{ - - set_stackptr(PSR_IRQ32_MODE, - irqstack.pv_va + ((IRQ_STACK_SIZE * PAGE_SIZE) * (cpu + 1))); - set_stackptr(PSR_ABT32_MODE, - abtstack.pv_va + ((ABT_STACK_SIZE * PAGE_SIZE) * (cpu + 1))); - set_stackptr(PSR_UND32_MODE, - undstack.pv_va + ((UND_STACK_SIZE * PAGE_SIZE) * (cpu + 1))); -} - #define FDT_DEVMAP_MAX (2) // FIXME static struct pmap_devmap fdt_devmap[FDT_DEVMAP_MAX] = { { 0, 0, 0, 0, 0, } Modified: head/sys/arm/xscale/i80321/ep80219_machdep.c ============================================================================== --- head/sys/arm/xscale/i80321/ep80219_machdep.c Sat Sep 22 05:27:47 2012 (r240801) +++ head/sys/arm/xscale/i80321/ep80219_machdep.c Sat Sep 22 06:41:56 2012 (r240802) @@ -104,11 +104,6 @@ __FBSDID("$FreeBSD$"); /* this should be evenly divisable by PAGE_SIZE / L2_TABLE_SIZE_REAL (or 4) */ #define NUM_KERNEL_PTS (KERNEL_PT_AFKERNEL + KERNEL_PT_AFKERNEL_NUM) -/* Define various stack sizes in pages */ -#define IRQ_STACK_SIZE 1 -#define ABT_STACK_SIZE 1 -#define UND_STACK_SIZE 1 - extern u_int data_abort_handler_address; extern u_int prefetch_abort_handler_address; extern u_int undefined_handler_address; @@ -329,16 +324,7 @@ initarm(struct arm_boot_params *abp) * Since the ARM stacks use STMFD etc. we must set r13 to the top end * of the stack memory. */ - - - set_stackptr(PSR_IRQ32_MODE, - irqstack.pv_va + IRQ_STACK_SIZE * PAGE_SIZE); - set_stackptr(PSR_ABT32_MODE, - abtstack.pv_va + ABT_STACK_SIZE * PAGE_SIZE); - set_stackptr(PSR_UND32_MODE, - undstack.pv_va + UND_STACK_SIZE * PAGE_SIZE); - - + set_stackptrs(0); /* * We must now clean the cache again.... Modified: head/sys/arm/xscale/i80321/iq31244_machdep.c ============================================================================== --- head/sys/arm/xscale/i80321/iq31244_machdep.c Sat Sep 22 05:27:47 2012 (r240801) +++ head/sys/arm/xscale/i80321/iq31244_machdep.c Sat Sep 22 06:41:56 2012 (r240802) @@ -104,11 +104,6 @@ __FBSDID("$FreeBSD$"); /* this should be evenly divisable by PAGE_SIZE / L2_TABLE_SIZE_REAL (or 4) */ #define NUM_KERNEL_PTS (KERNEL_PT_AFKERNEL + KERNEL_PT_AFKERNEL_NUM) -/* Define various stack sizes in pages */ -#define IRQ_STACK_SIZE 1 -#define ABT_STACK_SIZE 1 -#define UND_STACK_SIZE 1 - extern u_int data_abort_handler_address; extern u_int prefetch_abort_handler_address; extern u_int undefined_handler_address; @@ -328,16 +323,7 @@ initarm(struct arm_boot_params *abp) * Since the ARM stacks use STMFD etc. we must set r13 to the top end * of the stack memory. */ - - - set_stackptr(PSR_IRQ32_MODE, - irqstack.pv_va + IRQ_STACK_SIZE * PAGE_SIZE); - set_stackptr(PSR_ABT32_MODE, - abtstack.pv_va + ABT_STACK_SIZE * PAGE_SIZE); - set_stackptr(PSR_UND32_MODE, - undstack.pv_va + UND_STACK_SIZE * PAGE_SIZE); - - + set_stackptrs(0); /* * We must now clean the cache again.... Modified: head/sys/arm/xscale/i8134x/crb_machdep.c ============================================================================== --- head/sys/arm/xscale/i8134x/crb_machdep.c Sat Sep 22 05:27:47 2012 (r240801) +++ head/sys/arm/xscale/i8134x/crb_machdep.c Sat Sep 22 06:41:56 2012 (r240802) @@ -107,11 +107,6 @@ __FBSDID("$FreeBSD$"); /* this should be evenly divisable by PAGE_SIZE / L2_TABLE_SIZE_REAL (or 4) */ #define NUM_KERNEL_PTS (KERNEL_PT_AFKERNEL + KERNEL_PT_AFKERNEL_NUM) -/* Define various stack sizes in pages */ -#define IRQ_STACK_SIZE 1 -#define ABT_STACK_SIZE 1 -#define UND_STACK_SIZE 1 - extern u_int data_abort_handler_address; extern u_int prefetch_abort_handler_address; extern u_int undefined_handler_address; @@ -314,15 +309,7 @@ initarm(struct arm_boot_params *abp) * of the stack memory. */ - - set_stackptr(PSR_IRQ32_MODE, - irqstack.pv_va + IRQ_STACK_SIZE * PAGE_SIZE); - set_stackptr(PSR_ABT32_MODE, - abtstack.pv_va + ABT_STACK_SIZE * PAGE_SIZE); - set_stackptr(PSR_UND32_MODE, - undstack.pv_va + UND_STACK_SIZE * PAGE_SIZE); - - + set_stackptrs(0); /* * We must now clean the cache again.... Modified: head/sys/arm/xscale/ixp425/avila_machdep.c ============================================================================== --- head/sys/arm/xscale/ixp425/avila_machdep.c Sat Sep 22 05:27:47 2012 (r240801) +++ head/sys/arm/xscale/ixp425/avila_machdep.c Sat Sep 22 06:41:56 2012 (r240802) @@ -108,11 +108,6 @@ __FBSDID("$FreeBSD$"); /* this should be evenly divisable by PAGE_SIZE / L2_TABLE_SIZE_REAL (or 4) */ #define NUM_KERNEL_PTS (KERNEL_PT_AFKERNEL + KERNEL_PT_AFKERNEL_NUM) -/* Define various stack sizes in pages */ -#define IRQ_STACK_SIZE 1 -#define ABT_STACK_SIZE 1 -#define UND_STACK_SIZE 1 - extern u_int data_abort_handler_address; extern u_int prefetch_abort_handler_address; extern u_int undefined_handler_address; @@ -399,9 +394,7 @@ initarm(struct arm_boot_params *abp) * Since the ARM stacks use STMFD etc. we must set r13 to the top end * of the stack memory. */ - set_stackptr(PSR_IRQ32_MODE, irqstack.pv_va + IRQ_STACK_SIZE*PAGE_SIZE); - set_stackptr(PSR_ABT32_MODE, abtstack.pv_va + ABT_STACK_SIZE*PAGE_SIZE); - set_stackptr(PSR_UND32_MODE, undstack.pv_va + UND_STACK_SIZE*PAGE_SIZE); + set_stackptrs(0); /* * We must now clean the cache again.... Modified: head/sys/arm/xscale/pxa/pxa_machdep.c ============================================================================== --- head/sys/arm/xscale/pxa/pxa_machdep.c Sat Sep 22 05:27:47 2012 (r240801) +++ head/sys/arm/xscale/pxa/pxa_machdep.c Sat Sep 22 06:41:56 2012 (r240802) @@ -104,11 +104,6 @@ __FBSDID("$FreeBSD$"); /* this should be evenly divisable by PAGE_SIZE / L2_TABLE_SIZE_REAL (or 4) */ #define NUM_KERNEL_PTS (KERNEL_PT_AFKERNEL + KERNEL_PT_AFKERNEL_NUM) -/* Define various stack sizes in pages */ -#define IRQ_STACK_SIZE 1 -#define ABT_STACK_SIZE 1 -#define UND_STACK_SIZE 1 - extern u_int data_abort_handler_address; extern u_int prefetch_abort_handler_address; extern u_int undefined_handler_address; @@ -311,12 +306,7 @@ initarm(struct arm_boot_params *abp) * Since the ARM stacks use STMFD etc. we must set r13 to the top end * of the stack memory. */ - set_stackptr(PSR_IRQ32_MODE, - irqstack.pv_va + IRQ_STACK_SIZE * PAGE_SIZE); - set_stackptr(PSR_ABT32_MODE, - abtstack.pv_va + ABT_STACK_SIZE * PAGE_SIZE); - set_stackptr(PSR_UND32_MODE, - undstack.pv_va + UND_STACK_SIZE * PAGE_SIZE); + set_stackptrs(0); /* * We must now clean the cache again.... From owner-svn-src-all@FreeBSD.ORG Sat Sep 22 06:54:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C9086106566C; Sat, 22 Sep 2012 06:54:03 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B363F8FC0C; Sat, 22 Sep 2012 06:54:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8M6s3wZ009331; Sat, 22 Sep 2012 06:54:03 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8M6s3Fx009328; Sat, 22 Sep 2012 06:54:03 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201209220654.q8M6s3Fx009328@svn.freebsd.org> From: Alan Cox Date: Sat, 22 Sep 2012 06:54:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240803 - head/sys/arm/arm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Sep 2012 06:54:03 -0000 Author: alc Date: Sat Sep 22 06:54:03 2012 New Revision: 240803 URL: http://svn.freebsd.org/changeset/base/240803 Log: Since UMA_ZONE_NOFREE is specified when l2zone and l2table_zone are created, there is no need to release and reacquire the pmap and pvh global locks around calls to uma_zfree(). Recursion into the pmap simply won't occur. Eliminate the use of M_USE_RESERVE. It is deprecated and, in fact, counter- productive, meaning that it actually makes the memory allocation request more likely to fail. Eliminate the macros pmap_{alloc,free}_l2_dtable(). They are of limited utility, and pmap_free_l2_dtable() was inconsistently used. Tidy up pmap_init(). In particular, change the initialization of the PV zone so that it doesn't span the initialization of the l2 and l2table zones. Tested by: jmg Modified: head/sys/arm/arm/pmap-v6.c head/sys/arm/arm/pmap.c Modified: head/sys/arm/arm/pmap-v6.c ============================================================================== --- head/sys/arm/arm/pmap-v6.c Sat Sep 22 06:41:56 2012 (r240802) +++ head/sys/arm/arm/pmap-v6.c Sat Sep 22 06:54:03 2012 (r240803) @@ -357,14 +357,6 @@ struct l2_dtable { #define L2_NEXT_BUCKET(va) (((va) & L1_S_FRAME) + L1_S_SIZE) /* - * L2 allocation. - */ -#define pmap_alloc_l2_dtable() \ - (void*)uma_zalloc(l2table_zone, M_NOWAIT|M_USE_RESERVE) -#define pmap_free_l2_dtable(l2) \ - uma_zfree(l2table_zone, l2) - -/* * We try to map the page tables write-through, if possible. However, not * all CPUs have a write-through cache mode, so on those we have to sync * the cache when we frob page tables. @@ -621,10 +613,9 @@ pmap_alloc_l2_bucket(pmap_t pm, vm_offse * no entry in the L1 table. * Need to allocate a new l2_dtable. */ -again_l2table: PMAP_UNLOCK(pm); rw_wunlock(&pvh_global_lock); - if ((l2 = pmap_alloc_l2_dtable()) == NULL) { + if ((l2 = uma_zalloc(l2table_zone, M_NOWAIT)) == NULL) { rw_wlock(&pvh_global_lock); PMAP_LOCK(pm); return (NULL); @@ -632,18 +623,12 @@ again_l2table: rw_wlock(&pvh_global_lock); PMAP_LOCK(pm); if (pm->pm_l2[L2_IDX(l1idx)] != NULL) { - PMAP_UNLOCK(pm); - rw_wunlock(&pvh_global_lock); - uma_zfree(l2table_zone, l2); - rw_wlock(&pvh_global_lock); - PMAP_LOCK(pm); - l2 = pm->pm_l2[L2_IDX(l1idx)]; - if (l2 == NULL) - goto again_l2table; /* * Someone already allocated the l2_dtable while * we were doing the same. */ + uma_zfree(l2table_zone, l2); + l2 = pm->pm_l2[L2_IDX(l1idx)]; } else { bzero(l2, sizeof(*l2)); /* @@ -665,21 +650,14 @@ again_l2table: * No L2 page table has been allocated. Chances are, this * is because we just allocated the l2_dtable, above. */ -again_ptep: PMAP_UNLOCK(pm); rw_wunlock(&pvh_global_lock); - ptep = (void*)uma_zalloc(l2zone, M_NOWAIT|M_USE_RESERVE); + ptep = uma_zalloc(l2zone, M_NOWAIT); rw_wlock(&pvh_global_lock); PMAP_LOCK(pm); if (l2b->l2b_kva != 0) { /* We lost the race. */ - PMAP_UNLOCK(pm); - rw_wunlock(&pvh_global_lock); uma_zfree(l2zone, ptep); - rw_wlock(&pvh_global_lock); - PMAP_LOCK(pm); - if (l2b->l2b_kva == 0) - goto again_ptep; return (l2b); } l2b->l2b_phys = vtophys(ptep); @@ -691,7 +669,7 @@ again_ptep: */ if (l2->l2_occupancy == 0) { pm->pm_l2[L2_IDX(l1idx)] = NULL; - pmap_free_l2_dtable(l2); + uma_zfree(l2table_zone, l2); } return (NULL); } @@ -789,7 +767,7 @@ pmap_free_l2_bucket(pmap_t pm, struct l2 * the pointer in the parent pmap and free the l2_dtable. */ pm->pm_l2[L2_IDX(l1idx)] = NULL; - pmap_free_l2_dtable(l2); + uma_zfree(l2table_zone, l2); } /* @@ -1175,28 +1153,25 @@ pmap_init(void) PDEBUG(1, printf("pmap_init: phys_start = %08x\n", PHYSADDR)); + l2zone = uma_zcreate("L2 Table", L2_TABLE_SIZE_REAL, pmap_l2ptp_ctor, + NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_VM | UMA_ZONE_NOFREE); + l2table_zone = uma_zcreate("L2 Table", sizeof(struct l2_dtable), NULL, + NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_VM | UMA_ZONE_NOFREE); + /* - * init the pv free list + * Initialize the PV entry allocator. */ pvzone = uma_zcreate("PV ENTRY", sizeof (struct pv_entry), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_VM | UMA_ZONE_NOFREE); - /* - * Now it is safe to enable pv_table recording. - */ - PDEBUG(1, printf("pmap_init: done!\n")); - TUNABLE_INT_FETCH("vm.pmap.shpgperproc", &shpgperproc); - pv_entry_max = shpgperproc * maxproc + cnt.v_page_count; - pv_entry_high_water = 9 * (pv_entry_max / 10); - l2zone = uma_zcreate("L2 Table", L2_TABLE_SIZE_REAL, pmap_l2ptp_ctor, - NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_VM | UMA_ZONE_NOFREE); - l2table_zone = uma_zcreate("L2 Table", sizeof(struct l2_dtable), - NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, - UMA_ZONE_VM | UMA_ZONE_NOFREE); - uma_zone_set_obj(pvzone, &pvzone_obj, pv_entry_max); + pv_entry_high_water = 9 * (pv_entry_max / 10); + /* + * Now it is safe to enable pv_table recording. + */ + PDEBUG(1, printf("pmap_init: done!\n")); } int @@ -2544,7 +2519,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, } /* - * The page queues and pmap must be locked. + * The pvh global and pmap locks must be held. */ static void pmap_enter_locked(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot, Modified: head/sys/arm/arm/pmap.c ============================================================================== --- head/sys/arm/arm/pmap.c Sat Sep 22 06:41:56 2012 (r240802) +++ head/sys/arm/arm/pmap.c Sat Sep 22 06:54:03 2012 (r240803) @@ -366,14 +366,6 @@ struct l2_dtable { #define L2_NEXT_BUCKET(va) (((va) & L1_S_FRAME) + L1_S_SIZE) /* - * L2 allocation. - */ -#define pmap_alloc_l2_dtable() \ - (void*)uma_zalloc(l2table_zone, M_NOWAIT|M_USE_RESERVE) -#define pmap_free_l2_dtable(l2) \ - uma_zfree(l2table_zone, l2) - -/* * We try to map the page tables write-through, if possible. However, not * all CPUs have a write-through cache mode, so on those we have to sync * the cache when we frob page tables. @@ -875,10 +867,9 @@ pmap_alloc_l2_bucket(pmap_t pm, vm_offse * no entry in the L1 table. * Need to allocate a new l2_dtable. */ -again_l2table: PMAP_UNLOCK(pm); rw_wunlock(&pvh_global_lock); - if ((l2 = pmap_alloc_l2_dtable()) == NULL) { + if ((l2 = uma_zalloc(l2table_zone, M_NOWAIT)) == NULL) { rw_wlock(&pvh_global_lock); PMAP_LOCK(pm); return (NULL); @@ -886,18 +877,12 @@ again_l2table: rw_wlock(&pvh_global_lock); PMAP_LOCK(pm); if (pm->pm_l2[L2_IDX(l1idx)] != NULL) { - PMAP_UNLOCK(pm); - rw_wunlock(&pvh_global_lock); - uma_zfree(l2table_zone, l2); - rw_wlock(&pvh_global_lock); - PMAP_LOCK(pm); - l2 = pm->pm_l2[L2_IDX(l1idx)]; - if (l2 == NULL) - goto again_l2table; /* * Someone already allocated the l2_dtable while * we were doing the same. */ + uma_zfree(l2table_zone, l2); + l2 = pm->pm_l2[L2_IDX(l1idx)]; } else { bzero(l2, sizeof(*l2)); /* @@ -919,21 +904,14 @@ again_l2table: * No L2 page table has been allocated. Chances are, this * is because we just allocated the l2_dtable, above. */ -again_ptep: PMAP_UNLOCK(pm); rw_wunlock(&pvh_global_lock); - ptep = (void*)uma_zalloc(l2zone, M_NOWAIT|M_USE_RESERVE); + ptep = uma_zalloc(l2zone, M_NOWAIT); rw_wlock(&pvh_global_lock); PMAP_LOCK(pm); if (l2b->l2b_kva != 0) { /* We lost the race. */ - PMAP_UNLOCK(pm); - rw_wunlock(&pvh_global_lock); uma_zfree(l2zone, ptep); - rw_wlock(&pvh_global_lock); - PMAP_LOCK(pm); - if (l2b->l2b_kva == 0) - goto again_ptep; return (l2b); } l2b->l2b_phys = vtophys(ptep); @@ -945,7 +923,7 @@ again_ptep: */ if (l2->l2_occupancy == 0) { pm->pm_l2[L2_IDX(l1idx)] = NULL; - pmap_free_l2_dtable(l2); + uma_zfree(l2table_zone, l2); } return (NULL); } @@ -1066,7 +1044,7 @@ pmap_free_l2_bucket(pmap_t pm, struct l2 * the pointer in the parent pmap and free the l2_dtable. */ pm->pm_l2[L2_IDX(l1idx)] = NULL; - pmap_free_l2_dtable(l2); + uma_zfree(l2table_zone, l2); } /* @@ -1834,28 +1812,25 @@ pmap_init(void) PDEBUG(1, printf("pmap_init: phys_start = %08x\n", PHYSADDR)); + l2zone = uma_zcreate("L2 Table", L2_TABLE_SIZE_REAL, pmap_l2ptp_ctor, + NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_VM | UMA_ZONE_NOFREE); + l2table_zone = uma_zcreate("L2 Table", sizeof(struct l2_dtable), NULL, + NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_VM | UMA_ZONE_NOFREE); + /* - * init the pv free list + * Initialize the PV entry allocator. */ pvzone = uma_zcreate("PV ENTRY", sizeof (struct pv_entry), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_VM | UMA_ZONE_NOFREE); - /* - * Now it is safe to enable pv_table recording. - */ - PDEBUG(1, printf("pmap_init: done!\n")); - TUNABLE_INT_FETCH("vm.pmap.shpgperproc", &shpgperproc); - pv_entry_max = shpgperproc * maxproc + cnt.v_page_count; - pv_entry_high_water = 9 * (pv_entry_max / 10); - l2zone = uma_zcreate("L2 Table", L2_TABLE_SIZE_REAL, pmap_l2ptp_ctor, - NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_VM | UMA_ZONE_NOFREE); - l2table_zone = uma_zcreate("L2 Table", sizeof(struct l2_dtable), - NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, - UMA_ZONE_VM | UMA_ZONE_NOFREE); - uma_zone_set_obj(pvzone, &pvzone_obj, pv_entry_max); + pv_entry_high_water = 9 * (pv_entry_max / 10); + /* + * Now it is safe to enable pv_table recording. + */ + PDEBUG(1, printf("pmap_init: done!\n")); } int @@ -3302,7 +3277,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, } /* - * The page queues and pmap must be locked. + * The pvh global and pmap locks must be held. */ static void pmap_enter_locked(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot, From owner-svn-src-all@FreeBSD.ORG Sat Sep 22 07:27:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E604B106564A; Sat, 22 Sep 2012 07:27:24 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D16678FC12; Sat, 22 Sep 2012 07:27:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8M7ROZ3015492; Sat, 22 Sep 2012 07:27:24 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8M7ROT7015490; Sat, 22 Sep 2012 07:27:24 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201209220727.q8M7ROT7015490@svn.freebsd.org> From: Hans Petter Selasky Date: Sat, 22 Sep 2012 07:27:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240804 - head/sys/dev/usb/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Sep 2012 07:27:25 -0000 Author: hselasky Date: Sat Sep 22 07:27:24 2012 New Revision: 240804 URL: http://svn.freebsd.org/changeset/base/240804 Log: Apply correct casting. Modified: head/sys/dev/usb/net/if_smsc.c Modified: head/sys/dev/usb/net/if_smsc.c ============================================================================== --- head/sys/dev/usb/net/if_smsc.c Sat Sep 22 06:54:03 2012 (r240803) +++ head/sys/dev/usb/net/if_smsc.c Sat Sep 22 07:27:24 2012 (r240804) @@ -296,7 +296,7 @@ static int smsc_wait_for_bits(struct smsc_softc *sc, uint32_t reg, uint32_t bits) { usb_ticks_t start_ticks; - usb_ticks_t max_ticks = USB_MS_TO_TICKS(1000); + const usb_ticks_t max_ticks = USB_MS_TO_TICKS(1000); uint32_t val; int err; @@ -310,7 +310,7 @@ smsc_wait_for_bits(struct smsc_softc *sc return (0); uether_pause(&sc->sc_ue, hz / 100); - } while ((ticks - start_ticks) < max_ticks); + } while (((usb_ticks_t)(ticks - start_ticks)) < max_ticks); return (USB_ERR_TIMEOUT); } From owner-svn-src-all@FreeBSD.ORG Sat Sep 22 07:44:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 58FD6106564A; Sat, 22 Sep 2012 07:44:37 +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 439A58FC12; Sat, 22 Sep 2012 07:44:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8M7ibR0018903; Sat, 22 Sep 2012 07:44:37 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8M7ibqS018901; Sat, 22 Sep 2012 07:44:37 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201209220744.q8M7ibqS018901@svn.freebsd.org> From: Rui Paulo Date: Sat, 22 Sep 2012 07:44:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240805 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Sep 2012 07:44:37 -0000 Author: rpaulo Date: Sat Sep 22 07:44:36 2012 New Revision: 240805 URL: http://svn.freebsd.org/changeset/base/240805 Log: Improve the check for p4 opened files. Now we only search for opened files in ${SYSDIR}, which makes it possible to use multiple source trees. Modified: head/sys/conf/newvers.sh Modified: head/sys/conf/newvers.sh ============================================================================== --- head/sys/conf/newvers.sh Sat Sep 22 07:27:24 2012 (r240804) +++ head/sys/conf/newvers.sh Sat Sep 22 07:44:36 2012 (r240805) @@ -140,10 +140,10 @@ if [ -n "$p4_cmd" ] ; then case "$p4version" in [0-9]*) p4version=" ${p4version}" - p4opened=`$p4_cmd opened 2>&1` + p4opened=`cd ${SYSDIR} && $p4_cmd opened ./... 2>&1` case "$p4opened" in File*) ;; - *) p4version="${p4version}+pending" ;; + //*) p4version="${p4version}+edit" ;; esac ;; *) unset p4version ;; From owner-svn-src-all@FreeBSD.ORG Sat Sep 22 08:02:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C36D5106566C; Sat, 22 Sep 2012 08:02:42 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AE7C08FC0A; Sat, 22 Sep 2012 08:02:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8M82got022037; Sat, 22 Sep 2012 08:02:42 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8M82guR022035; Sat, 22 Sep 2012 08:02:42 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201209220802.q8M82guR022035@svn.freebsd.org> From: Hans Petter Selasky Date: Sat, 22 Sep 2012 08:02:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240806 - head/sys/dev/usb/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Sep 2012 08:02:42 -0000 Author: hselasky Date: Sat Sep 22 08:02:42 2012 New Revision: 240806 URL: http://svn.freebsd.org/changeset/base/240806 Log: Apply some more casting. Modified: head/sys/dev/usb/net/if_smsc.c Modified: head/sys/dev/usb/net/if_smsc.c ============================================================================== --- head/sys/dev/usb/net/if_smsc.c Sat Sep 22 07:44:36 2012 (r240805) +++ head/sys/dev/usb/net/if_smsc.c Sat Sep 22 08:02:42 2012 (r240806) @@ -334,7 +334,7 @@ static int smsc_eeprom_read(struct smsc_softc *sc, uint16_t off, uint8_t *buf, uint16_t buflen) { usb_ticks_t start_ticks; - usb_ticks_t max_ticks = USB_MS_TO_TICKS(1000); + const usb_ticks_t max_ticks = USB_MS_TO_TICKS(1000); int err; int locked; uint32_t val; @@ -365,8 +365,8 @@ smsc_eeprom_read(struct smsc_softc *sc, break; uether_pause(&sc->sc_ue, hz / 100); - } while ((ticks - start_ticks) < max_ticks); - + } while (((usb_ticks_t)(ticks - start_ticks)) < max_ticks); + if (val & (SMSC_EEPROM_CMD_BUSY | SMSC_EEPROM_CMD_TIMEOUT)) { smsc_warn_printf(sc, "eeprom command failed\n"); err = USB_ERR_IOERROR; @@ -1247,7 +1247,7 @@ smsc_phy_init(struct smsc_softc *sc) { int bmcr; usb_ticks_t start_ticks; - usb_ticks_t max_ticks = USB_MS_TO_TICKS(1000); + const usb_ticks_t max_ticks = USB_MS_TO_TICKS(1000); SMSC_LOCK_ASSERT(sc, MA_OWNED); @@ -1260,7 +1260,7 @@ smsc_phy_init(struct smsc_softc *sc) bmcr = smsc_miibus_readreg(sc->sc_ue.ue_dev, sc->sc_phyno, MII_BMCR); } while ((bmcr & MII_BMCR) && ((ticks - start_ticks) < max_ticks)); - if ((ticks - start_ticks) >= max_ticks) { + if (((usb_ticks_t)(ticks - start_ticks)) >= max_ticks) { smsc_err_printf(sc, "PHY reset timed-out"); return (EIO); } From owner-svn-src-all@FreeBSD.ORG Sat Sep 22 08:47:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5FBEB10656A6; Sat, 22 Sep 2012 08:47:30 +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 4971F8FC0A; Sat, 22 Sep 2012 08:47:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8M8lUd8029993; Sat, 22 Sep 2012 08:47:30 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8M8lUNV029986; Sat, 22 Sep 2012 08:47:30 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201209220847.q8M8lUNV029986@svn.freebsd.org> From: Xin LI Date: Sat, 22 Sep 2012 08:47:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240807 - in stable/9/contrib/bind9: . lib/dns lib/dns/include/dns X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Sep 2012 08:47:30 -0000 Author: delphij Date: Sat Sep 22 08:47:29 2012 New Revision: 240807 URL: http://svn.freebsd.org/changeset/base/240807 Log: MFC 240729 (dougb): Upgrade to 9.8.3-P3: Prevents a crash when queried for a record whose RDATA exceeds 65535 bytes. Prevents a crash when validating caused by using "Bad cache" data before it has been initialized. ISC_QUEUE handling for recursive clients was updated to address a race condition that could cause a memory leak. This rarely occurred with UDP clients, but could be a significant problem for a server handling a steady rate of TCP queries. A condition has been corrected where improper handling of zero-length RDATA could cause undesirable behavior, including termination of the named process. For more information: https://kb.isc.org/article/AA-00788 Modified: stable/9/contrib/bind9/CHANGES stable/9/contrib/bind9/lib/dns/include/dns/rdata.h stable/9/contrib/bind9/lib/dns/master.c stable/9/contrib/bind9/lib/dns/rdata.c stable/9/contrib/bind9/lib/dns/rdataslab.c stable/9/contrib/bind9/version Directory Properties: stable/9/contrib/bind9/ (props changed) Modified: stable/9/contrib/bind9/CHANGES ============================================================================== --- stable/9/contrib/bind9/CHANGES Sat Sep 22 08:02:42 2012 (r240806) +++ stable/9/contrib/bind9/CHANGES Sat Sep 22 08:47:29 2012 (r240807) @@ -1,3 +1,8 @@ + --- 9.8.3-P3 released --- + +3364. [security] Named could die on specially crafted record. + [RT #30416] + --- 9.8.3-P2 released --- 3346. [security] Bad-cache data could be used before it was Modified: stable/9/contrib/bind9/lib/dns/include/dns/rdata.h ============================================================================== --- stable/9/contrib/bind9/lib/dns/include/dns/rdata.h Sat Sep 22 08:02:42 2012 (r240806) +++ stable/9/contrib/bind9/lib/dns/include/dns/rdata.h Sat Sep 22 08:47:29 2012 (r240807) @@ -147,6 +147,17 @@ struct dns_rdata { (((rdata)->flags & ~(DNS_RDATA_UPDATE|DNS_RDATA_OFFLINE)) == 0) /* + * The maximum length of a RDATA that can be sent on the wire. + * Max packet size (65535) less header (12), less name (1), type (2), + * class (2), ttl(4), length (2). + * + * None of the defined types that support name compression can exceed + * this and all new types are to be sent uncompressed. + */ + +#define DNS_RDATA_MAXLENGTH 65512U + +/* * Flags affecting rdata formatting style. Flags 0xFFFF0000 * are used by masterfile-level formatting and defined elsewhere. * See additional comments at dns_rdata_tofmttext(). Modified: stable/9/contrib/bind9/lib/dns/master.c ============================================================================== --- stable/9/contrib/bind9/lib/dns/master.c Sat Sep 22 08:02:42 2012 (r240806) +++ stable/9/contrib/bind9/lib/dns/master.c Sat Sep 22 08:47:29 2012 (r240807) @@ -75,7 +75,7 @@ /*% * max message size - header - root - type - class - ttl - rdlen */ -#define MINTSIZ (65535 - 12 - 1 - 2 - 2 - 4 - 2) +#define MINTSIZ DNS_RDATA_MAXLENGTH /*% * Size for tokens in the presentation format, * The largest tokens are the base64 blocks in KEY and CERT records, Modified: stable/9/contrib/bind9/lib/dns/rdata.c ============================================================================== --- stable/9/contrib/bind9/lib/dns/rdata.c Sat Sep 22 08:02:42 2012 (r240806) +++ stable/9/contrib/bind9/lib/dns/rdata.c Sat Sep 22 08:47:29 2012 (r240807) @@ -429,6 +429,7 @@ dns_rdata_fromwire(dns_rdata_t *rdata, d isc_buffer_t st; isc_boolean_t use_default = ISC_FALSE; isc_uint32_t activelength; + size_t length; REQUIRE(dctx != NULL); if (rdata != NULL) { @@ -459,6 +460,14 @@ dns_rdata_fromwire(dns_rdata_t *rdata, d } /* + * Reject any rdata that expands out to more than DNS_RDATA_MAXLENGTH + * as we cannot transmit it. + */ + length = isc_buffer_usedlength(target) - isc_buffer_usedlength(&st); + if (result == ISC_R_SUCCESS && length > DNS_RDATA_MAXLENGTH) + result = DNS_R_FORMERR; + + /* * We should have consumed all of our buffer. */ if (result == ISC_R_SUCCESS && !buffer_empty(source)) @@ -466,8 +475,7 @@ dns_rdata_fromwire(dns_rdata_t *rdata, d if (rdata != NULL && result == ISC_R_SUCCESS) { region.base = isc_buffer_used(&st); - region.length = isc_buffer_usedlength(target) - - isc_buffer_usedlength(&st); + region.length = length; dns_rdata_fromregion(rdata, rdclass, type, ®ion); } @@ -602,6 +610,7 @@ dns_rdata_fromtext(dns_rdata_t *rdata, d unsigned long line; void (*callback)(dns_rdatacallbacks_t *, const char *, ...); isc_result_t tresult; + size_t length; REQUIRE(origin == NULL || dns_name_isabsolute(origin) == ISC_TRUE); if (rdata != NULL) { @@ -673,10 +682,13 @@ dns_rdata_fromtext(dns_rdata_t *rdata, d } } while (1); + length = isc_buffer_usedlength(target) - isc_buffer_usedlength(&st); + if (result == ISC_R_SUCCESS && length > DNS_RDATA_MAXLENGTH) + result = ISC_R_NOSPACE; + if (rdata != NULL && result == ISC_R_SUCCESS) { region.base = isc_buffer_used(&st); - region.length = isc_buffer_usedlength(target) - - isc_buffer_usedlength(&st); + region.length = length; dns_rdata_fromregion(rdata, rdclass, type, ®ion); } if (result != ISC_R_SUCCESS) { @@ -804,6 +816,7 @@ dns_rdata_fromstruct(dns_rdata_t *rdata, isc_buffer_t st; isc_region_t region; isc_boolean_t use_default = ISC_FALSE; + size_t length; REQUIRE(source != NULL); if (rdata != NULL) { @@ -818,10 +831,13 @@ dns_rdata_fromstruct(dns_rdata_t *rdata, if (use_default) (void)NULL; + length = isc_buffer_usedlength(target) - isc_buffer_usedlength(&st); + if (result == ISC_R_SUCCESS && length > DNS_RDATA_MAXLENGTH) + result = ISC_R_NOSPACE; + if (rdata != NULL && result == ISC_R_SUCCESS) { region.base = isc_buffer_used(&st); - region.length = isc_buffer_usedlength(target) - - isc_buffer_usedlength(&st); + region.length = length; dns_rdata_fromregion(rdata, rdclass, type, ®ion); } if (result != ISC_R_SUCCESS) Modified: stable/9/contrib/bind9/lib/dns/rdataslab.c ============================================================================== --- stable/9/contrib/bind9/lib/dns/rdataslab.c Sat Sep 22 08:02:42 2012 (r240806) +++ stable/9/contrib/bind9/lib/dns/rdataslab.c Sat Sep 22 08:47:29 2012 (r240807) @@ -305,6 +305,7 @@ dns_rdataslab_fromrdataset(dns_rdataset_ length = x[i].rdata.length; if (rdataset->type == dns_rdatatype_rrsig) length++; + INSIST(length <= 0xffff); *rawbuf++ = (length & 0xff00) >> 8; *rawbuf++ = (length & 0x00ff); #if DNS_RDATASET_FIXED Modified: stable/9/contrib/bind9/version ============================================================================== --- stable/9/contrib/bind9/version Sat Sep 22 08:02:42 2012 (r240806) +++ stable/9/contrib/bind9/version Sat Sep 22 08:47:29 2012 (r240807) @@ -7,4 +7,4 @@ MAJORVER=9 MINORVER=8 PATCHVER=3 RELEASETYPE=-P -RELEASEVER=2 +RELEASEVER=3 From owner-svn-src-all@FreeBSD.ORG Sat Sep 22 08:48:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CCDC010656DA; Sat, 22 Sep 2012 08:48:26 +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 B55458FC14; Sat, 22 Sep 2012 08:48:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8M8mQho030201; Sat, 22 Sep 2012 08:48:26 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8M8mQJg030192; Sat, 22 Sep 2012 08:48:26 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201209220848.q8M8mQJg030192@svn.freebsd.org> From: Xin LI Date: Sat, 22 Sep 2012 08:48:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240808 - in releng/9.1/contrib/bind9: . lib/dns lib/dns/include/dns X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Sep 2012 08:48:27 -0000 Author: delphij Date: Sat Sep 22 08:48:26 2012 New Revision: 240808 URL: http://svn.freebsd.org/changeset/base/240808 Log: MFC 240729 (dougb): Upgrade to 9.8.3-P3: Prevents a crash when queried for a record whose RDATA exceeds 65535 bytes. Prevents a crash when validating caused by using "Bad cache" data before it has been initialized. ISC_QUEUE handling for recursive clients was updated to address a race condition that could cause a memory leak. This rarely occurred with UDP clients, but could be a significant problem for a server handling a steady rate of TCP queries. A condition has been corrected where improper handling of zero-length RDATA could cause undesirable behavior, including termination of the named process. For more information: https://kb.isc.org/article/AA-00788 Approved by: re (kib) Modified: releng/9.1/contrib/bind9/CHANGES releng/9.1/contrib/bind9/lib/dns/include/dns/rdata.h releng/9.1/contrib/bind9/lib/dns/master.c releng/9.1/contrib/bind9/lib/dns/rdata.c releng/9.1/contrib/bind9/lib/dns/rdataslab.c releng/9.1/contrib/bind9/version Directory Properties: releng/9.1/contrib/bind9/ (props changed) Modified: releng/9.1/contrib/bind9/CHANGES ============================================================================== --- releng/9.1/contrib/bind9/CHANGES Sat Sep 22 08:47:29 2012 (r240807) +++ releng/9.1/contrib/bind9/CHANGES Sat Sep 22 08:48:26 2012 (r240808) @@ -1,3 +1,8 @@ + --- 9.8.3-P3 released --- + +3364. [security] Named could die on specially crafted record. + [RT #30416] + --- 9.8.3-P2 released --- 3346. [security] Bad-cache data could be used before it was Modified: releng/9.1/contrib/bind9/lib/dns/include/dns/rdata.h ============================================================================== --- releng/9.1/contrib/bind9/lib/dns/include/dns/rdata.h Sat Sep 22 08:47:29 2012 (r240807) +++ releng/9.1/contrib/bind9/lib/dns/include/dns/rdata.h Sat Sep 22 08:48:26 2012 (r240808) @@ -147,6 +147,17 @@ struct dns_rdata { (((rdata)->flags & ~(DNS_RDATA_UPDATE|DNS_RDATA_OFFLINE)) == 0) /* + * The maximum length of a RDATA that can be sent on the wire. + * Max packet size (65535) less header (12), less name (1), type (2), + * class (2), ttl(4), length (2). + * + * None of the defined types that support name compression can exceed + * this and all new types are to be sent uncompressed. + */ + +#define DNS_RDATA_MAXLENGTH 65512U + +/* * Flags affecting rdata formatting style. Flags 0xFFFF0000 * are used by masterfile-level formatting and defined elsewhere. * See additional comments at dns_rdata_tofmttext(). Modified: releng/9.1/contrib/bind9/lib/dns/master.c ============================================================================== --- releng/9.1/contrib/bind9/lib/dns/master.c Sat Sep 22 08:47:29 2012 (r240807) +++ releng/9.1/contrib/bind9/lib/dns/master.c Sat Sep 22 08:48:26 2012 (r240808) @@ -75,7 +75,7 @@ /*% * max message size - header - root - type - class - ttl - rdlen */ -#define MINTSIZ (65535 - 12 - 1 - 2 - 2 - 4 - 2) +#define MINTSIZ DNS_RDATA_MAXLENGTH /*% * Size for tokens in the presentation format, * The largest tokens are the base64 blocks in KEY and CERT records, Modified: releng/9.1/contrib/bind9/lib/dns/rdata.c ============================================================================== --- releng/9.1/contrib/bind9/lib/dns/rdata.c Sat Sep 22 08:47:29 2012 (r240807) +++ releng/9.1/contrib/bind9/lib/dns/rdata.c Sat Sep 22 08:48:26 2012 (r240808) @@ -429,6 +429,7 @@ dns_rdata_fromwire(dns_rdata_t *rdata, d isc_buffer_t st; isc_boolean_t use_default = ISC_FALSE; isc_uint32_t activelength; + size_t length; REQUIRE(dctx != NULL); if (rdata != NULL) { @@ -459,6 +460,14 @@ dns_rdata_fromwire(dns_rdata_t *rdata, d } /* + * Reject any rdata that expands out to more than DNS_RDATA_MAXLENGTH + * as we cannot transmit it. + */ + length = isc_buffer_usedlength(target) - isc_buffer_usedlength(&st); + if (result == ISC_R_SUCCESS && length > DNS_RDATA_MAXLENGTH) + result = DNS_R_FORMERR; + + /* * We should have consumed all of our buffer. */ if (result == ISC_R_SUCCESS && !buffer_empty(source)) @@ -466,8 +475,7 @@ dns_rdata_fromwire(dns_rdata_t *rdata, d if (rdata != NULL && result == ISC_R_SUCCESS) { region.base = isc_buffer_used(&st); - region.length = isc_buffer_usedlength(target) - - isc_buffer_usedlength(&st); + region.length = length; dns_rdata_fromregion(rdata, rdclass, type, ®ion); } @@ -602,6 +610,7 @@ dns_rdata_fromtext(dns_rdata_t *rdata, d unsigned long line; void (*callback)(dns_rdatacallbacks_t *, const char *, ...); isc_result_t tresult; + size_t length; REQUIRE(origin == NULL || dns_name_isabsolute(origin) == ISC_TRUE); if (rdata != NULL) { @@ -673,10 +682,13 @@ dns_rdata_fromtext(dns_rdata_t *rdata, d } } while (1); + length = isc_buffer_usedlength(target) - isc_buffer_usedlength(&st); + if (result == ISC_R_SUCCESS && length > DNS_RDATA_MAXLENGTH) + result = ISC_R_NOSPACE; + if (rdata != NULL && result == ISC_R_SUCCESS) { region.base = isc_buffer_used(&st); - region.length = isc_buffer_usedlength(target) - - isc_buffer_usedlength(&st); + region.length = length; dns_rdata_fromregion(rdata, rdclass, type, ®ion); } if (result != ISC_R_SUCCESS) { @@ -804,6 +816,7 @@ dns_rdata_fromstruct(dns_rdata_t *rdata, isc_buffer_t st; isc_region_t region; isc_boolean_t use_default = ISC_FALSE; + size_t length; REQUIRE(source != NULL); if (rdata != NULL) { @@ -818,10 +831,13 @@ dns_rdata_fromstruct(dns_rdata_t *rdata, if (use_default) (void)NULL; + length = isc_buffer_usedlength(target) - isc_buffer_usedlength(&st); + if (result == ISC_R_SUCCESS && length > DNS_RDATA_MAXLENGTH) + result = ISC_R_NOSPACE; + if (rdata != NULL && result == ISC_R_SUCCESS) { region.base = isc_buffer_used(&st); - region.length = isc_buffer_usedlength(target) - - isc_buffer_usedlength(&st); + region.length = length; dns_rdata_fromregion(rdata, rdclass, type, ®ion); } if (result != ISC_R_SUCCESS) Modified: releng/9.1/contrib/bind9/lib/dns/rdataslab.c ============================================================================== --- releng/9.1/contrib/bind9/lib/dns/rdataslab.c Sat Sep 22 08:47:29 2012 (r240807) +++ releng/9.1/contrib/bind9/lib/dns/rdataslab.c Sat Sep 22 08:48:26 2012 (r240808) @@ -305,6 +305,7 @@ dns_rdataslab_fromrdataset(dns_rdataset_ length = x[i].rdata.length; if (rdataset->type == dns_rdatatype_rrsig) length++; + INSIST(length <= 0xffff); *rawbuf++ = (length & 0xff00) >> 8; *rawbuf++ = (length & 0x00ff); #if DNS_RDATASET_FIXED Modified: releng/9.1/contrib/bind9/version ============================================================================== --- releng/9.1/contrib/bind9/version Sat Sep 22 08:47:29 2012 (r240807) +++ releng/9.1/contrib/bind9/version Sat Sep 22 08:48:26 2012 (r240808) @@ -7,4 +7,4 @@ MAJORVER=9 MINORVER=8 PATCHVER=3 RELEASETYPE=-P -RELEASEVER=2 +RELEASEVER=3 From owner-svn-src-all@FreeBSD.ORG Sat Sep 22 10:02:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D97E0106564A; Sat, 22 Sep 2012 10:02:44 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C50C08FC08; Sat, 22 Sep 2012 10:02:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8MA2iNA042618; Sat, 22 Sep 2012 10:02:44 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8MA2iAM042616; Sat, 22 Sep 2012 10:02:44 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201209221002.q8MA2iAM042616@svn.freebsd.org> From: Gleb Smirnoff Date: Sat, 22 Sep 2012 10:02:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240809 - head/sys/netpfil/pf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Sep 2012 10:02:45 -0000 Author: glebius Date: Sat Sep 22 10:02:44 2012 New Revision: 240809 URL: http://svn.freebsd.org/changeset/base/240809 Log: Fix fallout from r236397 in pfr_update_stats(), that was missed later in r237155. We need to zero sockaddr before lookup. While here, make pfr_update_stats() panic on unknown af. Modified: head/sys/netpfil/pf/pf_table.c Modified: head/sys/netpfil/pf/pf_table.c ============================================================================== --- head/sys/netpfil/pf/pf_table.c Sat Sep 22 08:48:26 2012 (r240808) +++ head/sys/netpfil/pf/pf_table.c Sat Sep 22 10:02:44 2012 (r240809) @@ -1954,6 +1954,7 @@ pfr_update_stats(struct pfr_ktable *kt, { struct sockaddr_in sin; + bzero(&sin, sizeof(sin)); sin.sin_len = sizeof(sin); sin.sin_family = AF_INET; sin.sin_addr.s_addr = a->addr32[0]; @@ -1968,6 +1969,7 @@ pfr_update_stats(struct pfr_ktable *kt, { struct sockaddr_in6 sin6; + bzero(&sin6, sizeof(sin6)); sin6.sin6_len = sizeof(sin6); sin6.sin6_family = AF_INET6; bcopy(a, &sin6.sin6_addr, sizeof(sin6.sin6_addr)); @@ -1978,7 +1980,7 @@ pfr_update_stats(struct pfr_ktable *kt, } #endif /* INET6 */ default: - ; + panic("%s: unknown address family %u", __func__, af); } if ((ke == NULL || ke->pfrke_not) != notrule) { if (op_pass != PFR_OP_PASS) From owner-svn-src-all@FreeBSD.ORG Sat Sep 22 10:04:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 75854106564A; Sat, 22 Sep 2012 10:04:49 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 611778FC08; Sat, 22 Sep 2012 10:04:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8MA4n0P043081; Sat, 22 Sep 2012 10:04:49 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8MA4nVB043079; Sat, 22 Sep 2012 10:04:49 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201209221004.q8MA4nVB043079@svn.freebsd.org> From: Gleb Smirnoff Date: Sat, 22 Sep 2012 10:04:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240810 - head/sys/netpfil/pf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Sep 2012 10:04:49 -0000 Author: glebius Date: Sat Sep 22 10:04:48 2012 New Revision: 240810 URL: http://svn.freebsd.org/changeset/base/240810 Log: In pfr_insert_kentry() return ENOMEM if memory allocation failed. Modified: head/sys/netpfil/pf/pf_table.c Modified: head/sys/netpfil/pf/pf_table.c ============================================================================== --- head/sys/netpfil/pf/pf_table.c Sat Sep 22 10:02:44 2012 (r240809) +++ head/sys/netpfil/pf/pf_table.c Sat Sep 22 10:04:48 2012 (r240810) @@ -834,7 +834,7 @@ pfr_insert_kentry(struct pfr_ktable *kt, return (0); p = pfr_create_kentry(ad); if (p == NULL) - return (EINVAL); + return (ENOMEM); rv = pfr_route_kentry(kt, p); if (rv) From owner-svn-src-all@FreeBSD.ORG Sat Sep 22 10:14:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0F057106564A; Sat, 22 Sep 2012 10:14:48 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ED2258FC14; Sat, 22 Sep 2012 10:14:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8MAEln6045074; Sat, 22 Sep 2012 10:14:47 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8MAEldK045071; Sat, 22 Sep 2012 10:14:47 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201209221014.q8MAEldK045071@svn.freebsd.org> From: Gleb Smirnoff Date: Sat, 22 Sep 2012 10:14:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240811 - head/sys/netpfil/pf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Sep 2012 10:14:48 -0000 Author: glebius Date: Sat Sep 22 10:14:47 2012 New Revision: 240811 URL: http://svn.freebsd.org/changeset/base/240811 Log: When connection rate hits and we overload a source to a table, we are actually editing table, which means editing rules, thus we need writer access to 'em. Fix this by offloading the update of table to the same taskqueue, we already use for flushing. Since taskqueues major task is now overloading, and flushing is optional, do mechanical rename s/flush/overload/ in the code related to the taskqueue. Since overloading tasks do unsafe referencing of rules, provide a bandaid in pf_purge_unlinked_rules(). If the latter sees any queued tasks, then it skips purging for this run. In table code: - Assert any lock in pfr_lookup_addr(). - Assert writer lock in pfr_route_kentry(). Modified: head/sys/netpfil/pf/pf.c head/sys/netpfil/pf/pf_table.c Modified: head/sys/netpfil/pf/pf.c ============================================================================== --- head/sys/netpfil/pf/pf.c Sat Sep 22 10:04:48 2012 (r240810) +++ head/sys/netpfil/pf/pf.c Sat Sep 22 10:14:47 2012 (r240811) @@ -163,25 +163,25 @@ static struct mtx pf_sendqueue_mtx; #define PF_SENDQ_UNLOCK() mtx_unlock(&pf_sendqueue_mtx) /* - * Queue for pf_flush_task() tasks. + * Queue for pf_overload_task() tasks. */ -struct pf_flush_entry { - SLIST_ENTRY(pf_flush_entry) next; +struct pf_overload_entry { + SLIST_ENTRY(pf_overload_entry) next; struct pf_addr addr; sa_family_t af; uint8_t dir; - struct pf_rule *rule; /* never dereferenced */ + struct pf_rule *rule; }; -SLIST_HEAD(pf_flush_head, pf_flush_entry); -static VNET_DEFINE(struct pf_flush_head, pf_flushqueue); -#define V_pf_flushqueue VNET(pf_flushqueue) -static VNET_DEFINE(struct task, pf_flushtask); -#define V_pf_flushtask VNET(pf_flushtask) - -static struct mtx pf_flushqueue_mtx; -#define PF_FLUSHQ_LOCK() mtx_lock(&pf_flushqueue_mtx) -#define PF_FLUSHQ_UNLOCK() mtx_unlock(&pf_flushqueue_mtx) +SLIST_HEAD(pf_overload_head, pf_overload_entry); +static VNET_DEFINE(struct pf_overload_head, pf_overloadqueue); +#define V_pf_overloadqueue VNET(pf_overloadqueue) +static VNET_DEFINE(struct task, pf_overloadtask); +#define V_pf_overloadtask VNET(pf_overloadtask) + +static struct mtx pf_overloadqueue_mtx; +#define PF_OVERLOADQ_LOCK() mtx_lock(&pf_overloadqueue_mtx) +#define PF_OVERLOADQ_UNLOCK() mtx_unlock(&pf_overloadqueue_mtx) VNET_DEFINE(struct pf_rulequeue, pf_unlinked_rules); struct mtx pf_unlnkdrules_mtx; @@ -279,7 +279,7 @@ static int pf_addr_wrap_neq(struct pf_ static struct pf_state *pf_find_state(struct pfi_kif *, struct pf_state_key_cmp *, u_int); static int pf_src_connlimit(struct pf_state **); -static void pf_flush_task(void *c, int pending); +static void pf_overload_task(void *c, int pending); static int pf_insert_src_node(struct pf_src_node **, struct pf_rule *, struct pf_addr *, sa_family_t); static int pf_purge_expired_states(int); @@ -461,8 +461,7 @@ pf_check_threshold(struct pf_threshold * static int pf_src_connlimit(struct pf_state **state) { - struct pfr_addr p; - struct pf_flush_entry *pffe; + struct pf_overload_entry *pfoe; int bad = 0; PF_STATE_LOCK_ASSERT(*state); @@ -494,69 +493,79 @@ pf_src_connlimit(struct pf_state **state if ((*state)->rule.ptr->overload_tbl == NULL) return (1); - V_pf_status.lcounters[LCNT_OVERLOAD_TABLE]++; - if (V_pf_status.debug >= PF_DEBUG_MISC) { - printf("%s: blocking address ", __func__); - pf_print_host(&(*state)->src_node->addr, 0, - (*state)->key[PF_SK_WIRE]->af); - printf("\n"); - } - - bzero(&p, sizeof(p)); - p.pfra_af = (*state)->key[PF_SK_WIRE]->af; - switch ((*state)->key[PF_SK_WIRE]->af) { -#ifdef INET - case AF_INET: - p.pfra_net = 32; - p.pfra_ip4addr = (*state)->src_node->addr.v4; - break; -#endif /* INET */ -#ifdef INET6 - case AF_INET6: - p.pfra_net = 128; - p.pfra_ip6addr = (*state)->src_node->addr.v6; - break; -#endif /* INET6 */ - } - - pfr_insert_kentry((*state)->rule.ptr->overload_tbl, &p, time_second); - - if ((*state)->rule.ptr->flush == 0) - return (1); - - /* Schedule flushing task. */ - pffe = malloc(sizeof(*pffe), M_PFTEMP, M_NOWAIT); - if (pffe == NULL) + /* Schedule overloading and flushing task. */ + pfoe = malloc(sizeof(*pfoe), M_PFTEMP, M_NOWAIT); + if (pfoe == NULL) return (1); /* too bad :( */ - bcopy(&(*state)->src_node->addr, &pffe->addr, sizeof(pffe->addr)); - pffe->af = (*state)->key[PF_SK_WIRE]->af; - pffe->dir = (*state)->direction; - if ((*state)->rule.ptr->flush & PF_FLUSH_GLOBAL) - pffe->rule = NULL; - else - pffe->rule = (*state)->rule.ptr; - PF_FLUSHQ_LOCK(); - SLIST_INSERT_HEAD(&V_pf_flushqueue, pffe, next); - PF_FLUSHQ_UNLOCK(); - taskqueue_enqueue(taskqueue_swi, &V_pf_flushtask); + bcopy(&(*state)->src_node->addr, &pfoe->addr, sizeof(pfoe->addr)); + pfoe->af = (*state)->key[PF_SK_WIRE]->af; + pfoe->rule = (*state)->rule.ptr; + pfoe->dir = (*state)->direction; + PF_OVERLOADQ_LOCK(); + SLIST_INSERT_HEAD(&V_pf_overloadqueue, pfoe, next); + PF_OVERLOADQ_UNLOCK(); + taskqueue_enqueue(taskqueue_swi, &V_pf_overloadtask); return (1); } static void -pf_flush_task(void *c, int pending) +pf_overload_task(void *c, int pending) { - struct pf_flush_head queue; - struct pf_flush_entry *pffe, *pffe1; + struct pf_overload_head queue; + struct pfr_addr p; + struct pf_overload_entry *pfoe, *pfoe1; uint32_t killed = 0; - PF_FLUSHQ_LOCK(); - queue = *(struct pf_flush_head *)c; - SLIST_INIT((struct pf_flush_head *)c); - PF_FLUSHQ_UNLOCK(); + PF_OVERLOADQ_LOCK(); + queue = *(struct pf_overload_head *)c; + SLIST_INIT((struct pf_overload_head *)c); + PF_OVERLOADQ_UNLOCK(); + + bzero(&p, sizeof(p)); + SLIST_FOREACH(pfoe, &queue, next) { + V_pf_status.lcounters[LCNT_OVERLOAD_TABLE]++; + if (V_pf_status.debug >= PF_DEBUG_MISC) { + printf("%s: blocking address ", __func__); + pf_print_host(&pfoe->addr, 0, pfoe->af); + printf("\n"); + } + + p.pfra_af = pfoe->af; + switch (pfoe->af) { +#ifdef INET + case AF_INET: + p.pfra_net = 32; + p.pfra_ip4addr = pfoe->addr.v4; + break; +#endif +#ifdef INET6 + case AF_INET6: + p.pfra_net = 128; + p.pfra_ip6addr = pfoe->addr.v6; + break; +#endif + } + + PF_RULES_WLOCK(); + pfr_insert_kentry(pfoe->rule->overload_tbl, &p, time_second); + PF_RULES_WUNLOCK(); + } + + /* + * Remove those entries, that don't need flushing. + */ + SLIST_FOREACH_SAFE(pfoe, &queue, next, pfoe1) + if (pfoe->rule->flush == 0) { + SLIST_REMOVE(&queue, pfoe, pf_overload_entry, next); + free(pfoe, M_PFTEMP); + } else + V_pf_status.lcounters[LCNT_OVERLOAD_FLUSH]++; - V_pf_status.lcounters[LCNT_OVERLOAD_FLUSH]++; + /* If nothing to flush, return. */ + if (SLIST_EMPTY(&queue)) + return; for (int i = 0; i <= V_pf_hashmask; i++) { struct pf_idhash *ih = &V_pf_idhash[i]; @@ -566,13 +575,14 @@ pf_flush_task(void *c, int pending) PF_HASHROW_LOCK(ih); LIST_FOREACH(s, &ih->states, entry) { sk = s->key[PF_SK_WIRE]; - SLIST_FOREACH(pffe, &queue, next) - if (sk->af == pffe->af && (pffe->rule == NULL || - pffe->rule == s->rule.ptr) && - ((pffe->dir == PF_OUT && - PF_AEQ(&pffe->addr, &sk->addr[1], sk->af)) || - (pffe->dir == PF_IN && - PF_AEQ(&pffe->addr, &sk->addr[0], sk->af)))) { + SLIST_FOREACH(pfoe, &queue, next) + if (sk->af == pfoe->af && + ((pfoe->rule->flush & PF_FLUSH_GLOBAL) || + pfoe->rule == s->rule.ptr) && + ((pfoe->dir == PF_OUT && + PF_AEQ(&pfoe->addr, &sk->addr[1], sk->af)) || + (pfoe->dir == PF_IN && + PF_AEQ(&pfoe->addr, &sk->addr[0], sk->af)))) { s->timeout = PFTM_PURGE; s->src.state = s->dst.state = TCPS_CLOSED; killed++; @@ -580,8 +590,8 @@ pf_flush_task(void *c, int pending) } PF_HASHROW_UNLOCK(ih); } - SLIST_FOREACH_SAFE(pffe, &queue, next, pffe1) - free(pffe, M_PFTEMP); + SLIST_FOREACH_SAFE(pfoe, &queue, next, pfoe1) + free(pfoe, M_PFTEMP); if (V_pf_status.debug >= PF_DEBUG_MISC) printf("%s: %u states killed", __func__, killed); } @@ -742,12 +752,13 @@ pf_initialize() sizeof(struct pf_mtag), NULL, NULL, pf_mtag_init, NULL, UMA_ALIGN_PTR, 0); - /* Send & flush queues. */ + /* Send & overload+flush queues. */ STAILQ_INIT(&V_pf_sendqueue); - SLIST_INIT(&V_pf_flushqueue); - TASK_INIT(&V_pf_flushtask, 0, pf_flush_task, &V_pf_flushqueue); + SLIST_INIT(&V_pf_overloadqueue); + TASK_INIT(&V_pf_overloadtask, 0, pf_overload_task, &V_pf_overloadqueue); mtx_init(&pf_sendqueue_mtx, "pf send queue", NULL, MTX_DEF); - mtx_init(&pf_flushqueue_mtx, "pf flush queue", NULL, MTX_DEF); + mtx_init(&pf_overloadqueue_mtx, "pf overload/flush queue", NULL, + MTX_DEF); /* Unlinked, but may be referenced rules. */ TAILQ_INIT(&V_pf_unlinked_rules); @@ -788,7 +799,7 @@ pf_cleanup() } mtx_destroy(&pf_sendqueue_mtx); - mtx_destroy(&pf_flushqueue_mtx); + mtx_destroy(&pf_overloadqueue_mtx); mtx_destroy(&pf_unlnkdrules_mtx); uma_zdestroy(V_pf_mtag_z); @@ -1579,6 +1590,19 @@ pf_purge_unlinked_rules() struct pf_rule *r, *r1; /* + * If we have overloading task pending, then we'd + * better skip purging this time. There is a tiny + * probability that overloading task references + * an already unlinked rule. + */ + PF_OVERLOADQ_LOCK(); + if (!SLIST_EMPTY(&V_pf_overloadqueue)) { + PF_OVERLOADQ_UNLOCK(); + return; + } + PF_OVERLOADQ_UNLOCK(); + + /* * Do naive mark-and-sweep garbage collecting of old rules. * Reference flag is raised by pf_purge_expired_states() * and pf_purge_expired_src_nodes(). Modified: head/sys/netpfil/pf/pf_table.c ============================================================================== --- head/sys/netpfil/pf/pf_table.c Sat Sep 22 10:04:48 2012 (r240810) +++ head/sys/netpfil/pf/pf_table.c Sat Sep 22 10:14:47 2012 (r240811) @@ -742,6 +742,8 @@ pfr_lookup_addr(struct pfr_ktable *kt, s struct radix_node_head *head = NULL; struct pfr_kentry *ke; + PF_RULES_ASSERT(); + bzero(&sa, sizeof(sa)); if (ad->pfra_af == AF_INET) { FILLIN_SIN(sa.sin, ad->pfra_ip4addr); @@ -929,6 +931,8 @@ pfr_route_kentry(struct pfr_ktable *kt, struct radix_node *rn; struct radix_node_head *head = NULL; + PF_RULES_WASSERT(); + bzero(ke->pfrke_node, sizeof(ke->pfrke_node)); if (ke->pfrke_af == AF_INET) head = kt->pfrkt_ip4; From owner-svn-src-all@FreeBSD.ORG Sat Sep 22 12:17:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CFD20106564A; Sat, 22 Sep 2012 12:17:09 +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 BC4108FC15; Sat, 22 Sep 2012 12:17:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8MCH9ob064473; Sat, 22 Sep 2012 12:17:09 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8MCH9Ip064471; Sat, 22 Sep 2012 12:17:09 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201209221217.q8MCH9Ip064471@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 22 Sep 2012 12:17:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240813 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Sep 2012 12:17:09 -0000 Author: kib Date: Sat Sep 22 12:17:09 2012 New Revision: 240813 URL: http://svn.freebsd.org/changeset/base/240813 Log: Do not skip two elements of the tid_buffer when reusing the buffer slot. This eventually results in exhaustion of the tid space, causing new threads get tid -1 as identifier. The bad effect of having the thread id equal to -1 is that UMTX_OP_UMUTEX_WAIT returns EFAULT for a lock owned by such thread, because casuword cannot distinguish between literal value -1 read from the address and -1 returned as an indication of faulted access. _thr_umutex_lock() helper from libthr does not check for errors from _umtx_op_err(2), causing an infinite loop in mutex_lock_sleep(). We observed the JVM processes hanging and consuming enormous amount of system time on machines with approximately 100 days uptime. Reported by: Mykola Dzham MFC after: 1 week Modified: head/sys/kern/kern_thread.c Modified: head/sys/kern/kern_thread.c ============================================================================== --- head/sys/kern/kern_thread.c Sat Sep 22 12:12:39 2012 (r240812) +++ head/sys/kern/kern_thread.c Sat Sep 22 12:17:09 2012 (r240813) @@ -116,7 +116,7 @@ tid_free(lwpid_t tid) mtx_lock(&tid_lock); if ((tid_tail + 1) % TID_BUFFER_SIZE == tid_head) { tmp_tid = tid_buffer[tid_head++]; - tid_head = (tid_head + 1) % TID_BUFFER_SIZE; + tid_head %= TID_BUFFER_SIZE; } tid_buffer[tid_tail++] = tid; tid_tail %= TID_BUFFER_SIZE; From owner-svn-src-all@FreeBSD.ORG Sat Sep 22 12:27:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E9F8C106564A; Sat, 22 Sep 2012 12:27:50 +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 D40D78FC1E; Sat, 22 Sep 2012 12:27:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8MCRop9065765; Sat, 22 Sep 2012 12:27:50 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8MCRohF065762; Sat, 22 Sep 2012 12:27:50 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201209221227.q8MCRohF065762@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 22 Sep 2012 12:27:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240814 - in stable/9/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Sep 2012 12:27:51 -0000 Author: kib Date: Sat Sep 22 12:27:50 2012 New Revision: 240814 URL: http://svn.freebsd.org/changeset/base/240814 Log: MFC r237431: Enchance the shared page chunk allocator. Modified: stable/9/sys/kern/kern_exec.c stable/9/sys/sys/sysent.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/kern_exec.c ============================================================================== --- stable/9/sys/kern/kern_exec.c Sat Sep 22 12:17:09 2012 (r240813) +++ stable/9/sys/kern/kern_exec.c Sat Sep 22 12:27:50 2012 (r240814) @@ -1514,33 +1514,81 @@ exec_unregister(execsw_arg) return (0); } +static struct sx shared_page_alloc_sx; static vm_object_t shared_page_obj; static int shared_page_free; -int -shared_page_fill(int size, int align, const char *data) +struct sf_buf * +shared_page_write_start(int base) { vm_page_t m; struct sf_buf *s; + + VM_OBJECT_LOCK(shared_page_obj); + m = vm_page_grab(shared_page_obj, OFF_TO_IDX(base), VM_ALLOC_RETRY); + VM_OBJECT_UNLOCK(shared_page_obj); + s = sf_buf_alloc(m, SFB_DEFAULT); + return (s); +} + +void +shared_page_write_end(struct sf_buf *sf) +{ + vm_page_t m; + + m = sf_buf_page(sf); + sf_buf_free(sf); + VM_OBJECT_LOCK(shared_page_obj); + vm_page_wakeup(m); + VM_OBJECT_UNLOCK(shared_page_obj); +} + +void +shared_page_write(int base, int size, const void *data) +{ + struct sf_buf *sf; vm_offset_t sk; + + sf = shared_page_write_start(base); + sk = sf_buf_kva(sf); + bcopy(data, (void *)(sk + (base & PAGE_MASK)), size); + shared_page_write_end(sf); +} + +static int +shared_page_alloc_locked(int size, int align) +{ int res; - VM_OBJECT_LOCK(shared_page_obj); - m = vm_page_grab(shared_page_obj, 0, VM_ALLOC_RETRY); res = roundup(shared_page_free, align); if (res + size >= IDX_TO_OFF(shared_page_obj->size)) res = -1; - else { - VM_OBJECT_UNLOCK(shared_page_obj); - s = sf_buf_alloc(m, SFB_DEFAULT); - sk = sf_buf_kva(s); - bcopy(data, (void *)(sk + res), size); + else shared_page_free = res + size; - sf_buf_free(s); - VM_OBJECT_LOCK(shared_page_obj); - } - vm_page_wakeup(m); - VM_OBJECT_UNLOCK(shared_page_obj); + return (res); +} + +int +shared_page_alloc(int size, int align) +{ + int res; + + sx_xlock(&shared_page_alloc_sx); + res = shared_page_alloc_locked(size, align); + sx_xunlock(&shared_page_alloc_sx); + return (res); +} + +int +shared_page_fill(int size, int align, const void *data) +{ + int res; + + sx_xlock(&shared_page_alloc_sx); + res = shared_page_alloc_locked(size, align); + if (res != -1) + shared_page_write(res, size, data); + sx_xunlock(&shared_page_alloc_sx); return (res); } @@ -1549,6 +1597,7 @@ shared_page_init(void *dummy __unused) { vm_page_t m; + sx_init(&shared_page_alloc_sx, "shpsx"); shared_page_obj = vm_pager_allocate(OBJT_PHYS, 0, PAGE_SIZE, VM_PROT_DEFAULT, 0, NULL); VM_OBJECT_LOCK(shared_page_obj); Modified: stable/9/sys/sys/sysent.h ============================================================================== --- stable/9/sys/sys/sysent.h Sat Sep 22 12:17:09 2012 (r240813) +++ stable/9/sys/sys/sysent.h Sat Sep 22 12:27:50 2012 (r240814) @@ -256,8 +256,13 @@ int lkmressys(struct thread *, struct no int syscall_thread_enter(struct thread *td, struct sysent *se); void syscall_thread_exit(struct thread *td, struct sysent *se); -int shared_page_fill(int size, int align, const char *data); +struct sf_buf; +int shared_page_alloc(int size, int align); +int shared_page_fill(int size, int align, const void *data); +void shared_page_write(int base, int size, const void *data); void exec_sysvec_init(void *param); +struct sf_buf *shared_page_write_start(int base); +void shared_page_write_end(struct sf_buf *sf); #define INIT_SYSENTVEC(name, sv) \ SYSINIT(name, SI_SUB_EXEC, SI_ORDER_ANY, \ From owner-svn-src-all@FreeBSD.ORG Sat Sep 22 12:32:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A1AB8106564A; Sat, 22 Sep 2012 12:32:04 +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 875938FC14; Sat, 22 Sep 2012 12:32:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8MCW4we066414; Sat, 22 Sep 2012 12:32:04 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8MCW4K6066393; Sat, 22 Sep 2012 12:32:04 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201209221232.q8MCW4K6066393@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 22 Sep 2012 12:32:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240815 - in stable/9/sys: amd64/include arm/include conf i386/include ia64/include kern mips/include pc98/include powerpc/include sparc64/include sys x86/include x86/x86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Sep 2012 12:32:04 -0000 Author: kib Date: Sat Sep 22 12:32:00 2012 New Revision: 240815 URL: http://svn.freebsd.org/changeset/base/240815 Log: MFC r237433: Implement mechanism to export some kernel timekeeping data to usermode, using shared page. MFC r237474: Stop updating the struct vdso_timehands from even handler executed in the scheduled task from tc_windup(). Do it directly from tc_windup in interrupt context. Added: stable/9/sys/amd64/include/vdso.h - copied unchanged from r237433, head/sys/amd64/include/vdso.h stable/9/sys/arm/include/vdso.h - copied unchanged from r237433, head/sys/arm/include/vdso.h stable/9/sys/i386/include/vdso.h - copied unchanged from r237433, head/sys/i386/include/vdso.h stable/9/sys/ia64/include/vdso.h - copied unchanged from r237433, head/sys/ia64/include/vdso.h stable/9/sys/kern/subr_dummy_vdso_tc.c - copied unchanged from r237433, head/sys/kern/subr_dummy_vdso_tc.c stable/9/sys/mips/include/vdso.h - copied unchanged from r237433, head/sys/mips/include/vdso.h stable/9/sys/pc98/include/vdso.h - copied unchanged from r237433, head/sys/pc98/include/vdso.h stable/9/sys/powerpc/include/vdso.h - copied unchanged from r237433, head/sys/powerpc/include/vdso.h stable/9/sys/sparc64/include/vdso.h - copied unchanged from r237433, head/sys/sparc64/include/vdso.h stable/9/sys/sys/vdso.h - copied, changed from r237433, head/sys/sys/vdso.h stable/9/sys/x86/include/vdso.h - copied unchanged from r237433, head/sys/x86/include/vdso.h Modified: stable/9/sys/conf/files.arm stable/9/sys/conf/files.ia64 stable/9/sys/conf/files.mips stable/9/sys/conf/files.powerpc stable/9/sys/conf/files.sparc64 stable/9/sys/kern/imgact_elf.c stable/9/sys/kern/kern_exec.c stable/9/sys/kern/kern_tc.c stable/9/sys/sys/sysent.h stable/9/sys/x86/x86/tsc.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/conf/ (props changed) Copied: stable/9/sys/amd64/include/vdso.h (from r237433, head/sys/amd64/include/vdso.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sys/amd64/include/vdso.h Sat Sep 22 12:32:00 2012 (r240815, copy of r237433, head/sys/amd64/include/vdso.h) @@ -0,0 +1,6 @@ +/*- + * This file is in the public domain. + */ +/* $FreeBSD$ */ + +#include Copied: stable/9/sys/arm/include/vdso.h (from r237433, head/sys/arm/include/vdso.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sys/arm/include/vdso.h Sat Sep 22 12:32:00 2012 (r240815, copy of r237433, head/sys/arm/include/vdso.h) @@ -0,0 +1,34 @@ +/*- + * Copyright 2012 Konstantin Belousov . + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _ARM_VDSO_H +#define _ARM_VDSO_H + +#define VDSO_TIMEHANDS_MD \ + uint32_t th_res[8]; + +#endif Modified: stable/9/sys/conf/files.arm ============================================================================== --- stable/9/sys/conf/files.arm Sat Sep 22 12:27:50 2012 (r240814) +++ stable/9/sys/conf/files.arm Sat Sep 22 12:32:00 2012 (r240815) @@ -76,3 +76,5 @@ libkern/umoddi3.c standard #XXX: We can't use these versions, as strcmp.c is included conf/files #libkern/arm/strcmp.S standard #libkern/arm/strncmp.S standard +# +kern/subr_dummy_vdso_tc.c standard Modified: stable/9/sys/conf/files.ia64 ============================================================================== --- stable/9/sys/conf/files.ia64 Sat Sep 22 12:27:50 2012 (r240814) +++ stable/9/sys/conf/files.ia64 Sat Sep 22 12:32:00 2012 (r240815) @@ -137,3 +137,4 @@ libkern/ia64/bswap16.S standard libkern/ia64/bswap32.S standard libkern/memmove.c standard libkern/memset.c standard +kern/subr_dummy_vdso_tc.c standard Modified: stable/9/sys/conf/files.mips ============================================================================== --- stable/9/sys/conf/files.mips Sat Sep 22 12:27:50 2012 (r240814) +++ stable/9/sys/conf/files.mips Sat Sep 22 12:32:00 2012 (r240815) @@ -89,6 +89,8 @@ libkern/umoddi3.c optional isa_mips32 #libkern/mips/strcmp.S standard #libkern/mips/strncmp.S standard +kern/subr_dummy_vdso_tc.c standard + kern/kern_clocksource.c standard kern/link_elf_obj.c standard Modified: stable/9/sys/conf/files.powerpc ============================================================================== --- stable/9/sys/conf/files.powerpc Sat Sep 22 12:27:50 2012 (r240814) +++ stable/9/sys/conf/files.powerpc Sat Sep 22 12:32:00 2012 (r240815) @@ -58,6 +58,7 @@ dev/tsec/if_tsec.c optional tsec dev/tsec/if_tsec_fdt.c optional tsec fdt dev/uart/uart_cpu_powerpc.c optional uart aim kern/kern_clocksource.c standard +kern/subr_dummy_vdso_tc.c standard kern/syscalls.c optional ktr libkern/ashldi3.c optional powerpc libkern/ashrdi3.c optional powerpc Modified: stable/9/sys/conf/files.sparc64 ============================================================================== --- stable/9/sys/conf/files.sparc64 Sat Sep 22 12:27:50 2012 (r240814) +++ stable/9/sys/conf/files.sparc64 Sat Sep 22 12:32:00 2012 (r240815) @@ -60,6 +60,7 @@ dev/syscons/scvtb.c optional sc dev/uart/uart_cpu_sparc64.c optional uart dev/uart/uart_kbd_sun.c optional uart sc kern/kern_clocksource.c standard +kern/subr_dummy_vdso_tc.c standard kern/syscalls.c optional ktr libkern/ffs.c standard libkern/ffsl.c standard Copied: stable/9/sys/i386/include/vdso.h (from r237433, head/sys/i386/include/vdso.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sys/i386/include/vdso.h Sat Sep 22 12:32:00 2012 (r240815, copy of r237433, head/sys/i386/include/vdso.h) @@ -0,0 +1,6 @@ +/*- + * This file is in the public domain. + */ +/* $FreeBSD$ */ + +#include Copied: stable/9/sys/ia64/include/vdso.h (from r237433, head/sys/ia64/include/vdso.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sys/ia64/include/vdso.h Sat Sep 22 12:32:00 2012 (r240815, copy of r237433, head/sys/ia64/include/vdso.h) @@ -0,0 +1,41 @@ +/*- + * Copyright 2012 Konstantin Belousov . + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _IA64_VDSO_H +#define _IA64_VDSO_H + +#define VDSO_TIMEHANDS_MD \ + uint32_t th_res[8]; + +#ifdef _KERNEL +#ifdef COMPAT_FREEBSD32 + +#define VDSO_TIMEHANDS_MD32 VDSO_TIMEHANDS_MD + +#endif +#endif +#endif Modified: stable/9/sys/kern/imgact_elf.c ============================================================================== --- stable/9/sys/kern/imgact_elf.c Sat Sep 22 12:27:50 2012 (r240814) +++ stable/9/sys/kern/imgact_elf.c Sat Sep 22 12:32:00 2012 (r240815) @@ -1015,6 +1015,10 @@ __elfN(freebsd_fixup)(register_t **stack AUXARGS_ENTRY(pos, AT_PAGESIZES, imgp->pagesizes); AUXARGS_ENTRY(pos, AT_PAGESIZESLEN, imgp->pagesizeslen); } + if (imgp->sysent->sv_timekeep_base != 0) { + AUXARGS_ENTRY(pos, AT_TIMEKEEP, + imgp->sysent->sv_timekeep_base); + } AUXARGS_ENTRY(pos, AT_STACKPROT, imgp->sysent->sv_shared_page_obj != NULL && imgp->stack_prot != 0 ? imgp->stack_prot : imgp->sysent->sv_stackprot); Modified: stable/9/sys/kern/kern_exec.c ============================================================================== --- stable/9/sys/kern/kern_exec.c Sat Sep 22 12:27:50 2012 (r240814) +++ stable/9/sys/kern/kern_exec.c Sat Sep 22 12:32:00 2012 (r240815) @@ -28,6 +28,7 @@ __FBSDID("$FreeBSD$"); #include "opt_capsicum.h" +#include "opt_compat.h" #include "opt_hwpmc_hooks.h" #include "opt_kdtrace.h" #include "opt_ktrace.h" @@ -64,6 +65,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #ifdef KTRACE @@ -1517,42 +1519,13 @@ exec_unregister(execsw_arg) static struct sx shared_page_alloc_sx; static vm_object_t shared_page_obj; static int shared_page_free; - -struct sf_buf * -shared_page_write_start(int base) -{ - vm_page_t m; - struct sf_buf *s; - - VM_OBJECT_LOCK(shared_page_obj); - m = vm_page_grab(shared_page_obj, OFF_TO_IDX(base), VM_ALLOC_RETRY); - VM_OBJECT_UNLOCK(shared_page_obj); - s = sf_buf_alloc(m, SFB_DEFAULT); - return (s); -} - -void -shared_page_write_end(struct sf_buf *sf) -{ - vm_page_t m; - - m = sf_buf_page(sf); - sf_buf_free(sf); - VM_OBJECT_LOCK(shared_page_obj); - vm_page_wakeup(m); - VM_OBJECT_UNLOCK(shared_page_obj); -} +char *shared_page_mapping; void shared_page_write(int base, int size, const void *data) { - struct sf_buf *sf; - vm_offset_t sk; - sf = shared_page_write_start(base); - sk = sf_buf_kva(sf); - bcopy(data, (void *)(sk + (base & PAGE_MASK)), size); - shared_page_write_end(sf); + bcopy(data, shared_page_mapping + base, size); } static int @@ -1596,6 +1569,7 @@ static void shared_page_init(void *dummy __unused) { vm_page_t m; + vm_offset_t addr; sx_init(&shared_page_alloc_sx, "shpsx"); shared_page_obj = vm_pager_allocate(OBJT_PHYS, 0, PAGE_SIZE, @@ -1605,15 +1579,95 @@ shared_page_init(void *dummy __unused) VM_ALLOC_ZERO); m->valid = VM_PAGE_BITS_ALL; VM_OBJECT_UNLOCK(shared_page_obj); + addr = kmem_alloc_nofault(kernel_map, PAGE_SIZE); + pmap_qenter(addr, &m, 1); + shared_page_mapping = (char *)addr; } SYSINIT(shp, SI_SUB_EXEC, SI_ORDER_FIRST, (sysinit_cfunc_t)shared_page_init, NULL); +static void +timehands_update(struct sysentvec *sv) +{ + struct vdso_timehands th; + struct vdso_timekeep *tk; + uint32_t enabled, idx; + + enabled = tc_fill_vdso_timehands(&th); + tk = (struct vdso_timekeep *)(shared_page_mapping + + sv->sv_timekeep_off); + idx = sv->sv_timekeep_curr; + atomic_store_rel_32(&tk->tk_th[idx].th_gen, 0); + if (++idx >= VDSO_TH_NUM) + idx = 0; + sv->sv_timekeep_curr = idx; + if (++sv->sv_timekeep_gen == 0) + sv->sv_timekeep_gen = 1; + th.th_gen = 0; + if (enabled) + tk->tk_th[idx] = th; + tk->tk_enabled = enabled; + atomic_store_rel_32(&tk->tk_th[idx].th_gen, sv->sv_timekeep_gen); + tk->tk_current = idx; +} + +#ifdef COMPAT_FREEBSD32 +static void +timehands_update32(struct sysentvec *sv) +{ + struct vdso_timekeep32 *tk; + struct vdso_timehands32 th; + uint32_t enabled, idx; + + enabled = tc_fill_vdso_timehands32(&th); + tk = (struct vdso_timekeep32 *)(shared_page_mapping + + sv->sv_timekeep_off); + idx = sv->sv_timekeep_curr; + atomic_store_rel_32(&tk->tk_th[idx].th_gen, 0); + if (++idx >= VDSO_TH_NUM) + idx = 0; + sv->sv_timekeep_curr = idx; + if (++sv->sv_timekeep_gen == 0) + sv->sv_timekeep_gen = 1; + th.th_gen = 0; + if (enabled) + tk->tk_th[idx] = th; + tk->tk_enabled = enabled; + atomic_store_rel_32(&tk->tk_th[idx].th_gen, sv->sv_timekeep_gen); + tk->tk_current = idx; +} +#endif + +/* + * This is hackish, but easiest way to avoid creating list structures + * that needs to be iterated over from the hardclock interrupt + * context. + */ +static struct sysentvec *host_sysentvec; +#ifdef COMPAT_FREEBSD32 +static struct sysentvec *compat32_sysentvec; +#endif + +void +timekeep_push_vdso(void) +{ + + if (host_sysentvec != NULL && host_sysentvec->sv_timekeep_base != 0) + timehands_update(host_sysentvec); +#ifdef COMPAT_FREEBSD32 + if (compat32_sysentvec != NULL && + compat32_sysentvec->sv_timekeep_base != 0) + timehands_update32(compat32_sysentvec); +#endif +} + void exec_sysvec_init(void *param) { struct sysentvec *sv; + int tk_base; + uint32_t tk_ver; sv = (struct sysentvec *)param; @@ -1622,4 +1676,32 @@ exec_sysvec_init(void *param) sv->sv_shared_page_obj = shared_page_obj; sv->sv_sigcode_base = sv->sv_shared_page_base + shared_page_fill(*(sv->sv_szsigcode), 16, sv->sv_sigcode); + if ((sv->sv_flags & SV_ABI_MASK) != SV_ABI_FREEBSD) + return; + tk_ver = VDSO_TK_VER_CURR; +#ifdef COMPAT_FREEBSD32 + if ((sv->sv_flags & SV_ILP32) != 0) { + tk_base = shared_page_alloc(sizeof(struct vdso_timekeep32) + + sizeof(struct vdso_timehands32) * VDSO_TH_NUM, 16); + KASSERT(tk_base != -1, ("tk_base -1 for 32bit")); + shared_page_write(tk_base + offsetof(struct vdso_timekeep32, + tk_ver), sizeof(uint32_t), &tk_ver); + KASSERT(compat32_sysentvec == 0, + ("Native compat32 already registered")); + compat32_sysentvec = sv; + } else { +#endif + tk_base = shared_page_alloc(sizeof(struct vdso_timekeep) + + sizeof(struct vdso_timehands) * VDSO_TH_NUM, 16); + KASSERT(tk_base != -1, ("tk_base -1 for native")); + shared_page_write(tk_base + offsetof(struct vdso_timekeep, + tk_ver), sizeof(uint32_t), &tk_ver); + KASSERT(host_sysentvec == 0, ("Native already registered")); + host_sysentvec = sv; +#ifdef COMPAT_FREEBSD32 + } +#endif + sv->sv_timekeep_base = sv->sv_shared_page_base + tk_base; + sv->sv_timekeep_off = tk_base; + timekeep_push_vdso(); } Modified: stable/9/sys/kern/kern_tc.c ============================================================================== --- stable/9/sys/kern/kern_tc.c Sat Sep 22 12:27:50 2012 (r240814) +++ stable/9/sys/kern/kern_tc.c Sat Sep 22 12:32:00 2012 (r240815) @@ -10,6 +10,7 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_compat.h" #include "opt_ntp.h" #include @@ -20,6 +21,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include /* * A large step happens on boot. This constant detects such steps. @@ -544,6 +546,7 @@ tc_windup(void) time_second = th->th_microtime.tv_sec; time_uptime = th->th_offset.sec; timehands = th; + timekeep_push_vdso(); } /* Report or change the active timecounter hardware. */ @@ -570,6 +573,7 @@ sysctl_kern_timecounter_hardware(SYSCTL_ (void)newtc->tc_get_timecount(newtc); timecounter = newtc; + timekeep_push_vdso(); return (0); } return (EINVAL); @@ -960,3 +964,63 @@ cputick2usec(uint64_t tick) } cpu_tick_f *cpu_ticks = tc_cpu_ticks; + +static int vdso_th_enable = 1; +static int +sysctl_fast_gettime(SYSCTL_HANDLER_ARGS) +{ + int old_vdso_th_enable, error; + + old_vdso_th_enable = vdso_th_enable; + error = sysctl_handle_int(oidp, &old_vdso_th_enable, 0, req); + if (error != 0) + return (error); + vdso_th_enable = old_vdso_th_enable; + timekeep_push_vdso(); + return (0); +} +SYSCTL_PROC(_kern_timecounter, OID_AUTO, fast_gettime, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, + NULL, 0, sysctl_fast_gettime, "I", "Enable fast time of day"); + +uint32_t +tc_fill_vdso_timehands(struct vdso_timehands *vdso_th) +{ + struct timehands *th; + uint32_t enabled; + + th = timehands; + vdso_th->th_algo = VDSO_TH_ALGO_1; + vdso_th->th_scale = th->th_scale; + vdso_th->th_offset_count = th->th_offset_count; + vdso_th->th_counter_mask = th->th_counter->tc_counter_mask; + vdso_th->th_offset = th->th_offset; + vdso_th->th_boottime = boottimebin; + enabled = cpu_fill_vdso_timehands(vdso_th); + if (!vdso_th_enable) + enabled = 0; + return (enabled); +} + +#ifdef COMPAT_FREEBSD32 +uint32_t +tc_fill_vdso_timehands32(struct vdso_timehands32 *vdso_th32) +{ + struct timehands *th; + uint32_t enabled; + + th = timehands; + vdso_th32->th_algo = VDSO_TH_ALGO_1; + *(uint64_t *)&vdso_th32->th_scale[0] = th->th_scale; + vdso_th32->th_offset_count = th->th_offset_count; + vdso_th32->th_counter_mask = th->th_counter->tc_counter_mask; + vdso_th32->th_offset.sec = th->th_offset.sec; + *(uint64_t *)&vdso_th32->th_offset.frac[0] = th->th_offset.frac; + vdso_th32->th_boottime.sec = boottimebin.sec; + *(uint64_t *)&vdso_th32->th_boottime.frac[0] = boottimebin.frac; + enabled = cpu_fill_vdso_timehands32(vdso_th32); + if (!vdso_th_enable) + enabled = 0; + return (enabled); +} +#endif Copied: stable/9/sys/kern/subr_dummy_vdso_tc.c (from r237433, head/sys/kern/subr_dummy_vdso_tc.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sys/kern/subr_dummy_vdso_tc.c Sat Sep 22 12:32:00 2012 (r240815, copy of r237433, head/sys/kern/subr_dummy_vdso_tc.c) @@ -0,0 +1,49 @@ +/*- + * Copyright 2012 Konstantin Belousov . + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_compat.h" + +#include +#include + +uint32_t +cpu_fill_vdso_timehands(struct vdso_timehands *vdso_th) +{ + + return (0); +} + +#ifdef COMPAT_FREEBSD32 +uint32_t +cpu_fill_vdso_timehands32(struct vdso_timehands32 *vdso_th32) +{ + + return (0); +} +#endif Copied: stable/9/sys/mips/include/vdso.h (from r237433, head/sys/mips/include/vdso.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sys/mips/include/vdso.h Sat Sep 22 12:32:00 2012 (r240815, copy of r237433, head/sys/mips/include/vdso.h) @@ -0,0 +1,41 @@ +/*- + * Copyright 2012 Konstantin Belousov . + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _MIPS_VDSO_H +#define _MIPS_VDSO_H + +#define VDSO_TIMEHANDS_MD \ + uint32_t th_res[8]; + +#ifdef _KERNEL +#ifdef COMPAT_FREEBSD32 + +#define VDSO_TIMEHANDS_MD32 VDSO_TIMEHANDS_MD + +#endif +#endif +#endif Copied: stable/9/sys/pc98/include/vdso.h (from r237433, head/sys/pc98/include/vdso.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sys/pc98/include/vdso.h Sat Sep 22 12:32:00 2012 (r240815, copy of r237433, head/sys/pc98/include/vdso.h) @@ -0,0 +1,6 @@ +/*- + * This file is in the public domain. + */ +/* $FreeBSD$ */ + +#include Copied: stable/9/sys/powerpc/include/vdso.h (from r237433, head/sys/powerpc/include/vdso.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sys/powerpc/include/vdso.h Sat Sep 22 12:32:00 2012 (r240815, copy of r237433, head/sys/powerpc/include/vdso.h) @@ -0,0 +1,41 @@ +/*- + * Copyright 2012 Konstantin Belousov . + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _POWERPC_VDSO_H +#define _POWERPC_VDSO_H + +#define VDSO_TIMEHANDS_MD \ + uint32_t th_res[8]; + +#ifdef _KERNEL +#ifdef COMPAT_FREEBSD32 + +#define VDSO_TIMEHANDS_MD32 VDSO_TIMEHANDS_MD + +#endif +#endif +#endif Copied: stable/9/sys/sparc64/include/vdso.h (from r237433, head/sys/sparc64/include/vdso.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sys/sparc64/include/vdso.h Sat Sep 22 12:32:00 2012 (r240815, copy of r237433, head/sys/sparc64/include/vdso.h) @@ -0,0 +1,34 @@ +/*- + * Copyright 2012 Konstantin Belousov . + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _SPARC64_VDSO_H +#define _SPARC64_VDSO_H + +#define VDSO_TIMEHANDS_MD \ + uint32_t th_res[8]; + +#endif Modified: stable/9/sys/sys/sysent.h ============================================================================== --- stable/9/sys/sys/sysent.h Sat Sep 22 12:27:50 2012 (r240814) +++ stable/9/sys/sys/sysent.h Sat Sep 22 12:32:00 2012 (r240815) @@ -124,6 +124,10 @@ struct sysentvec { vm_offset_t sv_shared_page_base; vm_offset_t sv_shared_page_len; vm_offset_t sv_sigcode_base; + vm_offset_t sv_timekeep_base; + int sv_timekeep_off; + int sv_timekeep_curr; + uint32_t sv_timekeep_gen; void *sv_shared_page_obj; void (*sv_schedtail)(struct thread *); }; @@ -261,8 +265,6 @@ int shared_page_alloc(int size, int alig int shared_page_fill(int size, int align, const void *data); void shared_page_write(int base, int size, const void *data); void exec_sysvec_init(void *param); -struct sf_buf *shared_page_write_start(int base); -void shared_page_write_end(struct sf_buf *sf); #define INIT_SYSENTVEC(name, sv) \ SYSINIT(name, SI_SUB_EXEC, SI_ORDER_ANY, \ Copied and modified: stable/9/sys/sys/vdso.h (from r237433, head/sys/sys/vdso.h) ============================================================================== --- head/sys/sys/vdso.h Fri Jun 22 07:06:40 2012 (r237433, copy source) +++ stable/9/sys/sys/vdso.h Sat Sep 22 12:32:00 2012 (r240815) @@ -29,7 +29,6 @@ #define _SYS_VDSO_H #include -#include #include struct vdso_timehands { @@ -74,6 +73,8 @@ u_int __vdso_gettc(const struct vdso_tim #ifdef _KERNEL +void timekeep_push_vdso(void); + uint32_t tc_fill_vdso_timehands(struct vdso_timehands *vdso_th); /* @@ -86,9 +87,6 @@ uint32_t tc_fill_vdso_timehands(struct v */ uint32_t cpu_fill_vdso_timehands(struct vdso_timehands *vdso_th); -typedef void (*tc_windup_fn)(void *); -EVENTHANDLER_DECLARE(tc_windup, tc_windup_fn); - #define VDSO_TH_NUM 4 #ifdef COMPAT_FREEBSD32 Copied: stable/9/sys/x86/include/vdso.h (from r237433, head/sys/x86/include/vdso.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sys/x86/include/vdso.h Sat Sep 22 12:32:00 2012 (r240815, copy of r237433, head/sys/x86/include/vdso.h) @@ -0,0 +1,42 @@ +/*- + * Copyright 2012 Konstantin Belousov . + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _X86_VDSO_H +#define _X86_VDSO_H + +#define VDSO_TIMEHANDS_MD \ + uint32_t th_x86_shift; \ + uint32_t th_res[7]; + +#ifdef _KERNEL +#ifdef COMPAT_FREEBSD32 + +#define VDSO_TIMEHANDS_MD32 VDSO_TIMEHANDS_MD + +#endif +#endif +#endif Modified: stable/9/sys/x86/x86/tsc.c ============================================================================== --- stable/9/sys/x86/x86/tsc.c Sat Sep 22 12:27:50 2012 (r240814) +++ stable/9/sys/x86/x86/tsc.c Sat Sep 22 12:32:00 2012 (r240815) @@ -27,6 +27,7 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_compat.h" #include "opt_clock.h" #include @@ -41,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -606,3 +608,23 @@ tsc_get_timecount_low(struct timecounter : "=a" (rv) : "c" ((int)(intptr_t)tc->tc_priv) : "edx"); return (rv); } + +uint32_t +cpu_fill_vdso_timehands(struct vdso_timehands *vdso_th) +{ + + vdso_th->th_x86_shift = (int)(intptr_t)timecounter->tc_priv; + bzero(vdso_th->th_res, sizeof(vdso_th->th_res)); + return (timecounter == &tsc_timecounter); +} + +#ifdef COMPAT_FREEBSD32 +uint32_t +cpu_fill_vdso_timehands32(struct vdso_timehands32 *vdso_th32) +{ + + vdso_th32->th_x86_shift = (int)(intptr_t)timecounter->tc_priv; + bzero(vdso_th32->th_res, sizeof(vdso_th32->th_res)); + return (timecounter == &tsc_timecounter); +} +#endif From owner-svn-src-all@FreeBSD.ORG Sat Sep 22 12:34:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD1C11065674; Sat, 22 Sep 2012 12:34:02 +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 97A8A8FC08; Sat, 22 Sep 2012 12:34:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8MCY2Um066707; Sat, 22 Sep 2012 12:34:02 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8MCY2qT066703; Sat, 22 Sep 2012 12:34:02 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201209221234.q8MCY2qT066703@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 22 Sep 2012 12:34:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240816 - in stable/9/sys/i386: i386 include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Sep 2012 12:34:02 -0000 Author: kib Date: Sat Sep 22 12:34:02 2012 New Revision: 240816 URL: http://svn.freebsd.org/changeset/base/240816 Log: MFC r237435: Enable shared page on i386, now it has a use for vdso_timehands. MFC r237445: Commit changes missed from r237435. Properly calculate the signal trampoline addresses after the shared page is enabled. Handle FreeBSD ABIs without shared page support too. Modified: stable/9/sys/i386/i386/elf_machdep.c stable/9/sys/i386/i386/machdep.c stable/9/sys/i386/include/vmparam.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/i386/i386/elf_machdep.c ============================================================================== --- stable/9/sys/i386/i386/elf_machdep.c Sat Sep 22 12:32:00 2012 (r240815) +++ stable/9/sys/i386/i386/elf_machdep.c Sat Sep 22 12:34:02 2012 (r240816) @@ -74,12 +74,15 @@ struct sysentvec elf32_freebsd_sysvec = .sv_setregs = exec_setregs, .sv_fixlimit = NULL, .sv_maxssiz = NULL, - .sv_flags = SV_ABI_FREEBSD | SV_IA32 | SV_ILP32, + .sv_flags = SV_ABI_FREEBSD | SV_IA32 | SV_ILP32 | SV_SHP, .sv_set_syscall_retval = cpu_set_syscall_retval, .sv_fetch_syscall_args = cpu_fetch_syscall_args, .sv_syscallnames = syscallnames, + .sv_shared_page_base = SHAREDPAGE, + .sv_shared_page_len = PAGE_SIZE, .sv_schedtail = NULL, }; +INIT_SYSENTVEC(elf32_sysvec, &elf32_freebsd_sysvec); static Elf32_Brandinfo freebsd_brand_info = { .brand = ELFOSABI_FREEBSD, Modified: stable/9/sys/i386/i386/machdep.c ============================================================================== --- stable/9/sys/i386/i386/machdep.c Sat Sep 22 12:32:00 2012 (r240815) +++ stable/9/sys/i386/i386/machdep.c Sat Sep 22 12:34:02 2012 (r240816) @@ -472,7 +472,13 @@ osendsig(sig_t catcher, ksiginfo_t *ksi, } regs->tf_esp = (int)fp; - regs->tf_eip = PS_STRINGS - szosigcode; + if (p->p_sysent->sv_sigcode_base != 0) { + regs->tf_eip = p->p_sysent->sv_sigcode_base + szsigcode - + szosigcode; + } else { + /* a.out sysentvec does not use shared page */ + regs->tf_eip = p->p_sysent->sv_psstrings - szosigcode; + } regs->tf_eflags &= ~(PSL_T | PSL_D); regs->tf_cs = _ucodesel; regs->tf_ds = _udatasel; @@ -599,7 +605,8 @@ freebsd4_sendsig(sig_t catcher, ksiginfo } regs->tf_esp = (int)sfp; - regs->tf_eip = PS_STRINGS - szfreebsd4_sigcode; + regs->tf_eip = p->p_sysent->sv_sigcode_base + szsigcode - + szfreebsd4_sigcode; regs->tf_eflags &= ~(PSL_T | PSL_D); regs->tf_cs = _ucodesel; regs->tf_ds = _udatasel; @@ -750,7 +757,7 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, } regs->tf_esp = (int)sfp; - regs->tf_eip = PS_STRINGS - *(p->p_sysent->sv_szsigcode); + regs->tf_eip = p->p_sysent->sv_sigcode_base; regs->tf_eflags &= ~(PSL_T | PSL_D); regs->tf_cs = _ucodesel; regs->tf_ds = _udatasel; Modified: stable/9/sys/i386/include/vmparam.h ============================================================================== --- stable/9/sys/i386/include/vmparam.h Sat Sep 22 12:32:00 2012 (r240815) +++ stable/9/sys/i386/include/vmparam.h Sat Sep 22 12:34:02 2012 (r240816) @@ -165,7 +165,8 @@ #define VM_MAXUSER_ADDRESS VADDR(PTDPTDI, 0) -#define USRSTACK VM_MAXUSER_ADDRESS +#define SHAREDPAGE (VM_MAXUSER_ADDRESS - PAGE_SIZE) +#define USRSTACK SHAREDPAGE #define VM_MAX_ADDRESS VADDR(PTDPTDI, PTDPTDI) #define VM_MIN_ADDRESS ((vm_offset_t)0) From owner-svn-src-all@FreeBSD.ORG Sat Sep 22 12:35:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 49DEC106564A; Sat, 22 Sep 2012 12:35:23 +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 34B3F8FC0C; Sat, 22 Sep 2012 12:35:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8MCZNgm066911; Sat, 22 Sep 2012 12:35:23 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8MCZNj8066908; Sat, 22 Sep 2012 12:35:23 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201209221235.q8MCZNj8066908@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 22 Sep 2012 12:35:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240817 - stable/9/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Sep 2012 12:35:23 -0000 Author: kib Date: Sat Sep 22 12:35:22 2012 New Revision: 240817 URL: http://svn.freebsd.org/changeset/base/240817 Log: MFC r237476: Remove no longer needed forward declaration for struct sf_buf. Modified: stable/9/sys/sys/sysent.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/sys/sysent.h ============================================================================== --- stable/9/sys/sys/sysent.h Sat Sep 22 12:34:02 2012 (r240816) +++ stable/9/sys/sys/sysent.h Sat Sep 22 12:35:22 2012 (r240817) @@ -260,7 +260,6 @@ int lkmressys(struct thread *, struct no int syscall_thread_enter(struct thread *td, struct sysent *se); void syscall_thread_exit(struct thread *td, struct sysent *se); -struct sf_buf; int shared_page_alloc(int size, int align); int shared_page_fill(int size, int align, const void *data); void shared_page_write(int base, int size, const void *data); From owner-svn-src-all@FreeBSD.ORG Sat Sep 22 12:36:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8A5BE106566B; Sat, 22 Sep 2012 12:36:32 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6B2BD8FC18; Sat, 22 Sep 2012 12:36:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8MCaWpC067123; Sat, 22 Sep 2012 12:36:32 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8MCaW4w067119; Sat, 22 Sep 2012 12:36:32 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201209221236.q8MCaW4w067119@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 22 Sep 2012 12:36:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240818 - in stable/9/sys: conf kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Sep 2012 12:36:32 -0000 Author: kib Date: Sat Sep 22 12:36:31 2012 New Revision: 240818 URL: http://svn.freebsd.org/changeset/base/240818 Log: MFC r237477: Move the code dealing with shared page into a dedicated kern_sharedpage.c source file from kern_exec.c. Added: stable/9/sys/kern/kern_sharedpage.c - copied unchanged from r237477, head/sys/kern/kern_sharedpage.c Modified: stable/9/sys/conf/files stable/9/sys/kern/kern_exec.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/conf/ (props changed) Modified: stable/9/sys/conf/files ============================================================================== --- stable/9/sys/conf/files Sat Sep 22 12:35:22 2012 (r240817) +++ stable/9/sys/conf/files Sat Sep 22 12:36:31 2012 (r240818) @@ -2388,6 +2388,7 @@ kern/kern_rmlock.c standard kern/kern_rwlock.c standard kern/kern_sdt.c optional kdtrace_hooks kern/kern_sema.c standard +kern/kern_sharedpage.c standard kern/kern_shutdown.c standard kern/kern_sig.c standard kern/kern_switch.c standard Modified: stable/9/sys/kern/kern_exec.c ============================================================================== --- stable/9/sys/kern/kern_exec.c Sat Sep 22 12:35:22 2012 (r240817) +++ stable/9/sys/kern/kern_exec.c Sat Sep 22 12:36:31 2012 (r240818) @@ -28,7 +28,6 @@ __FBSDID("$FreeBSD$"); #include "opt_capsicum.h" -#include "opt_compat.h" #include "opt_hwpmc_hooks.h" #include "opt_kdtrace.h" #include "opt_ktrace.h" @@ -65,7 +64,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #ifdef KTRACE @@ -1515,193 +1513,3 @@ exec_unregister(execsw_arg) execsw = newexecsw; return (0); } - -static struct sx shared_page_alloc_sx; -static vm_object_t shared_page_obj; -static int shared_page_free; -char *shared_page_mapping; - -void -shared_page_write(int base, int size, const void *data) -{ - - bcopy(data, shared_page_mapping + base, size); -} - -static int -shared_page_alloc_locked(int size, int align) -{ - int res; - - res = roundup(shared_page_free, align); - if (res + size >= IDX_TO_OFF(shared_page_obj->size)) - res = -1; - else - shared_page_free = res + size; - return (res); -} - -int -shared_page_alloc(int size, int align) -{ - int res; - - sx_xlock(&shared_page_alloc_sx); - res = shared_page_alloc_locked(size, align); - sx_xunlock(&shared_page_alloc_sx); - return (res); -} - -int -shared_page_fill(int size, int align, const void *data) -{ - int res; - - sx_xlock(&shared_page_alloc_sx); - res = shared_page_alloc_locked(size, align); - if (res != -1) - shared_page_write(res, size, data); - sx_xunlock(&shared_page_alloc_sx); - return (res); -} - -static void -shared_page_init(void *dummy __unused) -{ - vm_page_t m; - vm_offset_t addr; - - sx_init(&shared_page_alloc_sx, "shpsx"); - shared_page_obj = vm_pager_allocate(OBJT_PHYS, 0, PAGE_SIZE, - VM_PROT_DEFAULT, 0, NULL); - VM_OBJECT_LOCK(shared_page_obj); - m = vm_page_grab(shared_page_obj, 0, VM_ALLOC_RETRY | VM_ALLOC_NOBUSY | - VM_ALLOC_ZERO); - m->valid = VM_PAGE_BITS_ALL; - VM_OBJECT_UNLOCK(shared_page_obj); - addr = kmem_alloc_nofault(kernel_map, PAGE_SIZE); - pmap_qenter(addr, &m, 1); - shared_page_mapping = (char *)addr; -} - -SYSINIT(shp, SI_SUB_EXEC, SI_ORDER_FIRST, (sysinit_cfunc_t)shared_page_init, - NULL); - -static void -timehands_update(struct sysentvec *sv) -{ - struct vdso_timehands th; - struct vdso_timekeep *tk; - uint32_t enabled, idx; - - enabled = tc_fill_vdso_timehands(&th); - tk = (struct vdso_timekeep *)(shared_page_mapping + - sv->sv_timekeep_off); - idx = sv->sv_timekeep_curr; - atomic_store_rel_32(&tk->tk_th[idx].th_gen, 0); - if (++idx >= VDSO_TH_NUM) - idx = 0; - sv->sv_timekeep_curr = idx; - if (++sv->sv_timekeep_gen == 0) - sv->sv_timekeep_gen = 1; - th.th_gen = 0; - if (enabled) - tk->tk_th[idx] = th; - tk->tk_enabled = enabled; - atomic_store_rel_32(&tk->tk_th[idx].th_gen, sv->sv_timekeep_gen); - tk->tk_current = idx; -} - -#ifdef COMPAT_FREEBSD32 -static void -timehands_update32(struct sysentvec *sv) -{ - struct vdso_timekeep32 *tk; - struct vdso_timehands32 th; - uint32_t enabled, idx; - - enabled = tc_fill_vdso_timehands32(&th); - tk = (struct vdso_timekeep32 *)(shared_page_mapping + - sv->sv_timekeep_off); - idx = sv->sv_timekeep_curr; - atomic_store_rel_32(&tk->tk_th[idx].th_gen, 0); - if (++idx >= VDSO_TH_NUM) - idx = 0; - sv->sv_timekeep_curr = idx; - if (++sv->sv_timekeep_gen == 0) - sv->sv_timekeep_gen = 1; - th.th_gen = 0; - if (enabled) - tk->tk_th[idx] = th; - tk->tk_enabled = enabled; - atomic_store_rel_32(&tk->tk_th[idx].th_gen, sv->sv_timekeep_gen); - tk->tk_current = idx; -} -#endif - -/* - * This is hackish, but easiest way to avoid creating list structures - * that needs to be iterated over from the hardclock interrupt - * context. - */ -static struct sysentvec *host_sysentvec; -#ifdef COMPAT_FREEBSD32 -static struct sysentvec *compat32_sysentvec; -#endif - -void -timekeep_push_vdso(void) -{ - - if (host_sysentvec != NULL && host_sysentvec->sv_timekeep_base != 0) - timehands_update(host_sysentvec); -#ifdef COMPAT_FREEBSD32 - if (compat32_sysentvec != NULL && - compat32_sysentvec->sv_timekeep_base != 0) - timehands_update32(compat32_sysentvec); -#endif -} - -void -exec_sysvec_init(void *param) -{ - struct sysentvec *sv; - int tk_base; - uint32_t tk_ver; - - sv = (struct sysentvec *)param; - - if ((sv->sv_flags & SV_SHP) == 0) - return; - sv->sv_shared_page_obj = shared_page_obj; - sv->sv_sigcode_base = sv->sv_shared_page_base + - shared_page_fill(*(sv->sv_szsigcode), 16, sv->sv_sigcode); - if ((sv->sv_flags & SV_ABI_MASK) != SV_ABI_FREEBSD) - return; - tk_ver = VDSO_TK_VER_CURR; -#ifdef COMPAT_FREEBSD32 - if ((sv->sv_flags & SV_ILP32) != 0) { - tk_base = shared_page_alloc(sizeof(struct vdso_timekeep32) + - sizeof(struct vdso_timehands32) * VDSO_TH_NUM, 16); - KASSERT(tk_base != -1, ("tk_base -1 for 32bit")); - shared_page_write(tk_base + offsetof(struct vdso_timekeep32, - tk_ver), sizeof(uint32_t), &tk_ver); - KASSERT(compat32_sysentvec == 0, - ("Native compat32 already registered")); - compat32_sysentvec = sv; - } else { -#endif - tk_base = shared_page_alloc(sizeof(struct vdso_timekeep) + - sizeof(struct vdso_timehands) * VDSO_TH_NUM, 16); - KASSERT(tk_base != -1, ("tk_base -1 for native")); - shared_page_write(tk_base + offsetof(struct vdso_timekeep, - tk_ver), sizeof(uint32_t), &tk_ver); - KASSERT(host_sysentvec == 0, ("Native already registered")); - host_sysentvec = sv; -#ifdef COMPAT_FREEBSD32 - } -#endif - sv->sv_timekeep_base = sv->sv_shared_page_base + tk_base; - sv->sv_timekeep_off = tk_base; - timekeep_push_vdso(); -} Copied: stable/9/sys/kern/kern_sharedpage.c (from r237477, head/sys/kern/kern_sharedpage.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sys/kern/kern_sharedpage.c Sat Sep 22 12:36:31 2012 (r240818, copy of r237477, head/sys/kern/kern_sharedpage.c) @@ -0,0 +1,240 @@ +/*- + * Copyright (c) 2010, 2012 Konstantin Belousov + * 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 "opt_compat.h" +#include "opt_vm.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static struct sx shared_page_alloc_sx; +static vm_object_t shared_page_obj; +static int shared_page_free; +char *shared_page_mapping; + +void +shared_page_write(int base, int size, const void *data) +{ + + bcopy(data, shared_page_mapping + base, size); +} + +static int +shared_page_alloc_locked(int size, int align) +{ + int res; + + res = roundup(shared_page_free, align); + if (res + size >= IDX_TO_OFF(shared_page_obj->size)) + res = -1; + else + shared_page_free = res + size; + return (res); +} + +int +shared_page_alloc(int size, int align) +{ + int res; + + sx_xlock(&shared_page_alloc_sx); + res = shared_page_alloc_locked(size, align); + sx_xunlock(&shared_page_alloc_sx); + return (res); +} + +int +shared_page_fill(int size, int align, const void *data) +{ + int res; + + sx_xlock(&shared_page_alloc_sx); + res = shared_page_alloc_locked(size, align); + if (res != -1) + shared_page_write(res, size, data); + sx_xunlock(&shared_page_alloc_sx); + return (res); +} + +static void +shared_page_init(void *dummy __unused) +{ + vm_page_t m; + vm_offset_t addr; + + sx_init(&shared_page_alloc_sx, "shpsx"); + shared_page_obj = vm_pager_allocate(OBJT_PHYS, 0, PAGE_SIZE, + VM_PROT_DEFAULT, 0, NULL); + VM_OBJECT_LOCK(shared_page_obj); + m = vm_page_grab(shared_page_obj, 0, VM_ALLOC_RETRY | VM_ALLOC_NOBUSY | + VM_ALLOC_ZERO); + m->valid = VM_PAGE_BITS_ALL; + VM_OBJECT_UNLOCK(shared_page_obj); + addr = kmem_alloc_nofault(kernel_map, PAGE_SIZE); + pmap_qenter(addr, &m, 1); + shared_page_mapping = (char *)addr; +} + +SYSINIT(shp, SI_SUB_EXEC, SI_ORDER_FIRST, (sysinit_cfunc_t)shared_page_init, + NULL); + +static void +timehands_update(struct sysentvec *sv) +{ + struct vdso_timehands th; + struct vdso_timekeep *tk; + uint32_t enabled, idx; + + enabled = tc_fill_vdso_timehands(&th); + tk = (struct vdso_timekeep *)(shared_page_mapping + + sv->sv_timekeep_off); + idx = sv->sv_timekeep_curr; + atomic_store_rel_32(&tk->tk_th[idx].th_gen, 0); + if (++idx >= VDSO_TH_NUM) + idx = 0; + sv->sv_timekeep_curr = idx; + if (++sv->sv_timekeep_gen == 0) + sv->sv_timekeep_gen = 1; + th.th_gen = 0; + if (enabled) + tk->tk_th[idx] = th; + tk->tk_enabled = enabled; + atomic_store_rel_32(&tk->tk_th[idx].th_gen, sv->sv_timekeep_gen); + tk->tk_current = idx; +} + +#ifdef COMPAT_FREEBSD32 +static void +timehands_update32(struct sysentvec *sv) +{ + struct vdso_timekeep32 *tk; + struct vdso_timehands32 th; + uint32_t enabled, idx; + + enabled = tc_fill_vdso_timehands32(&th); + tk = (struct vdso_timekeep32 *)(shared_page_mapping + + sv->sv_timekeep_off); + idx = sv->sv_timekeep_curr; + atomic_store_rel_32(&tk->tk_th[idx].th_gen, 0); + if (++idx >= VDSO_TH_NUM) + idx = 0; + sv->sv_timekeep_curr = idx; + if (++sv->sv_timekeep_gen == 0) + sv->sv_timekeep_gen = 1; + th.th_gen = 0; + if (enabled) + tk->tk_th[idx] = th; + tk->tk_enabled = enabled; + atomic_store_rel_32(&tk->tk_th[idx].th_gen, sv->sv_timekeep_gen); + tk->tk_current = idx; +} +#endif + +/* + * This is hackish, but easiest way to avoid creating list structures + * that needs to be iterated over from the hardclock interrupt + * context. + */ +static struct sysentvec *host_sysentvec; +#ifdef COMPAT_FREEBSD32 +static struct sysentvec *compat32_sysentvec; +#endif + +void +timekeep_push_vdso(void) +{ + + if (host_sysentvec != NULL && host_sysentvec->sv_timekeep_base != 0) + timehands_update(host_sysentvec); +#ifdef COMPAT_FREEBSD32 + if (compat32_sysentvec != NULL && + compat32_sysentvec->sv_timekeep_base != 0) + timehands_update32(compat32_sysentvec); +#endif +} + +void +exec_sysvec_init(void *param) +{ + struct sysentvec *sv; + int tk_base; + uint32_t tk_ver; + + sv = (struct sysentvec *)param; + + if ((sv->sv_flags & SV_SHP) == 0) + return; + sv->sv_shared_page_obj = shared_page_obj; + sv->sv_sigcode_base = sv->sv_shared_page_base + + shared_page_fill(*(sv->sv_szsigcode), 16, sv->sv_sigcode); + if ((sv->sv_flags & SV_ABI_MASK) != SV_ABI_FREEBSD) + return; + tk_ver = VDSO_TK_VER_CURR; +#ifdef COMPAT_FREEBSD32 + if ((sv->sv_flags & SV_ILP32) != 0) { + tk_base = shared_page_alloc(sizeof(struct vdso_timekeep32) + + sizeof(struct vdso_timehands32) * VDSO_TH_NUM, 16); + KASSERT(tk_base != -1, ("tk_base -1 for 32bit")); + shared_page_write(tk_base + offsetof(struct vdso_timekeep32, + tk_ver), sizeof(uint32_t), &tk_ver); + KASSERT(compat32_sysentvec == 0, + ("Native compat32 already registered")); + compat32_sysentvec = sv; + } else { +#endif + tk_base = shared_page_alloc(sizeof(struct vdso_timekeep) + + sizeof(struct vdso_timehands) * VDSO_TH_NUM, 16); + KASSERT(tk_base != -1, ("tk_base -1 for native")); + shared_page_write(tk_base + offsetof(struct vdso_timekeep, + tk_ver), sizeof(uint32_t), &tk_ver); + KASSERT(host_sysentvec == 0, ("Native already registered")); + host_sysentvec = sv; +#ifdef COMPAT_FREEBSD32 + } +#endif + sv->sv_timekeep_base = sv->sv_shared_page_base + tk_base; + sv->sv_timekeep_off = tk_base; + timekeep_push_vdso(); +} From owner-svn-src-all@FreeBSD.ORG Sat Sep 22 12:38:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 474DA1065676; Sat, 22 Sep 2012 12:38:20 +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 2E8508FC1C; Sat, 22 Sep 2012 12:38:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8MCcKaj067397; Sat, 22 Sep 2012 12:38:20 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8MCcJPC067386; Sat, 22 Sep 2012 12:38:19 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201209221238.q8MCcJPC067386@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 22 Sep 2012 12:38:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240819 - in stable/9/lib/libc: amd64/sys gen i386/sys include sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Sep 2012 12:38:20 -0000 Author: kib Date: Sat Sep 22 12:38:19 2012 New Revision: 240819 URL: http://svn.freebsd.org/changeset/base/240819 Log: MFC r237434: Use struct vdso_timehands data to implement fast gettimeofday(2) and clock_gettime(2) functions if supported. Added: stable/9/lib/libc/amd64/sys/__vdso_gettc.c - copied unchanged from r237434, head/lib/libc/amd64/sys/__vdso_gettc.c stable/9/lib/libc/i386/sys/__vdso_gettc.c - copied unchanged from r237434, head/lib/libc/i386/sys/__vdso_gettc.c stable/9/lib/libc/sys/__vdso_gettimeofday.c - copied unchanged from r237434, head/lib/libc/sys/__vdso_gettimeofday.c stable/9/lib/libc/sys/clock_gettime.c - copied unchanged from r237434, head/lib/libc/sys/clock_gettime.c stable/9/lib/libc/sys/gettimeofday.c - copied unchanged from r237434, head/lib/libc/sys/gettimeofday.c Modified: stable/9/lib/libc/amd64/sys/Makefile.inc stable/9/lib/libc/gen/aux.c stable/9/lib/libc/i386/sys/Makefile.inc stable/9/lib/libc/include/libc_private.h stable/9/lib/libc/sys/Makefile.inc Directory Properties: stable/9/lib/libc/ (props changed) stable/9/lib/libc/sys/ (props changed) Modified: stable/9/lib/libc/amd64/sys/Makefile.inc ============================================================================== --- stable/9/lib/libc/amd64/sys/Makefile.inc Sat Sep 22 12:36:31 2012 (r240818) +++ stable/9/lib/libc/amd64/sys/Makefile.inc Sat Sep 22 12:38:19 2012 (r240819) @@ -1,7 +1,8 @@ # from: Makefile.inc,v 1.1 1993/09/03 19:04:23 jtc Exp # $FreeBSD$ -SRCS+= amd64_get_fsbase.c amd64_get_gsbase.c amd64_set_fsbase.c amd64_set_gsbase.c +SRCS+= amd64_get_fsbase.c amd64_get_gsbase.c amd64_set_fsbase.c \ + amd64_set_gsbase.c __vdso_gettc.c MDASM= vfork.S brk.S cerror.S exect.S getcontext.S pipe.S ptrace.S \ reboot.S sbrk.S setlogin.S sigreturn.S Copied: stable/9/lib/libc/amd64/sys/__vdso_gettc.c (from r237434, head/lib/libc/amd64/sys/__vdso_gettc.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/lib/libc/amd64/sys/__vdso_gettc.c Sat Sep 22 12:38:19 2012 (r240819, copy of r237434, head/lib/libc/amd64/sys/__vdso_gettc.c) @@ -0,0 +1,49 @@ +/*- + * Copyright (c) 2012 Konstantin Belousov + * + * 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 + +static u_int +__vdso_gettc_low(const struct vdso_timehands *th) +{ + uint32_t rv; + + __asm __volatile("rdtsc; shrd %%cl, %%edx, %0" + : "=a" (rv) : "c" (th->th_x86_shift) : "edx"); + return (rv); +} + +u_int +__vdso_gettc(const struct vdso_timehands *th) +{ + + return (th->th_x86_shift > 0 ? __vdso_gettc_low(th) : rdtsc32()); +} Modified: stable/9/lib/libc/gen/aux.c ============================================================================== --- stable/9/lib/libc/gen/aux.c Sat Sep 22 12:36:31 2012 (r240818) +++ stable/9/lib/libc/gen/aux.c Sat Sep 22 12:38:19 2012 (r240819) @@ -66,6 +66,7 @@ __init_elf_aux_vector(void) static pthread_once_t aux_once = PTHREAD_ONCE_INIT; static int pagesize, osreldate, canary_len, ncpus, pagesizes_len; static char *canary, *pagesizes; +static void *timekeep; static void init_aux(void) @@ -101,6 +102,10 @@ init_aux(void) case AT_NCPUS: ncpus = aux->a_un.a_val; break; + + case AT_TIMEKEEP: + timekeep = aux->a_un.a_ptr; + break; } } } @@ -163,6 +168,16 @@ _elf_aux_info(int aux, void *buf, int bu } else res = EINVAL; break; + case AT_TIMEKEEP: + if (buflen == sizeof(void *)) { + if (timekeep != NULL) { + *(void **)buf = timekeep; + res = 0; + } else + res = ENOENT; + } else + res = EINVAL; + break; default: res = ENOENT; break; Modified: stable/9/lib/libc/i386/sys/Makefile.inc ============================================================================== --- stable/9/lib/libc/i386/sys/Makefile.inc Sat Sep 22 12:36:31 2012 (r240818) +++ stable/9/lib/libc/i386/sys/Makefile.inc Sat Sep 22 12:38:19 2012 (r240819) @@ -5,7 +5,8 @@ SRCS+= i386_clr_watch.c i386_set_watch.c i386_vm86.c .endif SRCS+= i386_get_fsbase.c i386_get_gsbase.c i386_get_ioperm.c i386_get_ldt.c \ - i386_set_fsbase.c i386_set_gsbase.c i386_set_ioperm.c i386_set_ldt.c + i386_set_fsbase.c i386_set_gsbase.c i386_set_ioperm.c i386_set_ldt.c \ + __vdso_gettc.c MDASM= Ovfork.S brk.S cerror.S exect.S getcontext.S pipe.S ptrace.S \ reboot.S sbrk.S setlogin.S sigreturn.S syscall.S Copied: stable/9/lib/libc/i386/sys/__vdso_gettc.c (from r237434, head/lib/libc/i386/sys/__vdso_gettc.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/lib/libc/i386/sys/__vdso_gettc.c Sat Sep 22 12:38:19 2012 (r240819, copy of r237434, head/lib/libc/i386/sys/__vdso_gettc.c) @@ -0,0 +1,50 @@ +/*- + * Copyright (c) 2012 Konstantin Belousov + * + * 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 + +static u_int +__vdso_gettc_low(const struct vdso_timehands *th) +{ + uint32_t rv; + + __asm __volatile("rdtsc; shrd %%cl, %%edx, %0" + : "=a" (rv) : "c" (th->th_x86_shift) : "edx"); + return (rv); +} + +#pragma weak __vdso_gettc +u_int +__vdso_gettc(const struct vdso_timehands *th) +{ + + return (th->th_x86_shift > 0 ? __vdso_gettc_low(th) : rdtsc32()); +} Modified: stable/9/lib/libc/include/libc_private.h ============================================================================== --- stable/9/lib/libc/include/libc_private.h Sat Sep 22 12:36:31 2012 (r240818) +++ stable/9/lib/libc/include/libc_private.h Sat Sep 22 12:38:19 2012 (r240819) @@ -34,6 +34,7 @@ #ifndef _LIBC_PRIVATE_H_ #define _LIBC_PRIVATE_H_ +#include #include /* @@ -245,6 +246,12 @@ extern void * __sys_freebsd6_mmap(void * /* Without back-compat translation */ extern int __sys_fcntl(int, int, ...); +struct timespec; +struct timeval; +struct timezone; +int __sys_gettimeofday(struct timeval *, struct timezone *); +int __sys_clock_gettime(__clockid_t, struct timespec *ts); + /* execve() with PATH processing to implement posix_spawnp() */ int _execvpe(const char *, char * const *, char * const *); Modified: stable/9/lib/libc/sys/Makefile.inc ============================================================================== --- stable/9/lib/libc/sys/Makefile.inc Sat Sep 22 12:36:31 2012 (r240818) +++ stable/9/lib/libc/sys/Makefile.inc Sat Sep 22 12:38:19 2012 (r240819) @@ -15,6 +15,10 @@ # .sinclude "${.CURDIR}/${LIBC_ARCH}/sys/Makefile.inc" +SRCS+= clock_gettime.c gettimeofday.c __vdso_gettimeofday.c +NOASM+= clock_gettime.o gettimeofday.o +PSEUDO+= _clock_gettime.o _gettimeofday.o + # Sources common to both syscall interfaces: SRCS+= stack_protector.c stack_protector_compat.c __error.c .if !defined(WITHOUT_SYSCALL_COMPAT) Copied: stable/9/lib/libc/sys/__vdso_gettimeofday.c (from r237434, head/lib/libc/sys/__vdso_gettimeofday.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/lib/libc/sys/__vdso_gettimeofday.c Sat Sep 22 12:38:19 2012 (r240819, copy of r237434, head/lib/libc/sys/__vdso_gettimeofday.c) @@ -0,0 +1,142 @@ +/*- + * Copyright (c) 2012 Konstantin Belousov + * + * 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 +#include +#include "libc_private.h" + +static u_int +tc_delta(const struct vdso_timehands *th) +{ + + return ((__vdso_gettc(th) - th->th_offset_count) & + th->th_counter_mask); +} + +static int +binuptime(struct bintime *bt, struct vdso_timekeep *tk, int abs) +{ + struct vdso_timehands *th; + uint32_t curr, gen; + + do { + if (!tk->tk_enabled) + return (ENOSYS); + + /* + * XXXKIB. The load of tk->tk_current should use + * atomic_load_acq_32 to provide load barrier. But + * since tk points to r/o mapped page, x86 + * implementation of atomic_load_acq faults. + */ + curr = tk->tk_current; + rmb(); + th = &tk->tk_th[curr]; + if (th->th_algo != VDSO_TH_ALGO_1) + return (ENOSYS); + gen = th->th_gen; + *bt = th->th_offset; + bintime_addx(bt, th->th_scale * tc_delta(th)); + if (abs) + bintime_add(bt, &th->th_boottime); + + /* + * Barrier for load of both tk->tk_current and th->th_gen. + */ + rmb(); + } while (curr != tk->tk_current || gen == 0 || gen != th->th_gen); + return (0); +} + +static struct vdso_timekeep *tk; + +int +__vdso_gettimeofday(struct timeval *tv, struct timezone *tz) +{ + struct bintime bt; + int error; + + if (tz != NULL) + return (ENOSYS); + if (tk == NULL) { + error = _elf_aux_info(AT_TIMEKEEP, &tk, sizeof(tk)); + if (error != 0 || tk == NULL) + return (ENOSYS); + } + if (tk->tk_ver != VDSO_TK_VER_CURR) + return (ENOSYS); + error = binuptime(&bt, tk, 1); + if (error != 0) + return (error); + bintime2timeval(&bt, tv); + return (0); +} + +int +__vdso_clock_gettime(clockid_t clock_id, struct timespec *ts) +{ + struct bintime bt; + int abs, error; + + if (tk == NULL) { + error = _elf_aux_info(AT_TIMEKEEP, &tk, sizeof(tk)); + if (error != 0 || tk == NULL) + return (ENOSYS); + } + if (tk->tk_ver != VDSO_TK_VER_CURR) + return (ENOSYS); + switch (clock_id) { + case CLOCK_REALTIME: + case CLOCK_REALTIME_PRECISE: + case CLOCK_REALTIME_FAST: + case CLOCK_SECOND: + abs = 1; + break; + case CLOCK_MONOTONIC: + case CLOCK_MONOTONIC_PRECISE: + case CLOCK_MONOTONIC_FAST: + case CLOCK_UPTIME: + case CLOCK_UPTIME_PRECISE: + case CLOCK_UPTIME_FAST: + abs = 0; + break; + default: + return (ENOSYS); + } + error = binuptime(&bt, tk, abs); + if (error != 0) + return (error); + bintime2timespec(&bt, ts); + if (clock_id == CLOCK_SECOND) + ts->tv_nsec = 0; + return (0); +} Copied: stable/9/lib/libc/sys/clock_gettime.c (from r237434, head/lib/libc/sys/clock_gettime.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/lib/libc/sys/clock_gettime.c Sat Sep 22 12:38:19 2012 (r240819, copy of r237434, head/lib/libc/sys/clock_gettime.c) @@ -0,0 +1,52 @@ +/*- + * Copyright (c) 2012 Konstantin Belousov + * + * 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 +#include "libc_private.h" + +int __clock_gettime(clockid_t, struct timespec *ts); + +__weak_reference(__clock_gettime, clock_gettime); + +int +__clock_gettime(clockid_t clock_id, struct timespec *ts) +{ + int error; + + if (__vdso_clock_gettime != NULL && __vdso_gettc != NULL) + error = __vdso_clock_gettime(clock_id, ts); + else + error = ENOSYS; + if (error == ENOSYS) + error = __sys_clock_gettime(clock_id, ts); + return (error); +} Copied: stable/9/lib/libc/sys/gettimeofday.c (from r237434, head/lib/libc/sys/gettimeofday.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/lib/libc/sys/gettimeofday.c Sat Sep 22 12:38:19 2012 (r240819, copy of r237434, head/lib/libc/sys/gettimeofday.c) @@ -0,0 +1,51 @@ +/*- + * Copyright (c) 2012 Konstantin Belousov + * + * 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 "libc_private.h" + +int __gettimeofday(struct timeval *tv, struct timezone *tz); + +__weak_reference(__gettimeofday, gettimeofday); + +int +__gettimeofday(struct timeval *tv, struct timezone *tz) +{ + int error; + + if (__vdso_gettimeofday != NULL && __vdso_gettc != NULL) + error = __vdso_gettimeofday(tv, tz); + else + error = ENOSYS; + if (error == ENOSYS) + error = __sys_gettimeofday(tv, tz); + return (error); +} From owner-svn-src-all@FreeBSD.ORG Sat Sep 22 12:40:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CBED71065680; Sat, 22 Sep 2012 12:40:00 +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 9846A8FC16; Sat, 22 Sep 2012 12:40:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8MCe0Yv067644; Sat, 22 Sep 2012 12:40:00 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8MCe059067641; Sat, 22 Sep 2012 12:40:00 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201209221240.q8MCe059067641@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 22 Sep 2012 12:40:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240820 - head/usr.bin/kdump X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Sep 2012 12:40:01 -0000 Author: jilles Date: Sat Sep 22 12:40:00 2012 New Revision: 240820 URL: http://svn.freebsd.org/changeset/base/240820 Log: kdump: Pretty-print signal codes. MFC after: 1 week Modified: head/usr.bin/kdump/kdump.c head/usr.bin/kdump/mksubr Modified: head/usr.bin/kdump/kdump.c ============================================================================== --- head/usr.bin/kdump/kdump.c Sat Sep 22 12:38:19 2012 (r240819) +++ head/usr.bin/kdump/kdump.c Sat Sep 22 12:40:00 2012 (r240820) @@ -1242,11 +1242,15 @@ ktrpsig(struct ktr_psig *psig) printf("SIG%s ", signames[psig->signo]); else printf("SIG %d ", psig->signo); - if (psig->action == SIG_DFL) - printf("SIG_DFL code=0x%x\n", psig->code); - else { - printf("caught handler=0x%lx mask=0x%x code=0x%x\n", - (u_long)psig->action, psig->mask.__bits[0], psig->code); + if (psig->action == SIG_DFL) { + printf("SIG_DFL code="); + sigcodename(psig->signo, psig->code); + putchar('\n'); + } else { + printf("caught handler=0x%lx mask=0x%x code=", + (u_long)psig->action, psig->mask.__bits[0]); + sigcodename(psig->signo, psig->code); + putchar('\n'); } } Modified: head/usr.bin/kdump/mksubr ============================================================================== --- head/usr.bin/kdump/mksubr Sat Sep 22 12:38:19 2012 (r240819) +++ head/usr.bin/kdump/mksubr Sat Sep 22 12:40:00 2012 (r240820) @@ -388,7 +388,13 @@ auto_switch_type "schedpolicyname" " auto_switch_type "sendfileflagsname" "SF_[A-Z]+[[:space:]]+[0-9]+" "sys/socket.h" auto_or_type "shmatname" "SHM_[A-Z]+[[:space:]]+[0-9]{6}+" "sys/shm.h" auto_switch_type "shutdownhowname" "SHUT_[A-Z]+[[:space:]]+[0-9]+" "sys/socket.h" +auto_switch_type "sigbuscodename" "BUS_[A-Z]+[[:space:]]+[0-9]+" "sys/signal.h" +auto_switch_type "sigchldcodename" "CLD_[A-Z]+[[:space:]]+[0-9]+" "sys/signal.h" +auto_switch_type "sigfpecodename" "FPE_[A-Z]+[[:space:]]+[0-9]+" "sys/signal.h" auto_switch_type "sigprocmaskhowname" "SIG_[A-Z]+[[:space:]]+[0-9]+" "sys/signal.h" +auto_switch_type "sigillcodename" "ILL_[A-Z]+[[:space:]]+[0-9]+" "sys/signal.h" +auto_switch_type "sigsegvcodename" "SEGV_[A-Z]+[[:space:]]+[0-9]+" "sys/signal.h" +auto_switch_type "sigtrapcodename" "TRAP_[A-Z]+[[:space:]]+[0-9]+" "sys/signal.h" auto_if_type "sockdomainname" "PF_[[:alnum:]]+[[:space:]]+" "sys/socket.h" auto_if_type "sockfamilyname" "AF_[[:alnum:]]+[[:space:]]+" "sys/socket.h" auto_if_type "sockipprotoname" "IPPROTO_[[:alnum:]]+[[:space:]]+" "netinet/in.h" @@ -501,4 +507,46 @@ cat <<_EOF_ printf(">"); } +/* + * AUTO - Special + * + * Check general codes first, then defer to signal-specific codes. + */ +void +sigcodename(int sig, int code) +{ + switch (code) { _EOF_ +egrep "^#[[:space:]]*define[[:space:]]+SI_[A-Z]+[[:space:]]+0(x[0-9abcdef]+)?[[:space:]]*" \ + $include_dir/sys/signal.h | grep -v SI_UNDEFINED | \ + awk '{ for (i = 1; i <= NF; i++) \ + if ($i ~ /define/) \ + break; \ + ++i; \ + printf "\tcase %s:\n\t\tprintf(\"%s\");\n\t\tbreak;\n", $i, $i }' +cat <<_EOF_ + default: + switch (sig) { + case SIGILL: + sigillcodename(code); + break; + case SIGBUS: + sigbuscodename(code); + break; + case SIGSEGV: + sigsegvcodename(code); + break; + case SIGFPE: + sigfpecodename(code); + break; + case SIGTRAP: + sigtrapcodename(code); + break; + case SIGCHLD: + sigchldcodename(code); + break; + default: + printf("", code); + } + } +} From owner-svn-src-all@FreeBSD.ORG Sat Sep 22 12:40:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0D9BF1065672; Sat, 22 Sep 2012 12:40:53 +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 E2B488FC16; Sat, 22 Sep 2012 12:40:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8MCeqYX067794; Sat, 22 Sep 2012 12:40:52 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8MCeqM9067792; Sat, 22 Sep 2012 12:40:52 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201209221240.q8MCeqM9067792@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 22 Sep 2012 12:40:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240821 - stable/9/sys/x86/x86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Sep 2012 12:40:53 -0000 Author: kib Date: Sat Sep 22 12:40:52 2012 New Revision: 240821 URL: http://svn.freebsd.org/changeset/base/240821 Log: MFC r238973,r238975: Add explicit fences right before rdtsc in the timecounters 'get' functions. Modified: stable/9/sys/x86/x86/tsc.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/x86/x86/tsc.c ============================================================================== --- stable/9/sys/x86/x86/tsc.c Sat Sep 22 12:40:00 2012 (r240820) +++ stable/9/sys/x86/x86/tsc.c Sat Sep 22 12:40:52 2012 (r240821) @@ -82,7 +82,11 @@ static void tsc_freq_changed(void *arg, static void tsc_freq_changing(void *arg, const struct cf_level *level, int *status); static unsigned tsc_get_timecount(struct timecounter *tc); -static unsigned tsc_get_timecount_low(struct timecounter *tc); +static inline unsigned tsc_get_timecount_low(struct timecounter *tc); +static unsigned tsc_get_timecount_lfence(struct timecounter *tc); +static unsigned tsc_get_timecount_low_lfence(struct timecounter *tc); +static unsigned tsc_get_timecount_mfence(struct timecounter *tc); +static unsigned tsc_get_timecount_low_mfence(struct timecounter *tc); static void tsc_levels_changed(void *arg, int unit); static struct timecounter tsc_timecounter = { @@ -262,6 +266,10 @@ probe_tsc_freq(void) (vm_guest == VM_GUEST_NO && CPUID_TO_FAMILY(cpu_id) >= 0x10)) tsc_is_invariant = 1; + if (cpu_feature & CPUID_SSE2) { + tsc_timecounter.tc_get_timecount = + tsc_get_timecount_mfence; + } break; case CPU_VENDOR_INTEL: if ((amd_pminfo & AMDPM_TSC_INVARIANT) != 0 || @@ -271,6 +279,10 @@ probe_tsc_freq(void) (CPUID_TO_FAMILY(cpu_id) == 0xf && CPUID_TO_MODEL(cpu_id) >= 0x3)))) tsc_is_invariant = 1; + if (cpu_feature & CPUID_SSE2) { + tsc_timecounter.tc_get_timecount = + tsc_get_timecount_lfence; + } break; case CPU_VENDOR_CENTAUR: if (vm_guest == VM_GUEST_NO && @@ -278,6 +290,10 @@ probe_tsc_freq(void) CPUID_TO_MODEL(cpu_id) >= 0xf && (rdmsr(0x1203) & 0x100000000ULL) == 0) tsc_is_invariant = 1; + if (cpu_feature & CPUID_SSE2) { + tsc_timecounter.tc_get_timecount = + tsc_get_timecount_lfence; + } break; } @@ -328,16 +344,30 @@ init_TSC(void) #ifdef SMP -/* rmb is required here because rdtsc is not a serializing instruction. */ -#define TSC_READ(x) \ -static void \ -tsc_read_##x(void *arg) \ -{ \ - uint32_t *tsc = arg; \ - u_int cpu = PCPU_GET(cpuid); \ - \ - rmb(); \ - tsc[cpu * 3 + x] = rdtsc32(); \ +/* + * RDTSC is not a serializing instruction, and does not drain + * instruction stream, so we need to drain the stream before executing + * it. It could be fixed by use of RDTSCP, except the instruction is + * not available everywhere. + * + * Use CPUID for draining in the boot-time SMP constistency test. The + * timecounters use MFENCE for AMD CPUs, and LFENCE for others (Intel + * and VIA) when SSE2 is present, and nothing on older machines which + * also do not issue RDTSC prematurely. There, testing for SSE2 and + * vendor is too cumbersome, and we learn about TSC presence from CPUID. + * + * Do not use do_cpuid(), since we do not need CPUID results, which + * have to be written into memory with do_cpuid(). + */ +#define TSC_READ(x) \ +static void \ +tsc_read_##x(void *arg) \ +{ \ + uint32_t *tsc = arg; \ + u_int cpu = PCPU_GET(cpuid); \ + \ + __asm __volatile("cpuid" : : : "eax", "ebx", "ecx", "edx"); \ + tsc[cpu * 3 + x] = rdtsc32(); \ } TSC_READ(0) TSC_READ(1) @@ -487,7 +517,16 @@ init: for (shift = 0; shift < 31 && (tsc_freq >> shift) > max_freq; shift++) ; if (shift > 0) { - tsc_timecounter.tc_get_timecount = tsc_get_timecount_low; + if (cpu_feature & CPUID_SSE2) { + if (cpu_vendor_id == CPU_VENDOR_AMD) { + tsc_timecounter.tc_get_timecount = + tsc_get_timecount_low_mfence; + } else { + tsc_timecounter.tc_get_timecount = + tsc_get_timecount_low_lfence; + } + } else + tsc_timecounter.tc_get_timecount = tsc_get_timecount_low; tsc_timecounter.tc_name = "TSC-low"; if (bootverbose) printf("TSC timecounter discards lower %d bit(s)\n", @@ -599,16 +638,48 @@ tsc_get_timecount(struct timecounter *tc return (rdtsc32()); } -static u_int +static inline u_int tsc_get_timecount_low(struct timecounter *tc) { uint32_t rv; __asm __volatile("rdtsc; shrd %%cl, %%edx, %0" - : "=a" (rv) : "c" ((int)(intptr_t)tc->tc_priv) : "edx"); + : "=a" (rv) : "c" ((int)(intptr_t)tc->tc_priv) : "edx"); return (rv); } +static u_int +tsc_get_timecount_lfence(struct timecounter *tc __unused) +{ + + lfence(); + return (rdtsc32()); +} + +static u_int +tsc_get_timecount_low_lfence(struct timecounter *tc) +{ + + lfence(); + return (tsc_get_timecount_low(tc)); +} + +static u_int +tsc_get_timecount_mfence(struct timecounter *tc __unused) +{ + + mfence(); + return (rdtsc32()); +} + +static u_int +tsc_get_timecount_low_mfence(struct timecounter *tc) +{ + + mfence(); + return (tsc_get_timecount_low(tc)); +} + uint32_t cpu_fill_vdso_timehands(struct vdso_timehands *vdso_th) { From owner-svn-src-all@FreeBSD.ORG Sat Sep 22 12:41:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2F1421065672; Sat, 22 Sep 2012 12:41: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 D17688FC14; Sat, 22 Sep 2012 12:41:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8MCfn87067939; Sat, 22 Sep 2012 12:41:49 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8MCfnhJ067937; Sat, 22 Sep 2012 12:41:49 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201209221241.q8MCfnhJ067937@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 22 Sep 2012 12:41:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240822 - head/sys/geom X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Sep 2012 12:41:50 -0000 Author: pjd Date: Sat Sep 22 12:41:49 2012 New Revision: 240822 URL: http://svn.freebsd.org/changeset/base/240822 Log: Use the topology lock to protect list of providers while withering them. It is possible that provider is destroyed while we are iterating over the list. Reported by: Brian Parkison Discussed with: phk MFC after: 1 week Modified: head/sys/geom/geom_disk.c Modified: head/sys/geom/geom_disk.c ============================================================================== --- head/sys/geom/geom_disk.c Sat Sep 22 12:40:52 2012 (r240821) +++ head/sys/geom/geom_disk.c Sat Sep 22 12:41:49 2012 (r240822) @@ -635,10 +635,13 @@ disk_gone(struct disk *dp) struct g_geom *gp; struct g_provider *pp; + g_topology_lock(); gp = dp->d_geom; - if (gp != NULL) + if (gp != NULL) { LIST_FOREACH(pp, &gp->provider, provider) g_wither_provider(pp, ENXIO); + } + g_topology_unlock(); } void From owner-svn-src-all@FreeBSD.ORG Sat Sep 22 12:42:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18A0D106564A; Sat, 22 Sep 2012 12:42:52 +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 0409D8FC12; Sat, 22 Sep 2012 12:42:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8MCgpxU068112; Sat, 22 Sep 2012 12:42:51 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8MCgpGp068110; Sat, 22 Sep 2012 12:42:51 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201209221242.q8MCgpGp068110@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 22 Sep 2012 12:42:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240823 - head/sbin/devd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Sep 2012 12:42:52 -0000 Author: pjd Date: Sat Sep 22 12:42:51 2012 New Revision: 240823 URL: http://svn.freebsd.org/changeset/base/240823 Log: Use O_CLOEXEC for open instead of separate fcntl(2) call. Modified: head/sbin/devd/devd.cc Modified: head/sbin/devd/devd.cc ============================================================================== --- head/sbin/devd/devd.cc Sat Sep 22 12:41:49 2012 (r240822) +++ head/sbin/devd/devd.cc Sat Sep 22 12:42:51 2012 (r240823) @@ -855,11 +855,9 @@ event_loop(void) timeval tv; fd_set fds; - fd = open(PATH_DEVCTL, O_RDONLY); + fd = open(PATH_DEVCTL, O_RDONLY | O_CLOEXEC); if (fd == -1) err(1, "Can't open devctl device %s", PATH_DEVCTL); - if (fcntl(fd, F_SETFD, FD_CLOEXEC) != 0) - err(1, "Can't set close-on-exec flag on devctl"); server_fd = create_socket(PIPE); max_fd = max(fd, server_fd) + 1; while (1) { From owner-svn-src-all@FreeBSD.ORG Sat Sep 22 12:49:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A283106566C; Sat, 22 Sep 2012 12:49:37 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F006D8FC14; Sat, 22 Sep 2012 12:49:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8MCnaCC069163; Sat, 22 Sep 2012 12:49:36 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8MCna84069158; Sat, 22 Sep 2012 12:49:36 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201209221249.q8MCna84069158@svn.freebsd.org> From: Gleb Smirnoff Date: Sat, 22 Sep 2012 12:49:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240824 - head/sys/contrib/altq/altq X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Sep 2012 12:49:37 -0000 Author: glebius Date: Sat Sep 22 12:49:36 2012 New Revision: 240824 URL: http://svn.freebsd.org/changeset/base/240824 Log: Convert more M_WAITOK malloc() to M_NOWAIT. Reported by: Kim Culhan Modified: head/sys/contrib/altq/altq/altq_priq.c head/sys/contrib/altq/altq/altq_red.c head/sys/contrib/altq/altq/altq_rio.c Modified: head/sys/contrib/altq/altq/altq_priq.c ============================================================================== --- head/sys/contrib/altq/altq/altq_priq.c Sat Sep 22 12:42:51 2012 (r240823) +++ head/sys/contrib/altq/altq/altq_priq.c Sat Sep 22 12:49:36 2012 (r240824) @@ -362,8 +362,9 @@ priq_class_create(struct priq_if *pif, i if (flags & PRCF_RIO) { cl->cl_red = (red_t *)rio_alloc(0, NULL, red_flags, red_pkttime); - if (cl->cl_red != NULL) - qtype(cl->cl_q) = Q_RIO; + if (cl->cl_red == NULL) + goto err_ret; + qtype(cl->cl_q) = Q_RIO; } else #endif if (flags & PRCF_RED) { @@ -371,8 +372,9 @@ priq_class_create(struct priq_if *pif, i qlimit(cl->cl_q) * 10/100, qlimit(cl->cl_q) * 30/100, red_flags, red_pkttime); - if (cl->cl_red != NULL) - qtype(cl->cl_q) = Q_RED; + if (cl->cl_red == NULL) + goto err_ret; + qtype(cl->cl_q) = Q_RED; } } #endif /* ALTQ_RED */ Modified: head/sys/contrib/altq/altq/altq_red.c ============================================================================== --- head/sys/contrib/altq/altq/altq_red.c Sat Sep 22 12:42:51 2012 (r240823) +++ head/sys/contrib/altq/altq/altq_red.c Sat Sep 22 12:49:36 2012 (r240824) @@ -231,10 +231,9 @@ red_alloc(int weight, int inv_pmax, int int w, i; int npkts_per_sec; - rp = malloc(sizeof(red_t), M_DEVBUF, M_WAITOK); + rp = malloc(sizeof(red_t), M_DEVBUF, M_NOWAIT | M_ZERO); if (rp == NULL) return (NULL); - bzero(rp, sizeof(red_t)); rp->red_avg = 0; rp->red_idle = 1; Modified: head/sys/contrib/altq/altq/altq_rio.c ============================================================================== --- head/sys/contrib/altq/altq/altq_rio.c Sat Sep 22 12:42:51 2012 (r240823) +++ head/sys/contrib/altq/altq/altq_rio.c Sat Sep 22 12:49:36 2012 (r240824) @@ -204,10 +204,9 @@ rio_alloc(int weight, struct redparams * int w, i; int npkts_per_sec; - rp = malloc(sizeof(rio_t), M_DEVBUF, M_WAITOK); + rp = malloc(sizeof(rio_t), M_DEVBUF, M_NOWAIT | M_ZERO); if (rp == NULL) return (NULL); - bzero(rp, sizeof(rio_t)); rp->rio_flags = flags; if (pkttime == 0) From owner-svn-src-all@FreeBSD.ORG Sat Sep 22 12:52:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 282F11065670; Sat, 22 Sep 2012 12:52:42 +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 13DF88FC0A; Sat, 22 Sep 2012 12:52:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8MCqfnA069586; Sat, 22 Sep 2012 12:52:41 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8MCqftL069584; Sat, 22 Sep 2012 12:52:41 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201209221252.q8MCqftL069584@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 22 Sep 2012 12:52:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240825 - head/tools/regression/bin/sh/parser X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Sep 2012 12:52:42 -0000 Author: jilles Date: Sat Sep 22 12:52:41 2012 New Revision: 240825 URL: http://svn.freebsd.org/changeset/base/240825 Log: sh: Add some tests for aliasing a utility to itself. Added: head/tools/regression/bin/sh/parser/alias7.0 (contents, props changed) head/tools/regression/bin/sh/parser/alias8.0 (contents, props changed) Added: head/tools/regression/bin/sh/parser/alias7.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/parser/alias7.0 Sat Sep 22 12:52:41 2012 (r240825) @@ -0,0 +1,4 @@ +# $FreeBSD$ + +alias echo='echo a' +[ "`eval echo b`" = "a b" ] Added: head/tools/regression/bin/sh/parser/alias8.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/parser/alias8.0 Sat Sep 22 12:52:41 2012 (r240825) @@ -0,0 +1,4 @@ +# $FreeBSD$ + +alias echo='echo' +[ "`eval echo b`" = b ] From owner-svn-src-all@FreeBSD.ORG Sat Sep 22 14:39:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA2F7106566B; Sat, 22 Sep 2012 14:39:21 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8AD4C8FC0C; Sat, 22 Sep 2012 14:39:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8MEdLe9084342; Sat, 22 Sep 2012 14:39:21 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8MEdLPg084339; Sat, 22 Sep 2012 14:39:21 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201209221439.q8MEdLPg084339@svn.freebsd.org> From: Michael Tuexen Date: Sat, 22 Sep 2012 14:39:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240826 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Sep 2012 14:39:21 -0000 Author: tuexen Date: Sat Sep 22 14:39:20 2012 New Revision: 240826 URL: http://svn.freebsd.org/changeset/base/240826 Log: Small cleanups. No functional change. MFC after: 10 days Modified: head/sys/netinet/sctp_output.c head/sys/netinet/sctp_output.h Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Sat Sep 22 12:52:41 2012 (r240825) +++ head/sys/netinet/sctp_output.c Sat Sep 22 14:39:20 2012 (r240826) @@ -11394,11 +11394,11 @@ sctp_send_cwr(struct sctp_tcb *stcb, str struct sctp_cwr_chunk *cwr; struct sctp_tmit_chunk *chk; - asoc = &stcb->asoc; SCTP_TCB_LOCK_ASSERT(stcb); if (net == NULL) { return; } + asoc = &stcb->asoc; TAILQ_FOREACH(chk, &asoc->control_send_queue, sctp_next) { if ((chk->rec.chunk_id.id == SCTP_ECN_CWR) && (net == chk->whoTo)) { /* @@ -11453,13 +11453,11 @@ sctp_add_stream_reset_out(struct sctp_tm int number_entries, uint16_t * list, uint32_t seq, uint32_t resp_seq, uint32_t last_sent) { - int len, old_len, i; + uint16_t len, old_len, i; struct sctp_stream_reset_out_request *req_out; struct sctp_chunkhdr *ch; ch = mtod(chk->data, struct sctp_chunkhdr *); - - old_len = len = SCTP_SIZE32(ntohs(ch->chunk_length)); /* get to new offset for the param. */ @@ -11493,19 +11491,16 @@ sctp_add_stream_reset_out(struct sctp_tm return; } - -void +static void sctp_add_stream_reset_in(struct sctp_tmit_chunk *chk, int number_entries, uint16_t * list, uint32_t seq) { - int len, old_len, i; + uint16_t len, old_len, i; struct sctp_stream_reset_in_request *req_in; struct sctp_chunkhdr *ch; ch = mtod(chk->data, struct sctp_chunkhdr *); - - old_len = len = SCTP_SIZE32(ntohs(ch->chunk_length)); /* get to new offset for the param. */ @@ -11537,18 +11532,15 @@ sctp_add_stream_reset_in(struct sctp_tmi return; } - -void +static void sctp_add_stream_reset_tsn(struct sctp_tmit_chunk *chk, uint32_t seq) { - int len, old_len; + uint16_t len, old_len; struct sctp_stream_reset_tsn_request *req_tsn; struct sctp_chunkhdr *ch; ch = mtod(chk->data, struct sctp_chunkhdr *); - - old_len = len = SCTP_SIZE32(ntohs(ch->chunk_length)); /* get to new offset for the param. */ @@ -11572,13 +11564,11 @@ void sctp_add_stream_reset_result(struct sctp_tmit_chunk *chk, uint32_t resp_seq, uint32_t result) { - int len, old_len; + uint16_t len, old_len; struct sctp_stream_reset_response *resp; struct sctp_chunkhdr *ch; ch = mtod(chk->data, struct sctp_chunkhdr *); - - old_len = len = SCTP_SIZE32(ntohs(ch->chunk_length)); /* get to new offset for the param. */ @@ -11597,22 +11587,18 @@ sctp_add_stream_reset_result(struct sctp chk->send_size = SCTP_SIZE32(chk->book_size); SCTP_BUF_LEN(chk->data) = chk->send_size; return; - } - void sctp_add_stream_reset_result_tsn(struct sctp_tmit_chunk *chk, uint32_t resp_seq, uint32_t result, uint32_t send_una, uint32_t recv_next) { - int len, old_len; + uint16_t len, old_len; struct sctp_stream_reset_response_tsn *resp; struct sctp_chunkhdr *ch; ch = mtod(chk->data, struct sctp_chunkhdr *); - - old_len = len = SCTP_SIZE32(ntohs(ch->chunk_length)); /* get to new offset for the param. */ @@ -11640,7 +11626,7 @@ sctp_add_an_out_stream(struct sctp_tmit_ uint32_t seq, uint16_t adding) { - int len, old_len; + uint16_t len, old_len; struct sctp_chunkhdr *ch; struct sctp_stream_reset_add_strm *addstr; @@ -11673,7 +11659,7 @@ sctp_add_an_in_stream(struct sctp_tmit_c uint32_t seq, uint16_t adding) { - int len, old_len; + uint16_t len, old_len; struct sctp_chunkhdr *ch; struct sctp_stream_reset_add_strm *addstr; @@ -11700,8 +11686,6 @@ sctp_add_an_in_stream(struct sctp_tmit_c return; } - - int sctp_send_str_reset_req(struct sctp_tcb *stcb, int number_entries, uint16_t * list, @@ -11710,8 +11694,7 @@ sctp_send_str_reset_req(struct sctp_tcb uint8_t send_tsn_req, uint8_t add_stream, uint16_t adding_o, - uint16_t adding_i, uint8_t peer_asked -) + uint16_t adding_i, uint8_t peer_asked) { struct sctp_association *asoc; Modified: head/sys/netinet/sctp_output.h ============================================================================== --- head/sys/netinet/sctp_output.h Sat Sep 22 12:52:41 2012 (r240825) +++ head/sys/netinet/sctp_output.h Sat Sep 22 14:39:20 2012 (r240826) @@ -173,37 +173,19 @@ void sctp_send_cwr(struct sctp_tcb *, st void -sctp_add_stream_reset_out(struct sctp_tmit_chunk *chk, - int number_entries, uint16_t * list, - uint32_t seq, uint32_t resp_seq, uint32_t last_sent); +sctp_add_stream_reset_out(struct sctp_tmit_chunk *, + int, uint16_t *, uint32_t, uint32_t, uint32_t); void -sctp_add_stream_reset_in(struct sctp_tmit_chunk *chk, - int number_entries, uint16_t * list, - uint32_t seq); + sctp_add_stream_reset_result(struct sctp_tmit_chunk *, uint32_t, uint32_t); void -sctp_add_stream_reset_tsn(struct sctp_tmit_chunk *chk, - uint32_t seq); - -void -sctp_add_stream_reset_result(struct sctp_tmit_chunk *chk, - uint32_t resp_seq, uint32_t result); - -void -sctp_add_stream_reset_result_tsn(struct sctp_tmit_chunk *chk, - uint32_t resp_seq, uint32_t result, - uint32_t send_una, uint32_t recv_next); +sctp_add_stream_reset_result_tsn(struct sctp_tmit_chunk *, + uint32_t, uint32_t, uint32_t, uint32_t); int -sctp_send_str_reset_req(struct sctp_tcb *stcb, - int number_entries, uint16_t * list, - uint8_t send_out_req, - uint8_t send_in_req, - uint8_t send_tsn_req, - uint8_t add_stream, - uint16_t adding_o, - uint16_t adding_i, uint8_t from_peer); +sctp_send_str_reset_req(struct sctp_tcb *, int, uint16_t *, uint8_t, uint8_t, + uint8_t, uint8_t, uint16_t, uint16_t, uint8_t); void sctp_send_abort(struct mbuf *, int, struct sockaddr *, struct sockaddr *, From owner-svn-src-all@FreeBSD.ORG Sat Sep 22 15:19:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D0271065674; Sat, 22 Sep 2012 15:19:11 +0000 (UTC) (envelope-from kargl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 88EF78FC25; Sat, 22 Sep 2012 15:19:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8MFJBXQ089694; Sat, 22 Sep 2012 15:19:11 GMT (envelope-from kargl@svn.freebsd.org) Received: (from kargl@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8MFJBNu089692; Sat, 22 Sep 2012 15:19:11 GMT (envelope-from kargl@svn.freebsd.org) Message-Id: <201209221519.q8MFJBNu089692@svn.freebsd.org> From: Steve Kargl Date: Sat, 22 Sep 2012 15:19:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240827 - head/lib/msun/src X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Sep 2012 15:19:11 -0000 Author: kargl Date: Sat Sep 22 15:19:11 2012 New Revision: 240827 URL: http://svn.freebsd.org/changeset/base/240827 Log: * Make STRICT_ALIGN() work for doubles as well as for floats. This only affects i386. The double case was intentionally left broken as an optimization, but we are getting closer to supporting applications and/or kernels that change the (FreeBSD i386) default rounding precision from FP_PD to FP_PE and never change it back, and this requires the STRICT_ALIGN()s that were added to support FP_PE to actually work in all precisions. * Remove an extraneous semicolon at the end of a macro that was supposed to be function-like. Submitted by: bde Approved by: das (mentor) Modified: head/lib/msun/src/math_private.h Modified: head/lib/msun/src/math_private.h ============================================================================== --- head/lib/msun/src/math_private.h Sat Sep 22 14:39:20 2012 (r240826) +++ head/lib/msun/src/math_private.h Sat Sep 22 15:19:11 2012 (r240827) @@ -224,7 +224,7 @@ do { \ #define STRICT_ASSIGN(type, lval, rval) do { \ volatile type __lval; \ \ - if (sizeof(type) >= sizeof(double)) \ + if (sizeof(type) >= sizeof(long double)) \ (lval) = (rval); \ else { \ __lval = (rval); \ @@ -241,7 +241,7 @@ do { \ fp_prec_t __oprec; \ \ if ((__oprec = fpgetprec()) != FP_PE) \ - fpsetprec(FP_PE); + fpsetprec(FP_PE) #define RETURNI(x) do { \ __retval = (x); \ if (__oprec != FP_PE) \ From owner-svn-src-all@FreeBSD.ORG Sat Sep 22 15:38:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D765C106566B; Sat, 22 Sep 2012 15:38:30 +0000 (UTC) (envelope-from kargl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A98DD8FC0C; Sat, 22 Sep 2012 15:38:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8MFcUe2092627; Sat, 22 Sep 2012 15:38:30 GMT (envelope-from kargl@svn.freebsd.org) Received: (from kargl@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8MFcUwM092623; Sat, 22 Sep 2012 15:38:30 GMT (envelope-from kargl@svn.freebsd.org) Message-Id: <201209221538.q8MFcUwM092623@svn.freebsd.org> From: Steve Kargl Date: Sat, 22 Sep 2012 15:38:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240828 - head/lib/msun/src X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Sep 2012 15:38:31 -0000 Author: kargl Date: Sat Sep 22 15:38:29 2012 New Revision: 240828 URL: http://svn.freebsd.org/changeset/base/240828 Log: * Use ENTERI() and RETURNI() to toggle the rounding precision if necessary, so that cosl(), sinl() and tanl() work on i386 even for naive callers. Suggested by: bde Reviewed by: bde Approved by: das (mentor) Modified: head/lib/msun/src/s_cosl.c head/lib/msun/src/s_sinl.c head/lib/msun/src/s_tanl.c Modified: head/lib/msun/src/s_cosl.c ============================================================================== --- head/lib/msun/src/s_cosl.c Sat Sep 22 15:19:11 2012 (r240827) +++ head/lib/msun/src/s_cosl.c Sat Sep 22 15:38:29 2012 (r240828) @@ -33,6 +33,9 @@ __FBSDID("$FreeBSD$"); */ #include +#ifdef __i386__ +#include +#endif #include "math.h" #include "math_private.h" @@ -63,9 +66,11 @@ cosl(long double x) if (z.bits.exp == 32767) return ((x - x) / (x - x)); + ENTERI(); + /* Optimize the case where x is already within range. */ if (z.e < M_PI_4) - return (__kernel_cosl(z.e, 0)); + RETURNI(__kernel_cosl(z.e, 0)); e0 = __ieee754_rem_pio2l(x, y); hi = y[0]; @@ -86,5 +91,5 @@ cosl(long double x) break; } - return (hi); + RETURNI(hi); } Modified: head/lib/msun/src/s_sinl.c ============================================================================== --- head/lib/msun/src/s_sinl.c Sat Sep 22 15:19:11 2012 (r240827) +++ head/lib/msun/src/s_sinl.c Sat Sep 22 15:38:29 2012 (r240828) @@ -28,6 +28,9 @@ __FBSDID("$FreeBSD$"); #include +#ifdef __i386__ +#include +#endif #include "math.h" #include "math_private.h" @@ -59,10 +62,12 @@ sinl(long double x) if (z.bits.exp == 32767) return ((x - x) / (x - x)); + ENTERI(); + /* Optimize the case where x is already within range. */ if (z.e < M_PI_4) { hi = __kernel_sinl(z.e, 0, 0); - return (s ? -hi : hi); + RETURNI(s ? -hi : hi); } e0 = __ieee754_rem_pio2l(x, y); @@ -84,5 +89,5 @@ sinl(long double x) break; } - return (hi); + RETURNI(hi); } Modified: head/lib/msun/src/s_tanl.c ============================================================================== --- head/lib/msun/src/s_tanl.c Sat Sep 22 15:19:11 2012 (r240827) +++ head/lib/msun/src/s_tanl.c Sat Sep 22 15:38:29 2012 (r240828) @@ -34,6 +34,9 @@ __FBSDID("$FreeBSD$"); */ #include +#ifdef __i386__ +#include +#endif #include "math.h" #include "math_private.h" @@ -65,10 +68,12 @@ tanl(long double x) if (z.bits.exp == 32767) return ((x - x) / (x - x)); + ENTERI(); + /* Optimize the case where x is already within range. */ if (z.e < M_PI_4) { hi = __kernel_tanl(z.e, 0, 0); - return (s ? -hi : hi); + RETURNI(s ? -hi : hi); } e0 = __ieee754_rem_pio2l(x, y); @@ -86,5 +91,5 @@ tanl(long double x) break; } - return (hi); + RETURNI(hi); } From owner-svn-src-all@FreeBSD.ORG Sat Sep 22 17:32:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D0DE9106566C; Sat, 22 Sep 2012 17:32:40 +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 BC1628FC15; Sat, 22 Sep 2012 17:32:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8MHWeMm009505; Sat, 22 Sep 2012 17:32:40 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8MHWecd009503; Sat, 22 Sep 2012 17:32:40 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201209221732.q8MHWecd009503@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 22 Sep 2012 17:32:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240829 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Sep 2012 17:32:40 -0000 Author: pjd Date: Sat Sep 22 17:32:40 2012 New Revision: 240829 URL: http://svn.freebsd.org/changeset/base/240829 Log: As in r226967, r226987 and r232401 changes to UFS and TMPFS remove cache entries associated with the source and the target of rename(). MFC after: 1 week Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sat Sep 22 15:38:29 2012 (r240828) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sat Sep 22 17:32:40 2012 (r240829) @@ -3931,6 +3931,9 @@ top: if (error == 0) { cache_purge(sdvp); cache_purge(tdvp); + cache_purge(ZTOV(szp)); + if (tzp) + cache_purge(ZTOV(tzp)); } #endif } From owner-svn-src-all@FreeBSD.ORG Sat Sep 22 17:41:56 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AF2B41065670; Sat, 22 Sep 2012 17:41:56 +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 9B0448FC08; Sat, 22 Sep 2012 17:41:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8MHfuSX011071; Sat, 22 Sep 2012 17:41:56 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8MHfuoZ011069; Sat, 22 Sep 2012 17:41:56 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201209221741.q8MHfuoZ011069@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 22 Sep 2012 17:41:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240830 - head/sys/contrib/rdma X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Sep 2012 17:41:56 -0000 Author: pjd Date: Sat Sep 22 17:41:56 2012 New Revision: 240830 URL: http://svn.freebsd.org/changeset/base/240830 Log: Fix an obvious typo. Modified: head/sys/contrib/rdma/rdma_addr.c Modified: head/sys/contrib/rdma/rdma_addr.c ============================================================================== --- head/sys/contrib/rdma/rdma_addr.c Sat Sep 22 17:32:40 2012 (r240829) +++ head/sys/contrib/rdma/rdma_addr.c Sat Sep 22 17:41:56 2012 (r240830) @@ -173,7 +173,7 @@ static void addr_send_arp(struct sockadd *dst = *dst_in; rtalloc(&iproute); - if (iproute.ro_rt == NULL); + if (iproute.ro_rt == NULL) return; arpresolve(iproute.ro_rt->rt_ifp, iproute.ro_rt, NULL, From owner-svn-src-all@FreeBSD.ORG Sat Sep 22 17:42:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 047FA106567E; Sat, 22 Sep 2012 17:42:55 +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 7AB208FC0A; Sat, 22 Sep 2012 17:42:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8MHgs10011232; Sat, 22 Sep 2012 17:42:54 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8MHgsAQ011229; Sat, 22 Sep 2012 17:42:54 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201209221742.q8MHgsAQ011229@svn.freebsd.org> From: Andriy Gapon Date: Sat, 22 Sep 2012 17:42:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240831 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Sep 2012 17:42:55 -0000 Author: avg Date: Sat Sep 22 17:42:53 2012 New Revision: 240831 URL: http://svn.freebsd.org/changeset/base/240831 Log: zfs: allow a zvol to be used as a pool vdev, again Do this by checking if spa_namespace_lock is already held and not taking it again in that case. Add a comment explaining why that is done and why it is safe. Reviewed by: pjd MFC after: 24 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Sat Sep 22 17:41:56 2012 (r240830) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Sat Sep 22 17:42:53 2012 (r240831) @@ -878,27 +878,36 @@ zvol_open(struct g_provider *pp, int fla { zvol_state_t *zv; int err = 0; + boolean_t locked = B_FALSE; - if (MUTEX_HELD(&spa_namespace_lock)) { - /* - * If the spa_namespace_lock is being held, it means that ZFS - * is trying to open ZVOL as its VDEV. This is not supported. - */ - return (EOPNOTSUPP); + /* + * Protect against recursively entering spa_namespace_lock + * when spa_open() is used for a pool on a (local) ZVOL(s). + * This is needed since we replaced upstream zfsdev_state_lock + * with spa_namespace_lock in the ZVOL code. + * We are using the same trick as spa_open(). + * Note that calls in zvol_first_open which need to resolve + * pool name to a spa object will enter spa_open() + * recursively, but that function already has all the + * necessary protection. + */ + if (!MUTEX_HELD(&spa_namespace_lock)) { + mutex_enter(&spa_namespace_lock); + locked = B_TRUE; } - mutex_enter(&spa_namespace_lock); - zv = pp->private; if (zv == NULL) { - mutex_exit(&spa_namespace_lock); + if (locked) + mutex_exit(&spa_namespace_lock); return (ENXIO); } if (zv->zv_total_opens == 0) err = zvol_first_open(zv); if (err) { - mutex_exit(&spa_namespace_lock); + if (locked) + mutex_exit(&spa_namespace_lock); return (err); } if ((flag & FWRITE) && (zv->zv_flags & ZVOL_RDONLY)) { @@ -920,13 +929,15 @@ zvol_open(struct g_provider *pp, int fla #endif zv->zv_total_opens += count; - mutex_exit(&spa_namespace_lock); + if (locked) + mutex_exit(&spa_namespace_lock); return (err); out: if (zv->zv_total_opens == 0) zvol_last_close(zv); - mutex_exit(&spa_namespace_lock); + if (locked) + mutex_exit(&spa_namespace_lock); return (err); } @@ -936,12 +947,18 @@ zvol_close(struct g_provider *pp, int fl { zvol_state_t *zv; int error = 0; + boolean_t locked = B_FALSE; - mutex_enter(&spa_namespace_lock); + /* See comment in zvol_open(). */ + if (!MUTEX_HELD(&spa_namespace_lock)) { + mutex_enter(&spa_namespace_lock); + locked = B_TRUE; + } zv = pp->private; if (zv == NULL) { - mutex_exit(&spa_namespace_lock); + if (locked) + mutex_exit(&spa_namespace_lock); return (ENXIO); } @@ -964,7 +981,8 @@ zvol_close(struct g_provider *pp, int fl if (zv->zv_total_opens == 0) zvol_last_close(zv); - mutex_exit(&spa_namespace_lock); + if (locked) + mutex_exit(&spa_namespace_lock); return (error); } From owner-svn-src-all@FreeBSD.ORG Sat Sep 22 17:46:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 32DE0106566B; Sat, 22 Sep 2012 17:46:54 +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 1FD5A8FC08; Sat, 22 Sep 2012 17:46:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8MHkrAe011730; Sat, 22 Sep 2012 17:46:53 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8MHkrCh011728; Sat, 22 Sep 2012 17:46:53 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201209221746.q8MHkrCh011728@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 22 Sep 2012 17:46:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240832 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Sep 2012 17:46:54 -0000 Author: pjd Date: Sat Sep 22 17:46:53 2012 New Revision: 240832 URL: http://svn.freebsd.org/changeset/base/240832 Log: Make the example a bit more pretty. Modified: head/share/man/man4/ip6.4 Modified: head/share/man/man4/ip6.4 ============================================================================== --- head/share/man/man4/ip6.4 Sat Sep 22 17:42:53 2012 (r240831) +++ head/share/man/man4/ip6.4 Sat Sep 22 17:46:53 2012 (r240832) @@ -570,7 +570,8 @@ struct iovec iov[2]; u_char buf[BUFSIZ]; struct cmsghdr *cm; struct msghdr m; -int found, optval; +int optval; +bool found; u_char data[2048]; /* Create socket. */ @@ -597,8 +598,8 @@ if (setsockopt(s, IPPROTO_IPV6, IPV6_HOP sizeof(optval)) == -1) err(1, "setsockopt"); -found = 0; -while (!found) { +found = false; +do { if (recvmsg(s, &m, 0) == -1) err(1, "recvmsg"); for (cm = CMSG_FIRSTHDR(&m); cm != NULL; @@ -606,13 +607,13 @@ while (!found) { if (cm->cmsg_level == IPPROTO_IPV6 && cm->cmsg_type == IPV6_HOPLIMIT && cm->cmsg_len == CMSG_LEN(sizeof(int))) { - found = 1; + found = true; (void)printf("hop limit: %d\en", *(int *)CMSG_DATA(cm)); break; } } -} +} while (!found); .Ed .Sh DIAGNOSTICS A socket operation may fail with one of the following errors returned: From owner-svn-src-all@FreeBSD.ORG Sat Sep 22 17:47:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A9F7D1065672; Sat, 22 Sep 2012 17:47:38 +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 95F448FC12; Sat, 22 Sep 2012 17:47:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8MHlcsY011852; Sat, 22 Sep 2012 17:47:38 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8MHlcsq011850; Sat, 22 Sep 2012 17:47:38 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201209221747.q8MHlcsq011850@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 22 Sep 2012 17:47:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240833 - head/contrib/groff/tmac X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Sep 2012 17:47:38 -0000 Author: pjd Date: Sat Sep 22 17:47:37 2012 New Revision: 240833 URL: http://svn.freebsd.org/changeset/base/240833 Log: Add libsbuf. Modified: head/contrib/groff/tmac/doc-syms Modified: head/contrib/groff/tmac/doc-syms ============================================================================== --- head/contrib/groff/tmac/doc-syms Sat Sep 22 17:46:53 2012 (r240832) +++ head/contrib/groff/tmac/doc-syms Sat Sep 22 17:47:37 2012 (r240833) @@ -812,6 +812,7 @@ .ds doc-str-Lb-librpcsec_gss RPC GSS-API Authentication Library (librpcsec_gss, \-lrpcsec_gss) .ds doc-str-Lb-librpcsvc RPC Service Library (librpcsvc, \-lrpcsvc) .ds doc-str-Lb-librt \*[Px] \*[doc-str-Lb]Real-time Library (librt, \-lrt) +.ds doc-str-Lb-libsbuf Safe String Composition Library (libsbuf, \-lsbuf) .ds doc-str-Lb-libsdp Bluetooth Service Discovery Protocol User Library (libsdp, \-lsdp) .ds doc-str-Lb-libssp Buffer Overflow Protection Library (libssp, \-lssp) .ds doc-str-Lb-libSystem System Library (libSystem, \-lSystem) From owner-svn-src-all@FreeBSD.ORG Sat Sep 22 17:49:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5C088106566B; Sat, 22 Sep 2012 17:49:26 +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 480A68FC21; Sat, 22 Sep 2012 17:49:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8MHnQjK012105; Sat, 22 Sep 2012 17:49:26 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8MHnQgx012102; Sat, 22 Sep 2012 17:49:26 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201209221749.q8MHnQgx012102@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 22 Sep 2012 17:49:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240834 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Sep 2012 17:49:26 -0000 Author: pjd Date: Sat Sep 22 17:49:25 2012 New Revision: 240834 URL: http://svn.freebsd.org/changeset/base/240834 Log: Add rounddown2() macro similar to the roundup2() macro. Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Sat Sep 22 17:47:37 2012 (r240833) +++ head/sys/sys/param.h Sat Sep 22 17:49:25 2012 (r240834) @@ -275,6 +275,7 @@ #endif #define nitems(x) (sizeof((x)) / sizeof((x)[0])) #define rounddown(x, y) (((x)/(y))*(y)) +#define rounddown2(x, y) ((x)&(~((y)-1))) /* if y is power of two */ #define roundup(x, y) ((((x)+((y)-1))/(y))*(y)) /* to any y */ #define roundup2(x, y) (((x)+((y)-1))&(~((y)-1))) /* if y is powers of two */ #define powerof2(x) ((((x)-1)&(x))==0) From owner-svn-src-all@FreeBSD.ORG Sat Sep 22 18:47:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0FE0B106566C; Sat, 22 Sep 2012 18:47:15 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EF3BD8FC1D; Sat, 22 Sep 2012 18:47:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8MIlEOY019459; Sat, 22 Sep 2012 18:47:14 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8MIlEwo019457; Sat, 22 Sep 2012 18:47:14 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201209221847.q8MIlEwo019457@svn.freebsd.org> From: Gleb Smirnoff Date: Sat, 22 Sep 2012 18:47:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240835 - head/sys/contrib/altq/altq X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Sep 2012 18:47:15 -0000 Author: glebius Date: Sat Sep 22 18:47:14 2012 New Revision: 240835 URL: http://svn.freebsd.org/changeset/base/240835 Log: Use M_NOWAIT in wtab_alloc(), too. Convert panic() to a soft failure here. wtab_alloc() is used by red_alloc(), which can fail. Reported by: Kim Culhan Modified: head/sys/contrib/altq/altq/altq_red.c Modified: head/sys/contrib/altq/altq/altq_red.c ============================================================================== --- head/sys/contrib/altq/altq/altq_red.c Sat Sep 22 17:49:25 2012 (r240834) +++ head/sys/contrib/altq/altq/altq_red.c Sat Sep 22 18:47:14 2012 (r240835) @@ -235,6 +235,13 @@ red_alloc(int weight, int inv_pmax, int if (rp == NULL) return (NULL); + /* allocate weight table */ + rp->red_wtab = wtab_alloc(rp->red_weight); + if (rp->red_wtab == NULL) { + free(rp, M_DEVBUF); + return (NULL); + } + rp->red_avg = 0; rp->red_idle = 1; @@ -301,9 +308,6 @@ red_alloc(int weight, int inv_pmax, int rp->red_probd = (2 * (rp->red_thmax - rp->red_thmin) * rp->red_inv_pmax) << FP_SHIFT; - /* allocate weight table */ - rp->red_wtab = wtab_alloc(rp->red_weight); - microtime(&rp->red_last); return (rp); } @@ -638,10 +642,9 @@ wtab_alloc(int weight) return (w); } - w = malloc(sizeof(struct wtab), M_DEVBUF, M_WAITOK); + w = malloc(sizeof(struct wtab), M_DEVBUF, M_NOWAIT | M_ZERO); if (w == NULL) - panic("wtab_alloc: malloc failed!"); - bzero(w, sizeof(struct wtab)); + return (NULL); w->w_weight = weight; w->w_refcount = 1; w->w_next = wtab_list; From owner-svn-src-all@FreeBSD.ORG Sat Sep 22 19:03:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2776A106564A; Sat, 22 Sep 2012 19:03:12 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 13BED8FC12; Sat, 22 Sep 2012 19:03:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8MJ3BL6022254; Sat, 22 Sep 2012 19:03:11 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8MJ3BuC022250; Sat, 22 Sep 2012 19:03:11 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201209221903.q8MJ3BuC022250@svn.freebsd.org> From: Gleb Smirnoff Date: Sat, 22 Sep 2012 19:03:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240836 - head/sys/netpfil/pf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Sep 2012 19:03:12 -0000 Author: glebius Date: Sat Sep 22 19:03:11 2012 New Revision: 240836 URL: http://svn.freebsd.org/changeset/base/240836 Log: EBUSY is a better reply for refusing to unload pf(4) or pfsync(4). Submitted by: pluknet Modified: head/sys/netpfil/pf/if_pfsync.c head/sys/netpfil/pf/pf_ioctl.c Modified: head/sys/netpfil/pf/if_pfsync.c ============================================================================== --- head/sys/netpfil/pf/if_pfsync.c Sat Sep 22 18:47:14 2012 (r240835) +++ head/sys/netpfil/pf/if_pfsync.c Sat Sep 22 19:03:11 2012 (r240836) @@ -2371,7 +2371,7 @@ pfsync_modevent(module_t mod, int type, /* * Module should not be unloaded due to race conditions. */ - error = EPERM; + error = EBUSY; break; case MOD_UNLOAD: pfsync_uninit(); Modified: head/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- head/sys/netpfil/pf/pf_ioctl.c Sat Sep 22 18:47:14 2012 (r240835) +++ head/sys/netpfil/pf/pf_ioctl.c Sat Sep 22 19:03:11 2012 (r240836) @@ -3756,7 +3756,7 @@ pf_modevent(module_t mod, int type, void /* * Module should not be unloaded due to race conditions. */ - error = EPERM; + error = EBUSY; break; case MOD_UNLOAD: error = pf_unload(); From owner-svn-src-all@FreeBSD.ORG Sat Sep 22 21:13:35 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4FEF4106566B; Sat, 22 Sep 2012 21:13:35 +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 30B148FC08; Sat, 22 Sep 2012 21:13:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8MLDZKd042970; Sat, 22 Sep 2012 21:13:35 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8MLDYT7042966; Sat, 22 Sep 2012 21:13:34 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201209222113.q8MLDYT7042966@svn.freebsd.org> From: Andriy Gapon Date: Sat, 22 Sep 2012 21:13:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240837 - in stable/9/sys: boot/zfs cddl/boot/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Sep 2012 21:13:35 -0000 Author: avg Date: Sat Sep 22 21:13:34 2012 New Revision: 240837 URL: http://svn.freebsd.org/changeset/base/240837 Log: MFC r240346,240356: zfs boot: bring zap_leaf_chunk field names in sync with kernel code Modified: stable/9/sys/boot/zfs/zfs.c stable/9/sys/boot/zfs/zfsimpl.c stable/9/sys/cddl/boot/zfs/zfsimpl.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/boot/ (props changed) Modified: stable/9/sys/boot/zfs/zfs.c ============================================================================== --- stable/9/sys/boot/zfs/zfs.c Sat Sep 22 19:03:11 2012 (r240836) +++ stable/9/sys/boot/zfs/zfs.c Sat Sep 22 21:13:34 2012 (r240837) @@ -317,7 +317,7 @@ zfs_readdir(struct open_file *f, struct if (zc->l_entry.le_type != ZAP_CHUNK_ENTRY) goto fzap_next; - namelen = zc->l_entry.le_name_length; + namelen = zc->l_entry.le_name_numints; if (namelen > sizeof(d->d_name)) namelen = sizeof(d->d_name); Modified: stable/9/sys/boot/zfs/zfsimpl.c ============================================================================== --- stable/9/sys/boot/zfs/zfsimpl.c Sat Sep 22 19:03:11 2012 (r240836) +++ stable/9/sys/boot/zfs/zfsimpl.c Sat Sep 22 21:13:34 2012 (r240837) @@ -1179,7 +1179,7 @@ fzap_name_equal(const zap_leaf_t *zl, co const zap_leaf_chunk_t *nc; const char *p; - namelen = zc->l_entry.le_name_length; + namelen = zc->l_entry.le_name_numints; nc = &ZAP_LEAF_CHUNK(zl, zc->l_entry.le_name_chunk); p = name; @@ -1392,7 +1392,7 @@ fzap_list(const spa_t *spa, const dnode_ zc = &ZAP_LEAF_CHUNK(&zl, j); if (zc->l_entry.le_type != ZAP_CHUNK_ENTRY) continue; - namelen = zc->l_entry.le_name_length; + namelen = zc->l_entry.le_name_numints; if (namelen > sizeof(name)) namelen = sizeof(name); @@ -1491,7 +1491,7 @@ fzap_name_copy(const zap_leaf_t *zl, con const zap_leaf_chunk_t *nc; char *p; - namelen = zc->l_entry.le_name_length; + namelen = zc->l_entry.le_name_numints; nc = &ZAP_LEAF_CHUNK(zl, zc->l_entry.le_name_chunk); p = name; Modified: stable/9/sys/cddl/boot/zfs/zfsimpl.h ============================================================================== --- stable/9/sys/cddl/boot/zfs/zfsimpl.h Sat Sep 22 19:03:11 2012 (r240836) +++ stable/9/sys/cddl/boot/zfs/zfsimpl.h Sat Sep 22 21:13:34 2012 (r240837) @@ -1171,12 +1171,12 @@ typedef struct zap_leaf_phys { typedef union zap_leaf_chunk { struct zap_leaf_entry { uint8_t le_type; /* always ZAP_CHUNK_ENTRY */ - uint8_t le_int_size; /* size of ints */ + uint8_t le_value_intlen; /* size of ints */ uint16_t le_next; /* next entry in hash chain */ uint16_t le_name_chunk; /* first chunk of the name */ - uint16_t le_name_length; /* bytes in name, incl null */ + uint16_t le_name_numints; /* bytes in name, incl null */ uint16_t le_value_chunk; /* first chunk of the value */ - uint16_t le_value_length; /* value length in ints */ + uint16_t le_value_numints; /* value length in ints */ uint32_t le_cd; /* collision differentiator */ uint64_t le_hash; /* hash value of the name */ } l_entry; From owner-svn-src-all@FreeBSD.ORG Sat Sep 22 21:14:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6422D1065672; Sat, 22 Sep 2012 21:14:54 +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 452A88FC0A; Sat, 22 Sep 2012 21:14:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8MLEssq043222; Sat, 22 Sep 2012 21:14:54 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8MLEsVp043218; Sat, 22 Sep 2012 21:14:54 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201209222114.q8MLEsVp043218@svn.freebsd.org> From: Andriy Gapon Date: Sat, 22 Sep 2012 21:14: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: r240838 - in stable/8/sys: boot/zfs cddl/boot/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Sep 2012 21:14:54 -0000 Author: avg Date: Sat Sep 22 21:14:53 2012 New Revision: 240838 URL: http://svn.freebsd.org/changeset/base/240838 Log: MFC r240346,240356: zfs boot: bring zap_leaf_chunk field names in sync with kernel code Modified: stable/8/sys/boot/zfs/zfs.c stable/8/sys/boot/zfs/zfsimpl.c stable/8/sys/cddl/boot/zfs/zfsimpl.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/ (props changed) Modified: stable/8/sys/boot/zfs/zfs.c ============================================================================== --- stable/8/sys/boot/zfs/zfs.c Sat Sep 22 21:13:34 2012 (r240837) +++ stable/8/sys/boot/zfs/zfs.c Sat Sep 22 21:14:53 2012 (r240838) @@ -317,7 +317,7 @@ zfs_readdir(struct open_file *f, struct if (zc->l_entry.le_type != ZAP_CHUNK_ENTRY) goto fzap_next; - namelen = zc->l_entry.le_name_length; + namelen = zc->l_entry.le_name_numints; if (namelen > sizeof(d->d_name)) namelen = sizeof(d->d_name); Modified: stable/8/sys/boot/zfs/zfsimpl.c ============================================================================== --- stable/8/sys/boot/zfs/zfsimpl.c Sat Sep 22 21:13:34 2012 (r240837) +++ stable/8/sys/boot/zfs/zfsimpl.c Sat Sep 22 21:14:53 2012 (r240838) @@ -1179,7 +1179,7 @@ fzap_name_equal(const zap_leaf_t *zl, co const zap_leaf_chunk_t *nc; const char *p; - namelen = zc->l_entry.le_name_length; + namelen = zc->l_entry.le_name_numints; nc = &ZAP_LEAF_CHUNK(zl, zc->l_entry.le_name_chunk); p = name; @@ -1392,7 +1392,7 @@ fzap_list(const spa_t *spa, const dnode_ zc = &ZAP_LEAF_CHUNK(&zl, j); if (zc->l_entry.le_type != ZAP_CHUNK_ENTRY) continue; - namelen = zc->l_entry.le_name_length; + namelen = zc->l_entry.le_name_numints; if (namelen > sizeof(name)) namelen = sizeof(name); @@ -1491,7 +1491,7 @@ fzap_name_copy(const zap_leaf_t *zl, con const zap_leaf_chunk_t *nc; char *p; - namelen = zc->l_entry.le_name_length; + namelen = zc->l_entry.le_name_numints; nc = &ZAP_LEAF_CHUNK(zl, zc->l_entry.le_name_chunk); p = name; Modified: stable/8/sys/cddl/boot/zfs/zfsimpl.h ============================================================================== --- stable/8/sys/cddl/boot/zfs/zfsimpl.h Sat Sep 22 21:13:34 2012 (r240837) +++ stable/8/sys/cddl/boot/zfs/zfsimpl.h Sat Sep 22 21:14:53 2012 (r240838) @@ -1171,12 +1171,12 @@ typedef struct zap_leaf_phys { typedef union zap_leaf_chunk { struct zap_leaf_entry { uint8_t le_type; /* always ZAP_CHUNK_ENTRY */ - uint8_t le_int_size; /* size of ints */ + uint8_t le_value_intlen; /* size of ints */ uint16_t le_next; /* next entry in hash chain */ uint16_t le_name_chunk; /* first chunk of the name */ - uint16_t le_name_length; /* bytes in name, incl null */ + uint16_t le_name_numints; /* bytes in name, incl null */ uint16_t le_value_chunk; /* first chunk of the value */ - uint16_t le_value_length; /* value length in ints */ + uint16_t le_value_numints; /* value length in ints */ uint32_t le_cd; /* collision differentiator */ uint64_t le_hash; /* hash value of the name */ } l_entry; From owner-svn-src-all@FreeBSD.ORG Sat Sep 22 21:18:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 94C7C1065673; Sat, 22 Sep 2012 21:18:31 +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 8023F8FC0A; Sat, 22 Sep 2012 21:18:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8MLIVFD044483; Sat, 22 Sep 2012 21:18:31 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8MLIVQG044481; Sat, 22 Sep 2012 21:18:31 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201209222118.q8MLIVQG044481@svn.freebsd.org> From: Andriy Gapon Date: Sat, 22 Sep 2012 21:18:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240839 - stable/9/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Sep 2012 21:18:31 -0000 Author: avg Date: Sat Sep 22 21:18:30 2012 New Revision: 240839 URL: http://svn.freebsd.org/changeset/base/240839 Log: MFC r240513: sched_ule: fix inverted condition in reporting of priority lending via ktr Modified: stable/9/sys/kern/sched_ule.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/sched_ule.c ============================================================================== --- stable/9/sys/kern/sched_ule.c Sat Sep 22 21:14:53 2012 (r240838) +++ stable/9/sys/kern/sched_ule.c Sat Sep 22 21:18:30 2012 (r240839) @@ -1647,7 +1647,7 @@ sched_thread_priority(struct thread *td, "prio:%d", td->td_priority, "new prio:%d", prio, KTR_ATTR_LINKED, sched_tdname(curthread)); SDT_PROBE3(sched, , , change_pri, td, td->td_proc, prio); - if (td != curthread && prio > td->td_priority) { + if (td != curthread && prio < td->td_priority) { KTR_POINT3(KTR_SCHED, "thread", sched_tdname(curthread), "lend prio", "prio:%d", td->td_priority, "new prio:%d", prio, KTR_ATTR_LINKED, sched_tdname(td)); From owner-svn-src-all@FreeBSD.ORG Sat Sep 22 21:19:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4F336106566C; Sat, 22 Sep 2012 21:19:50 +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 3AB9C8FC14; Sat, 22 Sep 2012 21:19:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8MLJoQ5044758; Sat, 22 Sep 2012 21:19:50 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8MLJoGN044756; Sat, 22 Sep 2012 21:19:50 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201209222119.q8MLJoGN044756@svn.freebsd.org> From: Andriy Gapon Date: Sat, 22 Sep 2012 21:19: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: r240840 - stable/8/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Sep 2012 21:19:50 -0000 Author: avg Date: Sat Sep 22 21:19:49 2012 New Revision: 240840 URL: http://svn.freebsd.org/changeset/base/240840 Log: MFC r240513: sched_ule: fix inverted condition in reporting of priority lending via ktr Modified: stable/8/sys/kern/sched_ule.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/kern/ (props changed) Modified: stable/8/sys/kern/sched_ule.c ============================================================================== --- stable/8/sys/kern/sched_ule.c Sat Sep 22 21:18:30 2012 (r240839) +++ stable/8/sys/kern/sched_ule.c Sat Sep 22 21:19:49 2012 (r240840) @@ -1599,7 +1599,7 @@ sched_thread_priority(struct thread *td, "prio:%d", td->td_priority, "new prio:%d", prio, KTR_ATTR_LINKED, sched_tdname(curthread)); SDT_PROBE3(sched, , , change_pri, td, td->td_proc, prio); - if (td != curthread && prio > td->td_priority) { + if (td != curthread && prio < td->td_priority) { KTR_POINT3(KTR_SCHED, "thread", sched_tdname(curthread), "lend prio", "prio:%d", td->td_priority, "new prio:%d", prio, KTR_ATTR_LINKED, sched_tdname(td)); From owner-svn-src-all@FreeBSD.ORG Sat Sep 22 21:26:35 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 33CAE106564A; Sat, 22 Sep 2012 21:26:35 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail03.syd.optusnet.com.au (mail03.syd.optusnet.com.au [211.29.132.184]) by mx1.freebsd.org (Postfix) with ESMTP id A74848FC08; Sat, 22 Sep 2012 21:26:34 +0000 (UTC) Received: from c122-106-157-84.carlnfd1.nsw.optusnet.com.au (c122-106-157-84.carlnfd1.nsw.optusnet.com.au [122.106.157.84]) by mail03.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q8MLQQl0022051 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 23 Sep 2012 07:26:26 +1000 Date: Sun, 23 Sep 2012 07:26:26 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Steve Kargl In-Reply-To: <201209221519.q8MFJBNu089692@svn.freebsd.org> Message-ID: <20120923072608.J1963@besplex.bde.org> References: <201209221519.q8MFJBNu089692@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r240827 - head/lib/msun/src X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Sep 2012 21:26:35 -0000 On Sat, 22 Sep 2012, Steve Kargl wrote: > Log: > * Make STRICT_ALIGN() work for doubles as well as for floats. This > only affects i386. The double case was intentionally left broken > as an optimization, but we are getting closer to supporting > applications and/or kernels that change the (FreeBSD i386) default > rounding precision from FP_PD to FP_PE and never change it back, > and this requires the STRICT_ALIGN()s that were added to support > FP_PE to actually work in all precisions. > > * Remove an extraneous semicolon at the end of a macro that was > supposed to be function-like. > > Submitted by: bde > Approved by: das (mentor) Thanks. Bruce From owner-svn-src-all@FreeBSD.ORG Sat Sep 22 21:34:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AB51B106566B; Sat, 22 Sep 2012 21:34:48 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7D84D8FC15; Sat, 22 Sep 2012 21:34:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8MLYmaE047525; Sat, 22 Sep 2012 21:34:48 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8MLYmkK047523; Sat, 22 Sep 2012 21:34:48 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201209222134.q8MLYmkK047523@svn.freebsd.org> From: Eitan Adler Date: Sat, 22 Sep 2012 21:34:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240841 - head/share/man/man7 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Sep 2012 21:34:48 -0000 Author: eadler Date: Sat Sep 22 21:34:46 2012 New Revision: 240841 URL: http://svn.freebsd.org/changeset/base/240841 Log: Remove some duplicated advice. While here increase the suggested sizes for the partition as "make universe" takes a lot more space than mentioned. Reviewed by: gavin Approved by: gjb MFC after: 3 days X-MFC-With: r240728 Modified: head/share/man/man7/development.7 Modified: head/share/man/man7/development.7 ============================================================================== --- head/share/man/man7/development.7 Sat Sep 22 21:19:49 2012 (r240840) +++ head/share/man/man7/development.7 Sat Sep 22 21:34:46 2012 (r240841) @@ -48,8 +48,6 @@ kernel. The methods described here are as applicable to production installations as it is to development environments. -You need approximately 10GB of disk space on one machine to make this work -conveniently. .Sh SETTING UP THE ENVIRONMENT ON THE MASTER SERVER Your master server should always run a stable, production version of the .Fx @@ -60,9 +58,9 @@ The last thing you want to do is to run unstable environment on your master server which could lead to a situation where you lose the environment and/or cannot recover from a mistake. .Pp -Create a huge partition called +Create a partition called .Pa /FreeBSD . -Approximately 7GB is recommended. +Approximately 20GB is recommended. This partition will contain nearly all the development environment, including the subversion tree, broken-out source, and possibly even object files. You are going to export this partition to your other machines via a @@ -86,7 +84,7 @@ Third, because it makes it far easier to environments which are described later in this document. I recommend a .Pa /usr/obj -partition of at least 5GB. +partition of at least 12GB. .Pp On the master server, use .Xr svn 1 @@ -456,10 +454,6 @@ This is a good time to also remind you t .Xr svn 1 operations you do will be done as .Dq Li root . -It is a good idea to give your -.Pa /FreeBSD -partition a lot of space (I recommend -10-15GB) precisely for that reason. .Pp .Xr cron 8 . .Sh SEE ALSO From owner-svn-src-all@FreeBSD.ORG Sat Sep 22 22:04:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BAF26106564A; Sat, 22 Sep 2012 22:04:17 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A6BCA8FC18; Sat, 22 Sep 2012 22:04:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8MM4HK4051826; Sat, 22 Sep 2012 22:04:17 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8MM4HY9051824; Sat, 22 Sep 2012 22:04:17 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201209222204.q8MM4HY9051824@svn.freebsd.org> From: Michael Tuexen Date: Sat, 22 Sep 2012 22:04:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240842 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Sep 2012 22:04:17 -0000 Author: tuexen Date: Sat Sep 22 22:04:17 2012 New Revision: 240842 URL: http://svn.freebsd.org/changeset/base/240842 Log: Fix a bug related to handling Re-config chunks. It is not true that the association can be removed if the socket is gone. MFC after: 3 days Modified: head/sys/netinet/sctp_input.c Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Sat Sep 22 21:34:46 2012 (r240841) +++ head/sys/netinet/sctp_input.c Sat Sep 22 22:04:17 2012 (r240842) @@ -5387,23 +5387,6 @@ process_control_chunks: *offset = length; return (NULL); } - if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) { - /* We are not interested anymore */ -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - so = SCTP_INP_SO(inp); - atomic_add_int(&stcb->asoc.refcnt, 1); - SCTP_TCB_UNLOCK(stcb); - SCTP_SOCKET_LOCK(so, 1); - SCTP_TCB_LOCK(stcb); - atomic_subtract_int(&stcb->asoc.refcnt, 1); -#endif - (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_30); -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - SCTP_SOCKET_UNLOCK(so, 1); -#endif - *offset = length; - return (NULL); - } if (stcb->asoc.peer_supports_strreset == 0) { /* * hmm, peer should have announced this, but From owner-svn-src-all@FreeBSD.ORG Sat Sep 22 22:16:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C5CD106564A; Sat, 22 Sep 2012 22:16:08 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EC5468FC08; Sat, 22 Sep 2012 22:16:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8MMG7ke053951; Sat, 22 Sep 2012 22:16:07 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8MMG7w2053948; Sat, 22 Sep 2012 22:16:07 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201209222216.q8MMG7w2053948@svn.freebsd.org> From: Devin Teske Date: Sat, 22 Sep 2012 22:16:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240843 - head/usr.sbin/bsdconfig/timezone/share X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Sep 2012 22:16:08 -0000 Author: dteske Date: Sat Sep 22 22:16:07 2012 New Revision: 240843 URL: http://svn.freebsd.org/changeset/base/240843 Log: jilles accurately advises that, in the context of shell redirection, the `:' builtin is processed specially and thus the `: > file' syntax for example will cause premature termination of the current shell on redirection-error. The `true' builtin on the other-hand is not included in this special processing (for compatibility reasons to satisfy legacy scripts programmed for systems where `true' is not a builtin). Change bare `: > file' syntax into `true > file' syntax to prevent premature shell termination in the event of redirection-error. NOTE: Instances of `: > file' that appear within a sub-shell have been left unmodified as these will not cause premature termination of the main script. Reviewed by: jilles, adrian (co-mentor) Approved by: adrian (co-mentor) Modified: head/usr.sbin/bsdconfig/timezone/share/zones.subr Modified: head/usr.sbin/bsdconfig/timezone/share/zones.subr ============================================================================== --- head/usr.sbin/bsdconfig/timezone/share/zones.subr Sat Sep 22 22:04:17 2012 (r240842) +++ head/usr.sbin/bsdconfig/timezone/share/zones.subr Sat Sep 22 22:16:07 2012 (r240843) @@ -610,7 +610,7 @@ f_install_zoneinfo() # Save knowledge for later if [ "$REALLYDOIT" -a $rv -eq $SUCCESS ]; then - if : 2> /dev/null > "$_PATH_DB"; then + if true 2> /dev/null > "$_PATH_DB"; then cat <<-EOF > "$_PATH_DB" $zoneinfo EOF From owner-svn-src-all@FreeBSD.ORG Sat Sep 22 22:41:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C3987106564A; Sat, 22 Sep 2012 22:41:38 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AE3308FC0A; Sat, 22 Sep 2012 22:41:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8MMfcAv057948; Sat, 22 Sep 2012 22:41:38 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8MMfcFX057941; Sat, 22 Sep 2012 22:41:38 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201209222241.q8MMfcFX057941@svn.freebsd.org> From: Andrew Turner Date: Sat, 22 Sep 2012 22:41:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240844 - in head/sys/arm: broadcom/bcm2835 lpc mv tegra ti X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Sep 2012 22:41:38 -0000 Author: andrew Date: Sat Sep 22 22:41:38 2012 New Revision: 240844 URL: http://svn.freebsd.org/changeset/base/240844 Log: Reduce the diff between the FDT implementations of initarm. This only touches whitespace and comments. Modified: head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c head/sys/arm/lpc/lpc_machdep.c head/sys/arm/mv/mv_machdep.c head/sys/arm/tegra/tegra2_machdep.c head/sys/arm/ti/ti_machdep.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c Sat Sep 22 22:16:07 2012 (r240843) +++ head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c Sat Sep 22 22:41:38 2012 (r240844) @@ -304,6 +304,9 @@ initarm(struct arm_boot_params *abp) memsize = 0; set_cpufuncs(); + /* + * Find the dtb passed in by the boot loader. + */ kmdp = preload_search_by_type("elf kernel"); if (kmdp != NULL) dtbp = MD_FETCH(kmdp, MODINFOMD_DTBP, vm_offset_t); @@ -460,9 +463,7 @@ initarm(struct arm_boot_params *abp) cpu_domains((DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL * 2)) | DOMAIN_CLIENT); - pmap_pa = kernel_l1pt.pv_pa; - setttb(kernel_l1pt.pv_pa); cpu_tlb_flushID(); cpu_domains(DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL * 2)); @@ -517,7 +518,6 @@ initarm(struct arm_boot_params *abp) init_proc0(kernelstack.pv_va); arm_vector_init(ARM_VECTORS_HIGH, ARM_VEC_ALL); - arm_dump_avail_init(memsize, sizeof(dump_avail) / sizeof(dump_avail[0])); pmap_bootstrap(freemempos, pmap_bootstrap_lastaddr, &kernel_l1pt); msgbufp = (void *)msgbufpv.pv_va; Modified: head/sys/arm/lpc/lpc_machdep.c ============================================================================== --- head/sys/arm/lpc/lpc_machdep.c Sat Sep 22 22:16:07 2012 (r240843) +++ head/sys/arm/lpc/lpc_machdep.c Sat Sep 22 22:41:38 2012 (r240844) @@ -306,7 +306,7 @@ initarm(struct arm_boot_params *abp) set_cpufuncs(); kmdp = preload_search_by_type("elf kernel"); - if (kmdp != NULL) + if (kmdp != NULL) dtbp = MD_FETCH(kmdp, MODINFOMD_DTBP, vm_offset_t); else dtbp = (vm_offset_t)NULL; @@ -318,7 +318,6 @@ initarm(struct arm_boot_params *abp) */ if (dtbp == (vm_offset_t)NULL) dtbp = (vm_offset_t)&fdt_static_dtb; - #endif if (OF_install(OFW_FDT, 0) == FALSE) @@ -427,7 +426,7 @@ initarm(struct arm_boot_params *abp) &kernel_pt_table[i]); pmap_curmaxkvaddr = l2_start + (l2size - 1) * L1_S_SIZE; - + /* Map kernel code and data */ pmap_map_chunk(l1pagetable, KERNVIRTADDR, KERNPHYSADDR, (((uint32_t)(lastaddr) - KERNVIRTADDR) + PAGE_MASK) & ~PAGE_MASK, @@ -480,7 +479,7 @@ initarm(struct arm_boot_params *abp) #endif cninit(); - + physmem = memsize / PAGE_SIZE; debugf("initarm: console initialized\n"); @@ -547,6 +546,7 @@ initarm(struct arm_boot_params *abp) /* Do basic tuning, hz etc */ init_param2(physmem); kdb_init(); + return ((void *)(kernelstack.pv_va + USPACE_SVC_STACK_TOP - sizeof(struct pcb))); } Modified: head/sys/arm/mv/mv_machdep.c ============================================================================== --- head/sys/arm/mv/mv_machdep.c Sat Sep 22 22:16:07 2012 (r240843) +++ head/sys/arm/mv/mv_machdep.c Sat Sep 22 22:41:38 2012 (r240844) @@ -301,19 +301,18 @@ initarm(struct arm_boot_params *abp) u_int l1pagetable; int i = 0, j = 0, err_devmap = 0; - lastaddr = parse_boot_param(abp); + lastaddr = parse_boot_param(abp); memsize = 0; set_cpufuncs(); /* * Find the dtb passed in by the boot loader. */ - kmdp = preload_search_by_type("elf kernel"); - if (kmdp != NULL) + kmdp = preload_search_by_type("elf kernel"); + if (kmdp != NULL) dtbp = MD_FETCH(kmdp, MODINFOMD_DTBP, vm_offset_t); else dtbp = (vm_offset_t)NULL; - #if defined(FDT_DTB_STATIC) /* @@ -429,7 +428,7 @@ initarm(struct arm_boot_params *abp) &kernel_pt_table[i]); pmap_curmaxkvaddr = l2_start + (l2size - 1) * L1_S_SIZE; - + /* Map kernel code and data */ pmap_map_chunk(l1pagetable, KERNVIRTADDR, KERNPHYSADDR, (((uint32_t)(lastaddr) - KERNVIRTADDR) + PAGE_MASK) & ~PAGE_MASK, @@ -493,7 +492,7 @@ initarm(struct arm_boot_params *abp) if (err_devmap != 0) printf("WARNING: could not fully configure devmap, error=%d\n", - err_devmap); + err_devmap); /* * Re-initialise decode windows @@ -554,6 +553,7 @@ initarm(struct arm_boot_params *abp) /* Do basic tuning, hz etc */ init_param2(physmem); kdb_init(); + return ((void *)(kernelstack.pv_va + USPACE_SVC_STACK_TOP - sizeof(struct pcb))); } Modified: head/sys/arm/tegra/tegra2_machdep.c ============================================================================== --- head/sys/arm/tegra/tegra2_machdep.c Sat Sep 22 22:16:07 2012 (r240843) +++ head/sys/arm/tegra/tegra2_machdep.c Sat Sep 22 22:41:38 2012 (r240844) @@ -344,6 +344,9 @@ initarm(struct arm_boot_params *abp) memsize = 0; set_cpufuncs(); + /* + * Find the dtb passed in by the boot loader. + */ kmdp = preload_search_by_type("elf kernel"); if (kmdp != NULL) dtbp = MD_FETCH(kmdp, MODINFOMD_DTBP, vm_offset_t); @@ -520,7 +523,7 @@ initarm(struct arm_boot_params *abp) if (err_devmap != 0) printf("WARNING: could not fully configure devmap, error=%d\n", - err_devmap); + err_devmap); /* * Pages were allocated during the secondary bootstrap for the @@ -553,8 +556,8 @@ initarm(struct arm_boot_params *abp) undefined_init(); init_proc0(kernelstack.pv_va); - arm_vector_init(ARM_VECTORS_HIGH, ARM_VEC_ALL); + arm_vector_init(ARM_VECTORS_HIGH, ARM_VEC_ALL); arm_dump_avail_init(memsize, sizeof(dump_avail) / sizeof(dump_avail[0])); pmap_bootstrap(freemempos, pmap_bootstrap_lastaddr, &kernel_l1pt); msgbufp = (void *)msgbufpv.pv_va; Modified: head/sys/arm/ti/ti_machdep.c ============================================================================== --- head/sys/arm/ti/ti_machdep.c Sat Sep 22 22:16:07 2012 (r240843) +++ head/sys/arm/ti/ti_machdep.c Sat Sep 22 22:41:38 2012 (r240844) @@ -305,13 +305,15 @@ initarm(struct arm_boot_params *abp) memsize = 0; set_cpufuncs(); - + /* + * Find the dtb passed in by the boot loader. + */ kmdp = preload_search_by_type("elf kernel"); if (kmdp != NULL) dtbp = MD_FETCH(kmdp, MODINFOMD_DTBP, vm_offset_t); else dtbp = (vm_offset_t)NULL; - + #if defined(FDT_DTB_STATIC) /* * In case the device tree blob was not retrieved (from metadata) try @@ -423,7 +425,7 @@ initarm(struct arm_boot_params *abp) &kernel_pt_table[i]); pmap_curmaxkvaddr = l2_start + (l2size - 1) * L1_S_SIZE; - + /* Map kernel code and data */ pmap_map_chunk(l1pagetable, KERNVIRTADDR, KERNPHYSADDR, (((uint32_t)(lastaddr) - KERNVIRTADDR) + PAGE_MASK) & ~PAGE_MASK, @@ -480,7 +482,7 @@ initarm(struct arm_boot_params *abp) if (err_devmap != 0) printf("WARNING: could not fully configure devmap, error=%d\n", - err_devmap); + err_devmap); /* * Pages were allocated during the secondary bootstrap for the @@ -513,8 +515,8 @@ initarm(struct arm_boot_params *abp) undefined_init(); init_proc0(kernelstack.pv_va); - arm_vector_init(ARM_VECTORS_HIGH, ARM_VEC_ALL); + arm_vector_init(ARM_VECTORS_HIGH, ARM_VEC_ALL); arm_dump_avail_init(memsize, sizeof(dump_avail) / sizeof(dump_avail[0])); pmap_bootstrap(freemempos, pmap_bootstrap_lastaddr, &kernel_l1pt); msgbufp = (void *)msgbufpv.pv_va;